diff options
Diffstat (limited to 'libjava/classpath/java/awt/FontMetrics.java')
-rw-r--r-- | libjava/classpath/java/awt/FontMetrics.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libjava/classpath/java/awt/FontMetrics.java b/libjava/classpath/java/awt/FontMetrics.java index 6dd73ec2560..91866462fee 100644 --- a/libjava/classpath/java/awt/FontMetrics.java +++ b/libjava/classpath/java/awt/FontMetrics.java @@ -362,6 +362,18 @@ public abstract class FontMetrics implements java.io.Serializable 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 {@link LineMetrics} object constructed with the @@ -424,4 +436,13 @@ public abstract class FontMetrics implements java.io.Serializable return gRC; } + + /** + * Returns if the font has uniform line metrics. + * @see Font#hasUniformLineMetrics() + */ + public boolean hasUniformLineMetrics() + { + return font.hasUniformLineMetrics(); + } } |