Skip to main content
Participant
March 1, 2012
Question

Set height of individual line in TextFlow?

  • March 1, 2012
  • 1 reply
  • 2332 views

Greetings,

I am having some trouble with a particular TextFlow I'm using which contains InlineGraphicElements.  Some of these sit below the line (by way of a negative baselineShift) and are thus colliding with the line below.

I would like to be able to increase the spacing between the graphic's line and the line below, but I can't find a way to do this.

I am able to get a reference to the InlineGraphicElement, which I'll call x

And a reference to the TextFlowLine and TextLine below this way:

var xPos:int = x.getAbsoluteStart();

var xLineFlowNum:int = this.textFlow.flowComposer.findLineIndexAtPosition(xPos);

var xTextFlowLine:TextFlowLine = this.textFlow.flowComposer.findLineAtPosition(xPos);

var xTextLine:TextLine = xTextFlowLine.getTextLine();

var nextTextFlowLine:TextFlowLine = this.textFlow.flowComposer.getLineAt(xlineNum + 1);

var nextTextLine:TextLine = xTextLine.nextLine;

So far so good, but I have no idea how I can increase the height of that next line.

TextFlowLine has a height property, but it's readonly.

and TextLine has a height property, but if I set it, it just rescales the text's height-- it doesn't increase the lineheight.

Does anyone know a way to individually control the line spacing in a TextFlow? 

This topic has been closed for replies.

1 reply

Adobe Employee
March 2, 2012

It seems a bug that ILG with a negative baselineShift collide with the line below.

To work around it, you can set TextLine.y to move the line downwards.

And you are supposed to move all the lines below the ILG, because TLF won't know you have moved a textline.

wbg47401Author
Participant
March 2, 2012

This makes sense, thank you!