57 |
} |
} |
58 |
} |
} |
59 |
|
|
60 |
final private String Xname; |
final private String Xname; // uses %d for font size. |
61 |
|
|
62 |
public GtkFontPeer (String name, int style) |
public GtkFontPeer (String name, int style) |
63 |
{ |
{ |
64 |
if (bundle != null) |
if (bundle != null) |
65 |
Xname = bundle.getString (name.toLowerCase () + "." + style); |
Xname = bundle.getString (name.toLowerCase () + "." + style); |
66 |
else |
else |
67 |
Xname = "-*-*-medium-r-normal-*-12-*-*-*-c-*-*-*"; |
{ |
68 |
|
String weight; |
69 |
|
String slant; |
70 |
|
String spacing; |
71 |
|
|
72 |
|
if (style == Font.ITALIC || (style == (Font.BOLD+Font.ITALIC))) |
73 |
|
slant = "i"; |
74 |
|
else |
75 |
|
slant = "r"; |
76 |
|
if (style == Font.BOLD || (style == (Font.BOLD+Font.ITALIC))) |
77 |
|
weight = "bold"; |
78 |
|
else |
79 |
|
weight = "medium"; |
80 |
|
if (name.equals("Serif") || name.equals("SansSerif") |
81 |
|
|| name.equals("Helvetica") || name.equals("Times")) |
82 |
|
spacing = "p"; |
83 |
|
else |
84 |
|
spacing = "c"; |
85 |
|
|
86 |
|
Xname = "-*-*-" + weight + "-" + slant + "-normal-*-%d-*-*-*-" + spacing + "-*-*-*"; |
87 |
|
} |
88 |
} |
} |
89 |
|
|
90 |
public String getXLFD () |
public String getXLFD () |