Index: gnu/java/awt/peer/ClasspathFontPeer.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/ClasspathFontPeer.java,v retrieving revision 1.3 diff -u -r1.3 ClasspathFontPeer.java --- gnu/java/awt/peer/ClasspathFontPeer.java 19 Mar 2004 21:33:54 -0000 1.3 +++ gnu/java/awt/peer/ClasspathFontPeer.java 22 Apr 2004 07:22:00 -0000 @@ -1,5 +1,5 @@ /* ClasspathFontPeer.java -- Font peer used by GNU Classpath. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2004 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -395,6 +395,23 @@ } /** + * Implementation of address@hidden Font#deriveFont(int, float)} + * + * @param font the font this peer is being called from. This may be + * useful if you are sharing peers between Font objects. Otherwise it may + * be ignored. + */ + + public Font deriveFont (Font font, int style, float size) + { + Map attrs = new HashMap (); + getStandardAttributes (attrs); + copyStyleToAttrs (style, attrs); + copySizeToAttrs (size, attrs); + return tk().getFont (logicalName, attrs); + } + + /** * Implementation of address@hidden Font#deriveFont(float)} * * @param font the font this peer is being called from. This may be @@ -439,6 +456,22 @@ Map attrs = new HashMap (); getStandardAttributes (attrs); copyStyleToAttrs (style, attrs); + copyTransformToAttrs (t, attrs); + return tk().getFont (logicalName, attrs); + } + + /** + * Implementation of address@hidden Font#deriveFont(AffineTransform)} + * + * @param font the font this peer is being called from. This may be + * useful if you are sharing peers between Font objects. Otherwise it may + * be ignored. + */ + + public Font deriveFont (Font font, AffineTransform t) + { + Map attrs = new HashMap (); + getStandardAttributes (attrs); copyTransformToAttrs (t, attrs); return tk().getFont (logicalName, attrs); } Index: java/awt/Font.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/awt/Font.java,v retrieving revision 1.15 diff -u -r1.15 Font.java --- java/awt/Font.java 19 Mar 2004 21:22:24 -0000 1.15 +++ java/awt/Font.java 22 Apr 2004 07:22:00 -0000 @@ -1,5 +1,5 @@ /* Font.java -- Font object - Copyright (C) 1999, 2002 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -650,6 +650,22 @@ /** * Produces a new address@hidden Font} based on the current font, adjusted to a + * new size and style. + * + * @param style The style of the newly created font. + * @param size The size of the newly created font. + * + * @return A clone of the current font, with the specified size and style. + * + * @since 1.2 + */ + public Font deriveFont (int style, float size) +{ + return peer.deriveFont (this, style, size); +} + +/** + * Produces a new address@hidden Font} based on the current font, adjusted to a * new size. * * @param size The size of the newly created font. @@ -699,6 +715,27 @@ throw new IllegalArgumentException ("Affine transformation is null"); return peer.deriveFont (this, style, a); +} + +/** + * Produces a new address@hidden Font} based on the current font, subjected + * to a new affine transformation. + * + * @param a The transformation to apply. + * + * @return A clone of the current font, with the specified transform. + * + * @throws IllegalArgumentException If transformation is + * null. + * + * @since 1.2 + */ + public Font deriveFont (AffineTransform a) +{ + if (a == null) + throw new IllegalArgumentException ("Affine transformation is null"); + + return peer.deriveFont (this, a); } /**