FOUT Layout-Shift Width Delta Check

Estimate following-block displacement from measured line reflow/line heights and sum declared displacement areas; not browser CLS impact/viewport clipping/session-window aggregation or duplicate text-width delta.

Description

Font-swap reflow can displace following blocks.

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

Enter aligned nonempty nonnegative integer line counts, positive line heights/viewport and block widths between zero and viewport width. Return signed displacements, sum(abs(displacement)×blockWidth)/viewportArea and maximum absolute displacement.

When to use FOUT Layout-Shift Width Delta Check

Use FOUT Layout-Shift Width Delta Check when you need to evaluate the supplied records under the calculation and evidence rules below. No viewport clipping, impact-region union or CLS session-window aggregation is modeled.

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 FOUT Layout-Shift Width Delta Check 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 fallbackLineCounts, webfontLineCounts, fallbackLineHeightsPx, webfontLineHeightsPx, measuredFollowingBlockWidthsPx, viewportWidthPx, viewportHeightPx using the field table and calculation rules, then run the tool.
  3. Read signedFollowingBlockDisplacementsPx, sumDisplacedAreaOverViewportArea, maximumAbsoluteFollowingDisplacementPx. 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
fallbackLineCountsFallback line countslist of numberRequired
webfontLineCountsWebfont line countslist of numberRequired
fallbackLineHeightsPxFallback line heights pxlist of numberRequired
webfontLineHeightsPxWebfont line heights pxlist of numberRequired
measuredFollowingBlockWidthsPxMeasured following block widths pxlist of numberRequired
viewportWidthPxViewport width pxnumberRequired
viewportHeightPxViewport height pxnumberRequired

Enter aligned nonempty nonnegative integer line counts, positive line heights/viewport and block widths between zero and viewport width. Return signed displacements, sum(abs(displacement)×blockWidth)/viewportArea and maximum absolute displacement.

displacement=webLines×webLineHeight−fallbackLines×fallbackLineHeight

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

Output fieldMeaningValue type
signedFollowingBlockDisplacementsPxSigned following block displacements pxlist of number
sumDisplacedAreaOverViewportAreaSum displaced area over viewport areanumber
maximumAbsoluteFollowingDisplacementPxMaximum absolute following displacement pxnumber
json
{
  "input": {
    "fallbackLineCounts": [
      2,
      3
    ],
    "webfontLineCounts": [
      3,
      2
    ],
    "fallbackLineHeightsPx": [
      20,
      20
    ],
    "webfontLineHeightsPx": [
      22,
      22
    ],
    "measuredFollowingBlockWidthsPx": [
      100,
      200
    ],
    "viewportWidthPx": 500,
    "viewportHeightPx": 500
  },
  "output": {
    "signedFollowingBlockDisplacementsPx": [
      26,
      -16
    ],
    "sumDisplacedAreaOverViewportArea": 0.0232,
    "maximumAbsoluteFollowingDisplacementPx": 26
  }
}

Limitations and assumptions

No viewport clipping, impact-region union or CLS session-window aggregation is modeled.

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.

Alternative or Complementary methods

Use font-display Swap Block Fallback Shift Metric: Font-display timing and measured fallback differences jointly determine a modeled visible swap. Caller windows differ from browser implementation behavior. 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. FOUT Layout-Shift Width Delta Check — tool.io

Similar or alternative tools

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