Package org.axsl.ps

Examples of org.axsl.ps.Type1FontDictionary


        final FontServer4a fontServer = new FontServer4a();
        final FontFileReader reader = new FontFileReader(fontServer, fontFile);
        assertNotNull(reader);
        final Type1PFBFile pfbFile = new Type1PFBFile(reader);
        assertNotNull(pfbFile);
        final Type1FontDictionary fontDict = pfbFile.getFontDictionary();
        assertNotNull(fontDict);

        /* Test values below obtained from the AFM file. */

        final Type1FontInfoDictionary fontInfoDict = fontDict.getFontInfoDictionary();
        assertNotNull(fontInfoDict);

        final String fontName = fontDict.getFontName();
        assertEquals("CMR10", fontName);

        final int[] fontBBox = fontDict.getFontBbox();
        assertEquals(4, fontBBox.length);
        /* Following test fails. The AFM file shows -40, but the font file returns -251. */
//        assertEquals(-40, fontBBox[0]);
        assertEquals(-250, fontBBox[1]);
        assertEquals(1009, fontBBox[2]);
        assertEquals(969, fontBBox[3]);

        final Type1PrivateDictionary privateDict = fontDict.getPrivateDictionary();
        assertNotNull(privateDict);

        final Type1CharStringsDictionary charStringsDict = fontDict.getCharStringsDictionary();
        assertNotNull(charStringsDict);
    }
View Full Code Here

TOP

Related Classes of org.axsl.ps.Type1FontDictionary

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.