public class TextPathLayout
extends java.lang.Object
There are a number of improvements that could be made to this class. I'll try to list some of them:
Modifier and Type | Field and Description |
---|---|
static int |
ADJUST_GLYPHS
Use the entire glyph to adjust for textLength.
|
static int |
ADJUST_SPACING
Use the spacing between the glyphs to adjust for textLength.
|
static int |
ALIGN_END
Align the text at the end of the path.
|
static int |
ALIGN_MIDDLE
Align the text at the middle of the path.
|
static int |
ALIGN_START
Align the text at the start of the path.
|
Constructor and Description |
---|
TextPathLayout() |
Modifier and Type | Method and Description |
---|---|
static java.awt.Shape |
layoutGlyphVector(java.awt.font.GlyphVector glyphs,
java.awt.Shape path)
Wraps the GlyphVector around the given path.
|
static java.awt.Shape |
layoutGlyphVector(java.awt.font.GlyphVector glyphs,
java.awt.Shape path,
int align)
Wraps the GlyphVector around the given path.
|
static java.awt.Shape |
layoutGlyphVector(java.awt.font.GlyphVector glyphs,
java.awt.Shape path,
int align,
float startOffset,
float textLength,
int lengthAdjustMode)
Wraps the GlyphVector around the given path.
|
public static final int ALIGN_START
public static final int ALIGN_MIDDLE
public static final int ALIGN_END
public static final int ADJUST_SPACING
public static final int ADJUST_GLYPHS
public static java.awt.Shape layoutGlyphVector(java.awt.font.GlyphVector glyphs, java.awt.Shape path, int align, float startOffset, float textLength, int lengthAdjustMode)
glyphs
- The GlyphVector to layout.path
- The path (or shape) to wrap aroundalign
- The text alignment to use. Should be one
of ALIGN_START, ALIGN_MIDDLE or ALIGN_END.startOffset
- The offset from the start of the path for the initial
text position.textLength
- The length that the text should fill.lengthAdjustMode
- The method used to expand or contract
the text to meet the textLength.public static java.awt.Shape layoutGlyphVector(java.awt.font.GlyphVector glyphs, java.awt.Shape path, int align)
glyphs
- The GlyphVector to layout.path
- The path (or shape) to wrap aroundalign
- The text alignment to use. Should be one
of ALIGN_START, ALIGN_MIDDLE or ALIGN_END.public static java.awt.Shape layoutGlyphVector(java.awt.font.GlyphVector glyphs, java.awt.Shape path)
glyphs
- The GlyphVector to layout.path
- The path (or shape) to wrap aroundCopyright © 2022 Apache Software Foundation. All Rights Reserved.