SetaPDF_Core_Font_TrueType_File Parser class for TTF/OTF files

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

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

Class hierarchy

Summary

Properties

$_reader

$_tableRecords


Methods

__construct()

The constructor.

Parameters
$reader : string|SetaPDF_Core_Reader_Binary
 
Exceptions

Throws SetaPDF_Core_Exception

Throws SetaPDF_Exception_NotImplemented

_getUnitsPerEm()

Get the units per em.

Exceptions

Throws SetaPDF_Exception_NotImplemented

_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
): bool

Checks if characters are covered by this font.

Parameters
$chars : array

The chars in UTF-16BE encoding

Exceptions

Throws SetaPDF_Exception_NotImplemented

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
 
Exceptions

Throws SetaPDF_Exception_NotImplemented

getWidth()

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

Get the width of a single character/glyph.

Parameters
$char : string
 
Exceptions

Throws SetaPDF_Core_Font_Exception,SetaPDF_Exception_NotImplemented

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

Exceptions

Throws SetaPDF_Core_Font_Exception,SetaPDF_Exception_NotImplemented

isCharCovered()

public SetaPDF_Core_Font_TrueType_File::isCharCovered (
string $char [, string $encoding = 'UTF-16BE' ]
): bool

Checks if a character is covered by this font.

Parameters
$char : string

The character in the specified encoding

$encoding : string

The encoding - default is UTF-16BE

Exceptions

Throws SetaPDF_Exception_NotImplemented

isEmbeddable()

Checks if a font is embeddable.

Exceptions

Throws SetaPDF_Core_Font_TrueType_Subset_Exception

Throws SetaPDF_Exception_NotImplemented

isSubsettable()

Checks if a font is subsettable and embeddable.

Exceptions

Throws SetaPDF_Core_Font_TrueType_Subset_Exception

Throws SetaPDF_Exception_NotImplemented

tableExists()

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

Check if a specific table exists.

Parameters
$tag : string