Skip to content

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

@lte678

Description

@lte678

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions