Examples of GlyphList


Examples of ae.sun.font.GlyphList

        }
        /* setFromString returns false if shaping is needed, and we then back
         * off to a TextLayout. Such text may benefit slightly from a lower
         * overhead in this approach over the approach in previous releases.
         */
        GlyphList gl = GlyphList.getInstance();
        if (gl.setFromString(info, s, devx, devy)) {
            drawGlyphList(sg2d, gl);
            gl.dispose();
        } else {
            gl.dispose(); // release this asap.
            TextLayout tl = new TextLayout(s, sg2d.getFont(),
                                           sg2d.getFontRenderContext());
            tl.draw(sg2d, (float)x, (float)y);
        }
    }
View Full Code Here

Examples of ae.sun.font.GlyphList

            y = (float) origin[1];
        } else {
            x = ix + info.originX + sg2d.transX;
            y = iy + info.originY + sg2d.transY;
        }
        GlyphList gl = GlyphList.getInstance();
        if (gl.setFromChars(info, data, offset, length, x, y)) {
            drawGlyphList(sg2d, gl);
            gl.dispose();
        } else {
            gl.dispose(); // release this asap.
            TextLayout tl = new TextLayout(new String(data, offset, length),
                                           sg2d.getFont(),
                                           sg2d.getFontRenderContext());
            tl.draw(sg2d, ix, iy);
View Full Code Here

Examples of ae.sun.font.GlyphList

        } else {
            x += sg2d.transX; // don't use the glyph info origin, already in gv.
            y += sg2d.transY;
        }

        GlyphList gl = GlyphList.getInstance();
        gl.setFromGlyphVector(info, gv, x, y);
        drawGlyphList(sg2d, gl, info.aaHint);
        gl.dispose();
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.font.encoding.GlyphList

        addOperator(new ShowTextLineAndSpace());

        // load additional glyph list for Unicode mapping
        String path = "org/apache/pdfbox/resources/glyphlist/additional.txt";
        InputStream input = GlyphList.class.getClassLoader().getResourceAsStream(path);
        glyphList = new GlyphList(GlyphList.getAdobeGlyphList(), input);
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.font.encoding.GlyphList

    @Override
    public String toUnicode(int code, GlyphList customGlyphList) throws IOException
    {
        // allow the glyph list to be overridden for the purpose of extracting Unicode
        // we only do this when the font's glyph list is the AGL, to avoid breaking Zapf Dingbats
        GlyphList unicodeGlyphList;
        if (this.glyphList == GlyphList.getAdobeGlyphList())
        {
            unicodeGlyphList = customGlyphList;
        }
        else
        {
            unicodeGlyphList = this.glyphList;
        }

        // first try to use a ToUnicode CMap
        String unicode = super.toUnicode(code);
        if (unicode != null)
        {
            return unicode;
        }

        // if the font is a "simple font" and uses MacRoman/MacExpert/WinAnsi[Encoding]
        // or has Differences with names from only Adobe Standard and/or Symbol, then:
        //
        //    a) Map the character codes to names
        //    b) Look up the name in the Adobe Glyph List to obtain the Unicode value

        String name = null;
        if (encoding != null)
        {
            name = encoding.getName(code);
            unicode = unicodeGlyphList.toUnicode(name);
            if (unicode != null)
            {
                return unicode;
            }
        }
View Full Code Here

Examples of org.axsl.ps.GlyphList

     * @param psServer The PostScript server.
     * @param glyphName The glyph name to be converted.
     * @return The Unicode code point that corresponds to glyphName.
     */
    private char getCodePointForGlyphName(final PsServer psServer, final String glyphName) {
        GlyphList gl = psServer.getPredefinedGlyphList(GlyphList.Predefined.AGL);
        char theChar = gl.mapGlyphNameToCodePoint(glyphName);
        if (theChar == Character.MAX_VALUE) {
            gl = psServer.getPredefinedGlyphList(GlyphList.Predefined.ZAPF_DINGBATS);
            theChar = gl.mapGlyphNameToCodePoint(glyphName);
        }
        return theChar;
    }
View Full Code Here

Examples of org.axsl.ps.GlyphList

     * @throws PsException If a glyph name cannot be mapped to a code point.
     */
    private void createCodePoints() throws PsException {
        this.glyphListsToCheck = new ArrayList<GlyphList>(this.glyphLists.size() + 1);
        for (String glyphListString : this.glyphLists) {
            final GlyphList glyphList = GlyphList4a.getGlyphList(glyphListString);
            this.glyphListsToCheck.add(glyphList);
        }
        this.glyphListsToCheck.add(GlyphListAGL.getInstance());

        for (int i = 0; i < this.glyphNames.size(); i++) {
            final String glyphName = this.glyphNames.get(i);
            for (int j = 0; j < this.glyphListsToCheck.size(); j++) {
                final GlyphList glyphList = this.glyphListsToCheck.get(j);
                final char codePoint = glyphList.mapGlyphNameToCodePoint(
                        glyphName);
                if (codePoint != Character.MAX_VALUE) {
                    this.codePoints.set(i, codePoint);
                    final char glyphIndex = this.glyphIndexes.get(i);
                    this.codePointIndexes.set(i, glyphIndex);
View Full Code Here

Examples of org.axsl.ps.GlyphList

     * @throws PsException For errors parsing the line.
     */
    private void processCurrentLine(final String line, final int arrayIndex) throws PsException {
        this.characterSet.add(Character.MIN_VALUE);
        this.glyphNames.add(StringUtil.EMPTY_STRING);
        final GlyphList gl = GlyphListAGL.getInstance();
        final char theChar = gl.mapGlyphNameToCodePoint(line);
        if (theChar == Character.MAX_VALUE) {
            throw new PsException("Character not found in Adobe Glyph List, line "
                    + this.currentLineNumber + ": " + line);

        }
View Full Code Here

Examples of org.axsl.ps.GlyphList

    public String mapCodePointToGlyphName(final List<GlyphList> glyphLists, final int codePoint) {
        if (glyphLists == null) {
            return null;
        }
        for (int i = 0; i < glyphLists.size(); i++) {
            final GlyphList list = glyphLists.get(i);
            if (list == null) {
                continue;
            }
            final String glyphName = list.mapCodePointToGlyphName(codePoint);
            if (glyphName == null) {
                continue;
            }
            /* Make sure it maps back. Otherwise it must have come from a
             * different list. */
 
View Full Code Here

Examples of org.axsl.ps.GlyphList

    public char mapGlyphNameToCodePoint(final List<GlyphList> glyphLists, final String glyphName) {
        if (glyphLists == null) {
            return Encoding.INVALID_UNICODE_CHAR;
        }
        for (int i = 0; i < glyphLists.size(); i++) {
            final GlyphList list = glyphLists.get(i);
            if (list == null) {
                continue;
            }
            final char c = list.mapGlyphNameToCodePoint(glyphName);
            if (c != Encoding.INVALID_UNICODE_CHAR) {
                return c;
            }
        }
        return Encoding.INVALID_UNICODE_CHAR;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.