[OpenJDK 2D-Dev] RFR: 8221741 ClassCastException happen when fontconfig.properties was used

Langer, Christoph christoph.langer at sap.com
Mon Feb 17 10:44:42 UTC 2020


Hi Mario,

thanks for looking into the patch (which has already reached jdk/jdk mainline, btw).

> > I propose to fix this by adding a "NULL FONT HANDLE" to use in
> initialisedFonts for fonts that can’t be loaded. This will remove the recursion
> during loading of fonts. And afterwards a default physical font can then still
> be resolved, even if our font configuration contains less fonts (no true type
> fonts).
> 
> What happens now when there are no fonts at all on the system? (which
> is a case of misconfiguration).

In this case, I think one should run into this Error:
new Error("Probable fatal error: No physical fonts found."));

I think that's better and more explicit compared to having a strange ClassCastException.

Best regards
Christoph



More information about the 2d-dev mailing list