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

BitmapTextAlign.RIGHT crops text when textfield.size not an integer #17

Closed
MiltonW opened this issue Sep 25, 2014 · 5 comments
Closed

Comments

@MiltonW
Copy link

MiltonW commented Sep 25, 2014

Neko, Linux are fine, but when testing Flash and HTML5:

textfield.size = 0.99;
retro1

textfield.size = 1;
retro2

I'm using the desyrel font: http://examples.phaser.io/_site/view_full.html?d=text&f=bitmap+fonts.js&t=bitmap%20fonts

@Beeblerox
Copy link
Owner

it isn't actually a bug. it is caused by the way bitmap text renders in blit mode: it have "canvas" bitmapdata on which text symbols are drawn.
If you want to "avoid" this problem then you can do it in two ways:

  1. set textField's autoSize to true;
  2. set textField's width to textField's textWidth

@MiltonW
Copy link
Author

MiltonW commented Sep 25, 2014

Hmm, autoSize is true by default, and setting it didn't make a difference.
Setting the width didn't help either. Exactly the same problem.

I don't understand what the canvas has to do with it? Why does 0.99 crop and 1.0 not?
The size attribute is Font size, not text size?

This is with what I actually use, works fine on Neko and Linux:
textfield = new BitmapTextField(font, "RETRO");
textfield.size = 0.57;
retro3

@Beeblerox
Copy link
Owner

ok, i'll look into it this weekend

@Beeblerox
Copy link
Owner

@MiltonW can you try latest version?

@MiltonW
Copy link
Author

MiltonW commented Sep 26, 2014

Yep, fixed. Keep up the good work :)

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