setasign\SetaPDF2\Core\Font\TrueType

File Parser class for TTF/OTF files

File: /SetaPDF v2/Core/Font/TrueType/File.php
Old class name (alias): \SetaPDF_Core_Font_TrueType_File

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

Class hierarchy

Summary

Properties

$_entrySelector

protected File::$_entrySelector

$_numTables

protected File::$_numTables

$_rangeShift

protected File::$_rangeShift

$_reader

The reader instance

$_searchRange

protected File::$_searchRange

$_sfntVersion

protected File::$_sfntVersion

$_tableRecords

Data of tables in the TTF file


Methods

__construct()

public File::__construct ()

The constructor.

Parameters
$reader : string|\SetaPDF_Core_Reader_Binary
 
Exceptions

Throws \setasign\SetaPDF2\Core\Exception

Throws \setasign\SetaPDF2\NotImplementedException

_getUnitsPerEm()

protected File::_getUnitsPerEm (
void
): float

Get the units per em.

Exceptions

Throws \setasign\SetaPDF2\NotImplementedException

_seekTable()

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

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

Parameters
$tag : string
 
Exceptions

Throws \setasign\SetaPDF2\Core\Exception

areCharsCovered()

public File::areCharsCovered (
array $chars
): bool

Checks if characters are covered by this font.

Parameters
$chars : array

The chars in UTF-16BE encoding

Exceptions

Throws \setasign\SetaPDF2\NotImplementedException

cleanUp()

public File::cleanUp (
void
): void

Release resources.

getEntrySelector()

public File::getEntrySelector (
void
): int

Get the entry selector value.

getNumTables()

public File::getNumTables (
void
): int

Get the number of tables.

getRangeShift()

public File::getRangeShift (
void
): int

Get the range shift value.

getReader()

Get the reader instance.

getSearchRange()

public File::getSearchRange (
void
): int

Get the search range value.

getSfntVersion()

public File::getSfntVersion (
void
): int

Get the sfnt version.

getTable()

public File::getTable (
string $tag
): bool|\SetaPDF_Core_Font_TrueType_Table

Get a tag specific table.

Parameters
$tag : string
 
Exceptions

Throws \setasign\SetaPDF2\NotImplementedException

getWidth()

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

Get the width of a single character/glyph.

Parameters
$char : string
 
Exceptions

Throws \setasign\SetaPDF2\Core\Font\Exception,\setasign\SetaPDF2\NotImplementedException

getWidths()

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

Get character/glyph width values.

Parameters
$chars : array

The chars in UTF-16BE encoding

Exceptions

Throws \setasign\SetaPDF2\Core\Font\Exception,\setasign\SetaPDF2\NotImplementedException

isCharCovered()

public 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 \setasign\SetaPDF2\NotImplementedException

isEmbeddable()

public File::isEmbeddable (
void
): bool

Checks if a font is embeddable.

Exceptions

Throws Subset\Exception

Throws \setasign\SetaPDF2\NotImplementedException

isSubsettable()

public File::isSubsettable (
void
): bool

Checks if a font is subsettable and embeddable.

Exceptions

Throws Subset\Exception

Throws \setasign\SetaPDF2\NotImplementedException

tableExists()

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

Check if a specific table exists.

Parameters
$tag : string