From 1f0dac38df453035a8bd0205a23eecc44aa9d783 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Wed, 1 Jul 2009 18:03:09 -0700 Subject: [PATCH] Turn off kerning when testing TextUtils.ellipsize(). Otherwise, the different text measurement methods produce slightly different results and cause the text to show different results for Spanned vs. non-Spanned source strings. Bug 1837826 --- tests/AndroidTests/src/com/android/unit_tests/TextUtilsTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/AndroidTests/src/com/android/unit_tests/TextUtilsTest.java b/tests/AndroidTests/src/com/android/unit_tests/TextUtilsTest.java index 51e841cb8d3a3..7720041fcccae 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/TextUtilsTest.java +++ b/tests/AndroidTests/src/com/android/unit_tests/TextUtilsTest.java @@ -276,6 +276,7 @@ public class TextUtilsTest extends TestCase { Spannable s3 = new SpannableString(s1); s3.setSpan(new StyleSpan(0), 5, 10, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); TextPaint p = new TextPaint(); + p.setFlags(p.getFlags() & ~p.DEV_KERN_TEXT_FLAG); for (int i = 0; i < 100; i++) { for (int j = 0; j < 3; j++) {