size-adjust Percent Metric Match
CSS size-adjust percent to match independently measured normalized font metrics; not guaranteed identical layout.
Description
Calculate a size-adjust percentage from matching normalized target and fallback font metrics.
CSS size adjustment can be estimated by comparing the same normalized font metric in a target font and fallback font. This tool calculates that ratio as a percentage.
When to use this tool
Calculate a size-adjust percentage from matching normalized target and fallback font metrics. Use it when the input measurements and conventions below match the operation you need.
- Prepare targetMetricRatio, fallbackMetricRatio, respecting the measurement basis and boundaries below.
- Compare the worked example with your intended operation before reusing its result.
How to use the tool and how it works
- Enter every field in the input table using the stated units and exact supported selector spelling where applicable.
- Run the tool. Correct input errors before interpreting an output.
- Read the result fields below; use accompanying flags and the stated sign, boundary or model convention when interpreting a number.
Both metric ratios must be positive and measured on the same basis. sizeAdjustPercent equals 100 times targetMetricRatio divided by fallbackMetricRatio.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| targetMetricRatio | Target metric ratio. | Finite number; greater than zero |
| fallbackMetricRatio | Fallback metric ratio. | Finite number; greater than zero |
| Output field | Interpretation |
|---|---|
| result | Object containing the following named result fields. |
| result.sizeAdjustPercent | Size adjust percent; use the stated units and sign convention. |
{
"input": {
"targetMetricRatio": 0.5,
"fallbackMetricRatio": 0.4
},
"output": {
"result": {
"sizeAdjustPercent": 125
}
}
} Limitations and assumptions
- The tool does not read fonts, generate a complete fallback configuration or match every glyph and line metric. Mixing x-height with cap-height or incompatible normalization makes the ratio inappropriate.
- Every declared field is required and unexpected fields are rejected. Numeric inputs must be finite; input errors are distinct from a valid false result or an explicitly qualified output.
- Extremely large inputs and nonfinite or excessively large outputs are rejected. List positions reported by the tool use zero-based indices unless stated otherwise.
Alternative or Complementary methods
Compare the metric calculation with the intended font and rendered text. Font shaping and layout inspection are more appropriate when the task depends on actual glyph positions or reading conditions. Compare the scope of the nearby tools below before substituting one.
References
Similar or alternative tools
- all caps size compensation percent
All-capital text can be scaled under an explicit optical compensation policy.
- code inline monospace size match xheight
Matching inline code to body x-height requires independent metrics from both fonts.