Copy link to clipboard
Copied
I've been looking at converting an existing Flex 3 project to have an Arabic language version, so I have been looking at the TLF to help do that. Originally I intended to just use the components for using TLF in 3.2, but it looks like I may need to use Gumbo for font embedding.
I'm using the TextFlow to create an editable input box and so far I've run into a number of odd behaviours; can anyone explain where I might be going wrong, or an easy workaround?
This is the code I've been playing with as a test:
<code>
private static const textInput:XML = <TextFlow xmlns="http://ns.adobe.com/textLayout/2008">
<div><p><![CDATA[اتحاد الصحفيين العرب يدينس]]></p>
<p>\u064A\u0648\u0644\u062F \u062C\u0645\u064A\u0639 \u0627</p></div>
</TextFlow>;
[Embed(source="./fonts/AdobeArabic-Regular.otf", fontName="Adobe Arabic", cff="true")]
private var arabicFont:Class;
private function initApp():void
{
var textFlow:TextFlow = TextFilter.importToFlow(textInput, TextFilter.TEXT_LAYOUT_FORMAT);
textFlow.direction = Direction.RTL;
var cf:CharacterFormat = new CharacterFormat(textFlow.characterFormat);
cf.locale = 'ar';
cf.ligatureLevel = LigatureLevel.EXOTIC;
cf.fontFamily = "Adobe Arabic";
cf.fontLookup = FontLookup.EMBEDDED_CFF;
textFlow.characterFormat = cf;
var sprite:UIComponent = new UIComponent();
sprite.x = 20;
sprite.y = 20;
sprite.width = 200;
sprite.height = 100;
var controller:IContainerController = new DisplayObjectContainerController(sprite, 200, 100);
textFlow.flowComposer.addController(controller);
textFlow.interactionManager = new EditManager();
textFlow.flowComposer.updateAllContainers();
addChild(sprite);
}
</code>
I've found I've had to use the cff embedding to have the font showing correctly and also not garbling the characters. However, even with cff embedding on, I've found that Mac OS X keyboard inputs come out as garbled roman characters rather than Arabic.I'm sure there are examples of Arabic working in OS X though - is there something particular about how I'm setting up the TextFlow that could be causing this problem?
Thanks in advance for any responses.
Copy link to clipboard
Copied
Euan,
This is a known issue listed in the release notes. Copied from the release notes:
[Limitations on Keyboard Input of International Scripts: Some international scripts using Unicode encoding cannot be typed into Flash Player 10 on Macintosh OS or Windows. While all writing scripts supported by Flash Player 10 can be displayed correctly, keyboard input for some of these scripts may not function. Keyboard input will work correctly for several writing scripts including Roman, Chinese, Japanese, Cyrillic, and Central European languages on both Windows and Macintosh. On the Windows platform, typing works correctly only for writing scripts such as Arabic, Hebrew or Thai that have Windows codepages.]
Abhishek
(Adobe Systems Inc.)
Find more inspiration, events, and resources on the new Adobe Community
Explore Now