On a Windows XP SP 2 PC a user reports the following : on one test system we found a really strange behavious of a little app, which creates a Font instance for each available font familiy name. The code looks like this: String[] fontFamilyNames = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames(); Font[] fonts = new Font[fontFamilyNames.length]; int fontCount = 0; for (int i = 0; i < fontFamilyNames.length; i++) { fonts[i] = new Font(fontFamilyNames[i], Font.PLAIN, 1); } On that particular (WinXP) system, there are two fonts installed: Times New Roman (file name times.ttf) and Times (file name kycw1_75.ttf). Both family names ("Times New Roman" and "Times") are returned by the getAvailableFontFamilyNames() method. The problem is that the line new Font(fontFamilyNames[i], Font.PLAIN, 1) creates an instance of the "Times" font for both family names. I tried using alternative constructors (for example new Font(Map attributes) with only the FamilyName attribute set), but nothing works. As a result of this, we simply cannot use Times New Roman on that machine from Java, which is quite a shame, because it is far better than the Times font (much more of the Unicode glyphs are covered). If we remove the Times font from the machine, everything works fine. In non-Java applications both fonts appear in font choosers (under the names "Times" and "Times New Roman" as you would expect). I guess this is a bug in the Java font package, but I have a tiny bit a hope left that there is a workaround available. Can someone help? The Times font was installed from a driver CD-ROM for a Kyocera printer.
|