在 as3 中嵌入字体的替代方法 [英] Alternative to embedding a font in as3
问题描述
我有一个非常基本的问题,以确保我没有遗漏一些明显的问题!
I have quite a basic question to ensure I am not missing something obvious!
有谁知道嵌入字体的替代方法?我正在开发一个全球应用程序,它将更改亚洲语言的字体.如果这些字体被嵌入,它会导致一个巨大的 SWF 文件,当它从 windows/fonts 文件夹进入亚洲系统时,我想获取字体.
Does anyone know of an alternative to embedding fonts? I am developing a global app which will change the font for Asian languages. If these fonts are embedded it will result in a massive SWF file, I would like to get the font, when it goes on the Asian system from the windows/fonts folder.
干杯
推荐答案
您可以通过将字体嵌入外部 SWF 文件来实现.
You can do this by embeding the font in external SWF files.
例如你有:
Arial_EN.swf
Arial_EN.swf
Arial_RU.swf
Arial_RU.swf
Arial_JP.swf
Arial_JP.swf
Arial_DE.swf
Arial_DE.swf
然后在您的配置文件中定义要加载的 swf.加载 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>
加载 swf:
var fontLoader:Loader = new Loader ();
//all the eventlistener and functions for it
fontLoader.load ( xml.font.path )`
加载 swf 后,您只需注册字体,如果您将使用 embedFonts=true
选项
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 ) );
这篇关于在 as3 中嵌入字体的替代方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!