Package org.apache.fontbox.ttf
Class GlyfCompositeDescript
- java.lang.Object
-
- org.apache.fontbox.ttf.GlyfDescript
-
- org.apache.fontbox.ttf.GlyfCompositeDescript
-
- All Implemented Interfaces:
GlyphDescription
public class GlyfCompositeDescript extends GlyfDescript
Glyph description for composite glyphs. Composite glyphs are made up of one or more simple glyphs, usually with some sort of transformation applied to each. This class is based on code from Apache Batik a subproject of Apache XMLGraphics. see http://xmlgraphics.apache.org/batik/ for further details.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanbeingResolvedprivate java.util.List<GlyfCompositeComp>componentsprivate intcontourCountprivate java.util.Map<java.lang.Integer,GlyphDescription>descriptionsprivate GlyphTableglyphTableprivate static org.apache.commons.logging.LogLOGLog instance.private intpointCountprivate booleanresolved-
Fields inherited from class org.apache.fontbox.ttf.GlyfDescript
ON_CURVE, REPEAT, X_DUAL, X_SHORT_VECTOR, Y_DUAL, Y_SHORT_VECTOR
-
-
Constructor Summary
Constructors Constructor Description GlyfCompositeDescript(TTFDataStream bais, GlyphTable glyphTable, int level)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetComponentCount()Get number of components.java.util.List<GlyfCompositeComp>getComponents()Gets a view to the composite components.private GlyfCompositeCompgetCompositeComp(int i)private GlyfCompositeCompgetCompositeCompEndPt(int i)intgetContourCount()Returns the number of contours.intgetEndPtOfContours(int i)Returns the index of the ending point of the given contour.bytegetFlags(int i)Returns the flags of the given point.intgetPointCount()Returns the number of points.shortgetXCoordinate(int i)Returns the x coordinate of the given point.shortgetYCoordinate(int i)Returns the y coordinate of the given point.private voidinitDescriptions(int level)booleanisComposite()Returns whether this point is a composite or not.voidresolve()Resolve all parts of an composite glyph.-
Methods inherited from class org.apache.fontbox.ttf.GlyfDescript
getInstructions, readInstructions
-
-
-
-
Field Detail
-
LOG
private static final org.apache.commons.logging.Log LOG
Log instance.
-
components
private final java.util.List<GlyfCompositeComp> components
-
descriptions
private final java.util.Map<java.lang.Integer,GlyphDescription> descriptions
-
glyphTable
private GlyphTable glyphTable
-
beingResolved
private boolean beingResolved
-
resolved
private boolean resolved
-
pointCount
private int pointCount
-
contourCount
private int contourCount
-
-
Constructor Detail
-
GlyfCompositeDescript
GlyfCompositeDescript(TTFDataStream bais, GlyphTable glyphTable, int level) throws java.io.IOException
Constructor.- Parameters:
bais- the stream to be readglyphTable- the Glyphtable containing all glyphslevel- current level- Throws:
java.io.IOException- is thrown if something went wrong
-
-
Method Detail
-
resolve
public void resolve()
Resolve all parts of an composite glyph.- Specified by:
resolvein interfaceGlyphDescription- Overrides:
resolvein classGlyfDescript
-
getEndPtOfContours
public int getEndPtOfContours(int i)
Returns the index of the ending point of the given contour.- Parameters:
i- the number of the contour- Returns:
- the index of the ending point of the given contour
-
getFlags
public byte getFlags(int i)
Returns the flags of the given point. To decode these bit flags, use the static elements ofGlyfDescript. See also "Outline flags" in The 'glyf' table in the TrueType Reference Manual.- Parameters:
i- the given point- Returns:
- the flags value for the given point
-
getXCoordinate
public short getXCoordinate(int i)
Returns the x coordinate of the given point.- Parameters:
i- the given point- Returns:
- the x coordinate value for the given point
-
getYCoordinate
public short getYCoordinate(int i)
Returns the y coordinate of the given point.- Parameters:
i- the given point- Returns:
- the y coordinate value for the given point
-
isComposite
public boolean isComposite()
Returns whether this point is a composite or not.- Returns:
- true if this point is a composite
-
getPointCount
public int getPointCount()
Returns the number of points.- Returns:
- the number of points
-
getContourCount
public int getContourCount()
Returns the number of contours.- Specified by:
getContourCountin interfaceGlyphDescription- Overrides:
getContourCountin classGlyfDescript- Returns:
- the number of contours
-
getComponentCount
public int getComponentCount()
Get number of components.- Returns:
- the number of components
-
getComponents
public java.util.List<GlyfCompositeComp> getComponents()
Gets a view to the composite components.- Returns:
- unmodifiable list of this composite glyph's components
-
getCompositeComp
private GlyfCompositeComp getCompositeComp(int i)
-
getCompositeCompEndPt
private GlyfCompositeComp getCompositeCompEndPt(int i)
-
initDescriptions
private void initDescriptions(int level)
-
-