Font.java (deriveFont): Implement missing variants.

2004-04-22  Jerry Quinn  <jlquinn@optonline.net>

	* java/awt/Font.java (deriveFont): Implement missing variants.
	* gnu/java/awt/peer/ClasspathFontPeer.java (deriveFont): Implement
	missing variants.

From-SVN: r81002
This commit is contained in:
Jerry Quinn 2004-04-22 05:34:30 +00:00 committed by Jerry Quinn
parent aa26a3f648
commit 83ef3f2bae
3 changed files with 78 additions and 2 deletions

View file

@ -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.
@ -648,6 +648,22 @@ private static final long serialVersionUID = -4206021311591459213L;
return peer.createGlyphVector (this, ctx, glyphCodes);
}
/**
* Produces a new {@link 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 {@link Font} based on the current font, adjusted to a
* new size.
@ -701,6 +717,27 @@ private static final long serialVersionUID = -4206021311591459213L;
return peer.deriveFont (this, style, a);
}
/**
* Produces a new {@link 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
* <code>null</code>.
*
* @since 1.2
*/
public Font deriveFont (AffineTransform a)
{
if (a == null)
throw new IllegalArgumentException ("Affine transformation is null");
return peer.deriveFont (this, a);
}
/**
* Produces a new {@link Font} based on the current font, adjusted to a
* new set of attributes.