[HarfBuzz] harfbuzz: Branch 'master' - 3 commits
Behdad Esfahbod
behdad at kemper.freedesktop.org
Fri Nov 6 16:31:19 PST 2015
src/hb-ot-layout.cc | 2
src/hb-ot-shape-complex-arabic.cc | 26 +++++++++-
src/hb-unicode-private.hh | 20 -------
test/shaping/texts/in-tree/shaper-arabic/script-syriac/misc/abbreviation-mark.txt | 4 -
4 files changed, 27 insertions(+), 25 deletions(-)
New commits:
commit 04ff23e73d847ab3a5da0e9fac4fbca19aefd284
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Fri Nov 6 16:29:44 2015 -0800
[arabic] Improve stretch length calculation
Err on the side of being too short, than too wide. Reduces chance
of overlaps with neighboring glyphs.
diff --git a/src/hb-ot-shape-complex-arabic.cc b/src/hb-ot-shape-complex-arabic.cc
index a3f528d..575ab61 100644
--- a/src/hb-ot-shape-complex-arabic.cc
+++ b/src/hb-ot-shape-complex-arabic.cc
@@ -541,7 +541,7 @@ apply_stch (const hb_ot_shape_plan_t *plan,
hb_position_t w_remaining = w_total - w_fixed - overlap;
if (sign * w_remaining > sign * w_repeating && sign * w_repeating > 0)
- n_copies = (sign * w_remaining + sign * w_repeating / 2) / (sign * w_repeating) - 1;
+ n_copies = (sign * w_remaining + sign * w_repeating / 4) / (sign * w_repeating) - 1;
if (step == MEASURE)
{
commit 59821ab8b413df3a444c38b80582a5137e364a70
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Fri Nov 6 16:27:44 2015 -0800
[arabic] Don't stretch over cased letters
Addresses
https://github.com/behdad/harfbuzz/commit/6e6f82b6f3dde0fc6c3c7d991d9ec6cfff57823d#commitcomment-14248516
diff --git a/src/hb-ot-shape-complex-arabic.cc b/src/hb-ot-shape-complex-arabic.cc
index 31e0a11..a3f528d 100644
--- a/src/hb-ot-shape-complex-arabic.cc
+++ b/src/hb-ot-shape-complex-arabic.cc
@@ -38,6 +38,28 @@
#define HB_BUFFER_SCRATCH_FLAG_ARABIC_HAS_STCH HB_BUFFER_SCRATCH_FLAG_COMPLEX0
+/* See:
+ * https://github.com/behdad/harfbuzz/commit/6e6f82b6f3dde0fc6c3c7d991d9ec6cfff57823d#commitcomment-14248516 */
+#define HB_ARABIC_GENERAL_CATEGORY_IS_WORD(gen_cat) \
+ (FLAG_SAFE (gen_cat) & \
+ (FLAG (HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED) | \
+ FLAG (HB_UNICODE_GENERAL_CATEGORY_PRIVATE_USE) | \
+ /*FLAG (HB_UNICODE_GENERAL_CATEGORY_LOWERCASE_LETTER) |*/ \
+ FLAG (HB_UNICODE_GENERAL_CATEGORY_MODIFIER_LETTER) | \
+ FLAG (HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER) | \
+ /*FLAG (HB_UNICODE_GENERAL_CATEGORY_TITLECASE_LETTER) |*/ \
+ /*FLAG (HB_UNICODE_GENERAL_CATEGORY_UPPERCASE_LETTER) |*/ \
+ FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) | \
+ FLAG (HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) | \
+ FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) | \
+ FLAG (HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER) | \
+ FLAG (HB_UNICODE_GENERAL_CATEGORY_LETTER_NUMBER) | \
+ FLAG (HB_UNICODE_GENERAL_CATEGORY_OTHER_NUMBER) | \
+ FLAG (HB_UNICODE_GENERAL_CATEGORY_CURRENCY_SYMBOL) | \
+ FLAG (HB_UNICODE_GENERAL_CATEGORY_MODIFIER_SYMBOL) | \
+ FLAG (HB_UNICODE_GENERAL_CATEGORY_MATH_SYMBOL) | \
+ FLAG (HB_UNICODE_GENERAL_CATEGORY_OTHER_SYMBOL)))
+
/*
* Joining types:
@@ -501,7 +523,7 @@ apply_stch (const hb_ot_shape_plan_t *plan,
while (context &&
!hb_in_range<unsigned> (info[context - 1].arabic_shaping_action(), STCH_FIXED, STCH_REPEATING) &&
(_hb_glyph_info_is_default_ignorable (&info[context - 1]) ||
- HB_UNICODE_GENERAL_CATEGORY_IS_WORD (_hb_glyph_info_get_general_category (&info[context - 1]))))
+ HB_ARABIC_GENERAL_CATEGORY_IS_WORD (_hb_glyph_info_get_general_category (&info[context - 1]))))
{
context--;
w_total += pos[context].x_advance;
diff --git a/src/hb-unicode-private.hh b/src/hb-unicode-private.hh
index 5d544ec..ecbec51 100644
--- a/src/hb-unicode-private.hh
+++ b/src/hb-unicode-private.hh
@@ -362,24 +362,4 @@ extern HB_INTERNAL const hb_unicode_funcs_t _hb_unicode_funcs_nil;
(FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) | \
FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)))
-#define HB_UNICODE_GENERAL_CATEGORY_IS_WORD(gen_cat) \
- (FLAG_SAFE (gen_cat) & \
- (FLAG (HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED) | \
- FLAG (HB_UNICODE_GENERAL_CATEGORY_PRIVATE_USE) | \
- FLAG (HB_UNICODE_GENERAL_CATEGORY_LOWERCASE_LETTER) | \
- FLAG (HB_UNICODE_GENERAL_CATEGORY_MODIFIER_LETTER) | \
- FLAG (HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER) | \
- FLAG (HB_UNICODE_GENERAL_CATEGORY_TITLECASE_LETTER) | \
- FLAG (HB_UNICODE_GENERAL_CATEGORY_UPPERCASE_LETTER) | \
- FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) | \
- FLAG (HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) | \
- FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) | \
- FLAG (HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER) | \
- FLAG (HB_UNICODE_GENERAL_CATEGORY_LETTER_NUMBER) | \
- FLAG (HB_UNICODE_GENERAL_CATEGORY_OTHER_NUMBER) | \
- FLAG (HB_UNICODE_GENERAL_CATEGORY_CURRENCY_SYMBOL) | \
- FLAG (HB_UNICODE_GENERAL_CATEGORY_MODIFIER_SYMBOL) | \
- FLAG (HB_UNICODE_GENERAL_CATEGORY_MATH_SYMBOL) | \
- FLAG (HB_UNICODE_GENERAL_CATEGORY_OTHER_SYMBOL)))
-
#endif /* HB_UNICODE_PRIVATE_HH */
diff --git a/test/shaping/texts/in-tree/shaper-arabic/script-syriac/misc/abbreviation-mark.txt b/test/shaping/texts/in-tree/shaper-arabic/script-syriac/misc/abbreviation-mark.txt
index 80a568c..a450678 100644
--- a/test/shaping/texts/in-tree/shaper-arabic/script-syriac/misc/abbreviation-mark.txt
+++ b/test/shaping/texts/in-tree/shaper-arabic/script-syriac/misc/abbreviation-mark.txt
@@ -5,7 +5,7 @@
ܐܒܓܕ
ܐܒܓܕܐ
ܐܒܓܕܐܐܐܐܐܐܐܐܐ
+ܐܒܓܕܐܐܐܐܐܐܐܐܐ
ܐܒܓܕܓܓܓܓܓܓ
ܐܒܓ
-
-
+ܫܘabcܒ.
commit 5337db29af39084d677a63154f404eca0c20cfeb
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Fri Nov 6 16:18:09 2015 -0800
Revert "Don't process lookups if buffer is in error"
This reverts commit f92bd86cc8c11d262d1830c631cb7c63fc9d4bc8.
We don't want to be like cairo, where as soon as there's an error,
nothing works anymore. So, lets process lookups as long as there's
no new memory needed. That's also a model that hides fewer bugs.
diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc
index 4111004..275a960 100644
--- a/src/hb-ot-layout.cc
+++ b/src/hb-ot-layout.cc
@@ -954,7 +954,7 @@ apply_string (OT::hb_apply_context_t *c,
{
hb_buffer_t *buffer = c->buffer;
- if (unlikely (buffer->in_error || !buffer->len || !c->lookup_mask))
+ if (unlikely (!buffer->len || !c->lookup_mask))
return;
c->set_lookup_props (lookup.get_props ());
More information about the HarfBuzz
mailing list