1

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

StephenAdams
  • 521
  • 2
  • 9
  • 26
  • 2
    are you sure you don't want to have `testFont.embedFonts = false;` as true instead? – goliatone May 03 '11 at 13:57
  • yes, I actually found the cause of the problem. The font being used does not support the Euro symbol. Had to change to another font that is similar and supports the Euro symbol. – StephenAdams May 03 '11 at 14:51

1 Answers1

0

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/

Björn Kechel
  • 7,933
  • 3
  • 54
  • 57