Package org.foray.font

Examples of org.foray.font.Subset


     * Same as for {@link FontOutput4a#getCharsUsed()}, except that this
     * returns the chars used for the font subset.
     * @return The chars actually used by the document.
     */
    private char[] getSubsetCharsUsed() {
        final Subset subset = this.fontUse.getSubset();
        final Encoding encoding = this.fontUse.getEncoding();
        final char[] charArray = new char[subset.numGlyphsUsed()];
        for (int i = 0; i < subset.numGlyphsUsed(); i++) {
            final int originalGlyphIndex = subset.decodeSubsetIndex(i);
            final int codePoint = encoding.decodeCharacter(
                    (char) originalGlyphIndex);
            charArray[i] = (char) codePoint;
        }
        return charArray;
View Full Code Here


        final FreeStandingFont fsf = this.getFreeStandingFont();
        if (fsf == null) {
            return null;
        }
        if (fsf.getFontComplexity() != Font.Complexity.SIMPLE) {
            final Subset subset = this.fontUse.getSubset();
            if (subset == null) {
                return fsf.getWidths();
            }
            return getSubsetWidths();
        }
View Full Code Here

    /**
     * Returns the width array for reencoded glyphs in a subsetted font.
     * @return The width array for the reencoded glyphs.
     */
    private short[] getSubsetWidths() {
        final Subset subset = this.fontUse.getSubset();
        final short[] originalWidths = this.fontUse.getFreeStandingFont()
                .getWidths();
        final short[] tmpWidth = new short[subset.numGlyphsUsed()];
        for (int i = 0; i < subset.numGlyphsUsed(); i++) {
            final int originalIndex = subset.decodeSubsetIndex(i);
            tmpWidth[i] = originalWidths[originalIndex];
        }
        return tmpWidth;
    }
View Full Code Here

TOP

Related Classes of org.foray.font.Subset

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.