Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pixels cut off of some characters in render-glyph #253

Open
lte678 opened this issue Oct 6, 2024 · 0 comments
Open

Pixels cut off of some characters in render-glyph #253

lte678 opened this issue Oct 6, 2024 · 0 comments

Comments

@lte678
Copy link
Contributor

lte678 commented Oct 6, 2024

For some glyphs, pixels seem to be cut off in the render-glyph example (mostly, or only with subpixel rendering).
For example: '!'. Here it is only four pixels wide.

image

The glyph should normally look like this when rendered using the same settings to a larger canvas:
image
Here it is 5 pixels wide.

I believe this must be because the glyph size returned by raster_bounds() differs from rasterize_glyph() in Freetype.
Looking into raster_bounds(), I see that it does not pass any hinting information to the underlying typographic_bounds() function, but even if those are supplied, the size of the bitmap returned by raster_bounds() still differs from the actual bitmap that is rasterized. Perhaps because raster_bounds gets the size from FT_Glyph_Metrics instead of FT_Bitmap_Size.

This issue also occurs for a couple other letters. N is pretty bad too with these settings.

Font size: 32px
Font: DejaVuSans
HintingOptions: Full
Rasterization: SubpixelAa

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

No branches or pull requests

1 participant