font-display Swap Block Fallback Shift Metric

Audit measured fallback/webfont width differences and arrival against caller display block/swap windows; modeled visibility only, not a browser-timing guarantee or a real CLS score.

Description

Font-display timing and measured fallback differences jointly determine a modeled visible swap.

Font-display timing and measured fallback differences jointly determine a modeled visible swap. Caller windows differ from browser implementation behavior.1

Enter aligned nonempty nonnegative fallback/web widths and nonnegative timing windows. Return signed widths and all three timing flags.

When to use font-display Swap Block Fallback Shift Metric

Use font-display Swap Block Fallback Shift Metric when you need to evaluate the supplied records under the calculation and evidence rules below. No browser loading trace, guaranteed visibility or CLS score is produced.

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 font-display Swap Block Fallback Shift Metric 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 fallbackMeasuredTextWidthsPx, webfontMeasuredTextWidthsPx, fontSwapAtSeconds, callerBlockWindowSeconds, callerSwapWindowSeconds using the field table and calculation rules, then run the tool.
  3. Read signedPostSwapWidthChangesPx, fontArrivedInBlockWindow, fontArrivedBeforeSwapWindowEnd, visibleFallbackSwapExpectedUnderPolicy. 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
fallbackMeasuredTextWidthsPxFallback measured text widths pxlist of numberRequired
webfontMeasuredTextWidthsPxWebfont measured text widths pxlist of numberRequired
fontSwapAtSecondsFont swap at secondsnumberRequired
callerBlockWindowSecondsCaller block window secondsnumberRequired
callerSwapWindowSecondsCaller swap window secondsnumberRequired

Enter aligned nonempty nonnegative fallback/web widths and nonnegative timing windows. Return signed widths and all three timing flags.

block=arrival≤blockWindow; beforeEnd=arrival≤blockWindow+swapWindow; visible=!block AND beforeEnd

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

Output fieldMeaningValue type
signedPostSwapWidthChangesPxSigned post swap width changes pxlist of number
fontArrivedInBlockWindowFont arrived in block windowboolean
fontArrivedBeforeSwapWindowEndFont arrived before swap window endboolean
visibleFallbackSwapExpectedUnderPolicyVisible fallback swap expected under policyboolean
json
{
  "input": {
    "fallbackMeasuredTextWidthsPx": [
      100,
      200
    ],
    "webfontMeasuredTextWidthsPx": [
      110,
      180
    ],
    "fontSwapAtSeconds": 2,
    "callerBlockWindowSeconds": 3,
    "callerSwapWindowSeconds": 2
  },
  "output": {
    "signedPostSwapWidthChangesPx": [
      10,
      -20
    ],
    "fontArrivedInBlockWindow": true,
    "fontArrivedBeforeSwapWindowEnd": true,
    "visibleFallbackSwapExpectedUnderPolicy": false
  }
}

Limitations and assumptions

No browser loading trace, guaranteed visibility or CLS score is produced.

Numeric inputs, where present, must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Numeric lists are limited to 10,000 entries; string lists to 128 strings of at most 128 characters each. The rules above may impose smaller limits. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors. A successfully returned false flag is an evaluated outcome; its meaning is explained above.

Alternative or Complementary methods

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. For a complementary task, use Fallback Metrics Ascent/Descent Override: Font metrics overrides and size-adjust scaling interact. The requested percentages must account for scaling to reach the target layout metrics.

References

  1. font-display Swap Block Fallback Shift Metric — tool.io

Similar or alternative tools

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