diff --git a/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java index 7777e1918b300..e60a61c9fd97f 100644 --- a/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java +++ b/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java @@ -82,6 +82,7 @@ public class Paint_Delegate { private float mTextSize; private float mTextScaleX; private float mTextSkewX; + private int mHintingMode = Paint.HINTING_ON; private Xfermode_Delegate mXfermode; private ColorFilter_Delegate mColorFilter; @@ -269,6 +270,28 @@ public class Paint_Delegate { setFlag(thisPaint, Paint.FILTER_BITMAP_FLAG, filter); } + @LayoutlibDelegate + /*package*/ static int getHinting(Paint thisPaint) { + // get the delegate from the native int. + Paint_Delegate delegate = sManager.getDelegate(thisPaint.mNativePaint); + if (delegate == null) { + return Paint.HINTING_ON; + } + + return delegate.mHintingMode; + } + + @LayoutlibDelegate + /*package*/ static void setHinting(Paint thisPaint, int mode) { + // get the delegate from the native int. + Paint_Delegate delegate = sManager.getDelegate(thisPaint.mNativePaint); + if (delegate == null) { + return; + } + + delegate.mHintingMode = mode; + } + @LayoutlibDelegate /*package*/ static void setAntiAlias(Paint thisPaint, boolean aa) { setFlag(thisPaint, Paint.ANTI_ALIAS_FLAG, aa); @@ -1098,6 +1121,7 @@ public class Paint_Delegate { mPathEffect = paint.mPathEffect; mMaskFilter = paint.mMaskFilter; mRasterizer = paint.mRasterizer; + mHintingMode = paint.mHintingMode; updateFontObject(); } @@ -1121,6 +1145,7 @@ public class Paint_Delegate { mMaskFilter = null; mRasterizer = null; updateFontObject(); + mHintingMode = Paint.HINTING_ON; } /**