In release 7.1.13 of the iText Core layout API, we have made some important changes regarding how word-wrapping is handled in the context of languages that use special scripts, such as Thai, Khmer, Lao, and Myanmar.
Let’s take a look at the following situation where there’s a line of content being laid out, this line has a sequence of
IRenderer children. Among those children is one ImageRenderer, and right after this follows a sequence of TextRenderers with special scripts as content. In this case, the TextRenderers are parsed with a checking mechanism to guarantee line wraps are only applied where the ICU allows this.
In a scenario where the checking mechanism cannot find any valid position of where to wrap the text, we would previously force a split on a non-allowed position. An example of this is shown below:
In our 7.1.13 release this behavior has been changed to instead push the sequence of TextRenderers to the next line as shown in the example below:
These changes are automatically applied when using our latest iText Core release so they require no further intervention on the user side.