Skip to content

Commit f68832b

Browse files
author
Romain Guy
committed
Turn hinting back on
The difference is not obvious when compared to no hinting, and turning off hinting has undesirable side effects because of the lack of sub- pixel positioning when rendering text. Change-Id: If2162ba079f68f33b33aed444e80036fdbf015bb
1 parent e9a9dbe commit f68832b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

graphics/java/android/graphics/Paint.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import android.text.SpannableString;
2121
import android.text.SpannedString;
2222
import android.text.TextUtils;
23-
import android.util.DisplayMetrics;
2423

2524
/**
2625
* The Paint class holds the style and color information about how to draw
@@ -344,8 +343,10 @@ public Paint() {
344343
public Paint(int flags) {
345344
mNativePaint = native_init();
346345
setFlags(flags | DEFAULT_PAINT_FLAGS);
347-
setHinting(DisplayMetrics.DENSITY_DEVICE >= DisplayMetrics.DENSITY_TV
348-
? HINTING_OFF : HINTING_ON);
346+
// TODO: Turning off hinting has undesirable side effects, we need to
347+
// revisit hinting once we add support for subpixel positioning
348+
// setHinting(DisplayMetrics.DENSITY_DEVICE >= DisplayMetrics.DENSITY_TV
349+
// ? HINTING_OFF : HINTING_ON);
349350
mCompatScaling = mInvCompatScaling = 1;
350351
}
351352

@@ -365,8 +366,10 @@ public Paint(Paint paint) {
365366
public void reset() {
366367
native_reset(mNativePaint);
367368
setFlags(DEFAULT_PAINT_FLAGS);
368-
setHinting(DisplayMetrics.DENSITY_DEVICE >= DisplayMetrics.DENSITY_TV
369-
? HINTING_OFF : HINTING_ON);
369+
// TODO: Turning off hinting has undesirable side effects, we need to
370+
// revisit hinting once we add support for subpixel positioning
371+
// setHinting(DisplayMetrics.DENSITY_DEVICE >= DisplayMetrics.DENSITY_TV
372+
// ? HINTING_OFF : HINTING_ON);
370373
mHasCompatScaling = false;
371374
mCompatScaling = mInvCompatScaling = 1;
372375
mBidiFlags = BIDI_DEFAULT_LTR;

0 commit comments

Comments
 (0)