From da5118da77898ae4778af1ace4af52334b210dd6 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Fri, 16 Aug 2019 00:48:26 +0200 Subject: [PATCH] [ot-shape] Enable abvm/blwm features by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Core Text seems to apply them to Latin text, but Uniscribe doesn’t. See https://github.com/harfbuzz/harfbuzz/pull/1908#issuecomment-521819343 --- src/hb-ot-shape-complex-indic.cc | 9 -------- src/hb-ot-shape-complex-khmer.cc | 9 -------- src/hb-ot-shape-complex-myanmar.cc | 21 ------------------ src/hb-ot-shape-complex-use.cc | 14 ------------ src/hb-ot-shape.cc | 2 ++ test/shaping/data/in-house/Makefile.sources | 2 +- ...3f63620511b2097200d23774ffef197e829e69.ttf | Bin 0 -> 1804 bytes ...9eb71df4e4c9c273b67b89a06e5ff9e3c1f834.ttf | Bin 0 -> 1860 bytes test/shaping/data/in-house/tests/dist.tests | 1 - .../in-house/tests/positioning-features.tests | 3 +++ 10 files changed, 6 insertions(+), 55 deletions(-) create mode 100644 test/shaping/data/in-house/fonts/ea3f63620511b2097200d23774ffef197e829e69.ttf create mode 100644 test/shaping/data/in-house/fonts/f79eb71df4e4c9c273b67b89a06e5ff9e3c1f834.ttf delete mode 100644 test/shaping/data/in-house/tests/dist.tests create mode 100644 test/shaping/data/in-house/tests/positioning-features.tests diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index 7c9205a8..a04c9207 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -131,12 +131,6 @@ indic_features[] = {HB_TAG('b','l','w','s'), F_GLOBAL_MANUAL_JOINERS}, {HB_TAG('p','s','t','s'), F_GLOBAL_MANUAL_JOINERS}, {HB_TAG('h','a','l','n'), F_GLOBAL_MANUAL_JOINERS}, - /* - * Positioning features. - * We don't care about the types. - */ - {HB_TAG('a','b','v','m'), F_GLOBAL}, - {HB_TAG('b','l','w','m'), F_GLOBAL}, }; /* @@ -162,9 +156,6 @@ enum { _INDIC_PSTS, _INDIC_HALN, - _INDIC_ABVM, - _INDIC_BLWM, - INDIC_NUM_FEATURES, INDIC_BASIC_FEATURES = INDIC_INIT, /* Don't forget to update this! */ }; diff --git a/src/hb-ot-shape-complex-khmer.cc b/src/hb-ot-shape-complex-khmer.cc index 73921ed9..cd82900b 100644 --- a/src/hb-ot-shape-complex-khmer.cc +++ b/src/hb-ot-shape-complex-khmer.cc @@ -56,12 +56,6 @@ khmer_features[] = {HB_TAG('a','b','v','s'), F_GLOBAL_MANUAL_JOINERS}, {HB_TAG('b','l','w','s'), F_GLOBAL_MANUAL_JOINERS}, {HB_TAG('p','s','t','s'), F_GLOBAL_MANUAL_JOINERS}, - /* - * Positioning features. - * We don't care about the types. - */ - {HB_TAG('a','b','v','m'), F_GLOBAL}, - {HB_TAG('b','l','w','m'), F_GLOBAL}, }; /* @@ -79,9 +73,6 @@ enum { _KHMER_BLWS, _KHMER_PSTS, - _KHMER_ABVM, - _KHMER_BLWM, - KHMER_NUM_FEATURES, KHMER_BASIC_FEATURES = _KHMER_PRES, /* Don't forget to update this! */ }; diff --git a/src/hb-ot-shape-complex-myanmar.cc b/src/hb-ot-shape-complex-myanmar.cc index f734a337..8b9afa50 100644 --- a/src/hb-ot-shape-complex-myanmar.cc +++ b/src/hb-ot-shape-complex-myanmar.cc @@ -59,24 +59,6 @@ myanmar_other_features[] = HB_TAG('b','l','w','s'), HB_TAG('p','s','t','s'), }; -static const hb_tag_t -myanmar_positioning_features[] = -{ - /* - * Positioning features. - * We don't care about the types. - */ - /* Pre-release version of Windows 8 Myanmar font had abvm,blwm - * features. The released Windows 8 version of the font (as well - * as the released spec) used 'mark' instead. The Windows 8 - * shaper however didn't apply 'mark' but did apply 'mkmk'. - * Perhaps it applied abvm/blwm. This was fixed in a Windows 8 - * update, so now it applies mark/mkmk. We are guessing that - * it still applies abvm/blwm too. - */ - HB_TAG('a','b','v','m'), - HB_TAG('b','l','w','m'), -}; static void setup_syllables_myanmar (const hb_ot_shape_plan_t *plan, @@ -113,9 +95,6 @@ collect_features_myanmar (hb_ot_shape_planner_t *plan) for (unsigned int i = 0; i < ARRAY_LENGTH (myanmar_other_features); i++) map->enable_feature (myanmar_other_features[i], F_MANUAL_ZWJ); - - for (unsigned int i = 0; i < ARRAY_LENGTH (myanmar_positioning_features); i++) - map->enable_feature (myanmar_positioning_features[i]); } static void diff --git a/src/hb-ot-shape-complex-use.cc b/src/hb-ot-shape-complex-use.cc index 7f4b6f34..ffef685b 100644 --- a/src/hb-ot-shape-complex-use.cc +++ b/src/hb-ot-shape-complex-use.cc @@ -88,16 +88,6 @@ use_other_features[] = HB_TAG('p','r','e','s'), HB_TAG('p','s','t','s'), }; -static const hb_tag_t -use_positioning_features[] = -{ - /* - * Positioning features. - * We don't care about the types. - */ - HB_TAG('a','b','v','m'), - HB_TAG('b','l','w','m'), -}; static void setup_syllables_use (const hb_ot_shape_plan_t *plan, @@ -153,10 +143,6 @@ collect_features_use (hb_ot_shape_planner_t *plan) /* "Standard typographic presentation" */ for (unsigned int i = 0; i < ARRAY_LENGTH (use_other_features); i++) map->enable_feature (use_other_features[i], F_MANUAL_ZWJ); - - /* "Positional feature application" */ - for (unsigned int i = 0; i < ARRAY_LENGTH (use_positioning_features); i++) - map->enable_feature (use_positioning_features[i]); } struct use_shape_plan_t diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index cf40ff97..a1d9a239 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -285,6 +285,8 @@ hb_ot_shape_plan_t::position (hb_font_t *font, static const hb_ot_map_feature_t common_features[] = { + {HB_TAG('a','b','v','m'), F_GLOBAL}, + {HB_TAG('b','l','w','m'), F_GLOBAL}, {HB_TAG('c','c','m','p'), F_GLOBAL}, {HB_TAG('l','o','c','l'), F_GLOBAL}, {HB_TAG('m','a','r','k'), F_GLOBAL_MANUAL_JOINERS}, diff --git a/test/shaping/data/in-house/Makefile.sources b/test/shaping/data/in-house/Makefile.sources index f3a6a621..bf14a98c 100644 --- a/test/shaping/data/in-house/Makefile.sources +++ b/test/shaping/data/in-house/Makefile.sources @@ -14,7 +14,6 @@ TESTS = \ tests/context-matching.tests \ tests/cursive-positioning.tests \ tests/default-ignorables.tests \ - tests/dist.tests \ tests/emoji.tests \ tests/fallback-positioning.tests \ tests/hangul-jamo.tests \ @@ -42,6 +41,7 @@ TESTS = \ tests/myanmar-syllable.tests \ tests/myanmar-zawgyi.tests \ tests/none-directional.tests \ + tests/positioning-features.tests \ tests/rand.tests \ tests/spaces.tests \ tests/simple.tests \ diff --git a/test/shaping/data/in-house/fonts/ea3f63620511b2097200d23774ffef197e829e69.ttf b/test/shaping/data/in-house/fonts/ea3f63620511b2097200d23774ffef197e829e69.ttf new file mode 100644 index 0000000000000000000000000000000000000000..31d4e50368b828644f26e83af070ffb1bc57743f GIT binary patch literal 1804 zcma)7U1(cn7=F$<$w``aY1;gpH0`>Yc2Qz~@^{j9EzEYcp>)_{H?2~uX`24f{E=io zWfOWc6nCKmkqKUi3@^MC28tI7UMPYfDr|y!AzlbNDTpv(ZG66S(jP_z-^2HP@BjO} z-+6Na3BWOILBVWl;>k(8g(kqdKHKg zv5kvMR{{A;$}eT|>5}!A-NymtG0LN>xy_ZIJ}G@q{zt~2Tg#@G-FNO^qQA(WT%)3C z)pnb*$k(%$uU=N)t^Gxr_29}CGim&eYm{dxJM!tvB@9b{P>xXUDx~w-;QXkQ^_H3c zvr@5Az3WwfCEgy|2O+^ybIH2wM<1Z+v1D>k35B}5^|-e?==Eq?r>s#onA8(>rD{{0 zN_S}DS-s_BXUB16TN$-aIovMAra8_uj4R(L$2(hY1|lQ#>q{Z{0 zHW+txobLSG?~aDUosr#zsfD+x7p*AF15UXM@Hd_EJzVH7r6;&JaQ z0e{cUCcm%oPfc?>tf!r=HoMOmv)dBhubbTM?(4y}_Hb)(OFHIl35S~-8+{F>wqCb8 z8dz*@vv-BVZIAr(^2ydP`V)N+V zkd)tq`8(&pEph&E<=P87)4Nw3_bh&js_+#g&tp;6VUgWJs@)KIEWNv&p+@h{^va_K@lZvGIAZOv{s2Vh6txkCzqnNNPP}j zN>eBxgMM;j)Z}=97u3xEEAJw&moZ6EawndEoV0n$fc_VMu~WE-o!+TI?6`2 zT!3dOcPWoRej~rZ8#6PBUE1@49izBPe>-({o|8tVAcD*!ay?8URyLNXC}Jf3L$q=a zAjIA5$@CCaRB8mtIS5Xo4fRaIrxl&t%}fUw`1Pg^BA(t3-u>DC haUbGc5pg=5tHN2yXG+E`o0!aA)H+797lGG&@Gr}-0{s90 literal 0 HcmV?d00001 diff --git a/test/shaping/data/in-house/fonts/f79eb71df4e4c9c273b67b89a06e5ff9e3c1f834.ttf b/test/shaping/data/in-house/fonts/f79eb71df4e4c9c273b67b89a06e5ff9e3c1f834.ttf new file mode 100644 index 0000000000000000000000000000000000000000..be48fd0c9299933b92f06f263c7bd091fdb64140 GIT binary patch literal 1860 zcma)6T})eL7=FHU+QM+_25o8AKw$+Ib||H^l(9kLevqnN27{rvL}r2VGg=_DTed85 zOWcJqUhHB<8vky*TH;8I(Z!h2`n=~9#D$A}C+B?c z^Zq{X_j8~CY{7Zx7)bO!)rZ$n3E1DFwkI*rKXmrZ)G+Z~;%^f}!w0^Ld~^qJTqnNV zKhzeTJu#L6w7-d88qcN{?B5ic0DVN_r!r?If4S?sN%?0$ot{poCS2b?_>=w@sOy}j zV)InlEn>;vIGxR(-h6>vpnXE@%gm3b)NK_c&J#PcsnZMSR`-dI64%eAvgzPRkCXK- zG5==^^SS)XH?Mz1zG6QJg&Nx4(1Lgph{a>k&Uj_V&W46~%p2?Mj76(UlgHz(j>S9; zVhlPQ8^f9{!Isbt{puEbAQ_Gvc9jQ?gbzL664aO4_8Jk7C4{2Y?K^a1dz{@fOe5v!PR%*H~8=n9urYf8fCDV(jeyW z9&SQ*TKqL&dE(OB$G7(U1*P8;pF7UBcV+(J>?=R6BnxLNmTf*l)(|a2MlhHxKxU31v& znkH=bOSRRJ=`9kov)i;>CjCr_e^RNYm$Mh32QE1 zdieV~mSs35QMOIAkMgx-#T=t0S%VXcC0R!o&X;5x8gaWM+cC|XXT>@YRK2_t^H{(c zM$TZ0);zgJ5kWiRloGVgQ=dVa=o#+NIKq_nQOvIawlYmtq~wnJgbUOBsouVF5T;1-aVdYt5z?=ip3@oywY7rIJ-k<9Y3%S2?}PIs44W z00NXteU?0hnf1u26>p2B%$s>LAZiFf>@#g4^ak9SB&uQ#Ocku6~ zv_AZ5<^w9o