设置字体大小
示例代码
package test.create.c01;
import iofd.layout.OfdDocument;
import iofd.layout.block.Paragraph;
import iofd.layout.block.paragraph.Text;
import test.create.TestDocUtil;
/**
* 设置字体大小
* */
public class C0104SetTextFontSize {
public static void main(String[] args) throws Throwable {
C0104SetTextFontSize o = new C0104SetTextFontSize();
o.done();
}
private void done() throws Throwable {
String clzName = this.getClass().getSimpleName();
System.out.println(clzName + " begin");
String s = "这是展示如何设置字体大小:3.请务必认真仔细阅读并评估本活动计划书及其所包含的所有细节内容,尤其是本计划书特别强调的相关内容,否则,谢绝报名或参与;";
OfdDocument doc = new OfdDocument();
Paragraph p = new Paragraph();
Text text = new Text(s);
/*
* 设置为10PT字体
* */
text.setSize(10d);
p.add(text);
doc.add(p);
String fileName = TestDocUtil.getOfdFilePath(this.getClass());
doc.save(fileName);
System.out.println(clzName + " end");
}
}