Skip to content

Glyphs unaligned vertically because of hinting #3

@SolidAlloy

Description

@SolidAlloy

Hey, thanks for this implementation. I'm implementing an IMGUI library prototype and wanted to try MSDF. Your project gave me a start so that I could compare against something.

Unfortunately, an MSDF atlas cannot be used with the legacy text system without having vertical alignment issues. Look at this screenshot:
Image
The 'd' letter is noticeably lower than the other text. I put rectangles there to make it really obvious, but it's noticeable without them as well.

The issue stems from the legacy text system's use of font hinting behind the scenes. It helps when glyphs are rasterized, but breaks apart when any kind of SDF is used. Unfortunately, it cannot be changed.

I checked out TextMeshPro and the newest Unity TextCore module - they both allow for no hinting but don't have public methods for easy high-level text layout. All the higher-level components are internal, and the only thing they made public is FontEngine, which is very low-level. I basically have to reimplement the whole TextMeshPro layout code. This is how it looks with no hinting:
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions