gnu.awt.xlib

Class XFontMetrics

Implemented Interfaces:
Serializable

public class XFontMetrics
extends FontMetrics

See Also:
Serialized Form

Field Summary

Fields inherited from class java.awt.FontMetrics

font

Constructor Summary

XFontMetrics(Font xfont, Font awtFont)

Method Summary

int
getAscent()
Returns the ascent of the font, which is the distance from the base to the top of the majority of characters in the set.
int
getDescent()
Returns the descent of the font, which is the distance from the base to the bottom of the majority of characters in the set.
int
getMaxAscent()
Returns the maximum ascent value.
int
getMaxDescent()
Returns the maximum descent value.
int
stringWidth(String str)
Returns the total width of the specified string

Methods inherited from class java.awt.FontMetrics

bytesWidth, charWidth, charWidth, charsWidth, getAscent, getDescent, getFont, getHeight, getLeading, getLineMetrics, getLineMetrics, getLineMetrics, getLineMetrics, getMaxAdvance, getMaxAscent, getMaxCharBounds, getMaxDecent, getMaxDescent, getStringBounds, getStringBounds, getStringBounds, getStringBounds, getWidths, hasUniformLineMetrics, stringWidth, toString

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

XFontMetrics

public XFontMetrics(Font xfont,
                    Font awtFont)

Method Details

getAscent

public int getAscent()
Returns the ascent of the font, which is the distance from the base to the top of the majority of characters in the set. Some characters can exceed this value however.
Overrides:
getAscent in interface FontMetrics
Returns:
The font ascent.

getDescent

public int getDescent()
Returns the descent of the font, which is the distance from the base to the bottom of the majority of characters in the set. Some characters can exceed this value however.
Overrides:
getDescent in interface FontMetrics
Returns:
The font descent.

getMaxAscent

public int getMaxAscent()
Returns the maximum ascent value. This is the maximum distance any character in the font rised above the baseline.
Overrides:
getMaxAscent in interface FontMetrics
Returns:
The maximum ascent for this font.

getMaxDescent

public int getMaxDescent()
Returns the maximum descent value. This is the maximum distance any character in the font extends below the baseline.
Overrides:
getMaxDescent in interface FontMetrics
Returns:
The maximum descent for this font.

stringWidth

public int stringWidth(String str)
Returns the total width of the specified string
Overrides:
stringWidth in interface FontMetrics
Parameters:
str - The string to return the width of.
Returns:
The width of the string.

Copyright (C) 2000 Free Software Foundation This file is part of libgcj. This software is copyrighted work licensed under the terms of the Libgcj License. Please consult the file "LIBGCJ_LICENSE" for details.