我在使用 Flash 文本引擎 (FTE) 的 Flex 组件中显示泰语字符时遇到问题,特别是在 Mac OSX 10.6.8 Snow Leopard 上。
这是我在 flex-config.xml 中的编译器字体管理器的简介:
<flex-config>
<target-player>10.2.0</target-player>
<!-- Specifies the version of the compiled SWF -->
<swf-version>11</swf-version>
<compiler>
<!-- Specifies the locales for internationalization. -->
<locale>
<locale-element>en_US</locale-element>
</locale>
<fonts>
<!-- ... -->
<!-- Compiler font manager classes, in policy resolution order-->
<managers>
<manager-class>flash.fonts.JREFontManager</manager-class>
<manager-class>flash.fonts.BatikFontManager</manager-class>
<manager-class>flash.fonts.AFEFontManager</manager-class>
<manager-class>flash.fonts.CFFFontManager</manager-class>
</managers>
<!-- ... -->
</fonts>
</compiler>
</flex-config>
...另一个来自 flash-unicode-table.xml:
<language-range>
<lang>Thai</lang>
<range>U+0E01-0E5B</range>
</language-range>
我的 flex 应用程序最初在其样式表中定义了以下内容:
Application {
fontSize: 12px;
fontFamily: Arial;
font-sharpness:0;
font-anti-alias-type:advanced;
}
到目前为止,泰语字符在 TextField 等 mx 组件中正确呈现。但是,诸如 TextLine 之类的 FTE 组件将那些看起来很糟糕的框显示为替代品。我最初的猜测是,在 flex-config.xml 中声明的编译器字体管理器之一没有找到正确的系统字体来回退泰语字符。因此,我通过转到“系统偏好设置”>“语言和文本”>“编辑列表”来确保安装了系统字体。然后我将 fontFamily 更改为 Arial, Ayuthaya。仍然看到邪恶的盒子。
Next I figured that perhaps the Arial font might be assigning a box for each unicode value corresponding to a Thai character. So it was effectively overriding the Ayuthaya system font. So I changed fontFamily once more to just Ayuthaya and this worked with one issue - Ayuthaya looks inherently different from Arial for non-thai characters.
Here's my question - is there a less invasive way to support Thai in FTE components such that the appearance of the text is closer to the Arial font? I would rather not embed a font because I'm constrained on SWF size.