我只是想將我的經驗添加到這個問題。我也想旋轉文字。
首先,我只使用ActionScript嵌入字體。
Embed(source="C:\\WINDOWS\\Fonts\\CALIBRI.TTF", fontFamily="Calibri")]
public static const FONT_CALIBRI:Class;
...
var font:Font = new Global.FONT_CALIBRI as Font;
//Font.registerFont(Global.FONT_CALIBRI); //I tried various other things...
但是每次我設置embedFonts = true
時,文字就會消失。最後我給了和embedded the font using Flash。
var font:Font = new FontClass as Font; //FontClass was exported from Flash IDE
它終於奏效了。
var textFormat:TextFormat = new TextFormat(font.fontName);
textField = new TextField();
textField.defaultTextFormat = textFormat; //must be before setting the text
textField.embedFonts = true; //needed to rotate fonts
textField.autoSize = TextFieldAutoSize.CENTER;
textField.antiAliasType = flash.text.AntiAliasType.ADVANCED;
textField.text = ("TESTING")
this.addChild(textField);
哦,我討厭使用Flash IDE的任何東西。如果有人能夠在不使用Flash的情況下做到這一點,請分享!