diff options
27 files changed, 451 insertions, 96 deletions
diff --git a/Build/source/libs/README b/Build/source/libs/README index 8ae77021eaa..8b6f9db499a 100644 --- a/Build/source/libs/README +++ b/Build/source/libs/README @@ -25,8 +25,8 @@ graphite2 1.3.14 - checked 10apr20 http://sourceforge.net/projects/silgraphite/files/graphite2/ (requires C++11) -harfbuzz 8.0.0 - checked 09jul23 - https://github.com/harfbuzz/harfbuzz/releases/tag/8.0.0 +harfbuzz 8.0.1 - checked 12jul23 + https://github.com/harfbuzz/harfbuzz/releases/tag/8.0.1 icu 72.1 - checked 07jan23 https://github.com/unicode-org/icu/releases/ diff --git a/Build/source/libs/harfbuzz/ChangeLog b/Build/source/libs/harfbuzz/ChangeLog index e921dc1e8a5..edea99be1c9 100644 --- a/Build/source/libs/harfbuzz/ChangeLog +++ b/Build/source/libs/harfbuzz/ChangeLog @@ -1,3 +1,8 @@ +2023-07-12 Akira Kakuto <kakuto@jcom.zaq.ne.jp> + + Import harfbuzz-8.0.1. + * version.ac: Adjusted. + 2023-07-09 Akira Kakuto <kakuto@jcom.zaq.ne.jp> Import harfbuzz-8.0.0. diff --git a/Build/source/libs/harfbuzz/TLpatches/ChangeLog b/Build/source/libs/harfbuzz/TLpatches/ChangeLog index dd9f36eaae0..9823f813ce7 100644 --- a/Build/source/libs/harfbuzz/TLpatches/ChangeLog +++ b/Build/source/libs/harfbuzz/TLpatches/ChangeLog @@ -1,3 +1,8 @@ +2023-07-12 Akira Kakuto <kakuto@jcom.zaq.ne.jp> + + Imported harfbuzz-8.0.1 source tree from: + https://github.com/harfbuzz/harfbuzz/releases/download/8.0.1/ + 2023-07-09 Akira Kakuto <kakuto@jcom.zaq.ne.jp> Imported harfbuzz-8.0.0 source tree from: diff --git a/Build/source/libs/harfbuzz/TLpatches/TL-Changes b/Build/source/libs/harfbuzz/TLpatches/TL-Changes index 8bc3ce1a166..4ebc11629f8 100644 --- a/Build/source/libs/harfbuzz/TLpatches/TL-Changes +++ b/Build/source/libs/harfbuzz/TLpatches/TL-Changes @@ -1,5 +1,5 @@ -Changes applied to the harfbuzz-8.0.0/ tree as obtained from: - https://github.com/harfbuzz/harfbuzz/releases/download/8.0.0/ +Changes applied to the harfbuzz-8.0.1/ tree as obtained from: + https://github.com/harfbuzz/harfbuzz/releases/download/8.0.1/ Removed: COPYING diff --git a/Build/source/libs/harfbuzz/configure b/Build/source/libs/harfbuzz/configure index 2a0a9399b7e..4286a641392 100755 --- a/Build/source/libs/harfbuzz/configure +++ b/Build/source/libs/harfbuzz/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for harfbuzz (TeX Live) 8.0.0. +# Generated by GNU Autoconf 2.71 for harfbuzz (TeX Live) 8.0.1. # # Report bugs to <tex-k@tug.org>. # @@ -611,8 +611,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='harfbuzz (TeX Live)' PACKAGE_TARNAME='harfbuzz--tex-live-' -PACKAGE_VERSION='8.0.0' -PACKAGE_STRING='harfbuzz (TeX Live) 8.0.0' +PACKAGE_VERSION='8.0.1' +PACKAGE_STRING='harfbuzz (TeX Live) 8.0.1' PACKAGE_BUGREPORT='tex-k@tug.org' PACKAGE_URL='' @@ -1346,7 +1346,7 @@ if test "$ac_init_help" = "long"; then # 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 (TeX Live) 8.0.0 to adapt to many kinds of systems. +\`configure' configures harfbuzz (TeX Live) 8.0.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1418,7 +1418,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of harfbuzz (TeX Live) 8.0.0:";; + short | recursive ) echo "Configuration of harfbuzz (TeX Live) 8.0.1:";; esac cat <<\_ACEOF @@ -1523,7 +1523,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -harfbuzz (TeX Live) configure 8.0.0 +harfbuzz (TeX Live) configure 8.0.1 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -2064,7 +2064,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by harfbuzz (TeX Live) $as_me 8.0.0, which was +It was created by harfbuzz (TeX Live) $as_me 8.0.1, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -4823,7 +4823,7 @@ fi # Define the identity of the package. PACKAGE='harfbuzz--tex-live-' - VERSION='8.0.0' + VERSION='8.0.1' # Some tools Automake needs. @@ -5035,8 +5035,8 @@ WARNING_CFLAGS=$kpse_cv_warning_cflags HB_VERSION_MAJOR=8 HB_VERSION_MINOR=0 -HB_VERSION_MICRO=0 -HB_VERSION=8.0.0 +HB_VERSION_MICRO=1 +HB_VERSION=8.0.1 ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -8817,7 +8817,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by harfbuzz (TeX Live) $as_me 8.0.0, which was +This file was extended by harfbuzz (TeX Live) $as_me 8.0.1, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -8885,7 +8885,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -harfbuzz (TeX Live) config.status 8.0.0 +harfbuzz (TeX Live) config.status 8.0.1 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog b/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog index 372845e7703..0811c7a23bb 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog +++ b/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog @@ -1,3 +1,319 @@ +commit d160d9389cb4c5b15ebea9b41eb74018c4358924 +Author: Khaled Hosny <khaled@aliftype.com> +Date: Wed Jul 12 08:27:25 2023 +0300 + + 8.0.1 + + NEWS | 11 +++++++++++ + configure.ac | 2 +- + meson.build | 2 +- + src/hb-version.h | 4 ++-- + 4 files changed, 15 insertions(+), 4 deletions(-) + +commit 8704d73213da2294281687ecd7a40d408e9bf26a +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Mon Jul 10 18:08:13 2023 -0600 + + [priority-queue] Inline a couple more + + src/hb-priority-queue.hh | 3 +++ + 1 file changed, 3 insertions(+) + +commit 4c9e8b848b82dd8e268d596e69d0a5a32b724e01 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Mon Jul 10 18:04:03 2023 -0600 + + [priority-queue] Always-inline a method + + src/hb-priority-queue.hh | 1 + + 1 file changed, 1 insertion(+) + +commit c41b0d7b8318710d792066f2915cf8c02c89162e +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Mon Jul 10 17:23:58 2023 -0600 + + [sanitize/PairValueRecord] Add a max_size for faster sanitize + + src/OT/Layout/GPOS/PairValueRecord.hh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit c14f94f76bd323108bad6e61483b88ed3eac35c3 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Mon Jul 10 16:28:22 2023 -0600 + + Fix compiler error + + hb-ot-var-common.hh:758:32: error: implicit conversion from 'int' to 'char' changes value from 191 to -65 [-Werror, + -Wconstant-conversion] + *it++ = (DELTAS_ARE_ZERO | 63); + + src/hb-ot-var-common.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit fcc5d3df39219a2bf8803026e5976504d696e99f +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Mon Jul 10 16:21:28 2023 -0600 + + Add -Wconstant-conversion to errors + + src/hb.hh | 1 + + 1 file changed, 1 insertion(+) + +commit d1855e902d371471b2120af8b8bfd1bf9a629b75 +Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> +Date: Mon Jul 10 10:26:31 2023 +0000 + + Bump github/codeql-action from 2.20.1 to 2.20.3 + + Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.20.1 to 2.20.3. + - [Release notes](https://github.com/github/codeql-action/releases) + - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) + - [Commits](https://github.com/github/codeql-action/compare/f6e388ebf0efc915c6c5b165b019ee61a6746a38...46ed16ded91731b2df79a2893d3aea8e9f03b5c4) + + --- + updated-dependencies: + - dependency-name: github/codeql-action + dependency-type: direct:production + update-type: version-update:semver-patch + ... + + Signed-off-by: dependabot[bot] <support@github.com> + + .github/workflows/scorecard.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 997986ab307bb7868b780a3ff608bd608fb9e077 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Sun Jul 9 15:15:33 2023 -0600 + + [subset/hvar] Error handling + + Fixes https://oss-fuzz.com/testcase-detail/5029952234586112 + + src/hb-ot-var-hvar-table.hh | 2 +- + ...z-testcase-minimized-hb-subset-fuzzer-5029952234586112 | Bin 0 -> 837 bytes + 2 files changed, 1 insertion(+), 1 deletion(-) + +commit 0980e2b7481890685ce1869fc25a2915ecac92f4 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Sun Jul 9 15:13:57 2023 -0600 + + Minor casts + + src/hb-algs.hh | 4 ++-- + src/hb-bit-page.hh | 8 ++++---- + 2 files changed, 6 insertions(+), 6 deletions(-) + +commit db3aeeb547c1a2cad46ea03e162593d22f700cb4 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Sun Jul 9 12:32:49 2023 -0600 + + [subset] Fix cast-align issue + + Fixes https://github.com/harfbuzz/harfbuzz/issues/4316 + + src/hb-serialize.hh | 2 +- + src/hb-subset.cc | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit fc24ffbfb3384286efa20728fe054c884d487fb0 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Sun Jul 9 11:05:13 2023 -0600 + + [priority-queue] Minor simplify + + Tail-recursion definitely was being optimized by compiler, + but I prefer writing it this way. + + src/hb-priority-queue.hh | 19 +++++++++++-------- + 1 file changed, 11 insertions(+), 8 deletions(-) + +commit 557653abceeb4305a449851b74c62918540d03b0 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Sun Jul 9 10:18:04 2023 -0600 + + [cff] Minor; add tableTag + + src/hb-ot-cff1-table.hh | 2 ++ + src/hb-ot-cff2-table.hh | 2 ++ + 2 files changed, 4 insertions(+) + +commit 6df8ce7b41294fcaf028e425ccb6be331b37ced5 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Sun Jul 9 09:58:02 2023 -0600 + + [bit-page] Remove disabled assertion + + src/hb-bit-page.hh | 1 - + 1 file changed, 1 deletion(-) + +commit 9b9a9c6f4a47307e3cb5be3a4774f4bd1feeb180 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Sun Jul 9 09:55:00 2023 -0600 + + [bit-page] Speed up is_empty() + + src/hb-bit-page.hh | 1 + + 1 file changed, 1 insertion(+) + +commit 2f4ed5e939fb9619ca27786b6d71b577d909c15f +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Sun Jul 9 09:45:46 2023 -0600 + + [bit-page] Short-circuit is_subset() + + src/hb-bit-page.hh | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 347c1f701313d7449002e3b0426b38bbb870c8b5 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Sun Jul 9 09:33:04 2023 -0600 + + [set] Keep (lazy) population per bit-page + + 36% speedup in: + BM_subset/subset_glyphs/merged.devalast.ttf/10 + + src/hb-bit-page.hh | 20 ++++++++++++++------ + src/hb-bit-set.hh | 5 +++-- + 2 files changed, 17 insertions(+), 8 deletions(-) + +commit 04ee306b9ae7c2382baf17c9b7ae47a2527c38aa +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Sun Jul 9 07:37:57 2023 -0600 + + [subset/hmtx] Another TODO + + src/hb-ot-hmtx-table.hh | 1 + + 1 file changed, 1 insertion(+) + +commit caef35b3ef478462a996e3fdb988bcc9cca492c8 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Sun Jul 9 07:23:16 2023 -0600 + + [subset/hmtx] TODO + + src/hb-ot-hmtx-table.hh | 2 ++ + 1 file changed, 2 insertions(+) + +commit 982554c71c06a485b9e93ffd9a55c7b1d1add23c +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Sun Jul 9 06:58:02 2023 -0600 + + [subset/cff1] Speed up plan_subset_charset more + + 16% speed up in retaingid subsetting NotoSansCJKkr-Regular.otf. + + src/hb-subset-cff1.cc | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +commit 15d8f0ca7c7c9f293bc35034c3e9a3c12451cfd9 +Author: Khaled Hosny <khaled@aliftype.com> +Date: Sun Jul 9 10:56:36 2023 +0300 + + [doc] Fix warning: Section has no title and no file + + Move the private macros to the hb-common section, instead of a file-less + one. + + docs/harfbuzz-sections.txt | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +commit e60ec9dcd3b0f94d13b8baf7ba12cd6cf0626064 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Sat Jul 8 20:47:34 2023 -0600 + + [subset/cff2] Speedup retaingids serialize + + 10% speedup in subset_glyphs/SourceHanSans-VF.otf/retaingids/10 + + src/hb-ot-cff-common.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit b583978bdf0e83ab597c797d8a0b10291f976362 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Sat Jul 8 20:41:58 2023 -0600 + + [subset/DeltaSetMapIndex] Speedup retaingids serialize() + + src/hb-ot-var-common.hh | 17 ++++++++++------- + 1 file changed, 10 insertions(+), 7 deletions(-) + +commit 3505486a0d7c44217c2629c193f4d78cf29aa9ae +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Sat Jul 8 20:28:45 2023 -0600 + + [subset/DeltaSetMapIndex] Micro-optimize + + src/hb-ot-var-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c8f6ae1df7d559180c40511a8ad8c2da7b303dff +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Sat Jul 8 20:21:49 2023 -0600 + + [subset/hvar/retaingids] Synthesize a DeltaSetIndexMap if needed + + Before we were emitting the entire VarStore rows if advMap + was Null. Instead, synthesize an advMap. + + 20% speed up in subset_glyphs/SourceHanSans-VF.otf/retaingids benchmark. + + src/hb-ot-var-hvar-table.hh | 32 ++++++--------------- + test/api/fonts/AdobeVFPrototype.ac.retaingids.otf | Bin 4584 -> 4584 bytes + test/api/fonts/SourceSansVariable-Roman.abc.ttf | Bin 3196 -> 5160 bytes + .../SourceSansVariable-Roman.ac.retaingids.ttf | Bin 2976 -> 4584 bytes + test/api/fonts/SourceSansVariable-Roman.ac.ttf | Bin 2964 -> 4580 bytes + 5 files changed, 9 insertions(+), 23 deletions(-) + +commit 1f4645c6fc4c7cc4d551791b6c04f67e71f4952d +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Sat Jul 8 18:49:47 2023 -0600 + + [subset/hvar] Speed up + + src/hb-ot-var-hvar-table.hh | 19 +++++++++---------- + 1 file changed, 9 insertions(+), 10 deletions(-) + +commit 8d99db5c3b4bebf22b06bfa12cf90dad6af9555a +Author: Khaled Hosny <khaled@aliftype.com> +Date: Sun Jul 9 03:41:48 2023 +0300 + + [wasm] Typo [ci skip] + + docs/wasm-shaper.md | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 8115033ac338067f9fb1050294eb2cfd8f86e784 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Sat Jul 8 18:33:13 2023 -0600 + + [hvar] Speed up retaingids planning + + 35% speedup in: + BM_subset/subset_glyphs/SourceHanSans-VF.otf/retaingids/10 + + src/hb-ot-var-hvar-table.hh | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +commit 1fe1a497902249c37f2212d98ed7d76d4dee3307 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Sat Jul 8 18:24:09 2023 -0600 + + [bimap] Minor vector pre-alloc + + src/hb-bimap.hh | 1 + + 1 file changed, 1 insertion(+) + +commit 7a7001dfcf2f9d4a9847acd4b423f6ebf3ee6276 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Sat Jul 8 17:48:00 2023 -0600 + + Typo + + src/hb-subset-cff-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + commit b4305532a7746422e0b615eee6304119c1092fd8 Author: Khaled Hosny <khaled@aliftype.com> Date: Sun Jul 9 02:54:30 2023 +0300 diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/NEWS b/Build/source/libs/harfbuzz/harfbuzz-src/NEWS index 5b82163de8b..1454a2189db 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/NEWS +++ b/Build/source/libs/harfbuzz/harfbuzz-src/NEWS @@ -1,3 +1,14 @@ +Overview of changes leading to 8.0.1 +Wednesday, July 12, 2023 +==================================== +- Build fix on 32-bit arm. + +- More speed optimizations: + - 60% speedup in retaingids subsetting SourceHanSans-VF. + - 38% speed up in subsetting (beyond-64k) mega-merged Noto. + - 16% speed up in retain-gid (used for IFT) subsetting of NotoSansCJKkr. + + Overview of changes leading to 8.0.0 Sunday, July 9, 2023 ==================================== diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac b/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac index a2d532ed672..3de964bc54e 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac +++ b/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac @@ -1,6 +1,6 @@ AC_PREREQ([2.64]) AC_INIT([HarfBuzz], - [8.0.0], + [8.0.1], [https://github.com/harfbuzz/harfbuzz/issues/new], [harfbuzz], [http://harfbuzz.org/]) diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/meson.build b/Build/source/libs/harfbuzz/harfbuzz-src/meson.build index 284701222cb..c3062c72f59 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/meson.build +++ b/Build/source/libs/harfbuzz/harfbuzz-src/meson.build @@ -1,6 +1,6 @@ project('harfbuzz', 'c', 'cpp', meson_version: '>= 0.55.0', - version: '8.0.0', + version: '8.0.1', default_options: [ 'cpp_eh=none', # Just to support msvc, we are passing -fno-exceptions also anyway 'cpp_rtti=false', # Just to support msvc, we are passing -fno-rtti also anyway diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairValueRecord.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairValueRecord.hh index 3222477764a..c99a38699e4 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairValueRecord.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairValueRecord.hh @@ -22,7 +22,8 @@ struct PairValueRecord ValueRecord values; /* Positioning data for the first glyph * followed by for second glyph */ public: - DEFINE_SIZE_ARRAY (Types::size, values); + DEFINE_SIZE_ARRAY (Types::HBGlyphID::static_size, values); + DEFINE_SIZE_MAX (Types::HBGlyphID::static_size + 2 * Value::static_size * 8 * sizeof (ValueFormat)); int cmp (hb_codepoint_t k) const { return secondGlyph.cmp (k); } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-algs.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-algs.hh index 374965d56e8..bfd83a269c6 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-algs.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-algs.hh @@ -362,10 +362,10 @@ struct // https://github.com/harfbuzz/harfbuzz/pull/4228#issuecomment-1565079537 template <typename T, hb_enable_if (std::is_integral<T>::value && sizeof (T) <= sizeof (uint32_t))> constexpr auto - impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, v * 2654435761u /* Knuh's multiplicative hash */) + impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, (uint32_t) v * 2654435761u /* Knuh's multiplicative hash */) template <typename T, hb_enable_if (std::is_integral<T>::value && sizeof (T) > sizeof (uint32_t))> constexpr auto - impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, (v ^ (v >> 32)) * 2654435761u /* Knuth's multiplicative hash */) + impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, (uint32_t) (v ^ (v >> 32)) * 2654435761u /* Knuth's multiplicative hash */) template <typename T> constexpr auto impl (const T& v, hb_priority<0>) const HB_RETURN (uint32_t, std::hash<hb_decay<decltype (hb_deref (v))>>{} (hb_deref (v))) diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bimap.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bimap.hh index 4006fc4ebd0..64dbf2e8699 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bimap.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bimap.hh @@ -143,6 +143,7 @@ struct hb_inc_bimap_t hb_codepoint_t skip (unsigned count) { hb_codepoint_t start = back_map.length; + back_map.alloc (back_map.length + count); for (unsigned i = 0; i < count; i++) back_map.push (HB_MAP_VALUE_INVALID); return start; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bit-page.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bit-page.hh index e578d2643fa..e1826e12a59 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bit-page.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bit-page.hh @@ -89,14 +89,17 @@ struct hb_vector_size_t struct hb_bit_page_t { - void init0 () { v.init0 (); } - void init1 () { v.init1 (); } + void init0 () { v.init0 (); population = 0; } + void init1 () { v.init1 (); population = PAGE_BITS; } + + void dirty () { population = UINT_MAX; } static inline constexpr unsigned len () { return ARRAY_LENGTH_CONST (v); } bool is_empty () const { + if (has_population ()) return !population; return + hb_iter (v) | hb_none @@ -107,8 +110,8 @@ struct hb_bit_page_t return hb_bytes_t ((const char *) &v, sizeof (v)).hash (); } - void add (hb_codepoint_t g) { elt (g) |= mask (g); } - void del (hb_codepoint_t g) { elt (g) &= ~mask (g); } + void add (hb_codepoint_t g) { elt (g) |= mask (g); dirty (); } + void del (hb_codepoint_t g) { elt (g) &= ~mask (g); dirty (); } void set (hb_codepoint_t g, bool value) { if (value) add (g); else del (g); } bool get (hb_codepoint_t g) const { return elt (g) & mask (g); } @@ -120,20 +123,21 @@ struct hb_bit_page_t *la |= (mask (b) << 1) - mask(a); else { - *la |= ~(mask (a) - 1); + *la |= ~(mask (a) - 1llu); la++; hb_memset (la, 0xff, (char *) lb - (char *) la); - *lb |= ((mask (b) << 1) - 1); + *lb |= ((mask (b) << 1) - 1llu); } + dirty (); } void del_range (hb_codepoint_t a, hb_codepoint_t b) { elt_t *la = &elt (a); elt_t *lb = &elt (b); if (la == lb) - *la &= ~((mask (b) << 1) - mask(a)); + *la &= ~((mask (b) << 1llu) - mask(a)); else { *la &= mask (a) - 1; @@ -141,8 +145,9 @@ struct hb_bit_page_t hb_memset (la, 0, (char *) lb - (char *) la); - *lb &= ~((mask (b) << 1) - 1); + *lb &= ~((mask (b) << 1) - 1llu); } + dirty (); } void set_range (hb_codepoint_t a, hb_codepoint_t b, bool v) { if (v) add_range (a, b); else del_range (a, b); } @@ -222,18 +227,25 @@ struct hb_bit_page_t } bool is_subset (const hb_bit_page_t &larger_page) const { + if (has_population () && larger_page.has_population () && + population > larger_page.population) + return false; + for (unsigned i = 0; i < len (); i++) if (~larger_page.v[i] & v[i]) return false; return true; } + bool has_population () const { return population != UINT_MAX; } unsigned int get_population () const { - return + if (has_population ()) return population; + population = + hb_iter (v) | hb_reduce ([] (unsigned pop, const elt_t &_) { return pop + hb_popcount (_); }, 0u) ; + return population; } bool next (hb_codepoint_t *codepoint) const @@ -329,9 +341,9 @@ struct hb_bit_page_t const elt_t& elt (hb_codepoint_t g) const { return v[(g & MASK) / ELT_BITS]; } static constexpr elt_t mask (hb_codepoint_t g) { return elt_t (1) << (g & ELT_MASK); } + mutable unsigned population; vector_t v; }; -static_assert (hb_bit_page_t::PAGE_BITS == sizeof (hb_bit_page_t) * 8, ""); #endif /* HB_BIT_PAGE_HH */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bit-set.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bit-set.hh index a84d751fb35..17eb06541ae 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bit-set.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bit-set.hh @@ -553,6 +553,7 @@ struct hb_bit_set_t count--; page_map.arrayZ[count] = page_map.arrayZ[a]; page_at (count).v = op (page_at (a).v, other.page_at (b).v); + page_at (count).dirty (); } else if (page_map.arrayZ[a - 1].major > other.page_map.arrayZ[b - 1].major) { @@ -571,7 +572,7 @@ struct hb_bit_set_t count--; page_map.arrayZ[count].major = other.page_map.arrayZ[b].major; page_map.arrayZ[count].index = next_page++; - page_at (count).v = other.page_at (b).v; + page_at (count) = other.page_at (b); } } } @@ -589,7 +590,7 @@ struct hb_bit_set_t count--; page_map.arrayZ[count].major = other.page_map.arrayZ[b].major; page_map.arrayZ[count].index = next_page++; - page_at (count).v = other.page_at (b).v; + page_at (count) = other.page_at (b); } assert (!count); resize (newCount); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff-common.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff-common.hh index a2f90c8f5e2..923a32b26f8 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff-common.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff-common.hh @@ -94,10 +94,10 @@ struct CFFIndex for (const auto &_ : +it) { unsigned len = _.length; + if (!len) + continue; if (len <= 1) { - if (!len) - continue; *ret++ = *_.arrayZ; continue; } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff1-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff1-table.hh index 3d658ac626d..1e81dcb5e3a 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff1-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff1-table.hh @@ -1061,6 +1061,8 @@ struct cff1 template <typename PRIVOPSET, typename PRIVDICTVAL> struct accelerator_templ_t { + static constexpr hb_tag_t tableTag = cff1::tableTag; + accelerator_templ_t (hb_face_t *face) { if (!face) return; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff2-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff2-table.hh index 9913cdad0c6..af24bb9986f 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff2-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff2-table.hh @@ -390,6 +390,8 @@ struct cff2 template <typename PRIVOPSET, typename PRIVDICTVAL> struct accelerator_templ_t { + static constexpr hb_tag_t tableTag = cff2::tableTag; + accelerator_templ_t (hb_face_t *face) { if (!face) return; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hmtx-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hmtx-table.hh index fed6ca1c7a2..89640b43f15 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hmtx-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hmtx-table.hh @@ -179,6 +179,7 @@ struct hmtxvmtx lm.advance = mtx.first; lm.sb = mtx.second; } + // TODO(beyond-64k): This assumes that maxp.numGlyphs is 0xFFFF. else if (gid < 0x10000u) short_metrics[gid] = mtx.second; else @@ -199,6 +200,8 @@ struct hmtxvmtx /* Determine num_long_metrics to encode. */ auto& plan = c->plan; + // TODO Don't consider retaingid holes here. + num_long_metrics = hb_min (plan->num_output_glyphs (), 0xFFFFu); unsigned int last_advance = get_new_gid_advance_unscaled (plan, mtx_map, num_long_metrics - 1, _mtx); while (num_long_metrics > 1 && diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-common.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-common.hh index 44ec64bc03f..6bbb4d6f110 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-common.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-common.hh @@ -60,18 +60,21 @@ struct DeltaSetIndexMapFormat01 entryFormat = ((width-1)<<4)|(inner_bit_count-1); mapCount = output_map.length; - HBUINT8 *p = c->allocate_size<HBUINT8> (width * output_map.length, false); + HBUINT8 *p = c->allocate_size<HBUINT8> (width * output_map.length); if (unlikely (!p)) return_trace (false); for (unsigned int i = 0; i < output_map.length; i++) { - unsigned int v = output_map[i]; - unsigned int outer = v >> 16; - unsigned int inner = v & 0xFFFF; - unsigned int u = (outer << inner_bit_count) | inner; - for (unsigned int w = width; w > 0;) + unsigned int v = output_map.arrayZ[i]; + if (v) { - p[--w] = u; - u >>= 8; + unsigned int outer = v >> 16; + unsigned int inner = v & 0xFFFF; + unsigned int u = (outer << inner_bit_count) | inner; + for (unsigned int w = width; w > 0;) + { + p[--w] = u; + u >>= 8; + } } p += width; } @@ -755,14 +758,14 @@ struct tuple_delta_t while (run_length >= 64) { - *it++ = (DELTAS_ARE_ZERO | 63); + *it++ = char (DELTAS_ARE_ZERO | 63); run_length -= 64; encoded_len++; } if (run_length) { - *it++ = (DELTAS_ARE_ZERO | (run_length - 1)); + *it++ = char (DELTAS_ARE_ZERO | (run_length - 1)); encoded_len++; } return encoded_len; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-hvar-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-hvar-table.hh index 943d376bdfc..490f883fcce 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-hvar-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-hvar-table.hh @@ -45,7 +45,8 @@ struct index_map_subset_plan_t void init (const DeltaSetIndexMap &index_map, hb_inc_bimap_t &outer_map, hb_vector_t<hb_set_t *> &inner_sets, - const hb_subset_plan_t *plan) + const hb_subset_plan_t *plan, + bool bypass_empty = true) { map_count = 0; outer_bit_count = 0; @@ -53,11 +54,10 @@ struct index_map_subset_plan_t max_inners.init (); output_map.init (); - if (&index_map == &Null (DeltaSetIndexMap)) return; + if (bypass_empty && !index_map.get_map_count ()) return; unsigned int last_val = (unsigned int)-1; hb_codepoint_t last_gid = HB_CODEPOINT_INVALID; - hb_codepoint_t num_gid = (hb_codepoint_t) hb_min (index_map.get_map_count (), plan->num_output_glyphs ()); outer_bit_count = (index_map.get_width () * 8) - index_map.get_inner_bit_count (); max_inners.resize (inner_sets.length); @@ -68,24 +68,17 @@ struct index_map_subset_plan_t unsigned count = new_to_old_gid_list.length; for (unsigned j = count; j; j--) { - hb_codepoint_t gid = new_to_old_gid_list[j - 1].first; - if (gid >= num_gid) continue; - - hb_codepoint_t old_gid = new_to_old_gid_list[j - 1].second; + hb_codepoint_t gid = new_to_old_gid_list.arrayZ[j - 1].first; + hb_codepoint_t old_gid = new_to_old_gid_list.arrayZ[j - 1].second; unsigned int v = index_map.map (old_gid); if (last_gid == HB_CODEPOINT_INVALID) { - if (gid + 1 != num_gid) - { - last_gid = gid + 1; - break; - } last_val = v; last_gid = gid; continue; } - if (v != last_val || gid + 1 != last_gid) + if (v != last_val) break; last_gid = gid; @@ -120,8 +113,6 @@ struct index_map_subset_plan_t const hb_vector_t<hb_inc_bimap_t> &inner_maps, const hb_subset_plan_t *plan) { - if (input_map == &Null (DeltaSetIndexMap)) return; - for (unsigned int i = 0; i < max_inners.length; i++) { if (inner_maps[i].get_population () == 0) continue; @@ -129,18 +120,17 @@ struct index_map_subset_plan_t if (bit_count > inner_bit_count) inner_bit_count = bit_count; } - output_map.resize (map_count); - for (hb_codepoint_t gid = 0; gid < output_map.length; gid++) + if (unlikely (!output_map.resize (map_count))) return; + for (const auto &_ : plan->new_to_old_gid_list) { - hb_codepoint_t old_gid; - if (plan->old_gid_for_new_gid (gid, &old_gid)) - { - uint32_t v = input_map->map (old_gid); - unsigned int outer = v >> 16; - output_map[gid] = (outer_map[outer] << 16) | (inner_maps[outer][v & 0xFFFF]); - } - else - output_map[gid] = 0; /* Map unused glyph to outer/inner=0/0 */ + hb_codepoint_t new_gid = _.first; + hb_codepoint_t old_gid = _.second; + + if (unlikely (new_gid >= map_count)) break; + + uint32_t v = input_map->map (old_gid); + unsigned int outer = v >> 16; + output_map.arrayZ[new_gid] = (outer_map[outer] << 16) | (inner_maps[outer][v & 0xFFFF]); } } @@ -184,7 +174,7 @@ struct hvarvvar_subset_plan_t if (unlikely (!index_map_plans.length || !inner_sets.length || !inner_maps.length)) return; bool retain_adv_map = false; - index_map_plans[0].init (*index_maps[0], outer_map, inner_sets, plan); + index_map_plans[0].init (*index_maps[0], outer_map, inner_sets, plan, false); if (index_maps[0] == &Null (DeltaSetIndexMap)) { retain_adv_map = plan->flags & HB_SUBSET_FLAGS_RETAIN_GIDS; @@ -201,13 +191,10 @@ struct hvarvvar_subset_plan_t if (retain_adv_map) { - unsigned num_glyphs = plan->num_output_glyphs (); - for (hb_codepoint_t gid = 0; gid < num_glyphs; gid++) + for (const auto &_ : plan->new_to_old_gid_list) { - if (inner_sets[0]->has (gid)) - inner_maps[0].add (gid); - else - inner_maps[0].skip (); + hb_codepoint_t old_gid = _.second; + inner_maps[0].add (old_gid); } } else diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-priority-queue.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-priority-queue.hh index bf1b282d3d8..938c0287264 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-priority-queue.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-priority-queue.hh @@ -61,6 +61,9 @@ struct hb_priority_queue_t bubble_up (heap.length - 1); } +#ifndef HB_OPTIMIZE_SIZE + HB_ALWAYS_INLINE +#endif item_t pop_minimum () { assert (!is_empty ()); @@ -106,8 +109,10 @@ struct hb_priority_queue_t return 2 * index + 2; } + HB_ALWAYS_INLINE void bubble_down (unsigned index) { + repeat: assert (index < heap.length); unsigned left = left_child (index); @@ -123,19 +128,20 @@ struct hb_priority_queue_t && (!has_right || heap.arrayZ[index].first <= heap.arrayZ[right].first)) return; + unsigned child; if (!has_right || heap.arrayZ[left].first < heap.arrayZ[right].first) - { - swap (index, left); - bubble_down (left); - return; - } + child = left; + else + child = right; - swap (index, right); - bubble_down (right); + swap (index, child); + index = child; + goto repeat; } void bubble_up (unsigned index) { + repeat: assert (index < heap.length); if (index == 0) return; @@ -145,7 +151,8 @@ struct hb_priority_queue_t return; swap (index, parent_index); - bubble_up (parent_index); + index = parent_index; + goto repeat; } void swap (unsigned a, unsigned b) diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-serialize.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-serialize.hh index f852f07ba61..15eccb6a09a 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-serialize.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-serialize.hh @@ -266,7 +266,7 @@ struct hb_serialize_context_t propagate_error (std::forward<Ts> (os)...); } /* To be called around main operation. */ - template <typename Type> + template <typename Type=char> __attribute__((returns_nonnull)) Type *start_serialize () { diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff-common.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff-common.hh index f54792648d8..462e99cf8c8 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff-common.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff-common.hh @@ -773,7 +773,7 @@ struct subr_subsetter_t } } - /* Doing this here one by one instead of compacting all at the en + /* Doing this here one by one instead of compacting all at the end * has massive peak-memory saving. * * The compacting both saves memory and makes further operations diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff1.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff1.cc index e80d18d0970..872cba66725 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff1.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff1.cc @@ -551,14 +551,12 @@ struct cff1_subset_plan sid = sidmap.add (sid); if (sid != last_sid + 1) - { subset_charset_ranges.push (code_pair_t {sid, glyph}); - if (glyph == old_glyph && skip) - { - glyph = hb_min (_.first - 1, glyph_to_sid_map->arrayZ[old_glyph].glyph); - sid += glyph - old_glyph; - } + if (glyph == old_glyph && skip) + { + glyph = hb_min (_.first - 1, glyph_to_sid_map->arrayZ[old_glyph].glyph); + sid += glyph - old_glyph; } last_sid = sid; } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset.cc index 8e8a5eb0bdd..f497700ed6e 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset.cc @@ -273,7 +273,7 @@ _try_subset (const TableType *table, hb_vector_t<char>* buf, hb_subset_context_t* c /* OUT */) { - c->serializer->start_serialize<TableType> (); + c->serializer->start_serialize (); if (c->serializer->in_error ()) return false; bool needed = table->subset (c); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb.hh index 49119b8f82d..972608d6a30 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb.hh @@ -64,6 +64,7 @@ #pragma GCC diagnostic error "-Wbitwise-instead-of-logical" #pragma GCC diagnostic error "-Wcast-align" #pragma GCC diagnostic error "-Wcast-function-type" +#pragma GCC diagnostic error "-Wconstant-conversion" #pragma GCC diagnostic error "-Wcomma" #pragma GCC diagnostic error "-Wdelete-non-virtual-dtor" #pragma GCC diagnostic error "-Wembedded-directive" diff --git a/Build/source/libs/harfbuzz/version.ac b/Build/source/libs/harfbuzz/version.ac index ed6a07cdd6c..00a60fed73f 100644 --- a/Build/source/libs/harfbuzz/version.ac +++ b/Build/source/libs/harfbuzz/version.ac @@ -8,4 +8,4 @@ dnl dnl -------------------------------------------------------- dnl dnl m4-include this file to define the current harfbuzz version -m4_define([harfbuzz_version], [8.0.0]) +m4_define([harfbuzz_version], [8.0.1]) |