On Mon, Feb 17, 2020 at 11:44 AM Langer, Christoph
<christoph.lan...@sap.com> wrote:
>
> 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.

Oh, yes, I agree it's a better message.

Would they get this error during the font initialisation or at runtime
during use? I think this is one could be an interesting change from
the current status.

The reason I asked is because I'm aware of a few people getting the
weird error when all it meant was a misconfiguration (I think this
hits more because the closed JDK does come with some fonts if I
remember correctly while OpenJDK requires fonts to be installed on the
system), but I was afraid the new "NULL FONT HANDLE" would make the
jdk survive longer than necessary.

Cheers,
Mario

-- 
Mario Torre
Associate Manager, Software Engineering
Red Hat GmbH <https://www.redhat.com>
9704 A60C B4BE A8B8 0F30  9205 5D7E 4952 3F65 7898

Reply via email to