Source for gnu.awt.xlib.XFontMetrics

   1: /* Copyright (C) 2000  Free Software Foundation
   2: 
   3:    This file is part of libgcj.
   4: 
   5: This software is copyrighted work licensed under the terms of the
   6: Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
   7: details.  */
   8: 
   9: package gnu.awt.xlib;
  10: 
  11: import java.awt.FontMetrics;
  12: 
  13: public class XFontMetrics extends FontMetrics
  14: {
  15:   gnu.gcj.xlib.Font xfont;
  16:   
  17:   public XFontMetrics(gnu.gcj.xlib.Font xfont, java.awt.Font awtFont)
  18:   {
  19:     super(awtFont);
  20:     this.xfont = xfont;
  21:   }
  22: 
  23:   public int getAscent()
  24:   {
  25:     return xfont.getAscent();
  26:   }
  27: 
  28:   public int getDescent()
  29:   {
  30:     return xfont.getDescent();
  31:   }
  32: 
  33:   public int getMaxAscent()
  34:   {
  35:     return xfont.getMaxAscent();
  36:   }
  37:  
  38:   public int getMaxDescent()
  39:   {
  40:     return xfont.getMaxDescent();
  41:   }
  42: 
  43:   public int stringWidth(String str)
  44:   {
  45:     return xfont.getStringWidth(str);
  46:   }
  47: }