Skip to content

Fix cell height calculation#48

Open
matze wants to merge 1 commit intoembedded-graphics:masterfrom
matze:fix-character-cell-calculation
Open

Fix cell height calculation#48
matze wants to merge 1 commit intoembedded-graphics:masterfrom
matze:fix-character-cell-calculation

Conversation

@matze
Copy link

@matze matze commented Jan 27, 2026

This fixes two isses: clipped glyphs for when the computed bounding box does not match the actual bounding box and glyphs leaking into others.

This fixes two isses: clipped glyphs for when the computed bounding box
does not match the actual bounding box and glyphs leaking into others.
@rfuest
Copy link
Member

rfuest commented Mar 2, 2026

Looks good at first glance. Can you provide a font file which shows this issue, so that I can test it myself? I have another unmerged branch that might interfere with these changes and I want to make sure I don't accidentally break the fix again.

.glyphs
.iter()
.filter_map(|g| {
matches!(g.encoding, Encoding::Standard(_))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this ignore glyphs without a standard encoding?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not too familiar with the codebase and followed basically what was done in line 104 and 116.

@matze
Copy link
Author

matze commented Mar 4, 2026

Can you provide a font file which shows this issue, so that I can test it myself?

I am not sure if the font license allows redistributing but it should be fairly easy to reproduce. I used otf2bd to produce a 64 pixel tall rendition of Archivo Narrow with

otf2bdf -r 72 -p 64 ArchivoNarrow-Regular.ttf -o archivo.bdf

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