Multilingual textflow
Text flow with Japanese text, and styled spans.
The paragraph contains spans of text styled
differently as well as
forced line breaks. The text flows from one child of the 'region'
element to another. This example has three regions, shaped like
the letters 'G', 'O' and '!" respectively.
The text flow algorithm
wraps on spaces if it can
find them, otherwise it will break in the middle
of a word. This is needed for Japanese and
Chinese text where there are no spaces between
words like this:
If you need to implement Japanese
kinsoku rules for
line breaking, you will have to insert Unicode zero-width-joiner (zwj)
characters to forbid certain line breaks when generating the text.
Here is a third paragraph. The text is in blue to
show where the second paragraph ends and a third one begins. It will
not win any design awards.