| java.lang.Object org.apache.batik.ext.awt.font.TextPathLayout
TextPathLayout | public class TextPathLayout (Code) | | PathLayout can layout text along a Shape, usually a Path object.
There are a number of improvements that could be made to this class.
I'll try to list some of them:
- The layout should really only modify the GlyphVector, rather
than converting to a Shape.
- Maybe the functions should take a AttributedCharacterIterator
or something? Should this class do the entire layout?
- The layout code works, but it's definitely not perfect.
author: Dean Jackson version: $Id: TextPathLayout.java 522271 2007-03-25 14:42:45Z dvholten $ |
Field Summary | |
final public static int | ADJUST_GLYPHS Use the entire glyph to adjust for textLength. | final public static int | ADJUST_SPACING Use the spacing between the glyphs to adjust for textLength. | final public static int | ALIGN_END Align the text at the end of the path. | final public static int | ALIGN_MIDDLE Align the text at the middle of the path. | final public static int | ALIGN_START Align the text at the start of the path. |
Method Summary | |
public static Shape | layoutGlyphVector(GlyphVector glyphs, Shape path, int align, float startOffset, float textLength, int lengthAdjustMode) Wraps the GlyphVector around the given path. | public static Shape | layoutGlyphVector(GlyphVector glyphs, Shape path, int align) Wraps the GlyphVector around the given path.
Parameters: glyphs - The GlyphVector to layout. Parameters: path - The path (or shape) to wrap around Parameters: align - The text alignment to use. | public static Shape | layoutGlyphVector(GlyphVector glyphs, Shape path) Wraps the GlyphVector around the given path. |
ADJUST_GLYPHS | final public static int ADJUST_GLYPHS(Code) | | Use the entire glyph to adjust for textLength.
|
ADJUST_SPACING | final public static int ADJUST_SPACING(Code) | | Use the spacing between the glyphs to adjust for textLength.
|
ALIGN_END | final public static int ALIGN_END(Code) | | Align the text at the end of the path.
|
ALIGN_MIDDLE | final public static int ALIGN_MIDDLE(Code) | | Align the text at the middle of the path.
|
ALIGN_START | final public static int ALIGN_START(Code) | | Align the text at the start of the path.
|
layoutGlyphVector | public static Shape layoutGlyphVector(GlyphVector glyphs, Shape path, int align, float startOffset, float textLength, int lengthAdjustMode)(Code) | | Wraps the GlyphVector around the given path. The results
are mostly quite nice but you need to be careful choosing
the size of the font that created the GlyphVector, as
well as the "curvyness" of the path (really dynamic curves
don't look so great, abrupt changes/vertices look worse).
Parameters: glyphs - The GlyphVector to layout. Parameters: path - The path (or shape) to wrap around Parameters: align - The text alignment to use. Should be oneof ALIGN_START, ALIGN_MIDDLE or ALIGN_END. Parameters: startOffset - The offset from the start of the path for the initialtext position. Parameters: textLength - The length that the text should fill. Parameters: lengthAdjustMode - The method used to expand or contractthe text to meet the textLength. A shape that is the outline of the glyph vectorwrapped along the path |
layoutGlyphVector | public static Shape layoutGlyphVector(GlyphVector glyphs, Shape path, int align)(Code) | | Wraps the GlyphVector around the given path.
Parameters: glyphs - The GlyphVector to layout. Parameters: path - The path (or shape) to wrap around Parameters: align - The text alignment to use. Should be oneof ALIGN_START, ALIGN_MIDDLE or ALIGN_END. A shape that is the outline of the glyph vectorwrapped along the path |
layoutGlyphVector | public static Shape layoutGlyphVector(GlyphVector glyphs, Shape path)(Code) | | Wraps the GlyphVector around the given path.
Parameters: glyphs - The GlyphVector to layout. Parameters: path - The path (or shape) to wrap around A shape that is the outline of the glyph vectorwrapped along the path |
|
|