WELCOME

Welcome to VINITKAR PROFILE...

Monday, August 4, 2014

How to use device font in Flex Air Application.

My dear friends Now a days I have got a project to Implement System Font as well as Application Font to our Application.As you know It is very easy to implement Application font just Load font swf before font using or Embed it to our application style sheet  and we can use it. But here this is very challenging to use device font in our application.
I have to make collection of all device font using such a way:

var fontCollection:Array = Font.enumerateFonts(true) ;

But when we Use this font in Flex 3() and rotate it font visibility lost.I have to surfing on various blog as well as educational sites but I have not get exact solution .After that I have to install Flex 4.0 and use Sparx Label and Apply this  Font.enumerateFonts(true) we have to fixed this issues.

Thanks Appache.

Example:

var fontCollection:Array = Font.enumerateFonts(true) ;

protected function button1_clickHandler(event:MouseEvent):void
{

  var  label:Label = new Label();
   label.text  = "vinitkar";
   label.setStyle("fontFamily", fontCollection[5]);
   this.addChild(label);
                                   label.rotation = 45;

}

2 comments:

  1. Thanks vineet for this great information.
    At least, now not to much bother about font embeding.
    Good idea to use system font..
    keep it up :)

    ReplyDelete