|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.font.GlyphVector | +--com.klg.jclass.page.GlyphVectorBase
Create a GlyphVector which will report metrics using underlying font system metrics.
Field Summary | |
protected FontRenderContext |
fontRenderContext
|
protected FontMetrics |
metrics
|
protected String |
string
|
Fields inherited from class java.awt.font.GlyphVector |
FLAG_COMPLEX_GLYPHS, FLAG_HAS_POSITION_ADJUSTMENTS, FLAG_HAS_TRANSFORMS, FLAG_MASK, FLAG_RUN_RTL |
Constructor Summary | |
GlyphVectorBase(FontMetrics metrics,
FontRenderContext fontRenderContext,
String string)
Create a GlyphVector which will report metrics using underlying afm/tfm/pcl font metrics. |
Method Summary | |
boolean |
equals(GlyphVector set)
Tests if the specified GlyphVector exactly
equals this GlyphVector . |
Font |
getFont()
Returns the Font associated with this
GlyphVector . |
FontRenderContext |
getFontRenderContext()
Returns the FontRenderContext associated with this
GlyphVector . |
int |
getGlyphCharIndex(int glyphIndex)
Returns the character index of the specified glyph. |
int[] |
getGlyphCharIndices(int beginGlyphIndex,
int numEntries,
int[] codeReturn)
Returns the character indices of the specified glyphs. |
int[] |
getGlyphCodes(int beginGlyphIndex,
int numEntries,
int[] codeReturn)
Returns an array of glyphcodes for the specified glyphs. |
GlyphJustificationInfo |
getGlyphJustificationInfo(int glyphIndex)
Returns the justification information for the glyph at the specified index into this GlyphVector . |
Shape |
getGlyphLogicalBounds(int glyphIndex)
Returns the logical bounds of the specified glyph within this GlyphVector . |
GlyphMetrics |
getGlyphMetrics(int glyphIndex)
Returns the metrics of the glyph at the specified index into this GlyphVector . |
Shape |
getGlyphOutline(int glyphIndex)
Returns a Shape whose interior corresponds to the
visual representation of the specified glyph
within this GlyphVector . |
Shape |
getGlyphOutline(int glyphIndex,
float x,
float y)
Returns a Shape whose interior corresponds to the
visual representation of the specified glyph
within this GlyphVector , offset to x, y. |
Rectangle |
getGlyphPixelBounds(int index,
FontRenderContext renderFRC,
float x,
float y)
Returns the pixel bounds of the glyph at index when this GlyphVector is rendered in a Graphics with the
given FontRenderContext at the given location. |
Point2D |
getGlyphPosition(int glyphIndex)
Returns the position of the specified glyph within this GlyphVector . |
float[] |
getGlyphPositions(int beginGlyphIndex,
int numEntries,
float[] positionReturn)
Returns and array of glyph positions for the specified glyphs. |
AffineTransform |
getGlyphTransform(int glyphIndex)
Gets the transform of the specified glyph within this GlyphVector . |
Shape |
getGlyphVisualBounds(int glyphIndex)
Returns the visual bounds of the specified glyph within the GlyphVector . |
int |
getLayoutFlags()
Returns flags describing the global state of the GlyphVector. |
int |
getNumGlyphs()
Returns the number of glyphs in this GlyphVector . |
Shape |
getOutline()
Returns a Shape whose interior corresponds to the
visual representation of this GlyphVector . |
Shape |
getOutline(float x,
float y)
Returns a Shape whose interior corresponds to the
visual representation of this GlyphVector , offset
to x, y. |
Rectangle |
getPixelBounds(FontRenderContext renderFRC,
float x,
float y)
Returns the pixel bounds of this GlyphVector when
rendered in a graphics with the given
FontRenderContext at the given location. |
Rectangle2D |
getVisualBounds()
Returns the visual bounds of this GlyphVector
The visual bounds is the tightest rectangle enclosing all
non-background pixels in the rendered representation of this
GlyphVector . |
void |
performDefaultLayout()
Assigns default positions to each glyph in this GlyphVector . |
void |
setGlyphPosition(int glyphIndex,
Point2D newPos)
Sets the position of the specified glyph within this GlyphVector . |
void |
setGlyphTransform(int glyphIndex,
AffineTransform newTX)
Sets the transform of the specified glyph within this GlyphVector . |
Methods inherited from class java.awt.font.GlyphVector |
getGlyphCode, getLogicalBounds |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected FontRenderContext fontRenderContext
protected String string
protected FontMetrics metrics
Constructor Detail |
public GlyphVectorBase(FontMetrics metrics, FontRenderContext fontRenderContext, String string)
Method Detail |
public Font getFont()
Font
associated with this
GlyphVector
.
getFont
in class GlyphVector
Font
used to create this
GlyphVector
.Font
public FontRenderContext getFontRenderContext()
FontRenderContext
associated with this
GlyphVector
.
getFontRenderContext
in class GlyphVector
FontRenderContext
used to create this
GlyphVector
.FontRenderContext
,
Font
public void performDefaultLayout()
GlyphVector
. No shaping, reordering, or contextual
substitution is performed.
performDefaultLayout
in class GlyphVector
public int getNumGlyphs()
GlyphVector
.
This information is used to create arrays that are to be
filled with results of other information retrieval
operations.
getNumGlyphs
in class GlyphVector
GlyphVector
.public int[] getGlyphCodes(int beginGlyphIndex, int numEntries, int[] codeReturn)
Font
and can be used to ask the
Font
about the existence of ligatures and other
context-sensitive information. This method is used
for convenience and performance when processing glyphcodes.
If no array is passed in, an array is created.
getGlyphCodes
in class GlyphVector
beginGlyphIndex
- the index into this
GlyphVector
at which to start retrieving glyphcodes
for the corresponding glyphsnumEntries
- the offset from beginGlyphIndex
at
which to stop retrieving glyphcodescodeReturn
- the array that receives the glyphcodes and is
then returned
public Rectangle2D getVisualBounds()
GlyphVector
The visual bounds is the tightest rectangle enclosing all
non-background pixels in the rendered representation of this
GlyphVector
.
getVisualBounds
in class GlyphVector
Rectangle2D
that is the tightest bounds
of this GlyphVector
.public Shape getOutline()
Shape
whose interior corresponds to the
visual representation of this GlyphVector
.
getOutline
in class GlyphVector
Shape
that is the outline of this
GlyphVector
.public Shape getOutline(float x, float y)
Shape
whose interior corresponds to the
visual representation of this GlyphVector
, offset
to x, y.
getOutline
in class GlyphVector
Shape
that is the outline of this
GlyphVector
, offset to the specified
coordinates.public Shape getGlyphOutline(int glyphIndex)
Shape
whose interior corresponds to the
visual representation of the specified glyph
within this GlyphVector
.
getGlyphOutline
in class GlyphVector
glyphIndex
- the index into this GlyphVector
Shape
that is the outline of the glyph
at the specified glyphIndex
of this
GlyphVector
.public Point2D getGlyphPosition(int glyphIndex)
GlyphVector
.
This position corresponds to the leading edge of the baseline for
the glyph.
getGlyphPosition
in class GlyphVector
glyphIndex
- the index into this GlyphVector
Point2D
object that is the position of the glyph
at the specified glyphIndex
.public void setGlyphPosition(int glyphIndex, Point2D newPos)
GlyphVector
.
This position corresponds to the leading edge of the baseline for
the glyph.
setGlyphPosition
in class GlyphVector
glyphIndex
- the index into this GlyphVector
newPos
- the Point2D
at which to position the
glyph at the specified glyphIndex
public AffineTransform getGlyphTransform(int glyphIndex)
GlyphVector
.
getGlyphTransform
in class GlyphVector
glyphIndex
- the index into this GlyphVector
AffineTransform
that is the transform of
the glyph at the specified glyphIndex
.public void setGlyphTransform(int glyphIndex, AffineTransform newTX)
GlyphVector
.
This method can be used to rotate, mirror, translate and scale the
glyph. Adding a transform can result in signifant performance changes.
setGlyphTransform
in class GlyphVector
glyphIndex
- the index into this GlyphVector
public float[] getGlyphPositions(int beginGlyphIndex, int numEntries, float[] positionReturn)
getGlyphPositions
in class GlyphVector
beginGlyphIndex
- the index at which to begin retrieving
glyph positionsnumEntries
- the offset from beginGlyphIndex
at
which to stop retrieving glyph positionspositionReturn
- the array that receives the glyph positions
and is then returned.
beginGlyphIndex
and numEntries
.public Shape getGlyphLogicalBounds(int glyphIndex)
GlyphVector
.
These logical bounds have a total of four edges, with two edges
parallel to the baseline under the glyph's transform and the other two
edges are shared with adjacent glyphs if they are present. This
method is useful for hit-testing of the specified glyph,
positioning of a caret at the leading or trailing edge of a glyph,
and for drawing a highlight region around the specified glyph.
getGlyphLogicalBounds
in class GlyphVector
glyphIndex
- the index into this GlyphVector
that corresponds to the glyph from which to retrieve its logical
bounds
Shape
that is the logical bounds of the
glyph at the specified glyphIndex
.getGlyphVisualBounds(int)
public Shape getGlyphVisualBounds(int glyphIndex)
GlyphVector
.
These visual bounds have a total of four edges, representing the
tightest polygon enclosing non-background pixels in the rendered
representation of the glyph whose edges are parallel to the edges
of the logical bounds. Useful for hit-testing of the specified glyph.
getGlyphVisualBounds
in class GlyphVector
glyphIndex
- the index into this GlyphVector
that corresponds to the glyph from which to retrieve its visual
bounds
Shape
that is the visual bounds of the
glyph at the specified glyphIndex
.getGlyphLogicalBounds(int)
public GlyphMetrics getGlyphMetrics(int glyphIndex)
GlyphVector
.
getGlyphMetrics
in class GlyphVector
glyphIndex
- the index into this GlyphVector
that corresponds to the glyph from which to retrieve its metrics
GlyphMetrics
object that represents the
metrics of the glyph at the specified glyphIndex
into this GlyphVector
.public GlyphJustificationInfo getGlyphJustificationInfo(int glyphIndex)
GlyphVector
.
getGlyphJustificationInfo
in class GlyphVector
glyphIndex
- the index into this GlyphVector
that corresponds to the glyph from which to retrieve its
justification properties
GlyphJustificationInfo
object that
represents the justification properties of the glyph at the
specified glyphIndex
into this
GlyphVector
.public boolean equals(GlyphVector set)
GlyphVector
exactly
equals this GlyphVector
.
equals
in class GlyphVector
set
- the specified GlyphVector
to test
true
if the specified
GlyphVector
equals this GlyphVector
;
false
otherwise.public Rectangle getGlyphPixelBounds(int index, FontRenderContext renderFRC, float x, float y)
GlyphVector
is rendered in a Graphics
with the
given FontRenderContext
at the given location. The
renderFRC need not be the same as the
FontRenderContext
of this
GlyphVector
, and can be null. If it is null, the
FontRenderContext
of this GlyphVector
is used.
getGlyphPixelBounds
in class GlyphVector
index
- the index of the glyph.renderFRC
- the FontRenderContext
of the Graphics
.
Rectangle
bounding the pixels that would be affected.public int getLayoutFlags()
getLayoutFlags
in class GlyphVector
GlyphVector.FLAG_HAS_POSITION_ADJUSTMENTS
,
GlyphVector.FLAG_HAS_TRANSFORMS
,
GlyphVector.FLAG_RUN_RTL
,
GlyphVector.FLAG_COMPLEX_GLYPHS
,
GlyphVector.FLAG_MASK
public Shape getGlyphOutline(int glyphIndex, float x, float y)
Shape
whose interior corresponds to the
visual representation of the specified glyph
within this GlyphVector
, offset to x, y.
The outline returned by this method is positioned around the
origin of each individual glyph.
getGlyphOutline
in class GlyphVector
glyphIndex
- the index into this GlyphVector
Shape
that is the outline of the glyph
at the specified glyphIndex
of this
GlyphVector
when renderd at the specified
coordinates.
IndexOutOfBoundsException
- if glyphIndex
is less than 0 or greater than or equal to the number
of glyphs in this GlyphVector
public Rectangle getPixelBounds(FontRenderContext renderFRC, float x, float y)
GlyphVector
when
rendered in a graphics with the given
FontRenderContext
at the given location. The
renderFRC need not be the same as the
FontRenderContext
of this
GlyphVector
, and can be null. If it is null, the
FontRenderContext
of this GlyphVector
is used.
getPixelBounds
in class GlyphVector
renderFRC
- the FontRenderContext
of the Graphics
.x
- the x-coordinate at which to render this GlyphVector
.y
- the y-coordinate at which to render this GlyphVector
.
Rectangle
bounding the pixels that would be affected.public int getGlyphCharIndex(int glyphIndex)
getGlyphCharIndex
in class GlyphVector
glyphIndex
- the index of the glyph
public int[] getGlyphCharIndices(int beginGlyphIndex, int numEntries, int[] codeReturn)
getGlyphCharIndices
in class GlyphVector
beginGlyphIndex
- the index of the first glyphnumEntries
- the number of glyph indicescodeReturn
- the array into which to return the character indices
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |