[
https://issues.apache.org/jira/browse/PDFBOX-5556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17653832#comment-17653832
]
Tilman Hausherr commented on PDFBOX-5556:
-----------------------------------------
And here is what PDFDebugger shows:
!screenshot-2.png!
> The font name displayed in the exported PDF is incorrect
> --------------------------------------------------------
>
> Key: PDFBOX-5556
> URL: https://issues.apache.org/jira/browse/PDFBOX-5556
> Project: PDFBox
> Issue Type: Bug
> Affects Versions: 2.0.24
> Reporter: bai yuan
> Priority: Major
> Attachments: Swiss 721 Bold BT.ttf, fontName.png, screenshot-1.png,
> screenshot-2.png, test.pdf
>
>
> Load the attach ttf font and save this document
> {code:java}
> PDDocument doc = new PDDocument();
> PDPage page = new PDPage();
> doc.addPage(page);
> PDPageContentStream stream = new PDPageContentStream(doc, page);
> TrueTypeFont ttFont = new TTFParser().parse("resources//fonts//Swiss 721 Bold
> BT.ttf");
> PDFont font = PDType0Font.load(doc, ttFont, true);
> stream.setFont(font, 14);
> stream.beginText();
> stream.newLineAtOffset(100, 700);
> stream.setNonStrokingColor(Color.BLACK);
> String text = "Lazy dog";
> stream.showText(text);
> stream.endText();
> stream.stroke();
> stream.close();
> doc.save("test.pdf");
> doc.close(); {code}
> Open the exported document with Adobe Acrobat Pro, the font name is
> incorrect. It should be "Swis721 BT", but it is "Swiss 72 1 BT".
> !fontName.png!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]