Adobe Flex,从模块加载嵌入字体 [英] Adobe Flex, loading embedded fonts from modules

查看:27
本文介绍了Adobe Flex,从模块加载嵌入字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是在 Flex 中为各种亚洲语言编写语言学习应用程序.由于其中一些语言的字体非常大(例如中文),我不想将所有这些字体加载到应用程序中.立即但正在考虑将它们放入不同的模块,然后仅加载特定的模块(取决于在主应用程序中选择的语言).为此,我从主应用程序中移动了样式部分:

I am just programming a language learning app in Flex for various Asian languages. As some of these languages have very big font sizes (e.g. Chinese), I do not want to load all these fonts into the app. at once but was thinking to put them into different modules and then load only the specific module (depending on which language is chosen in the main app). For this I moved the style part from the main app:

<mx:Style>
@font-face 
    {
    font-family:DedicatedFont;
    src: url('assets/fonts/cma.ttf');
    fontStyle: normal;
    font-weight: normal;
    }
</mx:Style>

进入不同的模块.上面一个是例如对于中文字体 (cma.ttf).

into the different modules. Above one is e.g. for the Chinese font (cma.ttf).

模块已创建,我也可以在模块本身中使用字体样式 (DedicatedFont),但我无法从主应用程序访问它.

The modules are created and I can also use the fontstyle (DedicatedFont) in the module itself, but I can not access it from my main application.

谁能告诉我如何将此模块加载到我的主应用程序中,然后在我的主应用程序中使用 DedicatedFont 样式.

Could anybody pls tell me how I can load this module into my main app and then use the DedicatedFont style in my main app.

推荐答案

请查看 Bryan Langdon 的解决方案,并告诉我它是否适合您:http://bryanlangdon.com/blog/2007/03/22/loading-fonts-dynamically-in-actionscript-2-and-3/

Please review Bryan Langdon's solution, and let me know if that works for you or not: http://bryanlangdon.com/blog/2007/03/22/loading-fonts-dynamically-in-actionscript-2-and-3/

这篇关于Adobe Flex,从模块加载嵌入字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆