Alternative to embedding a font in as3

前端 未结 3 1434
轮回少年
轮回少年 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:51

    I have had success with using system fonts such as Arial or simply _sans for languages that have special characters. Just make sure to set embedFonts to false.

    0 讨论(0)
  • 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

    <!-- english Arial -->
    <o n="font">
    <o n="path">swf/Arial_DE.swf</o>
        <!-- Styles, under which names your fonts are exported while emebeded -->
    
        <o n="style">bold</o>
        <o n="style">bold_italic</o>
        <o n="style">italic</o>
        <o n="style">regular</o>
    </o>
    

    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 ) );
    
    0 讨论(0)
  • 2020-12-12 07:06

    You can embed the different fonts that you will require in different swf asset files and only load in the required fonts at runtime.

    0 讨论(0)
提交回复
热议问题