Skip to content

Conversation

@RytoEX
Copy link
Member

@RytoEX RytoEX commented Aug 8, 2025

Description

Add support for variable font weights to obs-text (the GDI+ Text Source).

Instead of simply checking if a font is bold or not (which in Qt is equivalent to font.weight() > Medium / font.weight() > 500),

Motivation and Context

Fixes #12393

https://doc.qt.io/qt-6.8/qfont.html#Weight-enum
https://learn.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-logfontw

How Has This Been Tested?

Tested locally on Windows 11.

For the most part, this improves user experience when using variable fonts. Some changes, such as between Regular and Medium styles, still do not seem to show a difference, even if the code does not actually call UpdateFont().

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@RytoEX RytoEX added this to the OBS Studio 31.1 milestone Aug 8, 2025
@RytoEX RytoEX requested review from Lain-B and PatTheMav August 8, 2025 17:46
@RytoEX RytoEX self-assigned this Aug 8, 2025
@RytoEX RytoEX added Bug Fix Non-breaking change which fixes an issue Seeking Testers Build artifacts on CI Windows Affects Windows labels Aug 8, 2025
@RytoEX
Copy link
Member Author

RytoEX commented Aug 8, 2025

Will dig into this a bit more. It seems the QFont isn't fully initialized until after QFontDialog returns, and I'll have to determine if we need to deal with the font weight at all in the properties-view.

Copy link
Collaborator

@Lain-B Lain-B left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outside of the build issues this seems fine 👍

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

Labels

Bug Fix Non-breaking change which fixes an issue Seeking Testers Build artifacts on CI Windows Affects Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some fonts do not render correctly as of v31.1.0-beta1

2 participants