Skip to main content
November 21, 2011
Question

Bitmap text (crispy font) not rendering in TLF 2.0 (spark components)

  • November 21, 2011
  • 1 reply
  • 1120 views

Hi,

I am using Flex 4.5.1 and TLF 2.0, and unable to render the bitmap fonts text (fonts loaded from external flash swf).

and i use the spark components.

thanks,

Mani

This topic has been closed for replies.

1 reply

Adobe Employee
November 22, 2011

Please paste your simple code here to show your way of using embeded font and loading fonts.

November 22, 2011

Hi,

My CSS is as follows

@font-face

{

          src: url("../font/fonts.swf");

          fontFamily: "Arial_15pt_st";

          fontStyle: "normal";

          fontWeight: "normal";

          fontAntiAliasType:normal;

}

.myArial {

          fontFamily : "Arial_15pt_st";

          fontWeight:          "normal";

}

I have embedded the Arial font in my fonts.swf as bitmap-anti-aliased so that i can get the fonts in crispy style. The above CSS will be converted into swf (Compile CSS to SWF) then i get the fonts embeded in the fonts.swf as 'Arial_15pt_st'.

Now i follow the traditional way of embedding the fonts to TLF using the following code,





var format:TextLayoutFormat = new TextLayoutFormat();




format.fontFamily = "Arial_15pt_st";




format.fontLookup = FontLookup.EMBEDDED_CFF;









textFlow.format = format;




// attach a format resolver




textFlow.formatResolver = new CSSFormatResolver(styleManager);




// set it into the editor




editor.textFlow = textFlow;









loadStyle("SimpleCSS.swf")

The same code works when the font embedding is done directly but not works when i try to load the font from swf as bitmap anti-aliasing.

Or please suggest me any way to give the embeded font crisping effect by eliminating the anti-aliasing.

thanks,

Mani

Adobe Employee
November 23, 2011

From your code, I am guessing that you are creating the TextBlock in the correct SWF contextFlex, but probably not using the context callbacks that would enable you to access the font in the SWF.

For details, please read through Alex's blog on loading fonts as SWFs:

http://blogs.adobe.com/aharui/2010/03/flex_and_embedded_fonts.html