High performance text component
Gaja Sutra
javafx at olifanz.com
Thu Aug 30 05:40:33 PDT 2012
I have a concern for localization support of FXML against the split of
each paragraph in multiple FXML span tags.
By example, your first sample <p>Hello <b>Bold</b> <i>World</i></p>, can
become in french <p>Bonjour <i>Monde</i> <b>Gras</b></p>, with different
order of bold and italic styles. Like this case, FXML containing rich
text will probably be separate for each language.
I understand DOM-like API for manipulation but I think it will be more
complex to localize than some annotated string.
By example with a syntax like RTF/LaTeX <p>Hello \strong{Bold}
\em{World}</p> and <p>Bonjour \em{Monde} \strong{Gras}</p>, you can
localize only by substituting the string in the bundle, because your
styles is not in FXML structure but only in the String containing text.
NB: In this case, your command annotating text is associated, by
example, to a custom CSS pseudo-class:
p:strong {-fx-font-weight: bold;}
p:em {-fx-font-style: italic;}
NB: I know RTF/LaTeX syntax is not really beautiful. I am choosing this
syntax only because special characters are not the same than XML and
because ${...} is more frequently used for executing content (variable
evaluation, etc.).
More information about the openjfx-dev
mailing list