diff options
Diffstat (limited to 'libjava/classpath/gnu/java/awt/peer/gtk/GdkFontPeer.java')
-rw-r--r-- | libjava/classpath/gnu/java/awt/peer/gtk/GdkFontPeer.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/GdkFontPeer.java b/libjava/classpath/gnu/java/awt/peer/gtk/GdkFontPeer.java index c6d42b37276..82744480dcf 100644 --- a/libjava/classpath/gnu/java/awt/peer/gtk/GdkFontPeer.java +++ b/libjava/classpath/gnu/java/awt/peer/gtk/GdkFontPeer.java @@ -1,5 +1,5 @@ /* GdkFontPeer.java -- Implements FontPeer with GTK+ - Copyright (C) 1999, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1999, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -43,6 +43,7 @@ import gnu.java.awt.peer.ClasspathFontPeer; import java.awt.Font; import java.awt.FontMetrics; +import java.awt.Toolkit; import java.awt.font.FontRenderContext; import java.awt.font.GlyphVector; import java.awt.font.LineMetrics; @@ -157,7 +158,7 @@ public class GdkFontPeer extends ClasspathFontPeer public String getPostScriptName(Font font) { - return null; + return this.familyName; } public boolean canDisplay (Font font, char c) @@ -301,7 +302,9 @@ public class GdkFontPeer extends ClasspathFontPeer public FontMetrics getFontMetrics (Font font) { - return new GdkFontMetrics (font); + // Get the font metrics through GtkToolkit to take advantage of + // the metrics cache. + return Toolkit.getDefaultToolkit().getFontMetrics (font); } } |