Adobe Flex, loading embedded fonts from modules

早过忘川 提交于 2019-12-22 17:38:47

问题


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>

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

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.

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.


回答1:


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/



来源:https://stackoverflow.com/questions/1812999/adobe-flex-loading-embedded-fonts-from-modules

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!