From d5e61470fa8e5046c35a79988e00e012ae4fff0f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 5 Aug 2014 14:19:01 -0400 Subject: [PATCH] [arabic] Fix fallback shaping regression Was broken in 615d00ea252739da57edbd980ff27e573. Fixes https://github.com/behdad/harfbuzz/pull/48 Micro-test added. --- src/hb-ot-shape-complex-arabic.cc | 4 ++-- test/shaping/Makefile.am | 1 + test/shaping/fonts/sha1sum/MANIFEST | 1 + .../df768b9c257e0c9c35786c47cae15c46571d56be.ttf | Bin 0 -> 6332 bytes test/shaping/tests/MANIFEST | 1 + test/shaping/tests/arabic-fallback-shaping.tests | 1 + 6 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 test/shaping/fonts/sha1sum/df768b9c257e0c9c35786c47cae15c46571d56be.ttf create mode 100644 test/shaping/tests/arabic-fallback-shaping.tests diff --git a/src/hb-ot-shape-complex-arabic.cc b/src/hb-ot-shape-complex-arabic.cc index 6cf1a7f59..ae9086412 100644 --- a/src/hb-ot-shape-complex-arabic.cc +++ b/src/hb-ot-shape-complex-arabic.cc @@ -223,8 +223,8 @@ data_create_arabic (const hb_ot_shape_plan_t *plan) for (unsigned int i = 0; i < ARABIC_NUM_FEATURES; i++) { arabic_plan->mask_array[i] = plan->map.get_1_mask (arabic_features[i]); arabic_plan->do_fallback = arabic_plan->do_fallback && - !FEATURE_IS_SYRIAC (arabic_features[i]) && - plan->map.needs_fallback (arabic_features[i]); + (FEATURE_IS_SYRIAC (arabic_features[i]) || + plan->map.needs_fallback (arabic_features[i])); } return arabic_plan; diff --git a/test/shaping/Makefile.am b/test/shaping/Makefile.am index 9e825133a..e2dcc98ef 100644 --- a/test/shaping/Makefile.am +++ b/test/shaping/Makefile.am @@ -36,6 +36,7 @@ CLEANFILES += \ $(NULL) TESTS = \ + tests/arabic-fallback-shaping.tests \ tests/arabic-feature-order.tests \ tests/context-matching.tests \ tests/hangul-jamo.tests \ diff --git a/test/shaping/fonts/sha1sum/MANIFEST b/test/shaping/fonts/sha1sum/MANIFEST index a8ca117f1..c51639b61 100644 --- a/test/shaping/fonts/sha1sum/MANIFEST +++ b/test/shaping/fonts/sha1sum/MANIFEST @@ -12,6 +12,7 @@ a919b33197965846f21074b24e30250d67277bce.ttf bb29ce50df2bdba2d10726427c6b7609bf460e04.ttf bb9473d2403488714043bcfb946c9f78b86ad627.ttf d629e7fedc0b350222d7987345fe61613fa3929a.ttf +df768b9c257e0c9c35786c47cae15c46571d56be.ttf e207635780b42f898d58654b65098763e340f5c7.ttf ef86fe710cfea877bbe0dbb6946a1f88d0661031.ttf f499fbc23865022234775c43503bba2e63978fe1.ttf diff --git a/test/shaping/fonts/sha1sum/df768b9c257e0c9c35786c47cae15c46571d56be.ttf b/test/shaping/fonts/sha1sum/df768b9c257e0c9c35786c47cae15c46571d56be.ttf new file mode 100644 index 0000000000000000000000000000000000000000..c6d8b18e7f049a1b68eaecdaeb92bebbf3abc57d GIT binary patch literal 6332 zcmbtYdsrLSl|OezGZK;zdW;@M2u6&M009C7$Y3zTLjp|9!`Q9_c0d>~IDQag=g~L` z`C`XjId;rVyKS@CWWQ~xt-JT$IrD${ zlkZ^v5`bxOb~-(!`>^30fca(QHO(T!wNw8J>K{TnFuU*29qIqo??w4!pre|q1v?p^b*0o+AM56vG~IP|5dcOO6+<)nT7;Pm{? z@BX9&?e(C14hSqQUn0-*ZBPKV7dflV44ebn+iiBzTvto%PAjWt7&g?<6mz-VWS_;h zpDXn;n@8M2SogEsp03={+6gvrmF^zCE%(mV%G{G}&WD6s z)8r=R7Shp=E1bF7n`dE5AOW*-Q*}k-2C1maD%kT_)^06ofL+4eY>x%HkmMq#m;8w@pn!Lw&(9{ zDCb|wEnV&X;NSXhJ>uLQKl|#ygCk^g;ht3LO^?T2GdVx*A@Z`t#`|ukW0Lzz_FL5s-Zf!6oM_fXFOIc}QRe3{0A)BvjH*6H` zqCFNV;EahB=ZKXjQn6SIi;;rB0fvPJQ53O4`w}nC4Is}&UMA>>ZXFWX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