public final class FontMetrics
extends java.lang.Object
FontMetrics
are obtained from GC
s
using the getFontMetrics()
method.Modifier and Type | Field and Description |
---|---|
TEXTMETRIC |
handle
On Windows, handle is a Win32 TEXTMETRIC struct
On Photon, handle is a Photon FontQueryInfo struct
(Warning: This field is platform dependent)
IMPORTANT: This field is not part of the SWT
public API.
|
Constructor and Description |
---|
FontMetrics()
Prevents instances from being created outside the package.
|
Modifier and Type | Method and Description |
---|---|
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.
|
int |
getAscent()
Returns the ascent of the font described by the receiver.
|
int |
getAverageCharWidth()
Returns the average character width, measured in pixels,
of the font described by the receiver.
|
int |
getDescent()
Returns the descent of the font described by the receiver.
|
int |
getHeight()
Returns the height of the font described by the receiver,
measured in pixels.
|
int |
getLeading()
Returns the leading area of the font described by the
receiver.
|
int |
hashCode()
Returns an integer hash code for the receiver.
|
static FontMetrics |
win32_new(TEXTMETRIC handle)
Invokes platform specific functionality to allocate a new font metrics.
|
public TEXTMETRIC handle
IMPORTANT: This field is not part of the SWT public API. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms and should never be accessed from application code.
FontMetrics()
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- the object to compare with this objecttrue
if the object is the same as this object and false
otherwisehashCode()
public int getAscent()
public int getAverageCharWidth()
public int getDescent()
public int getHeight()
getAscent()
,
getDescent()
,
getLeading()
public int getLeading()
public int hashCode()
true
when passed to
equals
must return the same value for this
method.hashCode
in class java.lang.Object
equals(java.lang.Object)
public static FontMetrics win32_new(TEXTMETRIC handle)
IMPORTANT: This method is not part of the public
API for FontMetrics
. It is marked public only so that
it can be shared within the packages provided by SWT. It is not
available on all platforms, and should never be called from
application code.
handle
- the TEXTMETRIC
containing information about a fontTEXTMETRIC