Alternative to embedding a font in as3

前端 未结 3 1442
轮回少年
轮回少年 2020-12-12 06:21

I have quite a basic question to ensure I am not missing something obvious!

Does anyone know of an alternative to embedding fonts? I am developing a global app wh

3条回答
  •  情书的邮戳
    2020-12-12 06:57

    You can do this by embeding the font in external SWF files.

    for example you have:

    Arial_EN.swf

    Arial_RU.swf

    Arial_JP.swf

    Arial_DE.swf

    Then in your configuration file you a defining which swf to load. After you load SWF

    
    
    swf/Arial_DE.swf
        
    
        bold
        bold_italic
        italic
        regular
    
    

    In your library you should see somehting like this:

    Load the swf:

    var fontLoader:Loader = new Loader ();
    //all the eventlistener and functions for it
    fontLoader.load ( xml.font.path )`
    

    After you load the swf and you have the style names just register the font, if you will be using embedFonts=true option

    Font.registerFont ( fontLoader.getClass ( xml.font.style ) );
    

提交回复
热议问题