Background:

The Glyph Positioning table (GPOS) provides precise control over glyph placement for sophisticated text layout and rendering in each script and language system that a font supports. To further expand its ability to support advanced glyph positioning techniques, iText is working on supporting Glyph Positioning (GPOS).

GPOS implementation will improve how iText renders feature-associated lookups which contain data for the feature. This new development will ensure that advanced adjustment positioning for complex scripts and glyphs is done properly. For instance, some languages (such as Arabic or Myanmar) require complex adjustment positioning of glyphs to have the font display as it should.

In previous versions iText will in some cases not guarantee correct results if the selected font is using unimplemented GPOS table features. However, in iText Core release 7.2.0 and Calligraph 3.0.0 support was added for GPOS lookup type 1 and subtype 2.

Code Snippet:

In the following code snippet, we take an input text written in Myanmar script and write it into a PDF using iText:

The resulting text matches the expected result shown in Figure 1:

Figure 1

However, the text from previous versions shows the results depicted in Figure 2 below:

Figure 2

You can notice the difference in results by comparing the images above, where you can see glyphs being misplaced in the second image.

Resources:

Right-click the link below and select "Save link as..." to download.

result.zip