From c96d36e1b0a718ec21f39befecfc0305f824238d Mon Sep 17 00:00:00 2001 From: Phil Race Date: Wed, 4 Dec 2019 17:42:18 -0800 Subject: [PATCH] 8214481: freetype path does not disable TrueType hinting with AA+FM hints Reviewed-by: serb, psadhukhan --- .../share/native/libfontmanager/freetypeScaler.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/java.desktop/share/native/libfontmanager/freetypeScaler.c b/src/java.desktop/share/native/libfontmanager/freetypeScaler.c index 02db30ac8e6..f34e3f4f571 100644 --- a/src/java.desktop/share/native/libfontmanager/freetypeScaler.c +++ b/src/java.desktop/share/native/libfontmanager/freetypeScaler.c @@ -857,6 +857,17 @@ static jlong return ptr_to_jlong(getNullGlyphImage()); } + /* + * When using Fractional metrics (linearly scaling advances) and + * greyscale antialiasing, disable hinting so that the glyph shapes + * are constant as size increases. This is good for animation as well + * as being compatible with what happened in earlier JDK versions + * which did not use freetype. + */ + if (context->aaType == TEXT_AA_ON && context->fmType == TEXT_FM_ON) { + renderFlags |= FT_LOAD_NO_HINTING; + } + if (!context->useSbits) { renderFlags |= FT_LOAD_NO_BITMAP; }