GlyphMetrics
class represents infomation for a single glyph. A glyph is the visual representation of one or more characters. Many different glyphs can be used to represent a single character or combination of characters. GlyphMetrics
instances are produced by {@link ae.java.awt.Font Font} and are applicableto a specific glyph in a particular Font
. Glyphs are either STANDARD, LIGATURE, COMBINING, or COMPONENT.
Other metrics available through GlyphMetrics
are the components of the advance, the visual bounds, and the left and right side bearings.
Glyphs for a rotated font, or obtained from a GlyphVector
which has applied a rotation to the glyph, can have advances that contain both X and Y components. Usually the advance only has one component.
The advance of a glyph is the distance from the glyph's origin to the origin of the next glyph along the baseline, which is either vertical or horizontal. Note that, in a GlyphVector
, the distance from a glyph to its following glyph might not be the glyph's advance, because of kerning or other positioning adjustments.
The bounds is the smallest rectangle that completely contains the outline of the glyph. The bounds rectangle is relative to the glyph's origin. The left-side bearing is the distance from the glyph origin to the left of its bounds rectangle. If the left-side bearing is negative, part of the glyph is drawn to the left of its origin. The right-side bearing is the distance from the right side of the bounds rectangle to the next glyph origin (the origin plus the advance). If negative, part of the glyph is drawn to the right of the next glyph's origin. Note that the bounds does not necessarily enclose all the pixels affected when rendering the glyph, because of rasterization and pixel adjustment effects.
Although instances of GlyphMetrics
can be directly constructed, they are almost always obtained from a GlyphVector
. Once constructed, GlyphMetrics
objects are immutable.
Example:
Querying a Font
for glyph information
@see ae.java.awt.Font @see GlyphVectorFont font = ...; int glyphIndex = ...; GlyphMetrics metrics = GlyphVector.getGlyphMetrics(glyphIndex); int isStandard = metrics.isStandard(); float glyphAdvance = metrics.getAdvance();
GlyphMetrics
class represents infomation for a single glyph. A glyph is the visual representation of one or more characters. Many different glyphs can be used to represent a single character or combination of characters. GlyphMetrics
instances are produced by {@link java.awt.Font Font} and are applicable to a specific glyph in a particular Font
. Glyphs are either STANDARD, LIGATURE, COMBINING, or COMPONENT.
Other metrics available through GlyphMetrics
are the components of the advance, the visual bounds, and the left and right side bearings.
Glyphs for a rotated font, or obtained from a GlyphVector
which has applied a rotation to the glyph, can have advances that contain both X and Y components. Usually the advance only has one component.
The advance of a glyph is the distance from the glyph's origin to the origin of the next glyph along the baseline, which is either vertical or horizontal. Note that, in a GlyphVector
, the distance from a glyph to its following glyph might not be the glyph's advance, because of kerning or other positioning adjustments.
The bounds is the smallest rectangle that completely contains the outline of the glyph. The bounds rectangle is relative to the glyph's origin. The left-side bearing is the distance from the glyph origin to the left of its bounds rectangle. If the left-side bearing is negative, part of the glyph is drawn to the left of its origin. The right-side bearing is the distance from the right side of the bounds rectangle to the next glyph origin (the origin plus the advance). If negative, part of the glyph is drawn to the right of the next glyph's origin. Note that the bounds does not necessarily enclose all the pixels affected when rendering the glyph, because of rasterization and pixel adjustment effects.
Although instances of GlyphMetrics
can be directly constructed, they are almost always obtained from a GlyphVector
. Once constructed, GlyphMetrics
objects are immutable.
Example:
Querying a Font
for glyph information
@see java.awt.Font @see GlyphVectorFont font = ...; int glyphIndex = ...; GlyphMetrics metrics = GlyphVector.getGlyphMetrics(glyphIndex); int isStandard = metrics.isStandard(); float glyphAdvance = metrics.getAdvance();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|