| java.lang.Object java.awt.FontMetrics java.awt.X11FontMetrics
X11FontMetrics | class X11FontMetrics extends FontMetrics (Code) | | A font metrics object for a WServer font.
version: 1.6, 10/18/01 |
Field Summary | |
int | XFontSet | int | ascent The standard ascent of the font. | int | descent The standard descent of the font. | int | height The standard height of a line of text in this font. | int | leading The standard leading for the font. | int | maxAdvance The maximum advance width of any character in this font. | int | maxAscent The maximum ascent for all characters in this font. | int | maxDescent The maximum descent for all characters in this font. | int | maxHeight The maximum possible height of a line of text in this font.
Adjacent lines of text spaced this distance apart will be
guaranteed not to overlap. |
Constructor Summary | |
public | X11FontMetrics(Font font) Calculate the metrics from the given WServer and font. |
ascent | int ascent(Code) | | The standard ascent of the font. This is the logical height
above the baseline for the Alphanumeric characters and should
be used for determining line spacing. Note, however, that some
characters in the font may extend above this height.
|
descent | int descent(Code) | | The standard descent of the font. This is the logical height
below the baseline for the Alphanumeric characters and should
be used for determining line spacing. Note, however, that some
characters in the font may extend below this height.
|
height | int height(Code) | | 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 ascent+descent+leading. There is no
guarantee that lines of text spaced at this distance will be
disjoint; such lines may overlap if some characters overshoot
the standard ascent and descent metrics.
|
leading | int leading(Code) | | The standard leading for the font. This 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.
|
maxAdvance | int maxAdvance(Code) | | The maximum advance width of any character in this font.
|
maxAscent | int maxAscent(Code) | | The maximum ascent for all characters in this font. No character
will extend further above the baseline than this metric.
|
maxDescent | int maxDescent(Code) | | The maximum descent for all characters in this font. No character
will descend further below the baseline than this metric.
|
maxHeight | int maxHeight(Code) | | The maximum possible height of a line of text in this font.
Adjacent lines of text spaced this distance apart will be
guaranteed not to overlap. Note, however, that many paragraphs
that contain ordinary alphanumeric text may look too widely
spaced if this metric is used to determine line spacing. The
height field should be preferred unless the text in a given
line contains particularly tall characters.
|
X11FontMetrics | public X11FontMetrics(Font font)(Code) | | Calculate the metrics from the given WServer and font.
|
bytesWidth | public int bytesWidth(byte data, int offset, int len)(Code) | | Return the width of the specified byte[] in this Font.
|
charWidth | public int charWidth(char c)(Code) | | Fast lookup of first 127 chars as these are always the same eg. ASCII charset.
|
charsWidth | public int charsWidth(char chars, int offset, int length)(Code) | | Return the width of the specified char[] in this Font.
|
getAscent | public int getAscent()(Code) | | Get ascent.
|
getDescent | public int getDescent()(Code) | | Get descent
|
getHeight | public int getHeight()(Code) | | Get height
|
getLeading | public int getLeading()(Code) | | Get leading
|
getMaxAdvance | public int getMaxAdvance()(Code) | | Get maxAdvance
|
getMaxAscent | public int getMaxAscent()(Code) | | Get maxAscent
|
getMaxDescent | public int getMaxDescent()(Code) | | Get maxDescent
|
getWidths | public int[] getWidths()(Code) | | Get the widths of the first 256 characters in the font.
|
stringWidth | public int stringWidth(String string)(Code) | | Return the width of the specified string in this Font.
|
|
|