Skip to content
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

String width problem? #4

Closed
eykamp opened this issue Mar 26, 2013 · 2 comments
Closed

String width problem? #4

eykamp opened this issue Mar 26, 2013 · 2 comments

Comments

@eykamp
Copy link

eykamp commented Mar 26, 2013

When I use sth_dim_text to calculate the width of a string, I get surprising results. I would expect the following two strings to be the same length:

"LLLLL " and "LLL LL".

However, it appears that strings with terminal spaces are reported to be shorter than expected. I have confirmed that in both cases the function iterates properly over all characters in the string, and is selecting what seem to be the proper glyphs. However the length of those glyphs seems to not be consistently calculated.

I have tried this with several TTF fonts, including the venerable OCRA. Is it possible this is somehow related to TTF hinting? Or is it a problem with Font-Stash?

@akrinke
Copy link
Owner

akrinke commented Mar 28, 2013

Thank you for the report! The latest commit should fix the issue.

@akrinke akrinke closed this as completed Mar 28, 2013
@eykamp
Copy link
Author

eykamp commented Mar 29, 2013

And thanks for the fix and the great lib!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants