diff -Nru harfbuzz-2.5.3/ChangeLog harfbuzz-2.6.2/ChangeLog --- harfbuzz-2.5.3/ChangeLog 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/ChangeLog 2019-10-26 02:02:55.000000000 +0000 @@ -1,3 +1,3833 @@ +commit e48ef0804ad7e4abd35ff3646fa6ed10ad32f1ef +Author: Behdad Esfahbod +Date: Mon Sep 30 12:39:06 2019 -0700 + + 2.6.2 + + NEWS | 6 ++++++ + configure.ac | 2 +- + src/hb-version.h | 4 ++-- + 3 files changed, 9 insertions(+), 3 deletions(-) + +commit d6ad613159aabce42fc21d57f6f1a4762c5617bf +Author: Behdad Esfahbod +Date: Tue Sep 10 15:31:44 2019 -0700 + + [docs] Misc fixes + + docs/harfbuzz-sections.txt | 4 ++-- + src/hb-gdi.cc | 2 +- + src/hb-ot-layout.cc | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +commit 2dce85ed06a8cc7ca20900c65662af659c53e717 +Author: Ebrahim Byagowi +Date: Thu Sep 26 21:15:59 2019 +0330 + + [icu] Remove HB_ICU_STMT (#1993) + + And ignore extra semicolon error to ICU versions < 65 + + src/hb-icu.cc | 43 ++++++++++++++++++++++++------------------- + 1 file changed, 24 insertions(+), 19 deletions(-) + +commit d6a83abd6a0c684bd9a27f593d5be388819022b7 +Author: Iceflower +Date: Thu Sep 26 11:42:11 2019 +0200 + + Define HB_UNUSED for clang + + src/hb.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c4567968cd175dc367ab951c9e3141ab5c03c2d6 +Author: Iceflower +Date: Thu Sep 26 11:35:27 2019 +0200 + + [dwrite] Fix extra semicolon issue + + src/hb-directwrite.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit b0c3eb06b64dcfcfee09a25dde8250804484f77d +Author: Qunxin Liu +Date: Wed Sep 18 16:11:44 2019 -0700 + + [subset] GPOS Lookup Type 3: CursivePos + + src/hb-ot-layout-common.hh | 33 ++++++++ + src/hb-ot-layout-gpos-table.hh | 87 ++++++++++++++++++++- + test/subset/data/Makefile.am | 1 + + test/subset/data/Makefile.sources | 1 + + .../gpos3_font3.keep-layout-retain-gids.28,29.otf | Bin 0 -> 1712 bytes + .../gpos3_font3.keep-layout-retain-gids.28,2B.otf | Bin 0 -> 1860 bytes + .../gpos3_font3.keep-layout-retain-gids.29,2B.otf | Bin 0 -> 1772 bytes + ...eep-layout-retain-gids.retain-all-codepoint.otf | Bin 0 -> 3692 bytes + .../layout.gpos3/gpos3_font3.keep-layout.28,29.otf | Bin 0 -> 1328 bytes + .../layout.gpos3/gpos3_font3.keep-layout.28,2B.otf | Bin 0 -> 1456 bytes + .../layout.gpos3/gpos3_font3.keep-layout.29,2B.otf | Bin 0 -> 1368 bytes + ...pos3_font3.keep-layout.retain-all-codepoint.otf | Bin 0 -> 3692 bytes + test/subset/data/fonts/gpos3_font3.otf | Bin 0 -> 4624 bytes + test/subset/data/tests/layout.gpos3.tests | 12 +++ + 14 files changed, 132 insertions(+), 2 deletions(-) + +commit 68d39ea4866a9d2bae60107619aad25dac6da241 +Author: Ebrahim Byagowi +Date: Tue Sep 24 13:52:46 2019 +0330 + + Revert previous change and fix -Wrange-loop-analysis complains + + src/hb-ot-layout-gpos-table.hh | 6 +++--- + src/hb-ot-vorg-table.hh | 2 +- + 2 files changed, 4 insertions(+), 4 deletions(-) + +commit cbc0646a6cfc0f6a04804d6888636f12130cd51b +Author: Ebrahim Byagowi +Date: Tue Sep 24 12:08:12 2019 +0330 + + Minor, normalize for each calls + + src/hb-ot-glyf-table.hh | 5 +---- + src/hb-ot-layout-gpos-table.hh | 10 +++++----- + src/hb-ot-name-table.hh | 3 +-- + src/hb-ot-vorg-table.hh | 3 +-- + 4 files changed, 8 insertions(+), 13 deletions(-) + +commit 22b6c6a5c7b9bebe123822c702b9661e144ebd6b +Author: Ebrahim Byagowi +Date: Tue Sep 24 12:06:28 2019 +0330 + + [serialize] use for each as #resolve_links, format + + src/hb-serialize.hh | 22 +++++++--------------- + 1 file changed, 7 insertions(+), 15 deletions(-) + +commit 512551f27600adac875de3381533b52d78f6b22d +Author: Qunxin Liu <48925186+qxliu76@users.noreply.github.com> +Date: Mon Sep 23 17:28:16 2019 -0700 + + memory leak fix in serializer (#1988) + + src/hb-serialize.hh | 1 + + 1 file changed, 1 insertion(+) + +commit f0a7677993e51ba4076a0f9a0e7d032d99917d34 +Author: Ebrahim Byagowi +Date: Mon Sep 23 21:09:39 2019 +0330 + + [gpos] minor + + src/hb-ot-layout-gpos-table.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 035ec3d1b46b8e60bea3aa8dcf29cf47a5a42d57 +Author: Ebrahim Byagowi +Date: Mon Sep 23 20:51:43 2019 +0330 + + [cmap] remove has_format14, minor format + + fixes #1986 + + src/hb-ot-cmap-table.hh | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +commit c1a585fab0c17fe47b0728cf67920791c2173019 +Author: Ebrahim Byagowi +Date: Sat Sep 21 23:30:52 2019 +0430 + + [gpos] minor + + src/hb-ot-layout-gpos-table.hh | 22 +++++++--------------- + 1 file changed, 7 insertions(+), 15 deletions(-) + +commit d87d38998a4ff7bec3d8fb658dc9299f144a2fcb +Author: Ebrahim Byagowi +Date: Sat Sep 21 17:27:39 2019 +0430 + + Fix clang -Wrange-loop-analysis complains + + ./hb-ot-layout-gpos-table.hh:674:43: error: loop variable '_' is always a copy because the range of type 'hb_zip_iter_t > &>, hb_iter_type > &> >' (aka 'hb_zip_iter_t >, hb_array_t > >') does not return a reference [-Werror,-Wrange-loop-analysis] + for (const hb_pair_t& _ : hb_zip (val_iter, first_val_iter)) + ^ + ./hb-ot-layout-gpos-table.hh:674:12: note: use non-reference type 'hb_pair_t' (aka 'hb_pair_t, IntType >') + for (const hb_pair_t& _ : hb_zip (val_iter, first_val_iter)) + + and + + In file included from hb-subset.cc:44: + ./hb-ot-vorg-table.hh:87:34: error: loop variable '_' is always a copy because the range of type 'hb_map_iter_t, const hb_set_t *, OT::HBGlyphID OT::VertOriginMetric::*, nullptr>, (lambda at ./hb-ot-vorg-table.hh:100:15), hb_function_sortedness_t::NOT_SORTED, nullptr>' does not return a reference [-Werror,-Wrange-loop-analysis] + for (const VertOriginMetric& _ : it) + ^ + ./hb-ot-vorg-table.hh:113:17: note: in instantiation of function template specialization 'OT::VORG::serialize, const hb_set_t *, OT::HBGlyphID OT::VertOriginMetric::*, nullptr>, (lambda at ./hb-ot-vorg-table.hh:100:15), hb_function_sortedness_t::NOT_SORTED, nullptr>, nullptr>' requested here + vorg_prime->serialize (c->serializer, it, defaultVertOriginY); + ^ + ./hb-ot-vorg-table.hh:87:10: note: use non-reference type 'OT::VertOriginMetric' + for (const VertOriginMetric& _ : it) + ^~~~~~~~~~~~~~~~~~~~~~~~~~~ + + src/hb-ot-layout-gpos-table.hh | 2 +- + src/hb-ot-vorg-table.hh | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 6e42a418c8fe4231c3cc080bc771455578b0cce0 +Author: Ebrahim Byagowi +Date: Sat Sep 21 16:25:54 2019 +0430 + + Minor, turn more of hb_apply to for each + + src/hb-ot-glyf-table.hh | 5 ++--- + src/hb-ot-layout-gpos-table.hh | 42 ++++++++++++++---------------------------- + src/hb-ot-name-table.hh | 5 ++--- + src/hb-ot-vorg-table.hh | 5 ++--- + 4 files changed, 20 insertions(+), 37 deletions(-) + +commit 0665dce1163317390adbed9394cce2b1325ddb6c +Author: Ebrahim Byagowi +Date: Sat Sep 21 17:22:02 2019 +0430 + + [fuzzer] Don't process output in debug mode as it causes timeout + + test/fuzzing/run-shape-fuzzer-tests.py | 7 ++++++- + test/fuzzing/run-subset-fuzzer-tests.py | 7 ++++++- + 2 files changed, 12 insertions(+), 2 deletions(-) + +commit dc886f6638f50e45e73d01e49db77b4bcefc85e1 +Author: Ebrahim Byagowi +Date: Sat Sep 14 11:18:47 2019 +0430 + + [ci] Re-enable debug builds on fedora bot + + .circleci/config.yml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 70228f68ac413ee19281861e3039a82d90c17f2a +Author: Ebrahim Byagowi +Date: Sat Sep 21 16:24:41 2019 +0430 + + [ci] Enable HB_WITH_WIN1256 on -Weverything bot + + To catch its compile warnings, #1969 related + + .circleci/config.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 385741d565de1cc90de23664f8e66fc77c31efae +Author: Ebrahim Byagowi +Date: Sat Sep 21 15:26:14 2019 +0430 + + [cmap] Turn hb_apply into foreach where possible + + src/hb-ot-cmap-table.hh | 151 +++++++++++++++++++----------------------------- + 1 file changed, 61 insertions(+), 90 deletions(-) + +commit 1023c2cc6de0f33602df8709134bef8cdb66ba0c +Author: Ebrahim Byagowi +Date: Sat Sep 21 14:33:43 2019 +0430 + + [cmap] minor + + src/hb-ot-cmap-table.hh | 62 ++++++++++++++++++------------------------------- + 1 file changed, 22 insertions(+), 40 deletions(-) + +commit ead46eefe3bf2bea61c86689f4c5a1da9b7e446b +Author: Ebrahim Byagowi +Date: Sat Sep 21 14:25:11 2019 +0430 + + minor, use internal API instead public hb_set_has + + src/hb-ot-cmap-table.hh | 4 ++-- + src/hb-subset-plan.cc | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit d8af4e7701fe63d63f6669706ce7a5bb3a15a19d +Author: Ebrahim Byagowi +Date: Sat Sep 21 14:19:14 2019 +0430 + + [cmap] minor, turn 8 spaces to tab + + src/hb-ot-cmap-table.hh | 228 ++++++++++++++++++++++++------------------------ + src/hb-subset-plan.cc | 6 +- + 2 files changed, 117 insertions(+), 117 deletions(-) + +commit 4315666283a7d1b175d1c3ed43b5ac85fdc84a50 +Author: Qunxin Liu +Date: Thu Aug 29 11:17:20 2019 -0700 + + [subset] updates according to review comments + + src/hb-ot-cmap-table.hh | 95 ++++++++++++++++++++++++------------------------- + 1 file changed, 47 insertions(+), 48 deletions(-) + +commit bf66d1bf589b6af2ceb30c18619f210b718c9db9 +Author: Qunxin Liu +Date: Wed Aug 21 14:24:33 2019 -0700 + + [subset] Add integration tests for cmap14 + + test/subset/data/Makefile.am | 1 + + test/subset/data/Makefile.sources | 1 + + .../cmap14/cmap14_font1.default.4E00,4E02,4E03.otf | Bin 0 -> 1360 bytes + .../cmap14/cmap14_font1.default.4E00,4E03.otf | Bin 0 -> 1236 bytes + .../cmap14/cmap14_font1.default.4E00,4E05,4E07.otf | Bin 0 -> 1328 bytes + .../cmap14/cmap14_font1.default.4E02,4E03,4E08.otf | Bin 0 -> 1576 bytes + .../expected/cmap14/cmap14_font1.default.4E02.otf | Bin 0 -> 996 bytes + .../expected/cmap14/cmap14_font1.default.4E03.otf | Bin 0 -> 1080 bytes + .../cmap14_font1.default.4E05,4E07,4E08,4E09.otf | Bin 0 -> 1848 bytes + .../cmap14/cmap14_font1.default.4E08,4E09.otf | Bin 0 -> 1720 bytes + .../expected/cmap14/cmap14_font1.default.4E08.otf | Bin 0 -> 1384 bytes + .../cmap14_font1.default.retain-all-codepoint.otf | Bin 0 -> 2348 bytes + ...font1.drop-hints-retain-gids.4E00,4E02,4E03.otf | Bin 0 -> 1388 bytes + ...ap14_font1.drop-hints-retain-gids.4E00,4E03.otf | Bin 0 -> 1272 bytes + ...font1.drop-hints-retain-gids.4E00,4E05,4E07.otf | Bin 0 -> 1396 bytes + ...font1.drop-hints-retain-gids.4E02,4E03,4E08.otf | Bin 0 -> 1720 bytes + .../cmap14_font1.drop-hints-retain-gids.4E02.otf | Bin 0 -> 1028 bytes + .../cmap14_font1.drop-hints-retain-gids.4E03.otf | Bin 0 -> 1124 bytes + ....drop-hints-retain-gids.4E05,4E07,4E08,4E09.otf | Bin 0 -> 1984 bytes + ...ap14_font1.drop-hints-retain-gids.4E08,4E09.otf | Bin 0 -> 1872 bytes + .../cmap14_font1.drop-hints-retain-gids.4E08.otf | Bin 0 -> 1544 bytes + ...drop-hints-retain-gids.retain-all-codepoint.otf | Bin 0 -> 2436 bytes + .../cmap14_font1.drop-hints.4E00,4E02,4E03.otf | Bin 0 -> 1292 bytes + .../cmap14/cmap14_font1.drop-hints.4E00,4E03.otf | Bin 0 -> 1168 bytes + .../cmap14_font1.drop-hints.4E00,4E05,4E07.otf | Bin 0 -> 1260 bytes + .../cmap14_font1.drop-hints.4E02,4E03,4E08.otf | Bin 0 -> 1512 bytes + .../cmap14/cmap14_font1.drop-hints.4E02.otf | Bin 0 -> 928 bytes + .../cmap14/cmap14_font1.drop-hints.4E03.otf | Bin 0 -> 1012 bytes + ...cmap14_font1.drop-hints.4E05,4E07,4E08,4E09.otf | Bin 0 -> 1780 bytes + .../cmap14/cmap14_font1.drop-hints.4E08,4E09.otf | Bin 0 -> 1652 bytes + .../cmap14/cmap14_font1.drop-hints.4E08.otf | Bin 0 -> 1316 bytes + ...map14_font1.drop-hints.retain-all-codepoint.otf | Bin 0 -> 2280 bytes + .../cmap14_font1.name-ids.4E00,4E02,4E03.otf | Bin 0 -> 1292 bytes + .../cmap14/cmap14_font1.name-ids.4E00,4E03.otf | Bin 0 -> 1168 bytes + .../cmap14_font1.name-ids.4E00,4E05,4E07.otf | Bin 0 -> 1260 bytes + .../cmap14_font1.name-ids.4E02,4E03,4E08.otf | Bin 0 -> 1508 bytes + .../expected/cmap14/cmap14_font1.name-ids.4E02.otf | Bin 0 -> 928 bytes + .../expected/cmap14/cmap14_font1.name-ids.4E03.otf | Bin 0 -> 1012 bytes + .../cmap14_font1.name-ids.4E05,4E07,4E08,4E09.otf | Bin 0 -> 1780 bytes + .../cmap14/cmap14_font1.name-ids.4E08,4E09.otf | Bin 0 -> 1652 bytes + .../expected/cmap14/cmap14_font1.name-ids.4E08.otf | Bin 0 -> 1316 bytes + .../cmap14_font1.name-ids.retain-all-codepoint.otf | Bin 0 -> 2280 bytes + .../cmap14_font1.retain-gids.4E00,4E02,4E03.otf | Bin 0 -> 1452 bytes + .../cmap14/cmap14_font1.retain-gids.4E00,4E03.otf | Bin 0 -> 1340 bytes + .../cmap14_font1.retain-gids.4E00,4E05,4E07.otf | Bin 0 -> 1464 bytes + .../cmap14_font1.retain-gids.4E02,4E03,4E08.otf | Bin 0 -> 1788 bytes + .../cmap14/cmap14_font1.retain-gids.4E02.otf | Bin 0 -> 1096 bytes + .../cmap14/cmap14_font1.retain-gids.4E03.otf | Bin 0 -> 1192 bytes + ...map14_font1.retain-gids.4E05,4E07,4E08,4E09.otf | Bin 0 -> 2048 bytes + .../cmap14/cmap14_font1.retain-gids.4E08,4E09.otf | Bin 0 -> 1940 bytes + .../cmap14/cmap14_font1.retain-gids.4E08.otf | Bin 0 -> 1608 bytes + ...ap14_font1.retain-gids.retain-all-codepoint.otf | Bin 0 -> 2500 bytes + test/subset/data/fonts/cmap14_font1.otf | Bin 0 -> 4484 bytes + test/subset/data/tests/cmap14.tests | 21 +++++++++++++++++++++ + 54 files changed, 23 insertions(+) + +commit 2583afa0eb90134274ddd92864ea5270eeebc52e +Author: Qunxin Liu +Date: Fri Aug 16 13:54:24 2019 -0700 + + [subset] subsetting cmap14 + + src/hb-ot-cmap-table.hh | 295 +++++++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 265 insertions(+), 30 deletions(-) + +commit 078ddbd0f6ad660e740809b7f4c067e02309b98d +Author: Qunxin Liu +Date: Wed Aug 7 13:17:26 2019 -0700 + + [subset] glyph closure for CMAP14 + + src/hb-ot-cmap-table.hh | 34 +++++++++++++++++++++++++++++++++- + src/hb-subset-plan.cc | 10 ++++++++++ + 2 files changed, 43 insertions(+), 1 deletion(-) + +commit bbe878006d347893fc70e282c2aaafef5dd622b4 +Author: Ebrahim Byagowi +Date: Wed Sep 18 22:22:01 2019 +0430 + + Avoid bitwise negate of enum value + + Fixes this -fno-sanitize-recover=undefined fail, + + hb-ot-map.hh:188:1: runtime error: load of value 4294967294, which is not a valid value for type 'hb_ot_map_feature_flags_t' + #0 0x7f62bfa9b227 in operator&=(hb_ot_map_feature_flags_t&, hb_ot_map_feature_flags_t) /home/ebrahim/Desktop/harfbuzz/src/./hb-ot-map.hh:188:1 + #1 0x7f62bfa9b227 in hb_ot_map_builder_t::compile(hb_ot_map_t&, hb_ot_shape_plan_key_t const&) /home/ebrahim/Desktop/harfbuzz/src/hb-ot-map.cc:194 + #2 0x7f62bface650 in hb_ot_shape_planner_t::compile(hb_ot_shape_plan_t&, hb_ot_shape_plan_key_t const&) /home/ebrahim/Desktop/harfbuzz/src/hb-ot-shape.cc:108:7 + #3 0x7f62bfacec1e in hb_ot_shape_plan_t::init0(hb_face_t*, hb_shape_plan_key_t const*) /home/ebrahim/Desktop/harfbuzz/src/hb-ot-shape.cc:225:11 + #4 0x7f62bfae1318 in hb_shape_plan_create2 /home/ebrahim/Desktop/harfbuzz/src/hb-shape-plan.cc:232:7 + #5 0x7f62bfae1d2a in hb_shape_plan_create_cached2 /home/ebrahim/Desktop/harfbuzz/src/hb-shape-plan.cc:489:33 + #6 0x7f62bfae2527 in hb_shape_full /home/ebrahim/Desktop/harfbuzz/src/hb-shape.cc:135:33 + #7 0x55ed360b6588 in shape_options_t::shape(hb_font_t*, hb_buffer_t*, char const**) /home/ebrahim/Desktop/harfbuzz/util/./options.hh:242:10 + #8 0x55ed360b5d9c in shape_consumer_t::consume_line(char const*, unsigned int, char const*, char const*) /home/ebrahim/Desktop/harfbuzz/util/./shape-consumer.hh:67:19 + #9 0x55ed360b549f in main_font_text_t, 2147483647, 0>::main(int, char**) /home/ebrahim/Desktop/harfbuzz/util/./main-font-text.hh:81:16 + #10 0x55ed360b4e23 in main /home/ebrahim/Desktop/harfbuzz/util/hb-shape.cc:189:17 + #11 0x7f62bf104ee2 in __libc_start_main (/usr/lib/libc.so.6+0x26ee2) + #12 0x55ed3608f7ad in _start (/home/ebrahim/Desktop/harfbuzz/util/.libs/lt-hb-shape+0xd7ad) + + src/hb-ot-map.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit e6909ee58d0f7b954f3bb227c2f90ca4cfd0c858 +Author: Ebrahim Byagowi +Date: Wed Sep 18 22:12:25 2019 +0430 + + minor + + src/hb-buffer.cc | 2 +- + src/hb-common.cc | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit bb41b74fd1fb42b08e9069c22ee046daeee98e6b +Author: Ebrahim Byagowi +Date: Wed Sep 18 00:55:24 2019 +0430 + + Don't rely on undefined left shift of negative value behavior + + Fixes this -fno-sanitize-recover=undefined check, + + hb-ft.cc:869:27: runtime error: left shift of negative value -16384 + #0 0x7ff8f47da843 in hb_ft_font_set_funcs /home/ebrahim/Desktop/harfbuzz/src/hb-ft.cc:869:27 + #1 0x55f20a66c7d6 in font_options_t::get_font() const /home/ebrahim/Desktop/harfbuzz/util/options.cc:731:3 + #2 0x55f20a668c1f in shape_consumer_t::init(hb_buffer_t*, font_options_t const*) /home/ebrahim/Desktop/harfbuzz/util/./shape-consumer.hh:47:42 + #3 0x55f20a668441 in main_font_text_t, 2147483647, 0>::main(int, char**) /home/ebrahim/Desktop/harfbuzz/util/./main-font-text.hh:75:14 + #4 0x55f20a667f91 in main /home/ebrahim/Desktop/harfbuzz/util/hb-shape.cc:180:21 + #5 0x7ff8f3df7ee2 in __libc_start_main (/usr/lib/libc.so.6+0x26ee2) + #6 0x55f20a6427ad in _start (/home/ebrahim/Desktop/harfbuzz/util/.libs/lt-hb-shape+0xd7ad) + + src/hb-ft.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit b73313ade75130bf86ad1efbd312ce4106166089 +Author: Ebrahim Byagowi +Date: Wed Sep 18 00:50:32 2019 +0430 + + Don't seek of out-of-bound value even if the result is not used + + Fixes this -fno-sanitize-recover=undefined fail, + + /set/iter: hb-algs.hh:1016:60: runtime error: index 4294967295 out of bounds for type 'unsigned long long const[8]' + #0 0x4d1e09 in hb_vector_size_t::operator[](unsigned int) const /home/user/code/harfbuzz/src/./hb-algs.hh:1016:60 + #1 0x4d8b5f in hb_set_t::page_t::previous(unsigned int*) const /home/user/code/harfbuzz/src/./hb-set.hh:139:53 + #2 0x4d0ada in hb_set_t::previous(unsigned int*) const /home/user/code/harfbuzz/src/./hb-set.hh:602:36 + #3 0x4cd76f in hb_set_previous /home/user/code/harfbuzz/src/hb-set.cc:494:15 + #4 0x4ca8af in test_set_iter /home/user/code/harfbuzz/test/api/test-set.c:310:3 + #5 0x7f3a4f3e0f49 (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x72f49) + #6 0x7f3a4f3e0e7a (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x72e7a) + #7 0x7f3a4f3e1121 in g_test_run_suite (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x73121) + #8 0x7f3a4f3e1140 in g_test_run (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x73140) + #9 0x4c8894 in hb_test_run /home/user/code/harfbuzz/test/api/./hb-test.h:88:10 + #10 0x4c8894 in main /home/user/code/harfbuzz/test/api/test-set.c:408:10 + #11 0x7f3a4e3d2b96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310 + #12 0x41e7d9 in _start (/home/user/code/harfbuzz/test/api/test-set+0x41e7d9) + + src/hb-set.hh | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit d8af9ee017ed1018343d30272f55b90dd03a3559 +Author: Ebrahim Byagowi +Date: Wed Sep 18 00:47:55 2019 +0430 + + Don't rely on nullptr deref recovery + + Fixes this -fno-sanitize-recover=undefined fail, + + /types/language: hb-common.cc:385:20: runtime error: member access within null pointer of type 'const struct hb_language_impl_t' + #0 0x4caa34 in hb_language_to_string /home/user/code/harfbuzz/src/hb-common.cc:385:20 + #1 0x4c9be8 in test_types_language /home/user/code/harfbuzz/test/api/test-common.c:205:3 + #2 0x7f9557e72f49 (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x72f49) + #3 0x7f9557e72e7a (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x72e7a) + #4 0x7f9557e73121 in g_test_run_suite (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x73121) + #5 0x7f9557e73140 in g_test_run (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x73140) + #6 0x4c88a3 in hb_test_run /home/user/code/harfbuzz/test/api/./hb-test.h:88:10 + #7 0x4c88a3 in main /home/user/code/harfbuzz/test/api/test-common.c:224:10 + #8 0x7f9556e64b96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310 + #9 0x41e7d9 in _start (/home/user/code/harfbuzz/test/api/test-common+0x41e7d9) + + src/hb-common.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit bfb155a5f19b26f9dcff667a76a24cd5c3b83234 +Author: Ebrahim Byagowi +Date: Wed Sep 18 00:44:52 2019 +0430 + + Don't call memset when length is zero + + Fixes this -fno-sanitize-recover=undefined check, + + /buffer/positions/empty: hb-buffer.cc:327:11: runtime error: null pointer passed as argument 1, which is declared to never be null + + /usr/include/string.h:60:62: note: nonnull attribute specified here + #0 0x4cf31c in hb_buffer_t::clear_positions() /home/user/code/harfbuzz/src/hb-buffer.cc:327:3 + #1 0x4d4dd4 in hb_buffer_get_glyph_positions /home/user/code/harfbuzz/src/hb-buffer.cc:1418:13 + #2 0x4cb553 in test_buffer_positions /home/user/code/harfbuzz/test/api/test-buffer.c:305:3 + #3 0x7f324187bf49 (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x72f49) + #4 0x7f324187be7a (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x72e7a) + #5 0x7f324187be7a (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x72e7a) + #6 0x7f324187c121 in g_test_run_suite (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x73121) + #7 0x7f324187c140 in g_test_run (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x73140) + #8 0x4c8bd3 in hb_test_run /home/user/code/harfbuzz/test/api/./hb-test.h:88:10 + #9 0x4c8bd3 in main /home/user/code/harfbuzz/test/api/test-buffer.c:884:10 + #10 0x7f324086db96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310 + #11 0x41e919 in _start (/home/user/code/harfbuzz/test/api/test-buffer+0x41e919) + + src/hb-buffer.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 5a1cc199ab7b619935af04584ecc650216a83d66 +Author: Ebrahim Byagowi +Date: Wed Sep 18 00:43:44 2019 +0430 + + [ci] Run -fno-sanitize-recover=undefined checks + + .circleci/config.yml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit c930ae2bd8b6f626ddec0628ae6b38e3134e3c97 +Author: Ebrahim Byagowi +Date: Mon Sep 16 14:04:34 2019 +0430 + + Avoid stdint.h in Kernel module compiles + + src/hb-common.h | 2 ++ + 1 file changed, 2 insertions(+) + +commit 412d6cac3a46d710159ed4b3cc3bb59fd5876d5f +Author: Ebrahim Byagowi +Date: Mon Sep 16 13:50:11 2019 +0430 + + Extract an avoid errno compile flag + + src/hb-blob.cc | 1 - + src/hb-config.hh | 1 + + src/hb.hh | 9 +++++++-- + 3 files changed, 8 insertions(+), 3 deletions(-) + +commit 8a16d6f1c13388e6d9ca844a309632ec583ee1a2 +Author: Ebrahim Byagowi +Date: Sun Sep 15 20:43:33 2019 +0430 + + [doc] fix minor typo + + src/hb-ot-layout.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit aab279b33dda45ae0e45c887f2fad6381b5138dc +Author: Ebrahim Byagowi +Date: Sat Sep 14 11:20:09 2019 +0430 + + [ci] Install cmake on macOS cmake/amalgam tester + + .circleci/config.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f3214df6f63919ebe73c713b1e80bba1097a0cea +Author: Ebrahim Byagowi +Date: Sat Sep 14 10:56:00 2019 +0430 + + [coretext] Fix double promotion warnings by making casts explicit + + src/hb-coretext.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit cbbb6fa45519a8670870c784841d7b9e1ab71dd1 +Author: Ebrahim Byagowi +Date: Sat Sep 14 10:53:12 2019 +0430 + + [ci] Don't build cmake tests in macOS bot + + .circleci/config.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6e4736a3c5acc0eea1b16c79b95d1a3082baa320 +Author: Ebrahim Byagowi +Date: Sat Sep 14 10:38:52 2019 +0430 + + [name] Undef entry_{index,score} to avoid collision in amalgam builds + + src/hb-ot-name-table.hh | 3 +++ + 1 file changed, 3 insertions(+) + +commit d512087e4dfb5d9483b78eaf8443b4fa8724b8e1 +Author: Ebrahim Byagowi +Date: Sat Sep 14 10:36:29 2019 +0430 + + Rename GlyphID to HBGlyphID + + Avoid collision with macOS's ATSUnicodeTypes.h GlyphID + + src/hb-aat-layout-bsln-table.hh | 4 +- + src/hb-aat-layout-common.hh | 16 +++---- + src/hb-aat-layout-just-table.hh | 8 ++-- + src/hb-aat-layout-kerx-table.hh | 4 +- + src/hb-aat-layout-morx-table.hh | 32 ++++++------- + src/hb-open-type.hh | 4 +- + src/hb-ot-cmap-table.hh | 4 +- + src/hb-ot-color-cbdt-table.hh | 8 ++-- + src/hb-ot-color-colr-table.hh | 4 +- + src/hb-ot-glyf-table.hh | 2 +- + src/hb-ot-layout-base-table.hh | 2 +- + src/hb-ot-layout-common.hh | 22 ++++----- + src/hb-ot-layout-gpos-table.hh | 2 +- + src/hb-ot-layout-gsub-table.hh | 72 +++++++++++++++--------------- + src/hb-ot-layout-jstf-table.hh | 2 +- + src/hb-ot-math-table.hh | 4 +- + src/hb-ot-shape-complex-arabic-fallback.hh | 14 +++--- + src/hb-ot-vorg-table.hh | 2 +- + 18 files changed, 103 insertions(+), 103 deletions(-) + +commit bf08611044d83b6f5d6dec443f5216db259b4085 +Author: Ebrahim Byagowi +Date: Sat Sep 14 10:35:08 2019 +0430 + + [ci] Update and compile cmake/amalgam on macOS bot + + .circleci/config.yml | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit 229ef1d29d5c7a370ebb10a1131c04719f34dc81 +Author: Behdad Esfahbod +Date: Tue Sep 10 10:31:07 2019 -0700 + + Rename Fixed to HBFixed + + Fixes(!!) https://github.com/harfbuzz/harfbuzz/issues/1966 + + src/hb-aat-fdsc-table.hh | 4 ++-- + src/hb-aat-layout-just-table.hh | 20 ++++++++++---------- + src/hb-aat-layout-trak-table.hh | 8 ++++---- + src/hb-open-type.hh | 4 ++-- + src/hb-ot-post-table.hh | 2 +- + src/hb-ot-stat-table.hh | 14 +++++++------- + src/hb-ot-var-fvar-table.hh | 16 ++++++++-------- + 7 files changed, 34 insertions(+), 34 deletions(-) + +commit 170b5dd856b1ba8f26e79863fe0c64a52eb68951 +Author: Behdad Esfahbod +Date: Sun Sep 8 16:34:11 2019 -0400 + + [aat] Minor + + src/hb-aat-layout-morx-table.hh | 14 +++++--------- + 1 file changed, 5 insertions(+), 9 deletions(-) + +commit a0695687eb03bcf80c4dec19917127cdd8d8797d +Author: Behdad Esfahbod +Date: Sun Sep 8 16:32:12 2019 -0400 + + [aat] Minor + + src/hb-aat-layout-morx-table.hh | 2 -- + 1 file changed, 2 deletions(-) + +commit 4905a2198b4c47c12c6356f72ae0d2b178630d25 +Author: Ebrahim Byagowi +Date: Mon Sep 9 12:36:12 2019 +0430 + + [number] Add static to hb-number-parser.hh functions + + src/hb-number-parser.hh | 4 ++-- + src/hb-number-parser.rl | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +commit 30e5cdfbf1ce2aadadf29ccfd0733355ced2d065 +Author: Ebrahim Byagowi +Date: Mon Sep 9 00:28:16 2019 +0430 + + [number] Optimize _pow10 constants (#1963) + + src/hb-number-parser.hh | 43 +++++++++++++++++++------------------------ + src/hb-number-parser.rl | 31 +++++++++++++------------------ + 2 files changed, 32 insertions(+), 42 deletions(-) + +commit 3f2cdf07a417f81aeeb1e296db493b6e02d76ba8 +Author: Behdad Esfahbod +Date: Sun Sep 8 15:08:02 2019 -0400 + + Change HB_VAR_ARRAY to 1 again + + To fix MSVC bots, while I work on changing this to 0 permanently. + + src/hb.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 39cf8e21be2bf69717cf60a339b3ad26c6f7985b +Author: Ebrahim Byagowi +Date: Sat Sep 7 15:27:30 2019 +0430 + + [number] Add overflow checks used to be done in parse_bcd + + Which were removed in 1083df8 + + src/hb-number-parser.hh | 60 +++++++++++++++++++++++++++++++++---------------- + src/hb-number-parser.rl | 38 ++++++++++++++++++++++++------- + 2 files changed, 71 insertions(+), 27 deletions(-) + +commit 47d82713a144e06e00a486b3aa7d3934d62d68fd +Author: Ebrahim Byagowi +Date: Fri Sep 6 20:33:10 2019 +0430 + + Replace strtod with a ragel implementation + + Use a ragel based number parser when strtod_l couldn't be found + as libc's strtod may is locale sensetivity which we need to not. + + src/Makefile.sources | 2 + + src/hb-number-parser.hh | 223 ++++++++++++++++++++++++++++++++++++++++++++++++ + src/hb-number-parser.rl | 122 ++++++++++++++++++++++++++ + src/hb-number.cc | 3 +- + src/test-number.cc | 30 +++++++ + 5 files changed, 379 insertions(+), 1 deletion(-) + +commit 80613e5b9ee31125f4390012719e6f39970118d3 +Author: Ebrahim Byagowi +Date: Sat Sep 7 14:25:54 2019 +0430 + + Minor, remove unused header + + src/hb-common.cc | 3 --- + 1 file changed, 3 deletions(-) + +commit 5902198cee9b9939ae310f459f9f18f5f1b07424 +Author: Behdad Esfahbod +Date: Fri Sep 6 21:36:31 2019 -0400 + + [kerx] Fix offset issue in kern format 2 + + Fixes tests with HB_VAR_ARRAY != 1, as done in previous commit. + + src/hb-aat-layout-common.hh | 2 +- + src/hb-aat-layout-kerx-table.hh | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 861547d5315be4cb22f3a1e7cd59696d8657ca49 +Author: Behdad Esfahbod +Date: Fri Sep 6 16:55:00 2019 -0400 + + Change HB_VAR_ARRAY from 1 to 0 + + Going to see which compilers it breaks and special-case those... + + src/hb.hh | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 0e294c455e7f2e50172f65463ab016f1372d4c59 +Author: Behdad Esfahbod +Date: Fri Sep 6 16:54:27 2019 -0400 + + Rename VAR to HB_VAR_ARRAY + + src/hb-machinery.hh | 2 +- + src/hb-open-type.hh | 8 ++++---- + src/hb-ot-cff-common.hh | 6 +++--- + src/hb-ot-cff1-table.hh | 4 ++-- + src/hb-ot-layout-common.hh | 2 +- + src/hb-ot-maxp-table.hh | 2 +- + src/hb-string-array.hh | 2 +- + src/hb.hh | 2 +- + 8 files changed, 14 insertions(+), 14 deletions(-) + +commit c379faed2bcca1cc1a81b0de132fc3c4f7f7a080 +Author: Behdad Esfahbod +Date: Fri Sep 6 16:41:12 2019 -0400 + + Fix a few struct size declarations + + Was wrong. As excercised by defining VAR to other than 1 in hb.hh. + + src/hb-aat-layout-feat-table.hh | 2 +- + src/hb-ot-cff-common.hh | 2 +- + src/hb-ot-color-sbix-table.hh | 2 +- + src/hb-ot-layout-common.hh | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +commit 7d4da8b86242d5a541e501937ddf321716b43f07 +Author: Evgeniy Reizner +Date: Fri Sep 6 19:24:32 2019 +0300 + + Remove duplicated tests from test-ot-tag (#1958) + + test/api/test-ot-tag.c | 3 --- + 1 file changed, 3 deletions(-) + +commit 3aceee2527ad921e0d589e42a1fe451e0fc67ee0 +Author: Behdad Esfahbod +Date: Fri Sep 6 12:17:18 2019 -0400 + + Revert "[null] Silence undefined-behavior complaints with too-small null bytes" + + This reverts commit 911c76abcdfe89770b252eb0d4eb621c0db00ad5. + + Broke tests. I'm not sure I understand why. At any rate, this was a + bad way to fix. I'll look into understanding as well as better fix. + + src/hb-null.hh | 6 ------ + 1 file changed, 6 deletions(-) + +commit 911c76abcdfe89770b252eb0d4eb621c0db00ad5 +Author: Behdad Esfahbod +Date: Fri Sep 6 11:53:11 2019 -0400 + + [null] Silence undefined-behavior complaints with too-small null bytes + + Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1577584 + + src/hb-null.hh | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 3c81246f66585edd8ee4515d226b133c290e9d7c +Author: Behdad Esfahbod +Date: Sun Sep 1 19:25:50 2019 -0500 + + [subset] Use newer iter tools in SinglePosFormat1 + + src/hb-ot-layout-gpos-table.hh | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +commit 9510e918f72d2496f5e2ec84c58e79af944c8a0b +Author: Behdad Esfahbod +Date: Sun Sep 1 16:25:33 2019 -0500 + + [iter] Partialize hb_zip() + + src/hb-iter.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 52d19ba4591e822708e52a8fc96d9821fe2668f4 +Author: Behdad Esfahbod +Date: Sun Sep 1 19:42:08 2019 -0500 + + Minor + + test/subset/Makefile.am | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit cad698568a36ea6c929b4c888bd5e8aafe8d39e3 +Author: Ebrahim Byagowi +Date: Wed Sep 4 10:59:19 2019 +0430 + + Use roundf to fix cast to int difference of msys2 w64 + + src/test-number.cc | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +commit 88c73359da3f7078d02f27087790c7109ab4d248 +Author: Ebrahim Byagowi +Date: Wed Sep 4 11:16:18 2019 +0430 + + Check roundf availibity in autotools + + Hmm, not sure how I missed it. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 1083df8b80b08aa1a4f2dabfe414aaa4a0ec8aa1 +Author: Ebrahim Byagowi +Date: Wed Sep 4 01:22:21 2019 +0430 + + Use hb_parse_double in CFF::dict_opset_t::parse_bcd + + src/Makefile.sources | 2 + + src/hb-cff-interp-dict-common.hh | 136 +++++++++------------------------------ + 2 files changed, 31 insertions(+), 107 deletions(-) + +commit 57f88e11d4c48f40a2e56625a54bdfed4aae601a +Author: Ebrahim Byagowi +Date: Wed Sep 4 01:20:50 2019 +0430 + + [number] Turn hb_parse_float into hb_parse_double + + src/hb-common.cc | 6 +++++- + src/hb-number.cc | 16 ++++++++-------- + src/hb-number.hh | 4 ++-- + src/test-number.cc | 44 ++++++++++++++++++++++---------------------- + 4 files changed, 37 insertions(+), 33 deletions(-) + +commit 65690b5a4bf1186a072e8e918c5e01464f918d46 +Author: Ebrahim Byagowi +Date: Tue Sep 3 23:09:47 2019 +0430 + + [number] Add whole buffer check and test it + + src/hb-algs.hh | 6 ++---- + src/hb-buffer-serialize.cc | 12 ++++-------- + src/hb-number.cc | 39 ++++++++++++++++++++++++--------------- + src/hb-number.hh | 9 ++++++--- + src/test-number.cc | 19 ++++++++++++++++--- + 5 files changed, 52 insertions(+), 33 deletions(-) + +commit 3661eb6105a33a763736d8dc4a2cd95c01aa4332 +Author: Ebrahim Byagowi +Date: Tue Sep 3 19:43:14 2019 +0430 + + Don't check null terminaion of source in hb_codepoint_parse + + This isn't what intended originally, just checking if consumed + all the buffer is enough. + + src/hb-algs.hh | 4 ++-- + src/test-number.cc | 32 +++++++++++++++++++++++++++++++- + 2 files changed, 33 insertions(+), 3 deletions(-) + +commit 3a162727501ad0c56d5d6561cace115d858eacb7 +Author: Ebrahim Byagowi +Date: Tue Sep 3 17:19:33 2019 +0430 + + [test] resolve msvc complain on signedness comparing + + src/test-number.cc | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +commit 005389beb5a28e2a94b40d0bb8229e9598b84b1d +Author: Ebrahim Byagowi +Date: Tue Sep 3 17:00:46 2019 +0430 + + Use hb_parse_uint in deserializer token parser + + src/hb-buffer-serialize.cc | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +commit 3d5b1df7ab689871db37ec9a2f5b1ff1665fdb20 +Author: Ebrahim Byagowi +Date: Tue Sep 3 16:58:16 2019 +0430 + + [number] Add test + + src/Makefile.am | 6 +- + src/test-number.cc | 180 +++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 185 insertions(+), 1 deletion(-) + +commit b5e6805ee777347ae13ba0133ca0d64252ef9d55 +Author: Ebrahim Byagowi +Date: Tue Sep 3 15:23:40 2019 +0430 + + [number] Minor tweak on parser related codes + + src/hb-algs.hh | 6 +++--- + src/hb-buffer-serialize.cc | 6 ++---- + src/hb-common.cc | 14 ++++++-------- + src/hb-number.cc | 6 ++---- + 4 files changed, 13 insertions(+), 19 deletions(-) + +commit e2cecf1f34fe1cc62fd8260172f9bd694a17fac5 +Author: Ebrahim Byagowi +Date: Tue Sep 3 15:14:21 2019 +0430 + + [number] Remove parsing code duplication of the calls using lambda + + src/hb-number.cc | 57 +++++++++++++++++++------------------------------------- + 1 file changed, 19 insertions(+), 38 deletions(-) + +commit a77bb7eb41d34b19a672bb4ede038cc1b19a3945 +Author: Ebrahim Byagowi +Date: Tue Sep 3 14:49:14 2019 +0430 + + Move hb_codepoint_parse to hb_parse_uint + + src/hb-algs.hh | 20 +++++++++----------- + src/hb-buffer-serialize.cc | 1 - + src/hb-common.cc | 1 - + src/hb-number.cc | 26 +++++++++++++++++++++++--- + src/hb-number.hh | 3 +++ + src/hb.hh | 3 ++- + 6 files changed, 37 insertions(+), 17 deletions(-) + +commit 43372fbb5afe31ea1e66d450f29de718b6190828 +Author: Ebrahim Byagowi +Date: Tue Sep 3 01:02:40 2019 +0430 + + Merge and aggregate number parsing logics to form hb-number + + src/Makefile.sources | 2 + + src/harfbuzz.cc | 1 + + src/hb-buffer-serialize.cc | 41 +++++--------- + src/hb-common.cc | 121 +++------------------------------------ + src/hb-number.cc | 138 +++++++++++++++++++++++++++++++++++++++++++++ + src/hb-number.hh | 35 ++++++++++++ + 6 files changed, 197 insertions(+), 141 deletions(-) + +commit d50d2fcbc7233f0473493e17ab3fb243d8d30edd +Author: Ebrahim Byagowi +Date: Tue Sep 3 05:02:06 2019 +0430 + + Fallback if roundf didn't exist, like in dietlibc (#1953) + + CMakeLists.txt | 2 +- + src/hb.hh | 9 +++++++++ + 2 files changed, 10 insertions(+), 1 deletion(-) + +commit d3b984d3790d61931d4427ad7c0ae6547f8f1076 +Author: Ebrahim Byagowi +Date: Mon Sep 2 18:18:25 2019 +0430 + + Revert in-house pow10 (d80a3ea) and fix oss-fuzz/16922 + + Probably can be fixed but merging it was wrong so let's revert. + + src/hb-cff-interp-dict-common.hh | 37 ++------------------- + ...ase-minimized-hb-subset-fuzzer-5728664968232960 | Bin 0 -> 28 bytes + 2 files changed, 3 insertions(+), 34 deletions(-) + +commit 41d6e95b0d47c874b73b314cd147e6ea8ec5ddfb +Author: Ebrahim Byagowi +Date: Mon Sep 2 01:41:48 2019 +0430 + + [subset] Use internal API of hb_set_t + + src/hb-subset.cc | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +commit 8ccf328d548a51140e22fe61ba6fdae3f7194aa2 +Author: Ebrahim Byagowi +Date: Mon Sep 2 00:02:06 2019 +0430 + + [subset] Run once for a tag + + src/hb-subset.cc | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 0954c8f7a003b4130cfdc1b3f29db8c57953a78f +Author: Khaled Hosny +Date: Sun Sep 1 17:09:08 2019 +0200 + + [ft] Prefer symbol cmap subtable if found (#1948) + + Similar to commit d304d60e4d49df14ed85d6646680085f27bafbf2 for ot-font. + + src/hb-ft.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 4375858792f3e3cc2fae72c3ae3327f52884f780 +Author: Ebrahim Byagowi +Date: Sun Sep 1 15:13:05 2019 +0430 + + [editorconfig] Treat Ragel files also as C sources + + .editorconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d80a3ea983534e291aee273dba5b1c6e889dadfa +Author: Ebrahim Byagowi +Date: Sun Sep 1 14:05:16 2019 +0430 + + [cff] Implement in-house power of 10 + + A minimal power only for natural numbers exponents of ten, for portability. + + Found the idea in Tcl/Tk but wrote it myself after weeks and it turned out + being a different implementation, reverse direction, constexpr, etc. + + src/hb-cff-interp-dict-common.hh | 37 ++++++++++++++++++++++++++++++++++--- + 1 file changed, 34 insertions(+), 3 deletions(-) + +commit f441a7c00837fbe7843df6faedd5f6383c2258c3 +Author: Ebrahim Byagowi +Date: Sun Sep 1 02:18:09 2019 +0430 + + Don't allow reference blob be accessed using empty tag in hb_face_reference_table (#1947) + + src/hb-face.cc | 3 +++ + src/hb-subset.cc | 5 ----- + 2 files changed, 3 insertions(+), 5 deletions(-) + +commit c9eb913f4cf3d9d4a28059c7ecf7145ad3c49c65 +Author: Behdad Esfahbod +Date: Sat Aug 31 15:21:02 2019 -0500 + + [iter] Simplify hb_chop() + + src/hb-iter.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 67ec9fa9e48714f595ab17bb8a673b5ee7c73aa8 +Author: Behdad Esfahbod +Date: Sat Aug 31 14:51:49 2019 -0500 + + [iter] Add hb_chop() + + src/hb-iter.hh | 14 ++++++++++++++ + src/test-iter.cc | 2 +- + 2 files changed, 15 insertions(+), 1 deletion(-) + +commit 5828d8e83c023547f0add77b6413967056c2a13c +Author: Behdad Esfahbod +Date: Sat Aug 31 14:36:44 2019 -0500 + + [iter] Add hb_take() specialization for arrays + + src/hb-iter.hh | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit 398b296f3b205daa8964de1a63957efeb59f6bdf +Author: Behdad Esfahbod +Date: Sat Aug 31 12:44:24 2019 -0500 + + [iter] Add hb_len() + + src/hb-iter.hh | 8 ++++++++ + src/test-iter.cc | 2 +- + 2 files changed, 9 insertions(+), 1 deletion(-) + +commit 875131d47854c162c1d0a39a5c0f8f8d0c5f24e0 +Author: Behdad Esfahbod +Date: Sat Aug 31 12:42:52 2019 -0500 + + [iter] Add hb_take() + + src/hb-iter.hh | 12 ++++++++++-- + src/test-iter.cc | 1 + + 2 files changed, 11 insertions(+), 2 deletions(-) + +commit 1f88dae9f54d18cd740f149d020b2bb435dc9378 +Author: Behdad Esfahbod +Date: Sat Aug 31 12:24:42 2019 -0500 + + [iter] Make iota() accept invokable for increasing to next item + + src/hb-iter.hh | 21 ++++++++++++++++----- + src/test-iter.cc | 1 + + 2 files changed, 17 insertions(+), 5 deletions(-) + +commit 3bc86fb237b668e738a78397be04c603e7cf083b +Author: Behdad Esfahbod +Date: Fri Aug 30 16:39:52 2019 -0500 + + [algs] Fix hb_inc/dec signature + + src/hb-algs.hh | 5 +++-- + src/test-algs.cc | 4 ++++ + 2 files changed, 7 insertions(+), 2 deletions(-) + +commit b1378d8a217a53e17562abebee22276e09528f8c +Author: Behdad Esfahbod +Date: Fri Aug 30 12:10:45 2019 -0500 + + [iter] Add hb_repeat() + + src/hb-iter.hh | 37 +++++++++++++++++++++++++++++++++---- + src/test-iter.cc | 3 +++ + 2 files changed, 36 insertions(+), 4 deletions(-) + +commit 966a18b92a8b95d8024ae67bc237eeffe5019711 +Author: Behdad Esfahbod +Date: Fri Aug 30 12:07:17 2019 -0500 + + [iter] Remove some && + + src/hb-iter.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit de45775c37873dd5818058dfe316cc0e98590334 +Author: Behdad Esfahbod +Date: Fri Aug 30 12:02:46 2019 -0500 + + [iter] Use hb_ridentity instead of lazy + + + src/hb-iter.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit ce4d63beec08995aaa6b8b45f7986f074a73f295 +Author: Behdad Esfahbod +Date: Fri Aug 30 11:59:50 2019 -0500 + + [iter] Separate hb_iota implementation from hb_range + + src/hb-iter.hh | 29 +++++++++++++++++++++++++++-- + 1 file changed, 27 insertions(+), 2 deletions(-) + +commit 814dc3cbe5a5e51b48cb962a6f7053797bbb8e0d +Author: Behdad Esfahbod +Date: Fri Aug 30 10:20:30 2019 -0500 + + [iter] Rename + + Moving towards making iota useful for non-integers. + + src/hb-iter.hh | 35 ++++++++++++++++++----------------- + 1 file changed, 18 insertions(+), 17 deletions(-) + +commit 2d5643aed4a5a4bc3ea129d4af3dcbe7af7b9995 +Author: Behdad Esfahbod +Date: Fri Aug 30 09:51:22 2019 -0500 + + [algs] Add hb_inc() and hb_dec()) + + src/hb-algs.hh | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit 7eafe94705bb818aac71fbc142158a22da622d19 +Author: Behdad Esfahbod +Date: Fri Aug 30 09:40:40 2019 -0500 + + Revert "[array] Add chop()" + + This reverts commit 545fe9d9f0870568c40c17591f3f224c228feba6. + + Breaks gcc 4.8 and MSVC all versions. + + Will add hb_chop() that works on all iterators instead. + + src/hb-array.hh | 14 -------------- + 1 file changed, 14 deletions(-) + +commit 28c8dcb53f0af0dd3f4e7909285e67865a10b67b +Author: Ebrahim Byagowi +Date: Sat Aug 31 12:27:14 2019 +0430 + + [subset] minor + + src/hb-subset.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 545fe9d9f0870568c40c17591f3f224c228feba6 +Author: Behdad Esfahbod +Date: Thu Aug 29 15:48:21 2019 -0700 + + [array] Add chop() + + Takes n, and returns iterator of iterators that contain up to + n items each. Basically cuts the array into subarrays of size n. + The last sub-array might contain fewer. + + Ideally this should become a generic iter tool, not array-specific, + so we can use it in GPOS to chop a value matrix into rows and elements. + + src/hb-array.hh | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +commit c72589f13f24ca24a0613f7d9bc28b7fe1ef25c0 +Author: Behdad Esfahbod +Date: Thu Aug 29 15:45:21 2019 -0700 + + [iter] Change item_size to get_item_size() + + By moving access to hb_static_size(Type) into a function instead of + a class-const, we can refer to iter types of incomplete types, which + come handy when a method of hb_array_t wants to return iterator + of hb_array_t. That kind of stuff. Next commit needs this to + build on clang... + + src/hb-array.hh | 8 ++++---- + src/hb-iter.hh | 4 ++-- + 2 files changed, 6 insertions(+), 6 deletions(-) + +commit d58e248df62457bdc8a5bab743e5de26c6fc57be +Author: Behdad Esfahbod +Date: Thu Aug 29 15:23:48 2019 -0700 + + [array] Add truncate() method + + src/hb-array.hh | 4 ++++ + 1 file changed, 4 insertions(+) + +commit a06edf1430ba73d24104fce5406f2bc787ce5f11 +Author: Behdad Esfahbod +Date: Thu Aug 29 15:21:18 2019 -0700 + + [array] Use injected class name more + + src/hb-array.hh | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +commit e0e0c8c10948212e97426e987b6f296dc4270c43 +Author: Behdad Esfahbod +Date: Thu Aug 29 14:58:16 2019 -0700 + + Minor + + src/hb-ot-layout-gpos-table.hh | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 0313ef86e32a217e14950d46a3c3b98362a53dee +Author: qxliu76 <48925186+qxliu76@users.noreply.github.com> +Date: Thu Aug 29 14:09:05 2019 -0700 + + bug fix in optimizing coverage table format (#1942) + + We are comparing number of shorts, NOT number of bytes. + + src/hb-ot-layout-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 38f95baf6b7a74547906e8e813c826ee8f8c272f +Author: Behdad Esfahbod +Date: Thu Aug 29 13:40:46 2019 -0700 + + [subset] in SingleSubst subsetting, check for substitute in glyphset + + That matches what fonttools does and allows for specifying exact + glyphset for subset. + + src/hb-ot-layout-gsub-table.hh | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit 499029644f35be7feedca7edf4610b2594855f01 +Author: Ebrahim Byagowi +Date: Thu Aug 29 15:09:39 2019 +0430 + + [gsub] Fix clang's semicolon complains + + src/hb-ot-layout-gsub-table.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 28620310b8a86092074d5a1c40c87fdc9a91ba61 +Author: Ebrahim Byagowi +Date: Thu Aug 29 14:55:54 2019 +0430 + + [test] Avoid alloca use as clang complain + + Fixes https://circleci.com/gh/harfbuzz/harfbuzz/108171 complain + + test/api/test-ot-color.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 875985cd481f1609d10ad0472f1e77af075c93bc +Author: Ebrahim Byagowi +Date: Thu Aug 29 14:51:22 2019 +0430 + + [subset] Don't allow malicious fonts to insert unlimited table headers + + Fixes https://crbug.com/oss-fuzz/16810 + + src/hb-subset.cc | 5 +++++ + ...estcase-minimized-hb-subset-fuzzer-5675720390475776 | Bin 0 -> 299037 bytes + 2 files changed, 5 insertions(+) + +commit dc9222b1dd197ba50f7b63eb97f3fe0891a7b7b5 +Author: Behdad Esfahbod +Date: Wed Aug 28 15:38:46 2019 -0700 + + [subset] Implement AlternateSubst subsetting + + src/hb-ot-layout-gsub-table.hh | 61 +++++++++++++++++++++++++++++++++++++----- + 1 file changed, 55 insertions(+), 6 deletions(-) + +commit 23681b6da4368895fc049beda5a79af58aad8d69 +Author: Behdad Esfahbod +Date: Wed Aug 28 15:30:37 2019 -0700 + + Minor + + src/hb-ot-layout-gsub-table.hh | 21 ++++++++------------- + 1 file changed, 8 insertions(+), 13 deletions(-) + +commit 33c8e2303c23e8dfacb79ac15d8a0e6c7f866c89 +Author: Behdad Esfahbod +Date: Wed Aug 28 15:25:55 2019 -0700 + + [subset] Implement MultipleSubst subsetting + + src/hb-ot-layout-gsub-table.hh | 50 ++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 48 insertions(+), 2 deletions(-) + +commit 5c43a7ba7e4cac229593f9cbe1017d3c55b111ac +Author: Behdad Esfahbod +Date: Wed Aug 28 15:09:58 2019 -0700 + + [GSUB] Use dagger in Ligature::intersects() + + src/hb-ot-layout-gsub-table.hh | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +commit b8c642c1f597fb28ef323ac3cd78541eb462a2f7 +Author: Behdad Esfahbod +Date: Wed Aug 28 15:06:45 2019 -0700 + + Minor + + src/hb-ot-layout-gsub-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit dc2c9aa0c398ac068e1385fffe1fb2b28c80d099 +Author: Behdad Esfahbod +Date: Wed Aug 28 15:05:49 2019 -0700 + + Rename + + src/hb-open-type.hh | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit bc5ef765a874ecd9fc0634dccf0848d1ee839c9a +Author: Behdad Esfahbod +Date: Wed Aug 28 14:51:28 2019 -0700 + + [subset] Subset ligature substitutes! + + Test with: + + $ ./hb-subset -o out.ttf NotoSansArabic-Regular.ttf --drop-tables= سلام && ./hb-view out.ttf سلام + + src/hb-ot-layout-gsub-table.hh | 79 ++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 76 insertions(+), 3 deletions(-) + +commit 42d887bd221879f57ef939838d4f72bf38268943 +Author: Behdad Esfahbod +Date: Wed Aug 28 14:47:14 2019 -0700 + + Beef up HeadlessArrayOf<> + + Should be merged with ArrayOf... + https://github.com/harfbuzz/harfbuzz/issues/1937 + + src/hb-open-type.hh | 37 ++++++++++++++++++++++++++++++------- + 1 file changed, 30 insertions(+), 7 deletions(-) + +commit 3ca809e3623e59b9a99bc0b9e5d10b02238bba3c +Author: Behdad Esfahbod +Date: Wed Aug 28 13:49:35 2019 -0700 + + Add ArrayOf::pop() + + src/hb-open-type.hh | 2 ++ + 1 file changed, 2 insertions(+) + +commit 307bd6d79f11eb175f06c08c321947a447496291 +Author: Behdad Esfahbod +Date: Wed Aug 28 13:49:17 2019 -0700 + + Add arithmetic operators to IntType<> + + src/hb-open-type.hh | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit 2e1d00c85bba98f08a728c4f6f8112d5a25d8062 +Author: Behdad Esfahbod +Date: Wed Aug 28 13:49:04 2019 -0700 + + [debug] Minor + + src/hb-debug.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 062cad5e28574f9f004f917afa7d010fa68fdad0 +Author: Behdad Esfahbod +Date: Wed Aug 28 13:33:08 2019 -0700 + + Add ArrayOf::serialize_append + + src/hb-open-type.hh | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit b66076812d067f893a5a422af2656916ff479d8f +Author: Adrian Wong +Date: Wed Aug 28 21:31:27 2019 +1000 + + Adjustments to the generated Indic table output (#1936) + + * Add empty parentheses after print call + + * Minor: newlines. Move #pragma pop down one; #endif up one + + * Adjust #define ISC/IMC output + + * Regenerate Indic table + + src/gen-indic-table.py | 21 ++++--- + src/hb-ot-shape-complex-indic-table.cc | 109 +++++++++++++++++---------------- + 2 files changed, 70 insertions(+), 60 deletions(-) + +commit 4ef08dbce1a9acd7e941168245c96e010248ecb6 +Author: Ebrahim Byagowi +Date: Tue Aug 27 14:49:46 2019 +0430 + + Use hb_bytes_t as in hb_blob_t + + src/hb-blob.hh | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +commit dce42cef2b769379a0690053da0e7467ff086195 +Author: Ebrahim Byagowi +Date: Tue Aug 27 14:32:05 2019 +0430 + + [glyf] Move GlyphHeader::from_bytes to hb_bytes_t, introduce .as () + + src/hb-array.hh | 6 ++++++ + src/hb-ot-glyf-table.hh | 24 +++++++++--------------- + 2 files changed, 15 insertions(+), 15 deletions(-) + +commit 6e82d59b4f72e8f2ff1830fb384907dcba95962a +Author: Ebrahim Byagowi +Date: Tue Aug 27 12:33:42 2019 +0430 + + [glyf] Revert the way indexToLocFormat is set + + src/hb-ot-glyf-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 88e9db19d29480fadcd4f49f0f4d9029ac64b429 +Author: Ebrahim Byagowi +Date: Tue Aug 27 02:44:26 2019 +0430 + + [subset] Remove subset table size assertion + + As https://github.com/harfbuzz/harfbuzz/pull/1930#issuecomment-525036802 + + src/hb-subset.cc | 1 - + 1 file changed, 1 deletion(-) + +commit a0b4ac4dce392326284138fc47cf3741e2798e21 +Author: Ebrahim Byagowi +Date: Sat Aug 24 17:57:14 2019 +0430 + + Turn 8 spaces to tab across the project + + According to the current code style of the project + + src/hb-aat-layout-kerx-table.hh | 12 +- + src/hb-aat-layout-morx-table.hh | 16 +-- + src/hb-aat-layout-trak-table.hh | 6 +- + src/hb-array.hh | 4 +- + src/hb-blob.cc | 4 +- + src/hb-buffer-serialize.cc | 2 +- + src/hb-buffer.cc | 22 ++-- + src/hb-buffer.h | 4 +- + src/hb-common.cc | 4 +- + src/hb-coretext.cc | 50 ++++---- + src/hb-dispatch.hh | 2 +- + src/hb-font.cc | 16 +-- + src/hb-ft.cc | 2 +- + src/hb-graphite2.cc | 10 +- + src/hb-iter.hh | 4 +- + src/hb-kern.hh | 6 +- + src/hb-machinery.hh | 2 +- + src/hb-object.hh | 2 +- + src/hb-open-file.hh | 4 +- + src/hb-open-type.hh | 2 +- + src/hb-ot-cmap-table.hh | 252 ++++++++++++++++++------------------- + src/hb-ot-color-cbdt-table.hh | 2 +- + src/hb-ot-color-cpal-table.hh | 2 +- + src/hb-ot-color-sbix-table.hh | 8 +- + src/hb-ot-font.cc | 16 +-- + src/hb-ot-hmtx-table.hh | 62 ++++----- + src/hb-ot-layout-common.hh | 16 +-- + src/hb-ot-layout-gdef-table.hh | 4 +- + src/hb-ot-layout-gpos-table.hh | 74 +++++------ + src/hb-ot-layout.cc | 26 ++-- + src/hb-ot-layout.h | 18 +-- + src/hb-ot-map.cc | 2 +- + src/hb-ot-maxp-table.hh | 2 +- + src/hb-ot-name-table.hh | 8 +- + src/hb-ot-name.cc | 2 +- + src/hb-ot-shape-complex-arabic.cc | 14 +-- + src/hb-ot-shape-complex-hangul.cc | 12 +- + src/hb-ot-shape-complex-indic.cc | 34 ++--- + src/hb-ot-shape-complex-khmer.cc | 2 +- + src/hb-ot-shape-complex-myanmar.cc | 2 +- + src/hb-ot-shape-complex-use.cc | 2 +- + src/hb-ot-shape-fallback.cc | 46 +++---- + src/hb-ot-shape-normalize.cc | 4 +- + src/hb-ot-shape.cc | 16 +-- + src/hb-ot-stat-table.hh | 4 +- + src/hb-ot-var-avar-table.hh | 2 +- + src/hb-ot-var-fvar-table.hh | 6 +- + src/hb-ot-vorg-table.hh | 28 ++--- + src/hb-pool.hh | 2 +- + src/hb-sanitize.hh | 6 +- + src/hb-set.hh | 36 +++--- + src/hb-shape-plan.cc | 50 ++++---- + src/hb-subset-cff2.cc | 18 +-- + src/hb-subset-input.cc | 2 +- + src/hb-subset-plan.cc | 34 ++--- + src/hb-subset-plan.hh | 8 +- + src/hb-subset.h | 2 +- + src/hb-uniscribe.cc | 8 +- + src/hb-utf.hh | 8 +- + src/hb-vector.hh | 2 +- + src/hb.hh | 12 +- + src/test-ot-color.cc | 4 +- + src/test-unicode-ranges.cc | 6 +- + test/api/hb-subset-test.h | 6 +- + test/api/test-buffer.c | 2 +- + test/api/test-object.c | 2 +- + test/api/test-ot-math.c | 132 +++++++++---------- + test/api/test-unicode.c | 16 +-- + util/ansi-print.cc | 26 ++-- + util/hb-fc-list.c | 2 +- + util/hb-fc.cc | 4 +- + util/hb-shape.cc | 2 +- + util/hb-subset.cc | 10 +- + util/helper-cairo-ansi.cc | 4 +- + util/helper-cairo.cc | 2 +- + util/options-subset.cc | 26 ++-- + util/options.cc | 50 ++++---- + util/options.hh | 8 +- + 78 files changed, 662 insertions(+), 668 deletions(-) + +commit 269a120f137ca69ca83b6fa00bb6a0ff1a87ae3e +Author: Ebrahim Byagowi +Date: Sun Aug 25 20:37:00 2019 +0430 + + [subset] Raise the bar in new vs old table size + + https://crbug.com/oss-fuzz/16740 + + This is actually an interesting thing that {h,v}mtx allocates as + much as a font pretends to have glyphs but the solution is not + that obvious as regular fonts can have less than actually containing + metrics in their {h,v}mtx. This change raises the bar to consider this + hmtx 4 byte for every glyph case. + + Initially we wanted to just find things allocating crazy amount of + memory but having the assert has led to interesting findings also + so let's don't remove the assert and see what we can find elsewhere. + + src/hb-subset.cc | 2 +- + ...z-testcase-minimized-hb-subset-fuzzer-5667673584697344 | Bin 0 -> 178 bytes + 2 files changed, 1 insertion(+), 1 deletion(-) + +commit 2f8e823331aca2c73b940f057f4b149a89af0502 +Author: Ebrahim Byagowi +Date: Sun Aug 25 12:37:40 2019 +0430 + + [glyf] minor + + src/hb-ot-glyf-table.hh | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit 07e467a30e2bab9731900d72dbf926dbe6fc6e1d +Author: Ebrahim Byagowi +Date: Sun Aug 25 00:36:58 2019 +0430 + + [glyf] Move GlyphHeader size checking to a static method + + src/hb-ot-glyf-table.hh | 69 ++++++++++++++++++++++++++----------------------- + 1 file changed, 36 insertions(+), 33 deletions(-) + +commit 139d14dc899250cf06a8d03b70504687184d5c7f +Author: Ebrahim Byagowi +Date: Sat Aug 24 17:23:16 2019 +0430 + + [glyf] Move GlyphHeader related logics to its, making its fields protected + + src/hb-ot-glyf-table.hh | 73 +++++++++++++++++++++++++------------------------ + 1 file changed, 38 insertions(+), 35 deletions(-) + +commit d57819cbdbab18ccf20caa25cb72cd66efe30848 +Author: Ebrahim Byagowi +Date: Sat Aug 24 16:26:42 2019 +0430 + + [glyf] format source + + src/hb-ot-glyf-table.hh | 282 ++++++++++++++++++++++++++---------------------- + 1 file changed, 154 insertions(+), 128 deletions(-) + +commit 2aef3013f3e6d71eacd0123f4faa63445034c32b +Author: Ebrahim Byagowi +Date: Sat Aug 24 02:59:18 2019 +0430 + + [subset] Consider instruction length place itself + + Now fixes https://crbug.com/oss-fuzz/16639 completely + + src/hb-ot-glyf-table.hh | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 922898c814b328712fac6c3259740804679dae11 +Author: Ebrahim Byagowi +Date: Fri Aug 23 22:04:14 2019 +0430 + + [subset] Fail on table grow more than 16x+4096 + + src/hb-subset.cc | 1 + + 1 file changed, 1 insertion(+) + +commit 28aba780c4035cc85a31b778db0f5553c896dd6a +Author: Ebrahim Byagowi +Date: Fri Aug 23 16:47:15 2019 +0430 + + [subset] Fix blob leak of _subset2 when returns early + + Fixes https://crbug.com/oss-fuzz/16639 + + src/hb-subset.cc | 2 ++ + ...z-testcase-minimized-hb-subset-fuzzer-5754526379802624 | Bin 0 -> 288 bytes + 2 files changed, 2 insertions(+) + +commit 541f3c2d7dcae47eb55650082e372286369d4a55 +Author: Behdad Esfahbod +Date: Fri Aug 23 12:25:58 2019 -0700 + + [debug] Fix extra semicolon issue + + https://github.com/harfbuzz/harfbuzz/issues/1923 + + src/hb-debug.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 4dcaca84115bf8de130fc2c9e03bd7e63fcf9607 +Author: Behdad Esfahbod +Date: Fri Aug 23 12:24:15 2019 -0700 + + Whitespace + + src/hb-debug.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 569426d861ac9336f4083e55f98284b4c647c795 +Author: Behdad Esfahbod +Date: Fri Aug 23 11:54:20 2019 -0700 + + [debug] Fix build with HB_DEBUG + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1923 + + src/hb-debug.hh | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit f233e6c8014cde9b2396c5350c29a3277cd3a657 +Author: Khaled Hosny +Date: Fri Aug 23 13:15:37 2019 +0200 + + [doc] Update list of default features in the manual + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1921 + + docs/usermanual-opentype-features.xml | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +commit be97e9d678017d4ec66625fa2b17ef3485552cad +Author: Behdad Esfahbod +Date: Thu Aug 22 15:52:24 2019 -0700 + + 2.6.1 + + NEWS | 11 +++++++++++ + configure.ac | 2 +- + src/hb-version.h | 4 ++-- + 3 files changed, 14 insertions(+), 3 deletions(-) + +commit d304d60e4d49df14ed85d6646680085f27bafbf2 +Author: Behdad Esfahbod +Date: Wed Aug 21 12:30:22 2019 -0700 + + [ot-font] Prefer symbol cmap subtable if found + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1918 + + Hopefully doesn't break anyone... + + src/hb-ot-cmap-table.hh | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +commit 2a3d4987a75fb2cd51ccf4c1d08baba383ceda7b +Author: Ebrahim Byagowi +Date: Wed Aug 21 03:02:01 2019 +0430 + + Remove hb_directwrite_shape_experimental_width public API + + I had specially exposed the API as I didn't know how to embed harfbuzz + easily elsewhere but now with harfbuzz.cc it has become very easy + and I don't like to see its use anywhere as it has a bad naming and + its Kashida adding is bogus and only useful to check where it should + be added, not visually useful however. + + src/hb-directwrite.cc | 29 ++++++----------------------- + src/hb-directwrite.h | 5 ----- + 2 files changed, 6 insertions(+), 28 deletions(-) + +commit 163a66dc737645852d7515381304d69706688e16 +Author: Behdad Esfahbod +Date: Tue Aug 20 14:22:57 2019 -0700 + + [test] Add test for aaa85931f3542639cd9d0dfb92fd6baab5b0298d + + test/api/test-shape.c | 48 ++++++++++++++++++++++++++++++------------------ + 1 file changed, 30 insertions(+), 18 deletions(-) + +commit aaa85931f3542639cd9d0dfb92fd6baab5b0298d +Author: Behdad Esfahbod +Date: Tue Aug 20 13:06:10 2019 -0700 + + [font] Update multipliers when creating sub_font + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1910 + + src/hb-font.cc | 1 + + 1 file changed, 1 insertion(+) + +commit bbad1b8298125d78c159ed7fdd7bde6a3f3fff56 +Author: Ebrahim Byagowi +Date: Tue Aug 20 14:46:48 2019 +0430 + + [trak] minor, use roundf instead round to normalize the use + + The change to `round` wasn't intended + + src/hb-aat-layout-trak-table.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit e67cb500e9c5f6717d0d1cd152de84d88ec7370e +Author: Ebrahim Byagowi +Date: Tue Aug 20 13:30:34 2019 +0430 + + [readme] add oss-fuzz badge + + Related: + https://github.com/google/oss-fuzz/pull/2513 + https://github.com/systemd/systemd/commit/ce2098b7e9443cd6f31fb70af7f72308cd2962a3 + + README.md | 1 + + 1 file changed, 1 insertion(+) + +commit d59d89b28128cf644d76098c709b9309b834eb09 +Author: Ebrahim Byagowi +Date: Tue Aug 20 13:07:17 2019 +0430 + + [test] Rebase 10.14 trak related test + + test/shaping/data/in-house/tests/macos.tests | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 20b1a27c8a319d43a582c3efa8233b9f2c3cc73e +Merge: 5ee1e451 37de38ad +Author: Ebrahim Byagowi +Date: Tue Aug 20 13:04:51 2019 +0430 + + Merge remove-coretext-96dpi-assumption, @drott + + Remove assumption about Core Text working in 96 DPI + +commit 37de38adeae48e1855c2431a39639db873a74554 +Merge: f401f85a 5ee1e451 +Author: Ebrahim Byagowi +Date: Tue Aug 20 12:59:33 2019 +0430 + + Merge branch 'master' into remove-coretext-96dpi-assumption + +commit 5ee1e451cfc75dc6ddbc3ae300ba7394a0cd560e +Author: Behdad Esfahbod +Date: Mon Aug 19 14:23:17 2019 -0700 + + Minor touch-up for recent change + + src/hb-ot-var-avar-table.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 33489928444b94bdd2cc523dac14707eb29d667e +Author: Ebrahim Byagowi +Date: Wed Aug 7 20:07:58 2019 +0430 + + [avar] Implement inverse map, unmap + + src/hb-ot-var-avar-table.hh | 30 ++++++++++++++++++++++++------ + 1 file changed, 24 insertions(+), 6 deletions(-) + +commit 981f5a54c3cbc1de45ba941fdf5315c62d86b6f3 +Author: Ebrahim Byagowi +Date: Wed Aug 7 18:45:39 2019 +0430 + + [fvar] Implement inverse normalize, unnormalize + + src/hb-ot-var-fvar-table.hh | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +commit dcb4cd400fb44172872a20ba54baa011d748b61d +Author: Behdad Esfahbod +Date: Mon Aug 19 11:35:37 2019 -0700 + + Minor + + src/hb-font.cc | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit ca54440324745afc388edac40ad1047e92567fdb +Author: Ebrahim Byagowi +Date: Sun Aug 18 11:58:04 2019 +0430 + + Remove continuous development helper script + + Not have used it personally for a long time, lets remove it + + src/dev-run.sh | 99 ---------------------------------------------------------- + 1 file changed, 99 deletions(-) + +commit 40aef1b473f63701ab901880d764e33682f13414 +Author: Khaled Hosny +Date: Fri Aug 16 01:00:30 2019 +0200 + + [ot-shape] Keep horizontal_features array sorted + + src/hb-ot-shape.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit da5118da77898ae4778af1ace4af52334b210dd6 +Author: Khaled Hosny +Date: Fri Aug 16 00:48:26 2019 +0200 + + [ot-shape] Enable abvm/blwm features by default + + 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 +- + .../ea3f63620511b2097200d23774ffef197e829e69.ttf | Bin 0 -> 1804 bytes + .../f79eb71df4e4c9c273b67b89a06e5ff9e3c1f834.ttf | Bin 0 -> 1860 bytes + test/shaping/data/in-house/tests/dist.tests | 1 - + .../data/in-house/tests/positioning-features.tests | 3 +++ + 10 files changed, 6 insertions(+), 55 deletions(-) + +commit 2164bd6f29df265acdc04b84f5f94cf63b2cea8a +Author: Khaled Hosny +Date: Fri Aug 16 00:28:41 2019 +0200 + + [ot-shape] Enable dist feature by default (#1908) + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1907 + + src/hb-ot-shape-complex-indic.cc | 2 -- + src/hb-ot-shape-complex-khmer.cc | 2 -- + src/hb-ot-shape-complex-myanmar.cc | 1 - + src/hb-ot-shape-complex-use.cc | 1 - + src/hb-ot-shape.cc | 1 + + test/shaping/data/in-house/Makefile.sources | 1 + + .../fonts/53a91c20e33a596f2be17fb68b382d6b7eb85d5c.ttf | Bin 0 -> 2020 bytes + test/shaping/data/in-house/tests/dist.tests | 1 + + 8 files changed, 3 insertions(+), 6 deletions(-) + +commit bc27f86ffef537835f6c9dbbecbc2ee6792cb127 +Author: Ebrahim Byagowi +Date: Wed Aug 14 22:37:00 2019 +0430 + + Move HB_NO_VAR to a better place in hb-font.cc + + Needed for other works + + src/hb-font.cc | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit 1cc844da66ab527991ff96efdf10d97f6b626bfe +Author: Ebrahim Byagowi +Date: Wed Aug 14 19:10:02 2019 +0430 + + minor + + Use hb_font_t coords directly + + src/hb-ot-cff2-table.cc | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit 6a194b6876db12f083ae5391ca01972168d4e68a +Author: Ebrahim Byagowi +Date: Wed Aug 14 18:49:57 2019 +0430 + + Minor, remove trailing spaces in hb-font.{cc,h} as .editorconfig + + src/hb-font.cc | 338 ++++++++++++++++++++++++++++----------------------------- + src/hb-font.h | 26 ++--- + 2 files changed, 182 insertions(+), 182 deletions(-) + +commit 3ae44645d60fe8271ad18b004434d475eaeb7ad6 +Author: Ebrahim Byagowi +Date: Wed Aug 14 14:34:55 2019 +0430 + + Fix caret_count value when AAT is disabled + + Set caret_count to zero as that is what we want to happen inside lcar when + there is no result. + + src/hb-ot-layout.cc | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit a5aa67b9f288687e21ca7a9887483f7fe1cbce54 +Author: Ebrahim Byagowi +Date: Wed Aug 14 14:29:01 2019 +0430 + + [lcar] Use multiformat convention + + src/hb-aat-layout-lcar-table.hh | 115 +++++++++++++++++++++++++++++++--------- + 1 file changed, 90 insertions(+), 25 deletions(-) + +commit bfffe85dd7d7557e10ec9f9886b86fe0d8b4a7a2 +Author: Ebrahim Byagowi +Date: Wed Aug 14 13:55:49 2019 +0430 + + [opbd] Use multiformat convention on the table + + src/hb-aat-layout-opbd-table.hh | 116 ++++++++++++++++++++++++++++++---------- + 1 file changed, 89 insertions(+), 27 deletions(-) + +commit d6206dbcc4e4ef8c034ee714e74d3a76c5333a12 +Author: Ebrahim Byagowi +Date: Wed Aug 14 11:24:06 2019 +0430 + + [opbd] Turn OpticalBounds fields to FWORD + + src/hb-aat-layout-opbd-table.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 6461143b44f81a4190d3f1cb02238750536f08e4 +Author: Behdad Esfahbod +Date: Tue Aug 13 22:20:54 2019 -0700 + + 2.6.0 + + NEWS | 23 +++++++++++++++++++++++ + configure.ac | 2 +- + docs/harfbuzz-docs.xml | 4 ++++ + src/hb-font.cc | 2 +- + src/hb-gdi.cc | 2 +- + src/hb-ot-layout.cc | 2 ++ + src/hb-ot-layout.h | 2 +- + src/hb-ot-meta.cc | 4 ++-- + src/hb-ot-meta.h | 2 +- + src/hb-ot-metrics.cc | 8 ++++---- + src/hb-ot-metrics.h | 2 +- + src/hb-version.h | 6 +++--- + 12 files changed, 44 insertions(+), 15 deletions(-) + +commit e56d4ff43b97ca35a8324be2acf1c8644f3b0a24 +Author: Behdad Esfahbod +Date: Tue Aug 13 21:02:47 2019 -0700 + + Rename hb_ot_meta_get_entries() to +hb_ot_meta_get_entry_tags() + + docs/harfbuzz-sections.txt | 2 +- + src/hb-ot-meta.cc | 8 ++++---- + src/hb-ot-meta.h | 8 ++++---- + src/test-ot-meta.cc | 4 ++-- + test/api/test-ot-face.c | 2 +- + test/api/test-ot-meta.c | 6 +++--- + 6 files changed, 15 insertions(+), 15 deletions(-) + +commit aade9b70aabd8a97dd8a28cda2cf4d0694dd7350 +Author: Behdad Esfahbod +Date: Tue Aug 13 16:09:20 2019 -0700 + + [pool] Fix alignment assertion + + I *think* it should fix https://github.com/harfbuzz/harfbuzz/issues/1901 + + Ie. if on a system, alignof(void*) < sizeof(void*)... + + src/hb-pool.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit b31d627f151c8eeeb12ed84c3282392d6adbc5b4 +Author: Ebrahim Byagowi +Date: Sun Aug 11 23:34:48 2019 +0430 + + Increase subset fuzzer timeout to 16s + + To satisfy -valgrind and -tsan bots, very ugly + + test/fuzzing/run-subset-fuzzer-tests.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5b9cf191fe1fb13bd4bf914e0f4c03c3b2795a73 +Author: Ebrahim Byagowi +Date: Sun Aug 11 23:07:29 2019 +0430 + + [ci] Disable vcpkg thus running the test suit in Windows + + vcpkg apparently doesn't like to work the same way used to anymore, lets disable it + + appveyor.yml | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +commit 60d9f0097580a339c7ffe582cc0657698e315cea +Author: Ebrahim Byagowi +Date: Sun Aug 11 16:15:19 2019 +0430 + + Implement opbd table parsing + + https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6opbd.html + + src/Makefile.sources | 1 + + src/hb-aat-layout-opbd-table.hh | 111 ++++++++++++++++++++++++++++++++++++++++ + src/hb-ot-face-table-list.hh | 1 + + src/hb-ot-layout.cc | 1 + + 4 files changed, 114 insertions(+) + +commit 8762676e34cef13f4b263b377b485b199b66d4d1 +Author: Ebrahim Byagowi +Date: Sat Aug 10 01:26:55 2019 +0430 + + [os2] Replace null pool addr compare by checking vital fields (#1896) + + src/hb-ot-os2-table.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 1f926fb2b642094a15e686be6a910e709b15ebd0 +Author: Ebrahim Byagowi +Date: Wed Aug 7 20:22:20 2019 +0430 + + [fvar] Use roundf instead hardcoding round logic + + src/hb-ot-var-fvar-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 60485ab0473630c585bb96fcdc14dbe415edf4f2 +Author: Ebrahim Byagowi +Date: Wed Aug 7 23:23:06 2019 +0430 + + [os2] Get defined lower/upper optical size + + src/hb-ot-os2-table.hh | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +commit 321d5588d4fa96bcc4aa558d2f982430031f242e +Author: Qunxin Liu +Date: Tue Jul 2 16:30:57 2019 -0700 + + [subset] Add subsetting for GPOS Lookup Type 1: Single Adjustment Positioning Subtable + + src/hb-ot-layout-gpos-table.hh | 157 ++++++++++++++++++++- + test/subset/data/Makefile.am | 1 + + test/subset/data/Makefile.sources | 1 + + .../gpos1_2_font.keep-layout-retain-gids.41,43.otf | Bin 0 -> 2068 bytes + .../gpos1_2_font.keep-layout-retain-gids.41,46.otf | Bin 0 -> 2232 bytes + .../gpos1_2_font.keep-layout-retain-gids.43,46.otf | Bin 0 -> 2096 bytes + ...eep-layout-retain-gids.retain-all-codepoint.otf | Bin 0 -> 3668 bytes + test/subset/data/fonts/gpos1_2_font.otf | Bin 0 -> 4564 bytes + test/subset/data/tests/layout.gpos.tests | 11 ++ + 9 files changed, 166 insertions(+), 4 deletions(-) + +commit 37572882e7a685d804384eaf11f0f3e53af38341 +Author: Qunxin Liu +Date: Tue Jun 25 13:17:30 2019 -0700 + + [subset] cmap table to use _subset2 and new iterator frameworks + + src/hb-ot-cmap-table.hh | 670 +++++++++++------------ + src/hb-subset.cc | 2 +- + test/api/fonts/Roboto-Regular.D7,D8,D9,DA,DE.ttf | Bin 2816 -> 2532 bytes + test/api/fonts/Roboto-Regular.abc.ttf | Bin 2460 -> 2168 bytes + test/api/fonts/Roboto-Regular.ac.ttf | Bin 2268 -> 1988 bytes + 5 files changed, 320 insertions(+), 352 deletions(-) + +commit 06596cf90700ff76f23297141c656dfc317eece6 +Author: Khaled Hosny +Date: Sat Aug 3 13:55:34 2019 +0200 + + Some styling + + README.python.md | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit 5848c890cf2f8a14c9d9e329c4f8283feac1f0c3 +Author: Ebrahim Byagowi +Date: Sat Aug 3 14:19:28 2019 +0430 + + [metrics] Add metrics tags documentation + + src/hb-ot-metrics.h | 28 ++++++++++++++++++++++++++++ + 1 file changed, 28 insertions(+) + +commit 4d1872b8e019659a92a59b1d7cba6fd81ed3607d +Author: Ebrahim Byagowi +Date: Sat Aug 3 14:06:46 2019 +0430 + + [base] Add documentation for baseline tags from ot spec + + src/hb-ot-layout.h | 19 ++++++++++++++++++- + 1 file changed, 18 insertions(+), 1 deletion(-) + +commit bbeee84a7f048633b0aaa95aa6129871a3a22164 +Author: Ebrahim Byagowi +Date: Sat Aug 3 13:47:55 2019 +0430 + + [meta] Add metadata tags documentation from ot spec + + src/hb-ot-meta.h | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +commit 521c7013abab84a0994fda3977ccd1ba3d496242 +Author: Ebrahim Byagowi +Date: Tue Jul 30 18:10:40 2019 +0430 + + [cpal] revert port to dagger + + It has a different semantic, maybe we should just do a zero memset, + letting Behdad to decide. + + src/hb-ot-color-cpal-table.hh | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit 8014ce198a09d20cb947e4a465c7d893a84c55be +Author: Ebrahim Byagowi +Date: Tue Jul 30 17:31:34 2019 +0430 + + [cpal] port to dagger (#1887) + + src/hb-ot-color-cpal-table.hh | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit d67201da5a2142cb9d039a8cb2cb713556d945af +Author: Ebrahim Byagowi +Date: Tue Jul 30 17:20:18 2019 +0430 + + [colr] minor + + src/hb-ot-color-colr-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 8c0a2e68ad91e55a11162da0cddb355810a4c8a0 +Author: Ebrahim Byagowi +Date: Tue Jul 30 13:16:15 2019 +0430 + + [fuzz] Add dummy call of the added APIs (#1886) + + test/api/test-ot-face.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit e5cf9718c07c8bf1fc20cd573cef2d125c28281f +Author: Ebrahim Byagowi +Date: Tue Jul 30 04:44:23 2019 +0430 + + [colr][feat][meta] Port sub_array iteration to dagger (#1868) + + src/hb-aat-layout-feat-table.hh | 37 ++++++++++++++++++------------------- + src/hb-ot-color-colr-table.hh | 14 ++++++-------- + src/hb-ot-meta-table.hh | 8 +++++--- + 3 files changed, 29 insertions(+), 30 deletions(-) + +commit 9f2b4956b484b802eb37f36974c11785c90493ce +Author: Ebrahim Byagowi +Date: Tue Jul 30 04:42:51 2019 +0430 + + [base] Add hb_ot_layout_get_baseline API + + docs/harfbuzz-sections.txt | 2 + + src/hb-ot-face-table-list.hh | 6 ++- + src/hb-ot-layout.cc | 87 ++++++++++++-------------------------------- + src/hb-ot-layout.h | 32 ++++++++++++++++ + test/api/test-baseline.c | 4 +- + 5 files changed, 63 insertions(+), 68 deletions(-) + +commit 40a4b6ddbdc84a25f76bd4d7ff41b1322fe95b83 +Author: Ebrahim Byagowi +Date: Sat Jul 27 13:33:46 2019 +0430 + + [var] Add a new API, hb_font_set_var_named_instance + + docs/harfbuzz-sections.txt | 1 + + src/hb-font.cc | 28 ++++++++++++++++++++++++++++ + src/hb-font.h | 4 ++++ + test/api/test-ot-extents-cff.c | 32 ++++++++++++++++++++++++++++++++ + 4 files changed, 65 insertions(+) + +commit b6a2281f1a2d29cc5797f4f266800f7141591585 +Author: Ebrahim Byagowi +Date: Tue Jul 30 03:45:45 2019 +0430 + + [meta] Make values match their enum type naming + + src/hb-ot-meta.h | 10 +++++----- + test/api/test-ot-meta.c | 4 ++-- + 2 files changed, 7 insertions(+), 7 deletions(-) + +commit 20072a2eca8943a82e36cbb603ad31481cfc56cd +Author: Ebrahim Byagowi +Date: Tue Jul 30 03:43:15 2019 +0430 + + [metrics] Make values match their enum type naming + + src/hb-ot-font.cc | 12 +++--- + src/hb-ot-metrics.cc | 100 ++++++++++++++++++++++----------------------- + src/hb-ot-metrics.h | 58 +++++++++++++------------- + test/api/test-ot-metrics.c | 26 ++++++------ + 4 files changed, 98 insertions(+), 98 deletions(-) + +commit ed2965a8527ee89994c8eecf451bf71846b3ca86 +Author: Ebrahim Byagowi +Date: Tue Jul 30 03:34:10 2019 +0430 + + [base] Don't use enum inside the table + + src/hb-ot-layout-base-table.hh | 31 ++++++++++++++----------------- + 1 file changed, 14 insertions(+), 17 deletions(-) + +commit 388fa9b32611a8726b9bbfe7ccf8cdbcd818fd70 +Author: Ebrahim Byagowi +Date: Sat Jul 27 14:56:18 2019 +0430 + + [lcar] flip for and switch position + + src/hb-aat-layout-lcar-table.hh | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +commit 4e1da6bb612b0c6386ab143dbb4ca19ff25bc2ba +Author: Ebrahim Byagowi +Date: Mon Jul 29 22:03:56 2019 +0430 + + [metrics] Rename hb_ot_metrics_t to hb_ot_metrics_tag_t + + src/hb-ot-metrics.cc | 22 +++++++++++----------- + src/hb-ot-metrics.h | 16 ++++++++-------- + src/hb-ot-metrics.hh | 6 +++--- + 3 files changed, 22 insertions(+), 22 deletions(-) + +commit 2c2a2b97dbe24ae2e09018f435559c97a460bdcb +Author: Ebrahim Byagowi +Date: Mon Jul 29 22:01:13 2019 +0430 + + [meta] Rename hb_ot_meta_t to hb_ot_meta_tag_t + + src/hb-ot-meta-table.hh | 10 +++++----- + src/hb-ot-meta.cc | 10 +++++----- + src/hb-ot-meta.h | 14 +++++++------- + src/test-ot-meta.cc | 4 ++-- + test/api/test-ot-meta.c | 6 +++--- + 5 files changed, 22 insertions(+), 22 deletions(-) + +commit 7bcc5dfa97a43d9c5f6dfdb87b4f0d5a589ecd48 +Author: Behdad Esfahbod +Date: Sun Jul 28 20:55:50 2019 -0700 + + [iter] Fix accumulate to accept const types + + src/hb-iter.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e21bdf500d4ecc3a5fd6f79aabf6232f3967035e +Author: Ebrahim Byagowi +Date: Sun Jul 28 22:59:09 2019 +0430 + + Increase subset fuzzer timeout to 8s + + Probably we should just remove timeout when running tsan and vaglrind here, the flaky bots + + test/fuzzing/run-subset-fuzzer-tests.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 87454c447d705327a26c1f879e0a4f3002ae2667 +Author: Ebrahim Byagowi +Date: Sun Jul 28 20:46:47 2019 +0430 + + [base] fix logic + + src/hb-ot-layout-base-table.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 69655d5bc3c7b240424545bdef197d9d7251e509 +Author: Ebrahim Byagowi +Date: Sun Jul 28 20:39:20 2019 +0430 + + [base] minor + + src/hb-ot-layout-base-table.hh | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit d9c44e7239daf59e283fecd4166c984b43d48e24 +Author: Ebrahim Byagowi +Date: Sun Jul 28 20:35:32 2019 +0430 + + [base] Check if the returned base_coord is valid + + src/hb-ot-layout-base-table.hh | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +commit 53853c044a6382ece51393dfc3a4fe6a5f8a5a23 +Author: Ebrahim Byagowi +Date: Sun Jul 28 20:23:48 2019 +0430 + + [meta] minor + + src/hb-ot-meta-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ed126d8c37c45d8d60eb0368143c6776d1fcfbff +Author: Ebrahim Byagowi +Date: Sun Jul 28 20:21:59 2019 +0430 + + [base] fix build + + src/hb-ot-layout-base-table.hh | 3 +++ + 1 file changed, 3 insertions(+) + +commit c7b22b96cc64c81248362a70f2d60d93ee520f2d +Author: Ebrahim Byagowi +Date: Sun Jul 28 19:46:57 2019 +0430 + + [base] minor + + src/hb-ot-layout-base-table.hh | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit a157342fce2616141ee62d68ad8e3fb93e52187e +Author: Ebrahim Byagowi +Date: Sun Jul 28 18:54:13 2019 +0430 + + [base] Fix use of bsearch + + src/hb-ot-layout-base-table.hh | 94 ++++++++++++++---------------------------- + 1 file changed, 31 insertions(+), 63 deletions(-) + +commit eddd45653282ffff8ef002ad2163bcf8bf4f3df1 +Author: Ebrahim Byagowi +Date: Sun Jul 28 02:21:54 2019 +0430 + + [base] minor spacing + + src/hb-ot-layout-base-table.hh | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit 0a18efd766b3b6cc987ee18785f7858fe2bd1c67 +Author: Behdad Esfahbod +Date: Fri Jul 26 14:34:26 2019 -0700 + + Minor + + src/hb-ot-layout-gsub-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 60d0fe2eda9c0eb67f50d61e905b584b8edc3e95 +Merge: 6d53cda1 658424b2 +Author: Ebrahim Byagowi +Date: Sat Jul 27 01:20:55 2019 +0430 + + Merge pull request #1872 from darktohka/cmake-regex-fix + + [cmake] Fix CMake build on newer CMake versions + +commit 658424b29efbc758541a790193c42171bb7fa965 +Author: Derzsi Dániel +Date: Fri Jul 26 22:52:03 2019 +0300 + + [cmake] Fix CMake build on newer CMake versions + + Unfortunately, newer CMake versions die during regex variable extraction, causing the build to fail. + + This is caused by the lack of escaping used around variables in the extract_make_variable function, causing these variables to be automatically unwrapped into empty strings. + + CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 6d53cda1baf130853e5725fe8fea1d1c5f766a79 +Author: Zero King +Date: Fri Jul 26 15:43:51 2019 +0000 + + [util] Fix memory leak + + util/options.cc | 1 + + 1 file changed, 1 insertion(+) + +commit d3d99f8bb6ad77d1ac73901885acfffd3bb3e7f7 +Author: Ebrahim Byagowi +Date: Fri Jul 26 16:46:04 2019 +0430 + + [metrics] Expose raw OS2/HHEA asc/dsc values using private tags (#1867) + + src/hb-ot-metrics.cc | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +commit aaffe41094f8ddefad6f33e86cbd04a24dd9bfff +Author: Ebrahim Byagowi +Date: Fri Jul 26 01:14:37 2019 +0430 + + [meta] minor, simplify iterator + + src/hb-ot-meta-table.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 62932c14bd256f10031380047ededd93a2aacd88 +Author: Ebrahim Byagowi +Date: Fri Jul 26 00:30:29 2019 +0430 + + [meta] Rename ot-metadata to ot-meta per review + + docs/harfbuzz-sections.txt | 7 +++--- + src/Makefile.am | 8 +++---- + src/Makefile.sources | 4 ++-- + src/harfbuzz.cc | 2 +- + src/hb-ot-meta-table.hh | 8 +++---- + src/{hb-ot-metadata.cc => hb-ot-meta.cc} | 22 +++++++++--------- + src/{hb-ot-metadata.h => hb-ot-meta.h} | 30 ++++++++++++------------- + src/hb-ot.h | 2 +- + src/{test-ot-metadata.cc => test-ot-meta.cc} | 10 ++++----- + test/api/Makefile.am | 2 +- + test/api/{test-ot-metadata.c => test-ot-meta.c} | 26 ++++++++++----------- + 11 files changed, 61 insertions(+), 60 deletions(-) + +commit 821d9e9034c57c5c593741284b134c76cc3c7c0f +Author: Ebrahim Byagowi +Date: Fri Jul 26 00:08:58 2019 +0430 + + Use .sub_array for DataMap tags iteration + + src/hb-ot-meta-table.hh | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +commit a250af98ae74c94ac3aa069e6e5958a937586bfc +Author: Ebrahim Byagowi +Date: Wed Jul 24 03:10:41 2019 +0430 + + [meta] Add max value to hb_ot_metadata_t + + src/hb-ot-metadata.h | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 80e246a1f2b3c4e3c25a4a3ec042e7610944abd4 +Author: Ebrahim Byagowi +Date: Wed Jul 24 03:08:34 2019 +0430 + + [meta] Add a test program for metadata + + src/Makefile.am | 5 ++++ + src/test-ot-metadata.cc | 70 +++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 75 insertions(+) + +commit bc65ebbce765545bc4455d8ae5ba4a6a99201e41 +Author: Ebrahim Byagowi +Date: Wed Jul 24 02:28:09 2019 +0430 + + [meta] hb_ot_metadata_get_entries, tags iteration API + + src/hb-ot-meta-table.hh | 17 +++++++++++++++++ + src/hb-ot-metadata.cc | 28 ++++++++++++++++++++++++---- + src/hb-ot-metadata.h | 8 +++++++- + test/api/test-ot-metadata.c | 26 ++++++++++++++++++++++++++ + 4 files changed, 74 insertions(+), 5 deletions(-) + +commit 3ac03bd67cb9f4a72e636bf56bc4a79e04bcba62 +Author: Ebrahim Byagowi +Date: Mon Jul 22 23:35:08 2019 +0430 + + [meta] New API, hb_ot_metadata_reference_entry for fetching meta entries + + docs/harfbuzz-sections.txt | 6 +++++ + src/Makefile.sources | 2 ++ + src/harfbuzz.cc | 1 + + src/hb-config.hh | 1 + + src/hb-ot-face-table-list.hh | 4 ++- + src/hb-ot-face.cc | 1 + + src/hb-ot-layout.cc | 1 - + src/hb-ot-meta-table.hh | 20 +++++++++++++++ + src/hb-ot-metadata.cc | 57 ++++++++++++++++++++++++++++++++++++++++++ + src/hb-ot-metadata.h | 57 ++++++++++++++++++++++++++++++++++++++++++ + src/hb-ot.h | 1 + + test/api/Makefile.am | 1 + + test/api/fonts/meta.ttf | Bin 0 -> 320 bytes + test/api/test-ot-metadata.c | 58 +++++++++++++++++++++++++++++++++++++++++++ + 14 files changed, 208 insertions(+), 2 deletions(-) + +commit aab8e084873eb098c55ed2569c15bb308c59e436 +Author: Ebrahim Byagowi +Date: Fri Jul 26 02:19:22 2019 +0430 + + minor spacing fix (#1869) + + src/hb-open-type.hh | 16 ++++++++-------- + src/hb-ot-vorg-table.hh | 2 +- + src/hb-vector.hh | 8 ++++---- + 3 files changed, 13 insertions(+), 13 deletions(-) + +commit d791446a930f8e2009c5ab5ea389da98d1ed9b95 +Author: Ebrahim Byagowi +Date: Fri Jul 26 02:12:06 2019 +0430 + + [feat] minor + + src/hb-aat-layout-feat-table.hh | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit 356b68a00afaf972908cb2a478170e3933eaf974 +Author: Ebrahim Byagowi +Date: Thu Jul 25 23:22:00 2019 +0430 + + [metrics] Add a test that actually practices variation (#1858) + + test/api/fonts/TestCFF2VF.otf | Bin 0 -> 3636 bytes + test/api/test-ot-metrics.c | 28 ++++++++++++++++++++++++++-- + 2 files changed, 26 insertions(+), 2 deletions(-) + +commit a744fdc6c8217d0d4bfce30e638ed2e5200cf380 +Author: Ebrahim Byagowi +Date: Thu Jul 25 14:49:02 2019 +0430 + + Add _MAX_VALUE to hb_ot_metrics_t (#1861) + + src/hb-ot-metrics.cc | 4 ++-- + src/hb-ot-metrics.h | 4 +++- + 2 files changed, 5 insertions(+), 3 deletions(-) + +commit 069872c51b31fe1a618e3ca5c3b0ab8ccba0cf81 +Author: Ebrahim Byagowi +Date: Thu Jul 25 14:27:43 2019 +0430 + + minor + + src/hb-ot-layout.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 737eb85a4ec8861791157d83dd170ac48fa2cfc7 +Author: Ebrahim Byagowi +Date: Thu Jul 25 14:26:30 2019 +0430 + + Add _MAX_VALUE to disabled baseline types enum + + src/hb-ot-layout.cc | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit dd9a0ed3f0c0a8a94e107689318463d62414cf60 +Author: Ebrahim Byagowi +Date: Wed Jul 24 00:47:19 2019 +0430 + + Replace 0x7FFFFFFFu in enums with HB_TAG_MAX_SIGNED + + src/hb-aat-layout.h | 4 ++-- + src/hb-ot-var.h | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit 636ae422372ed7f17b695e78c9c9015188b204e8 +Author: Ebrahim Byagowi +Date: Mon Jul 22 22:50:21 2019 +0430 + + minor, comment out meta table in list till its use + + src/hb-ot-face-table-list.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 04c11a19b75663af35d16c827e295aa2e555d110 +Merge: 41ab56e0 c9796d15 +Author: Khaled Hosny +Date: Mon Jul 22 16:44:47 2019 +0200 + + Merge pull request #1851 from khaledhosny/fix-sbix-extents + + Fix sbix glyph extents + +commit 41ab56e09586b675b1c5de745cf5f520a808bba1 +Author: Ebrahim Byagowi +Date: Mon Jul 22 18:46:52 2019 +0430 + + Implement meta table parsing + + src/Makefile.sources | 1 + + src/hb-ot-face-table-list.hh | 1 + + src/hb-ot-layout.cc | 15 ++++---- + src/hb-ot-meta-table.hh | 89 ++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 99 insertions(+), 7 deletions(-) + +commit a51aa951b5ad8da4ac7effc891437345e012a0ac +Author: Ebrahim Byagowi +Date: Mon Jul 22 18:35:55 2019 +0430 + + [metrics] Fix _get_variation API to works with actual coord values + + src/hb-ot-metrics.cc | 16 ++++++++-------- + src/hb-ot-metrics.h | 2 +- + test/api/test-ot-metrics.c | 2 +- + 3 files changed, 10 insertions(+), 10 deletions(-) + +commit 77141dff7d73fa6290f51c9e1ca56ce51a5deec0 +Author: Behdad Esfahbod +Date: Mon Jul 22 07:48:32 2019 -0400 + + [metrics] _-prefix internal symbol + + src/hb-ot-font.cc | 12 ++++++------ + src/hb-ot-metrics.cc | 8 ++++---- + src/hb-ot-metrics.hh | 6 +++--- + 3 files changed, 13 insertions(+), 13 deletions(-) + +commit 89228ccb9a81b728bc9955082c17c68c848c50c4 +Author: Behdad Esfahbod +Date: Mon Jul 22 07:07:37 2019 -0400 + + Fix warning on IBM compilers + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1852 + + src/hb.hh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit c9796d15e1ec5f8939f8b1ae368cb3352b6a9cb9 +Author: Khaled Hosny +Date: Mon Jul 22 03:57:24 2019 +0200 + + Fix sbix glyph extents + + * The ‘height’ needs to be negated since the API returns “distance from + top to bottom side”. + * Similarly, the ‘y_offset‘ needs to be added to the height to get the + ‘y_bearing’, since sbix’s offset is “the point in the glyph relative + to its lower-left corner which corresponds to the origin” while + ‘y_bearing’ is the “top side of glyph from origin”. + + With these changes the sbix glyph metrics return values similar to other + tables, as they were otherwise unusable. + + src/hb-ot-color-sbix-table.hh | 4 ++-- + test/api/test-ot-color.c | 4 ++-- + .../fonts/fcbaa518d3cce441ed37ae3b1fed6a19e9b54efd.ttf | Bin 0 -> 3128 bytes + test/shaping/data/in-house/tests/color-fonts.tests | 1 + + 4 files changed, 5 insertions(+), 4 deletions(-) + +commit 759f3bd486c99bb09fb9fa5f42e621ec21399df8 +Author: Ebrahim Byagowi +Date: Mon Jul 22 02:06:07 2019 +0430 + + [metrics] Don't use metrics API in _common + + As it is exposed with a different condition + + src/hb-ot-metrics.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit eb8bd2f7eccde483d33406f102c69260fde6fe23 +Author: Ebrahim Byagowi +Date: Tue Jul 16 22:27:01 2019 +0430 + + Add hb_gdi_face_create API + + Based on Konstantin Ritt work posted on mailing list + + CMakeLists.txt | 8 +++++ + appveyor.yml | 2 +- + configure.ac | 23 +++++++++++++++ + docs/harfbuzz-sections.txt | 5 ++++ + src/Makefile.am | 8 +++++ + src/Makefile.sources | 3 ++ + src/harfbuzz.cc | 1 + + src/hb-directwrite.cc | 9 ++---- + src/hb-gdi.cc | 73 ++++++++++++++++++++++++++++++++++++++++++++++ + src/hb-gdi.h | 39 +++++++++++++++++++++++++ + src/hb-uniscribe.cc | 7 ----- + src/hb.hh | 5 ++++ + 12 files changed, 168 insertions(+), 15 deletions(-) + +commit 3d03bb84d44bc9ef8a77e974d0e937a3385ffb92 +Author: Ebrahim Byagowi +Date: Sun Jul 21 12:38:04 2019 +0430 + + [metrics] minor, tweak comment + + src/hb-ot-metrics.cc | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit e540d402f6120e8761ff655bdbffb07d91a5f643 +Author: Behdad Esfahbod +Date: Fri Jul 19 11:19:31 2019 -0700 + + [docs] Minor + + docs/harfbuzz-sections.txt | 2 ++ + src/hb-ot-math.h | 2 +- + 2 files changed, 3 insertions(+), 1 deletion(-) + +commit 00e13985fbc5291850b8ea3d021e5f83c8a297e3 +Author: Ebrahim Byagowi +Date: Sat Jul 20 23:03:51 2019 +0430 + + Revert hhea fallback to OS/2 to its reverse way + + As searching number of hhea having fonts beats the number of OS/2 + having ones in macOS 10.14.2 + + src/hb-ot-metrics.cc | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit c13ef9cc64a447e74abfed75f4f418bf644be88d +Author: Ebrahim Byagowi +Date: Sat Jul 20 15:01:37 2019 +0430 + + Bring back asc/desc abs logic used to be in hmtx table + + src/hb-ot-metrics.cc | 21 ++++++++++++++++++--- + 1 file changed, 18 insertions(+), 3 deletions(-) + +commit 772e62688cd72c02910f623653d2ec8ef6990928 +Author: Ebrahim Byagowi +Date: Sat Jul 20 14:50:31 2019 +0430 + + Make HB_TINY builds work again by separating the always needed part + + src/hb-ot-font.cc | 12 +++++----- + src/hb-ot-metrics.cc | 62 ++++++++++++++++++++++++++++++++++++++++------------ + src/hb-ot-metrics.hh | 5 +++++ + 3 files changed, 59 insertions(+), 20 deletions(-) + +commit cb704337407ae9ccb57ae7631567002028b93c84 +Author: Ebrahim Byagowi +Date: Sat Jul 20 14:33:57 2019 +0430 + + Merge _get_position_internal into _get_position + + src/hb-ot-metrics.cc | 143 ++++++++++++++++++--------------------------------- + src/hb-ot-metrics.hh | 5 -- + 2 files changed, 49 insertions(+), 99 deletions(-) + +commit ac3518af58464b33f1b16b34b8846c302b935208 +Author: Ebrahim Byagowi +Date: Sat Jul 20 14:03:36 2019 +0430 + + Define post table only when used + + src/hb-ot-face-table-list.hh | 2 ++ + 1 file changed, 2 insertions(+) + +commit 471f798ace08b4551f0c9ead6855a4e49b72ba25 +Author: Ebrahim Byagowi +Date: Sat Jul 20 14:00:20 2019 +0430 + + Merge ot-metrics-internal.cc with ot-metrics now that isn't needed in subset + + src/Makefile.sources | 3 -- + src/harfbuzz.cc | 1 - + src/hb-ot-metrics-internal.cc | 100 ------------------------------------------ + src/hb-ot-metrics.cc | 71 +++++++++++++++++++++++++++++- + 4 files changed, 70 insertions(+), 105 deletions(-) + +commit 29444d7e9fd5007bf39efa2cf57a0117aabfc770 +Author: Ebrahim Byagowi +Date: Sat Jul 20 13:52:21 2019 +0430 + + Don't cache ascender/descender metrics + + src/hb-ot-font.cc | 24 ++++++++---------------- + src/hb-ot-hmtx-table.hh | 20 -------------------- + 2 files changed, 8 insertions(+), 36 deletions(-) + +commit 5e28c2654d030655d7b93ec0d6213d2b9fb2956e +Author: Ebrahim Byagowi +Date: Sat Jul 20 14:08:11 2019 +0430 + + [doc] minor, improve hb-ot-metrics doc a bit + + src/hb-ot-metrics.cc | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +commit ac8b6e330a443a66c3e0fb83af9794310688d848 +Merge: ec8dde81 08b48e89 +Author: Ebrahim Byagowi +Date: Sat Jul 20 13:16:16 2019 +0430 + + Merge pull request #1844 from ebraminio/hhea + + Fallback hhea's ascender/descender to OS2 + +commit 08b48e89d3c1bafe252badc7c65a9fc2f166a693 +Author: Ebrahim Byagowi +Date: Sat Jul 20 12:53:40 2019 +0430 + + [os2] minor spacing tweaks + + src/hb-ot-os2-table.hh | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +commit 54b9ab704dbf62e2916f1d5276ffef2543bcc2a7 +Author: Ebrahim Byagowi +Date: Sat Jul 20 12:51:38 2019 +0430 + + Fallback hhea's ascender/descender to OS2 + + src/hb-ot-metrics-internal.cc | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit ec8dde8142fbf9e5bc0aee9318a7c4e73d61c758 +Author: Behdad Esfahbod +Date: Fri Jul 19 11:13:50 2019 -0700 + + [metrics] Fall back to hhea if OS2 metrics are empty + + Reinstates previous logic, even if it might be unnecessary. + + src/hb-ot-metrics-internal.cc | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit 2e5b49d11d1dbfd44d8c640cb9ce5de7d26ca873 +Author: Ebrahim Byagowi +Date: Fri Jul 19 11:41:07 2019 +0430 + + Add HB_NO_METRICS and fix HB_TINY build (#1839) + + src/hb-config.hh | 1 + + src/hb-ot-face-table-list.hh | 2 -- + src/hb-ot-metrics-internal.cc | 8 +++++++- + src/hb-ot-metrics.cc | 6 ++++++ + 4 files changed, 14 insertions(+), 3 deletions(-) + +commit bdfdac0f26aafb3e9ff2db123116f0406fa49efc +Author: Ebrahim Byagowi +Date: Fri Jul 19 10:33:00 2019 +0430 + + [ci][fuzzer] print valgrind failure if an error happened + + test/fuzzing/run-shape-fuzzer-tests.py | 34 +++++++++++++++++----------------- + 1 file changed, 17 insertions(+), 17 deletions(-) + +commit 2bd953ff4f656f042dba2845f0479a7fe7c439a6 +Author: Behdad Esfahbod +Date: Thu Jul 18 14:25:45 2019 -0700 + + [metrics] Fix weird use of xor + + I believe that was a try to use one approach as fallback to other. But + felt wrong. Just believe what's in OS/2 table to be correct. + + src/hb-ot-metrics-internal.cc | 12 ++++++------ + src/hb-ot-os2-table.hh | 2 +- + 2 files changed, 7 insertions(+), 7 deletions(-) + +commit 9675a067bf1cc0e5d4707c1345736fda4be75b82 +Author: Behdad Esfahbod +Date: Thu Jul 18 14:15:08 2019 -0700 + + [ot-metrics] Touch up + + src/harfbuzz.cc | 2 ++ + src/hb-ot-hmtx-table.hh | 19 +++++++++---------- + 2 files changed, 11 insertions(+), 10 deletions(-) + +commit 87e628436e32786635796fbb07ed200f8c0da68f +Author: Ebrahim Byagowi +Date: Tue Nov 20 23:26:46 2018 +0330 + + Implement a simple API for fetching opentype metrics + + Fixes https://github.com/harfbuzz/harfbuzz/pull/1432 + + docs/harfbuzz-sections.txt | 9 +++ + src/Makefile.sources | 6 ++ + src/hb-ot-face-table-list.hh | 2 + + src/hb-ot-hhea-table.hh | 2 + + src/hb-ot-hmtx-table.hh | 62 +++++++++---------- + src/hb-ot-layout.cc | 1 - + src/hb-ot-metrics-internal.cc | 94 +++++++++++++++++++++++++++++ + src/hb-ot-metrics.cc | 135 ++++++++++++++++++++++++++++++++++++++++++ + src/hb-ot-metrics.h | 92 ++++++++++++++++++++++++++++ + src/hb-ot-metrics.hh | 35 +++++++++++ + src/hb-ot-os2-table.hh | 4 ++ + src/hb-ot-post-table.hh | 5 +- + src/hb-ot.h | 1 + + test/api/Makefile.am | 1 + + test/api/test-ot-metrics.c | 54 +++++++++++++++++ + 15 files changed, 467 insertions(+), 36 deletions(-) + +commit ed67efcc8c3638c625b2904833af3f27ef51db14 +Author: David Corbett +Date: Mon Jun 17 10:16:24 2019 -0400 + + Revert "[Myanmar] Prevent reordering between Asat and Dot below" + + This reverts commit 1c8654ead41ca746d577549c92d2a41c594ab639. + + src/hb-unicode.hh | 3 --- + 1 file changed, 3 deletions(-) + +commit 504bb17287c978d60a4a515555852465319f74ed +Author: Ebrahim Byagowi +Date: Wed Jul 17 22:57:46 2019 +0430 + + [ci] Bring back -linux-arm64 bot + + Let's see if 576065b has fixed it + + .circleci/config.yml | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit 6157bbe5127bbcbd17348622601976cffcd11c63 +Author: Behdad Esfahbod +Date: Wed Jul 17 11:20:08 2019 -0700 + + Revert "Revert previous change" + + This reverts commit b8e90ca1a10fbd472eda1aa8cc3797011da52356. + + Works now. + + src/hb-subset-plan.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 576065b4429109359c3af491b34b9ab0c6b149ee +Author: Behdad Esfahbod +Date: Wed Jul 17 11:19:34 2019 -0700 + + [iter] Fix reduce type deduction + + src/hb-iter.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 4552864c82c876da738ec3bf772cc089216f2fd2 +Author: Ebrahim Byagowi +Date: Wed Jul 17 22:08:39 2019 +0430 + + [ci] Disable -linux-arm64 bot + + This is its failure https://circleci.com/gh/harfbuzz/harfbuzz/99864 + + Trying to fix like ee05627, interestingly, makes the bot and the + others to fail like this https://circleci.com/gh/harfbuzz/harfbuzz/99841 + + .circleci/config.yml | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit b8e90ca1a10fbd472eda1aa8cc3797011da52356 +Author: Ebrahim Byagowi +Date: Wed Jul 17 21:38:19 2019 +0430 + + Revert previous change + + Interestingly all of the bots disagreed with the change and the complain is... weird. + + src/hb-subset-plan.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ee05627aff2993c51ed8a4bff3170450c000a28a +Author: Ebrahim Byagowi +Date: Wed Jul 17 21:28:25 2019 +0430 + + Improve syntax to make out linux-arm64 a little happy + + Decided to apply is we did the same on other places however this won't + fix all of its complains + + src/hb-subset-plan.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6a6bf7b7bc4a0b375fcf04ff7c674bf76e6d51aa +Author: Ebrahim Byagowi +Date: Wed Jul 17 21:22:38 2019 +0430 + + Downgrade -Wdeprecated-declarations to warning + + Fixes #1834 at least till fix of #1829 + + src/hb.hh | 1 + + 1 file changed, 1 insertion(+) + +commit 25e2562fdff6c14a9cb70999a1ad71ee1bdff494 +Author: Behdad Esfahbod +Date: Wed Jul 17 09:35:56 2019 -0700 + + [amalgam] Fix redundant-declaration warning/error + + src/hb-unicode.cc | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit c184180228540c23405aaa03b6b571bb41103b45 +Author: Ali Javadi +Date: Tue Jul 16 22:10:24 2019 +0430 + + Fix C++20 compile warning on implicit capture of this with '=' default capture (#1833) + + Happens when compiled with -std=c++2a, the fix just makes the captures explicit to resolve the issue. Just adding this in addition to = doesn't work in C++11. + + src/hb-ot-layout-gpos-table.hh:737:18: warning: implicit capture of 'this' with a capture default of '=' is deprecated [-Wdeprecated-this-capture] + { return (this+_).intersects (glyphs, valueFormat); }) + ^ + src/hb-ot-layout-gpos-table.hh:736:16: note: add an explicit capture of 'this' to capture '*this' by reference + | hb_map ([=] (const OffsetTo &_) + ^ + , this + + src/hb-ot-layout-gpos-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 1f94388516befe137d265c261f687a47ce6f8e69 +Author: Ebrahim Byagowi +Date: Tue Jul 16 11:24:29 2019 +0430 + + [usp] define atfree callback only if used + + src/hb-uniscribe.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 1da1b4dc94c500e4c9c833ab74fced07364d13fb +Author: Qunxin Liu +Date: Wed Jun 26 13:23:24 2019 -0700 + + [subset] For option "--unicodes", add support for "*" to retain all code points + + ...aa-Regular-new.default.retain-all-codepoint.ttf | Bin 0 -> 97204 bytes + ...drop-hints-retain-gids.retain-all-codepoint.ttf | Bin 0 -> 65976 bytes + ...Regular-new.drop-hints.retain-all-codepoint.ttf | Bin 0 -> 65936 bytes + ...a-Regular-new.name-ids.retain-all-codepoint.ttf | Bin 0 -> 96948 bytes + ...egular-new.retain-gids.retain-all-codepoint.ttf | Bin 0 -> 97244 bytes + ...to-Regular.abc.default.retain-all-codepoint.ttf | Bin 0 -> 2168 bytes + ...drop-hints-retain-gids.retain-all-codepoint.ttf | Bin 0 -> 924 bytes + ...Regular.abc.drop-hints.retain-all-codepoint.ttf | Bin 0 -> 924 bytes + ...o-Regular.abc.name-ids.retain-all-codepoint.ttf | Bin 0 -> 2168 bytes + ...egular.abc.retain-gids.retain-all-codepoint.ttf | Bin 0 -> 2168 bytes + test/subset/data/tests/basics.tests | 1 + + test/subset/subset_test_suite.py | 20 +++++++--- + util/hb-subset.cc | 7 ++++ + util/options.cc | 44 ++++++++++++--------- + 14 files changed, 48 insertions(+), 24 deletions(-) + +commit 4730b350b7ee90338caf3e962343af42412ce3df +Author: Behdad Esfahbod +Date: Fri Jul 12 15:38:35 2019 -0700 + + Revert "Update Graphite API to latest (#1215)" + + This reverts commit e4e74c2751ac24178086cce2811d34d8019b6f85. + + See https://github.com/harfbuzz/harfbuzz/issues/1829 + + src/hb-graphite2.cc | 28 +--------------------------- + 1 file changed, 1 insertion(+), 27 deletions(-) + +commit f8242b61ab01002e9f7374daa8755e92c6a92eb4 +Author: Ebrahim Byagowi +Date: Thu Jul 11 15:10:36 2019 +0430 + + [fuzz] Increase subset runner timeout for tsan bot + + Now is flaky let's just increase and maybe investigate later + + test/fuzzing/run-subset-fuzzer-tests.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit b65bad18aa527684af999b5808a9087404c0759a +Author: Ebrahim Byagowi +Date: Thu Jul 11 14:31:55 2019 +0430 + + [fuzz] Don't fail when blob is empty + + And enable more tests able to trig the issue. + + ...zz-testcase-minimized-hb-subset-fuzzer-5738978499624960 | Bin 0 -> 28 bytes + test/fuzzing/hb-subset-fuzzer.cc | 2 +- + test/fuzzing/run-subset-fuzzer-tests.py | 9 +++++---- + 3 files changed, 6 insertions(+), 5 deletions(-) + +commit 7a9d643c297990f9889a2f7b4a470ef933bac131 +Author: Ebrahim Byagowi +Date: Thu Jul 11 01:35:06 2019 +0430 + + Fix unintialized memory read in cmap subset (#1826) + + src/hb-ot-cmap-table.hh | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +commit a6065d05cf38620c06b6dd10b8a841ed236f76c2 +Author: Ebrahim Byagowi +Date: Wed Jul 10 16:41:40 2019 +0430 + + Don't call memcpy when a table is empty + + src/hb-open-file.hh | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit c85f624b519df1db141bf55d9452bc2837ef35c4 +Author: Ebrahim Byagowi +Date: Wed Jul 10 14:28:06 2019 +0430 + + Force blob generation and memory check in hb-subset-fuzzer + + test/fuzzing/hb-subset-fuzzer.cc | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +commit 2e7021da7d1726a37822e6a001b9218f82255bc8 +Author: Dominik Röttsches +Date: Mon Jul 8 10:19:49 2019 +0300 + + Revert "Minor" - revert moving extern "C" definitions in-function + + This reverts commit 62e60322cb9e18b3ee75f1b4a2a6d3069f587407 since it + breaks building HarfBuzz as part of Chromium. + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1821. + + src/hb-unicode.cc | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit f18ea1dd3a9961661a383b2966de57ea68a267e7 +Author: Behdad Esfahbod +Date: Fri Jul 5 13:56:45 2019 -0700 + + [font] Remove division when scaling + + Yoohoo. This seems to be precise enough! Let's see if it sticks. + I'm asking Dominik to run this in Chrome test suite and report. + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1801 + + src/hb-font.hh | 23 +++++++++-------------- + src/hb-ot-math-table.hh | 16 ++++++++-------- + 2 files changed, 17 insertions(+), 22 deletions(-) + +commit b847769292aca13345fd1facae35aaf999198ad4 +Author: Behdad Esfahbod +Date: Fri Jul 5 13:52:09 2019 -0700 + + [font] Keep font-space to user-space multiplier + + Part of https://github.com/harfbuzz/harfbuzz/issues/1801 + + src/hb-font.cc | 5 +++++ + src/hb-font.hh | 13 +++++++++++-- + 2 files changed, 16 insertions(+), 2 deletions(-) + +commit df6edcd44ceb63d01d9c0d6d2aa06b6c6cbb914d +Author: Behdad Esfahbod +Date: Fri Jul 5 13:45:15 2019 -0700 + + Make face immutable in hb_font_set_face() + + src/hb-font.cc | 1 + + 1 file changed, 1 insertion(+) + +commit 0d425e1eeaea97bf5e4fc9ce40e549332bc0cea1 +Author: Behdad Esfahbod +Date: Fri Jul 5 13:18:05 2019 -0700 + + [ot-font] Optimize rounding + + Part of https://github.com/harfbuzz/harfbuzz/issues/1801 + + The assumption that compiler optimizes "upem/2" to a shift only + works if upem is unsigned... Anyway, spoon-feed the compiler. + + src/hb-font.hh | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 144326e215671a42fb3ac9f00ddef779ba354345 +Author: Simon Sapin +Date: Fri Jul 5 19:05:11 2019 +0200 + + Clusters are reversed based on the direction, not script + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1818 + + docs/usermanual-clusters.xml | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit cf1a782a5ca82a880906cae3d4cb76b10ec2aad2 +Author: Simon Sapin +Date: Thu Jul 4 21:06:59 2019 +0200 + + Docs: fix a typo in function name + + docs/usermanual-fonts-and-faces.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ffa736f151f27adb76fb0bf91e18e1ec5cb8fe8d +Author: Simon Sapin +Date: Thu Jul 4 23:05:50 2019 +0200 + + hb_set_previous_range docs: fix presumed copy/paste error + + src/hb-set.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 641f33738089ef7ccbedce09886309edcd2e1718 +Author: Simon Sapin +Date: Thu Jul 4 23:03:45 2019 +0200 + + Docs typo fix: slower → lower + + src/hb-set.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 9fea6b4dd41bfe2b85f788523162658a7ab9bd49 +Author: Ebrahim Byagowi +Date: Fri Jul 5 18:46:41 2019 +0430 + + [amalgam] Use it in cmake port and fix conflicts (#1812) + + .circleci/config.yml | 8 ++--- + CMakeLists.txt | 74 ++++-------------------------------------- + src/Makefile.am | 2 ++ + src/hb-cff-interp-common.hh | 6 ++-- + src/hb-cff-interp-cs-common.hh | 2 +- + src/hb-coretext.cc | 4 +-- + src/hb-directwrite.cc | 14 ++++---- + src/hb-ft.cc | 4 +-- + 8 files changed, 27 insertions(+), 87 deletions(-) + +commit b240d701fd98efa59a7f772ff39654fc95b8fc8f +Author: Behdad Esfahbod +Date: Wed Jul 3 12:17:57 2019 -0700 + + [amalgam] Include integration source files as well + + Just for those that are normally built into libharfbuzz itself. + + Part of https://github.com/harfbuzz/harfbuzz/issues/1809 + + src/Makefile.am | 12 ++++++++++-- + src/harfbuzz.cc | 6 ++++++ + 2 files changed, 16 insertions(+), 2 deletions(-) + +commit d51524204528b36907ab0f48bf2a48ec124c93d9 +Author: Behdad Esfahbod +Date: Wed Jul 3 12:10:03 2019 -0700 + + [amalgam] Rename hb.cc to harfbuzz.cc + + Part of https://github.com/harfbuzz/harfbuzz/issues/1809 + + src/Makefile.am | 8 ++++---- + src/{hb.cc => harfbuzz.cc} | 0 + 2 files changed, 4 insertions(+), 4 deletions(-) + +commit 4cb180d227c1adc32e921c241a93cd1f50a98d33 +Author: Behdad Esfahbod +Date: Tue Jul 2 19:44:18 2019 -0700 + + Revert "Use constexpr to replace passthru_ bools" + + This reverts commit c4aa10ebc8dc28b1f9c90af2ca2092a7535f8395. + + Broke several compilers... Sigh. The version without constexpr + didn't fully optimize out the unreachable code on clang. + So, revert it is... + + src/hb-algs.hh | 8 ++++++++ + src/hb-set.hh | 18 ++++++++---------- + 2 files changed, 16 insertions(+), 10 deletions(-) + +commit c4aa10ebc8dc28b1f9c90af2ca2092a7535f8395 +Author: Behdad Esfahbod +Date: Tue Jul 2 19:15:03 2019 -0700 + + Use constexpr to replace passthru_ bools + + src/hb-algs.hh | 8 -------- + src/hb-set.hh | 18 ++++++++++-------- + 2 files changed, 10 insertions(+), 16 deletions(-) + +commit 2e48fd077954410f59156b3100c16bf56a507948 +Author: Behdad Esfahbod +Date: Tue Jul 2 17:55:58 2019 -0700 + + Sprinkle constexpr around + + Being conservative. Also not sure it makes any real difference + in our codebase. + + src/hb-algs.hh | 48 ++++++++++++++++++++++++------------------------ + src/hb-meta.hh | 18 +++++++++--------- + 2 files changed, 33 insertions(+), 33 deletions(-) + +commit df4448064e370a410404708a15ce819daf1d9386 +Author: Behdad Esfahbod +Date: Tue Jul 2 17:11:09 2019 -0700 + + Remove unused 'inline' specifier + + src/hb-ot-map.hh | 4 ++-- + src/hb-shape-plan.hh | 18 +++++++++--------- + 2 files changed, 11 insertions(+), 11 deletions(-) + +commit 04a4957040380bba58880ff51d529c5cccf1d2c7 +Author: Behdad Esfahbod +Date: Tue Jul 2 16:19:18 2019 -0700 + + [amalgam] Add hb.cc to git + + Part of https://github.com/harfbuzz/harfbuzz/issues/1809 + + src/Makefile.am | 1 + + src/hb.cc | 44 ++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 45 insertions(+) + +commit 62e60322cb9e18b3ee75f1b4a2a6d3069f587407 +Author: Behdad Esfahbod +Date: Tue Jul 2 16:07:03 2019 -0700 + + Minor + + src/hb-unicode.cc | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit ceb4c212dc91a277f646c4a5354e4362f548a9f6 +Author: Behdad Esfahbod +Date: Tue Jul 2 16:02:13 2019 -0700 + + [amalgam] Fix UCD issue + + This actually makes it build now! + + Part https://github.com/harfbuzz/harfbuzz/issues/1809 + + Keeping open to add tests, CI, etc. + + src/hb-ucd.cc | 5 +---- + src/hb-unicode.cc | 2 -- + src/hb-unicode.hh | 3 +++ + 3 files changed, 4 insertions(+), 6 deletions(-) + +commit 7ca54811f471a28163de6b3c561990c85aa39880 +Author: Behdad Esfahbod +Date: Tue Jul 2 16:00:58 2019 -0700 + + [amalgam] Fix CFF + + Part of https://github.com/harfbuzz/harfbuzz/issues/1809 + + src/hb-ot-cff1-table.cc | 18 +++++++++--------- + src/hb-ot-cff2-table.cc | 16 ++++++++-------- + 2 files changed, 17 insertions(+), 17 deletions(-) + +commit 3724f13ba0292055197efdbfcacfe3d7b067175c +Author: Behdad Esfahbod +Date: Tue Jul 2 15:23:00 2019 -0700 + + [amalgam] Finish fixing Indic-like shapers + + Part of https://github.com/harfbuzz/harfbuzz/issues/1809 + + src/hb-ot-shape-complex-indic.cc | 34 +++++++++++++++++----------------- + src/hb-ot-shape-complex-indic.hh | 9 ++++++++- + src/hb-ot-shape-complex-khmer.cc | 18 +++++++++--------- + src/hb-ot-shape-complex-khmer.hh | 17 ++++++++--------- + src/hb-ot-shape-complex-myanmar.cc | 8 ++++---- + src/hb-ot-shape-complex-myanmar.hh | 16 ++++++++-------- + src/hb-ot-shape-complex-use.cc | 14 +++++++------- + 7 files changed, 61 insertions(+), 55 deletions(-) + +commit eb37bc9d93b3abebee24390708940510fe37477a +Author: Behdad Esfahbod +Date: Tue Jul 2 15:19:39 2019 -0700 + + [use] Remove Syriac features + + This was non-standard, and unused anyway. + + src/hb-ot-shape-complex-use.cc | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +commit dc480fc4717937d53cf38860a5c5d48211e8cbc8 +Author: Behdad Esfahbod +Date: Tue Jul 2 15:17:56 2019 -0700 + + [amalgam] More Indic-like issues + + Part of https://github.com/harfbuzz/harfbuzz/issues/1809 + + src/hb-ot-shape-complex-indic.cc | 76 +++++++++++++++++++++------------------- + src/hb-ot-shape-complex-khmer.cc | 36 ++++++++++--------- + src/hb-ot-shape-complex-use.cc | 32 ++++++++--------- + 3 files changed, 74 insertions(+), 70 deletions(-) + +commit d8b5353e07650cf243ba182dbf52e7f198719762 +Author: Behdad Esfahbod +Date: Tue Jul 2 15:09:26 2019 -0700 + + [amalgam] More + + Part of https://github.com/harfbuzz/harfbuzz/issues/1809 + + src/hb-ot-shape-complex-myanmar.cc | 28 ++++++++++++++-------------- + src/hb-ot-shape-complex-use.cc | 28 ++++++++++++++-------------- + 2 files changed, 28 insertions(+), 28 deletions(-) + +commit d115a9e022c0b687fb402cfd2b90d516beded5c0 +Author: Behdad Esfahbod +Date: Tue Jul 2 14:42:45 2019 -0700 + + [amalgam] Fix most duplicate-id instances in Indic-like shapers + + Part of https://github.com/harfbuzz/harfbuzz/issues/1809 + + src/hb-ot-layout.hh | 22 +++++ + src/hb-ot-shape-complex-indic-machine.hh | 6 +- + src/hb-ot-shape-complex-indic-machine.rl | 6 +- + src/hb-ot-shape-complex-indic.cc | 130 +++++++++---------------- + src/hb-ot-shape-complex-indic.hh | 26 +++++ + src/hb-ot-shape-complex-khmer-machine.hh | 6 +- + src/hb-ot-shape-complex-khmer-machine.rl | 6 +- + src/hb-ot-shape-complex-khmer.cc | 97 ++++++------------- + src/hb-ot-shape-complex-myanmar-machine.hh | 4 +- + src/hb-ot-shape-complex-myanmar-machine.rl | 4 +- + src/hb-ot-shape-complex-myanmar.cc | 69 ++++++-------- + src/hb-ot-shape-complex-use-machine.hh | 4 +- + src/hb-ot-shape-complex-use-machine.rl | 4 +- + src/hb-ot-shape-complex-use.cc | 148 ++++++++++++----------------- + 14 files changed, 230 insertions(+), 302 deletions(-) + +commit c073233f45da6ad8131dd38cb43b125f48c17432 +Author: Behdad Esfahbod +Date: Tue Jul 2 14:26:45 2019 -0700 + + Add make rule to build hb.cc + + Part of https://github.com/harfbuzz/harfbuzz/issues/1809 + + src/Makefile.am | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit f1d20d9b4dcbeead3757650b9286393918b4be8a +Author: Behdad Esfahbod +Date: Tue Jul 2 14:18:38 2019 -0700 + + Add ucd-table make target + + src/Makefile.am | 23 +++++++++++++++-------- + src/gen-ucd-table.py | 8 +++++--- + 2 files changed, 20 insertions(+), 11 deletions(-) + +commit 040b261deeed8924edcb087e27a61392d1f85023 +Author: Michiharu Ariza +Date: Sun Jun 30 16:13:07 2019 -0700 + + add bimap test along with bug fix/tweaks + + src/Makefile.am | 6 ++++- + src/hb-bimap.hh | 4 +++ + src/test-bimap.cc | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 85 insertions(+), 1 deletion(-) + +commit 9c93f5cc2de5c60d5464a65890fc7d8c25aa9702 +Merge: ad341d5f 4ab2d1d6 +Author: Ebrahim Byagowi +Date: Mon Jul 1 20:08:22 2019 +0430 + + Merge pull request #1806 from carlo-bramini/master + + Make harfbuzz working on all existing versions of Windows + +commit 4ab2d1d6767568c45495be515e016805cce0c69a +Author: Ebrahim Byagowi +Date: Mon Jul 1 19:30:21 2019 +0430 + + [dwrite] Apply minor style improves + + src/hb-directwrite.cc | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit 5ebd265e66cbcd167469837dcf8647484310dfb5 +Author: Carlo Bramini <30959007+carlo-bramini@users.noreply.github.com> +Date: Mon Jul 1 16:06:43 2019 +0200 + + Fix error rised by GCC8+ + + src/hb-directwrite.cc | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit 693dacbb1c0bc805e3e6aedaca5a57f04eb6ec9c +Author: Carlo Bramini <30959007+carlo-bramini@users.noreply.github.com> +Date: Mon Jul 1 13:31:26 2019 +0200 + + Use lower case file name with #include + + I tried to cross compile harfbuzz for Windows and an error was generated because `DWrite_1.h` was not found. + This happened because the filesystem is case sensitive and for this reason that include file was not found. + The right name of the file to be used is `dwrite_1.h`, with all letters not capitalized: + https://docs.microsoft.com/en-us/windows/desktop/api/dwrite_1/ + I also verified in the installation of VS2017 with Windows Kit v10 and in that place it was also lower case. + So, in my opinion it should be better to change this. + + src/hb-directwrite.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a4543d408b31376c38bab878b2f72d4323abc564 +Author: Carlo Bramini <30959007+carlo-bramini@users.noreply.github.com> +Date: Sun Jun 30 15:06:30 2019 +0200 + + Empty DIRECTWRITE_LIBS + + Not used anymore since DWRITE is loaded dynamically. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 601b6825b05f67354b48dd3629b95e0d8bf68a14 +Author: Carlo Bramini <30959007+carlo-bramini@users.noreply.github.com> +Date: Sun Jun 30 15:03:44 2019 +0200 + + Dynamically load DWRITE + + Also checks if DWriteCreateFactory() has been executed successfully. + + src/hb-directwrite.cc | 41 +++++++++++++++++++++++++++++++++-------- + 1 file changed, 33 insertions(+), 8 deletions(-) + +commit ad341d5f1624f4e30b2d0eb2a171054a973053b5 +Author: Behdad Esfahbod +Date: Fri Jun 28 16:00:37 2019 -0700 + + [config] Fix CoreText build with NO_AAT + + src/hb-aat-layout.cc | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +commit 3f806673fbeacdbe1b31399394ccc26c773a794b +Author: Ebrahim Byagowi +Date: Sat Jun 29 00:00:00 2019 +0430 + + Apply some minor improves on CFFIndex + + src/hb-ot-cff-common.hh | 38 +++++++++++++------------------------- + 1 file changed, 13 insertions(+), 25 deletions(-) + +commit ddd29e5594ccc9d0281e6da7373a1f115f6f6f3a +Author: Ebrahim Byagowi +Date: Fri Jun 28 23:44:14 2019 +0430 + + minor, reuse StructAtOffset logic in StructAtOffsetOrNull + + src/hb-ot-cff-common.hh | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit 9db7ce73d7ac6566837cdd70d38c45f3aefd7769 +Author: Ebrahim Byagowi +Date: Fri Jun 28 23:11:52 2019 +0430 + + minor style improve in hb-cff-interp-common.hh + + src/hb-cff-interp-common.hh | 91 +++++++++++++++------------------------------ + 1 file changed, 30 insertions(+), 61 deletions(-) + +commit 9a7b7bd9fc5bde7796ffdd997ee65cb33cbf6b29 +Author: Ebrahim Byagowi +Date: Fri Jun 28 22:53:51 2019 +0430 + + style fix for pylint complain + + src/gen-emoji-table.py | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +commit 8d36ef50c8712be476572514d73b7bddf43e5951 +Author: Behdad Esfahbod +Date: Thu Jun 27 14:48:10 2019 -0700 + + [config] Add links + + CONFIG.md | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit f53590971c5326dd15f4296764bfd1255ec0506a +Author: Behdad Esfahbod +Date: Thu Jun 27 13:42:51 2019 -0700 + + [test] Make Unicode tests strict against internal UCD + + https://github.com/harfbuzz/harfbuzz/pull/1799 + + test/api/test-unicode.c | 30 ++++++++++++++++++++++-------- + 1 file changed, 22 insertions(+), 8 deletions(-) + +commit d42264f151a61a4a77e5d5712e535fc6e2daf338 +Author: David Corbett +Date: Wed Jun 26 21:10:11 2019 -0400 + + Test at least one character per Unicode version + + test/api/test-unicode.c | 142 ++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 138 insertions(+), 4 deletions(-) + +commit 7185bd6ffb4dd8c0efebdab5b930e62c5695e3ab +Merge: cd65305b 8341c0b3 +Author: Ebrahim Byagowi +Date: Thu Jun 27 22:09:28 2019 +0430 + + Merge pull request #1800 from harfbuzz/harfbuzz/cffnull_fix2 + + [CFF] fix for Subrs null ptr access + +commit 8341c0b304ee3bb0b7d150bcfb42a8b9e6448687 +Author: Michiharu Ariza +Date: Thu Jun 27 08:43:31 2019 -0700 + + add test case file + + ...z-testcase-minimized-harfbuzz_fuzzer-5093685255077888 | Bin 0 -> 1160 bytes + 1 file changed, 0 insertions(+), 0 deletions(-) + +commit 01832fd16b605971466fc3b174cb932787ef4bfb +Author: Michiharu Ariza +Date: Wed Jun 26 15:58:38 2019 -0700 + + alternate fix for https://crbug.com/971933 + + src/hb-cff-interp-cs-common.hh | 6 +++--- + src/hb-cff1-interp-cs.hh | 2 +- + src/hb-cff2-interp-cs.hh | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) + +commit cd65305b059e7495f4f993d25cfda4d88781589b +Author: Behdad Esfahbod +Date: Wed Jun 26 14:57:48 2019 -0700 + + [config] Don't disable emoji sequences in HB_TINY + + It makes sense to disable this code these if editing is not needed. + However, this is also necessary to correctly display emoji sequences + in right-to-left direction. For that reason, don't auto-disable it. + + src/hb-config.hh | 1 - + src/hb-ot-shape.cc | 2 +- + src/hb-unicode.cc | 2 +- + 3 files changed, 2 insertions(+), 3 deletions(-) + +commit 7298716a3cfbdabedd15960404623317a64db3ae +Author: Behdad Esfahbod +Date: Wed Jun 26 14:51:17 2019 -0700 + + [config] Compile out modified combining-class if HB_NO_OT_SHAPE + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-unicode.cc | 2 ++ + 1 file changed, 2 insertions(+) + +commit 1cdd0fa60d9a6aaddc20e646d294d642e2db9be4 +Author: Behdad Esfahbod +Date: Wed Jun 26 14:49:15 2019 -0700 + + [emoji] Port generator to packtab + + src/gen-emoji-table.py | 18 ++++-- + src/hb-unicode-emoji-table.hh | 126 ++++++++++++++++-------------------------- + src/hb-unicode.cc | 5 +- + 3 files changed, 60 insertions(+), 89 deletions(-) + +commit 5130c90ac0173c542b550049c93738ab5de84bb9 +Author: Behdad Esfahbod +Date: Wed Jun 26 14:29:39 2019 -0700 + + [config] Add HB_NO_EMOJI + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-config.hh | 1 + + src/hb-ot-shape.cc | 2 ++ + src/hb-unicode.cc | 2 ++ + 3 files changed, 5 insertions(+) + +commit 9d5b5348c7ca1e39faa9e197fdebfb8f5d3aeece +Author: Behdad Esfahbod +Date: Wed Jun 26 13:58:40 2019 -0700 + + [config] Add HB_NO_SHAPER + + Don't know who would want when why. But makes sense to have. + + src/hb-shaper-list.hh | 6 ++++++ + src/hb-shaper.cc | 2 ++ + 2 files changed, 8 insertions(+) + +commit 8fe15485cbc2f56adb29d4d5f0c3957869bd0e1a +Author: Behdad Esfahbod +Date: Wed Jun 26 13:49:42 2019 -0700 + + [config] Add HB_NO_OT_TAG + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-config.hh | 1 + + src/hb-ot-layout.cc | 4 ++++ + src/hb-ot-tag.cc | 5 +++++ + src/hb-uniscribe.cc | 4 ++++ + 4 files changed, 14 insertions(+) + +commit 7dcf8e126ecf52c67f59745e04d21df68b1a6992 +Author: Behdad Esfahbod +Date: Wed Jun 26 13:44:10 2019 -0700 + + [config] Fix build with HB_NO_OT_LAYOUT + + src/hb-ot-face-table-list.hh | 2 ++ + src/hb-ot-layout-gpos-table.hh | 3 ++- + src/hb-ot-layout-gsub-table.hh | 5 +++-- + src/hb-ot-layout-gsubgpos.hh | 8 +++++++- + 4 files changed, 14 insertions(+), 4 deletions(-) + +commit 2804790bceb9398cc9b668ca63f5aa9ffe29beeb +Author: Behdad Esfahbod +Date: Wed Jun 26 13:38:14 2019 -0700 + + [config] Add dependency + + src/hb-ot-shape.cc | 4 ++++ + 1 file changed, 4 insertions(+) + +commit b0fd16eec62dea29d984bab879064ae9d91afdfc +Author: Behdad Esfahbod +Date: Wed Jun 26 13:31:51 2019 -0700 + + [config] Add dependency + + src/hb-config.hh | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 12092a46d8826eec5dcf69e7817921380e4bc507 +Author: Behdad Esfahbod +Date: Wed Jun 26 13:31:01 2019 -0700 + + [config] Rename HB_NO_SHAPE_AAT to HB_NO_AAT_SHAPE + + src/hb-aat-map.cc | 2 +- + src/hb-config.hh | 2 +- + src/hb-ot-kern-table.hh | 14 +++++++------- + src/hb-ot-layout.cc | 2 +- + src/hb-ot-shape.cc | 36 ++++++++++++++++++------------------ + src/hb-ot-shape.hh | 8 ++++---- + 6 files changed, 32 insertions(+), 32 deletions(-) + +commit bb4bbe617d3878ca7e5e359ada493c68ec7f0a90 +Author: Behdad Esfahbod +Date: Wed Jun 26 13:29:58 2019 -0700 + + [config] Add HB_NO_OT_LAYOUT + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-config.hh | 1 + + src/hb-ot-layout.cc | 7 +++++++ + src/hb-ot-map.cc | 7 +++++++ + 3 files changed, 15 insertions(+) + +commit ab40a2feecf53d2ef787b7785132bf57e5bdcff9 +Author: Behdad Esfahbod +Date: Wed Jun 26 13:25:02 2019 -0700 + + [config] Enable HB_NO_OT_FONT in HB_NO_OT + + CONFIG.md | 4 ++-- + src/hb-config.hh | 1 + + 2 files changed, 3 insertions(+), 2 deletions(-) + +commit 7aad53657eb23264f658711a71da3e50f2264455 +Author: Behdad Esfahbod +Date: Wed Jun 26 13:21:03 2019 -0700 + + [config] Add HB_NO_OT_SHAPE / HB_NO_OT + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + CONFIG.md | 14 ++++++++++++++ + src/gen-indic-table.py | 6 ++++++ + src/gen-use-table.py | 6 ++++++ + src/gen-vowel-constraints.py | 7 +++++++ + src/hb-config.hh | 4 ++++ + src/hb-ot-shape-complex-arabic.cc | 6 ++++++ + src/hb-ot-shape-complex-default.cc | 7 +++++++ + src/hb-ot-shape-complex-hangul.cc | 7 +++++++ + src/hb-ot-shape-complex-hebrew.cc | 7 +++++++ + src/hb-ot-shape-complex-indic-table.cc | 6 ++++++ + src/hb-ot-shape-complex-indic.cc | 7 +++++++ + src/hb-ot-shape-complex-khmer.cc | 7 +++++++ + src/hb-ot-shape-complex-myanmar.cc | 7 +++++++ + src/hb-ot-shape-complex-thai.cc | 7 +++++++ + src/hb-ot-shape-complex-use-table.cc | 6 ++++++ + src/hb-ot-shape-complex-use.cc | 7 +++++++ + src/hb-ot-shape-complex-vowel-constraints.cc | 6 ++++++ + src/hb-ot-shape-fallback.cc | 7 +++++++ + src/hb-ot-shape-normalize.cc | 7 +++++++ + src/hb-ot-shape.cc | 7 +++++++ + src/hb-shape-plan.cc | 10 ++++++++++ + src/hb-shape-plan.hh | 4 ++++ + src/hb-shaper-list.hh | 2 ++ + 23 files changed, 154 insertions(+) + +commit cee9f6e044278b590694f4dff6f22eaad9371385 +Author: Behdad Esfahbod +Date: Wed Jun 26 13:01:58 2019 -0700 + + Fail compile if no shapers enabled + + src/hb-shaper.cc | 1 + + 1 file changed, 1 insertion(+) + +commit 8786820a5a7406be95bc4a6b6e2aca736126420c +Author: Behdad Esfahbod +Date: Wed Jun 26 12:53:57 2019 -0700 + + [src] Add make targets "tiny" and "tinyz" + + src/Makefile.am | 4 ++++ + 1 file changed, 4 insertions(+) + commit b14e413fae8f14b75c5956e9b38e413c878ded0c Author: Behdad Esfahbod Date: Wed Jun 26 10:44:10 2019 -0700 @@ -13792,6 +17622,49 @@ src/hb-machinery.hh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) +commit f401f85a5a3ec4ab9c28012a0bfe713d7ee96951 +Author: Tor Arne Vestbø +Date: Mon Dec 17 00:48:35 2018 +0100 + + Remove assumption about Core Text working in 96 DPI + + Core Text doesn't actually have a concept of DPI internally, as it + doesn't rasterize anything by itself, it just generates vector paths + that get passed along to Core Graphics. + + In practice this means Core Text operates in the classical macOS + logical DPI of 72, with one typographic point corresponding to one + point in the Core Graphics coordinate system, which for a normal + bitmap context then corresponds to one pixel -- or two pixels for + a "retina" context with a 2x scale transform. + + Scaling the font point sizes given to HarfBuzz to an assumed DPI + of 96 is problematic with this in mind, as fonts with optical + features such as 'trak' tables for tracking, or color glyphs, + will then base the metrics off of the wrong point size compared + to what the client asked for. + + This in turn causes mismatches between the metrics of the shaped + text and the actual rasterization, which doesn't include the 72 + to 96 DPI scaling. + + If a 96 DPI is needed, such as on the Web, the scaling should be + done outside of HarfBuzz, allowing the client to keep the DPI of + the shaping in sync with the rasterization. + + The recommended way to do that is by scaling the font point size, + not by applying a transform to the target Core Graphics context, + to let Core Text choose the right optical features of the target + point size, as described in WWDC 2015 session 804: + + https://developer.apple.com/videos/play/wwdc2015/804/ + + src/hb-aat-layout-trak-table.hh | 11 ++--------- + src/hb-coretext.cc | 25 ++++--------------------- + test/shaping/data/in-house/tests/aat-trak.tests | 14 +++++++------- + test/shaping/data/in-house/tests/macos.tests | 4 ++-- + 4 files changed, 15 insertions(+), 39 deletions(-) + commit 0d2727f4fe734af146785df10a44e3505e410ba1 Author: Behdad Esfahbod Date: Mon Jan 14 18:23:17 2019 -0800 diff -Nru harfbuzz-2.5.3/CMakeLists.txt harfbuzz-2.6.2/CMakeLists.txt --- harfbuzz-2.5.3/CMakeLists.txt 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/CMakeLists.txt 2019-10-26 02:02:54.000000000 +0000 @@ -43,6 +43,7 @@ endif () if (WIN32) option(HB_HAVE_UNISCRIBE "Enable Uniscribe shaper backend on Windows" OFF) + option(HB_HAVE_GDI "Enable GDI integration helpers on Windows" OFF) option(HB_HAVE_DIRECTWRITE "Enable DirectWrite shaper backend on Windows" OFF) endif () option(HB_BUILD_UTILS "Build harfbuzz utils, needs cairo, freetype, and glib properly be installed" OFF) @@ -77,6 +78,7 @@ set (HB_HAVE_GRAPHITE2 ON) if (WIN32) set (HB_HAVE_UNISCRIBE ON) + set (HB_HAVE_GDI ON) set (HB_HAVE_DIRECTWRITE ON) elseif (APPLE) set (HB_HAVE_CORETEXT ON) @@ -106,7 +108,7 @@ if (UNIX) list(APPEND CMAKE_REQUIRED_LIBRARIES m) endif () -check_funcs(atexit mprotect sysconf getpagesize mmap isatty newlocale strtod_l) +check_funcs(atexit mprotect sysconf getpagesize mmap isatty newlocale strtod_l roundf) check_include_file(unistd.h HAVE_UNISTD_H) if (${HAVE_UNISTD_H}) add_definitions(-DHAVE_UNISTD_H) @@ -140,8 +142,8 @@ ## Extract variables from Makefile files function (extract_make_variable variable makefile_source) - string(REGEX MATCH "${variable} = ([^$]+)\\$" temp ${makefile_source}) - string(REGEX MATCHALL "[^ \n\t\\]+" listVar ${CMAKE_MATCH_1}) + string(REGEX MATCH "${variable} = ([^$]+)\\$" temp "${makefile_source}") + string(REGEX MATCHALL "[^ \n\t\\]+" listVar "${CMAKE_MATCH_1}") set (${variable} ${listVar} PARENT_SCOPE) endfunction () @@ -157,8 +159,6 @@ file(READ ${PROJECT_SOURCE_DIR}/src/Makefile.sources SRCSOURCES) file(READ ${PROJECT_SOURCE_DIR}/util/Makefile.sources UTILSOURCES) -extract_make_variable(HB_BASE_sources ${SRCSOURCES}) -add_prefix_to_list(HB_BASE_sources "${PROJECT_SOURCE_DIR}/src/") extract_make_variable(HB_BASE_headers ${SRCSOURCES}) add_prefix_to_list(HB_BASE_headers "${PROJECT_SOURCE_DIR}/src/") @@ -192,59 +192,12 @@ set (HB_VERSION_MINOR ${CMAKE_MATCH_3}) set (HB_VERSION_MICRO ${CMAKE_MATCH_4}) - -## Define ragel tasks -# if (NOT IN_HB_DIST) -# foreach (ragel_output IN ITEMS ${HB_BASE_RAGEL_GENERATED_sources}) -# string(REGEX MATCH "([^/]+)\\.hh" temp ${ragel_output}) -# set (target_name ${CMAKE_MATCH_1}) -# add_custom_command(OUTPUT ${ragel_output} -# COMMAND ${RAGEL} -G2 -o ${ragel_output} ${PROJECT_SOURCE_DIR}/src/${target_name}.rl -I ${PROJECT_SOURCE_DIR} ${ARGN} -# DEPENDS ${PROJECT_SOURCE_DIR}/src/${target_name}.rl -# ) -# add_custom_target(harfbuzz_${target_name} DEPENDS ${PROJECT_BINARY_DIR}/src/${target_name}) -# endforeach () - -# mark_as_advanced(RAGEL) -# endif () - - -## Generate hb-version.h -# if (NOT IN_HB_DIST) -# set (HB_VERSION_H_IN "${PROJECT_SOURCE_DIR}/src/hb-version.h.in") -# set (HB_VERSION_H "${PROJECT_BINARY_DIR}/src/hb-version.h") -# set_source_files_properties("${HB_VERSION_H}" PROPERTIES GENERATED true) -# configure_file("${HB_VERSION_H_IN}" "${HB_VERSION_H}.tmp" @ONLY) -# execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_if_different -# "${HB_VERSION_H}.tmp" -# "${HB_VERSION_H}" -# ) -# file(REMOVE "${HB_VERSION_H}.tmp") -# endif () - - ## Define sources and headers of the project -set (project_sources - ${HB_BASE_sources} - ${HB_BASE_RAGEL_GENERATED_sources} -) - -set (subset_project_sources - ${HB_SUBSET_sources} -) - +set (project_sources ${PROJECT_SOURCE_DIR}/src/harfbuzz.cc) # use amalgam source +set (subset_project_sources ${HB_SUBSET_sources}) set (project_extra_sources) - -set (project_headers - #${HB_VERSION_H} - - ${HB_BASE_headers} -) - -set (subset_project_headers - ${HB_SUBSET_headers} -) - +set (project_headers ${HB_BASE_headers}) +set (subset_project_headers ${HB_SUBSET_headers}) ## Find and include needed header folders and libraries if (HB_HAVE_FREETYPE) @@ -257,7 +210,6 @@ include_directories(AFTER ${FREETYPE_INCLUDE_DIRS}) add_definitions(-DHAVE_FREETYPE=1) - list(APPEND project_sources ${PROJECT_SOURCE_DIR}/src/hb-ft.cc) list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-ft.h) # So check_funcs can find its headers @@ -275,7 +227,6 @@ include_directories(${GRAPHITE2_INCLUDE_DIR}) - list(APPEND project_sources ${PROJECT_SOURCE_DIR}/src/hb-graphite2.cc) list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-graphite2.h) list(APPEND THIRD_PARTY_LIBS ${GRAPHITE2_LIBRARY}) @@ -296,7 +247,6 @@ include_directories(${GLIBCONFIG_INCLUDE_DIR} ${GLIB_INCLUDE_DIR}) - list(APPEND project_sources ${PROJECT_SOURCE_DIR}/src/hb-glib.cc) list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-glib.h) list(APPEND THIRD_PARTY_LIBS ${GLIB_LIBRARIES}) @@ -316,7 +266,6 @@ include_directories(${ICU_INCLUDE_DIR}) - list(APPEND project_sources ${PROJECT_SOURCE_DIR}/src/hb-icu.cc) list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-icu.h) list(APPEND THIRD_PARTY_LIBS ${ICU_LIBRARY}) @@ -328,7 +277,6 @@ # Apple Advanced Typography add_definitions(-DHAVE_CORETEXT) - list(APPEND project_sources ${PROJECT_SOURCE_DIR}/src/hb-coretext.cc) list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-coretext.h) if (HB_IOS) @@ -359,21 +307,21 @@ endif () endif () +if (WIN32 AND HB_HAVE_GDI) + add_definitions(-DHAVE_GDI) + list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-gdi.h) + list(APPEND THIRD_PARTY_LIBS gdi32) +endif () + if (WIN32 AND HB_HAVE_UNISCRIBE) add_definitions(-DHAVE_UNISCRIBE) - - list(APPEND project_sources ${PROJECT_SOURCE_DIR}/src/hb-uniscribe.cc) list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-uniscribe.h) - list(APPEND THIRD_PARTY_LIBS usp10 gdi32 rpcrt4) endif () if (WIN32 AND HB_HAVE_DIRECTWRITE) add_definitions(-DHAVE_DIRECTWRITE) - - list(APPEND project_sources ${PROJECT_SOURCE_DIR}/src/hb-directwrite.cc) list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-directwrite.h) - list(APPEND THIRD_PARTY_LIBS dwrite rpcrt4) endif () @@ -481,7 +429,6 @@ ) endif () - ## Atomic ops availability detection file(WRITE "${PROJECT_BINARY_DIR}/try_compile_intel_atomic_primitives.c" " void memory_barrier (void) { __sync_synchronize (); } @@ -590,7 +537,6 @@ endif () if (HB_HAVE_INTROSPECTION) - find_package(PkgConfig) pkg_check_modules(PC_GI QUIET gobject-introspection-1.0) @@ -824,7 +770,7 @@ if (HB_BUILD_TESTS) ## src/ executables - foreach (prog main test test-gsub-would-substitute test-gpos-size-params test-buffer-serialize hb-ot-tag test-unicode-ranges) + foreach (prog main test test-gsub-would-substitute test-gpos-size-params test-buffer-serialize test-unicode-ranges) # hb-ot-tag set (prog_name ${prog}) if (${prog_name} STREQUAL "test") # test can not be used as a valid executable name on cmake, lets special case it @@ -833,7 +779,7 @@ add_executable(${prog_name} ${PROJECT_SOURCE_DIR}/src/${prog}.cc) target_link_libraries(${prog_name} harfbuzz ${THIRD_PARTY_LIBS}) endforeach () - set_target_properties(hb-ot-tag PROPERTIES COMPILE_FLAGS "-DMAIN") + # set_target_properties(hb-ot-tag PROPERTIES COMPILE_FLAGS "-DMAIN") ## Tests if (UNIX OR MINGW) diff -Nru harfbuzz-2.5.3/config.h.in harfbuzz-2.6.2/config.h.in --- harfbuzz-2.5.3/config.h.in 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/config.h.in 2019-10-26 02:02:55.000000000 +0000 @@ -42,6 +42,9 @@ /* Define to 1 if you have the `FT_Set_Var_Blend_Coordinates' function. */ #undef HAVE_FT_SET_VAR_BLEND_COORDINATES +/* Have GDI library */ +#undef HAVE_GDI + /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE @@ -87,6 +90,9 @@ /* Have PTHREAD_PRIO_INHERIT. */ #undef HAVE_PTHREAD_PRIO_INHERIT +/* Define to 1 if you have the `roundf' function. */ +#undef HAVE_ROUNDF + /* Define to 1 if you have the header file. */ #undef HAVE_SCHED_H diff -Nru harfbuzz-2.5.3/CONFIG.md harfbuzz-2.6.2/CONFIG.md --- harfbuzz-2.5.3/CONFIG.md 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/CONFIG.md 2019-10-26 02:02:54.000000000 +0000 @@ -40,7 +40,11 @@ library into your app, make sure your linker removes unused functions. This can be tricky and differ from environment to environment, but you definitely want to make sure this happens. Otherwise, every unused public function will -be adding unneeded bytes to your binary. +be adding unneeded bytes to your binary. The following pointers might come +handy: + + * https://lwn.net/Articles/741494/ (all of the four-part series) + * https://elinux.org/images/2/2d/ELC2010-gc-sections_Denys_Vlasenko.pdf Combining the above three build options should already shrink your library a lot. The rest of this file shows you ways to shrink the library even further at the @@ -86,6 +90,20 @@ without loss of functionality by defining `HB_NO_OT_FONT`. +## Shapers + +Most HarfBuzz clients use it for the main shaper, called "ot". However, it +is legitimate to want to compile HarfBuzz with only another backend, eg. +CoreText, for example for an iOS app. For that, you want `HB_NO_OT_SHAPE`. +If you are going down that route, check if you want `HB_NO_OT`. + +This is very rarely what you need. Make sure you understand exactly what you +are doing. + +Defining `HB_NO_FALLBACK_SHAPE` however is pretty harmless. That removes the +(unused) "fallback" shaper. + + ## Thread-safety By default HarfBuzz builds as a thread-safe library. The exception is that diff -Nru harfbuzz-2.5.3/configure harfbuzz-2.6.2/configure --- harfbuzz-2.5.3/configure 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/configure 2019-10-26 02:02:55.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HarfBuzz 2.5.3. +# Generated by GNU Autoconf 2.69 for HarfBuzz 2.6.2. # # Report bugs to . # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='HarfBuzz' PACKAGE_TARNAME='harfbuzz' -PACKAGE_VERSION='2.5.3' -PACKAGE_STRING='HarfBuzz 2.5.3' +PACKAGE_VERSION='2.6.2' +PACKAGE_STRING='HarfBuzz 2.6.2' PACKAGE_BUGREPORT='https://github.com/harfbuzz/harfbuzz/issues/new' PACKAGE_URL='http://harfbuzz.org/' @@ -644,6 +644,10 @@ HAVE_DIRECTWRITE_TRUE DIRECTWRITE_LIBS DIRECTWRITE_CXXFLAGS +HAVE_GDI_FALSE +HAVE_GDI_TRUE +GDI_LIBS +GDI_CFLAGS HAVE_UNISCRIBE_FALSE HAVE_UNISCRIBE_TRUE UNISCRIBE_LIBS @@ -902,6 +906,7 @@ with_graphite2 with_freetype with_uniscribe +with_gdi with_directwrite with_coretext ' @@ -1480,7 +1485,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HarfBuzz 2.5.3 to adapt to many kinds of systems. +\`configure' configures HarfBuzz 2.6.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1550,7 +1555,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HarfBuzz 2.5.3:";; + short | recursive ) echo "Configuration of HarfBuzz 2.6.2:";; esac cat <<\_ACEOF @@ -1608,6 +1613,8 @@ Use the FreeType library [default=auto] --with-uniscribe=[yes/no/auto] Use the Uniscribe library [default=no] + --with-gdi=[yes/no/auto] + Provide GDI integration helpers [default=no] --with-directwrite=[yes/no/auto] Use the DirectWrite library (experimental) [default=no] @@ -1732,7 +1739,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HarfBuzz configure 2.5.3 +HarfBuzz configure 2.6.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2550,7 +2557,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HarfBuzz $as_me 2.5.3, which was +It was created by HarfBuzz $as_me 2.6.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3419,7 +3426,7 @@ # Define the identity of the package. PACKAGE='harfbuzz' - VERSION='2.5.3' + VERSION='2.6.2' # Some tools Automake needs. @@ -19308,9 +19315,9 @@ HB_VERSION_MAJOR=2 -HB_VERSION_MINOR=5 -HB_VERSION_MICRO=3 -HB_VERSION=2.5.3 +HB_VERSION_MINOR=6 +HB_VERSION_MICRO=2 +HB_VERSION=2.6.2 @@ -19321,7 +19328,7 @@ -HB_LIBTOOL_VERSION_INFO=20503:0:20503 +HB_LIBTOOL_VERSION_INFO=20600:2:20600 @@ -19720,7 +19727,7 @@ # Functions and headers -for ac_func in atexit mprotect sysconf getpagesize mmap isatty newlocale strtod_l +for ac_func in atexit mprotect sysconf getpagesize mmap isatty newlocale strtod_l roundf do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -21652,6 +21659,51 @@ +# Check whether --with-gdi was given. +if test "${with_gdi+set}" = set; then : + withval=$with_gdi; +else + with_gdi=no +fi + +have_gdi=false +if test "x$with_gdi" = "xyes" -o "x$with_gdi" = "xauto"; then + for ac_header in windows.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default" +if test "x$ac_cv_header_windows_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WINDOWS_H 1 +_ACEOF + have_gdi=true +fi + +done + +fi +if test "x$with_gdi" = "xyes" -a "x$have_gdi" != "xtrue"; then + as_fn_error $? "gdi support requested but not found" "$LINENO" 5 +fi +if $have_gdi; then + GDI_CFLAGS= + GDI_LIBS="-lgdi32" + + + +$as_echo "#define HAVE_GDI 1" >>confdefs.h + +fi + if $have_gdi; then + HAVE_GDI_TRUE= + HAVE_GDI_FALSE='#' +else + HAVE_GDI_TRUE='#' + HAVE_GDI_FALSE= +fi + + + + # Check whether --with-directwrite was given. if test "${with_directwrite+set}" = set; then : withval=$with_directwrite; @@ -21692,7 +21744,7 @@ fi if $have_directwrite; then DIRECTWRITE_CXXFLAGS= - DIRECTWRITE_LIBS="-ldwrite" + DIRECTWRITE_LIBS= @@ -22160,6 +22212,10 @@ as_fn_error $? "conditional \"HAVE_UNISCRIBE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HAVE_GDI_TRUE}" && test -z "${HAVE_GDI_FALSE}"; then + as_fn_error $? "conditional \"HAVE_GDI\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${HAVE_DIRECTWRITE_TRUE}" && test -z "${HAVE_DIRECTWRITE_FALSE}"; then as_fn_error $? "conditional \"HAVE_DIRECTWRITE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -22565,7 +22621,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HarfBuzz $as_me 2.5.3, which was +This file was extended by HarfBuzz $as_me 2.6.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -22632,7 +22688,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HarfBuzz config.status 2.5.3 +HarfBuzz config.status 2.6.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -24626,6 +24682,7 @@ Platform shapers (not normally needed): CoreText: ${have_coretext} DirectWrite: ${have_directwrite} + GDI: ${have_gdi} Uniscribe: ${have_uniscribe} Other features: @@ -24655,6 +24712,7 @@ Platform shapers (not normally needed): CoreText: ${have_coretext} DirectWrite: ${have_directwrite} + GDI: ${have_gdi} Uniscribe: ${have_uniscribe} Other features: diff -Nru harfbuzz-2.5.3/configure.ac harfbuzz-2.6.2/configure.ac --- harfbuzz-2.5.3/configure.ac 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/configure.ac 2019-10-26 02:02:55.000000000 +0000 @@ -1,6 +1,6 @@ AC_PREREQ([2.64]) AC_INIT([HarfBuzz], - [2.5.3], + [2.6.2], [https://github.com/harfbuzz/harfbuzz/issues/new], [harfbuzz], [http://harfbuzz.org/]) @@ -77,7 +77,7 @@ ]) # Functions and headers -AC_CHECK_FUNCS(atexit mprotect sysconf getpagesize mmap isatty newlocale strtod_l) +AC_CHECK_FUNCS(atexit mprotect sysconf getpagesize mmap isatty newlocale strtod_l roundf) AC_CHECK_HEADERS(unistd.h sys/mman.h xlocale.h stdbool.h) # Compiler flags @@ -361,6 +361,28 @@ dnl =========================================================================== +AC_ARG_WITH(gdi, + [AS_HELP_STRING([--with-gdi=@<:@yes/no/auto@:>@], + [Provide GDI integration helpers @<:@default=no@:>@])],, + [with_gdi=no]) +have_gdi=false +if test "x$with_gdi" = "xyes" -o "x$with_gdi" = "xauto"; then + AC_CHECK_HEADERS(windows.h, have_gdi=true) +fi +if test "x$with_gdi" = "xyes" -a "x$have_gdi" != "xtrue"; then + AC_MSG_ERROR([gdi support requested but not found]) +fi +if $have_gdi; then + GDI_CFLAGS= + GDI_LIBS="-lgdi32" + AC_SUBST(GDI_CFLAGS) + AC_SUBST(GDI_LIBS) + AC_DEFINE(HAVE_GDI, 1, [Have GDI library]) +fi +AM_CONDITIONAL(HAVE_GDI, $have_gdi) + +dnl =========================================================================== + AC_ARG_WITH(directwrite, [AS_HELP_STRING([--with-directwrite=@<:@yes/no/auto@:>@], [Use the DirectWrite library (experimental) @<:@default=no@:>@])],, @@ -376,7 +398,7 @@ fi if $have_directwrite; then DIRECTWRITE_CXXFLAGS= - DIRECTWRITE_LIBS="-ldwrite" + DIRECTWRITE_LIBS= AC_SUBST(DIRECTWRITE_CXXFLAGS) AC_SUBST(DIRECTWRITE_LIBS) AC_DEFINE(HAVE_DIRECTWRITE, 1, [Have DirectWrite library]) @@ -510,6 +532,7 @@ Platform shapers (not normally needed): CoreText: ${have_coretext} DirectWrite: ${have_directwrite} + GDI: ${have_gdi} Uniscribe: ${have_uniscribe} Other features: diff -Nru harfbuzz-2.5.3/debian/changelog harfbuzz-2.6.2/debian/changelog --- harfbuzz-2.5.3/debian/changelog 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/debian/changelog 2019-10-26 02:02:55.000000000 +0000 @@ -1,8 +1,46 @@ -harfbuzz (2.5.3-1~ubuntu19.04.1) disco; urgency=low +harfbuzz (2.6.2-1~ubuntu19.04.1) disco; urgency=low * Auto build. - -- Adam Reviczky Sun, 21 Jul 2019 00:38:47 +0000 + -- Adam Reviczky Sat, 26 Oct 2019 02:02:55 +0000 + +harfbuzz (2.6.2-1) unstable; urgency=medium + + * Imstall cmake file in libharfbuzz-dev + * Revert "Add separate dh_makeshlibs call for the udeb" + This reverts commit a4bbcc06c858fb5f1e07dca96fc2eee32819036d. + * Add d/not-installed to list deliberately non-installed files + * Imported Upstream version 2.6.2 + * Update standards version to 4.4.1 + + -- أحمد المحمودي (Ahmed El-Mahmoudy) Thu, 03 Oct 2019 06:06:33 +0200 + +harfbuzz (2.6.1-3) unstable; urgency=medium + + * Added py3.diff patch to change shebang of python scripts to python3 + * Added python3:any to build deps (Closes: #939938) + + -- أحمد المحمودي (Ahmed El-Mahmoudy) Wed, 11 Sep 2019 05:59:47 +0200 + +harfbuzz (2.6.1-2) unstable; urgency=medium + + * Add separate dh_makeshlibs call for the udeb + + -- أحمد المحمودي (Ahmed El-Mahmoudy) Tue, 27 Aug 2019 05:42:57 +0200 + +harfbuzz (2.6.1-1) unstable; urgency=medium + + * New upstream version 2.6.1 + * Tag build autopkgtest as superficial + + -- أحمد المحمودي (Ahmed El-Mahmoudy) Mon, 26 Aug 2019 02:52:15 +0200 + +harfbuzz (2.6.0-1) unstable; urgency=medium + + * New upstream version 2.6.0 + * Update symbols' files + + -- أحمد المحمودي (Ahmed El-Mahmoudy) Fri, 16 Aug 2019 04:06:52 +0200 harfbuzz (2.5.3-1) unstable; urgency=medium diff -Nru harfbuzz-2.5.3/debian/control harfbuzz-2.6.2/debian/control --- harfbuzz-2.5.3/debian/control 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/debian/control 2019-10-26 02:02:55.000000000 +0000 @@ -3,9 +3,9 @@ Priority: optional Maintainer: أحمد المحمودي (Ahmed El-Mahmoudy) Uploaders: Emilio Pozuelo Monfort -Standards-Version: 4.4.0 +Standards-Version: 4.4.1 Build-Depends: - debhelper (>= 12), + debhelper (>= 11), pkg-config, libglib2.0-dev (>= 2.19.1), libcairo2-dev, @@ -15,6 +15,7 @@ libgirepository1.0-dev (>= 1.31.0-2), gobject-introspection (>= 1.42.0), gtk-doc-tools (>= 1.15), + python3:any Homepage: https://www.freedesktop.org/wiki/Software/HarfBuzz Vcs-Git: https://salsa.debian.org/freedesktop-team/harfbuzz.git Vcs-Browser: https://salsa.debian.org/freedesktop-team/harfbuzz diff -Nru harfbuzz-2.5.3/debian/git-build-recipe.manifest harfbuzz-2.6.2/debian/git-build-recipe.manifest --- harfbuzz-2.5.3/debian/git-build-recipe.manifest 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/debian/git-build-recipe.manifest 2019-10-26 02:02:55.000000000 +0000 @@ -1,2 +1,2 @@ -# git-build-recipe format 0.4 deb-version 2.5.3-1 -lp:~reviczky/+git/harfbuzz git-commit:3009e2cdaee61140b7c95f0126874c39df3cb8b8 +# git-build-recipe format 0.4 deb-version 2.6.2-1 +lp:~reviczky/+git/harfbuzz git-commit:1340832b4c588fbee5c0b29d71f3b30a39d748ce diff -Nru harfbuzz-2.5.3/debian/gitlab-ci.yml harfbuzz-2.6.2/debian/gitlab-ci.yml --- harfbuzz-2.5.3/debian/gitlab-ci.yml 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/debian/gitlab-ci.yml 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,6 @@ +include: + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml + +variables: + RELEASE: 'unstable' diff -Nru harfbuzz-2.5.3/debian/libharfbuzz0b.symbols harfbuzz-2.6.2/debian/libharfbuzz0b.symbols --- harfbuzz-2.5.3/debian/libharfbuzz0b.symbols 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/debian/libharfbuzz0b.symbols 2019-10-26 02:02:55.000000000 +0000 @@ -182,6 +182,7 @@ hb_font_set_user_data@Base 0.6.0 hb_font_set_var_coords_design@Base 1.4.2 hb_font_set_var_coords_normalized@Base 1.4.1 + hb_font_set_var_named_instance@Base 2.6.0 hb_font_set_variations@Base 1.4.2 hb_font_subtract_glyph_origin_for_direction@Base 0.6.0 hb_ft_face_create@Base 0.6.0 @@ -238,6 +239,7 @@ hb_ot_layout_feature_get_name_ids@Base 2.1.1 hb_ot_layout_feature_with_variations_get_lookups@Base 1.4.1 hb_ot_layout_get_attach_points@Base 0.6.0 + hb_ot_layout_get_baseline@Base 2.6.0 hb_ot_layout_get_glyph_class@Base 0.9.9 hb_ot_layout_get_glyphs_in_class@Base 0.9.9 hb_ot_layout_get_ligature_carets@Base 0.6.0 @@ -273,6 +275,12 @@ hb_ot_math_get_min_connector_overlap@Base 1.4.1 hb_ot_math_has_data@Base 1.4.1 hb_ot_math_is_glyph_extended_shape@Base 1.4.1 + hb_ot_meta_get_entry_tags@Base 2.6.0 + hb_ot_meta_reference_entry@Base 2.6.0 + hb_ot_metrics_get_position@Base 2.6.0 + hb_ot_metrics_get_variation@Base 2.6.0 + hb_ot_metrics_get_x_variation@Base 2.6.0 + hb_ot_metrics_get_y_variation@Base 2.6.0 hb_ot_name_get_utf16@Base 2.1.1 hb_ot_name_get_utf32@Base 2.1.1 hb_ot_name_get_utf8@Base 2.1.1 diff -Nru harfbuzz-2.5.3/debian/libharfbuzz-dev.install harfbuzz-2.6.2/debian/libharfbuzz-dev.install --- harfbuzz-2.5.3/debian/libharfbuzz-dev.install 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/debian/libharfbuzz-dev.install 2019-10-26 02:02:55.000000000 +0000 @@ -3,3 +3,4 @@ usr/lib/*/*.so usr/lib/*/pkgconfig/*.pc usr/share/gir-*/*.gir +usr/lib/*/cmake/*/*.cmake diff -Nru harfbuzz-2.5.3/debian/libharfbuzz-gobject0.symbols harfbuzz-2.6.2/debian/libharfbuzz-gobject0.symbols --- harfbuzz-2.5.3/debian/libharfbuzz-gobject0.symbols 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/debian/libharfbuzz-gobject0.symbols 2019-10-26 02:02:55.000000000 +0000 @@ -21,12 +21,15 @@ hb_gobject_map_get_type@Base 1.8.5 hb_gobject_memory_mode_get_type@Base 0.9.20 hb_gobject_ot_color_palette_flags_get_type@Base 2.1.1 + hb_gobject_ot_layout_baseline_tag_get_type@Base 2.6.0 hb_gobject_ot_layout_glyph_class_get_type@Base 0.9.20 hb_gobject_ot_math_constant_get_type@Base 1.4.1 hb_gobject_ot_math_glyph_part_flags_get_type@Base 1.4.1 hb_gobject_ot_math_glyph_part_get_type@Base 1.7.6 hb_gobject_ot_math_glyph_variant_get_type@Base 1.7.6 hb_gobject_ot_math_kern_get_type@Base 1.4.1 + hb_gobject_ot_meta_tag_get_type@Base 2.6.0 + hb_gobject_ot_metrics_tag_get_type@Base 2.6.0 hb_gobject_ot_var_axis_flags_get_type@Base 2.2.0 hb_gobject_script_get_type@Base 0.9.20 hb_gobject_segment_properties_get_type@Base 0.9.20 diff -Nru harfbuzz-2.5.3/debian/not-installed harfbuzz-2.6.2/debian/not-installed --- harfbuzz-2.5.3/debian/not-installed 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/debian/not-installed 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,3 @@ +usr/lib/*/*subset* +usr/lib/*/pkgconfig/*subset.pc +usr/lib/*/*la diff -Nru harfbuzz-2.5.3/debian/tests/control harfbuzz-2.6.2/debian/tests/control --- harfbuzz-2.5.3/debian/tests/control 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/debian/tests/control 2019-10-26 02:02:55.000000000 +0000 @@ -1,2 +1,3 @@ Tests: build Depends: libharfbuzz-dev, build-essential, pkg-config +Restrictions: superficial diff -Nru harfbuzz-2.5.3/docs/harfbuzz-docs.xml harfbuzz-2.6.2/docs/harfbuzz-docs.xml --- harfbuzz-2.5.3/docs/harfbuzz-docs.xml 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/harfbuzz-docs.xml 2019-10-26 02:02:55.000000000 +0000 @@ -36,9 +36,9 @@ - - + + @@ -130,9 +130,13 @@ - API Index Index of deprecated API + API Index + Index of new symbols in 2.6.0 + Index of new symbols in 2.5.0 + Index of new symbols in 2.4.0 + Index of new symbols in 2.3.0 Index of new symbols in 2.2.0 Index of new symbols in 2.1.0 Index of new symbols in 2.0.0 diff -Nru harfbuzz-2.5.3/docs/harfbuzz-sections.txt harfbuzz-2.6.2/docs/harfbuzz-sections.txt --- harfbuzz-2.5.3/docs/harfbuzz-sections.txt 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/harfbuzz-sections.txt 2019-10-26 02:02:55.000000000 +0000 @@ -1,6 +1,7 @@ HB_H_IN HB_OT_H_IN +HB_AAT_H_IN
@@ -179,6 +180,7 @@ HB_SCRIPT_CANADIAN_ABORIGINAL hb_font_funcs_set_glyph_func hb_font_get_glyph_func_t +HB_MATH_GLYPH_PART_FLAG_EXTENDER hb_ot_layout_table_choose_script hb_ot_layout_table_find_script hb_ot_tag_from_language @@ -195,12 +197,7 @@ hb_unicode_decompose_compatibility_func_t hb_unicode_decompose_compatibility hb_unicode_funcs_set_decompose_compatibility_func -hb_font_funcs_set_glyph_h_kerning_func hb_font_funcs_set_glyph_v_kerning_func -hb_font_get_glyph_h_kerning -hb_font_get_glyph_h_kerning_func_t -hb_font_get_glyph_kerning_for_direction -hb_font_get_glyph_kerning_func_t hb_font_get_glyph_v_kerning hb_font_get_glyph_v_kerning_func_t
@@ -271,6 +268,7 @@ hb_font_funcs_set_glyph_from_name_func hb_font_funcs_set_glyph_h_advance_func hb_font_funcs_set_glyph_h_advances_func +hb_font_funcs_set_glyph_h_kerning_func hb_font_funcs_set_glyph_h_origin_func hb_font_funcs_set_glyph_name_func hb_font_funcs_set_glyph_v_advance_func @@ -300,8 +298,12 @@ hb_font_get_glyph_h_advance_func_t hb_font_get_glyph_h_advances hb_font_get_glyph_h_advances_func_t +hb_font_get_glyph_h_kerning +hb_font_get_glyph_h_kerning_func_t hb_font_get_glyph_h_origin hb_font_get_glyph_h_origin_func_t +hb_font_get_glyph_kerning_for_direction +hb_font_get_glyph_kerning_func_t hb_font_get_glyph_name hb_font_get_glyph_name_func_t hb_font_get_glyph_origin_for_direction @@ -340,6 +342,7 @@ hb_font_set_variations hb_font_set_var_coords_design hb_font_set_var_coords_normalized +hb_font_set_var_named_instance hb_font_subtract_glyph_origin_for_direction hb_font_t hb_reference_table_func_t @@ -368,6 +371,11 @@
+hb-gdi +hb_gdi_face_create +
+ +
hb-glib hb_glib_get_unicode_funcs hb_glib_script_from_script @@ -540,6 +548,7 @@ HB_OT_TAG_GPOS HB_OT_TAG_GSUB HB_OT_TAG_JSTF +hb_ot_layout_baseline_tag_t hb_ot_layout_collect_lookups hb_ot_layout_collect_features hb_ot_layout_feature_get_characters @@ -547,6 +556,7 @@ hb_ot_layout_feature_get_name_ids hb_ot_layout_feature_with_variations_get_lookups hb_ot_layout_get_attach_points +hb_ot_layout_get_baseline hb_ot_layout_get_glyph_class hb_ot_layout_get_glyphs_in_class hb_ot_layout_get_ligature_carets @@ -601,6 +611,22 @@
+hb-ot-meta +hb_ot_meta_t +hb_ot_meta_get_entry_tags +hb_ot_meta_reference_entry +
+ +
+hb-ot-metrics +hb_ot_metrics_t +hb_ot_metrics_get_position +hb_ot_metrics_get_variation +hb_ot_metrics_get_x_variation +hb_ot_metrics_get_y_variation +
+ +
hb-ot-shape hb_ot_shape_glyphs_closure
diff -Nru harfbuzz-2.5.3/docs/harfbuzz.types harfbuzz-2.6.2/docs/harfbuzz.types --- harfbuzz-2.5.3/docs/harfbuzz.types 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/harfbuzz.types 2019-10-26 02:02:55.000000000 +0000 @@ -19,12 +19,15 @@ hb_gobject_map_get_type hb_gobject_memory_mode_get_type hb_gobject_ot_color_palette_flags_get_type +hb_gobject_ot_layout_baseline_tag_get_type hb_gobject_ot_layout_glyph_class_get_type hb_gobject_ot_math_constant_get_type hb_gobject_ot_math_glyph_part_flags_get_type hb_gobject_ot_math_glyph_part_get_type hb_gobject_ot_math_glyph_variant_get_type hb_gobject_ot_math_kern_get_type +hb_gobject_ot_meta_tag_get_type +hb_gobject_ot_metrics_tag_get_type hb_gobject_ot_var_axis_flags_get_type hb_gobject_script_get_type hb_gobject_segment_properties_get_type diff -Nru harfbuzz-2.5.3/docs/html/adding-text-to-the-buffer.html harfbuzz-2.6.2/docs/html/adding-text-to-the-buffer.html --- harfbuzz-2.5.3/docs/html/adding-text-to-the-buffer.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/adding-text-to-the-buffer.html 2019-10-26 02:02:55.000000000 +0000 @@ -25,8 +25,79 @@

Now we have a brand new HarfBuzz buffer. Let's start filling it with text! From HarfBuzz's perspective, a buffer is just a stream - of Unicode codepoints, but your input string is probably in one of - the standard Unicode character encodings (UTF-8, UTF-16, UTF-32) + of Unicode code points, but your input string is probably in one of + the standard Unicode character encodings (UTF-8, UTF-16, or + UTF-32). HarfBuzz provides convenience functions that accept + each of these encodings: + hb_buffer_add_utf8(), + hb_buffer_add_utf16(), and + hb_buffer_add_utf32(). Other than the + character encoding they accept, they function identically. +

+

+ You can add UTF-8 text to a buffer by passing in the text array, + the array's length, an offset into the array for the first + character to add, and the length of the segment to add: +

+
+    hb_buffer_add_utf8 (hb_buffer_t *buf,
+                    const char *text,
+                    int text_length,
+                    unsigned int item_offset,
+                    int item_length)
+    
+

+ So, in practice, you can say: +

+
+      hb_buffer_add_utf8(buf, text, strlen(text), 0, strlen(text));
+    
+

+ This will append your new characters to + buf, not replace its existing + contents. Also, note that you can use -1 in + place of the first instance of strlen(text) + if your text array is NULL-terminated. Similarly, you can also use + -1 as the final argument want to add its full + contents. +

+

+ Whatever start item_offset and + item_length you provide, HarfBuzz will also + attempt to grab the five characters before + the offset point and the five characters + after the designated end. These are the + before and after "context" segments, which are used internally + for HarfBuzz to make shaping decisions. They will not be part of + the final output, but they ensure that HarfBuzz's + script-specific shaping operations are correct. If there are + fewer than five characters available for the before or after + contexts, HarfBuzz will just grab what is there. +

+

+ For longer text runs, such as full paragraphs, it might be + tempting to only add smaller sub-segments to a buffer and + shape them in piecemeal fashion. Generally, this is not a good + idea, however, because a lot of shaping decisions are + dependent on this context information. For example, in Arabic + and other connected scripts, HarfBuzz needs to know the code + points before and after each character in order to correctly + determine which glyph to return. +

+

+ The safest approach is to add all of the text available, then + use item_offset and + item_length to indicate which characters you + want shaped, so that HarfBuzz has access to any context. +

+

+ You can also add Unicode code points directly with + hb_buffer_add_codepoints(). The arguments + to this function are the same as those for the UTF + encodings. But it is particularly important to note that + HarfBuzz does not do validity checking on the text that is added + to a buffer. Invalid code points will be replaced, but it is up + to you to do any deep-sanity checking necessary.

diff -Nru harfbuzz-2.5.3/docs/html/ch13.html harfbuzz-2.6.2/docs/html/ch13.html --- harfbuzz-2.5.3/docs/html/ch13.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/ch13.html 2019-10-26 02:02:55.000000000 +0000 @@ -2,12 +2,12 @@ -Integration API: HarfBuzz Manual +Apple Advanced Typography API: HarfBuzz Manual - - + + @@ -16,35 +16,15 @@ Home Up -Prev -Next +Prev +Next

-Integration API

-
-
-hb-coretext — CoreText integration -
-
-hb-ft — FreeType integration -
-
-hb-glib — GLib integration -
-
-hb-gobject — GObject integration -
-
-hb-graphite2 — Graphite2 integration -
-
-hb-icu — ICU integration -
-
-hb-uniscribe — Windows integration -
-
+Apple Advanced Typography API
+
+hb-aat-layout — Apple Advanced Typography Layout +
diff -Nru harfbuzz-2.5.3/docs/html/ch14.html harfbuzz-2.6.2/docs/html/ch14.html --- harfbuzz-2.5.3/docs/html/ch14.html 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/ch14.html 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,52 @@ + + + + +Integration API: HarfBuzz Manual + + + + + + + + + + + + + + + + +
+

+Integration API

+
+
+hb-coretext — CoreText integration +
+
+hb-ft — FreeType integration +
+
+hb-glib — GLib integration +
+
+hb-gobject — GObject integration +
+
+hb-graphite2 — Graphite2 integration +
+
+hb-icu — ICU integration +
+
+hb-uniscribe — Windows integration +
+
+
+ + + \ No newline at end of file diff -Nru harfbuzz-2.5.3/docs/html/clusters.html harfbuzz-2.6.2/docs/html/clusters.html --- harfbuzz-2.5.3/docs/html/clusters.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/clusters.html 2019-10-26 02:02:55.000000000 +0000 @@ -6,7 +6,7 @@ - + @@ -16,7 +16,7 @@ Home Up -Prev +Prev Next
diff -Nru harfbuzz-2.5.3/docs/html/customizing-unicode-functions.html harfbuzz-2.6.2/docs/html/customizing-unicode-functions.html --- harfbuzz-2.5.3/docs/html/customizing-unicode-functions.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/customizing-unicode-functions.html 2019-10-26 02:02:55.000000000 +0000 @@ -6,8 +6,8 @@ - - + + @@ -16,13 +16,113 @@ Home Up -Prev +Prev Next

Customizing Unicode functions

+ HarfBuzz requires some simple functions for accessing + information from the Unicode Character Database (such as the + General_Category (gc) and + Script (sc) properties) that is useful + for shaping, as well as some useful operations like composing and + decomposing code points. +

+

+ HarfBuzz includes its own internal, lightweight set of Unicode + functions. At build time, it is also possible to compile support + for some other options, such as the Unicode functions provided + by GLib or the International Components for Unicode (ICU) + library. Generally, this option is only of interest for client + programs that have specific integration requirements or that do + a significant amount of customization. +

+

+ If your program has access to other Unicode functions, however, + such as through a system library or application framework, you + might prefer to use those instead of the built-in + options. HarfBuzz supports this by implementing its Unicode + functions as a set of virtual methods that you can replace — + without otherwise affecting HarfBuzz's functionality. +

+

+ The Unicode functions are specified in a structure called + unicode_funcs which is attached to each + buffer. But even though unicode_funcs is + associated with a hb_buffer_t, the functions + themselves are called by other HarfBuzz APIs that access + buffers, so it would be unwise for you to hook different + functions into different buffers. +

+

+ In addition, you can mark your unicode_funcs + as immutable by calling + hb_unicode_funcs_make_immutable (ufuncs). + This is especially useful if your code is a + library or framework that will have its own client programs. By + marking your Unicode function choices as immutable, you prevent + your own client programs from changing the + unicode_funcs configuration and introducing + inconsistencies and errors downstream. +

+

+ You can retrieve the Unicode-functions configuration for + your buffer by calling hb_buffer_get_unicode_funcs(): +

+
+      hb_unicode_funcs_t *ufunctions;
+      ufunctions = hb_buffer_get_unicode_funcs(buf);
+    
+

+ The current version of unicode_funcs uses six functions: +

+
    +
  • + hb_unicode_combining_class_func_t: + returns the Canonical Combining Class of a code point. +

  • +
  • + hb_unicode_general_category_func_t: + returns the General Category (gc) of a code point. +

  • +
  • + hb_unicode_mirroring_func_t: returns + the Mirroring Glyph code point (for bi-directional + replacement) of a code point. +

  • +
  • + hb_unicode_script_func_t: returns the + Script (sc) property of a code point. +

  • +
  • + hb_unicode_compose_func_t: returns the + canonical composition of a sequence of two code points. +

  • +
  • + hb_unicode_decompose_func_t: returns + the canonical decomposition of a code point. +

  • +
+

+ Note, however, that future HarfBuzz releases may alter this set. +

+

+ Each Unicode function has a corresponding setter, with which you + can assign a callback to your replacement function. For example, + to replace + hb_unicode_general_category_func_t, you can call +

+
+      hb_unicode_funcs_set_general_category_func (*ufuncs, func, *user_data, destroy)	    
+    
+

+ Virtualizing this set of Unicode functions is primarily intended + to improve portability. There is no need for every client + program to make the effort to replace the default options, so if + you are unsure, do not feel any pressure to customize + unicode_funcs.

+

+ In the previous chapter, we saw how to set up a buffer and fill + it with text as Unicode code points. In order to shape this + buffer text with HarfBuzz, you will need also need a font + object. +

+

+ HarfBuzz provides abstractions to help you cache and reuse the + heavier parts of working with binary fonts, so we will look at + how to do that. We will also look at how to work with the + FreeType font-rendering library and at how you can customize + HarfBuzz to work with other libraries. +

+

+ Finally, we will look at how to work with OpenType variable + fonts, the latest update to the OpenType font format, and at + some other recent additions to OpenType. +

-Using FreeType

+Font and face objects
+

+ The outcome of shaping a run of text depends on the contents of + a specific font file (such as the substitutions and positioning + moves in the 'GSUB' and 'GPOS' tables), so HarfBuzz makes + accessing those internals fast. +

+

+ An hb_face_t represents a face + in HarfBuzz. This data type is a wrapper around an + hb_blob_t blob that holds the contents of a binary + font file. Since HarfBuzz supports TrueType Collections and + OpenType Collections (each of which can include multiple + typefaces), a HarfBuzz face also requires an index number + specifying which typeface in the file you want to use. Most of + the font files you will encounter in the wild include just a + single face, however, so most of the time you would pass in + 0 as the index when you create a face: +

+
+      hb_blob_t* blob = hb_blob_create_from_file(file);
+      ...
+      hb_face_t* face = hb_face_create(blob, 0);
+    
+

+ On its own, a face object is not quite ready to use for + shaping. The typeface must be set to a specific point size in + order for some details (such as hinting) to work. In addition, + if the font file in question is an OpenType Variable Font, then + you may need to specify one or variation-axis settings (or a + named instance) in order to get the output you need. +

+

+ In HarfBuzz, you do this by creating a font + object from your face. +

+

+ Font objects also have the advantage of being considerably + lighter-weight than face objects (remember that a face contains + the contents of a binary font file mapped into memory). As a + result, you can cache and reuse a font object, but you could + also create a new one for each additional size you needed. + Creating new fonts incurs some additional overhead, of course, + but whether or not it is excessive is your call in the end. In + contrast, face objects are substantially larger, and you really + should cache them and reuse them whenever possible. +

+

+ You can create a font object from a face object: +

+
+      hb_font_t* hb_font = hb_font_create(hb_face);
+    
+

+ After creating a font, there are a few properties you should + set. Many fonts enable and disable hints based on the size it + is used at, so setting this is important for font + objects. hb_font_set_ppem(font, x_ppem, + y_ppem) sets the pixels-per-EM value of the font. You + can also set the point size of the font with + hb_font_set_ptem(font, ptem). HarfBuzz uses the + industry standard 72 points per inch. +

+

+ HarfBuzz lets you specify the degree subpixel precision you want + through a scaling factor. You can set horizontal and + vertical scaling factors on the + font by calling hb_font_set_scale(font, x_scale, + y_scale). +

+

+ There may be times when you are handed a font object and need to + access the face object that it comes from. For that, you can call +

+
+      hb_face = hb_font_get_face(hb_font);
+    
+

+ You can also create a font object from an existing font object + using the hb_font_create_sub_font() + function. This creates a child font object that is initiated + with the same attributes as its parent; it can be used to + quickly set up a new font for the purpose of overriding a specific + font-functions method. +

+

+ All face objects and font objects are lifecycle-managed by + HarfBuzz. After creating a face, you increase its reference + count with hb_face_reference(face) and + decrease it with + hb_face_destroy(face). Likewise, you + increase the reference count on a font with + hb_font_reference(font) and decrease it + with hb_font_destroy(font). +

+ You can also attach user data to face objects and font objects.

diff -Nru harfbuzz-2.5.3/docs/html/fonts-and-faces-native-opentype.html harfbuzz-2.6.2/docs/html/fonts-and-faces-native-opentype.html --- harfbuzz-2.5.3/docs/html/fonts-and-faces-native-opentype.html 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/fonts-and-faces-native-opentype.html 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,93 @@ + + + + +Font objects and HarfBuzz's native OpenType implementation: HarfBuzz Manual + + + + + + + + + + + + + + + + +
+

+Font objects and HarfBuzz's native OpenType implementation

+

+ By default, whenever HarfBuzz creates a font object, it will + configure the font to use a built-in set of font functions that + supports contemporary OpenType font internals. If you want to + work with OpenType or TrueType fonts, you should be able to use + these functions without difficulty. +

+

+ Many of the methods in the font-functions structure deal with + the fundamental properties of glyphs that are required for + shaping text: extents (the maximums and minimums on each axis), + origins (the (0,0) coordinate point which + glyphs are drawn in reference to), and advances (the amount that + the cursor needs to be moved after drawing each glyph, including + any empty space for the glyph's side bearings). +

+

+ As you can see in the list of functions, there are separate "horizontal" + and "vertical" variants depending on whether the text is set in + the horizontal or vertical direction. For some scripts, fonts + that are designed to support text set horizontally or vertically (for + example, in Japanese) may include metrics for both text + directions. When fonts don't include this information, HarfBuzz + does its best to transform what the font provides. +

+

+ In addition to the direction-specific functions, HarfBuzz + provides some higher-level functions for fetching information + like extents and advances for a glyph. If you call +

+
+      hb_font_get_glyph_advance_for_direction(font, direction, extents);
+    
+

+ then you can provide any hb_direction_t as the + direction parameter, and HarfBuzz will + use the correct function variant for the text direction. There + are similar higher-level versions of the functions for fetching + extents, origin coordinates, and contour-point + coordinates. There are also addition and subtraction functions + for moving points with respect to the origin. +

+

+ There are also methods for fetching the glyph ID that + corresponds to a Unicode code point (possibly when followed by a + variation-selector code point), fetching the glyph name from the + font, and fetching the glyph ID that corresponds to a glyph name + you already have. +

+

+ HarfBuzz also provides functions for converting between glyph + names and string + variables. hb_font_glyph_to_string(font, glyph, s, + size) retrieves the name for the glyph ID + glyph from the font object. It generates a + generic name of the form gidDDD (where DDD is + the glyph index) if there is no name for the glyph in the + font. The hb_font_glyph_from_string(font, s, len, + glyph) takes an input string s + and looks for a glyph with that name in the font, returning its + glyph ID in the glyph + output parameter. It automatically parses + gidDDD and uniUUUU strings. +

+
+ + + \ No newline at end of file diff -Nru harfbuzz-2.5.3/docs/html/fonts-and-faces-variable.html harfbuzz-2.6.2/docs/html/fonts-and-faces-variable.html --- harfbuzz-2.5.3/docs/html/fonts-and-faces-variable.html 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/fonts-and-faces-variable.html 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,100 @@ + + + + +Working with OpenType Variable Fonts: HarfBuzz Manual + + + + + + + + + + + + + + + + +
+

+Working with OpenType Variable Fonts

+

+ If you are working with OpenType Variable Fonts, there are a few + additional functions you should use to specify the + variation-axis settings of your font object. Without doing so, + your variable font's font object can still be used, but only at + the default setting for every axis (which, of course, is + sometimes what you want, but does not cover general usage). +

+

+ HarfBuzz manages variation settings in the + hb_variation_t data type, which holds a tag for the + variation-axis identifier tag and a value for its + setting. You can retrieve the list of variation axes in a font + binary from the face object (not from a font object, notably) by + calling hb_ot_var_get_axis_count(face) to + find the number of axes, then using + hb_ot_var_get_axis_infos() to collect the + axis structures: +

+
+      axes = hb_ot_var_get_axis_count(face);
+      ...
+      hb_ot_var_get_axis_infos(face, 0, axes, axes_array);
+    
+

+ For each axis returned in the array, you can can access the + identifier in its tag. HarfBuzz also has + tag definitions predefined for the five standard axes specified + in OpenType (ital for italic, + opsz for optical size, + slnt for slant, wdth for + width, and wght for weight). Each axis also + has a min_value, a + default_value, and a max_value. +

+

+ To set your font object's variation settings, you call the + hb_font_set_variations() function with an + array of hb_variation_t variation settings. Let's + say our font has weight and width axes. We need to specify each + of the axes by tag and assign a value on the axis: +

+
+      unsigned int variation_count = 2;
+      hb_variation_t variation_data[variation_count];
+      variation_data[0].tag = HB_OT_TAG_VAR_AXIS_WIDTH;
+      variation_data[1].tag = HB_OT_TAG_VAR_AXIS_WEIGHT;
+      variation_data[0].value = 80;
+      variation_data[1].value = 750;
+      ...
+      hb_font_set_variations(font, variation_data, variation_count);
+    
+

+ That should give us a slightly condensed font ("normal" on the + wdth axis is 100) at a noticeably bolder + weight ("regular" is 400 on the wght axis). +

+

+ In practice, though, you should always check that the value you + want to set on the axis is within the + [min_value,max_value] + range actually implemented in the font's variation axis. After + all, a font might only provide lighter-than-regular weights, and + setting a heavier value on the wght axis will + not change that. +

+

+ Once your variation settings are specified on your font object, + however, shaping with a variable font is just like shaping a + static font. +

+
+ + + \ No newline at end of file diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz.devhelp2 harfbuzz-2.6.2/docs/html/harfbuzz.devhelp2 --- harfbuzz-2.5.3/docs/html/harfbuzz.devhelp2 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/harfbuzz.devhelp2 2019-10-26 02:02:55.000000000 +0000 @@ -44,13 +44,19 @@ - - - - - + + + + + + + + + + + @@ -64,14 +70,18 @@ - - - + + + + + + + + - - + @@ -85,7 +95,7 @@ - + @@ -94,10 +104,10 @@ - + - + @@ -106,8 +116,12 @@ - + + + + + @@ -275,18 +289,14 @@ - - - - + - @@ -329,6 +339,7 @@ + @@ -355,7 +366,10 @@ + + + @@ -389,6 +403,7 @@ + @@ -400,6 +415,7 @@ + @@ -539,6 +555,7 @@ + @@ -577,6 +594,7 @@ + @@ -860,6 +878,14 @@ + + + + + + + + diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-aat-layout.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-aat-layout.html --- harfbuzz-2.5.3/docs/html/harfbuzz-hb-aat-layout.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-aat-layout.html 2019-10-26 02:02:55.000000000 +0000 @@ -5,9 +5,9 @@ hb-aat-layout: HarfBuzz Manual - - - + + + @@ -19,9 +19,9 @@ Object Hierarchy Home -Up -Prev -Next +Up +Prev +Next
diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-blob.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-blob.html --- harfbuzz-2.5.3/docs/html/harfbuzz-hb-blob.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-blob.html 2019-10-26 02:02:55.000000000 +0000 @@ -5,8 +5,8 @@ hb-blob: HarfBuzz Manual - - + + @@ -19,8 +19,8 @@ Object Hierarchy Home -Up -Prev +Up +Prev Next
diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-buffer.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-buffer.html --- harfbuzz-2.5.3/docs/html/harfbuzz-hb-buffer.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-buffer.html 2019-10-26 02:02:55.000000000 +0000 @@ -5,7 +5,7 @@ hb-buffer: HarfBuzz Manual - + @@ -19,7 +19,7 @@ Object Hierarchy Home -Up +Up Prev Next diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-common.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-common.html --- harfbuzz-2.5.3/docs/html/harfbuzz-hb-common.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-common.html 2019-10-26 02:02:55.000000000 +0000 @@ -5,7 +5,7 @@ hb-common: HarfBuzz Manual - + @@ -19,7 +19,7 @@ Object Hierarchy Home -Up +Up Prev Next diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-coretext.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-coretext.html --- harfbuzz-2.5.3/docs/html/harfbuzz-hb-coretext.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-coretext.html 2019-10-26 02:02:55.000000000 +0000 @@ -5,8 +5,8 @@ hb-coretext: HarfBuzz Manual - - + + @@ -18,8 +18,8 @@ Description Home -Up -Prev +Up +Prev Next
diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-deprecated.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-deprecated.html --- harfbuzz-2.5.3/docs/html/harfbuzz-hb-deprecated.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-deprecated.html 2019-10-26 02:02:55.000000000 +0000 @@ -5,7 +5,7 @@ hb-deprecated: HarfBuzz Manual - + @@ -18,7 +18,7 @@ Description Home -Up +Up Prev Next @@ -60,14 +60,6 @@ void -hb_font_funcs_set_glyph_h_kerning_func () - - - - -void - - hb_font_funcs_set_glyph_v_kerning_func () @@ -76,30 +68,6 @@ hb_position_t -hb_font_get_glyph_h_kerning () - - - - -void - - -hb_font_get_glyph_kerning_for_direction () - - - - -hb_position_t - - -(*hb_font_get_glyph_kerning_func_t) () - - - - -hb_position_t - - hb_font_get_glyph_v_kerning () @@ -128,15 +96,15 @@ #define -HB_OT_VAR_NO_AXIS_INDEX +HB_MATH_GLYPH_PART_FLAG_EXTENDER #define -HB_UNICODE_MAX_DECOMPOSITION_LEN +HB_OT_VAR_NO_AXIS_INDEX -typedef -hb_font_get_glyph_h_kerning_func_t +#define +HB_UNICODE_MAX_DECOMPOSITION_LEN typedef @@ -217,39 +185,6 @@

-

hb_font_funcs_set_glyph_h_kerning_func ()

-
void
-hb_font_funcs_set_glyph_h_kerning_func
-                               (hb_font_funcs_t *ffuncs,
-                                hb_font_get_glyph_h_kerning_func_t func,
-                                void *user_data,
-                                hb_destroy_func_t destroy);
-
-

Parameters

-
----- - - - - - - - - - - - - -

ffuncs

font functions.

 

func

.

[closure user_data][destroy destroy][scope notified]
-
-

Since: 0.9.2

-
-
-

hb_font_funcs_set_glyph_v_kerning_func ()

void
 hb_font_funcs_set_glyph_v_kerning_func
@@ -284,80 +219,6 @@
 

-

hb_font_get_glyph_h_kerning ()

-
hb_position_t
-hb_font_get_glyph_h_kerning (hb_font_t *font,
-                             hb_codepoint_t left_glyph,
-                             hb_codepoint_t right_glyph);
-
-

Parameters

-
----- - - - - - -

font

a font.

 
-
-

Since: 0.9.2

-
-
-
-

hb_font_get_glyph_kerning_for_direction ()

-
void
-hb_font_get_glyph_kerning_for_direction
-                               (hb_font_t *font,
-                                hb_codepoint_t first_glyph,
-                                hb_codepoint_t second_glyph,
-                                hb_direction_t direction,
-                                hb_position_t *x,
-                                hb_position_t *y);
-
-

Parameters

-
----- - - - - - - - - - - - - - - - - - -

font

a font.

 

x

.

[out]

y

.

[out]
-
-

Since: 0.9.2

-
-
-
-

hb_font_get_glyph_kerning_func_t ()

-
hb_position_t
-(*hb_font_get_glyph_kerning_func_t) (hb_font_t *font,
-                                     void *font_data,
-                                     hb_codepoint_t first_glyph,
-                                     hb_codepoint_t second_glyph,
-                                     void *user_data);
-
-
-

hb_font_get_glyph_v_kerning ()

hb_position_t
 hb_font_get_glyph_v_kerning (hb_font_t *font,
@@ -406,6 +267,13 @@
 

+

HB_MATH_GLYPH_PART_FLAG_EXTENDER

+
#define HB_MATH_GLYPH_PART_FLAG_EXTENDER HB_OT_MATH_GLYPH_PART_FLAG_EXTENDER
+
+

HB_MATH_GLYPH_PART_FLAG_EXTENDER is deprecated and should not be used in newly-written code.

+
+
+

HB_OT_VAR_NO_AXIS_INDEX

#define HB_OT_VAR_NO_AXIS_INDEX		0xFFFFFFFFu
 
@@ -422,12 +290,6 @@

-

hb_font_get_glyph_h_kerning_func_t

-
typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_h_kerning_func_t;
-
-
-
-

hb_font_get_glyph_v_kerning_func_t

typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_v_kerning_func_t;
 
diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-face.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-face.html --- harfbuzz-2.5.3/docs/html/harfbuzz-hb-face.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-face.html 2019-10-26 02:02:55.000000000 +0000 @@ -5,7 +5,7 @@ hb-face: HarfBuzz Manual - + @@ -19,7 +19,7 @@ Object Hierarchy Home -Up +Up Prev Next diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-font.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-font.html --- harfbuzz-2.5.3/docs/html/harfbuzz-hb-font.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-font.html 2019-10-26 02:02:55.000000000 +0000 @@ -5,7 +5,7 @@ hb-font: HarfBuzz Manual - + @@ -19,7 +19,7 @@ Object Hierarchy Home -Up +Up Prev Next @@ -173,6 +173,14 @@ void +hb_font_funcs_set_glyph_h_kerning_func () + + + + +void + + hb_font_funcs_set_glyph_h_origin_func () @@ -378,6 +386,14 @@ +hb_position_t + + +hb_font_get_glyph_h_kerning () + + + + hb_bool_t @@ -386,6 +402,22 @@ +void + + +hb_font_get_glyph_kerning_for_direction () + + + + +hb_position_t + + +(*hb_font_get_glyph_kerning_func_t) () + + + + hb_bool_t @@ -652,6 +684,14 @@ void +hb_font_set_var_named_instance () + + + + +void + + hb_font_subtract_glyph_origin_for_direction () @@ -736,6 +776,10 @@ typedef +hb_font_get_glyph_h_kerning_func_t + + +typedef hb_font_get_glyph_h_origin_func_t @@ -1212,6 +1256,39 @@

+

hb_font_funcs_set_glyph_h_kerning_func ()

+
void
+hb_font_funcs_set_glyph_h_kerning_func
+                               (hb_font_funcs_t *ffuncs,
+                                hb_font_get_glyph_h_kerning_func_t func,
+                                void *user_data,
+                                hb_destroy_func_t destroy);
+
+

Parameters

+
+++++ + + + + + + + + + + + + +

ffuncs

font functions.

 

func

.

[closure user_data][destroy destroy][scope notified]
+
+

Since: 0.9.2

+
+
+

hb_font_funcs_set_glyph_h_origin_func ()

void
 hb_font_funcs_set_glyph_h_origin_func (hb_font_funcs_t *ffuncs,
@@ -1918,6 +1995,30 @@
 

+

hb_font_get_glyph_h_kerning ()

+
hb_position_t
+hb_font_get_glyph_h_kerning (hb_font_t *font,
+                             hb_codepoint_t left_glyph,
+                             hb_codepoint_t right_glyph);
+
+

Parameters

+
+++++ + + + + + +

font

a font.

 
+
+

Since: 0.9.2

+
+
+

hb_font_get_glyph_h_origin ()

hb_bool_t
 hb_font_get_glyph_h_origin (hb_font_t *font,
@@ -1955,6 +2056,56 @@
 

+

hb_font_get_glyph_kerning_for_direction ()

+
void
+hb_font_get_glyph_kerning_for_direction
+                               (hb_font_t *font,
+                                hb_codepoint_t first_glyph,
+                                hb_codepoint_t second_glyph,
+                                hb_direction_t direction,
+                                hb_position_t *x,
+                                hb_position_t *y);
+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

font

a font.

 

x

.

[out]

y

.

[out]
+
+

Since: 0.9.2

+
+
+
+

hb_font_get_glyph_kerning_func_t ()

+
hb_position_t
+(*hb_font_get_glyph_kerning_func_t) (hb_font_t *font,
+                                     void *font_data,
+                                     hb_codepoint_t first_glyph,
+                                     hb_codepoint_t second_glyph,
+                                     void *user_data);
+
+
+

hb_font_get_glyph_name ()

hb_bool_t
 hb_font_get_glyph_name (hb_font_t *font,
@@ -2786,6 +2937,37 @@
 

+

hb_font_set_var_named_instance ()

+
void
+hb_font_set_var_named_instance (hb_font_t *font,
+                                unsigned  instance_index);
+

Sets design coords of a font from a named instance index.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

font

a font.

 

instance_index

named instance index.

 
+
+

Since: 2.6.0

+
+
+

hb_font_subtract_glyph_origin_for_direction ()

void
 hb_font_subtract_glyph_origin_for_direction
@@ -3016,6 +3198,12 @@
 

+
+

hb_font_get_glyph_h_kerning_func_t

+
typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_h_kerning_func_t;
+
+
+

hb_font_get_glyph_h_origin_func_t

typedef hb_font_get_glyph_origin_func_t hb_font_get_glyph_h_origin_func_t;
diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-ft.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-ft.html
--- harfbuzz-2.5.3/docs/html/harfbuzz-hb-ft.html	2019-07-21 00:38:47.000000000 +0000
+++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-ft.html	2019-10-26 02:02:55.000000000 +0000
@@ -5,7 +5,7 @@
 hb-ft: HarfBuzz Manual
 
 
-
+
 
 
 
@@ -18,7 +18,7 @@
                   Description
 
 Home
-Up
+Up
 Prev
 Next
 
diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-glib.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-glib.html
--- harfbuzz-2.5.3/docs/html/harfbuzz-hb-glib.html	2019-07-21 00:38:47.000000000 +0000
+++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-glib.html	2019-10-26 02:02:55.000000000 +0000
@@ -5,7 +5,7 @@
 hb-glib: HarfBuzz Manual
 
 
-
+
 
 
 
@@ -18,7 +18,7 @@
                   Description
 
 Home
-Up
+Up
 Prev
 Next
 
diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-gobject.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-gobject.html
--- harfbuzz-2.5.3/docs/html/harfbuzz-hb-gobject.html	2019-07-21 00:38:47.000000000 +0000
+++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-gobject.html	2019-10-26 02:02:55.000000000 +0000
@@ -5,7 +5,7 @@
 hb-gobject: HarfBuzz Manual
 
 
-
+
 
 
 
@@ -18,7 +18,7 @@
                   Description
 
 Home
-Up
+Up
 Prev
 Next
 
diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-graphite2.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-graphite2.html
--- harfbuzz-2.5.3/docs/html/harfbuzz-hb-graphite2.html	2019-07-21 00:38:47.000000000 +0000
+++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-graphite2.html	2019-10-26 02:02:55.000000000 +0000
@@ -5,7 +5,7 @@
 hb-graphite2: HarfBuzz Manual
 
 
-
+
 
 
 
@@ -18,7 +18,7 @@
                   Description
 
 Home
-Up
+Up
 Prev
 Next
 
diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-icu.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-icu.html
--- harfbuzz-2.5.3/docs/html/harfbuzz-hb-icu.html	2019-07-21 00:38:47.000000000 +0000
+++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-icu.html	2019-10-26 02:02:55.000000000 +0000
@@ -5,7 +5,7 @@
 hb-icu: HarfBuzz Manual
 
 
-
+
 
 
 
@@ -18,7 +18,7 @@
                   Description
 
 Home
-Up
+Up
 Prev
 Next
 
diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-map.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-map.html
--- harfbuzz-2.5.3/docs/html/harfbuzz-hb-map.html	2019-07-21 00:38:47.000000000 +0000
+++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-map.html	2019-10-26 02:02:55.000000000 +0000
@@ -5,7 +5,7 @@
 hb-map: HarfBuzz Manual
 
 
-
+
 
 
 
@@ -19,7 +19,7 @@
                   Object Hierarchy
 
 Home
-Up
+Up
 Prev
 Next
 
diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-ot-color.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-ot-color.html
--- harfbuzz-2.5.3/docs/html/harfbuzz-hb-ot-color.html	2019-07-21 00:38:47.000000000 +0000
+++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-ot-color.html	2019-10-26 02:02:55.000000000 +0000
@@ -5,8 +5,8 @@
 hb-ot-color: HarfBuzz Manual
 
 
-
-
+
+
 
 
 
@@ -19,8 +19,8 @@
                   Object Hierarchy
 
 Home
-Up
-Prev
+Up
+Prev
 Next
 
 
diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-ot-font.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-ot-font.html --- harfbuzz-2.5.3/docs/html/harfbuzz-hb-ot-font.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-ot-font.html 2019-10-26 02:02:55.000000000 +0000 @@ -5,7 +5,7 @@ hb-ot-font: HarfBuzz Manual - + @@ -18,7 +18,7 @@ Description Home -Up +Up Prev Next diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-ot-layout.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-ot-layout.html --- harfbuzz-2.5.3/docs/html/harfbuzz-hb-ot-layout.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-ot-layout.html 2019-10-26 02:02:55.000000000 +0000 @@ -5,7 +5,7 @@ hb-ot-layout: HarfBuzz Manual - + @@ -19,7 +19,7 @@ Object Hierarchy Home -Up +Up Prev Next @@ -126,6 +126,14 @@ +hb_bool_t + + +hb_ot_layout_get_baseline () + + + + hb_ot_layout_glyph_class_t @@ -382,6 +390,10 @@ enum +hb_ot_layout_baseline_tag_t + + +enum hb_ot_layout_glyph_class_t @@ -390,6 +402,7 @@

Object Hierarchy

    GEnum
+    ├── hb_ot_layout_baseline_tag_t
     ╰── hb_ot_layout_glyph_class_t
 
@@ -926,7 +939,7 @@ unsigned int *point_count, unsigned int *point_array);

Fetches a list of all attachment points for the specified glyph in the GDEF -table of the face. The list returned will begin at the offset provided.

+table of the face. The list returned will begin at the offset provided.

Useful if the client program wishes to cache the list.

Parameters

@@ -969,6 +982,65 @@

+

hb_ot_layout_get_baseline ()

+
hb_bool_t
+hb_ot_layout_get_baseline (hb_font_t *font,
+                           hb_ot_layout_baseline_tag_t baseline_tag,
+                           hb_direction_t direction,
+                           hb_tag_t script_tag,
+                           hb_tag_t language_tag,
+                           hb_position_t *coord);
+

Fetches a baseline value from the face.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

font

a font

 

baseline_tag

a baseline tag

 

direction

text direction.

 

script_tag

script tag.

 

language_tag

language tag.

 

coord

baseline value if found.

[out]
+
+
+

Returns

+

if found baseline value in the the font.

+
+

Since: 2.6.0

+
+
+

hb_ot_layout_get_glyph_class ()

hb_ot_layout_glyph_class_t
 hb_ot_layout_get_glyph_class (hb_face_t *face,
@@ -1510,7 +1582,7 @@
                                     hb_set_t *glyphs_after,
                                     hb_set_t *glyphs_output);

Fetches a list of all glyphs affected by the specified lookup in the -specified face's GSUB table of GPOS table.

+specified face's GSUB table or GPOS table.

Parameters

@@ -1963,7 +2035,7 @@
unsigned int
 hb_ot_layout_table_get_lookup_count (hb_face_t *face,
                                      hb_tag_t table_tag);
-

Fetches the total number of lookups enumerated in the specified +

Fetches the total number of lookups enumerated in the specified face's GSUB table or GPOS table.

Parameters

@@ -2190,6 +2262,88 @@

+

enum hb_ot_layout_baseline_tag_t

+

Baseline tags from https://docs.microsoft.com/en-us/typography/opentype/spec/baselinetags

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

HB_OT_LAYOUT_BASELINE_TAG_ROMAN

+

The baseline used by alphabetic scripts such as Latin, Cyrillic and Greek. +In vertical writing mode, the alphabetic baseline for characters rotated 90 degrees clockwise. +(This would not apply to alphabetic characters that remain upright in vertical writing mode, since these +characters are not rotated.)

+
 

HB_OT_LAYOUT_BASELINE_TAG_HANGING

+

The hanging baseline. In horizontal direction, this is the horizontal +line from which syllables seem, to hang in Tibetan and other similar scripts. In vertical writing mode, +for Tibetan (or some other similar script) characters rotated 90 degrees clockwise.

+
 

HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_BOTTOM_OR_LEFT

+

Ideographic character face bottom or left edge, +if the direction is horizontal or vertical, respectively.

+
 

HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_TOP_OR_RIGHT

+

Ideographic character face top or right edge, +if the direction is horizontal or vertical, respectively.

+
 

HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_BOTTOM_OR_LEFT

+

Ideographic em-box bottom or left edge, +if the direction is horizontal or vertical, respectively.

+
 

HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_TOP_OR_RIGHT

+

Ideographic em-box top or right edge baseline, +if the direction is horizontal or vertical, respectively.

+
 

HB_OT_LAYOUT_BASELINE_TAG_MATH

+

The baseline about which mathematical characters are centered. +In vertical writing mode when mathematical characters rotated 90 degrees clockwise, are centered.

+
 

_HB_OT_LAYOUT_BASELINE_TAG_MAX_VALUE

  
+
+

Since: 2.6.0

+
+
+

enum hb_ot_layout_glyph_class_t

The GDEF classes defined for glyphs.

diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-ot-math.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-ot-math.html --- harfbuzz-2.5.3/docs/html/harfbuzz-hb-ot-math.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-ot-math.html 2019-10-26 02:02:55.000000000 +0000 @@ -5,7 +5,7 @@ hb-ot-math: HarfBuzz Manual - + @@ -19,7 +19,7 @@ Object Hierarchy Home -Up +Up Prev Next @@ -1036,8 +1036,8 @@

hb_position_t end_connector_length;

-  -  +

The length of the connector on the ending side of the variant part

hb_position_t full_advance;

diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-ot-name.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-ot-name.html --- harfbuzz-2.5.3/docs/html/harfbuzz-hb-ot-name.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-ot-name.html 2019-10-26 02:02:55.000000000 +0000 @@ -5,7 +5,7 @@ hb-ot-name: HarfBuzz Manual - + @@ -18,7 +18,7 @@ Description Home -Up +Up Prev Next diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-ot-shape.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-ot-shape.html --- harfbuzz-2.5.3/docs/html/harfbuzz-hb-ot-shape.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-ot-shape.html 2019-10-26 02:02:55.000000000 +0000 @@ -5,7 +5,7 @@ hb-ot-shape: HarfBuzz Manual - + @@ -18,7 +18,7 @@ Description Home -Up +Up Prev Next diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-ot-var.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-ot-var.html --- harfbuzz-2.5.3/docs/html/harfbuzz-hb-ot-var.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-ot-var.html 2019-10-26 02:02:55.000000000 +0000 @@ -5,9 +5,9 @@ hb-ot-var: HarfBuzz Manual - + - + @@ -19,9 +19,9 @@ Object Hierarchy Home -Up +Up Prev -Next +Next
diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-set.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-set.html --- harfbuzz-2.5.3/docs/html/harfbuzz-hb-set.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-set.html 2019-10-26 02:02:55.000000000 +0000 @@ -5,7 +5,7 @@ hb-set: HarfBuzz Manual - + @@ -19,7 +19,7 @@ Object Hierarchy Home -Up +Up Prev Next @@ -829,7 +829,7 @@ hb_set_previous (const hb_set_t *set, hb_codepoint_t *codepoint);

Gets the previous number in set - that is slower than current value of codepoint + that is lower than current value of codepoint .

Set codepoint to HB_SET_VALUE_INVALID to get started.

@@ -870,7 +870,7 @@ hb_codepoint_t *last);

Gets the previous consecutive range of numbers in set that -are greater than current value of last +are less than current value of first .

Set first to HB_SET_VALUE_INVALID to get started.

diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-shape.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-shape.html --- harfbuzz-2.5.3/docs/html/harfbuzz-hb-shape.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-shape.html 2019-10-26 02:02:55.000000000 +0000 @@ -5,7 +5,7 @@ hb-shape: HarfBuzz Manual - + @@ -18,7 +18,7 @@ Description Home -Up +Up Prev Next diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-shape-plan.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-shape-plan.html --- harfbuzz-2.5.3/docs/html/harfbuzz-hb-shape-plan.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-shape-plan.html 2019-10-26 02:02:55.000000000 +0000 @@ -5,7 +5,7 @@ hb-shape-plan: HarfBuzz Manual - + @@ -19,7 +19,7 @@ Object Hierarchy Home -Up +Up Prev Next diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-unicode.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-unicode.html --- harfbuzz-2.5.3/docs/html/harfbuzz-hb-unicode.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-unicode.html 2019-10-26 02:02:55.000000000 +0000 @@ -5,7 +5,7 @@ hb-unicode: HarfBuzz Manual - + @@ -19,7 +19,7 @@ Object Hierarchy Home -Up +Up Prev Next diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-uniscribe.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-uniscribe.html --- harfbuzz-2.5.3/docs/html/harfbuzz-hb-uniscribe.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-uniscribe.html 2019-10-26 02:02:55.000000000 +0000 @@ -5,9 +5,9 @@ hb-uniscribe: HarfBuzz Manual - + - + @@ -18,9 +18,9 @@ Description Home -Up +Up Prev -Next +Next
diff -Nru harfbuzz-2.5.3/docs/html/harfbuzz-hb-version.html harfbuzz-2.6.2/docs/html/harfbuzz-hb-version.html --- harfbuzz-2.5.3/docs/html/harfbuzz-hb-version.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/harfbuzz-hb-version.html 2019-10-26 02:02:55.000000000 +0000 @@ -5,9 +5,9 @@ hb-version: HarfBuzz Manual - + - + @@ -18,9 +18,9 @@ Description Home -Up +Up Prev -Next +Next
@@ -184,19 +184,19 @@

HB_VERSION_MICRO

-
#define HB_VERSION_MICRO 3
+
#define HB_VERSION_MICRO 2
 

HB_VERSION_MINOR

-
#define HB_VERSION_MINOR 5
+
#define HB_VERSION_MINOR 6
 

HB_VERSION_STRING

-
#define HB_VERSION_STRING "2.5.3"
+
#define HB_VERSION_STRING "2.6.2"
 
diff -Nru harfbuzz-2.5.3/docs/html/index.html harfbuzz-2.6.2/docs/html/index.html --- harfbuzz-2.5.3/docs/html/index.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/index.html 2019-10-26 02:02:55.000000000 +0000 @@ -87,14 +87,21 @@
Creating and destroying buffers
Adding text to the buffer
Setting buffer properties
-
What about the other scripts?
Customizing Unicode functions
-
Fonts and faces
+
Fonts, faces, and output
-
Using FreeType
-
Using HarfBuzz's native OpenType implementation
-
Using your own font functions
+
Font and face objects
+
Customizing font functions
+
Font objects and HarfBuzz's native OpenType implementation
+
Working with OpenType Variable Fonts
+
+
Shaping and shape plans
+
+
Shaping and buffer output
+
OpenType features
+
Shaper selection
+
Plans and caching
Clusters
@@ -110,15 +117,21 @@
Other considerations in level 2
-
Shaping and shape plans
+
Utilities
+
+
Command-line tools
-
OpenType features
-
Plans and caching
+
hb-shape
+
hb-view
+
hb-subset
+
+
Common data types and APIs
+
UCDN
II. Reference manual
-
Core API
+
Core API
hb-blob — Binary data containers @@ -157,7 +170,7 @@ hb-version — Information about the version of HarfBuzz in use
-
OpenType API
+
OpenType API
hb-ot-color — OpenType Color Fonts @@ -181,11 +194,11 @@ hb-ot-var — OpenType Font Variations
-
Apple Advanced Typography API
+
Apple Advanced Typography API
hb-aat-layout — Apple Advanced Typography Layout
-
Integration API
+
Integration API
hb-coretext — CoreText integration diff -Nru harfbuzz-2.5.3/docs/html/level-2.html harfbuzz-2.6.2/docs/html/level-2.html --- harfbuzz-2.5.3/docs/html/level-2.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/level-2.html 2019-10-26 02:02:55.000000000 +0000 @@ -7,7 +7,7 @@ - + @@ -17,7 +17,7 @@ Home Up Prev -Next +Next

diff -Nru harfbuzz-2.5.3/docs/html/plans-and-caching.html harfbuzz-2.6.2/docs/html/plans-and-caching.html --- harfbuzz-2.5.3/docs/html/plans-and-caching.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/plans-and-caching.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - - - -Plans and caching: HarfBuzz Manual - - - - - - - - - - - - - - - - -
-

-Plans and caching

-

-

-
- - - \ No newline at end of file diff -Nru harfbuzz-2.5.3/docs/html/pt01.html harfbuzz-2.6.2/docs/html/pt01.html --- harfbuzz-2.5.3/docs/html/pt01.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/pt01.html 2019-10-26 02:02:55.000000000 +0000 @@ -74,14 +74,21 @@
Creating and destroying buffers
Adding text to the buffer
Setting buffer properties
-
What about the other scripts?
Customizing Unicode functions

-
Fonts and faces
+
Fonts, faces, and output
-
Using FreeType
-
Using HarfBuzz's native OpenType implementation
-
Using your own font functions
+
Font and face objects
+
Customizing font functions
+
Font objects and HarfBuzz's native OpenType implementation
+
Working with OpenType Variable Fonts
+
+
Shaping and shape plans
+
+
Shaping and buffer output
+
OpenType features
+
Shaper selection
+
Plans and caching
Clusters
@@ -97,23 +104,19 @@
Other considerations in level 2
-
Shaping and shape plans
+
Utilities
-
OpenType features
-
Plans and caching
+
Command-line tools
+
+
hb-shape
+
hb-view
+
hb-subset
+
+
Common data types and APIs
+
UCDN
-
-

-Glyph information

-
-

-Names and numbers

-

-

-
-
diff -Nru harfbuzz-2.5.3/docs/html/pt02.html harfbuzz-2.6.2/docs/html/pt02.html --- harfbuzz-2.5.3/docs/html/pt02.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/pt02.html 2019-10-26 02:02:55.000000000 +0000 @@ -6,8 +6,8 @@ - - + + @@ -16,15 +16,15 @@ Home -Prev -Next +Prev +Next

Part II. Reference manual

- This document is for HarfBuzz 2.5.3 + This document is for HarfBuzz 2.6.2 .

@@ -32,7 +32,7 @@

Table of Contents

-
Core API
+
Core API
hb-blob — Binary data containers @@ -71,7 +71,7 @@ hb-version — Information about the version of HarfBuzz in use
-
OpenType API
+
OpenType API
hb-ot-color — OpenType Color Fonts @@ -95,11 +95,11 @@ hb-ot-var — OpenType Font Variations
-
Apple Advanced Typography API
+
Apple Advanced Typography API
hb-aat-layout — Apple Advanced Typography Layout
-
Integration API
+
Integration API
hb-coretext — CoreText integration diff -Nru harfbuzz-2.5.3/docs/html/setting-buffer-properties.html harfbuzz-2.6.2/docs/html/setting-buffer-properties.html --- harfbuzz-2.5.3/docs/html/setting-buffer-properties.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/setting-buffer-properties.html 2019-10-26 02:02:55.000000000 +0000 @@ -7,7 +7,7 @@ - + @@ -17,12 +17,141 @@ Home Up Prev -Next +Next

Setting buffer properties

+ Buffers containing input characters still need several + properties set before HarfBuzz can shape their text correctly. +

+

+ Initially, all buffers are set to the + HB_BUFFER_CONTENT_TYPE_INVALID content + type. After adding text, the buffer should be set to + HB_BUFFER_CONTENT_TYPE_UNICODE instead, which + indicates that it contains un-shaped input + characters. After shaping, the buffer will have the + HB_BUFFER_CONTENT_TYPE_GLYPHS content type. +

+

+ hb_buffer_add_utf8() and the + other UTF functions set the content type of their buffer + automatically. But if you are reusing a buffer you may want to + check its state with + hb_buffer_get_content_type(buffer). If + necessary you can set the content type with +

+
+      hb_buffer_set_content_type(buf, HB_BUFFER_CONTENT_TYPE_UNICODE);
+    
+

+ to prepare for shaping. +

+

+ Buffers also need to carry information about the script, + language, and text direction of their contents. You can set + these properties individually: +

+
+      hb_buffer_set_direction(buf, HB_DIRECTION_LTR);
+      hb_buffer_set_script(buf, HB_SCRIPT_LATIN);
+      hb_buffer_set_language(buf, hb_language_from_string("en", -1));
+    
+

+ However, since these properties are often the repeated for + multiple text runs, you can also save them in a + hb_segment_properties_t for reuse: +

+
+      hb_segment_properties_t *savedprops;
+      hb_buffer_get_segment_properties (buf, savedprops);
+      ...
+      hb_buffer_set_segment_properties (buf2, savedprops);
+    
+

+ HarfBuzz also provides getter functions to retrieve a buffer's + direction, script, and language properties individually. +

+

+ HarfBuzz recognizes four text directions in + hb_direction_t: left-to-right + (HB_DIRECTION_LTR), right-to-left (HB_DIRECTION_RTL), + top-to-bottom (HB_DIRECTION_TTB), and + bottom-to-top (HB_DIRECTION_BTT). For the + script property, HarfBuzz uses identifiers based on the + ISO 15924 + standard. For languages, HarfBuzz uses tags based on the + IETF BCP 47 standard. +

+

+ Helper functions are provided to convert character strings into + the necessary script and language tag types. +

+

+ Two additional buffer properties to be aware of are the + "invisible glyph" and the replacement code point. The + replacement code point is inserted into buffer output in place of + any invalid code points encountered in the input. By default, it + is the Unicode REPLACEMENT CHARACTER code + point, U+FFFD "�". You can change this with +

+
+      hb_buffer_set_replacement_codepoint(buf, replacement);
+    
+

+ passing in the replacement Unicode code point as the + replacement parameter. +

+

+ The invisible glyph is used to replace all output glyphs that + are invisible. By default, the standard space character + U+0020 is used; you can replace this (for + example, when using a font that provides script-specific + spaces) with +

+
+      hb_buffer_set_invisible_glyph(buf, replacement_glyph);
+    
+

+ Do note that in the replacement_glyph + parameter, you must provide the glyph ID of the replacement you + wish to use, not the Unicode code point. +

+

+ HarfBuzz supports a few additional flags you might want to set + on your buffer under certain circumstances. The + HB_BUFFER_FLAG_BOT and + HB_BUFFER_FLAG_EOT flags tell HarfBuzz + that the buffer represents the beginning or end (respectively) + of a text element (such as a paragraph or other block). Knowing + this allows HarfBuzz to apply certain contextual font features + when shaping, such as initial or final variants in connected + scripts. +

+

+ HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES + tells HarfBuzz not to hide glyphs with the + Default_Ignorable property in Unicode. This + property designates control characters and other non-printing + code points, such as joiners and variation selectors. Normally + HarfBuzz replaces them in the output buffer with zero-width + space glyphs (using the "invisible glyph" property discussed + above); setting this flag causes them to be printed, which can + be helpful for troubleshooting. +

+

+ Conversely, setting the + HB_BUFFER_FLAG_REMOVE_DEFAULT_IGNORABLES flag + tells HarfBuzz to remove Default_Ignorable + glyphs from the output buffer entirely. Finally, setting the + HB_BUFFER_FLAG_DO_NOT_INSERT_DOTTED_CIRCLE + flag tells HarfBuzz not to insert the dotted-circle glyph + (U+25CC, "◌"), which is normally + inserted into buffer output when broken character sequences are + encountered (such as combining marks that are not attached to a + base character).

+

+ The hb_shape() function call takes four arguments: the font + object to use, the buffer of characters to shape, an array of + user-specified features to apply, and the length of that feature + array. The feature array can be NULL, so for the sake of + simplicity we will start with that case. +

+

+ Internally, HarfBuzz looks at the tables of the font file to + determine where glyph classes, substitutions, and positioning + are defined, using that information to decide which + shaper to use (ot for + OpenType fonts, aat for Apple Advanced + Typography fonts, and so on). It also looks at the direction, + script, and language properties of the segment to figure out + which script-specific shaping model is needed (at least, in + shapers that support multiple options). +

+

+ If a font has a GDEF table, then that is used for + glyph classes; if not, HarfBuzz will fall back to Unicode + categorization by code point. If a font has an AAT "morx" table, + then it is used for substitutions; if not, but there is a GSUB + table, then the GSUB table is used. If the font has an AAT + "kerx" table, then it is used for positioning; if not, but + there is a GPOS table, then the GPOS table is used. If neither + table is found, but there is a "kern" table, then HarfBuzz will + use the "kern" table. If there is no "kerx", no GPOS, and no + "kern", HarfBuzz will fall back to positioning marks itself. +

+

+ With a well-behaved OpenType font, you expect GDEF, GSUB, and + GPOS tables to all be applied. HarfBuzz implements the + script-specific shaping models in internal functions, rather + than in the public API. +

+

+ The algorithms + used for complex scripts can be quite involved; HarfBuzz tries + to be compatible with the OpenType Layout specification + and, wherever there is any ambiguity, HarfBuzz attempts to replicate the + output of Microsoft's Uniscribe engine. See the Microsoft + Typography pages for more detail. +

+

+ In general, though, all that you need to know is that + hb_shape() returns the results of shaping + in the same buffer that you provided. The buffer's content type + will now be set to + HB_BUFFER_CONTENT_TYPE_GLYPHS, indicating + that it contains shaped output, rather than input text. You can + now extract the glyph information and positioning arrays: +

+
+      hb_glyph_info_t *glyph_info    = hb_buffer_get_glyph_infos(buf, &glyph_count);
+      hb_glyph_position_t *glyph_pos = hb_buffer_get_glyph_positions(buf, &glyph_count);
+    
+

+ The glyph information array holds a hb_glyph_info_t + for each output glyph, which has two fields: + codepoint and + cluster. Whereas, in the input buffer, + the codepoint field contained the Unicode + code point, it now contains the glyph ID of the corresponding + glyph in the font. The cluster field is + an integer that you can use to help identify when shaping has + reordered, split, or combined code points; we will say more + about that in the next chapter. +

+

+ The glyph positions array holds a corresponding + hb_glyph_position_t for each output glyph, + containing four fields: x_advance, + y_advance, + x_offset, and + y_offset. The advances tell you how far + you need to move the drawing point after drawing this glyph, + depending on whether you are setting horizontal text (in which + case you will have x advances) or vertical text (for which you + will have y advances). The x and y offsets tell you where to + move to start drawing the glyph; usually you will have both and + x and a y offset, regardless of the text direction. +

+ Most of the time, you will rely on a font-rendering library or + other graphics library to do the actual drawing of glyphs, so + you will need to iterate through the glyphs in the buffer and + pass the corresponding values off.

diff -Nru harfbuzz-2.5.3/docs/html/shaping-opentype-features.html harfbuzz-2.6.2/docs/html/shaping-opentype-features.html --- harfbuzz-2.5.3/docs/html/shaping-opentype-features.html 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/shaping-opentype-features.html 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,107 @@ + + + + +OpenType features: HarfBuzz Manual + + + + + + + + + + + + + + + + +
+

+OpenType features

+

+ OpenType features enable fonts to include smart behavior, + implemented as "lookup" rules stored in the GSUB and GPOS + tables. The OpenType specification defines a long list of + standard features that fonts can use for these behaviors; each + feature has a four-character reserved name and a well-defined + semantic meaning. +

+

+ Some OpenType features are defined for the purpose of supporting + complex-script shaping, and are automatically activated, but + only when a buffer's script property is set to a script that the + feature supports. +

+

+ Other features are more generic and can apply to several (or + any) script, and shaping engines are expected to implement + them. By default, HarfBuzz activates several of these features + on every text run. They include ccmp, + locl, mark, + mkmk, and rlig. +

+

+ In addition, if the text direction is horizontal, HarfBuzz + also applies the calt, + clig, curs, + kern, liga, + rclt, and frac features. +

+

+ If the text direction is vertical, HarfBuzz applies + the vert feature by default. +

+

+ Still other features are designed to be purely optional and left + up to the application or the end user to enable or disable as desired. +

+

+ You can adjust the set of features that HarfBuzz applies to a + buffer by supplying an array of hb_feature_t + features as the third argument to + hb_shape(). For a simple case, let's just + enable the dlig feature, which turns on any + "discretionary" ligatures in the font: +

+
+      hb_feature_t userfeatures[1];
+      userfeatures[0].tag = HB_TAG('d','l','i','g');
+      userfeatures[0].value = 1;
+      userfeatures[0].start = HB_FEATURE_GLOBAL_START;
+      userfeatures[0].end = HB_FEATURE_GLOBAL_END;
+    
+

+ HB_FEATURE_GLOBAL_END and + HB_FEATURE_GLOBAL_END are macros we can use + to indicate that the features will be applied to the entire + buffer. We could also have used a literal 0 + for the start and a -1 to indicate the end of + the buffer (or have selected other start and end positions, if needed). +

+

+ When we pass the userfeatures array to + hb_shape(), any discretionary ligature + substitutions from our font that match the text in our buffer + will get performed: +

+
+      hb_shape(font, buf, userfeatures, num_features);
+    
+

+ Just like we enabled the dlig feature by + setting its value to + 1, you would disable a feature by setting its + value to 0. Some + features can take other value settings; + be sure you read the full specification of each feature tag to + understand what it does and how to control it. +

+
+ + + \ No newline at end of file diff -Nru harfbuzz-2.5.3/docs/html/shaping-plans-and-caching.html harfbuzz-2.6.2/docs/html/shaping-plans-and-caching.html --- harfbuzz-2.5.3/docs/html/shaping-plans-and-caching.html 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/shaping-plans-and-caching.html 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,85 @@ + + + + +Plans and caching: HarfBuzz Manual + + + + + + + + + + + + + + + + +
+

+Plans and caching

+

+ Internally, HarfBuzz uses a structure called a shape plan to + track its decisions about how to shape the contents of a + buffer. The hb_shape() function builds up the shape plan by + examining segment properties and by inspecting the contents of + the font. +

+

+ This process can involve some decision-making and + trade-offs — for example, HarfBuzz inspects the GSUB and GPOS + lookups for the script and language tags set on the segment + properties, but it falls back on the lookups under the + DFLT tag (and sometimes other common tags) + if there are actually no lookups for the tag requested. +

+

+ HarfBuzz also includes some work-arounds for + handling well-known older font conventions that do not follow + OpenType or Unicode specifications, for buggy system fonts, and for + peculiarities of Microsoft Uniscribe. All of that means that a + shape plan, while not something that you should edit directly in + client code, still might be an object that you want to + inspect. Furthermore, if resources are tight, you might want to + cache the shape plan that HarfBuzz builds for your buffer and + font, so that you do not have to rebuild it for every shaping call. +

+

+ You can create a cacheable shape plan with + hb_shape_plan_create_cached(face, props, + user_features, num_user_features, shaper_list), where + face is a face object (not a font object, + notably), props is an + hb_segment_properties_t, + user_features is an array of + hb_feature_ts (with length + num_user_features), and + shaper_list is a list of shapers to try. +

+

+ Shape plans are objects in HarfBuzz, so there are + reference-counting functions and user-data attachment functions + you can + use. hb_shape_plan_reference(shape_plan) + increases the reference count on a shape plan, while + hb_shape_plan_destroy(shape_plan) decreases + the reference count, destroying the shape plan when the last + reference is dropped. +

+

+ You can attach user data to a shaper (with a key) using the + hb_shape_plan_set_user_data(shape_plan,key,data,destroy,replace) + function, optionally supplying a destroy + callback to use. You can then fetch the user data attached to a + shape plan with + hb_shape_plan_get_user_data(shape_plan, key). +

+
+ + + \ No newline at end of file diff -Nru harfbuzz-2.5.3/docs/html/shaping-shaper-selection.html harfbuzz-2.6.2/docs/html/shaping-shaper-selection.html --- harfbuzz-2.5.3/docs/html/shaping-shaper-selection.html 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/shaping-shaper-selection.html 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,65 @@ + + + + +Shaper selection: HarfBuzz Manual + + + + + + + + + + + + + + + + +
+

+Shaper selection

+

+ The basic version of hb_shape() determines + its shaping strategy based on examining the capabilities of the + font file. OpenType font tables cause HarfBuzz to try the + ot shaper, while AAT font tables cause HarfBuzz to try the + aat shaper. +

+

+ In the real world, however, a font might include some unusual + mix of tables, or one of the tables might simply be broken for + the script you need to shape. So, sometimes, you might not + want to rely on HarfBuzz's process for deciding what to do, and + just tell hb_shape() what you want it to try. +

+

+ hb_shape_full() is an alternate shaping + function that lets you supply a list of shapers for HarfBuzz to + try, in order, when shaping your buffer. For example, if you + have determined that HarfBuzz's attempts to work around broken + tables gives you better results than the AAT shaper itself does, + you might move the AAT shaper to the end of your list of + preferences and call hb_shape_full() +

+
+      char *shaperprefs[3] = {"ot", "default", "aat"};
+      ...
+      hb_shape_full(font, buf, userfeatures, num_features, shaperprefs);
+    
+

+ to get results you are happier with. +

+

+ You may also want to call + hb_shape_list_shapers() to get a list of + the shapers that were built at compile time in your copy of HarfBuzz. +

+
+ + + \ No newline at end of file diff -Nru harfbuzz-2.5.3/docs/html/using-harfbuzzs-native-opentype-implementation.html harfbuzz-2.6.2/docs/html/using-harfbuzzs-native-opentype-implementation.html --- harfbuzz-2.5.3/docs/html/using-harfbuzzs-native-opentype-implementation.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/using-harfbuzzs-native-opentype-implementation.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - - - -Using HarfBuzz's native OpenType implementation: HarfBuzz Manual - - - - - - - - - - - - - - - - -
-

-Using HarfBuzz's native OpenType implementation

-

-

-
- - - \ No newline at end of file diff -Nru harfbuzz-2.5.3/docs/html/using-your-own-font-functions.html harfbuzz-2.6.2/docs/html/using-your-own-font-functions.html --- harfbuzz-2.5.3/docs/html/using-your-own-font-functions.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/using-your-own-font-functions.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - - - -Using your own font functions: HarfBuzz Manual - - - - - - - - - - - - - - - - -
-

-Using your own font functions

-

-

-
- - - \ No newline at end of file diff -Nru harfbuzz-2.5.3/docs/html/utilities-common-types-apis.html harfbuzz-2.6.2/docs/html/utilities-common-types-apis.html --- harfbuzz-2.5.3/docs/html/utilities-common-types-apis.html 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/utilities-common-types-apis.html 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,84 @@ + + + + +Common data types and APIs: HarfBuzz Manual + + + + + + + + + + + + + + + + +
+

+Common data types and APIs

+

+ HarfBuzz includes several APIs for working with general-purpose + data that you may find convenient to leverage in your own + software. They include set operations and integer-to-integer + mapping operations. +

+

+ HarfBuzz uses set operations for internal bookkeeping, such as + when it collects all of the glyph IDs covered by a particular + font feature. You can also use the set API to build sets, add + and remove elements, test whether or not sets contain particular + elements, or compute the unions, intersections, or differences + between sets. +

+

+ All set elements are integers (specifically, + hb_codepoint_t 32-bit unsigned ints), and there are + functions for fetching the minimum and maximum element from a + set. The set API also includes some functions that might not + be part of a generic set facility, such as the ability to add a + contiguous range of integer elements to a set in bulk, and the + ability to fetch the next-smallest or next-largest element. +

+

+ The HarfBuzz set API includes some conveniences as well. All + sets are lifecycle-managed, just like other HarfBuzz + objects. You increase the reference count on a set with + hb_set_reference() and decrease it with + hb_set_destroy(). You can also attach + user data to a set, just like you can to blobs, buffers, faces, + fonts, and other objects, and set destroy callbacks. +

+

+ HarfBuzz also provides an API for keeping track of + integer-to-integer mappings. As with the set API, each integer is + stored as an unsigned 32-bit hb_codepoint_t + element. Maps, like other objects, are reference counted with + reference and destroy functions, and you can attach user data to + them. The mapping operations include adding and deleting + integer-to-integer key:value pairs to the map, testing for the + presence of a key, fetching the population of the map, and so on. +

+

+ There are several other internal HarfBuzz facilities that are + exposed publicly and which you may want to take advantage of + while processing text. HarfBuzz uses a common + hb_tag_t for a variety of OpenType tag identifiers (for + scripts, languages, font features, table names, variation-axis + names, and more), and provides functions for converting strings + to tags and vice-versa. +

+

+ Finally, HarfBuzz also includes data type for Booleans, bit + masks, and other simple types. +

+
+ + + \ No newline at end of file diff -Nru harfbuzz-2.5.3/docs/html/utilities.html harfbuzz-2.6.2/docs/html/utilities.html --- harfbuzz-2.5.3/docs/html/utilities.html 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/utilities.html 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,188 @@ + + + + +Utilities: HarfBuzz Manual + + + + + + + + + + + + + + + + +
+

+Utilities

+ +

+ HarfBuzz includes several auxiliary components in addition to the + main APIs. These include a set of command-line tools, a set of + lower-level APIs for common data types that may be of interest to + client programs, and an embedded library for working with + Unicode Character Database (UCD) data. +

+
+

+Command-line tools

+

+ HarfBuzz include three command-line tools: + <program>hb-shape</program>, <program>hb-view</program>, and + <program>hb-subset</program>. They can be used to examine + HarfBuzz's functionality, debug font binaries, or explore the + various shaping models and features from a terminal. +

+
+

+hb-shape

+

+ <program>hb-shape</program> allows you to run HarfBuzz's + hb_shape() function on an input string and + to examine the outcome, in human-readable form, as terminal + output. <program>hb-shape</program> does + not render the results of the shaping call + into rendered text (you can use <program>hb-view</program>, below, for + that). Instead, it prints out the final glyph indices and + positions, taking all shaping operations into account, as if the + input string were a HarfBuzz input buffer. +

+

+ You can specify the font to be used for shaping and, with + command-line options, you can add various aspects of the + internal state to the output that is sent to the terminal. The + general format is +

+
+	hb-shape [[OPTIONS]]
+      path/to/font/file.ttf
+      yourinputtext
+      
+

+ The default output format is plain text (although JSON output + can be selected instead by specifying the option + [--output-format=json]). The default output + syntax reports each glyph name (or glyph index if there is no + name) followed by its cluster value, its horizontal and vertical + position displacement, and its horizontal and vertical advances. +

+

+ Output options exist to skip any of these elements in the + output, and to include additional data, such as Unicode + code-point values, glyph extents, glyph flags, or interim + shaping results. +

+

+ Output can also be redirected to a file, or input read from a + file. Additional options enable you to enable or disable + specific font features, to set variation-font axis values, to + alter the language, script, direction, and clustering settings + used, to enable sanity checks, or to change which shaping engine is used. +

+

+ For a complete explanation of the options available, run +

+
+	hb-shape --help
+      
+
+
+

+hb-view

+

+ <program>hb-view</program> allows you to + see the shaped output of an input string in rendered + form. Like <program>hb-shape</program>, + <program>hb-view</program> takes a font file and a text string + as its arguments: +

+
+	hb-view [[OPTIONS]]
+	path/to/font/file.ttf
+	yourinputtext
+      
+

+ By default, <program>hb-view</program> renders the shaped + text in ASCII block-character images as terminal output. By + appending the + --output-file=[filename] + switch, you can write the output to a PNG, SVG, or PDF file + (among other formats). +

+

+ As with <program>hb-shape</program>, a lengthy set of options + is available, with which you can enable or disable + specific font features, set variation-font axis values, + alter the language, script, direction, and clustering settings + used, enable sanity checks, or change which shaping engine is + used. +

+

+ You can also set the foreground and background colors used for + the output, independently control the width of all four + margins, alter the line spacing, and annotate the output image + with +

+

+ In general, <program>hb-view</program> is a quick way to + verify that the output of HarfBuzz's shaping operation looks + correct for a given text-and-font combination, but you may + want to use <program>hb-shape</program> to figure out exactly + why something does not appear as expected. +

+
+
+

+hb-subset

+

+ <program>hb-subset</program> allows you + to generate a subset of a given font, with a limited set of + supported characters, features, and variation settings. +

+

+ By default, you provide an input font and an input text string + as the arguments to <program>hb-subset</program>, and it will + generate a font that covers the input text exactly like the + input font does, but includes no other characters or features. +

+
+	hb-subset [[OPTIONS]]
+	path/to/font/file.ttf
+	yourinputtext
+      
+

+ For example, to create a subset of Noto Serif that just includes the + numerals and the lowercase Latin alphabet, you could run +

+
+	hb-subset [[OPTIONS]]
+	NotoSerif-Regular.ttf
+	0123456789abcdefghijklmnopqrstuvwxyz
+      
+

+ There are options available to remove hinting from the + subsetted font and to specify a list of variation-axis settings. +

+
+
+
+ + + \ No newline at end of file diff -Nru harfbuzz-2.5.3/docs/html/utilities-ucdn.html harfbuzz-2.6.2/docs/html/utilities-ucdn.html --- harfbuzz-2.5.3/docs/html/utilities-ucdn.html 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/utilities-ucdn.html 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,49 @@ + + + + +UCDN: HarfBuzz Manual + + + + + + + + + + + + + + + + +
+

+UCDN

+

+ HarfBuzz includes a copy of the UCDN (Unicode + Database and Normalization) library, which provides functions + for accessing basic Unicode character properties, performing + canonical composition, and performing both canonical and + compatibility decomposition. +

+

+ Currently, UCDN supports direct queries for several more character + properties than HarfBuzz's built-in set of Unicode functions + does, such as the BiDirectional Class, East Asian Width, Paired + Bracket and Resolved Linebreak properties. If you need to access + more properties than HarfBuzz's internal implementation + provides, using the built-in UCDN functions may be a useful solution. +

+

+ The built-in UCDN functions are compiled by default when + building HarfBuzz from source, but this can be disabled with a + compile-time switch. +

+
+ + + \ No newline at end of file diff -Nru harfbuzz-2.5.3/docs/html/what-about-the-other-scripts.html harfbuzz-2.6.2/docs/html/what-about-the-other-scripts.html --- harfbuzz-2.5.3/docs/html/what-about-the-other-scripts.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/what-about-the-other-scripts.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - - - -What about the other scripts?: HarfBuzz Manual - - - - - - - - - - - - - - - - -
-

-What about the other scripts?

-

-

-
- - - \ No newline at end of file diff -Nru harfbuzz-2.5.3/docs/html/working-with-harfbuzz-clusters.html harfbuzz-2.6.2/docs/html/working-with-harfbuzz-clusters.html --- harfbuzz-2.5.3/docs/html/working-with-harfbuzz-clusters.html 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/html/working-with-harfbuzz-clusters.html 2019-10-26 02:02:55.000000000 +0000 @@ -76,18 +76,20 @@ order.

- For left-to-right scripts (LTR) and top-to-bottom scripts (TTB), + For buffers in the left-to-right (LTR) + or top-to-bottom (TTB) text flow direction, HarfBuzz will preserve the monotonic property: client programs - are guaranteed that monotonically increasing initial clulster + are guaranteed that monotonically increasing initial cluster values will be returned as monotonically increasing final cluster values.

- For right-to-left scripts (RTL) and bottom-to-top scripts (BTT), + For buffers in the right-to-left (RTL) + or bottom-to-top (BTT) text flow direction, the directionality of the buffer itself is reversed for final output as a matter of design. Therefore, HarfBuzz inverts the monotonic property: client programs are guaranteed that - monotonically increasing initial clulster values will be + monotonically increasing initial cluster values will be returned as monotonically decreasing final cluster values.

diff -Nru harfbuzz-2.5.3/docs/Makefile.in harfbuzz-2.6.2/docs/Makefile.in --- harfbuzz-2.5.3/docs/Makefile.in 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/Makefile.in 2019-10-26 02:02:55.000000000 +0000 @@ -203,6 +203,8 @@ FREETYPE_DEPS = @FREETYPE_DEPS@ FREETYPE_LIBS = @FREETYPE_LIBS@ GCOV = @GCOV@ +GDI_CFLAGS = @GDI_CFLAGS@ +GDI_LIBS = @GDI_LIBS@ GENHTML = @GENHTML@ GIT = @GIT@ GLIB_CFLAGS = @GLIB_CFLAGS@ diff -Nru harfbuzz-2.5.3/docs/usermanual-buffers-language-script-and-direction.xml harfbuzz-2.6.2/docs/usermanual-buffers-language-script-and-direction.xml --- harfbuzz-2.5.3/docs/usermanual-buffers-language-script-and-direction.xml 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/usermanual-buffers-language-script-and-direction.xml 2019-10-26 02:02:55.000000000 +0000 @@ -7,30 +7,38 @@ Buffers, language, script and direction - The input to HarfBuzz is a series of Unicode characters, stored in a + The input to the HarfBuzz shaper is a series of Unicode characters, stored in a buffer. In this chapter, we'll look at how to set up a buffer with - the text that we want and then customize the properties of the - buffer. + the text that we want and how to customize the properties of the + buffer. We'll also look at a piece of lower-level machinery that + you will need to understand before proceeding: the functions that + HarfBuzz uses to retrieve Unicode information. + + + After shaping is complete, HarfBuzz puts its output back + into the buffer. But getting that output requires setting up a + face and a font first, so we will look at that in the next chapter + instead of here.
Creating and destroying buffers As we saw in our Getting Started example, a buffer is created and - initialized with hb_buffer_create(). This + initialized with hb_buffer_create(). This produces a new, empty buffer object, instantiated with some default values and ready to accept your Unicode strings. HarfBuzz manages the memory of objects (such as buffers) that it creates, so you don't have to. When you have finished working on - a buffer, you can call hb_buffer_destroy(): + a buffer, you can call hb_buffer_destroy(): - hb_buffer_t *buffer = hb_buffer_create(); - ... - hb_buffer_destroy(buffer); - + hb_buffer_t *buf = hb_buffer_create(); + ... + hb_buffer_destroy(buf); + This will destroy the object and free its associated memory - unless some other part of the program holds a reference to this @@ -39,46 +47,364 @@ else destroying it, you should increase its reference count: -void somefunc(hb_buffer_t *buffer) { - buffer = hb_buffer_reference(buffer); - ... - + void somefunc(hb_buffer_t *buf) { + buf = hb_buffer_reference(buf); + ... + And then decrease it once you're done with it: - hb_buffer_destroy(buffer); -} - + hb_buffer_destroy(buf); + } + + + While we are on the subject of reference-counting buffers, it is + worth noting that an individual buffer can only meaningfully be + used by one thread at a time. + To throw away all the data in your buffer and start from scratch, - call hb_buffer_reset(buffer). If you want to + call hb_buffer_reset(buf). If you want to throw away the string in the buffer but keep the options, you can - instead call hb_buffer_clear_contents(buffer). + instead call hb_buffer_clear_contents(buf).
+
Adding text to the buffer Now we have a brand new HarfBuzz buffer. Let's start filling it with text! From HarfBuzz's perspective, a buffer is just a stream - of Unicode codepoints, but your input string is probably in one of - the standard Unicode character encodings (UTF-8, UTF-16, UTF-32) + of Unicode code points, but your input string is probably in one of + the standard Unicode character encodings (UTF-8, UTF-16, or + UTF-32). HarfBuzz provides convenience functions that accept + each of these encodings: + hb_buffer_add_utf8(), + hb_buffer_add_utf16(), and + hb_buffer_add_utf32(). Other than the + character encoding they accept, they function identically. + + + You can add UTF-8 text to a buffer by passing in the text array, + the array's length, an offset into the array for the first + character to add, and the length of the segment to add: + + hb_buffer_add_utf8 (hb_buffer_t *buf, + const char *text, + int text_length, + unsigned int item_offset, + int item_length) + + + So, in practice, you can say: + + + hb_buffer_add_utf8(buf, text, strlen(text), 0, strlen(text)); + + + This will append your new characters to + buf, not replace its existing + contents. Also, note that you can use -1 in + place of the first instance of strlen(text) + if your text array is NULL-terminated. Similarly, you can also use + -1 as the final argument want to add its full + contents. + + + Whatever start item_offset and + item_length you provide, HarfBuzz will also + attempt to grab the five characters before + the offset point and the five characters + after the designated end. These are the + before and after "context" segments, which are used internally + for HarfBuzz to make shaping decisions. They will not be part of + the final output, but they ensure that HarfBuzz's + script-specific shaping operations are correct. If there are + fewer than five characters available for the before or after + contexts, HarfBuzz will just grab what is there. + + + For longer text runs, such as full paragraphs, it might be + tempting to only add smaller sub-segments to a buffer and + shape them in piecemeal fashion. Generally, this is not a good + idea, however, because a lot of shaping decisions are + dependent on this context information. For example, in Arabic + and other connected scripts, HarfBuzz needs to know the code + points before and after each character in order to correctly + determine which glyph to return. + + + The safest approach is to add all of the text available, then + use item_offset and + item_length to indicate which characters you + want shaped, so that HarfBuzz has access to any context. + + + You can also add Unicode code points directly with + hb_buffer_add_codepoints(). The arguments + to this function are the same as those for the UTF + encodings. But it is particularly important to note that + HarfBuzz does not do validity checking on the text that is added + to a buffer. Invalid code points will be replaced, but it is up + to you to do any deep-sanity checking necessary. + +
+
Setting buffer properties + Buffers containing input characters still need several + properties set before HarfBuzz can shape their text correctly. + + + Initially, all buffers are set to the + HB_BUFFER_CONTENT_TYPE_INVALID content + type. After adding text, the buffer should be set to + HB_BUFFER_CONTENT_TYPE_UNICODE instead, which + indicates that it contains un-shaped input + characters. After shaping, the buffer will have the + HB_BUFFER_CONTENT_TYPE_GLYPHS content type. + + + hb_buffer_add_utf8() and the + other UTF functions set the content type of their buffer + automatically. But if you are reusing a buffer you may want to + check its state with + hb_buffer_get_content_type(buffer). If + necessary you can set the content type with + + + hb_buffer_set_content_type(buf, HB_BUFFER_CONTENT_TYPE_UNICODE); + + + to prepare for shaping. + + + Buffers also need to carry information about the script, + language, and text direction of their contents. You can set + these properties individually: + + + hb_buffer_set_direction(buf, HB_DIRECTION_LTR); + hb_buffer_set_script(buf, HB_SCRIPT_LATIN); + hb_buffer_set_language(buf, hb_language_from_string("en", -1)); + + + However, since these properties are often the repeated for + multiple text runs, you can also save them in a + hb_segment_properties_t for reuse: + + + hb_segment_properties_t *savedprops; + hb_buffer_get_segment_properties (buf, savedprops); + ... + hb_buffer_set_segment_properties (buf2, savedprops); + + + HarfBuzz also provides getter functions to retrieve a buffer's + direction, script, and language properties individually. + + + HarfBuzz recognizes four text directions in + hb_direction_t: left-to-right + (HB_DIRECTION_LTR), right-to-left (HB_DIRECTION_RTL), + top-to-bottom (HB_DIRECTION_TTB), and + bottom-to-top (HB_DIRECTION_BTT). For the + script property, HarfBuzz uses identifiers based on the + ISO 15924 + standard. For languages, HarfBuzz uses tags based on the + IETF BCP 47 standard. + + + Helper functions are provided to convert character strings into + the necessary script and language tag types. + + + Two additional buffer properties to be aware of are the + "invisible glyph" and the replacement code point. The + replacement code point is inserted into buffer output in place of + any invalid code points encountered in the input. By default, it + is the Unicode REPLACEMENT CHARACTER code + point, U+FFFD "�". You can change this with + + + hb_buffer_set_replacement_codepoint(buf, replacement); + + + passing in the replacement Unicode code point as the + replacement parameter. -
-
- What about the other scripts? + The invisible glyph is used to replace all output glyphs that + are invisible. By default, the standard space character + U+0020 is used; you can replace this (for + example, when using a font that provides script-specific + spaces) with + + + hb_buffer_set_invisible_glyph(buf, replacement_glyph); + + + Do note that in the replacement_glyph + parameter, you must provide the glyph ID of the replacement you + wish to use, not the Unicode code point. + + + HarfBuzz supports a few additional flags you might want to set + on your buffer under certain circumstances. The + HB_BUFFER_FLAG_BOT and + HB_BUFFER_FLAG_EOT flags tell HarfBuzz + that the buffer represents the beginning or end (respectively) + of a text element (such as a paragraph or other block). Knowing + this allows HarfBuzz to apply certain contextual font features + when shaping, such as initial or final variants in connected + scripts. + + + HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES + tells HarfBuzz not to hide glyphs with the + Default_Ignorable property in Unicode. This + property designates control characters and other non-printing + code points, such as joiners and variation selectors. Normally + HarfBuzz replaces them in the output buffer with zero-width + space glyphs (using the "invisible glyph" property discussed + above); setting this flag causes them to be printed, which can + be helpful for troubleshooting. + + + Conversely, setting the + HB_BUFFER_FLAG_REMOVE_DEFAULT_IGNORABLES flag + tells HarfBuzz to remove Default_Ignorable + glyphs from the output buffer entirely. Finally, setting the + HB_BUFFER_FLAG_DO_NOT_INSERT_DOTTED_CIRCLE + flag tells HarfBuzz not to insert the dotted-circle glyph + (U+25CC, "◌"), which is normally + inserted into buffer output when broken character sequences are + encountered (such as combining marks that are not attached to a + base character).
+
Customizing Unicode functions + HarfBuzz requires some simple functions for accessing + information from the Unicode Character Database (such as the + General_Category (gc) and + Script (sc) properties) that is useful + for shaping, as well as some useful operations like composing and + decomposing code points. + + + HarfBuzz includes its own internal, lightweight set of Unicode + functions. At build time, it is also possible to compile support + for some other options, such as the Unicode functions provided + by GLib or the International Components for Unicode (ICU) + library. Generally, this option is only of interest for client + programs that have specific integration requirements or that do + a significant amount of customization. + + + If your program has access to other Unicode functions, however, + such as through a system library or application framework, you + might prefer to use those instead of the built-in + options. HarfBuzz supports this by implementing its Unicode + functions as a set of virtual methods that you can replace — + without otherwise affecting HarfBuzz's functionality. + + + The Unicode functions are specified in a structure called + unicode_funcs which is attached to each + buffer. But even though unicode_funcs is + associated with a hb_buffer_t, the functions + themselves are called by other HarfBuzz APIs that access + buffers, so it would be unwise for you to hook different + functions into different buffers. + + + In addition, you can mark your unicode_funcs + as immutable by calling + hb_unicode_funcs_make_immutable (ufuncs). + This is especially useful if your code is a + library or framework that will have its own client programs. By + marking your Unicode function choices as immutable, you prevent + your own client programs from changing the + unicode_funcs configuration and introducing + inconsistencies and errors downstream. + + + You can retrieve the Unicode-functions configuration for + your buffer by calling hb_buffer_get_unicode_funcs(): + + + hb_unicode_funcs_t *ufunctions; + ufunctions = hb_buffer_get_unicode_funcs(buf); + + + The current version of unicode_funcs uses six functions: + + + + + hb_unicode_combining_class_func_t: + returns the Canonical Combining Class of a code point. + + + + + hb_unicode_general_category_func_t: + returns the General Category (gc) of a code point. + + + + + hb_unicode_mirroring_func_t: returns + the Mirroring Glyph code point (for bi-directional + replacement) of a code point. + + + + + hb_unicode_script_func_t: returns the + Script (sc) property of a code point. + + + + + hb_unicode_compose_func_t: returns the + canonical composition of a sequence of two code points. + + + + + hb_unicode_decompose_func_t: returns + the canonical decomposition of a code point. + + + + + Note, however, that future HarfBuzz releases may alter this set. + + + Each Unicode function has a corresponding setter, with which you + can assign a callback to your replacement function. For example, + to replace + hb_unicode_general_category_func_t, you can call + + + hb_unicode_funcs_set_general_category_func (*ufuncs, func, *user_data, destroy) + + + Virtualizing this set of Unicode functions is primarily intended + to improve portability. There is no need for every client + program to make the effort to replace the default options, so if + you are unsure, do not feel any pressure to customize + unicode_funcs.
+
diff -Nru harfbuzz-2.5.3/docs/usermanual-clusters.xml harfbuzz-2.6.2/docs/usermanual-clusters.xml --- harfbuzz-2.5.3/docs/usermanual-clusters.xml 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/usermanual-clusters.xml 2019-10-26 02:02:55.000000000 +0000 @@ -156,18 +156,20 @@ order. - For left-to-right scripts (LTR) and top-to-bottom scripts (TTB), + For buffers in the left-to-right (LTR) + or top-to-bottom (TTB) text flow direction, HarfBuzz will preserve the monotonic property: client programs - are guaranteed that monotonically increasing initial clulster + are guaranteed that monotonically increasing initial cluster values will be returned as monotonically increasing final cluster values. - For right-to-left scripts (RTL) and bottom-to-top scripts (BTT), + For buffers in the right-to-left (RTL) + or bottom-to-top (BTT) text flow direction, the directionality of the buffer itself is reversed for final output as a matter of design. Therefore, HarfBuzz inverts the monotonic property: client programs are guaranteed that - monotonically increasing initial clulster values will be + monotonically increasing initial cluster values will be returned as monotonically decreasing final cluster values. diff -Nru harfbuzz-2.5.3/docs/usermanual-fonts-and-faces.xml harfbuzz-2.6.2/docs/usermanual-fonts-and-faces.xml --- harfbuzz-2.5.3/docs/usermanual-fonts-and-faces.xml 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/usermanual-fonts-and-faces.xml 2019-10-26 02:02:55.000000000 +0000 @@ -5,20 +5,449 @@ ]> - Fonts and faces -
- Using FreeType + Fonts, faces, and output + + In the previous chapter, we saw how to set up a buffer and fill + it with text as Unicode code points. In order to shape this + buffer text with HarfBuzz, you will need also need a font + object. + + + HarfBuzz provides abstractions to help you cache and reuse the + heavier parts of working with binary fonts, so we will look at + how to do that. We will also look at how to work with the + FreeType font-rendering library and at how you can customize + HarfBuzz to work with other libraries. + + + Finally, we will look at how to work with OpenType variable + fonts, the latest update to the OpenType font format, and at + some other recent additions to OpenType. + + +
+ Font and face objects + + The outcome of shaping a run of text depends on the contents of + a specific font file (such as the substitutions and positioning + moves in the 'GSUB' and 'GPOS' tables), so HarfBuzz makes + accessing those internals fast. + + + An hb_face_t represents a face + in HarfBuzz. This data type is a wrapper around an + hb_blob_t blob that holds the contents of a binary + font file. Since HarfBuzz supports TrueType Collections and + OpenType Collections (each of which can include multiple + typefaces), a HarfBuzz face also requires an index number + specifying which typeface in the file you want to use. Most of + the font files you will encounter in the wild include just a + single face, however, so most of the time you would pass in + 0 as the index when you create a face: + + + hb_blob_t* blob = hb_blob_create_from_file(file); + ... + hb_face_t* face = hb_face_create(blob, 0); + + + On its own, a face object is not quite ready to use for + shaping. The typeface must be set to a specific point size in + order for some details (such as hinting) to work. In addition, + if the font file in question is an OpenType Variable Font, then + you may need to specify one or variation-axis settings (or a + named instance) in order to get the output you need. + + + In HarfBuzz, you do this by creating a font + object from your face. + + + Font objects also have the advantage of being considerably + lighter-weight than face objects (remember that a face contains + the contents of a binary font file mapped into memory). As a + result, you can cache and reuse a font object, but you could + also create a new one for each additional size you needed. + Creating new fonts incurs some additional overhead, of course, + but whether or not it is excessive is your call in the end. In + contrast, face objects are substantially larger, and you really + should cache them and reuse them whenever possible. + + + You can create a font object from a face object: + + + hb_font_t* hb_font = hb_font_create(hb_face); + + + After creating a font, there are a few properties you should + set. Many fonts enable and disable hints based on the size it + is used at, so setting this is important for font + objects. hb_font_set_ppem(font, x_ppem, + y_ppem) sets the pixels-per-EM value of the font. You + can also set the point size of the font with + hb_font_set_ptem(font, ptem). HarfBuzz uses the + industry standard 72 points per inch. + + + HarfBuzz lets you specify the degree subpixel precision you want + through a scaling factor. You can set horizontal and + vertical scaling factors on the + font by calling hb_font_set_scale(font, x_scale, + y_scale). + + + There may be times when you are handed a font object and need to + access the face object that it comes from. For that, you can call + + + hb_face = hb_font_get_face(hb_font); + + + You can also create a font object from an existing font object + using the hb_font_create_sub_font() + function. This creates a child font object that is initiated + with the same attributes as its parent; it can be used to + quickly set up a new font for the purpose of overriding a specific + font-functions method. + + All face objects and font objects are lifecycle-managed by + HarfBuzz. After creating a face, you increase its reference + count with hb_face_reference(face) and + decrease it with + hb_face_destroy(face). Likewise, you + increase the reference count on a font with + hb_font_reference(font) and decrease it + with hb_font_destroy(font). + + + You can also attach user data to face objects and font objects.
-
- Using HarfBuzz's native OpenType implementation + +
+ Customizing font functions + + During shaping, HarfBuzz frequently needs to query font objects + to get at the contents and parameters of the glyphs in a font + file. It includes a built-in set of functions that is tailored + to working with OpenType fonts. However, as was the case with + Unicode functions in the buffers chapter, HarfBuzz also wants to + make it easy for you to assign a substitute set of font + functions if you are developing a program to work with a library + or platform that provides its own font functions. + + + Therefore, the HarfBuzz API defines a set of virtual + methods for accessing font-object properties, and you can + replace the defaults with your own selections without + interfering with the shaping process. Each font object in + HarfBuzz includes a structure called + font_funcs that serves as a vtable for the + font object. The virtual methods in + font_funcs are: + + + + + hb_font_get_font_h_extents_func_t: returns + the extents of the font for horizontal text. + + + + + hb_font_get_font_v_extents_func_t: returns + the extents of the font for vertical text. + + + + + hb_font_get_nominal_glyph_func_t: returns + the font's nominal glyph for a given code point. + + + + + hb_font_get_variation_glyph_func_t: returns + the font's glyph for a given code point when it is followed by a + given Variation Selector. + + + + hb_font_get_nominal_glyphs_func_t: returns + the font's nominal glyphs for a series of code points. + + + + + hb_font_get_glyph_advance_func_t: returns + the advance for a glyph. + + + + + hb_font_get_glyph_h_advance_func_t: returns + the advance for a glyph for horizontal text. + + + + + hb_font_get_glyph_v_advance_func_t:returns + the advance for a glyph for vertical text. + + + + + hb_font_get_glyph_advances_func_t: returns + the advances for a series of glyphs. + + + + + hb_font_get_glyph_h_advances_func_t: returns + the advances for a series of glyphs for horizontal text . + + + + + hb_font_get_glyph_v_advances_func_t: returns + the advances for a series of glyphs for vertical text. + + + + + hb_font_get_glyph_origin_func_t: returns + the origin coordinates of a glyph. + + + + + hb_font_get_glyph_h_origin_func_t: returns + the origin coordinates of a glyph for horizontal text. + + + + + hb_font_get_glyph_v_origin_func_t: returns + the origin coordinates of a glyph for vertical text. + + + + + hb_font_get_glyph_extents_func_t: returns + the extents for a glyph. + + + + + hb_font_get_glyph_contour_point_func_t: + returns the coordinates of a specific contour point from a glyph. + + + + + hb_font_get_glyph_name_func_t: returns the + name of a glyph (from its glyph index). + + + + + hb_font_get_glyph_from_name_func_t: returns + the glyph index that corresponds to a given glyph name. + + + + + You can fetch the font-functions configuration for a font object + by calling hb_font_get_font_funcs(): + + + hb_font_funcs_t *ffunctions; + ffunctions = hb_font_get_font_funcs (font); + + + The individual methods can each be replaced with their own setter + function, such as + hb_font_funcs_set_nominal_glyph_func(*ffunctions, + func, *user_data, destroy). + + + Font-functions structures can be reused for multiple font + objects, and can be reference counted with + hb_font_funcs_reference() and + hb_font_funcs_destroy(). Just like other + objects in HarfBuzz, you can set user-data for each + font-functions structure and assign a destroy callback for + it. + + + You can also mark a font-functions structure as immutable, + with hb_font_funcs_make_immutable(). This + is especially useful if your code is a library or framework that + will have its own client programs. By marking your + font-functions structures as immutable, you prevent your client + programs from changing the configuration and introducing + inconsistencies and errors downstream.
-
- Using your own font functions + +
+ Font objects and HarfBuzz's native OpenType implementation + + By default, whenever HarfBuzz creates a font object, it will + configure the font to use a built-in set of font functions that + supports contemporary OpenType font internals. If you want to + work with OpenType or TrueType fonts, you should be able to use + these functions without difficulty. + + + Many of the methods in the font-functions structure deal with + the fundamental properties of glyphs that are required for + shaping text: extents (the maximums and minimums on each axis), + origins (the (0,0) coordinate point which + glyphs are drawn in reference to), and advances (the amount that + the cursor needs to be moved after drawing each glyph, including + any empty space for the glyph's side bearings). + + + As you can see in the list of functions, there are separate "horizontal" + and "vertical" variants depending on whether the text is set in + the horizontal or vertical direction. For some scripts, fonts + that are designed to support text set horizontally or vertically (for + example, in Japanese) may include metrics for both text + directions. When fonts don't include this information, HarfBuzz + does its best to transform what the font provides. + + + In addition to the direction-specific functions, HarfBuzz + provides some higher-level functions for fetching information + like extents and advances for a glyph. If you call + + + hb_font_get_glyph_advance_for_direction(font, direction, extents); + + + then you can provide any hb_direction_t as the + direction parameter, and HarfBuzz will + use the correct function variant for the text direction. There + are similar higher-level versions of the functions for fetching + extents, origin coordinates, and contour-point + coordinates. There are also addition and subtraction functions + for moving points with respect to the origin. + + + There are also methods for fetching the glyph ID that + corresponds to a Unicode code point (possibly when followed by a + variation-selector code point), fetching the glyph name from the + font, and fetching the glyph ID that corresponds to a glyph name + you already have. + + + HarfBuzz also provides functions for converting between glyph + names and string + variables. hb_font_glyph_to_string(font, glyph, s, + size) retrieves the name for the glyph ID + glyph from the font object. It generates a + generic name of the form gidDDD (where DDD is + the glyph index) if there is no name for the glyph in the + font. The hb_font_glyph_from_string(font, s, len, + glyph) takes an input string s + and looks for a glyph with that name in the font, returning its + glyph ID in the glyph + output parameter. It automatically parses + gidDDD and uniUUUU strings. + +
+ + + + + + +
+ Working with OpenType Variable Fonts + + If you are working with OpenType Variable Fonts, there are a few + additional functions you should use to specify the + variation-axis settings of your font object. Without doing so, + your variable font's font object can still be used, but only at + the default setting for every axis (which, of course, is + sometimes what you want, but does not cover general usage). + + + HarfBuzz manages variation settings in the + hb_variation_t data type, which holds a tag for the + variation-axis identifier tag and a value for its + setting. You can retrieve the list of variation axes in a font + binary from the face object (not from a font object, notably) by + calling hb_ot_var_get_axis_count(face) to + find the number of axes, then using + hb_ot_var_get_axis_infos() to collect the + axis structures: + + + axes = hb_ot_var_get_axis_count(face); + ... + hb_ot_var_get_axis_infos(face, 0, axes, axes_array); + + + For each axis returned in the array, you can can access the + identifier in its tag. HarfBuzz also has + tag definitions predefined for the five standard axes specified + in OpenType (ital for italic, + opsz for optical size, + slnt for slant, wdth for + width, and wght for weight). Each axis also + has a min_value, a + default_value, and a max_value. + + + To set your font object's variation settings, you call the + hb_font_set_variations() function with an + array of hb_variation_t variation settings. Let's + say our font has weight and width axes. We need to specify each + of the axes by tag and assign a value on the axis: + + + unsigned int variation_count = 2; + hb_variation_t variation_data[variation_count]; + variation_data[0].tag = HB_OT_TAG_VAR_AXIS_WIDTH; + variation_data[1].tag = HB_OT_TAG_VAR_AXIS_WEIGHT; + variation_data[0].value = 80; + variation_data[1].value = 750; + ... + hb_font_set_variations(font, variation_data, variation_count); + + + That should give us a slightly condensed font ("normal" on the + wdth axis is 100) at a noticeably bolder + weight ("regular" is 400 on the wght axis). + + + In practice, though, you should always check that the value you + want to set on the axis is within the + [min_value,max_value] + range actually implemented in the font's variation axis. After + all, a font might only provide lighter-than-regular weights, and + setting a heavier value on the wght axis will + not change that. + + Once your variation settings are specified on your font object, + however, shaping with a variable font is just like shaping a + static font.
- + + diff -Nru harfbuzz-2.5.3/docs/usermanual-install-harfbuzz.xml harfbuzz-2.6.2/docs/usermanual-install-harfbuzz.xml --- harfbuzz-2.5.3/docs/usermanual-install-harfbuzz.xml 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/usermanual-install-harfbuzz.xml 2019-10-26 02:02:55.000000000 +0000 @@ -246,7 +246,7 @@ Use GLib. (Default = auto) - + This option enables or disables usage of the GLib library. The default setting is to check for the @@ -297,7 +297,7 @@ Use Fontconfig. (Default = auto) - + This option enables or disables usage of the Fontconfig library, which provides font-matching functions and @@ -317,7 +317,7 @@ Use the ICU library. (Default = auto) - + This option enables or disables usage of the International Components for @@ -331,29 +331,11 @@ - --with-ucdn - - - Use HarfBuzz's built-in UCDN library. (Default = auto) - - - The HarfBuzz source tree includes a Unicode - Database and Normalization (UCDN) library - that provides access to basic character properties in - the Unicode Character Database (UCD) as well as low-level - normalization functions. HarfBuzz can be built without - this UCDN support if the usage of a different UCDN - library is desired. - - - - - --with-graphite2 Use the Graphite2 library. (Default = no) - + This option enables or disables usage of the Graphite2 library, which provides support for the Graphite shaping @@ -367,7 +349,7 @@ Use the FreeType library. (Default = auto) - + This option enables or disables usage of the FreeType font-rendering library. The default setting is to check for the @@ -384,7 +366,7 @@ Use the Uniscribe library (experimental). (Default = no) - + This option enables or disables usage of the Uniscribe font-rendering library. Uniscribe is available on @@ -400,7 +382,7 @@ Use the DirectWrite library (experimental). (Default = no) - + This option enables or disables usage of the DirectWrite font-rendering library. DirectWrite is available on @@ -416,7 +398,7 @@ Use the CoreText library. (Default = no) - + This option enables or disables usage of the CoreText library. CoreText is available on macOS and iOS systems. diff -Nru harfbuzz-2.5.3/docs/usermanual-opentype-features.xml harfbuzz-2.6.2/docs/usermanual-opentype-features.xml --- harfbuzz-2.5.3/docs/usermanual-opentype-features.xml 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/usermanual-opentype-features.xml 2019-10-26 02:02:55.000000000 +0000 @@ -6,14 +6,299 @@ ]> Shaping and shape plans -
+ + Once you have your face and font objects configured as desired and + your input buffer is filled with the characters you need to shape, + all you need to do is call hb_shape(). + + + HarfBuzz will return the shaped version of the text in the same + buffer that you provided, but it will be in output mode. At that + point, you can iterate through the glyphs in the buffer, drawing + each one at the specified position or handing them off to the + appropriate graphics library. + + + For the most part, HarfBuzz's shaping step is straightforward from + the outside. But that doesn't mean there will never be cases where + you want to look under the hood and see what is happening on the + inside. HarfBuzz provides facilities for doing that, too. + + +
+ Shaping and buffer output + + The hb_shape() function call takes four arguments: the font + object to use, the buffer of characters to shape, an array of + user-specified features to apply, and the length of that feature + array. The feature array can be NULL, so for the sake of + simplicity we will start with that case. + + + Internally, HarfBuzz looks at the tables of the font file to + determine where glyph classes, substitutions, and positioning + are defined, using that information to decide which + shaper to use (ot for + OpenType fonts, aat for Apple Advanced + Typography fonts, and so on). It also looks at the direction, + script, and language properties of the segment to figure out + which script-specific shaping model is needed (at least, in + shapers that support multiple options). + + + If a font has a GDEF table, then that is used for + glyph classes; if not, HarfBuzz will fall back to Unicode + categorization by code point. If a font has an AAT "morx" table, + then it is used for substitutions; if not, but there is a GSUB + table, then the GSUB table is used. If the font has an AAT + "kerx" table, then it is used for positioning; if not, but + there is a GPOS table, then the GPOS table is used. If neither + table is found, but there is a "kern" table, then HarfBuzz will + use the "kern" table. If there is no "kerx", no GPOS, and no + "kern", HarfBuzz will fall back to positioning marks itself. + + + With a well-behaved OpenType font, you expect GDEF, GSUB, and + GPOS tables to all be applied. HarfBuzz implements the + script-specific shaping models in internal functions, rather + than in the public API. + + + The algorithms + used for complex scripts can be quite involved; HarfBuzz tries + to be compatible with the OpenType Layout specification + and, wherever there is any ambiguity, HarfBuzz attempts to replicate the + output of Microsoft's Uniscribe engine. See the Microsoft + Typography pages for more detail. + + + In general, though, all that you need to know is that + hb_shape() returns the results of shaping + in the same buffer that you provided. The buffer's content type + will now be set to + HB_BUFFER_CONTENT_TYPE_GLYPHS, indicating + that it contains shaped output, rather than input text. You can + now extract the glyph information and positioning arrays: + + + hb_glyph_info_t *glyph_info = hb_buffer_get_glyph_infos(buf, &glyph_count); + hb_glyph_position_t *glyph_pos = hb_buffer_get_glyph_positions(buf, &glyph_count); + + + The glyph information array holds a hb_glyph_info_t + for each output glyph, which has two fields: + codepoint and + cluster. Whereas, in the input buffer, + the codepoint field contained the Unicode + code point, it now contains the glyph ID of the corresponding + glyph in the font. The cluster field is + an integer that you can use to help identify when shaping has + reordered, split, or combined code points; we will say more + about that in the next chapter. + + + The glyph positions array holds a corresponding + hb_glyph_position_t for each output glyph, + containing four fields: x_advance, + y_advance, + x_offset, and + y_offset. The advances tell you how far + you need to move the drawing point after drawing this glyph, + depending on whether you are setting horizontal text (in which + case you will have x advances) or vertical text (for which you + will have y advances). The x and y offsets tell you where to + move to start drawing the glyph; usually you will have both and + x and a y offset, regardless of the text direction. + + + Most of the time, you will rely on a font-rendering library or + other graphics library to do the actual drawing of glyphs, so + you will need to iterate through the glyphs in the buffer and + pass the corresponding values off. + +
+ +
OpenType features + OpenType features enable fonts to include smart behavior, + implemented as "lookup" rules stored in the GSUB and GPOS + tables. The OpenType specification defines a long list of + standard features that fonts can use for these behaviors; each + feature has a four-character reserved name and a well-defined + semantic meaning. + + + Some OpenType features are defined for the purpose of supporting + complex-script shaping, and are automatically activated, but + only when a buffer's script property is set to a script that the + feature supports. + + + Other features are more generic and can apply to several (or + any) script, and shaping engines are expected to implement + them. By default, HarfBuzz activates several of these features + on every text run. They include ccmp, + locl, mark, + mkmk, and rlig. + + + In addition, if the text direction is horizontal, HarfBuzz + also applies the calt, + clig, curs, + kern, liga, + rclt, and frac features. + + + If the text direction is vertical, HarfBuzz applies + the vert feature by default. + + + Still other features are designed to be purely optional and left + up to the application or the end user to enable or disable as desired. + + + You can adjust the set of features that HarfBuzz applies to a + buffer by supplying an array of hb_feature_t + features as the third argument to + hb_shape(). For a simple case, let's just + enable the dlig feature, which turns on any + "discretionary" ligatures in the font: + + + hb_feature_t userfeatures[1]; + userfeatures[0].tag = HB_TAG('d','l','i','g'); + userfeatures[0].value = 1; + userfeatures[0].start = HB_FEATURE_GLOBAL_START; + userfeatures[0].end = HB_FEATURE_GLOBAL_END; + + + HB_FEATURE_GLOBAL_END and + HB_FEATURE_GLOBAL_END are macros we can use + to indicate that the features will be applied to the entire + buffer. We could also have used a literal 0 + for the start and a -1 to indicate the end of + the buffer (or have selected other start and end positions, if needed). + + + When we pass the userfeatures array to + hb_shape(), any discretionary ligature + substitutions from our font that match the text in our buffer + will get performed: + + + hb_shape(font, buf, userfeatures, num_features); + + + Just like we enabled the dlig feature by + setting its value to + 1, you would disable a feature by setting its + value to 0. Some + features can take other value settings; + be sure you read the full specification of each feature tag to + understand what it does and how to control it.
-
+ +
+ Shaper selection + + The basic version of hb_shape() determines + its shaping strategy based on examining the capabilities of the + font file. OpenType font tables cause HarfBuzz to try the + ot shaper, while AAT font tables cause HarfBuzz to try the + aat shaper. + + + In the real world, however, a font might include some unusual + mix of tables, or one of the tables might simply be broken for + the script you need to shape. So, sometimes, you might not + want to rely on HarfBuzz's process for deciding what to do, and + just tell hb_shape() what you want it to try. + + + hb_shape_full() is an alternate shaping + function that lets you supply a list of shapers for HarfBuzz to + try, in order, when shaping your buffer. For example, if you + have determined that HarfBuzz's attempts to work around broken + tables gives you better results than the AAT shaper itself does, + you might move the AAT shaper to the end of your list of + preferences and call hb_shape_full() + + + char *shaperprefs[3] = {"ot", "default", "aat"}; + ... + hb_shape_full(font, buf, userfeatures, num_features, shaperprefs); + + + to get results you are happier with. + + + You may also want to call + hb_shape_list_shapers() to get a list of + the shapers that were built at compile time in your copy of HarfBuzz. + +
+ +
Plans and caching + Internally, HarfBuzz uses a structure called a shape plan to + track its decisions about how to shape the contents of a + buffer. The hb_shape() function builds up the shape plan by + examining segment properties and by inspecting the contents of + the font. + + + This process can involve some decision-making and + trade-offs — for example, HarfBuzz inspects the GSUB and GPOS + lookups for the script and language tags set on the segment + properties, but it falls back on the lookups under the + DFLT tag (and sometimes other common tags) + if there are actually no lookups for the tag requested. + + + HarfBuzz also includes some work-arounds for + handling well-known older font conventions that do not follow + OpenType or Unicode specifications, for buggy system fonts, and for + peculiarities of Microsoft Uniscribe. All of that means that a + shape plan, while not something that you should edit directly in + client code, still might be an object that you want to + inspect. Furthermore, if resources are tight, you might want to + cache the shape plan that HarfBuzz builds for your buffer and + font, so that you do not have to rebuild it for every shaping call. + + + You can create a cacheable shape plan with + hb_shape_plan_create_cached(face, props, + user_features, num_user_features, shaper_list), where + face is a face object (not a font object, + notably), props is an + hb_segment_properties_t, + user_features is an array of + hb_feature_ts (with length + num_user_features), and + shaper_list is a list of shapers to try. + + + Shape plans are objects in HarfBuzz, so there are + reference-counting functions and user-data attachment functions + you can + use. hb_shape_plan_reference(shape_plan) + increases the reference count on a shape plan, while + hb_shape_plan_destroy(shape_plan) decreases + the reference count, destroying the shape plan when the last + reference is dropped. + + + You can attach user data to a shaper (with a key) using the + hb_shape_plan_set_user_data(shape_plan,key,data,destroy,replace) + function, optionally supplying a destroy + callback to use. You can then fetch the user data attached to a + shape plan with + hb_shape_plan_get_user_data(shape_plan, key).
+ diff -Nru harfbuzz-2.5.3/docs/version.xml harfbuzz-2.6.2/docs/version.xml --- harfbuzz-2.5.3/docs/version.xml 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/docs/version.xml 2019-10-26 02:02:55.000000000 +0000 @@ -1 +1 @@ -2.5.3 +2.6.2 diff -Nru harfbuzz-2.5.3/Makefile.in harfbuzz-2.6.2/Makefile.in --- harfbuzz-2.5.3/Makefile.in 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/Makefile.in 2019-10-26 02:02:55.000000000 +0000 @@ -260,6 +260,8 @@ FREETYPE_DEPS = @FREETYPE_DEPS@ FREETYPE_LIBS = @FREETYPE_LIBS@ GCOV = @GCOV@ +GDI_CFLAGS = @GDI_CFLAGS@ +GDI_LIBS = @GDI_LIBS@ GENHTML = @GENHTML@ GIT = @GIT@ GLIB_CFLAGS = @GLIB_CFLAGS@ diff -Nru harfbuzz-2.5.3/NEWS harfbuzz-2.6.2/NEWS --- harfbuzz-2.5.3/NEWS 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/NEWS 2019-10-26 02:02:55.000000000 +0000 @@ -1,3 +1,43 @@ +Overview of changes leading to 2.6.2 +Monday, September 30, 2019 +==================================== +- Misc small fixes, mostly to build-related issues. + + +Overview of changes leading to 2.6.1 +Thursday, August 22, 2019 +==================================== +- Fix regression with hb_font_create_sub_font scaling introduced in 2.6.0. +- Change interpretation of font PTEM size / CoreText font size handling. + See https://github.com/harfbuzz/harfbuzz/pull/1484 +- hb-ot-font: Prefer symbol cmap subtable if present. +- Apply 'dist'/'abvm'/'blwm' features to all scripts. +- Drop experimental DirectWrite API. + + +Overview of changes leading to 2.6.0 +Tuesday, August 13, 2019 +==================================== +- New OpenType metrics, baseline, and metadata table access APIs. +- New API to set font variations to a named-instance. +- New hb-gdi.h header and API for creating hb_face_t from HFONT. +- Amalgam: Provide a single-file harfbuzz.cc file for easier alternate building. +- More size-reduction configurable options, enabled by HB_TINY. +- New API: ++hb_font_set_var_named_instance() ++hb_gdi_face_create() ++hb_ot_layout_baseline_tag_t ++hb_ot_layout_get_baseline() ++hb_ot_meta_tag_t ++hb_ot_meta_get_entry_tags() ++hb_ot_meta_reference_entry() ++hb_ot_metrics_tag_t ++hb_ot_metrics_get_position() ++hb_ot_metrics_get_variation() ++hb_ot_metrics_get_x_variation() ++hb_ot_metrics_get_y_variation() + + Overview of changes leading to 2.5.3 Wednesday, June 26, 2019 ==================================== diff -Nru harfbuzz-2.5.3/.pc/applied-patches harfbuzz-2.6.2/.pc/applied-patches --- harfbuzz-2.5.3/.pc/applied-patches 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/.pc/applied-patches 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1 @@ +py3.diff diff -Nru harfbuzz-2.5.3/.pc/py3.diff/src/gen-arabic-table.py harfbuzz-2.6.2/.pc/py3.diff/src/gen-arabic-table.py --- harfbuzz-2.5.3/.pc/py3.diff/src/gen-arabic-table.py 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/.pc/py3.diff/src/gen-arabic-table.py 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,267 @@ +#!/usr/bin/env python + +from __future__ import print_function, division, absolute_import + +import io, os.path, sys + +if len (sys.argv) != 4: + print ("usage: ./gen-arabic-table.py ArabicShaping.txt UnicodeData.txt Blocks.txt", file=sys.stderr) + sys.exit (1) + +files = [io.open (x, encoding='utf-8') for x in sys.argv[1:]] + +headers = [[files[0].readline (), files[0].readline ()], [files[2].readline (), files[2].readline ()]] +headers.append (["UnicodeData.txt does not have a header."]) +while files[0].readline ().find ('##################') < 0: + pass + +blocks = {} +def read_blocks(f): + global blocks + for line in f: + + j = line.find ('#') + if j >= 0: + line = line[:j] + + fields = [x.strip () for x in line.split (';')] + if len (fields) == 1: + continue + + uu = fields[0].split ('..') + start = int (uu[0], 16) + if len (uu) == 1: + end = start + else: + end = int (uu[1], 16) + + t = fields[1] + + for u in range (start, end + 1): + blocks[u] = t + +def print_joining_table(f): + + values = {} + for line in f: + + if line[0] == '#': + continue + + fields = [x.strip () for x in line.split (';')] + if len (fields) == 1: + continue + + u = int (fields[0], 16) + + if fields[3] in ["ALAPH", "DALATH RISH"]: + value = "JOINING_GROUP_" + fields[3].replace(' ', '_') + else: + value = "JOINING_TYPE_" + fields[2] + values[u] = value + + short_value = {} + for value in set([v for v in values.values()] + ['JOINING_TYPE_X']): + short = ''.join(x[0] for x in value.split('_')[2:]) + assert short not in short_value.values() + short_value[value] = short + + print () + for value,short in short_value.items(): + print ("#define %s %s" % (short, value)) + + uu = sorted(values.keys()) + num = len(values) + all_blocks = set([blocks[u] for u in uu]) + + last = -100000 + ranges = [] + for u in uu: + if u - last <= 1+16*5: + ranges[-1][-1] = u + else: + ranges.append([u,u]) + last = u + + print () + print ("static const uint8_t joining_table[] =") + print ("{") + last_block = None + offset = 0 + for start,end in ranges: + + print () + print ("#define joining_offset_0x%04xu %d" % (start, offset)) + + for u in range(start, end+1): + + block = blocks.get(u, last_block) + value = values.get(u, "JOINING_TYPE_X") + + if block != last_block or u == start: + if u != start: + print () + if block in all_blocks: + print ("\n /* %s */" % block) + else: + print ("\n /* FILLER */") + last_block = block + if u % 32 != 0: + print () + print (" /* %04X */" % (u//32*32), " " * (u % 32), end="") + + if u % 32 == 0: + print () + print (" /* %04X */ " % u, end="") + print ("%s," % short_value[value], end="") + print () + + offset += end - start + 1 + print () + occupancy = num * 100. / offset + print ("}; /* Table items: %d; occupancy: %d%% */" % (offset, occupancy)) + print () + + page_bits = 12; + print () + print ("static unsigned int") + print ("joining_type (hb_codepoint_t u)") + print ("{") + print (" switch (u >> %d)" % page_bits) + print (" {") + pages = set([u>>page_bits for u in [s for s,e in ranges]+[e for s,e in ranges]]) + for p in sorted(pages): + print (" case 0x%0Xu:" % p) + for (start,end) in ranges: + if p not in [start>>page_bits, end>>page_bits]: continue + offset = "joining_offset_0x%04xu" % start + print (" if (hb_in_range (u, 0x%04Xu, 0x%04Xu)) return joining_table[u - 0x%04Xu + %s];" % (start, end, start, offset)) + print (" break;") + print ("") + print (" default:") + print (" break;") + print (" }") + print (" return X;") + print ("}") + print () + for value,short in short_value.items(): + print ("#undef %s" % (short)) + print () + +def print_shaping_table(f): + + shapes = {} + ligatures = {} + names = {} + for line in f: + + fields = [x.strip () for x in line.split (';')] + if fields[5][0:1] != '<': + continue + + items = fields[5].split (' ') + shape, items = items[0][1:-1], tuple (int (x, 16) for x in items[1:]) + + if not shape in ['initial', 'medial', 'isolated', 'final']: + continue + + c = int (fields[0], 16) + if len (items) != 1: + # We only care about lam-alef ligatures + if len (items) != 2 or items[0] != 0x0644 or items[1] not in [0x0622, 0x0623, 0x0625, 0x0627]: + continue + + # Save ligature + names[c] = fields[1] + if items not in ligatures: + ligatures[items] = {} + ligatures[items][shape] = c + pass + else: + # Save shape + if items[0] not in names: + names[items[0]] = fields[1] + else: + names[items[0]] = os.path.commonprefix ([names[items[0]], fields[1]]).strip () + if items[0] not in shapes: + shapes[items[0]] = {} + shapes[items[0]][shape] = c + + print () + print ("static const uint16_t shaping_table[][4] =") + print ("{") + + keys = shapes.keys () + min_u, max_u = min (keys), max (keys) + for u in range (min_u, max_u + 1): + s = [shapes[u][shape] if u in shapes and shape in shapes[u] else 0 + for shape in ['initial', 'medial', 'final', 'isolated']] + value = ', '.join ("0x%04Xu" % c for c in s) + print (" {%s}, /* U+%04X %s */" % (value, u, names[u] if u in names else "")) + + print ("};") + print () + print ("#define SHAPING_TABLE_FIRST 0x%04Xu" % min_u) + print ("#define SHAPING_TABLE_LAST 0x%04Xu" % max_u) + print () + + ligas = {} + for pair in ligatures.keys (): + for shape in ligatures[pair]: + c = ligatures[pair][shape] + if shape == 'isolated': + liga = (shapes[pair[0]]['initial'], shapes[pair[1]]['final']) + elif shape == 'final': + liga = (shapes[pair[0]]['medial'], shapes[pair[1]]['final']) + else: + raise Exception ("Unexpected shape", shape) + if liga[0] not in ligas: + ligas[liga[0]] = [] + ligas[liga[0]].append ((liga[1], c)) + max_i = max (len (ligas[l]) for l in ligas) + print () + print ("static const struct ligature_set_t {") + print (" uint16_t first;") + print (" struct ligature_pairs_t {") + print (" uint16_t second;") + print (" uint16_t ligature;") + print (" } ligatures[%d];" % max_i) + print ("} ligature_table[] =") + print ("{") + for first in sorted (ligas.keys ()): + + print (" { 0x%04Xu, {" % (first)) + for liga in ligas[first]: + print (" { 0x%04Xu, 0x%04Xu }, /* %s */" % (liga[0], liga[1], names[liga[1]])) + print (" }},") + + print ("};") + print () + + + +print ("/* == Start of generated table == */") +print ("/*") +print (" * The following table is generated by running:") +print (" *") +print (" * ./gen-arabic-table.py ArabicShaping.txt UnicodeData.txt Blocks.txt") +print (" *") +print (" * on files with these headers:") +print (" *") +for h in headers: + for l in h: + print (" * %s" % (l.strip())) +print (" */") +print () +print ("#ifndef HB_OT_SHAPE_COMPLEX_ARABIC_TABLE_HH") +print ("#define HB_OT_SHAPE_COMPLEX_ARABIC_TABLE_HH") +print () + +read_blocks (files[2]) +print_joining_table (files[0]) +print_shaping_table (files[1]) + +print () +print ("#endif /* HB_OT_SHAPE_COMPLEX_ARABIC_TABLE_HH */") +print () +print ("/* == End of generated table == */") diff -Nru harfbuzz-2.5.3/.pc/py3.diff/src/gen-def.py harfbuzz-2.6.2/.pc/py3.diff/src/gen-def.py --- harfbuzz-2.5.3/.pc/py3.diff/src/gen-def.py 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/.pc/py3.diff/src/gen-def.py 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,24 @@ +#!/usr/bin/env python + +from __future__ import print_function, division, absolute_import + +import io, os, re, sys + +if len (sys.argv) < 3: + sys.exit("usage: gen-def.py harfbuzz.def hb.h [hb-blob.h hb-buffer.h ...]") + +output_file = sys.argv[1] +header_paths = sys.argv[2:] + +headers_content = [] +for h in header_paths: + if h.endswith (".h"): + with io.open (h, encoding='utf-8') as f: headers_content.append (f.read ()) + +symbols = "\n".join (sorted (re.findall (r"^hb_\w+(?= \()", "\n".join (headers_content), re.M))) + +result = symbols if os.environ.get('PLAIN_LIST', '') else """EXPORTS +%s +LIBRARY lib%s-0.dll""" % (symbols, output_file.replace ('.def', '')) + +with open (output_file, "w") as f: f.write (result) diff -Nru harfbuzz-2.5.3/.pc/py3.diff/src/gen-emoji-table.py harfbuzz-2.6.2/.pc/py3.diff/src/gen-emoji-table.py --- harfbuzz-2.5.3/.pc/py3.diff/src/gen-emoji-table.py 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/.pc/py3.diff/src/gen-emoji-table.py 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,73 @@ +#!/usr/bin/python + +from __future__ import print_function, division, absolute_import +import sys +import os.path +from collections import OrderedDict +import packTab + +if len (sys.argv) != 2: + print("usage: ./gen-emoji-table.py emoji-data.txt", file=sys.stderr) + sys.exit (1) + +f = open(sys.argv[1]) +header = [f.readline () for _ in range(10)] + +ranges = OrderedDict() +for line in f.readlines(): + line = line.strip() + if not line or line[0] == '#': + continue + rang, typ = [s.strip() for s in line.split('#')[0].split(';')[:2]] + + rang = [int(s, 16) for s in rang.split('..')] + if len(rang) > 1: + start, end = rang + else: + start = end = rang[0] + + if typ not in ranges: + ranges[typ] = [] + if ranges[typ] and ranges[typ][-1][1] == start - 1: + ranges[typ][-1] = (ranges[typ][-1][0], end) + else: + ranges[typ].append((start, end)) + + + +print ("/* == Start of generated table == */") +print ("/*") +print (" * The following tables are generated by running:") +print (" *") +print (" * ./gen-emoji-table.py emoji-data.txt") +print (" *") +print (" * on file with this header:") +print (" *") +for l in header: + print (" * %s" % (l.strip())) +print (" */") +print () +print ("#ifndef HB_UNICODE_EMOJI_TABLE_HH") +print ("#define HB_UNICODE_EMOJI_TABLE_HH") +print () +print ('#include "hb-unicode.hh"') +print () + +for typ, s in ranges.items(): + if typ != "Extended_Pictographic": continue + + arr = dict() + for start,end in s: + for i in range(start,end): + arr[i] = 1 + + sol = packTab.pack_table(arr, 0, compression=3) + code = packTab.Code('_hb_emoji') + sol.genCode(code, 'is_'+typ) + code.print_c(linkage='static inline') + print() + +print () +print ("#endif /* HB_UNICODE_EMOJI_TABLE_HH */") +print () +print ("/* == End of generated table == */") diff -Nru harfbuzz-2.5.3/.pc/py3.diff/src/gen-indic-table.py harfbuzz-2.6.2/.pc/py3.diff/src/gen-indic-table.py --- harfbuzz-2.5.3/.pc/py3.diff/src/gen-indic-table.py 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/.pc/py3.diff/src/gen-indic-table.py 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,271 @@ +#!/usr/bin/env python + +from __future__ import print_function, division, absolute_import + +import io, sys + +if len (sys.argv) != 4: + print ("usage: ./gen-indic-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt Blocks.txt", file=sys.stderr) + sys.exit (1) + +ALLOWED_SINGLES = [0x00A0, 0x25CC] +ALLOWED_BLOCKS = [ + 'Basic Latin', + 'Latin-1 Supplement', + 'Devanagari', + 'Bengali', + 'Gurmukhi', + 'Gujarati', + 'Oriya', + 'Tamil', + 'Telugu', + 'Kannada', + 'Malayalam', + 'Sinhala', + 'Myanmar', + 'Khmer', + 'Vedic Extensions', + 'General Punctuation', + 'Superscripts and Subscripts', + 'Devanagari Extended', + 'Myanmar Extended-B', + 'Myanmar Extended-A', +] + +files = [io.open (x, encoding='utf-8') for x in sys.argv[1:]] + +headers = [[f.readline () for i in range (2)] for f in files] + +data = [{} for f in files] +values = [{} for f in files] +for i, f in enumerate (files): + for line in f: + + j = line.find ('#') + if j >= 0: + line = line[:j] + + fields = [x.strip () for x in line.split (';')] + if len (fields) == 1: + continue + + uu = fields[0].split ('..') + start = int (uu[0], 16) + if len (uu) == 1: + end = start + else: + end = int (uu[1], 16) + + t = fields[1] + + for u in range (start, end + 1): + data[i][u] = t + values[i][t] = values[i].get (t, 0) + end - start + 1 + +# Merge data into one dict: +defaults = ('Other', 'Not_Applicable', 'No_Block') +for i,v in enumerate (defaults): + values[i][v] = values[i].get (v, 0) + 1 +combined = {} +for i,d in enumerate (data): + for u,v in d.items (): + if i == 2 and not u in combined: + continue + if not u in combined: + combined[u] = list (defaults) + combined[u][i] = v +combined = {k:v for k,v in combined.items() if k in ALLOWED_SINGLES or v[2] in ALLOWED_BLOCKS} +data = combined +del combined +num = len (data) + +# Move the outliers NO-BREAK SPACE and DOTTED CIRCLE out +singles = {} +for u in ALLOWED_SINGLES: + singles[u] = data[u] + del data[u] + +print ("/* == Start of generated table == */") +print ("/*") +print (" * The following table is generated by running:") +print (" *") +print (" * ./gen-indic-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt Blocks.txt") +print (" *") +print (" * on files with these headers:") +print (" *") +for h in headers: + for l in h: + print (" * %s" % (l.strip())) +print (" */") +print () +print ('#include "hb.hh"') +print () +print ('#ifndef HB_NO_OT_SHAPE') +print () +print ('#include "hb-ot-shape-complex-indic.hh"') +print () + +# Shorten values +short = [{ + "Bindu": 'Bi', + "Cantillation_Mark": 'Ca', + "Joiner": 'ZWJ', + "Non_Joiner": 'ZWNJ', + "Number": 'Nd', + "Visarga": 'Vs', + "Vowel": 'Vo', + "Vowel_Dependent": 'M', + "Consonant_Prefixed": 'CPrf', + "Other": 'x', +},{ + "Not_Applicable": 'x', +}] +all_shorts = [{},{}] + +# Add some of the values, to make them more readable, and to avoid duplicates + + +for i in range (2): + for v,s in short[i].items (): + all_shorts[i][s] = v + +what = ["INDIC_SYLLABIC_CATEGORY", "INDIC_MATRA_CATEGORY"] +what_short = ["ISC", "IMC"] +print ('#pragma GCC diagnostic push') +print ('#pragma GCC diagnostic ignored "-Wunused-macros"') +cat_defs = [] +for i in range (2): + vv = sorted (values[i].keys ()) + for v in vv: + v_no_and = v.replace ('_And_', '_') + if v in short[i]: + s = short[i][v] + else: + s = ''.join ([c for c in v_no_and if ord ('A') <= ord (c) <= ord ('Z')]) + if s in all_shorts[i]: + raise Exception ("Duplicate short value alias", v, all_shorts[i][s]) + all_shorts[i][s] = v + short[i][v] = s + cat_defs.append ((what_short[i] + '_' + s, what[i] + '_' + v.upper (), str (values[i][v]), v)) + +maxlen_s = max ([len (c[0]) for c in cat_defs]) +maxlen_l = max ([len (c[1]) for c in cat_defs]) +maxlen_n = max ([len (c[2]) for c in cat_defs]) +for s in what_short: + print () + for c in [c for c in cat_defs if s in c[0]]: + print ("#define %s %s /* %s chars; %s */" % + (c[0].ljust (maxlen_s), c[1].ljust (maxlen_l), c[2].rjust (maxlen_n), c[3])) +print () +print ('#pragma GCC diagnostic pop') +print () +print ("#define _(S,M) INDIC_COMBINE_CATEGORIES (ISC_##S, IMC_##M)") +print () +print () + +total = 0 +used = 0 +last_block = None +def print_block (block, start, end, data): + global total, used, last_block + if block and block != last_block: + print () + print () + print (" /* %s */" % block) + num = 0 + assert start % 8 == 0 + assert (end+1) % 8 == 0 + for u in range (start, end+1): + if u % 8 == 0: + print () + print (" /* %04X */" % u, end="") + if u in data: + num += 1 + d = data.get (u, defaults) + print ("%9s" % ("_(%s,%s)," % (short[0][d[0]], short[1][d[1]])), end="") + + total += end - start + 1 + used += num + if block: + last_block = block + +uu = sorted (data.keys ()) + +last = -100000 +num = 0 +offset = 0 +starts = [] +ends = [] +print ("static const INDIC_TABLE_ELEMENT_TYPE indic_table[] = {") +for u in uu: + if u <= last: + continue + block = data[u][2] + + start = u//8*8 + end = start+1 + while end in uu and block == data[end][2]: + end += 1 + end = (end-1)//8*8 + 7 + + if start != last + 1: + if start - last <= 1+16*3: + print_block (None, last+1, start-1, data) + last = start-1 + else: + if last >= 0: + ends.append (last + 1) + offset += ends[-1] - starts[-1] + print () + print () + print ("#define indic_offset_0x%04xu %d" % (start, offset)) + starts.append (start) + + print_block (block, start, end, data) + last = end +ends.append (last + 1) +offset += ends[-1] - starts[-1] +print () +print () +occupancy = used * 100. / total +page_bits = 12 +print ("}; /* Table items: %d; occupancy: %d%% */" % (offset, occupancy)) +print () +print ("INDIC_TABLE_ELEMENT_TYPE") +print ("hb_indic_get_categories (hb_codepoint_t u)") +print ("{") +print (" switch (u >> %d)" % page_bits) +print (" {") +pages = set ([u>>page_bits for u in starts+ends+list (singles.keys ())]) +for p in sorted(pages): + print (" case 0x%0Xu:" % p) + for u,d in singles.items (): + if p != u>>page_bits: continue + print (" if (unlikely (u == 0x%04Xu)) return _(%s,%s);" % (u, short[0][d[0]], short[1][d[1]])) + for (start,end) in zip (starts, ends): + if p not in [start>>page_bits, end>>page_bits]: continue + offset = "indic_offset_0x%04xu" % start + print (" if (hb_in_range (u, 0x%04Xu, 0x%04Xu)) return indic_table[u - 0x%04Xu + %s];" % (start, end-1, start, offset)) + print (" break;") + print ("") +print (" default:") +print (" break;") +print (" }") +print (" return _(x,x);") +print ("}") +print () +print ("#undef _") +for i in range (2): + print () + vv = sorted (values[i].keys ()) + for v in vv: + print ("#undef %s_%s" % + (what_short[i], short[i][v])) +print () +print ('#endif') +print () +print ("/* == End of generated table == */") + +# Maintain at least 30% occupancy in the table */ +if occupancy < 30: + raise Exception ("Table too sparse, please investigate: ", occupancy) diff -Nru harfbuzz-2.5.3/.pc/py3.diff/src/gen-os2-unicode-ranges.py harfbuzz-2.6.2/.pc/py3.diff/src/gen-os2-unicode-ranges.py --- harfbuzz-2.5.3/.pc/py3.diff/src/gen-os2-unicode-ranges.py 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/.pc/py3.diff/src/gen-os2-unicode-ranges.py 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,59 @@ +#!/usr/bin/python + +# -*- coding: utf-8 -*- + +# Generates the code for a sorted unicode range array as used in hb-ot-os2-unicode-ranges.hh +# Input is a tab seperated list of unicode ranges from the otspec +# (https://docs.microsoft.com/en-us/typography/opentype/spec/os2#ur). + +from __future__ import print_function, division, absolute_import + +import io +import re +import sys + +try: + reload(sys) + sys.setdefaultencoding('utf-8') +except NameError: + pass # Python 3 + +print ("""static OS2Range _hb_os2_unicode_ranges[] = +{""") + +args = sys.argv[1:] +input_file = args[0] + +with io.open(input_file, mode="r", encoding="utf-8") as f: + + all_ranges = []; + current_bit = 0 + while True: + line = f.readline().strip() + if not line: + break + fields = re.split(r'\t+', line) + if len(fields) == 3: + current_bit = fields[0] + fields = fields[1:] + elif len(fields) > 3: + raise Exception("bad input :(.") + + name = fields[0] + ranges = re.split("-", fields[1]) + if len(ranges) != 2: + raise Exception("bad input :(.") + + v = tuple((int(ranges[0], 16), int(ranges[1], 16), int(current_bit), name)) + all_ranges.append(v) + +all_ranges = sorted(all_ranges, key=lambda t: t[0]) + +for ranges in all_ranges: + start = ("0x%X" % ranges[0]).rjust(8) + end = ("0x%X" % ranges[1]).rjust(8) + bit = ("%s" % ranges[2]).rjust(3) + + print (" {%s, %s, %s}, // %s" % (start, end, bit, ranges[3])) + +print ("""};""") diff -Nru harfbuzz-2.5.3/.pc/py3.diff/src/gen-tag-table.py harfbuzz-2.6.2/.pc/py3.diff/src/gen-tag-table.py --- harfbuzz-2.5.3/.pc/py3.diff/src/gen-tag-table.py 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/.pc/py3.diff/src/gen-tag-table.py 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,1124 @@ +#!/usr/bin/python + +"""Generator of the mapping from OpenType tags to BCP 47 tags and vice +versa. + +It creates a ``const LangTag[]``, matching the tags from the OpenType +languages system tag list to the language subtags of the BCP 47 language +subtag registry, with some manual adjustments. The mappings are +supplemented with macrolanguages' sublanguages and retired codes' +replacements, according to BCP 47 and some manual additions where BCP 47 +omits a retired code entirely. + +Also generated is a function, ``hb_ot_ambiguous_tag_to_language``, +intended for use by ``hb_ot_tag_to_language``. It maps OpenType tags +back to BCP 47 tags. Ambiguous OpenType tags (those that correspond to +multiple BCP 47 tags) are listed here, except when the alphabetically +first BCP 47 tag happens to be the chosen disambiguated tag. In that +case, the fallback behavior will choose the right tag anyway. +""" + +from __future__ import absolute_import, division, print_function, unicode_literals + +import collections +try: + from HTMLParser import HTMLParser + def write (s): + print (s.encode ('utf-8'), end='') +except ImportError: + from html.parser import HTMLParser + def write (s): + sys.stdout.flush () + sys.stdout.buffer.write (s.encode ('utf-8')) +import io +import itertools +import re +import sys +import unicodedata + +if len (sys.argv) != 3: + print ('usage: ./gen-tag-table.py languagetags language-subtag-registry', file=sys.stderr) + sys.exit (1) + +try: + from html import unescape + def html_unescape (parser, entity): + return unescape (entity) +except ImportError: + def html_unescape (parser, entity): + return parser.unescape (entity) + +def expect (condition, message=None): + if not condition: + if message is None: + raise AssertionError + raise AssertionError (message) + +# from http://www-01.sil.org/iso639-3/iso-639-3.tab +ISO_639_3_TO_1 = { + 'aar': 'aa', + 'abk': 'ab', + 'afr': 'af', + 'aka': 'ak', + 'amh': 'am', + 'ara': 'ar', + 'arg': 'an', + 'asm': 'as', + 'ava': 'av', + 'ave': 'ae', + 'aym': 'ay', + 'aze': 'az', + 'bak': 'ba', + 'bam': 'bm', + 'bel': 'be', + 'ben': 'bn', + 'bis': 'bi', + 'bod': 'bo', + 'bos': 'bs', + 'bre': 'br', + 'bul': 'bg', + 'cat': 'ca', + 'ces': 'cs', + 'cha': 'ch', + 'che': 'ce', + 'chu': 'cu', + 'chv': 'cv', + 'cor': 'kw', + 'cos': 'co', + 'cre': 'cr', + 'cym': 'cy', + 'dan': 'da', + 'deu': 'de', + 'div': 'dv', + 'dzo': 'dz', + 'ell': 'el', + 'eng': 'en', + 'epo': 'eo', + 'est': 'et', + 'eus': 'eu', + 'ewe': 'ee', + 'fao': 'fo', + 'fas': 'fa', + 'fij': 'fj', + 'fin': 'fi', + 'fra': 'fr', + 'fry': 'fy', + 'ful': 'ff', + 'gla': 'gd', + 'gle': 'ga', + 'glg': 'gl', + 'glv': 'gv', + 'grn': 'gn', + 'guj': 'gu', + 'hat': 'ht', + 'hau': 'ha', + 'hbs': 'sh', + 'heb': 'he', + 'her': 'hz', + 'hin': 'hi', + 'hmo': 'ho', + 'hrv': 'hr', + 'hun': 'hu', + 'hye': 'hy', + 'ibo': 'ig', + 'ido': 'io', + 'iii': 'ii', + 'iku': 'iu', + 'ile': 'ie', + 'ina': 'ia', + 'ind': 'id', + 'ipk': 'ik', + 'isl': 'is', + 'ita': 'it', + 'jav': 'jv', + 'jpn': 'ja', + 'kal': 'kl', + 'kan': 'kn', + 'kas': 'ks', + 'kat': 'ka', + 'kau': 'kr', + 'kaz': 'kk', + 'khm': 'km', + 'kik': 'ki', + 'kin': 'rw', + 'kir': 'ky', + 'kom': 'kv', + 'kon': 'kg', + 'kor': 'ko', + 'kua': 'kj', + 'kur': 'ku', + 'lao': 'lo', + 'lat': 'la', + 'lav': 'lv', + 'lim': 'li', + 'lin': 'ln', + 'lit': 'lt', + 'ltz': 'lb', + 'lub': 'lu', + 'lug': 'lg', + 'mah': 'mh', + 'mal': 'ml', + 'mar': 'mr', + 'mkd': 'mk', + 'mlg': 'mg', + 'mlt': 'mt', + 'mol': 'mo', + 'mon': 'mn', + 'mri': 'mi', + 'msa': 'ms', + 'mya': 'my', + 'nau': 'na', + 'nav': 'nv', + 'nbl': 'nr', + 'nde': 'nd', + 'ndo': 'ng', + 'nep': 'ne', + 'nld': 'nl', + 'nno': 'nn', + 'nob': 'nb', + 'nor': 'no', + 'nya': 'ny', + 'oci': 'oc', + 'oji': 'oj', + 'ori': 'or', + 'orm': 'om', + 'oss': 'os', + 'pan': 'pa', + 'pli': 'pi', + 'pol': 'pl', + 'por': 'pt', + 'pus': 'ps', + 'que': 'qu', + 'roh': 'rm', + 'ron': 'ro', + 'run': 'rn', + 'rus': 'ru', + 'sag': 'sg', + 'san': 'sa', + 'sin': 'si', + 'slk': 'sk', + 'slv': 'sl', + 'sme': 'se', + 'smo': 'sm', + 'sna': 'sn', + 'snd': 'sd', + 'som': 'so', + 'sot': 'st', + 'spa': 'es', + 'sqi': 'sq', + 'srd': 'sc', + 'srp': 'sr', + 'ssw': 'ss', + 'sun': 'su', + 'swa': 'sw', + 'swe': 'sv', + 'tah': 'ty', + 'tam': 'ta', + 'tat': 'tt', + 'tel': 'te', + 'tgk': 'tg', + 'tgl': 'tl', + 'tha': 'th', + 'tir': 'ti', + 'ton': 'to', + 'tsn': 'tn', + 'tso': 'ts', + 'tuk': 'tk', + 'tur': 'tr', + 'twi': 'tw', + 'uig': 'ug', + 'ukr': 'uk', + 'urd': 'ur', + 'uzb': 'uz', + 'ven': 've', + 'vie': 'vi', + 'vol': 'vo', + 'wln': 'wa', + 'wol': 'wo', + 'xho': 'xh', + 'yid': 'yi', + 'yor': 'yo', + 'zha': 'za', + 'zho': 'zh', + 'zul': 'zu', +} + +class LanguageTag (object): + """A BCP 47 language tag. + + Attributes: + subtags (List[str]): The list of subtags in this tag. + grandfathered (bool): Whether this tag is grandfathered. If + ``true``, the entire lowercased tag is the ``language`` + and the other subtag fields are empty. + language (str): The language subtag. + script (str): The script subtag. + region (str): The region subtag. + variant (str): The variant subtag. + + Args: + tag (str): A BCP 47 language tag. + + """ + def __init__ (self, tag): + global bcp_47 + self.subtags = tag.lower ().split ('-') + self.grandfathered = tag.lower () in bcp_47.grandfathered + if self.grandfathered: + self.language = tag.lower () + self.script = '' + self.region = '' + self.variant = '' + else: + self.language = self.subtags[0] + self.script = self._find_first (lambda s: len (s) == 4 and s[0] > '9', self.subtags) + self.region = self._find_first (lambda s: len (s) == 2 and s[0] > '9' or len (s) == 3 and s[0] <= '9', self.subtags[1:]) + self.variant = self._find_first (lambda s: len (s) > 4 or len (s) == 4 and s[0] <= '9', self.subtags) + + def __str__(self): + return '-'.join(self.subtags) + + def __repr__ (self): + return 'LanguageTag(%r)' % str(self) + + @staticmethod + def _find_first (function, sequence): + try: + return next (iter (filter (function, sequence))) + except StopIteration: + return None + + def is_complex (self): + """Return whether this tag is too complex to represent as a + ``LangTag`` in the generated code. + + Complex tags need to be handled in + ``hb_ot_tags_from_complex_language``. + + Returns: + Whether this tag is complex. + """ + return not (len (self.subtags) == 1 + or self.grandfathered + and len (self.subtags[1]) != 3 + and ot.from_bcp_47[self.subtags[0]] == ot.from_bcp_47[self.language]) + + def get_group (self): + """Return the group into which this tag should be categorized in + ``hb_ot_tags_from_complex_language``. + + The group is the first letter of the tag, or ``'und'`` if this tag + should not be matched in a ``switch`` statement in the generated + code. + + Returns: + This tag's group. + """ + return ('und' + if (self.language == 'und' + or self.variant in bcp_47.prefixes and len (bcp_47.prefixes[self.variant]) == 1) + else self.language[0]) + +class OpenTypeRegistryParser (HTMLParser): + """A parser for the OpenType language system tag registry. + + Attributes: + header (str): The "last updated" line of the registry. + names (Mapping[str, str]): A map of language system tags to the + names they are given in the registry. + ranks (DefaultDict[str, int]): A map of language system tags to + numbers. If a single BCP 47 tag corresponds to multiple + OpenType tags, the tags are ordered in increasing order by + rank. The rank is based on the number of BCP 47 tags + associated with a tag, though it may be manually modified. + to_bcp_47 (DefaultDict[str, AbstractSet[str]]): A map of + OpenType language system tags to sets of BCP 47 tags. + from_bcp_47 (DefaultDict[str, AbstractSet[str]]): ``to_bcp_47`` + inverted. Its values start as unsorted sets; + ``sort_languages`` converts them to sorted lists. + + """ + def __init__ (self): + HTMLParser.__init__ (self) + self.header = '' + self.names = {} + self.ranks = collections.defaultdict (int) + self.to_bcp_47 = collections.defaultdict (set) + self.from_bcp_47 = collections.defaultdict (set) + # Whether the parser is in a element + self._td = False + # The text of the elements of the current element. + self._current_tr = [] + + def handle_starttag (self, tag, attrs): + if tag == 'meta': + for attr, value in attrs: + if attr == 'name' and value == 'updated_at': + self.header = self.get_starttag_text () + break + elif tag == 'td': + self._td = True + self._current_tr.append ('') + elif tag == 'tr': + self._current_tr = [] + + def handle_endtag (self, tag): + if tag == 'td': + self._td = False + elif tag == 'tr' and self._current_tr: + expect (2 <= len (self._current_tr) <= 3) + name = self._current_tr[0].strip () + tag = self._current_tr[1].strip ("\t\n\v\f\r '") + rank = 0 + if len (tag) > 4: + expect (tag.endswith (' (deprecated)'), 'ill-formed OpenType tag: %s' % tag) + name += ' (deprecated)' + tag = tag.split (' ')[0] + rank = 1 + self.names[tag] = re.sub (' languages$', '', name) + if not self._current_tr[2]: + return + iso_codes = self._current_tr[2].strip () + self.to_bcp_47[tag].update (ISO_639_3_TO_1.get (code, code) for code in iso_codes.replace (' ', '').split (',')) + rank += 2 * len (self.to_bcp_47[tag]) + self.ranks[tag] = rank + + def handle_data (self, data): + if self._td: + self._current_tr[-1] += data + + def handle_charref (self, name): + self.handle_data (html_unescape (self, '&#%s;' % name)) + + def handle_entityref (self, name): + self.handle_data (html_unescape (self, '&%s;' % name)) + + def parse (self, filename): + """Parse the OpenType language system tag registry. + + Args: + filename (str): The file name of the registry. + """ + with io.open (filename, encoding='utf-8') as f: + self.feed (f.read ()) + expect (self.header) + for tag, iso_codes in self.to_bcp_47.items (): + for iso_code in iso_codes: + self.from_bcp_47[iso_code].add (tag) + + def add_language (self, bcp_47_tag, ot_tag): + """Add a language as if it were in the registry. + + Args: + bcp_47_tag (str): A BCP 47 tag. If the tag is more than just + a language subtag, and if the language subtag is a + macrolanguage, then new languages are added corresponding + to the macrolanguages' individual languages with the + remainder of the tag appended. + ot_tag (str): An OpenType language system tag. + """ + global bcp_47 + self.to_bcp_47[ot_tag].add (bcp_47_tag) + self.from_bcp_47[bcp_47_tag].add (ot_tag) + if bcp_47_tag.lower () not in bcp_47.grandfathered: + try: + [macrolanguage, suffix] = bcp_47_tag.split ('-', 1) + if macrolanguage in bcp_47.macrolanguages: + s = set () + for language in bcp_47.macrolanguages[macrolanguage]: + if language.lower () not in bcp_47.grandfathered: + s.add ('%s-%s' % (language, suffix)) + bcp_47.macrolanguages['%s-%s' % (macrolanguage, suffix)] = s + except ValueError: + pass + + @staticmethod + def _remove_language (tag_1, dict_1, dict_2): + for tag_2 in dict_1.pop (tag_1): + dict_2[tag_2].remove (tag_1) + if not dict_2[tag_2]: + del dict_2[tag_2] + + def remove_language_ot (self, ot_tag): + """Remove an OpenType tag from the registry. + + Args: + ot_tag (str): An OpenType tag. + """ + self._remove_language (ot_tag, self.to_bcp_47, self.from_bcp_47) + + def remove_language_bcp_47 (self, bcp_47_tag): + """Remove a BCP 47 tag from the registry. + + Args: + bcp_47_tag (str): A BCP 47 tag. + """ + self._remove_language (bcp_47_tag, self.from_bcp_47, self.to_bcp_47) + + def inherit_from_macrolanguages (self): + """Copy mappings from macrolanguages to individual languages. + + If a BCP 47 tag for an individual mapping has no OpenType + mapping but its macrolanguage does, the mapping is copied to + the individual language. For example, als (Tosk Albanian) has no + explicit mapping, so it inherits from sq (Albanian) the mapping + to SQI. + + If a BCP 47 tag for a macrolanguage has no OpenType mapping but + all of its individual languages do and they all map to the same + tags, the mapping is copied to the macrolanguage. + """ + global bcp_47 + original_ot_from_bcp_47 = dict (self.from_bcp_47) + for macrolanguage, languages in dict (bcp_47.macrolanguages).items (): + ot_macrolanguages = set (original_ot_from_bcp_47.get (macrolanguage, set ())) + if ot_macrolanguages: + for ot_macrolanguage in ot_macrolanguages: + for language in languages: + # Remove the following condition if e.g. nn should map to NYN,NOR + # instead of just NYN. + if language not in original_ot_from_bcp_47: + self.add_language (language, ot_macrolanguage) + self.ranks[ot_macrolanguage] += 1 + else: + for language in languages: + if language in original_ot_from_bcp_47: + if ot_macrolanguages: + ml = original_ot_from_bcp_47[language] + if ml: + ot_macrolanguages &= ml + else: + pass + else: + ot_macrolanguages |= original_ot_from_bcp_47[language] + else: + ot_macrolanguages.clear () + if not ot_macrolanguages: + break + for ot_macrolanguage in ot_macrolanguages: + self.add_language (macrolanguage, ot_macrolanguage) + + def sort_languages (self): + """Sort the values of ``from_bcp_47`` in ascending rank order.""" + for language, tags in self.from_bcp_47.items (): + self.from_bcp_47[language] = sorted (tags, + key=lambda t: (self.ranks[t] + rank_delta (language, t), t)) + +ot = OpenTypeRegistryParser () + +class BCP47Parser (object): + """A parser for the BCP 47 subtag registry. + + Attributes: + header (str): The "File-Date" line of the registry. + names (Mapping[str, str]): A map of subtags to the names they + are given in the registry. Each value is a + ``'\\n'``-separated list of names. + scopes (Mapping[str, str]): A map of language subtags to strings + suffixed to language names, including suffixes to explain + language scopes. + macrolanguages (DefaultDict[str, AbstractSet[str]]): A map of + language subtags to the sets of language subtags which + inherit from them. See + ``OpenTypeRegistryParser.inherit_from_macrolanguages``. + prefixes (DefaultDict[str, AbstractSet[str]]): A map of variant + subtags to their prefixes. + grandfathered (AbstractSet[str]): The set of grandfathered tags, + normalized to lowercase. + + """ + def __init__ (self): + self.header = '' + self.names = {} + self.scopes = {} + self.macrolanguages = collections.defaultdict (set) + self.prefixes = collections.defaultdict (set) + self.grandfathered = set () + + def parse (self, filename): + """Parse the BCP 47 subtag registry. + + Args: + filename (str): The file name of the registry. + """ + with io.open (filename, encoding='utf-8') as f: + subtag_type = None + subtag = None + deprecated = False + has_preferred_value = False + line_buffer = '' + for line in itertools.chain (f, ['']): + line = line.rstrip () + if line.startswith (' '): + line_buffer += line[1:] + continue + line, line_buffer = line_buffer, line + if line.startswith ('Type: '): + subtag_type = line.split (' ')[1] + deprecated = False + has_preferred_value = False + elif line.startswith ('Subtag: ') or line.startswith ('Tag: '): + subtag = line.split (' ')[1] + if subtag_type == 'grandfathered': + self.grandfathered.add (subtag.lower ()) + elif line.startswith ('Description: '): + description = line.split (' ', 1)[1].replace (' (individual language)', '') + description = re.sub (' (\((individual |macro)language\)|languages)$', '', + description) + if subtag in self.names: + self.names[subtag] += '\n' + description + else: + self.names[subtag] = description + elif subtag_type == 'language' or subtag_type == 'grandfathered': + if line.startswith ('Scope: '): + scope = line.split (' ')[1] + if scope == 'macrolanguage': + scope = ' [macrolanguage]' + elif scope == 'collection': + scope = ' [family]' + else: + continue + self.scopes[subtag] = scope + elif line.startswith ('Deprecated: '): + self.scopes[subtag] = ' (retired code)' + self.scopes.get (subtag, '') + deprecated = True + elif deprecated and line.startswith ('Comments: see '): + # If a subtag is split into multiple replacement subtags, + # it essentially represents a macrolanguage. + for language in line.replace (',', '').split (' ')[2:]: + self._add_macrolanguage (subtag, language) + elif line.startswith ('Preferred-Value: '): + # If a subtag is deprecated in favor of a single replacement subtag, + # it is either a dialect or synonym of the preferred subtag. Either + # way, it is close enough to the truth to consider the replacement + # the macrolanguage of the deprecated language. + has_preferred_value = True + macrolanguage = line.split (' ')[1] + self._add_macrolanguage (macrolanguage, subtag) + elif not has_preferred_value and line.startswith ('Macrolanguage: '): + self._add_macrolanguage (line.split (' ')[1], subtag) + elif subtag_type == 'variant': + if line.startswith ('Prefix: '): + self.prefixes[subtag].add (line.split (' ')[1]) + elif line.startswith ('File-Date: '): + self.header = line + expect (self.header) + + def _add_macrolanguage (self, macrolanguage, language): + global ot + if language not in ot.from_bcp_47: + for l in self.macrolanguages.get (language, set ()): + self._add_macrolanguage (macrolanguage, l) + if macrolanguage not in ot.from_bcp_47: + for ls in list (self.macrolanguages.values ()): + if macrolanguage in ls: + ls.add (language) + return + self.macrolanguages[macrolanguage].add (language) + + def remove_extra_macrolanguages (self): + """Make every language have at most one macrolanguage.""" + inverted = collections.defaultdict (list) + for macrolanguage, languages in self.macrolanguages.items (): + for language in languages: + inverted[language].append (macrolanguage) + for language, macrolanguages in inverted.items (): + if len (macrolanguages) > 1: + macrolanguages.sort (key=lambda ml: len (self.macrolanguages[ml])) + biggest_macrolanguage = macrolanguages.pop () + for macrolanguage in macrolanguages: + self._add_macrolanguage (biggest_macrolanguage, macrolanguage) + + def get_name (self, lt): + """Return the names of the subtags in a language tag. + + Args: + lt (LanguageTag): A BCP 47 language tag. + + Returns: + The name form of ``lt``. + """ + name = self.names[lt.language].split ('\n')[0] + if lt.script: + name += '; ' + self.names[lt.script.title ()].split ('\n')[0] + if lt.region: + name += '; ' + self.names[lt.region.upper ()].split ('\n')[0] + if lt.variant: + name += '; ' + self.names[lt.variant].split ('\n')[0] + return name + +bcp_47 = BCP47Parser () + +ot.parse (sys.argv[1]) +bcp_47.parse (sys.argv[2]) + +ot.add_language ('ary', 'MOR') + +ot.add_language ('ath', 'ATH') + +ot.add_language ('bai', 'BML') + +ot.ranks['BAL'] = ot.ranks['KAR'] + 1 + +ot.add_language ('ber', 'BBR') + +ot.remove_language_ot ('PGR') +ot.add_language ('el-polyton', 'PGR') + +bcp_47.macrolanguages['et'] = {'ekk'} + +bcp_47.names['flm'] = 'Falam Chin' +bcp_47.scopes['flm'] = ' (retired code)' +bcp_47.macrolanguages['flm'] = {'cfm'} + +ot.ranks['FNE'] = ot.ranks['TNE'] + 1 + +ot.add_language ('und-fonipa', 'IPPH') + +ot.add_language ('und-fonnapa', 'APPH') + +ot.remove_language_ot ('IRT') +ot.add_language ('ga-Latg', 'IRT') + +ot.remove_language_ot ('KGE') +ot.add_language ('und-Geok', 'KGE') + +ot.add_language ('guk', 'GUK') +ot.names['GUK'] = 'Gumuz (SIL fonts)' +ot.ranks['GUK'] = ot.ranks['GMZ'] + 1 + +bcp_47.macrolanguages['id'] = {'in'} + +bcp_47.macrolanguages['ijo'] = {'ijc'} + +ot.add_language ('kht', 'KHN') +ot.names['KHN'] = ot.names['KHT'] + ' (Microsoft fonts)' +ot.names['KHT'] = ot.names['KHT'] + ' (OpenType spec and SIL fonts)' +ot.ranks['KHN'] = ot.ranks['KHT'] +ot.ranks['KHT'] += 1 + +ot.ranks['LCR'] = ot.ranks['MCR'] + 1 + +ot.names['MAL'] = 'Malayalam Traditional' +ot.ranks['MLR'] += 1 + +bcp_47.names['mhv'] = 'Arakanese' +bcp_47.scopes['mhv'] = ' (retired code)' + +ot.add_language ('no', 'NOR') + +ot.add_language ('oc-provenc', 'PRO') + +ot.add_language ('qu', 'QUZ') +ot.add_language ('qub', 'QWH') +ot.add_language ('qud', 'QVI') +ot.add_language ('qug', 'QVI') +ot.add_language ('qup', 'QVI') +ot.add_language ('qur', 'QWH') +ot.add_language ('qus', 'QUH') +ot.add_language ('quw', 'QVI') +ot.add_language ('qux', 'QWH') +ot.add_language ('qva', 'QWH') +ot.add_language ('qvh', 'QWH') +ot.add_language ('qvj', 'QVI') +ot.add_language ('qvl', 'QWH') +ot.add_language ('qvm', 'QWH') +ot.add_language ('qvn', 'QWH') +ot.add_language ('qvo', 'QVI') +ot.add_language ('qvp', 'QWH') +ot.add_language ('qvw', 'QWH') +ot.add_language ('qvz', 'QVI') +ot.add_language ('qwa', 'QWH') +ot.add_language ('qws', 'QWH') +ot.add_language ('qxa', 'QWH') +ot.add_language ('qxc', 'QWH') +ot.add_language ('qxh', 'QWH') +ot.add_language ('qxl', 'QVI') +ot.add_language ('qxn', 'QWH') +ot.add_language ('qxo', 'QWH') +ot.add_language ('qxr', 'QVI') +ot.add_language ('qxt', 'QWH') +ot.add_language ('qxw', 'QWH') + +bcp_47.macrolanguages['ro'].remove ('mo') +bcp_47.macrolanguages['ro-MD'].add ('mo') + +ot.add_language ('sgw', 'SGW') +ot.names['SGW'] = ot.names['CHG'] + ' (SIL fonts)' +ot.ranks['SGW'] = ot.ranks['CHG'] + 1 + +ot.remove_language_ot ('SYRE') +ot.remove_language_ot ('SYRJ') +ot.remove_language_ot ('SYRN') +ot.add_language ('und-Syre', 'SYRE') +ot.add_language ('und-Syrj', 'SYRJ') +ot.add_language ('und-Syrn', 'SYRN') + +bcp_47.names['xst'] = u"Silt'e" +bcp_47.scopes['xst'] = ' (retired code)' +bcp_47.macrolanguages['xst'] = {'stv', 'wle'} + +ot.add_language ('xwo', 'TOD') + +ot.remove_language_ot ('ZHH') +ot.remove_language_ot ('ZHP') +ot.remove_language_ot ('ZHT') +bcp_47.macrolanguages['zh'].remove ('lzh') +bcp_47.macrolanguages['zh'].remove ('yue') +ot.add_language ('zh-Hant-MO', 'ZHH') +ot.add_language ('zh-Hant-HK', 'ZHH') +ot.add_language ('zh-Hans', 'ZHS') +ot.add_language ('zh-Hant', 'ZHT') +ot.add_language ('zh-HK', 'ZHH') +ot.add_language ('zh-MO', 'ZHH') +ot.add_language ('zh-TW', 'ZHT') +ot.add_language ('lzh', 'ZHT') +ot.add_language ('lzh-Hans', 'ZHS') +ot.add_language ('yue', 'ZHH') +ot.add_language ('yue-Hans', 'ZHS') + +bcp_47.macrolanguages['zom'] = {'yos'} + +def rank_delta (bcp_47, ot): + """Return a delta to apply to a BCP 47 tag's rank. + + Most OpenType tags have a constant rank, but a few have ranks that + depend on the BCP 47 tag. + + Args: + bcp_47 (str): A BCP 47 tag. + ot (str): An OpenType tag to. + + Returns: + A number to add to ``ot``'s rank when sorting ``bcp_47``'s + OpenType equivalents. + """ + if bcp_47 == 'ak' and ot == 'AKA': + return -1 + if bcp_47 == 'tw' and ot == 'TWI': + return -1 + return 0 + +disambiguation = { + 'ALT': 'alt', + 'ARK': 'rki', + 'BHI': 'bhb', + 'BLN': 'bjt', + 'BTI': 'beb', + 'CCHN': 'cco', + 'CMR': 'swb', + 'CPP': 'crp', + 'CRR': 'crx', + 'DUJ': 'dwu', + 'ECR': 'crj', + 'HAL': 'cfm', + 'HND': 'hnd', + 'KIS': 'kqs', + 'LRC': 'bqi', + 'NDB': 'nd', + 'NIS': 'njz', + 'PLG': 'pce', + 'PRO': 'pro', + 'QIN': 'bgr', + 'QUH': 'quh', + 'QVI': 'qvi', + 'QWH': 'qwh', + 'SIG': 'stv', + 'TNE': 'yrk', + 'ZHH': 'zh-HK', + 'ZHS': 'zh-Hans', + 'ZHT': 'zh-Hant', +} + +ot.inherit_from_macrolanguages () +bcp_47.remove_extra_macrolanguages () +ot.inherit_from_macrolanguages () +ot.sort_languages () + +print ('/* == Start of generated table == */') +print ('/*') +print (' * The following table is generated by running:') +print (' *') +print (' * %s languagetags language-subtag-registry' % sys.argv[0]) +print (' *') +print (' * on files with these headers:') +print (' *') +print (' * %s' % ot.header.strip ()) +print (' * %s' % bcp_47.header) +print (' */') +print () +print ('#ifndef HB_OT_TAG_TABLE_HH') +print ('#define HB_OT_TAG_TABLE_HH') +print () +print ('static const LangTag ot_languages[] = {') + +def hb_tag (tag): + """Convert a tag to ``HB_TAG`` form. + + Args: + tag (str): An OpenType tag. + + Returns: + A snippet of C++ representing ``tag``. + """ + return u"HB_TAG('%s','%s','%s','%s')" % tuple (('%-4s' % tag)[:4]) + +def get_variant_set (name): + """Return a set of variant language names from a name. + + Args: + name (str): A list of language names from the BCP 47 registry, + joined on ``'\\n'``. + + Returns: + A set of normalized language names. + """ + return set (unicodedata.normalize ('NFD', n.replace ('\u2019', u"'")) + .encode ('ASCII', 'ignore') + .strip () + for n in re.split ('[\n(),]', name) if n) + +def language_name_intersection (a, b): + """Return the names in common between two language names. + + Args: + a (str): A list of language names from the BCP 47 registry, + joined on ``'\\n'``. + b (str): A list of language names from the BCP 47 registry, + joined on ``'\\n'``. + + Returns: + The normalized language names shared by ``a`` and ``b``. + """ + return get_variant_set (a).intersection (get_variant_set (b)) + +def get_matching_language_name (intersection, candidates): + return next (iter (c for c in candidates if not intersection.isdisjoint (get_variant_set (c)))) + +def same_tag (bcp_47_tag, ot_tags): + return len (bcp_47_tag) == 3 and len (ot_tags) == 1 and bcp_47_tag == ot_tags[0].lower () + +for language, tags in sorted (ot.from_bcp_47.items ()): + if language == '' or '-' in language: + continue + commented_out = same_tag (language, tags) + for i, tag in enumerate (tags, start=1): + print ('%s{\"%s\",\t%s},' % ('/*' if commented_out else ' ', language, hb_tag (tag)), end='') + if commented_out: + print ('*/', end='') + print ('\t/* ', end='') + bcp_47_name = bcp_47.names.get (language, '') + bcp_47_name_candidates = bcp_47_name.split ('\n') + intersection = language_name_intersection (bcp_47_name, ot.names[tag]) + scope = bcp_47.scopes.get (language, '') + if not intersection: + write ('%s%s -> %s' % (bcp_47_name_candidates[0], scope, ot.names[tag])) + else: + name = get_matching_language_name (intersection, bcp_47_name_candidates) + bcp_47.names[language] = name + write ('%s%s' % (name if len (name) > len (ot.names[tag]) else ot.names[tag], scope)) + print (' */') + +print ('};') +print () + +print ('/**') +print (' * hb_ot_tags_from_complex_language:') +print (' * @lang_str: a BCP 47 language tag to convert.') +print (' * @limit: a pointer to the end of the substring of @lang_str to consider for') +print (' * conversion.') +print (' * @count: maximum number of language tags to retrieve (IN) and actual number of') +print (' * language tags retrieved (OUT). If no tags are retrieved, it is not modified.') +print (' * @tags: array of size at least @language_count to store the language tag') +print (' * results') +print (' *') +print (' * Converts a multi-subtag BCP 47 language tag to language tags.') +print (' *') +print (' * Return value: Whether any language systems were retrieved.') +print (' **/') +print ('static bool') +print ('hb_ot_tags_from_complex_language (const char *lang_str,') +print ('\t\t\t\t const char *limit,') +print ('\t\t\t\t unsigned int *count /* IN/OUT */,') +print ('\t\t\t\t hb_tag_t *tags /* OUT */)') +print ('{') + +def print_subtag_matches (subtag, new_line): + if subtag: + if new_line: + print () + print ('\t&& ', end='') + print ('subtag_matches (lang_str, limit, "-%s")' % subtag, end='') + +complex_tags = collections.defaultdict (list) +for initial, group in itertools.groupby ((lt_tags for lt_tags in [ + (LanguageTag (language), tags) + for language, tags in sorted (ot.from_bcp_47.items (), + key=lambda i: (-len (i[0]), i[0])) + ] if lt_tags[0].is_complex ()), + key=lambda lt_tags: lt_tags[0].get_group ()): + complex_tags[initial] += group + +for initial, items in sorted (complex_tags.items ()): + if initial != 'und': + continue + for lt, tags in items: + if lt.variant in bcp_47.prefixes: + expect (next (iter (bcp_47.prefixes[lt.variant])) == lt.language, + '%s is not a valid prefix of %s' % (lt.language, lt.variant)) + print (' if (', end='') + print_subtag_matches (lt.script, False) + print_subtag_matches (lt.region, False) + print_subtag_matches (lt.variant, False) + print (')') + print (' {') + write (' /* %s */' % bcp_47.get_name (lt)) + print () + if len (tags) == 1: + write (' tags[0] = %s; /* %s */' % (hb_tag (tags[0]), ot.names[tags[0]])) + print () + print (' *count = 1;') + else: + print (' hb_tag_t possible_tags[] = {') + for tag in tags: + write (' %s, /* %s */' % (hb_tag (tag), ot.names[tag])) + print () + print (' };') + print (' for (i = 0; i < %s && i < *count; i++)' % len (tags)) + print (' tags[i] = possible_tags[i];') + print (' *count = i;') + print (' return true;') + print (' }') + +print (' switch (lang_str[0])') +print (' {') +for initial, items in sorted (complex_tags.items ()): + if initial == 'und': + continue + print (" case '%s':" % initial) + for lt, tags in items: + print (' if (', end='') + if lt.grandfathered: + print ('0 == strcmp (&lang_str[1], "%s")' % lt.language[1:], end='') + else: + string_literal = lt.language[1:] + '-' + if lt.script: + string_literal += lt.script + lt.script = None + if lt.region: + string_literal += '-' + lt.region + lt.region = None + if string_literal[-1] == '-': + print ('0 == strncmp (&lang_str[1], "%s", %i)' % (string_literal, len (string_literal)), end='') + else: + print ('lang_matches (&lang_str[1], "%s")' % string_literal, end='') + print_subtag_matches (lt.script, True) + print_subtag_matches (lt.region, True) + print_subtag_matches (lt.variant, True) + print (')') + print (' {') + write (' /* %s */' % bcp_47.get_name (lt)) + print () + if len (tags) == 1: + write (' tags[0] = %s; /* %s */' % (hb_tag (tags[0]), ot.names[tags[0]])) + print () + print (' *count = 1;') + else: + print (' unsigned int i;') + print (' hb_tag_t possible_tags[] = {') + for tag in tags: + write ('\t%s, /* %s */' % (hb_tag (tag), ot.names[tag])) + print () + print (' };') + print (' for (i = 0; i < %s && i < *count; i++)' % len (tags)) + print ('\ttags[i] = possible_tags[i];') + print (' *count = i;') + print (' return true;') + print (' }') + print (' break;') + +print (' }') +print (' return false;') +print ('}') +print () +print ('/**') +print (' * hb_ot_ambiguous_tag_to_language') +print (' * @tag: A language tag.') +print (' *') +print (' * Converts @tag to a BCP 47 language tag if it is ambiguous (it corresponds to') +print (' * many language tags) and the best tag is not the alphabetically first, or if') +print (' * the best tag consists of multiple subtags, or if the best tag does not appear') +print (' * in #ot_languages.') +print (' *') +print (' * Return value: The #hb_language_t corresponding to the BCP 47 language tag,') +print (' * or #HB_LANGUAGE_INVALID if @tag is not ambiguous.') +print (' **/') +print ('static hb_language_t') +print ('hb_ot_ambiguous_tag_to_language (hb_tag_t tag)') +print ('{') +print (' switch (tag)') +print (' {') + +def verify_disambiguation_dict (): + """Verify and normalize ``disambiguation``. + + ``disambiguation`` is a map of ambiguous OpenType language system + tags to the particular BCP 47 tags they correspond to. This function + checks that all its keys really are ambiguous and that each key's + value is valid for that key. It checks that no ambiguous tag is + missing, except when it can figure out which BCP 47 tag is the best + by itself. + + It modifies ``disambiguation`` to remove keys whose values are the + same as those that the fallback would return anyway, and to add + ambiguous keys whose disambiguations it determined automatically. + + Raises: + AssertionError: Verification failed. + """ + global bcp_47 + global disambiguation + global ot + for ot_tag, bcp_47_tags in ot.to_bcp_47.items (): + primary_tags = list (t for t in bcp_47_tags if t not in bcp_47.grandfathered and ot.from_bcp_47.get (t)[0] == ot_tag) + if len (primary_tags) == 1: + expect (ot_tag not in disambiguation, 'unnecessary disambiguation for OT tag: %s' % ot_tag) + if '-' in primary_tags[0]: + disambiguation[ot_tag] = primary_tags[0] + elif len (primary_tags) == 0: + expect (ot_tag not in disambiguation, 'There is no possible valid disambiguation for %s' % ot_tag) + else: + macrolanguages = list (t for t in primary_tags if bcp_47.scopes.get (t) == ' [macrolanguage]') + if len (macrolanguages) != 1: + macrolanguages = list (t for t in primary_tags if bcp_47.scopes.get (t) == ' [family]') + if len (macrolanguages) != 1: + macrolanguages = list (t for t in primary_tags if 'retired code' not in bcp_47.scopes.get (t, '')) + if len (macrolanguages) != 1: + expect (ot_tag in disambiguation, 'ambiguous OT tag: %s %s' % (ot_tag, str (macrolanguages))) + expect (disambiguation[ot_tag] in bcp_47_tags, + '%s is not a valid disambiguation for %s' % (disambiguation[ot_tag], ot_tag)) + elif ot_tag not in disambiguation: + disambiguation[ot_tag] = macrolanguages[0] + different_primary_tags = sorted (t for t in primary_tags if not same_tag (t, ot.from_bcp_47.get (t))) + if different_primary_tags and disambiguation[ot_tag] == different_primary_tags[0] and '-' not in disambiguation[ot_tag]: + del disambiguation[ot_tag] + for ot_tag in disambiguation.keys (): + expect (ot_tag in ot.to_bcp_47, 'unknown OT tag: %s' % ot_tag) + +verify_disambiguation_dict () +for ot_tag, bcp_47_tag in sorted (disambiguation.items ()): + write (' case %s: /* %s */' % (hb_tag (ot_tag), ot.names[ot_tag])) + print () + write (' return hb_language_from_string (\"%s\", -1); /* %s */' % (bcp_47_tag, bcp_47.get_name (LanguageTag (bcp_47_tag)))) + print () + +print (' default:') +print (' return HB_LANGUAGE_INVALID;') +print (' }') +print ('}') + +print () +print ('#endif /* HB_OT_TAG_TABLE_HH */') +print () +print ('/* == End of generated table == */') + diff -Nru harfbuzz-2.5.3/.pc/py3.diff/src/gen-ucd-table.py harfbuzz-2.6.2/.pc/py3.diff/src/gen-ucd-table.py --- harfbuzz-2.5.3/.pc/py3.diff/src/gen-ucd-table.py 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/.pc/py3.diff/src/gen-ucd-table.py 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,164 @@ +#!/usr/bin/env python + +from __future__ import print_function, division, absolute_import + +import io, os.path, sys, re +import logging +logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO) + +if len (sys.argv) not in (2, 3): + print("usage: ./gen-ucd-table ucd.nounihan.grouped.xml [/path/to/hb-common.h]", file=sys.stderr) + sys.exit(1) + +# https://github.com/harfbuzz/packtab +import packTab +import packTab.ucdxml + +logging.info('Loading UCDXML...') +ucdxml = packTab.ucdxml.load_ucdxml(sys.argv[1]) +ucd = packTab.ucdxml.ucdxml_get_repertoire(ucdxml) + +hb_common_h = 'hb-common.h' if len (sys.argv) < 3 else sys.argv[2] + +logging.info('Preparing data tables...') + +gc = [u['gc'] for u in ucd] +ccc = [int(u['ccc']) for u in ucd] +bmg = [int(v, 16) - int(u) if v else 0 for u,v in enumerate(u['bmg'] for u in ucd)] +#gc_ccc_non0 = set((cat,klass) for cat,klass in zip(gc,ccc) if klass) +#gc_bmg_non0 = set((cat,mirr) for cat,mirr in zip(gc, bmg) if mirr) + +sc = [u['sc'] for u in ucd] + +dm = {i:tuple(int(v, 16) for v in u['dm'].split()) for i,u in enumerate(ucd) + if u['dm'] != '#' and u['dt'] == 'can' and not (0xAC00 <= i < 0xAC00+11172)} +ce = {i for i,u in enumerate(ucd) if u['Comp_Ex'] == 'Y'} + +assert not any(v for v in dm.values() if len(v) not in (1,2)) +dm1 = sorted(set(v for v in dm.values() if len(v) == 1)) +assert all((v[0] >> 16) in (0,2) for v in dm1) +dm1_p0_array = ['0x%04Xu' % (v[0] & 0xFFFF) for v in dm1 if (v[0] >> 16) == 0] +dm1_p2_array = ['0x%04Xu' % (v[0] & 0xFFFF) for v in dm1 if (v[0] >> 16) == 2] +dm1_order = {v:i+1 for i,v in enumerate(dm1)} + +dm2 = sorted((v+(i if i not in ce and not ccc[i] else 0,), v) + for i,v in dm.items() if len(v) == 2) + +filt = lambda v: ((v[0] & 0xFFFFF800) == 0x0000 and + (v[1] & 0xFFFFFF80) == 0x0300 and + (v[2] & 0xFFF0C000) == 0x0000) +dm2_u32_array = [v for v in dm2 if filt(v[0])] +dm2_u64_array = [v for v in dm2 if not filt(v[0])] +assert dm2_u32_array + dm2_u64_array == dm2 +dm2_u32_array = ["HB_CODEPOINT_ENCODE3_11_7_14 (0x%04Xu, 0x%04Xu, 0x%04Xu)" % v[0] for v in dm2_u32_array] +dm2_u64_array = ["HB_CODEPOINT_ENCODE3 (0x%04Xu, 0x%04Xu, 0x%04Xu)" % v[0] for v in dm2_u64_array] + +l = 1 + len(dm1_p0_array) + len(dm1_p2_array) +dm2_order = {v[1]:i+l for i,v in enumerate(dm2)} + +dm_order = {None: 0} +dm_order.update(dm1_order) +dm_order.update(dm2_order) + +gc_order = dict() +for i,v in enumerate(('Cc', 'Cf', 'Cn', 'Co', 'Cs', 'Ll', 'Lm', 'Lo', 'Lt', 'Lu', + 'Mc', 'Me', 'Mn', 'Nd', 'Nl', 'No', 'Pc', 'Pd', 'Pe', 'Pf', + 'Pi', 'Po', 'Ps', 'Sc', 'Sk', 'Sm', 'So', 'Zl', 'Zp', 'Zs',)): + gc_order[i] = v + gc_order[v] = i + +sc_order = dict() +sc_array = [] +sc_re = re.compile(r"\b(HB_SCRIPT_[_A-Z]*).*HB_TAG [(]'(.)','(.)','(.)','(.)'[)]") +for line in open(hb_common_h): + m = sc_re.search (line) + if not m: continue + name = m.group(1) + tag = ''.join(m.group(i) for i in range(2, 6)) + i = len(sc_array) + sc_order[tag] = i + sc_order[i] = tag + sc_array.append(name) + +DEFAULT = 1 +COMPACT = 3 +SLOPPY = 5 + + +logging.info('Generating output...') +print("/* == Start of generated table == */") +print("/*") +print(" * The following table is generated by running:") +print(" *") +print(" * ./gen-ucd-table.py ucd.nounihan.grouped.xml") +print(" *") +print(" * on file with this description:", ucdxml.description) +print(" */") +print() +print("#ifndef HB_UCD_TABLE_HH") +print("#define HB_UCD_TABLE_HH") +print() +print('#include "hb.hh"') +print() + +code = packTab.Code('_hb_ucd') +sc_array, _ = code.addArray('hb_script_t', 'sc_map', sc_array) +dm1_p0_array, _ = code.addArray('uint16_t', 'dm1_p0_map', dm1_p0_array) +dm1_p2_array, _ = code.addArray('uint16_t', 'dm1_p2_map', dm1_p2_array) +dm2_u32_array, _ = code.addArray('uint32_t', 'dm2_u32_map', dm2_u32_array) +dm2_u64_array, _ = code.addArray('uint64_t', 'dm2_u64_map', dm2_u64_array) +code.print_c(linkage='static inline') + +datasets = [ + ('gc', gc, 'Cn', gc_order), + ('ccc', ccc, 0, None), + ('bmg', bmg, 0, None), + ('sc', sc, 'Zzzz', sc_order), + ('dm', dm, None, dm_order), +] + +for compression in (DEFAULT, COMPACT, SLOPPY): + logging.info(' Compression=%d:' % compression) + print() + if compression == DEFAULT: + print('#ifndef HB_OPTIMIZE_SIZE') + elif compression == COMPACT: + print('#elif !defined(HB_NO_UCD_UNASSIGNED)') + else: + print('#else') + print() + + if compression == SLOPPY: + for i in range(len(gc)): + if (i % 128) and gc[i] == 'Cn': + gc[i] = gc[i - 1] + for i in range(len(gc) - 2, -1, -1): + if ((i + 1) % 128) and gc[i] == 'Cn': + gc[i] = gc[i + 1] + for i in range(len(sc)): + if (i % 128) and sc[i] == 'Zzzz': + sc[i] = sc[i - 1] + for i in range(len(sc) - 2, -1, -1): + if ((i + 1) % 128) and sc[i] == 'Zzzz': + sc[i] = sc[i + 1] + + + code = packTab.Code('_hb_ucd') + + for name,data,default,mapping in datasets: + sol = packTab.pack_table(data, default, mapping=mapping, compression=compression) + logging.info(' Dataset=%-8s FullCost=%d' % (name, sol.fullCost)) + sol.genCode(code, name) + + code.print_c(linkage='static inline') + + print() + +print('#endif') +print() + +print() +print("#endif /* HB_UCD_TABLE_HH */") +print() +print("/* == End of generated table == */") +logging.info('Done.') diff -Nru harfbuzz-2.5.3/.pc/py3.diff/src/gen-use-table.py harfbuzz-2.6.2/.pc/py3.diff/src/gen-use-table.py --- harfbuzz-2.5.3/.pc/py3.diff/src/gen-use-table.py 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/.pc/py3.diff/src/gen-use-table.py 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,546 @@ +#!/usr/bin/env python +# flake8: noqa + +from __future__ import print_function, division, absolute_import + +import io +import sys + +if len (sys.argv) != 5: + print ("usage: ./gen-use-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt UnicodeData.txt Blocks.txt", file=sys.stderr) + sys.exit (1) + +BLACKLISTED_BLOCKS = ["Thai", "Lao"] + +files = [io.open (x, encoding='utf-8') for x in sys.argv[1:]] + +headers = [[f.readline () for i in range (2)] for j,f in enumerate(files) if j != 2] +headers.append (["UnicodeData.txt does not have a header."]) + +data = [{} for f in files] +values = [{} for f in files] +for i, f in enumerate (files): + for line in f: + + j = line.find ('#') + if j >= 0: + line = line[:j] + + fields = [x.strip () for x in line.split (';')] + if len (fields) == 1: + continue + + uu = fields[0].split ('..') + start = int (uu[0], 16) + if len (uu) == 1: + end = start + else: + end = int (uu[1], 16) + + t = fields[1 if i != 2 else 2] + + for u in range (start, end + 1): + data[i][u] = t + values[i][t] = values[i].get (t, 0) + end - start + 1 + +defaults = ('Other', 'Not_Applicable', 'Cn', 'No_Block') + +# TODO Characters that are not in Unicode Indic files, but used in USE +data[0][0x034F] = defaults[0] +data[0][0x1B61] = defaults[0] +data[0][0x1B63] = defaults[0] +data[0][0x1B64] = defaults[0] +data[0][0x1B65] = defaults[0] +data[0][0x1B66] = defaults[0] +data[0][0x1B67] = defaults[0] +data[0][0x1B69] = defaults[0] +data[0][0x1B6A] = defaults[0] +data[0][0x2060] = defaults[0] +# TODO https://github.com/harfbuzz/harfbuzz/pull/1685 +data[0][0x1B5B] = 'Consonant_Placeholder' +data[0][0x1B5C] = 'Consonant_Placeholder' +data[0][0x1B5F] = 'Consonant_Placeholder' +data[0][0x1B62] = 'Consonant_Placeholder' +data[0][0x1B68] = 'Consonant_Placeholder' +# TODO https://github.com/harfbuzz/harfbuzz/issues/1035 +data[0][0x11C44] = 'Consonant_Placeholder' +data[0][0x11C45] = 'Consonant_Placeholder' +# TODO https://github.com/harfbuzz/harfbuzz/pull/1399 +data[0][0x111C8] = 'Consonant_Placeholder' +for u in range (0xFE00, 0xFE0F + 1): + data[0][u] = defaults[0] + +# Merge data into one dict: +for i,v in enumerate (defaults): + values[i][v] = values[i].get (v, 0) + 1 +combined = {} +for i,d in enumerate (data): + for u,v in d.items (): + if i >= 2 and not u in combined: + continue + if not u in combined: + combined[u] = list (defaults) + combined[u][i] = v +combined = {k:v for k,v in combined.items() if v[3] not in BLACKLISTED_BLOCKS} +data = combined +del combined +num = len (data) + + +property_names = [ + # General_Category + 'Cc', 'Cf', 'Cn', 'Co', 'Cs', 'Ll', 'Lm', 'Lo', 'Lt', 'Lu', 'Mc', + 'Me', 'Mn', 'Nd', 'Nl', 'No', 'Pc', 'Pd', 'Pe', 'Pf', 'Pi', 'Po', + 'Ps', 'Sc', 'Sk', 'Sm', 'So', 'Zl', 'Zp', 'Zs', + # Indic_Syllabic_Category + 'Other', + 'Bindu', + 'Visarga', + 'Avagraha', + 'Nukta', + 'Virama', + 'Pure_Killer', + 'Invisible_Stacker', + 'Vowel_Independent', + 'Vowel_Dependent', + 'Vowel', + 'Consonant_Placeholder', + 'Consonant', + 'Consonant_Dead', + 'Consonant_With_Stacker', + 'Consonant_Prefixed', + 'Consonant_Preceding_Repha', + 'Consonant_Succeeding_Repha', + 'Consonant_Subjoined', + 'Consonant_Medial', + 'Consonant_Final', + 'Consonant_Head_Letter', + 'Consonant_Initial_Postfixed', + 'Modifying_Letter', + 'Tone_Letter', + 'Tone_Mark', + 'Gemination_Mark', + 'Cantillation_Mark', + 'Register_Shifter', + 'Syllable_Modifier', + 'Consonant_Killer', + 'Non_Joiner', + 'Joiner', + 'Number_Joiner', + 'Number', + 'Brahmi_Joining_Number', + # Indic_Positional_Category + 'Not_Applicable', + 'Right', + 'Left', + 'Visual_Order_Left', + 'Left_And_Right', + 'Top', + 'Bottom', + 'Top_And_Bottom', + 'Top_And_Right', + 'Top_And_Left', + 'Top_And_Left_And_Right', + 'Bottom_And_Left', + 'Bottom_And_Right', + 'Top_And_Bottom_And_Right', + 'Overstruck', +] + +try: + basestring +except NameError: + basestring = str + +class PropertyValue(object): + def __init__(self, name_): + self.name = name_ + def __str__(self): + return self.name + def __eq__(self, other): + return self.name == (other if isinstance(other, basestring) else other.name) + def __ne__(self, other): + return not (self == other) + def __hash__(self): + return hash(str(self)) + +property_values = {} + +for name in property_names: + value = PropertyValue(name) + assert value not in property_values + assert value not in globals() + property_values[name] = value +globals().update(property_values) + + +def is_BASE(U, UISC, UGC): + return (UISC in [Number, Consonant, Consonant_Head_Letter, + #SPEC-DRAFT Consonant_Placeholder, + Tone_Letter, + Vowel_Independent #SPEC-DRAFT + ] or + (UGC == Lo and UISC in [Avagraha, Bindu, Consonant_Final, Consonant_Medial, + Consonant_Subjoined, Vowel, Vowel_Dependent])) +def is_BASE_IND(U, UISC, UGC): + #SPEC-DRAFT return (UISC in [Consonant_Dead, Modifying_Letter] or UGC == Po) + return (UISC in [Consonant_Dead, Modifying_Letter] or + (UGC == Po and not U in [0x104B, 0x104E, 0x1B5B, 0x1B5C, 0x1B5F, 0x2022, 0x111C8, 0x11A3F, 0x11A45, 0x11C44, 0x11C45]) or + False # SPEC-DRAFT-OUTDATED! U == 0x002D + ) +def is_BASE_NUM(U, UISC, UGC): + return UISC == Brahmi_Joining_Number +def is_BASE_OTHER(U, UISC, UGC): + if UISC == Consonant_Placeholder: return True #SPEC-DRAFT + #SPEC-DRAFT return U in [0x00A0, 0x00D7, 0x2015, 0x2022, 0x25CC, 0x25FB, 0x25FC, 0x25FD, 0x25FE] + return U in [0x2015, 0x2022, 0x25FB, 0x25FC, 0x25FD, 0x25FE] +def is_CGJ(U, UISC, UGC): + return U == 0x034F +def is_CONS_FINAL(U, UISC, UGC): + return ((UISC == Consonant_Final and UGC != Lo) or + UISC == Consonant_Succeeding_Repha) +def is_CONS_FINAL_MOD(U, UISC, UGC): + #SPEC-DRAFT return UISC in [Consonant_Final_Modifier, Syllable_Modifier] + return UISC == Syllable_Modifier +def is_CONS_MED(U, UISC, UGC): + # Consonant_Initial_Postfixed is new in Unicode 11; not in the spec. + return (UISC == Consonant_Medial and UGC != Lo or + UISC == Consonant_Initial_Postfixed) +def is_CONS_MOD(U, UISC, UGC): + return UISC in [Nukta, Gemination_Mark, Consonant_Killer] +def is_CONS_SUB(U, UISC, UGC): + #SPEC-DRAFT return UISC == Consonant_Subjoined + return UISC == Consonant_Subjoined and UGC != Lo +def is_CONS_WITH_STACKER(U, UISC, UGC): + return UISC == Consonant_With_Stacker +def is_HALANT(U, UISC, UGC): + return (UISC in [Virama, Invisible_Stacker] + and not is_HALANT_OR_VOWEL_MODIFIER(U, UISC, UGC) + and not is_SAKOT(U, UISC, UGC)) +def is_HALANT_OR_VOWEL_MODIFIER(U, UISC, UGC): + # https://github.com/harfbuzz/harfbuzz/issues/1102 + # https://github.com/harfbuzz/harfbuzz/issues/1379 + return U in [0x11046, 0x1134D] +def is_HALANT_NUM(U, UISC, UGC): + return UISC == Number_Joiner +def is_ZWNJ(U, UISC, UGC): + return UISC == Non_Joiner +def is_ZWJ(U, UISC, UGC): + return UISC == Joiner +def is_Word_Joiner(U, UISC, UGC): + return U == 0x2060 +def is_OTHER(U, UISC, UGC): + #SPEC-OUTDATED return UGC == Zs # or any other SCRIPT_COMMON characters + return (UISC == Other + and not is_SYM(U, UISC, UGC) + and not is_SYM_MOD(U, UISC, UGC) + and not is_CGJ(U, UISC, UGC) + and not is_Word_Joiner(U, UISC, UGC) + and not is_VARIATION_SELECTOR(U, UISC, UGC) + ) +def is_Reserved(U, UISC, UGC): + return UGC == 'Cn' +def is_REPHA(U, UISC, UGC): + return UISC in [Consonant_Preceding_Repha, Consonant_Prefixed] +def is_SAKOT(U, UISC, UGC): + return U == 0x1A60 +def is_SYM(U, UISC, UGC): + if U == 0x25CC: return False #SPEC-DRAFT + #SPEC-DRAFT return UGC in [So, Sc] or UISC == Symbol_Letter + return UGC in [So, Sc] and U not in [0x1B62, 0x1B68] +def is_SYM_MOD(U, UISC, UGC): + return U in [0x1B6B, 0x1B6C, 0x1B6D, 0x1B6E, 0x1B6F, 0x1B70, 0x1B71, 0x1B72, 0x1B73] +def is_VARIATION_SELECTOR(U, UISC, UGC): + return 0xFE00 <= U <= 0xFE0F +def is_VOWEL(U, UISC, UGC): + # https://github.com/harfbuzz/harfbuzz/issues/376 + return (UISC == Pure_Killer or + (UGC != Lo and UISC in [Vowel, Vowel_Dependent] and U not in [0xAA29])) +def is_VOWEL_MOD(U, UISC, UGC): + # https://github.com/harfbuzz/harfbuzz/issues/376 + return (UISC in [Tone_Mark, Cantillation_Mark, Register_Shifter, Visarga] or + (UGC != Lo and (UISC == Bindu or U in [0xAA29]))) + +use_mapping = { + 'B': is_BASE, + 'IND': is_BASE_IND, + 'N': is_BASE_NUM, + 'GB': is_BASE_OTHER, + 'CGJ': is_CGJ, + 'F': is_CONS_FINAL, + 'FM': is_CONS_FINAL_MOD, + 'M': is_CONS_MED, + 'CM': is_CONS_MOD, + 'SUB': is_CONS_SUB, + 'CS': is_CONS_WITH_STACKER, + 'H': is_HALANT, + 'HVM': is_HALANT_OR_VOWEL_MODIFIER, + 'HN': is_HALANT_NUM, + 'ZWNJ': is_ZWNJ, + 'ZWJ': is_ZWJ, + 'WJ': is_Word_Joiner, + 'O': is_OTHER, + 'Rsv': is_Reserved, + 'R': is_REPHA, + 'S': is_SYM, + 'Sk': is_SAKOT, + 'SM': is_SYM_MOD, + 'VS': is_VARIATION_SELECTOR, + 'V': is_VOWEL, + 'VM': is_VOWEL_MOD, +} + +use_positions = { + 'F': { + 'Abv': [Top], + 'Blw': [Bottom], + 'Pst': [Right], + }, + 'M': { + 'Abv': [Top], + 'Blw': [Bottom, Bottom_And_Left], + 'Pst': [Right], + 'Pre': [Left], + }, + 'CM': { + 'Abv': [Top], + 'Blw': [Bottom], + }, + 'V': { + 'Abv': [Top, Top_And_Bottom, Top_And_Bottom_And_Right, Top_And_Right], + 'Blw': [Bottom, Overstruck, Bottom_And_Right], + 'Pst': [Right, Top_And_Left, Top_And_Left_And_Right, Left_And_Right], + 'Pre': [Left], + }, + 'VM': { + 'Abv': [Top], + 'Blw': [Bottom, Overstruck], + 'Pst': [Right], + 'Pre': [Left], + }, + 'SM': { + 'Abv': [Top], + 'Blw': [Bottom], + }, + 'H': None, + 'HVM': None, + 'B': None, + 'FM': { + 'Abv': [Top], + 'Blw': [Bottom], + 'Pst': [Not_Applicable], + }, + 'SUB': None, +} + +def map_to_use(data): + out = {} + items = use_mapping.items() + for U,(UISC,UIPC,UGC,UBlock) in data.items(): + + # Resolve Indic_Syllabic_Category + + # TODO: These don't have UISC assigned in Unicode 12.0, but have UIPC + if 0x1CE2 <= U <= 0x1CE8: UISC = Cantillation_Mark + + # Tibetan: + # TODO: These don't have UISC assigned in Unicode 12.0, but have UIPC + if 0x0F18 <= U <= 0x0F19 or 0x0F3E <= U <= 0x0F3F: UISC = Vowel_Dependent + if 0x0F86 <= U <= 0x0F87: UISC = Tone_Mark + # Overrides to allow NFC order matching syllable + # https://github.com/harfbuzz/harfbuzz/issues/1012 + if UBlock == 'Tibetan' and is_VOWEL (U, UISC, UGC): + if UIPC == Top: + UIPC = Bottom + + # TODO: https://github.com/harfbuzz/harfbuzz/pull/982 + # also https://github.com/harfbuzz/harfbuzz/issues/1012 + if UBlock == 'Chakma' and is_VOWEL (U, UISC, UGC): + if UIPC == Top: + UIPC = Bottom + elif UIPC == Bottom: + UIPC = Top + + # TODO: https://github.com/harfbuzz/harfbuzz/pull/627 + if 0x1BF2 <= U <= 0x1BF3: UISC = Nukta; UIPC = Bottom + + # TODO: U+1CED should only be allowed after some of + # the nasalization marks, maybe only for U+1CE9..U+1CF1. + if U == 0x1CED: UISC = Tone_Mark + + # TODO: https://github.com/harfbuzz/harfbuzz/issues/1105 + if U == 0x11134: UISC = Gemination_Mark + + values = [k for k,v in items if v(U,UISC,UGC)] + assert len(values) == 1, "%s %s %s %s" % (hex(U), UISC, UGC, values) + USE = values[0] + + # Resolve Indic_Positional_Category + + # TODO: These should die, but have UIPC in Unicode 12.0 + if U in [0x953, 0x954]: UIPC = Not_Applicable + + # TODO: In USE's override list but not in Unicode 12.0 + if U == 0x103C: UIPC = Left + + # TODO: These are not in USE's override list that we have, nor are they in Unicode 12.0 + if 0xA926 <= U <= 0xA92A: UIPC = Top + # TODO: https://github.com/harfbuzz/harfbuzz/pull/1037 + # and https://github.com/harfbuzz/harfbuzz/issues/1631 + if U in [0x11302, 0x11303, 0x114C1]: UIPC = Top + if U == 0x1171E: UIPC = Left + if 0x1CF8 <= U <= 0x1CF9: UIPC = Top + + assert (UIPC in [Not_Applicable, Visual_Order_Left] or + USE in use_positions), "%s %s %s %s %s" % (hex(U), UIPC, USE, UISC, UGC) + + pos_mapping = use_positions.get(USE, None) + if pos_mapping: + values = [k for k,v in pos_mapping.items() if v and UIPC in v] + assert len(values) == 1, "%s %s %s %s %s %s" % (hex(U), UIPC, USE, UISC, UGC, values) + USE = USE + values[0] + + out[U] = (USE, UBlock) + return out + +defaults = ('O', 'No_Block') +data = map_to_use(data) + +print ("/* == Start of generated table == */") +print ("/*") +print (" * The following table is generated by running:") +print (" *") +print (" * ./gen-use-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt UnicodeData.txt Blocks.txt") +print (" *") +print (" * on files with these headers:") +print (" *") +for h in headers: + for l in h: + print (" * %s" % (l.strip())) +print (" */") +print () +print ('#include "hb.hh"') +print () +print ('#ifndef HB_NO_OT_SHAPE') +print () +print ('#include "hb-ot-shape-complex-use.hh"') +print () + +total = 0 +used = 0 +last_block = None +def print_block (block, start, end, data): + global total, used, last_block + if block and block != last_block: + print () + print () + print (" /* %s */" % block) + if start % 16: + print (' ' * (20 + (start % 16 * 6)), end='') + num = 0 + assert start % 8 == 0 + assert (end+1) % 8 == 0 + for u in range (start, end+1): + if u % 16 == 0: + print () + print (" /* %04X */" % u, end='') + if u in data: + num += 1 + d = data.get (u, defaults) + print ("%6s," % d[0], end='') + + total += end - start + 1 + used += num + if block: + last_block = block + +uu = sorted (data.keys ()) + +last = -100000 +num = 0 +offset = 0 +starts = [] +ends = [] +print ('#pragma GCC diagnostic push') +print ('#pragma GCC diagnostic ignored "-Wunused-macros"') +for k,v in sorted(use_mapping.items()): + if k in use_positions and use_positions[k]: continue + print ("#define %s USE_%s /* %s */" % (k, k, v.__name__[3:])) +for k,v in sorted(use_positions.items()): + if not v: continue + for suf in v.keys(): + tag = k + suf + print ("#define %s USE_%s" % (tag, tag)) +print ('#pragma GCC diagnostic pop') +print ("") +print ("static const USE_TABLE_ELEMENT_TYPE use_table[] = {") +for u in uu: + if u <= last: + continue + block = data[u][1] + + start = u//8*8 + end = start+1 + while end in uu and block == data[end][1]: + end += 1 + end = (end-1)//8*8 + 7 + + if start != last + 1: + if start - last <= 1+16*3: + print_block (None, last+1, start-1, data) + last = start-1 + else: + if last >= 0: + ends.append (last + 1) + offset += ends[-1] - starts[-1] + print () + print () + print ("#define use_offset_0x%04xu %d" % (start, offset)) + starts.append (start) + + print_block (block, start, end, data) + last = end +ends.append (last + 1) +offset += ends[-1] - starts[-1] +print () +print () +occupancy = used * 100. / total +page_bits = 12 +print ("}; /* Table items: %d; occupancy: %d%% */" % (offset, occupancy)) +print () +print ("USE_TABLE_ELEMENT_TYPE") +print ("hb_use_get_category (hb_codepoint_t u)") +print ("{") +print (" switch (u >> %d)" % page_bits) +print (" {") +pages = set([u>>page_bits for u in starts+ends]) +for p in sorted(pages): + print (" case 0x%0Xu:" % p) + for (start,end) in zip (starts, ends): + if p not in [start>>page_bits, end>>page_bits]: continue + offset = "use_offset_0x%04xu" % start + print (" if (hb_in_range (u, 0x%04Xu, 0x%04Xu)) return use_table[u - 0x%04Xu + %s];" % (start, end-1, start, offset)) + print (" break;") + print ("") +print (" default:") +print (" break;") +print (" }") +print (" return USE_O;") +print ("}") +print () +for k in sorted(use_mapping.keys()): + if k in use_positions and use_positions[k]: continue + print ("#undef %s" % k) +for k,v in sorted(use_positions.items()): + if not v: continue + for suf in v.keys(): + tag = k + suf + print ("#undef %s" % tag) +print () +print () +print ('#endif') +print ("/* == End of generated table == */") + +# Maintain at least 50% occupancy in the table */ +if occupancy < 50: + raise Exception ("Table too sparse, please investigate: ", occupancy) diff -Nru harfbuzz-2.5.3/.pc/py3.diff/src/gen-vowel-constraints.py harfbuzz-2.6.2/.pc/py3.diff/src/gen-vowel-constraints.py --- harfbuzz-2.5.3/.pc/py3.diff/src/gen-vowel-constraints.py 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/.pc/py3.diff/src/gen-vowel-constraints.py 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,233 @@ +#!/usr/bin/python + +"""Generator of the function to prohibit certain vowel sequences. + +It creates ``_hb_preprocess_text_vowel_constraints``, which inserts dotted +circles into sequences prohibited by the USE script development spec. +This function should be used as the ``preprocess_text`` of an +``hb_ot_complex_shaper_t``. +""" + +from __future__ import absolute_import, division, print_function, unicode_literals + +import collections +try: + from HTMLParser import HTMLParser + def write (s): + print (s.encode ('utf-8'), end='') +except ImportError: + from html.parser import HTMLParser + def write (s): + sys.stdout.flush () + sys.stdout.buffer.write (s.encode ('utf-8')) +import itertools +import io +import sys + +if len (sys.argv) != 3: + print ('usage: ./gen-vowel-constraints.py HBIndicVowelConstraints.txt Scripts.txt', file=sys.stderr) + sys.exit (1) + +with io.open (sys.argv[2], encoding='utf-8') as f: + scripts_header = [f.readline () for i in range (2)] + scripts = {} + script_order = {} + for line in f: + j = line.find ('#') + if j >= 0: + line = line[:j] + fields = [x.strip () for x in line.split (';')] + if len (fields) == 1: + continue + uu = fields[0].split ('..') + start = int (uu[0], 16) + if len (uu) == 1: + end = start + else: + end = int (uu[1], 16) + script = fields[1] + for u in range (start, end + 1): + scripts[u] = script + if script not in script_order: + script_order[script] = start + +class ConstraintSet (object): + """A set of prohibited code point sequences. + + Args: + constraint (List[int]): A prohibited code point sequence. + + """ + def __init__ (self, constraint): + # Either a list or a dictionary. As a list of code points, it + # represents a prohibited code point sequence. As a dictionary, + # it represents a set of prohibited sequences, where each item + # represents the set of prohibited sequences starting with the + # key (a code point) concatenated with any of the values + # (ConstraintSets). + self._c = constraint + + def add (self, constraint): + """Add a constraint to this set.""" + if not constraint: + return + first = constraint[0] + rest = constraint[1:] + if isinstance (self._c, list): + if constraint == self._c[:len (constraint)]: + self._c = constraint + elif self._c != constraint[:len (self._c)]: + self._c = {self._c[0]: ConstraintSet (self._c[1:])} + if isinstance (self._c, dict): + if first in self._c: + self._c[first].add (rest) + else: + self._c[first] = ConstraintSet (rest) + + def _indent (self, depth): + return (' ' * depth).replace (' ', '\t') + + def __str__ (self, index=0, depth=4): + s = [] + indent = self._indent (depth) + if isinstance (self._c, list): + if len (self._c) == 0: + s.append ('{}matched = true;\n'.format (indent)) + elif len (self._c) == 1: + s.append ('{}matched = 0x{:04X}u == buffer->cur ({}).codepoint;\n'.format (indent, next (iter (self._c)), index or '')) + else: + s.append ('{}if (0x{:04X}u == buffer->cur ({}).codepoint &&\n'.format (indent, self._c[0], index)) + s.append ('{}buffer->idx + {} < count &&\n'.format (self._indent (depth + 2), len (self._c))) + for i, cp in enumerate (self._c[1:], start=1): + s.append ('{}0x{:04X}u == buffer->cur ({}).codepoint{}\n'.format ( + self._indent (depth + 2), cp, index + i, ')' if i == len (self._c) - 1 else ' &&')) + s.append ('{}{{\n'.format (indent)) + for i in range (len (self._c)): + s.append ('{}buffer->next_glyph ();\n'.format (self._indent (depth + 1))) + s.append ('{}_output_dotted_circle (buffer);\n'.format (self._indent (depth + 1))) + s.append ('{}}}\n'.format (indent)) + else: + s.append ('{}switch (buffer->cur ({}).codepoint)\n'.format(indent, index or '')) + s.append ('{}{{\n'.format (indent)) + cases = collections.defaultdict (set) + for first, rest in sorted (self._c.items ()): + cases[rest.__str__ (index + 1, depth + 2)].add (first) + for body, labels in sorted (cases.items (), key=lambda b_ls: sorted (b_ls[1])[0]): + for i, cp in enumerate (sorted (labels)): + if i % 4 == 0: + s.append (self._indent (depth + 1)) + else: + s.append (' ') + s.append ('case 0x{:04X}u:{}'.format (cp, '\n' if i % 4 == 3 else '')) + if len (labels) % 4 != 0: + s.append ('\n') + s.append (body) + s.append ('{}break;\n'.format (self._indent (depth + 2))) + s.append ('{}}}\n'.format (indent)) + return ''.join (s) + +constraints = {} +with io.open (sys.argv[1], encoding='utf-8') as f: + constraints_header = [f.readline ().strip () for i in range (2)] + for line in f: + j = line.find ('#') + if j >= 0: + line = line[:j] + constraint = [int (cp, 16) for cp in line.split (';')[0].split ()] + if not constraint: continue + assert 2 <= len (constraint), 'Prohibited sequence is too short: {}'.format (constraint) + script = scripts[constraint[0]] + if script in constraints: + constraints[script].add (constraint) + else: + constraints[script] = ConstraintSet (constraint) + assert constraints, 'No constraints found' + +print ('/* == Start of generated functions == */') +print ('/*') +print (' * The following functions are generated by running:') +print (' *') +print (' * %s use Scripts.txt' % sys.argv[0]) +print (' *') +print (' * on files with these headers:') +print (' *') +for line in constraints_header: + print (' * %s' % line.strip ()) +print (' *') +for line in scripts_header: + print (' * %s' % line.strip ()) +print (' */') + +print () +print ('#include "hb.hh"') +print () +print ('#ifndef HB_NO_OT_SHAPE') +print () +print ('#include "hb-ot-shape-complex-vowel-constraints.hh"') +print () +print ('static void') +print ('_output_dotted_circle (hb_buffer_t *buffer)') +print ('{') +print (' hb_glyph_info_t &dottedcircle = buffer->output_glyph (0x25CCu);') +print (' _hb_glyph_info_reset_continuation (&dottedcircle);') +print ('}') +print () +print ('static void') +print ('_output_with_dotted_circle (hb_buffer_t *buffer)') +print ('{') +print (' _output_dotted_circle (buffer);') +print (' buffer->next_glyph ();') +print ('}') +print () + +print ('void') +print ('_hb_preprocess_text_vowel_constraints (const hb_ot_shape_plan_t *plan HB_UNUSED,') +print ('\t\t\t\t hb_buffer_t *buffer,') +print ('\t\t\t\t hb_font_t *font HB_UNUSED)') +print ('{') +print ('#if defined(HB_NO_OT_SHAPE_COMPLEX_VOWEL_CONSTRAINTS)') +print (' return;') +print ('#endif') +print (' if (buffer->flags & HB_BUFFER_FLAG_DO_NOT_INSERT_DOTTED_CIRCLE)') +print (' return;') +print () +print (' /* UGLY UGLY UGLY business of adding dotted-circle in the middle of') +print (' * vowel-sequences that look like another vowel. Data for each script') +print (' * collected from the USE script development spec.') +print (' *') +print (' * https://github.com/harfbuzz/harfbuzz/issues/1019') +print (' */') +print (' bool processed = false;') +print (' buffer->clear_output ();') +print (' unsigned int count = buffer->len;') +print (' switch ((unsigned) buffer->props.script)') +print (' {') + +for script, constraints in sorted (constraints.items (), key=lambda s_c: script_order[s_c[0]]): + print (' case HB_SCRIPT_{}:'.format (script.upper ())) + print (' for (buffer->idx = 0; buffer->idx + 1 < count && buffer->successful;)') + print (' {') + print ('\tbool matched = false;') + write (str (constraints)) + print ('\tbuffer->next_glyph ();') + print ('\tif (matched) _output_with_dotted_circle (buffer);') + print (' }') + print (' processed = true;') + print (' break;') + print () + +print (' default:') +print (' break;') +print (' }') +print (' if (processed)') +print (' {') +print (' if (buffer->idx < count)') +print (' buffer->next_glyph ();') +print (' buffer->swap_buffers ();') +print (' }') +print ('}') + +print () +print () +print ('#endif') +print ('/* == End of generated functions == */') diff -Nru harfbuzz-2.5.3/.pc/py3.diff/test/fuzzing/run-shape-fuzzer-tests.py harfbuzz-2.6.2/.pc/py3.diff/test/fuzzing/run-shape-fuzzer-tests.py --- harfbuzz-2.5.3/.pc/py3.diff/test/fuzzing/run-shape-fuzzer-tests.py 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/.pc/py3.diff/test/fuzzing/run-shape-fuzzer-tests.py 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,107 @@ +#!/usr/bin/env python + +from __future__ import print_function, division, absolute_import + +import sys, os, subprocess, tempfile, threading + + +def which (program): + # https://stackoverflow.com/a/377028 + def is_exe (fpath): + return os.path.isfile (fpath) and os.access (fpath, os.X_OK) + + fpath, _ = os.path.split (program) + if fpath: + if is_exe (program): + return program + else: + for path in os.environ["PATH"].split (os.pathsep): + exe_file = os.path.join (path, program) + if is_exe (exe_file): + return exe_file + + return None + + +def cmd (command): + # https://stackoverflow.com/a/4408409 + # https://stackoverflow.com/a/10012262 + with tempfile.TemporaryFile () as tempf: + p = subprocess.Popen (command, stderr=tempf) + is_killed = {'value': False} + + def timeout (p, is_killed): + is_killed['value'] = True + p.kill () + timer = threading.Timer (2, timeout, [p, is_killed]) + + try: + timer.start() + p.wait () + tempf.seek (0) + text = tempf.read () + + #TODO: Detect debug mode with a better way + is_debug_mode = b"SANITIZE" in text + + text = "" if is_debug_mode else text.decode ("utf-8").strip () + returncode = p.returncode + finally: + timer.cancel() + + if is_killed['value']: + text = 'error: timeout, ' + text + returncode = 1 + + return text, returncode + + +srcdir = os.environ.get ("srcdir", ".") +EXEEXT = os.environ.get ("EXEEXT", "") +top_builddir = os.environ.get ("top_builddir", ".") +hb_shape_fuzzer = os.path.join (top_builddir, "hb-shape-fuzzer" + EXEEXT) + +if not os.path.exists (hb_shape_fuzzer): + if len (sys.argv) == 1 or not os.path.exists (sys.argv[1]): + print ("""Failed to find hb-shape-fuzzer binary automatically, +please provide it as the first argument to the tool""") + sys.exit (1) + + hb_shape_fuzzer = sys.argv[1] + +print ('hb_shape_fuzzer:', hb_shape_fuzzer) +fails = 0 + +libtool = os.environ.get ('LIBTOOL') +valgrind = None +if os.environ.get ('RUN_VALGRIND', ''): + valgrind = which ('valgrind') + if valgrind is None: + print ("""Valgrind requested but not found.""") + sys.exit (1) + if libtool is None: + print ("""Valgrind support is currently autotools only and needs libtool but not found.""") + + +parent_path = os.path.join (srcdir, "fonts") +for file in os.listdir (parent_path): + path = os.path.join (parent_path, file) + + if valgrind: + text, returncode = cmd (libtool.split(' ') + ['--mode=execute', valgrind + ' --leak-check=full --error-exitcode=1', '--', hb_shape_fuzzer, path]) + else: + text, returncode = cmd ([hb_shape_fuzzer, path]) + if 'error' in text: + returncode = 1 + + if (not valgrind or returncode) and text.strip (): + print (text) + + if returncode != 0: + print ('failure on %s' % file) + fails = fails + 1 + + +if fails: + print ("%i shape fuzzer related tests failed." % fails) + sys.exit (1) diff -Nru harfbuzz-2.5.3/.pc/py3.diff/test/fuzzing/run-subset-fuzzer-tests.py harfbuzz-2.6.2/.pc/py3.diff/test/fuzzing/run-subset-fuzzer-tests.py --- harfbuzz-2.5.3/.pc/py3.diff/test/fuzzing/run-subset-fuzzer-tests.py 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/.pc/py3.diff/test/fuzzing/run-subset-fuzzer-tests.py 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,114 @@ +#!/usr/bin/env python + +from __future__ import print_function, division, absolute_import + +import sys, os, subprocess, tempfile, threading + + +def which(program): + # https://stackoverflow.com/a/377028 + def is_exe(fpath): + return os.path.isfile(fpath) and os.access(fpath, os.X_OK) + + fpath, _ = os.path.split(program) + if fpath: + if is_exe(program): + return program + else: + for path in os.environ["PATH"].split(os.pathsep): + exe_file = os.path.join(path, program) + if is_exe(exe_file): + return exe_file + + return None + + +def cmd(command): + # https://stackoverflow.com/a/4408409 + # https://stackoverflow.com/a/10012262 + with tempfile.TemporaryFile() as tempf: + p = subprocess.Popen (command, stderr=tempf) + is_killed = {'value': False} + + def timeout(p, is_killed): + is_killed['value'] = True + p.kill() + timer = threading.Timer (16, timeout, [p, is_killed]) + + try: + timer.start() + p.wait () + tempf.seek (0) + text = tempf.read () + + #TODO: Detect debug mode with a better way + is_debug_mode = b"SANITIZE" in text + + text = "" if is_debug_mode else text.decode ("utf-8").strip () + returncode = p.returncode + finally: + timer.cancel() + + if is_killed['value']: + text = 'error: timeout, ' + text + returncode = 1 + + return text, returncode + + +srcdir = os.environ.get ("srcdir", ".") +EXEEXT = os.environ.get ("EXEEXT", "") +top_builddir = os.environ.get ("top_builddir", ".") +hb_subset_fuzzer = os.path.join (top_builddir, "hb-subset-fuzzer" + EXEEXT) + +if not os.path.exists (hb_subset_fuzzer): + if len (sys.argv) < 2 or not os.path.exists (sys.argv[1]): + print ("""Failed to find hb-subset-fuzzer binary automatically, +please provide it as the first argument to the tool""") + sys.exit (1) + + hb_subset_fuzzer = sys.argv[1] + +print ('hb_subset_fuzzer:', hb_subset_fuzzer) +fails = 0 + +libtool = os.environ.get('LIBTOOL') +valgrind = None +if os.environ.get('RUN_VALGRIND', ''): + valgrind = which ('valgrind') + if valgrind is None: + print ("""Valgrind requested but not found.""") + sys.exit (1) + if libtool is None: + print ("""Valgrind support is currently autotools only and needs libtool but not found.""") + + +def run_dir (parent_path): + global fails + for file in os.listdir (parent_path): + path = os.path.join(parent_path, file) + # TODO: Run on all the fonts not just subset related ones + if "subset" not in path: continue + + print ("running subset fuzzer against %s" % path) + if valgrind: + text, returncode = cmd (libtool.split(' ') + ['--mode=execute', valgrind + ' --leak-check=full --show-leak-kinds=all --error-exitcode=1', '--', hb_subset_fuzzer, path]) + else: + text, returncode = cmd ([hb_subset_fuzzer, path]) + if 'error' in text: + returncode = 1 + + if (not valgrind or returncode) and text.strip (): + print (text) + + if returncode != 0: + print ("failed for %s" % path) + fails = fails + 1 + + +run_dir (os.path.join (srcdir, "..", "subset", "data", "fonts")) +run_dir (os.path.join (srcdir, "fonts")) + +if fails: + print ("%i subset fuzzer related tests failed." % fails) + sys.exit (1) diff -Nru harfbuzz-2.5.3/.pc/py3.diff/test/shaping/hb_test_tools.py harfbuzz-2.6.2/.pc/py3.diff/test/shaping/hb_test_tools.py --- harfbuzz-2.5.3/.pc/py3.diff/test/shaping/hb_test_tools.py 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/.pc/py3.diff/test/shaping/hb_test_tools.py 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,576 @@ +#!/usr/bin/env python + +from __future__ import print_function, division, absolute_import + +import sys, os, re, difflib, unicodedata, errno, cgi +from itertools import * +try: + import unicodedata2 as unicodedata +except Exception: + pass + +diff_symbols = "-+=*&^%$#@!~/" +diff_colors = ['red', 'green', 'blue'] + +def codepoints(s): + return (ord (u) for u in s) + +try: + unichr = unichr + + if sys.maxunicode < 0x10FFFF: + # workarounds for Python 2 "narrow" builds with UCS2-only support. + + _narrow_unichr = unichr + + def unichr(i): + """ + Return the unicode character whose Unicode code is the integer 'i'. + The valid range is 0 to 0x10FFFF inclusive. + + >>> _narrow_unichr(0xFFFF + 1) + Traceback (most recent call last): + File "", line 1, in ? + ValueError: unichr() arg not in range(0x10000) (narrow Python build) + >>> unichr(0xFFFF + 1) == u'\U00010000' + True + >>> unichr(1114111) == u'\U0010FFFF' + True + >>> unichr(0x10FFFF + 1) + Traceback (most recent call last): + File "", line 1, in ? + ValueError: unichr() arg not in range(0x110000) + """ + try: + return _narrow_unichr(i) + except ValueError: + try: + padded_hex_str = hex(i)[2:].zfill(8) + escape_str = "\\U" + padded_hex_str + return escape_str.decode("unicode-escape") + except UnicodeDecodeError: + raise ValueError('unichr() arg not in range(0x110000)') + + def codepoints(s): + high_surrogate = None + for u in s: + cp = ord (u) + if 0xDC00 <= cp <= 0xDFFF: + if high_surrogate: + yield 0x10000 + (high_surrogate - 0xD800) * 0x400 + (cp - 0xDC00) + high_surrogate = None + else: + yield 0xFFFD + else: + if high_surrogate: + yield 0xFFFD + high_surrogate = None + if 0xD800 <= cp <= 0xDBFF: + high_surrogate = cp + else: + yield cp + high_surrogate = None + if high_surrogate: + yield 0xFFFD + +except NameError: + unichr = chr + +try: + unicode = unicode +except NameError: + unicode = str + +def tounicode(s, encoding='ascii', errors='strict'): + if not isinstance(s, unicode): + return s.decode(encoding, errors) + else: + return s + +class ColorFormatter: + + class Null: + @staticmethod + def start_color (c): return '' + @staticmethod + def end_color (): return '' + @staticmethod + def escape (s): return s + @staticmethod + def newline (): return '\n' + + class ANSI: + @staticmethod + def start_color (c): + return { + 'red': '\033[41;37;1m', + 'green': '\033[42;37;1m', + 'blue': '\033[44;37;1m', + }[c] + @staticmethod + def end_color (): + return '\033[m' + @staticmethod + def escape (s): return s + @staticmethod + def newline (): return '\n' + + class HTML: + @staticmethod + def start_color (c): + return '' % c + @staticmethod + def end_color (): + return '' + @staticmethod + def escape (s): return cgi.escape (s) + @staticmethod + def newline (): return '
\n' + + @staticmethod + def Auto (argv = [], out = sys.stdout): + format = ColorFormatter.ANSI + if "--format" in argv: + argv.remove ("--format") + format = ColorFormatter.ANSI + if "--format=ansi" in argv: + argv.remove ("--format=ansi") + format = ColorFormatter.ANSI + if "--format=html" in argv: + argv.remove ("--format=html") + format = ColorFormatter.HTML + if "--no-format" in argv: + argv.remove ("--no-format") + format = ColorFormatter.Null + return format + + +class DiffColorizer: + + diff_regex = re.compile ('([a-za-z0-9_]*)([^a-za-z0-9_]?)') + + def __init__ (self, formatter, colors=diff_colors, symbols=diff_symbols): + self.formatter = formatter + self.colors = colors + self.symbols = symbols + + def colorize_lines (self, lines): + lines = (l if l else '' for l in lines) + ss = [self.diff_regex.sub (r'\1\n\2\n', l).splitlines (True) for l in lines] + oo = ["",""] + st = [False, False] + for l in difflib.Differ().compare (*ss): + if l[0] == '?': + continue + if l[0] == ' ': + for i in range(2): + if st[i]: + oo[i] += self.formatter.end_color () + st[i] = False + oo = [o + self.formatter.escape (l[2:]) for o in oo] + continue + if l[0] in self.symbols: + i = self.symbols.index (l[0]) + if not st[i]: + oo[i] += self.formatter.start_color (self.colors[i]) + st[i] = True + oo[i] += self.formatter.escape (l[2:]) + continue + for i in range(2): + if st[i]: + oo[i] += self.formatter.end_color () + st[i] = False + oo = [o.replace ('\n', '') for o in oo] + return [s1+s2+self.formatter.newline () for (s1,s2) in zip (self.symbols, oo) if s2] + + def colorize_diff (self, f): + lines = [None, None] + for l in f: + if l[0] not in self.symbols: + yield self.formatter.escape (l).replace ('\n', self.formatter.newline ()) + continue + i = self.symbols.index (l[0]) + if lines[i]: + # Flush + for line in self.colorize_lines (lines): + yield line + lines = [None, None] + lines[i] = l[1:] + if (all (lines)): + # Flush + for line in self.colorize_lines (lines): + yield line + lines = [None, None] + if (any (lines)): + # Flush + for line in self.colorize_lines (lines): + yield line + + +class ZipDiffer: + + @staticmethod + def diff_files (files, symbols=diff_symbols): + files = tuple (files) # in case it's a generator, copy it + try: + for lines in izip_longest (*files): + if all (lines[0] == line for line in lines[1:]): + sys.stdout.writelines ([" ", lines[0]]) + continue + + for i, l in enumerate (lines): + if l: + sys.stdout.writelines ([symbols[i], l]) + except IOError as e: + if e.errno != errno.EPIPE: + print ("%s: %s: %s" % (sys.argv[0], e.filename, e.strerror), file=sys.stderr) + sys.exit (1) + + +class DiffFilters: + + @staticmethod + def filter_failures (f): + for key, lines in DiffHelpers.separate_test_cases (f): + lines = list (lines) + if not DiffHelpers.test_passed (lines): + for l in lines: yield l + +class Stat: + + def __init__ (self): + self.count = 0 + self.freq = 0 + + def add (self, test): + self.count += 1 + self.freq += test.freq + +class Stats: + + def __init__ (self): + self.passed = Stat () + self.failed = Stat () + self.total = Stat () + + def add (self, test): + self.total.add (test) + if test.passed: + self.passed.add (test) + else: + self.failed.add (test) + + def mean (self): + return float (self.passed.count) / self.total.count + + def variance (self): + return (float (self.passed.count) / self.total.count) * \ + (float (self.failed.count) / self.total.count) + + def stddev (self): + return self.variance () ** .5 + + def zscore (self, population): + """Calculate the standard score. + Population is the Stats for population. + Self is Stats for sample. + Returns larger absolute value if sample is highly unlikely to be random. + Anything outside of -3..+3 is very unlikely to be random. + See: http://en.wikipedia.org/wiki/Standard_score""" + + return (self.mean () - population.mean ()) / population.stddev () + + + + +class DiffSinks: + + @staticmethod + def print_stat (f): + passed = 0 + failed = 0 + # XXX port to Stats, but that would really slow us down here + for key, lines in DiffHelpers.separate_test_cases (f): + if DiffHelpers.test_passed (lines): + passed += 1 + else: + failed += 1 + total = passed + failed + print ("%d out of %d tests passed. %d failed (%g%%)" % (passed, total, failed, 100. * failed / total)) + + +class Test: + + def __init__ (self, lines): + self.freq = 1 + self.passed = True + self.identifier = None + self.text = None + self.unicodes = None + self.glyphs = None + for l in lines: + symbol = l[0] + if symbol != ' ': + self.passed = False + i = 1 + if ':' in l: + i = l.index (':') + if not self.identifier: + self.identifier = l[1:i] + i = i + 2 # Skip colon and space + j = -1 + if l[j] == '\n': + j -= 1 + brackets = l[i] + l[j] + l = l[i+1:-2] + if brackets == '()': + self.text = l + elif brackets == '<>': + self.unicodes = Unicode.parse (l) + elif brackets == '[]': + # XXX we don't handle failed tests here + self.glyphs = l + + +class DiffHelpers: + + @staticmethod + def separate_test_cases (f): + '''Reads lines from f, and if the lines have identifiers, ie. + have a colon character, groups them by identifier, + yielding lists of all lines with the same identifier.''' + + def identifier (l): + if ':' in l[1:]: + return l[1:l.index (':')] + return l + return groupby (f, key=identifier) + + @staticmethod + def test_passed (lines): + lines = list (lines) + # XXX This is a hack, but does the job for now. + if any (l.find("space+0|space+0") >= 0 for l in lines if l[0] == '+'): return True + if any (l.find("uni25CC") >= 0 for l in lines if l[0] == '+'): return True + if any (l.find("dottedcircle") >= 0 for l in lines if l[0] == '+'): return True + if any (l.find("glyph0") >= 0 for l in lines if l[0] == '+'): return True + if any (l.find("gid0") >= 0 for l in lines if l[0] == '+'): return True + if any (l.find("notdef") >= 0 for l in lines if l[0] == '+'): return True + return all (l[0] == ' ' for l in lines) + + +class FilterHelpers: + + @staticmethod + def filter_printer_function (filter_callback): + def printer (f): + for line in filter_callback (f): + print (line) + return printer + + @staticmethod + def filter_printer_function_no_newline (filter_callback): + def printer (f): + for line in filter_callback (f): + sys.stdout.writelines ([line]) + return printer + + +class Ngram: + + @staticmethod + def generator (n): + + def gen (f): + l = [] + for x in f: + l.append (x) + if len (l) == n: + yield tuple (l) + l[:1] = [] + + gen.n = n + return gen + + +class UtilMains: + + @staticmethod + def process_multiple_files (callback, mnemonic = "FILE"): + + if "--help" in sys.argv: + print ("Usage: %s %s..." % (sys.argv[0], mnemonic)) + sys.exit (1) + + try: + files = sys.argv[1:] if len (sys.argv) > 1 else ['-'] + for s in files: + callback (FileHelpers.open_file_or_stdin (s)) + except IOError as e: + if e.errno != errno.EPIPE: + print ("%s: %s: %s" % (sys.argv[0], e.filename, e.strerror), file=sys.stderr) + sys.exit (1) + + @staticmethod + def process_multiple_args (callback, mnemonic): + + if len (sys.argv) == 1 or "--help" in sys.argv: + print ("Usage: %s %s..." % (sys.argv[0], mnemonic)) + sys.exit (1) + + try: + for s in sys.argv[1:]: + callback (s) + except IOError as e: + if e.errno != errno.EPIPE: + print ("%s: %s: %s" % (sys.argv[0], e.filename, e.strerror), file=sys.stderr) + sys.exit (1) + + @staticmethod + def filter_multiple_strings_or_stdin (callback, mnemonic, \ + separator = " ", \ + concat_separator = False): + + if "--help" in sys.argv: + print ("Usage:\n %s %s...\nor:\n %s\n\nWhen called with no arguments, input is read from standard input." \ + % (sys.argv[0], mnemonic, sys.argv[0])) + sys.exit (1) + + try: + if len (sys.argv) == 1: + while (1): + line = sys.stdin.readline () + if not len (line): + break + if line[-1] == '\n': + line = line[:-1] + print (callback (line)) + else: + args = sys.argv[1:] + if concat_separator != False: + args = [concat_separator.join (args)] + print (separator.join (callback (x) for x in (args))) + except IOError as e: + if e.errno != errno.EPIPE: + print ("%s: %s: %s" % (sys.argv[0], e.filename, e.strerror), file=sys.stderr) + sys.exit (1) + + +class Unicode: + + @staticmethod + def decode (s): + return u','.join ("U+%04X" % cp for cp in codepoints (tounicode (s, 'utf-8'))) + + @staticmethod + def parse (s): + s = re.sub (r"0[xX]", " ", s) + s = re.sub (r"[<+>{},;&#\\xXuUnNiI\n\t]", " ", s) + return [int (x, 16) for x in s.split ()] + + @staticmethod + def encode (s): + s = u''.join (unichr (x) for x in Unicode.parse (s)) + if sys.version_info[0] == 2: s = s.encode ('utf-8') + return s + + shorthands = { + "ZERO WIDTH NON-JOINER": "ZWNJ", + "ZERO WIDTH JOINER": "ZWJ", + "NARROW NO-BREAK SPACE": "NNBSP", + "COMBINING GRAPHEME JOINER": "CGJ", + "LEFT-TO-RIGHT MARK": "LRM", + "RIGHT-TO-LEFT MARK": "RLM", + "LEFT-TO-RIGHT EMBEDDING": "LRE", + "RIGHT-TO-LEFT EMBEDDING": "RLE", + "POP DIRECTIONAL FORMATTING": "PDF", + "LEFT-TO-RIGHT OVERRIDE": "LRO", + "RIGHT-TO-LEFT OVERRIDE": "RLO", + } + + @staticmethod + def pretty_name (u): + try: + s = unicodedata.name (u) + except ValueError: + return "XXX" + s = re.sub (".* LETTER ", "", s) + s = re.sub (".* VOWEL SIGN (.*)", r"\1-MATRA", s) + s = re.sub (".* SIGN ", "", s) + s = re.sub (".* COMBINING ", "", s) + if re.match (".* VIRAMA", s): + s = "HALANT" + if s in Unicode.shorthands: + s = Unicode.shorthands[s] + return s + + @staticmethod + def pretty_names (s): + s = re.sub (r"[<+>\\uU]", " ", s) + s = re.sub (r"0[xX]", " ", s) + s = [unichr (int (x, 16)) for x in re.split ('[, \n]', s) if len (x)] + return u' + '.join (Unicode.pretty_name (x) for x in s).encode ('utf-8') + + +class FileHelpers: + + @staticmethod + def open_file_or_stdin (f): + if f == '-': + return sys.stdin + return open (f) + + +class Manifest: + + @staticmethod + def read (s, strict = True): + + if not os.path.exists (s): + if strict: + print ("%s: %s does not exist" % (sys.argv[0], s), file=sys.stderr) + sys.exit (1) + return + + s = os.path.normpath (s) + + if os.path.isdir (s): + + try: + m = open (os.path.join (s, "MANIFEST")) + items = [x.strip () for x in m.readlines ()] + for f in items: + for p in Manifest.read (os.path.join (s, f)): + yield p + except IOError: + if strict: + print ("%s: %s does not exist" % (sys.argv[0], os.path.join (s, "MANIFEST")), file=sys.stderr) + sys.exit (1) + return + else: + yield s + + @staticmethod + def update_recursive (s): + + for dirpath, dirnames, filenames in os.walk (s, followlinks=True): + + for f in ["MANIFEST", "README", "LICENSE", "COPYING", "AUTHORS", "SOURCES", "ChangeLog"]: + if f in dirnames: + dirnames.remove (f) + if f in filenames: + filenames.remove (f) + dirnames.sort () + filenames.sort () + ms = os.path.join (dirpath, "MANIFEST") + print (" GEN %s" % ms) + m = open (ms, "w") + for f in filenames: + print (f, file=m) + for f in dirnames: + print (f, file=m) + for f in dirnames: + Manifest.update_recursive (os.path.join (dirpath, f)) + +if __name__ == '__main__': + pass diff -Nru harfbuzz-2.5.3/.pc/py3.diff/test/shaping/run-tests.py harfbuzz-2.6.2/.pc/py3.diff/test/shaping/run-tests.py --- harfbuzz-2.5.3/.pc/py3.diff/test/shaping/run-tests.py 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/.pc/py3.diff/test/shaping/run-tests.py 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,141 @@ +#!/usr/bin/env python + +from __future__ import print_function, division, absolute_import + +import sys, os, subprocess, hashlib, tempfile, shutil + +def cmd(command): + global process + process.stdin.write ((' '.join (command) + '\n').encode ("utf-8")) + process.stdin.flush () + return process.stdout.readline().decode ("utf-8").strip () + +args = sys.argv[1:] + +reference = False +if len (args) and args[0] == "--reference": + reference = True + args = args[1:] + +if not args or args[0].find('hb-shape') == -1 or not os.path.exists (args[0]): + print ("""First argument does not seem to point to usable hb-shape.""") + sys.exit (1) +hb_shape, args = args[0], args[1:] + +process = subprocess.Popen ([hb_shape, '--batch'], + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=sys.stdout) + +passes = 0 +fails = 0 +skips = 0 + +if not len (args): + args = ['-'] + +for filename in args: + if not reference: + if filename == '-': + print ("Running tests from standard input") + else: + print ("Running tests in " + filename) + + if filename == '-': + f = sys.stdin + else: + f = open (filename) + + for line in f: + comment = False + if line.startswith ("#"): + comment = True + line = line[1:] + + if line.startswith (' '): + if not reference: + print ("#%s" % line) + continue + + line = line.strip () + if not line: + continue + + fontfile, options, unicodes, glyphs_expected = line.split (":") + if fontfile.startswith ('/') or fontfile.startswith ('"/'): + fontfile, expected_hash = fontfile.split('@') + + try: + with open (fontfile, 'rb') as ff: + actual_hash = hashlib.sha1 (ff.read()).hexdigest ().strip () + if actual_hash != expected_hash: + print ('different version of %s found; Expected hash %s, got %s; skipping.' % + (fontfile, expected_hash, actual_hash)) + skips += 1 + continue + except: + print ('%s not found, skip.' % fontfile) + skips += 1 + continue + else: + cwd = os.path.dirname(filename) + fontfile = os.path.normpath (os.path.join (cwd, fontfile)) + + extra_options = ["--shaper=ot"] + if glyphs_expected != '*': + extra_options.append("--verify") + + if comment: + if not reference: + print ('# %s "%s" --unicodes %s' % (hb_shape, fontfile, unicodes)) + continue + + if not reference: + print ('%s "%s" %s %s --unicodes %s' % + (hb_shape, fontfile, ' '.join(extra_options), options, unicodes)) + + # hack to support fonts with space on run-tests.py, after several other tries... + if ' ' in fontfile: + new_fontfile = os.path.join (tempfile.gettempdir (), 'tmpfile') + shutil.copyfile(fontfile, new_fontfile) + fontfile = new_fontfile + + glyphs1 = cmd ([hb_shape, "--font-funcs=ft", + fontfile] + extra_options + ["--unicodes", + unicodes] + (options.split (' ') if options else [])) + + glyphs2 = cmd ([hb_shape, "--font-funcs=ot", + fontfile] + extra_options + ["--unicodes", + unicodes] + (options.split (' ') if options else [])) + + if glyphs1 != glyphs2 and glyphs_expected != '*': + print ("FT funcs: " + glyphs1) # file=sys.stderr + print ("OT funcs: " + glyphs2) # file=sys.stderr + fails += 1 + else: + passes += 1 + + if reference: + print (":".join ([fontfile, options, unicodes, glyphs1])) + continue + + if glyphs1.strip() != glyphs_expected and glyphs_expected != '*': + print ("Actual: " + glyphs1) # file=sys.stderr + print ("Expected: " + glyphs_expected) # file=sys.stderr + fails += 1 + else: + passes += 1 + +if not reference: + print ("%d tests passed; %d failed; %d skipped." % (passes, fails, skips)) # file=sys.stderr + if not (fails + passes): + print ("No tests ran.") + elif not (fails + skips): + print ("All tests passed.") + +if fails: + sys.exit (1) +elif passes: + sys.exit (0) +else: + sys.exit (77) diff -Nru harfbuzz-2.5.3/.pc/py3.diff/test/subset/run-tests.py harfbuzz-2.6.2/.pc/py3.diff/test/subset/run-tests.py --- harfbuzz-2.5.3/.pc/py3.diff/test/subset/run-tests.py 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/.pc/py3.diff/test/subset/run-tests.py 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,150 @@ +#!/usr/bin/env python + +# Runs a subsetting test suite. Compares the results of subsetting via harfbuzz +# to subsetting via fonttools. + +from __future__ import print_function, division, absolute_import + +import io +from difflib import unified_diff +import os +import re +import subprocess +import sys +import tempfile + +from subset_test_suite import SubsetTestSuite + +# https://stackoverflow.com/a/377028 +def which (program): + def is_exe (fpath): + return os.path.isfile (fpath) and os.access (fpath, os.X_OK) + + fpath, _ = os.path.split (program) + if fpath: + if is_exe (program): + return program + else: + for path in os.environ["PATH"].split (os.pathsep): + exe_file = os.path.join (path, program) + if is_exe (exe_file): + return exe_file + + return None + +fonttools = which ("fonttools") +ots_sanitize = which ("ots-sanitize") + +if not fonttools: + print ("fonttools is not present, skipping test.") + sys.exit (77) + +def cmd(command): + p = subprocess.Popen ( + command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + (stdoutdata, stderrdata) = p.communicate () + print (stderrdata, end="") # file=sys.stderr + return stdoutdata, p.returncode + +def read_binary (file_path): + with open (file_path, 'rb') as f: + return f.read () + +def fail_test (test, cli_args, message): + print ('ERROR: %s' % message) + print ('Test State:') + print (' test.font_path %s' % os.path.abspath (test.font_path)) + print (' test.profile_path %s' % os.path.abspath (test.profile_path)) + print (' test.unicodes %s' % test.unicodes ()) + expected_file = os.path.join(test_suite.get_output_directory (), + test.get_font_name ()) + print (' expected_file %s' % os.path.abspath (expected_file)) + return 1 + +def run_test (test, should_check_ots): + out_file = os.path.join (tempfile.mkdtemp (), test.get_font_name () + '-subset' + test.get_font_extension ()) + cli_args = [hb_subset, + "--font-file=" + test.font_path, + "--output-file=" + out_file, + "--unicodes=%s" % test.unicodes (), + "--drop-tables+=DSIG,GPOS,GSUB,GDEF,gvar,avar,MVAR,HVAR"] + cli_args.extend (test.get_profile_flags ()) + print (' '.join (cli_args)) + _, return_code = cmd (cli_args) + + if return_code: + return fail_test (test, cli_args, "%s returned %d" % (' '.join (cli_args), return_code)) + + expected_ttx, return_code = run_ttx (os.path.join (test_suite.get_output_directory (), + test.get_font_name ())) + if return_code: + return fail_test (test, cli_args, "ttx (expected) returned %d" % (return_code)) + + actual_ttx, return_code = run_ttx (out_file) + if return_code: + return fail_test (test, cli_args, "ttx (actual) returned %d" % (return_code)) + + print ("stripping checksums.") + expected_ttx = strip_check_sum (expected_ttx) + actual_ttx = strip_check_sum (actual_ttx) + + if not actual_ttx == expected_ttx: + for line in unified_diff (expected_ttx.splitlines (1), actual_ttx.splitlines (1)): + sys.stdout.write (line) + sys.stdout.flush () + return fail_test (test, cli_args, 'ttx for expected and actual does not match.') + + if should_check_ots: + print ("Checking output with ots-sanitize.") + if not check_ots (out_file): + return fail_test (test, cli_args, 'ots for subsetted file fails.') + + return 0 + +def run_ttx (file): + print ("fonttools ttx %s" % file) + return cmd ([fonttools, "ttx", "-q", "-o-", file]) + +def strip_check_sum (ttx_string): + return re.sub ('checkSumAdjustment value=["]0x([0-9a-fA-F])+["]', + 'checkSumAdjustment value="0x00000000"', + ttx_string.decode ("utf-8"), count=1) + +def has_ots (): + if not ots_sanitize: + print("OTS is not present, skipping all ots checks.") + return False + return True + +def check_ots (path): + ots_report, returncode = cmd ([ots_sanitize, path]) + if returncode: + print("OTS Failure: %s" % ots_report); + return False + return True + +args = sys.argv[1:] +if not args or sys.argv[1].find ('hb-subset') == -1 or not os.path.exists (sys.argv[1]): + print ("First argument does not seem to point to usable hb-subset.") + sys.exit (1) +hb_subset, args = args[0], args[1:] + +if not len (args): + print ("No tests supplied.") + sys.exit (1) + +has_ots = has_ots() + +fails = 0 +for path in args: + with io.open (path, mode="r", encoding="utf-8") as f: + print ("Running tests in " + path) + test_suite = SubsetTestSuite (path, f.read ()) + for test in test_suite.tests (): + fails += run_test (test, has_ots) + +if fails != 0: + print (str (fails) + " test(s) failed.") + sys.exit(1) +else: + print ("All tests passed.") diff -Nru harfbuzz-2.5.3/.pc/py3.diff/test/subset/subset_test_suite.py harfbuzz-2.6.2/.pc/py3.diff/test/subset/subset_test_suite.py --- harfbuzz-2.5.3/.pc/py3.diff/test/subset/subset_test_suite.py 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/.pc/py3.diff/test/subset/subset_test_suite.py 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,100 @@ +#!/usr/bin/env python + +import io +import os + +# A single test in a subset test suite. Identifies a font +# a subsetting profile, and a subset to be cut. +class Test: + def __init__(self, font_path, profile_path, subset): + self.font_path = font_path + self.profile_path = profile_path + self.subset = subset + + def unicodes(self): + if self.subset == '*': + return self.subset[0] + else: + return ",".join("%X" % ord(c) for (i, c) in enumerate(self.subset)) + + def get_profile_flags(self): + with io.open(self.profile_path, mode="r", encoding="utf-8") as f: + return f.read().splitlines(); + + def get_font_name(self): + font_base_name = os.path.basename(self.font_path) + font_base_name_parts = os.path.splitext(font_base_name) + profile_name = os.path.splitext(os.path.basename(self.profile_path))[0] + + if self.unicodes() == "*": + return "%s.%s.retain-all-codepoint%s" % (font_base_name_parts[0], + profile_name, + font_base_name_parts[1]) + else: + return "%s.%s.%s%s" % (font_base_name_parts[0], + profile_name, + self.unicodes(), + font_base_name_parts[1]) + + def get_font_extension(self): + font_base_name = os.path.basename(self.font_path) + font_base_name_parts = os.path.splitext(font_base_name) + return font_base_name_parts[1] + +# A group of tests to perform on the subsetter. Each test +# Identifies a font a subsetting profile, and a subset to be cut. +class SubsetTestSuite: + + def __init__(self, test_path, definition): + self.test_path = test_path + self.fonts = [] + self.profiles = [] + self.subsets = [] + self._parse(definition) + + def get_output_directory(self): + test_name = os.path.splitext(os.path.basename(self.test_path))[0] + data_dir = os.path.join(os.path.dirname(self.test_path), "..") + + output_dir = os.path.normpath(os.path.join(data_dir, "expected", test_name)) + if not os.path.exists(output_dir): + os.mkdir(output_dir) + if not os.path.isdir(output_dir): + raise Exception("%s is not a directory." % output_dir) + + return output_dir + + def tests(self): + for font in self.fonts: + font = os.path.join(self._base_path(), "fonts", font) + for profile in self.profiles: + profile = os.path.join(self._base_path(), "profiles", profile) + for subset in self.subsets: + yield Test(font, profile, subset) + + def _base_path(self): + return os.path.dirname(os.path.dirname(self.test_path)) + + def _parse(self, definition): + destinations = { + "FONTS:": self.fonts, + "PROFILES:": self.profiles, + "SUBSETS:": self.subsets + } + + current_destination = None + for line in definition.splitlines(): + line = line.strip() + + if line.startswith("#"): + continue + + if not line: + continue + + if line in destinations: + current_destination = destinations[line] + elif current_destination is not None: + current_destination.append(line) + else: + raise Exception("Failed to parse test suite file.") diff -Nru harfbuzz-2.5.3/.pc/.quilt_patches harfbuzz-2.6.2/.pc/.quilt_patches --- harfbuzz-2.5.3/.pc/.quilt_patches 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/.pc/.quilt_patches 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1 @@ +/home/buildd/build-RECIPEBRANCHBUILD-2428898/chroot-autobuild/home/buildd/work/tree/recipe/debian/patches diff -Nru harfbuzz-2.5.3/.pc/.quilt_series harfbuzz-2.6.2/.pc/.quilt_series --- harfbuzz-2.5.3/.pc/.quilt_series 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/.pc/.quilt_series 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1 @@ +/home/buildd/build-RECIPEBRANCHBUILD-2428898/chroot-autobuild/home/buildd/work/tree/recipe/debian/patches/series diff -Nru harfbuzz-2.5.3/.pc/.version harfbuzz-2.6.2/.pc/.version --- harfbuzz-2.5.3/.pc/.version 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/.pc/.version 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1 @@ +2 diff -Nru harfbuzz-2.5.3/README harfbuzz-2.6.2/README --- harfbuzz-2.5.3/README 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/README 2019-10-26 02:02:55.000000000 +0000 @@ -1,6 +1,7 @@ [![Travis Build Status](https://travis-ci.org/harfbuzz/harfbuzz.svg?branch=master)](https://travis-ci.org/harfbuzz/harfbuzz) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/0t0flrxpstj9lb9w?svg=true&branch=master)](https://ci.appveyor.com/project/harfbuzz/harfbuzz) [![CircleCI Build Status](https://circleci.com/gh/harfbuzz/harfbuzz/tree/master.svg?style=svg)](https://circleci.com/gh/harfbuzz/harfbuzz/tree/master) +[![OSS-Fuzz Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/harfbuzz.svg)](https://oss-fuzz-build-logs.storage.googleapis.com/index.html) [![Coverity Code Health](https://img.shields.io/coverity/scan/5450.svg)](https://scan.coverity.com/projects/behdad-harfbuzz) [![Codacy Code Health](https://api.codacy.com/project/badge/Grade/f17f1708783c447488bc8dd317150eaa)](https://app.codacy.com/app/behdad/harfbuzz) [![Codecov Code Coverage](https://codecov.io/gh/harfbuzz/harfbuzz/branch/master/graph/badge.svg)](https://codecov.io/gh/harfbuzz/harfbuzz) diff -Nru harfbuzz-2.5.3/README.md harfbuzz-2.6.2/README.md --- harfbuzz-2.5.3/README.md 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/README.md 2019-10-26 02:02:55.000000000 +0000 @@ -1,6 +1,7 @@ [![Travis Build Status](https://travis-ci.org/harfbuzz/harfbuzz.svg?branch=master)](https://travis-ci.org/harfbuzz/harfbuzz) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/0t0flrxpstj9lb9w?svg=true&branch=master)](https://ci.appveyor.com/project/harfbuzz/harfbuzz) [![CircleCI Build Status](https://circleci.com/gh/harfbuzz/harfbuzz/tree/master.svg?style=svg)](https://circleci.com/gh/harfbuzz/harfbuzz/tree/master) +[![OSS-Fuzz Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/harfbuzz.svg)](https://oss-fuzz-build-logs.storage.googleapis.com/index.html) [![Coverity Code Health](https://img.shields.io/coverity/scan/5450.svg)](https://scan.coverity.com/projects/behdad-harfbuzz) [![Codacy Code Health](https://api.codacy.com/project/badge/Grade/f17f1708783c447488bc8dd317150eaa)](https://app.codacy.com/app/behdad/harfbuzz) [![Codecov Code Coverage](https://codecov.io/gh/harfbuzz/harfbuzz/branch/master/graph/badge.svg)](https://codecov.io/gh/harfbuzz/harfbuzz) diff -Nru harfbuzz-2.5.3/README.python.md harfbuzz-2.6.2/README.python.md --- harfbuzz-2.5.3/README.python.md 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/README.python.md 2019-10-26 02:02:55.000000000 +0000 @@ -6,21 +6,21 @@ sudo apt-get install libgirepository1.0-dev ``` -And then run autogen.sh (if building from git), and then: +And then run `autogen.sh` (if building from git), and then: ```bash ./configure --with-gobject --enable-introspection ``` -Make sure that gobject-introspection is enabled then in the final report. +Make sure that gobject-introspection is reported enabled then in the `configure` script output. Compile and install. -Make sure you have the installation lib dir in LD_LIBRARY_PATH, as needed +Make sure you have the installation lib dir in `LD_LIBRARY_PATH`, as needed for the linker to find the library. -Then make sure you also have GI_TYPELIB_PATH pointing to the resulting -$prefix/lib/girepository-* directory. +Then make sure you also have `GI_TYPELIB_PATH` pointing to the resulting +`$prefix/lib/girepository-*` directory. Make sure you have pygobject installed. Then check that the following import works in your Python interpreter: @@ -30,7 +30,7 @@ ``` If it does, you are ready to call HarfBuzz from Python! Congratulations. -See src/sample.py. +See [`src/sample.py`](src/sample.py). The Python API will change. Let us know on the mailing list if you are using it, and send lots of feedback. diff -Nru harfbuzz-2.5.3/src/gen-arabic-table.py harfbuzz-2.6.2/src/gen-arabic-table.py --- harfbuzz-2.5.3/src/gen-arabic-table.py 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/gen-arabic-table.py 2019-10-26 02:02:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function, division, absolute_import diff -Nru harfbuzz-2.5.3/src/gen-def.py harfbuzz-2.6.2/src/gen-def.py --- harfbuzz-2.5.3/src/gen-def.py 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/gen-def.py 2019-10-26 02:02:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function, division, absolute_import diff -Nru harfbuzz-2.5.3/src/gen-emoji-table.py harfbuzz-2.6.2/src/gen-emoji-table.py --- harfbuzz-2.5.3/src/gen-emoji-table.py 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/gen-emoji-table.py 2019-10-26 02:02:55.000000000 +0000 @@ -1,9 +1,10 @@ -#!/usr/bin/python +#!/usr/bin/python3 from __future__ import print_function, division, absolute_import import sys import os.path from collections import OrderedDict +import packTab if len (sys.argv) != 2: print("usage: ./gen-emoji-table.py emoji-data.txt", file=sys.stderr) @@ -52,14 +53,19 @@ print ('#include "hb-unicode.hh"') print () -for typ,s in ranges.items(): +for typ, s in ranges.items(): if typ != "Extended_Pictographic": continue + + arr = dict() + for start,end in s: + for i in range(start,end): + arr[i] = 1 + + sol = packTab.pack_table(arr, 0, compression=3) + code = packTab.Code('_hb_emoji') + sol.genCode(code, 'is_'+typ) + code.print_c(linkage='static inline') print() - print("static const struct hb_unicode_range_t _hb_unicode_emoji_%s_table[] =" % typ) - print("{") - for pair in sorted(s): - print(" {0x%04X, 0x%04X}," % pair) - print("};") print () print ("#endif /* HB_UNICODE_EMOJI_TABLE_HH */") diff -Nru harfbuzz-2.5.3/src/gen-indic-table.py harfbuzz-2.6.2/src/gen-indic-table.py --- harfbuzz-2.5.3/src/gen-indic-table.py 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/gen-indic-table.py 2019-10-26 02:02:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function, division, absolute_import @@ -98,6 +98,10 @@ print (" * %s" % (l.strip())) print (" */") print () +print ('#include "hb.hh"') +print () +print ('#ifndef HB_NO_OT_SHAPE') +print () print ('#include "hb-ot-shape-complex-indic.hh"') print () @@ -129,8 +133,8 @@ what_short = ["ISC", "IMC"] print ('#pragma GCC diagnostic push') print ('#pragma GCC diagnostic ignored "-Wunused-macros"') +cat_defs = [] for i in range (2): - print () vv = sorted (values[i].keys ()) for v in vv: v_no_and = v.replace ('_And_', '_') @@ -142,10 +146,17 @@ raise Exception ("Duplicate short value alias", v, all_shorts[i][s]) all_shorts[i][s] = v short[i][v] = s - print ("#define %s_%s %s_%s %s/* %3d chars; %s */" % - (what_short[i], s, what[i], v.upper (), - ' '* ((48-1 - len (what[i]) - 1 - len (v)) // 8), - values[i][v], v)) + cat_defs.append ((what_short[i] + '_' + s, what[i] + '_' + v.upper (), str (values[i][v]), v)) + +maxlen_s = max ([len (c[0]) for c in cat_defs]) +maxlen_l = max ([len (c[1]) for c in cat_defs]) +maxlen_n = max ([len (c[2]) for c in cat_defs]) +for s in what_short: + print () + for c in [c for c in cat_defs if s in c[0]]: + print ("#define %s %s /* %s chars; %s */" % + (c[0].ljust (maxlen_s), c[1].ljust (maxlen_l), c[2].rjust (maxlen_n), c[3])) +print () print ('#pragma GCC diagnostic pop') print () print ("#define _(S,M) INDIC_COMBINE_CATEGORIES (ISC_##S, IMC_##M)") @@ -245,12 +256,14 @@ print () print ("#undef _") for i in range (2): - print + print () vv = sorted (values[i].keys ()) for v in vv: print ("#undef %s_%s" % (what_short[i], short[i][v])) print () +print ('#endif') +print () print ("/* == End of generated table == */") # Maintain at least 30% occupancy in the table */ diff -Nru harfbuzz-2.5.3/src/gen-os2-unicode-ranges.py harfbuzz-2.6.2/src/gen-os2-unicode-ranges.py --- harfbuzz-2.5.3/src/gen-os2-unicode-ranges.py 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/gen-os2-unicode-ranges.py 2019-10-26 02:02:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # -*- coding: utf-8 -*- diff -Nru harfbuzz-2.5.3/src/gen-tag-table.py harfbuzz-2.6.2/src/gen-tag-table.py --- harfbuzz-2.5.3/src/gen-tag-table.py 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/gen-tag-table.py 2019-10-26 02:02:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 """Generator of the mapping from OpenType tags to BCP 47 tags and vice versa. diff -Nru harfbuzz-2.5.3/src/gen-ucd-table.py harfbuzz-2.6.2/src/gen-ucd-table.py --- harfbuzz-2.5.3/src/gen-ucd-table.py 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/gen-ucd-table.py 2019-10-26 02:02:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function, division, absolute_import @@ -6,8 +6,8 @@ import logging logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO) -if len (sys.argv) != 2: - print("usage: ./gen-ucd-table ucd.nounihan.grouped.xml", file=sys.stderr) +if len (sys.argv) not in (2, 3): + print("usage: ./gen-ucd-table ucd.nounihan.grouped.xml [/path/to/hb-common.h]", file=sys.stderr) sys.exit(1) # https://github.com/harfbuzz/packtab @@ -18,6 +18,8 @@ ucdxml = packTab.ucdxml.load_ucdxml(sys.argv[1]) ucd = packTab.ucdxml.ucdxml_get_repertoire(ucdxml) +hb_common_h = 'hb-common.h' if len (sys.argv) < 3 else sys.argv[2] + logging.info('Preparing data tables...') gc = [u['gc'] for u in ucd] @@ -68,7 +70,7 @@ sc_order = dict() sc_array = [] sc_re = re.compile(r"\b(HB_SCRIPT_[_A-Z]*).*HB_TAG [(]'(.)','(.)','(.)','(.)'[)]") -for line in open('hb-common.h'): +for line in open(hb_common_h): m = sc_re.search (line) if not m: continue name = m.group(1) diff -Nru harfbuzz-2.5.3/src/gen-use-table.py harfbuzz-2.6.2/src/gen-use-table.py --- harfbuzz-2.5.3/src/gen-use-table.py 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/gen-use-table.py 2019-10-26 02:02:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # flake8: noqa from __future__ import print_function, division, absolute_import @@ -419,6 +419,10 @@ print (" * %s" % (l.strip())) print (" */") print () +print ('#include "hb.hh"') +print () +print ('#ifndef HB_NO_OT_SHAPE') +print () print ('#include "hb-ot-shape-complex-use.hh"') print () @@ -533,6 +537,8 @@ tag = k + suf print ("#undef %s" % tag) print () +print () +print ('#endif') print ("/* == End of generated table == */") # Maintain at least 50% occupancy in the table */ diff -Nru harfbuzz-2.5.3/src/gen-vowel-constraints.py harfbuzz-2.6.2/src/gen-vowel-constraints.py --- harfbuzz-2.5.3/src/gen-vowel-constraints.py 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/gen-vowel-constraints.py 2019-10-26 02:02:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 """Generator of the function to prohibit certain vowel sequences. @@ -157,6 +157,11 @@ for line in scripts_header: print (' * %s' % line.strip ()) print (' */') + +print () +print ('#include "hb.hh"') +print () +print ('#ifndef HB_NO_OT_SHAPE') print () print ('#include "hb-ot-shape-complex-vowel-constraints.hh"') print () @@ -223,4 +228,6 @@ print ('}') print () +print () +print ('#endif') print ('/* == End of generated functions == */') diff -Nru harfbuzz-2.5.3/src/harfbuzz.cc harfbuzz-2.6.2/src/harfbuzz.cc --- harfbuzz-2.5.3/src/harfbuzz.cc 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/src/harfbuzz.cc 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,54 @@ +#include "hb-aat-layout.cc" +#include "hb-aat-map.cc" +#include "hb-blob.cc" +#include "hb-buffer-serialize.cc" +#include "hb-buffer.cc" +#include "hb-common.cc" +#include "hb-face.cc" +#include "hb-fallback-shape.cc" +#include "hb-font.cc" +#include "hb-map.cc" +#include "hb-number.cc" +#include "hb-ot-cff1-table.cc" +#include "hb-ot-cff2-table.cc" +#include "hb-ot-color.cc" +#include "hb-ot-face.cc" +#include "hb-ot-font.cc" +#include "hb-ot-layout.cc" +#include "hb-ot-map.cc" +#include "hb-ot-math.cc" +#include "hb-ot-meta.cc" +#include "hb-ot-metrics.cc" +#include "hb-ot-name.cc" +#include "hb-ot-shape-complex-arabic.cc" +#include "hb-ot-shape-complex-default.cc" +#include "hb-ot-shape-complex-hangul.cc" +#include "hb-ot-shape-complex-hebrew.cc" +#include "hb-ot-shape-complex-indic-table.cc" +#include "hb-ot-shape-complex-indic.cc" +#include "hb-ot-shape-complex-khmer.cc" +#include "hb-ot-shape-complex-myanmar.cc" +#include "hb-ot-shape-complex-thai.cc" +#include "hb-ot-shape-complex-use-table.cc" +#include "hb-ot-shape-complex-use.cc" +#include "hb-ot-shape-complex-vowel-constraints.cc" +#include "hb-ot-shape-fallback.cc" +#include "hb-ot-shape-normalize.cc" +#include "hb-ot-shape.cc" +#include "hb-ot-tag.cc" +#include "hb-ot-var.cc" +#include "hb-set.cc" +#include "hb-shape-plan.cc" +#include "hb-shape.cc" +#include "hb-shaper.cc" +#include "hb-static.cc" +#include "hb-ucd.cc" +#include "hb-unicode.cc" +#include "hb-warning.cc" +#include "hb-glib.cc" +#include "hb-ft.cc" +#include "hb-graphite2.cc" +#include "hb-uniscribe.cc" +#include "hb-gdi.cc" +#include "hb-directwrite.cc" +#include "hb-coretext.cc" diff -Nru harfbuzz-2.5.3/src/hb-aat-fdsc-table.hh harfbuzz-2.6.2/src/hb-aat-fdsc-table.hh --- harfbuzz-2.5.3/src/hb-aat-fdsc-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-aat-fdsc-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -65,7 +65,7 @@ protected: Tag tag; /* The 4-byte table tag name. */ union { - Fixed value; /* The value for the descriptor tag. */ + HBFixed value; /* The value for the descriptor tag. */ HBUINT32 nalfType; /* If the tag is `nalf`, see non_alphabetic_value_t */ } u; public: @@ -108,7 +108,7 @@ } protected: - Fixed version; /* Version number of the font descriptors + HBFixed version; /* Version number of the font descriptors * table (0x00010000 for the current version). */ LArrayOf descriptors; /* List of tagged-coordinate pairs style descriptors diff -Nru harfbuzz-2.5.3/src/hb-aat-layout-bsln-table.hh harfbuzz-2.6.2/src/hb-aat-layout-bsln-table.hh --- harfbuzz-2.5.3/src/hb-aat-layout-bsln-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-aat-layout-bsln-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -82,7 +82,7 @@ } protected: - GlyphID stdGlyph; /* The specific glyph index number in this + HBGlyphID stdGlyph; /* The specific glyph index number in this * font that is used to set the baseline values. * This is the standard glyph. * This glyph must contain a set of control points @@ -105,7 +105,7 @@ } protected: - GlyphID stdGlyph; /* ditto */ + HBGlyphID stdGlyph; /* ditto */ HBUINT16 ctlPoints[32]; /* ditto */ Lookup lookupTable; /* Lookup table that maps glyphs to their diff -Nru harfbuzz-2.5.3/src/hb-aat-layout.cc harfbuzz-2.6.2/src/hb-aat-layout.cc --- harfbuzz-2.5.3/src/hb-aat-layout.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-aat-layout.cc 2019-10-26 02:02:55.000000000 +0000 @@ -75,9 +75,6 @@ #endif -#ifndef HB_NO_AAT - - /** * SECTION:hb-aat-layout * @title: hb-aat-layout @@ -88,6 +85,8 @@ **/ +#if !defined(HB_NO_AAT) || defined(HAVE_CORETEXT) + /* Table data courtesy of Apple. Converted from mnemonics to integers * when moving to this file. */ static const hb_aat_feature_mapping_t feature_mappings[] = @@ -179,7 +178,10 @@ sizeof (feature_mappings[0]), hb_aat_feature_mapping_t::cmp); } +#endif + +#ifndef HB_NO_AAT /* * mort/morx/kerx/trak diff -Nru harfbuzz-2.5.3/src/hb-aat-layout-common.hh harfbuzz-2.6.2/src/hb-aat-layout-common.hh --- harfbuzz-2.5.3/src/hb-aat-layout-common.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-aat-layout-common.hh 2019-10-26 02:02:55.000000000 +0000 @@ -93,8 +93,8 @@ return_trace (c->check_struct (this) && value.sanitize (c, base)); } - GlyphID last; /* Last GlyphID in this segment */ - GlyphID first; /* First GlyphID in this segment */ + HBGlyphID last; /* Last GlyphID in this segment */ + HBGlyphID first; /* First GlyphID in this segment */ T value; /* The lookup value (only one) */ public: DEFINE_SIZE_STATIC (4 + T::static_size); @@ -162,8 +162,8 @@ valuesZ.sanitize (c, base, last - first + 1, hb_forward (ds)...)); } - GlyphID last; /* Last GlyphID in this segment */ - GlyphID first; /* First GlyphID in this segment */ + HBGlyphID last; /* Last GlyphID in this segment */ + HBGlyphID first; /* First GlyphID in this segment */ NNOffsetTo> valuesZ; /* A 16-bit offset from the start of * the table to the data. */ @@ -222,7 +222,7 @@ return_trace (c->check_struct (this) && value.sanitize (c, base)); } - GlyphID glyph; /* Last GlyphID */ + HBGlyphID glyph; /* Last GlyphID */ T value; /* The lookup value (only one) */ public: DEFINE_SIZE_STATIC (2 + T::static_size); @@ -284,7 +284,7 @@ protected: HBUINT16 format; /* Format identifier--format = 8 */ - GlyphID firstGlyph; /* First glyph index included in the trimmed array. */ + HBGlyphID firstGlyph; /* First glyph index included in the trimmed array. */ HBUINT16 glyphCount; /* Total number of glyphs (equivalent to the last * glyph minus the value of firstGlyph plus 1). */ UnsizedArrayOf @@ -326,7 +326,7 @@ protected: HBUINT16 format; /* Format identifier--format = 8 */ HBUINT16 valueSize; /* Byte size of each value. */ - GlyphID firstGlyph; /* First glyph index included in the trimmed array. */ + HBGlyphID firstGlyph; /* First glyph index included in the trimmed array. */ HBUINT16 glyphCount; /* Total number of glyphs (equivalent to the last * glyph minus the value of firstGlyph plus 1). */ UnsizedArrayOf @@ -658,7 +658,7 @@ return_trace (c->check_struct (this) && classArray.sanitize (c)); } protected: - GlyphID firstGlyph; /* First glyph index included in the trimmed array. */ + HBGlyphID firstGlyph; /* First glyph index included in the trimmed array. */ ArrayOf classArray; /* The class codes (indexed by glyph index minus * firstGlyph). */ public: @@ -678,7 +678,7 @@ const void *base, const T *array) { - return (offset - ((const char *) array - (const char *) base)) / sizeof (T); + return (offset - ((const char *) array - (const char *) base)) / T::static_size; } template static unsigned int byteOffsetToIndex (unsigned int offset, diff -Nru harfbuzz-2.5.3/src/hb-aat-layout-feat-table.hh harfbuzz-2.6.2/src/hb-aat-layout-feat-table.hh --- harfbuzz-2.5.3/src/hb-aat-layout-feat-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-aat-layout-feat-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -47,17 +47,16 @@ hb_aat_layout_feature_selector_t get_selector () const { return (hb_aat_layout_feature_selector_t) (unsigned) setting; } - void get_info (hb_aat_layout_feature_selector_info_t *s, - hb_aat_layout_feature_selector_t default_selector) const + hb_aat_layout_feature_selector_info_t get_info (hb_aat_layout_feature_selector_t default_selector) const { - s->name_id = nameIndex; - - s->enable = (hb_aat_layout_feature_selector_t) (unsigned int) setting; - s->disable = default_selector == HB_AAT_LAYOUT_FEATURE_SELECTOR_INVALID ? - (hb_aat_layout_feature_selector_t) (s->enable + 1) : - default_selector; - - s->reserved = 0; + return { + nameIndex, + (hb_aat_layout_feature_selector_t) (unsigned int) setting, + default_selector == HB_AAT_LAYOUT_FEATURE_SELECTOR_INVALID + ? (hb_aat_layout_feature_selector_t) (setting + 1) + : default_selector, + 0 + }; } bool sanitize (hb_sanitize_context_t *c) const @@ -117,9 +116,10 @@ if (selectors_count) { - hb_array_t arr = settings_table.sub_array (start_offset, selectors_count); - for (unsigned int i = 0; i < arr.length; i++) - settings_table[start_offset + i].get_info (&selectors[i], default_selector); + + settings_table.sub_array (start_offset, selectors_count) + | hb_map ([=] (const SettingName& setting) { return setting.get_info (default_selector); }) + | hb_sink (hb_array (selectors, *selectors_count)) + ; } return settings_table.length; } @@ -162,21 +162,18 @@ unsigned int *count, hb_aat_layout_feature_type_t *features) const { - unsigned int feature_count = featureNameCount; - if (count && *count) + if (count) { - unsigned int len = hb_min (feature_count - start_offset, *count); - for (unsigned int i = 0; i < len; i++) - features[i] = namesZ[i + start_offset].get_feature_type (); - *count = len; + + namesZ.as_array (featureNameCount).sub_array (start_offset, count) + | hb_map (&FeatureName::get_feature_type) + | hb_sink (hb_array (features, *count)) + ; } return featureNameCount; } const FeatureName& get_feature (hb_aat_layout_feature_type_t feature_type) const - { - return namesZ.bsearch (featureNameCount, feature_type); - } + { return namesZ.bsearch (featureNameCount, feature_type); } hb_ot_name_id_t get_feature_name_id (hb_aat_layout_feature_type_t feature) const { return get_feature (feature).get_feature_name_id (); } @@ -209,7 +206,7 @@ SortedUnsizedArrayOf namesZ; /* The feature name array. */ public: - DEFINE_SIZE_STATIC (24); + DEFINE_SIZE_ARRAY (12, namesZ); }; } /* namespace AAT */ diff -Nru harfbuzz-2.5.3/src/hb-aat-layout.h harfbuzz-2.6.2/src/hb-aat-layout.h --- harfbuzz-2.5.3/src/hb-aat-layout.h 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-aat-layout.h 2019-10-26 02:02:55.000000000 +0000 @@ -85,7 +85,7 @@ HB_AAT_LAYOUT_FEATURE_TYPE_LANGUAGE_TAG_TYPE = 39, HB_AAT_LAYOUT_FEATURE_TYPE_CJK_ROMAN_SPACING_TYPE = 103, - _HB_AAT_LAYOUT_FEATURE_TYPE_MAX_VALUE= 0x7FFFFFFFu, /*< skip >*/ + _HB_AAT_LAYOUT_FEATURE_TYPE_MAX_VALUE = HB_TAG_MAX_SIGNED /*< skip >*/ } hb_aat_layout_feature_type_t; /** @@ -424,7 +424,7 @@ HB_AAT_LAYOUT_FEATURE_SELECTOR_DEFAULT_CJK_ROMAN = 2, HB_AAT_LAYOUT_FEATURE_SELECTOR_FULL_WIDTH_CJK_ROMAN = 3, - _HB_AAT_LAYOUT_FEATURE_SELECTOR_MAX_VALUE= 0x7FFFFFFFu, /*< skip >*/ + _HB_AAT_LAYOUT_FEATURE_SELECTOR_MAX_VALUE = HB_TAG_MAX_SIGNED /*< skip >*/ } hb_aat_layout_feature_selector_t; HB_EXTERN unsigned int diff -Nru harfbuzz-2.5.3/src/hb-aat-layout-just-table.hh harfbuzz-2.6.2/src/hb-aat-layout-just-table.hh --- harfbuzz-2.5.3/src/hb-aat-layout-just-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-aat-layout-just-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -70,9 +70,9 @@ ActionSubrecordHeader header; - Fixed lowerLimit; /* If the distance factor is less than this value, + HBFixed lowerLimit; /* If the distance factor is less than this value, * then the ligature is decomposed. */ - Fixed upperLimit; /* If the distance factor is greater than this value, + HBFixed upperLimit; /* If the distance factor is greater than this value, * then the ligature is decomposed. */ HBUINT16 order; /* Numerical order in which this ligature will * be decomposed; you may want infrequent ligatures @@ -100,7 +100,7 @@ protected: ActionSubrecordHeader header; - GlyphID addGlyph; /* Glyph that should be added if the distance factor + HBGlyphID addGlyph; /* Glyph that should be added if the distance factor * is growing. */ public: @@ -118,14 +118,14 @@ protected: ActionSubrecordHeader header; - Fixed substThreshold; /* Distance growth factor (in ems) at which + HBFixed substThreshold; /* Distance growth factor (in ems) at which * this glyph is replaced and the growth factor * recalculated. */ - GlyphID addGlyph; /* Glyph to be added as kashida. If this value is + HBGlyphID addGlyph; /* Glyph to be added as kashida. If this value is * 0xFFFF, no extra glyph will be added. Note that * generally when a glyph is added, justification * will need to be redone. */ - GlyphID substGlyph; /* Glyph to be substituted for this glyph if the + HBGlyphID substGlyph; /* Glyph to be substituted for this glyph if the * growth factor equals or exceeds the value of * substThreshold. */ public: @@ -146,13 +146,13 @@ HBUINT32 variationAxis; /* The 4-byte tag identifying the ductile axis. * This would normally be 0x64756374 ('duct'), * but you may use any axis the font contains. */ - Fixed minimumLimit; /* The lowest value for the ductility axis tha + HBFixed minimumLimit; /* The lowest value for the ductility axis tha * still yields an acceptable appearance. Normally * this will be 1.0. */ - Fixed noStretchValue; /* This is the default value that corresponds to + HBFixed noStretchValue; /* This is the default value that corresponds to * no change in appearance. Normally, this will * be 1.0. */ - Fixed maximumLimit; /* The highest value for the ductility axis that + HBFixed maximumLimit; /* The highest value for the ductility axis that * still yields an acceptable appearance. */ public: DEFINE_SIZE_STATIC (22); @@ -170,7 +170,7 @@ ActionSubrecordHeader header; HBUINT16 flags; /* Currently unused; set to 0. */ - GlyphID glyph; /* Glyph that should be added if the distance factor + HBGlyphID glyph; /* Glyph that should be added if the distance factor * is growing. */ public: DEFINE_SIZE_STATIC (10); @@ -271,14 +271,14 @@ }; protected: - Fixed beforeGrowLimit;/* The ratio by which the advance width of the + HBFixed beforeGrowLimit;/* The ratio by which the advance width of the * glyph is permitted to grow on the left or top side. */ - Fixed beforeShrinkLimit; + HBFixed beforeShrinkLimit; /* The ratio by which the advance width of the * glyph is permitted to shrink on the left or top side. */ - Fixed afterGrowLimit; /* The ratio by which the advance width of the glyph + HBFixed afterGrowLimit; /* The ratio by which the advance width of the glyph * is permitted to shrink on the left or top side. */ - Fixed afterShrinkLimit; + HBFixed afterShrinkLimit; /* The ratio by which the advance width of the glyph * is at most permitted to shrink on the right or * bottom side. */ diff -Nru harfbuzz-2.5.3/src/hb-aat-layout-kerx-table.hh harfbuzz-2.6.2/src/hb-aat-layout-kerx-table.hh --- harfbuzz-2.5.3/src/hb-aat-layout-kerx-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-aat-layout-kerx-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -82,8 +82,8 @@ } protected: - GlyphID left; - GlyphID right; + HBGlyphID left; + HBGlyphID right; FWORD value; public: DEFINE_SIZE_STATIC (6); @@ -392,7 +392,7 @@ const UnsizedArrayOf &arrayZ = this+array; unsigned int kern_idx = l + r; - kern_idx = Types::offsetToIndex (kern_idx, this, &arrayZ); + kern_idx = Types::offsetToIndex (kern_idx, this, arrayZ.arrayZ); const FWORD *v = &arrayZ[kern_idx]; if (unlikely (!v->sanitize (&c->sanitizer))) return 0; @@ -830,7 +830,7 @@ for (unsigned int i = 0; i < count; i++) { if (st->get_type () == 1) - return true; + return true; st = &StructAfter (*st); } return false; @@ -845,7 +845,7 @@ for (unsigned int i = 0; i < count; i++) { if (st->u.header.coverage & st->u.header.CrossStream) - return true; + return true; st = &StructAfter (*st); } return false; @@ -862,7 +862,7 @@ { if ((st->u.header.coverage & (st->u.header.Variation | st->u.header.CrossStream)) || !st->u.header.is_horizontal ()) - continue; + continue; v += st->get_kerning (left, right); st = &StructAfter (*st); } @@ -883,7 +883,7 @@ bool reverse; if (!T::Types::extended && (st->u.header.coverage & st->u.header.Variation)) - goto skip; + goto skip; if (HB_DIRECTION_IS_HORIZONTAL (c->buffer->props.direction) != st->u.header.is_horizontal ()) goto skip; @@ -897,8 +897,8 @@ if (!seenCrossStream && (st->u.header.coverage & st->u.header.CrossStream)) { - /* Attach all glyphs into a chain. */ - seenCrossStream = true; + /* Attach all glyphs into a chain. */ + seenCrossStream = true; hb_glyph_position_t *pos = c->buffer->pos; unsigned int count = c->buffer->len; for (unsigned int i = 0; i < count; i++) diff -Nru harfbuzz-2.5.3/src/hb-aat-layout-lcar-table.hh harfbuzz-2.6.2/src/hb-aat-layout-lcar-table.hh --- harfbuzz-2.5.3/src/hb-aat-layout-lcar-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-aat-layout-lcar-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -38,52 +38,121 @@ typedef ArrayOf LigCaretClassEntry; -struct lcar +struct lcarFormat0 { - static constexpr hb_tag_t tableTag = HB_AAT_TAG_lcar; + unsigned int get_lig_carets (hb_font_t *font, + hb_direction_t direction, + hb_codepoint_t glyph, + unsigned int start_offset, + unsigned int *caret_count /* IN/OUT */, + hb_position_t *caret_array /* OUT */, + const void *base) const + { + const OffsetTo* entry_offset = lookupTable.get_value (glyph, + font->face->get_num_glyphs ()); + const LigCaretClassEntry& array = entry_offset ? base+*entry_offset : Null (LigCaretClassEntry); + if (caret_count) + { + hb_array_t arr = array.sub_array (start_offset, caret_count); + for (unsigned int i = 0; i < arr.length; ++i) + caret_array[i] = font->em_scale_dir (arr[i], direction); + } + return array.len; + } + bool sanitize (hb_sanitize_context_t *c, const void *base) const + { + TRACE_SANITIZE (this); + return_trace (likely (c->check_struct (this) && lookupTable.sanitize (c, base))); + } + + protected: + Lookup> + lookupTable; /* data Lookup table associating glyphs */ + public: + DEFINE_SIZE_MIN (2); +}; + +struct lcarFormat1 +{ unsigned int get_lig_carets (hb_font_t *font, hb_direction_t direction, hb_codepoint_t glyph, unsigned int start_offset, unsigned int *caret_count /* IN/OUT */, - hb_position_t *caret_array /* OUT */) const + hb_position_t *caret_array /* OUT */, + const void *base) const { - const OffsetTo* entry_offset = lookup.get_value (glyph, - font->face->get_num_glyphs ()); - const LigCaretClassEntry& array = entry_offset ? this+*entry_offset : Null (LigCaretClassEntry); + const OffsetTo* entry_offset = lookupTable.get_value (glyph, + font->face->get_num_glyphs ()); + const LigCaretClassEntry& array = entry_offset ? base+*entry_offset : Null (LigCaretClassEntry); if (caret_count) { hb_array_t arr = array.sub_array (start_offset, caret_count); - unsigned int count = arr.length; - for (unsigned int i = 0; i < count; ++i) - switch (format) - { - case 0: caret_array[i] = font->em_scale_dir (arr[i], direction); break; - case 1: - hb_position_t x, y; - font->get_glyph_contour_point_for_origin (glyph, arr[i], direction, &x, &y); - caret_array[i] = HB_DIRECTION_IS_HORIZONTAL (direction) ? x : y; - break; - } + for (unsigned int i = 0; i < arr.length; ++i) + { + hb_position_t x = 0, y = 0; + font->get_glyph_contour_point_for_origin (glyph, arr[i], direction, &x, &y); + caret_array[i] = HB_DIRECTION_IS_HORIZONTAL (direction) ? x : y; + } } return array.len; } + bool sanitize (hb_sanitize_context_t *c, const void *base) const + { + TRACE_SANITIZE (this); + return_trace (likely (c->check_struct (this) && lookupTable.sanitize (c, base))); + } + + protected: + Lookup> + lookupTable; /* data Lookup table associating glyphs */ + public: + DEFINE_SIZE_MIN (2); +}; + +struct lcar +{ + static constexpr hb_tag_t tableTag = HB_AAT_TAG_lcar; + + unsigned int get_lig_carets (hb_font_t *font, + hb_direction_t direction, + hb_codepoint_t glyph, + unsigned int start_offset, + unsigned int *caret_count /* IN/OUT */, + hb_position_t *caret_array /* OUT */) const + { + switch (format) + { + case 0: return u.format0.get_lig_carets (font, direction, glyph, start_offset, + caret_count, caret_array, this); + case 1: return u.format1.get_lig_carets (font, direction, glyph, start_offset, + caret_count, caret_array, this); + default:if (caret_count) *caret_count = 0; return 0; + } + } + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return_trace (likely (c->check_struct (this) && - version.major == 1 && - lookup.sanitize (c, this))); + if (unlikely (!c->check_struct (this) || version.major != 1)) + return_trace (false); + + switch (format) { + case 0: return_trace (u.format0.sanitize (c, this)); + case 1: return_trace (u.format1.sanitize (c, this)); + default:return_trace (true); + } } protected: FixedVersion<>version; /* Version number of the ligature caret table */ HBUINT16 format; /* Format of the ligature caret table. */ - Lookup> - lookup; /* data Lookup table associating glyphs */ - + union { + lcarFormat0 format0; + lcarFormat0 format1; + } u; public: DEFINE_SIZE_MIN (8); }; diff -Nru harfbuzz-2.5.3/src/hb-aat-layout-morx-table.hh harfbuzz-2.6.2/src/hb-aat-layout-morx-table.hh --- harfbuzz-2.5.3/src/hb-aat-layout-morx-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-aat-layout-morx-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -226,7 +226,7 @@ hb_buffer_t *buffer = driver->buffer; if (buffer->idx == buffer->len && !mark_set) - return false; + return false; return entry.data.markIndex != 0xFFFF || entry.data.currentIndex != 0xFFFF; } @@ -238,23 +238,23 @@ /* Looks like CoreText applies neither mark nor current substitution for * end-of-text if mark was not explicitly set. */ if (buffer->idx == buffer->len && !mark_set) - return; + return; - const GlyphID *replacement; + const HBGlyphID *replacement; replacement = nullptr; if (Types::extended) { if (entry.data.markIndex != 0xFFFF) { - const Lookup &lookup = subs[entry.data.markIndex]; + const Lookup &lookup = subs[entry.data.markIndex]; replacement = lookup.get_value (buffer->info[mark].codepoint, driver->num_glyphs); } } else { unsigned int offset = entry.data.markIndex + buffer->info[mark].codepoint; - const UnsizedArrayOf &subs_old = (const UnsizedArrayOf &) subs; + const UnsizedArrayOf &subs_old = (const UnsizedArrayOf &) subs; replacement = &subs_old[Types::wordOffsetToIndex (offset, table, subs_old.arrayZ)]; if (!replacement->sanitize (&c->sanitizer) || !*replacement) replacement = nullptr; @@ -272,14 +272,14 @@ { if (entry.data.currentIndex != 0xFFFF) { - const Lookup &lookup = subs[entry.data.currentIndex]; + const Lookup &lookup = subs[entry.data.currentIndex]; replacement = lookup.get_value (buffer->info[idx].codepoint, driver->num_glyphs); } } else { unsigned int offset = entry.data.currentIndex + buffer->info[idx].codepoint; - const UnsizedArrayOf &subs_old = (const UnsizedArrayOf &) subs; + const UnsizedArrayOf &subs_old = (const UnsizedArrayOf &) subs; replacement = &subs_old[Types::wordOffsetToIndex (offset, table, subs_old.arrayZ)]; if (!replacement->sanitize (&c->sanitizer) || !*replacement) replacement = nullptr; @@ -304,7 +304,7 @@ bool mark_set; unsigned int mark; const ContextualSubtable *table; - const UnsizedOffsetListOf, HBUINT, false> &subs; + const UnsizedOffsetListOf, HBUINT, false> &subs; }; bool apply (hb_aat_apply_context_t *c) const @@ -348,7 +348,7 @@ protected: StateTable machine; - NNOffsetTo, HBUINT, false>, HBUINT> + NNOffsetTo, HBUINT, false>, HBUINT> substitutionTables; public: DEFINE_SIZE_STATIC (20); @@ -488,7 +488,7 @@ unsigned int ligature_idx = 0; unsigned int action; - do + do { if (unlikely (!cursor)) { @@ -520,7 +520,7 @@ if (action & (LigActionStore | LigActionLast)) { ligature_idx = Types::offsetToIndex (ligature_idx, table, ligature.arrayZ); - const GlyphID &ligatureData = ligature[ligature_idx]; + const HBGlyphID &ligatureData = ligature[ligature_idx]; if (unlikely (!ligatureData.sanitize (&c->sanitizer))) break; hb_codepoint_t lig = ligatureData; @@ -554,7 +554,7 @@ const LigatureSubtable *table; const UnsizedArrayOf &ligAction; const UnsizedArrayOf &component; - const UnsizedArrayOf &ligature; + const UnsizedArrayOf &ligature; unsigned int match_length; unsigned int match_positions[HB_MAX_CONTEXT_LENGTH]; }; @@ -586,7 +586,7 @@ ligAction; /* Offset to the ligature action table. */ NNOffsetTo, HBUINT> component; /* Offset to the component table. */ - NNOffsetTo, HBUINT> + NNOffsetTo, HBUINT> ligature; /* Offset to the actual ligature lists. */ public: DEFINE_SIZE_STATIC (28); @@ -606,7 +606,7 @@ unsigned int count = c->buffer->len; for (unsigned int i = 0; i < count; i++) { - const GlyphID *replacement = substitute.get_value (info[i].codepoint, num_glyphs); + const HBGlyphID *replacement = substitute.get_value (info[i].codepoint, num_glyphs); if (replacement) { info[i].codepoint = *replacement; @@ -624,7 +624,7 @@ } protected: - Lookup substitute; + Lookup substitute; public: DEFINE_SIZE_MIN (2); }; @@ -726,7 +726,7 @@ { unsigned int count = (flags & MarkedInsertCount); unsigned int start = entry.data.markedInsertIndex; - const GlyphID *glyphs = &insertionAction[start]; + const HBGlyphID *glyphs = &insertionAction[start]; if (unlikely (!c->sanitizer.check_array (glyphs, count))) count = 0; bool before = flags & MarkedInsertBefore; @@ -754,7 +754,7 @@ { unsigned int count = (flags & CurrentInsertCount) >> 5; unsigned int start = entry.data.currentInsertIndex; - const GlyphID *glyphs = &insertionAction[start]; + const HBGlyphID *glyphs = &insertionAction[start]; if (unlikely (!c->sanitizer.check_array (glyphs, count))) count = 0; bool before = flags & CurrentInsertBefore; @@ -793,7 +793,7 @@ private: hb_aat_apply_context_t *c; unsigned int mark; - const UnsizedArrayOf &insertionAction; + const UnsizedArrayOf &insertionAction; }; bool apply (hb_aat_apply_context_t *c) const @@ -819,7 +819,7 @@ protected: StateTable machine; - NNOffsetTo, HBUINT> + NNOffsetTo, HBUINT> insertionAction; /* Byte offset from stateHeader to the start of * the insertion glyph table. */ public: @@ -976,12 +976,12 @@ bool reverse; if (!(subtable->subFeatureFlags & flags)) - goto skip; + goto skip; if (!(subtable->get_coverage() & ChainSubtable::AllDirections) && HB_DIRECTION_IS_VERTICAL (c->buffer->props.direction) != bool (subtable->get_coverage() & ChainSubtable::Vertical)) - goto skip; + goto skip; /* Buffer contents is always in logical direction. Determine if * we need to reverse before applying this subtable. We reverse @@ -1016,15 +1016,15 @@ HB_DIRECTION_IS_BACKWARD (c->buffer->props.direction); if (!c->buffer->message (c->font, "start chain subtable %d", c->lookup_index)) - goto skip; + goto skip; if (reverse) - c->buffer->reverse (); + c->buffer->reverse (); subtable->apply (c); if (reverse) - c->buffer->reverse (); + c->buffer->reverse (); (void) c->buffer->message (c->font, "end chain subtable %d", c->lookup_index); @@ -1080,10 +1080,10 @@ * The 'mort'/'morx' Table */ -template +template struct mortmorx { - static constexpr hb_tag_t tableTag = HB_AAT_TAG_morx; + static constexpr hb_tag_t tableTag = TAG; bool has_data () const { return version != 0; } @@ -1143,14 +1143,8 @@ DEFINE_SIZE_MIN (8); }; -struct morx : mortmorx -{ - static constexpr hb_tag_t tableTag = HB_AAT_TAG_morx; -}; -struct mort : mortmorx -{ - static constexpr hb_tag_t tableTag = HB_AAT_TAG_mort; -}; +struct morx : mortmorx {}; +struct mort : mortmorx {}; } /* namespace AAT */ diff -Nru harfbuzz-2.5.3/src/hb-aat-layout-opbd-table.hh harfbuzz-2.6.2/src/hb-aat-layout-opbd-table.hh --- harfbuzz-2.5.3/src/hb-aat-layout-opbd-table.hh 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-aat-layout-opbd-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,173 @@ +/* + * Copyright © 2019 Ebrahim Byagowi + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#ifndef HB_AAT_LAYOUT_OPBD_TABLE_HH +#define HB_AAT_LAYOUT_OPBD_TABLE_HH + +#include "hb-aat-layout-common.hh" +#include "hb-open-type.hh" + +/* + * opbd -- Optical Bounds + * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6opbd.html + */ +#define HB_AAT_TAG_opbd HB_TAG('o','p','b','d') + + +namespace AAT { + +struct OpticalBounds +{ + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (likely (c->check_struct (this))); + } + + FWORD leftSide; + FWORD topSide; + FWORD rightSide; + FWORD bottomSide; + public: + DEFINE_SIZE_STATIC (8); +}; + +struct opbdFormat0 +{ + bool get_bounds (hb_font_t *font, hb_codepoint_t glyph_id, + hb_glyph_extents_t *extents, const void *base) const + { + const OffsetTo *bounds_offset = lookupTable.get_value (glyph_id, font->face->get_num_glyphs ()); + if (!bounds_offset) return false; + const OpticalBounds &bounds = base+*bounds_offset; + + if (extents) + *extents = { + font->em_scale_x (bounds.leftSide), + font->em_scale_y (bounds.topSide), + font->em_scale_x (bounds.rightSide), + font->em_scale_y (bounds.bottomSide) + }; + return true; + } + + bool sanitize (hb_sanitize_context_t *c, const void *base) const + { + TRACE_SANITIZE (this); + return_trace (likely (c->check_struct (this) && lookupTable.sanitize (c, base))); + } + + protected: + Lookup> + lookupTable; /* Lookup table associating glyphs with the four + * int16 values for the left-side, top-side, + * right-side, and bottom-side optical bounds. */ + public: + DEFINE_SIZE_MIN (2); +}; + +struct opbdFormat1 +{ + bool get_bounds (hb_font_t *font, hb_codepoint_t glyph_id, + hb_glyph_extents_t *extents, const void *base) const + { + const OffsetTo *bounds_offset = lookupTable.get_value (glyph_id, font->face->get_num_glyphs ()); + if (!bounds_offset) return false; + const OpticalBounds &bounds = base+*bounds_offset; + + hb_position_t left = 0, top = 0, right = 0, bottom = 0, ignore; + if (font->get_glyph_contour_point (glyph_id, bounds.leftSide, &left, &ignore) || + font->get_glyph_contour_point (glyph_id, bounds.topSide, &ignore, &top) || + font->get_glyph_contour_point (glyph_id, bounds.rightSide, &right, &ignore) || + font->get_glyph_contour_point (glyph_id, bounds.bottomSide, &ignore, &bottom)) + { + if (extents) + *extents = {left, top, right, bottom}; + return true; + } + return false; + } + + bool sanitize (hb_sanitize_context_t *c, const void *base) const + { + TRACE_SANITIZE (this); + return_trace (likely (c->check_struct (this) && lookupTable.sanitize (c, base))); + } + + protected: + Lookup> + lookupTable; /* Lookup table associating glyphs with the four + * int16 values for the left-side, top-side, + * right-side, and bottom-side optical bounds. */ + public: + DEFINE_SIZE_MIN (2); +}; + +struct opbd +{ + static constexpr hb_tag_t tableTag = HB_AAT_TAG_opbd; + + bool get_bounds (hb_font_t *font, hb_codepoint_t glyph_id, + hb_glyph_extents_t *extents) const + { + switch (format) + { + case 0: return u.format0.get_bounds (font, glyph_id, extents, this); + case 1: return u.format1.get_bounds (font, glyph_id, extents, this); + default:return false; + } + } + + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + if (unlikely (!c->check_struct (this) || version.major != 1)) + return_trace (false); + + switch (format) + { + case 0: return_trace (u.format0.sanitize (c, this)); + case 1: return_trace (u.format1.sanitize (c, this)); + default:return_trace (true); + } + } + + protected: + FixedVersion<>version; /* Version number of the optical bounds + * table (0x00010000 for the current version). */ + HBUINT16 format; /* Format of the optical bounds table. + * Format 0 indicates distance and Format 1 indicates + * control point. */ + union { + opbdFormat0 format0; + opbdFormat1 format1; + } u; + public: + DEFINE_SIZE_MIN (8); +}; + +} /* namespace AAT */ + + +#endif /* HB_AAT_LAYOUT_OPBD_TABLE_HH */ diff -Nru harfbuzz-2.5.3/src/hb-aat-layout-trak-table.hh harfbuzz-2.6.2/src/hb-aat-layout-trak-table.hh --- harfbuzz-2.5.3/src/hb-aat-layout-trak-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-aat-layout-trak-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -62,7 +62,7 @@ } protected: - Fixed track; /* Track value for this record. */ + HBFixed track; /* Track value for this record. */ NameID trackNameID; /* The 'name' table index for this track. * (a short word or phrase like "loose" * or "very tight") */ @@ -82,7 +82,7 @@ const void *base) const { unsigned int sizes = nSizes; - hb_array_t size_table ((base+sizeTable).arrayZ, sizes); + hb_array_t size_table ((base+sizeTable).arrayZ, sizes); float s0 = size_table[idx].to_float (); float s1 = size_table[idx + 1].to_float (); @@ -93,13 +93,6 @@ int get_tracking (const void *base, float ptem) const { - /* CoreText points are CSS pixels (96 per inch), - * NOT typographic points (72 per inch). - * - * https://developer.apple.com/library/content/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html - */ - float csspx = ptem * 96.f / 72.f; - /* * Choose track. */ @@ -127,13 +120,13 @@ if (!sizes) return 0.; if (sizes == 1) return trackTableEntry->get_value (base, 0, sizes); - hb_array_t size_table ((base+sizeTable).arrayZ, sizes); + hb_array_t size_table ((base+sizeTable).arrayZ, sizes); unsigned int size_index; for (size_index = 0; size_index < sizes - 1; size_index++) - if (size_table[size_index].to_float () >= csspx) - break; + if (size_table[size_index].to_float () >= ptem) + break; - return roundf (interpolate_at (size_index ? size_index - 1 : 0, csspx, + return roundf (interpolate_at (size_index ? size_index - 1 : 0, ptem, *trackTableEntry, base)); } @@ -148,7 +141,7 @@ protected: HBUINT16 nTracks; /* Number of separate tracks included in this table. */ HBUINT16 nSizes; /* Number of point sizes included in this table. */ - LOffsetTo, false> + LOffsetTo, false> sizeTable; /* Offset from start of the tracking table to * Array[nSizes] of size values.. */ UnsizedArrayOf @@ -183,7 +176,7 @@ hb_position_t advance_to_add = c->font->em_scalef_x (tracking); foreach_grapheme (buffer, start, end) { - if (!(buffer->info[start].mask & trak_mask)) continue; + if (!(buffer->info[start].mask & trak_mask)) continue; buffer->pos[start].x_advance += advance_to_add; buffer->pos[start].x_offset += offset_to_add; } @@ -196,7 +189,7 @@ hb_position_t advance_to_add = c->font->em_scalef_y (tracking); foreach_grapheme (buffer, start, end) { - if (!(buffer->info[start].mask & trak_mask)) continue; + if (!(buffer->info[start].mask & trak_mask)) continue; buffer->pos[start].y_advance += advance_to_add; buffer->pos[start].y_offset += offset_to_add; } diff -Nru harfbuzz-2.5.3/src/hb-aat-map.cc harfbuzz-2.6.2/src/hb-aat-map.cc --- harfbuzz-2.5.3/src/hb-aat-map.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-aat-map.cc 2019-10-26 02:02:55.000000000 +0000 @@ -28,7 +28,7 @@ #include "hb.hh" -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE #include "hb-aat-map.hh" diff -Nru harfbuzz-2.5.3/src/hb-algs.hh harfbuzz-2.6.2/src/hb-algs.hh --- harfbuzz-2.5.3/src/hb-algs.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-algs.hh 2019-10-26 02:02:55.000000000 +0000 @@ -32,6 +32,7 @@ #include "hb.hh" #include "hb-meta.hh" #include "hb-null.hh" +#include "hb-number.hh" /* Encodes three unsigned integers in one 64-bit number. If the inputs have more than 21 bits, @@ -50,31 +51,31 @@ struct { /* Note. This is dangerous in that if it's passed an rvalue, it returns rvalue-reference. */ - template auto + template constexpr auto operator () (T&& v) const HB_AUTO_RETURN ( hb_forward (v) ) } HB_FUNCOBJ (hb_identity); struct { /* Like identity(), but only retains lvalue-references. Rvalues are returned as rvalues. */ - template T& + template constexpr T& operator () (T& v) const { return v; } - template hb_remove_reference + template constexpr hb_remove_reference operator () (T&& v) const { return v; } } HB_FUNCOBJ (hb_lidentity); struct { /* Like identity(), but always returns rvalue. */ - template hb_remove_reference + template constexpr hb_remove_reference operator () (T&& v) const { return v; } } HB_FUNCOBJ (hb_ridentity); struct { - template bool + template constexpr bool operator () (T&& v) const { return bool (hb_forward (v)); } } HB_FUNCOBJ (hb_bool); @@ -82,11 +83,12 @@ struct { private: - template auto + + template constexpr auto impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, hb_deref (v).hash ()) template auto + hb_enable_if (hb_is_integral (T))> constexpr auto impl (const T& v, hb_priority<0>) const HB_AUTO_RETURN ( /* Knuth's multiplicative method: */ @@ -95,7 +97,7 @@ public: - template auto + template constexpr auto operator () (const T& v) const HB_RETURN (uint32_t, impl (v, hb_prioritize)) } HB_FUNCOBJ (hb_hash); @@ -328,14 +330,14 @@ struct { - template typename Pair::first_t + template constexpr typename Pair::first_t operator () (const Pair& pair) const { return pair.first; } } HB_FUNCOBJ (hb_first); struct { - template typename Pair::second_t + template constexpr typename Pair::second_t operator () (const Pair& pair) const { return pair.second; } } HB_FUNCOBJ (hb_second); @@ -346,14 +348,14 @@ * comparing integers of different signedness. */ struct { - template auto + template constexpr auto operator () (T&& a, T2&& b) const HB_AUTO_RETURN (hb_forward (a) <= hb_forward (b) ? hb_forward (a) : hb_forward (b)) } HB_FUNCOBJ (hb_min); struct { - template auto + template constexpr auto operator () (T&& a, T2&& b) const HB_AUTO_RETURN (hb_forward (a) >= hb_forward (b) ? hb_forward (a) : hb_forward (b)) } @@ -895,17 +897,12 @@ static inline hb_bool_t hb_codepoint_parse (const char *s, unsigned int len, int base, hb_codepoint_t *out) { - /* Pain because we don't know whether s is nul-terminated. */ - char buf[64]; - len = hb_min (ARRAY_LENGTH (buf) - 1, len); - strncpy (buf, s, len); - buf[len] = '\0'; - - char *end; - errno = 0; - unsigned long v = strtoul (buf, &end, base); - if (errno) return false; - if (*end) return false; + unsigned int v; + const char *p = s; + const char *end = p + len; + if (unlikely (!hb_parse_uint (&p, end, &v, true/* whole buffer */, base))) + return false; + *out = v; return true; } @@ -917,7 +914,7 @@ { HB_PARTIALIZE(2); static constexpr bool passthru_left = false; static constexpr bool passthru_right = false; - template auto + template constexpr auto operator () (const T &a, const T &b) const HB_AUTO_RETURN (a & b) } HB_FUNCOBJ (hb_bitwise_and); @@ -925,7 +922,7 @@ { HB_PARTIALIZE(2); static constexpr bool passthru_left = true; static constexpr bool passthru_right = true; - template auto + template constexpr auto operator () (const T &a, const T &b) const HB_AUTO_RETURN (a | b) } HB_FUNCOBJ (hb_bitwise_or); @@ -933,7 +930,7 @@ { HB_PARTIALIZE(2); static constexpr bool passthru_left = true; static constexpr bool passthru_right = true; - template auto + template constexpr auto operator () (const T &a, const T &b) const HB_AUTO_RETURN (a ^ b) } HB_FUNCOBJ (hb_bitwise_xor); @@ -941,59 +938,71 @@ { HB_PARTIALIZE(2); static constexpr bool passthru_left = true; static constexpr bool passthru_right = false; - template auto + template constexpr auto operator () (const T &a, const T &b) const HB_AUTO_RETURN (a & ~b) } HB_FUNCOBJ (hb_bitwise_sub); struct { - template auto + template constexpr auto operator () (const T &a) const HB_AUTO_RETURN (~a) } HB_FUNCOBJ (hb_bitwise_neg); struct { HB_PARTIALIZE(2); - template auto + template constexpr auto operator () (const T &a, const T2 &b) const HB_AUTO_RETURN (a + b) } HB_FUNCOBJ (hb_add); struct { HB_PARTIALIZE(2); - template auto + template constexpr auto operator () (const T &a, const T2 &b) const HB_AUTO_RETURN (a - b) } HB_FUNCOBJ (hb_sub); struct { HB_PARTIALIZE(2); - template auto + template constexpr auto operator () (const T &a, const T2 &b) const HB_AUTO_RETURN (a * b) } HB_FUNCOBJ (hb_mul); struct { HB_PARTIALIZE(2); - template auto + template constexpr auto operator () (const T &a, const T2 &b) const HB_AUTO_RETURN (a / b) } HB_FUNCOBJ (hb_div); struct { HB_PARTIALIZE(2); - template auto + template constexpr auto operator () (const T &a, const T2 &b) const HB_AUTO_RETURN (a % b) } HB_FUNCOBJ (hb_mod); struct { - template auto + template constexpr auto operator () (const T &a) const HB_AUTO_RETURN (+a) } HB_FUNCOBJ (hb_pos); struct { - template auto + template constexpr auto operator () (const T &a) const HB_AUTO_RETURN (-a) } HB_FUNCOBJ (hb_neg); +struct +{ + template constexpr auto + operator () (T &a) const HB_AUTO_RETURN (++a) +} +HB_FUNCOBJ (hb_inc); +struct +{ + template constexpr auto + operator () (T &a) const HB_AUTO_RETURN (--a) +} +HB_FUNCOBJ (hb_dec); /* Compiler-assisted vectorization. */ diff -Nru harfbuzz-2.5.3/src/hb-array.hh harfbuzz-2.6.2/src/hb-array.hh --- harfbuzz-2.5.3/src/hb-array.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-array.hh 2019-10-26 02:02:55.000000000 +0000 @@ -50,7 +50,7 @@ template hb_array_t (const hb_array_t &o) : - hb_iter_with_fallback_t, Type&> (), + hb_iter_with_fallback_t (), arrayZ (o.arrayZ), length (o.length), backwards_length (o.backwards_length) {} template @@ -106,7 +106,7 @@ */ /* Note: our compare is NOT lexicographic; it also does NOT call Type::cmp. */ - int cmp (const hb_array_t &a) const + int cmp (const hb_array_t &a) const { if (length != a.length) return (int) a.length - (int) length; @@ -114,8 +114,8 @@ } HB_INTERNAL static int cmp (const void *pa, const void *pb) { - hb_array_t *a = (hb_array_t *) pa; - hb_array_t *b = (hb_array_t *) pb; + hb_array_t *a = (hb_array_t *) pa; + hb_array_t *b = (hb_array_t *) pb; return b->cmp (*a); } @@ -141,13 +141,13 @@ hb_sorted_array_t qsort (int (*cmp_)(const void*, const void*)) { if (likely (length)) - hb_qsort (arrayZ, length, this->item_size, cmp_); + hb_qsort (arrayZ, length, this->get_item_size (), cmp_); return hb_sorted_array_t (*this); } hb_sorted_array_t qsort () { if (likely (length)) - hb_qsort (arrayZ, length, this->item_size, Type::cmp); + hb_qsort (arrayZ, length, this->get_item_size (), Type::cmp); return hb_sorted_array_t (*this); } void qsort (unsigned int start, unsigned int end) @@ -155,16 +155,16 @@ end = hb_min (end, length); assert (start <= end); if (likely (start < end)) - hb_qsort (arrayZ + start, end - start, this->item_size, Type::cmp); + hb_qsort (arrayZ + start, end - start, this->get_item_size (), Type::cmp); } /* * Other methods. */ - unsigned int get_size () const { return length * this->item_size; } + unsigned int get_size () const { return length * this->get_item_size (); } - hb_array_t sub_array (unsigned int start_offset = 0, unsigned int *seg_count = nullptr /* IN/OUT */) const + hb_array_t sub_array (unsigned int start_offset = 0, unsigned int *seg_count = nullptr /* IN/OUT */) const { if (!start_offset && !seg_count) return *this; @@ -176,11 +176,19 @@ count -= start_offset; if (seg_count) count = *seg_count = hb_min (count, *seg_count); - return hb_array_t (arrayZ + start_offset, count); + return hb_array_t (arrayZ + start_offset, count); } - hb_array_t sub_array (unsigned int start_offset, unsigned int seg_count) const + hb_array_t sub_array (unsigned int start_offset, unsigned int seg_count) const { return sub_array (start_offset, &seg_count); } + hb_array_t truncate (unsigned length) const { return sub_array (0, length); } + + template + const T *as () const + { return length < hb_null_size (T) ? &Null (T) : reinterpret_cast (arrayZ); } + /* Only call if you allocated the underlying array using malloc() or similar. */ void free () { ::free ((void *) arrayZ); arrayZ = nullptr; length = 0; } @@ -228,7 +236,7 @@ hb_iter_t, Type&>, hb_array_t { - typedef hb_iter_t, Type&> iter_base_t; + typedef hb_iter_t iter_base_t; HB_ITER_USING (iter_base_t); static constexpr bool is_random_access_iterator = true; static constexpr bool is_sorted_iterator = true; @@ -241,7 +249,7 @@ template hb_sorted_array_t (const hb_array_t &o) : - hb_iter_t, Type&> (), + hb_iter_t (), hb_array_t (o) {} template @@ -252,11 +260,13 @@ bool operator != (const hb_sorted_array_t& o) const { return this->arrayZ != o.arrayZ || this->length != o.length; } - hb_sorted_array_t sub_array (unsigned int start_offset, unsigned int *seg_count /* IN/OUT */) const - { return hb_sorted_array_t (((const hb_array_t *) (this))->sub_array (start_offset, seg_count)); } - hb_sorted_array_t sub_array (unsigned int start_offset, unsigned int seg_count) const + hb_sorted_array_t sub_array (unsigned int start_offset, unsigned int *seg_count /* IN/OUT */) const + { return hb_sorted_array_t (((const hb_array_t *) (this))->sub_array (start_offset, seg_count)); } + hb_sorted_array_t sub_array (unsigned int start_offset, unsigned int seg_count) const { return sub_array (start_offset, &seg_count); } + hb_sorted_array_t truncate (unsigned length) const { return sub_array (0, length); } + template Type *bsearch (const T &x, Type *not_found = nullptr) { @@ -281,9 +291,9 @@ int mid = ((unsigned int) min + (unsigned int) max) / 2; int c = array[mid].cmp (x); if (c < 0) - max = mid - 1; + max = mid - 1; else if (c > 0) - min = mid + 1; + min = mid + 1; else { if (i) diff -Nru harfbuzz-2.5.3/src/hb-bimap.hh harfbuzz-2.6.2/src/hb-bimap.hh --- harfbuzz-2.5.3/src/hb-bimap.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-bimap.hh 2019-10-26 02:02:55.000000000 +0000 @@ -28,6 +28,7 @@ #define HB_BIMAP_HH #include "hb.hh" +#include "hb-map.hh" /* Bi-directional map */ struct hb_bimap_t @@ -57,6 +58,8 @@ void set (hb_codepoint_t lhs, hb_codepoint_t rhs) { + if (unlikely (lhs == HB_MAP_VALUE_INVALID)) return; + if (unlikely (rhs == HB_MAP_VALUE_INVALID)) { del (lhs); return; } forw_map.set (lhs, rhs); back_map.set (rhs, lhs); } @@ -131,6 +134,7 @@ work.qsort (cmp_id); + clear (); for (hb_codepoint_t rhs = 0; rhs < count; rhs++) set (work[rhs], rhs); } diff -Nru harfbuzz-2.5.3/src/hb-blob.cc harfbuzz-2.6.2/src/hb-blob.cc --- harfbuzz-2.5.3/src/hb-blob.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-blob.cc 2019-10-26 02:02:55.000000000 +0000 @@ -48,7 +48,6 @@ #endif /* HAVE_SYS_MMAN_H */ #include -#include #include @@ -592,7 +591,7 @@ ceparams.lpSecurityAttributes = nullptr; ceparams.hTemplateFile = nullptr; fd = CreateFile2 (wchar_file_name, GENERIC_READ, FILE_SHARE_READ, - OPEN_EXISTING, &ceparams); + OPEN_EXISTING, &ceparams); } #else fd = CreateFileW (wchar_file_name, GENERIC_READ, FILE_SHARE_READ, nullptr, @@ -669,7 +668,7 @@ } return hb_blob_create (data, len, HB_MEMORY_MODE_WRITABLE, data, - (hb_destroy_func_t) free); + (hb_destroy_func_t) free); fread_fail: fclose (fp); diff -Nru harfbuzz-2.5.3/src/hb-blob.hh harfbuzz-2.6.2/src/hb-blob.hh --- harfbuzz-2.5.3/src/hb-blob.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-blob.hh 2019-10-26 02:02:55.000000000 +0000 @@ -54,13 +54,9 @@ HB_INTERNAL bool try_make_writable_inplace (); HB_INTERNAL bool try_make_writable_inplace_unix (); + hb_bytes_t as_bytes () const { return hb_bytes_t (data, length); } template - const Type* as () const - { - return length < hb_null_size (Type) ? &Null(Type) : reinterpret_cast (data); - } - hb_bytes_t as_bytes () const - { return hb_bytes_t (data, length); } + const Type* as () const { return as_bytes ().as (); } public: hb_object_header_t header; diff -Nru harfbuzz-2.5.3/src/hb-buffer.cc harfbuzz-2.6.2/src/hb-buffer.cc --- harfbuzz-2.5.3/src/hb-buffer.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-buffer.cc 2019-10-26 02:02:55.000000000 +0000 @@ -324,7 +324,8 @@ out_len = 0; out_info = info; - memset (pos, 0, sizeof (pos[0]) * len); + if (likely (len)) + memset (pos, 0, sizeof (pos[0]) * len); } void @@ -648,8 +649,8 @@ if (likely (script != HB_SCRIPT_COMMON && script != HB_SCRIPT_INHERITED && script != HB_SCRIPT_UNKNOWN)) { - props.script = script; - break; + props.script = script; + break; } } } @@ -1388,7 +1389,7 @@ **/ hb_glyph_info_t * hb_buffer_get_glyph_infos (hb_buffer_t *buffer, - unsigned int *length) + unsigned int *length) { if (length) *length = buffer->len; @@ -1412,7 +1413,7 @@ **/ hb_glyph_position_t * hb_buffer_get_glyph_positions (hb_buffer_t *buffer, - unsigned int *length) + unsigned int *length) { if (!buffer->have_positions) buffer->clear_positions (); @@ -1936,9 +1937,9 @@ for (i = 0; i < count; i++) { if (contains && info[i].codepoint == dottedcircle_glyph) - result |= HB_BUFFER_DIFF_FLAG_DOTTED_CIRCLE_PRESENT; + result |= HB_BUFFER_DIFF_FLAG_DOTTED_CIRCLE_PRESENT; if (contains && info[i].codepoint == 0) - result |= HB_BUFFER_DIFF_FLAG_NOTDEF_PRESENT; + result |= HB_BUFFER_DIFF_FLAG_NOTDEF_PRESENT; } result |= HB_BUFFER_DIFF_FLAG_LENGTH_MISMATCH; return hb_buffer_diff_flags_t (result); @@ -1973,12 +1974,12 @@ for (unsigned int i = 0; i < count; i++) { if ((unsigned int) abs (buf_pos->x_advance - ref_pos->x_advance) > position_fuzz || - (unsigned int) abs (buf_pos->y_advance - ref_pos->y_advance) > position_fuzz || - (unsigned int) abs (buf_pos->x_offset - ref_pos->x_offset) > position_fuzz || - (unsigned int) abs (buf_pos->y_offset - ref_pos->y_offset) > position_fuzz) + (unsigned int) abs (buf_pos->y_advance - ref_pos->y_advance) > position_fuzz || + (unsigned int) abs (buf_pos->x_offset - ref_pos->x_offset) > position_fuzz || + (unsigned int) abs (buf_pos->y_offset - ref_pos->y_offset) > position_fuzz) { - result |= HB_BUFFER_DIFF_FLAG_POSITION_MISMATCH; - break; + result |= HB_BUFFER_DIFF_FLAG_POSITION_MISMATCH; + break; } buf_pos++; ref_pos++; diff -Nru harfbuzz-2.5.3/src/hb-buffer.h harfbuzz-2.6.2/src/hb-buffer.h --- harfbuzz-2.5.3/src/hb-buffer.h 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-buffer.h 2019-10-26 02:02:55.000000000 +0000 @@ -441,11 +441,11 @@ HB_EXTERN hb_glyph_info_t * hb_buffer_get_glyph_infos (hb_buffer_t *buffer, - unsigned int *length); + unsigned int *length); HB_EXTERN hb_glyph_position_t * hb_buffer_get_glyph_positions (hb_buffer_t *buffer, - unsigned int *length); + unsigned int *length); HB_EXTERN void diff -Nru harfbuzz-2.5.3/src/hb-buffer-serialize.cc harfbuzz-2.6.2/src/hb-buffer-serialize.cc --- harfbuzz-2.5.3/src/hb-buffer-serialize.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-buffer-serialize.cc 2019-10-26 02:02:55.000000000 +0000 @@ -135,7 +135,7 @@ hb_font_glyph_to_string (font, info[i].codepoint, g, sizeof (g)); *p++ = '"'; for (char *q = g; *q; q++) { - if (*q == '"') + if (*q == '"') *p++ = '\\'; *p++ = *q; } @@ -379,43 +379,24 @@ } } - -static hb_bool_t -parse_uint (const char *pp, const char *end, uint32_t *pv) +static bool +parse_int (const char *pp, const char *end, int32_t *pv) { - char buf[32]; - unsigned int len = hb_min (ARRAY_LENGTH (buf) - 1, (unsigned int) (end - pp)); - strncpy (buf, pp, len); - buf[len] = '\0'; - - char *p = buf; - char *pend = p; - uint32_t v; - - errno = 0; - v = strtol (p, &pend, 10); - if (errno || p == pend || pend - p != end - pp) + int v; + const char *p = pp; + if (unlikely (!hb_parse_int (&p, end, &v, true/* whole buffer */))) return false; *pv = v; return true; } -static hb_bool_t -parse_int (const char *pp, const char *end, int32_t *pv) +static bool +parse_uint (const char *pp, const char *end, uint32_t *pv) { - char buf[32]; - unsigned int len = hb_min (ARRAY_LENGTH (buf) - 1, (unsigned int) (end - pp)); - strncpy (buf, pp, len); - buf[len] = '\0'; - - char *p = buf; - char *pend = p; - int32_t v; - - errno = 0; - v = strtol (p, &pend, 10); - if (errno || p == pend || pend - p != end - pp) + unsigned int v; + const char *p = pp; + if (unlikely (!hb_parse_uint (&p, end, &v, true/* whole buffer */))) return false; *pv = v; diff -Nru harfbuzz-2.5.3/src/hb-cff1-interp-cs.hh harfbuzz-2.6.2/src/hb-cff1-interp-cs.hh --- harfbuzz-2.5.3/src/hb-cff1-interp-cs.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-cff1-interp-cs.hh 2019-10-26 02:02:55.000000000 +0000 @@ -40,7 +40,7 @@ template void init (const byte_str_t &str, ACC &acc, unsigned int fd) { - SUPER::init (str, *acc.globalSubrs, *acc.privateDicts[fd].localSubrs); + SUPER::init (str, acc.globalSubrs, acc.privateDicts[fd].localSubrs); processed_width = false; has_width = false; arg_start = 0; diff -Nru harfbuzz-2.5.3/src/hb-cff2-interp-cs.hh harfbuzz-2.6.2/src/hb-cff2-interp-cs.hh --- harfbuzz-2.5.3/src/hb-cff2-interp-cs.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-cff2-interp-cs.hh 2019-10-26 02:02:55.000000000 +0000 @@ -82,7 +82,7 @@ void init (const byte_str_t &str, ACC &acc, unsigned int fd, const int *coords_=nullptr, unsigned int num_coords_=0) { - SUPER::init (str, *acc.globalSubrs, *acc.privateDicts[fd].localSubrs); + SUPER::init (str, acc.globalSubrs, acc.privateDicts[fd].localSubrs); coords = coords_; num_coords = num_coords_; diff -Nru harfbuzz-2.5.3/src/hb-cff-interp-common.hh harfbuzz-2.6.2/src/hb-cff-interp-common.hh --- harfbuzz-2.5.3/src/hb-cff-interp-common.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-cff-interp-common.hh 2019-10-26 02:02:55.000000000 +0000 @@ -226,7 +226,7 @@ void set_fixed (int32_t v) { value = v / 65536.0; } int32_t to_fixed () const { return (int32_t) (value * 65536.0); } - void set_real (double v) { value = v; } + void set_real (double v) { value = v; } double to_real () const { return value; } int ceil () const { return (int) ::ceil (value); } @@ -235,17 +235,10 @@ bool in_int_range () const { return ((double) (int16_t) to_int () == value); } - bool operator > (const number_t &n) const - { return value > n.to_real (); } - - bool operator < (const number_t &n) const - { return n > *this; } - - bool operator >= (const number_t &n) const - { return !(*this < n); } - - bool operator <= (const number_t &n) const - { return !(*this > n); } + bool operator > (const number_t &n) const { return value > n.to_real (); } + bool operator < (const number_t &n) const { return n > *this; } + bool operator >= (const number_t &n) const { return !(*this < n); } + bool operator <= (const number_t &n) const { return !(*this > n); } const number_t &operator += (const number_t &n) { @@ -255,7 +248,7 @@ } protected: - double value; + double value; }; /* byte string */ @@ -308,7 +301,7 @@ : hb_ubytes_t (s, l) {} byte_str_t (const hb_ubytes_t &ub) /* conversion from hb_ubytes_t */ : hb_ubytes_t (ub) {} - + /* sub-string */ byte_str_t sub_str (unsigned int offset, unsigned int len_) const { return byte_str_t (hb_ubytes_t::sub_array (offset, len_)); } @@ -320,8 +313,7 @@ /* A byte string associated with the current offset and an error condition */ struct byte_str_ref_t { - byte_str_ref_t () - { init (); } + byte_str_ref_t () { init (); } void init () { @@ -343,13 +335,12 @@ } const unsigned char& operator [] (int i) { - if (unlikely ((unsigned int)(offset + i) >= str.length)) + if (unlikely ((unsigned int) (offset + i) >= str.length)) { set_error (); - return Null(unsigned char); + return Null (unsigned char); } - else - return str[offset + i]; + return str[offset + i]; } /* Conversion to byte_str_t */ @@ -359,9 +350,7 @@ { return str.sub_str (offset_, len_); } bool avail (unsigned int count=1) const - { - return (!in_error () && str.check_limit (offset, count)); - } + { return (!in_error () && str.check_limit (offset, count)); } void inc (unsigned int count=1) { if (likely (!in_error () && (offset <= str.length) && (offset + count <= str.length))) @@ -389,7 +378,7 @@ /* stack */ template -struct stack_t +struct cff_stack_t { void init () { @@ -400,11 +389,7 @@ for (unsigned int i = 0; i < elements.length; i++) elements[i].init (); } - - void fini () - { - elements.fini_deep (); - } + void fini () { elements.fini_deep (); } ELEM& operator [] (unsigned int i) { @@ -419,7 +404,6 @@ else set_error (); } - ELEM &push () { if (likely (count < elements.length)) @@ -441,7 +425,6 @@ return Crap(ELEM); } } - void pop (unsigned int n) { if (likely (count >= n)) @@ -452,13 +435,12 @@ const ELEM& peek () { - if (likely (count > 0)) - return elements[count-1]; - else + if (unlikely (count < 0)) { set_error (); return Null(ELEM); } + return elements[count - 1]; } void unpop () @@ -475,7 +457,7 @@ void set_error () { error = true; } unsigned int get_count () const { return count; } - bool is_empty () const { return count == 0; } + bool is_empty () const { return !count; } static constexpr unsigned kSizeLimit = LIMIT; @@ -487,7 +469,7 @@ /* argument stack */ template -struct arg_stack_t : stack_t +struct arg_stack_t : cff_stack_t { void push_int (int v) { @@ -519,7 +501,7 @@ i = 0; S::set_error (); } - return (unsigned)i; + return (unsigned) i; } void push_longint_from_substr (byte_str_ref_t& str_ref) @@ -538,12 +520,10 @@ } hb_array_t get_subarray (unsigned int start) const - { - return S::elements.sub_array (start); - } + { return S::elements.sub_array (start); } private: - typedef stack_t S; + typedef cff_stack_t S; }; /* an operator prefixed by its operands in a byte string */ @@ -605,7 +585,7 @@ } unsigned get_count () const { return values.length; } - const VAL &get_value (unsigned int i) const { return values[i]; } + const VAL &get_value (unsigned int i) const { return values[i]; } const VAL &operator [] (unsigned int i) const { return get_value (i); } unsigned int opStart; @@ -644,30 +624,19 @@ return op; } - const ARG& eval_arg (unsigned int i) - { - return argStack[i]; - } - - ARG& pop_arg () - { - return argStack.pop (); - } + const ARG& eval_arg (unsigned int i) { return argStack[i]; } - void pop_n_args (unsigned int n) - { - argStack.pop (n); - } + ARG& pop_arg () { return argStack.pop (); } + void pop_n_args (unsigned int n) { argStack.pop (n); } - void clear_args () - { - pop_n_args (argStack.get_count ()); - } + void clear_args () { pop_n_args (argStack.get_count ()); } - byte_str_ref_t str_ref; - arg_stack_t argStack; + byte_str_ref_t + str_ref; + arg_stack_t + argStack; protected: - bool error; + bool error; }; typedef interp_env_t<> num_interp_env_t; @@ -711,8 +680,8 @@ }; template -struct interpreter_t { - +struct interpreter_t +{ ~interpreter_t() { fini (); } void fini () { env.fini (); } diff -Nru harfbuzz-2.5.3/src/hb-cff-interp-cs-common.hh harfbuzz-2.6.2/src/hb-cff-interp-cs-common.hh --- harfbuzz-2.5.3/src/hb-cff-interp-cs-common.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-cff-interp-cs-common.hh 2019-10-26 02:02:55.000000000 +0000 @@ -57,14 +57,14 @@ /* call stack */ const unsigned int kMaxCallLimit = 10; -struct call_stack_t : stack_t {}; +struct call_stack_t : cff_stack_t {}; template struct biased_subrs_t { - void init (const SUBRS &subrs_) + void init (const SUBRS *subrs_) { - subrs = &subrs_; + subrs = subrs_; unsigned int nSubrs = get_count (); if (nSubrs < 1240) bias = 107; @@ -118,7 +118,7 @@ template struct cs_interp_env_t : interp_env_t { - void init (const byte_str_t &str, const SUBRS &globalSubrs_, const SUBRS &localSubrs_) + void init (const byte_str_t &str, const SUBRS *globalSubrs_, const SUBRS *localSubrs_) { interp_env_t::init (str); diff -Nru harfbuzz-2.5.3/src/hb-cff-interp-dict-common.hh harfbuzz-2.6.2/src/hb-cff-interp-dict-common.hh --- harfbuzz-2.5.3/src/hb-cff-interp-dict-common.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-cff-interp-dict-common.hh 2019-10-26 02:02:55.000000000 +0000 @@ -94,130 +94,52 @@ } } + /* Turns CFF's BCD format into strtod understandable string */ static double parse_bcd (byte_str_ref_t& str_ref) { - bool neg = false; - double int_part = 0; - uint64_t frac_part = 0; - uint32_t frac_count = 0; - bool exp_neg = false; - uint32_t exp_part = 0; - bool exp_overflow = false; - enum Part { INT_PART=0, FRAC_PART, EXP_PART } part = INT_PART; + if (unlikely (str_ref.in_error ())) return .0; + enum Nibble { DECIMAL=10, EXP_POS, EXP_NEG, RESERVED, NEG, END }; - const uint64_t MAX_FRACT = 0xFFFFFFFFFFFFFull; /* 1^52-1 */ - const uint32_t MAX_EXP = 0x7FFu; /* 1^11-1 */ - double value = 0.0; + char buf[32]; unsigned char byte = 0; - for (uint32_t i = 0;; i++) + for (unsigned i = 0, count = 0; count < ARRAY_LENGTH (buf); ++i, ++count) { - char d; - if ((i & 1) == 0) + unsigned nibble; + if (!(i & 1)) { - if (!str_ref.avail ()) - { - str_ref.set_error (); - return 0.0; - } + if (unlikely (!str_ref.avail ())) break; + byte = str_ref[0]; str_ref.inc (); - d = byte >> 4; + nibble = byte >> 4; } else - d = byte & 0x0F; + nibble = byte & 0x0F; - switch (d) + if (unlikely (nibble == RESERVED)) break; + else if (nibble == END) { - case RESERVED: - str_ref.set_error (); - return value; - - case END: - value = (double) (neg ? -int_part : int_part); - if (frac_count > 0) - { - double frac = (frac_part / pow (10.0, (double) frac_count)); - if (neg) frac = -frac; - value += frac; - } - if (unlikely (exp_overflow)) - { - if (value == 0.0) - return value; - if (exp_neg) - return neg ? -DBL_MIN : DBL_MIN; - else - return neg ? -DBL_MAX : DBL_MAX; - } - if (exp_part != 0) - { - if (exp_neg) - value /= pow (10.0, (double) exp_part); - else - value *= pow (10.0, (double) exp_part); - } - return value; - - case NEG: - if (i != 0) - { - str_ref.set_error (); - return 0.0; - } - neg = true; - break; - - case DECIMAL: - if (part != INT_PART) - { - str_ref.set_error (); - return value; - } - part = FRAC_PART; - break; - - case EXP_NEG: - exp_neg = true; - HB_FALLTHROUGH; - - case EXP_POS: - if (part == EXP_PART) - { - str_ref.set_error (); - return value; - } - part = EXP_PART; + const char *p = buf; + double pv; + if (unlikely (!hb_parse_double (&p, p + count, &pv, true/* whole buffer */))) break; - - default: - switch (part) { - default: - case INT_PART: - int_part = (int_part * 10) + d; - break; - - case FRAC_PART: - if (likely (frac_part <= MAX_FRACT / 10)) - { - frac_part = (frac_part * 10) + (unsigned)d; - frac_count++; - } - break; - - case EXP_PART: - if (likely (exp_part * 10 + d <= MAX_EXP)) - { - exp_part = (exp_part * 10) + d; - } - else - exp_overflow = true; - break; - } + return pv; + } + else + { + buf[count] = "0123456789.EE?-?"[nibble]; + if (nibble == EXP_NEG) + { + ++count; + if (unlikely (count == ARRAY_LENGTH (buf))) break; + buf[count] = '-'; + } } } - return value; + str_ref.set_error (); + return .0; } static bool is_hint_op (op_code_t op) diff -Nru harfbuzz-2.5.3/src/hb-common.cc harfbuzz-2.6.2/src/hb-common.cc --- harfbuzz-2.5.3/src/hb-common.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-common.cc 2019-10-26 02:02:55.000000000 +0000 @@ -27,13 +27,9 @@ */ #include "hb.hh" - #include "hb-machinery.hh" #include -#ifdef HAVE_XLOCALE_H -#include -#endif #ifdef HB_NO_SETLOCALE #define setlocale(Category, Locale) "C" @@ -67,7 +63,7 @@ { const char *p = strchr (c, ':'); if (!p) - p = c + strlen (c); + p = c + strlen (c); #define OPTION(name, symbol) \ if (0 == strncmp (c, name, p - c) && strlen (name) == static_cast(p - c)) do { u.opts.symbol = true; } while (0) @@ -385,7 +381,8 @@ const char * hb_language_to_string (hb_language_t language) { - /* This is actually nullptr-safe! */ + if (unlikely (!language)) return nullptr; + return language->s; } @@ -722,131 +719,24 @@ static bool parse_uint (const char **pp, const char *end, unsigned int *pv) { - char buf[32]; - unsigned int len = hb_min (ARRAY_LENGTH (buf) - 1, (unsigned int) (end - *pp)); - strncpy (buf, *pp, len); - buf[len] = '\0'; - - char *p = buf; - char *pend = p; - unsigned int v; - - /* Intentionally use strtol instead of strtoul, such that - * -1 turns into "big number"... */ - errno = 0; - v = strtol (p, &pend, 10); - if (errno || p == pend) - return false; + /* Intentionally use hb_parse_int inside instead of hb_parse_uint, + * such that -1 turns into "big number"... */ + int v; + if (unlikely (!hb_parse_int (pp, end, &v))) return false; *pv = v; - *pp += pend - p; return true; } static bool parse_uint32 (const char **pp, const char *end, uint32_t *pv) { - char buf[32]; - unsigned int len = hb_min (ARRAY_LENGTH (buf) - 1, (unsigned int) (end - *pp)); - strncpy (buf, *pp, len); - buf[len] = '\0'; - - char *p = buf; - char *pend = p; - unsigned int v; - - /* Intentionally use strtol instead of strtoul, such that - * -1 turns into "big number"... */ - errno = 0; - v = strtol (p, &pend, 10); - if (errno || p == pend) - return false; + /* Intentionally use hb_parse_int inside instead of hb_parse_uint, + * such that -1 turns into "big number"... */ + int v; + if (unlikely (!hb_parse_int (pp, end, &v))) return false; *pv = v; - *pp += pend - p; - return true; -} - -#if defined (HAVE_NEWLOCALE) && defined (HAVE_STRTOD_L) -#define USE_XLOCALE 1 -#define HB_LOCALE_T locale_t -#define HB_CREATE_LOCALE(locName) newlocale (LC_ALL_MASK, locName, nullptr) -#define HB_FREE_LOCALE(loc) freelocale (loc) -#elif defined(_MSC_VER) -#define USE_XLOCALE 1 -#define HB_LOCALE_T _locale_t -#define HB_CREATE_LOCALE(locName) _create_locale (LC_ALL, locName) -#define HB_FREE_LOCALE(loc) _free_locale (loc) -#define strtod_l(a, b, c) _strtod_l ((a), (b), (c)) -#endif - -#ifdef USE_XLOCALE - -#if HB_USE_ATEXIT -static void free_static_C_locale (); -#endif - -static struct hb_C_locale_lazy_loader_t : hb_lazy_loader_t, - hb_C_locale_lazy_loader_t> -{ - static HB_LOCALE_T create () - { - HB_LOCALE_T C_locale = HB_CREATE_LOCALE ("C"); - -#if HB_USE_ATEXIT - atexit (free_static_C_locale); -#endif - - return C_locale; - } - static void destroy (HB_LOCALE_T p) - { - HB_FREE_LOCALE (p); - } - static HB_LOCALE_T get_null () - { - return nullptr; - } -} static_C_locale; - -#if HB_USE_ATEXIT -static -void free_static_C_locale () -{ - static_C_locale.free_instance (); -} -#endif - -static HB_LOCALE_T -get_C_locale () -{ - return static_C_locale.get_unconst (); -} -#endif /* USE_XLOCALE */ - -static bool -parse_float (const char **pp, const char *end, float *pv) -{ - char buf[32]; - unsigned int len = hb_min (ARRAY_LENGTH (buf) - 1, (unsigned int) (end - *pp)); - strncpy (buf, *pp, len); - buf[len] = '\0'; - - char *p = buf; - char *pend = p; - float v; - - errno = 0; -#ifdef USE_XLOCALE - v = strtod_l (p, &pend, get_C_locale ()); -#else - v = strtod (p, &pend); -#endif - if (errno || p == pend) - return false; - - *pv = v; - *pp += pend - p; return true; } @@ -956,7 +846,7 @@ { bool had_equal = parse_char (pp, end, '='); bool had_value = parse_uint32 (pp, end, &feature->value) || - parse_bool (pp, end, &feature->value); + parse_bool (pp, end, &feature->value); /* CSS doesn't use equal-sign between tag and value. * If there was an equal-sign, then there *must* be a value. * A value without an equal-sign is ok, but not required. */ @@ -1099,7 +989,11 @@ parse_variation_value (const char **pp, const char *end, hb_variation_t *variation) { parse_char (pp, end, '='); /* Optional. */ - return parse_float (pp, end, &variation->value); + double v; + if (unlikely (!hb_parse_double (pp, end, &v))) return false; + + variation->value = v; + return true; } static bool diff -Nru harfbuzz-2.5.3/src/hb-common.h harfbuzz-2.6.2/src/hb-common.h --- harfbuzz-2.5.3/src/hb-common.h 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-common.h 2019-10-26 02:02:55.000000000 +0000 @@ -63,6 +63,8 @@ typedef unsigned __int32 uint32_t; typedef __int64 int64_t; typedef unsigned __int64 uint64_t; +#elif defined (__KERNEL__) +# include #else # include #endif diff -Nru harfbuzz-2.5.3/src/hb-config.hh harfbuzz-2.6.2/src/hb-config.hh --- harfbuzz-2.5.3/src/hb-config.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-config.hh 2019-10-26 02:02:55.000000000 +0000 @@ -58,6 +58,7 @@ #define HB_NO_BITMAP #define HB_NO_CFF #define HB_NO_COLOR +#define HB_NO_ERRNO #define HB_NO_FACE_COLLECT_UNICODES #define HB_NO_GETENV #define HB_NO_HINTING @@ -66,6 +67,8 @@ #define HB_NO_LAYOUT_COLLECT_GLYPHS #define HB_NO_LAYOUT_UNUSED #define HB_NO_MATH +#define HB_NO_META +#define HB_NO_METRICS #define HB_NO_MMAP #define HB_NO_NAME #define HB_NO_OPEN @@ -93,7 +96,7 @@ #ifdef HB_NO_AAT #define HB_NO_OT_NAME_LANGUAGE_AAT -#define HB_NO_SHAPE_AAT +#define HB_NO_AAT_SHAPE #endif #ifdef HB_NO_BITMAP @@ -121,6 +124,17 @@ #define HB_NO_OT_NAME_LANGUAGE #endif +#ifdef HB_NO_OT +#define HB_NO_OT_FONT +#define HB_NO_OT_LAYOUT +#define HB_NO_OT_TAG +#define HB_NO_OT_SHAPE +#endif + +#ifdef HB_NO_OT_SHAPE +#define HB_NO_AAT_SHAPE +#endif + #ifdef HB_NO_OT_SHAPE_FALLBACK #define HB_NO_OT_SHAPE_COMPLEX_ARABIC_FALLBACK #define HB_NO_OT_SHAPE_COMPLEX_HEBREW_FALLBACK diff -Nru harfbuzz-2.5.3/src/hb-coretext.cc harfbuzz-2.6.2/src/hb-coretext.cc --- harfbuzz-2.5.3/src/hb-coretext.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-coretext.cc 2019-10-26 02:02:55.000000000 +0000 @@ -49,24 +49,6 @@ /* https://developer.apple.com/documentation/coretext/1508745-ctfontcreatewithgraphicsfont */ #define HB_CORETEXT_DEFAULT_FONT_SIZE 12.f -static CGFloat -coretext_font_size_from_ptem (float ptem) -{ - /* CoreText points are CSS pixels (96 per inch), - * NOT typographic points (72 per inch). - * - * https://developer.apple.com/library/content/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html - */ - ptem *= 96.f / 72.f; - return (CGFloat) (ptem <= 0.f ? HB_CORETEXT_DEFAULT_FONT_SIZE : ptem); -} -static float -coretext_font_size_to_ptem (CGFloat size) -{ - size *= 72. / 96.; - return size <= 0 ? 0 : size; -} - static void release_table_data (void *user_data) { @@ -75,7 +57,7 @@ } static hb_blob_t * -reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data) +_hb_cg_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data) { CGFontRef cg_font = reinterpret_cast (user_data); CFDataRef cf_data = CGFontCopyTableForTag (cg_font, tag); @@ -129,7 +111,7 @@ release_data (void *info, const void *data, size_t size) { assert (hb_blob_get_length ((hb_blob_t *) info) == size && - hb_blob_get_data ((hb_blob_t *) info, nullptr) == data); + hb_blob_get_data ((hb_blob_t *) info, nullptr) == data); hb_blob_destroy ((hb_blob_t *) info); } @@ -251,21 +233,21 @@ atsFont = CTFontGetPlatformFont (new_ct_font, NULL); status = ATSFontGetFileReference (atsFont, &fsref); if (status == noErr) - new_url = CFURLCreateFromFSRef (NULL, &fsref); + new_url = CFURLCreateFromFSRef (NULL, &fsref); #else new_url = (CFURLRef) CTFontCopyAttribute (new_ct_font, kCTFontURLAttribute); #endif // Keep reconfigured font if URL cannot be retrieved (seems to be the case // on Mac OS 10.12 Sierra), speculative fix for crbug.com/625606 if (!original_url || !new_url || CFEqual (original_url, new_url)) { - CFRelease (ct_font); - ct_font = new_ct_font; + CFRelease (ct_font); + ct_font = new_ct_font; } else { - CFRelease (new_ct_font); - DEBUG_MSG (CORETEXT, ct_font, "Discarding reconfigured CTFont, location changed."); + CFRelease (new_ct_font); + DEBUG_MSG (CORETEXT, ct_font, "Discarding reconfigured CTFont, location changed."); } if (new_url) - CFRelease (new_url); + CFRelease (new_url); } else DEBUG_MSG (CORETEXT, ct_font, "Font copy with empty cascade list failed"); @@ -299,7 +281,7 @@ hb_face_t * hb_coretext_face_create (CGFontRef cg_font) { - return hb_face_create_for_tables (reference_table, CGFontRetain (cg_font), _hb_cg_font_release); + return hb_face_create_for_tables (_hb_cg_reference_table, CGFontRetain (cg_font), _hb_cg_font_release); } /* @@ -320,7 +302,8 @@ if (unlikely (!face_data)) return nullptr; CGFontRef cg_font = (CGFontRef) (const void *) face->data.coretext; - CTFontRef ct_font = create_ct_font (cg_font, coretext_font_size_from_ptem (font->ptem)); + CGFloat font_size = (CGFloat) (font->ptem <= 0.f ? HB_CORETEXT_DEFAULT_FONT_SIZE : font->ptem); + CTFontRef ct_font = create_ct_font (cg_font, font_size); if (unlikely (!ct_font)) { @@ -344,7 +327,7 @@ const hb_coretext_font_data_t *data = font->data.coretext; if (unlikely (!data)) return nullptr; - if (fabs (CTFontGetSize((CTFontRef) data) - coretext_font_size_from_ptem (font->ptem)) > .5) + if (fabs (CTFontGetSize ((CTFontRef) data) - (CGFloat) font->ptem) > .5) { /* XXX-MT-bug * Note that evaluating condition above can be dangerous if another thread @@ -384,7 +367,7 @@ if (unlikely (hb_object_is_immutable (font))) return font; - hb_font_set_ptem (font, coretext_font_size_to_ptem (CTFontGetSize(ct_font))); + hb_font_set_ptem (font, CTFontGetSize (ct_font)); /* Let there be dragons here... */ font->data.coretext.cmpexch (nullptr, (hb_coretext_font_data_t *) CFRetain (ct_font)); @@ -450,9 +433,9 @@ hb_bool_t _hb_coretext_shape (hb_shape_plan_t *shape_plan, hb_font_t *font, - hb_buffer_t *buffer, - const hb_feature_t *features, - unsigned int num_features) + hb_buffer_t *buffer, + const hb_feature_t *features, + unsigned int num_features) { hb_face_t *face = font->face; CGFontRef cg_font = (CGFontRef) (const void *) face->data.coretext; @@ -494,7 +477,7 @@ { const hb_aat_feature_mapping_t * mapping = hb_aat_layout_find_feature_mapping (features[i].tag); if (!mapping) - continue; + continue; active_feature_t feature; feature.rec.feature = mapping->aatFeatureType; @@ -536,7 +519,7 @@ if (event->index != last_index) { - /* Save a snapshot of active features and the range. */ + /* Save a snapshot of active features and the range. */ range_record_t *range = range_records.push (); if (active_features.length) @@ -597,9 +580,9 @@ if (event->start) { - active_features.push (event->feature); + active_features.push (event->feature); } else { - active_feature_t *feature = active_features.find (&event->feature); + active_feature_t *feature = active_features.find (&event->feature); if (feature) active_features.remove (feature - active_features.arrayZ); } @@ -717,15 +700,15 @@ #if !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) && MAC_OS_X_VERSION_MIN_REQUIRED < 1090 # define kCTLanguageAttributeName CFSTR ("NSLanguage") #endif - CFStringRef lang = CFStringCreateWithCStringNoCopy (kCFAllocatorDefault, + CFStringRef lang = CFStringCreateWithCStringNoCopy (kCFAllocatorDefault, hb_language_to_string (buffer->props.language), kCFStringEncodingUTF8, kCFAllocatorNull); if (unlikely (!lang)) - { + { CFRelease (attr_string); FAIL ("CFStringCreateWithCStringNoCopy failed"); - } + } CFAttributedStringSetAttribute (attr_string, CFRangeMake (0, chars_len), kCTLanguageAttributeName, lang); CFRelease (lang); @@ -774,7 +757,7 @@ feature.start < chars_len && feature.start < feature.end) { CFRange feature_range = CFRangeMake (feature.start, - hb_min (feature.end, chars_len) - feature.start); + hb_min (feature.end, chars_len) - feature.start); if (feature.value) CFAttributedStringRemoveAttribute (attr_string, feature_range, kCTKernAttributeName); else @@ -798,8 +781,8 @@ CFRelease (level_number); if (unlikely (!options)) { - CFRelease (attr_string); - FAIL ("CFDictionaryCreate failed"); + CFRelease (attr_string); + FAIL ("CFDictionaryCreate failed"); } CTTypesetterRef typesetter = CTTypesetterCreateWithAttributedStringAndOptions (attr_string, options); @@ -910,7 +893,7 @@ if (!matched) { CFRange range = CTRunGetStringRange (run); - DEBUG_MSG (CORETEXT, run, "Run used fallback font: %ld..%ld", + DEBUG_MSG (CORETEXT, run, "Run used fallback font: %ld..%ld", range.location, range.location + range.length); if (!buffer->ensure_inplace (buffer->len + range.length)) goto resize_and_retry; @@ -938,7 +921,7 @@ continue; } if (buffer->unicode->is_default_ignorable (ch)) - continue; + continue; info->codepoint = notdef; info->cluster = log_clusters[j]; @@ -983,7 +966,7 @@ scratch = scratch_saved { /* Setup glyphs */ - SCRATCH_SAVE(); + SCRATCH_SAVE(); const CGGlyph* glyphs = USE_PTR ? CTRunGetGlyphsPtr (run) : nullptr; if (!glyphs) { ALLOCATE_ARRAY (CGGlyph, glyph_buf, num_glyphs, goto resize_and_retry); @@ -1006,12 +989,12 @@ SCRATCH_RESTORE(); } { - /* Setup positions. + /* Setup positions. * Note that CoreText does not return advances for glyphs. As such, * for all but last glyph, we use the delta position to next glyph as * advance (in the advance direction only), and for last glyph we set * whatever is needed to make the whole run's advance add up. */ - SCRATCH_SAVE(); + SCRATCH_SAVE(); const CGPoint* positions = USE_PTR ? CTRunGetPositionsPtr (run) : nullptr; if (!positions) { ALLOCATE_ARRAY (CGPoint, position_buf, num_glyphs, goto resize_and_retry); diff -Nru harfbuzz-2.5.3/src/hb-debug.hh harfbuzz-2.6.2/src/hb-debug.hh --- harfbuzz-2.5.3/src/hb-debug.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-debug.hh 2019-10-26 02:02:55.000000000 +0000 @@ -296,22 +296,23 @@ if (plevel) --*plevel; } - ret_t ret (ret_t v, - const char *func = "", - unsigned int line = 0) + template + T ret (T&& v, + const char *func = "", + unsigned int line = 0) { if (unlikely (returned)) { fprintf (stderr, "OUCH, double calls to return_trace(). This is a bug, please report.\n"); - return v; + return hb_forward (v); } _hb_debug_msg (what, obj, func, true, plevel ? *plevel : 1, -1, "return %s (line %d)", - hb_printer_t().print (v), line); + hb_printer_t().print (v), line); if (plevel) --*plevel; plevel = nullptr; returned = true; - return v; + return hb_forward (v); } private: @@ -413,7 +414,7 @@ #define TRACE_SANITIZE(this) \ hb_auto_trace_t trace \ (&c->debug_depth, c->get_name (), this, HB_FUNC, \ - " "); + " ") #else #define TRACE_SANITIZE(this) hb_no_trace_t trace #endif @@ -425,7 +426,7 @@ #define TRACE_SERIALIZE(this) \ hb_auto_trace_t trace \ (&c->debug_depth, "SERIALIZE", c, HB_FUNC, \ - " "); + " ") #else #define TRACE_SERIALIZE(this) hb_no_trace_t trace #endif @@ -437,7 +438,7 @@ #define TRACE_SUBSET(this) \ hb_auto_trace_t trace \ (&c->debug_depth, c->get_name (), this, HB_FUNC, \ - " "); + " ") #else #define TRACE_SUBSET(this) hb_no_trace_t trace #endif @@ -454,7 +455,7 @@ #define TRACE_DISPATCH(this, format) \ hb_auto_trace_t trace \ (&c->debug_depth, c->get_name (), this, HB_FUNC, \ - "format %d", (int) format); + "format %d", (int) format) #else #define TRACE_DISPATCH(this, format) hb_no_trace_t trace #endif diff -Nru harfbuzz-2.5.3/src/hb-directwrite.cc harfbuzz-2.6.2/src/hb-directwrite.cc --- harfbuzz-2.5.3/src/hb-directwrite.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-directwrite.cc 2019-10-26 02:02:55.000000000 +0000 @@ -28,11 +28,18 @@ #include "hb-shaper-impl.hh" -#include +#include #include "hb-directwrite.h" +/* Declare object creator for dynamic support of DWRITE */ +typedef HRESULT (* WINAPI t_DWriteCreateFactory)( + DWRITE_FACTORY_TYPE factoryType, + REFIID iid, + IUnknown **factory +); + /* * hb-directwrite uses new/delete syntatically but as we let users * to override malloc/free, we will redefine new/delete so users @@ -138,6 +145,7 @@ struct hb_directwrite_face_data_t { + HMODULE dwrite_dll; IDWriteFactory *dwriteFactory; IDWriteFontFile *fontFile; DWriteFontFileStream *fontFileStream; @@ -153,12 +161,43 @@ if (unlikely (!data)) return nullptr; +#define FAIL(...) \ + HB_STMT_START { \ + DEBUG_MSG (DIRECTWRITE, nullptr, __VA_ARGS__); \ + return nullptr; \ + } HB_STMT_END + + data->dwrite_dll = LoadLibrary (TEXT ("DWRITE")); + if (unlikely (!data->dwrite_dll)) + FAIL ("Cannot find DWrite.DLL"); + + t_DWriteCreateFactory p_DWriteCreateFactory; + +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-function-type" +#endif + + p_DWriteCreateFactory = (t_DWriteCreateFactory) + GetProcAddress (data->dwrite_dll, "DWriteCreateFactory"); + +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif + + if (unlikely (!p_DWriteCreateFactory)) + FAIL ("Cannot find DWriteCreateFactory()."); + + HRESULT hr; + // TODO: factory and fontFileLoader should be cached separately IDWriteFactory* dwriteFactory; - DWriteCreateFactory (DWRITE_FACTORY_TYPE_SHARED, __uuidof (IDWriteFactory), - (IUnknown**) &dwriteFactory); + hr = p_DWriteCreateFactory (DWRITE_FACTORY_TYPE_SHARED, __uuidof (IDWriteFactory), + (IUnknown**) &dwriteFactory); + + if (unlikely (hr != S_OK)) + FAIL ("Failed to run DWriteCreateFactory()."); - HRESULT hr; hb_blob_t *blob = hb_face_reference_blob (face); DWriteFontFileStream *fontFileStream; fontFileStream = new DWriteFontFileStream ((uint8_t *) hb_blob_get_data (blob, nullptr), @@ -172,12 +211,6 @@ hr = dwriteFactory->CreateCustomFontFileReference (&fontFileKey, sizeof (fontFileKey), fontFileLoader, &fontFile); -#define FAIL(...) \ - HB_STMT_START { \ - DEBUG_MSG (DIRECTWRITE, nullptr, __VA_ARGS__); \ - return nullptr; \ - } HB_STMT_END - if (FAILED (hr)) FAIL ("Failed to load font file from data!"); @@ -224,6 +257,8 @@ delete data->fontFileStream; if (data->faceBlob) hb_blob_destroy (data->faceBlob); + if (data->dwrite_dll) + FreeLibrary (data->dwrite_dll); if (data) delete data; } @@ -504,11 +539,6 @@ Run mRunHead; }; -static inline uint16_t hb_uint16_swap (const uint16_t v) -{ return (v >> 8) | (v << 8); } -static inline uint32_t hb_uint32_swap (const uint32_t v) -{ return (hb_uint16_swap (v) << 16) | hb_uint16_swap (v >> 16); } - /* * shaper */ @@ -595,7 +625,7 @@ HB_STMT_START { \ DEBUG_MSG (DIRECTWRITE, nullptr, __VA_ARGS__); \ return false; \ - } HB_STMT_END; + } HB_STMT_END if (FAILED (hr)) FAIL ("Analyzer failed to generate results."); @@ -849,29 +879,12 @@ features, num_features, 0); } -/** - * hb_directwrite_shape_experimental_width: - * Experimental API to test DirectWrite's justification algorithm. - * - * It inserts Kashida at wrong order so don't use the API ever. - * - * It doesn't work with cygwin/msys due to header bugs so one - * should use MSVC toolchain in order to use it for now. - * - * @font: - * @buffer: - * @features: - * @num_features: - * @width: - * - * Since: 1.4.2 - **/ -hb_bool_t -hb_directwrite_shape_experimental_width (hb_font_t *font, - hb_buffer_t *buffer, - const hb_feature_t *features, - unsigned int num_features, - float width) +HB_UNUSED static bool +_hb_directwrite_shape_experimental_width (hb_font_t *font, + hb_buffer_t *buffer, + const hb_feature_t *features, + unsigned int num_features, + float width) { static const char *shapers = "directwrite"; hb_shape_plan_t *shape_plan; @@ -899,7 +912,7 @@ } static hb_blob_t * -reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data) +_hb_directwrite_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data) { IDWriteFontFace *dw_face = ((IDWriteFontFace *) user_data); const void *data; @@ -944,7 +957,7 @@ { if (font_face) font_face->AddRef (); - return hb_face_create_for_tables (reference_table, font_face, + return hb_face_create_for_tables (_hb_directwrite_reference_table, font_face, _hb_directwrite_font_release); } diff -Nru harfbuzz-2.5.3/src/hb-directwrite.h harfbuzz-2.6.2/src/hb-directwrite.h --- harfbuzz-2.5.3/src/hb-directwrite.h 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-directwrite.h 2019-10-26 02:02:55.000000000 +0000 @@ -29,11 +29,6 @@ HB_BEGIN_DECLS -HB_EXTERN hb_bool_t -hb_directwrite_shape_experimental_width (hb_font_t *font, hb_buffer_t *buffer, - const hb_feature_t *features, - unsigned int num_features, float width); - HB_EXTERN hb_face_t * hb_directwrite_face_create (IDWriteFontFace *font_face); diff -Nru harfbuzz-2.5.3/src/hb-dispatch.hh harfbuzz-2.6.2/src/hb-dispatch.hh --- harfbuzz-2.5.3/src/hb-dispatch.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-dispatch.hh 2019-10-26 02:02:55.000000000 +0000 @@ -41,7 +41,7 @@ private: /* https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern */ const Context* thiz () const { return static_cast (this); } - Context* thiz () { return static_cast< Context *> (this); } + Context* thiz () { return static_cast< Context *> (this); } public: static constexpr unsigned max_debug_depth = MaxDebugDepth; typedef Return return_t; diff -Nru harfbuzz-2.5.3/src/hb-face.cc harfbuzz-2.6.2/src/hb-face.cc --- harfbuzz-2.5.3/src/hb-face.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-face.cc 2019-10-26 02:02:55.000000000 +0000 @@ -367,6 +367,9 @@ hb_face_reference_table (const hb_face_t *face, hb_tag_t tag) { + if (unlikely (tag == HB_TAG_NONE)) + return hb_blob_get_empty (); + return face->reference_table (tag); } diff -Nru harfbuzz-2.5.3/src/hb-font.cc harfbuzz-2.6.2/src/hb-font.cc --- harfbuzz-2.5.3/src/hb-font.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-font.cc 2019-10-26 02:02:55.000000000 +0000 @@ -518,9 +518,9 @@ /** * hb_font_funcs_create: (Xconstructor) * - * * - * Return value: (transfer full): + * + * Return value: (transfer full): * * Since: 0.9.2 **/ @@ -540,9 +540,9 @@ /** * hb_font_funcs_get_empty: * - * * - * Return value: (transfer full): + * + * Return value: (transfer full): * * Since: 0.9.2 **/ @@ -556,9 +556,9 @@ * hb_font_funcs_reference: (skip) * @ffuncs: font functions. * - * * - * Return value: + * + * Return value: * * Since: 0.9.2 **/ @@ -572,7 +572,7 @@ * hb_font_funcs_destroy: (skip) * @ffuncs: font functions. * - * + * * * Since: 0.9.2 **/ @@ -592,14 +592,14 @@ /** * hb_font_funcs_set_user_data: (skip) * @ffuncs: font functions. - * @key: - * @data: - * @destroy: - * @replace: + * @key: + * @data: + * @destroy: + * @replace: + * * - * * - * Return value: + * Return value: * * Since: 0.9.2 **/ @@ -616,11 +616,11 @@ /** * hb_font_funcs_get_user_data: (skip) * @ffuncs: font functions. - * @key: + * @key: * - * * - * Return value: (transfer none): + * + * Return value: (transfer none): * * Since: 0.9.2 **/ @@ -636,7 +636,7 @@ * hb_font_funcs_make_immutable: * @ffuncs: font functions. * - * + * * * Since: 0.9.2 **/ @@ -653,9 +653,9 @@ * hb_font_funcs_is_immutable: * @ffuncs: font functions. * - * * - * Return value: + * + * Return value: * * Since: 0.9.2 **/ @@ -667,22 +667,22 @@ #define HB_FONT_FUNC_IMPLEMENT(name) \ - \ + \ void \ hb_font_funcs_set_##name##_func (hb_font_funcs_t *ffuncs, \ - hb_font_get_##name##_func_t func, \ - void *user_data, \ - hb_destroy_func_t destroy) \ + hb_font_get_##name##_func_t func, \ + void *user_data, \ + hb_destroy_func_t destroy) \ { \ if (hb_object_is_immutable (ffuncs)) { \ if (destroy) \ destroy (user_data); \ return; \ } \ - \ + \ if (ffuncs->destroy.name) \ ffuncs->destroy.name (ffuncs->user_data.name); \ - \ + \ if (func) { \ ffuncs->get.f.name = func; \ ffuncs->user_data.name = user_data; \ @@ -751,13 +751,13 @@ /** * hb_font_get_glyph: * @font: a font. - * @unicode: - * @variation_selector: - * @glyph: (out): + * @unicode: + * @variation_selector: + * @glyph: (out): + * * - * * - * Return value: + * Return value: * * Since: 0.9.2 **/ @@ -774,12 +774,12 @@ /** * hb_font_get_nominal_glyph: * @font: a font. - * @unicode: - * @glyph: (out): + * @unicode: + * @glyph: (out): * - * * - * Return value: + * + * Return value: * * Since: 1.2.3 **/ @@ -794,13 +794,13 @@ /** * hb_font_get_variation_glyph: * @font: a font. - * @unicode: - * @variation_selector: - * @glyph: (out): + * @unicode: + * @variation_selector: + * @glyph: (out): * - * * - * Return value: + * + * Return value: * * Since: 1.2.3 **/ @@ -815,11 +815,11 @@ /** * hb_font_get_glyph_h_advance: * @font: a font. - * @glyph: + * @glyph: * - * * - * Return value: + * + * Return value: * * Since: 0.9.2 **/ @@ -833,11 +833,11 @@ /** * hb_font_get_glyph_v_advance: * @font: a font. - * @glyph: + * @glyph: * - * * - * Return value: + * + * Return value: * * Since: 0.9.2 **/ @@ -852,7 +852,7 @@ * hb_font_get_glyph_h_advances: * @font: a font. * - * + * * * Since: 1.8.6 **/ @@ -870,7 +870,7 @@ * hb_font_get_glyph_v_advances: * @font: a font. * - * + * * * Since: 1.8.6 **/ @@ -888,13 +888,13 @@ /** * hb_font_get_glyph_h_origin: * @font: a font. - * @glyph: - * @x: (out): - * @y: (out): + * @glyph: + * @x: (out): + * @y: (out): * - * * - * Return value: + * + * Return value: * * Since: 0.9.2 **/ @@ -909,13 +909,13 @@ /** * hb_font_get_glyph_v_origin: * @font: a font. - * @glyph: - * @x: (out): - * @y: (out): + * @glyph: + * @x: (out): + * @y: (out): + * * - * * - * Return value: + * Return value: * * Since: 0.9.2 **/ @@ -930,12 +930,12 @@ /** * hb_font_get_glyph_h_kerning: * @font: a font. - * @left_glyph: - * @right_glyph: + * @left_glyph: + * @right_glyph: + * * - * * - * Return value: + * Return value: * * Since: 0.9.2 **/ @@ -950,12 +950,12 @@ /** * hb_font_get_glyph_v_kerning: * @font: a font. - * @top_glyph: - * @bottom_glyph: + * @top_glyph: + * @bottom_glyph: * - * * - * Return value: + * + * Return value: * * Since: 0.9.2 * Deprecated: 2.0.0 @@ -971,12 +971,12 @@ /** * hb_font_get_glyph_extents: * @font: a font. - * @glyph: - * @extents: (out): + * @glyph: + * @extents: (out): * - * * - * Return value: + * + * Return value: * * Since: 0.9.2 **/ @@ -991,14 +991,14 @@ /** * hb_font_get_glyph_contour_point: * @font: a font. - * @glyph: - * @point_index: - * @x: (out): - * @y: (out): + * @glyph: + * @point_index: + * @x: (out): + * @y: (out): + * * - * * - * Return value: + * Return value: * * Since: 0.9.2 **/ @@ -1013,13 +1013,13 @@ /** * hb_font_get_glyph_name: * @font: a font. - * @glyph: - * @name: (array length=size): - * @size: + * @glyph: + * @name: (array length=size): + * @size: * - * * - * Return value: + * + * Return value: * * Since: 0.9.2 **/ @@ -1034,13 +1034,13 @@ /** * hb_font_get_glyph_from_name: * @font: a font. - * @name: (array length=len): - * @len: - * @glyph: (out): + * @name: (array length=len): + * @len: + * @glyph: (out): + * * - * * - * Return value: + * Return value: * * Since: 0.9.2 **/ @@ -1075,12 +1075,12 @@ /** * hb_font_get_glyph_advance_for_direction: * @font: a font. - * @glyph: - * @direction: - * @x: (out): - * @y: (out): + * @glyph: + * @direction: + * @x: (out): + * @y: (out): + * * - * * * Since: 0.9.2 **/ @@ -1095,9 +1095,9 @@ /** * hb_font_get_glyph_advances_for_direction: * @font: a font. - * @direction: + * @direction: + * * - * * * Since: 1.8.6 **/ @@ -1116,12 +1116,12 @@ /** * hb_font_get_glyph_origin_for_direction: * @font: a font. - * @glyph: - * @direction: - * @x: (out): - * @y: (out): + * @glyph: + * @direction: + * @x: (out): + * @y: (out): + * * - * * * Since: 0.9.2 **/ @@ -1137,12 +1137,12 @@ /** * hb_font_add_glyph_origin_for_direction: * @font: a font. - * @glyph: - * @direction: - * @x: (out): - * @y: (out): + * @glyph: + * @direction: + * @x: (out): + * @y: (out): + * * - * * * Since: 0.9.2 **/ @@ -1158,12 +1158,12 @@ /** * hb_font_subtract_glyph_origin_for_direction: * @font: a font. - * @glyph: - * @direction: - * @x: (out): - * @y: (out): + * @glyph: + * @direction: + * @x: (out): + * @y: (out): + * * - * * * Since: 0.9.2 **/ @@ -1179,13 +1179,13 @@ /** * hb_font_get_glyph_kerning_for_direction: * @font: a font. - * @first_glyph: - * @second_glyph: - * @direction: - * @x: (out): - * @y: (out): + * @first_glyph: + * @second_glyph: + * @direction: + * @x: (out): + * @y: (out): + * * - * * * Since: 0.9.2 **/ @@ -1201,13 +1201,13 @@ /** * hb_font_get_glyph_extents_for_origin: * @font: a font. - * @glyph: - * @direction: - * @extents: (out): + * @glyph: + * @direction: + * @extents: (out): * - * * - * Return value: + * + * Return value: * * Since: 0.9.2 **/ @@ -1223,15 +1223,15 @@ /** * hb_font_get_glyph_contour_point_for_origin: * @font: a font. - * @glyph: - * @point_index: - * @direction: - * @x: (out): - * @y: (out): + * @glyph: + * @point_index: + * @direction: + * @x: (out): + * @y: (out): + * * - * * - * Return value: + * Return value: * * Since: 0.9.2 **/ @@ -1248,11 +1248,11 @@ /** * hb_font_glyph_to_string: * @font: a font. - * @glyph: - * @s: (array length=size): - * @size: + * @glyph: + * @s: (array length=size): + * @size: + * * - * * * Since: 0.9.2 **/ @@ -1268,13 +1268,13 @@ /** * hb_font_glyph_from_string: * @font: a font. - * @s: (array length=len) (element-type uint8_t): - * @len: - * @glyph: (out): + * @s: (array length=len) (element-type uint8_t): + * @len: + * @glyph: (out): + * * - * * - * Return value: + * Return value: * * Since: 0.9.2 **/ @@ -1300,6 +1300,8 @@ 1000, /* x_scale */ 1000, /* y_scale */ + 1<<16, /* x_mult */ + 1<<16, /* y_mult */ 0, /* x_ppem */ 0, /* y_ppem */ @@ -1330,6 +1332,7 @@ font->klass = hb_font_funcs_get_empty (); font->data.init0 (font); font->x_scale = font->y_scale = hb_face_get_upem (face); + font->x_mult = font->y_mult = 1 << 16; return font; } @@ -1338,9 +1341,9 @@ * hb_font_create: (Xconstructor) * @face: a face. * - * * - * Return value: (transfer full): + * + * Return value: (transfer full): * * Since: 0.9.2 **/ @@ -1361,9 +1364,9 @@ * hb_font_create_sub_font: * @parent: parent font. * - * * - * Return value: (transfer full): + * + * Return value: (transfer full): * * Since: 0.9.2 **/ @@ -1382,14 +1385,13 @@ font->x_scale = parent->x_scale; font->y_scale = parent->y_scale; + font->mults_changed (); font->x_ppem = parent->x_ppem; font->y_ppem = parent->y_ppem; font->ptem = parent->ptem; font->num_coords = parent->num_coords; - if (!font->num_coords) - font->coords = nullptr; - else + if (font->num_coords) { unsigned int size = parent->num_coords * sizeof (parent->coords[0]); font->coords = (int *) malloc (size); @@ -1405,7 +1407,7 @@ /** * hb_font_get_empty: * - * + * * * Return value: (transfer full) * @@ -1421,9 +1423,9 @@ * hb_font_reference: (skip) * @font: a font. * - * * - * Return value: (transfer full): + * + * Return value: (transfer full): * * Since: 0.9.2 **/ @@ -1437,7 +1439,7 @@ * hb_font_destroy: (skip) * @font: a font. * - * + * * * Since: 0.9.2 **/ @@ -1463,14 +1465,14 @@ /** * hb_font_set_user_data: (skip) * @font: a font. - * @key: - * @data: - * @destroy: - * @replace: + * @key: + * @data: + * @destroy: + * @replace: * - * * - * Return value: + * + * Return value: * * Since: 0.9.2 **/ @@ -1487,11 +1489,11 @@ /** * hb_font_get_user_data: (skip) * @font: a font. - * @key: + * @key: * - * * - * Return value: (transfer none): + * + * Return value: (transfer none): * * Since: 0.9.2 **/ @@ -1506,7 +1508,7 @@ * hb_font_make_immutable: * @font: a font. * - * + * * * Since: 0.9.2 **/ @@ -1526,9 +1528,9 @@ * hb_font_is_immutable: * @font: a font. * - * * - * Return value: + * + * Return value: * * Since: 0.9.2 **/ @@ -1568,9 +1570,9 @@ * hb_font_get_parent: * @font: a font. * - * * - * Return value: (transfer none): + * + * Return value: (transfer none): * * Since: 0.9.2 **/ @@ -1601,7 +1603,9 @@ hb_face_t *old = font->face; + hb_face_make_immutable (face); font->face = hb_face_reference (face); + font->mults_changed (); hb_face_destroy (old); } @@ -1610,9 +1614,9 @@ * hb_font_get_face: * @font: a font. * - * * - * Return value: (transfer none): + * + * Return value: (transfer none): * * Since: 0.9.2 **/ @@ -1627,10 +1631,10 @@ * hb_font_set_funcs: * @font: a font. * @klass: (closure font_data) (destroy destroy) (scope notified): - * @font_data: - * @destroy: + * @font_data: + * @destroy: + * * - * * * Since: 0.9.2 **/ @@ -1664,16 +1668,16 @@ * hb_font_set_funcs_data: * @font: a font. * @font_data: (destroy destroy) (scope notified): - * @destroy: + * @destroy: + * * - * * * Since: 0.9.2 **/ void hb_font_set_funcs_data (hb_font_t *font, - void *font_data, - hb_destroy_func_t destroy) + void *font_data, + hb_destroy_func_t destroy) { /* Destroy user_data? */ if (hb_object_is_immutable (font)) @@ -1694,10 +1698,10 @@ /** * hb_font_set_scale: * @font: a font. - * @x_scale: - * @y_scale: + * @x_scale: + * @y_scale: + * * - * * * Since: 0.9.2 **/ @@ -1711,15 +1715,16 @@ font->x_scale = x_scale; font->y_scale = y_scale; + font->mults_changed (); } /** * hb_font_get_scale: * @font: a font. - * @x_scale: (out): - * @y_scale: (out): + * @x_scale: (out): + * @y_scale: (out): + * * - * * * Since: 0.9.2 **/ @@ -1735,10 +1740,10 @@ /** * hb_font_set_ppem: * @font: a font. - * @x_ppem: - * @y_ppem: + * @x_ppem: + * @y_ppem: + * * - * * * Since: 0.9.2 **/ @@ -1757,10 +1762,10 @@ /** * hb_font_get_ppem: * @font: a font. - * @x_ppem: (out): - * @y_ppem: (out): + * @x_ppem: (out): + * @y_ppem: (out): + * * - * * * Since: 0.9.2 **/ @@ -1809,6 +1814,7 @@ return font->ptem; } +#ifndef HB_NO_VAR /* * Variations */ @@ -1824,7 +1830,6 @@ font->num_coords = coords_length; } -#ifndef HB_NO_VAR /** * hb_font_set_variations: * @@ -1855,6 +1860,7 @@ normalized, coords_length); _hb_font_adopt_var_coords_normalized (font, normalized, coords_length); } + /** * hb_font_set_var_coords_design: * @@ -1875,7 +1881,33 @@ hb_ot_var_normalize_coords (font->face, coords_length, coords, normalized); _hb_font_adopt_var_coords_normalized (font, normalized, coords_length); } -#endif + +/** + * hb_font_set_var_named_instance: + * @font: a font. + * @instance_index: named instance index. + * + * Sets design coords of a font from a named instance index. + * + * Since: 2.6.0 + */ +void +hb_font_set_var_named_instance (hb_font_t *font, + unsigned instance_index) +{ + if (hb_object_is_immutable (font)) + return; + + unsigned int coords_length = hb_ot_var_named_instance_get_design_coords (font->face, instance_index, nullptr, nullptr); + + float *coords = coords_length ? (float *) calloc (coords_length, sizeof (float)) : nullptr; + if (unlikely (coords_length && !coords)) + return; + + hb_ot_var_named_instance_get_design_coords (font->face, instance_index, &coords_length, coords); + hb_font_set_var_coords_design (font, coords, coords_length); + free (coords); +} /** * hb_font_set_var_coords_normalized: @@ -1917,7 +1949,7 @@ return font->coords; } - +#endif #ifndef HB_DISABLE_DEPRECATED /* diff -Nru harfbuzz-2.5.3/src/hb-font.h harfbuzz-2.6.2/src/hb-font.h --- harfbuzz-2.5.3/src/hb-font.h 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-font.h 2019-10-26 02:02:55.000000000 +0000 @@ -224,7 +224,7 @@ * @user_data: * @destroy: * - * + * * * Since: 1.2.3 **/ @@ -256,7 +256,7 @@ * @user_data: * @destroy: * - * + * * * Since: 1.2.3 **/ @@ -272,7 +272,7 @@ * @user_data: * @destroy: * - * + * * * Since: 0.9.2 **/ @@ -288,7 +288,7 @@ * @user_data: * @destroy: * - * + * * * Since: 0.9.2 **/ @@ -304,7 +304,7 @@ * @user_data: * @destroy: * - * + * * * Since: 1.8.6 **/ @@ -320,7 +320,7 @@ * @user_data: * @destroy: * - * + * * * Since: 1.8.6 **/ @@ -336,7 +336,7 @@ * @user_data: * @destroy: * - * + * * * Since: 0.9.2 **/ @@ -352,7 +352,7 @@ * @user_data: * @destroy: * - * + * * * Since: 0.9.2 **/ @@ -368,7 +368,7 @@ * @user_data: * @destroy: * - * + * * * Since: 0.9.2 **/ @@ -384,7 +384,7 @@ * @user_data: * @destroy: * - * + * * * Since: 0.9.2 **/ @@ -400,7 +400,7 @@ * @user_data: * @destroy: * - * + * * * Since: 0.9.2 **/ @@ -416,7 +416,7 @@ * @user_data: * @destroy: * - * + * * * Since: 0.9.2 **/ @@ -432,7 +432,7 @@ * @user_data: * @destroy: * - * + * * * Since: 0.9.2 **/ @@ -705,6 +705,10 @@ hb_font_get_var_coords_normalized (hb_font_t *font, unsigned int *length); +HB_EXTERN void +hb_font_set_var_named_instance (hb_font_t *font, + unsigned instance_index); + HB_END_DECLS #endif /* HB_FONT_H */ diff -Nru harfbuzz-2.5.3/src/hb-font.hh harfbuzz-2.6.2/src/hb-font.hh --- harfbuzz-2.5.3/src/hb-font.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-font.hh 2019-10-26 02:02:55.000000000 +0000 @@ -107,8 +107,10 @@ hb_font_t *parent; hb_face_t *face; - int x_scale; - int y_scale; + int32_t x_scale; + int32_t y_scale; + int64_t x_mult; + int64_t y_mult; unsigned int x_ppem; unsigned int y_ppem; @@ -127,16 +129,16 @@ /* Convert from font-space to user-space */ - int dir_scale (hb_direction_t direction) - { return HB_DIRECTION_IS_VERTICAL(direction) ? y_scale : x_scale; } - hb_position_t em_scale_x (int16_t v) { return em_scale (v, x_scale); } - hb_position_t em_scale_y (int16_t v) { return em_scale (v, y_scale); } - hb_position_t em_scalef_x (float v) { return em_scalef (v, this->x_scale); } - hb_position_t em_scalef_y (float v) { return em_scalef (v, this->y_scale); } + int64_t dir_mult (hb_direction_t direction) + { return HB_DIRECTION_IS_VERTICAL(direction) ? y_mult : x_mult; } + hb_position_t em_scale_x (int16_t v) { return em_mult (v, x_mult); } + hb_position_t em_scale_y (int16_t v) { return em_mult (v, y_mult); } + hb_position_t em_scalef_x (float v) { return em_scalef (v, x_scale); } + hb_position_t em_scalef_y (float v) { return em_scalef (v, y_scale); } float em_fscale_x (int16_t v) { return em_fscale (v, x_scale); } float em_fscale_y (int16_t v) { return em_fscale (v, y_scale); } hb_position_t em_scale_dir (int16_t v, hb_direction_t direction) - { return em_scale (v, dir_scale (direction)); } + { return em_mult (v, dir_mult (direction)); } /* Convert from parent-font user-space to our user-space */ hb_position_t parent_scale_x_distance (hb_position_t v) @@ -607,12 +609,16 @@ return false; } - hb_position_t em_scale (int16_t v, int scale) + void mults_changed () { - int upem = face->get_upem (); - int64_t scaled = v * (int64_t) scale; - scaled += scaled >= 0 ? upem/2 : -upem/2; /* Round. */ - return (hb_position_t) (scaled / upem); + signed upem = face->get_upem (); + x_mult = ((int64_t) x_scale << 16) / upem; + y_mult = ((int64_t) y_scale << 16) / upem; + } + + hb_position_t em_mult (int16_t v, int64_t mult) + { + return (hb_position_t) ((v * mult) >> 16); } hb_position_t em_scalef (float v, int scale) { return (hb_position_t) roundf (v * scale / face->get_upem ()); } diff -Nru harfbuzz-2.5.3/src/hb-ft.cc harfbuzz-2.6.2/src/hb-ft.cc --- harfbuzz-2.5.3/src/hb-ft.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ft.cc 2019-10-26 02:02:55.000000000 +0000 @@ -471,7 +471,7 @@ /* Check whether the given name was actually the name of glyph 0. */ char buf[128]; if (!FT_Get_Glyph_Name(ft_face, 0, buf, sizeof (buf)) && - len < 0 ? !strcmp (buf, name) : !strncmp (buf, name, len)) + len < 0 ? !strcmp (buf, name) : !strncmp (buf, name, len)) return true; } @@ -564,7 +564,7 @@ static hb_blob_t * -reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data) +_hb_ft_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data) { FT_Face ft_face = (FT_Face) user_data; FT_Byte *buffer; @@ -619,7 +619,7 @@ face = hb_face_create (blob, ft_face->face_index); hb_blob_destroy (blob); } else { - face = hb_face_create_for_tables (reference_table, ft_face, destroy); + face = hb_face_create_for_tables (_hb_ft_reference_table, ft_face, destroy); } hb_face_set_index (face, ft_face->face_index); @@ -840,8 +840,8 @@ return; } - if (FT_Select_Charmap (ft_face, FT_ENCODING_UNICODE)) - FT_Select_Charmap (ft_face, FT_ENCODING_MS_SYMBOL); + if (FT_Select_Charmap (ft_face, FT_ENCODING_MS_SYMBOL)) + FT_Select_Charmap (ft_face, FT_ENCODING_UNICODE); FT_Set_Char_Size (ft_face, abs (font->x_scale), abs (font->y_scale), @@ -866,7 +866,7 @@ if (ft_coords) { for (unsigned int i = 0; i < num_coords; i++) - ft_coords[i] = coords[i] << 2; + ft_coords[i] = coords[i] * 4; FT_Set_Var_Blend_Coordinates (ft_face, num_coords, ft_coords); free (ft_coords); } diff -Nru harfbuzz-2.5.3/src/hb-gdi.cc harfbuzz-2.6.2/src/hb-gdi.cc --- harfbuzz-2.5.3/src/hb-gdi.cc 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-gdi.cc 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,73 @@ +/* + * Copyright © 2019 Ebrahim Byagowi + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#include "hb.hh" + +#ifdef HAVE_GDI + +#include "hb-gdi.h" + +static hb_blob_t * +_hb_gdi_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data) +{ + char *buffer = nullptr; + DWORD length = 0; + + HDC hdc = GetDC (nullptr); + if (unlikely (!SelectObject (hdc, (HFONT) user_data))) goto fail; + + length = GetFontData (hdc, hb_uint32_swap (tag), 0, buffer, length); + if (unlikely (length == GDI_ERROR)) goto fail_with_releasedc; + + buffer = (char *) malloc (length); + if (unlikely (!buffer)) goto fail_with_releasedc; + length = GetFontData (hdc, hb_uint32_swap (tag), 0, buffer, length); + if (unlikely (length == GDI_ERROR)) goto fail_with_releasedc_and_free; + ReleaseDC (nullptr, hdc); + + return hb_blob_create ((const char *) buffer, length, HB_MEMORY_MODE_WRITABLE, buffer, free); + +fail_with_releasedc_and_free: + free (buffer); +fail_with_releasedc: + ReleaseDC (nullptr, hdc); +fail: + return hb_blob_get_empty (); +} + +/** + * hb_gdi_face_create: + * @hfont: a HFONT object. + * + * Return value: #hb_face_t object corresponding to the given input + * + * Since: 2.6.0 + **/ +hb_face_t * +hb_gdi_face_create (HFONT hfont) +{ + return hb_face_create_for_tables (_hb_gdi_reference_table, (void *) hfont, nullptr); +} + +#endif diff -Nru harfbuzz-2.5.3/src/hb-gdi.h harfbuzz-2.6.2/src/hb-gdi.h --- harfbuzz-2.5.3/src/hb-gdi.h 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-gdi.h 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,39 @@ +/* + * Copyright © 2019 Ebrahim Byagowi + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#ifndef HB_GDI_H +#define HB_GDI_H + +#include "hb.h" + +#include + +HB_BEGIN_DECLS + +HB_EXTERN hb_face_t * +hb_gdi_face_create (HFONT hfont); + +HB_END_DECLS + +#endif /* HB_GDI_H */ diff -Nru harfbuzz-2.5.3/src/hb-graphite2.cc harfbuzz-2.6.2/src/hb-graphite2.cc --- harfbuzz-2.5.3/src/hb-graphite2.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-graphite2.cc 2019-10-26 02:02:55.000000000 +0000 @@ -106,32 +106,6 @@ return d; } -static void hb_graphite2_release_table(const void *data, const void *table_buffer) -{ - hb_graphite2_face_data_t *face_data = (hb_graphite2_face_data_t *) data; - hb_graphite2_tablelist_t *tlist = face_data->tlist; - - hb_graphite2_tablelist_t *prev = nullptr; - hb_graphite2_tablelist_t *curr = tlist; - while (curr) - { - if (hb_blob_get_data(curr->blob, nullptr) == table_buffer) - { - if (prev == nullptr) - face_data->tlist.cmpexch(tlist, curr->next); - else - prev->next = curr->next; - hb_blob_destroy(curr->blob); - free(curr); - break; - } - prev = curr; - curr = curr->next; - } -} - -static gr_face_ops hb_graphite2_face_ops = { sizeof(gr_face_ops), hb_graphite2_get_table, hb_graphite2_release_table }; - hb_graphite2_face_data_t * _hb_graphite2_shaper_face_data_create (hb_face_t *face) { @@ -150,7 +124,7 @@ return nullptr; data->face = face; - data->grface = gr_make_face_with_ops (data, &hb_graphite2_face_ops, gr_face_preloadAll); + data->grface = gr_make_face (data, &hb_graphite2_get_table, gr_face_preloadAll); if (unlikely (!data->grface)) { free (data); @@ -366,14 +340,14 @@ c->num_glyphs = 0; if (HB_DIRECTION_IS_BACKWARD(buffer->props.direction)) { - c->advance = curradv - gr_slot_origin_X(is) * xscale; - curradv -= c->advance; + c->advance = curradv - gr_slot_origin_X(is) * xscale; + curradv -= c->advance; } else { - c->advance = 0; - clusters[ci].advance += gr_slot_origin_X(is) * xscale - curradv; - curradv += clusters[ci].advance; + c->advance = 0; + clusters[ci].advance += gr_slot_origin_X(is) * xscale - curradv; + curradv += clusters[ci].advance; } ci++; } diff -Nru harfbuzz-2.5.3/src/hb.hh harfbuzz-2.6.2/src/hb.hh --- harfbuzz-2.5.3/src/hb.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb.hh 2019-10-26 02:02:55.000000000 +0000 @@ -98,6 +98,7 @@ #ifndef HB_NO_PRAGMA_GCC_DIAGNOSTIC_WARNING #pragma GCC diagnostic warning "-Wbuiltin-macro-redefined" #pragma GCC diagnostic warning "-Wdeprecated" +#pragma GCC diagnostic warning "-Wdeprecated-declarations" #pragma GCC diagnostic warning "-Wdisabled-optimization" #pragma GCC diagnostic warning "-Wdouble-promotion" #pragma GCC diagnostic warning "-Wformat=2" @@ -179,7 +180,6 @@ #include #include #include -#include #include #include @@ -241,7 +241,7 @@ #define HB_CONST_FUNC #define HB_PRINTF_FUNC(format_idx, arg_idx) #endif -#if defined(__GNUC__) && (__GNUC__ >= 4) +#if defined(__GNUC__) && (__GNUC__ >= 4) || (__clang__) #define HB_UNUSED __attribute__((unused)) #elif defined(_MSC_VER) /* https://github.com/harfbuzz/harfbuzz/issues/635 */ #define HB_UNUSED __pragma(warning(suppress: 4100 4101)) @@ -317,7 +317,8 @@ # define HB_FALLTHROUGH /* FALLTHROUGH */ #endif -#ifdef __clang__ +/* https://github.com/harfbuzz/harfbuzz/issues/1852 */ +#if defined(__clang__) && !(defined(_AIX) && (defined(__IBMCPP__) || defined(__ibmxl__))) /* Disable certain sanitizer errors. */ /* https://github.com/harfbuzz/harfbuzz/issues/1247 */ #define HB_NO_SANITIZE_SIGNED_INTEGER_OVERFLOW __attribute__((no_sanitize("signed-integer-overflow"))) @@ -353,7 +354,7 @@ # endif # if _WIN32_WCE < 0x800 # define HB_NO_SETLOCALE -static int errno = 0; /* Use something better? */ +# define HB_NO_ERRNO # endif # elif defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP) # ifndef HB_NO_GETENV @@ -369,6 +370,12 @@ #define getenv(Name) nullptr #endif +#ifdef HB_NO_ERRNO +static int errno = 0; /* Use something better? */ +#else +#include +#endif + #if defined(HAVE_ATEXIT) && !defined(HB_USE_ATEXIT) /* atexit() is only safe to be called from shared libraries on certain * platforms. Whitelist. @@ -473,8 +480,24 @@ /* Size signifying variable-sized array */ -#define VAR 1 +#ifndef HB_VAR_ARRAY +#define HB_VAR_ARRAY 1 +#endif + +static inline double +_hb_roundf (float x) +{ + return x >= 0 ? floor ((double) x + .5) : ceil ((double) x - .5); +} +#ifndef HAVE_ROUNDF +#define roundf(x) _hb_roundf(x) +#endif +/* Endian swap, used in Windows related backends */ +static inline uint16_t hb_uint16_swap (const uint16_t v) +{ return (v >> 8) | (v << 8); } +static inline uint32_t hb_uint32_swap (const uint32_t v) +{ return (hb_uint16_swap (v) << 16) | hb_uint16_swap (v >> 16); } /* * Big-endian integers. Here because fundamental. @@ -519,7 +542,7 @@ #endif #endif return (v[0] << 8) - + (v[1] ); + + (v[1] ); } private: uint8_t v[2]; }; @@ -537,8 +560,8 @@ operator Type () const { return (v[0] << 16) - + (v[1] << 8) - + (v[2] ); + + (v[1] << 8) + + (v[2] ); } private: uint8_t v[3]; }; @@ -557,9 +580,9 @@ operator Type () const { return (v[0] << 24) - + (v[1] << 16) - + (v[2] << 8) - + (v[3] ); + + (v[1] << 16) + + (v[2] << 8) + + (v[3] ); } private: uint8_t v[4]; }; @@ -578,9 +601,10 @@ * them directly.*/ #include "hb-meta.hh" #include "hb-mutex.hh" +#include "hb-number.hh" #include "hb-atomic.hh" // Requires: hb-meta #include "hb-null.hh" // Requires: hb-meta -#include "hb-algs.hh" // Requires: hb-meta hb-null +#include "hb-algs.hh" // Requires: hb-meta hb-null hb-number #include "hb-iter.hh" // Requires: hb-algs hb-meta #include "hb-debug.hh" // Requires: hb-algs hb-atomic #include "hb-array.hh" // Requires: hb-algs hb-iter hb-null diff -Nru harfbuzz-2.5.3/src/hb-icu.cc harfbuzz-2.6.2/src/hb-icu.cc --- harfbuzz-2.5.3/src/hb-icu.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-icu.cc 2019-10-26 02:02:55.000000000 +0000 @@ -41,6 +41,12 @@ #include #include +/* ICU extra semicolon, fixed since 65, https://github.com/unicode-org/icu/commit/480bec3 */ +#if U_ICU_VERSION_MAJOR_NUM < 65 && (defined(__GNUC__) || defined(__clang__)) +#define HB_ICU_EXTRA_SEMI_IGNORED +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wextra-semi-stmt" +#endif /** * SECTION:hb-icu @@ -51,10 +57,6 @@ * Functions for using HarfBuzz with the ICU library to provide Unicode data. **/ -/* ICU doesn't do-while(0) around their statements. Ugh! - * https://unicode-org.atlassian.net/browse/CLDR-13027 */ -#define HB_ICU_STMT(S) do { S } while (0) - hb_script_t hb_icu_script_to_script (UScriptCode script) { @@ -188,9 +190,9 @@ len = 0; err = false; - HB_ICU_STMT (U16_APPEND (utf16, len, ARRAY_LENGTH (utf16), a, err)); + U16_APPEND (utf16, len, ARRAY_LENGTH (utf16), a, err); if (err) return false; - HB_ICU_STMT (U16_APPEND (utf16, len, ARRAY_LENGTH (utf16), b, err)); + U16_APPEND (utf16, len, ARRAY_LENGTH (utf16), b, err); if (err) return false; icu_err = U_ZERO_ERROR; @@ -198,7 +200,7 @@ if (U_FAILURE (icu_err)) return false; if (u_countChar32 (normalized, len) == 1) { - HB_ICU_STMT (U16_GET_UNSAFE (normalized, 0, *ab)); + U16_GET_UNSAFE (normalized, 0, *ab); ret = true; } else { ret = false; @@ -226,13 +228,13 @@ len = u_countChar32 (decomposed, len); if (len == 1) { - HB_ICU_STMT (U16_GET_UNSAFE (decomposed, 0, *a)); + U16_GET_UNSAFE (decomposed, 0, *a); *b = 0; return *a != ab; } else if (len == 2) { - len =0; - HB_ICU_STMT (U16_NEXT_UNSAFE (decomposed, len, *a)); - HB_ICU_STMT (U16_NEXT_UNSAFE (decomposed, len, *b)); + len = 0; + U16_NEXT_UNSAFE (decomposed, len, *a); + U16_NEXT_UNSAFE (decomposed, len, *b); } return true; } @@ -252,7 +254,7 @@ len = 0; err = false; - HB_ICU_STMT (U16_APPEND (utf16, len, ARRAY_LENGTH (utf16), ab, err)); + U16_APPEND (utf16, len, ARRAY_LENGTH (utf16), ab, err); if (err) return false; icu_err = U_ZERO_ERROR; @@ -263,13 +265,13 @@ len = u_countChar32 (normalized, len); if (len == 1) { - HB_ICU_STMT (U16_GET_UNSAFE (normalized, 0, *a)); + U16_GET_UNSAFE (normalized, 0, *a); *b = 0; ret = *a != ab; } else if (len == 2) { - len =0; - HB_ICU_STMT (U16_NEXT_UNSAFE (normalized, len, *a)); - HB_ICU_STMT (U16_NEXT_UNSAFE (normalized, len, *b)); + len = 0; + U16_NEXT_UNSAFE (normalized, len, *a); + U16_NEXT_UNSAFE (normalized, len, *b); /* Here's the ugly part: if ab decomposes to a single character and * that character decomposes again, we have to detect that and undo @@ -280,7 +282,7 @@ if (U_FAILURE (icu_err)) return false; hb_codepoint_t c; - HB_ICU_STMT (U16_GET_UNSAFE (recomposed, 0, c)); + U16_GET_UNSAFE (recomposed, 0, c); if (c != *a && c != ab) { *a = c; *b = 0; @@ -289,7 +291,7 @@ } else { /* If decomposed to more than two characters, take the last one, * and recompose the rest to get the first component. */ - HB_ICU_STMT (U16_PREV_UNSAFE (normalized, len, *b)); /* Changes len in-place. */ + U16_PREV_UNSAFE (normalized, len, *b); /* Changes len in-place. */ UChar recomposed[18 * 2]; icu_err = U_ZERO_ERROR; len = unorm2_normalize (unorm2_getNFCInstance (&icu_err), normalized, len, recomposed, ARRAY_LENGTH (recomposed), &icu_err); @@ -298,7 +300,7 @@ /* We expect that recomposed has exactly one character now. */ if (unlikely (u_countChar32 (recomposed, len) != 1)) return false; - HB_ICU_STMT (U16_GET_UNSAFE (recomposed, 0, *a)); + U16_GET_UNSAFE (recomposed, 0, *a); ret = true; } @@ -354,5 +356,8 @@ return static_icu_funcs.get_unconst (); } +#ifdef HB_ICU_EXTRA_SEMI_IGNORED +#pragma GCC diagnostic pop +#endif #endif diff -Nru harfbuzz-2.5.3/src/hb-iter.hh harfbuzz-2.6.2/src/hb-iter.hh --- harfbuzz-2.5.3/src/hb-iter.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-iter.hh 2019-10-26 02:02:55.000000000 +0000 @@ -64,7 +64,7 @@ struct hb_iter_t { typedef Item item_t; - static constexpr unsigned item_size = hb_static_size (Item); + constexpr unsigned get_item_size () const { return hb_static_size (Item); } static constexpr bool is_iterator = true; static constexpr bool is_random_access_iterator = false; static constexpr bool is_sorted_iterator = false; @@ -72,7 +72,7 @@ private: /* https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern */ const iter_t* thiz () const { return static_cast (this); } - iter_t* thiz () { return static_cast< iter_t *> (this); } + iter_t* thiz () { return static_cast< iter_t *> (this); } public: /* TODO: @@ -130,7 +130,7 @@ using item_t = typename Name::item_t; \ using Name::begin; \ using Name::end; \ - using Name::item_size; \ + using Name::get_item_size; \ using Name::is_iterator; \ using Name::iter; \ using Name::operator bool; \ @@ -156,6 +156,7 @@ template struct hb_array_t; +template struct hb_sorted_array_t; struct { @@ -175,6 +176,14 @@ } HB_FUNCOBJ (hb_iter); +struct +{ + template unsigned + operator () (T&& c) const + { return c.len (); } + +} +HB_FUNCOBJ (hb_len); /* Mixin to fill in what the subclass doesn't provide. */ template @@ -183,7 +192,7 @@ private: /* https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern */ const iter_t* thiz () const { return static_cast (this); } - iter_t* thiz () { return static_cast< iter_t *> (this); } + iter_t* thiz () { return static_cast< iter_t *> (this); } public: /* Access: Implement __item__(), or __item_at__() if random-access. */ @@ -480,7 +489,7 @@ template + typename AccuT = hb_decay> AccuT operator () (Iter it) { @@ -563,7 +572,7 @@ B b; }; struct -{ +{ HB_PARTIALIZE(2); template hb_zip_iter_t, hb_iter_type> @@ -602,18 +611,18 @@ } HB_FUNCOBJ (hb_apply); -/* hb_iota()/hb_range() */ +/* hb_range()/hb_iota()/hb_repeat() */ template -struct hb_counter_iter_t : - hb_iter_t, T> +struct hb_range_iter_t : + hb_iter_t, T> { - hb_counter_iter_t (T start, T end_, S step) : v (start), end_ (end_for (start, end_, step)), step (step) {} + hb_range_iter_t (T start, T end_, S step) : v (start), end_ (end_for (start, end_, step)), step (step) {} typedef T __item_t__; static constexpr bool is_random_access_iterator = true; static constexpr bool is_sorted_iterator = true; - __item_t__ __item__ () const { return +v; } + __item_t__ __item__ () const { return hb_ridentity (v); } __item_t__ __item_at__ (unsigned j) const { return v + j * step; } bool __more__ () const { return v != end_; } unsigned __len__ () const { return !step ? UINT_MAX : (end_ - v) / step; } @@ -621,8 +630,8 @@ void __forward__ (unsigned n) { v += n * step; } void __prev__ () { v -= step; } void __rewind__ (unsigned n) { v -= n * step; } - hb_counter_iter_t __end__ () const { return hb_counter_iter_t (end_, end_, step); } - bool operator != (const hb_counter_iter_t& o) const + hb_range_iter_t __end__ () const { return hb_range_iter_t (end_, end_, step); } + bool operator != (const hb_range_iter_t& o) const { return v != o.v; } private: @@ -644,24 +653,91 @@ }; struct { - template hb_counter_iter_t - operator () (T start = 0u, S&& step = 1u) const - { return hb_counter_iter_t (start, step >= 0 ? hb_int_max (T) : hb_int_min (T), step); } + template hb_range_iter_t + operator () (T end = (unsigned) -1) const + { return hb_range_iter_t (0, end, 1u); } + + template hb_range_iter_t + operator () (T start, T end, S step = 1u) const + { return hb_range_iter_t (start, end, step); } } -HB_FUNCOBJ (hb_iota); +HB_FUNCOBJ (hb_range); + +template +struct hb_iota_iter_t : + hb_iter_with_fallback_t, T> +{ + hb_iota_iter_t (T start, S step) : v (start), step (step) {} + + private: + + template + auto + inc (hb_type_identity s, hb_priority<1>) + -> hb_void_t (s), hb_declval ()))> + { v = hb_invoke (hb_forward (s), v); } + + void + inc (S s, hb_priority<0>) + { v += s; } + + public: + + typedef T __item_t__; + static constexpr bool is_random_access_iterator = true; + static constexpr bool is_sorted_iterator = true; + __item_t__ __item__ () const { return hb_ridentity (v); } + bool __more__ () const { return true; } + unsigned __len__ () const { return UINT_MAX; } + void __next__ () { inc (step, hb_prioritize); } + void __prev__ () { v -= step; } + hb_iota_iter_t __end__ () const { return *this; } + bool operator != (const hb_iota_iter_t& o) const { return true; } + + private: + T v; + S step; +}; struct { - template hb_counter_iter_t - operator () (T end = (unsigned) -1) const - { return hb_counter_iter_t (0, end, 1u); } + template hb_iota_iter_t + operator () (T start = 0u, S step = 1u) const + { return hb_iota_iter_t (start, step); } +} +HB_FUNCOBJ (hb_iota); + +template +struct hb_repeat_iter_t : + hb_iter_t, T> +{ + hb_repeat_iter_t (T value) : v (value) {} - template hb_counter_iter_t - operator () (T start, T end, S&& step = 1u) const - { return hb_counter_iter_t (start, end, step); } + typedef T __item_t__; + static constexpr bool is_random_access_iterator = true; + static constexpr bool is_sorted_iterator = true; + __item_t__ __item__ () const { return v; } + __item_t__ __item_at__ (unsigned j) const { return v; } + bool __more__ () const { return true; } + unsigned __len__ () const { return UINT_MAX; } + void __next__ () {} + void __forward__ (unsigned) {} + void __prev__ () {} + void __rewind__ (unsigned) {} + hb_repeat_iter_t __end__ () const { return *this; } + bool operator != (const hb_repeat_iter_t& o) const { return true; } + + private: + T v; +}; +struct +{ + template hb_repeat_iter_t + operator () (T value) const + { return hb_repeat_iter_t (value); } } -HB_FUNCOBJ (hb_range); +HB_FUNCOBJ (hb_repeat); -/* hb_enumerate */ +/* hb_enumerate()/hb_take() */ struct { @@ -673,6 +749,37 @@ } HB_FUNCOBJ (hb_enumerate); +struct +{ HB_PARTIALIZE(2); + template + auto operator () (Iterable&& it, unsigned count) const HB_AUTO_RETURN + ( hb_zip (hb_range (count), it) | hb_map (hb_second) ) + + /* Specialization arrays. */ + + template inline hb_array_t + operator () (hb_array_t array, unsigned count) const + { return array.sub_array (0, count); } + + template inline hb_sorted_array_t + operator () (hb_sorted_array_t array, unsigned count) const + { return array.sub_array (0, count); } +} +HB_FUNCOBJ (hb_take); + +struct +{ HB_PARTIALIZE(2); + template + auto operator () (Iter it, unsigned count) const HB_AUTO_RETURN + ( + + hb_iota (it, hb_add (count)) + | hb_map (hb_take (count)) + | hb_take ((hb_len (it) + count - 1) / count) + ) +} +HB_FUNCOBJ (hb_chop); /* hb_sink() */ diff -Nru harfbuzz-2.5.3/src/hb-kern.hh harfbuzz-2.6.2/src/hb-kern.hh --- harfbuzz-2.5.3/src/hb-kern.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-kern.hh 2019-10-26 02:02:55.000000000 +0000 @@ -82,11 +82,11 @@ if (likely (!kern)) - goto skip; + goto skip; if (horizontal) { - if (scale) + if (scale) kern = font->em_scale_x (kern); if (crossStream) { @@ -104,7 +104,7 @@ } else { - if (scale) + if (scale) kern = font->em_scale_y (kern); if (crossStream) { diff -Nru harfbuzz-2.5.3/src/hb-machinery.hh harfbuzz-2.6.2/src/hb-machinery.hh --- harfbuzz-2.5.3/src/hb-machinery.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-machinery.hh 2019-10-26 02:02:55.000000000 +0000 @@ -135,7 +135,7 @@ #define DEFINE_SIZE_ARRAY(size, array) \ DEFINE_COMPILES_ASSERTION ((void) (array)[0].static_size) \ - DEFINE_INSTANCE_ASSERTION (sizeof (*this) == (size) + VAR * sizeof ((array)[0])) \ + DEFINE_INSTANCE_ASSERTION (sizeof (*this) == (size) + HB_VAR_ARRAY * sizeof ((array)[0])) \ static constexpr unsigned null_size = (size); \ static constexpr unsigned min_size = (size) @@ -225,7 +225,7 @@ if (unlikely (!cmpexch (nullptr, p))) { - do_destroy (p); + do_destroy (p); goto retry; } } diff -Nru harfbuzz-2.5.3/src/hb-meta.hh harfbuzz-2.6.2/src/hb-meta.hh --- harfbuzz-2.5.3/src/hb-meta.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-meta.hh 2019-10-26 02:02:55.000000000 +0000 @@ -80,8 +80,8 @@ struct { - template - T* operator () (T& arg) const + template constexpr T* + operator () (T& arg) const { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" @@ -171,29 +171,29 @@ /* std::move and std::forward */ template -static hb_remove_reference&& hb_move (T&& t) { return (hb_remove_reference&&) (t); } +static constexpr hb_remove_reference&& hb_move (T&& t) { return (hb_remove_reference&&) (t); } template -static T&& hb_forward (hb_remove_reference& t) { return (T&&) t; } +static constexpr T&& hb_forward (hb_remove_reference& t) { return (T&&) t; } template -static T&& hb_forward (hb_remove_reference&& t) { return (T&&) t; } +static constexpr T&& hb_forward (hb_remove_reference&& t) { return (T&&) t; } struct { - template auto + template constexpr auto operator () (T&& v) const HB_AUTO_RETURN (hb_forward (v)) - template auto + template constexpr auto operator () (T *v) const HB_AUTO_RETURN (*v) } HB_FUNCOBJ (hb_deref); struct { - template auto + template constexpr auto operator () (T&& v) const HB_AUTO_RETURN (hb_forward (v)) - template auto + template constexpr auto operator () (T& v) const HB_AUTO_RETURN (hb_addressof (v)) } HB_FUNCOBJ (hb_ref); diff -Nru harfbuzz-2.5.3/src/hb-number.cc harfbuzz-2.6.2/src/hb-number.cc --- harfbuzz-2.5.3/src/hb-number.cc 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-number.cc 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,147 @@ +/* + * Copyright © 2019 Ebrahim Byagowi + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + */ + +#include "hb.hh" +#include "hb-machinery.hh" +#include "hb-number-parser.hh" + +#include +#ifdef HAVE_XLOCALE_H +#include +#endif + +template +static bool +_parse_number (const char **pp, const char *end, T *pv, + bool whole_buffer, Func f) +{ + char buf[32]; + unsigned int len = hb_min (ARRAY_LENGTH (buf) - 1, + (unsigned int) (end - *pp)); + strncpy (buf, *pp, len); + buf[len] = '\0'; + + char *p = buf; + char *pend = p; + + errno = 0; + *pv = f (p, &pend); + if (unlikely (errno || p == pend || + /* Check if consumed whole buffer if is requested */ + (whole_buffer && pend - p != end - *pp))) return false; + + *pp += pend - p; + return true; +} + +bool +hb_parse_int (const char **pp, const char *end, int *pv, bool whole_buffer) +{ + return _parse_number (pp, end, pv, whole_buffer, + [] (const char *p, char **end) + { return strtol (p, end, 10); }); +} + +bool +hb_parse_uint (const char **pp, const char *end, unsigned int *pv, + bool whole_buffer, int base) +{ + return _parse_number (pp, end, pv, whole_buffer, + [base] (const char *p, char **end) + { return strtoul (p, end, base); }); +} + + +#if defined (HAVE_NEWLOCALE) && defined (HAVE_STRTOD_L) +#define USE_XLOCALE 1 +#define HB_LOCALE_T locale_t +#define HB_CREATE_LOCALE(locName) newlocale (LC_ALL_MASK, locName, nullptr) +#define HB_FREE_LOCALE(loc) freelocale (loc) +#elif defined(_MSC_VER) +#define USE_XLOCALE 1 +#define HB_LOCALE_T _locale_t +#define HB_CREATE_LOCALE(locName) _create_locale (LC_ALL, locName) +#define HB_FREE_LOCALE(loc) _free_locale (loc) +#define strtod_l(a, b, c) _strtod_l ((a), (b), (c)) +#endif + +#ifdef USE_XLOCALE + +#if HB_USE_ATEXIT +static void free_static_C_locale (); +#endif + +static struct hb_C_locale_lazy_loader_t : hb_lazy_loader_t, + hb_C_locale_lazy_loader_t> +{ + static HB_LOCALE_T create () + { + HB_LOCALE_T C_locale = HB_CREATE_LOCALE ("C"); + +#if HB_USE_ATEXIT + atexit (free_static_C_locale); +#endif + + return C_locale; + } + static void destroy (HB_LOCALE_T p) + { + HB_FREE_LOCALE (p); + } + static HB_LOCALE_T get_null () + { + return nullptr; + } +} static_C_locale; + +#if HB_USE_ATEXIT +static +void free_static_C_locale () +{ + static_C_locale.free_instance (); +} +#endif + +static HB_LOCALE_T +get_C_locale () +{ + return static_C_locale.get_unconst (); +} +#endif /* USE_XLOCALE */ + +bool +hb_parse_double (const char **pp, const char *end, double *pv, + bool whole_buffer) +{ + return _parse_number (pp, end, pv, whole_buffer, + [] (const char *p, char **end) + { +#ifdef USE_XLOCALE + return strtod_l (p, end, get_C_locale ()); +#else + return strtod_rl (p, end); +#endif + }); +} diff -Nru harfbuzz-2.5.3/src/hb-number.hh harfbuzz-2.6.2/src/hb-number.hh --- harfbuzz-2.5.3/src/hb-number.hh 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-number.hh 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,41 @@ +/* + * Copyright © 2019 Ebrahim Byagowi + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + */ + +#ifndef HB_NUMBER_HH +#define HB_NUMBER_HH + +HB_INTERNAL bool +hb_parse_int (const char **pp, const char *end, int *pv, + bool whole_buffer = false); + +HB_INTERNAL bool +hb_parse_uint (const char **pp, const char *end, unsigned int *pv, + bool whole_buffer = false, int base = 10); + +HB_INTERNAL bool +hb_parse_double (const char **pp, const char *end, double *pv, + bool whole_buffer = false); + +#endif /* HB_NUMBER_HH */ diff -Nru harfbuzz-2.5.3/src/hb-number-parser.hh harfbuzz-2.6.2/src/hb-number-parser.hh --- harfbuzz-2.5.3/src/hb-number-parser.hh 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-number-parser.hh 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,240 @@ + +#line 1 "hb-number-parser.rl" +/* + * Copyright © 2019 Ebrahim Byagowi + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + */ + +#ifndef HB_NUMBER_PARSER_HH +#define HB_NUMBER_PARSER_HH + +#include "hb.hh" + +#include + + +#line 37 "hb-number-parser.hh" +static const unsigned char _double_parser_trans_keys[] = { + 0u, 0u, 43u, 57u, 46u, 57u, 48u, 57u, 43u, 57u, 48u, 57u, 48u, 101u, 48u, 57u, + 46u, 101u, 0 +}; + +static const char _double_parser_key_spans[] = { + 0, 15, 12, 10, 15, 10, 54, 10, + 56 +}; + +static const unsigned char _double_parser_index_offsets[] = { + 0, 0, 16, 29, 40, 56, 67, 122, + 133 +}; + +static const char _double_parser_indicies[] = { + 0, 1, 2, 3, 1, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 1, 3, 1, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 1, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, + 1, 6, 1, 7, 1, 1, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, + 1, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 1, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 9, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 9, 1, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 1, 3, 1, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 9, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 9, 1, 0 +}; + +static const char _double_parser_trans_targs[] = { + 2, 0, 2, 3, 8, 6, 5, 5, + 7, 4 +}; + +static const char _double_parser_trans_actions[] = { + 0, 0, 1, 0, 2, 3, 0, 4, + 5, 0 +}; + +static const int double_parser_start = 1; +static const int double_parser_first_final = 6; +static const int double_parser_error = 0; + +static const int double_parser_en_main = 1; + + +#line 70 "hb-number-parser.rl" + + +/* Works only for n < 512 */ +static inline double +_pow10 (unsigned int exponent) +{ + static const double _powers_of_10[] = + { + 1.0e+256, + 1.0e+128, + 1.0e+64, + 1.0e+32, + 1.0e+16, + 1.0e+8, + 10000., + 100., + 10. + }; + unsigned int mask = 1 << (ARRAY_LENGTH (_powers_of_10) - 1); + double result = 1; + for (const double *power = _powers_of_10; mask; ++power, mask >>= 1) + if (exponent & mask) result *= *power; + return result; +} + +static inline double +strtod_rl (const char *buf, char **end_ptr) +{ + const char *p, *pe; + double value = 0; + double frac = 0; + double frac_count = 0; + unsigned int exp = 0; + bool neg = false, exp_neg = false, exp_overflow = false; + const unsigned long long MAX_FRACT = 0xFFFFFFFFFFFFFull; /* 1^52-1 */ + const unsigned int MAX_EXP = 0x7FFu; /* 1^11-1 */ + p = buf; + pe = p + strlen (p); + + while (p < pe && ISSPACE (*p)) + p++; + + int cs; + +#line 142 "hb-number-parser.hh" + { + cs = double_parser_start; + } + +#line 147 "hb-number-parser.hh" + { + int _slen; + int _trans; + const unsigned char *_keys; + const char *_inds; + if ( p == pe ) + goto _test_eof; + if ( cs == 0 ) + goto _out; +_resume: + _keys = _double_parser_trans_keys + (cs<<1); + _inds = _double_parser_indicies + _double_parser_index_offsets[cs]; + + _slen = _double_parser_key_spans[cs]; + _trans = _inds[ _slen > 0 && _keys[0] <=(*p) && + (*p) <= _keys[1] ? + (*p) - _keys[0] : _slen ]; + + cs = _double_parser_trans_targs[_trans]; + + if ( _double_parser_trans_actions[_trans] == 0 ) + goto _again; + + switch ( _double_parser_trans_actions[_trans] ) { + case 1: +#line 39 "hb-number-parser.rl" + { neg = true; } + break; + case 4: +#line 40 "hb-number-parser.rl" + { exp_neg = true; } + break; + case 2: +#line 42 "hb-number-parser.rl" + { + value = value * 10. + ((*p) - '0'); +} + break; + case 3: +#line 45 "hb-number-parser.rl" + { + if (likely (frac <= MAX_FRACT / 10)) + { + frac = frac * 10. + ((*p) - '0'); + ++frac_count; + } +} + break; + case 5: +#line 52 "hb-number-parser.rl" + { + if (likely (exp * 10 + ((*p) - '0') <= MAX_EXP)) + exp = exp * 10 + ((*p) - '0'); + else + exp_overflow = true; +} + break; +#line 205 "hb-number-parser.hh" + } + +_again: + if ( cs == 0 ) + goto _out; + if ( ++p != pe ) + goto _resume; + _test_eof: {} + _out: {} + } + +#line 116 "hb-number-parser.rl" + + + *end_ptr = (char *) p; + + if (frac_count) value += frac / _pow10 (frac_count); + if (neg) value *= -1.; + + if (unlikely (exp_overflow)) + { + if (value == 0) return value; + if (exp_neg) return neg ? -DBL_MIN : DBL_MIN; + else return neg ? -DBL_MAX : DBL_MAX; + } + + if (exp) + { + if (exp_neg) value /= _pow10 (exp); + else value *= _pow10 (exp); + } + + return value; +} + +#endif /* HB_NUMBER_PARSER_HH */ diff -Nru harfbuzz-2.5.3/src/hb-number-parser.rl harfbuzz-2.6.2/src/hb-number-parser.rl --- harfbuzz-2.5.3/src/hb-number-parser.rl 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-number-parser.rl 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,139 @@ +/* + * Copyright © 2019 Ebrahim Byagowi + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + */ + +#ifndef HB_NUMBER_PARSER_HH +#define HB_NUMBER_PARSER_HH + +#include "hb.hh" + +#include + +%%{ + +machine double_parser; +alphtype unsigned char; +write data; + +action see_neg { neg = true; } +action see_exp_neg { exp_neg = true; } + +action add_int { + value = value * 10. + (fc - '0'); +} +action add_frac { + if (likely (frac <= MAX_FRACT / 10)) + { + frac = frac * 10. + (fc - '0'); + ++frac_count; + } +} +action add_exp { + if (likely (exp * 10 + (fc - '0') <= MAX_EXP)) + exp = exp * 10 + (fc - '0'); + else + exp_overflow = true; +} + +num = [0-9]+; + +main := ( + ( + (('+'|'-'@see_neg)? num @add_int) ('.' num @add_frac)? + | + (('+'|'-'@see_neg)? '.' num @add_frac) + ) + (('e'|'E') (('+'|'-'@see_exp_neg)? num @add_exp))? +); + +}%% + +/* Works only for n < 512 */ +static inline double +_pow10 (unsigned int exponent) +{ + static const double _powers_of_10[] = + { + 1.0e+256, + 1.0e+128, + 1.0e+64, + 1.0e+32, + 1.0e+16, + 1.0e+8, + 10000., + 100., + 10. + }; + unsigned int mask = 1 << (ARRAY_LENGTH (_powers_of_10) - 1); + double result = 1; + for (const double *power = _powers_of_10; mask; ++power, mask >>= 1) + if (exponent & mask) result *= *power; + return result; +} + +static inline double +strtod_rl (const char *buf, char **end_ptr) +{ + const char *p, *pe; + double value = 0; + double frac = 0; + double frac_count = 0; + unsigned int exp = 0; + bool neg = false, exp_neg = false, exp_overflow = false; + const unsigned long long MAX_FRACT = 0xFFFFFFFFFFFFFull; /* 1^52-1 */ + const unsigned int MAX_EXP = 0x7FFu; /* 1^11-1 */ + p = buf; + pe = p + strlen (p); + + while (p < pe && ISSPACE (*p)) + p++; + + int cs; + %%{ + write init; + write exec; + }%% + + *end_ptr = (char *) p; + + if (frac_count) value += frac / _pow10 (frac_count); + if (neg) value *= -1.; + + if (unlikely (exp_overflow)) + { + if (value == 0) return value; + if (exp_neg) return neg ? -DBL_MIN : DBL_MIN; + else return neg ? -DBL_MAX : DBL_MAX; + } + + if (exp) + { + if (exp_neg) value /= _pow10 (exp); + else value *= _pow10 (exp); + } + + return value; +} + +#endif /* HB_NUMBER_PARSER_HH */ diff -Nru harfbuzz-2.5.3/src/hb-object.hh harfbuzz-2.6.2/src/hb-object.hh --- harfbuzz-2.5.3/src/hb-object.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-object.hh 2019-10-26 02:02:55.000000000 +0000 @@ -62,7 +62,7 @@ old.fini (); } else { - item = nullptr; + item = nullptr; l.unlock (); } } else { diff -Nru harfbuzz-2.5.3/src/hb-open-file.hh harfbuzz-2.6.2/src/hb-open-file.hh --- harfbuzz-2.5.3/src/hb-open-file.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-open-file.hh 2019-10-26 02:02:55.000000000 +0000 @@ -92,9 +92,9 @@ if (table_count) { if (start_offset >= tables.len) - *table_count = 0; + *table_count = 0; else - *table_count = hb_min (*table_count, tables.len - start_offset); + *table_count = hb_min (*table_count, tables.len - start_offset); const TableRecord *sub_tables = tables.arrayZ + start_offset; unsigned int count = *table_count; @@ -141,14 +141,15 @@ TableRecord &rec = tables.arrayZ[i]; hb_blob_t *blob = items[i].blob; rec.tag = items[i].tag; - rec.length = hb_blob_get_length (blob); + rec.length = blob->length; rec.offset.serialize (c, this); /* Allocate room for the table and copy it. */ char *start = (char *) c->allocate_size (rec.length); - if (unlikely (!start)) {return false;} + if (unlikely (!start)) return false; - memcpy (start, hb_blob_get_data (blob, nullptr), rec.length); + if (likely (rec.length)) + memcpy (start, blob->data, rec.length); /* 4-byte alignment. */ c->align (4); diff -Nru harfbuzz-2.5.3/src/hb-open-type.hh harfbuzz-2.6.2/src/hb-open-type.hh --- harfbuzz-2.5.3/src/hb-open-type.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-open-type.hh 2019-10-26 02:02:55.000000000 +0000 @@ -63,6 +63,14 @@ operator wide_type () const { return v; } bool operator == (const IntType &o) const { return (Type) v == (Type) o.v; } bool operator != (const IntType &o) const { return !(*this == o); } + + IntType& operator += (unsigned count) { *this = *this + count; return *this; } + IntType& operator -= (unsigned count) { *this = *this - count; return *this; } + IntType& operator ++ () { *this += 1; return *this; } + IntType& operator -- () { *this -= 1; return *this; } + IntType operator ++ (int) { IntType c (*this); ++*this; return c; } + IntType operator -- (int) { IntType c (*this); --*this; return c; } + HB_INTERNAL static int cmp (const IntType *a, const IntType *b) { return b->cmp (*a); } template @@ -116,9 +124,9 @@ }; /* 32-bit signed fixed-point number (16.16). */ -struct Fixed : HBINT32 +struct HBFixed : HBINT32 { - Fixed& operator = (uint32_t i) { HBINT32::operator= (i); return *this; } + HBFixed& operator = (uint32_t i) { HBINT32::operator= (i); return *this; } // 65536 means 1<<16 float to_float () const { return ((int32_t) v) / 65536.f; } void set_float (float f) { v = roundf (f * 65536.f); } @@ -155,9 +163,9 @@ }; /* Glyph index number, same as uint16 (length = 16 bits) */ -struct GlyphID : HBUINT16 +struct HBGlyphID : HBUINT16 { - GlyphID& operator = (uint16_t i) { HBUINT16::operator= (i); return *this; } + HBGlyphID& operator = (uint16_t i) { HBUINT16::operator= (i); return *this; } }; /* Script/language-system/feature index */ @@ -475,7 +483,7 @@ } public: - Type arrayZ[VAR]; + Type arrayZ[HB_VAR_ARRAY]; public: DEFINE_SIZE_UNBOUNDED (0); }; @@ -564,6 +572,8 @@ explicit operator bool () const { return len; } + void pop () { len--; } + hb_array_t< Type> as_array () { return hb_array (arrayZ, len); } hb_array_t as_array () const { return hb_array (arrayZ, len); } @@ -576,13 +586,13 @@ operator writer_t () { return writer (); } hb_array_t sub_array (unsigned int start_offset, unsigned int count) const - { return as_array ().sub_array (start_offset, count);} + { return as_array ().sub_array (start_offset, count); } hb_array_t sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) const - { return as_array ().sub_array (start_offset, count);} + { return as_array ().sub_array (start_offset, count); } hb_array_t sub_array (unsigned int start_offset, unsigned int count) - { return as_array ().sub_array (start_offset, count);} + { return as_array ().sub_array (start_offset, count); } hb_array_t sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) - { return as_array ().sub_array (start_offset, count);} + { return as_array ().sub_array (start_offset, count); } bool serialize (hb_serialize_context_t *c, unsigned int items_len) { @@ -606,6 +616,18 @@ return_trace (true); } + Type* serialize_append (hb_serialize_context_t *c) + { + TRACE_SERIALIZE (this); + len++; + if (unlikely (!len || !c->extend (*this))) + { + len--; + return_trace (nullptr); + } + return_trace (&arrayZ[len - 1]); + } + ArrayOf* copy (hb_serialize_context_t *c) const { TRACE_SERIALIZE (this); @@ -647,7 +669,7 @@ public: LenType len; - Type arrayZ[VAR]; + Type arrayZ[HB_VAR_ARRAY]; public: DEFINE_SIZE_ARRAY (sizeof (LenType), arrayZ); }; @@ -720,17 +742,40 @@ return arrayZ[i-1]; } unsigned int get_size () const - { return lenP1.static_size + (lenP1 ? lenP1 - 1 : 0) * Type::static_size; } + { return lenP1.static_size + get_length () * Type::static_size; } + + unsigned get_length () const { return lenP1 ? lenP1 - 1 : 0; } - bool serialize (hb_serialize_context_t *c, - hb_array_t items) + hb_array_t< Type> as_array () { return hb_array (arrayZ, get_length ()); } + hb_array_t as_array () const { return hb_array (arrayZ, get_length ()); } + + /* Iterator. */ + typedef hb_array_t iter_t; + typedef hb_array_t< Type> writer_t; + iter_t iter () const { return as_array (); } + writer_t writer () { return as_array (); } + operator iter_t () const { return iter (); } + operator writer_t () { return writer (); } + + bool serialize (hb_serialize_context_t *c, unsigned int items_len) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (*this))) return_trace (false); - c->check_assign (lenP1, items.length + 1); + c->check_assign (lenP1, items_len + 1); if (unlikely (!c->extend (*this))) return_trace (false); - for (unsigned int i = 0; i < items.length; i++) - arrayZ[i] = items[i]; + return_trace (true); + } + template + bool serialize (hb_serialize_context_t *c, Iterator items) + { + TRACE_SERIALIZE (this); + unsigned count = items.len (); + if (unlikely (!serialize (c, count))) return_trace (false); + /* TODO Umm. Just exhaust the iterator instead? Being extra + * cautious right now.. */ + for (unsigned i = 0; i < count; i++, ++items) + arrayZ[i] = *items; return_trace (true); } @@ -740,7 +785,7 @@ TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c))) return_trace (false); if (!sizeof... (Ts) && hb_is_trivially_copyable (Type)) return_trace (true); - unsigned int count = lenP1 ? lenP1 - 1 : 0; + unsigned int count = get_length (); for (unsigned int i = 0; i < count; i++) if (unlikely (!c->dispatch (arrayZ[i], hb_forward (ds)...))) return_trace (false); @@ -757,7 +802,7 @@ public: LenType lenP1; - Type arrayZ[VAR]; + Type arrayZ[HB_VAR_ARRAY]; public: DEFINE_SIZE_ARRAY (sizeof (LenType), arrayZ); }; @@ -805,7 +850,7 @@ public: LenType lenM1; - Type arrayZ[VAR]; + Type arrayZ[HB_VAR_ARRAY]; public: DEFINE_SIZE_ARRAY (sizeof (LenType), arrayZ); }; @@ -826,13 +871,13 @@ operator writer_t () { return writer (); } hb_sorted_array_t sub_array (unsigned int start_offset, unsigned int count) const - { return as_array ().sub_array (start_offset, count);} + { return as_array ().sub_array (start_offset, count); } hb_sorted_array_t sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) const - { return as_array ().sub_array (start_offset, count);} + { return as_array ().sub_array (start_offset, count); } hb_sorted_array_t sub_array (unsigned int start_offset, unsigned int count) - { return as_array ().sub_array (start_offset, count);} + { return as_array ().sub_array (start_offset, count); } hb_sorted_array_t sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) - { return as_array ().sub_array (start_offset, count);} + { return as_array ().sub_array (start_offset, count); } bool serialize (hb_serialize_context_t *c, unsigned int items_len) { @@ -944,7 +989,7 @@ unsigned int count = Type::TerminationWordCount; for (unsigned int i = 0; i < count; i++) if (words[i] != 0xFFFFu) - return false; + return false; return true; } diff -Nru harfbuzz-2.5.3/src/hb-ot-cff1-table.cc harfbuzz-2.6.2/src/hb-ot-cff1-table.cc --- harfbuzz-2.5.3/src/hb-ot-cff1-table.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-cff1-table.cc 2019-10-26 02:02:55.000000000 +0000 @@ -210,7 +210,7 @@ point_t max; }; -struct extents_param_t +struct cff1_extents_param_t { void init (const OT::cff1::accelerator_t *_cff) { @@ -229,15 +229,15 @@ const OT::cff1::accelerator_t *cff; }; -struct cff1_path_procs_extents_t : path_procs_t +struct cff1_path_procs_extents_t : path_procs_t { - static void moveto (cff1_cs_interp_env_t &env, extents_param_t& param, const point_t &pt) + static void moveto (cff1_cs_interp_env_t &env, cff1_extents_param_t& param, const point_t &pt) { param.end_path (); env.moveto (pt); } - static void line (cff1_cs_interp_env_t &env, extents_param_t& param, const point_t &pt1) + static void line (cff1_cs_interp_env_t &env, cff1_extents_param_t& param, const point_t &pt1) { if (!param.is_path_open ()) { @@ -248,7 +248,7 @@ param.bounds.update (env.get_pt ()); } - static void curve (cff1_cs_interp_env_t &env, extents_param_t& param, const point_t &pt1, const point_t &pt2, const point_t &pt3) + static void curve (cff1_cs_interp_env_t &env, cff1_extents_param_t& param, const point_t &pt1, const point_t &pt2, const point_t &pt3) { if (!param.is_path_open ()) { @@ -265,9 +265,9 @@ static bool _get_bounds (const OT::cff1::accelerator_t *cff, hb_codepoint_t glyph, bounds_t &bounds, bool in_seac=false); -struct cff1_cs_opset_extents_t : cff1_cs_opset_t +struct cff1_cs_opset_extents_t : cff1_cs_opset_t { - static void process_seac (cff1_cs_interp_env_t &env, extents_param_t& param) + static void process_seac (cff1_cs_interp_env_t &env, cff1_extents_param_t& param) { unsigned int n = env.argStack.get_count (); point_t delta; @@ -296,11 +296,11 @@ if (unlikely (!cff->is_valid () || (glyph >= cff->num_glyphs))) return false; unsigned int fd = cff->fdSelect->get_fd (glyph); - cff1_cs_interpreter_t interp; + cff1_cs_interpreter_t interp; const byte_str_t str = (*cff->charStrings)[glyph]; interp.env.init (str, *cff, fd); interp.env.set_in_seac (in_seac); - extents_param_t param; + cff1_extents_param_t param; param.init (cff); if (unlikely (!interp.interpret (param))) return false; bounds = param.bounds; diff -Nru harfbuzz-2.5.3/src/hb-ot-cff1-table.hh harfbuzz-2.6.2/src/hb-ot-cff1-table.hh --- harfbuzz-2.5.3/src/hb-ot-cff1-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-cff1-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -357,7 +357,7 @@ return HBUINT16::static_size * (num_glyphs - 1); } - HBUINT16 sids[VAR]; + HBUINT16 sids[HB_VAR_ARRAY]; DEFINE_SIZE_ARRAY(0, sids); }; @@ -439,7 +439,7 @@ return size; } - Charset_Range ranges[VAR]; + Charset_Range ranges[HB_VAR_ARRAY]; DEFINE_SIZE_ARRAY (0, ranges); }; diff -Nru harfbuzz-2.5.3/src/hb-ot-cff2-table.cc harfbuzz-2.6.2/src/hb-ot-cff2-table.cc --- harfbuzz-2.5.3/src/hb-ot-cff2-table.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-cff2-table.cc 2019-10-26 02:02:55.000000000 +0000 @@ -33,7 +33,7 @@ using namespace CFF; -struct extents_param_t +struct cff2_extents_param_t { void init () { @@ -63,15 +63,15 @@ number_t max_y; }; -struct cff2_path_procs_extents_t : path_procs_t +struct cff2_path_procs_extents_t : path_procs_t { - static void moveto (cff2_cs_interp_env_t &env, extents_param_t& param, const point_t &pt) + static void moveto (cff2_cs_interp_env_t &env, cff2_extents_param_t& param, const point_t &pt) { param.end_path (); env.moveto (pt); } - static void line (cff2_cs_interp_env_t &env, extents_param_t& param, const point_t &pt1) + static void line (cff2_cs_interp_env_t &env, cff2_extents_param_t& param, const point_t &pt1) { if (!param.is_path_open ()) { @@ -82,7 +82,7 @@ param.update_bounds (env.get_pt ()); } - static void curve (cff2_cs_interp_env_t &env, extents_param_t& param, const point_t &pt1, const point_t &pt2, const point_t &pt3) + static void curve (cff2_cs_interp_env_t &env, cff2_extents_param_t& param, const point_t &pt1, const point_t &pt2, const point_t &pt3) { if (!param.is_path_open ()) { @@ -97,7 +97,7 @@ } }; -struct cff2_cs_opset_extents_t : cff2_cs_opset_t {}; +struct cff2_cs_opset_extents_t : cff2_cs_opset_t {}; bool OT::cff2::accelerator_t::get_extents (hb_font_t *font, hb_codepoint_t glyph, @@ -110,13 +110,11 @@ if (unlikely (!is_valid () || (glyph >= num_glyphs))) return false; - unsigned int num_coords; - const int *coords = hb_font_get_var_coords_normalized (font, &num_coords); unsigned int fd = fdSelect->get_fd (glyph); - cff2_cs_interpreter_t interp; + cff2_cs_interpreter_t interp; const byte_str_t str = (*charStrings)[glyph]; - interp.env.init (str, *this, fd, coords, num_coords); - extents_param_t param; + interp.env.init (str, *this, fd, font->coords, font->num_coords); + cff2_extents_param_t param; param.init (); if (unlikely (!interp.interpret (param))) return false; diff -Nru harfbuzz-2.5.3/src/hb-ot-cff-common.hh harfbuzz-2.6.2/src/hb-ot-cff-common.hh --- harfbuzz-2.5.3/src/hb-ot-cff-common.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-cff-common.hh 2019-10-26 02:02:55.000000000 +0000 @@ -40,14 +40,14 @@ /* utility macro */ template -static inline const Type& StructAtOffsetOrNull(const void *P, unsigned int offset) -{ return offset? (* reinterpret_cast ((const char *) P + offset)): Null(Type); } +static inline const Type& StructAtOffsetOrNull (const void *P, unsigned int offset) +{ return offset ? StructAtOffset (P, offset) : Null (Type); } -inline unsigned int calcOffSize(unsigned int dataSize) +inline unsigned int calcOffSize (unsigned int dataSize) { unsigned int size = 1; unsigned int offset = dataSize + 1; - while ((offset & ~0xFF) != 0) + while (offset & ~0xFF) { size++; offset >>= 8; @@ -58,8 +58,8 @@ struct code_pair_t { - hb_codepoint_t code; - hb_codepoint_t glyph; + hb_codepoint_t code; + hb_codepoint_t glyph; }; typedef hb_vector_t str_buff_t; @@ -92,10 +92,8 @@ static unsigned int calculate_serialized_size (unsigned int offSize_, unsigned int count, unsigned int dataSize) { - if (count == 0) - return COUNT::static_size; - else - return min_size + calculate_offset_array_size (offSize_, count) + dataSize; + if (count == 0) return COUNT::static_size; + return min_size + calculate_offset_array_size (offSize_, count) + dataSize; } bool serialize (hb_serialize_context_t *c, const CFFIndex &src) @@ -159,9 +157,7 @@ byteArray.init (); byteArray.resize (buffArray.length); for (unsigned int i = 0; i < byteArray.length; i++) - { byteArray[i] = byte_str_t (buffArray[i].arrayZ, buffArray[i].length); - } bool result = this->serialize (c, offSize_, byteArray); byteArray.fini (); return result; @@ -192,43 +188,35 @@ unsigned int length_at (unsigned int index) const { - if (likely ((offset_at (index + 1) >= offset_at (index)) && - (offset_at (index + 1) <= offset_at (count)))) - return offset_at (index + 1) - offset_at (index); - else + if (unlikely ((offset_at (index + 1) < offset_at (index)) || + (offset_at (index + 1) > offset_at (count)))) return 0; + return offset_at (index + 1) - offset_at (index); } const unsigned char *data_base () const - { return (const unsigned char *)this + min_size + offset_array_size (); } + { return (const unsigned char *) this + min_size + offset_array_size (); } unsigned int data_size () const { return HBINT8::static_size; } byte_str_t operator [] (unsigned int index) const { - if (likely (index < count)) - return byte_str_t (data_base () + offset_at (index) - 1, length_at (index)); - else - return Null (byte_str_t); + if (unlikely (index >= count)) return Null (byte_str_t); + return byte_str_t (data_base () + offset_at (index) - 1, length_at (index)); } unsigned int get_size () const { - if (this != &Null (CFFIndex)) - { - if (count > 0) - return min_size + offset_array_size () + (offset_at (count) - 1); - else - return count.static_size; /* empty CFFIndex contains count only */ - } - else - return 0; + if (this == &Null (CFFIndex)) return 0; + if (count > 0) + return min_size + offset_array_size () + (offset_at (count) - 1); + return count.static_size; /* empty CFFIndex contains count only */ } bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return_trace (likely ((count.sanitize (c) && count == 0) || /* empty INDEX */ + return_trace (likely ((c->check_struct (this) && count == 0) || /* empty INDEX */ (c->check_struct (this) && offSize >= 1 && offSize <= 4 && c->check_array (offsets, offSize, count + 1) && c->check_array ((const HBUINT8*) data_base (), 1, max_offset () - 1)))); @@ -249,8 +237,8 @@ public: COUNT count; /* Number of object data. Note there are (count+1) offsets */ HBUINT8 offSize; /* The byte size of each offset in the offsets array. */ - HBUINT8 offsets[VAR]; /* The array of (count + 1) offsets into objects array (1-base). */ - /* HBUINT8 data[VAR]; Object data */ + HBUINT8 offsets[HB_VAR_ARRAY]; /* The array of (count + 1) offsets into objects array (1-base). */ + /* HBUINT8 data[HB_VAR_ARRAY]; Object data */ public: DEFINE_SIZE_ARRAY (COUNT::static_size + HBUINT8::static_size, offsets); }; @@ -526,9 +514,9 @@ unsigned int get_size (unsigned int num_glyphs) const { return HBUINT8::static_size * num_glyphs; } - HBUINT8 fds[VAR]; + HBUINT8 fds[HB_VAR_ARRAY]; - DEFINE_SIZE_MIN (1); + DEFINE_SIZE_MIN (0); }; template diff -Nru harfbuzz-2.5.3/src/hb-ot-cmap-table.hh harfbuzz-2.6.2/src/hb-ot-cmap-table.hh --- harfbuzz-2.5.3/src/hb-ot-cmap-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-cmap-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -74,153 +74,201 @@ struct CmapSubtableFormat4 { - struct segment_plan - { - HBUINT16 start_code; - HBUINT16 end_code; - bool use_delta; - }; - - bool serialize (hb_serialize_context_t *c, - const hb_subset_plan_t *plan, - const hb_sorted_vector_t &segments) - { - TRACE_SERIALIZE (this); - if (unlikely (!c->extend_min (*this))) return_trace (false); + template + HBUINT16* serialize_endcode_array (hb_serialize_context_t *c, + Iterator it) + { + HBUINT16 *endCode = c->start_embed (); + hb_codepoint_t prev_endcp = 0xFFFF; + + + it + | hb_apply ([&] (const hb_item_type _) + { + if (prev_endcp != 0xFFFF && prev_endcp + 1u != _.first) + { + HBUINT16 end_code; + end_code = prev_endcp; + c->copy (end_code); + } + prev_endcp = _.first; + }) + ; + + { + // last endCode + HBUINT16 endcode; + endcode = prev_endcp; + if (unlikely (!c->copy (endcode))) return nullptr; + // There must be a final entry with end_code == 0xFFFF. + if (prev_endcp != 0xFFFF) + { + HBUINT16 finalcode; + finalcode = 0xFFFF; + if (unlikely (!c->copy (finalcode))) return nullptr; + } + } - this->format = 4; - this->length = get_sub_table_size (segments); + return endCode; + } - this->segCountX2 = segments.length * 2; - this->entrySelector = hb_max (1u, hb_bit_storage (segments.length)) - 1; - this->searchRange = 2 * (1u << this->entrySelector); - this->rangeShift = segments.length * 2 > this->searchRange - ? 2 * segments.length - this->searchRange - : 0; + template + HBUINT16* serialize_startcode_array (hb_serialize_context_t *c, + Iterator it) + { + HBUINT16 *startCode = c->start_embed (); + hb_codepoint_t prev_cp = 0xFFFF; - HBUINT16 *end_count = c->allocate_size (HBUINT16::static_size * segments.length); - c->allocate_size (HBUINT16::static_size); // 2 bytes of padding. - HBUINT16 *start_count = c->allocate_size (HBUINT16::static_size * segments.length); - HBINT16 *id_delta = c->allocate_size (HBUINT16::static_size * segments.length); - HBUINT16 *id_range_offset = c->allocate_size (HBUINT16::static_size * segments.length); + + it + | hb_apply ([&] (const hb_item_type _) + { + if (prev_cp == 0xFFFF || prev_cp + 1u != _.first) + { + HBUINT16 start_code; + start_code = _.first; + c->copy (start_code); + } - if (id_range_offset == nullptr) - return_trace (false); + prev_cp = _.first; + }) + ; - for (unsigned int i = 0; i < segments.length; i++) + // There must be a final entry with end_code == 0xFFFF. + if (it.len () == 0 || prev_cp != 0xFFFF) { - end_count[i] = segments[i].end_code; - start_count[i] = segments[i].start_code; - if (segments[i].use_delta) - { - hb_codepoint_t cp = segments[i].start_code; - hb_codepoint_t start_gid = 0; - if (unlikely (!plan->new_gid_for_codepoint (cp, &start_gid) && cp != 0xFFFF)) - return_trace (false); - id_delta[i] = start_gid - segments[i].start_code; - } else { - id_delta[i] = 0; - unsigned int num_codepoints = segments[i].end_code - segments[i].start_code + 1; - HBUINT16 *glyph_id_array = c->allocate_size (HBUINT16::static_size * num_codepoints); - if (glyph_id_array == nullptr) - return_trace (false); - // From the cmap spec: - // - // id_range_offset[i]/2 - // + (cp - segments[i].start_code) - // + (id_range_offset + i) - // = - // glyph_id_array + (cp - segments[i].start_code) - // - // So, solve for id_range_offset[i]: - // - // id_range_offset[i] - // = - // 2 * (glyph_id_array - id_range_offset - i) - id_range_offset[i] = 2 * (glyph_id_array - id_range_offset - i); - for (unsigned int j = 0; j < num_codepoints; j++) - { - hb_codepoint_t cp = segments[i].start_code + j; - hb_codepoint_t new_gid = 0; - if (unlikely (!plan->new_gid_for_codepoint (cp, &new_gid))) - return_trace (false); - glyph_id_array[j] = new_gid; - } - } + HBUINT16 finalcode; + finalcode = 0xFFFF; + if (unlikely (!c->copy (finalcode))) return nullptr; } - return_trace (true); + return startCode; } - static size_t get_sub_table_size (const hb_sorted_vector_t &segments) + template + HBINT16* serialize_idDelta_array (hb_serialize_context_t *c, + Iterator it, + HBUINT16 *endCode, + HBUINT16 *startCode, + unsigned segcount) { - size_t segment_size = 0; - for (unsigned int i = 0; i < segments.length; i++) - { - // Parallel array entries - segment_size += - 2 // end count - + 2 // start count - + 2 // delta - + 2; // range offset - - if (!segments[i].use_delta) - // Add bytes for the glyph index array entries for this segment. - segment_size += (segments[i].end_code - segments[i].start_code + 1) * 2; - } + unsigned i = 0; + hb_codepoint_t last_gid = 0, start_gid = 0, last_cp = 0xFFFF; + bool use_delta = true; - return min_size - + 2 // Padding - + segment_size; - } + HBINT16 *idDelta = c->start_embed (); + if ((char *)idDelta - (char *)startCode != (int) segcount * (int) HBINT16::static_size) + return nullptr; - static bool create_sub_table_plan (const hb_subset_plan_t *plan, - hb_sorted_vector_t *segments) + + it + | hb_apply ([&] (const hb_item_type _) + { + if (_.first == startCode[i]) + { + use_delta = true; + start_gid = _.second; + } + else if (_.second != last_gid + 1) use_delta = false; + + if (_.first == endCode[i]) + { + HBINT16 delta; + if (use_delta) delta = (int)start_gid - (int)startCode[i]; + else delta = 0; + c->copy (delta); + + i++; + } + + last_gid = _.second; + last_cp = _.first; + }) + ; + + if (it.len () == 0 || last_cp != 0xFFFF) + { + HBINT16 delta; + delta = 1; + if (unlikely (!c->copy (delta))) return nullptr; + } + + return idDelta; + } + + template + HBUINT16* serialize_rangeoffset_glyid (hb_serialize_context_t *c, + Iterator it, + HBUINT16 *endCode, + HBUINT16 *startCode, + HBINT16 *idDelta, + unsigned segcount) + { + HBUINT16 *idRangeOffset = c->allocate_size (HBUINT16::static_size * segcount); + if (unlikely (!c->check_success (idRangeOffset))) return nullptr; + if (unlikely ((char *)idRangeOffset - (char *)idDelta != (int) segcount * (int) HBINT16::static_size)) return nullptr; + + + hb_range (segcount) + | hb_filter ([&] (const unsigned _) { return idDelta[_] == 0; }) + | hb_apply ([&] (const unsigned i) + { + idRangeOffset[i] = 2 * (c->start_embed () - idRangeOffset - i); + + + it + | hb_filter ([&] (const hb_item_type _) { return _.first >= startCode[i] && _.first <= endCode[i]; }) + | hb_apply ([&] (const hb_item_type _) + { + HBUINT16 glyID; + glyID = _.second; + c->copy (glyID); + }) + ; + + + }) + ; + + return idRangeOffset; + } + + template + void serialize (hb_serialize_context_t *c, + Iterator it) { - segment_plan *segment = nullptr; - hb_codepoint_t last_gid = 0; + unsigned table_initpos = c->length (); + if (unlikely (!c->extend_min (*this))) return; + this->format = 4; - hb_codepoint_t cp = HB_SET_VALUE_INVALID; - while (plan->unicodes->next (&cp)) { - hb_codepoint_t new_gid = 0; - if (unlikely (!plan->new_gid_for_codepoint (cp, &new_gid))) - { - DEBUG_MSG(SUBSET, nullptr, "Unable to find new gid for %04x", cp); - return false; - } + //serialize endCode[] + HBUINT16 *endCode = serialize_endcode_array (c, it); + if (unlikely (!endCode)) return; - /* Stop adding to cmap if we are now outside of unicode BMP. */ - if (cp > 0xFFFF) break; + unsigned segcount = (c->length () - min_size) / HBUINT16::static_size; - if (!segment || - cp != segment->end_code + 1u) - { - segment = segments->push (); - segment->start_code = cp; - segment->end_code = cp; - segment->use_delta = true; - } else { - segment->end_code = cp; - if (last_gid + 1u != new_gid) - // gid's are not consecutive in this segment so delta - // cannot be used. - segment->use_delta = false; - } + // 2 bytes of padding. + if (unlikely (!c->allocate_size (HBUINT16::static_size))) return; // 2 bytes of padding. - last_gid = new_gid; - } + // serialize startCode[] + HBUINT16 *startCode = serialize_startcode_array (c, it); + if (unlikely (!startCode)) return; - // There must be a final entry with end_code == 0xFFFF. Check if we need to add one. - if (segment == nullptr || segment->end_code != 0xFFFF) - { - segment = segments->push (); - segment->start_code = 0xFFFF; - segment->end_code = 0xFFFF; - segment->use_delta = true; - } + //serialize idDelta[] + HBINT16 *idDelta = serialize_idDelta_array (c, it, endCode, startCode, segcount); + if (unlikely (!idDelta)) return; - return true; + HBUINT16 *idRangeOffset = serialize_rangeoffset_glyid (c, it, endCode, startCode, idDelta, segcount); + if (unlikely (!c->check_success (idRangeOffset))) return; + + if (unlikely (!c->check_assign(this->length, c->length () - table_initpos))) return; + this->segCountX2 = segcount * 2; + this->entrySelector = hb_max (1u, hb_bit_storage (segcount)) - 1; + this->searchRange = 2 * (1u << this->entrySelector); + this->rangeShift = segcount * 2 > this->searchRange + ? 2 * segcount - this->searchRange + : 0; } struct accelerator_t @@ -286,9 +334,7 @@ return true; } HB_INTERNAL static bool get_glyph_func (const void *obj, hb_codepoint_t codepoint, hb_codepoint_t *glyph) - { - return ((const accelerator_t *) obj)->get_glyph (codepoint, glyph); - } + { return ((const accelerator_t *) obj)->get_glyph (codepoint, glyph); } void collect_unicodes (hb_set_t *out) const { unsigned int count = this->segCount; @@ -450,7 +496,7 @@ UINT length; /* Byte length of this subtable. */ UINT language; /* Ignore. */ UINT startCharCode; /* First character code covered. */ - ArrayOf + ArrayOf glyphIdArray; /* Array of glyph index values for character * codes in the range. */ public: @@ -489,15 +535,6 @@ return_trace (c->check_struct (this) && groups.sanitize (c)); } - bool serialize (hb_serialize_context_t *c, - const hb_sorted_vector_t &group_data) - { - TRACE_SERIALIZE (this); - if (unlikely (!c->extend_min (*this))) return_trace (false); - if (unlikely (!groups.serialize (c, group_data.as_array ()))) return_trace (false); - return_trace (true); - } - protected: HBUINT16 format; /* Subtable format; set to 12. */ HBUINT16 reserved; /* Reserved; set to 0. */ @@ -517,64 +554,70 @@ group.glyphID + (u - group.startCharCode) : 0; } - bool serialize (hb_serialize_context_t *c, - const hb_sorted_vector_t &groups_data) - { - TRACE_SERIALIZE (this); - if (unlikely (!c->extend_min (*this))) return_trace (false); + template + void serialize (hb_serialize_context_t *c, + Iterator it) + { + if (it.len () == 0) return; + unsigned table_initpos = c->length (); + if (unlikely (!c->extend_min (*this))) return; + + hb_codepoint_t startCharCode = 0xFFFF, endCharCode = 0xFFFF; + hb_codepoint_t glyphID = 0; + + + it + | hb_apply ([&] (const hb_item_type _) + { + if (startCharCode == 0xFFFF) + { + startCharCode = _.first; + endCharCode = _.first; + glyphID = _.second; + } + else if (!_is_gid_consecutive (endCharCode, startCharCode, glyphID, _.first, _.second)) + { + CmapSubtableLongGroup grouprecord; + grouprecord.startCharCode = startCharCode; + grouprecord.endCharCode = endCharCode; + grouprecord.glyphID = glyphID; + c->copy (grouprecord); + + startCharCode = _.first; + endCharCode = _.first; + glyphID = _.second; + } + else + { + endCharCode = _.first; + } + }) + ; + + CmapSubtableLongGroup record; + record.startCharCode = startCharCode; + record.endCharCode = endCharCode; + record.glyphID = glyphID; + c->copy (record); this->format = 12; this->reserved = 0; - this->length = get_sub_table_size (groups_data); - - return_trace (CmapSubtableLongSegmented::serialize (c, groups_data)); + this->length = c->length () - table_initpos; + this->groups.len = (this->length - min_size)/CmapSubtableLongGroup::static_size; } static size_t get_sub_table_size (const hb_sorted_vector_t &groups_data) - { - return 16 + 12 * groups_data.length; - } - - static bool create_sub_table_plan (const hb_subset_plan_t *plan, - hb_sorted_vector_t *groups_out) - { - CmapSubtableLongGroup *group = nullptr; + { return 16 + 12 * groups_data.length; } - hb_codepoint_t cp = HB_SET_VALUE_INVALID; - while (plan->unicodes->next (&cp)) { - hb_codepoint_t new_gid = 0; - if (unlikely (!plan->new_gid_for_codepoint (cp, &new_gid))) - { - DEBUG_MSG(SUBSET, nullptr, "Unable to find new gid for %04x", cp); - return false; - } - - if (!group || !_is_gid_consecutive (group, cp, new_gid)) - { - group = groups_out->push (); - group->startCharCode = cp; - group->endCharCode = cp; - group->glyphID = new_gid; - } - else group->endCharCode = cp; - } - - DEBUG_MSG(SUBSET, nullptr, "cmap"); - for (unsigned int i = 0; i < groups_out->length; i++) { - CmapSubtableLongGroup& group = (*groups_out)[i]; - DEBUG_MSG(SUBSET, nullptr, " %d: U+%04X-U+%04X, gid %d-%d", i, (uint32_t) group.startCharCode, (uint32_t) group.endCharCode, (uint32_t) group.glyphID, (uint32_t) group.glyphID + ((uint32_t) group.endCharCode - (uint32_t) group.startCharCode)); - } - - return true; - } - - private: - static bool _is_gid_consecutive (CmapSubtableLongGroup *group, + private: + static bool _is_gid_consecutive (hb_codepoint_t endCharCode, + hb_codepoint_t startCharCode, + hb_codepoint_t glyphID, hb_codepoint_t cp, hb_codepoint_t new_gid) { - return (cp - 1 == group->endCharCode) && - new_gid == group->glyphID + (cp - group->startCharCode); + return (cp - 1 == endCharCode) && + new_gid == glyphID + (cp - startCharCode); } }; @@ -629,6 +672,63 @@ } } + DefaultUVS* copy (hb_serialize_context_t *c, + const hb_set_t *unicodes) const + { + DefaultUVS *out = c->start_embed (); + if (unlikely (!out)) return nullptr; + auto snap = c->snapshot (); + + HBUINT32 len; + len = 0; + if (unlikely (!c->copy (len))) return nullptr; + unsigned init_len = c->length (); + + hb_codepoint_t lastCode = HB_MAP_VALUE_INVALID; + int count = -1; + + for (const UnicodeValueRange& _ : as_array ()) + { + for (const unsigned addcnt : hb_range ((unsigned) _.additionalCount + 1)) + { + unsigned curEntry = (unsigned) _.startUnicodeValue + addcnt; + if (!unicodes->has (curEntry)) continue; + count += 1; + if (lastCode == HB_MAP_VALUE_INVALID) + lastCode = curEntry; + else if (lastCode + count != curEntry) + { + UnicodeValueRange rec; + rec.startUnicodeValue = lastCode; + rec.additionalCount = count - 1; + c->copy (rec); + + lastCode = curEntry; + count = 0; + } + } + } + + if (lastCode != HB_MAP_VALUE_INVALID) + { + UnicodeValueRange rec; + rec.startUnicodeValue = lastCode; + rec.additionalCount = count; + c->copy (rec); + } + + if (c->length () - init_len == 0) + { + c->revert (snap); + return nullptr; + } + else + { + if (unlikely (!c->check_assign (out->len, (c->length () - init_len) / UnicodeValueRange::static_size))) return nullptr; + return out; + } + } + public: DEFINE_SIZE_ARRAY (4, *this); }; @@ -647,7 +747,7 @@ } HBUINT24 unicodeValue; /* Base Unicode value of the UVS */ - GlyphID glyphID; /* Glyph ID of the UVS */ + HBGlyphID glyphID; /* Glyph ID of the UVS */ public: DEFINE_SIZE_STATIC (5); }; @@ -661,6 +761,49 @@ out->add (arrayZ[i].glyphID); } + void closure_glyphs (const hb_set_t *unicodes, + hb_set_t *glyphset) const + { + + as_array () + | hb_filter (unicodes, &UVSMapping::unicodeValue) + | hb_map (&UVSMapping::glyphID) + | hb_sink (glyphset) + ; + } + + NonDefaultUVS* copy (hb_serialize_context_t *c, + const hb_set_t *unicodes, + const hb_set_t *glyphs, + const hb_map_t *glyph_map) const + { + NonDefaultUVS *out = c->start_embed (); + if (unlikely (!out)) return nullptr; + + auto it = + + as_array () + | hb_filter ([&] (const UVSMapping& _) + { + return unicodes->has (_.unicodeValue) || glyphs->has (_.glyphID); + }) + ; + + if (!it) return nullptr; + + HBUINT32 len; + len = it.len (); + if (unlikely (!c->copy (len))) return nullptr; + + for (const UVSMapping& _ : it) + { + UVSMapping mapping; + mapping.unicodeValue = _.unicodeValue; + mapping.glyphID = glyph_map->get (_.glyphID); + c->copy (mapping); + } + + return out; + } + public: DEFINE_SIZE_ARRAY (4, *this); }; @@ -689,9 +832,7 @@ } int cmp (const hb_codepoint_t &variation_selector) const - { - return varSelector.cmp (variation_selector); - } + { return varSelector.cmp (variation_selector); } bool sanitize (hb_sanitize_context_t *c, const void *base) const { @@ -701,6 +842,52 @@ nonDefaultUVS.sanitize (c, base)); } + VariationSelectorRecord* copy (hb_serialize_context_t *c, + const hb_set_t *unicodes, + const hb_set_t *glyphs, + const hb_map_t *glyph_map, + const void *src_base, + const void *dst_base) const + { + auto snap = c->snapshot (); + auto *out = c->embed (*this); + if (unlikely (!out)) return nullptr; + + out->defaultUVS = 0; + out->nonDefaultUVS = 0; + + bool drop = true; + + if (defaultUVS != 0) + { + c->push (); + if (c->copy (src_base+defaultUVS, unicodes)) + { + c->add_link (out->defaultUVS, c->pop_pack (), dst_base); + drop = false; + } + else c->pop_discard (); + } + + if (nonDefaultUVS != 0) + { + c->push (); + if (c->copy (src_base+nonDefaultUVS, unicodes, glyphs, glyph_map)) + { + c->add_link (out->nonDefaultUVS, c->pop_pack (), dst_base); + drop = false; + } + else c->pop_discard (); + } + + if (drop) + { + c->revert (snap); + return nullptr; + } + else return out; + } + HBUINT24 varSelector; /* Variation selector. */ LOffsetTo defaultUVS; /* Offset to Default UVS Table. May be 0. */ @@ -715,9 +902,7 @@ glyph_variant_t get_glyph_variant (hb_codepoint_t codepoint, hb_codepoint_t variation_selector, hb_codepoint_t *glyph) const - { - return record.bsearch (variation_selector).get_glyph (codepoint, glyph, this); - } + { return record.bsearch (variation_selector).get_glyph (codepoint, glyph, this); } void collect_variation_selectors (hb_set_t *out) const { @@ -727,8 +912,44 @@ } void collect_variation_unicodes (hb_codepoint_t variation_selector, hb_set_t *out) const + { record.bsearch (variation_selector).collect_unicodes (out, this); } + + void serialize (hb_serialize_context_t *c, + const hb_set_t *unicodes, + const hb_set_t *glyphs, + const hb_map_t *glyph_map, + const void *src_base) { - record.bsearch (variation_selector).collect_unicodes (out, this); + auto snap = c->snapshot (); + unsigned table_initpos = c->length (); + const char* init_tail = c->tail; + + if (unlikely (!c->extend_min (*this))) return; + this->format = 14; + + const CmapSubtableFormat14 *src_tbl = reinterpret_cast (src_base); + for (const VariationSelectorRecord& _ : src_tbl->record) + c->copy (_, unicodes, glyphs, glyph_map, src_base, this); + + if (c->length () - table_initpos == CmapSubtableFormat14::min_size) + c->revert (snap); + else + { + int tail_len = init_tail - c->tail; + c->check_assign (this->length, c->length () - table_initpos + tail_len); + c->check_assign (this->record.len, (c->length () - table_initpos - CmapSubtableFormat14::min_size) / VariationSelectorRecord::static_size); + } + } + + void closure_glyphs (const hb_set_t *unicodes, + hb_set_t *glyphset) const + { + + hb_iter (record) + | hb_filter (hb_bool, &VariationSelectorRecord::nonDefaultUVS) + | hb_map (&VariationSelectorRecord::nonDefaultUVS) + | hb_map (hb_add (this)) + | hb_apply ([=] (const NonDefaultUVS& _) { _.closure_glyphs (unicodes, glyphset); }) + ; } bool sanitize (hb_sanitize_context_t *c) const @@ -756,12 +977,10 @@ hb_codepoint_t *glyph) const { switch (u.format) { -#ifndef HB_NO_CMAP_LEGACY_SUBTABLES case 0: return u.format0 .get_glyph (codepoint, glyph); + case 4: return u.format4 .get_glyph (codepoint, glyph); case 6: return u.format6 .get_glyph (codepoint, glyph); case 10: return u.format10.get_glyph (codepoint, glyph); -#endif - case 4: return u.format4 .get_glyph (codepoint, glyph); case 12: return u.format12.get_glyph (codepoint, glyph); case 13: return u.format13.get_glyph (codepoint, glyph); case 14: @@ -771,12 +990,10 @@ void collect_unicodes (hb_set_t *out) const { switch (u.format) { -#ifndef HB_NO_CMAP_LEGACY_SUBTABLES case 0: u.format0 .collect_unicodes (out); return; + case 4: u.format4 .collect_unicodes (out); return; case 6: u.format6 .collect_unicodes (out); return; case 10: u.format10.collect_unicodes (out); return; -#endif - case 4: u.format4 .collect_unicodes (out); return; case 12: u.format12.collect_unicodes (out); return; case 13: u.format13.collect_unicodes (out); return; case 14: @@ -784,17 +1001,31 @@ } } + template + void serialize (hb_serialize_context_t *c, + Iterator it, + unsigned format, + const hb_subset_plan_t *plan, + const void *src_base) + { + switch (format) { + case 4: u.format4.serialize (c, it); return; + case 12: u.format12.serialize (c, it); return; + case 14: u.format14.serialize (c, plan->unicodes, plan->_glyphset, plan->glyph_map, src_base); return; + default: return; + } + } + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (!u.format.sanitize (c)) return_trace (false); switch (u.format) { -#ifndef HB_NO_CMAP_LEGACY_SUBTABLES case 0: return_trace (u.format0 .sanitize (c)); + case 4: return_trace (u.format4 .sanitize (c)); case 6: return_trace (u.format6 .sanitize (c)); case 10: return_trace (u.format10.sanitize (c)); -#endif - case 4: return_trace (u.format4 .sanitize (c)); case 12: return_trace (u.format12.sanitize (c)); case 13: return_trace (u.format13.sanitize (c)); case 14: return_trace (u.format14.sanitize (c)); @@ -805,12 +1036,10 @@ public: union { HBUINT16 format; /* Format identifier */ -#ifndef HB_NO_CMAP_LEGACY_SUBTABLES CmapSubtableFormat0 format0; + CmapSubtableFormat4 format4; CmapSubtableFormat6 format6; CmapSubtableFormat10 format10; -#endif - CmapSubtableFormat4 format4; CmapSubtableFormat12 format12; CmapSubtableFormat13 format13; CmapSubtableFormat14 format14; @@ -839,6 +1068,41 @@ subtable.sanitize (c, base)); } + template + EncodingRecord* copy (hb_serialize_context_t *c, + Iterator it, + unsigned format, + const void *src_base, + const void *dst_base, + const hb_subset_plan_t *plan, + /* INOUT */ unsigned *objidx) const + { + TRACE_SERIALIZE (this); + auto snap = c->snapshot (); + auto *out = c->embed (this); + if (unlikely (!out)) return_trace (nullptr); + out->subtable = 0; + + if (*objidx == 0) + { + CmapSubtable *cmapsubtable = c->push (); + unsigned origin_length = c->length (); + cmapsubtable->serialize (c, it, format, plan, &(src_base+subtable)); + if (c->length () - origin_length > 0) *objidx = c->pop_pack (); + else c->pop_discard (); + } + + if (*objidx == 0) + { + c->revert (snap); + return_trace (nullptr); + } + + c->add_link (out->subtable, *objidx, dst_base); + return_trace (out); + } + HBUINT16 platformID; /* Platform ID. */ HBUINT16 encodingID; /* Platform-specific encoding ID. */ LOffsetTo @@ -851,174 +1115,99 @@ { static constexpr hb_tag_t tableTag = HB_OT_TAG_cmap; - struct subset_plan + template + void serialize (hb_serialize_context_t *c, + Iterator it, + EncodingRecIter encodingrec_iter, + const void *src_base, + const hb_subset_plan_t *plan) { - size_t final_size () const - { - return 4 // header - + 8 * num_enc_records - + CmapSubtableFormat4::get_sub_table_size (this->format4_segments) - + CmapSubtableFormat12::get_sub_table_size (this->format12_groups); - } - - unsigned int num_enc_records; - bool has_unicode_bmp; - bool has_unicode_ucs4; - bool has_ms_bmp; - bool has_ms_ucs4; - hb_sorted_vector_t format4_segments; - hb_sorted_vector_t format12_groups; - }; + if (unlikely (!c->extend_min ((*this)))) return; + this->version = 0; - bool _create_plan (const hb_subset_plan_t *plan, - subset_plan *cmap_plan) const - { - cmap_plan->has_unicode_bmp = find_subtable (0, 3); - cmap_plan->has_unicode_ucs4 = find_subtable (0, 4); - cmap_plan->has_ms_bmp = find_subtable (3, 1); - cmap_plan->has_ms_ucs4 = find_subtable (3, 10); - cmap_plan->num_enc_records = cmap_plan->has_unicode_bmp + cmap_plan->has_unicode_ucs4 + cmap_plan->has_ms_bmp + cmap_plan->has_ms_ucs4; - - if (unlikely (!CmapSubtableFormat4::create_sub_table_plan (plan, &cmap_plan->format4_segments))) - return false; - - if (!find_subtable (12)) return true; - return CmapSubtableFormat12::create_sub_table_plan (plan, &cmap_plan->format12_groups); - } + unsigned format4objidx = 0, format12objidx = 0, format14objidx = 0; - bool _subset (const hb_subset_plan_t *plan, - const subset_plan &cmap_subset_plan, - size_t dest_sz, - void *dest) const - { - hb_serialize_context_t c (dest, dest_sz); - - cmap *table = c.start_serialize (); - if (unlikely (!c.extend_min (*table))) + for (const EncodingRecord& _ : encodingrec_iter) { - return false; - } - - table->version = 0; - - if (unlikely (!table->encodingRecord.serialize (&c, cmap_subset_plan.num_enc_records))) return false; - - // TODO(grieger): Convert the below to a for loop - int enc_index = 0; - int unicode_bmp_index = 0; - int unicode_ucs4_index = 0; - int ms_bmp_index = 0; - int ms_ucs4_index = 0; + unsigned format = (src_base+_.subtable).u.format; - // Format 4, Plat 0 Encoding Record - if (cmap_subset_plan.has_unicode_bmp) - { - unicode_bmp_index = enc_index; - EncodingRecord &format4_plat0_rec = table->encodingRecord[enc_index++]; - format4_plat0_rec.platformID = 0; // Unicode - format4_plat0_rec.encodingID = 3; + if (format == 4) c->copy (_, it, 4u, src_base, this, plan, &format4objidx); + else if (format == 12) c->copy (_, it, 12u, src_base, this, plan, &format12objidx); + else if (format == 14) c->copy (_, it, 14u, src_base, this, plan, &format14objidx); } - // Format 12, Plat 0 Encoding Record - if (cmap_subset_plan.has_unicode_ucs4) - { - unicode_ucs4_index = enc_index; - EncodingRecord &format12_rec = table->encodingRecord[enc_index++]; - format12_rec.platformID = 0; // Unicode - format12_rec.encodingID = 4; // Unicode UCS-4 - } + c->check_assign(this->encodingRecord.len, (c->length () - cmap::min_size)/EncodingRecord::static_size); + } - // Format 4, Plat 3 Encoding Record - if (cmap_subset_plan.has_ms_bmp) - { - ms_bmp_index = enc_index; - EncodingRecord &format4_plat3_rec = table->encodingRecord[enc_index++]; - format4_plat3_rec.platformID = 3; // Windows - format4_plat3_rec.encodingID = 1; // Unicode BMP - } + void closure_glyphs (const hb_set_t *unicodes, + hb_set_t *glyphset) const + { + + hb_iter (encodingRecord) + | hb_map (&EncodingRecord::subtable) + | hb_map (hb_add (this)) + | hb_filter ([&] (const CmapSubtable& _) { return _.u.format == 14; }) + | hb_apply ([=] (const CmapSubtable& _) { _.u.format14.closure_glyphs (unicodes, glyphset); }) + ; + } - // Format 12, Plat 3 Encoding Record - if (cmap_subset_plan.has_ms_ucs4) - { - ms_ucs4_index = enc_index; - EncodingRecord &format12_rec = table->encodingRecord[enc_index++]; - format12_rec.platformID = 3; // Windows - format12_rec.encodingID = 10; // Unicode UCS-4 - } + bool subset (hb_subset_context_t *c) const + { + TRACE_SUBSET (this); - // Write out format 4 sub table - { - if (unlikely (!cmap_subset_plan.has_unicode_bmp && !cmap_subset_plan.has_ms_bmp)) return false; - EncodingRecord &format4_rec = cmap_subset_plan.has_unicode_bmp? - table->encodingRecord[unicode_bmp_index]: - table->encodingRecord[ms_bmp_index]; - CmapSubtable &subtable = format4_rec.subtable.serialize (&c, table); - if (cmap_subset_plan.has_unicode_bmp && cmap_subset_plan.has_ms_bmp) - table->encodingRecord[ms_bmp_index].subtable = (unsigned int) format4_rec.subtable; - subtable.u.format = 4; + cmap *cmap_prime = c->serializer->start_embed (); + if (unlikely (!c->serializer->check_success (cmap_prime))) return_trace (false); - CmapSubtableFormat4 &format4 = subtable.u.format4; - if (unlikely (!format4.serialize (&c, plan, cmap_subset_plan.format4_segments))) - return false; - } + auto encodingrec_iter = + + hb_iter (encodingRecord) + | hb_filter ([&] (const EncodingRecord& _) + { + if ((_.platformID == 0 && _.encodingID == 3) || + (_.platformID == 0 && _.encodingID == 4) || + (_.platformID == 3 && _.encodingID == 1) || + (_.platformID == 3 && _.encodingID == 10) || + (this + _.subtable).u.format == 14) + return true; - // Write out format 12 sub table. - if (cmap_subset_plan.format12_groups) - { - if (unlikely (!cmap_subset_plan.has_unicode_ucs4 && !cmap_subset_plan.has_ms_ucs4)) return false; - EncodingRecord &format12_rec = cmap_subset_plan.has_unicode_ucs4? - table->encodingRecord[unicode_ucs4_index]: - table->encodingRecord[ms_ucs4_index]; - - CmapSubtable &subtable = format12_rec.subtable.serialize (&c, table); - if (cmap_subset_plan.has_unicode_ucs4 && cmap_subset_plan.has_ms_ucs4) - table->encodingRecord[ms_ucs4_index].subtable = (unsigned int) format12_rec.subtable; - subtable.u.format = 12; + return false; + }) + ; - CmapSubtableFormat12 &format12 = subtable.u.format12; - if (unlikely (!format12.serialize (&c, cmap_subset_plan.format12_groups))) - return false; - } - c.end_serialize (); + if (unlikely (!encodingrec_iter.len ())) return_trace (false); - return true; - } - - bool subset (hb_subset_plan_t *plan) const - { - subset_plan cmap_subset_plan; + const EncodingRecord *unicode_bmp= nullptr, *unicode_ucs4 = nullptr, *ms_bmp = nullptr, *ms_ucs4 = nullptr; + bool has_format12 = false; - if (unlikely (!_create_plan (plan, &cmap_subset_plan))) + for (const EncodingRecord& _ : encodingrec_iter) { - DEBUG_MSG(SUBSET, nullptr, "Failed to generate a cmap subsetting plan."); - return false; - } + unsigned format = (this + _.subtable).u.format; + if (format == 12) has_format12 = true; - // We now know how big our blob needs to be - size_t dest_sz = cmap_subset_plan.final_size (); - void *dest = malloc (dest_sz); - if (unlikely (!dest)) { - DEBUG_MSG(SUBSET, nullptr, "Unable to alloc %lu for cmap subset output", (unsigned long) dest_sz); - return false; + const EncodingRecord *table = hb_addressof (_); + if (_.platformID == 0 && _.encodingID == 3) unicode_bmp = table; + else if (_.platformID == 0 && _.encodingID == 4) unicode_ucs4 = table; + else if (_.platformID == 3 && _.encodingID == 1) ms_bmp = table; + else if (_.platformID == 3 && _.encodingID == 10) ms_ucs4 = table; } - if (unlikely (!_subset (plan, cmap_subset_plan, dest_sz, dest))) - { - DEBUG_MSG(SUBSET, nullptr, "Failed to perform subsetting of cmap."); - free (dest); - return false; - } + if (unlikely (!unicode_bmp && !ms_bmp)) return_trace (false); + if (unlikely (has_format12 && (!unicode_ucs4 && !ms_ucs4))) return_trace (false); - // all done, write the blob into dest - hb_blob_t *cmap_prime = hb_blob_create ((const char *) dest, - dest_sz, - HB_MEMORY_MODE_READONLY, - dest, - free); - bool result = plan->add_table (HB_OT_TAG_cmap, cmap_prime); - hb_blob_destroy (cmap_prime); - return result; + auto it = + + hb_iter (c->plan->unicodes) + | hb_map ([&] (hb_codepoint_t _) + { + hb_codepoint_t new_gid = HB_MAP_VALUE_INVALID; + c->plan->new_gid_for_codepoint (_, &new_gid); + return hb_pair_t (_, new_gid); + }) + | hb_filter ([&] (const hb_pair_t _) + { return (_.second != HB_MAP_VALUE_INVALID); }) + ; + + cmap_prime->serialize (c->serializer, it, encodingrec_iter, this, c->plan); + return_trace (true); } const CmapSubtable *find_best_subtable (bool *symbol = nullptr) const @@ -1027,6 +1216,15 @@ const CmapSubtable *subtable; + /* Symbol subtable. + * Prefer symbol if available. + * https://github.com/harfbuzz/harfbuzz/issues/1918 */ + if ((subtable = this->find_subtable (3, 0))) + { + if (symbol) *symbol = true; + return subtable; + } + /* 32-bit subtables. */ if ((subtable = this->find_subtable (3, 10))) return subtable; if ((subtable = this->find_subtable (0, 6))) return subtable; @@ -1039,13 +1237,6 @@ if ((subtable = this->find_subtable (0, 1))) return subtable; if ((subtable = this->find_subtable (0, 0))) return subtable; - /* Symbol subtable. */ - if ((subtable = this->find_subtable (3, 0))) - { - if (symbol) *symbol = true; - return subtable; - } - /* Meh. */ return &Null (CmapSubtable); } @@ -1066,9 +1257,9 @@ this->get_glyph_data = subtable; if (unlikely (symbol)) - { this->get_glyph_funcZ = get_glyph_from_symbol; - } else { + else + { switch (subtable->u.format) { /* Accelerate format 4 and format 12. */ default: @@ -1078,20 +1269,20 @@ this->get_glyph_funcZ = get_glyph_from; break; case 4: - { - this->format4_accel.init (&subtable->u.format4); - this->get_glyph_data = &this->format4_accel; - this->get_glyph_funcZ = this->format4_accel.get_glyph_func; - } + { + this->format4_accel.init (&subtable->u.format4); + this->get_glyph_data = &this->format4_accel; + this->get_glyph_funcZ = this->format4_accel.get_glyph_func; break; } + } } } void fini () { this->table.destroy (); } bool get_nominal_glyph (hb_codepoint_t unicode, - hb_codepoint_t *glyph) const + hb_codepoint_t *glyph) const { if (unlikely (!this->get_glyph_funcZ)) return false; return this->get_glyph_funcZ (this->get_glyph_data, unicode, glyph); @@ -1135,18 +1326,12 @@ } void collect_unicodes (hb_set_t *out) const - { - subtable->collect_unicodes (out); - } + { subtable->collect_unicodes (out); } void collect_variation_selectors (hb_set_t *out) const - { - subtable_uvs->collect_variation_selectors (out); - } + { subtable_uvs->collect_variation_selectors (out); } void collect_variation_unicodes (hb_codepoint_t variation_selector, hb_set_t *out) const - { - subtable_uvs->collect_variation_unicodes (variation_selector, out); - } + { subtable_uvs->collect_variation_unicodes (variation_selector, out); } protected: typedef bool (*hb_cmap_get_glyph_func_t) (const void *obj, @@ -1193,6 +1378,7 @@ CmapSubtableFormat4::accelerator_t format4_accel; + public: hb_blob_ptr_t table; }; @@ -1212,6 +1398,16 @@ return &(this+result.subtable); } + const EncodingRecord *find_encodingrec (unsigned int platform_id, + unsigned int encoding_id) const + { + EncodingRecord key; + key.platformID = platform_id; + key.encodingID = encoding_id; + + return encodingRecord.as_array ().bsearch (key); + } + bool find_subtable (unsigned format) const { auto it = diff -Nru harfbuzz-2.5.3/src/hb-ot-color-cbdt-table.hh harfbuzz-2.6.2/src/hb-ot-color-cbdt-table.hh --- harfbuzz-2.5.3/src/hb-ot-color-cbdt-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-color-cbdt-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -226,8 +226,8 @@ offset, length, format); } - GlyphID firstGlyphIndex; - GlyphID lastGlyphIndex; + HBGlyphID firstGlyphIndex; + HBGlyphID lastGlyphIndex; LOffsetTo offsetToSubtable; public: DEFINE_SIZE_STATIC(8); @@ -251,7 +251,7 @@ unsigned int firstGlyphIndex = indexSubtablesZ[i].firstGlyphIndex; unsigned int lastGlyphIndex = indexSubtablesZ[i].lastGlyphIndex; if (firstGlyphIndex <= glyph && glyph <= lastGlyphIndex) - return &indexSubtablesZ[i]; + return &indexSubtablesZ[i]; } return nullptr; } @@ -290,8 +290,8 @@ HBUINT32 colorRef; SBitLineMetrics horizontal; SBitLineMetrics vertical; - GlyphID startGlyphIndex; - GlyphID endGlyphIndex; + HBGlyphID startGlyphIndex; + HBGlyphID endGlyphIndex; HBUINT8 ppemX; HBUINT8 ppemY; HBUINT8 bitDepth; diff -Nru harfbuzz-2.5.3/src/hb-ot-color-colr-table.hh harfbuzz-2.6.2/src/hb-ot-color-colr-table.hh --- harfbuzz-2.5.3/src/hb-ot-color-colr-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-color-colr-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -39,14 +39,16 @@ struct LayerRecord { + operator hb_ot_color_layer_t () const { return {glyphId, colorIdx}; } + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); } - public: - GlyphID glyphId; /* Glyph ID of layer glyph */ + protected: + HBGlyphID glyphId; /* Glyph ID of layer glyph */ Index colorIdx; /* Index value to use with a * selected color palette. * An index value of 0xFFFF @@ -73,7 +75,7 @@ } public: - GlyphID glyphId; /* Glyph ID of reference glyph */ + HBGlyphID glyphId; /* Glyph ID of reference glyph */ HBUINT16 firstLayerIdx; /* Index (from beginning of * the Layer Records) to the * layer record. There will be @@ -98,18 +100,14 @@ { const BaseGlyphRecord &record = (this+baseGlyphsZ).bsearch (numBaseGlyphs, glyph); - hb_array_t all_layers ((this+layersZ).arrayZ, numLayers); + hb_array_t all_layers = (this+layersZ).as_array (numLayers); hb_array_t glyph_layers = all_layers.sub_array (record.firstLayerIdx, record.numLayers); if (count) { - hb_array_t segment_layers = glyph_layers.sub_array (start_offset, *count); - *count = segment_layers.length; - for (unsigned int i = 0; i < segment_layers.length; i++) - { - layers[i].glyph = segment_layers.arrayZ[i].glyphId; - layers[i].color_index = segment_layers.arrayZ[i].colorIdx; - } + + glyph_layers.sub_array (start_offset, count) + | hb_sink (hb_array (layers, *count)) + ; } return glyph_layers.length; } diff -Nru harfbuzz-2.5.3/src/hb-ot-color-cpal-table.hh harfbuzz-2.6.2/src/hb-ot-color-cpal-table.hh --- harfbuzz-2.5.3/src/hb-ot-color-cpal-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-color-cpal-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -147,7 +147,7 @@ unsigned int count = hb_min ((unsigned) hb_max ((int) (numColors - start_offset), 0), *color_count); *color_count = count; for (unsigned int i = 0; i < count; i++) - colors[i] = segment_colors[i]; /* Bound-checked read. */ + colors[i] = segment_colors[i]; /* Bound-checked read. */ } return numColors; } diff -Nru harfbuzz-2.5.3/src/hb-ot-color-sbix-table.hh harfbuzz-2.6.2/src/hb-ot-color-sbix-table.hh --- harfbuzz-2.5.3/src/hb-ot-color-sbix-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-color-sbix-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -125,7 +125,7 @@ imageOffsetsZ; /* Offset from the beginning of the strike data header * to bitmap data for an individual glyph ID. */ public: - DEFINE_SIZE_STATIC (8); + DEFINE_SIZE_ARRAY (4, imageOffsetsZ); }; struct sbix @@ -173,11 +173,11 @@ { unsigned count = table->strikes.len; if (unlikely (!count)) - return Null(SBIXStrike); + return Null(SBIXStrike); unsigned int requested_ppem = hb_max (font->x_ppem, font->y_ppem); if (!requested_ppem) - requested_ppem = 1<<30; /* Choose largest strike. */ + requested_ppem = 1<<30; /* Choose largest strike. */ /* TODO Add DPI sensitivity as well? */ unsigned int best_i = 0; unsigned int best_ppem = table->get_strike (0).ppem; @@ -201,7 +201,7 @@ HBUINT8 signature[8]; struct { - struct + struct { HBUINT32 length; Tag type; @@ -226,7 +226,7 @@ /* Following code is safe to call even without data. * But faster to short-circuit. */ if (!has_data ()) - return false; + return false; int x_offset = 0, y_offset = 0; unsigned int strike_ppem = 0; @@ -235,9 +235,9 @@ const PNGHeader &png = *blob->as(); extents->x_bearing = x_offset; - extents->y_bearing = y_offset; + extents->y_bearing = png.IHDR.height + y_offset; extents->width = png.IHDR.width; - extents->height = png.IHDR.height; + extents->height = -png.IHDR.height; /* Convert to font units. */ if (strike_ppem) diff -Nru harfbuzz-2.5.3/src/hb-ot-face.cc harfbuzz-2.6.2/src/hb-ot-face.cc --- harfbuzz-2.5.3/src/hb-ot-face.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-face.cc 2019-10-26 02:02:55.000000000 +0000 @@ -32,6 +32,7 @@ #include "hb-ot-cff2-table.hh" #include "hb-ot-hmtx-table.hh" #include "hb-ot-kern-table.hh" +#include "hb-ot-meta-table.hh" #include "hb-ot-name-table.hh" #include "hb-ot-post-table.hh" #include "hb-ot-color-cbdt-table.hh" diff -Nru harfbuzz-2.5.3/src/hb-ot-face-table-list.hh harfbuzz-2.6.2/src/hb-ot-face-table-list.hh --- harfbuzz-2.5.3/src/hb-ot-face-table-list.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-face-table-list.hh 2019-10-26 02:02:55.000000000 +0000 @@ -50,9 +50,10 @@ #if !defined(HB_NO_FACE_COLLECT_UNICODES) || !defined(HB_NO_OT_FONT) HB_OT_ACCELERATOR (OT, cmap) #endif +HB_OT_TABLE (OT, hhea) HB_OT_ACCELERATOR (OT, hmtx) HB_OT_TABLE (OT, OS2) -#ifndef HB_NO_OT_FONT_GLYPH_NAMES +#if !defined(HB_NO_OT_FONT_GLYPH_NAMES) || !defined(HB_NO_METRICS) HB_OT_ACCELERATOR (OT, post) #endif #ifndef HB_NO_NAME @@ -61,8 +62,12 @@ #ifndef HB_NO_STAT HB_OT_TABLE (OT, STAT) #endif +#ifndef HB_NO_META +HB_OT_ACCELERATOR (OT, meta) +#endif /* Vertical layout. */ +HB_OT_TABLE (OT, vhea) HB_OT_ACCELERATOR (OT, vmtx) /* TrueType outlines. */ @@ -88,11 +93,17 @@ #endif /* OpenType shaping. */ +#ifndef HB_NO_OT_LAYOUT HB_OT_ACCELERATOR (OT, GDEF) HB_OT_ACCELERATOR (OT, GSUB) HB_OT_ACCELERATOR (OT, GPOS) -//HB_OT_TABLE (OT, BASE) //HB_OT_TABLE (OT, JSTF) +#endif + +/* OpenType baseline. */ +#ifndef HB_NO_BASE +HB_OT_TABLE (OT, BASE) +#endif /* AAT shaping. */ #ifndef HB_NO_AAT @@ -104,6 +115,7 @@ HB_OT_TABLE (AAT, lcar) HB_OT_TABLE (AAT, ltag) HB_OT_TABLE (AAT, feat) +// HB_OT_TABLE (AAT, opbd) #endif /* OpenType color fonts. */ diff -Nru harfbuzz-2.5.3/src/hb-ot-font.cc harfbuzz-2.6.2/src/hb-ot-font.cc --- harfbuzz-2.5.3/src/hb-ot-font.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-font.cc 2019-10-26 02:02:55.000000000 +0000 @@ -208,20 +208,20 @@ #ifndef HB_NO_OT_FONT_GLYPH_NAMES static hb_bool_t hb_ot_get_glyph_name (hb_font_t *font HB_UNUSED, - void *font_data, - hb_codepoint_t glyph, - char *name, unsigned int size, - void *user_data HB_UNUSED) + void *font_data, + hb_codepoint_t glyph, + char *name, unsigned int size, + void *user_data HB_UNUSED) { const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data; return ot_face->post->get_glyph_name (glyph, name, size); } static hb_bool_t hb_ot_get_glyph_from_name (hb_font_t *font HB_UNUSED, - void *font_data, - const char *name, int len, - hb_codepoint_t *glyph, - void *user_data HB_UNUSED) + void *font_data, + const char *name, int len, + hb_codepoint_t *glyph, + void *user_data HB_UNUSED) { const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data; return ot_face->post->get_glyph_from_name (name, len, glyph); @@ -230,32 +230,24 @@ static hb_bool_t hb_ot_get_font_h_extents (hb_font_t *font, - void *font_data, + void *font_data HB_UNUSED, hb_font_extents_t *metrics, void *user_data HB_UNUSED) { - const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data; - const OT::hmtx_accelerator_t &hmtx = *ot_face->hmtx; - metrics->ascender = font->em_scale_y (hmtx.ascender); - metrics->descender = font->em_scale_y (hmtx.descender); - metrics->line_gap = font->em_scale_y (hmtx.line_gap); - // TODO Hook up variations. - return hmtx.has_font_extents; + return _hb_ot_metrics_get_position_common (font, HB_OT_METRICS_TAG_HORIZONTAL_ASCENDER, &metrics->ascender) && + _hb_ot_metrics_get_position_common (font, HB_OT_METRICS_TAG_HORIZONTAL_DESCENDER, &metrics->descender) && + _hb_ot_metrics_get_position_common (font, HB_OT_METRICS_TAG_HORIZONTAL_LINE_GAP, &metrics->line_gap); } static hb_bool_t hb_ot_get_font_v_extents (hb_font_t *font, - void *font_data, + void *font_data HB_UNUSED, hb_font_extents_t *metrics, void *user_data HB_UNUSED) { - const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data; - const OT::vmtx_accelerator_t &vmtx = *ot_face->vmtx; - metrics->ascender = font->em_scale_x (vmtx.ascender); - metrics->descender = font->em_scale_x (vmtx.descender); - metrics->line_gap = font->em_scale_x (vmtx.line_gap); - // TODO Hook up variations. - return vmtx.has_font_extents; + return _hb_ot_metrics_get_position_common (font, HB_OT_METRICS_TAG_VERTICAL_ASCENDER, &metrics->ascender) && + _hb_ot_metrics_get_position_common (font, HB_OT_METRICS_TAG_VERTICAL_DESCENDER, &metrics->descender) && + _hb_ot_metrics_get_position_common (font, HB_OT_METRICS_TAG_VERTICAL_LINE_GAP, &metrics->line_gap); } #if HB_USE_ATEXIT diff -Nru harfbuzz-2.5.3/src/hb-ot-glyf-table.hh harfbuzz-2.6.2/src/hb-ot-glyf-table.hh --- harfbuzz-2.5.3/src/hb-ot-glyf-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-glyf-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright © 2015 Google, Inc. + * Copyright © 2019 Ebrahim Byagowi * * This is part of HarfBuzz, a text shaping library. * @@ -53,11 +54,12 @@ } protected: - UnsizedArrayOf dataZ; /* Location data. */ + UnsizedArrayOf + dataZ; /* Location data. */ public: - DEFINE_SIZE_MIN (0); /* In reality, this is UNBOUNDED() type; but since we always - * check the size externally, allow Null() object of it by - * defining it _MIN instead. */ + DEFINE_SIZE_MIN (0); /* In reality, this is UNBOUNDED() type; but since we always + * check the size externally, allow Null() object of it by + * defining it _MIN instead. */ }; @@ -93,7 +95,9 @@ if (unlikely (!loca_prime_data)) return false; - DEBUG_MSG(SUBSET, nullptr, "loca entry_size %d num_offsets %d max_offset %d size %d", entry_size, num_offsets, max_offset, entry_size * num_offsets); + DEBUG_MSG (SUBSET, nullptr, "loca entry_size %d num_offsets %d " + "max_offset %d size %d", + entry_size, num_offsets, max_offset, entry_size * num_offsets); if (use_short_loca) _write_loca (padded_offsets, 1, hb_array ((HBUINT16*) loca_prime_data, num_offsets)); @@ -122,27 +126,24 @@ unsigned int offset = 0; dest << 0; + it - | hb_map ([=, &offset] (unsigned int padded_size) { - offset += padded_size; - DEBUG_MSG(SUBSET, nullptr, "loca entry offset %d", offset); - return offset >> right_shift; - }) + | hb_map ([=, &offset] (unsigned int padded_size) + { + offset += padded_size; + DEBUG_MSG (SUBSET, nullptr, "loca entry offset %d", offset); + return offset >> right_shift; + }) | hb_sink (dest) ; } // requires source of SubsetGlyph complains the identifier isn't declared template - bool serialize(hb_serialize_context_t *c, - Iterator it, - const hb_subset_plan_t *plan) + bool serialize (hb_serialize_context_t *c, + Iterator it, + const hb_subset_plan_t *plan) { TRACE_SERIALIZE (this); - - + it - | hb_apply ([=] (const SubsetGlyph& _) { _.serialize (c, plan); }) - ; - + for (const auto &_ : it) _.serialize (c, plan); return_trace (true); } @@ -167,7 +168,8 @@ ; if (c->serializer->in_error ()) return_trace (false); - return_trace (c->serializer->check_success (_add_loca_and_head (c->plan, padded_offsets))); + return_trace (c->serializer->check_success (_add_loca_and_head (c->plan, + padded_offsets))); } template @@ -179,23 +181,26 @@ glyf.init (plan->source); + hb_range (plan->num_output_glyphs ()) - | hb_map ([&] (hb_codepoint_t new_gid) { - SubsetGlyph subset_glyph = {0}; - subset_glyph.new_gid = new_gid; - - // should never fail: all old gids should be mapped - if (!plan->old_gid_for_new_gid (new_gid, &subset_glyph.old_gid)) return subset_glyph; - - subset_glyph.source_glyph = glyf.bytes_for_glyph ((const char *) this, subset_glyph.old_gid); - if (plan->drop_hints) subset_glyph.drop_hints (glyf); - else subset_glyph.dest_start = subset_glyph.source_glyph; + | hb_map ([&] (hb_codepoint_t new_gid) + { + SubsetGlyph subset_glyph = {0}; + subset_glyph.new_gid = new_gid; + + // should never fail: all old gids should be mapped + if (!plan->old_gid_for_new_gid (new_gid, &subset_glyph.old_gid)) + return subset_glyph; + + subset_glyph.source_glyph = glyf.bytes_for_glyph ((const char *) this, + subset_glyph.old_gid); + if (plan->drop_hints) subset_glyph.drop_hints (glyf); + else subset_glyph.dest_start = subset_glyph.source_glyph; - return subset_glyph; - }) + return subset_glyph; + }) | hb_sink (glyphs) ; - glyf.fini(); + glyf.fini (); } static void @@ -221,30 +226,34 @@ static void _zero_instruction_length (hb_bytes_t glyph) { - const GlyphHeader &glyph_header = StructAtOffset (&glyph, 0); - int16_t num_contours = (int16_t) glyph_header.numberOfContours; - if (num_contours <= 0) return; // only for simple glyphs + const GlyphHeader &glyph_header = *glyph.as (); + if (!glyph_header.is_simple_glyph ()) return; // only for simple glyphs - const HBUINT16 &instruction_length = StructAtOffset (&glyph, GlyphHeader::static_size + 2 * num_contours); - (HBUINT16 &) instruction_length = 0; + unsigned int instruction_len_offset = glyph_header.simple_instruction_len_offset (); + const HBUINT16 &instruction_len = StructAtOffset (&glyph, + instruction_len_offset); + (HBUINT16 &) instruction_len = 0; } static bool _remove_composite_instruction_flag (hb_bytes_t glyph) { - const GlyphHeader &glyph_header = StructAtOffset (&glyph, 0); - if (glyph_header.numberOfContours >= 0) return true; // only for composites + const GlyphHeader &glyph_header = *glyph.as (); + if (!glyph_header.is_composite_glyph ()) return true; // only for composites /* remove WE_HAVE_INSTRUCTIONS from flags in dest */ OT::glyf::CompositeGlyphHeader::Iterator composite_it; - if (unlikely (!OT::glyf::CompositeGlyphHeader::get_iterator (&glyph, glyph.length, &composite_it))) return false; + if (unlikely (!OT::glyf::CompositeGlyphHeader::get_iterator (&glyph, glyph.length, + &composite_it))) + return false; const OT::glyf::CompositeGlyphHeader *composite_header; - do { + do + { composite_header = composite_it.current; OT::HBUINT16 *flags = const_cast (&composite_header->flags); *flags = (uint16_t) *flags & ~OT::glyf::CompositeGlyphHeader::WE_HAVE_INSTRUCTIONS; } while (composite_it.move_to_next ()); return true; -} + } static bool _add_head_and_set_loca_version (hb_subset_plan_t *plan, bool use_short_loca) @@ -266,21 +275,42 @@ struct GlyphHeader { - HBINT16 numberOfContours; /* If the number of contours is - * greater than or equal to zero, - * this is a simple glyph; if negative, - * this is a composite glyph. */ - FWORD xMin; /* Minimum x for coordinate data. */ - FWORD yMin; /* Minimum y for coordinate data. */ - FWORD xMax; /* Maximum x for coordinate data. */ - FWORD yMax; /* Maximum y for coordinate data. */ + unsigned int simple_instruction_len_offset () const + { return static_size + 2 * numberOfContours; } + + unsigned int simple_length (unsigned int instruction_len) const + { return simple_instruction_len_offset () + 2 + instruction_len; } + bool is_composite_glyph () const { return numberOfContours < 0; } + bool is_simple_glyph () const { return numberOfContours > 0; } + + void get_extents (hb_glyph_extents_t *extents) const + { + extents->x_bearing = hb_min (xMin, xMax); + extents->y_bearing = hb_max (yMin, yMax); + extents->width = hb_max (xMin, xMax) - extents->x_bearing; + extents->height = hb_min (yMin, yMax) - extents->y_bearing; + } + + bool has_data () const { return numberOfContours; } + + protected: + HBINT16 numberOfContours;/* If the number of contours is + * greater than or equal to zero, + * this is a simple glyph; if negative, + * this is a composite glyph. */ + FWORD xMin; /* Minimum x for coordinate data. */ + FWORD yMin; /* Minimum y for coordinate data. */ + FWORD xMax; /* Maximum x for coordinate data. */ + FWORD yMax; /* Maximum y for coordinate data. */ + public: DEFINE_SIZE_STATIC (10); }; struct CompositeGlyphHeader { - enum composite_glyph_flag_t { + enum composite_glyph_flag_t + { ARG_1_AND_2_ARE_WORDS = 0x0001, ARGS_ARE_XY_VALUES = 0x0002, ROUND_XY_TO_GRID = 0x0004, @@ -296,7 +326,7 @@ }; HBUINT16 flags; - GlyphID glyphIndex; + HBGlyphID glyphIndex; unsigned int get_size () const { @@ -340,8 +370,8 @@ bool in_range (const CompositeGlyphHeader *composite) const { return (const char *) composite >= glyph_start - && ((const char *) composite + CompositeGlyphHeader::min_size) <= glyph_end - && ((const char *) composite + composite->get_size ()) <= glyph_end; + && ((const char *) composite + CompositeGlyphHeader::min_size) <= glyph_end + && ((const char *) composite + composite->get_size ()) <= glyph_end; } }; @@ -349,11 +379,10 @@ unsigned int length, CompositeGlyphHeader::Iterator *iterator /* OUT */) { - if (length < GlyphHeader::static_size) - return false; /* Empty glyph; zero extents. */ + const GlyphHeader &glyph_header = *hb_bytes_t (glyph_data, length).as (); + if (!glyph_header.has_data ()) return false; /* Empty glyph; zero extents. */ - const GlyphHeader &glyph_header = StructAtOffset (glyph_data, 0); - if (glyph_header.numberOfContours < 0) + if (glyph_header.is_composite_glyph ()) { const CompositeGlyphHeader *possible = &StructAfter (glyph_header); @@ -416,7 +445,8 @@ composite); } - enum simple_glyph_flag_t { + enum simple_glyph_flag_t + { FLAG_ON_CURVE = 0x01, FLAG_X_SHORT = 0x02, FLAG_Y_SHORT = 0x04, @@ -431,21 +461,20 @@ bool remove_padding (unsigned int start_offset, unsigned int *end_offset) const { - if (*end_offset - start_offset < GlyphHeader::static_size) return true; - const char *glyph = ((const char *) glyf_table) + start_offset; - const char * const glyph_end = glyph + (*end_offset - start_offset); - const GlyphHeader &glyph_header = StructAtOffset (glyph, 0); - int16_t num_contours = (int16_t) glyph_header.numberOfContours; + unsigned int glyph_length = *end_offset - start_offset; + const GlyphHeader &glyph_header = *hb_bytes_t (glyph, glyph_length).as (); + if (!glyph_header.has_data ()) return true; - if (num_contours < 0) + const char *glyph_end = glyph + glyph_length; + if (glyph_header.is_composite_glyph ()) /* Trimming for composites not implemented. * If removing hints it falls out of that. */ return true; - else if (num_contours > 0) + else { /* simple glyph w/contours, possibly trimmable */ - glyph += GlyphHeader::static_size + 2 * num_contours; + glyph += glyph_header.simple_instruction_len_offset (); if (unlikely (glyph + 2 >= glyph_end)) return false; uint16_t nCoordinates = (uint16_t) StructAtOffset (glyph - 2, 0) + 1; @@ -466,7 +495,7 @@ { if (glyph >= glyph_end) { - DEBUG_MSG(SUBSET, nullptr, "Bad flag"); + DEBUG_MSG (SUBSET, nullptr, "Bad flag"); return false; } repeat = ((uint8_t) *glyph) + 1; @@ -489,7 +518,8 @@ if (coordsWithFlags != nCoordinates) { - DEBUG_MSG(SUBSET, nullptr, "Expect %d coords to have flags, got flags for %d", nCoordinates, coordsWithFlags); + DEBUG_MSG (SUBSET, nullptr, "Expect %d coords to have flags, got flags for %d", + nCoordinates, coordsWithFlags); return false; } glyph += coordBytes; @@ -530,52 +560,60 @@ bool get_instruction_length (hb_bytes_t glyph, unsigned int * length /* OUT */) const { + const GlyphHeader &glyph_header = *glyph.as (); /* Empty glyph; no instructions. */ - if (glyph.length < GlyphHeader::static_size) + if (!glyph_header.has_data ()) { *length = 0; // only 0 byte glyphs are healthy when missing GlyphHeader return glyph.length == 0; } - const GlyphHeader &glyph_header = StructAtOffset (&glyph, 0); - int16_t num_contours = (int16_t) glyph_header.numberOfContours; - if (num_contours < 0) + if (glyph_header.is_composite_glyph ()) { unsigned int start = glyph.length; unsigned int end = glyph.length; unsigned int glyph_offset = &glyph - glyf_table; CompositeGlyphHeader::Iterator composite_it; - if (unlikely (!CompositeGlyphHeader::get_iterator (&glyph, glyph.length, &composite_it))) return false; + if (unlikely (!CompositeGlyphHeader::get_iterator (&glyph, glyph.length, + &composite_it))) + return false; const CompositeGlyphHeader *last; - do { + do + { last = composite_it.current; } while (composite_it.move_to_next ()); if ((uint16_t) last->flags & CompositeGlyphHeader::WE_HAVE_INSTRUCTIONS) - start = ((char *) last - (char *) glyf_table->dataZ.arrayZ) + last->get_size () - glyph_offset; + start = ((char *) last - (char *) glyf_table->dataZ.arrayZ) + + last->get_size () - glyph_offset; if (unlikely (start > end)) { - DEBUG_MSG(SUBSET, nullptr, "Invalid instruction offset, %d is outside %d byte buffer", start, glyph.length); + DEBUG_MSG (SUBSET, nullptr, "Invalid instruction offset, %d is outside " + "%d byte buffer", start, glyph.length); return false; } *length = end - start; } else { - unsigned int instruction_length_offset = GlyphHeader::static_size + 2 * num_contours; - if (unlikely (instruction_length_offset + 2 > glyph.length)) + unsigned int instruction_len_offset = glyph_header.simple_instruction_len_offset (); + if (unlikely (instruction_len_offset + 2 > glyph.length)) { - DEBUG_MSG(SUBSET, nullptr, "Glyph size is too short, missing field instructionLength."); + DEBUG_MSG (SUBSET, nullptr, "Glyph size is too short, missing field " + "instructionLength."); return false; } - const HBUINT16 &instruction_length = StructAtOffset (&glyph, instruction_length_offset); - if (unlikely (instruction_length_offset + instruction_length > glyph.length)) // Out of bounds of the current glyph + const HBUINT16 &instruction_len = StructAtOffset (&glyph, + instruction_len_offset); + /* Out of bounds of the current glyph */ + if (unlikely (glyph_header.simple_length (instruction_len) > glyph.length)) { - DEBUG_MSG(SUBSET, nullptr, "The instructions array overruns the glyph's boundaries."); + DEBUG_MSG (SUBSET, nullptr, "The instructions array overruns the " + "glyph's boundaries."); return false; } - *length = (uint16_t) instruction_length; + *length = (uint16_t) instruction_len; } return true; } @@ -586,37 +624,28 @@ if (!get_offsets (glyph, &start_offset, &end_offset)) return false; - if (end_offset - start_offset < GlyphHeader::static_size) - return true; /* Empty glyph; zero extents. */ - - const GlyphHeader &glyph_header = StructAtOffset (glyf_table, start_offset); - - extents->x_bearing = hb_min (glyph_header.xMin, glyph_header.xMax); - extents->y_bearing = hb_max (glyph_header.yMin, glyph_header.yMax); - extents->width = hb_max (glyph_header.xMin, glyph_header.xMax) - extents->x_bearing; - extents->height = hb_min (glyph_header.yMin, glyph_header.yMax) - extents->y_bearing; - + hb_bytes_t ((const char *) glyf_table + start_offset, + end_offset - start_offset).as ()->get_extents (extents); return true; } - hb_bytes_t bytes_for_glyph (const char * glyf, hb_codepoint_t gid) - { - unsigned int start_offset, end_offset; - if (unlikely (!(get_offsets (gid, &start_offset, &end_offset) && - remove_padding (start_offset, &end_offset)))) + hb_bytes_t bytes_for_glyph (const char *glyf, hb_codepoint_t gid) { - DEBUG_MSG(SUBSET, nullptr, "Unable to get offset or remove padding for %d", gid); - return hb_bytes_t (); - } - hb_bytes_t glyph = hb_bytes_t (glyf + start_offset, end_offset - start_offset); - if (glyph.length == 0) return glyph; - if (unlikely (glyph.length < GlyphHeader::static_size)) - { - DEBUG_MSG(SUBSET, nullptr, "Glyph size smaller than minimum header %d", gid); - return hb_bytes_t (); + unsigned int start_offset, end_offset; + if (unlikely (!(get_offsets (gid, &start_offset, &end_offset) && + remove_padding (start_offset, &end_offset)))) + { + DEBUG_MSG (SUBSET, nullptr, "Unable to get offset or remove padding for %d", gid); + return hb_bytes_t (); + } + hb_bytes_t glyph_bytes = hb_bytes_t (glyf + start_offset, end_offset - start_offset); + if (!glyph_bytes.as ()->has_data ()) + { + DEBUG_MSG (SUBSET, nullptr, "Empty or invalid glyph size, %d", gid); + return hb_bytes_t (); + } + return glyph_bytes; } - return glyph; - } private: bool short_offset; @@ -625,99 +654,93 @@ hb_blob_ptr_t glyf_table; }; - struct SubsetGlyph { hb_codepoint_t new_gid; hb_codepoint_t old_gid; hb_bytes_t source_glyph; - hb_bytes_t dest_start; // region of source_glyph to copy first - hb_bytes_t dest_end; // region of source_glyph to copy second + hb_bytes_t dest_start; /* region of source_glyph to copy first */ + hb_bytes_t dest_end; /* region of source_glyph to copy second */ + bool serialize (hb_serialize_context_t *c, + const hb_subset_plan_t *plan) const + { + TRACE_SERIALIZE (this); - bool serialize (hb_serialize_context_t *c, - const hb_subset_plan_t *plan) const - { - TRACE_SERIALIZE (this); - - hb_bytes_t dest_glyph = dest_start.copy(c); - dest_glyph = hb_bytes_t (&dest_glyph, dest_glyph.length + dest_end.copy(c).length); - unsigned int pad_length = padding (); - DEBUG_MSG(SUBSET, nullptr, "serialize %d byte glyph, width %d pad %d", dest_glyph.length, dest_glyph.length + pad_length, pad_length); + hb_bytes_t dest_glyph = dest_start.copy (c); + dest_glyph = hb_bytes_t (&dest_glyph, dest_glyph.length + dest_end.copy (c).length); + unsigned int pad_length = padding (); + DEBUG_MSG (SUBSET, nullptr, "serialize %d byte glyph, width %d pad %d", + dest_glyph.length, dest_glyph.length + pad_length, pad_length); - HBUINT8 pad; - pad = 0; - while (pad_length > 0) - { - c->embed(pad); - pad_length--; - } + HBUINT8 pad; + pad = 0; + while (pad_length > 0) + { + c->embed (pad); + pad_length--; + } - if (dest_glyph.length) - { - _fix_component_gids (plan, dest_glyph); - if (plan->drop_hints) + if (dest_glyph.length) { - _zero_instruction_length (dest_glyph); - c->check_success (_remove_composite_instruction_flag (dest_glyph)); + _fix_component_gids (plan, dest_glyph); + if (plan->drop_hints) + { + _zero_instruction_length (dest_glyph); + c->check_success (_remove_composite_instruction_flag (dest_glyph)); + } } - } - return_trace (true); - } + return_trace (true); + } void drop_hints (const OT::glyf::accelerator_t& glyf) { if (source_glyph.length == 0) return; - unsigned int instruction_length = 0; - if (!glyf.get_instruction_length (source_glyph, &instruction_length)) + unsigned int instruction_len = 0; + if (!glyf.get_instruction_length (source_glyph, &instruction_len)) { - DEBUG_MSG(SUBSET, nullptr, "Unable to read instruction length for new_gid %d", new_gid); + DEBUG_MSG (SUBSET, nullptr, "Unable to read instruction length for new_gid %d", + new_gid); return ; } - const GlyphHeader& header = StructAtOffset (&source_glyph, 0); - int16_t num_contours = (int16_t) header.numberOfContours; - DEBUG_MSG(SUBSET, nullptr, "new_gid %d (%d contours) drop %d instruction bytes from %d byte source glyph", new_gid, num_contours, instruction_length, source_glyph.length); - if (num_contours < 0) + const GlyphHeader& header = *source_glyph.as (); + DEBUG_MSG (SUBSET, nullptr, "new_gid %d drop %d instruction bytes " + "from %d byte source glyph", + new_gid, instruction_len, source_glyph.length); + if (header.is_composite_glyph ()) { - // composite, just chop instructions off the end - dest_start = hb_bytes_t (&source_glyph, source_glyph.length - instruction_length); + /* just chop instructions off the end for composite glyphs */ + dest_start = hb_bytes_t (&source_glyph, source_glyph.length - instruction_len); } else { - // simple glyph - dest_start = hb_bytes_t (&source_glyph, GlyphHeader::static_size + 2 * header.numberOfContours + 2); - dest_end = hb_bytes_t (&source_glyph + dest_start.length + instruction_length, - source_glyph.length - dest_start.length - instruction_length); -DEBUG_MSG(SUBSET, nullptr, "source_len %d start len %d instruction_len %d end len %d", source_glyph.length, dest_start.length, instruction_length, dest_end.length); + unsigned int glyph_length = header.simple_length (instruction_len); + dest_start = hb_bytes_t (&source_glyph, glyph_length - instruction_len); + dest_end = hb_bytes_t (&source_glyph + glyph_length, + source_glyph.length - glyph_length); + DEBUG_MSG (SUBSET, nullptr, "source_len %d start len %d glyph_len %d " + "instruction_len %d end len %d", + source_glyph.length, dest_start.length, glyph_length, + instruction_len, dest_end.length); } } - unsigned int length () const - { - return dest_start.length + dest_end.length; - } - - // pad to 2 to ensure 2-byte loca will be ok - unsigned int padding () const - { - return length () % 2; - } - - unsigned int padded_size () const - { - return length () + padding (); - } + unsigned int length () const { return dest_start.length + dest_end.length; } + /* pad to 2 to ensure 2-byte loca will be ok */ + unsigned int padding () const { return length () % 2; } + unsigned int padded_size () const { return length () + padding (); } }; protected: - UnsizedArrayOf dataZ; /* Glyphs data. */ + UnsizedArrayOf + dataZ; /* Glyphs data. */ public: - DEFINE_SIZE_MIN (0); /* In reality, this is UNBOUNDED() type; but since we always - * check the size externally, allow Null() object of it by - * defining it _MIN instead. */ + DEFINE_SIZE_MIN (0); /* In reality, this is UNBOUNDED() type; but since we always + * check the size externally, allow Null() object of it by + * defining it _MIN instead. */ }; struct glyf_accelerator_t : glyf::accelerator_t {}; diff -Nru harfbuzz-2.5.3/src/hb-ot.h harfbuzz-2.6.2/src/hb-ot.h --- harfbuzz-2.5.3/src/hb-ot.h 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot.h 2019-10-26 02:02:55.000000000 +0000 @@ -35,6 +35,8 @@ #include "hb-ot-font.h" #include "hb-ot-layout.h" #include "hb-ot-math.h" +#include "hb-ot-meta.h" +#include "hb-ot-metrics.h" #include "hb-ot-name.h" #include "hb-ot-shape.h" #include "hb-ot-var.h" diff -Nru harfbuzz-2.5.3/src/hb-ot-hhea-table.hh harfbuzz-2.6.2/src/hb-ot-hhea-table.hh --- harfbuzz-2.5.3/src/hb-ot-hhea-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-hhea-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -45,6 +45,8 @@ template struct _hea { + bool has_data () const { return version.major; } + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); diff -Nru harfbuzz-2.5.3/src/hb-ot-hmtx-table.hh harfbuzz-2.6.2/src/hb-ot-hmtx-table.hh --- harfbuzz-2.5.3/src/hb-ot-hmtx-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-hmtx-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -29,8 +29,8 @@ #include "hb-open-type.hh" #include "hb-ot-hhea-table.hh" -#include "hb-ot-os2-table.hh" #include "hb-ot-var-hvar-table.hh" +#include "hb-ot-metrics.hh" /* * hmtx -- Horizontal Metrics @@ -66,7 +66,7 @@ bool subset_update_header (hb_subset_plan_t *plan, - unsigned int num_hmetrics) const + unsigned int num_hmetrics) const { hb_blob_t *src_blob = hb_sanitize_context_t ().reference_table (plan->source, H::tableTag); hb_blob_t *dest_blob = hb_blob_copy_writable_or_fail (src_blob); @@ -87,30 +87,30 @@ } template - void serialize (hb_serialize_context_t *c, - Iterator it, - unsigned num_advances) + hb_requires (hb_is_iterator (Iterator))> + void serialize (hb_serialize_context_t *c, + Iterator it, + unsigned num_advances) { unsigned idx = 0; + it | hb_apply ([c, &idx, num_advances] (const hb_item_type& _) - { - if (idx < num_advances) - { - LongMetric lm; - lm.advance = _.first; - lm.sb = _.second; - if (unlikely (!c->embed (&lm))) return; - } - else - { - FWORD *sb = c->allocate_size (FWORD::static_size); - if (unlikely (!sb)) return; - *sb = _.second; - } - idx++; - }) + { + if (idx < num_advances) + { + LongMetric lm; + lm.advance = _.first; + lm.sb = _.second; + if (unlikely (!c->embed (&lm))) return; + } + else + { + FWORD *sb = c->allocate_size (FWORD::static_size); + if (unlikely (!sb)) return; + *sb = _.second; + } + idx++; + }) ; } @@ -120,19 +120,19 @@ T *table_prime = c->serializer->start_embed (); if (unlikely (!table_prime)) return_trace (false); - + accelerator_t _mtx; _mtx.init (c->plan->source); unsigned num_advances = _mtx.num_advances_for_subset (c->plan); - - auto it = + + auto it = + hb_range (c->plan->num_output_glyphs ()) | hb_map ([c, &_mtx] (unsigned _) { hb_codepoint_t old_gid; if (c->plan->old_gid_for_new_gid (_, &old_gid)) - return hb_pair (_mtx.get_advance (old_gid), _mtx.get_side_bearing (old_gid)); - else + return hb_pair (_mtx.get_advance (old_gid), _mtx.get_side_bearing (old_gid)); + else return hb_pair (0u, 0u); }) ; @@ -158,32 +158,11 @@ friend struct hmtxvmtx; void init (hb_face_t *face, - unsigned int default_advance_ = 0) + unsigned int default_advance_ = 0) { default_advance = default_advance_ ? default_advance_ : hb_face_get_upem (face); - bool got_font_extents = false; - if (T::os2Tag != HB_TAG_NONE && face->table.OS2->is_typo_metrics ()) - { - ascender = abs (face->table.OS2->sTypoAscender); - descender = -abs (face->table.OS2->sTypoDescender); - line_gap = face->table.OS2->sTypoLineGap; - got_font_extents = (ascender | descender) != 0; - } - - hb_blob_t *_hea_blob = hb_sanitize_context_t().reference_table (face); - const H *_hea_table = _hea_blob->as (); - num_advances = _hea_table->numberOfLongMetrics; - if (!got_font_extents) - { - ascender = abs (_hea_table->ascender); - descender = -abs (_hea_table->descender); - line_gap = _hea_table->lineGap; - got_font_extents = (ascender | descender) != 0; - } - hb_blob_destroy (_hea_blob); - - has_font_extents = got_font_extents; + num_advances = T::is_horizontal ? face->table.hhea->numberOfLongMetrics : face->table.vhea->numberOfLongMetrics; table = hb_sanitize_context_t().reference_table (face, T::tableTag); @@ -215,10 +194,10 @@ unsigned int get_side_bearing (hb_codepoint_t glyph) const { if (glyph < num_advances) - return table->longMetricZ[glyph].sb; + return table->longMetricZ[glyph].sb; if (unlikely (glyph >= num_metrics)) - return 0; + return 0; const FWORD *bearings = (const FWORD *) &table->longMetricZ[num_advances]; return bearings[glyph - num_advances]; @@ -255,12 +234,12 @@ { unsigned int num_advances = plan->num_output_glyphs (); unsigned int last_advance = _advance_for_new_gid (plan, - num_advances - 1); + num_advances - 1); while (num_advances > 1 && - last_advance == _advance_for_new_gid (plan, - num_advances - 2)) + last_advance == _advance_for_new_gid (plan, + num_advances - 2)) { - num_advances--; + num_advances--; } return num_advances; @@ -268,21 +247,15 @@ private: unsigned int _advance_for_new_gid (const hb_subset_plan_t *plan, - hb_codepoint_t new_gid) const + hb_codepoint_t new_gid) const { hb_codepoint_t old_gid; if (!plan->old_gid_for_new_gid (new_gid, &old_gid)) - return 0; + return 0; return get_advance (old_gid); } - public: - bool has_font_extents; - int ascender; - int descender; - int line_gap; - protected: unsigned int num_metrics; unsigned int num_advances; @@ -322,12 +295,12 @@ struct hmtx : hmtxvmtx { static constexpr hb_tag_t tableTag = HB_OT_TAG_hmtx; static constexpr hb_tag_t variationsTag = HB_OT_TAG_HVAR; - static constexpr hb_tag_t os2Tag = HB_OT_TAG_OS2; + static constexpr bool is_horizontal = true; }; struct vmtx : hmtxvmtx { static constexpr hb_tag_t tableTag = HB_OT_TAG_vmtx; static constexpr hb_tag_t variationsTag = HB_OT_TAG_VVAR; - static constexpr hb_tag_t os2Tag = HB_TAG_NONE; + static constexpr bool is_horizontal = false; }; struct hmtx_accelerator_t : hmtx::accelerator_t {}; diff -Nru harfbuzz-2.5.3/src/hb-ot-kern-table.hh harfbuzz-2.6.2/src/hb-ot-kern-table.hh --- harfbuzz-2.5.3/src/hb-ot-kern-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-kern-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -128,11 +128,11 @@ TRACE_DISPATCH (this, subtable_type); switch (subtable_type) { case 0: return_trace (c->dispatch (u.format0)); -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE case 1: return_trace (u.header.apple ? c->dispatch (u.format1, hb_forward (ds)...) : c->default_return_value ()); #endif case 2: return_trace (c->dispatch (u.format2)); -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE case 3: return_trace (u.header.apple ? c->dispatch (u.format3, hb_forward (ds)...) : c->default_return_value ()); #endif default: return_trace (c->default_return_value ()); @@ -282,7 +282,7 @@ { switch (get_type ()) { case 0: return u.ot.has_state_machine (); -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE case 1: return u.aat.has_state_machine (); #endif default:return false; @@ -293,7 +293,7 @@ { switch (get_type ()) { case 0: return u.ot.has_cross_stream (); -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE case 1: return u.aat.has_cross_stream (); #endif default:return false; @@ -304,7 +304,7 @@ { switch (get_type ()) { case 0: return u.ot.get_h_kerning (left, right); -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE case 1: return u.aat.get_h_kerning (left, right); #endif default:return 0; @@ -321,7 +321,7 @@ TRACE_DISPATCH (this, subtable_type); switch (subtable_type) { case 0: return_trace (c->dispatch (u.ot, hb_forward (ds)...)); -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE case 1: return_trace (c->dispatch (u.aat, hb_forward (ds)...)); #endif default: return_trace (c->default_return_value ()); @@ -340,7 +340,7 @@ HBUINT32 version32; HBUINT16 major; KernOT ot; -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE KernAAT aat; #endif } u; diff -Nru harfbuzz-2.5.3/src/hb-ot-layout-base-table.hh harfbuzz-2.6.2/src/hb-ot-layout-base-table.hh --- harfbuzz-2.5.3/src/hb-ot-layout-base-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-layout-base-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -1,7 +1,7 @@ /* - * Copyright © 2016 Elie Roux + * Copyright © 2016 Elie Roux * Copyright © 2018 Google, Inc. - * Copyright © 2018 Ebrahim Byagowi + * Copyright © 2018-2019 Ebrahim Byagowi * * This is part of HarfBuzz, a text shaping library. * @@ -32,9 +32,6 @@ #include "hb-open-type.hh" #include "hb-ot-layout-common.hh" -/* To be removed */ -typedef hb_tag_t hb_ot_layout_baseline_t; - namespace OT { /* @@ -76,7 +73,7 @@ protected: HBUINT16 format; /* Format identifier--format = 2 */ FWORD coordinate; /* X or Y value, in design units */ - GlyphID referenceGlyph; /* Glyph ID of control glyph */ + HBGlyphID referenceGlyph; /* Glyph ID of control glyph */ HBUINT16 coordPoint; /* Index of contour point on the * reference glyph */ public: @@ -116,9 +113,11 @@ struct BaseCoord { - hb_position_t get_coord (hb_font_t *font, + bool has_data () const { return u.format; } + + hb_position_t get_coord (hb_font_t *font, const VariationStore &var_store, - hb_direction_t direction) const + hb_direction_t direction) const { switch (u.format) { case 1: return u.format1.get_coord (); @@ -142,10 +141,10 @@ protected: union { - HBUINT16 format; - BaseCoordFormat1 format1; - BaseCoordFormat2 format2; - BaseCoordFormat3 format3; + HBUINT16 format; + BaseCoordFormat1 format1; + BaseCoordFormat2 format2; + BaseCoordFormat3 format3; } u; public: DEFINE_SIZE_UNION (2, format); @@ -153,14 +152,9 @@ struct FeatMinMaxRecord { - HB_INTERNAL static int cmp (const void *key_, const void *entry_) - { - hb_tag_t key = * (hb_tag_t *) key_; - const FeatMinMaxRecord &entry = * (const FeatMinMaxRecord *) entry_; - return key < (unsigned int) entry.tag ? -1 : - key > (unsigned int) entry.tag ? 1 : - 0; - } + int cmp (hb_tag_t key) const { return tag.cmp (key); } + + bool has_data () const { return tag; } void get_min_max (const BaseCoord **min, const BaseCoord **max) const { @@ -195,17 +189,12 @@ struct MinMax { void get_min_max (hb_tag_t feature_tag, - const BaseCoord **min, - const BaseCoord **max) const + const BaseCoord **min, + const BaseCoord **max) const { - /* TODO Replace hb_bsearch() with .bsearch(). */ - const FeatMinMaxRecord *minMaxCoord = (const FeatMinMaxRecord *) - hb_bsearch (&feature_tag, featMinMaxRecords.arrayZ, - featMinMaxRecords.len, - FeatMinMaxRecord::static_size, - FeatMinMaxRecord::cmp); - if (minMaxCoord) - minMaxCoord->get_min_max (min, max); + const FeatMinMaxRecord &minMaxCoord = featMinMaxRecords.bsearch (feature_tag); + if (minMaxCoord.has_data ()) + minMaxCoord.get_min_max (min, max); else { if (likely (min)) *min = &(this+minCoord); @@ -271,17 +260,11 @@ struct BaseLangSysRecord { - HB_INTERNAL static int cmp (const void *key_, const void *entry_) - { - hb_tag_t key = * (hb_tag_t *) key_; - const BaseLangSysRecord &entry = * (const BaseLangSysRecord *) entry_; - return key < (unsigned int) entry.baseLangSysTag ? -1 : - key > (unsigned int) entry.baseLangSysTag ? 1 : - 0; - } + int cmp (hb_tag_t key) const { return baseLangSysTag.cmp (key); } - const MinMax &get_min_max () const - { return this+minMax; } + bool has_data () const { return baseLangSysTag; } + + const MinMax &get_min_max () const { return this+minMax; } bool sanitize (hb_sanitize_context_t *c, const void *base) const { @@ -303,19 +286,14 @@ { const MinMax &get_min_max (hb_tag_t language_tag) const { - /* TODO Replace hb_bsearch() with .bsearch(). */ - const BaseLangSysRecord* record = (const BaseLangSysRecord *) - hb_bsearch (&language_tag, baseLangSysRecords.arrayZ, - baseLangSysRecords.len, - BaseLangSysRecord::static_size, - BaseLangSysRecord::cmp); - return record ? record->get_min_max () : this+defaultMinMax; + const BaseLangSysRecord& record = baseLangSysRecords.bsearch (language_tag); + return record.has_data () ? record.get_min_max () : this+defaultMinMax; } const BaseCoord &get_base_coord (int baseline_tag_index) const { return (this+baseValues).get_base_coord (baseline_tag_index); } - bool is_empty () const { return !baseValues; } + bool has_data () const { return baseValues; } bool sanitize (hb_sanitize_context_t *c) const { @@ -345,14 +323,9 @@ struct BaseScriptList; struct BaseScriptRecord { - HB_INTERNAL static int cmp (const void *key_, const void *entry_) - { - hb_tag_t key = * (hb_tag_t *) key_; - const BaseScriptRecord &entry = * (const BaseScriptRecord *) entry_; - return key < (unsigned int) entry.baseScriptTag ? -1 : - key > (unsigned int) entry.baseScriptTag ? 1 : - 0; - } + int cmp (hb_tag_t key) const { return baseScriptTag.cmp (key); } + + bool has_data () const { return baseScriptTag; } const BaseScript &get_base_script (const BaseScriptList *list) const { return list+baseScript; } @@ -376,22 +349,11 @@ struct BaseScriptList { - const BaseScriptRecord *find_record (hb_tag_t script) const - { - /* TODO Replace hb_bsearch() with .bsearch(). */ - return (const BaseScriptRecord *) hb_bsearch (&script, baseScriptRecords.arrayZ, - baseScriptRecords.len, - BaseScriptRecord::static_size, - BaseScriptRecord::cmp); - } - - /* TODO: Or client should handle fallback? */ const BaseScript &get_base_script (hb_tag_t script) const { - const BaseScriptRecord *record = find_record (script); - if (!record) record = find_record ((hb_script_t) HB_TAG ('D','F','L','T')); - - return record ? record->get_base_script (this) : Null (BaseScript); + const BaseScriptRecord *record = &baseScriptRecords.bsearch (script); + if (!record->has_data ()) record = &baseScriptRecords.bsearch (HB_TAG ('D','F','L','T')); + return record->has_data () ? record->get_base_script (this) : Null (BaseScript); } bool sanitize (hb_sanitize_context_t *c) const @@ -411,15 +373,20 @@ struct Axis { - bool get_baseline (hb_ot_layout_baseline_t baseline, - hb_tag_t script_tag, - hb_tag_t language_tag, - const BaseCoord **coord) const + bool get_baseline (hb_tag_t baseline_tag, + hb_tag_t script_tag, + hb_tag_t language_tag, + const BaseCoord **coord) const { const BaseScript &base_script = (this+baseScriptList).get_base_script (script_tag); - if (base_script.is_empty ()) return false; + if (!base_script.has_data ()) return false; - if (likely (coord)) *coord = &base_script.get_base_coord ((this+baseTagList).bsearch (baseline)); + if (likely (coord)) + { + unsigned int tag_index = 0; + (this+baseTagList).bfind (baseline_tag, &tag_index); + *coord = &base_script.get_base_coord (tag_index); + } return true; } @@ -431,7 +398,7 @@ const BaseCoord **max_coord) const { const BaseScript &base_script = (this+baseScriptList).get_base_script (script_tag); - if (base_script.is_empty ()) return false; + if (!base_script.has_data ()) return false; base_script.get_min_max (language_tag).get_min_max (feature_tag, min_coord, max_coord); @@ -472,20 +439,21 @@ const VariationStore &get_var_store () const { return version.to_int () < 0x00010001u ? Null (VariationStore) : this+varStore; } - bool get_baseline (hb_font_t *font, - hb_ot_layout_baseline_t baseline, - hb_direction_t direction, - hb_tag_t script_tag, - hb_tag_t language_tag, - hb_position_t *base) const - { - const BaseCoord *base_coord; - if (!get_axis (direction).get_baseline (baseline, script_tag, language_tag, &base_coord)) + bool get_baseline (hb_font_t *font, + hb_tag_t baseline_tag, + hb_direction_t direction, + hb_tag_t script_tag, + hb_tag_t language_tag, + hb_position_t *base) const + { + const BaseCoord *base_coord = nullptr; + if (unlikely (!get_axis (direction).get_baseline (baseline_tag, script_tag, language_tag, &base_coord) || + !base_coord || !base_coord->has_data ())) return false; - if (likely (base && base_coord)) *base = base_coord->get_coord (font, - get_var_store (), - direction); + if (likely (base)) + *base = base_coord->get_coord (font, get_var_store (), direction); + return true; } diff -Nru harfbuzz-2.5.3/src/hb-ot-layout.cc harfbuzz-2.6.2/src/hb-ot-layout.cc --- harfbuzz-2.5.3/src/hb-ot-layout.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-layout.cc 2019-10-26 02:02:55.000000000 +0000 @@ -28,6 +28,14 @@ * Google Author(s): Behdad Esfahbod */ +#include "hb.hh" + +#ifndef HB_NO_OT_LAYOUT + +#ifdef HB_NO_OT_TAG +#error "Cannot compile hb-ot-layout.cc with HB_NO_OT_TAG." +#endif + #include "hb-open-type.hh" #include "hb-ot-layout.hh" #include "hb-ot-face.hh" @@ -35,7 +43,6 @@ #include "hb-map.hh" #include "hb-ot-kern-table.hh" -#include "hb-ot-gasp-table.hh" // Just so we compile it; unused otherwise. #include "hb-ot-layout-gdef-table.hh" #include "hb-ot-layout-gsub-table.hh" #include "hb-ot-layout-gpos-table.hh" @@ -47,6 +54,7 @@ #include "hb-aat-layout-lcar-table.hh" #include "hb-aat-layout-morx-table.hh" +#include "hb-aat-layout-opbd-table.hh" // Just so we compile it; unused otherwise. /** * SECTION:hb-ot-layout @@ -101,7 +109,7 @@ * * Tests whether a face has any cross-stream kerning (i.e., kerns * that make adjustments perpendicular to the direction of the text - * flow: Y adjustments in horizontal text or X adjustments in + * flow: Y adjustments in horizontal text or X adjustments in * vertical text) in the 'kern' table. * * Does NOT examine the GPOS table. @@ -278,7 +286,7 @@ * * Fetches the GDEF class of the requested glyph in the specified face. * - * Return value: The #hb_ot_layout_glyph_class_t glyph class of the given code + * Return value: The #hb_ot_layout_glyph_class_t glyph class of the given code * point in the GDEF table of the face. * * Since: 0.9.7 @@ -322,7 +330,7 @@ * @point_array: (out) (array length=point_count): The array of attachment points found for the query * * Fetches a list of all attachment points for the specified glyph in the GDEF - * table of the face. The list returned will begin at the offset provided. + * table of the face. The list returned will begin at the offset provided. * * Useful if the client program wishes to cache the list. * @@ -367,10 +375,14 @@ { if (caret_count) *caret_count = result_caret_count; } -#ifndef HB_NO_AAT else + { +#ifndef HB_NO_AAT result = font->face->table.lcar->get_lig_carets (font, direction, glyph, start_offset, caret_count, caret_array); +#else + if (caret_count) *caret_count = 0; #endif + } return result; } #endif @@ -388,7 +400,7 @@ return false; #endif -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE /* Mac OS X prefers morx over GSUB. It also ships with various Indic fonts, * all by 'MUTF' foundry (Tamil MN, Tamil Sangam MN, etc.), that have broken * GSUB/GPOS tables. Some have GSUB with zero scripts, those are ignored by @@ -555,7 +567,7 @@ if (g.find_script_index (script_tags[i], script_index)) { if (chosen_script) - *chosen_script = script_tags[i]; + *chosen_script = script_tags[i]; return true; } } @@ -972,7 +984,7 @@ * @face: #hb_face_t to work upon * @table_tag: HB_OT_TAG_GSUB or HB_OT_TAG_GPOS * - * Fetches the total number of lookups enumerated in the specified + * Fetches the total number of lookups enumerated in the specified * face's GSUB table or GPOS table. * * Since: 0.9.22 @@ -987,9 +999,9 @@ struct hb_collect_features_context_t { - hb_collect_features_context_t (hb_face_t *face, - hb_tag_t table_tag, - hb_set_t *feature_indexes_) + hb_collect_features_context_t (hb_face_t *face, + hb_tag_t table_tag, + hb_set_t *feature_indexes_) : g (get_gsubgpos_table (face, table_tag)), feature_indexes (feature_indexes_), script_count(0),langsys_count(0) {} @@ -1135,11 +1147,11 @@ **/ void hb_ot_layout_collect_features (hb_face_t *face, - hb_tag_t table_tag, - const hb_tag_t *scripts, - const hb_tag_t *languages, - const hb_tag_t *features, - hb_set_t *feature_indexes /* OUT */) + hb_tag_t table_tag, + const hb_tag_t *scripts, + const hb_tag_t *languages, + const hb_tag_t *features, + hb_set_t *feature_indexes /* OUT */) { hb_collect_features_context_t c (face, table_tag, feature_indexes); if (!scripts) @@ -1180,7 +1192,7 @@ * table or GPOS table, underneath the specified scripts, languages, and * features. If no list of scripts is provided, all scripts will be queried. * If no list of languages is provided, all languages will be queried. If no - * list of features is provided, all features will be queried. + * list of features is provided, all features will be queried. * * Since: 0.9.8 **/ @@ -1215,7 +1227,7 @@ * @glyphs_output: (out): Array of glyphs that would be the substitued output of the lookup * * Fetches a list of all glyphs affected by the specified lookup in the - * specified face's GSUB table of GPOS table. + * specified face's GSUB table or GPOS table. * * Since: 0.9.7 **/ @@ -1470,8 +1482,8 @@ **/ void hb_ot_layout_lookups_substitute_closure (hb_face_t *face, - const hb_set_t *lookups, - hb_set_t *glyphs /* OUT */) + const hb_set_t *lookups, + hb_set_t *glyphs /* OUT */) { hb_map_t done_lookups; OT::hb_closure_context_t c (face, glyphs, &done_lookups); @@ -1485,12 +1497,12 @@ if (lookups != nullptr) { for (hb_codepoint_t lookup_index = HB_SET_VALUE_INVALID; hb_set_next (lookups, &lookup_index);) - gsub.get_lookup (lookup_index).closure (&c, lookup_index); + gsub.get_lookup (lookup_index).closure (&c, lookup_index); } else { for (unsigned int i = 0; i < gsub.get_lookup_count (); i++) - gsub.get_lookup (i).closure (&c, i); + gsub.get_lookup (i).closure (&c, i); } } while (iteration_count++ <= HB_CLOSURE_MAX_STAGES && glyphs_length != glyphs->get_population ()); @@ -1574,7 +1586,7 @@ * as used here are defined as pertaining only to fonts within a font family that differ * specifically in their respective size ranges; other ways to differentiate fonts within * a subfamily are not covered by the `size` feature. - * + * * For more information on this distinction, see the `size` documentation at * https://docs.microsoft.com/en-us/typography/opentype/spec/features_pt#tag-39size39 * @@ -1716,7 +1728,7 @@ * returned. This function can be called with incrementally larger start_offset * until the char_count output value is lower than its input value, or the size * of the characters array can be increased. - * + * * Return value: Number of total sample characters in the cvXX feature. * * Since: 2.0.0 @@ -1933,70 +1945,36 @@ apply_string (c, lookup, accel); } -#if 0 +#ifndef HB_NO_BASE +/** + * hb_ot_layout_get_baseline: + * @font: a font + * @baseline_tag: a baseline tag + * @direction: text direction. + * @script_tag: script tag. + * @language_tag: language tag. + * @coord: (out): baseline value if found. + * + * Fetches a baseline value from the face. + * + * Return value: if found baseline value in the the font. + * + * Since: 2.6.0 + **/ hb_bool_t -hb_ot_layout_get_baseline (hb_font_t *font, - hb_ot_layout_baseline_t baseline, - hb_direction_t direction, - hb_tag_t script_tag, - hb_tag_t language_tag, - hb_position_t *coord /* OUT. May be NULL. */) +hb_ot_layout_get_baseline (hb_font_t *font, + hb_ot_layout_baseline_tag_t baseline_tag, + hb_direction_t direction, + hb_tag_t script_tag, + hb_tag_t language_tag, + hb_position_t *coord /* OUT. May be NULL. */) { - bool result = font->face->table.BASE->get_baseline (font, baseline, direction, script_tag, - language_tag, coord); + bool result = font->face->table.BASE->get_baseline (font, baseline_tag, direction, script_tag, language_tag, coord); - /* TODO: Simulate https://docs.microsoft.com/en-us/typography/opentype/spec/baselinetags#ideographic-em-box */ - if (!result && coord) *coord = 0; - - if (coord) *coord = font->em_scale_dir (*coord, direction); + if (result && coord) + *coord = HB_DIRECTION_IS_HORIZONTAL (direction) ? font->em_scale_y (*coord) : font->em_scale_x (*coord); return result; } - -/* To be moved to public header */ -/* - * BASE - */ - -/** - * hb_ot_layout_baseline_t: - * - * https://docs.microsoft.com/en-us/typography/opentype/spec/baselinetags - * - * Since: DONTREPLACEME - */ -typedef enum { - HB_OT_LAYOUT_BASELINE_HANG = HB_TAG('h','a','n','g'), - HB_OT_LAYOUT_BASELINE_ICFB = HB_TAG('i','c','f','b'), - HB_OT_LAYOUT_BASELINE_ICFT = HB_TAG('i','c','f','t'), - HB_OT_LAYOUT_BASELINE_IDEO = HB_TAG('i','d','e','o'), - HB_OT_LAYOUT_BASELINE_IDTB = HB_TAG('i','d','t','b'), - HB_OT_LAYOUT_BASELINE_MATH = HB_TAG('m','a','t','h'), - HB_OT_LAYOUT_BASELINE_ROMN = HB_TAG('r','o','m','n') -} hb_ot_layout_baseline_t; - - -/** - * hb_ot_layout_get_baseline: - * @font: The #hb_font_t to work upon - * @baseline: The #hb_ot_layout_baseline_t to query - * @direction: The #hb_direction_t text direction to use (horizontal or vertical) - * @script_tag: #hb_tag_t of the script to use - * @language_tag: #hb_tag_t of the language to use - * @coord: (out): The position of the requested baseline - * - * Fetches the coordinates of the specified baseline in the face, underneath - * the specified script and language and in the specified text direction. - * - * Return value: true if the baseline is found for the settings queried, false otherwise - * - **/ -HB_EXTERN hb_bool_t -hb_ot_layout_get_baseline (hb_font_t *font, - hb_ot_layout_baseline_t baseline, - hb_direction_t direction, - hb_tag_t script_tag, - hb_tag_t language_tag, - hb_position_t *coord /* OUT. May be NULL. */); - +#endif #endif diff -Nru harfbuzz-2.5.3/src/hb-ot-layout-common.hh harfbuzz-2.6.2/src/hb-ot-layout-common.hh --- harfbuzz-2.5.3/src/hb-ot-layout-common.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-layout-common.hh 2019-10-26 02:02:55.000000000 +0000 @@ -172,8 +172,8 @@ bool add_coverage (set_t *glyphs) const { return glyphs->add_range (start, end); } - GlyphID start; /* First GlyphID in the range */ - GlyphID end; /* Last GlyphID in the range */ + HBGlyphID start; /* First GlyphID in the range */ + HBGlyphID end; /* Last GlyphID in the range */ HBUINT16 value; /* Value */ public: DEFINE_SIZE_STATIC (6); @@ -540,7 +540,7 @@ FeatureParamsCharacterVariants characterVariants; } u; public: - DEFINE_SIZE_STATIC (17); + DEFINE_SIZE_MIN (0); }; struct Feature @@ -780,7 +780,7 @@ HBUINT16 lookupFlag; /* Lookup qualifiers */ ArrayOf subTable; /* Array of SubTables */ -/*HBUINT16 markFilteringSetX[VAR];*//* Index (base 0) into GDEF mark glyph sets +/*HBUINT16 markFilteringSetX[HB_VAR_ARRAY];*//* Index (base 0) into GDEF mark glyph sets * structure. This field is only present if bit * UseMarkFilteringSet of lookup flags is set. */ public: @@ -856,7 +856,7 @@ protected: HBUINT16 coverageFormat; /* Format identifier--format = 1 */ - SortedArrayOf + SortedArrayOf glyphArray; /* Array of GlyphIDs--in numerical order */ public: DEFINE_SIZE_ARRAY (4, glyphArray); @@ -895,7 +895,7 @@ for (auto g: glyphs) { if (last + 1 != g) - num_ranges++; + num_ranges++; last = g; } @@ -908,7 +908,7 @@ { if (last + 1 != g) { - range++; + range++; rangeRecord[range].start = g; rangeRecord[range].value = count; } @@ -1058,11 +1058,11 @@ for (auto g: glyphs) { if (last + 1 != g) - num_ranges++; + num_ranges++; last = g; count++; } - u.format = count * 2 < num_ranges * 3 ? 1 : 2; + u.format = count <= num_ranges * 3 ? 1 : 2; switch (u.format) { @@ -1196,7 +1196,7 @@ */ static inline void ClassDef_serialize (hb_serialize_context_t *c, - hb_array_t glyphs, + hb_array_t glyphs, hb_array_t klasses); struct ClassDefFormat1 @@ -1210,7 +1210,7 @@ } bool serialize (hb_serialize_context_t *c, - hb_array_t glyphs, + hb_array_t glyphs, hb_array_t klasses) { TRACE_SERIALIZE (this); @@ -1241,7 +1241,7 @@ TRACE_SUBSET (this); const hb_set_t &glyphset = *c->plan->glyphset (); const hb_map_t &glyph_map = *c->plan->glyph_map; - hb_sorted_vector_t glyphs; + hb_sorted_vector_t glyphs; hb_vector_t klasses; hb_codepoint_t start = startGlyph; @@ -1328,7 +1328,7 @@ protected: HBUINT16 classFormat; /* Format identifier--format = 1 */ - GlyphID startGlyph; /* First GlyphID of the classValueArray */ + HBGlyphID startGlyph; /* First GlyphID of the classValueArray */ ArrayOf classValue; /* Array of Class Values--one per GlyphID */ public: @@ -1346,7 +1346,7 @@ } bool serialize (hb_serialize_context_t *c, - hb_array_t glyphs, + hb_array_t glyphs, hb_array_t klasses) { TRACE_SERIALIZE (this); @@ -1390,7 +1390,7 @@ TRACE_SUBSET (this); const hb_set_t &glyphset = *c->plan->glyphset (); const hb_map_t &glyph_map = *c->plan->glyph_map; - hb_vector_t glyphs; + hb_vector_t glyphs; hb_vector_t klasses; unsigned int count = rangeRecord.len; @@ -1506,7 +1506,7 @@ } bool serialize (hb_serialize_context_t *c, - hb_array_t glyphs, + hb_array_t glyphs, hb_array_t klasses) { TRACE_SERIALIZE (this); @@ -1526,7 +1526,7 @@ num_ranges++; if (1 + (glyph_max - glyph_min + 1) < num_ranges * 3) - format = 1; + format = 1; } u.format = format; @@ -1611,7 +1611,7 @@ }; static inline void ClassDef_serialize (hb_serialize_context_t *c, - hb_array_t glyphs, + hb_array_t glyphs, hb_array_t klasses) { c->start_embed ()->serialize (c, glyphs, klasses); } @@ -1746,9 +1746,9 @@ } void get_scalars (int *coords, unsigned int coord_count, - const VarRegionList ®ions, - float *scalars /*OUT */, - unsigned int num_scalars) const + const VarRegionList ®ions, + float *scalars /*OUT */, + unsigned int num_scalars) const { unsigned count = hb_min (num_scalars, regionIndices.len); for (unsigned int i = 0; i < count; i++) @@ -1830,7 +1830,7 @@ #endif (this+dataSets[ivs]).get_scalars (coords, coord_count, this+regions, - &scalars[0], num_scalars); + &scalars[0], num_scalars); } protected: @@ -2057,6 +2057,8 @@ hb_position_t get_y_delta (hb_font_t *font) const { return get_delta (font->y_ppem, font->y_scale); } + public: + unsigned int get_size () const { unsigned int f = deltaFormat; @@ -2070,6 +2072,12 @@ return_trace (c->check_struct (this) && c->check_range (this, this->get_size ())); } + HintingDevice* copy (hb_serialize_context_t *c) const + { + TRACE_SERIALIZE (this); + return_trace (c->embed (this)); + } + private: int get_delta (unsigned int ppem, int scale) const @@ -2131,6 +2139,12 @@ hb_position_t get_y_delta (hb_font_t *font, const VariationStore &store) const { return font->em_scalef_y (get_delta (font, store)); } + VariationDevice* copy (hb_serialize_context_t *c) const + { + TRACE_SERIALIZE (this); + return_trace (c->embed (this)); + } + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); @@ -2216,6 +2230,25 @@ } } + Device* copy (hb_serialize_context_t *c) const + { + TRACE_SERIALIZE (this); + switch (u.b.format) { +#ifndef HB_NO_HINTING + case 1: + case 2: + case 3: + return_trace (reinterpret_cast (u.hinting.copy (c))); +#endif +#ifndef HB_NO_VAR + case 0x8000: + return_trace (reinterpret_cast (u.variation.copy (c))); +#endif + default: + return_trace (nullptr); + } + } + protected: union { DeviceHeader b; diff -Nru harfbuzz-2.5.3/src/hb-ot-layout-gdef-table.hh harfbuzz-2.6.2/src/hb-ot-layout-gdef-table.hh --- harfbuzz-2.5.3/src/hb-ot-layout-gdef-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-layout-gdef-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -149,8 +149,8 @@ const VariationStore &var_store) const { return HB_DIRECTION_IS_HORIZONTAL (direction) ? - font->em_scale_x (coordinate) + (this+deviceTable).get_x_delta (font, var_store) : - font->em_scale_y (coordinate) + (this+deviceTable).get_y_delta (font, var_store); + font->em_scale_x (coordinate) + (this+deviceTable).get_x_delta (font, var_store) : + font->em_scale_y (coordinate) + (this+deviceTable).get_y_delta (font, var_store); } bool sanitize (hb_sanitize_context_t *c) const diff -Nru harfbuzz-2.5.3/src/hb-ot-layout-gpos-table.hh harfbuzz-2.6.2/src/hb-ot-layout-gpos-table.hh --- harfbuzz-2.5.3/src/hb-ot-layout-gpos-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-layout-gpos-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -236,6 +236,11 @@ } }; +template +static inline void SinglePos_serialize (hb_serialize_context_t *c, + Iterator it, + ValueFormat valFormat); + struct AnchorFormat1 { @@ -252,6 +257,12 @@ TRACE_SANITIZE (this); return_trace (c->check_struct (this)); } + + AnchorFormat1* copy (hb_serialize_context_t *c) const + { + TRACE_SERIALIZE (this); + return_trace (c->embed (this)); + } protected: HBUINT16 format; /* Format identifier--format = 1 */ @@ -291,6 +302,12 @@ return_trace (c->check_struct (this)); } + AnchorFormat2* copy (hb_serialize_context_t *c) const + { + TRACE_SERIALIZE (this); + return_trace (c->embed (this)); + } + protected: HBUINT16 format; /* Format identifier--format = 2 */ FWORD xCoordinate; /* Horizontal value--in design units */ @@ -321,6 +338,17 @@ return_trace (c->check_struct (this) && xDeviceTable.sanitize (c, this) && yDeviceTable.sanitize (c, this)); } + AnchorFormat3* copy (hb_serialize_context_t *c) const + { + TRACE_SERIALIZE (this); + auto *out = c->embed (this); + if (unlikely (!out)) return_trace (nullptr); + + out->xDeviceTable.serialize_copy (c, xDeviceTable, this, out); + out->yDeviceTable.serialize_copy (c, yDeviceTable, this, out); + return_trace (out); + } + protected: HBUINT16 format; /* Format identifier--format = 3 */ FWORD xCoordinate; /* Horizontal value--in design units */ @@ -363,6 +391,17 @@ } } + Anchor* copy (hb_serialize_context_t *c) const + { + TRACE_SERIALIZE (this); + switch (u.format) { + case 1: return_trace (reinterpret_cast (u.format1.copy (c))); + case 2: return_trace (reinterpret_cast (u.format2.copy (c))); + case 3: return_trace (reinterpret_cast (u.format3.copy (c))); + default:return_trace (nullptr); + } + } + protected: union { HBUINT16 format; /* Format identifier */ @@ -496,11 +535,42 @@ return_trace (true); } + template + void serialize (hb_serialize_context_t *c, + Iterator it, + ValueFormat valFormat) + { + if (unlikely (!c->extend_min (*this))) return; + if (unlikely (!c->check_assign (valueFormat, valFormat))) return; + + for (const auto &_ : hb_second (*it)) + c->copy (_); + + auto glyphs = + + it + | hb_map_retains_sorting (hb_first) + ; + + coverage.serialize (c, this).serialize (c, glyphs); + } + bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); - // TODO(subset) - return_trace (false); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); + const hb_map_t &glyph_map = *c->plan->glyph_map; + + auto it = + + hb_iter (this+coverage) + | hb_filter (glyphset) + | hb_map_retains_sorting (glyph_map) + | hb_zip (hb_repeat (values.as_array (valueFormat.get_len ()))) + ; + + bool ret = bool (it); + SinglePos_serialize (c->serializer, it, valueFormat); + return_trace (ret); } bool sanitize (hb_sanitize_context_t *c) const @@ -552,11 +622,51 @@ return_trace (true); } + template + void serialize (hb_serialize_context_t *c, + Iterator it, + ValueFormat valFormat) + { + if (unlikely (!c->extend_min (*this))) return; + if (unlikely (!c->check_assign (valueFormat, valFormat))) return; + if (unlikely (!c->check_assign (valueCount, it.len ()))) return; + + for (const auto iter : it) + for (const auto &_ : iter.second) + c->copy (_); + + auto glyphs = + + it + | hb_map_retains_sorting (hb_first) + ; + + coverage.serialize (c, this).serialize (c, glyphs); + } + bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); - // TODO(subset) - return_trace (false); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); + const hb_map_t &glyph_map = *c->plan->glyph_map; + + unsigned sub_length = valueFormat.get_len (); + auto values_array = values.as_array (valueCount * sub_length); + + auto it = + + hb_zip (this+coverage, hb_range ((unsigned) valueCount)) + | hb_filter (glyphset, hb_first) + | hb_map_retains_sorting ([&] (const hb_pair_t& _) + { + return hb_pair (glyph_map[_.first], + values_array.sub_array (_.second * sub_length, + sub_length)); + }) + ; + + bool ret = bool (it); + SinglePos_serialize (c->serializer, it, valueFormat); + return_trace (ret); } bool sanitize (hb_sanitize_context_t *c) const @@ -583,6 +693,42 @@ struct SinglePos { + template + unsigned get_format (Iterator glyph_val_iter_pairs) + { + hb_array_t first_val_iter = hb_second (*glyph_val_iter_pairs); + + for (const auto iter : glyph_val_iter_pairs) + for (const auto _ : hb_zip (iter.second, first_val_iter)) + if (_.first != _.second) + return 2; + + return 1; + } + + + template + void serialize (hb_serialize_context_t *c, + Iterator glyph_val_iter_pairs, + ValueFormat valFormat) + { + if (unlikely (!c->extend_min (u.format))) return; + unsigned format = 2; + + if (glyph_val_iter_pairs) format = get_format (glyph_val_iter_pairs); + + u.format = format; + switch (u.format) { + case 1: u.format1.serialize (c, glyph_val_iter_pairs, valFormat); + return; + case 2: u.format2.serialize (c, glyph_val_iter_pairs, valFormat); + return; + default:return; + } + } + template typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const { @@ -603,13 +749,20 @@ } u; }; +template +static inline void +SinglePos_serialize (hb_serialize_context_t *c, + Iterator it, + ValueFormat valFormat) +{ c->start_embed ()->serialize (c, it, valFormat); } + struct PairValueRecord { friend struct PairSet; protected: - GlyphID secondGlyph; /* GlyphID of second glyph in the + HBGlyphID secondGlyph; /* GlyphID of second glyph in the * pair--first glyph is listed in the * Coverage table */ ValueRecord values; /* Positioning data for the first glyph @@ -733,7 +886,7 @@ + hb_zip (this+coverage, pairSet) | hb_filter (*glyphs, hb_first) | hb_map (hb_second) - | hb_map ([=] (const OffsetTo &_) + | hb_map ([glyphs, this] (const OffsetTo &_) { return (this+_).intersects (glyphs, valueFormat); }) | hb_any ; @@ -945,6 +1098,19 @@ return_trace (entryAnchor.sanitize (c, base) && exitAnchor.sanitize (c, base)); } + EntryExitRecord* copy (hb_serialize_context_t *c, + const void *src_base, + const void *dst_base) const + { + TRACE_SERIALIZE (this); + auto *out = c->embed (this); + if (unlikely (!out)) return_trace (nullptr); + + out->entryAnchor.serialize_copy (c, entryAnchor, src_base, dst_base); + out->exitAnchor.serialize_copy (c, exitAnchor, src_base, dst_base); + return_trace (out); + } + protected: OffsetTo entryAnchor; /* Offset to EntryAnchor table--from @@ -1072,11 +1238,47 @@ return_trace (true); } + template + void serialize (hb_serialize_context_t *c, + Iterator it, + const void *src_base) + { + if (unlikely (!c->extend_min ((*this)))) return; + this->format = 1; + this->entryExitRecord.len = it.len (); + + for (const EntryExitRecord& entry_record : + it + | hb_map (hb_second)) + c->copy (entry_record, src_base, this); + + auto glyphs = + + it + | hb_map_retains_sorting (hb_first) + ; + + coverage.serialize (c, this).serialize (c, glyphs); + } + bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); - // TODO(subset) - return_trace (false); + const hb_set_t &glyphset = *c->plan->glyphset (); + const hb_map_t &glyph_map = *c->plan->glyph_map; + + auto *out = c->serializer->start_embed (*this); + if (unlikely (!out)) return_trace (false); + + auto it = + + hb_zip (this+coverage, entryExitRecord) + | hb_filter (glyphset, hb_first) + | hb_map_retains_sorting ([&] (hb_pair_t p) -> hb_pair_t + { return hb_pair (glyph_map[p.first], p.second);}) + ; + + bool ret = bool (it); + out->serialize (c->serializer, it, this); + return_trace (ret); } bool sanitize (hb_sanitize_context_t *c) const @@ -1737,13 +1939,13 @@ /* Out-of-class implementation for methods recursing */ +#ifndef HB_NO_OT_LAYOUT template /*static*/ inline typename context_t::return_t PosLookup::dispatch_recurse_func (context_t *c, unsigned int lookup_index) { const PosLookup &l = c->face->table.GPOS.get_relaxed ()->table->get_lookup (lookup_index); return l.dispatch (c); } - /*static*/ inline bool PosLookup::apply_recurse_func (hb_ot_apply_context_t *c, unsigned int lookup_index) { const PosLookup &l = c->face->table.GPOS.get_relaxed ()->table->get_lookup (lookup_index); @@ -1756,6 +1958,7 @@ c->set_lookup_props (saved_lookup_props); return ret; } +#endif } /* namespace OT */ diff -Nru harfbuzz-2.5.3/src/hb-ot-layout-gsubgpos.hh harfbuzz-2.6.2/src/hb-ot-layout-gsubgpos.hh --- harfbuzz-2.5.3/src/hb-ot-layout-gsubgpos.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-layout-gsubgpos.hh 2019-10-26 02:02:55.000000000 +0000 @@ -483,7 +483,13 @@ iter_input (), iter_context (), font (font_), face (font->face), buffer (buffer_), recurse_func (nullptr), - gdef (*face->table.GDEF->table), + gdef ( +#ifndef HB_NO_OT_LAYOUT + *face->table.GDEF->table +#else + Null(GDEF) +#endif + ), var_store (gdef.get_var_store ()), direction (buffer_->props.direction), lookup_mask (1), diff -Nru harfbuzz-2.5.3/src/hb-ot-layout-gsub-table.hh harfbuzz-2.6.2/src/hb-ot-layout-gsub-table.hh --- harfbuzz-2.5.3/src/hb-ot-layout-gsub-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-layout-gsub-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -111,8 +111,11 @@ + hb_iter (this+coverage) | hb_filter (glyphset) | hb_map_retains_sorting ([&] (hb_codepoint_t g) { - return hb_codepoint_pair_t (glyph_map[g], - glyph_map[(g + delta) & 0xFFFF]); }) + return hb_codepoint_pair_t (g, + (g + delta) & 0xFFFF); }) + | hb_filter (glyphset, hb_second) + | hb_map_retains_sorting ([&] (hb_codepoint_pair_t p) -> hb_codepoint_pair_t + { return hb_pair (glyph_map[p.first], glyph_map[p.second]); }) ; bool ret = bool (it); @@ -208,7 +211,8 @@ auto it = + hb_zip (this+coverage, substitute) | hb_filter (glyphset, hb_first) - | hb_map_retains_sorting ([&] (hb_pair_t p) -> hb_codepoint_pair_t + | hb_filter (glyphset, hb_second) + | hb_map_retains_sorting ([&] (hb_pair_t p) -> hb_codepoint_pair_t { return hb_pair (glyph_map[p.first], glyph_map[p.second]); }) ; @@ -228,7 +232,7 @@ OffsetTo coverage; /* Offset to Coverage table--from * beginning of Substitution table */ - ArrayOf + ArrayOf substitute; /* Array of substitute * GlyphIDs--ordered by Coverage Index */ public: @@ -248,7 +252,7 @@ if (unlikely (!c->extend_min (u.format))) return_trace (false); unsigned format = 2; unsigned delta = 0; - if (glyphs.len ()) + if (glyphs) { format = 1; auto get_delta = [=] (hb_codepoint_pair_t _) { @@ -296,12 +300,11 @@ struct Sequence { + bool intersects (const hb_set_t *glyphs) const + { return hb_all (substitute, glyphs); } + void closure (hb_closure_context_t *c) const - { - unsigned int count = substitute.len; - for (unsigned int i = 0; i < count; i++) - c->output->add (substitute[i]); - } + { c->output->add_array (substitute.arrayZ, substitute.len); } void collect_glyphs (hb_collect_glyphs_context_t *c) const { c->output->add_array (substitute.arrayZ, substitute.len); } @@ -347,6 +350,23 @@ return_trace (substitute.serialize (c, subst)); } + bool subset (hb_subset_context_t *c) const + { + TRACE_SUBSET (this); + const hb_set_t &glyphset = *c->plan->glyphset (); + const hb_map_t &glyph_map = *c->plan->glyph_map; + + if (!intersects (&glyphset)) return_trace (false); + + auto it = + + hb_iter (substitute) + | hb_map (glyph_map) + ; + + auto *out = c->serializer->start_embed (*this); + return_trace (out->serialize (c->serializer, it)); + } + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); @@ -354,7 +374,7 @@ } protected: - ArrayOf + ArrayOf substitute; /* String of GlyphIDs to substitute */ public: DEFINE_SIZE_ARRAY (2, substitute); @@ -401,9 +421,9 @@ } bool serialize (hb_serialize_context_t *c, - hb_sorted_array_t glyphs, + hb_sorted_array_t glyphs, hb_array_t substitute_len_list, - hb_array_t substitute_glyphs_list) + hb_array_t substitute_glyphs_list) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (*this))) return_trace (false); @@ -422,8 +442,37 @@ bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); - // TODO(subset) - return_trace (false); + const hb_set_t &glyphset = *c->plan->glyphset (); + const hb_map_t &glyph_map = *c->plan->glyph_map; + + auto *out = c->serializer->start_embed (*this); + if (unlikely (!c->serializer->extend_min (out))) return_trace (false); + out->format = format; + + hb_sorted_vector_t new_coverage; + + hb_zip (this+coverage, sequence) + | hb_filter (glyphset, hb_first) + | hb_filter ([this, c, out] (const OffsetTo& _) + { + auto *o = out->sequence.serialize_append (c->serializer); + if (unlikely (!o)) return false; + auto snap = c->serializer->snapshot (); + bool ret = o->serialize_subset (c, _, this, out); + if (!ret) + { + out->sequence.pop (); + c->serializer->revert (snap); + } + return ret; + }, + hb_second) + | hb_map (hb_first) + | hb_map (glyph_map) + | hb_sink (new_coverage) + ; + out->coverage.serialize (c->serializer, out) + .serialize (c->serializer, new_coverage.iter ()); + return_trace (bool (new_coverage)); } bool sanitize (hb_sanitize_context_t *c) const @@ -447,9 +496,9 @@ struct MultipleSubst { bool serialize (hb_serialize_context_t *c, - hb_sorted_array_t glyphs, + hb_sorted_array_t glyphs, hb_array_t substitute_len_list, - hb_array_t substitute_glyphs_list) + hb_array_t substitute_glyphs_list) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (u.format))) return_trace (false); @@ -481,12 +530,11 @@ struct AlternateSet { + bool intersects (const hb_set_t *glyphs) const + { return hb_any (alternates, glyphs); } + void closure (hb_closure_context_t *c) const - { - unsigned int count = alternates.len; - for (unsigned int i = 0; i < count; i++) - c->output->add (alternates[i]); - } + { c->output->add_array (alternates.arrayZ, alternates.len); } void collect_glyphs (hb_collect_glyphs_context_t *c) const { c->output->add_array (alternates.arrayZ, alternates.len); } @@ -525,6 +573,23 @@ return_trace (alternates.serialize (c, alts)); } + bool subset (hb_subset_context_t *c) const + { + TRACE_SUBSET (this); + const hb_set_t &glyphset = *c->plan->glyphset (); + const hb_map_t &glyph_map = *c->plan->glyph_map; + + auto it = + + hb_iter (alternates) + | hb_filter (glyphset) + | hb_map (glyph_map) + ; + + auto *out = c->serializer->start_embed (*this); + return_trace (out->serialize (c->serializer, it) && + out->alternates); + } + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); @@ -532,7 +597,7 @@ } protected: - ArrayOf + ArrayOf alternates; /* Array of alternate GlyphIDs--in * arbitrary order */ public: @@ -579,9 +644,9 @@ } bool serialize (hb_serialize_context_t *c, - hb_sorted_array_t glyphs, + hb_sorted_array_t glyphs, hb_array_t alternate_len_list, - hb_array_t alternate_glyphs_list) + hb_array_t alternate_glyphs_list) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (*this))) return_trace (false); @@ -600,8 +665,37 @@ bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); - // TODO(subset) - return_trace (false); + const hb_set_t &glyphset = *c->plan->glyphset (); + const hb_map_t &glyph_map = *c->plan->glyph_map; + + auto *out = c->serializer->start_embed (*this); + if (unlikely (!c->serializer->extend_min (out))) return_trace (false); + out->format = format; + + hb_sorted_vector_t new_coverage; + + hb_zip (this+coverage, alternateSet) + | hb_filter (glyphset, hb_first) + | hb_filter ([this, c, out] (const OffsetTo& _) + { + auto *o = out->alternateSet.serialize_append (c->serializer); + if (unlikely (!o)) return false; + auto snap = c->serializer->snapshot (); + bool ret = o->serialize_subset (c, _, this, out); + if (!ret) + { + out->alternateSet.pop (); + c->serializer->revert (snap); + } + return ret; + }, + hb_second) + | hb_map (hb_first) + | hb_map (glyph_map) + | hb_sink (new_coverage) + ; + out->coverage.serialize (c->serializer, out) + .serialize (c->serializer, new_coverage.iter ()); + return_trace (bool (new_coverage)); } bool sanitize (hb_sanitize_context_t *c) const @@ -625,9 +719,9 @@ struct AlternateSubst { bool serialize (hb_serialize_context_t *c, - hb_sorted_array_t glyphs, + hb_sorted_array_t glyphs, hb_array_t alternate_len_list, - hb_array_t alternate_glyphs_list) + hb_array_t alternate_glyphs_list) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (u.format))) return_trace (false); @@ -661,13 +755,7 @@ struct Ligature { bool intersects (const hb_set_t *glyphs) const - { - unsigned int count = component.lenP1; - for (unsigned int i = 1; i < count; i++) - if (!glyphs->has (component[i])) - return false; - return true; - } + { return hb_all (component, glyphs); } void closure (hb_closure_context_t *c) const { @@ -677,7 +765,7 @@ void collect_glyphs (hb_collect_glyphs_context_t *c) const { - c->input->add_array (component.arrayZ, component.lenP1 ? component.lenP1 - 1 : 0); + c->input->add_array (component.arrayZ, component.get_length ()); c->output->add (ligGlyph); } @@ -735,7 +823,7 @@ template bool serialize (hb_serialize_context_t *c, - GlyphID ligature, + hb_codepoint_t ligature, Iterator components /* Starting from second */) { TRACE_SERIALIZE (this); @@ -745,6 +833,25 @@ return_trace (true); } + bool subset (hb_subset_context_t *c) const + { + TRACE_SUBSET (this); + const hb_set_t &glyphset = *c->plan->glyphset (); + const hb_map_t &glyph_map = *c->plan->glyph_map; + + if (!intersects (&glyphset) || !glyphset.has (ligGlyph)) return_trace (false); + + auto it = + + hb_iter (component) + | hb_map (glyph_map) + ; + + auto *out = c->serializer->start_embed (*this); + return_trace (out->serialize (c->serializer, + glyph_map[ligGlyph], + it)); + } + public: bool sanitize (hb_sanitize_context_t *c) const { @@ -753,8 +860,8 @@ } protected: - GlyphID ligGlyph; /* GlyphID of ligature to substitute */ - HeadlessArrayOf + HBGlyphID ligGlyph; /* GlyphID of ligature to substitute */ + HeadlessArrayOf component; /* Array of component GlyphIDs--start * with the second component--ordered * in writing direction */ @@ -814,9 +921,9 @@ } bool serialize (hb_serialize_context_t *c, - hb_array_t ligatures, + hb_array_t ligatures, hb_array_t component_count_list, - hb_array_t &component_list /* Starting from second for each ligature */) + hb_array_t &component_list /* Starting from second for each ligature */) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (*this))) return_trace (false); @@ -834,6 +941,31 @@ return_trace (true); } + bool subset (hb_subset_context_t *c) const + { + TRACE_SUBSET (this); + auto *out = c->serializer->start_embed (*this); + if (unlikely (!c->serializer->extend_min (out))) return_trace (false); + + + hb_iter (ligature) + | hb_filter ([this, c, out] (const OffsetTo& _) + { + auto *o = out->ligature.serialize_append (c->serializer); + if (unlikely (!o)) return false; + auto snap = c->serializer->snapshot (); + bool ret = o->serialize_subset (c, _, this, out); + if (!ret) + { + out->ligature.pop (); + c->serializer->revert (snap); + } + return ret; + }) + | hb_drain + ; + return_trace (bool (out->ligature)); + } + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); @@ -906,11 +1038,11 @@ } bool serialize (hb_serialize_context_t *c, - hb_sorted_array_t first_glyphs, + hb_sorted_array_t first_glyphs, hb_array_t ligature_per_first_glyph_count_list, - hb_array_t ligatures_list, + hb_array_t ligatures_list, hb_array_t component_count_list, - hb_array_t component_list /* Starting from second for each ligature */) + hb_array_t component_list /* Starting from second for each ligature */) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (*this))) return_trace (false); @@ -932,8 +1064,37 @@ bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); - // TODO(subset) - return_trace (false); + const hb_set_t &glyphset = *c->plan->glyphset (); + const hb_map_t &glyph_map = *c->plan->glyph_map; + + auto *out = c->serializer->start_embed (*this); + if (unlikely (!c->serializer->extend_min (out))) return_trace (false); + out->format = format; + + hb_sorted_vector_t new_coverage; + + hb_zip (this+coverage, ligatureSet) + | hb_filter (glyphset, hb_first) + | hb_filter ([this, c, out] (const OffsetTo& _) + { + auto *o = out->ligatureSet.serialize_append (c->serializer); + if (unlikely (!o)) return false; + auto snap = c->serializer->snapshot (); + bool ret = o->serialize_subset (c, _, this, out); + if (!ret) + { + out->ligatureSet.pop (); + c->serializer->revert (snap); + } + return ret; + }, + hb_second) + | hb_map (hb_first) + | hb_map (glyph_map) + | hb_sink (new_coverage) + ; + out->coverage.serialize (c->serializer, out) + .serialize (c->serializer, new_coverage.iter ()); + return_trace (bool (new_coverage)); } bool sanitize (hb_sanitize_context_t *c) const @@ -957,11 +1118,11 @@ struct LigatureSubst { bool serialize (hb_serialize_context_t *c, - hb_sorted_array_t first_glyphs, + hb_sorted_array_t first_glyphs, hb_array_t ligature_per_first_glyph_count_list, - hb_array_t ligatures_list, + hb_array_t ligatures_list, hb_array_t component_count_list, - hb_array_t component_list /* Starting from second for each ligature */) + hb_array_t component_list /* Starting from second for each ligature */) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (u.format))) return_trace (false); @@ -1038,7 +1199,7 @@ if (!intersects (c->glyphs)) return; const OffsetArrayOf &lookahead = StructAfter> (backtrack); - const ArrayOf &substitute = StructAfter> (lookahead); + const ArrayOf &substitute = StructAfter> (lookahead); + hb_zip (this+coverage, substitute) | hb_filter (*c->glyphs, hb_first) @@ -1062,7 +1223,7 @@ for (unsigned int i = 0; i < count; i++) if (unlikely (!(this+lookahead[i]).add_coverage (c->after))) return; - const ArrayOf &substitute = StructAfter> (lookahead); + const ArrayOf &substitute = StructAfter> (lookahead); count = substitute.len; c->output->add_array (substitute.arrayZ, substitute.len); } @@ -1082,7 +1243,7 @@ if (likely (index == NOT_COVERED)) return_trace (false); const OffsetArrayOf &lookahead = StructAfter> (backtrack); - const ArrayOf &substitute = StructAfter> (lookahead); + const ArrayOf &substitute = StructAfter> (lookahead); unsigned int start_index = 0, end_index = 0; if (match_backtrack (c, @@ -1120,7 +1281,7 @@ const OffsetArrayOf &lookahead = StructAfter> (backtrack); if (!lookahead.sanitize (c, this)) return_trace (false); - const ArrayOf &substitute = StructAfter> (lookahead); + const ArrayOf &substitute = StructAfter> (lookahead); return_trace (substitute.sanitize (c)); } @@ -1137,7 +1298,7 @@ lookaheadX; /* Array of coverage tables * in lookahead sequence, in glyph * sequence order */ - ArrayOf + ArrayOf substituteX; /* Array of substitute * GlyphIDs--ordered by Coverage Index */ public: @@ -1292,8 +1453,8 @@ bool serialize_single (hb_serialize_context_t *c, uint32_t lookup_props, - hb_sorted_array_t glyphs, - hb_array_t substitutes) + hb_sorted_array_t glyphs, + hb_array_t substitutes) { TRACE_SERIALIZE (this); if (unlikely (!Lookup::serialize (c, SubTable::Single, lookup_props, 1))) return_trace (false); @@ -1303,9 +1464,9 @@ bool serialize_multiple (hb_serialize_context_t *c, uint32_t lookup_props, - hb_sorted_array_t glyphs, + hb_sorted_array_t glyphs, hb_array_t substitute_len_list, - hb_array_t substitute_glyphs_list) + hb_array_t substitute_glyphs_list) { TRACE_SERIALIZE (this); if (unlikely (!Lookup::serialize (c, SubTable::Multiple, lookup_props, 1))) return_trace (false); @@ -1318,9 +1479,9 @@ bool serialize_alternate (hb_serialize_context_t *c, uint32_t lookup_props, - hb_sorted_array_t glyphs, + hb_sorted_array_t glyphs, hb_array_t alternate_len_list, - hb_array_t alternate_glyphs_list) + hb_array_t alternate_glyphs_list) { TRACE_SERIALIZE (this); if (unlikely (!Lookup::serialize (c, SubTable::Alternate, lookup_props, 1))) return_trace (false); @@ -1333,11 +1494,11 @@ bool serialize_ligature (hb_serialize_context_t *c, uint32_t lookup_props, - hb_sorted_array_t first_glyphs, + hb_sorted_array_t first_glyphs, hb_array_t ligature_per_first_glyph_count_list, - hb_array_t ligatures_list, + hb_array_t ligatures_list, hb_array_t component_count_list, - hb_array_t component_list /* Starting from second for each ligature */) + hb_array_t component_list /* Starting from second for each ligature */) { TRACE_SERIALIZE (this); if (unlikely (!Lookup::serialize (c, SubTable::Ligature, lookup_props, 1))) return_trace (false); @@ -1409,6 +1570,7 @@ /* Out-of-class implementation for methods recursing */ +#ifndef HB_NO_OT_LAYOUT /*static*/ inline bool ExtensionSubst::is_reverse () const { unsigned int type = get_type (); @@ -1416,14 +1578,12 @@ return CastR (get_subtable()).is_reverse (); return SubstLookup::lookup_type_is_reverse (type); } - template /*static*/ inline typename context_t::return_t SubstLookup::dispatch_recurse_func (context_t *c, unsigned int lookup_index) { const SubstLookup &l = c->face->table.GSUB.get_relaxed ()->table->get_lookup (lookup_index); return l.dispatch (c); } - /*static*/ inline bool SubstLookup::apply_recurse_func (hb_ot_apply_context_t *c, unsigned int lookup_index) { const SubstLookup &l = c->face->table.GSUB.get_relaxed ()->table->get_lookup (lookup_index); @@ -1436,6 +1596,8 @@ c->set_lookup_props (saved_lookup_props); return ret; } +#endif + } /* namespace OT */ diff -Nru harfbuzz-2.5.3/src/hb-ot-layout.h harfbuzz-2.6.2/src/hb-ot-layout.h --- harfbuzz-2.5.3/src/hb-ot-layout.h 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-layout.h 2019-10-26 02:02:55.000000000 +0000 @@ -249,11 +249,11 @@ HB_EXTERN void hb_ot_layout_collect_features (hb_face_t *face, - hb_tag_t table_tag, - const hb_tag_t *scripts, - const hb_tag_t *languages, - const hb_tag_t *features, - hb_set_t *feature_indexes /* OUT */); + hb_tag_t table_tag, + const hb_tag_t *scripts, + const hb_tag_t *languages, + const hb_tag_t *features, + hb_set_t *feature_indexes /* OUT */); HB_EXTERN void hb_ot_layout_collect_lookups (hb_face_t *face, @@ -333,14 +333,14 @@ HB_EXTERN void hb_ot_layout_lookup_substitute_closure (hb_face_t *face, - unsigned int lookup_index, - hb_set_t *glyphs + unsigned int lookup_index, + hb_set_t *glyphs /*TODO , hb_bool_t inclusive */); HB_EXTERN void hb_ot_layout_lookups_substitute_closure (hb_face_t *face, - const hb_set_t *lookups, - hb_set_t *glyphs); + const hb_set_t *lookups, + hb_set_t *glyphs); #ifdef HB_NOT_IMPLEMENTED @@ -402,6 +402,55 @@ unsigned int *char_count /* IN/OUT. May be NULL */, hb_codepoint_t *characters /* OUT. May be NULL */); +/* + * BASE + */ + +/** + * hb_ot_layout_baseline_tag_t: + * @HB_OT_LAYOUT_BASELINE_TAG_ROMAN: The baseline used by alphabetic scripts such as Latin, Cyrillic and Greek. + * In vertical writing mode, the alphabetic baseline for characters rotated 90 degrees clockwise. + * (This would not apply to alphabetic characters that remain upright in vertical writing mode, since these + * characters are not rotated.) + * @HB_OT_LAYOUT_BASELINE_TAG_HANGING: The hanging baseline. In horizontal direction, this is the horizontal + * line from which syllables seem, to hang in Tibetan and other similar scripts. In vertical writing mode, + * for Tibetan (or some other similar script) characters rotated 90 degrees clockwise. + * @HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_BOTTOM_OR_LEFT: Ideographic character face bottom or left edge, + * if the direction is horizontal or vertical, respectively. + * @HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_TOP_OR_RIGHT: Ideographic character face top or right edge, + * if the direction is horizontal or vertical, respectively. + * @HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_BOTTOM_OR_LEFT: Ideographic em-box bottom or left edge, + * if the direction is horizontal or vertical, respectively. + * @HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_TOP_OR_RIGHT: Ideographic em-box top or right edge baseline, + * if the direction is horizontal or vertical, respectively. + * @HB_OT_LAYOUT_BASELINE_TAG_MATH: The baseline about which mathematical characters are centered. + * In vertical writing mode when mathematical characters rotated 90 degrees clockwise, are centered. + * + * Baseline tags from https://docs.microsoft.com/en-us/typography/opentype/spec/baselinetags + * + * Since: 2.6.0 + */ +typedef enum { + HB_OT_LAYOUT_BASELINE_TAG_ROMAN = HB_TAG ('r','o','m','n'), + HB_OT_LAYOUT_BASELINE_TAG_HANGING = HB_TAG ('h','a','n','g'), + HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_BOTTOM_OR_LEFT = HB_TAG ('i','c','f','b'), + HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_TOP_OR_RIGHT = HB_TAG ('i','c','f','t'), + HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_BOTTOM_OR_LEFT = HB_TAG ('i','d','e','o'), + HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_TOP_OR_RIGHT = HB_TAG ('i','d','t','p'), + HB_OT_LAYOUT_BASELINE_TAG_MATH = HB_TAG ('m','a','t','h'), + + _HB_OT_LAYOUT_BASELINE_TAG_MAX_VALUE = HB_TAG_MAX_SIGNED /*< skip >*/ +} hb_ot_layout_baseline_tag_t; + +HB_EXTERN hb_bool_t +hb_ot_layout_get_baseline (hb_font_t *font, + hb_ot_layout_baseline_tag_t baseline_tag, + hb_direction_t direction, + hb_tag_t script_tag, + hb_tag_t language_tag, + hb_position_t *coord /* OUT. May be NULL. */); + + HB_END_DECLS #endif /* HB_OT_LAYOUT_H */ diff -Nru harfbuzz-2.5.3/src/hb-ot-layout.hh harfbuzz-2.6.2/src/hb-ot-layout.hh --- harfbuzz-2.5.3/src/hb-ot-layout.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-layout.hh 2019-10-26 02:02:55.000000000 +0000 @@ -168,6 +168,17 @@ return start; } +static inline void +_hb_clear_syllables (const hb_ot_shape_plan_t *plan HB_UNUSED, + hb_font_t *font HB_UNUSED, + hb_buffer_t *buffer) +{ + hb_glyph_info_t *info = buffer->info; + unsigned int count = buffer->len; + for (unsigned int i = 0; i < count; i++) + info[i].syllable() = 0; +} + /* unicode_props */ @@ -551,6 +562,17 @@ info->glyph_props() &= ~(HB_OT_LAYOUT_GLYPH_PROPS_SUBSTITUTED); } +static inline void +_hb_clear_substitution_flags (const hb_ot_shape_plan_t *plan HB_UNUSED, + hb_font_t *font HB_UNUSED, + hb_buffer_t *buffer) +{ + hb_glyph_info_t *info = buffer->info; + unsigned int count = buffer->len; + for (unsigned int i = 0; i < count; i++) + _hb_glyph_info_clear_substituted (&info[i]); +} + /* Allocation / deallocation. */ diff -Nru harfbuzz-2.5.3/src/hb-ot-layout-jstf-table.hh harfbuzz-2.6.2/src/hb-ot-layout-jstf-table.hh --- harfbuzz-2.5.3/src/hb-ot-layout-jstf-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-layout-jstf-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -136,7 +136,7 @@ * ExtenderGlyphs -- Extender Glyph Table */ -typedef SortedArrayOf ExtenderGlyphs; +typedef SortedArrayOf ExtenderGlyphs; /* diff -Nru harfbuzz-2.5.3/src/hb-ot-map.cc harfbuzz-2.6.2/src/hb-ot-map.cc --- harfbuzz-2.5.3/src/hb-ot-map.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-map.cc 2019-10-26 02:02:55.000000000 +0000 @@ -26,6 +26,10 @@ * Google Author(s): Behdad Esfahbod */ +#include "hb.hh" + +#ifndef HB_NO_OT_SHAPE + #include "hb-ot-map.hh" #include "hb-ot-shape.hh" #include "hb-ot-layout.hh" @@ -187,7 +191,8 @@ feature_infos[j].max_value = feature_infos[i].max_value; feature_infos[j].default_value = feature_infos[i].default_value; } else { - feature_infos[j].flags &= ~F_GLOBAL; + if (feature_infos[j].flags & F_GLOBAL) + feature_infos[j].flags ^= F_GLOBAL; feature_infos[j].max_value = hb_max (feature_infos[j].max_value, feature_infos[i].max_value); /* Inherit default_value from j */ } @@ -293,7 +298,7 @@ global_bit_mask); for (unsigned i = 0; i < m.features.length; i++) - if (m.features[i].stage[table_index] == stage) + if (m.features[i].stage[table_index] == stage) add_lookups (m, table_index, m.features[i].index[table_index], key.variations_index[table_index], @@ -332,3 +337,6 @@ } } } + + +#endif diff -Nru harfbuzz-2.5.3/src/hb-ot-map.hh harfbuzz-2.6.2/src/hb-ot-map.hh --- harfbuzz-2.5.3/src/hb-ot-map.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-map.hh 2019-10-26 02:02:55.000000000 +0000 @@ -154,8 +154,8 @@ HB_INTERNAL void collect_lookups (unsigned int table_index, hb_set_t *lookups) const; template - HB_INTERNAL inline void apply (const Proxy &proxy, - const struct hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) const; + HB_INTERNAL void apply (const Proxy &proxy, + const struct hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) const; HB_INTERNAL void substitute (const struct hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) const; HB_INTERNAL void position (const struct hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) const; diff -Nru harfbuzz-2.5.3/src/hb-ot-math.h harfbuzz-2.6.2/src/hb-ot-math.h --- harfbuzz-2.5.3/src/hb-ot-math.h 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-math.h 2019-10-26 02:02:55.000000000 +0000 @@ -158,7 +158,7 @@ * hb_ot_math_glyph_part_t: * @glyph: The glyph index of the variant part * @start_connector_length: The length of the connector on the starting side of the variant part - * @end_connection_length: The length of the connector on the ending side of the variant part + * @end_connector_length: The length of the connector on the ending side of the variant part * @full_advance: The total advance of the part * @flags: #hb_ot_math_glyph_part_flags_t flags for the part * diff -Nru harfbuzz-2.5.3/src/hb-ot-math-table.hh harfbuzz-2.6.2/src/hb-ot-math-table.hh --- harfbuzz-2.5.3/src/hb-ot-math-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-math-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -423,7 +423,7 @@ } protected: - GlyphID variantGlyph; /* Glyph ID for the variant. */ + HBGlyphID variantGlyph; /* Glyph ID for the variant. */ HBUINT16 advanceMeasurement; /* Advance width/height, in design units, of the * variant, in the direction of requested * glyph extension. */ @@ -453,14 +453,14 @@ } void extract (hb_ot_math_glyph_part_t &out, - int scale, + int64_t mult, hb_font_t *font) const { out.glyph = glyph; - out.start_connector_length = font->em_scale (startConnectorLength, scale); - out.end_connector_length = font->em_scale (endConnectorLength, scale); - out.full_advance = font->em_scale (fullAdvance, scale); + out.start_connector_length = font->em_mult (startConnectorLength, mult); + out.end_connector_length = font->em_mult (endConnectorLength, mult); + out.full_advance = font->em_mult (fullAdvance, mult); static_assert ((unsigned int) HB_OT_MATH_GLYPH_PART_FLAG_EXTENDER == (unsigned int) PartFlags::Extender, ""); @@ -471,7 +471,7 @@ } protected: - GlyphID glyph; /* Glyph ID for the part. */ + HBGlyphID glyph; /* Glyph ID for the part. */ HBUINT16 startConnectorLength; /* Advance width/ height of the straight bar * connector material, in design units, is at * the beginning of the glyph, in the @@ -508,11 +508,11 @@ { if (parts_count) { - int scale = font->dir_scale (direction); + int64_t mult = font->dir_mult (direction); hb_array_t arr = partRecords.sub_array (start_offset, parts_count); unsigned int count = arr.length; for (unsigned int i = 0; i < count; i++) - arr[i].extract (parts[i], scale, font); + arr[i].extract (parts[i], mult, font); } if (italics_correction) @@ -553,13 +553,13 @@ { if (variants_count) { - int scale = font->dir_scale (direction); + int64_t mult = font->dir_mult (direction); hb_array_t arr = mathGlyphVariantRecord.sub_array (start_offset, variants_count); unsigned int count = arr.length; for (unsigned int i = 0; i < count; i++) { variants[i].glyph = arr[i].variantGlyph; - variants[i].advance = font->em_scale (arr[i].advanceMeasurement, scale); + variants[i].advance = font->em_mult (arr[i].advanceMeasurement, mult); } } return mathGlyphVariantRecord.len; diff -Nru harfbuzz-2.5.3/src/hb-ot-maxp-table.hh harfbuzz-2.6.2/src/hb-ot-maxp-table.hh --- harfbuzz-2.5.3/src/hb-ot-maxp-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-maxp-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -108,7 +108,7 @@ if (unlikely (!dest_v1)) return_trace (false); if (c->plan->drop_hints) - drop_hint_fields (dest_v1); + drop_hint_fields (dest_v1); } return_trace (true); @@ -129,7 +129,7 @@ FixedVersion<>version; /* Version of the maxp table (0.5 or 1.0), * 0x00005000u or 0x00010000u. */ HBUINT16 numGlyphs; /* The number of glyphs in the font. */ -/*maxpV1Tail v1Tail[VAR]; */ +/*maxpV1Tail v1Tail[HB_VAR_ARRAY]; */ public: DEFINE_SIZE_STATIC (6); }; diff -Nru harfbuzz-2.5.3/src/hb-ot-meta.cc harfbuzz-2.6.2/src/hb-ot-meta.cc --- harfbuzz-2.5.3/src/hb-ot-meta.cc 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-meta.cc 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,77 @@ +/* + * Copyright © 2019 Ebrahim Byagowi + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#include "hb.hh" + +#ifndef HB_NO_META + +#include "hb-ot-meta-table.hh" + +/** + * SECTION:hb-ot-meta + * @title: hb-ot-meta + * @short_description: OpenType Metadata + * @include: hb-ot.h + * + * Functions for fetching metadata from fonts. + **/ + +/** + * hb_ot_meta_reference_entry: + * @face: a face object + * @start_offset: iteration's start offset + * @entries_count:(inout) (allow-none): buffer size as input, filled size as output + * @entries: (out caller-allocates) (array length=entries_count): entries tags buffer + * + * Return value: Number of all available feature types. + * + * Since: 2.6.0 + **/ +unsigned int +hb_ot_meta_get_entry_tags (hb_face_t *face, + unsigned int start_offset, + unsigned int *entries_count, /* IN/OUT. May be NULL. */ + hb_ot_meta_tag_t *entries /* OUT. May be NULL. */) +{ + return face->table.meta->get_entries (start_offset, entries_count, entries); +} + +/** + * hb_ot_meta_reference_entry: + * @face: a #hb_face_t object. + * @meta_tag: tag of metadata you like to have. + * + * It fetches metadata entry of a given tag from a font. + * + * Returns: (transfer full): A blob containing the blob. + * + * Since: 2.6.0 + **/ +hb_blob_t * +hb_ot_meta_reference_entry (hb_face_t *face, hb_ot_meta_tag_t meta_tag) +{ + return face->table.meta->reference_entry (meta_tag); +} + +#endif diff -Nru harfbuzz-2.5.3/src/hb-ot-meta.h harfbuzz-2.6.2/src/hb-ot-meta.h --- harfbuzz-2.5.3/src/hb-ot-meta.h 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-meta.h 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,71 @@ +/* + * Copyright © 2019 Ebrahim Byagowi + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#ifndef HB_OT_H_IN +#error "Include instead." +#endif + +#ifndef HB_OT_META_H +#define HB_OT_META_H + +#include "hb.h" + +HB_BEGIN_DECLS + +/** + * hb_ot_meta_tag_t: + * @HB_OT_META_TAG_DESIGN_LANGUAGES: Design languages. Text, using only + * Basic Latin (ASCII) characters. Indicates languages and/or scripts + * for the user audiences that the font was primarily designed for. + * @HB_OT_META_TAG_SUPPORTED_LANGUAGES: Supported languages. Text, using + * only Basic Latin (ASCII) characters. Indicates languages and/or scripts + * that the font is declared to be capable of supporting. + * + * Known metadata tags from https://docs.microsoft.com/en-us/typography/opentype/spec/meta + * + * Since: 2.6.0 + **/ +typedef enum { +/* + HB_OT_META_TAG_APPL = HB_TAG ('a','p','p','l'), + HB_OT_META_TAG_BILD = HB_TAG ('b','i','l','d'), +*/ + HB_OT_META_TAG_DESIGN_LANGUAGES = HB_TAG ('d','l','n','g'), + HB_OT_META_TAG_SUPPORTED_LANGUAGES = HB_TAG ('s','l','n','g'), + + _HB_OT_META_TAG_MAX_VALUE = HB_TAG_MAX_SIGNED /*< skip >*/ +} hb_ot_meta_tag_t; + +HB_EXTERN unsigned int +hb_ot_meta_get_entry_tags (hb_face_t *face, + unsigned int start_offset, + unsigned int *entries_count, /* IN/OUT. May be NULL. */ + hb_ot_meta_tag_t *entries /* OUT. May be NULL. */); + +HB_EXTERN hb_blob_t * +hb_ot_meta_reference_entry (hb_face_t *face, hb_ot_meta_tag_t meta_tag); + +HB_END_DECLS + +#endif /* HB_OT_META_H */ diff -Nru harfbuzz-2.5.3/src/hb-ot-meta-table.hh harfbuzz-2.6.2/src/hb-ot-meta-table.hh --- harfbuzz-2.5.3/src/hb-ot-meta-table.hh 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-meta-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,126 @@ +/* + * Copyright © 2019 Ebrahim Byagowi + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#ifndef HB_OT_META_TABLE_HH +#define HB_OT_META_TABLE_HH + +#include "hb-open-type.hh" + +/* + * meta -- Metadata Table + * https://docs.microsoft.com/en-us/typography/opentype/spec/meta + * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6meta.html + */ +#define HB_OT_TAG_meta HB_TAG ('m','e','t','a') + + +namespace OT { + + +struct DataMap +{ + int cmp (hb_tag_t a) const { return tag.cmp (a); } + + hb_tag_t get_tag () const { return tag; } + + hb_blob_t *reference_entry (hb_blob_t *meta_blob) const + { return hb_blob_create_sub_blob (meta_blob, dataZ, dataLength); } + + bool sanitize (hb_sanitize_context_t *c, const void *base) const + { + TRACE_SANITIZE (this); + return_trace (likely (c->check_struct (this) && + dataZ.sanitize (c, base, dataLength))); + } + + protected: + Tag tag; /* A tag indicating the type of metadata. */ + LOffsetTo> + dataZ; /* Offset in bytes from the beginning of the + * metadata table to the data for this tag. */ + HBUINT32 dataLength; /* Length of the data. The data is not required to + * be padded to any byte boundary. */ + public: + DEFINE_SIZE_STATIC (12); +}; + +struct meta +{ + static constexpr hb_tag_t tableTag = HB_OT_TAG_meta; + + struct accelerator_t + { + void init (hb_face_t *face) + { table = hb_sanitize_context_t ().reference_table (face); } + void fini () { table.destroy (); } + + hb_blob_t *reference_entry (hb_tag_t tag) const + { return table->dataMaps.lsearch (tag).reference_entry (table.get_blob ()); } + + unsigned int get_entries (unsigned int start_offset, + unsigned int *count, + hb_ot_meta_tag_t *entries) const + { + if (count) + { + + table->dataMaps.sub_array (start_offset, count) + | hb_map (&DataMap::get_tag) + | hb_map ([](hb_tag_t tag) { return (hb_ot_meta_tag_t) tag; }) + | hb_sink (hb_array (entries, *count)) + ; + } + return table->dataMaps.len; + } + + private: + hb_blob_ptr_t table; + }; + + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (likely (c->check_struct (this) && + version == 1 && + dataMaps.sanitize (c, this))); + } + + protected: + HBUINT32 version; /* Version number of the metadata table — set to 1. */ + HBUINT32 flags; /* Flags — currently unused; set to 0. */ + HBUINT32 dataOffset; /* Per Apple specification: + * Offset from the beginning of the table to the data. + * Per OT specification: + * Reserved. Not used; should be set to 0. */ + LArrayOf + dataMaps; /* Array of data map records. */ + public: + DEFINE_SIZE_ARRAY (16, dataMaps); +}; + +struct meta_accelerator_t : meta::accelerator_t {}; + +} /* namespace OT */ + + +#endif /* HB_OT_META_TABLE_HH */ diff -Nru harfbuzz-2.5.3/src/hb-ot-metrics.cc harfbuzz-2.6.2/src/hb-ot-metrics.cc --- harfbuzz-2.5.3/src/hb-ot-metrics.cc 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-metrics.cc 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,231 @@ +/* + * Copyright © 2018-2019 Ebrahim Byagowi + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#include "hb.hh" + +#include "hb-ot-var-mvar-table.hh" +#include "hb-ot-gasp-table.hh" // Just so we compile it; unused otherwise. +#include "hb-ot-os2-table.hh" +#include "hb-ot-post-table.hh" +#include "hb-ot-hhea-table.hh" +#include "hb-ot-metrics.hh" +#include "hb-ot-face.hh" + + +static float +_fix_ascender_descender (float value, hb_ot_metrics_tag_t metrics_tag) +{ + if (metrics_tag == HB_OT_METRICS_TAG_HORIZONTAL_ASCENDER || + metrics_tag == HB_OT_METRICS_TAG_VERTICAL_ASCENDER) + return fabs ((double) value); + if (metrics_tag == HB_OT_METRICS_TAG_HORIZONTAL_DESCENDER || + metrics_tag == HB_OT_METRICS_TAG_VERTICAL_DESCENDER) + return -fabs ((double) value); + return value; +} + +/* The common part of _get_position logic needed on hb-ot-font and here + to be able to have slim builds without the not always needed parts */ +bool +_hb_ot_metrics_get_position_common (hb_font_t *font, + hb_ot_metrics_tag_t metrics_tag, + hb_position_t *position /* OUT. May be NULL. */) +{ + hb_face_t *face = font->face; + switch ((unsigned) metrics_tag) + { +#ifndef HB_NO_VAR +#define GET_VAR face->table.MVAR->get_var (metrics_tag, font->coords, font->num_coords) +#else +#define GET_VAR .0f +#endif +#define GET_METRIC_X(TABLE, ATTR) \ + (face->table.TABLE->has_data () && \ + (position && (*position = font->em_scalef_x (_fix_ascender_descender ( \ + face->table.TABLE->ATTR + GET_VAR, metrics_tag))), true)) +#define GET_METRIC_Y(TABLE, ATTR) \ + (face->table.TABLE->has_data () && \ + (position && (*position = font->em_scalef_y (_fix_ascender_descender ( \ + face->table.TABLE->ATTR + GET_VAR, metrics_tag))), true)) + case HB_OT_METRICS_TAG_HORIZONTAL_ASCENDER: + return (face->table.OS2->use_typo_metrics () && GET_METRIC_Y (OS2, sTypoAscender)) || + GET_METRIC_Y (hhea, ascender); + case HB_OT_METRICS_TAG_HORIZONTAL_DESCENDER: + return (face->table.OS2->use_typo_metrics () && GET_METRIC_Y (OS2, sTypoDescender)) || + GET_METRIC_Y (hhea, descender); + case HB_OT_METRICS_TAG_HORIZONTAL_LINE_GAP: + return (face->table.OS2->use_typo_metrics () && GET_METRIC_Y (OS2, sTypoLineGap)) || + GET_METRIC_Y (hhea, lineGap); + case HB_OT_METRICS_TAG_VERTICAL_ASCENDER: return GET_METRIC_X (vhea, ascender); + case HB_OT_METRICS_TAG_VERTICAL_DESCENDER: return GET_METRIC_X (vhea, descender); + case HB_OT_METRICS_TAG_VERTICAL_LINE_GAP: return GET_METRIC_X (vhea, lineGap); +#undef GET_METRIC_Y +#undef GET_METRIC_X +#undef GET_VAR + default: assert (0); return false; + } +} + +#ifndef HB_NO_METRICS + +#if 0 +static bool +_get_gasp (hb_face_t *face, float *result, hb_ot_metrics_tag_t metrics_tag) +{ + const OT::GaspRange& range = face->table.gasp->get_gasp_range (metrics_tag - HB_TAG ('g','s','p','0')); + if (&range == &Null (OT::GaspRange)) return false; + if (result) *result = range.rangeMaxPPEM + font->face->table.MVAR->get_var (metrics_tag, font->coords, font->num_coords); + return true; +} +#endif + +/* Private tags for https://github.com/harfbuzz/harfbuzz/issues/1866 */ +#define _HB_OT_METRICS_TAG_HORIZONTAL_ASCENDER_OS2 HB_TAG ('O','a','s','c') +#define _HB_OT_METRICS_TAG_HORIZONTAL_ASCENDER_HHEA HB_TAG ('H','a','s','c') +#define _HB_OT_METRICS_TAG_HORIZONTAL_DESCENDER_OS2 HB_TAG ('O','d','s','c') +#define _HB_OT_METRICS_TAG_HORIZONTAL_DESCENDER_HHEA HB_TAG ('H','d','s','c') +#define _HB_OT_METRICS_TAG_HORIZONTAL_LINE_GAP_OS2 HB_TAG ('O','l','g','p') +#define _HB_OT_METRICS_TAG_HORIZONTAL_LINE_GAP_HHEA HB_TAG ('H','l','g','p') + +/** + * hb_ot_metrics_get_position: + * @font: a #hb_font_t object. + * @metrics_tag: tag of metrics value you like to fetch. + * @position: (out) (optional): result of metrics value from the font. + * + * It fetches metrics value corresponding to a given tag from a font. + * + * Returns: Whether found the requested metrics in the font. + * Since: 2.6.0 + **/ +hb_bool_t +hb_ot_metrics_get_position (hb_font_t *font, + hb_ot_metrics_tag_t metrics_tag, + hb_position_t *position /* OUT. May be NULL. */) +{ + hb_face_t *face = font->face; + switch ((unsigned) metrics_tag) + { + case HB_OT_METRICS_TAG_HORIZONTAL_ASCENDER: + case HB_OT_METRICS_TAG_HORIZONTAL_DESCENDER: + case HB_OT_METRICS_TAG_HORIZONTAL_LINE_GAP: + case HB_OT_METRICS_TAG_VERTICAL_ASCENDER: + case HB_OT_METRICS_TAG_VERTICAL_DESCENDER: + case HB_OT_METRICS_TAG_VERTICAL_LINE_GAP: return _hb_ot_metrics_get_position_common (font, metrics_tag, position); +#ifndef HB_NO_VAR +#define GET_VAR hb_ot_metrics_get_variation (font, metrics_tag) +#else +#define GET_VAR 0 +#endif +#define GET_METRIC_X(TABLE, ATTR) \ + (face->table.TABLE->has_data () && \ + (position && (*position = font->em_scalef_x (face->table.TABLE->ATTR + GET_VAR)), true)) +#define GET_METRIC_Y(TABLE, ATTR) \ + (face->table.TABLE->has_data () && \ + (position && (*position = font->em_scalef_y (face->table.TABLE->ATTR + GET_VAR)), true)) + case HB_OT_METRICS_TAG_HORIZONTAL_CLIPPING_ASCENT: return GET_METRIC_Y (OS2, usWinAscent); + case HB_OT_METRICS_TAG_HORIZONTAL_CLIPPING_DESCENT: return GET_METRIC_Y (OS2, usWinDescent); + case HB_OT_METRICS_TAG_HORIZONTAL_CARET_RISE: return GET_METRIC_Y (hhea, caretSlopeRise); + case HB_OT_METRICS_TAG_HORIZONTAL_CARET_RUN: return GET_METRIC_X (hhea, caretSlopeRun); + case HB_OT_METRICS_TAG_HORIZONTAL_CARET_OFFSET: return GET_METRIC_X (hhea, caretOffset); + case HB_OT_METRICS_TAG_VERTICAL_CARET_RISE: return GET_METRIC_X (vhea, caretSlopeRise); + case HB_OT_METRICS_TAG_VERTICAL_CARET_RUN: return GET_METRIC_Y (vhea, caretSlopeRun); + case HB_OT_METRICS_TAG_VERTICAL_CARET_OFFSET: return GET_METRIC_Y (vhea, caretOffset); + case HB_OT_METRICS_TAG_X_HEIGHT: return GET_METRIC_Y (OS2->v2 (), sxHeight); + case HB_OT_METRICS_TAG_CAP_HEIGHT: return GET_METRIC_Y (OS2->v2 (), sCapHeight); + case HB_OT_METRICS_TAG_SUBSCRIPT_EM_X_SIZE: return GET_METRIC_X (OS2, ySubscriptXSize); + case HB_OT_METRICS_TAG_SUBSCRIPT_EM_Y_SIZE: return GET_METRIC_Y (OS2, ySubscriptYSize); + case HB_OT_METRICS_TAG_SUBSCRIPT_EM_X_OFFSET: return GET_METRIC_X (OS2, ySubscriptXOffset); + case HB_OT_METRICS_TAG_SUBSCRIPT_EM_Y_OFFSET: return GET_METRIC_Y (OS2, ySubscriptYOffset); + case HB_OT_METRICS_TAG_SUPERSCRIPT_EM_X_SIZE: return GET_METRIC_X (OS2, ySuperscriptXSize); + case HB_OT_METRICS_TAG_SUPERSCRIPT_EM_Y_SIZE: return GET_METRIC_Y (OS2, ySuperscriptYSize); + case HB_OT_METRICS_TAG_SUPERSCRIPT_EM_X_OFFSET: return GET_METRIC_X (OS2, ySuperscriptXOffset); + case HB_OT_METRICS_TAG_SUPERSCRIPT_EM_Y_OFFSET: return GET_METRIC_Y (OS2, ySuperscriptYOffset); + case HB_OT_METRICS_TAG_STRIKEOUT_SIZE: return GET_METRIC_Y (OS2, yStrikeoutSize); + case HB_OT_METRICS_TAG_STRIKEOUT_OFFSET: return GET_METRIC_Y (OS2, yStrikeoutPosition); + case HB_OT_METRICS_TAG_UNDERLINE_SIZE: return GET_METRIC_Y (post->table, underlineThickness); + case HB_OT_METRICS_TAG_UNDERLINE_OFFSET: return GET_METRIC_Y (post->table, underlinePosition); + + /* Private tags */ + case _HB_OT_METRICS_TAG_HORIZONTAL_ASCENDER_OS2: return GET_METRIC_Y (OS2, sTypoAscender); + case _HB_OT_METRICS_TAG_HORIZONTAL_ASCENDER_HHEA: return GET_METRIC_Y (hhea, ascender); + case _HB_OT_METRICS_TAG_HORIZONTAL_DESCENDER_OS2: return GET_METRIC_Y (OS2, sTypoDescender); + case _HB_OT_METRICS_TAG_HORIZONTAL_DESCENDER_HHEA: return GET_METRIC_Y (hhea, descender); + case _HB_OT_METRICS_TAG_HORIZONTAL_LINE_GAP_OS2: return GET_METRIC_Y (OS2, sTypoLineGap); + case _HB_OT_METRICS_TAG_HORIZONTAL_LINE_GAP_HHEA: return GET_METRIC_Y (hhea, lineGap); +#undef GET_METRIC_Y +#undef GET_METRIC_X +#undef GET_VAR + default: return false; + } +} + +#ifndef HB_NO_VAR +/** + * hb_ot_metrics_get_variation: + * @font: + * @metrics_tag: + * + * Returns: + * + * Since: 2.6.0 + **/ +float +hb_ot_metrics_get_variation (hb_font_t *font, hb_ot_metrics_tag_t metrics_tag) +{ + return font->face->table.MVAR->get_var (metrics_tag, font->coords, font->num_coords); +} + +/** + * hb_ot_metrics_get_x_variation: + * @font: + * @metrics_tag: + * + * Returns: + * + * Since: 2.6.0 + **/ +hb_position_t +hb_ot_metrics_get_x_variation (hb_font_t *font, hb_ot_metrics_tag_t metrics_tag) +{ + return font->em_scalef_x (hb_ot_metrics_get_variation (font, metrics_tag)); +} + +/** + * hb_ot_metrics_get_y_variation: + * @font: + * @metrics_tag: + * + * Returns: + * + * Since: 2.6.0 + **/ +hb_position_t +hb_ot_metrics_get_y_variation (hb_font_t *font, hb_ot_metrics_tag_t metrics_tag) +{ + return font->em_scalef_y (hb_ot_metrics_get_variation (font, metrics_tag)); +} +#endif + +#endif diff -Nru harfbuzz-2.5.3/src/hb-ot-metrics.h harfbuzz-2.6.2/src/hb-ot-metrics.h --- harfbuzz-2.5.3/src/hb-ot-metrics.h 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-metrics.h 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,122 @@ +/* + * Copyright © 2018 Ebrahim Byagowi + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#ifndef HB_OT_H_IN +#error "Include instead." +#endif + +#ifndef HB_OT_METRICS_H +#define HB_OT_METRICS_H + +#include "hb.h" +#include "hb-ot-name.h" + +HB_BEGIN_DECLS + + +/** + * hb_ot_metrics_tag_t: + * @HB_OT_METRICS_TAG_HORIZONTAL_ASCENDER: horizontal ascender. + * @HB_OT_METRICS_TAG_HORIZONTAL_DESCENDER: horizontal descender. + * @HB_OT_METRICS_TAG_HORIZONTAL_LINE_GAP: horizontal line gap. + * @HB_OT_METRICS_TAG_HORIZONTAL_CLIPPING_ASCENT: horizontal clipping ascent. + * @HB_OT_METRICS_TAG_HORIZONTAL_CLIPPING_DESCENT: horizontal clipping descent. + * @HB_OT_METRICS_TAG_VERTICAL_ASCENDER: vertical ascender. + * @HB_OT_METRICS_TAG_VERTICAL_DESCENDER: vertical descender. + * @HB_OT_METRICS_TAG_VERTICAL_LINE_GAP: vertical line gap. + * @HB_OT_METRICS_TAG_HORIZONTAL_CARET_RISE: horizontal caret rise. + * @HB_OT_METRICS_TAG_HORIZONTAL_CARET_RUN: horizontal caret run. + * @HB_OT_METRICS_TAG_HORIZONTAL_CARET_OFFSET: horizontal caret offset. + * @HB_OT_METRICS_TAG_VERTICAL_CARET_RISE: vertical caret rise. + * @HB_OT_METRICS_TAG_VERTICAL_CARET_RUN: vertical caret run. + * @HB_OT_METRICS_TAG_VERTICAL_CARET_OFFSET: vertical caret offset. + * @HB_OT_METRICS_TAG_X_HEIGHT: x height. + * @HB_OT_METRICS_TAG_CAP_HEIGHT: cap height. + * @HB_OT_METRICS_TAG_SUBSCRIPT_EM_X_SIZE: subscript em x size. + * @HB_OT_METRICS_TAG_SUBSCRIPT_EM_Y_SIZE: subscript em y size. + * @HB_OT_METRICS_TAG_SUBSCRIPT_EM_X_OFFSET: subscript em x offset. + * @HB_OT_METRICS_TAG_SUBSCRIPT_EM_Y_OFFSET: subscript em y offset. + * @HB_OT_METRICS_TAG_SUPERSCRIPT_EM_X_SIZE: superscript em x size. + * @HB_OT_METRICS_TAG_SUPERSCRIPT_EM_Y_SIZE: superscript em y size. + * @HB_OT_METRICS_TAG_SUPERSCRIPT_EM_X_OFFSET: superscript em x offset. + * @HB_OT_METRICS_TAG_SUPERSCRIPT_EM_Y_OFFSET: superscript em y offset. + * @HB_OT_METRICS_TAG_STRIKEOUT_SIZE: strikeout size. + * @HB_OT_METRICS_TAG_STRIKEOUT_OFFSET: strikeout offset. + * @HB_OT_METRICS_TAG_UNDERLINE_SIZE: underline size. + * @HB_OT_METRICS_TAG_UNDERLINE_OFFSET: underline offset. + * + * From https://docs.microsoft.com/en-us/typography/opentype/spec/mvar#value-tags + * + * Since: 2.6.0 + **/ +typedef enum { + HB_OT_METRICS_TAG_HORIZONTAL_ASCENDER = HB_TAG ('h','a','s','c'), + HB_OT_METRICS_TAG_HORIZONTAL_DESCENDER = HB_TAG ('h','d','s','c'), + HB_OT_METRICS_TAG_HORIZONTAL_LINE_GAP = HB_TAG ('h','l','g','p'), + HB_OT_METRICS_TAG_HORIZONTAL_CLIPPING_ASCENT = HB_TAG ('h','c','l','a'), + HB_OT_METRICS_TAG_HORIZONTAL_CLIPPING_DESCENT = HB_TAG ('h','c','l','d'), + HB_OT_METRICS_TAG_VERTICAL_ASCENDER = HB_TAG ('v','a','s','c'), + HB_OT_METRICS_TAG_VERTICAL_DESCENDER = HB_TAG ('v','d','s','c'), + HB_OT_METRICS_TAG_VERTICAL_LINE_GAP = HB_TAG ('v','l','g','p'), + HB_OT_METRICS_TAG_HORIZONTAL_CARET_RISE = HB_TAG ('h','c','r','s'), + HB_OT_METRICS_TAG_HORIZONTAL_CARET_RUN = HB_TAG ('h','c','r','n'), + HB_OT_METRICS_TAG_HORIZONTAL_CARET_OFFSET = HB_TAG ('h','c','o','f'), + HB_OT_METRICS_TAG_VERTICAL_CARET_RISE = HB_TAG ('v','c','r','s'), + HB_OT_METRICS_TAG_VERTICAL_CARET_RUN = HB_TAG ('v','c','r','n'), + HB_OT_METRICS_TAG_VERTICAL_CARET_OFFSET = HB_TAG ('v','c','o','f'), + HB_OT_METRICS_TAG_X_HEIGHT = HB_TAG ('x','h','g','t'), + HB_OT_METRICS_TAG_CAP_HEIGHT = HB_TAG ('c','p','h','t'), + HB_OT_METRICS_TAG_SUBSCRIPT_EM_X_SIZE = HB_TAG ('s','b','x','s'), + HB_OT_METRICS_TAG_SUBSCRIPT_EM_Y_SIZE = HB_TAG ('s','b','y','s'), + HB_OT_METRICS_TAG_SUBSCRIPT_EM_X_OFFSET = HB_TAG ('s','b','x','o'), + HB_OT_METRICS_TAG_SUBSCRIPT_EM_Y_OFFSET = HB_TAG ('s','b','y','o'), + HB_OT_METRICS_TAG_SUPERSCRIPT_EM_X_SIZE = HB_TAG ('s','p','x','s'), + HB_OT_METRICS_TAG_SUPERSCRIPT_EM_Y_SIZE = HB_TAG ('s','p','y','s'), + HB_OT_METRICS_TAG_SUPERSCRIPT_EM_X_OFFSET = HB_TAG ('s','p','x','o'), + HB_OT_METRICS_TAG_SUPERSCRIPT_EM_Y_OFFSET = HB_TAG ('s','p','y','o'), + HB_OT_METRICS_TAG_STRIKEOUT_SIZE = HB_TAG ('s','t','r','s'), + HB_OT_METRICS_TAG_STRIKEOUT_OFFSET = HB_TAG ('s','t','r','o'), + HB_OT_METRICS_TAG_UNDERLINE_SIZE = HB_TAG ('u','n','d','s'), + HB_OT_METRICS_TAG_UNDERLINE_OFFSET = HB_TAG ('u','n','d','o'), + + _HB_OT_METRICS_TAG_MAX_VALUE = HB_TAG_MAX_SIGNED /*< skip >*/ +} hb_ot_metrics_tag_t; + +HB_EXTERN hb_bool_t +hb_ot_metrics_get_position (hb_font_t *font, + hb_ot_metrics_tag_t metrics_tag, + hb_position_t *position /* OUT. May be NULL. */); + +HB_EXTERN float +hb_ot_metrics_get_variation (hb_font_t *font, hb_ot_metrics_tag_t metrics_tag); + +HB_EXTERN hb_position_t +hb_ot_metrics_get_x_variation (hb_font_t *font, hb_ot_metrics_tag_t metrics_tag); + +HB_EXTERN hb_position_t +hb_ot_metrics_get_y_variation (hb_font_t *font, hb_ot_metrics_tag_t metrics_tag); + +HB_END_DECLS + +#endif /* HB_OT_METRICS_H */ diff -Nru harfbuzz-2.5.3/src/hb-ot-metrics.hh harfbuzz-2.6.2/src/hb-ot-metrics.hh --- harfbuzz-2.5.3/src/hb-ot-metrics.hh 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-metrics.hh 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,35 @@ +/* + * Copyright © 2018 Ebrahim Byagowi + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#ifndef HB_OT_METRICS_HH +#define HB_OT_METRICS_HH + +#include "hb.hh" + +HB_INTERNAL bool +_hb_ot_metrics_get_position_common (hb_font_t *font, + hb_ot_metrics_tag_t metrics_tag, + hb_position_t *position /* OUT. May be NULL. */); + +#endif /* HB_OT_METRICS_HH */ diff -Nru harfbuzz-2.5.3/src/hb-ot-name.cc harfbuzz-2.6.2/src/hb-ot-name.cc --- harfbuzz-2.5.3/src/hb-ot-name.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-name.cc 2019-10-26 02:02:55.000000000 +0000 @@ -90,7 +90,7 @@ const typename in_utf_t::codepoint_t *src_next = in_utf_t::next (src, src_end, &unicode, replacement); typename out_utf_t::codepoint_t *dst_next = out_utf_t::encode (dst, dst_end, unicode); if (dst_next == dst) - break; /* Out-of-room. */ + break; /* Out-of-room. */ dst = dst_next; src = src_next; diff -Nru harfbuzz-2.5.3/src/hb-ot-name-table.hh harfbuzz-2.6.2/src/hb-ot-name-table.hh --- harfbuzz-2.5.3/src/hb-ot-name-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-name-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -191,9 +191,7 @@ const void *dst_string_pool = &(this + this->stringOffset); - + it - | hb_apply ([=] (const NameRecord& _) { c->copy (_, src_string_pool, dst_string_pool); }) - ; + for (const auto &_ : it) c->copy (_, src_string_pool, dst_string_pool); if (unlikely (c->ran_out_of_room)) return_trace (false); @@ -265,10 +263,10 @@ unsigned int j = 0; for (unsigned int i = 0; i < this->names.length; i++) { - if (this->names[i].entry_score == UNSUPPORTED || + if (this->names[i].entry_score == UNSUPPORTED || this->names[i].language == HB_LANGUAGE_INVALID) continue; - if (i && + if (i && this->names[i - 1].name_id == this->names[i].name_id && this->names[i - 1].language == this->names[i].language) continue; @@ -295,10 +293,10 @@ sizeof (key), _hb_ot_name_entry_cmp_key); if (!entry) - return -1; + return -1; if (width) - *width = entry->entry_score < 10 ? 2 : 1; + *width = entry->entry_score < 10 ? 2 : 1; return entry->entry_index; } @@ -330,6 +328,9 @@ DEFINE_SIZE_ARRAY (6, nameRecordZ); }; +#undef entry_index +#undef entry_score + struct name_accelerator_t : name::accelerator_t {}; } /* namespace OT */ diff -Nru harfbuzz-2.5.3/src/hb-ot-os2-table.hh harfbuzz-2.6.2/src/hb-ot-os2-table.hh --- harfbuzz-2.5.3/src/hb-ot-os2-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-os2-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -59,6 +59,10 @@ struct OS2V2Tail { + bool has_data () const { return sxHeight || sCapHeight; } + + const OS2V2Tail * operator -> () const { return this; } + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); @@ -77,6 +81,23 @@ struct OS2V5Tail { + inline bool get_optical_size (unsigned int *lower, unsigned int *upper) const + { + unsigned int lower_optical_size = usLowerOpticalPointSize; + unsigned int upper_optical_size = usUpperOpticalPointSize; + + /* Per https://docs.microsoft.com/en-us/typography/opentype/spec/os2#lps */ + if (lower_optical_size < upper_optical_size && + lower_optical_size >= 1 && lower_optical_size <= 0xFFFE && + upper_optical_size >= 2 && upper_optical_size <= 0xFFFF) + { + *lower = lower_optical_size; + *upper = upper_optical_size; + return true; + } + return false; + } + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); @@ -94,7 +115,7 @@ { static constexpr hb_tag_t tableTag = HB_OT_TAG_OS2; - bool has_data () const { return this != &Null (OS2); } + bool has_data () const { return usWeightClass || usWidthClass || usFirstCharIndex || usLastCharIndex; } const OS2V1Tail &v1 () const { return version >= 1 ? v1X : Null (OS2V1Tail); } const OS2V2Tail &v2 () const { return version >= 2 ? v2X : Null (OS2V2Tail); } @@ -113,9 +134,9 @@ OBLIQUE = 1u<<9 }; - bool is_italic () const { return fsSelection & ITALIC; } - bool is_oblique () const { return fsSelection & OBLIQUE; } - bool is_typo_metrics () const { return fsSelection & USE_TYPO_METRICS; } + bool is_italic () const { return fsSelection & ITALIC; } + bool is_oblique () const { return fsSelection & OBLIQUE; } + bool use_typo_metrics () const { return fsSelection & USE_TYPO_METRICS; } enum width_class_t { FWIDTH_ULTRA_CONDENSED = 1, /* 50% */ @@ -192,13 +213,14 @@ } static void find_min_and_max_codepoint (const hb_set_t *codepoints, - uint16_t *min_cp, /* OUT */ - uint16_t *max_cp /* OUT */) + uint16_t *min_cp, /* OUT */ + uint16_t *max_cp /* OUT */) { *min_cp = codepoints->get_min (); *max_cp = codepoints->get_max (); } + /* https://github.com/Microsoft/Font-Validator/blob/520aaae/OTFontFileVal/val_OS2.cs#L644-L681 */ enum font_page_t { HEBREW_FONT_PAGE = 0xB100, // Hebrew Windows 3.1 font page SIMP_ARABIC_FONT_PAGE = 0xB200, // Simplified Arabic Windows 3.1 font page @@ -208,8 +230,6 @@ TRAD_FARSI_FONT_PAGE = 0xBB00, // Traditional Farsi Windows 3.1 font page THAI_FONT_PAGE = 0xDE00 // Thai Windows 3.1 font page }; - - // https://github.com/Microsoft/Font-Validator/blob/520aaae/OTFontFileVal/val_OS2.cs#L644-L681 font_page_t get_font_page () const { return (font_page_t) (version == 0 ? fsSelection & 0xFF00 : 0); } diff -Nru harfbuzz-2.5.3/src/hb-ot-post-table.hh harfbuzz-2.6.2/src/hb-ot-post-table.hh --- harfbuzz-2.5.3/src/hb-ot-post-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-post-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -178,6 +178,8 @@ return false; } + hb_blob_ptr_t table; + protected: unsigned int get_glyph_count () const @@ -237,7 +239,6 @@ } private: - hb_blob_ptr_t table; uint32_t version; const ArrayOf *glyphNameIndex; hb_vector_t index_to_offset; @@ -245,6 +246,8 @@ hb_atomic_ptr_t gids_sorted_by_name; }; + bool has_data () const { return version.to_int (); } + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); @@ -259,7 +262,7 @@ * 0x00020000 for version 2.0 * 0x00025000 for version 2.5 (deprecated) * 0x00030000 for version 3.0 */ - Fixed italicAngle; /* Italic angle in counter-clockwise degrees + HBFixed italicAngle; /* Italic angle in counter-clockwise degrees * from the vertical. Zero for upright text, * negative for text that leans to the right * (forward). */ diff -Nru harfbuzz-2.5.3/src/hb-ot-shape.cc harfbuzz-2.6.2/src/hb-ot-shape.cc --- harfbuzz-2.5.3/src/hb-ot-shape.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape.cc 2019-10-26 02:02:55.000000000 +0000 @@ -26,6 +26,14 @@ * Google Author(s): Behdad Esfahbod */ +#include "hb.hh" + +#ifndef HB_NO_OT_SHAPE + +#ifdef HB_NO_OT_LAYOUT +#error "Cannot compile 'ot' shaper with HB_NO_OT_LAYOUT." +#endif + #include "hb-shaper-impl.hh" #include "hb-ot-shape.hh" @@ -55,7 +63,7 @@ const hb_feature_t *user_features, unsigned int num_user_features); -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE static inline bool _hb_apply_morx (hb_face_t *face) { @@ -78,7 +86,7 @@ props (*props), map (face, props), aat_map (face, props) -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE , apply_morx (_hb_apply_morx (face)) #endif { @@ -98,7 +106,7 @@ plan.props = props; plan.shaper = shaper; map.compile (plan.map, key); -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE if (apply_morx) aat_map.compile (plan.aat_map); #endif @@ -117,7 +125,7 @@ plan.kern_mask = plan.map.get_mask (kern_tag); plan.requested_kerning = !!plan.kern_mask; #endif -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE plan.trak_mask = plan.map.get_mask (HB_TAG ('t','r','a','k')); plan.requested_tracking = !!plan.trak_mask; #endif @@ -137,7 +145,7 @@ * Decide who does substitutions. GSUB, morx, or fallback. */ -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE plan.apply_morx = apply_morx; #endif @@ -147,13 +155,13 @@ if (0) ; -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE else if (hb_options ().aat && hb_aat_layout_has_positioning (face)) plan.apply_kerx = true; #endif else if (!apply_morx && !disable_gpos && hb_ot_layout_has_positioning (face)) plan.apply_gpos = true; -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE else if (hb_aat_layout_has_positioning (face)) plan.apply_kerx = true; #endif @@ -161,7 +169,7 @@ if (!plan.apply_kerx && !has_gpos_kern) { /* Apparently Apple applies kerx if GPOS kern was not applied. */ -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE if (hb_aat_layout_has_positioning (face)) plan.apply_kerx = true; else @@ -192,7 +200,7 @@ plan.fallback_mark_positioning = plan.adjust_mark_positioning_when_zeroing && script_fallback_mark_positioning; -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE /* Currently we always apply trak. */ plan.apply_trak = plan.requested_tracking && hb_aat_layout_has_tracking (face); #endif @@ -203,7 +211,7 @@ const hb_shape_plan_key_t *key) { map.init (); -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE aat_map.init (); #endif @@ -233,7 +241,7 @@ shaper->data_destroy (const_cast (data)); map.fini (); -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE aat_map.fini (); #endif } @@ -242,7 +250,7 @@ hb_ot_shape_plan_t::substitute (hb_font_t *font, hb_buffer_t *buffer) const { -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE if (unlikely (apply_morx)) hb_aat_layout_substitute (this, font, buffer); else @@ -256,7 +264,7 @@ { if (this->apply_gpos) map.position (this, font, buffer); -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE else if (this->apply_kerx) hb_aat_layout_position (this, font, buffer); #endif @@ -267,7 +275,7 @@ else _hb_ot_shape_fallback_kern (this, font, buffer); -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE if (this->apply_trak) hb_aat_layout_track (this, font, buffer); #endif @@ -277,6 +285,8 @@ 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}, @@ -291,6 +301,7 @@ {HB_TAG('c','a','l','t'), F_GLOBAL}, {HB_TAG('c','l','i','g'), F_GLOBAL}, {HB_TAG('c','u','r','s'), F_GLOBAL}, + {HB_TAG('d','i','s','t'), F_GLOBAL}, {HB_TAG('k','e','r','n'), F_GLOBAL_HAS_FALLBACK}, {HB_TAG('l','i','g','a'), F_GLOBAL}, {HB_TAG('r','c','l','t'), F_GLOBAL}, @@ -332,7 +343,7 @@ /* Random! */ map->enable_feature (HB_TAG ('r','a','n','d'), F_RANDOM, HB_OT_MAP_MAX_VALUE); -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE /* Tracking. We enable dummy feature here just to allow disabling * AAT 'trak' table using features. * https://github.com/harfbuzz/harfbuzz/issues/1303 */ @@ -370,7 +381,7 @@ feature->value); } -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE if (planner->apply_morx) { hb_aat_map_builder_t *aat_map = &planner->aat_map; @@ -471,17 +482,19 @@ { _hb_glyph_info_set_continuation (&info[i]); } +#ifndef HB_NO_EMOJI_SEQUENCES else if (unlikely (_hb_glyph_info_is_zwj (&info[i]))) { _hb_glyph_info_set_continuation (&info[i]); if (i + 1 < count && _hb_unicode_is_emoji_Extended_Pictographic (info[i + 1].codepoint)) { - i++; + i++; _hb_glyph_info_set_unicode_props (&info[i], buffer); _hb_glyph_info_set_continuation (&info[i]); } } +#endif /* Or part of the Other_Grapheme_Extend that is not marks. * As of Unicode 11 that is just: * @@ -637,19 +650,19 @@ while (start && _hb_glyph_info_get_general_category (&info[start - 1]) == HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER) - start--; + start--; while (end < count && _hb_glyph_info_get_general_category (&info[end]) == HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER) - end++; + end++; buffer->unsafe_to_break (start, end); for (unsigned int j = start; j < i; j++) - info[j].mask |= pre_mask; + info[j].mask |= pre_mask; info[i].mask |= c->plan->frac_mask; for (unsigned int j = i + 1; j < end; j++) - info[j].mask |= post_mask; + info[j].mask |= post_mask; i = end - 1; } @@ -819,7 +832,7 @@ hb_ot_substitute_post (const hb_ot_shape_context_t *c) { hb_ot_hide_default_ignorables (c->buffer, c->font); -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE if (c->plan->apply_morx) hb_aat_layout_remove_deleted_glyphs (c->buffer); #endif @@ -856,7 +869,7 @@ if (_hb_glyph_info_is_mark (&info[i])) { if (adjust_offsets) - adjust_mark_offsets (&buffer->pos[i]); + adjust_mark_offsets (&buffer->pos[i]); zero_mark_width (&buffer->pos[i]); } } @@ -872,7 +885,7 @@ if (HB_DIRECTION_IS_HORIZONTAL (direction)) { c->font->get_glyph_h_advances (count, &info[0].codepoint, sizeof(info[0]), - &pos[0].x_advance, sizeof(pos[0])); + &pos[0].x_advance, sizeof(pos[0])); /* The nil glyph_h_origin() func returns 0, so no need to apply it. */ if (c->font->has_glyph_h_origin_func ()) for (unsigned int i = 0; i < count; i++) @@ -883,7 +896,7 @@ else { c->font->get_glyph_v_advances (count, &info[0].codepoint, sizeof(info[0]), - &pos[0].y_advance, sizeof(pos[0])); + &pos[0].y_advance, sizeof(pos[0])); for (unsigned int i = 0; i < count; i++) { c->font->subtract_glyph_v_origin (info[i].codepoint, @@ -956,7 +969,7 @@ /* Finish off. Has to follow a certain order. */ hb_ot_layout_position_finish_advances (c->font, c->buffer); hb_ot_zero_width_default_ignorables (c->buffer); -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE if (c->plan->apply_morx) hb_aat_layout_zero_width_deleted_glyphs (c->buffer); #endif @@ -1146,3 +1159,6 @@ hb_shape_plan_destroy (shape_plan); } + + +#endif diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-complex-arabic.cc harfbuzz-2.6.2/src/hb-ot-shape-complex-arabic.cc --- harfbuzz-2.5.3/src/hb-ot-shape-complex-arabic.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-complex-arabic.cc 2019-10-26 02:02:55.000000000 +0000 @@ -25,6 +25,9 @@ */ #include "hb.hh" + +#ifndef HB_NO_OT_SHAPE + #include "hb-ot-shape-complex-arabic.hh" #include "hb-ot-shape.hh" @@ -473,13 +476,13 @@ { if (!hb_in_range (info[i - 1].arabic_shaping_action(), STCH_FIXED, STCH_REPEATING)) { - if (step == CUT) + if (step == CUT) { --j; info[j] = info[i - 1]; pos[j] = pos[i - 1]; } - continue; + continue; } /* Yay, justification! */ @@ -537,10 +540,10 @@ hb_position_t shortfall = sign * w_remaining - sign * w_repeating * (n_copies + 1); if (shortfall > 0 && n_repeating > 0) { - ++n_copies; - hb_position_t excess = (n_copies + 1) * sign * w_repeating - sign * w_remaining; - if (excess > 0) - extra_repeat_overlap = excess / (n_copies * n_repeating); + ++n_copies; + hb_position_t excess = (n_copies + 1) * sign * w_repeating - sign * w_remaining; + if (excess > 0) + extra_repeat_overlap = excess / (n_copies * n_repeating); } if (step == MEASURE) @@ -580,7 +583,7 @@ if (step == MEASURE) { if (unlikely (!buffer->ensure (count + extra_glyphs_needed))) - break; + break; } else { @@ -710,3 +713,6 @@ HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE, true, /* fallback_position */ }; + + +#endif diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-complex-arabic-fallback.hh harfbuzz-2.6.2/src/hb-ot-shape-complex-arabic-fallback.hh --- harfbuzz-2.5.3/src/hb-ot-shape-complex-arabic-fallback.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-complex-arabic-fallback.hh 2019-10-26 02:02:55.000000000 +0000 @@ -49,8 +49,8 @@ hb_font_t *font, unsigned int feature_index) { - OT::GlyphID glyphs[SHAPING_TABLE_LAST - SHAPING_TABLE_FIRST + 1]; - OT::GlyphID substitutes[SHAPING_TABLE_LAST - SHAPING_TABLE_FIRST + 1]; + OT::HBGlyphID glyphs[SHAPING_TABLE_LAST - SHAPING_TABLE_FIRST + 1]; + OT::HBGlyphID substitutes[SHAPING_TABLE_LAST - SHAPING_TABLE_FIRST + 1]; unsigned int num_glyphs = 0; /* Populate arrays */ @@ -78,7 +78,7 @@ /* Bubble-sort or something equally good! * May not be good-enough for presidential candidate interviews, but good-enough for us... */ hb_stable_sort (&glyphs[0], num_glyphs, - (int(*)(const OT::HBUINT16*, const OT::HBUINT16 *)) OT::GlyphID::cmp, + (int(*)(const OT::HBUINT16*, const OT::HBUINT16 *)) OT::HBGlyphID::cmp, &substitutes[0]); @@ -99,15 +99,15 @@ arabic_fallback_synthesize_lookup_ligature (const hb_ot_shape_plan_t *plan HB_UNUSED, hb_font_t *font) { - OT::GlyphID first_glyphs[ARRAY_LENGTH_CONST (ligature_table)]; + OT::HBGlyphID first_glyphs[ARRAY_LENGTH_CONST (ligature_table)]; unsigned int first_glyphs_indirection[ARRAY_LENGTH_CONST (ligature_table)]; unsigned int ligature_per_first_glyph_count_list[ARRAY_LENGTH_CONST (first_glyphs)]; unsigned int num_first_glyphs = 0; /* We know that all our ligatures are 2-component */ - OT::GlyphID ligature_list[ARRAY_LENGTH_CONST (first_glyphs) * ARRAY_LENGTH_CONST(ligature_table[0].ligatures)]; + OT::HBGlyphID ligature_list[ARRAY_LENGTH_CONST (first_glyphs) * ARRAY_LENGTH_CONST(ligature_table[0].ligatures)]; unsigned int component_count_list[ARRAY_LENGTH_CONST (ligature_list)]; - OT::GlyphID component_list[ARRAY_LENGTH_CONST (ligature_list) * 1/* One extra component per ligature */]; + OT::HBGlyphID component_list[ARRAY_LENGTH_CONST (ligature_list) * 1/* One extra component per ligature */]; unsigned int num_ligatures = 0; /* Populate arrays */ @@ -125,7 +125,7 @@ num_first_glyphs++; } hb_stable_sort (&first_glyphs[0], num_first_glyphs, - (int(*)(const OT::HBUINT16*, const OT::HBUINT16 *)) OT::GlyphID::cmp, + (int(*)(const OT::HBUINT16*, const OT::HBUINT16 *)) OT::HBGlyphID::cmp, &first_glyphs_indirection[0]); /* Now that the first-glyphs are sorted, walk again, populate ligatures. */ diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-complex-default.cc harfbuzz-2.6.2/src/hb-ot-shape-complex-default.cc --- harfbuzz-2.5.3/src/hb-ot-shape-complex-default.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-complex-default.cc 2019-10-26 02:02:55.000000000 +0000 @@ -24,6 +24,10 @@ * Google Author(s): Behdad Esfahbod */ +#include "hb.hh" + +#ifndef HB_NO_OT_SHAPE + #include "hb-ot-shape-complex.hh" @@ -44,3 +48,6 @@ HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE, true, /* fallback_position */ }; + + +#endif diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-complex-hangul.cc harfbuzz-2.6.2/src/hb-ot-shape-complex-hangul.cc --- harfbuzz-2.5.3/src/hb-ot-shape-complex-hangul.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-complex-hangul.cc 2019-10-26 02:02:55.000000000 +0000 @@ -24,6 +24,10 @@ * Google Author(s): Behdad Esfahbod */ +#include "hb.hh" + +#ifndef HB_NO_OT_SHAPE + #include "hb-ot-shape-complex.hh" @@ -200,7 +204,7 @@ if (start < end && end == buffer->out_len) { /* Tone mark follows a valid syllable; move it in front, unless it's zero width. */ - buffer->unsafe_to_break_from_outbuffer (start, buffer->idx); + buffer->unsafe_to_break_from_outbuffer (start, buffer->idx); buffer->next_glyph (); if (!is_zero_width_char (font, u)) { @@ -350,9 +354,9 @@ */ if (has_glyph && !tindex) { - buffer->next_glyph (); - s_len++; - } + buffer->next_glyph (); + s_len++; + } if (unlikely (!buffer->successful)) return; @@ -361,7 +365,7 @@ * that are now in buffer->out_info. */ hb_glyph_info_t *info = buffer->out_info; - end = start + s_len; + end = start + s_len; unsigned int i = start; info[i++].hangul_shaping_feature() = LJMO; @@ -379,7 +383,7 @@ if (has_glyph) { - /* We didn't decompose the S, so just advance past it. */ + /* We didn't decompose the S, so just advance past it. */ end = start + 1; buffer->next_glyph (); continue; @@ -430,3 +434,6 @@ HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE, false, /* fallback_position */ }; + + +#endif diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-complex-hebrew.cc harfbuzz-2.6.2/src/hb-ot-shape-complex-hebrew.cc --- harfbuzz-2.5.3/src/hb-ot-shape-complex-hebrew.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-complex-hebrew.cc 2019-10-26 02:02:55.000000000 +0000 @@ -24,6 +24,10 @@ * Google Author(s): Behdad Esfahbod */ +#include "hb.hh" + +#ifndef HB_NO_OT_SHAPE + #include "hb-ot-shape-complex.hh" @@ -176,3 +180,6 @@ HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE, true, /* fallback_position */ }; + + +#endif diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-complex-indic.cc harfbuzz-2.6.2/src/hb-ot-shape-complex-indic.cc --- harfbuzz-2.5.3/src/hb-ot-shape-complex-indic.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-complex-indic.cc 2019-10-26 02:02:55.000000000 +0000 @@ -24,6 +24,10 @@ * Google Author(s): Behdad Esfahbod */ +#include "hb.hh" + +#ifndef HB_NO_OT_SHAPE + #include "hb-ot-shape-complex-indic.hh" #include "hb-ot-shape-complex-vowel-constraints.hh" #include "hb-ot-layout.hh" @@ -127,62 +131,47 @@ {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('d','i','s','t'), F_GLOBAL}, - {HB_TAG('a','b','v','m'), F_GLOBAL}, - {HB_TAG('b','l','w','m'), F_GLOBAL}, }; /* * Must be in the same order as the indic_features array. */ enum { - _NUKT, - _AKHN, - RPHF, - _RKRF, - PREF, - BLWF, - ABVF, - HALF, - PSTF, - _VATU, - _CJCT, - - INIT, - _PRES, - _ABVS, - _BLWS, - _PSTS, - _HALN, - - _DIST, - _ABVM, - _BLWM, + _INDIC_NUKT, + _INDIC_AKHN, + INDIC_RPHF, + _INDIC_RKRF, + INDIC_PREF, + INDIC_BLWF, + INDIC_ABVF, + INDIC_HALF, + INDIC_PSTF, + _INDIC_VATU, + _INDIC_CJCT, + + INDIC_INIT, + _INDIC_PRES, + _INDIC_ABVS, + _INDIC_BLWS, + _INDIC_PSTS, + _INDIC_HALN, INDIC_NUM_FEATURES, - INDIC_BASIC_FEATURES = INIT, /* Don't forget to update this! */ + INDIC_BASIC_FEATURES = INDIC_INIT, /* Don't forget to update this! */ }; static void -setup_syllables (const hb_ot_shape_plan_t *plan, - hb_font_t *font, - hb_buffer_t *buffer); -static void -initial_reordering (const hb_ot_shape_plan_t *plan, - hb_font_t *font, - hb_buffer_t *buffer); +setup_syllables_indic (const hb_ot_shape_plan_t *plan, + hb_font_t *font, + hb_buffer_t *buffer); static void -final_reordering (const hb_ot_shape_plan_t *plan, - hb_font_t *font, - hb_buffer_t *buffer); +initial_reordering_indic (const hb_ot_shape_plan_t *plan, + hb_font_t *font, + hb_buffer_t *buffer); static void -clear_syllables (const hb_ot_shape_plan_t *plan, - hb_font_t *font, - hb_buffer_t *buffer); +final_reordering_indic (const hb_ot_shape_plan_t *plan, + hb_font_t *font, + hb_buffer_t *buffer); static void collect_features_indic (hb_ot_shape_planner_t *plan) @@ -190,7 +179,7 @@ hb_ot_map_builder_t *map = &plan->map; /* Do this before any lookups have been applied. */ - map->add_gsub_pause (setup_syllables); + map->add_gsub_pause (setup_syllables_indic); map->enable_feature (HB_TAG('l','o','c','l')); /* The Indic specs do not require ccmp, but we apply it here since if @@ -199,14 +188,14 @@ unsigned int i = 0; - map->add_gsub_pause (initial_reordering); + map->add_gsub_pause (initial_reordering_indic); for (; i < INDIC_BASIC_FEATURES; i++) { map->add_feature (indic_features[i]); map->add_gsub_pause (nullptr); } - map->add_gsub_pause (final_reordering); + map->add_gsub_pause (final_reordering_indic); for (; i < INDIC_NUM_FEATURES; i++) map->add_feature (indic_features[i]); @@ -214,7 +203,7 @@ map->enable_feature (HB_TAG('c','a','l','t')); map->enable_feature (HB_TAG('c','l','i','g')); - map->add_gsub_pause (clear_syllables); + map->add_gsub_pause (_hb_clear_syllables); } static void @@ -224,32 +213,6 @@ } -struct would_substitute_feature_t -{ - void init (const hb_ot_map_t *map, hb_tag_t feature_tag, bool zero_context_) - { - zero_context = zero_context_; - map->get_stage_lookups (0/*GSUB*/, - map->get_feature_stage (0/*GSUB*/, feature_tag), - &lookups, &count); - } - - bool would_substitute (const hb_codepoint_t *glyphs, - unsigned int glyphs_count, - hb_face_t *face) const - { - for (unsigned int i = 0; i < count; i++) - if (hb_ot_layout_lookup_would_substitute (face, lookups[i].index, glyphs, glyphs_count, zero_context)) - return true; - return false; - } - - private: - const hb_ot_map_t::lookup_map_t *lookups; - unsigned int count; - bool zero_context; -}; - struct indic_shape_plan_t { bool load_virama_glyph (hb_font_t *font, hb_codepoint_t *pglyph) const @@ -281,10 +244,10 @@ #endif mutable hb_atomic_int_t virama_glyph; - would_substitute_feature_t rphf; - would_substitute_feature_t pref; - would_substitute_feature_t blwf; - would_substitute_feature_t pstf; + hb_indic_would_substitute_feature_t rphf; + hb_indic_would_substitute_feature_t pref; + hb_indic_would_substitute_feature_t blwf; + hb_indic_would_substitute_feature_t pstf; hb_mask_t mask_array[INDIC_NUM_FEATURES]; }; @@ -367,13 +330,13 @@ } -enum syllable_type_t { - consonant_syllable, - vowel_syllable, - standalone_cluster, - symbol_cluster, - broken_cluster, - non_indic_cluster, +enum indic_syllable_type_t { + indic_consonant_syllable, + indic_vowel_syllable, + indic_standalone_cluster, + indic_symbol_cluster, + indic_broken_cluster, + indic_non_indic_cluster, }; #include "hb-ot-shape-complex-indic-machine.hh" @@ -397,11 +360,11 @@ } static void -setup_syllables (const hb_ot_shape_plan_t *plan HB_UNUSED, - hb_font_t *font HB_UNUSED, - hb_buffer_t *buffer) +setup_syllables_indic (const hb_ot_shape_plan_t *plan HB_UNUSED, + hb_font_t *font HB_UNUSED, + hb_buffer_t *buffer) { - find_syllables (buffer); + find_syllables_indic (buffer); foreach_syllable (buffer, start, end) buffer->unsafe_to_break (start, end); } @@ -418,9 +381,9 @@ static void -update_consonant_positions (const hb_ot_shape_plan_t *plan, - hb_font_t *font, - hb_buffer_t *buffer) +update_consonant_positions_indic (const hb_ot_shape_plan_t *plan, + hb_font_t *font, + hb_buffer_t *buffer) { const indic_shape_plan_t *indic_plan = (const indic_shape_plan_t *) plan->data; @@ -493,7 +456,7 @@ * and has more than one consonant, Ra is excluded from candidates for * base consonants. */ unsigned int limit = start; - if (indic_plan->mask_array[RPHF] && + if (indic_plan->mask_array[INDIC_RPHF] && start + 3 <= end && ( (indic_plan->config->reph_mode == REPH_MODE_IMPLICIT && !is_joiner (info[start + 2])) || @@ -577,7 +540,7 @@ case BASE_POS_LAST_SINHALA: { - /* Sinhala base positioning is slightly different from main Indic, in that: + /* Sinhala base positioning is slightly different from main Indic, in that: * 1. Its ZWJ behavior is different, * 2. We don't need to look into the font for consonant positions. */ @@ -706,8 +669,8 @@ for (unsigned int i = base + 1; i < end; i++) if (info[i].indic_category() == OT_H) { - unsigned int j; - for (j = end - 1; j > i; j--) + unsigned int j; + for (j = end - 1; j > i; j--) if (is_consonant (info[j]) || (disallow_double_halants && info[j].indic_category() == OT_H)) break; @@ -717,7 +680,7 @@ memmove (&info[i], &info[i + 1], (j - i) * sizeof (info[0])); info[j] = t; } - break; + break; } } @@ -748,7 +711,7 @@ } } } else if (info[i].indic_position() != POS_SMVD) { - last_pos = (indic_position_t) info[i].indic_position(); + last_pos = (indic_position_t) info[i].indic_position(); } } } @@ -764,7 +727,7 @@ info[j].indic_position() = info[i].indic_position(); last = i; } else if (info[i].indic_category() == OT_M) - last = i; + last = i; } @@ -801,7 +764,7 @@ { /* Note! syllable() is a one-byte field. */ for (unsigned int i = base; i < end; i++) - if (info[i].syllable() != 255) + if (info[i].syllable() != 255) { unsigned int max = i; unsigned int j = start + info[i].syllable(); @@ -829,13 +792,13 @@ /* Reph */ for (unsigned int i = start; i < end && info[i].indic_position() == POS_RA_TO_BECOME_REPH; i++) - info[i].mask |= indic_plan->mask_array[RPHF]; + info[i].mask |= indic_plan->mask_array[INDIC_RPHF]; /* Pre-base */ - mask = indic_plan->mask_array[HALF]; + mask = indic_plan->mask_array[INDIC_HALF]; if (!indic_plan->is_old_spec && indic_plan->config->blwf_mode == BLWF_MODE_PRE_AND_POST) - mask |= indic_plan->mask_array[BLWF]; + mask |= indic_plan->mask_array[INDIC_BLWF]; for (unsigned int i = start; i < base; i++) info[i].mask |= mask; /* Base */ @@ -843,7 +806,9 @@ if (base < end) info[base].mask |= mask; /* Post-base */ - mask = indic_plan->mask_array[BLWF] | indic_plan->mask_array[ABVF] | indic_plan->mask_array[PSTF]; + mask = indic_plan->mask_array[INDIC_BLWF] | + indic_plan->mask_array[INDIC_ABVF] | + indic_plan->mask_array[INDIC_PSTF]; for (unsigned int i = base + 1; i < end; i++) info[i].mask |= mask; } @@ -875,23 +840,23 @@ (i + 2 == base || info[i+2].indic_category() != OT_ZWJ)) { - info[i ].mask |= indic_plan->mask_array[BLWF]; - info[i+1].mask |= indic_plan->mask_array[BLWF]; + info[i ].mask |= indic_plan->mask_array[INDIC_BLWF]; + info[i+1].mask |= indic_plan->mask_array[INDIC_BLWF]; } } unsigned int pref_len = 2; - if (indic_plan->mask_array[PREF] && base + pref_len < end) + if (indic_plan->mask_array[INDIC_PREF] && base + pref_len < end) { /* Find a Halant,Ra sequence and mark it for pre-base-reordering processing. */ for (unsigned int i = base + 1; i + pref_len - 1 < end; i++) { hb_codepoint_t glyphs[2]; for (unsigned int j = 0; j < pref_len; j++) - glyphs[j] = info[i + j].codepoint; + glyphs[j] = info[i + j].codepoint; if (indic_plan->pref.would_substitute (glyphs, pref_len, face)) { for (unsigned int j = 0; j < pref_len; j++) - info[i++].mask |= indic_plan->mask_array[PREF]; + info[i++].mask |= indic_plan->mask_array[INDIC_PREF]; break; } } @@ -912,7 +877,7 @@ /* A ZWNJ disables HALF. */ if (non_joiner) - info[j].mask &= ~indic_plan->mask_array[HALF]; + info[j].mask &= ~indic_plan->mask_array[INDIC_HALF]; } while (j > start && !is_consonant (info[j])); } @@ -941,34 +906,34 @@ } static void -initial_reordering_syllable (const hb_ot_shape_plan_t *plan, - hb_face_t *face, - hb_buffer_t *buffer, - unsigned int start, unsigned int end) +initial_reordering_syllable_indic (const hb_ot_shape_plan_t *plan, + hb_face_t *face, + hb_buffer_t *buffer, + unsigned int start, unsigned int end) { - syllable_type_t syllable_type = (syllable_type_t) (buffer->info[start].syllable() & 0x0F); + indic_syllable_type_t syllable_type = (indic_syllable_type_t) (buffer->info[start].syllable() & 0x0F); switch (syllable_type) { - case vowel_syllable: /* We made the vowels look like consonants. So let's call the consonant logic! */ - case consonant_syllable: + case indic_vowel_syllable: /* We made the vowels look like consonants. So let's call the consonant logic! */ + case indic_consonant_syllable: initial_reordering_consonant_syllable (plan, face, buffer, start, end); break; - case broken_cluster: /* We already inserted dotted-circles, so just call the standalone_cluster. */ - case standalone_cluster: + case indic_broken_cluster: /* We already inserted dotted-circles, so just call the standalone_cluster. */ + case indic_standalone_cluster: initial_reordering_standalone_cluster (plan, face, buffer, start, end); break; - case symbol_cluster: - case non_indic_cluster: + case indic_symbol_cluster: + case indic_non_indic_cluster: break; } } static inline void -insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED, - hb_font_t *font, - hb_buffer_t *buffer) +insert_dotted_circles_indic (const hb_ot_shape_plan_t *plan HB_UNUSED, + hb_font_t *font, + hb_buffer_t *buffer) { if (unlikely (buffer->flags & HB_BUFFER_FLAG_DO_NOT_INSERT_DOTTED_CIRCLE)) return; @@ -979,7 +944,7 @@ unsigned int count = buffer->len; hb_glyph_info_t *info = buffer->info; for (unsigned int i = 0; i < count; i++) - if ((info[i].syllable() & 0x0F) == broken_cluster) + if ((info[i].syllable() & 0x0F) == indic_broken_cluster) { has_broken_syllables = true; break; @@ -1004,8 +969,8 @@ while (buffer->idx < buffer->len && buffer->successful) { unsigned int syllable = buffer->cur().syllable(); - syllable_type_t syllable_type = (syllable_type_t) (syllable & 0x0F); - if (unlikely (last_syllable != syllable && syllable_type == broken_cluster)) + indic_syllable_type_t syllable_type = (indic_syllable_type_t) (syllable & 0x0F); + if (unlikely (last_syllable != syllable && syllable_type == indic_broken_cluster)) { last_syllable = syllable; @@ -1018,7 +983,7 @@ while (buffer->idx < buffer->len && buffer->successful && last_syllable == buffer->cur().syllable() && buffer->cur().indic_category() == OT_Repha) - buffer->next_glyph (); + buffer->next_glyph (); buffer->output_info (ginfo); } @@ -1029,21 +994,21 @@ } static void -initial_reordering (const hb_ot_shape_plan_t *plan, - hb_font_t *font, - hb_buffer_t *buffer) +initial_reordering_indic (const hb_ot_shape_plan_t *plan, + hb_font_t *font, + hb_buffer_t *buffer) { - update_consonant_positions (plan, font, buffer); - insert_dotted_circles (plan, font, buffer); + update_consonant_positions_indic (plan, font, buffer); + insert_dotted_circles_indic (plan, font, buffer); foreach_syllable (buffer, start, end) - initial_reordering_syllable (plan, font->face, buffer, start, end); + initial_reordering_syllable_indic (plan, font->face, buffer, start, end); } static void -final_reordering_syllable (const hb_ot_shape_plan_t *plan, - hb_buffer_t *buffer, - unsigned int start, unsigned int end) +final_reordering_syllable_indic (const hb_ot_shape_plan_t *plan, + hb_buffer_t *buffer, + unsigned int start, unsigned int end) { const indic_shape_plan_t *indic_plan = (const indic_shape_plan_t *) plan->data; hb_glyph_info_t *info = buffer->info; @@ -1064,7 +1029,7 @@ _hb_glyph_info_ligated (&info[i]) && _hb_glyph_info_multiplied (&info[i])) { - /* This will make sure that this glyph passes is_halant() test. */ + /* This will make sure that this glyph passes is_halant() test. */ info[i].indic_category() = OT_H; _hb_glyph_info_clear_ligated_and_multiplied (&info[i]); } @@ -1079,7 +1044,7 @@ * syllable. */ - bool try_pref = !!indic_plan->mask_array[PREF]; + bool try_pref = !!indic_plan->mask_array[INDIC_PREF]; /* Find base again */ unsigned int base; @@ -1089,7 +1054,7 @@ if (try_pref && base + 1 < end) { for (unsigned int i = base + 1; i < end; i++) - if ((info[i].mask & indic_plan->mask_array[PREF]) != 0) + if ((info[i].mask & indic_plan->mask_array[INDIC_PREF]) != 0) { if (!(_hb_glyph_info_substituted (&info[i]) && _hb_glyph_info_ligated_and_didnt_multiply (&info[i]))) @@ -1127,7 +1092,7 @@ } if (start < base && info[base].indic_position() > POS_BASE_C) - base--; + base--; break; } if (base == end && start < base && @@ -1217,7 +1182,7 @@ } } else - new_pos = start; /* No move. */ + new_pos = start; /* No move. */ } if (start < new_pos && info[new_pos].indic_position () != POS_PRE_M) @@ -1319,7 +1284,7 @@ while (new_reph_pos + 1 < end && info[new_reph_pos + 1].indic_position() <= POS_AFTER_MAIN) new_reph_pos++; if (new_reph_pos < end) - goto reph_move; + goto reph_move; } /* 4. If reph should be positioned before post-base consonant, find @@ -1335,7 +1300,7 @@ !( FLAG_UNSAFE (info[new_reph_pos + 1].indic_position()) & (FLAG (POS_POST_C) | FLAG (POS_AFTER_POST) | FLAG (POS_SMVD)))) new_reph_pos++; if (new_reph_pos < end) - goto reph_move; + goto reph_move; } /* 5. If no consonant is found in steps 3 or 4, move reph to a position @@ -1411,13 +1376,13 @@ if (try_pref && base + 1 < end) /* Otherwise there can't be any pre-base-reordering Ra. */ { for (unsigned int i = base + 1; i < end; i++) - if ((info[i].mask & indic_plan->mask_array[PREF]) != 0) + if ((info[i].mask & indic_plan->mask_array[INDIC_PREF]) != 0) { /* 1. Only reorder a glyph produced by substitution during application * of the feature. (Note that a font may shape a Ra consonant with * the feature generally but block it in certain contexts.) */ - /* Note: We just check that something got substituted. We don't check that + /* Note: We just check that something got substituted. We don't check that * the feature actually did it... * * Reorder pref only if it ligated. */ @@ -1463,7 +1428,7 @@ } } - break; + break; } } @@ -1474,7 +1439,7 @@ if (!start || !(FLAG_UNSAFE (_hb_glyph_info_get_general_category (&info[start - 1])) & FLAG_RANGE (HB_UNICODE_GENERAL_CATEGORY_FORMAT, HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK))) - info[start].mask |= indic_plan->mask_array[INIT]; + info[start].mask |= indic_plan->mask_array[INDIC_INIT]; else buffer->unsafe_to_break (start - 1, start + 1); } @@ -1489,7 +1454,7 @@ { case HB_SCRIPT_TAMIL: case HB_SCRIPT_SINHALA: - break; + break; default: /* Uniscribe merges the entire syllable into a single cluster... Except for Tamil & Sinhala. @@ -1504,15 +1469,15 @@ static void -final_reordering (const hb_ot_shape_plan_t *plan, - hb_font_t *font HB_UNUSED, - hb_buffer_t *buffer) +final_reordering_indic (const hb_ot_shape_plan_t *plan, + hb_font_t *font HB_UNUSED, + hb_buffer_t *buffer) { unsigned int count = buffer->len; if (unlikely (!count)) return; foreach_syllable (buffer, start, end) - final_reordering_syllable (plan, buffer, start, end); + final_reordering_syllable_indic (plan, buffer, start, end); HB_BUFFER_DEALLOCATE_VAR (buffer, indic_category); HB_BUFFER_DEALLOCATE_VAR (buffer, indic_position); @@ -1520,18 +1485,6 @@ static void -clear_syllables (const hb_ot_shape_plan_t *plan HB_UNUSED, - hb_font_t *font HB_UNUSED, - hb_buffer_t *buffer) -{ - hb_glyph_info_t *info = buffer->info; - unsigned int count = buffer->len; - for (unsigned int i = 0; i < count; i++) - info[i].syllable() = 0; -} - - -static void preprocess_text_indic (const hb_ot_shape_plan_t *plan, hb_buffer_t *buffer, hb_font_t *font) @@ -1648,3 +1601,6 @@ HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE, false, /* fallback_position */ }; + + +#endif diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-complex-indic.hh harfbuzz-2.6.2/src/hb-ot-shape-complex-indic.hh --- harfbuzz-2.5.3/src/hb-ot-shape-complex-indic.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-complex-indic.hh 2019-10-26 02:02:55.000000000 +0000 @@ -64,7 +64,14 @@ OT_Ra = 16, OT_CM = 17, /* Consonant-Medial. */ OT_Symbol = 18, /* Avagraha, etc that take marks (SM,A,VD). */ - OT_CS = 19 + OT_CS = 19, + + /* The following are used by Khmer & Myanmar shapers. Defined + * here for them to share. */ + OT_VAbv = 26, + OT_VBlw = 27, + OT_VPre = 28, + OT_VPst = 29, }; #define MEDIAL_FLAGS (FLAG (OT_CM)) @@ -398,5 +405,31 @@ info.indic_position() = pos; } +struct hb_indic_would_substitute_feature_t +{ + void init (const hb_ot_map_t *map, hb_tag_t feature_tag, bool zero_context_) + { + zero_context = zero_context_; + map->get_stage_lookups (0/*GSUB*/, + map->get_feature_stage (0/*GSUB*/, feature_tag), + &lookups, &count); + } + + bool would_substitute (const hb_codepoint_t *glyphs, + unsigned int glyphs_count, + hb_face_t *face) const + { + for (unsigned int i = 0; i < count; i++) + if (hb_ot_layout_lookup_would_substitute (face, lookups[i].index, glyphs, glyphs_count, zero_context)) + return true; + return false; + } + + private: + const hb_ot_map_t::lookup_map_t *lookups; + unsigned int count; + bool zero_context; +}; + #endif /* HB_OT_SHAPE_COMPLEX_INDIC_HH */ diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-complex-indic-machine.hh harfbuzz-2.6.2/src/hb-ot-shape-complex-indic-machine.hh --- harfbuzz-2.5.3/src/hb-ot-shape-complex-indic-machine.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-complex-indic-machine.hh 2019-10-26 02:02:55.000000000 +0000 @@ -395,13 +395,13 @@ HB_STMT_START { \ if (0) fprintf (stderr, "syllable %d..%d %s\n", ts, te, #syllable_type); \ for (unsigned int i = ts; i < te; i++) \ - info[i].syllable() = (syllable_serial << 4) | syllable_type; \ + info[i].syllable() = (syllable_serial << 4) | indic_##syllable_type; \ syllable_serial++; \ if (unlikely (syllable_serial == 16)) syllable_serial = 1; \ } HB_STMT_END static void -find_syllables (hb_buffer_t *buffer) +find_syllables_indic (hb_buffer_t *buffer) { unsigned int p, pe, eof, ts, te, act; int cs; @@ -569,4 +569,6 @@ } +#undef found_syllable + #endif /* HB_OT_SHAPE_COMPLEX_INDIC_MACHINE_HH */ diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-complex-indic-machine.rl harfbuzz-2.6.2/src/hb-ot-shape-complex-indic-machine.rl --- harfbuzz-2.5.3/src/hb-ot-shape-complex-indic-machine.rl 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-complex-indic-machine.rl 2019-10-26 02:02:55.000000000 +0000 @@ -96,13 +96,13 @@ HB_STMT_START { \ if (0) fprintf (stderr, "syllable %d..%d %s\n", ts, te, #syllable_type); \ for (unsigned int i = ts; i < te; i++) \ - info[i].syllable() = (syllable_serial << 4) | syllable_type; \ + info[i].syllable() = (syllable_serial << 4) | indic_##syllable_type; \ syllable_serial++; \ if (unlikely (syllable_serial == 16)) syllable_serial = 1; \ } HB_STMT_END static void -find_syllables (hb_buffer_t *buffer) +find_syllables_indic (hb_buffer_t *buffer) { unsigned int p, pe, eof, ts, te, act; int cs; @@ -121,4 +121,6 @@ }%% } +#undef found_syllable + #endif /* HB_OT_SHAPE_COMPLEX_INDIC_MACHINE_HH */ diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-complex-indic-table.cc harfbuzz-2.6.2/src/hb-ot-shape-complex-indic-table.cc --- harfbuzz-2.5.3/src/hb-ot-shape-complex-indic-table.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-complex-indic-table.cc 2019-10-26 02:02:55.000000000 +0000 @@ -14,63 +14,68 @@ * # Date: 2018-07-30, 19:40:00 GMT [KW] */ +#include "hb.hh" + +#ifndef HB_NO_OT_SHAPE + #include "hb-ot-shape-complex-indic.hh" #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-macros" -#define ISC_A INDIC_SYLLABIC_CATEGORY_AVAGRAHA /* 17 chars; Avagraha */ -#define ISC_Bi INDIC_SYLLABIC_CATEGORY_BINDU /* 86 chars; Bindu */ -#define ISC_BJN INDIC_SYLLABIC_CATEGORY_BRAHMI_JOINING_NUMBER /* 20 chars; Brahmi_Joining_Number */ -#define ISC_Ca INDIC_SYLLABIC_CATEGORY_CANTILLATION_MARK /* 59 chars; Cantillation_Mark */ -#define ISC_C INDIC_SYLLABIC_CATEGORY_CONSONANT /* 2160 chars; Consonant */ -#define ISC_CD INDIC_SYLLABIC_CATEGORY_CONSONANT_DEAD /* 12 chars; Consonant_Dead */ -#define ISC_CF INDIC_SYLLABIC_CATEGORY_CONSONANT_FINAL /* 67 chars; Consonant_Final */ -#define ISC_CHL INDIC_SYLLABIC_CATEGORY_CONSONANT_HEAD_LETTER /* 5 chars; Consonant_Head_Letter */ -#define ISC_CIP INDIC_SYLLABIC_CATEGORY_CONSONANT_INITIAL_POSTFIXED /* 1 chars; Consonant_Initial_Postfixed */ -#define ISC_CK INDIC_SYLLABIC_CATEGORY_CONSONANT_KILLER /* 2 chars; Consonant_Killer */ -#define ISC_CM INDIC_SYLLABIC_CATEGORY_CONSONANT_MEDIAL /* 29 chars; Consonant_Medial */ -#define ISC_CP INDIC_SYLLABIC_CATEGORY_CONSONANT_PLACEHOLDER /* 22 chars; Consonant_Placeholder */ -#define ISC_CPR INDIC_SYLLABIC_CATEGORY_CONSONANT_PRECEDING_REPHA /* 2 chars; Consonant_Preceding_Repha */ -#define ISC_CPrf INDIC_SYLLABIC_CATEGORY_CONSONANT_PREFIXED /* 9 chars; Consonant_Prefixed */ -#define ISC_CS INDIC_SYLLABIC_CATEGORY_CONSONANT_SUBJOINED /* 94 chars; Consonant_Subjoined */ -#define ISC_CSR INDIC_SYLLABIC_CATEGORY_CONSONANT_SUCCEEDING_REPHA /* 4 chars; Consonant_Succeeding_Repha */ -#define ISC_CWS INDIC_SYLLABIC_CATEGORY_CONSONANT_WITH_STACKER /* 6 chars; Consonant_With_Stacker */ -#define ISC_GM INDIC_SYLLABIC_CATEGORY_GEMINATION_MARK /* 3 chars; Gemination_Mark */ -#define ISC_IS INDIC_SYLLABIC_CATEGORY_INVISIBLE_STACKER /* 11 chars; Invisible_Stacker */ -#define ISC_ZWJ INDIC_SYLLABIC_CATEGORY_JOINER /* 1 chars; Joiner */ -#define ISC_ML INDIC_SYLLABIC_CATEGORY_MODIFYING_LETTER /* 1 chars; Modifying_Letter */ -#define ISC_ZWNJ INDIC_SYLLABIC_CATEGORY_NON_JOINER /* 1 chars; Non_Joiner */ -#define ISC_N INDIC_SYLLABIC_CATEGORY_NUKTA /* 30 chars; Nukta */ -#define ISC_Nd INDIC_SYLLABIC_CATEGORY_NUMBER /* 481 chars; Number */ -#define ISC_NJ INDIC_SYLLABIC_CATEGORY_NUMBER_JOINER /* 1 chars; Number_Joiner */ -#define ISC_x INDIC_SYLLABIC_CATEGORY_OTHER /* 1 chars; Other */ -#define ISC_PK INDIC_SYLLABIC_CATEGORY_PURE_KILLER /* 21 chars; Pure_Killer */ -#define ISC_RS INDIC_SYLLABIC_CATEGORY_REGISTER_SHIFTER /* 2 chars; Register_Shifter */ -#define ISC_SM INDIC_SYLLABIC_CATEGORY_SYLLABLE_MODIFIER /* 25 chars; Syllable_Modifier */ -#define ISC_TL INDIC_SYLLABIC_CATEGORY_TONE_LETTER /* 7 chars; Tone_Letter */ -#define ISC_TM INDIC_SYLLABIC_CATEGORY_TONE_MARK /* 42 chars; Tone_Mark */ -#define ISC_V INDIC_SYLLABIC_CATEGORY_VIRAMA /* 27 chars; Virama */ -#define ISC_Vs INDIC_SYLLABIC_CATEGORY_VISARGA /* 35 chars; Visarga */ -#define ISC_Vo INDIC_SYLLABIC_CATEGORY_VOWEL /* 30 chars; Vowel */ -#define ISC_M INDIC_SYLLABIC_CATEGORY_VOWEL_DEPENDENT /* 673 chars; Vowel_Dependent */ -#define ISC_VI INDIC_SYLLABIC_CATEGORY_VOWEL_INDEPENDENT /* 476 chars; Vowel_Independent */ - -#define IMC_B INDIC_MATRA_CATEGORY_BOTTOM /* 349 chars; Bottom */ -#define IMC_BL INDIC_MATRA_CATEGORY_BOTTOM_AND_LEFT /* 1 chars; Bottom_And_Left */ -#define IMC_BR INDIC_MATRA_CATEGORY_BOTTOM_AND_RIGHT /* 2 chars; Bottom_And_Right */ -#define IMC_L INDIC_MATRA_CATEGORY_LEFT /* 61 chars; Left */ -#define IMC_LR INDIC_MATRA_CATEGORY_LEFT_AND_RIGHT /* 21 chars; Left_And_Right */ -#define IMC_x INDIC_MATRA_CATEGORY_NOT_APPLICABLE /* 1 chars; Not_Applicable */ -#define IMC_O INDIC_MATRA_CATEGORY_OVERSTRUCK /* 10 chars; Overstruck */ -#define IMC_R INDIC_MATRA_CATEGORY_RIGHT /* 281 chars; Right */ -#define IMC_T INDIC_MATRA_CATEGORY_TOP /* 398 chars; Top */ -#define IMC_TB INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM /* 10 chars; Top_And_Bottom */ -#define IMC_TBR INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM_AND_RIGHT /* 1 chars; Top_And_Bottom_And_Right */ -#define IMC_TL INDIC_MATRA_CATEGORY_TOP_AND_LEFT /* 6 chars; Top_And_Left */ -#define IMC_TLR INDIC_MATRA_CATEGORY_TOP_AND_LEFT_AND_RIGHT /* 4 chars; Top_And_Left_And_Right */ -#define IMC_TR INDIC_MATRA_CATEGORY_TOP_AND_RIGHT /* 13 chars; Top_And_Right */ -#define IMC_VOL INDIC_MATRA_CATEGORY_VISUAL_ORDER_LEFT /* 19 chars; Visual_Order_Left */ +#define ISC_A INDIC_SYLLABIC_CATEGORY_AVAGRAHA /* 17 chars; Avagraha */ +#define ISC_Bi INDIC_SYLLABIC_CATEGORY_BINDU /* 86 chars; Bindu */ +#define ISC_BJN INDIC_SYLLABIC_CATEGORY_BRAHMI_JOINING_NUMBER /* 20 chars; Brahmi_Joining_Number */ +#define ISC_Ca INDIC_SYLLABIC_CATEGORY_CANTILLATION_MARK /* 59 chars; Cantillation_Mark */ +#define ISC_C INDIC_SYLLABIC_CATEGORY_CONSONANT /* 2160 chars; Consonant */ +#define ISC_CD INDIC_SYLLABIC_CATEGORY_CONSONANT_DEAD /* 12 chars; Consonant_Dead */ +#define ISC_CF INDIC_SYLLABIC_CATEGORY_CONSONANT_FINAL /* 67 chars; Consonant_Final */ +#define ISC_CHL INDIC_SYLLABIC_CATEGORY_CONSONANT_HEAD_LETTER /* 5 chars; Consonant_Head_Letter */ +#define ISC_CIP INDIC_SYLLABIC_CATEGORY_CONSONANT_INITIAL_POSTFIXED /* 1 chars; Consonant_Initial_Postfixed */ +#define ISC_CK INDIC_SYLLABIC_CATEGORY_CONSONANT_KILLER /* 2 chars; Consonant_Killer */ +#define ISC_CM INDIC_SYLLABIC_CATEGORY_CONSONANT_MEDIAL /* 29 chars; Consonant_Medial */ +#define ISC_CP INDIC_SYLLABIC_CATEGORY_CONSONANT_PLACEHOLDER /* 22 chars; Consonant_Placeholder */ +#define ISC_CPR INDIC_SYLLABIC_CATEGORY_CONSONANT_PRECEDING_REPHA /* 2 chars; Consonant_Preceding_Repha */ +#define ISC_CPrf INDIC_SYLLABIC_CATEGORY_CONSONANT_PREFIXED /* 9 chars; Consonant_Prefixed */ +#define ISC_CS INDIC_SYLLABIC_CATEGORY_CONSONANT_SUBJOINED /* 94 chars; Consonant_Subjoined */ +#define ISC_CSR INDIC_SYLLABIC_CATEGORY_CONSONANT_SUCCEEDING_REPHA /* 4 chars; Consonant_Succeeding_Repha */ +#define ISC_CWS INDIC_SYLLABIC_CATEGORY_CONSONANT_WITH_STACKER /* 6 chars; Consonant_With_Stacker */ +#define ISC_GM INDIC_SYLLABIC_CATEGORY_GEMINATION_MARK /* 3 chars; Gemination_Mark */ +#define ISC_IS INDIC_SYLLABIC_CATEGORY_INVISIBLE_STACKER /* 11 chars; Invisible_Stacker */ +#define ISC_ZWJ INDIC_SYLLABIC_CATEGORY_JOINER /* 1 chars; Joiner */ +#define ISC_ML INDIC_SYLLABIC_CATEGORY_MODIFYING_LETTER /* 1 chars; Modifying_Letter */ +#define ISC_ZWNJ INDIC_SYLLABIC_CATEGORY_NON_JOINER /* 1 chars; Non_Joiner */ +#define ISC_N INDIC_SYLLABIC_CATEGORY_NUKTA /* 30 chars; Nukta */ +#define ISC_Nd INDIC_SYLLABIC_CATEGORY_NUMBER /* 481 chars; Number */ +#define ISC_NJ INDIC_SYLLABIC_CATEGORY_NUMBER_JOINER /* 1 chars; Number_Joiner */ +#define ISC_x INDIC_SYLLABIC_CATEGORY_OTHER /* 1 chars; Other */ +#define ISC_PK INDIC_SYLLABIC_CATEGORY_PURE_KILLER /* 21 chars; Pure_Killer */ +#define ISC_RS INDIC_SYLLABIC_CATEGORY_REGISTER_SHIFTER /* 2 chars; Register_Shifter */ +#define ISC_SM INDIC_SYLLABIC_CATEGORY_SYLLABLE_MODIFIER /* 25 chars; Syllable_Modifier */ +#define ISC_TL INDIC_SYLLABIC_CATEGORY_TONE_LETTER /* 7 chars; Tone_Letter */ +#define ISC_TM INDIC_SYLLABIC_CATEGORY_TONE_MARK /* 42 chars; Tone_Mark */ +#define ISC_V INDIC_SYLLABIC_CATEGORY_VIRAMA /* 27 chars; Virama */ +#define ISC_Vs INDIC_SYLLABIC_CATEGORY_VISARGA /* 35 chars; Visarga */ +#define ISC_Vo INDIC_SYLLABIC_CATEGORY_VOWEL /* 30 chars; Vowel */ +#define ISC_M INDIC_SYLLABIC_CATEGORY_VOWEL_DEPENDENT /* 673 chars; Vowel_Dependent */ +#define ISC_VI INDIC_SYLLABIC_CATEGORY_VOWEL_INDEPENDENT /* 476 chars; Vowel_Independent */ + +#define IMC_B INDIC_MATRA_CATEGORY_BOTTOM /* 349 chars; Bottom */ +#define IMC_BL INDIC_MATRA_CATEGORY_BOTTOM_AND_LEFT /* 1 chars; Bottom_And_Left */ +#define IMC_BR INDIC_MATRA_CATEGORY_BOTTOM_AND_RIGHT /* 2 chars; Bottom_And_Right */ +#define IMC_L INDIC_MATRA_CATEGORY_LEFT /* 61 chars; Left */ +#define IMC_LR INDIC_MATRA_CATEGORY_LEFT_AND_RIGHT /* 21 chars; Left_And_Right */ +#define IMC_x INDIC_MATRA_CATEGORY_NOT_APPLICABLE /* 1 chars; Not_Applicable */ +#define IMC_O INDIC_MATRA_CATEGORY_OVERSTRUCK /* 10 chars; Overstruck */ +#define IMC_R INDIC_MATRA_CATEGORY_RIGHT /* 281 chars; Right */ +#define IMC_T INDIC_MATRA_CATEGORY_TOP /* 398 chars; Top */ +#define IMC_TB INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM /* 10 chars; Top_And_Bottom */ +#define IMC_TBR INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM_AND_RIGHT /* 1 chars; Top_And_Bottom_And_Right */ +#define IMC_TL INDIC_MATRA_CATEGORY_TOP_AND_LEFT /* 6 chars; Top_And_Left */ +#define IMC_TLR INDIC_MATRA_CATEGORY_TOP_AND_LEFT_AND_RIGHT /* 4 chars; Top_And_Left_And_Right */ +#define IMC_TR INDIC_MATRA_CATEGORY_TOP_AND_RIGHT /* 13 chars; Top_And_Right */ +#define IMC_VOL INDIC_MATRA_CATEGORY_VISUAL_ORDER_LEFT /* 19 chars; Visual_Order_Left */ + #pragma GCC diagnostic pop #define _(S,M) INDIC_COMBINE_CATEGORIES (ISC_##S, IMC_##M) @@ -435,6 +440,7 @@ } #undef _ + #undef ISC_A #undef ISC_Bi #undef ISC_BJN @@ -471,6 +477,7 @@ #undef ISC_Vo #undef ISC_M #undef ISC_VI + #undef IMC_B #undef IMC_BL #undef IMC_BR @@ -487,4 +494,6 @@ #undef IMC_TR #undef IMC_VOL +#endif + /* == End of generated table == */ diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-complex-khmer.cc harfbuzz-2.6.2/src/hb-ot-shape-complex-khmer.cc --- harfbuzz-2.5.3/src/hb-ot-shape-complex-khmer.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-complex-khmer.cc 2019-10-26 02:02:55.000000000 +0000 @@ -24,6 +24,10 @@ * Google Author(s): Behdad Esfahbod */ +#include "hb.hh" + +#ifndef HB_NO_OT_SHAPE + #include "hb-ot-shape-complex-khmer.hh" #include "hb-ot-layout.hh" @@ -52,50 +56,35 @@ {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('d','i','s','t'), F_GLOBAL}, - {HB_TAG('a','b','v','m'), F_GLOBAL}, - {HB_TAG('b','l','w','m'), F_GLOBAL}, }; /* * Must be in the same order as the khmer_features array. */ enum { - PREF, - BLWF, - ABVF, - PSTF, - CFAR, - - _PRES, - _ABVS, - _BLWS, - _PSTS, - - _DIST, - _ABVM, - _BLWM, + KHMER_PREF, + KHMER_BLWF, + KHMER_ABVF, + KHMER_PSTF, + KHMER_CFAR, + + _KHMER_PRES, + _KHMER_ABVS, + _KHMER_BLWS, + _KHMER_PSTS, KHMER_NUM_FEATURES, - KHMER_BASIC_FEATURES = _PRES, /* Don't forget to update this! */ + KHMER_BASIC_FEATURES = _KHMER_PRES, /* Don't forget to update this! */ }; static void -setup_syllables (const hb_ot_shape_plan_t *plan, - hb_font_t *font, - hb_buffer_t *buffer); -static void -reorder (const hb_ot_shape_plan_t *plan, - hb_font_t *font, - hb_buffer_t *buffer); +setup_syllables_khmer (const hb_ot_shape_plan_t *plan, + hb_font_t *font, + hb_buffer_t *buffer); static void -clear_syllables (const hb_ot_shape_plan_t *plan, - hb_font_t *font, - hb_buffer_t *buffer); +reorder_khmer (const hb_ot_shape_plan_t *plan, + hb_font_t *font, + hb_buffer_t *buffer); static void collect_features_khmer (hb_ot_shape_planner_t *plan) @@ -103,8 +92,8 @@ hb_ot_map_builder_t *map = &plan->map; /* Do this before any lookups have been applied. */ - map->add_gsub_pause (setup_syllables); - map->add_gsub_pause (reorder); + map->add_gsub_pause (setup_syllables_khmer); + map->add_gsub_pause (reorder_khmer); /* Testing suggests that Uniscribe does NOT pause between basic * features. Test with KhmerUI.ttf and the following three @@ -123,7 +112,7 @@ for (; i < KHMER_BASIC_FEATURES; i++) map->add_feature (khmer_features[i]); - map->add_gsub_pause (clear_syllables); + map->add_gsub_pause (_hb_clear_syllables); for (; i < KHMER_NUM_FEATURES; i++) map->add_feature (khmer_features[i]); @@ -149,32 +138,6 @@ } -struct would_substitute_feature_t -{ - void init (const hb_ot_map_t *map, hb_tag_t feature_tag, bool zero_context_) - { - zero_context = zero_context_; - map->get_stage_lookups (0/*GSUB*/, - map->get_feature_stage (0/*GSUB*/, feature_tag), - &lookups, &count); - } - - bool would_substitute (const hb_codepoint_t *glyphs, - unsigned int glyphs_count, - hb_face_t *face) const - { - for (unsigned int i = 0; i < count; i++) - if (hb_ot_layout_lookup_would_substitute (face, lookups[i].index, glyphs, glyphs_count, zero_context)) - return true; - return false; - } - - private: - const hb_ot_map_t::lookup_map_t *lookups; - unsigned int count; - bool zero_context; -}; - struct khmer_shape_plan_t { bool get_virama_glyph (hb_font_t *font, hb_codepoint_t *pglyph) const @@ -198,7 +161,7 @@ mutable hb_codepoint_t virama_glyph; - would_substitute_feature_t pref; + hb_indic_would_substitute_feature_t pref; hb_mask_t mask_array[KHMER_NUM_FEATURES]; }; @@ -228,10 +191,10 @@ } -enum syllable_type_t { - consonant_syllable, - broken_cluster, - non_khmer_cluster, +enum khmer_syllable_type_t { + khmer_consonant_syllable, + khmer_broken_cluster, + khmer_non_khmer_cluster, }; #include "hb-ot-shape-complex-khmer-machine.hh" @@ -253,11 +216,11 @@ } static void -setup_syllables (const hb_ot_shape_plan_t *plan HB_UNUSED, - hb_font_t *font HB_UNUSED, - hb_buffer_t *buffer) +setup_syllables_khmer (const hb_ot_shape_plan_t *plan HB_UNUSED, + hb_font_t *font HB_UNUSED, + hb_buffer_t *buffer) { - find_syllables (buffer); + find_syllables_khmer (buffer); foreach_syllable (buffer, start, end) buffer->unsafe_to_break (start, end); } @@ -278,7 +241,9 @@ /* Setup masks. */ { /* Post-base */ - hb_mask_t mask = khmer_plan->mask_array[BLWF] | khmer_plan->mask_array[ABVF] | khmer_plan->mask_array[PSTF]; + hb_mask_t mask = khmer_plan->mask_array[KHMER_BLWF] | + khmer_plan->mask_array[KHMER_ABVF] | + khmer_plan->mask_array[KHMER_PSTF]; for (unsigned int i = start + 1; i < end; i++) info[i].mask |= mask; } @@ -305,7 +270,7 @@ if (info[i + 1].khmer_category() == OT_Ra) { for (unsigned int j = 0; j < 2; j++) - info[i + j].mask |= khmer_plan->mask_array[PREF]; + info[i + j].mask |= khmer_plan->mask_array[KHMER_PREF]; /* Move the Coeng,Ro sequence to the start. */ buffer->merge_clusters (start, i + 2); @@ -321,9 +286,9 @@ * U+1784,U+17D2,U+179A,U+17D2,U+1782 * U+1784,U+17D2,U+1782,U+17D2,U+179A */ - if (khmer_plan->mask_array[CFAR]) + if (khmer_plan->mask_array[KHMER_CFAR]) for (unsigned int j = i + 2; j < end; j++) - info[j].mask |= khmer_plan->mask_array[CFAR]; + info[j].mask |= khmer_plan->mask_array[KHMER_CFAR]; num_coengs = 2; /* Done. */ } @@ -342,28 +307,28 @@ } static void -initial_reordering_syllable (const hb_ot_shape_plan_t *plan, - hb_face_t *face, - hb_buffer_t *buffer, - unsigned int start, unsigned int end) +reorder_syllable_khmer (const hb_ot_shape_plan_t *plan, + hb_face_t *face, + hb_buffer_t *buffer, + unsigned int start, unsigned int end) { - syllable_type_t syllable_type = (syllable_type_t) (buffer->info[start].syllable() & 0x0F); + khmer_syllable_type_t syllable_type = (khmer_syllable_type_t) (buffer->info[start].syllable() & 0x0F); switch (syllable_type) { - case broken_cluster: /* We already inserted dotted-circles, so just call the consonant_syllable. */ - case consonant_syllable: + case khmer_broken_cluster: /* We already inserted dotted-circles, so just call the consonant_syllable. */ + case khmer_consonant_syllable: reorder_consonant_syllable (plan, face, buffer, start, end); break; - case non_khmer_cluster: + case khmer_non_khmer_cluster: break; } } static inline void -insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED, - hb_font_t *font, - hb_buffer_t *buffer) +insert_dotted_circles_khmer (const hb_ot_shape_plan_t *plan HB_UNUSED, + hb_font_t *font, + hb_buffer_t *buffer) { if (unlikely (buffer->flags & HB_BUFFER_FLAG_DO_NOT_INSERT_DOTTED_CIRCLE)) return; @@ -374,7 +339,7 @@ unsigned int count = buffer->len; hb_glyph_info_t *info = buffer->info; for (unsigned int i = 0; i < count; i++) - if ((info[i].syllable() & 0x0F) == broken_cluster) + if ((info[i].syllable() & 0x0F) == khmer_broken_cluster) { has_broken_syllables = true; break; @@ -399,8 +364,8 @@ while (buffer->idx < buffer->len && buffer->successful) { unsigned int syllable = buffer->cur().syllable(); - syllable_type_t syllable_type = (syllable_type_t) (syllable & 0x0F); - if (unlikely (last_syllable != syllable && syllable_type == broken_cluster)) + khmer_syllable_type_t syllable_type = (khmer_syllable_type_t) (syllable & 0x0F); + if (unlikely (last_syllable != syllable && syllable_type == khmer_broken_cluster)) { last_syllable = syllable; @@ -413,7 +378,7 @@ while (buffer->idx < buffer->len && buffer->successful && last_syllable == buffer->cur().syllable() && buffer->cur().khmer_category() == OT_Repha) - buffer->next_glyph (); + buffer->next_glyph (); buffer->output_info (ginfo); } @@ -424,29 +389,18 @@ } static void -reorder (const hb_ot_shape_plan_t *plan, - hb_font_t *font, - hb_buffer_t *buffer) +reorder_khmer (const hb_ot_shape_plan_t *plan, + hb_font_t *font, + hb_buffer_t *buffer) { - insert_dotted_circles (plan, font, buffer); + insert_dotted_circles_khmer (plan, font, buffer); foreach_syllable (buffer, start, end) - initial_reordering_syllable (plan, font->face, buffer, start, end); + reorder_syllable_khmer (plan, font->face, buffer, start, end); HB_BUFFER_DEALLOCATE_VAR (buffer, khmer_category); } -static void -clear_syllables (const hb_ot_shape_plan_t *plan HB_UNUSED, - hb_font_t *font HB_UNUSED, - hb_buffer_t *buffer) -{ - hb_glyph_info_t *info = buffer->info; - unsigned int count = buffer->len; - for (unsigned int i = 0; i < count; i++) - info[i].syllable() = 0; -} - static bool decompose_khmer (const hb_ot_shape_normalize_context_t *c, @@ -502,3 +456,6 @@ HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE, false, /* fallback_position */ }; + + +#endif diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-complex-khmer.hh harfbuzz-2.6.2/src/hb-ot-shape-complex-khmer.hh --- harfbuzz-2.5.3/src/hb-ot-shape-complex-khmer.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-complex-khmer.hh 2019-10-26 02:02:55.000000000 +0000 @@ -43,11 +43,10 @@ OT_Robatic = 20, OT_Xgroup = 21, OT_Ygroup = 22, - - OT_VAbv = 26, - OT_VBlw = 27, - OT_VPre = 28, - OT_VPst = 29, + //OT_VAbv = 26, + //OT_VBlw = 27, + //OT_VPre = 28, + //OT_VPst = 29, }; static inline void @@ -100,10 +99,10 @@ if (cat == (khmer_category_t) OT_M) switch ((int) pos) { - case POS_PRE_C: cat = OT_VPre; break; - case POS_BELOW_C: cat = OT_VBlw; break; - case POS_ABOVE_C: cat = OT_VAbv; break; - case POS_POST_C: cat = OT_VPst; break; + case POS_PRE_C: cat = (khmer_category_t) OT_VPre; break; + case POS_BELOW_C: cat = (khmer_category_t) OT_VBlw; break; + case POS_ABOVE_C: cat = (khmer_category_t) OT_VAbv; break; + case POS_POST_C: cat = (khmer_category_t) OT_VPst; break; default: assert (0); } diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-complex-khmer-machine.hh harfbuzz-2.6.2/src/hb-ot-shape-complex-khmer-machine.hh --- harfbuzz-2.5.3/src/hb-ot-shape-complex-khmer-machine.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-complex-khmer-machine.hh 2019-10-26 02:02:55.000000000 +0000 @@ -226,13 +226,13 @@ HB_STMT_START { \ if (0) fprintf (stderr, "syllable %d..%d %s\n", ts, te, #syllable_type); \ for (unsigned int i = ts; i < te; i++) \ - info[i].syllable() = (syllable_serial << 4) | syllable_type; \ + info[i].syllable() = (syllable_serial << 4) | khmer_##syllable_type; \ syllable_serial++; \ if (unlikely (syllable_serial == 16)) syllable_serial = 1; \ } HB_STMT_END static void -find_syllables (hb_buffer_t *buffer) +find_syllables_khmer (hb_buffer_t *buffer) { unsigned int p, pe, eof, ts, te, act HB_UNUSED; int cs; @@ -367,4 +367,6 @@ } +#undef found_syllable + #endif /* HB_OT_SHAPE_COMPLEX_KHMER_MACHINE_HH */ diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-complex-khmer-machine.rl harfbuzz-2.6.2/src/hb-ot-shape-complex-khmer-machine.rl --- harfbuzz-2.5.3/src/hb-ot-shape-complex-khmer-machine.rl 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-complex-khmer-machine.rl 2019-10-26 02:02:55.000000000 +0000 @@ -83,13 +83,13 @@ HB_STMT_START { \ if (0) fprintf (stderr, "syllable %d..%d %s\n", ts, te, #syllable_type); \ for (unsigned int i = ts; i < te; i++) \ - info[i].syllable() = (syllable_serial << 4) | syllable_type; \ + info[i].syllable() = (syllable_serial << 4) | khmer_##syllable_type; \ syllable_serial++; \ if (unlikely (syllable_serial == 16)) syllable_serial = 1; \ } HB_STMT_END static void -find_syllables (hb_buffer_t *buffer) +find_syllables_khmer (hb_buffer_t *buffer) { unsigned int p, pe, eof, ts, te, act HB_UNUSED; int cs; @@ -108,4 +108,6 @@ }%% } +#undef found_syllable + #endif /* HB_OT_SHAPE_COMPLEX_KHMER_MACHINE_HH */ diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-complex-myanmar.cc harfbuzz-2.6.2/src/hb-ot-shape-complex-myanmar.cc --- harfbuzz-2.5.3/src/hb-ot-shape-complex-myanmar.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-complex-myanmar.cc 2019-10-26 02:02:55.000000000 +0000 @@ -24,6 +24,10 @@ * Google Author(s): Behdad Esfahbod */ +#include "hb.hh" + +#ifndef HB_NO_OT_SHAPE + #include "hb-ot-shape-complex-myanmar.hh" @@ -32,7 +36,7 @@ */ static const hb_tag_t -basic_features[] = +myanmar_basic_features[] = { /* * Basic features. @@ -44,7 +48,7 @@ HB_TAG('p','s','t','f'), }; static const hb_tag_t -other_features[] = +myanmar_other_features[] = { /* * Other features. @@ -55,36 +59,13 @@ HB_TAG('b','l','w','s'), HB_TAG('p','s','t','s'), }; -static const hb_tag_t -positioning_features[] = -{ - /* - * Positioning features. - * We don't care about the types. - */ - HB_TAG('d','i','s','t'), - /* 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 (const hb_ot_shape_plan_t *plan, - hb_font_t *font, - hb_buffer_t *buffer); -static void -reorder (const hb_ot_shape_plan_t *plan, - hb_font_t *font, - hb_buffer_t *buffer); +setup_syllables_myanmar (const hb_ot_shape_plan_t *plan, + hb_font_t *font, + hb_buffer_t *buffer); static void -clear_syllables (const hb_ot_shape_plan_t *plan, +reorder_myanmar (const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer); @@ -94,7 +75,7 @@ hb_ot_map_builder_t *map = &plan->map; /* Do this before any lookups have been applied. */ - map->add_gsub_pause (setup_syllables); + map->add_gsub_pause (setup_syllables_myanmar); map->enable_feature (HB_TAG('l','o','c','l')); /* The Indic specs do not require ccmp, but we apply it here since if @@ -102,21 +83,18 @@ map->enable_feature (HB_TAG('c','c','m','p')); - map->add_gsub_pause (reorder); + map->add_gsub_pause (reorder_myanmar); - for (unsigned int i = 0; i < ARRAY_LENGTH (basic_features); i++) + for (unsigned int i = 0; i < ARRAY_LENGTH (myanmar_basic_features); i++) { - map->enable_feature (basic_features[i], F_MANUAL_ZWJ); + map->enable_feature (myanmar_basic_features[i], F_MANUAL_ZWJ); map->add_gsub_pause (nullptr); } - map->add_gsub_pause (clear_syllables); - - for (unsigned int i = 0; i < ARRAY_LENGTH (other_features); i++) - map->enable_feature (other_features[i], F_MANUAL_ZWJ); + map->add_gsub_pause (_hb_clear_syllables); - for (unsigned int i = 0; i < ARRAY_LENGTH (positioning_features); i++) - map->enable_feature (positioning_features[i]); + for (unsigned int i = 0; i < ARRAY_LENGTH (myanmar_other_features); i++) + map->enable_feature (myanmar_other_features[i], F_MANUAL_ZWJ); } static void @@ -126,11 +104,11 @@ } -enum syllable_type_t { - consonant_syllable, - punctuation_cluster, - broken_cluster, - non_myanmar_cluster, +enum myanmar_syllable_type_t { + myanmar_consonant_syllable, + myanmar_punctuation_cluster, + myanmar_broken_cluster, + myanmar_non_myanmar_cluster, }; #include "hb-ot-shape-complex-myanmar-machine.hh" @@ -154,11 +132,11 @@ } static void -setup_syllables (const hb_ot_shape_plan_t *plan HB_UNUSED, - hb_font_t *font HB_UNUSED, - hb_buffer_t *buffer) +setup_syllables_myanmar (const hb_ot_shape_plan_t *plan HB_UNUSED, + hb_font_t *font HB_UNUSED, + hb_buffer_t *buffer) { - find_syllables (buffer); + find_syllables_myanmar (buffer); foreach_syllable (buffer, start, end) buffer->unsafe_to_break (start, end); } @@ -261,7 +239,7 @@ } if (pos == POS_BELOW_C && info[i].myanmar_category() != OT_A) { - pos = POS_AFTER_SUB; + pos = POS_AFTER_SUB; info[i].myanmar_position() = pos; continue; } @@ -274,29 +252,29 @@ } static void -initial_reordering_syllable (const hb_ot_shape_plan_t *plan HB_UNUSED, - hb_face_t *face HB_UNUSED, - hb_buffer_t *buffer, - unsigned int start, unsigned int end) +reorder_syllable_myanmar (const hb_ot_shape_plan_t *plan HB_UNUSED, + hb_face_t *face HB_UNUSED, + hb_buffer_t *buffer, + unsigned int start, unsigned int end) { - syllable_type_t syllable_type = (syllable_type_t) (buffer->info[start].syllable() & 0x0F); + myanmar_syllable_type_t syllable_type = (myanmar_syllable_type_t) (buffer->info[start].syllable() & 0x0F); switch (syllable_type) { - case broken_cluster: /* We already inserted dotted-circles, so just call the consonant_syllable. */ - case consonant_syllable: + case myanmar_broken_cluster: /* We already inserted dotted-circles, so just call the consonant_syllable. */ + case myanmar_consonant_syllable: initial_reordering_consonant_syllable (buffer, start, end); break; - case punctuation_cluster: - case non_myanmar_cluster: + case myanmar_punctuation_cluster: + case myanmar_non_myanmar_cluster: break; } } static inline void -insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED, - hb_font_t *font, - hb_buffer_t *buffer) +insert_dotted_circles_myanmar (const hb_ot_shape_plan_t *plan HB_UNUSED, + hb_font_t *font, + hb_buffer_t *buffer) { if (unlikely (buffer->flags & HB_BUFFER_FLAG_DO_NOT_INSERT_DOTTED_CIRCLE)) return; @@ -307,7 +285,7 @@ unsigned int count = buffer->len; hb_glyph_info_t *info = buffer->info; for (unsigned int i = 0; i < count; i++) - if ((info[i].syllable() & 0x0F) == broken_cluster) + if ((info[i].syllable() & 0x0F) == myanmar_broken_cluster) { has_broken_syllables = true; break; @@ -332,8 +310,8 @@ while (buffer->idx < buffer->len && buffer->successful) { unsigned int syllable = buffer->cur().syllable(); - syllable_type_t syllable_type = (syllable_type_t) (syllable & 0x0F); - if (unlikely (last_syllable != syllable && syllable_type == broken_cluster)) + myanmar_syllable_type_t syllable_type = (myanmar_syllable_type_t) (syllable & 0x0F); + if (unlikely (last_syllable != syllable && syllable_type == myanmar_broken_cluster)) { last_syllable = syllable; @@ -351,30 +329,19 @@ } static void -reorder (const hb_ot_shape_plan_t *plan, - hb_font_t *font, - hb_buffer_t *buffer) +reorder_myanmar (const hb_ot_shape_plan_t *plan, + hb_font_t *font, + hb_buffer_t *buffer) { - insert_dotted_circles (plan, font, buffer); + insert_dotted_circles_myanmar (plan, font, buffer); foreach_syllable (buffer, start, end) - initial_reordering_syllable (plan, font->face, buffer, start, end); + reorder_syllable_myanmar (plan, font->face, buffer, start, end); HB_BUFFER_DEALLOCATE_VAR (buffer, myanmar_category); HB_BUFFER_DEALLOCATE_VAR (buffer, myanmar_position); } -static void -clear_syllables (const hb_ot_shape_plan_t *plan HB_UNUSED, - hb_font_t *font HB_UNUSED, - hb_buffer_t *buffer) -{ - hb_glyph_info_t *info = buffer->info; - unsigned int count = buffer->len; - for (unsigned int i = 0; i < count; i++) - info[i].syllable() = 0; -} - const hb_ot_complex_shaper_t _hb_ot_complex_shaper_myanmar = { @@ -415,3 +382,6 @@ HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE, false, /* fallback_position */ }; + + +#endif diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-complex-myanmar.hh harfbuzz-2.6.2/src/hb-ot-shape-complex-myanmar.hh --- harfbuzz-2.5.3/src/hb-ot-shape-complex-myanmar.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-complex-myanmar.hh 2019-10-26 02:02:55.000000000 +0000 @@ -49,10 +49,10 @@ OT_MW = 23, /* Various consonant medial types */ OT_MY = 24, /* Various consonant medial types */ OT_PT = 25, /* Pwo and other tones */ - OT_VAbv = 26, - OT_VBlw = 27, - OT_VPre = 28, - OT_VPst = 29, + //OT_VAbv = 26, + //OT_VBlw = 27, + //OT_VPre = 28, + //OT_VPst = 29, OT_VS = 30, /* Variation selectors */ OT_P = 31, /* Punctuation */ OT_D = 32, /* Digits except zero */ @@ -155,11 +155,11 @@ { switch ((int) pos) { - case POS_PRE_C: cat = OT_VPre; + case POS_PRE_C: cat = (myanmar_category_t) OT_VPre; pos = POS_PRE_M; break; - case POS_ABOVE_C: cat = OT_VAbv; break; - case POS_BELOW_C: cat = OT_VBlw; break; - case POS_POST_C: cat = OT_VPst; break; + case POS_ABOVE_C: cat = (myanmar_category_t) OT_VAbv; break; + case POS_BELOW_C: cat = (myanmar_category_t) OT_VBlw; break; + case POS_POST_C: cat = (myanmar_category_t) OT_VPst; break; } } diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-complex-myanmar-machine.hh harfbuzz-2.6.2/src/hb-ot-shape-complex-myanmar-machine.hh --- harfbuzz-2.5.3/src/hb-ot-shape-complex-myanmar-machine.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-complex-myanmar-machine.hh 2019-10-26 02:02:55.000000000 +0000 @@ -304,13 +304,13 @@ HB_STMT_START { \ if (0) fprintf (stderr, "syllable %d..%d %s\n", ts, te, #syllable_type); \ for (unsigned int i = ts; i < te; i++) \ - info[i].syllable() = (syllable_serial << 4) | syllable_type; \ + info[i].syllable() = (syllable_serial << 4) | myanmar_##syllable_type; \ syllable_serial++; \ if (unlikely (syllable_serial == 16)) syllable_serial = 1; \ } HB_STMT_END static void -find_syllables (hb_buffer_t *buffer) +find_syllables_myanmar (hb_buffer_t *buffer) { unsigned int p, pe, eof, ts, te, act HB_UNUSED; int cs; diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-complex-myanmar-machine.rl harfbuzz-2.6.2/src/hb-ot-shape-complex-myanmar-machine.rl --- harfbuzz-2.5.3/src/hb-ot-shape-complex-myanmar-machine.rl 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-complex-myanmar-machine.rl 2019-10-26 02:02:55.000000000 +0000 @@ -97,13 +97,13 @@ HB_STMT_START { \ if (0) fprintf (stderr, "syllable %d..%d %s\n", ts, te, #syllable_type); \ for (unsigned int i = ts; i < te; i++) \ - info[i].syllable() = (syllable_serial << 4) | syllable_type; \ + info[i].syllable() = (syllable_serial << 4) | myanmar_##syllable_type; \ syllable_serial++; \ if (unlikely (syllable_serial == 16)) syllable_serial = 1; \ } HB_STMT_END static void -find_syllables (hb_buffer_t *buffer) +find_syllables_myanmar (hb_buffer_t *buffer) { unsigned int p, pe, eof, ts, te, act HB_UNUSED; int cs; diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-complex-thai.cc harfbuzz-2.6.2/src/hb-ot-shape-complex-thai.cc --- harfbuzz-2.5.3/src/hb-ot-shape-complex-thai.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-complex-thai.cc 2019-10-26 02:02:55.000000000 +0000 @@ -24,6 +24,10 @@ * Google Author(s): Behdad Esfahbod */ +#include "hb.hh" + +#ifndef HB_NO_OT_SHAPE + #include "hb-ot-shape-complex.hh" @@ -385,3 +389,6 @@ HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE, false,/* fallback_position */ }; + + +#endif diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-complex-use.cc harfbuzz-2.6.2/src/hb-ot-shape-complex-use.cc --- harfbuzz-2.5.3/src/hb-ot-shape-complex-use.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-complex-use.cc 2019-10-26 02:02:55.000000000 +0000 @@ -26,6 +26,10 @@ * Google Author(s): Behdad Esfahbod */ +#include "hb.hh" + +#ifndef HB_NO_OT_SHAPE + #include "hb-ot-shape-complex-use.hh" #include "hb-ot-shape-complex-arabic.hh" #include "hb-ot-shape-complex-vowel-constraints.hh" @@ -40,7 +44,7 @@ */ static const hb_tag_t -basic_features[] = +use_basic_features[] = { /* * Basic features. @@ -55,28 +59,23 @@ HB_TAG('c','j','c','t'), }; static const hb_tag_t -arabic_features[] = +use_topographical_features[] = { HB_TAG('i','s','o','l'), HB_TAG('i','n','i','t'), HB_TAG('m','e','d','i'), HB_TAG('f','i','n','a'), - /* The spec doesn't specify these but we apply anyway, since our Arabic shaper - * does. These are only used in Syriac spec. */ - HB_TAG('m','e','d','2'), - HB_TAG('f','i','n','2'), - HB_TAG('f','i','n','3'), }; -/* Same order as arabic_features. Don't need Syriac stuff.*/ +/* Same order as use_topographical_features. */ enum joining_form_t { - ISOL, - INIT, - MEDI, - FINA, - _NONE + USE_ISOL, + USE_INIT, + USE_MEDI, + USE_FINA, + _USE_NONE }; static const hb_tag_t -other_features[] = +use_other_features[] = { /* * Other features. @@ -89,42 +88,23 @@ HB_TAG('p','r','e','s'), HB_TAG('p','s','t','s'), }; -static const hb_tag_t -positioning_features[] = -{ - /* - * Positioning features. - * We don't care about the types. - */ - HB_TAG('d','i','s','t'), - HB_TAG('a','b','v','m'), - HB_TAG('b','l','w','m'), -}; static void -setup_syllables (const hb_ot_shape_plan_t *plan, +setup_syllables_use (const hb_ot_shape_plan_t *plan, + hb_font_t *font, + hb_buffer_t *buffer); +static void +record_rphf_use (const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer); static void -clear_substitution_flags (const hb_ot_shape_plan_t *plan, - hb_font_t *font, - hb_buffer_t *buffer); -static void -record_rphf (const hb_ot_shape_plan_t *plan, - hb_font_t *font, - hb_buffer_t *buffer); +record_pref_use (const hb_ot_shape_plan_t *plan, + hb_font_t *font, + hb_buffer_t *buffer); static void -record_pref (const hb_ot_shape_plan_t *plan, +reorder_use (const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer); -static void -reorder (const hb_ot_shape_plan_t *plan, - hb_font_t *font, - hb_buffer_t *buffer); -static void -clear_syllables (const hb_ot_shape_plan_t *plan, - hb_font_t *font, - hb_buffer_t *buffer); static void collect_features_use (hb_ot_shape_planner_t *plan) @@ -132,7 +112,7 @@ hb_ot_map_builder_t *map = &plan->map; /* Do this before any lookups have been applied. */ - map->add_gsub_pause (setup_syllables); + map->add_gsub_pause (setup_syllables_use); /* "Default glyph pre-processing group" */ map->enable_feature (HB_TAG('l','o','c','l')); @@ -141,32 +121,28 @@ map->enable_feature (HB_TAG('a','k','h','n'), F_MANUAL_ZWJ); /* "Reordering group" */ - map->add_gsub_pause (clear_substitution_flags); + map->add_gsub_pause (_hb_clear_substitution_flags); map->add_feature (HB_TAG('r','p','h','f'), F_MANUAL_ZWJ); - map->add_gsub_pause (record_rphf); - map->add_gsub_pause (clear_substitution_flags); + map->add_gsub_pause (record_rphf_use); + map->add_gsub_pause (_hb_clear_substitution_flags); map->enable_feature (HB_TAG('p','r','e','f'), F_MANUAL_ZWJ); - map->add_gsub_pause (record_pref); + map->add_gsub_pause (record_pref_use); /* "Orthographic unit shaping group" */ - for (unsigned int i = 0; i < ARRAY_LENGTH (basic_features); i++) - map->enable_feature (basic_features[i], F_MANUAL_ZWJ); + for (unsigned int i = 0; i < ARRAY_LENGTH (use_basic_features); i++) + map->enable_feature (use_basic_features[i], F_MANUAL_ZWJ); - map->add_gsub_pause (reorder); - map->add_gsub_pause (clear_syllables); + map->add_gsub_pause (reorder_use); + map->add_gsub_pause (_hb_clear_syllables); /* "Topographical features" */ - for (unsigned int i = 0; i < ARRAY_LENGTH (arabic_features); i++) - map->add_feature (arabic_features[i]); + for (unsigned int i = 0; i < ARRAY_LENGTH (use_topographical_features); i++) + map->add_feature (use_topographical_features[i]); map->add_gsub_pause (nullptr); /* "Standard typographic presentation" */ - for (unsigned int i = 0; i < ARRAY_LENGTH (other_features); i++) - map->enable_feature (other_features[i], F_MANUAL_ZWJ); - - /* "Positional feature application" */ - for (unsigned int i = 0; i < ARRAY_LENGTH (positioning_features); i++) - map->enable_feature (positioning_features[i]); + for (unsigned int i = 0; i < ARRAY_LENGTH (use_other_features); i++) + map->enable_feature (use_other_features[i], F_MANUAL_ZWJ); } struct use_shape_plan_t @@ -243,16 +219,16 @@ free (data); } -enum syllable_type_t { - independent_cluster, - virama_terminated_cluster, - sakot_terminated_cluster, - standard_cluster, - number_joiner_terminated_cluster, - numeral_cluster, - symbol_cluster, - broken_cluster, - non_cluster, +enum use_syllable_type_t { + use_independent_cluster, + use_virama_terminated_cluster, + use_sakot_terminated_cluster, + use_standard_cluster, + use_number_joiner_terminated_cluster, + use_numeral_cluster, + use_symbol_cluster, + use_broken_cluster, + use_non_cluster, }; #include "hb-ot-shape-complex-use-machine.hh" @@ -309,11 +285,11 @@ if (use_plan->arabic_plan) return; - static_assert ((INIT < 4 && ISOL < 4 && MEDI < 4 && FINA < 4), ""); + static_assert ((USE_INIT < 4 && USE_ISOL < 4 && USE_MEDI < 4 && USE_FINA < 4), ""); hb_mask_t masks[4], all_masks = 0; for (unsigned int i = 0; i < 4; i++) { - masks[i] = plan->map.get_1_mask (arabic_features[i]); + masks[i] = plan->map.get_1_mask (use_topographical_features[i]); if (masks[i] == plan->map.get_global_mask ()) masks[i] = 0; all_masks |= masks[i]; @@ -323,39 +299,39 @@ hb_mask_t other_masks = ~all_masks; unsigned int last_start = 0; - joining_form_t last_form = _NONE; + joining_form_t last_form = _USE_NONE; hb_glyph_info_t *info = buffer->info; foreach_syllable (buffer, start, end) { - syllable_type_t syllable_type = (syllable_type_t) (info[start].syllable() & 0x0F); + use_syllable_type_t syllable_type = (use_syllable_type_t) (info[start].syllable() & 0x0F); switch (syllable_type) { - case independent_cluster: - case symbol_cluster: - case non_cluster: + case use_independent_cluster: + case use_symbol_cluster: + case use_non_cluster: /* These don't join. Nothing to do. */ - last_form = _NONE; + last_form = _USE_NONE; break; - case virama_terminated_cluster: - case sakot_terminated_cluster: - case standard_cluster: - case number_joiner_terminated_cluster: - case numeral_cluster: - case broken_cluster: + case use_virama_terminated_cluster: + case use_sakot_terminated_cluster: + case use_standard_cluster: + case use_number_joiner_terminated_cluster: + case use_numeral_cluster: + case use_broken_cluster: - bool join = last_form == FINA || last_form == ISOL; + bool join = last_form == USE_FINA || last_form == USE_ISOL; if (join) { /* Fixup previous syllable's form. */ - last_form = last_form == FINA ? MEDI : INIT; + last_form = last_form == USE_FINA ? USE_MEDI : USE_INIT; for (unsigned int i = last_start; i < start; i++) info[i].mask = (info[i].mask & other_masks) | masks[last_form]; } /* Form for this syllable. */ - last_form = join ? FINA : ISOL; + last_form = join ? USE_FINA : USE_ISOL; for (unsigned int i = start; i < end; i++) info[i].mask = (info[i].mask & other_masks) | masks[last_form]; @@ -367,11 +343,11 @@ } static void -setup_syllables (const hb_ot_shape_plan_t *plan, - hb_font_t *font HB_UNUSED, - hb_buffer_t *buffer) +setup_syllables_use (const hb_ot_shape_plan_t *plan, + hb_font_t *font HB_UNUSED, + hb_buffer_t *buffer) { - find_syllables (buffer); + find_syllables_use (buffer); foreach_syllable (buffer, start, end) buffer->unsafe_to_break (start, end); setup_rphf_mask (plan, buffer); @@ -379,20 +355,9 @@ } static void -clear_substitution_flags (const hb_ot_shape_plan_t *plan HB_UNUSED, - hb_font_t *font HB_UNUSED, - hb_buffer_t *buffer) -{ - hb_glyph_info_t *info = buffer->info; - unsigned int count = buffer->len; - for (unsigned int i = 0; i < count; i++) - _hb_glyph_info_clear_substituted (&info[i]); -} - -static void -record_rphf (const hb_ot_shape_plan_t *plan, - hb_font_t *font HB_UNUSED, - hb_buffer_t *buffer) +record_rphf_use (const hb_ot_shape_plan_t *plan, + hb_font_t *font HB_UNUSED, + hb_buffer_t *buffer) { const use_shape_plan_t *use_plan = (const use_shape_plan_t *) plan->data; @@ -413,9 +378,9 @@ } static void -record_pref (const hb_ot_shape_plan_t *plan HB_UNUSED, - hb_font_t *font HB_UNUSED, - hb_buffer_t *buffer) +record_pref_use (const hb_ot_shape_plan_t *plan HB_UNUSED, + hb_font_t *font HB_UNUSED, + hb_buffer_t *buffer) { hb_glyph_info_t *info = buffer->info; @@ -432,22 +397,22 @@ } static inline bool -is_halant (const hb_glyph_info_t &info) +is_halant_use (const hb_glyph_info_t &info) { return (info.use_category() == USE_H || info.use_category() == USE_HVM) && !_hb_glyph_info_ligated (&info); } static void -reorder_syllable (hb_buffer_t *buffer, unsigned int start, unsigned int end) +reorder_syllable_use (hb_buffer_t *buffer, unsigned int start, unsigned int end) { - syllable_type_t syllable_type = (syllable_type_t) (buffer->info[start].syllable() & 0x0F); + use_syllable_type_t syllable_type = (use_syllable_type_t) (buffer->info[start].syllable() & 0x0F); /* Only a few syllable types need reordering. */ if (unlikely (!(FLAG_UNSAFE (syllable_type) & - (FLAG (virama_terminated_cluster) | - FLAG (sakot_terminated_cluster) | - FLAG (standard_cluster) | - FLAG (broken_cluster) | + (FLAG (use_virama_terminated_cluster) | + FLAG (use_sakot_terminated_cluster) | + FLAG (use_standard_cluster) | + FLAG (use_broken_cluster) | 0)))) return; @@ -478,7 +443,7 @@ for (unsigned int i = start + 1; i < end; i++) { bool is_post_base_glyph = (FLAG64_UNSAFE (info[i].use_category()) & POST_BASE_FLAGS64) || - is_halant (info[i]); + is_halant_use (info[i]); if (is_post_base_glyph || i == end - 1) { /* If we hit a post-base glyph, move before it; otherwise move to the @@ -502,7 +467,7 @@ for (unsigned int i = start; i < end; i++) { uint32_t flag = FLAG_UNSAFE (info[i].use_category()); - if (is_halant (info[i])) + if (is_halant_use (info[i])) { /* If we hit a halant, move after it; otherwise move to the beginning, and * shift things in between forward. */ @@ -522,9 +487,9 @@ } static inline void -insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED, - hb_font_t *font, - hb_buffer_t *buffer) +insert_dotted_circles_use (const hb_ot_shape_plan_t *plan HB_UNUSED, + hb_font_t *font, + hb_buffer_t *buffer) { if (unlikely (buffer->flags & HB_BUFFER_FLAG_DO_NOT_INSERT_DOTTED_CIRCLE)) return; @@ -535,7 +500,7 @@ unsigned int count = buffer->len; hb_glyph_info_t *info = buffer->info; for (unsigned int i = 0; i < count; i++) - if ((info[i].syllable() & 0x0F) == broken_cluster) + if ((info[i].syllable() & 0x0F) == use_broken_cluster) { has_broken_syllables = true; break; @@ -555,8 +520,8 @@ while (buffer->idx < buffer->len && buffer->successful) { unsigned int syllable = buffer->cur().syllable(); - syllable_type_t syllable_type = (syllable_type_t) (syllable & 0x0F); - if (unlikely (last_syllable != syllable && syllable_type == broken_cluster)) + use_syllable_type_t syllable_type = (use_syllable_type_t) (syllable & 0x0F); + if (unlikely (last_syllable != syllable && syllable_type == use_broken_cluster)) { last_syllable = syllable; @@ -569,7 +534,7 @@ while (buffer->idx < buffer->len && buffer->successful && last_syllable == buffer->cur().syllable() && buffer->cur().use_category() == USE_R) - buffer->next_glyph (); + buffer->next_glyph (); buffer->output_info (ginfo); } @@ -580,29 +545,18 @@ } static void -reorder (const hb_ot_shape_plan_t *plan, - hb_font_t *font, - hb_buffer_t *buffer) +reorder_use (const hb_ot_shape_plan_t *plan, + hb_font_t *font, + hb_buffer_t *buffer) { - insert_dotted_circles (plan, font, buffer); + insert_dotted_circles_use (plan, font, buffer); foreach_syllable (buffer, start, end) - reorder_syllable (buffer, start, end); + reorder_syllable_use (buffer, start, end); HB_BUFFER_DEALLOCATE_VAR (buffer, use_category); } -static void -clear_syllables (const hb_ot_shape_plan_t *plan HB_UNUSED, - hb_font_t *font HB_UNUSED, - hb_buffer_t *buffer) -{ - hb_glyph_info_t *info = buffer->info; - unsigned int count = buffer->len; - for (unsigned int i = 0; i < count; i++) - info[i].syllable() = 0; -} - static void preprocess_text_use (const hb_ot_shape_plan_t *plan, @@ -643,3 +597,6 @@ HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY, false, /* fallback_position */ }; + + +#endif diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-complex-use-machine.hh harfbuzz-2.6.2/src/hb-ot-shape-complex-use-machine.hh --- harfbuzz-2.5.3/src/hb-ot-shape-complex-use-machine.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-complex-use-machine.hh 2019-10-26 02:02:55.000000000 +0000 @@ -380,13 +380,13 @@ HB_STMT_START { \ if (0) fprintf (stderr, "syllable %d..%d %s\n", ts, te, #syllable_type); \ for (unsigned int i = ts; i < te; i++) \ - info[i].syllable() = (syllable_serial << 4) | syllable_type; \ + info[i].syllable() = (syllable_serial << 4) | use_##syllable_type; \ syllable_serial++; \ if (unlikely (syllable_serial == 16)) syllable_serial = 1; \ } HB_STMT_END static void -find_syllables (hb_buffer_t *buffer) +find_syllables_use (hb_buffer_t *buffer) { unsigned int p, pe, eof, ts, te, act; int cs; diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-complex-use-machine.rl harfbuzz-2.6.2/src/hb-ot-shape-complex-use-machine.rl --- harfbuzz-2.5.3/src/hb-ot-shape-complex-use-machine.rl 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-complex-use-machine.rl 2019-10-26 02:02:55.000000000 +0000 @@ -165,13 +165,13 @@ HB_STMT_START { \ if (0) fprintf (stderr, "syllable %d..%d %s\n", ts, te, #syllable_type); \ for (unsigned int i = ts; i < te; i++) \ - info[i].syllable() = (syllable_serial << 4) | syllable_type; \ + info[i].syllable() = (syllable_serial << 4) | use_##syllable_type; \ syllable_serial++; \ if (unlikely (syllable_serial == 16)) syllable_serial = 1; \ } HB_STMT_END static void -find_syllables (hb_buffer_t *buffer) +find_syllables_use (hb_buffer_t *buffer) { unsigned int p, pe, eof, ts, te, act; int cs; diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-complex-use-table.cc harfbuzz-2.6.2/src/hb-ot-shape-complex-use-table.cc --- harfbuzz-2.5.3/src/hb-ot-shape-complex-use-table.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-complex-use-table.cc 2019-10-26 02:02:55.000000000 +0000 @@ -15,6 +15,10 @@ * UnicodeData.txt does not have a header. */ +#include "hb.hh" + +#ifndef HB_NO_OT_SHAPE + #include "hb-ot-shape-complex-use.hh" #pragma GCC diagnostic push @@ -851,4 +855,6 @@ #undef VMPst #undef VMAbv + +#endif /* == End of generated table == */ diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-complex-vowel-constraints.cc harfbuzz-2.6.2/src/hb-ot-shape-complex-vowel-constraints.cc --- harfbuzz-2.5.3/src/hb-ot-shape-complex-vowel-constraints.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-complex-vowel-constraints.cc 2019-10-26 02:02:55.000000000 +0000 @@ -13,6 +13,10 @@ * # Date: 2019-01-28, 22:16:47 GMT */ +#include "hb.hh" + +#ifndef HB_NO_OT_SHAPE + #include "hb-ot-shape-complex-vowel-constraints.hh" static void @@ -440,4 +444,6 @@ } } + +#endif /* == End of generated functions == */ diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-fallback.cc harfbuzz-2.6.2/src/hb-ot-shape-fallback.cc --- harfbuzz-2.5.3/src/hb-ot-shape-fallback.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-fallback.cc 2019-10-26 02:02:55.000000000 +0000 @@ -24,6 +24,10 @@ * Google Author(s): Behdad Esfahbod */ +#include "hb.hh" + +#ifndef HB_NO_OT_SHAPE + #include "hb-ot-shape-fallback.hh" #include "hb-kern.hh" @@ -41,30 +45,30 @@ { switch (u) { - case 0x0E31u: - case 0x0E34u: - case 0x0E35u: - case 0x0E36u: - case 0x0E37u: - case 0x0E47u: - case 0x0E4Cu: - case 0x0E4Du: - case 0x0E4Eu: + case 0x0E31u: + case 0x0E34u: + case 0x0E35u: + case 0x0E36u: + case 0x0E37u: + case 0x0E47u: + case 0x0E4Cu: + case 0x0E4Du: + case 0x0E4Eu: klass = HB_UNICODE_COMBINING_CLASS_ABOVE_RIGHT; break; - case 0x0EB1u: - case 0x0EB4u: - case 0x0EB5u: - case 0x0EB6u: - case 0x0EB7u: - case 0x0EBBu: - case 0x0ECCu: - case 0x0ECDu: + case 0x0EB1u: + case 0x0EB4u: + case 0x0EB5u: + case 0x0EB6u: + case 0x0EB7u: + case 0x0EBBu: + case 0x0ECCu: + case 0x0ECDu: klass = HB_UNICODE_COMBINING_CLASS_ABOVE; break; - case 0x0EBCu: + case 0x0EBCu: klass = HB_UNICODE_COMBINING_CLASS_BELOW; break; } @@ -163,8 +167,8 @@ void _hb_ot_shape_fallback_mark_position_recategorize_marks (const hb_ot_shape_plan_t *plan HB_UNUSED, - hb_font_t *font HB_UNUSED, - hb_buffer_t *buffer) + hb_font_t *font HB_UNUSED, + hb_buffer_t *buffer) { #ifdef HB_NO_OT_SHAPE_FALLBACK return; @@ -228,10 +232,10 @@ case HB_UNICODE_COMBINING_CLASS_DOUBLE_ABOVE: if (buffer->props.direction == HB_DIRECTION_LTR) { pos.x_offset += base_extents.x_bearing + base_extents.width - mark_extents.width / 2 - mark_extents.x_bearing; - break; + break; } else if (buffer->props.direction == HB_DIRECTION_RTL) { pos.x_offset += base_extents.x_bearing - mark_extents.width / 2 - mark_extents.x_bearing; - break; + break; } HB_FALLTHROUGH; @@ -383,7 +387,7 @@ if (last_combining_class != this_combining_class) { last_combining_class = this_combining_class; - cluster_extents = component_extents; + cluster_extents = component_extents; } position_mark (plan, font, buffer, cluster_extents, i, this_combining_class); @@ -587,3 +591,6 @@ } } } + + +#endif diff -Nru harfbuzz-2.5.3/src/hb-ot-shape.hh harfbuzz-2.6.2/src/hb-ot-shape.hh --- harfbuzz-2.5.3/src/hb-ot-shape.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape.hh 2019-10-26 02:02:55.000000000 +0000 @@ -78,7 +78,7 @@ #else static constexpr hb_mask_t kern_mask = 0; #endif -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE hb_mask_t trak_mask; #else static constexpr hb_mask_t trak_mask = 0; @@ -89,7 +89,7 @@ #else static constexpr bool requested_kerning = false; #endif -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE bool requested_tracking : 1; #else static constexpr bool requested_tracking = false; @@ -111,7 +111,7 @@ #else static constexpr bool apply_kern = false; #endif -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE bool apply_kerx : 1; bool apply_morx : 1; bool apply_trak : 1; @@ -149,7 +149,7 @@ hb_segment_properties_t props; hb_ot_map_builder_t map; hb_aat_map_builder_t aat_map; -#ifndef HB_NO_SHAPE_AAT +#ifndef HB_NO_AAT_SHAPE bool apply_morx : 1; #else static constexpr bool apply_morx = false; diff -Nru harfbuzz-2.5.3/src/hb-ot-shape-normalize.cc harfbuzz-2.6.2/src/hb-ot-shape-normalize.cc --- harfbuzz-2.5.3/src/hb-ot-shape-normalize.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-shape-normalize.cc 2019-10-26 02:02:55.000000000 +0000 @@ -24,6 +24,10 @@ * Google Author(s): Behdad Esfahbod */ +#include "hb.hh" + +#ifndef HB_NO_OT_SHAPE + #include "hb-ot-shape-normalize.hh" #include "hb-ot-shape-complex.hh" #include "hb-ot-shape.hh" @@ -229,7 +233,7 @@ } else { - /* Just pass on the two characters separately, let GSUB do its magic. */ + /* Just pass on the two characters separately, let GSUB do its magic. */ set_glyph (buffer->cur(), font); buffer->next_glyph (); set_glyph (buffer->cur(), font); @@ -339,7 +343,7 @@ /* From idx to end are simple clusters. */ if (might_short_circuit) { - unsigned int done = font->get_nominal_glyphs (end - buffer->idx, + unsigned int done = font->get_nominal_glyphs (end - buffer->idx, &buffer->cur().codepoint, sizeof (buffer->info[0]), &buffer->cur().glyph_index(), @@ -469,3 +473,6 @@ buffer->swap_buffers (); } } + + +#endif diff -Nru harfbuzz-2.5.3/src/hb-ot-stat-table.hh harfbuzz-2.6.2/src/hb-ot-stat-table.hh --- harfbuzz-2.5.3/src/hb-ot-stat-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-stat-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -77,7 +77,7 @@ NameID valueNameID; /* The name ID for entries in the 'name' table * that provide a display string for this * attribute value. */ - Fixed value; /* A numeric value for this attribute value. */ + HBFixed value; /* A numeric value for this attribute value. */ public: DEFINE_SIZE_STATIC (12); }; @@ -102,10 +102,10 @@ NameID valueNameID; /* The name ID for entries in the 'name' table * that provide a display string for this * attribute value. */ - Fixed nominalValue; /* A numeric value for this attribute value. */ - Fixed rangeMinValue; /* The minimum value for a range associated + HBFixed nominalValue; /* A numeric value for this attribute value. */ + HBFixed rangeMinValue; /* The minimum value for a range associated * with the specified name ID. */ - Fixed rangeMaxValue; /* The maximum value for a range associated + HBFixed rangeMaxValue; /* The maximum value for a range associated * with the specified name ID. */ public: DEFINE_SIZE_STATIC (20); @@ -131,8 +131,8 @@ NameID valueNameID; /* The name ID for entries in the 'name' table * that provide a display string for this * attribute value. */ - Fixed value; /* A numeric value for this attribute value. */ - Fixed linkedValue; /* The numeric value for a style-linked mapping + HBFixed value; /* A numeric value for this attribute value. */ + HBFixed linkedValue; /* The numeric value for a style-linked mapping * from this value. */ public: DEFINE_SIZE_STATIC (16); @@ -150,7 +150,7 @@ HBUINT16 axisIndex; /* Zero-base index into the axis record array * identifying the axis to which this value * applies. Must be less than designAxisCount. */ - Fixed value; /* A numeric value for this attribute value. */ + HBFixed value; /* A numeric value for this attribute value. */ public: DEFINE_SIZE_STATIC (6); }; @@ -304,8 +304,8 @@ protected: - FixedVersion<>version; /* Version of the stat table - * initially set to 0x00010002u */ + FixedVersion<>version; /* Version of the stat table + * initially set to 0x00010002u */ HBUINT16 designAxisSize; /* The size in bytes of each axis record. */ HBUINT16 designAxisCount;/* The number of design axis records. In a * font with an 'fvar' table, this value must be diff -Nru harfbuzz-2.5.3/src/hb-ot-tag.cc harfbuzz-2.6.2/src/hb-ot-tag.cc --- harfbuzz-2.5.3/src/hb-ot-tag.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-tag.cc 2019-10-26 02:02:55.000000000 +0000 @@ -28,6 +28,8 @@ #include "hb.hh" +#ifndef HB_NO_OT_TAG + /* hb_script_t */ @@ -548,3 +550,6 @@ } #endif + + +#endif diff -Nru harfbuzz-2.5.3/src/hb-ot-var-avar-table.hh harfbuzz-2.6.2/src/hb-ot-var-avar-table.hh --- harfbuzz-2.5.3/src/hb-ot-var-avar-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-var-avar-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -49,9 +49,10 @@ } public: - F2DOT14 fromCoord; /* A normalized coordinate value obtained using - * default normalization. */ - F2DOT14 toCoord; /* The modified, normalized coordinate value. */ + F2DOT14 coords[2]; +// F2DOT14 fromCoord; /* A normalized coordinate value obtained using +// * default normalization. */ +// F2DOT14 toCoord; /* The modified, normalized coordinate value. */ public: DEFINE_SIZE_STATIC (4); @@ -59,12 +60,13 @@ struct SegmentMaps : ArrayOf { - int map (int value) const + int map (int value, unsigned int from_offset = 0, unsigned int to_offset = 1) const { +#define fromCoord coords[from_offset] +#define toCoord coords[to_offset] /* The following special-cases are not part of OpenType, which requires * that at least -1, 0, and +1 must be mapped. But we include these as * part of a better error recovery scheme. */ - if (len < 2) { if (!len) @@ -91,8 +93,12 @@ return arrayZ[i-1].toCoord + ((arrayZ[i].toCoord - arrayZ[i-1].toCoord) * (value - arrayZ[i-1].fromCoord) + denom/2) / denom; +#undef toCoord +#undef fromCoord } + int unmap (int value) const { return map (value, 1, 0); } + public: DEFINE_SIZE_ARRAY (2, *this); }; @@ -114,7 +120,7 @@ for (unsigned int i = 0; i < count; i++) { if (unlikely (!map->sanitize (c))) - return_trace (false); + return_trace (false); map = &StructAfter (*map); } @@ -133,6 +139,18 @@ } } + void unmap_coords (int *coords, unsigned int coords_length) const + { + unsigned int count = hb_min (coords_length, axisCount); + + const SegmentMaps *map = &firstAxisSegmentMaps; + for (unsigned int i = 0; i < count; i++) + { + coords[i] = map->unmap (coords[i]); + map = &StructAfter (*map); + } + } + protected: FixedVersion<>version; /* Version of the avar table * initially set to 0x00010000u */ @@ -140,7 +158,7 @@ HBUINT16 axisCount; /* The number of variation axes in the font. This * must be the same number as axisCount in the * 'fvar' table. */ - SegmentMaps firstAxisSegmentMaps; + SegmentMaps firstAxisSegmentMaps; public: DEFINE_SIZE_MIN (8); diff -Nru harfbuzz-2.5.3/src/hb-ot-var-fvar-table.hh harfbuzz-2.6.2/src/hb-ot-var-fvar-table.hh --- harfbuzz-2.5.3/src/hb-ot-var-fvar-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-var-fvar-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -44,7 +44,7 @@ { friend struct fvar; - hb_array_t get_coordinates (unsigned int axis_count) const + hb_array_t get_coordinates (unsigned int axis_count) const { return coordinatesZ.as_array (axis_count); } bool sanitize (hb_sanitize_context_t *c, unsigned int axis_count) const @@ -58,7 +58,7 @@ NameID subfamilyNameID;/* The name ID for entries in the 'name' table * that provide subfamily names for this instance. */ HBUINT16 flags; /* Reserved for future use — set to 0. */ - UnsizedArrayOf + UnsizedArrayOf coordinatesZ; /* The coordinates array for this instance. */ //NameID postScriptNameIDX;/*Optional. The name ID for entries in the 'name' // * table that provide PostScript names for this @@ -83,9 +83,9 @@ public: Tag axisTag; /* Tag identifying the design variation for the axis. */ - Fixed minValue; /* The minimum coordinate value for the axis. */ - Fixed defaultValue; /* The default coordinate value for the axis. */ - Fixed maxValue; /* The maximum coordinate value for the axis. */ + HBFixed minValue; /* The minimum coordinate value for the axis. */ + HBFixed defaultValue; /* The default coordinate value for the axis. */ + HBFixed maxValue; /* The maximum coordinate value for the axis. */ HBUINT16 flags; /* Axis flags. */ NameID axisNameID; /* The name ID for entries in the 'name' table that * provide a display name for this axis. */ @@ -199,7 +199,7 @@ for (unsigned int i = 0; i < count; i++) if (axes[i].axisTag == tag) { - if (axis_index) + if (axis_index) *axis_index = i; get_axis_deprecated (i, info); return true; @@ -237,7 +237,21 @@ v = (v - axis.default_value) / (axis.default_value - axis.min_value); else v = (v - axis.default_value) / (axis.max_value - axis.default_value); - return (int) (v * 16384.f + (v >= 0.f ? .5f : -.5f)); + return roundf (v * 16384.f); + } + + float unnormalize_axis_value (unsigned int axis_index, float v) const + { + hb_ot_var_axis_info_t axis; + get_axis_info (axis_index, &axis); + + if (v == 0) + return axis.default_value; + else if (v < 0) + v = v * (axis.default_value - axis.min_value) / 16384.f + axis.default_value; + else + v = v * (axis.max_value - axis.default_value) / 16384.f + axis.default_value; + return v; } unsigned int get_instance_count () const { return instanceCount; } @@ -266,16 +280,16 @@ if (unlikely (!instance)) { if (coords_length) - *coords_length = 0; + *coords_length = 0; return 0; } if (coords_length && *coords_length) { - hb_array_t instanceCoords = instance->get_coordinates (axisCount) + hb_array_t instanceCoords = instance->get_coordinates (axisCount) .sub_array (0, *coords_length); for (unsigned int i = 0; i < instanceCoords.length; i++) - coords[i] = instanceCoords.arrayZ[i].to_float (); + coords[i] = instanceCoords.arrayZ[i].to_float (); } return axisCount; } @@ -326,8 +340,8 @@ HBUINT16 instanceCount; /* The number of named instances defined in the font * (the number of records in the instances array). */ HBUINT16 instanceSize; /* The size in bytes of each InstanceRecord — set - * to either axisCount * sizeof(Fixed) + 4, or to - * axisCount * sizeof(Fixed) + 6. */ + * to either axisCount * sizeof(HBFixed) + 4, or to + * axisCount * sizeof(HBFixed) + 6. */ public: DEFINE_SIZE_STATIC (16); diff -Nru harfbuzz-2.5.3/src/hb-ot-var.h harfbuzz-2.6.2/src/hb-ot-var.h --- harfbuzz-2.5.3/src/hb-ot-var.h 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-var.h 2019-10-26 02:02:55.000000000 +0000 @@ -68,7 +68,7 @@ typedef enum { /*< flags >*/ HB_OT_VAR_AXIS_FLAG_HIDDEN = 0x00000001u, - _HB_OT_VAR_AXIS_FLAG_MAX_VALUE= 0x7FFFFFFFu /*< skip >*/ + _HB_OT_VAR_AXIS_FLAG_MAX_VALUE= HB_TAG_MAX_SIGNED /*< skip >*/ } hb_ot_var_axis_flags_t; /** diff -Nru harfbuzz-2.5.3/src/hb-ot-vorg-table.hh harfbuzz-2.6.2/src/hb-ot-vorg-table.hh --- harfbuzz-2.5.3/src/hb-ot-vorg-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ot-vorg-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -48,7 +48,7 @@ } public: - GlyphID glyph; + HBGlyphID glyph; FWORD vertOriginY; public: @@ -70,10 +70,10 @@ } template + hb_requires (hb_is_iterator (Iterator))> void serialize (hb_serialize_context_t *c, - Iterator it, - FWORD defaultVertOriginY) + Iterator it, + FWORD defaultVertOriginY) { if (unlikely (!c->extend_min ((*this)))) return; @@ -84,9 +84,7 @@ this->defaultVertOriginY = defaultVertOriginY; this->vertYOrigins.len = it.len (); - + it - | hb_apply ([c] (const VertOriginMetric& _) { c->copy (_);}) - ; + for (const auto _ : it) c->copy (_); } bool subset (hb_subset_context_t *c) const @@ -99,15 +97,15 @@ + vertYOrigins.as_array () | hb_filter (c->plan->glyphset (), &VertOriginMetric::glyph) | hb_map ([&] (const VertOriginMetric& _) - { - hb_codepoint_t new_glyph = HB_SET_VALUE_INVALID; - c->plan->new_gid_for_old_gid (_.glyph, &new_glyph); - - VertOriginMetric metric; - metric.glyph = new_glyph; - metric.vertOriginY = _.vertOriginY; - return metric; - }) + { + hb_codepoint_t new_glyph = HB_SET_VALUE_INVALID; + c->plan->new_gid_for_old_gid (_.glyph, &new_glyph); + + VertOriginMetric metric; + metric.glyph = new_glyph; + metric.vertOriginY = _.vertOriginY; + return metric; + }) ; /* serialize the new table */ @@ -119,8 +117,8 @@ { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && - version.major == 1 && - vertYOrigins.sanitize (c)); + version.major == 1 && + vertYOrigins.sanitize (c)); } protected: diff -Nru harfbuzz-2.5.3/src/hb-pool.hh harfbuzz-2.6.2/src/hb-pool.hh --- harfbuzz-2.5.3/src/hb-pool.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-pool.hh 2019-10-26 02:02:55.000000000 +0000 @@ -77,14 +77,14 @@ static_assert (ChunkLen > 1, ""); static_assert (sizeof (T) >= sizeof (void *), ""); - static_assert (alignof (T) % sizeof (void *) == 0, ""); + static_assert (alignof (T) % alignof (void *) == 0, ""); struct chunk_t { T* thread () { for (unsigned i = 0; i < ARRAY_LENGTH (arrayZ) - 1; i++) - * (T**) &arrayZ[i] = &arrayZ[i + 1]; + * (T**) &arrayZ[i] = &arrayZ[i + 1]; * (T**) &arrayZ[ARRAY_LENGTH (arrayZ) - 1] = nullptr; diff -Nru harfbuzz-2.5.3/src/hb-sanitize.hh harfbuzz-2.6.2/src/hb-sanitize.hh --- harfbuzz-2.5.3/src/hb-sanitize.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-sanitize.hh 2019-10-26 02:02:55.000000000 +0000 @@ -326,8 +326,8 @@ { DEBUG_MSG_FUNC (SANITIZE, start, "passed first round with %d edits; going for second round", edit_count); - /* sanitize again to ensure no toe-stepping */ - edit_count = 0; + /* sanitize again to ensure no toe-stepping */ + edit_count = 0; sane = t->sanitize (this); if (edit_count) { DEBUG_MSG_FUNC (SANITIZE, start, "requested %d edits in second round; FAILLING", edit_count); @@ -338,7 +338,7 @@ else { if (edit_count && !writable) { - start = hb_blob_get_data_writable (blob, nullptr); + start = hb_blob_get_data_writable (blob, nullptr); end = start + blob->length; if (start) diff -Nru harfbuzz-2.5.3/src/hb-serialize.hh harfbuzz-2.6.2/src/hb-serialize.hh --- harfbuzz-2.5.3/src/hb-serialize.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-serialize.hh 2019-10-26 02:02:55.000000000 +0000 @@ -91,9 +91,7 @@ void fini () { - ++ hb_iter (packed) - | hb_apply ([] (object_t *_) { _->fini (); }) - ; + for (object_t *_ : ++hb_iter (packed)) _->fini (); packed.fini (); this->packed_map.fini (); @@ -194,6 +192,7 @@ if (unlikely (!obj)) return; current = current->next; revert (*obj); + obj->fini (); object_pool.free (obj); } objidx_t pop_pack () @@ -291,7 +290,6 @@ assert (packed.length > 1); for (const object_t* parent : ++hb_iter (packed)) - { for (const object_t::link_t &link : parent->links) { const object_t* child = packed[link.objidx]; @@ -311,7 +309,6 @@ check_assign (off, offset); } } - } } unsigned int length () const { return this->head - current->head; } @@ -353,9 +350,7 @@ template Type *allocate_min () - { - return this->allocate_size (Type::min_size); - } + { return this->allocate_size (Type::min_size); } template Type *embed (const Type *obj) @@ -427,14 +422,12 @@ /* Copy both items from head side and tail side... */ unsigned int len = (this->head - this->start) + (this->end - this->tail); + char *p = (char *) malloc (len); - if (p) - { - memcpy (p, this->start, this->head - this->start); - memcpy (p + (this->head - this->start), this->tail, this->end - this->tail); - } - else - return hb_bytes_t (); + if (unlikely (!p)) return hb_bytes_t (); + + memcpy (p, this->start, this->head - this->start); + memcpy (p + (this->head - this->start), this->tail, this->end - this->tail); return hb_bytes_t (p, len); } template diff -Nru harfbuzz-2.5.3/src/hb-set.cc harfbuzz-2.6.2/src/hb-set.cc --- harfbuzz-2.5.3/src/hb-set.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-set.cc 2019-10-26 02:02:55.000000000 +0000 @@ -479,7 +479,7 @@ * @set: a set. * @codepoint: (inout): * - * Gets the previous number in @set that is slower than current value of @codepoint. + * Gets the previous number in @set that is lower than current value of @codepoint. * * Set @codepoint to %HB_SET_VALUE_INVALID to get started. * @@ -524,7 +524,7 @@ * @last: (out): output last codepoint in the range. * * Gets the previous consecutive range of numbers in @set that - * are greater than current value of @last. + * are less than current value of @first. * * Set @first to %HB_SET_VALUE_INVALID to get started. * diff -Nru harfbuzz-2.5.3/src/hb-set.hh harfbuzz-2.6.2/src/hb-set.hh --- harfbuzz-2.5.3/src/hb-set.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-set.hh 2019-10-26 02:02:55.000000000 +0000 @@ -63,7 +63,7 @@ bool is_empty () const { for (unsigned int i = 0; i < len (); i++) - if (v[i]) + if (v[i]) return false; return true; } @@ -77,7 +77,7 @@ elt_t *la = &elt (a); elt_t *lb = &elt (b); if (la == lb) - *la |= (mask (b) << 1) - mask(a); + *la |= (mask (b) << 1) - mask(a); else { *la |= ~(mask (a) - 1); @@ -98,7 +98,7 @@ { unsigned int pop = 0; for (unsigned int i = 0; i < len (); i++) - pop += hb_popcount (v[i]); + pop += hb_popcount (v[i]); return pop; } @@ -136,12 +136,17 @@ unsigned int j = m & ELT_MASK; const elt_t vv = v[i] & ((elt_t (1) << (j + 1)) - 1); - for (const elt_t *p = &vv; (int) i >= 0; p = &v[--i]) + const elt_t *p = &vv; + while (true) + { if (*p) { *codepoint = i * ELT_BITS + elt_get_max (*p); return true; } + if ((int) i <= 0) break; + p = &v[--i]; + } *codepoint = INVALID; return false; @@ -149,14 +154,14 @@ hb_codepoint_t get_min () const { for (unsigned int i = 0; i < len (); i++) - if (v[i]) + if (v[i]) return i * ELT_BITS + elt_get_min (v[i]); return INVALID; } hb_codepoint_t get_max () const { for (int i = len () - 1; i >= 0; i--) - if (v[i]) + if (v[i]) return i * ELT_BITS + elt_get_max (v[i]); return 0; } @@ -249,7 +254,7 @@ unsigned int count = pages.length; for (unsigned int i = 0; i < count; i++) if (!pages[i].is_empty ()) - return false; + return false; return true; } @@ -333,9 +338,9 @@ unsigned int end = major_start (m + 1); do { - /* If we try harder we can change the following comparison to <=; + /* If we try harder we can change the following comparison to <=; * Not sure if it's worth it. */ - if (g < last_g) return false; + if (g < last_g) return false; last_g = g; page->add (g); @@ -415,7 +420,7 @@ if (other->page_at (b).is_empty ()) { b++; continue; } if (page_map[a].major != other->page_map[b].major || !page_at (a).is_equal (&other->page_at (b))) - return false; + return false; a++; b++; } @@ -436,7 +441,7 @@ hb_codepoint_t c = INVALID; while (next (&c)) if (!larger_set->has (c)) - return false; + return false; return true; } @@ -458,21 +463,21 @@ { if (page_map[a].major == other->page_map[b].major) { - count++; + count++; a++; b++; } else if (page_map[a].major < other->page_map[b].major) { - if (Op::passthru_left) + if (Op::passthru_left) count++; - a++; + a++; } else { - if (Op::passthru_right) + if (Op::passthru_right) count++; - b++; + b++; } } if (Op::passthru_left) @@ -482,7 +487,7 @@ if (count > pages.length) if (!resize (count)) - return; + return; newCount = count; /* Process in-place backward. */ @@ -673,7 +678,7 @@ unsigned int count = pages.length; for (unsigned int i = 0; i < count; i++) if (!page_at (i).is_empty ()) - return page_map[i].major * page_t::PAGE_BITS + page_at (i).get_min (); + return page_map[i].major * page_t::PAGE_BITS + page_at (i).get_min (); return INVALID; } hb_codepoint_t get_max () const @@ -681,7 +686,7 @@ unsigned int count = pages.length; for (int i = count - 1; i >= 0; i++) if (!page_at (i).is_empty ()) - return page_map[(unsigned) i].major * page_t::PAGE_BITS + page_at (i).get_max (); + return page_map[(unsigned) i].major * page_t::PAGE_BITS + page_at (i).get_max (); return INVALID; } diff -Nru harfbuzz-2.5.3/src/hb-shape-plan.cc harfbuzz-2.6.2/src/hb-shape-plan.cc --- harfbuzz-2.5.3/src/hb-shape-plan.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-shape-plan.cc 2019-10-26 02:02:55.000000000 +0000 @@ -79,7 +79,9 @@ } this->shaper_func = nullptr; this->shaper_name = nullptr; +#ifndef HB_NO_OT_SHAPE this->ot.init (face, coords, num_coords); +#endif /* * Choose shaper. @@ -148,7 +150,9 @@ { return hb_segment_properties_equal (&this->props, &other->props) && this->user_features_match (other) && +#ifndef HB_NO_OT_SHAPE this->ot.equal (&other->ot) && +#endif this->shaper_func == other->shaper_func; } @@ -160,13 +164,13 @@ /** * hb_shape_plan_create: (Xconstructor) - * @face: - * @props: + * @face: + * @props: * @user_features: (array length=num_user_features): - * @num_user_features: + * @num_user_features: * @shaper_list: (array zero-terminated=1): * - * + * * * Return value: (transfer full): * @@ -224,12 +228,16 @@ num_coords, shaper_list))) goto bail2; +#ifndef HB_NO_OT_SHAPE if (unlikely (!shape_plan->ot.init0 (face, &shape_plan->key))) goto bail3; +#endif return shape_plan; +#ifndef HB_NO_OT_SHAPE bail3: +#endif shape_plan->key.free (); bail2: free (shape_plan); @@ -240,7 +248,7 @@ /** * hb_shape_plan_get_empty: * - * + * * * Return value: (transfer full): * @@ -256,7 +264,7 @@ * hb_shape_plan_reference: (skip) * @shape_plan: a shape plan. * - * + * * * Return value: (transfer full): * @@ -272,7 +280,7 @@ * hb_shape_plan_destroy: (skip) * @shape_plan: a shape plan. * - * + * * * Since: 0.9.7 **/ @@ -281,7 +289,9 @@ { if (!hb_object_destroy (shape_plan)) return; +#ifndef HB_NO_OT_SHAPE shape_plan->ot.fini (); +#endif shape_plan->key.free (); free (shape_plan); } @@ -289,14 +299,14 @@ /** * hb_shape_plan_set_user_data: (skip) * @shape_plan: a shape plan. - * @key: - * @data: - * @destroy: - * @replace: + * @key: + * @data: + * @destroy: + * @replace: + * * - * * - * Return value: + * Return value: * * Since: 0.9.7 **/ @@ -313,9 +323,9 @@ /** * hb_shape_plan_get_user_data: (skip) * @shape_plan: a shape plan. - * @key: + * @key: + * * - * * * Return value: (transfer none): * @@ -332,7 +342,7 @@ * hb_shape_plan_get_shaper: * @shape_plan: a shape plan. * - * + * * * Return value: (transfer none): * @@ -351,11 +361,11 @@ * @font: a font. * @buffer: a buffer. * @features: (array length=num_features): - * @num_features: + * @num_features: * - * * - * Return value: + * + * Return value: * * Since: 0.9.7 **/ @@ -410,13 +420,13 @@ /** * hb_shape_plan_create_cached: - * @face: - * @props: + * @face: + * @props: * @user_features: (array length=num_user_features): - * @num_user_features: + * @num_user_features: * @shaper_list: (array zero-terminated=1): * - * + * * * Return value: (transfer full): * @@ -471,8 +481,8 @@ for (hb_face_t::plan_node_t *node = cached_plan_nodes; node; node = node->next) if (node->shape_plan->key.equal (&key)) { - DEBUG_MSG_FUNC (SHAPE_PLAN, node->shape_plan, "fulfilled from cache"); - return hb_shape_plan_reference (node->shape_plan); + DEBUG_MSG_FUNC (SHAPE_PLAN, node->shape_plan, "fulfilled from cache"); + return hb_shape_plan_reference (node->shape_plan); } } diff -Nru harfbuzz-2.5.3/src/hb-shape-plan.hh harfbuzz-2.6.2/src/hb-shape-plan.hh --- harfbuzz-2.5.3/src/hb-shape-plan.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-shape-plan.hh 2019-10-26 02:02:55.000000000 +0000 @@ -39,21 +39,23 @@ const hb_feature_t *user_features; unsigned int num_user_features; +#ifndef HB_NO_OT_SHAPE hb_ot_shape_plan_key_t ot; +#endif hb_shape_func_t *shaper_func; const char *shaper_name; - HB_INTERNAL inline bool init (bool copy, - hb_face_t *face, - const hb_segment_properties_t *props, - const hb_feature_t *user_features, - unsigned int num_user_features, - const int *coords, - unsigned int num_coords, - const char * const *shaper_list); + HB_INTERNAL bool init (bool copy, + hb_face_t *face, + const hb_segment_properties_t *props, + const hb_feature_t *user_features, + unsigned int num_user_features, + const int *coords, + unsigned int num_coords, + const char * const *shaper_list); - HB_INTERNAL inline void free () { ::free ((void *) user_features); } + HB_INTERNAL void free () { ::free ((void *) user_features); } HB_INTERNAL bool user_features_match (const hb_shape_plan_key_t *other); @@ -65,7 +67,9 @@ hb_object_header_t header; hb_face_t *face_unsafe; /* We don't carry a reference to face. */ hb_shape_plan_key_t key; +#ifndef HB_NO_OT_SHAPE hb_ot_shape_plan_t ot; +#endif }; diff -Nru harfbuzz-2.5.3/src/hb-shaper.cc harfbuzz-2.6.2/src/hb-shaper.cc --- harfbuzz-2.5.3/src/hb-shaper.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-shaper.cc 2019-10-26 02:02:55.000000000 +0000 @@ -34,6 +34,9 @@ #include "hb-shaper-list.hh" #undef HB_SHAPER_IMPLEMENT }; +#ifndef HB_NO_SHAPER +static_assert (0 != ARRAY_LENGTH_CONST (all_shapers), "No shaper enabled."); +#endif #if HB_USE_ATEXIT static void free_static_shapers (); diff -Nru harfbuzz-2.5.3/src/hb-shaper-list.hh harfbuzz-2.6.2/src/hb-shaper-list.hh --- harfbuzz-2.5.3/src/hb-shaper-list.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-shaper-list.hh 2019-10-26 02:02:55.000000000 +0000 @@ -28,6 +28,9 @@ #define HB_SHAPER_LIST_HH #endif /* HB_SHAPER_LIST_HH */ /* Dummy header guards */ +#ifndef HB_NO_SHAPER + + /* v--- Add new shapers in the right place here. */ #ifdef HAVE_GRAPHITE2 @@ -35,7 +38,9 @@ HB_SHAPER_IMPLEMENT (graphite2) #endif +#ifndef HB_NO_OT_SHAPE HB_SHAPER_IMPLEMENT (ot) /* <--- This is our main OpenType shaper. */ +#endif #ifdef HAVE_UNISCRIBE HB_SHAPER_IMPLEMENT (uniscribe) @@ -50,3 +55,6 @@ #ifndef HB_NO_FALLBACK_SHAPE HB_SHAPER_IMPLEMENT (fallback) /* <--- This should be last. */ #endif + + +#endif diff -Nru harfbuzz-2.5.3/src/hb-string-array.hh harfbuzz-2.6.2/src/hb-string-array.hh --- harfbuzz-2.5.3/src/hb-string-array.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-string-array.hh 2019-10-26 02:02:55.000000000 +0000 @@ -48,7 +48,7 @@ #include HB_STRING_ARRAY_LIST #undef _S } st; - char str[VAR]; + char str[HB_VAR_ARRAY]; } HB_STRING_ARRAY_POOL_NAME = { diff -Nru harfbuzz-2.5.3/src/hb-subset.cc harfbuzz-2.6.2/src/hb-subset.cc --- harfbuzz-2.5.3/src/hb-subset.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-subset.cc 2019-10-26 02:02:55.000000000 +0000 @@ -82,6 +82,7 @@ if (unlikely (!buf.alloc (buf_size))) { DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c failed to allocate %u bytes.", HB_UNTAG (tag), buf_size); + hb_blob_destroy (source_blob); return false; } retry: @@ -96,6 +97,7 @@ if (unlikely (!buf.alloc (buf_size))) { DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c failed to reallocate %u bytes.", HB_UNTAG (tag), buf_size); + hb_blob_destroy (source_blob); return false; } goto retry; @@ -187,7 +189,7 @@ DEBUG_MSG(SUBSET, nullptr, "skip loca handled by glyf"); return true; case HB_OT_TAG_cmap: - result = _subset (plan); + result = _subset2 (plan); break; case HB_OT_TAG_OS2: result = _subset2 (plan); @@ -283,17 +285,19 @@ hb_tag_t table_tags[32]; unsigned int offset = 0, count; bool success = true; + hb_set_t tags_set; do { count = ARRAY_LENGTH (table_tags); hb_face_get_table_tags (source, offset, &count, table_tags); for (unsigned int i = 0; i < count; i++) { hb_tag_t tag = table_tags[i]; - if (_should_drop_table (plan, tag)) + if (_should_drop_table (plan, tag) && !tags_set.has (tag)) { DEBUG_MSG(SUBSET, nullptr, "drop %c%c%c%c", HB_UNTAG (tag)); continue; } + tags_set.add (tag); success = success && _subset_table (plan, tag); } offset += count; diff -Nru harfbuzz-2.5.3/src/hb-subset-cff2.cc harfbuzz-2.6.2/src/hb-subset-cff2.cc --- harfbuzz-2.5.3/src/hb-subset-cff2.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-subset-cff2.cc 2019-10-26 02:02:55.000000000 +0000 @@ -330,15 +330,15 @@ { subset_localsubrs[fd].init (); offsets.localSubrsInfos[fd].init (); - if (!subr_subsetter.encode_localsubrs (fd, subset_localsubrs[fd])) - return false; + if (!subr_subsetter.encode_localsubrs (fd, subset_localsubrs[fd])) + return false; - unsigned int dataSize = subset_localsubrs[fd].total_size (); - if (dataSize > 0) - { - offsets.localSubrsInfos[fd].offset = final_size; - offsets.localSubrsInfos[fd].offSize = calcOffSize (dataSize); - offsets.localSubrsInfos[fd].size = CFF2Subrs::calculate_serialized_size (offsets.localSubrsInfos[fd].offSize, subset_localsubrs[fd].length, dataSize); + unsigned int dataSize = subset_localsubrs[fd].total_size (); + if (dataSize > 0) + { + offsets.localSubrsInfos[fd].offset = final_size; + offsets.localSubrsInfos[fd].offSize = calcOffSize (dataSize); + offsets.localSubrsInfos[fd].size = CFF2Subrs::calculate_serialized_size (offsets.localSubrsInfos[fd].offSize, subset_localsubrs[fd].length, dataSize); } } } diff -Nru harfbuzz-2.5.3/src/hb-subset.h harfbuzz-2.6.2/src/hb-subset.h --- harfbuzz-2.5.3/src/hb-subset.h 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-subset.h 2019-10-26 02:02:55.000000000 +0000 @@ -68,7 +68,7 @@ HB_EXTERN void hb_subset_input_set_desubroutinize (hb_subset_input_t *subset_input, - hb_bool_t desubroutinize); + hb_bool_t desubroutinize); HB_EXTERN hb_bool_t hb_subset_input_get_desubroutinize (hb_subset_input_t *subset_input); diff -Nru harfbuzz-2.5.3/src/hb-subset-input.cc harfbuzz-2.6.2/src/hb-subset-input.cc --- harfbuzz-2.5.3/src/hb-subset-input.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-subset-input.cc 2019-10-26 02:02:55.000000000 +0000 @@ -172,7 +172,7 @@ HB_EXTERN void hb_subset_input_set_desubroutinize (hb_subset_input_t *subset_input, - hb_bool_t desubroutinize) + hb_bool_t desubroutinize) { subset_input->desubroutinize = desubroutinize; } diff -Nru harfbuzz-2.5.3/src/hb-subset-plan.cc harfbuzz-2.6.2/src/hb-subset-plan.cc --- harfbuzz-2.5.3/src/hb-subset-plan.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-subset-plan.cc 2019-10-26 02:02:55.000000000 +0000 @@ -39,7 +39,7 @@ hb_codepoint_t gid, hb_set_t *gids_to_retain) { - if (hb_set_has (gids_to_retain, gid)) + if (gids_to_retain->has (gid)) // Already visited this gid, ignore. return; @@ -58,8 +58,8 @@ #ifndef HB_NO_SUBSET_CFF static inline void _add_cff_seac_components (const OT::cff1::accelerator_t &cff, - hb_codepoint_t gid, - hb_set_t *gids_to_retain) + hb_codepoint_t gid, + hb_set_t *gids_to_retain) { hb_codepoint_t base_gid, accent_gid; if (cff.get_seac_components (gid, &base_gid, &accent_gid)) @@ -88,6 +88,14 @@ #endif static inline void +_cmap_closure (hb_face_t *face, + const hb_set_t *unicodes, + hb_set_t *glyphset) +{ + face->table.cmap->table->closure_glyphs (unicodes, glyphset); +} + +static inline void _remove_invalid_gids (hb_set_t *glyphs, unsigned int num_glyphs) { @@ -102,7 +110,7 @@ static void _populate_gids_to_retain (hb_subset_plan_t* plan, const hb_set_t *unicodes, - const hb_set_t *input_glyphs_to_retain, + const hb_set_t *input_glyphs_to_retain, bool close_over_gsub) { OT::cmap::accelerator_t cmap; @@ -129,6 +137,8 @@ plan->_glyphset_gsub->add (gid); } + _cmap_closure (plan->source, plan->unicodes, plan->_glyphset_gsub); + #ifndef HB_NO_SUBSET_LAYOUT if (close_over_gsub) // Add all glyphs needed for GSUB substitutions. @@ -157,11 +167,11 @@ static void _create_old_gid_to_new_gid_map (const hb_face_t *face, - bool retain_gids, + bool retain_gids, const hb_set_t *all_gids_to_retain, - hb_map_t *glyph_map, /* OUT */ - hb_map_t *reverse_glyph_map, /* OUT */ - unsigned int *num_glyphs /* OUT */) + hb_map_t *glyph_map, /* OUT */ + hb_map_t *reverse_glyph_map, /* OUT */ + unsigned int *num_glyphs /* OUT */) { if (!retain_gids) { @@ -179,7 +189,7 @@ unsigned max_glyph = + hb_iter (all_gids_to_retain) - | hb_reduce (hb_max, 0) + | hb_reduce (hb_max, 0u) ; *num_glyphs = max_glyph + 1; } @@ -191,8 +201,8 @@ } static void -_nameid_closure (hb_face_t *face, - hb_set_t *nameids) +_nameid_closure (hb_face_t *face, + hb_set_t *nameids) { #ifndef HB_NO_STAT face->table.STAT->collect_name_ids (nameids); @@ -213,8 +223,8 @@ * Since: 1.7.5 **/ hb_subset_plan_t * -hb_subset_plan_create (hb_face_t *face, - hb_subset_input_t *input) +hb_subset_plan_create (hb_face_t *face, + hb_subset_input_t *input) { hb_subset_plan_t *plan = hb_object_create (); @@ -235,16 +245,16 @@ plan->reverse_glyph_map = hb_map_create (); _populate_gids_to_retain (plan, - input->unicodes, - input->glyphs, - !input->drop_tables->has (HB_OT_TAG_GSUB)); + input->unicodes, + input->glyphs, + !input->drop_tables->has (HB_OT_TAG_GSUB)); _create_old_gid_to_new_gid_map (face, - input->retain_gids, + input->retain_gids, plan->_glyphset, plan->glyph_map, - plan->reverse_glyph_map, - &plan->_num_output_glyphs); + plan->reverse_glyph_map, + &plan->_num_output_glyphs); return plan; } diff -Nru harfbuzz-2.5.3/src/hb-subset-plan.hh harfbuzz-2.6.2/src/hb-subset-plan.hh --- harfbuzz-2.5.3/src/hb-subset-plan.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-subset-plan.hh 2019-10-26 02:02:55.000000000 +0000 @@ -108,7 +108,7 @@ } inline bool new_gid_for_codepoint (hb_codepoint_t codepoint, - hb_codepoint_t *new_gid) const + hb_codepoint_t *new_gid) const { hb_codepoint_t old_gid = codepoint_to_glyph->get (codepoint); if (old_gid == HB_MAP_VALUE_INVALID) @@ -118,7 +118,7 @@ } inline bool new_gid_for_old_gid (hb_codepoint_t old_gid, - hb_codepoint_t *new_gid) const + hb_codepoint_t *new_gid) const { hb_codepoint_t gid = glyph_map->get (old_gid); if (gid == HB_MAP_VALUE_INVALID) @@ -129,7 +129,7 @@ } inline bool old_gid_for_new_gid (hb_codepoint_t new_gid, - hb_codepoint_t *old_gid) const + hb_codepoint_t *old_gid) const { hb_codepoint_t gid = reverse_glyph_map->get (new_gid); if (gid == HB_MAP_VALUE_INVALID) @@ -157,7 +157,7 @@ HB_INTERNAL hb_subset_plan_t * hb_subset_plan_create (hb_face_t *face, - hb_subset_input_t *input); + hb_subset_input_t *input); HB_INTERNAL void hb_subset_plan_destroy (hb_subset_plan_t *plan); diff -Nru harfbuzz-2.5.3/src/hb-ucd.cc harfbuzz-2.6.2/src/hb-ucd.cc --- harfbuzz-2.5.3/src/hb-ucd.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-ucd.cc 2019-10-26 02:02:55.000000000 +0000 @@ -15,6 +15,7 @@ */ #include "hb.hh" +#include "hb-unicode.hh" #include "hb-machinery.hh" #include "hb-ucd-table.hh" @@ -235,10 +236,6 @@ } #endif -extern "C" HB_INTERNAL -hb_unicode_funcs_t * -hb_ucd_get_unicode_funcs (); - hb_unicode_funcs_t * hb_ucd_get_unicode_funcs () { diff -Nru harfbuzz-2.5.3/src/hb-unicode.cc harfbuzz-2.6.2/src/hb-unicode.cc --- harfbuzz-2.5.3/src/hb-unicode.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-unicode.cc 2019-10-26 02:02:55.000000000 +0000 @@ -126,10 +126,12 @@ } #endif - -extern "C" hb_unicode_funcs_t *hb_ucd_get_unicode_funcs (); -extern "C" hb_unicode_funcs_t *hb_glib_get_unicode_funcs (); -extern "C" hb_unicode_funcs_t *hb_icu_get_unicode_funcs (); +#if !defined(HB_NO_UNICODE_FUNCS) && defined(HAVE_GLIB) +#include "hb-glib.h" +#endif +#if !defined(HB_NO_UNICODE_FUNCS) && defined(HAVE_ICU) && defined(HAVE_ICU_BUILTIN) +#include "hb-icu.h" +#endif hb_unicode_funcs_t * hb_unicode_funcs_get_default () @@ -453,6 +455,7 @@ #endif +#ifndef HB_NO_OT_SHAPE /* See hb-unicode.hh for details. */ const uint8_t _hb_modified_combining_class[256] = @@ -565,19 +568,19 @@ 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, /* HB_UNICODE_COMBINING_CLASS_INVALID */ }; +#endif /* * Emoji */ +#ifndef HB_NO_EMOJI_SEQUENCES #include "hb-unicode-emoji-table.hh" bool _hb_unicode_is_emoji_Extended_Pictographic (hb_codepoint_t cp) { - return hb_bsearch (&cp, _hb_unicode_emoji_Extended_Pictographic_table, - ARRAY_LENGTH (_hb_unicode_emoji_Extended_Pictographic_table), - sizeof (hb_unicode_range_t), - hb_unicode_range_t::cmp); + return _hb_emoji_is_Extended_Pictographic (cp); } +#endif diff -Nru harfbuzz-2.5.3/src/hb-unicode-emoji-table.hh harfbuzz-2.6.2/src/hb-unicode-emoji-table.hh --- harfbuzz-2.5.3/src/hb-unicode-emoji-table.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-unicode-emoji-table.hh 2019-10-26 02:02:55.000000000 +0000 @@ -23,88 +23,56 @@ #include "hb-unicode.hh" - -static const struct hb_unicode_range_t _hb_unicode_emoji_Extended_Pictographic_table[] = +static const uint8_t +_hb_emoji_u8[448] = { - {0x00A9, 0x00A9}, - {0x00AE, 0x00AE}, - {0x203C, 0x203C}, - {0x2049, 0x2049}, - {0x2122, 0x2122}, - {0x2139, 0x2139}, - {0x2194, 0x2199}, - {0x21A9, 0x21AA}, - {0x231A, 0x231B}, - {0x2328, 0x2328}, - {0x2388, 0x2388}, - {0x23CF, 0x23CF}, - {0x23E9, 0x23F3}, - {0x23F8, 0x23FA}, - {0x24C2, 0x24C2}, - {0x25AA, 0x25AB}, - {0x25B6, 0x25B6}, - {0x25C0, 0x25C0}, - {0x25FB, 0x25FE}, - {0x2600, 0x2605}, - {0x2607, 0x2612}, - {0x2614, 0x2685}, - {0x2690, 0x2705}, - {0x2708, 0x2712}, - {0x2714, 0x2714}, - {0x2716, 0x2716}, - {0x271D, 0x271D}, - {0x2721, 0x2721}, - {0x2728, 0x2728}, - {0x2733, 0x2734}, - {0x2744, 0x2744}, - {0x2747, 0x2747}, - {0x274C, 0x274C}, - {0x274E, 0x274E}, - {0x2753, 0x2755}, - {0x2757, 0x2757}, - {0x2763, 0x2767}, - {0x2795, 0x2797}, - {0x27A1, 0x27A1}, - {0x27B0, 0x27B0}, - {0x27BF, 0x27BF}, - {0x2934, 0x2935}, - {0x2B05, 0x2B07}, - {0x2B1B, 0x2B1C}, - {0x2B50, 0x2B50}, - {0x2B55, 0x2B55}, - {0x3030, 0x3030}, - {0x303D, 0x303D}, - {0x3297, 0x3297}, - {0x3299, 0x3299}, - {0x1F000, 0x1F0FF}, - {0x1F10D, 0x1F10F}, - {0x1F12F, 0x1F12F}, - {0x1F16C, 0x1F171}, - {0x1F17E, 0x1F17F}, - {0x1F18E, 0x1F18E}, - {0x1F191, 0x1F19A}, - {0x1F1AD, 0x1F1E5}, - {0x1F201, 0x1F20F}, - {0x1F21A, 0x1F21A}, - {0x1F22F, 0x1F22F}, - {0x1F232, 0x1F23A}, - {0x1F23C, 0x1F23F}, - {0x1F249, 0x1F3FA}, - {0x1F400, 0x1F53D}, - {0x1F546, 0x1F64F}, - {0x1F680, 0x1F6FF}, - {0x1F774, 0x1F77F}, - {0x1F7D5, 0x1F7FF}, - {0x1F80C, 0x1F80F}, - {0x1F848, 0x1F84F}, - {0x1F85A, 0x1F85F}, - {0x1F888, 0x1F88F}, - {0x1F8AE, 0x1F8FF}, - {0x1F90C, 0x1F93A}, - {0x1F93C, 0x1F945}, - {0x1F947, 0x1FFFD}, + 0, 0, 0, 0, 33, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84,118, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 0, 3, + 0, 0, 0, 0, 0, 0, 4, 5, 6, 7, 8, 7, 9, 10, 11, 0, + 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, + 7, 7, 7, 14, 15, 16, 17, 18, 19, 20, 7, 7, 7, 7, 7, 21, + 7, 7, 7, 7, 22, 23, 7, 7, 7, 24, 7, 14, 0, 25, 0, 26, + 27, 28, 29, 14, 30, 31, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 22, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 1, 0, 2, 0, 0, + 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,254, 7, 3, + 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, + 159,255,243,255,255,255,255,255,255,255,255,255,255,255,255,255, + 31, 0,255,255,255,255,255,255, 31,255, 3, 0, 0, 0, 8, 0, + 0, 0, 24, 0,120, 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 16, 0, 96, 0, 0, 8, 0, 0, 0, 0, + 255,255,255,255,255,255,255,127, 0, 96, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,240, 1, 64, 0, 0,254, 3, 0,224,255,255, + 255,255,255,255, 31, 0, 0, 0,254,127, 0, 0, 0, 0,252,115, + 0,254,255,255,255,255,255,255,255,255,255,255,255,255,255, 3, + 255,255,255,255,255,255,255, 31,192,255,255,255,255,255,255,255, + 255,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240,127, + 0, 0,224,255,255,255,255,127, 0,112, 0, 0, 0, 0, 0, 0, + 0,127, 0,124, 0, 0, 0, 0, 0,127, 0, 0, 0,192,255,255, + 0,240,255,255,255,255,255,243,159,255,255,255,255,255,255,255, }; +static inline unsigned +_hb_emoji_b4 (const uint8_t* a, unsigned i) +{ + return (a[i>>1]>>((i&1u)<<2))&15u; +} +static inline unsigned +_hb_emoji_b1 (const uint8_t* a, unsigned i) +{ + return (a[i>>3]>>((i&7u)<<0))&1u; +} +static inline uint_fast8_t +_hb_emoji_is_Extended_Pictographic (unsigned u) +{ + return u<131069u?_hb_emoji_b1(192+_hb_emoji_u8,((_hb_emoji_u8[64+(((_hb_emoji_b4(_hb_emoji_u8,u>>6>>4))<<4)+((u>>6)&15u))])<<6)+((u)&63u)):0; +} + + #endif /* HB_UNICODE_EMOJI_TABLE_HH */ /* == End of generated table == */ diff -Nru harfbuzz-2.5.3/src/hb-unicode.hh harfbuzz-2.6.2/src/hb-unicode.hh --- harfbuzz-2.5.3/src/hb-unicode.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-unicode.hh 2019-10-26 02:02:55.000000000 +0000 @@ -105,9 +105,6 @@ unsigned int modified_combining_class (hb_codepoint_t u) { - /* XXX This hack belongs to the Myanmar shaper. */ - if (unlikely (u == 0x1037u)) u = 0x103Au; - /* XXX This hack belongs to the USE shaper (for Tai Tham): * Reorder SAKOT to ensure it comes after any tone marks. */ if (unlikely (u == 0x1A60u)) return 254; @@ -395,4 +392,7 @@ _hb_unicode_is_emoji_Extended_Pictographic (hb_codepoint_t cp); +extern "C" HB_INTERNAL hb_unicode_funcs_t *hb_ucd_get_unicode_funcs (); + + #endif /* HB_UNICODE_HH */ diff -Nru harfbuzz-2.5.3/src/hb-uniscribe.cc harfbuzz-2.6.2/src/hb-uniscribe.cc --- harfbuzz-2.5.3/src/hb-uniscribe.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-uniscribe.cc 2019-10-26 02:02:55.000000000 +0000 @@ -28,6 +28,10 @@ #ifdef HAVE_UNISCRIBE +#ifdef HB_NO_OT_TAG +#error "Cannot compile 'uniscribe' shaper with HB_NO_OT_TAG." +#endif + #include "hb-shaper-impl.hh" #include @@ -54,13 +58,6 @@ * Functions for using HarfBuzz with the Windows fonts. **/ - -static inline uint16_t hb_uint16_swap (const uint16_t v) -{ return (v >> 8) | (v << 8); } -static inline uint32_t hb_uint32_swap (const uint32_t v) -{ return (hb_uint16_swap (v) << 16) | hb_uint16_swap (v >> 16); } - - typedef HRESULT (WINAPI *SIOT) /*ScriptItemizeOpenType*/( const WCHAR *pwcInChars, int cInChars, @@ -241,8 +238,9 @@ } }; - +#if HB_USE_ATEXIT static void free_static_uniscribe_shaper_funcs (); +#endif static struct hb_uniscribe_shaper_funcs_lazy_loader_t : hb_lazy_loader_t @@ -387,8 +385,8 @@ static const uint16_t name_IDs[] = { 1, 2, 3, 4, 6 }; unsigned int name_table_length = OT::name::min_size + - ARRAY_LENGTH (name_IDs) * OT::NameRecord::static_size + - name_str_len * 2; /* for name data in UTF16BE form */ + ARRAY_LENGTH (name_IDs) * OT::NameRecord::static_size + + name_str_len * 2; /* for name data in UTF16BE form */ unsigned int padded_name_table_length = ((name_table_length + 3) & ~3); unsigned int name_table_offset = (length + 3) & ~3; @@ -668,7 +666,7 @@ if (event->index != last_index) { - /* Save a snapshot of active features and the range. */ + /* Save a snapshot of active features and the range. */ range_record_t *range = range_records.push (); unsigned int offset = feature_records.length; @@ -703,7 +701,7 @@ } else { - active_feature_t *feature = active_features.find (&event->feature); + active_feature_t *feature = active_features.find (&event->feature); if (feature) active_features.remove (feature - active_features.arrayZ); } diff -Nru harfbuzz-2.5.3/src/hb-utf.hh harfbuzz-2.6.2/src/hb-utf.hh --- harfbuzz-2.5.3/src/hb-utf.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-utf.hh 2019-10-26 02:02:55.000000000 +0000 @@ -235,10 +235,10 @@ hb_codepoint_t h = text[-1]; if (likely (hb_in_range (h, 0xD800u, 0xDBFFu))) { - /* High-surrogate in h */ - *unicode = (h << 10) + c - ((0xD800u << 10) - 0x10000u + 0xDC00u); - text--; - return text; + /* High-surrogate in h */ + *unicode = (h << 10) + c - ((0xD800u << 10) - 0x10000u + 0xDC00u); + text--; + return text; } } diff -Nru harfbuzz-2.5.3/src/hb-vector.hh harfbuzz-2.6.2/src/hb-vector.hh --- harfbuzz-2.5.3/src/hb-vector.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-vector.hh 2019-10-26 02:02:55.000000000 +0000 @@ -143,13 +143,13 @@ operator writer_t () { return writer (); } hb_array_t sub_array (unsigned int start_offset, unsigned int count) const - { return as_array ().sub_array (start_offset, count);} + { return as_array ().sub_array (start_offset, count); } hb_array_t sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) const - { return as_array ().sub_array (start_offset, count);} + { return as_array ().sub_array (start_offset, count); } hb_array_t sub_array (unsigned int start_offset, unsigned int count) - { return as_array ().sub_array (start_offset, count);} + { return as_array ().sub_array (start_offset, count); } hb_array_t sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) - { return as_array ().sub_array (start_offset, count);} + { return as_array ().sub_array (start_offset, count); } hb_sorted_array_t as_sorted_array () { return hb_sorted_array (arrayZ, length); } @@ -290,7 +290,7 @@ typedef hb_sorted_array_t< Type> iter_t; const_iter_t iter () const { return as_array (); } const_iter_t citer () const { return as_array (); } - iter_t iter () { return as_array (); } + iter_t iter () { return as_array (); } operator iter_t () { return iter (); } operator const_iter_t () const { return iter (); } diff -Nru harfbuzz-2.5.3/src/hb-version.h harfbuzz-2.6.2/src/hb-version.h --- harfbuzz-2.5.3/src/hb-version.h 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/hb-version.h 2019-10-26 02:02:55.000000000 +0000 @@ -37,10 +37,10 @@ #define HB_VERSION_MAJOR 2 -#define HB_VERSION_MINOR 5 -#define HB_VERSION_MICRO 3 +#define HB_VERSION_MINOR 6 +#define HB_VERSION_MICRO 2 -#define HB_VERSION_STRING "2.5.3" +#define HB_VERSION_STRING "2.6.2" #define HB_VERSION_ATLEAST(major,minor,micro) \ ((major)*10000+(minor)*100+(micro) <= \ diff -Nru harfbuzz-2.5.3/src/Makefile.am harfbuzz-2.6.2/src/Makefile.am --- harfbuzz-2.5.3/src/Makefile.am 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/Makefile.am 2019-10-26 02:02:55.000000000 +0000 @@ -12,9 +12,15 @@ TESTS = check_PROGRAMS = +EXTRA_DIST += harfbuzz.cc + # Convenience targets: lib: $(BUILT_SOURCES) libharfbuzz.la libs: $(BUILT_SOURCES) $(lib_LTLIBRARIES) +tiny: + $(MAKE) $(AM_MAKEFLAGS) CPPFLAGS="-Os -DHB_TINY $(CPPFLAGS)" libs +tinyz: + $(MAKE) $(AM_MAKEFLAGS) CPPFLAGS="-Oz -DHB_TINY $(CPPFLAGS)" libs lib_LTLIBRARIES = libharfbuzz.la @@ -76,6 +82,13 @@ HBHEADERS += $(HB_DIRECTWRITE_headers) endif +if HAVE_GDI +HBCFLAGS += $(GDI_CXXFLAGS) +HBNONPCLIBS += $(GDI_LIBS) +HBSOURCES += $(HB_GDI_sources) +HBHEADERS += $(HB_GDI_headers) +endif + if HAVE_CORETEXT HBCFLAGS += $(CORETEXT_CFLAGS) HBNONPCLIBS += $(CORETEXT_LIBS) @@ -249,31 +262,38 @@ $(NULL) EXTRA_DIST += $(GENERATORS) -unicode-tables: arabic-table indic-table tag-table use-table emoji-table +unicode-tables: \ + arabic-table \ + emoji-table \ + indic-table \ + tag-table \ + ucd-table \ + use-table \ + emoji-table \ + $(NULL) arabic-table: gen-arabic-table.py ArabicShaping.txt UnicodeData.txt Blocks.txt $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-arabic-table.hh \ || ($(RM) $(srcdir)/hb-ot-shape-complex-arabic-table.hh; false) - +emoji-table: gen-emoji-table.py emoji-data.txt + $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-unicode-emoji-table.hh \ + || ($(RM) $(srcdir)/hb-unicode-emoji-table.hh; false) indic-table: gen-indic-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt Blocks.txt $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-indic-table.cc \ || ($(RM) $(srcdir)/hb-ot-shape-complex-indic-table.cc; false) - tag-table: gen-tag-table.py languagetags language-subtag-registry $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-tag-table.hh \ || ($(RM) $(srcdir)/hb-ot-tag-table.hh; false) - +ucd-table: gen-ucd-table.py ucd.nounihan.grouped.zip hb-common.h + $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ucd-table.hh \ + || ($(RM) $(srcdir)/hb-ucd-table.hh; false) use-table: gen-use-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt UnicodeData.txt Blocks.txt $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-use-table.cc \ || ($(RM) $(srcdir)/hb-ot-shape-complex-use-table.cc; false) - vowel-constraints: gen-vowel-constraints.py HBIndicVowelConstraints.txt Scripts.txt $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-vowel-constraints.cc \ || ($(RM) $(srcdir)/hb-ot-shape-complex-vowel-constraints.cc; false) -emoji-table: gen-emoji-table.py emoji-data.txt - $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-unicode-emoji-table.hh \ - || ($(RM) $(srcdir)/hb-unicode-emoji-table.hh; false) built-sources: $(BUILT_SOURCES) @@ -292,10 +312,27 @@ $(AM_V_GEN)(cd $(srcdir) && $(RAGEL) -e -F1 -o "$*.hh" "$*.rl") \ || ($(RM) "$@"; false) +harfbuzz.cc: Makefile.sources + $(AM_V_GEN) \ + for f in \ + $(HB_BASE_sources) \ + $(HB_GLIB_sources) \ + $(HB_FT_sources) \ + $(HB_GRAPHITE2_sources) \ + $(HB_UNISCRIBE_sources) \ + $(HB_GDI_sources) \ + $(HB_DIRECTWRITE_sources) \ + $(HB_CORETEXT_sources) \ + ; do echo '#include "'$$f'"'; done | \ + grep '[.]cc"' > $(srcdir)/harfbuzz.cc \ + || ($(RM) $(srcdir)/harfbuzz.cc; false) +BUILT_SOURCES += harfbuzz.cc + noinst_PROGRAMS = \ main \ test \ test-buffer-serialize \ + test-ot-meta \ test-ot-name \ test-gpos-size-params \ test-gsub-would-substitute \ @@ -314,6 +351,10 @@ test_buffer_serialize_CPPFLAGS = $(HBCFLAGS) test_buffer_serialize_LDADD = libharfbuzz.la $(HBLIBS) +test_ot_meta_SOURCES = test-ot-meta.cc +test_ot_meta_CPPFLAGS = $(HBCFLAGS) +test_ot_meta_LDADD = libharfbuzz.la $(HBLIBS) + test_ot_name_SOURCES = test-ot-name.cc test_ot_name_CPPFLAGS = $(HBCFLAGS) test_ot_name_LDADD = libharfbuzz.la $(HBLIBS) @@ -370,7 +411,7 @@ dump_use_data_CPPFLAGS = $(HBCFLAGS) dump_use_data_LDADD = libharfbuzz.la $(HBLIBS) -COMPILED_TESTS = test-algs test-iter test-meta test-ot-tag test-unicode-ranges +COMPILED_TESTS = test-algs test-iter test-meta test-number test-ot-tag test-unicode-ranges test-bimap COMPILED_TESTS_CPPFLAGS = $(HBCFLAGS) -DMAIN -UNDEBUG COMPILED_TESTS_LDADD = libharfbuzz.la $(HBLIBS) check_PROGRAMS += $(COMPILED_TESTS) @@ -388,6 +429,10 @@ test_meta_CPPFLAGS = $(COMPILED_TESTS_CPPFLAGS) test_meta_LDADD = $(COMPILED_TESTS_LDADD) +test_number_SOURCES = test-number.cc hb-number.cc +test_number_CPPFLAGS = $(COMPILED_TESTS_CPPFLAGS) +test_number_LDADD = $(COMPILED_TESTS_LDADD) + test_ot_tag_SOURCES = hb-ot-tag.cc test_ot_tag_CPPFLAGS = $(COMPILED_TESTS_CPPFLAGS) test_ot_tag_LDADD = $(COMPILED_TESTS_LDADD) @@ -396,6 +441,10 @@ test_unicode_ranges_CPPFLAGS = $(COMPILED_TESTS_CPPFLAGS) test_unicode_ranges_LDADD = $(COMPILED_TESTS_LDADD) +test_bimap_SOURCES = test-bimap.cc hb-static.cc +test_bimap_CPPFLAGS = $(COMPILED_TESTS_CPPFLAGS) +test_bimap_LDADD = $(COMPILED_TESTS_LDADD) + TESTS_ENVIRONMENT = \ srcdir="$(srcdir)" \ MAKE="$(MAKE) $(AM_MAKEFLAGS)" \ diff -Nru harfbuzz-2.5.3/src/Makefile.in harfbuzz-2.6.2/src/Makefile.in --- harfbuzz-2.5.3/src/Makefile.in 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/Makefile.in 2019-10-26 02:02:55.000000000 +0000 @@ -129,44 +129,48 @@ @HAVE_DIRECTWRITE_TRUE@am__append_22 = $(DIRECTWRITE_LIBS) @HAVE_DIRECTWRITE_TRUE@am__append_23 = $(HB_DIRECTWRITE_sources) @HAVE_DIRECTWRITE_TRUE@am__append_24 = $(HB_DIRECTWRITE_headers) -@HAVE_CORETEXT_TRUE@am__append_25 = $(CORETEXT_CFLAGS) -@HAVE_CORETEXT_TRUE@am__append_26 = $(CORETEXT_LIBS) -@HAVE_CORETEXT_TRUE@am__append_27 = $(HB_CORETEXT_sources) -@HAVE_CORETEXT_TRUE@am__append_28 = $(HB_CORETEXT_headers) -@HAVE_ICU_BUILTIN_TRUE@@HAVE_ICU_TRUE@am__append_29 = $(ICU_CFLAGS) -@HAVE_ICU_BUILTIN_TRUE@@HAVE_ICU_TRUE@am__append_30 = $(ICU_LIBS) -@HAVE_ICU_BUILTIN_TRUE@@HAVE_ICU_TRUE@am__append_31 = $(HB_ICU_sources) -@HAVE_ICU_BUILTIN_TRUE@@HAVE_ICU_TRUE@am__append_32 = $(HB_ICU_headers) -@HAVE_ICU_BUILTIN_FALSE@@HAVE_ICU_TRUE@am__append_33 = libharfbuzz-icu.la -@HAVE_ICU_BUILTIN_FALSE@@HAVE_ICU_TRUE@am__append_34 = $(HB_ICU_headers) -@HAVE_ICU_BUILTIN_FALSE@@HAVE_ICU_TRUE@am__append_35 = harfbuzz-icu.pc -@HAVE_GOBJECT_TRUE@am__append_36 = libharfbuzz-gobject.la -@HAVE_GOBJECT_TRUE@am__append_37 = $(HB_GOBJECT_DIST_headers) -@HAVE_GOBJECT_TRUE@am__append_38 = $(HB_GOBJECT_NODIST_headers) -@HAVE_GOBJECT_TRUE@am__append_39 = harfbuzz-gobject.pc -@HAVE_GOBJECT_TRUE@am__append_40 = \ +@HAVE_GDI_TRUE@am__append_25 = $(GDI_CXXFLAGS) +@HAVE_GDI_TRUE@am__append_26 = $(GDI_LIBS) +@HAVE_GDI_TRUE@am__append_27 = $(HB_GDI_sources) +@HAVE_GDI_TRUE@am__append_28 = $(HB_GDI_headers) +@HAVE_CORETEXT_TRUE@am__append_29 = $(CORETEXT_CFLAGS) +@HAVE_CORETEXT_TRUE@am__append_30 = $(CORETEXT_LIBS) +@HAVE_CORETEXT_TRUE@am__append_31 = $(HB_CORETEXT_sources) +@HAVE_CORETEXT_TRUE@am__append_32 = $(HB_CORETEXT_headers) +@HAVE_ICU_BUILTIN_TRUE@@HAVE_ICU_TRUE@am__append_33 = $(ICU_CFLAGS) +@HAVE_ICU_BUILTIN_TRUE@@HAVE_ICU_TRUE@am__append_34 = $(ICU_LIBS) +@HAVE_ICU_BUILTIN_TRUE@@HAVE_ICU_TRUE@am__append_35 = $(HB_ICU_sources) +@HAVE_ICU_BUILTIN_TRUE@@HAVE_ICU_TRUE@am__append_36 = $(HB_ICU_headers) +@HAVE_ICU_BUILTIN_FALSE@@HAVE_ICU_TRUE@am__append_37 = libharfbuzz-icu.la +@HAVE_ICU_BUILTIN_FALSE@@HAVE_ICU_TRUE@am__append_38 = $(HB_ICU_headers) +@HAVE_ICU_BUILTIN_FALSE@@HAVE_ICU_TRUE@am__append_39 = harfbuzz-icu.pc +@HAVE_GOBJECT_TRUE@am__append_40 = libharfbuzz-gobject.la +@HAVE_GOBJECT_TRUE@am__append_41 = $(HB_GOBJECT_DIST_headers) +@HAVE_GOBJECT_TRUE@am__append_42 = $(HB_GOBJECT_NODIST_headers) +@HAVE_GOBJECT_TRUE@am__append_43 = harfbuzz-gobject.pc +@HAVE_GOBJECT_TRUE@am__append_44 = \ @HAVE_GOBJECT_TRUE@ $(HB_GOBJECT_ENUM_sources) \ @HAVE_GOBJECT_TRUE@ $(HB_GOBJECT_ENUM_headers) \ @HAVE_GOBJECT_TRUE@ $(NULL) -@HAVE_GOBJECT_TRUE@am__append_41 = \ +@HAVE_GOBJECT_TRUE@am__append_45 = \ @HAVE_GOBJECT_TRUE@ $(HB_GOBJECT_ENUM_sources) \ @HAVE_GOBJECT_TRUE@ $(HB_GOBJECT_ENUM_headers) \ @HAVE_GOBJECT_TRUE@ $(NULL) -@HAVE_GOBJECT_TRUE@am__append_42 = harfbuzz-gobject.def +@HAVE_GOBJECT_TRUE@am__append_46 = harfbuzz-gobject.def noinst_PROGRAMS = main$(EXEEXT) test$(EXEEXT) \ - test-buffer-serialize$(EXEEXT) test-ot-name$(EXEEXT) \ - test-gpos-size-params$(EXEEXT) \ + test-buffer-serialize$(EXEEXT) test-ot-meta$(EXEEXT) \ + test-ot-name$(EXEEXT) test-gpos-size-params$(EXEEXT) \ test-gsub-would-substitute$(EXEEXT) $(am__EXEEXT_1) \ $(am__EXEEXT_3) bin_PROGRAMS = -@HAVE_CAIRO_FT_TRUE@@HAVE_FREETYPE_TRUE@am__append_43 = test-ot-color -@WITH_LIBSTDCXX_FALSE@am__append_44 = \ +@HAVE_CAIRO_FT_TRUE@@HAVE_FREETYPE_TRUE@am__append_47 = test-ot-color +@WITH_LIBSTDCXX_FALSE@am__append_48 = \ @WITH_LIBSTDCXX_FALSE@ check-libstdc++.sh \ @WITH_LIBSTDCXX_FALSE@ $(NULL) -@HAVE_INTROSPECTION_TRUE@am__append_45 = $(gir_DATA) $(typelib_DATA) +@HAVE_INTROSPECTION_TRUE@am__append_49 = $(gir_DATA) $(typelib_DATA) subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_link_flag.m4 \ @@ -190,8 +194,8 @@ "$(DESTDIR)$(pkgincludedir)" "$(DESTDIR)$(pkgincludedir)" am__EXEEXT_1 = am__EXEEXT_2 = test-algs$(EXEEXT) test-iter$(EXEEXT) \ - test-meta$(EXEEXT) test-ot-tag$(EXEEXT) \ - test-unicode-ranges$(EXEEXT) + test-meta$(EXEEXT) test-number$(EXEEXT) test-ot-tag$(EXEEXT) \ + test-unicode-ranges$(EXEEXT) test-bimap$(EXEEXT) @HAVE_CAIRO_FT_TRUE@@HAVE_FREETYPE_TRUE@am__EXEEXT_3 = test-ot-color$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -256,7 +260,8 @@ @HAVE_ICU_BUILTIN_FALSE@@HAVE_ICU_TRUE@ -rpath $(libdir) libharfbuzz_subset_la_DEPENDENCIES = libharfbuzz.la am__objects_5 = -am__objects_6 = libharfbuzz_subset_la-hb-ot-cff1-table.lo \ +am__objects_6 = libharfbuzz_subset_la-hb-number.lo \ + libharfbuzz_subset_la-hb-ot-cff1-table.lo \ libharfbuzz_subset_la-hb-ot-cff2-table.lo \ libharfbuzz_subset_la-hb-static.lo \ libharfbuzz_subset_la-hb-subset-cff-common.lo \ @@ -277,31 +282,34 @@ @HAVE_PTHREAD_TRUE@am__DEPENDENCIES_5 = $(am__DEPENDENCIES_1) @HAVE_UNISCRIBE_TRUE@am__DEPENDENCIES_6 = $(am__DEPENDENCIES_1) @HAVE_DIRECTWRITE_TRUE@am__DEPENDENCIES_7 = $(am__DEPENDENCIES_1) -@HAVE_CORETEXT_TRUE@am__DEPENDENCIES_8 = $(am__DEPENDENCIES_1) -am__DEPENDENCIES_9 = $(am__DEPENDENCIES_5) $(am__DEPENDENCIES_6) \ - $(am__DEPENDENCIES_7) $(am__DEPENDENCIES_8) -@HAVE_ICU_BUILTIN_TRUE@@HAVE_ICU_TRUE@am__DEPENDENCIES_10 = \ +@HAVE_GDI_TRUE@am__DEPENDENCIES_8 = $(am__DEPENDENCIES_1) +@HAVE_CORETEXT_TRUE@am__DEPENDENCIES_9 = $(am__DEPENDENCIES_1) +am__DEPENDENCIES_10 = $(am__DEPENDENCIES_5) $(am__DEPENDENCIES_6) \ + $(am__DEPENDENCIES_7) $(am__DEPENDENCIES_8) \ + $(am__DEPENDENCIES_9) +@HAVE_ICU_BUILTIN_TRUE@@HAVE_ICU_TRUE@am__DEPENDENCIES_11 = \ @HAVE_ICU_BUILTIN_TRUE@@HAVE_ICU_TRUE@ $(am__DEPENDENCIES_1) -am__DEPENDENCIES_11 = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \ - $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_9) \ - $(am__DEPENDENCIES_10) -libharfbuzz_la_DEPENDENCIES = $(am__DEPENDENCIES_11) +am__DEPENDENCIES_12 = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \ + $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_10) \ + $(am__DEPENDENCIES_11) +libharfbuzz_la_DEPENDENCIES = $(am__DEPENDENCIES_12) am__libharfbuzz_la_SOURCES_DIST = hb-aat-fdsc-table.hh \ hb-aat-layout-ankr-table.hh hb-aat-layout-bsln-table.hh \ hb-aat-layout-common.hh hb-aat-layout-feat-table.hh \ hb-aat-layout-just-table.hh hb-aat-layout-kerx-table.hh \ hb-aat-layout-lcar-table.hh hb-aat-layout-morx-table.hh \ - hb-aat-layout-trak-table.hh hb-aat-layout.cc hb-aat-layout.hh \ - hb-aat-ltag-table.hh hb-aat-map.cc hb-aat-map.hh hb-algs.hh \ - hb-array.hh hb-atomic.hh hb-blob.cc hb-blob.hh \ - hb-buffer-serialize.cc hb-buffer.cc hb-buffer.hh hb-cache.hh \ - hb-cff-interp-common.hh hb-cff-interp-cs-common.hh \ - hb-cff-interp-dict-common.hh hb-cff1-interp-cs.hh \ - hb-cff2-interp-cs.hh hb-common.cc hb-config.hh hb-debug.hh \ - hb-dispatch.hh hb-face.cc hb-face.hh hb-fallback-shape.cc \ - hb-font.cc hb-font.hh hb-iter.hh hb-kern.hh hb-machinery.hh \ - hb-map.cc hb-map.hh hb-bimap.hh hb-meta.hh hb-mutex.hh \ - hb-null.hh hb-object.hh hb-open-file.hh hb-open-type.hh \ + hb-aat-layout-opbd-table.hh hb-aat-layout-trak-table.hh \ + hb-aat-layout.cc hb-aat-layout.hh hb-aat-ltag-table.hh \ + hb-aat-map.cc hb-aat-map.hh hb-algs.hh hb-array.hh \ + hb-atomic.hh hb-blob.cc hb-blob.hh hb-buffer-serialize.cc \ + hb-buffer.cc hb-buffer.hh hb-cache.hh hb-cff-interp-common.hh \ + hb-cff-interp-cs-common.hh hb-cff-interp-dict-common.hh \ + hb-cff1-interp-cs.hh hb-cff2-interp-cs.hh hb-common.cc \ + hb-config.hh hb-debug.hh hb-dispatch.hh hb-face.cc hb-face.hh \ + hb-fallback-shape.cc hb-font.cc hb-font.hh hb-iter.hh \ + hb-kern.hh hb-machinery.hh hb-map.cc hb-map.hh hb-bimap.hh \ + hb-meta.hh hb-mutex.hh hb-null.hh hb-number.cc hb-number.hh \ + hb-object.hh hb-open-file.hh hb-open-type.hh \ hb-ot-cff-common.hh hb-ot-cff1-table.cc hb-ot-cff1-table.hh \ hb-ot-cff2-table.cc hb-ot-cff2-table.hh hb-ot-cmap-table.hh \ hb-ot-color-cbdt-table.hh hb-ot-color-colr-table.hh \ @@ -316,10 +324,12 @@ hb-ot-layout-gsubgpos.hh hb-ot-layout-jstf-table.hh \ hb-ot-layout.cc hb-ot-layout.hh hb-ot-map.cc hb-ot-map.hh \ hb-ot-math-table.hh hb-ot-math.cc hb-ot-maxp-table.hh \ - hb-ot-name-language-static.hh hb-ot-name-language.hh \ - hb-ot-name-table.hh hb-ot-name.cc hb-ot-os2-table.hh \ - hb-ot-os2-unicode-ranges.hh hb-ot-post-macroman.hh \ - hb-ot-post-table.hh hb-ot-shape-complex-arabic-fallback.hh \ + hb-ot-meta-table.hh hb-ot-meta.cc hb-ot-metrics.cc \ + hb-ot-metrics.hh hb-ot-name-language-static.hh \ + hb-ot-name-language.hh hb-ot-name-table.hh hb-ot-name.cc \ + hb-ot-os2-table.hh hb-ot-os2-unicode-ranges.hh \ + hb-ot-post-macroman.hh hb-ot-post-table.hh \ + hb-ot-shape-complex-arabic-fallback.hh \ hb-ot-shape-complex-arabic-table.hh \ hb-ot-shape-complex-arabic-win1256.hh \ hb-ot-shape-complex-arabic.cc hb-ot-shape-complex-arabic.hh \ @@ -347,30 +357,31 @@ hb-unicode-emoji-table.hh hb-unicode.cc hb-unicode.hh \ hb-utf.hh hb-vector.hh hb-warning.cc hb.hh \ hb-buffer-deserialize-json.hh hb-buffer-deserialize-text.hh \ - hb-ot-shape-complex-indic-machine.hh \ + hb-number-parser.hh hb-ot-shape-complex-indic-machine.hh \ hb-ot-shape-complex-khmer-machine.hh \ hb-ot-shape-complex-myanmar-machine.hh \ hb-ot-shape-complex-use-machine.hh hb-glib.cc hb-ft.cc \ - hb-graphite2.cc hb-uniscribe.cc hb-directwrite.cc \ + hb-graphite2.cc hb-uniscribe.cc hb-directwrite.cc hb-gdi.cc \ hb-coretext.cc hb-icu.cc hb-aat-layout.h hb-aat.h hb-blob.h \ hb-buffer.h hb-common.h hb-deprecated.h hb-face.h hb-font.h \ hb-map.h hb-ot-color.h hb-ot-deprecated.h hb-ot-font.h \ - hb-ot-layout.h hb-ot-math.h hb-ot-name.h hb-ot-shape.h \ - hb-ot-var.h hb-ot.h hb-set.h hb-shape-plan.h hb-shape.h \ - hb-unicode.h hb-version.h hb.h hb-glib.h hb-ft.h \ - hb-graphite2.h hb-uniscribe.h hb-directwrite.h hb-coretext.h \ - hb-icu.h + hb-ot-layout.h hb-ot-math.h hb-ot-meta.h hb-ot-metrics.h \ + hb-ot-name.h hb-ot-shape.h hb-ot-var.h hb-ot.h hb-set.h \ + hb-shape-plan.h hb-shape.h hb-unicode.h hb-version.h hb.h \ + hb-glib.h hb-ft.h hb-graphite2.h hb-uniscribe.h \ + hb-directwrite.h hb-gdi.h hb-coretext.h hb-icu.h am__objects_7 = libharfbuzz_la-hb-aat-layout.lo \ libharfbuzz_la-hb-aat-map.lo libharfbuzz_la-hb-blob.lo \ libharfbuzz_la-hb-buffer-serialize.lo \ libharfbuzz_la-hb-buffer.lo libharfbuzz_la-hb-common.lo \ libharfbuzz_la-hb-face.lo libharfbuzz_la-hb-fallback-shape.lo \ libharfbuzz_la-hb-font.lo libharfbuzz_la-hb-map.lo \ - libharfbuzz_la-hb-ot-cff1-table.lo \ + libharfbuzz_la-hb-number.lo libharfbuzz_la-hb-ot-cff1-table.lo \ libharfbuzz_la-hb-ot-cff2-table.lo \ libharfbuzz_la-hb-ot-color.lo libharfbuzz_la-hb-ot-face.lo \ libharfbuzz_la-hb-ot-font.lo libharfbuzz_la-hb-ot-layout.lo \ libharfbuzz_la-hb-ot-map.lo libharfbuzz_la-hb-ot-math.lo \ + libharfbuzz_la-hb-ot-meta.lo libharfbuzz_la-hb-ot-metrics.lo \ libharfbuzz_la-hb-ot-name.lo \ libharfbuzz_la-hb-ot-shape-complex-arabic.lo \ libharfbuzz_la-hb-ot-shape-complex-default.lo \ @@ -403,100 +414,115 @@ @HAVE_UNISCRIBE_TRUE@am__objects_16 = $(am__objects_15) am__objects_17 = libharfbuzz_la-hb-directwrite.lo @HAVE_DIRECTWRITE_TRUE@am__objects_18 = $(am__objects_17) -am__objects_19 = libharfbuzz_la-hb-coretext.lo -@HAVE_CORETEXT_TRUE@am__objects_20 = $(am__objects_19) -am__objects_21 = libharfbuzz_la-hb-icu.lo -@HAVE_ICU_BUILTIN_TRUE@@HAVE_ICU_TRUE@am__objects_22 = \ -@HAVE_ICU_BUILTIN_TRUE@@HAVE_ICU_TRUE@ $(am__objects_21) -am__objects_23 = $(am__objects_7) $(am__objects_8) $(am__objects_10) \ +am__objects_19 = libharfbuzz_la-hb-gdi.lo +@HAVE_GDI_TRUE@am__objects_20 = $(am__objects_19) +am__objects_21 = libharfbuzz_la-hb-coretext.lo +@HAVE_CORETEXT_TRUE@am__objects_22 = $(am__objects_21) +am__objects_23 = libharfbuzz_la-hb-icu.lo +@HAVE_ICU_BUILTIN_TRUE@@HAVE_ICU_TRUE@am__objects_24 = \ +@HAVE_ICU_BUILTIN_TRUE@@HAVE_ICU_TRUE@ $(am__objects_23) +am__objects_25 = $(am__objects_7) $(am__objects_8) $(am__objects_10) \ $(am__objects_12) $(am__objects_14) $(am__objects_16) \ - $(am__objects_18) $(am__objects_20) $(am__objects_22) -@HAVE_GLIB_TRUE@am__objects_24 = $(am__objects_5) -@HAVE_FREETYPE_TRUE@am__objects_25 = $(am__objects_5) -@HAVE_GRAPHITE2_TRUE@am__objects_26 = $(am__objects_5) -@HAVE_UNISCRIBE_TRUE@am__objects_27 = $(am__objects_5) -@HAVE_DIRECTWRITE_TRUE@am__objects_28 = $(am__objects_5) -@HAVE_CORETEXT_TRUE@am__objects_29 = $(am__objects_5) -@HAVE_ICU_BUILTIN_TRUE@@HAVE_ICU_TRUE@am__objects_30 = \ + $(am__objects_18) $(am__objects_20) $(am__objects_22) \ + $(am__objects_24) +@HAVE_GLIB_TRUE@am__objects_26 = $(am__objects_5) +@HAVE_FREETYPE_TRUE@am__objects_27 = $(am__objects_5) +@HAVE_GRAPHITE2_TRUE@am__objects_28 = $(am__objects_5) +@HAVE_UNISCRIBE_TRUE@am__objects_29 = $(am__objects_5) +@HAVE_DIRECTWRITE_TRUE@am__objects_30 = $(am__objects_5) +@HAVE_GDI_TRUE@am__objects_31 = $(am__objects_5) +@HAVE_CORETEXT_TRUE@am__objects_32 = $(am__objects_5) +@HAVE_ICU_BUILTIN_TRUE@@HAVE_ICU_TRUE@am__objects_33 = \ @HAVE_ICU_BUILTIN_TRUE@@HAVE_ICU_TRUE@ $(am__objects_5) -am__objects_31 = $(am__objects_8) $(am__objects_24) $(am__objects_25) \ - $(am__objects_26) $(am__objects_27) $(am__objects_28) \ - $(am__objects_29) $(am__objects_30) -am_libharfbuzz_la_OBJECTS = $(am__objects_23) $(am__objects_31) +am__objects_34 = $(am__objects_8) $(am__objects_26) $(am__objects_27) \ + $(am__objects_28) $(am__objects_29) $(am__objects_30) \ + $(am__objects_31) $(am__objects_32) $(am__objects_33) +am_libharfbuzz_la_OBJECTS = $(am__objects_25) $(am__objects_34) libharfbuzz_la_OBJECTS = $(am_libharfbuzz_la_OBJECTS) am_dump_indic_data_OBJECTS = \ dump_indic_data-dump-indic-data.$(OBJEXT) \ dump_indic_data-hb-ot-shape-complex-indic-table.$(OBJEXT) dump_indic_data_OBJECTS = $(am_dump_indic_data_OBJECTS) -dump_indic_data_DEPENDENCIES = libharfbuzz.la $(am__DEPENDENCIES_11) +dump_indic_data_DEPENDENCIES = libharfbuzz.la $(am__DEPENDENCIES_12) am_dump_khmer_data_OBJECTS = \ dump_khmer_data-dump-khmer-data.$(OBJEXT) \ dump_khmer_data-hb-ot-shape-complex-indic-table.$(OBJEXT) dump_khmer_data_OBJECTS = $(am_dump_khmer_data_OBJECTS) -dump_khmer_data_DEPENDENCIES = libharfbuzz.la $(am__DEPENDENCIES_11) +dump_khmer_data_DEPENDENCIES = libharfbuzz.la $(am__DEPENDENCIES_12) am_dump_myanmar_data_OBJECTS = \ dump_myanmar_data-dump-myanmar-data.$(OBJEXT) \ dump_myanmar_data-hb-ot-shape-complex-indic-table.$(OBJEXT) dump_myanmar_data_OBJECTS = $(am_dump_myanmar_data_OBJECTS) -dump_myanmar_data_DEPENDENCIES = libharfbuzz.la $(am__DEPENDENCIES_11) +dump_myanmar_data_DEPENDENCIES = libharfbuzz.la $(am__DEPENDENCIES_12) am_dump_use_data_OBJECTS = dump_use_data-dump-use-data.$(OBJEXT) \ dump_use_data-hb-ot-shape-complex-use-table.$(OBJEXT) dump_use_data_OBJECTS = $(am_dump_use_data_OBJECTS) -dump_use_data_DEPENDENCIES = libharfbuzz.la $(am__DEPENDENCIES_11) +dump_use_data_DEPENDENCIES = libharfbuzz.la $(am__DEPENDENCIES_12) am_main_OBJECTS = main-main.$(OBJEXT) main_OBJECTS = $(am_main_OBJECTS) -main_DEPENDENCIES = libharfbuzz.la $(am__DEPENDENCIES_11) +main_DEPENDENCIES = libharfbuzz.la $(am__DEPENDENCIES_12) am_test_OBJECTS = test-test.$(OBJEXT) test_OBJECTS = $(am_test_OBJECTS) -test_DEPENDENCIES = libharfbuzz.la $(am__DEPENDENCIES_11) \ +test_DEPENDENCIES = libharfbuzz.la $(am__DEPENDENCIES_12) \ $(am__DEPENDENCIES_1) am_test_algs_OBJECTS = test_algs-test-algs.$(OBJEXT) \ test_algs-hb-static.$(OBJEXT) test_algs_OBJECTS = $(am_test_algs_OBJECTS) -am__DEPENDENCIES_12 = libharfbuzz.la $(am__DEPENDENCIES_11) -test_algs_DEPENDENCIES = $(am__DEPENDENCIES_12) +am__DEPENDENCIES_13 = libharfbuzz.la $(am__DEPENDENCIES_12) +test_algs_DEPENDENCIES = $(am__DEPENDENCIES_13) +am_test_bimap_OBJECTS = test_bimap-test-bimap.$(OBJEXT) \ + test_bimap-hb-static.$(OBJEXT) +test_bimap_OBJECTS = $(am_test_bimap_OBJECTS) +test_bimap_DEPENDENCIES = $(am__DEPENDENCIES_13) am_test_buffer_serialize_OBJECTS = \ test_buffer_serialize-test-buffer-serialize.$(OBJEXT) test_buffer_serialize_OBJECTS = $(am_test_buffer_serialize_OBJECTS) test_buffer_serialize_DEPENDENCIES = libharfbuzz.la \ - $(am__DEPENDENCIES_11) + $(am__DEPENDENCIES_12) am_test_gpos_size_params_OBJECTS = \ test_gpos_size_params-test-gpos-size-params.$(OBJEXT) test_gpos_size_params_OBJECTS = $(am_test_gpos_size_params_OBJECTS) test_gpos_size_params_DEPENDENCIES = libharfbuzz.la \ - $(am__DEPENDENCIES_11) + $(am__DEPENDENCIES_12) am_test_gsub_would_substitute_OBJECTS = test_gsub_would_substitute-test-gsub-would-substitute.$(OBJEXT) test_gsub_would_substitute_OBJECTS = \ $(am_test_gsub_would_substitute_OBJECTS) test_gsub_would_substitute_DEPENDENCIES = libharfbuzz.la \ - $(am__DEPENDENCIES_11) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_12) $(am__DEPENDENCIES_1) am_test_iter_OBJECTS = test_iter-test-iter.$(OBJEXT) \ test_iter-hb-static.$(OBJEXT) test_iter_OBJECTS = $(am_test_iter_OBJECTS) -test_iter_DEPENDENCIES = $(am__DEPENDENCIES_12) +test_iter_DEPENDENCIES = $(am__DEPENDENCIES_13) am_test_meta_OBJECTS = test_meta-test-meta.$(OBJEXT) \ test_meta-hb-static.$(OBJEXT) test_meta_OBJECTS = $(am_test_meta_OBJECTS) -test_meta_DEPENDENCIES = $(am__DEPENDENCIES_12) +test_meta_DEPENDENCIES = $(am__DEPENDENCIES_13) +am_test_number_OBJECTS = test_number-test-number.$(OBJEXT) \ + test_number-hb-number.$(OBJEXT) +test_number_OBJECTS = $(am_test_number_OBJECTS) +test_number_DEPENDENCIES = $(am__DEPENDENCIES_13) am__test_ot_color_SOURCES_DIST = test-ot-color.cc @HAVE_CAIRO_FT_TRUE@@HAVE_FREETYPE_TRUE@am_test_ot_color_OBJECTS = test_ot_color-test-ot-color.$(OBJEXT) test_ot_color_OBJECTS = $(am_test_ot_color_OBJECTS) @HAVE_CAIRO_FT_TRUE@@HAVE_FREETYPE_TRUE@test_ot_color_DEPENDENCIES = \ @HAVE_CAIRO_FT_TRUE@@HAVE_FREETYPE_TRUE@ libharfbuzz.la \ -@HAVE_CAIRO_FT_TRUE@@HAVE_FREETYPE_TRUE@ $(am__DEPENDENCIES_11) \ +@HAVE_CAIRO_FT_TRUE@@HAVE_FREETYPE_TRUE@ $(am__DEPENDENCIES_12) \ @HAVE_CAIRO_FT_TRUE@@HAVE_FREETYPE_TRUE@ $(am__DEPENDENCIES_1) \ @HAVE_CAIRO_FT_TRUE@@HAVE_FREETYPE_TRUE@ $(am__DEPENDENCIES_1) \ @HAVE_CAIRO_FT_TRUE@@HAVE_FREETYPE_TRUE@ $(am__DEPENDENCIES_1) +am_test_ot_meta_OBJECTS = test_ot_meta-test-ot-meta.$(OBJEXT) +test_ot_meta_OBJECTS = $(am_test_ot_meta_OBJECTS) +test_ot_meta_DEPENDENCIES = libharfbuzz.la $(am__DEPENDENCIES_12) am_test_ot_name_OBJECTS = test_ot_name-test-ot-name.$(OBJEXT) test_ot_name_OBJECTS = $(am_test_ot_name_OBJECTS) -test_ot_name_DEPENDENCIES = libharfbuzz.la $(am__DEPENDENCIES_11) +test_ot_name_DEPENDENCIES = libharfbuzz.la $(am__DEPENDENCIES_12) am_test_ot_tag_OBJECTS = test_ot_tag-hb-ot-tag.$(OBJEXT) test_ot_tag_OBJECTS = $(am_test_ot_tag_OBJECTS) -test_ot_tag_DEPENDENCIES = $(am__DEPENDENCIES_12) +test_ot_tag_DEPENDENCIES = $(am__DEPENDENCIES_13) am_test_unicode_ranges_OBJECTS = \ test_unicode_ranges-test-unicode-ranges.$(OBJEXT) test_unicode_ranges_OBJECTS = $(am_test_unicode_ranges_OBJECTS) -test_unicode_ranges_DEPENDENCIES = $(am__DEPENDENCIES_12) +test_unicode_ranges_DEPENDENCIES = $(am__DEPENDENCIES_13) am__dist_check_SCRIPTS_DIST = check-c-linkage-decls.sh \ check-externs.sh check-header-guards.sh check-includes.sh \ check-static-inits.sh check-symbols.sh check-libstdc++.sh @@ -538,10 +564,12 @@ ./$(DEPDIR)/libharfbuzz_la-hb-fallback-shape.Plo \ ./$(DEPDIR)/libharfbuzz_la-hb-font.Plo \ ./$(DEPDIR)/libharfbuzz_la-hb-ft.Plo \ + ./$(DEPDIR)/libharfbuzz_la-hb-gdi.Plo \ ./$(DEPDIR)/libharfbuzz_la-hb-glib.Plo \ ./$(DEPDIR)/libharfbuzz_la-hb-graphite2.Plo \ ./$(DEPDIR)/libharfbuzz_la-hb-icu.Plo \ ./$(DEPDIR)/libharfbuzz_la-hb-map.Plo \ + ./$(DEPDIR)/libharfbuzz_la-hb-number.Plo \ ./$(DEPDIR)/libharfbuzz_la-hb-ot-cff1-table.Plo \ ./$(DEPDIR)/libharfbuzz_la-hb-ot-cff2-table.Plo \ ./$(DEPDIR)/libharfbuzz_la-hb-ot-color.Plo \ @@ -550,6 +578,8 @@ ./$(DEPDIR)/libharfbuzz_la-hb-ot-layout.Plo \ ./$(DEPDIR)/libharfbuzz_la-hb-ot-map.Plo \ ./$(DEPDIR)/libharfbuzz_la-hb-ot-math.Plo \ + ./$(DEPDIR)/libharfbuzz_la-hb-ot-meta.Plo \ + ./$(DEPDIR)/libharfbuzz_la-hb-ot-metrics.Plo \ ./$(DEPDIR)/libharfbuzz_la-hb-ot-name.Plo \ ./$(DEPDIR)/libharfbuzz_la-hb-ot-shape-complex-arabic.Plo \ ./$(DEPDIR)/libharfbuzz_la-hb-ot-shape-complex-default.Plo \ @@ -577,6 +607,7 @@ ./$(DEPDIR)/libharfbuzz_la-hb-unicode.Plo \ ./$(DEPDIR)/libharfbuzz_la-hb-uniscribe.Plo \ ./$(DEPDIR)/libharfbuzz_la-hb-warning.Plo \ + ./$(DEPDIR)/libharfbuzz_subset_la-hb-number.Plo \ ./$(DEPDIR)/libharfbuzz_subset_la-hb-ot-cff1-table.Plo \ ./$(DEPDIR)/libharfbuzz_subset_la-hb-ot-cff2-table.Plo \ ./$(DEPDIR)/libharfbuzz_subset_la-hb-static.Plo \ @@ -589,6 +620,8 @@ ./$(DEPDIR)/main-main.Po ./$(DEPDIR)/test-test.Po \ ./$(DEPDIR)/test_algs-hb-static.Po \ ./$(DEPDIR)/test_algs-test-algs.Po \ + ./$(DEPDIR)/test_bimap-hb-static.Po \ + ./$(DEPDIR)/test_bimap-test-bimap.Po \ ./$(DEPDIR)/test_buffer_serialize-test-buffer-serialize.Po \ ./$(DEPDIR)/test_gpos_size_params-test-gpos-size-params.Po \ ./$(DEPDIR)/test_gsub_would_substitute-test-gsub-would-substitute.Po \ @@ -596,7 +629,10 @@ ./$(DEPDIR)/test_iter-test-iter.Po \ ./$(DEPDIR)/test_meta-hb-static.Po \ ./$(DEPDIR)/test_meta-test-meta.Po \ + ./$(DEPDIR)/test_number-hb-number.Po \ + ./$(DEPDIR)/test_number-test-number.Po \ ./$(DEPDIR)/test_ot_color-test-ot-color.Po \ + ./$(DEPDIR)/test_ot_meta-test-ot-meta.Po \ ./$(DEPDIR)/test_ot_name-test-ot-name.Po \ ./$(DEPDIR)/test_ot_tag-hb-ot-tag.Po \ ./$(DEPDIR)/test_unicode_ranges-test-unicode-ranges.Po @@ -643,10 +679,12 @@ $(libharfbuzz_la_SOURCES) $(dump_indic_data_SOURCES) \ $(dump_khmer_data_SOURCES) $(dump_myanmar_data_SOURCES) \ $(dump_use_data_SOURCES) $(main_SOURCES) $(test_SOURCES) \ - $(test_algs_SOURCES) $(test_buffer_serialize_SOURCES) \ + $(test_algs_SOURCES) $(test_bimap_SOURCES) \ + $(test_buffer_serialize_SOURCES) \ $(test_gpos_size_params_SOURCES) \ $(test_gsub_would_substitute_SOURCES) $(test_iter_SOURCES) \ - $(test_meta_SOURCES) $(test_ot_color_SOURCES) \ + $(test_meta_SOURCES) $(test_number_SOURCES) \ + $(test_ot_color_SOURCES) $(test_ot_meta_SOURCES) \ $(test_ot_name_SOURCES) $(test_ot_tag_SOURCES) \ $(test_unicode_ranges_SOURCES) DIST_SOURCES = $(am__libharfbuzz_gobject_la_SOURCES_DIST) \ @@ -655,10 +693,12 @@ $(am__libharfbuzz_la_SOURCES_DIST) $(dump_indic_data_SOURCES) \ $(dump_khmer_data_SOURCES) $(dump_myanmar_data_SOURCES) \ $(dump_use_data_SOURCES) $(main_SOURCES) $(test_SOURCES) \ - $(test_algs_SOURCES) $(test_buffer_serialize_SOURCES) \ + $(test_algs_SOURCES) $(test_bimap_SOURCES) \ + $(test_buffer_serialize_SOURCES) \ $(test_gpos_size_params_SOURCES) \ $(test_gsub_would_substitute_SOURCES) $(test_iter_SOURCES) \ - $(test_meta_SOURCES) $(am__test_ot_color_SOURCES_DIST) \ + $(test_meta_SOURCES) $(test_number_SOURCES) \ + $(am__test_ot_color_SOURCES_DIST) $(test_ot_meta_SOURCES) \ $(test_ot_name_SOURCES) $(test_ot_tag_SOURCES) \ $(test_unicode_ranges_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ @@ -678,11 +718,12 @@ am__pkginclude_HEADERS_DIST = hb-aat-layout.h hb-aat.h hb-blob.h \ hb-buffer.h hb-common.h hb-deprecated.h hb-face.h hb-font.h \ hb-map.h hb-ot-color.h hb-ot-deprecated.h hb-ot-font.h \ - hb-ot-layout.h hb-ot-math.h hb-ot-name.h hb-ot-shape.h \ - hb-ot-var.h hb-ot.h hb-set.h hb-shape-plan.h hb-shape.h \ - hb-unicode.h hb-version.h hb.h hb-glib.h hb-ft.h \ - hb-graphite2.h hb-uniscribe.h hb-directwrite.h hb-coretext.h \ - hb-icu.h hb-subset.h hb-gobject.h hb-gobject-structs.h + hb-ot-layout.h hb-ot-math.h hb-ot-meta.h hb-ot-metrics.h \ + hb-ot-name.h hb-ot-shape.h hb-ot-var.h hb-ot.h hb-set.h \ + hb-shape-plan.h hb-shape.h hb-unicode.h hb-version.h hb.h \ + hb-glib.h hb-ft.h hb-graphite2.h hb-uniscribe.h \ + hb-directwrite.h hb-gdi.h hb-coretext.h hb-icu.h hb-subset.h \ + hb-gobject.h hb-gobject-structs.h HEADERS = $(nodist_pkginclude_HEADERS) $(pkginclude_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive @@ -970,6 +1011,8 @@ FREETYPE_DEPS = @FREETYPE_DEPS@ FREETYPE_LIBS = @FREETYPE_LIBS@ GCOV = @GCOV@ +GDI_CFLAGS = @GDI_CFLAGS@ +GDI_LIBS = @GDI_LIBS@ GENHTML = @GENHTML@ GIT = @GIT@ GLIB_CFLAGS = @GLIB_CFLAGS@ @@ -1111,18 +1154,19 @@ NULL = SUBDIRS = DIST_SUBDIRS = -BUILT_SOURCES = hb-version.h $(am__append_40) $(RAGEL_GENERATED) -EXTRA_DIST = hb-version.h.in harfbuzz.pc.in harfbuzz-config.cmake.in \ - harfbuzz-subset.pc.in harfbuzz-icu.pc.in \ - harfbuzz-gobject.pc.in hb-gobject-enums.cc.tmpl \ - hb-gobject-enums.h.tmpl $(NULL) $(GENERATORS) \ - $(HB_BASE_RAGEL_sources) $(NULL) -CLEANFILES = $(pkgconfig_DATA) $(DEF_FILES) $(am__append_45) -DISTCLEANFILES = $(am__append_41) +BUILT_SOURCES = hb-version.h $(am__append_44) $(RAGEL_GENERATED) \ + harfbuzz.cc +EXTRA_DIST = harfbuzz.cc hb-version.h.in harfbuzz.pc.in \ + harfbuzz-config.cmake.in harfbuzz-subset.pc.in \ + harfbuzz-icu.pc.in harfbuzz-gobject.pc.in \ + hb-gobject-enums.cc.tmpl hb-gobject-enums.h.tmpl $(NULL) \ + $(GENERATORS) $(HB_BASE_RAGEL_sources) $(NULL) +CLEANFILES = $(pkgconfig_DATA) $(DEF_FILES) $(am__append_49) +DISTCLEANFILES = $(am__append_45) MAINTAINERCLEANFILES = DISTCHECK_CONFIGURE_FLAGS = --enable-introspection lib_LTLIBRARIES = libharfbuzz.la libharfbuzz-subset.la \ - $(am__append_33) $(am__append_36) + $(am__append_37) $(am__append_40) HB_BASE_sources = \ hb-aat-fdsc-table.hh \ hb-aat-layout-ankr-table.hh \ @@ -1133,6 +1177,7 @@ hb-aat-layout-kerx-table.hh \ hb-aat-layout-lcar-table.hh \ hb-aat-layout-morx-table.hh \ + hb-aat-layout-opbd-table.hh \ hb-aat-layout-trak-table.hh \ hb-aat-layout.cc \ hb-aat-layout.hh \ @@ -1171,6 +1216,8 @@ hb-meta.hh \ hb-mutex.hh \ hb-null.hh \ + hb-number.cc \ + hb-number.hh \ hb-object.hh \ hb-open-file.hh \ hb-open-type.hh \ @@ -1211,6 +1258,10 @@ hb-ot-math-table.hh \ hb-ot-math.cc \ hb-ot-maxp-table.hh \ + hb-ot-meta-table.hh \ + hb-ot-meta.cc \ + hb-ot-metrics.cc \ + hb-ot-metrics.hh \ hb-ot-name-language-static.hh \ hb-ot-name-language.hh \ hb-ot-name-table.hh \ @@ -1285,6 +1336,7 @@ HB_BASE_RAGEL_GENERATED_sources = \ hb-buffer-deserialize-json.hh \ hb-buffer-deserialize-text.hh \ + hb-number-parser.hh \ hb-ot-shape-complex-indic-machine.hh \ hb-ot-shape-complex-khmer-machine.hh \ hb-ot-shape-complex-myanmar-machine.hh \ @@ -1294,6 +1346,7 @@ HB_BASE_RAGEL_sources = \ hb-buffer-deserialize-json.rl \ hb-buffer-deserialize-text.rl \ + hb-number-parser.rl \ hb-ot-shape-complex-indic-machine.rl \ hb-ot-shape-complex-khmer-machine.rl \ hb-ot-shape-complex-myanmar-machine.rl \ @@ -1315,6 +1368,8 @@ hb-ot-font.h \ hb-ot-layout.h \ hb-ot-math.h \ + hb-ot-meta.h \ + hb-ot-metrics.h \ hb-ot-name.h \ hb-ot-shape.h \ hb-ot-var.h \ @@ -1341,6 +1396,8 @@ HB_CORETEXT_headers = hb-coretext.h HB_DIRECTWRITE_sources = hb-directwrite.cc HB_DIRECTWRITE_headers = hb-directwrite.h +HB_GDI_sources = hb-gdi.cc +HB_GDI_headers = hb-gdi.h HB_UNISCRIBE_sources = hb-uniscribe.cc HB_UNISCRIBE_headers = hb-uniscribe.h @@ -1350,6 +1407,8 @@ # Sources for libharfbuzz-subset HB_SUBSET_sources = \ + hb-number.cc \ + hb-number.hh \ hb-ot-cff1-table.cc \ hb-ot-cff2-table.cc \ hb-static.cc \ @@ -1383,21 +1442,21 @@ HB_GOBJECT_headers = $(HB_GOBJECT_DIST_headers) $(HB_GOBJECT_NODIST_headers) HBCFLAGS = $(am__append_1) $(am__append_3) $(am__append_8) \ $(am__append_12) $(am__append_17) $(am__append_21) \ - $(am__append_25) $(am__append_29) + $(am__append_25) $(am__append_29) $(am__append_33) # Put the library together HBLIBS = $(am__append_4) $(am__append_9) $(am__append_13) \ - $(HBNONPCLIBS) $(am__append_30) + $(HBNONPCLIBS) $(am__append_34) HBNONPCLIBS = $(am__append_2) $(am__append_18) $(am__append_22) \ - $(am__append_26) + $(am__append_26) $(am__append_30) HBDEPS = $(am__append_5) $(am__append_14) HBSOURCES = $(HB_BASE_sources) $(HB_BASE_RAGEL_GENERATED_sources) \ $(am__append_6) $(am__append_10) $(am__append_15) \ $(am__append_19) $(am__append_23) $(am__append_27) \ - $(am__append_31) + $(am__append_31) $(am__append_35) HBHEADERS = $(HB_BASE_headers) $(am__append_7) $(am__append_11) \ $(am__append_16) $(am__append_20) $(am__append_24) \ - $(am__append_28) $(am__append_32) + $(am__append_28) $(am__append_32) $(am__append_36) @OS_WIN32_TRUE@export_symbols = -export-symbols harfbuzz.def @OS_WIN32_TRUE@harfbuzz_def_dependency = harfbuzz.def @OS_WIN32_TRUE@export_symbols_subset = -export-symbols harfbuzz-subset.def @@ -1419,11 +1478,11 @@ libharfbuzz_la_LIBADD = $(HBLIBS) EXTRA_libharfbuzz_la_DEPENDENCIES = $(harfbuzz_def_dependency) pkginclude_HEADERS = $(HBHEADERS) $(HB_SUBSET_headers) \ - $(am__append_34) $(am__append_37) -nodist_pkginclude_HEADERS = $(am__append_38) + $(am__append_38) $(am__append_41) +nodist_pkginclude_HEADERS = $(am__append_42) pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = harfbuzz.pc harfbuzz-subset.pc $(am__append_35) \ - $(am__append_39) +pkgconfig_DATA = harfbuzz.pc harfbuzz-subset.pc $(am__append_39) \ + $(am__append_43) cmakedir = $(libdir)/cmake/harfbuzz cmake_DATA = harfbuzz-config.cmake libharfbuzz_subset_la_SOURCES = $(HB_SUBSET_sources) @@ -1444,7 +1503,7 @@ @HAVE_GOBJECT_TRUE@libharfbuzz_gobject_la_LIBADD = $(GOBJECT_LIBS) libharfbuzz.la @HAVE_GOBJECT_TRUE@EXTRA_libharfbuzz_gobject_la_DEPENDENCIES = $(harfbuzz_gobject_def_dependency) DEF_FILES = harfbuzz.def harfbuzz-subset.def harfbuzz-icu.def \ - harfbuzz-deprecated-symbols.txt $(am__append_42) + harfbuzz-deprecated-symbols.txt $(am__append_46) GENERATORS = \ gen-arabic-table.py \ gen-def.py \ @@ -1470,6 +1529,9 @@ test_buffer_serialize_SOURCES = test-buffer-serialize.cc test_buffer_serialize_CPPFLAGS = $(HBCFLAGS) test_buffer_serialize_LDADD = libharfbuzz.la $(HBLIBS) +test_ot_meta_SOURCES = test-ot-meta.cc +test_ot_meta_CPPFLAGS = $(HBCFLAGS) +test_ot_meta_LDADD = libharfbuzz.la $(HBLIBS) test_ot_name_SOURCES = test-ot-name.cc test_ot_name_CPPFLAGS = $(HBCFLAGS) test_ot_name_LDADD = libharfbuzz.la $(HBLIBS) @@ -1484,7 +1546,7 @@ @HAVE_CAIRO_FT_TRUE@@HAVE_FREETYPE_TRUE@test_ot_color_LDADD = libharfbuzz.la $(HBLIBS) $(FREETYPE_LIBS) $(CAIRO_LIBS) $(CAIRO_FT_LIBS) dist_check_SCRIPTS = check-c-linkage-decls.sh check-externs.sh \ check-header-guards.sh check-includes.sh check-static-inits.sh \ - check-symbols.sh $(NULL) $(am__append_44) + check-symbols.sh $(NULL) $(am__append_48) dump_indic_data_SOURCES = dump-indic-data.cc hb-ot-shape-complex-indic-table.cc dump_indic_data_CPPFLAGS = $(HBCFLAGS) dump_indic_data_LDADD = libharfbuzz.la $(HBLIBS) @@ -1497,7 +1559,7 @@ dump_use_data_SOURCES = dump-use-data.cc hb-ot-shape-complex-use-table.cc dump_use_data_CPPFLAGS = $(HBCFLAGS) dump_use_data_LDADD = libharfbuzz.la $(HBLIBS) -COMPILED_TESTS = test-algs test-iter test-meta test-ot-tag test-unicode-ranges +COMPILED_TESTS = test-algs test-iter test-meta test-number test-ot-tag test-unicode-ranges test-bimap COMPILED_TESTS_CPPFLAGS = $(HBCFLAGS) -DMAIN -UNDEBUG COMPILED_TESTS_LDADD = libharfbuzz.la $(HBLIBS) test_algs_SOURCES = test-algs.cc hb-static.cc @@ -1509,12 +1571,18 @@ test_meta_SOURCES = test-meta.cc hb-static.cc test_meta_CPPFLAGS = $(COMPILED_TESTS_CPPFLAGS) test_meta_LDADD = $(COMPILED_TESTS_LDADD) +test_number_SOURCES = test-number.cc hb-number.cc +test_number_CPPFLAGS = $(COMPILED_TESTS_CPPFLAGS) +test_number_LDADD = $(COMPILED_TESTS_LDADD) test_ot_tag_SOURCES = hb-ot-tag.cc test_ot_tag_CPPFLAGS = $(COMPILED_TESTS_CPPFLAGS) test_ot_tag_LDADD = $(COMPILED_TESTS_LDADD) test_unicode_ranges_SOURCES = test-unicode-ranges.cc test_unicode_ranges_CPPFLAGS = $(COMPILED_TESTS_CPPFLAGS) test_unicode_ranges_LDADD = $(COMPILED_TESTS_LDADD) +test_bimap_SOURCES = test-bimap.cc hb-static.cc +test_bimap_CPPFLAGS = $(COMPILED_TESTS_CPPFLAGS) +test_bimap_LDADD = $(COMPILED_TESTS_LDADD) TESTS_ENVIRONMENT = \ srcdir="$(srcdir)" \ MAKE="$(MAKE) $(AM_MAKEFLAGS)" \ @@ -1754,6 +1822,10 @@ @rm -f test-algs$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_algs_OBJECTS) $(test_algs_LDADD) $(LIBS) +test-bimap$(EXEEXT): $(test_bimap_OBJECTS) $(test_bimap_DEPENDENCIES) $(EXTRA_test_bimap_DEPENDENCIES) + @rm -f test-bimap$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_bimap_OBJECTS) $(test_bimap_LDADD) $(LIBS) + test-buffer-serialize$(EXEEXT): $(test_buffer_serialize_OBJECTS) $(test_buffer_serialize_DEPENDENCIES) $(EXTRA_test_buffer_serialize_DEPENDENCIES) @rm -f test-buffer-serialize$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_buffer_serialize_OBJECTS) $(test_buffer_serialize_LDADD) $(LIBS) @@ -1774,10 +1846,18 @@ @rm -f test-meta$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_meta_OBJECTS) $(test_meta_LDADD) $(LIBS) +test-number$(EXEEXT): $(test_number_OBJECTS) $(test_number_DEPENDENCIES) $(EXTRA_test_number_DEPENDENCIES) + @rm -f test-number$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_number_OBJECTS) $(test_number_LDADD) $(LIBS) + test-ot-color$(EXEEXT): $(test_ot_color_OBJECTS) $(test_ot_color_DEPENDENCIES) $(EXTRA_test_ot_color_DEPENDENCIES) @rm -f test-ot-color$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_ot_color_OBJECTS) $(test_ot_color_LDADD) $(LIBS) +test-ot-meta$(EXEEXT): $(test_ot_meta_OBJECTS) $(test_ot_meta_DEPENDENCIES) $(EXTRA_test_ot_meta_DEPENDENCIES) + @rm -f test-ot-meta$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(test_ot_meta_OBJECTS) $(test_ot_meta_LDADD) $(LIBS) + test-ot-name$(EXEEXT): $(test_ot_name_OBJECTS) $(test_ot_name_DEPENDENCIES) $(EXTRA_test_ot_name_DEPENDENCIES) @rm -f test-ot-name$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_ot_name_OBJECTS) $(test_ot_name_LDADD) $(LIBS) @@ -1819,10 +1899,12 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_la-hb-fallback-shape.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_la-hb-font.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_la-hb-ft.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_la-hb-gdi.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_la-hb-glib.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_la-hb-graphite2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_la-hb-icu.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_la-hb-map.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_la-hb-number.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_la-hb-ot-cff1-table.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_la-hb-ot-cff2-table.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_la-hb-ot-color.Plo@am__quote@ # am--include-marker @@ -1831,6 +1913,8 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_la-hb-ot-layout.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_la-hb-ot-map.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_la-hb-ot-math.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_la-hb-ot-meta.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_la-hb-ot-metrics.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_la-hb-ot-name.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_la-hb-ot-shape-complex-arabic.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_la-hb-ot-shape-complex-default.Plo@am__quote@ # am--include-marker @@ -1858,6 +1942,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_la-hb-unicode.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_la-hb-uniscribe.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_la-hb-warning.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_subset_la-hb-number.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_subset_la-hb-ot-cff1-table.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_subset_la-hb-ot-cff2-table.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libharfbuzz_subset_la-hb-static.Plo@am__quote@ # am--include-marker @@ -1871,6 +1956,8 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_algs-hb-static.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_algs-test-algs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_bimap-hb-static.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_bimap-test-bimap.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_buffer_serialize-test-buffer-serialize.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_gpos_size_params-test-gpos-size-params.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_gsub_would_substitute-test-gsub-would-substitute.Po@am__quote@ # am--include-marker @@ -1878,7 +1965,10 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_iter-test-iter.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_meta-hb-static.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_meta-test-meta.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_number-hb-number.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_number-test-number.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ot_color-test-ot-color.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ot_meta-test-ot-meta.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ot_name-test-ot-name.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ot_tag-hb-ot-tag.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_unicode_ranges-test-unicode-ranges.Po@am__quote@ # am--include-marker @@ -1931,6 +2021,13 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libharfbuzz_icu_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libharfbuzz_icu_la-hb-icu.lo `test -f 'hb-icu.cc' || echo '$(srcdir)/'`hb-icu.cc +libharfbuzz_subset_la-hb-number.lo: hb-number.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libharfbuzz_subset_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libharfbuzz_subset_la-hb-number.lo -MD -MP -MF $(DEPDIR)/libharfbuzz_subset_la-hb-number.Tpo -c -o libharfbuzz_subset_la-hb-number.lo `test -f 'hb-number.cc' || echo '$(srcdir)/'`hb-number.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libharfbuzz_subset_la-hb-number.Tpo $(DEPDIR)/libharfbuzz_subset_la-hb-number.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='hb-number.cc' object='libharfbuzz_subset_la-hb-number.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libharfbuzz_subset_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libharfbuzz_subset_la-hb-number.lo `test -f 'hb-number.cc' || echo '$(srcdir)/'`hb-number.cc + libharfbuzz_subset_la-hb-ot-cff1-table.lo: hb-ot-cff1-table.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libharfbuzz_subset_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libharfbuzz_subset_la-hb-ot-cff1-table.lo -MD -MP -MF $(DEPDIR)/libharfbuzz_subset_la-hb-ot-cff1-table.Tpo -c -o libharfbuzz_subset_la-hb-ot-cff1-table.lo `test -f 'hb-ot-cff1-table.cc' || echo '$(srcdir)/'`hb-ot-cff1-table.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libharfbuzz_subset_la-hb-ot-cff1-table.Tpo $(DEPDIR)/libharfbuzz_subset_la-hb-ot-cff1-table.Plo @@ -2064,6 +2161,13 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libharfbuzz_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libharfbuzz_la-hb-map.lo `test -f 'hb-map.cc' || echo '$(srcdir)/'`hb-map.cc +libharfbuzz_la-hb-number.lo: hb-number.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libharfbuzz_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libharfbuzz_la-hb-number.lo -MD -MP -MF $(DEPDIR)/libharfbuzz_la-hb-number.Tpo -c -o libharfbuzz_la-hb-number.lo `test -f 'hb-number.cc' || echo '$(srcdir)/'`hb-number.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libharfbuzz_la-hb-number.Tpo $(DEPDIR)/libharfbuzz_la-hb-number.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='hb-number.cc' object='libharfbuzz_la-hb-number.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libharfbuzz_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libharfbuzz_la-hb-number.lo `test -f 'hb-number.cc' || echo '$(srcdir)/'`hb-number.cc + libharfbuzz_la-hb-ot-cff1-table.lo: hb-ot-cff1-table.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libharfbuzz_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libharfbuzz_la-hb-ot-cff1-table.lo -MD -MP -MF $(DEPDIR)/libharfbuzz_la-hb-ot-cff1-table.Tpo -c -o libharfbuzz_la-hb-ot-cff1-table.lo `test -f 'hb-ot-cff1-table.cc' || echo '$(srcdir)/'`hb-ot-cff1-table.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libharfbuzz_la-hb-ot-cff1-table.Tpo $(DEPDIR)/libharfbuzz_la-hb-ot-cff1-table.Plo @@ -2120,6 +2224,20 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libharfbuzz_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libharfbuzz_la-hb-ot-math.lo `test -f 'hb-ot-math.cc' || echo '$(srcdir)/'`hb-ot-math.cc +libharfbuzz_la-hb-ot-meta.lo: hb-ot-meta.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libharfbuzz_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libharfbuzz_la-hb-ot-meta.lo -MD -MP -MF $(DEPDIR)/libharfbuzz_la-hb-ot-meta.Tpo -c -o libharfbuzz_la-hb-ot-meta.lo `test -f 'hb-ot-meta.cc' || echo '$(srcdir)/'`hb-ot-meta.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libharfbuzz_la-hb-ot-meta.Tpo $(DEPDIR)/libharfbuzz_la-hb-ot-meta.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='hb-ot-meta.cc' object='libharfbuzz_la-hb-ot-meta.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libharfbuzz_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libharfbuzz_la-hb-ot-meta.lo `test -f 'hb-ot-meta.cc' || echo '$(srcdir)/'`hb-ot-meta.cc + +libharfbuzz_la-hb-ot-metrics.lo: hb-ot-metrics.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libharfbuzz_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libharfbuzz_la-hb-ot-metrics.lo -MD -MP -MF $(DEPDIR)/libharfbuzz_la-hb-ot-metrics.Tpo -c -o libharfbuzz_la-hb-ot-metrics.lo `test -f 'hb-ot-metrics.cc' || echo '$(srcdir)/'`hb-ot-metrics.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libharfbuzz_la-hb-ot-metrics.Tpo $(DEPDIR)/libharfbuzz_la-hb-ot-metrics.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='hb-ot-metrics.cc' object='libharfbuzz_la-hb-ot-metrics.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libharfbuzz_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libharfbuzz_la-hb-ot-metrics.lo `test -f 'hb-ot-metrics.cc' || echo '$(srcdir)/'`hb-ot-metrics.cc + libharfbuzz_la-hb-ot-name.lo: hb-ot-name.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libharfbuzz_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libharfbuzz_la-hb-ot-name.lo -MD -MP -MF $(DEPDIR)/libharfbuzz_la-hb-ot-name.Tpo -c -o libharfbuzz_la-hb-ot-name.lo `test -f 'hb-ot-name.cc' || echo '$(srcdir)/'`hb-ot-name.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libharfbuzz_la-hb-ot-name.Tpo $(DEPDIR)/libharfbuzz_la-hb-ot-name.Plo @@ -2337,6 +2455,13 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libharfbuzz_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libharfbuzz_la-hb-directwrite.lo `test -f 'hb-directwrite.cc' || echo '$(srcdir)/'`hb-directwrite.cc +libharfbuzz_la-hb-gdi.lo: hb-gdi.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libharfbuzz_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libharfbuzz_la-hb-gdi.lo -MD -MP -MF $(DEPDIR)/libharfbuzz_la-hb-gdi.Tpo -c -o libharfbuzz_la-hb-gdi.lo `test -f 'hb-gdi.cc' || echo '$(srcdir)/'`hb-gdi.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libharfbuzz_la-hb-gdi.Tpo $(DEPDIR)/libharfbuzz_la-hb-gdi.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='hb-gdi.cc' object='libharfbuzz_la-hb-gdi.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libharfbuzz_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libharfbuzz_la-hb-gdi.lo `test -f 'hb-gdi.cc' || echo '$(srcdir)/'`hb-gdi.cc + libharfbuzz_la-hb-coretext.lo: hb-coretext.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libharfbuzz_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libharfbuzz_la-hb-coretext.lo -MD -MP -MF $(DEPDIR)/libharfbuzz_la-hb-coretext.Tpo -c -o libharfbuzz_la-hb-coretext.lo `test -f 'hb-coretext.cc' || echo '$(srcdir)/'`hb-coretext.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libharfbuzz_la-hb-coretext.Tpo $(DEPDIR)/libharfbuzz_la-hb-coretext.Plo @@ -2519,6 +2644,34 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_algs_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_algs-hb-static.obj `if test -f 'hb-static.cc'; then $(CYGPATH_W) 'hb-static.cc'; else $(CYGPATH_W) '$(srcdir)/hb-static.cc'; fi` +test_bimap-test-bimap.o: test-bimap.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bimap_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_bimap-test-bimap.o -MD -MP -MF $(DEPDIR)/test_bimap-test-bimap.Tpo -c -o test_bimap-test-bimap.o `test -f 'test-bimap.cc' || echo '$(srcdir)/'`test-bimap.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_bimap-test-bimap.Tpo $(DEPDIR)/test_bimap-test-bimap.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-bimap.cc' object='test_bimap-test-bimap.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bimap_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_bimap-test-bimap.o `test -f 'test-bimap.cc' || echo '$(srcdir)/'`test-bimap.cc + +test_bimap-test-bimap.obj: test-bimap.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bimap_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_bimap-test-bimap.obj -MD -MP -MF $(DEPDIR)/test_bimap-test-bimap.Tpo -c -o test_bimap-test-bimap.obj `if test -f 'test-bimap.cc'; then $(CYGPATH_W) 'test-bimap.cc'; else $(CYGPATH_W) '$(srcdir)/test-bimap.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_bimap-test-bimap.Tpo $(DEPDIR)/test_bimap-test-bimap.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-bimap.cc' object='test_bimap-test-bimap.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bimap_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_bimap-test-bimap.obj `if test -f 'test-bimap.cc'; then $(CYGPATH_W) 'test-bimap.cc'; else $(CYGPATH_W) '$(srcdir)/test-bimap.cc'; fi` + +test_bimap-hb-static.o: hb-static.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bimap_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_bimap-hb-static.o -MD -MP -MF $(DEPDIR)/test_bimap-hb-static.Tpo -c -o test_bimap-hb-static.o `test -f 'hb-static.cc' || echo '$(srcdir)/'`hb-static.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_bimap-hb-static.Tpo $(DEPDIR)/test_bimap-hb-static.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='hb-static.cc' object='test_bimap-hb-static.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bimap_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_bimap-hb-static.o `test -f 'hb-static.cc' || echo '$(srcdir)/'`hb-static.cc + +test_bimap-hb-static.obj: hb-static.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bimap_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_bimap-hb-static.obj -MD -MP -MF $(DEPDIR)/test_bimap-hb-static.Tpo -c -o test_bimap-hb-static.obj `if test -f 'hb-static.cc'; then $(CYGPATH_W) 'hb-static.cc'; else $(CYGPATH_W) '$(srcdir)/hb-static.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_bimap-hb-static.Tpo $(DEPDIR)/test_bimap-hb-static.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='hb-static.cc' object='test_bimap-hb-static.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bimap_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_bimap-hb-static.obj `if test -f 'hb-static.cc'; then $(CYGPATH_W) 'hb-static.cc'; else $(CYGPATH_W) '$(srcdir)/hb-static.cc'; fi` + test_buffer_serialize-test-buffer-serialize.o: test-buffer-serialize.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_buffer_serialize_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_buffer_serialize-test-buffer-serialize.o -MD -MP -MF $(DEPDIR)/test_buffer_serialize-test-buffer-serialize.Tpo -c -o test_buffer_serialize-test-buffer-serialize.o `test -f 'test-buffer-serialize.cc' || echo '$(srcdir)/'`test-buffer-serialize.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_buffer_serialize-test-buffer-serialize.Tpo $(DEPDIR)/test_buffer_serialize-test-buffer-serialize.Po @@ -2617,6 +2770,34 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_meta_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_meta-hb-static.obj `if test -f 'hb-static.cc'; then $(CYGPATH_W) 'hb-static.cc'; else $(CYGPATH_W) '$(srcdir)/hb-static.cc'; fi` +test_number-test-number.o: test-number.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_number_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_number-test-number.o -MD -MP -MF $(DEPDIR)/test_number-test-number.Tpo -c -o test_number-test-number.o `test -f 'test-number.cc' || echo '$(srcdir)/'`test-number.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_number-test-number.Tpo $(DEPDIR)/test_number-test-number.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-number.cc' object='test_number-test-number.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_number_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_number-test-number.o `test -f 'test-number.cc' || echo '$(srcdir)/'`test-number.cc + +test_number-test-number.obj: test-number.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_number_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_number-test-number.obj -MD -MP -MF $(DEPDIR)/test_number-test-number.Tpo -c -o test_number-test-number.obj `if test -f 'test-number.cc'; then $(CYGPATH_W) 'test-number.cc'; else $(CYGPATH_W) '$(srcdir)/test-number.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_number-test-number.Tpo $(DEPDIR)/test_number-test-number.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-number.cc' object='test_number-test-number.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_number_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_number-test-number.obj `if test -f 'test-number.cc'; then $(CYGPATH_W) 'test-number.cc'; else $(CYGPATH_W) '$(srcdir)/test-number.cc'; fi` + +test_number-hb-number.o: hb-number.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_number_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_number-hb-number.o -MD -MP -MF $(DEPDIR)/test_number-hb-number.Tpo -c -o test_number-hb-number.o `test -f 'hb-number.cc' || echo '$(srcdir)/'`hb-number.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_number-hb-number.Tpo $(DEPDIR)/test_number-hb-number.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='hb-number.cc' object='test_number-hb-number.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_number_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_number-hb-number.o `test -f 'hb-number.cc' || echo '$(srcdir)/'`hb-number.cc + +test_number-hb-number.obj: hb-number.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_number_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_number-hb-number.obj -MD -MP -MF $(DEPDIR)/test_number-hb-number.Tpo -c -o test_number-hb-number.obj `if test -f 'hb-number.cc'; then $(CYGPATH_W) 'hb-number.cc'; else $(CYGPATH_W) '$(srcdir)/hb-number.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_number-hb-number.Tpo $(DEPDIR)/test_number-hb-number.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='hb-number.cc' object='test_number-hb-number.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_number_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_number-hb-number.obj `if test -f 'hb-number.cc'; then $(CYGPATH_W) 'hb-number.cc'; else $(CYGPATH_W) '$(srcdir)/hb-number.cc'; fi` + test_ot_color-test-ot-color.o: test-ot-color.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ot_color_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_ot_color-test-ot-color.o -MD -MP -MF $(DEPDIR)/test_ot_color-test-ot-color.Tpo -c -o test_ot_color-test-ot-color.o `test -f 'test-ot-color.cc' || echo '$(srcdir)/'`test-ot-color.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ot_color-test-ot-color.Tpo $(DEPDIR)/test_ot_color-test-ot-color.Po @@ -2631,6 +2812,20 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ot_color_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_ot_color-test-ot-color.obj `if test -f 'test-ot-color.cc'; then $(CYGPATH_W) 'test-ot-color.cc'; else $(CYGPATH_W) '$(srcdir)/test-ot-color.cc'; fi` +test_ot_meta-test-ot-meta.o: test-ot-meta.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ot_meta_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_ot_meta-test-ot-meta.o -MD -MP -MF $(DEPDIR)/test_ot_meta-test-ot-meta.Tpo -c -o test_ot_meta-test-ot-meta.o `test -f 'test-ot-meta.cc' || echo '$(srcdir)/'`test-ot-meta.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ot_meta-test-ot-meta.Tpo $(DEPDIR)/test_ot_meta-test-ot-meta.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-ot-meta.cc' object='test_ot_meta-test-ot-meta.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ot_meta_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_ot_meta-test-ot-meta.o `test -f 'test-ot-meta.cc' || echo '$(srcdir)/'`test-ot-meta.cc + +test_ot_meta-test-ot-meta.obj: test-ot-meta.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ot_meta_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_ot_meta-test-ot-meta.obj -MD -MP -MF $(DEPDIR)/test_ot_meta-test-ot-meta.Tpo -c -o test_ot_meta-test-ot-meta.obj `if test -f 'test-ot-meta.cc'; then $(CYGPATH_W) 'test-ot-meta.cc'; else $(CYGPATH_W) '$(srcdir)/test-ot-meta.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ot_meta-test-ot-meta.Tpo $(DEPDIR)/test_ot_meta-test-ot-meta.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test-ot-meta.cc' object='test_ot_meta-test-ot-meta.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ot_meta_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_ot_meta-test-ot-meta.obj `if test -f 'test-ot-meta.cc'; then $(CYGPATH_W) 'test-ot-meta.cc'; else $(CYGPATH_W) '$(srcdir)/test-ot-meta.cc'; fi` + test_ot_name-test-ot-name.o: test-ot-name.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ot_name_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_ot_name-test-ot-name.o -MD -MP -MF $(DEPDIR)/test_ot_name-test-ot-name.Tpo -c -o test_ot_name-test-ot-name.o `test -f 'test-ot-name.cc' || echo '$(srcdir)/'`test-ot-name.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ot_name-test-ot-name.Tpo $(DEPDIR)/test_ot_name-test-ot-name.Po @@ -3115,6 +3310,13 @@ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +test-number.log: test-number$(EXEEXT) + @p='test-number$(EXEEXT)'; \ + b='test-number'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) test-ot-tag.log: test-ot-tag$(EXEEXT) @p='test-ot-tag$(EXEEXT)'; \ b='test-ot-tag'; \ @@ -3129,6 +3331,13 @@ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +test-bimap.log: test-bimap$(EXEEXT) + @p='test-bimap$(EXEEXT)'; \ + b='test-bimap'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ @@ -3284,10 +3493,12 @@ -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-fallback-shape.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-font.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-ft.Plo + -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-gdi.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-glib.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-graphite2.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-icu.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-map.Plo + -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-number.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-ot-cff1-table.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-ot-cff2-table.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-ot-color.Plo @@ -3296,6 +3507,8 @@ -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-ot-layout.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-ot-map.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-ot-math.Plo + -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-ot-meta.Plo + -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-ot-metrics.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-ot-name.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-ot-shape-complex-arabic.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-ot-shape-complex-default.Plo @@ -3323,6 +3536,7 @@ -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-unicode.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-uniscribe.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-warning.Plo + -rm -f ./$(DEPDIR)/libharfbuzz_subset_la-hb-number.Plo -rm -f ./$(DEPDIR)/libharfbuzz_subset_la-hb-ot-cff1-table.Plo -rm -f ./$(DEPDIR)/libharfbuzz_subset_la-hb-ot-cff2-table.Plo -rm -f ./$(DEPDIR)/libharfbuzz_subset_la-hb-static.Plo @@ -3336,6 +3550,8 @@ -rm -f ./$(DEPDIR)/test-test.Po -rm -f ./$(DEPDIR)/test_algs-hb-static.Po -rm -f ./$(DEPDIR)/test_algs-test-algs.Po + -rm -f ./$(DEPDIR)/test_bimap-hb-static.Po + -rm -f ./$(DEPDIR)/test_bimap-test-bimap.Po -rm -f ./$(DEPDIR)/test_buffer_serialize-test-buffer-serialize.Po -rm -f ./$(DEPDIR)/test_gpos_size_params-test-gpos-size-params.Po -rm -f ./$(DEPDIR)/test_gsub_would_substitute-test-gsub-would-substitute.Po @@ -3343,7 +3559,10 @@ -rm -f ./$(DEPDIR)/test_iter-test-iter.Po -rm -f ./$(DEPDIR)/test_meta-hb-static.Po -rm -f ./$(DEPDIR)/test_meta-test-meta.Po + -rm -f ./$(DEPDIR)/test_number-hb-number.Po + -rm -f ./$(DEPDIR)/test_number-test-number.Po -rm -f ./$(DEPDIR)/test_ot_color-test-ot-color.Po + -rm -f ./$(DEPDIR)/test_ot_meta-test-ot-meta.Po -rm -f ./$(DEPDIR)/test_ot_name-test-ot-name.Po -rm -f ./$(DEPDIR)/test_ot_tag-hb-ot-tag.Po -rm -f ./$(DEPDIR)/test_unicode_ranges-test-unicode-ranges.Po @@ -3417,10 +3636,12 @@ -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-fallback-shape.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-font.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-ft.Plo + -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-gdi.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-glib.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-graphite2.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-icu.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-map.Plo + -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-number.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-ot-cff1-table.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-ot-cff2-table.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-ot-color.Plo @@ -3429,6 +3650,8 @@ -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-ot-layout.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-ot-map.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-ot-math.Plo + -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-ot-meta.Plo + -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-ot-metrics.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-ot-name.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-ot-shape-complex-arabic.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-ot-shape-complex-default.Plo @@ -3456,6 +3679,7 @@ -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-unicode.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-uniscribe.Plo -rm -f ./$(DEPDIR)/libharfbuzz_la-hb-warning.Plo + -rm -f ./$(DEPDIR)/libharfbuzz_subset_la-hb-number.Plo -rm -f ./$(DEPDIR)/libharfbuzz_subset_la-hb-ot-cff1-table.Plo -rm -f ./$(DEPDIR)/libharfbuzz_subset_la-hb-ot-cff2-table.Plo -rm -f ./$(DEPDIR)/libharfbuzz_subset_la-hb-static.Plo @@ -3469,6 +3693,8 @@ -rm -f ./$(DEPDIR)/test-test.Po -rm -f ./$(DEPDIR)/test_algs-hb-static.Po -rm -f ./$(DEPDIR)/test_algs-test-algs.Po + -rm -f ./$(DEPDIR)/test_bimap-hb-static.Po + -rm -f ./$(DEPDIR)/test_bimap-test-bimap.Po -rm -f ./$(DEPDIR)/test_buffer_serialize-test-buffer-serialize.Po -rm -f ./$(DEPDIR)/test_gpos_size_params-test-gpos-size-params.Po -rm -f ./$(DEPDIR)/test_gsub_would_substitute-test-gsub-would-substitute.Po @@ -3476,7 +3702,10 @@ -rm -f ./$(DEPDIR)/test_iter-test-iter.Po -rm -f ./$(DEPDIR)/test_meta-hb-static.Po -rm -f ./$(DEPDIR)/test_meta-test-meta.Po + -rm -f ./$(DEPDIR)/test_number-hb-number.Po + -rm -f ./$(DEPDIR)/test_number-test-number.Po -rm -f ./$(DEPDIR)/test_ot_color-test-ot-color.Po + -rm -f ./$(DEPDIR)/test_ot_meta-test-ot-meta.Po -rm -f ./$(DEPDIR)/test_ot_name-test-ot-name.Po -rm -f ./$(DEPDIR)/test_ot_tag-hb-ot-tag.Po -rm -f ./$(DEPDIR)/test_unicode_ranges-test-unicode-ranges.Po @@ -3534,6 +3763,10 @@ # Convenience targets: lib: $(BUILT_SOURCES) libharfbuzz.la libs: $(BUILT_SOURCES) $(lib_LTLIBRARIES) +tiny: + $(MAKE) $(AM_MAKEFLAGS) CPPFLAGS="-Os -DHB_TINY $(CPPFLAGS)" libs +tinyz: + $(MAKE) $(AM_MAKEFLAGS) CPPFLAGS="-Oz -DHB_TINY $(CPPFLAGS)" libs $(srcdir)/hb-version.h: hb-version.h.in $(top_srcdir)/configure.ac $(AM_V_GEN) $(SED) \ @@ -3574,32 +3807,38 @@ harfbuzz-deprecated-symbols.txt: $(srcdir)/hb-deprecated.h $(AM_V_GEN) PLAIN_LIST=1 $(srcdir)/gen-def.py "$@" $^ -unicode-tables: arabic-table indic-table tag-table use-table emoji-table +unicode-tables: \ + arabic-table \ + emoji-table \ + indic-table \ + tag-table \ + ucd-table \ + use-table \ + emoji-table \ + $(NULL) arabic-table: gen-arabic-table.py ArabicShaping.txt UnicodeData.txt Blocks.txt $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-arabic-table.hh \ || ($(RM) $(srcdir)/hb-ot-shape-complex-arabic-table.hh; false) - +emoji-table: gen-emoji-table.py emoji-data.txt + $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-unicode-emoji-table.hh \ + || ($(RM) $(srcdir)/hb-unicode-emoji-table.hh; false) indic-table: gen-indic-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt Blocks.txt $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-indic-table.cc \ || ($(RM) $(srcdir)/hb-ot-shape-complex-indic-table.cc; false) - tag-table: gen-tag-table.py languagetags language-subtag-registry $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-tag-table.hh \ || ($(RM) $(srcdir)/hb-ot-tag-table.hh; false) - +ucd-table: gen-ucd-table.py ucd.nounihan.grouped.zip hb-common.h + $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ucd-table.hh \ + || ($(RM) $(srcdir)/hb-ucd-table.hh; false) use-table: gen-use-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt UnicodeData.txt Blocks.txt $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-use-table.cc \ || ($(RM) $(srcdir)/hb-ot-shape-complex-use-table.cc; false) - vowel-constraints: gen-vowel-constraints.py HBIndicVowelConstraints.txt Scripts.txt $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-vowel-constraints.cc \ || ($(RM) $(srcdir)/hb-ot-shape-complex-vowel-constraints.cc; false) -emoji-table: gen-emoji-table.py emoji-data.txt - $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-unicode-emoji-table.hh \ - || ($(RM) $(srcdir)/hb-unicode-emoji-table.hh; false) - built-sources: $(BUILT_SOURCES) .PHONY: unicode-tables arabic-table indic-table tag-table use-table vowel-constraints emoji-table built-sources @@ -3609,6 +3848,21 @@ $(AM_V_GEN)(cd $(srcdir) && $(RAGEL) -e -F1 -o "$*.hh" "$*.rl") \ || ($(RM) "$@"; false) +harfbuzz.cc: Makefile.sources + $(AM_V_GEN) \ + for f in \ + $(HB_BASE_sources) \ + $(HB_GLIB_sources) \ + $(HB_FT_sources) \ + $(HB_GRAPHITE2_sources) \ + $(HB_UNISCRIBE_sources) \ + $(HB_GDI_sources) \ + $(HB_DIRECTWRITE_sources) \ + $(HB_CORETEXT_sources) \ + ; do echo '#include "'$$f'"'; done | \ + grep '[.]cc"' > $(srcdir)/harfbuzz.cc \ + || ($(RM) $(srcdir)/harfbuzz.cc; false) + @HAVE_INTROSPECTION_TRUE@-include $(INTROSPECTION_MAKEFILE) @HAVE_INTROSPECTION_TRUE@HarfBuzz-0.0.gir: libharfbuzz.la libharfbuzz-gobject.la diff -Nru harfbuzz-2.5.3/src/Makefile.sources harfbuzz-2.6.2/src/Makefile.sources --- harfbuzz-2.5.3/src/Makefile.sources 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/Makefile.sources 2019-10-26 02:02:55.000000000 +0000 @@ -10,6 +10,7 @@ hb-aat-layout-kerx-table.hh \ hb-aat-layout-lcar-table.hh \ hb-aat-layout-morx-table.hh \ + hb-aat-layout-opbd-table.hh \ hb-aat-layout-trak-table.hh \ hb-aat-layout.cc \ hb-aat-layout.hh \ @@ -48,6 +49,8 @@ hb-meta.hh \ hb-mutex.hh \ hb-null.hh \ + hb-number.cc \ + hb-number.hh \ hb-object.hh \ hb-open-file.hh \ hb-open-type.hh \ @@ -88,6 +91,10 @@ hb-ot-math-table.hh \ hb-ot-math.cc \ hb-ot-maxp-table.hh \ + hb-ot-meta-table.hh \ + hb-ot-meta.cc \ + hb-ot-metrics.cc \ + hb-ot-metrics.hh \ hb-ot-name-language-static.hh \ hb-ot-name-language.hh \ hb-ot-name-table.hh \ @@ -162,6 +169,7 @@ HB_BASE_RAGEL_GENERATED_sources = \ hb-buffer-deserialize-json.hh \ hb-buffer-deserialize-text.hh \ + hb-number-parser.hh \ hb-ot-shape-complex-indic-machine.hh \ hb-ot-shape-complex-khmer-machine.hh \ hb-ot-shape-complex-myanmar-machine.hh \ @@ -170,6 +178,7 @@ HB_BASE_RAGEL_sources = \ hb-buffer-deserialize-json.rl \ hb-buffer-deserialize-text.rl \ + hb-number-parser.rl \ hb-ot-shape-complex-indic-machine.rl \ hb-ot-shape-complex-khmer-machine.rl \ hb-ot-shape-complex-myanmar-machine.rl \ @@ -191,6 +200,8 @@ hb-ot-font.h \ hb-ot-layout.h \ hb-ot-math.h \ + hb-ot-meta.h \ + hb-ot-metrics.h \ hb-ot-name.h \ hb-ot-shape.h \ hb-ot-var.h \ @@ -222,6 +233,9 @@ HB_DIRECTWRITE_sources = hb-directwrite.cc HB_DIRECTWRITE_headers = hb-directwrite.h +HB_GDI_sources = hb-gdi.cc +HB_GDI_headers = hb-gdi.h + HB_UNISCRIBE_sources = hb-uniscribe.cc HB_UNISCRIBE_headers = hb-uniscribe.h @@ -231,6 +245,8 @@ # Sources for libharfbuzz-subset HB_SUBSET_sources = \ + hb-number.cc \ + hb-number.hh \ hb-ot-cff1-table.cc \ hb-ot-cff2-table.cc \ hb-static.cc \ diff -Nru harfbuzz-2.5.3/src/test-algs.cc harfbuzz-2.6.2/src/test-algs.cc --- harfbuzz-2.5.3/src/test-algs.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/test-algs.cc 2019-10-26 02:02:55.000000000 +0000 @@ -87,5 +87,9 @@ assert (hb_add (2) (5) == 7); assert (hb_add (5) (2) == 7); + x = 1; + assert (++hb_inc (x) == 3); + assert (x == 3); + return 0; } diff -Nru harfbuzz-2.5.3/src/test-bimap.cc harfbuzz-2.6.2/src/test-bimap.cc --- harfbuzz-2.5.3/src/test-bimap.cc 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/src/test-bimap.cc 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,76 @@ +/* + * Copyright © 2019 Adobe, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Adobe Author(s): Michiharu Ariza + */ + +#include "hb.hh" +#include "hb-bimap.hh" + +int +main (int argc, char **argv) +{ + hb_bimap_t bm; + + assert (bm.is_empty () == true); + bm.set (1, 4); + bm.set (2, 5); + bm.set (3, 6); + assert (bm.get_population () == 3); + assert (bm.has (1) == true); + assert (bm.has (4) == false); + assert (bm[2] == 5); + assert (bm.backward (6) == 3); + bm.del (1); + assert (bm.has (1) == false); + assert (bm.has (3) == true); + bm.clear (); + assert (bm.get_population () == 0); + + hb_inc_bimap_t ibm; + + assert (ibm.add (13) == 0); + assert (ibm.add (8) == 1); + assert (ibm.add (10) == 2); + assert (ibm.add (8) == 1); + assert (ibm.add (7) == 3); + assert (ibm.get_population () == 4); + assert (ibm[7] == 3); + + ibm.sort (); + assert (ibm.get_population () == 4); + assert (ibm[7] == 0); + assert (ibm[13] == 3); + + ibm.identity (3); + assert (ibm.get_population () == 3); + assert (ibm[0] == 0); + assert (ibm[1] == 1); + assert (ibm[2] == 2); + assert (ibm.backward (0) == 0); + assert (ibm.backward (1) == 1); + assert (ibm.backward (2) == 2); + assert (ibm.has (4) == false); + + return 0; +} diff -Nru harfbuzz-2.5.3/src/test-iter.cc harfbuzz-2.6.2/src/test-iter.cc --- harfbuzz-2.5.3/src/test-iter.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/test-iter.cc 2019-10-26 02:02:55.000000000 +0000 @@ -267,7 +267,12 @@ hb_iota (); hb_iota (3); hb_iota (3, 2); + assert ((&vl) + 1 == *++hb_iota (&vl, hb_inc)); hb_range (); + hb_repeat (7u); + hb_repeat (nullptr); + hb_repeat (vl) | hb_chop (3); + assert (hb_len (hb_range (10) | hb_take (3)) == 3); assert (hb_range (9).len () == 9); assert (hb_range (2, 9).len () == 7); assert (hb_range (2, 9, 3).len () == 3); diff -Nru harfbuzz-2.5.3/src/test-number.cc harfbuzz-2.6.2/src/test-number.cc --- harfbuzz-2.5.3/src/test-number.cc 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/src/test-number.cc 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,253 @@ +/* + * Copyright © 2019 Ebrahim Byagowi + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + */ + +#include "hb.hh" +#include "hb-number.hh" +#include "hb-number-parser.hh" + + +int +main (int argc, char **argv) +{ + { + const char str[] = "123"; + const char *pp = str; + const char *end = str + 3; + + int pv; + assert (hb_parse_int (&pp, end, &pv)); + assert (pv == 123); + assert (pp - str == 3); + assert (end - pp == 0); + assert (!*end); + } + + { + const char str[] = "123"; + const char *pp = str; + const char *end = str + strlen (str); + + unsigned int pv; + assert (hb_parse_uint (&pp, end, &pv)); + assert (pv == 123); + assert (pp - str == 3); + assert (end - pp == 0); + assert (!*end); + } + + { + const char str[] = "12F"; + const char *pp = str; + const char *end = str + 3; + + unsigned int pv; + assert (hb_parse_uint (&pp, end, &pv, true, 16)); + assert (pv == 0x12F); + assert (pp - str == 3); + assert (end - pp == 0); + assert (!*end); + } + + { + const char str[] = "12Fq"; + const char *pp = str; + const char *end = str + 4; + + unsigned int pv; + assert (!hb_parse_uint (&pp, end, &pv, true, 16)); + assert (hb_parse_uint (&pp, end, &pv, false, 16)); + assert (pv == 0x12F); + assert (pp - str == 3); + assert (end - pp == 1); + assert (!*end); + } + + { + const char str[] = "-123"; + const char *pp = str; + const char *end = str + 4; + + int pv; + assert (hb_parse_int (&pp, end, &pv)); + assert (pv == -123); + assert (pp - str == 4); + assert (end - pp == 0); + assert (!*end); + } + + { + const char str[] = "123"; + const char *pp = str; + assert (ARRAY_LENGTH (str) == 4); + const char *end = str + ARRAY_LENGTH (str); + + unsigned int pv; + assert (hb_parse_uint (&pp, end, &pv)); + assert (pv == 123); + assert (pp - str == 3); + assert (end - pp == 1); + } + + { + const char str[] = "123\0"; + const char *pp = str; + assert (ARRAY_LENGTH (str) == 5); + const char *end = str + ARRAY_LENGTH (str); + + unsigned int pv; + assert (hb_parse_uint (&pp, end, &pv)); + assert (pv == 123); + assert (pp - str == 3); + assert (end - pp == 2); + } + + { + const char str[] = "123V"; + const char *pp = str; + assert (ARRAY_LENGTH (str) == 5); + const char *end = str + ARRAY_LENGTH (str); + + unsigned int pv; + assert (hb_parse_uint (&pp, end, &pv)); + assert (pv == 123); + assert (pp - str == 3); + assert (end - pp == 2); + } + + { + const char str[] = ".123"; + const char *pp = str; + const char *end = str + ARRAY_LENGTH (str); + + double pv; + assert (hb_parse_double (&pp, end, &pv)); + assert ((int) roundf (pv * 1000.) == 123); + assert (pp - str == 4); + assert (end - pp == 1); + + /* Test strtod_rl even if libc's strtod_l is used */ + char *pend; + assert ((int) roundf (strtod_rl (str, &pend) * 1000.) == 123); + assert (pend - str == 4); + } + + { + const char str[] = "0.123"; + const char *pp = str; + const char *end = str + ARRAY_LENGTH (str) - 1; + + double pv; + assert (hb_parse_double (&pp, end, &pv)); + assert ((int) roundf (pv * 1000.) == 123); + assert (pp - str == 5); + assert (end - pp == 0); + + char *pend; + assert ((int) roundf (strtod_rl (str, &pend) * 1000.) == 123); + assert (pend - str == 5); + } + + { + const char str[] = "0.123e0"; + const char *pp = str; + const char *end = str + ARRAY_LENGTH (str) - 1; + + double pv; + assert (hb_parse_double (&pp, end, &pv)); + assert ((int) roundf (pv * 1000.) == 123); + assert (pp - str == 7); + assert (end - pp == 0); + + char *pend; + assert ((int) roundf (strtod_rl (str, &pend) * 1000.) == 123); + assert (pend - str == 7); + } + + { + const char str[] = "123e-3"; + const char *pp = str; + const char *end = str + ARRAY_LENGTH (str) - 1; + + double pv; + assert (hb_parse_double (&pp, end, &pv)); + assert ((int) roundf (pv * 1000.) == 123); + assert (pp - str == 6); + assert (end - pp == 0); + + char *pend; + assert ((int) roundf (strtod_rl (str, &pend) * 1000.) == 123); + assert (pend - str == 6); + } + + { + const char str[] = ".000123e+3"; + const char *pp = str; + const char *end = str + ARRAY_LENGTH (str) - 1; + + double pv; + assert (hb_parse_double (&pp, end, &pv)); + assert ((int) roundf (pv * 1000.) == 123); + assert (pp - str == 10); + assert (end - pp == 0); + + char *pend; + assert ((int) roundf (strtod_rl (str, &pend) * 1000.) == 123); + assert (pend - str == 10); + } + + { + const char str[] = "-.000000123e6"; + const char *pp = str; + const char *end = str + ARRAY_LENGTH (str) - 1; + + double pv; + assert (hb_parse_double (&pp, end, &pv)); + assert ((int) roundf (pv * 1000.) == -123); + assert (pp - str == 13); + assert (end - pp == 0); + + char *pend; + assert ((int) roundf (strtod_rl (str, &pend) * 1000.) == -123); + assert (pend - str == 13); + } + + { + const char str[] = "-1.23E-1"; + const char *pp = str; + const char *end = str + ARRAY_LENGTH (str) - 1; + + double pv; + assert (hb_parse_double (&pp, end, &pv)); + assert ((int) roundf (pv * 1000.) == -123); + assert (pp - str == 8); + assert (end - pp == 0); + + char *pend; + assert ((int) roundf (strtod_rl (str, &pend) * 1000.) == -123); + assert (pend - str == 8); + } + + return 0; +} diff -Nru harfbuzz-2.5.3/src/test-ot-color.cc harfbuzz-2.6.2/src/test-ot-color.cc --- harfbuzz-2.5.3/src/test-ot-color.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/test-ot-color.cc 2019-10-26 02:02:55.000000000 +0000 @@ -330,8 +330,8 @@ // disabled when color font as cairo rendering of NotoColorEmoji is soooo slow if (!hb_ot_color_has_layers (face) && - !hb_ot_color_has_png (face) && - !hb_ot_color_has_svg (face)) + !hb_ot_color_has_png (face) && + !hb_ot_color_has_svg (face)) dump_glyphs (cairo_face, upem, num_glyphs, face_index); hb_font_destroy (font); diff -Nru harfbuzz-2.5.3/src/test-ot-meta.cc harfbuzz-2.6.2/src/test-ot-meta.cc --- harfbuzz-2.5.3/src/test-ot-meta.cc 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/src/test-ot-meta.cc 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,70 @@ +/* + * Copyright © 2019 Ebrahim Byagowi + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#include "hb.hh" +#include "hb-ot.h" + +#include +#include + +#ifdef HB_NO_OPEN +#define hb_blob_create_from_file(x) hb_blob_get_empty () +#endif + +int +main (int argc, char **argv) +{ + if (argc != 2) { + fprintf (stderr, "usage: %s font-file\n", argv[0]); + exit (1); + } + + hb_blob_t *blob = hb_blob_create_from_file (argv[1]); + hb_face_t *face = hb_face_create (blob, 0 /* first face */); + hb_blob_destroy (blob); + blob = nullptr; + + unsigned int count = 0; + +#ifndef HB_NO_META + count = hb_ot_meta_get_entry_tags (face, 0, nullptr, nullptr); + + hb_ot_meta_tag_t *tags = (hb_ot_meta_tag_t *) + malloc (sizeof (hb_ot_meta_tag_t) * count); + hb_ot_meta_get_entry_tags (face, 0, &count, tags); + for (unsigned i = 0; i < count; ++i) + { + hb_blob_t *entry = hb_ot_meta_reference_entry (face, tags[i]); + printf ("%c%c%c%c, size: %d: %.*s\n", + HB_UNTAG (tags[i]), hb_blob_get_length (entry), + hb_blob_get_length (entry), hb_blob_get_data (entry, nullptr)); + hb_blob_destroy (entry); + } + free (tags); +#endif + + hb_face_destroy (face); + + return !count; +} diff -Nru harfbuzz-2.5.3/src/test-unicode-ranges.cc harfbuzz-2.6.2/src/test-unicode-ranges.cc --- harfbuzz-2.5.3/src/test-unicode-ranges.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/src/test-unicode-ranges.cc 2019-10-26 02:02:55.000000000 +0000 @@ -33,9 +33,9 @@ if (OT::_hb_ot_os2_get_unicode_range_bit (cp) != bit) { fprintf (stderr, "got incorrect bit (%d) for cp 0x%X. Should have been %d.", - OT::_hb_ot_os2_get_unicode_range_bit (cp), - cp, - bit); + OT::_hb_ot_os2_get_unicode_range_bit (cp), + cp, + bit); abort(); } } Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/api/fonts/meta.ttf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/api/fonts/meta.ttf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/api/fonts/Roboto-Regular.abc.ttf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/api/fonts/Roboto-Regular.abc.ttf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/api/fonts/Roboto-Regular.ac.ttf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/api/fonts/Roboto-Regular.ac.ttf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/api/fonts/Roboto-Regular.D7,D8,D9,DA,DE.ttf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/api/fonts/Roboto-Regular.D7,D8,D9,DA,DE.ttf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/api/fonts/TestCFF2VF.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/api/fonts/TestCFF2VF.otf differ diff -Nru harfbuzz-2.5.3/test/api/hb-subset-test.h harfbuzz-2.6.2/test/api/hb-subset-test.h --- harfbuzz-2.5.3/test/api/hb-subset-test.h 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/api/hb-subset-test.h 2019-10-26 02:02:55.000000000 +0000 @@ -76,7 +76,7 @@ static inline hb_face_t * hb_subset_test_create_subset (hb_face_t *source, - hb_subset_input_t *input) + hb_subset_input_t *input) { hb_face_t *subset = hb_subset (source, input); g_assert (subset); @@ -87,8 +87,8 @@ static inline void hb_subset_test_check (hb_face_t *expected, - hb_face_t *actual, - hb_tag_t table) + hb_face_t *actual, + hb_tag_t table) { hb_blob_t *expected_blob, *actual_blob; expected_blob = hb_face_reference_table (expected, table); diff -Nru harfbuzz-2.5.3/test/api/Makefile.am harfbuzz-2.6.2/test/api/Makefile.am --- harfbuzz-2.5.3/test/api/Makefile.am 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/api/Makefile.am 2019-10-26 02:02:55.000000000 +0000 @@ -84,6 +84,8 @@ test-ot-color \ test-ot-ligature-carets \ test-ot-name \ + test-ot-meta \ + test-ot-metrics \ test-ot-tag \ test-ot-extents-cff \ $(NULL) diff -Nru harfbuzz-2.5.3/test/api/Makefile.in harfbuzz-2.6.2/test/api/Makefile.in --- harfbuzz-2.5.3/test/api/Makefile.in 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/api/Makefile.in 2019-10-26 02:02:55.000000000 +0000 @@ -152,7 +152,8 @@ @HAVE_GLIB_TRUE@ test-subset-nameids$(EXEEXT) $(am__EXEEXT_1) \ @HAVE_GLIB_TRUE@ test-ot-color$(EXEEXT) \ @HAVE_GLIB_TRUE@ test-ot-ligature-carets$(EXEEXT) \ -@HAVE_GLIB_TRUE@ test-ot-name$(EXEEXT) test-ot-tag$(EXEEXT) \ +@HAVE_GLIB_TRUE@ test-ot-name$(EXEEXT) test-ot-meta$(EXEEXT) \ +@HAVE_GLIB_TRUE@ test-ot-metrics$(EXEEXT) test-ot-tag$(EXEEXT) \ @HAVE_GLIB_TRUE@ test-ot-extents-cff$(EXEEXT) $(am__EXEEXT_1) \ @HAVE_GLIB_TRUE@ $(am__EXEEXT_2) $(am__EXEEXT_3) \ @HAVE_GLIB_TRUE@ test-c$(EXEEXT) test-cplusplus$(EXEEXT) \ @@ -269,6 +270,18 @@ @HAVE_FREETYPE_TRUE@@HAVE_GLIB_TRUE@test_ot_math_DEPENDENCIES = \ @HAVE_FREETYPE_TRUE@@HAVE_GLIB_TRUE@ $(am__DEPENDENCIES_2) \ @HAVE_FREETYPE_TRUE@@HAVE_GLIB_TRUE@ $(am__DEPENDENCIES_1) +test_ot_meta_SOURCES = test-ot-meta.c +test_ot_meta_OBJECTS = test-ot-meta.$(OBJEXT) +test_ot_meta_LDADD = $(LDADD) +@HAVE_GLIB_TRUE@test_ot_meta_DEPENDENCIES = \ +@HAVE_GLIB_TRUE@ $(top_builddir)/src/libharfbuzz.la \ +@HAVE_GLIB_TRUE@ $(am__DEPENDENCIES_1) +test_ot_metrics_SOURCES = test-ot-metrics.c +test_ot_metrics_OBJECTS = test-ot-metrics.$(OBJEXT) +test_ot_metrics_LDADD = $(LDADD) +@HAVE_GLIB_TRUE@test_ot_metrics_DEPENDENCIES = \ +@HAVE_GLIB_TRUE@ $(top_builddir)/src/libharfbuzz.la \ +@HAVE_GLIB_TRUE@ $(am__DEPENDENCIES_1) test_ot_name_SOURCES = test-ot-name.c test_ot_name_OBJECTS = test-ot-name.$(OBJEXT) test_ot_name_LDADD = $(LDADD) @@ -379,6 +392,7 @@ ./$(DEPDIR)/test-ot-color.Po \ ./$(DEPDIR)/test-ot-extents-cff.Po ./$(DEPDIR)/test-ot-face.Po \ ./$(DEPDIR)/test-ot-ligature-carets.Po \ + ./$(DEPDIR)/test-ot-meta.Po ./$(DEPDIR)/test-ot-metrics.Po \ ./$(DEPDIR)/test-ot-name.Po ./$(DEPDIR)/test-ot-tag.Po \ ./$(DEPDIR)/test-set.Po ./$(DEPDIR)/test-shape.Po \ ./$(DEPDIR)/test-subset-cff1.Po \ @@ -435,9 +449,9 @@ $(test_cplusplus_SOURCES) test-font.c test-map.c \ test-multithread.c test-object.c test-ot-color.c \ test-ot-extents-cff.c test-ot-face.c test-ot-ligature-carets.c \ - test-ot-math.c test-ot-name.c test-ot-tag.c test-set.c \ - test-shape.c test-subset.c test-subset-cff1.c \ - test-subset-cff2.c test-subset-cmap.c \ + test-ot-math.c test-ot-meta.c test-ot-metrics.c test-ot-name.c \ + test-ot-tag.c test-set.c test-shape.c test-subset.c \ + test-subset-cff1.c test-subset-cff2.c test-subset-cmap.c \ test-subset-drop-tables.c test-subset-glyf.c \ test-subset-hdmx.c test-subset-hmtx.c test-subset-nameids.c \ test-subset-os2.c test-subset-post.c test-subset-vmtx.c \ @@ -447,9 +461,9 @@ $(am__test_cplusplus_SOURCES_DIST) test-font.c test-map.c \ test-multithread.c test-object.c test-ot-color.c \ test-ot-extents-cff.c test-ot-face.c test-ot-ligature-carets.c \ - test-ot-math.c test-ot-name.c test-ot-tag.c test-set.c \ - test-shape.c test-subset.c test-subset-cff1.c \ - test-subset-cff2.c test-subset-cmap.c \ + test-ot-math.c test-ot-meta.c test-ot-metrics.c test-ot-name.c \ + test-ot-tag.c test-set.c test-shape.c test-subset.c \ + test-subset-cff1.c test-subset-cff2.c test-subset-cmap.c \ test-subset-drop-tables.c test-subset-glyf.c \ test-subset-hdmx.c test-subset-hmtx.c test-subset-nameids.c \ test-subset-os2.c test-subset-post.c test-subset-vmtx.c \ @@ -734,6 +748,8 @@ FREETYPE_DEPS = @FREETYPE_DEPS@ FREETYPE_LIBS = @FREETYPE_LIBS@ GCOV = @GCOV@ +GDI_CFLAGS = @GDI_CFLAGS@ +GDI_LIBS = @GDI_LIBS@ GENHTML = @GENHTML@ GIT = @GIT@ GLIB_CFLAGS = @GLIB_CFLAGS@ @@ -893,8 +909,9 @@ @HAVE_GLIB_TRUE@ test-subset-cff1 test-subset-cff2 test-unicode \ @HAVE_GLIB_TRUE@ test-version test-subset-nameids $(NULL) \ @HAVE_GLIB_TRUE@ test-ot-color test-ot-ligature-carets \ -@HAVE_GLIB_TRUE@ test-ot-name test-ot-tag test-ot-extents-cff \ -@HAVE_GLIB_TRUE@ $(NULL) $(am__append_4) $(am__append_5) test-c \ +@HAVE_GLIB_TRUE@ test-ot-name test-ot-meta test-ot-metrics \ +@HAVE_GLIB_TRUE@ test-ot-tag test-ot-extents-cff $(NULL) \ +@HAVE_GLIB_TRUE@ $(am__append_4) $(am__append_5) test-c \ @HAVE_GLIB_TRUE@ test-cplusplus $(NULL) @HAVE_GLIB_TRUE@test_subset_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la @HAVE_GLIB_TRUE@test_subset_cmap_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la @@ -1069,6 +1086,14 @@ @rm -f test-ot-math$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_ot_math_OBJECTS) $(test_ot_math_LDADD) $(LIBS) +test-ot-meta$(EXEEXT): $(test_ot_meta_OBJECTS) $(test_ot_meta_DEPENDENCIES) $(EXTRA_test_ot_meta_DEPENDENCIES) + @rm -f test-ot-meta$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_ot_meta_OBJECTS) $(test_ot_meta_LDADD) $(LIBS) + +test-ot-metrics$(EXEEXT): $(test_ot_metrics_OBJECTS) $(test_ot_metrics_DEPENDENCIES) $(EXTRA_test_ot_metrics_DEPENDENCIES) + @rm -f test-ot-metrics$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_ot_metrics_OBJECTS) $(test_ot_metrics_LDADD) $(LIBS) + test-ot-name$(EXEEXT): $(test_ot_name_OBJECTS) $(test_ot_name_DEPENDENCIES) $(EXTRA_test_ot_name_DEPENDENCIES) @rm -f test-ot-name$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_ot_name_OBJECTS) $(test_ot_name_LDADD) $(LIBS) @@ -1160,6 +1185,8 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ot-extents-cff.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ot-face.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ot-ligature-carets.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ot-meta.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ot-metrics.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ot-name.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ot-tag.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-set.Po@am__quote@ # am--include-marker @@ -1703,6 +1730,20 @@ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +test-ot-meta.log: test-ot-meta$(EXEEXT) + @p='test-ot-meta$(EXEEXT)'; \ + b='test-ot-meta'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-ot-metrics.log: test-ot-metrics$(EXEEXT) + @p='test-ot-metrics$(EXEEXT)'; \ + b='test-ot-metrics'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) test-ot-tag.log: test-ot-tag$(EXEEXT) @p='test-ot-tag$(EXEEXT)'; \ b='test-ot-tag'; \ @@ -1854,6 +1895,8 @@ -rm -f ./$(DEPDIR)/test-ot-extents-cff.Po -rm -f ./$(DEPDIR)/test-ot-face.Po -rm -f ./$(DEPDIR)/test-ot-ligature-carets.Po + -rm -f ./$(DEPDIR)/test-ot-meta.Po + -rm -f ./$(DEPDIR)/test-ot-metrics.Po -rm -f ./$(DEPDIR)/test-ot-name.Po -rm -f ./$(DEPDIR)/test-ot-tag.Po -rm -f ./$(DEPDIR)/test-set.Po @@ -1934,6 +1977,8 @@ -rm -f ./$(DEPDIR)/test-ot-extents-cff.Po -rm -f ./$(DEPDIR)/test-ot-face.Po -rm -f ./$(DEPDIR)/test-ot-ligature-carets.Po + -rm -f ./$(DEPDIR)/test-ot-meta.Po + -rm -f ./$(DEPDIR)/test-ot-metrics.Po -rm -f ./$(DEPDIR)/test-ot-name.Po -rm -f ./$(DEPDIR)/test-ot-tag.Po -rm -f ./$(DEPDIR)/test-set.Po diff -Nru harfbuzz-2.5.3/test/api/test-baseline.c harfbuzz-2.6.2/test/api/test-baseline.c --- harfbuzz-2.5.3/test/api/test-baseline.c 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/api/test-baseline.c 2019-10-26 02:02:55.000000000 +0000 @@ -34,14 +34,12 @@ hb_face_t *face = hb_test_open_font_file ("fonts/base.ttf"); hb_font_t *font = hb_font_create (face); -#if 0 hb_position_t position; - g_assert (hb_ot_layout_get_baseline (font, HB_OT_LAYOUT_BASELINE_ICFB, HB_DIRECTION_TTB, + g_assert (hb_ot_layout_get_baseline (font, HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_BOTTOM_OR_LEFT, HB_DIRECTION_TTB, HB_TAG ('h','a','n','i'), HB_TAG ('E','N','G',' '), &position)); g_assert_cmpint (46, ==, position); -#endif hb_font_destroy (font); hb_face_destroy (face); diff -Nru harfbuzz-2.5.3/test/api/test-buffer.c harfbuzz-2.6.2/test/api/test-buffer.c --- harfbuzz-2.5.3/test/api/test-buffer.c 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/api/test-buffer.c 2019-10-26 02:02:55.000000000 +0000 @@ -208,7 +208,7 @@ if (buffer_type == BUFFER_UTF16) cluster++; else if (buffer_type == BUFFER_UTF8) - cluster += 3; + cluster += 3; } g_assert_cmphex (glyphs[i].codepoint, ==, utf32[1+i]); g_assert_cmphex (glyphs[i].cluster, ==, cluster); diff -Nru harfbuzz-2.5.3/test/api/test-object.c harfbuzz-2.6.2/test/api/test-object.c --- harfbuzz-2.5.3/test/api/test-object.c 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/api/test-object.c 2019-10-26 02:02:55.000000000 +0000 @@ -345,7 +345,7 @@ if (!obj) continue; if (obj == o->get_empty ()) - continue; /* Tested already */ + continue; /* Tested already */ g_assert (obj == o->reference (obj)); o->destroy (obj); diff -Nru harfbuzz-2.5.3/test/api/test-ot-color.c harfbuzz-2.6.2/test/api/test-ot-color.c --- harfbuzz-2.5.3/test/api/test-ot-color.c 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/api/test-ot-color.c 2019-10-26 02:02:55.000000000 +0000 @@ -210,7 +210,7 @@ test_hb_ot_color_palette_get_colors_v0 (void) { unsigned int num_colors = hb_ot_color_palette_get_colors (cpal_v0, 0, 0, NULL, NULL); - hb_color_t *colors = (hb_color_t*) alloca (num_colors * sizeof (hb_color_t)); + hb_color_t *colors = (hb_color_t*) malloc (num_colors * sizeof (hb_color_t)); size_t colors_size = num_colors * sizeof(*colors); g_assert_cmpint (num_colors, ==, 2); @@ -252,6 +252,8 @@ g_assert_cmpint (num_colors, ==, 0); assert_color_rgba (colors, 0, 0x44, 0x44, 0x44, 0x44); /* untouched */ assert_color_rgba (colors, 1, 0x44, 0x44, 0x44, 0x44); /* untouched */ + + free (colors); } @@ -426,9 +428,9 @@ g_assert (strncmp (data + 1, "PNG", 3) == 0); hb_font_get_glyph_extents (sbix_font, 1, &extents); g_assert_cmpint (extents.x_bearing, ==, 0); - g_assert_cmpint (extents.y_bearing, ==, 0); + g_assert_cmpint (extents.y_bearing, ==, 800); g_assert_cmpint (extents.width, ==, 800); - g_assert_cmpint (extents.height, ==, 800); + g_assert_cmpint (extents.height, ==, -800); hb_blob_destroy (blob); hb_font_destroy (sbix_font); diff -Nru harfbuzz-2.5.3/test/api/test-ot-extents-cff.c harfbuzz-2.6.2/test/api/test-ot-extents-cff.c --- harfbuzz-2.5.3/test/api/test-ot-extents-cff.c 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/api/test-ot-extents-cff.c 2019-10-26 02:02:55.000000000 +0000 @@ -184,6 +184,37 @@ hb_font_destroy (font); } +static void +test_extents_cff2_vsindex_named_instance (void) +{ + hb_face_t *face = hb_test_open_font_file ("fonts/AdobeVFPrototype_vsindex.otf"); + g_assert (face); + hb_font_t *font = hb_font_create (face); + hb_face_destroy (face); + g_assert (font); + hb_ot_font_set_funcs (font); + + hb_font_set_var_named_instance (font, 6); // 6 (BlackMediumContrast): 900, 50 + hb_glyph_extents_t extents; + hb_bool_t result = hb_font_get_glyph_extents (font, 1, &extents); + g_assert (result); + + g_assert_cmpint (extents.x_bearing, ==, 12); + g_assert_cmpint (extents.y_bearing, ==, 652); + g_assert_cmpint (extents.width, ==, 653); + g_assert_cmpint (extents.height, ==, -652); + + result = hb_font_get_glyph_extents (font, 2, &extents); + g_assert (result); + + g_assert_cmpint (extents.x_bearing, ==, 6); + g_assert_cmpint (extents.y_bearing, ==, 675); + g_assert_cmpint (extents.width, ==, 647); + g_assert_cmpint (extents.height, ==, -675); + + hb_font_destroy (font); +} + int main (int argc, char **argv) { @@ -194,6 +225,7 @@ hb_test_add (test_extents_cff1_seac); hb_test_add (test_extents_cff2); hb_test_add (test_extents_cff2_vsindex); + hb_test_add (test_extents_cff2_vsindex_named_instance); return hb_test_run (); } diff -Nru harfbuzz-2.5.3/test/api/test-ot-face.c harfbuzz-2.6.2/test/api/test-ot-face.c --- harfbuzz-2.5.3/test/api/test-ot-face.c 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/api/test-ot-face.c 2019-10-26 02:02:55.000000000 +0000 @@ -74,6 +74,8 @@ hb_ot_color_has_png (face); hb_blob_destroy (hb_ot_color_glyph_reference_png (font, cp)); + hb_ot_layout_get_baseline (font, HB_OT_LAYOUT_BASELINE_TAG_HANGING, HB_DIRECTION_RTL, HB_SCRIPT_HANGUL, HB_TAG_NONE, NULL); + hb_ot_layout_has_glyph_classes (face); hb_ot_layout_has_substitution (face); hb_ot_layout_has_positioning (face); @@ -88,6 +90,14 @@ hb_ot_math_get_min_connector_overlap (font, HB_DIRECTION_RTL); hb_ot_math_get_glyph_assembly (font, cp, HB_DIRECTION_BTT, 0, NULL, NULL, NULL); + hb_ot_meta_get_entry_tags (face, 0, NULL, NULL); + hb_blob_destroy (hb_ot_meta_reference_entry (face, HB_OT_META_TAG_DESIGN_LANGUAGES)); + + hb_ot_metrics_get_position (font, HB_OT_METRICS_TAG_HORIZONTAL_ASCENDER, NULL); + hb_ot_metrics_get_variation (font, HB_OT_METRICS_TAG_UNDERLINE_OFFSET); + hb_ot_metrics_get_x_variation (font, HB_OT_METRICS_TAG_STRIKEOUT_OFFSET); + hb_ot_metrics_get_y_variation (font, HB_OT_METRICS_TAG_SUPERSCRIPT_EM_X_OFFSET); + len = sizeof (buf); hb_ot_name_list_names (face, NULL); hb_ot_name_get_utf8 (face, cp, NULL, &len, buf); diff -Nru harfbuzz-2.5.3/test/api/test-ot-math.c harfbuzz-2.6.2/test/api/test-ot-math.c --- harfbuzz-2.5.3/test/api/test-ot-math.c 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/api/test-ot-math.c 2019-10-26 02:02:55.000000000 +0000 @@ -457,41 +457,41 @@ g_assert(hb_font_get_glyph_from_name (hb_font, "arrowleft", -1, &glyph)); g_assert_cmpint(hb_ot_math_get_glyph_variants (hb_font, - glyph, - HB_DIRECTION_BTT, - 0, - NULL, - NULL), ==, 0); + glyph, + HB_DIRECTION_BTT, + 0, + NULL, + NULL), ==, 0); g_assert_cmpint(hb_ot_math_get_glyph_variants (hb_font, - glyph, - HB_DIRECTION_RTL, - 0, - NULL, - NULL), ==, 3); + glyph, + HB_DIRECTION_RTL, + 0, + NULL, + NULL), ==, 3); g_assert(hb_font_get_glyph_from_name (hb_font, "arrowup", -1, &glyph)); g_assert_cmpint(hb_ot_math_get_glyph_variants (hb_font, - glyph, - HB_DIRECTION_BTT, - 0, - NULL, - NULL), ==, 4); + glyph, + HB_DIRECTION_BTT, + 0, + NULL, + NULL), ==, 4); g_assert_cmpint(hb_ot_math_get_glyph_variants (hb_font, - glyph, - HB_DIRECTION_RTL, - 0, - NULL, - NULL), ==, 0); + glyph, + HB_DIRECTION_RTL, + 0, + NULL, + NULL), ==, 0); g_assert(hb_font_get_glyph_from_name (hb_font, "arrowleft", -1, &glyph)); do { count = variantsSize; hb_ot_math_get_glyph_variants (hb_font, - glyph, - HB_DIRECTION_RTL, - offset, - &count, - variants); + glyph, + HB_DIRECTION_RTL, + offset, + &count, + variants); offset += count; } while (count == variantsSize); g_assert_cmpint(offset, ==, 3); @@ -510,11 +510,11 @@ do { count = variantsSize; hb_ot_math_get_glyph_variants (hb_font, - glyph, - HB_DIRECTION_BTT, - offset, - &count, - variants); + glyph, + HB_DIRECTION_BTT, + offset, + &count, + variants); offset += count; } while (count == variantsSize); g_assert_cmpint(offset, ==, 4); @@ -581,46 +581,46 @@ g_assert(hb_font_get_glyph_from_name (hb_font, "arrowright", -1, &glyph)); g_assert_cmpint(hb_ot_math_get_glyph_assembly (hb_font, - glyph, - HB_DIRECTION_BTT, - 0, - NULL, - NULL, - NULL), ==, 0); + glyph, + HB_DIRECTION_BTT, + 0, + NULL, + NULL, + NULL), ==, 0); g_assert_cmpint(hb_ot_math_get_glyph_assembly (hb_font, - glyph, - HB_DIRECTION_RTL, - 0, - NULL, - NULL, - NULL), ==, 3); + glyph, + HB_DIRECTION_RTL, + 0, + NULL, + NULL, + NULL), ==, 3); g_assert(hb_font_get_glyph_from_name (hb_font, "arrowdown", -1, &glyph)); g_assert_cmpint(hb_ot_math_get_glyph_assembly (hb_font, - glyph, - HB_DIRECTION_BTT, - 0, - NULL, - NULL, - NULL), ==, 5); + glyph, + HB_DIRECTION_BTT, + 0, + NULL, + NULL, + NULL), ==, 5); g_assert_cmpint(hb_ot_math_get_glyph_assembly (hb_font, - glyph, - HB_DIRECTION_RTL, - 0, - NULL, - NULL, - NULL), ==, 0); + glyph, + HB_DIRECTION_RTL, + 0, + NULL, + NULL, + NULL), ==, 0); g_assert(hb_font_get_glyph_from_name (hb_font, "arrowright", -1, &glyph)); do { count = partsSize; hb_ot_math_get_glyph_assembly (hb_font, - glyph, - HB_DIRECTION_RTL, - offset, - &count, - parts, - NULL); + glyph, + HB_DIRECTION_RTL, + offset, + &count, + parts, + NULL); offset += count; } while (count == partsSize); g_assert_cmpint(offset, ==, 3); @@ -648,12 +648,12 @@ do { count = partsSize; hb_ot_math_get_glyph_assembly (hb_font, - glyph, - HB_DIRECTION_BTT, - offset, - &count, - parts, - NULL); + glyph, + HB_DIRECTION_BTT, + offset, + &count, + parts, + NULL); offset += count; } while (count == partsSize); g_assert_cmpint(offset, ==, 5); diff -Nru harfbuzz-2.5.3/test/api/test-ot-meta.c harfbuzz-2.6.2/test/api/test-ot-meta.c --- harfbuzz-2.5.3/test/api/test-ot-meta.c 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/test/api/test-ot-meta.c 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,84 @@ +/* + * Copyright © 2019 Ebrahim Byagowi + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#include "hb-test.h" + +#include + +/* Unit tests for hb-ot-meta.h */ + +static void +test_ot_meta_get_entries (void) +{ + hb_face_t *face = hb_test_open_font_file ("fonts/meta.ttf"); + hb_ot_meta_tag_t entries[2]; + + unsigned int entries_count = 2; + g_assert_cmpint (hb_ot_meta_get_entry_tags (face, 0, &entries_count, entries), ==, 5); + g_assert_cmpint (entries_count, ==, 2); + g_assert_cmpint (entries[0], ==, HB_TAG ('a','p','p','l')); + g_assert_cmpint (entries[1], ==, HB_TAG ('b','i','l','d')); + + entries_count = 1; + g_assert_cmpint (hb_ot_meta_get_entry_tags (face, 2, &entries_count, entries), ==, 5); + g_assert_cmpint (entries_count, ==, 1); + g_assert_cmpint (entries[0], ==, HB_TAG ('d','l','n','g')); + + entries_count = 2; + g_assert_cmpint (hb_ot_meta_get_entry_tags (face, 4, &entries_count, entries), ==, 5); + g_assert_cmpint (entries_count, ==, 1); + g_assert_cmpint (entries[0], ==, HB_TAG ('s','l','n','g')); + + hb_face_destroy (face); +} + +static void +test_ot_meta_reference_entry (void) +{ + hb_face_t *face = hb_test_open_font_file ("fonts/meta.ttf"); + hb_blob_t *dlng = hb_ot_meta_reference_entry (face, HB_OT_META_TAG_DESIGN_LANGUAGES); + g_assert_cmpint (hb_blob_get_length (dlng), ==, 8); + g_assert_cmpmem (hb_blob_get_data (dlng, NULL), 8, "ar,de,fa", 8); + hb_blob_destroy (dlng); + hb_blob_t *fslf = hb_ot_meta_reference_entry (face, (hb_ot_meta_tag_t) HB_TAG ('f','s','l','f')); + g_assert_cmpint (hb_blob_get_length (fslf), ==, 12); + hb_blob_destroy (fslf); + hb_blob_t *nacl = hb_ot_meta_reference_entry (face, (hb_ot_meta_tag_t) HB_TAG ('n','a','c','l')); + g_assert_cmpint (hb_blob_get_length (nacl), ==, 0); + hb_blob_destroy (nacl); + hb_blob_t *slng = hb_ot_meta_reference_entry (face, HB_OT_META_TAG_SUPPORTED_LANGUAGES); + g_assert_cmpint (hb_blob_get_length (slng), ==, 11); + g_assert_cmpmem (hb_blob_get_data (slng, NULL), 11, "ar,de,en,fa", 11); + hb_blob_destroy (slng); + hb_face_destroy (face); +} + +int +main (int argc, char **argv) +{ + hb_test_init (&argc, &argv); + hb_test_add (test_ot_meta_get_entries); + hb_test_add (test_ot_meta_reference_entry); + return hb_test_run (); +} diff -Nru harfbuzz-2.5.3/test/api/test-ot-metrics.c harfbuzz-2.6.2/test/api/test-ot-metrics.c --- harfbuzz-2.5.3/test/api/test-ot-metrics.c 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/test/api/test-ot-metrics.c 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,78 @@ +/* + * Copyright © 2018 Ebrahim Byagowi + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#include "hb-test.h" + +#include + +#include + +/* Unit tests for hb-ot-metrics.h */ + +static void +test_ot_metrics_get_no_var (void) +{ + hb_face_t *face = hb_test_open_font_file ("fonts/cpal-v0.ttf"); + hb_font_t *font = hb_font_create (face); + hb_position_t value; + g_assert (hb_ot_metrics_get_position (font, HB_OT_METRICS_TAG_HORIZONTAL_ASCENDER, &value)); + g_assert_cmpint (value, ==, 1000); + g_assert_cmpint (hb_ot_metrics_get_x_variation (font, HB_OT_METRICS_TAG_HORIZONTAL_ASCENDER), ==, 0); + g_assert_cmpint (hb_ot_metrics_get_y_variation (font, HB_OT_METRICS_TAG_HORIZONTAL_ASCENDER), ==, 0); + g_assert_cmpint (hb_ot_metrics_get_x_variation (font, HB_OT_METRICS_TAG_X_HEIGHT), ==, 0); + // g_assert_cmpint ((int) hb_ot_metrics_get_variation (font, HB_OT_METRICS_TAG_HORIZONTAL_ASCENDER), ==, 0); + hb_font_destroy (font); + hb_face_destroy (face); +} + +static void +test_ot_metrics_get_var (void) +{ + hb_face_t *face = hb_test_open_font_file ("fonts/TestCFF2VF.otf"); + hb_font_t *font = hb_font_create (face); + hb_position_t value; + g_assert (hb_ot_metrics_get_position (font, HB_OT_METRICS_TAG_X_HEIGHT, &value)); + g_assert_cmpint (value, ==, 486); + g_assert_cmpint (hb_ot_metrics_get_x_variation (font, HB_OT_METRICS_TAG_HORIZONTAL_ASCENDER), ==, 0); + g_assert_cmpint (hb_ot_metrics_get_y_variation (font, HB_OT_METRICS_TAG_HORIZONTAL_ASCENDER), ==, 0); + g_assert_cmpint (hb_ot_metrics_get_x_variation (font, HB_OT_METRICS_TAG_X_HEIGHT), ==, 0); + float coords[] = {100.f}; + hb_font_set_var_coords_design (font, coords, 1); + g_assert (hb_ot_metrics_get_position (font, HB_OT_METRICS_TAG_X_HEIGHT, &value)); + g_assert_cmpint (value, ==, 478); + g_assert_cmpint (hb_ot_metrics_get_x_variation (font, HB_OT_METRICS_TAG_HORIZONTAL_ASCENDER), ==, 0); + g_assert_cmpint (hb_ot_metrics_get_y_variation (font, HB_OT_METRICS_TAG_HORIZONTAL_ASCENDER), ==, 0); + g_assert_cmpint (hb_ot_metrics_get_x_variation (font, HB_OT_METRICS_TAG_X_HEIGHT), ==, -8); + hb_font_destroy (font); + hb_face_destroy (face); +} + +int +main (int argc, char **argv) +{ + hb_test_init (&argc, &argv); + hb_test_add (test_ot_metrics_get_no_var); + hb_test_add (test_ot_metrics_get_var); + return hb_test_run (); +} diff -Nru harfbuzz-2.5.3/test/api/test-ot-tag.c harfbuzz-2.6.2/test/api/test-ot-tag.c --- harfbuzz-2.5.3/test/api/test-ot-tag.c 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/api/test-ot-tag.c 2019-10-26 02:02:55.000000000 +0000 @@ -351,9 +351,6 @@ test_tag_from_language ("ZHH", "yue-Hant"); test_tag_from_language ("ZHS", "yue-Hans"); - test_tag_from_language ("ZHS", "zh"); /* Chinese */ - test_tag_from_language ("ZHS", "zh-xx"); - test_language_two_way ("ABC", "abc"); test_language_two_way ("ABCD", "x-hbotabcd"); test_tag_from_language ("ABC", "asdf-asdf-wer-x-hbotabc-zxc"); diff -Nru harfbuzz-2.5.3/test/api/test-shape.c harfbuzz-2.6.2/test/api/test-shape.c --- harfbuzz-2.5.3/test/api/test-shape.c 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/api/test-shape.c 2019-10-26 02:02:55.000000000 +0000 @@ -70,30 +70,13 @@ static const char TesT[] = "TesT"; static void -test_shape (void) +test_font (hb_font_t *font) { - hb_blob_t *blob; - hb_face_t *face; - hb_font_funcs_t *ffuncs; - hb_font_t *font; hb_buffer_t *buffer; unsigned int len; hb_glyph_info_t *glyphs; hb_glyph_position_t *positions; - blob = hb_blob_create (test_data, sizeof (test_data), HB_MEMORY_MODE_READONLY, NULL, NULL); - face = hb_face_create (blob, 0); - hb_blob_destroy (blob); - font = hb_font_create (face); - hb_face_destroy (face); - hb_font_set_scale (font, 10, 10); - - ffuncs = hb_font_funcs_create (); - hb_font_funcs_set_glyph_h_advance_func (ffuncs, glyph_h_advance_func, NULL, NULL); - hb_font_funcs_set_nominal_glyph_func (ffuncs, glyph_func, malloc (10), free); - hb_font_set_funcs (font, ffuncs, NULL, NULL); - hb_font_funcs_destroy (ffuncs); - buffer = hb_buffer_create (); hb_buffer_set_direction (buffer, HB_DIRECTION_LTR); hb_buffer_add_utf8 (buffer, TesT, 4, 0, 4); @@ -123,6 +106,35 @@ } hb_buffer_destroy (buffer); +} + +static void +test_shape (void) +{ + hb_blob_t *blob; + hb_face_t *face; + hb_font_funcs_t *ffuncs; + hb_font_t *font, *sub_font; + + blob = hb_blob_create (test_data, sizeof (test_data), HB_MEMORY_MODE_READONLY, NULL, NULL); + face = hb_face_create (blob, 0); + hb_blob_destroy (blob); + font = hb_font_create (face); + hb_face_destroy (face); + hb_font_set_scale (font, 10, 10); + + ffuncs = hb_font_funcs_create (); + hb_font_funcs_set_glyph_h_advance_func (ffuncs, glyph_h_advance_func, NULL, NULL); + hb_font_funcs_set_nominal_glyph_func (ffuncs, glyph_func, malloc (10), free); + hb_font_set_funcs (font, ffuncs, NULL, NULL); + hb_font_funcs_destroy (ffuncs); + + test_font (font); + + sub_font = hb_font_create_sub_font (font); + test_font (sub_font); + + hb_font_destroy (sub_font); hb_font_destroy (font); } diff -Nru harfbuzz-2.5.3/test/api/test-unicode.c harfbuzz-2.6.2/test/api/test-unicode.c --- harfbuzz-2.5.3/test/api/test-unicode.c 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/api/test-unicode.c 2019-10-26 02:02:55.000000000 +0000 @@ -62,8 +62,8 @@ static hb_script_t simple_get_script (hb_unicode_funcs_t *ufuncs, - hb_codepoint_t codepoint, - void *user_data) + hb_codepoint_t codepoint, + void *user_data) { data_t *data = (data_t *) user_data; @@ -79,8 +79,8 @@ static hb_script_t a_is_for_arabic_get_script (hb_unicode_funcs_t *ufuncs, - hb_codepoint_t codepoint, - void *user_data) + hb_codepoint_t codepoint, + void *user_data) { data_t *data = (data_t *) user_data; @@ -157,6 +157,27 @@ /* Unicode-6.0 character additions */ { 0x135D, 230 }, + /* Unicode-6.1 character additions */ + { 0xA674, 230 }, + + /* Unicode-7.0 character additions */ + { 0x1AB0, 230 }, + + /* Unicode-8.0 character additions */ + { 0xA69E, 230 }, + + /* Unicode-9.0 character additions */ + { 0x1E000, 230 }, + + /* Unicode-10.0 character additions */ + { 0x1DF6, 232 }, + + /* Unicode-11.0 character additions */ + { 0x07FD, 220 }, + + /* Unicode-12.0 character additions */ + { 0x0EBA, 9 }, + { 0x111111, 0 } }; @@ -204,6 +225,36 @@ /* Unicode-6.0 character additions */ { 0x0620, HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER }, + /* Unicode-6.1 character additions */ + { 0x058F, HB_UNICODE_GENERAL_CATEGORY_CURRENCY_SYMBOL }, + + /* Unicode-6.2 character additions */ + { 0x20BA, HB_UNICODE_GENERAL_CATEGORY_CURRENCY_SYMBOL }, + + /* Unicode-6.3 character additions */ + { 0x061C, HB_UNICODE_GENERAL_CATEGORY_FORMAT }, + + /* Unicode-7.0 character additions */ + { 0x058D, HB_UNICODE_GENERAL_CATEGORY_OTHER_SYMBOL }, + + /* Unicode-8.0 character additions */ + { 0x08E3, HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK }, + + /* Unicode-9.0 character additions */ + { 0x08D4, HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK }, + + /* Unicode-10.0 character additions */ + { 0x09FD, HB_UNICODE_GENERAL_CATEGORY_OTHER_PUNCTUATION }, + + /* Unicode-11.0 character additions */ + { 0x0560, HB_UNICODE_GENERAL_CATEGORY_LOWERCASE_LETTER }, + + /* Unicode-12.0 character additions */ + { 0x0C77, HB_UNICODE_GENERAL_CATEGORY_OTHER_PUNCTUATION }, + + /* Unicode-12.1 character additions */ + { 0x32FF, HB_UNICODE_GENERAL_CATEGORY_OTHER_SYMBOL }, + { 0x111111, HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED } }; @@ -242,7 +293,12 @@ }; static const test_pair_t mirroring_tests_more[] = { - /* No new mirroring characters have been encoded in recent Unicode versions. */ + /* Unicode-6.1 character additions */ + { 0x27CB, 0x27CD }, + + /* Unicode-11.0 character additions */ + { 0x2BFE, 0x221F }, + { 0x111111, 0x111111 } }; @@ -342,8 +398,10 @@ /* Unicode-5.2 additions */ { 0x10B00, HB_SCRIPT_AVESTAN }, { 0xA6A0, HB_SCRIPT_BAMUM }, + { 0x1400, HB_SCRIPT_CANADIAN_ABORIGINAL }, { 0x13000, HB_SCRIPT_EGYPTIAN_HIEROGLYPHS }, { 0x10840, HB_SCRIPT_IMPERIAL_ARAMAIC }, + { 0x1CED, HB_SCRIPT_INHERITED }, { 0x10B60, HB_SCRIPT_INSCRIPTIONAL_PAHLAVI }, { 0x10B40, HB_SCRIPT_INSCRIPTIONAL_PARTHIAN }, { 0xA980, HB_SCRIPT_JAVANESE }, @@ -361,9 +419,85 @@ { 0x11000, HB_SCRIPT_BRAHMI }, { 0x0840, HB_SCRIPT_MANDAIC }, - /* Unicode-5.2 character additions */ - { 0x1CED, HB_SCRIPT_INHERITED }, - { 0x1400, HB_SCRIPT_CANADIAN_ABORIGINAL }, + /* Unicode-6.1 additions */ + { 0x10980, HB_SCRIPT_MEROITIC_HIEROGLYPHS }, + { 0x109A0, HB_SCRIPT_MEROITIC_CURSIVE }, + { 0x110D0, HB_SCRIPT_SORA_SOMPENG }, + { 0x11100, HB_SCRIPT_CHAKMA }, + { 0x11180, HB_SCRIPT_SHARADA }, + { 0x11680, HB_SCRIPT_TAKRI }, + { 0x16F00, HB_SCRIPT_MIAO }, + + /* Unicode-6.2 additions */ + { 0x20BA, HB_SCRIPT_COMMON }, + + /* Unicode-6.3 additions */ + { 0x2066, HB_SCRIPT_COMMON }, + + /* Unicode-7.0 additions */ + { 0x10350, HB_SCRIPT_OLD_PERMIC }, + { 0x10500, HB_SCRIPT_ELBASAN }, + { 0x10530, HB_SCRIPT_CAUCASIAN_ALBANIAN }, + { 0x10600, HB_SCRIPT_LINEAR_A }, + { 0x10860, HB_SCRIPT_PALMYRENE }, + { 0x10880, HB_SCRIPT_NABATAEAN }, + { 0x10A80, HB_SCRIPT_OLD_NORTH_ARABIAN }, + { 0x10AC0, HB_SCRIPT_MANICHAEAN }, + { 0x10B80, HB_SCRIPT_PSALTER_PAHLAVI }, + { 0x11150, HB_SCRIPT_MAHAJANI }, + { 0x11200, HB_SCRIPT_KHOJKI }, + { 0x112B0, HB_SCRIPT_KHUDAWADI }, + { 0x11300, HB_SCRIPT_GRANTHA }, + { 0x11480, HB_SCRIPT_TIRHUTA }, + { 0x11580, HB_SCRIPT_SIDDHAM }, + { 0x11600, HB_SCRIPT_MODI }, + { 0x118A0, HB_SCRIPT_WARANG_CITI }, + { 0x11AC0, HB_SCRIPT_PAU_CIN_HAU }, + { 0x16A40, HB_SCRIPT_MRO }, + { 0x16AD0, HB_SCRIPT_BASSA_VAH }, + { 0x16B00, HB_SCRIPT_PAHAWH_HMONG }, + { 0x1BC00, HB_SCRIPT_DUPLOYAN }, + { 0x1E800, HB_SCRIPT_MENDE_KIKAKUI }, + + /* Unicode-8.0 additions */ + { 0x108E0, HB_SCRIPT_HATRAN }, + { 0x10C80, HB_SCRIPT_OLD_HUNGARIAN }, + { 0x11280, HB_SCRIPT_MULTANI }, + { 0x11700, HB_SCRIPT_AHOM }, + { 0x14400, HB_SCRIPT_ANATOLIAN_HIEROGLYPHS }, + { 0x1D800, HB_SCRIPT_SIGNWRITING }, + + /* Unicode-9.0 additions */ + { 0x104B0, HB_SCRIPT_OSAGE }, + { 0x11400, HB_SCRIPT_NEWA }, + { 0x11C00, HB_SCRIPT_BHAIKSUKI }, + { 0x11C70, HB_SCRIPT_MARCHEN }, + { 0x17000, HB_SCRIPT_TANGUT }, + { 0x1E900, HB_SCRIPT_ADLAM }, + + /* Unicode-10.0 additions */ + { 0x11A00, HB_SCRIPT_ZANABAZAR_SQUARE }, + { 0x11A50, HB_SCRIPT_SOYOMBO }, + { 0x11D00, HB_SCRIPT_MASARAM_GONDI }, + { 0x1B170, HB_SCRIPT_NUSHU }, + + /* Unicode-11.0 additions */ + { 0x10D00, HB_SCRIPT_HANIFI_ROHINGYA }, + { 0x10F00, HB_SCRIPT_OLD_SOGDIAN }, + { 0x10F30, HB_SCRIPT_SOGDIAN }, + { 0x11800, HB_SCRIPT_DOGRA }, + { 0x11D60, HB_SCRIPT_GUNJALA_GONDI }, + { 0x11EE0, HB_SCRIPT_MAKASAR }, + { 0x16E40, HB_SCRIPT_MEDEFAIDRIN }, + + /* Unicode-12.0 additions */ + { 0x10FE0, HB_SCRIPT_ELYMAIC }, + { 0x119A0, HB_SCRIPT_NANDINAGARI }, + { 0x1E100, HB_SCRIPT_NYIAKENG_PUACHUE_HMONG }, + { 0x1E2C0, HB_SCRIPT_WANCHO }, + + /* Unicode-12.1 additions */ + { 0x32FF, HB_SCRIPT_COMMON }, { 0x111111, HB_SCRIPT_UNKNOWN } }; @@ -413,7 +547,7 @@ #undef PROPERTY static void -test_unicode_properties (gconstpointer user_data) +test_unicode_properties (gconstpointer user_data, hb_bool_t lenient) { hb_unicode_funcs_t *uf = (hb_unicode_funcs_t *) user_data; unsigned int i, j; @@ -437,16 +571,30 @@ tests = p->tests_more; for (j = 0; j < p->num_tests_more; j++) { g_test_message ("Test %s more #%d: U+%04X", p->name, j, tests[j].unicode); - if (p->getter (uf, tests[j].unicode) != tests[j].value) { - g_test_message ("Soft fail: Received %x, expected %x", p->getter (uf, tests[j].unicode), tests[j].value); - failed = TRUE; + if (lenient) { + if (p->getter (uf, tests[j].unicode) != tests[j].value) { + g_test_message ("Soft fail: Received %x, expected %x", p->getter (uf, tests[j].unicode), tests[j].value); + failed = TRUE; + } } + else + g_assert_cmphex (p->getter (uf, tests[j].unicode), ==, tests[j].value); } } if (failed) g_test_message ("Some property tests failed. You probably have an old version of one of the libraries used."); } +static void +test_unicode_properties_lenient (gconstpointer user_data) +{ + test_unicode_properties (user_data, TRUE); +} +static void +test_unicode_properties_strict (gconstpointer user_data) +{ + test_unicode_properties (user_data, FALSE); +} static hb_codepoint_t default_value (hb_codepoint_t _default_value, hb_codepoint_t unicode) @@ -529,7 +677,7 @@ g_assert (!hb_unicode_funcs_is_immutable (uf2)); hb_unicode_funcs_make_immutable (uf2); - test_unicode_properties (uf2); + test_unicode_properties_strict (uf2); hb_unicode_funcs_destroy (uf2); @@ -603,7 +751,7 @@ hb_unicode_funcs_destroy (uf); hb_unicode_funcs_set_script_func (aa, a_is_for_arabic_get_script, - &f->data[1], free_up); + &f->data[1], free_up); g_assert_cmphex (hb_unicode_script (aa, 'a'), ==, HB_SCRIPT_ARABIC); g_assert_cmphex (hb_unicode_script (aa, 'b'), ==, HB_SCRIPT_UNKNOWN); @@ -622,7 +770,7 @@ aa = hb_unicode_funcs_create (uf); hb_unicode_funcs_set_script_func (aa, a_is_for_arabic_get_script, - &f->data[1], free_up); + &f->data[1], free_up); g_assert_cmphex (hb_unicode_script (aa, 'a'), ==, HB_SCRIPT_ARABIC); g_assert_cmphex (hb_unicode_script (aa, 'b'), ==, HB_SCRIPT_LATIN); @@ -640,7 +788,7 @@ uf = hb_unicode_funcs_create (NULL); hb_unicode_funcs_set_script_func (uf, simple_get_script, - &f->data[0], free_up); + &f->data[0], free_up); aa = hb_unicode_funcs_create (uf); @@ -650,7 +798,7 @@ g_assert (!f->data[0].freed); hb_unicode_funcs_set_script_func (aa, a_is_for_arabic_get_script, - &f->data[1], free_up); + &f->data[1], free_up); g_assert_cmphex (hb_unicode_script (aa, 'a'), ==, HB_SCRIPT_ARABIC); g_assert_cmphex (hb_unicode_script (aa, 'b'), ==, HB_SCRIPT_LATIN); @@ -800,16 +948,16 @@ hb_test_add (test_unicode_properties_nil); hb_test_add (test_unicode_properties_empty); - hb_test_add_data_flavor (hb_unicode_funcs_get_default (), "default", test_unicode_properties); + hb_test_add_data_flavor (hb_unicode_funcs_get_default (), "default", test_unicode_properties_strict); hb_test_add_data_flavor (hb_unicode_funcs_get_default (), "default", test_unicode_normalization); hb_test_add_data_flavor ((gconstpointer) script_roundtrip_default, "default", test_unicode_script_roundtrip); #ifdef HAVE_GLIB - hb_test_add_data_flavor (hb_glib_get_unicode_funcs (), "glib", test_unicode_properties); + hb_test_add_data_flavor (hb_glib_get_unicode_funcs (), "glib", test_unicode_properties_lenient); hb_test_add_data_flavor (hb_glib_get_unicode_funcs (), "glib", test_unicode_normalization); hb_test_add_data_flavor ((gconstpointer) script_roundtrip_glib, "glib", test_unicode_script_roundtrip); #endif #ifdef HAVE_ICU - hb_test_add_data_flavor (hb_icu_get_unicode_funcs (), "icu", test_unicode_properties); + hb_test_add_data_flavor (hb_icu_get_unicode_funcs (), "icu", test_unicode_properties_lenient); hb_test_add_data_flavor (hb_icu_get_unicode_funcs (), "icu", test_unicode_normalization); hb_test_add_data_flavor ((gconstpointer) script_roundtrip_icu, "icu", test_unicode_script_roundtrip); #endif Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/fuzzing/fonts/clusterfuzz-testcase-minimized-harfbuzz_fuzzer-5093685255077888 and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/fuzzing/fonts/clusterfuzz-testcase-minimized-harfbuzz_fuzzer-5093685255077888 differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-subset-fuzzer-5667673584697344 and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-subset-fuzzer-5667673584697344 differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-subset-fuzzer-5675720390475776 and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-subset-fuzzer-5675720390475776 differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-subset-fuzzer-5728664968232960 and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-subset-fuzzer-5728664968232960 differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-subset-fuzzer-5738978499624960 and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-subset-fuzzer-5738978499624960 differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-subset-fuzzer-5754526379802624 and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-subset-fuzzer-5754526379802624 differ diff -Nru harfbuzz-2.5.3/test/fuzzing/hb-subset-fuzzer.cc harfbuzz-2.6.2/test/fuzzing/hb-subset-fuzzer.cc --- harfbuzz-2.5.3/test/fuzzing/hb-subset-fuzzer.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/fuzzing/hb-subset-fuzzer.cc 2019-10-26 02:02:55.000000000 +0000 @@ -3,6 +3,7 @@ #include #include #include +#include #include "hb-subset.h" @@ -32,6 +33,19 @@ } hb_face_t *result = hb_subset (face, input); + { + hb_blob_t *blob = hb_face_reference_blob (result); + unsigned int length; + const char *data = hb_blob_get_data (blob, &length); + + // Something not optimizable just to access all the blob data + unsigned int bytes_count = 0; + for (unsigned int i = 0; i < length; ++i) + if (data[i]) ++bytes_count; + assert (bytes_count || !length); + + hb_blob_destroy (blob); + } hb_face_destroy (result); hb_subset_input_destroy (input); diff -Nru harfbuzz-2.5.3/test/fuzzing/Makefile.in harfbuzz-2.6.2/test/fuzzing/Makefile.in --- harfbuzz-2.5.3/test/fuzzing/Makefile.in 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/fuzzing/Makefile.in 2019-10-26 02:02:55.000000000 +0000 @@ -254,6 +254,8 @@ FREETYPE_DEPS = @FREETYPE_DEPS@ FREETYPE_LIBS = @FREETYPE_LIBS@ GCOV = @GCOV@ +GDI_CFLAGS = @GDI_CFLAGS@ +GDI_LIBS = @GDI_LIBS@ GENHTML = @GENHTML@ GIT = @GIT@ GLIB_CFLAGS = @GLIB_CFLAGS@ diff -Nru harfbuzz-2.5.3/test/fuzzing/run-shape-fuzzer-tests.py harfbuzz-2.6.2/test/fuzzing/run-shape-fuzzer-tests.py --- harfbuzz-2.5.3/test/fuzzing/run-shape-fuzzer-tests.py 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/fuzzing/run-shape-fuzzer-tests.py 2019-10-26 02:02:55.000000000 +0000 @@ -1,45 +1,50 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function, division, absolute_import import sys, os, subprocess, tempfile, threading -def which(program): +def which (program): # https://stackoverflow.com/a/377028 - def is_exe(fpath): - return os.path.isfile(fpath) and os.access(fpath, os.X_OK) + def is_exe (fpath): + return os.path.isfile (fpath) and os.access (fpath, os.X_OK) - fpath, _ = os.path.split(program) + fpath, _ = os.path.split (program) if fpath: - if is_exe(program): + if is_exe (program): return program else: - for path in os.environ["PATH"].split(os.pathsep): - exe_file = os.path.join(path, program) - if is_exe(exe_file): + for path in os.environ["PATH"].split (os.pathsep): + exe_file = os.path.join (path, program) + if is_exe (exe_file): return exe_file return None -def cmd(command): +def cmd (command): # https://stackoverflow.com/a/4408409 # https://stackoverflow.com/a/10012262 - with tempfile.TemporaryFile() as tempf: + with tempfile.TemporaryFile () as tempf: p = subprocess.Popen (command, stderr=tempf) is_killed = {'value': False} - def timeout(p, is_killed): + def timeout (p, is_killed): is_killed['value'] = True - p.kill() + p.kill () timer = threading.Timer (2, timeout, [p, is_killed]) try: timer.start() p.wait () tempf.seek (0) - text = tempf.read().decode ("utf-8").strip () + text = tempf.read () + + #TODO: Detect debug mode with a better way + is_debug_mode = b"SANITIZE" in text + + text = "" if is_debug_mode else text.decode ("utf-8").strip () returncode = p.returncode finally: timer.cancel() @@ -67,9 +72,9 @@ print ('hb_shape_fuzzer:', hb_shape_fuzzer) fails = 0 -libtool = os.environ.get('LIBTOOL') +libtool = os.environ.get ('LIBTOOL') valgrind = None -if os.environ.get('RUN_VALGRIND', ''): +if os.environ.get ('RUN_VALGRIND', ''): valgrind = which ('valgrind') if valgrind is None: print ("""Valgrind requested but not found.""") @@ -80,7 +85,7 @@ parent_path = os.path.join (srcdir, "fonts") for file in os.listdir (parent_path): - path = os.path.join(parent_path, file) + path = os.path.join (parent_path, file) if valgrind: text, returncode = cmd (libtool.split(' ') + ['--mode=execute', valgrind + ' --leak-check=full --error-exitcode=1', '--', hb_shape_fuzzer, path]) @@ -89,7 +94,7 @@ if 'error' in text: returncode = 1 - if not valgrind and text.strip (): + if (not valgrind or returncode) and text.strip (): print (text) if returncode != 0: diff -Nru harfbuzz-2.5.3/test/fuzzing/run-subset-fuzzer-tests.py harfbuzz-2.6.2/test/fuzzing/run-subset-fuzzer-tests.py --- harfbuzz-2.5.3/test/fuzzing/run-subset-fuzzer-tests.py 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/fuzzing/run-subset-fuzzer-tests.py 2019-10-26 02:02:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function, division, absolute_import @@ -33,13 +33,18 @@ def timeout(p, is_killed): is_killed['value'] = True p.kill() - timer = threading.Timer (2, timeout, [p, is_killed]) + timer = threading.Timer (16, timeout, [p, is_killed]) try: timer.start() p.wait () tempf.seek (0) - text = tempf.read().decode ("utf-8").strip () + text = tempf.read () + + #TODO: Detect debug mode with a better way + is_debug_mode = b"SANITIZE" in text + + text = "" if is_debug_mode else text.decode ("utf-8").strip () returncode = p.returncode finally: timer.cancel() @@ -82,6 +87,8 @@ global fails for file in os.listdir (parent_path): path = os.path.join(parent_path, file) + # TODO: Run on all the fonts not just subset related ones + if "subset" not in path: continue print ("running subset fuzzer against %s" % path) if valgrind: @@ -91,7 +98,7 @@ if 'error' in text: returncode = 1 - if not valgrind and text.strip (): + if (not valgrind or returncode) and text.strip (): print (text) if returncode != 0: @@ -100,8 +107,7 @@ run_dir (os.path.join (srcdir, "..", "subset", "data", "fonts")) -# TODO running these tests very slow tests. Fix and re-enable -#run_dir (os.path.join (srcdir, "fonts")) +run_dir (os.path.join (srcdir, "fonts")) if fails: print ("%i subset fuzzer related tests failed." % fails) diff -Nru harfbuzz-2.5.3/test/Makefile.in harfbuzz-2.6.2/test/Makefile.in --- harfbuzz-2.5.3/test/Makefile.in 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/Makefile.in 2019-10-26 02:02:55.000000000 +0000 @@ -236,6 +236,8 @@ FREETYPE_DEPS = @FREETYPE_DEPS@ FREETYPE_LIBS = @FREETYPE_LIBS@ GCOV = @GCOV@ +GDI_CFLAGS = @GDI_CFLAGS@ +GDI_LIBS = @GDI_LIBS@ GENHTML = @GENHTML@ GIT = @GIT@ GLIB_CFLAGS = @GLIB_CFLAGS@ diff -Nru harfbuzz-2.5.3/test/shaping/data/aots/Makefile.in harfbuzz-2.6.2/test/shaping/data/aots/Makefile.in --- harfbuzz-2.5.3/test/shaping/data/aots/Makefile.in 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/shaping/data/aots/Makefile.in 2019-10-26 02:02:55.000000000 +0000 @@ -480,6 +480,8 @@ FREETYPE_DEPS = @FREETYPE_DEPS@ FREETYPE_LIBS = @FREETYPE_LIBS@ GCOV = @GCOV@ +GDI_CFLAGS = @GDI_CFLAGS@ +GDI_LIBS = @GDI_LIBS@ GENHTML = @GENHTML@ GIT = @GIT@ GLIB_CFLAGS = @GLIB_CFLAGS@ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/shaping/data/in-house/fonts/53a91c20e33a596f2be17fb68b382d6b7eb85d5c.ttf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/shaping/data/in-house/fonts/53a91c20e33a596f2be17fb68b382d6b7eb85d5c.ttf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/shaping/data/in-house/fonts/ea3f63620511b2097200d23774ffef197e829e69.ttf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/shaping/data/in-house/fonts/ea3f63620511b2097200d23774ffef197e829e69.ttf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/shaping/data/in-house/fonts/f79eb71df4e4c9c273b67b89a06e5ff9e3c1f834.ttf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/shaping/data/in-house/fonts/f79eb71df4e4c9c273b67b89a06e5ff9e3c1f834.ttf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/shaping/data/in-house/fonts/fcbaa518d3cce441ed37ae3b1fed6a19e9b54efd.ttf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/shaping/data/in-house/fonts/fcbaa518d3cce441ed37ae3b1fed6a19e9b54efd.ttf differ diff -Nru harfbuzz-2.5.3/test/shaping/data/in-house/Makefile.in harfbuzz-2.6.2/test/shaping/data/in-house/Makefile.in --- harfbuzz-2.5.3/test/shaping/data/in-house/Makefile.in 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/shaping/data/in-house/Makefile.in 2019-10-26 02:02:55.000000000 +0000 @@ -112,9 +112,9 @@ tests/mark-attachment.tests tests/mark-filtering-sets.tests \ tests/mongolian-variation-selector.tests \ tests/myanmar-syllable.tests tests/myanmar-zawgyi.tests \ - tests/none-directional.tests tests/rand.tests \ - tests/spaces.tests tests/simple.tests tests/sinhala.tests \ - tests/tibetan-contractions-1.tests \ + tests/none-directional.tests tests/positioning-features.tests \ + tests/rand.tests tests/spaces.tests tests/simple.tests \ + tests/sinhala.tests tests/tibetan-contractions-1.tests \ tests/tibetan-contractions-2.tests tests/tibetan-vowels.tests \ tests/use.tests tests/use-indic3.tests tests/use-marchen.tests \ tests/use-syllable.tests tests/variations-rvrn.tests \ @@ -410,6 +410,8 @@ FREETYPE_DEPS = @FREETYPE_DEPS@ FREETYPE_LIBS = @FREETYPE_LIBS@ GCOV = @GCOV@ +GDI_CFLAGS = @GDI_CFLAGS@ +GDI_LIBS = @GDI_LIBS@ GENHTML = @GENHTML@ GIT = @GIT@ GLIB_CFLAGS = @GLIB_CFLAGS@ diff -Nru harfbuzz-2.5.3/test/shaping/data/in-house/Makefile.sources harfbuzz-2.6.2/test/shaping/data/in-house/Makefile.sources --- harfbuzz-2.5.3/test/shaping/data/in-house/Makefile.sources 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/shaping/data/in-house/Makefile.sources 2019-10-26 02:02:55.000000000 +0000 @@ -41,6 +41,7 @@ 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 -Nru harfbuzz-2.5.3/test/shaping/data/in-house/tests/aat-trak.tests harfbuzz-2.6.2/test/shaping/data/in-house/tests/aat-trak.tests --- harfbuzz-2.5.3/test/shaping/data/in-house/tests/aat-trak.tests 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/shaping/data/in-house/tests/aat-trak.tests 2019-10-26 02:02:55.000000000 +0000 @@ -1,11 +1,11 @@ ../fonts/TRAK.ttf::U+0041,U+0042,U+0043:[A.alt=0+1000|B=1+1000|C.alt=2+1000] ../fonts/TRAK.ttf:--font-ptem=.5:U+0041,U+0042,U+0043:[A.alt=0@100,0+1200|B=1@100,0+1200|C.alt=2@100,0+1200] ../fonts/TRAK.ttf:--font-ptem=1:U+0041,U+0042,U+0043:[A.alt=0@100,0+1200|B=1@100,0+1200|C.alt=2@100,0+1200] -../fonts/TRAK.ttf:--font-ptem=2:U+0041,U+0042,U+0043:[A.alt=0@93,0+1187|B=1@93,0+1187|C.alt=2@93,0+1187] -../fonts/TRAK.ttf:--font-ptem=9:U+0041,U+0042,U+0043:[A.alt=0+1000|B=1+1000|C.alt=2+1000] -../fonts/TRAK.ttf:--font-ptem=24:U+0041,U+0042,U+0043:[A.alt=0@-12,0+976|B=1@-12,0+976|C.alt=2@-12,0+976] -../fonts/TRAK.ttf:--font-ptem=72:U+0041,U+0042,U+0043:[A.alt=0@-50,0+900|B=1@-50,0+900|C.alt=2@-50,0+900] -../fonts/TRAK.ttf:--font-ptem=144:U+0041,U+0042,U+0043:[A.alt=0@-107,0+786|B=1@-107,0+786|C.alt=2@-107,0+786] -../fonts/TRAK.ttf:--font-ptem=144:U+0041,U+0042,U+0043:[A.alt=0@-107,0+786|B=1@-107,0+786|C.alt=2@-107,0+786] +../fonts/TRAK.ttf:--font-ptem=2:U+0041,U+0042,U+0043:[A.alt=0@100,0+1200|B=1@100,0+1200|C.alt=2@100,0+1200] +../fonts/TRAK.ttf:--font-ptem=9:U+0041,U+0042,U+0043:[A.alt=0@30,0+1060|B=1@30,0+1060|C.alt=2@30,0+1060] +../fonts/TRAK.ttf:--font-ptem=24:U+0041,U+0042,U+0043:[A.alt=0@-7,0+986|B=1@-7,0+986|C.alt=2@-7,0+986] +../fonts/TRAK.ttf:--font-ptem=72:U+0041,U+0042,U+0043:[A.alt=0@-35,0+929|B=1@-35,0+929|C.alt=2@-35,0+929] +../fonts/TRAK.ttf:--font-ptem=144:U+0041,U+0042,U+0043:[A.alt=0@-78,0+843|B=1@-78,0+843|C.alt=2@-78,0+843] +../fonts/TRAK.ttf:--font-ptem=144:U+0041,U+0042,U+0043:[A.alt=0@-78,0+843|B=1@-78,0+843|C.alt=2@-78,0+843] ../fonts/TRAK.ttf:--font-ptem=144 --features=-trak:U+0041,U+0042,U+0043:[A.alt=0+1000|B=1+1000|C.alt=2+1000] -../fonts/TRAK.ttf:--font-ptem=144 --features=-trak[1;3]:U+0041,U+0042,U+0043,U+0041,U+0042,U+0043:[A.alt=0@-107,0+786|B=1+1000|C.alt=2+1000|A.alt=3@-107,0+786|B=4@-107,0+786|C.alt=5@-107,0+786] +../fonts/TRAK.ttf:--font-ptem=144 --features=-trak[1;3]:U+0041,U+0042,U+0043,U+0041,U+0042,U+0043:[A.alt=0@-78,0+843|B=1+1000|C.alt=2+1000|A.alt=3@-78,0+843|B=4@-78,0+843|C.alt=5@-78,0+843] diff -Nru harfbuzz-2.5.3/test/shaping/data/in-house/tests/color-fonts.tests harfbuzz-2.6.2/test/shaping/data/in-house/tests/color-fonts.tests --- harfbuzz-2.5.3/test/shaping/data/in-house/tests/color-fonts.tests 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/shaping/data/in-house/tests/color-fonts.tests 2019-10-26 02:02:55.000000000 +0000 @@ -1 +1,2 @@ ../fonts/ee39587d13b2afa5499cc79e45780aa79293bbd4.ttf:--font-funcs=ot --show-extents:U+1F42F:[gid1=0+2963<0,2179,2963,-2789>] +../fonts/fcbaa518d3cce441ed37ae3b1fed6a19e9b54efd.ttf:--font-funcs=ot --show-extents:U+1F600:[gid4=0+2550<0,1898,2555,-2405>] diff -Nru harfbuzz-2.5.3/test/shaping/data/in-house/tests/macos.tests harfbuzz-2.6.2/test/shaping/data/in-house/tests/macos.tests --- harfbuzz-2.5.3/test/shaping/data/in-house/tests/macos.tests 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/shaping/data/in-house/tests/macos.tests 2019-10-26 02:02:55.000000000 +0000 @@ -13,7 +13,7 @@ /System/Library/Fonts/GeezaPro.ttc@f43ee7151c2e9f1dddfbc26cfc148609eb5c5820:--font-funcs ot:U+0631,U+0628:[u0628.beh=1+1415|u0631.reh=0@-202,0+700] /System/Library/Fonts/GeezaPro.ttc@f43ee7151c2e9f1dddfbc26cfc148609eb5c5820:--font-funcs ot:U+0628,U+064F:[u064f.damma=0@250,-250+250|u0628.beh=0@-250,0+1165] /System/Library/Fonts/SFNSDisplay.ttf@92787c30716672737e9059bc367c15d04fbc1ced:--font-funcs ot:U+0054,U+0065,U+0020,U+0041,U+0056,U+0020,U+0054,U+0072,U+0020,U+0056,U+0061,U+0020,U+0072,U+0054,U+0020,U+0065,U+0054,U+0020,U+0054,U+0064:[gid225=0+1105|gid584=1@-105,0+979|gid3=2+490|gid4=3+1227|gid265=4@-65,0+1227|gid3=5+490|gid225=6+1130|gid728=7@-80,0+569|gid3=8+490|gid265=9+1227|gid505=10@-65,0+997|gid3=11+490|gid728=12+609|gid225=13@-40,0+1170|gid3=14+490|gid584=15+1004|gid225=16@-80,0+1130|gid3=17+490|gid225=18+1105|gid576=19@-105,0+1068] -/System/Library/Fonts/SFNSDisplay.ttf@92787c30716672737e9059bc367c15d04fbc1ced:--font-ptem 9 --font-funcs ot:U+0054,U+0065,U+0020,U+0041,U+0056,U+0020,U+0054,U+0072,U+0020,U+0056,U+0061,U+0020,U+0072,U+0054,U+0020,U+0065,U+0054,U+0020,U+0054,U+0064:[gid225=0@46,0+1197|gid584=1@-59,0+1071|gid3=2@46,0+582|gid4=3@46,0+1319|gid265=4@-19,0+1319|gid3=5@46,0+582|gid225=6@46,0+1222|gid728=7@-34,0+661|gid3=8@46,0+582|gid265=9@46,0+1319|gid505=10@-19,0+1089|gid3=11@46,0+582|gid728=12@46,0+701|gid225=13@6,0+1262|gid3=14@46,0+582|gid584=15@46,0+1096|gid225=16@-34,0+1222|gid3=17@46,0+582|gid225=18@46,0+1197|gid576=19@-59,0+1160] +/System/Library/Fonts/SFNSDisplay.ttf@92787c30716672737e9059bc367c15d04fbc1ced:--font-ptem 9 --font-funcs ot:U+0054,U+0065,U+0020,U+0041,U+0056,U+0020,U+0054,U+0072,U+0020,U+0056,U+0061,U+0020,U+0072,U+0054,U+0020,U+0065,U+0054,U+0020,U+0054,U+0064:[gid225=0@65,0+1235|gid584=1@-40,0+1109|gid3=2@65,0+620|gid4=3@65,0+1357|gid265=4+1357|gid3=5@65,0+620|gid225=6@65,0+1260|gid728=7@-15,0+699|gid3=8@65,0+620|gid265=9@65,0+1357|gid505=10+1127|gid3=11@65,0+620|gid728=12@65,0+739|gid225=13@25,0+1300|gid3=14@65,0+620|gid584=15@65,0+1134|gid225=16@-15,0+1260|gid3=17@65,0+620|gid225=18@65,0+1235|gid576=19@-40,0+1198] /System/Library/Fonts/Apple Color Emoji.ttc@d2fe8a134483aa48a43a9d1e4b7204d37a4abdf5:--remove-default-ignorables --font-funcs ot:U+1F468,U+200D,U+1F469,U+200D,U+1F467,U+200D,U+1F466:[u1F46A.MWGB=0+800] /Library/Fonts/Zapfino.ttf@9ee799ffb09516ead6b0cf6f2ca807276e150748:--font-funcs ot:U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+006F:[Z=0+416|a=1@-21,0+264|p_f=2+433|i=4+181|n=5+261|Z=6+416|a=7@-21,0+264|p_f=8+433|i=10+181|n=11+261|Z=12+416|a=13@-21,0+264|p_f=14+433|i=16+181|n=17+261|Z=18+416|a=19@-21,0+264|p_f=20+433|i=22+181|n=23+261|Z=24+416|a=25@-21,0+264|p_f=26+433|i=28+181|n=29+261|Z=30+416|a=31@-21,0+264|p_f=32+433|i=34+181|n=35+261|Z=36+416|a=37@-21,0+264|p_f=38+433|i=40+181|n=41+261|Z=42+416|a=43@-21,0+264|p_f=44+433|i=46+181|n=47+261|Z=48+416|a=49@-21,0+264|p_f=50+433|i=52+181|n=53+261|Z=54+416|a=55@-21,0+264|p_f=56+433|i=58+181|n=59+261|Z=60+416|a=61@-21,0+264|p_f=62+433|i=64+181|n=65+261|Z_a_p_f_i_n_o=66+2333] @@ -32,7 +32,7 @@ /System/Library/Fonts/GeezaPro.ttc@ab26ea45dcaa5e1c5a958e42af10e10d330e7334:--font-funcs ot:U+0631,U+0628:[u0628.beh=1+1415|u0631.reh=0@-202,0+700] /System/Library/Fonts/GeezaPro.ttc@ab26ea45dcaa5e1c5a958e42af10e10d330e7334:--font-funcs ot:U+0628,U+064F:[u064f.damma=0@250,-250+250|u0628.beh=0@-250,0+1165] /System/Library/Fonts/SFNSDisplay.ttf@c8948f464ff822a5f9bbf2e12d0e4e32268815aa:--font-funcs ot:U+0054,U+0065,U+0020,U+0041,U+0056,U+0020,U+0054,U+0072,U+0020,U+0056,U+0061,U+0020,U+0072,U+0054,U+0020,U+0065,U+0054,U+0020,U+0054,U+0064:[gid282=0+1055|gid658=1@-135,0+914|gid3=2+420|gid4=3+1227|gid332=4@-65,0+1227|gid3=5+420|gid282=6+1075|gid813=7@-115,0+516|gid3=8+420|gid332=9+1217|gid572=10@-75,0+953|gid3=11+420|gid813=12+546|gid282=13@-85,0+1105|gid3=14+420|gid658=15+914|gid282=16@-135,0+1055|gid3=17+420|gid282=18+1055|gid649=19@-135,0+999] -/System/Library/Fonts/SFNSDisplay.ttf@c8948f464ff822a5f9bbf2e12d0e4e32268815aa:--font-ptem 9 --font-funcs ot:U+0054,U+0065,U+0020,U+0041,U+0056,U+0020,U+0054,U+0072,U+0020,U+0056,U+0061,U+0020,U+0072,U+0054,U+0020,U+0065,U+0054,U+0020,U+0054,U+0064:[gid282=0@46,0+1147|gid658=1@-89,0+1006|gid3=2@46,0+512|gid4=3@46,0+1319|gid332=4@-19,0+1319|gid3=5@46,0+512|gid282=6@46,0+1167|gid813=7@-69,0+608|gid3=8@46,0+512|gid332=9@46,0+1309|gid572=10@-29,0+1045|gid3=11@46,0+512|gid813=12@46,0+638|gid282=13@-39,0+1197|gid3=14@46,0+512|gid658=15@46,0+1006|gid282=16@-89,0+1147|gid3=17@46,0+512|gid282=18@46,0+1147|gid649=19@-89,0+1091] +/System/Library/Fonts/SFNSDisplay.ttf@c8948f464ff822a5f9bbf2e12d0e4e32268815aa:--font-ptem 9 --font-funcs ot:U+0054,U+0065,U+0020,U+0041,U+0056,U+0020,U+0054,U+0072,U+0020,U+0056,U+0061,U+0020,U+0072,U+0054,U+0020,U+0065,U+0054,U+0020,U+0054,U+0064:[gid282=0@65,0+1185|gid658=1@-70,0+1044|gid3=2@65,0+550|gid4=3@65,0+1357|gid332=4+1357|gid3=5@65,0+550|gid282=6@65,0+1205|gid813=7@-50,0+646|gid3=8@65,0+550|gid332=9@65,0+1347|gid572=10@-10,0+1083|gid3=11@65,0+550|gid813=12@65,0+676|gid282=13@-20,0+1235|gid3=14@65,0+550|gid658=15@65,0+1044|gid282=16@-70,0+1185|gid3=17@65,0+550|gid282=18@65,0+1185|gid649=19@-70,0+1129] /System/Library/Fonts/Apple Color Emoji.ttc@2e09b1f3d42c3821cc6c4ac5b6ce16237ab0d496:--remove-default-ignorables --font-funcs ot:U+1F468,U+200D,U+1F469,U+200D,U+1F467,U+200D,U+1F466:[u1F46A.MWGB=0+800] /Library/Fonts/Zapfino.ttf@99a1e15163c3e9567d5b1019c45e9254dae63b08:--font-funcs ot:U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+006F:[Z=0+416|a=1@-21,0+264|p_f=2+433|i=4+181|n=5+261|Z=6+416|a=7@-21,0+264|p_f=8+433|i=10+181|n=11+261|Z=12+416|a=13@-21,0+264|p_f=14+433|i=16+181|n=17+261|Z=18+416|a=19@-21,0+264|p_f=20+433|i=22+181|n=23+261|Z=24+416|a=25@-21,0+264|p_f=26+433|i=28+181|n=29+261|Z=30+416|a=31@-21,0+264|p_f=32+433|i=34+181|n=35+261|Z=36+416|a=37@-21,0+264|p_f=38+433|i=40+181|n=41+261|Z=42+416|a=43@-21,0+264|p_f=44+433|i=46+181|n=47+261|Z=48+416|a=49@-21,0+264|p_f=50+433|i=52+181|n=53+261|Z=54+416|a=55@-21,0+264|p_f=56+433|i=58+181|n=59+261|Z=60+416|a=61@-21,0+264|p_f=62+433|i=64+181|n=65+261|Z_a_p_f_i_n_o=66+2333] @@ -51,6 +51,6 @@ /System/Library/Fonts/GeezaPro.ttc@ab26ea45dcaa5e1c5a958e42af10e10d330e7334:--font-funcs ot:U+0631,U+0628:[u0628.beh=1+1415|u0631.reh=0@-202,0+700] /System/Library/Fonts/GeezaPro.ttc@ab26ea45dcaa5e1c5a958e42af10e10d330e7334:--font-funcs ot:U+0628,U+064F:[u064f.damma=0@250,-250+250|u0628.beh=0@-250,0+1165] /System/Library/Fonts/SFNSDisplay.ttf@6e9677c443f6583228a63fd147663cfc635924d9:--font-funcs ot:U+0054,U+0065,U+0020,U+0041,U+0056,U+0020,U+0054,U+0072,U+0020,U+0056,U+0061,U+0020,U+0072,U+0054,U+0020,U+0065,U+0054,U+0020,U+0054,U+0064:[gid283=0+1055|gid659=1@-135,0+914|gid3=2+420|gid4=3+1227|gid333=4@-65,0+1227|gid3=5+420|gid283=6+1075|gid815=7@-115,0+516|gid3=8+420|gid333=9+1217|gid573=10@-75,0+953|gid3=11+420|gid815=12+546|gid283=13@-85,0+1105|gid3=14+420|gid659=15+914|gid283=16@-135,0+1055|gid3=17+420|gid283=18+1055|gid650=19@-135,0+999] -/System/Library/Fonts/SFNSDisplay.ttf@6e9677c443f6583228a63fd147663cfc635924d9:--font-ptem 9 --font-funcs ot:U+0054,U+0065,U+0020,U+0041,U+0056,U+0020,U+0054,U+0072,U+0020,U+0056,U+0061,U+0020,U+0072,U+0054,U+0020,U+0065,U+0054,U+0020,U+0054,U+0064:[gid283=0@46,0+1147|gid659=1@-89,0+1006|gid3=2@46,0+512|gid4=3@46,0+1319|gid333=4@-19,0+1319|gid3=5@46,0+512|gid283=6@46,0+1167|gid815=7@-69,0+608|gid3=8@46,0+512|gid333=9@46,0+1309|gid573=10@-29,0+1045|gid3=11@46,0+512|gid815=12@46,0+638|gid283=13@-39,0+1197|gid3=14@46,0+512|gid659=15@46,0+1006|gid283=16@-89,0+1147|gid3=17@46,0+512|gid283=18@46,0+1147|gid650=19@-89,0+1091] +/System/Library/Fonts/SFNSDisplay.ttf@6e9677c443f6583228a63fd147663cfc635924d9:--font-ptem 9 --font-funcs ot:U+0054,U+0065,U+0020,U+0041,U+0056,U+0020,U+0054,U+0072,U+0020,U+0056,U+0061,U+0020,U+0072,U+0054,U+0020,U+0065,U+0054,U+0020,U+0054,U+0064:[gid283=0@65,0+1185|gid659=1@-70,0+1044|gid3=2@65,0+550|gid4=3@65,0+1357|gid333=4+1357|gid3=5@65,0+550|gid283=6@65,0+1205|gid815=7@-50,0+646|gid3=8@65,0+550|gid333=9@65,0+1347|gid573=10@-10,0+1083|gid3=11@65,0+550|gid815=12@65,0+676|gid283=13@-20,0+1235|gid3=14@65,0+550|gid659=15@65,0+1044|gid283=16@-70,0+1185|gid3=17@65,0+550|gid283=18@65,0+1185|gid650=19@-70,0+1129] /System/Library/Fonts/Apple Color Emoji.ttc@60f77161021b1b87e99c3690e1a9b56341cf8792:--remove-default-ignorables --font-funcs ot:U+1F468,U+200D,U+1F469,U+200D,U+1F467,U+200D,U+1F466:[u1F46A.MWGB=0+800] /Library/Fonts/Zapfino.ttf@99a1e15163c3e9567d5b1019c45e9254dae63b08:--font-funcs ot:U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+005A,U+0061,U+0070,U+0066,U+0069,U+006E,U+006F:[Z=0+416|a=1@-21,0+264|p_f=2+433|i=4+181|n=5+261|Z=6+416|a=7@-21,0+264|p_f=8+433|i=10+181|n=11+261|Z=12+416|a=13@-21,0+264|p_f=14+433|i=16+181|n=17+261|Z=18+416|a=19@-21,0+264|p_f=20+433|i=22+181|n=23+261|Z=24+416|a=25@-21,0+264|p_f=26+433|i=28+181|n=29+261|Z=30+416|a=31@-21,0+264|p_f=32+433|i=34+181|n=35+261|Z=36+416|a=37@-21,0+264|p_f=38+433|i=40+181|n=41+261|Z=42+416|a=43@-21,0+264|p_f=44+433|i=46+181|n=47+261|Z=48+416|a=49@-21,0+264|p_f=50+433|i=52+181|n=53+261|Z=54+416|a=55@-21,0+264|p_f=56+433|i=58+181|n=59+261|Z=60+416|a=61@-21,0+264|p_f=62+433|i=64+181|n=65+261|Z_a_p_f_i_n_o=66+2333] diff -Nru harfbuzz-2.5.3/test/shaping/data/in-house/tests/positioning-features.tests harfbuzz-2.6.2/test/shaping/data/in-house/tests/positioning-features.tests --- harfbuzz-2.5.3/test/shaping/data/in-house/tests/positioning-features.tests 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/test/shaping/data/in-house/tests/positioning-features.tests 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,3 @@ +../fonts/53a91c20e33a596f2be17fb68b382d6b7eb85d5c.ttf::U+0041,U+0056:[A=0+625|V=1+675] +../fonts/f79eb71df4e4c9c273b67b89a06e5ff9e3c1f834.ttf::U+006D,U+0315:[m=0+945|uni0315=0@32,-178+0] +../fonts/ea3f63620511b2097200d23774ffef197e829e69.ttf::U+0079,U+0325:[y=0+565|uni0325=0@-422,-240+0] diff -Nru harfbuzz-2.5.3/test/shaping/data/Makefile.in harfbuzz-2.6.2/test/shaping/data/Makefile.in --- harfbuzz-2.5.3/test/shaping/data/Makefile.in 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/shaping/data/Makefile.in 2019-10-26 02:02:55.000000000 +0000 @@ -236,6 +236,8 @@ FREETYPE_DEPS = @FREETYPE_DEPS@ FREETYPE_LIBS = @FREETYPE_LIBS@ GCOV = @GCOV@ +GDI_CFLAGS = @GDI_CFLAGS@ +GDI_LIBS = @GDI_LIBS@ GENHTML = @GENHTML@ GIT = @GIT@ GLIB_CFLAGS = @GLIB_CFLAGS@ diff -Nru harfbuzz-2.5.3/test/shaping/data/text-rendering-tests/Makefile.in harfbuzz-2.6.2/test/shaping/data/text-rendering-tests/Makefile.in --- harfbuzz-2.5.3/test/shaping/data/text-rendering-tests/Makefile.in 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/shaping/data/text-rendering-tests/Makefile.in 2019-10-26 02:02:55.000000000 +0000 @@ -404,6 +404,8 @@ FREETYPE_DEPS = @FREETYPE_DEPS@ FREETYPE_LIBS = @FREETYPE_LIBS@ GCOV = @GCOV@ +GDI_CFLAGS = @GDI_CFLAGS@ +GDI_LIBS = @GDI_LIBS@ GENHTML = @GENHTML@ GIT = @GIT@ GLIB_CFLAGS = @GLIB_CFLAGS@ diff -Nru harfbuzz-2.5.3/test/shaping/hb_test_tools.py harfbuzz-2.6.2/test/shaping/hb_test_tools.py --- harfbuzz-2.5.3/test/shaping/hb_test_tools.py 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/shaping/hb_test_tools.py 2019-10-26 02:02:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function, division, absolute_import diff -Nru harfbuzz-2.5.3/test/shaping/Makefile.in harfbuzz-2.6.2/test/shaping/Makefile.in --- harfbuzz-2.5.3/test/shaping/Makefile.in 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/shaping/Makefile.in 2019-10-26 02:02:55.000000000 +0000 @@ -236,6 +236,8 @@ FREETYPE_DEPS = @FREETYPE_DEPS@ FREETYPE_LIBS = @FREETYPE_LIBS@ GCOV = @GCOV@ +GDI_CFLAGS = @GDI_CFLAGS@ +GDI_LIBS = @GDI_LIBS@ GENHTML = @GENHTML@ GIT = @GIT@ GLIB_CFLAGS = @GLIB_CFLAGS@ diff -Nru harfbuzz-2.5.3/test/shaping/run-tests.py harfbuzz-2.6.2/test/shaping/run-tests.py --- harfbuzz-2.5.3/test/shaping/run-tests.py 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/shaping/run-tests.py 2019-10-26 02:02:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function, division, absolute_import Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/basics/Comfortaa-Regular-new.default.retain-all-codepoint.ttf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/basics/Comfortaa-Regular-new.default.retain-all-codepoint.ttf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/basics/Comfortaa-Regular-new.drop-hints.retain-all-codepoint.ttf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/basics/Comfortaa-Regular-new.drop-hints.retain-all-codepoint.ttf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/basics/Comfortaa-Regular-new.drop-hints-retain-gids.retain-all-codepoint.ttf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/basics/Comfortaa-Regular-new.drop-hints-retain-gids.retain-all-codepoint.ttf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/basics/Comfortaa-Regular-new.name-ids.retain-all-codepoint.ttf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/basics/Comfortaa-Regular-new.name-ids.retain-all-codepoint.ttf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/basics/Comfortaa-Regular-new.retain-gids.retain-all-codepoint.ttf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/basics/Comfortaa-Regular-new.retain-gids.retain-all-codepoint.ttf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/basics/Roboto-Regular.abc.default.retain-all-codepoint.ttf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/basics/Roboto-Regular.abc.default.retain-all-codepoint.ttf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/basics/Roboto-Regular.abc.drop-hints.retain-all-codepoint.ttf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/basics/Roboto-Regular.abc.drop-hints.retain-all-codepoint.ttf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/basics/Roboto-Regular.abc.drop-hints-retain-gids.retain-all-codepoint.ttf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/basics/Roboto-Regular.abc.drop-hints-retain-gids.retain-all-codepoint.ttf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/basics/Roboto-Regular.abc.name-ids.retain-all-codepoint.ttf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/basics/Roboto-Regular.abc.name-ids.retain-all-codepoint.ttf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/basics/Roboto-Regular.abc.retain-gids.retain-all-codepoint.ttf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/basics/Roboto-Regular.abc.retain-gids.retain-all-codepoint.ttf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.default.4E00,4E02,4E03.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.default.4E00,4E02,4E03.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.default.4E00,4E03.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.default.4E00,4E03.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.default.4E00,4E05,4E07.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.default.4E00,4E05,4E07.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.default.4E02,4E03,4E08.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.default.4E02,4E03,4E08.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.default.4E02.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.default.4E02.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.default.4E03.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.default.4E03.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.default.4E05,4E07,4E08,4E09.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.default.4E05,4E07,4E08,4E09.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.default.4E08,4E09.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.default.4E08,4E09.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.default.4E08.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.default.4E08.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.default.retain-all-codepoint.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.default.retain-all-codepoint.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.drop-hints.4E00,4E02,4E03.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.drop-hints.4E00,4E02,4E03.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.drop-hints.4E00,4E03.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.drop-hints.4E00,4E03.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.drop-hints.4E00,4E05,4E07.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.drop-hints.4E00,4E05,4E07.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.drop-hints.4E02,4E03,4E08.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.drop-hints.4E02,4E03,4E08.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.drop-hints.4E02.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.drop-hints.4E02.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.drop-hints.4E03.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.drop-hints.4E03.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.drop-hints.4E05,4E07,4E08,4E09.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.drop-hints.4E05,4E07,4E08,4E09.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.drop-hints.4E08,4E09.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.drop-hints.4E08,4E09.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.drop-hints.4E08.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.drop-hints.4E08.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.drop-hints.retain-all-codepoint.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.drop-hints.retain-all-codepoint.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.drop-hints-retain-gids.4E00,4E02,4E03.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.drop-hints-retain-gids.4E00,4E02,4E03.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.drop-hints-retain-gids.4E00,4E03.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.drop-hints-retain-gids.4E00,4E03.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.drop-hints-retain-gids.4E00,4E05,4E07.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.drop-hints-retain-gids.4E00,4E05,4E07.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.drop-hints-retain-gids.4E02,4E03,4E08.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.drop-hints-retain-gids.4E02,4E03,4E08.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.drop-hints-retain-gids.4E02.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.drop-hints-retain-gids.4E02.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.drop-hints-retain-gids.4E03.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.drop-hints-retain-gids.4E03.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.drop-hints-retain-gids.4E05,4E07,4E08,4E09.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.drop-hints-retain-gids.4E05,4E07,4E08,4E09.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.drop-hints-retain-gids.4E08,4E09.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.drop-hints-retain-gids.4E08,4E09.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.drop-hints-retain-gids.4E08.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.drop-hints-retain-gids.4E08.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.drop-hints-retain-gids.retain-all-codepoint.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.drop-hints-retain-gids.retain-all-codepoint.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.name-ids.4E00,4E02,4E03.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.name-ids.4E00,4E02,4E03.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.name-ids.4E00,4E03.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.name-ids.4E00,4E03.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.name-ids.4E00,4E05,4E07.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.name-ids.4E00,4E05,4E07.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.name-ids.4E02,4E03,4E08.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.name-ids.4E02,4E03,4E08.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.name-ids.4E02.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.name-ids.4E02.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.name-ids.4E03.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.name-ids.4E03.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.name-ids.4E05,4E07,4E08,4E09.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.name-ids.4E05,4E07,4E08,4E09.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.name-ids.4E08,4E09.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.name-ids.4E08,4E09.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.name-ids.4E08.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.name-ids.4E08.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.name-ids.retain-all-codepoint.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.name-ids.retain-all-codepoint.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.retain-gids.4E00,4E02,4E03.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.retain-gids.4E00,4E02,4E03.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.retain-gids.4E00,4E03.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.retain-gids.4E00,4E03.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.retain-gids.4E00,4E05,4E07.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.retain-gids.4E00,4E05,4E07.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.retain-gids.4E02,4E03,4E08.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.retain-gids.4E02,4E03,4E08.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.retain-gids.4E02.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.retain-gids.4E02.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.retain-gids.4E03.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.retain-gids.4E03.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.retain-gids.4E05,4E07,4E08,4E09.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.retain-gids.4E05,4E07,4E08,4E09.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.retain-gids.4E08,4E09.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.retain-gids.4E08,4E09.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.retain-gids.4E08.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.retain-gids.4E08.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/cmap14/cmap14_font1.retain-gids.retain-all-codepoint.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/cmap14/cmap14_font1.retain-gids.retain-all-codepoint.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/layout.gpos/gpos1_2_font.keep-layout-retain-gids.41,43.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/layout.gpos/gpos1_2_font.keep-layout-retain-gids.41,43.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/layout.gpos/gpos1_2_font.keep-layout-retain-gids.41,46.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/layout.gpos/gpos1_2_font.keep-layout-retain-gids.41,46.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/layout.gpos/gpos1_2_font.keep-layout-retain-gids.43,46.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/layout.gpos/gpos1_2_font.keep-layout-retain-gids.43,46.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/layout.gpos/gpos1_2_font.keep-layout-retain-gids.retain-all-codepoint.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/layout.gpos/gpos1_2_font.keep-layout-retain-gids.retain-all-codepoint.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/layout.gpos3/gpos3_font3.keep-layout.28,29.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/layout.gpos3/gpos3_font3.keep-layout.28,29.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/layout.gpos3/gpos3_font3.keep-layout.28,2B.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/layout.gpos3/gpos3_font3.keep-layout.28,2B.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/layout.gpos3/gpos3_font3.keep-layout.29,2B.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/layout.gpos3/gpos3_font3.keep-layout.29,2B.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/layout.gpos3/gpos3_font3.keep-layout.retain-all-codepoint.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/layout.gpos3/gpos3_font3.keep-layout.retain-all-codepoint.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/layout.gpos3/gpos3_font3.keep-layout-retain-gids.28,29.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/layout.gpos3/gpos3_font3.keep-layout-retain-gids.28,29.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/layout.gpos3/gpos3_font3.keep-layout-retain-gids.28,2B.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/layout.gpos3/gpos3_font3.keep-layout-retain-gids.28,2B.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/layout.gpos3/gpos3_font3.keep-layout-retain-gids.29,2B.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/layout.gpos3/gpos3_font3.keep-layout-retain-gids.29,2B.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/expected/layout.gpos3/gpos3_font3.keep-layout-retain-gids.retain-all-codepoint.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/expected/layout.gpos3/gpos3_font3.keep-layout-retain-gids.retain-all-codepoint.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/fonts/cmap14_font1.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/fonts/cmap14_font1.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/fonts/gpos1_2_font.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/fonts/gpos1_2_font.otf differ Binary files /tmp/tmpibuUwd/oSmv7MxwiK/harfbuzz-2.5.3/test/subset/data/fonts/gpos3_font3.otf and /tmp/tmpibuUwd/hY66y660Oh/harfbuzz-2.6.2/test/subset/data/fonts/gpos3_font3.otf differ diff -Nru harfbuzz-2.5.3/test/subset/data/Makefile.am harfbuzz-2.6.2/test/subset/data/Makefile.am --- harfbuzz-2.5.3/test/subset/data/Makefile.am 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/subset/data/Makefile.am 2019-10-26 02:02:55.000000000 +0000 @@ -13,6 +13,9 @@ expected/japanese \ expected/cff-japanese \ expected/layout \ + expected/layout.gpos \ + expected/layout.gpos3 \ + expected/cmap14 \ fonts \ profiles \ $(NULL) diff -Nru harfbuzz-2.5.3/test/subset/data/Makefile.in harfbuzz-2.6.2/test/subset/data/Makefile.in --- harfbuzz-2.5.3/test/subset/data/Makefile.in 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/subset/data/Makefile.in 2019-10-26 02:02:55.000000000 +0000 @@ -91,7 +91,9 @@ host_triplet = @host@ TESTS = tests/basics.tests tests/full-font.tests \ tests/cff-full-font.tests tests/japanese.tests \ - tests/cff-japanese.tests tests/layout.tests $(am__EXEEXT_1) + tests/cff-japanese.tests tests/layout.tests \ + tests/layout.gpos.tests tests/layout.gpos3.tests \ + tests/cmap14.tests $(am__EXEEXT_1) XFAIL_TESTS = $(am__EXEEXT_1) subdir = test/subset/data ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -442,6 +444,8 @@ FREETYPE_DEPS = @FREETYPE_DEPS@ FREETYPE_LIBS = @FREETYPE_LIBS@ GCOV = @GCOV@ +GDI_CFLAGS = @GDI_CFLAGS@ +GDI_LIBS = @GDI_LIBS@ GENHTML = @GENHTML@ GIT = @GIT@ GLIB_CFLAGS = @GLIB_CFLAGS@ @@ -583,7 +587,8 @@ NULL = EXTRA_DIST = $(TESTS) expected/basics expected/full-font \ expected/cff-full-font expected/japanese expected/cff-japanese \ - expected/layout fonts profiles $(NULL) + expected/layout expected/layout.gpos expected/layout.gpos3 \ + expected/cmap14 fonts profiles $(NULL) CLEANFILES = SUBDIRS = TEST_EXTENSIONS = .tests diff -Nru harfbuzz-2.5.3/test/subset/data/Makefile.sources harfbuzz-2.6.2/test/subset/data/Makefile.sources --- harfbuzz-2.5.3/test/subset/data/Makefile.sources 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/subset/data/Makefile.sources 2019-10-26 02:02:55.000000000 +0000 @@ -5,6 +5,9 @@ tests/japanese.tests \ tests/cff-japanese.tests \ tests/layout.tests \ + tests/layout.gpos.tests \ + tests/layout.gpos3.tests \ + tests/cmap14.tests \ $(NULL) XFAIL_TESTS = \ diff -Nru harfbuzz-2.5.3/test/subset/data/tests/basics.tests harfbuzz-2.6.2/test/subset/data/tests/basics.tests --- harfbuzz-2.5.3/test/subset/data/tests/basics.tests 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/subset/data/tests/basics.tests 2019-10-26 02:02:55.000000000 +0000 @@ -15,3 +15,4 @@ c ac a +* diff -Nru harfbuzz-2.5.3/test/subset/data/tests/cmap14.tests harfbuzz-2.6.2/test/subset/data/tests/cmap14.tests --- harfbuzz-2.5.3/test/subset/data/tests/cmap14.tests 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/test/subset/data/tests/cmap14.tests 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,21 @@ +FONTS: +cmap14_font1.otf + +PROFILES: +default.txt +drop-hints.txt +drop-hints-retain-gids.txt +retain-gids.txt +name-ids.txt + +SUBSETS: +一丂七 +丂 +七 +一七 +一丅万 +丅万丈三 +丈 +丈三 +丂七丈 +* diff -Nru harfbuzz-2.5.3/test/subset/data/tests/layout.gpos3.tests harfbuzz-2.6.2/test/subset/data/tests/layout.gpos3.tests --- harfbuzz-2.5.3/test/subset/data/tests/layout.gpos3.tests 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/test/subset/data/tests/layout.gpos3.tests 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,12 @@ +FONTS: +gpos3_font3.otf + +PROFILES: +keep-layout.txt +keep-layout-retain-gids.txt + +SUBSETS: +() +(+ +)+ +* diff -Nru harfbuzz-2.5.3/test/subset/data/tests/layout.gpos.tests harfbuzz-2.6.2/test/subset/data/tests/layout.gpos.tests --- harfbuzz-2.5.3/test/subset/data/tests/layout.gpos.tests 1970-01-01 00:00:00.000000000 +0000 +++ harfbuzz-2.6.2/test/subset/data/tests/layout.gpos.tests 2019-10-26 02:02:55.000000000 +0000 @@ -0,0 +1,11 @@ +FONTS: +gpos1_2_font.otf + +PROFILES: +keep-layout-retain-gids.txt + +SUBSETS: +AC +CF +AF +* diff -Nru harfbuzz-2.5.3/test/subset/Makefile.am harfbuzz-2.6.2/test/subset/Makefile.am --- harfbuzz-2.5.3/test/subset/Makefile.am 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/subset/Makefile.am 2019-10-26 02:02:55.000000000 +0000 @@ -6,7 +6,8 @@ SUBDIRS = data # Convenience targets: -lib: +lib: libs # Always build subsetter lib in this subdir +libs: @$(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir)/src libs EXTRA_DIST += \ diff -Nru harfbuzz-2.5.3/test/subset/Makefile.in harfbuzz-2.6.2/test/subset/Makefile.in --- harfbuzz-2.5.3/test/subset/Makefile.in 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/subset/Makefile.in 2019-10-26 02:02:55.000000000 +0000 @@ -236,6 +236,8 @@ FREETYPE_DEPS = @FREETYPE_DEPS@ FREETYPE_LIBS = @FREETYPE_LIBS@ GCOV = @GCOV@ +GDI_CFLAGS = @GDI_CFLAGS@ +GDI_LIBS = @GDI_LIBS@ GENHTML = @GENHTML@ GIT = @GIT@ GLIB_CFLAGS = @GLIB_CFLAGS@ @@ -695,7 +697,8 @@ # Convenience targets: -lib: +lib: libs # Always build subsetter lib in this subdir +libs: @$(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir)/src libs -include $(top_srcdir)/git.mk diff -Nru harfbuzz-2.5.3/test/subset/run-tests.py harfbuzz-2.6.2/test/subset/run-tests.py --- harfbuzz-2.5.3/test/subset/run-tests.py 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/subset/run-tests.py 2019-10-26 02:02:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Runs a subsetting test suite. Compares the results of subsetting via harfbuzz # to subsetting via fonttools. diff -Nru harfbuzz-2.5.3/test/subset/subset_test_suite.py harfbuzz-2.6.2/test/subset/subset_test_suite.py --- harfbuzz-2.5.3/test/subset/subset_test_suite.py 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/test/subset/subset_test_suite.py 2019-10-26 02:02:55.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import io import os @@ -12,7 +12,10 @@ self.subset = subset def unicodes(self): - return ",".join("%X" % ord(c) for (i, c) in enumerate(self.subset)) + if self.subset == '*': + return self.subset[0] + else: + return ",".join("%X" % ord(c) for (i, c) in enumerate(self.subset)) def get_profile_flags(self): with io.open(self.profile_path, mode="r", encoding="utf-8") as f: @@ -23,7 +26,12 @@ font_base_name_parts = os.path.splitext(font_base_name) profile_name = os.path.splitext(os.path.basename(self.profile_path))[0] - return "%s.%s.%s%s" % (font_base_name_parts[0], + if self.unicodes() == "*": + return "%s.%s.retain-all-codepoint%s" % (font_base_name_parts[0], + profile_name, + font_base_name_parts[1]) + else: + return "%s.%s.%s%s" % (font_base_name_parts[0], profile_name, self.unicodes(), font_base_name_parts[1]) @@ -39,9 +47,9 @@ def __init__(self, test_path, definition): self.test_path = test_path - self.fonts = set() - self.profiles = set() - self.subsets = set() + self.fonts = [] + self.profiles = [] + self.subsets = [] self._parse(definition) def get_output_directory(self): @@ -87,6 +95,6 @@ if line in destinations: current_destination = destinations[line] elif current_destination is not None: - current_destination.add(line) + current_destination.append(line) else: raise Exception("Failed to parse test suite file.") diff -Nru harfbuzz-2.5.3/util/ansi-print.cc harfbuzz-2.6.2/util/ansi-print.cc --- harfbuzz-2.5.3/util/ansi-print.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/util/ansi-print.cc 2019-10-26 02:02:55.000000000 +0000 @@ -133,7 +133,7 @@ for (unsigned int col = 0; col < w; col++) *q++ = *p++; else { - unsigned int limit = width - x; + unsigned int limit = width - x; for (unsigned int col = 0; col < limit; col++) *q++ = *p++; p--; @@ -171,17 +171,17 @@ int freq[8] = {0}; for (unsigned int y = 0; y < height; y++) for (unsigned int x = 0; x < width; x++) { - color_t c = image (x, y); - freq[c.to_ansi ()]++; + color_t c = image (x, y); + freq[c.to_ansi ()]++; } bg = 0; for (unsigned int i = 1; i < 8; i++) if (freq[bg] < freq[i]) - bg = i; + bg = i; fg = 0; for (unsigned int i = 1; i < 8; i++) if (i != bg && freq[fg] < freq[i]) - fg = i; + fg = i; if (fg == bg || freq[fg] == 0) { fg = bg; unicolor = true; @@ -202,7 +202,7 @@ int dd = diff.dot (diff); for (unsigned int y = 0; y < height; y++) for (unsigned int x = 0; x < width; x++) { - int d = diff.dot (image (x, y).diff (bgc)); + int d = diff.dot (image (x, y).diff (bgc)); (*this)(x, y) = d < 0 ? 0 : d > dd ? 255 : lround (d * 255. / dd); } } @@ -287,13 +287,13 @@ unsigned int s; s = row_sum[i] + total_i - row_sum_i[i]; if (s < best_s) { - best_s = s; + best_s = s; best_i = i; best_inv = false; } s = row_sum_i[i] + total - row_sum[i]; if (s < best_s) { - best_s = s; + best_s = s; best_i = i; best_inv = true; } @@ -319,13 +319,13 @@ unsigned int s; s = col_sum[i] + total_i - col_sum_i[i]; if (s < best_s) { - best_s = s; + best_s = s; best_i = i; best_inv = true; } s = col_sum_i[i] + total - col_sum[i]; if (s < best_s) { - best_s = s; + best_s = s; best_i = i; best_inv = false; } @@ -396,15 +396,15 @@ image.copy_sub_image (cell, col * CELL_W, row * CELL_H, CELL_W, CELL_H); bi.set (cell); if (bi.unicolor) { - if (last_bg != bi.bg) { + if (last_bg != bi.bg) { printf ("%c[%dm", ESC_E, 40 + bi.bg); last_bg = bi.bg; } printf (" "); } else { - /* Figure out the closest character to the biimage */ + /* Figure out the closest character to the biimage */ bool inverse = false; - const char *c = block_best (bi, &inverse); + const char *c = block_best (bi, &inverse); if (inverse) { if (last_bg != bi.fg || last_fg != bi.bg) { printf ("%c[%d;%dm", ESC_E, 30 + bi.bg, 40 + bi.fg); diff -Nru harfbuzz-2.5.3/util/hb-shape.cc harfbuzz-2.6.2/util/hb-shape.cc --- harfbuzz-2.5.3/util/hb-shape.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/util/hb-shape.cc 2019-10-26 02:02:55.000000000 +0000 @@ -181,7 +181,7 @@ fflush (stdout); if (ret) - break; + break; } return ret; } diff -Nru harfbuzz-2.5.3/util/hb-subset.cc harfbuzz-2.6.2/util/hb-subset.cc --- harfbuzz-2.5.3/util/hb-subset.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/util/hb-subset.cc 2019-10-26 02:02:55.000000000 +0000 @@ -40,19 +40,26 @@ : failed (false), options (parser), subset_options (parser), font (nullptr), input (nullptr) {} void init (hb_buffer_t *buffer_, - const font_options_t *font_opts) + const font_options_t *font_opts) { font = hb_font_reference (font_opts->get_font ()); input = hb_subset_input_reference (subset_options.input); } void consume_line (const char *text, - unsigned int text_len, - const char *text_before, - const char *text_after) + unsigned int text_len, + const char *text_before, + const char *text_after) { // TODO(Q1) does this only get called with at least 1 codepoint? hb_set_t *codepoints = hb_subset_input_unicode_set (input); + if (0 == strcmp (text, "*")) + { + hb_face_t *face = hb_font_get_face (font); + hb_face_collect_unicodes (face, codepoints); + return; + } + gchar *c = (gchar *)text; do { gunichar cp = g_utf8_get_char(c); @@ -81,7 +88,7 @@ } if ((unsigned int) bytes_written != data_length) { fprintf(stderr, "Expected %u bytes written, got %d\n", data_length, - bytes_written); + bytes_written); return false; } return true; diff -Nru harfbuzz-2.5.3/util/helper-cairo-ansi.cc harfbuzz-2.6.2/util/helper-cairo-ansi.cc --- harfbuzz-2.5.3/util/helper-cairo-ansi.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/util/helper-cairo-ansi.cc 2019-10-26 02:02:55.000000000 +0000 @@ -71,7 +71,7 @@ unsigned int i; for (i = 0; i < width; i++) if (data[i] != bg_color) - break; + break; if (i < width) break; data += stride / 4; @@ -86,7 +86,7 @@ unsigned int i; for (i = 0; i < width; i++) if (row[i] != bg_color) - break; + break; if (i < width) break; height--; diff -Nru harfbuzz-2.5.3/util/helper-cairo.cc harfbuzz-2.6.2/util/helper-cairo.cc --- harfbuzz-2.5.3/util/helper-cairo.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/util/helper-cairo.cc 2019-10-26 02:02:55.000000000 +0000 @@ -97,7 +97,7 @@ if (FT_New_Memory_Face (ft_library, (const FT_Byte *) blob_data, - blob_length, + blob_length, font_opts->face_index, &ft_face)) fail (false, "FT_New_Memory_Face fail"); diff -Nru harfbuzz-2.5.3/util/Makefile.in harfbuzz-2.6.2/util/Makefile.in --- harfbuzz-2.5.3/util/Makefile.in 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/util/Makefile.in 2019-10-26 02:02:55.000000000 +0000 @@ -305,6 +305,8 @@ FREETYPE_DEPS = @FREETYPE_DEPS@ FREETYPE_LIBS = @FREETYPE_LIBS@ GCOV = @GCOV@ +GDI_CFLAGS = @GDI_CFLAGS@ +GDI_LIBS = @GDI_LIBS@ GENHTML = @GENHTML@ GIT = @GIT@ GLIB_CFLAGS = @GLIB_CFLAGS@ diff -Nru harfbuzz-2.5.3/util/options.cc harfbuzz-2.6.2/util/options.cc --- harfbuzz-2.5.3/util/options.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/util/options.cc 2019-10-26 02:02:55.000000000 +0000 @@ -196,8 +196,8 @@ bool found = false; for (const char **hb_shaper = hb_shape_list_shapers (); *hb_shaper; hb_shaper++) { if (strcmp (*shaper, *hb_shaper) == 0) { - found = true; - break; + found = true; + break; } } if (!found) { @@ -228,9 +228,9 @@ static gboolean parse_features (const char *name G_GNUC_UNUSED, - const char *arg, - gpointer data, - GError **error G_GNUC_UNUSED) + const char *arg, + gpointer data, + GError **error G_GNUC_UNUSED) { shape_options_t *shape_opts = (shape_options_t *) data; char *s = (char *) arg; @@ -271,9 +271,9 @@ static gboolean parse_variations (const char *name G_GNUC_UNUSED, - const char *arg, - gpointer data, - GError **error G_GNUC_UNUSED) + const char *arg, + gpointer data, + GError **error G_GNUC_UNUSED) { font_options_t *font_opts = (font_options_t *) data; char *s = (char *) arg; @@ -335,9 +335,9 @@ static gboolean parse_unicodes (const char *name G_GNUC_UNUSED, - const char *arg, - gpointer data, - GError **error G_GNUC_UNUSED) + const char *arg, + gpointer data, + GError **error G_GNUC_UNUSED) { text_options_t *text_opts = (text_options_t *) data; @@ -349,28 +349,37 @@ } GString *gs = g_string_new (nullptr); - char *s = (char *) arg; - char *p; - - while (s && *s) + if (0 == strcmp (arg, "*")) { - while (*s && strchr (DELIMITERS, *s)) - s++; - if (!*s) - break; + g_string_append_c (gs, '*'); + } + else + { + + char *s = (char *) arg; + char *p; - errno = 0; - hb_codepoint_t u = strtoul (s, &p, 16); - if (errno || s == p) + while (s && *s) { - g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE, - "Failed parsing Unicode values at: '%s'", s); - return false; - } + while (*s && strchr (DELIMITERS, *s)) + s++; + if (!*s) + break; - g_string_append_unichar (gs, u); + errno = 0; + hb_codepoint_t u = strtoul (s, &p, 16); + if (errno || s == p) + { + g_string_free (gs, TRUE); + g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE, + "Failed parsing Unicode values at: '%s'", s); + return false; + } - s = p; + g_string_append_unichar (gs, u); + + s = p; + } } text_opts->text_len = gs->len; @@ -707,7 +716,7 @@ GString *s = g_string_new (nullptr); for (unsigned int i = 0; i < ARRAY_LENGTH (supported_font_funcs); i++) { - if (i) + if (i) g_string_append_c (s, '/'); g_string_append (s, supported_font_funcs[i].name); } @@ -868,9 +877,9 @@ parser->add_group (entries, "output-syntax", "Output syntax:\n" - " text: [=@,+,|...]\n" - " json: [{\"g\": , \"ax\": , \"ay\": , \"dx\": , \"dy\": , \"cl\": }, ...]\n" - "\nOutput syntax options:", + " text: [=@,+,|...]\n" + " json: [{\"g\": , \"ax\": , \"ay\": , \"dx\": , \"dy\": , \"cl\": }, ...]\n" + "\nOutput syntax options:", "Options for the syntax of the output", this); } diff -Nru harfbuzz-2.5.3/util/options.hh harfbuzz-2.6.2/util/options.hh --- harfbuzz-2.5.3/util/options.hh 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/util/options.hh 2019-10-26 02:02:55.000000000 +0000 @@ -242,7 +242,7 @@ if (!hb_shape_full (font, buffer, features, num_features, shapers)) { if (error) - *error = "all shapers failed."; + *error = "all shapers failed."; goto fail; } @@ -341,7 +341,7 @@ /* Shape segment corresponding to glyphs start..end. */ if (end == num_glyphs) { - if (forward) + if (forward) text_end = num_chars; else text_start = 0; @@ -372,9 +372,9 @@ /* TODO: Add pre/post context text. */ hb_buffer_flags_t flags = hb_buffer_get_flags (fragment); if (0 < text_start) - flags = (hb_buffer_flags_t) (flags & ~HB_BUFFER_FLAG_BOT); + flags = (hb_buffer_flags_t) (flags & ~HB_BUFFER_FLAG_BOT); if (text_end < num_chars) - flags = (hb_buffer_flags_t) (flags & ~HB_BUFFER_FLAG_EOT); + flags = (hb_buffer_flags_t) (flags & ~HB_BUFFER_FLAG_EOT); hb_buffer_set_flags (fragment, flags); hb_buffer_append (fragment, text_buffer, text_start, text_end); diff -Nru harfbuzz-2.5.3/util/options-subset.cc harfbuzz-2.6.2/util/options-subset.cc --- harfbuzz-2.5.3/util/options-subset.cc 2019-07-21 00:38:47.000000000 +0000 +++ harfbuzz-2.6.2/util/options-subset.cc 2019-10-26 02:02:55.000000000 +0000 @@ -30,9 +30,9 @@ static gboolean parse_nameids (const char *name, - const char *arg, - gpointer data, - GError **error G_GNUC_UNUSED) + const char *arg, + gpointer data, + GError **error G_GNUC_UNUSED) { subset_options_t *subset_opts = (subset_options_t *) data; hb_set_t *name_ids = subset_opts->input->name_ids; @@ -46,7 +46,7 @@ { if (last_name_char == '-') hb_set_del_range (name_ids, 0, 0x7FFF); - else + else hb_set_add_range (name_ids, 0, 0x7FFF); return true; } @@ -67,7 +67,7 @@ { hb_set_destroy (name_ids); g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE, - "Failed parsing nameID values at: '%s'", s); + "Failed parsing nameID values at: '%s'", s); return false; } @@ -86,9 +86,9 @@ static gboolean parse_drop_tables (const char *name, - const char *arg, - gpointer data, - GError **error G_GNUC_UNUSED) + const char *arg, + gpointer data, + GError **error G_GNUC_UNUSED) { subset_options_t *subset_opts = (subset_options_t *) data; hb_set_t *drop_tables = subset_opts->input->drop_tables; @@ -104,7 +104,7 @@ if (strlen (s) > 4) // Table tags are at most 4 bytes. { g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE, - "Failed parsing table tag values at: '%s'", s); + "Failed parsing table tag values at: '%s'", s); return false; } @@ -137,8 +137,8 @@ {nullptr} }; parser->add_group (entries, - "subset", - "Subset options:", - "Options subsetting", - this); + "subset", + "Subset options:", + "Options subsetting", + this); }