嵌入Flash Builder中的文本
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了嵌入Flash Builder中的文本相关的知识,希望对你有一定的参考价值。
embeded multiple fonts
package { import flash.text.Font; public class MyFonts { [Embed(source = '../fonts/visitor2.ttf', fontName = 'visitor2', embedAsCFF = 'false')] private var visitor2:Class; [Embed(source = '../fonts/bitlow.ttf', fontName = 'bitlow', embedAsCFF = 'false')] private var bitlow:Class; [Embed(source = '../fonts/Sansation_Regular.ttf', fontName = 'Sansation_Regular', embedAsCFF = 'false')] private var Sansation_Regular:Class; [Embed(source = '../fonts/LiberationSerif_Regular.ttf', fontName = 'LiberationSerif_Regular', embedAsCFF = 'false')] private var LiberationSerif_Regular:Class; [Embed(source = '../fonts/f04b_08.ttf', fontName = 'f04b_08', embedAsCFF = 'false')] private var f04b_08:Class; [Embed(source = '../fonts/calibri.ttf', fontName = 'calibri', embedAsCFF = 'false')] private var calibri:Class; [Embed(source = '../fonts/baars.ttf', fontName = 'baars', embedAsCFF = 'false')] private var baars:Class; [Embed(source = '../fonts/BabelSans.ttf', fontName = 'BabelSans', embedAsCFF = 'false')] private var BabelSans:Class; private static const MyFonts:Array = [ 'visitor2', 'bitlow', 'Sansation_Regular', 'LiberationSerif_Regular', 'f04b_08', 'calibri', 'baars', 'BabelSans' ]; public function MyFonts() { var length:int = MyFonts.length; for (var i:int; i < length; i++) { Font.registerFont(this[MyFonts[i]]); } } } } private var tfStatus:TextField; private function showStatusMessage(message:String):void { if (!tfStatus) { tfStatus = new TextField(); var format:TextFormat = new TextFormat(); format.size = 10; format.align = TextFormatAlign.CENTER; format.font = "Sansation_Regular"; tfStatus.embedFonts = true; //tfStatus.autoSize = TextFieldAutoSize.CENTER; tfStatus.defaultTextFormat = format; tfStatus.text = message; tfStatus.width = stage.stageWidth - 10; tfStatus.wordWrap = false; tfStatus.x = 5; tfStatus.y = 460; tfStatus.antiAliasType = AntiAliasType.ADVANCED; tfStatus.visible = true; addChild(tfStatus); } else { tfStatus.visible = true; tfStatus.text = message; } }
以上是关于嵌入Flash Builder中的文本的主要内容,如果未能解决你的问题,请参考以下文章
Flash Builder 4.5.1mobile 项目的嵌入元数据时间限制?
在 ActionScript (Flash Builder) 中调试 JavaScript 注入