Chapter 11. Choosing the right font
This chapter covers
- Font files, types, and classes
- Writing systems and advanced typography
- Automatic font creation and selection
We discussed two font classes in chapter 2: Font and BaseFont. You used the Font class in section 2.2.1 for the 14 standard Type 1 fonts. These fonts are supposed to be “known” by every PDF viewer and are therefore never embedded by iText. In section 2.2.2, you used the Font class in combination with BaseFont to embed fonts. You created a BaseFont object by telling iText where to find a font program; for instance, a .ttf file. In chapter 3, you needed the BaseFont class to set the font when writing text to the direct content. You’ve also learned how to measure Strings in a certain ...