< prev index next >
src/java.desktop/share/classes/sun/font/SunFontManager.java
Print this page
*** 1075,1096 ****
* directory is missing), it could find another version of Lucida
* from the host system. This is OK because at that point we are
* trying to gracefully handle/recover from a system
* misconfiguration and this is probably a reasonable substitution.
*/
! defaultPhysicalFont = (PhysicalFont)
findFont2D(getDefaultFontFaceName(), Font.PLAIN, NO_FALLBACK);
if (defaultPhysicalFont == null) {
/* Because of the findFont2D call above, if we reach here, we
* know all fonts have already been loaded, just accept any
* match at this point. If this fails we are in real trouble
* and I don't know how to recover from there being absolutely
* no fonts anywhere on the system.
*/
Iterator<PhysicalFont> i = physicalFonts.values().iterator();
if (i.hasNext()) {
defaultPhysicalFont = i.next();
} else {
throw new Error("Probable fatal error:No fonts found.");
}
}
}
--- 1075,1102 ----
* directory is missing), it could find another version of Lucida
* from the host system. This is OK because at that point we are
* trying to gracefully handle/recover from a system
* misconfiguration and this is probably a reasonable substitution.
*/
! Font2D font2d =
findFont2D(getDefaultFontFaceName(), Font.PLAIN, NO_FALLBACK);
+ if (font2d instanceof PhysicalFont) {
+ defaultPhysicalFont = (PhysicalFont) font2d;
+ }
if (defaultPhysicalFont == null) {
/* Because of the findFont2D call above, if we reach here, we
* know all fonts have already been loaded, just accept any
* match at this point. If this fails we are in real trouble
* and I don't know how to recover from there being absolutely
* no fonts anywhere on the system.
*/
Iterator<PhysicalFont> i = physicalFonts.values().iterator();
if (i.hasNext()) {
defaultPhysicalFont = i.next();
+ if (font2d instanceof CompositeFont) {
+ defaultPhysicalFont = ((CompositeFont) font2d).getSlotFont(0);
+ }
} else {
throw new Error("Probable fatal error:No fonts found.");
}
}
}
< prev index next >