phpdftk API Documentation

MathConstantsParser
in package

FinalYes

Parser for the MathConstants sub-table of an OpenType MATH table.

Layout per https://learn.microsoft.com/en-us/typography/opentype/spec/math#mathconstants-table :

  • 4 plain Int16 fields up front (ScriptPercentScaleDown, ScriptScriptPercentScaleDown, DelimitedSubFormulaMinHeight, DisplayOperatorMinHeight).
  • 51 MathValueRecord fields (each = Int16 FWord + uint16 Device table offset). The painter only needs the FWord half.
  • 1 trailing Int16 percent (RadicalDegreeBottomRaisePercent).

v1 reads the FWord half of each MathValueRecord and discards the Device table offset. Device tables encode per-PPEM tweaks for hinting; the painter doesn't ship a hinter so the corrections would be noise.

Total fixed-size payload: 4 * 2 + 51 * (2 + 2) + 2 = 214 bytes.

Throws on short input - a font's MathConstants record is fixed- length per the spec and any short read is a malformed font.

Table of Contents

Methods

parse()  : MathConstants

Methods


        
On this page

Search results