-
Bug
-
Resolution: Fixed
-
P3
-
1.4.0
-
beta
-
sparc
-
solaris_2.6
Name: dsR10051 Date: 12/18/2000
The documentation for constructor
java.awt.Font.Font(String name, int style, int size)
has a contradiction in the specification of style parameter.
The javadoc says:
/**
* Creates a new <code>Font</code> from the specified name, style and
* point size.
* @param name the font name. This can be a logical font name or a
* font face name. A logical name must be either: Dialog, DialogInput,
* Monospaced, Serif, SansSerif, or Symbol. If <code>name</code> is
* <code>null</code>, the <code>name</code> of the new
* <code>Font</code> is set to Default.
* @param style the style constant for the <code>Font</code>
* The style argument is an integer bitmask that may
* be PLAIN, or a bitwise union of BOLD and/or ITALIC
* (for example, ITALIC or BOLD|ITALIC). Any other
^^^^^^^^^
* bits set in the style parameter are ignored.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* If the style argument does not conform to one of the expected
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* integer bitmasks then the style is set to PLAIN.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* @param size the point size of the <code>Font</code>
* @see GraphicsEnvironment#getAllFonts
* @see GraphicsEnvironment#getAvailableFontFamilyNames
* @since JDK1.0
*/
public Font(String name, int style, int size) {
There are two sentences - first is marked by '^' and second is marked by '!'.
If a user passes the style value with BOLD bit and some other bit set
(e.g. Font.BOLD | ~(Font.BOLD | Font.ITALIC)) the behavior of the
constructor is undefined. Following by the first state the font constructed
should have style set to BOLD. Following by the second state the font has to be
PLAIN.
======================================================================
- relates to
-
JDK-4389893 Behavior of java.awt.Font.Font(String ...) has been changed
-
- Closed
-