-
Bug
-
Resolution: Unresolved
-
P4
-
23, 24, 25
-
None
When extreme font sizes are used - as is the case with the test java/awt/FontMetrics/ExtremeFontSize.java -
the code is supposed to use a null scaler *context* - so that the advances, glyphs etc are all zero-size.
And per the fix for https://bugs.openjdk.org/browse/JDK-8328896, it should not invalidate the scaler itself,
or mark the font bad.
And that fix did resolve that after using large sizes, subsequent calls to get metrics (etc) for the font are not zero
Yet when (on Linux) I turn on logging I see the font de-registered which was not the plan.
FileFontStrike constructor - line 196 - will call deRegisterBadFont if the returned scaler context is null.
I think that call should be removed.
In the native call, if a call to calloc() fails it also returns 0 (NULL) - but in that case it also calls invalidateJavaScaler()
That code has been there since 2007 .. when the FreetypeScaler.c was introduced.
And I think it is wrong. It probably never gets executed but it is not a reason to invalidate the whole scaler,
and it means that for the caller, one case it can keep using the font (simple null return) but in the other case
it can't.
Also the ExtremeFontSize.java test can be enhanced to cache and compate the results of the "before" and "after" metrics.
Currently the font is replaced, so they will likely differ and they should not.
the code is supposed to use a null scaler *context* - so that the advances, glyphs etc are all zero-size.
And per the fix for https://bugs.openjdk.org/browse/JDK-8328896, it should not invalidate the scaler itself,
or mark the font bad.
And that fix did resolve that after using large sizes, subsequent calls to get metrics (etc) for the font are not zero
Yet when (on Linux) I turn on logging I see the font de-registered which was not the plan.
FileFontStrike constructor - line 196 - will call deRegisterBadFont if the returned scaler context is null.
I think that call should be removed.
In the native call, if a call to calloc() fails it also returns 0 (NULL) - but in that case it also calls invalidateJavaScaler()
That code has been there since 2007 .. when the FreetypeScaler.c was introduced.
And I think it is wrong. It probably never gets executed but it is not a reason to invalidate the whole scaler,
and it means that for the caller, one case it can keep using the font (simple null return) but in the other case
it can't.
Also the ExtremeFontSize.java test can be enhanced to cache and compate the results of the "before" and "after" metrics.
Currently the font is replaced, so they will likely differ and they should not.