@Test
    public void testTTFParsing() throws Exception {
        ContentHandler handler = new BodyContentHandler();
        Metadata metadata = new Metadata();
        ParseContext context = new ParseContext();
        //Open Sans font is ASL 2.0 according to
        //http://www.google.com/fonts/specimen/Open+Sans
        //...despite the copyright in the file's metadata.

        try (TikaInputStream stream = TikaInputStream
                .get(getResourceAsUrl("/test-documents/testTrueType3.ttf"))) {
            AUTO_DETECT_PARSER.parse(stream, handler, metadata, context);
        }

        assertEquals("application/x-font-ttf", metadata.get(Metadata.CONTENT_TYPE));
        assertEquals("Open Sans Bold", metadata.get(TikaCoreProperties.TITLE));

        assertEquals("2010-12-30T11:04:00Z", metadata.get(TikaCoreProperties.CREATED));
        assertEquals("2011-05-05T12:37:53Z", metadata.get(TikaCoreProperties.MODIFIED));

        assertEquals("Open Sans Bold", metadata.get(MET_FONT_NAME));
        assertEquals("Open Sans", metadata.get(MET_FONT_FAMILY_NAME));
        assertEquals("Bold", metadata.get(MET_FONT_SUB_FAMILY_NAME));
        assertEquals("OpenSans-Bold", metadata.get(MET_PS_NAME));

        assertEquals("Digitized", metadata.get("Copyright").substring(0, 9));
        assertEquals("Open Sans", metadata.get("Trademark").substring(0, 9));

        // Not extracted
        assertEquals(null, metadata.get(MET_FONT_FULL_NAME));
        assertEquals(null, metadata.get(MET_FONT_WEIGHT));
        assertEquals(null, metadata.get(MET_FONT_VERSION));

        // Currently, the parser doesn't extract any contents
        String content = handler.toString();
        assertEquals("", content);
    }
Test case for parsing various different font files.
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-font-module/src/test/java/org/apache/tika/parser/font/FontParsersTest.java