[coretext] Use vertical advance for notdef in vertical direction
authorBehdad Esfahbod <behdad@behdad.org>
Thu, 22 Jan 2015 00:42:09 +0000 (16:42 -0800)
committerBehdad Esfahbod <behdad@behdad.org>
Thu, 22 Jan 2015 02:51:42 +0000 (18:51 -0800)
src/hb-coretext.cc

index 11629cc..64ceb44 100644 (file)
@@ -861,7 +861,12 @@ retry:
          hb_glyph_info_t *info = buffer->info + buffer->len;
 
          CGGlyph notdef = 0;
-         double advance = CTFontGetAdvancesForGlyphs (font_data->ct_font, kCTFontHorizontalOrientation, &notdef, NULL, 1);
+         double advance = CTFontGetAdvancesForGlyphs (font_data->ct_font,
+                                                      HB_DIRECTION_IS_HORIZONTAL (buffer->props.direction) ?
+                                                      kCTFontHorizontalOrientation :
+                                                      kCTFontVerticalOrientation,
+                                                      &notdef, NULL, 1);
+         /* XXX adjust sign / scale of advance. */
 
          unsigned int old_len = buffer->len;
          for (CFIndex j = range.location; j < range.location + range.length; j++)