-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.2.0
-
None
-
x86
-
windows_nt
I suspect this problem is already known, but since I can't find a specific bug on it,
I am filing this as P4/S4 for the record.
We bundle various fonts with the JRE, including "Lucida Sans Regular". It appears
that by default these fonts are not available through simple calls on the Font
constructor, but instead you need to first call GraphicsEnviornment.getAllFonts.
It's not at all obvious from the description of the "Font" constructor that you need
to call the getAllFonts method in order to make extra fonts accessible. I only
discovered this by chance. This is likely to be an impediment to anyone actually
using the Lucida fonts.
See the test case below. If you run it as "java Test" then it doesn't call getAllFonts
and it is given Arial when it asks for Lucida. If you run it as "java Test 1" then it
calls getAllFonts and finds Lucida OK.
import java.awt.*;
public class Test extends java.awt.Frame {
public static void main(String argv[]) {
Frame frame = new Test();
frame.setBounds(200,200,200,200);
frame.show();
if (argv.length >= 1) {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
Font fonts[] = ge.getAllFonts();
}
Font f1 = new Font("Lucida Sans Regular", Font.PLAIN, 12);
System.out.println("f1 = " + f1);
Font f2 = new Font("Lucida Sans", Font.PLAIN, 12);
System.out.println("f2 = " + f2);
}
}
graham.hamilton@Eng 1999-01-19
- duplicates
-
JDK-4222384 Font(name,style,size) works correctly ONLY AFTER getAvailableFontFamilyNames()
-
- Resolved
-
- relates to
-
JDK-4213568 no font.properties file bundled for solaris en_US.UTF-8 locale
-
- Resolved
-
-
JDK-4213897 no font.properties file bundled for solaris iw locale
-
- Closed
-
-
JDK-4213898 no font.properties file bundled for solaris ar locale
-
- Closed
-
-
JDK-4213904 incorrect font.properties file bundled for lv/lt in 2.8
-
- Closed
-