sfnttool 抽取中文的ttf文件怎么不能正常使用?有没有大神

图片说明

见: https://blog.csdn.net/qq_31482599/article/details/79384548

import java.io.FileOutputStream;
import com.lowagie.text.Document;
import com.lowagie.text.Font;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.BaseFont;
import com.lowagie.text.pdf.PdfWriter;
public class MainClass {
public static void main(String[] args) throws Exception {
Document document = new Document();
PdfWriter.getInstance(document, new FileOutputStream("2.pdf"));
document.open();
BaseFont bf = BaseFont.createFont("esl_gothic_shavian.otf", "Cp1252", BaseFont.EMBEDDED);
System.err.println(bf.getClass().getName());
Font font = new Font(bf, 12);
document.add(new Paragraph("abced"));
document.add(new Paragraph("this is a test", font));
document.close();
}
}
这段程序貌似是把pdf设置成otf字体输出,改一下就好!
这程序绝对经得起考研!从国外教程网站找到d!
把esl_gothic_shavian.otf换成你的字体

详见http://linux.chinaunix.net/bbs/viewthread.php?tid=1019170