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
- Prepare measured font or typeset-layout values and the explicit design policy requested. For text or font bytes, use the supported syntax explained below.
- Enter targetAscentUnits, targetDescentMagnitudeUnits, targetLineGapUnits, targetUnitsPerEm, fallbackSizeAdjustFraction using the field table and calculation rules, then run the tool.
- Read cssAscentOverridePercent, cssDescentOverridePercent, cssLineGapOverridePercent. The explanation below defines the units, signs, ordering and any flags or placeholder values.
- 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 field | Meaning | Value type; see rules below | Requirement |
|---|---|---|---|
| targetAscentUnits | Target ascent units | number | Required |
| targetDescentMagnitudeUnits | Target descent magnitude units | number | Required |
| targetLineGapUnits | Target line gap units | number | Required |
| targetUnitsPerEm | Target units per em | number | Required |
| fallbackSizeAdjustFraction | Fallback size adjust fraction | number | Required |
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 field | Meaning | Value type |
|---|---|---|
| cssAscentOverridePercent | Css ascent override percent | number |
| cssDescentOverridePercent | Css descent override percent | number |
| cssLineGapOverridePercent | Css line gap override percent | number |
{
"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
-
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.