Skip to content

Adding a font to the default stylesheet causes corrupt glyphs to draw #488

@timojch

Description

@timojch

Repro

  1. Modify the Fonts block in default_ui_skin.mms so that it reads as follows
<Fonts UsedSpace="0, 0, 1024, 160">
	<Font Id="default-font" File="Inter-Regular.ttf" Size="20"/>
	<Font Id="tooltip-font" File="Inter-Regular.ttf" Size="16"/>
	<Font Id="monospace-font" File="Consolas.ttf" Size="18" />
</Fonts>
  1. Add a Consolas.ttf as a resource to the Myra.Monogame project with the path Resources.Consolas.ttf. (Any TTF file should work as long as it matches the above)
  2. Draw a UI containing two or more widgets which contain text using default-font.
  3. Change one of the widgets to use monospace-font.
  4. Draw the UI again.

Expected Result

The UI should draw with one label using the original default and the other font using Consolas.

Actual Result

Everything draws correctly before the font change.
After the font change, the Consolas label draws correctly, but everything that was using the default font draws garbage.

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