changeset 59278:002b849de829

8214481: freetype path does not disable TrueType hinting with AA+FM hints Reviewed-by: serb, psadhukhan
author prr
date Wed, 04 Dec 2019 17:42:18 -0800
parents a680d0981607
children 269d810313dc
files src/java.desktop/share/native/libfontmanager/freetypeScaler.c
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/share/native/libfontmanager/freetypeScaler.c	Wed Dec 04 17:41:03 2019 -0800
+++ b/src/java.desktop/share/native/libfontmanager/freetypeScaler.c	Wed Dec 04 17:42:18 2019 -0800
@@ -857,6 +857,17 @@
         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;
     }