Repository navigation
Conversation
Co-authored-by: Brandon Thomas <echelon@gmail.com>
* M7: select real Japanese fallback faces by family and weight Refs storytold#184. Keep Type 3 font-name reporting separate in storytold#387; missing weights and the small web font input remain explicit limitations. Assisted-by: OpenAI GPT-6.1 (gpt-6.1-sol) * Test the Japanese fallback name for a sans source: the Gothic face since storytold#394 matches the source style Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Brandon Thomas <echelon@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Light, Medium and Semibold were collapsed to Regular or Bold. The font menu now lists the family's own faces, and a named face is what gets saved in the typeface. Co-authored-by: Cursor <cursoragent@cursor.com>
06cac49 to
7c5a512
Compare
|
Thanks for this. Listing and drawing the font faces a family really has (Light, Semibold and so on), and saving them by typeface name, still looks valuable. I checked just now: the PR is open, GitHub reports it conflicts with |
* ui: use craft_ui::ComboBox so dropdown menus grow back (egui#5225); repin craft-libs * chore(deps): craft-libs 60d60d48 (dropdown fixes) * chore(deps): craft-libs 6af63481 (dropdown fixes) * chore(deps): craft-libs 4d7b82f7 (dropdown fixes) * chore(deps): craft-libs 92d392cf (#387 merged) * chore(xtask): pdf-deps expects craft-libs 92d392cf
FredApps
left a comment
There was a problem hiding this comment.
ReviewerA — source-read COMMENT (not an approval)
I read the head of the diff: the font faces a family actually has are drawn (#69). The family's own list (Light, Semibold and others) is offered, drawn and saved as the typeface name, and the ROADMAP's scores are rewritten by hand (feature breadth 80% weighted over 191 features, menu bar coverage 59% of 217 items), which are measurements made by the project's tooling and are better regenerated by it. PowerPoint offers fonts such as "Segoe UI Semibold" as separate families, so saving the face as the typeface name matches the file format. This overlaps deckcraft#1864 and designcraft#1969 on named instances and legacy names, and the font naming rules should be shared. I have not run it, and no exact-head CI result exists for this head. Nothing was run.
I ran nothing and have no exact-head CI result for this PR, so this is not an approval. Where a diff was long I read its code hunks rather than every generated or documentation line.
Status: waiting_author.
aiongg
left a comment
There was a problem hiding this comment.
AI-generated review (Opus). Not a maintainer decision.
Changes needed:
This adds a per-family face menu, draws the chosen face and writes it into the .pptx typeface name. Rendering and the basic save and reopen path work, but the face is kept apart from the family and goes stale in several paths.
- crates/model/src/text.rs:412 inherits
font_styleon its own, but crates/pptx/src/read/dml.rs:533-541 only sets it when a style was split off. A run with an explicitlatin typeface="Arial"under a list style withInter Lighttherefore draws and saves as Arial Light. A plain typeface should clear the inherited face (for example by storing an empty style), and format.bold or choosing Regular should not let an inherited face come back. - Changing the family keeps the face:
format.font(crates/engine/src/cmd/format.rs:316) and the Font dialog'swrite(format.rs:518-520) setfontbut leavefont_style, so Inter Light then Arial is saved asArial Light. - The Font dialog's Bold and Italic (format.rs:524-529) set the flags without clearing
font_style, andfont_dialog_params(format.rs:665-666) reads the raw flags. On a Semibold run, unticking Bold keeps it Semibold, and the dialog can disagree with the ribbon. - Splitting the typeface on read changes what Replace Fonts sees (crates/engine/src/fonts.rs:71, 165). A deck using
Segoe UI Semiboldnow listsSegoe UI, and replacing it keepsSemiboldon the new family. Theme fonts (crates/pptx/src/read/theme.rs:20) are not split, so the same face can show up under two names. - The substitutes entries
segoe ui light,segoe ui semiboldandfranklin gothic medium(crates/fonts/src/fontdb.rs:39, 46) can no longer be reached from runs, because the family is split before lookup. - ROADMAP.md adds a second Feature breadth row (80%) beside the existing 84%, a second Features dimension row and a second Tables row (89% beside 97%). These look like merge leftovers. The headline numbers should be regenerated by the parity tool, not added by hand.
- The ribbon list (crates/ui-egui/src/ribbon.rs:512-527) and the face lookup in layout (crates/text/src/lib.rs:437-440) do what the description says.
Claims checked:
- verified: The Home font menu lists each family's own faces, not only Regular, Bold and Italic (crates/ui-egui/src/ribbon.rs:512-527 builds the style dropdown from FontDb::styles(&font) (crates/fonts/src/fontdb.rs:847-863) and runs format.fontStyle on click)
- verified: A named face is drawn from that face (crates/text/src/lib.rs:437-440 uses font_style as the style name for document_face and suppresses fake bold and italic when the named style already implies them. The face chain and cascade use st.style_name (lib.rs:508, 802, 875, 886))
- contradicted: A .pptx save writes the face in the typeface name so it comes back as the same face (The writer joins family and face at crates/pptx/src/write/dml.rs:688 and the reader splits them at crates/pptx/src/read/dml.rs:533-541. But a plain typeface leaves font_style None, and crates/model/src/text.rs:412…
- contradicted: Bold still selects the family's Bold face (format.bold clears font_style (crates/engine/src/cmd/format.rs:270-276), but the Font dialog's write sets bold and italic without clearing it (format.rs:524-529), and font_dialog_params reads the raw flags (format.rs:665-666). Clearing to None also lets an…
Recommendation: update the pull request; it will be reviewed again.
Reviewed at 7c5a512.
Summary
.pptxsave writes it in the typeface name (Inter Light) so it comes back as the same face.Test plan
cargo test -p deckcraft-pptx --lib typeface::cargo test -p deckcraft-engine --lib a_named_font_stylecargo test -p deckcraft-pptx --test roundtrip a_named_font_stylecargo clippy -p deckcraft-fonts -p deckcraft-model -p deckcraft-text -p deckcraft-engine -p deckcraft-pptx -p deckcraft-ui-egui -- -D warnings.pptx, and reopenMade with Cursor