public final class Type2CStringGenerator extends Object implements HintedOutlineConsumer
| Modifier and Type | Field and Description |
|---|---|
static double |
DEFAULT_DEFAULT_WIDTH |
static double |
DEFAULT_NOMINAL_WIDTH |
| Constructor and Description |
|---|
Type2CStringGenerator(int numGlyphs,
int numFDs)
Creates an instance of a Type2CStringGenerator.
|
Type2CStringGenerator(int numGlyphs,
int numFDs,
boolean willSubrize) |
| Modifier and Type | Method and Description |
|---|---|
double |
calculateDefaultWidth(int fontDictionary)
All of the charstrings have been run.
|
double |
calculateNominalWidth(int fontDictionary)
All of the charstrings have been run.
|
void |
closepath()
A closepath command was seen.
|
void |
curveto(double x1,
double y1,
double x2,
double y2)
Called for a quadratic curve.
|
void |
curveto(double x1,
double y1,
double x2,
double y2,
double x3,
double y3)
Called for a cubic curve.
|
void |
endchar()
Called to signal the end of a glyph's outline.
|
void |
flex(double depth,
double x1,
double y1,
double x2,
double y2,
double x3,
double y3,
double x4,
double y4,
double x5,
double y5,
double x6,
double y6)
A flex command was seen
|
CharStrings |
getCharstringIndex()
All of the charstrings have been run.
|
void |
globalColorOn()
A command was seen that says that global coloring applies to this glyph.
|
void |
lineto(double x,
double y)
Called for a line.
|
void |
moveto(double x,
double y)
Called to set a new currentpoint.
|
void |
newGlyph(int glyphID,
int fontDictionary,
double defaultWidth,
double nominalWidth)
Called before playing the outlines for a new glyph.
|
void |
noCounters()
A command was seen that says that the glyph has no counters.
|
void |
noHints()
A command was seen that says that no hints should be applied to the next part of the
glyph.
|
void |
setMatrix(Matrix m)
Tells the OutlineConsumer the matrix to be applied to subsequent
points in order to get to a 1 ppem size.
|
void |
stem(double edge1,
double edge2,
boolean doHintSubstitution,
boolean vertical,
boolean isCounter)
A stem command was seen.
|
void |
stem3(double edge1,
double edge2,
double edge3,
double edge4,
double edge5,
double edge6,
boolean doHintSubstitution,
boolean isVertical)
A hstem3 or vstem3 command was seen.
|
boolean |
width(double wx)
The advance width of the glyph in the x direction
|
public static final double DEFAULT_NOMINAL_WIDTH
public static final double DEFAULT_DEFAULT_WIDTH
public Type2CStringGenerator(int numGlyphs,
int numFDs)
numGlyphs - The number of charstrings that will be generated.numFDs - The number of font dictionaries that will be associated with those charstrings.
numFDs must be at least 1.public Type2CStringGenerator(int numGlyphs,
int numFDs,
boolean willSubrize)
public void newGlyph(int glyphID,
int fontDictionary,
double defaultWidth,
double nominalWidth)
glyphID - The glyphID for the new glyph. glyphID must be less than the numGlyphs
value passed to the constructor.fontDictionary - The font dictionary to which the glyph belongs. fontDictionary must
be at least 0 and must be less than the numFDs value passed to the constructor.defaultWidth - The default width associated with this glyph. DEFAULT_DEFAULT_WIDTH should
be passed if there isn't one.public void setMatrix(Matrix m)
OutlineConsumersetMatrix in interface OutlineConsumerpublic void stem(double edge1,
double edge2,
boolean doHintSubstitution,
boolean vertical,
boolean isCounter)
HintedOutlineConsumerstem in interface HintedOutlineConsumeredge1 - The bottom/left edge.edge2 - The top/right edge. If isCounter is false and the stem is
a topmost, rightmost, bottommost, or
leftmost edge, the order of the edges is reversed (ie edge1 > edge2). If
isCounter is true and the stem is the last counter in the current counter group,
the order of the edges is reversed (ie edge1 > edge2).doHintSubstitution - If isCounter is false, hint substitution must
occur at this point iff doHintSubstitution is true.
Else iff doHintSubstitution is true and isCounter is true, a new counter
group must be started at this point.vertical - true iff the command was a vertical stem/counter.isCounter - true iff the stem should be added to the current counter group.public void stem3(double edge1,
double edge2,
double edge3,
double edge4,
double edge5,
double edge6,
boolean doHintSubstitution,
boolean isVertical)
HintedOutlineConsumerstem3 in interface HintedOutlineConsumerdoHintSubstitution - If true, hint substitution must occur at this point.isVertical - true iff this command is a vstem3public boolean width(double wx)
HintedOutlineConsumerwidth in interface HintedOutlineConsumerwx - the advance widthpublic void globalColorOn()
HintedOutlineConsumerglobalColorOn in interface HintedOutlineConsumerpublic void noCounters()
HintedOutlineConsumernoCounters in interface HintedOutlineConsumerpublic void noHints()
HintedOutlineConsumernoHints in interface HintedOutlineConsumerpublic void lineto(double x,
double y)
OutlineConsumerx, y). After this call, the currentpoint
should be x,ylineto in interface OutlineConsumerpublic void curveto(double x1,
double y1,
double x2,
double y2)
OutlineConsumerx2, y2),
(x3, y3). After this call, the
currentpoint should be x3, y3.curveto in interface OutlineConsumerpublic void curveto(double x1,
double y1,
double x2,
double y2,
double x3,
double y3)
OutlineConsumerx2, y2),
(x3, y3),
(x4, y4). After this call, the
currentpoint should be x4, y4.curveto in interface OutlineConsumerpublic void moveto(double x,
double y)
OutlineConsumermoveto in interface OutlineConsumerx - the x coordinate of the new currentpointy - the y coordinate of the new currentpointpublic void closepath()
HintedOutlineConsumerclosepath in interface HintedOutlineConsumerpublic void flex(double depth,
double x1,
double y1,
double x2,
double y2,
double x3,
double y3,
double x4,
double y4,
double x5,
double y5,
double x6,
double y6)
HintedOutlineConsumerflex in interface HintedOutlineConsumerpublic void endchar()
OutlineConsumerendchar in interface OutlineConsumerpublic CharStrings getCharstringIndex() throws InvalidFontException, UnsupportedFontException
public double calculateNominalWidth(int fontDictionary)
public double calculateDefaultWidth(int fontDictionary)
Copyright © 2010 - 2020 Adobe. All Rights Reserved