Properties

$allowed

$allowed : array

Allowed properties

Type

array

$readOnly

$readOnly : array

Read-only properties

Type

array

$allowedTypes

$allowedTypes : array

Array of allowed file types.

Type

array

$fullpath

$fullpath : string

Full path of font file, i.e. '/path/to/fontfile.ext'

Type

string

$dir

$dir : string

Full, absolute directory of the font file, i.e. '/some/dir/'

Type

string

$basename

$basename : string

Full basename of font file, i.e. 'fontfile.ext'

Type

string

$filename

$filename : string

Full filename of font file, i.e. 'fontfile'

Type

string

$extension

$extension : string

Font file extension, i.e. 'ext'

Type

string

$size

$size : integer

Font file size in bytes

Type

integer

$mime

$mime : string

Font file mime type

Type

string

Methods

__construct()

__construct(string  $font) : \Pop\Pdf\Build\Font\TrueType

Constructor

Instantiate a TrueType font file object based on a pre-existing font file on disk.

Parameters

string $font

Returns

\Pop\Pdf\Build\Font\TrueType

read()

read(integer  $offset = null, integer  $length = null) : string

Read data from the font file.

Parameters

integer $offset
integer $length

Returns

string

readFixed()

readFixed(integer  $mantissaBits, integer  $fractionBits, string  $bytes) : integer

Static method to read and return a fixed-point number

Parameters

integer $mantissaBits
integer $fractionBits
string $bytes

Returns

integer

readInt()

readInt(integer  $size, string  $bytes) : integer

Static method to read and return a signed integer

Parameters

integer $size
string $bytes

Returns

integer

shiftToSigned()

shiftToSigned(integer|array  $values) : integer|array

Method to shift an unpacked signed short from little endian to big endian

Parameters

integer|array $values

Returns

integer|array

toEmSpace()

toEmSpace(integer  $value) : integer

Method to convert a value to the representative value in EM.

Parameters

integer $value

Returns

integer

calcFlags()

calcFlags() : integer

Method to calculate the font flags

Returns

integer

offsetSet()

offsetSet(string  $name, mixed  $value) : void

Offset set method

Parameters

string $name
mixed $value

Throws

\InvalidArgumentException

offsetGet()

offsetGet(string  $name) : mixed

Offset get method

Parameters

string $name

Throws

\InvalidArgumentException

Returns

mixed

parseTtfTable()

parseTtfTable() : void

Method to parse the TTF header and table of the TrueType font file.

parseName()

parseName() : void

Method to parse the TTF info of the TrueType font file from the name table.

parseCommonTables()

parseCommonTables() : void

Method to parse the common tables of the TrueType font file.

parseRequiredTables()

parseRequiredTables() : void

Method to parse the required tables of the TrueType font file.