I would like to achieve the following behavior: the gap between all text lines to be always X pixels.
My understanding how TLF handles this (please correct me if I am wrong) is that there is no gap between TextLines but one could achieve similar behavior by playing with lineHeigh. You could set it to a percentage and then this would introduce visual gap between text lines however in cases when a text line contains elements with different height (like the case with images or spans with different fontSize) then the gap will differ because it is calculated as a percentage of the overall fontSize. I don't want to have different gaps in these cases. I would like to have always (let's say) 10 pixels between each text line.
What I need is very similar to the "verticalGap" style available in the VBox container. I would like to specify the exact gap between each text line in exactly the same way.
Using "lineHeight" is not good because it depends on the height of the text/images and this leads to different gaps when I have mixture of elements with different heights. The way I set the gap should not be dependent on the height of the elements.
You can specify lineHeight in pixels instead of percentages - lineHeight="12" versus lineHeight="120%"
If you want each line to be exactly the same height - as if the lines were falling on a grid, you can specify a pixel lineHeight with the default leadingModel. In this case we set each line's baseline that many pixels from the last line's baseline. In this case larger type or larger inlines may not fit, so you have to specify a pixel height that's appropriate for the content.
Or if you want lines with larger content to automatically be larger, but the gap between the lines to be constant, then you can choose the ASCENT_DESCENT_UP leadingModel and a pixel lineHeight. In this case lineHeight is the distance between one line's descenders and the next line's ascenders. I think that's what you're asking for.