Add bold font support to the GDI renderer#19441
Conversation
f61ca48 to
be4a8eb
Compare
| HFONT _hfont; | ||
| HFONT _hfontBold; | ||
| HFONT _hfontItalic; | ||
| HFONT _hfontBoldItalic; |
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.
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
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!
|
|
||
| // 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())); |
There was a problem hiding this comment.
@lhecker surprised this would pass audit mode; it hates []
|
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 :) |


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