Search in sources :

Example 1 with CmapLookup

use of com.tom_roush.fontbox.ttf.CmapLookup in project PdfBox-Android by TomRoush.

the class TestCMap method testPDFBox3997.

/**
 * PDFBOX-3997: test unicode that is above the basic multilingual plane, here: helicopter
 * symbol, or D83D DE81 in the Noto Emoji font.
 *
 * @throws IOException
 */
@Test
public // TODO: PdfBox-Android - provide test file
void testPDFBox3997() throws IOException {
    String fontPath = "target/pdfs/NotoEmoji-Regular.ttf";
    assumeTrue(new File(fontPath).exists());
    TrueTypeFont ttf = new TTFParser().parse(fontPath);
    CmapLookup cmap = ttf.getUnicodeCmapLookup(false);
    Assert.assertEquals(886, cmap.getGlyphId(0x1F681));
    ttf.close();
}
Also used : TrueTypeFont(com.tom_roush.fontbox.ttf.TrueTypeFont) CmapLookup(com.tom_roush.fontbox.ttf.CmapLookup) File(java.io.File) TTFParser(com.tom_roush.fontbox.ttf.TTFParser) Test(org.junit.Test)

Aggregations

CmapLookup (com.tom_roush.fontbox.ttf.CmapLookup)1 TTFParser (com.tom_roush.fontbox.ttf.TTFParser)1 TrueTypeFont (com.tom_roush.fontbox.ttf.TrueTypeFont)1 File (java.io.File)1 Test (org.junit.Test)1