ch Unit Line Length Checker

Distinguish CSS ch (zero-glyph advance) from caller observed text mean advance and nominal CPL; unlike em/ch-width conversion, actual glyph calibration is explicit, not exact wrapping.

Description

CSS ch measures the zero glyph’s advance.

CSS ch measures the zero glyph’s advance. Actual characters per line depend on the mean advance of the text being set.1

Enter nonnegative ch length/expected CPL and positive measured advances. Return modeled width, estimated CPL and signed departure from expected.

When to use ch Unit Line Length Checker

Use ch Unit Line Length Checker when you need to evaluate the supplied records under the calculation and evidence rules below. No exact wrapping, shaping or language-specific line breaking 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 ch Unit Line Length Checker 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 cssChLength, measuredZeroGlyphAdvancePx, measuredMeanTextGlyphAdvancePx, callerExpectedCpl using the field table and calculation rules, then run the tool.
  3. Read modeledLineWidthPx, estimatedActualCharactersPerLine, signedCplDeparture. 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
cssChLengthCss ch lengthnumberRequired
measuredZeroGlyphAdvancePxMeasured zero glyph advance pxnumberRequired
measuredMeanTextGlyphAdvancePxMeasured mean text glyph advance pxnumberRequired
callerExpectedCplCaller expected cplnumberRequired

Enter nonnegative ch length/expected CPL and positive measured advances. Return modeled width, estimated CPL and signed departure from expected.

width=chLength×zeroAdvance; CPL=width/meanAdvance

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

Output fieldMeaningValue type
modeledLineWidthPxModeled line width pxnumber
estimatedActualCharactersPerLineEstimated actual characters per linenumber
signedCplDepartureSigned cpl departurenumber
json
{
  "input": {
    "cssChLength": 60,
    "measuredZeroGlyphAdvancePx": 10,
    "measuredMeanTextGlyphAdvancePx": 5,
    "callerExpectedCpl": 60
  },
  "output": {
    "modeledLineWidthPx": 600,
    "estimatedActualCharactersPerLine": 120,
    "signedCplDeparture": 60
  }
}

Limitations and assumptions

No exact wrapping, shaping or language-specific line breaking is modeled.

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 Optimal Measure Characters-Per-Line: Characters per line depend on word advances and wrapping, not just nominal font size. A greedy word model makes unbreakable overflows visible. For a complementary task, use Column Count From Text Width: Column packing accounts for N−1 gutters between N columns. Insufficient width should yield an explicit zero-column result.

References

  1. ch Unit Line Length Checker — tool.io

Similar or alternative tools

  • Optimal Measure Characters-Per-Line

    Characters per line depend on word advances and wrapping, not just nominal font size. A greedy word model makes unbreakable overflows visible.

  • Column Count From Text Width

    Column packing accounts for N−1 gutters between N columns. Insufficient width should yield an explicit zero-column result.

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