在Flex移动项目中,文本输入显示块,而不是显示阿拉伯文本。标签的阿拉伯语效果很好。
在文本输入中有任何方法显示阿拉伯文本吗?
我的代码示例是
<fx:Script>
<![CDATA[
/* Import all the easing classes so its
easier to switch between them on the
fly without tweaking import statements. */
import mx.effects.easing.*;
]]>
</fx:Script>
<fx:Style>
@font-face {
src: url('assets/AlBayan.ttf');
font-family: Base02;
unicode-range:
U+0600-U+06FF,
U+FB50-U+FDFF,
U+FE70-U+FEFF;
}
.MyEmbeddedFont {
font-family: Base02;
font-size: 14px;
}
</fx:Style>
<s:Label x="91" y="149" width="276" height="69" styleName="MyEmbeddedFont"
text="Testing Unicodes"/>
<s:TextInput x="30" y="274" styleName="MyEmbeddedFont"/>
因为它是用于flex移动项目的,所以当我输入阿拉伯语文本时,它会显示不同的字符。阿拉伯语是一种没有单独字符的语言。它应该把字母组合成特定的单词。
发布于 2011-06-08 15:15:05
假设您已经嵌入了支持阿拉伯字符的字体,则可以尝试将这些字符的unicode范围添加到应用程序中。FlexEamples有一个相当好的把它写在这里。
示例:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="800" height="600">
<mx:Style>
@font-face {
src: url('assets/fonts/TAHOMA.TTF');
font-family: Base02;
unicode-range:
U+0600-U+06FF,
U+FB50-U+FDFF,
U+FE70-U+FEFF; /* define the character range, these ranges are for arabic */
}
.MyEmbeddedFont {
font-family: Base02;
font-size: 14px;
}
</mx:Style>
<mx:TextInput id="embeddedText" text="¿¿¿¿¿" styleName="MyEmbeddedFont" fontAntiAliasType="advanced"/>
</mx:Application>
您可能还想看看FlarabySWF。我没有亲自使用过它,但它可能也值得研究。
https://stackoverflow.com/questions/6275110
复制相似问题