Faux bold when the font does not support it#543
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #543 +/- ##
======================================
Coverage 84% 84%
======================================
Files 332 333 +1
Lines 24708 24815 +107
Branches 3618 3640 +22
======================================
+ Hits 20813 20917 +104
Misses 3009 3009
- Partials 886 889 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
JimBobSquarePants
left a comment
There was a problem hiding this comment.
Thanks for this. I’m going to accept this PR as an initial integration point, but with some important caveats.
Synthetic bold should be owned by Fonts so that all renderers receive the same glyph geometry. However, the current emboldening implementation should not be treated as final. I want to follow browser layout behavior, meaning synthetic bold should not change layout advance, but I also want the actual outline dilation logic to be much closer to FreeType’s outline emboldening algorithm.
So I’m going to merge this to unblock the feature, then follow up by replacing/refining the dilation algorithm and adding stronger tests around counters, mixed contour winding, CFF/TrueType outlines, and bounds behavior.
|
Thank you; let me know if you'd like me to spend more time on any of it! |
Prerequisites
Description
A follow-up to #542 - should be merged after the italic one.
Bold is much more complex than italic, because it requires dilating glyphs, although it does not require changing the advance (I thought it would require it but comparing to Chrome, it looks fine with just widening the glyphs).
Disclaimer: this code was written using AI (Copilot with Claude Opus 4.8), and reviewed by me. However, while the italic PR is fairly simple to understand, I don't have the knowledge to personally fully verify
EmboldeningGlyphRenderer. This being said, the logic looks sound and renders correctly.Thanks for your consideration!