|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.page.adobe.postscript.AFMParser
Reads in a file corresponding to the Adobe Font Metrics Format Specification (.afm files) and builds an in-memory representation of the specific font's information.
Parsing details: Each afm file contains information for one PostScript font program. Each begins with Global information about the font in general, then sections on individual character metrics.
The file format is line-oriented, each line beginning with a property (key) followed by values for that property. Keys and values are separated by one or more white spaces. Key names are case-sensitive.
Field Summary | |
static int |
ASCENDER
|
static int |
CAPHEIGHT
|
static int |
CHARBBOX
|
static int |
CHARNAME
|
static int |
CODE
|
static int |
COMMENT
|
static int |
COMPCHAR
|
static int |
COMPCHARPIECE
|
protected String |
currentLine
|
protected String |
DELIMITERS
|
static int |
DESCENDER
|
static int |
ENCODINGSCHEME
|
static int |
ENDCHARMETRICS
|
static int |
ENDCOMPOSITES
|
static int |
ENDFONTMETRICS
|
static int |
ENDKERNDATA
|
static int |
ENDKERNPAIRS
|
static int |
ENDTRACKKERN
|
protected static int |
EOF
|
static int |
FAMILYNAME
|
static int |
FONTBBOX
|
static int |
FONTNAME
|
static int |
FULLNAME
|
static int |
ISFIXEDPITCH
|
static int |
ITALICANGLE
|
static int |
KERNPAIR
|
static int |
KERNPAIRXAMT
|
static String[] |
keyStrings
|
static int |
LIGATURE
|
static int |
NOPE
|
protected static int |
NOT_FOUND
|
static int |
NOTICE
|
protected BufferedReader |
reader
|
static int |
STARTCHARMETRICS
|
static int |
STARTCOMPOSITES
|
static int |
STARTFONTMETRICS
|
static int |
STARTKERNDATA
|
static int |
STARTKERNPAIRS
|
static int |
STARTTRACKKERN
|
static int |
STDHW
|
static int |
STDVW
|
protected StringTokenizer |
tokenizer
|
static int |
TRACKKERN
|
static int |
UNDERLINEPOSITION
|
static int |
UNDERLINETHICKNESS
|
static int |
VERSION
|
static int |
WEIGHT
|
static int |
XHEIGHT
|
static int |
XWIDTH
|
static int |
XYWIDTH
|
Constructor Summary | |
AFMParser()
Constructor Call parse() to parse the file. |
|
AFMParser(String afmFileName)
Constructor Calls parse() for you. |
Method Summary | |
protected float |
atof(String a)
|
protected int |
atoi(String a)
|
protected String |
getLine()
Return the rest of the current line and move the pointer to the next line. |
static void |
main(String[] args)
Driver |
Vector |
parse(InputStream inputStream)
Parse the file and build the in-memory image. |
protected void |
parseCharMetrics(com.klg.jclass.page.adobe.postscript.FontPS font)
This function is called by parseFile to save all character metric information. |
protected void |
parseCompCharData()
|
protected void |
parseGlobals(com.klg.jclass.page.adobe.postscript.FontPS font)
This function is called by "parseFile". |
protected void |
parsePairKernData(com.klg.jclass.page.adobe.postscript.FontPS font)
|
protected void |
parseTrackKernData(com.klg.jclass.page.adobe.postscript.FontPS font)
This function is called by "parseFile". |
protected int |
recognize(String key)
|
protected String |
token()
Return the next token from the file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ASCENDER
public static final int CHARBBOX
public static final int CODE
public static final int COMPCHAR
public static final int CAPHEIGHT
public static final int COMMENT
public static final int DESCENDER
public static final int ENCODINGSCHEME
public static final int ENDCHARMETRICS
public static final int ENDCOMPOSITES
public static final int ENDFONTMETRICS
public static final int ENDKERNDATA
public static final int ENDKERNPAIRS
public static final int ENDTRACKKERN
public static final int FAMILYNAME
public static final int FONTBBOX
public static final int FONTNAME
public static final int FULLNAME
public static final int ISFIXEDPITCH
public static final int ITALICANGLE
public static final int KERNPAIR
public static final int KERNPAIRXAMT
public static final int LIGATURE
public static final int CHARNAME
public static final int NOTICE
public static final int COMPCHARPIECE
public static final int STARTCHARMETRICS
public static final int STARTCOMPOSITES
public static final int STARTFONTMETRICS
public static final int STARTKERNDATA
public static final int STARTKERNPAIRS
public static final int STARTTRACKKERN
public static final int STDHW
public static final int STDVW
public static final int TRACKKERN
public static final int UNDERLINEPOSITION
public static final int UNDERLINETHICKNESS
public static final int VERSION
public static final int XYWIDTH
public static final int XWIDTH
public static final int WEIGHT
public static final int XHEIGHT
public static final int NOPE
public static String[] keyStrings
protected String currentLine
protected static final int EOF
protected static final int NOT_FOUND
protected BufferedReader reader
protected String DELIMITERS
protected StringTokenizer tokenizer
Constructor Detail |
public AFMParser()
public AFMParser(String afmFileName) throws FileNotFoundException, IOException
afmFileName
- a String file name.
FileNotFoundException
- If a file is not found.
IOException
- If there is an error.Method Detail |
public Vector parse(InputStream inputStream) throws IOException
parse
in interface FontParser
IOException
- If there is an error.protected String token() throws IOException
IOException
protected String getLine() throws IOException
IOException
protected void parseCompCharData() throws IOException
IOException
protected void parsePairKernData(com.klg.jclass.page.adobe.postscript.FontPS font) throws IOException
IOException
protected void parseTrackKernData(com.klg.jclass.page.adobe.postscript.FontPS font) throws IOException
IOException
protected void parseCharMetrics(com.klg.jclass.page.adobe.postscript.FontPS font) throws IOException
IOException
protected void parseGlobals(com.klg.jclass.page.adobe.postscript.FontPS font) throws IOException
IOException
protected int atoi(String a)
protected float atof(String a)
protected int recognize(String key)
public static void main(String[] args)
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |