|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.foray.ps.encode.EncodingParser
public class EncodingParser
An EncodingParser instance parses an encoding list, arranging its data for efficient use during processing.
Constructor Summary | |
---|---|
EncodingParser(InputStream input,
int columnNum,
int radix,
List<String> glyphLists)
Create a new EncodingParser instance. |
Method Summary | |
---|---|
static String |
formatArrayIndex(int index)
Formats the array index for java source code. |
char[] |
getCodePointIndexes()
Returns the codepoint indexes. |
char[] |
getCodePoints()
Returns the codepoints. |
char[] |
getGlyphIndexes()
Returns the glyph indexes. |
List<org.axsl.ps.GlyphList> |
getGlyphListsToCheck()
Returns the glyph lists to check. |
String[] |
getGlyphNames()
Returns the glyph names. |
static void |
main(String[] args)
Main method useful for parsing an encoding list file from the command-line and generating the java code that encapsulates that encoding. |
static String |
padSpaces(String string,
int desiredColumn,
int minimumPad)
Pads spaces in the output to try to make it more readable. |
void |
parseList()
Parses a glyph list. |
void |
writeAsJavaStatics(OutputStream out)
Writes out the 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 |
---|
public EncodingParser(InputStream input, int columnNum, int radix, List<String> glyphLists)
input
- The reader encapsulating the file to be parsed.columnNum
- The column number in the input file that should be read to get the encoded value for this
encoding.
Column number 1 is the first field after the glyph name, that is, field 2.radix
- The radix of the numbering system (10 for decimal, 8 for octal, etc.).glyphLists
- The list of glyph lists to be consulted when mapping glyph names to Unicode code points, listed
in the order in which they should be checked.
The Adobe Glyph List is always consulted, but only after any custom ones listed here.Method Detail |
---|
public void parseList() throws IOException, org.axsl.ps.PsException
IOException
- For I/O Errors.
org.axsl.ps.PsException
- For errors parsing the input.public void writeAsJavaStatics(OutputStream out) throws IOException
out
- The OutputStream to which the data structures should be
written.
IOException
- For errors when writing to out.public static String padSpaces(String string, int desiredColumn, int minimumPad)
string
- The pre-padded output line.desiredColumn
- The column number up to which padding should be
added.minimumPad
- The minimum padding size that should be added.
public static String formatArrayIndex(int index)
index
- The index to be formatted.
public char[] getCodePointIndexes()
public char[] getCodePoints()
public char[] getGlyphIndexes()
public String[] getGlyphNames()
public List<org.axsl.ps.GlyphList> getGlyphListsToCheck()
public static void main(String[] args)
args
- Element 0 is the URL of the encoding list to be parsed.
This file is a text file, one line per record, with at least two
whitespace-delimited fields.
The first field is always the glyph name.
The second and any other (optional) fields contain the glyph index for
that glyph name for a specific encoding.
Thus multiple encodings for the same glyph list can be contained in the
same file.
Element 1 is the column-number to parse.
Column number 1 is the first field after the glyph name, i.e. field 2.
Element 2 is the radix of the numbering system (10 for decimal, 8 for
octal, etc.).
Element 3 is the URL of the file to which the java source code should be
written.
Element 4 is the (optional) list of already-registered glyph lists that
should be consulted when searching for a glyph name.
The Adobe Glyph List is always consulted, but only after any custom ones
listed here.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |