【发布时间】:2015-02-10 12:01:11
【问题描述】:
这是我用来构建 Chapter 的代码:
Font chapterFont = FontFactory.getFont(FontFactory.HELVETICA, 16, Font.BOLDITALIC)
Font paragraphFont = FontFactory.getFont(FontFactory.HELVETICA, 12, Font.NORMAL)
Chunk chunk = new Chunk(doc.title, this.chapterFont).setLocalDestination(title);
Chapter chapter = new Chapter(new Paragraph(chunk), i);
chapter.setNumberDepth(0);
paragraphs.each { paragraph ->
chapter.add(new Paragraph(paragraph, paragraphFont))
}
this.document.add(chapter);
当我创建文档并将其写入文件时,段落以与章节标题相同的字体(16 Helvetica)显示。章节标题的字体设置是否会覆盖段落中的某些内容?
【问题讨论】: