High performance text component

Felipe Heidrich felipe.heidrich at oracle.com
Wed Sep 5 13:16:57 PDT 2012


Hi Daniel, 


> 
> I feel like the word wrapping text+embedded objects is the big thing here, otherwise it's just a flow layout right? I don't really get an immediate sense of what this is all about from those samples. Most of those screenshots could be achieved without a new paragraph tag I think. 
> 

In the simple cases visually the Paragraph layout is just a flow layout, but behind the scenes it is completely different.
The text  in the children span within a paragraph are merged into one and analyzed in a single pass, so that ligatures between adjacent spans are respects, bidi reordering occurs in the entire line, line breaking, etc.
Also note that during line breaking or bidi reordering a single text span can have visual components that are render in disjointed locations. For example, a span can be split during word wrapping so that the first part of the span is visible at the end of the first line and the remaining part is at the beginning  of the second line.

Other difference is that a paragraph can have properties that are text-related, for example
line spacing, alignment (left,right,center, justify), word wrapping, text direction (left to right, right to left), etc
These properties don't belong to flow layout.

> 
> We already have 'Text'. Is this different or could we reuse what's already there.


This is an open question because Text already includes some of the properties that are used during the paragraph layout. 
For example, Text has wrapping width and text alignment, if we choose to reuse Text that will mean that these properties will be ignored if they are set in Text that is parent by a Paragraph.

Felipe


More information about the openjfx-dev mailing list