Repository navigation
compiler: em/ex for slanted and small-caps fonts from real TFM fontdimens (stacked on #587) - #618
Merged
Merged
Conversation
What changed: - Preserve font-relative metrics in expansion checkpoints and shifted incremental checkpoints. What was run: - test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s - test result: ok. 55 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.01s - test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.25s - test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s - test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s Next step: - Integrate compiler font-relative dimension handling. Implementation-Agent: codex gpt-5.6-luna (max) Commit-Executor: codex (this session) Lane-Owner: daniel-parent (mac-m5pro-dq222)
What changed: - Resolve em/ex dimensions from the active compiler class, size declaration, and known Core14 family metrics. - Preserve source interword glue around hspace and accept parser-owned global length prefixes, including table length names. - Add pdflatex-measured regression coverage for dimensions, register values, grouping, and invalid global setlength. What was run: - test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s - test result: ok. 18 passed; 0 failed; 0 ignored; 0 measured; 321 filtered out; finished in 0.01s - test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 7 filtered out; finished in 0.00s - test result: ok. 339 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.48s Next step: - Integrate this branch into the parent branch. Implementation-Agent: codex gpt-5.6-luna (max) Commit-Executor: codex (this session) Lane-Owner: daniel-parent (mac-m5pro-dq222)
…\setlength is valid Addresses the independent review on #587. What changed: - em/ex are the selected text font's \fontdimen6/\fontdimen5, not the class point size. src/text_fontdimens.rs (generated by scripts/gen_text_fontdimens.py from pdflatex) records them for OT1/T1 x CM/lmodern x rm/sf/tt x m/bx x n/it x the 12 LaTeX sizes. cmr12's quad is 11.74988pt, so 12pt 3em = 35.24963pt. - The parser path resolves \small/\large/\bfseries/\sffamily/\ttfamily/ italics/fontenc/lmodern through it, scaling with TeX's §455 arithmetic (0.65em in ecrm1095 = 7.07704pt). - tex-expansion tracks host font switches (\small, \bfseries, \textbf{..}, \emph, ...) as a grouped font selector and asks FontMetrics::quad_sp_in. Checkpoints keep the metrics provider, so restored engines match. - \global\setlength / \global\addtolength are passed to the parser and applied globally (pdflatex accepts them; \setlength is a macro). - \fboxsep=/\fboxrule= assignments work in the body with \global; a body \parskip= gets the same "not implemented" warning as \setlength. - Table lengths are documented as stateless; their test no longer claims to check scoping. What was run: - cargo test --manifest-path crates/compiler/Cargo.toml --no-fail-fast: 58 targets, all "test result: ok"; lib "ok. 339 passed; 0 failed"; em_global "ok. 11 passed; 0 failed"; preamble_lengths "ok. 13 passed; 0 failed"; expansion_incremental "ok. 2 passed; 0 failed" - cargo test --manifest-path crates/tex-expansion/Cargo.toml: "ok. 55 passed", "ok. 3 passed", "ok. 2 passed" Next step: independent re-review, then vendor re-pin after merge. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
What changed: - Generate deterministic em/ex rows for upright, italic, slanted, and small-caps NFSS shapes across the existing setups. - Track slanted and small-caps styles on parser and expansion register paths, including bx/sc fallback coverage. - Pin pdflatex 10/11/12pt sl/sc and bfseries/sc values. What was run: - python3 crates/compiler/scripts/gen_text_fontdimens.py --texbin /Library/TeX/texbin - CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-sl-sc CARGO_BUILD_JOBS=4 cargo test --manifest-path crates/tex-expansion/Cargo.toml - CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-sl-sc CARGO_BUILD_JOBS=4 cargo test --manifest-path crates/compiler/Cargo.toml Next step: - Integrate this commit into the parent branch. Implementation-Agent: codex gpt-5.6-luna (max) Commit-Executor: codex (this session) Lane-Owner: daniel-parent (mac-m5pro-dq222)
Contributor
Author
|
daniel-parent independent review (subagent)
No issues found. The expansion cache also correctly invalidates on |
Conflicts: crates/compiler/src/parser.rs (both sides added TABLE_LENGTHS; kept main's const/doc, updated main's dispatch arm to the branch's three-argument length_assignment with \global support) and crates/tex-expansion/src/registers.rs (kept branch's xn_over_d and scale_internal_dimen, dropped the branch's duplicate round_decimals in favour of main's public one, kept main's tests). Regenerated supported-latex artifacts; bundled copy in sync. Implementation-Agent: fable-rebase-d Commit-Executor: fable-rebase-d (direct; Cursor usage limit)
…olved) into agent/daniel-parent/fontdimens-sl-sc Clean merge of the parent branch's main-merge; regenerated supported-latex artifacts (no drift), bundled copy in sync. Implementation-Agent: fable-rebase-d Commit-Executor: fable-rebase-d (direct; Cursor usage limit)
/#568) Conflicts: - crates/compiler/src/parser.rs: both sides appended P fields; kept both. - crates/compiler/src/expansion.rs: #610 replaced the halted/re-expand flag with recovered/resume-unexpanded and threads limits through build_cache; kept that structure and carried this branch's DocumentFonts cache key and configure_with_fonts init. - crates/tex-expansion/src/expand.rs, incremental.rs: kept both sides' new State/Checkpoint fields (font_switches/pending_font_switch/metrics and group/conditional_limit_reported/last_origin/peak_memory); dimen scanning combines main's clamped_number with this branch's scale_unit/scale_internal_dimen em/ex handling. Regenerated supported-latex artifacts; bundled copy in sync. Implementation-Agent: fable-rebase-d Commit-Executor: fable-rebase-d (direct; Cursor usage limit)
glue) Conflict: crates/compiler/src/parser.rs \vspace — #606 parses rubber glue (parse_glue_pt_at), this branch parses em/ex against the active font. Combined: parse_glue_pt_current parses each glue component with parse_dimen_pt_current. Updated #606's vspace glue test to the branch's pdflatex-verified em semantics (1em = cmr10 quad 10.00002pt, not BODY_SIZE_PT) and widened Block::VSpace patterns in this branch's tests for the new stretch/shrink fields. Implementation-Agent: fable-rebase-d Commit-Executor: fable-rebase-d (direct; Cursor usage limit)
Merged the final 587 branch tip first, then main; main's squash of #587 is byte-identical to that tip for the four add/add files (font_units.rs, text_fontdimens.rs, em_global.rs, gen_text_fontdimens.py), so the branch side — 587 final plus this branch's slanted/small-caps fontdimens — is the resolution. All other files auto-resolved. Regenerated supported-latex artifacts; bundled copy in sync. Implementation-Agent: fable-rebase-d Commit-Executor: fable-rebase-d (direct; Cursor usage limit)
GoKubar
added a commit
that referenced
this pull request
Sep 15, 2026
/#635 grew the inventory docs/user/compiler.md (generated) conflicted again; took main's copy and regenerated via render_supported_latex.sh so \underbar and main's additions both appear, sync --check clean. Implementation-Agent: fable-rebase-a Commit-Executor: fable-rebase-a (direct; Cursor usage limit)
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.
What
Stacked on #587.
em/exfor slanted (\slshape,\textsl) and small-caps (\scshape,\textsc) fonts now come from the real TFM fontdimens, not from the italic values. This works on both the parser path and the expansion register path.\bfseries\scshapeem / exbx/scfalls back tobx/n, matching pdflatex's substitution warning. The values come from pdflatex\showthe, via #587's generator (gen_text_fontdimens.py). Rerunning the generator produces byte-identical output.Why
It closes items (a) and (b) of #587's Not done. Item (c),
\normalfontresetting the size, is assigned separately.Overlap check
GH-FONTDIMENS-SL-SC.Test results
Not done
vendor/compilerre-pin.🤖 Generated with Claude Code
https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz