Repository navigation
fonts: bundle the Latin Modern sans, slanted and small-caps designs every running head needs - #205
Merged
Conversation
…very running head needs
The bundle shipped 33 outline faces -- LMRoman, LMMono and math -- and
zero Latin Modern sans, slanted or small-caps designs. article.cls and
book.cls set every headings/myheadings running head in \slshape
(article.cls:134-135,152,163-164), so this was not a corner case: every
running head in the bundle was drawn from a substituted roman outline
with a font_outline_substituted warning, and \textsf/\textsl/\textsc
substituted roman throughout the body.
The renderer already mapped these shapes; the files were simply absent.
latin_modern_outline returns lmsans*/lmromanslant*/lmromancaps*/
lmromandemi*/lmromanunsl*, latin_modern_tfm maps them to ec-lmss/ec-lmro/
ec-lmcsc/..., and ec_tfm_file names the jknappen EC metrics for a
[T1]{fontenc} document without lmodern. None of those files were vendored.
192 files added, all from packages this tree already vendors (lm and
jknappen), so no new package and no new licence file:
- 25 outlines: lmromanslant{8,9,10,12,17}-regular, lmromanslant10-bold,
lmromancaps10-{regular,oblique}, lmromanunsl10-regular,
lmromandemi10-{regular,oblique}, lmsans{8,9,10,12,17}-{regular,oblique},
lmsans10-{bold,boldoblique}, lmsansdemicond10-{regular,oblique}.
Exactly what latin_modern_outline can return for FamilyKind::Sf and for
the roman shapes outside m/n, bx/n, m/it, bx/it.
- 25 ec-lm* TFMs under public/lm: exactly what latin_modern_tfm maps
those outlines to, so each new face lays out on its own TeX metrics
rather than on substituted roman ones.
- 142 jknappen/ec TFMs: every remaining file ec_tfm_file can name --
eccc/ecsc/ecoc/ecui/ecbl/ecrb/ecxc at the 14 t1cmr.fd sizes and
ecss/ecsi/ecsx/ecso at the 11 distinct sizes t1cmss.fd reaches. Without
ecxc1000.tfm the 20-t1-rm-bfsc fixture measured 11.533 bp from pdflatex,
which sets it from SFXC1000 (= ecxc1000.tfm). After this tier
ec_tfm_file can no longer name a metric the bundle lacks.
Release identity verified by byte-comparison, the method PR #183 used,
because linux-primary has TeX Live 2025 r78234 and no MacTeX: every file
already pinned from these packages is byte-identical (cmp) between the
two distributions -- 33 Latin Modern OTFs, 38 public/lm TFMs, 114
jknappen/ec TFMs and 6 amsfonts/symbols TFMs. 191 files compared, 0
differences. The new members were copied from the same directories in
the same run and hashed after the copy. No CTAN archive is present on
this host, so no archive hash is claimed.
Both in-repo pins regenerated to their true new values, not relaxed:
SUPPLEMENTARY-FACES.json 30 -> 55 entries, SUPPLEMENTARY-METRICS.json
155 -> 322, each with a provenance block. Every hard-pinned count in the
Swift tests was regenerated: latinModernFaceFiles 33 -> 58, faces
entries 30 -> 55, supplementary-face rows 30 -> 55, metrics entries
155 -> 322. latinModernMonoFaceFiles stays 10 and the 21 reachable text
masters stay 21 (preview postScriptName only emits LMRoman). Two new
counts added for the new arrays. The stray-face test used
lmsans10-regular.otf as its "unpinned" sentinel, which this change makes
a legitimately pinned face; it now uses lmdunh10-regular.otf, a design
latin_modern_outline has no arm to return.
bundle-texmf.py MAX_SUPPLEMENTARY raised 65536 -> 262144. It is a sanity
bound on parsing an in-repo sidecar, not a trust boundary: every entry is
still checked individually (byte_length + sha256) and any vendored file
no pin lists is still refused as unpinned. 322 entries do not fit in 64K.
bundle-texmf.py check: 386 entries, all verified (9 pinned, 55
supplementary-face, 322 supplementary).
Implementation-Agent: Claude Code engine-engineer (linux-primary / NixOS)
Commit-Executor: git via Claude Code
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar
marked this pull request as ready for review
September 13, 2026 20:15
This was referenced Sep 13, 2026
GoKubar
deleted the
agent/linux-primary/latin-modern-sans-slant-caps
branch
September 16, 2026 04:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft while
mainis frozen for the v0.1.2 release run. Independent of #202/#203 — it touches no test those PRs touch, and its three tests are the three they both name as the remaining pre-existing gap.The defect
The bundle shipped 33 outline faces — LMRoman, LMMono, math — and zero Latin Modern sans, slanted or small-caps designs.
article.clsandbook.clsset everyheadings/myheadingsrunning head in\slshape(article.cls:134-135,152,163-164), so this was not a corner case: every running head in the bundle was drawn from a substituted roman outline, and\textsf/\textsl/\textscsubstituted roman throughout the body.The renderer already mapped these shapes —
latin_modern_outlinereturnslmsans*/lmromanslant*/lmromancaps*,latin_modern_tfmmaps them toec-lmss/ec-lmro/ec-lmcsc, andec_tfm_filenames the jknappen EC metrics for[T1]{fontenc}withoutlmodern. The files were simply absent.What is bundled — 192 files, no new package
All from
lmandjknappen, both already vendored, so no new licence file:lmromanslant{8,9,10,12,17}-regular,lmromanslant10-bold,lmromancaps10-{regular,oblique},lmromanunsl10-regular,lmromandemi10-{regular,oblique},lmsans{8,9,10,12,17}-{regular,oblique},lmsans10-{bold,boldoblique},lmsansdemicond10-{regular,oblique}— exactly whatlatin_modern_outlinecan return forFamilyKind::Sfand the roman shapes outsidem/n,bx/n,m/it,bx/itpublic/lmTFMslatin_modern_tfmmaps those outlines to, so each face lays out on its own TeX metricsjknappen/ecTFMsec_tfm_filecan name:eccc/ecsc/ecoc/ecui/ecbl/ecrb/ecxc× 14t1cmr.fdsizes,ecss/ecsi/ecsx/ecso× the 11 distinct sizest1cmss.fdreachesThe EC tier is not padding: without
ecxc1000.tfmthe20-t1-rm-bfscfixture measured 11.533 bp from pdfLaTeX, which sets it fromSFXC1000(=ecxc1000.tfm). After this tierec_tfm_filecan no longer name a metric the bundle lacks — the same invariant the typewriter tier (#183) established forFamilyKind::Tt.Provenance — measured, not asserted
linux-primaryhas TeX Live 2025 r78234 and no MacTeX, so release identity was established by byte-comparison, exactly as #183 did: every file already pinned from these packages was compared (cmp) against this distribution.public/lmTFMsjknappen/ecTFMsamsfonts/symbolsTFMsThe new members were copied from the same directories in the same run and hashed after the copy. No CTAN archive is present on this host, so no archive hash is claimed; the sidecars'
limitationfields say so.Independent corroboration for one of the new faces.
crates/font-engine/src/manifest.rsalready carried a pin forlm/lmsans10-regular.otf— sha256d431b786…, 95128 bytes — written by another lane, from another source, for a file that was not in the bundle (apps/mac/Fonts/lmsans10-regular.otfdoes not exist at the base commit). The copy this PR takes from TeX Live 2025 matches it exactly. All 6 Latin Modern entries in that manifest now match the bundle byte-for-byte (match=6 mismatch=0 absent=0), where one was previously unmatchable.Pins regenerated to their true values, never relaxed
SUPPLEMENTARY-FACES.json30 → 55 entries,SUPPLEMENTARY-METRICS.json155 → 322, each with a new provenance block.bundle-texmf.py check: 386 entries, allverified(9pinned, 55supplementary-face, 322supplementary).Every hard-pinned Swift count was regenerated, none weakened into a range:
latinModernFaceFiles.countlatinModernMonoFaceFiles.countlatinModernRomanShapeFaceFiles.countlatinModernSansFaceFiles.countentries.countsupplementary-facerowsentries.countseen.count)postScriptNameonly emitsLMRoman)Two things needed care beyond the counts:
testPackagingCheckVerifiesFacesAndRefusesDriftusedlmsans10-regular.otfas its "unpinned stray" sentinel, which this change makes a legitimately pinned face — the assertion would have silently changed meaning. It now useslmdunh10-regular.otf, a dunhill designlatin_modern_outlinehas no arm to return, so no tier can ever pin it.MAX_SUPPLEMENTARYinbundle-texmf.pyraised 65536 → 262144. It is a sanity bound on parsing an in-repo sidecar, not a trust boundary: every entry is still checked individually (byte_length+sha256) and any vendored file no pin lists is still refused asunpinned. 322 entries do not fit in 64 KB.Verification
macOS — the platform these tests actually run on
Xcode 26.6 on the owner's Mac, branch at
9a22ae62,apps/mac:(The two skips need a GUI session for macOS local-network permission; they pass there.)
A whole-suite "0 failures" does not by itself prove the regenerated counts were exercised rather than skipped, so the two classes that carry every changed pin were re-run with full per-test output:
Every assertion this PR changed is in a test that positively ran and passed:
testEveryProducerRequestableFaceIsVendoredAndPinnedcount == 58, mono 10, roman-shape 11, sans 14,entries.count == 55, and sha256 + byte_length for all 55 facestestPackagingCheckVerifiesFacesAndRefusesDriftsupplementary-facerows== 55, and the newlmdunh10-regular.otfstray sentineltestEveryPreviewMasterResolvesToARealCoreTextFaceseen.count == 21— ran, did notXCTSkiptestSupplementaryMetricsMatchTheirInRepoPinentries.count == 322, sha256 + byte_length for all 322, every-TFM-accounted-for, and thefaces_covered/ec_faces_covered/ams_symbols_coveredclaimsThe 3 skips are the
FLASHTEX_RENDER-gated real-producer tests. CI does run them (scripts/ci/build-helpers.shexportsFLASHTEX_RENDERintoGITHUB_ENV), so they are not free. Their core assertions were reproduced against the real producer on Linux with the same bundle (the macOS versions addsandbox-execto deny host TeX; no host TeX is on anyFLASHTEX_*path here and the producer does not probe for it):ec_metrics_unavailable0, missing-font/metric 0ec_metrics_unavailable7 → the assertion is not vacuousheadingsdocument with\textsf,\textsl,\textsc, bold-caps, bold-sans, sans-italic, bold-slantedec_metrics_unavailable0,font_outline_substituted1That one remaining substitution is
lmromancaps10-regular.otf: Latin Modern has no bold small-caps design; the medium one is drawn— an upstream Latin Modern gap, not a bundling gap, and the pre-existingNO_BOLD_CAPSnote infonts.rs. pdfLaTeX agrees: the oracle mapsSFXC→LMRomanCaps-Regularfor exactly this reason, which is why20-t1-rm-bfscnow passes.Linux — failing SET vs a control checkout of the same base
Control worktree at the same base (
6ea56c8a), same font environment on both sides,--no-fail-fastso the whole crate runs:render-pipelineThe three that flipped are exactly this PR's targets; the 5 that remain are exactly the environment-contaminated controls #202 fixes, byte-for-byte the list in that PR.
page_frame_against_pdflatexfootnotes_against_pdflatex21-book-chapter, off 0.512 bpfont_family_fixtures_match_pdflatexThe same comparison under the narrow env
Both sides also run with the pre-
93fb3219narrow env (public/lmalone):The set difference is exactly
{footnotes_against_pdflatex, page_frame_against_pdflatex}removed — zero new failures.font_family_fixtures_match_pdflatexstill fails under narrow on both sides, because the narrow env deliberately omitsjknappen/ec, where theecxcmetrics its T1 fixtures need live.To be precise about what that does and does not show: this is not a claim of whole-suite environment invariance, and #202 never made one either — it claimed invariance for
math_symbols+metrics_provenance, which this PR does not touch. The narrow env is an artificial configuration, not one the product ships:BundledMetrics.defaultBundledDirectoriesadvertises all three metric directories (asserteddirs.count == 3),Discovery::bundle_texmf_rootsderives them inside a real.app, and CI's env lists them. In every environment the product actually uses, all three tests pass.Running-head geometry — before/after against pdfLaTeX
Expected to change; that is the fix.
page_frame's chrome tolerance is 0.1 pt = 0.0996 bp.04-article-twoside-headingsp2, and the worst case in the set:"4"(page no.)"DISCUSSION""Left"(06-…-myheadingsp2)Chrome words matched, per fixture:
04-article-twoside-headings05-article-oneside-headings06-article-twoside-myheadings07-article-oneside-myheadingsBody text was already exact and stayed exact (
lines matched 82/82 x 82/82 y 82/82on both sides).Gates
font_unavailable/required_metrics_unavailable/ec_metrics_unavailable/font_outline_substituted/tfm_missing/math_font_unavailableacross all 10 fixtures. The 35math_resource_profilenotes are the pre-existing math-face profile notes (lmmi/lmsy/lmex/msbmdrawn from the OpenType math faces), identical on the control, and none is thelmr*roman-fallback markerTeX Live 2025 is an oracle only, never in the product path; no committed oracle expected data was regenerated.
Implementation-Agent: Claude Code engine-engineer (linux-primary / NixOS)