Skip to content

Fix #136: SVG export and CSS write each style's numeric font-weight - #148

Merged
bflatastic merged 1 commit into
mainfrom
fix/issue-136
Oct 5, 2026
Merged

bflatastic merged 1 commit into
mainfrom
fix/issue-136

Conversation

@bflatastic

Copy link
Copy Markdown
Member

Fixes #136: SVG export and the CSS Properties panel write each font style's numeric weight.

  • font_props in crates/svg/src/css.rs, which both writers share, now writes the weight that font_descriptor/style_weight already computed: 100–900, bold for 700, and nothing for 400. Semibold becomes 600, Light 300, Black 900.
  • The importer already reads numbers back to the right face. The private embeds_fonts helper is removed because nothing uses it any more.
  • Tests: crates/svg/tests/font_weights.rs checks 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

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: SVG and CSS export write Semibold text as bold, and Light or Medium as regular

1 participant