-
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 different platforms #707
Comments
Looking at the text in the issue, there appears to be some special character? If this character is supposed to be there, then it may be that Linux can/can't render it as a space and is replacing it with a block character. Also, are you using the same fonts? The default font on each platform is the platform-default font. |
@mattleibow Is there any way to get rid of block character and get the exact string width? |
@mattleibow Yes. I need to measure those special characters also. Am I missing any property settings? |
Hmm. What is the font name and can you ensure that the font exists on linux? On my WSL, I only have 2 fonts. After installing Times New Roman, I got the same values as the Windows. If you are setting the font, you can check the typeface via the |
It may be the text... Maybe attach a text file with the exact string - maybe GitHub is processing the text. |
Make sure to test this with a font loaded by stream. That way you ensure the same typeface is used on both platforms. When that fails to produce the same measures there is an issue. |
I tried the same font file on both platforms, and I get the same values. What font are you using? |
I'm getting 190 as width in linux and 184 in windows for DejaVu sans font. |
Could you attach the font file you are using so I can have a look. I can't seem to replicate. Also, what other font properties are you using? It might be best just to create a sample project. |
We are closing this issue since no response was received. Please open a new issue referring to this one if you have more information. |
Description
I tried to measure a text range and I get different width for the same text range in windows and linux.
Code
MeasureText("This€is a€test line full of Text€")
Expected Behavior
In windows and mac I get almost the same width but in linux the measured width is more than the one from windows.
Actual Behavior
Values should be more or less within a tolerable limit.
Basic Information
The text was updated successfully, but these errors were encountered: