summaryrefslogtreecommitdiffstats
path: root/tests/BiDiTests
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2012-01-13 18:55:32 -0800
committerFabrice Di Meglio <fdimeglio@google.com>2012-01-13 19:49:46 -0800
commit03e250aefa29387f30a01243682eab2371103f8e (patch)
tree4bca102253b7d3eba8aafd93d829772533b58233 /tests/BiDiTests
parentd4a69b4a1cb5b52035345abd8cb9595ae4cf9fa5 (diff)
downloadframeworks_base-03e250aefa29387f30a01243682eab2371103f8e.zip
frameworks_base-03e250aefa29387f30a01243682eab2371103f8e.tar.gz
frameworks_base-03e250aefa29387f30a01243682eab2371103f8e.tar.bz2
Fix bug #5870701 Thai text can be clipped when there are more glyphs generated than the initial number of code points
- compute total advances correctly by iterating on the advances array for up to mShaperItem.num_glyphs - update unit tests Change-Id: I00af68bef88702215e9222ed80dbffcc81df51a7
Diffstat (limited to 'tests/BiDiTests')
-rw-r--r--tests/BiDiTests/res/values/strings.xml1
-rw-r--r--tests/BiDiTests/src/com/android/bidi/BiDiTestView.java6
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/BiDiTests/res/values/strings.xml b/tests/BiDiTests/res/values/strings.xml
index b1f5e50..1d4fc84 100644
--- a/tests/BiDiTests/res/values/strings.xml
+++ b/tests/BiDiTests/res/values/strings.xml
@@ -50,5 +50,6 @@
<string name="rtl">"والحق أن تترك ونص"</string>
<string name="composing">"\u0644\u0627"</string>
<string name="url">www.amazon.co.uk/gp/aw/h.html/275-8912818-8203452</string>
+ <string name="pointer_location" msgid="6084434787496938001">"ตำแหน่งของตัวชี้"</string>
</resources>
diff --git a/tests/BiDiTests/src/com/android/bidi/BiDiTestView.java b/tests/BiDiTests/src/com/android/bidi/BiDiTestView.java
index 0126dea..0b1974a 100644
--- a/tests/BiDiTests/src/com/android/bidi/BiDiTestView.java
+++ b/tests/BiDiTests/src/com/android/bidi/BiDiTestView.java
@@ -51,6 +51,7 @@ public class BiDiTestView extends View {
private String MIXED_TEXT_1;
private String HEBREW_TEXT;
private String RTL_TEXT;
+ private String THAI_TEXT;
private int currentTextSize;
@@ -82,6 +83,7 @@ public class BiDiTestView extends View {
MIXED_TEXT_1 = context.getString(R.string.mixed_text_1);
HEBREW_TEXT = context.getString(R.string.hebrew_text);
RTL_TEXT = context.getString(R.string.rtl);
+ THAI_TEXT = context.getString(R.string.pointer_location);
}
public void setCurrentTextSize(int size) {
@@ -134,6 +136,10 @@ public class BiDiTestView extends View {
// Test Hebrew
deltaX = testString(canvas, RTL_TEXT, ORIGIN, ORIGIN + 14 * currentTextSize,
false, false, Paint.DIRECTION_RTL, currentTextSize);
+
+ // Test Thai
+ deltaX = testString(canvas, THAI_TEXT, ORIGIN, ORIGIN + 16 * currentTextSize,
+ false, false, Paint.DIRECTION_LTR, currentTextSize);
}
private int testString(Canvas canvas, String text, int x, int y,