Package com.adobe.fontengine.font.type1
Class Type1CStringParser
java.lang.Object
com.adobe.fontengine.font.type1.Type1CStringParser
Parses Type1 charstrings
* A
Type1CStringParser offers a single method, parse which is given
a glyphID, a type1 font, and a HintedOutlineConsumer. As the charString is parsed, the
HintedOutlineConsumer is called for each operator that affects the path. The parser maintains the
stack and storage area, interpreting the operators which affect them,
as well as interpreting subroutine calls and seac operators. The intent is that a Consumer
can concentrate on dealing with the path and hints operators, and
ignore the arithmetic, storage, conditional and subroutine
operators.
The same parser can be used repeatedly to
parse multiple charstrings; those charstrings do not need to be
in the same font. The parser maintains
no state between invocations of parse.
The consumer must not call parse on the parser that
invoked it.
Synchronization
This class is not synchronized. Multiple instances can safely coexist without threadsafety issues, but each must only be accessed from one thread (or must be guarded by the client). Theparse method invokes the
HintedOutlineConsumer on the thread on which it is called.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidparse(HintedOutlineConsumer consumer, Type1Font type1Font, int glyphID) Decode a type1 charstring
-
Constructor Details
-
Type1CStringParser
public Type1CStringParser()
-
-
Method Details
-
parse
public void parse(HintedOutlineConsumer consumer, Type1Font type1Font, int glyphID) throws InvalidGlyphException, UnsupportedFontException Decode a type1 charstring- Parameters:
consumer- the HintedOutlineConsumer to alert of parsing eventstype1Font- The Type1Font from which charstrings and subroutines should be pulledglyphID- The glyphID of the charstring to be interpretted- Throws:
InvalidGlyphException- The charstring could not be interprettedUnsupportedFontException- thrown when the font contains data indicating that this class of fonts is not supported.
-