Package com.adobe.fontengine.font.cff
Class Type2OutlineParser
- java.lang.Object
-
- com.adobe.fontengine.font.cff.Type2OutlineParser
-
public final class Type2OutlineParser extends java.lang.Object
Extract the unhinted bezier outlines from a Type2 charstring. AType2OutlineParser
offers a single method,parse
which is given a charstring and anOutlineConsumer
. As the lines and curves of the charstring are parsed, theOutlineConsumer
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 theOutlineConsumer
on the thread on which it is called.
-
-
Constructor Summary
Constructors Constructor Description Type2OutlineParser(boolean hintedOutlines)
Create a new Type2OutlineParser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
parse(CharStrings charStrings, int index, CharStrings localSubrs, CharStrings globalSubrs, OutlineConsumer outlineConsumer, Matrix m, NameKeyedFont font)
Parse the outlines of a Type2 charstring.
-
-
-
Constructor Detail
-
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 Detail
-
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
- theCharStrings
containing the charstringindex
- the index of the charctstring incharStrings
localSubrs
- 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
-
-