Skip to content

Freetype fixes - #1240

Open
kierank wants to merge 3 commits into
Upipe:masterfrom
kierank:freetype-fixes
Open

Freetype fixes#1240
kierank wants to merge 3 commits into
Upipe:masterfrom
kierank:freetype-fixes

Conversation

@kierank

@kierank kierank commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Someone with more freetype knowledge should check these. Claude was insistent they were bugs.

kierank and others added 3 commits August 26, 2026 20:30
The renderer read the coverage of a glyph at buffer[j * width + i], which is
only where it is when the bitmap has no padding between its lines.  Both the
small bitmap cache and a rendered glyph say what the distance between two
lines is, so use it: with a padded bitmap the glyph was sheared by a pixel per
line and read past the end of the buffer on the last ones.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The left of the box was taken from the first glyph under "if (!i)", but the
string index is advanced before the test, so it was never zero and the box
always started at zero however far into the line the first glyph sat.  Take it
from the first glyph that is actually looked up.

The height was assigned twice, the second time without the guard the first one
had, which made the guard do nothing; drop the second one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The scaler handed to the cache manager is a stack structure with two fields
left unset; the manager keeps a copy of it.  They are the resolutions, which
it only reads when the sizes are not in pixels, so nothing came of it, but
zero them rather than hash and store whatever was on the stack.

FT_Get_Advance leaves its output untouched when it fails, and the result was
added to the total either way.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@cmassiot
cmassiot requested a review from quarium August 27, 2026 10:59
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.

1 participant