/[classpath]/classpath/gnu/java/awt/peer/gtk/GdkFontMetrics.java
ViewVC logotype

Diff of /classpath/gnu/java/awt/peer/gtk/GdkFontMetrics.java

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

revision 1.7 by mkoch, Wed Jul 9 10:25:34 2003 UTC revision 1.8 by fitzsim, Mon Dec 1 23:44:12 2003 UTC
# Line 50  public class GdkFontMetrics extends Font Line 50  public class GdkFontMetrics extends Font
50                         MAX_ADVANCE = 4;                         MAX_ADVANCE = 4;
51    
52    private int[] metrics;    private int[] metrics;
53    private native int[] initState (String xlfd, int pts);    private native int[] initState (String fname, int size);
54    
55    public GdkFontMetrics (Font font)    public GdkFontMetrics (Font font)
56    {    {
57      super (font);      super (font);
58      metrics = initState (((GtkFontPeer)font.getPeer ()).getXLFD (),      metrics = initState (font.getName (), font.getSize ());
                          font.getSize ());  
59    }    }
60    
61    native public int stringWidth (String str);    native public int stringWidth (String fname, int size, String str);
62    
63      public int stringWidth (String str)
64      {
65        return stringWidth (font.getName (), font.getSize (), str);
66      }
67    
68    public int charWidth (char ch)    public int charWidth (char ch)
69    {    {
# Line 71  public class GdkFontMetrics extends Font Line 75  public class GdkFontMetrics extends Font
75      return stringWidth (new String (data, off, len));      return stringWidth (new String (data, off, len));
76    }    }
77    
78    /*    // Sun's Motif implementation always returns 0 or 1 here (???).
      Sun's Motif implementation always returns 0 or 1 here (???), but  
      going by the X11 man pages, it seems as though we should return  
      font.ascent + font.descent.  
   */  
79    public int getLeading ()    public int getLeading ()
80    {    {
81      return 1;      return 0;
 //      return metrics[ASCENT] + metrics[DESCENT];  
82    }    }
83    
84    public int getAscent ()    public int getAscent ()

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

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