Skip to main content
March 5, 2012
Question

blurry fonts on scaling

  • March 5, 2012
  • 6 replies
  • 2097 views

Hi, I'm facing some problems on font rendering on mobile platforms. I have a dynamic textfield inserted into a sprite that is constantly resized. The font becomes very blurry and nearly unreadable. It seems that the text is being replaced by a bitmap representation, even if the "cacheAsBitmap" is set to false. Is there a way to enhance this font display? The problem happens on both Android an iOS, but seems worse on Android.

This topic has been closed for replies.

6 replies

sinious
Legend
March 6, 2012

cacheAsBitmap will cache what you create at the size you create it. So if you technically make the text a lot larger initially than you need it then the bitmap it generates will have enough resolution to scale up without losing much quality. Not much of a work around and can strain memory on mobile but a possability.

March 6, 2012

Yes, that's right; I found that setting the z position even to 0 forces the bitmap caching. The solution I found was to use all text that I need to be clear avoiding setting z position. Not the best solution, but does the trick.

March 6, 2012

I found that the problem is related to 3d transformations. If I do not set z position or rotation on x, y or z axis the text renders perfectly, however this is not an option in my case...

Colin Holgate
Inspiring
March 6, 2012

Setting the z of a displayobject is enough to force the GPU to handle it. What colordepth are you using? You may need to use 32 bit to get the best quality. Set this in the Android part of the app descriptor:

16bit</colorDepth

March 5, 2012

The problem is I can't scale the text itself, I mus do all transform on the holder sprite...

sinious
Legend
March 5, 2012

What is resizing, the TextField or the Sprite?

Can you tell us if you have embedFonts = true; on the TextField?

Is this classic text or TLF text?

Are you applying any TextFormat or transforms?

Any filters?

Are you sure cacheAsBitmap is disabled on the Sprite and the parent of that sprite as well (e.g. parent->sprite->text, make sure any parent of the sprite doesn't have cacheAsBitmap, although this shouldn't harm it, it's worth checking).

What font size are you embedding your font outlines at?

How are you scaling the text? scale property or getting closer in z-depth on a 3d layer?

March 5, 2012

Hi, I'm using the Flex SDK, not flash, so I'm using the standard TextField class. The text properties are:

  • antialias = advanced
  • embed fonts = true (it's working since I can see the right font)
  • I'm setting a default text format

I'm sure the cacheasbitmap is set to false, and I'm resizing the holder sprite, not the textfield itself, by applying changes on width and height directly or scael (tried both). Also, there is, indeed, filters running on the holder sprite, as there are transformations on all axis and rotations (x, y, and z). I believe that the bitmap cache is, indeed, expected on these conditions, but the result is too crappy and I would like to improve it.

sinious
Legend
March 5, 2012

Can you simply scale the text up and down without the filters and see if you get the expected crispness? I can scale a spark Label or TextField without any vector degredation. Just hunting for clues.

March 5, 2012

I remember I got similar problems a while ago... I assume you are embedding your font characters, have you tried chaging some antialias settings on your textfield? changing it to readability instead of animation? just an idea...