Package org.eclipse.swt.graphics
Class FontMetrics
- java.lang.Object
-
- org.eclipse.swt.graphics.FontMetrics
-
public final class FontMetrics extends java.lang.ObjectInstances of this class provide measurement information about fonts .FontMetricsare obtained fromGCs using thegetFontMetrics()method.- Since:
- 1.3
- See Also:
GC.getFontMetrics()
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object object)Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.intgetAverageCharWidth()Returns the average character width, measured in pixels, of the font described by the receiver.intgetHeight()Returns the height of the font described by the receiver, measured in pixels.inthashCode()Returns an integer hash code for the receiver.
-
-
-
Method Detail
-
getAverageCharWidth
public int getAverageCharWidth()
Returns the average character width, measured in pixels, of the font described by the receiver.- Returns:
- the average character width of the font
-
getHeight
public int getHeight()
Returns the height of the font described by the receiver, measured in pixels. A font's height is the sum of its ascent, descent and leading area.- Returns:
- the height of the font
-
equals
public boolean equals(java.lang.Object object)
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.- Overrides:
equalsin classjava.lang.Object- Parameters:
object- the object to compare with this object- Returns:
trueif the object is the same as this object andfalseotherwise- See Also:
hashCode()
-
hashCode
public int hashCode()
Returns an integer hash code for the receiver. Any two objects that returntruewhen passed toequalsmust return the same value for this method.- Overrides:
hashCodein classjava.lang.Object- Returns:
- the receiver's hash
- See Also:
equals(java.lang.Object)
-
-