summaryrefslogtreecommitdiffstats
path: root/third_party
diff options
context:
space:
mode:
authorjshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-19 01:04:27 +0000
committerjshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-19 01:04:27 +0000
commit4cb1c583dfa8fcad38f789754676e2bceebc7c27 (patch)
treeb8a61d72495597a7e83b1d3e2ad530561c0bc196 /third_party
parent7f6f1953337ed7455de65c46b433cbd6acf24b8f (diff)
downloadchromium_src-4cb1c583dfa8fcad38f789754676e2bceebc7c27.zip
chromium_src-4cb1c583dfa8fcad38f789754676e2bceebc7c27.tar.gz
chromium_src-4cb1c583dfa8fcad38f789754676e2bceebc7c27.tar.bz2
Fix the alignment issue with Arabic when a font has kerning or cursive gsub
Patch by behdad@chromium.org. Will add a webkit layout test for Arabic alignment as soon as we find a font that can be included in Webkit LayoutTests. BUG=105685 TEST= http://www.bbcarabic.com should be rendered the same way as is done by Firefox on Linux. Paragraphs should be right justified and should not overlap with photos or other elements next to them. See the screenshots attached in the bug report. TBR=bashik Review URL: https://chromiumcodereview.appspot.com/10382212 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138001 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party')
-rw-r--r--third_party/harfbuzz/README.chromium2
-rw-r--r--third_party/harfbuzz/chromium.patch23
-rw-r--r--third_party/harfbuzz/src/harfbuzz-shaper.cpp8
3 files changed, 27 insertions, 6 deletions
diff --git a/third_party/harfbuzz/README.chromium b/third_party/harfbuzz/README.chromium
index 14bdb34..d7ae968 100644
--- a/third_party/harfbuzz/README.chromium
+++ b/third_party/harfbuzz/README.chromium
@@ -18,3 +18,5 @@ changes against upstream; you must also apply any changes that you make to
the checked-in copy of the source.)
Added support for building on Android.
+
+The patch for Arabic alignment bug was added (bug 105685).
diff --git a/third_party/harfbuzz/chromium.patch b/third_party/harfbuzz/chromium.patch
index a2f44c8..eddf99a 100644
--- a/third_party/harfbuzz/chromium.patch
+++ b/third_party/harfbuzz/chromium.patch
@@ -133,3 +133,26 @@ index 847ac52..6f9a55b 100644
static const HB_OpenTypeFeature tibetan_features[] = {
{ HB_MAKE_TAG('c', 'c', 'm', 'p'), CcmpProperty },
+diff --git a/src/harfbuzz-shaper.cpp b/src/harfbuzz-shaper.cpp
+index ce4d4ac..6b4d6d2 100644
+--- a/src/harfbuzz-shaper.cpp
++++ b/src/harfbuzz-shaper.cpp
+@@ -1263,16 +1263,13 @@ HB_Bool HB_OpenTypePosition(HB_ShaperItem *item, int availableGlyphs, HB_Bool do
+ // (int)(positions[i].x_pos >> 6), (int)(positions[i].y_pos >> 6),
+ // positions[i].back, positions[i].new_advance);
+
+- HB_Fixed adjustment = (item->item.bidiLevel % 2) ? -positions[i].x_advance : positions[i].x_advance;
++ HB_Fixed adjustment = positions[i].x_advance;
+
+ if (!(face->current_flags & HB_ShaperFlag_UseDesignMetrics))
+ adjustment = HB_FIXED_ROUND(adjustment);
+
+- if (positions[i].new_advance) {
+- advances[i] = adjustment;
+- } else {
++ if (positions[i].new_advance == 0)
+ advances[i] += adjustment;
+- }
+
+ int back = 0;
+ HB_FixedPoint *offsets = item->offsets;
diff --git a/third_party/harfbuzz/src/harfbuzz-shaper.cpp b/third_party/harfbuzz/src/harfbuzz-shaper.cpp
index 5999e08..5ca8078 100644
--- a/third_party/harfbuzz/src/harfbuzz-shaper.cpp
+++ b/third_party/harfbuzz/src/harfbuzz-shaper.cpp
@@ -1282,16 +1282,13 @@ HB_Bool HB_OpenTypePosition(HB_ShaperItem *item, int availableGlyphs, HB_Bool do
// (int)(positions[i].x_pos >> 6), (int)(positions[i].y_pos >> 6),
// positions[i].back, positions[i].new_advance);
- HB_Fixed adjustment = (item->item.bidiLevel % 2) ? -positions[i].x_advance : positions[i].x_advance;
+ HB_Fixed adjustment = positions[i].x_advance;
if (!(face->current_flags & HB_ShaperFlag_UseDesignMetrics))
adjustment = HB_FIXED_ROUND(adjustment);
- if (positions[i].new_advance) {
- advances[i] = adjustment;
- } else {
+ if (positions[i].new_advance == 0)
advances[i] += adjustment;
- }
int back = 0;
HB_FixedPoint *offsets = item->offsets;
@@ -1354,4 +1351,3 @@ HB_Bool HB_ShapeItem(HB_ShaperItem *shaper_item)
shaper_item->glyphIndicesPresent = false;
return result;
}
-