将资源文件中的字体嵌入到 as3 中
我正在创建一个通用的 Flash 导航。我希望允许人们使用自己的字体,例如 sIFR。我知道我可以创建一个嵌入字体的 swf 文件,但我想让人们尽可能轻松地交换字体,因此首选创建 swf 字体文件的现有方法。
I'm creating a generic flash navigation. I'd like to allow people to use their own fonts like sIFR. I know i can just create a swf file with a font embedded but i'd like to make it as easy as possible for someone to swap fonts so an existing method of creating a swf font file would be preferred.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不知道是否有帮助,但是 Ştefan Isarie 有相当多的 sIFR字体可供使用。
Maxmc的建议看起来不错。您能否通过 Apache/IIS 的 Flex 模块< /a>?
希望您不会遇到特殊字符的麻烦。
另外,作为备用计划,您是否考虑过替代方案?
哈特哈,
乔治
Don't know if it helps, but Ştefan Isarie has quite a few sIFR fonts ready for use.
Maxmc's suggestion looks fine. Would you be able to generate the swf on the server via the Flex Module for Apache/IIS ?
Hopefully you won't get in trouble with special characters.
Also, just as a backup plan, have you considered alternatives ?
HTH,
George
您可以在 xml 文件中定义字体 swf,
然后在运行时加载 xml,加载定义的 font.swf 并将
Font.registerFont
与加载的 swf 一起使用。请注意,您无法轻松加载 ttf 等原始字体格式。 (无论如何,这会很大)您需要将它们编译为 swf 以便能够在您的应用程序中加载和注册它们。
You could define the font swfs in a xml file,
<font id="Futura" src="fonts/futura.swf" />
then load the xml at runtime, load the defined font.swf and use
Font.registerFont
with the the loaded swf.Note that you can't easily load original font formates like ttf. (which would be to big anyway) You need to complile them to swf in order to be able to load and register them in your application.