public class FontManager extends Object
The following fonts are used on the client. Font index 0 is the default font.
Java name Index Windows OS/2 ------------- ------ ------------- --------------------------- Dialog 0 System System Proportional Monospaced 1 Courier New Courier SansSerif 2 MS Sans Serif Helv Serif 3 MS Serif Tms Rmn Monospaced 4 Fixedsys System Monospaced Monospaced 5 Terminal System VIO Dialog 6 System System Proportional Non-ISOThe Java fonts may not exist, so the following table maps the names to other fonts when the client is started:
Name Alternate(s) ----------- --------------------------------- Dialog DialogInput, SansSerif, Helvetica Monospaced Courier SansSerif Helvetica Serif TimesRomanThe font substitution is done on the Server in the "server.ini" file under the section [FontSubstitution].
Each font substitution is done with the point size, a space, and the font index (0-6). After the equal sign, specify point size, a space and then font name. Several such font entries may be specified separated by a comma. The client will try to find the matching font, and if found this one will be used instead of the normal font.
| Modifier and Type | Method and Description |
|---|---|
static void |
getAllFontMetrics(Transaction t)
Adds the entire font metrics
|
static Font |
getBGFont(int index)
Returns the correct font for the Business Graphics (BG) control.
|
static Font |
getFont(int index)
Gets a font from the cache or creates one.
|
static int |
getFontAscent(FontMetrics fm)
Gets the font ascent.
|
static int |
getFontDescent(FontMetrics fm)
Gets the font descent.
|
static int |
getFontHeight(FontMetrics fm)
Gets the font height.
|
static int |
getFontHeightOffset(int index)
Get font substitution font height offset.
|
static int |
getLowerCaseAverageCharWidth(FontMetrics fm)
Computes the dialog average character width that Phantom uses as dialog
coordinates.
|
static void |
resetFonts()
Reset the font substitution.
|
static void |
setFontRatio(int xRatio,
int yRatio,
boolean useRatioScaling)
Sets the ratio processing for fonts.
|
static void |
substituteFonts(Phantom phantom,
Transaction trans)
Sets up the font substitution
|
public static Font DEFAULT
public static Font getFont(int index)
public static int getFontHeightOffset(int index)
public static Font getBGFont(int index)
public static int getFontHeight(FontMetrics fm)
public static int getFontAscent(FontMetrics fm)
public static int getFontDescent(FontMetrics fm)
public static int getLowerCaseAverageCharWidth(FontMetrics fm)
This value is taken from the string "abcdefghijklmnopqrstuvwxyz 0123456789" average.
public static void resetFonts()
public static void substituteFonts(Phantom phantom, Transaction trans)
public static void getAllFontMetrics(Transaction t)
public static void setFontRatio(int xRatio,
int yRatio,
boolean useRatioScaling)
Phantom® and NetPhantom® are registered trademarks of Nexum Technologies SARL.
© Copyright Nexum Technologies SARL, 2011. All rights reserved.