Skip to main content
June 22, 2009
Question

problems with embedding fonts from flash ide (osx)

  • June 22, 2009
  • 1 reply
  • 807 views

im having problems with my embedded fonts. the show up as embedded using Font.enumerateFonts(false); , but they do not show up in the textflow.

they do work in a textField using css.

the fonts are embedded using exported library items from flash cs4 professional ide.

ive tried embedding using embed tag. but i couldn't get it  to work either.

any hel appreciated!!!

This topic has been closed for replies.

1 reply

Participating Frequently
June 23, 2009

you have to embedd fonts as CFF fonts. You can do this via TextLayoutFramework component - there is button "embed Fonts"

or

you can embedd it via flex like this with (Fonts.as)

package {

 

  import flash.display.Sprite; 

public class Fonts extends Sprite

{

[Embed(source="/Users/name/FontExplorer X/Font Library/H/Hypatia Sans Pro ExtraLight/HypatiaSansPro-ExtraLight.otf", fontFamily="HypatiaSansPro", mimeType="application/x-font", cff="true")]

public static  const HypatiaSansProExtraLight:Class;

}

}

if you want to use it in flash you should load generated swf into your flash app and onLoad handler

function  fontLoaded(event:Event) {

var FontLibrary:Class=event.target.applicationDomain.getDefinition("Fonts") as Class;

Font.registerFont(FontLibrary.HypatiaSansProExtraLight as Class);

}

and it should work