setasign\SetaPDF2\Core\Font\TrueType\Subset\File

Identity Font subsetting class used for identity encoding (more bytes).

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

Class hierarchy

Summary

Properties

$_cmapOriginSubTable

$_mapping

private array Identity::$_mapping = array()

The glyph id to char code mapping.

$_tables

The table instances.


Static Methods

calculateChecksumAdjustment()

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

Calculates the checksum adjustment.

Parameters
$offsetData : string
 
$checksums : string[]
 

calculateTableChecksum()

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

Calculates a table checksum.

Parameters
$data : string
 

Methods

__construct()

_prepareSubset()

public Identity::_prepareSubset (
void
): void

Prepares the data for sub-setting.

Exceptions

Throws \setasign\SetaPDF2\Core\Font\Exception

_resolveGlyphs()

protected AbstractFile::_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 \setasign\SetaPDF2\Core\Font\Exception

_writeOffsetTable()

Writes the offset table.

Parameters
$writer : \SetaPDF_Core_Writer_WriterInterface
 

_writeTable()

protected AbstractFile::_writeTable (): array

Writes a single table and returns information about it.

Parameters
$writer : \SetaPDF_Core_Writer_WriterInterface
 
$tag : string
 

_writeTables()

Writes the tables.

Parameters
$writer : \SetaPDF_Core_Writer_WriterInterface
 

addChar()

public Identity::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

Exceptions

Throws \setasign\SetaPDF2\NotImplementedException

addCharCode()

public Identity::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.

Exceptions

Throws \setasign\SetaPDF2\NotImplementedException

cleanUp()

public Identity::cleanUp (
void
): void

Release memory and cycled references.

getFont()

Gets the original font.

getTable()

Gets a table.

Parameters
$tag : string
 
Exceptions

Throws \setasign\SetaPDF2\Core\Font\Exception

subset()

Subsets the font.

Parameters
$writer : \SetaPDF_Core_Writer_WriterInterface
 
Exceptions

Throws \setasign\SetaPDF2\Core\Font\Exception