【问题标题】:Embedding a font that supports the Euro symbol嵌入支持欧元符号的字体
【发布时间】:2011-07-01 15:13:52
【问题描述】:

我正在制作一个使用 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 是否是未显示欧元符号的原因?

谢谢

斯蒂芬

【问题讨论】:

  • 您确定不想将 testFont.embedFonts = false; 设为 true 吗?
  • 是的,我确实找到了问题的原因。使用的字体不支持欧元符号。不得不更改为另一种类似并支持欧元符号的字体。

标签: actionscript-3 fonts euro


【解决方案1】:

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

embedFont = true;

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-26
    • 1970-01-01
    • 2014-11-11
    • 2012-05-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多