-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
[WIP]Fix line height calculation for lines that contain fallback fonts #19013
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
base: master
Are you sure you want to change the base?
[WIP]Fix line height calculation for lines that contain fallback fonts #19013
Conversation
You can test this PR using the following package version. |
Could you provide me the string that shows the clipping? |
I'll try to whack out a repro project if the problem does not manifest for you (I am not adding any constraints that would cause it that I can see, but maybe the Material theme does). And it turns out the 2 missing dots are not even combining diacritics, but proper part of the letter https://unicode-explorer.com/c/064A |
You can test this PR using the following package version. |
You can test this PR using the following package version. |
I don't think that's right, the fallback fonts should be used to determine the line's height as soon as they're used, or we'll get clipping and other issues. They should have no impact if unused though. Said another way, having Example: <StackPanel TextElement.FontSize="32">
<TextBlock Background="DodgerBlue" Text="رقم سري" FontFamily="/#Noto Sans Arabic" Margin="8" />
<TextBlock Background="DodgerBlue" Text="رقم سري" FontFamily="/#Noto Sans,/#Noto Sans Arabic" Margin="8" />
</StackPanel> Master: Notice the clipping and line height not being respected. Fonts: https://fonts.google.com/specimen/Noto+Sans and https://fonts.google.com/specimen/Noto+Sans+Arabic |
So there needs to be a different approach for the line height adjustment. We could adjust the scaling of the fallback font to better match the base font. In the end we want to avoid line height changes when a base font is mixed with a fallback font. If there is no ideal solution I need to revert the lineheight related changes. |
…alonia into fixes/lineHeightCalculation
Related: #18438 |
Fix Direct2D1 glyph bounds
You can test this PR using the following package version. |
Remove InlineUIContainer BaselineAlignment override Fix TextBlock InlineUIContainer arrange
…alonia into fixes/lineHeightCalculation
You can test this PR using the following package version. |
What does the pull request do?
This PR changes the line text metrics calculation so fallback fonts do not affect the final metrics.
This also fixes an issue with zero-width glyphs that are being hit-tested.
What is the current behavior?
What is the updated/expected behavior with this PR?
How was the solution implemented (if it's not obvious)?
Checklist
Breaking changes
Obsoletions / Deprecations
Fixed issues