2005-09-24  Sven de Marothy  <[EMAIL PROTECTED]>

        * java/awt/FontMetrics.java
        (getMaxCharBounds, hasUniformLineMetrics): New methods.
        

Index: java/awt/FontMetrics.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/FontMetrics.java,v
retrieving revision 1.17
diff -U3 -r1.17 FontMetrics.java
--- java/awt/FontMetrics.java	17 Aug 2005 14:17:52 -0000	1.17
+++ java/awt/FontMetrics.java	24 Sep 2005 01:15:30 -0000
@@ -362,6 +362,18 @@
       rc = gRC;
     return font.getLineMetrics(chars, begin, limit, rc);
   }
+  
+  /**
+   * Returns the bounds of the largest character in a Graphics context.
+   * @param context the Graphics context object.
+   * @return a <code>Rectangle2D</code> representing the bounds
+   */
+  public Rectangle2D getMaxCharBounds(Graphics context)
+  {
+    if( context instanceof Graphics2D )
+      return font.getMaxCharBounds(((Graphics2D)context).getFontRenderContext());
+    return font.getMaxCharBounds( gRC );
+  }
 
   /**
    * Returns a [EMAIL PROTECTED] LineMetrics} object constructed with the
@@ -423,5 +435,14 @@
       return ((Graphics2D) context).getFontRenderContext();
 
     return gRC;
+  }
+
+  /**
+   * Returns if the font has uniform line metrics.
+   * @see Font#hasUniformLineMetrics()
+   */
+  public boolean hasUniformLineMetrics()
+  {
+    return font.hasUniformLineMetrics();
   }
 }
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to