-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce DxFontInfo #9201
Introduce DxFontInfo #9201
Conversation
public: | ||
DxFontInfo() noexcept; | ||
|
||
DxFontInfo(std::wstring_view familyName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure whether this should be familyName
or faceName
. Seems to me there are familyName
& faceName
in the GDI font info, but only familyName
in DWrite?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are face names on the IDWriteFont::GetFaceNames
method... the problem tends to be that there are multiple of them depending on the locale or language or variations and GDI just sort of glosses over that. I think we should just continue to focus on the family name until proven otherwise.
public: | ||
DxFontInfo() noexcept; | ||
|
||
DxFontInfo(std::wstring_view familyName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are face names on the IDWriteFont::GetFaceNames
method... the problem tends to be that there are multiple of them depending on the locale or language or variations and GDI just sort of glosses over that. I think we should just continue to focus on the family name until proven otherwise.
Huh...the trick See microsoft/azure-pipelines-agent#1270 (comment) . I don't honestly know what she meant by saying "Azure DevOps honors the [skip ci] commands on CI builds as the change being built has already been merged" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of the unit tests seem to be failing, other than that this looks good to me!
OK I have no idea how & why there tests has anything to do with my code:
|
The failed tests all look like
Where |
The common thing in the unit tests looks like a call to
So at a guess, there's some code-path where some initialisation never happens and hence some value is 0.f. It's being hit by the unit tests' very minimal initialisation, that you aren't seeing in actual testing when you run WT. |
wow thanks @TBBle for the investigation. I'll get to this PR later and found out why. I promise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blocking while reviewing since this has 2 s/o
src/renderer/dx/DxFontInfo.h
Outdated
bool _didFallback; | ||
}; | ||
|
||
struct DxFontInfoHash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My personal preference is that we properly extend std::hash
; it means that we can use the STL containers with less customization, and perhaps that leads to a higher likelihood that they will be deduplicated as "identical code" 😄
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 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
Fixes the performance regression caused by DxFontInfo. DxFontInfo introduced in #9201
🎉 Handy links: |
This PR Introduces
DxFontInfo
to simplify the logic inDxFontRenderData
.DxFontInfo
aims to be the DWrite equivalent ofFontInfo
&FontInfoBase
in GDI. It encapsulates the needed information torepresent 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.