2
votes

I am using as3 and trying to use embed fonts with Arabic text but it doesn't work So is there a way that I can access from .tff file the shape of the character or make it works using embed fonts

As using system fonts works but at same time its bad as on some machines it is reverted so I want to use embed font

Hope anyone can help

3

3 Answers

1
votes

I found code by some one to change the input arabic text to the correct shape based on the position in text and I modified it to work perfectly with my code :)

here the AS3 code file: http://www.akhalifa.com/testing/ArabicAS3File/ArabicStringUtils.as

and here an example on how to use it: http://www.akhalifa.com/testing/ArabicAS3File/Main.as

1
votes

You can use any arabic/persian input language like Maryam4 then write your sentence in this program after that copy it and paste in your code also as @Goran Mottram said embed your font (for this situation if you use Maryam you must select F_fonts) but noticed that in your code if you paste your arabic language it shows you wired character like ÂMoø , but dont worry if you publish you see a correct arabic word with rtl support

0
votes

If you have the font installed on your system, make sure to import the font into your library and tick the box "Export for ActionScript" and give it an appropriate name, say MyArabicFont, then bind it to textfield using the following code:

// create the font
var myFont:Font = new MyArabicFont();

// assign to textformat
var myTextFormat:TextFormat = new TextFormat();
myTextFormat.font = myFont.fontName;

// assign to textfield          
var myTextField:TextField = new TextField();
myTextField.defaultTextFormat = myTextFormat;
myTextField.embedFonts = true;
myTextField.text = "Hello, world";
this.addChild(myTextField);