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
Spanish letters misaligned with font sizes smaller than ~22 #22
Comments
Have you tried rounding your |
I'm aware of the positioning challenges for smaller font sizes. Adding a proper layout utility in fontdue will happen before 1.0 and I'll address this issue. |
Turns out the issue was I'm aligning to the wrong baseline during rasterization. I'll have a fix out soonish, along with some more subpixel positioning options for people rolling their own layout before Fontdue's is finished. |
I just pushed it, |
@mooman219 I'm having some trouble using the new fix. Would you be willing to look at my rendering code briefly? I'm not a font expert, so I suspect that there's some error in my code wrt how I'm using your library. Thank you! Code (the second function,
|
At a glance, I believe it's to do with not flooring your y positions at the right spot, but the root of the issue is that proper layout is actually just hard (several hundred lines and some state management). I'm implementing a proper layout utility for the next revision so Fontdue will handle it for you. |
Thanks for your help! I have a few things to say/ask in response to what you said:
|
Spanish uses some accented letters that don't exist in English. These include "í" "ó" and "á". Consider the sample string:
As can be seen when Github+Firefox render this string, the vertical alignment of the accented letters is fine. Yet, when I render this same string using fontdue, the letters are slightly lower than they should be, but only with smaller font sizes.
Font size 12:
Font size 17:
Font size 22:
This is the code that handles the rendering:
The text was updated successfully, but these errors were encountered: