209 |
* The style should be one of BOLD, ITALIC, or BOLDITALIC. The default |
* The style should be one of BOLD, ITALIC, or BOLDITALIC. The default |
210 |
* style if none is specified is PLAIN. The default size if none |
* style if none is specified is PLAIN. The default size if none |
211 |
* is specified is 12. |
* is specified is 12. |
212 |
|
* |
213 |
|
* @param fontspec a string specifying the required font (<code>null</code> |
214 |
|
* permitted, interpreted as 'Dialog-PLAIN-12'). |
215 |
|
* |
216 |
|
* @return A font. |
217 |
*/ |
*/ |
218 |
public static Font decode (String fontspec) |
public static Font decode (String fontspec) |
219 |
{ |
{ |
220 |
|
if (fontspec == null) |
221 |
|
fontspec = "Dialog-PLAIN-12"; |
222 |
String name = null; |
String name = null; |
223 |
int style = PLAIN; |
int style = PLAIN; |
224 |
int size = 12; |
int size = 12; |
225 |
|
|
226 |
StringTokenizer st = new StringTokenizer(fontspec, "-"); |
StringTokenizer st = new StringTokenizer(fontspec, "- "); |
227 |
while (st.hasMoreTokens()) |
while (st.hasMoreTokens()) |
228 |
{ |
{ |
229 |
String token = st.nextToken(); |
String token = st.nextToken(); |