Back to API Reference
Class
NoBreakModifier
Inherits:RangeCollectingModifier
Keeps the tagged range together as one word — no soft break is taken inside it.
Remarks
The range takes no soft, CJK, or dictionary break inside it, so it moves whole to the next line when it does not fit. Wrapping stays allowed immediately before and after it, so it behaves as a single word — and, like any word, a range wider than the text box still breaks to fit rather than overflowing. Applied to the character span of a visible markup tag (via a
ChromeRule), it makes the tag a cohesive word. Pair with a TagRule (conventional tag name nobr): uniText.AddStyle(Style.Tag(new NoBreakModifier(), "nobr")).