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

HorizontalMetrics This class represents the "hmtx" table in a sub-setting context.

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

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

Class hierarchy

Summary

Properties

$_changedData

protected array AbstractTable::$_changedData = array()

The modified data.

$_hMetrics

private array HorizontalMetrics::$_hMetrics = array()

The horizontal metrics.

$_optimized

The optimized horizontal metrics.

$_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

addHMetric()

public HorizontalMetrics::addHMetric (
int $glyphId,
int $advanceWidth,
int $leftSideBearing
): void

Paired advance width and left side bearing values for each glyph.

Records are indexed by glyph id. There is no glyph id gap allowed in the data that gets added.

Parameters
$glyphId : int
 
$advanceWidth : int
 
$leftSideBearing : int
 

cleanUp()

public HorizontalMetrics::cleanUp (
void
): void

Release memory and cycled references.

getHMetric()

public HorizontalMetrics::getHMetric (
int $glyphId
): int[2]

Get the horizontal metric by a glyph id.

Parameters
$glyphId : int
 

getOriginalTable()

Gets the original table.

optimize()

public HorizontalMetrics::optimize (
void
): array

Optimizes the horizontal metrics data.

Return Values

The optimized horizontal metrics.

write()

Writes the table.

Parameters
$writer : \SetaPDF_Core_Writer_WriterInterface