5 Replies Latest reply on May 25, 2009 1:51 AM by atty391

    Unicode Rendering Problem

    RoshanMathews
      Indic characters aren't rendered properly in a TextArea that I used in MXML. I created an empty TextArea and pasted the content into it from another web page. Any ideas?

      A screen shot is available here. It looks like the it is drawing it correctly, but the output has slipped down to where it isn't visible.

      Is this a bug? Is there a work-around for it?
        • 1. Re: Unicode Rendering Problem
          Gregory Lafrance Level 6
          You might need to embed the font and specify a unicode range?

          @font-face {
          fontFamily:"Thai_font";
          src: url("../assets/THAN.TTF"); /* Embed from file */
          flashType: true;
          unicodeRange:"thai"
          }


          See these help topics in FB 2.0.1 or via LiveDocs:

          Setting character ranges
          Embedding double-byte fonts
          Using character ranges for embedded fonts
          Embedding fonts in ActionScript
          • 2. Re: Unicode Rendering Problem
            RoshanMathews Level 1
            Greg,

            Thank you, that does seem helpful and I am checking it out right now. But what happens if I want to have text from multiple languages in the same TextArea? The screenshot that I had attached above shows what I am trying to do. From the examples it looks like I need to embed the font and then specify which font I want to use.

            Anyways, the fonts are being shaped correctly, but they aren't displayed right, I don't know how to describe it beyond saying that it looks like it has slipped down below the "baseline". Maybe if I can get them to display properly then I can embed them so that they show up right on another machine, but right now the problem is that it isn't being displayed right.
            • 3. Re: Unicode Rendering Problem
              Gregory Lafrance Level 6
              I know Flex 2 and Flex 3 do not render Arabic correctly in some cases. Probably your case is similar. I think it will be addressed in Flex 4, but for now you may need to be creative in your app design to get around this.
              • 4. Re: Unicode Rendering Problem
                Karl_Sigiscar_1971 Level 3

                Yes, Flash Player 10 will be used only in Flex 4, addressing issues with Arabic, Hebrew and Thai.

                As Greg pointed out, you need two things to render characters correctly: the right unicode encoding and the right unicode font. Each font encodes or not the set of characters for the language you require.

                Arial encodes latin, all modified latin alphabets (including suomi, svenska, polish, czech...), russian, greek and arabic.

                If you want to use Chinese or Japanese, you are not going to be able to embed the font (e.g MS Pincho or MS Mincho) because they are 30MB+ each... Sometimes, it works best if you use a device font instead (that is, whatever common font is on the client computer). For Chinese, Japanese and Korean, I use only device fonts. My application checks the locale of the chosen language and either uses a style with a device font or a style that points to the font-family of an embedded font.

                Check the Unicode Converter extension for Firefox. It will help you convert your characters from codepage (what you most commonly get when copying text from a webpage) to unicode (Unicode to char reference (hex)). Check https://addons.mozilla.org/en-US/firefox/search?q=unicode&status=4

                You can mix different languages in the same TextArea as long as the one and only font used encodes all the languages used within the text.
                • 5. Re: Unicode Rendering Problem
                  atty391

                  Hey. i saw the screenshot you provided. i dont really have an answer. but i would like to know how you typed the indian languages in flash. i'm desperate to know how to type in indian languages. if you could reply with a step by step answer, i would be really grateful. please reply and tell me how to type in indic scripts in flash. i use flash cs4.