Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Not A Bug
-
2.0.12
-
None
-
None
-
None
Description
webdings.ttf
1. Run the follows code on linux.
2. When the code is finished executing, use the command "lsof -c java | grep webdings" to check this font file is not released.
public static void main(String[] args) throws IOException { System.setProperty("sun.java2d.cmm", "sun.java2d.cmm.kcms.KcmsServiceProvider"); PDDocument doc = new PDDocument(); PDPage page = new PDPage(PDRectangle.A4); doc.addPage(page); File file = new File("webdings.ttf"); PDType0Font ttFont = PDType0Font.load(doc, file); PDPageContentStream contentStream1 = new PDPageContentStream(doc, page); contentStream1.beginText(); contentStream1.newLineAtOffset(100, 100); if(isCharacterEncodeable("depending", ttFont)) { contentStream1.setFont(ttFont, 12); contentStream1.showText("depending"); } contentStream1.endText(); contentStream1.close(); doc.save("export.pdf"); doc.close(); System.out.println("aaaaa"); } private static boolean isCharacterEncodeable(String text, PDType0Font font){ try { font.encode(text); return true; } catch (Exception e) { return false; } }
Attachments
Attachments
Issue Links
- is related to
-
PDFBOX-4854 Add test that font can be deleted after usage
- Closed