gnu.java.awt.font
Class GNUGlyphVector
- Cloneable
The GNU implementation of the abstract GlyphVector class, which
uses the services provided by a FontDelegate for its functionality.
boolean | equals(GlyphVector other) - Determines whether another GlyphVector is for the same font and
rendering context, uses the same glyphs and positions them to the
same location.
|
Font | getFont() - Returns the font of the glyphs in this GlyphVector.
|
FontRenderContext | getFontRenderContext() - Returns the FontRenderContext that is used to calculate the
extent and position of the glyphs.
|
int | getGlyphCode(int glyphIndex) - Determines the glyph number by index in this vector.
|
int[] | getGlyphCodes(int firstGlyphIndex, int numEntries, int[] outCodes) - Returns a slice of this GlyphVector.
|
GlyphJustificationInfo | getGlyphJustificationInfo(int glyphIndex) - Determines the justification information for the glyph at the
specified index.
|
Shape | getGlyphLogicalBounds(int glyphIndex)
|
GlyphMetrics | getGlyphMetrics(int glyphIndex) - Determines the metrics of the glyph at the specified index.
|
Shape | getGlyphOutline(int glyphIndex) - Determines the shape of the specified glyph.
|
Shape | getGlyphOutline(int glyphIndex, int type)
|
Point2D | getGlyphPosition(int glyphIndex) - Determines the position of the specified glyph, or the
total advance width and height of the vector.
|
float[] | getGlyphPositions(int firstGlyphIndex, int numGlyphs, float[] outPositions) - Returns the positions of a range of glyphs in this vector.
|
AffineTransform | getGlyphTransform(int glyphIndex) - Returns the affine transformation that is applied to the
glyph at the specified index.
|
Shape | getGlyphVisualBounds(int glyphIndex)
|
int | getLayoutFlags() - Returns flags that can be used for optimizing the rendering
of this GlyphVector.
|
Rectangle2D | getLogicalBounds()
|
int | getNumGlyphs() - Determines the number of glyphs in this GlyphVector.
|
Shape | getOutline() - Returns the shape of this GlyphVector.
|
Shape | getOutline(float x, float y) - Returns the shape of this GlyphVector, translated to the
specified position.
|
Shape | getOutline(float x, float y, int type)
|
Rectangle2D | getVisualBounds()
|
void | performDefaultLayout() - Moves each glyph in the vector to its default position.
|
void | setGlyphPosition(int glyphIndex, Point2D position) - Moves the specified glyph to a new position, or changes the
advance width and height of the entire glyph vector.
|
void | setGlyphTransform(int glyphIndex, AffineTransform transform) - Applies an affine transformation to the glyph at the specified
index.
|
equals , getFont , getFontRenderContext , getGlyphCharIndex , getGlyphCharIndices , getGlyphCode , getGlyphCodes , getGlyphJustificationInfo , getGlyphLogicalBounds , getGlyphMetrics , getGlyphOutline , getGlyphOutline , getGlyphPixelBounds , getGlyphPosition , getGlyphPositions , getGlyphTransform , getGlyphVisualBounds , getLayoutFlags , getLogicalBounds , getNumGlyphs , getOutline , getOutline , getPixelBounds , getVisualBounds , performDefaultLayout , setGlyphPosition , setGlyphTransform |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
GNUGlyphVector
public GNUGlyphVector(FontDelegate fontDelegate,
Font font,
FontRenderContext renderContext,
int[] glyphs)
Constructs a new GNUGlyphVector.
fontDelegate
- the FontDelegate that creates this vector.font
- the Font that this GlyphVector will return for getFont()
. That object is also used to determine the point
size, which affects the affine transformation used by the font
scaler.renderContext
- an object with parameters for font
rendering, such as whether anti-aliasing is enabled.glyphs
- the glyphs in this vector.
equals
public boolean equals(GlyphVector other)
Determines whether another GlyphVector is for the same font and
rendering context, uses the same glyphs and positions them to the
same location.
- equals in interface GlyphVector
other
- the GlyphVector to compare with.
true
if the two vectors are equal,
false
otherwise.
getGlyphCode
public int getGlyphCode(int glyphIndex)
Determines the glyph number by index in this vector.
Glyph numbers are specific to each font, so two fonts
will likely assign different numbers to the same glyph.
- getGlyphCode in interface GlyphVector
glyphIndex
- the index of the glyph whose glyph number is to
be retrieved.
getGlyphCodes
public int[] getGlyphCodes(int firstGlyphIndex,
int numEntries,
int[] outCodes)
Returns a slice of this GlyphVector.
- getGlyphCodes in interface GlyphVector
firstGlyphIndex
- the index of the first glyph in the
returned slice.numEntries
- the size of the returned slice.outCodes
- a pre-allocated array for storing the slice,
or null
to cause allocation of a new array.
- a slice of this GlyphVector. If
outCodes
is null
, the slice will be stored into a freshly
allocated array; otherwise, the result will be stored into
outCodes
.
getGlyphPosition
public Point2D getGlyphPosition(int glyphIndex)
Determines the position of the specified glyph, or the
total advance width and height of the vector.
- getGlyphPosition in interface GlyphVector
glyphIndex
- the index of the glyph in question.
If this value equals getNumGlyphs()
, the
position after the last glyph will be returned,
which is the total advance width and height of the vector.
getGlyphPositions
public float[] getGlyphPositions(int firstGlyphIndex,
int numGlyphs,
float[] outPositions)
Returns the positions of a range of glyphs in this vector.
- getGlyphPositions in interface GlyphVector
firstGlyphIndex
- the index of the first glyph whose
position is retrieved.numGlyphs
- the number of glyphs whose positions
are retrieved.outPositions
- an array for storing the results
(the length must be at least twice numGlyphs
),
or null
for freshly allocating an array.
- an array with the glyph positions. The horizontal
position of the
i
-th glyph is at index 2 *
i
, the vertical position at index 2 * i + 1
.
getGlyphTransform
public AffineTransform getGlyphTransform(int glyphIndex)
Returns the affine transformation that is applied to the
glyph at the specified index.
- getGlyphTransform in interface GlyphVector
glyphIndex
- the index of the glyph whose transformation
is to be retrieved.
- an affine transformation, or
null
for the identity transformation.
getLayoutFlags
public int getLayoutFlags()
Returns flags that can be used for optimizing the rendering
of this GlyphVector.
- getLayoutFlags in interface GlyphVector
- a bit mask with the applicable flags set.
getOutline
public Shape getOutline(float x,
float y)
Returns the shape of this GlyphVector, translated to the
specified position.
- getOutline in interface GlyphVector
x
- the horizontal position for rendering this vector.y
- the vertical position for rendering this vector.
setGlyphPosition
public void setGlyphPosition(int glyphIndex,
Point2D position)
Moves the specified glyph to a new position, or changes the
advance width and height of the entire glyph vector.
Note that the position of an individual glyph may also
affected by its affine transformation.
- setGlyphPosition in interface GlyphVector
glyphIndex
- the index of the moved glyph. If
glyphIndex
equals the total number of glyphs in this
vector, the advance width and height of the vector is changed.position
- the new position of the glyph.
setGlyphTransform
public void setGlyphTransform(int glyphIndex,
AffineTransform transform)
Applies an affine transformation to the glyph at the specified
index.
- setGlyphTransform in interface GlyphVector
glyphIndex
- the index of the glyph to which the
transformation is applied.transform
- the affine transformation for the glyph, or
null
for an identity transformation.
GNUGlyphVector.java -- The GNU implementation of GlyphVector.
Copyright (C) 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.