Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.swt.graphics
Class FontMetrics

java.lang.Object
  extended by 
org.eclipse.swt.graphics.FontMetrics

public final class FontMetrics
extends Object

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

See Also:
GC.getFontMetrics(), Sample code and further information

Field Summary
 org.eclipse.swt.internal.win32.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.
 
Method Summary
 boolean equals ( 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 (org.eclipse.swt.internal.win32.TEXTMETRIC handle)
          Invokes platform specific functionality to allocate a new font metrics.
 
Methods inherited from class java.lang. Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

handle

public org.eclipse.swt.internal.win32.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. 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.

Method Detail

equals

public boolean equals(
Object object)
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.

Overrides:
equals in class Object
Parameters:
object - the object to compare with this object
Returns:
true if the object is the same as this object and false otherwise
See Also:
hashCode()

getAscent

public int getAscent()
Returns the ascent of the font described by the receiver. A font's ascent is the distance from the baseline to the top of actual characters, not including any of the leading area, measured in pixels.

Returns:
the ascent of the font

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

getDescent

public int getDescent()
Returns the descent of the font described by the receiver. A font's descent is the distance from the baseline to the bottom of actual characters, not including any of the leading area, measured in pixels.

Returns:
the descent 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
See Also:
getAscent(), getDescent(), getLeading()

getLeading

public int getLeading()
Returns the leading area of the font described by the receiver. A font's leading area is the space above its ascent which may include accents or other marks.

Returns:
the leading space of the font

hashCode

public int hashCode()
Returns an integer hash code for the receiver. Any two objects that return true when passed to equals must return the same value for this method.

Overrides:
hashCode in class Object
Returns:
the receiver's hash
See Also:
equals(java.lang.Object)

win32_new

public static 
FontMetrics win32_new(org.eclipse.swt.internal.win32.TEXTMETRIC handle)
Invokes platform specific functionality to allocate a new font metrics.

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.

Parameters:
handle - the TEXTMETRIC containing information about a font
Returns:
a new font metrics object containing the specified TEXTMETRIC

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire