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

        * java/awt/Font.java
        Fixed comments.
        (pointSize): New field.
        (Font): Set size fields.
        (getSize, getSize2D): Return size fields.


Index: java/awt/Font.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/Font.java,v
retrieving revision 1.29
diff -U3 -r1.29 Font.java
--- java/awt/Font.java	19 Aug 2005 02:16:09 -0000	1.29
+++ java/awt/Font.java	24 Sep 2005 22:11:16 -0000
@@ -170,13 +170,20 @@
   protected String name;
 
   /**
-   * The size of this font in pixels.
+   * The size of this font in points, rounded.
    *
    * @since 1.0
    */
   protected int size;
 
   /**
+   * The size of this font in points.
+   *
+   * @since 1.0
+   */
+  protected float pointSize;
+
+  /**
    * The style of this font -- PLAIN, BOLD, ITALIC or BOLD+ITALIC.
    *
    * @since 1.0
@@ -346,6 +353,8 @@
     ClasspathFontPeer.copyStyleToAttrs (style, attrs);
     ClasspathFontPeer.copySizeToAttrs (size, attrs);
     this.peer = getPeerFromToolkit (name, attrs);
+    this.size = size;
+    this.pointSize = (float)size;
   }
 
   public Font (Map attrs)
@@ -363,7 +372,9 @@
     // Font default attributes.
     if (attrs == null)
       attrs = new HashMap();
-    this.peer = getPeerFromToolkit (name, attrs);
+    peer = getPeerFromToolkit (name, attrs);
+    size = (int)peer.getSize( this );
+    pointSize = peer.getSize( this );
   }
 
 /*************************************************************************/
@@ -391,18 +402,24 @@
 /*************************************************************************/
 
 /**
-  * Returns the style of the font.
+  * Returns the size of the font, in typographics points (1/72 of an inch),
+  * rounded to an integer.
   * 
-  * @return The font style.
+  * @return The font size
   */
   public int getSize ()
 {
-    return (int) peer.getSize (this);
+  return size;
 }
 
+/**
+  * Returns the size of the font, in typographics points (1/72 of an inch).
+  * 
+  * @return The font size
+  */
   public float getSize2D ()
 {
-    return peer.getSize (this);
+  return pointSize;
 }
 
 /*************************************************************************/
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to