Package org.axsl.ps

Examples of org.axsl.ps.Cmap04


        final int glyphIdArrayOffset = (int) getReader().getFilePointer();

        // Parse the table entries and build a CMap4 from them.
        final String encodingName = "internal-"
                + this.ttfFont().getPostscriptName();
        final Cmap04 cmap04 = psServer.makeCmap04(encodingName, segCountX2 / 2);
        for (int i = 0; i < startCount.length; i++) {
            if (rangeOffset[i] == 0) {
                cmap04.addEntry(startCount[i],
                        endCount[i],
                        (char) (startCount[i] + deltas[i]));
            } else {
                final char[] computedIndexes = new char[endCount[i]
                        - startCount[i] + 1];
                for (int j = startCount[i]; j <= endCount[i]; j++) {
                    final int glyphOffset
                            = glyphIdArrayOffset
                            + ((rangeOffset[i] / 2)
                            + (j - startCount[i])
                            + i - segCountX2 / 2)
                            * 2;
                    getReader().seek(glyphOffset);
                    final char glyphIndex =
                            (char) ((getReader().readUnsignedShort()
                            + deltas[i]) & Character.MAX_VALUE);
                    computedIndexes[j - startCount[i]] = glyphIndex;
                }
                cmap04.addEntry(startCount[i],
                        endCount[i], computedIndexes);
            }
            getLogger().debug(i + ": " + startCount[i] + " - "
                    + endCount[i]);
        }
View Full Code Here

TOP

Related Classes of org.axsl.ps.Cmap04

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.