java.lang.Object | ||
↳ | java.awt.FontMetrics | |
↳ | sun.font.FontDesignMetrics |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the advance width of the specified character in this
Font . | |||||||||||
Returns the advance width of the specified character in this
Font . | |||||||||||
Returns the total advance width for showing the specified array
of characters in this
Font . | |||||||||||
Determines the font ascent of the
Font
described by this FontMetrics object. | |||||||||||
Determines the font descent of the
Font
described by this
FontMetrics object. | |||||||||||
Gets the
FontRenderContext used by this
FontMetrics object to measure text. | |||||||||||
Gets the standard height of a line of text in this font.
| |||||||||||
Determines the standard leading of the
Font described by this FontMetrics
object. | |||||||||||
Gets the maximum advance width of any character in this
Font . | |||||||||||
Gets the advance widths of the first 256 characters in the
Font . | |||||||||||
Returns the total advance width for showing the specified
String in this Font . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Returns the advance width of the specified character in this
Font
. The advance is the
distance from the leftmost point to the rightmost point on the
character's baseline. Note that the advance of a
String
is not necessarily the sum of the advances
of its characters.
This method doesn't validate the specified character to be a
valid Unicode code point. The caller must validate the
character value using Character.isValidCodePoint
if necessary.
ch | the character (Unicode code point) to be measured |
---|
Font
described by this
FontMetrics
object.Returns the advance width of the specified character in this
Font
. The advance is the
distance from the leftmost point to the rightmost point on the
character's baseline. Note that the advance of a
String
is not necessarily the sum of the advances
of its characters.
Note: This method cannot handle supplementary
characters. To support all Unicode characters, including
supplementary characters, use the charWidth(int)
method.
ch | the character to be measured |
---|
Font
described by this
FontMetrics
object.Returns the total advance width for showing the specified array
of characters in this Font
. The advance is the
distance from the leftmost point to the rightmost point on the
string's baseline. The advance of a String
is not necessarily the sum of the advances of its characters.
This is equivalent to measuring a String
of the
characters in the specified range.
data | the array of characters to be measured |
---|---|
off | the start offset of the characters in the array |
len | the number of characters to be measured from the array |
char
array in the font described by
this FontMetrics
object.Determines the font ascent of the Font
described by this FontMetrics
object. The font ascent
is the distance from the font's baseline to the top of most
alphanumeric characters. Some characters in the Font
might extend above the font ascent line.
Font
.Determines the font descent of the Font
described by this
FontMetrics
object. The font descent is the distance
from the font's baseline to the bottom of most alphanumeric
characters with descenders. Some characters in the
Font
might extend
below the font descent line.
Font
.Gets the FontRenderContext
used by this
FontMetrics
object to measure text.
Note that methods in this class which take a Graphics
parameter measure text using the FontRenderContext
of that Graphics
object, and not this
FontRenderContext
FontRenderContext
used by this
FontMetrics
object.Gets the standard height of a line of text in this font. This is the distance between the baseline of adjacent lines of text. It is the sum of the leading + ascent + descent. Due to rounding this may not be the same as getAscent() + getDescent() + getLeading(). There is no guarantee that lines of text spaced at this distance are disjoint; such lines may overlap if some characters overshoot either the standard ascent or the standard descent metric.
Determines the standard leading of the
Font
described by this FontMetrics
object. The standard leading, or
interline spacing, is the logical amount of space to be reserved
between the descent of one line of text and the ascent of the next
line. The height metric is calculated to include this extra space.
Font
.Gets the maximum advance width of any character in this
Font
. The advance is the
distance from the leftmost point to the rightmost point on the
string's baseline. The advance of a String
is
not necessarily the sum of the advances of its characters.
Font
, or -1
if the
maximum advance width is not known.
Gets the advance widths of the first 256 characters in the
Font
. The advance is the
distance from the leftmost point to the rightmost point on the
character's baseline. Note that the advance of a
String
is not necessarily the sum of the advances
of its characters.
Font
described by this FontMetrics
object.
Returns the total advance width for showing the specified
String
in this Font
. The advance
is the distance from the leftmost point to the rightmost point
on the string's baseline.
Note that the advance of a String
is
not necessarily the sum of the advances of its characters.
str | the String to be measured |
---|
String
in the Font
described by this
FontMetrics
.