Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f68832bc authored by Romain Guy's avatar Romain Guy
Browse files

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
parent e9a9dbe7
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import android.text.GraphicsOperations;
import android.text.SpannableString;
import android.text.SpannedString;
import android.text.TextUtils;
import android.util.DisplayMetrics;

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

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