Textlinemetrics?
Hi TLF pros,
I try to get the right height of a textflow - unfortuntaley the returned value of the container (Sprite) height is too large:
I extended a simple "Hello World" example and tried to visualise the problem:
private function init():void
{
var format:TextLayoutFormat = new TextLayoutFormat();
format.fontSize = "120";
format.fontFamily = "Times";
var textFlow:TextFlow = new TextFlow();
textFlow.format = format;
var p:ParagraphElement = new ParagraphElement();
textFlow.addChild(p);
var span:SpanElement = new SpanElement();
span.text = "Hello, World";
p.addChild(span);
textFlow.flowComposer.addController(new ContainerController(this, 400, 300));
textFlow.flowComposer.updateAllControllers();
// "LETS draw the height"
graphics.beginFill(0xff0000);
graphics.drawRect(0, 0, 10, height);
graphics.endFill();
}
The final output looks like:

You can see that the red rectangle's height (= containerController.height) is bigger than the "textfield".
- > That makes no scense for me - I want to get the exact height of the textflow.
Further, the first line has a small "padding-top" of 5-7 pixels. -> A: How do I get rid of that?
B: How do I get the "real" height of this text? I cant find something like a "getTextLineMetrics property.
THANKS!
// - - - - - - - - - - - - - -
I tried to add optimize some Textlayoutformat properties, but without success:
format.paragraphSpaceBefore = 0;
format.paddingTop = 0;
format.paragraphSpaceAfter =0;
format.paddingBottom = 0;
