concept different encoding in category itext

appears as: different encodings, Different Encoding, different encoding
iText in Action, Second Edition

This is an excerpt from Manning's book iText in Action, Second Edition.

Figure 11.5. Using different encodings of the same font

If you use a simple font, it’s up to you to decide which encoding to use. Some Western languages (for instance, French) have letters that get a cedilla (˘) or a circumflex (ˇ). Those letters are in code page 1252 (Latin 1). If you need a hacek or a caron (ˇ), you should use code page 1250 (Latin 2). Figure 11.5 shows examples using different encodings available in Arial-BoldMT, including examples in Cyrillic (code page 1251) and Greek (code page 1253).

Figure 11.5. Using different encodings of the same font

Listing 11.4, which produced what you see in figure 11.5, shows that four different BaseFont objects were created using the same font, but with different encodings. If you look at the document properties (see the window on the right in figure 11.5), you’ll find four embedded subsets of Arial-BoldMT: one using Ansi encoding (Cp1252) and three using a custom encoding.

An alternative to this approach would be to subclass the DefaultFontMapper so that it uses a different encoding, or even a different font.