This page discusses some of the details of the current Rich Text API prototype.
The current prototype adds one (not two) new node to the scene layer.
TextFlow, subclass of Parent. Includes the following properties:
name |
type |
|---|---|
wrappingWidth |
double |
textAlignment |
TextAlignment |
Notes:
Alternative names for TextFlow (New: very unlikely the name will change):
Paragraph, TextGroup, TextPane, TextBlock, DIV, TextLayoutPane, RichTextPane.
Instead of adding a new node (e.i Span) we decided to use the existent Text node:
When Text is a child of TextFlow only the following properties are respected:
name |
type |
|---|---|
text |
String |
font |
Font |
fontSmoothingType |
FontSmoothingType |
underline |
boolean |
strikethrough |
boolean |
Plus all the properties in the super classes (Shape & Node)
Note that some of the properties in Text are ignored when it is a child of TextFlow. They are:
x, y, textOrigin, boundsType, wrappingWidth, textAlignment.
Using these new elements a rich text layout can be accomplished using code or markup (FXML), and entirely styled using properties or CSS.
See some examples in Rich Text API Samples.
Relavants FXML bugs for Rich Text: