Add bold font support to the GDI renderer#19441
Merged
DHowett merged 3 commits intomicrosoft:mainfrom Oct 14, 2025
Merged
Conversation
f61ca48 to
be4a8eb
Compare
lhecker
approved these changes
Oct 14, 2025
src/renderer/gdi/gdirenderer.hpp
Outdated
Comment on lines
+105
to
+108
| HFONT _hfont; | ||
| HFONT _hfontBold; | ||
| HFONT _hfontItalic; | ||
| HFONT _hfontBoldItalic; |
Member
There was a problem hiding this comment.
I suppose at this point we could consider making this an HFONT[4] array so that we can replace things like the DeleteObject code with loops. FontType could be changed to map the 4 styles to 0-3.
Contributor
Author
There was a problem hiding this comment.
I didn't want to mix features and refactoring, but if you think it's ok - sure, why not. Done.
lhecker
approved these changes
Oct 14, 2025
Member
lhecker
left a comment
There was a problem hiding this comment.
I've pushed a commit to make the style checker happy. Thank you for your PR!
DHowett
reviewed
Oct 14, 2025
|
|
||
| // Select into DC | ||
| RETURN_HR_IF_NULL(E_FAIL, SelectFont(_hdcMemoryContext, hFont.get())); | ||
| RETURN_HR_IF_NULL(E_FAIL, SelectFont(_hdcMemoryContext, hFonts[static_cast<size_t>(FontType::Default)].get())); |
Member
There was a problem hiding this comment.
@lhecker surprised this would pass audit mode; it hates []
DHowett
approved these changes
Oct 14, 2025
Member
|
thanks for doing this! Since it doesn't afford for the intense text option, I chose not to close the bug bug rather just link the PR to it :) |
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.
Summary of the Pull Request
Bold fonts support in GDI engine
References and Relevant Issues
#18919
Detailed Description of the Pull Request / Additional comments
Render SGR1 as bold in 256 and true colors, where "bold is intense" is not applicable.
Implemented by creating 2 extra fonts: bold for 1 and bold italic for 1 + 3.
No non-trivial changes, just extensions.
LOGFONT also supports Underline and StrikeOut, but they seem to be already covered by other means, so no combinatorial explosion of fonts expected.
Validation Steps Performed
PR Checklist