Class FontData
 Application code does not need to explicitly release the
 resources managed by each instance when those instances are no longer
 required, and thus no dispose() method is provided.
- Since:
- 1.0
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionFontData()Constructs a new uninitialized font data.Constructs a new FontData given a string representation in the form generated by theFontData.toStringmethod.Constructs a new font data given a font name, the height of the desired font in points, and a font style.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanCompares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.intReturns the height of the receiver in points.Returns the locale of the receiver.getName()Returns the name of the receiver.intgetStyle()Returns the style of the receiver which is a bitwise OR of one or more of theSWTconstants NORMAL, BOLD and ITALIC.inthashCode()Returns an integer hash code for the receiver.voidsetHeight(int height) Sets the height of the receiver.voidSets the locale of the receiver.voidSets the name of the receiver.voidsetStyle(int style) Sets the style of the receiver to the argument which must be a bitwise OR of one or more of theSWTconstants NORMAL, BOLD and ITALIC.toString()Returns a string representation of the receiver which is suitable for constructing an equivalent instance using theFontData(String)constructor.
- 
Constructor Details- 
FontDatapublic FontData()Constructs a new uninitialized font data.- Since:
- 1.4
 
- 
FontDataConstructs a new font data given a font name, the height of the desired font in points, and a font style.- Parameters:
- name- the name of the font (must not be null)
- height- the font height in points
- style- a bit or combination of NORMAL, BOLD, ITALIC
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - when the font name is null
- ERROR_INVALID_ARGUMENT - if the height is negative
 
 
- 
FontDataConstructs a new FontData given a string representation in the form generated by theFontData.toStringmethod.- Parameters:
- string- the string representation of a- FontData(must not be null)
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the argument is null
- ERROR_INVALID_ARGUMENT - if the argument does not represent a valid description
 
- See Also:
 
 
- 
- 
Method Details- 
toStringReturns a string representation of the receiver which is suitable for constructing an equivalent instance using theFontData(String)constructor.
- 
getHeightpublic int getHeight()Returns the height of the receiver in points.- Returns:
- the height of this FontData
- See Also:
 
- 
getNameReturns the name of the receiver.- Returns:
- the name of this FontData
- See Also:
 
- 
getStylepublic int getStyle()Returns the style of the receiver which is a bitwise OR of one or more of theSWTconstants NORMAL, BOLD and ITALIC.- Returns:
- the style of this FontData
- See Also:
 
- 
getLocaleReturns the locale of the receiver.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. - Returns:
- the Stringrepresenting a Locale object
- Since:
- 1.3
 
- 
setHeightpublic void setHeight(int height) Sets the height of the receiver. The parameter is specified in terms of points, where a point is one seventy-second of an inch.- Parameters:
- height- the height of the- FontData
- Throws:
- IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the height is negative
 
- Since:
- 1.4
- See Also:
 
- 
setNameSets the name of the receiver.- Parameters:
- name- the name of the font data (must not be null)
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - when the font name is null
 
- Since:
- 1.4
- See Also:
 
- 
setStylepublic void setStyle(int style) Sets the style of the receiver to the argument which must be a bitwise OR of one or more of theSWTconstants NORMAL, BOLD and ITALIC. All other style bits are ignored.- Parameters:
- style- the new style for this- FontData
- Since:
- 1.4
- See Also:
 
- 
setLocaleSets the locale of the receiver.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. - Parameters:
- locale- the- Stringrepresenting a Locale object
- Since:
- 1.4
- See Also:
 
- 
equalsCompares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
- 
hashCodepublic int hashCode()Returns an integer hash code for the receiver. Any two objects that returntruewhen passed toequalsmust return the same value for this method.
 
-