Line breaking

When allocating the content of a paragraph, TopLeaf will try to put as much material on each line as possible. If there is insufficient space to fit more content within a line, TopLeaf determines a line break point and overflows the content after that point to a new line.

The position at which a line can break is primarily dependent on the language being used. For European languages, lines usually break between words. Words are separated either by white space characters (space, tab, line feed, etc.) or by one of the user defined word break characters. By default the only word break character is the hyphen (U+002D). You can use the <text-properties/> command to declare a set of word break characters. Undesirable line breaks between adjacent words can be avoided by replacing the interword space with either a hard space or non-breaking space.

Additional language specific line breaking rules are applied when processing Chinese, Japanese, Korean and Arabic content.

Lines can also be broken by using hyphenation as described in “Hyphenation”.

If the language and hyphenation line breaking rules fail to identify a suitable line break, TopLeaf will insert a break point before or after any inline graphic, rule fill, or space or character fillers located within the line.