Skip to main content
Participant
April 6, 2010
Question

lineHeight and leadingModel

  • April 6, 2010
  • 1 reply
  • 479 views

Hi All,

I have a problem getting the lines not to overlap each other in RichText.

I'm using superscripts and subscripts in the text (indicating them by baselineShift="superscript" or baselineShift="subscript"). It seems that when RichText calculates vertical distance between lines it does not take into account whether a line contains any subscripted/superscripted text. Is it right?

In many cases when a line contains subscripted text with large font size (which is located well below main text baseline) and the following line contains text with smaller font size, then the subscript in the first line overlaps the text in the second line.

My guess was that I can make workaround for that by indicating different line height for the subscripted text and having this line height to refer to the distance to the line located below (by setting leadingModel="ideographicCenterDown" or any other model which indicates that the line height is referring to the distance from to line below). But it seems that the leadingModel parameter can be applied only to the whole TextFlow not to its "parts" like separate "span" elements. Could you please advice if it is true or not?

Anyway, can anyone help me with my final goal: how to make the subscripts/superscript not to overlap lines below/above?

Thank you,

Alex

This topic has been closed for replies.

1 reply

Adobe Employee
April 7, 2010

TLF takes the leadingModel into account for each paragraph, so if you set it for an individual span, you're right, you won't get the effect you want. If you set it on a paragraph level, but then change it between paragraphs, you may find some discontinuities of spacing between the paragraphs. I think the right answer for this is a "half and half" leading model that would put half the space about and half below, which is a feature we'd like to add, but haven't done so yet. That obviously doesn't help you now with your problem, sorry. I would suggest adding a bit more lineHeight to all the lines so they have even spacing and no overlaps.

- robin