[HarfBuzz] harfbuzz: Branch 'master' - 3 commits

Behdad Esfahbod behdad at kemper.freedesktop.org
Tue Aug 12 16:18:01 PDT 2014


 src/hb-coretext.cc |   24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

New commits:
commit 1b3011c27df531875d432e909ae6b77f115c5017
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Aug 12 19:17:19 2014 -0400

    [coretext] Pass buffer language to CoreText

diff --git a/src/hb-coretext.cc b/src/hb-coretext.cc
index 53adc81..06e001c 100644
--- a/src/hb-coretext.cc
+++ b/src/hb-coretext.cc
@@ -698,6 +698,18 @@ retry:
 	CFAttributedStringSetAttribute (attr_string, CFRangeMake (0, chars_len),
 					kCTVerticalFormsAttributeName, kCFBooleanTrue);
       }
+      if (buffer->props.language)
+      {
+        CFStringRef lang = CFStringCreateWithCStringNoCopy (kCFAllocatorDefault,
+							    hb_language_to_string (buffer->props.language),
+							    kCFStringEncodingUTF8,
+							    kCFAllocatorNull);
+	if (unlikely (!lang))
+	  FAIL ("CFStringCreateWithCStringNoCopy failed");
+	CFAttributedStringSetAttribute (attr_string, CFRangeMake (0, chars_len),
+					kCTLanguageAttributeName, lang);
+	CFRelease (lang);
+      }
       CFAttributedStringSetAttribute (attr_string, CFRangeMake (0, chars_len),
 				      kCTFontAttributeName, font_data->ct_font);
 
commit 3eb6a4dbf25b11fce5e0e426e89f7457887aeca0
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Aug 12 19:10:33 2014 -0400

    [coretext] Minor

diff --git a/src/hb-coretext.cc b/src/hb-coretext.cc
index f08aec5..53adc81 100644
--- a/src/hb-coretext.cc
+++ b/src/hb-coretext.cc
@@ -693,10 +693,11 @@ retry:
       if (unlikely (!attr_string))
 	FAIL ("CFAttributedStringCreateMutable failed");
       CFAttributedStringReplaceString (attr_string, CFRangeMake (0, 0), string_ref);
-      CFAttributedStringSetAttribute (attr_string, CFRangeMake (0, chars_len),
-				      kCTVerticalFormsAttributeName,
-				      HB_DIRECTION_IS_VERTICAL (buffer->props.direction) ?
-				      kCFBooleanTrue : kCFBooleanFalse);
+      if (HB_DIRECTION_IS_VERTICAL (buffer->props.direction))
+      {
+	CFAttributedStringSetAttribute (attr_string, CFRangeMake (0, chars_len),
+					kCTVerticalFormsAttributeName, kCFBooleanTrue);
+      }
       CFAttributedStringSetAttribute (attr_string, CFRangeMake (0, chars_len),
 				      kCTFontAttributeName, font_data->ct_font);
 
commit 08acfe0d3a1d8223a9fa0696703fff63d6c2ea8b
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Aug 12 18:57:08 2014 -0400

    [hb-coretext] Fix cluster order of notdef runs in RTL text

diff --git a/src/hb-coretext.cc b/src/hb-coretext.cc
index fe5f31b..f08aec5 100644
--- a/src/hb-coretext.cc
+++ b/src/hb-coretext.cc
@@ -843,6 +843,7 @@ retry:
 	  CGGlyph notdef = 0;
 	  double advance = CTFontGetAdvancesForGlyphs (font_data->ct_font, kCTFontHorizontalOrientation, &notdef, NULL, 1);
 
+	  unsigned int old_len = buffer->len;
 	  for (CFIndex j = range.location; j < range.location + range.length; j++)
 	  {
 	      UniChar ch = CFStringGetCharacterAtIndex (string_ref, j);
@@ -865,6 +866,8 @@ retry:
 	      info++;
 	      buffer->len++;
 	  }
+	  if (HB_DIRECTION_IS_BACKWARD (buffer->props.direction))
+	    buffer->reverse_range (old_len, buffer->len);
 	  continue;
 	}
       }


More information about the HarfBuzz mailing list