-
Notifications
You must be signed in to change notification settings - Fork 555
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
measureText method returns different values in windows and linux container #752
Comments
List linking this issue fore reference: #707 |
Thanks for the repro, I'll investigate. |
Thank you for looking into it. Please do let me know if you need any additional info. |
When measuring fonts, there are 2 components that influence the values - the font and the measuring logic. The line: SKTypeface.FromFamilyName("Calibri", SKTypefaceStyle.Bold); assume the font is installed? Is this the case? And then it may also be the case that Windows DirectWrite and Linux FontConfig may be doing different things. SkiaSharp does not do much in the way of fonts and rendering, and in order to measure some string it needs to be shaped. This is probably a reason to use RichTextKit. |
FromFamilyName asks the current font manager for a typeface that is matching the name. This will be an installed font and it can be any font that relates to the specified name. On Linux this can be an alias. To be sure to get the same rendering on all platforms you need to load a typeface via stream. |
Description
Values returned by measureText in linux container and in windows are not same.
Code
Expected Behavior
Values should be same
Actual Behavior
In windows I'm getting 228.213379 and in linux container the same code returns 231 as width.
Basic Information
I'm using these fonts in both windows and linux container.
Calibri.zip
The text was updated successfully, but these errors were encountered: