Repository navigation
Text: a space after a symbol-font character keeps the run's font - #1417
Conversation
PowerPoint stores an arrow typed in a Wingdings run as U+F0E0 with <a:sym typeface="Wingdings"/> on the whole run, and draws only the symbol code in Wingdings: the space after it is the run's own font. A synthetic deck with "→ Only …" (U+F0E0, a space, words) in one run with a:sym, and the same with a:sym on the arrow's run alone, exported as PDF, draws both lines alike. DeckCraft kept the space in the arrow's face, since spaces, digits and punctuation stay in the face of the text before them, and Wingdings' space is about four times a text font's: the words started 20 pt further right. A neutral character no longer stays in a symbol font's face (is_symbol_font); it takes the run's font like any other. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Neutral character selection and validation crates/text/src/lib.rs, crates/text/src/tests.rs, ROADMAP.md |
The preceding-face reuse rule now excludes recognized symbol fonts. The test checks that a following space and words do not use Wingdings, and compares word positioning. The roadmap records the change. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related issues
- Issue 1364 reports that spaces and
+after fallback symbols use the fallback font instead of the run font. This change addresses neutral-character font selection after symbol-font characters.
Suggested reviewers: echelon, hamzaelkachtaf4-star
Merge Risk: 
Minimal · up to 08651
-
The font-selection change appears ready to merge after normal checks; no actionable risk remains.
Architecture risk: 
Low · up to 08651
-
The change affects 2 systems.
Changed systems:
crates,ROADMAP.mdArchitecture concerns
No architecture-level concerns identified.Review details
-
Systems and components
- observed — crates (service) was modified; 2 changed files map to changed impact.
- observed — ROADMAP.md (service) was modified; 1 changed file maps to changed impact.
Before / after behavior
- observed — Modified behavior in ROADMAP.md: Adds a progress-log entry describing that spaces, digits, and punctuation after symbol-font characters now draw in the run’s own font, rather than in the symbol font.
- observed — Modified behavior in ROADMAP.md: Adds a trivial revision-history entry for the progress-log update about characters following symbol-font characters.
- observed — Modified behavior in crates/text/src/lib.rs: The comment now excludes symbol fonts from the stated rule for keeping spaces, digits, and punctuation with the preceding text face, noting that symbol-font spaces can be much wider.
- observed — Modified behavior in crates/text/src/lib.rs: Preceding-face reuse for neutral clusters now requires that the preceding face is not a recognized symbol font. Previously, any non-color preceding face could be reused if it covered the cluster and the character style matched; symbol-font faces now proceed to the cascade path instead.
-
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
I checked the PowerPoint claim in this PR against real PowerPoint on Windows (COM). I did not build or run the Rust code, so the new test was not run by me (it skips without Wingdings anyway). This PR currently conflicts with main (merge state DIRTY); I reviewed the diff at 0865152. What I ran: a hand-built .pptx with two 24 pt text boxes, both Arial with
So PowerPoint draws only the symbol code in the |
Text: a space after a symbol-font character keeps the run's font
|
Landed on main, thank you @pick2510 for the contribution! If you haven't already, come join us on Discord: https://discord.gg/artcraft |
|
Note on what I changed before landing: merged main in and moved the guard to |
What
An arrow typed with a symbol font, as in "→ Only regulations…", is stored as U+F0E0 with
<a:sym typeface="Wingdings"/>. PowerPoint puts thata:symon the whole run, words included. PowerPoint draws only the symbol code in Wingdings; the space after it is in the run's own font.DeckCraft kept that space in the arrow's face, because spaces, digits and punctuation stay in the face of the text before them. Wingdings' space is about four times as wide as a text font's, so the words after the arrow started about 20 pt too far right (24 pt text).
Evidence
a:symon a whole "→ Only …" run,a:symon the arrow's run alone, plain text, and the arrow without a space. In PowerPoint for Mac 16.114's PDF export, the first two lines are identical. DeckCraft now draws the same; before, the first line had the wide gap.How
crates/text/src/lib.rs: a neutral cluster (space, digit, punctuation) stays in the previous face only if that face isn't a symbol font (is_symbol_font: Wingdings, Webdings, Symbol, Marlett). Otherwise it takes the run's font like any other character. Symbol codes themselves still draw in thea:symfont.Relation to #1049
#1049 (amosarc) makes all ASCII and high-ANSI neutrals take the run's Latin typeface by code range, which would also cover this case. It's broader (CJK runs, glyph advances), and this PR is one condition. If #1049 lands first, this reduces to its test, which pins the Wingdings case.
Tests
text::tests::a_space_after_a_symbol_font_character_keeps_the_runs_font: witha:sym Wingdingson the whole run, the space and the words aren't in Wingdings, and "Only" starts where it does when only the arrow carriesa:sym. Like the other symbol-font tests, it skips when Wingdings isn't installed (it runs on macOS with Office). Before: the space in the Wingdings run, and "Only" at 62.6 pt instead of 42.4 pt.cargo xtask ci: fmt, clippy, pdf-deps,assets,layersandwasmpass, and so do the doctests.cargo test --workspace --no-fail-fastpasses 2,112 tests, with one failure,backstage::tests::start_screen_opens_the_palette_and_preferences(a panic in egui's font code since the egui 0.37 migration), which fails the same way onmain.Summary by CodeRabbit