java.lang.Object
org.verapdf.parser.BaseParser
org.verapdf.parser.NotSeekableBaseParser
org.verapdf.pd.font.type3.Type3CharProcParser
- All Implemented Interfaces:
Closeable,AutoCloseable
Parses type 3 char procs to obtain glyph widths.
- Author:
- Sergey Shemyakov
-
Field Summary
Fields inherited from class org.verapdf.parser.BaseParser
isPSParser, source, token -
Constructor Summary
ConstructorsConstructorDescriptionType3CharProcParser(ASInputStream charProcStream) Constructor parser from char proc data. -
Method Summary
Modifier and TypeMethodDescriptiondoubleDeprecated.a char proc that begins with the d0 operator specifies the glyph width only (ISO 32000-1, 9.6.5.3) and declares no glyph bounding box, so its ascent is undefined rather than 0.doubleDeprecated.undefined descent cannot be distinguished from 0; usegetDescentOrNull()instead.doublegetWidth()voidparse()Parses width from given char proc string.Methods inherited from class org.verapdf.parser.NotSeekableBaseParser
close, extendArray, findKeyword, getSource, isEndOfComment, readASCII85, skipComment, skipStreamSpacesMethods inherited from class org.verapdf.parser.BaseParser
appendToToken, appendToToken, clearToken, decodeASCII85, findKeyword, getErrorMessage, getLine, getLineBytes, getToken, initializeToken, isCR, isDigit, isDigit, isFF, isLF, isPSParser, nextToken, readName, readNumber, readUntilDelimiter, skipSingleSpace, skipSpaces, skipSpaces
-
Constructor Details
-
Type3CharProcParser
Constructor parser from char proc data.- Throws:
IOException
-
-
Method Details
-
parse
Parses width from given char proc string.- Throws:
IOException- if stream reading error occurred or input stream can't be parsed.
-
getWidth
public double getWidth()- Returns:
- width of glyph presented by given char proc or -1 if parsing failed or was not performed.
-
getAscent
Deprecated.a char proc that begins with the d0 operator specifies the glyph width only (ISO 32000-1, 9.6.5.3) and declares no glyph bounding box, so its ascent is undefined rather than 0. This method cannot express that; usegetAscentOrNull()instead.- Returns:
- ascent of the glyph presented by given char proc, or 0 if the char proc declares no glyph bounding box.
-
getDescent
Deprecated.undefined descent cannot be distinguished from 0; usegetDescentOrNull()instead. SeegetAscent().- Returns:
- descent of the glyph presented by given char proc, or 0 if the char proc declares no glyph bounding box.
-
getAscentOrNull
- Returns:
- ascent of the glyph presented by given char proc, or null if the char proc declares no glyph bounding box. A char proc that begins with the d0 operator specifies the glyph width only (ISO 32000-1, 9.6.5.3), so its ascent is undefined rather than 0.
-
getDescentOrNull
- Returns:
- descent of the glyph presented by given char proc, or null if the
char proc declares no glyph bounding box. See
getAscentOrNull().
-