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?
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?