Skip to content

Uneven text for non-integral DPI scaling #382

@emilk

Description

@emilk

with 1.25 pixels_per_point text can become uneven:

egui_0 12

The reason it gets like that is because I render each character as a textured quad. The font kerning requires a non-integral number of pixels of offset between characters. If I do that I get either blurry fonts (bilinear sampling) or weird offsets (round to nearest pixel).

Rounding to nearest pixel is done in Font::layout_single_row_fragment and in Tessellator::tessellate_text.

If we don't round to closest pixel, the text becomes even, but blurry:

no_rounding

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is brokentextProblems related to text

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions