This class is used to parse AFM(Adobe Font Metrics) documents.
Field Summary |
---|
public static final String | COMMENT | This is a comment in a AFM file. |
public static final String | START_FONT_METRICS | This is the constant used in the AFM file to start a font metrics item. |
public static final String | END_FONT_METRICS | This is the constant used in the AFM file to end a font metrics item. |
public static final String | FONT_NAME | This is the font name. |
public static final String | FULL_NAME | This is the full name. |
public static final String | FAMILY_NAME | This is the Family name. |
public static final String | WEIGHT | This is the weight. |
public static final String | FONT_BBOX | This is the font bounding box. |
public static final String | VERSION | This is the version of the font. |
public static final String | NOTICE | This is the notice. |
public static final String | ENCODING_SCHEME | This is the encoding scheme. |
public static final String | MAPPING_SCHEME | This is the mapping scheme. |
public static final String | ESC_CHAR | This is the escape character. |
public static final String | CHARACTER_SET | This is the character set. |
public static final String | CHARACTERS | This is the characters attribute. |
public static final String | IS_BASE_FONT | This will determine if this is a base font. |
public static final String | V_VECTOR | This is the V Vector attribute. |
public static final String | IS_FIXED_V | This will tell if the V is fixed. |
public static final String | CAP_HEIGHT | This is the cap height attribute. |
public static final String | X_HEIGHT | This is the X height. |
public static final String | ASCENDER | This is ascender attribute. |
public static final String | DESCENDER | This is the descender attribute. |
public static final String | UNDERLINE_POSITION | The underline position. |
public static final String | UNDERLINE_THICKNESS | This is the Underline thickness. |
public static final String | ITALIC_ANGLE | This is the italic angle. |
public static final String | CHAR_WIDTH | This is the char width. |
public static final String | IS_FIXED_PITCH | This will determine if this is fixed pitch. |
public static final String | START_CHAR_METRICS | This is the start of character metrics. |
public static final String | END_CHAR_METRICS | This is the end of character metrics. |
public static final String | CHARMETRICS_C | The character metrics c value. |
public static final String | CHARMETRICS_CH | The character metrics c value. |
public static final String | CHARMETRICS_WX | The character metrics value. |
public static final String | CHARMETRICS_W0X | The character metrics value. |
public static final String | CHARMETRICS_W1X | The character metrics value. |
public static final String | CHARMETRICS_WY | The character metrics value. |
public static final String | CHARMETRICS_W0Y | The character metrics value. |
public static final String | CHARMETRICS_W1Y | The character metrics value. |
public static final String | CHARMETRICS_W | The character metrics value. |
public static final String | CHARMETRICS_W0 | The character metrics value. |
public static final String | CHARMETRICS_W1 | The character metrics value. |
public static final String | CHARMETRICS_VV | The character metrics value. |
public static final String | CHARMETRICS_N | The character metrics value. |
public static final String | CHARMETRICS_B | The character metrics value. |
public static final String | CHARMETRICS_L | The character metrics value. |
public static final String | STD_HW | The character metrics value. |
public static final String | STD_VW | The character metrics value. |
public static final String | START_TRACK_KERN | This is the start of track kern data. |
public static final String | END_TRACK_KERN | This is the end of track kern data. |
public static final String | START_KERN_DATA | This is the start of kern data. |
public static final String | END_KERN_DATA | This is the end of kern data. |
public static final String | START_KERN_PAIRS | This is the start of kern pairs data. |
public static final String | END_KERN_PAIRS | This is the end of kern pairs data. |
public static final String | START_KERN_PAIRS0 | This is the start of kern pairs data. |
public static final String | START_KERN_PAIRS1 | This is the start of kern pairs data. |
public static final String | START_COMPOSITES | This is the start compisites data section. |
public static final String | END_COMPOSITES | This is the end compisites data section. |
public static final String | CC | This is a composite character. |
public static final String | PCC | This is a composite charater part. |
public static final String | KERN_PAIR_KP | This is a kern pair. |
public static final String | KERN_PAIR_KPH | This is a kern pair. |
public static final String | KERN_PAIR_KPX | This is a kern pair. |
public static final String | KERN_PAIR_KPY | This is a kern pair. |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from org.apache.fontbox.afm.AFMParser Detail: |
public FontMetric getResult() {
return result;
}
This will get the result of the parsing. |
public static void main(String[] args) throws IOException {
java.io.File afmDir = new java.io.File( "Resources/afm" );
java.io.File[] files = afmDir.listFiles();
for( int i=0; i< files.length; i++ )
{
if( files[i].getPath().toUpperCase().endsWith( ".AFM" ) )
{
long start = System.currentTimeMillis();
java.io.FileInputStream input = new java.io.FileInputStream( files[i] );
AFMParser parser = new AFMParser( input );
parser.parse();
long stop = System.currentTimeMillis();
System.out.println( "Parsing:" + files[i].getPath() + " " + (stop-start) );
}
}
}
A method to test parsing of all AFM documents in the resources
directory. |
public void parse() throws IOException {
result = parseFontMetric();
}
This will parse the AFM document. This will close the Input stream
when the parsing is finished. |