Lorixen.
EN

A Font Fallback Check for Downloadable Quote Previews

A quote preview can look fine and still be wrong. If the font you chose is missing where the file is generated or opened, a substitute font may take its place. Substitutes often change the width of characters, and they can draw similar characters almost identically. Product codes are where this hurts most, because a code such as 0O1lI is useless if the reader cannot tell the zero from the letter O.

This article proposes a small, repeatable check. Everything here is a suggestion for you to adapt. All examples are hypothetical.

What you are trying to detect

There are three separate failures, and each needs its own test:

  1. Missing glyphs: a character is replaced by an empty box, a question mark or nothing at all.
  2. Look-alike confusion: the substitute draws two different characters so alike that a person cannot separate them.
  3. Width drift: the substitute is wider, so a code wraps onto two lines or is cut off at a column edge.

The glyph fixture

Build one test quote whose only job is to stress the font. It should not look like a real customer quote. Put these hypothetical codes in the line items:

  • Ambiguous characters: 0O0O-1lI1-5S5S-8B8B
  • Separators: AB/12.5-C_9 (slash, dot, hyphen, underscore)
  • Accented and non-Latin text in the description column: a short name with an accent, plus one line in any other script your customers actually use
  • The longest code in your catalogue, pasted unchanged
  • A code written in all capitals, then the same code in lower case
  • A currency symbol and a multiplication sign next to a quantity

Generate the preview in the environments where it will really be produced and opened. If you cannot list those environments, that is the first finding.

Line-wrap acceptance sheet

For each environment, record a result against each row below. Use pass, fail or not tested.

Check Pass means
Missing glyph No box, blank or question mark anywhere in the fixture
Zero versus O A reviewer reading at normal size can say which is which for all four ambiguous groups
One, l and I Same test, three characters
Longest code Stays on one line, or breaks only at a separator you chose
Column edge No code touches or crosses its cell border
Row count Page count and row order match the data
Copy and paste Pasting a code into a search box returns the same string you stored

The last row matters because a file can look right and still hold the wrong text underneath.

Branching choices

If glyphs are missing, consider embedding the font in the file if your generator and the font's terms allow it, or pick a font you are sure is present. If only look-alike confusion fails, consider a monospace or slashed-zero face for the code column only. If only width drifts, set a fixed code column width and decide in advance where a long code may break.

If you cannot control the opening environment, consider printing a plain text code list at the bottom of the quote as a fallback.

Hypothetical worked example

Imagine a quote lists code KX-0O1-77. In one test environment the preview shows the code in a substitute face where the zero and the capital O look the same, and the code wraps after the hyphen. The sheet records a fail on zero versus O and a fail on longest code. The team chooses to set the code column in a distinct face with a slashed zero and a wider cell. They rerun the fixture. The sheet now passes in the environments they tested, which says nothing about environments they did not test.

Stop conditions

Stop and do not publish the preview feature if any code cannot be told apart from another code in the fixture, if copied text differs from stored text, or if you cannot name every environment the file will be opened in. Do not treat a pass in one environment as a pass everywhere.

Acceptance checks

  • The fixture lives next to the template and is rerun whenever the template, font or generator changes.
  • Every environment has a dated row on the sheet.
  • A person who did not build the template reads the codes aloud and a second person confirms them.
  • Failures are recorded, not averaged away.

Sources

    WhatsAppLet’s talk