Rich Text API Details

Skip to end of metadata
Go to start of metadata

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:

  1. Font can be set in CSS, even thought it doesn't exist as property in the node, and it is inherit to the children.
  2. Font-smoothing, underline, strikethrough, fill won't work the same way since they are not inherit in CSS.
  3. The fact that TextFlow does not have a font makes tab expansion wrong (tab is 8 whitespace in which font?), a possible solution for this problem is to added a tab stop list to TextFlow.
  4. TextFlow does not have a BoundsType property, it is always logic. Laying out the children using visual bounds doesn't seen to make sense.
  5. Line spacing would be easy to add (See RT-21683).
  6. Consider change TextFlow to subclass Region instead of Parent New: most likely doing this!
  7. What is the best way to handle TextFlow nested in TextFlow?
  8. Properties removed (relative to the original proposal): x, y, textOrigin

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:

  1. RT-24466 - support load object hierarchy from string
  2. RT-24336 - better whitespace handling in the text node
Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Nov 09, 2012

    How is setting the line spacing for multi-line text handled?

  2. Mar 24, 2013

    Is Rich Text designed at the paragraph level, or at the page level?

    If Rich Text is designed for the paragraph level, then we have to create new page level classes in our applications.

    If Rich Text is designed at the page level, it should include tables, paragraphs, charts, and lists. Tabs are not needed anywhere. Nested tables can be used for layout, to provide indenting, margins, borders, headers, footers, body, page numbers, columns, rows.

    The Rich Text use cases could be: a user form, a journal article, a business proposal, a financial statement, a business letter, a financial report (with charts), a requirements document, a test plan, an advertisment, a short story, or a whole book.

Sign up or Log in to add a comment or watch this page.


The individuals who post here are part of the extended Oracle community and they might not be employed or in any way formally affiliated with Oracle. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Oracle nor any other party necessarily agrees with them.