Skip to content

Ignore ascent metric in MonoFont conversion#50

Open
rfuest wants to merge 2 commits intoembedded-graphics:masterfrom
rfuest:ignore-metrics
Open

Ignore ascent metric in MonoFont conversion#50
rfuest wants to merge 2 commits intoembedded-graphics:masterfrom
rfuest:ignore-metrics

Conversation

@rfuest
Copy link
Member

@rfuest rfuest commented Mar 6, 2026

This PR changes the mono font conversion to only rely on the glyph bounding boxes to ensure that glyphs aren't cut off or overlap. The font bounding box and ascent metrics are ignored, instead a union of all included glyph bounding boxes is used.

@rfuest rfuest mentioned this pull request Mar 6, 2026
@matze
Copy link

matze commented Mar 8, 2026

Works fine as well, thank you!

@rfuest
Copy link
Member Author

rfuest commented Mar 8, 2026

Thanks for testing.

I've updated the PR to fix some edge cases and to add a setting to change how the glyphs of a proportional font are aligned in the larger monospace bounding box.

Left aligned:
Screenshot from 2026-03-08 19-59-14

Center aligned (the new default):
Screenshot from 2026-03-08 19-59-38

I think the more even spacing of the characters, especially narrow ones like I and J, look better in the centered version.

@matze
Copy link

matze commented Mar 8, 2026

I think the more even spacing of the characters, especially narrow ones like I and J, look better in the centered version.

Absolutely, I noticed that as well. Thanks for looking into this closer.

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.

2 participants