phpdftk API Documentation

MathConstants
in package

Read onlyYes
FinalYes

Parsed MathConstants sub-table from an OpenType MATH table.

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

Every value is in font design units (FUnit) unless otherwise noted; the consumer scales by (size / unitsPerEm) to get points. Percent-scale fields are signed Int16 percentages (so a 0.7 scale-down is stored as 70).

The painter consumes these constants to replace the hardcoded em-fractions baked into the tracer-bullet (SCRIPT_FONT_SCALE, SUP_RAISE_EM, fraction-bar thickness, etc.) with font-correct values that match the rendered glyph metrics.

v1 of this parser handles the FWord half of each MathValueRecord field. The Device-table half (per-PPEM corrections for hinting) is read but discarded - hinting at math-typesetting sizes is negligible and adds parser surface area for no observable gain.

Table of Contents

Properties

$accentBaseHeight  : int
Vertical alignment for an accent's bottom relative to the base glyph's top.
$axisHeight  : int
Vertical position of the mathematical axis (the centerline for fraction bars, sum operators, etc.) above baseline.
$delimitedSubFormulaMinHeight  : int
Minimum height (in design units) at which a delimiter is drawn as the next stretched variant. Used by stretchy brackets and radicals.
$displayOperatorMinHeight  : int
Minimum height (design units) at which an operator switches to its display (large) form.
$flattenedAccentBaseHeight  : int
Vertical alignment for a flattened accent's bottom.
$fractionDenomDisplayStyleGapMin  : int
$fractionDenominatorDisplayStyleShiftDown  : int
$fractionDenominatorGapMin  : int
$fractionDenominatorShiftDown  : int
$fractionNumDisplayStyleGapMin  : int
$fractionNumeratorDisplayStyleShiftUp  : int
$fractionNumeratorGapMin  : int
$fractionNumeratorShiftUp  : int
$fractionRuleThickness  : int
Thickness of the horizontal bar in fractions.
$lowerLimitBaselineDropMin  : int
$lowerLimitGapMin  : int
$mathLeading  : int
Recommended gap between top of a math row and the top of its tallest glyph.
$overbarExtraAscender  : int
$overbarRuleThickness  : int
$overbarVerticalGap  : int
$radicalDegreeBottomRaisePercent  : int
Percent of radical sign height the degree base rises (e.g. 60).
$radicalDisplayStyleVerticalGap  : int
$radicalExtraAscender  : int
$radicalKernAfterDegree  : int
$radicalKernBeforeDegree  : int
$radicalRuleThickness  : int
$radicalVerticalGap  : int
$scriptPercentScaleDown  : int
Percent scale-down for script-level glyphs (e.g. 70 => 70%).
$scriptScriptPercentScaleDown  : int
Percent scale-down for script-script-level glyphs (e.g. 55).
$skewedFractionHorizontalGap  : int
$skewedFractionVerticalGap  : int
$spaceAfterScript  : int
$stackBottomDisplayStyleShiftDown  : int
$stackBottomShiftDown  : int
$stackDisplayStyleGapMin  : int
$stackGapMin  : int
$stackTopDisplayStyleShiftUp  : int
$stackTopShiftUp  : int
$stretchStackBottomShiftDown  : int
$stretchStackGapAboveMin  : int
$stretchStackGapBelowMin  : int
$stretchStackTopShiftUp  : int
$subscriptBaselineDropMin  : int
$subscriptShiftDown  : int
$subscriptTopMax  : int
$subSuperscriptGapMin  : int
$superscriptBaselineDropMax  : int
$superscriptBottomMaxWithSubscript  : int
$superscriptBottomMin  : int
$superscriptShiftUp  : int
$superscriptShiftUpCramped  : int
$underbarExtraDescender  : int
$underbarRuleThickness  : int
$underbarVerticalGap  : int
$upperLimitBaselineRiseMin  : int
$upperLimitGapMin  : int

Methods

__construct()  : mixed

Properties

$accentBaseHeight

Vertical alignment for an accent's bottom relative to the base glyph's top.

public int $accentBaseHeight

$axisHeight

Vertical position of the mathematical axis (the centerline for fraction bars, sum operators, etc.) above baseline.

public int $axisHeight

$delimitedSubFormulaMinHeight

Minimum height (in design units) at which a delimiter is drawn as the next stretched variant. Used by stretchy brackets and radicals.

public int $delimitedSubFormulaMinHeight

$displayOperatorMinHeight

Minimum height (design units) at which an operator switches to its display (large) form.

public int $displayOperatorMinHeight

$flattenedAccentBaseHeight

Vertical alignment for a flattened accent's bottom.

public int $flattenedAccentBaseHeight

$fractionDenomDisplayStyleGapMin

public int $fractionDenomDisplayStyleGapMin

$fractionDenominatorDisplayStyleShiftDown

public int $fractionDenominatorDisplayStyleShiftDown

$fractionDenominatorGapMin

public int $fractionDenominatorGapMin

$fractionDenominatorShiftDown

public int $fractionDenominatorShiftDown

$fractionNumDisplayStyleGapMin

public int $fractionNumDisplayStyleGapMin

$fractionNumeratorDisplayStyleShiftUp

public int $fractionNumeratorDisplayStyleShiftUp

$fractionNumeratorGapMin

public int $fractionNumeratorGapMin

$fractionNumeratorShiftUp

public int $fractionNumeratorShiftUp

$fractionRuleThickness

Thickness of the horizontal bar in fractions.

public int $fractionRuleThickness

$lowerLimitBaselineDropMin

public int $lowerLimitBaselineDropMin

$mathLeading

Recommended gap between top of a math row and the top of its tallest glyph.

public int $mathLeading

$radicalDegreeBottomRaisePercent

Percent of radical sign height the degree base rises (e.g. 60).

public int $radicalDegreeBottomRaisePercent

$radicalDisplayStyleVerticalGap

public int $radicalDisplayStyleVerticalGap

$radicalKernBeforeDegree

public int $radicalKernBeforeDegree

$scriptPercentScaleDown

Percent scale-down for script-level glyphs (e.g. 70 => 70%).

public int $scriptPercentScaleDown

$scriptScriptPercentScaleDown

Percent scale-down for script-script-level glyphs (e.g. 55).

public int $scriptScriptPercentScaleDown

$skewedFractionHorizontalGap

public int $skewedFractionHorizontalGap

$skewedFractionVerticalGap

public int $skewedFractionVerticalGap

$stackBottomDisplayStyleShiftDown

public int $stackBottomDisplayStyleShiftDown

$stackDisplayStyleGapMin

public int $stackDisplayStyleGapMin

$stackTopDisplayStyleShiftUp

public int $stackTopDisplayStyleShiftUp

$stretchStackBottomShiftDown

public int $stretchStackBottomShiftDown

$stretchStackGapAboveMin

public int $stretchStackGapAboveMin

$stretchStackGapBelowMin

public int $stretchStackGapBelowMin

$subscriptBaselineDropMin

public int $subscriptBaselineDropMin

$superscriptBaselineDropMax

public int $superscriptBaselineDropMax

$superscriptBottomMaxWithSubscript

public int $superscriptBottomMaxWithSubscript

$superscriptShiftUpCramped

public int $superscriptShiftUpCramped

$upperLimitBaselineRiseMin

public int $upperLimitBaselineRiseMin

Methods

__construct()

public __construct(int $scriptPercentScaleDown, int $scriptScriptPercentScaleDown, int $delimitedSubFormulaMinHeight, int $displayOperatorMinHeight, int $mathLeading, int $axisHeight, int $accentBaseHeight, int $flattenedAccentBaseHeight, int $subscriptShiftDown, int $subscriptTopMax, int $subscriptBaselineDropMin, int $superscriptShiftUp, int $superscriptShiftUpCramped, int $superscriptBottomMin, int $superscriptBaselineDropMax, int $subSuperscriptGapMin, int $superscriptBottomMaxWithSubscript, int $spaceAfterScript, int $upperLimitGapMin, int $upperLimitBaselineRiseMin, int $lowerLimitGapMin, int $lowerLimitBaselineDropMin, int $stackTopShiftUp, int $stackTopDisplayStyleShiftUp, int $stackBottomShiftDown, int $stackBottomDisplayStyleShiftDown, int $stackGapMin, int $stackDisplayStyleGapMin, int $stretchStackTopShiftUp, int $stretchStackBottomShiftDown, int $stretchStackGapAboveMin, int $stretchStackGapBelowMin, int $fractionNumeratorShiftUp, int $fractionNumeratorDisplayStyleShiftUp, int $fractionDenominatorShiftDown, int $fractionDenominatorDisplayStyleShiftDown, int $fractionNumeratorGapMin, int $fractionNumDisplayStyleGapMin, int $fractionRuleThickness, int $fractionDenominatorGapMin, int $fractionDenomDisplayStyleGapMin, int $skewedFractionHorizontalGap, int $skewedFractionVerticalGap, int $overbarVerticalGap, int $overbarRuleThickness, int $overbarExtraAscender, int $underbarVerticalGap, int $underbarRuleThickness, int $underbarExtraDescender, int $radicalVerticalGap, int $radicalDisplayStyleVerticalGap, int $radicalRuleThickness, int $radicalExtraAscender, int $radicalKernBeforeDegree, int $radicalKernAfterDegree, int $radicalDegreeBottomRaisePercent) : mixed
Parameters
$scriptPercentScaleDown : int
$scriptScriptPercentScaleDown : int
$delimitedSubFormulaMinHeight : int
$displayOperatorMinHeight : int
$mathLeading : int
$axisHeight : int
$accentBaseHeight : int
$flattenedAccentBaseHeight : int
$subscriptShiftDown : int
$subscriptTopMax : int
$subscriptBaselineDropMin : int
$superscriptShiftUp : int
$superscriptShiftUpCramped : int
$superscriptBottomMin : int
$superscriptBaselineDropMax : int
$subSuperscriptGapMin : int
$superscriptBottomMaxWithSubscript : int
$spaceAfterScript : int
$upperLimitGapMin : int
$upperLimitBaselineRiseMin : int
$lowerLimitGapMin : int
$lowerLimitBaselineDropMin : int
$stackTopShiftUp : int
$stackTopDisplayStyleShiftUp : int
$stackBottomShiftDown : int
$stackBottomDisplayStyleShiftDown : int
$stackGapMin : int
$stackDisplayStyleGapMin : int
$stretchStackTopShiftUp : int
$stretchStackBottomShiftDown : int
$stretchStackGapAboveMin : int
$stretchStackGapBelowMin : int
$fractionNumeratorShiftUp : int
$fractionNumeratorDisplayStyleShiftUp : int
$fractionDenominatorShiftDown : int
$fractionDenominatorDisplayStyleShiftDown : int
$fractionNumeratorGapMin : int
$fractionNumDisplayStyleGapMin : int
$fractionRuleThickness : int
$fractionDenominatorGapMin : int
$fractionDenomDisplayStyleGapMin : int
$skewedFractionHorizontalGap : int
$skewedFractionVerticalGap : int
$overbarVerticalGap : int
$overbarRuleThickness : int
$overbarExtraAscender : int
$underbarVerticalGap : int
$underbarRuleThickness : int
$underbarExtraDescender : int
$radicalVerticalGap : int
$radicalDisplayStyleVerticalGap : int
$radicalRuleThickness : int
$radicalExtraAscender : int
$radicalKernBeforeDegree : int
$radicalKernAfterDegree : int
$radicalDegreeBottomRaisePercent : int

        
On this page

Search results