Package org.axsl.ps

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


     * @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

     * @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

    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

    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

        } catch (final IOException e1) {
            logError("Unable to read: " + file);
            return;
        }
        try {
            final GlyphList glyphList = this.fontServer.getPsServer().parseGlyphList(name, input);
            this.glyphListMap.put(name, glyphList);
        } catch (final IOException e) {
            logError("Error parsing \"" + file + "\": " + e.getMessage());
        } catch (final PsException e) {
            logError("Error parsing \"" + file + "\": " + e.getMessage());
View Full Code Here

TOP

Related Classes of org.axsl.ps.GlyphList

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.