-
Notifications
You must be signed in to change notification settings - Fork 24
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
About font scale_factor calculate #14
Comments
ab-glyph doesn't use You can just make your own calculation and apply it to scales if you need consistency with something else. |
Thank yout. I want to know what is the standard practice? Could I believe rusttype?
|
I've raised an issue to discuss this #15. Changing would involve a breaking version increment, but I'd certainly consider it if the new pixel scaling was considerably more "standard". |
For example:
output:
In font Roboto, units per em = 1000, height = 1448
so the text rasterize seems smaller.
Font size is 24px, left is in chrome, right is in ab_glyph.
I am not sure which is correct, but I found in another font parse library fontdue:
It use units_per_em.
https://github.com/mooman219/fontdue/blob/master/src/font.rs#L243-L247
======================
I try to adjust the scale factory to fit units_per_em, it seems size equal:
=======================================
Chrome demo:
http://static.takwolf.com/font-test/index.html
https://github.com/TakWolf/static.takwolf.com/blob/master/font-test/index.html
ab-glyph demo:
https://github.com/TakWolf/tge/blob/feature/ab-glyph/examples/text_layout.rs
The text was updated successfully, but these errors were encountered: