Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.image.painter
Class FontUtils

java.lang.Object
  |
  +--oracle.cabo.image.painter.FontUtils

public class FontUtils
extends java.lang.Object

A utility class for working with fonts.

FontUtils contains utility functions for:


Method Summary
static java.awt.Font deriveFontUsingStyle(java.awt.Font baseFont, int derivingStyle, int derivedStyles)
          Returns a Font based on the base font, but with the styles specified by derivingStyle and derivedStyles.
static int getAverageWidth(java.awt.Font font)
          Return the average width of a glyph in this font.
static int getAverageWidth(java.awt.FontMetrics metrics)
          Return the average width of a glyph in this font.
static java.awt.Font getDefaultDialogFont()
          Returns the default Dialog font
static java.awt.Font getDefaultDialogInputFont()
          Returns the default dialog input font.
static java.awt.Font getDefaultMonospacedFont()
          Returns the default monospaced font.
static java.awt.Font getDefaultSansSerifFont()
          Returns the default sans serif font.
static java.awt.Font getDefaultSerifFont()
          Returns the default serif font.
static int getMinimumWidth(java.awt.Font font)
          Return the minimum width of a glyph in this font.
static int getMinimumWidth(java.awt.FontMetrics metrics)
          Return the minimum width of a glyph in this font.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

deriveFontUsingStyle

public static java.awt.Font deriveFontUsingStyle(java.awt.Font baseFont,
                                                 int derivingStyle,
                                                 int derivedStyles)
Returns a Font based on the base font, but with the styles specified by derivingStyle and derivedStyles.

Parameters:
baseFont - Font to get base the derived Font on.
derivingStyle - Style bits that must be present in the derived font.
derivedStyles - Mask of which derivingStyle bits are valid.

getDefaultDialogFont

public static java.awt.Font getDefaultDialogFont()
Returns the default Dialog font

getDefaultSansSerifFont

public static java.awt.Font getDefaultSansSerifFont()
Returns the default sans serif font. This is the font to be used in place of the deprecated "Helvetica" font.

getDefaultSerifFont

public static java.awt.Font getDefaultSerifFont()
Returns the default serif font. This is the font to be used in place of the deprecated "TimesRoman" font.

getDefaultMonospacedFont

public static java.awt.Font getDefaultMonospacedFont()
Returns the default monospaced font. This is the font to be used in place of the deprecated "Courier" font.

getDefaultDialogInputFont

public static java.awt.Font getDefaultDialogInputFont()
Returns the default dialog input font.

getAverageWidth

public static final int getAverageWidth(java.awt.Font font)
Return the average width of a glyph in this font. This is just an approximation. The current implementation returns the empirically determined width of the 'e' glyph.

Parameters:
font - the font used to test

getAverageWidth

public static int getAverageWidth(java.awt.FontMetrics metrics)
Return the average width of a glyph in this font. This is just an approximation. The current implementation returns the empirically determined width of the 'e' glyph.

Parameters:
metrics - the fontmetrics used to test

getMinimumWidth

public static final int getMinimumWidth(java.awt.Font font)
Return the minimum width of a glyph in this font. This is just an approximation. The current implementation returns the empirically determined width of the '.' glyph.

Parameters:
font - the font used to test

getMinimumWidth

public static int getMinimumWidth(java.awt.FontMetrics metrics)
Return the minimum width of a glyph in this font. This is just an approximation. The current implementation returns the empirically determined width of the '.' glyph.

Parameters:
metrics - the fontmetrics used to test

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

Copyright © 2002,2003, Oracle. All Rights Reserved.