Surface silent PDF rendering loss: gate dropped glyphs, report overflow, fix \setminus#103
Merged
Merged
Conversation
…ow, fix \setminus Two changes so the PDF build stops silently dropping content from the rendered output. The PDF opens fine, but individual math glyphs go missing with no error surfaced -- so a downstream spec build shipped with missing symbols unnoticed. 1. PDF quality gate (#100). The stderr filter previously suppressed every Overfull \hbox warning and let "Missing character" warnings scroll past without failing the build. Now: - Missing-character / unrepresentable-glyph warnings FAIL the build by default (a silently dropped character is meaning-changing); --no-check-glyphs downgrades to a warning. - Overfull \hbox (Xpt too wide) are collected and REPORTED worst-first, non-fatal by default; --check-overflow makes them fatal, --overflow-threshold-pt sets the cutoff (default 1.0pt). - Underfull boxes still ignored. 2. \setminus remap. unicode-math maps \setminus to U+29F5 (reverse solidus operator), which no bundled math font provides (DejaVuMathTeXGyre and latinmodern-math both lack it; tectonic ships only latinmodern-math.otf). It rendered as a blank box. Remapped to U+2216 (standard set-minus), which DejaVuMathTeXGyre has. Resolves #100. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
dgovil
self-requested a review
June 30, 2026 21:54
dgovil
approved these changes
Jun 30, 2026
The diff self-test invokes the builder with a types.SimpleNamespace args object that has none of the new gate flags, so args.no_check_glyphs raised AttributeError. Read the three flags via getattr, and define their defaults as module-level constants (GATE_DEFAULT_*) referenced by both the argparse `default=` and the getattr fallbacks -- single source of truth, so the CLI and programmatic-caller paths cannot drift apart. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
asluk
force-pushed
the
wip/glyph-fallback-and-ci-report
branch
from
June 30, 2026 22:36
1fc048c to
b517fff
Compare
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.
Two changes to stop the PDF build from silently dropping content from the rendered output. The PDF opens fine — but individual glyphs go missing from the math with no error surfaced, so a downstream spec build shipped with missing symbols unnoticed.
1. PDF quality gate (#100)
doc_builder.py's stderr filter previously suppressed everyOverfull \hboxwarning and letMissing characterwarnings scroll past without failing the build. So right-margin overflow and silently-dropped glyphs were both invisible in CI.New behavior in the
stderr_processor+ a new_report_pdf_diagnosticshelper:--no-check-glyphsdowngrades to a warning.\hbox(Xpt too wide) → collected and REPORTED, worst-first, non-fatal by default.--check-overflowmakes them fatal;--overflow-threshold-ptsets the cutoff (default1.0).Sample output:
2.
\setminusremap (template/after-header-includes.latex)unicode-mathmaps\setminus→ U+29F5 (reverse solidus operator), which no bundled math font provides — DejaVuMathTeXGyre and latinmodern-math both lack it, and tectonic's bundle ships onlylatinmodern-math.otfas an OTF math font. Result:\setminusrenders as a blank/tofu box. Remapped to U+2216 (standard set-minus), which DejaVuMathTeXGyre has:Minimal repro (blank before, set-minus after):
$A \setminus B$This is purely an engine/font-coverage gap, so it belongs here. (A separate, source-level issue — a text-mode
\^accent misused in math mode, which drops the accent — is fixed in the downstream spec source, not here.)Validation
Built a downstream spec against this branch (local Windows + Linux CI, byte-identical PDFs): 0 missing-glyph warnings after the fix; set-minus renders. Validated in CI both directions: a clean build passes; a deliberately-reintroduced missing glyph fails the build (gate message + exit 1) with overflow staying non-fatal — so the build fails only on the dropped glyph, as designed. Before/after renders available on request.
Decisions for maintainers (@OleksiyPuzikov @dgovil)
This touches every spec's CI, so the defaults are a policy call:
>= 1.0pt. Honest but noisy (~185 lines), largely fromRaggedRight+ wide math. Keep non-fatal default, or pick a higher threshold?C:/font paths breakfontspec; the existing relative posixdejavufontpathworkaround is what makes it build. Confirms Debug the LaTeX handling of Windows paths in the font setup #23's root cause; nothing here depends on changing it.