Package org.apache.fop.fonts

Examples of org.apache.fop.fonts.CIDSubset


                return new int[] { 0 };
            }

            @Override
            public CIDSubset getCIDSubset() {
                return new CIDSubset();
            }
        }
        PDFDocument doc = new PDFDocument("Test");
        PDFFactory pdfFactory = new PDFFactory(doc);
        MockedFont font = new MockedFont();
View Full Code Here


                return new int[] { 0 };
            }

            @Override
            public CIDSubset getCIDSubset() {
                return new CIDSubset();
            }
View Full Code Here

     */
    public PDFWArray getSubsetWidths(CIDFont cidFont) {
        // Create widths for reencoded chars
        PDFWArray warray = new PDFWArray();
        int[] widths = cidFont.getWidths();
        CIDSubset subset = cidFont.getCIDSubset();
        int[] tmpWidth = new int[subset.getSubsetSize()];

        for (int i = 0, c = subset.getSubsetSize(); i < c; i++) {
            int nwx = Math.max(0, subset.getGlyphIndexForSubsetIndex(i));
            tmpWidth[i] = widths[nwx];
        }
        warray.addEntry(0, tmpWidth);
        return warray;
    }
View Full Code Here

        // TODO XUID (optional but strongly recommended)

        // TODO /FontInfo

        gen.write("/CIDCount ");
        CIDSubset cidSubset = font.getCIDSubset();
        int subsetSize = cidSubset.getSubsetSize();
        gen.write(subsetSize);
        gen.writeln(" def");
        gen.writeln("/GDBytes 2 def"); // TODO always 2?
        gen.writeln("/CIDMap [<");
        int colCount = 0;
        int lineCount = 1;
        for (int cid = 0; cid < subsetSize; cid++) {
            if (colCount++ == 20) {
                gen.newLine();
                colCount = 1;
                if (lineCount++ == 800) {
                    gen.writeln("> <");
                    lineCount = 1;
                }
            }
            String gid;
            if (font.getEmbeddingMode() != EmbeddingMode.FULL) {
                gid = HexEncoder.encode(cid, 4);
            } else {
                gid = HexEncoder.encode(cidSubset.getGlyphIndexForSubsetIndex(cid), 4);
            }
            gen.write(gid);
        }
        gen.writeln(">] def");
        FontFileReader reader = new FontFileReader(fontStream);
View Full Code Here

     */
    public PDFWArray getSubsetWidths(CIDFont cidFont) {
        // Create widths for reencoded chars
        PDFWArray warray = new PDFWArray();
        int[] widths = cidFont.getWidths();
        CIDSubset subset = cidFont.getCIDSubset();
        int[] tmpWidth = new int[subset.getSubsetSize()];

        for (int i = 0, c = subset.getSubsetSize(); i < c; i++) {
            int nwx = Math.max(0, subset.getGlyphIndexForSubsetIndex(i));
            tmpWidth[i] = widths[nwx];
        }
        warray.addEntry(0, tmpWidth);
        return warray;
    }
View Full Code Here

        // TODO XUID (optional but strongly recommended)

        // TODO /FontInfo

        gen.write("/CIDCount ");
        CIDSubset cidSubset = font.getCIDSubset();
        int subsetSize = cidSubset.getSubsetSize();
        gen.write(subsetSize);
        gen.writeln(" def");
        gen.writeln("/GDBytes 2 def"); // TODO always 2?
        gen.writeln("/CIDMap [<");
        int colCount = 0;
        int lineCount = 1;
        for (int cid = 0; cid < subsetSize; cid++) {
            if (colCount++ == 20) {
                gen.newLine();
                colCount = 1;
                if (lineCount++ == 800) {
                    gen.writeln("> <");
                    lineCount = 1;
                }
            }
            String gid;
            if (font.getEmbeddingMode() != EmbeddingMode.FULL) {
                gid = HexEncoder.encode(cid, 4);
            } else {
                gid = HexEncoder.encode(cidSubset.getGlyphIndexForSubsetIndex(cid), 4);
            }
            gen.write(gid);
        }
        gen.writeln(">] def");
        FontFileReader reader = new FontFileReader(fontStream);
View Full Code Here

     */
    public PDFWArray getSubsetWidths(CIDFont cidFont) {
        // Create widths for reencoded chars
        PDFWArray warray = new PDFWArray();
        int[] widths = cidFont.getWidths();
        CIDSubset subset = cidFont.getCIDSubset();
        int[] tmpWidth = new int[subset.getSubsetSize()];

        for (int i = 0, c = subset.getSubsetSize(); i < c; i++) {
            int nwx = Math.max(0, subset.getGlyphIndexForSubsetIndex(i));
            tmpWidth[i] = widths[nwx];
        }
        warray.addEntry(0, tmpWidth);
        return warray;
    }
View Full Code Here

TOP

Related Classes of org.apache.fop.fonts.CIDSubset

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.