Fallback Metrics Ascent/Descent Override

Resolve fallback ascent/descent/line-gap override percentages after separately supplied size-adjust scaling, so final layout metrics match target; no duplicate single ascent/descent alias or browser support guarantee.

Description

Font metrics overrides and size-adjust scaling interact.

Font metrics overrides and size-adjust scaling interact. The requested percentages must account for scaling to reach the target layout metrics.1

Enter nonnegative ascent, descent magnitude and line gap, positive units/em and positive size-adjust fraction. Return the three CSS override percentages.

When to use Fallback Metrics Ascent/Descent Override

Use Fallback Metrics Ascent/Descent Override when you need to evaluate the supplied records under the calculation and evidence rules below. No browser support, actual fallback fit or font-table extraction is verified.

Prepare measured font or typeset-layout values and the explicit design policy requested. For text or font bytes, use the supported syntax explained below.

How to use Fallback Metrics Ascent/Descent Override and understand its results

  1. Prepare measured font or typeset-layout values and the explicit design policy requested. For text or font bytes, use the supported syntax explained below.
  2. Enter targetAscentUnits, targetDescentMagnitudeUnits, targetLineGapUnits, targetUnitsPerEm, fallbackSizeAdjustFraction using the field table and calculation rules, then run the tool.
  3. Read cssAscentOverridePercent, cssDescentOverridePercent, cssLineGapOverridePercent. The explanation below defines the units, signs, ordering and any flags or placeholder values.
  4. If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
Input fieldMeaningValue type; see rules belowRequirement
targetAscentUnitsTarget ascent unitsnumberRequired
targetDescentMagnitudeUnitsTarget descent magnitude unitsnumberRequired
targetLineGapUnitsTarget line gap unitsnumberRequired
targetUnitsPerEmTarget units per emnumberRequired
fallbackSizeAdjustFractionFallback size adjust fractionnumberRequired

Enter nonnegative ascent, descent magnitude and line gap, positive units/em and positive size-adjust fraction. Return the three CSS override percentages.

override%=100targetMetric/(targetUnitsPerEm×sizeAdjustFraction)

Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.

Output fieldMeaningValue type
cssAscentOverridePercentCss ascent override percentnumber
cssDescentOverridePercentCss descent override percentnumber
cssLineGapOverridePercentCss line gap override percentnumber
json
{
  "input": {
    "targetAscentUnits": 800,
    "targetDescentMagnitudeUnits": 200,
    "targetLineGapUnits": 100,
    "targetUnitsPerEm": 1000,
    "fallbackSizeAdjustFraction": 1.25
  },
  "output": {
    "cssAscentOverridePercent": 64,
    "cssDescentOverridePercent": 16,
    "cssLineGapOverridePercent": 8
  }
}

Limitations and assumptions

No browser support, actual fallback fit or font-table extraction is verified.

Numeric inputs, where present, must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors.

Alternative or Complementary methods

Use x-Height Ratio From Font File: A font’s x-height ratio relates a native metric to units per em. Missing native metrics should be represented separately from measured outline height. For a complementary task, use FOUT Layout-Shift Width Delta Check: Font-swap reflow can displace following blocks. A simple displaced-area ratio differs from browser Cumulative Layout Shift.

References

  1. Fallback Metrics Ascent/Descent Override — tool.io

Similar or alternative tools

  • x-Height Ratio From Font File

    A font’s x-height ratio relates a native metric to units per em. Missing native metrics should be represented separately from measured outline height.

  • FOUT Layout-Shift Width Delta Check

    Font-swap reflow can displace following blocks. A simple displaced-area ratio differs from browser Cumulative Layout Shift.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies