/[classpath]/classpath/java/awt/Font.java
ViewVC logotype

Diff of /classpath/java/awt/Font.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.18.2.3 by gnu_andrew, Sun Jan 16 02:14:46 2005 UTC revision 1.18.2.4 by gnu_andrew, Sun Mar 13 14:38:39 2005 UTC
# Line 1  Line 1 
1  /* Font.java -- Font object  /* Font.java -- Font object
2     Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc.     Copyright (C) 1999, 2002, 2004, 2005  Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 209  private static final long serialVersionU Line 209  private static final long serialVersionU
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();
# Line 247  private static final long serialVersionU Line 254  private static final long serialVersionU
254          {          {
255            tokenval = Integer.parseInt(token);            tokenval = Integer.parseInt(token);
256          }          }
257        catch(NumberFormatException e) { ; }        catch(NumberFormatException e)
258            {
259              // Ignored.
260            }
261    
262        if (tokenval != 0)        if (tokenval != 0)
263          size = tokenval;          size = tokenval;

Legend:
Removed from v.1.18.2.3  
changed lines
  Added in v.1.18.2.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26