SetaPDF_Core_Font_TrueType_Subset_File An abstract class for sub-setting TrueType fonts.

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

This class is marked as abstract to allow custom control of character codes to glyph ids mapping in extending classes.

Based on the OpenType specification: https://www.microsoft.com/typography/otspec/otff.htm

Class hierarchy

Summary

Properties

$_font

The original true type font instance.


Static Methods

calculateChecksumAdjustment()

public static SetaPDF_Core_Font_TrueType_Subset_File::calculateChecksumAdjustment (
string $offsetData, string[] $checksums
): string

Calculates the checksum adjustment.

Parameters
$offsetData : string
 
$checksums : string[]
 

calculateTableChecksum()

public static SetaPDF_Core_Font_TrueType_Subset_File::calculateTableChecksum (
string $data
): string

Calculates a table checksum.

Parameters
$data : string
 

Methods

_prepareSubset()

Prepares the data for sub-setting.

Exceptions

Throws SetaPDF_Core_Font_Exception

_resolveGlyphs()

protected SetaPDF_Core_Font_TrueType_Subset_File::_resolveGlyphs (
array $glyphs, array &$data [, int $depth = 0 ]
): array

Resolves all the glyphs recursively and updates the data array accordingly.

Parameters
$glyphs : array
 
$data : array
 
$depth : int
 
Exceptions

Throws SetaPDF_Core_Font_Exception

_writeOffsetTable()

_writeTable()

Writes a single table and returns information about it.

Parameters
$writer : SetaPDF_Core_Writer_WriterInterface
 
$tag : string
 

_writeTables()

addChar()

abstract public SetaPDF_Core_Font_TrueType_Subset_File::addChar (
string $char
): string

Adds a character to the subset and returns the value to which it is registered.

Parameters
$char : string

The char in UTF16-BE encoding

addCharCode()

abstract public SetaPDF_Core_Font_TrueType_Subset_File::addCharCode (
int $charCode
): int

Adds a char code to the subset.

Parameters
$charCode : int

The unicode point to add.

Return Values

The new point in the individual encoding.

cleanUp()

Release memory and cycled references.

getFont()

getTable()

Gets a table.

Parameters
$tag : string
 
Exceptions

Throws SetaPDF_Core_Font_Exception

subset()