小编Han*_*Kun的帖子

嵌入字体和非嵌入字体有什么区别?

在书中我看到了例子:

BaseFont bf = BaseFont.createFont("KozMinPro-Regular", "Identity-V", BaseFont.NOT_EMBEDDED);
Font font = new Font(bf, 20);
VerticalText vt = new VerticalText(writer.getDirectContent()); vt.setVerticalLayout(390, 570, 540, 12, 30);
font = new Font(bf, 20);
vt.addText(new Phrase(convertCIDs("a"), font));
vt.go();

public String convertCIDs(String text) {
  char cid[] = text.toCharArray();
  for (int k = 0; k < cid.length; ++k) {
  char c = cid[k];
  if (c == '\n')
    cid[k] = '\uff00';
  else
    cid[k] = (char) (c - ' ' + 8720);
  }
  return new String(cid);
}
Run Code Online (Sandbox Code Playgroud)

当我更改为:

BaseFont bf …
Run Code Online (Sandbox Code Playgroud)

itext

2
推荐指数
1
解决办法
2210
查看次数

标签 统计

itext ×1