-
Bug
-
Resolution: Fixed
-
P3
-
fx2.0
-
Windows 7
In the VT, we need to get all the font families and their associated names.
It works well on most of the OS, but recently I received a standard Oracle laptop (Win7),
and get the following NPE when trying to get names for most of the families, although the fonts seems to be installed on the machine.
I only get font names (no NPE) for : Monospaced, SansSerif, Serif, System
The exception raised:
Caused by: java.lang.NullPointerException
at com.sun.t2k.T2KFontFactory.getFontFullNames(T2KFontFactory.java:994)
at com.sun.javafx.font.PrismFontLoader.getFontNames(PrismFontLoader.java:168)
at javafx.scene.text.Font.getFontNames(Font.java:124)
at helloworld.HelloFontSize.start(HelloFontSize.java:29)
To check this, one only need to add in an Fx example :
for (String family : Font.getFamilies()) {
System.out.println("\n===========================");
System.out.println(family);
try {
for (String name : Font.getFontNames(family)) {
System.out.println("\t" + name);
}
} catch (Exception ex) {
System.out.println("Exception for family : " + family);
}
}
It works well on most of the OS, but recently I received a standard Oracle laptop (Win7),
and get the following NPE when trying to get names for most of the families, although the fonts seems to be installed on the machine.
I only get font names (no NPE) for : Monospaced, SansSerif, Serif, System
The exception raised:
Caused by: java.lang.NullPointerException
at com.sun.t2k.T2KFontFactory.getFontFullNames(T2KFontFactory.java:994)
at com.sun.javafx.font.PrismFontLoader.getFontNames(PrismFontLoader.java:168)
at javafx.scene.text.Font.getFontNames(Font.java:124)
at helloworld.HelloFontSize.start(HelloFontSize.java:29)
To check this, one only need to add in an Fx example :
for (String family : Font.getFamilies()) {
System.out.println("\n===========================");
System.out.println(family);
try {
for (String name : Font.getFontNames(family)) {
System.out.println("\t" + name);
}
} catch (Exception ex) {
System.out.println("Exception for family : " + family);
}
}
- duplicates
-
JDK-8114157 getFontNames throws Runtime Exception
-
- Closed
-