Skip to main content
Participating Frequently
July 15, 2009
Question

Arabic vocalization diacritics are not rendered correctly using Adobe Arabic as Embedded Font

  • July 15, 2009
  • 4 replies
  • 4222 views

Hi,

Vocalization diacritics are rendered as independent characters.

Vocalization diacritics should be rendered combined and merged with the characters preceding them like in the third line of the attached image.

Have a look at the SWF:

1) The first line is aTextLayoutComponent which uses Adobe Arabic as en Embeded Font.

2) The second line is using the System Font Adobe Arabic.

Does anyone have an idea ?

I personally think, when you choose System Font, it uses System Text rendering Engine. But if you embeed font flash has problem with rendering the diacritics properly.

This topic has been closed for replies.

4 replies

Participating Frequently
November 13, 2009

Assalamualaikum

Please see the attached image with this post.

I am facing the same problem, as you did. In my case my Arabic words are not diaplying(makred with red line in the image) correctly.

I am using  flex 4.

Awaiting for prompt response.

November 13, 2009

Prestine,

Please give us some information about the font you are using.

Thanks,

Alan

Participating Frequently
November 13, 2009

Hello,

this is my whole code:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/halo"
               minWidth="1024" minHeight="768"
               creationComplete="init()"
               xmlns:controls="flashx.textLayout.controls.*">
    <s:layout >
        <s:VerticalLayout/>
    </s:layout>
   
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
       
        <s:HTTPService id="httpServiceObj" url="TopFirst.txt" result="handleResult(event)"
                       fault="handleFault(event)" 
                       resultFormat="text"/>
    </fx:Declarations>
   
   
    <fx:Style>
        @namespace s "library://ns.adobe.com/flex/spark";
        @namespace mx "library://ns.adobe.com/flex/halo";
             
          @font-face
        {
            src:url("trado.ttf");
            fontFamily: ArabicFont;
            fontWeight: normal;
            font-style:normal;
            advancedAntiAliasing: true;
           
        }  
       
    </fx:Style>
          
    <fx:Script>
        <![CDATA[
            import mx.controls.Alert;
            import mx.rpc.events.FaultEvent;
            import mx.rpc.events.ResultEvent;
                   
           
            private function init():void{
                httpServiceObj.send();
            }
            [Bindable]
            private var _str:String;
            private function handleResult(event:ResultEvent):void{
                _str    =    event.result as String;       
            }
           
            private function handleFault(event:FaultEvent):void{
                Alert.show("fault is = " + event.fault.faultString);
            }
               
           
        ]]>
    </fx:Script>
   

       

    <s:TextArea text="{_str}"  width="100%"
                height="100%"
                fontSize="50"
                />
       
   
</s:Application
>

As you can see from the code, I am not given any font to the TextArea , even  after giving the font which I have embeded ,out is the same.

Where I am going wrong..

Participating Frequently
August 5, 2009

Thanks for the replies Gordan and Alan ,

I guess Im just going to have to dive into it and see how it pans out unfortunately I do not write or speak Arabic and so i would not even know when things like diacretics are working correctly or not, i did not land this client/project at our firm but am the developer who is expected to get it all working , hence my stress.

Thanks again

Ian

Participant
August 5, 2009

If you don't explicity ask for loading device fonts, you can use 'Arial' as your font. This renders Arabic correctly with the right diacritics. Arabic alphabets have up to 4 different 'cases', aka diacritics. The correct one to use depends on whether the alphabet is at the beginning , at the end, standalone, or in the middle of a word.

August 5, 2009

This is true for the version of Arial that ships with Vista.  The XP version of Arial has the non-zero-width diacritic problem, unfortunately.

Participating Frequently
July 30, 2009

This has been reported as Flex SDK bug SDK-17345. But it is actually an FTE problem in the Flash Player (#1930910). It has been fixed in internal builds of the Player, but the release date for the player version with the fix has not been announced yet.

Gordon Smith

Adobe Flex SDK Team

Participant
July 30, 2009

Thanks for letting us know. Just curious, how does the example 'World Languages' work then? It's using embedded fonts. I looked at the flash code and could not figure out any difference in how I prepare the TextFlow object and character formats.

Participating Frequently
July 31, 2009

That's a great question and I don't know the answer. Maybe some Arabic fonts work properly and others don't? Hopefully someone on the TLF team will provide the answer.

Gordon Smith

Adobe Flex SDK Team

Participant
July 30, 2009

I'm seeing the same thing too. The problem I'm facing is that I've to render both Chinese and Farsi in the same application based on dynamic text coming from the server. We need embedded chinese fonts to get around font availability on all platform and punctuation not rendered corrected after english character issue. However, when we embed Farsi font as well, the diacritics is lost in rendered arabic text.

Please let us know if there is any work around.