Package org.apache.fop.fonts.type1
Class PostscriptParser.PSElement
java.lang.Object
org.apache.fop.fonts.type1.PostscriptParser.PSElement
- Direct Known Subclasses:
PostscriptParser.PSDictionary
,PostscriptParser.PSFixedArray
,PostscriptParser.PSSubroutine
,PostscriptParser.PSVariable
,PostscriptParser.PSVariableArray
- Enclosing class:
- PostscriptParser
A base Postscript element class
-
Field Summary
Modifier and TypeFieldDescriptionprotected LinkedHashMap<String,
int[]> protected int
protected boolean
protected String
protected boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionLinkedHashMap<String,
int[]> int[]
getBinaryEntryByIndex
(int index) Gets the binary entry location of a given index from the arrayint
The end location of the element within the source binary databoolean
Returns whether unexpected postscript has been found in the elementGets the Postscript element operatorint
The start location of the element within the source binary databoolean
hasMore()
Determines if more data is still to be parsed for the Postscript element.protected boolean
void
parse
(byte cur, int pos) Takes over the task of tokenizing the byte dataabstract void
parseByte
(byte cur, int pos) Passes responsibility for processing the byte stream to the PostScript objectabstract void
parseToken
(String token, int curPos) Delegates the parse routine to a sub classprotected void
setFoundUnexpected
(boolean foundUnexpected) Sets a value to be true if an expected entry postscript is found in the element.
-
Field Details
-
operator
-
hasMore
protected boolean hasMore -
binaryEntries
-
tokens
-
readBinary
protected boolean readBinary -
endPoint
protected int endPoint
-
-
Constructor Details
-
PSElement
-
-
Method Details
-
getOperator
Gets the Postscript element operator- Returns:
- The operator returned as a string
-
getStartPoint
public int getStartPoint()The start location of the element within the source binary data- Returns:
- The start location returned as an integer
-
getEndPoint
public int getEndPoint()The end location of the element within the source binary data- Returns:
- The end location returned as an integer
-
parse
Takes over the task of tokenizing the byte data- Parameters:
cur
- The current byte being read- Throws:
UnsupportedEncodingException
-
parseByte
public abstract void parseByte(byte cur, int pos) Passes responsibility for processing the byte stream to the PostScript object- Parameters:
cur
- The byte currently being readpos
- The position of the given byte
-
parseToken
Delegates the parse routine to a sub class- Parameters:
token
- The token which to parse
-
isInteger
-
getBinaryEntries
-
getBinaryEntryByIndex
public int[] getBinaryEntryByIndex(int index) Gets the binary entry location of a given index from the array- Parameters:
index
- The index for which to retrieve the binary data location- Returns:
-
hasMore
public boolean hasMore()Determines if more data is still to be parsed for the Postscript element.- Returns:
- Returns true if more data exists
-
setFoundUnexpected
protected void setFoundUnexpected(boolean foundUnexpected) Sets a value to be true if an expected entry postscript is found in the element. An example is where the encoding table may have a series of postscript operators altering the state of the array. In this case the only option will be to fully embed the font to avoid incorrect encoding in the resulting subset.- Parameters:
foundUnexpected
- true if unexpected postscript is found.
-
getFoundUnexpected
public boolean getFoundUnexpected()Returns whether unexpected postscript has been found in the element- Returns:
- true if unexpected postscript is found
-