phpdftk API Documentation

MathTableData
in package

Read onlyYes
FinalYes

Parsed `MATH` table from an OpenType math font (Latin Modern Math, STIX Two Math, Cambria Math, ...). Defined in the OpenType spec https://learn.microsoft.com/en-us/typography/opentype/spec/math.

The MATH table holds the per-font constants and glyph metadata MathML and TeX-style typesetting need to lay out fractions, scripts, radicals, large operators, and stretchy delimiters with font-correct proportions instead of guessed em-fractions.

v1 of this value object captures just the table header and the three sub-table byte ranges. Each sub-table parses on demand in a follow-up slice:

  • MathConstants - ~50 layout constants (script percent, axis height, fraction shape, etc.).
  • MathGlyphInfo - per-glyph italic correction, top-accent attachment, extended-shape membership, glyph-script percent overrides.
  • MathVariants - stretchy delimiter chains + glyph assembly recipes.

Storing the raw bytes for each sub-table keeps this slice tight: the OpenTypeParser only locates them; the parsers for each sub-table live in their own classes that consume these byte ranges and return strongly-typed values.

Table of Contents

Properties

$majorVersion  : int
$mathConstantsBytes  : string
$mathGlyphInfoBytes  : string
$mathVariantsBytes  : string
$minorVersion  : int

Methods

__construct()  : mixed
hasMathConstants()  : bool
hasMathGlyphInfo()  : bool
hasMathVariants()  : bool

Properties

Methods

__construct()

public __construct(int $majorVersion, int $minorVersion, string $mathConstantsBytes, string $mathGlyphInfoBytes, string $mathVariantsBytes) : mixed
Parameters
$majorVersion : int

MATH table major version (1).

$minorVersion : int

MATH table minor version (0).

$mathConstantsBytes : string

Raw bytes of the MathConstants sub-table. Empty when the offset is zero (sub-table absent).

$mathGlyphInfoBytes : string

Raw bytes of the MathGlyphInfo sub-table.

$mathVariantsBytes : string

Raw bytes of the MathVariants sub-table.

hasMathConstants()

public hasMathConstants() : bool
Return values
bool

hasMathGlyphInfo()

public hasMathGlyphInfo() : bool
Return values
bool

hasMathVariants()

public hasMathVariants() : bool
Return values
bool

        
On this page

Search results