JDK-5092091 : fonts created with Font.createFont() not listed by getAvailableFontFamilyNames()
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • OS: solaris_2.5.1
  • CPU: x86
  • Submitted: 2004-08-25
  • Updated: 2004-08-26
  • Resolved: 2004-08-26
Related Reports
Relates :  
Description
Name: gm110360			Date: 08/25/2004


FULL PRODUCT VERSION :
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b51)
Java HotSpot(TM) Client VM (build 1.5.0-beta2-b51, mixed mode, sharing)


ADDITIONAL OS VERSION INFORMATION :
Linux infinity 2.6.7-1-386 #1 Thu Jul 8 05:08:04 EDT 2004 i686 GNU/Linux


A DESCRIPTION OF THE PROBLEM :
true type fonts created internally in a swing application with Font.createFont() are available and accessable for internal use in swing applications with java.awt.GraphicsEnvironment.getAvailableFontFamilyNames()  in JDK 1.4, but in JDK 1.5 only standard Java fonts are available.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
from the url
http://sourceforge.net/project/showfiles.php?group_id=69142&package_id=68012
get RabtIM.jar, RabtPad.jar and copy in a directory.

start application in new directory with java -Djava.ext.dirs=. -jar RabtPad.jar

in the font list with JDK 1.5 only java standard fonts are availabel, fonts installd internally with
createFont() are no more listed via getAvailableFontFamilyNames, in JDK 1.4 is was correct.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
font list with java standard fonts and additionally in the list user fonts.
ACTUAL -
only standard fonts are available

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
above example to reproduce, or the source is availabel at
http://prdownloads.sourceforge.net/rabtpad/rabt20040106_source.tgz?download

or

http://sourceforge.net/project/showfiles.php?group_id=69142&package_id=68012.

See the class RabtPad.java and search for method getAvailableFontFamilyNames...
---------- END SOURCE ----------

Release Regression From : 1.4.2
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.

(Incident Review ID: 300488) 
======================================================================

Comments
EVALUATION Fonts created via createFont are supposed to be in a sandbox. You have to keep a reference to it if you want to keep the font around. They aren't supposed to be enumerable through APIs like getAvailableFontFamilyNames() and certainly not outside your ap context. So JDK 1.4 should not have been doing that. Its contrary to spec and a bad idea. Font.createFont() docs say that if you wnat to use a Font obtained through that API you must use Font.deriveFont() to get new instances of the size that you want. So 1.5 is behaving to spec, and it appears this app was using the API contrary to spec. ###@###.### 2004-08-26 ============================
26-08-2004