嵌入支持欧元符号的字体
我正在制作一个使用 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 是否是欧元符号未显示的原因?
谢谢
斯蒂芬
I'm building a Flash ad that uses the Neo Sans font, the text that is shows contains the Euro symbol, but I can get the Euro symbol to show. This is how I'm embedding the font:
[Embed(source='C:/WINDOWS/Fonts/NeoSans Medium.otf', fontFamily='_NeoSansMedium', embedAsCFF='false', mimeType="application/x-font", unicodeRange="U+20AC")]
public static var _NeoSansMedium:Class;
As you can see I'm using the unicodeRange to try to show the Euro symbol, but still it is not showing up.
This is how I'm using this embedded font:
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);
How can I check that this font supports the Euro symbol, and is the unicodeRange the reason the Euro symbol is not being displayed?
Thanks
Stephen
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您已经通过嵌入字体来炸毁您的 swf,您也应该使用它,因此设置
embedFont = true;
还要确保包含正确的 unicode-range,一个好的工具是 http://inspiritgames.com/blog/2010/09/unicode-range-generator-for-as3/
if you already blow up your swf by embedding a font, you should use it as well, so set
embedFont = true;
also make sure you include the correct unicode-range, a good tool is http://inspiritgames.com/blog/2010/09/unicode-range-generator-for-as3/