印地语字体在某些客户端计算机中无法正常显示

时间:2016-01-16 09:00:07

标签: actionscript-3 flex fonts flex4.5

我们开发了Adobe air应用程序,可以选择印地语和英语。对于翻译,我们使用microsoft office Hindi Pack并使用屏幕键盘在印地文写作。我们在应用程序中使用了Arial字体。

在某些客户端计算机中,当语言改为印地语时,我们会看到代替单词的方框。客户端计算机具有Arial字体可用。

我们已准备好在我们的应用程序中嵌入正确的TTF文件,但我们不确定成功的机器正在使用哪个字体文件,因为我们没有安装任何特殊字体。请帮忙。

==更新===

发现有一个选项可以嵌入编译的系统应用程序的字体。为此,我使用了以下代码,但它不起作用:

[Embed(systemFont="arial", fontName="myArial",
                    mimeType="application/x-font", advancedAntiAliasing="true")]
        protected var fontClass:Class;

然后在css文件中添加

global
{
     font-family: "myArial";
}

但我收到错误:

    Description Resource    Path    Location    Type
exception `during transcoding: Cannot embed local font 'arial' as CFF. The CSS @font-face 'local()' syntax is not supported. Please specify a path directly to a font file using the 'url()' syntax. For [Embed] syntax the 'systemFont' attribute is not supported. Please specify a path directly to a font file using the 'source'` attribute.   HondaLMS.mxml   /HondaLMS/src   line 81 Flex Problem

Description Resource    Path    Location    Type
unable to build font 'myArial'  HondaLMS.mxml   /HondaLMS/src   line 81 Flex Problem

1 个答案:

答案 0 :(得分:0)

我认为systemFont名称是“Arial”,而不是“arial”(它们区分大小写)。

如果这不起作用,请尝试将其嵌入css:

@font-face 
{
   src: local("Arial");
   fontFamily: "myArial";
   unicodeRange: U+0020-00FF; // change the range for your desired english and hindi characters, numbers and punctuation, otherwise you would embed ALL characters including cyrillic, chinese, arabic and whatnot and it would become  huge
}

global
{
   font-family: "myArial";
}

如果它不能与字体名称引用一起使用,只需将Arial字体复制到项目目录中并使用相对路径嵌入它:

@font-face 
{
   src: url("../assets/Arial.ttf");
   fontFamily: "myArial";
   unicodeRange: U+0020-00FF; // change the range for your desired english and hindi characters, numbers and punctuation, otherwise you would embed ALL characters including cyrillic, chinese, arabic and whatnot and it would become  huge
}