Style Propagation

The Unicode Text Framework uses the propagation of a style to determine how it can be applied to character ranges and how the affected style runs change as the characters are edited. The framework currently defines two types of style propagation:

Styles that propagate by character can be applied to any arbitrary range of at least one character. The styles remain with these characters regardless of how characters within that range or surrounding that range are edited. Styles applied to a range of characters also propagate to any new text entered into that range.

For example, this shows a sequence of possible editing changes:

Styles that propagate by paragraph can be applied only to paragraphs--ranges of characters delimited by paragraph-separator characters (UUnicodeSpecial::kParagraphSeparator). This makes the style propagation mechanism more complicated than it is for character styles, because IText has to repropagate paragraph styles when paragraph separator characters are added or deleted.

The mechanism for propagating styles follows these rules:

IText propagates paragraph styles backwards from the character closest to a paragraph separator back to the beginning of the paragraph. For example, if you have two text strings containing several paragraphs with different paragraph styles:

When propagating paragraph styles, IText recognizes only the UUnicodeSpecial::kParagraphSeparator character (U+2029) to be a paragraph-separator character. When text in other character encoding systems is transcoded into Unicode, you must ensure that it is processed by an ILineBreakConverter object so that the separator characters are transcoded correctly.


Styles and Style Sets
Transcoding Classes

Editing Character Data in an IText Object