Repository navigation
Fix #136: SVG export and CSS write each style's numeric font-weight - #148
Merged
Merged
Conversation
font_props wrote `bold` for any style whose name contained bold, black or heavy and nothing for the others unless fonts were embedded, so Semibold came back Bold and Light or Medium came back Regular. It now writes the style's numeric weight (font_descriptor, from style_weight) for every writer: 600 for Semibold, 300 for Light, 900 for Black, `bold` for 700 and nothing for 400. The SVG import already reads these numbers back to the matching face. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 5, 2026
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.
Fixes #136: SVG export and the CSS Properties panel write each font style's numeric weight.
font_propsincrates/svg/src/css.rs, which both writers share, now writes the weight thatfont_descriptor/style_weightalready computed: 100–900,boldfor 700, and nothing for 400. Semibold becomes 600, Light 300, Black 900.embeds_fontshelper is removed because nothing uses it any more.crates/svg/tests/font_weights.rschecks the SVG and CSS output for 13 styles and that the re-imported text uses the same face. Both tests fail without the fix.Checks
mainat088ffc8(Fix #87: rust-version 1.95 and clippy 1.95 #144).cargo xtask cipasses all 7 steps (fmt, clippy, tests, assets, brands, layers, wasm) at the top of the stack, with 2,935 tests.🤖 Generated with Claude Code