FontMetrics

Instances of this class provide measurement information about fonts including ascent, descent, height, leading space between rows, and average character width. <code>FontMetrics</code> are obtained from <code>GC</code>s using the <code>getFontMetrics()</code> method.

@see GC#getFontMetrics @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>

Members

Functions

getAscent
int getAscent()

Returns the ascent of the font described by the receiver. A font's <em>ascent</em> is the distance from the baseline to the top of actual characters, not including any of the leading area, measured in pixels.

getAverageCharWidth
int getAverageCharWidth()

Returns the average character width, measured in pixels, of the font described by the receiver.

getDescent
int getDescent()

Returns the descent of the font described by the receiver. A font's <em>descent</em> is the distance from the baseline to the bottom of actual characters, not including any of the leading area, measured in pixels.

getHeight
int getHeight()

Returns the height of the font described by the receiver, measured in pixels. A font's <em>height</em> is the sum of its ascent, descent and leading area.

getLeading
int getLeading()

Returns the leading area of the font described by the receiver. A font's <em>leading area</em> is the space above its ascent which may include accents or other marks.

opEquals
equals_t opEquals(Object object)

Compares the argument to the receiver, and returns true if they represent the <em>same</em> object using a class specific comparison.

toHash
hash_t toHash()

Returns an integer hash code for the receiver. Any two objects that return <code>true</code> when passed to <code>equals</code> must return the same value for this method.

Meta