-
Notifications
You must be signed in to change notification settings - Fork 386
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
Wrong measure text field width in BitmapFontTextRenderer #1676
Comments
Thanks, I'll take a look soon! |
Switching to Unfortunately, the bitmap fonts that I've tested with cannot reproduce your issue, and I could not reproduce the new issue either. I guess it depends on the exact bitmap font that you use. |
We use fonts with shadows generated in literra. |
Sorry, I was wrong in my last message. |
No, I have not been able to reproduce with text aligned to the right either. |
a few days ago i tried textalign.Right on a label with backgroundskin and saw the text was out from label's borders. i can try to reproduce it and make screenshots if you want |
There is an error in measuring white space after a symbol. Current code is like (previousCharData.xAdvance - previousCharData.width) * scale;
Lines
https://github.com/BowlerHatLLC/feathers/blob/master/source/feathers/controls/text/BitmapFontTextRenderer.as#L806
https://github.com/BowlerHatLLC/feathers/blob/master/source/feathers/controls/text/BitmapFontTextRenderer.as#L833
and others.
The right formulae is xAdvance - width - xOffset, because char.width doesn't contain xOffset.
xAdvance = xOffset + width + someSpaceAfter
Because of that issue some chars (like colon) get cropped from the right in a textfield with TextAlign.RIGHT
The text was updated successfully, but these errors were encountered: