Skip navigation
big bernhard
Currently Being Moderated

TextFormat size being rounded to int

Sep 7, 2012 7:02 AM

Tags: #actionscript3 #decimal #textformat

Hi,

 

can someone confirm whether it should be possible to set a TextFormat instances size property to a floating point Number? I'm trying to set it to a 12.5, but the Textfomat instance rounds the number, when it's set, back to 12.

 

The as3 docs specify that the TextFormat size property is an Object and state that the value represents 'The size in pixels of text in this text format'. Does this mean that it has to be a whole pixel? There's no explicit mention of the fact that it should be an int or that it can't be a floating point number?

 

I've run a seperate test in the flash professional cs3 IDE and am able to create a dynamic Textfield on the stage and set it's size to a floating point number. Seems odd that that would work, but you're not able to accomplish the same thing progrmmatically?

 

I've found an old post on the flex forum suggesting that embedding the font 'may' fix this issue, but my fonts are already embedded,  so it doesn't appear to be that.

 

Thanks,

 

James

 
Replies
  • kglad
    62,147 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 7, 2012 7:37 AM   in reply to big bernhard

    you're correct. dynamic font size is rounded to the nearest int.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points