obs-text: Fix changing fonts for Qt 6.7+#12483
Open
RytoEX wants to merge 3 commits into
Open
Conversation
Member
Author
|
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. |
Lain-B
approved these changes
Aug 16, 2025
Lain-B
left a comment
Collaborator
There was a problem hiding this comment.
Outside of the build issues this seems fine 👍
|
Is there a completed build that can be tested? |
6e5b2d7 to
23b3793
Compare
Member
Author
|
Rebased this. Will push additional fixes later to see if those help. |
13872f7 to
a4cbbd6
Compare
Also, fix the comparison order for font size to be consistent with the other comparisons.
a4cbbd6 to
91cb6be
Compare
Member
Author
|
Testing on #12393 indicates that the primary issue is based in Qt. Though, some of these changes are probably still "correct", they do not directly address the issue, so this PR itself can be lowered in priority. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Checklist: