From c76c4a2738080876fe6de7c032b94aa8ea27dda0 Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Sun, 18 Dec 2022 01:06:39 +0000 Subject: harfbuzz-6.0.0 git-svn-id: svn://tug.org/texlive/trunk@65304 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/libs/harfbuzz/ChangeLog | 5 + Build/source/libs/harfbuzz/Makefile.am | 4 + Build/source/libs/harfbuzz/Makefile.in | 4 + Build/source/libs/harfbuzz/TLpatches/ChangeLog | 5 + Build/source/libs/harfbuzz/TLpatches/TL-Changes | 5 +- Build/source/libs/harfbuzz/configure | 28 +- Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog | 6067 ++++++++++++++++++++ Build/source/libs/harfbuzz/harfbuzz-src/NEWS | 62 + .../source/libs/harfbuzz/harfbuzz-src/configure.ac | 2 +- .../source/libs/harfbuzz/harfbuzz-src/meson.build | 84 +- .../libs/harfbuzz/harfbuzz-src/src/Makefile.am | 49 +- .../harfbuzz/harfbuzz-src/src/Makefile.sources | 4 + .../harfbuzz-src/src/OT/Layout/Common/Coverage.hh | 42 +- .../src/OT/Layout/Common/CoverageFormat1.hh | 9 +- .../src/OT/Layout/Common/CoverageFormat2.hh | 35 +- .../harfbuzz-src/src/OT/Layout/GPOS/MarkBasePos.hh | 4 +- .../harfbuzz-src/src/OT/Layout/GPOS/MarkLigPos.hh | 4 +- .../harfbuzz-src/src/OT/Layout/GPOS/MarkMarkPos.hh | 4 +- .../harfbuzz-src/src/OT/Layout/GPOS/PairPos.hh | 4 +- .../src/OT/Layout/GPOS/PairPosFormat1.hh | 26 +- .../src/OT/Layout/GPOS/PairPosFormat2.hh | 27 +- .../harfbuzz-src/src/OT/Layout/GPOS/PairSet.hh | 20 +- .../src/OT/Layout/GSUB/AlternateSet.hh | 2 +- .../src/OT/Layout/GSUB/AlternateSubst.hh | 4 +- .../harfbuzz-src/src/OT/Layout/GSUB/Ligature.hh | 2 +- .../src/OT/Layout/GSUB/LigatureSubst.hh | 4 +- .../src/OT/Layout/GSUB/MultipleSubst.hh | 4 +- .../harfbuzz-src/src/OT/Layout/GSUB/Sequence.hh | 2 +- .../harfbuzz-src/src/OT/Layout/GSUB/SingleSubst.hh | 8 +- .../src/OT/Layout/GSUB/SingleSubstFormat1.hh | 2 +- .../src/OT/Layout/GSUB/SingleSubstFormat2.hh | 20 +- .../harfbuzz-src/src/OT/glyf/CompositeGlyph.hh | 67 +- .../harfbuzz/harfbuzz-src/src/OT/glyf/Glyph.hh | 139 +- .../harfbuzz-src/src/OT/glyf/SimpleGlyph.hh | 49 +- .../harfbuzz-src/src/OT/glyf/SubsetGlyph.hh | 10 +- .../harfbuzz-src/src/OT/glyf/VarCompositeGlyph.hh | 353 ++ .../harfbuzz-src/src/OT/glyf/composite-iter.hh | 68 + .../harfbuzz-src/src/OT/glyf/coord-setter.hh | 34 + .../libs/harfbuzz/harfbuzz-src/src/OT/glyf/glyf.hh | 66 +- .../harfbuzz/harfbuzz-src/src/check-symbols.py | 2 +- .../libs/harfbuzz/harfbuzz-src/src/gen-def.py | 4 +- .../harfbuzz/harfbuzz-src/src/gen-indic-table.py | 17 +- .../harfbuzz/harfbuzz-src/src/gen-ucd-table.py | 57 +- .../harfbuzz/harfbuzz-src/src/gen-use-table.py | 30 +- .../harfbuzz-src/src/graph/classdef-graph.hh | 2 +- .../harfbuzz-src/src/graph/coverage-graph.hh | 2 +- .../libs/harfbuzz/harfbuzz-src/src/graph/graph.hh | 149 +- .../harfbuzz-src/src/graph/gsubgpos-graph.hh | 6 +- .../harfbuzz-src/src/graph/markbasepos-graph.hh | 10 +- .../harfbuzz-src/src/graph/pairpos-graph.hh | 6 +- .../harfbuzz/harfbuzz-src/src/graph/serialize.hh | 23 +- .../harfbuzz-src/src/harfbuzz-config.cmake.in | 44 +- .../harfbuzz-src/src/hb-aat-layout-morx-table.hh | 8 +- .../harfbuzz/harfbuzz-src/src/hb-aat-layout.cc | 2 +- .../libs/harfbuzz/harfbuzz-src/src/hb-aat-map.hh | 2 +- .../libs/harfbuzz/harfbuzz-src/src/hb-algs.hh | 137 +- .../libs/harfbuzz/harfbuzz-src/src/hb-array.hh | 94 +- .../libs/harfbuzz/harfbuzz-src/src/hb-bit-page.hh | 90 +- .../harfbuzz-src/src/hb-bit-set-invertible.hh | 6 +- .../libs/harfbuzz/harfbuzz-src/src/hb-bit-set.hh | 72 +- .../libs/harfbuzz/harfbuzz-src/src/hb-blob.cc | 2 +- .../harfbuzz-src/src/hb-buffer-deserialize-json.hh | 12 +- .../harfbuzz-src/src/hb-buffer-deserialize-json.rl | 4 +- .../harfbuzz-src/src/hb-buffer-deserialize-text.hh | 490 +- .../harfbuzz-src/src/hb-buffer-deserialize-text.rl | 6 +- .../harfbuzz-src/src/hb-buffer-serialize.cc | 8 +- .../harfbuzz/harfbuzz-src/src/hb-buffer-verify.cc | 5 +- .../libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc | 99 +- .../libs/harfbuzz/harfbuzz-src/src/hb-buffer.hh | 11 + .../libs/harfbuzz/harfbuzz-src/src/hb-cache.hh | 2 +- .../harfbuzz-src/src/hb-cff-interp-common.hh | 95 +- .../harfbuzz/harfbuzz-src/src/hb-cff2-interp-cs.hh | 16 +- .../libs/harfbuzz/harfbuzz-src/src/hb-common.cc | 14 +- .../libs/harfbuzz/harfbuzz-src/src/hb-config.hh | 14 +- .../libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc | 13 +- .../libs/harfbuzz/harfbuzz-src/src/hb-draw.cc | 91 +- .../libs/harfbuzz/harfbuzz-src/src/hb-face.cc | 17 +- .../libs/harfbuzz/harfbuzz-src/src/hb-face.hh | 2 + .../harfbuzz/harfbuzz-src/src/hb-fallback-shape.cc | 10 - .../libs/harfbuzz/harfbuzz-src/src/hb-font.cc | 154 +- .../libs/harfbuzz/harfbuzz-src/src/hb-font.hh | 6 +- .../source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc | 32 +- .../libs/harfbuzz/harfbuzz-src/src/hb-glib.cc | 77 +- .../libs/harfbuzz/harfbuzz-src/src/hb-graphite2.cc | 2 +- .../libs/harfbuzz/harfbuzz-src/src/hb-iter.hh | 16 +- .../libs/harfbuzz/harfbuzz-src/src/hb-machinery.hh | 14 +- .../libs/harfbuzz/harfbuzz-src/src/hb-map.hh | 219 +- .../libs/harfbuzz/harfbuzz-src/src/hb-meta.hh | 3 +- .../harfbuzz-src/src/hb-ms-feature-ranges.hh | 2 +- .../libs/harfbuzz/harfbuzz-src/src/hb-multimap.hh | 92 + .../libs/harfbuzz/harfbuzz-src/src/hb-mutex.hh | 7 +- .../harfbuzz/harfbuzz-src/src/hb-number-parser.hh | 8 +- .../libs/harfbuzz/harfbuzz-src/src/hb-object.hh | 4 +- .../libs/harfbuzz/harfbuzz-src/src/hb-open-file.hh | 4 +- .../libs/harfbuzz/harfbuzz-src/src/hb-open-type.hh | 67 +- .../harfbuzz/harfbuzz-src/src/hb-ot-cff-common.hh | 156 +- .../harfbuzz/harfbuzz-src/src/hb-ot-cff1-table.hh | 10 +- .../harfbuzz/harfbuzz-src/src/hb-ot-cff2-table.hh | 11 +- .../harfbuzz/harfbuzz-src/src/hb-ot-cmap-table.hh | 224 +- .../harfbuzz-src/src/hb-ot-color-cbdt-table.hh | 8 +- .../harfbuzz-src/src/hb-ot-color-colr-table.hh | 113 +- .../harfbuzz-src/src/hb-ot-face-table-list.hh | 28 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc | 5 +- .../harfbuzz-src/src/hb-ot-layout-common.hh | 350 +- .../harfbuzz-src/src/hb-ot-layout-gdef-table.hh | 4 +- .../harfbuzz-src/src/hb-ot-layout-gsubgpos.hh | 258 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-layout.cc | 112 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-layout.hh | 7 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-map.cc | 79 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-map.hh | 16 +- .../harfbuzz/harfbuzz-src/src/hb-ot-math-table.hh | 8 +- .../harfbuzz/harfbuzz-src/src/hb-ot-meta-table.hh | 2 +- .../harfbuzz/harfbuzz-src/src/hb-ot-name-table.hh | 211 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-name.cc | 51 +- .../harfbuzz/harfbuzz-src/src/hb-ot-os2-table.hh | 23 +- .../harfbuzz-src/src/hb-ot-post-table-v2subset.hh | 4 +- .../harfbuzz/harfbuzz-src/src/hb-ot-post-table.hh | 2 +- .../harfbuzz-src/src/hb-ot-shape-normalize.cc | 2 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.cc | 4 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.hh | 2 +- .../harfbuzz-src/src/hb-ot-shaper-arabic.cc | 19 +- .../harfbuzz-src/src/hb-ot-shaper-default.cc | 2 + .../harfbuzz-src/src/hb-ot-shaper-indic-machine.hh | 610 +- .../harfbuzz-src/src/hb-ot-shaper-indic-machine.rl | 5 +- .../harfbuzz-src/src/hb-ot-shaper-indic-table.cc | 21 +- .../harfbuzz-src/src/hb-ot-shaper-indic.cc | 73 +- .../harfbuzz-src/src/hb-ot-shaper-khmer-machine.hh | 16 +- .../harfbuzz-src/src/hb-ot-shaper-khmer-machine.rl | 2 +- .../harfbuzz-src/src/hb-ot-shaper-khmer.cc | 21 +- .../src/hb-ot-shaper-myanmar-machine.hh | 16 +- .../src/hb-ot-shaper-myanmar-machine.rl | 2 +- .../harfbuzz-src/src/hb-ot-shaper-myanmar.cc | 48 +- .../harfbuzz-src/src/hb-ot-shaper-syllabic.cc | 12 +- .../harfbuzz-src/src/hb-ot-shaper-syllabic.hh | 4 +- .../harfbuzz/harfbuzz-src/src/hb-ot-shaper-thai.cc | 6 +- .../harfbuzz-src/src/hb-ot-shaper-use-machine.hh | 16 +- .../harfbuzz-src/src/hb-ot-shaper-use-machine.rl | 2 +- .../harfbuzz-src/src/hb-ot-shaper-use-table.hh | 270 + .../harfbuzz/harfbuzz-src/src/hb-ot-shaper-use.cc | 33 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-shaper.hh | 2 + .../harfbuzz/harfbuzz-src/src/hb-ot-stat-table.hh | 2 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-tag.cc | 2 +- .../harfbuzz-src/src/hb-ot-var-avar-table.hh | 6 +- .../harfbuzz/harfbuzz-src/src/hb-ot-var-common.hh | 21 +- .../harfbuzz-src/src/hb-ot-var-fvar-table.hh | 12 +- .../harfbuzz-src/src/hb-ot-var-gvar-table.hh | 229 +- .../libs/harfbuzz/harfbuzz-src/src/hb-pool.hh | 12 +- .../harfbuzz/harfbuzz-src/src/hb-priority-queue.hh | 14 +- .../libs/harfbuzz/harfbuzz-src/src/hb-repacker.hh | 27 +- .../libs/harfbuzz/harfbuzz-src/src/hb-sanitize.hh | 15 +- .../libs/harfbuzz/harfbuzz-src/src/hb-serialize.hh | 64 +- .../harfbuzz/harfbuzz-src/src/hb-set-digest.hh | 35 +- .../libs/harfbuzz/harfbuzz-src/src/hb-set.hh | 6 +- .../harfbuzz/harfbuzz-src/src/hb-shape-plan.cc | 7 +- .../libs/harfbuzz/harfbuzz-src/src/hb-shape.cc | 5 + .../libs/harfbuzz/harfbuzz-src/src/hb-shaper.cc | 2 +- .../libs/harfbuzz/harfbuzz-src/src/hb-static.cc | 2 + .../harfbuzz-src/src/hb-subset-accelerator.hh | 61 +- .../harfbuzz-src/src/hb-subset-cff-common.cc | 11 +- .../harfbuzz-src/src/hb-subset-cff-common.hh | 491 +- .../harfbuzz/harfbuzz-src/src/hb-subset-cff1.cc | 38 +- .../harfbuzz/harfbuzz-src/src/hb-subset-cff2.cc | 23 +- .../harfbuzz/harfbuzz-src/src/hb-subset-input.cc | 141 +- .../harfbuzz/harfbuzz-src/src/hb-subset-input.hh | 55 +- .../harfbuzz/harfbuzz-src/src/hb-subset-plan.cc | 108 +- .../harfbuzz/harfbuzz-src/src/hb-subset-plan.hh | 39 +- .../libs/harfbuzz/harfbuzz-src/src/hb-subset.cc | 95 +- .../libs/harfbuzz/harfbuzz-src/src/hb-subset.h | 17 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ucd-table.hh | 3892 ++++++------- .../libs/harfbuzz/harfbuzz-src/src/hb-ucd.cc | 16 + .../libs/harfbuzz/harfbuzz-src/src/hb-unicode.cc | 26 +- .../libs/harfbuzz/harfbuzz-src/src/hb-uniscribe.cc | 6 +- .../libs/harfbuzz/harfbuzz-src/src/hb-vector.hh | 100 +- Build/source/libs/harfbuzz/harfbuzz-src/src/hb.hh | 1 + .../source/libs/harfbuzz/harfbuzz-src/src/main.cc | 9 +- .../libs/harfbuzz/harfbuzz-src/src/meson.build | 24 +- .../libs/harfbuzz/harfbuzz-src/src/test-array.cc | 3 + .../harfbuzz-src/src/test-buffer-serialize.cc | 8 +- .../libs/harfbuzz/harfbuzz-src/src/test-iter.cc | 25 +- .../libs/harfbuzz/harfbuzz-src/src/test-map.cc | 74 +- .../harfbuzz/harfbuzz-src/src/test-multimap.cc | 59 + .../harfbuzz/harfbuzz-src/src/test-repacker.cc | 3 +- .../libs/harfbuzz/harfbuzz-src/src/test-set.cc | 9 +- .../libs/harfbuzz/harfbuzz-src/src/test-vector.cc | 21 +- Build/source/libs/harfbuzz/version.ac | 2 +- 185 files changed, 13542 insertions(+), 4855 deletions(-) create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/VarCompositeGlyph.hh create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/composite-iter.hh create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/coord-setter.hh create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-multimap.hh create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/test-multimap.cc (limited to 'Build/source/libs/harfbuzz') diff --git a/Build/source/libs/harfbuzz/ChangeLog b/Build/source/libs/harfbuzz/ChangeLog index 674c1433af7..197652e7692 100644 --- a/Build/source/libs/harfbuzz/ChangeLog +++ b/Build/source/libs/harfbuzz/ChangeLog @@ -1,3 +1,8 @@ +2022-12-18 Akira Kakuto + + Import harfbuzz-6.0.0. + * version.ac, Makefile.am: Adjusted. + 2022-10-20 Akira Kakuto Import harfbuzz-5.3.1. diff --git a/Build/source/libs/harfbuzz/Makefile.am b/Build/source/libs/harfbuzz/Makefile.am index 5e59c5aedc6..a8b25e89eb9 100644 --- a/Build/source/libs/harfbuzz/Makefile.am +++ b/Build/source/libs/harfbuzz/Makefile.am @@ -165,6 +165,7 @@ libharfbuzz_a_SOURCES += \ @HARFBUZZ_TREE@/src/hb-aat-map.cc \ @HARFBUZZ_TREE@/src/hb-aat-map.hh \ @HARFBUZZ_TREE@/src/hb-array.hh \ + @HARFBUZZ_TREE@/src/hb-multimap.hh \ @HARFBUZZ_TREE@/src/hb-ot-font.cc \ @HARFBUZZ_TREE@/src/hb-ot-layout.cc \ @HARFBUZZ_TREE@/src/hb-ot-layout-base-table.hh \ @@ -239,6 +240,9 @@ libharfbuzz_a_SOURCES += \ @HARFBUZZ_TREE@/src/OT/glyf/SimpleGlyph.hh \ @HARFBUZZ_TREE@/src/OT/glyf/CompositeGlyph.hh \ @HARFBUZZ_TREE@/src/OT/glyf/SubsetGlyph.hh \ + @HARFBUZZ_TREE@/src/OT/glyf/VarCompositeGlyph.hh \ + @HARFBUZZ_TREE@/src/OT/glyf/composite-iter.hh \ + @HARFBUZZ_TREE@/src/OT/glyf/coord-setter.hh \ @HARFBUZZ_TREE@/src/OT/Layout/Common/Coverage.hh \ @HARFBUZZ_TREE@/src/OT/Layout/Common/CoverageFormat1.hh \ @HARFBUZZ_TREE@/src/OT/Layout/Common/CoverageFormat2.hh \ diff --git a/Build/source/libs/harfbuzz/Makefile.in b/Build/source/libs/harfbuzz/Makefile.in index d2f9f935711..4fe8081fc39 100644 --- a/Build/source/libs/harfbuzz/Makefile.in +++ b/Build/source/libs/harfbuzz/Makefile.in @@ -834,6 +834,7 @@ libharfbuzz_a_SOURCES = @HARFBUZZ_TREE@/src/hb-algs.hh \ @HARFBUZZ_TREE@/src/hb-aat-map.cc \ @HARFBUZZ_TREE@/src/hb-aat-map.hh \ @HARFBUZZ_TREE@/src/hb-array.hh \ + @HARFBUZZ_TREE@/src/hb-multimap.hh \ @HARFBUZZ_TREE@/src/hb-ot-font.cc \ @HARFBUZZ_TREE@/src/hb-ot-layout.cc \ @HARFBUZZ_TREE@/src/hb-ot-layout-base-table.hh \ @@ -906,6 +907,9 @@ libharfbuzz_a_SOURCES = @HARFBUZZ_TREE@/src/hb-algs.hh \ @HARFBUZZ_TREE@/src/OT/glyf/SimpleGlyph.hh \ @HARFBUZZ_TREE@/src/OT/glyf/CompositeGlyph.hh \ @HARFBUZZ_TREE@/src/OT/glyf/SubsetGlyph.hh \ + @HARFBUZZ_TREE@/src/OT/glyf/VarCompositeGlyph.hh \ + @HARFBUZZ_TREE@/src/OT/glyf/composite-iter.hh \ + @HARFBUZZ_TREE@/src/OT/glyf/coord-setter.hh \ @HARFBUZZ_TREE@/src/OT/Layout/Common/Coverage.hh \ @HARFBUZZ_TREE@/src/OT/Layout/Common/CoverageFormat1.hh \ @HARFBUZZ_TREE@/src/OT/Layout/Common/CoverageFormat2.hh \ diff --git a/Build/source/libs/harfbuzz/TLpatches/ChangeLog b/Build/source/libs/harfbuzz/TLpatches/ChangeLog index ffda25586d4..99ea10526b1 100644 --- a/Build/source/libs/harfbuzz/TLpatches/ChangeLog +++ b/Build/source/libs/harfbuzz/TLpatches/ChangeLog @@ -1,3 +1,8 @@ +2022-12-18 Akira Kakuto + + Imported harfbuzz-6.0.0 source tree from: + https://github.com/harfbuzz/harfbuzz/releases/download/6.0.0/ + 2022-10-20 Akira Kakuto Imported harfbuzz-5.3.1 source tree from: diff --git a/Build/source/libs/harfbuzz/TLpatches/TL-Changes b/Build/source/libs/harfbuzz/TLpatches/TL-Changes index 8bea55225aa..e52fabccd35 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-5.3.1/ tree as obtained from: - https://github.com/harfbuzz/harfbuzz/releases/download/5.3.1/ +Changes applied to the harfbuzz-6.0.0/ tree as obtained from: + https://github.com/harfbuzz/harfbuzz/releases/download/6.0.0/ Removed: COPYING @@ -18,6 +18,7 @@ Removed: test-driver src/Makefile.in src/hb-version.h + src/hb-features.h.in unused dirs: docs diff --git a/Build/source/libs/harfbuzz/configure b/Build/source/libs/harfbuzz/configure index 505fa2f6514..6db9dda0629 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) 5.3.1. +# Generated by GNU Autoconf 2.71 for harfbuzz (TeX Live) 6.0.0. # # Report bugs to . # @@ -611,8 +611,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='harfbuzz (TeX Live)' PACKAGE_TARNAME='harfbuzz--tex-live-' -PACKAGE_VERSION='5.3.1' -PACKAGE_STRING='harfbuzz (TeX Live) 5.3.1' +PACKAGE_VERSION='6.0.0' +PACKAGE_STRING='harfbuzz (TeX Live) 6.0.0' 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) 5.3.1 to adapt to many kinds of systems. +\`configure' configures harfbuzz (TeX Live) 6.0.0 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) 5.3.1:";; + short | recursive ) echo "Configuration of harfbuzz (TeX Live) 6.0.0:";; 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 5.3.1 +harfbuzz (TeX Live) configure 6.0.0 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 5.3.1, which was +It was created by harfbuzz (TeX Live) $as_me 6.0.0, 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='5.3.1' + VERSION='6.0.0' # Some tools Automake needs. @@ -5033,10 +5033,10 @@ WARNING_CFLAGS=$kpse_cv_warning_cflags -HB_VERSION_MAJOR=5 -HB_VERSION_MINOR=3 -HB_VERSION_MICRO=1 -HB_VERSION=5.3.1 +HB_VERSION_MAJOR=6 +HB_VERSION_MINOR=0 +HB_VERSION_MICRO=0 +HB_VERSION=6.0.0 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 5.3.1, which was +This file was extended by harfbuzz (TeX Live) $as_me 6.0.0, 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 5.3.1 +harfbuzz (TeX Live) config.status 6.0.0 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 1f1c94db61e..72f9886b1bd 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog +++ b/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog @@ -1,3 +1,6070 @@ +commit afcae83a064843d71d47624bc162e121cc56c08b +Author: Khaled Hosny +Date: Fri Dec 16 23:14:57 2022 +0200 + + 6.0.0 + + NEWS | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ + configure.ac | 2 +- + docs/harfbuzz-docs.xml | 1 + + meson.build | 2 +- + src/hb-subset-input.cc | 6 ++--- + src/hb-version.h | 8 +++---- + 6 files changed, 72 insertions(+), 9 deletions(-) + +commit 27ff90d7b8c65017334f15f45b5552d4f6fdb128 +Author: Khaled Hosny +Date: Fri Dec 16 22:08:33 2022 +0200 + + [meson] Update freetype2 wrap + + Use the one from WrapDB and add zlib wrap because current FreeType + tarball misses it. + + subprojects/freetype2.wrap | 10 ++++++---- + subprojects/zlib.wrap | 12 ++++++++++++ + 2 files changed, 18 insertions(+), 4 deletions(-) + +commit a98c6fdd92f35c2d176f5c808287a0b568aede48 +Author: Matthias Clasen +Date: Fri Dec 16 14:04:54 2022 -0500 + + Mark an argument as unused + + src/hb-ot-color-colr-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 601d3806c93309ec47c2dc0c53fb36c3b95a3d9d +Author: Matthias Clasen +Date: Fri Dec 16 13:34:15 2022 -0500 + + COLRv1: Revamp extents variation + + Try to do this a cleaner way. + + src/hb-ot-color-colr-table.hh | 60 ++++++++++++++++++++++++++++--------------- + 1 file changed, 39 insertions(+), 21 deletions(-) + +commit 318df8a706b2cd9b8323d8368f2f7d96117c7348 +Author: Khaled Hosny +Date: Fri Dec 16 21:27:37 2022 +0200 + + [meson] Update google-benchmark wrap + + Use the one from WrapDB. + + subprojects/google-benchmark.wrap | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +commit bd7c458028e1dde0cdeb9099279d17bf63f5b3ff +Author: Khaled Hosny +Date: Fri Dec 16 21:01:26 2022 +0200 + + [meson] Update glib wrap + + Use the one from WrapDB. + + .circleci/config.yml | 4 ++-- + subprojects/glib.wrap | 17 +++++++++-------- + 2 files changed, 11 insertions(+), 10 deletions(-) + +commit 51a17201a734616640e8c46bccaa0b26e1caaa27 +Author: Behdad Esfahbod +Date: Fri Dec 16 12:28:30 2022 -0700 + + [open-type] In to_float() take offset as float + + src/hb-open-type.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 9e3bfd9aa169f1ca77d6b1e6227905ee585a4255 +Author: Khaled Hosny +Date: Fri Dec 16 20:10:51 2022 +0200 + + [ci] Build Windows binaries without cairo-ft + + .ci/build-win32.sh | 3 ++- + .ci/build-win64.sh | 3 ++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +commit 6add69a6ec422406727186fdc5a7fcde289cbfbe +Author: Khaled Hosny +Date: Fri Dec 16 19:54:00 2022 +0200 + + [hb-view] Allow building without cairo-ft + + Fixes https://github.com/harfbuzz/harfbuzz/issues/3925 + + meson.build | 3 ++- + util/helper-cairo.hh | 16 ++++++++++++++-- + util/meson.build | 3 +-- + 3 files changed, 17 insertions(+), 5 deletions(-) + +commit f252cf80e194130d26ae3057227dc86dc60f8cb8 +Author: Behdad Esfahbod +Date: Fri Dec 16 12:03:51 2022 -0700 + + [open-type] Allow passing an offset to to_float() + + src/hb-open-type.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6ae35365f89e31dfc6ceeafdc47f302d040ffbf8 +Author: Behdad Esfahbod +Date: Fri Dec 16 11:43:38 2022 -0700 + + Fix build + + src/hb-ot-color-colr-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e957391efe2c00946ddf0586a710a4a4877981df +Author: Behdad Esfahbod +Date: Fri Dec 16 11:33:04 2022 -0700 + + [colr] Add NoVariable::varIdxBase + + src/hb-ot-color-colr-table.hh | 2 ++ + 1 file changed, 2 insertions(+) + +commit e06de98c36200f7c6ff8939bb094960079521820 +Author: Behdad Esfahbod +Date: Fri Dec 16 11:31:00 2022 -0700 + + [var-common] Make VarInstancer take an offset + + src/hb-ot-color-colr-table.hh | 8 ++++---- + src/hb-ot-var-common.hh | 4 ++-- + 2 files changed, 6 insertions(+), 6 deletions(-) + +commit 251f9f62134bf2b7050a4156dad9b0bb0968879f +Author: Behdad Esfahbod +Date: Fri Dec 16 11:29:51 2022 -0700 + + [open-type] Add VarIdx::add() + + src/hb-open-type.hh | 5 +++++ + src/hb-ot-color-colr-table.hh | 10 +++++----- + 2 files changed, 10 insertions(+), 5 deletions(-) + +commit bf2ae3f0ca19c0e18741c39ca19fc2a88d2e972b +Author: Behdad Esfahbod +Date: Fri Dec 16 11:26:24 2022 -0700 + + [open-type] Add static_assert for NO_VARIATION + + src/hb-open-type.hh | 1 + + src/hb-ot-color-colr-table.hh | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +commit d4496e640594ac26cef6f46a6f15f9ee55386eff +Author: Matthias Clasen +Date: Fri Dec 16 12:19:39 2022 -0500 + + COLRv1: Apply variations correctly + + The variations are for xMin, yMin, xMAx, yMax. + Apply them before converting to extents.. + + src/hb-ot-color-colr-table.hh | 26 +++++++++++++++----------- + 1 file changed, 15 insertions(+), 11 deletions(-) + +commit 193e0e3e8efc86215990d4e450ea90b723fda9b0 +Author: Matthias Clasen +Date: Thu Dec 15 00:32:11 2022 -0500 + + Cosmetic: typo fix + + src/hb-font.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit b5acde43ed81f7c212b4a37aa06c3988bce168a1 +Author: Garret Rieger +Date: Tue Dec 13 22:04:19 2022 +0000 + + [subset] check pending/subsetted tag sets for alloc failure. + + src/hb-subset.cc | 7 ++++++- + ...z-testcase-minimized-hb-subset-fuzzer-6164014466203648 | Bin 0 -> 191 bytes + 2 files changed, 6 insertions(+), 1 deletion(-) + +commit 79285a9983983840d60d45220abb4d50cf08be05 +Author: Jordan Petridis <16531710+alatiera@users.noreply.github.com> +Date: Tue Dec 13 20:14:20 2022 +0200 + + VarC: cast ints (#3934) + + msvc is rightfully complaining that the types on the sides of + the ternary are not matching: + + ``` + C:\pango\subprojects\harfbuzz\src\OT\glyf\VarCompositeGlyph.hh(317): error C2446: ':': no conversion from 'const OT::HBUINT16' to 'const OT::HBUINT8' + ``` + + src/OT/glyf/VarCompositeGlyph.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 300d82ce2ef1f30d8c9cd839801fe3b429c78d45 +Author: Behdad Esfahbod +Date: Tue Dec 13 10:48:56 2022 -0700 + + Fix compiler warning + + src/hb-ot-layout-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 199345eb29ed821fed300b53000ced1d245c6ef2 +Merge: bd7cb384c 4e9a6cfb4 +Author: Behdad Esfahbod +Date: Mon Dec 12 18:37:10 2022 -0700 + + Merge pull request #3928 from harfbuzz/colrv1-extents + + COLRv1: use ClipBoxes for extents + +commit bd7cb384cf73cb88e3121f3b7ab89ce50a64e5bd +Author: Behdad Esfahbod +Date: Mon Dec 12 14:10:13 2022 -0700 + + [VarC] Remove unused variable + + src/OT/glyf/VarCompositeGlyph.hh | 2 -- + 1 file changed, 2 deletions(-) + +commit 51d3ce39bab6270568706ef92d0f55d6d171ab2e +Merge: 1b278c765 64cbe8b96 +Author: Behdad Esfahbod +Date: Mon Dec 12 14:07:44 2022 -0700 + + Merge pull request #3933 from googlefonts/cff + + [subset] Fix infinite loop when instancing CFF fonts + +commit 1b278c76580351e52c98b7c8ffa22933cd25a59c +Author: Behdad Esfahbod +Date: Mon Dec 12 13:57:05 2022 -0700 + + [VarC] Update for new format + + https://github.com/harfbuzz/boring-expansion-spec/issues/71 + + src/OT/glyf/VarCompositeGlyph.hh | 134 ++++++++++++++++++++++++++++++--------- + 1 file changed, 103 insertions(+), 31 deletions(-) + +commit 64cbe8b96273ef2268111c03950610efe3f6e5e5 +Author: Garret Rieger +Date: Mon Dec 12 20:41:40 2022 +0000 + + [subset] Also note that only full instancing works. + + src/hb-subset-input.cc | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 0da59f86a8b33672a3da31e3e2c4bf62fd4cac24 +Author: Garret Rieger +Date: Mon Dec 12 20:26:11 2022 +0000 + + [subset] note that CFF/CFF2 instancing is not yet supported. + + src/hb-subset-input.cc | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 9fbe52b88d07557197191b8080bdd591de4318b6 +Author: Garret Rieger +Date: Mon Dec 12 20:24:24 2022 +0000 + + [subset] enable instancing tests by default. + + test/subset/data/Makefile.sources | 8 ++++---- + test/subset/generate-expected-outputs.py | 1 - + test/subset/meson.build | 15 ++++----------- + util/hb-subset.cc | 4 ---- + 4 files changed, 8 insertions(+), 20 deletions(-) + +commit 38a962888512da088eb35ddee4f58c2a06392b73 +Author: Garret Rieger +Date: Mon Dec 12 20:13:17 2022 +0000 + + [subset] simplify handling of table subsetting depedencies. + + Allow the dependency checker to see all tables that will be subset. Use this to fix the HMTX/VMTX dep check against glyf. Don't delay hmtx/vmtx subsetting if no glyf table is present. + + src/hb-subset.cc | 75 ++++++++++++++++++++++++++++++-------------------------- + 1 file changed, 40 insertions(+), 35 deletions(-) + +commit 0853e5d9d7bd15fc7782b111dcf9815d25c6d031 +Author: Garret Rieger +Date: Mon Dec 12 19:43:31 2022 +0000 + + [subset] if table dependencies can't be resolved fail the subset. + + Avoids getting stuck in an infinite loop. + + src/hb-subset.cc | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 6bb478eeeb665ddb1801a424679644b5b2b6c9e1 +Author: Behdad Esfahbod +Date: Mon Dec 12 11:39:06 2022 -0700 + + [VarC] Clamp after addition + + src/OT/glyf/VarCompositeGlyph.hh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 80a5011eb654275920aed8c08731b75e1a9a7bc9 +Author: Behdad Esfahbod +Date: Mon Dec 12 11:37:59 2022 -0700 + + [VarC] Fix coord setting + + Those are additive. + + src/OT/glyf/VarCompositeGlyph.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 4e9a6cfb49841d2293883a08e0aaae8481fbc27b +Author: Behdad Esfahbod +Date: Mon Dec 12 10:20:51 2022 -0700 + + [COLR] Use VarStoreInstancer + + src/hb-ot-color-colr-table.hh | 35 ++++++++++++++++------------------- + src/hb-ot-var-common.hh | 2 ++ + 2 files changed, 18 insertions(+), 19 deletions(-) + +commit a3a3d37b952201265b9f17e1ef58d1127f617210 +Author: Behdad Esfahbod +Date: Mon Dec 12 10:17:20 2022 -0700 + + [var] Add VarStoreInstancer + + src/hb-ot-var-common.hh | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +commit c64661b2f856341c399eea5bff10fca35db57f6b +Author: Behdad Esfahbod +Date: Mon Dec 12 10:11:02 2022 -0700 + + [COLR] Fix variation code + + src/hb-ot-color-colr-table.hh | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +commit ff332b14eae0ac122d7cfea90fb7d98e107dea92 +Author: Behdad Esfahbod +Date: Sun Dec 11 21:05:14 2022 -0700 + + [COLR] Handle HB_OT_LAYOUT_NO_VARIATIONS_INDEX + + src/hb-ot-color-colr-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 9a3f0be2911388e65e1e037e1c40ccfddc8b10bf +Author: Behdad Esfahbod +Date: Sun Dec 11 13:40:53 2022 -0700 + + [COLR] Apply variations in get_extent + + src/hb-ot-color-colr-table.hh | 36 +++++++++++++++++++++++++++++------- + src/hb-ot-layout-common.hh | 8 ++++++++ + 2 files changed, 37 insertions(+), 7 deletions(-) + +commit 68964efa553e77e0867777f4c4bfa5e962a9bda6 +Author: Behdad Esfahbod +Date: Sun Dec 11 13:21:01 2022 -0700 + + [COLR] Use bsearch in get_extents + + src/hb-ot-color-colr-table.hh | 11 ++++++++--- + src/hb-static.cc | 2 ++ + 2 files changed, 10 insertions(+), 3 deletions(-) + +commit d0ee5a452f057386d5dbffef1e8f7912fec8537c +Author: Behdad Esfahbod +Date: Sun Dec 11 13:13:35 2022 -0700 + + [COLR] Return false from get_extents if table version not 1 + + src/hb-ot-color-colr-table.hh | 2 ++ + 1 file changed, 2 insertions(+) + +commit b3d6a5ef8644f7531e320fcfb98971ae56718c9a +Author: Behdad Esfahbod +Date: Sun Dec 11 13:04:24 2022 -0700 + + [colr] Minor no behavior change + + src/hb-ot-color-colr-table.hh | 21 +++++++++------------ + 1 file changed, 9 insertions(+), 12 deletions(-) + +commit 7a748ad4acacd76b8c6285eab013a68813027997 +Author: Matthias Clasen +Date: Sat Dec 10 19:59:03 2022 -0500 + + COLRv1: use ClipBoxes for extents + + This is a first step; ultimatively, we + should compute the extents is ClipBoxes + are missing. + + src/hb-ot-color-colr-table.hh | 49 +++++++++++++++++++++++++++++++++++++++++++ + src/hb-ot-font.cc | 4 ++++ + 2 files changed, 53 insertions(+) + +commit d36a0f8c422cdabd5bb931a048a4c8515cd8b33d +Author: Behdad Esfahbod +Date: Sun Dec 11 13:12:19 2022 -0700 + + [COLR] Add TODO + + src/hb-ot-color-colr-table.hh | 1 + + 1 file changed, 1 insertion(+) + +commit a3068206817c7df57dc13b7c7b48a3e1c538fada +Author: Behdad Esfahbod +Date: Sun Dec 11 13:03:55 2022 -0700 + + [colr] Use SortedArray instead of Array + + src/hb-ot-color-colr-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit b9d5e7a8bbc15ffdffd2a00c2ca8497cbed4d85a +Author: Behdad Esfahbod +Date: Sun Dec 11 12:54:19 2022 -0700 + + [colr] Set HB_COLRV1_MAX_NESTING_LEVEL to 16 + + Was 100. That seemed excessive. + + src/hb-ot-color-colr-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c17afa48deb932650cb6748328cbfe3b95c7126d +Author: Behdad Esfahbod +Date: Sun Dec 11 12:53:55 2022 -0700 + + [colr] Remove COLRV1_ENABLE_SUBSETTING + + src/hb-ot-color-colr-table.hh | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +commit 9ab2c8034ee137e84749b9aa2c197b2acec206aa +Author: Behdad Esfahbod +Date: Sun Dec 11 12:00:54 2022 -0700 + + Revert "[glyf] Use component phantom points after transformation" + + This reverts commit a756bd1944404da6e53173c4061a2aef262e60f3. + + Fixes https://github.com/harfbuzz/harfbuzz/issues/3929 + + src/OT/glyf/Glyph.hh | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +commit 7f73b57bc1a64438b9a57e866a9ad055b7ef7f23 +Author: Behdad Esfahbod +Date: Sat Dec 10 17:35:52 2022 -0700 + + [subset] Graduate L1 instancing API from experimental + + Fixes https://github.com/harfbuzz/harfbuzz/issues/3926 + + docs/harfbuzz-sections.txt | 4 ++-- + perf/benchmark-subset.cc | 4 ---- + src/gen-def.py | 2 -- + src/hb-subset-input.cc | 6 ++---- + src/hb-subset.h | 4 ---- + 5 files changed, 4 insertions(+), 16 deletions(-) + +commit 0f4e38cd865afedcb03ebc955f7c6e072415a09c +Author: Khaled Hosny +Date: Sat Dec 10 16:39:26 2022 +0200 + + [subset] Small doc fixes + + src/hb-subset-input.cc | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit bf2e8175491126f7b7f471fb9739e84c623c8d2d +Author: Behdad Esfahbod +Date: Fri Dec 9 23:15:26 2022 -0700 + + [VarComposites] Support GID24 + + src/OT/glyf/VarCompositeGlyph.hh | 36 ++++++++++++++++++++++-------------- + 1 file changed, 22 insertions(+), 14 deletions(-) + +commit 8c641eeefb88659bf88a28dcd9cd7cf52aeb1d35 +Merge: e66d02126 10d38dcdf +Author: Behdad Esfahbod +Date: Fri Dec 9 19:43:47 2022 -0700 + + Merge pull request #3841 from harfbuzz/varc + + [glyf] VariableComposites + +commit 10d38dcdfd7e0b62f35ac5ff1d6cdf9ce1a78cc2 +Author: Behdad Esfahbod +Date: Fri Dec 9 19:19:57 2022 -0700 + + [varc] Change format slightly + + Fixes https://github.com/harfbuzz/boring-expansion-spec/issues/70 + + src/OT/glyf/VarCompositeGlyph.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit af450a757d8471e55b71d1f3eb3c1e1fd3390d7b +Author: Behdad Esfahbod +Date: Fri Dec 9 19:05:16 2022 -0700 + + [config] Use HB_EXPERIMENTAL_API instead of adhoc HB_EXPERIMENTAL + + src/hb-config.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5cf0b9ae7d21cdce0c822ac1f6fb8de1e922aed8 +Author: Behdad Esfahbod +Date: Fri Dec 9 18:59:43 2022 -0700 + + [varc] Mark as experimental feature with HB_NO_VAR_COMPOSITES + + src/OT/glyf/Glyph.hh | 4 ++++ + src/hb-config.hh | 1 + + 2 files changed, 5 insertions(+) + +commit 82b4f3791e1348273ebc8c13d410638842eef833 +Author: Behdad Esfahbod +Date: Fri Dec 9 18:45:37 2022 -0700 + + [coord-setter] Don't modify font coords + + src/OT/glyf/Glyph.hh | 4 ++-- + src/OT/glyf/coord-setter.hh | 33 +++++++++------------------------ + 2 files changed, 11 insertions(+), 26 deletions(-) + +commit e9e503b80bba01d42b0987bab4dc240db6368e8f +Author: Behdad Esfahbod +Date: Fri Dec 9 18:42:46 2022 -0700 + + [Glyph] Pass down coords to get_points + + src/OT/glyf/Glyph.hh | 29 ++++++++++++++++++++++++----- + 1 file changed, 24 insertions(+), 5 deletions(-) + +commit 8e46870093fe9c214679370bdf34dbd67f388d18 +Author: Behdad Esfahbod +Date: Fri Dec 9 18:35:30 2022 -0700 + + [gvar] Take coords in instead of font in apply_deltas_to_points + + src/OT/glyf/Glyph.hh | 4 +++- + src/hb-ot-var-gvar-table.hh | 6 +++--- + 2 files changed, 6 insertions(+), 4 deletions(-) + +commit 3caa42a4a7b4879162d19273441c2cc8b44e3142 +Author: Behdad Esfahbod +Date: Fri Dec 9 14:48:41 2022 -0700 + + Fix build after rebase + + src/OT/glyf/Glyph.hh | 2 +- + src/OT/glyf/VarCompositeGlyph.hh | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit bbe59e4211c6dbff929320c7a4332289353cf666 +Author: Behdad Esfahbod +Date: Thu Dec 8 16:04:19 2022 -0700 + + Whitespace + + src/OT/glyf/Glyph.hh | 2 -- + 1 file changed, 2 deletions(-) + +commit 13deea7cbd5becb0746585177b9d67e0a52516e7 +Author: Behdad Esfahbod +Date: Tue Oct 18 13:38:12 2022 -0600 + + [glyf/VarComposite] Clamp axis coordinates + + src/OT/glyf/VarCompositeGlyph.hh | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit a975be4c072b4370ee5efad5409b0b88e818259d +Author: Behdad Esfahbod +Date: Tue Oct 18 11:00:35 2022 -0600 + + [glyf/VarComposite] Minor rename + + src/OT/glyf/Glyph.hh | 2 +- + src/OT/glyf/VarCompositeGlyph.hh | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit 1e71db2d264ebf9d86a43dc3378b653b8e5907ea +Author: Behdad Esfahbod +Date: Tue Oct 18 10:47:32 2022 -0600 + + [glyf/VarComposite] Fix transformation + + src/OT/glyf/VarCompositeGlyph.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 1233be61d89b876dee6901137a02b4d7ee7a0e13 +Author: Behdad Esfahbod +Date: Mon Oct 17 14:06:44 2022 -0600 + + [glyf/VarComposite] Remove unneeded resize + + src/OT/glyf/Glyph.hh | 1 - + 1 file changed, 1 deletion(-) + +commit 1a906162cb5d2445975cc571bc808e025f31b5d1 +Author: Behdad Esfahbod +Date: Mon Oct 17 14:01:34 2022 -0600 + + [glyf/coord-setter] Fix memory issue + + src/OT/glyf/coord-setter.hh | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 7efd68da390f5cd125a1dd3a187ae28bbfb282e0 +Author: Behdad Esfahbod +Date: Mon Oct 17 13:05:22 2022 -0600 + + [glyf/VarComposite] Set coordinates + + Code is untested but complete! + + src/OT/glyf/Glyph.hh | 3 ++- + src/OT/glyf/VarCompositeGlyph.hh | 16 ++++++++++++++++ + 2 files changed, 18 insertions(+), 1 deletion(-) + +commit 4ec77814978b675d0aa74e869c24abc8b5270678 +Author: Behdad Esfahbod +Date: Mon Oct 17 12:53:58 2022 -0600 + + [glyf] Move coord-setter to its own file + + src/Makefile.sources | 1 + + src/OT/glyf/Glyph.hh | 29 +------------------------- + src/OT/glyf/VarCompositeGlyph.hh | 1 + + src/OT/glyf/coord-setter.hh | 45 ++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 48 insertions(+), 28 deletions(-) + +commit dadb4ed71de2da768ee4f07a3b595181813fb0f4 +Author: Behdad Esfahbod +Date: Mon Oct 17 12:48:24 2022 -0600 + + [glyf/VarComposite] More, almost there + + src/OT/glyf/Glyph.hh | 18 ++++++++----- + src/OT/glyf/VarCompositeGlyph.hh | 58 +++++++++++++++++++++++++++++++++------- + 2 files changed, 60 insertions(+), 16 deletions(-) + +commit 0a939b48a60bc5b5cae0d3a5774218f1143b6759 +Author: Behdad Esfahbod +Date: Mon Oct 17 12:12:40 2022 -0600 + + [glyf/VarComposite] Implement more + + src/OT/glyf/Glyph.hh | 49 +++++++++++++++++++++++++++++++++++++--- + src/OT/glyf/VarCompositeGlyph.hh | 8 +++++-- + 2 files changed, 52 insertions(+), 5 deletions(-) + +commit 65cc3b5e2b2181e82836c85ea060b2bd8c59ff49 +Author: Behdad Esfahbod +Date: Thu Oct 13 17:11:12 2022 -0600 + + [glyf/VarComposite] More + + src/OT/glyf/VarCompositeGlyph.hh | 24 ++++++++++++++++++------ + 1 file changed, 18 insertions(+), 6 deletions(-) + +commit 12688ed3865fcbfcd34dd5c1c4ab3ca3bfc63e42 +Author: Behdad Esfahbod +Date: Thu Oct 13 17:06:07 2022 -0600 + + [glyf] Fix distcheck + + src/Makefile.sources | 2 ++ + 1 file changed, 2 insertions(+) + +commit 60d959a6e7b73ce6492fb1b49b91aefe81ad99a5 +Author: Behdad Esfahbod +Date: Thu Oct 13 14:15:36 2022 -0600 + + [glyf/VarComposite] Add use_my_metrics() + + src/OT/glyf/VarCompositeGlyph.hh | 2 ++ + 1 file changed, 2 insertions(+) + +commit 575d99406a5e40eab04b9d6c5c3a970b674b1753 +Author: Behdad Esfahbod +Date: Thu Oct 13 13:12:26 2022 -0600 + + [glyf] Flesh out VarCompositeGlyph + + src/OT/glyf/VarCompositeGlyph.hh | 218 +++++++++++++++++++++++---------------- + src/hb-open-type.hh | 3 + + 2 files changed, 132 insertions(+), 89 deletions(-) + +commit 21f671bc453ba42b03402774a7e07fa0d3733099 +Author: Behdad Esfahbod +Date: Thu Oct 13 11:25:29 2022 -0600 + + [glyf] Add stub VarCompositeGlyph + + src/OT/glyf/Glyph.hh | 1 + + src/OT/glyf/VarCompositeGlyph.hh | 157 +++++++++++++++++++++++++++++++++++++++ + 2 files changed, 158 insertions(+) + +commit 435c5eeffec54fe48e190699532ec063c0a12c3a +Author: Behdad Esfahbod +Date: Thu Oct 13 10:54:58 2022 -0600 + + [glyf] Split composite-iter + + src/OT/glyf/CompositeGlyph.hh | 51 ++------------------------------ + src/OT/glyf/composite-iter.hh | 68 +++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 70 insertions(+), 49 deletions(-) + +commit 1024a013fd62eddc65c092f6fb2ff2fae176a618 +Author: Behdad Esfahbod +Date: Mon Aug 22 09:49:30 2022 -0600 + + [glyf] Add CoordSetter + + src/OT/glyf/Glyph.hh | 32 +++++++++++++++++++++++++++++++- + 1 file changed, 31 insertions(+), 1 deletion(-) + +commit e66d02126e876ab01d0dacd1f22540106a27d7ec +Author: Garret Rieger +Date: Thu Dec 8 22:56:07 2022 +0000 + + [subset] replace subset-processing.md reference with link to it on github. + + src/hb-subset-input.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 27201ed32b37d3956b15859e76db1be4ab32d7d5 +Author: Garret Rieger +Date: Thu Dec 8 22:48:27 2022 +0000 + + [subset] fix up hb_subset_preprocess api comment. + + docs/harfbuzz-sections.txt | 2 +- + docs/subset-preprocessing.md | 2 +- + src/hb-subset-input.cc | 8 +++++--- + 3 files changed, 7 insertions(+), 5 deletions(-) + +commit 13b038835122c6eba53db15d33a02f898ce369a3 +Author: Garret Rieger +Date: Wed Dec 7 22:53:44 2022 +0000 + + [subset] link to preprocessing doc from api comment. + + docs/subset-preprocessing.md | 6 ++++-- + src/hb-subset-input.cc | 2 ++ + 2 files changed, 6 insertions(+), 2 deletions(-) + +commit c097abab52c51568f40b443576dbe030ff3cae89 +Author: Garret Rieger +Date: Wed Dec 7 22:50:09 2022 +0000 + + [subset] set no prune unicode ranges flag in preprocessor. + + To avoid modifying the original unicode range values in the source font. + + src/hb-subset-input.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 8c021462e6a7c52beb20906b595be52d526d5976 +Author: Garret Rieger +Date: Wed Dec 7 22:44:50 2022 +0000 + + [subset] Add short document on subset preprocessing. + + docs/subset-preprocessing.md | 226 +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 226 insertions(+) + +commit bc87fe952e62624464933913bcba5874b49379a9 +Author: Garret Rieger +Date: Wed Dec 7 21:43:14 2022 +0000 + + [subset] add note about memory management with preprocessed faces. + + src/hb-subset-input.cc | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 5e713e99bf5121a7d0cd2341c40db3d79bd09879 +Author: Garret Rieger +Date: Mon Dec 5 23:57:57 2022 +0000 + + Revert "[map] Speed up is_real()" + + This reverts commit f5307c3ba8401fbaf9008705d7f8dfa7d28e944c. + + Found to slow down the benchmarks in some cases. + + src/hb-map.hh | 15 ++++++--------- + 1 file changed, 6 insertions(+), 9 deletions(-) + +commit eda02c2ebd6527f9072e3488ef8c675e4d85a720 +Author: Garret Rieger +Date: Mon Dec 5 20:18:41 2022 +0000 + + [subset] Move hb_subset_preprocess to be non-experimental. + + perf/benchmark-subset.cc | 4 ---- + src/gen-def.py | 1 - + src/hb-subset-input.cc | 6 ++---- + src/hb-subset.h | 7 +++---- + test/subset/run-tests.py | 11 ++++++++--- + util/hb-subset.cc | 4 ---- + 6 files changed, 13 insertions(+), 20 deletions(-) + +commit 76d5482a7c6bfc1b10de0b925c229a9cdd220977 +Author: Garret Rieger +Date: Mon Dec 5 19:40:49 2022 +0000 + + [subset] always return a valid face from hb_subset_preprocess. + + src/hb-subset-input.cc | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit a80cae445369ad7feafbca2398601238df8e7e65 +Author: Khaled Hosny +Date: Thu Dec 8 11:17:47 2022 +0200 + + [doc] Add missing symbols to harfbuzz-sections.txt + + docs/harfbuzz-sections.txt | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 41edf95893f616c8a518f4853aba6f28c423d056 +Author: Khaled Hosny +Date: Thu Dec 8 11:01:04 2022 +0200 + + [doc] Fix sorting + + * Keep setters and getters together, with setters first. + * Keep common functions at the top and in a predictable order. + * Put callback functions right above their setters. + + Fixes https://github.com/harfbuzz/harfbuzz/issues/3352 + + docs/harfbuzz-sections.txt | 411 ++++++++++++++++++++++----------------------- + 1 file changed, 205 insertions(+), 206 deletions(-) + +commit 35233d2514cc202e9e2f8f94b3102cb620a0d403 +Author: Garret Rieger +Date: Wed Dec 7 00:47:28 2022 +0000 + + [repacker] fix fuzzer reported stack overflow. + + Fixes https://oss-fuzz.com/testcase-detail/6014493291577344. + + src/graph/graph.hh | 5 +++++ + src/hb-repacker.hh | 8 ++++++++ + ...testcase-minimized-hb-repacker-fuzzer-6014493291577344 | Bin 0 -> 921 bytes + 3 files changed, 13 insertions(+) + +commit b17fbc200bee7b1898862bdb13e46387d0057b38 +Author: Garret Rieger +Date: Mon Dec 5 20:34:51 2022 +0000 + + [repacker] use memcpy to avoid alignment issues. + + test/fuzzing/hb-repacker-fuzzer.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f1d3489388a48a2dcde35bb1872abd1d7aafa192 +Author: Garret Rieger +Date: Mon Dec 5 19:33:15 2022 +0000 + + [repacker] bail on failure to alloc assigned_bytes set. + + Fixes fuzzer issue https://oss-fuzz.com/testcase-detail/5390364397928448. + + src/graph/graph.hh | 3 ++- + ...testcase-minimized-hb-repacker-fuzzer-5390364397928448 | Bin 0 -> 423 bytes + 2 files changed, 2 insertions(+), 1 deletion(-) + +commit 239a5aca022926d89291701ad9547ac4477c86d6 +Author: Garret Rieger +Date: Mon Dec 5 19:15:36 2022 +0000 + + [repacker] don't allow references to the null object in graph. + + Fixes fuzzer issue https://oss-fuzz.com/testcase-detail/6714085985353728 + + src/graph/graph.hh | 7 ++++--- + ...tcase-minimized-hb-repacker-fuzzer-6714085985353728 | Bin 0 -> 358596 bytes + 2 files changed, 4 insertions(+), 3 deletions(-) + +commit 4ce0f088978b20b8ef431426faa16dee253a5ea0 +Author: Behdad Esfahbod +Date: Mon Oct 31 12:20:19 2022 -0600 + + [coretext] Clamp variation settings to min/max + + Like our native implementation does; CoreText doesn't itself. + + Also fix leak of CFNumber's. + + src/hb-coretext.cc | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +commit 1b867530314e8efe3a67377ac25b04ca2e71e90e +Author: Behdad Esfahbod +Date: Mon Dec 5 11:44:52 2022 -0700 + + [hb-subset] Support -u, -g, -t + + For --unicodes, --gids, --text. + + util/hb-subset.cc | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 22b0390e2dcefcf737d70f8d965d99b902831a29 +Author: Behdad Esfahbod +Date: Mon Dec 5 09:43:36 2022 -0700 + + Revert "[VarData] Don't clear memory we are going to fill in completely" + + This reverts commit e28e2dad03a453c5e5c4c5a9d6fd276182c5f80b. + + This made fuzzer unhappy. I'm not sure how. + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54044 + + src/hb-ot-layout-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 3c497e2458d358748d0e85f5e3afb9d9e33e717c +Author: Behdad Esfahbod +Date: Sun Dec 4 15:35:01 2022 -0700 + + [harfbuzz-subset.cc] Revert accidental change + + These extra files are unnecessary, but our generator currently + isn't smart enough to know that. Will fix some time. + + src/harfbuzz-subset.cc | 40 ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 40 insertions(+) + +commit aa7f5e3742bc737f727a3c62a9884ed12cdb87fa +Author: Behdad Esfahbod +Date: Sun Dec 4 15:31:47 2022 -0700 + + [subset] Conditionalize call to hb_font_set_variations + + src/OT/glyf/glyf.hh | 2 ++ + src/harfbuzz-subset.cc | 40 ---------------------------------------- + src/hb-subset-plan.cc | 2 ++ + 3 files changed, 4 insertions(+), 40 deletions(-) + +commit ad5588e80046ea2f5108d21c583a1ecf12efeb82 +Author: Behdad Esfahbod +Date: Sun Dec 4 15:27:59 2022 -0700 + + [config] If HB_NO_SHAPER then HB_NO_OT_SHAPE + + src/hb-config.hh | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 1a5c749581a9d7d19ab94250599c6e2700660fee +Author: Behdad Esfahbod +Date: Sun Dec 4 15:20:51 2022 -0700 + + [config] Flesh out HB_NO_SHAPER a bit more + + src/hb-face.cc | 2 ++ + src/hb-face.hh | 2 ++ + src/hb-shape-plan.cc | 5 +++++ + src/hb-shape.cc | 5 +++++ + 4 files changed, 14 insertions(+) + +commit 2c0abf02580ba109abcd6fb1da890f8b7500a9b1 +Author: Behdad Esfahbod +Date: Sun Dec 4 15:03:36 2022 -0700 + + Revert "[harfbuzz-subset.cc] Trim down!" + + This reverts commit a335458d5776135f8672bfc98681b8862f657d5c. + + While this can be vastly trimmed down, what I did is not right. + It still depends on hb-face, hb-font, hb-blob, hb-set, and hb-map. + + src/harfbuzz-subset.cc | 45 +++++++++++++++++++++++++++++++++++++++++++++ + src/meson.build | 2 +- + 2 files changed, 46 insertions(+), 1 deletion(-) + +commit a335458d5776135f8672bfc98681b8862f657d5c +Author: Behdad Esfahbod +Date: Sun Dec 4 14:56:20 2022 -0700 + + [harfbuzz-subset.cc] Trim down! + + src/harfbuzz-subset.cc | 45 --------------------------------------------- + src/meson.build | 2 +- + 2 files changed, 1 insertion(+), 46 deletions(-) + +commit 765a3551da9c05ad6b2868a703ddf50fd84630cd +Author: Behdad Esfahbod +Date: Sun Dec 4 14:48:32 2022 -0700 + + [face-builder] Minor cast + + src/hb-face.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 3fff6d9084e92642f4e13e54e9720c682d5d2bc5 +Author: Behdad Esfahbod +Date: Sun Dec 4 14:47:38 2022 -0700 + + [face-builder] Initialize face orders to -1 + + src/hb-face.cc | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 805ce9ad3d3254e4b8dde113cdf914aebb533482 +Author: Behdad Esfahbod +Date: Sun Dec 4 14:43:17 2022 -0700 + + [face-builer] Protect against wrong face + + In hb_face_builder_sort_tables. + + src/hb-face.cc | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit 0acfd2b714ad15167c882c1c5be3a650db24e748 +Author: Behdad Esfahbod +Date: Sun Dec 4 14:01:05 2022 -0700 + + [indic-machine] Regenerate line numbers + + src/hb-ot-shaper-indic-machine.hh | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +commit 9704f8354e92c86aaaec7dc736463091e421b03c +Merge: 0545949f0 c1aae14a6 +Author: Behdad Esfahbod +Date: Sun Dec 4 13:58:52 2022 -0700 + + Merge branch 'config-header' + +commit c1aae14a68eaea92c4de20e372cfca05c66c50b1 +Author: Behdad Esfahbod +Date: Sun Dec 4 13:53:55 2022 -0700 + + [features.h] Fix autotools build rules + + src/Makefile.am | 18 ++++++++++-------- + 1 file changed, 10 insertions(+), 8 deletions(-) + +commit 0545949f018cf48743052de878bfabbb95b4d1d6 +Author: Behdad Esfahbod +Date: Sun Dec 4 12:44:09 2022 -0700 + + [gvar] Minor use array get_size() + + src/hb-ot-var-gvar-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 1bd386515c603a1e77291f77e50dc7cb3437dbcd +Author: Behdad Esfahbod +Date: Sun Dec 4 12:29:23 2022 -0700 + + [bit-set] Micro-optimize page_for + + src/hb-bit-set.hh | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit b182e2808af51a04b72951781fe21c3e2301e827 +Author: Behdad Esfahbod +Date: Sun Dec 4 12:22:17 2022 -0700 + + [bit-set] Don't clear pages when copying set + + src/hb-bit-set.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit f5307c3ba8401fbaf9008705d7f8dfa7d28e944c +Author: Behdad Esfahbod +Date: Sun Dec 4 11:54:16 2022 -0700 + + [map] Speed up is_real() + + src/hb-map.hh | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +commit 301f6e4b47f0ce40758a773cc351f98564eda02c +Author: Behdad Esfahbod +Date: Sun Dec 4 11:46:10 2022 -0700 + + [Coverage] Remove TODO + + src/OT/Layout/Common/CoverageFormat2.hh | 2 -- + 1 file changed, 2 deletions(-) + +commit dbbb8e8006ea71519546105f229ce635105bf855 +Author: Behdad Esfahbod +Date: Sun Dec 4 11:13:39 2022 -0700 + + Revert "[map] Add hb_map_filter_invalid" + + This reverts commit 8d7e92111786b21906157127c24b72b1e444e6e7. + + Surprisingly this slowed NotoNastaliqUrdu benchmark down by a couple + percent instead of speeding it up. + + src/OT/Layout/Common/Coverage.hh | 2 +- + src/hb-map.hh | 2 -- + 2 files changed, 1 insertion(+), 3 deletions(-) + +commit 8d7e92111786b21906157127c24b72b1e444e6e7 +Author: Behdad Esfahbod +Date: Sun Dec 4 11:01:45 2022 -0700 + + [map] Add hb_map_filter_invalid + + Use it in one place. + + src/OT/Layout/Common/Coverage.hh | 2 +- + src/hb-map.hh | 2 ++ + 2 files changed, 3 insertions(+), 1 deletion(-) + +commit 260df1fa326c6c19d35e030f78d24e2342cb7370 +Author: David Corbett +Date: Sun Dec 4 12:25:22 2022 -0500 + + [indic] Support + + src/gen-indic-table.py | 11 +- + src/hb-ot-shaper-indic-machine.hh | 610 +++++++++++---------- + src/hb-ot-shaper-indic-machine.rl | 3 +- + src/hb-ot-shaper-indic-table.cc | 7 +- + src/hb-ot-shaper-indic.cc | 14 +- + .../5f73fff1ffc07b5a99a90c0909609f2b09fef274.ttf | Bin 0 -> 1028 bytes + .../data/in-house/tests/indic-special-cases.tests | 2 + + 7 files changed, 349 insertions(+), 298 deletions(-) + +commit 8b533763c07f565c1b31505351bf3b51088a62a3 +Author: Behdad Esfahbod +Date: Sat Dec 3 15:58:12 2022 -0700 + + Use hb_len() instead of .len() + + src/hb-open-type.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit e28e2dad03a453c5e5c4c5a9d6fd276182c5f80b +Author: Behdad Esfahbod +Date: Sat Dec 3 15:56:43 2022 -0700 + + [VarData] Don't clear memory we are going to fill in completely + + src/hb-ot-layout-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 0e13b4abbc90574fb3a2c7c87070fc3908b7d4ea +Author: Behdad Esfahbod +Date: Sat Dec 3 15:50:24 2022 -0700 + + [VarData] Optimize main loop slightly + + src/hb-ot-layout-common.hh | 19 ++++++++++--------- + 1 file changed, 10 insertions(+), 9 deletions(-) + +commit ad17c0acce14995bcbd67ff18532c6c4283ff9d0 +Author: Behdad Esfahbod +Date: Sat Dec 3 14:56:57 2022 -0700 + + [VarData] Whitespace + + src/hb-ot-layout-common.hh | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit e7eb445d29076f4d5cf9d7d7d09d40288eaf9186 +Author: Behdad Esfahbod +Date: Sat Dec 3 14:56:00 2022 -0700 + + [VarData] Optimize longWord calculation + + src/hb-ot-layout-common.hh | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +commit f2c980be2998a909486a4a40515763a57b03846b +Author: Behdad Esfahbod +Date: Sat Dec 3 14:49:38 2022 -0700 + + [VarData] Optimize wordCount calculation + + 6% speedup in RobotoFlex-Variable/900 benchmark. + + src/hb-ot-layout-common.hh | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 3641b0e01ec46a06cd684c48262680ac74194393 +Author: Behdad Esfahbod +Date: Sat Dec 3 14:26:21 2022 -0700 + + [VarData] Optimize serialize() + + src/hb-ot-layout-common.hh | 39 +++++++++++++++++++++++++++++++-------- + 1 file changed, 31 insertions(+), 8 deletions(-) + +commit e155f1230702afb6b81b2c2901087945e5d4d249 +Author: Behdad Esfahbod +Date: Sat Dec 3 14:14:39 2022 -0700 + + [VarData] Minor save a variable + + src/hb-ot-layout-common.hh | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 5596a7308752b619d9417735c8f8718b09ec9a34 +Author: Behdad Esfahbod +Date: Sat Dec 3 13:33:48 2022 -0700 + + [layout] Speed up ClassDefFormat2 intersects + + src/hb-ot-layout-common.hh | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +commit 85e7263b38db4a42c56cb7e7d81564576e5607a5 +Author: Behdad Esfahbod +Date: Sat Dec 3 13:28:02 2022 -0700 + + [VariationStore] Minor access array directly + + src/hb-ot-layout-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 41a8597f38b7ebcad3c599105f12104e106d5873 +Author: Behdad Esfahbod +Date: Sat Dec 3 13:23:26 2022 -0700 + + [layout] Simplify CoverageFormat2 intersects_coverage() + + src/OT/Layout/Common/CoverageFormat2.hh | 18 +++--------------- + 1 file changed, 3 insertions(+), 15 deletions(-) + +commit 1f4d8ccaedfce035567f43fbb47597151bdf89a6 +Author: Behdad Esfahbod +Date: Sat Dec 3 13:17:15 2022 -0700 + + [CoverageFormat2] Optimize intersects() + + src/OT/Layout/Common/CoverageFormat2.hh | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit c482b061081a77e8ca085ade01c951406c5d554d +Author: Behdad Esfahbod +Date: Sat Dec 3 13:14:31 2022 -0700 + + [gpos] Optimize PairPosFormat1::intersects + + src/OT/Layout/GPOS/PairPosFormat1.hh | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +commit 58e9df132fd5db88667bb71a7538358d4109ce33 +Author: Behdad Esfahbod +Date: Sat Dec 3 13:04:00 2022 -0700 + + [Device] Serialize VariationDevice zerocopy + + src/hb-ot-layout-common.hh | 1 + + 1 file changed, 1 insertion(+) + +commit 071a2bb4f7e433eabb21e38cd560cc4dcfacab7d +Author: Behdad Esfahbod +Date: Sat Dec 3 13:03:38 2022 -0700 + + [serialize] Support zerocopy while sharing + + src/hb-serialize.hh | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +commit 44a5de3a97c6092547d4994c7b10922fbdce15b8 +Author: Behdad Esfahbod +Date: Sat Dec 3 12:50:32 2022 -0700 + + [Device] Save a snap/revert + + src/hb-ot-layout-common.hh | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +commit 93328cedfc6e55e78f86db1026f4f1b98dd84501 +Author: Behdad Esfahbod +Date: Sat Dec 3 12:49:26 2022 -0700 + + [Device] Save a map get() + + src/hb-ot-layout-common.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 630b874ae6f54d7c1705ec1c16599d476b8c1c69 +Author: Behdad Esfahbod +Date: Sat Dec 3 12:13:15 2022 -0700 + + [gsubgpos] Add a cache to intersected_class_glyphs + + 30% gain on subset_codepoints/NotoNastaliqUrdu-Regular.ttf/nohinting/1400. + + src/hb-ot-layout-gsubgpos.hh | 72 +++++++++++++++++++++++++++++++++----------- + 1 file changed, 54 insertions(+), 18 deletions(-) + +commit c044f4af3e3e513e42ffd1b48b7b0b4af7633953 +Author: Behdad Esfahbod +Date: Sat Dec 3 11:58:04 2022 -0700 + + [gsubgpos] Remove wrong const + + src/hb-ot-layout-gsubgpos.hh | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +commit 2680be1f22e7446fb6da04e99716dc08a112d0c2 +Author: Behdad Esfahbod +Date: Sat Dec 3 11:53:14 2022 -0700 + + [gsubgpos] Don't set unnecessary funcs + + src/hb-ot-layout-gsubgpos.hh | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit 023f595dec2b9c0cbc91a6b63a594e9041f1006e +Author: Behdad Esfahbod +Date: Sat Dec 3 11:18:05 2022 -0700 + + [cmap] Speed up DefaultUVS::copy even more + + Another 14% on SourceHanSerifVF/10 benchmark. + + src/hb-ot-cmap-table.hh | 81 +++++++++++++++++++++++++++++++++++-------------- + 1 file changed, 59 insertions(+), 22 deletions(-) + +commit 4ca610510805764433eea47a4f991aaf059bd9ce +Author: Behdad Esfahbod +Date: Sat Dec 3 11:15:06 2022 -0700 + + [cmap] Remove double-min + + src/hb-ot-cmap-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit cd29147e30df819850b9f257bc1bd69470741ed4 +Author: Behdad Esfahbod +Date: Sat Dec 3 10:41:42 2022 -0700 + + [cmap] Minor cast + + src/hb-ot-cmap-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 4cdb5cc69b6110fe28b9e01d9c3e4e8f4a8b3272 +Author: Behdad Esfahbod +Date: Sat Dec 3 10:40:24 2022 -0700 + + [cmap] Minor change iterator + + src/hb-ot-cmap-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2cdaedaf543375a54f0810cf5b2b2a535fd85d3b +Author: Behdad Esfahbod +Date: Sat Dec 3 10:16:35 2022 -0700 + + Use hb_enumerate in more places + + src/graph/markbasepos-graph.hh | 4 ++-- + src/hb-ot-var-fvar-table.hh | 10 +++++----- + src/hb-subset-plan.cc | 6 ++---- + 3 files changed, 9 insertions(+), 11 deletions(-) + +commit 02bc4dd69bc5dc8d11de1404e6531b35e233dd39 +Author: Behdad Esfahbod +Date: Sat Dec 3 10:07:16 2022 -0700 + + Use hb_enumerate instead of hand-coding + + src/hb-ot-layout-common.hh | 46 ++++++++++++++++++++-------------------------- + 1 file changed, 20 insertions(+), 26 deletions(-) + +commit 4d19c724c0423892810eefe8b9d9c6efcf274ddd +Author: Behdad Esfahbod +Date: Sat Dec 3 09:57:29 2022 -0700 + + [CoverageFormat1] Speed up intersects() + + Speeds up SourceHanSerif/10000 benchmark (not in test suite) by + 32%! + + src/OT/Layout/Common/CoverageFormat1.hh | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +commit a2d33779e1f582e06c89549090ba95251c04be13 +Author: Behdad Esfahbod +Date: Sat Dec 3 09:49:00 2022 -0700 + + Fix arm bot build + + src/hb-ot-cmap-table.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit dabbf13d402620e605ad497b58dbfb61aed28a3d +Author: Behdad Esfahbod +Date: Sat Dec 3 09:46:11 2022 -0700 + + [cmap] Speed up DefaultUVS::copy + + src/hb-ot-cmap-table.hh | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit 8eadb83640b0f027639d80a10071ad4ae3ab6c47 +Author: Qunxin Liu +Date: Thu Nov 10 10:33:26 2022 -0800 + + [subset] Update hb_subset_input_override_name_table API + + Override the name string for the NameRecord identified by name_id, + platform_id, encoding_id and language_ids specified by the user. + If a record with specified name_id does not exist, this API will create + a new NameRecord with provided info and insert it to the name table. + + src/hb-ot-name-table.hh | 154 ++++++++++++++++++++++------ + src/hb-subset-input.cc | 69 +++++++++---- + src/hb-subset-input.hh | 44 +++++++- + src/hb-subset-plan.cc | 10 +- + src/hb-subset-plan.hh | 10 +- + src/hb-subset.h | 5 +- + test/api/fonts/nameID.override.expected.ttf | Bin 167936 -> 168012 bytes + test/api/test-subset-nameids.c | 14 ++- + 8 files changed, 237 insertions(+), 69 deletions(-) + +commit 29903f46b92db764ba8e6b6422c2128c011c7223 +Author: Behdad Esfahbod +Date: Fri Dec 2 17:45:01 2022 -0700 + + [benchmark-subset] Cache (preprocessed) face amongst runs + + perf/benchmark-subset.cc | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +commit 3fb4ea29cd5a40e76760668e694133fa095e8d55 +Merge: a42fc8ec4 ddeac3658 +Author: Behdad Esfahbod +Date: Fri Dec 2 17:08:31 2022 -0700 + + Merge pull request #3914 from harfbuzz/multimap + + [multimap] Add a multimap datastructure & use for gid-to-unicodes subset accelerator + +commit ddeac3658b46a6536a67b06b8bc8f3efd9ce5f6f +Author: Behdad Esfahbod +Date: Fri Dec 2 16:51:07 2022 -0700 + + [test-multimap] More tests + + src/test-multimap.cc | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit ff419789efb2a7b8f997fbd8d87bea738f2a6c59 +Author: Behdad Esfahbod +Date: Fri Dec 2 16:25:26 2022 -0700 + + [subset-plan] Sort unicode_to_new_gid_list when needed + + src/hb-algs.hh | 12 ++++++++++++ + src/hb-subset-plan.cc | 7 ++++++- + src/hb-subset-plan.hh | 2 +- + 3 files changed, 19 insertions(+), 2 deletions(-) + +commit 1a40da4ad1a8896f65a99838d5251613ecc8e350 +Author: Behdad Esfahbod +Date: Fri Dec 2 16:13:37 2022 -0700 + + [subset-plan] Use add_array instead of add_sorted_array + + That vector is not declared as sorted. + + src/hb-subset-plan.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 32e049a315a1f1d6e2f751f1f93472134fec8f00 +Author: Behdad Esfahbod +Date: Fri Dec 2 16:09:10 2022 -0700 + + [subset-plan] Use gid-to-unicodes multimap + + One test fails. Need investigation. + + src/hb-subset-plan.cc | 37 +++++++++++++++++++++++++++++++------ + 1 file changed, 31 insertions(+), 6 deletions(-) + +commit da7961b2e879aab88fedda7cd0c9e2de4c3240a1 +Author: Behdad Esfahbod +Date: Fri Dec 2 16:08:40 2022 -0700 + + . + + src/hb-multimap.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 7d6893a8034230458ba22f677d54e67c68b1508a +Author: Behdad Esfahbod +Date: Fri Dec 2 15:50:52 2022 -0700 + + [subset-accelerator] Cache gid-to-unicodes + + src/hb-subset-accelerator.hh | 15 +++++++++++---- + src/hb-subset-plan.cc | 12 ++++++++++++ + 2 files changed, 23 insertions(+), 4 deletions(-) + +commit 10c8fc55535e679a75f6f3012273f256e0416d90 +Author: Behdad Esfahbod +Date: Fri Dec 2 15:34:34 2022 -0700 + + [multimap] Add a multimap datastructure + + src/Makefile.am | 5 +++ + src/Makefile.sources | 1 + + src/hb-multimap.hh | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/meson.build | 2 ++ + src/test-multimap.cc | 50 ++++++++++++++++++++++++++++ + 5 files changed, 150 insertions(+) + +commit a42fc8ec4a55adce3a935fb40183f388ff376f8a +Author: Behdad Esfahbod +Date: Fri Dec 2 15:41:18 2022 -0700 + + [subset-accelerator] Adjust in_error() + + src/hb-subset-accelerator.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 65d9630312e277dc464122ae60ce877634ad1820 +Author: Behdad Esfahbod +Date: Fri Dec 2 14:59:26 2022 -0700 + + [subset-cff2] Whitespace + + src/hb-subset-cff2.cc | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit b33297ee26a3965e172ec13d1297eef11783c0c2 +Author: Behdad Esfahbod +Date: Fri Dec 2 14:43:37 2022 -0700 + + [cff2] Remove unused typedef + + src/hb-cff2-interp-cs.hh | 1 - + 1 file changed, 1 deletion(-) + +commit 3ade2ffaa58d639bc825dbeee8aa1d0033ed668b +Author: Behdad Esfahbod +Date: Fri Dec 2 14:26:36 2022 -0700 + + [serialize] Adjust pop_discard for zerocopy + + src/hb-serialize.hh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 043eeb29a3913ff92879c35d410669da3574af18 +Author: Behdad Esfahbod +Date: Fri Dec 2 13:58:36 2022 -0700 + + [subset-cff] Optimize encode_subrs + + Don't loop over all original subrs. Just walk over closure subrs. + + src/hb-subset-cff-common.hh | 13 ++++++------- + 1 file changed, 6 insertions(+), 7 deletions(-) + +commit 0ad5977cd6679f7d0f19e255d78eaf14ecc4e116 +Author: Behdad Esfahbod +Date: Fri Dec 2 13:41:06 2022 -0700 + + [subset-cff] Simplify hinting processing + + We already have drop_hints in the params. + + src/hb-subset-cff-common.hh | 26 ++++++++++---------------- + 1 file changed, 10 insertions(+), 16 deletions(-) + +commit 16cbe41bcaefb9ba1634f781adb7357f8006f645 +Merge: 2a7a1d5a7 16f61a1c8 +Author: Behdad Esfahbod +Date: Fri Dec 2 12:43:13 2022 -0700 + + Merge pull request #3910 from googlefonts/repacker_fuzz + + [repacker] Add a fuzzer for the hb-subset-repacker api. + +commit 2a7a1d5a73f2bd337c69a381d8592a7633113793 +Author: Behdad Esfahbod +Date: Fri Dec 2 12:33:24 2022 -0700 + + [Coverage] Avoid timeout on broken ranges + + Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53929 + + src/OT/Layout/Common/CoverageFormat2.hh | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit c9476527689bd5f061584ba83e1298dd8be3549f +Author: Behdad Esfahbod +Date: Thu Dec 1 21:48:35 2022 -0700 + + [subset-cff] Micro-optimize + + src/hb-subset-cff-common.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit a24d4e9261ccd280e874177e6d21bdf40dd6d76d +Author: Behdad Esfahbod +Date: Thu Dec 1 20:27:56 2022 -0700 + + [array] Oops. Fix memcpy copy()! + + src/hb-array.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5e41766bb92d7b58ededf40e1e031b4690464f48 +Author: Behdad Esfahbod +Date: Thu Dec 1 20:19:04 2022 -0700 + + [array] Fix hb_bytes_t memcpy copy + + Wasn't being used! + + src/hb-array.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit a5616227caf44c5fdcdea3c8f8336808d5b0087b +Author: Behdad Esfahbod +Date: Thu Dec 1 20:11:34 2022 -0700 + + [subset-cff] Fix buffer size calculation + + src/hb-subset-cff-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 015af5a8e5bbcfbc63328a1196318621ed21e1e7 +Author: Behdad Esfahbod +Date: Thu Dec 1 20:08:59 2022 -0700 + + [subset-cff] Write a couple loops as range-based for + + src/hb-subset-cff-common.hh | 24 +++++++++--------------- + 1 file changed, 9 insertions(+), 15 deletions(-) + +commit bfbbd4af253a2ac58bb8bcdcde650fcba9636038 +Author: Behdad Esfahbod +Date: Thu Dec 1 20:05:20 2022 -0700 + + [subset-cff] Copy str for call ops + + src/hb-subset-cff-common.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit c755b3884f40595340fe3de615faf8c17842c667 +Author: Behdad Esfahbod +Date: Thu Dec 1 20:02:38 2022 -0700 + + [subset-cff] Pre-alloc enough for check-less copy + + src/hb-subset-cff-common.hh | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +commit 062e59ae673d645c4b072938a40af7f3931ccaca +Author: Behdad Esfahbod +Date: Thu Dec 1 19:43:48 2022 -0700 + + [subset-cff] Optimize vector allocation for preprocessed input + + src/hb-subset-cff-common.hh | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit 8e9e94dba971e3b09d4a9853a8abcf68d5c6dc62 +Author: Behdad Esfahbod +Date: Thu Dec 1 19:40:21 2022 -0700 + + Revert "[vector] Optimize grow_vector() for size" + + This reverts commit 1dd9396c7a4c24fe9d578551fab735bdd699e52a. + + Is faster indeed. + + 15% on SourceHanSans/10000 benchmark. + + src/hb-vector.hh | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit 2644540a74c19a32fbe3fe904b1266163b8ff2a1 +Author: Behdad Esfahbod +Date: Thu Dec 1 18:49:09 2022 -0700 + + [subset-cff] Compact parsed strings if using accelerator + + Saves 32% on SourceHanSans/10000 benchmark! + + Also, use memcmp now for writing out strings since now that our + ops are not super short, that's faster. + + This makes cff-japanese test takes super long though; that needs + inspection. + + src/hb-subset-cff-common.hh | 55 ++++++++++++++++++++++++++++++++++++--------- + 1 file changed, 45 insertions(+), 10 deletions(-) + +commit 6012d3b228bc30397ab46eda48776fb414043315 +Author: Behdad Esfahbod +Date: Thu Dec 1 17:33:53 2022 -0700 + + [subset-cff] Write out charstrings zerocopy to serializer + + src/hb-serialize.hh | 21 +++++++++++++++++---- + src/hb-subset-cff1.cc | 8 +++++++- + src/hb-subset-cff2.cc | 8 +++++++- + 3 files changed, 31 insertions(+), 6 deletions(-) + +commit 16f61a1c87f83ac750bdf529917519593a9ef58e +Author: Garret Rieger +Date: Thu Dec 1 23:57:30 2022 +0000 + + [repacker] only build repacker fuzzer when experimental api is enabled. + + test/fuzzing/meson.build | 35 +++++++++++++++++++++-------------- + 1 file changed, 21 insertions(+), 14 deletions(-) + +commit 36e1a6339cb0a9bd9ec6e76b64ae83ec871d2f8f +Author: Behdad Esfahbod +Date: Thu Dec 1 16:52:29 2022 -0700 + + [cff] Add total_size to INDEX + + src/hb-ot-cff-common.hh | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +commit 3843000660d587d81d3f71bfd8a1e76939847b86 +Author: Behdad Esfahbod +Date: Thu Dec 1 16:48:22 2022 -0700 + + [serialize] Add start_zerocopy() + + src/hb-serialize.hh | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +commit de5a621322a749e96333656a86137a6ee42490b3 +Author: Garret Rieger +Date: Thu Dec 1 23:37:16 2022 +0000 + + [repacker] enforce root node having no incoming edges. + + src/graph/graph.hh | 8 ++++++++ + .../crash-3bf72494aa4c9f8cbbcbf887fdc2a2858c87feb4 | Bin 0 -> 358596 bytes + 2 files changed, 8 insertions(+) + +commit a2681c37c171143858ade2f91c9eff876c0aa586 +Author: Behdad Esfahbod +Date: Thu Dec 1 16:09:03 2022 -0700 + + [cff-subset] Simplify INDEX serialize() more + + src/hb-ot-cff-common.hh | 21 ++++++--------------- + src/hb-ot-cff1-table.hh | 2 -- + 2 files changed, 6 insertions(+), 17 deletions(-) + +commit c4b05878cbca0b710485c5ea749d8e5e69166aef +Author: Behdad Esfahbod +Date: Thu Dec 1 15:56:37 2022 -0700 + + [subset-cff] Remove INDEX unused serialize() methods + + src/hb-ot-cff-common.hh | 61 ------------------------------------------------- + 1 file changed, 61 deletions(-) + +commit b3ad4d72cced348ff5a169ef59b28c13b5f09741 +Author: Behdad Esfahbod +Date: Thu Dec 1 15:46:00 2022 -0700 + + [cff] Another no-memset in INDEX + + src/hb-ot-cff-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5fd2f255fc4bd749d583cf98dc1788e69f40acd6 +Author: Behdad Esfahbod +Date: Thu Dec 1 15:18:59 2022 -0700 + + [open-type] Don't memset 0 in serialize for ArrayOf family + + Not necessary. + + src/hb-open-type.hh | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +commit 30e405e470f002693b353db5a1bb90504ba01b2a +Author: Garret Rieger +Date: Thu Dec 1 22:12:59 2022 +0000 + + [repacker] ensure link obj indices are valid. + + src/graph/graph.hh | 11 +++++++++-- + .../leak-a77f29b25edb873729f3ab120148fdb213cfa527 | Bin 0 -> 358596 bytes + 2 files changed, 9 insertions(+), 2 deletions(-) + +commit 70ac6dfb28e7ec921ab03467dd84e7c9103d87c5 +Author: Behdad Esfahbod +Date: Thu Dec 1 14:56:28 2022 -0700 + + [subset-cff] Don't memset 0 INDEX and other serialize methods + + Not necessary. + + src/hb-ot-cff-common.hh | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit 554ed06fac759508ad959482f784bf02e4839a66 +Author: Garret Rieger +Date: Thu Dec 1 21:51:17 2022 +0000 + + [repacker] add cycle detection to the graph sort. + + This allows us to bail early if the graph is not acyclic. + + src/graph/graph.hh | 14 ++++++++++---- + src/hb-repacker.hh | 5 +++++ + src/test-repacker.cc | 1 + + test/fuzzing/hb-repacker-fuzzer.cc | 17 +++++++++++++++-- + 4 files changed, 31 insertions(+), 6 deletions(-) + +commit a66de336fb6c98f9946830194e6b28d0f3aaaef8 +Author: Behdad Esfahbod +Date: Thu Dec 1 14:32:13 2022 -0700 + + [vector] Minor use get_size() in as_bytes() + + src/hb-vector.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 0b826368fd122691e6d9095a42e8ad3023baa4bb +Author: Behdad Esfahbod +Date: Thu Dec 1 14:23:25 2022 -0700 + + [serializer] Don't memset memory in embed + + Not necessary. + + src/hb-serialize.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 3b68c7146f0722f6ae54f3bee9afa8112dc8dba4 +Author: Behdad Esfahbod +Date: Thu Dec 1 14:19:27 2022 -0700 + + [array] Don't clear serializer buffer when copying out + + Not needed. + + src/hb-array.hh | 4 ++-- + src/hb-serialize.hh | 13 +++++++------ + 2 files changed, 9 insertions(+), 8 deletions(-) + +commit 57808609c98ff037e03c2c1be0c7d9dbffe3f62f +Author: Behdad Esfahbod +Date: Thu Dec 1 14:03:56 2022 -0700 + + [VarData] Move an unlikely + + src/hb-ot-layout-common.hh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 9e99d08470c455d3ea8fc73e01a244d492fff989 +Author: Garret Rieger +Date: Thu Sep 8 23:19:02 2022 +0000 + + [repacker] validate link widths during repacker setup. + + src/graph/graph.hh | 7 +++++++ + test/fuzzing/hb-repacker-fuzzer.cc | 2 -- + 2 files changed, 7 insertions(+), 2 deletions(-) + +commit edf7a29595f01bf5548587476b37efdc24c500f1 +Author: Garret Rieger +Date: Thu Sep 8 22:59:34 2022 +0000 + + [repacker] Validate link positions before running the repacker. + + src/graph/graph.hh | 30 +++++++++++++++++++++ + src/hb-repacker.hh | 6 +++++ + .../crash-442bfac994a3d9929cf06262ae9fb00f6ee1f774 | Bin 0 -> 358596 bytes + test/fuzzing/hb-repacker-fuzzer.cc | 1 + + 4 files changed, 37 insertions(+) + +commit 88d437525ffc25c5f9ee3d81b828aedd234b521c +Author: Garret Rieger +Date: Thu Sep 8 21:19:25 2022 +0000 + + [repacker] add test for repacker fuzzer. + + test/fuzzing/meson.build | 12 ++++++ + test/fuzzing/run-repacker-fuzzer-tests.py | 68 +++++++++++++++++++++++++++++++ + 2 files changed, 80 insertions(+) + +commit 6627a1ab450066bfda9c064dc48a0e4ea7fa45c8 +Author: Garret Rieger +Date: Thu Sep 8 21:11:39 2022 +0000 + + [repacker] Add a initial seed for the fuzzer repacker. + + test/fuzzing/graphs/noto_nastaliq_urdu | Bin 0 -> 358596 bytes + 1 file changed, 0 insertions(+), 0 deletions(-) + +commit deca30b2684f5580606ad614bc3ffb6c35e887a5 +Author: Garret Rieger +Date: Thu Sep 8 21:10:06 2022 +0000 + + [repacker] get repacker fuzzer working. + + Additionally add helper method that allows a graph to be saved as a fuzzer seed. + + src/graph/graph.hh | 50 ++++++++++++++++++++++++++++++++++++++ + src/hb-repacker.hh | 2 +- + test/fuzzing/hb-repacker-fuzzer.cc | 13 +++++++--- + 3 files changed, 60 insertions(+), 5 deletions(-) + +commit 261a605f9c75d65570ee70abbc46a03e4ce99f7b +Author: Garret Rieger +Date: Wed Sep 7 22:43:06 2022 +0000 + + [repacker] verify graph is a dag before using the fuzzer input. + + test/fuzzing/hb-repacker-fuzzer.cc | 12 +++--------- + 1 file changed, 3 insertions(+), 9 deletions(-) + +commit 985b19f678cbccc57853796d2ee0e6885b9e7244 +Author: Garret Rieger +Date: Wed Sep 7 22:21:16 2022 +0000 + + [repacker] begin implementing a fuzzer for the repacker api. + + src/graph/graph.hh | 12 ++++ + src/hb-repacker.hh | 6 ++ + test/fuzzing/hb-repacker-fuzzer.cc | 134 +++++++++++++++++++++++++++++++++++++ + test/fuzzing/meson.build | 3 + + 4 files changed, 155 insertions(+) + +commit c6d616cc41561cc0029050e579b36cb5084a05ed +Author: Matthias Clasen +Date: Mon Oct 17 22:41:51 2022 -0400 + + Generate and install hb-features.h + + This header has defines for all the optional + dependendencies that come with their own Harfbuzz + headers, so you can do: + + #include + #ifdef HB_HAS_DIRECTWRITE + #include + #endif + + src/Makefile.am | 42 ++++++++++++++++++++++- + src/hb-features.h.in | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/meson.build | 18 ++++++++++ + 3 files changed, 155 insertions(+), 1 deletion(-) + +commit 8805a866b52526e41acd1e7ffe2c9e7bbee5a3b6 +Author: Behdad Esfahbod +Date: Wed Nov 30 17:15:00 2022 -0700 + + [ClassDef2] Write a few loops as range-based for + + src/hb-ot-layout-common.hh | 34 ++++++++++++++-------------------- + 1 file changed, 14 insertions(+), 20 deletions(-) + +commit ac8b232a2d94dcde2cdf00a4cc1db856009edb2a +Author: Behdad Esfahbod +Date: Wed Nov 30 16:42:15 2022 -0700 + + [gsub] Cache intersects_class results for closure + + Benchmark Time CPU Time Old Time New CPU Old CPU New + ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- + BM_subset/subset_codepoints/NotoNastaliqUrdu-Regular.ttf/nohinting/10 +0.0246 +0.0240 0 0 0 0 + BM_subset/subset_codepoints/NotoNastaliqUrdu-Regular.ttf/nohinting/64 -0.5541 -0.5544 4 2 4 2 + BM_subset/subset_codepoints/NotoNastaliqUrdu-Regular.ttf/nohinting/512 -0.1120 -0.1123 43 38 43 38 + BM_subset/subset_codepoints/NotoNastaliqUrdu-Regular.ttf/nohinting/1400 -0.1154 -0.1159 43 38 43 38 + + src/hb-ot-layout-gsubgpos.hh | 58 +++++++++++++++++++++++++++++++------------- + 1 file changed, 41 insertions(+), 17 deletions(-) + +commit 20a0a467299964b0095295247f455835e63ed009 +Author: Behdad Esfahbod +Date: Wed Nov 30 15:59:54 2022 -0700 + + [perf] Remove stale run.sh + + perf/run.sh | 25 ------------------------- + 1 file changed, 25 deletions(-) + +commit 38e7bc345c5a55fa910b3af967c4713da2dbcb6a +Author: Behdad Esfahbod +Date: Wed Nov 30 15:01:38 2022 -0700 + + [benchmark-subset] Support testing arbitrary fonts from cmdline + + perf/benchmark-subset.cc | 38 +++++++++++++++++++++++++++++++------- + 1 file changed, 31 insertions(+), 7 deletions(-) + +commit c6a4b60116a528afb4f1bb28880326cf80ceafc8 +Author: Behdad Esfahbod +Date: Wed Nov 30 14:09:59 2022 -0700 + + [gsubgpos] Add an unlikely + + src/hb-ot-layout-gsubgpos.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit d4dec54c3adec19875f3b29b773b282390e1f1ef +Author: Behdad Esfahbod +Date: Wed Nov 30 13:51:14 2022 -0700 + + [ci] Switch configs build to Ubuntu 20.04 + + https://github.com/actions/runner-images/issues/6002 + + .github/workflows/configs-build.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 52d8346d993ed5ad96356216958323abc89cd514 +Author: Behdad Esfahbod +Date: Wed Nov 30 13:50:16 2022 -0700 + + [ci] Change Linux runner to Ubuntu 20.04 + + https://github.com/actions/runner-images/issues/6002 + + .github/workflows/linux-ci.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 32dd9810cf156b7710bc849030d69b902e58077b +Author: Behdad Esfahbod +Date: Wed Nov 30 13:15:58 2022 -0700 + + [subset-cff1] Cache glyph-to-sid-map in the accelerator + + Benchmark Time CPU Time Old Time New CPU Old CPU New + --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + BM_subset/subset_codepoints/SourceHanSans-Regular_subset.otf/nohinting/10 -0.0841 -0.0843 0 0 0 0 + BM_subset/subset_codepoints/SourceHanSans-Regular_subset.otf/nohinting/64 -0.1305 -0.1305 0 0 0 0 + BM_subset/subset_codepoints/SourceHanSans-Regular_subset.otf/nohinting/512 -0.1398 -0.1401 1 1 1 1 + BM_subset/subset_codepoints/SourceHanSans-Regular_subset.otf/nohinting/4096 +0.0382 +0.0380 9 9 9 9 + BM_subset/subset_codepoints/SourceHanSans-Regular_subset.otf/nohinting/10000 +0.0213 +0.0211 11 11 11 11 + + src/hb-ot-cff2-table.hh | 5 +++++ + src/hb-subset-cff-common.hh | 2 ++ + src/hb-subset-cff1.cc | 21 +++++++++++++++++---- + 3 files changed, 24 insertions(+), 4 deletions(-) + +commit 72fabef0a46435152ec620b88245d32391858634 +Author: Behdad Esfahbod +Date: Wed Nov 30 11:37:49 2022 -0700 + + [SingleSubstFormat2] Speed up closure + + src/OT/Layout/GSUB/SingleSubstFormat2.hh | 20 ++++++++++++++++++-- + 1 file changed, 18 insertions(+), 2 deletions(-) + +commit 2dc2e016d4bc47a37857eebf64d8d0b8378b32db +Author: Behdad Esfahbod +Date: Wed Nov 30 11:25:50 2022 -0700 + + [cff] Enable an unlikely + + src/hb-ot-cff-common.hh | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 582a87ef0a320061b991662f081e6b247f7f38f2 +Author: Behdad Esfahbod +Date: Wed Nov 30 11:20:19 2022 -0700 + + [cff] Speed up FDSelect0 sanitize + + src/hb-ot-cff-common.hh | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit 2658370f00981ac95c7031e9acaf8163f2e0f526 +Author: Garret Rieger +Date: Wed Nov 30 00:19:10 2022 +0000 + + [subset] make the cmap cache in accelerator const. + + src/hb-ot-cmap-table.hh | 30 +++++++++++++++++++++++------- + src/hb-subset-accelerator.hh | 4 +--- + 2 files changed, 24 insertions(+), 10 deletions(-) + +commit 7551a668e38248a5c1df3f1315e7a05bc5909ab6 +Author: Garret Rieger +Date: Wed Nov 30 00:04:16 2022 +0000 + + [subset] Make cff_accelerator const. + + This gives more confidence that it won't be accidentally modified by the subset operation using it. + + src/hb-subset-accelerator.hh | 2 +- + src/hb-subset-cff-common.hh | 34 ++++++++++++++++------------------ + 2 files changed, 17 insertions(+), 19 deletions(-) + +commit d8d0e0669405c5efbd07bcc24ad97b467534ff39 +Author: Behdad Esfahbod +Date: Tue Nov 29 21:35:54 2022 -0700 + + [array] Comment + + src/hb-array.hh | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 2fecf2aa1997b5f914a9fa545c95929afc79714a +Author: Behdad Esfahbod +Date: Tue Nov 29 21:25:01 2022 -0700 + + [ClassDef] Minor rename + + src/hb-ot-layout-common.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 8f632ca8843427cefd9e2f7f76e1453c93c33913 +Author: Behdad Esfahbod +Date: Tue Nov 29 21:23:35 2022 -0700 + + [ClassDef] Write another loop as range for + + src/hb-ot-layout-common.hh | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +commit 87b12aee13778065bbacc601cfec61fac5f62268 +Author: Behdad Esfahbod +Date: Tue Nov 29 21:18:48 2022 -0700 + + [ClassDef] Write a couple loops as range for + + src/hb-ot-layout-common.hh | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit ccd40c842ccaef4923bd4ed3981e7332d73aed4c +Author: Behdad Esfahbod +Date: Tue Nov 29 21:14:44 2022 -0700 + + [ClassDef] Optimize intersected_class_glyphs + + src/hb-ot-layout-common.hh | 14 ++++++-------- + 1 file changed, 6 insertions(+), 8 deletions(-) + +commit 44c585a6df139665a953c1f85e6e3adcc204e71f +Author: Behdad Esfahbod +Date: Tue Nov 29 20:51:58 2022 -0700 + + [ClassDef] Fix disabled codeblock + + src/hb-ot-layout-common.hh | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +commit 9b7617d433158eeef45461715dd416bce34328a5 +Author: Behdad Esfahbod +Date: Tue Nov 29 20:29:58 2022 -0700 + + [ClassDef2] Use a faster algorithm in subset() + + Speedup across the board; up to 40% for MPlus1 at small sizes. + + src/hb-ot-layout-common.hh | 66 ++++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 55 insertions(+), 11 deletions(-) + +commit ae5e6d562bd49eed1438ecafc1c0b37ba77e0da3 +Author: Behdad Esfahbod +Date: Tue Nov 29 15:48:38 2022 -0700 + + [ClassDef2] Micro-optimize + + src/hb-ot-layout-common.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 7129b79406fbbf53e08fa55623b5d8e2fa34e649 +Author: Behdad Esfahbod +Date: Tue Nov 29 15:33:07 2022 -0700 + + [open-type] Add faster range-based loop to array types + + src/hb-open-type.hh | 12 ++++++++++++ + src/hb-vector.hh | 2 +- + 2 files changed, 13 insertions(+), 1 deletion(-) + +commit dc823340612196ee360b5fb5a32bd1d9e143b256 +Author: Behdad Esfahbod +Date: Tue Nov 29 15:26:55 2022 -0700 + + Remove a couple of unneeded .iter() invocations + + src/hb-ot-layout-common.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 00f2657bb8fea82613d67a059dd4c3a5550683f1 +Author: Behdad Esfahbod +Date: Tue Nov 29 13:49:15 2022 -0700 + + [subset] Accelerate sanitize-table-cache + + Big wins all across small subsets + + BM_subset/subset_codepoints/Roboto-Regular.ttf/nohinting/10                              -0.1140         -0.1129             0             0             0             0 + BM_subset/subset_codepoints/Amiri-Regular.ttf/nohinting/10                               -0.4717         -0.4714             0             0             0             0 + BM_subset/subset_codepoints/NotoNastaliqUrdu-Regular.ttf/nohinting/10                    -0.8147         -0.8146             0             0             0             0 + BM_subset/subset_codepoints/NotoSansDevanagari-Regular.ttf/nohinting/10                  -0.3248         -0.3242             0             0             0             0 + BM_subset/subset_codepoints/Mplus1p-Regular.ttf/nohinting/10                             -0.1262         -0.1260             0             0             0             0 + BM_subset/subset_codepoints/SourceHanSans-Regular_subset.otf/nohinting/10                -0.0308         -0.0309             0             0             0             0 + BM_subset/subset_codepoints/SourceSansPro-Regular.otf/nohinting/10                       -0.1374         -0.1373             0             0             0             0 + BM_subset/subset_codepoints/AdobeVFPrototype.otf/nohinting/10                            -0.4555         -0.4555             0             0             0             0 + BM_subset/subset_codepoints/MPLUS1-Variable.ttf/nohinting/10                             -0.4175         -0.4174             0             0             0             0 + BM_subset/subset_codepoints/RobotoFlex-Variable.ttf/nohinting/10                         -0.4214         -0.4214             0             0             0 + + src/hb-mutex.hh | 7 ++++--- + src/hb-subset-accelerator.hh | 12 ++++++++++-- + src/hb-subset-plan.hh | 16 +++++++++------- + 3 files changed, 23 insertions(+), 12 deletions(-) + +commit 33165f4848608ddd813404602877bcf907e1e683 +Author: Behdad Esfahbod +Date: Tue Nov 29 15:14:15 2022 -0700 + + [bit-page] Remove ELT_BITS_LOG_2 + + My compiler is smart enough to take care of it. + + src/hb-bit-page.hh | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +commit 58925ed9a0bf0dc7b3e8dff34d296bf50759e2b7 +Author: Satadru Pramanik +Date: Tue Nov 29 13:14:10 2022 -0500 + + Update freetype subproject to 2.12.1 + + subprojects/freetype2.wrap | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 80dd751564e8a9153f7466e687b8699a5e7e27c6 +Author: Christoph Reiter +Date: Tue Nov 29 19:15:31 2022 +0100 + + CI: work around flaky 64bit MSYS2 builds + + MSYS2 Python+meson has some random crashes in CI which we haven't been + able to reproduce yet. Naturally enabling debugging fixes them.. :) + + .github/workflows/msys2-ci.yml | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 8f41b6a13918968476b9b2e917798daca3394352 +Author: Christoph Reiter +Date: Tue Nov 29 18:29:46 2022 +0100 + + CI: fix msvc build + + The Windows image for some reason now contains a zlib and freetype build + which meson finds and tries to use. Force meson to use the subprojects always + to avoid picking up system libs. + + .github/workflows/msvc-ci.yml | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 7a004a7ac27da776b623c0892ebced3d12213c39 +Author: Garret Rieger +Date: Tue Nov 29 00:47:55 2022 +0000 + + [subset] Cache per subtable cmap unicode mappings. + + src/hb-ot-cmap-table.hh | 108 +++++++++++++++++++++++++++++++++++-------- + src/hb-subset-accelerator.hh | 15 +++++- + src/hb-subset.cc | 5 ++ + 3 files changed, 109 insertions(+), 19 deletions(-) + +commit d2a2670e54d545db2e5200eeeba0f08191a09f74 +Author: Behdad Esfahbod +Date: Mon Nov 28 19:42:27 2022 -0700 + + [iter] Simplify has() interface implementations + + src/OT/Layout/Common/Coverage.hh | 6 ++---- + src/hb-bit-set-invertible.hh | 6 ++---- + src/hb-bit-set.hh | 6 ++---- + src/hb-map.hh | 3 +-- + src/hb-ot-layout-common.hh | 6 ++---- + src/hb-set.hh | 6 ++---- + 6 files changed, 11 insertions(+), 22 deletions(-) + +commit cba82829baa1e5344e31095932c383f412a409a6 +Author: Behdad Esfahbod +Date: Mon Nov 28 16:19:54 2022 -0700 + + [subset-cff1] Share subrs object + + Multiple FDs might share the same subrs... + + src/hb-subset-cff1.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c7b998b355f3815d4b288c457aa120770580f3c6 +Author: Behdad Esfahbod +Date: Mon Nov 28 16:18:21 2022 -0700 + + [cff2] Don't share fd-array link + + No point. + + src/hb-subset-cff2.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 3d9e3c2dc7a5cfa2831a30903419a1c98f571757 +Author: Behdad Esfahbod +Date: Mon Nov 28 16:17:09 2022 -0700 + + [subset-cff2] Don't share varstore object + + src/hb-subset-cff2.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c503cf003e75191f3b3f9200c8dc4e90fdc1c67b +Author: Behdad Esfahbod +Date: Mon Nov 28 15:53:35 2022 -0700 + + [cmap] Store offset, not pointer, in cmap cache + + src/hb-ot-cmap-table.hh | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit 3e151139a8987a13cdd8cc2ddc025534c51c607f +Author: Behdad Esfahbod +Date: Mon Nov 28 14:23:49 2022 -0700 + + [PairPos] Optimize get_effective_value_format + + Speeds up BM_subset/subset_glyphs/SourceHanSans-Regular_subset.otf/nohinting/512 + 12%. + + src/OT/Layout/GPOS/PairPosFormat1.hh | 3 +++ + src/OT/Layout/GPOS/PairPosFormat2.hh | 6 +++++- + 2 files changed, 8 insertions(+), 1 deletion(-) + +commit 3131aecf9fc8b34a22ebf797412496c4baf18c68 +Author: Behdad Esfahbod +Date: Mon Nov 28 14:12:55 2022 -0700 + + [array/hash] Fix asan issue + + ../src/hb-algs.hh:240:43: runtime error: reference binding to misaligned address 0x7ffe91a08b0e for type 'const unsigned int', which requires 4 byte alignment + + src/hb-array.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 26ad7a6022533e3497e7fa94d67808830b9915b3 +Author: Behdad Esfahbod +Date: Mon Nov 28 14:09:21 2022 -0700 + + [gpos] Minor micro-optimize + + src/OT/Layout/GPOS/PairPosFormat1.hh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit c769d7e1810cbb30210d0fbcc21e04909e270cf8 +Author: Behdad Esfahbod +Date: Mon Nov 28 14:03:58 2022 -0700 + + [gpos] Whitespace + + src/OT/Layout/GPOS/PairPosFormat1.hh | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 3ea0f37c30aaf354e256ad1374fd2e0956df8120 +Author: Behdad Esfahbod +Date: Mon Nov 28 13:58:44 2022 -0700 + + [subset-cff] Move an init to constructor + + The init was not called anyway. + + src/hb-subset-cff-common.hh | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit 6c92c3e0cf4e7c09c13e2e2c59cc5467605ad165 +Author: Behdad Esfahbod +Date: Mon Nov 28 13:54:24 2022 -0700 + + [subset-cff] Remove unnecessary check + + src/hb-subset-cff-common.hh | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit 7fd300dd9a7e38973ee9eda0197e973bc88b043f +Author: Behdad Esfahbod +Date: Mon Nov 28 13:51:16 2022 -0700 + + [subset-cff] Use constructor for parsed_cs_op_t + + src/hb-subset-cff-common.hh | 13 ++++--------- + 1 file changed, 4 insertions(+), 9 deletions(-) + +commit bd37900e0da9c5b9dbfabccb8af64e97cbe8c956 +Author: Garret Rieger +Date: Mon Nov 28 20:35:34 2022 +0000 + + [subset] use a reference to cached global/loca subrs. + + Previously they were being copied in. Copying is no longer necessary now that hint dropping doesn't mutate the arrays. + + src/hb-subset-cff-common.hh | 91 +++++++++++++++++---------------------------- + 1 file changed, 35 insertions(+), 56 deletions(-) + +commit ded9de9cd82aa33a5ffbf8e23c473c6ff2c186c9 +Author: Behdad Esfahbod +Date: Mon Nov 28 13:31:40 2022 -0700 + + [cff] bsearch in fdselect + + Saves 8% in NotoSansCJK / 10000 subset benchmark. + + src/hb-ot-cff-common.hh | 18 ++++++++++++------ + src/hb-subset-cff-common.hh | 9 ++++----- + 2 files changed, 16 insertions(+), 11 deletions(-) + +commit 0c33aba30cb06f2798088573efb7880315d94029 +Author: Behdad Esfahbod +Date: Mon Nov 28 12:28:13 2022 -0700 + + [subset-cff] Rename drop flag to hinting flag + + src/hb-subset-cff-common.hh | 28 ++++++++++++++-------------- + 1 file changed, 14 insertions(+), 14 deletions(-) + +commit 6f5b531986c5084da7b85d12551018650ac63d5d +Author: Behdad Esfahbod +Date: Mon Nov 28 11:39:24 2022 -0700 + + [subset-cff] Make no-hinting use accelerator as well + + src/hb-subset-cff-common.hh | 43 +++++++++++++++++++++++++++---------------- + 1 file changed, 27 insertions(+), 16 deletions(-) + +commit fad8322b3f126281ff662eb7b1a6d1747f5fc193 +Author: Behdad Esfahbod +Date: Sun Nov 27 15:09:48 2022 -0700 + + [benchmark-subset] Add no-hinting ops + + perf/benchmark-subset.cc | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +commit f51a624e6752441ea081052620129714135559a8 +Author: Behdad Esfahbod +Date: Sun Nov 27 14:54:39 2022 -0700 + + [subset-cff] Micro-optimize drop_hints_in_str + + src/hb-subset-cff-common.hh | 22 ++++++++++++---------- + 1 file changed, 12 insertions(+), 10 deletions(-) + +commit 38603266881499db8c7925ab7fc909158b462308 +Author: Behdad Esfahbod +Date: Sun Nov 27 13:23:13 2022 -0700 + + [subset-cff] Write loop more idiomatic + + src/hb-number-parser.hh | 8 ++++---- + src/hb-subset-cff-common.hh | 15 ++++++++------- + 2 files changed, 12 insertions(+), 11 deletions(-) + +commit 3ff502d3aef4cdd1ac4dee29fbcb5af16f43b2cf +Author: Behdad Esfahbod +Date: Sun Nov 27 12:58:04 2022 -0700 + + [subset-cff] Remove unnecessary initialization + + src/hb-subset-cff-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6af4985bf9013cef85bc5cdf3c8b8150fc72c967 +Author: Behdad Esfahbod +Date: Sat Nov 26 18:20:20 2022 -0700 + + [subset-cff] No need for bitflag here anymore + + src/hb-subset-cff-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 69ce606d1467dbfdd3c01070a5126e141c5c3047 +Author: Behdad Esfahbod +Date: Sat Nov 26 18:18:35 2022 -0700 + + [subset-cff] Immediately drop subr numbers instead of marking for skip + + Seems to work and saves ~2% time. + + src/hb-subset-cff-common.hh | 17 ++--------------- + 1 file changed, 2 insertions(+), 15 deletions(-) + +commit 1cf4f3e0830eb45bd9d96fdfcdea15d2fb1af8f2 +Author: Behdad Esfahbod +Date: Sat Nov 26 18:15:28 2022 -0700 + + [subset-cff] More comment + + src/hb-subset-cff-common.hh | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit f68221ff43df990f10ddcf91f6a71d4c72a82e82 +Author: Behdad Esfahbod +Date: Sat Nov 26 18:12:14 2022 -0700 + + [subset-cff] Add comment + + src/hb-subset-cff-common.hh | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 048ab8a066afd5c472e4a436f5e95016ac0d3649 +Author: Behdad Esfahbod +Date: Sat Nov 26 18:00:43 2022 -0700 + + [subset-cff] Remove unused bits + + src/hb-subset-cff-common.hh | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +commit 37cbfc0c7ee82ee6f781b2b1df6a8c8555a15c16 +Author: Behdad Esfahbod +Date: Sat Nov 26 17:57:44 2022 -0700 + + [subset-cff] Remove unneeded member + + src/hb-subset-cff-common.hh | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +commit 46ab15137b0ee04b76e22cb5964969aa9f2e6e7c +Author: Behdad Esfahbod +Date: Sat Nov 26 17:49:21 2022 -0700 + + [subset-cff] Add has_calls to parsed charstrings + + Optimize closure based on it. + + src/hb-subset-cff-common.hh | 17 +++++++++++++---- + 1 file changed, 13 insertions(+), 4 deletions(-) + +commit 6d53074e6375c1680f40b647a1b4ad88dd3cc1c6 +Author: Behdad Esfahbod +Date: Sat Nov 26 17:23:09 2022 -0700 + + [subset-cff] Drop another unused parameter + + src/hb-subset-cff-common.hh | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +commit 42615561b545f2bb7c29618884fa2d63d8dd97a8 +Author: Behdad Esfahbod +Date: Sat Nov 26 17:10:58 2022 -0700 + + Optimize a couple array references + + src/hb-ot-map.cc | 2 +- + src/hb-subset-cff-common.hh | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit 04d23b7ca802cde23b04c8570d8d166c1b543ac3 +Author: Behdad Esfahbod +Date: Sat Nov 26 17:08:00 2022 -0700 + + [subset-cff] Micro-optimize collect_subr_refs_in_str + + src/hb-subset-cff-common.hh | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +commit 9d18180c3c77ed73188d5eda14b9602c5f6d073b +Author: Behdad Esfahbod +Date: Sat Nov 26 15:38:21 2022 -0700 + + [array] Use hb_hash instead of handrolling + + src/hb-array.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 1e6f77c250825a7f6ef7e550289f67253a469b05 +Author: Behdad Esfahbod +Date: Sat Nov 26 15:31:56 2022 -0700 + + [benchmark-subset] Adjust num glyphs more + + perf/benchmark-subset.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 0382defa5196a28e3e0fcad5d91bcee14f303bad +Author: Behdad Esfahbod +Date: Sat Nov 26 15:27:07 2022 -0700 + + [benchmark-subset] Adjust number of glyphs of fonts + + perf/benchmark-subset.cc | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 4cb441dfd11221bdd423622a4c57f87e723fc129 +Author: Behdad Esfahbod +Date: Sat Nov 26 15:23:07 2022 -0700 + + [benchmark-subset] Add AdobeVFPrototype + + perf/benchmark-subset.cc | 1 + + 1 file changed, 1 insertion(+) + +commit e302b9d5da0641ab9c3e1d20cfab19282649f839 +Author: Behdad Esfahbod +Date: Sat Nov 26 15:18:16 2022 -0700 + + Fix build + + src/hb-coretext.cc | 2 +- + src/hb-ms-feature-ranges.hh | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 70d97d079b73cc39d457dcb18ffae4eca3b5f5b0 +Author: Behdad Esfahbod +Date: Sat Nov 26 15:16:11 2022 -0700 + + [subset-cff] Remove unused argument + + src/hb-cff2-interp-cs.hh | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 4167e93a1507d8fdefa37dba2044d9015f87ad78 +Author: Behdad Esfahbod +Date: Sat Nov 26 15:14:52 2022 -0700 + + [subset-cff2] Micro-optimize blend operator + + src/hb-cff2-interp-cs.hh | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit f159bf075bb7050eebf307a5a90e1110fc526573 +Author: Behdad Esfahbod +Date: Sat Nov 26 15:11:32 2022 -0700 + + [cff2] Micro-optimize blend operator + + src/hb-cff2-interp-cs.hh | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit a331e913dc99cba1e5994b06cffa2c5cc007f7ff +Author: Behdad Esfahbod +Date: Sat Nov 26 14:59:37 2022 -0700 + + [bit-page] Hand-code equality + + Faster than memcmp() because of alignment. + + src/hb-bit-page.hh | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 9df06a26950ced1017395c771e25be56f20fba5c +Author: Behdad Esfahbod +Date: Sat Nov 26 14:56:45 2022 -0700 + + [bit-set] Fix is_subset() short-circut criteria + + Ouch! + + src/hb-bit-set.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 915c1a00cfde01cc153582df31031361ded28b20 +Author: Behdad Esfahbod +Date: Sat Nov 26 14:48:57 2022 -0700 + + [vector] Add remove_unordered + + Saves 5% in NotoNastaliq/1000 subset benchmark. + + src/graph/graph.hh | 4 ++-- + src/graph/markbasepos-graph.hh | 2 +- + src/hb-vector.hh | 14 +++++++++++++- + src/test-vector.cc | 3 ++- + 4 files changed, 18 insertions(+), 5 deletions(-) + +commit 4b8d8fbee4dc5fb96d298ea8ea8c5871b7ffbc26 +Author: Behdad Esfahbod +Date: Sat Nov 26 14:31:15 2022 -0700 + + [ot-map] Micro-optimize for size + + src/hb-ot-map.hh | 6 +++--- + src/hb-vector.hh | 3 +++ + 2 files changed, 6 insertions(+), 3 deletions(-) + +commit 93f3a9dbc677ae51e5b0a754c995963207ca97b8 +Author: Behdad Esfahbod +Date: Sat Nov 26 14:19:00 2022 -0700 + + [ot-map] Micro-optimize more + + Another 500 bytes. + + src/hb-ot-map.cc | 33 ++++++++++++++++++--------------- + 1 file changed, 18 insertions(+), 15 deletions(-) + +commit f39f049870ebad20b76e3f56194568e89fa45aac +Author: Behdad Esfahbod +Date: Sat Nov 26 14:16:15 2022 -0700 + + [ot-map] Micro-optimize + + Weird that shrinks size by 500 bytes. + + src/hb-ot-map.cc | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit 60bb32c45470f8ea3d30baf67980c699dfb9b801 +Author: Behdad Esfahbod +Date: Sat Nov 26 14:12:57 2022 -0700 + + [ot-map] Minor refactor + + src/hb-ot-map.cc | 21 +++++++++++---------- + 1 file changed, 11 insertions(+), 10 deletions(-) + +commit e3cc61838fe331167d8074b55271039fbe2d2cb2 +Author: Behdad Esfahbod +Date: Sat Nov 26 13:58:04 2022 -0700 + + [PairPos] Adjust kerning buffer messages + + src/OT/Layout/GPOS/PairPosFormat2.hh | 12 ++++++++++-- + src/OT/Layout/GPOS/PairSet.hh | 12 ++++++++++-- + 2 files changed, 20 insertions(+), 4 deletions(-) + +commit a81dd1053dcdd1e26a0516d3a5b84e0b904e2c96 +Author: Behdad Esfahbod +Date: Sat Nov 26 13:43:15 2022 -0700 + + [layout] Adjust printing feature tags + + For required-feature, print spaces, not nul bytes. + + src/hb-ot-layout.cc | 6 +++--- + src/hb-ot-map.hh | 2 +- + 2 files changed, 4 insertions(+), 4 deletions(-) + +commit 56e3868b52ef6e85d6495d28bae57dcc5746d1db +Author: Behdad Esfahbod +Date: Sat Nov 26 13:14:23 2022 -0700 + + [layout/buffer-message] Print feature name in lookup buffer messages + + src/hb-ot-layout.cc | 6 +++--- + src/hb-ot-map.cc | 7 +++++-- + src/hb-ot-map.hh | 4 +++- + 3 files changed, 11 insertions(+), 6 deletions(-) + +commit a5d35fd80a26cb62c4c9030894f94c0785d183e7 +Author: Garret Rieger +Date: Fri Nov 25 23:17:05 2022 +0000 + + [subset] use charstrings directly from accelerator cache if mutability isn't needed. + + src/hb-subset-cff-common.hh | 70 ++++++++++++++++++++++++++++++--------------- + 1 file changed, 47 insertions(+), 23 deletions(-) + +commit 026b64ef76e12f87ec4740c26eeda724193f810e +Author: Behdad Esfahbod +Date: Fri Nov 25 14:57:40 2022 -0700 + + [subset-cff] Avoid set mallocation in hb_plan_subset_cff_fdselect + + src/hb-subset-cff-common.cc | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +commit 74acf52f3321d3aeeb4b96f5b36040727634efd0 +Author: Behdad Esfahbod +Date: Fri Nov 25 14:43:44 2022 -0700 + + [subset-cff] Micro-optimize copy_str more + + src/hb-subset-cff-common.hh | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit d2f3cde7ef20a7e7d58c3301ac32da6d38a65712 +Author: Behdad Esfahbod +Date: Fri Nov 25 14:38:30 2022 -0700 + + [subset-cff] Micro-optimize copy_str + + src/hb-subset-cff-common.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit e333223f269a090732ae3a9d468bb93c35bbeb62 +Author: Behdad Esfahbod +Date: Fri Nov 25 14:23:57 2022 -0700 + + [array] Optimize serializing copy() + + src/hb-array.hh | 16 +++++++++++++++- + src/hb-vector.hh | 11 ++++++----- + 2 files changed, 21 insertions(+), 6 deletions(-) + +commit 22990fca1d78680a4f24fc29a109a115fe0660d0 +Merge: 7b197446a 8d5c899b0 +Author: Behdad Esfahbod +Date: Fri Nov 25 14:12:58 2022 -0700 + + Merge pull request #3894 from googlefonts/cff_accel + + [subset] Cache parsed char strings in CFF accelerator + +commit 8d5c899b0ff43b4b8aeb767623627cf55168c8fb +Author: Garret Rieger +Date: Fri Nov 25 20:33:39 2022 +0000 + + [subset] In cff accelerator hold reference to CFF table instead of the whole font. + + src/hb-ot-cff1-table.hh | 2 +- + src/hb-ot-cff2-table.hh | 2 +- + src/hb-subset-cff-common.hh | 19 ++++++++++--------- + 3 files changed, 12 insertions(+), 11 deletions(-) + +commit 7b197446acc8b4876d3d193b56ee5ab605424ef3 +Author: Behdad Esfahbod +Date: Fri Nov 25 13:28:53 2022 -0700 + + [vector] Adjust for HB_OPTIMIZE_SIZE + + src/hb-vector.hh | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 75a99f28abbb6d82e51f49dcda95c0d61b225e98 +Author: Garret Rieger +Date: Fri Nov 25 18:38:13 2022 +0000 + + [subset] destruct cff accelerator if present. + + src/hb-subset-accelerator.hh | 7 ++++++- + src/hb-subset-cff-common.hh | 6 ++++-- + 2 files changed, 10 insertions(+), 3 deletions(-) + +commit 1d474194f0a5c164ce629c4e291051ee12979e25 +Author: Behdad Esfahbod +Date: Fri Nov 25 13:21:35 2022 -0700 + + [subset-cff] Micro-optimize encode_str + + src/hb-subset-cff-common.hh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 3c4a610b59857665c73e771a4d2448fcd1acaae1 +Author: Behdad Esfahbod +Date: Fri Nov 25 13:16:30 2022 -0700 + + [subset-cff] Micro-optimize copy_str some more + + src/hb-subset-cff-common.hh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 535aadb309f51dbb243042230c5fef09885c7499 +Author: Behdad Esfahbod +Date: Fri Nov 25 13:07:42 2022 -0700 + + [subset-cff] Micro-optimize collect_subr_refs_in_str more + + src/hb-subset-cff-common.hh | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +commit 00a9df3a43484f81d02baf9e726993ff67bb523f +Author: Behdad Esfahbod +Date: Fri Nov 25 13:05:05 2022 -0700 + + [subset-cff] Micro-optimize collect_subr_refs_in_str + + src/hb-subset-cff-common.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit d2a2f5bf4ed66979b17332f35b52c3395b02ed2d +Author: Behdad Esfahbod +Date: Fri Nov 25 12:44:02 2022 -0700 + + [vector] Handroll copy + + src/hb-vector.hh | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 1fed366d5bb5020948b8d6d033ad886fec7e8be8 +Author: Behdad Esfahbod +Date: Fri Nov 25 12:37:24 2022 -0700 + + [serialize] Shut compiler warning off + + src/hb-serialize.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f2297e6978087cefd27a947e044adf9e89eab5f6 +Author: Behdad Esfahbod +Date: Fri Nov 25 11:33:00 2022 -0700 + + [buffer] Documentation + + Fixes https://github.com/harfbuzz/harfbuzz/issues/3889 + + src/hb-buffer.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 71c23c1c079cbd992ee3c9e92435ee2b1374c227 +Author: Garret Rieger +Date: Fri Nov 25 18:04:44 2022 +0000 + + [subset] don't copy the entire global/loca subr lists from the accelerator. + + Instead run a closure on the retained charstrings and copy only the referenced subrs. This significantly speeds up cases with small character sets. + + src/hb-subset-cff-common.hh | 80 ++++++++++++++++++++++++++++++--------------- + 1 file changed, 53 insertions(+), 27 deletions(-) + +commit 4ff09274a86102a69c6e7abebc59d694bc90bbcd +Author: Garret Rieger +Date: Thu Nov 24 22:47:29 2022 +0000 + + [subset] In CFF accelerator keep a reference to original face. + + The charstring objects reference memory from the original face so we need to maintain a reference to prevent it from being destroyed. + + src/hb-subset-cff-common.hh | 17 +++++++++++++++-- + 1 file changed, 15 insertions(+), 2 deletions(-) + +commit 6aaa16627c3d6c77da32e6b2019724385103581d +Author: Behdad Esfahbod +Date: Thu Nov 24 14:58:42 2022 -0700 + + [Coverage] Comment + + src/OT/Layout/Common/CoverageFormat1.hh | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 06e2147a483a1244b6978c0f7c4ca3fbe3bad227 +Author: Behdad Esfahbod +Date: Thu Nov 24 14:56:04 2022 -0700 + + More call set->next() directly + + src/hb-ot-layout-common.hh | 29 ++++++++++++++--------------- + 1 file changed, 14 insertions(+), 15 deletions(-) + +commit 196c9db06fc627a4709886e49ff0823dba3bbdbc +Author: Behdad Esfahbod +Date: Thu Nov 24 14:51:52 2022 -0700 + + Call ->next() directly + + src/hb-ot-layout-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 03d64b7469d12d10b498fbf942afb7b87810012f +Author: Behdad Esfahbod +Date: Thu Nov 24 14:33:18 2022 -0700 + + [bit-set] Remove TODO that would never happen + + src/hb-bit-set.hh | 2 -- + 1 file changed, 2 deletions(-) + +commit 690df8a36955390cfd7251a50a2629e64b52bb82 +Author: Behdad Esfahbod +Date: Thu Nov 24 14:32:51 2022 -0700 + + [bit-set] Micro-optimize prev() + + src/hb-bit-set.hh | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit fe5d9176aed02c0d3388d5a5cf3881e6437db71f +Author: Behdad Esfahbod +Date: Thu Nov 24 14:30:18 2022 -0700 + + [bit-set] Micro-optimize size + + It's silly that this saves size at all. :( + + src/hb-bit-set.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit cf9b9929df088570c18ea8b55e61ba7f31374532 +Author: Behdad Esfahbod +Date: Thu Nov 24 14:26:28 2022 -0700 + + [bit-set] Micro-optimize process() + + src/hb-bit-set.hh | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +commit d77903db7b165dbb6327141e1949984a09756de7 +Author: Behdad Esfahbod +Date: Thu Nov 24 14:22:32 2022 -0700 + + [bit-set] Micro-optimize + + src/hb-bit-set.hh | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +commit 13dd4b464b7bf7bfaff790d242b6baeec2edffa9 +Author: Behdad Esfahbod +Date: Thu Nov 24 14:20:42 2022 -0700 + + [bit-set] Micro-optimize access + + src/hb-bit-set.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit a3afa61ce8d01784d88de4af3647ebd5b3e71fe6 +Author: Garret Rieger +Date: Wed Nov 23 22:24:39 2022 +0000 + + [subset] use cached parsed char strings if available. + + src/hb-subset-cff-common.hh | 67 ++++++++++++++++++++++++++++++++++----------- + 1 file changed, 51 insertions(+), 16 deletions(-) + +commit 47c125845caf1c24f538679ffdc32c04b2f0920b +Author: Garret Rieger +Date: Wed Nov 23 21:02:39 2022 +0000 + + [subset] Cache parsed charstrings in the cff accelerator. + + src/hb-subset-cff-common.hh | 36 ++++++++++++++++++++++++++++++++---- + 1 file changed, 32 insertions(+), 4 deletions(-) + +commit 48b68370743264f900457e4b463e9ced5325ceae +Author: Garret Rieger +Date: Wed Nov 23 20:51:51 2022 +0000 + + [subset] add a CFF specific accelerator object. + + This allows CFF specific accelerator structures to be isolated to the CFF code. + + src/hb-subset-accelerator.hh | 12 +++++++++++- + src/hb-subset-cff-common.hh | 22 ++++++++++++++++++++++ + 2 files changed, 33 insertions(+), 1 deletion(-) + +commit d77f346d1a822c7209192f55218fe707e6295183 +Author: Behdad Esfahbod +Date: Thu Nov 24 14:02:46 2022 -0700 + + [subset-cff] Minor rename + + src/hb-subset-cff-common.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 29a0fa089a6c0bf390a02ddaa1757d8894c1a0a7 +Author: Behdad Esfahbod +Date: Thu Nov 24 14:00:59 2022 -0700 + + [subset-cff] Micro-optimize + + src/hb-subset-cff-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d480ae1fac8c2d32fb9df851629b877248331416 +Author: Behdad Esfahbod +Date: Thu Nov 24 13:53:43 2022 -0700 + + [cff] Remove unused function + + src/hb-cff-interp-common.hh | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 73046d53e5e769ec8c4eff2a1b8306bb15ce0cce +Author: Behdad Esfahbod +Date: Thu Nov 24 13:49:29 2022 -0700 + + [shaper] Disable dumber shaper if no AAT + + src/hb-ot-shape.cc | 2 ++ + src/hb-ot-shaper-default.cc | 2 ++ + 2 files changed, 4 insertions(+) + +commit e9f964c01a4d1273f5632d34f8f3827608cab735 +Author: Behdad Esfahbod +Date: Thu Nov 24 13:38:53 2022 -0700 + + [ot-face] Declare more tables as core + + src/hb-machinery.hh | 2 +- + src/hb-ot-face-table-list.hh | 28 ++++++++++++++-------------- + 2 files changed, 15 insertions(+), 15 deletions(-) + +commit 5bc27a128dc5fb6ec65591c0f0632973ce9e8116 +Author: Behdad Esfahbod +Date: Thu Nov 24 13:30:12 2022 -0700 + + [machinery] Comment + + src/hb-machinery.hh | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit d21bfb08615f44ffd60737295b45da5e1a5fca7e +Author: Behdad Esfahbod +Date: Thu Nov 24 13:14:05 2022 -0700 + + [normalize] Remove an unlikely + + Keep unlikely for truely unlikely scenarios. + + src/hb-ot-shape-normalize.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 9e1239f443bce69200d7203cd3a89b921a382531 +Author: Behdad Esfahbod +Date: Thu Nov 24 13:00:47 2022 -0700 + + [config] Define HB_NO_VERTICAL in HB_LEAN and as such in HB_TINY + + src/hb-config.hh | 1 + + 1 file changed, 1 insertion(+) + +commit 6f133ccfde9c96ab6de8e18ddbbac4b7509eed0c +Author: Behdad Esfahbod +Date: Thu Nov 24 12:59:55 2022 -0700 + + [glyf] Fix build with HB_NO_VERTICAL + + src/OT/glyf/Glyph.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 76420ef769e828db3633578e814409c4ddc7b938 +Author: Behdad Esfahbod +Date: Thu Nov 24 12:52:15 2022 -0700 + + [machine.rl] Remove unlikely from what happens 1/16 of the time + + src/hb-ot-shaper-indic-machine.hh | 16 ++++++++-------- + src/hb-ot-shaper-indic-machine.rl | 2 +- + src/hb-ot-shaper-khmer-machine.hh | 16 ++++++++-------- + src/hb-ot-shaper-khmer-machine.rl | 2 +- + src/hb-ot-shaper-myanmar-machine.hh | 16 ++++++++-------- + src/hb-ot-shaper-myanmar-machine.rl | 2 +- + src/hb-ot-shaper-use-machine.hh | 16 ++++++++-------- + src/hb-ot-shaper-use-machine.rl | 2 +- + 8 files changed, 36 insertions(+), 36 deletions(-) + +commit 1248574454facabe15a96d7670243c7959f4a065 +Author: Behdad Esfahbod +Date: Thu Nov 24 12:46:04 2022 -0700 + + [config] Disable Zawgyi shaper in HB_MINI/HB_TINY + + src/hb-config.hh | 1 + + src/hb-ot-shaper-myanmar.cc | 2 ++ + src/hb-ot-shaper.hh | 2 ++ + 3 files changed, 5 insertions(+) + +commit 05aa084e67705285941c9acd13151e2a38da8b0f +Author: Behdad Esfahbod +Date: Thu Nov 24 12:13:31 2022 -0700 + + [PairPos] Another attempt at fixing unsafe-to-break with ValueFormat2 + + Fixes https://github.com/harfbuzz/harfbuzz/issues/3888#issuecomment-1326781116 + + Test: + $ hb-shape XBRoya34.ttf ' الأ' --show-flags --script=arab + + src/OT/Layout/GPOS/PairPosFormat2.hh | 9 +++++---- + src/OT/Layout/GPOS/PairSet.hh | 5 +++-- + 2 files changed, 8 insertions(+), 6 deletions(-) + +commit 54ae3345b225151d9f77189f1dec071c1f075ce9 +Author: Behdad Esfahbod +Date: Thu Nov 24 11:59:50 2022 -0700 + + [buffer] Improve documentation of hb_buffer_add_codepoints() + + Fixes https://github.com/harfbuzz/harfbuzz/issues/3889 + + src/hb-buffer.cc | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit a4a40786326cef97fe25eee2232852c9173347e7 +Merge: 0c70bc7f3 64e8707ec +Author: Behdad Esfahbod +Date: Thu Nov 24 11:56:58 2022 -0700 + + Merge pull request #3893 from googlefonts/preprocess_test + + [subset] Fix testing of preprocess + +commit 0c70bc7f3286ea0c04164f110a6d2caac805812c +Author: Behdad Esfahbod +Date: Thu Nov 24 11:48:48 2022 -0700 + + [skippy-iter] Fix two logic errors + + First, a signed underflow. + + Second, a wrong condition. + + Both were introduced in 42681bdb55a75520d4ac194302fe936d1ce3cb34 + + src/hb-ot-layout-gsubgpos.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 64e8707ecac726a4e78772875d069db3f5c0ad6a +Author: Garret Rieger +Date: Thu Nov 24 18:24:50 2022 +0000 + + [subset] don't use hb repacker when generating test files from fonttools. + + ...astaliqUrdu-Regular.default.627,644,62D,628.ttf | Bin 24564 -> 24532 bytes + .../NotoNastaliqUrdu-Regular.default.633,6D2.ttf | Bin 14296 -> 14292 bytes + ...otoNastaliqUrdu-Regular.default.63A,64A,631.ttf | Bin 26152 -> 26124 bytes + ...iqUrdu-Regular.default.retain-all-codepoint.ttf | Bin 542388 -> 542328 bytes + ...liqUrdu-Regular.retain-gids.627,644,62D,628.ttf | Bin 30464 -> 30432 bytes + ...otoNastaliqUrdu-Regular.retain-gids.633,6D2.ttf | Bin 20140 -> 20132 bytes + ...astaliqUrdu-Regular.retain-gids.63A,64A,631.ttf | Bin 32012 -> 31984 bytes + ...du-Regular.retain-gids.retain-all-codepoint.ttf | Bin 542424 -> 542360 bytes + test/subset/generate-expected-outputs.py | 2 ++ + 9 files changed, 2 insertions(+) + +commit 3b43096ef336cf3ba149518c82541c0079ef0f92 +Author: Behdad Esfahbod +Date: Wed Nov 23 22:04:02 2022 -0700 + + [buffer] Whitespace + + src/hb-buffer.cc | 1 - + 1 file changed, 1 deletion(-) + +commit 094f80738a57a99a9f541f55bbf8aa796235756c +Author: Behdad Esfahbod +Date: Wed Nov 23 22:03:26 2022 -0700 + + [buffer] Handle null buffer in set_message_func + + src/hb-buffer.cc | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit 1fa64c0c23ed86d60117198420587aee81fdc8d8 +Author: Behdad Esfahbod +Date: Wed Nov 23 21:38:51 2022 -0700 + + [gsubgpos] Conditionalize skippy on unsafe-to-concat + + src/hb-ot-layout-gsubgpos.hh | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit 42681bdb55a75520d4ac194302fe936d1ce3cb34 +Author: Behdad Esfahbod +Date: Wed Nov 23 21:36:43 2022 -0700 + + [gsubgpos] No logic-change minor rewrite + + src/hb-ot-layout-gsubgpos.hh | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit c15efdec496aae23f9e15d08b69d61f77bf6dee0 +Author: Behdad Esfahbod +Date: Wed Nov 23 21:14:28 2022 -0700 + + [gsubgpos] Comment + + src/hb-ot-layout-gsubgpos.hh | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 7ec1c41a55729808d61cb85fb2d632e0b488f53f +Author: Behdad Esfahbod +Date: Wed Nov 23 21:12:41 2022 -0700 + + [gsubgpos] Skippy-iter: Prefer correctness to performance + + Prefer unsafe-to-concat correctness, over performance. + + src/hb-ot-layout-gsubgpos.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit b6df3471379bfe66e9360cf1d6625c705e179018 +Author: Behdad Esfahbod +Date: Wed Nov 23 20:15:16 2022 -0700 + + [perf] Add Hindi test to benchmark-shape + + perf/benchmark-shape.cc | 4 + + perf/texts/hi-words.txt | 10000 ++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 10004 insertions(+) + +commit dce3502e10af6f52bffad94c2f772b3cae12fd5e +Author: Behdad Esfahbod +Date: Wed Nov 23 18:34:54 2022 -0700 + + [array] Add commented-out static asserts + + They don't work. + + src/hb-array.hh | 2 ++ + 1 file changed, 2 insertions(+) + +commit a7fee43cefce95097ba46591090395a3c882741c +Author: Behdad Esfahbod +Date: Wed Nov 23 17:46:32 2022 -0700 + + [priority-queue] Minor micro-optimize + + src/hb-priority-queue.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ff3cac0ccd0633a7715945e4c9f1e7243f75d1cb +Author: Garret Rieger +Date: Wed Nov 23 23:50:49 2022 +0000 + + [subset] Fix unecessary trailing 0 bytes left by ContextFormat2 pruning. + + Uneeded rules where beind removed from the count by the bytes for them was being left in the font. + + src/hb-ot-layout-gsubgpos.hh | 6 +++++- + ...subrules_f1.layout-test-retain-gids.41,42,43.otf | Bin 2152 -> 2148 bytes + ...le_subrules_f1.layout-test-retain-gids.41,42.otf | Bin 2028 -> 2024 bytes + ...layout-test-retain-gids.retain-all-codepoint.otf | Bin 4012 -> 4008 bytes + ...t2_multiple_subrules_f1.layout-test.41,42,43.otf | Bin 1440 -> 1436 bytes + ...text2_multiple_subrules_f1.layout-test.41,42.otf | Bin 1320 -> 1316 bytes + ...subrules_f1.layout-test.retain-all-codepoint.otf | Bin 4012 -> 4008 bytes + ...landhar-Regular.default.retain-all-codepoint.ttf | Bin 49248 -> 49244 bytes + ...dhar-Regular.drop-hints.retain-all-codepoint.ttf | Bin 29468 -> 29464 bytes + ...ndhar-Regular.keep-gdef.retain-all-codepoint.ttf | Bin 49248 -> 49244 bytes + ...subrules_f2.layout-test-retain-gids.41,42,43.otf | Bin 2256 -> 2252 bytes + ...le_subrules_f2.layout-test-retain-gids.41,42.otf | Bin 2224 -> 2220 bytes + ...layout-test-retain-gids.retain-all-codepoint.otf | Bin 4008 -> 4004 bytes + ...t2_multiple_subrules_f2.layout-test.41,42,43.otf | Bin 1460 -> 1456 bytes + ...text2_multiple_subrules_f2.layout-test.41,42.otf | Bin 1416 -> 1412 bytes + ...subrules_f2.layout-test.retain-all-codepoint.otf | Bin 4008 -> 4004 bytes + 16 files changed, 5 insertions(+), 1 deletion(-) + +commit f2851e4157e302d9932ef0582da6c36cade4f085 +Author: Behdad Esfahbod +Date: Wed Nov 23 16:50:30 2022 -0700 + + [test-map] Test has() getter with unique-ptr + + src/test-map.cc | 2 ++ + 1 file changed, 2 insertions(+) + +commit 5f3a780614ee76347fd0692439fe37a7fc02602e +Author: Behdad Esfahbod +Date: Wed Nov 23 16:45:46 2022 -0700 + + [font] Protect against div-by-zero + + src/hb-font.cc | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit 060ecac949dca29a75538ddeedf015441296334b +Author: Behdad Esfahbod +Date: Wed Nov 23 16:31:37 2022 -0700 + + [font] Respect subfont slant setting in hb-draw + + Fixes https://github.com/harfbuzz/harfbuzz/issues/3890 + + src/hb-font.cc | 34 ++++++++++++++++++++-------------- + 1 file changed, 20 insertions(+), 14 deletions(-) + +commit 2e9b270a496de14d3eee9d8b7e1372293bf13888 +Author: Behdad Esfahbod +Date: Wed Nov 23 16:17:50 2022 -0700 + + [hb-view] Fix cairo slanting condition + + hb-draw already does slanting. If NOT hb-draw, we should slant + through cairo path. Donno why this was untested before. + + This was double-slanting with hb-draw, and not slanting without it. + + util/helper-cairo.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 51028e63e68b2e06f969da9e4e727d5c2f912bf4 +Author: Garret Rieger +Date: Wed Nov 23 22:51:16 2022 +0000 + + [subset] Retain all glyphs in preprocessed face. + + src/hb-subset-input.cc | 3 +++ + 1 file changed, 3 insertions(+) + +commit 404cb99d86c2d639b4ce2fc59f00f5e66468af34 +Author: Behdad Esfahbod +Date: Wed Nov 23 15:35:14 2022 -0700 + + [buffer-diff] Fix check for glyph flag equality + + I'm not sure if the old behavior was intentional, but it was checking + that the glyph flags were a subset of the reference buffer's glyph + flags. I don't see why that is useful. Fix that. + + Then make the buffer-verify code ignore flag differences when verifying + buffers, since our unsafe-to-concat flag at least, is conservative and + not guaranteed to be produced the same in fragments. See: + + https://github.com/harfbuzz/harfbuzz/issues/3888 + + src/hb-buffer-verify.cc | 5 ++--- + src/hb-buffer.cc | 2 +- + 2 files changed, 3 insertions(+), 4 deletions(-) + +commit 4c49daf7cd961fb47126baf04240243736cae606 +Author: Garret Rieger +Date: Wed Nov 23 22:33:57 2022 +0000 + + [subset] actually use the preprocessed face in hb-subset. + + Tests weren't actually using the preprocessed face due to this typo in util/hb-subset. + + src/hb-subset-input.cc | 5 +++++ + util/hb-subset.cc | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +commit 2c0afde7370a27d1aa26983751a422f61924580c +Author: Garret Rieger +Date: Wed Nov 23 20:24:40 2022 +0000 + + [subset] add an inprogress accelerator to plan. + + This allows subset code to cache information into the accelerator during preprocess subset. Previously the accelerator was created at the end of subsetting. + + src/hb-subset-plan.cc | 11 +++++++++++ + src/hb-subset-plan.hh | 4 ++++ + src/hb-subset.cc | 11 ++++++----- + 3 files changed, 21 insertions(+), 5 deletions(-) + +commit 81640fdffe5a57191b392eda2d93fcf39183dbcf +Author: Garret Rieger +Date: Wed Nov 23 20:22:36 2022 +0000 + + [subset] fix leaked font in glyf::subset(...) + + src/OT/glyf/glyf.hh | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit dcce53ddcb52d10dca1ff1d3e118297175892c26 +Author: Behdad Esfahbod +Date: Wed Nov 23 13:19:38 2022 -0700 + + [cff] Micro-optimize fetch_op + + src/hb-cff-interp-common.hh | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 0bf7d9eb4dd1b706a139e56638d2e8db0ccab933 +Author: Behdad Esfahbod +Date: Wed Nov 23 13:00:23 2022 -0700 + + [subset-cff] Micro-optimize encode_byte + + src/hb-subset-cff-common.hh | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit a23f820427a7ae7be5b24d66265bd46fb0d4d6df +Author: Behdad Esfahbod +Date: Wed Nov 23 12:56:13 2022 -0700 + + [subset-cff] Micro-optimize array access + + src/hb-subset-cff-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 1e8f1ac6774226a12cb6d9794f300a103a590ea4 +Author: Behdad Esfahbod +Date: Wed Nov 23 12:28:29 2022 -0700 + + [subset-glyf] Micro-optimize array access + + src/OT/glyf/SimpleGlyph.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 356d135ed698042f6337486e5c8cb2fe6206c44a +Author: Behdad Esfahbod +Date: Wed Nov 23 12:20:51 2022 -0700 + + [subset-glyf] Reduce roundf calls + + Saves 7% on MPLUS1-Variable/6000 benchmark. + + src/OT/glyf/Glyph.hh | 30 +++++++++++++++--------------- + 1 file changed, 15 insertions(+), 15 deletions(-) + +commit 463ae07e9982e337b9340cb24598db57d008e33c +Author: Garret Rieger +Date: Wed Nov 23 18:41:23 2022 +0000 + + [subset] In the preprocess subset call always use long loca. + + Long loca is needed so that we can store the trimmed glyph bytes to allow us to safely skip trimming in the later subset. + + src/OT/glyf/glyf.hh | 9 ++++++--- + src/hb-subset-input.cc | 5 +++++ + src/hb-subset-input.hh | 4 ++++ + src/hb-subset-plan.cc | 1 + + src/hb-subset-plan.hh | 1 + + 5 files changed, 17 insertions(+), 3 deletions(-) + +commit 299ec902eb3f657b71517ac1cd1f477ceec6b409 +Author: Behdad Esfahbod +Date: Tue Nov 22 16:03:02 2022 -0700 + + [glyf] Move instanciation to serialize() + + src/OT/glyf/SubsetGlyph.hh | 10 +++++++++- + src/OT/glyf/glyf.hh | 46 ++++++++++++++-------------------------------- + 2 files changed, 23 insertions(+), 33 deletions(-) + +commit d8d881f22d634573afd4860415e9dda29ce44492 +Author: Behdad Esfahbod +Date: Tue Nov 22 15:24:16 2022 -0700 + + [subset-glyf] Don't create a second glyf accelerator + + src/OT/glyf/glyf.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 75609300707fedc45d7a2bc6d9b62793ad212aa4 +Author: Behdad Esfahbod +Date: Tue Nov 22 15:22:25 2022 -0700 + + [glyf] Add _create_font_for_instancing + + src/OT/glyf/glyf.hh | 24 ++++++++++++++++++------ + 1 file changed, 18 insertions(+), 6 deletions(-) + +commit 40634ceeb0bf1bdb6c2b12e90ecac9e45c2e4671 +Author: Behdad Esfahbod +Date: Tue Nov 22 15:07:16 2022 -0700 + + [glyf] Adjust data types + + src/OT/glyf/SimpleGlyph.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit ba0d28ea3647fe5d8108ba4f2ca60be7f267c043 +Author: Behdad Esfahbod +Date: Tue Nov 22 15:01:48 2022 -0700 + + [glyf] Fix font error check + + src/OT/glyf/glyf.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 04c525019c84e4683e99674624e199c0598e38e2 +Author: Behdad Esfahbod +Date: Tue Nov 22 14:54:55 2022 -0700 + + [glyf] Use a malloc instead of calloc + + src/OT/glyf/SimpleGlyph.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 024aa818051712a5ea14e8d1ad7603a5ab9ca4ef +Author: Behdad Esfahbod +Date: Tue Nov 22 14:51:42 2022 -0700 + + [glyf] Micro-optimize encode_coord + + src/OT/glyf/SimpleGlyph.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit b6694597f9b80d37fd8361723ae34861019a46ba +Author: Behdad Esfahbod +Date: Tue Nov 22 14:49:01 2022 -0700 + + [glyf] Micro-optimize encode_flag() + + src/OT/glyf/SimpleGlyph.hh | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit d47cfe79364391bd10ceb8588f4cdb55ff6e47e8 +Author: Behdad Esfahbod +Date: Tue Nov 22 14:45:04 2022 -0700 + + [glyf] Minor use operator ++ + + src/OT/glyf/SimpleGlyph.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 03e6bde79035a5d3e25c9a571fab8b1d916c069c +Author: Behdad Esfahbod +Date: Tue Nov 22 14:40:36 2022 -0700 + + [glyf] Minor adjustment to lastflag handling + + No logic change. + + src/OT/glyf/SimpleGlyph.hh | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +commit 0ca9fda889a97febac66bcc86bda9211628bd7ba +Author: Behdad Esfahbod +Date: Tue Nov 22 14:39:10 2022 -0700 + + [glyf] Remove misplaced comment + + src/OT/glyf/SimpleGlyph.hh | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 44be8ef4ce883f6ce9680f6f489d37722711fa8e +Author: Behdad Esfahbod +Date: Tue Nov 22 14:21:25 2022 -0700 + + [gvar] Skip degenerate all-untouched delta-sets + + src/hb-ot-var-gvar-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 656bb223f17343d68dcd6118d6afdb85b7298345 +Author: Behdad Esfahbod +Date: Tue Nov 22 14:16:40 2022 -0700 + + [gvar] Micro-optimize unpack_points + + src/hb-ot-var-gvar-table.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit a383027262d5d073da29e4bc45ef2b99c734a1de +Author: Behdad Esfahbod +Date: Tue Nov 22 14:15:17 2022 -0700 + + [gvar] Cosmetic + + src/hb-ot-var-gvar-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit be89919a7097d6ba1fa4e3042627d13fac545e53 +Author: Behdad Esfahbod +Date: Tue Nov 22 13:56:20 2022 -0700 + + [gvar] is_valid() remove a check + + I don't know why this check was there, but it doesn't make sense + because that function never returns 0 / false. + + src/hb-ot-var-gvar-table.hh | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit e8ddf107d0f3ecd66db901c748028bf642210ae8 +Author: Behdad Esfahbod +Date: Tue Nov 22 13:29:32 2022 -0700 + + [gvar] Optimize a loop + + src/hb-ot-var-gvar-table.hh | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit dd6fcec92ccc609435312dd42b9ae3c98c88af40 +Author: Behdad Esfahbod +Date: Tue Nov 22 13:27:40 2022 -0700 + + [gvar] Remove a conditional + + src/hb-ot-var-gvar-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a02317238af994b15f280b33d20a0eb8e75ae711 +Author: Behdad Esfahbod +Date: Tue Nov 22 13:24:39 2022 -0700 + + [gvar] Refactor deltas array access + + src/hb-ot-var-gvar-table.hh | 18 ++++++++++-------- + 1 file changed, 10 insertions(+), 8 deletions(-) + +commit c34c77698c473cdaa85a703a75db85ee5f328d7f +Author: Behdad Esfahbod +Date: Tue Nov 22 13:21:01 2022 -0700 + + [gvar] Don't try IUP if all points are specified + + src/hb-ot-var-gvar-table.hh | 84 ++++++++++++++++++++++++--------------------- + 1 file changed, 45 insertions(+), 39 deletions(-) + +commit 27c4037e5988d41b92c7c3904d4ceeea8c31586c +Author: Behdad Esfahbod +Date: Tue Nov 22 13:12:22 2022 -0700 + + [gvar] Micro-optimize boundary-checking + + src/hb-ot-var-gvar-table.hh | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +commit ab8346fb6fee2fd64204cc880c5f75f3b1b33ff9 +Author: Behdad Esfahbod +Date: Tue Nov 22 13:07:39 2022 -0700 + + [gvar] Add an unlikely + + src/hb-ot-var-gvar-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 1e8a342ea2769f368be6dbf0bf6b0aaf99af1db7 +Author: Behdad Esfahbod +Date: Tue Nov 22 13:02:38 2022 -0700 + + [gvar] Micro-optimize int types + + src/hb-ot-var-gvar-table.hh | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +commit 4afcdf675ba9b134a92659090aa4bf0b7a39d5f7 +Author: Behdad Esfahbod +Date: Tue Nov 22 12:56:48 2022 -0700 + + More hb_memcpy + + src/OT/glyf/CompositeGlyph.hh | 16 ++++++++-------- + src/OT/glyf/SimpleGlyph.hh | 10 +++++----- + src/graph/gsubgpos-graph.hh | 2 +- + src/graph/pairpos-graph.hh | 2 +- + src/graph/serialize.hh | 2 +- + 5 files changed, 16 insertions(+), 16 deletions(-) + +commit 58a696d80ed3158c88e8e95345642cbd4db75eaa +Author: Behdad Esfahbod +Date: Tue Nov 22 12:56:05 2022 -0700 + + More hb_memset + + src/OT/Layout/Common/Coverage.hh | 2 +- + src/hb-buffer-deserialize-json.rl | 4 ++-- + src/hb-buffer-deserialize-text.rl | 4 ++-- + 3 files changed, 5 insertions(+), 5 deletions(-) + +commit 59c45f6debd8e266286ba7b34314a3b625d8a307 +Author: Behdad Esfahbod +Date: Tue Nov 22 12:54:50 2022 -0700 + + Use hb_memcpy instead of memcpy consistently + + src/hb-aat-layout-morx-table.hh | 8 ++++---- + src/hb-blob.cc | 2 +- + src/hb-buffer-serialize.cc | 8 ++++---- + src/hb-buffer.cc | 6 +++--- + src/hb-cff-interp-common.hh | 2 +- + src/hb-common.cc | 8 ++++---- + src/hb-font.cc | 10 +++++----- + src/hb-open-file.hh | 2 +- + src/hb-ot-cff-common.hh | 6 +++--- + src/hb-ot-cff1-table.hh | 4 ++-- + src/hb-ot-cff2-table.hh | 4 ++-- + src/hb-ot-color-cbdt-table.hh | 2 +- + src/hb-ot-layout-common.hh | 2 +- + src/hb-ot-math-table.hh | 4 ++-- + src/hb-ot-name-table.hh | 2 +- + src/hb-ot-post-table.hh | 2 +- + src/hb-ot-stat-table.hh | 2 +- + src/hb-ot-tag.cc | 2 +- + src/hb-ot-var-common.hh | 2 +- + src/hb-ot-var-gvar-table.hh | 4 ++-- + src/hb-serialize.hh | 8 ++++---- + src/hb-shape-plan.cc | 2 +- + src/hb-shaper.cc | 2 +- + src/hb-subset-cff-common.hh | 4 ++-- + src/hb-uniscribe.cc | 4 ++-- + src/test-repacker.cc | 2 +- + 26 files changed, 52 insertions(+), 52 deletions(-) + +commit ac0efaf8181636fdecbffa79c629547e072f5287 +Author: Behdad Esfahbod +Date: Tue Nov 22 12:50:36 2022 -0700 + + Use hb_memset instead of memset consistently + + src/hb-aat-map.hh | 2 +- + src/hb-bit-page.hh | 6 +++--- + src/hb-buffer-deserialize-json.hh | 4 ++-- + src/hb-buffer-deserialize-text.hh | 28 ++++++++++++++-------------- + src/hb-buffer.cc | 12 ++++++------ + src/hb-common.cc | 4 ++-- + src/hb-font.cc | 6 +++--- + src/hb-font.hh | 6 +++--- + src/hb-graphite2.cc | 2 +- + src/hb-ot-map.cc | 2 +- + src/hb-ot-map.hh | 2 +- + src/hb-pool.hh | 2 +- + src/hb-uniscribe.cc | 2 +- + 13 files changed, 39 insertions(+), 39 deletions(-) + +commit 44a892a233e0441a0bac84a680aebf2362f2c227 +Author: Behdad Esfahbod +Date: Tue Nov 22 12:48:52 2022 -0700 + + [shape] Use hb_memcmp instead of memcmp + + src/hb-ot-shape.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c53c64812724762b91ff397c56f6701d42d000b5 +Author: Behdad Esfahbod +Date: Tue Nov 22 12:46:25 2022 -0700 + + [subset-cff] Another handrolled memcpy + + src/hb-subset-cff-common.hh | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +commit ae578705c2ac7f8d520ff5f6646c2efe57469902 +Author: Behdad Esfahbod +Date: Tue Nov 22 12:23:17 2022 -0700 + + [array] Write hash as range for loop again + + Now that our range loop is faster than our own iter. + + src/hb-array.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 13e1ca9eb520d7a5ca1092d2bf8566669d8b5580 +Author: Behdad Esfahbod +Date: Tue Nov 22 12:19:28 2022 -0700 + + [cff] Micro-optimize memcpy + + src/hb-cff-interp-common.hh | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 2968dd7844c71734e0e052bb1a9eb7875e214961 +Author: Behdad Esfahbod +Date: Tue Nov 22 11:57:29 2022 -0700 + + [gvar] Optimize as_array() access + + src/hb-ot-var-gvar-table.hh | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +commit bb3bb76450c575321aecf33b74e5b51d0c5c75e3 +Author: Behdad Esfahbod +Date: Tue Nov 22 11:53:35 2022 -0700 + + [gvar] Optimize scalar = 1.0 case + + src/hb-ot-var-gvar-table.hh | 26 ++++++++++++++++++-------- + 1 file changed, 18 insertions(+), 8 deletions(-) + +commit 2d098d5d7f223d587abe4e8926a911cfbb5eef62 +Author: Behdad Esfahbod +Date: Tue Nov 22 11:51:04 2022 -0700 + + [gvar] Use memset + + src/hb-ot-var-gvar-table.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit e630a65e604ea4d1fc4fb4818c456c3d450fede4 +Author: Behdad Esfahbod +Date: Tue Nov 22 11:27:05 2022 -0700 + + [gvar] Micro-optize vector extend + + src/hb-ot-var-gvar-table.hh | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +commit 49d4f62135f34983ea1e47828f6f549d4f581f9a +Author: Behdad Esfahbod +Date: Tue Nov 22 11:14:56 2022 -0700 + + [gvar] Micro-optimize + + src/hb-ot-var-gvar-table.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 1758ee6646f69f80bbcd79d93fc4992aeaf6c2bc +Author: Behdad Esfahbod +Date: Tue Nov 22 10:45:49 2022 -0700 + + [glyf] Minor write loop more idiomatically + + src/OT/glyf/SimpleGlyph.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 16ec9dcc1bb7f4e710d4c4b83f3900dc15b29c3b +Author: Behdad Esfahbod +Date: Tue Nov 22 10:43:46 2022 -0700 + + [gvar] Whitespace + + src/hb-ot-var-gvar-table.hh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit b567ce51d3724c6dc89cce72257dd5baf245fc9a +Author: Behdad Esfahbod +Date: Mon Nov 21 20:08:54 2022 -0700 + + [subset] Don't trim glyf's again if preprocessed + + Speeds up M1/10000 benchmark by 30%! + + src/OT/glyf/glyf.hh | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 72059a47891d2ecf875dcf36836a2cabe599502a +Author: Behdad Esfahbod +Date: Tue Nov 22 10:41:37 2022 -0700 + + [gvar] Optimize IUP alg + + src/hb-ot-var-gvar-table.hh | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +commit ee9873b5ede5ee14a542dd1d4bc470695487c5f4 +Author: Behdad Esfahbod +Date: Tue Nov 22 10:23:17 2022 -0700 + + [gvar] Disable initializing vectors when not necessary + + src/hb-ot-var-gvar-table.hh | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +commit b0d2641186e269da1f1556bf7d1c8b8c7763ccb3 +Author: Behdad Esfahbod +Date: Tue Nov 22 10:20:11 2022 -0700 + + [vector] Add "initialize" argument to resize() + + src/hb-vector.hh | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +commit a2059f8f55ebbc8cbc6adf7df0d1886ee130f2dd +Author: Behdad Esfahbod +Date: Tue Nov 22 10:16:21 2022 -0700 + + [gvar] Optimize unpack_points + + src/hb-ot-var-gvar-table.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 6d7206b68bbb4cd99f2a53ff8ac61114d272a958 +Author: Behdad Esfahbod +Date: Tue Nov 22 10:13:14 2022 -0700 + + [gvar] Optimize unpack_deltas + + src/hb-ot-var-gvar-table.hh | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +commit bca569ae535e4fb7a38f9ec9514e667fc15a29d2 +Author: Behdad Esfahbod +Date: Mon Nov 21 23:19:42 2022 -0700 + + [array] Speed up hash() for byte arrays + + src/hb-array.hh | 32 ++++++++++++++++++++++++++++---- + 1 file changed, 28 insertions(+), 4 deletions(-) + +commit d7b492e3f589f8ba0d034a818a83a1d14a86b443 +Author: Behdad Esfahbod +Date: Mon Nov 21 23:08:51 2022 -0700 + + Revert "[array] Remove hash specializations for bytes" + + This reverts commit 213117317cefeb4e75d21c5c21e383309f116bb0. + + src/hb-array.hh | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +commit 1572ba281acb7fb3510d97e0f52bea83a1d6050d +Author: Behdad Esfahbod +Date: Mon Nov 21 22:26:44 2022 -0700 + + [subset-cff] Return in subr closure if already seen subr + + Not sure why this was not done before. + + src/hb-subset-cff-common.hh | 2 ++ + 1 file changed, 2 insertions(+) + +commit a29ca6efbc7ee4a7832fdf66bdda07654e28496a +Author: Behdad Esfahbod +Date: Mon Nov 21 22:02:17 2022 -0700 + + [subset-cff] Comment + + src/hb-subset-cff-common.hh | 3 +++ + 1 file changed, 3 insertions(+) + +commit 28e767ddea3acea744fad3f8e44f1f8f3b4d198d +Author: Behdad Esfahbod +Date: Mon Nov 21 21:59:51 2022 -0700 + + [subset-cff] Really optimize op_str_t / parsed_cs_op_t layout + + Now parsed_cs_op_t and op_str_t are both 16 bytes. + + Saves another 7% in SourceHanSans/10000 benchmark. + + src/hb-cff-interp-common.hh | 9 ++++++--- + src/hb-subset-cff-common.hh | 5 +++-- + 2 files changed, 9 insertions(+), 5 deletions(-) + +commit 2d5ee23731ecbd779a36142cd32f8d50eae88ff2 +Author: Behdad Esfahbod +Date: Mon Nov 21 21:37:38 2022 -0700 + + [subset-cff] Readjust parsed_cs_op_t + + Now it doesn't matter anymore since op_str_t is adjusted and + is 16 bytes with 8byte alignment. + + src/hb-subset-cff-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 4f056b923a99236b70d52236a4e3c293242c3216 +Author: Behdad Esfahbod +Date: Mon Nov 21 21:37:38 2022 -0700 + + [subset-cff] Optimize op_str_t layout + + src/hb-cff-interp-common.hh | 18 +++++++++++++----- + src/hb-subset-cff-common.hh | 20 ++++++++++---------- + src/hb-subset-cff1.cc | 5 +++-- + 3 files changed, 26 insertions(+), 17 deletions(-) + +commit a750cb012855558e137c8eb483af1c94ea7d3e00 +Author: Behdad Esfahbod +Date: Mon Nov 21 21:03:32 2022 -0700 + + Simplify rvalue creation + + src/hb-subset-plan.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 86a763c651090094f35f1995cba7a923aaa9e0d3 +Author: Behdad Esfahbod +Date: Mon Nov 21 20:53:44 2022 -0700 + + [map] Make keys moveable + + src/hb-map.hh | 10 ++++++---- + src/test-map.cc | 6 ++---- + 2 files changed, 8 insertions(+), 8 deletions(-) + +commit cf20d2ec5d609a5a9319b5b1f6cdf5616d41d13d +Author: Behdad Esfahbod +Date: Mon Nov 21 20:46:01 2022 -0700 + + [map] Take const key + + src/hb-map.hh | 10 +++++----- + src/hb-subset-plan.hh | 6 +++--- + src/test-map.cc | 2 +- + 3 files changed, 9 insertions(+), 9 deletions(-) + +commit 3d1c76f713844f192aa11af956e9ee84f097b071 +Author: Behdad Esfahbod +Date: Mon Nov 21 19:40:32 2022 -0700 + + [serializer] Don't hash objects twice + + src/hb-map.hh | 78 ++++++++++++++++++++++++++--------------------------- + src/hb-serialize.hh | 6 +++-- + src/test-map.cc | 2 +- + 3 files changed, 43 insertions(+), 43 deletions(-) + +commit 35878df2155f38e981acde5888141bb61bd9ab63 +Author: Behdad Esfahbod +Date: Mon Nov 21 19:14:03 2022 -0700 + + [algs] Implement swap() for pair_t + + Helps priority_queue::pop_minimum and friends, which help subsetter + repacker. Shows a few percentage improvement on NotoNastaliq benchmark. + + src/hb-algs.hh | 29 ++++++++++++++++++----------- + 1 file changed, 18 insertions(+), 11 deletions(-) + +commit a2984a2932c94312d75dfc64485c8afaa97a34b0 +Author: Behdad Esfahbod +Date: Mon Nov 21 18:40:01 2022 -0700 + + [cff] Remove unnecessary namespacing + + src/hb-ot-cff-common.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit dc3bb5e0ed4f44e3a11474656ecf2cd8b7d86a68 +Author: Behdad Esfahbod +Date: Mon Nov 21 18:18:48 2022 -0700 + + [subset-cff] Pre-allocate values array for subroutines as well + + src/hb-cff-interp-common.hh | 2 ++ + src/hb-subset-cff-common.hh | 4 ++++ + 2 files changed, 6 insertions(+) + +commit c6279224dbe5b2b8d3895cd91429178fc408e23a +Author: Behdad Esfahbod +Date: Mon Nov 21 18:01:50 2022 -0700 + + [cff] Adjust pre-allocation + + This better matches actual usage, given that ops are one or two + bytes, and vector also allocates 50% extra. + + src/hb-subset-cff-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit bab8ec58b044272d45d584e8f16c6715ca21ee89 +Author: Behdad Esfahbod +Date: Mon Nov 21 17:46:32 2022 -0700 + + [subset-cff] Disable sharing when packing charstring INDEXes + + Saves another 8%ish. + + src/hb-subset-cff1.cc | 6 +++--- + src/hb-subset-cff2.cc | 4 ++-- + 2 files changed, 5 insertions(+), 5 deletions(-) + +commit 2cadacad6c1da254fc778db3300aa6c53d0de420 +Author: Behdad Esfahbod +Date: Mon Nov 21 17:17:15 2022 -0700 + + [cff] Simplify str_encoder_t error handling + + src/hb-subset-cff-common.hh | 16 ++++------------ + 1 file changed, 4 insertions(+), 12 deletions(-) + +commit f263e3fe2e11810a517925d580640a21402ae36b +Author: Behdad Esfahbod +Date: Mon Nov 21 17:04:55 2022 -0700 + + [cff] Manually copy short strings instead of memcpy() + + src/hb-subset-cff-common.hh | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 38efd1862fd42e8323aa93da9c6f9685ea4919fc +Author: Behdad Esfahbod +Date: Mon Nov 21 17:02:11 2022 -0700 + + [cff] Add a likely() + + src/hb-subset-cff-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 191025cc96b2f72dd893619b7d296001609c168d +Author: Behdad Esfahbod +Date: Mon Nov 21 16:58:19 2022 -0700 + + [cff] Adjust buffer pre-allocation + + Most ops take one or two bytes, so allocate count*2, not count*3. + Shows minor speedup in subsetting benchmark (around 2%). + + src/hb-subset-cff-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 4b2caafea2cd2902b866a94c965f20d1caabad5e +Author: Behdad Esfahbod +Date: Mon Nov 21 16:46:20 2022 -0700 + + [subset-cff] Optimize parsed_cs_op_t size + + Shows 5% speedup on SourceHanSans-Regular/10000 benchmark. + + src/hb-subset-cff-common.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit e0b06bd1b1daaac4d8e020db9ac3ec1fcaad38b6 +Author: Behdad Esfahbod +Date: Mon Nov 21 16:09:39 2022 -0700 + + [subset] Cache has_seac in accelerator + + Speeds up SourceHanSans-Regular/10000 benchmark by %25. + + src/hb-subset-accelerator.hh | 5 ++++- + src/hb-subset-plan.cc | 16 ++++++++++++---- + src/hb-subset-plan.hh | 1 + + src/hb-subset.cc | 3 ++- + 4 files changed, 19 insertions(+), 6 deletions(-) + +commit dd1ba328a8d49ff43633eda43013fd5dd1fe2ada +Author: Garret Rieger +Date: Mon Nov 21 23:20:59 2022 +0000 + + [repacker] fix fuzzer timeout. + + For https://oss-fuzz.com/testcase-detail/5845846876356608. Only process the set of unique overflows. + + src/graph/serialize.hh | 21 +++++++++++++++++++++ + ...ase-minimized-hb-subset-fuzzer-5845846876356608 | Bin 0 -> 427854 bytes + 2 files changed, 21 insertions(+) + +commit 59451502e99ff0dd73361a53fc576cb8b0057d75 +Author: Behdad Esfahbod +Date: Mon Nov 21 15:23:16 2022 -0700 + + [cff] Optimize env error checking + + src/hb-cff-interp-common.hh | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +commit b238578a9c9255282b7634bcbf751f03001ceda6 +Author: Behdad Esfahbod +Date: Mon Nov 21 14:36:57 2022 -0700 + + [cff] Optimize INDEX operator[] + + src/hb-ot-cff-common.hh | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +commit d9de515a382c169f50a56fc7292aa96f62366ce8 +Author: Behdad Esfahbod +Date: Mon Nov 21 14:23:07 2022 -0700 + + [cff] Optimize byte_str_ref_t array access + + src/hb-cff-interp-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a81ec9b2b6734e66c0d532ae4da1b6788dd59f0c +Author: Behdad Esfahbod +Date: Mon Nov 21 14:03:28 2022 -0700 + + [cff] Optimize byte_str_ref_t inc() + + Shows a couple percent speedup. + + src/hb-cff-interp-common.hh | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +commit 3ff75411bdc29094c4664f834703dc5c4cf117c7 +Author: Behdad Esfahbod +Date: Mon Nov 21 13:08:55 2022 -0700 + + [algs] Fix bot fail + + src/hb-algs.hh | 2 +- + src/hb-ot-shaper-thai.cc | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit b81e3989f83da88e387e04b54bdb85d1f26ed5e4 +Author: Behdad Esfahbod +Date: Mon Nov 21 13:02:40 2022 -0700 + + Try fixing arm-eabi build after a10cfe3f32861c13578dc21476b2fe4d2e0af43c + + src/hb-ot-shaper-thai.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 4c14043b06cb28cef5a8a6ebfc39a0c83902d423 +Author: Behdad Esfahbod +Date: Mon Nov 21 12:56:33 2022 -0700 + + [algs] Add output argument to hb_unsigned_mul_overflows() + + src/hb-algs.hh | 10 +++++++--- + src/hb-buffer.cc | 20 ++++++++++---------- + src/hb-sanitize.hh | 15 +++++++++------ + 3 files changed, 26 insertions(+), 19 deletions(-) + +commit 25adbb382535de2c981755df211295249a93c4e2 +Author: Behdad Esfahbod +Date: Mon Nov 21 12:47:53 2022 -0700 + + [algs] Use __builtin_mul_overflow + + Compiles to smaller binary. + + src/hb-algs.hh | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit a10cfe3f32861c13578dc21476b2fe4d2e0af43c +Author: Behdad Esfahbod +Date: Mon Nov 21 12:37:59 2022 -0700 + + [algs] Write hb_in_ranges() recursively + + src/hb-algs.hh | 15 +++++---------- + 1 file changed, 5 insertions(+), 10 deletions(-) + +commit 2e86700e30265e839f7b00e4bdaf43b5fe04bde2 +Author: Behdad Esfahbod +Date: Mon Nov 21 12:28:10 2022 -0700 + + [gvar] Add memory-barrier as in ArrayOf + + src/hb-ot-var-gvar-table.hh | 1 + + 1 file changed, 1 insertion(+) + +commit b00a911fa721598b1b7c44943790671506091542 +Author: Behdad Esfahbod +Date: Mon Nov 21 12:11:30 2022 -0700 + + [sorted-array] Add faster iterator implementation here as well + + src/hb-array.hh | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 7cc79a8a86835bc641bf56c0b82e36063f44e22f +Author: Behdad Esfahbod +Date: Mon Nov 21 12:09:24 2022 -0700 + + [vector] Adjust comment + + src/hb-vector.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e82a3c69dd5155b7bcd41fe2131514fa780da24a +Author: Behdad Esfahbod +Date: Mon Nov 21 12:00:10 2022 -0700 + + [array/vector] Optimize range-based for-loop + + Avoid bounds-checking. + + src/hb-array.hh | 5 +++++ + src/hb-iter.hh | 16 ++++++++++------ + src/hb-ot-map.cc | 3 +-- + src/hb-vector.hh | 5 +++++ + 4 files changed, 21 insertions(+), 8 deletions(-) + +commit 0387182c2a198c69f2313bc8627762477bae4bde +Author: Behdad Esfahbod +Date: Mon Nov 21 11:05:47 2022 -0700 + + [ot-map] Minor refactor features[i] access + + src/hb-ot-map.cc | 17 ++++++++++------- + 1 file changed, 10 insertions(+), 7 deletions(-) + +commit 5ee6d5d77e373314e007d736f04b3686723d1cfd +Author: Behdad Esfahbod +Date: Mon Nov 21 11:00:29 2022 -0700 + + [cff] Add memory-barrier to INDEX + + Like we do for ArrayOf. + + src/hb-ot-cff-common.hh | 1 + + 1 file changed, 1 insertion(+) + +commit 6905d36d73f7b33243aaa8507ded49272462d3f8 +Author: Behdad Esfahbod +Date: Mon Nov 21 10:51:33 2022 -0700 + + [cff] Fix fetch_op() bounds-checking + + src/hb-cff-interp-common.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit b51ab1a9e515f10ed6906b9e1149120854c48260 +Author: Behdad Esfahbod +Date: Mon Nov 21 10:27:07 2022 -0700 + + [cff] Optimize byte_str_ref_t + + Make it 16 bytes instead of 24. This struct is used in the subroutine + call stack heavily. + + This change makes the HB AdobeVFPrototype benchmark to become faster + than FT one, with about 6% speedup as a result of this change. + + src/hb-cff-interp-common.hh | 36 ++++++++++++++++-------------------- + 1 file changed, 16 insertions(+), 20 deletions(-) + +commit 7a39464b1883dd4e04608427522d545e049c8389 +Author: Behdad Esfahbod +Date: Mon Nov 21 09:48:54 2022 -0700 + + [cff] Hide members of byte_str_ref_t + + src/hb-cff-interp-common.hh | 13 +++++++------ + src/hb-ot-cff1-table.hh | 2 +- + 2 files changed, 8 insertions(+), 7 deletions(-) + +commit 18141f00070d2134fb45a68edad026cc83b0f2ea +Author: Behdad Esfahbod +Date: Mon Nov 21 09:47:03 2022 -0700 + + [cff] Move a sub_array call + + No logic change.... I hope?! + + src/hb-cff-interp-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f66415cdd17009463cbc79e6fe3af1edc08a3649 +Author: Behdad Esfahbod +Date: Mon Nov 21 09:39:27 2022 -0700 + + [cff] Move initialization of a type to constructor + + src/hb-cff-interp-common.hh | 12 ++---------- + 1 file changed, 2 insertions(+), 10 deletions(-) + +commit 70a5cd53f645ff70f6dbcb306fbde3bc778abece +Author: Behdad Esfahbod +Date: Mon Nov 21 08:52:33 2022 -0700 + + [algs] Assert trivial copy assignable in stable_sort + + src/hb-algs.hh | 3 +++ + 1 file changed, 3 insertions(+) + +commit 9bb39423f5c46fb2f69ac8975de1433020e46411 +Author: Behdad Esfahbod +Date: Sun Nov 20 17:40:54 2022 -0700 + + [algs] Simplify stable_sort signatures + + src/hb-algs.hh | 10 ++-------- + 1 file changed, 2 insertions(+), 8 deletions(-) + +commit d119568df6bb1691bb9f8146a020811ded5c8dfd +Author: Behdad Esfahbod +Date: Sun Nov 20 14:11:51 2022 -0700 + + [cbdt] Use vector tail() + + src/hb-ot-color-cbdt-table.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 87a88117c8fe819eccce98c71e5f912a756ade96 +Author: Behdad Esfahbod +Date: Sun Nov 20 14:10:39 2022 -0700 + + [object] Use vector tail() + + src/hb-object.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 76ce390b5ae15004ff8abf8c6360a377c0656dd6 +Author: Behdad Esfahbod +Date: Sun Nov 20 13:54:56 2022 -0700 + + [ucd] Document algorithms + + src/gen-ucd-table.py | 33 ++++++++++++++++++++++++++++++--- + src/hb-ucd.cc | 16 ++++++++++++++++ + 2 files changed, 46 insertions(+), 3 deletions(-) + +commit ed43bc5118edb0cdcbbfac4d31f514d7aa86ebe4 +Author: Behdad Esfahbod +Date: Sun Nov 20 13:10:19 2022 -0700 + + [buffer] Move delete_glyphs_inplace() here + + src/hb-aat-layout.cc | 2 +- + src/hb-buffer.cc | 47 +++++++++++++++++++++++++++++++++++++++++++++++ + src/hb-buffer.hh | 2 ++ + src/hb-ot-layout.cc | 50 -------------------------------------------------- + src/hb-ot-layout.hh | 4 ---- + src/hb-ot-shape.cc | 2 +- + 6 files changed, 51 insertions(+), 56 deletions(-) + +commit dd88dae8a9f140c6bbc44d3efd44a37acc71c0c4 +Author: Behdad Esfahbod +Date: Sat Nov 19 15:22:39 2022 -0700 + + [unicode] Simplify set_funcs a bit more + + src/hb-unicode.cc | 13 +++++-------- + 1 file changed, 5 insertions(+), 8 deletions(-) + +commit 2d8ff3bcbe69f9d573f2075ef0e3c3d061f1133f +Author: Behdad Esfahbod +Date: Sat Nov 19 15:23:44 2022 -0700 + + [unicode] Destroy user_data in set_funcs fail paths + + This is what the font_funcs / draw_funcs do. + + src/hb-unicode.cc | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 527823ccacf2b1e9807ea5b15e8ea15c1f4ddeb1 +Author: Behdad Esfahbod +Date: Sat Nov 19 15:19:08 2022 -0700 + + [unicode] Destroy user_data in set_funcs fail paths + + This is what the font_funcs / draw_funcs do. + + src/hb-unicode.cc | 14 +++++++++++++- + test/api/test-unicode.c | 4 ++-- + 2 files changed, 15 insertions(+), 3 deletions(-) + +commit 56d6b6992b630ea81b681b2876dbcee97164b617 +Author: Behdad Esfahbod +Date: Sat Nov 19 15:08:50 2022 -0700 + + [font/draw] Remove unneeded branch + + The preamble sets user_data/destroy to nullptr if func is nullptr. + + src/hb-draw.cc | 19 +++++++------------ + src/hb-font.cc | 18 +++++++----------- + 2 files changed, 14 insertions(+), 23 deletions(-) + +commit 976bb26cc14909273959695691c65b099349666b +Author: Behdad Esfahbod +Date: Sat Nov 19 15:06:23 2022 -0700 + + [draw] Optimize set_func functions + + src/hb-draw.cc | 72 +++++++++++++++++++++++++++++++++++++++++++--------------- + src/hb-font.cc | 18 +++++++-------- + 2 files changed, 63 insertions(+), 27 deletions(-) + +commit 114167a9333ebd492832ed45fcf86484def1d909 +Author: Behdad Esfahbod +Date: Sat Nov 19 14:47:45 2022 -0700 + + [font] Optimize set_func functions + + src/hb-font.cc | 81 ++++++++++++++++++++++++++++++++++++++-------------------- + 1 file changed, 54 insertions(+), 27 deletions(-) + +commit f9d7b303ede471a58393d730c4ca3cf935ac7f8b +Author: Behdad Esfahbod +Date: Sat Nov 19 14:20:36 2022 -0700 + + [thai] Use smaller type for arrays + + No logic change. + + src/hb-ot-shaper-thai.cc | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 72c4e431af13a2c5108998b6d23d3f36d0f97b25 +Author: Behdad Esfahbod +Date: Sat Nov 19 13:40:33 2022 -0700 + + [use-table] Add a OPTIMIZE_SIZE version + + src/gen-use-table.py | 28 ++++- + src/hb-ot-shaper-use-table.hh | 270 ++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 293 insertions(+), 5 deletions(-) + +commit 83c3a91dc6a1e666383987e37e2ef934ffb245bc +Author: Behdad Esfahbod +Date: Sat Nov 19 13:34:58 2022 -0700 + + [gen-use-table] Report fullCost + + src/gen-use-table.py | 4 ++++ + 1 file changed, 4 insertions(+) + +commit ba08de624ef42229933061ae9837512196b5c53e +Author: Behdad Esfahbod +Date: Sat Nov 19 13:14:18 2022 -0700 + + [ucd] Change OPTIMIZE_SIZE to compression level 9 + + Also changes default compression level from 3 to 5, but that shows + no change in the generated table size. + + src/gen-ucd-table.py | 24 +- + src/hb-ucd-table.hh | 3892 ++++++++++++++++++++++++-------------------------- + 2 files changed, 1871 insertions(+), 2045 deletions(-) + +commit b68f9f3cfecc23c7f1af128256e652cdb2c04a80 +Author: Behdad Esfahbod +Date: Fri Nov 18 21:35:35 2022 -0700 + + [machinery] Adjust comment + + src/hb-machinery.hh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit a47ba1dc0eafa93af0b390f8cc61a8d0573cbf1a +Author: Behdad Esfahbod +Date: Fri Nov 18 21:14:07 2022 -0700 + + [lazy-pointer] Hide instance + + src/hb-machinery.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 281b4705b43503e0a377a6ac251f4b48ae00542f +Author: Behdad Esfahbod +Date: Fri Nov 18 20:25:05 2022 -0700 + + [pool] Rewrite a loop as dagger + + src/hb-pool.hh | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 3ff8abf27287da410883b0f4305cb9426206a60f +Author: Behdad Esfahbod +Date: Fri Nov 18 19:35:49 2022 -0700 + + Revert "[map] Allow std::move-ing keys into the map" + + This reverts commit f657ef7e57c889309c2d9d37934368ca255f9d5b. + + This breaks many compilers with messages like this: + + hb-subset-plan.hh:226: undefined reference to `OT::head::tableTag' + + I'm out of my depth re how to fix it. + + src/hb-map.hh | 15 ++++++--------- + src/test-map.cc | 6 ++++-- + 2 files changed, 10 insertions(+), 11 deletions(-) + +commit 039e476baccd87786e79e3b483c526d784f5631c +Author: Behdad Esfahbod +Date: Fri Nov 18 19:26:02 2022 -0700 + + [test-vector] Test sink-move'ing + + src/test-vector.cc | 3 +++ + 1 file changed, 3 insertions(+) + +commit a3a218edb57e63f49b49ef847b258b641609a1d7 +Author: Behdad Esfahbod +Date: Fri Nov 18 19:24:41 2022 -0700 + + [map] Add a couple more sink interfaces + + src/hb-map.hh | 4 ++++ + src/test-map.cc | 2 ++ + 2 files changed, 6 insertions(+) + +commit 90226eab8933975cb5a6f4e7f7f8067c0a24a68a +Author: Behdad Esfahbod +Date: Fri Nov 18 19:21:58 2022 -0700 + + [test-map] Test inserting shared_ptr key + + src/test-map.cc | 2 ++ + 1 file changed, 2 insertions(+) + +commit f657ef7e57c889309c2d9d37934368ca255f9d5b +Author: Behdad Esfahbod +Date: Fri Nov 18 19:17:03 2022 -0700 + + [map] Allow std::move-ing keys into the map + + src/hb-map.hh | 15 +++++++++------ + src/test-map.cc | 2 ++ + 2 files changed, 11 insertions(+), 6 deletions(-) + +commit a1768ad82938922cda34603371af86ff8035beac +Author: Behdad Esfahbod +Date: Fri Nov 18 19:08:34 2022 -0700 + + [map] Fix use of != + + src/hb-map.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e74b372b59db623f246499db12e8e9707648ccce +Author: Behdad Esfahbod +Date: Fri Nov 18 18:41:39 2022 -0700 + + [test-map] Test moving values + + src/test-map.cc | 17 +++++++++++++++-- + 1 file changed, 15 insertions(+), 2 deletions(-) + +commit a9c6a20b193bfa26a43b0d5a1021038dfe4c8ba4 +Author: Behdad Esfahbod +Date: Fri Nov 18 18:29:12 2022 -0700 + + [map] Support moving value in sink interface + + src/hb-algs.hh | 2 +- + src/hb-map.hh | 2 ++ + src/test-map.cc | 10 +++++++++- + 3 files changed, 12 insertions(+), 2 deletions(-) + +commit 1bf9afaad0c7b05d6fbd97805449561b4cc4c5fe +Author: Behdad Esfahbod +Date: Fri Nov 18 18:20:50 2022 -0700 + + [test-vector] Test sink interface + + src/test-vector.cc | 1 + + 1 file changed, 1 insertion(+) + +commit fa0e4b041d8d3525a84f838a27b84d2a100025cf +Author: Behdad Esfahbod +Date: Fri Nov 18 18:20:14 2022 -0700 + + [test-map] Test sink interface + + src/test-map.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 1c612a85415ed3b0aec4907817f5ed7211dd1c3c +Author: Behdad Esfahbod +Date: Fri Nov 18 18:18:42 2022 -0700 + + [test-set] Test sinking range + + src/test-set.cc | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit 356708e34a52bbf22cafa44771ee6eeaefc8a80b +Author: Behdad Esfahbod +Date: Fri Nov 18 18:17:34 2022 -0700 + + [test-set] Test length of iterator + + src/test-set.cc | 2 ++ + 1 file changed, 2 insertions(+) + +commit 2892fc71e8733890db666afe0ccbd491c0c0bbd2 +Author: Behdad Esfahbod +Date: Fri Nov 18 18:03:59 2022 -0700 + + [vector] Add std::move to pop() + + This was removed in 76fc27713f52cc338f0325650c2c7798f5cfa2ce, + but I believe that was faultly. It was because of a bad move + implementation in the set. + + src/hb-vector.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 921f45f46d2f973113d79fd68adb59ae8c0141af +Author: Behdad Esfahbod +Date: Fri Nov 18 17:26:58 2022 -0700 + + [array] Rewrite hash() as dagger + + src/hb-array.hh | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit 213117317cefeb4e75d21c5c21e383309f116bb0 +Author: Behdad Esfahbod +Date: Fri Nov 18 17:24:23 2022 -0700 + + [array] Remove hash specializations for bytes + + Not needed. + + src/hb-array.hh | 15 --------------- + 1 file changed, 15 deletions(-) + +commit bef5a1c8dc5fd2930e2fd395ad6c1ec4a6a0c2c3 +Author: Behdad Esfahbod +Date: Fri Nov 18 17:22:17 2022 -0700 + + [vector] Comment + + src/hb-vector.hh | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 69b41f92ec97e3c6822541a96daea66258eba637 +Author: Behdad Esfahbod +Date: Fri Nov 18 17:04:34 2022 -0700 + + [vector] Simplify shift_down_vector() + + Compiler is smarter than I am. + + src/hb-vector.hh | 11 ----------- + 1 file changed, 11 deletions(-) + +commit 1dd9396c7a4c24fe9d578551fab735bdd699e52a +Author: Behdad Esfahbod +Date: Fri Nov 18 17:01:14 2022 -0700 + + [vector] Optimize grow_vector() for size + + Again, compiler is smarter than I am. + + src/hb-vector.hh | 10 ---------- + 1 file changed, 10 deletions(-) + +commit d36f688131070308c222ebb54fbb188c6cbe278f +Author: Behdad Esfahbod +Date: Fri Nov 18 17:00:07 2022 -0700 + + [vector] Optimize shrink_vector for size + + Compiler is smarter than I am. + + src/hb-vector.hh | 13 +------------ + 1 file changed, 1 insertion(+), 12 deletions(-) + +commit bc8eded2963376901be02f9d0f563c980b0a67b0 +Author: Behdad Esfahbod +Date: Fri Nov 18 16:51:24 2022 -0700 + + [vector] Remove a for loop + + src/hb-vector.hh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit afd9a58bd76032f98fa1daf579c780121ddcdfb6 +Author: Behdad Esfahbod +Date: Fri Nov 18 16:46:01 2022 -0700 + + [vector] Save a couple hb_iter() invocations + + src/hb-vector.hh | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit 3ead9863d2fc6ab64984ae5ba49c6c3005679138 +Author: Behdad Esfahbod +Date: Fri Nov 18 16:43:47 2022 -0700 + + [map] Add size() + + src/hb-map.hh | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +commit 42db8be1897862d0545471b48a8da765496c7aa0 +Author: Behdad Esfahbod +Date: Fri Nov 18 16:41:50 2022 -0700 + + [map] Minor remove if condition + + src/hb-map.hh | 19 +++++++++---------- + 1 file changed, 9 insertions(+), 10 deletions(-) + +commit 4ec706980c9f5583b9c6db2862b9603bba284055 +Author: Behdad Esfahbod +Date: Fri Nov 18 16:39:30 2022 -0700 + + [map] Rewrite hash() as dagger + + Somehow our daggers instead of for loop save size. I cannot + pinpoint why, other than maybe not inlining. + + src/hb-map.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 025a68cb074cde6b150f7edaf9fa87cb11773b56 +Author: Behdad Esfahbod +Date: Fri Nov 18 16:33:04 2022 -0700 + + [map] Optimize copy resizing logic + + src/hb-map.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f1d716871d64641136f2f7f17b0731bed59f3a12 +Author: Behdad Esfahbod +Date: Fri Nov 18 16:31:27 2022 -0700 + + [map] Change bucket_for_hash() to item_for_hash() + + src/hb-map.hh | 26 +++++++++++++------------- + 1 file changed, 13 insertions(+), 13 deletions(-) + +commit d012f9a9b3a38cc313a07780b68e6494cc8c97c0 +Author: Behdad Esfahbod +Date: Fri Nov 18 16:29:06 2022 -0700 + + [map] Change bucket_for() to item_for() + + src/hb-map.hh | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +commit 68a29020c586a17bcefead7041cf64033a0c3cea +Author: Behdad Esfahbod +Date: Fri Nov 18 16:02:45 2022 -0700 + + [bit-page] Write hash() as dagger + + src/hb-bit-page.hh | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit 87271e1b2e3e313ab21ee78f947d7470b01fac72 +Author: Behdad Esfahbod +Date: Fri Nov 18 16:01:23 2022 -0700 + + [bit-page] Write get_population as dagger + + src/hb-bit-page.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 744eb6baf9ff060af52a6457c012e0f6f4c0a0ce +Author: Behdad Esfahbod +Date: Fri Nov 18 15:56:06 2022 -0700 + + [bit-page] Write is_empty() as dagger + + src/hb-bit-page.hh | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +commit 43a4028f0e22c70a979164ddf037c1f6709a3524 +Author: Behdad Esfahbod +Date: Fri Nov 18 15:54:34 2022 -0700 + + [algs] Move hb_vector_size_t to bit-page as only user + + src/hb-algs.hh | 43 ------------------------------------------- + src/hb-bit-page.hh | 44 ++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 44 insertions(+), 43 deletions(-) + +commit 01f961ac3a1fdfb31c184e66a5b772239a579764 +Author: Behdad Esfahbod +Date: Fri Nov 18 15:47:17 2022 -0700 + + [gsubgpos] Minor call hb_iter() instead of ->iter() directly + + src/hb-ot-layout-gsubgpos.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit bba5765583c5857622512c8c99a40cecc7b38839 +Author: Behdad Esfahbod +Date: Fri Nov 18 14:52:17 2022 -0700 + + [gsubgpos] Remove a few unnecessary namespace invocations + + src/hb-ot-layout-gsubgpos.hh | 34 +++++++++++++++++----------------- + 1 file changed, 17 insertions(+), 17 deletions(-) + +commit b4d0d1608d5b86ae5b3021fbf98db0472911c578 +Author: Behdad Esfahbod +Date: Fri Nov 18 14:47:33 2022 -0700 + + [gsubgpos] Rewrite a couple apply() functions as daggers + + src/hb-ot-layout-gsubgpos.hh | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +commit 76c8214eb51fada2d99c460b59307c7acc4ad074 +Author: Behdad Esfahbod +Date: Fri Nov 18 12:30:46 2022 -0700 + + [gsubgpos] Move member around + + src/hb-ot-layout-gsubgpos.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 81a573008e407a67b9c0ea22d4a9a2d9c22222ac +Author: Behdad Esfahbod +Date: Thu Nov 17 16:59:36 2022 -0700 + + [map] Optimize storage + + src/hb-map.hh | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +commit ae080bf202e08f3b9748a2d752ee5a1cc8a522f1 +Author: Behdad Esfahbod +Date: Thu Nov 17 16:34:58 2022 -0700 + + [map] Initialize key and value explicitly + + If they are of int time they won't be initialized otherwise. + + src/hb-map.hh | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +commit 1d41b9cb3c5078f4d0dd5b693e611ac8724ec91d +Author: Behdad Esfahbod +Date: Thu Nov 17 16:26:48 2022 -0700 + + [user-data] std::move item + + src/hb-object.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ff0bb74895ad6b43792cdc2e3add9cbe9c712a15 +Author: Behdad Esfahbod +Date: Thu Nov 17 16:17:37 2022 -0700 + + [map] Call item_t constructor/destructor directly + + src/hb-map.hh | 34 ++++++++++++++-------------------- + 1 file changed, 14 insertions(+), 20 deletions(-) + +commit 5c8871594955133a5652d4fad07bec20805bfbcf +Author: Behdad Esfahbod +Date: Thu Nov 17 16:14:16 2022 -0700 + + [map] Add item_t.destruct() + + src/hb-map.hh | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit 7f83040836e77c13e5a704ee76b83840389876d4 +Author: Behdad Esfahbod +Date: Thu Nov 17 16:10:37 2022 -0700 + + [map] Simplify (de)construction of item_t + + src/hb-map.hh | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +commit 99103bd9768fbb2063542c60ecdae317df0ce155 +Author: Behdad Esfahbod +Date: Thu Nov 17 15:57:06 2022 -0700 + + [map] Destruct objects when clearing + + src/hb-map.hh | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +commit 4caad5720cecbf28bb9b11aceba4ab8bf79f611e +Author: Behdad Esfahbod +Date: Thu Nov 17 15:51:39 2022 -0700 + + [test-map] Add test for reset + + I expect this to leak now, since we don't destruct items. + + src/test-map.cc | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit e93c01c3ae4e7ed019455dd9098034b506b8c49a +Author: Behdad Esfahbod +Date: Thu Nov 17 15:50:00 2022 -0700 + + [map] Rename item clear() to construct() + + src/hb-map.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit fc22d706fe1f72212ad1fba61435a1484b75ffe6 +Author: Behdad Esfahbod +Date: Thu Nov 17 15:46:48 2022 -0700 + + [test-map] Don't insert null smart-pointers in map + + Dereferencing them is not supported anymore after + 3aad7c2ddffc3f882bf33504dbac31be491c4d72 + + We don't support that for regular pointers, so don't supporting + them for smart-pointers sounds right to me. + + src/test-map.cc | 4 ---- + 1 file changed, 4 deletions(-) + +commit 896377463f880fa653e49184f81ce1190d05e082 +Author: Behdad Esfahbod +Date: Thu Nov 17 15:25:45 2022 -0700 + + [map] Don't resize map if not necessary + + src/hb-map.hh | 2 ++ + 1 file changed, 2 insertions(+) + +commit 7595fa2d9a15518a9ca41f6892a17fd36858e5af +Author: Behdad Esfahbod +Date: Thu Nov 17 15:19:29 2022 -0700 + + [map] Fix copy-assignment operator + + Ouch! + + src/hb-map.hh | 2 +- + src/test-map.cc | 13 ++++++++++++- + 2 files changed, 13 insertions(+), 2 deletions(-) + +commit 41f4bdac357a8b4e4a04a470e7afd11f9d416beb +Author: Behdad Esfahbod +Date: Thu Nov 17 15:16:00 2022 -0700 + + [map] Fix resize during copy-construction/assignment + + src/hb-map.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 3aad7c2ddffc3f882bf33504dbac31be491c4d72 +Author: Behdad Esfahbod +Date: Thu Nov 17 15:10:47 2022 -0700 + + [algs] Remove smart-pointers from hb_hash() + + hb_deref() handles them. I think this code predated that. + + src/hb-algs.hh | 11 ----------- + 1 file changed, 11 deletions(-) + +commit 7bd101728ac1c0223f9f4cda50d37e006bb069da +Author: Behdad Esfahbod +Date: Thu Nov 17 15:01:55 2022 -0700 + + [map] Minor use hb_iter instead of hb_array + + src/hb-map.hh | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +commit 238fc14716bc976c1e2891668e79d177a805b8c0 +Author: Behdad Esfahbod +Date: Thu Nov 17 14:58:50 2022 -0700 + + [map] Simplify iterators + + src/hb-map.hh | 35 ++++++++++++++++------------------- + 1 file changed, 16 insertions(+), 19 deletions(-) + +commit 410c14bfa2c5584d785ac1865a1cd273dfba8c50 +Author: Behdad Esfahbod +Date: Thu Nov 17 14:53:00 2022 -0700 + + [map] Fix equality + + Ouch! + + src/hb-map.hh | 2 +- + src/test-map.cc | 12 +++++++++++- + 2 files changed, 12 insertions(+), 2 deletions(-) + +commit 6dfd4a16e7dd18944c506764983e87f0098bf338 +Author: Behdad Esfahbod +Date: Wed Nov 16 22:44:22 2022 -0700 + + [ot-font] Remove stale TODO + + src/hb-ot-font.cc | 1 - + 1 file changed, 1 deletion(-) + +commit a0bde1e1ea5b6496c84424d47461ee48c4517bdc +Author: Behdad Esfahbod +Date: Wed Nov 16 21:27:12 2022 -0700 + + [open-type] Remove (Sorted)ArrayOf.sub_array() + + src/OT/Layout/GSUB/AlternateSet.hh | 2 +- + src/hb-open-file.hh | 2 +- + src/hb-open-type.hh | 18 ------------------ + src/hb-ot-layout-common.hh | 6 +++--- + src/hb-ot-layout-gdef-table.hh | 4 ++-- + src/hb-ot-math-table.hh | 4 ++-- + src/hb-ot-meta-table.hh | 2 +- + 7 files changed, 10 insertions(+), 28 deletions(-) + +commit f2b5db700f1674e96f7bbf1face89507351e103c +Author: Behdad Esfahbod +Date: Wed Nov 16 21:22:43 2022 -0700 + + [vector] Remove .sub_array () + + src/OT/glyf/Glyph.hh | 4 ++-- + src/hb-ot-map.cc | 2 +- + src/hb-vector.hh | 9 --------- + 3 files changed, 3 insertions(+), 12 deletions(-) + +commit c7d57dcf260288818fc0b74852a588d8e5611a12 +Author: Behdad Esfahbod +Date: Wed Nov 16 21:21:31 2022 -0700 + + [vector/array] Simplify qsort() + + src/hb-array.hh | 7 ------- + src/hb-open-type.hh | 4 ++-- + src/hb-ot-map.cc | 2 +- + src/hb-vector.hh | 4 +--- + 4 files changed, 4 insertions(+), 13 deletions(-) + +commit 1610008e623ad7cf60b20c28fb02808cdf709aef +Author: Behdad Esfahbod +Date: Wed Nov 16 20:02:36 2022 -0700 + + [gsubgpos] Minor remove call to hb_iter + + src/hb-ot-layout-gsubgpos.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 19ec01d25c68f90bb78150b81363f6744089aa22 +Author: Behdad Esfahbod +Date: Wed Nov 16 19:14:42 2022 -0700 + + [gsubgpos] Sprinkle const around + + src/hb-ot-layout-gsubgpos.hh | 27 +++++++++++++++------------ + 1 file changed, 15 insertions(+), 12 deletions(-) + +commit 561946c7d57ce2370835236182f475946d646406 +Author: Behdad Esfahbod +Date: Wed Nov 16 17:58:59 2022 -0700 + + [layout] Comment + + src/hb-ot-layout.cc | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 2268207c19b417e07da4b808b3df257811158c25 +Author: Behdad Esfahbod +Date: Wed Nov 16 17:51:22 2022 -0700 + + [layout] Update comment + + src/hb-ot-map.hh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 658f8f4391d768ce87fe7213e7443e79e0982c04 +Author: Behdad Esfahbod +Date: Wed Nov 16 17:50:35 2022 -0700 + + [layout] Comment + + src/hb-ot-map.hh | 1 + + 1 file changed, 1 insertion(+) + +commit 27a8fe7d58d5bf361ce829ddd9916f8042e129ae +Author: Behdad Esfahbod +Date: Wed Nov 16 17:49:44 2022 -0700 + + [layout] Only update buffer digest if buffer changed by a pause + + src/hb-ot-layout.cc | 9 +++++---- + src/hb-ot-layout.hh | 3 ++- + src/hb-ot-map.hh | 2 +- + src/hb-ot-shaper-arabic.cc | 19 +++++++++++-------- + src/hb-ot-shaper-indic.cc | 33 ++++++++++++++++++++------------- + src/hb-ot-shaper-khmer.cc | 21 +++++++++++++-------- + src/hb-ot-shaper-myanmar.cc | 19 ++++++++++++------- + src/hb-ot-shaper-syllabic.cc | 12 +++++++----- + src/hb-ot-shaper-syllabic.hh | 4 ++-- + src/hb-ot-shaper-use.cc | 33 ++++++++++++++++++++------------- + 10 files changed, 93 insertions(+), 62 deletions(-) + +commit 8b2a2111235af22ca969898737835e904badf92f +Author: Behdad Esfahbod +Date: Wed Nov 16 16:57:44 2022 -0700 + + [layout] Keep digest updated in the context + + Don't recompute digest after every (applied) GSUB lookup. + + src/hb-ot-layout-gsubgpos.hh | 16 ++++++++++------ + src/hb-ot-layout.cc | 19 +++++++++---------- + 2 files changed, 19 insertions(+), 16 deletions(-) + +commit a5964a2d2a064941b7090f49f1da2b55938fa95a +Author: Behdad Esfahbod +Date: Wed Nov 16 16:45:23 2022 -0700 + + [layout] Minor simplify + + src/hb-ot-layout.cc | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +commit 443961971adcfd1a8a2c1d3e8a3aeb8a49297bed +Author: Behdad Esfahbod +Date: Wed Nov 16 16:35:00 2022 -0700 + + [perf] Add fa-words.txt and use in shape benchmark + + perf/benchmark-shape.cc | 4 + + perf/texts/fa-words.txt | 10000 ++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 10004 insertions(+) + +commit 80b87588815bee1be0d083665425caed176ad09e +Author: Behdad Esfahbod +Date: Wed Nov 16 16:26:41 2022 -0700 + + [layout] Add a buffer message for digest-skipped lookups + + src/hb-ot-layout.cc | 2 ++ + 1 file changed, 2 insertions(+) + +commit afa71ee8effa697888daa4e89e4547fa634c42ba +Author: Behdad Esfahbod +Date: Wed Nov 16 16:22:45 2022 -0700 + + Fix alignment error + + src/hb-set-digest.hh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit dff1b809a0535d3c32cf7e8f10cbd5fb8926bca9 +Author: Behdad Esfahbod +Date: Wed Nov 16 16:19:05 2022 -0700 + + [buffer] Add .digest() and use + + src/hb-buffer.hh | 9 +++++++++ + src/hb-ot-layout.cc | 11 ++--------- + 2 files changed, 11 insertions(+), 9 deletions(-) + +commit 654a2eafc8a0710b2c2edcb4b7d8098bf801cd50 +Author: Behdad Esfahbod +Date: Wed Nov 16 16:09:04 2022 -0700 + + [layout] Use buffer-digest for GSUB as well + + Combined with previous commit, this shows up to 12% speed up with + Roboto and the en-words (ie. short strings) benchmark, about 5% + for longer English tests, and no adverse effect on heavier fonts. + + src/hb-ot-layout.cc | 34 +++++++++++++++++++++------------- + 1 file changed, 21 insertions(+), 13 deletions(-) + +commit 15b6c3259957f9bbfab848530aa4ff8ece89780e +Author: Behdad Esfahbod +Date: Wed Nov 16 15:59:13 2022 -0700 + + [layout] Use a buffer digest for GPOS to skip whole lookups + + src/hb-ot-layout-gsubgpos.hh | 2 +- + src/hb-ot-layout.cc | 37 +++++++++++++++++++++++++------------ + src/hb-set-digest.hh | 8 ++++++++ + 3 files changed, 34 insertions(+), 13 deletions(-) + +commit a053b84cb92bb8624ae407265377475f45b9f095 +Author: Behdad Esfahbod +Date: Wed Nov 16 14:39:25 2022 -0700 + + [gsubgpos] Optimize set-digest initialization + + Previously we were once collecting set-digest for each subtable, + and another time for each lookup. + + Now we compute the one for each lookup simply from the ones for + its subtables. + + src/hb-ot-layout-gsubgpos.hh | 7 ++++--- + src/hb-set-digest.hh | 8 ++++++++ + 2 files changed, 12 insertions(+), 3 deletions(-) + +commit 20654cd8891a75e6e44f3f0a467a6d53d65ab3f9 +Author: Behdad Esfahbod +Date: Wed Nov 16 14:15:58 2022 -0700 + + [set-digest] Minor no logic change + + src/hb-set-digest.hh | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +commit 95b9763dbc011e5aa32b8a9faf2146aa552d6eef +Author: Behdad Esfahbod +Date: Wed Nov 16 14:15:01 2022 -0700 + + [set-digest] Minor simplify + + src/hb-set-digest.hh | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +commit 9855b678f218ca89376dad44032cd3fc73aadbba +Author: Behdad Esfahbod +Date: Wed Nov 16 13:37:34 2022 -0700 + + [cache] Minor rewrite assertion + + src/hb-cache.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a10ff20562f9a77b2f1510bdb70a70f3d2699f1c +Author: Behdad Esfahbod +Date: Wed Nov 16 13:34:37 2022 -0700 + + [ft] Comment + + src/hb-ft.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 557be9502a49b6a2ed736fed8937b77f6afdd5af +Author: Behdad Esfahbod +Date: Wed Nov 16 12:47:05 2022 -0700 + + [test-vector] Fix test + + src/test-vector.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 9027d15410a889a903839aba12b08280d53551ea +Author: Behdad Esfahbod +Date: Wed Nov 16 12:39:30 2022 -0700 + + [test-iter] Fix leak + + src/test-iter.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit afd716d4cdaa7ac314bc806b4ac4f761d51fbc2e +Author: Behdad Esfahbod +Date: Wed Nov 16 12:28:56 2022 -0700 + + [serialize] Don't free object-pool in reset() + + src/hb-pool.hh | 9 +++------ + src/hb-serialize.hh | 1 - + 2 files changed, 3 insertions(+), 7 deletions(-) + +commit 02949cf64f6bc9fb9faf5d143519cf50126347f5 +Author: Behdad Esfahbod +Date: Wed Nov 16 12:06:44 2022 -0700 + + [priority-queue] More assert adjustment + + src/hb-priority-queue.hh | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 620ddd762d586d8189212715b56d270ccc6db683 +Author: Behdad Esfahbod +Date: Wed Nov 16 12:04:35 2022 -0700 + + [priority-queue] Fix asserts + + src/hb-priority-queue.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 57de568aad32ea2f1be894536d695a6aa6b4a12a +Author: Behdad Esfahbod +Date: Wed Nov 16 11:50:05 2022 -0700 + + [indic-table] Minor adjust empty lines + + src/gen-indic-table.py | 6 +++--- + src/hb-ot-shaper-indic-table.cc | 14 ++++++-------- + 2 files changed, 9 insertions(+), 11 deletions(-) + +commit 281a2602cc1c5974814d9eb639e17e1dfd3d112c +Author: Behdad Esfahbod +Date: Wed Nov 16 11:36:33 2022 -0700 + + Update generated file + + src/hb-buffer-deserialize-json.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit f734c26c5c78f56e2d1875f5ce262b6a06093d70 +Author: Behdad Esfahbod +Date: Tue Nov 15 16:27:56 2022 -0700 + + [test-vector] Test inserting set and map + + src/test-vector.cc | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +commit 0a97d27c2b80554d58a51a2f5037a341c18ac993 +Author: Behdad Esfahbod +Date: Tue Nov 15 16:23:48 2022 -0700 + + [test-iter] Add another test + + src/test-iter.cc | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +commit e9e985682af41a8aa106cb0252592a64b536a6db +Author: Behdad Esfahbod +Date: Tue Nov 15 16:11:57 2022 -0700 + + [fallback-shape] Remove TODO + + src/hb-fallback-shape.cc | 10 ---------- + 1 file changed, 10 deletions(-) + +commit 6df8498da2662cf949770d580d0744817c8acfb8 +Author: Behdad Esfahbod +Date: Tue Nov 15 15:52:04 2022 -0700 + + [sample.py] Fix warning + + src/sample.py | 2 ++ + 1 file changed, 2 insertions(+) + +commit 49fe5c1e5a329d033e55ce87ceff7fae1bf28f4b +Author: Behdad Esfahbod +Date: Tue Nov 15 15:37:23 2022 -0700 + + [glib] Remove old cruft from pre-2011 + + src/hb-glib.cc | 77 +++------------------------------------------------------- + 1 file changed, 4 insertions(+), 73 deletions(-) + +commit 1bd1a37837c1a57fc8a440a6a75b7e6c2778b810 +Author: Behdad Esfahbod +Date: Tue Nov 15 15:18:36 2022 -0700 + + [test] Minor + + src/test-map.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 35aa492eb71def762ecb24c924c1b65c6abb340c +Author: Behdad Esfahbod +Date: Tue Nov 15 15:05:15 2022 -0700 + + [main] sprintf -> snprintf + + src/main.cc | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +commit 72c6962012fab7a4bfe345687d10f8d08c672151 +Author: Behdad Esfahbod +Date: Mon Nov 14 21:34:16 2022 -0700 + + [buffer-deserialize-text] Fix glyph name for glyph flags + + Skip "#" in glyph names. + + src/hb-buffer-deserialize-text.hh | 462 +++++++++++++------------------------- + src/hb-buffer-deserialize-text.rl | 2 +- + 2 files changed, 160 insertions(+), 304 deletions(-) + +commit dee26de76fc3fdfa2dbfc780c62120206229f1f2 +Author: Behdad Esfahbod +Date: Mon Nov 14 16:24:25 2022 -0700 + + [test-buffer-serialize] Allow no font + + src/test-buffer-serialize.cc | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +commit f6076890c5103f7078196d14cfc15323a4781b17 +Author: Behdad Esfahbod +Date: Mon Nov 14 16:06:39 2022 -0700 + + Hide all mentions of name_table_overrides behind EXPERIMENTAL_API + + Fixes https://github.com/harfbuzz/harfbuzz/issues/3872 + + src/hb-ot-name-table.hh | 39 ++++++++++++++++++++++++++++++--------- + src/hb-subset-input.cc | 13 +++++++++++-- + src/hb-subset-input.hh | 8 +++++++- + src/hb-subset-plan.cc | 3 ++- + src/hb-subset-plan.hh | 4 ++++ + 5 files changed, 54 insertions(+), 13 deletions(-) + +commit ebc382a8474af5a8829750db8f641b384f6f47ec +Author: Behdad Esfahbod +Date: Mon Nov 14 15:59:46 2022 -0700 + + Revert "Avoid use values () in hb-hashmap if value_t has an overriden operator &" + + This reverts commit b92e4cc0091e093f6941019e1a53cc04a137017a. + + src/hb-subset-input.cc | 7 +++---- + src/hb-subset-plan.cc | 7 +++---- + src/hb-subset-plan.hh | 6 ++---- + 3 files changed, 8 insertions(+), 12 deletions(-) + +commit ff0d0d020e0fcf7be4e45d6791eb5c7155f5c84b +Author: Behdad Esfahbod +Date: Mon Nov 14 14:34:20 2022 -0700 + + [meta] Use std::decay + + src/hb-meta.hh | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 9650f34a84006c714ac81c72ee59b249bf4e9788 +Author: Behdad Esfahbod +Date: Mon Nov 14 14:16:11 2022 -0700 + + [CI] Remove coverage testing from macos-ci + + .github/workflows/macos-ci.yml | 10 ++-------- + 1 file changed, 2 insertions(+), 8 deletions(-) + +commit 3a9ca6aa698d112c8c7d6733dbbc438b701fd917 +Author: Behdad Esfahbod +Date: Mon Nov 14 13:57:02 2022 -0700 + + [CI] Try fixing macos-ci + + .github/workflows/macos-ci.yml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 24cf86b0099ada427936b3113c5b48c3537b3425 +Author: Behdad Esfahbod +Date: Mon Nov 14 13:33:06 2022 -0700 + + [array] Fix MSVC fail + + src/test-array.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit a87843be3dea86a5893e1fa64667df872408549e +Author: Behdad Esfahbod +Date: Mon Nov 14 13:43:58 2022 -0700 + + [array] Another try at sizeof sorted_array + + src/hb-array.hh | 8 ++++---- + src/test-array.cc | 3 +-- + 2 files changed, 5 insertions(+), 6 deletions(-) + +commit 72ba0b2aa2bd65ea1bfdbca75fe4127264590e00 +Author: Behdad Esfahbod +Date: Mon Nov 14 13:33:06 2022 -0700 + + [array] Fix MSVC fail + + src/test-array.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit b92e4cc0091e093f6941019e1a53cc04a137017a +Author: Qunxin Liu +Date: Mon Nov 14 08:54:24 2022 -0800 + + Avoid use values () in hb-hashmap if value_t has an overriden operator & + + src/hb-subset-input.cc | 7 ++++--- + src/hb-subset-plan.cc | 7 ++++--- + src/hb-subset-plan.hh | 6 ++++-- + 3 files changed, 12 insertions(+), 8 deletions(-) + +commit ea63e95e4cc287d8efbad6fd215a0b4c541a9e15 +Author: Behdad Esfahbod +Date: Fri Nov 11 12:45:12 2022 -0700 + + [GPOS.PairPos] Adjust unsafe-to-break for non-zero ValueFormat2 + + Fixes https://github.com/harfbuzz/harfbuzz/issues/3824 + + src/OT/Layout/GPOS/PairPosFormat2.hh | 4 ++++ + src/OT/Layout/GPOS/PairSet.hh | 7 ++++++- + 2 files changed, 10 insertions(+), 1 deletion(-) + +commit 85e0be13575d1342645867bc1a788e13e196594f +Author: Behdad Esfahbod +Date: Sun Nov 13 17:28:09 2022 -0700 + + [vector/array] Add simple test for sorted size + + src/test-array.cc | 2 ++ + src/test-vector.cc | 1 + + 2 files changed, 3 insertions(+) + +commit 4e618557a67f6ce49f93d5c10686500628bede30 +Author: Behdad Esfahbod +Date: Sun Nov 13 17:23:25 2022 -0700 + + [vector] Don't subclass sorted vector from unsorted + + Was doubling the size unnecessarily. + + src/hb-vector.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 8f15fb125247de8b19e8b5a9396f40a83114a64a +Author: Behdad Esfahbod +Date: Sun Nov 13 17:06:58 2022 -0700 + + [util] Move variable closer to use + + util/shape-consumer.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 630f09c8b6022184f7a414bb5e07c01898fae60c +Author: Behdad Esfahbod +Date: Wed Nov 9 11:32:30 2022 -0700 + + Another hb_memcpy instead of strncpy use + + src/hb-subset-plan.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit cd011ceadfa443767fd818cfe1af8a87150291a2 +Author: Behdad Esfahbod +Date: Wed Nov 9 11:30:44 2022 -0700 + + Use hb_memcpy instead of strncpy + + Nul-termination is not intended. + + src/hb-subset-input.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 604fe807078ce41d0ac7742547e90b17c066709f +Author: Eli Schwartz +Date: Tue Nov 8 16:24:08 2022 -0500 + + meson: fix regression in detecting freetype2/icu-uc when explicitly disabled + + In #3811 / commit 53a194aa3f5f7de0b40e879e41fcbe0de6e9fefe a broken and + half-implemented approach to kind of sort of handling the detection of + both pkg-config and cmake names for dependencies, was implemented. It + just checked for both versions with required: false, but when the build + was configured with *disabled* options, it was still found because it + was treated as auto. + + Really, the problem here is trying to outsmart Meson, which handles a + lot of edge cases correctly. But it's possible, albeit very wordy, to + manually implement Meson's internal logic via if/else fallbacks. Do so + here. + + meson.build | 79 +++++++++++++++++++++++++++++++++++++++++++------------------ + 1 file changed, 56 insertions(+), 23 deletions(-) + +commit c158b626c3033036321180d4ac90c129206b0ad2 +Author: Behdad Esfahbod +Date: Tue Nov 8 14:15:56 2022 -0700 + + [name] Simplify buffer-length calculation + + src/hb-ot-name-table.hh | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +commit 55edf59d521d06a981b16af44a9d6f217093d73b +Author: Behdad Esfahbod +Date: Tue Nov 8 14:53:27 2022 -0700 + + [name] Typo + + src/hb-ot-name-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 27c8bbcb04d506670dad8bbe3b9e9d1bde466aa8 +Author: Behdad Esfahbod +Date: Tue Nov 8 14:48:38 2022 -0700 + + Revert "[name] Simplify buffer-length calculation" + + This reverts commit d70595657e8d56b52d5714d082092d8eb104093e. + + src/hb-ot-name-table.hh | 12 ++++-------- + 1 file changed, 4 insertions(+), 8 deletions(-) + +commit d70595657e8d56b52d5714d082092d8eb104093e +Author: Behdad Esfahbod +Date: Tue Nov 8 14:15:56 2022 -0700 + + [name] Simplify buffer-length calculation + + src/hb-ot-name-table.hh | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +commit 6314aa7da4204379cd3ebeeaa447a51fbd7ef7bc +Author: Qunxin Liu +Date: Fri Oct 28 10:44:48 2022 -0700 + + [subset] add an experimental API that can override name strings for specified name_id + + src/gen-def.py | 1 + + src/hb-ot-name-table.hh | 83 ++++++++++++++++++++++++++-- + src/hb-ot-name.cc | 51 +---------------- + src/hb-subset-input.cc | 50 ++++++++++++++++- + src/hb-subset-input.hh | 3 +- + src/hb-subset-plan.cc | 23 ++++++++ + src/hb-subset-plan.hh | 11 ++++ + src/hb-subset.h | 7 +++ + test/api/fonts/nameID.override.expected.ttf | Bin 0 -> 167936 bytes + test/api/test-subset-nameids.c | 35 ++++++++++++ + 10 files changed, 208 insertions(+), 56 deletions(-) + +commit f53ef69d5941514b06f5afbcd83709cf724eb74d +Author: Behdad Esfahbod +Date: Fri Nov 4 16:00:34 2022 -0600 + + [indic] Order left-matras inside-out + + Fixes https://github.com/harfbuzz/harfbuzz/issues/3863 + + src/hb-ot-shaper-indic.cc | 28 ++++++++++++++++++++- + src/hb-ot-shaper-myanmar.cc | 27 ++++++++++++++++++++ + .../9d8c53cb64b8747abdd2b70755cce2ee0eb42ef7.ttf | Bin 0 -> 3000 bytes + .../a232bb734d4c6c898a44506547d19768f0eba6a6.ttf | Bin 0 -> 2512 bytes + .../data/in-house/tests/indic-special-cases.tests | 2 ++ + test/shape/data/in-house/tests/myanmar-misc.tests | 1 + + 6 files changed, 57 insertions(+), 1 deletion(-) + +commit 2822b589bc837fae6f66233e2cf2eef0f6ce8470 +Author: Garret Rieger +Date: Thu Nov 3 19:49:49 2022 +0000 + + [subset] Include instancing tests in distribution. + + Automatically enable them when the experimental api is enabled. + + test/subset/data/Makefile.am | 5 +++++ + test/subset/data/Makefile.sources | 5 +++++ + test/subset/meson.build | 19 ++++++++++++------- + 3 files changed, 22 insertions(+), 7 deletions(-) + +commit dbb7f47b19e60551ef4707f6a2cb60f1bd8334dd +Author: Qunxin Liu +Date: Thu Nov 3 11:55:41 2022 -0700 + + fix bug in hb_hashmap_t has() interface + + It was not working when the value type is hb_bytes_t because hb_array_t + overloaded operator & + + src/hb-map.hh | 2 +- + src/test-map.cc | 10 ++++++++++ + 2 files changed, 11 insertions(+), 1 deletion(-) + +commit d1f445ec1e6518d2d135eca13e791a79a824025a +Author: Behdad Esfahbod +Date: Wed Nov 2 12:24:04 2022 -0600 + + [name] Typo + + src/hb-ot-name.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit fc935fb81b04cce3753b0502897944792be47a19 +Author: Behdad Esfahbod +Date: Tue Nov 1 14:39:33 2022 -0600 + + Fix snprintf use + + https://github.com/harfbuzz/harfbuzz/pull/3495#issuecomment-1299107964 + + src/OT/Layout/GSUB/Ligature.hh | 2 +- + src/OT/Layout/GSUB/Sequence.hh | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 2ee42bbac2e2c85e946db525a8241d32d6b01459 +Author: Lorenz Wildberg +Date: Tue Nov 1 13:00:18 2022 +0100 + + hb_variation_to_string: Fix GIR annotation + + src/hb-common.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 0e4f579493c42e34931277dc32aec75d0044af14 +Author: Behdad Esfahbod +Date: Mon Oct 31 13:51:24 2022 -0600 + + [util/hb-view] Default HB_DRAW to 1 + + See comments. + + util/helper-cairo.hh | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit 02b76393efa4ca9a335cc08473bdb744be721bda +Author: Behdad Esfahbod +Date: Sat Oct 29 11:15:03 2022 -0600 + + [config] Re-enable BORING_EXPANSION + + Only the non-experimental parts (currently avar2) are + enabled by default. + + src/OT/Layout/Common/Coverage.hh | 34 +++++++++++++++++----------------- + src/OT/Layout/GPOS/MarkBasePos.hh | 4 ++-- + src/OT/Layout/GPOS/MarkLigPos.hh | 4 ++-- + src/OT/Layout/GPOS/MarkMarkPos.hh | 4 ++-- + src/OT/Layout/GPOS/PairPos.hh | 4 ++-- + src/OT/Layout/GSUB/AlternateSubst.hh | 4 ++-- + src/OT/Layout/GSUB/LigatureSubst.hh | 4 ++-- + src/OT/Layout/GSUB/MultipleSubst.hh | 4 ++-- + src/OT/Layout/GSUB/SingleSubst.hh | 8 ++++---- + src/graph/classdef-graph.hh | 2 +- + src/graph/coverage-graph.hh | 2 +- + src/graph/gsubgpos-graph.hh | 4 ++-- + src/graph/markbasepos-graph.hh | 4 ++-- + src/graph/pairpos-graph.hh | 4 ++-- + src/hb-config.hh | 4 ---- + 15 files changed, 43 insertions(+), 47 deletions(-) + +commit 6a47ef34b1ac5c1afc94a37dc7d2bcbe2013975e +Author: Behdad Esfahbod +Date: Sat Oct 29 11:14:27 2022 -0600 + + [config] If not HB_EXPERIMENTAL, then HB_NO_BEYOND_64K + + src/hb-config.hh | 4 ++++ + 1 file changed, 4 insertions(+) + +commit a0f999cd95834dce7f98f34890aaccb44c3179d5 +Author: Behdad Esfahbod +Date: Sat Oct 29 11:13:40 2022 -0600 + + [config] Rename HB_NO_VARIATIONS2 to HB_NO_AVAR2 + + src/hb-config.hh | 2 +- + src/hb-ot-var-avar-table.hh | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +commit 60c6b7786d9f4651ae2803bfc4ff4435b38a5bc6 +Author: Behdad Esfahbod +Date: Fri Oct 28 14:19:39 2022 -0600 + + Disable -Wcast-function-type-strict + + https://github.com/harfbuzz/harfbuzz/pull/3859#issuecomment-1295409126 + + src/hb.hh | 1 + + 1 file changed, 1 insertion(+) + +commit d88269c827895b38f99f7cf741fa60210d4d5169 +Author: Martin Storsjö +Date: Fri Oct 28 22:17:15 2022 +0300 + + freetype: Fix function signatures to match without casts + + Clang 16 has got a new stricter warning for casts of function types + (see https://github.com/llvm/llvm-project/commit/1aad641c793090b4d036c03e737df2ebe2c32c57). + + This new warning gets included as part of the existing error + diagnostic setting of -Wcast-function-type. + + This fixes errors like these: + + ../src/hb-ft.cc:1011:34: error: cast from 'void (*)(FT_Face)' (aka 'void (*)(FT_FaceRec_ *)') to 'FT_Generic_Finalizer' (aka 'void (*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict] + ft_face->generic.finalizer = (FT_Generic_Finalizer) hb_ft_face_finalize; + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + src/hb-ft.cc | 30 ++++++++++++++++++------------ + 1 file changed, 18 insertions(+), 12 deletions(-) + +commit 8a5524833ce78484ed38eeacffc476c462a384d8 +Author: Qunxin Liu +Date: Thu Oct 27 09:43:07 2022 -0700 + + [instance] update OS2/.usWeightClass and .usWidthClass when + no-prune-unicode-ranges option is enabled + + src/hb-ot-os2-table.hh | 23 +++++++++++---------- + ...anges.retain-all-codepoint.wght=150,wdth=80.ttf | Bin 0 -> 114200 bytes + ...anges.retain-all-codepoint.wght=300,wdth=90.ttf | Bin 0 -> 114300 bytes + test/subset/data/tests/full_instance.tests | 1 + + 4 files changed, 13 insertions(+), 11 deletions(-) + +commit fddeba26e4a0363f7b9ae260ddff2daad6939b34 +Merge: e854739b2 db292f6f0 +Author: خالد حسني (Khaled Hosny) +Date: Wed Oct 26 22:34:02 2022 +0200 + + Merge pull request #3857 from 2xsaiko/outgoing/cmake-abs-path + + Pass through absolute paths to cmake config directly + +commit db292f6f0238581a489aa8cddc585129b6e920cd +Author: Marco Rebhan +Date: Wed Oct 26 20:49:52 2022 +0200 + + Pass through absolute paths to cmake config directly + + The previous code concatenates includedir to _harfbuzz_prefix verbatim, + which results in a wrong final include path in case includedir is an absolute + path. Instead, we can let meson determine the absolute include and lib paths + in advance and save them in the cmake config. + + This is an issue in nixpkgs, where includedir is set to the final (absolute) + path of the built library in the Nix store, which causes CMake projects + depending on harfbuzz to not configure. + + See https://github.com/NixOS/nixpkgs/issues/180054. + + src/harfbuzz-config.cmake.in | 44 ++++++++------------------------------------ + src/meson.build | 4 ++-- + 2 files changed, 10 insertions(+), 38 deletions(-) + +commit e854739b2d905a98082dd37344e75beddf795e1a +Author: Behdad Esfahbod +Date: Wed Oct 26 13:12:56 2022 -0600 + + [fuzzing] Add test font for previous commit + + ...testcase-minimized-hb-shape-fuzzer-6635625931735040 | Bin 0 -> 175945 bytes + 1 file changed, 0 insertions(+), 0 deletions(-) + +commit 477d71724c945c9f1b4ca8a569be1cc5c5f93dcb +Author: Behdad Esfahbod +Date: Wed Oct 26 13:11:47 2022 -0600 + + [glyf] Limit points in a glyf to 10000 roughly + + Only enforced when components are being expanded. + + Fixes https://github.com/harfbuzz/harfbuzz/issues/3838 + + src/OT/glyf/Glyph.hh | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit 9aad3dba8f6cc91c8039ebfc2c6c6c5fd179a74b +Author: Behdad Esfahbod +Date: Wed Oct 26 13:04:02 2022 -0600 + + [SingleSubst] Fix degenerate-lookup test + + Part of https://github.com/harfbuzz/harfbuzz/issues/3853 + + src/OT/Layout/GSUB/SingleSubstFormat1.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 83769b9cb1bc44511c05f89dfeaa96cfec9749a8 +Author: Garret Rieger +Date: Fri Oct 21 22:37:32 2022 +0000 + + [subset] add comment for why we retain empty lookups. + + src/hb-ot-layout-common.hh | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 70e2de2bd440bccbb5e896ca1a08202da7ed0b4d +Author: Garret Rieger +Date: Fri Oct 21 22:33:17 2022 +0000 + + [subset] Always output Lookup's even if they are empty. + + The rest of layout subsetting depends on lookup indices being consistent with those computed during planning. So if an empty lookup is discarded during the subset phase it will invalidate all subsequent lookup indices. Generally we shouldn't end up with an empty lookup as we pre-prune them during the planning phase, but it can happen in rare cases such as when a subtable is considered degenerate (eg. #3853) + + src/hb-ot-layout-common.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 3377ddf69e0be9ddacf0330c45c0649eade8ba3e +Author: Joel Auterson +Date: Thu Oct 20 21:07:05 2022 +0100 + + Add missing underscore + + .github/workflows/arm-ci.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 28cb1b39545aa7ab6a2ec5e9110098fd848a30fa +Author: Joel Auterson +Date: Thu Oct 20 21:01:53 2022 +0100 + + Fix working-directory + + .github/workflows/arm-ci.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit dbbbf02d77a415a3c1c14f01365b348526e01b8a +Author: Joel Auterson +Date: Thu Oct 20 20:59:12 2022 +0100 + + Fix GHA workflow + + .github/workflows/arm-ci.yml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 756b5000188a5ca60ba78333aa29d20de8d14320 +Author: Joel Auterson +Date: Thu Oct 20 20:16:58 2022 +0100 + + Add ARM CI workflow + + .github/workflows/arm-ci.yml | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +commit c813f84235b16994c293d2ffa4584056a97c8e73 +Author: Joel Auterson +Date: Thu Oct 20 19:45:23 2022 +0100 + + Make build work for arm-none-eabi + + src/graph/graph.hh | 14 +++++++------- + src/hb-ot-layout-common.hh | 8 ++++---- + src/hb-ot-post-table-v2subset.hh | 4 ++-- + src/hb-ot-var-fvar-table.hh | 2 +- + src/hb-repacker.hh | 2 +- + 5 files changed, 15 insertions(+), 15 deletions(-) + +commit b0b7a65388da25ae3fa01e969ad6abc67eed4f49 +Author: Behdad Esfahbod +Date: Thu Oct 20 17:13:26 2022 -0600 + + [subset] Fix check-symbols failure + + Fixes https://github.com/harfbuzz/harfbuzz/issues/3850 + + src/check-symbols.py | 2 +- + src/hb-subset-accelerator.hh | 5 +++-- + src/hb-subset.cc | 4 ++++ + 3 files changed, 8 insertions(+), 3 deletions(-) + commit 970321db7bddbe8c579b73751fc655a924ea3ce6 Author: Khaled Hosny Date: Wed Oct 19 22:06:46 2022 +0200 diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/NEWS b/Build/source/libs/harfbuzz/harfbuzz-src/NEWS index 8d4389fc67b..73dcef083ab 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/NEWS +++ b/Build/source/libs/harfbuzz/harfbuzz-src/NEWS @@ -1,3 +1,65 @@ +Overview of changes leading to 6.0.0 +Friday, December 16, 2022 +==================================== +- A new API have been added to pre-process the face and speed up future + subsetting operations on that face. Provides up to a 95% reduction in + subsetting times when the same face is subset more than once. + + For more details and benchmarks, see: + https://github.com/harfbuzz/harfbuzz/blob/main/docs/subset-preprocessing.md + + (Garret Rieger, Behdad Esfahbod) + +- Shaping have been speedup by skipping entire lookups when the buffer contents + don't intersect with the lookup. Shows up to a 10% speedup in shaping some + fonts. (Behdad Esfahbod) + +- A new experimental feature, “Variable Composites” (enabled by passing + -Dexperimental_api=true to meson), is also featured in this release. + This technology enables drastic compression of fonts in the Chinese, + Japanese, Korean, and other writing systems, by reusing the OpenType Font + Variations technology for encoding “smart components” into the font. + + The specification for these extensions to the font format can be found in: + https://github.com/harfbuzz/boring-expansion-spec/blob/glyf1/glyf1.md + + A test variable-font with ~7160 Hangul syllables derived from the + NotoSerifKR-VF font has been built, with existing OpenType technology, as + well as with the new Variable Composites (VarComposites) technology. The + VarComposites font is over 90% smaller than the OpenType version of the font! + Both fonts can be obtained from the “smarties” repository: + https://github.com/behdad/smarties/tree/3.0/fonts/hangul/serif + + When building HarfBuzz with experimental features enabled, you can test + the “smarties” font with a sample character like this: + + $ hb-view butchered-hangul-serif-smarties-variable.ttf -u AE01 --variations=wght=700 + + (Behdad Esfahbod) + +- The HarfBuzz subsetter can now drop axes by pinning them to specific values + (also referred to as instancing). There are a couple of restrictions + currently: + + - Only works with TrueType (“glyf”) based fonts. “CFF2” fonts are not yet + supported. + - Only supports the case where all axes in a font are pinned. + + (Garret Rieger, Qunxin Liu) + +- Miscellaneous fixes and improvements. + + (Behdad Esfahbod, Christoph Reiter, David Corbett, Eli Schwartz, Garret + Rieger, Joel Auterson, Jordan Petridis, Khaled Hosny, Lorenz Wildberg, + Marco Rebhan, Martin Storsjö, Matthias Clasen, Qunxin Liu, Satadru Pramanik) + + +- New API ++hb_subset_input_pin_axis_location() ++hb_subset_input_pin_axis_to_default() ++hb_subset_preprocess() + + Overview of changes leading to 5.3.1 Wednesday, October 19, 2022 ==================================== diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac b/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac index f2480c349d3..abe86ede587 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], - [5.3.1], + [6.0.0], [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 b80679d3aa1..cc802f2f5cf 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: '5.3.1', + version: '6.0.0', default_options: [ 'cpp_rtti=false', # Just to support msvc, we are passing -fno-exceptions also anyway 'cpp_std=c++11', @@ -83,20 +83,35 @@ check_funcs = [ m_dep = cpp.find_library('m', required: false) - -# Try pkgconfig name -freetype_dep = dependency('freetype2', required: false) -if not freetype_dep.found() - # Try cmake name - freetype_dep = dependency('freetype', required: false) -endif -if not freetype_dep.found() - # Subproject fallback, `allow_fallback: true` means the fallback will be - # tried even if the freetype option is set to `auto`. - freetype_dep = dependency('freetype2', +if meson.version().version_compare('>=0.60.0') + # pkg-config: freetype2, cmake: Freetype + freetype_dep = dependency('freetype2', 'Freetype', required: get_option('freetype'), default_options: ['harfbuzz=disabled'], allow_fallback: true) +else + # painful hack to handle multiple dependencies but also respect options + freetype_opt = get_option('freetype') + # we want to handle enabled manually after fallbacks, but also handle disabled normally + if freetype_opt.enabled() + freetype_opt = false + endif + # try pkg-config name + freetype_dep = dependency('freetype2', method: 'pkg-config', required: freetype_opt) + # when disabled, leave it not-found + if not freetype_dep.found() and not get_option('freetype').disabled() + # Try cmake name + freetype_dep = dependency('Freetype', method: 'cmake', required: false) + # Subproject fallback, `allow_fallback: true` means the fallback will be + # tried even if the freetype option is set to `auto`. + if not freetype_dep.found() + freetype_dep = dependency('freetype2', + method: 'pkg-config', + required: get_option('freetype'), + default_options: ['harfbuzz=disabled'], + allow_fallback: true) + endif + endif endif glib_dep = dependency('glib-2.0', required: get_option('glib')) @@ -104,18 +119,36 @@ gobject_dep = dependency('gobject-2.0', required: get_option('gobject')) graphite2_dep = dependency('graphite2', required: get_option('graphite2')) graphite_dep = dependency('graphite2', required: get_option('graphite')) -# Try pkgconfig name -icu_dep = dependency('icu-uc', required: false) -if not icu_dep.found() - # Try cmake name - icu_dep = dependency('ICU', - required: false, - components: 'uc', - method: 'cmake') -endif -if not icu_dep.found() - # Subproject fallback if icu option is enabled - icu_dep = dependency('icu-uc', required: get_option('icu')) +if meson.version().version_compare('>=0.60.0') + # pkg-config: icu-uc, cmake: ICU but with components + icu_dep = dependency('icu-uc', 'ICU', + components: 'uc', + required: get_option('icu'), + default_options: ['harfbuzz=disabled'], + allow_fallback: true) +else + # painful hack to handle multiple dependencies but also respect options + icu_opt = get_option('icu') + # we want to handle enabled manually after fallbacks, but also handle disabled normally + if icu_opt.enabled() + icu_opt = false + endif + # try pkg-config name + icu_dep = dependency('icu-uc', method: 'pkg-config', required: icu_opt) + # when disabled, leave it not-found + if not icu_dep.found() and not get_option('icu').disabled() + # Try cmake name + icu_dep = dependency('ICU', method: 'cmake', components: 'uc', required: false) + # Try again with subproject fallback. `allow_fallback: true` means the + # fallback will be tried even if the icu option is set to `auto`, but + # we cannot pass this option until Meson 0.59.0, because no wrap file + # is checked into git. + if not icu_dep.found() + icu_dep = dependency('icu-uc', + method: 'pkg-config', + required: get_option('icu')) + endif + endif endif if icu_dep.found() and icu_dep.type_name() == 'pkgconfig' @@ -148,7 +181,8 @@ if not get_option('cairo').disabled() # harfbuzz support disabled, so when cairo will lookup freetype2 dependency # it will be forced to use that one. cairo_dep = dependency('cairo', required: get_option('cairo')) - cairo_ft_dep = dependency('cairo-ft', required: get_option('cairo')) + cairo_ft_required = get_option('cairo').enabled() and get_option('freetype').enabled() + cairo_ft_dep = dependency('cairo-ft', required: cairo_ft_required) endif endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am b/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am index 225444e326c..31399a6aa09 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am @@ -47,6 +47,9 @@ HBLIBS += $(GLIB_LIBS) HBDEPS += $(GLIB_DEPS) HBSOURCES += $(HB_GLIB_sources) HBHEADERS += $(HB_GLIB_headers) +HB_HAS_GLIB_DEF = define HB_HAS_GLIB 1 +else +HB_HAS_GLIB_DEF = undef HB_HAS_GLIB endif if HAVE_FREETYPE @@ -55,6 +58,9 @@ HBLIBS += $(FREETYPE_LIBS) HBDEPS += $(FREETYPE_DEPS) HBSOURCES += $(HB_FT_sources) HBHEADERS += $(HB_FT_headers) +HB_HAS_FREETYPE_DEF = define HB_HAS_FREETYPE 1 +else +HB_HAS_FREETYPE_DEF = undef HB_HAS_FREETYPE endif if HAVE_GRAPHITE2 @@ -63,6 +69,9 @@ HBLIBS += $(GRAPHITE2_LIBS) HBDEPS += $(GRAPHITE2_DEPS) HBSOURCES += $(HB_GRAPHITE2_sources) HBHEADERS += $(HB_GRAPHITE2_headers) +HB_HAS_GRAPHITE_DEF = define HB_HAS_GRAPHITE 1 +else +HB_HAS_GRAPHITE_DEF = undef HB_HAS_GRAPHITE endif if HAVE_UNISCRIBE @@ -70,6 +79,9 @@ HBCFLAGS += $(UNISCRIBE_CFLAGS) HBNONPCLIBS += $(UNISCRIBE_LIBS) HBSOURCES += $(HB_UNISCRIBE_sources) HBHEADERS += $(HB_UNISCRIBE_headers) +HB_HAS_UNISCRIBE_DEF = define HB_HAS_UNISCRIBE 1 +else +HB_HAS_UNISCRIBE_DEF = undef HB_HAS_UNISCRIBE endif if HAVE_DIRECTWRITE @@ -77,6 +89,9 @@ HBCFLAGS += $(DIRECTWRITE_CXXFLAGS) HBNONPCLIBS += $(DIRECTWRITE_LIBS) HBSOURCES += $(HB_DIRECTWRITE_sources) HBHEADERS += $(HB_DIRECTWRITE_headers) +HB_HAS_DIRECTWRITE_DEF = define HB_HAS_DIRECTWRITE 1 +else +HB_HAS_DIRECTWRITE_DEF = undef HB_HAS_DIRECTWRITE endif if HAVE_GDI @@ -84,6 +99,9 @@ HBCFLAGS += $(GDI_CXXFLAGS) HBNONPCLIBS += $(GDI_LIBS) HBSOURCES += $(HB_GDI_sources) HBHEADERS += $(HB_GDI_headers) +HB_HAS_GDI_DEF = define HB_HAS_GDI 1 +else +HB_HAS_GDI_DEF = undef HB_HAS_GDI endif if HAVE_CORETEXT @@ -91,6 +109,9 @@ HBCFLAGS += $(CORETEXT_CFLAGS) HBNONPCLIBS += $(CORETEXT_LIBS) HBSOURCES += $(HB_CORETEXT_sources) HBHEADERS += $(HB_CORETEXT_headers) +HB_HAS_CORETEXT_DEF = define HB_HAS_CORETEXT 1 +else +HB_HAS_CORETEXT_DEF = undef HB_HAS_CORETEXT endif @@ -147,7 +168,7 @@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = harfbuzz.pc cmakedir = $(libdir)/cmake/harfbuzz cmake_DATA = harfbuzz-config.cmake -EXTRA_DIST += hb-version.h.in harfbuzz.pc.in harfbuzz-config.cmake.in +EXTRA_DIST += hb-version.h.in hb-features.h.in harfbuzz.pc.in harfbuzz-config.cmake.in lib_LTLIBRARIES += libharfbuzz-subset.la libharfbuzz_subset_la_LINK = $(chosen_linker) $(libharfbuzz_subset_la_LDFLAGS) @@ -178,6 +199,7 @@ HBCFLAGS += $(ICU_CFLAGS) HBLIBS += $(ICU_LIBS) HBSOURCES += $(HB_ICU_sources) HBHEADERS += $(HB_ICU_headers) +HB_HAS_ICU_DEF = define HB_HAS_ICU 1 else lib_LTLIBRARIES += libharfbuzz-icu.la libharfbuzz_icu_la_SOURCES = $(HB_ICU_sources) @@ -187,6 +209,7 @@ libharfbuzz_icu_la_LIBADD = $(ICU_LIBS) libharfbuzz.la EXTRA_libharfbuzz_icu_la_DEPENDENCIES = $(harfbuzz_icu_def_dependency) pkginclude_HEADERS += $(HB_ICU_headers) pkgconfig_DATA += harfbuzz-icu.pc +HB_HAS_ICU_DEF = undef HB_HAS_ICU endif endif EXTRA_DIST += harfbuzz-icu.pc.in @@ -226,6 +249,25 @@ EXTRA_DIST += \ $(NULL) +BUILT_SOURCES += \ + hb-features.h +DISTCLEANFILES += \ + hb-features.h + +hb-features.h: hb-features.h.in $(top_builddir)/config.status + $(AM_V_GEN) $(SED) \ + -e 's/mesondefine HB_HAS_FREETYPE/$(HB_HAS_FREETYPE_DEF)/' \ + -e 's/mesondefine HB_HAS_GDI/$(HB_HAS_GDI_DEF)/' \ + -e 's/mesondefine HB_HAS_GDI/$(HB_HAS_GDI_DEF)/' \ + -e 's/mesondefine HB_HAS_GRAPHITE/$(HB_HAS_GRAPHITE_DEF)/' \ + -e 's/mesondefine HB_HAS_GLIB/$(HB_HAS_GLIB_DEF)/' \ + -e 's/mesondefine HB_HAS_UNISCRIBE/$(HB_HAS_UNISCRIBE_DEF)/' \ + -e 's/mesondefine HB_HAS_DIRECTWRITE/$(HB_HAS_DIRECTWRITE_DEF)/' \ + -e 's/mesondefine HB_HAS_CORETEXT/$(HB_HAS_CORETEXT_DEF)/' \ + -e 's/mesondefine HB_HAS_ICU/$(HB_HAS_ICU_DEF)/' \ + "$<" > "$@" || ($(RM) "$@"; false) + + %.pc: %.pc.in $(top_builddir)/config.status $(AM_V_GEN) \ $(SED) -e 's@%prefix%@$(prefix)@g' \ @@ -368,6 +410,7 @@ COMPILED_TESTS = \ test-iter \ test-machinery \ test-map \ + test-multimap \ test-number \ test-ot-tag \ test-priority-queue \ @@ -407,6 +450,10 @@ test_map_SOURCES = test-map.cc hb-static.cc test_map_CPPFLAGS = $(COMPILED_TESTS_CPPFLAGS) test_map_LDADD = $(COMPILED_TESTS_LDADD) +test_multimap_SOURCES = test-multimap.cc hb-static.cc +test_multimap_CPPFLAGS = $(COMPILED_TESTS_CPPFLAGS) +test_multimap_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) diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources b/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources index 6c891eac577..6c4fc5de711 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources @@ -52,6 +52,7 @@ HB_BASE_sources = \ hb-map.hh \ hb-meta.hh \ hb-ms-feature-ranges.hh \ + hb-multimap.hh \ hb-mutex.hh \ hb-null.hh \ hb-number.cc \ @@ -95,7 +96,10 @@ HB_BASE_sources = \ OT/glyf/Glyph.hh \ OT/glyf/GlyphHeader.hh \ OT/glyf/SimpleGlyph.hh \ + OT/glyf/coord-setter.hh \ + OT/glyf/composite-iter.hh \ OT/glyf/CompositeGlyph.hh \ + OT/glyf/VarCompositeGlyph.hh \ OT/glyf/SubsetGlyph.hh \ OT/Layout/types.hh \ OT/Layout/Common/Coverage.hh \ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/Common/Coverage.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/Common/Coverage.hh index eef89a28791..fbd7c642abd 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/Common/Coverage.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/Common/Coverage.hh @@ -49,7 +49,7 @@ struct Coverage HBUINT16 format; /* Format identifier */ CoverageFormat1_3 format1; CoverageFormat2_4 format2; -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K CoverageFormat1_3format3; CoverageFormat2_4format4; #endif @@ -65,7 +65,7 @@ struct Coverage { case 1: return_trace (u.format1.sanitize (c)); case 2: return_trace (u.format2.sanitize (c)); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 3: return_trace (u.format3.sanitize (c)); case 4: return_trace (u.format4.sanitize (c)); #endif @@ -74,10 +74,8 @@ struct Coverage } /* Has interface. */ - static constexpr unsigned SENTINEL = NOT_COVERED; - typedef unsigned int value_t; - value_t operator [] (hb_codepoint_t k) const { return get (k); } - bool has (hb_codepoint_t k) const { return (*this)[k] != SENTINEL; } + unsigned operator [] (hb_codepoint_t k) const { return get (k); } + bool has (hb_codepoint_t k) const { return (*this)[k] != NOT_COVERED; } /* Predicate. */ bool operator () (hb_codepoint_t k) const { return has (k); } @@ -87,7 +85,7 @@ struct Coverage switch (u.format) { case 1: return u.format1.get_coverage (glyph_id); case 2: return u.format2.get_coverage (glyph_id); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 3: return u.format3.get_coverage (glyph_id); case 4: return u.format4.get_coverage (glyph_id); #endif @@ -100,7 +98,7 @@ struct Coverage switch (u.format) { case 1: return u.format1.get_population (); case 2: return u.format2.get_population (); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 3: return u.format3.get_population (); case 4: return u.format4.get_population (); #endif @@ -127,7 +125,7 @@ struct Coverage } u.format = count <= num_ranges * 3 ? 1 : 2; -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K if (count && last > 0xFFFFu) u.format += 2; #endif @@ -136,7 +134,7 @@ struct Coverage { case 1: return_trace (u.format1.serialize (c, glyphs)); case 2: return_trace (u.format2.serialize (c, glyphs)); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 3: return_trace (u.format3.serialize (c, glyphs)); case 4: return_trace (u.format4.serialize (c, glyphs)); #endif @@ -166,7 +164,7 @@ struct Coverage { case 1: return u.format1.intersects (glyphs); case 2: return u.format2.intersects (glyphs); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 3: return u.format3.intersects (glyphs); case 4: return u.format4.intersects (glyphs); #endif @@ -179,7 +177,7 @@ struct Coverage { case 1: return u.format1.intersects_coverage (glyphs, index); case 2: return u.format2.intersects_coverage (glyphs, index); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 3: return u.format3.intersects_coverage (glyphs, index); case 4: return u.format4.intersects_coverage (glyphs, index); #endif @@ -196,7 +194,7 @@ struct Coverage { case 1: return u.format1.collect_coverage (glyphs); case 2: return u.format2.collect_coverage (glyphs); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 3: return u.format3.collect_coverage (glyphs); case 4: return u.format4.collect_coverage (glyphs); #endif @@ -212,7 +210,7 @@ struct Coverage { case 1: return u.format1.intersect_set (glyphs, intersect_glyphs); case 2: return u.format2.intersect_set (glyphs, intersect_glyphs); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 3: return u.format3.intersect_set (glyphs, intersect_glyphs); case 4: return u.format4.intersect_set (glyphs, intersect_glyphs); #endif @@ -225,13 +223,13 @@ struct Coverage static constexpr bool is_sorted_iterator = true; iter_t (const Coverage &c_ = Null (Coverage)) { - memset (this, 0, sizeof (*this)); + hb_memset (this, 0, sizeof (*this)); format = c_.u.format; switch (format) { case 1: u.format1.init (c_.u.format1); return; case 2: u.format2.init (c_.u.format2); return; -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 3: u.format3.init (c_.u.format3); return; case 4: u.format4.init (c_.u.format4); return; #endif @@ -244,7 +242,7 @@ struct Coverage { case 1: return u.format1.__more__ (); case 2: return u.format2.__more__ (); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 3: return u.format3.__more__ (); case 4: return u.format4.__more__ (); #endif @@ -257,7 +255,7 @@ struct Coverage { case 1: u.format1.__next__ (); break; case 2: u.format2.__next__ (); break; -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 3: u.format3.__next__ (); break; case 4: u.format4.__next__ (); break; #endif @@ -273,7 +271,7 @@ struct Coverage { case 1: return u.format1.get_glyph (); case 2: return u.format2.get_glyph (); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 3: return u.format3.get_glyph (); case 4: return u.format4.get_glyph (); #endif @@ -287,7 +285,7 @@ struct Coverage { case 1: return u.format1 != o.u.format1; case 2: return u.format2 != o.u.format2; -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 3: return u.format3 != o.u.format3; case 4: return u.format4 != o.u.format4; #endif @@ -302,7 +300,7 @@ struct Coverage { case 1: it.u.format1 = u.format1.__end__ (); break; case 2: it.u.format2 = u.format2.__end__ (); break; -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 3: it.u.format3 = u.format3.__end__ (); break; case 4: it.u.format4 = u.format4.__end__ (); break; #endif @@ -314,7 +312,7 @@ struct Coverage private: unsigned int format; union { -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K CoverageFormat2_4::iter_t format4; /* Put this one first since it's larger; helps shut up compiler. */ CoverageFormat1_3::iter_t format3; #endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/Common/CoverageFormat1.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/Common/CoverageFormat1.hh index 82fd48dc50d..5d68e3d15e7 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/Common/CoverageFormat1.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/Common/CoverageFormat1.hh @@ -77,7 +77,14 @@ struct CoverageFormat1_3 bool intersects (const hb_set_t *glyphs) const { - /* TODO Speed up, using hb_set_next() and bsearch()? */ + if (glyphArray.len > glyphs->get_population () * hb_bit_storage ((unsigned) glyphArray.len) / 2) + { + for (hb_codepoint_t g = HB_SET_VALUE_INVALID; glyphs->next (&g);) + if (get_coverage (g) != NOT_COVERED) + return true; + return false; + } + for (const auto& g : glyphArray.as_array ()) if (glyphs->has (g)) return true; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/Common/CoverageFormat2.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/Common/CoverageFormat2.hh index 974d094633a..d7fcc352028 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/Common/CoverageFormat2.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/Common/CoverageFormat2.hh @@ -80,8 +80,6 @@ struct CoverageFormat2_4 TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (this))) return_trace (false); - /* TODO(iter) Write more efficiently? */ - unsigned num_ranges = 0; hb_codepoint_t last = (hb_codepoint_t) -2; for (auto g: glyphs) @@ -115,26 +113,22 @@ struct CoverageFormat2_4 bool intersects (const hb_set_t *glyphs) const { + if (rangeRecord.len > glyphs->get_population () * hb_bit_storage ((unsigned) rangeRecord.len) / 2) + { + for (hb_codepoint_t g = HB_SET_VALUE_INVALID; glyphs->next (&g);) + if (get_coverage (g) != NOT_COVERED) + return true; + return false; + } + return hb_any (+ hb_iter (rangeRecord) | hb_map ([glyphs] (const RangeRecord &range) { return range.intersects (*glyphs); })); } bool intersects_coverage (const hb_set_t *glyphs, unsigned int index) const { - auto cmp = [] (const void *pk, const void *pr) -> int - { - unsigned index = * (const unsigned *) pk; - const RangeRecord &range = * (const RangeRecord *) pr; - if (index < range.value) return -1; - if (index > (unsigned int) range.value + (range.last - range.first)) return +1; - return 0; - }; - - auto arr = rangeRecord.as_array (); - unsigned idx; - if (hb_bsearch_impl (&idx, index, - arr.arrayZ, arr.length, sizeof (arr[0]), - (int (*)(const void *_key, const void *_item)) cmp)) - return arr.arrayZ[idx].intersects (*glyphs); + auto *range = rangeRecord.as_array ().bsearch (index); + if (range) + return range->intersects (*glyphs); return false; } @@ -142,9 +136,14 @@ struct CoverageFormat2_4 hb_requires (hb_is_sink_of (IterableOut, hb_codepoint_t))> void intersect_set (const hb_set_t &glyphs, IterableOut&& intersect_glyphs) const { + /* Break out of loop for overlapping, broken, tables, + * to avoid fuzzer timouts. */ + hb_codepoint_t last = 0; for (const auto& range : rangeRecord) { - hb_codepoint_t last = range.last; + if (unlikely (range.first < last)) + break; + last = range.last; for (hb_codepoint_t g = range.first - 1; glyphs.next (&g) && g <= last;) intersect_glyphs << g; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/MarkBasePos.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/MarkBasePos.hh index c99b6b2e4b7..edf7099c072 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/MarkBasePos.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/MarkBasePos.hh @@ -13,7 +13,7 @@ struct MarkBasePos union { HBUINT16 format; /* Format identifier */ MarkBasePosFormat1_2 format1; -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K MarkBasePosFormat1_2 format2; #endif } u; @@ -26,7 +26,7 @@ struct MarkBasePos if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ()); switch (u.format) { case 1: return_trace (c->dispatch (u.format1, std::forward (ds)...)); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 2: return_trace (c->dispatch (u.format2, std::forward (ds)...)); #endif default:return_trace (c->default_return_value ()); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/MarkLigPos.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/MarkLigPos.hh index 8a4de9ffaa6..09152fd876e 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/MarkLigPos.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/MarkLigPos.hh @@ -13,7 +13,7 @@ struct MarkLigPos union { HBUINT16 format; /* Format identifier */ MarkLigPosFormat1_2 format1; -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K MarkLigPosFormat1_2 format2; #endif } u; @@ -26,7 +26,7 @@ struct MarkLigPos if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ()); switch (u.format) { case 1: return_trace (c->dispatch (u.format1, std::forward (ds)...)); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 2: return_trace (c->dispatch (u.format2, std::forward (ds)...)); #endif default:return_trace (c->default_return_value ()); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/MarkMarkPos.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/MarkMarkPos.hh index 74b5105c423..4118fc304ff 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/MarkMarkPos.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/MarkMarkPos.hh @@ -13,7 +13,7 @@ struct MarkMarkPos union { HBUINT16 format; /* Format identifier */ MarkMarkPosFormat1_2 format1; -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K MarkMarkPosFormat1_2 format2; #endif } u; @@ -26,7 +26,7 @@ struct MarkMarkPos if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ()); switch (u.format) { case 1: return_trace (c->dispatch (u.format1, std::forward (ds)...)); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 2: return_trace (c->dispatch (u.format2, std::forward (ds)...)); #endif default:return_trace (c->default_return_value ()); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairPos.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairPos.hh index 72bfc43dc43..9823768cbc1 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairPos.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairPos.hh @@ -15,7 +15,7 @@ struct PairPos HBUINT16 format; /* Format identifier */ PairPosFormat1_3 format1; PairPosFormat2_4 format2; -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K PairPosFormat1_3 format3; PairPosFormat2_4 format4; #endif @@ -30,7 +30,7 @@ struct PairPos switch (u.format) { case 1: return_trace (c->dispatch (u.format1, std::forward (ds)...)); case 2: return_trace (c->dispatch (u.format2, std::forward (ds)...)); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 3: return_trace (c->dispatch (u.format3, std::forward (ds)...)); case 4: return_trace (c->dispatch (u.format4, std::forward (ds)...)); #endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairPosFormat1.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairPosFormat1.hh index ddf7313f94b..9c9b268889f 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairPosFormat1.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairPosFormat1.hh @@ -51,8 +51,21 @@ struct PairPosFormat1_3 bool intersects (const hb_set_t *glyphs) const { + auto &cov = this+coverage; + + if (pairSet.len > glyphs->get_population () * hb_bit_storage ((unsigned) pairSet.len) / 4) + { + for (hb_codepoint_t g = HB_SET_VALUE_INVALID; glyphs->next (&g);) + { + unsigned i = cov.get_coverage (g); + if ((this+pairSet[i]).intersects (glyphs, valueFormat)) + return true; + } + return false; + } + return - + hb_zip (this+coverage, pairSet) + + hb_zip (cov, pairSet) | hb_filter (*glyphs, hb_first) | hb_map (hb_second) | hb_map ([glyphs, this] (const typename Types::template OffsetTo &_) @@ -171,12 +184,16 @@ struct PairPosFormat1_3 unsigned format1 = 0; unsigned format2 = 0; for (const auto & _ : - + hb_zip (this+coverage, pairSet) | hb_filter (glyphset, hb_first) | hb_map (hb_second)) + + hb_zip (this+coverage, pairSet) + | hb_filter (glyphset, hb_first) + | hb_map (hb_second) + ) { const PairSet& set = (this + _); const PairValueRecord *record = &set.firstPairValueRecord; - for (unsigned i = 0; i < set.len; i++) + unsigned count = set.len; + for (unsigned i = 0; i < count; i++) { if (record->intersects (glyphset)) { @@ -185,6 +202,9 @@ struct PairPosFormat1_3 } record = &StructAtOffset (record, record_size); } + + if (format1 == valueFormat[0] && format2 == valueFormat[1]) + break; } return hb_pair (format1, format2); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairPosFormat2.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairPosFormat2.hh index 83b093b9883..9c87ac2b038 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairPosFormat2.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairPosFormat2.hh @@ -220,17 +220,25 @@ struct PairPosFormat2_4 if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) { c->buffer->message (c->font, - "kerning glyphs at %d,%d", + "try kerning glyphs at %d,%d", c->buffer->idx, skippy_iter.idx); } applied_first = valueFormat1.apply_value (c, this, v, buffer->cur_pos()); applied_second = valueFormat2.apply_value (c, this, v + len1, buffer->pos[skippy_iter.idx]); + if (applied_first || applied_second) + if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) + { + c->buffer->message (c->font, + "kerned glyphs at %d,%d", + c->buffer->idx, skippy_iter.idx); + } + if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) { c->buffer->message (c->font, - "kerned glyphs at %d,%d", + "tried kerning glyphs at %d,%d", c->buffer->idx, skippy_iter.idx); } @@ -241,10 +249,15 @@ struct PairPosFormat2_4 boring: buffer->unsafe_to_concat (buffer->idx, skippy_iter.idx + 1); + if (len2) + { + skippy_iter.idx++; + // https://github.com/harfbuzz/harfbuzz/issues/3824 + // https://github.com/harfbuzz/harfbuzz/issues/3888#issuecomment-1326781116 + buffer->unsafe_to_break (buffer->idx, skippy_iter.idx + 1); + } buffer->idx = skippy_iter.idx; - if (len2) - buffer->idx++; return_trace (true); } @@ -309,6 +322,7 @@ struct PairPosFormat2_4 { unsigned len1 = valueFormat1.get_len (); unsigned len2 = valueFormat2.get_len (); + unsigned record_size = len1 + len2; unsigned format1 = 0; unsigned format2 = 0; @@ -317,10 +331,13 @@ struct PairPosFormat2_4 { for (unsigned class2_idx : + hb_range ((unsigned) class2Count) | hb_filter (klass2_map)) { - unsigned idx = (class1_idx * (unsigned) class2Count + class2_idx) * (len1 + len2); + unsigned idx = (class1_idx * (unsigned) class2Count + class2_idx) * record_size; format1 = format1 | valueFormat1.get_effective_format (&values[idx]); format2 = format2 | valueFormat2.get_effective_format (&values[idx + len1]); } + + if (format1 == valueFormat1 && format2 == valueFormat2) + break; } return hb_pair (format1, format2); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairSet.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairSet.hh index aa48d933c39..a318f399136 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairSet.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairSet.hh @@ -112,24 +112,38 @@ struct PairSet if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) { c->buffer->message (c->font, - "kerning glyphs at %d,%d", + "try kerning glyphs at %d,%d", c->buffer->idx, pos); } bool applied_first = valueFormats[0].apply_value (c, this, &record->values[0], buffer->cur_pos()); bool applied_second = valueFormats[1].apply_value (c, this, &record->values[len1], buffer->pos[pos]); + if (applied_first || applied_second) + if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) + { + c->buffer->message (c->font, + "kerned glyphs at %d,%d", + c->buffer->idx, pos); + } + if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) { c->buffer->message (c->font, - "kerned glyphs at %d,%d", + "tried kerning glyphs at %d,%d", c->buffer->idx, pos); } if (applied_first || applied_second) buffer->unsafe_to_break (buffer->idx, pos + 1); + if (len2) - pos++; + { + pos++; + // https://github.com/harfbuzz/harfbuzz/issues/3824 + // https://github.com/harfbuzz/harfbuzz/issues/3888#issuecomment-1326781116 + buffer->unsafe_to_break (buffer->idx, pos + 1); + } buffer->idx = pos; return_trace (true); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/AlternateSet.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/AlternateSet.hh index 4a9e9672ebc..6c50c9717a9 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/AlternateSet.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/AlternateSet.hh @@ -84,7 +84,7 @@ struct AlternateSet { if (alternates.len && alternate_count) { - + alternates.sub_array (start_offset, alternate_count) + + alternates.as_array ().sub_array (start_offset, alternate_count) | hb_sink (hb_array (alternate_glyphs, *alternate_count)) ; } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/AlternateSubst.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/AlternateSubst.hh index 37406179a28..9d7cd6fddf1 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/AlternateSubst.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/AlternateSubst.hh @@ -14,7 +14,7 @@ struct AlternateSubst union { HBUINT16 format; /* Format identifier */ AlternateSubstFormat1_2 format1; -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K AlternateSubstFormat1_2 format2; #endif } u; @@ -27,7 +27,7 @@ struct AlternateSubst if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ()); switch (u.format) { case 1: return_trace (c->dispatch (u.format1, std::forward (ds)...)); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 2: return_trace (c->dispatch (u.format2, std::forward (ds)...)); #endif default:return_trace (c->default_return_value ()); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/Ligature.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/Ligature.hh index 6caa80e056c..cdb35f525be 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/Ligature.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/Ligature.hh @@ -118,7 +118,7 @@ struct Ligature match_positions[i] += delta; if (i) *p++ = ','; - snprintf (p, sizeof(buf), "%u", match_positions[i]); + snprintf (p, sizeof(buf) - (p - buf), "%u", match_positions[i]); p += strlen(p); } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/LigatureSubst.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/LigatureSubst.hh index 63707972a81..7ba19e844c5 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/LigatureSubst.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/LigatureSubst.hh @@ -14,7 +14,7 @@ struct LigatureSubst union { HBUINT16 format; /* Format identifier */ LigatureSubstFormat1_2 format1; -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K LigatureSubstFormat1_2 format2; #endif } u; @@ -27,7 +27,7 @@ struct LigatureSubst if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ()); switch (u.format) { case 1: return_trace (c->dispatch (u.format1, std::forward (ds)...)); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 2: return_trace (c->dispatch (u.format2, std::forward (ds)...)); #endif default:return_trace (c->default_return_value ()); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/MultipleSubst.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/MultipleSubst.hh index 852ca3eac52..95710ed2be8 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/MultipleSubst.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/MultipleSubst.hh @@ -14,7 +14,7 @@ struct MultipleSubst union { HBUINT16 format; /* Format identifier */ MultipleSubstFormat1_2 format1; -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K MultipleSubstFormat1_2 format2; #endif } u; @@ -28,7 +28,7 @@ struct MultipleSubst if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ()); switch (u.format) { case 1: return_trace (c->dispatch (u.format1, std::forward (ds)...)); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 2: return_trace (c->dispatch (u.format2, std::forward (ds)...)); #endif default:return_trace (c->default_return_value ()); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/Sequence.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/Sequence.hh index abf1c643ff7..e2190078b80 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/Sequence.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/Sequence.hh @@ -117,7 +117,7 @@ struct Sequence { if (buf < p) *p++ = ','; - snprintf (p, sizeof(buf), "%u", i); + snprintf (p, sizeof(buf) - (p - buf), "%u", i); p += strlen(p); } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/SingleSubst.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/SingleSubst.hh index 6942e6997f6..7da8103168f 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/SingleSubst.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/SingleSubst.hh @@ -16,7 +16,7 @@ struct SingleSubst HBUINT16 format; /* Format identifier */ SingleSubstFormat1_3 format1; SingleSubstFormat2_4 format2; -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K SingleSubstFormat1_3 format3; SingleSubstFormat2_4 format4; #endif @@ -32,7 +32,7 @@ struct SingleSubst switch (u.format) { case 1: return_trace (c->dispatch (u.format1, std::forward (ds)...)); case 2: return_trace (c->dispatch (u.format2, std::forward (ds)...)); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 3: return_trace (c->dispatch (u.format3, std::forward (ds)...)); case 4: return_trace (c->dispatch (u.format4, std::forward (ds)...)); #endif @@ -55,7 +55,7 @@ struct SingleSubst format = 1; hb_codepoint_t mask = 0xFFFFu; -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K if (+ glyphs | hb_map_retains_sorting (hb_first) | hb_filter ([] (hb_codepoint_t gid) { return gid > 0xFFFFu; })) @@ -78,7 +78,7 @@ struct SingleSubst | hb_map_retains_sorting (hb_first), delta)); case 2: return_trace (u.format2.serialize (c, glyphs)); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 3: return_trace (u.format3.serialize (c, + glyphs | hb_map_retains_sorting (hb_first), diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/SingleSubstFormat1.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/SingleSubstFormat1.hh index 13665d7ba1d..1be21b98bc4 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/SingleSubstFormat1.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/SingleSubstFormat1.hh @@ -57,7 +57,7 @@ struct SingleSubstFormat1_3 hb_codepoint_t max_before = intersection.get_max (); hb_codepoint_t min_after = (min_before + d) & mask; hb_codepoint_t max_after = (max_before + d) & mask; - if (pop >= max_before - min_before && + if (intersection.get_population () == max_before - min_before + 1 && ((min_before <= min_after && min_after <= max_before) || (min_before <= max_after && max_after <= max_before))) return; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/SingleSubstFormat2.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/SingleSubstFormat2.hh index 5416299754c..01df714525c 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/SingleSubstFormat2.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/SingleSubstFormat2.hh @@ -36,8 +36,24 @@ struct SingleSubstFormat2_4 void closure (hb_closure_context_t *c) const { - + hb_zip (this+coverage, substitute) - | hb_filter (c->parent_active_glyphs (), hb_first) + auto &cov = this+coverage; + auto &glyph_set = c->parent_active_glyphs (); + + if (substitute.len > glyph_set.get_population () * 4) + { + for (auto g : glyph_set) + { + unsigned i = cov.get_coverage (g); + if (i == NOT_COVERED || i >= substitute.len) + continue; + c->output->add (substitute.arrayZ[i]); + } + + return; + } + + + hb_zip (cov, substitute) + | hb_filter (glyph_set, hb_first) | hb_map (hb_second) | hb_sink (c->output) ; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/CompositeGlyph.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/CompositeGlyph.hh index fc8e309bc92..edf8cd8797d 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/CompositeGlyph.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/CompositeGlyph.hh @@ -3,6 +3,7 @@ #include "../../hb-open-type.hh" +#include "composite-iter.hh" namespace OT { @@ -121,7 +122,7 @@ struct CompositeGlyphRecord if (flags & ARG_1_AND_2_ARE_WORDS) { // no overflow, copy and update value with deltas - memcpy (out, this, len); + hb_memcpy (out, this, len); const HBINT16 *px = reinterpret_cast (p); HBINT16 *o = reinterpret_cast (out + len_before_val); @@ -135,7 +136,7 @@ struct CompositeGlyphRecord if (new_x <= 127 && new_x >= -128 && new_y <= 127 && new_y >= -128) { - memcpy (out, this, len); + hb_memcpy (out, this, len); HBINT8 *o = reinterpret_cast (out + len_before_val); o[0] = new_x; o[1] = new_y; @@ -143,7 +144,7 @@ struct CompositeGlyphRecord else { // int8 overflows after deltas applied - memcpy (out, this, len_before_val); + hb_memcpy (out, this, len_before_val); //update flags CompositeGlyphRecord *o = reinterpret_cast (out); @@ -152,14 +153,14 @@ struct CompositeGlyphRecord HBINT16 new_value; new_value = new_x; - memcpy (out, &new_value, HBINT16::static_size); + hb_memcpy (out, &new_value, HBINT16::static_size); out += HBINT16::static_size; new_value = new_y; - memcpy (out, &new_value, HBINT16::static_size); + hb_memcpy (out, &new_value, HBINT16::static_size); out += HBINT16::static_size; - memcpy (out, p+2, len - len_before_val - 2); + hb_memcpy (out, p+2, len - len_before_val - 2); len += 2; } } @@ -252,55 +253,7 @@ struct CompositeGlyphRecord DEFINE_SIZE_MIN (4); }; -struct composite_iter_t : hb_iter_with_fallback_t -{ - typedef const CompositeGlyphRecord *__item_t__; - composite_iter_t (hb_bytes_t glyph_, __item_t__ current_) : - glyph (glyph_), current (nullptr), current_size (0) - { - set_current (current_); - } - - composite_iter_t () : glyph (hb_bytes_t ()), current (nullptr), current_size (0) {} - - item_t __item__ () const { return *current; } - bool __more__ () const { return current; } - void __next__ () - { - if (!current->has_more ()) { current = nullptr; return; } - - set_current (&StructAtOffset (current, current_size)); - } - composite_iter_t __end__ () const { return composite_iter_t (); } - bool operator != (const composite_iter_t& o) const - { return current != o.current; } - - - void set_current (__item_t__ current_) - { - if (!glyph.check_range (current_, CompositeGlyphRecord::min_size)) - { - current = nullptr; - current_size = 0; - return; - } - unsigned size = current_->get_size (); - if (!glyph.check_range (current_, size)) - { - current = nullptr; - current_size = 0; - return; - } - - current = current_; - current_size = size; - } - - private: - hb_bytes_t glyph; - __item_t__ current; - unsigned current_size; -}; +using composite_iter_t = composite_iter_tmpl; struct CompositeGlyph { @@ -382,7 +335,7 @@ struct CompositeGlyph unsigned comp_len = component.get_size (); if (component.is_anchored ()) { - memcpy (p, &component, comp_len); + hb_memcpy (p, &component, comp_len); p += comp_len; } else @@ -398,7 +351,7 @@ struct CompositeGlyph if (source_len > source_comp_len) { unsigned instr_len = source_len - source_comp_len; - memcpy (p, (const char *)c + source_comp_len, instr_len); + hb_memcpy (p, (const char *)c + source_comp_len, instr_len); p += instr_len; } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/Glyph.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/Glyph.hh index 0b25659acca..b7215b01700 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/Glyph.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/Glyph.hh @@ -7,6 +7,8 @@ #include "GlyphHeader.hh" #include "SimpleGlyph.hh" #include "CompositeGlyph.hh" +#include "VarCompositeGlyph.hh" +#include "coord-setter.hh" namespace OT { @@ -16,6 +18,11 @@ struct glyf_accelerator_t; namespace glyf_impl { +#ifndef HB_GLYF_MAX_POINTS +#define HB_GLYF_MAX_POINTS 10000 +#endif + + enum phantom_point_index_t { PHANTOM_LEFT = 0, @@ -27,7 +34,7 @@ enum phantom_point_index_t struct Glyph { - enum glyph_type_t { EMPTY, SIMPLE, COMPOSITE }; + enum glyph_type_t { EMPTY, SIMPLE, COMPOSITE, VAR_COMPOSITE }; public: composite_iter_t get_composite_iterator () const @@ -35,6 +42,11 @@ struct Glyph if (type != COMPOSITE) return composite_iter_t (); return CompositeGlyph (*header, bytes).iter (); } + var_composite_iter_t get_var_composite_iterator () const + { + if (type != VAR_COMPOSITE) return var_composite_iter_t (); + return VarCompositeGlyph (*header, bytes).iter (); + } const hb_bytes_t trim_padding () const { @@ -108,25 +120,25 @@ struct Glyph if (unlikely (!glyph_header)) return false; } - int xMin = 0, xMax = 0; - int yMin = 0, yMax = 0; + float xMin = 0, xMax = 0; + float yMin = 0, yMax = 0; if (all_points.length > 4) { - xMin = xMax = roundf (all_points[0].x); - yMin = yMax = roundf (all_points[0].y); + xMin = xMax = all_points[0].x; + yMin = yMax = all_points[0].y; } for (unsigned i = 1; i < all_points.length - 4; i++) { - float rounded_x = roundf (all_points[i].x); - float rounded_y = roundf (all_points[i].y); - xMin = hb_min (xMin, rounded_x); - xMax = hb_max (xMax, rounded_x); - yMin = hb_min (yMin, rounded_y); - yMax = hb_max (yMax, rounded_y); + float x = all_points[i].x; + float y = all_points[i].y; + xMin = hb_min (xMin, x); + xMax = hb_max (xMax, x); + yMin = hb_min (yMin, y); + yMax = hb_max (yMax, y); } - update_mtx (plan, xMin, yMax, all_points); + update_mtx (plan, roundf (xMin), roundf (yMax), all_points); /*for empty glyphs: all_points only include phantom points. *just update metrics and then return */ @@ -134,10 +146,10 @@ struct Glyph return true; glyph_header->numberOfContours = header->numberOfContours; - glyph_header->xMin = xMin; - glyph_header->yMin = yMin; - glyph_header->xMax = xMax; - glyph_header->yMax = yMax; + glyph_header->xMin = roundf (xMin); + glyph_header->yMin = roundf (yMin); + glyph_header->xMax = roundf (xMax); + glyph_header->yMax = roundf (yMax); dest_bytes = hb_bytes_t ((const char *)glyph_header, GlyphHeader::static_size); return true; @@ -199,15 +211,24 @@ struct Glyph bool shift_points_hori = true, bool use_my_metrics = true, bool phantom_only = false, + hb_array_t coords = hb_array_t (), unsigned int depth = 0) const { if (unlikely (depth > HB_MAX_NESTING_LEVEL)) return false; + + if (!coords) + coords = hb_array (font->coords, font->num_coords); + contour_point_vector_t stack_points; bool inplace = type == SIMPLE && all_points.length == 0; /* Load into all_points if it's empty, as an optimization. */ contour_point_vector_t &points = inplace ? all_points : stack_points; switch (type) { + case SIMPLE: + if (unlikely (!SimpleGlyph (*header, bytes).get_contour_points (points, phantom_only))) + return false; + break; case COMPOSITE: { /* pseudo component points for each component in composite glyph */ @@ -215,20 +236,25 @@ struct Glyph if (unlikely (!points.resize (num_points))) return false; break; } - case SIMPLE: - if (unlikely (!SimpleGlyph (*header, bytes).get_contour_points (points, phantom_only))) - return false; +#ifndef HB_NO_VAR_COMPOSITES + case VAR_COMPOSITE: + { + for (auto &item : get_var_composite_iterator ()) + if (unlikely (!item.get_points (points))) return false; + } +#endif + default: break; } /* Init phantom points */ if (unlikely (!points.resize (points.length + PHANTOM_COUNT))) return false; - hb_array_t phantoms = points.sub_array (points.length - PHANTOM_COUNT, PHANTOM_COUNT); + hb_array_t phantoms = points.as_array ().sub_array (points.length - PHANTOM_COUNT, PHANTOM_COUNT); { int lsb = 0; int h_delta = glyf_accelerator.hmtx->get_leading_bearing_without_var_unscaled (gid, &lsb) ? (int) header->xMin - lsb : 0; - int tsb = 0; + HB_UNUSED int tsb = 0; int v_orig = (int) header->yMax + #ifndef HB_NO_VERTICAL ((void) glyf_accelerator.vmtx->get_leading_bearing_without_var_unscaled (gid, &tsb), tsb) @@ -257,7 +283,9 @@ struct Glyph } #ifndef HB_NO_VAR - glyf_accelerator.gvar->apply_deltas_to_points (gid, font, points.as_array ()); + glyf_accelerator.gvar->apply_deltas_to_points (gid, + coords, + points.as_array ()); #endif // mainly used by CompositeGlyph calculating new X/Y offset value so no need to extend it @@ -283,11 +311,24 @@ struct Glyph for (auto &item : get_composite_iterator ()) { comp_points.reset (); + if (unlikely (!glyf_accelerator.glyph_for_gid (item.get_gid ()) - .get_points (font, glyf_accelerator, comp_points, - deltas, shift_points_hori, use_my_metrics, phantom_only, depth + 1))) + .get_points (font, + glyf_accelerator, + comp_points, + deltas, + shift_points_hori, + use_my_metrics, + phantom_only, + coords, + depth + 1))) return false; + /* Copy phantom points from component if USE_MY_METRICS flag set */ + if (use_my_metrics && item.is_use_my_metrics ()) + for (unsigned int i = 0; i < PHANTOM_COUNT; i++) + phantoms[i] = comp_points[comp_points.length - PHANTOM_COUNT + i]; + /* Apply component transformation & translation */ item.transform_points (comp_points); @@ -308,20 +349,63 @@ struct Glyph } } + all_points.extend (comp_points.as_array ().sub_array (0, comp_points.length - PHANTOM_COUNT)); + + if (all_points.length > HB_GLYF_MAX_POINTS) + return false; + + comp_index++; + } + + all_points.extend (phantoms); + } break; +#ifndef HB_NO_VAR_COMPOSITES + case VAR_COMPOSITE: + { + contour_point_vector_t comp_points; + hb_array_t points_left = points.as_array (); + for (auto &item : get_var_composite_iterator ()) + { + hb_array_t record_points = points_left.sub_array (0, item.get_num_points ()); + + comp_points.reset (); + + coord_setter_t coord_setter (coords); + item.set_variations (coord_setter, record_points); + + if (unlikely (!glyf_accelerator.glyph_for_gid (item.get_gid ()) + .get_points (font, + glyf_accelerator, + comp_points, + deltas, + shift_points_hori, + use_my_metrics, + phantom_only, + coord_setter.get_coords (), + depth + 1))) + return false; + + /* Apply component transformation */ + item.transform_points (record_points, comp_points); + /* Copy phantom points from component if USE_MY_METRICS flag set */ if (use_my_metrics && item.is_use_my_metrics ()) for (unsigned int i = 0; i < PHANTOM_COUNT; i++) phantoms[i] = comp_points[comp_points.length - PHANTOM_COUNT + i]; - all_points.extend (comp_points.sub_array (0, comp_points.length - PHANTOM_COUNT)); + all_points.extend (comp_points.as_array ().sub_array (0, comp_points.length - PHANTOM_COUNT)); - comp_index++; - } + if (all_points.length > HB_GLYF_MAX_POINTS) + return false; + points_left += item.get_num_points (); + } all_points.extend (phantoms); } break; +#endif default: all_points.extend (phantoms); + break; } if (depth == 0 && shift_points_hori) /* Apply at top level */ @@ -360,6 +444,7 @@ struct Glyph int num_contours = header->numberOfContours; if (unlikely (num_contours == 0)) type = EMPTY; else if (num_contours > 0) type = SIMPLE; + else if (num_contours == -2) type = VAR_COMPOSITE; else type = COMPOSITE; /* negative numbers */ } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/SimpleGlyph.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/SimpleGlyph.hh index d45f4eb3505..2b4aa99d25d 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/SimpleGlyph.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/SimpleGlyph.hh @@ -132,8 +132,8 @@ struct SimpleGlyph if (unlikely (p + 1 > end)) return false; unsigned int repeat_count = *p++; unsigned stop = hb_min (i + repeat_count, count); - for (; i < stop;) - points_.arrayZ[i++].flag = flag; + for (; i < stop; i++) + points_.arrayZ[i].flag = flag; } } return true; @@ -223,33 +223,34 @@ struct SimpleGlyph if (value > 0) flag |= same_flag; else value = -value; - coords.push ((uint8_t)value); + coords.arrayZ[coords.length++] = (uint8_t) value; } else { int16_t val = value; - coords.push (val >> 8); - coords.push (val & 0xff); + coords.arrayZ[coords.length++] = val >> 8; + coords.arrayZ[coords.length++] = val & 0xff; } } static void encode_flag (uint8_t &flag, uint8_t &repeat, - uint8_t &lastflag, + uint8_t lastflag, hb_vector_t &flags /* OUT */) { if (flag == lastflag && repeat != 255) { - repeat = repeat + 1; + repeat++; if (repeat == 1) { - flags.push(flag); + /* We know there's room. */ + flags.arrayZ[flags.length++] = flag; } else { unsigned len = flags.length; - flags[len-2] = flag | FLAG_REPEAT; - flags[len-1] = repeat; + flags.arrayZ[len-2] = flag | FLAG_REPEAT; + flags.arrayZ[len-1] = repeat; } } else @@ -257,7 +258,6 @@ struct SimpleGlyph repeat = 0; flags.push (flag); } - lastflag = flag; } bool compile_bytes_with_deltas (const contour_point_vector_t &all_points, @@ -269,7 +269,6 @@ struct SimpleGlyph dest_bytes = hb_bytes_t (); return true; } - //convert absolute values to relative values unsigned num_points = all_points.length - 4; hb_vector_t flags, x_coords, y_coords; @@ -277,23 +276,23 @@ struct SimpleGlyph if (unlikely (!x_coords.alloc (2*num_points))) return false; if (unlikely (!y_coords.alloc (2*num_points))) return false; - uint8_t lastflag = 0, repeat = 0; - int prev_x = 0.f, prev_y = 0.f; - + uint8_t lastflag = 255, repeat = 0; + int prev_x = 0, prev_y = 0; + for (unsigned i = 0; i < num_points; i++) { - uint8_t flag = all_points[i].flag; + uint8_t flag = all_points.arrayZ[i].flag; flag &= FLAG_ON_CURVE + FLAG_OVERLAP_SIMPLE; - float cur_x = roundf (all_points[i].x); - float cur_y = roundf (all_points[i].y); + int cur_x = roundf (all_points.arrayZ[i].x); + int cur_y = roundf (all_points.arrayZ[i].y); encode_coord (cur_x - prev_x, flag, FLAG_X_SHORT, FLAG_X_SAME, x_coords); encode_coord (cur_y - prev_y, flag, FLAG_Y_SHORT, FLAG_Y_SAME, y_coords); - if (i == 0) lastflag = flag + 1; //make lastflag != flag for the first point encode_flag (flag, repeat, lastflag, flags); prev_x = cur_x; prev_y = cur_y; + lastflag = flag; } unsigned len_before_instrs = 2 * header.numberOfContours + 2; @@ -303,29 +302,29 @@ struct SimpleGlyph if (!no_hinting) total_len += len_instrs; - char *p = (char *) hb_calloc (total_len, sizeof (char)); + char *p = (char *) hb_malloc (total_len); if (unlikely (!p)) return false; const char *src = bytes.arrayZ + GlyphHeader::static_size; char *cur = p; - memcpy (p, src, len_before_instrs); + hb_memcpy (p, src, len_before_instrs); cur += len_before_instrs; src += len_before_instrs; if (!no_hinting) { - memcpy (cur, src, len_instrs); + hb_memcpy (cur, src, len_instrs); cur += len_instrs; } - memcpy (cur, flags.arrayZ, flags.length); + hb_memcpy (cur, flags.arrayZ, flags.length); cur += flags.length; - memcpy (cur, x_coords.arrayZ, x_coords.length); + hb_memcpy (cur, x_coords.arrayZ, x_coords.length); cur += x_coords.length; - memcpy (cur, y_coords.arrayZ, y_coords.length); + hb_memcpy (cur, y_coords.arrayZ, y_coords.length); dest_bytes = hb_bytes_t (p, total_len); return true; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/SubsetGlyph.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/SubsetGlyph.hh index 88fc93c4358..1a0370c7577 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/SubsetGlyph.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/SubsetGlyph.hh @@ -21,10 +21,18 @@ struct SubsetGlyph bool serialize (hb_serialize_context_t *c, bool use_short_loca, - const hb_subset_plan_t *plan) const + const hb_subset_plan_t *plan, + hb_font_t *font) { TRACE_SERIALIZE (this); + if (font) + { + const OT::glyf_accelerator_t &glyf = *font->face->table.glyf; + if (!this->compile_bytes_with_deltas (plan, font, glyf)) + return_trace (false); + } + 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 = use_short_loca ? padding () : 0; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/VarCompositeGlyph.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/VarCompositeGlyph.hh new file mode 100644 index 00000000000..0f4c71c83d5 --- /dev/null +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/VarCompositeGlyph.hh @@ -0,0 +1,353 @@ +#ifndef OT_GLYF_VARCOMPOSITEGLYPH_HH +#define OT_GLYF_VARCOMPOSITEGLYPH_HH + + +#include "../../hb-open-type.hh" +#include "coord-setter.hh" + + +namespace OT { +namespace glyf_impl { + + +struct VarCompositeGlyphRecord +{ + protected: + enum var_composite_glyph_flag_t + { + USE_MY_METRICS = 0x0001, + AXIS_INDICES_ARE_SHORT = 0x0002, + UNIFORM_SCALE = 0x0004, + HAVE_TRANSLATE_X = 0x0008, + HAVE_TRANSLATE_Y = 0x0010, + HAVE_ROTATION = 0x0020, + HAVE_SCALE_X = 0x0040, + HAVE_SCALE_Y = 0x0080, + HAVE_SKEW_X = 0x0100, + HAVE_SKEW_Y = 0x0200, + HAVE_TCENTER_X = 0x0400, + HAVE_TCENTER_Y = 0x0800, + GID_IS_24 = 0x1000, + AXES_HAVE_VARIATION = 0x2000, + }; + + public: + + unsigned int get_size () const + { + unsigned int size = min_size; + + unsigned axis_width = (flags & AXIS_INDICES_ARE_SHORT) ? 4 : 3; + size += numAxes * axis_width; + + // gid + size += 2; + if (flags & GID_IS_24) size += 1; + + if (flags & HAVE_TRANSLATE_X) size += 2; + if (flags & HAVE_TRANSLATE_Y) size += 2; + if (flags & HAVE_ROTATION) size += 2; + if (flags & HAVE_SCALE_X) size += 2; + if (flags & HAVE_SCALE_Y) size += 2; + if (flags & HAVE_SKEW_X) size += 2; + if (flags & HAVE_SKEW_Y) size += 2; + if (flags & HAVE_TCENTER_X) size += 2; + if (flags & HAVE_TCENTER_Y) size += 2; + + return size; + } + + bool has_more () const { return true; } + + bool is_use_my_metrics () const { return flags & USE_MY_METRICS; } + + hb_codepoint_t get_gid () const + { + if (flags & GID_IS_24) + return StructAfter (numAxes); + else + return StructAfter (numAxes); + } + + unsigned get_numAxes () const + { + return numAxes; + } + + unsigned get_num_points () const + { + unsigned num = 0; + if (flags & AXES_HAVE_VARIATION) num += numAxes; + if (flags & (HAVE_TRANSLATE_X | HAVE_TRANSLATE_Y)) num++; + if (flags & HAVE_ROTATION) num++; + if (flags & (HAVE_SCALE_X | HAVE_SCALE_Y)) num++; + if (flags & (HAVE_SKEW_X | HAVE_SKEW_Y)) num++; + if (flags & (HAVE_TCENTER_X | HAVE_TCENTER_Y)) num++; + return num; + } + + void transform_points (hb_array_t record_points, + contour_point_vector_t &points) const + { + float matrix[4]; + contour_point_t trans; + + get_transformation_from_points (record_points, matrix, trans); + + points.transform (matrix); + points.translate (trans); + } + + static inline void transform (float (&matrix)[4], contour_point_t &trans, + float (other)[6]) + { + // https://github.com/fonttools/fonttools/blob/f66ee05f71c8b57b5f519ee975e95edcd1466e14/Lib/fontTools/misc/transform.py#L268 + float xx1 = other[0]; + float xy1 = other[1]; + float yx1 = other[2]; + float yy1 = other[3]; + float dx1 = other[4]; + float dy1 = other[5]; + float xx2 = matrix[0]; + float xy2 = matrix[1]; + float yx2 = matrix[2]; + float yy2 = matrix[3]; + float dx2 = trans.x; + float dy2 = trans.y; + + matrix[0] = xx1*xx2 + xy1*yx2; + matrix[1] = xx1*xy2 + xy1*yy2; + matrix[2] = yx1*xx2 + yy1*yx2; + matrix[3] = yx1*xy2 + yy1*yy2; + trans.x = xx2*dx1 + yx2*dy1 + dx2; + trans.y = xy2*dx1 + yy2*dy1 + dy2; + } + + static void translate (float (&matrix)[4], contour_point_t &trans, + float translateX, float translateY) + { + // https://github.com/fonttools/fonttools/blob/f66ee05f71c8b57b5f519ee975e95edcd1466e14/Lib/fontTools/misc/transform.py#L213 + float other[6] = {1.f, 0.f, 0.f, 1.f, translateX, translateY}; + transform (matrix, trans, other); + } + + static void scale (float (&matrix)[4], contour_point_t &trans, + float scaleX, float scaleY) + { + // https://github.com/fonttools/fonttools/blob/f66ee05f71c8b57b5f519ee975e95edcd1466e14/Lib/fontTools/misc/transform.py#L224 + float other[6] = {scaleX, 0.f, 0.f, scaleY, 0.f, 0.f}; + transform (matrix, trans, other); + } + + static void rotate (float (&matrix)[4], contour_point_t &trans, + float rotation) + { + // https://github.com/fonttools/fonttools/blob/f66ee05f71c8b57b5f519ee975e95edcd1466e14/Lib/fontTools/misc/transform.py#L240 + rotation = rotation * float (M_PI); + float c = cosf (rotation); + float s = sinf (rotation); + float other[6] = {c, s, -s, c, 0.f, 0.f}; + transform (matrix, trans, other); + } + + static void skew (float (&matrix)[4], contour_point_t &trans, + float skewX, float skewY) + { + // https://github.com/fonttools/fonttools/blob/f66ee05f71c8b57b5f519ee975e95edcd1466e14/Lib/fontTools/misc/transform.py#L255 + skewX = skewX * float (M_PI); + skewY = skewY * float (M_PI); + float other[6] = {1.f, tanf (skewY), tanf (skewX), 1.f, 0.f, 0.f}; + transform (matrix, trans, other); + } + + bool get_points (contour_point_vector_t &points) const + { + float translateX = 0.f; + float translateY = 0.f; + float rotation = 0.f; + float scaleX = 1.f * (1 << 12); + float scaleY = 1.f * (1 << 12); + float skewX = 0.f; + float skewY = 0.f; + float tCenterX = 0.f; + float tCenterY = 0.f; + + if (unlikely (!points.resize (points.length + get_num_points ()))) return false; + + unsigned axis_width = (flags & AXIS_INDICES_ARE_SHORT) ? 2 : 1; + unsigned axes_size = numAxes * axis_width; + + const F2DOT14 *q = (const F2DOT14 *) (axes_size + + (flags & GID_IS_24 ? 3 : 2) + + &StructAfter (numAxes)); + + hb_array_t rec_points = points.as_array ().sub_array (points.length - get_num_points ()); + + unsigned count = numAxes; + if (flags & AXES_HAVE_VARIATION) + { + for (unsigned i = 0; i < count; i++) + rec_points[i].x = *q++; + rec_points += count; + } + else + q += count; + + const HBUINT16 *p = (const HBUINT16 *) q; + + if (flags & HAVE_TRANSLATE_X) translateX = * (const FWORD *) p++; + if (flags & HAVE_TRANSLATE_Y) translateY = * (const FWORD *) p++; + if (flags & HAVE_ROTATION) rotation = * (const F2DOT14 *) p++; + if (flags & HAVE_SCALE_X) scaleX = * (const F4DOT12 *) p++; + if (flags & HAVE_SCALE_Y) scaleY = * (const F4DOT12 *) p++; + if (flags & HAVE_SKEW_X) skewX = * (const F2DOT14 *) p++; + if (flags & HAVE_SKEW_Y) skewY = * (const F2DOT14 *) p++; + if (flags & HAVE_TCENTER_X) tCenterX = * (const FWORD *) p++; + if (flags & HAVE_TCENTER_Y) tCenterY = * (const FWORD *) p++; + + if ((flags & UNIFORM_SCALE) && !(flags & HAVE_SCALE_Y)) + scaleY = scaleX; + + if (flags & (HAVE_TRANSLATE_X | HAVE_TRANSLATE_Y)) + { + rec_points[0].x = translateX; + rec_points[0].y = translateY; + rec_points++; + } + if (flags & HAVE_ROTATION) + { + rec_points[0].x = rotation; + rec_points++; + } + if (flags & (HAVE_SCALE_X | HAVE_SCALE_Y)) + { + rec_points[0].x = scaleX; + rec_points[0].y = scaleY; + rec_points++; + } + if (flags & (HAVE_SKEW_X | HAVE_SKEW_Y)) + { + rec_points[0].x = skewX; + rec_points[0].y = skewY; + rec_points++; + } + if (flags & (HAVE_TCENTER_X | HAVE_TCENTER_Y)) + { + rec_points[0].x = tCenterX; + rec_points[0].y = tCenterY; + rec_points++; + } + assert (!rec_points); + + return true; + } + + void get_transformation_from_points (hb_array_t rec_points, + float (&matrix)[4], contour_point_t &trans) const + { + if (flags & AXES_HAVE_VARIATION) + rec_points += numAxes; + + matrix[0] = matrix[3] = 1.f; + matrix[1] = matrix[2] = 0.f; + trans.init (0.f, 0.f); + + float translateX = 0.f; + float translateY = 0.f; + float rotation = 0.f; + float scaleX = 1.f; + float scaleY = 1.f; + float skewX = 0.f; + float skewY = 0.f; + float tCenterX = 0.f; + float tCenterY = 0.f; + + if (flags & (HAVE_TRANSLATE_X | HAVE_TRANSLATE_Y)) + { + translateX = rec_points[0].x; + translateY = rec_points[0].y; + rec_points++; + } + if (flags & HAVE_ROTATION) + { + rotation = rec_points[0].x / (1 << 14); + rec_points++; + } + if (flags & (HAVE_SCALE_X | HAVE_SCALE_Y)) + { + scaleX = rec_points[0].x / (1 << 12); + scaleY = rec_points[0].y / (1 << 12); + rec_points++; + } + if (flags & (HAVE_SKEW_X | HAVE_SKEW_Y)) + { + skewX = rec_points[0].x / (1 << 14); + skewY = rec_points[0].y / (1 << 14); + rec_points++; + } + if (flags & (HAVE_TCENTER_X | HAVE_TCENTER_Y)) + { + tCenterX = rec_points[0].x; + tCenterY = rec_points[0].y; + rec_points++; + } + assert (!rec_points); + + translate (matrix, trans, translateX + tCenterX, translateY + tCenterY); + rotate (matrix, trans, rotation); + scale (matrix, trans, scaleX, scaleY); + skew (matrix, trans, -skewX, skewY); + translate (matrix, trans, -tCenterX, -tCenterY); + } + + void set_variations (coord_setter_t &setter, + hb_array_t rec_points) const + { + bool have_variations = flags & AXES_HAVE_VARIATION; + unsigned axis_width = (flags & AXIS_INDICES_ARE_SHORT) ? 2 : 1; + + const HBUINT8 *p = (const HBUINT8 *) (((HBUINT8 *) &numAxes) + numAxes.static_size + (flags & GID_IS_24 ? 3 : 2)); + const HBUINT16 *q = (const HBUINT16 *) (((HBUINT8 *) &numAxes) + numAxes.static_size + (flags & GID_IS_24 ? 3 : 2)); + + const F2DOT14 *a = (const F2DOT14 *) ((HBUINT8 *) (axis_width == 1 ? (p + numAxes) : (HBUINT8 *) (q + numAxes))); + + unsigned count = numAxes; + for (unsigned i = 0; i < count; i++) + { + unsigned axis_index = axis_width == 1 ? (unsigned) *p++ : (unsigned) *q++; + + signed v = have_variations ? rec_points[i].x : *a++; + + v += setter[axis_index]; + v = hb_clamp (v, -(1<<14), (1<<14)); + setter[axis_index] = v; + } + } + + protected: + HBUINT16 flags; + HBUINT8 numAxes; + public: + DEFINE_SIZE_MIN (3); +}; + +using var_composite_iter_t = composite_iter_tmpl; + +struct VarCompositeGlyph +{ + const GlyphHeader &header; + hb_bytes_t bytes; + VarCompositeGlyph (const GlyphHeader &header_, hb_bytes_t bytes_) : + header (header_), bytes (bytes_) {} + + var_composite_iter_t iter () const + { return var_composite_iter_t (bytes, &StructAfter (header)); } + +}; + + +} /* namespace glyf_impl */ +} /* namespace OT */ + + +#endif /* OT_GLYF_VARCOMPOSITEGLYPH_HH */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/composite-iter.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/composite-iter.hh new file mode 100644 index 00000000000..d05701f3d1e --- /dev/null +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/composite-iter.hh @@ -0,0 +1,68 @@ +#ifndef OT_GLYF_COMPOSITE_ITER_HH +#define OT_GLYF_COMPOSITE_ITER_HH + + +#include "../../hb.hh" + + +namespace OT { +namespace glyf_impl { + + +template +struct composite_iter_tmpl : hb_iter_with_fallback_t, + const CompositeGlyphRecord &> +{ + typedef const CompositeGlyphRecord *__item_t__; + composite_iter_tmpl (hb_bytes_t glyph_, __item_t__ current_) : + glyph (glyph_), current (nullptr), current_size (0) + { + set_current (current_); + } + + composite_iter_tmpl () : glyph (hb_bytes_t ()), current (nullptr), current_size (0) {} + + const CompositeGlyphRecord & __item__ () const { return *current; } + bool __more__ () const { return current; } + void __next__ () + { + if (!current->has_more ()) { current = nullptr; return; } + + set_current (&StructAtOffset (current, current_size)); + } + composite_iter_tmpl __end__ () const { return composite_iter_tmpl (); } + bool operator != (const composite_iter_tmpl& o) const + { return current != o.current; } + + + void set_current (__item_t__ current_) + { + if (!glyph.check_range (current_, CompositeGlyphRecord::min_size)) + { + current = nullptr; + current_size = 0; + return; + } + unsigned size = current_->get_size (); + if (!glyph.check_range (current_, size)) + { + current = nullptr; + current_size = 0; + return; + } + + current = current_; + current_size = size; + } + + private: + hb_bytes_t glyph; + __item_t__ current; + unsigned current_size; +}; + + +} /* namespace glyf_impl */ +} /* namespace OT */ + +#endif /* OT_GLYF_COMPOSITE_ITER_HH */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/coord-setter.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/coord-setter.hh new file mode 100644 index 00000000000..df64ed5af7d --- /dev/null +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/coord-setter.hh @@ -0,0 +1,34 @@ +#ifndef OT_GLYF_COORD_SETTER_HH +#define OT_GLYF_COORD_SETTER_HH + + +#include "../../hb.hh" + + +namespace OT { +namespace glyf_impl { + + +struct coord_setter_t +{ + coord_setter_t (hb_array_t coords) : + coords (coords) {} + + int& operator [] (unsigned idx) + { + if (coords.length < idx + 1) + coords.resize (idx + 1); + return coords[idx]; + } + + hb_array_t get_coords () + { return coords.as_array (); } + + hb_vector_t coords; +}; + + +} /* namespace glyf_impl */ +} /* namespace OT */ + +#endif /* OT_GLYF_COORD_SETTER_HH */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/glyf.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/glyf.hh index 5fb32f67f35..e6e985c38c8 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/glyf.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/glyf.hh @@ -42,11 +42,15 @@ struct glyf bool serialize (hb_serialize_context_t *c, Iterator it, bool use_short_loca, - const hb_subset_plan_t *plan) + const hb_subset_plan_t *plan, + hb_font_t *font) { TRACE_SERIALIZE (this); + unsigned init_len = c->length (); - for (const auto &_ : it) _.serialize (c, use_short_loca, plan); + for (auto &_ : it) + if (unlikely (!_.serialize (c, use_short_loca, plan, font))) + return false; /* As a special case when all glyph in the font are empty, add a zero byte * to the table, so that OTS doesn’t reject it, and to make the table work @@ -74,10 +78,11 @@ struct glyf hb_vector_t glyphs; _populate_subset_glyphs (c->plan, glyphs); + hb_font_t *font = nullptr; if (!c->plan->pinned_at_default) { - if (!_compile_subset_glyphs_with_deltas (c->plan, &glyphs)) - return_trace (false); + font = _create_font_for_instancing (c->plan); + if (unlikely (!font)) return false; } auto padded_offsets = @@ -85,11 +90,14 @@ struct glyf | hb_map (&glyf_impl::SubsetGlyph::padded_size) ; - unsigned max_offset = + padded_offsets | hb_reduce (hb_add, 0); - bool use_short_loca = max_offset < 0x1FFFF; - + bool use_short_loca = false; + if (likely (!c->plan->force_long_loca)) + { + unsigned max_offset = + padded_offsets | hb_reduce (hb_add, 0); + use_short_loca = max_offset < 0x1FFFF; + } - glyf_prime->serialize (c->serializer, hb_iter (glyphs), use_short_loca, c->plan); + glyf_prime->serialize (c->serializer, glyphs.writer (), use_short_loca, c->plan, font); if (!use_short_loca) { padded_offsets = + hb_iter (glyphs) @@ -97,9 +105,12 @@ struct glyf ; } - - if (!c->plan->pinned_at_default) + if (font) + { _free_compiled_subset_glyphs (&glyphs); + hb_font_destroy (font); + } + if (unlikely (c->serializer->in_error ())) return_trace (false); return_trace (c->serializer->check_success (glyf_impl::_add_loca_and_head (c->plan, padded_offsets, @@ -110,9 +121,8 @@ struct glyf _populate_subset_glyphs (const hb_subset_plan_t *plan, hb_vector_t &glyphs /* OUT */) const; - bool - _compile_subset_glyphs_with_deltas (const hb_subset_plan_t *plan, - hb_vector_t *glyphs /* OUT */) const; + hb_font_t * + _create_font_for_instancing (const hb_subset_plan_t *plan) const; void _free_compiled_subset_glyphs (hb_vector_t *glyphs) const { @@ -394,7 +404,11 @@ glyf::_populate_subset_glyphs (const hb_subset_plan_t *plan, plan->pinned_at_default) subset_glyph.source_glyph = glyf_impl::Glyph (); else - subset_glyph.source_glyph = glyf.glyph_for_gid (subset_glyph.old_gid, true); + { + /* If plan has an accelerator, the preprocessing step already trimmed glyphs. + * Don't trim them again! */ + subset_glyph.source_glyph = glyf.glyph_for_gid (subset_glyph.old_gid, !plan->accelerator); + } if (plan->flags & HB_SUBSET_FLAGS_NO_HINTING) subset_glyph.drop_hints_bytes (); @@ -403,17 +417,15 @@ glyf::_populate_subset_glyphs (const hb_subset_plan_t *plan, } } -inline bool -glyf::_compile_subset_glyphs_with_deltas (const hb_subset_plan_t *plan, - hb_vector_t *glyphs /* OUT */) const +inline hb_font_t * +glyf::_create_font_for_instancing (const hb_subset_plan_t *plan) const { - OT::glyf_accelerator_t glyf (plan->source); hb_font_t *font = hb_font_create (plan->source); - if (unlikely (!font)) return false; + if (unlikely (font == hb_font_get_empty ())) return nullptr; hb_vector_t vars; if (unlikely (!vars.alloc (plan->user_axes_location->get_population ()))) - return false; + return nullptr; for (auto _ : *plan->user_axes_location) { @@ -423,18 +435,10 @@ glyf::_compile_subset_glyphs_with_deltas (const hb_subset_plan_t *plan, vars.push (var); } +#ifndef HB_NO_VAR hb_font_set_variations (font, vars.arrayZ, plan->user_axes_location->get_population ()); - for (auto& subset_glyph : *glyphs) - { - if (!const_cast (subset_glyph).compile_bytes_with_deltas (plan, font, glyf)) - { - hb_font_destroy (font); - return false; - } - } - - hb_font_destroy (font); - return true; +#endif + return font; } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/check-symbols.py b/Build/source/libs/harfbuzz/harfbuzz-src/src/check-symbols.py index 11ca28dc7f4..d0b8bd3c82d 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/check-symbols.py +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/check-symbols.py @@ -31,7 +31,7 @@ for soname in ['harfbuzz', 'harfbuzz-subset', 'harfbuzz-icu', 'harfbuzz-gobject' symprefix = '_' if suffix == 'dylib' else '' EXPORTED_SYMBOLS = [s.split ()[2] - for s in re.findall (r'^.+ [BCDGIRST] .+$', subprocess.check_output (nm.split() + [so]).decode ('utf-8'), re.MULTILINE) + for s in re.findall (r'^.+ [BCDGIRSTu] .+$', subprocess.check_output (nm.split() + [so]).decode ('utf-8'), re.MULTILINE) if not re.match (r'.* %s(%s)\b' % (symprefix, IGNORED_SYMBOLS), s)] # run again c++filt also if is available diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-def.py b/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-def.py index e751f524e47..9b4efd4f3ec 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-def.py +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-def.py @@ -20,9 +20,7 @@ if '--experimental-api' not in sys.argv: # Move these to harfbuzz-sections.txt when got stable experimental_symbols = \ """hb_subset_repack_or_fail -hb_subset_input_pin_axis_location -hb_subset_input_pin_axis_to_default -hb_subset_preprocess +hb_subset_input_override_name_table """.splitlines () symbols = [x for x in symbols if x not in experimental_symbols] symbols = "\n".join (symbols) diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-indic-table.py b/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-indic-table.py index 0ff3ef4ac2f..4ef970265d1 100755 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-indic-table.py +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-indic-table.py @@ -95,6 +95,7 @@ categories = { 'PLACEHOLDER', 'DOTTEDCIRCLE', 'RS', + 'MPst', 'Repha', 'Ra', 'CM', @@ -168,8 +169,6 @@ category_map = { 'Vowel' : 'V', 'Vowel_Dependent' : 'M', 'Vowel_Independent' : 'V', - 'Dotted_Circle' : 'DOTTEDCIRCLE', # Ours, not Unicode's - 'Ra' : 'Ra', # Ours, not Unicode's } position_map = { 'Not_Applicable' : 'END', @@ -240,6 +239,9 @@ category_overrides = { 0x0953: 'SM', 0x0954: 'SM', + # U+0A40 GURMUKHI VOWEL SIGN II may be preceded by U+0A02 GURMUKHI SIGN BINDI. + 0x0A40: 'MPst', + # The following act like consonants. 0x0A72: 'C', 0x0A73: 'C', @@ -440,7 +442,7 @@ for k,new_cat in category_overrides.items(): indic_data[k] = (new_cat, pos, unicode_data[2][k]) # We only expect position for certain types -positioned_categories = ('CM', 'SM', 'RS', 'H', 'M') +positioned_categories = ('CM', 'SM', 'RS', 'H', 'M', 'MPst') for k, (cat, pos, block) in indic_data.items(): if cat not in positioned_categories: pos = 'END' @@ -450,11 +452,12 @@ for k, (cat, pos, block) in indic_data.items(): # Keep in sync with CONSONANT_FLAGS in the shaper consonant_categories = ('C', 'CS', 'Ra','CM', 'V', 'PLACEHOLDER', 'DOTTEDCIRCLE') +matra_categories = ('M', 'MPst') smvd_categories = ('SM', 'VD', 'A', 'Symbol') for k, (cat, pos, block) in indic_data.items(): if cat in consonant_categories: pos = 'BASE_C' - elif cat == 'M': + elif cat in matra_categories: if block.startswith('Khmer') or block.startswith('Myanmar'): cat = position_to_category(pos) else: @@ -634,7 +637,7 @@ for u in uu: end = (end-1)//8*8 + 7 if start != last + 1: - if start - last <= 1+16*3: + if start - last <= 1+16*2: print_block (None, last+1, start-1, indic_data) else: if last >= 0: @@ -691,6 +694,6 @@ print ('#endif') print () print ("/* == End of generated table == */") -# Maintain at least 30% occupancy in the table */ -if occupancy < 30: +# Maintain at least 50% occupancy in the table */ +if occupancy < 50: raise Exception ("Table too sparse, please investigate: ", occupancy) diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-ucd-table.py b/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-ucd-table.py index f4c099f863e..d85ae4faa89 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-ucd-table.py +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-ucd-table.py @@ -25,14 +25,28 @@ hb_common_h = 'hb-common.h' if len (sys.argv) < 3 else sys.argv[2] logging.info('Preparing data tables...') + +# This is how the data is encoded: +# +# General_Category (gc), Canonical_Combining_Class (ccc), +# and Script (sc) are encoded as integers. +# +# Mirroring character (bmg) is encoded as difference from +# the original character. +# +# Composition & Decomposition (dm) are encoded elaborately, +# as discussed below. + 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] + +# Prepare Compose / Decompose data +# +# This code is very dense. See hb_ucd_compose() / hb_ucd_decompose() for the logic. + 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'} @@ -63,6 +77,9 @@ dm_order = {None: 0} dm_order.update(dm1_order) dm_order.update(dm2_order) + +# Prepare General_Category / Script mapping arrays + 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', @@ -83,10 +100,18 @@ for line in open(hb_common_h): sc_order[i] = tag sc_array.append(name) -DEFAULT = 3 -COMPACT = 5 -SLOPPY = 9 +# Write out main data + +DEFAULT = 'DEFAULT' +COMPACT = 'COMPACT' +SLOPPY = 'SLOPPY' + +compression_level = { + DEFAULT: 5, + COMPACT: 9, + SLOPPY: 9, +} logging.info('Generating output...') print("/* == Start of generated table == */") @@ -104,6 +129,9 @@ print() print('#include "hb.hh"') print() + +# Write mapping data + 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) @@ -120,18 +148,24 @@ datasets = [ ('dm', dm, None, dm_order), ] -for compression in (DEFAULT, COMPACT, SLOPPY): + +# Write main data + +for step in (DEFAULT, COMPACT, SLOPPY): + compression = compression_level[step] logging.info(' Compression=%d:' % compression) print() - if compression == DEFAULT: + if step == DEFAULT: print('#ifndef HB_OPTIMIZE_SIZE') - elif compression == COMPACT: + elif step == COMPACT: print('#elif !defined(HB_NO_UCD_UNASSIGNED)') - else: + elif step == SLOPPY: print('#else') + else: + assert False print() - if compression == SLOPPY: + if step == SLOPPY: for i in range(len(gc)): if (i % 128) and gc[i] == 'Cn': gc[i] = gc[i - 1] @@ -157,6 +191,7 @@ for compression in (DEFAULT, COMPACT, SLOPPY): print() + print('#endif') print() diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-use-table.py b/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-use-table.py index 0600a33886b..e8b76dfb5fb 100755 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-use-table.py +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-use-table.py @@ -1,6 +1,9 @@ #!/usr/bin/env python3 # flake8: noqa: F821 +import logging +logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO) + """usage: ./gen-use-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt ArabicShaping.txt DerivedCoreProperties.txt UnicodeData.txt Blocks.txt Scripts.txt IndicSyllabicCategory-Additional.txt IndicPositionalCategory-Additional.txt Input files: @@ -465,10 +468,29 @@ print ("") import packTab data = {u:v[0] for u,v in use_data.items()} -code = packTab.Code('hb_use') -sol = packTab.pack_table(data, compression=5, default='O') -sol.genCode(code, f'get_category') -code.print_c(linkage='static inline') + +DEFAULT = 5 +COMPACT = 9 +for compression in (DEFAULT, COMPACT): + + logging.info(' Compression=%d:' % compression) + print() + if compression == DEFAULT: + print('#ifndef HB_OPTIMIZE_SIZE') + elif compression == COMPACT: + print('#else') + else: + assert False + print() + + code = packTab.Code('hb_use') + sol = packTab.pack_table(data, compression=compression, default='O') + logging.info(' FullCost=%d' % (sol.fullCost)) + sol.genCode(code, f'get_category') + code.print_c(linkage='static inline') + print () + +print('#endif') print () for k in sorted(use_mapping.keys()): diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/classdef-graph.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/classdef-graph.hh index 0bda76ac2f0..c2e24a70678 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/classdef-graph.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/classdef-graph.hh @@ -112,7 +112,7 @@ struct ClassDef : public OT::ClassDef { case 1: return ((ClassDefFormat1*)this)->sanitize (vertex); case 2: return ((ClassDefFormat2*)this)->sanitize (vertex); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K // Not currently supported case 3: case 4: diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/coverage-graph.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/coverage-graph.hh index 3c1022f0903..49d09363156 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/coverage-graph.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/coverage-graph.hh @@ -136,7 +136,7 @@ struct Coverage : public OT::Layout::Common::Coverage { case 1: return ((CoverageFormat1*)this)->sanitize (vertex); case 2: return ((CoverageFormat2*)this)->sanitize (vertex); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K // Not currently supported case 3: case 4: diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/graph.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/graph.hh index 79c7e690a16..dc5b6a36fef 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/graph.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/graph.hh @@ -49,6 +49,50 @@ struct graph_t unsigned end = 0; unsigned priority = 0; + + bool link_positions_valid (unsigned num_objects, bool removed_nil) + { + hb_set_t assigned_bytes; + for (const auto& l : obj.real_links) + { + if (l.objidx >= num_objects + || (removed_nil && !l.objidx)) + { + DEBUG_MSG (SUBSET_REPACK, nullptr, + "Invalid graph. Invalid object index."); + return false; + } + + unsigned start = l.position; + unsigned end = start + l.width - 1; + + if (unlikely (l.width < 2 || l.width > 4)) + { + DEBUG_MSG (SUBSET_REPACK, nullptr, + "Invalid graph. Invalid link width."); + return false; + } + + if (unlikely (end >= table_size ())) + { + DEBUG_MSG (SUBSET_REPACK, nullptr, + "Invalid graph. Link position is out of bounds."); + return false; + } + + if (unlikely (assigned_bytes.intersects (start, end))) + { + DEBUG_MSG (SUBSET_REPACK, nullptr, + "Invalid graph. Found offsets whose positions overlap."); + return false; + } + + assigned_bytes.add_range (start, end); + } + + return !assigned_bytes.in_error (); + } + void normalize () { obj.real_links.qsort (); @@ -132,7 +176,7 @@ struct graph_t for (unsigned i = 0; i < parents.length; i++) { if (parents[i] != parent_index) continue; - parents.remove (i); + parents.remove_unordered (i); break; } } @@ -148,7 +192,7 @@ struct graph_t if ((obj.head + link.position) != offset) continue; - obj.real_links.remove (i); + obj.real_links.remove_unordered (i); return; } } @@ -286,8 +330,6 @@ struct graph_t vertices_scratch_.alloc (objects.length); for (unsigned i = 0; i < objects.length; i++) { - // TODO(grieger): check all links point to valid objects. - // If this graph came from a serialization buffer object 0 is the // nil object. We don't need it for our purposes here so drop it. if (i == 0 && !objects[i]) @@ -299,6 +341,9 @@ struct graph_t vertex_t* v = vertices_.push (); if (check_success (!vertices_.in_error ())) v->obj = *objects[i]; + + check_success (v->link_positions_valid (objects.length, removed_nil)); + if (!removed_nil) continue; // Fix indices to account for removed nil object. for (auto& l : v->obj.all_links_writer ()) { @@ -418,6 +463,13 @@ struct graph_t hb_swap (sorted_graph[new_id], vertices_[next_id]); const vertex_t& next = sorted_graph[new_id]; + if (unlikely (!check_success(new_id >= 0))) { + // We are out of ids. Which means we've visited a node more than once. + // This graph contains a cycle which is not allowed. + DEBUG_MSG (SUBSET_REPACK, nullptr, "Invalid graph. Contains cycle."); + return; + } + id_map[next_id] = new_id--; for (const auto& link : next.obj.all_links ()) { @@ -580,7 +632,7 @@ struct graph_t while (roots) { - unsigned next = HB_SET_VALUE_INVALID; + uint32_t next = HB_SET_VALUE_INVALID; if (unlikely (!check_success (!roots.in_error ()))) break; if (!roots.next (&next)) break; @@ -661,8 +713,8 @@ struct graph_t auto new_subgraph = + subgraph.keys () - | hb_map([&] (unsigned node_idx) { - const unsigned *v; + | hb_map([&] (uint32_t node_idx) { + const uint32_t *v; if (index_map.has (node_idx, &v)) return *v; return node_idx; }) @@ -672,10 +724,10 @@ struct graph_t remap_obj_indices (index_map, parents.iter (), true); // Update roots set with new indices as needed. - unsigned next = HB_SET_VALUE_INVALID; + uint32_t next = HB_SET_VALUE_INVALID; while (roots.next (&next)) { - const unsigned *v; + const uint32_t *v; if (index_map.has (next, &v)) { roots.del (next); @@ -690,7 +742,7 @@ struct graph_t { for (const auto& link : vertices_[node_idx].obj.all_links ()) { - const unsigned *v; + const uint32_t *v; if (subgraph.has (link.objidx, &v)) { subgraph.set (link.objidx, *v + 1); @@ -941,6 +993,72 @@ struct graph_t return made_change; } + bool is_fully_connected () + { + update_parents(); + + if (root().parents) + // Root cannot have parents. + return false; + + for (unsigned i = 0; i < root_idx (); i++) + { + if (!vertices_[i].parents) + return false; + } + return true; + } + +#if 0 + /* + * Saves the current graph to a packed binary format which the repacker fuzzer takes + * as a seed. + */ + void save_fuzzer_seed (hb_tag_t tag) const + { + FILE* f = fopen ("./repacker_fuzzer_seed", "w"); + fwrite ((void*) &tag, sizeof (tag), 1, f); + + uint16_t num_objects = vertices_.length; + fwrite ((void*) &num_objects, sizeof (num_objects), 1, f); + + for (const auto& v : vertices_) + { + uint16_t blob_size = v.table_size (); + fwrite ((void*) &blob_size, sizeof (blob_size), 1, f); + fwrite ((const void*) v.obj.head, blob_size, 1, f); + } + + uint16_t link_count = 0; + for (const auto& v : vertices_) + link_count += v.obj.real_links.length; + + fwrite ((void*) &link_count, sizeof (link_count), 1, f); + + typedef struct + { + uint16_t parent; + uint16_t child; + uint16_t position; + uint8_t width; + } link_t; + + for (unsigned i = 0; i < vertices_.length; i++) + { + for (const auto& l : vertices_[i].obj.real_links) + { + link_t link { + (uint16_t) i, (uint16_t) l.objidx, + (uint16_t) l.position, (uint8_t) l.width + }; + fwrite ((void*) &link, sizeof (link), 1, f); + } + } + + fclose (f); + } +#endif + void print_orphaned_nodes () { if (!DEBUG_ENABLED(SUBSET_REPACK)) return; @@ -949,6 +1067,10 @@ struct graph_t parents_invalid = true; update_parents(); + if (root().parents) { + DEBUG_MSG (SUBSET_REPACK, nullptr, "Root node has incoming edges."); + } + for (unsigned i = 0; i < root_idx (); i++) { const auto& v = vertices_[i]; @@ -1065,6 +1187,11 @@ struct graph_t } } + for (unsigned i = 0; i < vertices_.length; i++) + // parents arrays must be accurate or downstream operations like cycle detection + // and sorting won't work correctly. + check_success (!vertices_[i].parents.in_error ()); + parents_invalid = false; } @@ -1183,7 +1310,7 @@ struct graph_t { for (auto& link : vertices_[i].obj.all_links_writer ()) { - const unsigned *v; + const uint32_t *v; if (!id_map.has (link.objidx, &v)) continue; if (only_wide && !(link.width == 4 && !link.is_signed)) continue; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/gsubgpos-graph.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/gsubgpos-graph.hh index e8d5bef9a8b..c170638409f 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/gsubgpos-graph.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/gsubgpos-graph.hh @@ -201,7 +201,7 @@ struct Lookup : public OT::Lookup + new_subtable_count * OT::Offset16::static_size; char* buffer = (char*) hb_calloc (1, new_size); c.add_buffer (buffer); - memcpy (buffer, v.obj.head, v.table_size()); + hb_memcpy (buffer, v.obj.head, v.table_size()); v.obj.head = buffer; v.obj.tail = buffer + new_size; @@ -355,7 +355,7 @@ struct GSTAR : public OT::GSUBGPOS { switch (u.version.major) { case 1: return u.version1.get_lookup_list_offset (); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 2: return u.version2.get_lookup_list_offset (); #endif default: return 0; @@ -374,7 +374,7 @@ struct GSTAR : public OT::GSUBGPOS { switch (u.version.major) { case 1: find_lookups (graph, lookups); break; -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 2: find_lookups (graph, lookups); break; #endif } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/markbasepos-graph.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/markbasepos-graph.hh index e42a6042ccc..84ef5f71b93 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/markbasepos-graph.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/markbasepos-graph.hh @@ -112,7 +112,7 @@ struct AnchorMatrix : public OT::Layout::GPOS_impl::AnchorMatrix auto& child = c.graph.vertices_[child_idx]; child.remove_parent (this_index); - o.real_links.remove (i); + o.real_links.remove_unordered (i); num_links--; i--; } @@ -372,7 +372,7 @@ struct MarkBasePosFormat1 : public OT::Layout::GPOS_impl::MarkBasePosFormat1_2iter ()) + + hb_enumerate (mark_coverage.table->iter ()) | hb_filter (marks, hb_first) | hb_map_retains_sorting (hb_second) ; @@ -431,7 +431,7 @@ struct MarkBasePosFormat1 : public OT::Layout::GPOS_impl::MarkBasePosFormat1_2iter ()) + + hb_enumerate (mark_coverage.table->iter ()) | hb_filter (marks, hb_first) | hb_map_retains_sorting (hb_second) ; @@ -477,7 +477,7 @@ struct MarkBasePos : public OT::Layout::GPOS_impl::MarkBasePos switch (u.format) { case 1: return ((MarkBasePosFormat1*)(&u.format1))->split_subtables (c, parent_index, this_index); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 2: HB_FALLTHROUGH; // Don't split 24bit PairPos's. #endif @@ -494,7 +494,7 @@ struct MarkBasePos : public OT::Layout::GPOS_impl::MarkBasePos switch (u.format) { case 1: return ((MarkBasePosFormat1*)(&u.format1))->sanitize (vertex); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 2: HB_FALLTHROUGH; #endif default: diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/pairpos-graph.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/pairpos-graph.hh index 8040778ea30..1c13eb24f94 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/pairpos-graph.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/pairpos-graph.hh @@ -434,7 +434,7 @@ struct PairPosFormat2 : public OT::Layout::GPOS_impl::PairPosFormat2_4values[0], + hb_memcpy (&pair_pos_prime->values[0], start_addr, num_records * split_context.class1_record_size); @@ -611,7 +611,7 @@ struct PairPos : public OT::Layout::GPOS_impl::PairPos return ((PairPosFormat1*)(&u.format1))->split_subtables (c, parent_index, this_index); case 2: return ((PairPosFormat2*)(&u.format2))->split_subtables (c, parent_index, this_index); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 3: HB_FALLTHROUGH; case 4: HB_FALLTHROUGH; // Don't split 24bit PairPos's. @@ -631,7 +631,7 @@ struct PairPos : public OT::Layout::GPOS_impl::PairPos return ((PairPosFormat1*)(&u.format1))->sanitize (vertex); case 2: return ((PairPosFormat2*)(&u.format2))->sanitize (vertex); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K case 3: HB_FALLTHROUGH; case 4: HB_FALLTHROUGH; #endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/serialize.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/serialize.hh index ecc6cc5aea2..d03a61bd19e 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/serialize.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/serialize.hh @@ -33,6 +33,23 @@ struct overflow_record_t { unsigned parent; unsigned child; + + bool operator != (const overflow_record_t o) const + { return !(*this == o); } + + inline bool operator == (const overflow_record_t& o) const + { + return parent == o.parent && + child == o.child; + } + + inline uint32_t hash () const + { + uint32_t current = 0; + current = current * 31 + hb_hash (parent); + current = current * 31 + hb_hash (child); + return current; + } }; inline @@ -94,6 +111,7 @@ will_overflow (graph_t& graph, if (overflows) overflows->resize (0); graph.update_positions (); + hb_hashmap_t record_set; const auto& vertices = graph.vertices_; for (int parent_idx = vertices.length - 1; parent_idx >= 0; parent_idx--) { @@ -109,7 +127,10 @@ will_overflow (graph_t& graph, overflow_record_t r; r.parent = parent_idx; r.child = link.objidx; + if (record_set.has(&r)) continue; // don't keep duplicate overflows. + overflows->push (r); + record_set.set(&r, true); } } @@ -223,7 +244,7 @@ inline hb_blob_t* serialize (const graph_t& graph) return nullptr; } - memcpy (start, vertices[i].obj.head, size); + hb_memcpy (start, vertices[i].obj.head, size); // Only real links needs to be serialized. for (const auto& link : vertices[i].obj.real_links) diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/harfbuzz-config.cmake.in b/Build/source/libs/harfbuzz/harfbuzz-src/src/harfbuzz-config.cmake.in index 304410d9bae..0de082c2a63 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/harfbuzz-config.cmake.in +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/harfbuzz-config.cmake.in @@ -1,29 +1,5 @@ -# Set these variables so that the `${prefix}/lib` expands to something we can -# remove. -set(_harfbuzz_remove_string "REMOVE_ME") -set(exec_prefix "${_harfbuzz_remove_string}") -set(prefix "${_harfbuzz_remove_string}") - -# Compute the installation prefix by stripping components from our current -# location. -get_filename_component(_harfbuzz_prefix "${CMAKE_CURRENT_LIST_DIR}" DIRECTORY) -get_filename_component(_harfbuzz_prefix "${_harfbuzz_prefix}" DIRECTORY) set(_harfbuzz_libdir "@libdir@") -string(REPLACE "${_harfbuzz_remove_string}/" "" _harfbuzz_libdir "${_harfbuzz_libdir}") -set(_harfbuzz_libdir_iter "${_harfbuzz_libdir}") -while (_harfbuzz_libdir_iter) - set(_harfbuzz_libdir_prev_iter "${_harfbuzz_libdir_iter}") - get_filename_component(_harfbuzz_libdir_iter "${_harfbuzz_libdir_iter}" DIRECTORY) - if (_harfbuzz_libdir_prev_iter STREQUAL _harfbuzz_libdir_iter) - break() - endif () - get_filename_component(_harfbuzz_prefix "${_harfbuzz_prefix}" DIRECTORY) -endwhile () -unset(_harfbuzz_libdir_iter) - -# Get the include subdir. set(_harfbuzz_includedir "@includedir@") -string(REPLACE "${_harfbuzz_remove_string}/" "" _harfbuzz_includedir "${_harfbuzz_includedir}") # Extract version information from libtool. set(_harfbuzz_version_info "@HB_LIBTOOL_VERSION_INFO@") @@ -48,29 +24,29 @@ endif () # Add the libraries. add_library(harfbuzz::harfbuzz SHARED IMPORTED) set_target_properties(harfbuzz::harfbuzz PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${_harfbuzz_prefix}/${_harfbuzz_includedir}/harfbuzz" - IMPORTED_LOCATION "${_harfbuzz_prefix}/${_harfbuzz_libdir}/libharfbuzz${_harfbuzz_lib_suffix}") + INTERFACE_INCLUDE_DIRECTORIES "${_harfbuzz_includedir}/harfbuzz" + IMPORTED_LOCATION "${_harfbuzz_libdir}/libharfbuzz${_harfbuzz_lib_suffix}") add_library(harfbuzz::icu SHARED IMPORTED) set_target_properties(harfbuzz::icu PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${_harfbuzz_prefix}/${_harfbuzz_includedir}/harfbuzz" + INTERFACE_INCLUDE_DIRECTORIES "${_harfbuzz_includedir}/harfbuzz" INTERFACE_LINK_LIBRARIES "harfbuzz::harfbuzz" - IMPORTED_LOCATION "${_harfbuzz_prefix}/${_harfbuzz_libdir}/libharfbuzz-icu${_harfbuzz_lib_suffix}") + IMPORTED_LOCATION "${_harfbuzz_libdir}/libharfbuzz-icu${_harfbuzz_lib_suffix}") add_library(harfbuzz::subset SHARED IMPORTED) set_target_properties(harfbuzz::subset PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${_harfbuzz_prefix}/${_harfbuzz_includedir}/harfbuzz" + INTERFACE_INCLUDE_DIRECTORIES "${_harfbuzz_includedir}/harfbuzz" INTERFACE_LINK_LIBRARIES "harfbuzz::harfbuzz" - IMPORTED_LOCATION "${_harfbuzz_prefix}/${_harfbuzz_libdir}/libharfbuzz-subset${_harfbuzz_lib_suffix}") + IMPORTED_LOCATION "${_harfbuzz_libdir}/libharfbuzz-subset${_harfbuzz_lib_suffix}") # Only add the gobject library if it was built. set(_harfbuzz_have_gobject "@have_gobject@") if (_harfbuzz_have_gobject) add_library(harfbuzz::gobject SHARED IMPORTED) set_target_properties(harfbuzz::gobject PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${_harfbuzz_prefix}/${_harfbuzz_includedir}/harfbuzz" + INTERFACE_INCLUDE_DIRECTORIES "${_harfbuzz_includedir}/harfbuzz" INTERFACE_LINK_LIBRARIES "harfbuzz::harfbuzz" - IMPORTED_LOCATION "${_harfbuzz_prefix}/${_harfbuzz_libdir}/libharfbuzz-gobject${_harfbuzz_lib_suffix}") + IMPORTED_LOCATION "${_harfbuzz_libdir}/libharfbuzz-gobject${_harfbuzz_lib_suffix}") endif () # Clean out variables we used in our scope. @@ -80,7 +56,3 @@ unset(_harfbuzz_revision) unset(_harfbuzz_age) unset(_harfbuzz_includedir) unset(_harfbuzz_libdir) -unset(_harfbuzz_prefix) -unset(exec_prefix) -unset(prefix) -unset(_harfbuzz_remove_string) diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-morx-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-morx-table.hh index aa4ad4cf3c1..8b9190d0be3 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-morx-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-morx-table.hh @@ -131,14 +131,14 @@ struct RearrangementSubtable hb_glyph_info_t *info = buffer->info; hb_glyph_info_t buf[4]; - memcpy (buf, info + start, l * sizeof (buf[0])); - memcpy (buf + 2, info + end - r, r * sizeof (buf[0])); + hb_memcpy (buf, info + start, l * sizeof (buf[0])); + hb_memcpy (buf + 2, info + end - r, r * sizeof (buf[0])); if (l != r) memmove (info + start + r, info + start + l, (end - start - l - r) * sizeof (buf[0])); - memcpy (info + start, buf + 2, r * sizeof (buf[0])); - memcpy (info + end - l, buf, l * sizeof (buf[0])); + hb_memcpy (info + start, buf + 2, r * sizeof (buf[0])); + hb_memcpy (info + end - l, buf, l * sizeof (buf[0])); if (reverse_l) { buf[0] = info[end - 1]; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout.cc index d60126fe19a..78427b0d5a7 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout.cc @@ -289,7 +289,7 @@ is_deleted_glyph (const hb_glyph_info_t *info) void hb_aat_layout_remove_deleted_glyphs (hb_buffer_t *buffer) { - hb_ot_layout_delete_glyphs_inplace (buffer, is_deleted_glyph); + buffer->delete_glyphs_inplace (is_deleted_glyph); } /** diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-map.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-map.hh index c914f58d707..d0ee7d672c9 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-map.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-map.hh @@ -38,7 +38,7 @@ struct hb_aat_map_t void init () { - memset (this, 0, sizeof (*this)); + hb_memset (this, 0, sizeof (*this)); chain_flags.init (); } void fini () { chain_flags.fini (); } 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 cc37c073da1..d85a4afe102 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-algs.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-algs.hh @@ -236,17 +236,6 @@ struct template constexpr auto impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, hb_deref (v).hash ()) - template constexpr uint32_t - impl (const hb::shared_ptr& v, hb_priority<1>) const - { - return v.get () ? v.get ()->hash () : 0; - } - template constexpr uint32_t - impl (const hb::unique_ptr& v, hb_priority<1>) const - { - return v.get () ? v.get ()->hash () : 0; - } - template constexpr auto impl (const T& v, hb_priority<0>) const HB_RETURN (uint32_t, std::hash>{} (hb_deref (v))) @@ -495,6 +484,17 @@ struct } HB_FUNCOBJ (hb_equal); +struct +{ + template void + operator () (T& a, T& b) const + { + using std::swap; // allow ADL + swap (a, b); + } +} +HB_FUNCOBJ (hb_swap); + template struct hb_pair_t @@ -507,7 +507,7 @@ struct hb_pair_t hb_enable_if (std::is_default_constructible::value && std::is_default_constructible::value)> hb_pair_t () : first (), second () {} - hb_pair_t (T1 a, T2 b) : first (a), second (b) {} + hb_pair_t (T1 a, T2 b) : first (std::forward (a)), second (std::forward (b)) {} template (const pair_t& o) const { return first > o.first || (first == o.first && second > o.second); } bool operator <= (const pair_t& o) const { return !(*this > o); } + static int cmp (const void *pa, const void *pb) + { + pair_t *a = (pair_t *) pa; + pair_t *b = (pair_t *) pb; + + if (a->first < b->first) return -1; + if (a->first > b->first) return +1; + if (a->second < b->second) return -1; + if (a->second > b->second) return +1; + return 0; + } + + friend void swap (hb_pair_t& a, hb_pair_t& b) + { + hb_swap (a.first, b.first); + hb_swap (a.second, b.second); + } + + T1 first; T2 second; }; @@ -570,17 +589,6 @@ struct } HB_FUNCOBJ (hb_clamp); -struct -{ - template void - operator () (T& a, T& b) const - { - using std::swap; // allow ADL - swap (a, b); - } -} -HB_FUNCOBJ (hb_swap); - /* * Bithacks. */ @@ -849,19 +857,14 @@ hb_in_range (T u, T lo, T hi) return (T)(u - lo) <= (T)(hi - lo); } template static inline bool -hb_in_ranges (T u, T lo1, T hi1, T lo2, T hi2) +hb_in_ranges (T u, T lo1, T hi1) { - return hb_in_range (u, lo1, hi1) || hb_in_range (u, lo2, hi2); + return hb_in_range (u, lo1, hi1); } -template static inline bool -hb_in_ranges (T u, T lo1, T hi1, T lo2, T hi2, T lo3, T hi3) +template static inline bool +hb_in_ranges (T u, T lo1, T hi1, Ts... ds) { - return hb_in_range (u, lo1, hi1) || hb_in_range (u, lo2, hi2) || hb_in_range (u, lo3, hi3); -} -template static inline bool -hb_in_ranges (T u, T lo1, T hi1, T lo2, T hi2, T lo3, T hi3, T lo4, T hi4) -{ - return hb_in_range (u, lo1, hi1) || hb_in_range (u, lo2, hi2) || hb_in_range (u, lo3, hi3) || hb_in_range (u, lo4, hi4); + return hb_in_range (u, lo1, hi1) || hb_in_ranges (u, ds...); } @@ -869,10 +872,18 @@ hb_in_ranges (T u, T lo1, T hi1, T lo2, T hi2, T lo3, T hi3, T lo4, T hi4) * Overflow checking. */ -/* Consider __builtin_mul_overflow use here also */ static inline bool -hb_unsigned_mul_overflows (unsigned int count, unsigned int size) +hb_unsigned_mul_overflows (unsigned int count, unsigned int size, unsigned *result = nullptr) { +#if (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) + unsigned stack_result; + if (!result) + result = &stack_result; + return __builtin_mul_overflow (count, size, result); +#endif + + if (result) + *result = count * size; return (size > 0) && (count >= ((unsigned int) -1) / size); } @@ -1164,9 +1175,12 @@ hb_qsort (void *base, size_t nel, size_t width, } -template static inline void -hb_stable_sort (T *array, unsigned int len, int(*compar)(const T2 *, const T2 *), T3 *array2) +template static inline void +hb_stable_sort (T *array, unsigned int len, int(*compar)(const T2 *, const T2 *), T3 *array2 = nullptr) { + static_assert (hb_is_trivially_copy_assignable (T), ""); + static_assert (hb_is_trivially_copy_assignable (T3), ""); + for (unsigned int i = 1; i < len; i++) { unsigned int j = i; @@ -1189,12 +1203,6 @@ hb_stable_sort (T *array, unsigned int len, int(*compar)(const T2 *, const T2 *) } } -template static inline void -hb_stable_sort (T *array, unsigned int len, int(*compar)(const T *, const T *)) -{ - hb_stable_sort (array, len, compar, (int *) nullptr); -} - static inline hb_bool_t hb_codepoint_parse (const char *s, unsigned int len, int base, hb_codepoint_t *out) { @@ -1322,47 +1330,4 @@ struct HB_FUNCOBJ (hb_dec); -/* Compiler-assisted vectorization. */ - -/* Type behaving similar to vectorized vars defined using __attribute__((vector_size(...))), - * basically a fixed-size bitset. */ -template -struct hb_vector_size_t -{ - elt_t& operator [] (unsigned int i) { return v[i]; } - const elt_t& operator [] (unsigned int i) const { return v[i]; } - - void clear (unsigned char v = 0) { memset (this, v, sizeof (*this)); } - - template - hb_vector_size_t process (const Op& op) const - { - hb_vector_size_t r; - for (unsigned int i = 0; i < ARRAY_LENGTH (v); i++) - r.v[i] = op (v[i]); - return r; - } - template - hb_vector_size_t process (const Op& op, const hb_vector_size_t &o) const - { - hb_vector_size_t r; - for (unsigned int i = 0; i < ARRAY_LENGTH (v); i++) - r.v[i] = op (v[i], o.v[i]); - return r; - } - hb_vector_size_t operator | (const hb_vector_size_t &o) const - { return process (hb_bitwise_or, o); } - hb_vector_size_t operator & (const hb_vector_size_t &o) const - { return process (hb_bitwise_and, o); } - hb_vector_size_t operator ^ (const hb_vector_size_t &o) const - { return process (hb_bitwise_xor, o); } - hb_vector_size_t operator ~ () const - { return process (hb_bitwise_neg); } - - private: - static_assert (0 == byte_size % sizeof (elt_t), ""); - elt_t v[byte_size / sizeof (elt_t)]; -}; - - #endif /* HB_ALGS_HH */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-array.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-array.hh index 5884007c198..17562bc3366 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-array.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-array.hh @@ -100,10 +100,18 @@ struct hb_array_t : hb_iter_with_fallback_t, Type&> /* Ouch. The operator== compares the contents of the array. For range-based for loops, * it's best if we can just compare arrayZ, though comparing contents is still fast, * but also would require that Type has operator==. As such, we optimize this operator - * for range-based for loop and just compare arrayZ and length. */ + * for range-based for loop and just compare arrayZ and length. + * + * The above comment is outdated now because we implemented separate begin/end to + * objects that were using hb_array_t for range-based loop before. */ bool operator != (const hb_array_t& o) const { return this->arrayZ != o.arrayZ || this->length != o.length; } + /* Faster range-based for loop without bounds-check. */ + Type *begin () const { return arrayZ; } + Type *end () const { return arrayZ + length; } + + /* Extra operators. */ Type * operator & () const { return arrayZ; } @@ -112,11 +120,11 @@ struct hb_array_t : hb_iter_with_fallback_t, Type&> HB_INTERNAL bool operator == (const hb_array_t &o) const; - uint32_t hash () const { + uint32_t hash () const + { uint32_t current = 0; - for (unsigned int i = 0; i < this->length; i++) { - current = current * 31 + hb_hash (this->arrayZ[i]); - } + for (auto &v : *this) + current = current * 31 + hb_hash (v); return current; } @@ -184,23 +192,18 @@ struct hb_array_t : hb_iter_with_fallback_t, Type&> hb_sorted_array_t qsort (int (*cmp_)(const void*, const void*)) { + //static_assert (hb_enable_if (hb_is_trivially_copy_assignable(Type)), ""); if (likely (length)) hb_qsort (arrayZ, length, this->get_item_size (), cmp_); return hb_sorted_array_t (*this); } hb_sorted_array_t qsort () { + //static_assert (hb_enable_if (hb_is_trivially_copy_assignable(Type)), ""); if (likely (length)) hb_qsort (arrayZ, length, this->get_item_size (), Type::cmp); return hb_sorted_array_t (*this); } - void qsort (unsigned int start, unsigned int end) - { - end = hb_min (end, length); - assert (start <= end); - if (likely (start < end)) - hb_qsort (arrayZ + start, end - start, this->get_item_size (), Type::cmp); - } /* * Other methods. @@ -262,17 +265,31 @@ struct hb_array_t : hb_iter_with_fallback_t, Type&> void fini () { hb_free ((void *) arrayZ); arrayZ = nullptr; length = 0; } - template + template )))> hb_array_t copy (hb_serialize_context_t *c) const { TRACE_SERIALIZE (this); auto* out = c->start_embed (arrayZ); - if (unlikely (!c->extend_size (out, get_size ()))) return_trace (hb_array_t ()); + if (unlikely (!c->extend_size (out, get_size (), false))) return_trace (hb_array_t ()); for (unsigned i = 0; i < length; i++) out[i] = arrayZ[i]; /* TODO: add version that calls c->copy() */ return_trace (hb_array_t (out, length)); } + template ))> + hb_array_t copy (hb_serialize_context_t *c) const + { + TRACE_SERIALIZE (this); + auto* out = c->start_embed (arrayZ); + if (unlikely (!c->extend_size (out, get_size (), false))) return_trace (hb_array_t ()); + hb_memcpy (out, arrayZ, get_size ()); + return_trace (hb_array_t (out, length)); + } + template bool sanitize (hb_sanitize_context_t *c) const { return c->check_array (arrayZ, length); } @@ -295,8 +312,8 @@ hb_array (T (&array_)[length_]) template struct hb_sorted_array_t : - hb_iter_t, Type&>, - hb_array_t + hb_array_t, + hb_iter_t, Type&> { typedef hb_iter_t iter_base_t; HB_ITER_USING (iter_base_t); @@ -316,8 +333,8 @@ struct hb_sorted_array_t : template constexpr hb_sorted_array_t (const hb_array_t &o) : - hb_iter_t (), - hb_array_t (o) {} + hb_array_t (o), + hb_iter_t () {} template hb_sorted_array_t& operator = (const hb_array_t &o) @@ -329,6 +346,11 @@ struct hb_sorted_array_t : bool operator != (const hb_sorted_array_t& o) const { return this->arrayZ != o.arrayZ || this->length != o.length; } + /* Faster range-based for loop without bounds-check. */ + Type *begin () const { return this->arrayZ; } + Type *end () const { return this->arrayZ + this->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 @@ -421,18 +443,42 @@ inline bool hb_array_t::operator == (const hb_array_t -inline uint32_t hb_array_t::hash () const { +inline uint32_t hb_array_t::hash () const +{ uint32_t current = 0; - for (unsigned int i = 0; i < this->length; i++) - current = current * 31 + (uint32_t) (this->arrayZ[i] * 2654435761u); + unsigned i = 0; + +#if defined(__OPTIMIZE__) && !defined(HB_NO_PACKED) && \ + ((defined(__GNUC__) && __GNUC__ >= 5) || defined(__clang__)) + struct __attribute__((packed)) packed_uint32_t { uint32_t v; }; + for (; i + 4 <= this->length; i += 4) + current = current * 31 + hb_hash ((uint32_t) ((packed_uint32_t *) &this->arrayZ[i])->v); +#endif + + for (; i < this->length; i++) + current = current * 31 + hb_hash (this->arrayZ[i]); return current; } + template <> -inline uint32_t hb_array_t::hash () const { +inline uint32_t hb_array_t::hash () const +{ uint32_t current = 0; - for (unsigned int i = 0; i < this->length; i++) - current = current * 31 + (uint32_t) (this->arrayZ[i] * 2654435761u); + unsigned i = 0; + +#if defined(__OPTIMIZE__) && !defined(HB_NO_PACKED) && \ + ((defined(__GNUC__) && __GNUC__ >= 5) || defined(__clang__)) + struct __attribute__((packed)) packed_uint32_t { uint32_t v; }; + for (; i + 4 <= this->length; i += 4) + current = current * 31 + hb_hash ((uint32_t) ((packed_uint32_t *) &this->arrayZ[i])->v); +#endif + + for (; i < this->length; i++) + current = current * 31 + hb_hash (this->arrayZ[i]); return current; } 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 95ae1b7bf98..11987054f85 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 @@ -30,6 +30,53 @@ #include "hb.hh" + +/* Compiler-assisted vectorization. */ + +/* Type behaving similar to vectorized vars defined using __attribute__((vector_size(...))), + * basically a fixed-size bitset. */ +template +struct hb_vector_size_t +{ + elt_t& operator [] (unsigned int i) { return v[i]; } + const elt_t& operator [] (unsigned int i) const { return v[i]; } + + void clear (unsigned char v = 0) { hb_memset (this, v, sizeof (*this)); } + + template + hb_vector_size_t process (const Op& op) const + { + hb_vector_size_t r; + for (unsigned int i = 0; i < ARRAY_LENGTH (v); i++) + r.v[i] = op (v[i]); + return r; + } + template + hb_vector_size_t process (const Op& op, const hb_vector_size_t &o) const + { + hb_vector_size_t r; + for (unsigned int i = 0; i < ARRAY_LENGTH (v); i++) + r.v[i] = op (v[i], o.v[i]); + return r; + } + hb_vector_size_t operator | (const hb_vector_size_t &o) const + { return process (hb_bitwise_or, o); } + hb_vector_size_t operator & (const hb_vector_size_t &o) const + { return process (hb_bitwise_and, o); } + hb_vector_size_t operator ^ (const hb_vector_size_t &o) const + { return process (hb_bitwise_xor, o); } + hb_vector_size_t operator ~ () const + { return process (hb_bitwise_neg); } + + hb_array_t iter () const + { return hb_array (v); } + + private: + static_assert (0 == byte_size % sizeof (elt_t), ""); + elt_t v[byte_size / sizeof (elt_t)]; +}; + + struct hb_bit_page_t { void init0 () { v.clear (); } @@ -40,17 +87,17 @@ struct hb_bit_page_t bool is_empty () const { - for (unsigned i = 0; i < len (); i++) - if (v[i]) - return false; - return true; + return + + hb_iter (v) + | hb_none + ; } uint32_t hash () const { - uint32_t h = 0; - for (unsigned i = 0; i < len (); i++) - h = h * 31 + hb_hash (v[i]); - return h; + return + + hb_iter (v) + | hb_reduce ([] (uint32_t h, const elt_t &_) { return h * 31 + hb_hash (_); }, (uint32_t) 0u) + ; } void add (hb_codepoint_t g) { elt (g) |= mask (g); } @@ -69,7 +116,7 @@ struct hb_bit_page_t *la |= ~(mask (a) - 1); la++; - memset (la, 0xff, (char *) lb - (char *) la); + hb_memset (la, 0xff, (char *) lb - (char *) la); *lb |= ((mask (b) << 1) - 1); } @@ -85,7 +132,7 @@ struct hb_bit_page_t *la &= mask (a) - 1; la++; - memset (la, 0, (char *) lb - (char *) la); + hb_memset (la, 0, (char *) lb - (char *) la); *lb &= ~((mask (b) << 1) - 1); } @@ -101,13 +148,13 @@ struct hb_bit_page_t hb_codepoint_t *p, unsigned int size) const { - unsigned int start_v = start_value >> ELT_BITS_LOG_2; + unsigned int start_v = start_value / ELT_BITS; unsigned int start_bit = start_value & ELT_MASK; unsigned int count = 0; for (unsigned i = start_v; i < len () && count < size; i++) { elt_t bits = v[i]; - uint32_t v_base = base | (i << ELT_BITS_LOG_2); + uint32_t v_base = base | (i * ELT_BITS); for (unsigned int j = start_bit; j < ELT_BITS && count < size; j++) { if ((elt_t(1) << j) & bits) { @@ -132,13 +179,13 @@ struct hb_bit_page_t unsigned int size, hb_codepoint_t *next_value) const { - unsigned int start_v = start_value >> ELT_BITS_LOG_2; + unsigned int start_v = start_value / ELT_BITS; unsigned int start_bit = start_value & ELT_MASK; unsigned int count = 0; for (unsigned i = start_v; i < len () && count < size; i++) { elt_t bits = v[i]; - uint32_t v_offset = i << ELT_BITS_LOG_2; + uint32_t v_offset = i * ELT_BITS; for (unsigned int j = start_bit; j < ELT_BITS && count < size; j++) { if ((elt_t(1) << j) & bits) @@ -161,7 +208,10 @@ struct hb_bit_page_t bool is_equal (const hb_bit_page_t &other) const { - return 0 == hb_memcmp (&v, &other.v, sizeof (v)); + for (unsigned i = 0; i < len (); i++) + if (v[i] != other.v[i]) + return false; + return true; } bool is_subset (const hb_bit_page_t &larger_page) const { @@ -173,10 +223,10 @@ struct hb_bit_page_t unsigned int get_population () const { - unsigned int pop = 0; - for (unsigned int i = 0; i < len (); i++) - pop += hb_popcount (v[i]); - return pop; + return + + hb_iter (v) + | hb_reduce ([] (unsigned pop, const elt_t &_) { return pop + hb_popcount (_); }, 0u) + ; } bool next (hb_codepoint_t *codepoint) const @@ -262,8 +312,6 @@ struct hb_bit_page_t typedef hb_vector_size_t vector_t; static constexpr unsigned ELT_BITS = sizeof (elt_t) * 8; - static constexpr unsigned ELT_BITS_LOG_2 = 6; - static_assert (1 << ELT_BITS_LOG_2 == ELT_BITS, ""); static constexpr unsigned ELT_MASK = ELT_BITS - 1; static constexpr unsigned BITS = sizeof (vector_t) * 8; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bit-set-invertible.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bit-set-invertible.hh index 27fb0732eab..ff8aecc60cc 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bit-set-invertible.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bit-set-invertible.hh @@ -123,10 +123,8 @@ struct hb_bit_set_invertible_t bool get (hb_codepoint_t g) const { return s.get (g) ^ inverted; } /* Has interface. */ - static constexpr bool SENTINEL = false; - typedef bool value_t; - value_t operator [] (hb_codepoint_t k) const { return get (k); } - bool has (hb_codepoint_t k) const { return (*this)[k] != SENTINEL; } + bool operator [] (hb_codepoint_t k) const { return get (k); } + bool has (hb_codepoint_t k) const { return (*this)[k]; } /* Predicate. */ bool operator () (hb_codepoint_t k) const { return has (k); } 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 a63887efda7..8de6e037fbd 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 @@ -85,10 +85,10 @@ struct hb_bit_set_t void err () { if (successful) successful = false; } /* TODO Remove */ bool in_error () const { return !successful; } - bool resize (unsigned int count) + bool resize (unsigned int count, bool clear = true) { if (unlikely (!successful)) return false; - if (unlikely (!pages.resize (count) || !page_map.resize (count))) + if (unlikely (!pages.resize (count, clear) || !page_map.resize (count, clear))) { pages.resize (page_map.length); successful = false; @@ -330,10 +330,8 @@ struct hb_bit_set_t } /* Has interface. */ - static constexpr bool SENTINEL = false; - typedef bool value_t; - value_t operator [] (hb_codepoint_t k) const { return get (k); } - bool has (hb_codepoint_t k) const { return (*this)[k] != SENTINEL; } + bool operator [] (hb_codepoint_t k) const { return get (k); } + bool has (hb_codepoint_t k) const { return (*this)[k]; } /* Predicate. */ bool operator () (hb_codepoint_t k) const { return has (k); } @@ -352,7 +350,7 @@ struct hb_bit_set_t { if (unlikely (!successful)) return; unsigned int count = other.pages.length; - if (unlikely (!resize (count))) + if (unlikely (!resize (count, false))) return; population = other.population; @@ -391,7 +389,7 @@ struct hb_bit_set_t bool is_subset (const hb_bit_set_t &larger_set) const { if (has_population () && larger_set.has_population () && - population != larger_set.population) + population > larger_set.population) return false; uint32_t spi = 0; @@ -540,21 +538,21 @@ struct hb_bit_set_t b = nb; for (; a && b; ) { - if (page_map[a - 1].major == other.page_map[b - 1].major) + if (page_map.arrayZ[a - 1].major == other.page_map.arrayZ[b - 1].major) { a--; b--; count--; - page_map[count] = page_map[a]; + page_map.arrayZ[count] = page_map.arrayZ[a]; page_at (count).v = op (page_at (a).v, other.page_at (b).v); } - else if (page_map[a - 1].major > other.page_map[b - 1].major) + else if (page_map.arrayZ[a - 1].major > other.page_map.arrayZ[b - 1].major) { a--; if (passthru_left) { count--; - page_map[count] = page_map[a]; + page_map.arrayZ[count] = page_map.arrayZ[a]; } } else @@ -563,8 +561,8 @@ struct hb_bit_set_t if (passthru_right) { count--; - page_map[count].major = other.page_map[b].major; - page_map[count].index = next_page++; + 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; } } @@ -574,15 +572,15 @@ struct hb_bit_set_t { a--; count--; - page_map[count] = page_map [a]; + page_map.arrayZ[count] = page_map.arrayZ[a]; } if (passthru_right) while (b) { b--; count--; - page_map[count].major = other.page_map[b].major; - page_map[count].index = next_page++; + 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; } assert (!count); @@ -605,8 +603,6 @@ struct hb_bit_set_t bool next (hb_codepoint_t *codepoint) const { - // TODO: this should be merged with prev() as both implementations - // are very similar. if (unlikely (*codepoint == INVALID)) { *codepoint = get_min (); return *codepoint != INVALID; @@ -640,7 +636,7 @@ struct hb_bit_set_t for (; i < page_map.length; i++) { - const page_map_t ¤t = page_map.arrayZ[i]; + const page_map_t ¤t = page_map_array[i]; hb_codepoint_t m = pages_array[current.index].get_min (); if (m != INVALID) { @@ -663,21 +659,21 @@ struct hb_bit_set_t page_map_t map = {get_major (*codepoint), 0}; unsigned int i; page_map.bfind (map, &i, HB_NOT_FOUND_STORE_CLOSEST); - if (i < page_map.length && page_map[i].major == map.major) + if (i < page_map.length && page_map.arrayZ[i].major == map.major) { - if (pages[page_map[i].index].previous (codepoint)) + if (pages[page_map.arrayZ[i].index].previous (codepoint)) { - *codepoint += page_map[i].major * page_t::PAGE_BITS; + *codepoint += page_map.arrayZ[i].major * page_t::PAGE_BITS; return true; } } i--; for (; (int) i >= 0; i--) { - hb_codepoint_t m = pages[page_map[i].index].get_max (); + hb_codepoint_t m = pages.arrayZ[page_map.arrayZ[i].index].get_max (); if (m != INVALID) { - *codepoint = page_map[i].major * page_t::PAGE_BITS + m; + *codepoint = page_map.arrayZ[i].major * page_t::PAGE_BITS + m; return true; } } @@ -905,7 +901,7 @@ struct hb_bit_set_t { auto &cached_page = page_map.arrayZ[i]; if (cached_page.major == major) - return &pages[cached_page.index]; + return &pages.arrayZ[cached_page.index]; } page_map_t map = {major, pages.length}; @@ -917,15 +913,15 @@ struct hb_bit_set_t if (unlikely (!resize (pages.length + 1))) return nullptr; - pages[map.index].init0 (); - memmove (page_map + i + 1, - page_map + i, + pages.arrayZ[map.index].init0 (); + memmove (page_map.arrayZ + i + 1, + page_map.arrayZ + i, (page_map.length - 1 - i) * page_map.item_size); page_map[i] = map; } last_page_lookup = i; - return &pages[page_map[i].index]; + return &pages.arrayZ[page_map.arrayZ[i].index]; } const page_t *page_for (hb_codepoint_t g) const { @@ -939,7 +935,7 @@ struct hb_bit_set_t { auto &cached_page = page_map.arrayZ[i]; if (cached_page.major == major) - return &pages[cached_page.index]; + return &pages.arrayZ[cached_page.index]; } page_map_t key = {major}; @@ -947,10 +943,18 @@ struct hb_bit_set_t return nullptr; last_page_lookup = i; - return &pages[page_map[i].index]; + return &pages.arrayZ[page_map[i].index]; + } + page_t &page_at (unsigned int i) + { + assert (i < page_map.length); + return pages.arrayZ[page_map.arrayZ[i].index]; + } + const page_t &page_at (unsigned int i) const + { + assert (i < page_map.length); + return pages.arrayZ[page_map.arrayZ[i].index]; } - page_t &page_at (unsigned int i) { return pages[page_map[i].index]; } - const page_t &page_at (unsigned int i) const { return pages[page_map[i].index]; } unsigned int get_major (hb_codepoint_t g) const { return g >> page_t::PAGE_BITS_LOG_2; } unsigned int page_remainder (hb_codepoint_t g) const { return g & page_t::PAGE_BITMASK; } hb_codepoint_t major_start (unsigned int major) const { return major << page_t::PAGE_BITS_LOG_2; } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc index 9bc12ea3fa0..f0fda1fa4d1 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc @@ -495,7 +495,7 @@ hb_blob_t::try_make_writable () DEBUG_MSG_FUNC (BLOB, this, "dupped successfully -> %p\n", this->data); - memcpy (new_data, this->data, this->length); + hb_memcpy (new_data, this->data, this->length); this->destroy_user_data (); this->mode = HB_MEMORY_MODE_WRITABLE; this->data = new_data; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-json.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-json.hh index 87095855d63..993bb1f6981 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-json.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-json.hh @@ -32,7 +32,7 @@ #include "hb.hh" -#line 36 "hb-buffer-deserialize-json.hh" +#line 33 "hb-buffer-deserialize-json.hh" static const unsigned char _deserialize_json_trans_keys[] = { 0u, 0u, 9u, 123u, 9u, 34u, 97u, 117u, 120u, 121u, 34u, 34u, 9u, 58u, 9u, 57u, 48u, 57u, 9u, 125u, 9u, 125u, 9u, 125u, 34u, 34u, 9u, 58u, 9u, 57u, 48u, 57u, @@ -557,12 +557,12 @@ _hb_buffer_deserialize_json (hb_buffer_t *buffer, hb_glyph_info_t info = {0}; hb_glyph_position_t pos = {0}; -#line 561 "hb-buffer-deserialize-json.hh" +#line 554 "hb-buffer-deserialize-json.hh" { cs = deserialize_json_start; } -#line 566 "hb-buffer-deserialize-json.hh" +#line 557 "hb-buffer-deserialize-json.hh" { int _slen; int _trans; @@ -590,8 +590,8 @@ _resume: case 1: #line 38 "hb-buffer-deserialize-json.rl" { - memset (&info, 0, sizeof (info)); - memset (&pos , 0, sizeof (pos )); + hb_memset (&info, 0, sizeof (info)); + hb_memset (&pos , 0, sizeof (pos )); } break; case 5: @@ -774,7 +774,7 @@ _resume: *end_ptr = p; } break; -#line 778 "hb-buffer-deserialize-json.hh" +#line 735 "hb-buffer-deserialize-json.hh" } _again: diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-json.rl b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-json.rl index d5e3c138db1..d6fbfe89cdb 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-json.rl +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-json.rl @@ -36,8 +36,8 @@ alphtype unsigned char; write data; action clear_item { - memset (&info, 0, sizeof (info)); - memset (&pos , 0, sizeof (pos )); + hb_memset (&info, 0, sizeof (info)); + hb_memset (&pos , 0, sizeof (pos )); } action add_item { diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-text.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-text.hh index 9062610de23..6b9b4282fcc 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-text.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-text.hh @@ -32,32 +32,30 @@ #include "hb.hh" -#line 36 "hb-buffer-deserialize-text.hh" +#line 33 "hb-buffer-deserialize-text.hh" static const unsigned char _deserialize_text_trans_keys[] = { - 0u, 0u, 9u, 91u, 85u, 85u, 43u, 43u, 48u, 102u, 9u, 85u, 48u, 57u, 45u, 57u, - 48u, 57u, 48u, 57u, 48u, 57u, 45u, 57u, 48u, 57u, 44u, 44u, 45u, 57u, 48u, 57u, - 44u, 57u, 43u, 124u, 45u, 57u, 48u, 57u, 9u, 124u, 9u, 124u, 0u, 0u, 9u, 85u, + 0u, 0u, 9u, 91u, 85u, 85u, 43u, 43u, 48u, 102u, 9u, 85u, 48u, 57u, 48u, 57u, + 45u, 57u, 48u, 57u, 45u, 57u, 48u, 57u, 48u, 57u, 45u, 57u, 48u, 57u, 44u, 44u, + 45u, 57u, 48u, 57u, 44u, 57u, 43u, 124u, 9u, 124u, 9u, 124u, 0u, 0u, 9u, 85u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, - 9u, 124u, 9u, 124u, 9u, 124u, 0 + 0 }; static const char _deserialize_text_key_spans[] = { - 0, 83, 1, 1, 55, 77, 10, 13, - 10, 10, 10, 13, 10, 1, 13, 10, - 14, 82, 13, 10, 116, 116, 0, 77, - 116, 116, 116, 116, 116, 116, 116, 116, + 0, 83, 1, 1, 55, 77, 10, 10, + 13, 10, 13, 10, 10, 13, 10, 1, + 13, 10, 14, 82, 116, 116, 0, 77, 116, 116, 116, 116, 116, 116, 116, 116, - 116, 116, 116 + 116, 116, 116, 116, 116, 116, 116, 116 }; static const short _deserialize_text_index_offsets[] = { 0, 0, 84, 86, 88, 144, 222, 233, - 247, 258, 269, 280, 294, 305, 307, 321, - 332, 347, 430, 444, 455, 572, 689, 690, + 244, 258, 269, 283, 294, 305, 319, 330, + 332, 346, 357, 372, 455, 572, 689, 690, 768, 885, 1002, 1119, 1236, 1353, 1470, 1587, - 1704, 1821, 1938, 2055, 2172, 2289, 2406, 2523, - 2640, 2757, 2874 + 1704, 1821, 1938, 2055, 2172, 2289, 2406, 2523 }; static const char _deserialize_text_indicies[] = { @@ -90,34 +88,34 @@ static const char _deserialize_text_indicies[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 8, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 1, 10, 1, 1, 11, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 1, + 9, 1, 10, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 1, 12, 1, 1, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 1, 15, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 1, 17, 18, - 18, 18, 18, 18, 18, 18, 18, 18, - 1, 19, 1, 1, 20, 21, 21, 21, + 16, 16, 16, 16, 16, 1, 17, 1, + 1, 18, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 1, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 1, 22, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 1, 24, 1, 25, 1, 1, 26, - 27, 27, 27, 27, 27, 27, 27, 27, - 27, 1, 28, 29, 29, 29, 29, 29, - 29, 29, 29, 29, 1, 24, 1, 1, - 1, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 1, 30, 30, 1, 1, + 23, 1, 24, 1, 1, 25, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 1, + 27, 28, 28, 28, 28, 28, 28, 28, + 28, 28, 1, 29, 1, 30, 1, 1, + 31, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 1, 33, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 1, 29, 1, + 1, 1, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 1, 35, 35, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 30, 1, - 1, 30, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 35, + 1, 1, 35, 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, 30, 30, 1, + 1, 1, 1, 1, 1, 1, 35, 35, 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, 30, 1, 31, - 1, 1, 32, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 1, 34, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 1, + 1, 1, 1, 1, 1, 1, 35, 1, 36, 36, 36, 36, 36, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 36, @@ -201,282 +199,235 @@ static const char _deserialize_text_indicies[] = { 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 56, 48, - 57, 57, 57, 57, 57, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 57, - 30, 30, 58, 30, 30, 30, 30, 30, - 30, 30, 59, 1, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 60, 30, 30, 61, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 62, 63, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 64, 30, 57, 57, 57, - 57, 57, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 57, 30, 30, 58, - 30, 30, 30, 30, 30, 30, 30, 59, - 1, 30, 30, 30, 65, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 30, 30, - 30, 60, 30, 30, 61, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 62, 63, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 64, 30, 67, 67, 67, 67, 67, 1, + 57, 57, 57, 57, 57, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 57, + 35, 35, 58, 35, 35, 35, 35, 35, + 35, 35, 59, 1, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 60, 35, 35, 61, + 35, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 35, 62, 63, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 35, 64, 35, 65, 65, 65, + 65, 65, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 65, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 67, 1, 1, 68, 1, 1, 1, - 1, 1, 1, 1, 1, 69, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 70, 1, + 1, 66, 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, 1, 1, 1, 1, 71, 1, 72, - 72, 72, 72, 72, 1, 1, 1, 1, + 67, 1, 68, 68, 68, 68, 68, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 72, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 68, 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, 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, 42, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 42, 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, 73, 1, 74, 74, 74, 74, - 74, 48, 48, 48, 48, 48, 48, 48, + 1, 1, 1, 1, 1, 69, 1, 70, + 70, 70, 70, 70, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 74, 48, 48, 50, 48, - 48, 48, 48, 48, 48, 48, 51, 1, + 48, 48, 48, 48, 48, 48, 70, 48, + 48, 50, 48, 48, 48, 48, 48, 48, + 48, 51, 1, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 52, 48, 48, 53, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 52, 48, 48, 53, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 54, - 55, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 54, 55, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 56, - 48, 75, 75, 75, 75, 75, 1, 1, + 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 56, 48, 71, 71, 71, 71, + 71, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 71, 1, 1, 72, 1, + 1, 1, 1, 1, 1, 1, 1, 73, 1, 1, 1, 1, 1, 1, 1, 1, - 75, 1, 1, 76, 1, 1, 1, 1, - 1, 1, 1, 77, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 78, 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, 45, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 74, 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, 79, 1, 80, 80, - 80, 80, 80, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 75, + 1, 76, 76, 76, 76, 76, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 80, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 76, 1, 1, 77, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 81, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 78, 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, 82, 1, 80, 80, 80, 80, 80, + 1, 1, 1, 1, 79, 1, 76, 76, + 76, 76, 76, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 76, 1, 1, + 77, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 80, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 83, 83, 83, 83, 83, 83, - 83, 83, 83, 83, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 78, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 81, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 79, 1, 71, 71, 71, 71, 71, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 82, 1, - 84, 84, 84, 84, 84, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 84, - 1, 1, 85, 1, 1, 1, 1, 1, - 1, 1, 86, 1, 1, 1, 1, 1, + 1, 1, 71, 1, 1, 72, 1, 1, + 1, 1, 1, 1, 1, 1, 73, 1, + 1, 1, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 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, 1, 1, 1, 1, 74, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 87, 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, 75, 1, + 80, 80, 80, 80, 80, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 88, 1, 84, 84, 84, - 84, 84, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 80, + 1, 1, 81, 1, 1, 1, 1, 1, + 1, 1, 82, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 84, 1, 1, 85, - 1, 1, 1, 1, 1, 1, 1, 86, - 1, 1, 1, 1, 29, 29, 29, 29, - 29, 29, 29, 29, 29, 29, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 83, 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, 45, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 87, 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, 84, 1, 85, 85, 85, + 85, 85, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 88, 1, 75, 75, 75, 75, 75, 1, + 1, 1, 1, 1, 85, 1, 1, 86, + 1, 1, 1, 1, 1, 1, 1, 87, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 75, 1, 1, 76, 1, 1, 1, - 1, 1, 1, 1, 77, 1, 1, 1, - 1, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 1, 1, 1, 1, 1, - 1, 78, 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, 45, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 88, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 79, 1, 90, - 90, 90, 90, 90, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 90, 1, - 1, 91, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 89, 1, 85, 85, 85, 85, 85, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 85, 1, 1, 86, 1, 1, 1, + 1, 1, 1, 1, 87, 1, 1, 1, + 1, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 92, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 88, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 93, 1, 90, 90, 90, 90, - 90, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 90, 1, 1, 91, 1, + 1, 1, 1, 1, 1, 89, 1, 80, + 80, 80, 80, 80, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 80, 1, + 1, 81, 1, 1, 1, 1, 1, 1, + 1, 82, 1, 1, 1, 1, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, + 1, 1, 1, 1, 1, 1, 83, 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, 45, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 92, 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, 93, - 1, 67, 67, 67, 67, 67, 1, 1, + 1, 1, 84, 1, 65, 65, 65, 65, + 65, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 65, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 67, 1, 1, 68, 1, 1, 1, 1, - 1, 1, 1, 1, 69, 1, 1, 1, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 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, 1, 70, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 66, 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, 71, 1, 94, 94, - 94, 94, 94, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 94, 30, 30, - 58, 30, 30, 30, 30, 30, 30, 30, - 59, 1, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 60, 30, 30, 61, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 62, 95, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 96, 30, 94, 94, 94, 94, 94, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 94, 30, 30, 58, 30, 30, - 30, 30, 30, 30, 30, 59, 1, 30, - 30, 30, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 30, 30, 30, 60, - 30, 30, 61, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 62, 95, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 96, 30, - 0 + 1, 1, 1, 1, 1, 1, 1, 67, + 1, 0 }; static const char _deserialize_text_trans_targs[] = { 1, 0, 2, 26, 3, 4, 20, 5, - 24, 25, 8, 29, 40, 29, 40, 32, - 37, 33, 34, 12, 13, 16, 13, 16, - 14, 15, 35, 36, 35, 36, 27, 19, - 38, 39, 38, 39, 21, 20, 6, 22, + 24, 25, 28, 39, 9, 31, 34, 31, + 34, 11, 32, 33, 32, 33, 35, 38, + 14, 15, 18, 15, 18, 16, 17, 36, + 37, 36, 37, 27, 21, 20, 6, 22, 23, 21, 22, 23, 21, 22, 23, 25, - 27, 27, 28, 7, 9, 11, 17, 22, - 31, 27, 28, 7, 9, 11, 17, 22, - 31, 41, 42, 30, 10, 18, 22, 31, - 30, 31, 31, 30, 10, 7, 11, 31, - 30, 22, 31, 34, 30, 10, 7, 22, - 31, 37, 30, 10, 22, 31, 27, 22, - 31, 42 + 27, 27, 7, 8, 12, 13, 19, 22, + 30, 27, 7, 8, 12, 13, 19, 22, + 30, 29, 22, 30, 29, 30, 30, 29, + 7, 10, 22, 30, 29, 7, 22, 30, + 29, 7, 8, 13, 30, 29, 7, 8, + 22, 30, 38, 39 }; static const char _deserialize_text_trans_actions[] = { 0, 0, 0, 0, 1, 0, 2, 0, - 2, 2, 3, 4, 4, 5, 5, 4, - 4, 4, 4, 3, 3, 3, 0, 0, - 6, 3, 4, 4, 5, 5, 5, 3, - 4, 4, 5, 5, 7, 8, 9, 7, + 2, 2, 3, 3, 4, 3, 3, 5, + 5, 4, 3, 3, 5, 5, 3, 3, + 4, 4, 4, 0, 0, 6, 4, 3, + 3, 5, 5, 5, 7, 8, 9, 7, 7, 0, 0, 0, 10, 10, 10, 8, - 12, 13, 14, 15, 15, 15, 16, 11, - 11, 18, 19, 20, 20, 20, 0, 17, - 17, 4, 4, 21, 22, 22, 21, 21, - 0, 0, 13, 10, 23, 23, 23, 10, - 24, 24, 24, 5, 25, 26, 26, 25, - 25, 5, 27, 28, 27, 27, 30, 29, - 29, 5 + 12, 13, 14, 14, 14, 14, 15, 11, + 11, 17, 18, 18, 18, 18, 0, 16, + 16, 19, 19, 19, 0, 0, 13, 20, + 21, 21, 20, 20, 22, 23, 22, 22, + 10, 24, 24, 24, 10, 25, 26, 26, + 25, 25, 5, 5 }; static const char _deserialize_text_eof_actions[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, - 10, 10, 11, 17, 17, 21, 0, 11, - 10, 24, 24, 25, 25, 10, 27, 27, - 21, 29, 29 + 10, 10, 11, 16, 19, 0, 11, 20, + 22, 22, 20, 10, 25, 25, 10, 19 }; static const int deserialize_text_start = 1; @@ -509,12 +460,12 @@ _hb_buffer_deserialize_text (hb_buffer_t *buffer, hb_glyph_info_t info = {0}; hb_glyph_position_t pos = {0}; -#line 513 "hb-buffer-deserialize-text.hh" +#line 457 "hb-buffer-deserialize-text.hh" { cs = deserialize_text_start; } -#line 518 "hb-buffer-deserialize-text.hh" +#line 460 "hb-buffer-deserialize-text.hh" { int _slen; int _trans; @@ -542,11 +493,11 @@ _resume: case 1: #line 38 "hb-buffer-deserialize-text.rl" { - memset (&info, 0, sizeof (info)); - memset (&pos , 0, sizeof (pos )); + hb_memset (&info, 0, sizeof (info)); + hb_memset (&pos , 0, sizeof (pos )); } break; - case 3: + case 4: #line 51 "hb-buffer-deserialize-text.rl" { tok = p; @@ -560,7 +511,7 @@ _resume: #line 56 "hb-buffer-deserialize-text.rl" { if (unlikely (!buffer->ensure_unicode ())) return false; } break; - case 20: + case 18: #line 58 "hb-buffer-deserialize-text.rl" { /* TODO Unescape delimiters. */ @@ -574,7 +525,7 @@ _resume: #line 66 "hb-buffer-deserialize-text.rl" {if (!parse_hex (tok, p, &info.codepoint )) return false; } break; - case 23: + case 24: #line 68 "hb-buffer-deserialize-text.rl" { if (!parse_uint (tok, p, &info.cluster )) return false; } break; @@ -586,26 +537,26 @@ _resume: #line 70 "hb-buffer-deserialize-text.rl" { if (!parse_int (tok, p, &pos.y_offset )) return false; } break; - case 22: + case 21: #line 71 "hb-buffer-deserialize-text.rl" { if (!parse_int (tok, p, &pos.x_advance)) return false; } break; - case 28: + case 23: #line 72 "hb-buffer-deserialize-text.rl" { if (!parse_int (tok, p, &pos.y_advance)) return false; } break; - case 16: + case 15: #line 38 "hb-buffer-deserialize-text.rl" { - memset (&info, 0, sizeof (info)); - memset (&pos , 0, sizeof (pos )); + hb_memset (&info, 0, sizeof (info)); + hb_memset (&pos , 0, sizeof (pos )); } #line 51 "hb-buffer-deserialize-text.rl" { tok = p; } break; - case 4: + case 3: #line 51 "hb-buffer-deserialize-text.rl" { tok = p; @@ -621,7 +572,7 @@ _resume: #line 56 "hb-buffer-deserialize-text.rl" { if (unlikely (!buffer->ensure_unicode ())) return false; } break; - case 17: + case 16: #line 58 "hb-buffer-deserialize-text.rl" { /* TODO Unescape delimiters. */ @@ -638,18 +589,6 @@ _resume: buffer->pos[buffer->len - 1] = pos; *end_ptr = p; } - break; - case 19: -#line 58 "hb-buffer-deserialize-text.rl" - { - /* TODO Unescape delimiters. */ - if (!hb_font_glyph_from_string (font, - tok, p - tok, - &info.codepoint)) - return false; -} -#line 55 "hb-buffer-deserialize-text.rl" - { if (unlikely (!buffer->ensure_glyphs ())) return false; } break; case 7: #line 66 "hb-buffer-deserialize-text.rl" @@ -687,7 +626,7 @@ _resume: *end_ptr = p; } break; - case 21: + case 20: #line 71 "hb-buffer-deserialize-text.rl" { if (!parse_int (tok, p, &pos.x_advance)) return false; } #line 43 "hb-buffer-deserialize-text.rl" @@ -699,7 +638,7 @@ _resume: *end_ptr = p; } break; - case 27: + case 22: #line 72 "hb-buffer-deserialize-text.rl" { if (!parse_int (tok, p, &pos.y_advance)) return false; } #line 43 "hb-buffer-deserialize-text.rl" @@ -711,7 +650,7 @@ _resume: *end_ptr = p; } break; - case 24: + case 19: #line 73 "hb-buffer-deserialize-text.rl" { if (!parse_uint (tok, p, &info.mask )) return false; } #line 43 "hb-buffer-deserialize-text.rl" @@ -726,8 +665,8 @@ _resume: case 12: #line 38 "hb-buffer-deserialize-text.rl" { - memset (&info, 0, sizeof (info)); - memset (&pos , 0, sizeof (pos )); + hb_memset (&info, 0, sizeof (info)); + hb_memset (&pos , 0, sizeof (pos )); } #line 51 "hb-buffer-deserialize-text.rl" { @@ -736,11 +675,11 @@ _resume: #line 55 "hb-buffer-deserialize-text.rl" { if (unlikely (!buffer->ensure_glyphs ())) return false; } break; - case 15: + case 14: #line 38 "hb-buffer-deserialize-text.rl" { - memset (&info, 0, sizeof (info)); - memset (&pos , 0, sizeof (pos )); + hb_memset (&info, 0, sizeof (info)); + hb_memset (&pos , 0, sizeof (pos )); } #line 51 "hb-buffer-deserialize-text.rl" { @@ -755,7 +694,7 @@ _resume: return false; } break; - case 18: + case 17: #line 58 "hb-buffer-deserialize-text.rl" { /* TODO Unescape delimiters. */ @@ -773,33 +712,13 @@ _resume: return false; buffer->pos[buffer->len - 1] = pos; *end_ptr = p; -} - break; - case 29: -#line 58 "hb-buffer-deserialize-text.rl" - { - /* TODO Unescape delimiters. */ - if (!hb_font_glyph_from_string (font, - tok, p - tok, - &info.codepoint)) - return false; -} -#line 73 "hb-buffer-deserialize-text.rl" - { if (!parse_uint (tok, p, &info.mask )) return false; } -#line 43 "hb-buffer-deserialize-text.rl" - { - buffer->add_info (info); - if (unlikely (!buffer->successful)) - return false; - buffer->pos[buffer->len - 1] = pos; - *end_ptr = p; } break; case 11: #line 38 "hb-buffer-deserialize-text.rl" { - memset (&info, 0, sizeof (info)); - memset (&pos , 0, sizeof (pos )); + hb_memset (&info, 0, sizeof (info)); + hb_memset (&pos , 0, sizeof (pos )); } #line 51 "hb-buffer-deserialize-text.rl" { @@ -813,49 +732,6 @@ _resume: &info.codepoint)) return false; } -#line 43 "hb-buffer-deserialize-text.rl" - { - buffer->add_info (info); - if (unlikely (!buffer->successful)) - return false; - buffer->pos[buffer->len - 1] = pos; - *end_ptr = p; -} - break; - case 14: -#line 38 "hb-buffer-deserialize-text.rl" - { - memset (&info, 0, sizeof (info)); - memset (&pos , 0, sizeof (pos )); -} -#line 51 "hb-buffer-deserialize-text.rl" - { - tok = p; -} -#line 58 "hb-buffer-deserialize-text.rl" - { - /* TODO Unescape delimiters. */ - if (!hb_font_glyph_from_string (font, - tok, p - tok, - &info.codepoint)) - return false; -} -#line 55 "hb-buffer-deserialize-text.rl" - { if (unlikely (!buffer->ensure_glyphs ())) return false; } - break; - case 30: -#line 58 "hb-buffer-deserialize-text.rl" - { - /* TODO Unescape delimiters. */ - if (!hb_font_glyph_from_string (font, - tok, p - tok, - &info.codepoint)) - return false; -} -#line 73 "hb-buffer-deserialize-text.rl" - { if (!parse_uint (tok, p, &info.mask )) return false; } -#line 55 "hb-buffer-deserialize-text.rl" - { if (unlikely (!buffer->ensure_glyphs ())) return false; } #line 43 "hb-buffer-deserialize-text.rl" { buffer->add_info (info); @@ -868,8 +744,8 @@ _resume: case 13: #line 38 "hb-buffer-deserialize-text.rl" { - memset (&info, 0, sizeof (info)); - memset (&pos , 0, sizeof (pos )); + hb_memset (&info, 0, sizeof (info)); + hb_memset (&pos , 0, sizeof (pos )); } #line 51 "hb-buffer-deserialize-text.rl" { @@ -894,7 +770,7 @@ _resume: *end_ptr = p; } break; -#line 898 "hb-buffer-deserialize-text.hh" +#line 715 "hb-buffer-deserialize-text.hh" } _again: @@ -906,7 +782,7 @@ _again: if ( p == eof ) { switch ( _deserialize_text_eof_actions[cs] ) { - case 17: + case 16: #line 58 "hb-buffer-deserialize-text.rl" { /* TODO Unescape delimiters. */ @@ -960,7 +836,7 @@ _again: *end_ptr = p; } break; - case 21: + case 20: #line 71 "hb-buffer-deserialize-text.rl" { if (!parse_int (tok, p, &pos.x_advance)) return false; } #line 43 "hb-buffer-deserialize-text.rl" @@ -972,7 +848,7 @@ _again: *end_ptr = p; } break; - case 27: + case 22: #line 72 "hb-buffer-deserialize-text.rl" { if (!parse_int (tok, p, &pos.y_advance)) return false; } #line 43 "hb-buffer-deserialize-text.rl" @@ -984,27 +860,7 @@ _again: *end_ptr = p; } break; - case 24: -#line 73 "hb-buffer-deserialize-text.rl" - { if (!parse_uint (tok, p, &info.mask )) return false; } -#line 43 "hb-buffer-deserialize-text.rl" - { - buffer->add_info (info); - if (unlikely (!buffer->successful)) - return false; - buffer->pos[buffer->len - 1] = pos; - *end_ptr = p; -} - break; - case 29: -#line 58 "hb-buffer-deserialize-text.rl" - { - /* TODO Unescape delimiters. */ - if (!hb_font_glyph_from_string (font, - tok, p - tok, - &info.codepoint)) - return false; -} + case 19: #line 73 "hb-buffer-deserialize-text.rl" { if (!parse_uint (tok, p, &info.mask )) return false; } #line 43 "hb-buffer-deserialize-text.rl" @@ -1019,8 +875,8 @@ _again: case 11: #line 38 "hb-buffer-deserialize-text.rl" { - memset (&info, 0, sizeof (info)); - memset (&pos , 0, sizeof (pos )); + hb_memset (&info, 0, sizeof (info)); + hb_memset (&pos , 0, sizeof (pos )); } #line 51 "hb-buffer-deserialize-text.rl" { @@ -1043,7 +899,7 @@ _again: *end_ptr = p; } break; -#line 1047 "hb-buffer-deserialize-text.hh" +#line 825 "hb-buffer-deserialize-text.hh" } } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-text.rl b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-text.rl index 0f33eb89d44..f82d5ab821f 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-text.rl +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-text.rl @@ -36,8 +36,8 @@ alphtype unsigned char; write data; action clear_item { - memset (&info, 0, sizeof (info)); - memset (&pos , 0, sizeof (pos )); + hb_memset (&info, 0, sizeof (info)); + hb_memset (&pos , 0, sizeof (pos )); } action add_item { @@ -76,7 +76,7 @@ unum = '0' | [1-9] digit*; num = '-'? unum; glyph_id = unum; -glyph_name = ([^\\\]=@+,|] | '\\' [\\\]=@+,|]) *; +glyph_name = ([^\\\]=@+,#|] | '\\' [\\\]=@+,|]) *; glyph = (glyph_id | glyph_name) >tok %parse_glyph; cluster = '=' (unum >tok %parse_cluster); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-serialize.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-serialize.cc index d1e17754303..a458f2318f1 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-serialize.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-serialize.cc @@ -183,7 +183,7 @@ _hb_buffer_serialize_glyphs_json (hb_buffer_t *buffer, unsigned int l = p - b; if (buf_size > l) { - memcpy (buf, b, l); + hb_memcpy (buf, b, l); buf += l; buf_size -= l; *buf_consumed += l; @@ -241,7 +241,7 @@ _hb_buffer_serialize_unicode_json (hb_buffer_t *buffer, unsigned int l = p - b; if (buf_size > l) { - memcpy (buf, b, l); + hb_memcpy (buf, b, l); buf += l; buf_size -= l; *buf_consumed += l; @@ -329,7 +329,7 @@ _hb_buffer_serialize_glyphs_text (hb_buffer_t *buffer, unsigned int l = p - b; if (buf_size > l) { - memcpy (buf, b, l); + hb_memcpy (buf, b, l); buf += l; buf_size -= l; *buf_consumed += l; @@ -381,7 +381,7 @@ _hb_buffer_serialize_unicode_text (hb_buffer_t *buffer, unsigned int l = p - b; if (buf_size > l) { - memcpy (buf, b, l); + hb_memcpy (buf, b, l); buf += l; buf_size -= l; *buf_consumed += l; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-verify.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-verify.cc index 5453e1ca94e..1cd52b39b15 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-verify.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-verify.cc @@ -186,7 +186,7 @@ buffer_verify_unsafe_to_break (hb_buffer_t *buffer, bool ret = true; hb_buffer_diff_flags_t diff = hb_buffer_diff (reconstruction, buffer, (hb_codepoint_t) -1, 0); - if (diff) + if (diff & ~HB_BUFFER_DIFF_FLAG_GLYPH_FLAGS_MISMATCH) { buffer_verify_error (buffer, font, BUFFER_VERIFY_ERROR "unsafe-to-break test failed."); ret = false; @@ -313,7 +313,6 @@ buffer_verify_unsafe_to_concat (hb_buffer_t *buffer, bool ret = true; hb_buffer_diff_flags_t diff; - /* * Shape the two fragment streams. */ @@ -382,7 +381,7 @@ buffer_verify_unsafe_to_concat (hb_buffer_t *buffer, * Diff results. */ diff = hb_buffer_diff (reconstruction, buffer, (hb_codepoint_t) -1, 0); - if (diff) + if (diff & ~HB_BUFFER_DIFF_FLAG_GLYPH_FLAGS_MISMATCH) { buffer_verify_error (buffer, font, BUFFER_VERIFY_ERROR "unsafe-to-concat test failed."); ret = false; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc index 57a5ae03ed1..4b6c2d9eaae 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc @@ -172,12 +172,13 @@ hb_buffer_t::enlarge (unsigned int size) while (size >= new_allocated) new_allocated += (new_allocated >> 1) + 32; - static_assert ((sizeof (info[0]) == sizeof (pos[0])), ""); - if (unlikely (hb_unsigned_mul_overflows (new_allocated, sizeof (info[0])))) + unsigned new_bytes; + if (unlikely (hb_unsigned_mul_overflows (new_allocated, sizeof (info[0]), &new_bytes))) goto done; - new_pos = (hb_glyph_position_t *) hb_realloc (pos, new_allocated * sizeof (pos[0])); - new_info = (hb_glyph_info_t *) hb_realloc (info, new_allocated * sizeof (info[0])); + static_assert (sizeof (info[0]) == sizeof (pos[0]), ""); + new_pos = (hb_glyph_position_t *) hb_realloc (pos, new_bytes); + new_info = (hb_glyph_info_t *) hb_realloc (info, new_bytes); done: if (unlikely (!new_pos || !new_info)) @@ -208,7 +209,7 @@ hb_buffer_t::make_room_for (unsigned int num_in, assert (have_output); out_info = (hb_glyph_info_t *) pos; - memcpy (out_info, info, out_len * sizeof (out_info[0])); + hb_memcpy (out_info, info, out_len * sizeof (out_info[0])); } return true; @@ -229,7 +230,7 @@ hb_buffer_t::shift_forward (unsigned int count) * Ideally, we should at least set Default_Ignorable bits on * these, as well as consistent cluster values. But the former * is layering violation... */ - memset (info + len, 0, (idx + count - len) * sizeof (info[0])); + hb_memset (info + len, 0, (idx + count - len) * sizeof (info[0])); } len += count; idx += count; @@ -298,8 +299,8 @@ hb_buffer_t::clear () out_len = 0; out_info = info; - memset (context, 0, sizeof context); - memset (context_len, 0, sizeof context_len); + hb_memset (context, 0, sizeof context); + hb_memset (context_len, 0, sizeof context_len); deallocate_var_all (); serial = 0; @@ -313,15 +314,14 @@ hb_buffer_t::enter () serial = 0; shaping_failed = false; scratch_flags = HB_BUFFER_SCRATCH_FLAG_DEFAULT; - if (likely (!hb_unsigned_mul_overflows (len, HB_BUFFER_MAX_LEN_FACTOR))) + unsigned mul; + if (likely (!hb_unsigned_mul_overflows (len, HB_BUFFER_MAX_LEN_FACTOR, &mul))) { - max_len = hb_max (len * HB_BUFFER_MAX_LEN_FACTOR, - (unsigned) HB_BUFFER_MAX_LEN_MIN); + max_len = hb_max (mul, (unsigned) HB_BUFFER_MAX_LEN_MIN); } - if (likely (!hb_unsigned_mul_overflows (len, HB_BUFFER_MAX_OPS_FACTOR))) + if (likely (!hb_unsigned_mul_overflows (len, HB_BUFFER_MAX_OPS_FACTOR, &mul))) { - max_ops = hb_max (len * HB_BUFFER_MAX_OPS_FACTOR, - (unsigned) HB_BUFFER_MAX_OPS_MIN); + max_ops = hb_max (mul, (unsigned) HB_BUFFER_MAX_OPS_MIN); } } void @@ -345,7 +345,7 @@ hb_buffer_t::add (hb_codepoint_t codepoint, glyph = &info[len]; - memset (glyph, 0, sizeof (*glyph)); + hb_memset (glyph, 0, sizeof (*glyph)); glyph->codepoint = codepoint; glyph->mask = 0; glyph->cluster = cluster; @@ -605,6 +605,53 @@ done: skip_glyph (); } +void +hb_buffer_t::delete_glyphs_inplace (bool (*filter) (const hb_glyph_info_t *info)) +{ + /* Merge clusters and delete filtered glyphs. + * NOTE! We can't use out-buffer as we have positioning data. */ + unsigned int j = 0; + unsigned int count = len; + for (unsigned int i = 0; i < count; i++) + { + if (filter (&info[i])) + { + /* Merge clusters. + * Same logic as delete_glyph(), but for in-place removal. */ + + unsigned int cluster = info[i].cluster; + if (i + 1 < count && cluster == info[i + 1].cluster) + continue; /* Cluster survives; do nothing. */ + + if (j) + { + /* Merge cluster backward. */ + if (cluster < info[j - 1].cluster) + { + unsigned int mask = info[i].mask; + unsigned int old_cluster = info[j - 1].cluster; + for (unsigned k = j; k && info[k - 1].cluster == old_cluster; k--) + set_cluster (info[k - 1], cluster, mask); + } + continue; + } + + if (i + 1 < count) + merge_clusters (i, i + 2); /* Merge cluster forward. */ + + continue; + } + + if (j != i) + { + info[j] = info[i]; + pos[j] = pos[i]; + } + j++; + } + len = j; +} + void hb_buffer_t::guess_segment_properties () { @@ -933,7 +980,6 @@ hb_buffer_get_unicode_funcs (const hb_buffer_t *buffer) void hb_buffer_set_direction (hb_buffer_t *buffer, hb_direction_t direction) - { if (unlikely (hb_object_is_immutable (buffer))) return; @@ -1385,9 +1431,9 @@ hb_buffer_set_length (hb_buffer_t *buffer, /* Wipe the new space */ if (length > buffer->len) { - memset (buffer->info + buffer->len, 0, sizeof (buffer->info[0]) * (length - buffer->len)); + hb_memset (buffer->info + buffer->len, 0, sizeof (buffer->info[0]) * (length - buffer->len)); if (buffer->have_positions) - memset (buffer->pos + buffer->len, 0, sizeof (buffer->pos[0]) * (length - buffer->len)); + hb_memset (buffer->pos + buffer->len, 0, sizeof (buffer->pos[0]) * (length - buffer->len)); } buffer->len = length; @@ -1795,7 +1841,9 @@ hb_buffer_add_latin1 (hb_buffer_t *buffer, * marks at stat of run. * * This function does not check the validity of @text, it is up to the caller - * to ensure it contains a valid Unicode code points. + * to ensure it contains a valid Unicode scalar values. In contrast, + * hb_buffer_add_utf32() can be used that takes similar input but performs + * sanity-check on the input. * * Since: 0.9.31 **/ @@ -1858,9 +1906,9 @@ hb_buffer_append (hb_buffer_t *buffer, hb_segment_properties_overlay (&buffer->props, &source->props); - memcpy (buffer->info + orig_len, source->info + start, (end - start) * sizeof (buffer->info[0])); + hb_memcpy (buffer->info + orig_len, source->info + start, (end - start) * sizeof (buffer->info[0])); if (buffer->have_positions) - memcpy (buffer->pos + orig_len, source->pos + start, (end - start) * sizeof (buffer->pos[0])); + hb_memcpy (buffer->pos + orig_len, source->pos + start, (end - start) * sizeof (buffer->pos[0])); if (source->content_type == HB_BUFFER_CONTENT_TYPE_UNICODE) { @@ -2048,7 +2096,7 @@ hb_buffer_diff (hb_buffer_t *buffer, result |= HB_BUFFER_DIFF_FLAG_CODEPOINT_MISMATCH; if (buf_info->cluster != ref_info->cluster) result |= HB_BUFFER_DIFF_FLAG_CLUSTER_MISMATCH; - if ((buf_info->mask & ~ref_info->mask & HB_GLYPH_FLAG_DEFINED)) + if ((buf_info->mask ^ ref_info->mask) & HB_GLYPH_FLAG_DEFINED) result |= HB_BUFFER_DIFF_FLAG_GLYPH_FLAGS_MISMATCH; if (contains && ref_info->codepoint == dottedcircle_glyph) result |= HB_BUFFER_DIFF_FLAG_DOTTED_CIRCLE_PRESENT; @@ -2103,6 +2151,13 @@ hb_buffer_set_message_func (hb_buffer_t *buffer, hb_buffer_message_func_t func, void *user_data, hb_destroy_func_t destroy) { + if (unlikely (hb_object_is_immutable (buffer))) + { + if (destroy) + destroy (user_data); + return; + } + if (buffer->message_destroy) buffer->message_destroy (buffer->message_data); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.hh index 26c3f0fac8c..bb1efe9dd31 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.hh @@ -32,6 +32,7 @@ #include "hb.hh" #include "hb-unicode.hh" +#include "hb-set-digest.hh" #ifndef HB_BUFFER_MAX_LEN_FACTOR @@ -207,6 +208,14 @@ struct hb_buffer_t hb_glyph_info_t &prev () { return out_info[out_len ? out_len - 1 : 0]; } hb_glyph_info_t prev () const { return out_info[out_len ? out_len - 1 : 0]; } + hb_set_digest_t digest () const + { + hb_set_digest_t d; + d.init (); + d.add_array (&info[0].codepoint, len, sizeof (info[0])); + return d; + } + HB_INTERNAL void similar (const hb_buffer_t &src); HB_INTERNAL void reset (); HB_INTERNAL void clear (); @@ -402,6 +411,8 @@ struct hb_buffer_t HB_INTERNAL void merge_out_clusters (unsigned int start, unsigned int end); /* Merge clusters for deleting current glyph, and skip it. */ HB_INTERNAL void delete_glyph (); + HB_INTERNAL void delete_glyphs_inplace (bool (*filter) (const hb_glyph_info_t *info)); + /* Adds glyph flags in mask to infos with clusters between start and end. diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cache.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cache.hh index 897f313fbd4..f8c8108f1f1 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cache.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cache.hh @@ -46,7 +46,7 @@ struct hb_cache_t >::type; static_assert ((key_bits >= cache_bits), ""); - static_assert ((key_bits + value_bits - cache_bits <= 8 * sizeof (item_t)), ""); + static_assert ((key_bits + value_bits <= cache_bits + 8 * sizeof (item_t)), ""); void init () { clear (); } void fini () {} diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff-interp-common.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff-interp-common.hh index 5c2cb060a41..49805a89c5a 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff-interp-common.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff-interp-common.hh @@ -284,65 +284,56 @@ struct UnsizedByteStr : UnsizedArrayOf /* A byte string associated with the current offset and an error condition */ struct byte_str_ref_t { - byte_str_ref_t () { init (); } - - void init () - { - str = hb_ubytes_t (); - offset = 0; - error = false; - } - - void fini () {} + byte_str_ref_t () + : str () {} byte_str_ref_t (const hb_ubytes_t &str_, unsigned int offset_ = 0) - : str (str_), offset (offset_), error (false) {} + : str (str_) { set_offset (offset_); } void reset (const hb_ubytes_t &str_, unsigned int offset_ = 0) { str = str_; - offset = offset_; - error = false; + set_offset (offset_); } const unsigned char& operator [] (int i) { - if (unlikely ((unsigned int) (offset + i) >= str.length)) + if (unlikely ((unsigned int) (get_offset () + i) >= str.length)) { set_error (); return Null (unsigned char); } - return str[offset + i]; + return str.arrayZ[get_offset () + i]; } + unsigned char head_unchecked () const { return str.arrayZ[get_offset ()]; } + /* Conversion to hb_ubytes_t */ - operator hb_ubytes_t () const { return str.sub_array (offset, str.length - offset); } + operator hb_ubytes_t () const { return str.sub_array (get_offset ()); } hb_ubytes_t sub_array (unsigned int offset_, unsigned int len_) const { return str.sub_array (offset_, len_); } bool avail (unsigned int count=1) const - { return (!in_error () && offset + count <= str.length); } + { return get_offset () + count <= str.length; } void inc (unsigned int count=1) { - if (likely (!in_error () && (offset <= str.length) && (offset + count <= str.length))) - { - offset += count; - } - else - { - offset = str.length; - set_error (); - } + /* Automatically puts us in error if count is out-of-range. */ + set_offset (get_offset () + count); } - void set_error () { error = true; } - bool in_error () const { return error; } + /* We (ab)use ubytes backwards_length as a cursor (called offset), + * as well as to store error condition. */ - hb_ubytes_t str; - unsigned int offset; /* beginning of the sub-string within str */ + unsigned get_offset () const { return str.backwards_length; } + void set_offset (unsigned offset) { str.backwards_length = offset; } + + void set_error () { str.backwards_length = str.length + 1; } + bool in_error () const { return str.backwards_length > str.length; } + + unsigned total_size () const { return str.length; } protected: - bool error; + hb_ubytes_t str; }; using byte_str_array_t = hb_vector_t; @@ -491,8 +482,15 @@ struct arg_stack_t : cff_stack_t /* an operator prefixed by its operands in a byte string */ struct op_str_t { - hb_ubytes_t str; + /* This used to have a hb_ubytes_t. Using a pointer and length + * in a particular order, saves 8 bytes in this struct and more + * in our parsed_cs_op_t subclass. */ + + const unsigned char *ptr = nullptr; + op_code_t op; + + uint8_t length = 0; }; /* base of OP_SERIALIZER */ @@ -503,9 +501,11 @@ struct op_serializer_t { TRACE_SERIALIZE (this); - HBUINT8 *d = c->allocate_size (opstr.str.length); + unsigned char *d = c->allocate_size (opstr.length); if (unlikely (!d)) return_trace (false); - memcpy (d, &opstr.str[0], opstr.str.length); + /* Faster than hb_memcpy for small strings. */ + for (unsigned i = 0; i < opstr.length; i++) + d[i] = opstr.ptr[i]; return_trace (true); } }; @@ -529,16 +529,20 @@ struct parsed_values_t { VAL *val = values.push (); val->op = op; - val->str = str_ref.str.sub_array (opStart, str_ref.offset - opStart); - opStart = str_ref.offset; + auto arr = str_ref.sub_array (opStart, str_ref.get_offset () - opStart); + val->ptr = arr.arrayZ; + val->length = arr.length; + opStart = str_ref.get_offset (); } void add_op (op_code_t op, const byte_str_ref_t& str_ref, const VAL &v) { VAL *val = values.push (v); val->op = op; - val->str = str_ref.sub_array ( opStart, str_ref.offset - opStart); - opStart = str_ref.offset; + auto arr = str_ref.sub_array (opStart, str_ref.get_offset () - opStart); + val->ptr = arr.arrayZ; + val->length = arr.length; + opStart = str_ref.get_offset (); } bool has_op (op_code_t op) const @@ -549,8 +553,7 @@ struct parsed_values_t } unsigned get_count () const { return values.length; } - const VAL &get_value (unsigned int i) const { return values[i]; } - const VAL &operator [] (unsigned int i) const { return get_value (i); } + const VAL &operator [] (unsigned int i) const { return values[i]; } unsigned int opStart; hb_vector_t values; @@ -565,23 +568,23 @@ struct interp_env_t str_ref.reset (str_); } bool in_error () const - { return error || str_ref.in_error () || argStack.in_error (); } + { return str_ref.in_error () || argStack.in_error (); } - void set_error () { error = true; } + void set_error () { str_ref.set_error (); } op_code_t fetch_op () { op_code_t op = OpCode_Invalid; if (unlikely (!str_ref.avail ())) return OpCode_Invalid; - op = (op_code_t)(unsigned char)str_ref[0]; + op = (op_code_t) str_ref.head_unchecked (); + str_ref.inc (); if (op == OpCode_escape) { if (unlikely (!str_ref.avail ())) return OpCode_Invalid; - op = Make_OpCode_ESC(str_ref[1]); + op = Make_OpCode_ESC (str_ref.head_unchecked ()); str_ref.inc (); } - str_ref.inc (); return op; } @@ -596,8 +599,6 @@ struct interp_env_t str_ref; arg_stack_t argStack; - protected: - bool error = false; }; using num_interp_env_t = interp_env_t<>; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff2-interp-cs.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff2-interp-cs.hh index d0b9e7b0863..00c25800e68 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff2-interp-cs.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff2-interp-cs.hh @@ -40,13 +40,15 @@ struct blend_arg_t : number_t void set_real (double v) { reset_blends (); number_t::set_real (v); } void set_blends (unsigned int numValues_, unsigned int valueIndex_, - unsigned int numBlends, hb_array_t blends_) + hb_array_t blends_) { numValues = numValues_; valueIndex = valueIndex_; - deltas.resize (numBlends); + unsigned numBlends = blends_.length; + if (unlikely (!deltas.resize (numBlends))) + return; for (unsigned int i = 0; i < numBlends; i++) - deltas[i] = blends_[i]; + deltas.arrayZ[i] = blends_.arrayZ[i]; } bool blending () const { return deltas.length > 0; } @@ -61,7 +63,6 @@ struct blend_arg_t : number_t hb_vector_t deltas; }; -typedef interp_env_t BlendInterpEnv; typedef biased_subrs_t cff2_biased_subrs_t; template @@ -154,8 +155,9 @@ struct cff2_cs_interp_env_t : cs_interp_env_t { if (likely (scalars.length == deltas.length)) { - for (unsigned int i = 0; i < scalars.length; i++) - v += (double) scalars[i] * deltas[i].to_real (); + unsigned count = scalars.length; + for (unsigned i = 0; i < count; i++) + v += (double) scalars.arrayZ[i] * deltas.arrayZ[i].to_real (); } } return v; @@ -220,7 +222,7 @@ struct cff2_cs_opset_t : cs_opset_t, PAR const hb_array_t blends, unsigned n, unsigned i) { - arg.set_blends (n, i, blends.length, blends); + arg.set_blends (n, i, blends); } template diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.cc index bbb6cd552be..e9f9cfeb5ff 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.cc @@ -285,7 +285,7 @@ struct hb_language_item_t { lang = (hb_language_t) hb_malloc(len); if (likely (lang)) { - memcpy((unsigned char *) lang, s, len); + hb_memcpy((unsigned char *) lang, s, len); for (unsigned char *p = (unsigned char *) lang; *p; p++) *p = canon_map[*p]; } @@ -379,7 +379,7 @@ hb_language_from_string (const char *str, int len) /* NUL-terminate it. */ char strbuf[64]; len = hb_min (len, (int) sizeof (strbuf) - 1); - memcpy (strbuf, str, len); + hb_memcpy (strbuf, str, len); strbuf[len] = '\0'; item = lang_find_or_insert (strbuf); } @@ -976,7 +976,7 @@ hb_feature_from_string (const char *str, int len, } if (feature) - memset (feature, 0, sizeof (*feature)); + hb_memset (feature, 0, sizeof (*feature)); return false; } @@ -1025,7 +1025,7 @@ hb_feature_to_string (hb_feature_t *feature, } assert (len < ARRAY_LENGTH (s)); len = hb_min (len, size - 1); - memcpy (buf, s, len); + hb_memcpy (buf, s, len); buf[len] = '\0'; } @@ -1088,7 +1088,7 @@ hb_variation_from_string (const char *str, int len, } if (variation) - memset (variation, 0, sizeof (*variation)); + hb_memset (variation, 0, sizeof (*variation)); return false; } @@ -1136,7 +1136,7 @@ get_C_locale () /** * hb_variation_to_string: * @variation: an #hb_variation_t to convert - * @buf: (array length=size) (out): output string + * @buf: (array length=size) (out caller-allocates): output string * @size: the allocated size of @buf * * Converts an #hb_variation_t into a `NULL`-terminated string in the format @@ -1166,7 +1166,7 @@ hb_variation_to_string (hb_variation_t *variation, assert (len < ARRAY_LENGTH (s)); len = hb_min (len, size - 1); - memcpy (buf, s, len); + hb_memcpy (buf, s, len); buf[len] = '\0'; } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-config.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-config.hh index d56617f6a9b..98b1e9d0cf6 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-config.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-config.hh @@ -35,8 +35,9 @@ #include "config.h" #endif -#ifndef HB_BORING_EXPANSION -#define HB_NO_BORING_EXPANSION +#ifndef HB_EXPERIMENTAL_API +#define HB_NO_BEYOND_64K +#define HB_NO_VAR_COMPOSITES #endif #ifdef HB_TINY @@ -84,6 +85,7 @@ #define HB_NO_OT_SHAPE_FRACTIONS #define HB_NO_STYLE #define HB_NO_SUBSET_LAYOUT +#define HB_NO_VERTICAL #define HB_NO_VAR #endif @@ -104,7 +106,7 @@ #ifdef HB_NO_BORING_EXPANSION #define HB_NO_BEYOND_64K -#define HB_NO_VARIATIONS2 +#define HB_NO_AVAR2 #endif #ifdef HB_DISABLE_DEPRECATED @@ -113,6 +115,11 @@ #define HB_IF_NOT_DEPRECATED(x) x #endif +#ifdef HB_NO_SHAPER +#define HB_NO_OT_SHAPE +#define HB_NO_AAT_SHAPE +#endif + #ifdef HB_NO_AAT #define HB_NO_OT_NAME_LANGUAGE_AAT #define HB_NO_AAT_SHAPE @@ -159,6 +166,7 @@ #define HB_NO_OT_SHAPER_HEBREW_FALLBACK #define HB_NO_OT_SHAPER_THAI_FALLBACK #define HB_NO_OT_SHAPER_VOWEL_CONSTRAINTS +#define HB_NO_OT_SHAPER_MYANMAR_ZAWGYI #endif #ifdef NDEBUG diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc index 99b33c001e5..4267e0e13e8 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc @@ -347,10 +347,13 @@ _hb_coretext_shaper_font_data_create (hb_font_t *font) hb_ot_var_axis_info_t info; unsigned int c = 1; hb_ot_var_get_axis_infos (font->face, i, &c, &info); - CFDictionarySetValue (variations, - CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &info.tag), - CFNumberCreate (kCFAllocatorDefault, kCFNumberFloatType, &font->design_coords[i]) - ); + float v = hb_clamp (font->design_coords[i], info.min_value, info.max_value); + + CFNumberRef tag_number = CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &info.tag); + CFNumberRef value_number = CFNumberCreate (kCFAllocatorDefault, kCFNumberFloatType, &v); + CFDictionarySetValue (variations, tag_number, value_number); + CFRelease (tag_number); + CFRelease (value_number); } CFDictionaryRef attributes = @@ -648,7 +651,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan, } else { active_feature_t *feature = active_features.lsearch (event->feature); if (feature) - active_features.remove (feature - active_features.arrayZ); + active_features.remove_ordered (feature - active_features.arrayZ); } } } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-draw.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-draw.cc index 46797e64e62..72c203f24fb 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-draw.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-draw.cc @@ -80,6 +80,56 @@ hb_draw_close_path_nil (hb_draw_funcs_t *dfuncs HB_UNUSED, void *draw_data HB_UN void *user_data HB_UNUSED) {} +static bool +_hb_draw_funcs_set_preamble (hb_draw_funcs_t *dfuncs, + bool func_is_null, + void **user_data, + hb_destroy_func_t *destroy) +{ + if (hb_object_is_immutable (dfuncs)) + { + if (*destroy) + (*destroy) (*user_data); + return false; + } + + if (func_is_null) + { + if (*destroy) + (*destroy) (*user_data); + *destroy = nullptr; + *user_data = nullptr; + } + + return true; +} + +static bool +_hb_draw_funcs_set_middle (hb_draw_funcs_t *dfuncs, + void *user_data, + hb_destroy_func_t destroy) +{ + if (user_data && !dfuncs->user_data) + { + dfuncs->user_data = (decltype (dfuncs->user_data)) hb_calloc (1, sizeof (*dfuncs->user_data)); + if (unlikely (!dfuncs->user_data)) + goto fail; + } + if (destroy && !dfuncs->destroy) + { + dfuncs->destroy = (decltype (dfuncs->destroy)) hb_calloc (1, sizeof (*dfuncs->destroy)); + if (unlikely (!dfuncs->destroy)) + goto fail; + } + + return true; + +fail: + if (destroy) + (destroy) (user_data); + return false; +} + #define HB_DRAW_FUNC_IMPLEMENT(name) \ \ void \ @@ -88,43 +138,24 @@ hb_draw_funcs_set_##name##_func (hb_draw_funcs_t *dfuncs, \ void *user_data, \ hb_destroy_func_t destroy) \ { \ - if (hb_object_is_immutable (dfuncs)) \ - return; \ + if (!_hb_draw_funcs_set_preamble (dfuncs, !func, &user_data, &destroy))\ + return; \ \ if (dfuncs->destroy && dfuncs->destroy->name) \ dfuncs->destroy->name (!dfuncs->user_data ? nullptr : dfuncs->user_data->name); \ \ - if (user_data && !dfuncs->user_data) \ - { \ - dfuncs->user_data = (decltype (dfuncs->user_data)) hb_calloc (1, sizeof (*dfuncs->user_data)); \ - if (unlikely (!dfuncs->user_data)) \ - goto fail; \ - } \ - if (destroy && !dfuncs->destroy) \ - { \ - dfuncs->destroy = (decltype (dfuncs->destroy)) hb_calloc (1, sizeof (*dfuncs->destroy)); \ - if (unlikely (!dfuncs->destroy)) \ - goto fail; \ - } \ + if (!_hb_draw_funcs_set_middle (dfuncs, user_data, destroy)) \ + return; \ \ - if (func) { \ + if (func) \ dfuncs->func.name = func; \ - if (dfuncs->user_data) \ - dfuncs->user_data->name = user_data; \ - if (dfuncs->destroy) \ - dfuncs->destroy->name = destroy; \ - } else { \ + else \ dfuncs->func.name = hb_draw_##name##_nil; \ - if (dfuncs->user_data) \ - dfuncs->user_data->name = nullptr; \ - if (dfuncs->destroy) \ - dfuncs->destroy->name = nullptr; \ - } \ - return; \ - \ -fail: \ - if (destroy) \ - destroy (user_data); \ + \ + if (dfuncs->user_data) \ + dfuncs->user_data->name = user_data; \ + if (dfuncs->destroy) \ + dfuncs->destroy->name = destroy; \ } HB_DRAW_FUNCS_IMPLEMENT_CALLBACKS diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc index e7deb31dd83..8b4b635c7a7 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc @@ -288,6 +288,7 @@ hb_face_destroy (hb_face_t *face) { if (!hb_object_destroy (face)) return; +#ifndef HB_NO_SHAPER for (hb_face_t::plan_node_t *node = face->shape_plans; node; ) { hb_face_t::plan_node_t *next = node->next; @@ -295,6 +296,7 @@ hb_face_destroy (hb_face_t *face) hb_free (node); node = next; } +#endif face->data.fini (); face->table.fini (); @@ -636,7 +638,7 @@ hb_face_collect_variation_unicodes (hb_face_t *face, struct face_table_info_t { hb_blob_t* data; - unsigned order; + signed order; }; struct hb_face_builder_data_t @@ -784,16 +786,16 @@ hb_face_builder_create () hb_bool_t hb_face_builder_add_table (hb_face_t *face, hb_tag_t tag, hb_blob_t *blob) { - if (tag == HB_MAP_VALUE_INVALID) + if (unlikely (face->destroy != (hb_destroy_func_t) _hb_face_builder_data_destroy)) return false; - if (unlikely (face->destroy != (hb_destroy_func_t) _hb_face_builder_data_destroy)) + if (tag == HB_MAP_VALUE_INVALID) return false; hb_face_builder_data_t *data = (hb_face_builder_data_t *) face->user_data; hb_blob_t* previous = data->tables.get (tag).data; - if (!data->tables.set (tag, face_table_info_t {hb_blob_reference (blob), 0})) + if (!data->tables.set (tag, face_table_info_t {hb_blob_reference (blob), -1})) { hb_blob_destroy (blob); return false; @@ -819,13 +821,16 @@ void hb_face_builder_sort_tables (hb_face_t *face, const hb_tag_t *tags) { + if (unlikely (face->destroy != (hb_destroy_func_t) _hb_face_builder_data_destroy)) + return; + hb_face_builder_data_t *data = (hb_face_builder_data_t *) face->user_data; // Sort all unspecified tables after any specified tables. for (auto& info : data->tables.values_ref()) - info.order = -1; + info.order = (unsigned) -1; - unsigned order = 0; + signed order = 0; for (const hb_tag_t* tag = tags; *tag; tag++) diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.hh index 12e10d01e01..1bf0606e526 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.hh @@ -65,7 +65,9 @@ struct hb_face_t hb_shape_plan_t *shape_plan; plan_node_t *next; }; +#ifndef HB_NO_SHAPER hb_atomic_ptr_t shape_plans; +#endif hb_blob_t *reference_table (hb_tag_t tag) const { diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-fallback-shape.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-fallback-shape.cc index f8524ecc8e7..c54ad8764bc 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-fallback-shape.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-fallback-shape.cc @@ -75,16 +75,6 @@ _hb_fallback_shape (hb_shape_plan_t *shape_plan HB_UNUSED, const hb_feature_t *features HB_UNUSED, unsigned int num_features HB_UNUSED) { - /* TODO - * - * - Apply fallback kern. - * - Handle Variation Selectors? - * - Apply normalization? - * - * This will make the fallback shaper into a dumb "TrueType" - * shaper which many people unfortunately still request. - */ - hb_codepoint_t space; bool has_space = (bool) font->get_nominal_glyph (' ', &space); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc index 856bbdda328..0ce3e2608a7 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc @@ -71,7 +71,7 @@ hb_font_get_font_h_extents_nil (hb_font_t *font HB_UNUSED, hb_font_extents_t *extents, void *user_data HB_UNUSED) { - memset (extents, 0, sizeof (*extents)); + hb_memset (extents, 0, sizeof (*extents)); return false; } @@ -96,7 +96,7 @@ hb_font_get_font_v_extents_nil (hb_font_t *font HB_UNUSED, hb_font_extents_t *extents, void *user_data HB_UNUSED) { - memset (extents, 0, sizeof (*extents)); + hb_memset (extents, 0, sizeof (*extents)); return false; } @@ -409,7 +409,7 @@ hb_font_get_glyph_extents_nil (hb_font_t *font HB_UNUSED, hb_glyph_extents_t *extents, void *user_data HB_UNUSED) { - memset (extents, 0, sizeof (*extents)); + hb_memset (extents, 0, sizeof (*extents)); return false; } @@ -518,6 +518,7 @@ typedef struct hb_font_get_glyph_shape_default_adaptor_t { void *draw_data; float x_scale; float y_scale; + float slant; } hb_font_get_glyph_shape_default_adaptor_t; static void @@ -530,9 +531,10 @@ hb_draw_move_to_default (hb_draw_funcs_t *dfuncs HB_UNUSED, hb_font_get_glyph_shape_default_adaptor_t *adaptor = (hb_font_get_glyph_shape_default_adaptor_t *) draw_data; float x_scale = adaptor->x_scale; float y_scale = adaptor->y_scale; + float slant = adaptor->slant; adaptor->draw_funcs->emit_move_to (adaptor->draw_data, *st, - x_scale * to_x, y_scale * to_y); + x_scale * to_x + slant * to_y, y_scale * to_y); } static void @@ -544,12 +546,13 @@ hb_draw_line_to_default (hb_draw_funcs_t *dfuncs HB_UNUSED, void *draw_data, hb_font_get_glyph_shape_default_adaptor_t *adaptor = (hb_font_get_glyph_shape_default_adaptor_t *) draw_data; float x_scale = adaptor->x_scale; float y_scale = adaptor->y_scale; + float slant = adaptor->slant; - st->current_x *= x_scale; - st->current_y *= y_scale; + st->current_x = st->current_x * x_scale + st->current_y * slant; + st->current_y = st->current_y * y_scale; adaptor->draw_funcs->emit_line_to (adaptor->draw_data, *st, - x_scale * to_x, y_scale * to_y); + x_scale * to_x + slant * to_y, y_scale * to_y); } static void @@ -562,13 +565,14 @@ hb_draw_quadratic_to_default (hb_draw_funcs_t *dfuncs HB_UNUSED, void *draw_data hb_font_get_glyph_shape_default_adaptor_t *adaptor = (hb_font_get_glyph_shape_default_adaptor_t *) draw_data; float x_scale = adaptor->x_scale; float y_scale = adaptor->y_scale; + float slant = adaptor->slant; - st->current_x *= x_scale; - st->current_y *= y_scale; + st->current_x = st->current_x * x_scale + st->current_y * slant; + st->current_y = st->current_y * y_scale; adaptor->draw_funcs->emit_quadratic_to (adaptor->draw_data, *st, - x_scale * control_x, y_scale * control_y, - x_scale * to_x, y_scale * to_y); + x_scale * control_x + slant * control_y, y_scale * control_y, + x_scale * to_x + slant * to_y, y_scale * to_y); } static void @@ -582,14 +586,15 @@ hb_draw_cubic_to_default (hb_draw_funcs_t *dfuncs HB_UNUSED, void *draw_data, hb_font_get_glyph_shape_default_adaptor_t *adaptor = (hb_font_get_glyph_shape_default_adaptor_t *) draw_data; float x_scale = adaptor->x_scale; float y_scale = adaptor->y_scale; + float slant = adaptor->slant; - st->current_x *= x_scale; - st->current_y *= y_scale; + st->current_x = st->current_x * x_scale + st->current_y * slant; + st->current_y = st->current_y * y_scale; adaptor->draw_funcs->emit_cubic_to (adaptor->draw_data, *st, - x_scale * control1_x, y_scale * control1_y, - x_scale * control2_x, y_scale * control2_y, - x_scale * to_x, y_scale * to_y); + x_scale * control1_x + slant * control1_y, y_scale * control1_y, + x_scale * control2_x + slant * control2_y, y_scale * control2_y, + x_scale * to_x + slant * to_y, y_scale * to_y); } static void @@ -623,8 +628,10 @@ hb_font_get_glyph_shape_default (hb_font_t *font, hb_font_get_glyph_shape_default_adaptor_t adaptor = { draw_funcs, draw_data, - (float) font->x_scale / (float) font->parent->x_scale, - (float) font->y_scale / (float) font->parent->y_scale + font->parent->x_scale ? (float) font->x_scale / (float) font->parent->x_scale : 0.f, + font->parent->y_scale ? (float) font->y_scale / (float) font->parent->y_scale : 0.f, + font->parent->y_scale ? (font->slant - font->parent->slant) * + (float) font->x_scale / (float) font->parent->y_scale : 0.f }; font->parent->get_glyph_shape (glyph, @@ -822,6 +829,56 @@ hb_font_funcs_is_immutable (hb_font_funcs_t *ffuncs) } +static bool +_hb_font_funcs_set_preamble (hb_font_funcs_t *ffuncs, + bool func_is_null, + void **user_data, + hb_destroy_func_t *destroy) +{ + if (hb_object_is_immutable (ffuncs)) + { + if (*destroy) + (*destroy) (*user_data); + return false; + } + + if (func_is_null) + { + if (*destroy) + (*destroy) (*user_data); + *destroy = nullptr; + *user_data = nullptr; + } + + return true; +} + +static bool +_hb_font_funcs_set_middle (hb_font_funcs_t *ffuncs, + void *user_data, + hb_destroy_func_t destroy) +{ + if (user_data && !ffuncs->user_data) + { + ffuncs->user_data = (decltype (ffuncs->user_data)) hb_calloc (1, sizeof (*ffuncs->user_data)); + if (unlikely (!ffuncs->user_data)) + goto fail; + } + if (destroy && !ffuncs->destroy) + { + ffuncs->destroy = (decltype (ffuncs->destroy)) hb_calloc (1, sizeof (*ffuncs->destroy)); + if (unlikely (!ffuncs->destroy)) + goto fail; + } + + return true; + +fail: + if (destroy) + (destroy) (user_data); + return false; +} + #define HB_FONT_FUNC_IMPLEMENT(name) \ \ void \ @@ -830,51 +887,24 @@ hb_font_funcs_set_##name##_func (hb_font_funcs_t *ffuncs, \ void *user_data, \ hb_destroy_func_t destroy) \ { \ - if (hb_object_is_immutable (ffuncs)) \ - goto fail; \ - \ - if (!func) \ - { \ - if (destroy) \ - destroy (user_data); \ - destroy = nullptr; \ - user_data = nullptr; \ - } \ + if (!_hb_font_funcs_set_preamble (ffuncs, !func, &user_data, &destroy))\ + return; \ \ if (ffuncs->destroy && ffuncs->destroy->name) \ ffuncs->destroy->name (!ffuncs->user_data ? nullptr : ffuncs->user_data->name); \ \ - if (user_data && !ffuncs->user_data) \ - { \ - ffuncs->user_data = (decltype (ffuncs->user_data)) hb_calloc (1, sizeof (*ffuncs->user_data)); \ - if (unlikely (!ffuncs->user_data)) \ - goto fail; \ - } \ - if (destroy && !ffuncs->destroy) \ - { \ - ffuncs->destroy = (decltype (ffuncs->destroy)) hb_calloc (1, sizeof (*ffuncs->destroy)); \ - if (unlikely (!ffuncs->destroy)) \ - goto fail; \ - } \ + if (!_hb_font_funcs_set_middle (ffuncs, user_data, destroy)) \ + return; \ \ - if (func) { \ + if (func) \ ffuncs->get.f.name = func; \ - if (ffuncs->user_data) \ - ffuncs->user_data->name = user_data; \ - if (ffuncs->destroy) \ - ffuncs->destroy->name = destroy; \ - } else { \ + else \ ffuncs->get.f.name = hb_font_get_##name##_default; \ - if (ffuncs->user_data) \ - ffuncs->user_data->name = nullptr; \ - if (ffuncs->destroy) \ - ffuncs->destroy->name = nullptr; \ - } \ - return; \ - \ -fail: \ - if (destroy) \ - destroy (user_data); \ + \ + if (ffuncs->user_data) \ + ffuncs->user_data->name = user_data; \ + if (ffuncs->destroy) \ + ffuncs->destroy->name = destroy; \ } HB_FONT_FUNCS_IMPLEMENT_CALLBACKS @@ -1323,7 +1353,7 @@ hb_font_get_glyph_from_name (hb_font_t *font, * @draw_data: User data to pass to draw callbacks * * Fetches the glyph shape that corresponds to a glyph in the specified @font. - * The shape is returned by way of calls to the callsbacks of the @dfuncs + * The shape is returned by way of calls to the callbacks of the @dfuncs * objects, with @draw_data passed to them. * * Since: 4.0.0 @@ -1780,8 +1810,8 @@ hb_font_create_sub_font (hb_font_t *parent) float *design_coords = (float *) hb_calloc (num_coords, sizeof (parent->design_coords[0])); if (likely (coords && design_coords)) { - memcpy (coords, parent->coords, num_coords * sizeof (parent->coords[0])); - memcpy (design_coords, parent->design_coords, num_coords * sizeof (parent->design_coords[0])); + hb_memcpy (coords, parent->coords, num_coords * sizeof (parent->coords[0])); + hb_memcpy (design_coords, parent->design_coords, num_coords * sizeof (parent->design_coords[0])); _hb_font_adopt_var_coords (font, coords, design_coords, num_coords); } else @@ -2443,7 +2473,7 @@ hb_font_set_var_coords_design (hb_font_t *font, } if (coords_length) - memcpy (design_coords, coords, coords_length * sizeof (font->design_coords[0])); + hb_memcpy (design_coords, coords, coords_length * sizeof (font->design_coords[0])); hb_ot_var_normalize_coords (font->face, coords_length, coords, normalized); _hb_font_adopt_var_coords (font, normalized, design_coords, coords_length); @@ -2519,8 +2549,8 @@ hb_font_set_var_coords_normalized (hb_font_t *font, if (coords_length) { - memcpy (copy, coords, coords_length * sizeof (coords[0])); - memcpy (unmapped, coords, coords_length * sizeof (coords[0])); + hb_memcpy (copy, coords, coords_length * sizeof (coords[0])); + hb_memcpy (unmapped, coords, coords_length * sizeof (coords[0])); } /* Best effort design coords simulation */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.hh index bb402e23eb4..6942d99c70a 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.hh @@ -206,14 +206,14 @@ struct hb_font_t hb_bool_t get_font_h_extents (hb_font_extents_t *extents) { - memset (extents, 0, sizeof (*extents)); + hb_memset (extents, 0, sizeof (*extents)); return klass->get.f.font_h_extents (this, user_data, extents, !klass->user_data ? nullptr : klass->user_data->font_h_extents); } hb_bool_t get_font_v_extents (hb_font_extents_t *extents) { - memset (extents, 0, sizeof (*extents)); + hb_memset (extents, 0, sizeof (*extents)); return klass->get.f.font_v_extents (this, user_data, extents, !klass->user_data ? nullptr : klass->user_data->font_v_extents); @@ -342,7 +342,7 @@ struct hb_font_t hb_bool_t get_glyph_extents (hb_codepoint_t glyph, hb_glyph_extents_t *extents) { - memset (extents, 0, sizeof (*extents)); + hb_memset (extents, 0, sizeof (*extents)); return klass->get.f.glyph_extents (this, user_data, glyph, extents, diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc index bcc1dd080f5..3892dedc133 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc @@ -89,7 +89,7 @@ struct hb_ft_font_t bool unref; /* Whether to destroy ft_face when done. */ bool transform; /* Whether to apply FT_Face's transform. */ - mutable hb_mutex_t lock; + mutable hb_mutex_t lock; /* Protects members below. */ FT_Face ft_face; mutable unsigned cached_serial; mutable hb_ft_advance_cache_t advance_cache; @@ -732,16 +732,18 @@ hb_ft_get_font_h_extents (hb_font_t *font HB_UNUSED, static int _hb_ft_move_to (const FT_Vector *to, - hb_draw_session_t *drawing) + void *arg) { + hb_draw_session_t *drawing = (hb_draw_session_t *) arg; drawing->move_to (to->x, to->y); return FT_Err_Ok; } static int _hb_ft_line_to (const FT_Vector *to, - hb_draw_session_t *drawing) + void *arg) { + hb_draw_session_t *drawing = (hb_draw_session_t *) arg; drawing->line_to (to->x, to->y); return FT_Err_Ok; } @@ -749,8 +751,9 @@ _hb_ft_line_to (const FT_Vector *to, static int _hb_ft_conic_to (const FT_Vector *control, const FT_Vector *to, - hb_draw_session_t *drawing) + void *arg) { + hb_draw_session_t *drawing = (hb_draw_session_t *) arg; drawing->quadratic_to (control->x, control->y, to->x, to->y); return FT_Err_Ok; @@ -760,8 +763,9 @@ static int _hb_ft_cubic_to (const FT_Vector *control1, const FT_Vector *control2, const FT_Vector *to, - hb_draw_session_t *drawing) + void *arg) { + hb_draw_session_t *drawing = (hb_draw_session_t *) arg; drawing->cubic_to (control1->x, control1->y, control2->x, control2->y, to->x, to->y); @@ -787,10 +791,10 @@ hb_ft_get_glyph_shape (hb_font_t *font HB_UNUSED, return; const FT_Outline_Funcs outline_funcs = { - (FT_Outline_MoveToFunc) _hb_ft_move_to, - (FT_Outline_LineToFunc) _hb_ft_line_to, - (FT_Outline_ConicToFunc) _hb_ft_conic_to, - (FT_Outline_CubicToFunc) _hb_ft_cubic_to, + _hb_ft_move_to, + _hb_ft_line_to, + _hb_ft_conic_to, + _hb_ft_cubic_to, 0, /* shift */ 0, /* delta */ }; @@ -975,8 +979,9 @@ hb_ft_face_create_referenced (FT_Face ft_face) } static void -hb_ft_face_finalize (FT_Face ft_face) +hb_ft_face_finalize (void *arg) { + FT_Face ft_face = (FT_Face) arg; hb_face_destroy ((hb_face_t *) ft_face->generic.data); } @@ -1008,7 +1013,7 @@ hb_ft_face_create_cached (FT_Face ft_face) ft_face->generic.finalizer (ft_face); ft_face->generic.data = hb_ft_face_create (ft_face, nullptr); - ft_face->generic.finalizer = (FT_Generic_Finalizer) hb_ft_face_finalize; + ft_face->generic.finalizer = hb_ft_face_finalize; } return hb_face_reference ((hb_face_t *) ft_face->generic.data); @@ -1217,8 +1222,9 @@ get_ft_library () } static void -_release_blob (FT_Face ft_face) +_release_blob (void *arg) { + FT_Face ft_face = (FT_Face) arg; hb_blob_destroy ((hb_blob_t *) ft_face->generic.data); } @@ -1271,7 +1277,7 @@ hb_ft_font_set_funcs (hb_font_t *font) ft_face->generic.data = blob; - ft_face->generic.finalizer = (FT_Generic_Finalizer) _release_blob; + ft_face->generic.finalizer = _release_blob; _hb_ft_font_set_funcs (font, ft_face, true); hb_ft_font_set_load_flags (font, FT_LOAD_DEFAULT | FT_LOAD_NO_HINTING); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-glib.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-glib.cc index 8ddc7ebad8f..1da81696e75 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-glib.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-glib.cc @@ -129,32 +129,9 @@ hb_glib_unicode_compose (hb_unicode_funcs_t *ufuncs HB_UNUSED, { #if GLIB_CHECK_VERSION(2,29,12) return g_unichar_compose (a, b, ab); +#else + return false; #endif - - /* We don't ifdef-out the fallback code such that compiler always - * sees it and makes sure it's compilable. */ - - gchar utf8[12]; - gchar *normalized; - int len; - hb_bool_t ret; - - len = g_unichar_to_utf8 (a, utf8); - len += g_unichar_to_utf8 (b, utf8 + len); - normalized = g_utf8_normalize (utf8, len, G_NORMALIZE_NFC); - len = g_utf8_strlen (normalized, -1); - if (unlikely (!len)) - return false; - - if (len == 1) { - *ab = g_utf8_get_char (normalized); - ret = true; - } else { - ret = false; - } - - g_free (normalized); - return ret; } static hb_bool_t @@ -166,55 +143,9 @@ hb_glib_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED, { #if GLIB_CHECK_VERSION(2,29,12) return g_unichar_decompose (ab, a, b); +#else + return false; #endif - - /* We don't ifdef-out the fallback code such that compiler always - * sees it and makes sure it's compilable. */ - - gchar utf8[6]; - gchar *normalized; - int len; - hb_bool_t ret; - - len = g_unichar_to_utf8 (ab, utf8); - normalized = g_utf8_normalize (utf8, len, G_NORMALIZE_NFD); - len = g_utf8_strlen (normalized, -1); - if (unlikely (!len)) - return false; - - if (len == 1) { - *a = g_utf8_get_char (normalized); - *b = 0; - ret = *a != ab; - } else if (len == 2) { - *a = g_utf8_get_char (normalized); - *b = g_utf8_get_char (g_utf8_next_char (normalized)); - /* Here's the ugly part: if ab decomposes to a single character and - * that character decomposes again, we have to detect that and undo - * the second part :-(. */ - gchar *recomposed = g_utf8_normalize (normalized, -1, G_NORMALIZE_NFC); - hb_codepoint_t c = g_utf8_get_char (recomposed); - if (c != ab && c != *a) { - *a = c; - *b = 0; - } - g_free (recomposed); - ret = true; - } else { - /* If decomposed to more than two characters, take the last one, - * and recompose the rest to get the first component. */ - gchar *end = g_utf8_offset_to_pointer (normalized, len - 1); - gchar *recomposed; - *b = g_utf8_get_char (end); - recomposed = g_utf8_normalize (normalized, end - normalized, G_NORMALIZE_NFC); - /* We expect that recomposed has exactly one character now. */ - *a = g_utf8_get_char (recomposed); - g_free (recomposed); - ret = true; - } - - g_free (normalized); - return ret; } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.cc index 4d0e687c755..9e068f8d84d 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.cc @@ -318,7 +318,7 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan HB_UNUSED, #undef ALLOCATE_ARRAY - memset (clusters, 0, sizeof (clusters[0]) * buffer->len); + hb_memset (clusters, 0, sizeof (clusters[0]) * buffer->len); hb_codepoint_t *pg = gids; clusters[0].cluster = buffer->info[0].cluster; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-iter.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-iter.hh index 1a3ab43de03..b57f37b1322 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-iter.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-iter.hh @@ -73,8 +73,10 @@ struct hb_iter_t /* Operators. */ iter_t iter () const { return *thiz(); } iter_t operator + () const { return *thiz(); } - iter_t begin () const { return *thiz(); } - iter_t end () const { return thiz()->__end__ (); } + iter_t _begin () const { return *thiz(); } + iter_t begin () const { return _begin (); } + iter_t _end () const { return thiz()->__end__ (); } + iter_t end () const { return _end (); } explicit operator bool () const { return thiz()->__more__ (); } unsigned len () const { return thiz()->__len__ (); } /* The following can only be enabled if item_t is reference type. Otherwise @@ -118,7 +120,9 @@ struct hb_iter_t #define HB_ITER_USING(Name) \ using item_t = typename Name::item_t; \ + using Name::_begin; \ using Name::begin; \ + using Name::_end; \ using Name::end; \ using Name::get_item_size; \ using Name::is_iterator; \ @@ -377,7 +381,7 @@ struct hb_map_iter_t : void __forward__ (unsigned n) { it += n; } void __prev__ () { --it; } void __rewind__ (unsigned n) { it -= n; } - hb_map_iter_t __end__ () const { return hb_map_iter_t (it.end (), f); } + hb_map_iter_t __end__ () const { return hb_map_iter_t (it._end (), f); } bool operator != (const hb_map_iter_t& o) const { return it != o.it; } @@ -440,7 +444,7 @@ struct hb_filter_iter_t : bool __more__ () const { return bool (it); } void __next__ () { do ++it; while (it && !hb_has (p.get (), hb_get (f.get (), *it))); } void __prev__ () { do --it; while (it && !hb_has (p.get (), hb_get (f.get (), *it))); } - hb_filter_iter_t __end__ () const { return hb_filter_iter_t (it.end (), p, f); } + hb_filter_iter_t __end__ () const { return hb_filter_iter_t (it._end (), p, f); } bool operator != (const hb_filter_iter_t& o) const { return it != o.it; } @@ -553,7 +557,7 @@ struct hb_zip_iter_t : void __forward__ (unsigned n) { a += n; b += n; } void __prev__ () { --a; --b; } void __rewind__ (unsigned n) { a -= n; b -= n; } - hb_zip_iter_t __end__ () const { return hb_zip_iter_t (a.end (), b.end ()); } + hb_zip_iter_t __end__ () const { return hb_zip_iter_t (a._end (), b._end ()); } /* Note, we should stop if ANY of the iters reaches end. As such two compare * unequal if both items are unequal, NOT if either is unequal. */ bool operator != (const hb_zip_iter_t& o) const @@ -637,7 +641,7 @@ struct hb_concat_iter_t : } } - hb_concat_iter_t __end__ () const { return hb_concat_iter_t (a.end (), b.end ()); } + hb_concat_iter_t __end__ () const { return hb_concat_iter_t (a._end (), b._end ()); } bool operator != (const hb_concat_iter_t& o) const { return a != o.a diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-machinery.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-machinery.hh index 2571f22e154..b555739cfb6 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-machinery.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-machinery.hh @@ -136,6 +136,13 @@ static inline Type& StructAfter(TObject &X) /* * Lazy loaders. + * + * The lazy-loaders are thread-safe pointer-like objects that create their + * instead on-demand. They also support access to a "data" object that is + * necessary for creating their instance. The data object, if specified, + * is accessed via pointer math, located at a location before the position + * of the loader itself. This avoids having to store a pointer to data + * for every lazy-loader. Multiple lazy-loaders can access the same data. */ template @@ -228,7 +235,8 @@ struct hb_lazy_loader_t : hb_data_wrapper_t bool cmpexch (Stored *current, Stored *value) const { - /* This *must* be called when there are no other threads accessing. */ + /* This function can only be safely called directly if no + * other thread is accessing. */ return this->instance.cmpexch (current, value); } @@ -261,7 +269,7 @@ struct hb_lazy_loader_t : hb_data_wrapper_t hb_free (p); } -// private: + private: /* Must only have one pointer. */ hb_atomic_ptr_t instance; }; @@ -283,7 +291,7 @@ struct hb_table_lazy_loader_t : hb_lazy_loader_t (face); } static void destroy (hb_blob_t *p) { hb_blob_destroy (p); } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-map.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-map.hh index 8302e3f8c7a..bfb1b3f7680 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-map.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-map.hh @@ -43,9 +43,9 @@ struct hb_hashmap_t hb_hashmap_t () { init (); } ~hb_hashmap_t () { fini (); } - hb_hashmap_t (const hb_hashmap_t& o) : hb_hashmap_t () { resize (population); hb_copy (o, *this); } + hb_hashmap_t (const hb_hashmap_t& o) : hb_hashmap_t () { resize (o.population); hb_copy (o, *this); } hb_hashmap_t (hb_hashmap_t&& o) : hb_hashmap_t () { hb_swap (*this, o); } - hb_hashmap_t& operator= (const hb_hashmap_t& o) { resize (population); hb_copy (o, *this); return *this; } + hb_hashmap_t& operator= (const hb_hashmap_t& o) { reset (); resize (o.population); hb_copy (o, *this); return *this; } hb_hashmap_t& operator= (hb_hashmap_t&& o) { hb_swap (*this, o); return *this; } hb_hashmap_t (std::initializer_list> lst) : hb_hashmap_t () @@ -71,6 +71,11 @@ struct hb_hashmap_t uint32_t is_tombstone_ : 1; V value; + item_t () : key (), + hash (0), + is_used_ (false), is_tombstone_ (false), + value () {} + bool is_used () const { return is_used_; } void set_used (bool is_used) { is_used_ = is_used; } bool is_tombstone () const { return is_tombstone_; } @@ -88,17 +93,8 @@ struct hb_hashmap_t return minus_1; }; - void clear () - { - new (std::addressof (key)) K (); - new (std::addressof (value)) V (); - hash = 0; - is_used_ = false; - is_tombstone_ = false; - } - - bool operator == (const K &o) { return hb_deref (key) == hb_deref (o); } - bool operator == (const item_t &o) { return *this == o.key; } + bool operator == (const K &o) const { return hb_deref (key) == hb_deref (o); } + bool operator == (const item_t &o) const { return *this == o.key; } hb_pair_t get_pair() const { return hb_pair_t (key, value); } hb_pair_t get_pair_ref() const { return hb_pair_t (key, value); } @@ -107,8 +103,8 @@ struct hb_hashmap_t }; hb_object_header_t header; - bool successful; /* Allocations successful */ - unsigned int population; /* Not including tombstones. */ + unsigned int successful : 1; /* Allocations successful */ + unsigned int population : 31; /* Not including tombstones. */ unsigned int occupancy; /* Including tombstones. */ unsigned int mask; unsigned int prime; @@ -118,7 +114,10 @@ struct hb_hashmap_t { if (unlikely (!a.successful || !b.successful)) return; - hb_swap (a.population, b.population); + unsigned tmp = a.population; + a.population = b.population; + b.population = tmp; + //hb_swap (a.population, b.population); hb_swap (a.occupancy, b.occupancy); hb_swap (a.mask, b.mask); hb_swap (a.prime, b.prime); @@ -160,7 +159,9 @@ struct hb_hashmap_t { if (unlikely (!successful)) return false; - unsigned int power = hb_bit_storage (hb_max (population, new_population) * 2 + 8); + if (new_population != 0 && (new_population + new_population / 2) < mask) return true; + + unsigned int power = hb_bit_storage (hb_max ((unsigned) population, new_population) * 2 + 8); unsigned int new_size = 1u << power; item_t *new_items = (item_t *) hb_malloc ((size_t) new_size * sizeof (item_t)); if (unlikely (!new_items)) @@ -169,9 +170,9 @@ struct hb_hashmap_t return false; } for (auto &_ : hb_iter (new_items, new_size)) - _.clear (); + new (&_) item_t (); - unsigned int old_size = mask + 1; + unsigned int old_size = size (); item_t *old_items = items; /* Switch to new, empty, array. */ @@ -181,47 +182,82 @@ struct hb_hashmap_t items = new_items; /* Insert back old items. */ - if (old_items) - for (unsigned int i = 0; i < old_size; i++) + for (unsigned int i = 0; i < old_size; i++) + { + if (old_items[i].is_real ()) { - if (old_items[i].is_real ()) - { - set_with_hash (old_items[i].key, - old_items[i].hash, - std::move (old_items[i].value)); - } - old_items[i].~item_t (); + set_with_hash (std::move (old_items[i].key), + old_items[i].hash, + std::move (old_items[i].value)); } + old_items[i].~item_t (); + } hb_free (old_items); return true; } + template + bool set_with_hash (KK&& key, uint32_t hash, VV&& value, bool is_delete=false) + { + if (unlikely (!successful)) return false; + if (unlikely ((occupancy + occupancy / 2) >= mask && !resize ())) return false; + item_t &item = item_for_hash (key, hash); + + if (is_delete && !(item == key)) + return true; /* Trying to delete non-existent key. */ + + if (item.is_used ()) + { + occupancy--; + if (!item.is_tombstone ()) + population--; + } + + item.key = std::forward (key); + item.value = std::forward (value); + item.hash = hash; + item.set_used (true); + item.set_tombstone (is_delete); + + occupancy++; + if (!is_delete) + population++; + + return true; + } + + template + bool set (const K &key, VV&& value) { return set_with_hash (key, hb_hash (key), std::forward (value)); } template - bool set (K key, VV&& value) { return set_with_hash (key, hb_hash (key), std::forward (value)); } + bool set (K &&key, VV&& value) { return set_with_hash (std::move (key), hb_hash (key), std::forward (value)); } - const V& get (K key) const + const V& get_with_hash (const K &key, uint32_t hash) const + { + if (unlikely (!items)) return item_t::default_value (); + auto &item = item_for_hash (key, hash); + return item.is_real () && item == key ? item.value : item_t::default_value (); + } + const V& get (const K &key) const { if (unlikely (!items)) return item_t::default_value (); - unsigned int i = bucket_for (key); - return items[i].is_real () && items[i] == key ? items[i].value : item_t::default_value (); + return get_with_hash (key, hb_hash (key)); } - void del (K key) { set_with_hash (key, hb_hash (key), item_t::default_value (), true); } + void del (const K &key) { set_with_hash (key, hb_hash (key), item_t::default_value (), true); } /* Has interface. */ - typedef const V& value_t; - value_t operator [] (K k) const { return get (k); } + const V& operator [] (K k) const { return get (k); } template bool has (K key, VV **vp = nullptr) const { if (unlikely (!items)) return false; - unsigned int i = bucket_for (key); - if (items[i].is_real () && items[i] == key) + auto &item = item_for_hash (key, hb_hash (key)); + if (item.is_real () && item == key) { - if (vp) *vp = &items[i].value; + if (vp) *vp = std::addressof (item.value); return true; } else @@ -230,13 +266,18 @@ struct hb_hashmap_t /* Projection. */ V operator () (K k) const { return get (k); } + unsigned size () const { return mask ? mask + 1 : 0; } + void clear () { if (unlikely (!successful)) return; - if (items) - for (auto &_ : hb_iter (items, mask + 1)) - _.clear (); + for (auto &_ : hb_iter (items, size ())) + { + /* Reconstruct items. */ + _.~item_t (); + new (&_) item_t (); + } population = occupancy = 0; } @@ -246,11 +287,10 @@ struct hb_hashmap_t uint32_t hash () const { - uint32_t h = 0; - for (const auto &item : + hb_array (items, mask ? mask + 1 : 0) - | hb_filter (&item_t::is_real)) - h ^= item.total_hash (); - return h; + return + + iter_items () + | hb_reduce ([] (uint32_t h, const item_t &_) { return h ^ _.total_hash (); }, (uint32_t) 0u) + ; } bool is_equal (const hb_hashmap_t &other) const @@ -258,7 +298,7 @@ struct hb_hashmap_t if (population != other.population) return false; for (auto pair : iter ()) - if (get (pair.first) != pair.second) + if (other.get (pair.first) != pair.second) return false; return true; @@ -271,87 +311,54 @@ struct hb_hashmap_t /* * Iterator */ - auto iter () const HB_AUTO_RETURN + + auto iter_items () const HB_AUTO_RETURN ( - + hb_array (items, mask ? mask + 1 : 0) + + hb_iter (items, size ()) | hb_filter (&item_t::is_real) - | hb_map (&item_t::get_pair) ) auto iter_ref () const HB_AUTO_RETURN ( - + hb_array (items, mask ? mask + 1 : 0) - | hb_filter (&item_t::is_real) + + iter_items () | hb_map (&item_t::get_pair_ref) ) - auto keys () const HB_AUTO_RETURN + auto iter () const HB_AUTO_RETURN ( - + hb_array (items, mask ? mask + 1 : 0) - | hb_filter (&item_t::is_real) - | hb_map (&item_t::key) - | hb_map (hb_ridentity) + + iter_items () + | hb_map (&item_t::get_pair) ) auto keys_ref () const HB_AUTO_RETURN ( - + hb_array (items, mask ? mask + 1 : 0) - | hb_filter (&item_t::is_real) + + iter_items () | hb_map (&item_t::key) ) - auto values () const HB_AUTO_RETURN + auto keys () const HB_AUTO_RETURN ( - + hb_array (items, mask ? mask + 1 : 0) - | hb_filter (&item_t::is_real) - | hb_map (&item_t::value) + + keys_ref () | hb_map (hb_ridentity) ) auto values_ref () const HB_AUTO_RETURN ( - + hb_array (items, mask ? mask + 1 : 0) - | hb_filter (&item_t::is_real) + + iter_items () | hb_map (&item_t::value) ) + auto values () const HB_AUTO_RETURN + ( + + values_ref () + | hb_map (hb_ridentity) + ) /* Sink interface. */ hb_hashmap_t& operator << (const hb_pair_t& v) { set (v.first, v.second); return *this; } - - protected: - - template - bool set_with_hash (K key, uint32_t hash, VV&& value, bool is_delete=false) - { - if (unlikely (!successful)) return false; - if (unlikely ((occupancy + occupancy / 2) >= mask && !resize ())) return false; - unsigned int i = bucket_for_hash (key, hash); - - if (is_delete && items[i].key != key) - return true; /* Trying to delete non-existent key. */ - - if (items[i].is_used ()) - { - occupancy--; - if (!items[i].is_tombstone ()) - population--; - } - - items[i].key = key; - items[i].value = std::forward (value); - items[i].hash = hash; - items[i].set_used (true); - items[i].set_tombstone (is_delete); - - occupancy++; - if (!is_delete) - population++; - - return true; - } - - unsigned int bucket_for (const K &key) const - { - return bucket_for_hash (key, hb_hash (key)); - } - - unsigned int bucket_for_hash (const K &key, uint32_t hash) const + hb_hashmap_t& operator << (const hb_pair_t& v) + { set (v.first, std::move (v.second)); return *this; } + hb_hashmap_t& operator << (const hb_pair_t& v) + { set (std::move (v.first), v.second); return *this; } + hb_hashmap_t& operator << (const hb_pair_t& v) + { set (std::move (v.first), std::move (v.second)); return *this; } + + item_t& item_for_hash (const K &key, uint32_t hash) const { hash &= 0x3FFFFFFF; // We only store lower 30bit of hash unsigned int i = hash % prime; @@ -360,12 +367,12 @@ struct hb_hashmap_t while (items[i].is_used ()) { if (items[i].hash == hash && items[i] == key) - return i; + return items[i]; if (tombstone == (unsigned) -1 && items[i].is_tombstone ()) tombstone = i; i = (i + ++step) & mask; } - return tombstone == (unsigned) -1 ? i : tombstone; + return items[tombstone == (unsigned) -1 ? i : tombstone]; } static unsigned int prime_for (unsigned int shift) diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-meta.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-meta.hh index 52a6791e313..31aa7fa6f16 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-meta.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-meta.hh @@ -112,8 +112,7 @@ template auto _hb_try_add_pointer (hb_priority<1>) -> hb_type_ident template using hb_add_pointer = decltype (_hb_try_add_pointer (hb_prioritize)); -/* TODO Add feature-parity to std::decay. */ -template using hb_decay = hb_remove_const>; +template using hb_decay = typename std::decay::type; #define hb_is_convertible(From,To) std::is_convertible::value diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ms-feature-ranges.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ms-feature-ranges.hh index d40fdeaa824..46a20c91eab 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ms-feature-ranges.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ms-feature-ranges.hh @@ -166,7 +166,7 @@ hb_ms_setup_features (const hb_feature_t *features, { auto *feature = active_features.lsearch (event->feature); if (feature) - active_features.remove (feature - active_features.arrayZ); + active_features.remove_ordered (feature - active_features.arrayZ); } } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-multimap.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-multimap.hh new file mode 100644 index 00000000000..f0f95917aaa --- /dev/null +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-multimap.hh @@ -0,0 +1,92 @@ +/* + * Copyright © 2022 Behdad Esfahbod + * + * 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_MULTIMAP_HH +#define HB_MULTIMAP_HH + +#include "hb.hh" +#include "hb-map.hh" +#include "hb-vector.hh" + + +/* + * hb_multimap_t + */ + +struct hb_multimap_t +{ + void add (hb_codepoint_t k, hb_codepoint_t v) + { + hb_codepoint_t *i; + if (multiples_indices.has (k, &i)) + { + multiples_values[*i].push (v); + return; + } + + hb_codepoint_t *old_v; + if (singulars.has (k, &old_v)) + { + hb_codepoint_t old = *old_v; + singulars.del (k); + + multiples_indices.set (k, multiples_values.length); + auto *vec = multiples_values.push (); + + vec->push (old); + vec->push (v); + + return; + } + + singulars.set (k, v); + } + + hb_array_t get (hb_codepoint_t k) const + { + hb_codepoint_t *v; + if (singulars.has (k, &v)) + return hb_array (v, 1); + + hb_codepoint_t *i; + if (multiples_indices.has (k, &i)) + return multiples_values[*i].as_array (); + + return hb_array_t (); + } + + bool in_error () const + { + return singulars.in_error () || multiples_indices.in_error () || multiples_values.in_error (); + } + + protected: + hb_map_t singulars; + hb_map_t multiples_indices; + hb_vector_t> multiples_values; +}; + + + +#endif /* HB_MULTIMAP_HH */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-mutex.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-mutex.hh index 6914b224502..053f9ddcc4f 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-mutex.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-mutex.hh @@ -108,10 +108,11 @@ struct hb_mutex_t struct hb_lock_t { - hb_lock_t (hb_mutex_t &mutex_) : mutex (mutex_) { mutex.lock (); } - ~hb_lock_t () { mutex.unlock (); } + hb_lock_t (hb_mutex_t &mutex_) : mutex (&mutex_) { mutex->lock (); } + hb_lock_t (hb_mutex_t *mutex_) : mutex (mutex_) { if (mutex) mutex->lock (); } + ~hb_lock_t () { if (mutex) mutex->unlock (); } private: - hb_mutex_t &mutex; + hb_mutex_t *mutex; }; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-number-parser.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-number-parser.hh index 1a9dbba6dd3..ec68c3a7281 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-number-parser.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-number-parser.hh @@ -31,7 +31,7 @@ #include "hb.hh" -#line 35 "hb-number-parser.hh" +#line 32 "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 @@ -135,12 +135,12 @@ strtod_rl (const char *p, const char **end_ptr /* IN/OUT */) int cs; -#line 139 "hb-number-parser.hh" +#line 132 "hb-number-parser.hh" { cs = double_parser_start; } -#line 144 "hb-number-parser.hh" +#line 135 "hb-number-parser.hh" { int _slen; int _trans; @@ -198,7 +198,7 @@ _resume: exp_overflow = true; } break; -#line 202 "hb-number-parser.hh" +#line 187 "hb-number-parser.hh" } _again: diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-object.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-object.hh index 9876c2923cf..a23c25f7ca4 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-object.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-object.hh @@ -80,7 +80,7 @@ struct hb_lockable_set_t if (item) { item_t old = *item; - *item = items[items.length - 1]; + *item = std::move (items.tail ()); items.pop (); l.unlock (); old.fini (); @@ -123,7 +123,7 @@ struct hb_lockable_set_t l.lock (); while (items.length) { - item_t old = items[items.length - 1]; + item_t old = items.tail (); items.pop (); l.unlock (); old.fini (); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-file.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-file.hh index 6eee5827c18..13570a46e0c 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-file.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-file.hh @@ -90,7 +90,7 @@ typedef struct OpenTypeOffsetTable { if (table_count) { - + tables.sub_array (start_offset, table_count) + + tables.as_array ().sub_array (start_offset, table_count) | hb_map (&TableRecord::tag) | hb_sink (hb_array (table_tags, *table_count)) ; @@ -158,7 +158,7 @@ typedef struct OpenTypeOffsetTable return_trace (false); if (likely (len)) - memcpy (start, blob->data, len); + hb_memcpy (start, blob->data, len); /* 4-byte alignment. */ c->align (4); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-type.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-type.hh index e66f4518207..290799127af 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-type.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-type.hh @@ -148,7 +148,7 @@ struct HBFixed : Type static_assert (Type::static_size * 8 > fraction_bits, ""); HBFixed& operator = (typename Type::type i ) { Type::operator= (i); return *this; } - float to_float () const { return ((int32_t) Type::v) / shift; } + float to_float (float offset = 0) const { return ((int32_t) Type::v + offset) / shift; } void set_float (float f) { Type::v = roundf (f * shift); } public: DEFINE_SIZE_STATIC (Type::static_size); @@ -157,6 +157,9 @@ struct HBFixed : Type /* 16-bit signed fixed number with the low 14 bits of fraction (2.14). */ using F2DOT14 = HBFixed; +/* 16-bit signed fixed number with the low 12 bits of fraction (4.12). */ +using F4DOT12 = HBFixed; + /* 32-bit signed fixed-point number (16.16). */ using F16DOT16 = HBFixed; @@ -209,6 +212,12 @@ typedef Index NameID; struct VarIdx : HBUINT32 { static constexpr unsigned NO_VARIATION = 0xFFFFFFFFu; + static_assert (NO_VARIATION == HB_OT_LAYOUT_NO_VARIATIONS_INDEX, ""); + static uint32_t add (uint32_t i, unsigned short v) + { + if (i == NO_VARIATION) return i; + return i + v; + } VarIdx& operator = (uint32_t i) { HBUINT32::operator= (i); return *this; } }; DECLARE_NULL_NAMESPACE_BYTES (OT, VarIdx); @@ -493,10 +502,10 @@ struct UnsizedArrayOf void qsort (unsigned int len, unsigned int start = 0, unsigned int end = (unsigned int) -1) { as_array (len).qsort (start, end); } - bool serialize (hb_serialize_context_t *c, unsigned int items_len) + bool serialize (hb_serialize_context_t *c, unsigned int items_len, bool clear = true) { TRACE_SERIALIZE (this); - if (unlikely (!c->extend (this, items_len))) return_trace (false); + if (unlikely (!c->extend_size (this, get_size (items_len), clear))) return_trace (false); return_trace (true); } template sub_array (unsigned int start_offset, unsigned int count) const - { 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); } - hb_array_t sub_array (unsigned int start_offset, unsigned int 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); } + /* Faster range-based for loop. */ + const Type *begin () const { return arrayZ; } + const Type *end () const { return arrayZ + len; } template Type &lsearch (const T &x, Type ¬_found = Crap (Type)) @@ -667,15 +671,15 @@ struct ArrayOf unsigned int to_store = (unsigned int) -1) const { return as_array ().lfind (x, i, not_found, to_store); } - void qsort (unsigned int start = 0, unsigned int end = (unsigned int) -1) - { as_array ().qsort (start, end); } + void qsort () + { as_array ().qsort (); } - HB_NODISCARD bool serialize (hb_serialize_context_t *c, unsigned items_len) + HB_NODISCARD bool serialize (hb_serialize_context_t *c, unsigned items_len, bool clear = true) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (this))) return_trace (false); c->check_assign (len, items_len, HB_SERIALIZE_ERROR_ARRAY_OVERFLOW); - if (unlikely (!c->extend (this))) return_trace (false); + if (unlikely (!c->extend_size (this, get_size (), clear))) return_trace (false); return_trace (true); } template extend_min (this))) return_trace (false); c->check_assign (lenP1, items_len + 1, HB_SERIALIZE_ERROR_ARRAY_OVERFLOW); - if (unlikely (!c->extend (this))) return_trace (false); + if (unlikely (!c->extend_size (this, get_size (), clear))) return_trace (false); return_trace (true); } template - bool serialize (hb_serialize_context_t *c, Iterator items) + HB_NODISCARD bool serialize (hb_serialize_context_t *c, Iterator items) { TRACE_SERIALIZE (this); - unsigned count = items.len (); - if (unlikely (!serialize (c, count))) return_trace (false); + unsigned count = hb_len (items); + if (unlikely (!serialize (c, count, false))) return_trace (false); /* TODO Umm. Just exhaust the iterator instead? Being extra * cautious right now.. */ for (unsigned i = 0; i < count; i++, ++items) @@ -944,14 +952,9 @@ struct SortedArrayOf : ArrayOf operator iter_t () const { return iter (); } 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); } - 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); } - hb_sorted_array_t sub_array (unsigned int start_offset, unsigned int 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); } + /* Faster range-based for loop. */ + const Type *begin () const { return this->arrayZ; } + const Type *end () const { return this->arrayZ + this->len; } bool serialize (hb_serialize_context_t *c, unsigned int items_len) { 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 ae3b83a2563..f22824fc699 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 @@ -66,95 +66,25 @@ struct CFFIndex { TRACE_SERIALIZE (this); unsigned int size = get_size (); - CFFIndex *out = c->allocate_size (size); + CFFIndex *out = c->allocate_size (size, false); if (likely (out)) - memcpy (out, this, size); + hb_memcpy (out, this, size); return_trace (out); } + template bool serialize (hb_serialize_context_t *c, - unsigned int offSize_, - const byte_str_array_t &byteArray) + const Iterable &iterable) { TRACE_SERIALIZE (this); - - if (byteArray.length == 0) - { - COUNT *dest = c->allocate_min (); - if (unlikely (!dest)) return_trace (false); - *dest = 0; - return_trace (true); - } - - /* serialize CFFIndex header */ - if (unlikely (!c->extend_min (this))) return_trace (false); - this->count = byteArray.length; - this->offSize = offSize_; - if (unlikely (!c->allocate_size (offSize_ * (byteArray.length + 1)))) - return_trace (false); - - /* serialize indices */ - unsigned int offset = 1; - unsigned int i = 0; - for (; i < byteArray.length; i++) - { - set_offset_at (i, offset); - offset += byteArray[i].get_size (); - } - set_offset_at (i, offset); - - /* serialize data */ - for (unsigned int i = 0; i < byteArray.length; i++) - { - const hb_ubytes_t &bs = byteArray[i]; - unsigned char *dest = c->allocate_size (bs.length); - if (unlikely (!dest)) return_trace (false); - memcpy (dest, &bs[0], bs.length); - } - - return_trace (true); - } - - bool serialize (hb_serialize_context_t *c, - unsigned int offSize_, - const str_buff_vec_t &buffArray) - { - byte_str_array_t byteArray; - byteArray.init (); - byteArray.resize (buffArray.length); - for (unsigned int i = 0; i < byteArray.length; i++) - byteArray[i] = hb_ubytes_t (buffArray[i].arrayZ, buffArray[i].length); - bool result = this->serialize (c, offSize_, byteArray); - byteArray.fini (); - return result; - } - - template - bool serialize (hb_serialize_context_t *c, - Iterator it) - { - TRACE_SERIALIZE (this); - serialize_header(c, + it | hb_map ([] (const hb_ubytes_t &_) { return _.length; })); + auto it = hb_iter (iterable); + serialize_header(c, + it | hb_map (hb_iter) | hb_map (hb_len)); for (const auto &_ : +it) - _.copy (c); + hb_iter (_).copy (c); return_trace (true); } - bool serialize (hb_serialize_context_t *c, - const byte_str_array_t &byteArray) - { return serialize (c, + hb_iter (byteArray)); } - - bool serialize (hb_serialize_context_t *c, - const str_buff_vec_t &buffArray) - { - auto it = - + hb_iter (buffArray) - | hb_map ([] (const str_buff_t &_) { return hb_ubytes_t (_.arrayZ, _.length); }) - ; - return serialize (c, it); - } - template bool serialize_header (hb_serialize_context_t *c, @@ -171,7 +101,7 @@ struct CFFIndex if (!this->count) return_trace (true); if (unlikely (!c->extend (this->offSize))) return_trace (false); this->offSize = off_size; - if (unlikely (!c->allocate_size (off_size * (this->count + 1)))) + if (unlikely (!c->allocate_size (off_size * (this->count + 1), false))) return_trace (false); /* serialize indices */ @@ -179,14 +109,27 @@ struct CFFIndex unsigned int i = 0; for (unsigned _ : +it) { - CFFIndex::set_offset_at (i++, offset); + set_offset_at (i++, offset); offset += _; } - CFFIndex::set_offset_at (i, offset); + set_offset_at (i, offset); return_trace (true); } + template + static unsigned total_size (const Iterable &iterable) + { + auto it = + hb_iter (iterable) | hb_map (hb_iter) | hb_map (hb_len); + if (!it) return 0; + + unsigned total = + it | hb_reduce (hb_add, 0); + unsigned off_size = (hb_bit_storage (total + 1) + 7) / 8; + + return min_size + HBUINT8::static_size + (hb_len (it) + 1) * off_size + total; + } + void set_offset_at (unsigned int index, unsigned int offset) { assert (index <= count); @@ -207,10 +150,14 @@ struct CFFIndex unsigned int size = offSize; const HBUINT8 *p = offsets + size * index; - unsigned int offset = 0; - for (; size; size--) - offset = (offset << 8) + *p++; - return offset; + switch (size) + { + case 1: return * (HBUINT8 *) p; + case 2: return * (HBUINT16 *) p; + case 3: return * (HBUINT24 *) p; + case 4: return * (HBUINT32 *) p; + default: return 0; + } } unsigned int length_at (unsigned int index) const @@ -229,6 +176,7 @@ struct CFFIndex hb_ubytes_t operator [] (unsigned int index) const { if (unlikely (index >= count)) return hb_ubytes_t (); + _hb_compiler_memory_r_barrier (); unsigned length = length_at (index); if (unlikely (!length)) return hb_ubytes_t (); return hb_ubytes_t (data_base () + offset_at (index) - 1, length); @@ -280,7 +228,7 @@ struct CFFIndexOf : CFFIndex if (unlikely (!c->extend_min (this))) return_trace (false); this->count = dataArrayLen; this->offSize = offSize_; - if (unlikely (!c->allocate_size (offSize_ * (dataArrayLen + 1)))) + if (unlikely (!c->allocate_size (offSize_ * (dataArrayLen + 1), false))) return_trace (false); /* serialize indices */ @@ -288,10 +236,10 @@ struct CFFIndexOf : CFFIndex unsigned int i = 0; for (; i < dataArrayLen; i++) { - CFFIndex::set_offset_at (i, offset); + this->set_offset_at (i, offset); offset += dataSizeArray[i]; } - CFFIndex::set_offset_at (i, offset); + this->set_offset_at (i, offset); /* serialize data */ for (unsigned int i = 0; i < dataArrayLen; i++) @@ -324,13 +272,12 @@ struct Dict : UnsizedByteStr template static bool serialize_int_op (hb_serialize_context_t *c, op_code_t op, V value, op_code_t intOp) { - // XXX: not sure why but LLVM fails to compile the following 'unlikely' macro invocation - if (/*unlikely*/ (!serialize_int (c, intOp, value))) + if (unlikely ((!serialize_int (c, intOp, value)))) return false; TRACE_SERIALIZE (this); /* serialize the opcode */ - HBUINT8 *p = c->allocate_size (OpCode_Size (op)); + HBUINT8 *p = c->allocate_size (OpCode_Size (op), false); if (unlikely (!p)) return_trace (false); if (Is_OpCode_ESC (op)) { @@ -415,9 +362,8 @@ struct FDSelect0 { TRACE_SANITIZE (this); if (unlikely (!(c->check_struct (this)))) return_trace (false); - for (unsigned int i = 0; i < c->get_num_glyphs (); i++) - if (unlikely (!fds[i].sanitize (c))) - return_trace (false); + if (unlikely (!c->check_array (fds, c->get_num_glyphs ()))) + return_trace (false); return_trace (true); } @@ -471,14 +417,20 @@ struct FDSelect3_4 return_trace (true); } - hb_codepoint_t get_fd (hb_codepoint_t glyph) const + static int _cmp_range (const void *_key, const void *_item) { - unsigned int i; - for (i = 1; i < nRanges (); i++) - if (glyph < ranges[i].first) - break; + hb_codepoint_t glyph = * (hb_codepoint_t *) _key; + FDSelect3_4_Range *range = (FDSelect3_4_Range *) _item; - return (hb_codepoint_t) ranges[i - 1].fd; + if (glyph < range[0].first) return -1; + if (glyph < range[1].first) return 0; + return +1; + } + + hb_codepoint_t get_fd (hb_codepoint_t glyph) const + { + auto *range = hb_bsearch (glyph, &ranges[0], nRanges () - 1, sizeof (ranges[0]), _cmp_range); + return range ? range->fd : ranges[nRanges () - 1].fd; } GID_TYPE &nRanges () { return ranges.len; } @@ -501,9 +453,9 @@ struct FDSelect { TRACE_SERIALIZE (this); unsigned int size = src.get_size (num_glyphs); - FDSelect *dest = c->allocate_size (size); + FDSelect *dest = c->allocate_size (size, false); if (unlikely (!dest)) return_trace (false); - memcpy (dest, &src, size); + hb_memcpy (dest, &src, size); return_trace (true); } 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 17b02966168..bb856c9ddbc 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 @@ -175,7 +175,7 @@ struct Encoding unsigned int size = src.get_size (); Encoding *dest = c->allocate_size (size); if (unlikely (!dest)) return_trace (false); - memcpy (dest, &src, size); + hb_memcpy (dest, &src, size); return_trace (true); } @@ -471,7 +471,7 @@ struct Charset unsigned int size = src.get_size (num_glyphs); Charset *dest = c->allocate_size (size); if (unlikely (!dest)) return_trace (false); - memcpy (dest, &src, size); + hb_memcpy (dest, &src, size); return_trace (true); } @@ -617,7 +617,6 @@ struct CFF1StringIndex : CFF1Index } byte_str_array_t bytesArray; - bytesArray.init (); if (!bytesArray.resize (sidmap.get_population ())) return_trace (false); for (unsigned int i = 0; i < strings.count; i++) @@ -628,7 +627,6 @@ struct CFF1StringIndex : CFF1Index } bool result = CFF1Index::serialize (c, bytesArray); - bytesArray.fini (); return_trace (result); } }; @@ -813,7 +811,7 @@ struct cff1_top_dict_opset_t : top_dict_opset_t break; default: - env.last_offset = env.str_ref.offset; + env.last_offset = env.str_ref.get_offset (); top_dict_opset_t::process_op (op, env, dictval); /* Record this operand below if stack is empty, otherwise done */ if (!env.argStack.is_empty ()) return; @@ -1295,10 +1293,10 @@ struct cff1 } protected: - hb_blob_t *blob = nullptr; hb_sanitize_context_t sc; public: + hb_blob_t *blob = nullptr; const Encoding *encoding = nullptr; const Charset *charset = nullptr; const CFF1NameIndex *nameIndex = nullptr; 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 746160dc8e4..9081930bbeb 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 @@ -56,7 +56,7 @@ struct CFF2FDSelect unsigned int size = src.get_size (num_glyphs); CFF2FDSelect *dest = c->allocate_size (size); if (unlikely (!dest)) return_trace (false); - memcpy (dest, &src, size); + hb_memcpy (dest, &src, size); return_trace (true); } @@ -124,7 +124,7 @@ struct CFF2VariationStore unsigned int size_ = varStore->get_size (); CFF2VariationStore *dest = c->allocate_size (size_); if (unlikely (!dest)) return_trace (false); - memcpy (dest, varStore, size_); + hb_memcpy (dest, varStore, size_); return_trace (true); } @@ -483,13 +483,18 @@ struct cff2 blob = nullptr; } + hb_map_t *create_glyph_to_sid_map () const + { + return nullptr; + } + bool is_valid () const { return blob; } protected: - hb_blob_t *blob = nullptr; hb_sanitize_context_t sc; public: + hb_blob_t *blob = nullptr; cff2_top_dict_values_t topDict; const CFF2Subrs *globalSubrs = nullptr; const CFF2VariationStore *varStore = nullptr; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cmap-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cmap-table.hh index 09c9fe93f32..523196fa797 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cmap-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cmap-table.hh @@ -909,7 +909,7 @@ struct DefaultUVS : SortedArray32Of hb_codepoint_t first = arrayZ[i].startUnicodeValue; hb_codepoint_t last = hb_min ((hb_codepoint_t) (first + arrayZ[i].additionalCount), (hb_codepoint_t) HB_UNICODE_MAX); - out->add_range (first, hb_min (last, 0x10FFFFu)); + out->add_range (first, last); } } @@ -925,37 +925,75 @@ struct DefaultUVS : SortedArray32Of 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 ()) + if (this->len > unicodes->get_population () * hb_bit_storage ((unsigned) this->len)) { - for (const unsigned addcnt : hb_range ((unsigned) _.additionalCount + 1)) + hb_codepoint_t start = HB_SET_VALUE_INVALID; + hb_codepoint_t end = HB_SET_VALUE_INVALID; + + for (hb_codepoint_t u = HB_SET_VALUE_INVALID; + unicodes->next (&u);) { - 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) + if (!as_array ().bsearch (u)) + continue; + if (start == HB_SET_VALUE_INVALID) { + start = u; + end = start - 1; + } + if (end + 1 != u || end - start == 255) + { UnicodeValueRange rec; - rec.startUnicodeValue = lastCode; - rec.additionalCount = count - 1; + rec.startUnicodeValue = start; + rec.additionalCount = end - start; c->copy (rec); - - lastCode = curEntry; - count = 0; + start = u; } + end = u; + } + if (start != HB_SET_VALUE_INVALID) + { + UnicodeValueRange rec; + rec.startUnicodeValue = start; + rec.additionalCount = end - start; + c->copy (rec); } - } - if (lastCode != HB_MAP_VALUE_INVALID) + } + else { - UnicodeValueRange rec; - rec.startUnicodeValue = lastCode; - rec.additionalCount = count; - c->copy (rec); + hb_codepoint_t lastCode = HB_SET_VALUE_INVALID; + int count = -1; + + for (const UnicodeValueRange& _ : *this) + { + hb_codepoint_t curEntry = (hb_codepoint_t) (_.startUnicodeValue - 1); + hb_codepoint_t end = curEntry + _.additionalCount + 2; + + for (; unicodes->next (&curEntry) && curEntry < end;) + { + count += 1; + if (lastCode == HB_SET_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) @@ -1474,32 +1512,80 @@ struct EncodingRecord DEFINE_SIZE_STATIC (8); }; +struct cmap; + struct SubtableUnicodesCache { private: - const void* base; - hb_hashmap_t> cached_unicodes; + hb_blob_ptr_t base_blob; + const char* base; + hb_hashmap_t> cached_unicodes; public: + + static SubtableUnicodesCache* create (hb_blob_ptr_t source_table) + { + SubtableUnicodesCache* cache = + (SubtableUnicodesCache*) hb_malloc (sizeof(SubtableUnicodesCache)); + new (cache) SubtableUnicodesCache (source_table); + return cache; + } + + static void destroy (void* value) { + if (!value) return; + + SubtableUnicodesCache* cache = (SubtableUnicodesCache*) value; + cache->~SubtableUnicodesCache (); + hb_free (cache); + } + SubtableUnicodesCache(const void* cmap_base) - : base(cmap_base), cached_unicodes() {} + : base_blob(), + base ((const char*) cmap_base), + cached_unicodes () + {} + + SubtableUnicodesCache(hb_blob_ptr_t base_blob_) + : base_blob(base_blob_), + base ((const char *) base_blob.get()), + cached_unicodes () + {} + + ~SubtableUnicodesCache() + { + base_blob.destroy (); + } + + bool same_base(const void* other) const + { + return other == (const void*) base; + } - hb_set_t* set_for (const EncodingRecord* record) + const hb_set_t* set_for (const EncodingRecord* record, + SubtableUnicodesCache& mutable_cache) const { - if (!cached_unicodes.has ((intptr_t) record)) + if (cached_unicodes.has ((unsigned) ((const char *) record - base))) + return cached_unicodes.get ((unsigned) ((const char *) record - base)); + + return mutable_cache.set_for (record); + } + + const hb_set_t* set_for (const EncodingRecord* record) + { + if (!cached_unicodes.has ((unsigned) ((const char *) record - base))) { hb_set_t *s = hb_set_create (); if (unlikely (s->in_error ())) return hb_set_get_empty (); - + (base+record->subtable).collect_unicodes (s); - if (unlikely (!cached_unicodes.set ((intptr_t) record, hb::unique_ptr {s}))) + if (unlikely (!cached_unicodes.set ((unsigned) ((const char *) record - base), hb::unique_ptr {s}))) return hb_set_get_empty (); return s; } - return cached_unicodes.get ((intptr_t) record); + return cached_unicodes.get ((unsigned) ((const char *) record - base)); } }; @@ -1523,13 +1609,30 @@ struct cmap { static constexpr hb_tag_t tableTag = HB_OT_TAG_cmap; + + static SubtableUnicodesCache* create_filled_cache(hb_blob_ptr_t source_table) { + const cmap* cmap = source_table.get(); + auto it = + + hb_iter (cmap->encodingRecord) + | hb_filter ([&](const EncodingRecord& _) { + return cmap::filter_encoding_records_for_subset (cmap, _); + }) + ; + + SubtableUnicodesCache* cache = SubtableUnicodesCache::create(source_table); + for (const EncodingRecord& _ : it) + cache->set_for(&_); // populate the cache for this encoding record. + + return cache; + } + template bool serialize (hb_serialize_context_t *c, Iterator it, EncodingRecIter encodingrec_iter, const void *base, - const hb_subset_plan_t *plan, + hb_subset_plan_t *plan, bool drop_format_4 = false) { if (unlikely (!c->extend_min ((*this)))) return false; @@ -1538,7 +1641,14 @@ struct cmap unsigned format4objidx = 0, format12objidx = 0, format14objidx = 0; auto snap = c->snapshot (); - SubtableUnicodesCache unicodes_cache (base); + SubtableUnicodesCache local_unicodes_cache (base); + const SubtableUnicodesCache* unicodes_cache = &local_unicodes_cache; + + if (plan->accelerator && + plan->accelerator->cmap_cache && + plan->accelerator->cmap_cache->same_base (base)) + unicodes_cache = plan->accelerator->cmap_cache; + for (const EncodingRecord& _ : encodingrec_iter) { if (c->in_error ()) @@ -1547,7 +1657,7 @@ struct cmap unsigned format = (base+_.subtable).u.format; if (format != 4 && format != 12 && format != 14) continue; - hb_set_t* unicodes_set = unicodes_cache.set_for (&_); + const hb_set_t* unicodes_set = unicodes_cache->set_for (&_, local_unicodes_cache); if (!drop_format_4 && format == 4) { @@ -1566,7 +1676,13 @@ struct cmap else if (format == 12) { - if (_can_drop (_, *unicodes_set, base, unicodes_cache, + it | hb_map (hb_first), encodingrec_iter)) continue; + if (_can_drop (_, + *unicodes_set, + base, + *unicodes_cache, + local_unicodes_cache, + + it | hb_map (hb_first), encodingrec_iter)) + continue; c->copy (_, + it | hb_filter (*unicodes_set, hb_first), 12u, base, plan, &format12objidx); } else if (format == 14) c->copy (_, it, 14u, base, plan, &format14objidx); @@ -1585,7 +1701,8 @@ struct cmap bool _can_drop (const EncodingRecord& cmap12, const hb_set_t& cmap12_unicodes, const void* base, - SubtableUnicodesCache& unicodes_cache, + const SubtableUnicodesCache& unicodes_cache, + SubtableUnicodesCache& local_unicodes_cache, Iterator subset_unicodes, EncodingRecordIterator encoding_records) { @@ -1616,7 +1733,7 @@ struct cmap || (base+_.subtable).get_language() != target_language) continue; - hb_set_t* sibling_unicodes = unicodes_cache.set_for (&_); + const hb_set_t* sibling_unicodes = unicodes_cache.set_for (&_, local_unicodes_cache); auto cmap12 = + subset_unicodes | hb_filter (cmap12_unicodes); auto sibling = + subset_unicodes | hb_filter (*sibling_unicodes); @@ -1653,17 +1770,9 @@ struct cmap 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; - - return false; - }) + | hb_filter ([&](const EncodingRecord& _) { + return cmap::filter_encoding_records_for_subset (this, _); + }) ; if (unlikely (!encodingrec_iter.len ())) return_trace (false); @@ -1692,7 +1801,11 @@ struct cmap { return (_.second != HB_MAP_VALUE_INVALID); }) ; - return_trace (cmap_prime->serialize (c->serializer, it, encodingrec_iter, this, c->plan)); + return_trace (cmap_prime->serialize (c->serializer, + it, + encodingrec_iter, + this, + c->plan)); } const CmapSubtable *find_best_subtable (bool *symbol = nullptr) const @@ -1928,6 +2041,19 @@ struct cmap encodingRecord.sanitize (c, this)); } + private: + + static bool filter_encoding_records_for_subset(const cmap* cmap, + const EncodingRecord& _) + { + return + (_.platformID == 0 && _.encodingID == 3) || + (_.platformID == 0 && _.encodingID == 4) || + (_.platformID == 3 && _.encodingID == 1) || + (_.platformID == 3 && _.encodingID == 10) || + (cmap + _.subtable).u.format == 14; + } + protected: HBUINT16 version; /* Table version number (0). */ SortedArray16Of diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-cbdt-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-cbdt-table.hh index 23fa56c4f6f..3246894d398 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-cbdt-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-cbdt-table.hh @@ -67,7 +67,7 @@ _copy_data_to_cbdt (hb_vector_t *cbdt_prime, { unsigned int new_len = cbdt_prime->length + length; if (unlikely (!cbdt_prime->alloc (new_len))) return false; - memcpy (cbdt_prime->arrayZ + cbdt_prime->length, data, length); + hb_memcpy (cbdt_prime->arrayZ + cbdt_prime->length, data, length); cbdt_prime->length = new_len; return true; } @@ -468,13 +468,13 @@ struct IndexSubtableRecord if (unlikely (!c->serializer->check_success (records->resize (records->length + 1)))) return_trace (false); - (*records)[records->length - 1].firstGlyphIndex = 1; - (*records)[records->length - 1].lastGlyphIndex = 0; + records->tail ().firstGlyphIndex = 1; + records->tail ().lastGlyphIndex = 0; bitmap_size_context->size += IndexSubtableRecord::min_size; c->serializer->push (); - if (unlikely (!add_new_subtable (c, bitmap_size_context, &((*records)[records->length - 1]), lookup, base, start))) + if (unlikely (!add_new_subtable (c, bitmap_size_context, &(records->tail ()), lookup, base, start))) { c->serializer->pop_discard (); c->serializer->revert (snap); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-colr-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-colr-table.hh index 908bf550f0d..1af9d309375 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-colr-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-colr-table.hh @@ -39,11 +39,7 @@ #define HB_OT_TAG_COLR HB_TAG('C','O','L','R') #ifndef HB_COLRV1_MAX_NESTING_LEVEL -#define HB_COLRV1_MAX_NESTING_LEVEL 100 -#endif - -#ifndef COLRV1_ENABLE_SUBSETTING -#define COLRV1_ENABLE_SUBSETTING 1 +#define HB_COLRV1_MAX_NESTING_LEVEL 16 #endif namespace OT { @@ -188,6 +184,7 @@ struct Variable protected: T value; + public: VarIdx varIdxBase; public: DEFINE_SIZE_STATIC (4 + T::static_size); @@ -196,6 +193,8 @@ struct Variable template struct NoVariable { + static constexpr uint32_t varIdxBase = VarIdx::NO_VARIATION; + NoVariable* copy (hb_serialize_context_t *c) const { TRACE_SERIALIZE (this); @@ -888,6 +887,11 @@ struct PaintComposite DEFINE_SIZE_STATIC (8); }; +struct ClipBoxData +{ + int xMin, yMin, xMax, yMax; +}; + struct ClipBoxFormat1 { bool sanitize (hb_sanitize_context_t *c) const @@ -896,6 +900,14 @@ struct ClipBoxFormat1 return_trace (c->check_struct (this)); } + void get_clip_box (ClipBoxData &clip_box, const VarStoreInstancer &instancer HB_UNUSED) const + { + clip_box.xMin = xMin; + clip_box.yMin = yMin; + clip_box.xMax = xMax; + clip_box.yMax = yMax; + } + public: HBUINT8 format; /* format = 1(noVar) or 2(Var)*/ FWORD xMin; @@ -906,7 +918,20 @@ struct ClipBoxFormat1 DEFINE_SIZE_STATIC (1 + 4 * FWORD::static_size); }; -struct ClipBoxFormat2 : Variable {}; +struct ClipBoxFormat2 : Variable +{ + void get_clip_box (ClipBoxData &clip_box, const VarStoreInstancer &instancer) const + { + value.get_clip_box(clip_box, instancer); + if (instancer) + { + clip_box.xMin += _hb_roundf (instancer (varIdxBase, 0)); + clip_box.yMin += _hb_roundf (instancer (varIdxBase, 1)); + clip_box.xMax += _hb_roundf (instancer (varIdxBase, 2)); + clip_box.yMax += _hb_roundf (instancer (varIdxBase, 3)); + } + } +}; struct ClipBox { @@ -932,6 +957,28 @@ struct ClipBox } } + bool get_extents (hb_glyph_extents_t *extents, + const VarStoreInstancer &instancer) const + { + ClipBoxData clip_box; + switch (u.format) { + case 1: + u.format1.get_clip_box (clip_box, instancer); + break; + case 2: + u.format2.get_clip_box (clip_box, instancer); + break; + default: + return false; + } + + extents->x_bearing = clip_box.xMin; + extents->y_bearing = clip_box.yMax; + extents->width = clip_box.xMax - clip_box.xMin; + extents->height = clip_box.yMin - clip_box.yMax; + return true; + } + protected: union { HBUINT8 format; /* Format identifier */ @@ -942,6 +989,9 @@ struct ClipBox struct ClipRecord { + int cmp (hb_codepoint_t g) const + { return g < startGlyphID ? -1 : g <= endGlyphID ? 0 : +1; } + ClipRecord* copy (hb_serialize_context_t *c, const void *base) const { TRACE_SERIALIZE (this); @@ -957,6 +1007,13 @@ struct ClipRecord return_trace (c->check_struct (this) && clipBox.sanitize (c, base)); } + bool get_extents (hb_glyph_extents_t *extents, + const void *base, + const VarStoreInstancer &instancer) const + { + return (base+clipBox).get_extents (extents, instancer); + } + public: HBUINT16 startGlyphID; // first gid clip applies to HBUINT16 endGlyphID; // last gid clip applies to, inclusive @@ -964,6 +1021,7 @@ struct ClipRecord public: DEFINE_SIZE_STATIC (7); }; +DECLARE_NULL_NAMESPACE_BYTES (OT, ClipRecord); struct ClipList { @@ -1052,11 +1110,26 @@ struct ClipList bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); + // TODO Make a formatted struct! return_trace (c->check_struct (this) && clips.sanitize (c, this)); } + bool + get_extents (hb_codepoint_t gid, + hb_glyph_extents_t *extents, + const VarStoreInstancer &instancer) const + { + auto *rec = clips.as_array ().bsearch (gid); + if (rec) + { + rec->get_extents (extents, this, instancer); + return true; + } + return false; + } + HBUINT8 format; // Set to 1. - Array32Of clips; // Clip records, sorted by startGlyphID + SortedArray32Of clips; // Clip records, sorted by startGlyphID public: DEFINE_SIZE_ARRAY_SIZED (5, clips); }; @@ -1359,7 +1432,7 @@ struct COLR (this+baseGlyphsZ).sanitize (c, numBaseGlyphs) && (this+layersZ).sanitize (c, numLayers) && (version == 0 || - (COLRV1_ENABLE_SUBSETTING && version == 1 && + (version == 1 && baseGlyphList.sanitize (c, this) && layerList.sanitize (c, this) && clipList.sanitize (c, this) && @@ -1516,6 +1589,30 @@ struct COLR return_trace (true); } + bool + get_extents (hb_font_t *font, hb_codepoint_t glyph, hb_glyph_extents_t *extents) const + { + if (version != 1) + return false; + + VarStoreInstancer instancer (this+varStore, + this+varIdxMap, + hb_array (font->coords, font->num_coords)); + + if ((this+clipList).get_extents (glyph, + extents, + instancer)) + { + extents->x_bearing = font->em_scale_x (extents->x_bearing); + extents->y_bearing = font->em_scale_x (extents->y_bearing); + extents->width = font->em_scale_x (extents->width); + extents->height = font->em_scale_x (extents->height); + return true; + } + + return false; + } + protected: HBUINT16 version; /* Table version number (starts at 0). */ HBUINT16 numBaseGlyphs; /* Number of Base Glyph Records. */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-face-table-list.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-face-table-list.hh index c05034b3bb5..c9da36c1bb5 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-face-table-list.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-face-table-list.hh @@ -56,9 +56,9 @@ HB_OT_CORE_TABLE (OT, maxp) #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_CORE_TABLE (OT, hhea) HB_OT_ACCELERATOR (OT, hmtx) -HB_OT_TABLE (OT, OS2) +HB_OT_CORE_TABLE (OT, OS2) #if !defined(HB_NO_OT_FONT_GLYPH_NAMES) || !defined(HB_NO_METRICS) || !defined(HB_NO_STYLE) HB_OT_ACCELERATOR (OT, post) #endif @@ -66,7 +66,7 @@ HB_OT_ACCELERATOR (OT, post) HB_OT_ACCELERATOR (OT, name) #endif #ifndef HB_NO_STYLE -HB_OT_TABLE (OT, STAT) +HB_OT_CORE_TABLE (OT, STAT) #endif #ifndef HB_NO_META HB_OT_ACCELERATOR (OT, meta) @@ -74,9 +74,9 @@ HB_OT_ACCELERATOR (OT, meta) /* Vertical layout. */ #ifndef HB_NO_VERTICAL -HB_OT_TABLE (OT, vhea) +HB_OT_CORE_TABLE (OT, vhea) HB_OT_ACCELERATOR (OT, vmtx) -HB_OT_TABLE (OT, VORG) +HB_OT_CORE_TABLE (OT, VORG) #endif /* TrueType outlines. */ @@ -91,15 +91,15 @@ HB_OT_ACCELERATOR (OT, cff2) /* OpenType variations. */ #ifndef HB_NO_VAR -HB_OT_TABLE (OT, fvar) -HB_OT_TABLE (OT, avar) +HB_OT_CORE_TABLE (OT, fvar) +HB_OT_CORE_TABLE (OT, avar) HB_OT_ACCELERATOR (OT, gvar) -HB_OT_TABLE (OT, MVAR) +HB_OT_CORE_TABLE (OT, MVAR) #endif /* Legacy kern. */ #ifndef HB_NO_OT_KERN -HB_OT_TABLE (OT, kern) +HB_OT_CORE_TABLE (OT, kern) #endif /* OpenType shaping. */ @@ -107,12 +107,12 @@ HB_OT_TABLE (OT, kern) HB_OT_ACCELERATOR (OT, GDEF) HB_OT_ACCELERATOR (OT, GSUB) HB_OT_ACCELERATOR (OT, GPOS) -//HB_OT_TABLE (OT, JSTF) +//HB_OT_CORE_TABLE (OT, JSTF) #endif /* OpenType baseline. */ #ifndef HB_NO_BASE -HB_OT_TABLE (OT, BASE) +HB_OT_CORE_TABLE (OT, BASE) #endif /* AAT shaping. */ @@ -129,8 +129,8 @@ HB_OT_TABLE (AAT, feat) /* OpenType color fonts. */ #ifndef HB_NO_COLOR -HB_OT_TABLE (OT, COLR) -HB_OT_TABLE (OT, CPAL) +HB_OT_CORE_TABLE (OT, COLR) +HB_OT_CORE_TABLE (OT, CPAL) HB_OT_ACCELERATOR (OT, CBDT) HB_OT_ACCELERATOR (OT, sbix) HB_OT_ACCELERATOR (OT, SVG) @@ -138,7 +138,7 @@ HB_OT_ACCELERATOR (OT, SVG) /* OpenType math. */ #ifndef HB_NO_MATH -HB_OT_TABLE (OT, MATH) +HB_OT_CORE_TABLE (OT, MATH) #endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc index 825b30853c8..84051034238 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc @@ -45,6 +45,7 @@ #include "hb-ot-vorg-table.hh" #include "hb-ot-color-cbdt-table.hh" #include "hb-ot-color-sbix-table.hh" +#include "hb-ot-color-colr-table.hh" /** @@ -349,6 +350,9 @@ hb_ot_get_glyph_extents (hb_font_t *font, #if !defined(HB_NO_OT_FONT_BITMAP) && !defined(HB_NO_COLOR) if (ot_face->sbix->get_extents (font, glyph, extents)) return true; if (ot_face->CBDT->get_extents (font, glyph, extents)) return true; +#endif +#if !defined(HB_NO_COLOR) + if (ot_face->COLR->get_extents (font, glyph, extents)) return true; #endif if (ot_face->glyf->get_extents (font, glyph, extents)) return true; #ifndef HB_NO_OT_FONT_CFF @@ -356,7 +360,6 @@ hb_ot_get_glyph_extents (hb_font_t *font, if (ot_face->cff2->get_extents (font, glyph, extents)) return true; #endif - // TODO Hook up side-bearings variations. return false; } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-common.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-common.hh index 579abf011a6..0f424f5aa65 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-common.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-common.hh @@ -478,7 +478,7 @@ struct IndexArray : Array16Of { if (_count) { - + this->sub_array (start_offset, _count) + + this->as_array ().sub_array (start_offset, _count) | hb_sink (hb_array (_indexes, *_count)) ; } @@ -658,7 +658,7 @@ struct FeatureParamsCharacterVariants { if (char_count) { - + characters.sub_array (start_offset, char_count) + + characters.as_array ().sub_array (start_offset, char_count) | hb_sink (hb_array (chars, *char_count)) ; } @@ -932,7 +932,7 @@ struct RecordArrayOf : SortedArray16Of> { if (record_count) { - + this->sub_array (start_offset, record_count) + + this->as_array ().sub_array (start_offset, record_count) | hb_map (&Record::tag) | hb_sink (hb_array (record_tags, *record_count)) ; @@ -980,18 +980,16 @@ struct RecordListOfFeature : RecordListOf auto *out = c->serializer->start_embed (*this); if (unlikely (!out || !c->serializer->extend_min (out))) return_trace (false); - unsigned count = this->len; - - + hb_zip (*this, hb_range (count)) - | hb_filter (l->feature_index_map, hb_second) - | hb_apply ([l, out, this] (const hb_pair_t&, unsigned>& _) + + hb_enumerate (*this) + | hb_filter (l->feature_index_map, hb_first) + | hb_apply ([l, out, this] (const hb_pair_t&>& _) { const Feature *f_sub = nullptr; const Feature **f = nullptr; - if (l->feature_substitutes_map->has (_.second, &f)) + if (l->feature_substitutes_map->has (_.first, &f)) f_sub = *f; - subset_record_array (l, out, this, f_sub) (_.first); + subset_record_array (l, out, this, f_sub) (_.second); }) ; @@ -1079,7 +1077,7 @@ struct LangSys auto *out = c->serializer->start_embed (*this); if (unlikely (!out || !c->serializer->extend_min (out))) return_trace (false); - const unsigned *v; + const uint32_t *v; out->reqFeatureIndex = l->feature_index_map->has (reqFeatureIndex, &v) ? *v : 0xFFFFu; if (!l->visitFeatureIndex (featureIndex.len)) @@ -1147,7 +1145,6 @@ struct Script return; } - unsigned langsys_count = get_lang_sys_count (); if (has_default_lang_sys ()) { //only collect features from non-redundant langsys @@ -1156,24 +1153,24 @@ struct Script d.collect_features (c); } - for (auto _ : + hb_zip (langSys, hb_range (langsys_count))) + for (auto _ : + hb_enumerate (langSys)) { - const LangSys& l = this+_.first.offset; + const LangSys& l = this+_.second.offset; if (!c->visitLangsys (l.get_feature_count ())) continue; if (l.compare (d, c->duplicate_feature_map)) continue; l.collect_features (c); - c->script_langsys_map->get (script_index)->add (_.second); + c->script_langsys_map->get (script_index)->add (_.first); } } else { - for (auto _ : + hb_zip (langSys, hb_range (langsys_count))) + for (auto _ : + hb_enumerate (langSys)) { - const LangSys& l = this+_.first.offset; + const LangSys& l = this+_.second.offset; if (!c->visitLangsys (l.get_feature_count ())) continue; l.collect_features (c); - c->script_langsys_map->get (script_index)->add (_.second); + c->script_langsys_map->get (script_index)->add (_.first); } } } @@ -1211,10 +1208,9 @@ struct Script const hb_set_t *active_langsys = l->script_langsys_map->get (l->cur_script_index); if (active_langsys) { - unsigned count = langSys.len; - + hb_zip (langSys, hb_range (count)) - | hb_filter (active_langsys, hb_second) - | hb_map (hb_first) + + hb_enumerate (langSys) + | hb_filter (active_langsys, hb_first) + | hb_map (hb_second) | hb_filter ([=] (const Record& record) {return l->visitLangSys (); }) | hb_apply (subset_record_array (l, &(out->langSys), this)) ; @@ -1250,12 +1246,11 @@ struct RecordListOfScript : RecordListOf