在帮助文档中,并没有提到可以给TextField设置的最大字号是127px,动态文本和输入文本都有这个限制,但是静态文本没有这个限制。这个127px限制由来已久,是flash player和操作系统之间的问题。
有一个解决这个限制的办法:设置scale
有一个解决这个限制的办法:设置scale
var format:TextFormat = new TextFormat();
format.size = 100;
var t:TextField = new TextField();
t.autoSize = TextFieldAutoSize.LEFT;
t.text = "Nice and big.";
t.setTextFormat(format);
t.scaleX = 2;
t.scaleY = 2;
addChild(t);
在Flashplayer10中,TextField还是有这个限制,但是在新的Flash Text Engine中这个限制已经取消了。
设置字号为300px的代码如下:
var ef:ElementFormat = new ElementFormat();
ef.fontSize = 300;
var te:TextElement = new TextElement ("Nice and big.", ef);
var tb:TextBlock = new TextBlock (te);
var tl:TextLine = tb.createTextLine();
tl.x = 20;
tl.y = 300;
addChild (tl);
回复Comments
作者:
{commentrecontent}