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.
Constructor and Description |
---|
FontManager()
Constructs a font manager.
|
Modifier and Type | Method and Description |
---|---|
void |
getAllFontMetrics(Transaction t)
Adds the entire font metrics
|
Font |
getBGFont(int index)
Returns the correct font for the Business Graphics (BG) control.
|
Font |
getFont(int index)
Gets a font from the cache or creates one.
|
int |
getFontAscent(FontMetrics fm)
Gets the font ascent.
|
int |
getFontDescent(FontMetrics fm)
Gets the font descent.
|
int |
getFontHeight(FontMetrics fm)
Gets the font height.
|
int |
getFontHeightOffset(int index)
Get font substitution font height offset.
|
double |
getImageScale()
Gets the image scaling factor.
|
static FontManager |
getInstance()
Gets the default instance used for the Client.
|
int |
getLowerCaseAverageCharWidth(FontMetrics fm)
Computes the dialog average character width that Phantom uses as dialog
coordinates.
|
double |
getRatioX()
Gets the ratio X font value.
|
double |
getRatioY()
Gets the ratio Y font value.
|
double |
getScaling()
Gets the scaling to use, dependent of if factor or scale is used.
|
void |
init(ImageManager imageManager)
Initializes the Image Manager with scaling according to fonts.
|
void |
initFont(int scale,
boolean showMessage,
boolean isDesignUI)
Initializes the font depending on the FONT parameter of the client.
|
void |
initFont(String fontString)
Initializes the font depending on the FONT parameter of the client.
|
void |
initFont(String fontString,
boolean showMessage)
Initializes the font depending on the FONT parameter of the client.
|
void |
resetFonts()
Reset the font substitution.
|
void |
setFontRatio(int xRatio,
int yRatio,
boolean useRatioScaling)
Sets the ratio processing for fonts.
|
void |
substituteFonts(Phantom phantom,
Transaction trans)
Sets up the font substitution
|
public Font DEFAULT
public FontManager()
public static FontManager getInstance()
public Font getFont(int index)
public int getFontHeightOffset(int index)
public Font getBGFont(int index)
public int getFontHeight(FontMetrics fm)
public int getFontAscent(FontMetrics fm)
public int getFontDescent(FontMetrics fm)
public int getLowerCaseAverageCharWidth(FontMetrics fm)
This value is taken from the string "abcdefghijklmnopqrstuvwxyz 0123456789 MW" average.
fm
- The font metrics of the font.public void resetFonts()
public void substituteFonts(Phantom phantom, Transaction trans)
public void getAllFontMetrics(Transaction t)
public void setFontRatio(int xRatio, int yRatio, boolean useRatioScaling)
public void initFont(String fontString)
Valid fontString
values are integer values between 50 and 800,
meaning a scaling of 50% to 800%.
fontString
- The scaling value as an integer string between 50 to 800, zero
or null
for system scaling.public void initFont(String fontString, boolean showMessage)
Valid fontString
values are integer values between 50 and 800,
meaning a scaling of 50% to 800%.
fontString
- The scaling value as an integer string between 50 to 800, zero
or null
for system scaling.showMessage
- Flag to show the potential scaling applied.public void initFont(int scale, boolean showMessage, boolean isDesignUI)
Valid fontString
values are integer values between 50 and 800,
meaning a scaling of 50% to 800%.
scale
- The scaling value between 50 to 800, zero
for system scaling.showMessage
- Flag to show the potential scaling applied.isDesignUI
- Flag for Design UI (Panel Designer), false for Client or Editor itself.public void init(ImageManager imageManager)
public double getImageScale()
public double getRatioX()
public double getRatioY()
public double getScaling()
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.