Skip to main content
JabbyPandaUA
Inspiring
January 21, 2010
Answered

Not all chinese characters display correctly with non-embedded text

  • January 21, 2010
  • 2 replies
  • 8965 views

Hi all,

  I've updated to the last beta 2 of Flash Player 10.1 (10,1,51,66) and compiled this simple Flex application to illustrate the fact that not all chinese characters can be displayed correctly with non-embedded text (device font).

<?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="resourceManager.localeChain = ['zh_CN'];"

               layout="{new VerticalLayout()}">           

    <fx:Script>

        <![CDATA[

            import spark.layouts.VerticalLayout;

        ]]>

    </fx:Script>

    <s:Label text="伜-伞伟传伡伢伣伤伥伦伧伨伩伪伫伬伭-伝">

    </s:Label>

    <mx:Label text="伜-伞伟传伡伢伣伤伥伦伧伨伩伪伫伬伭-伝"/>       

</s:Application>

  Notice that characters from the Unicode range 0x4F1E .. 0x4А2D are not displayed within <s:Label> component that uses Flash Text Engine (FTE) by default to display the text, but at the same time those characters display just fine within older <mx:Label> component that relies on flash.text.TextField instance to render the text.

This topic has been closed for replies.
Correct answer

    OK, did not know that "Arial Unicode MS" font is only distributed with Microsoft Office, was looking into relying on this font in case if "simsun.ttc" font is not available at the user's system, by using the following:

<?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/mx"                minWidth="1024" minHeight="768"                creationComplete="resourceManager.localeChain = ['zh_CN']"                layout="{new VerticalLayout()}">                    <fx:Style>         @namespace s "library://ns.adobe.com/flex/spark";         @namespace mx "library://ns.adobe.com/flex/halo";                 s|Label {             fontFamily: "Arial Unicode MS, SimSun, Arial";                     }                              </fx:Style>        <fx:Script>         <![CDATA[             import spark.layouts.VerticalLayout;         ]]>     </fx:Script>     <s:Label id="sparkLabel" text="伜-伞伟传伡伢伣伤伥伦伧伨伩伪伫伬伭-伝"/>    </s:Application>  

Tough decision ahead, but accordingly to  the survey at codestyle.org (2000 participants from 2007 year and onwards), Arial Unicode MS is present at 62.53%% system surveyed.

ps

   My current install of Windows XP already includes the install of Microsoft Office 2007 and I've also enabled/disabled the support of East Asian languages, thus the content of  my "fonts" folder differs now significantly from "clean" Windows XP install version.

Nevertheless I found the page with comprehensive lists of standard fonts installed with different releases of Windows that looks viable here:  http://www.kayskreations.net/fonts/fonttb.html


Adding Arial Unicode MS to your font family list is probably the way to go - and it's likely that a substantial portion of the 37.5% that do not have that font and are interested in viewing Chinese text will have East Asian language support enabled. So they would be able to view the text in SimSun.

2 replies

Participant
February 3, 2010

Another thing to check is to make sure you have supplemental language support installed. Go to Control Panel > Regional and Language Options > Languages (tab) and check the box for Install files for East Asian languages. Hope this helps.

Marc

JabbyPandaUA
Inspiring
February 3, 2010

No, I do not have installed support for East Asian languages at my Windows XP install, that's a problem

January 21, 2010

When I compile your code with a relatively recent Flash Builder 4.0 install and open in 10.1 beta 2, I see both labels with the same glyphs. Could you give a picture of your results?

JabbyPandaUA
Inspiring
January 22, 2010

Here the screenshot of what I see, I am running Windows XP, Flash Player 10,1,51,66 (debug), Internet Explorer 6.

January 22, 2010

OK - I can see the problem in XP. In Vista, Win 7 and the Mac it renders correctly. I'm asking around why font fallback isn't working in this case for XP.