bug 654057 - fix the zeroing of diacritic widths to resolve misplaced accents with Segoe UI. r=jdaggett
authorJonathan Kew <jfkthame@gmail.com>
Wed, 11 May 2011 20:24:56 +0100
changeset 69355 800a2d46bb4e39da16583172d738bf44a2c8a236
parent 69354 c6c669e643b585766ca01f40aa33ea35f0eaed82
child 69356 427fa3603d4c19dda278b996c6777297fea6ae37
push id19937
push userjkew@mozilla.com
push dateWed, 11 May 2011 19:26:49 +0000
treeherdermozilla-central@427fa3603d4c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdaggett
bugs654057
milestone6.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 654057 - fix the zeroing of diacritic widths to resolve misplaced accents with Segoe UI. r=jdaggett
gfx/harfbuzz/src/hb-ot-layout.cc
--- a/gfx/harfbuzz/src/hb-ot-layout.cc
+++ b/gfx/harfbuzz/src/hb-ot-layout.cc
@@ -478,46 +478,26 @@ hb_ot_layout_position_lookup   (hb_font_
 
 void
 hb_ot_layout_position_finish (hb_face_t *face, hb_buffer_t *buffer)
 {
   /* force diacritics to have zero width */
   unsigned int count = buffer->len;
   if (hb_ot_layout_has_glyph_classes (face)) {
     const GDEF& gdef = _get_gdef (face);
-    if (buffer->props.direction == HB_DIRECTION_RTL) {
-      for (unsigned int i = 1; i < count; i++) {
-        if (gdef.get_glyph_class (buffer->info[i].codepoint) == GDEF::MarkGlyph) {
-          buffer->pos[i].x_advance = 0;
-        }
-      }
-    } else {
-      for (unsigned int i = 1; i < count; i++) {
-        if (gdef.get_glyph_class (buffer->info[i].codepoint) == GDEF::MarkGlyph) {
-          hb_glyph_position_t& pos = buffer->pos[i];
-          pos.x_offset -= pos.x_advance;
-          pos.x_advance = 0;
-        }
+    for (unsigned int i = 1; i < count; i++) {
+      if (gdef.get_glyph_class (buffer->info[i].codepoint) == GDEF::MarkGlyph) {
+        buffer->pos[i].x_advance = 0;
       }
     }
   } else {
     /* no GDEF classes available, so use General Category as a fallback */
-    if (buffer->props.direction == HB_DIRECTION_RTL) {
-      for (unsigned int i = 1; i < count; i++) {
-        if (buffer->info[i].general_category() == HB_CATEGORY_NON_SPACING_MARK) {
-          buffer->pos[i].x_advance = 0;
-        }
-      }
-    } else {
-      for (unsigned int i = 1; i < count; i++) {
-        if (buffer->info[i].general_category() == HB_CATEGORY_NON_SPACING_MARK) {
-          hb_glyph_position_t& pos = buffer->pos[i];
-          pos.x_offset -= pos.x_advance;
-          pos.x_advance = 0;
-        }
+    for (unsigned int i = 1; i < count; i++) {
+      if (buffer->info[i].general_category() == HB_CATEGORY_NON_SPACING_MARK) {
+        buffer->pos[i].x_advance = 0;
       }
     }
   }
 
   GPOS::position_finish (buffer);
 }