Conversation
|
I'm putting Michael and Dustin on this one - Michael since he's the rendering expert, and Dustin because I know he had some other thoughts on how to deal with implementing bold. |
miniksa
left a comment
There was a problem hiding this comment.
Very excited by this. There were SO MANY PARAMETERS being passed around for this font information and it just kept getting bigger and bigger.
I just had a few small things to discuss/address before signoff.
Thanks!
miniksa
left a comment
There was a problem hiding this comment.
I think I'm good with this now. Thanks!
| <ProjectName>RendererBase</ProjectName> | ||
| <TargetName>ConRenderBase</TargetName> | ||
| <ConfigurationType>StaticLibrary</ConfigurationType> | ||
| <ConfigurationType>StaticLibrary</ConfigurationType> |
There was a problem hiding this comment.
If you’re wondering why this is modified, originally I added an “interface” class here but then found it useless. VS modified the line ending anyway
There was a problem hiding this comment.
Since this is the only change in the file, would you mind reverting it?
There was a problem hiding this comment.
Sure. Will do
There was a problem hiding this comment.
It took a while for me to realize I'm actually changing the LF here to CRLF, to make it 'correct'. Do you still want me to revert this?...
There was a problem hiding this comment.
Oh. Since this makes it correct, you can keep it.
| // - dpi - The DPI of the screen | ||
| // Return Value: | ||
| // - S_OK or relevant DirectX error | ||
| [[nodiscard]] HRESULT DxFontRenderData::UpdateFont(const FontInfoDesired& desired, FontInfo& actual, const int dpi) noexcept |
There was a problem hiding this comment.
This monstrous method will be refactored in my following PRs, which will introduce DxFontInfo and clear the logic in DxFontRenderData. @DHowett Probably not what you initially expect ("cascading FontInfo", See #8580 (comment) ) but I'll try my best.
DHowett
left a comment
There was a problem hiding this comment.
Thanks!
note: i brought up the sources thing because technically the dx renderer still works in conhost ... sometimes. 😄
|
Hello @DHowett! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
This PR Introduces `DxFontInfo` to simplify the logic in `DxFontRenderData`. `DxFontInfo` aims to be the DWrite equivalent of `FontInfo` & `FontInfoBase` in GDI. It encapsulates the needed information to represent a displayable font face. It also provides the ability to resolve a font face based on the available fonts on the system. ## References This is a follow-up of #9096. Initial Italic support was introduced by #8580. The motivation behind this is to support bold & bold-italic text in Windows Terminal.
This commit adds support for bold text in DxRenderer. For now, bold fonts are always rendered using DWRITE_FONT_WEIGHT_BOLD regardless of the base weight. As yet, this behavior is unconfigurable. References Previous refactoring PRs: #9096 (DxFontRenderData) #9201 (DxFontInfo) SGR support tracking issue: #6879 Closes #109

This is my attempt to isolate all the dwrite font related thing by
introducing a new layer -
DxFontRenderData. This will freeDxRenderer&CustomTextLayoutfrom the burden of handling fonts &box effects. The logic is more simplified & streamlined.
In short I just moved everything fonts-related into
DxFontRenderDataand started from there. There's no modification to code logic. Just pure
structural stuff.
SGR support tracking issue: #6879
Initial Italic support PR: #8580