Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Arabic text in as3

How can I display arabic text from right to left with as3?

like image 562
gabitzish Avatar asked Jan 10 '11 22:01

gabitzish


2 Answers

This code will do the trick:

import flash.text.AntiAliasType;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.external.*
import fl.text.TLFTextField;
import flash.text.TextFormat;

import flashx.textLayout.formats.TextLayoutFormat;
import flashx.textLayout.elements.TextFlow;


var arabicTextField:TLFTextField = new TLFTextField();
arabicTextField.antiAliasType = AntiAliasType.ADVANCED;
arabicTextField.mouseEnabled = false;
arabicTextField.selectable = false;

arabicTextField.direction = flashx.textLayout.formats.Direction.RTL;

var fmt:TextFormat = new TextFormat();
fmt.color = 0xFFFFFF;
fmt.font = "arialArabic"
arabicTextField.embedFonts = false;
arabicTextField.defaultTextFormat = fmt;
arabicTextField.setTextFormat(fmt);
like image 98
Ellen S Avatar answered Sep 27 '22 23:09

Ellen S


The Text Layout Framework can handle right to left text.

like image 29
maxmc Avatar answered Sep 28 '22 01:09

maxmc