Why can't I set the font of a Phrase (or Paragraph)?

笑着哭i 提交于 2019-12-02 11:26:48
Bruno Lowagie

This is documented in my book.

  • A Chunk is an atomic part of text in the sense that all the text in a Chunk has the same font family, font size, font color,...
  • A Phrase is a collection of Chunk objects and as such a Phrase can contain different 'atoms' of text using different fonts.

In your example "Nos formules" will be written in Helvetica. You change the font after the Helvetica Chunk with the text "Nos formules" was added to the Phrase.As you didn't add anything else to titreFormules, the font "Comic" is never used.

This is also what I meant when I answered the question iText - PdfPTable doesn't show Cyrillic(Russian) symbols:

When you use setFont(), you change the font of the Phrase for all the content that is added after the font was set.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!