public class FontSubstitution extends Object
Constructor and Description |
---|
FontSubstitution()
Constructor that creates the Transaction to the client that is used for
font substitution.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addItem(String item,
String value)
Adds a new font substitution item (e.g.
|
static boolean |
createClient(IniFile ini)
Create (eventually) list of client specific FontSubstitutions.
|
static boolean |
createDefault(IniFile ini)
Create the default FontSubstitution.
|
static boolean |
createFontSubstitution(IniFile serverIni)
Create method that initiates all static FontSubstitutions.
|
static FontSubstitution |
getDefaultSubstitution()
The default font substitution.
|
byte[] |
getFontMetrics()
The binary array of special font metrics (null for none).
|
static String |
getFsNameList()
The static string that contain a list of font substitutions.
|
int |
getIsApplet()
Applet flag, -1=doesn't matter, 0=not browser, 1=is browser.
|
String |
getJavaVendor()
Java vendor name for compare with client.
|
int |
getJavaVendorWild()
javaVendor wild card position, or -1 if none.
|
String |
getJavaVersion()
Java version name for compare with client.
|
int |
getJavaVersionWild()
javaVersion wild card position, or -1 if none.
|
String |
getOsName()
OS name for compare with client.
|
int |
getOsNameWild()
OS name wild card position, or -1 if none.
|
String |
getOsVersion()
OS version name for compare with client.
|
int |
getOsVersionWild()
osVersion wild card position, or -1 if none.
|
static ArrayList<FontSubstitution> |
getSubstitutions()
The static array of created client type font substitutions.
|
Transaction |
getTransaction()
Instance method to actually get this FontSubstitution's transaction.
|
static void |
setDefaultSubstitution(FontSubstitution defaultSubstitution)
The default font substitution.
|
void |
setFontMetrics(byte[] fontMetrics)
The binary array of special font metrics (null for none).
|
static void |
setFsNameList(String fsNameList)
The static string that contain a list of font substitutions.
|
void |
setIsApplet(int isApplet)
Applet flag, -1=doesn't matter, 0=not browser, 1=is browser.
|
void |
setJavaVendor(String javaVendor)
Java vendor name for compare with client.
|
void |
setJavaVendorWild(int javaVendorWild)
javaVendor wild card position, or -1 if none.
|
void |
setJavaVersion(String javaVersion)
Java version name for compare with client.
|
void |
setJavaVersionWild(int javaVersionWild)
javaVersion wild card position, or -1 if none.
|
void |
setOsName(String osName)
OS name for compare with client.
|
void |
setOsNameWild(int osNameWild)
OS name wild card position, or -1 if none.
|
void |
setOsVersion(String osVersion)
OS version name for compare with client.
|
void |
setOsVersionWild(int osVersionWild)
osVersion wild card position, or -1 if none.
|
void |
terminate()
Terminate the transaction when all items are added.
|
public FontSubstitution()
addItem
, the terminate
method should be called. Subsequent
calls to addItem
will throw an IOException! If terminate
is
not called, this will be done automatically.public static ArrayList<FontSubstitution> getSubstitutions()
public static FontSubstitution getDefaultSubstitution()
public static void setDefaultSubstitution(FontSubstitution defaultSubstitution)
defaultSubstitution
- the defaultSubstitution to setpublic static String getFsNameList()
public static void setFsNameList(String fsNameList)
fsNameList
- the fsNameList to setpublic static boolean createFontSubstitution(IniFile serverIni) throws IOException
This method is thread safe in combination with appendTransaction
.
IOException
public static boolean createDefault(IniFile ini) throws IOException
IOException
public static boolean createClient(IniFile ini) throws IOException
IOException
public String getJavaVersion()
public void setJavaVersion(String javaVersion)
javaVersion
- the javaVersion to setpublic int getJavaVersionWild()
public void setJavaVersionWild(int javaVersionWild)
javaVersionWild
- the javaVersionWild to setpublic String getJavaVendor()
public void setJavaVendor(String javaVendor)
javaVendor
- the javaVendor to setpublic int getJavaVendorWild()
public void setJavaVendorWild(int javaVendorWild)
javaVendorWild
- the javaVendorWild to setpublic String getOsName()
public void setOsName(String osName)
osName
- the osName to setpublic int getOsNameWild()
public void setOsNameWild(int osNameWild)
osNameWild
- the osNameWild to setpublic String getOsVersion()
public void setOsVersion(String osVersion)
osVersion
- the osVersion to setpublic int getOsVersionWild()
public void setOsVersionWild(int osVersionWild)
osVersionWild
- the osVersionWild to setpublic int getIsApplet()
public void setIsApplet(int isApplet)
isApplet
- the isApplet to setpublic byte[] getFontMetrics()
terminate
is called,
this value is set to null.public void setFontMetrics(byte[] fontMetrics)
terminate
is called,
this value is set to null.fontMetrics
- the fontMetrics to setpublic boolean addItem(String item, String value) throws IOException
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 TimesRomanEach 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.
Syntax:
PointSize(4-255)[Styles] FontIndex(0-6) = PointSize1[Styles] FontName1[:heightDiff1] [, PointSize2[Styles] FontName2[:heightDiff2]] [, ...etc...]where [Styles] (note: directly after point size without space) can be:
B Bold I Italic BI Bold and ItalicThe [:heightDiff] is optional and causes the height of the font to be adjusted by the number specified with heightDiff as pixels (the number may be negative). This new font height is only used by listboxes and is intended to make a perfect match for a font under Windows environment with a font for the NetPhantom Client.
Example: map Monospaced Bold 10 to Monospaced/Courier Bold Italic 8:
10B 1 = 8BI Monospaced, 8BI Courier
IOException
- for format errors in the value String parameter.public void terminate()
public Transaction getTransaction()
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.