summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRaph Levien <raph@google.com>2014-05-19 11:58:20 -0700
committerRaph Levien <raph@google.com>2014-05-27 14:44:32 +0000
commit86fa46c5ebb0d2c3319e08f4fbf487d8c2abbbfc (patch)
tree45318a5360fe32af41e6f79e2ab7fff9115b6d45 /include
parentb43357ad71782b4d1df03ee7e89b30705fcc6a93 (diff)
downloadandroid_frameworks_minikin-86fa46c5ebb0d2c3319e08f4fbf487d8c2abbbfc.tar.gz
android_frameworks_minikin-86fa46c5ebb0d2c3319e08f4fbf487d8c2abbbfc.tar.bz2
android_frameworks_minikin-86fa46c5ebb0d2c3319e08f4fbf487d8c2abbbfc.zip
Do BiDi algorithm for text layout
This is a fix for bug 15130102 "Language name for Hebrew displayed the wrong way around on keyboard". This patch extends the previous BiDi support (when the direction for the entire string was given by the caller) to run the BiDi algorithm (provided by ICU) over the string to break it into BiDi runs. Thus, it handles mixed LTR and RTL strings in a single layout, and also respects heuristics for inferring the paragraph direction from the string. Change-Id: Ia4b869de3c139c5a7d16b8ce7766870b98a815ea (cherry picked from commit 4b3a941128454e55893d65433a835e78a9e9781d)
Diffstat (limited to 'include')
-rw-r--r--include/minikin/Layout.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/minikin/Layout.h b/include/minikin/Layout.h
index 4fe9d87..6c338db 100644
--- a/include/minikin/Layout.h
+++ b/include/minikin/Layout.h
@@ -94,6 +94,10 @@ private:
// Find a face in the mFaces vector, or create a new entry
int findFace(MinikinFont* face, MinikinPaint* paint);
+ // Lay out a single bidi run
+ void doLayoutRun(const uint16_t* buf, size_t start, size_t count, size_t bufSize,
+ bool isRtl, FontStyle style, MinikinPaint& paint);
+
CssProperties mProps; // TODO: want spans
std::vector<LayoutGlyph> mGlyphs;
std::vector<float> mAdvances;