FontMetricsNameFontMetrics
DescriptionThe FontMetrics class provides the means to calculate actual width and height of text if drawn on the screen. Class Definition
public abstract class java.awt.FontMetrics extends java.lang.Object implements java.io.Serializable { // Variables protected Font font; // Constructors protected FontMetrics (Font font); // Instance Methods public int bytesWidth (byte data[], int offset, int length); public int charsWidth (char data[], int offset, int length); public int charWidth (char character); public int charWidth (int character); public int getAscent(); public int getDescent(); public Font getFont(); public int getHeight(); public int getLeading(); public int getMaxAdvance(); public int getMaxAscent(); public int getMaxDecent(); public int getMaxDescent(); public int[] getWidths(); public int stringWidth (String string); public String toString(); } Variablesfontprotected Font fontThe Font object whose metrics are represented by this object. ConstructorsFontMetricsprotected FontMetrics (Font font)
Instance MethodsbytesWidthpublic int bytesWidth (byte data[], int offset, int length)
charsWidthpublic int charsWidth (char data[], int offset, int length)
charWidthpublic int charWidth (char character)
public int charWidth (int character)
getAscentpublic int getAscent()
getDescentpublic int getDescent()
getFontpublic Font getFont()
getHeightpublic int getHeight()
getLeadingpublic int getLeading()
getMaxAdvancepublic int getMaxAdvance()
getMaxAscentpublic int getMaxAscent()
getMaxDecentpublic int getMaxDecent()
getMaxDescentpublic int getMaxDescent()
getWidthspublic int[] getWidths()
stringWidthpublic int stringWidth (String string)
toStringpublic String toString()
See AlsoFont, Object, String |
|