Skip to content

Fix: font style setting follows the font intrinsic style - #830

Open
nborodikhin wants to merge 1 commit into
LoveRetro:mainfrom
nborodikhin:fix/reset-font-style-on-font-change
Open

Fix: font style setting follows the font intrinsic style#830
nborodikhin wants to merge 1 commit into
LoveRetro:mainfrom
nborodikhin:fix/reset-font-style-on-font-change

Conversation

@nborodikhin

@nborodikhin nborodikhin commented Sep 6, 2026

Copy link
Copy Markdown

Description

The issue:

  • NextUI setting "Font Style" is wrong on either bold or non-bold fonts.

TTF font bears a property what style it is - regular, bold, italic, bold italic. NextUI has a setting to choose the font style (Normal/Bold) which is applied to the system font.

The issue is that due to the the SDL_ttf implementation, there are several possibilities, two if which are wrong. Check the following table which demonstrates the issue on Rounded Mplus 1c font (default NextUI font):

Font Face Font style: Normal Font style: Bold
Regular image
font drawn Regular
Correct
image
font drawn Bold (synthetic)
Inconsistent stroke width, digit metrics
Bold image
font drawn Bold
Incorrect - normal expected
image
font drawn Bold
Correct

From the table it is clear that:

  • Normal style setting yields the Bold look for a Bold face font
  • Bold style setting produces an unbalanced look for a Regular face font.
  • The only correct visual representation of the font is when the style setting matches the intrinsic font face.

Matching font style setting to the font is important even when system font is bold - third-party apps may use their own fonts but rely on the font style to match NextUI's look-and-fell.

#749 which added the font style setting made it sticky. As a result, when user selected a font with a different font face weight, they get either a non-optimal "synthetic bold" look or a wrong bold look on a normal setting.

This change implements a better approach: on font selection, font style resets to match the selected font face. This way on a font change it always produces the correct combination.

Brief history of the default NextUI font

  • 2025-02-01 - v0.01-beta - BPreplay Bold
  • 2025-02-28 - v1.7.1-release - Rounded Mplus 1c Bold
  • 2025-02-28 - v1.7.2-release - ChillRoundM Regular
  • 2025-03-01 - v1.8.0-release - Rounded Mplus 1c Bold
  • 2025-04-09 - v3.0.0-release - Rounded Mplus 1c Bold

There was no option to control the style of the font, it was dictated by the font file (same as Normal today).

Change

  • add GFX_getSystemFontFaceStyle() to detect the intrinsic font style before NextUI applies the configured style
  • reset the Font Style setting after each font selection and each Appearance reset
  • map values in CFG_setFontStyle() to Normal or Bold from the SDL_ttf Bold bit

Testing

  • check on tg5040, desktop
  • confirm that when I select a Regular face font, Font Style setting drops to Normal

@nborodikhin nborodikhin changed the title Fix: reset font style when selecting fonts Fix: font style setting follows the font Sep 6, 2026
@nborodikhin nborodikhin changed the title Fix: font style setting follows the font Fix: font style setting follows the font intrinsic style Sep 6, 2026
@nborodikhin
nborodikhin marked this pull request as ready for review September 6, 2026 19:45
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.

1 participant