Tilman Hausherr created PDFBOX-3997:
---------------------------------------
Summary: Cannot encode strings with of surrogate pairs
Key: PDFBOX-3997
URL: https://issues.apache.org/jira/browse/PDFBOX-3997
Project: PDFBox
Issue Type: Bug
Components: FontBox
Affects Versions: 2.0.8
Reporter: Tilman Hausherr
Assignee: Tilman Hausherr
Fix For: 2.0.9, 3.0.0
Attachments: NotoEmoji-Regular.ttf
This code doesn't work:
{code:java}
try (PDDocument doc = new PDDocument())
{
PDPage page = new PDPage();
doc.addPage(page);
try (PDPageContentStream cs = new PDPageContentStream(doc, page))
{
PDFont font = PDType0Font.load(doc, new File("NotoEmoji-Regular.ttf"));
cs.setFont(font, 50);
cs.beginText();
cs.newLineAtOffset(100, 700);
cs.showText("\uD83D\uDE81");
cs.endText();
}
doc.save("heli.pdf");
}
{code}
It throws an exception
{quote}
IllegalArgumentException: No glyph for U+1F681 in font NotoEmoji
{quote}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]