bai yuan created PDFBOX-5556:
--------------------------------

             Summary: 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
         Attachments: Swiss 721 Bold BT.ttf, 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".



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to