Skip to main content
Participant
February 20, 2010
Question

lineHeight vs ascent and descent

  • February 20, 2010
  • 1 reply
  • 978 views

I have a question (and possible bug report) about controlling line heights. How are descents used? For example go to the demo http://labs.adobe.com/technologies/textlayout/demos/ and try the following: change the font size to 80 and type "ppp". Then change the font size back to 10 and hit enter to start a new line and type "hello". Notice the "hello" is running through the descenders of the p's. A similar behavior is seen if you use line-wrapping to go to the next line instead of hitting enter. I would expect the next line to always be below the bottom of the previous line's descenders.

How exactly does TLF (or FTE) position lines?

-Ben

This topic has been closed for replies.

1 reply

ben_hinkAuthor
Participant
February 21, 2010

Poking around in the TextBlock it could be that baselineFontSize is the cause: http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/text/engine/TextBlock.html#baselineFontSize

The demo might set the baseline font which then causes lines to be positioned using that line spacing.

February 21, 2010

The issue is the default leadingModel setting of ROMAN_UP. This sets the distance between baselines, which in this case sets the baseline of the second line 12 pixels below the baseline of the first line - well within the descenders.

The (old) demo does not include a newer leadingModel that's been added since - ASCENT_DESCENT_UP, which sets the distance between the ascenders of a line and the baseline of the line previous. This leading model can work better for mixed point sizes.

ben_hinkAuthor
Participant
February 22, 2010

Thanks for the reply. I have a follow-up question. With ASCENT_DESCENT does that mean if a line with lower case letters (eg only goes up to the x height of the font) is below a line with no descenders then the lower line will be "tight" up against the previous line? I guess I'm asking for a way to do TeX's line layout where a standard baselineskip is used unless a line is too large in which case it fits tight up against the previous line.

While I'm at it, is there a way to have baseline adjustments on InlineGraphicsElements change the descent so that it, too, can make a little space below itself?