Package org.apache.fop.fonts.type1
Class AFMParser
java.lang.Object
org.apache.fop.fonts.type1.AFMParser
Parses the contents of a Type 1 AFM font metrics file into an object structure (
AFMFile
).-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
(package private) static interface
private static class
private static class
private static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static org.apache.commons.logging.Log
private static final String
private static final int
private static final int
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final Map<String,
AFMParser.ValueHandler> private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static boolean
isWhitespace
(char ch) parse
(BufferedReader reader, String afmFileName) Parses an AFM file from a BufferedReader.parse
(InputStream in, String afmFileName) Parses an AFM file from a stream.private String
parseCharMetrics
(String line, Stack<Object> stack, String afmFileName) private String
private static int
skipToNonWhiteSpace
(String line, int startpos) private static int
skipToWhiteSpace
(String line, int startpos)
-
Field Details
-
log
private static org.apache.commons.logging.Log log -
START_FONT_METRICS
- See Also:
-
FONT_NAME
- See Also:
-
FULL_NAME
- See Also:
-
FAMILY_NAME
- See Also:
-
WEIGHT
- See Also:
-
FONT_BBOX
- See Also:
-
ENCODING_SCHEME
- See Also:
-
CHARACTER_SET
- See Also:
-
IS_BASE_FONT
- See Also:
-
IS_CID_FONT
- See Also:
-
CAP_HEIGHT
- See Also:
-
X_HEIGHT
- See Also:
-
ASCENDER
- See Also:
-
DESCENDER
- See Also:
-
STDHW
- See Also:
-
STDVW
- See Also:
-
UNDERLINE_POSITION
- See Also:
-
UNDERLINE_THICKNESS
- See Also:
-
ITALIC_ANGLE
- See Also:
-
IS_FIXED_PITCH
- See Also:
-
START_DIRECTION
- See Also:
-
END_DIRECTION
- See Also:
-
START_CHAR_METRICS
- See Also:
-
END_CHAR_METRICS
- See Also:
-
C
- See Also:
-
CH
- See Also:
-
WX
- See Also:
-
W0X
- See Also:
-
W1X
- See Also:
-
WY
- See Also:
-
W0Y
- See Also:
-
W1Y
- See Also:
-
W
- See Also:
-
W0
- See Also:
-
W1
- See Also:
-
N
- See Also:
-
B
- See Also:
-
START_TRACK_KERN
- See Also:
-
END_TRACK_KERN
- See Also:
-
START_KERN_PAIRS1
- See Also:
-
START_COMPOSITES
- See Also:
-
START_COMP_FONT_METRICS
- See Also:
-
KP
- See Also:
-
KPH
- See Also:
-
KPX
- See Also:
-
KPY
- See Also:
-
PARSE_NORMAL
private static final int PARSE_NORMAL- See Also:
-
PARSE_CHAR_METRICS
private static final int PARSE_CHAR_METRICS- See Also:
-
VALUE_PARSERS
-
PARSE_MODE_CHANGES
-
-
Constructor Details
-
AFMParser
public AFMParser()Main constructor.
-
-
Method Details
-
parse
Parses an AFM file from a stream.- Parameters:
in
- the stream to read fromafmFileName
- the name of the AFM file- Returns:
- the parsed AFM file
- Throws:
IOException
- if an I/O error occurs
-
parse
Parses an AFM file from a BufferedReader.- Parameters:
reader
- the BufferedReader instance to read fromafmFileName
- the name of the AFM file- Returns:
- the parsed AFM file
- Throws:
IOException
- if an I/O error occurs
-
parseLine
- Throws:
IOException
-
parseCharMetrics
private String parseCharMetrics(String line, Stack<Object> stack, String afmFileName) throws IOException - Throws:
IOException
-
skipToNonWhiteSpace
-
skipToWhiteSpace
-
isWhitespace
private static boolean isWhitespace(char ch)
-