我注意到使用TextLayout
时出现渲染问题,当括号在新行开头时无法正确呈现。所以:
public function TestTextLayout()
{
basic(" The Intel Core i7 Processor (720QM)", 500, 500);
}
public function basic(text:String, width:int, height:int):void {
var textFlow:TextFlow = new TextFlow();
var p:ParagraphElement = new ParagraphElement();
textFlow.addChild(p);
var span:SpanElement = new SpanElement();
span.text = text;
span.fontSize = 40;
p.addChild(span);
textFlow.direction = Direction.RTL;
textFlow.flowComposer.addController(new ContainerController(this, width, height));
textFlow.flowComposer.updateAllControllers();
debug("line height = " + p.lineHeight);
}
创建以下文本:
The Intel Core i7 Processor
720QM
有没有人对如何解决这个问题有任何想法?