setasign\SetaPDF2\Core\Font\TrueType\Subset\Table

GlyphData This class represents the "glyf" table in a sub-setting context.

File: /SetaPDF v2/Core/Font/TrueType/Subset/Table/GlyphData.php
Old class name (alias): \SetaPDF_Core_Font_TrueType_Subset_Table_GlyphData

See https://www.microsoft.com/typography/otspec/glyf.htm for more details.

Class hierarchy

Summary

Properties

$_changedData

protected array AbstractTable::$_changedData = array()

The modified data.

$_glyphs

The glyphs to subset.

$_mapping

private array<int|false> GlyphData::$_mapping = array()

Original glyph id to new glyph id mapping array.

$_originalTable


Static Methods

getClassName()

public static AbstractTable::getClassName (
string $tag
): string

Get a class name by tag name.

Parameters
$tag : string
 
Exceptions

Throws \InvalidArgumentException


Methods

cleanUp()

public GlyphData::cleanUp (
void
): void

Release memory and cycled references.

getGlyph()

Gets the new glyph.

Parameters
$glyphId : int

The new glyphId

getMapping()

public GlyphData::getMapping (
void
): int[]

Gets all original to new glyph id mappings.

getNewGlyphId()

public GlyphData::getNewGlyphId (
int $originalGlyphId
): int

Gets the new glyph id by its original glyph id.

Parameters
$originalGlyphId : int
 
Exceptions

Throws \Exception

getNumGlyphs()

public GlyphData::getNumGlyphs (
void
): int

Gets the current number of registered glyphs.

getOriginalTable()

Gets the original table.

registerGlyph()

public GlyphData::registerGlyph (
int $originGlyphId
): int|false

Registers a glyph using his glyph id and returns a new glyph id.

Parameters
$originGlyphId : int

The origin glyph id

Return Values

The new glyph id

write()

Writes the table.

Parameters
$writer : \SetaPDF_Core_Writer_WriterInterface
 
Exceptions

Throws \Exception