org.foray.ps.encode
Class GlyphListParser

java.lang.Object
  extended by org.foray.ps.encode.GlyphListParser

public class GlyphListParser
extends Object

A GlyphListParser instance parses a glyph list, arranging its data for efficient use during processing.


Constructor Summary
GlyphListParser(InputStream input)
          Create a new GlyphListParser instance.
 
Method Summary
 char[] getCodePoints()
          Returns the sorted list of codepoints.
 char[][] getCodePointsForGlyphNames()
          Returns the array of Unicode codepoints that corresponds to getGlyphNames().
 short[] getGlyphNameIndex()
          Returns the array of indexes into getGlyphNames() that corresponds to the Unicode codepoint in getCodePoints().
 String[] getGlyphNames()
          Returns the sorted list of glyph names in this glyph list.
static void main(String[] args)
          Main method useful for parsing a glyph list file from the command-line and generating the java code that encapsulates that glyph list.
 void parseList()
          Parses a glyph list.
 void writeAsJavaStatics(OutputStream out)
          Writes out the four internal arrays that have been parsed into java source code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlyphListParser

public GlyphListParser(InputStream input)
Create a new GlyphListParser instance.

Parameters:
input - The file to be parsed.
Method Detail

parseList

public void parseList()
               throws IOException,
                      org.axsl.ps.PsException
Parses a glyph list.

Throws:
IOException - For I/O Error.
org.axsl.ps.PsException - For errors parsing the input.

writeAsJavaStatics

public void writeAsJavaStatics(OutputStream out)
                        throws IOException
Writes out the four internal arrays that have been parsed into java source code. This is useful in cases where you wish to permanently encapsulate a glyph list.

Parameters:
out - The OutputStream to which the data structures should be written.
Throws:
IOException - For errors when writing to out.

getGlyphNames

public String[] getGlyphNames()
Returns the sorted list of glyph names in this glyph list. The corresponding Unicode codepoints are found in getCodePointsForGlyphNames().

Returns:
The glyph names.

getCodePointsForGlyphNames

public char[][] getCodePointsForGlyphNames()
Returns the array of Unicode codepoints that corresponds to getGlyphNames().

Returns:
The codepoints for glyph names.

getCodePoints

public char[] getCodePoints()
Returns the sorted list of codepoints. The corresponding indexes into the glyph names is found in getGlyphNameIndex().

Returns:
The codepoints.

getGlyphNameIndex

public short[] getGlyphNameIndex()
Returns the array of indexes into getGlyphNames() that corresponds to the Unicode codepoint in getCodePoints().

Returns:
The glyph name index.

main

public static void main(String[] args)
Main method useful for parsing a glyph list file from the command-line and generating the java code that encapsulates that glyph list.

Parameters:
args - Element 0 is the URL of the glyph list to be parsed. Element 1 is the URL of the file to which the java source code should be written.


Copyright © 2017. All rights reserved.