Skip to content

Fixed bold italic fonts not being restored on restart - #6632

Open
dekrom wants to merge 1 commit into
MeteorDevelopment:masterfrom
dekrom:fix/font-face-persistence
Open

Fixed bold italic fonts not being restored on restart#6632
dekrom wants to merge 1 commit into
MeteorDevelopment:masterfrom
dekrom:fix/font-face-persistence

Conversation

@dekrom

@dekrom dekrom commented Aug 30, 2026

Copy link
Copy Markdown

Type of change

  • Bug fix
  • New feature

Description

FontFaceSetting saves the font type with toString() and loads it with valueOf.
FontInfo.Type overrides toString so BoldItalic writes out as "Bold Italic" with a space,
and valueOf("Bold Italic") throws, so the catch quietly resets you to the default font.

Picking a Bold Italic face therefore never survives a restart. There is already a
FontInfo.Type#fromString that handles both "Bold Italic" and "BoldItalic", the load path
just was not using it.

Also null checks the face before setting it, since FontFamily#get returns null for a type the
family does not have, and moved the default fallback to a single exit instead of the changed
flag.

Related issues

None that I found.

How Has This Been Tested?

Not reproduced in game yet. FontInfo.Type#toString returns "Bold Italic" with a space and
valueOf only accepts BoldItalic, so the load always throws for that one type. Builds clean
against current master.

Checklist:

  • My code follows the style guidelines of this project.
  • I have added comments to my code in more complex areas.
  • I have tested the code in both development and production environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants