java.awt.FontMetrics (JDK 1.0)
This class represents font metrics for a specified Font. The methods allow you to determine the overall metrics for the font (ascent, descent, etc.), and also to compute the width of strings that are to be displayed in a particular font. You can obtain a FontMetrics object for a font with the getFontMetrics() method of Component or Toolkit.
public abstract classFontMetricsextends Object implements Serializable { //Protected ConstructorprotectedFontMetrics(Fontfont); //Protected Instance Variablesprotected Fontfont; //Public Instance Methodspublic intbytesWidth(byte[]data, intoff, intlen); public intcharWidth(intch); public intcharWidth(charch); public intcharsWidth(char[]data, intoff, intlen); public intgetAscent(); public intgetDescent(); public FontgetFont(); public intgetHeight(); public intgetLeading(); public intgetMaxAdvance(); public intgetMaxAscent(); # public intgetMaxDecent(); public intgetMaxDescent(); public int[]getWidths(); public intstringWidth(Stringstr); public StringtoString(); //Overrides Object}
Returned By:
Component.getFontMetrics(), ComponentPeer.getFontMetrics(), Graphics.getFontMetrics(), Toolkit.getFontMetrics()