1 Reply Latest reply on Jan 9, 2014 7:44 AM by sinious

    cacheAsBitmap interfering with device font clear type rendering.

    James22s22 Level 1

      I want to use device fonts in my application so the text appears clear on LCD displays and uses the system's clearType font rasterizing system.  It is characterized by slightly colored edges of text, as opposed to Flash's purely grayscale text rasterizer.  clearType is also what web browsers use, so it allows the text in Flash to exactly match that of the web browser.  Otherwise, Flash's text looks blurry when it uses it's own system with embedded fonts such as "anti-alias for readability", which is purely grayscale.


      I've noticed that when I'm using a scrollRect with cacheAsBitmp, my text is no longer clear and no longer uses the clearType system, despite having embedFonts set to off.  If I turn off cacheAsBitmap, then the text renders as expected.


      Is this alteration in font rendering technique by design?  I don't understand why cacheAsBitmp doesn't just render normally and cache the results.  The cached image will be aligned to whole pixels, and frankly, if it wasn't going to be and the colored edges wouldn't look right, then I wouldn't use clearType rendering, but it should be my decision.  cacheAsBitmap seems to exhibit this side effect of altering the font rendering technique, but I wasn't expecting it to have such an effect.

        • 1. Re: cacheAsBitmap interfering with device font clear type rendering.
          sinious Most Valuable Participant

          And around we go


          I think you'll find cacheAsBitmap matches the antialias settings built into Flash. ClearType would require OS-level interaction to snap a bitmap capture of the text. Once you tick off that checkbox I'm "fairly sure" flash takes the outlines into its own hands, renders the text and captures the bitmap from its own internal drawing system.


          As you know, a bitmap is nothing like a vector. When you enable cAB you surrender the crisp vectors to the speed of a low DPI pixel representation to remove the expensive frame to frame calculations. There has to be some tradeoff and I'm not sure the current monochromatic replacement is any less clear than the interpolated, smoothed ClearType. If anything the monochromatic nature of the built in system adds weight to the characters whereas the summer bevel appearance of ClearType might smooth characters so thin they're hard to read.

          1 person found this helpful