public final class Font
implements IConstructable, IPersistable
Encapsulates a Win32 font. Fonts are used to draw text on video displays and other output devices.
Fields
Name | Description |
---|---|
ANSI_FIXED | Standard ANSI fixed-width font. |
ANSI_VAR | Standard ANSI variable-width font. |
DEFAULT_GUI | Default font for the current user interface. |
DEVICE_DEFAULT | Standard font for the current graphics device. |
OEM_FIXED | Standard original equipment manufacturer (OEM) fixed font. |
SYSTEM | Standard Windows variable-width system font. |
SYSTEM_FIXED | Standard Windows fixed-width system font. |
Constructors
Name | Description |
---|---|
Font(int handle) | Creates a Font object based on an existing Win32 font handle. |
Font(String name, int size) | Creates a new font based on a specified font face name and size. |
Font(String name, int size, int weight, boolean italic, boolean underline, boolean strikeOut) | Creates a new font given a font face, size, and style. |
Font(String name, int size, int weight, boolean italic, boolean underline, boolean strikeOut, int charSet, int orientation) | Creates a new font. |
Font(Font font, int size) | Creates a new font from an existing one. |
Font(Font font, int weight, boolean italic, boolean underline, boolean strikeOut) | Creates a new font from an existing one. |
Font(Font font, int size, int weight, boolean italic, boolean underline, boolean strikeOut) | Creates a new font from an existing one. |
Font(int family, int pitch, int size) | Creates a new font based on a specified font family, pitch and size. |
Font(int family, int pitch, int size, int weight, boolean italic, boolean underline, boolean strikeOut) | Creates a new font based on a specified font face, size, and style. |
Font(int family, int pitch, int size, int weight, boolean italic, boolean underline, boolean strikeOut, int charSet, int orientation) | Creates a new font, based on the specified family, pitch, size, and weight. |
Font(IDataStream stream) | Creates a new font from a specified datastream. |
Methods
Name | Description |
---|---|
equals(Object obj) | Determines if one object equates to another. |
equalsBase(Font font) | Determines if one font shares the same base font as another. |
finalize() throws Throwable | Releases all resources allocated by this object. |
getBold() | Retrieves a boolean value that indicates if the font is bold. |
getCharacterSet() | Retrieves the character set the font is using. |
getConstructorArgs() | Retrieves the ConstructorArgs needed to persist this object. |
getExtension() | Retrieves a file name extension with which to save this object's persistance data. |
getFontMetrics() | Retrieves a FontMetrics object for this font. |
getFontMetrics(Graphics gr) | Retrieves a FontMetrics object for this font. |
getHandle() | Retrieves the Win32 HFONT handle. |
getItalic() | Retrieves a boolean value that indicates whether the font is italicized. |
getLogicalUnits(float points) | Converts a font's Point value to a logical unit. |
getLogicalUnits(float points, Graphics gr) | Converts a font's Point value to a logical unit. |
getName() | Retrieves the face name of the font, and returns the name in a String object. |
getOrientation() | Rerieves the orientation of the font, in tenths of a degree, from the x-axis of the device. |
getPoints(int units) | Converts a font's logical unit to a point. |
getPoints(int units, Graphics gr) | Converts a font's logical unit to a point. |
getSize() | Retrieves the size of the font in logical units. |
getStock(int index) | Retrieves a stock font, based on a specified index. |
getStrikeout() | Retrieves a boolean value that indicates whether the current font is a strike-through font. |
getUnderline() | Retrieves a boolean value that indicates whether the font is underlined. |
getWeight() | Retrieves the weight associated with this font. |
hashCode() | Retrieves a hash code value for this font. |
save(IDataStream stream) | Persists this font to the given datastream. |
Creates a Font object based on an existing Win32 font handle. The handle is not owned by this object.
Creates a new font based on a specified font face name and size.
Creates a new font given a font face, size, and style.
Creates a new font.
Creates a new font from an existing one.
Creates a new font from an existing one.
Creates a new font from an existing one.
Creates a new font based on a specified font family, pitch and size. Usually, you use this method if you do not know the name of the font you want to create.
Creates a new font based on a specified font face, size, and style. Usually, you use this method if you do not know the name of the font you want to create.
Creates a new font, based on the specified family, pitch, size, and weight. Usually, you use this method when you do not know the name of the font you want to create.
Creates a new font from a specified datastream.
Returns true if the given object equals this object; otherwise, returns false.
Determines if one object equates to another.
Returns true if the given font has the same base characteristics as this font; otherwise, returns false.
Determines if one font shares the same base font as another.
Releases all resources allocated by this object.
Throwable Thrown if a problem occurs while freeing the object's resources.
Returns true if the font is bold; otherwise, returns false.
Retrieves a boolean value that indicates if the font is bold.
Returns a wfc.app.CharacterSet enumeration value.
Retrieves the character set the font is using.
Returns a ConstructorArg array.
Retrieves the ConstructorArgs needed to persist this object.
Returns a file name extension to use during object persistence. Because Font objects do not use an extension, this method always returns null.
Retrieves a file name extension with which to save this object's persistance data.
Returns a FontMetrics object with the physical characteristics of the font.
Retrieves a FontMetrics object for this font. While a Font object maintains the requested characteristics of a font, a FontMetrics contains information about the actual font as it will be rendered to a Graphics object. This information may or may not match the requested characteristics, depending on what font information is available. This function assumes a default Graphics object of the screen.
Returns a FontMetrics object that describes the physical characteristics of the font.
Retrieves a FontMetrics object for this font. While a Font object maintains the requested characteristics of a font, a FontMetrics object contains information about the font as it will be rendered to a Graphics object. This information may or may not match the requested Font object characteristics, depending on font information that is available.
Returns a Win32 handle to the font.
Retrieves the Win32 HFONT handle.
Returns true if the font is italicized; otherwise, returns false.
Retrieves a boolean value that indicates whether the font is italicized.
Returns the number of logical units.
Converts a font's Point value to a logical unit. A font's logical units are independent of a given Graphics object's resolution. Points, on the other hand, are dependent on the resolution of the target object.
Returns the number of logical units.
Converts a font's Point value to a logical unit. A font's logical units are independent of a given Graphics object's resolution. Points, on the other hand, are dependent on the resolution of the target object.
Returns the font's face name.
Retrieves the face name of the font, and returns the name in a String object.
Returns the orientation of the font.
Rerieves the orientation of the font, in tenths of a degree, from the x-axis of the device.
Returns the number of points in the logical unit.
Converts a font's logical unit to a point. Logical units are independent of a Graphics object's resolution. Points, on the other hand, depend on the resolution of the target object.
Returns the number of points in the logical unit.
Converts a font's logical unit to a point. Logical units are independent of a Graphics object's resolution. Points, on the other hand, depend on the resolution of the target object.
Returns the font size in logical units.
Retrieves the size of the font in logical units. Windows defines a positive font size as the cell height of the font, which is usually the distance from the bottom of a "g" to the top of an "M". Windows defines a negative font size as the character height of the font, which is typically the height of an "M".
Returns the stock font that corresponds to the specified index.
Retrieves a stock font, based on a specified index.
Returns true if the font is a strike-through font; otherwise, returns false.
Retrieves a boolean value that indicates whether the current font is a strike-through font.
Returns true if the font is underlined; Otherwise, returns false.
Retrieves a boolean value that indicates whether the font is underlined.
Returns one of the enumeration values defined in the FontWeight class.
Retrieves the weight associated with this font.
Returns a hash code value for this font.
Retrieves a hash code value for this font.
Persists this font to the given datastream.