From 4ca29e7f53a6b8a57f2f64c3c3e9a0b423e76429 Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Fri, 19 Oct 2018 23:02:01 +0000 Subject: harfbuzz 2.0.0 git-svn-id: svn://tug.org/texlive/trunk@48949 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/libs/README | 2 +- Build/source/libs/harfbuzz/ChangeLog | 5 + Build/source/libs/harfbuzz/Makefile.am | 4 +- Build/source/libs/harfbuzz/Makefile.in | 12 +- Build/source/libs/harfbuzz/TLpatches/ChangeLog | 5 + Build/source/libs/harfbuzz/TLpatches/TL-Changes | 2 +- Build/source/libs/harfbuzz/configure | 26 +- Build/source/libs/harfbuzz/harfbuzz-src/AUTHORS | 12 +- .../libs/harfbuzz/harfbuzz-src/CMakeLists.txt | 153 +- Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog | 6677 ++++++++++++++++++++ Build/source/libs/harfbuzz/harfbuzz-src/NEWS | 68 + Build/source/libs/harfbuzz/harfbuzz-src/TODO | 10 +- .../source/libs/harfbuzz/harfbuzz-src/config.h.in | 3 - .../source/libs/harfbuzz/harfbuzz-src/configure.ac | 12 +- .../libs/harfbuzz/harfbuzz-src/src/Makefile.am | 21 +- .../harfbuzz/harfbuzz-src/src/Makefile.sources | 5 +- .../harfbuzz-src/src/check-static-inits.sh | 4 +- .../harfbuzz/harfbuzz-src/src/check-symbols.sh | 2 +- .../libs/harfbuzz/harfbuzz-src/src/dump-emoji.cc | 42 +- .../harfbuzz/harfbuzz-src/src/dump-khmer-data.cc | 8 +- .../harfbuzz/harfbuzz-src/src/gen-emoji-table.py | 64 + .../harfbuzz-src/src/gen-os2-unicode-ranges.py | 54 + .../harfbuzz/harfbuzz-src/src/gen-tag-table.py | 1126 ++++ .../harfbuzz/harfbuzz-src/src/gen-use-table.py | 41 +- .../harfbuzz-src/src/harfbuzz-config.cmake.in | 4 + .../harfbuzz-src/src/hb-aat-layout-ankr-table.hh | 25 +- .../harfbuzz-src/src/hb-aat-layout-common.hh | 239 +- .../harfbuzz-src/src/hb-aat-layout-feat-table.hh | 2 +- .../harfbuzz-src/src/hb-aat-layout-kerx-table.hh | 709 ++- .../harfbuzz-src/src/hb-aat-layout-morx-table.hh | 391 +- .../harfbuzz-src/src/hb-aat-layout-trak-table.hh | 144 +- .../harfbuzz/harfbuzz-src/src/hb-aat-layout.cc | 181 +- .../harfbuzz/harfbuzz-src/src/hb-aat-layout.hh | 47 +- .../harfbuzz/harfbuzz-src/src/hb-aat-ltag-table.hh | 2 +- .../libs/harfbuzz/harfbuzz-src/src/hb-atomic.hh | 42 +- .../libs/harfbuzz/harfbuzz-src/src/hb-blob.cc | 37 +- .../harfbuzz-src/src/hb-buffer-serialize.cc | 4 +- .../libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc | 112 +- .../libs/harfbuzz/harfbuzz-src/src/hb-buffer.h | 28 +- .../libs/harfbuzz/harfbuzz-src/src/hb-buffer.hh | 74 +- .../libs/harfbuzz/harfbuzz-src/src/hb-cache.hh | 80 + .../libs/harfbuzz/harfbuzz-src/src/hb-common.cc | 44 +- .../libs/harfbuzz/harfbuzz-src/src/hb-common.h | 42 +- .../libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc | 192 +- .../libs/harfbuzz/harfbuzz-src/src/hb-debug.hh | 10 +- .../libs/harfbuzz/harfbuzz-src/src/hb-deprecated.h | 181 +- .../libs/harfbuzz/harfbuzz-src/src/hb-dsalgs.hh | 34 +- .../libs/harfbuzz/harfbuzz-src/src/hb-face.cc | 22 +- .../libs/harfbuzz/harfbuzz-src/src/hb-font.cc | 125 +- .../libs/harfbuzz/harfbuzz-src/src/hb-font.h | 91 +- .../libs/harfbuzz/harfbuzz-src/src/hb-font.hh | 23 +- .../source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc | 125 +- .../libs/harfbuzz/harfbuzz-src/src/hb-glib.cc | 50 +- .../libs/harfbuzz/harfbuzz-src/src/hb-graphite2.cc | 41 +- .../libs/harfbuzz/harfbuzz-src/src/hb-graphite2.h | 2 +- .../libs/harfbuzz/harfbuzz-src/src/hb-icu.cc | 63 +- .../libs/harfbuzz/harfbuzz-src/src/hb-machinery.hh | 36 +- .../libs/harfbuzz/harfbuzz-src/src/hb-mutex.hh | 8 + .../libs/harfbuzz/harfbuzz-src/src/hb-null.hh | 15 +- .../libs/harfbuzz/harfbuzz-src/src/hb-open-file.hh | 221 +- .../libs/harfbuzz/harfbuzz-src/src/hb-open-type.hh | 290 +- .../harfbuzz/harfbuzz-src/src/hb-ot-cmap-table.hh | 14 +- .../harfbuzz-src/src/hb-ot-color-cbdt-table.hh | 62 +- .../harfbuzz-src/src/hb-ot-color-colr-table.hh | 4 +- .../harfbuzz-src/src/hb-ot-color-cpal-table.hh | 8 +- .../harfbuzz-src/src/hb-ot-color-svg-table.hh | 2 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-face.cc | 20 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-face.hh | 78 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc | 166 +- .../harfbuzz/harfbuzz-src/src/hb-ot-glyf-table.hh | 10 +- .../harfbuzz/harfbuzz-src/src/hb-ot-hdmx-table.hh | 30 +- .../harfbuzz/harfbuzz-src/src/hb-ot-hmtx-table.hh | 53 +- .../harfbuzz/harfbuzz-src/src/hb-ot-kern-table.hh | 200 +- .../harfbuzz-src/src/hb-ot-layout-common.hh | 49 +- .../harfbuzz-src/src/hb-ot-layout-gpos-table.hh | 68 +- .../harfbuzz-src/src/hb-ot-layout-gsub-table.hh | 17 +- .../harfbuzz-src/src/hb-ot-layout-gsubgpos.hh | 249 +- .../harfbuzz-src/src/hb-ot-layout-jstf-table.hh | 4 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-layout.cc | 392 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-layout.h | 49 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-layout.hh | 136 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-map.cc | 30 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-map.hh | 43 +- .../harfbuzz/harfbuzz-src/src/hb-ot-math-table.hh | 48 +- .../harfbuzz/harfbuzz-src/src/hb-ot-maxp-table.hh | 2 +- .../harfbuzz/harfbuzz-src/src/hb-ot-name-table.hh | 13 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-name.h | 53 + .../harfbuzz/harfbuzz-src/src/hb-ot-os2-table.hh | 2 +- .../harfbuzz-src/src/hb-ot-os2-unicode-ranges.hh | 49 +- .../harfbuzz/harfbuzz-src/src/hb-ot-post-table.hh | 10 +- .../src/hb-ot-shape-complex-arabic-fallback.hh | 2 +- .../harfbuzz-src/src/hb-ot-shape-complex-arabic.cc | 53 +- .../src/hb-ot-shape-complex-default.cc | 2 +- .../harfbuzz-src/src/hb-ot-shape-complex-hangul.cc | 22 +- .../harfbuzz-src/src/hb-ot-shape-complex-hebrew.cc | 16 +- .../src/hb-ot-shape-complex-indic-machine.hh | 1636 +++-- .../src/hb-ot-shape-complex-indic-machine.rl | 22 +- .../harfbuzz-src/src/hb-ot-shape-complex-indic.cc | 357 +- .../harfbuzz-src/src/hb-ot-shape-complex-indic.hh | 10 +- .../src/hb-ot-shape-complex-khmer-machine.hh | 308 +- .../src/hb-ot-shape-complex-khmer-machine.rl | 50 +- .../harfbuzz-src/src/hb-ot-shape-complex-khmer.cc | 61 +- .../harfbuzz-src/src/hb-ot-shape-complex-khmer.hh | 110 +- .../src/hb-ot-shape-complex-myanmar-machine.hh | 22 +- .../src/hb-ot-shape-complex-myanmar-machine.rl | 8 +- .../src/hb-ot-shape-complex-myanmar.cc | 64 +- .../src/hb-ot-shape-complex-myanmar.hh | 48 +- .../harfbuzz-src/src/hb-ot-shape-complex-thai.cc | 11 +- .../src/hb-ot-shape-complex-tibetan.cc | 63 - .../src/hb-ot-shape-complex-use-machine.hh | 524 +- .../src/hb-ot-shape-complex-use-machine.rl | 38 +- .../src/hb-ot-shape-complex-use-table.cc | 98 +- .../harfbuzz-src/src/hb-ot-shape-complex-use.cc | 35 +- .../harfbuzz-src/src/hb-ot-shape-complex-use.hh | 5 +- .../harfbuzz-src/src/hb-ot-shape-complex.hh | 61 +- .../harfbuzz-src/src/hb-ot-shape-fallback.cc | 90 +- .../harfbuzz-src/src/hb-ot-shape-fallback.hh | 12 +- .../harfbuzz-src/src/hb-ot-shape-normalize.cc | 212 +- .../harfbuzz-src/src/hb-ot-shape-normalize.hh | 7 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.cc | 376 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.hh | 42 +- .../harfbuzz/harfbuzz-src/src/hb-ot-tag-table.hh | 2064 ++++++ .../libs/harfbuzz/harfbuzz-src/src/hb-ot-tag.cc | 1119 +--- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-tag.h | 31 +- .../harfbuzz-src/src/hb-ot-var-avar-table.hh | 8 +- .../harfbuzz-src/src/hb-ot-var-fvar-table.hh | 9 +- .../harfbuzz-src/src/hb-ot-var-hvar-table.hh | 9 +- .../harfbuzz-src/src/hb-ot-var-mvar-table.hh | 9 +- .../source/libs/harfbuzz/harfbuzz-src/src/hb-ot.h | 1 + .../libs/harfbuzz/harfbuzz-src/src/hb-set.hh | 4 +- .../harfbuzz/harfbuzz-src/src/hb-shaper-list.hh | 2 - .../libs/harfbuzz/harfbuzz-src/src/hb-static.cc | 4 + .../libs/harfbuzz/harfbuzz-src/src/hb-subset.cc | 6 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ucdn.cc | 33 +- .../harfbuzz-src/src/hb-unicode-emoji-table.hh | 269 + .../libs/harfbuzz/harfbuzz-src/src/hb-unicode.cc | 18 + .../libs/harfbuzz/harfbuzz-src/src/hb-unicode.h | 77 +- .../libs/harfbuzz/harfbuzz-src/src/hb-unicode.hh | 54 +- .../libs/harfbuzz/harfbuzz-src/src/hb-uniscribe.cc | 14 +- .../libs/harfbuzz/harfbuzz-src/src/hb-vector.hh | 100 +- Build/source/libs/harfbuzz/harfbuzz-src/src/hb.hh | 37 +- .../harfbuzz-src/src/test-unicode-ranges.cc | 8 +- Build/source/libs/harfbuzz/include/Makefile.am | 1 + Build/source/libs/harfbuzz/include/Makefile.in | 7 +- Build/source/libs/harfbuzz/version.ac | 2 +- 145 files changed, 17099 insertions(+), 5107 deletions(-) create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/gen-emoji-table.py create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/gen-os2-unicode-ranges.py create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/gen-tag-table.py create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cache.hh create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-name.h delete mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-tibetan.cc create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-tag-table.hh create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode-emoji-table.hh (limited to 'Build/source/libs') diff --git a/Build/source/libs/README b/Build/source/libs/README index 24ae054bda6..60bbe4980cd 100644 --- a/Build/source/libs/README +++ b/Build/source/libs/README @@ -25,7 +25,7 @@ graphite2 1.3.12 - checked 16aug18 http://sourceforge.net/projects/silgraphite/files/graphite2/ (requires C++11) -harfbuzz 1.8.8 - checked 15aug18 +harfbuzz 2.0.0 - checked 20oct18 http://www.freedesktop.org/software/harfbuzz/release/ icu 61.1 - checked 29mar18 diff --git a/Build/source/libs/harfbuzz/ChangeLog b/Build/source/libs/harfbuzz/ChangeLog index fd5a6cfd927..83bb0c0ce43 100644 --- a/Build/source/libs/harfbuzz/ChangeLog +++ b/Build/source/libs/harfbuzz/ChangeLog @@ -1,3 +1,8 @@ +2018-10-20 Akira Kakuto + + Import harfbuzz-2.0.0. + * version.ac, Makefile.am, include/Makefile.am: Adjusted. + 2018-10-20 Khaled Hosny * configure.ac: Set HAVE_ICU_BUILTIN. diff --git a/Build/source/libs/harfbuzz/Makefile.am b/Build/source/libs/harfbuzz/Makefile.am index 2242e91b854..a8d719efc14 100644 --- a/Build/source/libs/harfbuzz/Makefile.am +++ b/Build/source/libs/harfbuzz/Makefile.am @@ -37,6 +37,7 @@ libharfbuzz_a_SOURCES = \ @HARFBUZZ_TREE@/src/hb-buffer.hh \ @HARFBUZZ_TREE@/src/hb-buffer-serialize.cc \ @HARFBUZZ_TREE@/src/hb-buffer.cc \ + @HARFBUZZ_TREE@/src/hb-cache.hh \ @HARFBUZZ_TREE@/src/hb-common.cc \ @HARFBUZZ_TREE@/src/hb-debug.hh \ @HARFBUZZ_TREE@/src/hb-dsalgs.hh \ @@ -70,6 +71,7 @@ libharfbuzz_a_SOURCES = \ @HARFBUZZ_TREE@/src/hb-ot-post-macroman.hh \ @HARFBUZZ_TREE@/src/hb-ot-post-table.hh \ @HARFBUZZ_TREE@/src/hb-ot-tag.cc \ + @HARFBUZZ_TREE@/src/hb-ot-tag-table.hh \ @HARFBUZZ_TREE@/src/hb-set-digest.hh \ @HARFBUZZ_TREE@/src/hb-set.hh \ @HARFBUZZ_TREE@/src/hb-set.cc \ @@ -86,6 +88,7 @@ libharfbuzz_a_SOURCES = \ @HARFBUZZ_TREE@/src/hb-subset.hh \ @HARFBUZZ_TREE@/src/hb-unicode.hh \ @HARFBUZZ_TREE@/src/hb-unicode.cc \ + @HARFBUZZ_TREE@/src/hb-unicode-emoji-table.hh \ @HARFBUZZ_TREE@/src/hb-vector.hh \ @HARFBUZZ_TREE@/src/hb-utf.hh \ @HARFBUZZ_TREE@/src/hb-warning.cc \ @@ -142,7 +145,6 @@ libharfbuzz_a_SOURCES += \ @HARFBUZZ_TREE@/src/hb-ot-shape-complex-myanmar.hh \ @HARFBUZZ_TREE@/src/hb-ot-shape-complex-myanmar.cc \ @HARFBUZZ_TREE@/src/hb-ot-shape-complex-thai.cc \ - @HARFBUZZ_TREE@/src/hb-ot-shape-complex-tibetan.cc \ @HARFBUZZ_TREE@/src/hb-ot-shape-complex-use.cc \ @HARFBUZZ_TREE@/src/hb-ot-shape-complex.hh \ @HARFBUZZ_TREE@/src/hb-ot-shape-complex-use-table.cc \ diff --git a/Build/source/libs/harfbuzz/Makefile.in b/Build/source/libs/harfbuzz/Makefile.in index 287c4eddabf..3d61110b9fe 100644 --- a/Build/source/libs/harfbuzz/Makefile.in +++ b/Build/source/libs/harfbuzz/Makefile.in @@ -153,7 +153,6 @@ am_libharfbuzz_a_OBJECTS = @HARFBUZZ_TREE@/src/hb-blob.$(OBJEXT) \ @HARFBUZZ_TREE@/src/hb-ot-shape-complex-khmer.$(OBJEXT) \ @HARFBUZZ_TREE@/src/hb-ot-shape-complex-myanmar.$(OBJEXT) \ @HARFBUZZ_TREE@/src/hb-ot-shape-complex-thai.$(OBJEXT) \ - @HARFBUZZ_TREE@/src/hb-ot-shape-complex-tibetan.$(OBJEXT) \ @HARFBUZZ_TREE@/src/hb-ot-shape-complex-use.$(OBJEXT) \ @HARFBUZZ_TREE@/src/hb-ot-shape-complex-use-table.$(OBJEXT) \ @HARFBUZZ_TREE@/src/hb-ot-shape-normalize.$(OBJEXT) \ @@ -212,7 +211,6 @@ am__depfiles_remade = ./$(DEPDIR)/hbtest-dummy.Po \ @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-complex-khmer.Po \ @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-complex-myanmar.Po \ @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-complex-thai.Po \ - @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-complex-tibetan.Po \ @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-complex-use-table.Po \ @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-complex-use.Po \ @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-fallback.Po \ @@ -703,6 +701,7 @@ libharfbuzz_a_SOURCES = @HARFBUZZ_TREE@/src/hb-atomic.hh \ @HARFBUZZ_TREE@/src/hb-buffer.hh \ @HARFBUZZ_TREE@/src/hb-buffer-serialize.cc \ @HARFBUZZ_TREE@/src/hb-buffer.cc \ + @HARFBUZZ_TREE@/src/hb-cache.hh \ @HARFBUZZ_TREE@/src/hb-common.cc \ @HARFBUZZ_TREE@/src/hb-debug.hh \ @HARFBUZZ_TREE@/src/hb-dsalgs.hh \ @@ -732,6 +731,7 @@ libharfbuzz_a_SOURCES = @HARFBUZZ_TREE@/src/hb-atomic.hh \ @HARFBUZZ_TREE@/src/hb-ot-post-macroman.hh \ @HARFBUZZ_TREE@/src/hb-ot-post-table.hh \ @HARFBUZZ_TREE@/src/hb-ot-tag.cc \ + @HARFBUZZ_TREE@/src/hb-ot-tag-table.hh \ @HARFBUZZ_TREE@/src/hb-set-digest.hh \ @HARFBUZZ_TREE@/src/hb-set.hh @HARFBUZZ_TREE@/src/hb-set.cc \ @HARFBUZZ_TREE@/src/hb-shape.cc \ @@ -747,6 +747,7 @@ libharfbuzz_a_SOURCES = @HARFBUZZ_TREE@/src/hb-atomic.hh \ @HARFBUZZ_TREE@/src/hb-subset.hh \ @HARFBUZZ_TREE@/src/hb-unicode.hh \ @HARFBUZZ_TREE@/src/hb-unicode.cc \ + @HARFBUZZ_TREE@/src/hb-unicode-emoji-table.hh \ @HARFBUZZ_TREE@/src/hb-vector.hh @HARFBUZZ_TREE@/src/hb-utf.hh \ @HARFBUZZ_TREE@/src/hb-warning.cc \ @HARFBUZZ_TREE@/src/hb-buffer-deserialize-json.hh \ @@ -798,7 +799,6 @@ libharfbuzz_a_SOURCES = @HARFBUZZ_TREE@/src/hb-atomic.hh \ @HARFBUZZ_TREE@/src/hb-ot-shape-complex-myanmar.hh \ @HARFBUZZ_TREE@/src/hb-ot-shape-complex-myanmar.cc \ @HARFBUZZ_TREE@/src/hb-ot-shape-complex-thai.cc \ - @HARFBUZZ_TREE@/src/hb-ot-shape-complex-tibetan.cc \ @HARFBUZZ_TREE@/src/hb-ot-shape-complex-use.cc \ @HARFBUZZ_TREE@/src/hb-ot-shape-complex.hh \ @HARFBUZZ_TREE@/src/hb-ot-shape-complex-use-table.cc \ @@ -1003,9 +1003,6 @@ clean-noinstLIBRARIES: @HARFBUZZ_TREE@/src/hb-ot-shape-complex-thai.$(OBJEXT): \ @HARFBUZZ_TREE@/src/$(am__dirstamp) \ @HARFBUZZ_TREE@/src/$(DEPDIR)/$(am__dirstamp) -@HARFBUZZ_TREE@/src/hb-ot-shape-complex-tibetan.$(OBJEXT): \ - @HARFBUZZ_TREE@/src/$(am__dirstamp) \ - @HARFBUZZ_TREE@/src/$(DEPDIR)/$(am__dirstamp) @HARFBUZZ_TREE@/src/hb-ot-shape-complex-use.$(OBJEXT): \ @HARFBUZZ_TREE@/src/$(am__dirstamp) \ @HARFBUZZ_TREE@/src/$(DEPDIR)/$(am__dirstamp) @@ -1072,7 +1069,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@@HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-complex-khmer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-complex-myanmar.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-complex-thai.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@@HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-complex-tibetan.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-complex-use-table.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-complex-use.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-fallback.Po@am__quote@ # am--include-marker @@ -1706,7 +1702,6 @@ distclean: distclean-recursive -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-complex-khmer.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-complex-myanmar.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-complex-thai.Po - -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-complex-tibetan.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-complex-use-table.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-complex-use.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-fallback.Po @@ -1796,7 +1791,6 @@ maintainer-clean: maintainer-clean-recursive -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-complex-khmer.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-complex-myanmar.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-complex-thai.Po - -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-complex-tibetan.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-complex-use-table.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-complex-use.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-shape-fallback.Po diff --git a/Build/source/libs/harfbuzz/TLpatches/ChangeLog b/Build/source/libs/harfbuzz/TLpatches/ChangeLog index 488f19d7882..9878ab40ff1 100644 --- a/Build/source/libs/harfbuzz/TLpatches/ChangeLog +++ b/Build/source/libs/harfbuzz/TLpatches/ChangeLog @@ -1,3 +1,8 @@ +2018-10-20 Akira Kakuto + + Imported harfbuzz-2.0.0 source tree from: + http://www.freedesktop.org/software/harfbuzz/release/ + 2018-09-11 Akira Kakuto Imported harfbuzz-1.9.0 source tree from: diff --git a/Build/source/libs/harfbuzz/TLpatches/TL-Changes b/Build/source/libs/harfbuzz/TLpatches/TL-Changes index dae72960cfe..e4a2d8d755b 100644 --- a/Build/source/libs/harfbuzz/TLpatches/TL-Changes +++ b/Build/source/libs/harfbuzz/TLpatches/TL-Changes @@ -1,4 +1,4 @@ -Changes applied to the harfbuzz-1.9.0/ tree as obtained from: +Changes applied to the harfbuzz-2.0.0/ tree as obtained from: http://www.freedesktop.org/software/harfbuzz/release/ Removed: diff --git a/Build/source/libs/harfbuzz/configure b/Build/source/libs/harfbuzz/configure index 75485dc763b..b81652fc50b 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.69 for harfbuzz (TeX Live) 1.9.0. +# Generated by GNU Autoconf 2.69 for harfbuzz (TeX Live) 2.0.0. # # Report bugs to . # @@ -580,8 +580,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='harfbuzz (TeX Live)' PACKAGE_TARNAME='harfbuzz--tex-live-' -PACKAGE_VERSION='1.9.0' -PACKAGE_STRING='harfbuzz (TeX Live) 1.9.0' +PACKAGE_VERSION='2.0.0' +PACKAGE_STRING='harfbuzz (TeX Live) 2.0.0' PACKAGE_BUGREPORT='tex-k@tug.org' PACKAGE_URL='' @@ -1317,7 +1317,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) 1.9.0 to adapt to many kinds of systems. +\`configure' configures harfbuzz (TeX Live) 2.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1388,7 +1388,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of harfbuzz (TeX Live) 1.9.0:";; + short | recursive ) echo "Configuration of harfbuzz (TeX Live) 2.0.0:";; esac cat <<\_ACEOF @@ -1495,7 +1495,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -harfbuzz (TeX Live) configure 1.9.0 +harfbuzz (TeX Live) configure 2.0.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2131,7 +2131,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 1.9.0, which was +It was created by harfbuzz (TeX Live) $as_me 2.0.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -4054,7 +4054,7 @@ fi # Define the identity of the package. PACKAGE='harfbuzz--tex-live-' - VERSION='1.9.0' + VERSION='2.0.0' # Some tools Automake needs. @@ -4246,10 +4246,10 @@ WARNING_CFLAGS=$kpse_cv_warning_cflags -HB_VERSION_MAJOR=1 -HB_VERSION_MINOR=9 +HB_VERSION_MAJOR=2 +HB_VERSION_MINOR=0 HB_VERSION_MICRO=0 -HB_VERSION=1.9.0 +HB_VERSION=2.0.0 ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -8143,7 +8143,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 1.9.0, which was +This file was extended by harfbuzz (TeX Live) $as_me 2.0.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -8209,7 +8209,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -harfbuzz (TeX Live) config.status 1.9.0 +harfbuzz (TeX Live) config.status 2.0.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/AUTHORS b/Build/source/libs/harfbuzz/harfbuzz-src/AUTHORS index 81cdc4cf37f..0763761bbf8 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/AUTHORS +++ b/Build/source/libs/harfbuzz/harfbuzz-src/AUTHORS @@ -1,9 +1,11 @@ Behdad Esfahbod -Simon Hausmann -Martin Hosken +David Turner +Ebrahim Byagowi Jonathan Kew +Khaled Hosny Lars Knoll -Werner Lemberg -Roozbeh Pournader +Martin Hosken Owen Taylor -David Turner +Roozbeh Pournader +Simon Hausmann +Werner Lemberg diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/CMakeLists.txt b/Build/source/libs/harfbuzz/harfbuzz-src/CMakeLists.txt index e881dbd1a4d..760883fdae8 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/CMakeLists.txt +++ b/Build/source/libs/harfbuzz/harfbuzz-src/CMakeLists.txt @@ -82,12 +82,21 @@ if (HB_CHECK) endif () endif () +set (HB_DISABLE_SUBSET OFF) +set (HB_DISABLE_TESTS OFF) +option(HB_IOS "Apply iOS specific build flags" OFF) +if (HB_IOS) + # We should fix their issue and enable them + set (HB_DISABLE_SUBSET ON) + set (HB_DISABLE_TESTS ON) + set (HB_HAVE_CORETEXT OFF) +endif () + include_directories(AFTER ${PROJECT_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src ) -add_definitions(-DHAVE_OT) add_definitions(-DHAVE_FALLBACK) # We need PYTHON_EXECUTABLE to be set for running the tests... @@ -359,12 +368,32 @@ if (APPLE AND HB_HAVE_CORETEXT) list(APPEND project_sources ${PROJECT_SOURCE_DIR}/src/hb-coretext.cc) list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-coretext.h) - find_library(APPLICATION_SERVICES_FRAMEWORK ApplicationServices) - if (APPLICATION_SERVICES_FRAMEWORK) - list(APPEND THIRD_PARTY_LIBS ${APPLICATION_SERVICES_FRAMEWORK}) - endif (APPLICATION_SERVICES_FRAMEWORK) + if (HB_IOS) + find_library(COREFOUNDATION CoreFoundation) + if (COREFOUNDATION) + list(APPEND THIRD_PARTY_LIBS ${COREFOUNDATION}) + endif () + mark_as_advanced(COREFOUNDATION) - mark_as_advanced(APPLICATION_SERVICES_FRAMEWORK) + find_library(CORETEXT CoreText) + if (CORETEXT) + list(APPEND THIRD_PARTY_LIBS ${CORETEXT}) + endif () + mark_as_advanced(CORETEXT) + + find_library(COREGRAPHICS CoreGraphics) + if (COREGRAPHICS) + list(APPEND THIRD_PARTY_LIBS ${COREGRAPHICS}) + endif () + mark_as_advanced(COREGRAPHICS) + else () + find_library(APPLICATION_SERVICES_FRAMEWORK ApplicationServices) + if (APPLICATION_SERVICES_FRAMEWORK) + list(APPEND THIRD_PARTY_LIBS ${APPLICATION_SERVICES_FRAMEWORK}) + endif () + + mark_as_advanced(APPLICATION_SERVICES_FRAMEWORK) + endif () endif () if (WIN32 AND HB_HAVE_UNISCRIBE) @@ -527,12 +556,14 @@ add_library(harfbuzz ${project_sources} ${project_extra_sources} ${project_heade target_link_libraries(harfbuzz ${THIRD_PARTY_LIBS}) ## Define harfbuzz-subset library -add_library(harfbuzz-subset ${subset_project_sources} ${subset_project_headers}) -add_dependencies(harfbuzz-subset harfbuzz) -target_link_libraries(harfbuzz-subset harfbuzz ${THIRD_PARTY_LIBS}) +if (NOT HB_DISABLE_SUBSET) + add_library(harfbuzz-subset ${subset_project_sources} ${subset_project_headers}) + add_dependencies(harfbuzz-subset harfbuzz) + target_link_libraries(harfbuzz-subset harfbuzz ${THIRD_PARTY_LIBS}) -if (BUILD_SHARED_LIBS) - set_target_properties(harfbuzz harfbuzz-subset PROPERTIES VISIBILITY_INLINES_HIDDEN TRUE) + if (BUILD_SHARED_LIBS) + set_target_properties(harfbuzz harfbuzz-subset PROPERTIES VISIBILITY_INLINES_HIDDEN TRUE) + endif () endif () if (UNIX OR MINGW) @@ -549,7 +580,9 @@ if (UNIX OR MINGW) set (CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "m") # libm set (CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "") set_target_properties(harfbuzz PROPERTIES LINKER_LANGUAGE C) - set_target_properties(harfbuzz-subset PROPERTIES LINKER_LANGUAGE C) + if (NOT HB_DISABLE_SUBSET) + set_target_properties(harfbuzz-subset PROPERTIES LINKER_LANGUAGE C) + endif () # No threadsafe statics as we do it ourselves set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-threadsafe-statics") @@ -574,7 +607,7 @@ if (HB_HAVE_GOBJECT) endif () if (BUILD_SHARED_LIBS AND WIN32 AND NOT MINGW) - add_definitions("-DHB_EXTERN=__declspec(dllexport) extern") + add_definitions("-DHB_DLL_EXPORT") endif () # On Windows, g-ir-scanner requires a DLL build in order for it to work @@ -761,12 +794,22 @@ endif () if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) install(TARGETS harfbuzz + EXPORT harfbuzzConfig ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} FRAMEWORK DESTINATION Library/Frameworks ) + install(EXPORT harfbuzzConfig + NAMESPACE harfbuzz:: + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/harfbuzz + ) if (HB_BUILD_UTILS) + if (WIN32 AND BUILD_SHARED_LIBS) + install(TARGETS harfbuzz-subset + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) + endif () install(TARGETS hb-view RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) @@ -818,51 +861,53 @@ if (UNIX AND CMAKE_GENERATOR STREQUAL "Ninja") endif () -## src/ executables -foreach (prog main test test-would-substitute test-size-params test-buffer-serialize hb-ot-tag test-unicode-ranges) - set (prog_name ${prog}) - if (${prog_name} STREQUAL "test") - # test can not be used as a valid executable name on cmake, lets special case it - set (prog_name test-test) - endif () - add_executable(${prog_name} ${PROJECT_SOURCE_DIR}/src/${prog}.cc) - target_link_libraries(${prog_name} harfbuzz ${THIRD_PARTY_LIBS}) -endforeach () -set_target_properties(hb-ot-tag PROPERTIES COMPILE_FLAGS "-DMAIN") - -## Tests -if (UNIX OR MINGW) - if (BUILD_SHARED_LIBS) - # generate harfbuzz.def after build completion - add_custom_command(TARGET harfbuzz POST_BUILD - COMMAND "${PYTHON_EXECUTABLE}" ${PROJECT_SOURCE_DIR}/src/gen-def.py ${PROJECT_BINARY_DIR}/harfbuzz.def ${project_headers} - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/src) - - add_test(NAME check-static-inits.sh - COMMAND ${PROJECT_SOURCE_DIR}/src/check-static-inits.sh - WORKING_DIRECTORY ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/harfbuzz.dir/src # ugly hack - ) - add_test(NAME check-libstdc++.sh COMMAND ${PROJECT_SOURCE_DIR}/src/check-libstdc++.sh) - add_test(NAME check-symbols.sh COMMAND ${PROJECT_SOURCE_DIR}/src/check-symbols.sh) +if (NOT HB_DISABLE_TESTS) + ## src/ executables + foreach (prog main test test-would-substitute test-size-params test-buffer-serialize hb-ot-tag test-unicode-ranges) + set (prog_name ${prog}) + if (${prog_name} STREQUAL "test") + # test can not be used as a valid executable name on cmake, lets special case it + set (prog_name test-test) + endif () + add_executable(${prog_name} ${PROJECT_SOURCE_DIR}/src/${prog}.cc) + target_link_libraries(${prog_name} harfbuzz ${THIRD_PARTY_LIBS}) + endforeach () + set_target_properties(hb-ot-tag PROPERTIES COMPILE_FLAGS "-DMAIN") + + ## Tests + if (UNIX OR MINGW) + if (BUILD_SHARED_LIBS) + # generate harfbuzz.def after build completion + add_custom_command(TARGET harfbuzz POST_BUILD + COMMAND "${PYTHON_EXECUTABLE}" ${PROJECT_SOURCE_DIR}/src/gen-def.py ${PROJECT_BINARY_DIR}/harfbuzz.def ${project_headers} + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/src) + + add_test(NAME check-static-inits.sh + COMMAND ${PROJECT_SOURCE_DIR}/src/check-static-inits.sh + WORKING_DIRECTORY ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/harfbuzz.dir/src # ugly hack + ) + add_test(NAME check-libstdc++.sh COMMAND ${PROJECT_SOURCE_DIR}/src/check-libstdc++.sh) + add_test(NAME check-symbols.sh COMMAND ${PROJECT_SOURCE_DIR}/src/check-symbols.sh) + + set_tests_properties( + check-static-inits.sh check-libstdc++.sh check-symbols.sh + PROPERTIES + ENVIRONMENT "libs=.;srcdir=${PROJECT_SOURCE_DIR}/src" + SKIP_RETURN_CODE 77) + endif () + add_test(NAME check-c-linkage-decls.sh COMMAND ./check-c-linkage-decls.sh) + add_test(NAME check-header-guards.sh COMMAND ./check-header-guards.sh) + add_test(NAME check-externs.sh COMMAND ./check-externs.sh) + add_test(NAME check-includes.sh COMMAND ./check-includes.sh) set_tests_properties( - check-static-inits.sh check-libstdc++.sh check-symbols.sh + check-c-linkage-decls.sh check-header-guards.sh check-externs.sh check-includes.sh PROPERTIES - ENVIRONMENT "libs=.;srcdir=${PROJECT_SOURCE_DIR}/src" + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/src SKIP_RETURN_CODE 77) endif () - add_test(NAME check-c-linkage-decls.sh COMMAND ./check-c-linkage-decls.sh) - add_test(NAME check-header-guards.sh COMMAND ./check-header-guards.sh) - add_test(NAME check-externs.sh COMMAND ./check-externs.sh) - add_test(NAME check-includes.sh COMMAND ./check-includes.sh) - set_tests_properties( - check-c-linkage-decls.sh check-header-guards.sh check-externs.sh check-includes.sh - PROPERTIES - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/src - SKIP_RETURN_CODE 77) + # Needs to come last so that variables defined above are passed to + # subdirectories. + add_subdirectory(test) endif () - -# Needs to come last so that variables defined above are passed to -# subdirectories. -add_subdirectory(test) diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog b/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog index e0f47e8af90..d8f413c5386 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog +++ b/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog @@ -1,3 +1,6680 @@ +commit 3d9a0306ebb48706778fd2c487c3cacc7d508d6c +Author: Behdad Esfahbod +Date: Thu Oct 18 05:58:17 2018 -0700 + + 2.0.0 + + NEWS | 68 + +++++++++++++++++++++++++++++++++++++++++++++++++++++ + configure.ac | 2 +- + src/hb-buffer.cc | 4 ++-- + src/hb-common.h | 4 ++-- + src/hb-deprecated.h | 18 +++++++------- + src/hb-font.cc | 6 ++--- + src/hb-font.h | 2 +- + src/hb-ot-layout.cc | 8 +++---- + src/hb-ot-name.h | 4 ++-- + src/hb-ot-tag.cc | 4 ++-- + src/hb-ot-tag.h | 4 ++-- + src/hb-version.h | 6 ++--- + 12 files changed, 99 insertions(+), 31 deletions(-) + +commit 535ca678bf9c8ab470ebf5ad84a090328d79d42b +Author: Behdad Esfahbod +Date: Thu Oct 18 05:58:04 2018 -0700 + + [test] Don't use newer glib API + + test/api/test-ot-tag.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 03e144135b5c691e3942d1aef917fe2246665fb6 +Author: Ebrahim Byagowi +Date: Thu Oct 18 11:06:37 2018 +0330 + + [ubsan] Use unsigned int instead enum where needed (#1270) + + Actually the check is right, + + On -myanmar.hh, on that particular switch, OT_C is indic_category_t + but OT_D is myanmar_category_t so we are mixing the types in one + variable. + + And on -arabic.cc, step can goes one number higher than step_t enum + in the + loop so we are actually using it as an unsinged int. + + .circleci/config.yml | 2 +- + src/hb-ot-shape-complex-arabic.cc | 4 ++-- + src/hb-ot-shape-complex-myanmar.hh | 48 + +++++++++++++++++++------------------- + 3 files changed, 27 insertions(+), 27 deletions(-) + +commit 64df6b0b0f9d221e14811084f2412a01cf4deb46 +Author: Behdad Esfahbod +Date: Thu Oct 18 00:35:01 2018 -0700 + + [AUTHORS] Add Ebrahim and Khaled + + AUTHORS | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +commit f1ced9be378d7c7ad3ea35a1cee6f9aff7a44a13 +Author: Behdad Esfahbod +Date: Wed Oct 17 23:06:53 2018 -0700 + + More warning fix + + Okay, let's see if the gods are happy now... + + src/hb-static.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 40606abd0cd40faf3973d0a8c30af90d36ae8231 +Author: Behdad Esfahbod +Date: Wed Oct 17 23:06:37 2018 -0700 + + Fix build + + src/hb-static.cc | 1 + + 1 file changed, 1 insertion(+) + +commit c406aca19303e61fa5ba15d215386cfc6d920124 +Author: Behdad Esfahbod +Date: Wed Oct 17 22:58:43 2018 -0700 + + Fix warning + + src/hb-machinery.hh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 270a37c3244b32dd839a99eb379be241613ee895 +Author: Behdad Esfahbod +Date: Wed Oct 17 22:42:47 2018 -0700 + + Kick bots + + src/hb-aat-layout-common.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 6da8ef3f9f4706fe88715fabdba7904ff279539b +Author: Behdad Esfahbod +Date: Wed Oct 17 22:37:34 2018 -0700 + + Fix some wierdness... + + src/hb-static.cc | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +commit 83780308b41b029513ac2568b6688d3eaad77338 +Author: Behdad Esfahbod +Date: Wed Oct 17 22:34:16 2018 -0700 + + [aat] Fix sanitize slowdown + + Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11034 + + src/hb-aat-layout-common.hh | 4 ++++ + src/hb-machinery.hh | 2 +- + 2 files changed, 5 insertions(+), 1 deletion(-) + +commit b9478e28ac4361353e4920d749cc5d29e5bfef67 +Author: Behdad Esfahbod +Date: Wed Oct 17 21:52:14 2018 -0700 + + Revert "[test] Remove not-fixed yet testcases (#1268)" + + This reverts commit 191eef823fe95355425621f8e002dfe7fe632383. + + ...rfuzz-testcase-minimized-hb-fuzzer-4548492505645056 | Bin 0 -> + 122 bytes + ...rfuzz-testcase-minimized-hb-fuzzer-6210176798425088 | Bin 0 -> + 1420 bytes + ...testcase-minimized-hb-shape-fuzzer-5738888765636608 | Bin 0 -> + 267731 bytes + 3 files changed, 0 insertions(+), 0 deletions(-) + +commit af99b20dfddbca75e68f84c5aa465a54728990a6 +Author: Ebrahim Byagowi +Date: Thu Oct 18 08:35:20 2018 +0330 + + [ci/ubsan] Disable enum sanitization + + Behdad apparently not interested on them + + .circleci/config.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 9e8a9b846ec24e9124d61706272a0e5fa58d7a24 +Author: Behdad Esfahbod +Date: Wed Oct 17 21:41:25 2018 -0700 + + [aat] Another try at fixing Lookup null objects... + + Ugly as hell, and don't even understand why some bits are needed. + But the logic is sound. + + src/hb-aat-layout-common.hh | 23 ++++++++++++++++++++--- + src/hb-static.cc | 4 ++++ + 2 files changed, 24 insertions(+), 3 deletions(-) + +commit 191eef823fe95355425621f8e002dfe7fe632383 +Author: Ebrahim Byagowi +Date: Thu Oct 18 08:04:18 2018 +0330 + + [test] Remove not-fixed yet testcases (#1268) + + I added them but now that I think, it is a bad idea to have them as + fuzzing bots will find good seeds to tweak in order to find easy new + testcases which causes duplicated issues. + + ...rfuzz-testcase-minimized-hb-fuzzer-4548492505645056 | Bin 122 -> + 0 bytes + ...rfuzz-testcase-minimized-hb-fuzzer-6210176798425088 | Bin 1420 -> + 0 bytes + ...testcase-minimized-hb-shape-fuzzer-5738888765636608 | Bin 267731 -> + 0 bytes + 3 files changed, 0 insertions(+), 0 deletions(-) + +commit 392e1f4ddd7eb649e1a71755b9bcf6431739f98f +Author: Ebrahim Byagowi +Date: Thu Oct 18 07:42:20 2018 +0330 + + [test/shape-fuzzer] fail on timeout and ubsan errors (#1267) + + test/fuzzing/run-shape-fuzzer-tests.py | 38 + ++++++++++++++++++++++++++++++---- + 1 file changed, 34 insertions(+), 4 deletions(-) + +commit eeddda3ec6c28b411d33c74938ec6198c7f6888d +Author: Ebrahim Byagowi +Date: Thu Oct 18 07:38:47 2018 +0330 + + [util] Better file-not-found error from hb-shape / hb-view + + fixes #1266 + + util/options.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 751c10e55e43e2266a5bba024d560c5127fae4b8 +Author: Ebrahim Byagowi +Date: Thu Oct 18 06:36:48 2018 +0330 + + [fuzz] Add more new testcases + + ...testcase-minimized-hb-shape-fuzzer-5718464350650368 | Bin 0 -> + 41 bytes + ...testcase-minimized-hb-shape-fuzzer-5738888765636608 | Bin 0 -> + 267731 bytes + 2 files changed, 0 insertions(+), 0 deletions(-) + +commit fd282eb3285e6d20f77e8a3a7237b677433ccbb4 +Author: Ebrahim Byagowi +Date: Thu Oct 18 06:33:39 2018 +0330 + + [fuzz] Add a new testcase + + .../clusterfuzz-testcase-hb-shape-fuzzer-5634395566768128 | Bin 0 -> + 106 bytes + 1 file changed, 0 insertions(+), 0 deletions(-) + +commit 9d42d70269b879e67f3c7724beab8e4cdbfc877a +Author: Behdad Esfahbod +Date: Wed Oct 17 17:55:47 2018 -0700 + + [trak] Fix calc + + We were getting the first track record always. Ie. this line: + + if (trackTable[i].get_track_value () == 0.f) + { + - trackTableEntry = &trackTable[0]; + + trackTableEntry = &trackTable[i]; + break; + } + + The rest is cleanup. + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1263 for the + most part. + + src/hb-aat-layout-trak-table.hh | 17 ++++++++--------- + 1 file changed, 8 insertions(+), 9 deletions(-) + +commit 3341c7fbfb9bc8e137afd9f16da8cf18eb67b25b +Author: Behdad Esfahbod +Date: Wed Oct 17 15:04:35 2018 -0700 + + [fuzzing] Move fuzzing fonts from api/ here + + ...estcase-minimized-hb-subset-fuzzer-5521982557782016 | Bin 1228 -> + 0 bytes + ...estcase-minimized-hb-subset-fuzzer-5542653037903872 | Bin 160249 -> + 0 bytes + ...estcase-minimized-hb-subset-fuzzer-5609911946838016 | Bin 313 -> + 0 bytes + ...estcase-minimized-hb-subset-fuzzer-5670861909524480 | Bin 1298 -> + 0 bytes + ...estcase-minimized-hb-subset-fuzzer-5750092395970560 | Bin 72435 -> + 0 bytes + ...estcase-minimized-hb-subset-fuzzer-6651660668502016 | Bin 15229 -> + 0 bytes + ...ed-hb-subset-get-codepoints-fuzzer-5973295416475648 | Bin 109 -> + 0 bytes + ...ed-hb-subset-get-codepoints-fuzzer-6136125075750912 | Bin 65816 -> + 0 bytes + test/api/test-subset-glyf.c | 2 +- + test/api/test-subset-hdmx.c | 4 ++-- + test/api/test-subset-hmtx.c | 2 +- + test/api/test-subset.c | 6 +++--- + .../crash-4b60576767ee4d9fe1cc10959d89baf73d4e8249 | Bin + .../crash-b577db318b30f2851828a4c9ef97cb30678b1b54 | Bin + .../crash-ccc61c92d589f895174cdef6ff2e3b20e9999a1a | Bin + .../crash-e4e0bb1458a91b692eba492c907ae1f94e635480 | Bin + .../fonts/oom-6ef8c96d3710262511bcc730dce9c00e722cb653 | Bin + .../fonts/oom-ccc61c92d589f895174cdef6ff2e3b20e9999a1a | Bin + 18 files changed, 7 insertions(+), 7 deletions(-) + +commit 2e7c716511e8b2cfcd059fa2a2ed4cdd48b351bf +Author: Behdad Esfahbod +Date: Tue Oct 16 18:35:03 2018 -0700 + + [buffer] Add an assert + + See if it helps debugging + https://bugs.chromium.org/p/chromium/issues/detail?id=895117 + + src/hb-buffer.cc | 2 ++ + 1 file changed, 2 insertions(+) + +commit 5842756b1398253d38749c4c8a23a1450e642caf +Author: Behdad Esfahbod +Date: Tue Oct 16 18:28:55 2018 -0700 + + [fuzzing] Delete blink fuzzed data + + These are text, not font. + + ...minimized-blink_harfbuzz_shaper_fuzzer-5099655095123968 | Bin 88 -> + 0 bytes + 1 file changed, 0 insertions(+), 0 deletions(-) + +commit 25fe7e7e1031401d38db1efed360cd75ea7910b9 +Author: Behdad Esfahbod +Date: Tue Oct 16 18:22:54 2018 -0700 + + [aat] Comment + + src/hb-aat-layout-common.hh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 26092bb3d1aa239de5e933700e0371619d147f65 +Author: HinTak +Date: Wed Oct 17 00:54:39 2018 +0100 + + "allow-none" annotation for "out" parameters + + Fixes the following warnings: + hb-ot-tag.cc:330: Warning: HarfBuzz: invalid "allow-none" annotation: + only valid for pointer types and out parameters + hb-ot-tag.cc:334: Warning: HarfBuzz: invalid "allow-none" annotation: + only valid for pointer types and out parameters + + src/hb-ot-tag.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit ba42651608da1be0d152e03ad42ea96fc8476ac7 +Author: Behdad Esfahbod +Date: Tue Oct 16 17:35:46 2018 -0700 + + Fix indent + + test/fuzzing/run-shape-fuzzer-tests.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 49bdb54427b17d439eadf31732a5f2a0add46bf5 +Author: HinTak +Date: Wed Oct 17 00:36:04 2018 +0100 + + typo in gobject annotation - "in/out" should be "inout" + + "in/out" should be "inout" + + src/hb-ot-layout.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c0c190c16a2c1b281f40dacdcf515dc5a59ab3bb +Author: Behdad Esfahbod +Date: Tue Oct 16 16:39:29 2018 -0700 + + [fuzzing] Run tests against fuzzing fonts + + Some disable. + + test/fuzzing/run-shape-fuzzer-tests.py | 12 ++-- + test/fuzzing/run-subset-fuzzer-tests.py | 35 ++++++----- + test/shaping/data/in-house/Makefile.sources | 1 - + test/shaping/data/in-house/tests/fuzzed.tests | 84 + --------------------------- + 4 files changed, 24 insertions(+), 108 deletions(-) + +commit 7b37705fb579a39334be0618c6215c1b887bf9fc +Author: Behdad Esfahbod +Date: Tue Oct 16 16:33:06 2018 -0700 + + [fuzzing] Rename + + ...ebdebc6.ttf => 0509e80afb379d16560e9e47bdd7d888bebdebc6} | Bin + ...63b6daf.ttf => 1a6f1687b7a221f9f2c834b0b360d3c8463b6daf} | Bin + ...28b22cb.ttf => 205edd09bd3d141cc9580f650109556cc28b22cb} | Bin + ...f026462.ttf => 217a934cfe15c548b572c203dceb2befdf026462} | Bin + ...ac34f18.ttf => 3511ff5c1647150595846ac414c595cccac34f18} | Bin + ...675d5a3.ttf => 375d6ae32a3cbe52fbf81a4e5777e3377675d5a3} | Bin + ...9c9a56b.ttf => 43979b90b2dd929723cf4fe1715990bcb9c9a56b} | Bin + ...1a8e2b0.ttf => 558661aa659912f4d30ecd27bd09835171a8e2b0} | Bin + ...0655fa8.ttf => 5a5daf5eb5a4db77a2baa3ad9c7a6ed6e0655fa8} | Bin + ...c149ddc.ttf => 641bd9db850193064d17575053ae2bf8ec149ddc} | Bin + ...bcf861f.ttf => 8240789f6d12d4cfc4b5e8e6f246c3701bcf861f} | Bin + ...1386016.ttf => a34a9191d9376bda419836effeef7e75c1386016} | Bin + ...bdae30e.ttf => a69118c2c2ada48ff803d9149daa54c9ebdae30e} | Bin + ...6b31fe2.ttf => b9e2aaa0d75fcef6971ec3a96d806ba4a6b31fe2} | Bin + ...14a0467.ttf => e88c339237f52d21e01c55f01b9c1b4cc14a0467} | Bin + ...1395725.ttf => fab39d60d758cb586db5a504f218442cd1395725} | Bin + 16 files changed, 0 insertions(+), 0 deletions(-) + +commit 3676c685d407cc7b9b813b4a08e7c5bcd9a47ea1 +Author: Behdad Esfahbod +Date: Tue Oct 16 16:32:26 2018 -0700 + + [fuzzing] Move rest of fuzzing tests here + + .../fonts/0509e80afb379d16560e9e47bdd7d888bebdebc6.ttf | Bin + .../fonts/1a6f1687b7a221f9f2c834b0b360d3c8463b6daf.ttf | Bin + .../fonts/205edd09bd3d141cc9580f650109556cc28b22cb.ttf | Bin + .../fonts/217a934cfe15c548b572c203dceb2befdf026462.ttf | Bin + .../fonts/3511ff5c1647150595846ac414c595cccac34f18.ttf | Bin + .../fonts/375d6ae32a3cbe52fbf81a4e5777e3377675d5a3.ttf | Bin + .../fonts/43979b90b2dd929723cf4fe1715990bcb9c9a56b.ttf | Bin + .../fonts/558661aa659912f4d30ecd27bd09835171a8e2b0.ttf | Bin + .../fonts/5a5daf5eb5a4db77a2baa3ad9c7a6ed6e0655fa8.ttf | Bin + .../fonts/641bd9db850193064d17575053ae2bf8ec149ddc.ttf | Bin + .../fonts/8240789f6d12d4cfc4b5e8e6f246c3701bcf861f.ttf | Bin + .../fonts/a34a9191d9376bda419836effeef7e75c1386016.ttf | Bin + .../fonts/a69118c2c2ada48ff803d9149daa54c9ebdae30e.ttf | Bin + .../fonts/b9e2aaa0d75fcef6971ec3a96d806ba4a6b31fe2.ttf | Bin + .../fonts/e88c339237f52d21e01c55f01b9c1b4cc14a0467.ttf | Bin + .../fonts/fab39d60d758cb586db5a504f218442cd1395725.ttf | Bin + test/shaping/data/in-house/tests/fuzzed.tests | 16 + ---------------- + 17 files changed, 16 deletions(-) + +commit 1487173dcf4137fb210b15d9a869aa1f0c626d15 +Author: Behdad Esfahbod +Date: Tue Oct 16 16:30:38 2018 -0700 + + [fuzzing] Delete duplicate fonts + + .../233c1e252e737ca79e03a9fd56b71aaa4a230f2b.ttf | Bin 1048576 -> + 0 bytes + .../243798dd281c1c77c065958e1ff467420faa9bde.ttf | Bin 225 -> + 0 bytes + .../9d8a94a67932a3ab75a596fc8b5c6d0392ca9e49.ttf | Bin 4545 -> + 0 bytes + .../b6acef662e0beb8d5fcf5b61c6b0ca69537b7402.ttf | Bin 3301 -> + 0 bytes + .../bbf4a308c402f0678c3e82844892a4da2ebe598f.ttf | Bin 204 -> + 0 bytes + .../dd9f0c7c7c36f75a18be0cab1cddf8f3ab0f366b.ttf | Bin 2786 -> + 0 bytes + .../ef2511f215aa3ca847cbfffbf861793b42170875.ttf | Bin 1152 -> + 0 bytes + test/shaping/data/in-house/tests/fuzzed.tests | 7 ------- + 8 files changed, 7 deletions(-) + +commit 49c041f7c5b135cbcbd1663e18047afd54fc948b +Author: Behdad Esfahbod +Date: Tue Oct 16 16:25:24 2018 -0700 + + Minor + + test/fuzzing/clusterfuzz-testcase-6107935408390144 | Bin 16800 -> 0 bytes + 1 file changed, 0 insertions(+), 0 deletions(-) + +commit 36f38ea7033b4e52c6cd94a8a0d686a95c0cc148 +Author: Behdad Esfahbod +Date: Tue Oct 16 16:24:03 2018 -0700 + + [gpos] Protect mark attachment against out-of-bounds + + Not sure how can happen, but does... + + src/hb-ot-layout-gpos-table.hh | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +commit 1147ce2392ac6b3d12fdabe69ac5da9bae97e30d +Author: Behdad Esfahbod +Date: Tue Oct 16 16:18:32 2018 -0700 + + [fuzzing] Add more tests + + .../fuzzing/fonts/clusterfuzz-testcase-6107935408390144 | Bin 0 -> + 16800 bytes + ...-testcase-minimized-harfbuzz_fuzzer-5973566991106048 | Bin 0 -> + 4047 bytes + ...-testcase-minimized-hb-shape-fuzzer-5633985665826816 | Bin 0 -> + 73 bytes + 3 files changed, 0 insertions(+), 0 deletions(-) + +commit 12cbe195ae65656dbc9e32b4d50696bc4223136b +Author: Behdad Esfahbod +Date: Tue Oct 16 16:13:53 2018 -0700 + + [aat] Another non-null offset + + src/hb-aat-layout-ankr-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 87205ef935ede70365187549d133014669ea47f2 +Author: Behdad Esfahbod +Date: Tue Oct 16 15:40:44 2018 -0700 + + [aat] Make sure Lookup offset is never nulled + + It has unbounded size... + + Fixes https://oss-fuzz.com/v2/testcase-detail/5718889451749376 + + src/hb-aat-layout-ankr-table.hh | 2 +- + src/hb-aat-layout-common.hh | 3 ++- + src/hb-aat-layout-kerx-table.hh | 18 ++++++++---------- + src/hb-aat-layout-morx-table.hh | 4 ++-- + src/hb-open-type.hh | 12 ++++++------ + 5 files changed, 19 insertions(+), 20 deletions(-) + +commit 1aa353e4fc79dfa880559ff75113ed58fac8392b +Author: Behdad Esfahbod +Date: Tue Oct 16 15:26:51 2018 -0700 + + Fix tests + + test/shaping/data/in-house/tests/fuzzed.tests | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 98d4ad02b97628e5a9a7bfe3187ccc3851c00b18 +Author: Behdad Esfahbod +Date: Tue Oct 16 15:17:31 2018 -0700 + + [fuzzing] One more + + test/fuzzing/clusterfuzz-testcase-6107935408390144 | Bin 0 -> 16800 bytes + 1 file changed, 0 insertions(+), 0 deletions(-) + +commit e6f267c3dfe3e93dfc726266672da5a235fbd930 +Author: Behdad Esfahbod +Date: Tue Oct 16 15:16:20 2018 -0700 + + [fuzzing] Add more clusterfuzz tests I had lying around + + .../fonts/clusterfuzz-testcase-5517117891805184 | Bin 0 -> + 178 bytes + ...sterfuzz-testcase-hb-shape-fuzzer-5746142327865344 | Bin 0 -> + 219 bytes + ...sterfuzz-testcase-hb-shape-fuzzer-5750379279548416 | Bin 0 -> + 317 bytes + .../clusterfuzz-testcase-minimized-4884742786777088 | Bin 0 -> + 393 bytes + .../clusterfuzz-testcase-minimized-5255344882188288 | Bin 0 -> 65 bytes + .../clusterfuzz-testcase-minimized-5720051798769664 | Bin 0 -> + 1048576 bytes + .../clusterfuzz-testcase-minimized-5924299061854208 | Bin 0 -> + 2786 bytes + .../clusterfuzz-testcase-minimized-6460279560863744 | Bin 0 -> + 589 bytes + ...ized-blink_harfbuzz_shaper_fuzzer-5099655095123968 | Bin 0 -> 88 bytes + ...estcase-minimized-hb-shape-fuzzer-5650286710882304 | Bin 0 -> 76 bytes + ...stcase-minimized-hb-shape-fuzzer-5672261407735808} | Bin + 11 files changed, 0 insertions(+), 0 deletions(-) + +commit e53206271db4a83834433ab5f82d16815a18b998 +Author: Ebrahim Byagowi +Date: Wed Oct 17 01:42:04 2018 +0330 + + Add all the fonts found by fuzzers to the repo (#1258) + + test/fuzzing/Makefile.am | 1 + + ...clusterfuzz-testcase-hb-fuzzer-4666056377368576 | Bin 0 -> 1152 bytes + ...clusterfuzz-testcase-hb-fuzzer-5662671558934528 | Bin 0 -> 242272 + bytes + ...clusterfuzz-testcase-hb-fuzzer-6243458541944832 | Bin 0 -> 370187 + bytes + ...clusterfuzz-testcase-hb-fuzzer-6303297511096320 | Bin 0 -> 4545 bytes + ...clusterfuzz-testcase-hb-fuzzer-6696647723581440 | Bin 0 -> 3266 bytes + ...z-testcase-minimized-hb-fuzzer-4523479581851648 | Bin 0 -> 322 bytes + ...z-testcase-minimized-hb-fuzzer-4535496598355968 | Bin 0 -> 2786 bytes + ...z-testcase-minimized-hb-fuzzer-4548492505645056 | Bin 0 -> 122 bytes + ...z-testcase-minimized-hb-fuzzer-4595692015190016 | Bin 0 -> 225 bytes + ...z-testcase-minimized-hb-fuzzer-4687441845813248 | Bin 0 -> 162 bytes + ...z-testcase-minimized-hb-fuzzer-4706238090706944 | Bin 0 -> 350 bytes + ...z-testcase-minimized-hb-fuzzer-4769173588672512 | Bin 0 -> 37 bytes + ...z-testcase-minimized-hb-fuzzer-4827735151083520 | Bin 0 -> 1384 bytes + ...z-testcase-minimized-hb-fuzzer-4841745322868736 | Bin 0 -> 660 bytes + ...z-testcase-minimized-hb-fuzzer-4884742786777088 | Bin 0 -> 393 bytes + ...z-testcase-minimized-hb-fuzzer-5216838347653120 | Bin 0 -> 157600 + bytes + ...z-testcase-minimized-hb-fuzzer-5255344882188288 | Bin 0 -> 65 bytes + ...z-testcase-minimized-hb-fuzzer-5294584596791296 | Bin 0 -> 1602 bytes + ...z-testcase-minimized-hb-fuzzer-5303930168803328 | Bin 0 -> 7321 bytes + ...z-testcase-minimized-hb-fuzzer-5331901587914752 | Bin 0 -> 3301 bytes + ...z-testcase-minimized-hb-fuzzer-5388906574905344 | Bin 0 -> 9937 bytes + ...z-testcase-minimized-hb-fuzzer-5517117891805184 | Bin 0 -> 178 bytes + ...z-testcase-minimized-hb-fuzzer-5617496443846656 | Bin 0 -> 195 bytes + ...z-testcase-minimized-hb-fuzzer-5672141338968064 | Bin 0 -> 176 bytes + ...z-testcase-minimized-hb-fuzzer-5700697074958336 | Bin 0 -> 878 bytes + ...z-testcase-minimized-hb-fuzzer-5720051798769664 | Bin 0 -> 1048576 + bytes + ...z-testcase-minimized-hb-fuzzer-5924299061854208 | Bin 0 -> 2786 bytes + ...z-testcase-minimized-hb-fuzzer-6023178755244032 | Bin 0 -> 2261 bytes + ...z-testcase-minimized-hb-fuzzer-6111685556305920 | Bin 0 -> 586 bytes + ...z-testcase-minimized-hb-fuzzer-6160439919509504 | Bin 0 -> 204 bytes + ...z-testcase-minimized-hb-fuzzer-6210176798425088 | Bin 0 -> 1420 bytes + ...z-testcase-minimized-hb-fuzzer-6260579246276608 | Bin 0 -> 700 bytes + ...z-testcase-minimized-hb-fuzzer-6264625609834496 | Bin 0 -> 1731 bytes + ...z-testcase-minimized-hb-fuzzer-6424351550210048 | Bin 0 -> 73 bytes + ...z-testcase-minimized-hb-fuzzer-6460279560863744 | Bin 0 -> 589 bytes + ...z-testcase-minimized-hb-fuzzer-6576177596596224 | Bin 0 -> 385 bytes + ...z-testcase-minimized-hb-fuzzer-6595199411159040 | Bin 0 -> 1862 bytes + ...z-testcase-minimized-hb-fuzzer-6624904746106880 | Bin 0 -> 42 bytes + ...z-testcase-minimized-hb-fuzzer-6723367514144768 | Bin 0 -> 1074 bytes + ...case-minimized-hb-shape-fuzzer-5630246225707008 | Bin 0 -> 109 bytes + ...case-minimized-hb-shape-fuzzer-5635082459545600 | Bin 0 -> 52 bytes + ...case-minimized-hb-shape-fuzzer-5652019562414080 | Bin 0 -> 49 bytes + ...case-minimized-hb-shape-fuzzer-5656511058018304 | Bin 0 -> 28 bytes + ...case-minimized-hb-shape-fuzzer-5659641787187200 | Bin 0 -> 3498 bytes + ...case-minimized-hb-shape-fuzzer-5668791174823936 | Bin 0 -> 3608 bytes + ...ase-minimized-hb-shape-fuzzer-56722614077358084 | Bin 0 -> 192 bytes + ...case-minimized-hb-shape-fuzzer-5674361600606208 | Bin 0 -> 518 bytes + ...case-minimized-hb-shape-fuzzer-5677421274071040 | Bin 0 -> 3608 bytes + ...case-minimized-hb-shape-fuzzer-5679244475105280 | Bin 0 -> 256 bytes + ...case-minimized-hb-shape-fuzzer-5685596677210112 | Bin 0 -> 58 bytes + ...case-minimized-hb-shape-fuzzer-5695615258853376 | Bin 0 -> 194 bytes + ...case-minimized-hb-shape-fuzzer-5696686572175360 | Bin 0 -> 256 bytes + ...case-minimized-hb-shape-fuzzer-5718889451749376 | Bin 0 -> 1680 bytes + ...case-minimized-hb-shape-fuzzer-5719982789361664 | Bin 0 -> 3608 bytes + ...case-minimized-hb-shape-fuzzer-5725129603022848 | Bin 0 -> 3608 bytes + ...case-minimized-hb-shape-fuzzer-5726089628876800 | Bin 0 -> 76 bytes + ...case-minimized-hb-shape-fuzzer-5729361857085440 | Bin 0 -> 2250 bytes + ...case-minimized-hb-shape-fuzzer-5733166795456512 | Bin 0 -> 78 bytes + ...case-minimized-hb-shape-fuzzer-5734736291430400 | Bin 0 -> 66 bytes + ...case-minimized-hb-shape-fuzzer-5740171484463104 | Bin 0 -> 186 bytes + ...case-minimized-hb-shape-fuzzer-5750379279548416 | Bin 0 -> 219 bytes + ...case-minimized-hb-shape-fuzzer-5762490181353472 | Bin 0 -> 101 bytes + ...ase-minimized-hb-subset-fuzzer-5359635656605696 | Bin 0 -> 393270 + bytes + ...ase-minimized-hb-subset-fuzzer-5521982557782016 | Bin 0 -> 1228 bytes + ...ase-minimized-hb-subset-fuzzer-5542653037903872 | Bin 0 -> 160249 + bytes + ...ase-minimized-hb-subset-fuzzer-5609911946838016 | Bin 0 -> 313 bytes + ...ase-minimized-hb-subset-fuzzer-5629878397829120 | Bin 0 -> 3746 bytes + ...ase-minimized-hb-subset-fuzzer-5651059347816448 | Bin 0 -> 2648 bytes + ...ase-minimized-hb-subset-fuzzer-5669437462544384 | Bin 0 -> 284427 + bytes + ...ase-minimized-hb-subset-fuzzer-5670861909524480 | Bin 0 -> 1298 bytes + ...ase-minimized-hb-subset-fuzzer-5696607199166464 | Bin 0 -> 28 bytes + ...ase-minimized-hb-subset-fuzzer-5711951464759296 | Bin 0 -> 284521 + bytes + ...ase-minimized-hb-subset-fuzzer-5747265633779712 | Bin 0 -> 177090 + bytes + ...ase-minimized-hb-subset-fuzzer-5750092395970560 | Bin 0 -> 72435 bytes + ...ase-minimized-hb-subset-fuzzer-5758598970343424 | Bin 0 -> 64 bytes + ...ase-minimized-hb-subset-fuzzer-6543700493598720 | Bin 0 -> 138425 + bytes + ...ase-minimized-hb-subset-fuzzer-6651660668502016 | Bin 0 -> 15229 bytes + ...b-subset-get-codepoints-fuzzer-5203067375976448 | Bin 0 -> 16310 bytes + ...b-subset-get-codepoints-fuzzer-5630904853069824 | Bin 0 -> 580 bytes + ...b-subset-get-codepoints-fuzzer-5687638085337088 | Bin 0 -> 1206 bytes + ...b-subset-get-codepoints-fuzzer-5736539338833920 | Bin 0 -> 512 bytes + ...b-subset-get-codepoints-fuzzer-5973295416475648 | Bin 0 -> 109 bytes + ...b-subset-get-codepoints-fuzzer-6136125075750912 | Bin 0 -> 65816 bytes + ...b-subset-get-codepoints-fuzzer-6394290358976512 | Bin 0 -> 1868 bytes + test/fuzzing/run-shape-fuzzer-tests.py | 4 + + test/shaping/data/in-house/tests/fuzzed.tests | 84 + +++++++++++++++++++++ + 87 files changed, 89 insertions(+) + +commit 2137582c9696b6e38d70b4a0d4199b315c9fd4ce +Author: Behdad Esfahbod +Date: Tue Oct 16 14:46:07 2018 -0700 + + [morx] Reword ligation + + Still fails MORX-41. Am talking to Sascha to better understand + what CoreText + is doing. + + src/hb-aat-layout-morx-table.hh | 25 + ++++++++++++---------- + test/shaping/data/text-rendering-tests/DISABLED | 2 ++ + .../data/text-rendering-tests/Makefile.sources | 2 +- + 3 files changed, 17 insertions(+), 12 deletions(-) + +commit c53a25c6579a4d3fe8e6a6fc198d70add41035ec +Author: Behdad Esfahbod +Date: Tue Oct 16 13:57:35 2018 -0700 + + [morx] Comment + + src/hb-aat-layout-morx-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c46d42f8f2c303817467c6a4e19d69d0e433dba6 +Author: Behdad Esfahbod +Date: Tue Oct 16 13:39:54 2018 -0700 + + [test/text-rendering-tests] Update from upstream + + test/shaping/data/text-rendering-tests/Makefile.sources | 1 + + .../text-rendering-tests/fonts/TestMORXFourtyone.ttf | Bin 0 -> + 2248 bytes + .../data/text-rendering-tests/tests/MORX-41.tests | 4 ++++ + 3 files changed, 5 insertions(+) + +commit 5eb7e7f6461bcf5b1e1d8ccb49eb904382762533 +Author: Behdad Esfahbod +Date: Tue Oct 16 13:32:52 2018 -0700 + + Revert "[vector] Simplify Sort" and "More of the same" + + This reverts commit de0b9a466490c2c13d6ec6f59d5122b0a87d3180. + This reverts commit 921f0e6ec722940a1e37660e1291aa69f9f39db8. + + Annnnd, revert. MSVC doesn't like it. + + src/hb-vector.hh | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +commit 661340c475dc928f227d54b3f36eaf6f41c2b6e3 +Author: Behdad Esfahbod +Date: Tue Oct 16 13:24:29 2018 -0700 + + [kern] Scale kern pairs before applying + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1255 + Fixes https://github.com/harfbuzz/harfbuzz/issues/1252 + + src/hb-ot-kern-table.hh | 18 ++++++++++++------ + src/hb-ot-shape-fallback.cc | 2 +- + 2 files changed, 13 insertions(+), 7 deletions(-) + +commit de0b9a466490c2c13d6ec6f59d5122b0a87d3180 +Author: Behdad Esfahbod +Date: Mon Oct 15 22:20:26 2018 -0700 + + [vector] More of the same + + src/hb-vector.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 921f0e6ec722940a1e37660e1291aa69f9f39db8 +Author: Behdad Esfahbod +Date: Mon Oct 15 22:19:17 2018 -0700 + + [vector] Simplify sort + + Hopefully this fits fine with SFINAE with all our compilers. + + src/hb-vector.hh | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +commit 61510b63c15e91d80e36a497260db0e2d6d36c66 +Author: Ebrahim Byagowi +Date: Tue Oct 16 14:17:21 2018 +0330 + + [test] Minor cleanup in test-multithread and test-ot-name (#1256) + + test/api/CMakeLists.txt | 2 +- + test/api/Makefile.am | 2 +- + test/api/test-multithread.c | 6 ++- + test/api/{test-ot-nameid.c => test-ot-name.c} | 58 + ++++++++++++++------------- + 4 files changed, 36 insertions(+), 32 deletions(-) + +commit 42b75dc3a701b13665115e2a234bfa5dedafef3f +Author: Ebrahim Byagowi +Date: Tue Oct 16 10:58:09 2018 +0330 + + [kerx] Minor, remove debug bit + + src/hb-aat-layout-kerx-table.hh | 1 - + 1 file changed, 1 deletion(-) + +commit 11703afce6cebbb4c5e7cdea59ca59a1787608b8 +Author: Behdad Esfahbod +Date: Mon Oct 15 21:16:58 2018 -0700 + + [kerx] Fix Format6 sanitize + + Fixes https://oss-fuzz.com/v2/testcase-detail/5650286710882304 + + src/hb-aat-layout-kerx-table.hh | 21 +++++++++++---------- + 1 file changed, 11 insertions(+), 10 deletions(-) + +commit 4c27da7638f6d072c3ff93223488c4ab316236c1 +Author: Behdad Esfahbod +Date: Mon Oct 15 19:46:45 2018 -0700 + + [CBDT] Fix more offsetting + + Fixes https://oss-fuzz.com/v2/testcase-detail/5750379279548416 + + src/hb-ot-color-cbdt-table.hh | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit 0f85edb7781f4d5ec2de676979be75a0f6559d80 +Author: Behdad Esfahbod +Date: Mon Oct 15 11:15:54 2018 -0700 + + [morx] Another end-of-text corner case + + Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10990 + + src/hb-aat-layout-morx-table.hh | 2 ++ + 1 file changed, 2 insertions(+) + +commit 55d5ea666c25f75e9b1bc2eb43cfb104a16ebe04 +Author: Behdad Esfahbod +Date: Mon Oct 15 11:04:49 2018 -0700 + + [kerx] Merge clusters in Ligature + + src/hb-aat-layout-morx-table.hh | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit bb35725cd760f07fdb0586453512a106e534b739 +Author: Behdad Esfahbod +Date: Mon Oct 15 10:20:39 2018 -0700 + + [kerx/morx] More end-of-text protection + + src/hb-aat-layout-kerx-table.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 8f3048a1f838484babc4948754c16dda8f53daf1 +Author: Ebrahim Byagowi +Date: Mon Oct 15 12:16:47 2018 +0330 + + [dump-emoji] minor + + src/dump-emoji.cc | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 27e095a613ed0a753231405cab887da19e9aecd1 +Author: Ebrahim Byagowi +Date: Mon Oct 15 12:04:14 2018 +0330 + + [dump-emoji] better explaination of the usage + + src/dump-emoji.cc | 21 ++++++++++++++++++++- + 1 file changed, 20 insertions(+), 1 deletion(-) + +commit 8dc6296818e3a52c003852aa185f2b7eb6afa5d3 +Author: Behdad Esfahbod +Date: Mon Oct 15 01:09:05 2018 -0700 + + [ot-font] Implement TrueType v_origin + + Fixes https://github.com/harfbuzz/harfbuzz/issues/537 + + src/hb-ot-font.cc | 31 +++++++++++++++++- + src/hb-ot-hmtx-table.hh | 43 + ++++++++++++++++--------- + test/shaping/data/in-house/tests/vertical.tests | 2 +- + 3 files changed, 59 insertions(+), 17 deletions(-) + +commit 6e07076fd094afc8c9c8ad8f08453e7882294592 +Author: Behdad Esfahbod +Date: Sun Oct 14 22:22:45 2018 -0700 + + [blob] Fix UBSan error + + src/hb-blob.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit fc812faaa96aa4e67814a92376b2da751d5a0aba +Author: Behdad Esfahbod +Date: Sun Oct 14 21:32:09 2018 -0700 + + [CBDT] Fix more offsetting issues + + Fixes https://github.com/harfbuzz/harfbuzz/issues/960 + + dump-emoji still segfaults. Needs debugging. + + src/hb-ot-color-cbdt-table.hh | 28 +++++++++++++++------------- + 1 file changed, 15 insertions(+), 13 deletions(-) + +commit 6aee3bb87cee88525b745a640df294cb721245f6 +Author: Behdad Esfahbod +Date: Sun Oct 14 21:08:42 2018 -0700 + + [CBDT] Fix offset handling + + Fixes https://github.com/harfbuzz/harfbuzz/issues/960 + + src/hb-ot-color-cbdt-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit da744c6b3e79b778f414ec9f4d9070d06ec2a706 +Author: Behdad Esfahbod +Date: Sun Oct 14 20:49:21 2018 -0700 + + [CBDT] More UnsizedArrayOf cleanup + + src/hb-ot-color-cbdt-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2995b4465bce52b30de2cb6ba24cc80d8602413d +Author: Behdad Esfahbod +Date: Sun Oct 14 20:37:57 2018 -0700 + + [CBDT] Simplify sanitize + + src/hb-ot-color-cbdt-table.hh | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +commit 1c76c8f6ff7877e486f6e94d04b2dc65348b26d5 +Author: Behdad Esfahbod +Date: Sun Oct 14 19:39:31 2018 -0700 + + [morx] Handle end-of-text conditions in Insertion + + Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10955 + + src/hb-aat-layout-morx-table.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 60c13976733ea05e71c66c486d62e31ffbb71bac +Author: Behdad Esfahbod +Date: Sun Oct 14 19:36:46 2018 -0700 + + [buffer] Fix output_glyph at end of buffer + + Part of https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10955 + + src/hb-buffer.hh | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 7efa38257b6f79d1c6e2a9bad29c33af276abe29 +Author: Behdad Esfahbod +Date: Sun Oct 14 19:30:44 2018 -0700 + + [aat] More protection against buffer fail + + src/hb-aat-layout-common.hh | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit e1add2a275a8afa5efc22aa44a4e62646f0b0ba4 +Author: Behdad Esfahbod +Date: Sun Oct 14 16:26:03 2018 -0700 + + [hmtx] Whitespace + + src/hb-ot-hmtx-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 62376a7d983442408059b0b8987e7ca8d1de154e +Author: Behdad Esfahbod +Date: Sun Oct 14 15:20:50 2018 -0700 + + Ignore signed-integer-overflow while kerning + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1247 + + src/hb-ot-kern-table.hh | 1 + + src/hb.hh | 9 +++++++++ + 2 files changed, 10 insertions(+) + +commit 40f2b9355cf827c7b82ea5e55b112ce0032a9abf +Author: Behdad Esfahbod +Date: Sun Oct 14 14:56:32 2018 -0700 + + [kerx] Fix Format1 sanitize + + Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10948 + + src/hb-aat-layout-kerx-table.hh | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit 44af1f93ee32e236a5c14085c72d3fa102a14f5e +Author: Behdad Esfahbod +Date: Sun Oct 14 14:52:17 2018 -0700 + + [aat] Whitespace + + src/hb-aat-layout-common.hh | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 56b8dd17f677ffe97e4d917c47924e1ac7632c71 +Author: Behdad Esfahbod +Date: Sat Oct 13 19:03:33 2018 -0400 + + [aat] Finish off massaging table + + src/hb-aat-layout.cc | 163 + +++++++++++++++++++++++++-------------------------- + 1 file changed, 81 insertions(+), 82 deletions(-) + +commit e0c5e0d91bbc0c8b2bb547ba5cb118989affc617 +Author: Behdad Esfahbod +Date: Sat Oct 13 18:37:14 2018 -0400 + + [aat] WIP remove feature mapping here from hb-coretext + + Need to map enum values to numerics since we don't have CoreText + headers. + + src/hb-aat-layout.cc | 94 +++++++++++++++++++++++++ + src/hb-aat-layout.hh | 22 ++++++ + src/hb-coretext.cc | 189 + +-------------------------------------------------- + 3 files changed, 117 insertions(+), 188 deletions(-) + +commit cb057749131826dd89bc3b92527116a974ae3bbe +Author: Behdad Esfahbod +Date: Sat Oct 13 17:03:32 2018 -0400 + + [coretext] Prepare AAT feature mapping to be moved + + src/hb-coretext.cc | 39 ++++++++++++++++++++++----------------- + 1 file changed, 22 insertions(+), 17 deletions(-) + +commit de6e414c565de5f27b9da8c7b8b11f88659a4c42 +Author: Behdad Esfahbod +Date: Sat Oct 13 13:48:22 2018 -0400 + + [kerx] Sanitize more + + src/hb-aat-layout-kerx-table.hh | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +commit 71f76f2f39c88998b430b171c99b85818d4fa0ab +Author: Behdad Esfahbod +Date: Sat Oct 13 13:36:27 2018 -0400 + + [kerx] Fix-up previous commit + + A "&" was missing. Go back to using pointers that are less + error-prone. + + src/hb-aat-layout-kerx-table.hh | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +commit 6d4b054234b4736ca9927268ee3e2d9a0f8f6ead +Author: Behdad Esfahbod +Date: Sat Oct 13 12:20:33 2018 -0400 + + [kerx] Use sanitizer instead of handcoded runtime sanitization + + src/hb-aat-layout-kerx-table.hh | 24 +++++++++--------------- + 1 file changed, 9 insertions(+), 15 deletions(-) + +commit 5733113662e668a25187e0042935d955e44fb488 +Author: Behdad Esfahbod +Date: Sat Oct 13 12:16:12 2018 -0400 + + [kerx] Wire up context down to get_kerning + + src/hb-aat-layout-kerx-table.hh | 32 ++++++++++++++------------------ + 1 file changed, 14 insertions(+), 18 deletions(-) + +commit c4502833b711a76cce1af0c5bf075692b965c991 +Author: Behdad Esfahbod +Date: Sat Oct 13 11:48:49 2018 -0400 + + [kerx] Use sanitizer.get_num_glyphs() instead of + face->get_num_glyphs() + + src/hb-aat-layout-kerx-table.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit fc45e698f2d8a6d577f33b1e69a83714aceae528 +Author: Behdad Esfahbod +Date: Sat Oct 13 11:39:12 2018 -0400 + + [kerx] Protext against overflows + + src/hb-aat-layout-kerx-table.hh | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +commit ed2ee78136c40de8e7b915dfdfd3ca92880912c3 +Author: Behdad Esfahbod +Date: Sat Oct 13 09:47:51 2018 -0400 + + [hangul] Fix use-after-free issue + + out_info might have moved since we copied it's position into local + info var. + + Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=894937 + + src/hb-ot-shape-complex-hangul.cc | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +commit 63109432cf61333e01af4ef5163d4202bb43f84d +Author: Ebrahim Byagowi +Date: Sat Oct 13 14:00:05 2018 +0330 + + Cosmetic and minor changes + + src/hb-buffer-serialize.cc | 4 +- + src/hb-ot-cmap-table.hh | 4 +- + src/hb-ot-layout-common.hh | 4 +- + src/hb-ot-layout-gsubgpos.hh | 8 +-- + src/hb-ot-layout.cc | 127 + +++++++++++++++++++------------------------ + src/hb-ot-layout.h | 25 +++++---- + src/hb-ot-math-table.hh | 8 +-- + src/hb-ot-name.h | 1 - + src/hb-ot-shape-complex.hh | 18 +++--- + 9 files changed, 93 insertions(+), 106 deletions(-) + +commit c0a6814b49e376984a0cae9d385a6f6ba8c73579 +Author: Behdad Esfahbod +Date: Fri Oct 12 16:05:56 2018 -0400 + + Touch up new API + + New API: + +hb_ot_layout_feature_get_name_ids() + +hb_ot_layout_feature_get_characters() + + src/hb-ot-layout.cc | 16 +++++++++------- + src/hb-ot-layout.h | 2 -- + test/api/test-ot-nameid.c | 16 ++++++++++------ + 3 files changed, 19 insertions(+), 15 deletions(-) + +commit 477bc9aafeaf89708d13a436869126351e2d9b50 +Author: Behdad Esfahbod +Date: Fri Oct 12 15:52:31 2018 -0400 + + Add hb-ot-name.h + + Actual name-fetching API to come later. + + New API: + hb_name_id_t + HB_NAME_ID_INVALID + + src/Makefile.sources | 1 + + src/hb-ot-layout-common.hh | 2 +- + src/hb-ot-layout.h | 12 ++--------- + src/hb-ot-name.h | 54 + ++++++++++++++++++++++++++++++++++++++++++++++ + src/hb-ot.h | 1 + + 5 files changed, 59 insertions(+), 11 deletions(-) + +commit dc49bd8d813571fe16d9e5342e4a3926ff947bd6 +Author: Ebrahim Byagowi +Date: Fri Oct 12 03:00:59 2018 +0330 + + Add two APIs for getting stylistic set labels + + * hb_ot_layout_feature_get_characters + * hb_ot_layout_feature_get_name_ids + + However HarfBuzz currently doesn't expose an API for retrieving + the actual + information associated with NameId from the `name` table and that + should be + done separately. + + docs/harfbuzz-sections.txt | 2 + + src/hb-ot-layout-common.hh | 14 +++++ + src/hb-ot-layout.cc | 133 + +++++++++++++++++++++++++++++++++++++++++++++ + src/hb-ot-layout.h | 29 ++++++++++ + test/api/CMakeLists.txt | 2 + + test/api/Makefile.am | 1 + + test/api/fonts/cv01.otf | Bin 0 -> 1956 bytes + test/api/test-ot-nameid.c | 96 ++++++++++++++++++++++++++++++++ + 8 files changed, 277 insertions(+) + +commit e9f9c0d81c73d8b6d87700aadb5b886bd289769a +Author: Behdad Esfahbod +Date: Thu Oct 11 21:37:45 2018 -0400 + + [sanitize] Reorder condition to silence bogus gcc warning + + Was givin a dozen of: + + ../../src/hb-machinery.hh: In member function ‘bool + AAT::ankr::sanitize(hb_sanitize_context_t*) const’: + ../../src/hb-machinery.hh:307:23: warning: missed loop optimization, + the loop counter may overflow [-Wunsafe-loop-optimizations] + bool ok = --this->max_ops > 0 && + ~~~~~~~~~~~~~~~~~~~~~~ + this->start <= p && + ~~~~~~~~~~~~~~~~~~~ + p <= this->end && + ~~~~~~~~~~~~~~~^~ + (unsigned int) (this->end - p) >= len; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + I believe those are bogus, but this silences them and does not + introduce + logic issues I believe. + + src/hb-machinery.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 1a6b5ac6c300ed2ccdcd8eadde433120f6e07f2a +Author: Behdad Esfahbod +Date: Thu Oct 11 21:22:49 2018 -0400 + + Add HB_DEPRECATED_FOR and mark relevant symbols + + src/hb-common.h | 8 ++++++++ + src/hb-deprecated.h | 10 +++++----- + src/hb-graphite2.h | 2 +- + 3 files changed, 14 insertions(+), 6 deletions(-) + +commit c9413d7bb575093411b39ac21974795b6ad91454 +Author: Behdad Esfahbod +Date: Thu Oct 11 21:19:39 2018 -0400 + + [graphite] Add HB_DEPRECATED annotation + + src/hb-graphite2.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 68c86af187ff645a1305ac3b64832f3bb2350519 +Author: Behdad Esfahbod +Date: Thu Oct 11 21:18:20 2018 -0400 + + Always compile deprecated symbols + + We haven't been keeping this updated. So, while we don't expose the + symbols in the headers if HB_DISABLE_DEPRECATED is defined, we still + always build them. + + src/hb-font.cc | 4 ---- + 1 file changed, 4 deletions(-) + +commit c55100000bc20d7c8319cfc54294215a923ffc25 +Author: David Corbett +Date: Thu Oct 11 22:08:14 2018 -0400 + + Add missing colons to GObject annotations + + src/hb-ot-tag.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 1e816d62efe1b3540ef605092b97794e68ec0832 +Author: David Corbett +Date: Thu Oct 11 20:37:49 2018 -0400 + + Fix Indic script tags in Graphite + + src/hb-graphite2.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit bf8469be9a8932cc407b60daf4d494fef46e233b +Author: Behdad Esfahbod +Date: Thu Oct 11 20:45:00 2018 -0400 + + Attach CursivePositioning backwards, not forward + + This is how Uniscribe does it. So, adjust. This is only relevant + to fonts that apply cursive positioning from a contextual lookup. + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1181 + + src/hb-ot-layout-gpos-table.hh | 20 + ++++++++++---------- + .../9fc3e6960b3520e5304033ef5fd540285f72f14d.ttf | Bin 0 -> 2380 bytes + .../data/in-house/tests/cursive-positioning.tests | 1 + + 3 files changed, 11 insertions(+), 10 deletions(-) + +commit bdb53ca24a5ad9671d8e29e17d1d8981505bd882 +Author: Behdad Esfahbod +Date: Thu Oct 11 20:20:00 2018 -0400 + + [myanmar] Implement Zawgyi shaper + + Enabled if script tag 'Qaag' is passed to HarfBuzz. Disables mark + advance-zeroing and fallback mark-positioning. + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1162 + + src/hb-ot-shape-complex-myanmar.cc | 22 + +++++++++++++++++++++ + src/hb-ot-shape-complex.hh | 5 +++++ + src/hb.hh | 8 ++++++++ + test/shaping/data/in-house/Makefile.sources | 1 + + .../ab14b4eb9d7a67e293f51d30d719add06c9d6e06.ttf | Bin 0 -> 1792 bytes + .../data/in-house/tests/myanmar-zawgyi.tests | 1 + + 6 files changed, 37 insertions(+) + +commit 00c5c4a79dfb352a679a5c56bf9c756ab0fa98d2 +Author: Behdad Esfahbod +Date: Thu Oct 11 20:15:31 2018 -0400 + + [myanmar] Shuffle + + src/hb-ot-shape-complex-myanmar.cc | 33 +++++++++++++++++---------------- + 1 file changed, 17 insertions(+), 16 deletions(-) + +commit ec8f493bf9fefc33f027db24c4b175990b2d751c +Author: Behdad Esfahbod +Date: Thu Oct 11 20:15:00 2018 -0400 + + [graphite] Remove assert + + src/hb-graphite2.cc | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 5646dcbd1125049c3af342fadfcfcbd523ce53d3 +Author: Behdad Esfahbod +Date: Thu Oct 11 19:39:07 2018 -0400 + + Minor + + src/hb-ot-tag.cc | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit 788e1478557603d30966f12449eef0d0bd51c880 +Author: Behdad Esfahbod +Date: Thu Oct 11 19:24:52 2018 -0400 + + [test] Add test for USE indic3 + + test/shaping/data/in-house/Makefile.sources | 1 + + .../fonts/3c96e7a303c58475a8c750bf4289bbe73784f37d.ttf | Bin 0 -> + 3364 bytes + test/shaping/data/in-house/tests/use-indic3.tests | 1 + + 3 files changed, 2 insertions(+) + +commit a11972787a2a90b541f92cc56bb885859390a0c0 +Author: Behdad Esfahbod +Date: Thu Oct 11 19:23:36 2018 -0400 + + Minor + + test/shaping/record-test.sh | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 654365dc894326f04abaaba415f48ca5ba2d1286 +Author: Behdad Esfahbod +Date: Thu Oct 11 17:51:21 2018 -0400 + + Pass indic3 tags to USE shaper + + Fixes https://github.com/harfbuzz/harfbuzz/issues/539 + + src/hb-ot-shape-complex.hh | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 28d091d045b042506a1ec2cdefe7cf0d718e8b22 +Author: David Corbett +Date: Thu Oct 11 17:15:22 2018 -0400 + + Parse Indic3 tags + + src/hb-ot-tag.cc | 11 ++++++++--- + test/api/test-ot-tag.c | 44 +++++++++++++++++++++++++------------------- + 2 files changed, 33 insertions(+), 22 deletions(-) + +commit 211cd3691ba01b1cb2eeb8a91ac3532181791a8a +Author: Behdad Esfahbod +Date: Thu Oct 11 17:31:29 2018 -0400 + + Remove remains of get-codepoint-fuzzer + + test/fuzzing/CMakeLists.txt | 7 +------ + test/fuzzing/run-subset-fuzzer-tests.py | 12 ------------ + 2 files changed, 1 insertion(+), 18 deletions(-) + +commit 120ed0272569e6a34172a511d4a5a70a3a18f1d2 +Author: Behdad Esfahbod +Date: Thu Oct 11 17:08:12 2018 -0400 + + [fuzzing] Fold get-codepoints-fuzzer into subset-fuzzer + + test/fuzzing/Makefile.am | 16 ---------------- + test/fuzzing/hb-subset-fuzzer.cc | 5 +++++ + test/fuzzing/hb-subset-get-codepoints-fuzzer.cc | 23 + ----------------------- + 3 files changed, 5 insertions(+), 39 deletions(-) + +commit 2c824d3644e16643c2bbe85fb88f9fb6fed53ce7 +Author: Behdad Esfahbod +Date: Thu Oct 11 16:41:01 2018 -0400 + + [aat] Fix two wrongs that made a right before! + + Unfortunately our static asserts (DEFINE_SIZE_STATIC) don't actually + fail when used in templates, thanks to SFINAE. Le sighs. + + Probably fixes + https://oss-fuzz.com/v2/testcase-detail/5740171484463104 + + src/hb-aat-layout-common.hh | 4 ++-- + src/hb-open-type.hh | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit e940530c9723c3a581a5d5b31e5f419865dd6cc7 +Author: Behdad Esfahbod +Date: Thu Oct 11 15:56:17 2018 -0400 + + [aat] Fix mul overflow + + Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10897 + + src/hb-aat-layout-common.hh | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +commit 1d995a340b9e17fc8dca7a3e88e0918de2d8f02c +Author: Behdad Esfahbod +Date: Thu Oct 11 15:42:54 2018 -0400 + + Minor + + test/api/hb-subset-test.h | 6 ++---- + test/api/test-multithread.c | 5 +---- + test/fuzzing/main.cc | 2 +- + 3 files changed, 4 insertions(+), 9 deletions(-) + +commit 0744a02cb12e4d800abb611dfa5d268bb2dfd9f3 +Author: Behdad Esfahbod +Date: Thu Oct 11 15:14:18 2018 -0400 + + [arabic] Update to latest UTR#53 + + From Lorna Evans: "That was a new character added to Unicode 11.0" + + src/hb-ot-shape-complex-arabic.cc | 1 + + 1 file changed, 1 insertion(+) + +commit 57b05210b1a8968d18ccbbe70879b2e11b6a09f2 +Author: Behdad Esfahbod +Date: Thu Oct 11 15:03:21 2018 -0400 + + [test] Fix use of deprecated symbols + + test/api/test-ot-tag.c | 60 + ++++++++++++++++++++++++++++++++++++++------------ + 1 file changed, 46 insertions(+), 14 deletions(-) + +commit 4f9e36e8cf5d9d3d3e5a1ed46149355ee5f5e9fb +Author: Behdad Esfahbod +Date: Thu Oct 11 14:32:59 2018 -0400 + + [graphite] Remove deprecated symbol use + + src/hb-graphite2.cc | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +commit da591f2a9d2ae2a5878d3b2ef78a6d589b19aab0 +Author: Behdad Esfahbod +Date: Thu Oct 11 14:30:15 2018 -0400 + + Whitespace + + src/hb-ot-tag.cc | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 4d205f0462b19f371df495b9cc12c0128f507de9 +Author: Behdad Esfahbod +Date: Thu Oct 11 14:25:48 2018 -0400 + + [graphite] Fix deva/dev2 resolution + + See + https://github.com/harfbuzz/harfbuzz/pull/730#issuecomment-428277800 + + src/hb-graphite2.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 8061664ad1a5933098adc3bc1dca0b5be48586ef +Author: Behdad Esfahbod +Date: Thu Oct 11 14:16:55 2018 -0400 + + Add doc stubs for recently added API + + Thanks to David Corbett who revamped our script and language + processing + and implemented full BCP 47 support. + + https://github.com/harfbuzz/harfbuzz/pull/730 + + New API: + +hb_ot_layout_table_select_script() + +hb_ot_layout_script_select_language() + +HB_OT_MAX_TAGS_PER_SCRIPT + +HB_OT_MAX_TAGS_PER_LANGUAGE + +hb_ot_tags_from_script_and_language() + +hb_ot_tags_to_script_and_language() + + Deprecated API: + -hb_ot_layout_table_choose_script() + -hb_ot_layout_script_find_language() + -hb_ot_tags_from_script() + -hb_ot_tag_from_language() + + src/hb-ot-layout.cc | 10 ++++++++++ + src/hb-ot-tag.cc | 21 ++++++++++++++++----- + src/hb-ot-tag.h | 10 ++++++++++ + src/hb-unicode.h | 2 +- + 4 files changed, 37 insertions(+), 6 deletions(-) + +commit cf975ac653bff369f4ed7ba7fc04fae6ce2cec95 +Author: Behdad Esfahbod +Date: Thu Oct 11 14:07:44 2018 -0400 + + Remove use of deprecated function + + src/hb-ot-layout.cc | 23 ++++++++++++----------- + src/hb-ot-layout.h | 12 ++++++------ + 2 files changed, 18 insertions(+), 17 deletions(-) + +commit 66790d64c7120b75c72bf91c769dc52d95858909 +Author: David Corbett +Date: Mon Sep 10 13:15:00 2018 -0400 + + Increase HB_OT_MAX_TAGS_PER_SCRIPT to 3 + + No script has 3 tags yet, but the plan is for the Indic scripts + to each + get a third tag someday. + + src/hb-ot-tag.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit bca7a16938609539e4adb5cdf943734b7dfa1561 +Author: David Corbett +Date: Mon Sep 10 12:05:51 2018 -0400 + + Update language system tag registry to OT 1.8.3 + + src/gen-tag-table.py | 10 +++++++++- + src/hb-ot-tag-table.hh | 44 +++++++++++++++++++++++++++++++++----------- + 2 files changed, 42 insertions(+), 12 deletions(-) + +commit 7f1fbfe2e312f397db9271dd17a8e701489ffc79 +Author: David Corbett +Date: Mon Jul 23 21:19:23 2018 -0400 + + Add hb_ot_tags_to_script_and_language + + docs/harfbuzz-sections.txt | 3 +- + src/hb-ot-map.cc | 2 +- + src/hb-ot-tag.cc | 75 + ++++++++++++++++++++++++++++++++++++++++------ + src/hb-ot-tag.h | 18 +++++++---- + test/api/test-ot-tag.c | 33 ++++++++++++++++++-- + 5 files changed, 112 insertions(+), 19 deletions(-) + +commit 3f8877473fb4c72a6f3edfcfc927b9993a5f3616 +Author: David Corbett +Date: Thu Jul 19 13:48:07 2018 -0400 + + Switch on the first char of a complex language tag + + This results in a tenfold speed-up for the common case of tags + that are + not complex, in the sense of `hb_ot_tags_from_complex_language`. + + src/gen-tag-table.py | 171 ++++-- + src/hb-ot-tag-table.hh | 1580 + ++++++++++++++++++++++++------------------------ + 2 files changed, 922 insertions(+), 829 deletions(-) + +commit a754d44195021603306af2a296d06187eda95409 +Author: David Corbett +Date: Mon Jul 16 21:14:48 2018 -0400 + + Map Quechua languages to closest ones with tags + + OpenType only officially maps four ISO 639 codes to Quechua languages, + but prior versions of HarfBuzz also mapped qu to 'QUZ '. Because qu + is a + macrolanguage, the mapping now applies to all individual Quechua + languages. OpenType calls 'QUZ ' "Quechua", but it really corresponds + to + Cusco Quechua, so the individual Quechua languages should not all + necessarily be mapped to it. + + src/gen-tag-table.py | 32 ++++++++++++++++++++++++++ + src/hb-ot-tag-table.hh | 62 + +++++++++++++++++++++++++++----------------------- + 2 files changed, 65 insertions(+), 29 deletions(-) + +commit 65d01f77552a5102ee114d9917fd2ecf091a35c3 +Author: David Corbett +Date: Thu Jan 18 16:33:39 2018 -0500 + + Test deprecated tag fallback in a font + + The font supports the deprecated tag 'DHV ' instead of 'DIV '. dv is + mapped to 'DIV ' and 'DHV ', in that order. The test specifies + `--language=dv`, demonstrating that if a font does not support + the first + OpenType tag mapped to a BCP 47 tag, it will fall back to the + next tag. + + .../fonts/d3129450fafe5e5c98cfc25a4e71809b1b4d2855.ttf | Bin 0 -> + 956 bytes + test/shaping/data/in-house/tests/language-tags.tests | 1 + + 2 files changed, 1 insertion(+) + +commit 7c7cb2a98907d99ca86bdbfca0bf9c48bfa4ed49 +Author: David Corbett +Date: Sat Jan 20 15:53:09 2018 -0500 + + Match extlang subtags + + If the second subtag of a BCP 47 tag is three letters long, it denotes + an extended language. The tag converter ignores the language + subtag and + uses the extended language instead. + + There are some grandfathered exceptions, which are handled earlier. + + src/gen-tag-table.py | 2 +- + src/hb-ot-tag-table.hh | 21 +++++++++++++++++++++ + src/hb-ot-tag.cc | 10 +++++++++- + test/api/test-ot-tag.c | 7 +++++++ + 4 files changed, 38 insertions(+), 2 deletions(-) + +commit 2f1f961cc0f0f907916b4b00342d8a2dda8b4ee1 +Author: David Corbett +Date: Fri Dec 8 22:45:52 2017 -0500 + + Autogenerate the BCP 47 to OpenType mappings + + The new script, gen-tag-table.py, generates `ot_languages` + automatically + from the [OpenType language system tag registry][ot] and the [IANA + Language Subtag Registry][bcp47] with some manual modifications. If an + OpenType tag maps to a BCP 47 macrolanguage, all the macrolanguage's + individual languages are mapped to the same OpenType tag, except for + individual languages with their own OpenType mappings. Deprecated + BCP 47 tags are canonicalized. + + [ot]: + https://docs.microsoft.com/en-us/typography/opentype/spec/languagetags + [bcp47]: + https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry + + Some OpenType tags correspond to multiple ISO 639 codes. The mapping + from ISO 639 codes lists OpenType tags in priority order, such + that more + specific or more likely tags appear first. + + Some OpenType tags have no corresponding ISO 639 code in the + registry so + their mappings use BCP 47 subtags besides the language. For example, + any + BCP 47 tag with a fonipa variant subtag is mapped to 'IPPH', and + 'IPPH' + is mapped back to und-fonipa. + + Other OpenType tags have no corresponding ISO 639 code because it + is not + clear what they are for. HarfBuzz just ignores these tags. + + One such ignored tag is 'ZHP ' (Chinese Phonetic). It probably means + zh-Latn. However, it is used in Microsoft JhengHei and Microsoft YaHei + with the script tag 'hani', implying that it is not a romanization + scheme after all. It would be simple enough to add this mapping to + gen-tag-table.py once a definitive mapping is determined. + + The manual modifications are mainly either obvious mappings that the + OpenType registry omits or mappings for compatibility with previous + versions of HarfBuzz. Some of the old mappings were discarded, though, + for homophonous language names. For example, OpenType maps 'KUI ' to + kxu; previous versions of HarfBuzz also mapped it to kvd, because kvd + and kxu both happen to be called "Kui". + + gen-tag-table.py also generates a function to convert multi-subtag + tags + like el-polyton and zh-HK to OpenType tags, replacing + `ot_languages_zh` + and the hard-coded list of special cases in + `hb_ot_tags_from_language`. + It also generates a function to convert OpenType tags to BCP 47, + replacing the hard-coded list of special cases in + `hb_ot_tag_to_language`. + + src/Makefile.am | 9 +- + src/Makefile.sources | 1 + + src/gen-tag-table.py | 1013 ++++++++++++++++++++++++ + src/hb-ot-tag-table.hh | 1997 + ++++++++++++++++++++++++++++++++++++++++++++++++ + src/hb-ot-tag.cc | 842 +------------------- + src/hb-ot-tag.h | 2 +- + test/api/test-ot-tag.c | 66 +- + 7 files changed, 3092 insertions(+), 838 deletions(-) + +commit 2c7d4db7af16e228bb30eddf7334a524b74ae26c +Author: David Corbett +Date: Fri Dec 29 20:19:05 2017 +0800 + + Deprecate obsolete functions + + `hb_ot_tags` replaces `hb_ot_tags_from_script` and + `hb_ot_tag_from_language`. + + `hb_ot_layout_table_select_script` replaces + `hb_ot_layout_table_choose_script`. + + `hb_ot_layout_script_select_language` replaces + `hb_ot_layout_script_find_language`. + + docs/harfbuzz-sections.txt | 8 ++++---- + src/hb-deprecated.h | 23 +++++++++++++++++++++++ + src/hb-ot-layout.h | 15 --------------- + src/hb-ot-tag.h | 8 -------- + 4 files changed, 27 insertions(+), 27 deletions(-) + +commit 91067716f5e7b15d9a642f69019246c83fc7c108 +Author: David Corbett +Date: Fri Dec 8 11:21:14 2017 -0500 + + Refactor the selection of script and language tags + + The old hb-ot-tag.cc functions, `hb_ot_tags_from_script` and + `hb_ot_tag_from_language`, are now wrappers around a new function: + `hb_ot_tags`. It converts a script and a language to arrays of script + tags and language tags. This will make it easier to add new script + tags + to scripts, like 'dev3'. It also allows for language fallback chains; + nothing produces more than one language yet though. + + Where the old functions return the default tags 'DFLT' and 'dflt', + `hb_ot_tags` returns an empty array. The caller is responsible for + using the default tag in that case. + + The new function also adds a new private use subtag syntax for script + overrides: "x-hbscabcd" requests a script tag of 'abcd'. + + The old hb-ot-layout.cc functions,`hb_ot_layout_table_choose_script` + and + `hb_ot_layout_script_find_language` are now wrappers around the new + functions `hb_ot_layout_table_select_script` and + `hb_ot_layout_script_select_language`. They are essentially the + same as + the old ones plus a tag count parameter. + + Closes #495. + + docs/harfbuzz-sections.txt | 5 + + src/hb-ot-layout.cc | 43 +- + src/hb-ot-layout.h | 16 + + src/hb-ot-map.cc | 13 +- + src/hb-ot-tag.cc | 1639 + ++++++++++++++++++++++++-------------------- + src/hb-ot-tag.h | 11 + + test/api/test-ot-tag.c | 107 +++ + 7 files changed, 1070 insertions(+), 764 deletions(-) + +commit a03f5f4dfbbf885db567c3909241a55eb5869fce +Author: David Corbett +Date: Thu Dec 28 22:59:29 2017 +0800 + + Replace "ISO 639" with "BCP 47" + + `hb_language_from_string` accepts not only ISO 639 but also BCP + 47. Not + all ISO 639 codes are valid BCP 47 tags but the function does + not accept + overlong language subtags anyway. + + src/hb-buffer.cc | 2 +- + src/hb-common.cc | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +commit 0b9d60e1a1c4b7867ac907bbd7c004191a14e697 +Author: Behdad Esfahbod +Date: Thu Oct 11 13:26:58 2018 -0400 + + [aat] Apply kerx if GPOS kern was not applied + + Ned tells me this is what Apple does. + + src/hb-ot-shape.cc | 18 ++++++++---------- + 1 file changed, 8 insertions(+), 10 deletions(-) + +commit b59a428af08d6451a47f40ed01e594815ebf6303 +Author: Behdad Esfahbod +Date: Thu Oct 11 13:24:17 2018 -0400 + + Minor + + src/hb-ot-shape.cc | 6 +++++- + src/hb-ot-shape.hh | 5 +++-- + 2 files changed, 8 insertions(+), 3 deletions(-) + +commit 100e95f48e3d137c654d206e858d6419ea62a12c +Author: Behdad Esfahbod +Date: Thu Oct 11 11:30:45 2018 -0400 + + [trak] Add tests + + test/shaping/data/in-house/Makefile.sources | 1 + + test/shaping/data/in-house/fonts/TestTRAK.ttf | Bin 0 -> 2456 bytes + test/shaping/data/in-house/tests/aat-trak.tests | 8 ++++++++ + 3 files changed, 9 insertions(+) + +commit 04f72e8990ea61ffc6b62105c75e0a3e1b1ebab4 +Author: Behdad Esfahbod +Date: Thu Oct 11 11:25:07 2018 -0400 + + [trak] Implement extrapolation + + This concludes trak, as well as AAT shaping support! + + src/hb-aat-layout-trak-table.hh | 39 + ++++++++++++++++++++------------------- + 1 file changed, 20 insertions(+), 19 deletions(-) + +commit d6a12dba6da6262fd9e5d8397b46ac8516136cae +Author: Behdad Esfahbod +Date: Thu Oct 11 11:10:06 2018 -0400 + + [trak] Fix, and hook up + + Works beautifully! Test coming. + + src/hb-aat-layout-common.hh | 4 ++-- + src/hb-aat-layout-trak-table.hh | 6 ++++-- + src/hb-aat-layout.cc | 25 ++++++++++++++++++++++++- + src/hb-aat-layout.hh | 8 ++++++++ + src/hb-ot-shape.cc | 2 ++ + 5 files changed, 40 insertions(+), 5 deletions(-) + +commit 3d7dea6dfdc9e75dcca100a79525aa3736dbe29c +Author: Behdad Esfahbod +Date: Thu Oct 11 10:32:08 2018 -0400 + + [trak] Handle nSizes=0 and 1 + + src/hb-aat-layout-trak-table.hh | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +commit 451f3de521ff1b7f4d3b8ebb2cc0b95d88c9314a +Author: Behdad Esfahbod +Date: Thu Oct 11 10:30:32 2018 -0400 + + [trak] Fix counting + + src/hb-aat-layout-trak-table.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit a5be380cae9b49ed85c8620f1921209ef61a72ad +Author: Behdad Esfahbod +Date: Thu Oct 11 10:29:02 2018 -0400 + + [trak] More + + src/hb-aat-layout-trak-table.hh | 26 +++++++++++++++++--------- + 1 file changed, 17 insertions(+), 9 deletions(-) + +commit d06c4a867f0d383d8c27f2957e646d9e3fe6853b +Author: Behdad Esfahbod +Date: Thu Oct 11 10:22:01 2018 -0400 + + [trak] Only adjust around first glyph + + Assumes graphemes only have one base glyph. + + src/hb-aat-layout-trak-table.hh | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit 071a2cbcddcbafae9458e674c21db5001b39518d +Author: Behdad Esfahbod +Date: Thu Oct 11 10:18:46 2018 -0400 + + [trak] Clean up + + src/hb-aat-layout-trak-table.hh | 67 + +++++++++++++++++++++++------------------ + 1 file changed, 37 insertions(+), 30 deletions(-) + +commit fbbd926dba163d9a2a6a62f380951f03363c2b14 +Author: Behdad Esfahbod +Date: Thu Oct 11 01:22:29 2018 -0400 + + [kerx] Implement Format4 action_type=1 contour-point-based attachment + + Untested. + + This concludes kerx table support! + + src/hb-aat-layout-kerx-table.hh | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +commit b6bc0d4ff62e4509643db3b304306a72bbcb2c38 +Author: Behdad Esfahbod +Date: Thu Oct 11 01:17:57 2018 -0400 + + [kerx] Implement Format4 action_type=2 coordinate-based attachment + + Untested. + + src/hb-aat-layout-kerx-table.hh | 21 ++++++++++++--------- + 1 file changed, 12 insertions(+), 9 deletions(-) + +commit 1622ba5943d14b2d50d45dc17fb723f4c9ddb0bb +Author: Behdad Esfahbod +Date: Thu Oct 11 01:14:18 2018 -0400 + + [kerx] Implement Format4 'ankr'-based mark attachment + + Tested with Kannada MN: + + $ HB_OPTIONS=aat ./hb-shape Kannada\ MN.ttc -u 0CCD,0C95,0CD6 + [kn_ka.vattu=0+230|kn_ai_length_mark=1@326,0+607] + + src/hb-aat-layout-common.hh | 8 ++++++-- + src/hb-aat-layout-kerx-table.hh | 20 +++++++++++++++++--- + src/hb-aat-layout.cc | 20 ++++++++++++++++---- + src/hb-ot-layout-gpos-table.hh | 4 ---- + 4 files changed, 39 insertions(+), 13 deletions(-) + +commit 7bb4da7d9538f3d4b1d28030d43e0c3d720d821b +Author: Behdad Esfahbod +Date: Thu Oct 11 00:52:07 2018 -0400 + + [aat] Wire up 'ankr' table to apply context + + src/hb-aat-layout-common.hh | 7 +++++-- + src/hb-aat-layout.cc | 8 +++++++- + 2 files changed, 12 insertions(+), 3 deletions(-) + +commit 28f0367aab648c486d6e8d0e13dbbb2af1b65dcc +Author: Behdad Esfahbod +Date: Thu Oct 11 00:12:49 2018 -0400 + + [kerx] Flesh out Format4 + + Doesn't apply actions yet. + + src/hb-aat-layout-kerx-table.hh | 122 + ++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 118 insertions(+), 4 deletions(-) + +commit 947962a287d9aca2cb509c11f44cb5150aa6daf1 +Author: Behdad Esfahbod +Date: Wed Oct 10 23:07:03 2018 -0400 + + [ankr] Implement table access + + src/hb-aat-layout-ankr-table.hh | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +commit 7281cb3eeb00091c6e6085895afd4a38a0516f35 +Author: Behdad Esfahbod +Date: Wed Oct 10 22:56:52 2018 -0400 + + [ankr] Start fixing + + src/hb-aat-layout-ankr-table.hh | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +commit 34caadc5c78e3d09faf11ef60bfade8f64f55de2 +Author: Behdad Esfahbod +Date: Wed Oct 10 22:17:07 2018 -0400 + + Ugh. Re-enable accidentally disabled GPOS + + src/hb-ot-shape.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f7c45bc33ec1559c960a039b770d5c37bd82f057 +Author: Behdad Esfahbod +Date: Wed Oct 10 22:15:13 2018 -0400 + + [kerx] Allow granularly disabling kerning + + src/hb-aat-layout-kerx-table.hh | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +commit 2b72c4b63d29eea39b646c8a1a1cfc2db732e1a6 +Author: Behdad Esfahbod +Date: Wed Oct 10 21:53:14 2018 -0400 + + [kerx] Comment + + src/hb-aat-layout-kerx-table.hh | 3 +++ + 1 file changed, 3 insertions(+) + +commit 9f450f07b0a1593962e3b45d00f2cf93916f3466 +Author: Behdad Esfahbod +Date: Wed Oct 10 21:46:58 2018 -0400 + + [kerx] Make Format1 work + + Tested using Kannada MN: + + $ HB_OPTIONS=aat ./hb-shape Kannada\ MN.ttc -u 0C95,0CCd,C95,CCD + [kn_ka.virama=0+1299|kn_ka.vattu=0+115|_blank=0@-115,0+385] + + $ HB_OPTIONS=aat ./hb-shape Kannada\ MN.ttc -u 0C95,0CCd,C95,CCD + --features=-kern + [kn_ka.virama=0+1799|kn_ka.vattu=0+230|_blank=0+0] + + I don't see the GPOS table in the font do the same. ¯\_(ツ)_/¯ + + src/hb-aat-layout-kerx-table.hh | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +commit 504cb68fc972c7f606bf9fc62015376382f78f45 +Author: Behdad Esfahbod +Date: Wed Oct 10 21:29:46 2018 -0400 + + Disable mark advance zeroing as well as mark fallback positioning + if doing kerx + + src/hb-ot-shape.cc | 50 + ++++++++++++++++++++++++++------------------------ + 1 file changed, 26 insertions(+), 24 deletions(-) + +commit 84967537966a76297c89460d95e7336f1bfc332d +Author: Behdad Esfahbod +Date: Wed Oct 10 21:18:37 2018 -0400 + + [kerx] Implement Format1 + + Untested. + + src/hb-aat-layout-kerx-table.hh | 62 + +++++++++++++++++++++++++++++++++-------- + src/hb-aat-layout-morx-table.hh | 2 +- + 2 files changed, 52 insertions(+), 12 deletions(-) + +commit c9165f5450b99e6d93e2a168b198384a221eef58 +Author: Behdad Esfahbod +Date: Wed Oct 10 20:43:21 2018 -0400 + + [kerx] More UnsizedArrayOf<> + + src/hb-aat-layout-kerx-table.hh | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +commit ca54eba4846d0afda4601929556617a7ebe51714 +Author: Behdad Esfahbod +Date: Wed Oct 10 20:41:16 2018 -0400 + + [kerx] Fix bound-checking error introduced a couple commits past + + src/hb-aat-layout-kerx-table.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 339036dd970625e03696b4533ced1e25fc4fd131 +Author: Behdad Esfahbod +Date: Wed Oct 10 20:37:22 2018 -0400 + + [kerx] Start fleshing out Format1 + + src/hb-aat-layout-kerx-table.hh | 59 + +++++++++++++++++++++++++++++++++++------ + src/hb-aat-layout-morx-table.hh | 2 +- + 2 files changed, 52 insertions(+), 9 deletions(-) + +commit ab1f30bd059f1d2270793e9726b60666b328d2b8 +Author: Behdad Esfahbod +Date: Wed Oct 10 20:10:20 2018 -0400 + + [kerx] Implement Format6 + + Untested. The only Apple font shipping with this format is San + Francisco fonts + that use this for their kerx variation tables, which we don't support. + + src/hb-aat-layout-kerx-table.hh | 73 + +++++++++++++++++++++++++++++++++-------- + 1 file changed, 60 insertions(+), 13 deletions(-) + +commit c9a2ce9e05f91730a2150b9214dc6a49f31555c1 +Author: Behdad Esfahbod +Date: Wed Oct 10 20:00:44 2018 -0400 + + [kerx] Move bounds-checking to subtable length itself + + src/hb-aat-layout-kerx-table.hh | 12 +++++------- + 1 file changed, 5 insertions(+), 7 deletions(-) + +commit 22955b23cdeb48e46cdffd0eb906a855a420c4d1 +Author: Behdad Esfahbod +Date: Wed Oct 10 19:58:20 2018 -0400 + + [kerx] Start fleshing out Format6 + + src/hb-aat-layout-kerx-table.hh | 42 + ++++++++++++++++++++++++++++++++--------- + src/hb-open-type.hh | 3 +++ + 2 files changed, 36 insertions(+), 9 deletions(-) + +commit f6aaad9b4ffb42e6cd8398f6439fe420e393c8f6 +Author: Behdad Esfahbod +Date: Wed Oct 10 19:20:06 2018 -0400 + + [kerx] When rejecting variable kerning, also check for tupleCount + + src/hb-aat-layout-kerx-table.hh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 7ed5366d3cfca9c533250cb419e8cc878f32505d +Author: Behdad Esfahbod +Date: Wed Oct 10 19:11:30 2018 -0400 + + [kerx] No-op + + Tested that Format0 works with Kannada MN font: + + $ make -j5 lib -s && HB_OPTIONS=aat ./hb-shape Kannada\ MN.ttc + -u 0C95,0CC2 + [kn_ka=0+1000|kn_matra_uu=0@-30,0+1345] + + $ make -j5 lib -s && HB_OPTIONS=aat ./hb-shape Kannada\ MN.ttc -u + 0C95,0CC2 --features=-kern + [kn_ka=0+1030|kn_matra_uu=0+1375] + + Note that GPOS does the same with 'dist' feature, and applies the + whole difference to the + same glyph: + + $ make -j5 lib -s && ./hb-shape Kannada\ MN.ttc -u 0C95,0CC2 + [kn_ka=0+970|kn_matra_uu=0+1375] + + $ make -j5 lib -s && ./hb-shape Kannada\ MN.ttc -u 0C95,0CC2 + --features=-dist + [kn_ka=0+1030|kn_matra_uu=0+1375] + + src/hb-aat-layout-kerx-table.hh | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit 7fa69e92ca3dd9d8fa92aba0e01098165d2b7975 +Author: Behdad Esfahbod +Date: Wed Oct 10 19:02:32 2018 -0400 + + Comment + + src/hb-machinery.hh | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit 7e6e5bf6147596d6d096e2ba37f3a6eefd7429cd +Author: Behdad Esfahbod +Date: Wed Oct 10 18:59:07 2018 -0400 + + Fix option string matching + + src/hb-common.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5d34164d98f04816aafaa0abfc44cd899c7d70b3 +Author: Behdad Esfahbod +Date: Wed Oct 10 18:14:41 2018 -0400 + + [kern/kerx] Fix offset base + + Disable kern Format2. + + Fix kerx Format2. Manually tested this with Tamil MN font and + it works: + + $ HB_OPTIONS=aat ./hb-shape Tamil\ MN.ttc -u 0B94,0B95 + [tgv_au=0+3435|tgc_ka=1@-75,0+1517] + + HB_OPTIONS=aat ./hb-shape Tamil\ MN.ttc -u 0B94,0B95 --features=-kern + [tgv_au=0+3510|tgc_ka=1+1592] + + src/hb-aat-layout-kerx-table.hh | 73 + +++++++++++++++++++++++++---------------- + src/hb-ot-kern-table.hh | 7 ++++ + 2 files changed, 52 insertions(+), 28 deletions(-) + +commit 60f86d32d7c735ccf783b382e18ecdc096eaa682 +Author: Behdad Esfahbod +Date: Wed Oct 10 18:10:05 2018 -0400 + + [kerx] Don't loop over kerning subtables if kerning disabled + + src/hb-aat-layout-kerx-table.hh | 12 ++++++++++++ + src/hb-ot-shape.cc | 4 ++-- + src/hb-ot-shape.hh | 1 + + 3 files changed, 15 insertions(+), 2 deletions(-) + +commit 38a7a8a89ed035a1d1fc34a675a1860ad660b6ff +Author: Behdad Esfahbod +Date: Wed Oct 10 17:44:46 2018 -0400 + + Allow HB_OPTIONS=aat to prefer AAT tables over OT + + Fixes https://github.com/harfbuzz/harfbuzz/issues/322 + + src/hb-common.cc | 23 +++++++++++++++++++++-- + src/hb-debug.hh | 7 ++++--- + src/hb-ot-shape.cc | 24 ++++++++++++++++-------- + 3 files changed, 41 insertions(+), 13 deletions(-) + +commit 44f09afd5bd4f4f1ea47ca54ac9d605219b06910 +Author: Behdad Esfahbod +Date: Wed Oct 10 17:32:32 2018 -0400 + + [kerx] Skip variation subtables + + src/hb-aat-layout-kerx-table.hh | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +commit 1e8fdd285f90b7b715b6d9ca9222a3c91cbea6b8 +Author: Behdad Esfahbod +Date: Wed Oct 10 16:32:35 2018 -0400 + + Remove HAVE_OT + + We never tested compiling without it. Just kill it. We always build + our own shaper. + + CMakeLists.txt | 1 - + configure.ac | 6 ------ + src/Makefile.am | 2 -- + src/hb-shaper-list.hh | 2 -- + src/hb.hh | 2 -- + test/api/Makefile.am | 4 +--- + test/api/test-c.c | 5 +---- + util/Makefile.am | 4 ---- + util/options.cc | 4 ---- + util/options.hh | 2 -- + 10 files changed, 2 insertions(+), 30 deletions(-) + +commit 7727e737566ddc826647e19fc645b296ad5a0cac +Author: Behdad Esfahbod +Date: Wed Oct 10 13:24:51 2018 -0400 + + [kerx] Actually hook up, and fix crash + + src/hb-aat-layout-common.hh | 6 ++++++ + src/hb-aat-layout-kerx-table.hh | 4 ++-- + src/hb-ot-shape.cc | 4 ++-- + 3 files changed, 10 insertions(+), 4 deletions(-) + +commit b3390990f508def9c375716614b92fc7b0038228 +Author: Behdad Esfahbod +Date: Wed Oct 10 12:07:49 2018 -0400 + + Add per-subtable set-digests + + This speeds up Roboto shaping by ~10%. I was hoping for more. + Still, good defense against lookups with many subtables. + + src/hb-null.hh | 2 +- + src/hb-ot-layout-gsubgpos.hh | 108 + +++++++++++++++++++++++-------------------- + 2 files changed, 59 insertions(+), 51 deletions(-) + +commit e78549edfb4df617128a5f5ddd12692f1d0af4bf +Author: Behdad Esfahbod +Date: Wed Oct 10 11:54:48 2018 -0400 + + Move apply down into subtables accel + + src/hb-ot-layout-gsubgpos.hh | 10 +++++++++- + src/hb-ot-layout.cc | 17 +++-------------- + 2 files changed, 12 insertions(+), 15 deletions(-) + +commit 78c09bf21335a0f2b538b37de6647af08e3b1161 +Author: Behdad Esfahbod +Date: Wed Oct 10 11:50:46 2018 -0400 + + Move subtable array into lookup accel + + src/hb-null.hh | 2 +- + src/hb-ot-layout-gsubgpos.hh | 14 +++++++++++--- + src/hb-ot-layout.cc | 16 ++++++---------- + 3 files changed, 18 insertions(+), 14 deletions(-) + +commit 97e5913d5ac2cd313fb3923e9602358d7f75f11d +Author: Behdad Esfahbod +Date: Wed Oct 10 11:41:05 2018 -0400 + + Move more code + + src/hb-ot-layout-gsubgpos.hh | 17 +++++++++++++++++ + src/hb-ot-layout.cc | 12 ++++++------ + src/hb-ot-layout.hh | 20 ++------------------ + src/hb-ot-shape-complex-arabic-fallback.hh | 2 +- + 4 files changed, 26 insertions(+), 25 deletions(-) + +commit c8f2d9334c0f91ec30f1c7821eb44bb5149bd31c +Author: Behdad Esfahbod +Date: Wed Oct 10 11:36:28 2018 -0400 + + Move code + + In preparation to move add per-subtable set digests... + + src/hb-ot-layout-gsubgpos.hh | 50 ++++++++++++++++++++++++++++++++++++++ + src/hb-ot-layout.cc | 57 + ++++---------------------------------------- + 2 files changed, 54 insertions(+), 53 deletions(-) + +commit a03850a3567d532c3a4d7655aa71bfe73dfb0e33 +Author: Behdad Esfahbod +Date: Wed Oct 10 10:57:28 2018 -0400 + + Fix GPOS/kern interaction + + Oops. Was checking for kern feature in GSUB, not GPOS. + + src/hb-ot-shape.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d1be805e784dfaadf2ce9caa830a3f851fdd67da +Author: Behdad Esfahbod +Date: Wed Oct 10 10:49:45 2018 -0400 + + More rewriting plan compile + + Hopefully more clear. + + src/hb-ot-shape.cc | 55 + ++++++++++++++++++++++++++++++++++++++---------------- + src/hb-ot-shape.hh | 1 - + 2 files changed, 39 insertions(+), 17 deletions(-) + +commit 961ab46b24ca9f3ef42a56398646191f106bf5bd +Author: Behdad Esfahbod +Date: Wed Oct 10 10:42:10 2018 -0400 + + More reshuffle plan compile + + src/hb-ot-shape.cc | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit 2091b509e3e3b7fb7315539679fae81da2879280 +Author: Behdad Esfahbod +Date: Wed Oct 10 10:41:08 2018 -0400 + + [kerx] Hook up to shaper + + src/hb-aat-layout.cc | 31 ++++++++++++++++++++++++------- + src/hb-aat-layout.hh | 3 +++ + src/hb-ot-shape.cc | 6 ++++-- + src/hb-ot-shape.hh | 1 + + 4 files changed, 32 insertions(+), 9 deletions(-) + +commit 8d00c39bfc558895c63e22148d88db51cde39164 +Author: Behdad Esfahbod +Date: Wed Oct 10 10:18:39 2018 -0400 + + [kern] Minor + + src/hb-ot-shape-fallback.cc | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit e655fd38cf20eefb1c071a52282a4caccb6f08ea +Author: Behdad Esfahbod +Date: Wed Oct 10 10:16:09 2018 -0400 + + Apply TT or fallback kerning when GPOS does not have kern feature + + Previously we only did if there was no GPOS whatsoever. This applies + to Arial, Times New Roman, etc in Win7. Was not kerning before. It + is now. + + src/hb-ot-shape.cc | 25 ++++++++++++++++--------- + 1 file changed, 16 insertions(+), 9 deletions(-) + +commit 754cf440bf80ced36461a98a5d4607a700f44fd3 +Author: Behdad Esfahbod +Date: Wed Oct 10 10:04:05 2018 -0400 + + Minor + + src/hb-ot-shape-fallback.cc | 2 ++ + 1 file changed, 2 insertions(+) + +commit 187df7d7a9a1d9cd67cb2f72d4d6ed8cae1eed61 +Author: Ebrahim Byagowi +Date: Wed Oct 10 17:12:52 2018 +0330 + + [circleci] Add an iOS bot (#1233) + + .circleci/config.yml | 12 +++++ + CMakeLists.txt | 140 + ++++++++++++++++++++++++++++++++------------------- + 2 files changed, 100 insertions(+), 52 deletions(-) + +commit 0537a40193e803d50a99cd6b993d6d9301e84ebf +Author: Behdad Esfahbod +Date: Tue Oct 9 23:35:07 2018 -0400 + + [kerx] Comment + + src/hb-aat-layout-kerx-table.hh | 2 +- + src/hb-ot-kern-table.hh | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +commit 362d3241195bb7054c395fb4b029b6d55da4612a +Author: Behdad Esfahbod +Date: Tue Oct 9 23:27:00 2018 -0400 + + [aat] Rename + + src/hb-aat-layout-kerx-table.hh | 4 ++-- + src/hb-aat-layout-morx-table.hh | 6 +++--- + 2 files changed, 5 insertions(+), 5 deletions(-) + +commit 54c9ecb92d196e62901eef3f8bc025c024ed16bb +Author: Behdad Esfahbod +Date: Tue Oct 9 23:18:19 2018 -0400 + + [morx] Use subtable range for embedded sanitizer here as well + + src/hb-aat-layout-morx-table.hh | 2 ++ + 1 file changed, 2 insertions(+) + +commit d35315cc028e70dd1b3ffc8cb079a2336b22a0c3 +Author: Behdad Esfahbod +Date: Tue Oct 9 23:17:32 2018 -0400 + + [aat] Fixup recent commit + + For 329f2401082011007d9ce12b15ce0225cd267c57 + + max_ops is signed. + + src/hb-aat-layout-common.hh | 2 +- + src/hb-machinery.hh | 5 ++++- + 2 files changed, 5 insertions(+), 2 deletions(-) + +commit 948f59a13a4c643ae310f5fc643e29fefd6c3787 +Author: Behdad Esfahbod +Date: Tue Oct 9 23:07:47 2018 -0400 + + [kerx] Use subtable range for runtime checks + + src/hb-aat-layout-kerx-table.hh | 4 +++- + src/hb-machinery.hh | 8 ++++++++ + 2 files changed, 11 insertions(+), 1 deletion(-) + +commit 329f2401082011007d9ce12b15ce0225cd267c57 +Author: Behdad Esfahbod +Date: Tue Oct 9 23:02:53 2018 -0400 + + [aat] Set embedded sanitizer max ops really high + + Since we consume it legitimately during shaping. + + src/hb-aat-layout-common.hh | 1 + + src/hb-machinery.hh | 2 ++ + 2 files changed, 3 insertions(+) + +commit ad763074861da60ed51211931788ca5b27fc1512 +Author: Behdad Esfahbod +Date: Tue Oct 9 22:57:00 2018 -0400 + + [kerx] Comment + + src/hb-aat-layout-kerx-table.hh | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit db9600bbe15035cea6c2d4e8e9d184a5e23e357e +Author: Behdad Esfahbod +Date: Tue Oct 9 22:55:47 2018 -0400 + + [kerx] Remove junk + + src/hb-aat-layout-kerx-table.hh | 16 ---------------- + 1 file changed, 16 deletions(-) + +commit 27db859416c0362f211e2b42dc9a2ebb53b0e0f4 +Author: Behdad Esfahbod +Date: Tue Oct 9 22:52:41 2018 -0400 + + [kern/kerx] Adjust bounds check + + src/hb-aat-layout-kerx-table.hh | 8 +++----- + src/hb-ot-kern-table.hh | 8 +++----- + 2 files changed, 6 insertions(+), 10 deletions(-) + +commit c66f7f8c5deaac109e34bf65fc16cff92b74e69a +Author: Behdad Esfahbod +Date: Tue Oct 9 22:49:33 2018 -0400 + + [kerx] Implement Format2 apply() + + Still, not hooked. + + src/hb-aat-layout-kerx-table.hh | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +commit 4b461785bdf356e4b5586cb6e5b226f47da04b7d +Author: Behdad Esfahbod +Date: Tue Oct 9 22:46:30 2018 -0400 + + Fix check + + src/hb-aat-layout-kerx-table.hh | 2 ++ + src/hb-aat-layout.cc | 4 +++- + 2 files changed, 5 insertions(+), 1 deletion(-) + +commit 4df8eb200def767d342762654b96d5d9314e5b21 +Author: Behdad Esfahbod +Date: Tue Oct 9 22:46:12 2018 -0400 + + [kern] Use kern subtable length for sanitizing in the accelerator + + src/hb-ot-kern-table.hh | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit 8bff1d2994876a5202c8605d1cc37522431c6c84 +Author: Behdad Esfahbod +Date: Tue Oct 9 22:39:31 2018 -0400 + + [kern] Minor + + src/hb-ot-kern-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 53e55945000347fb19168bb4c13a470d30d46251 +Author: Behdad Esfahbod +Date: Tue Oct 9 22:35:22 2018 -0400 + + [kerx] Implement Format0 apply() + + Not hooked up to be called yet. + + src/hb-aat-layout-common.hh | 6 ++++-- + src/hb-aat-layout-kerx-table.hh | 29 ++++++++++++++++++++++++++--- + src/hb-aat-layout.cc | 6 ++++-- + src/hb-aat-layout.hh | 12 +++++++----- + src/hb-ot-shape.cc | 2 +- + 5 files changed, 42 insertions(+), 13 deletions(-) + +commit 60318f87153b559e5da103f0bfcce6bad8bab3b0 +Author: Behdad Esfahbod +Date: Tue Oct 9 22:25:53 2018 -0400 + + Minor + + src/hb-mutex.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 210f899acad1959d60892538ac1968a36dbbb51b +Author: Behdad Esfahbod +Date: Tue Oct 9 21:56:37 2018 -0400 + + [kern] Sanitize 4 bytes, not 2 + + src/hb-ot-kern-table.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit be2f148da474d6dd30132c22dd467ea33a942edf +Author: Behdad Esfahbod +Date: Tue Oct 9 16:24:50 2018 -0400 + + [ft] Use mutex to lock access to FT_Face + + Makes our FT-backed hb_font_t safe to use from multiple threads. + Still, + the underlying FT_Face should NOT be used from other threads by client + or other libraries. + + Maybe I add a lock()/unlock() public API ala PangoFT2 and cairo-ft. + Maybe not. + + src/hb-ft.cc | 18 +++++++++++++++++- + src/hb-mutex.hh | 8 ++++++++ + test/api/test-multithread.c | 7 ++----- + 3 files changed, 27 insertions(+), 6 deletions(-) + +commit d18c3c5861d40291077eb8b8667dc2f12b649cf2 +Author: Behdad Esfahbod +Date: Tue Oct 9 16:07:55 2018 -0400 + + [ft] Remove (probably) stale comment + + src/hb-ft.cc | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +commit 7003b601afd02b0ba7e839510a7d0b886da09aaa +Author: Behdad Esfahbod +Date: Tue Oct 9 15:55:26 2018 -0400 + + Minor + + src/hb-ot-shape-complex-arabic.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 07899435b8065d494e563f83e0a35300c828eefe +Author: Behdad Esfahbod +Date: Tue Oct 9 15:39:51 2018 -0400 + + Install ot-funcs on newly created funcs + + **Finally**! Casual users can stop caring about font-funcs + completely now, + like they haven't been needing to care re unicode-funcs for a + few years. + + src/hb-font.cc | 39 ++++++++++++++++++++++++++------------- + 1 file changed, 26 insertions(+), 13 deletions(-) + +commit 55153553675445e8aad06e363295d399aa79c54f +Author: Behdad Esfahbod +Date: Tue Oct 9 15:12:09 2018 -0400 + + [ot-font] Don't pre-load cmap table + + Now that we have get_h_advances() and get_nominal_glyphs() + implemented, the + overhead of doing a proper atomic load would be once per run, NOT + once per + glyph. So, no need to pre-load the tables to avoid that overhead. + + As such, hb_ot_font_set_funcs() has become really cheap. + Can *finally* make + it be default font functions on all newly created fonts! + + src/hb-ot-font.cc | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +commit ec84460e46fdaa5f8a3c16c8d48dabe2b0c869da +Author: Behdad Esfahbod +Date: Tue Oct 9 15:07:04 2018 -0400 + + [ot/ft] Implement get_nominal_glyphs() callback + + Some more measurable speedup. The recent commits' speedups are + as follows: + + Testing with Roboto, ****when disabling kern and liga****: + + Before: + + FT --features=-kern,-liga + user↦ 0m0.521s + + OT --features=-liga,-kern + user↦ 0m0.568s + + After: + + FT --features=-liga,-kern + user↦ 0m0.428s + + OT --features=-liga,-kern + user↦ 0m0.470s + + So, 17% speedup. + + Note that FT callbacks are faster than OT these days since we added + an advance + cache to FT. I don't think the difference is enough to justify + adding a cache + to OT. + + When not disabling kern, the thing is three times slower, so the + speedups + are three times less impressive... Still, 5% not bad for a codebase + that I + otherwise thought is optimized out. + + Note that, because of this and other optimiztions in our main shaper, + disabling kern and liga, the OT shaper is now *faster* than the + fallback + shaper. So, that's my recommendation to clients that need the + absolute + fastest... + + src/hb-ft.cc | 26 ++++++++++++++++++++++++++ + src/hb-ot-font.cc | 24 ++++++++++++++++++++++++ + 2 files changed, 50 insertions(+) + +commit e883f52732a25f5495ec30656489954afd8cc3a4 +Author: Behdad Esfahbod +Date: Tue Oct 9 14:50:57 2018 -0400 + + Call get_nominal_glyphs() for runs of simple clusters at a time + + Even without FT or OT font funcs implementing get_nominal_glyphs(), + there's measurable + speedup. + + src/hb-buffer.hh | 20 +++++++++++++++++++- + src/hb-ot-shape-normalize.cc | 9 +++++++++ + 2 files changed, 28 insertions(+), 1 deletion(-) + +commit 8008bca83b0bb310fc434dbdd339545af951193b +Author: Behdad Esfahbod +Date: Tue Oct 9 14:38:23 2018 -0400 + + Whitespace + + src/hb-font.hh | 2 +- + src/hb-ot-shape-normalize.cc | 52 + ++++++++++++++++++++++++-------------------- + 2 files changed, 29 insertions(+), 25 deletions(-) + +commit 30c114ffec335770452e60729224b1634586c5b0 +Author: Behdad Esfahbod +Date: Tue Oct 9 14:37:08 2018 -0400 + + Avoid sort and recompose stages if all clusters simple + + Even has measurable speedup... + + src/hb-ot-shape-normalize.cc | 52 + ++++++++++++++++++++++++-------------------- + 1 file changed, 29 insertions(+), 23 deletions(-) + +commit 9f79365c3b183278d14352ba6241c7d4ec274984 +Author: Behdad Esfahbod +Date: Tue Oct 9 14:36:25 2018 -0400 + + Fix warning + + How come this one is not generated by clang everything bot?! + + ../../../test/api/test-multithread.c:37:26: warning: initialization + discards ‘const’ qualifier from pointer target type + [-Wdiscarded-qualifiers] + static char *font_path = "fonts/Inconsolata-Regular.abc.ttf"; + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ../../../test/api/test-multithread.c:38:21: warning: initialization + discards ‘const’ qualifier from pointer target type + [-Wdiscarded-qualifiers] + + test/api/test-multithread.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 24382debe893450088acd1e4b387ac31145d4553 +Author: Behdad Esfahbod +Date: Tue Oct 9 14:33:24 2018 -0400 + + Rewrite main normalizer loop to isolate runs of simple clusters + + src/hb-ot-shape-normalize.cc | 24 +++++++++++++++++++----- + 1 file changed, 19 insertions(+), 5 deletions(-) + +commit b5371f18effbeb91565fd8c554c120b911641f0b +Author: Behdad Esfahbod +Date: Tue Oct 9 14:12:59 2018 -0400 + + Inline decompose_cluster + + Towards separating the common case into its own loop. + + src/hb-ot-shape-normalize.cc | 14 ++++---------- + 1 file changed, 4 insertions(+), 10 deletions(-) + +commit b314c4e9abf4236c6650a63d1287471b61f64885 +Author: Behdad Esfahbod +Date: Tue Oct 9 09:23:51 2018 -0400 + + [font] Add get_nominal_glyphs() callback (note the plural) + + Unused as of now. To be wired up to normalizer, which would remove + overhead and allow hb-ot-font initialization to become a no-op, so + we can enable it by default. + + docs/harfbuzz-sections.txt | 3 +++ + src/hb-font.cc | 33 +++++++++++++++++++++++++++++++++ + src/hb-font.h | 24 ++++++++++++++++++++++++ + src/hb-font.hh | 13 +++++++++++++ + 4 files changed, 73 insertions(+) + +commit ca6a317012a13ee84b58a69e14e74c94c5b158ff +Author: Behdad Esfahbod +Date: Tue Oct 9 09:06:07 2018 -0400 + + Minor + + src/hb-font.cc | 6 +++--- + src/hb-font.h | 8 ++++---- + src/hb-font.hh | 2 +- + 3 files changed, 8 insertions(+), 8 deletions(-) + +commit 4035158de46ce373b7521daf61c5b6df83312968 +Author: Chun-wei Fan +Date: Wed Jul 25 18:26:10 2018 +0800 + + test/api/test-subset-*.c: Fix build on pre-C99 + + Ensure that we have the variables at the beginning of the block. + These + are the only fixes that we need for building HarfBuzz on older + compilers. + + test/api/test-collect-unicodes.c | 9 ++++++--- + test/api/test-subset-glyf.c | 19 +++++++++++++------ + test/api/test-subset-hdmx.c | 8 ++++++-- + test/api/test-subset-hmtx.c | 3 ++- + test/api/test-subset-post.c | 3 ++- + test/api/test-subset-vmtx.c | 6 ++++-- + test/api/test-subset.c | 12 +++++++++--- + 7 files changed, 42 insertions(+), 18 deletions(-) + +commit 8e4ad1d7a0a35298ca04828ef1ef18b4c019ec03 +Author: Chun-wei Fan +Date: Wed Jul 25 18:12:34 2018 +0800 + + builds: Fix and clean up MSVC DLL builds + + Instead of passing a CFLAG/CXXFLAG to define HB_EXTERN, define it + directly in src/hb.hh as __declspec(dllexport) extern when we are + building HarfBuzz as DLLs on Visual Studio. Define HB_INTERNAL + as nothing without defining HB_NO_VISIBILITY when building HarfBuzz as + DLLs to avoid linker errors on Visual Studio builds. + + Also "install" harfbuzz-subset.dll into $(PREFIX)\bin as the + hb-subset utility will depend on that DLL at runtime, when HarfBuzz is + built as DLLs. Since it consists of private APIs that are subject to + change, we do not install its headers nor .lib file. + + CMakeLists.txt | 7 ++++++- + src/hb.hh | 10 ++++++++-- + 2 files changed, 14 insertions(+), 3 deletions(-) + +commit e640f3a6b16f41cee5f7868ec738fda01244e96a +Author: Behdad Esfahbod +Date: Tue Oct 9 08:28:07 2018 -0400 + + Another old bot fix + + src/hb-aat-layout-kerx-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e4f27f368f8f0509fa47f6a28f3984e90b40588f +Author: Behdad Esfahbod +Date: Tue Oct 9 08:20:10 2018 -0400 + + Try fixing older bots + + src/hb-ot-shape-fallback.cc | 42 + +++++++++++++++++++++--------------------- + 1 file changed, 21 insertions(+), 21 deletions(-) + +commit bee93e269711a3eda4e7d762b730522564fe6e87 +Author: Behdad Esfahbod +Date: Tue Oct 9 08:01:49 2018 -0400 + + Add const to get_*_advances API + + Ouch! + + src/hb-font.cc | 10 +++++----- + src/hb-font.h | 8 ++++---- + src/hb-font.hh | 6 +++--- + src/hb-ft.cc | 2 +- + src/hb-ot-font.cc | 4 ++-- + 5 files changed, 15 insertions(+), 15 deletions(-) + +commit eb2be97f864c726feaa2434e290f962ddfa97069 +Author: Behdad Esfahbod +Date: Tue Oct 9 07:48:52 2018 -0400 + + Port test off deprecated API + + test/api/test-shape.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit cc126f2817844a2e83e973129e5b2caa18de599f +Author: Behdad Esfahbod +Date: Tue Oct 9 01:10:15 2018 -0400 + + Minor + + src/Makefile.am | 2 +- + test/shaping/Makefile.am | 2 ++ + test/subset/Makefile.am | 2 +- + 3 files changed, 4 insertions(+), 2 deletions(-) + +commit b2fbe55b828ea5864bc0aed54db7109a2e189de2 +Author: Behdad Esfahbod +Date: Tue Oct 9 01:07:36 2018 -0400 + + [icu] Unbreak + + src/hb-icu.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit a353c1768dc1d7934b8ac293761620f561304bb2 +Author: Behdad Esfahbod +Date: Tue Oct 9 01:05:28 2018 -0400 + + Remove test for deprecated hb_set_invert() + + test/api/test-set.c | 4 ---- + 1 file changed, 4 deletions(-) + +commit a52bc039c33b3c01dbb96b815dc24df7f03bc4be +Author: Behdad Esfahbod +Date: Tue Oct 9 00:56:33 2018 -0400 + + Properly remove deprecated stuff + + src/hb-glib.cc | 15 ++++++--------- + src/hb-icu.cc | 15 ++++++--------- + src/hb-ucdn.cc | 15 ++++++--------- + 3 files changed, 18 insertions(+), 27 deletions(-) + +commit fc50916589a300e49183b5ee598e64ca28d0bd9a +Author: Behdad Esfahbod +Date: Tue Oct 9 00:39:42 2018 -0400 + + Remove deprecated decompose_compatibility stuff + + src/hb-glib.cc | 31 +----------------------------- + src/hb-icu.cc | 33 +------------------------------- + src/hb-ucdn.cc | 8 +------- + test/api/test-unicode.c | 51 + ------------------------------------------------- + 4 files changed, 3 insertions(+), 120 deletions(-) + +commit eed737f6726d3408191a4e64592805b70d8bb247 +Author: Behdad Esfahbod +Date: Tue Oct 9 00:33:30 2018 -0400 + + Remove deprecated eastasian_width + + src/hb-glib.cc | 8 +------ + src/hb-icu.cc | 19 +-------------- + src/hb-ucdn.cc | 9 +------ + test/api/test-unicode.c | 64 + ------------------------------------------------- + 4 files changed, 3 insertions(+), 97 deletions(-) + +commit 47030b1855f04c0d75899ffb6f5021fea3c19b90 +Author: Behdad Esfahbod +Date: Tue Oct 9 00:30:45 2018 -0400 + + [ft/ot] Remove implementation of deprecated kerning funcs + + src/hb-ft.cc | 19 ------------------- + src/hb-ot-font.cc | 13 ------------- + 2 files changed, 32 deletions(-) + +commit 977c8a8e5c811995f47b0eb721199d0dc3689e48 +Author: Behdad Esfahbod +Date: Tue Oct 9 00:22:08 2018 -0400 + + [kern] Minor + + src/hb-ot-kern-table.hh | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +commit ed5cfa42c7fb8d5ff2d74bdb452a0590174f4e19 +Author: Behdad Esfahbod +Date: Tue Oct 9 00:20:35 2018 -0400 + + [kern] Minor + + src/hb-aat-layout-kerx-table.hh | 1 + + 1 file changed, 1 insertion(+) + +commit d219f899f4b2fb4b39ebc1dff9fb648fc5d6d112 +Author: Behdad Esfahbod +Date: Tue Oct 9 00:01:09 2018 -0400 + + Deprecate font kern API + + docs/harfbuzz-sections.txt | 16 +++++++------- + src/hb-deprecated.h | 54 + ++++++++++++++++++++++++++++++++++++++++++++++ + src/hb-font.cc | 3 +++ + src/hb-font.h | 51 + ------------------------------------------- + 4 files changed, 65 insertions(+), 59 deletions(-) + +commit a51958819fcf51ade3f8eb38001e680a419ebbba +Author: Behdad Esfahbod +Date: Mon Oct 8 23:57:45 2018 -0400 + + Apply TrueType/OpenType kern table when GPOS kern feature is not + available + + Fixes https://github.com/harfbuzz/harfbuzz/issues/250 + + src/hb-ot-kern-table.hh | 24 +++++++++++-------- + src/hb-ot-layout.cc | 57 + ++++++++++++++++++++------------------------- + src/hb-ot-layout.hh | 13 +++++++++++ + src/hb-ot-shape-fallback.cc | 4 ++-- + src/hb-ot-shape.cc | 10 +++++--- + src/hb-ot-shape.hh | 1 + + 6 files changed, 62 insertions(+), 47 deletions(-) + +commit 09ad2613c8d8a60dac69a878c2d568adfea054c8 +Author: Behdad Esfahbod +Date: Mon Oct 8 23:30:24 2018 -0400 + + Separate fallback kern vs mark positioning + + src/hb-ot-shape-fallback.cc | 12 ++++++------ + src/hb-ot-shape-fallback.hh | 12 ++++++------ + src/hb-ot-shape.cc | 15 ++++++++------- + src/hb-ot-shape.hh | 4 ++-- + 4 files changed, 22 insertions(+), 21 deletions(-) + +commit 3c23ff9b7c4241ec23054a95f1fdfbdef2c51f40 +Author: Behdad Esfahbod +Date: Mon Oct 8 23:26:26 2018 -0400 + + [kern] Add kerning driver to TT kern table + + src/hb-ot-kern-table.hh | 19 +++++++++++++++++-- + src/hb-ot-shape-fallback.cc | 2 +- + 2 files changed, 18 insertions(+), 3 deletions(-) + +commit 683c3a95330928129cfbb1488650f708414d68ba +Author: Behdad Esfahbod +Date: Mon Oct 8 23:09:48 2018 -0400 + + [kern] Abstract away kerning machine + + src/hb-font.hh | 2 +- + src/hb-ot-kern-table.hh | 71 + +++++++++++++++++++++++++++++++++++++++++++++ + src/hb-ot-shape-fallback.cc | 67 + +++++++++++------------------------------- + 3 files changed, 89 insertions(+), 51 deletions(-) + +commit fb4f43838154a77912a9fc3437110c81e9d34aac +Author: Behdad Esfahbod +Date: Mon Oct 8 22:44:16 2018 -0400 + + Add HB_DEPRECATED + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1232 + + src/hb-common.h | 9 +++++++++ + src/hb-deprecated.h | 12 ++++++------ + 2 files changed, 15 insertions(+), 6 deletions(-) + +commit 80e3102b8a216f9a751d073f9a2f7900ca758086 +Author: Behdad Esfahbod +Date: Mon Oct 8 22:41:08 2018 -0400 + + [kerx] Process coverage flags + + src/hb-aat-layout-kerx-table.hh | 27 +++++++++++++++++++++++++++ + 1 file changed, 27 insertions(+) + +commit 26d7305da7a7e2cf765b068f565836442872ffe7 +Author: Behdad Esfahbod +Date: Mon Oct 8 22:31:35 2018 -0400 + + Deprecate decompose_compatibility stuff + + docs/harfbuzz-sections.txt | 7 +++--- + src/hb-deprecated.h | 63 + ++++++++++++++++++++++++++++++++++++++++++++++ + src/hb-unicode.h | 47 ---------------------------------- + 3 files changed, 67 insertions(+), 50 deletions(-) + +commit 42b51eee54f143854b7c6c3be5d84bfbbd895100 +Author: Behdad Esfahbod +Date: Mon Oct 8 22:26:39 2018 -0400 + + Deprecate eastasian_width stuff + + docs/harfbuzz-sections.txt | 5 +++-- + src/hb-deprecated.h | 37 +++++++++++++++++++++++++++++++++++++ + src/hb-unicode.h | 28 ---------------------------- + 3 files changed, 40 insertions(+), 30 deletions(-) + +commit 286a45641fc6732bb7cab02f06c90396834541b1 +Author: Behdad Esfahbod +Date: Mon Oct 8 16:41:08 2018 -0400 + + Minor + + src/hb-ot-shape-normalize.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c0d3bf1bafe7b6d2e8f2798c1f55aaec71350d90 +Author: Behdad Esfahbod +Date: Mon Oct 8 16:32:44 2018 -0400 + + Minor + + src/hb-ot-shape.cc | 26 +++++++++++++------------- + 1 file changed, 13 insertions(+), 13 deletions(-) + +commit 9c1bb81f5c5ca64ad1c665edd16947e4bc6f6c46 +Author: Behdad Esfahbod +Date: Mon Oct 8 16:10:54 2018 -0400 + + [test/text-rendering-tests] Update from upstream + + test/shaping/data/text-rendering-tests/DISABLED | 3 --- + test/shaping/data/text-rendering-tests/Makefile.sources | 2 +- + test/shaping/data/text-rendering-tests/tests/MORX-35.tests | 4 ++-- + 3 files changed, 3 insertions(+), 6 deletions(-) + +commit 1a5a3325a26f4989ab8c4bb91515d4898ffa4631 +Author: Behdad Esfahbod +Date: Sun Oct 7 23:08:39 2018 -0400 + + [kerx] Minor + + src/hb-aat-layout-kerx-table.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit d62b4011cc600ade2b130f81a077dd08d4e4464f +Author: Behdad Esfahbod +Date: Sun Oct 7 22:58:06 2018 -0400 + + [kern] Shout less + + src/hb-ot-kern-table.hh | 36 +++++++++++++++++++----------------- + 1 file changed, 19 insertions(+), 17 deletions(-) + +commit c6bb3a588f493630b40d8823532b482f407bacbf +Author: Behdad Esfahbod +Date: Sun Oct 7 22:52:53 2018 -0400 + + [kerx] Clean up Format2 + + src/hb-aat-layout-kerx-table.hh | 48 + ++++++++--------------------------------- + 1 file changed, 9 insertions(+), 39 deletions(-) + +commit 8aa83d97f9e7f63e2fcb4ae965b75a39961c7d87 +Author: Behdad Esfahbod +Date: Sun Oct 7 22:43:59 2018 -0400 + + [kern/kerx] Fix Format2 offsetting + + "The values in the right class table are stored pre-multiplied by the + number of bytes in a single kerning value, and the values in the left + class table are stored pre-multiplied by the number of bytes in one + row. This eliminates needing to multiply the row and column values + together to determine the location of the kerning value. The array can + be indexed by doing the right- and left-hand class mappings, + adding the + class values to the address of the array, and fetching the kerning + value to which the new address points." + + src/hb-aat-layout-kerx-table.hh | 2 +- + src/hb-ot-kern-table.hh | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit ed2a404272bc99234c6f71f22b5a642834e59e6c +Author: Behdad Esfahbod +Date: Sun Oct 7 22:33:41 2018 -0400 + + [kerx] Clean up Format0 + + src/hb-aat-layout-kerx-table.hh | 48 + +++++++++++------------------------------ + 1 file changed, 12 insertions(+), 36 deletions(-) + +commit 4c3b19d52ec7a1fa46f8d0971e377a7d29b87e27 +Author: Behdad Esfahbod +Date: Sun Oct 7 22:30:42 2018 -0400 + + Support HBUINT32 BinSearchArrayOf + + src/hb-open-type.hh | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +commit 456a68c506238e9c6b019244237d4443bd3589af +Author: Behdad Esfahbod +Date: Sun Oct 7 22:28:45 2018 -0400 + + Move code + + src/hb-aat-layout-common.hh | 105 + -------------------------------------------- + src/hb-open-type.hh | 105 + +++++++++++++++++++++++++++++++++++++++++++- + 2 files changed, 104 insertions(+), 106 deletions(-) + +commit 3515c8b187e2316dcf3abaefc84917b09449d485 +Author: Behdad Esfahbod +Date: Sun Oct 7 22:27:00 2018 -0400 + + [aat] Rename + + src/hb-aat-layout-common.hh | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit e42cd58c997adafca5517faa9aacf651b90520f5 +Author: Behdad Esfahbod +Date: Sun Oct 7 20:46:11 2018 -0400 + + Rename invisible_codepoint to invisible_glyph in API + + Deleted recently added API: + hb_buffer_set_invisible_codepoint() + hb_buffer_get_invisible_codepoint() + + hb-shape / hb-view --invisible-codepoint + + New API: + hb_buffer_set_invisible_glyph() + hb_buffer_get_invisible_glyph() + + hb-shape / hb-view --invisible-glyph + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1216 + + docs/harfbuzz-sections.txt | 4 ++-- + src/hb-buffer.cc | 12 ++++++------ + src/hb-buffer.h | 6 +++--- + util/options.cc | 2 +- + util/options.hh | 6 +++--- + 5 files changed, 15 insertions(+), 15 deletions(-) + +commit 2a5cb37fdb43230217e055f3d7c770a35cfd5c21 +Author: Behdad Esfahbod +Date: Sun Oct 7 20:36:46 2018 -0400 + + Revert "[morx] Fix MORX-35" + + This reverts commit f62f6e90ad1f1a83f77771ad65ee1ffb79470a8a. + + src/hb-aat-layout-morx-table.hh | 14 + +++++--------- + test/shaping/data/text-rendering-tests/DISABLED | 3 +++ + test/shaping/data/text-rendering-tests/Makefile.sources | 2 +- + 3 files changed, 9 insertions(+), 10 deletions(-) + +commit 14ebf8af0c04efcae6ca788ac85601bfe462f28d +Author: Behdad Esfahbod +Date: Sun Oct 7 20:35:06 2018 -0400 + + [buffer] Improve shift_forward() + + "Improve" is a strong word in this case though, I understand. + + src/hb-buffer.cc | 16 +++++++++++++--- + 1 file changed, 13 insertions(+), 3 deletions(-) + +commit f62f6e90ad1f1a83f77771ad65ee1ffb79470a8a +Author: Behdad Esfahbod +Date: Sun Oct 7 18:06:53 2018 -0400 + + [morx] Fix MORX-35 + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1224 + + src/hb-aat-layout-morx-table.hh | 14 + ++++++++++---- + test/shaping/data/text-rendering-tests/DISABLED | 3 --- + test/shaping/data/text-rendering-tests/Makefile.sources | 2 +- + 3 files changed, 11 insertions(+), 8 deletions(-) + +commit 94368855c6bd7201d562cab3d2107685589e69c8 +Author: Behdad Esfahbod +Date: Sun Oct 7 18:52:12 2018 -0400 + + Remove some code + + We use scratch-flags to short-circuit this function. No need for + previous + early loop. + + src/hb-ot-shape.cc | 16 +++------------- + 1 file changed, 3 insertions(+), 13 deletions(-) + +commit c07b91b812dc66b38b11329cd6a93258a3769f9e +Author: Behdad Esfahbod +Date: Sun Oct 7 18:00:14 2018 -0400 + + [test/text-rendering-tests] Update from upstream + + test/shaping/data/text-rendering-tests/Makefile.sources | 6 +++++- + .../data/text-rendering-tests/fonts/TestMORXForty.ttf | Bin 0 -> + 2408 bytes + .../text-rendering-tests/fonts/TestMORXThirtyeight.ttf | Bin 0 -> + 2444 bytes + .../text-rendering-tests/fonts/TestMORXThirtynine.ttf | Bin 0 -> + 2436 bytes + .../text-rendering-tests/fonts/TestMORXThirtyseven.ttf | Bin 0 -> + 2444 bytes + .../data/text-rendering-tests/tests/MORX-35.tests | 4 ++-- + .../data/text-rendering-tests/tests/MORX-37.tests | 4 ++++ + .../data/text-rendering-tests/tests/MORX-38.tests | 4 ++++ + .../data/text-rendering-tests/tests/MORX-39.tests | 4 ++++ + .../data/text-rendering-tests/tests/MORX-40.tests | 4 ++++ + 10 files changed, 23 insertions(+), 3 deletions(-) + +commit fdce1e15434f14b7f4802edd67f7af737cf2b075 +Author: Behdad Esfahbod +Date: Sun Oct 7 14:01:33 2018 -0400 + + [kerx] Clean up kerx and KerxTable structures + + src/hb-aat-layout-kerx-table.hh | 169 + ++++++++++++++++++++++++++-------------- + src/hb-aat-layout-morx-table.hh | 2 +- + 2 files changed, 113 insertions(+), 58 deletions(-) + +commit 71b65eb27dd0867f51d9906887b9e372eb37f54a +Author: Behdad Esfahbod +Date: Sun Oct 7 18:41:52 2018 +0200 + + Add API for setting invisible-codepoint + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1216 + + New API: + hb_buffer_set_invisible_codepoint() + hb_buffer_get_invisible_codepoint() + + hb-shape / hb-view --invisible-codepoint + + docs/harfbuzz-sections.txt | 2 ++ + src/hb-buffer.cc | 42 + ++++++++++++++++++++++++++++++++++++++++++ + src/hb-buffer.h | 7 +++++++ + src/hb-buffer.hh | 1 + + src/hb-ot-shape.cc | 8 ++++---- + util/options.cc | 1 + + util/options.hh | 3 +++ + 7 files changed, 60 insertions(+), 4 deletions(-) + +commit 13da3be0b342e8e2f060eba8753c6957c477c4ee +Author: Behdad Esfahbod +Date: Sun Oct 7 18:23:45 2018 +0200 + + [ot-font] Load hmtx/vmtx lazily + + Since we have get_*_advanes() API now, the overhead is once per shape, + not once per glyph. + + Only cmap is warmed-up at set_funcs() time now. + + src/hb-ot-font.cc | 26 +++++++++++++------------- + 1 file changed, 13 insertions(+), 13 deletions(-) + +commit 856db4c9184e39c0457cc07c815f90058937c8a2 +Author: Behdad Esfahbod +Date: Sun Oct 7 18:21:15 2018 +0200 + + Minor + + src/hb-ot-font.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f92330b5e0b1a5a61768494bd7081e3fc235b182 +Author: Behdad Esfahbod +Date: Sun Oct 7 17:51:50 2018 +0200 + + Minor + + test/api/test-multithread.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit b2e398c077cf9437298bfe2ee53b7407a5865c14 +Author: Behdad Esfahbod +Date: Sun Oct 7 16:31:33 2018 +0200 + + [coretext] Fix OS X check + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1230 + + src/hb-coretext.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 7ee50af8366547c382047a30a94f7f5f739aabcb +Author: Behdad Esfahbod +Date: Sat Oct 6 21:31:44 2018 +0200 + + [morx] Fix memory access issues with unsafe_to_break + + src/hb-aat-layout-common.hh | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +commit f58c5175890e666503b6f140d238e1abca91598e +Author: Ebrahim Byagowi +Date: Sat Oct 6 22:42:56 2018 +0330 + + Make msan output a little more readable + + .circleci/config.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e9abe33963739f753cdfb007eed40101ce33f550 +Author: Ebrahim Byagowi +Date: Sat Oct 6 12:19:33 2018 +0330 + + Use tempfile in run-tests as a fix for Windows CI fails (#1228) + + test/shaping/run-tests.py | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +commit 0816a549789a1b647443c2b33cfda3f4400a0f87 +Author: Behdad Esfahbod +Date: Sat Oct 6 02:40:57 2018 +0200 + + [uniscribe/coretext] Fix for previous change + + src/hb-coretext.cc | 2 +- + src/hb-uniscribe.cc | 12 ++++++------ + 2 files changed, 7 insertions(+), 7 deletions(-) + +commit 341206eb609202e4b2f0d03d29cb577ebe8390b9 +Author: Behdad Esfahbod +Date: Fri Oct 5 18:39:48 2018 +0200 + + [vector] Make hb_vector_t relocatable / nestable + + Ugly, but... + Fixes https://github.com/harfbuzz/harfbuzz/issues/1227 + + src/hb-face.cc | 2 +- + src/hb-machinery.hh | 2 +- + src/hb-ot-cmap-table.hh | 2 +- + src/hb-ot-post-table.hh | 2 +- + src/hb-set.hh | 4 +-- + src/hb-subset.cc | 2 +- + src/hb-vector.hh | 94 + +++++++++++++++++++++++++++++++------------------ + 7 files changed, 66 insertions(+), 42 deletions(-) + +commit 5469d80707d32c733b1c60f79ab2f217e879de55 +Author: Behdad Esfahbod +Date: Fri Oct 5 18:21:08 2018 +0200 + + Add hb_vector_t::fini_deep () + + src/hb-vector.hh | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit 4831e615d173be9c7e140be0fa9017e4d9e499af +Author: Behdad Esfahbod +Date: Fri Oct 5 18:14:13 2018 +0200 + + [morx] Fix memory access issue + + If buffer was enlarged, info was being outdated. + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1225 + + src/hb-aat-layout-common.hh | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit 5a41cf6be69adb0b5b29976a33c4c6dd6ce7afc5 +Author: Behdad Esfahbod +Date: Fri Oct 5 11:33:19 2018 +0200 + + [test/text-rendering-tests] Update from upstream + + test/shaping/data/text-rendering-tests/DISABLED | 3 +++ + test/shaping/data/text-rendering-tests/Makefile.sources | 2 ++ + .../text-rendering-tests/fonts/TestMORXThirtyfive.ttf | Bin 0 -> + 1968 bytes + .../text-rendering-tests/fonts/TestMORXThirtysix.ttf | Bin 0 -> + 1836 bytes + .../data/text-rendering-tests/tests/MORX-35.tests | 2 ++ + .../data/text-rendering-tests/tests/MORX-36.tests | 1 + + 6 files changed, 8 insertions(+) + +commit a62f37d6fa412b799b7247b813f6e65a968e7645 +Author: Behdad Esfahbod +Date: Fri Oct 5 02:49:29 2018 +0200 + + Change vendor features from Harf/Buzz to HARF/BUZZ + + https://github.com/harfbuzz/harfbuzz/commit/a01194aaf4c15160330b4042066263b2c963b658#commitcomment-30772041 + + "The tag space of tags consisting of four uppercase letters (A-Z) + with no punctuation, + spaces, or numbers, is reserved as a vendor space. Font vendors may + use such tags to + identify private features." + + src/hb-ot-shape.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 7b3ae5ffd202346cb3742fe0f8cfafe8c36a4bd5 +Author: Behdad Esfahbod +Date: Thu Oct 4 16:36:42 2018 +0200 + + More bot fixes + + test/shaping/run-tests.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 310bdac4a08b99a25de6a16a20464873f90b52e4 +Author: Behdad Esfahbod +Date: Thu Oct 4 16:31:14 2018 +0200 + + Fix a warning + + util/view-cairo.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 0abce58139bb58b8b97171db6387d2ac7eebdee0 +Author: Behdad Esfahbod +Date: Thu Oct 4 16:23:42 2018 +0200 + + [test] Choose 'ot' shaper specifically + + Now that we added morx support, our OS X bot is running them through + CoreText + and failing (with a DoS / infinite loop no less!). Always run + tests through + our own shaper. + + test/shaping/run-tests.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c93d379bf2414eb6ee6d38fb9753ddf818a777ea +Author: Behdad Esfahbod +Date: Thu Oct 4 13:28:13 2018 +0200 + + [TODO] Clean up + + TODO | 10 +--------- + 1 file changed, 1 insertion(+), 9 deletions(-) + +commit a01194aaf4c15160330b4042066263b2c963b658 +Author: Behdad Esfahbod +Date: Thu Oct 4 13:00:37 2018 +0200 + + Enable two OpenType features, 'Harf' and 'Buzz' + + One early, before script-specific features, one late, after. + Allows font + developers to detect us and behave differently if needed. + + src/hb-ot-shape.cc | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 55468ca01b4cdf274900fb752fbf9ae05a78705e +Author: Behdad Esfahbod +Date: Thu Oct 4 12:13:55 2018 +0200 + + [test/text-rendering-tests] Update from upstream + + test/shaping/data/text-rendering-tests/Makefile.sources | 6 +++++- + test/shaping/data/text-rendering-tests/extract-tests.py | 12 + ++++++++++++ + .../data/text-rendering-tests/fonts/TestGSUBThree.ttf | Bin 0 -> + 1504 bytes + .../text-rendering-tests/fonts/TestMORXThirtyfour.ttf | Bin 0 -> + 3608 bytes + .../text-rendering-tests/fonts/TestMORXThirtythree.ttf | Bin 0 -> + 1520 bytes + .../text-rendering-tests/fonts/TestMORXTwentyfour.ttf | Bin 0 -> + 1828 bytes + .../shaping/data/text-rendering-tests/tests/GSUB-3.tests | 1 + + .../data/text-rendering-tests/tests/MORX-24.tests | 1 + + .../data/text-rendering-tests/tests/MORX-32.tests | 8 ++++---- + .../data/text-rendering-tests/tests/MORX-33.tests | 3 +++ + .../data/text-rendering-tests/tests/MORX-34.tests | 1 + + test/shaping/run-tests.py | 15 + +++++++++------ + 12 files changed, 36 insertions(+), 11 deletions(-) + +commit 6ff8a8a10b62a54a87d53b0af66ccaba5d58b107 +Author: Behdad Esfahbod +Date: Thu Oct 4 12:09:45 2018 +0200 + + Minor + + test/shaping/data/text-rendering-tests/extract-tests.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 14ff3cbe0f30dea24e1bb175b1e8e41039f6afdc +Author: Behdad Esfahbod +Date: Thu Oct 4 11:34:21 2018 +0200 + + Apply morx if there's no GSUB! + + src/hb-ot-shape.cc | 23 ++++++++++++---- + src/hb-ot-shape.hh | 5 ++++ + test/shaping/data/text-rendering-tests/DISABLED | 32 + ---------------------- + .../data/text-rendering-tests/Makefile.sources | 14 +++++----- + 4 files changed, 29 insertions(+), 45 deletions(-) + +commit 3417037eb13a59dce6add0b1691ddb1b2b54c1e4 +Author: Behdad Esfahbod +Date: Thu Oct 4 11:08:15 2018 +0200 + + [aat] Add +hb_aat_layout_has_substitution + + src/hb-aat-layout-morx-table.hh | 2 ++ + src/hb-aat-layout.cc | 6 ++++++ + src/hb-aat-layout.hh | 2 ++ + 3 files changed, 10 insertions(+) + +commit 1f14107f71a6c3da8270ed21c3588f945fa91733 +Author: Sascha Brawer +Date: Thu Oct 4 09:17:08 2018 +0200 + + Minor: Fix autoconf warning + + Before this change, autoconf was emitting the following warnings: + + ``` + configure.ac:22: warning: AC_COMPILE_IFELSE was called before + AC_USE_SYSTEM_EXTENSIONS + ../../lib/autoconf/specific.m4:368: AC_USE_SYSTEM_EXTENSIONS is + expanded from... + configure.ac:22: the top level + configure.ac:22: warning: AC_RUN_IFELSE was called before + AC_USE_SYSTEM_EXTENSIONS + ../../lib/autoconf/specific.m4:368: AC_USE_SYSTEM_EXTENSIONS is + expanded from... + configure.ac:22: the top level + configure.ac:22: warning: AC_COMPILE_IFELSE was called before + AC_USE_SYSTEM_EXTENSIONS + ../../lib/autoconf/specific.m4:368: AC_USE_SYSTEM_EXTENSIONS is + expanded from... + configure.ac:22: the top level + configure.ac:22: warning: AC_RUN_IFELSE was called before + AC_USE_SYSTEM_EXTENSIONS + ../../lib/autoconf/specific.m4:368: AC_USE_SYSTEM_EXTENSIONS is + expanded from... + configure.ac:22: the top level + configure.ac:22: warning: AC_COMPILE_IFELSE was called before + AC_USE_SYSTEM_EXTENSIONS + ../../lib/autoconf/specific.m4:368: AC_USE_SYSTEM_EXTENSIONS is + expanded from... + configure.ac:22: the top level + configure.ac:22: warning: AC_RUN_IFELSE was called before + AC_USE_SYSTEM_EXTENSIONS + ../../lib/autoconf/specific.m4:368: AC_USE_SYSTEM_EXTENSIONS is + expanded from... + configure.ac:22: the top level + configure.ac:22: warning: AC_COMPILE_IFELSE was called before + AC_USE_SYSTEM_EXTENSIONS + ../../lib/autoconf/specific.m4:368: AC_USE_SYSTEM_EXTENSIONS is + expanded from... + configure.ac:22: the top level + configure.ac:22: warning: AC_RUN_IFELSE was called before + AC_USE_SYSTEM_EXTENSIONS + ../../lib/autoconf/specific.m4:368: AC_USE_SYSTEM_EXTENSIONS is + expanded from... + configure.ac:22: the top level + ``` + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 7810bb1a59ea71afeed7ea489400801ebdf642e4 +Author: Sascha Brawer +Date: Thu Oct 4 09:24:08 2018 +0200 + + [morx] Only insert glyphs at mark when a mark has been set before + + This reverts commit f4072e8cb81072cd6d51a2607efedb76c02e7db1. + https://github.com/harfbuzz/harfbuzz/issues/1195 + + src/hb-aat-layout-morx-table.hh | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit 5de2d9cdbdca870901c0ba9472f5b78c48ba0a58 +Author: Ebrahim Byagowi +Date: Thu Oct 4 02:14:18 2018 +0330 + + Minor, fix double-promotion warnings (#1221) + + .circleci/config.yml | 2 +- + src/dump-emoji.cc | 2 +- + src/hb-common.cc | 2 +- + src/hb-ot-var-fvar-table.hh | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +commit c2c7e6471ca912c91c82f6d71338082978f13dc6 +Author: Ebrahim Byagowi +Date: Thu Oct 4 00:29:40 2018 +0330 + + State our graphite2 dependency no-deprecated compile flag (#1220) + + .circleci/config.yml | 2 +- + .travis.yml | 2 -- + configure.ac | 2 +- + 3 files changed, 2 insertions(+), 4 deletions(-) + +commit e4e74c2751ac24178086cce2811d34d8019b6f85 +Author: mhosken +Date: Thu Oct 4 02:33:26 2018 +0700 + + Update Graphite API to latest (#1215) + + src/hb-graphite2.cc | 28 +++++++++++++++++++++++++++- + 1 file changed, 27 insertions(+), 1 deletion(-) + +commit 81f5eb09eca010337ffb3369000a3d5c1e8e2cda +Author: Behdad Esfahbod +Date: Wed Oct 3 21:30:48 2018 +0200 + + Add emoji test for recent work + + test/shaping/data/in-house/Makefile.sources | 2 +- + .../fonts/3cf6f8ac6d647473a43a3100e7494b202b2cfafe.ttf | Bin 0 -> + 16596 bytes + test/shaping/data/in-house/tests/emoji-flag-tags.tests | 2 -- + test/shaping/data/in-house/tests/emoji.tests | 4 ++++ + 4 files changed, 5 insertions(+), 3 deletions(-) + +commit 9e2824cca0e42a53fafda7b2feb095986df40675 +Author: Ebrahim Byagowi +Date: Wed Oct 3 22:49:02 2018 +0330 + + [ci] Delete azure-pipelines + + End of experiment, we might get back to it later + + azure-pipelines.yml | 10 ---------- + 1 file changed, 10 deletions(-) + +commit b710ea4fdeb1a620b396bd07665fc129fe5fc074 +Author: Behdad Esfahbod +Date: Wed Oct 3 21:17:59 2018 +0200 + + Clean Fitzpatrick hack + + src/hb-ot-layout.hh | 2 +- + src/hb-ot-shape.cc | 9 +++++++-- + src/hb-unicode.hh | 20 -------------------- + 3 files changed, 8 insertions(+), 23 deletions(-) + +commit 95e5f1ae69036108f318b93b11d85b2ebc19109b +Author: Behdad Esfahbod +Date: Wed Oct 3 21:11:13 2018 +0200 + + Unbreak Fitzpatrick + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1159 + + src/hb-ot-layout.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 03fb6dd4c7d12a98cc0ef325432658c3c76ab208 +Author: Behdad Esfahbod +Date: Wed Oct 3 21:02:16 2018 +0200 + + Rewrite grapheme-formation in terms of new work + + Also, don't attach ZWNJ to previous cluster. Closer to Unicode + graphemes. + + src/hb-coretext.cc | 2 +- + src/hb-ot-shape.cc | 48 + ++++++---------------- + .../in-house/tests/indic-joiner-candrabindu.tests | 2 +- + .../data/in-house/tests/indic-joiners.tests | 6 +-- + 4 files changed, 18 insertions(+), 40 deletions(-) + +commit 68106b1d9b96caf79b0a778a7da75caf54e7d44a +Author: Behdad Esfahbod +Date: Wed Oct 3 20:50:12 2018 +0200 + + Minor + + src/hb-ot-layout.hh | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 3f1c741b7a85d9c2d66e7f2446e988470c538b49 +Author: Behdad Esfahbod +Date: Wed Oct 3 20:45:19 2018 +0200 + + [test] Split a test + + .../fonts/4d4206e30b2dbf1c1ef492a8eae1c9e7829ebad8.ttf | Bin 0 -> + 51924 bytes + .../fonts/bb29ce50df2bdba2d10726427c6b7609bf460e04.ttf | Bin 74856 -> + 0 bytes + .../in-house/tests/mongolian-variation-selector.tests | 17 + ++++++++++++++++- + 3 files changed, 16 insertions(+), 1 deletion(-) + +commit ba813aab0909375af0c8f8e0c34595680c2762a4 +Author: Ebrahim Byagowi +Date: Wed Oct 3 21:52:15 2018 +0330 + + Update azure-pipelines.yml + + azure-pipelines.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 06922acbc4558699e43a4ed98ffb21f1e84abfc6 +Author: Behdad Esfahbod +Date: Wed Oct 3 20:19:17 2018 +0200 + + Fix distcheck + + src/Makefile.sources | 1 + + 1 file changed, 1 insertion(+) + +commit 4eea2e279b019ac627b2b9e2234a194957971022 +Author: Behdad Esfahbod +Date: Wed Oct 3 20:16:03 2018 +0200 + + [thai] Set continuation on decomposed nikhahit + + src/hb-ot-shape-complex-thai.cc | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 8edc91022c3943fb306cee26ed6eb85381b5ea76 +Author: Behdad Esfahbod +Date: Wed Oct 3 20:13:20 2018 +0200 + + [indic] Reset continuation on inserted dottedcircle + + src/hb-ot-shape-complex-indic.cc | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 2a6f15213ec30e5eb07465dd9dc81c2c386cb1e0 +Author: Behdad Esfahbod +Date: Wed Oct 3 20:09:14 2018 +0200 + + [buffer] Inline some more + + src/hb-buffer.cc | 44 -------------------------------------------- + src/hb-buffer.hh | 52 + ++++++++++++++++++++++++++++++++++++++++++++-------- + 2 files changed, 44 insertions(+), 52 deletions(-) + +commit 6f39c22029867c6d00cf70d7df242a28ca8f12bc +Author: Behdad Esfahbod +Date: Wed Oct 3 20:06:32 2018 +0200 + + Add code + + src/hb-ot-layout.hh | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 19d50aa2620f1464da8e00185b746e46fb0d80c4 +Author: Behdad Esfahbod +Date: Wed Oct 3 20:05:28 2018 +0200 + + [indic] Simplify dottedcircle + + src/hb-ot-shape-complex-indic.cc | 23 +++++++++++++++-------- + 1 file changed, 15 insertions(+), 8 deletions(-) + +commit 3b7831851052ecf2611a115cc2b80ef970d83df8 +Author: Behdad Esfahbod +Date: Wed Oct 3 19:44:15 2018 +0200 + + [emoji] Mark emoji contination sequences as continuation + + This adds a new grapheme bit. Not used yet. + + Part of https://github.com/harfbuzz/harfbuzz/issues/1159 + + src/hb-ot-layout.hh | 83 + +++++++++++++++++++++++++---------------------------- + src/hb-ot-shape.cc | 24 ++++++++++++++++ + src/hb-unicode.hh | 5 ---- + 3 files changed, 63 insertions(+), 49 deletions(-) + +commit 123326e20a30a51e25339c2eca272e4e6c847742 +Author: Behdad Esfahbod +Date: Wed Oct 3 19:19:51 2018 +0200 + + Dotted-circle all marks, not just non-spacing, at text beginning + + src/hb-ot-shape.cc | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 4146c00caa29e53ee9a29def151f12792ac76596 +Author: Ebrahim Byagowi +Date: Wed Oct 3 21:26:58 2018 +0330 + + [test] Use an in-repo font for test-multithread (#1218) + + As Khaled's suggestion, hard-coded font paths was only for my own + testing. + + test/api/hb-subset-test.h | 13 +++++++++---- + test/api/test-multithread.c | 41 + ++++++++++++++++++++++++++--------------- + test/fuzzing/main.cc | 6 ++++++ + 3 files changed, 41 insertions(+), 19 deletions(-) + +commit fde9b8852d7cd6224afeffcfe363f4b445ab1ece +Author: azure-pipelines[bot] + +Date: Wed Oct 3 17:47:05 2018 +0000 + + [ci] Add a test Azure Pipelines Linux bot + + Related #1219 + + azure-pipelines.yml | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit 674560cf244054a7e8c16073a59aa1b01e1ba5ea +Author: Behdad Esfahbod +Date: Wed Oct 3 19:10:28 2018 +0200 + + Fix build + + src/test-unicode-ranges.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 45e55f70801e2ccd28e1ee30bdf5341b1ac6efe5 +Author: Behdad Esfahbod +Date: Wed Oct 3 18:07:49 2018 +0200 + + [indic] Fix clang everything + + src/hb-ot-shape-complex-indic.cc | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +commit 4df02e3240ada0734748a47572baa2fc1c6afbd1 +Author: Behdad Esfahbod +Date: Wed Oct 3 17:54:09 2018 +0200 + + Minor + + src/hb-ot-os2-unicode-ranges.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 1e8f195b96765480007808da60789de9ac501c3b +Author: Behdad Esfahbod +Date: Wed Oct 3 17:46:48 2018 +0200 + + [emoji] Add emoji Extended_Pictographic table and function + + Part of https://github.com/harfbuzz/harfbuzz/issues/1159 + + . + + src/Makefile.am | 12 +- + src/gen-emoji-table.py | 64 ++++++++++ + src/hb-ot-os2-table.hh | 2 +- + src/hb-ot-os2-unicode-ranges.hh | 6 +- + src/hb-unicode-emoji-table.hh | 269 + ++++++++++++++++++++++++++++++++++++++++ + src/hb-unicode.cc | 16 +++ + src/hb-unicode.hh | 37 +++++- + 7 files changed, 398 insertions(+), 8 deletions(-) + +commit 1dc601b04a816a5b5ed12ae1c01ddcfd60a8398f +Author: Behdad Esfahbod +Date: Wed Oct 3 17:27:46 2018 +0200 + + [os2] Minor rename/shuffle + + ...unicode-ranges.py => gen-os2-unicode-ranges.py} | 2 +- + src/hb-ot-os2-unicode-ranges.hh | 45 + +++++++++++----------- + 2 files changed, 24 insertions(+), 23 deletions(-) + +commit 7a1ab0464d3ee1ca5c9b31215fbffb8601ae860d +Author: lantw44 +Date: Wed Oct 3 23:22:43 2018 +0800 + + Fix test-multithread build on FreeBSD (#1217) + + Add the default font path used by FreeBSD ports. + + test/api/test-multithread.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit df32eaae42b505b00de4a8b5efce9ab948bed847 +Author: Behdad Esfahbod +Date: Wed Oct 3 14:44:25 2018 +0200 + + [indic] Disallow vowel mark combinations that spoof other vowel marks + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1019 + + New numbers: + + BENGALI: 353725 out of 354188 tests passed. 463 failed (0.130722%) + DEVANAGARI: 707261 out of 707394 tests passed. 133 failed (0.0188014%) + GUJARATI: 366353 out of 366457 tests passed. 104 failed (0.0283799%) + GURMUKHI: 60729 out of 60747 tests passed. 18 failed (0.0296311%) + KANNADA: 951300 out of 951913 tests passed. 613 failed (0.0643966%) + MALAYALAM: 1048136 out of 1048334 tests passed. 198 failed + (0.0188871%) + ORIYA: 42327 out of 42329 tests passed. 2 failed (0.00472489%) + SINHALA: 271596 out of 271847 tests passed. 251 failed (0.0923313%) + TAMIL: 1091754 out of 1091754 tests passed. 0 failed (0%) + TELUGU: 970555 out of 970573 tests passed. 18 failed (0.00185457%) + + Devanagari regressed because Uniscribe doesn't enforce the full set. + + Tests added with the *-vowel-letters.txt files in tree and Noto fonts. + + src/hb-ot-shape-complex-indic.cc | 256 + ++++++++++++++++++++- + test/shaping/data/in-house/Makefile.sources | 1 + + .../03e3f463c3a985bc42096620cc415342818454fb.ttf | Bin 0 -> 2904 bytes + .../1a5face3fcbd929d228235c2f72bbd6f8eb37424.ttf | Bin 0 -> 8188 bytes + .../2c25beb56d9c556622d56b0b5d02b4670c034f89.ttf | Bin 0 -> 2460 bytes + .../604026ae5aaca83c49cd8416909d71ba3e1c1194.ttf | Bin 0 -> 4120 bytes + .../738d9f3b8c2dfd03875bf35a61d28fd78faf17c8.ttf | Bin 0 -> 2336 bytes + .../7d18685e1529e4ceaad5b6095dfab2f9789e5bce.ttf | Bin 0 -> 3452 bytes + .../881642af1667ae30a54e58de8be904566d00508f.ttf | Bin 0 -> 2760 bytes + .../af85624080af5627fb050f570d148a62f04fda74.ttf | Bin 0 -> 2656 bytes + .../tests/indic-vowel-letter-spoofing.tests | 53 +++++ + 11 files changed, 309 insertions(+), 1 deletion(-) + +commit 1b8d5e999192035c08f918aa1fcfcebdea67d82e +Author: Behdad Esfahbod +Date: Wed Oct 3 14:44:19 2018 +0200 + + [thai] Minor + + src/hb-ot-shape-complex-thai.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit d3d0cbd27831a6ea41b89f50d380296565c0016d +Author: Behdad Esfahbod +Date: Wed Oct 3 13:54:21 2018 +0200 + + Typo + + .../{bengali-vowel-leters.txt => bengali-vowel-letters.txt} + | 0 + .../{gujarati-vowel-letter.txt => gujarati-vowel-letters.txt} + | 0 + 2 files changed, 0 insertions(+), 0 deletions(-) + +commit 0dd9101fd0ddff80fff10ba98e93523aed95c8f5 +Author: Behdad Esfahbod +Date: Wed Oct 3 13:26:26 2018 +0200 + + Minor + + src/hb-ot-shape-complex-indic.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 9c4ffd10c4040ada9b1ffeb13c35f1330336359e +Author: Behdad Esfahbod +Date: Wed Oct 3 12:53:54 2018 +0200 + + Minor + + src/hb-ot-shape-complex.hh | 11 +++-------- + 1 file changed, 3 insertions(+), 8 deletions(-) + +commit bd1be8738fc4c73635cab7d77965264748d747cc +Author: HinTak +Date: Wed Oct 3 07:11:22 2018 +0800 + + Missing colon for gobject annotation + + There should be a colon separating "(transfer full)" and the + rest. Warned by g-ir-scanner. + + src/hb-face.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 75114e01d29b90f72a9398ed5dbc4298aba5a6b8 +Author: Behdad Esfahbod +Date: Wed Oct 3 12:29:56 2018 +0200 + + [use] Add Halant_Or_Vowel_Modifier category + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1102 + + src/gen-use-table.py | 7 +- + src/hb-ot-shape-complex-use-machine.hh | 518 + +++++++++++---------- + src/hb-ot-shape-complex-use-machine.rl | 9 +- + src/hb-ot-shape-complex-use-table.cc | 4 +- + src/hb-ot-shape-complex-use.hh | 5 +- + .../28f497629c04ceb15546c9a70e0730125ed6698d.ttf | Bin 0 -> 1496 bytes + .../shaping/data/in-house/tests/use-syllable.tests | 3 + + 7 files changed, 301 insertions(+), 245 deletions(-) + +commit 6353cc1f83c862910860976411a1157f7ed571bc +Author: Ebrahim Byagowi +Date: Tue Oct 2 21:39:19 2018 +0330 + + [circleci] Fix some of warnings from clang-everything bot (#1211) + + * -Wshift-sign-overflow + * -Wmissing-prototypes + + .circleci/config.yml | 4 ++-- + src/dump-emoji.cc | 19 ++++++++++--------- + src/hb-ucdn.cc | 3 +++ + src/test-unicode-ranges.cc | 4 ++-- + test/fuzzing/hb-subset-fuzzer.cc | 32 +++++++++++++++++--------------- + util/ansi-print.cc | 4 ++-- + 6 files changed, 36 insertions(+), 30 deletions(-) + +commit 9f1dee32fbad3b1486725c18570199156b57a94d +Author: Behdad Esfahbod +Date: Tue Oct 2 18:56:20 2018 +0200 + + [tests] Allow test-runner to ignore shaping output + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1212 + + test/shaping/data/in-house/tests/fuzzed.tests | 46 + +++++++++++++-------------- + test/shaping/run-tests.py | 2 +- + 2 files changed, 24 insertions(+), 24 deletions(-) + +commit fef7af1e22efb399517137b35d0ba9f307411ca3 +Author: Behdad Esfahbod +Date: Tue Oct 2 18:46:13 2018 +0200 + + [tibetan] Remove unused Tibetan shaper + + src/Makefile.sources | 1 - + src/hb-ot-shape-complex-tibetan.cc | 63 + -------------------------------------- + src/hb-ot-shape-complex.hh | 1 - + 3 files changed, 65 deletions(-) + +commit 32a438166fbccac6e0d9a615a492fc8cabfd21ab +Author: Behdad Esfahbod +Date: Tue Oct 2 18:43:29 2018 +0200 + + [tibetan] Route Tibetan through USE + + Fixes https://github.com/harfbuzz/harfbuzz/pull/933 + https://github.com/harfbuzz/harfbuzz/issues/1012 + + Tibetan failures go from 0 to 2: + + TIBETAN: 208467 out of 208469 tests passed. 2 failed (0.000959375%) + + src/gen-use-table.py | 30 ++++++++++------ + src/hb-ot-shape-complex-use-table.cc | 70 + ++++++++++++++++++++++-------------- + src/hb-ot-shape-complex.hh | 8 +---- + 3 files changed, 65 insertions(+), 43 deletions(-) + +commit 77792187be1405599e6aecfc3ed1fc771d505ddb +Author: Behdad Esfahbod +Date: Tue Oct 2 18:20:16 2018 +0200 + + [khmer] Remove unused khmer_position() + + src/dump-khmer-data.cc | 8 +++----- + src/hb-ot-shape-complex-khmer.hh | 1 - + 2 files changed, 3 insertions(+), 6 deletions(-) + +commit 5101abd42f4027edf182eddfa58c629b11c2a7f6 +Author: Behdad Esfahbod +Date: Tue Oct 2 17:49:06 2018 +0200 + + [indic/use] Factor common expressions in ragel machine + + No machine change. + + src/hb-ot-shape-complex-indic-machine.hh | 46 + ++++++++++++++++---------------- + src/hb-ot-shape-complex-indic-machine.rl | 10 ++++--- + src/hb-ot-shape-complex-use-machine.hh | 38 +++++++++++++------------- + src/hb-ot-shape-complex-use-machine.rl | 20 +++++++------- + 4 files changed, 58 insertions(+), 56 deletions(-) + +commit 6f457f8370de5d96452ee3a2d1b0a97b025ef1d1 +Author: Behdad Esfahbod +Date: Tue Oct 2 17:46:27 2018 +0200 + + [indic] Minor flip grammar around + + No behavior change. + + src/hb-ot-shape-complex-indic-machine.rl | 2 +- + src/hb-ot-shape-complex-use-machine.rl | 1 - + 2 files changed, 1 insertion(+), 2 deletions(-) + +commit d992982d23ef0c39ea42595ed0e8a4752977d1a5 +Author: Behdad Esfahbod +Date: Tue Oct 2 17:16:01 2018 +0200 + + [indic] Add some confusable sequences from Unicode Standard + + .../script-bengali/bengali-vowel-leters.txt | 3 ++ + .../devanagari-atomic-consonants.txt | 33 + ++++++++++++++++++++++ + .../script-devanagari/devanagari-vowel-letters.txt | 17 +++++++++++ + .../script-gujarati/gujarati-vowel-letter.txt | 8 ++++++ + .../script-gurmukhi/gurmukhi-vowel-letters.txt | 9 ++++++ + .../script-kannada/kannada-vowel-letters.txt | 3 ++ + .../script-malayalam/malayalam-vowel-letters.txt | 5 ++++ + .../script-oriya/oriya-vowel-letters.txt | 3 ++ + .../script-telugu/telugu-vowel-letters.txt | 5 ++++ + 9 files changed, 86 insertions(+) + +commit 40d5d19d5b875eef526a2a66892c3f638f633fa3 +Author: Behdad Esfahbod +Date: Tue Oct 2 17:04:05 2018 +0200 + + [ragel] Use ts/te (token-start / token-end) instead of manual tracking + + src/hb-ot-shape-complex-indic-machine.hh | 22 ++++++++++------------ + src/hb-ot-shape-complex-indic-machine.rl | 8 +++----- + src/hb-ot-shape-complex-khmer-machine.hh | 22 ++++++++++------------ + src/hb-ot-shape-complex-khmer-machine.rl | 8 +++----- + src/hb-ot-shape-complex-myanmar-machine.hh | 22 ++++++++++------------ + src/hb-ot-shape-complex-myanmar-machine.rl | 8 +++----- + src/hb-ot-shape-complex-use-machine.hh | 22 ++++++++++------------ + src/hb-ot-shape-complex-use-machine.rl | 8 +++----- + 8 files changed, 52 insertions(+), 68 deletions(-) + +commit 9efddb9de821fc909a3ea8354f3dfd39c823e97b +Author: Behdad Esfahbod +Date: Tue Oct 2 16:05:26 2018 +0200 + + Treat a base+mark... ligature as base, not ligature + + Fixes https://github.com/harfbuzz/harfbuzz/issues/746 + + src/hb-ot-layout-gsubgpos.hh | 22 +++++++++++++++------- + 1 file changed, 15 insertions(+), 7 deletions(-) + +commit 3cca978723db43233d25402254d297dfccf991a3 +Author: Behdad Esfahbod +Date: Tue Oct 2 15:02:16 2018 +0200 + + Move code around + + src/hb-ot-layout-gsub-table.hh | 3 --- + src/hb-ot-layout-gsubgpos.hh | 22 +++++++++++----------- + 2 files changed, 11 insertions(+), 14 deletions(-) + +commit 0a371fee4d22ed63207aa76c00b05b75bbc95f5f +Author: Behdad Esfahbod +Date: Tue Oct 2 14:48:39 2018 +0200 + + Minor + + src/hb-ot-map.hh | 6 ++++-- + src/hb-ot-shape-complex-arabic.cc | 6 +++--- + src/hb-ot-shape-complex-myanmar.cc | 4 ++-- + src/hb-ot-shape-complex-use.cc | 8 ++++---- + src/hb-ot-shape.cc | 4 ++-- + 5 files changed, 15 insertions(+), 13 deletions(-) + +commit 94d15528f80dbb7110d816fb5845f257f605a0be +Author: Behdad Esfahbod +Date: Tue Oct 2 14:45:09 2018 +0200 + + Minor + + src/hb-ot-map.hh | 1 + + src/hb-ot-shape.cc | 39 ++++++++++++++++++--------------------- + 2 files changed, 19 insertions(+), 21 deletions(-) + +commit 729f634728fb553300021d52089495271dfb19fd +Author: Behdad Esfahbod +Date: Tue Oct 2 14:40:14 2018 +0200 + + Disable joiner-skipping when looking back for base to attach mark to + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1189 + + src/hb-ot-shape.cc | 5 ++++- + test/shaping/data/in-house/Makefile.sources | 1 + + .../fonts/641ca9d7808b01cafa9a666c13811c9b56eb9c52.ttf | Bin 0 -> + 11492 bytes + .../data/in-house/tests/arabic-mark-attach.tests | 1 + + 4 files changed, 6 insertions(+), 1 deletion(-) + +commit c36f3f5bef52e660541933f003fafa6e3a14785d +Author: Behdad Esfahbod +Date: Tue Oct 2 14:34:29 2018 +0200 + + [arabic] Use manual-zwj instead of flipping joiners + + src/hb-buffer.hh | 3 +-- + src/hb-ot-layout.hh | 12 ++---------- + src/hb-ot-shape-complex-arabic.cc | 41 + ++++++--------------------------------- + 3 files changed, 9 insertions(+), 47 deletions(-) + +commit 48c513fec978819927535bc86b43be74315f746c +Author: Behdad Esfahbod +Date: Tue Oct 2 14:17:42 2018 +0200 + + Minor + + src/hb-ot-shape-complex-arabic.cc | 2 +- + src/hb-ot-shape-complex-default.cc | 2 +- + src/hb-ot-shape-complex-hangul.cc | 2 +- + src/hb-ot-shape-complex-hebrew.cc | 14 +------------- + src/hb-ot-shape-complex-indic.cc | 2 +- + src/hb-ot-shape-complex-indic.hh | 2 -- + src/hb-ot-shape-complex-khmer.cc | 2 +- + src/hb-ot-shape-complex-myanmar.cc | 4 ++-- + src/hb-ot-shape-complex-thai.cc | 2 +- + src/hb-ot-shape-complex-tibetan.cc | 2 +- + src/hb-ot-shape-complex-use.cc | 2 +- + src/hb-ot-shape-complex.hh | 11 ++++------- + src/hb-ot-shape.cc | 8 ++++---- + 13 files changed, 19 insertions(+), 36 deletions(-) + +commit cca757ae56d6a82cfad35edc6dbae58049a34f91 +Author: Behdad Esfahbod +Date: Tue Oct 2 13:27:11 2018 +0200 + + Minor + + src/hb-ot-shape.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 96eca87f89588126d3fa5c7f3884ae2f302a91e1 +Author: Behdad Esfahbod +Date: Tue Oct 2 13:24:40 2018 +0200 + + Move things + + src/hb-ot-shape.cc | 22 ++++++++++------------ + src/hb-ot-shape.hh | 3 +++ + 2 files changed, 13 insertions(+), 12 deletions(-) + +commit 588a4ac8bc9fd20464c7a77ead27ae34478c9bc8 +Author: Behdad Esfahbod +Date: Tue Oct 2 13:13:47 2018 +0200 + + Rename + + src/hb-ot-face.cc | 20 +++++++------- + src/hb-ot-face.hh | 78 + +++++++++++++++++++++++++++---------------------------- + 2 files changed, 49 insertions(+), 49 deletions(-) + +commit 10b6c7c63870fa04cd8adcf9f38644c2a799db8a +Author: Behdad Esfahbod +Date: Tue Oct 2 13:11:18 2018 +0200 + + Minor include cleanup + + src/hb-ot-shape-complex.hh | 1 + + src/hb-ot-shape.cc | 4 +--- + src/hb-ot-shape.hh | 2 +- + 3 files changed, 3 insertions(+), 4 deletions(-) + +commit 1d1734e985e1f2a746b4fff0cd82d96d477577d5 +Author: Behdad Esfahbod +Date: Tue Oct 2 13:04:05 2018 +0200 + + Shuffle code around + + src/hb-ot-shape-complex-hebrew.cc | 2 +- + src/hb-ot-shape-fallback.cc | 2 +- + src/hb-ot-shape-normalize.cc | 2 +- + src/hb-ot-shape.cc | 32 ++++++++++++++++++++++++++++---- + src/hb-ot-shape.hh | 29 ++++++----------------------- + 5 files changed, 37 insertions(+), 30 deletions(-) + +commit bf5088b3dcd94106937290c180f3f40bc8524b48 +Author: Ebrahim Byagowi +Date: Tue Oct 2 11:07:06 2018 +0330 + + Minor, fix -Weverthing bot warnings (#1210) + + test/api/test-buffer.c | 8 ++++---- + test/api/test-multithread.c | 3 +-- + 2 files changed, 5 insertions(+), 6 deletions(-) + +commit d27e5ec3a236b8eb37ef9ce558ad54077e46b003 +Author: Khaled Hosny +Date: Tue Oct 2 08:25:29 2018 +0200 + + Skip BOM in the Python sample file + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1208 + + src/sample.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit f9ea3dc4c6e85c417dd4c8546e5ebe02b67131b9 +Author: HinTak +Date: Tue Oct 2 06:43:06 2018 +0100 + + Missing "out" indicator (#1209) + + Missing "out" indicator. Affect gobject introspection. + + src/hb-font.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 9742679b8253919f8bfec8a77532092044e951aa +Author: Ebrahim Byagowi +Date: Tue Oct 2 03:20:48 2018 +0330 + + [circleci] Remove some of the not needed flags + + .circleci/config.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f72b748371da2d7ce327a5d15feea46960aa7dd3 +Author: Ebrahim Byagowi +Date: Tue Oct 2 00:16:08 2018 +0330 + + [circleci] Fix "msan" and "everything" bots (#1205) + + .circleci/config.yml | 13 ++++++------- + src/check-symbols.sh | 2 -- + test/fuzzing/main.cc | 22 +++++++++------------- + test/fuzzing/run-shape-fuzzer-tests.py | 2 -- + test/fuzzing/run-subset-fuzzer-tests.py | 2 -- + 5 files changed, 15 insertions(+), 26 deletions(-) + +commit 8bf4027d23318c7e1ff7fe9f5e7ad8b0380e5415 +Author: Behdad Esfahbod +Date: Mon Oct 1 20:05:00 2018 +0200 + + [indic] Remove Consonant_Medial from grammar and code + + The only Indic CM is U+0A75 GURMUKHI SIGN YAKASH, which Uniscribe + doesn't treat + specially, and font designers design for that. So, do the same. + + src/hb-ot-shape-complex-indic-machine.hh | 1244 + ++++++++++++++---------------- + src/hb-ot-shape-complex-indic-machine.rl | 10 +- + src/hb-ot-shape-complex-indic.cc | 2 +- + src/hb-ot-shape-complex-indic.hh | 6 +- + 4 files changed, 589 insertions(+), 673 deletions(-) + +commit ab4c37f73a7d4fcf48584cda3fff94e98a672086 +Author: Behdad Esfahbod +Date: Mon Oct 1 19:35:48 2018 +0200 + + [khmer] Add mark-ordering tests + + Fixes https://github.com/harfbuzz/harfbuzz/issues/667 + + test/shaping/data/in-house/Makefile.sources | 2 ++ + .../b6031119874ae9ff1dd65383a335e361c0962220.ttf | Bin 0 -> 2564 bytes + .../data/in-house/tests/khmer-mark-order.tests | 25 + +++++++++++++++++++++ + 3 files changed, 27 insertions(+) + +commit 51436547162a18e88144e7125ad6ce4a69a08d4b +Author: Behdad Esfahbod +Date: Mon Oct 1 19:09:58 2018 +0200 + + [khmer] Rewrite grammar completely + + Based on experimenting with Uniscribe to extract grammar and + categories. + + Failures down from 44 to 35: + + KHMER: 299089 out of 299124 tests passed. 35 failed (0.0117008%) + + We still don't enforce the one-matra rule pre-decomposition, + but enforce + an order and one-matra-per-position post-decomposition. + + https://github.com/harfbuzz/harfbuzz/issues/667 + + src/hb-ot-shape-complex-indic.hh | 2 +- + src/hb-ot-shape-complex-khmer-machine.hh | 300 + ++++++++++++++++++++----------- + src/hb-ot-shape-complex-khmer-machine.rl | 42 +++-- + src/hb-ot-shape-complex-khmer.cc | 4 +- + src/hb-ot-shape-complex-khmer.hh | 99 +++++----- + 5 files changed, 270 insertions(+), 177 deletions(-) + +commit aaaa65baa7fcfb65ae814528bdd93cc5c4ea540d +Author: Behdad Esfahbod +Date: Mon Oct 1 16:59:48 2018 +0200 + + [khmer] Remove unused code + + src/hb-ot-shape-complex-khmer.hh | 12 ------------ + 1 file changed, 12 deletions(-) + +commit eb1e60287732ede6040ce6f7498c10909448d248 +Author: Behdad Esfahbod +Date: Mon Oct 1 15:31:50 2018 +0200 + + [test] Try import unicodedata2 as unicodedata + + test/shaping/hb_test_tools.py | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 81afdbe803ca949d915d03cab4a6ed6c6e6ff304 +Author: Behdad Esfahbod +Date: Mon Oct 1 15:01:04 2018 +0200 + + [use] Disable automatic ZWJ for 'akhn' feature + + Fixes https://github.com/harfbuzz/harfbuzz/issues/746 + + src/hb-ot-shape-complex-use.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ceef311dcaea7e1ecfedb4f1257a705572611f0f +Author: Behdad Esfahbod +Date: Mon Oct 1 12:45:06 2018 +0200 + + [use] Change categories for Left_And_* matras + + These are only relevant to Sinhala, because they decompose in other + cases. The USE spec categorizes them all as VPst. No idea why we + weren't following that before. + + src/gen-use-table.py | 4 ++-- + src/hb-ot-shape-complex-use-table.cc | 24 ++++++++++++------------ + 2 files changed, 14 insertions(+), 14 deletions(-) + +commit 3426a361571a1996b5a895fb9374ce3a4a7f9af3 +Author: Behdad Esfahbod +Date: Mon Oct 1 12:55:57 2018 +0200 + + Unbreak bots + + src/hb-cache.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 98ac01d3b3deb7c7f5411f6f25c6e7588d84b5f9 +Author: Behdad Esfahbod +Date: Mon Oct 1 12:10:00 2018 +0200 + + [morx] Break out if buffer gets into error + + Was getting stuck not making progress somehow. + + src/hb-aat-layout-common.hh | 2 ++ + src/hb-aat-layout-morx-table.hh | 4 ++++ + 2 files changed, 6 insertions(+) + +commit df827a6ab88cd8bde346176fc53a5c2d57eee808 +Author: Behdad Esfahbod +Date: Mon Oct 1 11:34:20 2018 +0200 + + [cache] Fix cache coherency corner-case + + If key_bits+value_bits-cache_bits==32 then -1 is ambiguous... + + src/hb-cache.hh | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 0fa1edbd3bbf825be078677dc46c3440f9802551 +Author: Ebrahim Byagowi +Date: Mon Oct 1 09:40:29 2018 +0330 + + [circleci] Couple of fixes (#1200) + + * Raise error on warnings on -everything + * Enable fontconfig to two bots + * Fix msan bot now that all of its real complain are gone + + .circleci/config.yml | 14 ++++++-------- + src/check-symbols.sh | 2 ++ + src/hb-ucdn.cc | 2 ++ + test/fuzzing/run-shape-fuzzer-tests.py | 2 ++ + test/fuzzing/run-subset-fuzzer-tests.py | 2 ++ + util/helper-cairo.cc | 2 ++ + 6 files changed, 16 insertions(+), 8 deletions(-) + +commit 3babb0813c69d2b419f06773f366a44a9ad32cdb +Author: Behdad Esfahbod +Date: Sun Sep 30 20:02:30 2018 +0200 + + [msan] Disable icu explicitly + + .circleci/config.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit dc9b47ae87096d34d146e50e44e742a76861976f +Author: Behdad Esfahbod +Date: Sun Sep 30 18:35:12 2018 +0200 + + [msan] Remove uninstrumented libraries + + .circleci/config.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ad1c190ecfbac66ffeef69db769073a33331eed3 +Author: Behdad Esfahbod +Date: Sun Sep 30 18:26:45 2018 +0200 + + Correct fix for glib-mkenum warning + + src/hb-buffer.h | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 1dd1e56bf42af5b11afc3e34f78869e93d39867e +Author: Behdad Esfahbod +Date: Sun Sep 30 18:25:58 2018 +0200 + + Revert "Fix glib-mkenum warning" + + This reverts commit 247756a7d89008ee6a7d1171dc07ba22454c6034. + + Was wrong. Right fix coming. + + src/hb-buffer.h | 2 ++ + 1 file changed, 2 insertions(+) + +commit 3f08750fa6772e7e342b96192b84cb9963f7335b +Author: Behdad Esfahbod +Date: Sun Sep 30 18:23:34 2018 +0200 + + Move _POSIX_SOURCE to hb.hh + + src/hb-blob.cc | 5 ----- + src/hb.hh | 4 ++++ + 2 files changed, 4 insertions(+), 5 deletions(-) + +commit 90dd255e570bf8ea3436e2f29242068845256e55 +Author: Behdad Esfahbod +Date: Sun Sep 30 18:19:54 2018 +0200 + + Change _HB_SCRIPT_MAX_VALUE from 0xFFFFFFFF to 0x7FFFFFFF + + Fixes https://github.com/harfbuzz/harfbuzz/issues/504 + + src/hb-common.h | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +commit dcfcb950b81a2865ef01f5a69087264b79ed1bfd +Author: Behdad Esfahbod +Date: Sun Sep 30 18:14:50 2018 +0200 + + [test] Fix -Wunused-parameter warnings + + test/api/hb-test.h | 1 + + test/api/test-blob.c | 2 +- + test/api/test-c.c | 2 +- + test/api/test-font.c | 16 ++++++++-------- + test/api/test-multithread.c | 2 +- + test/api/test-ot-color.c | 2 +- + test/api/test-shape.c | 14 +++++++------- + test/api/test-unicode.c | 10 +++++----- + 8 files changed, 25 insertions(+), 24 deletions(-) + +commit be0b2ed3162f465dbf44a0f018d4e2af5dcdf87c +Author: Behdad Esfahbod +Date: Sun Sep 30 18:01:20 2018 +0200 + + More warning fixes + + test/api/test-multithread.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +commit 5c65ed800de4caef5ee9ad2111225fa5d8235737 +Author: Behdad Esfahbod +Date: Sun Sep 30 17:48:55 2018 +0200 + + Fix bug introduced in 9b0b40b3c1ac8155c80ed5dc976228f4d3ec7e1f + + Also discovered by msan bot. + + src/hb-ot-shape-fallback.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 247756a7d89008ee6a7d1171dc07ba22454c6034 +Author: Behdad Esfahbod +Date: Sun Sep 30 13:10:54 2018 +0200 + + Fix glib-mkenum warning + + GEN hb-gobject-enums.h + WARNING: Failed to parse "/*< private >*/" in ../../src/hb-buffer.h + + src/hb-buffer.h | 2 -- + 1 file changed, 2 deletions(-) + +commit 0a89f9572fe2d0d9fbf0297e0a69307f0ba1a17c +Author: Ebrahim Byagowi +Date: Sun Sep 30 17:44:15 2018 +0330 + + [circleci] Pass ‌freetype compile flags to right place + + .circleci/config.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ad701f05cc86c22e8e53b7f5458887457e3a5e5f +Author: Ebrahim Byagowi +Date: Sun Sep 30 17:30:42 2018 +0330 + + [circleci] Use an instrumented freetype on msan bot + + .circleci/config.yml | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 57aabbc29ec6dfa7f1b57da7b6c62fdc547f8ef8 +Author: Ebrahim Byagowi +Date: Sun Sep 30 16:31:28 2018 +0330 + + [circleci] Another on fixing msan + + .circleci/config.yml | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 24f148df3ecc899c9cf6d5359d3d35ee5e84a98c +Author: Ebrahim Byagowi +Date: Sun Sep 30 14:46:56 2018 +0330 + + [circleci] minor + + .circleci/config.yml | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 0a9aab672287149540e8d90b5063ad4c562c423c +Author: Ebrahim Byagowi +Date: Sun Sep 30 14:45:43 2018 +0330 + + [circleci] Try to fix msan bot + + .circleci/config.yml | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit b5285b34798cb7ee672343d00cbe066ea8a2ef83 +Author: Behdad Esfahbod +Date: Sun Sep 30 12:23:01 2018 +0200 + + [util] Remove unneeded virtual + + clang warning: + + ../../util/options.hh:72:13: warning: destination for this 'memset' + call is a pointer to dynamic class + 'option_parser_t'; vtable pointer will be overwritten + [-Wdynamic-class-memaccess] + memset (this, 0, sizeof (*this)); + ~~~~~~ ^ + ../../util/options.hh:72:13: note: explicitly cast the pointer to + silence this warning + memset (this, 0, sizeof (*this)); + ^ + (void*) + + util/options.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 89ed040b21b366c927199bedd0e4cb060389d076 +Author: Behdad Esfahbod +Date: Sun Sep 30 06:06:26 2018 -0400 + + [util] Fix more non-virtual-destructor warnings + + util/options.hh | 28 ++++++++++++++++++---------- + 1 file changed, 18 insertions(+), 10 deletions(-) + +commit 2382dd07fa6ff49638b146a523e9d2e93cf69ceb +Author: Behdad Esfahbod +Date: Sun Sep 30 05:54:47 2018 -0400 + + Minor + + util/options.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 9caa432d0c5c09c8151cfce1e2cc184fbdd89594 +Author: Behdad Esfahbod +Date: Sun Sep 30 05:49:08 2018 -0400 + + [util] Use HB_FALLTHROUGH + + Sure, gcc knows to warn about this as well: + + ../../util/options.cc:175:17: warning: this statement may fall through + [-Wimplicit-fallthrough=] + case 1: m.r = m.t; + ~~~~^~~~~ + ../../util/options.cc:176:5: note: here + case 2: m.b = m.t; + ^~~~ + + But HOLY SMOKES, look at clang -Weverything bot message: + + options.cc:176:5: warning: unannotated fall-through between switch + labels [-Wimplicit-fallthrough] + case 2: m.b = m.t; + ^ + options.cc:176:5: note: insert 'HB_FALLTHROUGH;' to silence this + warning + case 2: m.b = m.t; + ^ + HB_FALLTHROUGH; + + Right, it's telling me to insert "HB_FALLTHROUGH;" there!!!!!!!!! + + util/options.cc | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit 2e728a7d86c714d845524a0722c2b653feb9d915 +Author: Behdad Esfahbod +Date: Sun Sep 30 05:47:36 2018 -0400 + + [util] Mark var static + + From clang -Weverything bot: + + options.cc:39:3: warning: no previous extern declaration + for non-static variable 'supported_font_funcs' + [-Wmissing-variable-declarations] + + util/options.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e910a1aef4b2413c627240fc06d2a5696b24747a +Author: Behdad Esfahbod +Date: Sun Sep 30 05:46:20 2018 -0400 + + [util] Add empty virtual destructor to option_group_t + + From clang -Weverything bot: + + ./options.hh:57:8: warning: 'option_group_t' has virtual functions + but non-virtual destructor [-Wnon-virtual-dtor] + struct option_group_t + ^ + + util/options.hh | 2 ++ + 1 file changed, 2 insertions(+) + +commit b1e07e1e6cc7a8e5445c7aeb9491ae629029011b +Author: Behdad Esfahbod +Date: Sun Sep 30 05:43:22 2018 -0400 + + [indic/khmer] Remove use of global constructors + + Alternative woul have been to resurrect F_COMBINE that I removed in + 70136a78cb9eda244767f8e8a3d30d0f3c569d01 + + But this does it for now. I'm not sure why check-static-inits.sh + didn't + catch this before. Clang -Weverything bot did: + + CXX libharfbuzz_la-hb-ot-shape-complex-indic.lo + hb-ot-shape-complex-indic.cc:99:1: warning: declaration requires a + global constructor [-Wglobal-constructors] + indic_features[] = + ^ + 1 warning generated. + CXX libharfbuzz_la-hb-ot-shape-complex-khmer.lo + hb-ot-shape-complex-khmer.cc:36:1: warning: declaration requires a + global constructor [-Wglobal-constructors] + khmer_features[] = + ^ + 1 warning generated. + + src/hb-ot-map.hh | 2 ++ + src/hb-ot-shape-complex-indic.cc | 34 +++++++++++++++++----------------- + src/hb-ot-shape-complex-khmer.cc | 18 +++++++++--------- + 3 files changed, 28 insertions(+), 26 deletions(-) + +commit 00cd00e64130694ff7b49456d4bc421a153b4e6d +Author: Behdad Esfahbod +Date: Sun Sep 30 05:34:30 2018 -0400 + + Tweak HB_TAG and HB_UNTAG + + uint32_t was getting promoted to signed int, which is not what + we wanted... + + Wow, clang has become good at generating warnings... + + ../../src/hb-common.h:349:29: warning: signed shift result + (0xFF000000) sets the sign bit of the shift expression's type ('int') + and becomes negative [-Wshift-sign-overflow] + _HB_SCRIPT_MAX_VALUE = HB_TAG_MAX, /*< + skip >*/ + ^~~~~~~~~~ + ../../src/hb-common.h:93:20: note: expanded from macro 'HB_TAG_MAX' + define HB_TAG_MAX HB_TAG(0xff,0xff,0xff,0xff) + ^~~~~~~~~~~~~~~~~~~~~~~~~~~ + ../../src/hb-common.h:89:57: note: expanded from macro 'HB_TAG' + define HB_TAG(c1,c2,c3,c4) + ((hb_tag_t)((((uint8_t)(c1))<<24)|(((uint8_t)(c2))<<16)|(((uint8_t)(c3))<<8)|((uint8_t)(c4)))) + ~~~~~~~~~~~~~~~^ ~~ + ../../src/hb-common.h:349:3: warning: ISO C restricts enumerator + values to range of 'int' (4294967295 is too large) [-Wpedantic] + _HB_SCRIPT_MAX_VALUE = HB_TAG_MAX, /*< + skip >*/ + ^ ~~~~~~~~~~ + + src/hb-common.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 8a31e406291f4cb27480fc85049f08abd739cb59 +Author: Behdad Esfahbod +Date: Sun Sep 30 05:27:39 2018 -0400 + + [font] Make *_advance() fallback to *_advances + + And remove redundant implementations. + + src/hb-font.cc | 12 ++++++++++++ + src/hb-ft.cc | 19 ------------------- + src/hb-ot-font.cc | 22 ---------------------- + 3 files changed, 12 insertions(+), 41 deletions(-) + +commit bd07d2878ff28baecf7b4b587a18ffbb744b7eb1 +Author: Behdad Esfahbod +Date: Sun Sep 30 03:54:40 2018 -0400 + + Use buffer scratch_flags to remember if we had any joiners + + src/hb-buffer.hh | 3 ++- + src/hb-ot-layout.hh | 12 ++++++++++-- + src/hb-ot-shape-complex-arabic.cc | 3 +++ + 3 files changed, 15 insertions(+), 3 deletions(-) + +commit ba0f0f156fe05bda760efcb0c8d34f303fa26ab0 +Author: Behdad Esfahbod +Date: Sun Sep 30 03:49:52 2018 -0400 + + Document setlocale() threadsafety issue + + "Fixes" //github.com/harfbuzz/harfbuzz/issues/1191 + + src/hb-buffer.cc | 2 ++ + src/hb-common.cc | 7 +++++++ + 2 files changed, 9 insertions(+) + +commit 06be2aa93fa6ea8cc32684a4b51bfe927c5202bb +Author: Ebrahim Byagowi +Date: Sun Sep 30 00:15:25 2018 +0330 + + [ci] Build glib and freetype and enable msan bot (#1198) + + .circleci/config.yml | 41 +++++++++++++++++++++-------------------- + 1 file changed, 21 insertions(+), 20 deletions(-) + +commit cefdef0247026f941eba8930c73b66b0498bb63c +Author: Ebrahim Byagowi +Date: Sat Sep 29 10:19:54 2018 +0330 + + Minor on test-multithread, align the actual and expected results + + test/api/test-multithread.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 678beff64ca3b2963de25d8a76a2bf3710c3d7a6 +Author: Ebrahim Byagowi +Date: Sat Sep 29 10:16:14 2018 +0330 + + [circleci] Add -Wno-reserved-id-macro to clang-everything + + .circleci/config.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c763b9440189b541316054ba4f623e728b5aae77 +Author: Behdad Esfahbod +Date: Fri Sep 28 20:53:07 2018 -0400 + + [test-multithread] Disable FreeType funcs + + test/api/test-multithread.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit 9b0b40b3c1ac8155c80ed5dc976228f4d3ec7e1f +Author: Behdad Esfahbod +Date: Fri Sep 28 11:16:18 2018 -0400 + + Fix fallback kerning to check for current glyph's mask + + src/hb-ot-shape-fallback.cc | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +commit 909a07b587884e9cd1d92ba9f3d5b96d8774c67a +Author: Ebrahim Byagowi +Date: Sat Sep 29 03:10:13 2018 +0330 + + [circleci] Improve clang-everything bot log, more to come + + #1196 + + .circleci/config.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 9be8062b4d241f02bb96df436e98f10f08bda4f8 +Author: Ebrahim Byagowi +Date: Sat Sep 29 02:11:05 2018 +0330 + + [ci] Another try on mingw bot + + appveyor.yml | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit d4d261a97723b27fb9ad9a69b8dc7fd8c560a98b +Author: Ebrahim Byagowi +Date: Sat Sep 29 01:57:50 2018 +0330 + + [ci] Another try on fixing mingw bots + + Per + https://github.com/Alexpux/MSYS2-packages/issues/163#issuecomment-73555971 + + appveyor.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 7b68edf2abc7680199360d52ed283cfc4f49b7d5 +Author: Ebrahim Byagowi +Date: Fri Sep 28 20:53:48 2018 +0330 + + [tests] Don't try to get glyph names on failures + + As it may cause a race unrelated to the issue actually happened + + test/api/test-multithread.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit d289d6381864649504abfb1196ac20a1d4664a4e +Author: Ebrahim Byagowi +Date: Fri Sep 28 20:47:21 2018 +0330 + + [ci] Trying to fix mingw bot + + As https://github.com/Alexpux/MSYS2-packages/issues/702 + + appveyor.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 33231a855f0e3d2a14e5e2fcb921c6fc773ae6cf +Author: Behdad Esfahbod +Date: Fri Sep 28 11:06:49 2018 -0400 + + Fix pthread fail for real + + Using a hack... + + test/api/Makefile.am | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 8cb8209c911a69442f23f744981e3ed01e44a3fc +Author: Behdad Esfahbod +Date: Fri Sep 28 10:55:28 2018 -0400 + + Fix bot fails + + test/api/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f4072e8cb81072cd6d51a2607efedb76c02e7db1 +Author: Behdad Esfahbod +Date: Fri Sep 28 10:14:23 2018 -0400 + + [morx] Remove mark_set from Insertion + + text-rendering-tests test MORX-32 shows that for Insertion, an unset + mark is treated + as mark set at 0. This is unlike the Reordering lookup where un + unset mark performs + nothing. + + Fixes MORX-32. + + src/hb-aat-layout-morx-table.hh | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +commit 0d18ec5467818fa8f763ec2871146a64d39987e7 +Author: Behdad Esfahbod +Date: Fri Sep 28 10:00:07 2018 -0400 + + [morx] unsafe-to-break in Insertion + + Makes MORX-29, MORX-30, MORX-31 pass. + + src/hb-aat-layout-morx-table.hh | 2 ++ + 1 file changed, 2 insertions(+) + +commit 02bebe42c1ffbd8e11b232c943317c8cd8141afb +Author: Behdad Esfahbod +Date: Fri Sep 28 09:51:35 2018 -0400 + + [test/text-rendering-tests] Update from upstream + + test/shaping/data/text-rendering-tests/DISABLED | 4 ++++ + test/shaping/data/text-rendering-tests/Makefile.sources | 4 ++++ + .../text-rendering-tests/fonts/TestMORXThirtyone.ttf | Bin 0 -> + 2964 bytes + .../text-rendering-tests/fonts/TestMORXThirtytwo.ttf | Bin 0 -> + 2948 bytes + .../text-rendering-tests/fonts/TestMORXTwentynine.ttf | Bin 0 -> + 3012 bytes + .../data/text-rendering-tests/tests/MORX-29.tests | 4 ++++ + .../data/text-rendering-tests/tests/MORX-30.tests | 4 ++++ + .../data/text-rendering-tests/tests/MORX-31.tests | 8 ++++++++ + .../data/text-rendering-tests/tests/MORX-32.tests | 4 ++++ + 9 files changed, 28 insertions(+) + +commit 4cd342baea323bf9709340bbabfc092c976c239c +Author: Behdad Esfahbod +Date: Fri Sep 28 09:47:45 2018 -0400 + + Fix ubsan bot + + test/api/Makefile.am | 1 + + 1 file changed, 1 insertion(+) + +commit b435df3a5b6f7fddc091c4362a36840305144a57 +Author: Behdad Esfahbod +Date: Fri Sep 28 09:13:14 2018 -0400 + + More atomic tuneup + + src/hb-atomic.hh | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +commit 7e6e094abd27fd022fe9aea1872ef82f6a0cdcec +Author: Behdad Esfahbod +Date: Fri Sep 28 08:45:57 2018 -0400 + + [test-multithread] Install ot funcs before filling ref buffer + + test/api/test-multithread.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 21fbee831e0eab2c2f4513825c939158f4578156 +Author: Behdad Esfahbod +Date: Fri Sep 28 08:43:37 2018 -0400 + + [test-multithread] Take num-threads and num-iters from command-line + + test/api/test-multithread.c | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 598be3bb38fd11a288f8155b8c27ffef4ebdd8b9 +Author: Behdad Esfahbod +Date: Fri Sep 28 08:33:26 2018 -0400 + + Minor + + test/api/test-multithread.c | 1 + + 1 file changed, 1 insertion(+) + +commit c09bf3d50589c8eb95b322ef3e4eb8a288dacebe +Author: Ebrahim Byagowi +Date: Fri Sep 28 16:13:01 2018 +0330 + + test-multithread, check the results on every iteration (#1194) + + test/api/test-multithread.c | 59 + ++++++++++++++++++++++++--------------------- + 1 file changed, 32 insertions(+), 27 deletions(-) + +commit dbc3070a15290310bb5aade11d04eb24fe958094 +Author: Ebrahim Byagowi +Date: Fri Sep 28 16:01:15 2018 +0330 + + Make test-multithread pass the tsan bot test (#1193) + + test/api/test-multithread.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit d2542cd28c70b2ba7ab28c0fe5459a1b4a873478 +Author: Behdad Esfahbod +Date: Thu Sep 27 17:23:24 2018 -0400 + + More atomic fixup + + src/hb-atomic.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 3ee96984f4633852736b33640c89d1706bc77e0b +Author: Behdad Esfahbod +Date: Thu Sep 27 17:20:26 2018 -0400 + + Fixup atomics from recent change + + src/hb-atomic.hh | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit 305468708dc9ce9dadad36c117c380f13bcc6a26 +Author: Behdad Esfahbod +Date: Thu Sep 27 16:54:23 2018 -0400 + + [cache] Use atomic writes in clear() + + To help TSan. + + src/hb-cache.hh | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 9e9a36ee651502b69717895385387951a2d0802a +Author: Volker Krause +Date: Thu Sep 27 16:33:49 2018 +0200 + + Fix infinite loop when walking up the directory hierarchy (#1183) + + A single find_package(harfbuzz) line in user code resulted in + this loop + getting stuck when _harfbuzz_libdir_iter became "/". + + src/harfbuzz-config.cmake.in | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 0c1d852bc41a4f69f890be4817c84bd7de56e07a +Author: Ebrahim Byagowi +Date: Thu Sep 27 11:53:17 2018 +0330 + + Use clang for compiling freetype for tsan bot + + .circleci/config.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 662f7d7e8bfa77b21ffa05e853f61dda993dcc8a +Author: Behdad Esfahbod +Date: Wed Sep 26 18:42:37 2018 -0400 + + [arabic] Do the joiner-flipping only for rlig feature + + See comment. + + src/hb-ot-shape-complex-arabic.cc | 24 +++++++++++++++++++----- + 1 file changed, 19 insertions(+), 5 deletions(-) + +commit 7f30629cddcf0196d7b754df0cb2d4a8e5fed4b6 +Author: Behdad Esfahbod +Date: Wed Sep 26 16:40:23 2018 -0400 + + [ft] Make TSan happy + + src/hb-ft.cc | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit ec743fce2a72a1cb76ac9401747a442a03a051d9 +Author: Behdad Esfahbod +Date: Wed Sep 26 16:37:18 2018 -0400 + + Add more atomic intrinsics + + src/hb-atomic.hh | 21 ++++++++++++++++++--- + 1 file changed, 18 insertions(+), 3 deletions(-) + +commit d183b33c1dd42055a9432f4a756ea20856913201 +Author: Behdad Esfahbod +Date: Wed Sep 26 16:29:35 2018 -0400 + + Rename test + + test/api/Makefile.am | 2 +- + test/api/{test-subset-codepoints.c => test-collect-unicodes.c} | 0 + 2 files changed, 1 insertion(+), 1 deletion(-) + +commit c9c75fe3d9eb36f166d594ceb5889a1dc0b14fe6 +Author: Ebrahim Byagowi +Date: Thu Sep 27 00:08:06 2018 +0330 + + [ci] Compile freetype on tsan and put sanitizer flags on correct + places (#1188) + + .circleci/config.yml | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +commit 39da1914b4fd1c58d61cb29c78a0904ff6b905c6 +Author: Ebrahim Byagowi +Date: Wed Sep 26 23:32:45 2018 +0330 + + Test freetype funcs on test-multithread (#1187) + + test/api/Makefile.am | 6 ++++-- + test/api/test-multithread.c | 25 +++++++++++++++++-------- + 2 files changed, 21 insertions(+), 10 deletions(-) + +commit e88009a93f5d13ed31b6262f928761e9574dcef1 +Author: Ebrahim Byagowi +Date: Wed Sep 26 22:53:02 2018 +0330 + + Minor, remove the no longer needed comment on test-multithread + + test/api/test-multithread.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 90a0f9fa0c020c268ac3ba31c7f1337eed85f35e +Author: Behdad Esfahbod +Date: Wed Sep 26 15:03:07 2018 -0400 + + Make TSan happy with make_immutable() + + src/hb-blob.cc | 2 ++ + src/hb-face.cc | 2 ++ + src/hb-font.cc | 4 ++++ + src/hb-unicode.cc | 2 ++ + 4 files changed, 10 insertions(+) + +commit 34d5a2595331c568ae524057d031c9d5d2573978 +Author: Behdad Esfahbod +Date: Wed Sep 26 15:02:21 2018 -0400 + + Fix test-multithread and increase num_threads to 30 + + What were you thinking? ;) + + test/api/test-multithread.c | 56 + +++++++++++++++++++++------------------------ + 1 file changed, 26 insertions(+), 30 deletions(-) + +commit 8bb73dad7f3279e1f1362cf9a137504e8ef08985 +Author: Ebrahim Byagowi +Date: Wed Sep 26 20:50:51 2018 +0330 + + Add a multithreaded test (#1184) + + test/api/Makefile.am | 6 ++ + test/api/test-multithread.c | 146 + ++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 152 insertions(+) + +commit 04caf11608d2db13eb6ed2ecc3d406e284b4c13c +Author: Behdad Esfahbod +Date: Wed Sep 26 12:13:47 2018 -0400 + + [hb-view] Change subpixel bits from 8 to 6 + + To match FreeType units, such that FreeType gets correct size from us. + This matters more now that we allow setting --ft-load-flags. + + util/hb-view.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 824111d4842b9a7bbbdcd147325f8f372ed3d37c +Author: Behdad Esfahbod +Date: Tue Sep 25 12:47:37 2018 -0400 + + Fix iOS build + + Fixes https://github.com/harfbuzz/harfbuzz/pull/1179 + + src/hb-coretext.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 4b4be7701f635f8378e7f868cfbe8d4571fc841f +Author: Ebrahim Byagowi +Date: Tue Sep 25 09:24:35 2018 +0330 + + [circle] Add an obsessive clang bot (#1178) + + .circleci/config.yml | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +commit 8282e881b51363811078bce53fad6aa5b41f7b41 +Author: Behdad Esfahbod +Date: Mon Sep 24 19:43:01 2018 -0400 + + Disable msan bot again + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1175 + + .circleci/config.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6c0e7eb6a6f3f888442c0a97ce6a771631990ed6 +Author: Behdad Esfahbod +Date: Mon Sep 24 19:07:23 2018 -0400 + + Minor + + src/hb-ot-map.hh | 1 + + src/hb-ot-shape-complex-indic.cc | 34 +++++++++++++++++----------------- + src/hb-ot-shape-complex-khmer.cc | 18 +++++++++--------- + 3 files changed, 27 insertions(+), 26 deletions(-) + +commit d748dc76644f28d4130f9cb1dee7a22cbe81c25d +Author: Behdad Esfahbod +Date: Mon Sep 24 18:30:50 2018 -0400 + + More iter inits + + src/hb-ot-layout-gsubgpos.hh | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit d9867497d09af929554eaa89cc6fee865b018646 +Author: Behdad Esfahbod +Date: Mon Sep 24 18:11:59 2018 -0400 + + Minor + + src/hb-ot-shape.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 70136a78cb9eda244767f8e8a3d30d0f3c569d01 +Author: Behdad Esfahbod +Date: Mon Sep 24 18:03:34 2018 -0400 + + Remove F_COMBINE + + Now I wonder if any bots will be unhappy we calling | in static + const initializations... + Or would that cost runtime init? Our tests don't detect any.. + + src/hb-ot-map.hh | 2 -- + src/hb-ot-shape-complex-arabic.cc | 2 +- + 2 files changed, 1 insertion(+), 3 deletions(-) + +commit f048ead84a4d3fe0bb712ed228c2f39c01ce9705 +Author: Behdad Esfahbod +Date: Mon Sep 24 18:01:53 2018 -0400 + + Some more + + src/hb-ot-map.cc | 5 +++-- + src/hb-ot-map.hh | 13 +++++++------ + src/hb-ot-shape-complex-arabic.cc | 18 +++++++++--------- + src/hb-ot-shape-complex-hangul.cc | 2 +- + src/hb-ot-shape-complex-indic.cc | 8 ++++---- + src/hb-ot-shape-complex-khmer.cc | 8 ++++---- + src/hb-ot-shape-complex-myanmar.cc | 10 +++++----- + src/hb-ot-shape-complex-tibetan.cc | 2 +- + src/hb-ot-shape-complex-use.cc | 20 ++++++++++---------- + src/hb-ot-shape.cc | 30 +++++++++++++++--------------- + 10 files changed, 59 insertions(+), 57 deletions(-) + +commit 1676f608c8e4f880789252ca448bb008f6dd51b4 +Author: Behdad Esfahbod +Date: Mon Sep 24 17:55:03 2018 -0400 + + Minor refactoring + + src/hb-ot-map.hh | 15 ++++++++++- + src/hb-ot-shape-complex-hangul.cc | 2 +- + src/hb-ot-shape-complex-indic.cc | 52 + +++++++++++++++----------------------- + src/hb-ot-shape-complex-khmer.cc | 38 ++++++++++------------------ + src/hb-ot-shape-complex-myanmar.cc | 2 +- + 5 files changed, 51 insertions(+), 58 deletions(-) + +commit 10203339600e85d6aaffba6034ac250e72fdfc12 +Author: Ebrahim Byagowi +Date: Tue Sep 25 01:00:32 2018 +0330 + + [circleci] Update sanitizer bots with newer clang and Ubuntu version + (#1176) + + .circleci/config.yml | 48 + ++++++++++++++++++++++++++++++++---------------- + 1 file changed, 32 insertions(+), 16 deletions(-) + +commit 12b8baa7653741ba13a89cd40f1f36b8bac11666 +Author: Behdad Esfahbod +Date: Mon Sep 24 17:22:39 2018 -0400 + + [msan] Enable again to get a build log, and try to play with + suppressions + + .circleci/config.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit aec0d3cbc923a8801c5bd9e9ae05801a31a7260c +Author: Behdad Esfahbod +Date: Mon Sep 24 13:12:15 2018 -0400 + + [ubsan] Re-enable now that it passes locally + + .circleci/config.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 4839807340cc73d5ba826dff4b4ba358775a213d +Author: Behdad Esfahbod +Date: Mon Sep 24 13:11:34 2018 -0400 + + [check-static-inits.sh] Allow some if ubsan is in effect + + src/check-static-inits.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit e45ba31dc723988150ef766758fa89fecd50ca03 +Author: Behdad Esfahbod +Date: Mon Sep 24 13:04:48 2018 -0400 + + [check-symbols.sh] Allow weak objects "V" + + ubsan generates these. + + src/check-symbols.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d07f3111b4bc38798e16a2459b80a16d7a9f9ff1 +Author: Behdad Esfahbod +Date: Mon Sep 24 13:01:35 2018 -0400 + + Link API test programs with C++ linker + + Needed to make ubsan work. + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1174 + + test/api/Makefile.am | 2 ++ + 1 file changed, 2 insertions(+) + +commit a96508cfc9bd9013d24b18547fcd9c03e08fe2f2 +Author: Behdad Esfahbod +Date: Mon Sep 24 12:52:42 2018 -0400 + + [msan] Add MSAN_OPTIONS=exitcode=42 + + Default exit value is 77, which causes autotools to "skip" test. + + .circleci/config.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 45f5aa97905996e3486c6dbba8493b11cfa0cf15 +Author: Behdad Esfahbod +Date: Mon Sep 24 12:43:29 2018 -0400 + + [circleci] Disable msan and ubsan builds + + https://github.com/harfbuzz/harfbuzz/issues/1174 + https://github.com/harfbuzz/harfbuzz/issues/1175 + + .circleci/config.yml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 2d93148a0f915bb52433ecc9d66845191a2f9135 +Author: Behdad Esfahbod +Date: Mon Sep 24 11:52:22 2018 -0400 + + Ignore weak symbols in check-symbols.sh + + Some clang versions leave a std::round(float) weak symbol around... + + src/check-symbols.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 55bae6825ed2058255a512a73293e3cdff0e78a4 +Author: Behdad Esfahbod +Date: Mon Sep 24 10:43:06 2018 -0400 + + [docs] A few improvements + + If we wrote just this much every day... + + src/hb-buffer.cc | 4 ++++ + src/hb-buffer.h | 20 +++++++++++++++----- + src/hb-face.cc | 11 +++++++---- + src/hb-font.cc | 12 +++++++----- + 4 files changed, 33 insertions(+), 14 deletions(-) + +commit 57fa2c23de8b6b66894d6872d192ac90ec8bf05a +Author: Behdad Esfahbod +Date: Mon Sep 24 09:57:52 2018 -0400 + + Readjust Hebrew composition again + + src/hb-ot-shape-complex-hebrew.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 7f335390f3a498119319a0e6c3ce7656a3902066 +Author: Behdad Esfahbod +Date: Mon Sep 24 09:56:18 2018 -0400 + + Revert change that would decompose text if GPOS mark feature is + available + + https://github.com/harfbuzz/harfbuzz/issues/653#issuecomment-423905920 + + src/hb-ot-shape-normalize.cc | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit a6f4b2f7cd088aeb44e1aac672434641f4f9e484 +Author: Behdad Esfahbod +Date: Mon Sep 24 09:54:37 2018 -0400 + + Fix normalization + + https://github.com/harfbuzz/harfbuzz/commit/62d1e0852a5549a1b510ad46a4b89f12730bb708#commitcomment-30613091 + + src/hb-ot-shape-normalize.cc | 1 - + 1 file changed, 1 deletion(-) + +commit 3583fb03b14a10ec5ab5f9c480e150934101fd0b +Author: Behdad Esfahbod +Date: Sun Sep 23 22:33:38 2018 -0400 + + Simplify ZWJ-skipping a bit + + Towards disabling ZWJ-skipping in certain GPOS contexts. + + Part of https://github.com/flutter/flutter/issues/16886 + + src/hb-ot-layout-gsubgpos.hh | 6 +++--- + src/hb-ot-shape-complex-indic.cc | 21 ++++++++++++++++----- + src/hb-ot-shape-complex-khmer.cc | 21 ++++++++++++++------- + src/hb-ot-shape-complex-myanmar.cc | 15 ++++++++++++++- + src/hb-ot-shape-complex-use.cc | 15 +++++++++++++-- + 5 files changed, 60 insertions(+), 18 deletions(-) + +commit 9516cbd3df7ccdb40b27a7ba99a1e0da8a6b170c +Author: Behdad Esfahbod +Date: Sun Sep 23 22:00:34 2018 -0400 + + Reinit skippy iters when auto_zwj / auto_zwnj change + + Ouch. How did we not hit this bug before... + + src/hb-ot-layout-gsubgpos.hh | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +commit 62d1e0852a5549a1b510ad46a4b89f12730bb708 +Author: Behdad Esfahbod +Date: Sun Sep 23 21:32:18 2018 -0400 + + Prefer decomposed form if font has GPOS mark feature + + Fixes https://github.com/harfbuzz/harfbuzz/issues/653 + + src/hb-ot-shape-complex-hebrew.cc | 2 +- + src/hb-ot-shape-normalize.cc | 126 + ++++++++++++++++++++------------------ + src/hb-ot-shape-normalize.hh | 7 ++- + 3 files changed, 72 insertions(+), 63 deletions(-) + +commit d7f21777e6a797758ab234555f5f7e07c87278f9 +Author: Behdad Esfahbod +Date: Sun Sep 23 19:12:52 2018 -0400 + + [ot-font] Fix leak + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1171 + + I'm glad we have leak-detector bots now. + + src/hb-ot-post-table.hh | 1 + + 1 file changed, 1 insertion(+) + +commit ae39a53f55e6b812defb4c7b48562651c9eb13a3 +Author: Ebrahim Byagowi +Date: Sat Sep 22 14:22:17 2018 +0330 + + Add bots with address- and thread-sanitizer + + .circleci/config.yml | 52 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 52 insertions(+) + +commit 24dd6c1a9d8d571c30dce4d39c1975b1d1cedc2a +Author: Matt Oliver +Date: Sun Sep 23 18:08:30 2018 +1000 + + src/hb-blob.cc: Fix mmap functionality with UWP. + + src/hb-blob.cc | 27 +++++++++++++++++++++++++++ + src/hb.hh | 4 +++- + 2 files changed, 30 insertions(+), 1 deletion(-) + +commit b7f1bbc2f8b14a402fa9e42e88919dc0173373ce +Author: Khaled Hosny +Date: Sat Sep 22 16:41:56 2018 +0200 + + [test] Fix printing subprocess error messages + + Decode the string as Python 3 returns bytes string, and also don’t + assume that it ends with a new line. + + test/shaping/run-tests.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 403019482b0d7f17fbdb5def2be5f43e28bafcf3 +Author: Ebrahim Byagowi +Date: Sat Sep 22 17:24:03 2018 +0330 + + Fix test-subset-* leak issues + + See also https://github.com/harfbuzz/harfbuzz/pull/1169 + + test/api/hb-subset-test.h | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +commit f6ebe1f4dc95a7c4b3a0af23086873a11867c1d9 +Author: Ebrahim Byagowi +Date: Sat Sep 22 17:05:52 2018 +0330 + + Fix test-ot-math leak issue + + See also https://github.com/harfbuzz/harfbuzz/pull/1169 + + test/api/test-ot-math.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 669ac81ac52e9d559324db851a9ee46ef651e7b0 +Author: Ebrahim Byagowi +Date: Sat Sep 22 16:49:23 2018 +0330 + + Fix test-set leak issue + + See also https://github.com/harfbuzz/harfbuzz/pull/1169 + + test/api/test-set.c | 1 + + 1 file changed, 1 insertion(+) + +commit ef9307fd2227bf0f750d8f7fafae466affc81454 +Author: Ebrahim Byagowi +Date: Sat Sep 22 16:45:31 2018 +0330 + + Fix test-font leak issue + + See also https://github.com/harfbuzz/harfbuzz/pull/1169 + + test/api/test-font.c | 1 + + 1 file changed, 1 insertion(+) + +commit 5fd8bce945e7efaa48d0c29eb8b2700027bd3c0b +Author: Behdad Esfahbod +Date: Wed Sep 19 22:34:09 2018 -0400 + + [morx] Fix mark_set check + + src/hb-aat-layout-morx-table.hh | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit 0739b28169eb63332b31420deb5bf58b5446f154 +Author: Behdad Esfahbod +Date: Wed Sep 19 17:32:21 2018 -0400 + + [aat] Minor + + src/hb-aat-layout-common.hh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 7671cb9b04770d50b1b2a05a24f6fadc35993cd1 +Author: Behdad Esfahbod +Date: Wed Sep 19 17:10:26 2018 -0400 + + [coretext] Minor + + src/hb-coretext.cc | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +commit dc8ed45292ce4e522c3bda03fd83873da7b6591e +Author: Behdad Esfahbod +Date: Wed Sep 19 16:46:41 2018 -0400 + + [morx] Implement forward/backward processing + + We reverse too many times. Can be optimized. But I doubt many fonts + use reverse lookups, so doesn't matter. + + Other than not applying user features, this completes morx table + implementation. + + src/hb-aat-layout-morx-table.hh | 40 + ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 40 insertions(+) + +commit 3bccd62196b5dff70d446c3fe053b1b47bb9c19e +Author: Behdad Esfahbod +Date: Wed Sep 19 16:24:34 2018 -0400 + + [morx] Implement horiz-only/vert-only subtables + + src/hb-aat-layout-morx-table.hh | 24 +++++++++++++++++++++++- + 1 file changed, 23 insertions(+), 1 deletion(-) + +commit 041a08de3d0ca74d3e2fdccfa5311ff26a8b97e4 +Author: Behdad Esfahbod +Date: Wed Sep 19 16:02:56 2018 -0400 + + [morx] Improve buffer position in Insertion w DontAdvance and wo + + Just speculation. Needs tests to determine which is correct behavior. + + src/hb-aat-layout-morx-table.hh | 23 ++++++++++++++++++----- + 1 file changed, 18 insertions(+), 5 deletions(-) + +commit 388ab91642734e1ba0d7a4a4f29a17b15f1b249d +Author: Behdad Esfahbod +Date: Mon Sep 17 19:29:34 2018 +0200 + + [morx] Implement InsertionChain + + src/hb-aat-layout-morx-table.hh | 87 + ++++++++++++++++------------------------- + 1 file changed, 33 insertions(+), 54 deletions(-) + +commit d8d1e7df0057c79f54d855b7bfec2d21f59b09e8 +Author: David Corbett +Date: Mon Sep 17 11:09:51 2018 -0400 + + Don't enforce a native direction for Old Hungarian + + src/hb-common.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6a97d0f3d377a35ea691d15ac142ce043f953e71 +Author: Simon Hausmann +Date: Mon Sep 17 10:33:34 2018 +0200 + + Fix installation of cmake config when building with cmake (#1161) + + When building with the auto tools, the manually mantained + harfbuzz-config.cmake is installed. When building with cmake, we + can use + cmake to generate the correct config files for us and install them. + + CMakeLists.txt | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 606bf57430370810f7bb62ba12b9685d8943685d +Author: Behdad Esfahbod +Date: Sun Sep 16 19:33:48 2018 +0200 + + Revert forcing use of single-parameter static_assert() + + Some clang versions define static_assert as a macro apparently, + so we cannot + redefine it... + + This reverts commit 94bfea0ce6a7b4d5641c198d50751748a353df11. + This reverts commit 4e62627831e7457ed60ff87712570065b14b200a. + + src/hb-atomic.hh | 4 ++-- + src/hb-buffer.cc | 2 +- + src/hb-buffer.hh | 4 ++-- + src/hb-cache.hh | 4 ++-- + src/hb-coretext.cc | 2 +- + src/hb-debug.hh | 2 +- + src/hb-dsalgs.hh | 4 ++-- + src/hb-machinery.hh | 4 ++-- + src/hb-null.hh | 8 +++---- + src/hb-open-type.hh | 4 ++-- + src/hb-ot-layout-common.hh | 2 +- + src/hb-ot-layout-gdef-table.hh | 6 +++--- + src/hb-ot-layout.cc | 14 ++++++------ + src/hb-ot-map.cc | 2 +- + src/hb-ot-math-table.hh | 2 +- + src/hb-ot-shape-complex-arabic-fallback.hh | 2 +- + src/hb-ot-shape-complex-indic.hh | 2 +- + src/hb-ot-shape-complex-use.cc | 2 +- + src/hb-set-digest.hh | 4 ++-- + src/hb-set.hh | 6 +++--- + src/hb-uniscribe.cc | 2 +- + src/hb.hh | 34 + +++++++++++++----------------- + util/options.cc | 3 ++- + 23 files changed, 58 insertions(+), 61 deletions(-) + +commit cbcaba6ffdf6b147d45baa95d62fd29cec67ed54 +Author: Behdad Esfahbod +Date: Sun Sep 16 19:25:19 2018 +0200 + + One more bot fix + + src/hb-unicode.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 94bfea0ce6a7b4d5641c198d50751748a353df11 +Author: Behdad Esfahbod +Date: Sun Sep 16 19:12:19 2018 +0200 + + Fix build, another try + + util/options.cc | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 89dd4b959773d35981299551074ccc7a1eb332bd +Author: Behdad Esfahbod +Date: Sun Sep 16 18:11:46 2018 +0200 + + Fix bots + + "Unused private member" warning turned error. ugh. + + src/hb-aat-layout-morx-table.hh | 2 ++ + 1 file changed, 2 insertions(+) + +commit 4e62627831e7457ed60ff87712570065b14b200a +Author: Behdad Esfahbod +Date: Sun Sep 16 18:09:36 2018 +0200 + + Enforce single-param static_assert() only + + So we don't accidentally break it again. + + src/hb-atomic.hh | 4 ++-- + src/hb-buffer.cc | 2 +- + src/hb-buffer.hh | 4 ++-- + src/hb-cache.hh | 4 ++-- + src/hb-coretext.cc | 2 +- + src/hb-debug.hh | 2 +- + src/hb-dsalgs.hh | 4 ++-- + src/hb-machinery.hh | 4 ++-- + src/hb-null.hh | 8 +++---- + src/hb-open-type.hh | 4 ++-- + src/hb-ot-layout-common.hh | 2 +- + src/hb-ot-layout-gdef-table.hh | 6 +++--- + src/hb-ot-layout.cc | 14 ++++++------ + src/hb-ot-map.cc | 2 +- + src/hb-ot-math-table.hh | 2 +- + src/hb-ot-shape-complex-arabic-fallback.hh | 2 +- + src/hb-ot-shape-complex-indic.hh | 2 +- + src/hb-ot-shape-complex-use.cc | 2 +- + src/hb-set-digest.hh | 4 ++-- + src/hb-set.hh | 6 +++--- + src/hb-uniscribe.cc | 2 +- + src/hb.hh | 34 + +++++++++++++++++------------- + 22 files changed, 60 insertions(+), 56 deletions(-) + +commit f1a86e1e6f3906f33fc89de694a4bbbc3e40d2bc +Author: Behdad Esfahbod +Date: Sun Sep 16 18:01:32 2018 +0200 + + Remove unused try + + src/hb-null.hh | 13 ------------- + 1 file changed, 13 deletions(-) + +commit ebd50b3c83a22a0fdba53271275b8619a23739aa +Author: Behdad Esfahbod +Date: Sun Sep 16 17:57:12 2018 +0200 + + Fix static_assert + + src/hb-open-type.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 10642b3fbfbc1776e784b190c43a9e0693dd423a +Author: Behdad Esfahbod +Date: Sat Sep 15 19:43:33 2018 +0200 + + Disallow null-enabled offsets to unsized structures... + + ...like UnsizedArrayOf<>. + + This fixes a class of crasher bugs, mostly with color and AAT tables. + We + cannot use nullable offsets to varsized data that does not declare + min_size, + because it's nost safe to use our fixed-size null pool for types + that have + their size external. So, use non_null'able offsets for these. + + A further enhancement would be to make use of min_size in Null<> + itself. + Will try that after. + + src/hb-aat-layout-common.hh | 8 ++++---- + src/hb-aat-layout-feat-table.hh | 2 +- + src/hb-aat-layout-morx-table.hh | 10 +++++----- + src/hb-aat-layout-trak-table.hh | 4 ++-- + src/hb-aat-ltag-table.hh | 2 +- + src/hb-open-type.hh | 5 +++++ + src/hb-ot-color-cbdt-table.hh | 4 +--- + src/hb-ot-color-colr-table.hh | 4 ++-- + src/hb-ot-color-cpal-table.hh | 8 ++++---- + src/hb-ot-color-svg-table.hh | 2 +- + src/hb-ot-layout-common.hh | 18 ++++++++++-------- + src/hb-ot-layout-jstf-table.hh | 4 ++-- + 12 files changed, 38 insertions(+), 33 deletions(-) + +commit 9ff76c6025b55d184c96b193f23aa935ab32f1fc +Author: Behdad Esfahbod +Date: Sat Sep 15 18:31:14 2018 +0200 + + [morx] Respect default feature settings + + Does NOT apply user-selected features. But at least now enables + correct subtables. + + src/hb-aat-layout-morx-table.hh | 34 +++++++++++++++++++++++----------- + 1 file changed, 23 insertions(+), 11 deletions(-) + +commit 2f97da6e2d6629e112789d399765d90f96952c0a +Author: Behdad Esfahbod +Date: Sat Sep 15 14:51:50 2018 +0200 + + [aat] Change version field + + src/hb-aat-layout-morx-table.hh | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +commit 29c2bd1795b933a611512af50a14f25e25d43159 +Author: Behdad Esfahbod +Date: Sat Sep 15 14:47:18 2018 +0200 + + [morx] Add stub for InsertionChain + + src/hb-aat-layout-morx-table.hh | 209 + ++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 200 insertions(+), 9 deletions(-) + +commit f8ccb545c47abe8f0f4ed318ff7b5bf176913893 +Author: Behdad Esfahbod +Date: Fri Sep 14 18:59:53 2018 +0200 + + [dfont] Disable null-processsing for offsets + + An offset to unsized arrayis not safe to be redirected to our + fixed-sized + null pool. Plus, we want to reject, not repair, bad-looking dfonts. + + src/hb-open-file.hh | 8 ++++---- + src/hb-open-type.hh | 2 +- + 2 files changed, 5 insertions(+), 5 deletions(-) + +commit 01b9148d9ae7d18228538774243e49840cfd2499 +Author: Behdad Esfahbod +Date: Fri Sep 14 14:23:09 2018 +0200 + + [unicode] Move Fitzpatrick hack from ot-layout into unicode.hh + + src/hb-ot-layout.hh | 12 +----------- + src/hb-unicode.hh | 36 +++++++++++++++++++++++++++--------- + 2 files changed, 28 insertions(+), 20 deletions(-) + +commit 6ebbf514ac90712fe089b2b64f68d1cf681edd5d +Author: Behdad Esfahbod +Date: Fri Sep 14 12:15:53 2018 +0200 + + Minor + + src/hb-ot-layout.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 957dbed388fc3214248f6aca65902ad277d070fb +Author: Behdad Esfahbod +Date: Fri Sep 14 12:14:42 2018 +0200 + + Fix builds + + src/hb-aat-layout-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 4653e6cf3c1ef5005886d901df30e952d57eed6c +Author: Behdad Esfahbod +Date: Fri Sep 14 11:31:33 2018 +0200 + + [aat] Add enums for pre-defined state and classes + + Not sure how I didn't add before... + + src/hb-aat-layout-common.hh | 19 ++++++++++++++++--- + 1 file changed, 16 insertions(+), 3 deletions(-) + +commit 67449c39331babb88f7d29d737895d786cd5da33 +Author: Behdad Esfahbod +Date: Fri Sep 14 10:58:00 2018 +0200 + + Don't dereference offset before check_struct() + + src/hb-open-file.hh | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit ca746f261e1e54cec2f9c8bc7a6f930491e19418 +Author: Behdad Esfahbod +Date: Thu Sep 13 20:35:21 2018 +0200 + + [dfont] Also check dataLen range in sanitize + + Just to disagree with myself re being done with this code... + + src/hb-open-file.hh | 1 + + 1 file changed, 1 insertion(+) + +commit 3789c557ca06aef430726f4942cafecac6fe4eef +Author: Behdad Esfahbod +Date: Thu Sep 13 20:30:04 2018 +0200 + + [dfont] Solve the mystery +2 offset thing! + + Previously, ResourceForkHeader was defined as 30 bytes, having the + typeCountM1 as last member. + There was a mysterious offset-by-2 in the code, derived from FontTools + and JDK code this was + ported from. + + In testing, I observed that typeListZ offset is actually 28. + Suggesting that the typeCountM1 + does NOT actually belong to ResourceForkHeader, but belongs to the + array itself. Adjusting for + that resolves the mystery +2 offset hack, so everything is clean + and good now. + + This, concludes my dfont hacking. The code looks great now, and + I'm happy to leave it. + Fuzzers might disagree though, we will see! + + src/hb-open-file.hh | 30 ++++++++++++------------------ + src/hb-open-type.hh | 44 ++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 56 insertions(+), 18 deletions(-) + +commit effc7ced72a6ce0fea328a8b68dc3d55f09774f1 +Author: Behdad Esfahbod +Date: Thu Sep 13 20:21:54 2018 +0200 + + Rename HeadlessArrayOf::len to lenP1 + + So it doesn't accidentally match our templates, etc. + + src/hb-open-type.hh | 14 +++++++------- + src/hb-ot-layout-gsub-table.hh | 10 +++++----- + src/hb-ot-layout-gsubgpos.hh | 10 +++++----- + 3 files changed, 17 insertions(+), 17 deletions(-) + +commit 180a88a96ce327e4103df3635c73559de65d1546 +Author: Behdad Esfahbod +Date: Thu Sep 13 19:19:57 2018 +0200 + + [dfont] Some more + + src/hb-open-file.hh | 21 ++++++++------------- + 1 file changed, 8 insertions(+), 13 deletions(-) + +commit 0ab0f1e5ac5ccb07c57364e9f5be0b991398eb6f +Author: Behdad Esfahbod +Date: Thu Sep 13 19:13:01 2018 +0200 + + [dfont] Push methods further down + + src/hb-open-file.hh | 58 + ++++++++++++++++++++++++++++++----------------------- + 1 file changed, 33 insertions(+), 25 deletions(-) + +commit 8c9bdcc1feeab321a642bdaac50b716e48ce4263 +Author: Behdad Esfahbod +Date: Thu Sep 13 19:08:22 2018 +0200 + + [dfont] Minor + + src/hb-open-file.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 4479d3a2eda57d278700f5c78414ef6ef617d2a9 +Author: Behdad Esfahbod +Date: Thu Sep 13 19:05:59 2018 +0200 + + [dfon]t Sanitize OpenTypeFontFace + + src/hb-dsalgs.hh | 6 ------ + src/hb-open-file.hh | 21 +++++++++------------ + 2 files changed, 9 insertions(+), 18 deletions(-) + +commit 3fba41906fba28c5ea01cc0749654de862453bf4 +Author: Behdad Esfahbod +Date: Thu Sep 13 18:49:16 2018 +0200 + + [dfont] Minor + + src/hb-open-file.hh | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +commit bf852f0e62a8bdbb809af6a975f8ae8eed708d70 +Author: Behdad Esfahbod +Date: Thu Sep 13 18:47:53 2018 +0200 + + [dfont] Make test pass + + Offset 0 is not null in this context. + + src/hb-open-file.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 29faebe911a13916aa3d737e93d38deedc53567f +Author: Behdad Esfahbod +Date: Thu Sep 13 18:45:35 2018 +0200 + + Allow Offset<>'s that have no 0==null + + src/hb-open-type.hh | 43 +++++++++++++++++++++---------------------- + 1 file changed, 21 insertions(+), 22 deletions(-) + +commit 82f4d776c21b7c1224dd7073ce69cdf76d85f16b +Author: Behdad Esfahbod +Date: Thu Sep 13 18:27:20 2018 +0200 + + [dfont] Minor + + src/hb-open-file.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 07e0ca930c29757217c2f9e4e0e6954657b6b82d +Author: Behdad Esfahbod +Date: Thu Sep 13 17:39:09 2018 +0200 + + [bytes] Rename content to arrayZ + + src/hb-dsalgs.hh | 16 ++++++++-------- + src/hb-ot-post-table.hh | 2 +- + 2 files changed, 9 insertions(+), 9 deletions(-) + +commit dbb764dceb61365b7360a48d581ba5a4b3526e98 +Author: Behdad Esfahbod +Date: Thu Sep 13 16:49:26 2018 +0200 + + [dfont] Clean up sanitize() + + I don't think I broke anything. Fuzzers will let me know.. + + src/hb-dsalgs.hh | 8 ++++ + src/hb-open-file.hh | 122 + ++++++++++++++++++++++++---------------------------- + 2 files changed, 64 insertions(+), 66 deletions(-) + +commit 361fc2686152ad8c0ebaf19e0522e0fc58ba3953 +Author: Behdad Esfahbod +Date: Thu Sep 13 16:47:33 2018 +0200 + + Fix OffsetTo::sanitize() after reshuffling + + src/hb-open-type.hh | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +commit 4c6b0fb5f6668a6e562260d16f629ad3c41e8961 +Author: Behdad Esfahbod +Date: Thu Sep 13 16:39:30 2018 +0200 + + OffsetTo::sanitize() Add version with three user_data + + src/hb-open-type.hh | 18 +++++++++++++----- + 1 file changed, 13 insertions(+), 5 deletions(-) + +commit a73bea69c599787b4cfeac92a3afd00749e00434 +Author: Behdad Esfahbod +Date: Thu Sep 13 16:31:31 2018 +0200 + + OffsetTo::sanitize() more shuffling + + src/hb-open-type.hh | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +commit b482e5231cd5987082dd2c05fd649c3653f3c67a +Author: Behdad Esfahbod +Date: Thu Sep 13 16:29:49 2018 +0200 + + OffsetTo::sanitize() reshuffling + + src/hb-open-type.hh | 26 +++++++++++++++++++------- + 1 file changed, 19 insertions(+), 7 deletions(-) + +commit bd75fd45cdbd0edb24568326bb7fde59d299a82c +Author: Behdad Esfahbod +Date: Tue Sep 11 18:12:26 2018 +0200 + + [dfont] Some renaming, plus add link to reference doc + + src/hb-open-file.hh | 79 + ++++++++++++++++++++++++----------------------------- + 1 file changed, 35 insertions(+), 44 deletions(-) + +commit 4134ec1307bbaff24972e238bc5e4a403cd3f1c1 +Author: Behdad Esfahbod +Date: Tue Sep 11 17:56:03 2018 +0200 + + [dfont] Sanitize only sfnt resources as OpenTypeFontFile + + src/hb-open-file.hh | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +commit 6b5e4d07adb6b739dc294da513c4a7acd03977f7 +Author: Behdad Esfahbod +Date: Tue Sep 11 17:26:24 2018 +0200 + + [dfont] Minor + + src/hb-open-file.hh | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +commit d5c509272f2fbd1b4c56e3b530da7e42e7f03901 +Author: Behdad Esfahbod +Date: Tue Sep 11 17:18:21 2018 +0200 + + [dfont] Fix test expecatation and minor touch up + + I have no way to authoritatively know, but looks like test font only + has one + face. So, adjust test expectation instead. + + src/hb-open-file.hh | 18 + ++++++------------ + test/shaping/data/in-house/tests/collections.tests | 2 +- + 2 files changed, 7 insertions(+), 13 deletions(-) + +commit 2b2ed1e536061cfd3a0f29522118f42b451678bd +Author: Ebrahim Byagowi +Date: Mon Jul 2 17:26:43 2018 +0430 + + [dfont] Add test + + test/shaping/data/in-house/Makefile.sources | 1 + + test/shaping/data/in-house/fonts/TestDFONT.dfont | Bin 0 -> 3505 bytes + test/shaping/data/in-house/fonts/TestTTC.ttc | Bin 0 -> 2608 bytes + test/shaping/data/in-house/tests/collections.tests | 6 ++++++ + 4 files changed, 7 insertions(+) + +commit 9479ffefbfa3ea4ee39747e34177d26ab1ebbec9 +Author: Behdad Esfahbod +Date: Tue Sep 11 16:41:26 2018 +0200 + + [dfont] Re-enable and fix offset handling + + Fixes https://github.com/harfbuzz/harfbuzz/pull/1085 + + src/hb-face.cc | 5 +++-- + src/hb-open-file.hh | 19 +++++++++++++------ + 2 files changed, 16 insertions(+), 8 deletions(-) + +commit a1814e2bec3a43b9eeb4d50a67daae3fc52fd0a5 +Author: Behdad Esfahbod +Date: Tue Sep 11 14:45:23 2018 +0200 + + Whitespace + + src/hb-open-file.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 383060cc3354e12611dec3082a6fe08fdb25f652 +Author: Behdad Esfahbod +Date: Tue Sep 11 14:41:19 2018 +0200 + + [ft] Invalidate advance cache if font size changed + + src/hb-ft.cc | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit 54998befc43ef38e47b74b3153380adbcf6279d4 +Author: Behdad Esfahbod +Date: Tue Sep 11 14:35:26 2018 +0200 + + [ft] Cache advances + + I decided to always use the cache, instead of my previous sketch + direction + that was to only allocate and use cache if fast advances are not + available. + The cache is a mere 1kb, so just use it... + + TODO: Invalidate cache on font size change. + + Fixes https://github.com/harfbuzz/harfbuzz/issues/651 + Fixes https://github.com/harfbuzz/harfbuzz/pull/1082 + + src/hb-cache.hh | 2 +- + src/hb-ft.cc | 37 +++++++++++++++++-------------------- + 2 files changed, 18 insertions(+), 21 deletions(-) + +commit f90bab8560816b60b4b3f2379b36c08756b21e6c +Author: Behdad Esfahbod +Date: Tue Sep 11 14:21:15 2018 +0200 + + [util] Add --ft-load-flags + + Useful for performance testing. + + Not hooked to cairo yet. Just changes shaping, not rasterization. + + util/helper-cairo.cc | 2 +- + util/options.cc | 4 ++++ + util/options.hh | 2 ++ + 3 files changed, 7 insertions(+), 1 deletion(-) + +commit 93f7596254808d567b9e1e01fb4855efcd34677c +Author: Behdad Esfahbod +Date: Tue Sep 11 14:11:10 2018 +0200 + + [util] Add -n shorthand for --num-iterations + + Meh. + + util/options.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 047a84c5dd76cdfc072de25c572e30866f87a1f7 +Author: Behdad Esfahbod +Date: Tue Sep 11 14:05:16 2018 +0200 + + [ft] Towards caching slow get_h_advance results + + Related to https://github.com/harfbuzz/harfbuzz/pull/1082 + + src/hb-ft.cc | 24 ++++++++++++++++++++---- + 1 file changed, 20 insertions(+), 4 deletions(-) + +commit 237f21537842e6b471cdd6c86b98edfc0da0756c +Author: Behdad Esfahbod +Date: Tue Sep 11 13:05:47 2018 +0200 + + [ft] Add advances() callback + + src/hb-ft.cc | 27 +++++++++++++++++++++++++++ + 1 file changed, 27 insertions(+) + +commit cbea7d49ab8d4765a2d72dcbf608d326bdf9af3d +Author: Behdad Esfahbod +Date: Tue Sep 11 12:56:17 2018 +0200 + + [ot-font] Rename + + src/hb-ot-font.cc | 74 + +++++++++++++++++++++++++++---------------------------- + 1 file changed, 37 insertions(+), 37 deletions(-) + +commit d8a67dac2a673138bb4d41cd7eab97c9ee987958 +Author: Behdad Esfahbod +Date: Tue Sep 11 12:55:54 2018 +0200 + + [ot-font] Add advances() callbacks + + src/hb-ot-font.cc | 43 ++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 42 insertions(+), 1 deletion(-) + +commit 0ea42e117ba2c76e118974fe114ae5d9ceef5743 +Author: Behdad Esfahbod +Date: Tue Sep 11 12:22:42 2018 +0200 + + [cache] Minor + + src/hb-cache.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 0f520adaacca3c7b6d8e84a7722343184105f612 +Author: Behdad Esfahbod +Date: Tue Sep 11 12:02:34 2018 +0200 + + Revert "Remove unused hb_cache_t" + + This reverts commit 473b17af4d421f4ce7ac18c769731bb2aa4088f8. + + Updates to recent changes. + + src/Makefile.sources | 1 + + src/hb-cache.hh | 75 + ++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/hb-ft.cc | 1 + + 3 files changed, 77 insertions(+) + +commit cfdea884754ed40ffa5cc00cb1ecaa86cb46a394 +Author: Behdad Esfahbod +Date: Tue Sep 11 10:57:48 2018 +0200 + + [random] Switch to 32bit RNG + + src/hb-ot-layout-gsubgpos.hh | 7 ++++--- + test/shaping/data/in-house/tests/rand.tests | 4 ++-- + 2 files changed, 6 insertions(+), 5 deletions(-) + +commit 08260c708ae6adc4efa9bde5e9ede01b7e4d42cc +Author: Behdad Esfahbod +Date: Tue Sep 11 10:51:19 2018 +0200 + + [random] Shuffle + + src/hb-ot-layout-gsub-table.hh | 5 +---- + src/hb-ot-layout-gsubgpos.hh | 6 ++++++ + 2 files changed, 7 insertions(+), 4 deletions(-) + +commit 71c9f84e7c0afe41a8987b8a4ebc2b45a22fac56 +Author: Behdad Esfahbod +Date: Mon Sep 10 22:37:19 2018 +0200 + + Make --features rand=1 available to the user + + Use rand=255 to mean "randomize". + + Part of https://github.com/harfbuzz/harfbuzz/pull/803 + + src/hb-ot-layout-gsub-table.hh | 11 ++++------- + src/hb-ot-layout-gsubgpos.hh | 1 + + src/hb-ot-map.cc | 4 ++-- + src/hb-ot-map.hh | 3 +++ + src/hb-ot-shape.cc | 2 +- + 5 files changed, 11 insertions(+), 10 deletions(-) + +commit cc1c4fdf88f6953dcd07fb42ee963404657cdef4 +Author: Behdad Esfahbod +Date: Mon Sep 10 16:36:05 2018 +0200 + + Respect user's wish if they set rand feature manually + + Except if the set it to 1, which would mean "randomize"... Ugly. + + src/hb-ot-layout-gsub-table.hh | 30 ++++++++++++++++-------------- + 1 file changed, 16 insertions(+), 14 deletions(-) + +commit 80de4bcd2677bfb0907ea7059524f918b109ac37 +Author: Behdad Esfahbod +Date: Mon Sep 10 16:24:52 2018 +0200 + + Minor clean up of 'rand' patchset + + src/hb-ot-layout-gsub-table.hh | 7 +++++-- + src/hb-ot-layout-gsubgpos.hh | 7 ++++--- + src/hb-ot-shape.cc | 13 ++++++------- + test/shaping/data/in-house/tests/rand.tests | 2 +- + 4 files changed, 16 insertions(+), 13 deletions(-) + +commit b545e27d8891f1e7f1fd034dd84abe44c839c380 +Author: David Corbett +Date: Fri Feb 23 12:22:32 2018 -0500 + + Don't seed the RNG from the contents of the buffer + + src/hb-ot-layout-gsubgpos.hh | 7 ++----- + src/hb-ot-layout.cc | 5 +---- + test/shaping/data/in-house/tests/rand.tests | 2 +- + 3 files changed, 4 insertions(+), 10 deletions(-) + +commit 2de96e846844d21888af6893378b21a33fc19232 +Author: David Corbett +Date: Sat Jan 27 19:48:38 2018 -0500 + + Test 'rand' + + test/shaping/data/in-house/Makefile.sources | 1 + + .../fonts/5bb74492f5e0ffa1fbb72e4c881be035120b6513.ttf | Bin 0 -> + 1352 bytes + test/shaping/data/in-house/tests/rand.tests | 3 +++ + 3 files changed, 4 insertions(+) + +commit f05df643b44d9bbfd742e93f02c235fc821190d0 +Author: David Corbett +Date: Fri Jan 26 21:36:15 2018 -0500 + + Allow requesting a specific glyph for 'rand' + + Randomization only happens by default. If the user specifies a + value for + 'rand', that value is respected. + + src/hb-ot-map.cc | 3 ++- + src/hb-ot-map.hh | 4 +++- + src/hb-ot-shape.cc | 7 ++++++- + 3 files changed, 11 insertions(+), 3 deletions(-) + +commit c2a75e07e54314f6c611dda0f050ed5f09909e43 +Author: David Corbett +Date: Thu Jan 25 14:22:03 2018 -0500 + + Implement 'rand' + + src/hb-ot-layout-gsub-table.hh | 19 ++++++++++++------- + src/hb-ot-layout-gsubgpos.hh | 8 ++++++++ + src/hb-ot-layout.cc | 8 ++++++++ + src/hb-ot-map.cc | 7 +++++-- + src/hb-ot-map.hh | 4 +++- + src/hb-ot-shape.cc | 1 + + 6 files changed, 37 insertions(+), 10 deletions(-) + +commit 96471fe8593575deceb44d3757c227f65f10a25e +Author: Behdad Esfahbod +Date: Tue Sep 11 01:39:23 2018 +0200 + + [uniscribe] Fix build + + src/hb-uniscribe.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit becd84aa2f2902ea9d2d1677b28945e103a68816 +Author: Behdad Esfahbod +Date: Tue Sep 11 01:26:18 2018 +0200 + + Add HB_FEATURE_GLOBAL_START/END + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1141 + + New API: + HB_FEATURE_GLOBAL_START + HB_FEATURE_GLOBAL_END + + docs/harfbuzz-sections.txt | 2 ++ + src/hb-common.cc | 4 ++-- + src/hb-common.h | 13 +++++++++++++ + 3 files changed, 17 insertions(+), 2 deletions(-) + +commit 13a8786c7c580651d8a6db9345b9aa85ca8ed956 +Author: Behdad Esfahbod +Date: Tue Sep 11 01:07:06 2018 +0200 + + Add (unused) hb_array_t<> + + src/hb-dsalgs.hh | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +commit bccf3e1827eec07433340eea705597201b6d0a32 +Author: Behdad Esfahbod +Date: Tue Sep 11 01:04:50 2018 +0200 + + Minor + + src/hb-open-type.hh | 1 - + 1 file changed, 1 deletion(-) + +commit dff2c45f1e2a30767f6813d3cb6a70978d98d424 +Author: Behdad Esfahbod +Date: Mon Sep 10 23:29:26 2018 +0200 + + Port rest from VAR to UnsizedArrayOf<> + + src/hb-aat-layout-common.hh | 14 +++++++------- + src/hb-aat-layout-morx-table.hh | 16 ++++++++-------- + src/hb-open-type.hh | 10 +++++----- + src/hb-ot-cmap-table.hh | 8 +++++--- + src/hb-ot-color-cbdt-table.hh | 16 ++++++++-------- + src/hb-ot-glyf-table.hh | 10 +++++----- + src/hb-ot-hdmx-table.hh | 30 +++++++++++++----------------- + src/hb-ot-hmtx-table.hh | 8 ++++---- + src/hb-ot-kern-table.hh | 20 ++++++++++---------- + src/hb-ot-layout-common.hh | 9 +++++---- + src/hb-ot-layout-gpos-table.hh | 26 +++++++++++++------------- + src/hb-ot-math-table.hh | 36 +++++++++++++++++++----------------- + src/hb-ot-maxp-table.hh | 2 +- + src/hb-ot-name-table.hh | 13 +++++++------ + src/hb-ot-post-table.hh | 5 +++-- + 15 files changed, 113 insertions(+), 110 deletions(-) + +commit 9507b05a7a65962d5d02eb424e4f5d8570976f4e +Author: Behdad Esfahbod +Date: Mon Sep 10 23:18:07 2018 +0200 + + Simplify sanitize->check_array() + + Fix a bug in CBDT sanitize, and redundant check in avar. + + src/hb-aat-layout-common.hh | 10 ++++------ + src/hb-aat-layout-morx-table.hh | 2 +- + src/hb-machinery.hh | 3 ++- + src/hb-open-type.hh | 6 +++--- + src/hb-ot-color-cbdt-table.hh | 4 ++-- + src/hb-ot-kern-table.hh | 2 +- + src/hb-ot-layout-common.hh | 2 +- + src/hb-ot-layout-gpos-table.hh | 8 ++++---- + src/hb-ot-layout-gsubgpos.hh | 4 ++-- + src/hb-ot-math-table.hh | 8 ++------ + src/hb-ot-name-table.hh | 2 +- + src/hb-ot-var-avar-table.hh | 4 ++-- + src/hb-ot-var-fvar-table.hh | 2 +- + src/hb-ot-var-hvar-table.hh | 2 +- + src/hb-ot-var-mvar-table.hh | 2 +- + 15 files changed, 28 insertions(+), 33 deletions(-) + +commit bc485a98122131efc4768fef9147823f2bce146b +Author: Behdad Esfahbod +Date: Mon Sep 10 23:02:24 2018 +0200 + + Port some VAR arrays to UnsizedArrayOf<> + + Fix avar sanitize(). + + src/hb-ot-layout-gsubgpos.hh | 59 + +++++++++++++++++++++++--------------------- + src/hb-ot-var-avar-table.hh | 10 +++++--- + src/hb-ot-var-fvar-table.hh | 7 +++--- + src/hb-ot-var-hvar-table.hh | 9 ++++--- + src/hb-ot-var-mvar-table.hh | 9 ++++--- + 5 files changed, 51 insertions(+), 43 deletions(-) + +commit 1bc7a8d6c4deb9fa6e010d7be08b68cad88579ae +Author: Behdad Esfahbod +Date: Mon Sep 10 22:51:26 2018 +0200 + + [indic] Cache hb_options().uniscribe_bug_compatible on indic_plan + + src/hb-ot-shape-complex-indic.cc | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +commit 24f1d9622489a016904314a5d4e3c637da2e1c77 +Author: Behdad Esfahbod +Date: Mon Sep 10 18:19:37 2018 +0200 + + Unbreak HB_OPTIONS + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1154 + + src/hb-debug.hh | 3 +++ + 1 file changed, 3 insertions(+) + +commit e46c51f1e985ac9c0ffa90fda4ea436d54b4009c +Author: Behdad Esfahbod +Date: Mon Sep 10 17:38:19 2018 +0200 + + [indic] Do NOT allow matra after Halant,ZWJ + + Fixes https://github.com/harfbuzz/harfbuzz/issues/556 + + Devanagari regresses 12 tests, and Gujarati 2. See: + + https://github.com/harfbuzz/harfbuzz/issues/556#issuecomment-419957472 + + New numbers: + + BENGALI: 353725 out of 354188 tests passed. 463 failed (0.130722%) + DEVANAGARI: 707299 out of 707394 tests passed. 95 failed (0.0134296%) + GUJARATI: 366353 out of 366457 tests passed. 104 failed (0.0283799%) + GURMUKHI: 60729 out of 60747 tests passed. 18 failed (0.0296311%) + KANNADA: 951300 out of 951913 tests passed. 613 failed (0.0643966%) + MALAYALAM: 1048136 out of 1048334 tests passed. 198 failed + (0.0188871%) + ORIYA: 42327 out of 42329 tests passed. 2 failed (0.00472489%) + SINHALA: 271596 out of 271847 tests passed. 251 failed (0.0923313%) + TAMIL: 1091754 out of 1091754 tests passed. 0 failed (0%) + TELUGU: 970555 out of 970573 tests passed. 18 failed (0.00185457%) + + src/hb-ot-shape-complex-indic-machine.hh | 1688 + ++++++++++++++---------------- + src/hb-ot-shape-complex-indic-machine.rl | 2 +- + 2 files changed, 784 insertions(+), 906 deletions(-) + +commit 5dfd6e07626a9022a995eb7fa16767eff66c6047 +Author: Behdad Esfahbod +Date: Mon Sep 10 15:45:32 2018 +0200 + + Fix sanitize or Context Rule + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1110 + + src/hb-ot-layout-gsubgpos.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 20a11a824d2a07a8544649477ad03e809bdd8e19 +Author: Behdad Esfahbod +Date: Mon Sep 10 13:56:28 2018 +0200 + + Revert "[subset] Disable GSUB/GPOS subsetting for now" + + This reverts commit 616fd34a69bb69bc35c7e4ea939e71c3ea2e92cb. + + src/hb-subset.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 54d332dd9b0263821376161cdffb60ffb3c7847f +Author: Behdad Esfahbod +Date: Mon Sep 10 11:37:24 2018 +0200 + + 1.9.0 + + NEWS | 19 +++++++++++++++++++ + configure.ac | 2 +- + src/hb-face.cc | 10 +++++----- + src/hb-unicode.h | 5 +++++ + src/hb-version.h | 6 +++--- + 5 files changed, 33 insertions(+), 9 deletions(-) + commit 616fd34a69bb69bc35c7e4ea939e71c3ea2e92cb Author: Behdad Esfahbod Date: Mon Sep 10 11:19:49 2018 +0200 diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/NEWS b/Build/source/libs/harfbuzz/harfbuzz-src/NEWS index c9af0f36853..58e21a592fc 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/NEWS +++ b/Build/source/libs/harfbuzz/harfbuzz-src/NEWS @@ -1,3 +1,71 @@ +Overview of changes leading to 2.0.0 +Wednesday, October 17, 2018 +==================================== +- Added AAT shaping support (morx/kerx/trak). + Automatically used if GSUB/GPOS are not available respectively. + Set HB_OPTIONS=aat env var to have morx/kerx preferred over + GSUB/GPOS. +- Apply TrueType kern table internally, instead of relying on + hb_font_t callbacks. +- Khmer shaper significantly rewritten to better match Uniscribe. +- Indic3 tags ('dev3', etc) are passed to USE shaper. +- .dfont Mac font containers implemented. +- Script- and language-mapping revamped to better use BCP 47. +- Misc USE and Indic fixes. +- Misc everything fixes. +- Too many things to list. Biggest release since 0.9.1, with + over 500 commits in just over 5 weeks! Didn't intend it to + be a big release. Just happened to become. +- hb-ft now locks underlying FT_Face during use. + +API changes: + +- Newly-created hb_font_t's now have our internal "hb-ot-font" + callbacks set on them, so they should work out of the box + without any callbacks set. If callbacks are set, everything + is back to what it was before, the fallback callbacks are + null. If you to get the internal implementation modified, + sub_font it. + +- New hb_font_funcs_set_nominal_glyphs_func() allows speeding + up character to glyph mapping. + +New API: ++HB_FEATURE_GLOBAL_START ++HB_FEATURE_GLOBAL_END ++hb_buffer_set_invisible_glyph() ++hb_buffer_get_invisible_glyph() ++hb_font_funcs_set_nominal_glyphs_func() ++hb_ot_layout_table_select_script() ++hb_ot_layout_script_select_language() ++hb_ot_layout_feature_get_name_ids() ++hb_ot_layout_feature_get_characters() ++hb_name_id_t ++HB_NAME_ID_INVALID ++HB_OT_MAX_TAGS_PER_SCRIPT ++hb_ot_tags_from_script_and_language() ++hb_ot_tags_to_script_and_language() + +Deprecated API: +-hb_font_funcs_set_glyph_func() +-hb_unicode_eastasian_width_func_t +-hb_unicode_funcs_set_eastasian_width_func() +-hb_unicode_eastasian_width() +-hb_unicode_decompose_compatibility_func_t +-HB_UNICODE_MAX_DECOMPOSITION_LEN +-hb_unicode_funcs_set_decompose_compatibility_func() +-hb_unicode_decompose_compatibility() +-hb_font_funcs_set_glyph_h_kerning_func() +-hb_font_funcs_set_glyph_v_kerning_func() +-hb_font_get_glyph_h_kerning() +-hb_font_get_glyph_v_kerning() +-hb_font_get_glyph_kerning_for_direction() +-hb_ot_layout_table_choose_script() +-hb_ot_layout_script_find_language() +-hb_ot_tags_from_script() +-hb_ot_tag_from_language() + + Overview of changes leading to 1.9.0 Monday, September 10, 2018 ==================================== diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/TODO b/Build/source/libs/harfbuzz/harfbuzz-src/TODO index 6dac0be5298..d2c5812a007 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/TODO +++ b/Build/source/libs/harfbuzz/harfbuzz-src/TODO @@ -1,9 +1,3 @@ -General fixes: -============= - -- Implement 'rand' feature. - - API issues: =========== @@ -19,12 +13,10 @@ API additions - Add hb-cairo glue -- Add sanitize API (and a cached version, that saves result on blob user-data) +- Add sanitize API. - BCP 47 language handling / API (language_matches?) -- Add hb_font_create_unscaled()? - - Add query / enumeration API for aalt-like features? - Add segmentation API diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/config.h.in b/Build/source/libs/harfbuzz/harfbuzz-src/config.h.in index c2d5c3ad4aa..029518d7c83 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/config.h.in +++ b/Build/source/libs/harfbuzz/harfbuzz-src/config.h.in @@ -85,9 +85,6 @@ /* Define to 1 if you have the `newlocale' function. */ #undef HAVE_NEWLOCALE -/* Have native OpenType Layout backend */ -#undef HAVE_OT - /* Define to 1 if you have the `posix_memalign' function. */ #undef HAVE_POSIX_MEMALIGN diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac b/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac index 1c698087132..a3ce8c1e8fb 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], - [1.9.0], + [2.0.0], [https://github.com/harfbuzz/harfbuzz/issues/new], [harfbuzz], [http://harfbuzz.org/]) @@ -12,6 +12,7 @@ AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE([1.13.0 gnits tar-ustar dist-bzip2 no-dist-gzip -Wall no-define color-tests -Wno-portability]) AM_SILENT_RULES([yes]) AX_CODE_COVERAGE +AC_USE_SYSTEM_EXTENSIONS # Initialize libtool m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) @@ -19,7 +20,6 @@ LT_PREREQ([2.2]) LT_INIT([disable-static]) # Check for programs -AC_USE_SYSTEM_EXTENSIONS AC_PROG_CC AC_PROG_CC_C99 AM_PROG_CC_C_O @@ -148,12 +148,6 @@ AM_CONDITIONAL(HAVE_PTHREAD, $have_pthread) dnl ========================================================================== -have_ot=true -if $have_ot; then - AC_DEFINE(HAVE_OT, 1, [Have native OpenType Layout backend]) -fi -AM_CONDITIONAL(HAVE_OT, $have_ot) - have_fallback=true if $have_fallback; then AC_DEFINE(HAVE_FALLBACK, 1, [Have simple TrueType Layout backend]) @@ -330,7 +324,7 @@ AC_ARG_WITH(graphite2, [Use the graphite2 library @<:@default=no@:>@])],, [with_graphite2=no]) have_graphite2=false -GRAPHITE2_DEPS="graphite2" +GRAPHITE2_DEPS="graphite2 >= 1.2.0" AC_SUBST(GRAPHITE2_DEPS) if test "x$with_graphite2" = "xyes" -o "x$with_graphite2" = "xauto"; then PKG_CHECK_MODULES(GRAPHITE2, $GRAPHITE2_DEPS, have_graphite2=true, :) diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am b/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am index 9e7fd2995c3..c74bab5d9e7 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am @@ -13,7 +13,7 @@ TESTS = check_PROGRAMS = # Convenience targets: -lib: $(BUILT_SOURCES) libharfbuzz.la libharfbuzz-subset.la +lib: $(BUILT_SOURCES) libharfbuzz.la libs: $(BUILT_SOURCES) $(lib_LTLIBRARIES) fuzzing: $(BUILT_SOURCES) libharfbuzz-fuzzing.la libharfbuzz-subset-fuzzing.la @@ -29,11 +29,9 @@ HBSOURCES = $(HB_BASE_sources) HBSOURCES += $(HB_BASE_RAGEL_GENERATED_sources) HBHEADERS = $(HB_BASE_headers) -if HAVE_OT HBSOURCES += $(HB_OT_sources) HBSOURCES += $(HB_OT_RAGEL_GENERATED_sources) HBHEADERS += $(HB_OT_headers) -endif if HAVE_FALLBACK HBSOURCES += $(HB_FALLBACK_sources) @@ -289,13 +287,16 @@ harfbuzz-gobject.def: $(HB_GOBJECT_headers) GENERATORS = \ gen-arabic-table.py \ + gen-def.py \ + gen-emoji-table.py \ gen-indic-table.py \ + gen-os2-unicode-ranges.py \ + gen-tag-table.py \ gen-use-table.py \ - gen-def.py \ $(NULL) EXTRA_DIST += $(GENERATORS) -unicode-tables: arabic-table indic-table use-table +unicode-tables: arabic-table indic-table tag-table use-table emoji-table arabic-table: gen-arabic-table.py ArabicShaping.txt UnicodeData.txt Blocks.txt $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-arabic-table.hh \ @@ -305,13 +306,21 @@ indic-table: gen-indic-table.py IndicSyllabicCategory.txt IndicPositionalCategor $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-indic-table.cc \ || ($(RM) $(srcdir)/hb-ot-shape-complex-indic-table.cc; false) +tag-table: gen-tag-table.py languagetags language-subtag-registry + $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-tag-table.hh \ + || ($(RM) $(srcdir)/hb-ot-tag-table.hh; false) + use-table: gen-use-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt UnicodeData.txt Blocks.txt $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-ot-shape-complex-use-table.cc \ || ($(RM) $(srcdir)/hb-ot-shape-complex-use-table.cc; false) +emoji-table: gen-emoji-table.py emoji-data.txt + $(AM_V_GEN) $(builddir)/$^ > $(srcdir)/hb-unicode-emoji-table.hh \ + || ($(RM) $(srcdir)/hb-unicode-emoji-table.hh; false) + built-sources: $(BUILT_SOURCES) -.PHONY: unicode-tables arabic-table indic-table use-table built-sources +.PHONY: unicode-tables arabic-table indic-table tag-table use-table emoji-table built-sources RAGEL_GENERATED = \ $(patsubst %,$(srcdir)/%,$(HB_BASE_RAGEL_GENERATED_sources)) \ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources b/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources index 654255e20c7..59cde6bd1d5 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources @@ -7,6 +7,7 @@ HB_BASE_sources = \ hb-buffer.hh \ hb-buffer-serialize.cc \ hb-buffer.cc \ + hb-cache.hh \ hb-common.cc \ hb-debug.hh \ hb-dsalgs.hh \ @@ -37,6 +38,7 @@ HB_BASE_sources = \ hb-ot-os2-unicode-ranges.hh \ hb-ot-post-macroman.hh \ hb-ot-post-table.hh \ + hb-ot-tag-table.hh \ hb-ot-tag.cc \ hb.hh \ hb-set-digest.hh \ @@ -52,6 +54,7 @@ HB_BASE_sources = \ hb-static.cc \ hb-string-array.hh \ hb-unicode.hh \ + hb-unicode-emoji-table.hh \ hb-unicode.cc \ hb-vector.hh \ hb-utf.hh \ @@ -136,7 +139,6 @@ HB_OT_sources = \ hb-ot-shape-complex-myanmar.hh \ hb-ot-shape-complex-myanmar.cc \ hb-ot-shape-complex-thai.cc \ - hb-ot-shape-complex-tibetan.cc \ hb-ot-shape-complex-use.cc \ hb-ot-shape-complex-use.hh \ hb-ot-shape-complex-use-table.cc \ @@ -171,6 +173,7 @@ HB_OT_headers = \ hb-ot-font.h \ hb-ot-layout.h \ hb-ot-math.h \ + hb-ot-name.h \ hb-ot-shape.h \ hb-ot-tag.h \ hb-ot-var.h \ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/check-static-inits.sh b/Build/source/libs/harfbuzz/harfbuzz-src/src/check-static-inits.sh index 71551cbd4c8..def25c70143 100755 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/check-static-inits.sh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/check-static-inits.sh @@ -7,7 +7,6 @@ test -z "$srcdir" && srcdir=. test -z "$libs" && libs=.libs stat=0 - if which objdump 2>/dev/null >/dev/null; then : else @@ -31,7 +30,8 @@ done echo "Checking that no object file has lazy static C++ constructors/destructors or other such stuff" for obj in $OBJS; do - if objdump -t "$obj" | grep '__cxa_'; then + if objdump -t "$obj" | grep -q '__cxa_' && ! objdump -t "$obj" | grep -q __ubsan_handle; then + objdump -t "$obj" | grep '__cxa_' echo "Ouch, $obj has lazy static C++ constructors/destructors or other such stuff" stat=1 fi diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/check-symbols.sh b/Build/source/libs/harfbuzz/harfbuzz-src/src/check-symbols.sh index d4eca5079cb..cea8684889a 100755 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/check-symbols.sh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/check-symbols.sh @@ -26,7 +26,7 @@ for soname in harfbuzz harfbuzz-subset harfbuzz-icu harfbuzz-gobject; do symprefix= if test $suffix = dylib; then symprefix=_; fi - EXPORTED_SYMBOLS="`nm "$so" | grep ' [BCDGINRSTVW] .' | grep -v " $symprefix\\($IGNORED_SYMBOLS\\>\\)" | cut -d' ' -f3 | c++filt`" + EXPORTED_SYMBOLS="`nm "$so" | grep ' [BCDGINRST] .' | grep -v " $symprefix\\($IGNORED_SYMBOLS\\>\\)" | cut -d' ' -f3 | c++filt`" prefix=$symprefix`basename "$so" | sed 's/libharfbuzz/hb/; s/-/_/g; s/[.].*//'` diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/dump-emoji.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/dump-emoji.cc index 65214692ff5..f45bc3106dd 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/dump-emoji.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/dump-emoji.cc @@ -45,8 +45,8 @@ #include #include -void cbdt_callback (const uint8_t* data, unsigned int length, - unsigned int group, unsigned int gid) +static void cbdt_callback (const uint8_t* data, unsigned int length, + unsigned int group, unsigned int gid) { char output_path[255]; sprintf (output_path, "out/cbdt-%d-%d.png", group, gid); @@ -55,8 +55,8 @@ void cbdt_callback (const uint8_t* data, unsigned int length, fclose (f); } -void sbix_callback (const uint8_t* data, unsigned int length, - unsigned int group, unsigned int gid) +static void sbix_callback (const uint8_t* data, unsigned int length, + unsigned int group, unsigned int gid) { char output_path[255]; sprintf (output_path, "out/sbix-%d-%d.png", group, gid); @@ -65,8 +65,8 @@ void sbix_callback (const uint8_t* data, unsigned int length, fclose (f); } -void svg_callback (const uint8_t* data, unsigned int length, - unsigned int start_glyph, unsigned int end_glyph) +static void svg_callback (const uint8_t* data, unsigned int length, + unsigned int start_glyph, unsigned int end_glyph) { char output_path[255]; if (start_glyph == end_glyph) @@ -83,8 +83,8 @@ void svg_callback (const uint8_t* data, unsigned int length, fclose (f); } -void colr_cpal_rendering (cairo_font_face_t *cairo_face, unsigned int upem, unsigned int num_glyphs, - const OT::COLR *colr, const OT::CPAL *cpal) +static void colr_cpal_rendering (cairo_font_face_t *cairo_face, unsigned int upem, unsigned int num_glyphs, + const OT::COLR *colr, const OT::CPAL *cpal) { for (unsigned int i = 0; i < num_glyphs; ++i) { @@ -146,7 +146,7 @@ void colr_cpal_rendering (cairo_font_face_t *cairo_face, unsigned int upem, unsi int r = (color >> 8) & 0xFF; int g = (color >> 16) & 0xFF; int b = (color >> 24) & 0xFF; - cairo_set_source_rgba (cr, r / 255.f, g / 255.f, b / 255.f, alpha); + cairo_set_source_rgba (cr, r / 255., g / 255., b / 255., alpha); cairo_glyph_t glyph; glyph.index = glyph_id; @@ -162,7 +162,8 @@ void colr_cpal_rendering (cairo_font_face_t *cairo_face, unsigned int upem, unsi } } -void dump_glyphs (cairo_font_face_t *cairo_face, unsigned int upem, unsigned int num_glyphs) +static void dump_glyphs (cairo_font_face_t *cairo_face, unsigned int upem, + unsigned int num_glyphs) { // Dump every glyph available on the font return; // disabled for now @@ -210,10 +211,29 @@ void dump_glyphs (cairo_font_face_t *cairo_face, unsigned int upem, unsigned int int main (int argc, char **argv) { if (argc != 2) { - fprintf (stderr, "usage: %s font-file.ttf\n", argv[0]); + fprintf (stderr, "usage: %s font-file.ttf\n" + "run it like `rm -rf out && mkdir out && %s font-file.ttf`\n", + argv[0], argv[0]); exit (1); } + + FILE *font_name_file = fopen ("out/_font_name_file.txt", "r"); + if (font_name_file != nullptr) + { + fprintf (stderr, "Purge or move ./out folder in order to run a new dump\n"); + exit (1); + } + + font_name_file = fopen ("out/_font_name_file.txt", "w"); + if (font_name_file == nullptr) + { + fprintf (stderr, "./out is not accessible, create it please\n"); + exit (1); + } + fwrite (argv[1], 1, strlen (argv[1]), font_name_file); + fclose (font_name_file); + hb_blob_t *blob = hb_blob_create_from_file (argv[1]); hb_face_t *face = hb_face_create (blob, 0); hb_font_t *font = hb_font_create (face); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/dump-khmer-data.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/dump-khmer-data.cc index 12871fa850f..1e79a976732 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/dump-khmer-data.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/dump-khmer-data.cc @@ -34,10 +34,8 @@ main (void) hb_glyph_info_t info; info.codepoint = u; set_khmer_properties (info); - if (info.khmer_category() != INDIC_SYLLABIC_CATEGORY_OTHER || - info.khmer_position() != INDIC_MATRA_CATEGORY_NOT_APPLICABLE) - printf("U+%04X %u %u\n", u, - info.khmer_category(), - info.khmer_position()); + if (info.khmer_category() != INDIC_SYLLABIC_CATEGORY_OTHER) + printf("U+%04X %u\n", u, + info.khmer_category()); } } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-emoji-table.py b/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-emoji-table.py new file mode 100644 index 00000000000..278e0b2d4a7 --- /dev/null +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-emoji-table.py @@ -0,0 +1,64 @@ +#!/usr/bin/python + +from __future__ import print_function, division, absolute_import +import sys +import os.path +from collections import OrderedDict + +if len (sys.argv) != 2: + print("usage: ./gen-emoji-table.py emoji-data.txt", file=sys.stderr) + sys.exit (1) + +f = open(sys.argv[1]) +header = [f.readline () for _ in range(10)] + +sets = OrderedDict() +for line in f.readlines(): + line = line.strip() + if not line or line[0] == '#': + continue + rang, typ = [s.strip() for s in line.split('#')[0].split(';')[:2]] + + rang = [int(s, 16) for s in rang.split('..')] + if len(rang) > 1: + start, end = rang + else: + start = end = rang[0] + + if typ not in sets: + sets[typ] = set() + sets[typ].add((start, end)) + + + +print ("/* == Start of generated table == */") +print ("/*") +print (" * The following tables are generated by running:") +print (" *") +print (" * ./gen-emoji-table.py emoji-data.txt") +print (" *") +print (" * on file with this header:") +print (" *") +for l in header: + print (" * %s" % (l.strip())) +print (" */") +print () +print ("#ifndef HB_UNICODE_EMOJI_TABLE_HH") +print ("#define HB_UNICODE_EMOJI_TABLE_HH") +print () +print ('#include "hb-unicode.hh"') +print () + +for typ,s in sets.items(): + if typ != "Extended_Pictographic": continue + print() + print("static const struct hb_unicode_range_t _hb_unicode_emoji_%s_table[] =" % typ) + print("{") + for pair in sorted(s): + print(" {0x%04X, 0x%04X}," % pair) + print("};") + +print () +print ("#endif /* HB_UNICODE_EMOJI_TABLE_HH */") +print () +print ("/* == End of generated table == */") diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-os2-unicode-ranges.py b/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-os2-unicode-ranges.py new file mode 100644 index 00000000000..d768313ddde --- /dev/null +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-os2-unicode-ranges.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- + +# Generates the code for a sorted unicode range array as used in hb-ot-os2-unicode-ranges.hh +# Input is a tab seperated list of unicode ranges from the otspec +# (https://docs.microsoft.com/en-us/typography/opentype/spec/os2#ulunicoderange1). + +from __future__ import print_function, division, absolute_import + +import io +import re +import sys + +reload(sys) +sys.setdefaultencoding('utf-8') + +print ("""static OS2Range _hb_os2_unicode_ranges[] = +{""") + +args = sys.argv[1:] +input_file = args[0] + +with io.open(input_file, mode="r", encoding="utf-8") as f: + + all_ranges = []; + current_bit = 0 + while True: + line = f.readline().strip() + if not line: + break + fields = re.split(r'\t+', line) + if len(fields) == 3: + current_bit = fields[0] + fields = fields[1:] + elif len(fields) > 3: + raise Error("bad input :(.") + + name = fields[0] + ranges = re.split("-", fields[1]) + if len(ranges) != 2: + raise Error("bad input :(.") + + v = tuple((int(ranges[0], 16), int(ranges[1], 16), int(current_bit), name)) + all_ranges.append(v) + +all_ranges = sorted(all_ranges, key=lambda t: t[0]) + +for ranges in all_ranges: + start = ("0x%X" % ranges[0]).rjust(8) + end = ("0x%X" % ranges[1]).rjust(8) + bit = ("%s" % ranges[2]).rjust(3) + + print (" {%s, %s, %s}, // %s" % (start, end, bit, ranges[3])) + +print ("""};""") diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-tag-table.py b/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-tag-table.py new file mode 100644 index 00000000000..13004629d2b --- /dev/null +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-tag-table.py @@ -0,0 +1,1126 @@ +#!/usr/bin/python + +"""Generator of the mapping from OpenType tags to BCP 47 tags and vice +versa. + +It creates a ``const LangTag[]``, matching the tags from the OpenType +languages system tag list to the language subtags of the BCP 47 language +subtag registry, with some manual adjustments. The mappings are +supplemented with macrolanguages' sublanguages and retired codes' +replacements, according to BCP 47 and some manual additions where BCP 47 +omits a retired code entirely. + +Also generated is a function, ``hb_ot_ambiguous_tag_to_language``, +intended for use by ``hb_ot_tag_to_language``. It maps OpenType tags +back to BCP 47 tags. Ambiguous OpenType tags (those that correspond to +multiple BCP 47 tags) are listed here, except when the alphabetically +first BCP 47 tag happens to be the chosen disambiguated tag. In that +case, the fallback behavior will choose the right tag anyway. +""" + +from __future__ import absolute_import, division, print_function, unicode_literals + +import collections +try: + from HTMLParser import HTMLParser + def write (s): + print (s.encode ('utf-8'), end='') +except ImportError: + from html.parser import HTMLParser + def write (s): + sys.stdout.flush () + sys.stdout.buffer.write (s.encode ('utf-8')) +import io +import itertools +import re +import sys +import unicodedata + +if len (sys.argv) != 3: + print ('usage: ./gen-tag-table.py languagetags language-subtag-registry', file=sys.stderr) + sys.exit (1) + +try: + from html import unescape + def html_unescape (parser, entity): + return unescape (entity) +except ImportError: + def html_unescape (parser, entity): + return parser.unescape (entity) + +def expect (condition, message=None): + if not condition: + if message is None: + raise AssertionError + raise AssertionError (message) + +# from http://www-01.sil.org/iso639-3/iso-639-3.tab +ISO_639_3_TO_1 = { + 'aar': 'aa', + 'abk': 'ab', + 'afr': 'af', + 'aka': 'ak', + 'amh': 'am', + 'ara': 'ar', + 'arg': 'an', + 'asm': 'as', + 'ava': 'av', + 'ave': 'ae', + 'aym': 'ay', + 'aze': 'az', + 'bak': 'ba', + 'bam': 'bm', + 'bel': 'be', + 'ben': 'bn', + 'bis': 'bi', + 'bod': 'bo', + 'bos': 'bs', + 'bre': 'br', + 'bul': 'bg', + 'cat': 'ca', + 'ces': 'cs', + 'cha': 'ch', + 'che': 'ce', + 'chu': 'cu', + 'chv': 'cv', + 'cor': 'kw', + 'cos': 'co', + 'cre': 'cr', + 'cym': 'cy', + 'dan': 'da', + 'deu': 'de', + 'div': 'dv', + 'dzo': 'dz', + 'ell': 'el', + 'eng': 'en', + 'epo': 'eo', + 'est': 'et', + 'eus': 'eu', + 'ewe': 'ee', + 'fao': 'fo', + 'fas': 'fa', + 'fij': 'fj', + 'fin': 'fi', + 'fra': 'fr', + 'fry': 'fy', + 'ful': 'ff', + 'gla': 'gd', + 'gle': 'ga', + 'glg': 'gl', + 'glv': 'gv', + 'grn': 'gn', + 'guj': 'gu', + 'hat': 'ht', + 'hau': 'ha', + 'hbs': 'sh', + 'heb': 'he', + 'her': 'hz', + 'hin': 'hi', + 'hmo': 'ho', + 'hrv': 'hr', + 'hun': 'hu', + 'hye': 'hy', + 'ibo': 'ig', + 'ido': 'io', + 'iii': 'ii', + 'iku': 'iu', + 'ile': 'ie', + 'ina': 'ia', + 'ind': 'id', + 'ipk': 'ik', + 'isl': 'is', + 'ita': 'it', + 'jav': 'jv', + 'jpn': 'ja', + 'kal': 'kl', + 'kan': 'kn', + 'kas': 'ks', + 'kat': 'ka', + 'kau': 'kr', + 'kaz': 'kk', + 'khm': 'km', + 'kik': 'ki', + 'kin': 'rw', + 'kir': 'ky', + 'kom': 'kv', + 'kon': 'kg', + 'kor': 'ko', + 'kua': 'kj', + 'kur': 'ku', + 'lao': 'lo', + 'lat': 'la', + 'lav': 'lv', + 'lim': 'li', + 'lin': 'ln', + 'lit': 'lt', + 'ltz': 'lb', + 'lub': 'lu', + 'lug': 'lg', + 'mah': 'mh', + 'mal': 'ml', + 'mar': 'mr', + 'mkd': 'mk', + 'mlg': 'mg', + 'mlt': 'mt', + 'mol': 'mo', + 'mon': 'mn', + 'mri': 'mi', + 'msa': 'ms', + 'mya': 'my', + 'nau': 'na', + 'nav': 'nv', + 'nbl': 'nr', + 'nde': 'nd', + 'ndo': 'ng', + 'nep': 'ne', + 'nld': 'nl', + 'nno': 'nn', + 'nob': 'nb', + 'nor': 'no', + 'nya': 'ny', + 'oci': 'oc', + 'oji': 'oj', + 'ori': 'or', + 'orm': 'om', + 'oss': 'os', + 'pan': 'pa', + 'pli': 'pi', + 'pol': 'pl', + 'por': 'pt', + 'pus': 'ps', + 'que': 'qu', + 'roh': 'rm', + 'ron': 'ro', + 'run': 'rn', + 'rus': 'ru', + 'sag': 'sg', + 'san': 'sa', + 'sin': 'si', + 'slk': 'sk', + 'slv': 'sl', + 'sme': 'se', + 'smo': 'sm', + 'sna': 'sn', + 'snd': 'sd', + 'som': 'so', + 'sot': 'st', + 'spa': 'es', + 'sqi': 'sq', + 'srd': 'sc', + 'srp': 'sr', + 'ssw': 'ss', + 'sun': 'su', + 'swa': 'sw', + 'swe': 'sv', + 'tah': 'ty', + 'tam': 'ta', + 'tat': 'tt', + 'tel': 'te', + 'tgk': 'tg', + 'tgl': 'tl', + 'tha': 'th', + 'tir': 'ti', + 'ton': 'to', + 'tsn': 'tn', + 'tso': 'ts', + 'tuk': 'tk', + 'tur': 'tr', + 'twi': 'tw', + 'uig': 'ug', + 'ukr': 'uk', + 'urd': 'ur', + 'uzb': 'uz', + 'ven': 've', + 'vie': 'vi', + 'vol': 'vo', + 'wln': 'wa', + 'wol': 'wo', + 'xho': 'xh', + 'yid': 'yi', + 'yor': 'yo', + 'zha': 'za', + 'zho': 'zh', + 'zul': 'zu', +} + +class LanguageTag (object): + """A BCP 47 language tag. + + Attributes: + subtags (List[str]): The list of subtags in this tag. + grandfathered (bool): Whether this tag is grandfathered. If + ``true``, the entire lowercased tag is the ``language`` + and the other subtag fields are empty. + language (str): The language subtag. + script (str): The script subtag. + region (str): The region subtag. + variant (str): The variant subtag. + + Args: + tag (str): A BCP 47 language tag. + + """ + def __init__ (self, tag): + global bcp_47 + self.subtags = tag.lower ().split ('-') + self.grandfathered = tag.lower () in bcp_47.grandfathered + if self.grandfathered: + self.language = tag.lower () + self.script = '' + self.region = '' + self.variant = '' + else: + self.language = self.subtags[0] + self.script = self._find_first (lambda s: len (s) == 4 and s[0] > '9', self.subtags) + self.region = self._find_first (lambda s: len (s) == 2 and s[0] > '9' or len (s) == 3 and s[0] <= '9', self.subtags[1:]) + self.variant = self._find_first (lambda s: len (s) > 4 or len (s) == 4 and s[0] <= '9', self.subtags) + + def __str__(self): + return '-'.join(self.subtags) + + def __repr__ (self): + return 'LanguageTag(%r)' % str(self) + + @staticmethod + def _find_first (function, sequence): + try: + return next (iter (filter (function, sequence))) + except StopIteration: + return None + + def is_complex (self): + """Return whether this tag is too complex to represent as a + ``LangTag`` in the generated code. + + Complex tags need to be handled in + ``hb_ot_tags_from_complex_language``. + + Returns: + Whether this tag is complex. + """ + return not (len (self.subtags) == 1 + or self.grandfathered + and len (self.subtags[1]) != 3 + and ot.from_bcp_47[self.subtags[0]] == ot.from_bcp_47[self.language]) + + def get_group (self): + """Return the group into which this tag should be categorized in + ``hb_ot_tags_from_complex_language``. + + The group is the first letter of the tag, or ``'und'`` if this tag + should not be matched in a ``switch`` statement in the generated + code. + + Returns: + This tag's group. + """ + return ('und' + if (self.language == 'und' + or self.variant in bcp_47.prefixes and len (bcp_47.prefixes[self.variant]) == 1) + else self.language[0]) + +class OpenTypeRegistryParser (HTMLParser): + """A parser for the OpenType language system tag registry. + + Attributes: + header (str): The "last updated" line of the registry. + names (Mapping[str, str]): A map of language system tags to the + names they are given in the registry. + ranks (DefaultDict[str, int]): A map of language system tags to + numbers. If a single BCP 47 tag corresponds to multiple + OpenType tags, the tags are ordered in increasing order by + rank. The rank is based on the number of BCP 47 tags + associated with a tag, though it may be manually modified. + to_bcp_47 (DefaultDict[str, AbstractSet[str]]): A map of + OpenType language system tags to sets of BCP 47 tags. + from_bcp_47 (DefaultDict[str, AbstractSet[str]]): ``to_bcp_47`` + inverted. Its values start as unsorted sets; + ``sort_languages`` converts them to sorted lists. + + """ + def __init__ (self): + HTMLParser.__init__ (self) + self.header = '' + self.names = {} + self.ranks = collections.defaultdict (int) + self.to_bcp_47 = collections.defaultdict (set) + self.from_bcp_47 = collections.defaultdict (set) + # Whether the parser is in a element + self._td = False + # The text of the elements of the current element. + self._current_tr = [] + + def handle_starttag (self, tag, attrs): + if tag == 'meta': + for attr, value in attrs: + if attr == 'name' and value == 'updated_at': + self.header = self.get_starttag_text () + break + elif tag == 'td': + self._td = True + self._current_tr.append ('') + elif tag == 'tr': + self._current_tr = [] + + def handle_endtag (self, tag): + if tag == 'td': + self._td = False + elif tag == 'tr' and self._current_tr: + expect (2 <= len (self._current_tr) <= 3) + name = self._current_tr[0].strip () + tag = self._current_tr[1].strip ("\t\n\v\f\r '") + rank = 0 + if len (tag) > 4: + expect (tag.endswith (' (deprecated)'), 'ill-formed OpenType tag: %s' % tag) + name += ' (deprecated)' + tag = tag.split (' ')[0] + rank = 1 + self.names[tag] = re.sub (' languages$', '', name) + if not self._current_tr[2]: + return + iso_codes = self._current_tr[2].strip () + self.to_bcp_47[tag].update (ISO_639_3_TO_1.get (code, code) for code in iso_codes.replace (' ', '').split (',')) + rank += 2 * len (self.to_bcp_47[tag]) + self.ranks[tag] = rank + + def handle_data (self, data): + if self._td: + self._current_tr[-1] += data + + def handle_charref (self, name): + self.handle_data (html_unescape (self, '&#%s;' % name)) + + def handle_entityref (self, name): + self.handle_data (html_unescape (self, '&%s;' % name)) + + def parse (self, filename): + """Parse the OpenType language system tag registry. + + Args: + filename (str): The file name of the registry. + """ + with io.open (filename, encoding='utf-8') as f: + self.feed (f.read ()) + expect (self.header) + for tag, iso_codes in self.to_bcp_47.items (): + for iso_code in iso_codes: + self.from_bcp_47[iso_code].add (tag) + + def add_language (self, bcp_47_tag, ot_tag): + """Add a language as if it were in the registry. + + Args: + bcp_47_tag (str): A BCP 47 tag. If the tag is more than just + a language subtag, and if the language subtag is a + macrolanguage, then new languages are added corresponding + to the macrolanguages' individual languages with the + remainder of the tag appended. + ot_tag (str): An OpenType language system tag. + """ + global bcp_47 + self.to_bcp_47[ot_tag].add (bcp_47_tag) + self.from_bcp_47[bcp_47_tag].add (ot_tag) + if bcp_47_tag.lower () not in bcp_47.grandfathered: + try: + [macrolanguage, suffix] = bcp_47_tag.split ('-', 1) + if macrolanguage in bcp_47.macrolanguages: + s = set () + for language in bcp_47.macrolanguages[macrolanguage]: + if language.lower () not in bcp_47.grandfathered: + s.add ('%s-%s' % (language, suffix)) + bcp_47.macrolanguages['%s-%s' % (macrolanguage, suffix)] = s + except ValueError: + pass + + @staticmethod + def _remove_language (tag_1, dict_1, dict_2): + for tag_2 in dict_1.pop (tag_1): + dict_2[tag_2].remove (tag_1) + if not dict_2[tag_2]: + del dict_2[tag_2] + + def remove_language_ot (self, ot_tag): + """Remove an OpenType tag from the registry. + + Args: + ot_tag (str): An OpenType tag. + """ + self._remove_language (ot_tag, self.to_bcp_47, self.from_bcp_47) + + def remove_language_bcp_47 (self, bcp_47_tag): + """Remove a BCP 47 tag from the registry. + + Args: + bcp_47_tag (str): A BCP 47 tag. + """ + self._remove_language (bcp_47_tag, self.from_bcp_47, self.to_bcp_47) + + def inherit_from_macrolanguages (self): + """Copy mappings from macrolanguages to individual languages. + + If a BCP 47 tag for an individual mapping has no OpenType + mapping but its macrolanguage does, the mapping is copied to + the individual language. For example, als (Tosk Albanian) has no + explicit mapping, so it inherits from sq (Albanian) the mapping + to SQI. + + If a BCP 47 tag for a macrolanguage has no OpenType mapping but + all of its individual languages do and they all map to the same + tags, the mapping is copied to the macrolanguage. + """ + global bcp_47 + original_ot_from_bcp_47 = dict (self.from_bcp_47) + for macrolanguage, languages in dict (bcp_47.macrolanguages).items (): + ot_macrolanguages = set (original_ot_from_bcp_47.get (macrolanguage, set ())) + if ot_macrolanguages: + for ot_macrolanguage in ot_macrolanguages: + for language in languages: + # Remove the following condition if e.g. nn should map to NYN,NOR + # instead of just NYN. + if language not in original_ot_from_bcp_47: + self.add_language (language, ot_macrolanguage) + self.ranks[ot_macrolanguage] += 1 + else: + for language in languages: + if language in original_ot_from_bcp_47: + if ot_macrolanguages: + ml = original_ot_from_bcp_47[language] + if ml: + ot_macrolanguages &= ml + else: + pass + else: + ot_macrolanguages |= original_ot_from_bcp_47[language] + else: + ot_macrolanguages.clear () + if not ot_macrolanguages: + break + for ot_macrolanguage in ot_macrolanguages: + self.add_language (macrolanguage, ot_macrolanguage) + + def sort_languages (self): + """Sort the values of ``from_bcp_47`` in ascending rank order.""" + for language, tags in self.from_bcp_47.items (): + self.from_bcp_47[language] = sorted (tags, + key=lambda t: (self.ranks[t] + rank_delta (language, t), t)) + +ot = OpenTypeRegistryParser () + +class BCP47Parser (object): + """A parser for the BCP 47 subtag registry. + + Attributes: + header (str): The "File-Date" line of the registry. + names (Mapping[str, str]): A map of subtags to the names they + are given in the registry. Each value is a + ``'\\n'``-separated list of names. + scopes (Mapping[str, str]): A map of language subtags to strings + suffixed to language names, including suffixes to explain + language scopes. + macrolanguages (DefaultDict[str, AbstractSet[str]]): A map of + language subtags to the sets of language subtags which + inherit from them. See + ``OpenTypeRegistryParser.inherit_from_macrolanguages``. + prefixes (DefaultDict[str, AbstractSet[str]]): A map of variant + subtags to their prefixes. + grandfathered (AbstractSet[str]): The set of grandfathered tags, + normalized to lowercase. + + """ + def __init__ (self): + self.header = '' + self.names = {} + self.scopes = {} + self.macrolanguages = collections.defaultdict (set) + self.prefixes = collections.defaultdict (set) + self.grandfathered = set () + + def parse (self, filename): + """Parse the BCP 47 subtag registry. + + Args: + filename (str): The file name of the registry. + """ + with io.open (filename, encoding='utf-8') as f: + subtag_type = None + subtag = None + deprecated = False + has_preferred_value = False + line_buffer = '' + for line in itertools.chain (f, ['']): + line = line.rstrip () + if line.startswith (' '): + line_buffer += line[1:] + continue + line, line_buffer = line_buffer, line + if line.startswith ('Type: '): + subtag_type = line.split (' ')[1] + deprecated = False + has_preferred_value = False + elif line.startswith ('Subtag: ') or line.startswith ('Tag: '): + subtag = line.split (' ')[1] + if subtag_type == 'grandfathered': + self.grandfathered.add (subtag.lower ()) + elif line.startswith ('Description: '): + description = line.split (' ', 1)[1].replace (' (individual language)', '') + description = re.sub (' (\((individual |macro)language\)|languages)$', '', + description) + if subtag in self.names: + self.names[subtag] += '\n' + description + else: + self.names[subtag] = description + elif subtag_type == 'language' or subtag_type == 'grandfathered': + if line.startswith ('Scope: '): + scope = line.split (' ')[1] + if scope == 'macrolanguage': + scope = ' [macrolanguage]' + elif scope == 'collection': + scope = ' [family]' + else: + continue + self.scopes[subtag] = scope + elif line.startswith ('Deprecated: '): + self.scopes[subtag] = ' (retired code)' + self.scopes.get (subtag, '') + deprecated = True + elif deprecated and line.startswith ('Comments: see '): + # If a subtag is split into multiple replacement subtags, + # it essentially represents a macrolanguage. + for language in line.replace (',', '').split (' ')[2:]: + self._add_macrolanguage (subtag, language) + elif line.startswith ('Preferred-Value: '): + # If a subtag is deprecated in favor of a single replacement subtag, + # it is either a dialect or synonym of the preferred subtag. Either + # way, it is close enough to the truth to consider the replacement + # the macrolanguage of the deprecated language. + has_preferred_value = True + macrolanguage = line.split (' ')[1] + self._add_macrolanguage (macrolanguage, subtag) + elif not has_preferred_value and line.startswith ('Macrolanguage: '): + self._add_macrolanguage (line.split (' ')[1], subtag) + elif subtag_type == 'variant': + if line.startswith ('Prefix: '): + self.prefixes[subtag].add (line.split (' ')[1]) + elif line.startswith ('File-Date: '): + self.header = line + expect (self.header) + + def _add_macrolanguage (self, macrolanguage, language): + global ot + if language not in ot.from_bcp_47: + for l in self.macrolanguages.get (language, set ()): + self._add_macrolanguage (macrolanguage, l) + if macrolanguage not in ot.from_bcp_47: + for ls in list (self.macrolanguages.values ()): + if macrolanguage in ls: + ls.add (language) + return + self.macrolanguages[macrolanguage].add (language) + + def remove_extra_macrolanguages (self): + """Make every language have at most one macrolanguage.""" + inverted = collections.defaultdict (list) + for macrolanguage, languages in self.macrolanguages.items (): + for language in languages: + inverted[language].append (macrolanguage) + for language, macrolanguages in inverted.items (): + if len (macrolanguages) > 1: + macrolanguages.sort (key=lambda ml: len (self.macrolanguages[ml])) + biggest_macrolanguage = macrolanguages.pop () + for macrolanguage in macrolanguages: + self._add_macrolanguage (biggest_macrolanguage, macrolanguage) + + def get_name (self, lt): + """Return the names of the subtags in a language tag. + + Args: + lt (LanguageTag): A BCP 47 language tag. + + Returns: + The name form of ``lt``. + """ + name = self.names[lt.language].split ('\n')[0] + if lt.script: + name += '; ' + self.names[lt.script.title ()].split ('\n')[0] + if lt.region: + name += '; ' + self.names[lt.region.upper ()].split ('\n')[0] + if lt.variant: + name += '; ' + self.names[lt.variant].split ('\n')[0] + return name + +bcp_47 = BCP47Parser () + +ot.parse (sys.argv[1]) +bcp_47.parse (sys.argv[2]) + +ot.add_language ('ary', 'MOR') + +ot.add_language ('ath', 'ATH') + +ot.add_language ('bai', 'BML') + +ot.ranks['BAL'] = ot.ranks['KAR'] + 1 + +ot.add_language ('ber', 'BBR') + +ot.remove_language_ot ('PGR') +ot.add_language ('el-polyton', 'PGR') + +bcp_47.macrolanguages['et'] = {'ekk'} + +bcp_47.names['flm'] = 'Falam Chin' +bcp_47.scopes['flm'] = ' (retired code)' +bcp_47.macrolanguages['flm'] = {'cfm'} + +ot.ranks['FNE'] = ot.ranks['TNE'] + 1 + +ot.add_language ('und-fonipa', 'IPPH') + +ot.add_language ('und-fonnapa', 'APPH') + +ot.remove_language_ot ('IRT') +ot.add_language ('ga-Latg', 'IRT') + +ot.remove_language_ot ('KGE') +ot.add_language ('und-Geok', 'KGE') + +ot.add_language ('guk', 'GUK') +ot.names['GUK'] = 'Gumuz (SIL fonts)' +ot.ranks['GUK'] = ot.ranks['GMZ'] + 1 + +bcp_47.macrolanguages['id'] = {'in'} + +bcp_47.macrolanguages['ijo'] = {'ijc'} + +ot.add_language ('kht', 'KHN') +ot.names['KHN'] = ot.names['KHT'] + ' (Microsoft fonts)' +ot.names['KHT'] = ot.names['KHT'] + ' (OpenType spec and SIL fonts)' +ot.ranks['KHN'] = ot.ranks['KHT'] +ot.ranks['KHT'] += 1 + +ot.ranks['LCR'] = ot.ranks['MCR'] + 1 + +ot.names['MAL'] = 'Malayalam Traditional' +ot.ranks['MLR'] += 1 + +bcp_47.names['mhv'] = 'Arakanese' +bcp_47.scopes['mhv'] = ' (retired code)' + +ot.add_language ('no', 'NOR') + +ot.add_language ('oc-provenc', 'PRO') + +ot.add_language ('qu', 'QUZ') +ot.add_language ('qub', 'QWH') +ot.add_language ('qud', 'QVI') +ot.add_language ('qug', 'QVI') +ot.add_language ('qup', 'QVI') +ot.add_language ('qur', 'QWH') +ot.add_language ('qus', 'QUH') +ot.add_language ('quw', 'QVI') +ot.add_language ('qux', 'QWH') +ot.add_language ('qva', 'QWH') +ot.add_language ('qvh', 'QWH') +ot.add_language ('qvj', 'QVI') +ot.add_language ('qvl', 'QWH') +ot.add_language ('qvm', 'QWH') +ot.add_language ('qvn', 'QWH') +ot.add_language ('qvo', 'QVI') +ot.add_language ('qvp', 'QWH') +ot.add_language ('qvw', 'QWH') +ot.add_language ('qvz', 'QVI') +ot.add_language ('qwa', 'QWH') +ot.add_language ('qws', 'QWH') +ot.add_language ('qxa', 'QWH') +ot.add_language ('qxc', 'QWH') +ot.add_language ('qxh', 'QWH') +ot.add_language ('qxl', 'QVI') +ot.add_language ('qxn', 'QWH') +ot.add_language ('qxo', 'QWH') +ot.add_language ('qxr', 'QVI') +ot.add_language ('qxt', 'QWH') +ot.add_language ('qxw', 'QWH') + +bcp_47.macrolanguages['ro'].remove ('mo') +bcp_47.macrolanguages['ro-MD'].add ('mo') + +ot.add_language ('sgw', 'SGW') +ot.names['SGW'] = ot.names['CHG'] + ' (SIL fonts)' +ot.ranks['SGW'] = ot.ranks['CHG'] + 1 + +ot.remove_language_ot ('SYRE') +ot.remove_language_ot ('SYRJ') +ot.remove_language_ot ('SYRN') +ot.add_language ('und-Syre', 'SYRE') +ot.add_language ('und-Syrj', 'SYRJ') +ot.add_language ('und-Syrn', 'SYRN') + +bcp_47.names['xst'] = u"Silt'e" +bcp_47.scopes['xst'] = ' (retired code)' +bcp_47.macrolanguages['xst'] = {'stv', 'wle'} + +ot.add_language ('xwo', 'TOD') + +ot.remove_language_ot ('ZHH') +ot.remove_language_ot ('ZHP') +ot.remove_language_ot ('ZHT') +bcp_47.macrolanguages['zh'].remove ('lzh') +bcp_47.macrolanguages['zh'].remove ('yue') +ot.add_language ('zh-Hant-MO', 'ZHH') +ot.add_language ('zh-Hant-HK', 'ZHH') +ot.add_language ('zh-Hans', 'ZHS') +ot.add_language ('zh-Hant', 'ZHT') +ot.add_language ('zh-HK', 'ZHH') +ot.add_language ('zh-MO', 'ZHH') +ot.add_language ('zh-TW', 'ZHT') +ot.add_language ('lzh', 'ZHT') +ot.add_language ('lzh-Hans', 'ZHS') +ot.add_language ('yue', 'ZHH') +ot.add_language ('yue-Hans', 'ZHS') + +bcp_47.macrolanguages['zom'] = {'yos'} + +def rank_delta (bcp_47, ot): + """Return a delta to apply to a BCP 47 tag's rank. + + Most OpenType tags have a constant rank, but a few have ranks that + depend on the BCP 47 tag. + + Args: + bcp_47 (str): A BCP 47 tag. + ot (str): An OpenType tag to. + + Returns: + A number to add to ``ot``'s rank when sorting ``bcp_47``'s + OpenType equivalents. + """ + if bcp_47 == 'ak' and ot == 'AKA': + return -1 + if bcp_47 == 'tw' and ot == 'TWI': + return -1 + return 0 + +disambiguation = { + 'ALT': 'alt', + 'ARK': 'rki', + 'BHI': 'bhb', + 'BLN': 'bjt', + 'BTI': 'beb', + 'CCHN': 'cco', + 'CMR': 'swb', + 'CPP': 'crp', + 'CRR': 'crx', + 'DUJ': 'dwu', + 'ECR': 'crj', + 'HAL': 'cfm', + 'HND': 'hnd', + 'KIS': 'kqs', + 'LRC': 'bqi', + 'NDB': 'nd', + 'NIS': 'njz', + 'PLG': 'pce', + 'PRO': 'pro', + 'QIN': 'bgr', + 'QUH': 'quh', + 'QVI': 'qvi', + 'QWH': 'qwh', + 'SIG': 'stv', + 'TNE': 'yrk', + 'ZHH': 'zh-HK', + 'ZHS': 'zh-Hans', + 'ZHT': 'zh-Hant', +} + +ot.inherit_from_macrolanguages () +bcp_47.remove_extra_macrolanguages () +ot.inherit_from_macrolanguages () +ot.sort_languages () + +print ('/* == Start of generated table == */') +print ('/*') +print (' * The following table is generated by running:') +print (' *') +print (' * %s languagetags language-subtag-registry' % sys.argv[0]) +print (' *') +print (' * on files with these headers:') +print (' *') +print (' * %s' % ot.header.strip ()) +print (' * %s' % bcp_47.header) +print (' */') +print () +print ('#ifndef HB_OT_TAG_TABLE_HH') +print ('#define HB_OT_TAG_TABLE_HH') +print () +print ('static const LangTag ot_languages[] = {') + +def hb_tag (tag): + """Convert a tag to ``HB_TAG`` form. + + Args: + tag (str): An OpenType tag. + + Returns: + A snippet of C++ representing ``tag``. + """ + return u"HB_TAG('%s','%s','%s','%s')" % tuple (('%-4s' % tag)[:4]) + +def get_variant_set (name): + """Return a set of variant language names from a name. + + Args: + name (str): A list of language names from the BCP 47 registry, + joined on ``'\\n'``. + + Returns: + A set of normalized language names. + """ + return set (unicodedata.normalize ('NFD', n.replace ('\u2019', u"'")) + .encode ('ASCII', 'ignore') + .strip () + for n in re.split ('[\n(),]', name) if n) + +def language_name_intersection (a, b): + """Return the names in common between two language names. + + Args: + a (str): A list of language names from the BCP 47 registry, + joined on ``'\\n'``. + b (str): A list of language names from the BCP 47 registry, + joined on ``'\\n'``. + + Returns: + The normalized language names shared by ``a`` and ``b``. + """ + return get_variant_set (a).intersection (get_variant_set (b)) + +def get_matching_language_name (intersection, candidates): + return next (iter (c for c in candidates if not intersection.isdisjoint (get_variant_set (c)))) + +maximum_tags = 0 +for language, tags in sorted (ot.from_bcp_47.items ()): + if language == '' or '-' in language: + continue + print (' {\"%s\",\t{' % language, end='') + maximum_tags = max (maximum_tags, len (tags)) + tag_count = len (tags) + for i, tag in enumerate (tags, start=1): + if i > 1: + print ('\t\t ', end='') + print (hb_tag (tag), end='') + if i == tag_count: + print ('}}', end='') + print (',\t/* ', end='') + bcp_47_name = bcp_47.names.get (language, '') + bcp_47_name_candidates = bcp_47_name.split ('\n') + intersection = language_name_intersection (bcp_47_name, ot.names[tag]) + scope = bcp_47.scopes.get (language, '') + if not intersection: + write ('%s%s -> %s' % (bcp_47_name_candidates[0], scope, ot.names[tag])) + else: + name = get_matching_language_name (intersection, bcp_47_name_candidates) + bcp_47.names[language] = name + write ('%s%s' % (name if len (name) > len (ot.names[tag]) else ot.names[tag], scope)) + print (' */') + +print ('};') +print () +print ('static_assert (HB_OT_MAX_TAGS_PER_LANGUAGE == %iu, "");' % maximum_tags) +print () + +print ('/**') +print (' * hb_ot_tags_from_complex_language:') +print (' * @lang_str: a BCP 47 language tag to convert.') +print (' * @limit: a pointer to the end of the substring of @lang_str to consider for') +print (' * conversion.') +print (' * @count: maximum number of language tags to retrieve (IN) and actual number of') +print (' * language tags retrieved (OUT). If no tags are retrieved, it is not modified.') +print (' * @tags: array of size at least @language_count to store the language tag') +print (' * results') +print (' *') +print (' * Converts a multi-subtag BCP 47 language tag to language tags.') +print (' *') +print (' * Return value: Whether any language systems were retrieved.') +print (' **/') +print ('static bool') +print ('hb_ot_tags_from_complex_language (const char *lang_str,') +print ('\t\t\t\t const char *limit,') +print ('\t\t\t\t unsigned int *count /* IN/OUT */,') +print ('\t\t\t\t hb_tag_t *tags /* OUT */)') +print ('{') + +def print_subtag_matches (subtag, new_line): + if subtag: + if new_line: + print () + print ('\t&& ', end='') + print ('subtag_matches (lang_str, limit, "-%s")' % subtag, end='') + +complex_tags = collections.defaultdict (list) +for initial, group in itertools.groupby ((lt_tags for lt_tags in [ + (LanguageTag (language), tags) + for language, tags in sorted (ot.from_bcp_47.items (), + key=lambda i: (-len (i[0]), i[0])) + ] if lt_tags[0].is_complex ()), + key=lambda lt_tags: lt_tags[0].get_group ()): + complex_tags[initial] += group + +for initial, items in sorted (complex_tags.items ()): + if initial != 'und': + continue + for lt, tags in items: + if lt.variant in bcp_47.prefixes: + expect (next (iter (bcp_47.prefixes[lt.variant])) == lt.language, + '%s is not a valid prefix of %s' % (lt.language, lt.variant)) + print (' if (', end='') + print_subtag_matches (lt.script, False) + print_subtag_matches (lt.region, False) + print_subtag_matches (lt.variant, False) + print (')') + print (' {') + write (' /* %s */' % bcp_47.get_name (lt)) + print () + if len (tags) == 1: + write (' tags[0] = %s; /* %s */' % (hb_tag (tags[0]), ot.names[tags[0]])) + print () + print (' *count = 1;') + else: + print (' hb_tag_t possible_tags[] = {') + for tag in tags: + write (' %s, /* %s */' % (hb_tag (tag), ot.names[tag])) + print () + print (' };') + print (' for (i = 0; i < %s && i < *count; i++)' % len (tags)) + print (' tags[i] = possible_tags[i];') + print (' *count = i;') + print (' return true;') + print (' }') + +print (' switch (lang_str[0])') +print (' {') +for initial, items in sorted (complex_tags.items ()): + if initial == 'und': + continue + print (" case '%s':" % initial) + for lt, tags in items: + print (' if (', end='') + if lt.grandfathered: + print ('0 == strcmp (&lang_str[1], "%s")' % lt.language[1:], end='') + else: + string_literal = lt.language[1:] + '-' + if lt.script: + string_literal += lt.script + lt.script = None + if lt.region: + string_literal += '-' + lt.region + lt.region = None + if string_literal[-1] == '-': + print ('0 == strncmp (&lang_str[1], "%s", %i)' % (string_literal, len (string_literal)), end='') + else: + print ('lang_matches (&lang_str[1], "%s")' % string_literal, end='') + print_subtag_matches (lt.script, True) + print_subtag_matches (lt.region, True) + print_subtag_matches (lt.variant, True) + print (')') + print (' {') + write (' /* %s */' % bcp_47.get_name (lt)) + print () + if len (tags) == 1: + write (' tags[0] = %s; /* %s */' % (hb_tag (tags[0]), ot.names[tags[0]])) + print () + print (' *count = 1;') + else: + print (' unsigned int i;') + print (' hb_tag_t possible_tags[] = {') + for tag in tags: + write ('\t%s, /* %s */' % (hb_tag (tag), ot.names[tag])) + print () + print (' };') + print (' for (i = 0; i < %s && i < *count; i++)' % len (tags)) + print ('\ttags[i] = possible_tags[i];') + print (' *count = i;') + print (' return true;') + print (' }') + print (' break;') + +print (' }') +print (' return false;') +print ('}') +print () +print ('/**') +print (' * hb_ot_ambiguous_tag_to_language') +print (' * @tag: A language tag.') +print (' *') +print (' * Converts @tag to a BCP 47 language tag if it is ambiguous (it corresponds to') +print (' * many language tags) and the best tag is not the alphabetically first, or if') +print (' * the best tag consists of multiple subtags.') +print (' *') +print (' * Return value: The #hb_language_t corresponding to the BCP 47 language tag,') +print (' * or #HB_LANGUAGE_INVALID if @tag is not ambiguous.') +print (' **/') +print ('static hb_language_t') +print ('hb_ot_ambiguous_tag_to_language (hb_tag_t tag)') +print ('{') +print (' switch (tag)') +print (' {') + +def verify_disambiguation_dict (): + """Verify and normalize ``disambiguation``. + + ``disambiguation`` is a map of ambiguous OpenType language system + tags to the particular BCP 47 tags they correspond to. This function + checks that all its keys really are ambiguous and that each key's + value is valid for that key. It checks that no ambiguous tag is + missing, except when it can figure out which BCP 47 tag is the best + by itself. + + It modifies ``disambiguation`` to remove keys whose values are the + same as those that the fallback would return anyway, and to add + ambiguous keys whose disambiguations it determined automatically. + + Raises: + AssertionError: Verification failed. + """ + global bcp_47 + global disambiguation + global ot + for ot_tag, bcp_47_tags in ot.to_bcp_47.items (): + primary_tags = list (t for t in bcp_47_tags if t not in bcp_47.grandfathered and ot.from_bcp_47.get (t)[0] == ot_tag) + if len (primary_tags) == 1: + expect (ot_tag not in disambiguation, 'unnecessary disambiguation for OT tag: %s' % ot_tag) + if '-' in primary_tags[0]: + disambiguation[ot_tag] = primary_tags[0] + elif len (primary_tags) == 0: + expect (ot_tag not in disambiguation, 'There is no possible valid disambiguation for %s' % ot_tag) + else: + macrolanguages = list (t for t in primary_tags if bcp_47.scopes.get (t) == ' [macrolanguage]') + if len (macrolanguages) != 1: + macrolanguages = list (t for t in primary_tags if bcp_47.scopes.get (t) == ' [family]') + if len (macrolanguages) != 1: + macrolanguages = list (t for t in primary_tags if 'retired code' not in bcp_47.scopes.get (t, '')) + if len (macrolanguages) != 1: + expect (ot_tag in disambiguation, 'ambiguous OT tag: %s %s' % (ot_tag, str (macrolanguages))) + expect (disambiguation[ot_tag] in bcp_47_tags, + '%s is not a valid disambiguation for %s' % (disambiguation[ot_tag], ot_tag)) + elif ot_tag not in disambiguation: + disambiguation[ot_tag] = macrolanguages[0] + if disambiguation[ot_tag] == sorted (primary_tags)[0] and '-' not in disambiguation[ot_tag]: + del disambiguation[ot_tag] + for ot_tag in disambiguation.keys (): + expect (ot_tag in ot.to_bcp_47, 'unknown OT tag: %s' % ot_tag) + +verify_disambiguation_dict () +for ot_tag, bcp_47_tag in sorted (disambiguation.items ()): + write (' case %s: /* %s */' % (hb_tag (ot_tag), ot.names[ot_tag])) + print () + write (' return hb_language_from_string (\"%s\", -1); /* %s */' % (bcp_47_tag, bcp_47.get_name (LanguageTag (bcp_47_tag)))) + print () + +print (' default:') +print (' return HB_LANGUAGE_INVALID;') +print (' }') +print ('}') + +print () +print ('#endif /* HB_OT_TAG_TABLE_HH */') +print () +print ('/* == End of generated table == */') + diff --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 a8724619a03..ebfae6fab8f 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 @@ -8,7 +8,7 @@ if len (sys.argv) != 5: print ("usage: ./gen-use-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt UnicodeData.txt Blocks.txt", file=sys.stderr) sys.exit (1) -BLACKLISTED_BLOCKS = ["Thai", "Lao", "Tibetan"] +BLACKLISTED_BLOCKS = ["Thai", "Lao"] files = [io.open (x, encoding='utf-8') for x in sys.argv[1:]] @@ -197,7 +197,10 @@ def is_CONS_SUB(U, UISC, UGC): def is_CONS_WITH_STACKER(U, UISC, UGC): return UISC == Consonant_With_Stacker def is_HALANT(U, UISC, UGC): - return UISC in [Virama, Invisible_Stacker] + return UISC in [Virama, Invisible_Stacker] and not is_HALANT_OR_VOWEL_MODIFIER(U, UISC, UGC) +def is_HALANT_OR_VOWEL_MODIFIER(U, UISC, UGC): + # https://github.com/harfbuzz/harfbuzz/issues/1102 + return U == 0x11046 def is_HALANT_NUM(U, UISC, UGC): return UISC == Number_Joiner def is_ZWNJ(U, UISC, UGC): @@ -248,6 +251,7 @@ use_mapping = { 'SUB': is_CONS_SUB, 'CS': is_CONS_WITH_STACKER, 'H': is_HALANT, + 'HVM': is_HALANT_OR_VOWEL_MODIFIER, 'HN': is_HALANT_NUM, 'ZWNJ': is_ZWNJ, 'ZWJ': is_ZWJ, @@ -281,8 +285,8 @@ use_positions = { 'V': { 'Abv': [Top, Top_And_Bottom, Top_And_Bottom_And_Right, Top_And_Right], 'Blw': [Bottom, Overstruck, Bottom_And_Right], - 'Pst': [Right], - 'Pre': [Left, Top_And_Left, Top_And_Left_And_Right, Left_And_Right], + 'Pst': [Right, Top_And_Left, Top_And_Left_And_Right, Left_And_Right], + 'Pre': [Left], }, 'VM': { 'Abv': [Top], @@ -295,6 +299,7 @@ use_positions = { 'Blw': [Bottom], }, 'H': None, + 'HVM': None, 'B': None, 'FM': None, 'SUB': None, @@ -307,11 +312,28 @@ def map_to_use(data): # Resolve Indic_Syllabic_Category - # TODO: These don't have UISC assigned in Unicode 8.0, but - # have UIPC + # TODO: These don't have UISC assigned in Unicode 8.0, but have UIPC if U == 0x17DD: UISC = Vowel_Dependent if 0x1CE2 <= U <= 0x1CE8: UISC = Cantillation_Mark + # Tibetan: + # TODO: These don't have UISC assigned in Unicode 11.0, but have UIPC + if 0x0F18 <= U <= 0x0F19 or 0x0F3E <= U <= 0x0F3F: UISC = Vowel_Dependent + if 0x0F86 <= U <= 0x0F87: UISC = Tone_Mark + # Overrides to allow NFC order matching syllable + # https://github.com/harfbuzz/harfbuzz/issues/1012 + if UBlock == 'Tibetan' and is_VOWEL (U, UISC, UGC): + if UIPC == Top: + UIPC = Bottom + + # TODO: https://github.com/harfbuzz/harfbuzz/pull/982 + # also https://github.com/harfbuzz/harfbuzz/issues/1012 + if UBlock == 'Chakma' and is_VOWEL (U, UISC, UGC): + if UIPC == Top: + UIPC = Bottom + elif UIPC == Bottom: + UIPC = Top + # TODO: https://github.com/harfbuzz/harfbuzz/pull/627 if 0x1BF2 <= U <= 0x1BF3: UISC = Nukta; UIPC = Bottom @@ -359,13 +381,6 @@ def map_to_use(data): # https://github.com/roozbehp/unicode-data/issues/8 if U == 0x0A51: UIPC = Bottom - # TODO: https://github.com/harfbuzz/harfbuzz/pull/982 - if UBlock == 'Chakma' and is_VOWEL (U, UISC, UGC): - if UIPC == Top: - UIPC = Bottom - elif UIPC == Bottom: - UIPC = Top - assert (UIPC in [Not_Applicable, Visual_Order_Left] or USE in use_positions), "%s %s %s %s %s" % (hex(U), UIPC, USE, UISC, UGC) 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 87b15721a3a..304410d9bae 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 @@ -12,7 +12,11 @@ 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) diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-ankr-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-ankr-table.hh index a197cec8112..2e3ed275851 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-ankr-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-ankr-table.hh @@ -45,32 +45,47 @@ struct Anchor return_trace (c->check_struct (this)); } + public: FWORD xCoordinate; FWORD yCoordinate; public: DEFINE_SIZE_STATIC (4); }; +typedef LArrayOf GlyphAnchors; + struct ankr { static const hb_tag_t tableTag = HB_AAT_TAG_ankr; + inline const Anchor &get_anchor (hb_codepoint_t glyph_id, + unsigned int i, + unsigned int num_glyphs, + const char *end) const + { + unsigned int offset = (this+lookupTable).get_value_or_null (glyph_id, num_glyphs); + const GlyphAnchors &anchors = StructAtOffset (&(this+anchorData), offset); + /* TODO Use sanitizer; to avoid overflows and more. */ + if (unlikely ((const char *) &anchors + anchors.get_size () > end)) + return Null(Anchor); + return anchors[i]; + } + inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && version == 0 && - lookupTable.sanitize (c, this) && - anchors.sanitize (c, this))); + lookupTable.sanitize (c, this))); } protected: HBUINT16 version; /* Version number (set to zero) */ HBUINT16 flags; /* Flags (currently unused; set to zero) */ - LOffsetTo > + LOffsetTo >, false> lookupTable; /* Offset to the table's lookup table */ - LOffsetTo > - anchors; /* Offset to the glyph data table */ + LOffsetTo + anchorData; /* Offset to the glyph data table */ public: DEFINE_SIZE_STATIC (12); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-common.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-common.hh index 25f4fe14a75..89ed91f28a7 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-common.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-common.hh @@ -35,111 +35,6 @@ namespace AAT { using namespace OT; -/* - * Binary Searching Tables - */ - -struct BinSearchHeader -{ - - inline bool sanitize (hb_sanitize_context_t *c) const - { - TRACE_SANITIZE (this); - return_trace (c->check_struct (this)); - } - - HBUINT16 unitSize; /* Size of a lookup unit for this search in bytes. */ - HBUINT16 nUnits; /* Number of units of the preceding size to be searched. */ - HBUINT16 searchRange; /* The value of unitSize times the largest power of 2 - * that is less than or equal to the value of nUnits. */ - HBUINT16 entrySelector; /* The log base 2 of the largest power of 2 less than - * or equal to the value of nUnits. */ - HBUINT16 rangeShift; /* The value of unitSize times the difference of the - * value of nUnits minus the largest power of 2 less - * than or equal to the value of nUnits. */ - public: - DEFINE_SIZE_STATIC (10); -}; - -template -struct BinSearchArrayOf -{ - inline const Type& operator [] (unsigned int i) const - { - if (unlikely (i >= header.nUnits)) return Null(Type); - return StructAtOffset (bytesZ, i * header.unitSize); - } - inline Type& operator [] (unsigned int i) - { - return StructAtOffset (bytesZ, i * header.unitSize); - } - inline unsigned int get_size (void) const - { return header.static_size + header.nUnits * header.unitSize; } - - inline bool sanitize (hb_sanitize_context_t *c) const - { - TRACE_SANITIZE (this); - if (unlikely (!sanitize_shallow (c))) return_trace (false); - - /* Note: for structs that do not reference other structs, - * we do not need to call their sanitize() as we already did - * a bound check on the aggregate array size. We just include - * a small unreachable expression to make sure the structs - * pointed to do have a simple sanitize(), ie. they do not - * reference other structs via offsets. - */ - (void) (false && StructAtOffset (bytesZ, 0).sanitize (c)); - - return_trace (true); - } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const - { - TRACE_SANITIZE (this); - if (unlikely (!sanitize_shallow (c))) return_trace (false); - unsigned int count = header.nUnits; - for (unsigned int i = 0; i < count; i++) - if (unlikely (!(*this)[i].sanitize (c, base))) - return_trace (false); - return_trace (true); - } - - template - inline const Type *bsearch (const T &key) const - { - unsigned int size = header.unitSize; - int min = 0, max = (int) header.nUnits - 1; - while (min <= max) - { - int mid = (min + max) / 2; - const Type *p = (const Type *) (((const char *) bytesZ) + (mid * size)); - int c = p->cmp (key); - if (c < 0) - max = mid - 1; - else if (c > 0) - min = mid + 1; - else - return p; - } - return nullptr; - } - - private: - inline bool sanitize_shallow (hb_sanitize_context_t *c) const - { - TRACE_SANITIZE (this); - return_trace (header.sanitize (c) && - Type::static_size >= header.unitSize && - c->check_array (bytesZ, header.unitSize, header.nUnits)); - } - - protected: - BinSearchHeader header; - HBUINT8 bytesZ[VAR]; - public: - DEFINE_SIZE_ARRAY (10, bytesZ); -}; - - /* * Lookup Table */ @@ -213,7 +108,7 @@ struct LookupFormat2 protected: HBUINT16 format; /* Format identifier--format = 2 */ - BinSearchArrayOf > + VarSizedBinSearchArrayOf > segments; /* The actual segments. These must already be sorted, * according to the first word in each one (the last * glyph in each segment). */ @@ -243,7 +138,7 @@ struct LookupSegmentArray GlyphID last; /* Last GlyphID in this segment */ GlyphID first; /* First GlyphID in this segment */ - OffsetTo > + OffsetTo, HBUINT16, false> valuesZ; /* A 16-bit offset from the start of * the table to the data. */ public: @@ -269,8 +164,8 @@ struct LookupFormat4 } protected: - HBUINT16 format; /* Format identifier--format = 2 */ - BinSearchArrayOf > + HBUINT16 format; /* Format identifier--format = 4 */ + VarSizedBinSearchArrayOf > segments; /* The actual segments. These must already be sorted, * according to the first word in each one (the last * glyph in each segment). */ @@ -292,7 +187,7 @@ struct LookupSingle GlyphID glyph; /* Last GlyphID */ T value; /* The lookup value (only one) */ public: - DEFINE_SIZE_STATIC (4 + T::static_size); + DEFINE_SIZE_STATIC (2 + T::static_size); }; template @@ -315,7 +210,7 @@ struct LookupFormat6 protected: HBUINT16 format; /* Format identifier--format = 6 */ - BinSearchArrayOf > + VarSizedBinSearchArrayOf > entries; /* The actual entries, sorted by glyph index. */ public: DEFINE_SIZE_ARRAY (8, entries); @@ -329,7 +224,8 @@ struct LookupFormat8 private: inline const T* get_value (hb_codepoint_t glyph_id) const { - return firstGlyph <= glyph_id && glyph_id - firstGlyph < glyphCount ? &valueArrayZ[glyph_id - firstGlyph] : nullptr; + return firstGlyph <= glyph_id && glyph_id - firstGlyph < glyphCount ? + &valueArrayZ[glyph_id - firstGlyph] : nullptr; } inline bool sanitize (hb_sanitize_context_t *c) const @@ -339,7 +235,7 @@ struct LookupFormat8 } protected: - HBUINT16 format; /* Format identifier--format = 6 */ + HBUINT16 format; /* Format identifier--format = 8 */ GlyphID firstGlyph; /* First glyph index included in the trimmed array. */ HBUINT16 glyphCount; /* Total number of glyphs (equivalent to the last * glyph minus the value of firstGlyph plus 1). */ @@ -365,6 +261,12 @@ struct Lookup } } + inline const T& get_value_or_null (hb_codepoint_t glyph_id, unsigned int num_glyphs) const + { + const T *v = get_value (glyph_id, num_glyphs); + return v ? *v : Null(T); + } + inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); @@ -391,6 +293,25 @@ struct Lookup public: DEFINE_SIZE_UNION (2, format); }; +/* Lookup 0 has unbounded size (dependant on num_glyphs). So we need to defined + * special NULL objects for Lookup<> objects, but since it's template our macros + * don't work. So we have to hand-code them here. UGLY. */ +} /* Close namespace. */ +/* Ugly hand-coded null objects for template Lookup<> :(. */ +extern HB_INTERNAL const unsigned char _hb_Null_AAT_Lookup[2]; +template <> +/*static*/ inline const AAT::Lookup& Null > (void) { + return *reinterpret_cast *> (_hb_Null_AAT_Lookup); +} +template <> +/*static*/ inline const AAT::Lookup& Null > (void) { + return *reinterpret_cast *> (_hb_Null_AAT_Lookup); +} +template <> +/*static*/ inline const AAT::Lookup >& Null > > (void) { + return *reinterpret_cast > *> (_hb_Null_AAT_Lookup); +} +namespace AAT { /* @@ -439,10 +360,23 @@ struct Entry template struct StateTable { + enum State + { + STATE_START_OF_TEXT = 0, + STATE_START_OF_LINE = 1, + }; + enum Class + { + CLASS_END_OF_TEXT = 0, + CLASS_OUT_OF_BOUNDS = 1, + CLASS_DELETED_GLYPH = 2, + CLASS_END_OF_LINE = 3, + }; + inline unsigned int get_class (hb_codepoint_t glyph_id, unsigned int num_glyphs) const { const HBUINT16 *v = (this+classTable).get_value (glyph_id, num_glyphs); - return v ? *v : 1; + return v ? (unsigned) *v : (unsigned) CLASS_OUT_OF_BOUNDS; } inline const Entry *get_entries () const @@ -472,6 +406,8 @@ struct StateTable const HBUINT16 *states = (this+stateArrayTable).arrayZ; const Entry *entries = (this+entryTable).arrayZ; + unsigned int num_classes = nClasses; + unsigned int num_states = 1; unsigned int num_entries = 0; @@ -479,20 +415,25 @@ struct StateTable unsigned int entry = 0; while (state < num_states) { + if (unlikely (hb_unsigned_mul_overflows (num_classes, states[0].static_size))) + return_trace (false); + if (unlikely (!c->check_array (states, - states[0].static_size * nClasses, - num_states))) + num_states, + num_classes * states[0].static_size))) + return_trace (false); + if ((c->max_ops -= num_states - state) < 0) return_trace (false); { /* Sweep new states. */ - const HBUINT16 *stop = &states[num_states * nClasses]; - for (const HBUINT16 *p = &states[state * nClasses]; p < stop; p++) + const HBUINT16 *stop = &states[num_states * num_classes]; + for (const HBUINT16 *p = &states[state * num_classes]; p < stop; p++) num_entries = MAX (num_entries, *p + 1); state = num_states; } - if (unlikely (!c->check_array (entries, - entries[0].static_size, - num_entries))) + if (unlikely (!c->check_array (entries, num_entries))) + return_trace (false); + if ((c->max_ops -= num_entries - entry) < 0) return_trace (false); { /* Sweep new entries. */ const Entry *stop = &entries[num_entries]; @@ -511,11 +452,11 @@ struct StateTable protected: HBUINT32 nClasses; /* Number of classes, which is the number of indices * in a single line in the state array. */ - LOffsetTo > + LOffsetTo, false> classTable; /* Offset to the class table. */ - LOffsetTo > + LOffsetTo, false> stateArrayTable;/* Offset to the state array. */ - LOffsetTo > > + LOffsetTo >, false> entryTable; /* Offset to the entry array. */ public: @@ -535,31 +476,32 @@ struct StateTableDriver template inline void drive (context_t *c) { - hb_glyph_info_t *info = buffer->info; - if (!c->in_place) buffer->clear_output (); - unsigned int state = 0; + unsigned int state = StateTable::STATE_START_OF_TEXT; bool last_was_dont_advance = false; for (buffer->idx = 0;;) { unsigned int klass = buffer->idx < buffer->len ? - machine.get_class (info[buffer->idx].codepoint, num_glyphs) : - 0 /* End of text */; + machine.get_class (buffer->info[buffer->idx].codepoint, num_glyphs) : + (unsigned) StateTable::CLASS_END_OF_TEXT; const Entry *entry = machine.get_entryZ (state, klass); if (unlikely (!entry)) break; /* Unsafe-to-break before this if not in state 0, as things might - * go differently if we start from state 0 here. */ - if (state && buffer->idx) + * go differently if we start from state 0 here. + * + * Ugh. The indexing here is ugly... */ + if (state && buffer->backtrack_len () && buffer->idx < buffer->len) { /* If there's no action and we're just epsilon-transitioning to state 0, * safe to break. */ if (c->is_actionable (this, entry) || - !(entry->newState == 0 && entry->flags == context_t::DontAdvance)) - buffer->unsafe_to_break (buffer->idx - 1, buffer->idx + 1); + !(entry->newState == StateTable::STATE_START_OF_TEXT && + entry->flags == context_t::DontAdvance)) + buffer->unsafe_to_break_from_outbuffer (buffer->backtrack_len () - 1, buffer->idx + 1); } /* Unsafe-to-break if end-of-text would kick in here. */ @@ -573,6 +515,8 @@ struct StateTableDriver if (unlikely (!c->transition (this, entry))) break; + if (unlikely (!buffer->successful)) return; + last_was_dont_advance = (entry->flags & context_t::DontAdvance) && buffer->max_ops-- > 0; state = entry->newState; @@ -586,9 +530,10 @@ struct StateTableDriver if (!c->in_place) { - for (; buffer->idx < buffer->len;) - buffer->next_glyph (); - buffer->swap_buffers (); + for (; buffer->successful && buffer->idx < buffer->len;) + buffer->next_glyph (); + if (likely (buffer->successful)) + buffer->swap_buffers (); } } @@ -599,6 +544,7 @@ struct StateTableDriver }; +struct ankr; struct hb_aat_apply_context_t : hb_dispatch_context_t @@ -609,24 +555,33 @@ struct hb_aat_apply_context_t : static return_t default_return_value (void) { return false; } bool stop_sublookup_iteration (return_t r) const { return r; } + hb_ot_shape_plan_t *plan; hb_font_t *font; hb_face_t *face; hb_buffer_t *buffer; hb_sanitize_context_t sanitizer; + const ankr &ankr_table; + const char *ankr_end; /* Unused. For debug tracing only. */ unsigned int lookup_index; unsigned int debug_depth; - inline hb_aat_apply_context_t (hb_font_t *font_, + inline hb_aat_apply_context_t (hb_ot_shape_plan_t *plan_, + hb_font_t *font_, hb_buffer_t *buffer_, - hb_blob_t *table) : - font (font_), face (font->face), buffer (buffer_), - sanitizer (), lookup_index (0), debug_depth (0) - { - sanitizer.init (table); + hb_blob_t *blob = const_cast (&Null(hb_blob_t)), + const ankr &ankr_table_ = Null(ankr), + const char *ankr_end_ = nullptr) : + plan (plan_), font (font_), face (font->face), buffer (buffer_), + sanitizer (), + ankr_table (ankr_table_), ankr_end (ankr_end_), + lookup_index (0), debug_depth (0) + { + sanitizer.init (blob); sanitizer.set_num_glyphs (face->get_num_glyphs ()); sanitizer.start_processing (); + sanitizer.set_max_ops (HB_SANITIZE_MAX_OPS_MAX); } inline void set_lookup_index (unsigned int i) { lookup_index = i; } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-feat-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-feat-table.hh index b7007631662..b670caab83b 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-feat-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-feat-table.hh @@ -78,7 +78,7 @@ struct FeatureName protected: HBUINT16 feature; /* Feature type. */ HBUINT16 nSettings; /* The number of records in the setting name array. */ - LOffsetTo > + LOffsetTo, false> settingTable; /* Offset in bytes from the beginning of this table to * this feature's setting name array. The actual type of * record this offset refers to will depend on the diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-kerx-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-kerx-table.hh index 615a8f8d4c3..c09a6d31075 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-kerx-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-kerx-table.hh @@ -30,7 +30,8 @@ #include "hb-open-type.hh" #include "hb-aat-layout-common.hh" -#include "hb-aat-layout-ankr-table.hh" +#include "hb-ot-layout-gpos-table.hh" +#include "hb-ot-kern-table.hh" /* * kerx -- Extended Kerning @@ -44,7 +45,7 @@ namespace AAT { using namespace OT; -struct KerxFormat0Records +struct KerxSubTableHeader { inline bool sanitize (hb_sanitize_context_t *c) const { @@ -52,217 +53,565 @@ struct KerxFormat0Records return_trace (likely (c->check_struct (this))); } - protected: - GlyphID left; - GlyphID right; - FWORD value; public: - DEFINE_SIZE_STATIC (6); + HBUINT32 length; + HBUINT32 coverage; + HBUINT32 tupleCount; + public: + DEFINE_SIZE_STATIC (12); }; struct KerxSubTableFormat0 { - // TODO(ebraminio) Enable when we got suitable BinSearchArrayOf - // inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const - // { - // hb_glyph_pair_t pair = {left, right}; - // int i = pairs.bsearch (pair); - // if (i == -1) - // return 0; - // return pairs[i].get_kerning (); - // } + inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const + { + hb_glyph_pair_t pair = {left, right}; + int i = pairs.bsearch (pair); + return i == -1 ? 0 : pairs[i].get_kerning (); + } + + inline bool apply (hb_aat_apply_context_t *c) const + { + TRACE_APPLY (this); + + if (!c->plan->requested_kerning) + return false; + + hb_kern_machine_t machine (*this); + + machine.kern (c->font, c->buffer, c->plan->kern_mask); + + return_trace (true); + } inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return_trace (likely (c->check_struct (this) && - recordsZ.sanitize (c, nPairs))); + return_trace (likely (pairs.sanitize (c))); } protected: - // TODO(ebraminio): A custom version of "BinSearchArrayOf pairs;" is - // needed here to use HBUINT32 instead - HBUINT32 nPairs; /* The number of kerning pairs in this subtable */ - HBUINT32 searchRange; /* The largest power of two less than or equal to the value of nPairs, - * multiplied by the size in bytes of an entry in the subtable. */ - HBUINT32 entrySelector; /* This is calculated as log2 of the largest power of two less - * than or equal to the value of nPairs. */ - HBUINT32 rangeShift; /* The value of nPairs minus the largest power of two less than or equal to nPairs. */ - UnsizedArrayOf - recordsZ; /* VAR=nPairs */ + KerxSubTableHeader header; + BinSearchArrayOf + pairs; /* Sorted kern records. */ public: - DEFINE_SIZE_ARRAY (16, recordsZ); + DEFINE_SIZE_ARRAY (28, pairs); }; struct KerxSubTableFormat1 { - inline bool sanitize (hb_sanitize_context_t *c) const + struct EntryData { - TRACE_SANITIZE (this); - return_trace (likely (c->check_struct (this) && - stateHeader.sanitize (c))); - } + HBUINT16 kernActionIndex;/* Index into the kerning value array. If + * this index is 0xFFFF, then no kerning + * is to be performed. */ + public: + DEFINE_SIZE_STATIC (2); + }; + + struct driver_context_t + { + static const bool in_place = true; + enum Flags + { + Push = 0x8000, /* If set, push this glyph on the kerning stack. */ + DontAdvance = 0x4000, /* If set, don't advance to the next glyph + * before going to the new state. */ + Reset = 0x2000, /* If set, reset the kerning data (clear the stack) */ + Reserved = 0x1FFF, /* Not used; set to 0. */ + }; + + inline driver_context_t (const KerxSubTableFormat1 *table, + hb_aat_apply_context_t *c_) : + c (c_), + /* Apparently the offset kernAction is from the beginning of the state-machine, + * similar to offsets in morx table, NOT from beginning of this table, like + * other subtables in kerx. Discovered via testing. */ + kernAction (&table->machine + table->kernAction), + depth (0) {} + + inline bool is_actionable (StateTableDriver *driver, + const Entry *entry) + { + return entry->data.kernActionIndex != 0xFFFF; + } + inline bool transition (StateTableDriver *driver, + const Entry *entry) + { + hb_buffer_t *buffer = driver->buffer; + unsigned int flags = entry->flags; + + if (flags & Reset) + { + depth = 0; + } + + if (flags & Push) + { + if (likely (depth < ARRAY_LENGTH (stack))) + stack[depth++] = buffer->idx; + else + depth = 0; /* Probably not what CoreText does, but better? */ + } + + if (entry->data.kernActionIndex != 0xFFFF) + { + const FWORD *actions = &kernAction[entry->data.kernActionIndex]; + if (!c->sanitizer.check_array (actions, depth)) + { + depth = 0; + return false; + } + + hb_mask_t kern_mask = c->plan->kern_mask; + for (unsigned int i = 0; i < depth; i++) + { + /* Apparently, when spec says "Each pops one glyph from the kerning stack + * and applies the kerning value to it.", it doesn't mean it in that order. + * The deepest item in the stack corresponds to the first item in the action + * list. Discovered by testing. */ + unsigned int idx = stack[i]; + int v = *actions++; + if (idx < buffer->len && buffer->info[idx].mask & kern_mask) + { + /* XXX Non-forward direction... */ + if (HB_DIRECTION_IS_HORIZONTAL (buffer->props.direction)) + buffer->pos[idx].x_advance += c->font->em_scale_x (v); + else + buffer->pos[idx].y_advance += c->font->em_scale_y (v); + } + } + depth = 0; + } + + return true; + } - protected: - StateTable stateHeader; - LOffsetTo > valueTable; - public: - DEFINE_SIZE_STATIC (20); -}; + private: + hb_aat_apply_context_t *c; + const UnsizedArrayOf &kernAction; + unsigned int stack[8]; + unsigned int depth; + }; -// TODO(ebraminio): Maybe this can be replaced with Lookup? -struct KerxClassTable -{ - inline unsigned int get_class (hb_codepoint_t g) const { return classes[g - firstGlyph]; } + inline bool apply (hb_aat_apply_context_t *c) const + { + TRACE_APPLY (this); + + if (!c->plan->requested_kerning) + return false; + + driver_context_t dc (this, c); + + StateTableDriver driver (machine, c->buffer, c->font->face); + driver.drive (&dc); + + return_trace (true); + } inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return_trace (likely (firstGlyph.sanitize (c) && - classes.sanitize (c))); + /* The rest of array sanitizations are done at run-time. */ + return_trace (likely (c->check_struct (this) && + machine.sanitize (c))); } protected: - HBUINT16 firstGlyph; /* First glyph in class range. */ - ArrayOf classes; /* Glyph classes. */ + KerxSubTableHeader header; + StateTable machine; + LOffsetTo, false> kernAction; public: - DEFINE_SIZE_ARRAY (4, classes); + DEFINE_SIZE_STATIC (32); }; struct KerxSubTableFormat2 { - inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right, const char *end) const + inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right, + hb_aat_apply_context_t *c) const { - unsigned int l = (this+leftClassTable).get_class (left); - unsigned int r = (this+leftClassTable).get_class (left); - unsigned int offset = l * rowWidth + r * sizeof (FWORD); - const FWORD *arr = &(this+array); - if (unlikely ((const void *) arr < (const void *) this || (const void *) arr >= (const void *) end)) - return 0; - const FWORD *v = &StructAtOffset (arr, offset); - if (unlikely ((const void *) v < (const void *) arr || (const void *) (v + 1) > (const void *) end)) - return 0; + unsigned int num_glyphs = c->sanitizer.get_num_glyphs (); + unsigned int l = (this+leftClassTable).get_value_or_null (left, num_glyphs); + unsigned int r = (this+rightClassTable).get_value_or_null (right, num_glyphs); + unsigned int offset = l + r; + const FWORD *v = &StructAtOffset (&(this+array), offset); + if (unlikely (!v->sanitize (&c->sanitizer))) return 0; return *v; } + inline bool apply (hb_aat_apply_context_t *c) const + { + TRACE_APPLY (this); + + if (!c->plan->requested_kerning) + return false; + + accelerator_t accel (*this, c); + hb_kern_machine_t machine (accel); + machine.kern (c->font, c->buffer, c->plan->kern_mask); + + return_trace (true); + } + inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return_trace (likely (c->check_struct (this) && - rowWidth.sanitize (c) && + return_trace (likely (rowWidth.sanitize (c) && leftClassTable.sanitize (c, this) && rightClassTable.sanitize (c, this) && - array.sanitize (c, this))); + c->check_range (this, array))); } + struct accelerator_t + { + const KerxSubTableFormat2 &table; + hb_aat_apply_context_t *c; + + inline accelerator_t (const KerxSubTableFormat2 &table_, + hb_aat_apply_context_t *c_) : + table (table_), c (c_) {} + + inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const + { return table.get_kerning (left, right, c); } + }; + protected: - HBUINT32 rowWidth; /* The width, in bytes, of a row in the table. */ - LOffsetTo - leftClassTable; /* Offset from beginning of this subtable to - * left-hand class table. */ - LOffsetTo - rightClassTable;/* Offset from beginning of this subtable to - * right-hand class table. */ - LOffsetTo - array; /* Offset from beginning of this subtable to - * the start of the kerning array. */ + KerxSubTableHeader header; + HBUINT32 rowWidth; /* The width, in bytes, of a row in the table. */ + LOffsetTo, false> + leftClassTable; /* Offset from beginning of this subtable to + * left-hand class table. */ + LOffsetTo, false> + rightClassTable;/* Offset from beginning of this subtable to + * right-hand class table. */ + LOffsetTo, false> + array; /* Offset from beginning of this subtable to + * the start of the kerning array. */ public: - DEFINE_SIZE_STATIC (16); + DEFINE_SIZE_STATIC (28); }; struct KerxSubTableFormat4 { + struct EntryData + { + HBUINT16 ankrActionIndex;/* Either 0xFFFF (for no action) or the index of + * the action to perform. */ + public: + DEFINE_SIZE_STATIC (2); + }; + + struct driver_context_t + { + static const bool in_place = true; + enum Flags + { + Mark = 0x8000, /* If set, remember this glyph as the marked glyph. */ + DontAdvance = 0x4000, /* If set, don't advance to the next glyph before + * going to the new state. */ + Reserved = 0x3FFF, /* Not used; set to 0. */ + }; + + enum SubTableFlags + { + ActionType = 0xC0000000, /* A two-bit field containing the action type. */ + Unused = 0x3F000000, /* Unused - must be zero. */ + Offset = 0x00FFFFFF, /* Masks the offset in bytes from the beginning + * of the subtable to the beginning of the control + * point table. */ + }; + + inline driver_context_t (const KerxSubTableFormat4 *table, + hb_aat_apply_context_t *c_) : + c (c_), + action_type ((table->flags & ActionType) >> 30), + ankrData ((HBUINT16 *) ((const char *) &table->machine + (table->flags & Offset))), + mark_set (false), + mark (0) {} + + inline bool is_actionable (StateTableDriver *driver, + const Entry *entry) + { + return entry->data.ankrActionIndex != 0xFFFF; + } + inline bool transition (StateTableDriver *driver, + const Entry *entry) + { + hb_buffer_t *buffer = driver->buffer; + unsigned int flags = entry->flags; + + if (mark_set && entry->data.ankrActionIndex != 0xFFFF && buffer->idx < buffer->len) + { + hb_glyph_position_t &o = buffer->cur_pos(); + switch (action_type) + { + case 0: /* Control Point Actions.*/ + { + /* indexed into glyph outline. */ + const HBUINT16 *data = &ankrData[entry->data.ankrActionIndex]; + if (!c->sanitizer.check_array (data, 2)) + return false; + HB_UNUSED unsigned int markControlPoint = *data++; + HB_UNUSED unsigned int currControlPoint = *data++; + hb_position_t markX = 0; + hb_position_t markY = 0; + hb_position_t currX = 0; + hb_position_t currY = 0; + if (!c->font->get_glyph_contour_point_for_origin (c->buffer->info[mark].codepoint, + markControlPoint, + HB_DIRECTION_LTR /*XXX*/, + &markX, &markY) || + !c->font->get_glyph_contour_point_for_origin (c->buffer->cur ().codepoint, + currControlPoint, + HB_DIRECTION_LTR /*XXX*/, + &currX, &currY)) + return true; /* True, such that the machine continues. */ + + o.x_offset = markX - currX; + o.y_offset = markY - currY; + } + break; + + case 1: /* Anchor Point Actions. */ + { + /* Indexed into 'ankr' table. */ + const HBUINT16 *data = &ankrData[entry->data.ankrActionIndex]; + if (!c->sanitizer.check_array (data, 2)) + return false; + unsigned int markAnchorPoint = *data++; + unsigned int currAnchorPoint = *data++; + const Anchor markAnchor = c->ankr_table.get_anchor (c->buffer->info[mark].codepoint, + markAnchorPoint, + c->sanitizer.get_num_glyphs (), + c->ankr_end); + const Anchor currAnchor = c->ankr_table.get_anchor (c->buffer->cur ().codepoint, + currAnchorPoint, + c->sanitizer.get_num_glyphs (), + c->ankr_end); + + o.x_offset = c->font->em_scale_x (markAnchor.xCoordinate) - c->font->em_scale_x (currAnchor.xCoordinate); + o.y_offset = c->font->em_scale_y (markAnchor.yCoordinate) - c->font->em_scale_y (currAnchor.yCoordinate); + } + break; + + case 2: /* Control Point Coordinate Actions. */ + { + const FWORD *data = (const FWORD *) &ankrData[entry->data.ankrActionIndex]; + if (!c->sanitizer.check_array (data, 4)) + return false; + int markX = *data++; + int markY = *data++; + int currX = *data++; + int currY = *data++; + + o.x_offset = c->font->em_scale_x (markX) - c->font->em_scale_x (currX); + o.y_offset = c->font->em_scale_y (markY) - c->font->em_scale_y (currY); + } + break; + } + o.attach_type() = ATTACH_TYPE_MARK; + o.attach_chain() = (int) mark - (int) buffer->idx; + buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT; + } + + if (flags & Mark) + { + mark_set = true; + mark = buffer->idx; + } + + return true; + } + + private: + hb_aat_apply_context_t *c; + unsigned int action_type; + const HBUINT16 *ankrData; + bool mark_set; + unsigned int mark; + }; + + inline bool apply (hb_aat_apply_context_t *c) const + { + TRACE_APPLY (this); + + driver_context_t dc (this, c); + + StateTableDriver driver (machine, c->buffer, c->font->face); + driver.drive (&dc); + + return_trace (true); + } + inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); + /* The rest of array sanitizations are done at run-time. */ return_trace (likely (c->check_struct (this) && - rowWidth.sanitize (c) && - leftClassTable.sanitize (c, this) && - rightClassTable.sanitize (c, this) && - array.sanitize (c, this))); + machine.sanitize (c))); } protected: - HBUINT32 rowWidth; /* The width, in bytes, of a row in the table. */ - LOffsetTo - leftClassTable; /* Offset from beginning of this subtable to - * left-hand class table. */ - LOffsetTo - rightClassTable;/* Offset from beginning of this subtable to - * right-hand class table. */ - LOffsetTo - array; /* Offset from beginning of this subtable to - * the start of the kerning array. */ + KerxSubTableHeader header; + StateTable machine; + HBUINT32 flags; public: - DEFINE_SIZE_STATIC (16); + DEFINE_SIZE_STATIC (32); }; struct KerxSubTableFormat6 { + enum Flags + { + ValuesAreLong = 0x00000001, + }; + + inline bool is_long (void) const { return flags & ValuesAreLong; } + + inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right, + hb_aat_apply_context_t *c) const + { + unsigned int num_glyphs = c->sanitizer.get_num_glyphs (); + if (is_long ()) + { + const U::Long &t = u.l; + unsigned int l = (this+t.rowIndexTable).get_value_or_null (left, num_glyphs); + unsigned int r = (this+t.columnIndexTable).get_value_or_null (right, num_glyphs); + unsigned int offset = l + r; + if (unlikely (offset < l)) return 0; /* Addition overflow. */ + if (unlikely (hb_unsigned_mul_overflows (offset, sizeof (FWORD32)))) return 0; + const FWORD32 *v = &StructAtOffset (&(this+t.array), offset * sizeof (FWORD32)); + if (unlikely (!v->sanitize (&c->sanitizer))) return 0; + return *v; + } + else + { + const U::Short &t = u.s; + unsigned int l = (this+t.rowIndexTable).get_value_or_null (left, num_glyphs); + unsigned int r = (this+t.columnIndexTable).get_value_or_null (right, num_glyphs); + unsigned int offset = l + r; + const FWORD *v = &StructAtOffset (&(this+t.array), offset * sizeof (FWORD)); + if (unlikely (!v->sanitize (&c->sanitizer))) return 0; + return *v; + } + } + + inline bool apply (hb_aat_apply_context_t *c) const + { + TRACE_APPLY (this); + + if (!c->plan->requested_kerning) + return false; + + accelerator_t accel (*this, c); + hb_kern_machine_t machine (accel); + machine.kern (c->font, c->buffer, c->plan->kern_mask); + + return_trace (true); + } + inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && - rowIndexTable.sanitize (c, this) && - columnIndexTable.sanitize (c, this) && - kerningArray.sanitize (c, this) && - kerningVector.sanitize (c, this))); + (is_long () ? + ( + u.l.rowIndexTable.sanitize (c, this) && + u.l.columnIndexTable.sanitize (c, this) && + c->check_range (this, u.l.array) + ) : ( + u.s.rowIndexTable.sanitize (c, this) && + u.s.columnIndexTable.sanitize (c, this) && + c->check_range (this, u.s.array) + )))); } + struct accelerator_t + { + const KerxSubTableFormat6 &table; + hb_aat_apply_context_t *c; + + inline accelerator_t (const KerxSubTableFormat6 &table_, + hb_aat_apply_context_t *c_) : + table (table_), c (c_) {} + + inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const + { return table.get_kerning (left, right, c); } + }; + protected: - HBUINT32 flags; - HBUINT16 rowCount; - HBUINT16 columnCount; - LOffsetTo > rowIndexTable; - LOffsetTo > columnIndexTable; - LOffsetTo > kerningArray; - LOffsetTo > kerningVector; + KerxSubTableHeader header; + HBUINT32 flags; + HBUINT16 rowCount; + HBUINT16 columnCount; + union U + { + struct Long + { + LOffsetTo, false> rowIndexTable; + LOffsetTo, false> columnIndexTable; + LOffsetTo, false> array; + } l; + struct Short + { + LOffsetTo, false> rowIndexTable; + LOffsetTo, false> columnIndexTable; + LOffsetTo, false> array; + } s; + } u; public: - DEFINE_SIZE_STATIC (24); -}; - -enum coverage_flags_t -{ - COVERAGE_VERTICAL_FLAG = 0x80u, - COVERAGE_CROSSSTREAM_FLAG = 0x40u, - COVERAGE_VARIATION_FLAG = 0x20u, - COVERAGE_PROCESS_DIRECTION = 0x10u, + DEFINE_SIZE_STATIC (32); }; struct KerxTable { - inline bool apply (hb_aat_apply_context_t *c, const AAT::ankr *ankr) const + friend struct kerx; + + inline unsigned int get_size (void) const { return u.header.length; } + inline unsigned int get_type (void) const { return u.header.coverage & SubtableType; } + + enum Coverage { - TRACE_APPLY (this); - /* TODO */ - return_trace (false); + Vertical = 0x80000000, /* Set if table has vertical kerning values. */ + CrossStream = 0x40000000, /* Set if table has cross-stream kerning values. */ + Variation = 0x20000000, /* Set if table has variation kerning values. */ + Backwards = 0x10000000, /* If clear, process the glyphs forwards, that + * is, from first to last in the glyph stream. + * If we, process them from last to first. + * This flag only applies to state-table based + * 'kerx' subtables (types 1 and 4). */ + Reserved = 0x0FFFFF00, /* Reserved, set to zero. */ + SubtableType = 0x000000FF, /* Subtable type. */ + }; + + template + inline typename context_t::return_t dispatch (context_t *c) const + { + unsigned int subtable_type = get_type (); + TRACE_DISPATCH (this, subtable_type); + switch (subtable_type) { + case 0 : return_trace (c->dispatch (u.format0)); + case 1 : return_trace (c->dispatch (u.format1)); + case 2 : return_trace (c->dispatch (u.format2)); + case 4 : return_trace (c->dispatch (u.format4)); + case 6 : return_trace (c->dispatch (u.format6)); + default: return_trace (c->default_return_value ()); + } } - inline unsigned int get_size (void) const { return length; } - inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - if (unlikely (!c->check_struct (this))) + if (!u.header.sanitize (c) || + !c->check_range (this, u.header.length)) return_trace (false); - switch (format) { - case 0: return u.format0.sanitize (c); - case 1: return u.format1.sanitize (c); - case 2: return u.format2.sanitize (c); - case 4: return u.format4.sanitize (c); - case 6: return u.format6.sanitize (c); - default:return_trace (false); - } + return_trace (dispatch (c)); } protected: - HBUINT32 length; - HBUINT8 coverage; - HBUINT16 unused; - HBUINT8 format; - HBUINT32 tupleIndex; union { + KerxSubTableHeader header; KerxSubTableFormat0 format0; KerxSubTableFormat1 format1; KerxSubTableFormat2 format2; @@ -273,71 +622,91 @@ public: DEFINE_SIZE_MIN (12); }; -struct SubtableGlyphCoverageArray -{ - inline bool sanitize (hb_sanitize_context_t *c) const - { - TRACE_SANITIZE (this); - return_trace (likely (c->check_struct (this))); - } - protected: - HBUINT32 length; - HBUINT32 coverage; - HBUINT32 tupleCount; - public: - DEFINE_SIZE_STATIC (12); -}; +/* + * The 'kerx' Table + */ struct kerx { static const hb_tag_t tableTag = HB_AAT_TAG_kerx; - inline bool apply (hb_aat_apply_context_t *c, const AAT::ankr *ankr) const + inline bool has_data (void) const { return version != 0; } + + inline void apply (hb_aat_apply_context_t *c) const { - TRACE_APPLY (this); - const KerxTable &table = StructAfter (*this); - return_trace (table.apply (c, ankr)); + c->set_lookup_index (0); + const KerxTable *table = &firstTable; + unsigned int count = tableCount; + for (unsigned int i = 0; i < count; i++) + { + bool reverse; + + if (table->u.header.coverage & (KerxTable::CrossStream | KerxTable::Variation) || + table->u.header.tupleCount) + goto skip; /* We do NOT handle cross-stream or variation kerning. */ + + if (HB_DIRECTION_IS_VERTICAL (c->buffer->props.direction) != + bool (table->u.header.coverage & KerxTable::Vertical)) + goto skip; + + reverse = bool (table->u.header.coverage & KerxTable::Backwards) != + HB_DIRECTION_IS_BACKWARD (c->buffer->props.direction); + + if (!c->buffer->message (c->font, "start kerx subtable %d", c->lookup_index)) + goto skip; + + if (reverse) + c->buffer->reverse (); + + c->sanitizer.set_object (*table); + + /* XXX Reverse-kern is not working yet... + * hb_kern_machine_t would need to know that it's reverse-kerning. + * Or better yet, make it work in reverse as well, so we don't have + * to reverse and reverse back? */ + table->dispatch (c); + + if (reverse) + c->buffer->reverse (); + + (void) c->buffer->message (c->font, "end kerx subtable %d", c->lookup_index); + + skip: + table = &StructAfter (*table); + } } inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - if (unlikely (!(c->check_struct (this)))) - return_trace (false); - - /* TODO: Something like `morx`s ChainSubtable should be done here instead */ - const KerxTable *table = &StructAfter (*this); - if (unlikely (!(table->sanitize (c)))) + if (!version.sanitize (c) || version < 2 || + !tableCount.sanitize (c)) return_trace (false); - for (unsigned int i = 0; i < nTables - 1; ++i) + const KerxTable *table = &firstTable; + unsigned int count = tableCount; + for (unsigned int i = 0; i < count; i++) { + if (!table->sanitize (c)) + return_trace (false); table = &StructAfter (*table); - if (unlikely (!(table->sanitize (c)))) - return_trace (false); } - // If version is less than 3, we are done here; otherwise better to check footer also - if (version < 3) - return_trace (true); - - // TODO: Investigate why this just work on some fonts no matter of version - // const SubtableGlyphCoverageArray &footer = - // StructAfter (*table); - // return_trace (footer.sanitize (c)); - return_trace (true); } protected: - HBUINT16 version; - HBUINT16 padding; - HBUINT32 nTables; -/*KerxTable tablesZ[VAR]; XXX ArrayOf??? */ -/*SubtableGlyphCoverageArray coverage_array;*/ + HBUINT16 version; /* The version number of the extended kerning table + * (currently 2, 3, or 4). */ + HBUINT16 unused; /* Set to 0. */ + HBUINT32 tableCount; /* The number of subtables included in the extended kerning + * table. */ + KerxTable firstTable; /* Subtables. */ +/*subtableGlyphCoverageArray*/ /* Only if version >= 3. We don't use. */ + public: - DEFINE_SIZE_STATIC (8); + DEFINE_SIZE_MIN (8); }; } /* namespace AAT */ 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 ef452e22b29..651af2188fd 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 @@ -50,7 +50,8 @@ struct RearrangementSubtable struct driver_context_t { static const bool in_place = true; - enum Flags { + enum Flags + { MarkFirst = 0x8000, /* If set, make the current glyph the first * glyph to be rearranged. */ DontAdvance = 0x4000, /* If set, don't advance to the next glyph @@ -163,7 +164,7 @@ struct RearrangementSubtable driver_context_t dc (this); - StateTableDriver driver (machine, c->buffer, c->face); + StateTableDriver driver (machine, c->buffer, c->face); driver.drive (&dc); return_trace (dc.ret); @@ -196,7 +197,8 @@ struct ContextualSubtable struct driver_context_t { static const bool in_place = true; - enum Flags { + enum Flags + { SetMark = 0x8000, /* If set, make the current glyph the marked glyph. */ DontAdvance = 0x4000, /* If set, don't advance to the next glyph before * going to the new state. */ @@ -268,7 +270,7 @@ struct ContextualSubtable private: bool mark_set; unsigned int mark; - const UnsizedOffsetListOf, HBUINT32> &subs; + const UnsizedOffsetListOf, HBUINT32, false> &subs; }; inline bool apply (hb_aat_apply_context_t *c) const @@ -309,7 +311,7 @@ struct ContextualSubtable protected: StateTable machine; - LOffsetTo, HBUINT32> > + LOffsetTo, HBUINT32, false>, false> substitutionTables; public: DEFINE_SIZE_STATIC (20); @@ -329,7 +331,8 @@ struct LigatureSubtable struct driver_context_t { static const bool in_place = false; - enum Flags { + enum Flags + { SetComponent = 0x8000, /* Push this glyph onto the component stack for * eventual processing. */ DontAdvance = 0x4000, /* Leave the glyph pointer at this glyph for the @@ -338,7 +341,8 @@ struct LigatureSubtable * group. */ Reserved = 0x1FFF, /* These bits are reserved and should be set to 0. */ }; - enum LigActionFlags { + enum LigActionFlags + { LigActionLast = 0x80000000, /* This is the last action in the list. This also * implies storage. */ LigActionStore = 0x40000000, /* Store the ligature at the current cumulated index @@ -361,7 +365,7 @@ struct LigatureSubtable inline bool is_actionable (StateTableDriver *driver, const Entry *entry) { - return !!(entry->flags & PerformAction); + return entry->flags & PerformAction; } inline bool transition (StateTableDriver *driver, const Entry *entry) @@ -387,12 +391,20 @@ struct LigatureSubtable unsigned int action_idx = entry->data.ligActionIndex; unsigned int action; unsigned int ligature_idx = 0; + + if (unlikely (!match_length)) + return true; + + /* TODO Only when ligation happens? */ + buffer->merge_out_clusters (match_positions[0], buffer->out_len); + + unsigned int cursor = match_length; do { - if (unlikely (!match_length)) - return false; + if (unlikely (!cursor)) + break; - buffer->move_to (match_positions[--match_length]); + buffer->move_to (match_positions[--cursor]); const HBUINT32 &actionData = ligAction[action_idx]; if (unlikely (!actionData.sanitize (&c->sanitizer))) return false; @@ -400,8 +412,10 @@ struct LigatureSubtable uint32_t uoffset = action & LigActionOffset; if (uoffset & 0x20000000) - uoffset += 0xC0000000; + uoffset |= 0xC0000000; /* Sign-extend. */ int32_t offset = (int32_t) uoffset; + if (buffer->idx >= buffer->len) + return false; // TODO Work on previous instead? unsigned int component_idx = buffer->cur().codepoint + offset; const HBUINT16 &componentData = component[component_idx]; @@ -414,21 +428,21 @@ struct LigatureSubtable if (unlikely (!ligatureData.sanitize (&c->sanitizer))) return false; hb_codepoint_t lig = ligatureData; - match_positions[match_length++] = buffer->out_len; buffer->replace_glyph (lig); - //ligature_idx = 0; // XXX Yes or no? - } - else - { - buffer->skip_glyph (); - end--; + /* Now go and delete all subsequent components. */ + while (match_length - 1 > cursor) + { + buffer->move_to (match_positions[--match_length]); + buffer->skip_glyph (); + end--; + } } - /* TODO merge_clusters / unsafe_to_break */ action_idx++; } while (!(action & LigActionLast)); + match_length = 0; buffer->move_to (end); } @@ -469,11 +483,11 @@ struct LigatureSubtable protected: StateTable machine; - LOffsetTo > + LOffsetTo, false> ligAction; /* Offset to the ligature action table. */ - LOffsetTo > + LOffsetTo, false> component; /* Offset to the component table. */ - LOffsetTo > + LOffsetTo, false> ligature; /* Offset to the actual ligature lists. */ public: DEFINE_SIZE_STATIC (28); @@ -517,19 +531,201 @@ struct NoncontextualSubtable struct InsertionSubtable { + struct EntryData + { + HBUINT16 currentInsertIndex; /* Zero-based index into the insertion glyph table. + * The number of glyphs to be inserted is contained + * in the currentInsertCount field in the flags. + * A value of 0xFFFF indicates no insertion is to + * be done. */ + HBUINT16 markedInsertIndex; /* Zero-based index into the insertion glyph table. + * The number of glyphs to be inserted is contained + * in the markedInsertCount field in the flags. + * A value of 0xFFFF indicates no insertion is to + * be done. */ + public: + DEFINE_SIZE_STATIC (4); + }; + + struct driver_context_t + { + static const bool in_place = false; + enum Flags + { + SetMark = 0x8000, /* If set, mark the current glyph. */ + DontAdvance = 0x4000, /* If set, don't advance to the next glyph before + * going to the new state. This does not mean + * that the glyph pointed to is the same one as + * before. If you've made insertions immediately + * downstream of the current glyph, the next glyph + * processed would in fact be the first one + * inserted. */ + CurrentIsKashidaLike= 0x2000, /* If set, and the currentInsertList is nonzero, + * then the specified glyph list will be inserted + * as a kashida-like insertion, either before or + * after the current glyph (depending on the state + * of the currentInsertBefore flag). If clear, and + * the currentInsertList is nonzero, then the + * specified glyph list will be inserted as a + * split-vowel-like insertion, either before or + * after the current glyph (depending on the state + * of the currentInsertBefore flag). */ + MarkedIsKashidaLike= 0x1000, /* If set, and the markedInsertList is nonzero, + * then the specified glyph list will be inserted + * as a kashida-like insertion, either before or + * after the marked glyph (depending on the state + * of the markedInsertBefore flag). If clear, and + * the markedInsertList is nonzero, then the + * specified glyph list will be inserted as a + * split-vowel-like insertion, either before or + * after the marked glyph (depending on the state + * of the markedInsertBefore flag). */ + CurrentInsertBefore= 0x0800, /* If set, specifies that insertions are to be made + * to the left of the current glyph. If clear, + * they're made to the right of the current glyph. */ + MarkedInsertBefore= 0x0400, /* If set, specifies that insertions are to be + * made to the left of the marked glyph. If clear, + * they're made to the right of the marked glyph. */ + CurrentInsertCount= 0x3E0, /* This 5-bit field is treated as a count of the + * number of glyphs to insert at the current + * position. Since zero means no insertions, the + * largest number of insertions at any given + * current location is 31 glyphs. */ + MarkedInsertCount= 0x001F, /* This 5-bit field is treated as a count of the + * number of glyphs to insert at the marked + * position. Since zero means no insertions, the + * largest number of insertions at any given + * marked location is 31 glyphs. */ + }; + + inline driver_context_t (const InsertionSubtable *table, + hb_aat_apply_context_t *c_) : + ret (false), + c (c_), + mark_set (false), + mark (0), + insertionAction (table+table->insertionAction) {} + + inline bool is_actionable (StateTableDriver *driver, + const Entry *entry) + { + return (entry->flags & (CurrentInsertCount | MarkedInsertCount)) && + (entry->data.currentInsertIndex != 0xFFFF ||entry->data.markedInsertIndex != 0xFFFF); + } + inline bool transition (StateTableDriver *driver, + const Entry *entry) + { + hb_buffer_t *buffer = driver->buffer; + unsigned int flags = entry->flags; + + if (entry->data.markedInsertIndex != 0xFFFF && mark_set) + { + unsigned int count = (flags & MarkedInsertCount); + unsigned int start = entry->data.markedInsertIndex; + const GlyphID *glyphs = &insertionAction[start]; + if (unlikely (!c->sanitizer.check_array (glyphs, count))) return false; + + bool before = flags & MarkedInsertBefore; + + unsigned int end = buffer->out_len; + buffer->move_to (mark); + + if (buffer->idx < buffer->len && !before) + buffer->copy_glyph (); + /* TODO We ignore KashidaLike setting. */ + for (unsigned int i = 0; i < count; i++) + buffer->output_glyph (glyphs[i]); + if (buffer->idx < buffer->len && !before) + buffer->skip_glyph (); + + buffer->move_to (end + count); + + buffer->unsafe_to_break_from_outbuffer (mark, MIN (buffer->idx + 1, buffer->len)); + } + + if (entry->data.currentInsertIndex != 0xFFFF) + { + unsigned int count = (flags & CurrentInsertCount) >> 5; + unsigned int start = entry->data.currentInsertIndex; + const GlyphID *glyphs = &insertionAction[start]; + if (unlikely (!c->sanitizer.check_array (glyphs, count))) return false; + + bool before = flags & CurrentInsertBefore; + + unsigned int end = buffer->out_len; + + if (buffer->idx < buffer->len && !before) + buffer->copy_glyph (); + /* TODO We ignore KashidaLike setting. */ + for (unsigned int i = 0; i < count; i++) + buffer->output_glyph (glyphs[i]); + if (buffer->idx < buffer->len && !before) + buffer->skip_glyph (); + + /* Humm. Not sure where to move to. There's this wording under + * DontAdvance flag: + * + * "If set, don't update the glyph index before going to the new state. + * This does not mean that the glyph pointed to is the same one as + * before. If you've made insertions immediately downstream of the + * current glyph, the next glyph processed would in fact be the first + * one inserted." + * + * This suggests that if DontAdvance is NOT set, we should move to + * end+count. If it *was*, then move to end, such that newly inserted + * glyphs are now visible. + * + * https://github.com/harfbuzz/harfbuzz/issues/1224#issuecomment-427691417 + */ + buffer->move_to ((flags & DontAdvance) ? end : end + count); + } + + if (flags & SetMark) + { + mark_set = true; + mark = buffer->out_len; + } + + return true; + } + + public: + bool ret; + private: + hb_aat_apply_context_t *c; + bool mark_set; + unsigned int mark; + const UnsizedArrayOf &insertionAction; + }; + inline bool apply (hb_aat_apply_context_t *c) const { TRACE_APPLY (this); - /* TODO */ - return_trace (false); + + driver_context_t dc (this, c); + + StateTableDriver driver (machine, c->buffer, c->face); + driver.drive (&dc); + + return_trace (dc.ret); } inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - /* TODO */ - return_trace (true); + /* The rest of array sanitizations are done at run-time. */ + return_trace (c->check_struct (this) && machine.sanitize (c) && + insertionAction); } + + protected: + StateTable + machine; + LOffsetTo, false> + insertionAction; /* Byte offset from stateHeader to the start of + * the insertion glyph table. */ + public: + DEFINE_SIZE_STATIC (20); }; @@ -559,9 +755,27 @@ struct ChainSubtable friend struct Chain; inline unsigned int get_size (void) const { return length; } - inline unsigned int get_type (void) const { return coverage & 0xFF; } + inline unsigned int get_type (void) const { return coverage & SubtableType; } - enum Type { + enum Coverage + { + Vertical = 0x80000000, /* If set, this subtable will only be applied + * to vertical text. If clear, this subtable + * will only be applied to horizontal text. */ + Backwards = 0x40000000, /* If set, this subtable will process glyphs + * in descending order. If clear, it will + * process the glyphs in ascending order. */ + AllDirections = 0x20000000, /* If set, this subtable will be applied to + * both horizontal and vertical text (i.e. + * the state of bit 0x80000000 is ignored). */ + Logical = 0x10000000, /* If set, this subtable will process glyphs + * in logical order (or reverse logical order, + * depending on the value of bit 0x80000000). */ + Reserved = 0x0FFFFF00, /* Reserved, set to zero. */ + SubtableType = 0x000000FF, /* Subtable type; see following table. */ + }; + enum Type + { Rearrangement = 0, Contextual = 1, Ligature = 2, @@ -569,11 +783,6 @@ struct ChainSubtable Insertion = 5 }; - inline void apply (hb_aat_apply_context_t *c) const - { - dispatch (c); - } - template inline typename context_t::return_t dispatch (context_t *c) const { @@ -619,28 +828,94 @@ struct Chain { inline void apply (hb_aat_apply_context_t *c) const { - const ChainSubtable *subtable = &StructAtOffset (featureZ, featureZ[0].static_size * featureCount); + uint32_t flags = defaultFlags; + { + /* Compute applicable flags. TODO Should move this to planning + * stage and take user-requested features into account. */ + unsigned int count = featureCount; + for (unsigned i = 0; i < count; i++) + { + const Feature &feature = featureZ[i]; + if (false) /* XXX Check if feature enabled... */ + { + flags &= feature.disableFlags; + flags |= feature.enableFlags; + } + } + } + + const ChainSubtable *subtable = &StructAtOffset (&featureZ, featureZ[0].static_size * featureCount); unsigned int count = subtableCount; for (unsigned int i = 0; i < count; i++) { + bool reverse; + + if (!(subtable->subFeatureFlags & flags)) + goto skip; + + if (!(subtable->coverage & ChainSubtable::AllDirections) && + HB_DIRECTION_IS_VERTICAL (c->buffer->props.direction) != + bool (subtable->coverage & ChainSubtable::Vertical)) + goto skip; + + /* Buffer contents is always in logical direction. Determine if + * we need to reverse before applying this subtable. We reverse + * back after if we did reverse indeed. + * + * Quoting the spac: + * """ + * Bits 28 and 30 of the coverage field control the order in which + * glyphs are processed when the subtable is run by the layout engine. + * Bit 28 is used to indicate if the glyph processing direction is + * the same as logical order or layout order. Bit 30 is used to + * indicate whether glyphs are processed forwards or backwards within + * that order. + + Bit 30 Bit 28 Interpretation for Horizontal Text + 0 0 The subtable is processed in layout order + (the same order as the glyphs, which is + always left-to-right). + 1 0 The subtable is processed in reverse layout order + (the order opposite that of the glyphs, which is + always right-to-left). + 0 1 The subtable is processed in logical order + (the same order as the characters, which may be + left-to-right or right-to-left). + 1 1 The subtable is processed in reverse logical order + (the order opposite that of the characters, which + may be right-to-left or left-to-right). + */ + reverse = subtable->coverage & ChainSubtable::Logical ? + bool (subtable->coverage & ChainSubtable::Backwards) : + bool (subtable->coverage & ChainSubtable::Backwards) != + HB_DIRECTION_IS_BACKWARD (c->buffer->props.direction); + if (!c->buffer->message (c->font, "start chain subtable %d", c->lookup_index)) - { - c->set_lookup_index (c->lookup_index + 1); - continue; - } + goto skip; - subtable->apply (c); - subtable = &StructAfter (*subtable); + if (reverse) + c->buffer->reverse (); + + c->sanitizer.set_object (*subtable); + + subtable->dispatch (c); + + if (reverse) + c->buffer->reverse (); (void) c->buffer->message (c->font, "end chain subtable %d", c->lookup_index); + if (unlikely (!c->buffer->successful)) return; + + skip: + subtable = &StructAfter (*subtable); c->set_lookup_index (c->lookup_index + 1); } } inline unsigned int get_size (void) const { return length; } - inline bool sanitize (hb_sanitize_context_t *c, unsigned int major) const + inline bool sanitize (hb_sanitize_context_t *c, unsigned int version) const { TRACE_SANITIZE (this); if (!length.sanitize (c) || @@ -648,10 +923,10 @@ struct Chain !c->check_range (this, length)) return_trace (false); - if (!c->check_array (featureZ, featureZ[0].static_size, featureCount)) + if (!c->check_array (featureZ.arrayZ, featureCount)) return_trace (false); - const ChainSubtable *subtable = &StructAtOffset (featureZ, featureZ[0].static_size * featureCount); + const ChainSubtable *subtable = &StructAtOffset (&featureZ, featureZ[0].static_size * featureCount); unsigned int count = subtableCount; for (unsigned int i = 0; i < count; i++) { @@ -669,9 +944,9 @@ struct Chain HBUINT32 featureCount; /* Number of feature subtable entries. */ HBUINT32 subtableCount; /* The number of subtables in the chain. */ - Feature featureZ[VAR]; /* Features. */ -/*ChainSubtable subtableX[VAR];*//* Subtables. */ -/*subtableGlyphCoverageArray*/ /* Only if major == 3. */ + UnsizedArrayOf featureZ; /* Features. */ +/*ChainSubtable firstSubtable;*//* Subtables. */ +/*subtableGlyphCoverageArray*/ /* Only if version >= 3. We don't use. */ public: DEFINE_SIZE_MIN (16); @@ -679,21 +954,25 @@ struct Chain /* - * The 'mort'/'morx' Tables + * The 'morx' Table */ struct morx { static const hb_tag_t tableTag = HB_AAT_TAG_morx; + inline bool has_data (void) const { return version != 0; } + inline void apply (hb_aat_apply_context_t *c) const { + if (unlikely (!c->buffer->successful)) return; c->set_lookup_index (0); - const Chain *chain = chainsZ; + const Chain *chain = &firstChain; unsigned int count = chainCount; for (unsigned int i = 0; i < count; i++) { chain->apply (c); + if (unlikely (!c->buffer->successful)) return; chain = &StructAfter (*chain); } } @@ -701,16 +980,15 @@ struct morx inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - if (!version.sanitize (c) || - (version.major >> (sizeof (HBUINT32) == 4 ? 1 : 0)) != 1 || + if (!version.sanitize (c) || version < 2 || !chainCount.sanitize (c)) return_trace (false); - const Chain *chain = chainsZ; + const Chain *chain = &firstChain; unsigned int count = chainCount; for (unsigned int i = 0; i < count; i++) { - if (!chain->sanitize (c, version.major)) + if (!chain->sanitize (c, version)) return_trace (false); chain = &StructAfter (*chain); } @@ -719,11 +997,12 @@ struct morx } protected: - FixedVersion<>version; /* Version number of the glyph metamorphosis table. - * 1 for mort, 2 or 3 for morx. */ + HBUINT16 version; /* Version number of the glyph metamorphosis table. + * 2 or 3. */ + HBUINT16 unused; /* Set to 0. */ HBUINT32 chainCount; /* Number of metamorphosis chains contained in this * table. */ - Chain chainsZ[VAR]; /* Chains. */ + Chain firstChain; /* Chains. */ public: DEFINE_SIZE_MIN (8); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-trak-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-trak-table.hh index c4bec2cab64..4b4bc2ffeee 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-trak-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-trak-table.hh @@ -46,29 +46,33 @@ struct TrackTableEntry { friend struct TrackData; - inline bool sanitize (hb_sanitize_context_t *c, const void *base, - unsigned int size) const + inline float get_track_value () const { - TRACE_SANITIZE (this); - return_trace (likely (c->check_struct (this) && - (valuesZ.sanitize (c, base, size)))); + return track.to_float (); } - private: - inline float get_track_value () const + inline int get_value (const void *base, + unsigned int index, + unsigned int nSizes) const { - return track.to_float (); + return hb_array_t ((base+valuesZ).arrayZ, nSizes)[index]; } - inline int get_value (const void *base, unsigned int index) const + public: + inline bool sanitize (hb_sanitize_context_t *c, const void *base, + unsigned int nSizes) const { - return (base+valuesZ)[index]; + TRACE_SANITIZE (this); + return_trace (likely (c->check_struct (this) && + (valuesZ.sanitize (c, base, nSizes)))); } protected: Fixed track; /* Track value for this record. */ - NameID trackNameID; /* The 'name' table index for this track */ - OffsetTo > + NameID trackNameID; /* The 'name' table index for this track. + * (a short word or phrase like "loose" + * or "very tight") */ + OffsetTo, HBUINT16, false> valuesZ; /* Offset from start of tracking table to * per-size tracking values for this track. */ @@ -78,15 +82,22 @@ struct TrackTableEntry struct TrackData { - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + inline float interpolate_at (unsigned int idx, + float target_size, + const TrackTableEntry &trackTableEntry, + const void *base) const { - TRACE_SANITIZE (this); - return_trace (c->check_struct (this) && - sizeTable.sanitize (c, base, nSizes) && - trackTable.sanitize (c, nTracks, base, nSizes)); + unsigned int sizes = nSizes; + hb_array_t size_table ((base+sizeTable).arrayZ, sizes); + + float s0 = size_table[idx].to_float (); + float s1 = size_table[idx + 1].to_float (); + float t = unlikely (s0 == s1) ? 0.f : (target_size - s0) / (s1 - s0); + return t * trackTableEntry.get_value (base, idx + 1, sizes) + + (1.f - t) * trackTableEntry.get_value (base, idx, sizes); } - inline float get_tracking (const void *base, float ptem) const + inline int get_tracking (const void *base, float ptem) const { /* CoreText points are CSS pixels (96 per inch), * NOT typographic points (72 per inch). @@ -94,48 +105,59 @@ struct TrackData * https://developer.apple.com/library/content/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html */ float csspx = ptem * 96.f / 72.f; - Fixed fixed_size; - fixed_size.set_float (csspx); - /* XXX Clean this up. Make it work with nSizes==1 and 0. */ + /* + * Choose track. + */ + const TrackTableEntry *trackTableEntry = nullptr; + unsigned int count = nTracks; + for (unsigned int i = 0; i < count; i++) + { + /* Note: Seems like the track entries are sorted by values. But the + * spec doesn't explicitly say that. It just mentions it in the example. */ - unsigned int sizes = nSizes; + /* For now we only seek for track entries with zero tracking value */ - const TrackTableEntry *trackTableEntry = nullptr; - for (unsigned int i = 0; i < sizes; ++i) - // For now we only seek for track entries with zero tracking value if (trackTable[i].get_track_value () == 0.f) - trackTableEntry = &trackTable[0]; - - // We couldn't match any, exit + { + trackTableEntry = &trackTable[i]; + break; + } + } if (!trackTableEntry) return 0.; + /* + * Choose size. + */ + unsigned int sizes = nSizes; + if (!sizes) return 0.; + if (sizes == 1) return trackTableEntry->get_value (base, 0, sizes); + /* TODO bfind() */ + hb_array_t size_table ((base+sizeTable).arrayZ, sizes); unsigned int size_index; - UnsizedArrayOf size_table = base+sizeTable; - for (size_index = 0; size_index < sizes; ++size_index) - if (size_table[size_index] >= fixed_size) + for (size_index = 0; size_index < sizes; size_index++) + if (size_table[size_index].to_float () >= csspx) break; - // TODO(ebraminio): We don't attempt to extrapolate to larger or - // smaller values for now but we should do, per spec - if (size_index == sizes) - return trackTableEntry->get_value (base, sizes - 1); - if (size_index == 0 || size_table[size_index] == fixed_size) - return trackTableEntry->get_value (base, size_index); - - float s0 = size_table[size_index - 1].to_float (); - float s1 = size_table[size_index].to_float (); - float t = (csspx - s0) / (s1 - s0); - return (float) t * trackTableEntry->get_value (base, size_index) + - ((float) 1.0 - t) * trackTableEntry->get_value (base, size_index - 1); + return round (interpolate_at (size_index ? size_index - 1 : 0, csspx, + *trackTableEntry, base)); + } + + inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && + sizeTable.sanitize (c, base, nSizes) && + trackTable.sanitize (c, nTracks, base, nSizes)); } protected: HBUINT16 nTracks; /* Number of separate tracks included in this table. */ HBUINT16 nSizes; /* Number of point sizes included in this table. */ - LOffsetTo > - sizeTable; /* Offset to array[nSizes] of size values. */ + LOffsetTo, false> + sizeTable; /* Offset from start of the tracking table to + * Array[nSizes] of size values.. */ UnsizedArrayOf trackTable; /* Array[nTracks] of TrackTableEntry records. */ @@ -147,6 +169,8 @@ struct trak { static const hb_tag_t tableTag = HB_AAT_TAG_trak; + inline bool has_data (void) const { return version.to_int () != 0; } + inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); @@ -168,25 +192,25 @@ struct trak if (HB_DIRECTION_IS_HORIZONTAL (buffer->props.direction)) { const TrackData &trackData = this+horizData; - float tracking = trackData.get_tracking (this, ptem); - hb_position_t advance_to_add = c->font->em_scalef_x (tracking / 2); + int tracking = trackData.get_tracking (this, ptem); + hb_position_t offset_to_add = c->font->em_scalef_x (tracking / 2); + hb_position_t advance_to_add = c->font->em_scalef_x (tracking); foreach_grapheme (buffer, start, end) { - buffer->pos[start].x_offset += advance_to_add; buffer->pos[start].x_advance += advance_to_add; - buffer->pos[end].x_advance += advance_to_add; + buffer->pos[start].x_offset += offset_to_add; } } else { const TrackData &trackData = this+vertData; - float tracking = trackData.get_tracking (this, ptem); - hb_position_t advance_to_add = c->font->em_scalef_y (tracking / 2); + int tracking = trackData.get_tracking (this, ptem); + hb_position_t offset_to_add = c->font->em_scalef_y (tracking / 2); + hb_position_t advance_to_add = c->font->em_scalef_y (tracking); foreach_grapheme (buffer, start, end) { - buffer->pos[start].y_offset += advance_to_add; buffer->pos[start].y_advance += advance_to_add; - buffer->pos[end].y_advance += advance_to_add; + buffer->pos[start].y_offset += offset_to_add; } } @@ -194,15 +218,17 @@ struct trak } protected: - FixedVersion<> version; /* Version of the tracking table--currently - * 0x00010000u for version 1.0. */ - HBUINT16 format; /* Format of the tracking table */ - OffsetTo horizData; /* TrackData for horizontal text */ - OffsetTo vertData; /* TrackData for vertical text */ + FixedVersion<> version; /* Version of the tracking table + * (0x00010000u for version 1.0). */ + HBUINT16 format; /* Format of the tracking table (set to 0). */ + OffsetTo horizData; /* Offset from start of tracking table to TrackData + * for horizontal text (or 0 if none). */ + OffsetTo vertData; /* Offset from start of tracking table to TrackData + * for vertical text (or 0 if none). */ HBUINT16 reserved; /* Reserved. Set to 0. */ public: - DEFINE_SIZE_MIN (12); + DEFINE_SIZE_STATIC (12); }; } /* namespace AAT */ 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 a5e36a40a38..e9da850b390 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 @@ -36,8 +36,101 @@ #include "hb-aat-layout-trak-table.hh" #include "hb-aat-ltag-table.hh" // Just so we compile it; unused otherwise. + +/* Table data courtesy of Apple. Converted from mnemonics to integers + * when moving to this file. */ +static const hb_aat_feature_mapping_t feature_mappings[] = +{ + {HB_TAG ('c','2','p','c'), 38/*kUpperCaseType*/, 2/*kUpperCasePetiteCapsSelector*/, 0/*kDefaultUpperCaseSelector*/}, + {HB_TAG ('c','2','s','c'), 38/*kUpperCaseType*/, 1/*kUpperCaseSmallCapsSelector*/, 0/*kDefaultUpperCaseSelector*/}, + {HB_TAG ('c','a','l','t'), 36/*kContextualAlternatesType*/, 0/*kContextualAlternatesOnSelector*/, 1/*kContextualAlternatesOffSelector*/}, + {HB_TAG ('c','a','s','e'), 33/*kCaseSensitiveLayoutType*/, 0/*kCaseSensitiveLayoutOnSelector*/, 1/*kCaseSensitiveLayoutOffSelector*/}, + {HB_TAG ('c','l','i','g'), 1/*kLigaturesType*/, 18/*kContextualLigaturesOnSelector*/, 19/*kContextualLigaturesOffSelector*/}, + {HB_TAG ('c','p','s','p'), 33/*kCaseSensitiveLayoutType*/, 2/*kCaseSensitiveSpacingOnSelector*/, 3/*kCaseSensitiveSpacingOffSelector*/}, + {HB_TAG ('c','s','w','h'), 36/*kContextualAlternatesType*/, 4/*kContextualSwashAlternatesOnSelector*/, 5/*kContextualSwashAlternatesOffSelector*/}, + {HB_TAG ('d','l','i','g'), 1/*kLigaturesType*/, 4/*kRareLigaturesOnSelector*/, 5/*kRareLigaturesOffSelector*/}, + {HB_TAG ('e','x','p','t'), 20/*kCharacterShapeType*/, 10/*kExpertCharactersSelector*/, 16}, + {HB_TAG ('f','r','a','c'), 11/*kFractionsType*/, 2/*kDiagonalFractionsSelector*/, 0/*kNoFractionsSelector*/}, + {HB_TAG ('f','w','i','d'), 22/*kTextSpacingType*/, 1/*kMonospacedTextSelector*/, 7}, + {HB_TAG ('h','a','l','t'), 22/*kTextSpacingType*/, 6/*kAltHalfWidthTextSelector*/, 7}, + {HB_TAG ('h','i','s','t'), 1/*kLigaturesType*/, 20/*kHistoricalLigaturesOnSelector*/, 21/*kHistoricalLigaturesOffSelector*/}, + {HB_TAG ('h','k','n','a'), 34/*kAlternateKanaType*/, 0/*kAlternateHorizKanaOnSelector*/, 1/*kAlternateHorizKanaOffSelector*/, }, + {HB_TAG ('h','l','i','g'), 1/*kLigaturesType*/, 20/*kHistoricalLigaturesOnSelector*/, 21/*kHistoricalLigaturesOffSelector*/}, + {HB_TAG ('h','n','g','l'), 23/*kTransliterationType*/, 1/*kHanjaToHangulSelector*/, 0/*kNoTransliterationSelector*/}, + {HB_TAG ('h','o','j','o'), 20/*kCharacterShapeType*/, 12/*kHojoCharactersSelector*/, 16}, + {HB_TAG ('h','w','i','d'), 22/*kTextSpacingType*/, 2/*kHalfWidthTextSelector*/, 7}, + {HB_TAG ('i','t','a','l'), 32/*kItalicCJKRomanType*/, 2/*kCJKItalicRomanOnSelector*/, 3/*kCJKItalicRomanOffSelector*/}, + {HB_TAG ('j','p','0','4'), 20/*kCharacterShapeType*/, 11/*kJIS2004CharactersSelector*/, 16}, + {HB_TAG ('j','p','7','8'), 20/*kCharacterShapeType*/, 2/*kJIS1978CharactersSelector*/, 16}, + {HB_TAG ('j','p','8','3'), 20/*kCharacterShapeType*/, 3/*kJIS1983CharactersSelector*/, 16}, + {HB_TAG ('j','p','9','0'), 20/*kCharacterShapeType*/, 4/*kJIS1990CharactersSelector*/, 16}, + {HB_TAG ('l','i','g','a'), 1/*kLigaturesType*/, 2/*kCommonLigaturesOnSelector*/, 3/*kCommonLigaturesOffSelector*/}, + {HB_TAG ('l','n','u','m'), 21/*kNumberCaseType*/, 1/*kUpperCaseNumbersSelector*/, 2}, + {HB_TAG ('m','g','r','k'), 15/*kMathematicalExtrasType*/, 10/*kMathematicalGreekOnSelector*/, 11/*kMathematicalGreekOffSelector*/}, + {HB_TAG ('n','l','c','k'), 20/*kCharacterShapeType*/, 13/*kNLCCharactersSelector*/, 16}, + {HB_TAG ('o','n','u','m'), 21/*kNumberCaseType*/, 0/*kLowerCaseNumbersSelector*/, 2}, + {HB_TAG ('o','r','d','n'), 10/*kVerticalPositionType*/, 3/*kOrdinalsSelector*/, 0/*kNormalPositionSelector*/}, + {HB_TAG ('p','a','l','t'), 22/*kTextSpacingType*/, 5/*kAltProportionalTextSelector*/, 7}, + {HB_TAG ('p','c','a','p'), 37/*kLowerCaseType*/, 2/*kLowerCasePetiteCapsSelector*/, 0/*kDefaultLowerCaseSelector*/}, + {HB_TAG ('p','k','n','a'), 22/*kTextSpacingType*/, 0/*kProportionalTextSelector*/, 7}, + {HB_TAG ('p','n','u','m'), 6/*kNumberSpacingType*/, 1/*kProportionalNumbersSelector*/, 4}, + {HB_TAG ('p','w','i','d'), 22/*kTextSpacingType*/, 0/*kProportionalTextSelector*/, 7}, + {HB_TAG ('q','w','i','d'), 22/*kTextSpacingType*/, 4/*kQuarterWidthTextSelector*/, 7}, + {HB_TAG ('r','u','b','y'), 28/*kRubyKanaType*/, 2/*kRubyKanaOnSelector*/, 3/*kRubyKanaOffSelector*/}, + {HB_TAG ('s','i','n','f'), 10/*kVerticalPositionType*/, 4/*kScientificInferiorsSelector*/, 0/*kNormalPositionSelector*/}, + {HB_TAG ('s','m','c','p'), 37/*kLowerCaseType*/, 1/*kLowerCaseSmallCapsSelector*/, 0/*kDefaultLowerCaseSelector*/}, + {HB_TAG ('s','m','p','l'), 20/*kCharacterShapeType*/, 1/*kSimplifiedCharactersSelector*/, 16}, + {HB_TAG ('s','s','0','1'), 35/*kStylisticAlternativesType*/, 2/*kStylisticAltOneOnSelector*/, 3/*kStylisticAltOneOffSelector*/}, + {HB_TAG ('s','s','0','2'), 35/*kStylisticAlternativesType*/, 4/*kStylisticAltTwoOnSelector*/, 5/*kStylisticAltTwoOffSelector*/}, + {HB_TAG ('s','s','0','3'), 35/*kStylisticAlternativesType*/, 6/*kStylisticAltThreeOnSelector*/, 7/*kStylisticAltThreeOffSelector*/}, + {HB_TAG ('s','s','0','4'), 35/*kStylisticAlternativesType*/, 8/*kStylisticAltFourOnSelector*/, 9/*kStylisticAltFourOffSelector*/}, + {HB_TAG ('s','s','0','5'), 35/*kStylisticAlternativesType*/, 10/*kStylisticAltFiveOnSelector*/, 11/*kStylisticAltFiveOffSelector*/}, + {HB_TAG ('s','s','0','6'), 35/*kStylisticAlternativesType*/, 12/*kStylisticAltSixOnSelector*/, 13/*kStylisticAltSixOffSelector*/}, + {HB_TAG ('s','s','0','7'), 35/*kStylisticAlternativesType*/, 14/*kStylisticAltSevenOnSelector*/, 15/*kStylisticAltSevenOffSelector*/}, + {HB_TAG ('s','s','0','8'), 35/*kStylisticAlternativesType*/, 16/*kStylisticAltEightOnSelector*/, 17/*kStylisticAltEightOffSelector*/}, + {HB_TAG ('s','s','0','9'), 35/*kStylisticAlternativesType*/, 18/*kStylisticAltNineOnSelector*/, 19/*kStylisticAltNineOffSelector*/}, + {HB_TAG ('s','s','1','0'), 35/*kStylisticAlternativesType*/, 20/*kStylisticAltTenOnSelector*/, 21/*kStylisticAltTenOffSelector*/}, + {HB_TAG ('s','s','1','1'), 35/*kStylisticAlternativesType*/, 22/*kStylisticAltElevenOnSelector*/, 23/*kStylisticAltElevenOffSelector*/}, + {HB_TAG ('s','s','1','2'), 35/*kStylisticAlternativesType*/, 24/*kStylisticAltTwelveOnSelector*/, 25/*kStylisticAltTwelveOffSelector*/}, + {HB_TAG ('s','s','1','3'), 35/*kStylisticAlternativesType*/, 26/*kStylisticAltThirteenOnSelector*/, 27/*kStylisticAltThirteenOffSelector*/}, + {HB_TAG ('s','s','1','4'), 35/*kStylisticAlternativesType*/, 28/*kStylisticAltFourteenOnSelector*/, 29/*kStylisticAltFourteenOffSelector*/}, + {HB_TAG ('s','s','1','5'), 35/*kStylisticAlternativesType*/, 30/*kStylisticAltFifteenOnSelector*/, 31/*kStylisticAltFifteenOffSelector*/}, + {HB_TAG ('s','s','1','6'), 35/*kStylisticAlternativesType*/, 32/*kStylisticAltSixteenOnSelector*/, 33/*kStylisticAltSixteenOffSelector*/}, + {HB_TAG ('s','s','1','7'), 35/*kStylisticAlternativesType*/, 34/*kStylisticAltSeventeenOnSelector*/, 35/*kStylisticAltSeventeenOffSelector*/}, + {HB_TAG ('s','s','1','8'), 35/*kStylisticAlternativesType*/, 36/*kStylisticAltEighteenOnSelector*/, 37/*kStylisticAltEighteenOffSelector*/}, + {HB_TAG ('s','s','1','9'), 35/*kStylisticAlternativesType*/, 38/*kStylisticAltNineteenOnSelector*/, 39/*kStylisticAltNineteenOffSelector*/}, + {HB_TAG ('s','s','2','0'), 35/*kStylisticAlternativesType*/, 40/*kStylisticAltTwentyOnSelector*/, 41/*kStylisticAltTwentyOffSelector*/}, + {HB_TAG ('s','u','b','s'), 10/*kVerticalPositionType*/, 2/*kInferiorsSelector*/, 0/*kNormalPositionSelector*/}, + {HB_TAG ('s','u','p','s'), 10/*kVerticalPositionType*/, 1/*kSuperiorsSelector*/, 0/*kNormalPositionSelector*/}, + {HB_TAG ('s','w','s','h'), 36/*kContextualAlternatesType*/, 2/*kSwashAlternatesOnSelector*/, 3/*kSwashAlternatesOffSelector*/}, + {HB_TAG ('t','i','t','l'), 19/*kStyleOptionsType*/, 4/*kTitlingCapsSelector*/, 0/*kNoStyleOptionsSelector*/}, + {HB_TAG ('t','n','a','m'), 20/*kCharacterShapeType*/, 14/*kTraditionalNamesCharactersSelector*/, 16}, + {HB_TAG ('t','n','u','m'), 6/*kNumberSpacingType*/, 0/*kMonospacedNumbersSelector*/, 4}, + {HB_TAG ('t','r','a','d'), 20/*kCharacterShapeType*/, 0/*kTraditionalCharactersSelector*/, 16}, + {HB_TAG ('t','w','i','d'), 22/*kTextSpacingType*/, 3/*kThirdWidthTextSelector*/, 7}, + {HB_TAG ('u','n','i','c'), 3/*kLetterCaseType*/, 14, 15}, + {HB_TAG ('v','a','l','t'), 22/*kTextSpacingType*/, 5/*kAltProportionalTextSelector*/, 7}, + {HB_TAG ('v','e','r','t'), 4/*kVerticalSubstitutionType*/, 0/*kSubstituteVerticalFormsOnSelector*/, 1/*kSubstituteVerticalFormsOffSelector*/}, + {HB_TAG ('v','h','a','l'), 22/*kTextSpacingType*/, 6/*kAltHalfWidthTextSelector*/, 7}, + {HB_TAG ('v','k','n','a'), 34/*kAlternateKanaType*/, 2/*kAlternateVertKanaOnSelector*/, 3/*kAlternateVertKanaOffSelector*/}, + {HB_TAG ('v','p','a','l'), 22/*kTextSpacingType*/, 5/*kAltProportionalTextSelector*/, 7}, + {HB_TAG ('v','r','t','2'), 4/*kVerticalSubstitutionType*/, 0/*kSubstituteVerticalFormsOnSelector*/, 1/*kSubstituteVerticalFormsOffSelector*/}, + {HB_TAG ('z','e','r','o'), 14/*kTypographicExtrasType*/, 4/*kSlashedZeroOnSelector*/, 5/*kSlashedZeroOffSelector*/}, +}; + +const hb_aat_feature_mapping_t * +hb_aat_layout_find_feature_mapping (hb_tag_t tag) +{ + return (const hb_aat_feature_mapping_t *) bsearch (&tag, + feature_mappings, + ARRAY_LENGTH (feature_mappings), + sizeof (feature_mappings[0]), + hb_aat_feature_mapping_t::cmp); +} + + /* - * morx/kerx/trak/ankr + * morx/kerx/trak */ static inline const AAT::morx& @@ -54,28 +147,96 @@ _get_morx (hb_face_t *face, hb_blob_t **blob = nullptr) *blob = hb_ot_face_data (face)->morx.get_blob (); return morx; } +static inline const AAT::kerx& +_get_kerx (hb_face_t *face, hb_blob_t **blob = nullptr) +{ + if (unlikely (!hb_ot_shaper_face_data_ensure (face))) + { + if (blob) + *blob = hb_blob_get_empty (); + return Null(AAT::kerx); + } + const AAT::kerx& kerx = *(hb_ot_face_data (face)->kerx.get ()); + if (blob) + *blob = hb_ot_face_data (face)->kerx.get_blob (); + return kerx; +} +static inline const AAT::ankr& +_get_ankr (hb_face_t *face, hb_blob_t **blob = nullptr) +{ + if (unlikely (!hb_ot_shaper_face_data_ensure (face))) + { + if (blob) + *blob = hb_blob_get_empty (); + return Null(AAT::ankr); + } + const AAT::ankr& ankr = *(hb_ot_face_data (face)->ankr.get ()); + if (blob) + *blob = hb_ot_face_data (face)->ankr.get_blob (); + return ankr; +} +static inline const AAT::trak& +_get_trak (hb_face_t *face) +{ + if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(AAT::trak); + return *(hb_ot_face_data (face)->trak.get ()); +} + + +hb_bool_t +hb_aat_layout_has_substitution (hb_face_t *face) +{ + return _get_morx (face).has_data (); +} void -hb_aat_layout_substitute (hb_font_t *font, hb_buffer_t *buffer) +hb_aat_layout_substitute (hb_ot_shape_plan_t *plan, + hb_font_t *font, + hb_buffer_t *buffer) { hb_blob_t *blob; const AAT::morx& morx = _get_morx (font->face, &blob); - AAT::hb_aat_apply_context_t c (font, buffer, blob); + AAT::hb_aat_apply_context_t c (plan, font, buffer, blob); morx.apply (&c); } + +hb_bool_t +hb_aat_layout_has_positioning (hb_face_t *face) +{ + return _get_kerx (face).has_data (); +} + void -hb_aat_layout_position (hb_font_t *font, hb_buffer_t *buffer) +hb_aat_layout_position (hb_ot_shape_plan_t *plan, + hb_font_t *font, + hb_buffer_t *buffer) { -#if 0 hb_blob_t *blob; - const AAT::ankr& ankr = _get_ankr (font->face, &blob); const AAT::kerx& kerx = _get_kerx (font->face, &blob); - const AAT::trak& trak = _get_trak (font->face, &blob); - AAT::hb_aat_apply_context_t c (font, buffer, blob); - kerx.apply (&c, &ankr); + hb_blob_t *ankr_blob; + const AAT::ankr& ankr = _get_ankr (font->face, &ankr_blob); + + AAT::hb_aat_apply_context_t c (plan, font, buffer, blob, + ankr, ankr_blob->data + ankr_blob->length); + kerx.apply (&c); +} + +hb_bool_t +hb_aat_layout_has_tracking (hb_face_t *face) +{ + return _get_trak (face).has_data (); +} + +void +hb_aat_layout_track (hb_ot_shape_plan_t *plan, + hb_font_t *font, + hb_buffer_t *buffer) +{ + const AAT::trak& trak = _get_trak (font->face); + + AAT::hb_aat_apply_context_t c (plan, font, buffer); trak.apply (&c); -#endif } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout.hh index ac9c535395a..d0eb0190db6 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout.hh @@ -29,15 +29,52 @@ #include "hb.hh" -#include "hb-font.hh" -#include "hb-buffer.hh" -#include "hb-open-type.hh" +#include "hb-ot-shape.hh" +struct hb_aat_feature_mapping_t +{ + hb_tag_t otFeatureTag; + uint16_t aatFeatureType; + uint16_t selectorToEnable; + uint16_t selectorToDisable; + + static inline int cmp (const void *key_, const void *entry_) + { + hb_tag_t key = * (unsigned int *) key_; + const hb_aat_feature_mapping_t * entry = (const hb_aat_feature_mapping_t *) entry_; + return key < entry->otFeatureTag ? -1 : + key > entry->otFeatureTag ? 1 : + 0; + } +}; + +HB_INTERNAL const hb_aat_feature_mapping_t * +hb_aat_layout_find_feature_mapping (hb_tag_t tag); + + +HB_INTERNAL hb_bool_t +hb_aat_layout_has_substitution (hb_face_t *face); + HB_INTERNAL void -hb_aat_layout_substitute (hb_font_t *font, hb_buffer_t *buffer); +hb_aat_layout_substitute (hb_ot_shape_plan_t *plan, + hb_font_t *font, + hb_buffer_t *buffer); + +HB_INTERNAL hb_bool_t +hb_aat_layout_has_positioning (hb_face_t *face); + +HB_INTERNAL void +hb_aat_layout_position (hb_ot_shape_plan_t *plan, + hb_font_t *font, + hb_buffer_t *buffer); + +HB_INTERNAL hb_bool_t +hb_aat_layout_has_tracking (hb_face_t *face); HB_INTERNAL void -hb_aat_layout_position (hb_font_t *font, hb_buffer_t *buffer); +hb_aat_layout_track (hb_ot_shape_plan_t *plan, + hb_font_t *font, + hb_buffer_t *buffer); #endif /* HB_AAT_LAYOUT_HH */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-ltag-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-ltag-table.hh index e308ab28c37..08a1b51a9e8 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-ltag-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-ltag-table.hh @@ -46,7 +46,7 @@ struct FTStringRange } protected: - OffsetTo > + OffsetTo, HBUINT16, false> tag; /* Offset from the start of the table to * the beginning of the string */ HBUINT16 length; /* String length (in bytes) */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-atomic.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-atomic.hh index 6e3672c18bc..5cb7ca5d53d 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-atomic.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-atomic.hh @@ -49,17 +49,21 @@ /* Defined externally, i.e. in config.h. */ -#elif !defined(HB_NO_MT) && defined(__ATOMIC_CONSUME) +#elif !defined(HB_NO_MT) && defined(__ATOMIC_ACQUIRE) /* C++11-style GCC primitives. */ +#define _hb_memory_barrier() __sync_synchronize () + #define hb_atomic_int_impl_add(AI, V) __atomic_fetch_add ((AI), (V), __ATOMIC_ACQ_REL) #define hb_atomic_int_impl_set_relaxed(AI, V) __atomic_store_n ((AI), (V), __ATOMIC_RELAXED) +#define hb_atomic_int_impl_set(AI, V) __atomic_store_n ((AI), (V), __ATOMIC_RELEASE) #define hb_atomic_int_impl_get_relaxed(AI) __atomic_load_n ((AI), __ATOMIC_RELAXED) +#define hb_atomic_int_impl_get(AI) __atomic_load_n ((AI), __ATOMIC_ACQUIRE) #define hb_atomic_ptr_impl_set_relaxed(P, V) __atomic_store_n ((P), (V), __ATOMIC_RELAXED) #define hb_atomic_ptr_impl_get_relaxed(P) __atomic_load_n ((P), __ATOMIC_RELAXED) -#define hb_atomic_ptr_impl_get(P) __atomic_load_n ((P), __ATOMIC_CONSUME) +#define hb_atomic_ptr_impl_get(P) __atomic_load_n ((P), __ATOMIC_ACQUIRE) static inline bool _hb_atomic_ptr_impl_cmplexch (const void **P, const void *O_, const void *N) { @@ -74,13 +78,19 @@ _hb_atomic_ptr_impl_cmplexch (const void **P, const void *O_, const void *N) #include +#define _hb_memory_barrier() std::atomic_thread_fence(std::memory_order_ack_rel) +#define _hb_memory_r_barrier() std::atomic_thread_fence(std::memory_order_acquire) +#define _hb_memory_w_barrier() std::atomic_thread_fence(std::memory_order_release) + #define hb_atomic_int_impl_add(AI, V) (reinterpret_cast *> (AI)->fetch_add ((V), std::memory_order_acq_rel)) #define hb_atomic_int_impl_set_relaxed(AI, V) (reinterpret_cast *> (AI)->store ((V), std::memory_order_relaxed)) +#define hb_atomic_int_impl_set(AI, V) (reinterpret_cast *> (AI)->store ((V), std::memory_order_release)) #define hb_atomic_int_impl_get_relaxed(AI) (reinterpret_cast *> (AI)->load (std::memory_order_relaxed)) +#define hb_atomic_int_impl_get(AI) (reinterpret_cast *> (AI)->load (std::memory_order_acquire)) #define hb_atomic_ptr_impl_set_relaxed(P, V) (reinterpret_cast *> (P)->store ((V), std::memory_order_relaxed)) #define hb_atomic_ptr_impl_get_relaxed(P) (reinterpret_cast *> (P)->load (std::memory_order_relaxed)) -#define hb_atomic_ptr_impl_get(P) (reinterpret_cast *> (P)->load (std::memory_order_consume)) +#define hb_atomic_ptr_impl_get(P) (reinterpret_cast *> (P)->load (std::memory_order_acquire)) static inline bool _hb_atomic_ptr_impl_cmplexch (const void **P, const void *O_, const void *N) { @@ -109,7 +119,7 @@ static inline void _hb_memory_barrier (void) #define hb_atomic_int_impl_add(AI, V) InterlockedExchangeAdd ((LONG *) (AI), (V)) static_assert ((sizeof (LONG) == sizeof (int)), ""); -#define hb_atomic_ptr_impl_cmpexch(P,O,N) (InterlockedCompareExchangePointer ((void **) (P), (void *) (N), (void *) (O)) == (void *) (O)) +#define hb_atomic_ptr_impl_cmpexch(P,O,N) (InterlockedCompareExchangePointer ((P), (N), (O)) == (O)) #elif !defined(HB_NO_MT) && defined(HAVE_INTEL_ATOMIC_PRIMITIVES) @@ -137,17 +147,17 @@ static inline int _hb_fetch_and_add (int *AI, int V) _hb_memory_r_barrier (); return result; } -static inline bool _hb_compare_and_swap_ptr (const void **P, const void *O, const void *N) +static inline bool _hb_compare_and_swap_ptr (void **P, void *O, void *N) { _hb_memory_w_barrier (); - int result = atomic_cas_ptr ((void **) P, (void *) O, (void *) N) == (void *) O; + bool result = atomic_cas_ptr (P, O, N) == O; _hb_memory_r_barrier (); return result; } #define hb_atomic_int_impl_add(AI, V) _hb_fetch_and_add ((AI), (V)) -#define hb_atomic_ptr_impl_cmpexch(P,O,N) _hb_compare_and_swap_ptr ((const void **) (P), (O), (N)) +#define hb_atomic_ptr_impl_cmpexch(P,O,N) _hb_compare_and_swap_ptr ((P), (O), (N)) #elif !defined(HB_NO_MT) && defined(__APPLE__) @@ -164,12 +174,12 @@ static inline bool _hb_compare_and_swap_ptr (const void **P, const void *O, cons #define hb_atomic_int_impl_add(AI, V) (OSAtomicAdd32Barrier ((V), (AI)) - (V)) #if (MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4 || __IPHONE_VERSION_MIN_REQUIRED >= 20100) -#define hb_atomic_ptr_impl_cmpexch(P,O,N) OSAtomicCompareAndSwapPtrBarrier ((void *) (O), (void *) (N), (void **) (P)) +#define hb_atomic_ptr_impl_cmpexch(P,O,N) OSAtomicCompareAndSwapPtrBarrier ((O), (N), (P)) #else #if __ppc64__ || __x86_64__ || __aarch64__ -#define hb_atomic_ptr_impl_cmpexch(P,O,N) OSAtomicCompareAndSwap64Barrier ((int64_t) (void *) (O), (int64_t) (void *) (N), (int64_t*) (P)) +#define hb_atomic_ptr_impl_cmpexch(P,O,N) OSAtomicCompareAndSwap64Barrier ((int64_t) (O), (int64_t) (N), (int64_t*) (P)) #else -#define hb_atomic_ptr_impl_cmpexch(P,O,N) OSAtomicCompareAndSwap32Barrier ((int32_t) (void *) (O), (int32_t) (void *) (N), (int32_t*) (P)) +#define hb_atomic_ptr_impl_cmpexch(P,O,N) OSAtomicCompareAndSwap32Barrier ((int32_t) (O), (int32_t) (N), (int32_t*) (P)) #endif #endif @@ -243,6 +253,12 @@ static_assert ((sizeof (long) == sizeof (void *)), ""); #ifndef hb_atomic_ptr_impl_get_relaxed #define hb_atomic_ptr_impl_get_relaxed(P) (*(P)) #endif +#ifndef hb_atomic_int_impl_set +inline void hb_atomic_int_impl_set (int *AI, int v) { _hb_memory_w_barrier (); *AI = v; } +#endif +#ifndef hb_atomic_int_impl_get +inline int hb_atomic_int_impl_get (int *AI) { int v = *AI; _hb_memory_r_barrier (); return v; } +#endif #ifndef hb_atomic_ptr_impl_get inline void *hb_atomic_ptr_impl_get (void **P) { void *v = *P; _hb_memory_r_barrier (); return v; } #endif @@ -252,7 +268,9 @@ inline void *hb_atomic_ptr_impl_get (void **P) { void *v = *P; _hb_memory_r_barr struct hb_atomic_int_t { inline void set_relaxed (int v_) const { hb_atomic_int_impl_set_relaxed (&v, v_); } + inline void set (int v_) const { hb_atomic_int_impl_set (&v, v_); } inline int get_relaxed (void) const { return hb_atomic_int_impl_get_relaxed (&v); } + inline int get (void) const { return hb_atomic_int_impl_get (&v); } inline int inc (void) { return hb_atomic_int_impl_add (&v, 1); } inline int dec (void) { return hb_atomic_int_impl_add (&v, -1); } @@ -271,9 +289,9 @@ struct hb_atomic_ptr_t inline void init (T* v_ = nullptr) { set_relaxed (v_); } inline void set_relaxed (T* v_) const { hb_atomic_ptr_impl_set_relaxed (&v, v_); } - inline T *get_relaxed (void) const { return hb_atomic_ptr_impl_get_relaxed (&v); } + inline T *get_relaxed (void) const { return (T *) hb_atomic_ptr_impl_get_relaxed (&v); } inline T *get (void) const { return (T *) hb_atomic_ptr_impl_get ((void **) &v); } - inline bool cmpexch (const T *old, T *new_) const{ return hb_atomic_ptr_impl_cmpexch (&v, old, new_); } + inline bool cmpexch (const T *old, T *new_) const { return hb_atomic_ptr_impl_cmpexch ((void **) &v, (void *) old, (void *) new_); } mutable T *v; }; 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 a335df308a5..edee6730053 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc @@ -25,11 +25,6 @@ * Red Hat Author(s): Behdad Esfahbod */ -/* http://www.oracle.com/technetwork/articles/servers-storage-dev/standardheaderfiles-453865.html */ -#ifndef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 200809L -#endif - #include "hb.hh" #include "hb-blob.hh" @@ -293,6 +288,8 @@ hb_blob_make_immutable (hb_blob_t *blob) { if (hb_object_is_inert (blob)) return; + if (blob->immutable) + return; blob->immutable = true; } @@ -510,8 +507,9 @@ struct hb_mapped_file_t #if (defined(HAVE_MMAP) || defined(_WIN32) || defined(__CYGWIN__)) && !defined(HB_NO_MMAP) static void -_hb_mapped_file_destroy (hb_mapped_file_t *file) +_hb_mapped_file_destroy (void *file_) { + hb_mapped_file_t *file = (hb_mapped_file_t *) file_; #ifdef HAVE_MMAP munmap (file->contents, file->length); #elif defined(_WIN32) || defined(__CYGWIN__) @@ -574,18 +572,45 @@ fail_without_close: wchar_t * wchar_file_name = (wchar_t *) malloc (sizeof (wchar_t) * size); if (unlikely (wchar_file_name == nullptr)) goto fail_without_close; mbstowcs (wchar_file_name, file_name, size); +#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP) + { + CREATEFILE2_EXTENDED_PARAMETERS ceparams = { 0 }; + ceparams.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS); + ceparams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED & 0xFFFF; + ceparams.dwFileFlags = FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED & 0xFFF00000; + ceparams.dwSecurityQosFlags = FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED & 0x000F0000; + ceparams.lpSecurityAttributes = nullptr; + ceparams.hTemplateFile = nullptr; + fd = CreateFile2 (wchar_file_name, GENERIC_READ, FILE_SHARE_READ, + OPEN_EXISTING, &ceparams); + } +#else fd = CreateFileW (wchar_file_name, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_OVERLAPPED, nullptr); +#endif free (wchar_file_name); if (unlikely (fd == INVALID_HANDLE_VALUE)) goto fail_without_close; +#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP) + { + LARGE_INTEGER length; + GetFileSizeEx (fd, &length); + file->length = length.LowPart; + file->mapping = CreateFileMappingFromApp (fd, nullptr, PAGE_READONLY, length.QuadPart, nullptr); + } +#else file->length = (unsigned long) GetFileSize (fd, nullptr); file->mapping = CreateFileMapping (fd, nullptr, PAGE_READONLY, 0, 0, nullptr); +#endif if (unlikely (file->mapping == nullptr)) goto fail; +#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP) + file->contents = (char *) MapViewOfFileFromApp (file->mapping, FILE_MAP_READ, 0, 0); +#else file->contents = (char *) MapViewOfFile (file->mapping, FILE_MAP_READ, 0, 0, 0); +#endif if (unlikely (file->contents == nullptr)) goto fail; CloseHandle (fd); 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 1b6d14731fd..c1d82ab8dfe 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 @@ -440,8 +440,8 @@ hb_bool_t hb_buffer_deserialize_glyphs (hb_buffer_t *buffer, const char *buf, int buf_len, /* -1 means nul-terminated */ - const char **end_ptr, /* May be nullptr */ - hb_font_t *font, /* May be nullptr */ + const char **end_ptr, /* May be NULL */ + hb_font_t *font, /* May be NULL */ hb_buffer_serialize_format_t format) { const char *end; 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 536ab5d5376..ce9b0530ce9 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc @@ -182,7 +182,11 @@ hb_buffer_t::shift_forward (unsigned int count) if (idx + count > len) { /* Under memory failure we might expose this area. At least - * clean it up. Oh well... */ + * clean it up. Oh well... + * + * 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])); } len += count; @@ -219,6 +223,7 @@ hb_buffer_t::reset (void) unicode = hb_unicode_funcs_reference (hb_unicode_funcs_get_default ()); flags = HB_BUFFER_FLAG_DEFAULT; replacement = HB_BUFFER_REPLACEMENT_CODEPOINT_DEFAULT; + invisible = 0; clear (); } @@ -354,6 +359,8 @@ hb_buffer_t::replace_glyphs (unsigned int num_in, { if (unlikely (!make_room_for (num_in, num_out))) return; + assert (idx + num_in <= len); + merge_clusters (idx, idx + num_in); hb_glyph_info_t orig_info = info[idx]; @@ -369,37 +376,6 @@ hb_buffer_t::replace_glyphs (unsigned int num_in, out_len += num_out; } -void -hb_buffer_t::output_glyph (hb_codepoint_t glyph_index) -{ - if (unlikely (!make_room_for (0, 1))) return; - - out_info[out_len] = info[idx]; - out_info[out_len].codepoint = glyph_index; - - out_len++; -} - -void -hb_buffer_t::output_info (const hb_glyph_info_t &glyph_info) -{ - if (unlikely (!make_room_for (0, 1))) return; - - out_info[out_len] = glyph_info; - - out_len++; -} - -void -hb_buffer_t::copy_glyph (void) -{ - if (unlikely (!make_room_for (0, 1))) return; - - out_info[out_len] = info[idx]; - - out_len++; -} - bool hb_buffer_t::move_to (unsigned int i) { @@ -429,8 +405,14 @@ hb_buffer_t::move_to (unsigned int i) unsigned int count = out_len - i; /* This will blow in our face if memory allocation fails later - * in this same lookup... */ - if (unlikely (idx < count && !shift_forward (count + 32))) return false; + * in this same lookup... + * + * We used to shift with extra 32 items, instead of the 0 below. + * But that would leave empty slots in the buffer in case of allocation + * failures. Setting to zero for now to avoid other problems (see + * comments in shift_forward(). This can cause O(N^2) behavior more + * severely than adding 32 empty slots can... */ + if (unlikely (idx < count && !shift_forward (count + 0))) return false; assert (idx >= count); @@ -442,19 +424,6 @@ hb_buffer_t::move_to (unsigned int i) return true; } -void -hb_buffer_t::replace_glyph (hb_codepoint_t glyph_index) -{ - if (unlikely (out_info != info || out_len != idx)) { - if (unlikely (!make_room_for (1, 1))) return; - out_info[out_len] = info[idx]; - } - out_info[out_len].codepoint = glyph_index; - - idx++; - out_len++; -} - void hb_buffer_t::set_masks (hb_mask_t value, @@ -709,6 +678,7 @@ DEFINE_NULL_INSTANCE (hb_buffer_t) = HB_BUFFER_FLAG_DEFAULT, HB_BUFFER_CLUSTER_LEVEL_DEFAULT, HB_BUFFER_REPLACEMENT_CODEPOINT_DEFAULT, + 0, /* invisible */ HB_BUFFER_SCRATCH_FLAG_DEFAULT, HB_BUFFER_MAX_LEN_DEFAULT, HB_BUFFER_MAX_OPS_DEFAULT, @@ -1028,7 +998,7 @@ hb_buffer_get_script (hb_buffer_t *buffer) * are orthogonal to the scripts, and though they are related, they are * different concepts and should not be confused with each other. * - * Use hb_language_from_string() to convert from ISO 639 language codes to + * Use hb_language_from_string() to convert from BCP 47 language tags to * #hb_language_t. * * Since: 0.9.2 @@ -1210,6 +1180,46 @@ hb_buffer_get_replacement_codepoint (hb_buffer_t *buffer) } +/** + * hb_buffer_set_invisible_glyph: + * @buffer: an #hb_buffer_t. + * @invisible: the invisible #hb_codepoint_t + * + * Sets the #hb_codepoint_t that replaces invisible characters in + * the shaping result. If set to zero (default), the glyph for the + * U+0020 SPACE character is used. Otherwise, this value is used + * verbatim. + * + * Since: 2.0.0 + **/ +void +hb_buffer_set_invisible_glyph (hb_buffer_t *buffer, + hb_codepoint_t invisible) +{ + if (unlikely (hb_object_is_inert (buffer))) + return; + + buffer->invisible = invisible; +} + +/** + * hb_buffer_get_invisible_glyph: + * @buffer: an #hb_buffer_t. + * + * See hb_buffer_set_invisible_glyph(). + * + * Return value: + * The @buffer invisible #hb_codepoint_t. + * + * Since: 2.0.0 + **/ +hb_codepoint_t +hb_buffer_get_invisible_glyph (hb_buffer_t *buffer) +{ + return buffer->invisible; +} + + /** * hb_buffer_reset: * @buffer: an #hb_buffer_t. @@ -1499,6 +1509,8 @@ hb_buffer_reverse_clusters (hb_buffer_t *buffer) * it will be set to the process's default language as returned by * hb_language_get_default(). This may change in the future by * taking buffer script into consideration when choosing a language. + * Note that hb_language_get_default() is NOT threadsafe the first time + * it is called. See documentation for that function for details. * * Since: 0.9.7 **/ @@ -1887,6 +1899,10 @@ hb_buffer_t::sort (unsigned int start, unsigned int end, int(*compar)(const hb_g /** * hb_buffer_diff: + * @buffer: a buffer. + * @reference: other buffer to compare to. + * @dottedcircle_glyph: glyph id of U+25CC DOTTED CIRCLE, or (hb_codepont_t) -1. + * @position_fuzz: allowed absolute difference in position values. * * If dottedcircle_glyph is (hb_codepoint_t) -1 then %HB_BUFFER_DIFF_FLAG_DOTTED_CIRCLE_PRESENT * and %HB_BUFFER_DIFF_FLAG_NOTDEF_PRESENT are never returned. This should be used by most diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.h b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.h index 8a2d3e8690f..d0aed02d534 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.h +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.h @@ -44,7 +44,6 @@ HB_BEGIN_DECLS * hb_glyph_info_t: * @codepoint: either a Unicode code point (before shaping) or a glyph index * (after shaping). - * @mask: * @cluster: the index of the character in the original text that corresponds * to this #hb_glyph_info_t, or whatever the client passes to * hb_buffer_add(). More than one #hb_glyph_info_t can have the same @@ -59,11 +58,13 @@ HB_BEGIN_DECLS * * The #hb_glyph_info_t is the structure that holds information about the * glyphs and their relation to input text. - * */ -typedef struct hb_glyph_info_t { +typedef struct hb_glyph_info_t +{ hb_codepoint_t codepoint; - hb_mask_t mask; /* Holds hb_glyph_flags_t after hb_shape(), plus other things. */ + /*< private >*/ + hb_mask_t mask; + /*< public >*/ uint32_t cluster; /*< private >*/ @@ -92,7 +93,7 @@ typedef struct hb_glyph_info_t { typedef enum { /*< flags >*/ HB_GLYPH_FLAG_UNSAFE_TO_BREAK = 0x00000001, - HB_GLYPH_FLAG_DEFINED = 0x00000001 /* OR of all defined flags */ + HB_GLYPH_FLAG_DEFINED = 0x00000001 /*< skip >*/ /* OR of all defined flags */ } hb_glyph_flags_t; HB_EXTERN hb_glyph_flags_t @@ -298,7 +299,15 @@ hb_buffer_set_flags (hb_buffer_t *buffer, HB_EXTERN hb_buffer_flags_t hb_buffer_get_flags (hb_buffer_t *buffer); -/* +/** + * hb_buffer_cluster_level_t: + * @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES: Return cluster values grouped by graphemes into + * monotone order. + * @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS: Return cluster values grouped into monotone order. + * @HB_BUFFER_CLUSTER_LEVEL_CHARACTERS: Don't group cluster values. + * @HB_BUFFER_CLUSTER_LEVEL_DEFAULT: Default cluster level, + * equal to @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES. + * * Since: 0.9.42 */ typedef enum { @@ -332,6 +341,13 @@ hb_buffer_set_replacement_codepoint (hb_buffer_t *buffer, HB_EXTERN hb_codepoint_t hb_buffer_get_replacement_codepoint (hb_buffer_t *buffer); +HB_EXTERN void +hb_buffer_set_invisible_glyph (hb_buffer_t *buffer, + hb_codepoint_t invisible); + +HB_EXTERN hb_codepoint_t +hb_buffer_get_invisible_glyph (hb_buffer_t *buffer); + HB_EXTERN void hb_buffer_reset (hb_buffer_t *buffer); 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 bcaf066c70b..0d888e1e052 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.hh @@ -93,6 +93,7 @@ struct hb_buffer_t hb_buffer_flags_t flags; /* BOT / EOT / etc. */ hb_buffer_cluster_level_t cluster_level; hb_codepoint_t replacement; /* U+FFFD or something else. */ + hb_codepoint_t invisible; /* 0 or something else. */ hb_buffer_scratch_flags_t scratch_flags; /* Have space-fallback, etc. */ unsigned int max_len; /* Maximum allowed len. */ int max_ops; /* Maximum allowed operations. */ @@ -212,13 +213,49 @@ struct hb_buffer_t unsigned int num_out, const hb_codepoint_t *glyph_data); - HB_INTERNAL void replace_glyph (hb_codepoint_t glyph_index); + inline void replace_glyph (hb_codepoint_t glyph_index) + { + if (unlikely (out_info != info || out_len != idx)) { + if (unlikely (!make_room_for (1, 1))) return; + out_info[out_len] = info[idx]; + } + out_info[out_len].codepoint = glyph_index; + + idx++; + out_len++; + } /* Makes a copy of the glyph at idx to output and replace glyph_index */ - HB_INTERNAL void output_glyph (hb_codepoint_t glyph_index); - HB_INTERNAL void output_info (const hb_glyph_info_t &glyph_info); + inline hb_glyph_info_t & output_glyph (hb_codepoint_t glyph_index) + { + if (unlikely (!make_room_for (0, 1))) return Crap(hb_glyph_info_t); + + if (unlikely (idx == len && !out_len)) + return Crap(hb_glyph_info_t); + + out_info[out_len] = idx < len ? info[idx] : out_info[out_len - 1]; + out_info[out_len].codepoint = glyph_index; + + out_len++; + + return out_info[out_len - 1]; + } + inline void output_info (const hb_glyph_info_t &glyph_info) + { + if (unlikely (!make_room_for (0, 1))) return; + + out_info[out_len] = glyph_info; + + out_len++; + } /* Copies glyph at idx to output but doesn't advance idx */ - HB_INTERNAL void copy_glyph (void); - HB_INTERNAL bool move_to (unsigned int i); /* i is output-buffer index. */ + inline void copy_glyph (void) + { + if (unlikely (!make_room_for (0, 1))) return; + + out_info[out_len] = info[idx]; + + out_len++; + } /* Copies glyph at idx to output and advance idx. * If there's no output, just advance idx. */ inline void @@ -226,7 +263,8 @@ struct hb_buffer_t { if (have_output) { - if (unlikely (out_info != info || out_len != idx)) { + if (out_info != info || out_len != idx) + { if (unlikely (!make_room_for (1, 1))) return; out_info[out_len] = info[idx]; } @@ -235,10 +273,28 @@ struct hb_buffer_t idx++; } + /* Copies n glyphs at idx to output and advance idx. + * If there's no output, just advance idx. */ + inline void + next_glyphs (unsigned int n) + { + if (have_output) + { + if (out_info != info || out_len != idx) + { + if (unlikely (!make_room_for (n, n))) return; + memmove (out_info + out_len, info + idx, n * sizeof (out_info[0])); + } + out_len += n; + } + idx += n; + } /* Advance idx without copying to output. */ - inline void skip_glyph (void) { idx++; } - + inline void skip_glyph (void) + { + idx++; + } inline void reset_masks (hb_mask_t mask) { for (unsigned int j = 0; j < len; j++) @@ -275,6 +331,8 @@ struct hb_buffer_t /* Internal methods */ + HB_INTERNAL bool move_to (unsigned int i); /* i is output-buffer index. */ + HB_INTERNAL bool enlarge (unsigned int size); inline bool ensure (unsigned int size) diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cache.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cache.hh new file mode 100644 index 00000000000..eb48f18cf94 --- /dev/null +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cache.hh @@ -0,0 +1,80 @@ +/* + * Copyright © 2012 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_CACHE_HH +#define HB_CACHE_HH + +#include "hb.hh" + + +/* Implements a lock-free cache for int->int functions. */ + +template +struct hb_cache_t +{ + static_assert ((key_bits >= cache_bits), ""); + static_assert ((key_bits + value_bits - cache_bits <= 8 * sizeof (hb_atomic_int_t)), ""); + static_assert (sizeof (hb_atomic_int_t) == sizeof (unsigned int), ""); + + inline void init (void) { clear (); } + inline void fini (void) {} + + inline void clear (void) + { + for (unsigned i = 0; i < ARRAY_LENGTH (values); i++) + values[i].set_relaxed (-1); + } + + inline bool get (unsigned int key, unsigned int *value) const + { + unsigned int k = key & ((1u<> value_bits) != (key >> cache_bits)) + return false; + *value = v & ((1u<> key_bits) || (value >> value_bits))) + return false; /* Overflows */ + unsigned int k = key & ((1u<>cache_bits)< hb_cmap_cache_t; +typedef hb_cache_t<16, 24, 8> hb_advance_cache_t; + + +#endif /* HB_CACHE_HH */ 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 ed3fed2a35c..4940e7fb561 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.cc @@ -47,8 +47,27 @@ _hb_options_init (void) u.i = 0; u.opts.initialized = 1; - char *c = getenv ("HB_OPTIONS"); - u.opts.uniscribe_bug_compatible = c && strstr (c, "uniscribe-bug-compatible"); + const char *c = getenv ("HB_OPTIONS"); + if (c) + { + while (*c) + { + const char *p = strchr (c, ':'); + if (!p) + p = c + strlen (c); + +#define OPTION(name, symbol) \ + if (0 == strncmp (c, name, p - c) && strlen (name) == p - c) u.opts.symbol = true; + + OPTION ("uniscribe-bug-compatible", uniscribe_bug_compatible); + OPTION ("aat", aat); + +#undef OPTION + + c = *p ? p + 1 : p; + } + + } /* This is idempotent and threadsafe. */ _hb_options.set_relaxed (u.i); @@ -306,14 +325,14 @@ retry: /** * hb_language_from_string: * @str: (array length=len) (element-type uint8_t): a string representing - * ISO 639 language code + * a BCP 47 language tag * @len: length of the @str, or -1 if it is %NULL-terminated. * - * Converts @str representing an ISO 639 language code to the corresponding + * Converts @str representing a BCP 47 language tag to the corresponding * #hb_language_t. * * Return value: (transfer none): - * The #hb_language_t corresponding to the ISO 639 language code. + * The #hb_language_t corresponding to the BCP 47 language tag. * * Since: 0.9.2 **/ @@ -361,7 +380,14 @@ hb_language_to_string (hb_language_t language) /** * hb_language_get_default: * + * Get default language from current locale. * + * Note that the first time this function is called, it calls + * "setlocale (LC_CTYPE, nullptr)" to fetch current locale. The underlying + * setlocale function is, in many implementations, NOT threadsafe. To avoid + * problems, call this function once before multiple threads can call it. + * This function is only used from hb_buffer_guess_segment_properties() by + * HarfBuzz itself. * * Return value: (transfer none): * @@ -531,7 +557,6 @@ hb_script_get_horizontal_direction (hb_script_t script) /* Unicode-8.0 additions */ case HB_SCRIPT_HATRAN: - case HB_SCRIPT_OLD_HUNGARIAN: /* Unicode-9.0 additions */ case HB_SCRIPT_ADLAM: @@ -545,6 +570,7 @@ hb_script_get_horizontal_direction (hb_script_t script) /* https://github.com/harfbuzz/harfbuzz/issues/1000 */ + case HB_SCRIPT_OLD_HUNGARIAN: case HB_SCRIPT_OLD_ITALIC: case HB_SCRIPT_RUNIC: @@ -877,8 +903,8 @@ parse_feature_indices (const char **pp, const char *end, hb_feature_t *feature) bool has_start; - feature->start = 0; - feature->end = (unsigned int) -1; + feature->start = HB_FEATURE_GLOBAL_START; + feature->end = HB_FEATURE_GLOBAL_END; if (!parse_char (pp, end, '[')) return true; @@ -1065,7 +1091,7 @@ hb_variation_to_string (hb_variation_t *variation, while (len && s[len - 1] == ' ') len--; s[len++] = '='; - len += MAX (0, snprintf (s + len, ARRAY_LENGTH (s) - len, "%g", variation->value)); + len += MAX (0, snprintf (s + len, ARRAY_LENGTH (s) - len, "%g", (double) variation->value)); assert (len < ARRAY_LENGTH (s)); len = MIN (len, size - 1); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.h b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.h index 5dc1ebcd2c5..2f09f431801 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.h +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.h @@ -63,6 +63,23 @@ typedef unsigned __int64 uint64_t; # include #endif +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) +#define HB_DEPRECATED __attribute__((__deprecated__)) +#elif defined(_MSC_VER) && (_MSC_VER >= 1300) +#define HB_DEPRECATED __declspec(deprecated) +#else +#define HB_DEPRECATED +#endif + +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +#define HB_DEPRECATED_FOR(f) __attribute__((__deprecated__("Use '" #f "' instead"))) +#elif defined(_MSC_FULL_VER) && (_MSC_FULL_VER > 140050320) +#define HB_DEPRECATED_FOR(f) __declspec(deprecated("is deprecated. Use '" #f "' instead")) +#else +#define HB_DEPRECATED_FOR(f) HB_DEPRECATED +#endif + + HB_BEGIN_DECLS @@ -86,8 +103,8 @@ typedef union _hb_var_int_t { typedef uint32_t hb_tag_t; -#define HB_TAG(c1,c2,c3,c4) ((hb_tag_t)((((uint8_t)(c1))<<24)|(((uint8_t)(c2))<<16)|(((uint8_t)(c3))<<8)|((uint8_t)(c4)))) -#define HB_UNTAG(tag) ((uint8_t)((tag)>>24)), ((uint8_t)((tag)>>16)), ((uint8_t)((tag)>>8)), ((uint8_t)(tag)) +#define HB_TAG(c1,c2,c3,c4) ((hb_tag_t)((((uint32_t)(c1)&0xFF)<<24)|(((uint32_t)(c2)&0xFF)<<16)|(((uint32_t)(c3)&0xFF)<<8)|((uint32_t)(c4)&0xFF))) +#define HB_UNTAG(tag) (((tag)>>24)&0xFF), (((tag)>>16)&0xFF), (((tag)>>8)&0xFF), ((tag)&0xFF) #define HB_TAG_NONE HB_TAG(0,0,0,0) #define HB_TAG_MAX HB_TAG(0xff,0xff,0xff,0xff) @@ -340,13 +357,15 @@ typedef enum HB_SCRIPT_INVALID = HB_TAG_NONE, /* Dummy values to ensure any hb_tag_t value can be passed/stored as hb_script_t - * without risking undefined behavior. Include both a signed and unsigned max, - * since technically enums are int, and indeed, hb_script_t ends up being signed. + * without risking undefined behavior. We have two, for historical reasons. + * HB_TAG_MAX used to be unsigned, but that was invalid Ansi C, so was changed + * to _HB_SCRIPT_MAX_VALUE to be equal to HB_TAG_MAX_SIGNED as well. + * * See this thread for technicalities: * * https://lists.freedesktop.org/archives/harfbuzz/2014-March/004150.html */ - _HB_SCRIPT_MAX_VALUE = HB_TAG_MAX, /*< skip >*/ + _HB_SCRIPT_MAX_VALUE = HB_TAG_MAX_SIGNED, /*< skip >*/ _HB_SCRIPT_MAX_VALUE_SIGNED = HB_TAG_MAX_SIGNED /*< skip >*/ } hb_script_t; @@ -379,6 +398,19 @@ typedef void (*hb_destroy_func_t) (void *user_data); /* Font features and variations. */ +/** + * HB_FEATURE_GLOBAL_START + * + * Since: 2.0.0 + */ +#define HB_FEATURE_GLOBAL_START 0 +/** + * HB_FEATURE_GLOBAL_END + * + * Since: 2.0.0 + */ +#define HB_FEATURE_GLOBAL_END ((unsigned int) -1) + typedef struct hb_feature_t { hb_tag_t tag; uint32_t value; 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 a7ba85f8350..aa3921a3fdd 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc @@ -32,6 +32,7 @@ #include "hb-shaper-impl.hh" #include "hb-coretext.h" +#include "hb-aat-layout.hh" #include /* https://developer.apple.com/documentation/coretext/1508745-ctfontcreatewithgraphicsfont */ @@ -210,7 +211,7 @@ create_ct_font (CGFontRef cg_font, CGFloat font_size) } CFURLRef original_url = nullptr; -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 +#if TARGET_OS_OSX && MAC_OS_X_VERSION_MIN_REQUIRED < 1060 ATSFontRef atsFont; FSRef fsref; OSStatus status; @@ -240,7 +241,7 @@ create_ct_font (CGFontRef cg_font, CGFloat font_size) * process in Blink. This can be detected by the new file URL location * that the newly found font points to. */ CFURLRef new_url = nullptr; -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 +#if TARGET_OS_OSX && MAC_OS_X_VERSION_MIN_REQUIRED < 1060 atsFont = CTFontGetPlatformFont (new_ct_font, NULL); status = ATSFontGetFileReference (atsFont, &fsref); if (status == noErr) @@ -431,183 +432,6 @@ struct range_record_t { }; -/* The following enum members are added in OS X 10.8. */ -#define kAltHalfWidthTextSelector 6 -#define kAltProportionalTextSelector 5 -#define kAlternateHorizKanaOffSelector 1 -#define kAlternateHorizKanaOnSelector 0 -#define kAlternateKanaType 34 -#define kAlternateVertKanaOffSelector 3 -#define kAlternateVertKanaOnSelector 2 -#define kCaseSensitiveLayoutOffSelector 1 -#define kCaseSensitiveLayoutOnSelector 0 -#define kCaseSensitiveLayoutType 33 -#define kCaseSensitiveSpacingOffSelector 3 -#define kCaseSensitiveSpacingOnSelector 2 -#define kContextualAlternatesOffSelector 1 -#define kContextualAlternatesOnSelector 0 -#define kContextualAlternatesType 36 -#define kContextualLigaturesOffSelector 19 -#define kContextualLigaturesOnSelector 18 -#define kContextualSwashAlternatesOffSelector 5 -#define kContextualSwashAlternatesOnSelector 4 -#define kDefaultLowerCaseSelector 0 -#define kDefaultUpperCaseSelector 0 -#define kHistoricalLigaturesOffSelector 21 -#define kHistoricalLigaturesOnSelector 20 -#define kHojoCharactersSelector 12 -#define kJIS2004CharactersSelector 11 -#define kLowerCasePetiteCapsSelector 2 -#define kLowerCaseSmallCapsSelector 1 -#define kLowerCaseType 37 -#define kMathematicalGreekOffSelector 11 -#define kMathematicalGreekOnSelector 10 -#define kNLCCharactersSelector 13 -#define kQuarterWidthTextSelector 4 -#define kScientificInferiorsSelector 4 -#define kStylisticAltEightOffSelector 17 -#define kStylisticAltEightOnSelector 16 -#define kStylisticAltEighteenOffSelector 37 -#define kStylisticAltEighteenOnSelector 36 -#define kStylisticAltElevenOffSelector 23 -#define kStylisticAltElevenOnSelector 22 -#define kStylisticAltFifteenOffSelector 31 -#define kStylisticAltFifteenOnSelector 30 -#define kStylisticAltFiveOffSelector 11 -#define kStylisticAltFiveOnSelector 10 -#define kStylisticAltFourOffSelector 9 -#define kStylisticAltFourOnSelector 8 -#define kStylisticAltFourteenOffSelector 29 -#define kStylisticAltFourteenOnSelector 28 -#define kStylisticAltNineOffSelector 19 -#define kStylisticAltNineOnSelector 18 -#define kStylisticAltNineteenOffSelector 39 -#define kStylisticAltNineteenOnSelector 38 -#define kStylisticAltOneOffSelector 3 -#define kStylisticAltOneOnSelector 2 -#define kStylisticAltSevenOffSelector 15 -#define kStylisticAltSevenOnSelector 14 -#define kStylisticAltSeventeenOffSelector 35 -#define kStylisticAltSeventeenOnSelector 34 -#define kStylisticAltSixOffSelector 13 -#define kStylisticAltSixOnSelector 12 -#define kStylisticAltSixteenOffSelector 33 -#define kStylisticAltSixteenOnSelector 32 -#define kStylisticAltTenOffSelector 21 -#define kStylisticAltTenOnSelector 20 -#define kStylisticAltThirteenOffSelector 27 -#define kStylisticAltThirteenOnSelector 26 -#define kStylisticAltThreeOffSelector 7 -#define kStylisticAltThreeOnSelector 6 -#define kStylisticAltTwelveOffSelector 25 -#define kStylisticAltTwelveOnSelector 24 -#define kStylisticAltTwentyOffSelector 41 -#define kStylisticAltTwentyOnSelector 40 -#define kStylisticAltTwoOffSelector 5 -#define kStylisticAltTwoOnSelector 4 -#define kStylisticAlternativesType 35 -#define kSwashAlternatesOffSelector 3 -#define kSwashAlternatesOnSelector 2 -#define kThirdWidthTextSelector 3 -#define kTraditionalNamesCharactersSelector 14 -#define kUpperCasePetiteCapsSelector 2 -#define kUpperCaseSmallCapsSelector 1 -#define kUpperCaseType 38 - -/* Table data courtesy of Apple. */ -static const struct feature_mapping_t { - FourCharCode otFeatureTag; - uint16_t aatFeatureType; - uint16_t selectorToEnable; - uint16_t selectorToDisable; -} feature_mappings[] = { - { 'c2pc', kUpperCaseType, kUpperCasePetiteCapsSelector, kDefaultUpperCaseSelector }, - { 'c2sc', kUpperCaseType, kUpperCaseSmallCapsSelector, kDefaultUpperCaseSelector }, - { 'calt', kContextualAlternatesType, kContextualAlternatesOnSelector, kContextualAlternatesOffSelector }, - { 'case', kCaseSensitiveLayoutType, kCaseSensitiveLayoutOnSelector, kCaseSensitiveLayoutOffSelector }, - { 'clig', kLigaturesType, kContextualLigaturesOnSelector, kContextualLigaturesOffSelector }, - { 'cpsp', kCaseSensitiveLayoutType, kCaseSensitiveSpacingOnSelector, kCaseSensitiveSpacingOffSelector }, - { 'cswh', kContextualAlternatesType, kContextualSwashAlternatesOnSelector, kContextualSwashAlternatesOffSelector }, - { 'dlig', kLigaturesType, kRareLigaturesOnSelector, kRareLigaturesOffSelector }, - { 'expt', kCharacterShapeType, kExpertCharactersSelector, 16 }, - { 'frac', kFractionsType, kDiagonalFractionsSelector, kNoFractionsSelector }, - { 'fwid', kTextSpacingType, kMonospacedTextSelector, 7 }, - { 'halt', kTextSpacingType, kAltHalfWidthTextSelector, 7 }, - { 'hist', kLigaturesType, kHistoricalLigaturesOnSelector, kHistoricalLigaturesOffSelector }, - { 'hkna', kAlternateKanaType, kAlternateHorizKanaOnSelector, kAlternateHorizKanaOffSelector, }, - { 'hlig', kLigaturesType, kHistoricalLigaturesOnSelector, kHistoricalLigaturesOffSelector }, - { 'hngl', kTransliterationType, kHanjaToHangulSelector, kNoTransliterationSelector }, - { 'hojo', kCharacterShapeType, kHojoCharactersSelector, 16 }, - { 'hwid', kTextSpacingType, kHalfWidthTextSelector, 7 }, - { 'ital', kItalicCJKRomanType, kCJKItalicRomanOnSelector, kCJKItalicRomanOffSelector }, - { 'jp04', kCharacterShapeType, kJIS2004CharactersSelector, 16 }, - { 'jp78', kCharacterShapeType, kJIS1978CharactersSelector, 16 }, - { 'jp83', kCharacterShapeType, kJIS1983CharactersSelector, 16 }, - { 'jp90', kCharacterShapeType, kJIS1990CharactersSelector, 16 }, - { 'liga', kLigaturesType, kCommonLigaturesOnSelector, kCommonLigaturesOffSelector }, - { 'lnum', kNumberCaseType, kUpperCaseNumbersSelector, 2 }, - { 'mgrk', kMathematicalExtrasType, kMathematicalGreekOnSelector, kMathematicalGreekOffSelector }, - { 'nlck', kCharacterShapeType, kNLCCharactersSelector, 16 }, - { 'onum', kNumberCaseType, kLowerCaseNumbersSelector, 2 }, - { 'ordn', kVerticalPositionType, kOrdinalsSelector, kNormalPositionSelector }, - { 'palt', kTextSpacingType, kAltProportionalTextSelector, 7 }, - { 'pcap', kLowerCaseType, kLowerCasePetiteCapsSelector, kDefaultLowerCaseSelector }, - { 'pkna', kTextSpacingType, kProportionalTextSelector, 7 }, - { 'pnum', kNumberSpacingType, kProportionalNumbersSelector, 4 }, - { 'pwid', kTextSpacingType, kProportionalTextSelector, 7 }, - { 'qwid', kTextSpacingType, kQuarterWidthTextSelector, 7 }, - { 'ruby', kRubyKanaType, kRubyKanaOnSelector, kRubyKanaOffSelector }, - { 'sinf', kVerticalPositionType, kScientificInferiorsSelector, kNormalPositionSelector }, - { 'smcp', kLowerCaseType, kLowerCaseSmallCapsSelector, kDefaultLowerCaseSelector }, - { 'smpl', kCharacterShapeType, kSimplifiedCharactersSelector, 16 }, - { 'ss01', kStylisticAlternativesType, kStylisticAltOneOnSelector, kStylisticAltOneOffSelector }, - { 'ss02', kStylisticAlternativesType, kStylisticAltTwoOnSelector, kStylisticAltTwoOffSelector }, - { 'ss03', kStylisticAlternativesType, kStylisticAltThreeOnSelector, kStylisticAltThreeOffSelector }, - { 'ss04', kStylisticAlternativesType, kStylisticAltFourOnSelector, kStylisticAltFourOffSelector }, - { 'ss05', kStylisticAlternativesType, kStylisticAltFiveOnSelector, kStylisticAltFiveOffSelector }, - { 'ss06', kStylisticAlternativesType, kStylisticAltSixOnSelector, kStylisticAltSixOffSelector }, - { 'ss07', kStylisticAlternativesType, kStylisticAltSevenOnSelector, kStylisticAltSevenOffSelector }, - { 'ss08', kStylisticAlternativesType, kStylisticAltEightOnSelector, kStylisticAltEightOffSelector }, - { 'ss09', kStylisticAlternativesType, kStylisticAltNineOnSelector, kStylisticAltNineOffSelector }, - { 'ss10', kStylisticAlternativesType, kStylisticAltTenOnSelector, kStylisticAltTenOffSelector }, - { 'ss11', kStylisticAlternativesType, kStylisticAltElevenOnSelector, kStylisticAltElevenOffSelector }, - { 'ss12', kStylisticAlternativesType, kStylisticAltTwelveOnSelector, kStylisticAltTwelveOffSelector }, - { 'ss13', kStylisticAlternativesType, kStylisticAltThirteenOnSelector, kStylisticAltThirteenOffSelector }, - { 'ss14', kStylisticAlternativesType, kStylisticAltFourteenOnSelector, kStylisticAltFourteenOffSelector }, - { 'ss15', kStylisticAlternativesType, kStylisticAltFifteenOnSelector, kStylisticAltFifteenOffSelector }, - { 'ss16', kStylisticAlternativesType, kStylisticAltSixteenOnSelector, kStylisticAltSixteenOffSelector }, - { 'ss17', kStylisticAlternativesType, kStylisticAltSeventeenOnSelector, kStylisticAltSeventeenOffSelector }, - { 'ss18', kStylisticAlternativesType, kStylisticAltEighteenOnSelector, kStylisticAltEighteenOffSelector }, - { 'ss19', kStylisticAlternativesType, kStylisticAltNineteenOnSelector, kStylisticAltNineteenOffSelector }, - { 'ss20', kStylisticAlternativesType, kStylisticAltTwentyOnSelector, kStylisticAltTwentyOffSelector }, - { 'subs', kVerticalPositionType, kInferiorsSelector, kNormalPositionSelector }, - { 'sups', kVerticalPositionType, kSuperiorsSelector, kNormalPositionSelector }, - { 'swsh', kContextualAlternatesType, kSwashAlternatesOnSelector, kSwashAlternatesOffSelector }, - { 'titl', kStyleOptionsType, kTitlingCapsSelector, kNoStyleOptionsSelector }, - { 'tnam', kCharacterShapeType, kTraditionalNamesCharactersSelector, 16 }, - { 'tnum', kNumberSpacingType, kMonospacedNumbersSelector, 4 }, - { 'trad', kCharacterShapeType, kTraditionalCharactersSelector, 16 }, - { 'twid', kTextSpacingType, kThirdWidthTextSelector, 7 }, - { 'unic', kLetterCaseType, 14, 15 }, - { 'valt', kTextSpacingType, kAltProportionalTextSelector, 7 }, - { 'vert', kVerticalSubstitutionType, kSubstituteVerticalFormsOnSelector, kSubstituteVerticalFormsOffSelector }, - { 'vhal', kTextSpacingType, kAltHalfWidthTextSelector, 7 }, - { 'vkna', kAlternateKanaType, kAlternateVertKanaOnSelector, kAlternateVertKanaOffSelector }, - { 'vpal', kTextSpacingType, kAltProportionalTextSelector, 7 }, - { 'vrt2', kVerticalSubstitutionType, kSubstituteVerticalFormsOnSelector, kSubstituteVerticalFormsOffSelector }, - { 'zero', kTypographicExtrasType, kSlashedZeroOnSelector, kSlashedZeroOffSelector }, -}; - -static int -_hb_feature_mapping_cmp (const void *key_, const void *entry_) -{ - unsigned int key = * (unsigned int *) key_; - const feature_mapping_t * entry = (const feature_mapping_t *) entry_; - return key < entry->otFeatureTag ? -1 : - key > entry->otFeatureTag ? 1 : - 0; -} - hb_bool_t _hb_coretext_shape (hb_shape_plan_t *shape_plan, hb_font_t *font, @@ -624,7 +448,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan, CGFloat y_mult = (CGFloat) font->y_scale / ct_font_size; /* Attach marks to their bases, to match the 'ot' shaper. - * Adapted from hb-ot-shape:hb_form_clusters(). + * Adapted from a very old version of hb-ot-shape:hb_form_clusters(). * Note that this only makes us be closer to the 'ot' shaper, * but by no means the same. For example, if there's * B1 M1 B2 M2, and B1-B2 form a ligature, M2's cluster will @@ -653,11 +477,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan, hb_auto_t > feature_events; for (unsigned int i = 0; i < num_features; i++) { - const feature_mapping_t * mapping = (const feature_mapping_t *) bsearch (&features[i].tag, - feature_mappings, - ARRAY_LENGTH (feature_mappings), - sizeof (feature_mappings[0]), - _hb_feature_mapping_cmp); + const hb_aat_feature_mapping_t * mapping = hb_aat_layout_find_feature_mapping (features[i].tag); if (!mapping) continue; @@ -766,7 +586,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan, } else { active_feature_t *feature = active_features.find (&event->feature); if (feature) - active_features.remove (feature - active_features.arrayZ); + active_features.remove (feature - active_features.arrayZ()); } } } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-debug.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-debug.hh index 49663d215dc..58c190d275d 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-debug.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-debug.hh @@ -43,9 +43,10 @@ struct hb_options_t { - unsigned int unused : 1; /* In-case sign bit is here. */ - unsigned int initialized : 1; - unsigned int uniscribe_bug_compatible : 1; + bool unused : 1; /* In-case sign bit is here. */ + bool initialized : 1; + bool uniscribe_bug_compatible : 1; + bool aat : 1; }; union hb_options_union_t { @@ -67,7 +68,10 @@ hb_options (void) u.i = _hb_options.get_relaxed (); if (unlikely (!u.i)) + { _hb_options_init (); + u.i = _hb_options.get_relaxed (); + } return u.opts; } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-deprecated.h b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-deprecated.h index eac7efb42f1..5af9bdbd85d 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-deprecated.h +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-deprecated.h @@ -50,14 +50,191 @@ typedef hb_bool_t (*hb_font_get_glyph_func_t) (hb_font_t *font, void *font_data, hb_codepoint_t *glyph, void *user_data); -HB_EXTERN void +HB_EXTERN HB_DEPRECATED_FOR(hb_font_funcs_set_nominal_glyph_func or hb_font_funcs_set_variation_glyph_func) void hb_font_funcs_set_glyph_func (hb_font_funcs_t *ffuncs, hb_font_get_glyph_func_t func, void *user_data, hb_destroy_func_t destroy); -HB_EXTERN void +HB_EXTERN HB_DEPRECATED void hb_set_invert (hb_set_t *set); +/** + * hb_unicode_eastasian_width_func_t: + * + * Deprecated: 2.0.0 + */ +typedef unsigned int (*hb_unicode_eastasian_width_func_t) (hb_unicode_funcs_t *ufuncs, + hb_codepoint_t unicode, + void *user_data); + +/** + * hb_unicode_funcs_set_eastasian_width_func: + * @ufuncs: a Unicode function structure + * @func: (closure user_data) (destroy destroy) (scope notified): + * @user_data: + * @destroy: + * + * + * + * Since: 0.9.2 + * Deprecated: 2.0.0 + **/ +HB_EXTERN HB_DEPRECATED void +hb_unicode_funcs_set_eastasian_width_func (hb_unicode_funcs_t *ufuncs, + hb_unicode_eastasian_width_func_t func, + void *user_data, hb_destroy_func_t destroy); + +/** + * hb_unicode_eastasian_width: + * + * Since: 0.9.2 + * Deprecated: 2.0.0 + **/ +HB_EXTERN HB_DEPRECATED unsigned int +hb_unicode_eastasian_width (hb_unicode_funcs_t *ufuncs, + hb_codepoint_t unicode); + + +/** + * hb_unicode_decompose_compatibility_func_t: + * @ufuncs: a Unicode function structure + * @u: codepoint to decompose + * @decomposed: address of codepoint array (of length %HB_UNICODE_MAX_DECOMPOSITION_LEN) to write decomposition into + * @user_data: user data pointer as passed to hb_unicode_funcs_set_decompose_compatibility_func() + * + * Fully decompose @u to its Unicode compatibility decomposition. The codepoints of the decomposition will be written to @decomposed. + * The complete length of the decomposition will be returned. + * + * If @u has no compatibility decomposition, zero should be returned. + * + * The Unicode standard guarantees that a buffer of length %HB_UNICODE_MAX_DECOMPOSITION_LEN codepoints will always be sufficient for any + * compatibility decomposition plus an terminating value of 0. Consequently, @decompose must be allocated by the caller to be at least this length. Implementations + * of this function type must ensure that they do not write past the provided array. + * + * Return value: number of codepoints in the full compatibility decomposition of @u, or 0 if no decomposition available. + * + * Deprecated: 2.0.0 + */ +typedef unsigned int (*hb_unicode_decompose_compatibility_func_t) (hb_unicode_funcs_t *ufuncs, + hb_codepoint_t u, + hb_codepoint_t *decomposed, + void *user_data); + +/** + * HB_UNICODE_MAX_DECOMPOSITION_LEN: + * + * See Unicode 6.1 for details on the maximum decomposition length. + * + * Deprecated: 2.0.0 + */ +#define HB_UNICODE_MAX_DECOMPOSITION_LEN (18+1) /* codepoints */ + +/** + * hb_unicode_funcs_set_decompose_compatibility_func: + * @ufuncs: a Unicode function structure + * @func: (closure user_data) (destroy destroy) (scope notified): + * @user_data: + * @destroy: + * + * + * + * Since: 0.9.2 + * Deprecated: 2.0.0 + **/ +HB_EXTERN HB_DEPRECATED void +hb_unicode_funcs_set_decompose_compatibility_func (hb_unicode_funcs_t *ufuncs, + hb_unicode_decompose_compatibility_func_t func, + void *user_data, hb_destroy_func_t destroy); + +/** + * hb_unicode_decompose_compatibility: + * + * + * Deprecated: 2.0.0 + **/ +HB_EXTERN HB_DEPRECATED unsigned int +hb_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs, + hb_codepoint_t u, + hb_codepoint_t *decomposed); + + +typedef hb_position_t (*hb_font_get_glyph_kerning_func_t) (hb_font_t *font, void *font_data, + hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, + void *user_data); +typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_h_kerning_func_t; +typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_v_kerning_func_t; + +/** + * hb_font_funcs_set_glyph_h_kerning_func: + * @ffuncs: font functions. + * @func: (closure user_data) (destroy destroy) (scope notified): + * @user_data: + * @destroy: + * + * + * + * Since: 0.9.2 + * Deprecated: 2.0.0 + **/ +HB_EXTERN void +hb_font_funcs_set_glyph_h_kerning_func (hb_font_funcs_t *ffuncs, + hb_font_get_glyph_h_kerning_func_t func, + void *user_data, hb_destroy_func_t destroy); + +/** + * hb_font_funcs_set_glyph_v_kerning_func: + * @ffuncs: font functions. + * @func: (closure user_data) (destroy destroy) (scope notified): + * @user_data: + * @destroy: + * + * + * + * Since: 0.9.2 + * Deprecated: 2.0.0 + **/ +HB_EXTERN void +hb_font_funcs_set_glyph_v_kerning_func (hb_font_funcs_t *ffuncs, + hb_font_get_glyph_v_kerning_func_t func, + void *user_data, hb_destroy_func_t destroy); + +HB_EXTERN hb_position_t +hb_font_get_glyph_h_kerning (hb_font_t *font, + hb_codepoint_t left_glyph, hb_codepoint_t right_glyph); +HB_EXTERN hb_position_t +hb_font_get_glyph_v_kerning (hb_font_t *font, + hb_codepoint_t top_glyph, hb_codepoint_t bottom_glyph); + +HB_EXTERN void +hb_font_get_glyph_kerning_for_direction (hb_font_t *font, + hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y); + +/* Like hb_ot_layout_table_find_script, but takes zero-terminated array of scripts to test */ +HB_EXTERN HB_DEPRECATED_FOR (hb_ot_layout_table_select_script) hb_bool_t +hb_ot_layout_table_choose_script (hb_face_t *face, + hb_tag_t table_tag, + const hb_tag_t *script_tags, + unsigned int *script_index, + hb_tag_t *chosen_script); + +HB_EXTERN HB_DEPRECATED_FOR (hb_ot_layout_script_select_language) hb_bool_t +hb_ot_layout_script_find_language (hb_face_t *face, + hb_tag_t table_tag, + unsigned int script_index, + hb_tag_t language_tag, + unsigned int *language_index); + +HB_EXTERN HB_DEPRECATED_FOR (hb_ot_tags_from_script_and_language) void +hb_ot_tags_from_script (hb_script_t script, + hb_tag_t *script_tag_1, + hb_tag_t *script_tag_2); + +HB_EXTERN HB_DEPRECATED_FOR (hb_ot_tags_from_script_and_language) hb_tag_t +hb_ot_tag_from_language (hb_language_t language); + + #endif HB_END_DECLS diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-dsalgs.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-dsalgs.hh index 7e06ff17010..eb15c089eb6 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-dsalgs.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-dsalgs.hh @@ -29,6 +29,8 @@ #include "hb.hh" +#include "hb-null.hh" + /* Void! For when we need a expression-type of void. */ typedef const struct _hb_void_t *hb_void_t; @@ -507,20 +509,40 @@ struct hb_auto_t : Type void fini (void) {} }; +template +struct hb_array_t +{ + inline hb_array_t (void) : arrayZ (nullptr), len (0) {} + inline hb_array_t (const T *array_, unsigned int len_) : arrayZ (array_), len (len_) {} + + inline const T& operator [] (unsigned int i) const + { + if (unlikely (i >= len)) return Null(T); + return arrayZ[i]; + } + + inline void free (void) { ::free ((void *) arrayZ); arrayZ = nullptr; len = 0; } + + const T *arrayZ; + unsigned int len; +}; + struct hb_bytes_t { - inline hb_bytes_t (void) : bytes (nullptr), len (0) {} - inline hb_bytes_t (const char *bytes_, unsigned int len_) : bytes (bytes_), len (len_) {} - inline hb_bytes_t (const void *bytes_, unsigned int len_) : bytes ((const char *) bytes_), len (len_) {} + inline hb_bytes_t (void) : arrayZ (nullptr), len (0) {} + inline hb_bytes_t (const char *bytes_, unsigned int len_) : arrayZ (bytes_), len (len_) {} + inline hb_bytes_t (const void *bytes_, unsigned int len_) : arrayZ ((const char *) bytes_), len (len_) {} + template + inline hb_bytes_t (const T& array) : arrayZ ((const char *) array.arrayZ), len (array.len) {} - inline void free (void) { ::free ((void *) bytes); bytes = nullptr; len = 0; } + inline void free (void) { ::free ((void *) arrayZ); arrayZ = nullptr; len = 0; } inline int cmp (const hb_bytes_t &a) const { if (len != a.len) return (int) a.len - (int) len; - return memcmp (a.bytes, bytes, len); + return memcmp (a.arrayZ, arrayZ, len); } static inline int cmp (const void *pa, const void *pb) { @@ -529,7 +551,7 @@ struct hb_bytes_t return b->cmp (*a); } - const char *bytes; + const char *arrayZ; unsigned int len; }; 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 92c34152335..bba1ee3fa0c 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc @@ -36,12 +36,12 @@ /** - * hb_face_count: Get number of faces on the blob - * @blob: - * + * hb_face_count: + * @blob: a blob. * + * Get number of faces in a blob. * - * Return value: Number of faces on the blob + * Return value: Number of faces in @blob * * Since: 1.7.7 **/ @@ -163,11 +163,12 @@ _hb_face_for_data_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void return hb_blob_reference (data->blob); const OT::OpenTypeFontFile &ot_file = *data->blob->as (); - const OT::OpenTypeFontFace &ot_face = ot_file.get_face (data->index); + unsigned int base_offset; + const OT::OpenTypeFontFace &ot_face = ot_file.get_face (data->index, &base_offset); const OT::OpenTypeTable &table = ot_face.get_table_by_tag (tag); - hb_blob_t *blob = hb_blob_create_sub_blob (data->blob, table.offset, table.length); + hb_blob_t *blob = hb_blob_create_sub_blob (data->blob, base_offset + table.offset, table.length); return blob; } @@ -324,6 +325,8 @@ hb_face_make_immutable (hb_face_t *face) { if (unlikely (hb_object_is_inert (face))) return; + if (face->immutable) + return; face->immutable = true; } @@ -487,6 +490,9 @@ hb_face_get_glyph_count (const hb_face_t *face) /** * hb_face_get_table_tags: * @face: a face. + * @start_offset: index of first tag to return. + * @table_count: input length of @table_tags array, output number of items written. + * @table_tags: array to write tags into. * * Retrieves table tags for a face, if possible. * @@ -628,7 +634,7 @@ _hb_face_builder_data_reference_blob (hb_face_builder_data_t *data) unsigned int face_length = table_count * 16 + 12; for (unsigned int i = 0; i < table_count; i++) - face_length += hb_ceil_to_4 (hb_blob_get_length (data->tables.arrayZ[i].blob)); + face_length += hb_ceil_to_4 (hb_blob_get_length (data->tables[i].blob)); char *buf = (char *) malloc (face_length); if (unlikely (!buf)) @@ -682,7 +688,7 @@ _hb_face_builder_reference_table (hb_face_t *face, hb_tag_t tag, void *user_data * After tables are added to the face, it can be compiled to a binary * font file by calling hb_face_reference_blob(). * - * Return value: (transfer full) New face. + * Return value: (transfer full): New face. * * Since: 1.9.0 **/ 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 bc831dd53f2..7a430237c73 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc @@ -31,6 +31,8 @@ #include "hb-font.hh" #include "hb-machinery.hh" +#include "hb-ot.h" + /* * hb_font_funcs_t @@ -101,9 +103,42 @@ hb_font_get_nominal_glyph_default (hb_font_t *font, hb_codepoint_t *glyph, void *user_data HB_UNUSED) { + if (font->has_nominal_glyphs_func ()) + { + return font->get_nominal_glyphs (1, &unicode, 0, glyph, 0); + } return font->parent->get_nominal_glyph (unicode, glyph); } +#define hb_font_get_nominal_glyphs_nil hb_font_get_nominal_glyphs_default +static unsigned int +hb_font_get_nominal_glyphs_default (hb_font_t *font, + void *font_data HB_UNUSED, + unsigned int count, + const hb_codepoint_t *first_unicode, + unsigned int unicode_stride, + hb_codepoint_t *first_glyph, + unsigned int glyph_stride, + void *user_data HB_UNUSED) +{ + if (font->has_nominal_glyph_func ()) + { + for (unsigned int i = 0; i < count; i++) + { + if (!font->get_nominal_glyph (*first_unicode, first_glyph)) + return i; + + first_unicode = &StructAtOffset (first_unicode, unicode_stride); + first_glyph = &StructAtOffset (first_glyph, glyph_stride); + } + return count; + } + + return font->parent->get_nominal_glyphs (count, + first_unicode, unicode_stride, + first_glyph, glyph_stride); +} + static hb_bool_t hb_font_get_variation_glyph_nil (hb_font_t *font HB_UNUSED, void *font_data HB_UNUSED, @@ -141,6 +176,12 @@ hb_font_get_glyph_h_advance_default (hb_font_t *font, hb_codepoint_t glyph, void *user_data HB_UNUSED) { + if (font->has_glyph_h_advances_func ()) + { + hb_position_t ret; + font->get_glyph_h_advances (1, &glyph, 0, &ret, 0); + return ret; + } return font->parent_scale_x_distance (font->parent->get_glyph_h_advance (glyph)); } @@ -159,6 +200,12 @@ hb_font_get_glyph_v_advance_default (hb_font_t *font, hb_codepoint_t glyph, void *user_data HB_UNUSED) { + if (font->has_glyph_v_advances_func ()) + { + hb_position_t ret; + font->get_glyph_v_advances (1, &glyph, 0, &ret, 0); + return ret; + } return font->parent_scale_y_distance (font->parent->get_glyph_v_advance (glyph)); } @@ -167,7 +214,7 @@ static void hb_font_get_glyph_h_advances_default (hb_font_t* font, void* font_data HB_UNUSED, unsigned int count, - hb_codepoint_t *first_glyph, + const hb_codepoint_t *first_glyph, unsigned int glyph_stride, hb_position_t *first_advance, unsigned int advance_stride, @@ -199,7 +246,7 @@ static void hb_font_get_glyph_v_advances_default (hb_font_t* font, void* font_data HB_UNUSED, unsigned int count, - hb_codepoint_t *first_glyph, + const hb_codepoint_t *first_glyph, unsigned int glyph_stride, hb_position_t *first_advance, unsigned int advance_stride, @@ -586,6 +633,8 @@ hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs) { if (unlikely (hb_object_is_inert (ffuncs))) return; + if (ffuncs->immutable) + return; ffuncs->immutable = true; } @@ -793,8 +842,8 @@ hb_font_get_glyph_v_advance (hb_font_t *font, **/ void hb_font_get_glyph_h_advances (hb_font_t* font, - unsigned count, - hb_codepoint_t *first_glyph, + unsigned int count, + const hb_codepoint_t *first_glyph, unsigned glyph_stride, hb_position_t *first_advance, unsigned advance_stride) @@ -811,8 +860,8 @@ hb_font_get_glyph_h_advances (hb_font_t* font, **/ void hb_font_get_glyph_v_advances (hb_font_t* font, - unsigned count, - hb_codepoint_t *first_glyph, + unsigned int count, + const hb_codepoint_t *first_glyph, unsigned glyph_stride, hb_position_t *first_advance, unsigned advance_stride) @@ -873,6 +922,7 @@ hb_font_get_glyph_v_origin (hb_font_t *font, * Return value: * * Since: 0.9.2 + * Deprecated: 2.0.0 **/ hb_position_t hb_font_get_glyph_h_kerning (hb_font_t *font, @@ -892,6 +942,7 @@ hb_font_get_glyph_h_kerning (hb_font_t *font, * Return value: * * Since: 0.9.2 + * Deprecated: 2.0.0 **/ hb_position_t hb_font_get_glyph_v_kerning (hb_font_t *font, @@ -991,7 +1042,7 @@ hb_font_get_glyph_from_name (hb_font_t *font, * hb_font_get_extents_for_direction: * @font: a font. * @direction: - * @extents: + * @extents: (out): * * * @@ -1036,8 +1087,8 @@ hb_font_get_glyph_advance_for_direction (hb_font_t *font, HB_EXTERN void hb_font_get_glyph_advances_for_direction (hb_font_t* font, hb_direction_t direction, - unsigned count, - hb_codepoint_t *first_glyph, + unsigned int count, + const hb_codepoint_t *first_glyph, unsigned glyph_stride, hb_position_t *first_advance, unsigned advance_stride) @@ -1120,6 +1171,7 @@ hb_font_subtract_glyph_origin_for_direction (hb_font_t *font, * * * Since: 0.9.2 + * Deprecated: 2.0.0 **/ void hb_font_get_glyph_kerning_for_direction (hb_font_t *font, @@ -1254,18 +1306,8 @@ DEFINE_NULL_INSTANCE (hb_font_t) = }; -/** - * hb_font_create: (Xconstructor) - * @face: a face. - * - * - * - * Return value: (transfer full): - * - * Since: 0.9.2 - **/ -hb_font_t * -hb_font_create (hb_face_t *face) +static hb_font_t * +_hb_font_create (hb_face_t *face) { hb_font_t *font; @@ -1284,6 +1326,27 @@ hb_font_create (hb_face_t *face) return font; } +/** + * hb_font_create: (Xconstructor) + * @face: a face. + * + * + * + * Return value: (transfer full): + * + * Since: 0.9.2 + **/ +hb_font_t * +hb_font_create (hb_face_t *face) +{ + hb_font_t *font = _hb_font_create (face); + + /* Install our in-house, very lightweight, funcs. */ + hb_ot_font_set_funcs (font); + + return font; +} + /** * hb_font_create_sub_font: * @parent: parent font. @@ -1300,7 +1363,7 @@ hb_font_create_sub_font (hb_font_t *parent) if (unlikely (!parent)) parent = hb_font_get_empty (); - hb_font_t *font = hb_font_create (parent->face); + hb_font_t *font = _hb_font_create (parent->face); if (unlikely (hb_object_is_inert (font))) return font; @@ -1444,6 +1507,8 @@ hb_font_make_immutable (hb_font_t *font) { if (unlikely (hb_object_is_inert (font))) return; + if (font->immutable) + return; if (font->parent) hb_font_make_immutable (font->parent); @@ -1703,9 +1768,11 @@ hb_font_get_ppem (hb_font_t *font, /** * hb_font_set_ptem: * @font: a font. - * @ptem: + * @ptem: font size in points. * - * Sets "point size" of the font. + * Sets "point size" of the font. Set to 0 to unset. + * + * There are 72 points in an inch. * * Since: 1.6.0 **/ @@ -1843,8 +1910,6 @@ hb_font_get_var_coords_normalized (hb_font_t *font, } -#ifndef HB_DISABLE_DEPRECATED - /* * Deprecated get_glyph_func(): */ @@ -1931,9 +1996,9 @@ hb_font_get_variation_glyph_trampoline (hb_font_t *font, /** * hb_font_funcs_set_glyph_func: * @ffuncs: font functions. - * @func: (closure user_data) (destroy destroy) (scope notified): - * @user_data: - * @destroy: + * @func: (closure user_data) (destroy destroy) (scope notified): callback function. + * @user_data: data to pass to @func. + * @destroy: function to call when @user_data is not needed anymore. * * Deprecated. Use hb_font_funcs_set_nominal_glyph_func() and * hb_font_funcs_set_variation_glyph_func() instead. @@ -1967,5 +2032,3 @@ hb_font_funcs_set_glyph_func (hb_font_funcs_t *ffuncs, trampoline, trampoline_destroy); } - -#endif /* HB_DISABLE_DEPRECATED */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.h b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.h index 6cd486979b0..74c61aba487 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.h +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.h @@ -125,6 +125,14 @@ typedef hb_bool_t (*hb_font_get_variation_glyph_func_t) (hb_font_t *font, void * hb_codepoint_t *glyph, void *user_data); +typedef unsigned int (*hb_font_get_nominal_glyphs_func_t) (hb_font_t *font, void *font_data, + unsigned int count, + const hb_codepoint_t *first_unicode, + unsigned int unicode_stride, + hb_codepoint_t *first_glyph, + unsigned int glyph_stride, + void *user_data); + typedef hb_position_t (*hb_font_get_glyph_advance_func_t) (hb_font_t *font, void *font_data, hb_codepoint_t glyph, @@ -133,8 +141,8 @@ typedef hb_font_get_glyph_advance_func_t hb_font_get_glyph_h_advance_func_t; typedef hb_font_get_glyph_advance_func_t hb_font_get_glyph_v_advance_func_t; typedef void (*hb_font_get_glyph_advances_func_t) (hb_font_t* font, void* font_data, - unsigned count, - hb_codepoint_t *first_glyph, + unsigned int count, + const hb_codepoint_t *first_glyph, unsigned glyph_stride, hb_position_t *first_advance, unsigned advance_stride, @@ -149,12 +157,6 @@ typedef hb_bool_t (*hb_font_get_glyph_origin_func_t) (hb_font_t *font, void *fon typedef hb_font_get_glyph_origin_func_t hb_font_get_glyph_h_origin_func_t; typedef hb_font_get_glyph_origin_func_t hb_font_get_glyph_v_origin_func_t; -typedef hb_position_t (*hb_font_get_glyph_kerning_func_t) (hb_font_t *font, void *font_data, - hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, - void *user_data); -typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_h_kerning_func_t; -typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_v_kerning_func_t; - typedef hb_bool_t (*hb_font_get_glyph_extents_func_t) (hb_font_t *font, void *font_data, hb_codepoint_t glyph, @@ -226,6 +228,22 @@ hb_font_funcs_set_nominal_glyph_func (hb_font_funcs_t *ffuncs, hb_font_get_nominal_glyph_func_t func, void *user_data, hb_destroy_func_t destroy); +/** + * hb_font_funcs_set_nominal_glyphs_func: + * @ffuncs: font functions. + * @func: (closure user_data) (destroy destroy) (scope notified): + * @user_data: + * @destroy: + * + * + * + * Since: 2.0.0 + **/ +HB_EXTERN void +hb_font_funcs_set_nominal_glyphs_func (hb_font_funcs_t *ffuncs, + hb_font_get_nominal_glyphs_func_t func, + void *user_data, hb_destroy_func_t destroy); + /** * hb_font_funcs_set_variation_glyph_func: * @ffuncs: font functions. @@ -338,38 +356,6 @@ hb_font_funcs_set_glyph_v_origin_func (hb_font_funcs_t *ffuncs, hb_font_get_glyph_v_origin_func_t func, void *user_data, hb_destroy_func_t destroy); -/** - * hb_font_funcs_set_glyph_h_kerning_func: - * @ffuncs: font functions. - * @func: (closure user_data) (destroy destroy) (scope notified): - * @user_data: - * @destroy: - * - * - * - * Since: 0.9.2 - **/ -HB_EXTERN void -hb_font_funcs_set_glyph_h_kerning_func (hb_font_funcs_t *ffuncs, - hb_font_get_glyph_h_kerning_func_t func, - void *user_data, hb_destroy_func_t destroy); - -/** - * hb_font_funcs_set_glyph_v_kerning_func: - * @ffuncs: font functions. - * @func: (closure user_data) (destroy destroy) (scope notified): - * @user_data: - * @destroy: - * - * - * - * Since: 0.9.2 - **/ -HB_EXTERN void -hb_font_funcs_set_glyph_v_kerning_func (hb_font_funcs_t *ffuncs, - hb_font_get_glyph_v_kerning_func_t func, - void *user_data, hb_destroy_func_t destroy); - /** * hb_font_funcs_set_glyph_extents_func: * @ffuncs: font functions. @@ -461,15 +447,15 @@ hb_font_get_glyph_v_advance (hb_font_t *font, HB_EXTERN void hb_font_get_glyph_h_advances (hb_font_t* font, - unsigned count, - hb_codepoint_t *first_glyph, + unsigned int count, + const hb_codepoint_t *first_glyph, unsigned glyph_stride, hb_position_t *first_advance, unsigned advance_stride); HB_EXTERN void hb_font_get_glyph_v_advances (hb_font_t* font, - unsigned count, - hb_codepoint_t *first_glyph, + unsigned int count, + const hb_codepoint_t *first_glyph, unsigned glyph_stride, hb_position_t *first_advance, unsigned advance_stride); @@ -483,13 +469,6 @@ hb_font_get_glyph_v_origin (hb_font_t *font, hb_codepoint_t glyph, hb_position_t *x, hb_position_t *y); -HB_EXTERN hb_position_t -hb_font_get_glyph_h_kerning (hb_font_t *font, - hb_codepoint_t left_glyph, hb_codepoint_t right_glyph); -HB_EXTERN hb_position_t -hb_font_get_glyph_v_kerning (hb_font_t *font, - hb_codepoint_t top_glyph, hb_codepoint_t bottom_glyph); - HB_EXTERN hb_bool_t hb_font_get_glyph_extents (hb_font_t *font, hb_codepoint_t glyph, @@ -531,8 +510,8 @@ hb_font_get_glyph_advance_for_direction (hb_font_t *font, HB_EXTERN void hb_font_get_glyph_advances_for_direction (hb_font_t* font, hb_direction_t direction, - unsigned count, - hb_codepoint_t *first_glyph, + unsigned int count, + const hb_codepoint_t *first_glyph, unsigned glyph_stride, hb_position_t *first_advance, unsigned advance_stride); @@ -552,12 +531,6 @@ hb_font_subtract_glyph_origin_for_direction (hb_font_t *font, hb_direction_t direction, hb_position_t *x, hb_position_t *y); -HB_EXTERN void -hb_font_get_glyph_kerning_for_direction (hb_font_t *font, - hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, - hb_direction_t direction, - hb_position_t *x, hb_position_t *y); - HB_EXTERN hb_bool_t hb_font_get_glyph_extents_for_origin (hb_font_t *font, hb_codepoint_t glyph, 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 4c8d0aeec03..e10d56745fc 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.hh @@ -43,6 +43,7 @@ HB_FONT_FUNC_IMPLEMENT (font_h_extents) \ HB_FONT_FUNC_IMPLEMENT (font_v_extents) \ HB_FONT_FUNC_IMPLEMENT (nominal_glyph) \ + HB_FONT_FUNC_IMPLEMENT (nominal_glyphs) \ HB_FONT_FUNC_IMPLEMENT (variation_glyph) \ HB_FONT_FUNC_IMPLEMENT (glyph_h_advance) \ HB_FONT_FUNC_IMPLEMENT (glyph_v_advance) \ @@ -212,6 +213,18 @@ struct hb_font_t unicode, glyph, klass->user_data.nominal_glyph); } + inline unsigned int get_nominal_glyphs (unsigned int count, + const hb_codepoint_t *first_unicode, + unsigned int unicode_stride, + hb_codepoint_t *first_glyph, + unsigned int glyph_stride) + { + return klass->get.f.nominal_glyphs (this, user_data, + count, + first_unicode, unicode_stride, + first_glyph, glyph_stride, + klass->user_data.nominal_glyphs); + } inline hb_bool_t get_variation_glyph (hb_codepoint_t unicode, hb_codepoint_t variation_selector, hb_codepoint_t *glyph) @@ -237,7 +250,7 @@ struct hb_font_t } inline void get_glyph_h_advances (unsigned int count, - hb_codepoint_t *first_glyph, + const hb_codepoint_t *first_glyph, unsigned int glyph_stride, hb_position_t *first_advance, unsigned int advance_stride) @@ -250,7 +263,7 @@ struct hb_font_t } inline void get_glyph_v_advances (unsigned int count, - hb_codepoint_t *first_glyph, + const hb_codepoint_t *first_glyph, unsigned int glyph_stride, hb_position_t *first_advance, unsigned int advance_stride) @@ -377,8 +390,8 @@ struct hb_font_t *y = get_glyph_v_advance (glyph); } inline void get_glyph_advances_for_direction (hb_direction_t direction, - unsigned count, - hb_codepoint_t *first_glyph, + unsigned int count, + const hb_codepoint_t *first_glyph, unsigned glyph_stride, hb_position_t *first_advance, unsigned advance_stride) @@ -502,8 +515,8 @@ struct hb_font_t hb_position_t *x, hb_position_t *y) { if (likely (HB_DIRECTION_IS_HORIZONTAL (direction))) { - *x = get_glyph_h_kerning (first_glyph, second_glyph); *y = 0; + *x = get_glyph_h_kerning (first_glyph, second_glyph); } else { *x = 0; *y = get_glyph_v_kerning (first_glyph, second_glyph); 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 5d6abb29d16..18fb72a73cf 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc @@ -33,6 +33,7 @@ #include "hb-font.hh" #include "hb-machinery.hh" +#include "hb-cache.hh" #include FT_ADVANCES_H #include FT_MULTIPLE_MASTERS_H @@ -44,30 +45,29 @@ * In general, this file does a fine job of what it's supposed to do. * There are, however, things that need more work: * - * - I remember seeing FT_Get_Advance() without the NO_HINTING flag to be buggy. - * Have not investigated. - * * - FreeType works in 26.6 mode. Clients can decide to use that mode, and everything * would work fine. However, we also abuse this API for performing in font-space, * but don't pass the correct flags to FreeType. We just abuse the no-hinting mode * for that, such that no rounding etc happens. As such, we don't set ppem, and * pass NO_HINTING as load_flags. Would be much better to use NO_SCALE, and scale - * ourselves, like we do in uniscribe, etc. + * ourselves. * * - We don't handle / allow for emboldening / obliqueing. * * - In the future, we should add constructors to create fonts in font space? - * - * - FT_Load_Glyph() is extremely costly. Do something about it? */ struct hb_ft_font_t { + mutable hb_mutex_t lock; FT_Face ft_face; int load_flags; bool symbol; /* Whether selected cmap is symbol cmap. */ bool unref; /* Whether to destroy ft_face when done. */ + + mutable hb_atomic_int_t cached_x_scale; + mutable hb_advance_cache_t advance_cache; }; static hb_ft_font_t * @@ -78,12 +78,16 @@ _hb_ft_font_create (FT_Face ft_face, bool symbol, bool unref) if (unlikely (!ft_font)) return nullptr; + ft_font->lock.init (); ft_font->ft_face = ft_face; ft_font->symbol = symbol; ft_font->unref = unref; ft_font->load_flags = FT_LOAD_DEFAULT | FT_LOAD_NO_HINTING; + ft_font->cached_x_scale.set (0); + ft_font->advance_cache.init (); + return ft_font; } @@ -98,9 +102,13 @@ _hb_ft_font_destroy (void *data) { hb_ft_font_t *ft_font = (hb_ft_font_t *) data; + ft_font->advance_cache.fini (); + if (ft_font->unref) _hb_ft_face_destroy (ft_font->ft_face); + ft_font->lock.fini (); + free (ft_font); } @@ -168,6 +176,7 @@ hb_ft_get_nominal_glyph (hb_font_t *font HB_UNUSED, void *user_data HB_UNUSED) { const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data; + hb_lock_t lock (ft_font->lock); unsigned int g = FT_Get_Char_Index (ft_font->ft_face, unicode); if (unlikely (!g)) @@ -191,6 +200,32 @@ hb_ft_get_nominal_glyph (hb_font_t *font HB_UNUSED, return true; } +static unsigned int +hb_ft_get_nominal_glyphs (hb_font_t *font HB_UNUSED, + void *font_data, + unsigned int count, + const hb_codepoint_t *first_unicode, + unsigned int unicode_stride, + hb_codepoint_t *first_glyph, + unsigned int glyph_stride, + void *user_data HB_UNUSED) +{ + const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data; + hb_lock_t lock (ft_font->lock); + unsigned int done; + for (done = 0; + done < count && (*first_glyph = FT_Get_Char_Index (ft_font->ft_face, *first_unicode)); + done++) + { + first_unicode = &StructAtOffset (first_unicode, unicode_stride); + first_glyph = &StructAtOffset (first_glyph, glyph_stride); + } + /* We don't need to do ft_font->symbol dance here, since HB calls the singular + * nominal_glyph() for what we don't handle here. */ + return done; +} + + static hb_bool_t hb_ft_get_variation_glyph (hb_font_t *font HB_UNUSED, void *font_data, @@ -200,6 +235,7 @@ hb_ft_get_variation_glyph (hb_font_t *font HB_UNUSED, void *user_data HB_UNUSED) { const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data; + hb_lock_t lock (ft_font->lock); unsigned int g = FT_Face_GetCharVariantIndex (ft_font->ft_face, unicode, variation_selector); if (unlikely (!g)) @@ -209,22 +245,45 @@ hb_ft_get_variation_glyph (hb_font_t *font HB_UNUSED, return true; } -static hb_position_t -hb_ft_get_glyph_h_advance (hb_font_t *font, - void *font_data, - hb_codepoint_t glyph, - void *user_data HB_UNUSED) +static void +hb_ft_get_glyph_h_advances (hb_font_t* font, void* font_data, + unsigned count, + const hb_codepoint_t *first_glyph, + unsigned glyph_stride, + hb_position_t *first_advance, + unsigned advance_stride, + void *user_data HB_UNUSED) { const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data; - FT_Fixed v; + hb_lock_t lock (ft_font->lock); + FT_Face ft_face = ft_font->ft_face; + int load_flags = ft_font->load_flags; + int mult = font->x_scale < 0 ? -1 : +1; - if (unlikely (FT_Get_Advance (ft_font->ft_face, glyph, ft_font->load_flags, &v))) - return 0; + if (font->x_scale != ft_font->cached_x_scale.get ()) + { + ft_font->advance_cache.clear (); + ft_font->cached_x_scale.set (font->x_scale); + } - if (font->x_scale < 0) - v = -v; + for (unsigned int i = 0; i < count; i++) + { + FT_Fixed v = 0; + hb_codepoint_t glyph = *first_glyph; - return (v + (1<<9)) >> 10; + unsigned int cv; + if (ft_font->advance_cache.get (glyph, &cv)) + v = cv; + else + { + FT_Get_Advance (ft_face, glyph, load_flags, &v); + ft_font->advance_cache.set (glyph, v); + } + + *first_advance = (v * mult + (1<<9)) >> 10; + first_glyph = &StructAtOffset (first_glyph, glyph_stride); + first_advance = &StructAtOffset (first_advance, advance_stride); + } } static hb_position_t @@ -234,6 +293,7 @@ hb_ft_get_glyph_v_advance (hb_font_t *font, void *user_data HB_UNUSED) { const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data; + hb_lock_t lock (ft_font->lock); FT_Fixed v; if (unlikely (FT_Get_Advance (ft_font->ft_face, glyph, ft_font->load_flags | FT_LOAD_VERTICAL_LAYOUT, &v))) @@ -256,6 +316,7 @@ hb_ft_get_glyph_v_origin (hb_font_t *font, void *user_data HB_UNUSED) { const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data; + hb_lock_t lock (ft_font->lock); FT_Face ft_face = ft_font->ft_face; if (unlikely (FT_Load_Glyph (ft_face, glyph, ft_font->load_flags))) @@ -274,23 +335,6 @@ hb_ft_get_glyph_v_origin (hb_font_t *font, return true; } -static hb_position_t -hb_ft_get_glyph_h_kerning (hb_font_t *font, - void *font_data, - hb_codepoint_t left_glyph, - hb_codepoint_t right_glyph, - void *user_data HB_UNUSED) -{ - const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data; - FT_Vector kerningv; - - FT_Kerning_Mode mode = font->x_ppem ? FT_KERNING_DEFAULT : FT_KERNING_UNFITTED; - if (FT_Get_Kerning (ft_font->ft_face, left_glyph, right_glyph, mode, &kerningv)) - return 0; - - return kerningv.x; -} - static hb_bool_t hb_ft_get_glyph_extents (hb_font_t *font, void *font_data, @@ -299,6 +343,7 @@ hb_ft_get_glyph_extents (hb_font_t *font, void *user_data HB_UNUSED) { const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data; + hb_lock_t lock (ft_font->lock); FT_Face ft_face = ft_font->ft_face; if (unlikely (FT_Load_Glyph (ft_face, glyph, ft_font->load_flags))) @@ -331,6 +376,7 @@ hb_ft_get_glyph_contour_point (hb_font_t *font HB_UNUSED, void *user_data HB_UNUSED) { const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data; + hb_lock_t lock (ft_font->lock); FT_Face ft_face = ft_font->ft_face; if (unlikely (FT_Load_Glyph (ft_face, glyph, ft_font->load_flags))) @@ -356,8 +402,10 @@ hb_ft_get_glyph_name (hb_font_t *font HB_UNUSED, void *user_data HB_UNUSED) { const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data; + hb_lock_t lock (ft_font->lock); + FT_Face ft_face = ft_font->ft_face; - hb_bool_t ret = !FT_Get_Glyph_Name (ft_font->ft_face, glyph, name, size); + hb_bool_t ret = !FT_Get_Glyph_Name (ft_face, glyph, name, size); if (ret && (size && !*name)) ret = false; @@ -372,6 +420,7 @@ hb_ft_get_glyph_from_name (hb_font_t *font HB_UNUSED, void *user_data HB_UNUSED) { const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data; + hb_lock_t lock (ft_font->lock); FT_Face ft_face = ft_font->ft_face; if (len < 0) @@ -404,6 +453,7 @@ hb_ft_get_font_h_extents (hb_font_t *font HB_UNUSED, void *user_data HB_UNUSED) { const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data; + hb_lock_t lock (ft_font->lock); FT_Face ft_face = ft_font->ft_face; metrics->ascender = ft_face->size->metrics.ascender; metrics->descender = ft_face->size->metrics.descender; @@ -430,13 +480,12 @@ static struct hb_ft_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t= 2.29.12 we have to perform - * a round trip to UTF-8 and the associated memory management dance. */ - gchar utf8[6]; - gchar *utf8_decomposed, *c; - gsize utf8_len, utf8_decomposed_len, i; - - /* Convert @u to UTF-8 and normalise it in NFKD mode. This performs the compatibility decomposition. */ - utf8_len = g_unichar_to_utf8 (u, utf8); - utf8_decomposed = g_utf8_normalize (utf8, utf8_len, G_NORMALIZE_NFKD); - utf8_decomposed_len = g_utf8_strlen (utf8_decomposed, -1); - - assert (utf8_decomposed_len <= HB_UNICODE_MAX_DECOMPOSITION_LEN); - - for (i = 0, c = utf8_decomposed; i < utf8_decomposed_len; i++, c = g_utf8_next_char (c)) - *decomposed++ = g_utf8_get_char (c); - - g_free (utf8_decomposed); - - return utf8_decomposed_len; -} - #ifdef HB_USE_ATEXIT static void free_static_glib_funcs (void); @@ -376,10 +336,12 @@ static struct hb_glib_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader { hb_unicode_funcs_t *funcs = hb_unicode_funcs_create (nullptr); -#define HB_UNICODE_FUNC_IMPLEMENT(name) \ - hb_unicode_funcs_set_##name##_func (funcs, hb_glib_unicode_##name, nullptr, nullptr); - HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS -#undef HB_UNICODE_FUNC_IMPLEMENT + hb_unicode_funcs_set_combining_class_func (funcs, hb_glib_unicode_combining_class, nullptr, nullptr); + hb_unicode_funcs_set_general_category_func (funcs, hb_glib_unicode_general_category, nullptr, nullptr); + hb_unicode_funcs_set_mirroring_func (funcs, hb_glib_unicode_mirroring, nullptr, nullptr); + hb_unicode_funcs_set_script_func (funcs, hb_glib_unicode_script, nullptr, nullptr); + hb_unicode_funcs_set_compose_func (funcs, hb_glib_unicode_compose, nullptr, nullptr); + hb_unicode_funcs_set_decompose_func (funcs, hb_glib_unicode_decompose, nullptr, nullptr); hb_unicode_funcs_make_immutable (funcs); 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 817278f309b..6b2b6f19d45 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.cc @@ -33,6 +33,8 @@ #include +#include "hb-ot-tag.h" + HB_SHAPER_DATA_ENSURE_DEFINE(graphite2, face) HB_SHAPER_DATA_ENSURE_DEFINE(graphite2, font) @@ -95,6 +97,32 @@ retry: return d; } +static void hb_graphite2_release_table(const void *data, const void *table_buffer) +{ + hb_graphite2_face_data_t *face_data = (hb_graphite2_face_data_t *) data; + hb_graphite2_tablelist_t *tlist = face_data->tlist.get(); + + hb_graphite2_tablelist_t *prev = nullptr; + hb_graphite2_tablelist_t *curr = tlist; + while (curr) + { + if (hb_blob_get_data(curr->blob, nullptr) == table_buffer) + { + if (prev == nullptr) + face_data->tlist.cmpexch(tlist, curr->next); + else + prev->next = curr->next; + hb_blob_destroy(curr->blob); + free(curr); + break; + } + prev = curr; + curr = curr->next; + } +} + +static gr_face_ops hb_graphite2_face_ops = { sizeof(gr_face_ops), hb_graphite2_get_table, hb_graphite2_release_table }; + hb_graphite2_face_data_t * _hb_graphite2_shaper_face_data_create (hb_face_t *face) { @@ -113,7 +141,7 @@ _hb_graphite2_shaper_face_data_create (hb_face_t *face) return nullptr; data->face = face; - data->grface = gr_make_face (data, &hb_graphite2_get_table, gr_face_preloadAll); + data->grface = gr_make_face_with_ops (data, &hb_graphite2_face_ops, gr_face_preloadAll); if (unlikely (!data->grface)) { free (data); @@ -251,11 +279,16 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan, /* TODO ensure_native_direction. */ - hb_tag_t script_tag[2]; - hb_ot_tags_from_script (hb_buffer_get_script (buffer), &script_tag[0], &script_tag[1]); + hb_tag_t script_tag[HB_OT_MAX_TAGS_PER_SCRIPT]; + unsigned int count = HB_OT_MAX_TAGS_PER_SCRIPT; + hb_ot_tags_from_script_and_language (hb_buffer_get_script (buffer), + HB_LANGUAGE_INVALID, + &count, + script_tag, + nullptr, nullptr); seg = gr_make_seg (nullptr, grface, - script_tag[1] == HB_TAG_NONE ? script_tag[0] : script_tag[1], + count ? script_tag[count - 1] : HB_OT_TAG_DEFAULT_SCRIPT, feats, gr_utf32, chars, buffer->len, 2 | (hb_buffer_get_direction (buffer) == HB_DIRECTION_RTL ? 1 : 0)); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.h b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.h index 05c55debec9..1720191b42f 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.h +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.h @@ -41,7 +41,7 @@ hb_graphite2_face_get_gr_face (hb_face_t *face); #ifndef HB_DISABLE_DEPRECATED -HB_EXTERN gr_font * +HB_EXTERN HB_DEPRECATED_FOR (hb_graphite2_face_get_gr_face) gr_font * hb_graphite2_font_get_gr_font (hb_font_t *font); #endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-icu.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-icu.cc index 564f71fe2dc..e012314b507 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-icu.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-icu.cc @@ -31,7 +31,6 @@ #include "hb-icu.h" -#include "hb-unicode.hh" #include "hb-machinery.hh" #include @@ -73,25 +72,6 @@ hb_icu_unicode_combining_class (hb_unicode_funcs_t *ufuncs HB_UNUSED, return (hb_unicode_combining_class_t) u_getCombiningClass (unicode); } -static unsigned int -hb_icu_unicode_eastasian_width (hb_unicode_funcs_t *ufuncs HB_UNUSED, - hb_codepoint_t unicode, - void *user_data HB_UNUSED) -{ - switch (u_getIntPropertyValue(unicode, UCHAR_EAST_ASIAN_WIDTH)) - { - case U_EA_WIDE: - case U_EA_FULLWIDTH: - return 2; - case U_EA_NEUTRAL: - case U_EA_AMBIGUOUS: - case U_EA_HALFWIDTH: - case U_EA_NARROW: - return 1; - } - return 1; -} - static hb_unicode_general_category_t hb_icu_unicode_general_category (hb_unicode_funcs_t *ufuncs HB_UNUSED, hb_codepoint_t unicode, @@ -309,39 +289,6 @@ hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED, return ret; } -static unsigned int -hb_icu_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs HB_UNUSED, - hb_codepoint_t u, - hb_codepoint_t *decomposed, - void *user_data HB_UNUSED) -{ - UChar utf16[2], normalized[2 * HB_UNICODE_MAX_DECOMPOSITION_LEN + 1]; - unsigned int len; - int32_t utf32_len; - hb_bool_t err; - UErrorCode icu_err; - - /* Copy @u into a UTF-16 array to be passed to ICU. */ - len = 0; - err = false; - U16_APPEND (utf16, len, ARRAY_LENGTH (utf16), u, err); - if (err) - return 0; - - /* Normalise the codepoint using NFKD mode. */ - icu_err = U_ZERO_ERROR; - len = unorm2_normalize (unorm2_getNFKDInstance (&icu_err), utf16, len, normalized, ARRAY_LENGTH (normalized), &icu_err); - if (U_FAILURE (icu_err)) - return 0; - - /* Convert the decomposed form from UTF-16 to UTF-32. */ - icu_err = U_ZERO_ERROR; - u_strToUTF32 ((UChar32*) decomposed, HB_UNICODE_MAX_DECOMPOSITION_LEN, &utf32_len, normalized, len, &icu_err); - if (U_FAILURE (icu_err)) - return 0; - - return utf32_len; -} #ifdef HB_USE_ATEXIT static void free_static_icu_funcs (void); @@ -360,10 +307,12 @@ static struct hb_icu_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader_ hb_unicode_funcs_t *funcs = hb_unicode_funcs_create (nullptr); -#define HB_UNICODE_FUNC_IMPLEMENT(name) \ - hb_unicode_funcs_set_##name##_func (funcs, hb_icu_unicode_##name, user_data, nullptr); - HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS -#undef HB_UNICODE_FUNC_IMPLEMENT + hb_unicode_funcs_set_combining_class_func (funcs, hb_icu_unicode_combining_class, nullptr, nullptr); + hb_unicode_funcs_set_general_category_func (funcs, hb_icu_unicode_general_category, nullptr, nullptr); + hb_unicode_funcs_set_mirroring_func (funcs, hb_icu_unicode_mirroring, nullptr, nullptr); + hb_unicode_funcs_set_script_func (funcs, hb_icu_unicode_script, nullptr, nullptr); + hb_unicode_funcs_set_compose_func (funcs, hb_icu_unicode_compose, user_data, nullptr); + hb_unicode_funcs_set_decompose_func (funcs, hb_icu_unicode_decompose, user_data, nullptr); hb_unicode_funcs_make_immutable (funcs); 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 62f49072113..d836a94d629 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-machinery.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-machinery.hh @@ -217,6 +217,9 @@ struct hb_dispatch_context_t #ifndef HB_SANITIZE_MAX_OPS_MIN #define HB_SANITIZE_MAX_OPS_MIN 16384 #endif +#ifndef HB_SANITIZE_MAX_OPS_MAX +#define HB_SANITIZE_MAX_OPS_MAX 0x3FFFFFFF +#endif struct hb_sanitize_context_t : hb_dispatch_context_t @@ -224,7 +227,8 @@ struct hb_sanitize_context_t : inline hb_sanitize_context_t (void) : debug_depth (0), start (nullptr), end (nullptr), - writable (false), edit_count (0), max_ops (0), + max_ops (0), + writable (false), edit_count (0), blob (nullptr), num_glyphs (65536), num_glyphs_set (false) {} @@ -252,6 +256,23 @@ struct hb_sanitize_context_t : } inline unsigned int get_num_glyphs (void) { return num_glyphs; } + inline void set_max_ops (int max_ops_) { max_ops = max_ops_; } + + /* TODO + * This set_object() thing is to use sanitize at runtime lookup + * application time. This is very distinct from the regular + * sanitizer operation, so, eventually, separate into another + * type and make hb_aat_apply_context_t use that one instead + * of abusing this one. + */ + template + inline void set_object (const T& obj) + { + this->start = (const char *) &obj; + this->end = (const char *) &obj + obj.get_size (); + assert (this->start <= this->end); /* Must not overflow. */ + } + inline void start_processing (void) { this->start = this->blob->data; @@ -282,10 +303,10 @@ struct hb_sanitize_context_t : inline bool check_range (const void *base, unsigned int len) const { const char *p = (const char *) base; - bool ok = this->max_ops-- > 0 && - this->start <= p && + bool ok = this->start <= p && p <= this->end && - (unsigned int) (this->end - p) >= len; + (unsigned int) (this->end - p) >= len && + this->max_ops-- > 0; DEBUG_MSG_LEVEL (SANITIZE, p, this->debug_depth+1, 0, "check_range [%p..%p] (%d bytes) in [%p..%p] -> %s", @@ -296,7 +317,8 @@ struct hb_sanitize_context_t : return likely (ok); } - inline bool check_array (const void *base, unsigned int record_size, unsigned int len) const + template + inline bool check_array (const T *base, unsigned int len, unsigned int record_size = T::static_size) const { const char *p = (const char *) base; bool overflows = hb_unsigned_mul_overflows (len, record_size); @@ -422,10 +444,10 @@ struct hb_sanitize_context_t : mutable unsigned int debug_depth; const char *start, *end; + mutable int max_ops; private: bool writable; unsigned int edit_count; - mutable int max_ops; hb_blob_t *blob; unsigned int num_glyphs; bool num_glyphs_set; @@ -590,7 +612,7 @@ struct Supplier } inline Supplier (const hb_vector_t *v) { - head = v->arrayZ; + head = v->arrayZ(); len = v->len; stride = sizeof (Type); } 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 d8cdf4b64ac..75b89addb9a 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-mutex.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-mutex.hh @@ -137,5 +137,13 @@ struct hb_mutex_t inline void fini (void) { hb_mutex_impl_finish (&m); } }; +struct hb_lock_t +{ + inline hb_lock_t (hb_mutex_t &mutex_) : mutex (mutex_) { mutex.lock (); } + inline ~hb_lock_t (void) { mutex.unlock (); } + private: + hb_mutex_t &mutex; +}; + #endif /* HB_MUTEX_HH */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-null.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-null.hh index 7128f0a94f3..bf01b3af741 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-null.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-null.hh @@ -36,7 +36,7 @@ /* Global nul-content Null pool. Enlarge as necessary. */ -#define HB_NULL_POOL_SIZE 264 +#define HB_NULL_POOL_SIZE 1024 extern HB_INTERNAL hb_vector_size_impl_t const _hb_NullPool[(HB_NULL_POOL_SIZE + sizeof (hb_vector_size_impl_t) - 1) / sizeof (hb_vector_size_impl_t)]; @@ -73,19 +73,6 @@ static_assert (true, "Just so we take semicolon after.") #define DEFINE_NULL_INSTANCE(Type) \ const Type _hb_Null_##Type -/* Specializaiton to disallow Null objects. */ -#define DECLARE_NULL_DISALLOW(Type) \ - template <> inline const Type& Null (void) -#define DECLARE_NULL_NAMSPACE_DISALLOW(Namespace, Type) \ - } /* Close namespace. */ \ - template <> \ - /*static*/ inline const Namespace::Type& Null (void) { \ - extern void *_hb_undefined; \ - return *reinterpret_cast (_hb_undefined); \ - } \ - namespace Namespace { \ - static_assert (true, "Just so we take semicolon after.") - /* Global writable pool. Enlarge as necessary. */ /* To be fully correct, CrapPool must be thread_local. However, we do not rely on CrapPool 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 d3b748602ba..8772c79fa10 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 @@ -287,188 +287,159 @@ struct TTCHeader /* * Mac Resource Fork + * + * http://mirror.informatimago.com/next/developer.apple.com/documentation/mac/MoreToolbox/MoreToolbox-99.html */ -struct ResourceRefItem +struct ResourceRecord { - inline bool sanitize (hb_sanitize_context_t *c) const + inline const OpenTypeFontFace & get_face (const void *data_base) const + { return CastR ((data_base+offset).arrayZ); } + + inline bool sanitize (hb_sanitize_context_t *c, + const void *data_base) const { TRACE_SANITIZE (this); - // actual data sanitization is done on ResourceForkHeader sanitizer - return_trace (likely (c->check_struct (this))); + return_trace (c->check_struct (this) && + offset.sanitize (c, data_base) && + get_face (data_base).sanitize (c)); } - HBINT16 id; /* Resource ID, is really should be signed? */ + protected: + HBUINT16 id; /* Resource ID. */ HBINT16 nameOffset; /* Offset from beginning of resource name list - * to resource name, minus means there is no */ - HBUINT8 attr; /* Resource attributes */ - HBUINT24 dataOffset; /* Offset from beginning of resource data to + * to resource name, -1 means there is none. */ + HBUINT8 attrs; /* Resource attributes */ + OffsetTo, HBUINT24, false> + offset; /* Offset from beginning of data block to * data for this resource */ HBUINT32 reserved; /* Reserved for handle to resource */ public: DEFINE_SIZE_STATIC (12); }; -struct ResourceTypeItem +#define HB_TAG_sfnt HB_TAG ('s','f','n','t') + +struct ResourceTypeRecord { - inline bool sanitize (hb_sanitize_context_t *c) const - { - TRACE_SANITIZE (this); - // RefList sanitization is done on ResourceMap sanitizer - return_trace (likely (c->check_struct (this))); - } + inline unsigned int get_resource_count (void) const + { return tag == HB_TAG_sfnt ? resCountM1 + 1 : 0; } - inline unsigned int get_resource_count () const - { - return numRes + 1; - } + inline bool is_sfnt (void) const { return tag == HB_TAG_sfnt; } - inline bool is_sfnt () const + inline const ResourceRecord& get_resource_record (unsigned int i, + const void *type_base) const { - return type == HB_TAG ('s','f','n','t'); + return hb_array_t ((type_base+resourcesZ).arrayZ, + get_resource_count ()) [i]; } - inline const ResourceRefItem& get_ref_item (const void *base, - unsigned int i) const + inline bool sanitize (hb_sanitize_context_t *c, + const void *type_base, + const void *data_base) const { - return (base+refList)[i]; + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && + resourcesZ.sanitize (c, type_base, + get_resource_count (), + data_base)); } protected: - Tag type; /* Resource type */ - HBUINT16 numRes; /* Number of resource this type in map minus 1 */ - OffsetTo > - refList; /* Offset from beginning of resource type list - * to reference list for this type */ + Tag tag; /* Resource type. */ + HBUINT16 resCountM1; /* Number of resources minus 1. */ + OffsetTo, HBUINT16, false> + resourcesZ; /* Offset from beginning of resource type list + * to reference item list for this type. */ public: DEFINE_SIZE_STATIC (8); }; struct ResourceMap { - inline bool sanitize (hb_sanitize_context_t *c) const + inline unsigned int get_face_count (void) const { - TRACE_SANITIZE (this); - if (unlikely (!c->check_struct (this))) - return_trace (false); - for (unsigned int i = 0; i < get_types_count (); ++i) + unsigned int count = get_type_count (); + for (unsigned int i = 0; i < count; i++) { - const ResourceTypeItem& type = get_type (i); - if (unlikely (!type.sanitize (c))) - return_trace (false); - for (unsigned int j = 0; j < type.get_resource_count (); ++j) - if (unlikely (!get_ref_item (type, j).sanitize (c))) - return_trace (false); + const ResourceTypeRecord& type = get_type_record (i); + if (type.is_sfnt ()) + return type.get_resource_count (); } - return_trace (true); - } - - inline const ResourceTypeItem& get_type (unsigned int i) const - { - // Why offset from the second byte of the object? I'm not sure - return ((&reserved[2])+typeList)[i]; + return 0; } - inline unsigned int get_types_count () const + inline const OpenTypeFontFace& get_face (unsigned int idx, + const void *data_base) const { - return nTypes + 1; + unsigned int count = get_type_count (); + for (unsigned int i = 0; i < count; i++) + { + const ResourceTypeRecord& type = get_type_record (i); + /* The check for idx < count is here because ResourceRecord is NOT null-safe. + * Because an offset of 0 there does NOT mean null. */ + if (type.is_sfnt () && idx < type.get_resource_count ()) + return type.get_resource_record (idx, &(this+typeList)).get_face (data_base); + } + return Null (OpenTypeFontFace); } - inline const ResourceRefItem &get_ref_item (const ResourceTypeItem &type, - unsigned int i) const + inline bool sanitize (hb_sanitize_context_t *c, const void *data_base) const { - return type.get_ref_item (&(this+typeList), i); + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && + typeList.sanitize (c, this, + &(this+typeList), + data_base)); } - inline const PString& get_name (const ResourceRefItem &item, - unsigned int i) const - { - if (item.nameOffset == -1) - return Null (PString); + private: + inline unsigned int get_type_count (void) const { return (this+typeList).lenM1 + 1; } - return StructAtOffset (this, nameList + item.nameOffset); - } + inline const ResourceTypeRecord& get_type_record (unsigned int i) const + { return (this+typeList)[i]; } protected: - HBUINT8 reserved[16]; /* Reserved for copy of resource header */ - LOffsetTo - reserved1; /* Reserved for handle to next resource map */ - HBUINT16 reserved2; /* Reserved for file reference number */ - HBUINT16 attr; /* Resource fork attribute */ - OffsetTo > + HBUINT8 reserved0[16]; /* Reserved for copy of resource header */ + HBUINT32 reserved1; /* Reserved for handle to next resource map */ + HBUINT16 resreved2; /* Reserved for file reference number */ + HBUINT16 attrs; /* Resource fork attribute */ + OffsetTo, HBUINT16, false> typeList; /* Offset from beginning of map to * resource type list */ - HBUINT16 nameList; /* Offset from beginning of map to + Offset16 nameList; /* Offset from beginning of map to * resource name list */ - HBUINT16 nTypes; /* Number of types in the map minus 1 */ public: - DEFINE_SIZE_STATIC (30); + DEFINE_SIZE_STATIC (28); }; struct ResourceForkHeader { - inline unsigned int get_face_count () const - { - const ResourceMap &resource_map = this+map; - for (unsigned int i = 0; i < resource_map.get_types_count (); ++i) - { - const ResourceTypeItem& type = resource_map.get_type (i); - if (type.is_sfnt ()) - return type.get_resource_count (); - } - return 0; - } + inline unsigned int get_face_count (void) const + { return (this+map).get_face_count (); } - inline const LArrayOf& get_data (const ResourceTypeItem& type, - unsigned int idx) const + inline const OpenTypeFontFace& get_face (unsigned int idx, + unsigned int *base_offset = nullptr) const { - const ResourceMap &resource_map = this+map; - unsigned int offset = dataOffset; - offset += resource_map.get_ref_item (type, idx).dataOffset; - return StructAtOffset > (this, offset); - } - - inline const OpenTypeFontFace& get_face (unsigned int idx) const - { - const ResourceMap &resource_map = this+map; - for (unsigned int i = 0; i < resource_map.get_types_count (); ++i) - { - const ResourceTypeItem& type = resource_map.get_type (i); - if (type.is_sfnt () && idx < type.get_resource_count ()) - return (OpenTypeFontFace&) get_data (type, idx).arrayZ; - } - return Null (OpenTypeFontFace); + const OpenTypeFontFace &face = (this+map).get_face (idx, &(this+data)); + if (base_offset) + *base_offset = (const char *) &face - (const char *) this; + return face; } inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - if (unlikely (!c->check_struct (this))) - return_trace (false); - - const ResourceMap &resource_map = this+map; - if (unlikely (!resource_map.sanitize (c))) - return_trace (false); - - for (unsigned int i = 0; i < resource_map.get_types_count (); ++i) - { - const ResourceTypeItem& type = resource_map.get_type (i); - for (unsigned int j = 0; j < type.get_resource_count (); ++j) - { - const LArrayOf& data = get_data (type, j); - if (unlikely (!(data.sanitize (c) && - ((OpenTypeFontFace&) data.arrayZ).sanitize (c)))) - return_trace (false); - } - } - - return_trace (true); + return_trace (c->check_struct (this) && + data.sanitize (c, this, dataLen) && + map.sanitize (c, this, &(this+data))); } protected: - HBUINT32 dataOffset; /* Offset from beginning of resource fork + LOffsetTo, false> + data; /* Offset from beginning of resource fork * to resource data */ - LOffsetTo + LOffsetTo map; /* Offset from beginning of resource fork * to resource map */ HBUINT32 dataLen; /* Length of resource data */ @@ -485,7 +456,7 @@ struct OpenTypeFontFile { enum { CFFTag = HB_TAG ('O','T','T','O'), /* OpenType with Postscript outlines */ - TrueTypeTag = HB_TAG ( 0 , 1 , 0 , 0 ), /* OpenType with TrueType outlines */ + TrueTypeTag = HB_TAG ( 0 , 1 , 0 , 0 ), /* OpenType with TrueType outlines */ TTCTag = HB_TAG ('t','t','c','f'), /* TrueType Collection */ DFontTag = HB_TAG ( 0 , 0 , 1 , 0 ), /* DFont Mac Resource Fork */ TrueTag = HB_TAG ('t','r','u','e'), /* Obsolete Apple TrueType */ @@ -502,12 +473,14 @@ struct OpenTypeFontFile case Typ1Tag: case TrueTypeTag: return 1; case TTCTag: return u.ttcHeader.get_face_count (); -// case DFontTag: return u.rfHeader.get_face_count (); + case DFontTag: return u.rfHeader.get_face_count (); default: return 0; } } - inline const OpenTypeFontFace& get_face (unsigned int i) const + inline const OpenTypeFontFace& get_face (unsigned int i, unsigned int *base_offset = nullptr) const { + if (base_offset) + *base_offset = 0; switch (u.tag) { /* Note: for non-collection SFNT data we ignore index. This is because * Apple dfont container is a container of SFNT's. So each SFNT is a @@ -517,7 +490,7 @@ struct OpenTypeFontFile case Typ1Tag: case TrueTypeTag: return u.fontFace; case TTCTag: return u.ttcHeader.get_face (i); -// case DFontTag: return u.rfHeader.get_face (i); + case DFontTag: return u.rfHeader.get_face (i, base_offset); default: return Null(OpenTypeFontFace); } } @@ -544,7 +517,7 @@ struct OpenTypeFontFile case Typ1Tag: case TrueTypeTag: return_trace (u.fontFace.sanitize (c)); case TTCTag: return_trace (u.ttcHeader.sanitize (c)); -// case DFontTag: return_trace (u.rfHeader.sanitize (c)); + case DFontTag: return_trace (u.rfHeader.sanitize (c)); default: return_trace (true); } } 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 ef18163fa56..9d2e1fa7c1d 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 @@ -92,6 +92,9 @@ typedef IntType HBUINT24; /* 24-bit unsigned integer. */ /* 16-bit signed integer (HBINT16) that describes a quantity in FUnits. */ typedef HBINT16 FWORD; +/* 32-bit signed integer (HBINT32) that describes a quantity in FUnits. */ +typedef HBINT32 FWORD32; + /* 16-bit unsigned integer (HBUINT16) that describes a quantity in FUnits. */ typedef HBUINT16 UFWORD; @@ -155,10 +158,10 @@ struct Index : HBUINT16 { DECLARE_NULL_NAMESPACE_BYTES (OT, Index); /* Offset, Null offset = 0 */ -template +template struct Offset : Type { - inline bool is_null (void) const { return 0 == *this; } + inline bool is_null (void) const { return has_null && 0 == *this; } inline void *serialize (hb_serialize_context_t *c, const void *base) { @@ -226,20 +229,23 @@ struct FixedVersion * Use: (base+offset) */ -template -struct OffsetTo : Offset +template struct assert_has_min_size { static_assert (Type::min_size > 0, ""); }; +template struct assert_has_min_size {}; + +template +struct OffsetTo : Offset { + static_assert (sizeof (assert_has_min_size) || true, ""); + inline const Type& operator () (const void *base) const { - unsigned int offset = *this; - if (unlikely (!offset)) return Null(Type); - return StructAtOffset (base, offset); + if (unlikely (this->is_null ())) return Null(Type); + return StructAtOffset (base, *this); } inline Type& operator () (void *base) const { - unsigned int offset = *this; - if (unlikely (!offset)) return Crap(Type); - return StructAtOffset (base, offset); + if (unlikely (this->is_null ())) return Crap(Type); + return StructAtOffset (base, *this); } inline Type& serialize (hb_serialize_context_t *c, const void *base) @@ -260,46 +266,70 @@ struct OffsetTo : Offset this->set (0); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + inline bool sanitize_shallow (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); if (unlikely (!c->check_struct (this))) return_trace (false); - unsigned int offset = *this; - if (unlikely (!offset)) return_trace (true); - if (unlikely (!c->check_range (base, offset))) return_trace (false); - const Type &obj = StructAtOffset (base, offset); - return_trace (likely (obj.sanitize (c)) || neuter (c)); + if (unlikely (this->is_null ())) return_trace (true); + if (unlikely (!c->check_range (base, *this))) return_trace (false); + return_trace (true); } - template - inline bool sanitize (hb_sanitize_context_t *c, const void *base, T user_data) const + + inline bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); - if (unlikely (!c->check_struct (this))) return_trace (false); - unsigned int offset = *this; - if (unlikely (!offset)) return_trace (true); - if (unlikely (!c->check_range (base, offset))) return_trace (false); - const Type &obj = StructAtOffset (base, offset); - return_trace (likely (obj.sanitize (c, user_data)) || neuter (c)); + return_trace (sanitize_shallow (c, base) && + (this->is_null () || + StructAtOffset (base, *this).sanitize (c) || + neuter (c))); + } + template + inline bool sanitize (hb_sanitize_context_t *c, const void *base, T1 d1) const + { + TRACE_SANITIZE (this); + return_trace (sanitize_shallow (c, base) && + (this->is_null () || + StructAtOffset (base, *this).sanitize (c, d1) || + neuter (c))); + } + template + inline bool sanitize (hb_sanitize_context_t *c, const void *base, T1 d1, T2 d2) const + { + TRACE_SANITIZE (this); + return_trace (sanitize_shallow (c, base) && + (this->is_null () || + StructAtOffset (base, *this).sanitize (c, d1, d2) || + neuter (c))); + } + template + inline bool sanitize (hb_sanitize_context_t *c, const void *base, T1 d1, T2 d2, T3 d3) const + { + TRACE_SANITIZE (this); + return_trace (sanitize_shallow (c, base) && + (this->is_null () || + StructAtOffset (base, *this).sanitize (c, d1, d2, d3) || + neuter (c))); } /* Set the offset to Null */ - inline bool neuter (hb_sanitize_context_t *c) const { + inline bool neuter (hb_sanitize_context_t *c) const + { + if (!has_null) return false; return c->try_set (this, 0); } DEFINE_SIZE_STATIC (sizeof(OffsetType)); }; -template struct LOffsetTo : OffsetTo {}; -template -static inline const Type& operator + (const Base &base, const OffsetTo &offset) { return offset (base); } -template -static inline Type& operator + (Base &base, OffsetTo &offset) { return offset (base); } +template struct LOffsetTo : OffsetTo {}; +template +static inline const Type& operator + (const Base &base, const OffsetTo &offset) { return offset (base); } +template +static inline Type& operator + (Base &base, OffsetTo &offset) { return offset (base); } /* * Array Types */ -/* TODO Use it in ArrayOf, HeadlessArrayOf, and other places around the code base?? */ template struct UnsizedArrayOf { @@ -345,22 +375,22 @@ struct UnsizedArrayOf inline bool sanitize_shallow (hb_sanitize_context_t *c, unsigned int count) const { TRACE_SANITIZE (this); - return_trace (c->check_array (arrayZ, arrayZ[0].static_size, count)); + return_trace (c->check_array (arrayZ, count)); } public: - Type arrayZ[VAR]; + Type arrayZ[VAR]; public: DEFINE_SIZE_ARRAY (0, arrayZ); }; /* Unsized array of offset's */ -template -struct UnsizedOffsetArrayOf : UnsizedArrayOf > {}; +template +struct UnsizedOffsetArrayOf : UnsizedArrayOf > {}; /* Unsized array of offsets relative to the beginning of the array itself. */ -template -struct UnsizedOffsetListOf : UnsizedOffsetArrayOf +template +struct UnsizedOffsetListOf : UnsizedOffsetArrayOf { inline const Type& operator [] (unsigned int i) const { @@ -370,13 +400,13 @@ struct UnsizedOffsetListOf : UnsizedOffsetArrayOf inline bool sanitize (hb_sanitize_context_t *c, unsigned int count) const { TRACE_SANITIZE (this); - return_trace ((UnsizedOffsetArrayOf::sanitize (c, count, this))); + return_trace ((UnsizedOffsetArrayOf::sanitize (c, count, this))); } template inline bool sanitize (hb_sanitize_context_t *c, unsigned int count, T user_data) const { TRACE_SANITIZE (this); - return_trace ((UnsizedOffsetArrayOf::sanitize (c, count, this, user_data))); + return_trace ((UnsizedOffsetArrayOf::sanitize (c, count, this, user_data))); } }; @@ -487,12 +517,12 @@ struct ArrayOf inline bool sanitize_shallow (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return_trace (len.sanitize (c) && c->check_array (arrayZ, Type::static_size, len)); + return_trace (len.sanitize (c) && c->check_array (arrayZ, len)); } public: - LenType len; - Type arrayZ[VAR]; + LenType len; + Type arrayZ[VAR]; public: DEFINE_SIZE_ARRAY (sizeof (LenType), arrayZ); }; @@ -548,16 +578,16 @@ struct HeadlessArrayOf { inline const Type& operator [] (unsigned int i) const { - if (unlikely (i >= len || !i)) return Null(Type); + if (unlikely (i >= lenP1 || !i)) return Null(Type); return arrayZ[i-1]; } inline Type& operator [] (unsigned int i) { - if (unlikely (i >= len || !i)) return Crap(Type); + if (unlikely (i >= lenP1 || !i)) return Crap(Type); return arrayZ[i-1]; } inline unsigned int get_size (void) const - { return len.static_size + (len ? len - 1 : 0) * Type::static_size; } + { return lenP1.static_size + (lenP1 ? lenP1 - 1 : 0) * Type::static_size; } inline bool serialize (hb_serialize_context_t *c, Supplier &items, @@ -565,7 +595,7 @@ struct HeadlessArrayOf { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (*this))) return_trace (false); - len.set (items_len); /* TODO(serialize) Overflow? */ + lenP1.set (items_len); /* TODO(serialize) Overflow? */ if (unlikely (!items_len)) return_trace (true); if (unlikely (!c->extend (*this))) return_trace (false); for (unsigned int i = 0; i < items_len - 1; i++) @@ -595,13 +625,57 @@ struct HeadlessArrayOf inline bool sanitize_shallow (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return_trace (len.sanitize (c) && - (!len || c->check_array (arrayZ, Type::static_size, len - 1))); + return_trace (lenP1.sanitize (c) && + (!lenP1 || c->check_array (arrayZ, lenP1 - 1))); } public: - LenType len; - Type arrayZ[VAR]; + LenType lenP1; + Type arrayZ[VAR]; + public: + DEFINE_SIZE_ARRAY (sizeof (LenType), arrayZ); +}; + +/* An array storing length-1. */ +template +struct ArrayOfM1 +{ + inline const Type& operator [] (unsigned int i) const + { + if (unlikely (i > lenM1)) return Null(Type); + return arrayZ[i]; + } + inline Type& operator [] (unsigned int i) + { + if (unlikely (i > lenM1)) return Crap(Type); + return arrayZ[i]; + } + inline unsigned int get_size (void) const + { return lenM1.static_size + (lenM1 + 1) * Type::static_size; } + + template + inline bool sanitize (hb_sanitize_context_t *c, const void *base, T user_data) const + { + TRACE_SANITIZE (this); + if (unlikely (!sanitize_shallow (c))) return_trace (false); + unsigned int count = lenM1 + 1; + for (unsigned int i = 0; i < count; i++) + if (unlikely (!arrayZ[i].sanitize (c, base, user_data))) + return_trace (false); + return_trace (true); + } + + private: + inline bool sanitize_shallow (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (lenM1.sanitize (c) && + (c->check_array (arrayZ, lenM1 + 1))); + } + + public: + LenType lenM1; + Type arrayZ[VAR]; public: DEFINE_SIZE_ARRAY (sizeof (LenType), arrayZ); }; @@ -631,7 +705,11 @@ struct SortedArrayOf : ArrayOf } }; -/* Binary-search arrays */ +/* + * Binary-search arrays + */ + +template struct BinSearchHeader { inline operator uint32_t (void) const { return len; } @@ -654,17 +732,117 @@ struct BinSearchHeader } protected: - HBUINT16 len; - HBUINT16 searchRange; - HBUINT16 entrySelector; - HBUINT16 rangeShift; + LenType len; + LenType searchRange; + LenType entrySelector; + LenType rangeShift; public: DEFINE_SIZE_STATIC (8); }; +template +struct BinSearchArrayOf : SortedArrayOf > {}; + +struct VarSizedBinSearchHeader +{ + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this)); + } + + HBUINT16 unitSize; /* Size of a lookup unit for this search in bytes. */ + HBUINT16 nUnits; /* Number of units of the preceding size to be searched. */ + HBUINT16 searchRange; /* The value of unitSize times the largest power of 2 + * that is less than or equal to the value of nUnits. */ + HBUINT16 entrySelector; /* The log base 2 of the largest power of 2 less than + * or equal to the value of nUnits. */ + HBUINT16 rangeShift; /* The value of unitSize times the difference of the + * value of nUnits minus the largest power of 2 less + * than or equal to the value of nUnits. */ + public: + DEFINE_SIZE_STATIC (10); +}; + template -struct BinSearchArrayOf : SortedArrayOf {}; +struct VarSizedBinSearchArrayOf +{ + inline const Type& operator [] (unsigned int i) const + { + if (unlikely (i >= header.nUnits)) return Null(Type); + return StructAtOffset (&bytesZ, i * header.unitSize); + } + inline Type& operator [] (unsigned int i) + { + return StructAtOffset (&bytesZ, i * header.unitSize); + } + inline unsigned int get_size (void) const + { return header.static_size + header.nUnits * header.unitSize; } + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + if (unlikely (!sanitize_shallow (c))) return_trace (false); + + /* Note: for structs that do not reference other structs, + * we do not need to call their sanitize() as we already did + * a bound check on the aggregate array size. We just include + * a small unreachable expression to make sure the structs + * pointed to do have a simple sanitize(), ie. they do not + * reference other structs via offsets. + */ + (void) (false && StructAtOffset (&bytesZ, 0).sanitize (c)); + + return_trace (true); + } + inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + { + TRACE_SANITIZE (this); + if (unlikely (!sanitize_shallow (c))) return_trace (false); + unsigned int count = header.nUnits; + for (unsigned int i = 0; i < count; i++) + if (unlikely (!(*this)[i].sanitize (c, base))) + return_trace (false); + return_trace (true); + } + + template + inline const Type *bsearch (const T &key) const + { + unsigned int size = header.unitSize; + int min = 0, max = (int) header.nUnits - 1; + while (min <= max) + { + int mid = (min + max) / 2; + const Type *p = (const Type *) (((const char *) &bytesZ) + (mid * size)); + int c = p->cmp (key); + if (c < 0) + max = mid - 1; + else if (c > 0) + min = mid + 1; + else + return p; + } + return nullptr; + } + + private: + inline bool sanitize_shallow (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (header.sanitize (c) && + Type::static_size <= header.unitSize && + c->check_array (bytesZ.arrayZ, header.nUnits, header.unitSize)); + } + + protected: + VarSizedBinSearchHeader header; + UnsizedArrayOf bytesZ; + public: + DEFINE_SIZE_ARRAY (10, bytesZ); +}; } /* namespace OT */ 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 e6876d12cf6..e5793c387ea 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 @@ -231,7 +231,7 @@ struct CmapSubtableFormat4 inline void init (const CmapSubtableFormat4 *subtable) { segCount = subtable->segCountX2 / 2; - endCount = subtable->values; + endCount = subtable->values.arrayZ; startCount = endCount + segCount + 1; idDelta = startCount + segCount; idRangeOffset = idDelta + segCount; @@ -369,7 +369,8 @@ struct CmapSubtableFormat4 HBUINT16 entrySelector; /* log2(searchRange/2) */ HBUINT16 rangeShift; /* 2 x segCount - searchRange */ - HBUINT16 values[VAR]; + UnsizedArrayOf + values; #if 0 HBUINT16 endCount[segCount]; /* End characterCode for each segment, * last=0xFFFFu. */ @@ -377,7 +378,8 @@ struct CmapSubtableFormat4 HBUINT16 startCount[segCount]; /* Start character code for each segment. */ HBINT16 idDelta[segCount]; /* Delta for all character codes in segment. */ HBUINT16 idRangeOffset[segCount];/* Offsets into glyphIdArray or 0 */ - HBUINT16 glyphIdArray[VAR]; /* Glyph index array (arbitrary length) */ + UnsizedArrayOf + glyphIdArray; /* Glyph index array (arbitrary length) */ #endif public: @@ -493,7 +495,7 @@ struct CmapSubtableLongSegmented { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (*this))) return_trace (false); - Supplier supplier (group_data.arrayZ, group_data.len); + Supplier supplier (group_data.arrayZ(), group_data.len); if (unlikely (!groups.serialize (c, supplier, group_data.len))) return_trace (false); return true; } @@ -707,9 +709,9 @@ struct VariationSelectorRecord HBUINT24 varSelector; /* Variation selector. */ LOffsetTo - defaultUVS; /* Offset to Default UVS Table. May be 0. */ + defaultUVS; /* Offset to Default UVS Table. May be 0. */ LOffsetTo - nonDefaultUVS; /* Offset to Non-Default UVS Table. May be 0. */ + nonDefaultUVS; /* Offset to Non-Default UVS Table. May be 0. */ public: DEFINE_SIZE_STATIC (11); }; 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 8bedf2224a0..1e1fe095613 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 @@ -128,7 +128,7 @@ struct IndexSubtableFormat1Or3 { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && - c->check_array (offsetArrayZ, offsetArrayZ[0].static_size, glyph_count + 1)); + offsetArrayZ.sanitize (c, glyph_count + 1)); } bool get_image_data (unsigned int idx, @@ -144,7 +144,8 @@ struct IndexSubtableFormat1Or3 } IndexSubtableHeader header; - Offset offsetArrayZ[VAR]; + UnsizedArrayOf > + offsetArrayZ; public: DEFINE_SIZE_ARRAY(8, offsetArrayZ); }; @@ -205,24 +206,23 @@ struct IndexSubtableRecord TRACE_SANITIZE (this); return_trace (c->check_struct (this) && firstGlyphIndex <= lastGlyphIndex && - offsetToSubtable.sanitize (c, this, lastGlyphIndex - firstGlyphIndex + 1)); + offsetToSubtable.sanitize (c, base, lastGlyphIndex - firstGlyphIndex + 1)); } - inline bool get_extents (hb_glyph_extents_t *extents) const + inline bool get_extents (hb_glyph_extents_t *extents, + const void *base) const { - return (this+offsetToSubtable).get_extents (extents); + return (base+offsetToSubtable).get_extents (extents); } - bool get_image_data (unsigned int gid, + bool get_image_data (unsigned int gid, + const void *base, unsigned int *offset, unsigned int *length, unsigned int *format) const { - if (gid < firstGlyphIndex || gid > lastGlyphIndex) - { - return false; - } - return (this+offsetToSubtable).get_image_data (gid - firstGlyphIndex, + if (gid < firstGlyphIndex || gid > lastGlyphIndex) return false; + return (base+offsetToSubtable).get_image_data (gid - firstGlyphIndex, offset, length, format); } @@ -240,12 +240,7 @@ struct IndexSubtableArray inline bool sanitize (hb_sanitize_context_t *c, unsigned int count) const { TRACE_SANITIZE (this); - if (unlikely (!c->check_array (&indexSubtablesZ, indexSubtablesZ[0].static_size, count))) - return_trace (false); - for (unsigned int i = 0; i < count; i++) - if (unlikely (!indexSubtablesZ[i].sanitize (c, this))) - return_trace (false); - return_trace (true); + return_trace (indexSubtablesZ.sanitize (c, count, this)); } public: @@ -255,17 +250,14 @@ struct IndexSubtableArray { unsigned int firstGlyphIndex = indexSubtablesZ[i].firstGlyphIndex; unsigned int lastGlyphIndex = indexSubtablesZ[i].lastGlyphIndex; - if (firstGlyphIndex <= glyph && glyph <= lastGlyphIndex) { + if (firstGlyphIndex <= glyph && glyph <= lastGlyphIndex) return &indexSubtablesZ[i]; - } } return nullptr; } protected: - IndexSubtableRecord indexSubtablesZ[VAR]; - public: - DEFINE_SIZE_ARRAY(0, indexSubtablesZ); + UnsizedArrayOf indexSubtablesZ; }; struct BitmapSizeTable @@ -278,18 +270,20 @@ struct BitmapSizeTable TRACE_SANITIZE (this); return_trace (c->check_struct (this) && indexSubtableArrayOffset.sanitize (c, base, numberOfIndexSubtables) && - c->check_range (&(base+indexSubtableArrayOffset), indexTablesSize) && horizontal.sanitize (c) && vertical.sanitize (c)); } - const IndexSubtableRecord *find_table (hb_codepoint_t glyph, const void *base) const + const IndexSubtableRecord *find_table (hb_codepoint_t glyph, + const void *base, + const void **out_base) const { + *out_base = &(base+indexSubtableArrayOffset); return (base+indexSubtableArrayOffset).find_table (glyph, numberOfIndexSubtables); } protected: - LOffsetTo + LOffsetTo indexSubtableArrayOffset; HBUINT32 indexTablesSize; HBUINT32 numberOfIndexSubtables; @@ -350,7 +344,8 @@ struct CBLC protected: const IndexSubtableRecord *find_table (hb_codepoint_t glyph, - unsigned int *x_ppem, unsigned int *y_ppem) const + unsigned int *x_ppem, unsigned int *y_ppem, + const void **base) const { /* TODO: Make it possible to select strike. */ @@ -363,7 +358,7 @@ struct CBLC { *x_ppem = sizeTables[i].ppemX; *y_ppem = sizeTables[i].ppemY; - return sizeTables[i].find_table (glyph, this); + return sizeTables[i].find_table (glyph, this, base); } } @@ -421,15 +416,16 @@ struct CBDT if (!cblc) return false; // Not a color bitmap font. - const IndexSubtableRecord *subtable_record = this->cblc->find_table(glyph, &x_ppem, &y_ppem); + const void *base; + const IndexSubtableRecord *subtable_record = this->cblc->find_table (glyph, &x_ppem, &y_ppem, &base); if (!subtable_record || !x_ppem || !y_ppem) return false; - if (subtable_record->get_extents (extents)) + if (subtable_record->get_extents (extents, base)) return true; unsigned int image_offset = 0, image_length = 0, image_format = 0; - if (!subtable_record->get_image_data (glyph, &image_offset, &image_length, &image_format)) + if (!subtable_record->get_image_data (glyph, base, &image_offset, &image_length, &image_format)) return false; { @@ -480,7 +476,7 @@ struct CBDT { unsigned int image_offset = 0, image_length = 0, image_format = 0; - if (!subtable_record.get_image_data (gid, + if (!subtable_record.get_image_data (gid, &subtable_array, &image_offset, &image_length, &image_format)) continue; @@ -527,8 +523,8 @@ struct CBDT protected: - FixedVersion<> version; - HBUINT8 dataZ[VAR]; + FixedVersion<> version; + UnsizedArrayOf dataZ; public: DEFINE_SIZE_ARRAY(4, dataZ); }; 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 070226f18e2..a59d2bfa93e 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 @@ -129,9 +129,9 @@ struct COLR protected: HBUINT16 version; /* Table version number */ HBUINT16 numBaseGlyphs; /* Number of Base Glyph Records */ - LOffsetTo > + LOffsetTo, false> baseGlyphsZ; /* Offset to Base Glyph records. */ - LOffsetTo > + LOffsetTo, false> layersZ; /* Offset to Layer Records */ HBUINT16 numLayers; /* Number of Layer Records */ public: diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-cpal-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-cpal-table.hh index 2c9fced093e..e354ced5c28 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-cpal-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-cpal-table.hh @@ -118,15 +118,15 @@ struct CPALV1Tail } protected: - LOffsetTo > + LOffsetTo, false> paletteFlagsZ; /* Offset from the beginning of CPAL table to * the Palette Type Array. Set to 0 if no array * is provided. */ - LOffsetTo > + LOffsetTo, false> paletteLabelZ; /* Offset from the beginning of CPAL table to * the Palette Labels Array. Set to 0 if no * array is provided. */ - LOffsetTo > + LOffsetTo, false> paletteEntryLabelZ; /* Offset from the beginning of CPAL table to * the Palette Entry Label Array. Set to 0 * if no array is provided. */ @@ -207,7 +207,7 @@ struct CPAL HBUINT16 numPalettes; /* Number of palettes in the table. */ HBUINT16 numColorRecords; /* Total number of color records, combined for * all palettes. */ - LOffsetTo > + LOffsetTo, false> colorRecordsZ; /* Offset from the beginning of CPAL table to * the first ColorRecord. */ UnsizedArrayOf diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-svg-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-svg-table.hh index ad9162f7c7d..53d466846a4 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-svg-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-svg-table.hh @@ -54,7 +54,7 @@ struct SVGDocumentIndexEntry * this index entry. */ HBUINT16 endGlyphID; /* The last glyph ID in the range described by * this index entry. Must be >= startGlyphID. */ - LOffsetTo > + LOffsetTo, false> svgDoc; /* Offset from the beginning of the SVG Document Index * to an SVG document. Must be non-zero. */ HBUINT32 svgDocLength; /* Length of the SVG document. diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-face.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-face.cc index 388a5972058..1bc68d36690 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-face.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-face.cc @@ -40,19 +40,19 @@ void hb_ot_face_data_t::init0 (hb_face_t *face) { this->face = face; -#define HB_OT_LAYOUT_TABLE(Namespace, Type) Type.init0 (); -#define HB_OT_LAYOUT_ACCELERATOR(Namespace, Type) HB_OT_LAYOUT_TABLE (Namespace, Type) - HB_OT_LAYOUT_TABLES -#undef HB_OT_LAYOUT_ACCELERATOR -#undef HB_OT_LAYOUT_TABLE +#define HB_OT_TABLE(Namespace, Type) Type.init0 (); +#define HB_OT_ACCELERATOR(Namespace, Type) HB_OT_TABLE (Namespace, Type) + HB_OT_TABLES +#undef HB_OT_ACCELERATOR +#undef HB_OT_TABLE } void hb_ot_face_data_t::fini (void) { -#define HB_OT_LAYOUT_TABLE(Namespace, Type) Type.fini (); -#define HB_OT_LAYOUT_ACCELERATOR(Namespace, Type) HB_OT_LAYOUT_TABLE (Namespace, Type) - HB_OT_LAYOUT_TABLES -#undef HB_OT_LAYOUT_ACCELERATOR -#undef HB_OT_LAYOUT_TABLE +#define HB_OT_TABLE(Namespace, Type) Type.fini (); +#define HB_OT_ACCELERATOR(Namespace, Type) HB_OT_TABLE (Namespace, Type) + HB_OT_TABLES +#undef HB_OT_ACCELERATOR +#undef HB_OT_TABLE } hb_ot_face_data_t * diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-face.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-face.hh index 5ac3538e44d..e3059221855 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-face.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-face.hh @@ -43,66 +43,66 @@ /* Most of these tables are NOT needed for shaping. But we need to hook them *somewhere*. * This is as good as any place. */ -#define HB_OT_LAYOUT_TABLES \ +#define HB_OT_TABLES \ /* OpenType shaping. */ \ - HB_OT_LAYOUT_TABLE(OT, JSTF) \ - HB_OT_LAYOUT_TABLE(OT, BASE) \ + HB_OT_TABLE(OT, JSTF) \ + HB_OT_TABLE(OT, BASE) \ /* AAT shaping. */ \ - HB_OT_LAYOUT_TABLE(AAT, morx) \ - HB_OT_LAYOUT_TABLE(AAT, kerx) \ - HB_OT_LAYOUT_TABLE(AAT, ankr) \ - HB_OT_LAYOUT_TABLE(AAT, trak) \ + HB_OT_TABLE(AAT, morx) \ + HB_OT_TABLE(AAT, kerx) \ + HB_OT_TABLE(AAT, ankr) \ + HB_OT_TABLE(AAT, trak) \ /* OpenType variations. */ \ - HB_OT_LAYOUT_TABLE(OT, fvar) \ - HB_OT_LAYOUT_TABLE(OT, avar) \ - HB_OT_LAYOUT_TABLE(OT, MVAR) \ + HB_OT_TABLE(OT, fvar) \ + HB_OT_TABLE(OT, avar) \ + HB_OT_TABLE(OT, MVAR) \ /* OpenType math. */ \ - HB_OT_LAYOUT_TABLE(OT, MATH) \ + HB_OT_TABLE(OT, MATH) \ /* OpenType fundamentals. */ \ - HB_OT_LAYOUT_ACCELERATOR(OT, GDEF) \ - HB_OT_LAYOUT_ACCELERATOR(OT, GSUB) \ - HB_OT_LAYOUT_ACCELERATOR(OT, GPOS) \ - HB_OT_LAYOUT_ACCELERATOR(OT, cmap) \ - HB_OT_LAYOUT_ACCELERATOR(OT, hmtx) \ - HB_OT_LAYOUT_ACCELERATOR(OT, vmtx) \ - HB_OT_LAYOUT_ACCELERATOR(OT, post) \ - HB_OT_LAYOUT_ACCELERATOR(OT, kern) \ - HB_OT_LAYOUT_ACCELERATOR(OT, glyf) \ - HB_OT_LAYOUT_ACCELERATOR(OT, CBDT) \ + HB_OT_ACCELERATOR(OT, GDEF) \ + HB_OT_ACCELERATOR(OT, GSUB) \ + HB_OT_ACCELERATOR(OT, GPOS) \ + HB_OT_ACCELERATOR(OT, cmap) \ + HB_OT_ACCELERATOR(OT, hmtx) \ + HB_OT_ACCELERATOR(OT, vmtx) \ + HB_OT_ACCELERATOR(OT, post) \ + HB_OT_ACCELERATOR(OT, kern) \ + HB_OT_ACCELERATOR(OT, glyf) \ + HB_OT_ACCELERATOR(OT, CBDT) \ /* */ /* Declare tables. */ -#define HB_OT_LAYOUT_TABLE(Namespace, Type) namespace Namespace { struct Type; } -#define HB_OT_LAYOUT_ACCELERATOR(Namespace, Type) HB_OT_LAYOUT_TABLE (Namespace, Type##_accelerator_t) -HB_OT_LAYOUT_TABLES -#undef HB_OT_LAYOUT_ACCELERATOR -#undef HB_OT_LAYOUT_TABLE +#define HB_OT_TABLE(Namespace, Type) namespace Namespace { struct Type; } +#define HB_OT_ACCELERATOR(Namespace, Type) HB_OT_TABLE (Namespace, Type##_accelerator_t) +HB_OT_TABLES +#undef HB_OT_ACCELERATOR +#undef HB_OT_TABLE struct hb_ot_face_data_t { HB_INTERNAL void init0 (hb_face_t *face); HB_INTERNAL void fini (void); -#define HB_OT_LAYOUT_TABLE_ORDER(Namespace, Type) \ +#define HB_OT_TABLE_ORDER(Namespace, Type) \ HB_PASTE (ORDER_, HB_PASTE (Namespace, HB_PASTE (_, Type))) enum order_t { ORDER_ZERO, -#define HB_OT_LAYOUT_TABLE(Namespace, Type) HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type), -#define HB_OT_LAYOUT_ACCELERATOR(Namespace, Type) HB_OT_LAYOUT_TABLE (Namespace, Type) - HB_OT_LAYOUT_TABLES -#undef HB_OT_LAYOUT_ACCELERATOR -#undef HB_OT_LAYOUT_TABLE +#define HB_OT_TABLE(Namespace, Type) HB_OT_TABLE_ORDER (Namespace, Type), +#define HB_OT_ACCELERATOR(Namespace, Type) HB_OT_TABLE (Namespace, Type) + HB_OT_TABLES +#undef HB_OT_ACCELERATOR +#undef HB_OT_TABLE }; hb_face_t *face; /* MUST be JUST before the lazy loaders. */ -#define HB_OT_LAYOUT_TABLE(Namespace, Type) \ - hb_table_lazy_loader_t Type; -#define HB_OT_LAYOUT_ACCELERATOR(Namespace, Type) \ - hb_face_lazy_loader_t Type; - HB_OT_LAYOUT_TABLES -#undef HB_OT_LAYOUT_ACCELERATOR -#undef HB_OT_LAYOUT_TABLE +#define HB_OT_TABLE(Namespace, Type) \ + hb_table_lazy_loader_t Type; +#define HB_OT_ACCELERATOR(Namespace, Type) \ + hb_face_lazy_loader_t Type; + HB_OT_TABLES +#undef HB_OT_ACCELERATOR +#undef HB_OT_TABLE }; 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 a4c5584fbd9..e6df038d322 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 @@ -46,10 +46,32 @@ hb_ot_get_nominal_glyph (hb_font_t *font HB_UNUSED, hb_codepoint_t unicode, hb_codepoint_t *glyph, void *user_data HB_UNUSED) +{ + const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data; + return ot_face->cmap.get ()->get_nominal_glyph (unicode, glyph); +} +static unsigned int +hb_ot_get_nominal_glyphs (hb_font_t *font HB_UNUSED, + void *font_data, + unsigned int count, + const hb_codepoint_t *first_unicode, + unsigned int unicode_stride, + hb_codepoint_t *first_glyph, + unsigned int glyph_stride, + void *user_data HB_UNUSED) { - const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data; - return ot_font->cmap.get_relaxed()->get_nominal_glyph (unicode, glyph); + const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data; + const OT::cmap_accelerator_t &cmap = *ot_face->cmap.get (); + unsigned int done; + for (done = 0; + done < count && cmap.get_nominal_glyph (*first_unicode, first_glyph); + done++) + { + first_unicode = &StructAtOffset (first_unicode, unicode_stride); + first_glyph = &StructAtOffset (first_glyph, glyph_stride); + } + return done; } static hb_bool_t @@ -60,39 +82,77 @@ hb_ot_get_variation_glyph (hb_font_t *font HB_UNUSED, hb_codepoint_t *glyph, void *user_data HB_UNUSED) { - const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data; - return ot_font->cmap.get_relaxed ()->get_variation_glyph (unicode, variation_selector, glyph); + const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data; + return ot_face->cmap.get ()->get_variation_glyph (unicode, variation_selector, glyph); } -static hb_position_t -hb_ot_get_glyph_h_advance (hb_font_t *font, - void *font_data, - hb_codepoint_t glyph, - void *user_data HB_UNUSED) +static void +hb_ot_get_glyph_h_advances (hb_font_t* font, void* font_data, + unsigned count, + const hb_codepoint_t *first_glyph, + unsigned glyph_stride, + hb_position_t *first_advance, + unsigned advance_stride, + void *user_data HB_UNUSED) { - const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data; - return font->em_scale_x (ot_font->hmtx.get_relaxed ()->get_advance (glyph, font)); + const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data; + const OT::hmtx_accelerator_t &hmtx = *ot_face->hmtx.get (); + + for (unsigned int i = 0; i < count; i++) + { + *first_advance = font->em_scale_x (hmtx.get_advance (*first_glyph, font)); + first_glyph = &StructAtOffset (first_glyph, glyph_stride); + first_advance = &StructAtOffset (first_advance, advance_stride); + } } -static hb_position_t -hb_ot_get_glyph_v_advance (hb_font_t *font, - void *font_data, - hb_codepoint_t glyph, - void *user_data HB_UNUSED) +static void +hb_ot_get_glyph_v_advances (hb_font_t* font, void* font_data, + unsigned count, + const hb_codepoint_t *first_glyph, + unsigned glyph_stride, + hb_position_t *first_advance, + unsigned advance_stride, + void *user_data HB_UNUSED) { - const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data; - return font->em_scale_y (-(int) ot_font->vmtx.get_relaxed ()->get_advance (glyph, font)); + const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data; + const OT::vmtx_accelerator_t &vmtx = *ot_face->vmtx.get (); + + for (unsigned int i = 0; i < count; i++) + { + *first_advance = font->em_scale_y (-(int) vmtx.get_advance (*first_glyph, font)); + first_glyph = &StructAtOffset (first_glyph, glyph_stride); + first_advance = &StructAtOffset (first_advance, advance_stride); + } } -static hb_position_t -hb_ot_get_glyph_h_kerning (hb_font_t *font, - void *font_data, - hb_codepoint_t left_glyph, - hb_codepoint_t right_glyph, - void *user_data HB_UNUSED) +static hb_bool_t +hb_ot_get_glyph_v_origin (hb_font_t *font, + void *font_data, + hb_codepoint_t glyph, + hb_position_t *x, + hb_position_t *y, + void *user_data HB_UNUSED) { - const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data; - return font->em_scale_x (ot_font->kern->get_h_kerning (left_glyph, right_glyph)); + const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data; + + *x = font->get_glyph_h_advance (glyph) / 2; + + hb_glyph_extents_t extents = {0}; + bool ret = ot_face->glyf->get_extents (glyph, &extents); + if (ret) + { + const OT::vmtx_accelerator_t &vmtx = *ot_face->vmtx.get (); + hb_position_t tsb = vmtx.get_side_bearing (glyph); + *y = font->em_scale_y (extents.y_bearing + tsb); + return true; + } + + hb_font_extents_t font_extents; + font->get_h_extents_with_fallback (&font_extents); + *y = font_extents.ascender; + + return true; } static hb_bool_t @@ -102,10 +162,10 @@ hb_ot_get_glyph_extents (hb_font_t *font, hb_glyph_extents_t *extents, void *user_data HB_UNUSED) { - const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data; - bool ret = ot_font->glyf->get_extents (glyph, extents); + const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data; + bool ret = ot_face->glyf->get_extents (glyph, extents); if (!ret) - ret = ot_font->CBDT->get_extents (glyph, extents); + ret = ot_face->CBDT->get_extents (glyph, extents); // TODO Hook up side-bearings variations. extents->x_bearing = font->em_scale_x (extents->x_bearing); extents->y_bearing = font->em_scale_y (extents->y_bearing); @@ -121,8 +181,8 @@ hb_ot_get_glyph_name (hb_font_t *font HB_UNUSED, char *name, unsigned int size, void *user_data HB_UNUSED) { - const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data; - return ot_font->post->get_glyph_name (glyph, name, size); + const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data; + return ot_face->post->get_glyph_name (glyph, name, size); } static hb_bool_t @@ -132,8 +192,8 @@ hb_ot_get_glyph_from_name (hb_font_t *font HB_UNUSED, hb_codepoint_t *glyph, void *user_data HB_UNUSED) { - const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data; - return ot_font->post->get_glyph_from_name (name, len, glyph); + const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data; + return ot_face->post->get_glyph_from_name (name, len, glyph); } static hb_bool_t @@ -142,12 +202,13 @@ hb_ot_get_font_h_extents (hb_font_t *font, hb_font_extents_t *metrics, void *user_data HB_UNUSED) { - const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data; - metrics->ascender = font->em_scale_y (ot_font->hmtx.get_relaxed ()->ascender); - metrics->descender = font->em_scale_y (ot_font->hmtx.get_relaxed ()->descender); - metrics->line_gap = font->em_scale_y (ot_font->hmtx.get_relaxed ()->line_gap); + const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data; + const OT::hmtx_accelerator_t &hmtx = *ot_face->hmtx.get (); + metrics->ascender = font->em_scale_y (hmtx.ascender); + metrics->descender = font->em_scale_y (hmtx.descender); + metrics->line_gap = font->em_scale_y (hmtx.line_gap); // TODO Hook up variations. - return ot_font->hmtx.get_relaxed ()->has_font_extents; + return hmtx.has_font_extents; } static hb_bool_t @@ -156,12 +217,13 @@ hb_ot_get_font_v_extents (hb_font_t *font, hb_font_extents_t *metrics, void *user_data HB_UNUSED) { - const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data; - metrics->ascender = font->em_scale_x (ot_font->vmtx.get_relaxed ()->ascender); - metrics->descender = font->em_scale_x (ot_font->vmtx.get_relaxed ()->descender); - metrics->line_gap = font->em_scale_x (ot_font->vmtx.get_relaxed ()->line_gap); + const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data; + const OT::vmtx_accelerator_t &vmtx = *ot_face->vmtx.get (); + metrics->ascender = font->em_scale_x (vmtx.ascender); + metrics->descender = font->em_scale_x (vmtx.descender); + metrics->line_gap = font->em_scale_x (vmtx.line_gap); // TODO Hook up variations. - return ot_font->vmtx.get_relaxed ()->has_font_extents; + return vmtx.has_font_extents; } #ifdef HB_USE_ATEXIT @@ -177,13 +239,12 @@ static struct hb_ot_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_tface))) return; - hb_ot_face_data_t *ot_font = hb_ot_face_data (font->face); - - /* Load them lazies. We access them with get_relaxed() for performance. */ - ot_font->cmap.get (); - ot_font->hmtx.get (); - ot_font->vmtx.get (); + hb_ot_face_data_t *ot_face = hb_ot_face_data (font->face); hb_font_set_funcs (font, _hb_ot_get_font_funcs (), - ot_font, + ot_face, nullptr); } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-glyf-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-glyf-table.hh index 7c20983603f..2145ac02b2e 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-glyf-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-glyf-table.hh @@ -54,7 +54,7 @@ struct loca } protected: - HBUINT8 dataZ[VAR]; /* Location data. */ + UnsizedArrayOf dataZ; /* Location data. */ DEFINE_SIZE_ARRAY (0, dataZ); }; @@ -375,13 +375,13 @@ struct glyf if (short_offset) { - const HBUINT16 *offsets = (const HBUINT16 *) loca_table->dataZ; + const HBUINT16 *offsets = (const HBUINT16 *) loca_table->dataZ.arrayZ; *start_offset = 2 * offsets[glyph]; *end_offset = 2 * offsets[glyph + 1]; } else { - const HBUINT32 *offsets = (const HBUINT32 *) loca_table->dataZ; + const HBUINT32 *offsets = (const HBUINT32 *) loca_table->dataZ.arrayZ; *start_offset = offsets[glyph]; *end_offset = offsets[glyph + 1]; @@ -418,7 +418,7 @@ struct glyf } while (composite_it.move_to_next()); if ( (uint16_t) last->flags & CompositeGlyphHeader::WE_HAVE_INSTRUCTIONS) - *instruction_start = ((char *) last - (char *) glyf_table->dataZ) + last->get_size(); + *instruction_start = ((char *) last - (char *) glyf_table->dataZ.arrayZ) + last->get_size(); else *instruction_start = end_offset; *instruction_end = end_offset; @@ -483,7 +483,7 @@ struct glyf }; protected: - HBUINT8 dataZ[VAR]; /* Glyphs data. */ + UnsizedArrayOf dataZ; /* Glyphs data. */ DEFINE_SIZE_ARRAY (0, dataZ); }; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hdmx-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hdmx-table.hh index 87dd6d01822..04511b5d09e 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hdmx-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hdmx-table.hh @@ -66,7 +66,7 @@ struct DeviceRecord if (unlikely (i >= len())) return nullptr; hb_codepoint_t gid = this->subset_plan->glyphs [i]; - const HBUINT8* width = &(this->source_device_record->widths[gid]); + const HBUINT8* width = &(this->source_device_record->widthsZ[gid]); if (width < ((const HBUINT8 *) this->source_device_record) + size_device_record) return width; @@ -77,11 +77,7 @@ struct DeviceRecord static inline unsigned int get_size (unsigned int count) { - unsigned int raw_size = min_size + count * HBUINT8::static_size; - if (raw_size % 4) - /* Align to 32 bits */ - return raw_size + (4 - (raw_size % 4)); - return raw_size; + return hb_ceil_to_4 (min_size + count * HBUINT8::static_size); } inline bool serialize (hb_serialize_context_t *c, const SubsetView &subset_view) @@ -107,7 +103,7 @@ struct DeviceRecord DEBUG_MSG(SUBSET, nullptr, "HDMX width for new gid %d is missing.", i); return_trace (false); } - widths[i].set (*width); + widthsZ[i].set (*width); } return_trace (true); @@ -120,11 +116,11 @@ struct DeviceRecord c->check_range (this, size_device_record))); } - HBUINT8 pixel_size; /* Pixel size for following widths (as ppem). */ - HBUINT8 max_width; /* Maximum width. */ - HBUINT8 widths[VAR]; /* Array of widths (numGlyphs is from the 'maxp' table). */ + HBUINT8 pixel_size; /* Pixel size for following widths (as ppem). */ + HBUINT8 max_width; /* Maximum width. */ + UnsizedArrayOf widthsZ; /* Array of widths (numGlyphs is from the 'maxp' table). */ public: - DEFINE_SIZE_ARRAY (2, widths); + DEFINE_SIZE_ARRAY (2, widthsZ); }; @@ -140,7 +136,7 @@ struct hdmx inline const DeviceRecord& operator [] (unsigned int i) const { if (unlikely (i >= num_records)) return Null(DeviceRecord); - return StructAtOffset (this->data, i * size_device_record); + return StructAtOffset (&this->dataZ, i * size_device_record); } inline bool serialize (hb_serialize_context_t *c, const hdmx *source_hdmx, hb_subset_plan_t *plan) @@ -211,12 +207,12 @@ struct hdmx } protected: - HBUINT16 version; /* Table version number (0) */ - HBUINT16 num_records; /* Number of device records. */ - HBUINT32 size_device_record; /* Size of a device record, 32-bit aligned. */ - HBUINT8 data[VAR]; /* Array of device records. */ + HBUINT16 version; /* Table version number (0) */ + HBUINT16 num_records; /* Number of device records. */ + HBUINT32 size_device_record; /* Size of a device record, 32-bit aligned. */ + UnsizedArrayOf dataZ; /* Array of device records. */ public: - DEFINE_SIZE_ARRAY (8, data); + DEFINE_SIZE_ARRAY (8, dataZ); }; } /* namespace OT */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hmtx-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hmtx-table.hh index 3e4b3bdef5c..5293fdada1c 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hmtx-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hmtx-table.hh @@ -48,7 +48,7 @@ namespace OT { struct LongMetric { UFWORD advance; /* Advance width/height. */ - FWORD lsb; /* Leading (left/top) side bearing. */ + FWORD sb; /* Leading (left/top) side bearing. */ public: DEFINE_SIZE_STATIC (4); }; @@ -134,8 +134,8 @@ struct hmtxvmtx } else { - /* dest just lsb */ - *((FWORD *) dest_pos) = src_metric->lsb; + /* dest just sb */ + *((FWORD *) dest_pos) = src_metric->sb; } } else @@ -147,18 +147,18 @@ struct hmtxvmtx failed = true; break; } - FWORD src_lsb = *(lsbs + gids[i] - _mtx.num_advances); + FWORD src_sb = *(lsbs + gids[i] - _mtx.num_advances); if (i < num_advances) { /* dest needs a full LongMetric */ LongMetric *metric = (LongMetric *)dest_pos; metric->advance = src_metric->advance; - metric->lsb = src_lsb; + metric->sb = src_sb; } else { - /* dest just needs an lsb */ - *((FWORD *) dest_pos) = src_lsb; + /* dest just needs an sb */ + *((FWORD *) dest_pos) = src_sb; } } dest_pos += (i < num_advances ? 4 : 2); @@ -249,20 +249,33 @@ struct hmtxvmtx hb_blob_destroy (var_blob); } - inline unsigned int get_advance (hb_codepoint_t glyph) const + /* TODO Add variations version. */ + inline unsigned int get_side_bearing (hb_codepoint_t glyph) const + { + if (glyph < num_advances) + return table->longMetricZ[glyph].sb; + + if (unlikely (glyph > num_metrics)) + return 0; + + const FWORD *bearings = (const FWORD *) &table->longMetricZ[num_advances]; + return bearings[glyph - num_advances]; + } + + inline unsigned int get_advance (hb_codepoint_t glyph) const { if (unlikely (glyph >= num_metrics)) { - /* If num_metrics is zero, it means we don't have the metrics table - * for this direction: return default advance. Otherwise, it means that the - * glyph index is out of bound: return zero. */ - if (num_metrics) - return 0; - else - return default_advance; + /* If num_metrics is zero, it means we don't have the metrics table + * for this direction: return default advance. Otherwise, it means that the + * glyph index is out of bound: return zero. */ + if (num_metrics) + return 0; + else + return default_advance; } - return table->longMetric[MIN (glyph, (uint32_t) num_advances - 1)].advance; + return table->longMetricZ[MIN (glyph, (uint32_t) num_advances - 1)].advance; } inline unsigned int get_advance (hb_codepoint_t glyph, @@ -271,7 +284,7 @@ struct hmtxvmtx unsigned int advance = get_advance (glyph); if (likely(glyph < num_metrics)) { - advance += (font->num_coords ? var_table->get_advance_var (glyph, font->coords, font->num_coords) : 0); // TODO Optimize?! + advance += (font->num_coords ? var_table->get_advance_var (glyph, font->coords, font->num_coords) : 0); // TODO Optimize?! } return advance; } @@ -295,7 +308,7 @@ struct hmtxvmtx }; protected: - LongMetric longMetric[VAR]; /* Paired advance width and leading + UnsizedArrayOflongMetricZ;/* Paired advance width and leading * bearing values for each glyph. The * value numOfHMetrics comes from * the 'hhea' table. If the font is @@ -303,7 +316,7 @@ struct hmtxvmtx * be in the array, but that entry is * required. The last entry applies to * all subsequent glyphs. */ -/*FWORD leadingBearingX[VAR];*/ /* Here the advance is assumed +/*UnsizedArrayOf leadingBearingX;*//* Here the advance is assumed * to be the same as the advance * for the last entry above. The * number of entries in this array is @@ -317,7 +330,7 @@ struct hmtxvmtx * font to vary the side bearing * values for each glyph. */ public: - DEFINE_SIZE_ARRAY (0, longMetric); + DEFINE_SIZE_ARRAY (0, longMetricZ); }; struct hmtx : hmtxvmtx { diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-kern-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-kern-table.hh index 40f94be296f..63551d313cd 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-kern-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-kern-table.hh @@ -28,6 +28,88 @@ #define HB_OT_KERN_TABLE_HH #include "hb-open-type.hh" +#include "hb-ot-shape.hh" +#include "hb-ot-layout-gsubgpos.hh" + + +template +struct hb_kern_machine_t +{ + hb_kern_machine_t (const Driver &driver_) : driver (driver_) {} + + HB_NO_SANITIZE_SIGNED_INTEGER_OVERFLOW + inline void kern (hb_font_t *font, + hb_buffer_t *buffer, + hb_mask_t kern_mask, + bool scale = true) const + { + OT::hb_ot_apply_context_t c (1, font, buffer); + c.set_lookup_mask (kern_mask); + c.set_lookup_props (OT::LookupFlag::IgnoreMarks); + OT::hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c.iter_input; + skippy_iter.init (&c); + + bool horizontal = HB_DIRECTION_IS_HORIZONTAL (buffer->props.direction); + unsigned int count = buffer->len; + hb_glyph_info_t *info = buffer->info; + hb_glyph_position_t *pos = buffer->pos; + for (unsigned int idx = 0; idx < count;) + { + if (!(info[idx].mask & kern_mask)) + { + idx++; + continue; + } + + skippy_iter.reset (idx, 1); + if (!skippy_iter.next ()) + { + idx++; + continue; + } + + unsigned int i = idx; + unsigned int j = skippy_iter.idx; + + hb_position_t kern = driver.get_kerning (info[i].codepoint, + info[j].codepoint); + + + if (likely (!kern)) + goto skip; + + + if (horizontal) + { + if (scale) + kern = font->em_scale_x (kern); + hb_position_t kern1 = kern >> 1; + hb_position_t kern2 = kern - kern1; + pos[i].x_advance += kern1; + pos[j].x_advance += kern2; + pos[j].x_offset += kern2; + } + else + { + if (scale) + kern = font->em_scale_y (kern); + hb_position_t kern1 = kern >> 1; + hb_position_t kern2 = kern - kern1; + pos[i].y_advance += kern1; + pos[j].y_advance += kern2; + pos[j].y_offset += kern2; + } + + buffer->unsafe_to_break (i, j + 1); + + skip: + idx = skippy_iter.idx; + } + } + + const Driver &driver; +}; + /* * kern -- Kerning @@ -116,14 +198,18 @@ struct KernSubTableFormat2 { inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right, const char *end) const { + /* This subtable is disabled. It's not cleaer to me *exactly* where the offests are + * based from. I *think* they should be based from beginning of kern subtable wrapper, + * *NOT* "this". Since we know of no fonts that use this subtable, we are disabling + * it. Someday fix it and re-enable. Better yet, find fonts that use it... Meh, + * Windows doesn't implement it. Maybe just remove... */ + return 0; unsigned int l = (this+leftClassTable).get_class (left); unsigned int r = (this+rightClassTable).get_class (right); - unsigned int offset = l * rowWidth + r * sizeof (FWORD); - const FWORD *arr = &(this+array); - if (unlikely ((const void *) arr < (const void *) this || (const void *) arr >= (const void *) end)) - return 0; - const FWORD *v = &StructAtOffset (arr, offset); - if (unlikely ((const void *) v < (const void *) arr || (const void *) (v + 1) > (const void *) end)) + unsigned int offset = l + r; + const FWORD *v = &StructAtOffset (&(this+array), offset); + if (unlikely ((const char *) v < (const char *) &array || + (const char *) v > (const char *) end - 2)) return 0; return *v; } @@ -131,6 +217,7 @@ struct KernSubTableFormat2 inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); + return_trace (true); /* Disabled. See above. */ return_trace (rowWidth.sanitize (c) && leftClassTable.sanitize (c, this) && rightClassTable.sanitize (c, this) && @@ -190,10 +277,10 @@ struct KernSubTableWrapper inline const T* thiz (void) const { return static_cast (this); } inline bool is_horizontal (void) const - { return (thiz()->coverage & T::COVERAGE_CHECK_FLAGS) == T::COVERAGE_CHECK_HORIZONTAL; } + { return (thiz()->coverage & T::CheckFlags) == T::CheckHorizontal; } inline bool is_override (void) const - { return bool (thiz()->coverage & T::COVERAGE_OVERRIDE_FLAG); } + { return bool (thiz()->coverage & T::Override); } inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right, const char *end) const { return thiz()->subtable.get_kerning (left, right, end, thiz()->format); } @@ -208,7 +295,7 @@ struct KernSubTableWrapper TRACE_SANITIZE (this); return_trace (c->check_struct (thiz()) && thiz()->length >= T::min_size && - c->check_array (thiz(), 1, thiz()->length) && + c->check_range (thiz(), thiz()->length) && thiz()->subtable.sanitize (c, thiz()->format)); } }; @@ -219,16 +306,16 @@ struct KernTable /* https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern */ inline const T* thiz (void) const { return static_cast (this); } - inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right, unsigned int table_length) const + inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const { int v = 0; - const typename T::SubTableWrapper *st = CastP (thiz()->data); + const typename T::SubTableWrapper *st = CastP (&thiz()->dataZ); unsigned int count = thiz()->nTables; for (unsigned int i = 0; i < count; i++) { if (st->is_override ()) v = 0; - v += st->get_h_kerning (left, right, table_length + (const char *) this); + v += st->get_h_kerning (left, right, st->length + (const char *) st); st = &StructAfter (*st); } return v; @@ -241,7 +328,7 @@ struct KernTable thiz()->version != T::VERSION)) return_trace (false); - const typename T::SubTableWrapper *st = CastP (thiz()->data); + const typename T::SubTableWrapper *st = CastP (&thiz()->dataZ); unsigned int count = thiz()->nTables; for (unsigned int i = 0; i < count; i++) { @@ -262,18 +349,20 @@ struct KernOT : KernTable struct SubTableWrapper : KernSubTableWrapper { + friend struct KernTable; friend struct KernSubTableWrapper; - enum coverage_flags_t { - COVERAGE_DIRECTION_FLAG = 0x01u, - COVERAGE_MINIMUM_FLAG = 0x02u, - COVERAGE_CROSSSTREAM_FLAG = 0x04u, - COVERAGE_OVERRIDE_FLAG = 0x08u, + enum Coverage + { + Direction = 0x01u, + Minimum = 0x02u, + CrossStream = 0x04u, + Override = 0x08u, - COVERAGE_VARIATION_FLAG = 0x00u, /* Not supported. */ + Variation = 0x00u, /* Not supported. */ - COVERAGE_CHECK_FLAGS = 0x07u, - COVERAGE_CHECK_HORIZONTAL = 0x01u + CheckFlags = 0x07u, + CheckHorizontal = 0x01u }; protected: @@ -287,11 +376,11 @@ struct KernOT : KernTable }; protected: - HBUINT16 version; /* Version--0x0000u */ - HBUINT16 nTables; /* Number of subtables in the kerning table. */ - HBUINT8 data[VAR]; + HBUINT16 version; /* Version--0x0000u */ + HBUINT16 nTables; /* Number of subtables in the kerning table. */ + UnsizedArrayOf dataZ; public: - DEFINE_SIZE_ARRAY (4, data); + DEFINE_SIZE_ARRAY (4, dataZ); }; struct KernAAT : KernTable @@ -302,17 +391,19 @@ struct KernAAT : KernTable struct SubTableWrapper : KernSubTableWrapper { + friend struct KernTable; friend struct KernSubTableWrapper; - enum coverage_flags_t { - COVERAGE_DIRECTION_FLAG = 0x80u, - COVERAGE_CROSSSTREAM_FLAG = 0x40u, - COVERAGE_VARIATION_FLAG = 0x20u, + enum Coverage + { + Direction = 0x80u, + CrossStream = 0x40u, + Variation = 0x20u, - COVERAGE_OVERRIDE_FLAG = 0x00u, /* Not supported. */ + Override = 0x00u, /* Not supported. */ - COVERAGE_CHECK_FLAGS = 0xE0u, - COVERAGE_CHECK_HORIZONTAL = 0x00u + CheckFlags = 0xE0u, + CheckHorizontal = 0x00u }; protected: @@ -327,22 +418,25 @@ struct KernAAT : KernTable }; protected: - HBUINT32 version; /* Version--0x00010000u */ - HBUINT32 nTables; /* Number of subtables in the kerning table. */ - HBUINT8 data[VAR]; + HBUINT32 version; /* Version--0x00010000u */ + HBUINT32 nTables; /* Number of subtables in the kerning table. */ + UnsizedArrayOf dataZ; public: - DEFINE_SIZE_ARRAY (8, data); + DEFINE_SIZE_ARRAY (8, dataZ); }; struct kern { static const hb_tag_t tableTag = HB_OT_TAG_kern; - inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right, unsigned int table_length) const + inline bool has_data (void) const + { return u.version32 != 0; } + + inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const { switch (u.major) { - case 0: return u.ot.get_h_kerning (left, right, table_length); - case 1: return u.aat.get_h_kerning (left, right, table_length); + case 0: return u.ot.get_h_kerning (left, right); + case 1: return u.aat.get_h_kerning (left, right); default:return 0; } } @@ -350,7 +444,7 @@ struct kern inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - if (!u.major.sanitize (c)) return_trace (false); + if (!u.version32.sanitize (c)) return_trace (false); switch (u.major) { case 0: return_trace (u.ot.sanitize (c)); case 1: return_trace (u.aat.sanitize (c)); @@ -364,30 +458,48 @@ struct kern { blob = hb_sanitize_context_t().reference_table (face); table = blob->as (); - table_length = blob->length; } inline void fini (void) { hb_blob_destroy (blob); } + inline bool has_data (void) const + { return table->has_data (); } + inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const - { return table->get_h_kerning (left, right, table_length); } + { return table->get_h_kerning (left, right); } + + inline int get_kerning (hb_codepoint_t first, hb_codepoint_t second) const + { return get_h_kerning (first, second); } + + inline void apply (hb_font_t *font, + hb_buffer_t *buffer, + hb_mask_t kern_mask) const + { + /* We only apply horizontal kerning in this table. */ + if (!HB_DIRECTION_IS_HORIZONTAL (buffer->props.direction)) + return; + + hb_kern_machine_t machine (*this); + + machine.kern (font, buffer, kern_mask); + } private: hb_blob_t *blob; const kern *table; - unsigned int table_length; }; protected: union { + HBUINT32 version32; HBUINT16 major; KernOT ot; KernAAT aat; } u; public: - DEFINE_SIZE_UNION (2, major); + DEFINE_SIZE_UNION (4, version32); }; struct kern_accelerator_t : kern::accelerator_t {}; 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 dd65f338494..0c60a1304e2 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 @@ -70,6 +70,11 @@ namespace OT { * Script, ScriptList, LangSys, Feature, FeatureList, Lookup, LookupList */ +struct Record_sanitize_closure_t { + hb_tag_t tag; + const void *list_base; +}; + template struct Record { @@ -77,14 +82,10 @@ struct Record return tag.cmp (a); } - struct sanitize_closure_t { - hb_tag_t tag; - const void *list_base; - }; inline bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); - const sanitize_closure_t closure = {tag, base}; + const Record_sanitize_closure_t closure = {tag, base}; return_trace (c->check_struct (this) && offset.sanitize (c, base, &closure)); } @@ -240,7 +241,7 @@ struct LangSys } inline bool sanitize (hb_sanitize_context_t *c, - const Record::sanitize_closure_t * = nullptr) const + const Record_sanitize_closure_t * = nullptr) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && featureIndex.sanitize (c)); @@ -291,7 +292,7 @@ struct Script } inline bool sanitize (hb_sanitize_context_t *c, - const Record