Package com.adobe.fontengine.font.cff
Class Type2OutlineParser
java.lang.Object
com.adobe.fontengine.font.cff.Type2OutlineParser
Extract the unhinted bezier outlines from a Type2 charstring.
A
Type2OutlineParser offers a single method, parse which is
given a charstring and an OutlineConsumer. As the
lines and curves of the charstring are parsed,
the OutlineConsumer is called.
The same Type2OutlineParser object can be used repeatedly
to extract outlines. The successive invocations do not need to be for
the same font (not even in the same fontset), nor do they need to use
the same consumer.
The consumer must not call parse on the Type2OutlineParser
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 OutlineConsumer on the thread on which it is called.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidparse(CharStrings charStrings, int index, CharStrings localSubrs, CharStrings globalSubrs, OutlineConsumer outlineConsumer, Matrix m, NameKeyedFont font) Parse the outlines of a Type2 charstring.
-
Constructor Details
-
Type2OutlineParser
public Type2OutlineParser(boolean hintedOutlines) Create a new Type2OutlineParser.- Parameters:
hintedOutlines- True if the outlineConsumers passed to parse will be implementations of HintedOutlineConsumer. False if they will be implementations of OutlineConsumer.
-
-
Method Details
-
parse
public void parse(CharStrings charStrings, int index, CharStrings localSubrs, CharStrings globalSubrs, OutlineConsumer outlineConsumer, Matrix m, NameKeyedFont font) throws InvalidFontException, UnsupportedFontException Parse the outlines of a Type2 charstring.- Parameters:
charStrings- theCharStringscontaining the charstringindex- the index of the charctstring incharStringslocalSubrs- the local subroutinesglobalSubrs- the global subroutinesoutlineConsumer- the OutlineConsumer to alert of the parsing eventsm- the Matrix to be applied to the outlines in order to get to a 1 ppem outlinefont- the font to use to resolve seac operators- Throws:
InvalidFontException- the charstring is malformedUnsupportedFontException
-