SetaPDF_Core_Font_TrueType_File Parser class for TTF/OTF files

File: /SetaPDF v2/Core/Font/TrueType/File.php

Based on the OpenType specification 1.6: http://www.microsoft.com/typography/otspec/

Class hierarchy

Summary

Properties

$_entrySelector

protected SetaPDF_Core_Font_TrueType_File::$_entrySelector

$_numTables

protected SetaPDF_Core_Font_TrueType_File::$_numTables

$_rangeShift

protected SetaPDF_Core_Font_TrueType_File::$_rangeShift

$_reader

protected SetaPDF_Core_Reader_Binary SetaPDF_Core_Font_TrueType_File::$_reader

The reader instance

$_searchRange

protected SetaPDF_Core_Font_TrueType_File::$_searchRange

$_sfntVersion

protected SetaPDF_Core_Font_TrueType_File::$_sfntVersion

$_tableRecords

protected array SetaPDF_Core_Font_TrueType_File::$_tableRecords = array()

Data of tables in the TTF file


Methods

__construct()

_getUnitsPerEm()

Get the units per em.

_seekTable()

protected SetaPDF_Core_Font_TrueType_File::_seekTable (
string $tag
): void

Set the file pointer to the start byte offset position of table.

Parameters
$tag : string
 
Exceptions

Throws SetaPDF_Core_Exception

areCharsCovered()

public SetaPDF_Core_Font_TrueType_File::areCharsCovered (
array $chars
): boolean

Checks if characters are covered by this font.

Parameters
$chars : array

The chars in UTF-16BE encoding

cleanUp()

Release resources.

getEntrySelector()

Get the entry selector value.

getNumTables()

Get the number of tables.

getRangeShift()

Get the range shift value.

getReader()

Get the reader instance.

getSearchRange()

Get the search range value.

getSfntVersion()

Get the sfnt version.

getTable()

Get a tag specific table.

Parameters
$tag : string
 

getWidth()

public SetaPDF_Core_Font_TrueType_File::getWidth (
string $char
): float|boolean

Get the width of a single character/glyph.

Parameters
$char : string
 

getWidths()

public SetaPDF_Core_Font_TrueType_File::getWidths (
array $chars
): array

Get character/glyph width values.

Parameters
$chars : array

The chars in UTF-16BE encoding

isCharCovered()

public SetaPDF_Core_Font_TrueType_File::isCharCovered (
string $char
): boolean

Checks if a character is covered by this font.

Parameters
$char : string

The character in UTF-16BE encoding

isEmbeddable()

Checks if a font is embeddable.

tableExists()

public SetaPDF_Core_Font_TrueType_File::tableExists (
string $tag
): boolean

Check if a specific table exists.

Parameters
$tag : string