|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.swt.graphics.FontData
public final class FontData
Instances of this class describe operating system fonts.
For platform-independent behaviour, use the get and set methods corresponding to the following properties:
FontData
corresponds to a Windows LOGFONT
structure whose fields
may be retrieved and modified.FontData
correspond
to the entries in the font's XLFD name and may be retrieved and modified.
dispose()
method is provided.
Font
,
Sample code and further informationField Summary | |
---|---|
float |
height
The height of the font data in points (Warning: This field is platform dependent) |
java.lang.String |
name
the font name (Warning: This field is platform dependent) |
byte[] |
string
the Pango string (Warning: This field is platform dependent) |
int |
style
the font style (Warning: This field is platform dependent) |
Constructor Summary | |
---|---|
FontData()
Constructs a new uninitialized font data. |
|
FontData(java.lang.String string)
Constructs a new FontData given a string representation in the form generated by the FontData.toString
method. |
|
FontData(java.lang.String name,
int height,
int style)
Constructs a new font data given a font name, the height of the desired font in points, and a font style. |
Method Summary | |
---|---|
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 |
getHeight()
Returns the height of the receiver in points. |
java.lang.String |
getLocale()
Returns the locale of the receiver. |
java.lang.String |
getName()
Returns the name of the receiver. |
int |
getStyle()
Returns the style of the receiver which is a bitwise OR of one or more of the SWT constants NORMAL, BOLD
and ITALIC. |
int |
hashCode()
Returns an integer hash code for the receiver. |
void |
setHeight(int height)
Sets the height of the receiver. |
void |
setLocale(java.lang.String locale)
Sets the locale of the receiver. |
void |
setName(java.lang.String name)
Sets the name of the receiver. |
void |
setStyle(int style)
Sets the style of the receiver to the argument which must be a bitwise OR of one or more of the SWT
constants NORMAL, BOLD and ITALIC. |
java.lang.String |
toString()
Returns a string representation of the receiver which is suitable for constructing an equivalent instance using the FontData(String) constructor. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public java.lang.String name
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.
public float height
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.
public int style
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.
public byte[] string
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.
Constructor Detail |
---|
public FontData()
public FontData(java.lang.String string)
FontData.toString
method.
Note that the representation varies between platforms, and a FontData can only be created from a string that was generated on the same platform.
string
- the string representation of a FontData
(must not be null)
java.lang.IllegalArgumentException
- toString()
public FontData(java.lang.String name, int height, int style)
name
- the name of the font (must not be null)height
- the font height in pointsstyle
- a bit or combination of NORMAL, BOLD, ITALIC
java.lang.IllegalArgumentException
- Method Detail |
---|
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- the object to compare with this object
true
if the object is the same as this object and false
otherwisehashCode()
public int getHeight()
setHeight(int)
public java.lang.String getLocale()
The locale determines which platform character set this font is going to use. Widgets and graphics operations that use this font will convert UNICODE strings to the platform character set of the specified locale.
On platforms where there are multiple character sets for a given language/country locale, the variant portion of the locale will determine the character set.
String
representing a Locale objectpublic java.lang.String getName()
FontData
setName(java.lang.String)
public int getStyle()
SWT
constants NORMAL, BOLD
and ITALIC.
FontData
setStyle(int)
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 void setHeight(int height)
height
- the height of the FontData
java.lang.IllegalArgumentException
- getHeight()
public void setLocale(java.lang.String locale)
The locale determines which platform character set this font is going to use. Widgets and graphics operations that use this font will convert UNICODE strings to the platform character set of the specified locale.
On platforms where there are multiple character sets for a given language/country locale, the variant portion of the locale will determine the character set.
locale
- the String
representing a Locale objectLocale.toString()
public void setName(java.lang.String name)
Some platforms support font foundries. On these platforms, the name of the font specified in setName() may have one of the following forms:
On platforms that do not support font foundries, only the face name
(for example, "courier") is used in setName()
and
getName()
.
name
- the name of the font data (must not be null)
java.lang.IllegalArgumentException
- getName()
public void setStyle(int style)
SWT
constants NORMAL, BOLD and ITALIC. All other style bits are
ignored.
style
- the new style for this FontData
getStyle()
public java.lang.String toString()
FontData(String)
constructor.
toString
in class java.lang.Object
FontData
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |