Elementa icon indicating copy to clipboard operation
Elementa copied to clipboard

MSDF FontRenderer misaligned text height

Open Harry282 opened this issue 3 years ago • 0 comments

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

Harry282 avatar Apr 17 '22 14:04 Harry282