嵌入支持欧元符号的字体

时间:2011-05-03 10:48:23

标签: actionscript-3 fonts euro

我正在构建一个使用Neo Sans字体的Flash广告,显示的文字包含欧元符号,但我可以显示欧元符号。这就是我嵌入字体的方式:

[Embed(source='C:/WINDOWS/Fonts/NeoSans Medium.otf', fontFamily='_NeoSansMedium', embedAsCFF='false',  mimeType="application/x-font", unicodeRange="U+20AC")]
   public static var _NeoSansMedium:Class;

正如您所看到的,我正在使用unicodeRange来尝试显示欧元符号,但它仍未显示。

这就是我使用这种嵌入字体的方式:

var subPriceFormat:TextFormat = new TextFormat();
       subPriceFormat.font = "_NeoSansMedium"; 
       subPriceFormat.size = 40;
       subPriceFormat.letterSpacing = 0;
       subPriceFormat.color = 0xdc188c;


       var testFont:TextField = new TextField();
       testFont.type = TextFieldType.DYNAMIC;
       testFont.defaultTextFormat = subPriceFormat;
       testFont.selectable = false;
       testFont.multiline = false;
       testFont.embedFonts = false;
       testFont.width = 400;
       testFont.text = "£31,90sdfsdf €";
       trace(testFont.text);
       addChild(testFont);

如何检查此字体是否支持欧元符号,unicodeRange是否显示欧元符号的原因?

由于

斯蒂芬

1 个答案:

答案 0 :(得分:0)

如果你已经通过嵌入字体炸掉你的swf,你也应该使用它,所以设置

embedFont = true;

还要确保包含正确的unicode-range,一个好的工具是http://inspiritgames.com/blog/2010/09/unicode-range-generator-for-as3/