[HarfBuzz] harfbuzz-ng: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Wed Jun 2 19:31:49 PDT 2010


 src/hb-ot-shape.cc |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

New commits:
commit a224b4d502d026fa642ee4098bf7bc0b4ba7ce27
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Jun 2 22:24:54 2010 -0400

    Fix skipping variation-selectors

diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc
index 705d1f5..77724ce 100644
--- a/src/hb-ot-shape.cc
+++ b/src/hb-ot-shape.cc
@@ -474,16 +474,18 @@ hb_map_glyphs (hb_font_t    *font,
   if (unlikely (!buffer->len))
     return;
 
+  buffer->clear_output ();
   unsigned int count = buffer->len - 1;
-  for (unsigned int i = 0; i < count; i++) {
-    if (unlikely (is_variation_selector (buffer->info[i + 1].codepoint))) {
-      buffer->info[i].codepoint = hb_font_get_glyph (font, face, buffer->info[i].codepoint, buffer->info[i + 1].codepoint);
-      i++;
+  for (buffer->i = 0; buffer->i < count;) {
+    if (unlikely (is_variation_selector (buffer->info[buffer->i + 1].codepoint))) {
+      buffer->add_output_glyph (hb_font_get_glyph (font, face, buffer->info[buffer->i].codepoint, buffer->info[buffer->i + 1].codepoint));
+      buffer->i++;
     } else {
-      buffer->info[i].codepoint = hb_font_get_glyph (font, face, buffer->info[i].codepoint, 0);
+      buffer->add_output_glyph (hb_font_get_glyph (font, face, buffer->info[buffer->i].codepoint, 0));
     }
   }
-  buffer->info[count].codepoint = hb_font_get_glyph (font, face, buffer->info[count].codepoint, 0);
+  buffer->add_output_glyph (hb_font_get_glyph (font, face, buffer->info[buffer->i].codepoint, 0));
+  buffer->swap ();
 }
 
 static void



More information about the HarfBuzz mailing list