EssentialGG / Elementa

A simple, declarative GUI library for Minecraft
GNU Lesser General Public License v3.0
351 stars 30 forks source link

MSDF FontRenderer misaligned text height #56

Closed Harry282 closed 11 months ago

Harry282 commented 2 years ago

Describe the bug Text rendered with the MSDF FontRenderer is higher than it should be, outside the bounding box of the constraints.

To Reproduce Steps to reproduce the behavior:

  1. Render any UIText with fontProvider set to one that uses MSDF FontRenderer.
  2. Having an OutlineEffect makes the misalignment easier to see.

Expected behavior Text should be rendered inside the bounding box of the constraints.

Screenshots image Sample text rendered using DefaultFonts.ELEMENTA_MINECRAFT_FONT_RENDERER with CenterConstraint() and an OutlineEffect().

image Same text and code, but using DefaultFonts.VANILLA_FONT_RENDERER instead.

Additional context Only affects fonts created with FontRenderer. VanillaFontRenderer and BasicFontRenderer are rendered correctly