pudl

Inter subsets

PUDL 0.44.0 addresses issue #11 by declaring upright and italic Inter faces for Latin, extended Latin, Vietnamese, Greek, extended Greek, Cyrillic, extended Cyrillic, and the remaining supported characters. Browsers request only subsets needed by the page. All U+2190-21FF arrows supported by Inter belong to Latin, including the footnote return arrow.

Adoption

Copy pudl.css and the complete dist/fonts/ directory together. Loading the new stylesheet without the new font files causes failed requests and fallback text. The family name, font tokens, weight range, and optical-size behavior are unchanged. The SIL Open Font License remains beside the fonts.

The original InterVariable.woff2 and InterVariable-Italic.woff2 remain available for existing direct references and as build inputs. PUDL’s default faces no longer request them. Remove any preload of those files when adopting subsets. Hosts that choose to preload may use the following path, adjusted to their asset location:

<link rel="preload" as="font" type="font/woff2" crossorigin
      href="pudl/fonts/Inter-latin.woff2">

Preloading is optional. A page that overrides the Inter family or does not render Latin may waste that download.

Style Whole font Latin subset Reduction
Upright 352,240 bytes 162,188 bytes 54.0%
Italic 387,976 bytes 179,156 bytes 53.8%

The total installed font directory grows because script subsets share glyphs and the original files are retained. The saving applies to a visitor’s downloads. A page using many scripts can download more than one whole font would have required.

Rebuilding

The build uses the documented fontTools subsetter. Python is a maintainer dependency only; consuming PUDL still requires no build.

python -m pip install -r build/fonts-requirements.txt
python build/fonts.py
python build/fonts.py --check

The script uses the whole files in dist/fonts/ as inputs and writes sixteen WOFF2 files plus the marked font-face block in pudl.css. It retains glyph names, hinting, name records, layout features, and both variable axes. It preserves the source glyph bounds and disables timestamp recalculation and the optional HarfBuzz repacker so the pinned toolchain produces consistent bytes. Commit the generated assets with any input or generator change.

Each script range is intersected with the source font’s character map. A computed remainder covers everything outside those ranges. Every subset also retains all combining marks supported by the source font. This follows the CSS cluster-matching rules, which prefer one face for a base character and its marks. Without that addition, the ranges proposed in the issue changed the metrics of decomposed accented text in Chromium and WebKit. The extra coverage accounts for the larger Latin subset compared with the issue’s estimate. Shared characters may appear in several subsets; Latin is declared last so ordinary punctuation uses the common subset. Glyphs required by shaping rules are retained even when they have no directly addressable Unicode character.

The font files also retain basic Latin letters as internal hinting context, with basic Greek and Cyrillic retained in their respective extended subsets. These extra characters stay outside the subset’s advertised CSS range unless they already belong there. FreeType documents that its auto-hinter derives alignment zones from representative characters. Removing that context changed bold extended-Latin widths by one pixel in Linux Chromium, even though the design-space advances were unchanged. Retaining it restores the tested metrics without loading additional files.

Verification

The generator checks serialized character maps, complete coverage, variable-axis bounds, glyph-name table format, and the union of retained OpenType feature tags against each original font. --check also rebuilds and compares every generated byte without modifying files. CI runs this check with pinned fontTools and Brotli versions.

tests/fonts.test.js checks actual browser requests for every subset and both styles. It verifies that an English page with a footnote arrow requests only Latin, that italics load on demand, and that representative mixed-script and decomposed accented text matches the whole font’s layout metrics at body and heading sizes with regular and bold weights and tabular numerals. The release review compares the reference page in both themes.