May peace and Allah mercy and blessings be upon you

For a pure Actionscript component, check FlarabyAS3
For a design time solution of Arabic in Flash problem, check FlarabySWF
- FlarabyAS3Flex component was built using Adobe Flex SDK 2 to correctly work with Adobe Flex2 and 3 commandline compilers, in addition to Adobe Flex Builder 2 and 3.
- This version of FlarabyAS3Flex works only with Adobe Flex 2, 3 and Adobe Air. FlarabyAS3Flex does NOT work on Flash CS3.
- FlarabyAS3Flex extends TextField component (located inside flash.text.TextField) which is the main component that internaly handles the process of text rendering in SWF files. FlarabyAS3Flex is used to convert normal string of text to a string that can be read into other Adobe Flex components. Most often, to effectively use FlarabyAS3Flex you need to deal with UITextField component (Flex2) or IUITextField component (Flex3) which are subclasses of TextField component. Using either of these components you can know the properties of the internal textField of components like Text, TextArea and TextInput and then convert text based on these properties. You can deal with any of these components by using either an official way, by extending them to be able to access the protected 'textfield' property, or by using an undocumented way, which is the 'mx_internal' namespace:
import mx.core.mx_internal;use namespace mx_internal;
component.getTextField();where component is the component instance you want to get its internal textField. For more details:
- FlarabyAS3Flex is located inside the package com.arabicode.text.Flaraby, so you must include this into a namespace in your Flex/Air applications, for example:
xmlns:Flaraby="com.arabicode.text.Flaraby.*"
and use it like this:<Flaraby:FlarabyAS3Flex />
- FlarabyAS3Flex supports Arabic, Persian or Urdu text together with Latin (eg. English, French, Spanish or Italian) text. Support for Persian and Urdu depends on the font used, so you must choose the correct font for that. Traditional Arabic and Andalus are two examples of correct fonts for Arabic language, any font used to render Persian or Urdu must have its characters mapped the same way as these fonts Arabic characters. As a guide you can use a tool like "Windows Character Map".
- FlarabyAS3Flex has support for Tashkeel (Arabic Diatrics) while "embedFonts=true". In this case, only Traditional Arabic and Andalus, (or similar) fonts can render Tashkeel due to their character mappings.
- You must use TextFormat with FlarabyAS3Flex to define the font name, weight, size, ... TextFormat will be applied on the entire textField. Using more than one TextFormat in the same textField is not supported.
- FlarabyAS3Flex has support for ONLY the following Html Tags "<font>" (color attribute only), "<u>", "<a>". Nested Html Tags with the same type are not supported, for example:
<font color="blue">Flaraby supports <font color="red">Html</font> tags</font>
Html Tags must be well formated.
- FlarabyAS3Flex supports embedFonts property which enables embedding Arabic fonts in SWF files at runtime. This can make the text readable even on a non-Arabic system. But due to the different font mappings for each font FlarabyAS3Flex does NOT support all fonts, but just some of them like Traditional Arabic and Andalus. Also, FlarabyAS3Flex takes benefit of Flex 3 newly added compiler parameter (-managers=flash.fonts.AFEFontManager). If this parameter is used when compiling, you can use the new set of Arabic fonts like the one made by www.arabeyes.org (for example "ae_fonts"), and correctly render them using FlarabyAS3Flex. This set can be downloaded from here
An example of compiling a file "test.mxml" (Flex 3 only) that uses FlarabyAS3Flex and the "ae_fonts" fonts (please see the Examples):
mxmlc test.mxml -library-path+=components/FlarabyAS3Flex.swc -managers=flash.fonts.AFEFontManager
- Due to the different fonts shapes and sizes, it is always recommended to test how the text looks after converting it with FlarabyAS3Flex to be sure it looks the way you expect, especially while in multiline text mode, and change the 'extraCharWidth' property as needed. Generaly, values from 0.1 to 1 give suitable results.
- You must specify wether embedFonts=true/false before using any of FlarabyAS3Flex methods.
- Switching embedFonts to true/false at runtime using Actionscript leads to unexpected results.
- Traditional Arabic and Andalous fonts don't render correctly at these sizes:
8, 9, 11, 13, 16, 18, 24, 32
only while embedFonts=false.



















Add new comment