\Pop\Pdf\Build\FontAbstractFont

Font abstract class

Summary

Methods
Properties
Constants
__construct()
read()
readFixed()
readInt()
shiftToSigned()
toEmSpace()
getWidthsForGlyphs()
getStringWidth()
calcFlags()
offsetSet()
offsetGet()
No public properties found
No constants found
No protected methods found
$allowed
$readOnly
$allowedTypes
$fullpath
$dir
$basename
$filename
$extension
$size
$mime
N/A
No private methods found
No private properties found
N/A

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) 

Constructor

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

Parameters

string $font

Throws

\Pop\Pdf\Build\Font\Exception

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

getWidthsForGlyphs()

getWidthsForGlyphs(array  $glyphs) : array

Get the widths for the glyphs

Parameters

array $glyphs

Returns

array

getStringWidth()

getStringWidth(string  $string, mixed  $size) : mixed

Attempt to get string width

Parameters

string $string
mixed $size

Returns

mixed

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