JDK-4892261 : Spec clarification needed for java.awt.Font.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: pbp_1.0,1.0-b28,5.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,solaris_2.5
  • CPU: generic,x86
  • Submitted: 2003-07-17
  • Updated: 2017-05-16
  • Resolved: 2003-08-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.

To download the current JDK release, click here.
5.0 tigerFixed
java.awt.Font documents that its constructors accepts logical font names
like "Serif" and font face names, like "Lucida Sans Regular"

GraphicsEnvironment.getAllFonts() will return fonts whose face names
are for logical fonts are, for example, "serif.bold"

The implication is that "serif.bold" is a valid name to pass in to
Font's constructor.

But there isn't explicit provision for accepting font family names
even though "Serif" is arguably the "family" name for a logical font
and the GraphicsEnvironment.getAvailableFontFamilyNames() API will
return family names like "Lucida Sans" and further documents that
these are useful in specifying just the family allowing the implementation
to pick up the most appropriate style.

Furthermore, when a face name is specified, there is no specification
how this is combined with "style" parameter, or with style attributes
supplied in a map.

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger FIXED IN: tiger INTEGRATED IN: tiger tiger-b15

EVALUATION I believe we should document that family names are accepted and that if a face name is specified, if a style other than PLAIN is separately specified that is different from the true style of the specified font face name, the implementation will attempt to provide the most appropriate font, even if it means using a different font than the one specified by the face name. This is consistent with historical implementation as well as likely being the most useful interpretation. ###@###.### 2003-07-17 ============================