@Test
    public void testFontDetection() throws Exception {
        assertTypeByName("application/x-font-adobe-metric", "x.afm");
        assertTypeByData("application/x-font-adobe-metric", "testAFM.afm");

        assertTypeByName("application/x-font-printer-metric", "x.pfm");
        // TODO Get a sample .pfm file
        assertTypeByData("application/x-font-printer-metric",
                new byte[]{0x00, 0x01, 256 - 0xb1, 0x0a, 0x00, 0x00, 0x43, 0x6f, 0x70, 0x79, 0x72,
                        0x69, 0x67, 0x68, 0x74, 0x20});

        assertTypeByName("application/x-font-type1", "x.pfa");
        // TODO Get a sample .pfa file
        assertTypeByData("application/x-font-type1",
                new byte[]{0x25, 0x21, 0x50, 0x53, 0x2d, 0x41, 0x64, 0x6f, 0x62, 0x65, 0x46, 0x6f,
                        0x6e, 0x74, 0x2d, 0x31, 0x2e, 0x30, 0x20, 0x20, 0x2d, 0x2a, 0x2d, 0x20});

        assertTypeByName("application/x-font-type1", "x.pfb");
        // TODO Get a sample .pfm file
        assertTypeByData("application/x-font-type1",
                new byte[]{-0x80, 0x01, 0x09, 0x05, 0x00, 0x00, 0x25, 0x21, 0x50, 0x53, 0x2d, 0x41,
                        0x64, 0x6f, 0x62, 0x65, 0x46, 0x6f, 0x6e, 0x74, 0x2d, 0x31, 0x2e, 0x30});
    }
Tests that we correctly detect the font types
tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/java/org/apache/tika/mime/TestMimeTypes.java