[
https://issues.apache.org/jira/browse/PDFBOX-6015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18008952#comment-18008952
]
Tilman Hausherr commented on PDFBOX-6015:
-----------------------------------------
I wanted to suggest to create the missing table yourself, but after looking at
the font, it turns out that it has a cmap, but not one that we look for. Sorry.
I'll add it.
> Load a TTF font which is from Mac OS throw an exception
> -------------------------------------------------------
>
> Key: PDFBOX-6015
> URL: https://issues.apache.org/jira/browse/PDFBOX-6015
> Project: PDFBox
> Issue Type: Bug
> Affects Versions: 2.0.32
> Reporter: bai yuan
> Priority: Major
> Attachments: Keyboard.ttf, screenshot-1.png
>
>
> Using PDType0Font.load to load a font which is from Mac OS, it throws an
> exception:
> {code:java}
> try (PDDocument document = new PDDocument()) {
> PDPage page = new PDPage();
> document.addPage(page);
> TrueTypeFont ttFont = new TTFParser().parse(new
> File("Keyboard.ttf"));
> PDFont font = PDType0Font.load(document, ttFont, true);
> PDPageContentStream contentStream = new
> PDPageContentStream(document, page);
> contentStream.beginText();
> contentStream.setFont(font, 12);
> contentStream.newLineAtOffset(100, 700);
> contentStream.showText("abc");
> contentStream.endText();
> contentStream.close();
> document.save("output.pdf");
> } catch (IOException e) {
> e.printStackTrace();
> }
> {code}
> The exception as follows:
> !screenshot-1.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]