From aefa260469999e53f3b8ea263fda94cdddef8ce3 Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Sat, 22 Dec 2018 00:39:38 +0000 Subject: harfbuzz-2.3.0 git-svn-id: svn://tug.org/texlive/trunk@49473 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/libs/README | 2 +- Build/source/libs/harfbuzz/ChangeLog | 5 + Build/source/libs/harfbuzz/Makefile.am | 20 +- Build/source/libs/harfbuzz/Makefile.in | 66 +- Build/source/libs/harfbuzz/TLpatches/ChangeLog | 5 + Build/source/libs/harfbuzz/TLpatches/TL-Changes | 2 +- Build/source/libs/harfbuzz/configure | 24 +- .../libs/harfbuzz/harfbuzz-src/CMakeLists.txt | 14 +- Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog | 5057 +++++++++++++++++++- Build/source/libs/harfbuzz/harfbuzz-src/NEWS | 15 + .../source/libs/harfbuzz/harfbuzz-src/config.h.in | 32 - .../source/libs/harfbuzz/harfbuzz-src/configure.ac | 3 +- .../source/libs/harfbuzz/harfbuzz-src/gtk-doc.make | 1 + .../libs/harfbuzz/harfbuzz-src/src/Makefile.am | 6 - .../harfbuzz/harfbuzz-src/src/Makefile.sources | 239 +- .../harfbuzz/harfbuzz-src/src/dump-indic-data.cc | 2 +- .../harfbuzz/harfbuzz-src/src/dump-khmer-data.cc | 2 +- .../harfbuzz/harfbuzz-src/src/dump-myanmar-data.cc | 2 +- .../harfbuzz/harfbuzz-src/src/dump-use-data.cc | 2 +- .../harfbuzz/harfbuzz-src/src/hb-aat-fdsc-table.hh | 126 + .../harfbuzz-src/src/hb-aat-layout-ankr-table.hh | 14 +- .../harfbuzz-src/src/hb-aat-layout-bsln-table.hh | 15 +- .../harfbuzz-src/src/hb-aat-layout-common.hh | 180 +- .../harfbuzz-src/src/hb-aat-layout-feat-table.hh | 48 +- .../harfbuzz-src/src/hb-aat-layout-just-table.hh | 28 +- .../harfbuzz-src/src/hb-aat-layout-kerx-table.hh | 131 +- .../harfbuzz-src/src/hb-aat-layout-lcar-table.hh | 16 +- .../harfbuzz-src/src/hb-aat-layout-morx-table.hh | 118 +- .../harfbuzz-src/src/hb-aat-layout-trak-table.hh | 40 +- .../harfbuzz/harfbuzz-src/src/hb-aat-layout.cc | 40 +- .../libs/harfbuzz/harfbuzz-src/src/hb-aat-layout.h | 24 + .../harfbuzz/harfbuzz-src/src/hb-aat-layout.hh | 11 +- .../harfbuzz/harfbuzz-src/src/hb-aat-ltag-table.hh | 8 +- .../libs/harfbuzz/harfbuzz-src/src/hb-aat-map.hh | 7 +- .../libs/harfbuzz/harfbuzz-src/src/hb-array.hh | 274 ++ .../libs/harfbuzz/harfbuzz-src/src/hb-atomic.hh | 30 +- .../libs/harfbuzz/harfbuzz-src/src/hb-blob.cc | 8 +- .../libs/harfbuzz/harfbuzz-src/src/hb-blob.hh | 41 +- .../harfbuzz-src/src/hb-buffer-serialize.cc | 4 +- .../libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc | 68 +- .../libs/harfbuzz/harfbuzz-src/src/hb-buffer.hh | 105 +- .../libs/harfbuzz/harfbuzz-src/src/hb-cache.hh | 10 +- .../harfbuzz-src/src/hb-cff-interp-common.hh | 744 +++ .../harfbuzz-src/src/hb-cff-interp-cs-common.hh | 904 ++++ .../harfbuzz-src/src/hb-cff-interp-dict-common.hh | 294 ++ .../harfbuzz/harfbuzz-src/src/hb-cff1-interp-cs.hh | 161 + .../harfbuzz/harfbuzz-src/src/hb-cff2-interp-cs.hh | 271 ++ .../libs/harfbuzz/harfbuzz-src/src/hb-common.cc | 29 +- .../libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc | 20 +- .../libs/harfbuzz/harfbuzz-src/src/hb-debug.hh | 24 +- .../libs/harfbuzz/harfbuzz-src/src/hb-deprecated.h | 61 +- .../harfbuzz/harfbuzz-src/src/hb-directwrite.cc | 289 +- .../libs/harfbuzz/harfbuzz-src/src/hb-dsalgs.hh | 277 +- .../libs/harfbuzz/harfbuzz-src/src/hb-face.cc | 17 +- .../libs/harfbuzz/harfbuzz-src/src/hb-face.hh | 10 +- .../libs/harfbuzz/harfbuzz-src/src/hb-font.cc | 6 +- .../libs/harfbuzz/harfbuzz-src/src/hb-font.hh | 222 +- .../source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc | 20 +- .../libs/harfbuzz/harfbuzz-src/src/hb-glib.cc | 8 +- .../harfbuzz-src/src/hb-gobject-enums.cc.tmpl | 2 +- .../harfbuzz-src/src/hb-gobject-enums.h.tmpl | 2 +- .../harfbuzz-src/src/hb-gobject-structs.cc | 2 +- .../libs/harfbuzz/harfbuzz-src/src/hb-icu.cc | 8 +- .../libs/harfbuzz/harfbuzz-src/src/hb-iter.hh | 149 - .../libs/harfbuzz/harfbuzz-src/src/hb-kern.hh | 8 +- .../libs/harfbuzz/harfbuzz-src/src/hb-machinery.hh | 363 +- .../libs/harfbuzz/harfbuzz-src/src/hb-map.cc | 4 +- .../libs/harfbuzz/harfbuzz-src/src/hb-map.hh | 56 +- .../libs/harfbuzz/harfbuzz-src/src/hb-mutex.hh | 12 +- .../libs/harfbuzz/harfbuzz-src/src/hb-null.hh | 79 +- .../libs/harfbuzz/harfbuzz-src/src/hb-object.hh | 38 +- .../libs/harfbuzz/harfbuzz-src/src/hb-open-file.hh | 118 +- .../libs/harfbuzz/harfbuzz-src/src/hb-open-type.hh | 294 +- .../harfbuzz/harfbuzz-src/src/hb-ot-cff-common.hh | 711 +++ .../harfbuzz/harfbuzz-src/src/hb-ot-cff1-table.cc | 385 ++ .../harfbuzz/harfbuzz-src/src/hb-ot-cff1-table.hh | 1300 +++++ .../harfbuzz/harfbuzz-src/src/hb-ot-cff2-table.cc | 136 + .../harfbuzz/harfbuzz-src/src/hb-ot-cff2-table.hh | 565 +++ .../harfbuzz/harfbuzz-src/src/hb-ot-cmap-table.hh | 190 +- .../harfbuzz-src/src/hb-ot-color-cbdt-table.hh | 44 +- .../harfbuzz-src/src/hb-ot-color-colr-table.hh | 20 +- .../harfbuzz-src/src/hb-ot-color-cpal-table.hh | 57 +- .../harfbuzz-src/src/hb-ot-color-sbix-table.hh | 61 +- .../harfbuzz-src/src/hb-ot-color-svg-table.hh | 34 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-color.h | 2 +- .../harfbuzz/harfbuzz-src/src/hb-ot-deprecated.h | 107 + .../libs/harfbuzz/harfbuzz-src/src/hb-ot-face.cc | 4 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-face.hh | 4 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc | 14 +- .../harfbuzz/harfbuzz-src/src/hb-ot-gasp-table.hh | 84 + .../harfbuzz/harfbuzz-src/src/hb-ot-glyf-table.hh | 46 +- .../harfbuzz/harfbuzz-src/src/hb-ot-hdmx-table.hh | 42 +- .../harfbuzz/harfbuzz-src/src/hb-ot-head-table.hh | 19 +- .../harfbuzz/harfbuzz-src/src/hb-ot-hhea-table.hh | 6 +- .../harfbuzz/harfbuzz-src/src/hb-ot-hmtx-table.hh | 44 +- .../harfbuzz/harfbuzz-src/src/hb-ot-kern-table.hh | 58 +- .../harfbuzz-src/src/hb-ot-layout-base-table.hh | 107 +- .../harfbuzz-src/src/hb-ot-layout-common.hh | 613 ++- .../harfbuzz-src/src/hb-ot-layout-gdef-table.hh | 146 +- .../harfbuzz-src/src/hb-ot-layout-gpos-table.hh | 225 +- .../harfbuzz-src/src/hb-ot-layout-gsub-table.hh | 529 +- .../harfbuzz-src/src/hb-ot-layout-gsubgpos.hh | 392 +- .../harfbuzz-src/src/hb-ot-layout-jstf-table.hh | 46 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-layout.cc | 9 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-map.cc | 2 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-map.hh | 40 +- .../harfbuzz/harfbuzz-src/src/hb-ot-math-table.hh | 147 +- .../harfbuzz/harfbuzz-src/src/hb-ot-maxp-table.hh | 17 +- .../harfbuzz/harfbuzz-src/src/hb-ot-name-table.hh | 35 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-name.cc | 10 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-name.h | 2 +- .../harfbuzz/harfbuzz-src/src/hb-ot-os2-table.hh | 150 +- .../harfbuzz/harfbuzz-src/src/hb-ot-post-table.hh | 37 +- .../src/hb-ot-shape-complex-arabic-fallback.hh | 23 +- .../harfbuzz-src/src/hb-ot-shape-complex-indic.cc | 10 +- .../harfbuzz-src/src/hb-ot-shape-complex-khmer.cc | 25 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.cc | 8 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.hh | 8 +- .../harfbuzz/harfbuzz-src/src/hb-ot-stat-table.hh | 54 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-tag.cc | 4 +- .../harfbuzz-src/src/hb-ot-var-avar-table.hh | 10 +- .../harfbuzz-src/src/hb-ot-var-fvar-table.hh | 58 +- .../harfbuzz-src/src/hb-ot-var-hvar-table.hh | 27 +- .../harfbuzz-src/src/hb-ot-var-mvar-table.hh | 12 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-var.h | 2 +- .../harfbuzz/harfbuzz-src/src/hb-ot-vorg-table.hh | 26 +- .../source/libs/harfbuzz/harfbuzz-src/src/hb-ot.h | 1 + .../harfbuzz/harfbuzz-src/src/hb-set-digest.hh | 55 +- .../libs/harfbuzz/harfbuzz-src/src/hb-set.cc | 4 +- .../libs/harfbuzz/harfbuzz-src/src/hb-set.hh | 124 +- .../harfbuzz/harfbuzz-src/src/hb-shape-plan.cc | 2 +- .../harfbuzz/harfbuzz-src/src/hb-shape-plan.hh | 5 +- .../libs/harfbuzz/harfbuzz-src/src/hb-shape.cc | 20 +- .../harfbuzz/harfbuzz-src/src/hb-shaper-list.hh | 8 +- .../libs/harfbuzz/harfbuzz-src/src/hb-shaper.cc | 18 +- .../libs/harfbuzz/harfbuzz-src/src/hb-shaper.hh | 12 +- .../libs/harfbuzz/harfbuzz-src/src/hb-static.cc | 4 +- .../harfbuzz-src/src/hb-subset-cff-common.cc | 226 + .../harfbuzz-src/src/hb-subset-cff-common.hh | 992 ++++ .../harfbuzz/harfbuzz-src/src/hb-subset-cff1.cc | 1108 +++++ .../harfbuzz/harfbuzz-src/src/hb-subset-cff1.hh | 38 + .../harfbuzz/harfbuzz-src/src/hb-subset-cff2.cc | 624 +++ .../harfbuzz/harfbuzz-src/src/hb-subset-cff2.hh | 38 + .../harfbuzz/harfbuzz-src/src/hb-subset-input.cc | 15 +- .../harfbuzz/harfbuzz-src/src/hb-subset-input.hh | 1 + .../harfbuzz/harfbuzz-src/src/hb-subset-plan.cc | 20 + .../harfbuzz/harfbuzz-src/src/hb-subset-plan.hh | 13 +- .../libs/harfbuzz/harfbuzz-src/src/hb-subset.cc | 26 +- .../libs/harfbuzz/harfbuzz-src/src/hb-subset.h | 5 + .../libs/harfbuzz/harfbuzz-src/src/hb-subset.hh | 7 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ucdn.cc | 10 +- .../libs/harfbuzz/harfbuzz-src/src/hb-unicode.cc | 64 +- .../libs/harfbuzz/harfbuzz-src/src/hb-unicode.hh | 26 +- .../libs/harfbuzz/harfbuzz-src/src/hb-uniscribe.cc | 32 +- .../libs/harfbuzz/harfbuzz-src/src/hb-utf.hh | 54 +- .../libs/harfbuzz/harfbuzz-src/src/hb-vector.hh | 98 +- Build/source/libs/harfbuzz/harfbuzz-src/src/hb.hh | 40 +- .../harfbuzz/harfbuzz-src/src/test-name-table.cc | 6 +- .../harfbuzz-src/src/test-unicode-ranges.cc | 4 +- Build/source/libs/harfbuzz/include/Makefile.am | 1 + Build/source/libs/harfbuzz/include/Makefile.in | 16 +- Build/source/libs/harfbuzz/version.ac | 2 +- 162 files changed, 17923 insertions(+), 3840 deletions(-) create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-fdsc-table.hh create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-array.hh create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff-interp-common.hh create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff-interp-cs-common.hh create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff-interp-dict-common.hh create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff1-interp-cs.hh create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff2-interp-cs.hh delete mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-iter.hh create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff-common.hh create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff1-table.cc create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff1-table.hh create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff2-table.cc create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff2-table.hh create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-deprecated.h create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-gasp-table.hh create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff-common.cc create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff-common.hh create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff1.cc create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff1.hh create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff2.cc create mode 100644 Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff2.hh (limited to 'Build') diff --git a/Build/source/libs/README b/Build/source/libs/README index 938d6ce163a..8f019cf444d 100644 --- a/Build/source/libs/README +++ b/Build/source/libs/README @@ -25,7 +25,7 @@ graphite2 1.3.13 - checked 21dec18 http://sourceforge.net/projects/silgraphite/files/graphite2/ (requires C++11) -harfbuzz 2.2.0 - checked 30nov18 +harfbuzz 2.3.0 - checked 22dec18 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 879151eddd5..ce3909402fa 100644 --- a/Build/source/libs/harfbuzz/ChangeLog +++ b/Build/source/libs/harfbuzz/ChangeLog @@ -1,3 +1,8 @@ +2018-12-22 Akira Kakuto + + Import harfbuzz-2.3.0. + * version.ac, Makefile.am, include/Makefile.am: Adjusted. + 2018-11-30 Akira Kakuto Import harfbuzz-2.2.0. diff --git a/Build/source/libs/harfbuzz/Makefile.am b/Build/source/libs/harfbuzz/Makefile.am index 8ce471d1b73..0e666d65d1e 100644 --- a/Build/source/libs/harfbuzz/Makefile.am +++ b/Build/source/libs/harfbuzz/Makefile.am @@ -38,6 +38,11 @@ libharfbuzz_a_SOURCES = \ @HARFBUZZ_TREE@/src/hb-buffer-serialize.cc \ @HARFBUZZ_TREE@/src/hb-buffer.cc \ @HARFBUZZ_TREE@/src/hb-cache.hh \ + @HARFBUZZ_TREE@/src/hb-cff-interp-common.hh \ + @HARFBUZZ_TREE@/src/hb-cff-interp-cs-common.hh \ + @HARFBUZZ_TREE@/src/hb-cff-interp-dict-common.hh \ + @HARFBUZZ_TREE@/src/hb-cff1-interp-cs.hh \ + @HARFBUZZ_TREE@/src/hb-cff2-interp-cs.hh \ @HARFBUZZ_TREE@/src/hb-common.cc \ @HARFBUZZ_TREE@/src/hb-debug.hh \ @HARFBUZZ_TREE@/src/hb-dsalgs.hh \ @@ -45,7 +50,6 @@ libharfbuzz_a_SOURCES = \ @HARFBUZZ_TREE@/src/hb-face.cc \ @HARFBUZZ_TREE@/src/hb-font.hh \ @HARFBUZZ_TREE@/src/hb-font.cc \ - @HARFBUZZ_TREE@/src/hb-iter.hh \ @HARFBUZZ_TREE@/src/hb-kern.hh \ @HARFBUZZ_TREE@/src/hb-map.hh \ @HARFBUZZ_TREE@/src/hb-map.cc \ @@ -55,6 +59,12 @@ libharfbuzz_a_SOURCES = \ @HARFBUZZ_TREE@/src/hb-object.hh \ @HARFBUZZ_TREE@/src/hb-open-file.hh \ @HARFBUZZ_TREE@/src/hb-open-type.hh \ + @HARFBUZZ_TREE@/src/hb-ot-cff-common.hh \ + @HARFBUZZ_TREE@/src/hb-ot-cff1-table.cc \ + @HARFBUZZ_TREE@/src/hb-ot-cff1-table.hh \ + @HARFBUZZ_TREE@/src/hb-ot-cff2-table.cc \ + @HARFBUZZ_TREE@/src/hb-ot-cff2-table.hh \ + @HARFBUZZ_TREE@/src/hb-ot-gasp-table.hh \ @HARFBUZZ_TREE@/src/hb-ot-color-cbdt-table.hh \ @HARFBUZZ_TREE@/src/hb-ot-cmap-table.hh \ @HARFBUZZ_TREE@/src/hb-ot-face.cc \ @@ -89,6 +99,12 @@ libharfbuzz_a_SOURCES = \ @HARFBUZZ_TREE@/src/hb-shaper.cc \ @HARFBUZZ_TREE@/src/hb-static.cc \ @HARFBUZZ_TREE@/src/hb-string-array.hh \ + @HARFBUZZ_TREE@/src/hb-subset-cff-common.cc \ + @HARFBUZZ_TREE@/src/hb-subset-cff-common.hh \ + @HARFBUZZ_TREE@/src/hb-subset-cff1.cc \ + @HARFBUZZ_TREE@/src/hb-subset-cff1.hh \ + @HARFBUZZ_TREE@/src/hb-subset-cff2.cc \ + @HARFBUZZ_TREE@/src/hb-subset-cff2.hh \ @HARFBUZZ_TREE@/src/hb-subset-input.hh \ @HARFBUZZ_TREE@/src/hb-subset.hh \ @HARFBUZZ_TREE@/src/hb-unicode.hh \ @@ -104,6 +120,7 @@ libharfbuzz_a_SOURCES = \ ## native OpenType Layout backend libharfbuzz_a_SOURCES += \ + @HARFBUZZ_TREE@/src/hb-aat-fdsc-table.hh \ @HARFBUZZ_TREE@/src/hb-aat-layout.cc \ @HARFBUZZ_TREE@/src/hb-aat-layout-common.hh \ @HARFBUZZ_TREE@/src/hb-aat-layout-ankr-table.hh \ @@ -118,6 +135,7 @@ libharfbuzz_a_SOURCES += \ @HARFBUZZ_TREE@/src/hb-aat-ltag-table.hh \ @HARFBUZZ_TREE@/src/hb-aat-map.cc \ @HARFBUZZ_TREE@/src/hb-aat-map.hh \ + @HARFBUZZ_TREE@/src/hb-array.hh \ @HARFBUZZ_TREE@/src/hb-ot-font.cc \ @HARFBUZZ_TREE@/src/hb-ot-layout.cc \ @HARFBUZZ_TREE@/src/hb-ot-layout-base-table.hh \ diff --git a/Build/source/libs/harfbuzz/Makefile.in b/Build/source/libs/harfbuzz/Makefile.in index 2b4e8660154..c3f835233ae 100644 --- a/Build/source/libs/harfbuzz/Makefile.in +++ b/Build/source/libs/harfbuzz/Makefile.in @@ -127,6 +127,8 @@ am_libharfbuzz_a_OBJECTS = @HARFBUZZ_TREE@/src/hb-blob.$(OBJEXT) \ @HARFBUZZ_TREE@/src/hb-face.$(OBJEXT) \ @HARFBUZZ_TREE@/src/hb-font.$(OBJEXT) \ @HARFBUZZ_TREE@/src/hb-map.$(OBJEXT) \ + @HARFBUZZ_TREE@/src/hb-ot-cff1-table.$(OBJEXT) \ + @HARFBUZZ_TREE@/src/hb-ot-cff2-table.$(OBJEXT) \ @HARFBUZZ_TREE@/src/hb-ot-face.$(OBJEXT) \ @HARFBUZZ_TREE@/src/hb-ot-name-language.$(OBJEXT) \ @HARFBUZZ_TREE@/src/hb-ot-name.$(OBJEXT) \ @@ -136,6 +138,9 @@ am_libharfbuzz_a_OBJECTS = @HARFBUZZ_TREE@/src/hb-blob.$(OBJEXT) \ @HARFBUZZ_TREE@/src/hb-shape-plan.$(OBJEXT) \ @HARFBUZZ_TREE@/src/hb-shaper.$(OBJEXT) \ @HARFBUZZ_TREE@/src/hb-static.$(OBJEXT) \ + @HARFBUZZ_TREE@/src/hb-subset-cff-common.$(OBJEXT) \ + @HARFBUZZ_TREE@/src/hb-subset-cff1.$(OBJEXT) \ + @HARFBUZZ_TREE@/src/hb-subset-cff2.$(OBJEXT) \ @HARFBUZZ_TREE@/src/hb-unicode.$(OBJEXT) \ @HARFBUZZ_TREE@/src/hb-warning.$(OBJEXT) \ @HARFBUZZ_TREE@/src/hb-fallback-shape.$(OBJEXT) \ @@ -201,6 +206,8 @@ am__depfiles_remade = ./$(DEPDIR)/hbtest-dummy.Po \ @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-graphite2.Po \ @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-icu.Po \ @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-map.Po \ + @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-cff1-table.Po \ + @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-cff2-table.Po \ @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-color.Po \ @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-face.Po \ @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-font.Po \ @@ -231,6 +238,9 @@ am__depfiles_remade = ./$(DEPDIR)/hbtest-dummy.Po \ @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-shape.Po \ @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-shaper.Po \ @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-static.Po \ + @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-subset-cff-common.Po \ + @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-subset-cff1.Po \ + @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-subset-cff2.Po \ @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-unicode.Po \ @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-warning.Po am__mv = mv -f @@ -710,18 +720,29 @@ libharfbuzz_a_SOURCES = @HARFBUZZ_TREE@/src/hb-atomic.hh \ @HARFBUZZ_TREE@/src/hb-buffer-serialize.cc \ @HARFBUZZ_TREE@/src/hb-buffer.cc \ @HARFBUZZ_TREE@/src/hb-cache.hh \ + @HARFBUZZ_TREE@/src/hb-cff-interp-common.hh \ + @HARFBUZZ_TREE@/src/hb-cff-interp-cs-common.hh \ + @HARFBUZZ_TREE@/src/hb-cff-interp-dict-common.hh \ + @HARFBUZZ_TREE@/src/hb-cff1-interp-cs.hh \ + @HARFBUZZ_TREE@/src/hb-cff2-interp-cs.hh \ @HARFBUZZ_TREE@/src/hb-common.cc \ @HARFBUZZ_TREE@/src/hb-debug.hh \ @HARFBUZZ_TREE@/src/hb-dsalgs.hh \ @HARFBUZZ_TREE@/src/hb-face.hh @HARFBUZZ_TREE@/src/hb-face.cc \ @HARFBUZZ_TREE@/src/hb-font.hh @HARFBUZZ_TREE@/src/hb-font.cc \ - @HARFBUZZ_TREE@/src/hb-iter.hh @HARFBUZZ_TREE@/src/hb-kern.hh \ - @HARFBUZZ_TREE@/src/hb-map.hh @HARFBUZZ_TREE@/src/hb-map.cc \ + @HARFBUZZ_TREE@/src/hb-kern.hh @HARFBUZZ_TREE@/src/hb-map.hh \ + @HARFBUZZ_TREE@/src/hb-map.cc \ @HARFBUZZ_TREE@/src/hb-machinery.hh \ @HARFBUZZ_TREE@/src/hb-mutex.hh @HARFBUZZ_TREE@/src/hb-null.hh \ @HARFBUZZ_TREE@/src/hb-object.hh \ @HARFBUZZ_TREE@/src/hb-open-file.hh \ @HARFBUZZ_TREE@/src/hb-open-type.hh \ + @HARFBUZZ_TREE@/src/hb-ot-cff-common.hh \ + @HARFBUZZ_TREE@/src/hb-ot-cff1-table.cc \ + @HARFBUZZ_TREE@/src/hb-ot-cff1-table.hh \ + @HARFBUZZ_TREE@/src/hb-ot-cff2-table.cc \ + @HARFBUZZ_TREE@/src/hb-ot-cff2-table.hh \ + @HARFBUZZ_TREE@/src/hb-ot-gasp-table.hh \ @HARFBUZZ_TREE@/src/hb-ot-color-cbdt-table.hh \ @HARFBUZZ_TREE@/src/hb-ot-cmap-table.hh \ @HARFBUZZ_TREE@/src/hb-ot-face.cc \ @@ -755,6 +776,12 @@ libharfbuzz_a_SOURCES = @HARFBUZZ_TREE@/src/hb-atomic.hh \ @HARFBUZZ_TREE@/src/hb-shaper.cc \ @HARFBUZZ_TREE@/src/hb-static.cc \ @HARFBUZZ_TREE@/src/hb-string-array.hh \ + @HARFBUZZ_TREE@/src/hb-subset-cff-common.cc \ + @HARFBUZZ_TREE@/src/hb-subset-cff-common.hh \ + @HARFBUZZ_TREE@/src/hb-subset-cff1.cc \ + @HARFBUZZ_TREE@/src/hb-subset-cff1.hh \ + @HARFBUZZ_TREE@/src/hb-subset-cff2.cc \ + @HARFBUZZ_TREE@/src/hb-subset-cff2.hh \ @HARFBUZZ_TREE@/src/hb-subset-input.hh \ @HARFBUZZ_TREE@/src/hb-subset.hh \ @HARFBUZZ_TREE@/src/hb-unicode.hh \ @@ -765,7 +792,9 @@ libharfbuzz_a_SOURCES = @HARFBUZZ_TREE@/src/hb-atomic.hh \ @HARFBUZZ_TREE@/src/hb-buffer-deserialize-json.hh \ @HARFBUZZ_TREE@/src/hb-buffer-deserialize-text.hh \ @HARFBUZZ_TREE@/src/hb-fallback-shape.cc \ - @HARFBUZZ_TREE@/src/hb.hh @HARFBUZZ_TREE@/src/hb-aat-layout.cc \ + @HARFBUZZ_TREE@/src/hb.hh \ + @HARFBUZZ_TREE@/src/hb-aat-fdsc-table.hh \ + @HARFBUZZ_TREE@/src/hb-aat-layout.cc \ @HARFBUZZ_TREE@/src/hb-aat-layout-common.hh \ @HARFBUZZ_TREE@/src/hb-aat-layout-ankr-table.hh \ @HARFBUZZ_TREE@/src/hb-aat-layout-bsln-table.hh \ @@ -779,6 +808,7 @@ libharfbuzz_a_SOURCES = @HARFBUZZ_TREE@/src/hb-atomic.hh \ @HARFBUZZ_TREE@/src/hb-aat-ltag-table.hh \ @HARFBUZZ_TREE@/src/hb-aat-map.cc \ @HARFBUZZ_TREE@/src/hb-aat-map.hh \ + @HARFBUZZ_TREE@/src/hb-array.hh \ @HARFBUZZ_TREE@/src/hb-ot-font.cc \ @HARFBUZZ_TREE@/src/hb-ot-layout.cc \ @HARFBUZZ_TREE@/src/hb-ot-layout-base-table.hh \ @@ -944,6 +974,12 @@ clean-noinstLIBRARIES: @HARFBUZZ_TREE@/src/hb-map.$(OBJEXT): \ @HARFBUZZ_TREE@/src/$(am__dirstamp) \ @HARFBUZZ_TREE@/src/$(DEPDIR)/$(am__dirstamp) +@HARFBUZZ_TREE@/src/hb-ot-cff1-table.$(OBJEXT): \ + @HARFBUZZ_TREE@/src/$(am__dirstamp) \ + @HARFBUZZ_TREE@/src/$(DEPDIR)/$(am__dirstamp) +@HARFBUZZ_TREE@/src/hb-ot-cff2-table.$(OBJEXT): \ + @HARFBUZZ_TREE@/src/$(am__dirstamp) \ + @HARFBUZZ_TREE@/src/$(DEPDIR)/$(am__dirstamp) @HARFBUZZ_TREE@/src/hb-ot-face.$(OBJEXT): \ @HARFBUZZ_TREE@/src/$(am__dirstamp) \ @HARFBUZZ_TREE@/src/$(DEPDIR)/$(am__dirstamp) @@ -971,6 +1007,15 @@ clean-noinstLIBRARIES: @HARFBUZZ_TREE@/src/hb-static.$(OBJEXT): \ @HARFBUZZ_TREE@/src/$(am__dirstamp) \ @HARFBUZZ_TREE@/src/$(DEPDIR)/$(am__dirstamp) +@HARFBUZZ_TREE@/src/hb-subset-cff-common.$(OBJEXT): \ + @HARFBUZZ_TREE@/src/$(am__dirstamp) \ + @HARFBUZZ_TREE@/src/$(DEPDIR)/$(am__dirstamp) +@HARFBUZZ_TREE@/src/hb-subset-cff1.$(OBJEXT): \ + @HARFBUZZ_TREE@/src/$(am__dirstamp) \ + @HARFBUZZ_TREE@/src/$(DEPDIR)/$(am__dirstamp) +@HARFBUZZ_TREE@/src/hb-subset-cff2.$(OBJEXT): \ + @HARFBUZZ_TREE@/src/$(am__dirstamp) \ + @HARFBUZZ_TREE@/src/$(DEPDIR)/$(am__dirstamp) @HARFBUZZ_TREE@/src/hb-unicode.$(OBJEXT): \ @HARFBUZZ_TREE@/src/$(am__dirstamp) \ @HARFBUZZ_TREE@/src/$(DEPDIR)/$(am__dirstamp) @@ -1086,6 +1131,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@@HARFBUZZ_TREE@/src/$(DEPDIR)/hb-graphite2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@HARFBUZZ_TREE@/src/$(DEPDIR)/hb-icu.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@HARFBUZZ_TREE@/src/$(DEPDIR)/hb-map.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@@HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-cff1-table.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@@HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-cff2-table.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-color.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-face.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-font.Po@am__quote@ # am--include-marker @@ -1116,6 +1163,9 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@@HARFBUZZ_TREE@/src/$(DEPDIR)/hb-shape.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@HARFBUZZ_TREE@/src/$(DEPDIR)/hb-shaper.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@HARFBUZZ_TREE@/src/$(DEPDIR)/hb-static.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@@HARFBUZZ_TREE@/src/$(DEPDIR)/hb-subset-cff-common.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@@HARFBUZZ_TREE@/src/$(DEPDIR)/hb-subset-cff1.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@@HARFBUZZ_TREE@/src/$(DEPDIR)/hb-subset-cff2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@HARFBUZZ_TREE@/src/$(DEPDIR)/hb-unicode.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@HARFBUZZ_TREE@/src/$(DEPDIR)/hb-warning.Po@am__quote@ # am--include-marker @@ -1723,6 +1773,8 @@ distclean: distclean-recursive -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-graphite2.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-icu.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-map.Po + -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-cff1-table.Po + -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-cff2-table.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-color.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-face.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-font.Po @@ -1753,6 +1805,9 @@ distclean: distclean-recursive -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-shape.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-shaper.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-static.Po + -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-subset-cff-common.Po + -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-subset-cff1.Po + -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-subset-cff2.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-unicode.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-warning.Po -rm -f Makefile @@ -1816,6 +1871,8 @@ maintainer-clean: maintainer-clean-recursive -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-graphite2.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-icu.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-map.Po + -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-cff1-table.Po + -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-cff2-table.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-color.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-face.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-ot-font.Po @@ -1846,6 +1903,9 @@ maintainer-clean: maintainer-clean-recursive -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-shape.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-shaper.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-static.Po + -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-subset-cff-common.Po + -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-subset-cff1.Po + -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-subset-cff2.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-unicode.Po -rm -f @HARFBUZZ_TREE@/src/$(DEPDIR)/hb-warning.Po -rm -f Makefile diff --git a/Build/source/libs/harfbuzz/TLpatches/ChangeLog b/Build/source/libs/harfbuzz/TLpatches/ChangeLog index 04eafb87164..9c359303c5c 100644 --- a/Build/source/libs/harfbuzz/TLpatches/ChangeLog +++ b/Build/source/libs/harfbuzz/TLpatches/ChangeLog @@ -1,3 +1,8 @@ +2018-12-22 Akira Kakuto + + Imported harfbuzz-2.3.0 source tree from: + http://www.freedesktop.org/software/harfbuzz/release/ + 2018-11-30 Akira Kakuto Imported harfbuzz-2.2.0 source tree from: diff --git a/Build/source/libs/harfbuzz/TLpatches/TL-Changes b/Build/source/libs/harfbuzz/TLpatches/TL-Changes index ce348915506..c25f50191e8 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-2.2.0/ tree as obtained from: +Changes applied to the harfbuzz-2.3.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 8b4f98cc176..b7075bddd05 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) 2.2.0. +# Generated by GNU Autoconf 2.69 for harfbuzz (TeX Live) 2.3.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='2.2.0' -PACKAGE_STRING='harfbuzz (TeX Live) 2.2.0' +PACKAGE_VERSION='2.3.0' +PACKAGE_STRING='harfbuzz (TeX Live) 2.3.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) 2.2.0 to adapt to many kinds of systems. +\`configure' configures harfbuzz (TeX Live) 2.3.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) 2.2.0:";; + short | recursive ) echo "Configuration of harfbuzz (TeX Live) 2.3.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 2.2.0 +harfbuzz (TeX Live) configure 2.3.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 2.2.0, which was +It was created by harfbuzz (TeX Live) $as_me 2.3.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='2.2.0' + VERSION='2.3.0' # Some tools Automake needs. @@ -4247,9 +4247,9 @@ WARNING_CFLAGS=$kpse_cv_warning_cflags HB_VERSION_MAJOR=2 -HB_VERSION_MINOR=2 +HB_VERSION_MINOR=3 HB_VERSION_MICRO=0 -HB_VERSION=2.2.0 +HB_VERSION=2.3.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 2.2.0, which was +This file was extended by harfbuzz (TeX Live) $as_me 2.3.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 2.2.0 +harfbuzz (TeX Live) config.status 2.3.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/CMakeLists.txt b/Build/source/libs/harfbuzz/harfbuzz-src/CMakeLists.txt index 019e205bc63..b6241e93772 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/CMakeLists.txt +++ b/Build/source/libs/harfbuzz/harfbuzz-src/CMakeLists.txt @@ -168,10 +168,6 @@ extract_make_variable(HB_BASE_headers ${SRCSOURCES}) add_prefix_to_list(HB_BASE_headers "${PROJECT_SOURCE_DIR}/src/") extract_make_variable(HB_FALLBACK_sources ${SRCSOURCES}) add_prefix_to_list(HB_FALLBACK_sources "${PROJECT_SOURCE_DIR}/src/") -extract_make_variable(HB_OT_sources ${SRCSOURCES}) -add_prefix_to_list(HB_OT_sources "${PROJECT_SOURCE_DIR}/src/") -extract_make_variable(HB_OT_headers ${SRCSOURCES}) -add_prefix_to_list(HB_OT_headers "${PROJECT_SOURCE_DIR}/src/") extract_make_variable(HB_SUBSET_sources ${SRCSOURCES}) add_prefix_to_list(HB_SUBSET_sources "${PROJECT_SOURCE_DIR}/src/") @@ -180,13 +176,10 @@ extract_make_variable(HB_SUBSET_headers ${SRCSOURCES}) add_prefix_to_list(HB_SUBSET_headers "${PROJECT_SOURCE_DIR}/src/") extract_make_variable(HB_BASE_RAGEL_GENERATED_sources ${SRCSOURCES}) -extract_make_variable(HB_OT_RAGEL_GENERATED_sources ${SRCSOURCES}) #if (IN_HB_DIST) add_prefix_to_list(HB_BASE_RAGEL_GENERATED_sources "${PROJECT_SOURCE_DIR}/src/") - add_prefix_to_list(HB_OT_RAGEL_GENERATED_sources "${PROJECT_SOURCE_DIR}/src/") #else () # add_prefix_to_list(HB_BASE_RAGEL_GENERATED_sources "${PROJECT_BINARY_DIR}/src/") -# add_prefix_to_list(HB_OT_RAGEL_GENERATED_sources "${PROJECT_BINARY_DIR}/src/") #endif () extract_make_variable(HB_VIEW_sources ${UTILSOURCES}) @@ -212,7 +205,7 @@ set (HB_VERSION_MICRO ${CMAKE_MATCH_4}) ## Define ragel tasks # if (NOT IN_HB_DIST) -# foreach (ragel_output IN ITEMS ${HB_BASE_RAGEL_GENERATED_sources} ${HB_OT_RAGEL_GENERATED_sources}) +# foreach (ragel_output IN ITEMS ${HB_BASE_RAGEL_GENERATED_sources}) # string(REGEX MATCH "([^/]+)\\.hh" temp ${ragel_output}) # set (target_name ${CMAKE_MATCH_1}) # add_custom_command(OUTPUT ${ragel_output} @@ -246,8 +239,6 @@ set (project_sources ${HB_BASE_RAGEL_GENERATED_sources} ${HB_FALLBACK_sources} - ${HB_OT_sources} - ${HB_OT_RAGEL_GENERATED_sources} ) set (subset_project_sources @@ -260,7 +251,6 @@ set (project_headers #${HB_VERSION_H} ${HB_BASE_headers} - ${HB_OT_headers} ) set (subset_project_headers @@ -706,6 +696,8 @@ if (HB_HAVE_INTROSPECTION) -DHB_H_IN -DHB_OT_H -DHB_OT_H_IN + -DHB_AAT_H + -DHB_AAT_H_IN -DHB_GOBJECT_H -DHB_GOBJECT_H_IN -DHB_EXTERN= diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog b/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog index e6e9cd1ea96..35148210668 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog +++ b/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog @@ -1,3 +1,2646 @@ +commit 87f7c83fffb7e64970be23c8e3c620d32a3b8f5b +Author: Behdad Esfahbod +Date: Thu Dec 20 15:54:17 2018 -0500 + + [serializer] Add operator << + + Not sure if we are going to use it. But might incentivize us to. + + src/hb-machinery.hh | 2 ++ + 1 file changed, 2 insertions(+) + +commit 5b70074edf1c12a9442037d54c03d3025bd93995 +Author: Behdad Esfahbod +Date: Thu Dec 20 15:38:59 2018 -0500 + + Add hb_assign(obj, value) + + src/hb-machinery.hh | 2 +- + src/hb-null.hh | 24 +++++++++++++++++++++++- + src/hb-open-type.hh | 5 +++-- + 3 files changed, 27 insertions(+), 4 deletions(-) + +commit 6124123393eabb77d34830c971ec463998d50aba +Author: Behdad Esfahbod +Date: Thu Dec 20 12:26:30 2018 -0500 + + [serialize] Adjust ClassDef + + [skip ci] + + src/hb-ot-layout-common.hh | 32 ++++++++++++++++---------------- + 1 file changed, 16 insertions(+), 16 deletions(-) + +commit 4220b7bdd7706622563401bf8f055c4b1482b4e5 +Author: Behdad Esfahbod +Date: Thu Dec 20 11:48:45 2018 -0500 + + Fix code on big-endian gcc / clang + + Ouch! We need a bigendian bot... + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1498 + + src/hb-machinery.hh | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +commit c87ee72232416099a73b563ca7aaf293b1c87b2a +Author: Behdad Esfahbod +Date: Wed Dec 19 22:28:16 2018 -0500 + + Minor [skip ci] + + src/hb-dsalgs.hh | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +commit 5000a59a6391d588c2cbdda132839b1fb1f75bf2 +Author: Behdad Esfahbod +Date: Wed Dec 19 21:07:53 2018 -0500 + + [saitnize] Minor + + src/hb-machinery.hh | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 3ee4ea945674c4b96c9aa6b0367bbf22dc8745d1 +Author: fanc999 +Date: Thu Dec 20 11:26:54 2018 +0800 + + Fix build on older Visual Studio versions (#1499) + + * src/hb-cff-interp-dict-common.hh: Use ull for unsigned int64_t + + The llu suffix does not work for older Visual Studio versions + (pre-2013), but ull works for all the compilers that we attempt to + support. + + * test/api: Fix build on pre-C99 compilers + + Ensure variables are declared at the top of the block. + + * src/hb-dsalgs.hh: Add specialization for hb_is_signed<> for __int8 + + Pre-Visual Studio 2010 does not consider __int8 (which is typedef'ed + to + int8_t) to be equivilant to signed char, so the compiler cannot + find the + corresponding hb_is_signed<> specialization that is needed. + + The interesting thing is unsigned __int8 is considered to be + equivilant + to unsigned char, so as the other types (short, int, long) that + we look + for here, so only the specialization for __int8 is added here. + + This will fix builds on Visual Studio 2008 at least. + + src/hb-cff-interp-dict-common.hh | 2 +- + src/hb-dsalgs.hh | 9 +++++++++ + test/api/test-aat-layout.c | 3 ++- + test/api/test-subset-cff1.c | 12 ++++++++---- + 4 files changed, 20 insertions(+), 6 deletions(-) + +commit a62870506d16949582bf0b54e3dc8846b9747a4a +Author: Behdad Esfahbod +Date: Wed Dec 19 21:05:00 2018 -0500 + + [sanitize] Use hb_static_size instead of ::static_size + + https://github.com/harfbuzz/harfbuzz/issues/1496#issuecomment-448818112 + + src/hb-machinery.hh | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +commit 0c9cd5d5f4d96df77e4298e16c786e67b83f9bc4 +Author: Ebrahim Byagowi +Date: Wed Dec 19 21:18:30 2018 +0330 + + [test] Fix test-name-table.cc leak issue + + Spotted it accidentally but wanted to see if is anything serious so + went for fixing it + + src/test-name-table.cc | 2 ++ + 1 file changed, 2 insertions(+) + +commit 3d9d7dc4dd4be8e746507282569504b511afa709 +Author: Behdad Esfahbod +Date: Tue Dec 18 22:11:23 2018 -0500 + + [arrays] Add hb_ubytes_t for unsigned char + + src/hb-array.hh | 1 + + 1 file changed, 1 insertion(+) + +commit f1e95e40edc871c840abe8a8a695efc252af40f5 +Author: Behdad Esfahbod +Date: Tue Dec 18 16:49:08 2018 -0500 + + [arrays] Remove hb_supplier_t<> + + src/hb-array.hh | 11 -- + src/hb-cff2-interp-cs.hh | 2 +- + src/hb-face.cc | 6 +- + src/hb-open-file.hh | 15 +- + src/hb-open-type.hh | 18 +- + src/hb-ot-cmap-table.hh | 3 +- + src/hb-ot-layout-common.hh | 104 ++++-------- + src/hb-ot-layout-gsub-table.hh | 257 + +++++++++++++---------------- + src/hb-ot-shape-complex-arabic-fallback.hh | 23 +-- + 9 files changed, 170 insertions(+), 269 deletions(-) + +commit f9417af29bd5a1d2f5b55389a1cc6f4280b347d8 +Author: Behdad Esfahbod +Date: Tue Dec 18 13:23:32 2018 -0500 + + [serialize] Propagate error from hb-face + + src/hb-face.cc | 1 + + 1 file changed, 1 insertion(+) + +commit 9aebfb418222427a324d911b32abfc11256ca9e3 +Author: Behdad Esfahbod +Date: Tue Dec 18 13:22:17 2018 -0500 + + [serialize] Streamline error propagation + + src/hb-buffer.hh | 2 ++ + src/hb-machinery.hh | 35 ++++++++++++++++++++++++++--------- + src/hb-map.hh | 2 ++ + src/hb-ot-layout-common.hh | 4 ++-- + src/hb-ot-layout-gsub-table.hh | 4 ++-- + src/hb-set.hh | 2 ++ + src/hb-subset.cc | 2 +- + 7 files changed, 37 insertions(+), 14 deletions(-) + +commit 969ff3c7aadbe721cdd414488eb170433f10d00c +Author: Behdad Esfahbod +Date: Mon Dec 17 22:43:00 2018 -0500 + + Remove unused hb-iter.hh + + The ideas there are all part of hb-array.hh now. To be determined + how we + want to use generic iterator patterns. + + src/Makefile.sources | 1 - + src/hb-iter.hh | 146 + --------------------------------------------------- + src/hb-machinery.hh | 1 - + 3 files changed, 148 deletions(-) + +commit b1094fc2d2b614c1407b502d15bd98407a5ffb56 +Author: Behdad Esfahbod +Date: Mon Dec 17 22:41:04 2018 -0500 + + [arrays] Minor tweaks to hb_supplier_t + + I think I like to keep this hb_supplier_t thing separately from + hb_array_t. + + src/hb-array.hh | 5 +++++ + 1 file changed, 5 insertions(+) + +commit cf39c242057636feebafce347f8e7ac2b305112a +Author: Behdad Esfahbod +Date: Mon Dec 17 22:36:23 2018 -0500 + + [arrays] Rename Supplier to hb_supplier_t + + src/hb-array.hh | 6 +- + src/hb-face.cc | 2 +- + src/hb-open-file.hh | 4 +- + src/hb-open-type.hh | 4 +- + src/hb-ot-cmap-table.hh | 2 +- + src/hb-ot-layout-common.hh | 34 ++++----- + src/hb-ot-layout-gsub-table.hh | 108 + ++++++++++++++--------------- + src/hb-ot-shape-complex-arabic-fallback.hh | 14 ++-- + 8 files changed, 87 insertions(+), 87 deletions(-) + +commit 6b5eaa753047b6b0389cb7521c52efbaccf72daf +Author: Behdad Esfahbod +Date: Mon Dec 17 21:55:33 2018 -0500 + + Hide hb_addressof() + + src/hb-dsalgs.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6befa75cdf83d561de69fb342f68694cd7b46f5e +Author: Behdad Esfahbod +Date: Mon Dec 17 20:34:51 2018 -0500 + + Enable __builtin_* on clang + + We'll see which old clang versions this breaks... + + src/hb-dsalgs.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 8d2d41025619e24160ed80edd1c413168a2dda36 +Author: Behdad Esfahbod +Date: Mon Dec 17 20:23:26 2018 -0500 + + Add hb_addressof() and use it to fix bug after hb_bytes_t merge + + We cannot take address hb_bytes_t direction. We need to use the + newly added hb_addressof(), ala std::addressof(). + + src/hb-dsalgs.hh | 9 +++++++++ + src/hb-ot-post-table.hh | 3 ++- + 2 files changed, 11 insertions(+), 1 deletion(-) + +commit 49334f9b509fc15e8baa93d49b86886ca933de04 +Author: Behdad Esfahbod +Date: Mon Dec 17 18:27:36 2018 -0500 + + Enable system extensions in hb.hh + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1491 + + configure.ac | 1 - + src/hb.hh | 26 ++++++++++++++++++++++++++ + 2 files changed, 26 insertions(+), 1 deletion(-) + +commit 37c14bc7459e8b9cc0840b68223123ffb950b4cc +Author: prrace +Date: Mon Dec 17 14:59:37 2018 -0800 + + Fix Solaris use after free (#1495) + + src/hb-atomic.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 483f2491e40ccf660836ed2797738297e40bd100 +Author: Behdad Esfahbod +Date: Mon Dec 17 17:56:10 2018 -0500 + + Remove define GNU_SOURCE + + Not needed. We get it in our config.h automatically thanks to + AC_USE_SYSTEM_EXTENSIONS. Let's see whose build it breaks... + If we end up putting it back, we should add other things from + that macro and remove the macro. + + src/hb.hh | 2 -- + 1 file changed, 2 deletions(-) + +commit 87ff65aea117391c732d51d874964b3e32d6fa94 +Author: Behdad Esfahbod +Date: Mon Dec 17 17:19:42 2018 -0500 + + Fix more warnings + + src/hb.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f9d219a17417f61fa2c6152d2181504866583a72 +Author: prrace +Date: Mon Dec 17 14:18:47 2018 -0800 + + Fix Solaris Trailing comma in enum warnings (#1490) + + src/hb-ot-color.h | 2 +- + src/hb-ot-name.h | 2 +- + src/hb-ot-var.h | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +commit 244a8627f7b0ed651d6010c7ee7e54fa8fcca400 +Author: Ebrahim Byagowi +Date: Mon Dec 17 21:31:43 2018 +0330 + + Lower coretext_aat shaper priority (#1488) + + Related to https://github.com/harfbuzz/harfbuzz/issues/1478 + + src/hb-shaper-list.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit e41200859997ccf8fd7d36fff654f3ceea3a4160 +Author: Ebrahim Byagowi +Date: Mon Dec 17 21:31:01 2018 +0330 + + Remove redundant void from C++ sources (#1486) + + src/dump-indic-data.cc | 2 +- + src/dump-khmer-data.cc | 2 +- + src/dump-myanmar-data.cc | 2 +- + src/dump-use-data.cc | 2 +- + src/hb-aat-fdsc-table.hh | 4 +- + src/hb-aat-layout-common.hh | 23 +++--- + src/hb-aat-layout-feat-table.hh | 8 +-- + src/hb-aat-layout-just-table.hh | 2 +- + src/hb-aat-layout-kerx-table.hh | 21 +++--- + src/hb-aat-layout-morx-table.hh | 10 +-- + src/hb-aat-layout-trak-table.hh | 4 +- + src/hb-aat-layout.cc | 6 +- + src/hb-aat-map.hh | 4 +- + src/hb-array.hh | 24 +++---- + src/hb-atomic.hh | 18 ++--- + src/hb-blob.cc | 8 +-- + src/hb-blob.hh | 33 ++++----- + src/hb-buffer-serialize.cc | 2 +- + src/hb-buffer.cc | 24 +++---- + src/hb-buffer.hh | 51 ++++++------- + src/hb-cache.hh | 6 +- + src/hb-cff-interp-common.hh | 113 +++++++++++++---------------- + src/hb-cff-interp-cs-common.hh | 26 +++---- + src/hb-cff-interp-dict-common.hh | 12 ++-- + src/hb-cff1-interp-cs.hh | 4 +- + src/hb-cff2-interp-cs.hh | 24 +++---- + src/hb-common.cc | 20 +++--- + src/hb-coretext.cc | 2 +- + src/hb-debug.hh | 6 +- + src/hb-directwrite.cc | 16 ++--- + src/hb-dsalgs.hh | 2 +- + src/hb-face.cc | 6 +- + src/hb-face.hh | 8 +-- + src/hb-font.cc | 6 +- + src/hb-font.hh | 6 +- + src/hb-ft.cc | 18 ++--- + src/hb-glib.cc | 8 +-- + src/hb-gobject-enums.cc.tmpl | 2 +- + src/hb-gobject-enums.h.tmpl | 2 +- + src/hb-gobject-structs.cc | 2 +- + src/hb-icu.cc | 8 +-- + src/hb-iter.hh | 15 ++-- + src/hb-machinery.hh | 150 + ++++++++++++++++----------------------- + src/hb-map.cc | 4 +- + src/hb-map.hh | 24 +++---- + src/hb-mutex.hh | 10 +-- + src/hb-null.hh | 32 ++++----- + src/hb-object.hh | 22 +++--- + src/hb-open-file.hh | 32 ++++----- + src/hb-open-type.hh | 66 +++++++++-------- + src/hb-ot-cff-common.hh | 30 ++++---- + src/hb-ot-cff1-table.cc | 17 ++--- + src/hb-ot-cff1-table.hh | 52 ++++++-------- + src/hb-ot-cff2-table.cc | 8 +-- + src/hb-ot-cff2-table.hh | 34 ++++----- + src/hb-ot-cmap-table.hh | 10 +-- + src/hb-ot-color-cbdt-table.hh | 4 +- + src/hb-ot-color-colr-table.hh | 2 +- + src/hb-ot-color-cpal-table.hh | 10 +-- + src/hb-ot-color-sbix-table.hh | 11 ++- + src/hb-ot-color-svg-table.hh | 7 +- + src/hb-ot-face.cc | 2 +- + src/hb-ot-face.hh | 2 +- + src/hb-ot-font.cc | 8 +-- + src/hb-ot-glyf-table.hh | 6 +- + src/hb-ot-hdmx-table.hh | 4 +- + src/hb-ot-head-table.hh | 8 +-- + src/hb-ot-hmtx-table.hh | 2 +- + src/hb-ot-kern-table.hh | 20 +++--- + src/hb-ot-layout-base-table.hh | 10 +-- + src/hb-ot-layout-common.hh | 67 +++++++++-------- + src/hb-ot-layout-gdef-table.hh | 20 +++--- + src/hb-ot-layout-gpos-table.hh | 34 ++++----- + src/hb-ot-layout-gsub-table.hh | 24 +++---- + src/hb-ot-layout-gsubgpos.hh | 92 +++++++++++------------- + src/hb-ot-layout-jstf-table.hh | 8 +-- + src/hb-ot-map.cc | 2 +- + src/hb-ot-map.hh | 8 +-- + src/hb-ot-math-table.hh | 11 ++- + src/hb-ot-maxp-table.hh | 5 +- + src/hb-ot-name-table.hh | 6 +- + src/hb-ot-os2-table.hh | 18 ++--- + src/hb-ot-post-table.hh | 4 +- + src/hb-ot-shape.cc | 2 +- + src/hb-ot-shape.hh | 2 +- + src/hb-ot-tag.cc | 4 +- + src/hb-ot-var-fvar-table.hh | 9 ++- + src/hb-ot-var-hvar-table.hh | 9 +-- + src/hb-ot-vorg-table.hh | 2 +- + src/hb-set-digest.hh | 4 +- + src/hb-set.cc | 4 +- + src/hb-set.hh | 38 +++++----- + src/hb-shape-plan.cc | 2 +- + src/hb-shape-plan.hh | 5 +- + src/hb-shape.cc | 10 +-- + src/hb-shaper.cc | 14 ++-- + src/hb-shaper.hh | 6 +- + src/hb-static.cc | 4 +- + src/hb-subset-cff-common.hh | 91 +++++++++++------------- + src/hb-subset-cff1.cc | 20 ++---- + src/hb-subset-cff2.cc | 8 +-- + src/hb-subset-input.cc | 2 +- + src/hb-subset.hh | 4 +- + src/hb-ucdn.cc | 10 +-- + src/hb-unicode.cc | 64 ++++++++--------- + src/hb-uniscribe.cc | 12 ++-- + src/hb-vector.hh | 38 +++++----- + src/hb.hh | 6 +- + src/test-unicode-ranges.cc | 4 +- + util/ansi-print.cc | 6 +- + util/hb-fc.cc | 2 +- + util/hb-shape.cc | 5 +- + util/helper-cairo.cc | 2 +- + util/helper-cairo.hh | 2 +- + util/main-font-text.hh | 2 +- + util/options.cc | 8 +-- + util/options.hh | 22 +++--- + util/view-cairo.hh | 14 ++-- + 118 files changed, 861 insertions(+), 1024 deletions(-) + +commit 7ace10078c23d00da4af0480f91b877faeed3d38 +Author: Ebrahim Byagowi +Date: Mon Dec 17 20:07:04 2018 +0330 + + Minor, fix two more ArrayOf incorrect operator logic + + src/hb-open-type.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit a1240383aa82fd88e922a1e751444d14033ae882 +Author: Behdad Esfahbod +Date: Mon Dec 17 10:44:14 2018 -0500 + + [arrays] Minor fix + + src/hb-open-type.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 381c3548e9022a421bcf88db148cc11f337f3b79 +Author: Behdad Esfahbod +Date: Mon Dec 17 00:39:30 2018 -0500 + + [array] Add cast operator to add const to Type + + In lieu of constructor removed in previous commit. + + src/hb-array.hh | 1 + + 1 file changed, 1 insertion(+) + +commit 15acf33c228e0c8e0f8cc6a04e566970164dd5f1 +Author: Behdad Esfahbod +Date: Mon Dec 17 00:38:13 2018 -0500 + + [array] Remove problematic constructor + + src/hb-array.hh | 1 - + 1 file changed, 1 deletion(-) + +commit 470369a871791b610e0c42212558e83baeb83409 +Author: Behdad Esfahbod +Date: Mon Dec 17 00:20:19 2018 -0500 + + [array] Add arithmetic operators + + src/hb-array.hh | 22 ++++++++++++++++++---- + 1 file changed, 18 insertions(+), 4 deletions(-) + +commit 6cd60c2f2aa17e3f02b50c19cf640b3f183f3354 +Author: Behdad Esfahbod +Date: Mon Dec 17 00:09:06 2018 -0500 + + [array] Return Crap instead of Null if Type is not const + + Ouch! + + src/hb-array.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 94e72cf1c9af563fbf522efb7f2e0b1fcd616418 +Author: Behdad Esfahbod +Date: Mon Dec 17 00:06:40 2018 -0500 + + [array] Add operator * + + src/hb-array.hh | 2 ++ + 1 file changed, 2 insertions(+) + +commit 68d4a5eee0f248891d20d69b897201d105951aef +Author: Behdad Esfahbod +Date: Mon Dec 17 00:02:42 2018 -0500 + + [array] Add constructor from fixed-size array + + src/hb-array.hh | 1 + + src/hb-iter.hh | 4 ++-- + 2 files changed, 3 insertions(+), 2 deletions(-) + +commit a4354d2fd36377ec8b544c7b88a231cb1273dccd +Author: Behdad Esfahbod +Date: Sun Dec 16 23:57:27 2018 -0500 + + [array] Organize + + src/hb-array.hh | 75 + ++++++++++++++++++++++++++++++++++++--------------------- + 1 file changed, 48 insertions(+), 27 deletions(-) + +commit 84c1865821151d83a8798ae11ebba3329a12c560 +Author: Behdad Esfahbod +Date: Sun Dec 16 23:52:17 2018 -0500 + + [arrays] Reduce Supplier<> even further + + src/hb-array.hh | 24 +++--------------------- + 1 file changed, 3 insertions(+), 21 deletions(-) + +commit 1bcc4fc9f34ab518fc822c9464a73ba3e90f5f1c +Author: Behdad Esfahbod +Date: Sun Dec 16 23:47:56 2018 -0500 + + Whitespace + + src/hb-ot-shape-complex-arabic-fallback.hh | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit f85f6e815f439075f8c6f5391e5c8dfe77e0f00d +Author: Behdad Esfahbod +Date: Sun Dec 16 23:45:07 2018 -0500 + + [array] Add operator += + + src/hb-array.hh | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +commit 7c0e3e9b2b077fced829a10f616ed3d6b51c15c4 +Author: Behdad Esfahbod +Date: Sun Dec 16 23:43:17 2018 -0500 + + [array] Add constructor from hb_array_t + + src/hb-array.hh | 1 + + 1 file changed, 1 insertion(+) + +commit 92680361ec68734ad38e2158626feebaf18eec88 +Author: Behdad Esfahbod +Date: Sun Dec 16 23:38:51 2018 -0500 + + [arrays] Move Supplier<> to hb-array.hh + + src/hb-array.hh | 33 +++++++++++++++++++++++++++++++++ + src/hb-machinery.hh | 32 -------------------------------- + 2 files changed, 33 insertions(+), 32 deletions(-) + +commit 2a3fa3f82ffdb778a2d21fc01e859579161237c9 +Author: Behdad Esfahbod +Date: Sun Dec 16 23:33:03 2018 -0500 + + [arrays] Remove unnecessary constructor from Supplier<> + + Looks like operator hb_array_t<> from vector works here. :) + + src/hb-machinery.hh | 5 ----- + 1 file changed, 5 deletions(-) + +commit 507cac4943e987879b95d842fe60643abbf22efa +Author: Behdad Esfahbod +Date: Sun Dec 16 23:31:19 2018 -0500 + + [arrays] Start moving Supplier<> to hb_array_t<> + + src/hb-machinery.hh | 31 +++++++++++-------------------- + 1 file changed, 11 insertions(+), 20 deletions(-) + +commit 1e2c98126e8500ace31483b05d77478afd59bab8 +Author: Behdad Esfahbod +Date: Sun Dec 16 22:30:44 2018 -0500 + + [arrays] Remove unused stride from Supplier + + src/hb-machinery.hh | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +commit 0d0fe9df46c645538feaee1ec99a0108383a3669 +Author: Behdad Esfahbod +Date: Sun Dec 16 22:29:40 2018 -0500 + + [arrays] Remove need of stride in Supplier<> + + src/hb-face.cc | 6 ++---- + src/hb-open-file.hh | 19 +++++++++---------- + src/hb-vector.hh | 2 +- + 3 files changed, 12 insertions(+), 15 deletions(-) + +commit dcfa4a8d711716de88b94a370663e9564e3e7ccc +Author: Behdad Esfahbod +Date: Sun Dec 16 20:40:07 2018 -0500 + + [array] Remove custom hb_bytes_t implementation + + src/hb-array.hh | 67 + +++++++++++++++++-------------------------------- + src/hb-machinery.hh | 2 +- + src/hb-ot-name-table.hh | 8 +++--- + src/hb-ot-name.cc | 10 ++++---- + 4 files changed, 33 insertions(+), 54 deletions(-) + +commit 3656f56d47cf6b89a25990d7836704fef79fa5b4 +Author: Behdad Esfahbod +Date: Sun Dec 16 20:35:11 2018 -0500 + + [arrays] Minor + + src/hb-array.hh | 3 ++- + src/hb-open-type.hh | 10 ++++------ + src/hb-vector.hh | 4 +--- + 3 files changed, 7 insertions(+), 10 deletions(-) + +commit aa8f94714ee720c56be1a3406df7bacb0550158c +Author: Behdad Esfahbod +Date: Sun Dec 16 20:20:35 2018 -0500 + + [array] Minor + + src/hb-array.hh | 4 ++++ + src/hb-iter.hh | 2 +- + 2 files changed, 5 insertions(+), 1 deletion(-) + +commit 5a552f75468d777d8d4bd3168e28f56a3369eafd +Author: Behdad Esfahbod +Date: Sun Dec 16 20:07:44 2018 -0500 + + [array] Move hb_array_t and related types to hb-array.hh + + src/Makefile.sources | 1 + + src/hb-array.hh | 241 + +++++++++++++++++++++++++++++++++++++++++++++++++++ + src/hb-dsalgs.hh | 206 ------------------------------------------- + src/hb-machinery.hh | 1 + + src/hb-vector.hh | 2 +- + 5 files changed, 244 insertions(+), 207 deletions(-) + +commit 01d06e34ffa746d3737df00bb692cdb1e859c1c6 +Author: Behdad Esfahbod +Date: Sun Dec 16 14:27:43 2018 -0500 + + Minor change to explicit_operator aesthetics + + src/hb-iter.hh | 2 +- + src/hb-machinery.hh | 2 +- + src/hb-vector.hh | 4 ++-- + src/hb.hh | 4 ++-- + 4 files changed, 6 insertions(+), 6 deletions(-) + +commit b2ebaa9afac0f57006283db92d1f3b4df3d6bd7e +Author: Ebrahim Byagowi +Date: Sun Dec 16 22:38:10 2018 +0330 + + Remove redundant 'inline' from methods (#1483) + + src/hb-aat-fdsc-table.hh | 12 +- + src/hb-aat-layout-ankr-table.hh | 12 +- + src/hb-aat-layout-bsln-table.hh | 13 +- + src/hb-aat-layout-common.hh | 150 +++++++------- + src/hb-aat-layout-feat-table.hh | 46 ++--- + src/hb-aat-layout-just-table.hh | 26 +-- + src/hb-aat-layout-kerx-table.hh | 120 +++++------ + src/hb-aat-layout-lcar-table.hh | 14 +- + src/hb-aat-layout-morx-table.hh | 104 +++++----- + src/hb-aat-layout-trak-table.hh | 28 +-- + src/hb-aat-layout.hh | 2 +- + src/hb-aat-ltag-table.hh | 6 +- + src/hb-aat-map.hh | 7 +- + src/hb-atomic.hh | 26 +-- + src/hb-blob.hh | 32 ++- + src/hb-buffer.hh | 76 ++++--- + src/hb-cache.hh | 10 +- + src/hb-cff-interp-common.hh | 197 +++++++++--------- + src/hb-cff-interp-cs-common.hh | 166 +++++++-------- + src/hb-cff-interp-dict-common.hh | 26 +-- + src/hb-cff1-interp-cs.hh | 21 +- + src/hb-cff2-interp-cs.hh | 48 ++--- + src/hb-common.cc | 13 +- + src/hb-debug.hh | 20 +- + src/hb-directwrite.cc | 2 +- + src/hb-dsalgs.hh | 84 ++++---- + src/hb-face.cc | 2 +- + src/hb-face.hh | 6 +- + src/hb-font.hh | 216 ++++++++++---------- + src/hb-ft.cc | 8 +- + src/hb-glib.cc | 2 +- + src/hb-icu.cc | 2 +- + src/hb-iter.hh | 18 +- + src/hb-kern.hh | 8 +- + src/hb-machinery.hh | 210 +++++++++---------- + src/hb-map.hh | 38 ++-- + src/hb-mutex.hh | 12 +- + src/hb-null.hh | 26 +-- + src/hb-object.hh | 34 ++-- + src/hb-open-file.hh | 92 ++++----- + src/hb-open-type.hh | 253 ++++++++++++----------- + src/hb-ot-cff-common.hh | 177 ++++++++-------- + src/hb-ot-cff1-table.cc | 32 +-- + src/hb-ot-cff1-table.hh | 160 +++++++-------- + src/hb-ot-cff2-table.cc | 16 +- + src/hb-ot-cff2-table.hh | 62 +++--- + src/hb-ot-cmap-table.hh | 185 +++++++++-------- + src/hb-ot-color-cbdt-table.hh | 40 ++-- + src/hb-ot-color-colr-table.hh | 18 +- + src/hb-ot-color-cpal-table.hh | 55 +++-- + src/hb-ot-color-sbix-table.hh | 48 ++--- + src/hb-ot-color-svg-table.hh | 20 +- + src/hb-ot-font.cc | 2 +- + src/hb-ot-gasp-table.hh | 6 +- + src/hb-ot-glyf-table.hh | 37 ++-- + src/hb-ot-hdmx-table.hh | 36 ++-- + src/hb-ot-head-table.hh | 10 +- + src/hb-ot-hhea-table.hh | 2 +- + src/hb-ot-hmtx-table.hh | 18 +- + src/hb-ot-kern-table.hh | 44 ++-- + src/hb-ot-layout-base-table.hh | 104 +++++----- + src/hb-ot-layout-common.hh | 425 + ++++++++++++++++++++------------------- + src/hb-ot-layout-gdef-table.hh | 126 ++++++------ + src/hb-ot-layout-gpos-table.hh | 209 +++++++++---------- + src/hb-ot-layout-gsub-table.hh | 360 ++++++++++++++++----------------- + src/hb-ot-layout-gsubgpos.hh | 353 ++++++++++++++++---------------- + src/hb-ot-layout-jstf-table.hh | 44 ++-- + src/hb-ot-map.hh | 38 ++-- + src/hb-ot-math-table.hh | 142 ++++++------- + src/hb-ot-maxp-table.hh | 12 +- + src/hb-ot-name-table.hh | 21 +- + src/hb-ot-os2-table.hh | 34 ++-- + src/hb-ot-post-table.hh | 26 +-- + src/hb-ot-shape-complex-indic.cc | 10 +- + src/hb-ot-shape-complex-khmer.cc | 10 +- + src/hb-ot-shape.hh | 6 +- + src/hb-ot-stat-table.hh | 16 +- + src/hb-ot-var-avar-table.hh | 8 +- + src/hb-ot-var-fvar-table.hh | 55 +++-- + src/hb-ot-var-hvar-table.hh | 16 +- + src/hb-ot-var-mvar-table.hh | 10 +- + src/hb-ot-vorg-table.hh | 22 +- + src/hb-set-digest.hh | 41 ++-- + src/hb-set.hh | 114 +++++------ + src/hb-shape.cc | 14 +- + src/hb-shaper.cc | 14 +- + src/hb-shaper.hh | 10 +- + src/hb-subset-cff-common.hh | 175 ++++++++-------- + src/hb-subset-cff1.cc | 91 ++++----- + src/hb-subset-cff2.cc | 36 ++-- + src/hb-subset-plan.hh | 12 +- + src/hb-subset.hh | 4 +- + src/hb-ucdn.cc | 2 +- + src/hb-unicode.hh | 26 +-- + src/hb-uniscribe.cc | 16 +- + src/hb-utf.hh | 54 +++-- + src/hb-vector.hh | 86 ++++---- + 97 files changed, 2911 insertions(+), 2987 deletions(-) + +commit 7251c7729061b7df29efe2b466315e96c81ad03f +Author: Behdad Esfahbod +Date: Sat Dec 15 21:00:55 2018 -0500 + + Whitespace + + src/hb-buffer-serialize.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 829b56b1a22736eac49132b2e56dc480157afca2 +Author: Behdad Esfahbod +Date: Sat Dec 15 13:02:13 2018 -0500 + + Whitespace + + src/hb-ot-cff-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 42a1012562c1f020f470526a34b68ed21ad138cc +Author: Behdad Esfahbod +Date: Thu Dec 13 19:39:59 2018 -0500 + + [subset] Actually subset GDEF + + src/hb-subset.cc | 3 +++ + 1 file changed, 3 insertions(+) + +commit c9c746c7f6091e575fd74ba8f8cae2c4fd44a1ad +Author: Behdad Esfahbod +Date: Thu Dec 13 18:37:37 2018 -0500 + + [subset] Fix up ClassDef some more + + src/hb-ot-layout-common.hh | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +commit 7ee6128902333716dd8d8df6e38a8d1ebacb0a46 +Author: Behdad Esfahbod +Date: Thu Dec 13 18:32:04 2018 -0500 + + [subset] Fix ClassDefFormat1 subsetting + + src/hb-ot-layout-common.hh | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +commit 1b6d0c44b3067f5840d3fdac99fbc7448d0f37bf +Author: Behdad Esfahbod +Date: Thu Dec 13 18:10:48 2018 -0500 + + [subset] Sketch GDEF subsetting + + src/hb-ot-layout-gdef-table.hh | 20 ++++++++++++++++++++ + src/hb-ot-layout-gsubgpos.hh | 2 ++ + 2 files changed, 22 insertions(+) + +commit 705e2f5056d60c28154004e0c5d3b0ec67fe93c8 +Author: Behdad Esfahbod +Date: Thu Dec 13 17:48:42 2018 -0500 + + [subset] Implement for ClassDef + + src/hb-ot-layout-common.hh | 80 + ++++++++++++++++++++++++++++++++++++++++++ + src/hb-ot-layout-gsub-table.hh | 8 ++--- + 2 files changed, 84 insertions(+), 4 deletions(-) + +commit 6e33a3955df77b9d1fda5ea44302d97b21e7871c +Author: Behdad Esfahbod +Date: Thu Dec 13 16:40:01 2018 -0500 + + Minor + + src/hb-machinery.hh | 12 +++++++++--- + src/hb-ot-cmap-table.hh | 3 +-- + src/hb-ot-layout-gsub-table.hh | 8 ++++---- + 3 files changed, 14 insertions(+), 9 deletions(-) + +commit cc65901ca7185df926570d5067ace763a2cc759e +Author: Behdad Esfahbod +Date: Thu Dec 13 16:01:45 2018 -0500 + + [serialize] Implement for ClassDef + + src/hb-ot-layout-common.hh | 33 +++++++++++++++++++++++++++++++-- + 1 file changed, 31 insertions(+), 2 deletions(-) + +commit e5309e4fd8583aa5c5ad9f3934d8aa593c850468 +Author: Behdad Esfahbod +Date: Thu Dec 13 15:57:12 2018 -0500 + + [serialize] Implement for ClassDefFormat2 + + src/hb-ot-layout-common.hh | 50 + ++++++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 46 insertions(+), 4 deletions(-) + +commit c8b43cbe316b07507aece4dc769f38226cd706da +Author: Behdad Esfahbod +Date: Thu Dec 13 15:50:13 2018 -0500 + + [serialize] Implement for ClassDefFormat1 + + src/hb-ot-layout-common.hh | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +commit 576103132945c9d916514720d4034b398e099cfa +Author: Behdad Esfahbod +Date: Wed Dec 12 21:21:26 2018 -0500 + + [subset] Minor + + src/hb-subset.cc | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 798e98c47bd9fa4d434487ae92e2c88ebb8a19a5 +Author: Michiharu Ariza +Date: Wed Dec 12 18:08:15 2018 -0800 + + [CFF] bad offset in Index (#1476) + + * Update hb-ot-cff-common.hh + + * fix bug + + * bummer fix wasn't hit. refix + + * additional sanity check + + * Added test cases for oss-fuzz issues 11805, 11806 + + src/hb-ot-cff-common.hh | 10 + ++++++++-- + ...clusterfuzz-testcase-hb-subset-fuzzer-5643036478930944 | Bin 0 -> + 369 bytes + ...clusterfuzz-testcase-hb-subset-fuzzer-5686186874503168 | Bin 0 -> + 962 bytes + 3 files changed, 8 insertions(+), 2 deletions(-) + +commit bcb4ecaf68c7219e89a801352bfc6a682b1581ef +Author: Michiharu Ariza +Date: Wed Dec 12 17:36:01 2018 -0800 + + [CFF] check out of range FD index (#1477) + + * add fd index checks to subr subsetter + + also added oss-fuzz test case + + * undid SubrSubsetParam::is_valid + + because already validated by SubrClosures.valid + + src/hb-subset-cff-common.hh | 10 ++++++++++ + ...lusterfuzz-testcase-hb-subset-fuzzer-5762137968869376 | Bin 0 -> + 2037 bytes + 2 files changed, 10 insertions(+) + +commit 3f8e7a98d3cc10fefe65b9638c8abdf3ebe152cb +Author: Behdad Esfahbod +Date: Wed Dec 12 11:32:57 2018 -0500 + + [util/hb-subset] Add --layout to keep GDEF/GSUB/GPOS + + Will become default and option removed in the future. + + util/hb-subset.cc | 1 + + util/options.cc | 1 + + util/options.hh | 2 ++ + 3 files changed, 4 insertions(+) + +commit 2cc993e035cb37711f894968246817e53a9e823d +Author: Behdad Esfahbod +Date: Wed Dec 12 10:07:38 2018 -0500 + + [dispatch] Minor + + src/hb-ot-layout-gpos-table.hh | 4 +--- + src/hb-ot-layout-gsub-table.hh | 4 +--- + 2 files changed, 2 insertions(+), 6 deletions(-) + +commit 602fbfe3c96b3f18b0109239528ba18a19be4948 +Author: Behdad Esfahbod +Date: Wed Dec 12 09:56:47 2018 -0500 + + [sanitize] Fix sanitizing sublookup array + + src/hb-ot-layout-common.hh | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +commit c78e4784fbe06ceb27b54a1d8908016ade071cb4 +Author: Behdad Esfahbod +Date: Wed Dec 12 09:50:18 2018 -0500 + + [dispatch] Minor + + src/hb-machinery.hh | 1 + + src/hb-ot-layout-gsubgpos.hh | 3 --- + src/hb-subset.hh | 1 - + 3 files changed, 1 insertion(+), 4 deletions(-) + +commit f9d211af1d6d78d092038d263b222ec8a65cf09d +Author: Behdad Esfahbod +Date: Wed Dec 12 09:44:30 2018 -0500 + + Revert "Minor fix re sanitize of Lookup subtables" + + This reverts commit 7146718bef81492e13aede0a2801cda1da41ce35. + + Fixing differently. + + src/hb-ot-layout-common.hh | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit 7ee5c52345c122436e054062084cd51292b90ad1 +Author: Ebrahim Byagowi +Date: Wed Dec 12 15:14:37 2018 +0330 + + minor style fix, use void in methods on no argument + + src/hb-aat-fdsc-table.hh | 4 +- + src/hb-aat-layout-common.hh | 6 +- + src/hb-aat-layout-feat-table.hh | 4 +- + src/hb-aat-layout-trak-table.hh | 18 +-- + src/hb-aat-layout.cc | 4 +- + src/hb-buffer.cc | 48 +++---- + src/hb-directwrite.cc | 297 + +++++++++++++++++++--------------------- + src/hb-dsalgs.hh | 5 +- + src/hb-map.hh | 20 +-- + src/hb-ot-cmap-table.hh | 2 +- + src/hb-ot-color-cbdt-table.hh | 2 +- + src/hb-ot-color-cpal-table.hh | 4 +- + src/hb-ot-color-sbix-table.hh | 10 +- + src/hb-ot-color-svg-table.hh | 15 +- + src/hb-ot-glyf-table.hh | 2 +- + src/hb-ot-hdmx-table.hh | 6 +- + src/hb-ot-layout-base-table.hh | 11 +- + src/hb-ot-os2-table.hh | 15 +- + 18 files changed, 211 insertions(+), 262 deletions(-) + +commit a33f238f8888cc969e1e393deda0518fb8dd6b13 +Merge: 7146718b 1e09add2 +Author: Ebrahim Byagowi +Date: Wed Dec 12 12:44:06 2018 +0330 + + Merge pull request #1474 from fanc999/master.msvc + + Few fixes for Visual Studio builds + +commit 7146718bef81492e13aede0a2801cda1da41ce35 +Author: Behdad Esfahbod +Date: Tue Dec 11 23:44:29 2018 -0500 + + Minor fix re sanitize of Lookup subtables + + We were dereferencing Null pointers and trying to sanitize them, + which is not necessary... + + src/hb-ot-layout-common.hh | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit ce069d193229cde12c77a3f464fc10286bedf5f3 +Author: Behdad Esfahbod +Date: Tue Dec 11 23:07:48 2018 -0500 + + Minor + + src/hb-open-type.hh | 1 - + 1 file changed, 1 deletion(-) + +commit 1aea86944605e7e18acfd2c0a77ba60e62239274 +Author: Behdad Esfahbod +Date: Tue Dec 11 22:53:58 2018 -0500 + + [subset] Map glyphs during SingleSubst subsetting + + Ha! + + src/hb-ot-layout-gsub-table.hh | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +commit 41d1a1c10f7e5ca69a337ae164d270e09b5f93ac +Author: Behdad Esfahbod +Date: Tue Dec 11 22:48:27 2018 -0500 + + [subset] Minor + + src/hb-machinery.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2aba2c6c73301396f7e0e5dee819ab6863e74900 +Author: Behdad Esfahbod +Date: Tue Dec 11 21:18:47 2018 -0500 + + [serialize] Break down assert + + src/hb-machinery.hh | 18 ++++++++---------- + 1 file changed, 8 insertions(+), 10 deletions(-) + +commit 9844c880e280e9cd28dcbeac2e581ac923c5ddf3 +Author: Behdad Esfahbod +Date: Tue Dec 11 17:28:04 2018 -0500 + + Minor + + test/shaping/Makefile.am | 2 ++ + util/Makefile.am | 2 ++ + 2 files changed, 4 insertions(+) + +commit 2941208f1eedabec2715b2a67d40f058df7eb5e6 +Author: Michiharu Ariza +Date: Tue Dec 11 12:21:24 2018 -0800 + + [CFF] oss-fuzz issue 11690 ASSERT: substr.offset >= opStart (#1461) + + * fix oss-fuzz 11690: substr.offset >= opStart + + detect recursive subroutine call & handle as error + + * fix build failure + + * add minimized test case for oss-fuzz 11690 + + * removed asserts + + src/hb-cff-interp-common.hh | 9 ++++----- + src/hb-subset-cff-common.hh | 12 + ++++++++++-- + src/hb-subset-cff1.cc | 4 ++-- + src/hb-subset-cff2.cc | 4 ++-- + ...testcase-minimized-hb-subset-fuzzer-5750420593442816 | Bin 0 -> + 96091 bytes + 5 files changed, 18 insertions(+), 11 deletions(-) + +commit 333586245cb37668c8a29af17920474c09667f4b +Author: Michiharu Ariza +Date: Tue Dec 11 12:20:20 2018 -0800 + + minimize use of assert: removed or changed to error handling (#1467) + + src/hb-ot-cff-common.hh | 2 +- + src/hb-ot-cff1-table.hh | 12 ++++++++---- + src/hb-subset-cff-common.cc | 6 ++++-- + src/hb-subset-cff-common.hh | 1 - + src/hb-subset-cff1.cc | 22 +++++++++++++++++----- + src/hb-subset-cff2.cc | 14 +++++++++++--- + 6 files changed, 41 insertions(+), 16 deletions(-) + +commit f24498c1e95e816889eb7a2f8b1062bbf15bed1b +Author: Ebrahim Byagowi +Date: Tue Dec 11 23:02:52 2018 +0330 + + [ci] Fix Travis macOS bot ICU issue (#1472) + + .travis.yml | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 9f3a51ddb952e1281f9a656fde7193c3e3b8dad2 +Author: 👻 +Date: Tue Dec 11 13:38:05 2018 -0500 + + [ucdn] Fix header + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1470 + + src/hb-ucdn/ucdn.h | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit b225593d6baf3455e1ac951efc0df5015fdf7c69 +Author: David Corbett +Date: Tue Dec 11 13:19:17 2018 -0500 + + Correct REPLACEMENT CHARACTER's code point to FFFD (#1471) + + test/shaping/hb_test_tools.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 1e09add232e14ef61d2f222a5ee05a2105af64f0 +Author: Chun-wei Fan +Date: Wed Dec 12 01:32:01 2018 +0800 + + test/api: Fix building on pre-C99 compilers + + Ensure variables are declared at the top of the block. + + test/api/hb-test.h | 3 ++- + test/api/test-aat-layout.c | 3 ++- + test/api/test-font.c | 2 +- + test/api/test-map.c | 9 ++++++--- + test/api/test-ot-color.c | 9 +++++---- + test/api/test-ot-face.c | 14 ++++++++------ + test/api/test-ot-name.c | 30 ++++++++++++++++-------------- + test/api/test-ot-tag.c | 11 ++++++----- + 8 files changed, 46 insertions(+), 35 deletions(-) + +commit 09b16c536d31376de771eedde54620dd6c8f39d7 +Author: Chun-wei Fan +Date: Wed Dec 12 01:23:53 2018 +0800 + + CMake: Fix Introspection builds + + We need to add -DHB_AAT_H and -DHB_AAT_H_IN to the flags that + are passed + to g-ir-scanner, so that introspection builds can proceed normally. + + CMakeLists.txt | 2 ++ + 1 file changed, 2 insertions(+) + +commit 1683bb2c9337fa34e5e80d459ab5eab99d7a9804 +Author: Ebrahim Byagowi +Date: Sat Dec 8 13:57:39 2018 +0330 + + [glyf] minor + + src/hb-ot-glyf-table.hh | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit f7cfe99815c07f82d5ad253af1e811db734bf92b +Author: Ebrahim Byagowi +Date: Sat Dec 8 13:40:44 2018 +0330 + + [os2] Move typometrics detection logic to the table (#1465) + + src/hb-ot-hmtx-table.hh | 14 +++++--------- + src/hb-ot-os2-table.hh | 7 ++++--- + 2 files changed, 9 insertions(+), 12 deletions(-) + +commit 47cf9a9633bbff12fef1131e7179dfc351f7e5f3 +Author: Ebrahim Byagowi +Date: Sat Dec 8 10:20:25 2018 +0330 + + Apply non-controversial parts of ot-style (#1464) + + Things to be used in https://github.com/harfbuzz/harfbuzz/pull/1459 + + src/hb-aat-fdsc-table.hh | 29 +++++++++++++++++++++++++--- + src/hb-aat-layout-common.hh | 1 + + src/hb-ot-head-table.hh | 13 +++++++++++++ + src/hb-ot-os2-table.hh | 46 + +++++++++++++++++++++++++++++++++++++++++++++ + src/hb-ot-stat-table.hh | 38 ++++++++++++++++++------------------- + 5 files changed, 105 insertions(+), 22 deletions(-) + +commit 4d809696ef4db046d11072e5433ea5ff36bd7b26 +Author: Michiharu Ariza +Date: Fri Dec 7 20:49:39 2018 -0800 + + fix for issue #1447 (#1462) + + Added case for OpCode_BaseFontName. This opcode in spec but + practically unused. + Added a comment for default case which can't be hit + + src/hb-ot-cff1-table.hh | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 1abd4fcaec31053b442525d7f240af489c5974b1 +Author: Ebrahim Byagowi +Date: Fri Dec 7 22:34:12 2018 +0330 + + [fdsc] minor + + src/hb-aat-fdsc-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 59345cdef38cf1f514a6a0eb6e8852350acb6166 +Author: Michiharu Ariza +Date: Thu Dec 6 13:36:26 2018 -0800 + + [CFF] Refix oss-fuzz 11714: set_blends (PR #1458) (#1460) + + * pass subarray of stack to set_blends + + * get_subarray to return a value, not ref + + * restored error check (with tweak) + + src/hb-cff-interp-common.hh | 5 +++++ + src/hb-cff2-interp-cs.hh | 14 +++++++++----- + 2 files changed, 14 insertions(+), 5 deletions(-) + +commit 20245f0000a0f04f2ba172b51ce69ee7ebb256aa +Author: Behdad Esfahbod +Date: Thu Dec 6 10:27:37 2018 -0800 + + Fix likely check + + Ouch! + + src/hb-cff-interp-dict-common.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit d866e905fd555d393464ed58d5fc11ee453c7ea4 +Author: Behdad Esfahbod +Date: Thu Dec 6 10:26:32 2018 -0800 + + Add default value to first argument of sub_array() + + src/hb-dsalgs.hh | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit f1352f7486caaf6d3480ef2ac6b4719acf73e6a2 +Author: Behdad Esfahbod +Date: Thu Dec 6 10:21:06 2018 -0800 + + Add sub_array to hb_vector_t + + src/hb-vector.hh | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +commit ca23b719357b01e98a5cf533bbf637d6706a4ec2 +Author: Behdad Esfahbod +Date: Thu Dec 6 10:19:03 2018 -0800 + + Add default-value for second arg of sub_array() + + src/hb-dsalgs.hh | 7 +++---- + src/hb-open-type.hh | 8 ++++---- + 2 files changed, 7 insertions(+), 8 deletions(-) + +commit 6ad3fcddaf2ba8ebc9ad49ff9e7b33b60fcad16a +Merge: f95324a3 ae087d10 +Author: Ebrahim Byagowi +Date: Thu Dec 6 10:21:00 2018 +0330 + + Merge pull request #1458 from harfbuzz/cff-check-blends + + [CFF] oss-fuzz issue 11714: set_blends + +commit ae087d10c22249f3aec3239e4eac98a728f71f75 +Author: Michiharu Ariza +Date: Wed Dec 5 21:47:34 2018 -0800 + + add minimized test case for oss-fuzz issue 11714 + + ...-testcase-minimized-hb-subset-fuzzer-5710107829075968 | Bin 0 -> + 3660 bytes + 1 file changed, 0 insertions(+), 0 deletions(-) + +commit 1ccbdcf73bbc967f5f94c0bc7f7e869bd87d9fa0 +Merge: 14d29a10 f95324a3 +Author: Michiharu Ariza +Date: Wed Dec 5 21:37:38 2018 -0800 + + Merge branch 'master' into cff-check-blends + +commit 14d29a10437205566c4bd7bcfa2282d34d9f4f2f +Author: Michiharu Ariza +Date: Wed Dec 5 21:33:29 2018 -0800 + + check number of blends against args on stack + + src/hb-cff2-interp-cs.hh | 5 +++++ + 1 file changed, 5 insertions(+) + +commit f95324a3351c1f699214ad84d073268218ea83a3 +Merge: 6727c4b6 9d8f3b0d +Author: Ebrahim Byagowi +Date: Thu Dec 6 08:33:44 2018 +0330 + + Merge pull request #1457 from harfbuzz/cff-varstore-sanitize + + [CFF] oss-fuzz issue 11713 (CFF2VariationStore::serialize) + +commit 6727c4b6f0356b08803b4d5cde608ec004e3533f +Merge: d9dabc00 34e3ef8f +Author: Behdad Esfahbod +Date: Wed Dec 5 17:37:21 2018 -0800 + + Merge pull request #1456 from harfbuzz/cff-subr-sanitize + + [CFF] fix oss-fuzz issue 11691 (BlendArg::set_blends) + +commit 9d8f3b0dfbf39f5dfa25d52f47e8af6ad318eb17 +Author: Michiharu Ariza +Date: Wed Dec 5 17:14:51 2018 -0800 + + add minimized test case for oss-fuzz issue 11713 + + ...z-testcase-minimized-hb-subset-fuzzer-5660711141769216 | Bin 0 -> + 383 bytes + 1 file changed, 0 insertions(+), 0 deletions(-) + +commit c31092ab34641072606f854408eb1bea18ed2507 +Author: Michiharu Ariza +Date: Wed Dec 5 17:04:55 2018 -0800 + + sanitize variationStore in CFF2 against its size + + src/hb-ot-cff2-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 34e3ef8ff394f281b8d7e2c08f346a9495692edc +Merge: 72d8f763 d9dabc00 +Author: Michiharu Ariza +Date: Wed Dec 5 15:50:05 2018 -0800 + + Merge branch 'master' into cff-subr-sanitize + +commit 72d8f76368b264a42fe58438fe15811d458a7935 +Author: Michiharu Ariza +Date: Wed Dec 5 15:49:11 2018 -0800 + + add minimized test case for oss-fuzz issue 11691 + + ...z-testcase-minimized-hb-shape-fuzzer-5686369209286656 | Bin 0 -> + 2880 bytes + 1 file changed, 0 insertions(+), 0 deletions(-) + +commit d9dabc00e9278a346e85538212c126da7e610d55 +Merge: 81cfd3c7 010e2ddb +Author: Behdad Esfahbod +Date: Wed Dec 5 15:39:34 2018 -0800 + + Merge pull request #1454 from harfbuzz/cff-fixbcd + + [CFF] fix oss-fuzz issue 11674: parse_bcd + +commit 81cfd3c775dbc470f57d7fe2775cc068ffa367b6 +Merge: 8394a6cb 6708c559 +Author: Behdad Esfahbod +Date: Wed Dec 5 15:37:15 2018 -0800 + + Merge pull request #1455 from harfbuzz/cff-strinc_assert + + [CFF] fix oss-fuzz issue 11675 (ASSERT: count <= str.len) + +commit 6dcfda92c17a7701479118751a8290246e9a3c05 +Author: Michiharu Ariza +Date: Wed Dec 5 15:07:46 2018 -0800 + + sanitize CFF1 & CFF2 global subrs + + src/hb-ot-cff1-table.hh | 2 +- + src/hb-ot-cff2-table.hh | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +commit 6708c5595fc6babdae0132f8a23cbe3558a58703 +Author: Michiharu Ariza +Date: Wed Dec 5 12:51:18 2018 -0800 + + fix oss-fuzz issue 11675 (ASSERT: count <= str.len) + + Also added an additional error check to avail () + + src/hb-cff-interp-common.hh | 18 + ++++++++++++++++-- + ...stcase-minimized-hb-subset-fuzzer-5768186323009536 | Bin 0 -> + 337 bytes + 2 files changed, 16 insertions(+), 2 deletions(-) + +commit 010e2ddb384b5a721172fd7466aafec58dbf8063 +Author: Michiharu Ariza +Date: Wed Dec 5 12:23:58 2018 -0800 + + minimized test case for oss-fuzz issue 11674 + + ...zz-testcase-minimized-hb-subset-fuzzer-5672006905757696 | Bin 0 -> + 73 bytes + 1 file changed, 0 insertions(+), 0 deletions(-) + +commit 2cb9d4c183afc838ecf2ba0d47814e9eaa6f09c6 +Merge: a5fa843c 8394a6cb +Author: Michiharu Ariza +Date: Wed Dec 5 11:25:29 2018 -0800 + + Merge branch 'master' into cff-fixbcd + +commit a5fa843c746e20aaca48ece6cff057deb8d916ca +Author: Michiharu Ariza +Date: Wed Dec 5 11:18:16 2018 -0800 + + fixed a bug with fractional part in a negative value + + src/hb-cff-interp-dict-common.hh | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 8394a6cb252dd8b4230c2b59e8c346ec5403bf88 +Author: Ebrahim Byagowi +Date: Wed Dec 5 15:23:41 2018 +0330 + + [os2] Make newer table fields accessible (#1452) + + src/hb-ot-os2-table.hh | 88 + +++++++++++++++++++++++++++++++++++++------------- + 1 file changed, 66 insertions(+), 22 deletions(-) + +commit 5ab086ebb18112ef48bf6c913acc91b2009a9bed +Author: Ebrahim Byagowi +Date: Wed Dec 5 14:17:37 2018 +0330 + + [fdsc] Implement the table parsing + + Related to https://github.com/harfbuzz/harfbuzz/issues/1337 + + May used in addition to an API related to STAT. + + Lots of Apple fonts have it. + + src/Makefile.sources | 1 + + src/hb-aat-fdsc-table.hh | 103 + +++++++++++++++++++++++++++++++++++++++++++++++ + src/hb-aat-layout.cc | 1 + + 3 files changed, 105 insertions(+) + +commit 8f80e53341a3d5bac6c2c39ab6d6973eedb0b074 +Author: Ebrahim Byagowi +Date: Wed Dec 5 13:51:14 2018 +0330 + + [gasp] Implement the table parsing + + May or may not be used in + https://github.com/harfbuzz/harfbuzz/pull/1432 + + src/Makefile.sources | 1 + + src/hb-ot-gasp-table.hh | 84 + +++++++++++++++++++++++++++++++++++++++++++++++++ + src/hb-ot-layout.cc | 5 +-- + 3 files changed, 88 insertions(+), 2 deletions(-) + +commit 79e7e3445efef2dc57f8a10c7e355e802af08868 +Merge: cf4b7db6 78f639b8 +Author: Ebrahim Byagowi +Date: Wed Dec 5 13:25:18 2018 +0330 + + Merge pull request #1449 from harfbuzz/cff-fixcharset + + [CFF] fix for oss-fuzz 11657: Charset overrun + +commit cf4b7db6b1e01c11d7a8a26d95cf947935a234a7 +Merge: 32cc46c7 803d2f92 +Author: Ebrahim Byagowi +Date: Wed Dec 5 13:23:23 2018 +0330 + + Merge pull request #1448 from harfbuzz/cff-leak + + [CFF] fix leak: oss-fuzz 11662 + +commit 620d1ef588c6ce25644891cfe4b9c20fd8a9d1db +Author: Michiharu Ariza +Date: Wed Dec 5 00:36:11 2018 -0800 + + fix unsigned long const + + src/hb-cff-interp-dict-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 28dfb4c14280b05ad0a519f9df2b0eda41a62540 +Author: Michiharu Ariza +Date: Wed Dec 5 00:26:03 2018 -0800 + + fix signed/unsigned comparison + + src/hb-cff-interp-dict-common.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit f9cee08edd32182044407bf6ffde00df0feb09b7 +Author: Michiharu Ariza +Date: Tue Dec 4 23:58:26 2018 -0800 + + use sized int types in parse_bcd + + src/hb-cff-interp-dict-common.hh | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit c01a5f32a33fa875de68ca29a4672fd36a05245b +Author: Michiharu Ariza +Date: Tue Dec 4 23:23:23 2018 -0800 + + refix + + src/hb-cff-interp-dict-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 755fefc92113e469a1aadee2546958fede156c01 +Author: Michiharu Ariza +Date: Tue Dec 4 23:18:28 2018 -0800 + + fix bug + + src/hb-cff-interp-dict-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 0e81b153aff1f2e301e73ca1a15a9bc5b2e7bb82 +Author: Michiharu Ariza +Date: Tue Dec 4 22:40:07 2018 -0800 + + fix typo + + src/hb-cff-interp-dict-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 85d4b15cd88ce9a6ffccccf90300f9c184166058 +Author: Michiharu Ariza +Date: Tue Dec 4 22:30:33 2018 -0800 + + include float.h + + src/hb-cff-interp-dict-common.hh | 1 + + 1 file changed, 1 insertion(+) + +commit 5a7c371e4c6f1775ebbfe120fafe92afe402a954 +Author: Michiharu Ariza +Date: Tue Dec 4 22:24:38 2018 -0800 + + check overflow & clamp + + src/hb-cff-interp-dict-common.hh | 36 + +++++++++++++++++++++++++++--------- + 1 file changed, 27 insertions(+), 9 deletions(-) + +commit 32cc46c75a5f163f254b7998ed9193d5bbc85e4b +Author: Michiharu Ariza +Date: Tue Dec 4 21:32:34 2018 -0800 + + [CFF] fix oss-fuzz issue 11670: NULL dereference (#1450) + + * guard against no subr access + + * code tweak + + * add minimized testcase for oss-fuzz 11670 (Null deference) + + src/hb-cff-interp-cs-common.hh | 22 + ++++++++++++++++----- + src/hb-ot-cff-common.hh | 2 +- + ...ase-minimized-hb-subset-fuzzer-5672913680728064 | Bin 0 -> 861 bytes + 3 files changed, 18 insertions(+), 6 deletions(-) + +commit 78f639b8bf508ccfb27224f12442f8e8a1460e08 +Author: Michiharu Ariza +Date: Tue Dec 4 14:17:03 2018 -0800 + + added minimized testcase for oss-fuzz issue 11657 + + ...zz-testcase-minimized-hb-shape-fuzzer-5700264032468992 | Bin 0 -> + 648 bytes + 1 file changed, 0 insertions(+), 0 deletions(-) + +commit d3d2f32c6e85de1d7fbbb18afef356e09110e61c +Author: Michiharu Ariza +Date: Tue Dec 4 13:51:26 2018 -0800 + + fix oss-fuzz 11657: buffer overrun + + Check overrun in Charset1_2::get_glyph + + src/hb-ot-cff1-table.hh | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +commit d0a250a7b15f1099c2005bc2427d62e7370dcc33 +Author: Ebrahim Byagowi +Date: Tue Dec 4 23:42:13 2018 +0330 + + Reuse hb_aat_layout_has_* logic in coretext-aat detection logic + (#1442) + + src/hb-coretext.cc | 16 ++-------------- + 1 file changed, 2 insertions(+), 14 deletions(-) + +commit 803d2f92dca329a84d92c224a73e13906e8b8d56 +Merge: 6ce8d10b c775adc1 +Author: Michiharu Ariza +Date: Tue Dec 4 11:01:26 2018 -0800 + + Merge branch 'master' into cff-leak + +commit 6ce8d10b45598f5f6dade38e65486f793f33d0b6 +Author: Michiharu Ariza +Date: Tue Dec 4 10:39:17 2018 -0800 + + add unlikely to error handling + + src/hb-ot-cff1-table.hh | 2 +- + src/hb-ot-cff2-table.hh | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit b61f74f69a84f427b40deefefed429fbc915981c +Author: Michiharu Ariza +Date: Tue Dec 4 10:30:35 2018 -0800 + + added minimized test case for oss-fuzz issue 11662 + + ...testcase-minimized-hb-shape-fuzzer-5175735354916864 | Bin 0 -> + 354461 bytes + 1 file changed, 0 insertions(+), 0 deletions(-) + +commit 0b952e6026c8be13d16d97f464034ee477e6282f +Author: Michiharu Ariza +Date: Tue Dec 4 10:22:35 2018 -0800 + + more leak fixes + + src/hb-ot-cff1-table.hh | 2 +- + src/hb-ot-cff2-table.hh | 3 ++- + 2 files changed, 3 insertions(+), 2 deletions(-) + +commit c775adc1383f72f02b1329628b3eba1dc377a0f7 +Merge: c968869f 04f2ca94 +Author: Ebrahim Byagowi +Date: Tue Dec 4 21:30:07 2018 +0330 + + Merge pull request #1444 from harfbuzz/cff-assert + + removed assert, fixes https://github.com/harfbuzz/harfbuzz/issues/1443 + +commit 9473463f5c884fcb1de8a7ba7410da2601e6ffa8 +Author: Michiharu Ariza +Date: Tue Dec 4 09:58:48 2018 -0800 + + fix attempt for oss-fuzz 11662 leak + + src/hb-ot-cff1-table.hh | 1 + + 1 file changed, 1 insertion(+) + +commit 04f2ca94212983d675ed2cd36350be23ff2a6e19 +Author: Michiharu Ariza +Date: Tue Dec 4 09:24:07 2018 -0800 + + removed assert + + src/hb-ot-cff1-table.hh | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit c968869f212dbfcb86d42fb36049328521cbf00c +Merge: 8c05b955 c48f53d3 +Author: Behdad Esfahbod +Date: Tue Dec 4 04:14:13 2018 -0500 + + Merge pull request #1441 from harfbuzz/cff-doublenum + + use double as CFF Number implementation + +commit c48f53d30901dfc20b7432c2947e66642010dc4e +Author: Michiharu Ariza +Date: Mon Dec 3 16:59:41 2018 -0800 + + more double changes + + src/hb-cff2-interp-cs.hh | 4 ++-- + test/api/test-ot-extents-cff.c | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit 9424e8052686a6a93e0d30e38aecbe927db9d787 +Author: Michiharu Ariza +Date: Mon Dec 3 16:18:10 2018 -0800 + + added minimized test cases + + ...zz-testcase-minimized-hb-shape-fuzzer-5647267827023872 | Bin 0 -> + 655 bytes + ...zz-testcase-minimized-hb-shape-fuzzer-5725855502827520 | Bin 0 -> + 655 bytes + ...zz-testcase-minimized-hb-shape-fuzzer-5736657639178240 | Bin 0 -> + 459 bytes + 3 files changed, 0 insertions(+), 0 deletions(-) + +commit 5fff6ab0024547a8ac47723a0047f4b17416d6ce +Author: Michiharu Ariza +Date: Mon Dec 3 16:06:58 2018 -0800 + + additional precision made a difference in extents test + + src/hb-cff-interp-common.hh | 2 +- + src/hb-cff2-interp-cs.hh | 2 +- + test/api/test-ot-extents-cff.c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +commit 9e5180cd444b6900a0fa0c3df4c8138f9a663383 +Author: Michiharu Ariza +Date: Mon Dec 3 15:32:42 2018 -0800 + + more double changes + + src/hb-cff-interp-common.hh | 8 ++++---- + src/hb-cff-interp-dict-common.hh | 10 +++++----- + 2 files changed, 9 insertions(+), 9 deletions(-) + +commit 9af33d7a2ad5ce88fc508bc5c6a56be4650d2621 +Author: Michiharu Ariza +Date: Mon Dec 3 14:48:46 2018 -0800 + + Number to use double for all types + + src/hb-cff-interp-common.hh | 84 + +++++++-------------------------------------- + 1 file changed, 13 insertions(+), 71 deletions(-) + +commit 8c05b955eb4aa088b2b5df9b6415863486eaf59c +Merge: d19b1680 01f628cf +Author: Behdad Esfahbod +Date: Mon Dec 3 14:30:51 2018 -0500 + + Merge pull request #1439 from ebraminio/tracking + + [aat] Expose hb_aat_layout_has_tracking API + +commit 01f628cf5571b8b58108ab66cfc3e929c9840e31 +Author: Ebrahim Byagowi +Date: Mon Dec 3 22:04:48 2018 +0330 + + [aat] Expose hb_aat_layout_has_tracking API + + docs/harfbuzz-sections.txt | 7 ++++--- + src/hb-aat-layout.cc | 9 ++++++++- + src/hb-aat-layout.h | 8 ++++++++ + src/hb-aat-layout.hh | 3 --- + test/api/fonts/aat-morx.ttf | Bin 0 -> 1620 bytes + test/api/fonts/aat-trak.ttf | Bin 0 -> 2456 bytes + test/api/test-aat-layout.c | 13 +++++++++++++ + 7 files changed, 33 insertions(+), 7 deletions(-) + +commit d19b1680b53e54f449736432f369a676c394ebf8 +Author: Behdad Esfahbod +Date: Mon Dec 3 10:41:37 2018 -0500 + + [aat] Expose a couple APIs + + New API: + +hb_aat_layout_has_substitution() + +hb_aat_layout_has_positioning() + + docs/harfbuzz-sections.txt | 2 ++ + src/hb-aat-layout.cc | 20 ++++++++++++++++---- + src/hb-aat-layout.h | 16 ++++++++++++++++ + src/hb-aat-layout.hh | 6 ------ + 4 files changed, 34 insertions(+), 10 deletions(-) + +commit 84efe0438e1cfc5b070e114b70e8c070be6119ca +Author: Behdad Esfahbod +Date: Sun Dec 2 12:38:53 2018 -0500 + + [aat] Fix division sign fallout + + Happened after 11d2f49af8f53340134c844173f4d8655b00dea3 + since now nClasses is unsigned int... + + src/hb-aat-layout-common.hh | 2 +- + ...zz-testcase-minimized-hb-shape-fuzzer-5768046065483776 | Bin 0 -> + 342 bytes + 2 files changed, 1 insertion(+), 1 deletion(-) + +commit 2087f5a2a743380b36399ba8a2b4ff9e93890fcf +Author: Behdad Esfahbod +Date: Sat Dec 1 20:04:45 2018 -0500 + + Add casts to hb_array_t<> + + src/hb-open-type.hh | 13 ++++++++++--- + src/hb-vector.hh | 2 ++ + 2 files changed, 12 insertions(+), 3 deletions(-) + +commit 58d4d19947794aded4e966290b01e1034f216a7d +Author: Behdad Esfahbod +Date: Sat Dec 1 19:34:18 2018 -0500 + + Simplify build source list + + CMakeLists.txt | 12 +-- + src/Makefile.am | 6 -- + src/Makefile.sources | 231 + ++++++++++++++++++++++++--------------------------- + 3 files changed, 111 insertions(+), 138 deletions(-) + +commit 967a204ee92548163a0d19678a237dcaf3720c20 +Author: Behdad Esfahbod +Date: Sat Dec 1 19:28:17 2018 -0500 + + Minor + + test/api/hb-subset-test.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 11d2f49af8f53340134c844173f4d8655b00dea3 +Author: Behdad Esfahbod +Date: Sat Dec 1 13:12:21 2018 -0500 + + New approach to change BigEndian casts to be int-sized + + Fixes spurious warnings like: + Fixes https://github.com/harfbuzz/harfbuzz/issues/1436 + + src/hb-open-type.hh | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +commit 50e0273ab18acd2fbb21bcf18ad487092e890b4e +Author: Behdad Esfahbod +Date: Sat Dec 1 13:03:52 2018 -0500 + + Change hb_assert_unsigned_t<> to hb_is_signed<> + + src/hb-dsalgs.hh | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +commit c3a8b047aab47e40dc107a952b3a1472068ec932 +Author: Behdad Esfahbod +Date: Sat Dec 1 00:14:48 2018 -0500 + + Revert "Change BigEndian casts to be int-sized" + + This reverts commit eb5ddd32bf4e458ca0af8d5784f8fd46485ad225. + + Broke tests, badly. To be investigated and reenabled. + + src/hb-open-type.hh | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit be45677ab605efc711a433323d66e4051c289252 +Author: Behdad Esfahbod +Date: Sat Dec 1 00:04:29 2018 -0500 + + Minor + + src/hb-ot-layout-gsub-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit eb5ddd32bf4e458ca0af8d5784f8fd46485ad225 +Author: Behdad Esfahbod +Date: Sat Dec 1 00:03:01 2018 -0500 + + Change BigEndian casts to be int-sized + + Fixes spurious warnings like: + Fixes https://github.com/harfbuzz/harfbuzz/issues/1436 + + src/hb-open-type.hh | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit e8860fdcaa69e3452edd903f78599bc8fa9d109c +Author: Behdad Esfahbod +Date: Fri Nov 30 23:38:24 2018 -0500 + + Fix more warning + + src/hb-ot-cff-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit af349ee3487b31c2328f0a37a43d31b248ed14e5 +Author: Behdad Esfahbod +Date: Fri Nov 30 23:20:50 2018 -0500 + + Fix warning + + src/hb-ot-cff-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 825df6dbc7fd013c68d7b5672f81e69b69bc14e7 +Author: Behdad Esfahbod +Date: Fri Nov 30 23:04:59 2018 -0500 + + [CFF] Change spaces to tabs + + src/hb-cff-interp-common.hh | 389 ++++++++++++++++----------------- + src/hb-cff-interp-cs-common.hh | 324 ++++++++++++++-------------- + src/hb-cff-interp-dict-common.hh | 190 ++++++++-------- + src/hb-cff1-interp-cs.hh | 72 +++---- + src/hb-cff2-interp-cs.hh | 76 +++---- + src/hb-ot-cff-common.hh | 128 +++++------ + src/hb-ot-cff1-table.cc | 4 +- + src/hb-ot-cff1-table.hh | 456 + +++++++++++++++++++-------------------- + src/hb-ot-cff2-table.cc | 4 +- + src/hb-ot-cff2-table.hh | 216 +++++++++---------- + src/hb-subset-cff-common.cc | 76 +++---- + src/hb-subset-cff-common.hh | 384 ++++++++++++++++----------------- + src/hb-subset-cff1.cc | 416 + +++++++++++++++++------------------ + src/hb-subset-cff1.hh | 2 +- + src/hb-subset-cff2.cc | 240 ++++++++++----------- + src/hb-subset-cff2.hh | 2 +- + 16 files changed, 1492 insertions(+), 1487 deletions(-) + +commit 592f39b3c4ed04a6f6cf129020358e64782c7108 +Author: Behdad Esfahbod +Date: Fri Nov 30 22:54:57 2018 -0500 + + [CFF] Whitespace + + src/hb-cff-interp-common.hh | 7 +++---- + src/hb-cff-interp-cs-common.hh | 6 +++--- + src/hb-cff-interp-dict-common.hh | 6 +++--- + src/hb-cff2-interp-cs.hh | 2 +- + src/hb-ot-cff-common.hh | 12 ++++++------ + src/hb-ot-cff1-table.hh | 30 +++++++++++++++--------------- + src/hb-ot-cff2-table.hh | 12 ++++++------ + src/hb-subset-cff-common.cc | 8 ++++---- + src/hb-subset-cff-common.hh | 34 +++++++++++++++++----------------- + src/hb-subset-cff1.cc | 20 ++++++++++---------- + src/hb-subset-cff2.cc | 18 +++++++++--------- + 11 files changed, 77 insertions(+), 78 deletions(-) + +commit a2e8d1d455c5d0ae22927567cf8a9a2539cd3470 +Author: Behdad Esfahbod +Date: Fri Nov 30 22:54:20 2018 -0500 + + Minor + + src/Makefile.sources | 27 +++++++++++++-------------- + 1 file changed, 13 insertions(+), 14 deletions(-) + +commit e3dc47c6357813d2dd098aad312d79e9d7c2aa18 +Author: Behdad Esfahbod +Date: Fri Nov 30 22:43:22 2018 -0500 + + Remove generated files that were accidentally added by CFF2 branch + + gtk-doc.make | 320 -- + m4/libtool.m4 | 8369 + ----------------------------------------------------- + m4/ltoptions.m4 | 437 --- + m4/ltsugar.m4 | 124 - + m4/ltversion.m4 | 23 - + m4/lt~obsolete.m4 | 99 - + 6 files changed, 9372 deletions(-) + +commit 5e64e0f53259dbc0a3ea8e220ded15e85bbc1782 +Merge: 09096aa8 d8c69137 +Author: Behdad Esfahbod +Date: Fri Nov 30 22:40:54 2018 -0500 + + Merge pull request #1113 from harfbuzz/cff-subset + + CFF/CFF2 subsetter + +commit 09096aa89f1944dff94a5518bce578eba8989e74 +Author: Bruce Mitchener +Date: Sat Dec 1 10:22:49 2018 +0700 + + Use nullptr instead of 0/NULL. (#1435) + + * Use nullptr instead of 0/NULL. + + * Update test-name-table.cc + + src/hb-debug.hh | 2 +- + src/test-name-table.cc | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit d8c69137655fbe9678d1dfef0eb3c4172f8bbfc0 +Author: Michiharu Ariza +Date: Fri Nov 30 18:58:14 2018 -0800 + + undo 0u + + src/hb-cff2-interp-cs.hh | 2 +- + src/hb-ot-cff1-table.hh | 4 ++-- + src/hb-ot-vorg-table.hh | 2 +- + src/hb-subset-cff-common.hh | 4 ++-- + src/hb-subset-cff1.cc | 4 ++-- + 5 files changed, 8 insertions(+), 8 deletions(-) + +commit 2c859b3880868b30823eb00bed90dc0de873628b +Merge: 9483da14 bb72de66 +Author: Michiharu Ariza +Date: Fri Nov 30 18:47:34 2018 -0800 + + Merge branch 'master' into cff-subset + +commit bb72de66ddf3ae9ae53cf68642cb228e88aa64f5 +Merge: fedd8e6c fb059082 +Author: Behdad Esfahbod +Date: Fri Nov 30 21:36:35 2018 -0500 + + Merge pull request #1433 from harfbuzz/overload-overload + + Fix ambiguous overload errors with old compilers + +commit fb059082138bf17a5a8616410d9a35f927f9fd85 +Author: Behdad Esfahbod +Date: Fri Nov 30 20:45:40 2018 -0500 + + Revert ugly fixes + + Now that we have 6daf45e0, revert cryptic hacks... + + This reverts commit abd81ed4f5cbc5a94171747909bc6b77551cb929. + This reverts commit 9c6921c08c905a0cf45ba0182134e6ff910fac51. + This reverts commit d39760cabfe4007cefdfc45231e85e93fababac2. + This reverts commit fedd8e6c176dea85194693399e50243eb1c117c4. + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1374 + + src/hb-aat-layout-morx-table.hh | 4 ++-- + src/hb-face.cc | 4 ++-- + src/hb-machinery.hh | 4 ++-- + src/hb-ot-color-cpal-table.hh | 2 +- + src/hb-ot-kern-table.hh | 2 +- + src/hb-ot-layout-gpos-table.hh | 32 ++++++++++++++++---------------- + src/hb-ot-layout-gsubgpos.hh | 14 +++++++------- + 7 files changed, 31 insertions(+), 31 deletions(-) + +commit dfad19ad5aefdacecca6af81917abc2670d4416f +Author: Behdad Esfahbod +Date: Fri Nov 30 19:57:12 2018 -0500 + + Make operator [] take signed int + + The built-in operator takes signed int. So, match it, such that + the built-in is never a better or equally-good match to our operator. + Fixes "ambiguous overload" errors from gcc 4.2 and VS 2008. + + See https://github.com/harfbuzz/harfbuzz/issues/1374 + + src/hb-dsalgs.hh | 3 ++- + src/hb-open-type.hh | 42 ++++++++++++++++++++++++++++-------------- + src/hb-vector.hh | 6 ++++-- + 3 files changed, 34 insertions(+), 17 deletions(-) + +commit 9483da145d6da1bdfa3224fe13a5b4e9b449d19f +Author: Michiharu Ariza +Date: Fri Nov 30 16:59:41 2018 -0800 + + redo fixes + + src/hb-cff2-interp-cs.hh | 2 +- + src/hb-ot-cff1-table.hh | 4 ++-- + src/hb-subset-cff-common.hh | 6 +++--- + src/hb-subset-cff1.cc | 4 ++-- + 4 files changed, 8 insertions(+), 8 deletions(-) + +commit 291da448237cdc0b5534fbc1ce2288e1aa8e7b8a +Author: Michiharu Ariza +Date: Fri Nov 30 16:50:46 2018 -0800 + + yet another + + src/hb-subset-cff-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit b1821b9d092e4fd7fd888f4bffc341283bace461 +Author: Michiharu Ariza +Date: Fri Nov 30 16:31:01 2018 -0800 + + some more + + src/hb-subset-cff-common.hh | 4 ++-- + src/hb-subset-cff1.cc | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +commit 9784cff55688d1ee93275e39c2339d5a486ed78b +Author: Michiharu Ariza +Date: Fri Nov 30 16:07:08 2018 -0800 + + fix another pesky gcc error + + src/hb-cff2-interp-cs.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 23a797b44365ed76fc7db25be13bd9c3580a8695 +Author: Michiharu Ariza +Date: Fri Nov 30 15:15:31 2018 -0800 + + silence picky gcc errors + + src/hb-ot-cff1-table.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 9ae954f43ad1eb703d54db98ce46157370b71a9c +Merge: 471db3aa fedd8e6c +Author: Michiharu Ariza +Date: Fri Nov 30 15:00:52 2018 -0800 + + Merge branch 'master' into cff-subset + +commit fedd8e6c176dea85194693399e50243eb1c117c4 +Author: Behdad Esfahbod +Date: Fri Nov 30 16:50:30 2018 -0500 + + One more......... + + I wonder if there's something better to do about these :(. + + In file included from hb-ot-color.cc:31: + hb-ot-color-cpal-table.hh: In member function 'unsigned int + OT::CPAL::get_size() const': + hb-ot-color-cpal-table.hh:118: error: ISO C++ says that these are + ambiguous, even though the worst conversion for the first is better + than the worst conversion for the second: + + src/hb-ot-color-cpal-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit bc5db9b0807767ac04d6e50070d69cb9c520f06e +Author: Behdad Esfahbod +Date: Fri Nov 30 16:04:52 2018 -0500 + + One more.... + + hb-ot-vorg-table.hh:96: error: ISO C++ says that these are ambiguous, + even though the worst conversion for the first is better than the + worst conversion for the second: + hb-vector.hh:87: note: candidate 1: const Type& hb_vector_t::operator[](unsigned int) const [with Type = + OT::VertOriginMetric, unsigned int PreallocedCount = 8u] + hb-ot-vorg-table.hh:96: note: candidate 2: operator[](const T*, + int) + + src/hb-ot-vorg-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d39760cabfe4007cefdfc45231e85e93fababac2 +Author: Behdad Esfahbod +Date: Fri Nov 30 15:55:30 2018 -0500 + + One more... + + Sigh. + + hb-ot-kern-table.hh: In member function 'int + OT::KernSubTableFormat3::get_kerning(hb_codepoint_t, + hb_codepoint_t) const': + hb-ot-kern-table.hh:59: error: ambiguous overload for 'operator[]' + in 'kernValue[kernIndex[i]]' + hb-ot-kern-table.hh:59: note: candidates are: operator[](T*, int) + + hb-dsalgs.hh:574: note: Type& + hb_array_t::operator[](unsigned int) const [with Type = const + OT::IntType] + + src/hb-ot-kern-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 9c6921c08c905a0cf45ba0182134e6ff910fac51 +Author: Behdad Esfahbod +Date: Fri Nov 30 15:16:57 2018 -0500 + + More... + + hb-ot-layout-gsubgpos.hh:1707: error: ISO C++ says that these are + ambiguous, even though the worst conversion for the first is better + than the worst conversion for the second: + ... + + src/hb-aat-layout-morx-table.hh | 4 ++-- + src/hb-ot-layout-gpos-table.hh | 32 ++++++++++++++++---------------- + src/hb-ot-layout-gsubgpos.hh | 16 ++++++++-------- + 3 files changed, 26 insertions(+), 26 deletions(-) + +commit f998bb2086342d6fdcd4295593eddea91396e0b6 +Author: Behdad Esfahbod +Date: Fri Nov 30 12:52:21 2018 -0500 + + More weird fixes + + In file included from hb-ot-name.cc:29: + hb-ot-name-table.hh: In member function 'unsigned int + OT::name::get_size() const': + hb-ot-name-table.hh:157: error: ISO C++ says that these are ambiguous, + even though the worst conversion for the first is better than the + worst conversion for the second: + hb-open-type.hh:354: note: candidate 1: const Type& + OT::UnsizedArrayOf::operator[](unsigned int) const [with Type + = OT::NameRecord] + hb-ot-name-table.hh:157: note: candidate 2: operator[](const T*, + int) + hb-ot-name-table.hh: In member function 'void + OT::name::accelerator_t::init(hb_face_t*)': + hb-ot-name-table.hh:196: error: ISO C++ says that these are ambiguous, + even though the worst conversion for the first is better than the + worst conversion for the second: + hb-dsalgs.hh:574: note: candidate 1: Type& + hb_array_t::operator[](unsigned int) const [with Type = + const OT::NameRecord] + hb-ot-name-table.hh:196: note: candidate 2: operator[](T*, int) + + hb-ot-name-table.hh:197: error: ISO C++ says that these are ambiguous, + even though the worst conversion for the first is better than the + worst conversion for the second: + hb-dsalgs.hh:574: note: candidate 1: Type& + hb_array_t::operator[](unsigned int) const [with Type = + const OT::NameRecord] + hb-ot-name-table.hh:197: note: candidate 2: operator[](T*, int) + + hb-ot-name-table.hh:198: error: ISO C++ says that these are ambiguous, + even though the worst conversion for the first is better than the + worst conversion for the second: + hb-dsalgs.hh:574: note: candidate 1: Type& + hb_array_t::operator[](unsigned int) const [with Type = + const OT::NameRecord] + hb-ot-name-table.hh:198: note: candidate 2: operator[](T*, int) + + make[4]: *** [libharfbuzz_la-hb-ot-name.lo] Error 1 + make[3]: *** [all-recursive] Error 1 + + src/hb-ot-name-table.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 67fd94da98f950b5feb719ac805f2a45379fc935 +Merge: abd81ed4 ae79fdaa +Author: Behdad Esfahbod +Date: Fri Nov 30 11:53:30 2018 -0500 + + Merge commit 'ae79fdaa7774d3f886a8f03926577c3bd2010b03' + +commit abd81ed4f5cbc5a94171747909bc6b77551cb929 +Author: Behdad Esfahbod +Date: Fri Nov 30 11:51:26 2018 -0500 + + Umm. Cryptic, yes + + In file included from hb-face.cc:35: + hb-ot-cmap-table.hh: In member function 'void + OT::CmapSubtableFormat4::_compiles_assertion_on_line_388() const': + hb-ot-cmap-table.hh:388: error: ISO C++ says that these are ambiguous, + even though the worst conversion for the first is better than the + worst conversion for the second: + hb-open-type.hh:354: note: candidate 1: const Type& + OT::UnsizedArrayOf::operator[](unsigned int) const [with Type = + OT::IntType] + hb-ot-cmap-table.hh:388: note: candidate 2: operator[](const T*, + int) + hb-ot-cmap-table.hh: In member function 'void + OT::CmapSubtableFormat4::_instance_assertion_on_line_388() const': + hb-ot-cmap-table.hh:388: error: ISO C++ says that these are ambiguous, + even though the worst conversion for the first is better than the + worst conversion for the second: + hb-open-type.hh:354: note: candidate 1: const Type& + OT::UnsizedArrayOf::operator[](unsigned int) const [with Type = + OT::IntType] + hb-ot-cmap-table.hh:388: note: candidate 2: operator[](const T*, + int) + hb-face.cc: In function 'hb_blob_t* + _hb_face_builder_data_reference_blob(hb_face_builder_data_t*)': + hb-face.cc:650: error: ISO C++ says that these are ambiguous, even + though the worst conversion for the first is better than the worst + conversion for the second: + hb-vector.hh:81: note: candidate 1: Type& hb_vector_t::operator[](unsigned int) [with Type = + hb_face_builder_data_t::table_entry_t, unsigned int PreallocedCount + = 32u] + hb-face.cc:650: note: candidate 2: operator[](T*, int) + hb-face.cc:650: error: ISO C++ says that these are ambiguous, even + though the worst conversion for the first is better than the worst + conversion for the second: + hb-vector.hh:81: note: candidate 1: Type& hb_vector_t::operator[](unsigned int) [with Type = + hb_face_builder_data_t::table_entry_t, unsigned int PreallocedCount + = 32u] + hb-face.cc:650: note: candidate 2: operator[](const T*, int) + + hb-face.cc:651: error: ISO C++ says that these are ambiguous, even + though the worst conversion for the first is better than the worst + conversion for the second: + hb-vector.hh:81: note: candidate 1: Type& hb_vector_t::operator[](unsigned int) [with Type = + hb_face_builder_data_t::table_entry_t, unsigned int PreallocedCount + = 32u] + hb-face.cc:651: note: candidate 2: operator[](T*, int) + hb-face.cc:651: error: ISO C++ says that these are ambiguous, even + though the worst conversion for the first is better than the worst + conversion for the second: + hb-vector.hh:81: note: candidate 1: Type& hb_vector_t::operator[](unsigned int) [with Type = + hb_face_builder_data_t::table_entry_t, unsigned int PreallocedCount + = 32u] + hb-face.cc:651: note: candidate 2: operator[](const T*, int) + + + src/hb-face.cc | 4 ++-- + src/hb-machinery.hh | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +commit ae79fdaa7774d3f886a8f03926577c3bd2010b03 +Author: Behdad Esfahbod +Date: Fri Nov 30 11:51:26 2018 -0500 + + Umm. Cryptic, yes + + hb-face.cc:650: error: ISO C++ says that these are ambiguous, even + though the worst conversion for the first is better than the worst + conversion for the second: + hb-vector.hh:81: note: candidate 1: Type& hb_vector_t::operator[](unsigned int) [with Type = + hb_face_builder_data_t::table_entry_t, unsigned int PreallocedCount + = 32u] + hb-face.cc:650: note: candidate 2: operator[](T*, int) + + src/hb-face.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 0f32c95e1487ffcc37439635c3294f941eae857a +Author: Behdad Esfahbod +Date: Fri Nov 30 11:31:39 2018 -0500 + + Fix a few more sizeof(vector[0]) errors with weird compilers + + src/hb-face.cc | 4 ++-- + src/hb-set.hh | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit 88630a458b21b811075bed9e761a94c50736dc11 +Author: Behdad Esfahbod +Date: Fri Nov 30 01:11:04 2018 -0500 + + Fix build for realz + + src/hb-ot-deprecated.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 346286d04eb616c43ba8c796211fa2e5e7bf1983 +Author: Behdad Esfahbod +Date: Fri Nov 30 00:44:40 2018 -0500 + + Fix build + + src/hb-ot-deprecated.h | 1 + + 1 file changed, 1 insertion(+) + +commit 31f39cb41e1497a76c5838c93f9b4034089049f2 +Author: Behdad Esfahbod +Date: Fri Nov 30 00:38:08 2018 -0500 + + [post] Rename v2 to v2X + + src/hb-ot-post-table.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit e3dd47e6025a7f082af4830ba483d90d9b44381f +Author: Behdad Esfahbod +Date: Fri Nov 30 00:32:12 2018 -0500 + + Move things + + src/Makefile.sources | 1 + + src/hb-deprecated.h | 61 +--------------------------- + src/hb-ot-deprecated.h | 106 + +++++++++++++++++++++++++++++++++++++++++++++++++ + src/hb-ot.h | 1 + + 4 files changed, 109 insertions(+), 60 deletions(-) + +commit 27a6b0a2f7255ed6fc7bfe1f10052c2e344e319b +Author: Behdad Esfahbod +Date: Thu Nov 29 16:29:30 2018 -0500 + + Fix build for realz + + src/hb-coretext.cc | 2 +- + src/hb-uniscribe.cc | 10 +++++----- + 2 files changed, 6 insertions(+), 6 deletions(-) + +commit e2af4dd1ecbe398c60fe5f3f370dd35400d7e1eb +Author: Behdad Esfahbod +Date: Thu Nov 29 16:03:15 2018 -0500 + + [uniscribe] Fix build + + src/hb-uniscribe.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit bf738ba3ba80778c7feb95ece446607a250d9382 +Author: Ebrahim Byagowi +Date: Fri Nov 30 00:06:40 2018 +0330 + + [test][aat] Remove extra --shaper ot + + As run-tests.py already adds it + + test/shaping/data/in-house/tests/macos.tests | 64 + ++++++++++++++-------------- + 1 file changed, 32 insertions(+), 32 deletions(-) + +commit b65645bbafb3f1f9f956df3028cf4479a4bdc265 +Author: Ebrahim Byagowi +Date: Thu Nov 29 23:57:50 2018 +0330 + + [ci] Re-enable llvm-gcc-4.2 bots (#1429) + + .circleci/config.yml | 48 + ++++++++++++++++++++++++------------------------ + 1 file changed, 24 insertions(+), 24 deletions(-) + +commit e7bd29ea11bd6301a332b471120a4a2cd8575d09 +Author: Ebrahim Byagowi +Date: Thu Nov 29 23:47:20 2018 +0330 + + Limit __builtin_bswap16 to GCC >= 5 as it was implemented on 4.8 + + src/hb-machinery.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ac0264717b949df8840b179d882a9bed2993fb74 +Author: Behdad Esfahbod +Date: Thu Nov 29 15:07:44 2018 -0500 + + [coretext] Fix compile + + Fingers crossed. + + src/hb-coretext.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5c4fead734b082e0168e6811bec4bcaa19acc36a +Author: Behdad Esfahbod +Date: Thu Nov 29 15:04:34 2018 -0500 + + Convert "static const hb_tag_t" constants to enum + + src/hb-aat-layout-ankr-table.hh | 2 +- + src/hb-aat-layout-bsln-table.hh | 2 +- + src/hb-aat-layout-feat-table.hh | 2 +- + src/hb-aat-layout-just-table.hh | 2 +- + src/hb-aat-layout-kerx-table.hh | 2 +- + src/hb-aat-layout-lcar-table.hh | 2 +- + src/hb-aat-layout-morx-table.hh | 6 +++--- + src/hb-aat-layout-trak-table.hh | 2 +- + src/hb-aat-ltag-table.hh | 2 +- + src/hb-ot-cmap-table.hh | 2 +- + src/hb-ot-color-cbdt-table.hh | 4 ++-- + src/hb-ot-color-colr-table.hh | 2 +- + src/hb-ot-color-cpal-table.hh | 2 +- + src/hb-ot-color-sbix-table.hh | 2 +- + src/hb-ot-color-svg-table.hh | 2 +- + src/hb-ot-glyf-table.hh | 4 ++-- + src/hb-ot-hdmx-table.hh | 2 +- + src/hb-ot-head-table.hh | 2 +- + src/hb-ot-hhea-table.hh | 4 ++-- + src/hb-ot-hmtx-table.hh | 14 +++++++------- + src/hb-ot-kern-table.hh | 6 +++--- + src/hb-ot-layout-base-table.hh | 2 +- + src/hb-ot-layout-gdef-table.hh | 2 +- + src/hb-ot-layout-gpos-table.hh | 2 +- + src/hb-ot-layout-gsub-table.hh | 2 +- + src/hb-ot-layout-jstf-table.hh | 2 +- + src/hb-ot-math-table.hh | 2 +- + src/hb-ot-maxp-table.hh | 2 +- + src/hb-ot-name-table.hh | 2 +- + src/hb-ot-os2-table.hh | 2 +- + src/hb-ot-post-table.hh | 2 +- + src/hb-ot-stat-table.hh | 2 +- + src/hb-ot-var-avar-table.hh | 2 +- + src/hb-ot-var-fvar-table.hh | 2 +- + src/hb-ot-var-hvar-table.hh | 8 ++++---- + src/hb-ot-var-mvar-table.hh | 2 +- + src/hb-ot-vorg-table.hh | 2 +- + 37 files changed, 53 insertions(+), 53 deletions(-) + +commit 9e4138c82548c2b29a1ae8801d2c6c7c1f1a9c7a +Author: Behdad Esfahbod +Date: Thu Nov 29 15:01:10 2018 -0500 + + Convert misc "static const" constants to enum + + src/hb-aat-layout-kerx-table.hh | 4 ++-- + src/hb-map.hh | 2 +- + src/hb-ot-kern-table.hh | 4 ++-- + src/hb-set-digest.hh | 14 +++++++------- + 4 files changed, 12 insertions(+), 12 deletions(-) + +commit 44cbd2ea3dc36312bd80860983b6616586e78c6c +Author: Behdad Esfahbod +Date: Thu Nov 29 14:53:43 2018 -0500 + + Convert "static const bool" constants to anonymous enum + + src/hb-aat-layout-common.hh | 4 ++-- + src/hb-aat-layout-kerx-table.hh | 4 ++-- + src/hb-aat-layout-morx-table.hh | 8 ++++---- + src/hb-dsalgs.hh | 16 ++++++++-------- + src/hb-ot-kern-table.hh | 4 ++-- + src/hb-ot-layout.cc | 4 ++-- + 6 files changed, 20 insertions(+), 20 deletions(-) + +commit 861bc75349257f74c12b261abfcd5ab9e2f04863 +Author: Behdad Esfahbod +Date: Thu Nov 29 14:34:44 2018 -0500 + + [vector] Make pointer cast explicit + + Too bad this doesn't help MSVC 2008 build, as explicit operators are + C++11. + + src/hb-machinery.hh | 2 +- + src/hb-ot-cmap-table.hh | 3 ++- + src/hb-set.hh | 4 ++-- + src/hb-subset.cc | 2 +- + src/hb-vector.hh | 4 ++-- + 5 files changed, 8 insertions(+), 7 deletions(-) + +commit 72955e68256806f082439d65e6f9b5cf2e35fa8a +Author: Behdad Esfahbod +Date: Thu Nov 29 14:28:44 2018 -0500 + + Hand-hold older compilers + + src/hb-set.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 1a182e97ee71de0e78a70ff823ae17fa93a31830 +Author: Behdad Esfahbod +Date: Thu Nov 29 12:39:52 2018 -0500 + + [test/text-rendering-tests] Update from upstream + + .../text-rendering-tests/fonts/TestGVAR-Composite-0.ttf | Bin 0 -> + 3136 bytes + .../fonts/TestGVAR-Composite-Missing.ttf | Bin 0 -> + 2984 bytes + 2 files changed, 0 insertions(+), 0 deletions(-) + +commit 000d4b128eba58677acdc3b361829ff2f9a257b1 +Author: Behdad Esfahbod +Date: Thu Nov 29 12:32:47 2018 -0500 + + Make shaper's override_features() override user features as well + + The override_features is used to override features that are normally + discretionary features, but in a specific shaper are for various + reasons desired to be bolted on or off, because they've been used + for inherent shaping. As such, it makes sense that they also + override user features. Ie. if user turned 'liga' on, we don't + want Khmer shaping to become broken... Or turn 'clig' off... + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1310 + + src/hb-ot-shape.cc | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit a95d9d8c8465ebc927bc2194dffe4ea95542e54c +Author: Behdad Esfahbod +Date: Thu Nov 29 12:30:14 2018 -0500 + + [khmer] Move 'clig' to overrides + + Prerequisite for https://github.com/harfbuzz/harfbuzz/issues/1310 + + src/hb-ot-shape-complex-khmer.cc | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +commit 282ce7230b8bd8ad65c408cdaf1499504038247d +Author: Behdad Esfahbod +Date: Thu Nov 29 12:18:14 2018 -0500 + + Fix "typename outside template" issues + + Nothing an extra template class wouldn't fix... + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1419 + + src/hb-null.hh | 25 +++++++++++++++++++------ + 1 file changed, 19 insertions(+), 6 deletions(-) + +commit dc41ecef85b094b30c612113606597b91c55351c +Author: Behdad Esfahbod +Date: Thu Nov 29 11:53:53 2018 -0500 + + 2.2.0 + + NEWS | 35 +++++++++++++++++++++++++++++++++++ + configure.ac | 2 +- + src/hb-aat-layout.cc | 6 +++--- + src/hb-aat-layout.h | 4 ++-- + src/hb-deprecated.h | 4 ++-- + src/hb-ot-var.cc | 8 ++++---- + src/hb-ot-var.h | 4 ++-- + src/hb-version.h | 6 +++--- + 8 files changed, 52 insertions(+), 17 deletions(-) + commit 7b85081be4fbd6cad75dc28ae933ce920f71b22d Author: Behdad Esfahbod Date: Thu Nov 29 11:34:22 2018 -0500 @@ -25,6 +2668,22 @@ Date: Thu Nov 29 11:36:05 2018 +0330 test/shaping/data/in-house/tests/macos.tests | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) +commit 471db3aa6f963ecd4ebaf66daa81ef245d30d3b8 +Author: Michiharu Ariza +Date: Wed Nov 28 17:06:11 2018 -0800 + + workaround for issue #1417 + + src/hb-cff-interp-common.hh | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit 32d291ae899eb095500052bed2a22e5255a34838 +Merge: 1ecbf4d3 949655aa +Author: Michiharu Ariza +Date: Wed Nov 28 16:27:45 2018 -0800 + + Merge branch 'master' into cff-subset + commit 949655aa7853a4513af6b5247b9822be38f5d322 Merge: 7b78d223 d3d0f15f Author: Behdad Esfahbod @@ -2248,6 +4907,13 @@ Date: Tue Nov 20 11:33:33 2018 -0500 src/hb-ot-var.h | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) +commit 1ecbf4d3e3de7edc86651c6f805788747d6d89af +Merge: 515f1a16 064f703c +Author: Michiharu Ariza +Date: Tue Nov 20 17:19:05 2018 -0800 + + Merge branch 'master' into cff-subset + commit 064f703c7ac5a28803a8221720e922ea6dbd2505 Merge: be1828da 82951182 Author: Behdad Esfahbod @@ -2437,6 +5103,22 @@ Date: Mon Nov 19 11:30:40 2018 -0500 src/hb-ot-var.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +commit 515f1a16140f78c9ec379854851f77a1b44af145 +Merge: a6da9b94 e3a1a835 +Author: Michiharu Ariza +Date: Fri Nov 16 17:38:47 2018 -0800 + + Merge branch 'master' into cff-subset + +commit a6da9b9415bae43c58f12a8e43b77ba31dd432a6 +Author: Michiharu Ariza +Date: Fri Nov 16 17:29:03 2018 -0800 + + fixed Charset format selection + + src/hb-subset-cff1.cc | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + commit e3a1a8350a6a7933b0a100194985f4425ab9de19 Author: Behdad Esfahbod Date: Fri Nov 16 16:53:25 2018 -0800 @@ -2571,6 +5253,36 @@ Date: Fri Nov 16 14:31:05 2018 -0800 src/hb-ot-var-fvar-table.hh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) +commit b6903bd6c4b0c792c821e37a8e223088ae40e5fa +Author: Michiharu Ariza +Date: Fri Nov 16 13:46:58 2018 -0800 + + ensure fdmap initialized as identity for single-FD (non-CID) fonts + + src/hb-subset-cff1.cc | 13 ++++++++++--- + src/hb-subset-cff2.cc | 2 ++ + 2 files changed, 12 insertions(+), 3 deletions(-) + +commit b403be8ad98ffd2dbe95dad73e96c7ed1295d9fc +Merge: b67a7c73 50d1a41c +Author: Michiharu Ariza +Date: Fri Nov 16 12:29:18 2018 -0800 + + Merge branch 'master' into cff-subset + +commit b67a7c731f041323c19ab245f0285c304d9ae3d2 +Author: Michiharu Ariza +Date: Fri Nov 16 12:28:24 2018 -0800 + + drop dotsection as hint along with test case + + src/hb-subset-cff-common.hh | 4 ++++ + src/hb-subset-cff1.cc | 1 + + test/api/fonts/cff1_dotsect.nohints.otf | Bin 0 -> 3132 bytes + test/api/fonts/cff1_dotsect.otf | Bin 0 -> 3220 bytes + test/api/test-subset-cff1.c | 21 +++++++++++++++++++++ + 5 files changed, 26 insertions(+) + commit 50d1a41c08ad3508a94240b52df03c383ae8f1f8 Author: Behdad Esfahbod Date: Fri Nov 16 08:52:57 2018 -0500 @@ -2700,6 +5412,50 @@ Date: Fri Nov 16 01:48:26 2018 -0500 src/hb-subset-plan.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) +commit 072c7aba92d3c92c84454a12578264f12439bb0d +Author: Michiharu Ariza +Date: Thu Nov 15 15:41:46 2018 -0800 + + use 2-byte offset instead of 4-byte for local subrs + + more than enough since local subrs immediately follow its + corresponding private dict, as the result 2-byte redunction for each + font dict with local subrs + updated api test expected subset fonts accordingly + + src/hb-subset-cff-common.hh | 4 ++-- + test/api/fonts/AdobeVFPrototype.abc.otf | Bin 7460 -> + 7456 bytes + test/api/fonts/AdobeVFPrototype.ac.nohints.otf | Bin 6780 -> + 6780 bytes + test/api/fonts/AdobeVFPrototype.ac.otf | Bin 6996 -> + 6996 bytes + .../fonts/SourceHanSans-Regular.41,4C2E.nohints.otf | Bin 2380 -> + 2376 bytes + test/api/fonts/SourceHanSans-Regular.41,4C2E.otf | Bin 2576 -> + 2572 bytes + test/api/fonts/SourceSansPro-Regular.abc.otf | Bin 1812 -> + 1808 bytes + test/api/fonts/SourceSansPro-Regular.ac.nohints.otf | Bin 1592 -> + 1592 bytes + test/api/fonts/SourceSansPro-Regular.ac.otf | Bin 1708 -> + 1704 bytes + test/api/fonts/cff1_seac.C0.otf | Bin 1604 -> + 1600 bytes + 10 files changed, 2 insertions(+), 2 deletions(-) + +commit 9d0231cfe7c404da3b5bc360ad76180a7aded62c +Author: Michiharu Ariza +Date: Thu Nov 15 15:39:43 2018 -0800 + + fixed a subset bug when no font dicts reduce + + src/hb-ot-cff-common.hh | 11 +++++++++++ + src/hb-subset-cff-common.cc | 24 +++++++++++++----------- + src/hb-subset-cff1.cc | 27 ++++++--------------------- + src/hb-subset-cff2.cc | 25 +++++-------------------- + 4 files changed, 35 insertions(+), 52 deletions(-) + commit 11aa0468ac2c62ff734ba6b0f6eb43d1bd6f602b Author: Ebrahim Byagowi Date: Thu Nov 15 23:10:56 2018 +0330 @@ -2737,6 +5493,34 @@ Date: Thu Nov 15 23:10:49 2018 +0330 src/hb-ot-math-table.hh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) +commit 13735570f051c4131cdc481939799d76c38c758b +Author: Michiharu Ariza +Date: Thu Nov 15 12:10:23 2018 -0800 + + reject nested seac + + src/hb-cff1-interp-cs.hh | 4 ++++ + src/hb-ot-cff1-table.cc | 11 ++++++----- + 2 files changed, 10 insertions(+), 5 deletions(-) + +commit c37aecd41c5b55e5ef496f3c4cc255a1e2ce7f9f +Merge: ecdb77f0 cabe433f +Author: Michiharu Ariza +Date: Thu Nov 15 11:03:46 2018 -0800 + + Merge branch 'master' into cff-subset + +commit ecdb77f0ae1ef9b129cf9195dbdaa9f6c4425ed5 +Author: Michiharu Ariza +Date: Thu Nov 15 10:54:15 2018 -0800 + + fixed CFF1 subset of std encoding & non-std charset combo + + src/hb-ot-cff-common.hh | 2 -- + src/hb-ot-cff1-table.hh | 2 ++ + src/hb-subset-cff1.cc | 5 +++-- + 3 files changed, 5 insertions(+), 4 deletions(-) + commit cabe433fbb81d314ad9e3cbed768dd13983a4477 Author: Behdad Esfahbod Date: Thu Nov 15 02:48:50 2018 -0500 @@ -2774,6 +5558,33 @@ Date: Wed Nov 14 14:49:34 2018 -0500 src/hb-ot-shape.hh | 6 +++--- 7 files changed, 43 insertions(+), 29 deletions(-) +commit 892ab37e7c9580e35b35a4d82a99e2ea73ac7b0b +Merge: 3787c078 7867c2ba +Author: Michiharu Ariza +Date: Wed Nov 14 13:54:07 2018 -0800 + + Merge branch 'master' into cff-subset + +commit 3787c078561f1157bd04644f092c4467f63c717c +Author: Michiharu Ariza +Date: Wed Nov 14 13:38:03 2018 -0800 + + Implemented seac for extents & subset along with API tests + + gtk-doc.make | 321 + +++++++++++++++++++++++++++++++++++++++- + src/hb-cff-interp-common.hh | 2 +- + src/hb-cff-interp-cs-common.hh | 7 + + src/hb-cff1-interp-cs.hh | 29 +++- + src/hb-ot-cff1-table.cc | 256 +++++++++++++++++++++++++------- + src/hb-ot-cff1-table.hh | 88 ++++++++--- + src/hb-subset-plan.cc | 19 +++ + test/api/fonts/cff1_seac.C0.otf | Bin 0 -> 1604 bytes + test/api/fonts/cff1_seac.otf | Bin 0 -> 2260 bytes + test/api/test-ot-extents-cff.c | 31 ++++ + test/api/test-subset-cff1.c | 19 +++ + 11 files changed, 699 insertions(+), 73 deletions(-) + commit 7867c2bad05fe48f9e4a1b776fb7da67b747fb4e Author: Ebrahim Byagowi Date: Wed Nov 14 22:13:50 2018 +0330 @@ -3164,6 +5975,41 @@ Date: Mon Nov 12 13:01:22 2018 -0500 69 bytes 2 files changed, 1 insertion(+), 1 deletion(-) +commit 41a8bc7fd9399def8f580b02627a77f3972cc0e9 +Merge: 0dfa584c 77bd0a64 +Author: Michiharu Ariza +Date: Mon Nov 12 08:49:00 2018 -0800 + + Merge branch 'master' into cff-subset + +commit 0dfa584cb4af6be2852d038e9bd591f67ea9fc6e +Author: Michiharu Ariza +Date: Mon Nov 12 08:47:07 2018 -0800 + + changed Adobe company name + + src/hb-cff-interp-common.hh | 2 +- + src/hb-cff-interp-cs-common.hh | 2 +- + src/hb-cff-interp-dict-common.hh | 2 +- + src/hb-cff1-interp-cs.hh | 2 +- + src/hb-cff2-interp-cs.hh | 2 +- + src/hb-ot-cff-common.hh | 2 +- + src/hb-ot-cff1-table.cc | 2 +- + src/hb-ot-cff1-table.hh | 2 +- + src/hb-ot-cff2-table.cc | 2 +- + src/hb-ot-cff2-table.hh | 2 +- + src/hb-ot-vorg-table.hh | 2 +- + src/hb-subset-cff-common.cc | 2 +- + src/hb-subset-cff-common.hh | 2 +- + src/hb-subset-cff1.cc | 2 +- + src/hb-subset-cff1.hh | 2 +- + src/hb-subset-cff2.cc | 2 +- + src/hb-subset-cff2.hh | 2 +- + test/api/test-ot-extents-cff.c | 2 +- + test/api/test-subset-cff1.c | 2 +- + test/api/test-subset-cff2.c | 2 +- + 20 files changed, 20 insertions(+), 20 deletions(-) + commit 3e284e02c2a5da758526360a45364a330b8ab8e9 Author: Behdad Esfahbod Date: Sun Nov 11 22:51:34 2018 -0500 @@ -3529,6 +6375,13 @@ Date: Sat Nov 10 19:54:08 2018 -0500 src/hb-ot-var-avar-table.hh | 9 ++++----- 5 files changed, 20 insertions(+), 13 deletions(-) +commit fb2a037f54f3cd323a447925f6534eccd1c709c1 +Merge: 87984165 b4c61130 +Author: Michiharu Ariza +Date: Sat Nov 10 16:23:11 2018 -0800 + + Merge branch 'master' into cff-subset + commit b4c61130324455bfd42095b01fa14ac901e441f1 Author: Behdad Esfahbod Date: Sat Nov 10 16:35:39 2018 -0500 @@ -3664,6 +6517,17 @@ Date: Sat Nov 10 02:42:08 2018 +0330 src/hb-ot-glyf-table.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +commit 87984165877c90bf4e0a0418a6407e44c048335d +Author: Michiharu Ariza +Date: Fri Nov 9 08:59:18 2018 -0800 + + fixed vstem handling (lack thereof) in check_width + + bug exposed by U+2261 equivalence in SourceCodePro-Regular.otf + + src/hb-cff1-interp-cs.hh | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + commit 5f97fe9956274d9de4e7813d7f2e850d9ffd8224 Author: Behdad Esfahbod Date: Fri Nov 9 10:01:50 2018 -0500 @@ -3733,6 +6597,22 @@ Date: Thu Nov 8 20:48:54 2018 +0330 src/hb-aat-layout-trak-table.hh | 12 ++++++------ 2 files changed, 12 insertions(+), 11 deletions(-) +commit 26c291aaa023d31c793b6f505c76e0dd7acbff9b +Merge: 417963dd f9042384 +Author: Michiharu Ariza +Date: Thu Nov 8 09:06:49 2018 -0800 + + Merge branch 'master' into cff-subset + +commit 417963dd9f93a316e672c77493e763978bfdbc28 +Author: Michiharu Ariza +Date: Thu Nov 8 09:01:20 2018 -0800 + + got rid of Remap::fullset() as incorrect, redundant, inefficient + + src/hb-ot-cff-common.hh | 22 ---------------------- + 1 file changed, 22 deletions(-) + commit f90423847b07ff9c9f66be6dfa3b6071f9c7d9d3 Author: Ebrahim Byagowi Date: Thu Nov 8 19:17:02 2018 +0330 @@ -3779,6 +6659,19 @@ Date: Wed Nov 7 21:58:04 2018 -0500 src/hb-aat-layout.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +commit 636a6833c57eb88ebaa92034c1f4722471f70781 +Author: Michiharu Ariza +Date: Wed Nov 7 17:58:45 2018 -0800 + + fixed ends_in_hint bug + + subr ends in hint itself should be regarded as hint + this flag should propagate to its caller if the call itself is at + the end of the caller + + src/hb-subset-cff-common.hh | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + commit 0bf76154f1bb15aa2fc361eb725977313f103a58 Author: Behdad Esfahbod Date: Wed Nov 7 19:11:43 2018 -0500 @@ -3806,6 +6699,20 @@ Date: Wed Nov 7 18:13:22 2018 -0500 src/hb-aat-layout-kerx-table.hh | 4 ++++ 1 file changed, 4 insertions(+) +commit 4d740206943ecb72e4be7cc4815e0a3aa3edaa9d +Merge: e0c30b96 9d502769 +Author: Michiharu Ariza +Date: Wed Nov 7 15:09:30 2018 -0800 + + Merge branch 'master' into cff-subset + +commit e0c30b961de87d38bff8dd49e86785a5b74fcad3 +Merge: 0996c0ff ae8fd0db +Author: Michiharu Ariza +Date: Wed Nov 7 15:08:55 2018 -0800 + + merge with cff-subset branch + commit 006386be3a069199ebaf22bcc55fa7233c62e0d5 Author: Behdad Esfahbod Date: Wed Nov 7 18:04:53 2018 -0500 @@ -3819,6 +6726,34 @@ Date: Wed Nov 7 18:04:53 2018 -0500 src/hb-aat-layout-kerx-table.hh | 10 ----- 2 files changed, 66 insertions(+), 34 deletions(-) +commit 0996c0ff6279f377e2b14f08663df2ce82de2b14 +Author: Michiharu Ariza +Date: Wed Nov 7 14:48:37 2018 -0800 + + implented no-desubroutinize with CFF2 along with API test + + replaced AdobeVFPrototype.abc.otf with a hinted (maually) & + subroutinized copy + replaced expected results as well + + src/hb-cff-interp-dict-common.hh | 4 +- + src/hb-cff2-interp-cs.hh | 16 +- + src/hb-ot-cff-common.hh | 22 +-- + src/hb-subset-cff-common.hh | 64 +++++--- + src/hb-subset-cff2.cc | 180 + ++++++++++++++++++--- + test/api/fonts/AdobeVFPrototype.abc.nohints.otf | Bin 7800 -> 0 bytes + test/api/fonts/AdobeVFPrototype.abc.otf | Bin 7800 -> + 7460 bytes + test/api/fonts/AdobeVFPrototype.ac.nohints.otf | Bin 7152 -> + 6780 bytes + .../fonts/AdobeVFPrototype.ac.nosubrs.nohints.otf | Bin 0 -> 6844 bytes + test/api/fonts/AdobeVFPrototype.ac.nosubrs.otf | Bin 0 -> 7060 bytes + test/api/fonts/AdobeVFPrototype.ac.otf | Bin 7336 -> + 6996 bytes + test/api/test-subset-cff2.c | 51 +++++- + 12 files changed, 271 insertions(+), 66 deletions(-) + commit 29c5302376ff2bc8f04b0fc0efba3ce40ef564a7 Author: Behdad Esfahbod Date: Wed Nov 7 17:29:37 2018 -0500 @@ -4171,6 +7106,25 @@ Date: Wed Nov 7 12:16:38 2018 -0500 src/hb-aat-layout-kerx-table.hh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) +commit ae8fd0dbfb57afadfe815c5bde4ad4a6485fd950 +Author: Michiharu Ariza +Date: Wed Nov 7 09:16:12 2018 -0800 + + clear stack after vsindex op + + src/hb-cff2-interp-cs.hh | 1 + + src/hb-ot-cff2-table.hh | 1 + + 2 files changed, 2 insertions(+) + +commit 7fed7d80f72b35900b41878ae59e38fd1cb49dc8 +Author: Michiharu Ariza +Date: Wed Nov 7 09:09:13 2018 -0800 + + fixed off-by-one error in CFF1 Encoding lookup + + src/hb-ot-cff1-table.hh | 4 ++++ + 1 file changed, 4 insertions(+) + commit d5c0ca210fef315fd039e5b1825a865f36606a3f Author: Behdad Esfahbod Date: Wed Nov 7 12:08:44 2018 -0500 @@ -4579,6 +7533,22 @@ Date: Tue Nov 6 13:51:39 2018 -0500 src/hb-ot-kern-table.hh | 1 + 2 files changed, 2 insertions(+) +commit 7b21319edfd6531a444846f71e87303bc09f4621 +Author: Michiharu Ariza +Date: Tue Nov 6 13:59:07 2018 -0800 + + don't reject empty Dict + + src/hb-cff-interp-dict-common.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 43ee0e4d006ce7b4ade4483f2c8ec3d39723fc94 +Merge: ec6817c1 bfafe208 +Author: Michiharu Ariza +Date: Tue Nov 6 09:57:17 2018 -0800 + + Merge branch 'master' into cff-subset + commit bfafe208da11817b5ebf3751f02af2dcdf57bd19 Author: Behdad Esfahbod Date: Tue Nov 6 12:11:45 2018 -0500 @@ -4971,6 +7941,152 @@ Date: Mon Nov 5 12:59:32 2018 -0500 src/hb-ot-var.cc | 6 ++---- 7 files changed, 25 insertions(+), 27 deletions(-) +commit ec6817c1bd82a60b84cb868e4d7ff4c65cb80ccc +Author: Michiharu Ariza +Date: Mon Nov 5 07:59:08 2018 -0800 + + remove build files accidentally pushed + + INSTALL | 370 - + Makefile | 954 -- + Makefile.in | 954 -- + aclocal.m4 | 1496 --- + ar-lib | 270 - + autom4te.cache/output.0 | 23333 + ---------------------------------------------- + autom4te.cache/output.1 | 23333 + ---------------------------------------------- + autom4te.cache/output.2 | 23333 + ---------------------------------------------- + autom4te.cache/requests | 555 -- + autom4te.cache/traces.0 | 3823 -------- + autom4te.cache/traces.1 | 1229 --- + autom4te.cache/traces.2 | 3823 -------- + compile | 347 - + config.guess | 1421 --- + config.h | 227 - + config.h.in | 226 - + config.log | 1560 ---- + config.status | 2420 ----- + config.sub | 1807 ---- + configure | 23333 + ---------------------------------------------- + depcomp | 791 -- + install-sh | 501 - + libtool | 11805 ----------------------- + ltmain.sh | 11147 ---------------------- + missing | 215 - + stamp-h1 | 1 - + test-driver | 148 - + 27 files changed, 139422 deletions(-) + +commit b721fdae662673ab706da897aaa1db126f8ca1a5 +Author: Michiharu Ariza +Date: Sun Nov 4 16:19:15 2018 -0800 + + fixed leaks in CFF subr subset + + src/hb-ot-cff-common.hh | 10 +++++++++- + src/hb-subset-cff-common.hh | 10 +++++++++- + 2 files changed, 18 insertions(+), 2 deletions(-) + +commit 85f5644e8e9fe18032e37d4153c3c928d087ac6a +Author: Michiharu Ariza +Date: Sun Nov 4 14:17:30 2018 -0800 + + added missing switch breaks + + src/hb-subset-cff-common.hh | 2 ++ + 1 file changed, 2 insertions(+) + +commit 1682d1bbecaeeddc8a1678a01c57c0e0023bf7c4 +Merge: d8fadec0 b605db2f +Author: Michiharu Ariza +Date: Sun Nov 4 13:25:41 2018 -0800 + + Merge branch 'master' into cff-subset + +commit d8fadec098935335e69e46c1101da3f142824638 +Author: Michiharu Ariza +Date: Sun Nov 4 13:12:20 2018 -0800 + + added desubroutinize full font test profiles & expected fonts + + modified subset_test_suite.py to apply desubroutinize profiles to + CFF only (not to TT) + + ...urceSansPro-Regular.default.1FC,21,41,20,62,63.otf | Bin 3640 -> + 3784 bytes + .../SourceSansPro-Regular.default.61,62,63.otf | Bin 3400 -> + 3496 bytes + .../SourceSansPro-Regular.default.D7,D8,D9,DA,DE.otf | Bin 3596 -> + 3612 bytes + ...sPro-Regular.desubroutinize.1FC,21,41,20,62,63.otf | Bin 0 -> + 3640 bytes + .../SourceSansPro-Regular.desubroutinize.61,62,63.otf | Bin 0 -> + 3400 bytes + ...eSansPro-Regular.desubroutinize.D7,D8,D9,DA,DE.otf | Bin 0 -> + 3596 bytes + ...eSansPro-Regular.drop-hints.1FC,21,41,20,62,63.otf | Bin 3480 -> + 3564 bytes + .../SourceSansPro-Regular.drop-hints.61,62,63.otf | Bin 3276 -> + 3340 bytes + ...ourceSansPro-Regular.drop-hints.D7,D8,D9,DA,DE.otf | Bin 3448 -> + 3464 bytes + ...r.drop-hints.desubroutinize.1FC,21,41,20,62,63.otf | Bin 0 -> + 3480 bytes + ...Pro-Regular.drop-hints.desubroutinize.61,62,63.otf | Bin 0 -> + 3276 bytes + ...gular.drop-hints.desubroutinize.D7,D8,D9,DA,DE.otf | Bin 0 -> + 3448 bytes + ...-Regular.default.3042,3044,3046,3048,304A,304B.otf | Bin 6248 -> + 6324 bytes + ...-Regular.default.3042,3044,3046,73E0,5EA6,8F38.otf | Bin 6432 -> + 6568 bytes + .../SourceHanSans-Regular.default.61,63,65,6B.otf | Bin 5428 -> + 5500 bytes + ...-Regular.default.660E,6975,73E0,5EA6,8F38,6E05.otf | Bin 6552 -> + 6780 bytes + .../japanese/SourceHanSans-Regular.default.660E.otf | Bin 5196 -> + 5248 bytes + ....otf => SourceHanSans-Regular.desubroutinize..otf} | Bin + ...r.desubroutinize.3042,3044,3046,3048,304A,304B.otf | Bin 0 -> + 6248 bytes + ...r.desubroutinize.3042,3044,3046,73E0,5EA6,8F38.otf | Bin 0 -> + 6432 bytes + ...urceHanSans-Regular.desubroutinize.61,63,65,6B.otf | Bin 0 -> + 5428 bytes + ...r.desubroutinize.660E,6975,73E0,5EA6,8F38,6E05.otf | Bin 0 -> + 6552 bytes + .../SourceHanSans-Regular.desubroutinize.660E.otf | Bin 0 -> + 5196 bytes + ...gular.drop-hints.3042,3044,3046,3048,304A,304B.otf | Bin 6076 -> + 6132 bytes + ...gular.drop-hints.3042,3044,3046,73E0,5EA6,8F38.otf | Bin 6180 -> + 6304 bytes + .../SourceHanSans-Regular.drop-hints.61,63,65,6B.otf | Bin 5312 -> + 5344 bytes + ...gular.drop-hints.660E,6975,73E0,5EA6,8F38,6E05.otf | Bin 6248 -> + 6472 bytes + .../SourceHanSans-Regular.drop-hints.660E.otf | Bin 5088 -> + 5140 bytes + ...rceHanSans-Regular.drop-hints.desubroutinize..otf} | Bin + ...s.desubroutinize.3042,3044,3046,3048,304A,304B.otf | Bin 0 -> + 6076 bytes + ...s.desubroutinize.3042,3044,3046,73E0,5EA6,8F38.otf | Bin 0 -> + 6180 bytes + ...-Regular.drop-hints.desubroutinize.61,63,65,6B.otf | Bin 0 -> + 5312 bytes + ...s.desubroutinize.660E,6975,73E0,5EA6,8F38,6E05.otf | Bin 0 -> + 6248 bytes + ...HanSans-Regular.drop-hints.desubroutinize.660E.otf | Bin 0 -> + 5140 bytes + test/subset/data/profiles/desubroutinize.txt | 1 + + .../data/profiles/drop-hints-desubroutinize.txt | 2 ++ + test/subset/generate-expected-outputs.py | 1 - + test/subset/subset_test_suite.py | 7 ++++++- + 38 files changed, 9 insertions(+), 2 deletions(-) + commit b605db2f65e62ad6727a61481f78015933dbf207 Author: Behdad Esfahbod Date: Sun Nov 4 12:58:02 2018 -0500 @@ -5029,6 +8145,23 @@ Date: Sun Nov 4 02:25:07 2018 -0500 src/hb-ot-shape.cc | 1 - 10 files changed, 6 insertions(+), 17 deletions(-) +commit 191ca0f15b7fc9ab959e1f6472c48839687402ec +Author: Michiharu Ariza +Date: Sat Nov 3 22:42:22 2018 -0700 + + CFF1 no-desubr fixes + + make sure charstring/subrs not ending with endchar/return handled + correctly + if no local subrs, skip serializing Subrs op in Private + misc fixes + + src/hb-ot-cff-common.hh | 13 +++++++++- + src/hb-subset-cff-common.hh | 59 + +++++++++++++++++++++++---------------------- + src/hb-subset-cff1.cc | 27 +++++++++++++++------ + 3 files changed, 62 insertions(+), 37 deletions(-) + commit 4eb52460c8c6dc48af240f2254f76fae065bfa97 Author: Behdad Esfahbod Date: Sat Nov 3 21:45:39 2018 -0400 @@ -5081,6 +8214,18 @@ Date: Sat Nov 3 20:50:56 2018 -0400 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) +commit 1da4de7e7b71dfde734cb77ec6acb31f574585f2 +Author: Michiharu Ariza +Date: Sat Nov 3 15:41:29 2018 -0700 + + fix for subset fuzzer failure + + A called subr must be freshly parsed or completely parsed. otherwise + the prevoius parse must have terminated prematurely + + src/hb-subset-cff1.cc | 3 +++ + 1 file changed, 3 insertions(+) + commit 0b0b38ec1e6a815a30bef98193043d255b52c4a1 Author: Behdad Esfahbod Date: Sat Nov 3 16:15:30 2018 -0400 @@ -5251,6 +8396,56 @@ Date: Sat Nov 3 13:03:36 2018 +0330 36 bytes 1 file changed, 0 insertions(+), 0 deletions(-) +commit 34b06d994a79124963d2a7432d0ec945e72bfdbd +Author: Michiharu Ariza +Date: Fri Nov 2 16:40:20 2018 -0700 + + fixed FDSelect size calcluation + + src/hb-ot-cff-common.hh | 2 +- + src/hb-subset-cff-common.cc | 6 +++--- + test/api/fonts/SourceHanSans-Regular.41,3041,4C2E.otf | Bin 2576 -> + 3892 bytes + 3 files changed, 4 insertions(+), 4 deletions(-) + +commit 481fdfdc23f557400ad3aceeceeab07add78f005 +Merge: 1bc710a8 2840a104 +Author: Michiharu Ariza +Date: Fri Nov 2 15:28:09 2018 -0700 + + Merge branch 'cff-subset' of https://github.com/harfbuzz/harfbuzz + into cff-subset + +commit 1bc710a8c94fbe08ca3a3e535c7b6597a57883df +Author: Michiharu Ariza +Date: Fri Nov 2 15:28:01 2018 -0700 + + added CFF1 desubr api test cases & bug fixes + + src/hb-cff1-interp-cs.hh | 7 -- + src/hb-ot-cff-common.hh | 56 ++++++---- + src/hb-subset-cff-common.hh | 100 + +++++++++-------- + src/hb-subset-cff1.cc | 53 ++++----- + .../fonts/SourceHanSans-Regular.41,3041,4C2E.otf | Bin 3892 -> + 2576 bytes + .../SourceHanSans-Regular.41,4C2E.nohints.otf | Bin 0 -> 2380 bytes + ...urceHanSans-Regular.41,4C2E.nosubrs.nohints.otf | Bin 0 -> 2360 bytes + .../SourceHanSans-Regular.41,4C2E.nosubrs.otf | Bin 0 -> 2548 bytes + test/api/fonts/SourceHanSans-Regular.41,4C2E.otf | Bin 2548 -> + 2576 bytes + test/api/fonts/SourceSansPro-Regular.abc.otf | Bin 3412 -> + 1812 bytes + .../api/fonts/SourceSansPro-Regular.ac.nohints.otf | Bin 3228 -> + 1592 bytes + .../SourceSansPro-Regular.ac.nosubrs.nohints.otf | Bin 0 -> 1540 bytes + .../api/fonts/SourceSansPro-Regular.ac.nosubrs.otf | Bin 0 -> 1632 bytes + test/api/fonts/SourceSansPro-Regular.ac.otf | Bin 3332 -> + 1708 bytes + test/api/test-subset-cff1.c | 122 + +++++++++++++++++++++ + 15 files changed, 232 insertions(+), 106 deletions(-) + commit 2c68f34bddbe506d0b22948562f2f59b9a5b6050 Author: Khaled Hosny Date: Fri Nov 2 23:06:00 2018 +0200 @@ -5437,6 +8632,63 @@ Date: Fri Nov 2 11:16:43 2018 -0400 src/hb-ot-kern-table.hh | 5 +++++ 1 file changed, 5 insertions(+) +commit 0b2870085ddecdde8370eebc7c2bb346b1992b93 +Author: Michiharu Ariza +Date: Thu Nov 1 22:43:17 2018 -0700 + + removed unused code + + src/hb-cff-interp-common.hh | 18 ------------------ + 1 file changed, 18 deletions(-) + +commit 6186dbf1be4da88d9c4f1ef5cea19fd7779f29ab +Author: Michiharu Ariza +Date: Thu Nov 1 17:25:23 2018 -0700 + + added hb_subset_input_set_desubroutinize API + + hooked up with CFF1 subroutinizer + a renaming + + src/hb-subset-cff-common.hh | 2 +- + src/hb-subset-cff1.cc | 4 ++-- + src/hb-subset-input.cc | 13 +++++++++++++ + src/hb-subset.h | 5 +++++ + util/hb-subset.cc | 1 + + util/options.cc | 2 +- + 6 files changed, 23 insertions(+), 4 deletions(-) + +commit b1d0c589154d080ff519c3e80aea923185787b13 +Author: Michiharu Ariza +Date: Thu Nov 1 16:33:46 2018 -0700 + + removed extraneous ;s + + src/hb-cff-interp-common.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 2840a104c1288af79cbda720afa9e37aec6fb29d +Author: Michiharu Ariza +Date: Thu Nov 1 16:18:13 2018 -0700 + + tweaks to build with new merge + + src/hb-cff2-interp-cs.hh | 11 +++++++---- + src/hb-ot-cff2-table.cc | 9 +++++---- + src/hb-ot-cff2-table.hh | 7 +++---- + src/hb-subset-cff-common.cc | 12 ++++-------- + src/hb-subset-cff-common.hh | 3 +-- + src/hb-subset-cff1.cc | 3 +-- + src/hb-subset-cff2.cc | 3 +-- + 7 files changed, 22 insertions(+), 26 deletions(-) + +commit e600e5440b3b77294df47fae947758137ea02501 +Merge: 82248b92 de96e5c8 +Author: Michiharu Ariza +Date: Thu Nov 1 16:13:56 2018 -0700 + + Merge branch 'master' into cff-subset + commit de96e5c81c7f473520df93052ecea162baa5a350 Author: Behdad Esfahbod Date: Thu Nov 1 18:13:58 2018 -0400 @@ -5464,6 +8716,34 @@ Date: Thu Nov 1 18:01:26 2018 -0400 src/hb-aat-map.hh | 2 -- 1 file changed, 2 deletions(-) +commit 82248b9287e7b208c304e761393b745604a51c6e +Author: Michiharu Ariza +Date: Thu Nov 1 10:36:50 2018 -0700 + + fix leak attempt ^2 + + src/hb-subset-cff2.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a9c305c2b00b7e793dc3d8333eee43d677aebd42 +Author: Michiharu Ariza +Date: Thu Nov 1 10:31:21 2018 -0700 + + fix leaks + + src/hb-subset-cff1.cc | 4 ++-- + src/hb-subset-cff2.cc | 3 +-- + 2 files changed, 3 insertions(+), 4 deletions(-) + +commit 049ce078e51bebce50b17889f3edae3db3ea39f5 +Author: Michiharu Ariza +Date: Thu Nov 1 08:46:21 2018 -0700 + + fix bogus width with --no-hinting + + src/hb-cff1-interp-cs.hh | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + commit 07ec792212063851ee41eae33792d3d90d31e6a1 Author: Behdad Esfahbod Date: Thu Nov 1 10:31:12 2018 -0400 @@ -5491,6 +8771,35 @@ Date: Thu Nov 1 13:39:06 2018 +0330 test/api/test-ot-color.c | 2 -- 1 file changed, 2 deletions(-) +commit d56e338a903a5a7c4f8ccd0f4d983cd492243ed6 +Author: Michiharu Ariza +Date: Wed Oct 31 22:30:34 2018 -0700 + + CFF1 no-desubroutinize + no-hinting + + no-desubroutinize option is disabled for now + code cleanup (esp. CFF1 width handling) + bug fixes & renaming + + src/hb-cff-interp-common.hh | 49 +++ + src/hb-cff-interp-cs-common.hh | 93 +++++- + src/hb-cff-interp-dict-common.hh | 45 +-- + src/hb-cff1-interp-cs.hh | 66 +++- + src/hb-cff2-interp-cs.hh | 1 + + src/hb-ot-cff-common.hh | 85 ++--- + src/hb-ot-cff1-table.hh | 20 +- + src/hb-ot-cff2-table.hh | 25 +- + src/hb-subset-cff-common.hh | 702 + ++++++++++++++++++++++++++++++++++++--- + src/hb-subset-cff1.cc | 242 +++++++++++--- + src/hb-subset-cff2.cc | 45 +-- + src/hb-subset-input.hh | 1 + + src/hb-subset-plan.cc | 1 + + src/hb-subset-plan.hh | 1 + + util/options.cc | 2 + + util/options.hh | 2 + + 16 files changed, 1130 insertions(+), 250 deletions(-) + commit 52a00cd87f63c8ab32413a1a9ce792a3e2ec84e2 Author: Behdad Esfahbod Date: Wed Oct 31 19:05:53 2018 -0700 @@ -8266,6 +11575,20 @@ Date: Fri Oct 26 00:23:45 2018 +0330 docs/harfbuzz-sections.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) +commit be746009e9b7063dcb57e30e342f9410387ef8b6 +Author: Michiharu Ariza +Date: Thu Oct 25 13:40:40 2018 -0700 + + dropped support of legacy CFF CharString ops + + along with test & font + + src/hb-cff1-interp-cs.hh | 135 + +------------------------------------- + test/api/fonts/cff1_legacyops.otf | Bin 3104 -> 0 bytes + test/api/test-ot-extents-cff.c | 23 ------- + 3 files changed, 1 insertion(+), 157 deletions(-) + commit 1cfe702872058ebc50d6cb5543daa38fb3a7ebfb Author: Behdad Esfahbod Date: Thu Oct 25 13:37:08 2018 -0700 @@ -8313,6 +11636,13 @@ Date: Thu Oct 25 13:19:34 2018 -0700 src/hb-vector.hh | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) +commit 2ebf36010206cebdbe58bab6edf4e3bc011b6479 +Merge: 36c2c374 94e421ab +Author: Michiharu Ariza +Date: Thu Oct 25 13:05:06 2018 -0700 + + Merge branch 'master' into cff-subset + commit 94e421abbfc7ede9aaf3c8d86bb0ff9992ea3123 Author: Ben Wagner Date: Thu Oct 25 13:44:27 2018 -0400 @@ -8458,6 +11788,18 @@ Date: Tue Oct 23 15:45:35 2018 -0700 src/hb-machinery.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +commit 36c2c374bf9c2d0ca903e601760e69bfc3da5388 +Author: Michiharu Ariza +Date: Tue Oct 23 15:11:09 2018 -0700 + + removed unused multi_val from DictVal + + src/hb-cff-interp-common.hh | 16 ---------------- + src/hb-cff-interp-dict-common.hh | 3 --- + src/hb-ot-cff1-table.hh | 2 +- + src/hb-ot-cff2-table.hh | 1 - + 4 files changed, 1 insertion(+), 21 deletions(-) + commit f33ad6d69216a983624e832177895481549bdc07 Author: Behdad Esfahbod Date: Tue Oct 23 14:31:51 2018 -0700 @@ -8528,6 +11870,13 @@ Date: Tue Oct 23 13:09:30 2018 -0700 src/hb-ot-shape.hh | 9 +++------ 2 files changed, 13 insertions(+), 14 deletions(-) +commit e1241636d60a63cbfd741288716b55797a4dc8ee +Merge: 960267fc cf92d657 +Author: Michiharu Ariza +Date: Tue Oct 23 11:25:51 2018 -0700 + + Merge branch 'master' into cff-subset + commit cf92d6579e91d326598dcff93457fe85dfa962c2 Author: Behdad Esfahbod Date: Tue Oct 23 03:10:56 2018 -0700 @@ -8819,6 +12168,15 @@ Date: Mon Oct 22 16:55:12 2018 -0700 src/hb-ot-color.h | 10 ++++----- 3 files changed, 38 insertions(+), 57 deletions(-) +commit 960267fc4315a138f0963e78407e3af2ec6007af +Author: Michiharu Ariza +Date: Mon Oct 22 16:37:39 2018 -0700 + + fix build attempt ^4 + + src/hb-ot-cff-common.hh | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + commit 683fad062792a199e2fe86fe161f41b9389d08c3 Author: Behdad Esfahbod Date: Mon Oct 22 16:35:03 2018 -0700 @@ -8908,6 +12266,39 @@ Date: Mon Oct 22 14:43:12 2018 -0700 src/hb-ot-color.cc | 1 + 2 files changed, 17 insertions(+), 16 deletions(-) +commit ba055a8d53595ab49747ed3e02d90c9b6a3cf4f3 +Author: Michiharu Ariza +Date: Mon Oct 22 16:20:04 2018 -0700 + + fix build attempt ^3 + + test/api/test-ot-extents-cff.c | 2 +- + test/api/test-subset-cff1.c | 1 + + test/api/test-subset-cff2.c | 1 + + 3 files changed, 3 insertions(+), 1 deletion(-) + +commit b11032afaefb2c84f9a4bbffe95c91f6374df802 +Author: Michiharu Ariza +Date: Mon Oct 22 15:52:37 2018 -0700 + + fix build attempt ^2 + + src/hb-ot-cff-common.hh | 2 +- + test/api/test-ot-extents-cff.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 3d3df5575c5be0e3c69b99ca1d8df2cea1672aaf +Author: Michiharu Ariza +Date: Mon Oct 22 15:23:39 2018 -0700 + + fix build attempt + + src/hb-ot-cff-common.hh | 5 ++++- + test/api/test-ot-extents-cff.c | 11 +++++------ + test/api/test-subset-cff1.c | 19 +++++++++---------- + test/api/test-subset-cff2.c | 11 +++++------ + 4 files changed, 23 insertions(+), 23 deletions(-) + commit 0babf761c986855f9cdd1a2679380ee6a02390c8 Author: Ebrahim Byagowi Date: Tue Oct 23 01:33:45 2018 +0330 @@ -8982,6 +12373,13 @@ Date: Sun Oct 21 19:23:11 2018 -0700 test/api/test-ot-color.c | 30 ++++++++--------- 5 files changed, 85 insertions(+), 60 deletions(-) +commit 570b77f7d2b41262ccb20fadbee2c6b455cd06c6 +Merge: 857c5827 d440c8d3 +Author: Michiharu Ariza +Date: Mon Oct 22 13:06:47 2018 -0700 + + Merge branch 'master' into cff-subset + commit 9085a72deb041cf10edfa61d24b7c25f947f736b Author: Behdad Esfahbod Date: Sun Oct 21 19:08:25 2018 -0700 @@ -9030,6 +12428,13 @@ Date: Mon Oct 22 22:07:59 2018 +0330 test/api/test-ot-color.c | 21 +++++++++++++++++++++ 9 files changed, 55 insertions(+), 4 deletions(-) +commit 857c58279e82897ed69e8ade2f736073fa12883b +Merge: 51fba41c b92b9d7e +Author: Michiharu Ariza +Date: Mon Oct 22 09:57:20 2018 -0700 + + Merge branch 'master' into cff-subset + commit b92b9d7e5290eaa83e94fd40cddaee71628a3c2a Author: Behdad Esfahbod Date: Sun Oct 21 17:42:51 2018 -0700 @@ -9775,6 +13180,39 @@ Date: Fri Oct 19 08:09:53 2018 +0330 9410 bytes 13 files changed, 0 insertions(+), 0 deletions(-) +commit 51fba41cc958ded3afc6c1e738895b0a81993e18 +Merge: e555ed96 3d9a0306 +Author: Michiharu Ariza +Date: Thu Oct 18 13:08:42 2018 -0700 + + Merge branch 'master' into cff-subset + +commit e555ed961e86104e059861efe4245b7b146dbd3b +Author: Michiharu Ariza +Date: Thu Oct 18 13:04:41 2018 -0700 + + added flex extents test + + test/api/fonts/cff1_flex.otf | Bin 0 -> 3152 bytes + test/api/test-ot-extents-cff.c | 23 +++++++++++++++++++++++ + 2 files changed, 23 insertions(+) + +commit 8679d02b4b3f2f9147c4ea0319eb39851c4e40e6 +Author: Michiharu Ariza +Date: Thu Oct 18 13:04:21 2018 -0700 + + implement flex ops for glyph extents/subset + + also removed unused CSInterpEnv::move_[xy]_with_arg + fixed bug a width being left over on argStack with CFF1 + + src/hb-cff-interp-cs-common.hh | 157 + +++++++++++++++++++++++++++++++++++------ + src/hb-cff1-interp-cs.hh | 1 + + src/hb-subset-cff1.cc | 4 -- + src/hb-subset-cff2.cc | 4 -- + 4 files changed, 138 insertions(+), 28 deletions(-) + commit 3d9a0306ebb48706778fd2c487c3cacc7d508d6c Author: Behdad Esfahbod Date: Thu Oct 18 05:58:17 2018 -0700 @@ -10053,6 +13491,13 @@ Date: Wed Oct 17 15:04:35 2018 -0700 .../fonts/oom-ccc61c92d589f895174cdef6ff2e3b20e9999a1a | Bin 18 files changed, 7 insertions(+), 7 deletions(-) +commit 1f34388e8b40a77157f61c8e1a2fc7c4846c192e +Merge: 9ade3e7b 2e7c7165 +Author: Michiharu Ariza +Date: Wed Oct 17 09:34:48 2018 -0700 + + Merge branch 'master' into cff-subset + commit 2e7c716511e8b2cfcd059fa2a2ed4cdd48b351bf Author: Behdad Esfahbod Date: Tue Oct 16 18:35:03 2018 -0700 @@ -10547,6 +13992,22 @@ Date: Mon Oct 15 19:46:45 2018 -0700 src/hb-ot-color-cbdt-table.hh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) +commit 9ade3e7bb81be43b3c0811614b9b9533127894b0 +Merge: 6420ffe0 0f85edb7 +Author: Michiharu Ariza +Date: Mon Oct 15 14:03:23 2018 -0700 + + Merge branch 'master' into cff-subset + +commit 6420ffe00fc4f4c6ffa63b80d961f70bc36c2caf +Author: Michiharu Ariza +Date: Mon Oct 15 14:03:18 2018 -0700 + + fixed type casting bug + + src/hb-cff-interp-common.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + commit 0f85edb7781f4d5ec2de676979be75a0f6559d80 Author: Behdad Esfahbod Date: Mon Oct 15 11:15:54 2018 -0700 @@ -10731,6 +14192,26 @@ Date: Sun Oct 14 14:52:17 2018 -0700 src/hb-aat-layout-common.hh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) +commit db0d83ddc73ecf50ec4489fc10eddf3fa5835ae2 +Merge: 9228db06 56b8dd17 +Author: Michiharu Ariza +Date: Sat Oct 13 17:25:38 2018 -0700 + + Merge branch 'master' into cff-subset + +commit 9228db06f46908afd0e62f5964470c37c66ba91f +Author: Michiharu Ariza +Date: Sat Oct 13 17:25:09 2018 -0700 + + added CFF1 Expert Encoding subset test & bug fixes + + src/hb-ot-cff1-table.hh | 8 +++++++- + src/hb-subset-cff1.cc | 10 ++++++++-- + test/api/fonts/cff1_expert.2D,F6E9,FB00.otf | Bin 0 -> 3096 bytes + test/api/fonts/cff1_expert.otf | Bin 0 -> 3656 bytes + test/api/test-subset-cff1.c | 21 +++++++++++++++++++++ + 5 files changed, 36 insertions(+), 3 deletions(-) + commit 56b8dd17f677ffe97e4d917c47924e1ac7632c71 Author: Behdad Esfahbod Date: Sat Oct 13 19:03:33 2018 -0400 @@ -10855,6 +14336,17 @@ Date: Sat Oct 13 14:00:05 2018 +0330 src/hb-ot-shape-complex.hh | 18 +++--- 9 files changed, 93 insertions(+), 106 deletions(-) +commit b64ef69b9e3d9cd4e81a2149cea3fe6e9e371cac +Author: Michiharu Ariza +Date: Fri Oct 12 14:14:21 2018 -0700 + + from encode_int removed assert hit by fuzzer + + clamp the value instead + + src/hb-subset-cff-common.hh | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + commit c0a6814b49e376984a0cae9d385a6f6ba8c73579 Author: Behdad Esfahbod Date: Fri Oct 12 16:05:56 2018 -0400 @@ -10977,6 +14469,31 @@ Date: Thu Oct 11 21:18:20 2018 -0400 src/hb-font.cc | 4 ---- 1 file changed, 4 deletions(-) +commit fc0153a1d4903a57b21974cc8d0b0a82d7bc43dc +Merge: 7d99a6ce c5510000 +Author: Michiharu Ariza +Date: Fri Oct 12 12:16:50 2018 -0700 + + Merge branch 'master' into cff-subset + +commit 7d99a6cef80ec178c10dcf0e848394614c5e6912 +Author: Michiharu Ariza +Date: Fri Oct 12 02:16:07 2018 -0700 + + overhauled error handling in CFF interpreter + + minimized "if (error) return false" idiom + + src/hb-cff-interp-common.hh | 138 + +++++++++++++++++++++++---------------- + src/hb-cff-interp-cs-common.hh | 43 ++++++------ + src/hb-cff-interp-dict-common.hh | 72 +++++++++++--------- + src/hb-cff1-interp-cs.hh | 72 +++++++++++--------- + src/hb-cff2-interp-cs.hh | 50 +++++++------- + src/hb-ot-cff1-table.hh | 91 +++++++++++--------------- + src/hb-ot-cff2-table.hh | 71 +++++++++----------- + 7 files changed, 281 insertions(+), 256 deletions(-) + commit c55100000bc20d7c8319cfc54294215a923ffc25 Author: David Corbett Date: Thu Oct 11 22:08:14 2018 -0400 @@ -11182,6 +14699,15 @@ Date: Thu Oct 11 15:03:21 2018 -0400 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 14 deletions(-) +commit ca37172ee3908bac12cc3d97768b95ae571530d2 +Author: Michiharu Ariza +Date: Thu Oct 11 11:55:55 2018 -0700 + + fixed leak + + test/api/test-ot-extents-cff.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + commit 4f9e36e8cf5d9d3d3e5a1ed46149355ee5f5e9fb Author: Behdad Esfahbod Date: Thu Oct 11 14:32:59 2018 -0400 @@ -11511,6 +15037,35 @@ Date: Thu Dec 28 22:59:29 2017 +0800 src/hb-common.cc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) +commit ce6639cd27f79856466a5e8abf58f544f069e25d +Merge: a6b6faf2 0b9d60e1 +Author: Michiharu Ariza +Date: Thu Oct 11 10:53:48 2018 -0700 + + Merge branch 'master' into cff-subset + +commit a6b6faf2b87f113fb23cf8e040f8b7875e2daf80 +Author: Michiharu Ariza +Date: Thu Oct 11 10:53:44 2018 -0700 + + Replaced CFF1 J subset font for better coverage + + in api test-ot-extents-cff + + test/api/fonts/SourceHanSans-Regular.41,3041,4C2E.otf | Bin 0 -> + 3892 bytes + test/api/fonts/SourceHanSans-Regular.41,3041,4E9D.otf | Bin 5864 -> + 0 bytes + test/api/fonts/SourceHanSans-Regular.41,4C2E.otf | Bin 0 -> + 2548 bytes + test/api/fonts/SourceHanSans-Regular.41,4E9D.otf | Bin 5500 -> + 0 bytes + test/api/test-ot-extents-cff.c | 15 + +++++++++++++++ + test/api/test-subset-cff1.c | 18 + +++++++++--------- + 6 files changed, 24 insertions(+), 9 deletions(-) + commit 0b9d60e1a1c4b7867ac907bbd7c004191a14e697 Author: Behdad Esfahbod Date: Thu Oct 11 13:26:58 2018 -0400 @@ -11746,6 +15301,25 @@ Date: Wed Oct 10 21:46:58 2018 -0400 src/hb-aat-layout-kerx-table.hh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) +commit b5aa5dbb1158a5dfba29f7b119df9b4b319e8489 +Merge: af61c3b1 ab1f30bd +Author: Michiharu Ariza +Date: Wed Oct 10 18:36:35 2018 -0700 + + Merge branch 'master' into cff-subset + +commit af61c3b10f83a00b4862cc0cb92fc9f0856e7dd6 +Author: Michiharu Ariza +Date: Wed Oct 10 18:35:12 2018 -0700 + + added vsindex test & fixed process_vsindex + + src/hb-cff2-interp-cs.hh | 12 +++++----- + test/api/fonts/AdobeVFPrototype_vsindex.otf | Bin 0 -> 7036 bytes + test/api/test-ot-extents-cff.c | 33 + ++++++++++++++++++++++++++++ + 3 files changed, 40 insertions(+), 5 deletions(-) + commit 504cb68fc972c7f606bf9fc62015376382f78f45 Author: Behdad Esfahbod Date: Wed Oct 10 21:29:46 2018 -0400 @@ -12124,6 +15698,26 @@ Date: Wed Oct 10 17:12:52 2018 +0330 ++++++++++++++++++++++++++++++++------------------- 2 files changed, 100 insertions(+), 52 deletions(-) +commit c06a5dff0b0f8d1c5aba53bcfd7fb0b680f1ca92 +Merge: 83c5298f 0537a401 +Author: Michiharu Ariza +Date: Tue Oct 9 22:00:10 2018 -0700 + + Merge branch 'master' into cff-subset + +commit 83c5298f33e66cfd3d84d246297683f0de80c57d +Author: Michiharu Ariza +Date: Tue Oct 9 21:59:36 2018 -0700 + + added cff1_legacyops.otf as test-ot-extents-cff test case + + fixed roll operator bugs uncovered by the test + + src/hb-cff-interp-common.hh | 4 ++-- + test/api/fonts/cff1_legacyops.otf | Bin 0 -> 3104 bytes + test/api/test-ot-extents-cff.c | 23 +++++++++++++++++++++++ + 3 files changed, 25 insertions(+), 2 deletions(-) + commit 0537a40193e803d50a99cd6b993d6d9301e84ebf Author: Behdad Esfahbod Date: Tue Oct 9 23:35:07 2018 -0400 @@ -12289,6 +15883,15 @@ Date: Tue Oct 9 21:56:37 2018 -0400 src/hb-ot-kern-table.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) +commit 588518ea51b2226bdb41417946848d18c3913a67 +Author: Michiharu Ariza +Date: Tue Oct 9 14:48:04 2018 -0700 + + fixed test-ot-extents-cff failure on some platforms + + test/api/test-ot-extents-cff.c | 11 +++-------- + 1 file changed, 3 insertions(+), 8 deletions(-) + commit be2f148da474d6dd30132c22dd467ea33a942edf Author: Behdad Esfahbod Date: Tue Oct 9 16:24:50 2018 -0400 @@ -12488,6 +16091,13 @@ Date: Tue Oct 9 14:12:59 2018 -0400 src/hb-ot-shape-normalize.cc | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) +commit f5f505b5120c316f06306318c6c2f0db4496ba04 +Merge: 8b349040 4035158d +Author: Michiharu Ariza +Date: Tue Oct 9 10:10:35 2018 -0700 + + Merge branch 'master' into cff-subset + commit b314c4e9abf4236c6650a63d1287471b61f64885 Author: Behdad Esfahbod Date: Tue Oct 9 09:23:51 2018 -0400 @@ -12639,6 +16249,13 @@ Date: Tue Oct 9 00:56:33 2018 -0400 src/hb-ucdn.cc | 15 ++++++--------- 3 files changed, 18 insertions(+), 27 deletions(-) +commit 8b349040e92b8894a7f8a609fac8070bcb110f96 +Merge: df964a09 fc509165 +Author: Michiharu Ariza +Date: Mon Oct 8 21:46:23 2018 -0700 + + Merge branch 'master' into cff-subset + commit fc50916589a300e49183b5ee598e64ca28d0bd9a Author: Behdad Esfahbod Date: Tue Oct 9 00:39:42 2018 -0400 @@ -12804,6 +16421,52 @@ Date: Mon Oct 8 22:26:39 2018 -0400 src/hb-unicode.h | 28 ---------------------------- 3 files changed, 40 insertions(+), 30 deletions(-) +commit df964a09319bbf5b0a7528b906311726d4f640d6 +Author: Michiharu Ariza +Date: Mon Oct 8 15:38:05 2018 -0700 + + fixed test-subset-cff2 + + src/hb-cff2-interp-cs.hh | 7 +++---- + src/hb-ot-cff2-table.cc | 2 +- + 2 files changed, 4 insertions(+), 5 deletions(-) + +commit a90fd8b9feeee3b02d139f2e7db774766d7855cb +Merge: b51418f5 e42cd58c +Author: Michiharu Ariza +Date: Mon Oct 8 15:07:58 2018 -0700 + + Merge branch 'master' into cff-subset + +commit b51418f596097aa5d1b28fb0a02b613c36bacd8e +Author: Michiharu Ariza +Date: Mon Oct 8 15:05:36 2018 -0700 + + added CFF2 get_extents + + added source hb-ot-cff2-table.cc + augmented VariationData to return scalars + misc bug fixes, renaming, cleanup + + src/Makefile.sources | 2 + + src/hb-cff-interp-common.hh | 37 ++++++----- + src/hb-cff-interp-cs-common.hh | 134 + +++++++++++++++++++------------------- + src/hb-cff-interp-dict-common.hh | 6 +- + src/hb-cff2-interp-cs.hh | 102 ++++++++++++++++++++++++----- + src/hb-ot-cff1-table.hh | 4 +- + src/hb-ot-cff2-table.cc | 135 + +++++++++++++++++++++++++++++++++++++++ + src/hb-ot-cff2-table.hh | 71 ++++++++++++-------- + src/hb-ot-face.cc | 1 + + src/hb-ot-face.hh | 1 + + src/hb-ot-font.cc | 4 ++ + src/hb-ot-layout-common.hh | 28 +++++++- + src/hb-subset-cff1.cc | 2 +- + src/hb-subset-cff2.cc | 4 +- + test/api/test-ot-extents-cff.c | 36 +++++++++++ + 15 files changed, 426 insertions(+), 141 deletions(-) + commit 286a45641fc6732bb7cab02f06c90396834541b1 Author: Behdad Esfahbod Date: Mon Oct 8 16:41:08 2018 -0400 @@ -13100,6 +16763,48 @@ Date: Sun Oct 7 16:31:33 2018 +0200 src/hb-coretext.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +commit 55942ad5c1ee999c9f590b8cc8fbde12e937aa6f +Author: Michiharu Ariza +Date: Sat Oct 6 14:49:44 2018 -0700 + + Merge branch 'master' into cff-subset + + TODO | 10 +-- + configure.ac | 2 +- + src/hb-aat-layout-common.hh | 4 +- + src/hb-aat-layout-morx-table.hh | 9 +- + src/hb-aat-layout.cc | 6 ++ + src/hb-aat-layout.hh | 2 + + 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-ot-shape.cc | 27 ++++-- + src/hb-ot-shape.hh | 5 ++ + src/hb-set.hh | 4 +- + src/hb-subset.cc | 2 +- + src/hb-vector.hh | 100 + ++++++++++++++------- + test/shaping/data/text-rendering-tests/DISABLED | 35 +------- + .../data/text-rendering-tests/Makefile.sources | 18 ++-- + .../data/text-rendering-tests/extract-tests.py | 18 +++- + .../text-rendering-tests/fonts/TestGSUBThree.ttf | Bin 0 -> 1504 bytes + .../fonts/TestMORXThirtyfive.ttf | Bin 0 -> 1968 bytes + .../fonts/TestMORXThirtyfour.ttf | Bin 0 -> 3608 bytes + .../fonts/TestMORXThirtysix.ttf | Bin 0 -> 1836 bytes + .../fonts/TestMORXThirtythree.ttf | Bin 0 -> 1520 bytes + .../fonts/TestMORXTwentyfour.ttf | Bin 0 -> 1828 bytes + .../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 + + .../data/text-rendering-tests/tests/MORX-35.tests | 2 + + .../data/text-rendering-tests/tests/MORX-36.tests | 1 + + test/shaping/run-tests.py | 19 ++-- + util/view-cairo.hh | 2 +- + 33 files changed, 173 insertions(+), 115 deletions(-) + commit 7ee50af8366547c382047a30a94f7f5f739aabcb Author: Behdad Esfahbod Date: Sat Oct 6 21:31:44 2018 +0200 @@ -13211,6 +16916,36 @@ Date: Fri Oct 5 02:49:29 2018 +0200 src/hb-ot-shape.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +commit e7a045e4db39e037badcab0ad1239c0cb56c1170 +Author: Michiharu Ariza +Date: Thu Oct 4 14:16:07 2018 -0700 + + fixed leak exposed by test-ot-extents-cff + + src/hb-cff-interp-common.hh | 3 +++ + src/hb-cff-interp-dict-common.hh | 4 ++++ + 2 files changed, 7 insertions(+) + +commit 6238edbd8b654d105bbd191dffabc7820f0a3223 +Author: Michiharu Ariza +Date: Thu Oct 4 13:59:36 2018 -0700 + + added CFF glyph extents API test + + test/api/Makefile.am | 1 + + test/api/test-ot-extents-cff.c | 65 + ++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 66 insertions(+) + +commit 0222d57c357c775f25866653700b9dcb7d5bb807 +Author: Michiharu Ariza +Date: Thu Oct 4 09:37:57 2018 -0700 + + tweaked previous warning fixes + + src/hb-cff-interp-common.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + commit 7b3ae5ffd202346cb3742fe0f8cfafe8c36a4bd5 Author: Behdad Esfahbod Date: Thu Oct 4 16:36:42 2018 +0200 @@ -13391,6 +17126,32 @@ Date: Thu Oct 4 09:24:08 2018 +0200 src/hb-aat-layout-morx-table.hh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) +commit 3ef358909eb7e26ca9630e61c7ba142d9e94389e +Author: Michiharu Ariza +Date: Wed Oct 3 18:08:25 2018 -0700 + + fixed warnings + + src/hb-cff-interp-common.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 1aeaee9dfc7ee3ca410919c41e55452a0b6b9bf6 +Author: Michiharu Ariza +Date: Wed Oct 3 17:44:45 2018 -0700 + + fixed cff2 subset test data + + test/api/fonts/AdobeVFPrototype.abc.nohints.otf | Bin 0 -> 7800 bytes + test/api/test-subset-cff2.c | 4 ++-- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 8be5a9186be3ca4c50c73f372be4dbad08ac1863 +Merge: d7b384ad 5de2d9cd +Author: Michiharu Ariza +Date: Wed Oct 3 17:06:18 2018 -0700 + + Merge branch 'master' into cff-subset + commit 5de2d9cdbdca870901c0ba9472f5b78c48ba0a58 Author: Ebrahim Byagowi Date: Thu Oct 4 02:14:18 2018 +0330 @@ -13803,6 +17564,80 @@ Date: Wed Oct 3 12:29:56 2018 +0200 .../shaping/data/in-house/tests/use-syllable.tests | 3 + 7 files changed, 301 insertions(+), 245 deletions(-) +commit d7b384ad0d0a3e1d35ef92a6e98a97bb9c367f48 +Author: Michiharu Ariza +Date: Tue Oct 2 21:08:36 2018 -0700 + + silence warning ^3 + + src/hb-subset-cff1.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e9cc71ac86bd771d9fcb2ee1eb620060db92ac1a +Author: Michiharu Ariza +Date: Tue Oct 2 20:44:30 2018 -0700 + + silence warning ^2 + + src/hb-subset-cff1.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2700db9ade23cbf69d17a7a1802a7f144c25f8dc +Author: Michiharu Ariza +Date: Tue Oct 2 15:05:26 2018 -0700 + + rm build files + + build/test/api/.libs/test-collect-unicodes | Bin 14336 -> 0 bytes + build/test/api/.libs/test-multithread | Bin 10936 -> 0 bytes + build/test/api/test-collect-unicodes | 210 + ----------------------------- + build/test/api/test-multithread | 210 + ----------------------------- + 4 files changed, 420 deletions(-) + +commit 51d5bf4ca2ebb9b8aa3b2777781e328fb93ceea7 +Author: Michiharu Ariza +Date: Tue Oct 2 14:38:06 2018 -0700 + + silence warnings + + src/hb-cff-interp-cs-common.hh | 2 +- + src/hb-subset-cff1.cc | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 35b64dfb57cac0d949363e9b19352dd4274c2584 +Author: Michiharu Ariza +Date: Tue Oct 2 14:13:36 2018 -0700 + + silence & fix new warnings + + src/hb-cff-interp-dict-common.hh | 3 ++- + src/hb-cff1-interp-cs.hh | 9 +++++---- + src/hb-ot-cff-common.hh | 4 ++-- + src/hb-subset-cff1.cc | 4 ++-- + src/hb-subset-cff2.cc | 4 ++-- + 5 files changed, 13 insertions(+), 11 deletions(-) + +commit eed7e6bbc8e7be99d59a7822a1c37bc715c379b3 +Author: Michiharu Ariza +Date: Tue Oct 2 13:45:14 2018 -0700 + + redefine OpCodes as define instead of enum + + in order to eradicate duplicate enum warnings + + src/hb-cff-interp-common.hh | 348 + ++++++++++++++++++++++---------------------- + 1 file changed, 174 insertions(+), 174 deletions(-) + +commit 9cdd70b344b9dc34a29aeca79028cbb5d949ca1d +Merge: 3dd43f02 6353cc1f +Author: Michiharu Ariza +Date: Tue Oct 2 13:43:21 2018 -0700 + + Merge branch 'master' into cff-subset + commit 6353cc1f83c862910860976411a1157f7ed571bc Author: Ebrahim Byagowi Date: Tue Oct 2 21:39:19 2018 +0330 @@ -14193,6 +18028,13 @@ Date: Mon Oct 1 19:09:58 2018 +0200 src/hb-ot-shape-complex-khmer.hh | 99 +++++----- 5 files changed, 270 insertions(+), 177 deletions(-) +commit 3dd43f0234febd434d89927adf2ee19f0489c5a7 +Merge: ab16b24c eb1e6028 +Author: Michiharu Ariza +Date: Mon Oct 1 10:22:06 2018 -0700 + + Merge branch 'master' into cff-subset + commit aaaa65baa7fcfb65ae814528bdd93cc5c4ea540d Author: Behdad Esfahbod Date: Mon Oct 1 16:59:48 2018 +0200 @@ -14927,6 +18769,31 @@ Date: Thu Sep 27 11:53:17 2018 +0330 .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +commit ab16b24cc94389ac66a9353327d2a87a7c230ed4 +Author: Michiharu Ariza +Date: Wed Sep 26 18:51:36 2018 -0700 + + tweaked get_fd fix + + src/hb-ot-cff-common.hh | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit dac70f252a84e1a255375eaacffc2cb3f3fc6e58 +Author: Michiharu Ariza +Date: Wed Sep 26 16:30:26 2018 -0700 + + Added CFF1 J font subset to api test + + Also fixed FDSelect3_4::get_fd + Fixed test_subset_cff1_strip_hints (wrong font names!) + + src/hb-ot-cff-common.hh | 2 +- + .../fonts/SourceHanSans-Regular.41,3041,4E9D.otf | Bin 0 -> 5864 bytes + test/api/fonts/SourceHanSans-Regular.41,4E9D.otf | Bin 0 -> 5500 bytes + test/api/test-subset-cff1.c | 25 + +++++++++++++++++++-- + 4 files changed, 24 insertions(+), 3 deletions(-) + commit 662f7d7e8bfa77b21ffa05e853f61dda993dcc8a Author: Behdad Esfahbod Date: Wed Sep 26 18:42:37 2018 -0400 @@ -15062,6 +18929,38 @@ Date: Tue Sep 25 09:24:35 2018 +0330 .circleci/config.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) +commit ae7f0e83d4417fac2455c44eaea15b3cca03d18e +Author: Michiharu Ariza +Date: Mon Sep 24 22:49:44 2018 -0700 + + fixed memory leaks + + in CFF1 & CFF2 accelerators, VORG subsetter + + src/hb-ot-cff1-table.hh | 2 ++ + src/hb-ot-cff2-table.hh | 2 ++ + src/hb-ot-vorg-table.hh | 3 +++ + 3 files changed, 7 insertions(+) + +commit 258b456566abd266657725b3fc4e70f18b370d5d +Author: Michiharu Ariza +Date: Mon Sep 24 16:50:47 2018 -0700 + + Added CFF1 & CFF2 api tests + + test/api/Makefile.am | 4 + + test/api/fonts/AdobeVFPrototype.abc.otf | Bin 0 -> 7800 bytes + test/api/fonts/AdobeVFPrototype.ac.nohints.otf | Bin 0 -> 7152 bytes + test/api/fonts/AdobeVFPrototype.ac.otf | Bin 0 -> 7336 bytes + test/api/fonts/SourceSansPro-Regular.abc.otf | Bin 0 -> 3412 bytes + .../api/fonts/SourceSansPro-Regular.ac.nohints.otf | Bin 0 -> 3228 bytes + test/api/fonts/SourceSansPro-Regular.ac.otf | Bin 0 -> 3332 bytes + test/api/test-subset-cff1.c | 104 + +++++++++++++++++++++ + test/api/test-subset-cff2.c | 104 + +++++++++++++++++++++ + 9 files changed, 212 insertions(+) + commit 8282e881b51363811078bce53fad6aa5b41f7b41 Author: Behdad Esfahbod Date: Mon Sep 24 19:43:01 2018 -0400 @@ -15187,6 +19086,13 @@ Date: Mon Sep 24 13:11:34 2018 -0400 src/check-static-inits.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +commit 0604bf2b3846b200c56447ffe542bf69c0529a06 +Merge: 76e54d2b 45f5aa97 +Author: Michiharu Ariza +Date: Mon Sep 24 10:09:25 2018 -0700 + + Merge branch 'master' into cff-subset + commit e45ba31dc723988150ef766758fa89fecd50ca03 Author: Behdad Esfahbod Date: Mon Sep 24 13:04:48 2018 -0400 @@ -15422,6 +19328,47 @@ Date: Sat Sep 22 16:45:31 2018 +0330 test/api/test-font.c | 1 + 1 file changed, 1 insertion(+) +commit 76e54d2bd804414183858ca198157050419dfe6c +Author: Michiharu Ariza +Date: Fri Sep 21 12:16:36 2018 -0700 + + fixed subroutinized CFF2 flattening + + and some code cleanup + + src/hb-cff-interp-common.hh | 2 +- + src/hb-cff-interp-cs-common.hh | 13 ------------- + src/hb-cff2-interp-cs.hh | 7 ++++--- + 3 files changed, 5 insertions(+), 17 deletions(-) + +commit 321e592333014f713557e8ce8041dcb5de710218 +Author: Michiharu Ariza +Date: Thu Sep 20 10:31:06 2018 -0700 + + Added desubroutinize option to generate-expected-outputs.py + + Currently hb-subset always desubroutinizes CFF fonts. + Note that even with this option fonttools won't generate the expected + subset CFF fonts. They were manually created & tweaked to match + hb-subset output. + + test/subset/generate-expected-outputs.py | 1 + + 1 file changed, 1 insertion(+) + +commit f212c050ad50898d5105d1d3a6ea3498f94ee462 +Author: Michiharu Ariza +Date: Thu Sep 20 09:45:43 2018 -0700 + + Added VORG struct and its subsetter + + new file: hb-ot-vorg-table.hh + + src/Makefile.sources | 1 + + src/hb-ot-vorg-table.hh | 163 + ++++++++++++++++++++++++++++++++++++++++++++++++ + src/hb-subset.cc | 5 +- + 3 files changed, 168 insertions(+), 1 deletion(-) + commit 5fd8bce945e7efaa48d0c29eb8b2700027bd3c0b Author: Behdad Esfahbod Date: Wed Sep 19 22:34:09 2018 -0400 @@ -15431,6 +19378,46 @@ Date: Wed Sep 19 22:34:09 2018 -0400 src/hb-aat-layout-morx-table.hh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) +commit 1377adc8a88c627891cb8b9cea511d8f9f5324f9 +Author: Michiharu Ariza +Date: Wed Sep 19 17:00:10 2018 -0700 + + Added SourceHanSans-Regular for CFF subset test + + Disabled FDSelect serialization to format 0 for compatibility with + fonttools + + src/hb-subset-cff-common.cc | 16 + +++++++++++++--- + .../japanese/SourceHanSans-Regular.default..otf | Bin 0 -> + 2340 bytes + ...Regular.default.3042,3044,3046,3048,304A,304B.otf | Bin 0 -> + 6248 bytes + ...Regular.default.3042,3044,3046,73E0,5EA6,8F38.otf | Bin 0 -> + 6432 bytes + .../SourceHanSans-Regular.default.61,63,65,6B.otf | Bin 0 -> + 5428 bytes + ...Regular.default.660E,6975,73E0,5EA6,8F38,6E05.otf | Bin 0 -> + 6552 bytes + .../japanese/SourceHanSans-Regular.default.660E.otf | Bin 0 -> + 5196 bytes + .../japanese/SourceHanSans-Regular.drop-hints..otf | Bin 0 -> + 2188 bytes + ...ular.drop-hints.3042,3044,3046,3048,304A,304B.otf | Bin 0 -> + 6076 bytes + ...ular.drop-hints.3042,3044,3046,73E0,5EA6,8F38.otf | Bin 0 -> + 6180 bytes + .../SourceHanSans-Regular.drop-hints.61,63,65,6B.otf | Bin 0 -> + 5312 bytes + ...ular.drop-hints.660E,6975,73E0,5EA6,8F38,6E05.otf | Bin 0 -> + 6248 bytes + .../SourceHanSans-Regular.drop-hints.660E.otf | Bin 0 -> + 5088 bytes + test/subset/data/fonts/SourceHanSans-Regular.otf | Bin 0 -> + 16427580 bytes + test/subset/data/tests/japanese.tests | 1 + + 15 files changed, 14 insertions(+), 3 deletions(-) + commit 0739b28169eb63332b31420deb5bf58b5446f154 Author: Behdad Esfahbod Date: Wed Sep 19 17:32:21 2018 -0400 @@ -15485,6 +19472,106 @@ Date: Wed Sep 19 16:02:56 2018 -0400 src/hb-aat-layout-morx-table.hh | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) +commit ebeccf3e63bff96b7a7766dea566704a9cbeae44 +Author: Michiharu Ariza +Date: Tue Sep 18 17:24:30 2018 -0700 + + fixed char widths & standard Encoding in subset CFF + + also merged flush_n_args to flush_args into one + takes start index of the arguments on stack instead of count + + src/hb-cff-interp-cs-common.hh | 20 +++++--------------- + src/hb-cff1-interp-cs.hh | 11 +++++++---- + src/hb-cff2-interp-cs.hh | 2 +- + src/hb-subset-cff1.cc | 22 ++++++++++++++++------ + src/hb-subset-cff2.cc | 12 ++++++------ + 5 files changed, 35 insertions(+), 32 deletions(-) + +commit bf4eb2e4cf8d08b674f81954e22b331cca2b3721 +Author: Michiharu Ariza +Date: Tue Sep 18 15:53:37 2018 -0700 + + Added SourceSansPro-Regular along as CFF full-font test case + + derived "expected" subset fonts from fonttools then manually tweaked + further so they resemble hb-subset output + + ...ourceSansPro-Regular.default.1FC,21,41,20,62,63.otf | Bin 0 -> + 3640 bytes + .../SourceSansPro-Regular.default.61,62,63.otf | Bin 0 -> + 3400 bytes + .../SourceSansPro-Regular.default.D7,D8,D9,DA,DE.otf | Bin 0 -> + 3596 bytes + ...ceSansPro-Regular.drop-hints.1FC,21,41,20,62,63.otf | Bin 0 -> + 3480 bytes + .../SourceSansPro-Regular.drop-hints.61,62,63.otf | Bin 0 -> + 3276 bytes + ...SourceSansPro-Regular.drop-hints.D7,D8,D9,DA,DE.otf | Bin 0 -> + 3448 bytes + test/subset/data/fonts/SourceSansPro-Regular.otf | Bin 0 -> + 220852 bytes + test/subset/data/tests/full-font.tests | 1 + + test/subset/run-tests.py | 4 ++-- + test/subset/subset_test_suite.py | 5 +++++ + 10 files changed, 8 insertions(+), 2 deletions(-) + +commit e75e7224c9c02ab99e132a51fe8801e29827cac5 +Author: Michiharu Ariza +Date: Mon Sep 17 15:34:39 2018 -0700 + + include curve control points in extents + + this makes results consistent with FT + also optimized handling of path end points + + src/hb-cff-interp-cs-common.hh | 6 +++--- + src/hb-ot-cff1-table.cc | 27 +++++++++++++++++++++++++-- + 2 files changed, 28 insertions(+), 5 deletions(-) + +commit 98b94f8ba53276887ab583eeeb4cb097c7b84b2c +Author: Michiharu Ariza +Date: Mon Sep 17 13:56:39 2018 -0700 + + fix static_assert failure in OffsetTo + + src/hb-ot-cff2-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d050ab8d3e73debfb414fc8c9426180459150b61 +Merge: f0a4e0c2 388ab916 +Author: Michiharu Ariza +Date: Mon Sep 17 13:07:29 2018 -0700 + + Merge branch 'master' into cff-subset + +commit f0a4e0c2ca5ee0225765590384216d5d5367de7e +Author: Michiharu Ariza +Date: Mon Sep 17 12:11:56 2018 -0700 + + fix build attempt ^3 + + src/hb-ot-cff1-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f0d74971aee5ce309bdfa2a4397667f14ee15f42 +Author: Michiharu Ariza +Date: Mon Sep 17 12:02:12 2018 -0700 + + fix attempt ^2: unuse INT32_MAX/MIN + + src/hb-ot-cff1-table.cc | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 4d963a2711e6035e97e246241d8420273363f857 +Author: Michiharu Ariza +Date: Mon Sep 17 11:28:33 2018 -0700 + + fix build attempt + + src/hb-ot-cff1-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + commit 388ab91642734e1ba0d7a4a4f29a17b15f1b249d Author: Behdad Esfahbod Date: Mon Sep 17 19:29:34 2018 +0200 @@ -15495,6 +19582,31 @@ Date: Mon Sep 17 19:29:34 2018 +0200 ++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 54 deletions(-) +commit c0c85b852d37dad75eeef473e6dd3ec91a3b559b +Author: Michiharu Ariza +Date: Mon Sep 17 11:14:56 2018 -0700 + + implemented get_glyph_extents with CFF1 + + Implemented path operators in a new struct PathProc hooked up + to CSOpSet + Added current point to CSInterpEnv + + src/hb-cff-interp-common.hh | 86 ++++++++- + src/hb-cff-interp-cs-common.hh | 425 + +++++++++++++++++++++++++++++++++++++++-- + src/hb-cff1-interp-cs.hh | 18 +- + src/hb-cff2-interp-cs.hh | 10 +- + src/hb-null.hh | 2 +- + src/hb-ot-cff1-table.cc | 82 ++++++++ + src/hb-ot-cff1-table.hh | 95 +++++---- + src/hb-ot-face.cc | 1 + + src/hb-ot-face.hh | 1 + + src/hb-ot-font.cc | 2 + + src/hb-subset-cff1.cc | 4 +- + src/hb-subset-cff2.cc | 10 +- + 12 files changed, 657 insertions(+), 79 deletions(-) + commit d8d1e7df0057c79f54d855b7bfec2d21f59b09e8 Author: David Corbett Date: Mon Sep 17 11:09:51 2018 -0400 @@ -15764,6 +19876,13 @@ Date: Fri Sep 14 10:58:00 2018 +0200 src/hb-open-file.hh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) +commit f2c4720ae696096d90493db218ef1283681561e7 +Merge: 1234a813 ca746f26 +Author: Michiharu Ariza +Date: Thu Sep 13 12:44:00 2018 -0700 + + Merge branch 'master' into cff-subset + commit ca746f261e1e54cec2f9c8bc7a6f930491e19418 Author: Behdad Esfahbod Date: Thu Sep 13 20:35:21 2018 +0200 @@ -15815,6 +19934,16 @@ Date: Thu Sep 13 20:21:54 2018 +0200 src/hb-ot-layout-gsubgpos.hh | 10 +++++----- 3 files changed, 17 insertions(+), 17 deletions(-) +commit 1234a8136891429bb7353f47480595f44615f322 +Author: Michiharu Ariza +Date: Thu Sep 13 10:55:56 2018 -0700 + + add head table to CFF/CFF2 + + src/hb-ot-cff1-table.hh | 4 ++++ + src/hb-ot-cff2-table.hh | 4 ++++ + 2 files changed, 8 insertions(+) + commit 180a88a96ce327e4103df3635c73559de65d1546 Author: Behdad Esfahbod Date: Thu Sep 13 19:19:57 2018 +0200 @@ -15932,23 +20061,133 @@ Date: Thu Sep 13 16:39:30 2018 +0200 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 +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 3cae9c75153277b9cfaaba20e0de84e420aeb1eb +Author: Michiharu Ariza +Date: Wed Sep 12 17:23:08 2018 -0700 + + fixed hb_plan_subset_cff_fdselect + + FDSelect3/4 sentinel size wasn't taken into account + + src/hb-subset-cff-common.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 0f159a38a62bbf1b7fb267694a5d91d8135da625 +Author: Michiharu Ariza +Date: Wed Sep 12 16:08:54 2018 -0700 + + fixed serialize_fdselect_3_4 + + src/hb-ot-cff-common.hh | 6 ++++ + src/hb-ot-cff1-table.hh | 6 ---- + src/hb-subset-cff-common.cc | 68 + ++++++++++++++++++++++++++------------------- + src/hb-subset-cff-common.hh | 10 +++---- + src/hb-subset-cff1.cc | 12 ++++---- + src/hb-subset-cff2.cc | 12 ++++---- + 6 files changed, 63 insertions(+), 51 deletions(-) + +commit 1608481d88919ca748e367146e3a78458d5bbe8f +Author: Michiharu Ariza +Date: Wed Sep 12 13:22:19 2018 -0700 + + fixed bugs in Charset serialization + + also some code cleanup + + src/hb-ot-cff1-table.hh | 4 ++-- + src/hb-subset-cff1.cc | 44 ++++++++++++++++++++------------------------ + 2 files changed, 22 insertions(+), 26 deletions(-) + +commit f45ac6296add6435ea5a902f7519187414aa8092 +Author: Michiharu Ariza +Date: Tue Sep 11 22:41:50 2018 -0700 + + fixed name mixup in Remap::reset + + it was causing inconsistent Strings Index subset results + + src/hb-ot-cff-common.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 497e7fb264ec5cb799c038cbe693b70410b18da3 +Author: Michiharu Ariza +Date: Tue Sep 11 16:47:55 2018 -0700 + + misc bug fixes + + Added OpCode_FontMatrix to TopDictOpSet (yet to parse values) + fixed a wrong assert in encode_int + + src/hb-cff-interp-dict-common.hh | 3 +++ + src/hb-subset-cff-common.hh | 2 +- + 2 files changed, 4 insertions(+), 1 deletion(-) + +commit 5b453f77f804cd8421a45d8276ed3e04041da23c +Author: Michiharu Ariza +Date: Tue Sep 11 16:20:39 2018 -0700 + + fixed off-by-one error with offSize + + src/hb-ot-cff-common.hh | 5 +++-- + src/hb-subset-cff1.cc | 4 ++-- + src/hb-subset-cff2.cc | 2 +- + 3 files changed, 6 insertions(+), 5 deletions(-) + +commit 1499029a9695e26beaf72e11287be60ad9e40cfe +Author: Michiharu Ariza +Date: Tue Sep 11 13:56:52 2018 -0700 + + fixed a bug + + src/hb-cff-interp-dict-common.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 0bd5912a08698fb7880e1354e45bf63ef45125a5 +Author: Michiharu Ariza +Date: Tue Sep 11 13:24:27 2018 -0700 + + make parse_bcd locale free + + src/hb-cff-interp-dict-common.hh | 92 + +++++++++++++++++++++++++++++----------- + 1 file changed, 68 insertions(+), 24 deletions(-) - OffsetTo::sanitize() more shuffling +commit bb38d0f66388ec37ee9b0e81176d60c66fc17a19 +Author: Michiharu Ariza +Date: Tue Sep 11 10:43:15 2018 -0700 - src/hb-open-type.hh | 18 +++++++++--------- - 1 file changed, 9 insertions(+), 9 deletions(-) + Implement parse_bcd -commit b482e5231cd5987082dd2c05fd649c3653f3c67a -Author: Behdad Esfahbod -Date: Thu Sep 13 16:29:49 2018 +0200 + src/hb-cff-interp-common.hh | 15 -------------- + src/hb-cff-interp-dict-common.hh | 44 + ++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 44 insertions(+), 15 deletions(-) - OffsetTo::sanitize() reshuffling +commit 45e564a51917475ef6481825a6efb5b99bf1912e +Merge: c6f75c30 d5c50927 +Author: Michiharu Ariza +Date: Tue Sep 11 09:46:37 2018 -0700 - src/hb-open-type.hh | 26 +++++++++++++++++++------- - 1 file changed, 19 insertions(+), 7 deletions(-) + Merge branch 'master' into cff-subset commit bd75fd45cdbd0edb24568326bb7fde59d299a82c Author: Behdad Esfahbod @@ -16258,6 +20497,17 @@ Date: Thu Jan 25 14:22:03 2018 -0500 src/hb-ot-shape.cc | 1 + 6 files changed, 37 insertions(+), 10 deletions(-) +commit c6f75c3049685440d166bd4169b36abac2df4fdd +Author: Michiharu Ariza +Date: Mon Sep 10 17:02:31 2018 -0700 + + fix build attempt + + src/hb-ot-cff1-table.hh | 70 + ++++++++++++++++++++++++------------------------- + src/hb-subset-cff1.cc | 16 +++++------ + 2 files changed, 43 insertions(+), 43 deletions(-) + commit 96471fe8593575deceb44d3757c227f65f10a25e Author: Behdad Esfahbod Date: Tue Sep 11 01:39:23 2018 +0200 @@ -16267,6 +20517,20 @@ Date: Tue Sep 11 01:39:23 2018 +0200 src/hb-uniscribe.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +commit cc52e53cf0cb76809145ae7407a8b613e9e61153 +Author: Michiharu Ariza +Date: Mon Sep 10 16:27:49 2018 -0700 + + Removed unused subr subset code + + src/hb-subset-cff-common.hh | 98 + ++------------------------------------------- + src/hb-subset-cff1.cc | 92 + +++++------------------------------------- + src/hb-subset-cff2.cc | 90 + ++++------------------------------------- + 3 files changed, 22 insertions(+), 258 deletions(-) + commit becd84aa2f2902ea9d2d1677b28945e103a68816 Author: Behdad Esfahbod Date: Tue Sep 11 01:26:18 2018 +0200 @@ -16325,6 +20589,27 @@ Date: Mon Sep 10 23:29:26 2018 +0200 src/hb-ot-post-table.hh | 5 +++-- 15 files changed, 113 insertions(+), 110 deletions(-) +commit 1666b89e300c86347dc82131423463cbfed8cc0f +Author: Michiharu Ariza +Date: Mon Sep 10 16:00:20 2018 -0700 + + subset CFF1 String Index + + Repurposed FDMap as Remap then subclassed for remapping SIDs + misc code cleanup + + src/hb-cff-interp-common.hh | 2 - + src/hb-cff-interp-dict-common.hh | 12 +- + src/hb-ot-cff-common.hh | 96 +++++++++-- + src/hb-ot-cff1-table.hh | 251 +++++++++++++++++++---------- + src/hb-ot-cff2-table.hh | 12 +- + src/hb-subset-cff-common.cc | 24 +-- + src/hb-subset-cff-common.hh | 20 ++- + src/hb-subset-cff1.cc | 334 + ++++++++++++++++++++++++++++++++------- + src/hb-subset-cff2.cc | 8 +- + 9 files changed, 565 insertions(+), 194 deletions(-) + commit 9507b05a7a65962d5d02eb424e4f5d8570976f4e Author: Behdad Esfahbod Date: Mon Sep 10 23:18:07 2018 +0200 @@ -16518,6 +20803,13 @@ Date: Fri Sep 7 15:02:57 2018 -0400 src/hb-set.hh | 12 ++++++------ 8 files changed, 18 insertions(+), 18 deletions(-) +commit 1e88b1755c37eaa171c08f7bedb93f110238c80f +Merge: 22b88632 ebe67137 +Author: Michiharu Ariza +Date: Fri Sep 7 10:50:55 2018 -0700 + + Merge branch 'master' into cff-subset + commit ebe67137ab3559c2c6aaf53442ca223cb34df5af Author: Behdad Esfahbod Date: Fri Sep 7 10:46:13 2018 -0400 @@ -16536,6 +20828,58 @@ Date: Fri Sep 7 10:24:22 2018 -0400 src/hb-subset.cc | 3 +++ 1 file changed, 3 insertions(+) +commit 22b88632d5bd3676642b0a1d93f27e47438c140b +Merge: 2a74536a 21bf1470 +Author: Michiharu Ariza +Date: Thu Sep 6 22:27:44 2018 -0700 + + Merge branch 'master' into cff-subset + +commit 2a74536aae443a8b7f23ed018dec14a013c04dfe +Author: Michiharu Ariza +Date: Thu Sep 6 18:26:13 2018 -0700 + + fix build attempt ^2 + + Added hb-ot-cff1-table.cc to hb-subset sources + Deleted unused variable (charset) + + src/Makefile.sources | 1 + + src/hb-subset-cff1.cc | 1 - + 2 files changed, 1 insertion(+), 1 deletion(-) + +commit 55268df9d4b287883c8266e316cda44f4011f424 +Author: Michiharu Ariza +Date: Thu Sep 6 17:56:05 2018 -0700 + + fix build attempt + + Added HB_INTERNAL to static funtion declarations + + src/hb-ot-cff1-table.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit aca73c9df2054f62cf10a5c27bc5fa7823747f8b +Author: Michiharu Ariza +Date: Thu Sep 6 17:28:15 2018 -0700 + + subset CFF1 Encoding & Charset + + fixed misc Charset bugs + added source file hb-ot-cff1.table.cc + renamed things for clarity & consistency + + src/Makefile.sources | 1 + + src/hb-cff-interp-dict-common.hh | 15 +- + src/hb-ot-cff-common.hh | 34 ++-- + src/hb-ot-cff1-table.cc | 130 +++++++++++++ + src/hb-ot-cff1-table.hh | 403 + ++++++++++++++++++++++++++++++++------- + src/hb-ot-cff2-table.hh | 24 +-- + src/hb-subset-cff1.cc | 247 ++++++++++++++++++++---- + src/hb-subset-cff2.cc | 30 +-- + 8 files changed, 737 insertions(+), 147 deletions(-) + commit 21bf147054f6b5bd1c430c0e02a8c4058ed229a1 Author: Garret Rieger Date: Wed Sep 5 18:04:52 2018 -0700 @@ -16585,6 +20929,43 @@ Date: Mon Sep 3 20:50:11 2018 -0700 src/hb-vector.hh | 2 ++ 4 files changed, 81 insertions(+), 25 deletions(-) +commit 5ea03d2951375bfcc1258c2c0b5c33efc6ebf7f8 +Author: Michiharu Ariza +Date: Tue Sep 4 11:29:15 2018 -0700 + + fix build by untemplatizing DictOpSet & DictVal + + as they aren't instantiated with BlendArg (yet) + + src/hb-cff-interp-dict-common.hh | 21 +++++++++------------ + src/hb-cff2-interp-cs.hh | 1 - + src/hb-ot-cff1-table.hh | 8 ++++---- + src/hb-ot-cff2-table.hh | 16 ++++++++-------- + src/hb-subset-cff-common.hh | 4 ++-- + 5 files changed, 23 insertions(+), 27 deletions(-) + +commit f2d299b0b75fd110cdc6b16de31e7212e292cc14 +Author: Michiharu Ariza +Date: Tue Sep 4 10:25:21 2018 -0700 + + Drop hints from CFF2 charstrings + + Templatized ArgStack so it may store the default value along with + blend deltas as BlendArg while parsing blend operator arguments in + CFF2 charstring + Added get_region_count() method to VarRegionList & VariationStore + + src/hb-cff-interp-common.hh | 67 +++++++++++++++++++++++++++------ + src/hb-cff1-interp-cs.hh | 5 ++- + src/hb-cff2-interp-cs.hh | 91 + +++++++++++++++++++++++++++++++++++++++------ + src/hb-ot-cff2-table.hh | 22 ++++++----- + src/hb-ot-layout-common.hh | 6 +++ + src/hb-subset-cff-common.hh | 60 ++++++++++++++++-------------- + src/hb-subset-cff1.cc | 5 ++- + src/hb-subset-cff2.cc | 54 ++++++++++++++++++++++----- + 8 files changed, 235 insertions(+), 75 deletions(-) + commit 3f00d0b0df14d69859b15568ff28a810d08f59ea Author: Behdad Esfahbod Date: Mon Sep 3 18:54:32 2018 -0700 @@ -16767,6 +21148,46 @@ Date: Fri Aug 31 16:31:00 2018 -0700 src/hb-subset.hh | 21 +++++++++++++++++++++ 9 files changed, 31 insertions(+), 6 deletions(-) +commit fcf177885b4c3d732ffeb82936da906969a269d3 +Author: Michiharu Ariza +Date: Fri Aug 31 16:28:47 2018 -0700 + + templatized ArgStack as a prep to store blends + + src/hb-cff-interp-common.hh | 46 + +++++++++++++++++++++--------------- + src/hb-cff-interp-cs-common.hh | 41 ++++++++++++++++++-------------- + src/hb-cff-interp-dict-common.hh | 35 ++++++++++++++++----------- + src/hb-cff1-interp-cs.hh | 15 +++++++----- + src/hb-cff2-interp-cs.hh | 14 +++++++---- + src/hb-ot-cff1-table.hh | 32 ++++++++++++------------- + src/hb-ot-cff2-table.hh | 51 + ++++++++++++++++++++++++++-------------- + src/hb-subset-cff-common.hh | 4 ++-- + src/hb-subset-cff1.cc | 1 - + src/hb-subset-cff2.cc | 2 +- + 10 files changed, 142 insertions(+), 99 deletions(-) + +commit 968168bf0e369927cd6a7f63608d844abe123a7b +Author: Michiharu Ariza +Date: Fri Aug 31 13:28:16 2018 -0700 + + drop hints from CFF1 charstrings + + renamed confusing Stack.size to Stack.count + + src/hb-cff-interp-common.hh | 43 +++++++----- + src/hb-cff-interp-cs-common.hh | 140 + +++++++++++++++++---------------------- + src/hb-cff-interp-dict-common.hh | 4 +- + src/hb-cff1-interp-cs.hh | 14 ++-- + src/hb-cff2-interp-cs.hh | 18 ++--- + src/hb-ot-cff1-table.hh | 26 ++++---- + src/hb-ot-cff2-table.hh | 20 +++--- + src/hb-subset-cff1.cc | 53 ++++++++------- + src/hb-subset-cff2.cc | 69 +++++++++---------- + 9 files changed, 190 insertions(+), 197 deletions(-) + commit aba0a945c5f8724cc7bd1a9b7f7b5df1c64b03f4 Author: Behdad Esfahbod Date: Fri Aug 31 13:25:19 2018 -0700 @@ -16800,6 +21221,19 @@ Date: Fri Aug 31 13:00:57 2018 -0700 src/hb-ot-shape-complex-arabic-fallback.hh | 1 - 1 file changed, 1 deletion(-) +commit 8c5e03b5415f83312719ebb3cd284229e52a4843 +Author: Michiharu Ariza +Date: Thu Aug 30 17:21:56 2018 -0700 + + Added drop_hints to SubrFlattener + + src/hb-cff-interp-cs-common.hh | 20 +++++++++++++++++++- + src/hb-subset-cff-common.hh | 18 ++++++++++++++---- + src/hb-subset-cff1.cc | 35 ++++++++++++++++++++++------------ + src/hb-subset-cff2.cc | 43 + ++++++++++++++++++++++++++---------------- + 4 files changed, 83 insertions(+), 33 deletions(-) + commit a23b892fe6cc4859a30edc7ffc003ab7624aa5f0 Author: Behdad Esfahbod Date: Wed Aug 29 18:28:39 2018 -0700 @@ -16828,6 +21262,22 @@ Date: Wed Aug 29 18:24:03 2018 -0700 util/hb-subset.cc | 3 +-- 9 files changed, 52 insertions(+), 49 deletions(-) +commit 9fd08cc238f8e2f7be1eaefca110021382efe606 +Author: Michiharu Ariza +Date: Wed Aug 29 18:18:18 2018 -0700 + + CFF2 subroutine flattner + + Factored out CFF1 & CFF2 common subsetting code in + hb-subset-cff-common.hh + + src/hb-cff2-interp-cs.hh | 34 +++++-- + src/hb-subset-cff-common.hh | 154 +++++++++++++++++++++++++++++ + src/hb-subset-cff1.cc | 135 +++----------------------- + src/hb-subset-cff2.cc | 229 + ++++++++++++++++++-------------------------- + 4 files changed, 285 insertions(+), 267 deletions(-) + commit d237ce71810045ee400c52740cd8ab6e1113aada Author: Behdad Esfahbod Date: Wed Aug 29 18:13:07 2018 -0700 @@ -16885,6 +21335,72 @@ Date: Wed Aug 29 22:37:39 2018 +0100 -------------------------------------------------------------- 1 file changed, 157 deletions(-) +commit b95bf075d7b62baf7d6fa1d8f0d1f16fad934975 +Author: Michiharu Ariza +Date: Wed Aug 29 14:41:52 2018 -0700 + + fix build attempt ^2 + + src/hb-subset-cff1.cc | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 1d1afddfd21155ef136c2d96b1d6c286bdc8925f +Author: Michiharu Ariza +Date: Wed Aug 29 13:36:39 2018 -0700 + + corrected preprocessor guards + + src/hb-cff-interp-common.hh | 6 +++--- + src/hb-cff-interp-cs-common.hh | 6 +++--- + src/hb-cff-interp-dict-common.hh | 6 +++--- + src/hb-ot-cff-common.hh | 6 +++--- + src/hb-subset-cff-common.hh | 6 +++--- + 5 files changed, 15 insertions(+), 15 deletions(-) + +commit 8af9690ac7ce41fb1db878d556df5c4ee624eaa0 +Merge: 0ad081ec fee0f41c +Author: Michiharu Ariza +Date: Wed Aug 29 13:26:17 2018 -0700 + + Merge branch 'master' into cff-subset + + Renamed cff "private" source/headers without the suffix + +commit 0ad081ec324e734cfca60d4d2c36a1be5bc8a067 +Author: Michiharu Ariza +Date: Wed Aug 29 12:56:48 2018 -0700 + + attempt to fix build failure + + src/hb-subset-cff1.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit a11420b48c405e1a43e2ba62893e9a0872e5f496 +Author: Michiharu Ariza +Date: Wed Aug 29 12:14:30 2018 -0700 + + Subroutine flattener for CFF1 + + Subr-flattened charstrings are temporarily re-encoded in ByteStrBuff + during "plan" phase, then copied to hb_serialize_context_t during + "write" phase + + CSOpSet may callback opcode processing "virtual" functions via CRTP + + Numer struct may store a value as fixed optionally in addition to + int and float + + src/hb-cff-interp-common-private.hh | 53 ++++++++++-- + src/hb-cff-interp-cs-common-private.hh | 109 ++++++++++++++++++----- + src/hb-cff1-interp-cs.hh | 35 +++++--- + src/hb-cff2-interp-cs.hh | 14 +-- + src/hb-ot-cff-common-private.hh | 10 +-- + src/hb-subset-cff-common-private.hh | 102 +++++++++++++++++++++- + src/hb-subset-cff1.cc | 152 + ++++++++++++++++++++++----------- + src/hb-subset-cff2.cc | 7 +- + 8 files changed, 372 insertions(+), 110 deletions(-) + commit fee0f41c6c1e50621d10b07802ca36a9b295b53d Author: Behdad Esfahbod Date: Tue Aug 28 18:27:41 2018 -0700 @@ -17629,6 +22145,230 @@ Date: Wed Aug 15 20:12:25 2018 -0700 src/hb-ot-var.cc | 4 +- 10 files changed, 71 insertions(+), 91 deletions(-) +commit 27c32d8afbdf5b587b14f3b194f79882680348ba +Author: Michiharu Ariza +Date: Wed Aug 22 11:36:39 2018 -0700 + + fixed "Fixed" number decoding + + src/hb-cff-interp-common-private.hh | 11 ++++++++++- + src/hb-cff-interp-cs-common-private.hh | 4 ++-- + 2 files changed, 12 insertions(+), 3 deletions(-) + +commit 811a651bbd3f1bda7ed8eaee9af8e9dbbc8f80de +Author: Michiharu Ariza +Date: Mon Aug 20 14:04:46 2018 -0700 + + fixed bugs with empty CFFIndex, fullset FDMap + + src/hb-ot-cff-common-private.hh | 21 ++++++++++++++++++--- + 1 file changed, 18 insertions(+), 3 deletions(-) + +commit 5cde2f55cd2f8917954f3a3f60bd571c86b3aa59 +Author: Michiharu Ariza +Date: Fri Aug 17 16:50:13 2018 -0700 + + drop hints from CFF & CFF2 Private + + src/hb-cff-interp-dict-common-private.hh | 24 ++++++++++++++ + src/hb-subset-cff1.cc | 53 + +++++++++++++++++++++++++++--- + src/hb-subset-cff2.cc | 55 + +++++++++++++++++++++++++++++--- + 3 files changed, 123 insertions(+), 9 deletions(-) + +commit cef75ea41a513a612a683bced27ced31761204b5 +Author: Michiharu Ariza +Date: Fri Aug 17 13:13:18 2018 -0700 + + Added CFF2 Subr nullifier + + along with CFF2 charstring interpreter + factored out common code between CFF1 & CFF2 to CSInterpreter + moved fetch_op from Interpreter to InterpEnv + misc code clean up & bug fixes + + src/Makefile.sources | 1 + + src/hb-cff-interp-common-private.hh | 44 +++++++-------- + src/hb-cff-interp-cs-common-private.hh | 95 + +++++++++++++++++++++++++++++-- + src/hb-cff-interp-dict-common-private.hh | 3 +- + src/hb-cff1-interp-cs.hh | 82 --------------------------- + src/hb-cff2-interp-cs.hh | 97 + ++++++++++++++++++++++++++++++++ + src/hb-ot-cff-common-private.hh | 4 ++ + src/hb-ot-cff2-table.hh | 7 ++- + src/hb-subset-cff1.cc | 1 + + src/hb-subset-cff2.cc | 62 ++++++++++++++++++-- + 10 files changed, 278 insertions(+), 118 deletions(-) + +commit f57d6bcbca276cec54d1e5308c308265e8e983b9 +Author: Michiharu Ariza +Date: Thu Aug 16 08:03:46 2018 -0700 + + renamed CFF::Index to CFF::CFFIndex + + to avoid confusion with OT::Index + + src/hb-ot-cff-common-private.hh | 38 + +++++++++++++++++++------------------- + src/hb-ot-cff1-table.hh | 4 ++-- + src/hb-ot-cff2-table.hh | 2 +- + src/hb-subset-cff2.cc | 4 ++-- + 4 files changed, 24 insertions(+), 24 deletions(-) + +commit c4ae426a3d3f9411b94d35745ca0e14677cd7bdb +Author: Michiharu Ariza +Date: Thu Aug 16 00:59:46 2018 -0700 + + treat h/vstem the same as h/vstemhm + + src/hb-cff1-interp-cs.hh | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit e67bb3fbcf39385ea1db136aeca61291364fb75b +Author: Michiharu Ariza +Date: Thu Aug 16 00:25:57 2018 -0700 + + renamed OT::cff to OT::cff1 for consistency + + along with HB_OT_TAG_cff1 + + src/hb-ot-cff1-table.hh | 14 +++++++------- + src/hb-subset-cff1.cc | 16 ++++++++-------- + src/hb-subset.cc | 4 ++-- + 3 files changed, 17 insertions(+), 17 deletions(-) + +commit fdbfa1848b2f279c0f7a885bc1a985fa3375cfcd +Author: Michiharu Ariza +Date: Thu Aug 16 00:13:09 2018 -0700 + + renamed CFF version 1 structs and sources to CFF1 from CFF + + "CFF" is used for shared structs & sources between CFF1 & CFF2 + except OT:cff is for CFF version 1 table + + src/Makefile.sources | 8 +- + src/{hb-cff-interp-cs.hh => hb-cff1-interp-cs.hh} | 22 ++-- + src/{hb-ot-cff-table.hh => hb-ot-cff1-table.hh} | 150 + +++++++++++----------- + src/hb-ot-font.cc | 2 +- + src/{hb-subset-cff.cc => hb-subset-cff1.cc} | 86 ++++++------- + src/{hb-subset-cff.hh => hb-subset-cff1.hh} | 8 +- + src/hb-subset.cc | 2 +- + 7 files changed, 139 insertions(+), 139 deletions(-) + +commit 867f68bd8a74634ac6220bd76c8bafe3e2226041 +Author: Michiharu Ariza +Date: Wed Aug 15 15:53:50 2018 -0700 + + fix build attempt ^7 + + src/hb-subset-cff2.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 685db67bb07505729fdb997129ffd068bbe3c40d +Author: Michiharu Ariza +Date: Wed Aug 15 15:45:17 2018 -0700 + + fix build attempt ^6 + + src/hb-subset-cff2.cc | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 2810caafeb9a621d53653f454dab0fa3e7f5c4a3 +Author: Michiharu Ariza +Date: Wed Aug 15 15:30:24 2018 -0700 + + fix build attempt ^5 + + src/hb-subset-cff2.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 25b8310b2a3e074c9d1d723ab6d10a29f8d189be +Merge: 7aa23f35 22defe09 +Author: Michiharu Ariza +Date: Wed Aug 15 15:00:55 2018 -0700 + + Merge branch 'master' into cff-subset + +commit 7aa23f3597e4783b88ad526021cc4cafc05395f2 +Author: Michiharu Ariza +Date: Wed Aug 15 15:00:32 2018 -0700 + + fix build attempt ^4 + + src/hb-cff-interp-cs.hh | 10 +++++----- + src/hb-subset-cff.cc | 2 +- + 2 files changed, 6 insertions(+), 6 deletions(-) + +commit 270452a44653773b3dc584729ec438ff922e2739 +Author: Michiharu Ariza +Date: Wed Aug 15 13:15:08 2018 -0700 + + fix build attempt ^3 + + src/hb-cff-interp-common-private.hh | 2 -- + src/hb-cff-interp-cs-common-private.hh | 1 + + src/hb-cff-interp-cs.hh | 1 + + src/hb-subset-cff.cc | 2 +- + 4 files changed, 3 insertions(+), 3 deletions(-) + +commit c234839f25e68700c3489c55fda2773f2e00eecb +Author: Michiharu Ariza +Date: Wed Aug 15 13:04:43 2018 -0700 + + fix build attempt ^2 + + src/hb-cff-interp-common-private.hh | 2 ++ + src/hb-cff-interp-cs-common-private.hh | 6 +++--- + src/hb-cff-interp-cs.hh | 6 +++--- + src/hb-cff-interp-dict-common-private.hh | 6 +++--- + src/hb-subset-cff.cc | 6 +++--- + 5 files changed, 14 insertions(+), 12 deletions(-) + +commit eab07e713a67da2c5b368c59808f7e2db1cf0b0b +Author: Michiharu Ariza +Date: Wed Aug 15 12:15:55 2018 -0700 + + fix build + + src/Makefile.sources | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 633ce88de93f5c565ee7fb8acdbd93c57779524b +Author: Michiharu Ariza +Date: Wed Aug 15 12:00:19 2018 -0700 + + CFF Subrs subsetting + + Unreferenced subroutines are nullified (not removed) in a subset font + + Separate Interpreter struct from hb-ot-cff-common-private.hh in a + set of four header files, augmented for CharString (CS): + hb-cff-interp-common-private.hh + hb-cff-interp-dict-common-private.hh + hb-cff-interp-cs-common-private.hh + hb-cff-interp-cs.hh + + Interpreter runtime is separated off as a new struct InterpEnv + sub-classed differently for Dict and CharString (CS) + + src/Makefile.sources | 8 +- + src/hb-cff-interp-common-private.hh | 581 + +++++++++++++++++++++++++++++++ + src/hb-cff-interp-cs-common-private.hh | 174 +++++++++ + src/hb-cff-interp-cs.hh | 282 +++++++++++++++ + src/hb-cff-interp-dict-common-private.hh | 183 ++++++++++ + src/hb-ot-cff-common-private.hh | 562 + ++---------------------------- + src/hb-ot-cff-table.hh | 165 ++++----- + src/hb-ot-cff2-table.hh | 147 ++++---- + src/hb-subset-cff-common-private.hh | 83 +++++ + src/hb-subset-cff.cc | 118 +++++-- + src/hb-subset-cff2.cc | 38 +- + 11 files changed, 1585 insertions(+), 756 deletions(-) + commit 22defe0965adddaa09eebc13df7fa6c64e2abba3 Author: Emil A Eklund Date: Tue Aug 14 14:47:20 2018 -0700 @@ -17953,6 +22693,64 @@ Date: Thu Aug 9 15:16:32 2018 +0700 src/hb-common.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +commit a3a8c85b027779365bb33e2063221b4650fbac3b +Merge: 145f371d 652cd45c +Author: Michiharu Ariza +Date: Fri Aug 10 13:41:42 2018 -0700 + + Merge branch 'master' into cff-subset + +commit 145f371d71965b86635025c73117db0e24f2df75 +Author: Michiharu Ariza +Date: Fri Aug 10 13:07:53 2018 -0700 + + fixed TRACE build failure + + src/hb-ot-cff-common-private.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a97ed342d18bdb262400c8ab6501df110fe4e18f +Author: Michiharu Ariza +Date: Fri Aug 10 12:55:22 2018 -0700 + + fixed inclusion of excluded Private & local Subrs + + It was bloating a multi-FD subset font unnecessarily + defined a wrapper struct FDMap for fdmap + + src/hb-ot-cff-common-private.hh | 34 ++++++++++++++++++++----- + src/hb-subset-cff-common-private.cc | 6 ++--- + src/hb-subset-cff-common-private.hh | 4 +-- + src/hb-subset-cff.cc | 48 + +++++++++++++++++++---------------- + src/hb-subset-cff2.cc | 50 + ++++++++++++++++++++----------------- + 5 files changed, 87 insertions(+), 55 deletions(-) + +commit 64c541226457907ec1801a5766050ee64feb67e8 +Author: Michiharu Ariza +Date: Fri Aug 10 11:07:07 2018 -0700 + + Added CFF support + + Added sources hb-ot-cff-table.hh, hb-subset-cff.cc & hh + Templatized Index because CFF uses 16-bit count while CFF2 uses 32-bit + Misc code cleanup & bug fixes + + src/Makefile.sources | 9 +- + src/hb-ot-cff-common-private.hh | 477 ++++++++++++------- + src/hb-ot-cff-table.hh | 919 + ++++++++++++++++++++++++++++++++++++ + src/hb-ot-cff2-table.hh | 235 ++++----- + src/hb-ot-font.cc | 1 + + src/hb-subset-cff-common-private.cc | 6 +- + src/hb-subset-cff-common-private.hh | 4 +- + src/hb-subset-cff.cc | 560 ++++++++++++++++++++++ + src/hb-subset-cff.hh | 38 ++ + src/hb-subset-cff2.cc | 104 ++-- + src/hb-subset.cc | 4 + + 11 files changed, 1991 insertions(+), 366 deletions(-) + commit 652cd45c650b1cdce2585dcee614e5a9cdda530c Author: Behdad Esfahbod Date: Thu Aug 9 01:02:02 2018 -0700 @@ -18205,6 +23003,53 @@ Date: Mon Aug 6 15:32:13 2018 -0700 src/hb-iter-private.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +commit 161ece4c3097096f355dc5ea514320a8dc678bea +Merge: e8d695eb 79e21984 +Author: Michiharu Ariza +Date: Mon Aug 6 11:23:50 2018 -0700 + + Merge branch 'master' into cff-subset + +commit e8d695ebaa4b5d36d907042fb6930244e87b1e29 +Author: Michiharu Ariza +Date: Mon Aug 6 11:13:06 2018 -0700 + + removed CMakeCache.txt + + build/CMakeCache.txt | 1 - + 1 file changed, 1 deletion(-) + +commit 9fae33b9f3fd7fce816c3db71089db4ce0c82d4c +Author: Michiharu Ariza +Date: Mon Aug 6 10:44:12 2018 -0700 + + Silence Codacy + + build/CMakeCache.txt | 1 + + src/hb-subset-cff-common-private.cc | 8 +++++--- + src/hb-subset-cff2.cc | 4 +++- + 3 files changed, 9 insertions(+), 4 deletions(-) + +commit 5561b818498431adb52f958d1e9589620f0e6539 +Author: Michiharu Ariza +Date: Mon Aug 6 10:04:53 2018 -0700 + + subset FDSelect and FDArray + + Added a set of sources hb-subset-cff-common-private.cc & .hh for + FDSelect subseting code. + Added FDSelect format 4 (CFF2 only) support. Shared its implementation + with format 3 as a template. + + src/Makefile.sources | 2 + + src/hb-ot-cff-common-private.hh | 130 ++++++++++++++++------- + src/hb-ot-cff2-table.hh | 71 ++++++++++++- + src/hb-subset-cff-common-private.cc | 200 + ++++++++++++++++++++++++++++++++++++ + src/hb-subset-cff-common-private.hh | 54 ++++++++++ + src/hb-subset-cff2.cc | 71 ++++++++++--- + 6 files changed, 476 insertions(+), 52 deletions(-) + commit 79e21984b13bdb879f3007ba9a97fde47df340d3 Author: Behdad Esfahbod Date: Mon Aug 6 09:45:17 2018 -0700 @@ -18498,6 +23343,34 @@ Date: Fri Aug 3 16:22:16 2018 -0700 src/hb-ot-var.cc | 4 ++-- 7 files changed, 27 insertions(+), 26 deletions(-) +commit cc3f4e00aa5da1d9f0430adefe30689b3daa8282 +Author: Michiharu Ariza +Date: Fri Aug 3 15:00:37 2018 -0700 + + silence gcc + + src/hb-ot-cff2-table.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 00970dd2420c3dcc58c25568be4abe6586c159df +Author: Michiharu Ariza +Date: Fri Aug 3 14:35:09 2018 -0700 + + Removed parsed hint fields from CFF2PrivateDictValues + + Instead moved & stored uniformly in values vector (renamed from + opstrs) + This should be fine as we aren't likely going to use them as hints + after all + Templatized DictValues whether to parse them out + For subsetter, they aren't parsed + + src/hb-ot-cff-common-private.hh | 113 ++++++++++++++---------- + src/hb-ot-cff2-table.hh | 185 + ++++++++++++---------------------------- + src/hb-subset-cff2.cc | 2 +- + 3 files changed, 120 insertions(+), 180 deletions(-) + commit 6a0a298aabe777e2c1ed443f100fe6142c83e3b3 Author: Behdad Esfahbod Date: Thu Aug 2 23:13:19 2018 -0700 @@ -18541,6 +23414,66 @@ Date: Thu Aug 2 20:04:37 2018 -0700 src/hb-ot-font.cc | 41 ++++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) +commit 76f7397c10832b891a082e30afc74222bd5ffd7b +Author: Michiharu Ariza +Date: Thu Aug 2 16:28:10 2018 -0700 + + templatized CFF2 accelerator for lean Private dict interpretting + for subset + + also fixed local subrs serialization + + src/hb-ot-cff-common-private.hh | 8 ++- + src/hb-ot-cff2-table.hh | 119 + ++++++++++++++++++++++++++++++++-------- + src/hb-subset-cff2.cc | 13 +++-- + 3 files changed, 109 insertions(+), 31 deletions(-) + +commit 43040564e661fdd616d39e84fde07612d55bb785 +Author: Michiharu Ariza +Date: Thu Aug 2 12:23:10 2018 -0700 + + removed TRACE_SERIALIZE from non-member function _write_cff2 + + src/hb-subset-cff2.cc | 29 ++++++++++++++--------------- + 1 file changed, 14 insertions(+), 15 deletions(-) + +commit e2fd49e4779663e3138bd1990736a9cf850303bf +Merge: 693ae804 d4d1bf81 +Author: Michiharu Ariza +Date: Thu Aug 2 11:39:22 2018 -0700 + + Merge branch 'master' into cff-subset + +commit 693ae804743c60968d4339465fa6480e0ed8396c +Author: Michiharu Ariza +Date: Thu Aug 2 11:22:42 2018 -0700 + + more silencing fixes + + src/hb-ot-cff2-table.hh | 2 +- + src/hb-subset-cff2.cc | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +commit f6da44983178e345ddbac1bcd1691ddb330399c6 +Author: Michiharu Ariza +Date: Thu Aug 2 10:52:08 2018 -0700 + + silence archlinux + + src/hb-ot-cff-common-private.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 58279c3db4f31bf3f9a509d1d88bca01b57c6b81 +Author: Michiharu Ariza +Date: Thu Aug 2 10:18:01 2018 -0700 + + silence Codacy + + src/hb-ot-cff-common-private.hh | 25 +++++++++++++++++++------ + src/hb-ot-cff2-table.hh | 14 +++++++------- + 2 files changed, 26 insertions(+), 13 deletions(-) + commit 574b37e933f98e35c2bdae04458a95522bbfbb82 Author: Behdad Esfahbod Date: Thu Aug 2 02:22:38 2018 -0700 @@ -18695,6 +23628,38 @@ Date: Wed Aug 1 17:53:30 2018 -0700 src/hb-shaper-private.hh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) +commit 19ce0b24c0173fed11104a8ab039e856cbf40924 +Author: Michiharu Ariza +Date: Wed Aug 1 17:34:59 2018 -0700 + + removed unused field OpStr::update + + src/hb-ot-cff-common-private.hh | 4 +--- + src/hb-ot-cff2-table.hh | 22 +++++++++++----------- + 2 files changed, 12 insertions(+), 14 deletions(-) + +commit 3bda54c43b248ee2bc18a9210fb4d880bb4d82ac +Author: Michiharu Ariza +Date: Wed Aug 1 16:32:27 2018 -0700 + + fixed Index::serialize + + The bug was causing CharString of the last glyph corrupt + + src/hb-ot-cff-common-private.hh | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 16f4dc9b73a197a5ab0ad29dcf5a7ed7495ec4e1 +Author: Michiharu Ariza +Date: Wed Aug 1 16:06:52 2018 -0700 + + fixed CFF2VariationStore::serialize + + also get_size + + src/hb-ot-cff2-table.hh | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + commit 44d1fb37efa20852cc466c0f0bba95dbd24ce288 Author: Behdad Esfahbod Date: Wed Aug 1 14:51:51 2018 -0700 @@ -18762,6 +23727,24 @@ Date: Thu Aug 2 00:11:43 2018 +0430 appveyor.yml | 1 + 1 file changed, 1 insertion(+) +commit b2ff582c8c1a0fea60ee323dc820ce6fe807b063 +Author: Michiharu Ariza +Date: Wed Aug 1 11:30:38 2018 -0700 + + Implemented hb_subset_cff2 + + Added serialize functions to CFF2 structs + Fixed issues & bugs & code cleanup + Now subsetting CFF2 table outputs something + + src/hb-ot-cff-common-private.hh | 428 + +++++++++++++++++++++++++++++++++++----- + src/hb-ot-cff2-table.hh | 237 +++++++++++++++++----- + src/hb-private.hh | 2 +- + src/hb-subset-cff2.cc | 392 + +++++++++++++++++++++++++++++++----- + 4 files changed, 914 insertions(+), 145 deletions(-) + commit 1a7fed631880fff8a947ebec9c7427efff581916 Author: Ebrahim Byagowi Date: Wed Aug 1 12:15:44 2018 +0430 @@ -19517,6 +24500,37 @@ Date: Mon Jul 30 16:59:41 2018 -0700 src/hb-machinery-private.hh | 6 ------ 1 file changed, 6 deletions(-) +commit 8782f80cce147c101b605501d9fd9c7d64338314 +Author: Michiharu Ariza +Date: Mon Jul 30 15:27:20 2018 -0700 + + fixed FDSelect0::sanitize + + src/hb-ot-cff-common-private.hh | 1 + + 1 file changed, 1 insertion(+) + +commit 9c4cadaef01733b32ab6190dd91552ee7145f3c3 +Author: Michiharu Ariza +Date: Mon Jul 30 14:28:40 2018 -0700 + + Added sanitize functions & calls + + Added sanitize functions to FDSelect + Added satnitize calls for FDSelect, VariationStore, FDArray, TopDict + + src/hb-ot-cff-common-private.hh | 67 + ++++++++++++++++++++++++++++++++--------- + src/hb-ot-cff2-table.hh | 26 +++++++++++----- + src/hb-subset-cff2.cc | 2 +- + 3 files changed, 72 insertions(+), 23 deletions(-) + +commit 161b642ec5babc7e4b81d41f725d81ad2caa9330 +Merge: 3a61c3e9 5edf454a +Author: Michiharu Ariza +Date: Mon Jul 30 12:22:09 2018 -0700 + + Merge branch 'master' into cff-subset + commit 5edf454aa64aad461c90bd991e7eaf27668b7e6b Author: Garret Rieger Date: Thu Jul 26 17:42:02 2018 -0700 @@ -19863,6 +24877,25 @@ Date: Sat Jul 21 21:14:48 2018 +0430 src/hb-ot-layout.h | 8 ++++ 4 files changed, 109 insertions(+) +commit 3a61c3e935cf649ba65ef0cb4daa9f06ab5d3c0a +Author: Michiharu Ariza +Date: Wed Jul 18 14:17:52 2018 -0700 + + first push of CFF/CFF2 work + + Index, Dict structs + hooked up to hb-subset (takes CFF2, outputs empty CFF2) + + src/Makefile.sources | 4 + + src/hb-ot-cff-common-private.hh | 475 + ++++++++++++++++++++++++++++++++++++++++ + src/hb-ot-cff2-table.hh | 386 ++++++++++++++++++++++++++++++++ + src/hb-ot-font.cc | 2 + + src/hb-subset-cff2.cc | 121 ++++++++++ + src/hb-subset-cff2.hh | 38 ++++ + src/hb-subset.cc | 4 + + 7 files changed, 1030 insertions(+) + commit 93b65d9fe331a217640069fad4159cb7c3ec35e6 Author: Ebrahim Byagowi Date: Tue Jul 17 23:29:16 2018 +0430 diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/NEWS b/Build/source/libs/harfbuzz/harfbuzz-src/NEWS index ff4f6e29df2..890c258d83c 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/NEWS +++ b/Build/source/libs/harfbuzz/harfbuzz-src/NEWS @@ -1,3 +1,18 @@ +Overview of changes leading to 2.3.0 +Thursday, December 20, 2018 +==================================== +- Fix regression on big-endian architectures. Ouch! +- Misc bug and build fixes. +- Fix subsetting of simple GSUB/GDEF. +- Merge CFF / CFF2 support contributed by Adobe. This mostly involves + the subsetter, but also get_glyph_extents on CFF fonts. + +New API in hb-aat.h: ++hb_aat_layout_has_substitution() ++hb_aat_layout_has_positioning() ++hb_aat_layout_has_tracking() + + Overview of changes leading to 2.2.0 Thursday, November 29, 2018 ==================================== diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/config.h.in b/Build/source/libs/harfbuzz/harfbuzz-src/config.h.in index 029518d7c83..7faa9fdd3a6 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/config.h.in +++ b/Build/source/libs/harfbuzz/harfbuzz-src/config.h.in @@ -182,28 +182,6 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS -/* Enable extensions on AIX 3, Interix. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif -/* Enable threading extensions on Solaris. */ -#ifndef _POSIX_PTHREAD_SEMANTICS -# undef _POSIX_PTHREAD_SEMANTICS -#endif -/* Enable extensions on HP NonStop. */ -#ifndef _TANDEM_SOURCE -# undef _TANDEM_SOURCE -#endif -/* Enable general extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ -#endif - - /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 @@ -214,13 +192,3 @@ /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES - -/* Define to 1 if on MINIX. */ -#undef _MINIX - -/* Define to 2 if the system does not provide POSIX.1 features except with - this defined. */ -#undef _POSIX_1_SOURCE - -/* Define to 1 if you need to in order for `stat' and other things to work. */ -#undef _POSIX_SOURCE diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac b/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac index 0649464386d..03155372bfb 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], - [2.2.0], + [2.3.0], [https://github.com/harfbuzz/harfbuzz/issues/new], [harfbuzz], [http://harfbuzz.org/]) @@ -12,7 +12,6 @@ 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]) diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/gtk-doc.make b/Build/source/libs/harfbuzz/harfbuzz-src/gtk-doc.make index e4a12a5b255..2454c285797 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/gtk-doc.make +++ b/Build/source/libs/harfbuzz/harfbuzz-src/gtk-doc.make @@ -196,6 +196,7 @@ html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_con if test -f $(abs_builddir)/$$file ; then \ cp $(abs_builddir)/$$file $(abs_builddir)/html; \ fi; \ + test -f $$file && cp $$file $(abs_builddir)/html; \ done; $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) $(AM_V_at)touch html-build.stamp diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am b/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am index c726cf2a660..3618d03a2c7 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am @@ -28,10 +28,6 @@ HBSOURCES = $(HB_BASE_sources) HBSOURCES += $(HB_BASE_RAGEL_GENERATED_sources) HBHEADERS = $(HB_BASE_headers) -HBSOURCES += $(HB_OT_sources) -HBSOURCES += $(HB_OT_RAGEL_GENERATED_sources) -HBHEADERS += $(HB_OT_headers) - if HAVE_FALLBACK HBSOURCES += $(HB_FALLBACK_sources) endif @@ -299,12 +295,10 @@ built-sources: $(BUILT_SOURCES) RAGEL_GENERATED = \ $(patsubst %,$(srcdir)/%,$(HB_BASE_RAGEL_GENERATED_sources)) \ - $(patsubst %,$(srcdir)/%,$(HB_OT_RAGEL_GENERATED_sources)) \ $(NULL) BUILT_SOURCES += $(RAGEL_GENERATED) EXTRA_DIST += \ $(HB_BASE_RAGEL_sources) \ - $(HB_OT_RAGEL_sources) \ $(NULL) # We decided to add ragel-generated files to git... #MAINTAINERCLEANFILES += $(RAGEL_GENERATED) diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources b/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources index ba90ef022ef..98b62288978 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources @@ -1,196 +1,198 @@ # Base and default-included sources and headers HB_BASE_sources = \ + hb-aat-fdsc-table.hh \ + hb-aat-layout-ankr-table.hh \ + hb-aat-layout-bsln-table.hh \ + hb-aat-layout-common.hh \ + hb-aat-layout-feat-table.hh \ + hb-aat-layout-just-table.hh \ + hb-aat-layout-kerx-table.hh \ + hb-aat-layout-lcar-table.hh \ + hb-aat-layout-morx-table.hh \ + hb-aat-layout-trak-table.hh \ + hb-aat-layout.cc \ + hb-aat-layout.hh \ + hb-aat-ltag-table.hh \ + hb-aat-map.cc \ + hb-aat-map.hh \ + hb-array.hh \ hb-atomic.hh \ - hb-blob.hh \ hb-blob.cc \ - hb-buffer.hh \ + hb-blob.hh \ hb-buffer-serialize.cc \ hb-buffer.cc \ + hb-buffer.hh \ hb-cache.hh \ + hb-cff-interp-common.hh \ + hb-cff-interp-cs-common.hh \ + hb-cff-interp-dict-common.hh \ + hb-cff1-interp-cs.hh \ + hb-cff2-interp-cs.hh \ hb-common.cc \ hb-debug.hh \ hb-dsalgs.hh \ - hb-face.hh \ hb-face.cc \ - hb-font.hh \ + hb-face.hh \ hb-font.cc \ - hb-iter.hh \ + hb-font.hh \ hb-kern.hh \ - hb-map.hh \ - hb-map.cc \ hb-machinery.hh \ + hb-map.cc \ + hb-map.hh \ hb-mutex.hh \ hb-null.hh \ hb-object.hh \ hb-open-file.hh \ hb-open-type.hh \ - hb-ot-color-cbdt-table.hh \ + hb-ot-cff-common.hh \ + hb-ot-cff1-table.cc \ + hb-ot-cff1-table.hh \ + hb-ot-cff2-table.cc \ + hb-ot-cff2-table.hh \ hb-ot-cmap-table.hh \ + hb-ot-color-cbdt-table.hh \ + hb-ot-color-colr-table.hh \ + hb-ot-color-cpal-table.hh \ + hb-ot-color-sbix-table.hh \ + hb-ot-color-svg-table.hh \ + hb-ot-color.cc \ + hb-ot-face.cc \ + hb-ot-face.hh \ + hb-ot-font.cc \ + hb-ot-gasp-table.hh \ hb-ot-glyf-table.hh \ hb-ot-hdmx-table.hh \ hb-ot-head-table.hh \ hb-ot-hhea-table.hh \ hb-ot-hmtx-table.hh \ hb-ot-kern-table.hh \ - hb-ot-maxp-table.hh \ - hb-ot-name-language.cc \ - hb-ot-name-language.hh \ - hb-ot-name-table.hh \ - hb-ot-name.cc \ - hb-ot-os2-table.hh \ - hb-ot-os2-unicode-ranges.hh \ - hb-ot-post-macroman.hh \ - hb-ot-post-table.hh \ - hb-ot-tag-table.hh \ - hb-ot-tag.cc \ - hb.hh \ - hb-set-digest.hh \ - hb-set.hh \ - hb-set.cc \ - hb-shape.cc \ - hb-shape-plan.hh \ - hb-shape-plan.cc \ - hb-shaper-list.hh \ - hb-shaper-impl.hh \ - hb-shaper.hh \ - hb-shaper.cc \ - hb-static.cc \ - hb-string-array.hh \ - hb-unicode.hh \ - hb-unicode-emoji-table.hh \ - hb-unicode.cc \ - hb-vector.hh \ - hb-utf.hh \ - hb-warning.cc \ - $(NULL) - -HB_BASE_RAGEL_GENERATED_sources = \ - hb-buffer-deserialize-json.hh \ - hb-buffer-deserialize-text.hh \ - $(NULL) -HB_BASE_RAGEL_sources = \ - hb-buffer-deserialize-json.rl \ - hb-buffer-deserialize-text.rl \ - $(NULL) - -HB_BASE_headers = \ - hb.h \ - hb-blob.h \ - hb-buffer.h \ - hb-common.h \ - hb-deprecated.h \ - hb-face.h \ - hb-font.h \ - hb-map.h \ - hb-set.h \ - hb-shape.h \ - hb-shape-plan.h \ - hb-unicode.h \ - hb-version.h \ - $(NULL) - -HB_FALLBACK_sources = \ - hb-fallback-shape.cc \ - $(NULL) - -HB_OT_sources = \ - hb-aat-layout.cc \ - hb-aat-layout-common.hh \ - hb-aat-layout-ankr-table.hh \ - hb-aat-layout-bsln-table.hh \ - hb-aat-layout-feat-table.hh \ - hb-aat-layout-just-table.hh \ - hb-aat-layout-kerx-table.hh \ - hb-aat-layout-lcar-table.hh \ - hb-aat-layout-morx-table.hh \ - hb-aat-layout-trak-table.hh \ - hb-aat-layout.hh \ - hb-aat-ltag-table.hh \ - hb-aat-map.cc \ - hb-aat-map.hh \ - hb-ot-face.hh \ - hb-ot-face.cc \ - hb-ot-font.cc \ - hb-ot-layout.cc \ hb-ot-layout-base-table.hh \ hb-ot-layout-common.hh \ hb-ot-layout-gdef-table.hh \ hb-ot-layout-gpos-table.hh \ - hb-ot-layout-gsubgpos.hh \ hb-ot-layout-gsub-table.hh \ + hb-ot-layout-gsubgpos.hh \ hb-ot-layout-jstf-table.hh \ + hb-ot-layout.cc \ hb-ot-layout.hh \ - hb-ot-color.cc \ - hb-ot-color-colr-table.hh \ - hb-ot-color-cpal-table.hh \ - hb-ot-color-sbix-table.hh \ - hb-ot-color-svg-table.hh \ hb-ot-map.cc \ hb-ot-map.hh \ - hb-ot-math.cc \ hb-ot-math-table.hh \ - hb-ot-shape.cc \ - hb-ot-shape-complex-arabic.cc \ + hb-ot-math.cc \ + hb-ot-maxp-table.hh \ + hb-ot-name-language.cc \ + hb-ot-name-language.hh \ + hb-ot-name-table.hh \ + hb-ot-name.cc \ + hb-ot-os2-table.hh \ + hb-ot-os2-unicode-ranges.hh \ + hb-ot-post-macroman.hh \ + hb-ot-post-table.hh \ hb-ot-shape-complex-arabic-fallback.hh \ - hb-ot-shape-complex-arabic.hh \ hb-ot-shape-complex-arabic-table.hh \ hb-ot-shape-complex-arabic-win1256.hh \ + hb-ot-shape-complex-arabic.cc \ + hb-ot-shape-complex-arabic.hh \ hb-ot-shape-complex-default.cc \ hb-ot-shape-complex-hangul.cc \ hb-ot-shape-complex-hebrew.cc \ + hb-ot-shape-complex-indic-table.cc \ hb-ot-shape-complex-indic.cc \ hb-ot-shape-complex-indic.hh \ - hb-ot-shape-complex-indic-table.cc \ - hb-ot-shape-complex-khmer.hh \ hb-ot-shape-complex-khmer.cc \ - hb-ot-shape-complex-myanmar.hh \ + hb-ot-shape-complex-khmer.hh \ hb-ot-shape-complex-myanmar.cc \ + hb-ot-shape-complex-myanmar.hh \ hb-ot-shape-complex-thai.cc \ + hb-ot-shape-complex-use-table.cc \ hb-ot-shape-complex-use.cc \ hb-ot-shape-complex-use.hh \ - hb-ot-shape-complex-use-table.cc \ hb-ot-shape-complex-vowel-constraints.cc \ hb-ot-shape-complex-vowel-constraints.hh \ hb-ot-shape-complex.hh \ - hb-ot-shape-normalize.hh \ - hb-ot-shape-normalize.cc \ - hb-ot-shape-fallback.hh \ hb-ot-shape-fallback.cc \ + hb-ot-shape-fallback.hh \ + hb-ot-shape-normalize.cc \ + hb-ot-shape-normalize.hh \ + hb-ot-shape.cc \ hb-ot-shape.hh \ hb-ot-stat-table.hh \ - hb-ot-var.cc \ + hb-ot-tag-table.hh \ + hb-ot-tag.cc \ hb-ot-var-avar-table.hh \ hb-ot-var-fvar-table.hh \ hb-ot-var-hvar-table.hh \ hb-ot-var-mvar-table.hh \ + hb-ot-var.cc \ hb-ot-vorg-table.hh \ + hb-set-digest.hh \ + hb-set.cc \ + hb-set.hh \ + hb-shape-plan.cc \ + hb-shape-plan.hh \ + hb-shape.cc \ + hb-shaper-impl.hh \ + hb-shaper-list.hh \ + hb-shaper.cc \ + hb-shaper.hh \ + hb-static.cc \ + hb-string-array.hh \ + hb-unicode-emoji-table.hh \ + hb-unicode.cc \ + hb-unicode.hh \ + hb-utf.hh \ + hb-vector.hh \ + hb-warning.cc \ + hb.hh \ $(NULL) -HB_OT_RAGEL_GENERATED_sources = \ +HB_BASE_RAGEL_GENERATED_sources = \ + hb-buffer-deserialize-json.hh \ + hb-buffer-deserialize-text.hh \ hb-ot-shape-complex-indic-machine.hh \ hb-ot-shape-complex-khmer-machine.hh \ hb-ot-shape-complex-myanmar-machine.hh \ hb-ot-shape-complex-use-machine.hh \ $(NULL) -HB_OT_RAGEL_sources = \ +HB_BASE_RAGEL_sources = \ + hb-buffer-deserialize-json.rl \ + hb-buffer-deserialize-text.rl \ hb-ot-shape-complex-indic-machine.rl \ hb-ot-shape-complex-khmer-machine.rl \ hb-ot-shape-complex-myanmar-machine.rl \ hb-ot-shape-complex-use-machine.rl \ $(NULL) -HB_OT_headers = \ - hb-aat.h \ +HB_BASE_headers = \ hb-aat-layout.h \ - hb-ot.h \ + hb-aat.h \ + hb-blob.h \ + hb-buffer.h \ + hb-common.h \ + hb-deprecated.h \ + hb-face.h \ + hb-font.h \ + hb-map.h \ hb-ot-color.h \ + hb-ot-deprecated.h \ hb-ot-font.h \ hb-ot-layout.h \ hb-ot-math.h \ hb-ot-name.h \ hb-ot-shape.h \ hb-ot-var.h \ + hb-ot.h \ + hb-set.h \ + hb-shape-plan.h \ + hb-shape.h \ + hb-unicode.h \ + hb-version.h \ + hb.h \ + $(NULL) + +HB_FALLBACK_sources = \ + hb-fallback-shape.cc \ $(NULL) # Optional Sources and Headers with external deps @@ -224,15 +226,26 @@ HB_ICU_headers = hb-icu.h # Sources for libharfbuzz-subset HB_SUBSET_sources = \ + hb-ot-cff1-table.cc \ + hb-ot-cff2-table.cc \ hb-static.cc \ - hb-subset.cc \ - hb-subset.hh \ + hb-subset-cff-common.cc \ + hb-subset-cff-common.hh \ + hb-subset-cff1.cc \ + hb-subset-cff1.hh \ + hb-subset-cff2.cc \ + hb-subset-cff2.hh \ hb-subset-glyf.cc \ hb-subset-glyf.hh \ + hb-subset-glyf.hh \ hb-subset-input.cc \ hb-subset-input.hh \ hb-subset-plan.cc \ hb-subset-plan.hh \ + hb-subset-plan.hh \ + hb-subset.cc \ + hb-subset.hh \ + hb-subset.hh \ $(NULL) HB_SUBSET_headers = \ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/dump-indic-data.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/dump-indic-data.cc index a506889810b..8ddc9d5a4ef 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/dump-indic-data.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/dump-indic-data.cc @@ -27,7 +27,7 @@ #include "hb-ot-shape-complex-indic.hh" int -main (void) +main () { for (hb_codepoint_t u = 0; u <= 0x10FFFF; u++) { 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 1e79a976732..cffbb92df72 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 @@ -27,7 +27,7 @@ #include "hb-ot-shape-complex-khmer.hh" int -main (void) +main () { for (hb_codepoint_t u = 0; u <= 0x10FFFF; u++) { diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/dump-myanmar-data.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/dump-myanmar-data.cc index 9f8b12ed229..c1a303f8f1a 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/dump-myanmar-data.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/dump-myanmar-data.cc @@ -27,7 +27,7 @@ #include "hb-ot-shape-complex-myanmar.hh" int -main (void) +main () { for (hb_codepoint_t u = 0; u <= 0x10FFFF; u++) { diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/dump-use-data.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/dump-use-data.cc index 4a8b25842e1..d639426b733 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/dump-use-data.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/dump-use-data.cc @@ -27,7 +27,7 @@ #include "hb-ot-shape-complex-use.hh" int -main (void) +main () { for (hb_codepoint_t u = 0; u <= 0x10FFFF; u++) { diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-fdsc-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-fdsc-table.hh new file mode 100644 index 00000000000..a1af595f9ff --- /dev/null +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-fdsc-table.hh @@ -0,0 +1,126 @@ +/* + * Copyright © 2018 Ebrahim Byagowi + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#ifndef HB_AAT_FDSC_TABLE_HH +#define HB_AAT_FDSC_TABLE_HH + +#include "hb-aat-layout-common.hh" +#include "hb-open-type.hh" + +/* + * fdsc -- Font descriptors + * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6fdsc.html + */ +#define HB_AAT_TAG_fdsc HB_TAG('f','d','s','c') + + +namespace AAT { + + +struct FontDescriptor +{ + bool has_data () const { return tag; } + + int cmp (hb_tag_t a) const { return tag.cmp (a); } + + float get_value () const { return u.value.to_float (); } + + enum non_alphabetic_value_t { + Alphabetic = 0, + Dingbats = 1, + PiCharacters = 2, + Fleurons = 3, + DecorativeBorders = 4, + InternationalSymbols= 5, + MathSymbols = 6 + }; + + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this)); + } + + protected: + Tag tag; /* The 4-byte table tag name. */ + union { + Fixed value; /* The value for the descriptor tag. */ + HBUINT32 nalfType; /* If the tag is `nalf`, see non_alphabetic_value_t */ + } u; + public: + DEFINE_SIZE_STATIC (8); +}; + +struct fdsc +{ + enum { tableTag = HB_AAT_TAG_fdsc }; + + enum { + Weight = HB_TAG ('w','g','h','t'), + /* Percent weight relative to regular weight. + * (defaul value: 1.0) */ + Width = HB_TAG ('w','d','t','h'), + /* Percent width relative to regular width. + * (default value: 1.0) */ + Slant = HB_TAG ('s','l','n','t'), + /* Angle of slant in degrees, where positive + * is clockwise from straight up. + * (default value: 0.0) */ + OpticalSize = HB_TAG ('o','p','s','z'), + /* Point size the font was designed for. + * (default value: 12.0) */ + NonAlphabetic= HB_TAG ('n','a','l','f') + /* These values are treated as integers, + * not fixed32s. 0 means alphabetic, and greater + * integers mean the font is non-alphabetic (e.g. symbols). + * (default value: 0) */ + }; + + const FontDescriptor &get_descriptor (hb_tag_t style) const + { return descriptors.lsearch (style); } + + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && + descriptors.sanitize (c)); + } + + protected: + Fixed version; /* Version number of the font descriptors + * table (0x00010000 for the current version). */ + LArrayOf + descriptors; /* List of tagged-coordinate pairs style descriptors + * that will be included to characterize this font. + * Each descriptor consists of a pair. + * These pairs are located in the gxFontDescriptor + * array that follows. */ + public: + DEFINE_SIZE_ARRAY (8, descriptors); +}; + +} /* namespace AAT */ + + +#endif /* HB_AAT_FDSC_TABLE_HH */ 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 b793245a0c5..4235b363a1f 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 @@ -41,7 +41,7 @@ using namespace OT; struct Anchor { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); @@ -58,12 +58,12 @@ typedef LArrayOf GlyphAnchors; struct ankr { - static const hb_tag_t tableTag = HB_AAT_TAG_ankr; + enum { 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 + const Anchor &get_anchor (hb_codepoint_t glyph_id, + unsigned int i, + unsigned int num_glyphs, + const char *end) const { const Offset *offset = (this+lookupTable).get_value (glyph_id, num_glyphs); if (!offset) @@ -75,7 +75,7 @@ struct ankr return anchors[i]; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-bsln-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-bsln-table.hh index b86408626f2..5bc59cbb10a 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-bsln-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-bsln-table.hh @@ -39,7 +39,7 @@ namespace AAT { struct BaselineTableFormat0Part { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -57,7 +57,7 @@ struct BaselineTableFormat0Part struct BaselineTableFormat1Part { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -75,7 +75,7 @@ struct BaselineTableFormat1Part struct BaselineTableFormat2Part { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -98,7 +98,7 @@ struct BaselineTableFormat2Part struct BaselineTableFormat3Part { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && lookupTable.sanitize (c)); @@ -116,15 +116,16 @@ struct BaselineTableFormat3Part struct bsln { - static const hb_tag_t tableTag = HB_AAT_TAG_bsln; + enum { tableTag = HB_AAT_TAG_bsln }; - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (unlikely (!(c->check_struct (this) && defaultBaseline < 32))) return_trace (false); - switch (format) { + switch (format) + { case 0: return_trace (parts.format0.sanitize (c)); case 1: return_trace (parts.format1.sanitize (c)); case 2: return_trace (parts.format2.sanitize (c)); 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 c0b0e3751f3..95d6b312ab5 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 @@ -28,6 +28,7 @@ #define HB_AAT_LAYOUT_COMMON_HH #include "hb-aat-layout.hh" +#include "hb-open-type.hh" namespace AAT { @@ -47,18 +48,18 @@ struct LookupFormat0 friend struct Lookup; private: - inline const T* get_value (hb_codepoint_t glyph_id, unsigned int num_glyphs) const + const T* get_value (hb_codepoint_t glyph_id, unsigned int num_glyphs) const { if (unlikely (glyph_id >= num_glyphs)) return nullptr; return &arrayZ[glyph_id]; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (arrayZ.sanitize (c, c->get_num_glyphs ())); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (arrayZ.sanitize (c, c->get_num_glyphs (), base)); @@ -78,16 +79,15 @@ struct LookupSegmentSingle { enum { TerminationWordCount = 2 }; - inline int cmp (hb_codepoint_t g) const { - return g < first ? -1 : g <= last ? 0 : +1 ; - } + int cmp (hb_codepoint_t g) const + { return g < first ? -1 : g <= last ? 0 : +1 ; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && value.sanitize (c)); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && value.sanitize (c, base)); @@ -106,18 +106,18 @@ struct LookupFormat2 friend struct Lookup; private: - inline const T* get_value (hb_codepoint_t glyph_id) const + const T* get_value (hb_codepoint_t glyph_id) const { const LookupSegmentSingle *v = segments.bsearch (glyph_id); return v ? &v->value : nullptr; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (segments.sanitize (c)); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (segments.sanitize (c, base)); @@ -138,16 +138,15 @@ struct LookupSegmentArray { enum { TerminationWordCount = 2 }; - inline const T* get_value (hb_codepoint_t glyph_id, const void *base) const + const T* get_value (hb_codepoint_t glyph_id, const void *base) const { return first <= glyph_id && glyph_id <= last ? &(base+valuesZ)[glyph_id - first] : nullptr; } - inline int cmp (hb_codepoint_t g) const { - return g < first ? -1 : g <= last ? 0 : +1 ; - } + int cmp (hb_codepoint_t g) const + { return g < first ? -1 : g <= last ? 0 : +1; } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -155,7 +154,7 @@ struct LookupSegmentArray valuesZ.sanitize (c, base, last - first + 1)); } template - inline bool sanitize (hb_sanitize_context_t *c, const void *base, T2 user_data) const + bool sanitize (hb_sanitize_context_t *c, const void *base, T2 user_data) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -178,18 +177,18 @@ struct LookupFormat4 friend struct Lookup; private: - inline const T* get_value (hb_codepoint_t glyph_id) const + const T* get_value (hb_codepoint_t glyph_id) const { const LookupSegmentArray *v = segments.bsearch (glyph_id); return v ? v->get_value (glyph_id, this) : nullptr; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (segments.sanitize (c, this)); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (segments.sanitize (c, this, base)); @@ -210,14 +209,14 @@ struct LookupSingle { enum { TerminationWordCount = 1 }; - inline int cmp (hb_codepoint_t g) const { return glyph.cmp (g); } + int cmp (hb_codepoint_t g) const { return glyph.cmp (g); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && value.sanitize (c)); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && value.sanitize (c, base)); @@ -235,18 +234,18 @@ struct LookupFormat6 friend struct Lookup; private: - inline const T* get_value (hb_codepoint_t glyph_id) const + const T* get_value (hb_codepoint_t glyph_id) const { const LookupSingle *v = entries.bsearch (glyph_id); return v ? &v->value : nullptr; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (entries.sanitize (c)); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (entries.sanitize (c, base)); @@ -266,18 +265,18 @@ struct LookupFormat8 friend struct Lookup; private: - inline const T* get_value (hb_codepoint_t glyph_id) const + const T* get_value (hb_codepoint_t glyph_id) const { return firstGlyph <= glyph_id && glyph_id - firstGlyph < glyphCount ? &valueArrayZ[glyph_id - firstGlyph] : nullptr; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && valueArrayZ.sanitize (c, glyphCount)); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && valueArrayZ.sanitize (c, glyphCount, base)); @@ -301,7 +300,7 @@ struct LookupFormat10 friend struct Lookup; private: - inline const typename T::type get_value_or_null (hb_codepoint_t glyph_id) const + const typename T::type get_value_or_null (hb_codepoint_t glyph_id) const { if (!(firstGlyph <= glyph_id && glyph_id - firstGlyph < glyphCount)) return Null(T); @@ -316,7 +315,7 @@ struct LookupFormat10 return v; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -340,7 +339,7 @@ struct LookupFormat10 template struct Lookup { - inline const T* get_value (hb_codepoint_t glyph_id, unsigned int num_glyphs) const + const T* get_value (hb_codepoint_t glyph_id, unsigned int num_glyphs) const { switch (u.format) { case 0: return u.format0.get_value (glyph_id, num_glyphs); @@ -352,7 +351,7 @@ struct Lookup } } - inline const typename T::type get_value_or_null (hb_codepoint_t glyph_id, unsigned int num_glyphs) const + const typename T::type get_value_or_null (hb_codepoint_t glyph_id, unsigned int num_glyphs) const { switch (u.format) { /* Format 10 cannot return a pointer. */ @@ -363,15 +362,15 @@ struct Lookup } } - inline typename T::type get_class (hb_codepoint_t glyph_id, - unsigned int num_glyphs, - unsigned int outOfRange) const + typename T::type get_class (hb_codepoint_t glyph_id, + unsigned int num_glyphs, + unsigned int outOfRange) const { const T *v = get_value (glyph_id, num_glyphs); return v ? *v : outOfRange; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (!u.format.sanitize (c)) return_trace (false); @@ -385,7 +384,7 @@ struct Lookup default:return_trace (true); } } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); if (!u.format.sanitize (c)) return_trace (false); @@ -420,17 +419,14 @@ struct Lookup /* 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); -} +/*static*/ inline const AAT::Lookup& Null > () +{ return *reinterpret_cast *> (_hb_Null_AAT_Lookup); } template <> -/*static*/ inline const AAT::Lookup& Null > (void) { - return *reinterpret_cast *> (_hb_Null_AAT_Lookup); -} +/*static*/ inline const AAT::Lookup& Null > () +{ return *reinterpret_cast *> (_hb_Null_AAT_Lookup); } template <> -/*static*/ inline const AAT::Lookup >& Null > > (void) { - return *reinterpret_cast > *> (_hb_Null_AAT_Lookup); -} +/*static*/ inline const AAT::Lookup >& Null > > () +{ return *reinterpret_cast > *> (_hb_Null_AAT_Lookup); } namespace AAT { enum { DELETED_GLYPH = 0xFFFF }; @@ -442,7 +438,7 @@ enum { DELETED_GLYPH = 0xFFFF }; template struct Entry { - inline bool sanitize (hb_sanitize_context_t *c, unsigned int count) const + bool sanitize (hb_sanitize_context_t *c, unsigned int count) const { TRACE_SANITIZE (this); /* Note, we don't recurse-sanitize data because we don't access it. @@ -470,7 +466,7 @@ struct Entry template <> struct Entry { - inline bool sanitize (hb_sanitize_context_t *c, unsigned int count /*XXX Unused?*/) const + bool sanitize (hb_sanitize_context_t *c, unsigned int count /*XXX Unused?*/) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); @@ -503,21 +499,19 @@ struct StateTable CLASS_END_OF_LINE = 3, }; - inline int new_state (unsigned int newState) const - { return Types::extended ? newState : ((int) newState - (int) stateArrayTable) / nClasses; } + int new_state (unsigned int newState) const + { return Types::extended ? newState : ((int) newState - (int) stateArrayTable) / (int) nClasses; } - inline unsigned int get_class (hb_codepoint_t glyph_id, unsigned int num_glyphs) const + unsigned int get_class (hb_codepoint_t glyph_id, unsigned int num_glyphs) const { if (unlikely (glyph_id == DELETED_GLYPH)) return CLASS_DELETED_GLYPH; return (this+classTable).get_class (glyph_id, num_glyphs, 1); } - inline const Entry *get_entries () const - { - return (this+entryTable).arrayZ; - } + const Entry *get_entries () const + { return (this+entryTable).arrayZ; } - inline const Entry *get_entryZ (int state, unsigned int klass) const + const Entry *get_entryZ (int state, unsigned int klass) const { if (unlikely (klass >= nClasses)) return nullptr; @@ -530,8 +524,8 @@ struct StateTable return &entries[entry]; } - inline bool sanitize (hb_sanitize_context_t *c, - unsigned int *num_entries_out = nullptr) const + bool sanitize (hb_sanitize_context_t *c, + unsigned int *num_entries_out = nullptr) const { TRACE_SANITIZE (this); if (unlikely (!(c->check_struct (this) && @@ -649,18 +643,18 @@ struct StateTable template struct ClassTable { - inline unsigned int get_class (hb_codepoint_t glyph_id, unsigned int outOfRange) const + unsigned int get_class (hb_codepoint_t glyph_id, unsigned int outOfRange) const { unsigned int i = glyph_id - firstGlyph; return i >= classArray.len ? outOfRange : classArray.arrayZ[i]; } - inline unsigned int get_class (hb_codepoint_t glyph_id, - unsigned int num_glyphs HB_UNUSED, - unsigned int outOfRange) const + unsigned int get_class (hb_codepoint_t glyph_id, + unsigned int num_glyphs HB_UNUSED, + unsigned int outOfRange) const { return get_class (glyph_id, outOfRange); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && classArray.sanitize (c)); @@ -675,60 +669,60 @@ struct ClassTable struct ObsoleteTypes { - static const bool extended = false; + enum { extended = false }; typedef HBUINT16 HBUINT; typedef HBUINT8 HBUSHORT; typedef ClassTable ClassTypeNarrow; typedef ClassTable ClassTypeWide; template - static inline unsigned int offsetToIndex (unsigned int offset, - const void *base, - const T *array) + static unsigned int offsetToIndex (unsigned int offset, + const void *base, + const T *array) { return (offset - ((const char *) array - (const char *) base)) / sizeof (T); } template - static inline unsigned int byteOffsetToIndex (unsigned int offset, - const void *base, - const T *array) + static unsigned int byteOffsetToIndex (unsigned int offset, + const void *base, + const T *array) { return offsetToIndex (offset, base, array); } template - static inline unsigned int wordOffsetToIndex (unsigned int offset, - const void *base, - const T *array) + static unsigned int wordOffsetToIndex (unsigned int offset, + const void *base, + const T *array) { return offsetToIndex (2 * offset, base, array); } }; struct ExtendedTypes { - static const bool extended = true; + enum { extended = true }; typedef HBUINT32 HBUINT; typedef HBUINT16 HBUSHORT; typedef Lookup ClassTypeNarrow; typedef Lookup ClassTypeWide; template - static inline unsigned int offsetToIndex (unsigned int offset, - const void *base, - const T *array) + static unsigned int offsetToIndex (unsigned int offset, + const void *base, + const T *array) { return offset; } template - static inline unsigned int byteOffsetToIndex (unsigned int offset, - const void *base, - const T *array) + static unsigned int byteOffsetToIndex (unsigned int offset, + const void *base, + const T *array) { return offset / 2; } template - static inline unsigned int wordOffsetToIndex (unsigned int offset, - const void *base, - const T *array) + static unsigned int wordOffsetToIndex (unsigned int offset, + const void *base, + const T *array) { return offset; } @@ -737,15 +731,15 @@ struct ExtendedTypes template struct StateTableDriver { - inline StateTableDriver (const StateTable &machine_, - hb_buffer_t *buffer_, - hb_face_t *face_) : + StateTableDriver (const StateTable &machine_, + hb_buffer_t *buffer_, + hb_face_t *face_) : machine (machine_), buffer (buffer_), num_glyphs (face_->get_num_glyphs ()) {} template - inline void drive (context_t *c) + void drive (context_t *c) { if (!c->in_place) buffer->clear_output (); @@ -819,10 +813,10 @@ struct ankr; struct hb_aat_apply_context_t : hb_dispatch_context_t { - inline const char *get_name (void) { return "APPLY"; } + const char *get_name () { return "APPLY"; } template - inline return_t dispatch (const T &obj) { return obj.apply (this); } - static return_t default_return_value (void) { return false; } + return_t dispatch (const T &obj) { return obj.apply (this); } + static return_t default_return_value () { return false; } bool stop_sublookup_iteration (return_t r) const { return r; } const hb_ot_shape_plan_t *plan; @@ -842,11 +836,11 @@ struct hb_aat_apply_context_t : hb_buffer_t *buffer_, hb_blob_t *blob = const_cast (&Null(hb_blob_t))); - HB_INTERNAL ~hb_aat_apply_context_t (void); + HB_INTERNAL ~hb_aat_apply_context_t (); HB_INTERNAL void set_ankr_table (const AAT::ankr *ankr_table_, const char *ankr_end_); - inline void set_lookup_index (unsigned int i) { lookup_index = i; } + 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 4e63ec8e855..63c69a20f9f 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 @@ -44,10 +44,10 @@ struct SettingName int cmp (hb_aat_layout_feature_selector_t key) const { return (int) key - (int) setting; } - inline hb_aat_layout_feature_selector_t get_selector (void) const + hb_aat_layout_feature_selector_t get_selector () const { return (hb_aat_layout_feature_selector_t) (unsigned) setting; } - inline void get_info (hb_aat_layout_feature_selector_info_t *s, + void get_info (hb_aat_layout_feature_selector_info_t *s, hb_aat_layout_feature_selector_t default_selector) const { s->name_id = nameIndex; @@ -60,7 +60,7 @@ struct SettingName s->reserved = 0; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -95,11 +95,11 @@ struct FeatureName * as the default. */ }; - inline unsigned int get_selector_infos (unsigned int start_offset, - unsigned int *selectors_count, /* IN/OUT. May be NULL. */ - hb_aat_layout_feature_selector_info_t *selectors, /* OUT. May be NULL. */ - unsigned int *pdefault_index, /* OUT. May be NULL. */ - const void *base) const + unsigned int get_selector_infos (unsigned int start_offset, + unsigned int *selectors_count, /* IN/OUT. May be NULL. */ + hb_aat_layout_feature_selector_info_t *selectors, /* OUT. May be NULL. */ + unsigned int *pdefault_index, /* OUT. May be NULL. */ + const void *base) const { hb_array_t< const SettingName> settings_table = (base+settingTableZ).as_array (nSettings); @@ -125,12 +125,12 @@ struct FeatureName return settings_table.len; } - inline hb_aat_layout_feature_type_t get_feature_type () const + hb_aat_layout_feature_type_t get_feature_type () const { return (hb_aat_layout_feature_type_t) (unsigned int) feature; } - inline hb_ot_name_id_t get_feature_name_id () const { return nameIndex; } + hb_ot_name_id_t get_feature_name_id () const { return nameIndex; } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -155,13 +155,13 @@ struct FeatureName struct feat { - static const hb_tag_t tableTag = HB_AAT_TAG_feat; + enum { tableTag = HB_AAT_TAG_feat }; - inline bool has_data (void) const { return version.to_int (); } + bool has_data () const { return version.to_int (); } - inline unsigned int get_feature_types (unsigned int start_offset, - unsigned int *count, - hb_aat_layout_feature_type_t *features) const + unsigned int get_feature_types (unsigned int start_offset, + unsigned int *count, + hb_aat_layout_feature_type_t *features) const { unsigned int feature_count = featureNameCount; if (count && *count) @@ -174,25 +174,25 @@ struct feat return featureNameCount; } - inline const FeatureName& get_feature (hb_aat_layout_feature_type_t feature_type) const + const FeatureName& get_feature (hb_aat_layout_feature_type_t feature_type) const { return namesZ.bsearch (featureNameCount, feature_type); } - inline hb_ot_name_id_t get_feature_name_id (hb_aat_layout_feature_type_t feature) const + hb_ot_name_id_t get_feature_name_id (hb_aat_layout_feature_type_t feature) const { return get_feature (feature).get_feature_name_id (); } - inline unsigned int get_selector_infos (hb_aat_layout_feature_type_t feature_type, - unsigned int start_offset, - unsigned int *selectors_count, /* IN/OUT. May be NULL. */ - hb_aat_layout_feature_selector_info_t *selectors, /* OUT. May be NULL. */ - unsigned int *default_index /* OUT. May be NULL. */) const + unsigned int get_selector_infos (hb_aat_layout_feature_type_t feature_type, + unsigned int start_offset, + unsigned int *selectors_count, /* IN/OUT. May be NULL. */ + hb_aat_layout_feature_selector_info_t *selectors, /* OUT. May be NULL. */ + unsigned int *default_index /* OUT. May be NULL. */) const { return get_feature (feature_type).get_selector_infos (start_offset, selectors_count, selectors, default_index, this); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-just-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-just-table.hh index 92ca6603e16..d39945abd6b 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-just-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-just-table.hh @@ -45,7 +45,7 @@ using namespace OT; struct ActionSubrecordHeader { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -62,7 +62,7 @@ struct ActionSubrecordHeader struct DecompositionAction { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -91,7 +91,7 @@ struct DecompositionAction struct UnconditionalAddGlyphAction { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); @@ -109,7 +109,7 @@ struct UnconditionalAddGlyphAction struct ConditionalAddGlyphAction { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -134,7 +134,7 @@ struct ConditionalAddGlyphAction struct DuctileGlyphAction { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -160,7 +160,7 @@ struct DuctileGlyphAction struct RepeatedAddGlyphAction { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -178,9 +178,9 @@ struct RepeatedAddGlyphAction struct ActionSubrecord { - inline unsigned int get_length (void) const { return u.header.actionLength; } + unsigned int get_length () const { return u.header.actionLength; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (unlikely (!c->check_struct (this))) @@ -215,7 +215,7 @@ struct ActionSubrecord struct PostcompensationActionChain { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (unlikely (!c->check_struct (this))) @@ -291,7 +291,7 @@ struct JustWidthDeltaEntry struct WidthDeltaPair { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -328,7 +328,7 @@ struct JustificationCategory * glyph if nonzero. */ }; - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -347,7 +347,7 @@ struct JustificationCategory struct JustificationHeader { - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -382,9 +382,9 @@ struct JustificationHeader struct just { - static const hb_tag_t tableTag = HB_AAT_TAG_just; + enum { tableTag = HB_AAT_TAG_just }; - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); 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 7caf45d5dd1..291f3e35b40 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 @@ -66,17 +66,16 @@ struct hb_glyph_pair_t struct KernPair { - inline int get_kerning (void) const - { return value; } + int get_kerning () const { return value; } - inline int cmp (const hb_glyph_pair_t &o) const + int cmp (const hb_glyph_pair_t &o) const { int ret = left.cmp (o.left); if (ret) return ret; return right.cmp (o.right); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); @@ -93,15 +92,15 @@ struct KernPair template struct KerxSubTableFormat0 { - inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right, - hb_aat_apply_context_t *c = nullptr) const + int get_kerning (hb_codepoint_t left, hb_codepoint_t right, + hb_aat_apply_context_t *c = nullptr) const { hb_glyph_pair_t pair = {left, right}; int v = pairs.bsearch (pair).get_kerning (); return kerxTupleKern (v, header.tuple_count (), this, c); } - inline bool apply (hb_aat_apply_context_t *c) const + bool apply (hb_aat_apply_context_t *c) const { TRACE_APPLY (this); @@ -123,16 +122,16 @@ struct KerxSubTableFormat0 const KerxSubTableFormat0 &table; hb_aat_apply_context_t *c; - inline accelerator_t (const KerxSubTableFormat0 &table_, - hb_aat_apply_context_t *c_) : - table (table_), c (c_) {} + accelerator_t (const KerxSubTableFormat0 &table_, + hb_aat_apply_context_t *c_) : + table (table_), c (c_) {} - inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const + int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const { return table.get_kerning (left, right, c); } }; - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (pairs.sanitize (c))); @@ -171,10 +170,10 @@ struct Format1Entry DEFINE_SIZE_STATIC (2); }; - static inline bool performAction (const Entry *entry) + static bool performAction (const Entry *entry) { return entry->data.kernActionIndex != 0xFFFF; } - static inline unsigned int kernActionIndex (const Entry *entry) + static unsigned int kernActionIndex (const Entry *entry) { return entry->data.kernActionIndex; } }; template <> @@ -193,10 +192,10 @@ struct Format1Entry typedef void EntryData; - static inline bool performAction (const Entry *entry) + static bool performAction (const Entry *entry) { return entry->flags & Offset; } - static inline unsigned int kernActionIndex (const Entry *entry) + static unsigned int kernActionIndex (const Entry *entry) { return entry->flags & Offset; } }; @@ -211,14 +210,14 @@ struct KerxSubTableFormat1 struct driver_context_t { - static const bool in_place = true; + enum { in_place = true }; enum { DontAdvance = Format1EntryT::DontAdvance, }; - inline driver_context_t (const KerxSubTableFormat1 *table_, - hb_aat_apply_context_t *c_) : + driver_context_t (const KerxSubTableFormat1 *table_, + hb_aat_apply_context_t *c_) : c (c_), table (table_), /* Apparently the offset kernAction is from the beginning of the state-machine, @@ -228,13 +227,13 @@ struct KerxSubTableFormat1 depth (0), crossStream (table->header.coverage & table->header.CrossStream) {} - inline bool is_actionable (StateTableDriver *driver HB_UNUSED, - const Entry *entry) + bool is_actionable (StateTableDriver *driver HB_UNUSED, + const Entry *entry) { return Format1EntryT::performAction (entry); } - inline bool transition (StateTableDriver *driver, - const Entry *entry) + bool transition (StateTableDriver *driver, + const Entry *entry) { hb_buffer_t *buffer = driver->buffer; unsigned int flags = entry->flags; @@ -348,7 +347,7 @@ struct KerxSubTableFormat1 bool crossStream; }; - inline bool apply (hb_aat_apply_context_t *c) const + bool apply (hb_aat_apply_context_t *c) const { TRACE_APPLY (this); @@ -364,7 +363,7 @@ struct KerxSubTableFormat1 return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); /* The rest of array sanitizations are done at run-time. */ @@ -386,8 +385,8 @@ struct KerxSubTableFormat2 typedef typename KernSubTableHeader::Types Types; typedef typename Types::HBUINT HBUINT; - inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right, - hb_aat_apply_context_t *c) const + 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 (); unsigned int l = (this+leftClassTable).get_class (left, num_glyphs, 0); @@ -402,7 +401,7 @@ struct KerxSubTableFormat2 return kerxTupleKern (*v, header.tuple_count (), this, c); } - inline bool apply (hb_aat_apply_context_t *c) const + bool apply (hb_aat_apply_context_t *c) const { TRACE_APPLY (this); @@ -424,15 +423,15 @@ struct KerxSubTableFormat2 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_) {} + 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 + int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const { return table.get_kerning (left, right, c); } }; - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -472,7 +471,7 @@ struct KerxSubTableFormat4 struct driver_context_t { - static const bool in_place = true; + enum { in_place = true }; enum Flags { Mark = 0x8000, /* If set, remember this glyph as the marked glyph. */ @@ -490,7 +489,7 @@ struct KerxSubTableFormat4 * point table. */ }; - inline driver_context_t (const KerxSubTableFormat4 *table, + driver_context_t (const KerxSubTableFormat4 *table, hb_aat_apply_context_t *c_) : c (c_), action_type ((table->flags & ActionType) >> 30), @@ -498,13 +497,13 @@ struct KerxSubTableFormat4 mark_set (false), mark (0) {} - inline bool is_actionable (StateTableDriver *driver HB_UNUSED, - const Entry *entry) + bool is_actionable (StateTableDriver *driver HB_UNUSED, + const Entry *entry) { return entry->data.ankrActionIndex != 0xFFFF; } - inline bool transition (StateTableDriver *driver, - const Entry *entry) + bool transition (StateTableDriver *driver, + const Entry *entry) { hb_buffer_t *buffer = driver->buffer; @@ -599,7 +598,7 @@ struct KerxSubTableFormat4 unsigned int mark; }; - inline bool apply (hb_aat_apply_context_t *c) const + bool apply (hb_aat_apply_context_t *c) const { TRACE_APPLY (this); @@ -611,7 +610,7 @@ struct KerxSubTableFormat4 return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); /* The rest of array sanitizations are done at run-time. */ @@ -635,9 +634,9 @@ struct KerxSubTableFormat6 ValuesAreLong = 0x00000001, }; - inline bool is_long (void) const { return flags & ValuesAreLong; } + bool is_long () const { return flags & ValuesAreLong; } - inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right, + 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 (); @@ -665,7 +664,7 @@ struct KerxSubTableFormat6 } } - inline bool apply (hb_aat_apply_context_t *c) const + bool apply (hb_aat_apply_context_t *c) const { TRACE_APPLY (this); @@ -682,7 +681,7 @@ struct KerxSubTableFormat6 return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -705,11 +704,11 @@ struct KerxSubTableFormat6 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_) {} + 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 + int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const { return table.get_kerning (left, right, c); } }; @@ -743,8 +742,8 @@ struct KerxSubTableHeader { typedef ExtendedTypes Types; - inline unsigned int tuple_count (void) const { return tupleCount; } - inline bool is_horizontal (void) const { return !(coverage & Vertical); } + unsigned int tuple_count () const { return tupleCount; } + bool is_horizontal () const { return !(coverage & Vertical); } enum Coverage { @@ -760,7 +759,7 @@ struct KerxSubTableHeader SubtableType= 0x000000FFu, /* Subtable type. */ }; - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -778,11 +777,11 @@ struct KerxSubTable { 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 & u.header.SubtableType; } + unsigned int get_size () const { return u.header.length; } + unsigned int get_type () const { return u.header.coverage & u.header.SubtableType; } template - inline typename context_t::return_t dispatch (context_t *c) const + typename context_t::return_t dispatch (context_t *c) const { unsigned int subtable_type = get_type (); TRACE_DISPATCH (this, subtable_type); @@ -796,7 +795,7 @@ struct KerxSubTable } } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (!u.header.sanitize (c) || @@ -829,9 +828,9 @@ template struct KerxTable { /* https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern */ - inline const T* thiz (void) const { return static_cast (this); } + const T* thiz () const { return static_cast (this); } - inline bool has_state_machine (void) const + bool has_state_machine () const { typedef typename T::SubTable SubTable; @@ -846,7 +845,7 @@ struct KerxTable return false; } - inline bool has_cross_stream (void) const + bool has_cross_stream () const { typedef typename T::SubTable SubTable; @@ -861,7 +860,7 @@ struct KerxTable return false; } - inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const + int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const { typedef typename T::SubTable SubTable; @@ -879,7 +878,7 @@ struct KerxTable return v; } - inline bool apply (AAT::hb_aat_apply_context_t *c) const + bool apply (AAT::hb_aat_apply_context_t *c) const { typedef typename T::SubTable SubTable; @@ -943,11 +942,11 @@ struct KerxTable return ret; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (unlikely (!thiz()->version.sanitize (c) || - thiz()->version < T::minVersion || + (unsigned) thiz()->version < (unsigned) T::minVersion || !thiz()->tableCount.sanitize (c))) return_trace (false); @@ -982,14 +981,14 @@ struct kerx : KerxTable { friend struct KerxTable; - static const hb_tag_t tableTag = HB_AAT_TAG_kerx; - static const uint16_t minVersion = 2; + enum { tableTag = HB_AAT_TAG_kerx }; + enum { minVersion = 2u }; typedef KerxSubTableHeader SubTableHeader; typedef SubTableHeader::Types Types; typedef KerxSubTable SubTable; - inline bool has_data (void) const { return version; } + bool has_data () const { return version; } protected: HBUINT16 version; /* The version number of the extended kerning table diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-lcar-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-lcar-table.hh index 40d34f59bf0..cac96971721 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-lcar-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-lcar-table.hh @@ -40,14 +40,14 @@ typedef ArrayOf LigCaretClassEntry; struct lcar { - static const hb_tag_t tableTag = HB_AAT_TAG_lcar; + enum { tableTag = HB_AAT_TAG_lcar }; - inline unsigned int get_lig_carets (hb_font_t *font, - hb_direction_t direction, - hb_codepoint_t glyph, - unsigned int start_offset, - unsigned int *caret_count /* IN/OUT */, - hb_position_t *caret_array /* OUT */) const + unsigned int get_lig_carets (hb_font_t *font, + hb_direction_t direction, + hb_codepoint_t glyph, + unsigned int start_offset, + unsigned int *caret_count /* IN/OUT */, + hb_position_t *caret_array /* OUT */) const { const OffsetTo* entry_offset = lookup.get_value (glyph, font->face->get_num_glyphs ()); @@ -70,7 +70,7 @@ struct lcar return array.len; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && 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 171ee4a10b2..c7600aa25dc 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 @@ -54,7 +54,7 @@ struct RearrangementSubtable struct driver_context_t { - static const bool in_place = true; + enum { in_place = true }; enum Flags { MarkFirst = 0x8000, /* If set, make the current glyph the first @@ -69,17 +69,17 @@ struct RearrangementSubtable Verb = 0x000F, /* The type of rearrangement specified. */ }; - inline driver_context_t (const RearrangementSubtable *table HB_UNUSED) : + driver_context_t (const RearrangementSubtable *table HB_UNUSED) : ret (false), start (0), end (0) {} - inline bool is_actionable (StateTableDriver *driver HB_UNUSED, - const Entry *entry) + bool is_actionable (StateTableDriver *driver HB_UNUSED, + const Entry *entry) { return (entry->flags & Verb) && start < end; } - inline bool transition (StateTableDriver *driver, - const Entry *entry) + bool transition (StateTableDriver *driver, + const Entry *entry) { hb_buffer_t *buffer = driver->buffer; unsigned int flags = entry->flags; @@ -163,7 +163,7 @@ struct RearrangementSubtable unsigned int end; }; - inline bool apply (hb_aat_apply_context_t *c) const + bool apply (hb_aat_apply_context_t *c) const { TRACE_APPLY (this); @@ -175,7 +175,7 @@ struct RearrangementSubtable return_trace (dc.ret); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (machine.sanitize (c)); @@ -204,7 +204,7 @@ struct ContextualSubtable struct driver_context_t { - static const bool in_place = true; + enum { in_place = true }; enum Flags { SetMark = 0x8000, /* If set, make the current glyph the marked glyph. */ @@ -213,7 +213,7 @@ struct ContextualSubtable Reserved = 0x3FFF, /* These bits are reserved and should be set to 0. */ }; - inline driver_context_t (const ContextualSubtable *table_, + driver_context_t (const ContextualSubtable *table_, hb_aat_apply_context_t *c_) : ret (false), c (c_), @@ -222,8 +222,8 @@ struct ContextualSubtable table (table_), subs (table+table->substitutionTables) {} - inline bool is_actionable (StateTableDriver *driver, - const Entry *entry) + bool is_actionable (StateTableDriver *driver, + const Entry *entry) { hb_buffer_t *buffer = driver->buffer; @@ -232,8 +232,8 @@ struct ContextualSubtable return entry->data.markIndex != 0xFFFF || entry->data.currentIndex != 0xFFFF; } - inline bool transition (StateTableDriver *driver, - const Entry *entry) + bool transition (StateTableDriver *driver, + const Entry *entry) { hb_buffer_t *buffer = driver->buffer; @@ -311,7 +311,7 @@ struct ContextualSubtable const UnsizedOffsetListOf, HBUINT, false> &subs; }; - inline bool apply (hb_aat_apply_context_t *c) const + bool apply (hb_aat_apply_context_t *c) const { TRACE_APPLY (this); @@ -323,7 +323,7 @@ struct ContextualSubtable return_trace (dc.ret); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); @@ -384,10 +384,10 @@ struct LigatureEntry DEFINE_SIZE_STATIC (2); }; - static inline bool performAction (const Entry *entry) + static bool performAction (const Entry *entry) { return entry->flags & PerformAction; } - static inline unsigned int ligActionIndex (const Entry *entry) + static unsigned int ligActionIndex (const Entry *entry) { return entry->data.ligActionIndex; } }; template <> @@ -406,10 +406,10 @@ struct LigatureEntry typedef void EntryData; - static inline bool performAction (const Entry *entry) + static bool performAction (const Entry *entry) { return entry->flags & Offset; } - static inline unsigned int ligActionIndex (const Entry *entry) + static unsigned int ligActionIndex (const Entry *entry) { return entry->flags & Offset; } }; @@ -424,7 +424,7 @@ struct LigatureSubtable struct driver_context_t { - static const bool in_place = false; + enum { in_place = false }; enum { DontAdvance = LigatureEntryT::DontAdvance, @@ -441,8 +441,8 @@ struct LigatureSubtable * into the component table. */ }; - inline driver_context_t (const LigatureSubtable *table_, - hb_aat_apply_context_t *c_) : + driver_context_t (const LigatureSubtable *table_, + hb_aat_apply_context_t *c_) : ret (false), c (c_), table (table_), @@ -451,13 +451,13 @@ struct LigatureSubtable ligature (table+table->ligature), match_length (0) {} - inline bool is_actionable (StateTableDriver *driver HB_UNUSED, - const Entry *entry) + bool is_actionable (StateTableDriver *driver HB_UNUSED, + const Entry *entry) { return LigatureEntryT::performAction (entry); } - inline bool transition (StateTableDriver *driver, - const Entry *entry) + bool transition (StateTableDriver *driver, + const Entry *entry) { hb_buffer_t *buffer = driver->buffer; @@ -567,7 +567,7 @@ struct LigatureSubtable unsigned int match_positions[HB_MAX_CONTEXT_LENGTH]; }; - inline bool apply (hb_aat_apply_context_t *c) const + bool apply (hb_aat_apply_context_t *c) const { TRACE_APPLY (this); @@ -579,7 +579,7 @@ struct LigatureSubtable return_trace (dc.ret); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); /* The rest of array sanitizations are done at run-time. */ @@ -603,7 +603,7 @@ struct LigatureSubtable template struct NoncontextualSubtable { - inline bool apply (hb_aat_apply_context_t *c) const + bool apply (hb_aat_apply_context_t *c) const { TRACE_APPLY (this); @@ -625,7 +625,7 @@ struct NoncontextualSubtable return_trace (ret); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (substitute.sanitize (c)); @@ -660,7 +660,7 @@ struct InsertionSubtable struct driver_context_t { - static const bool in_place = false; + enum { in_place = false }; enum Flags { SetMark = 0x8000, /* If set, mark the current glyph. */ @@ -709,22 +709,22 @@ struct InsertionSubtable * marked location is 31 glyphs. */ }; - inline driver_context_t (const InsertionSubtable *table, - hb_aat_apply_context_t *c_) : + 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 HB_UNUSED, - const Entry *entry) + bool is_actionable (StateTableDriver *driver HB_UNUSED, + const Entry *entry) { return (entry->flags & (CurrentInsertCount | MarkedInsertCount)) && (entry->data.currentInsertIndex != 0xFFFF ||entry->data.markedInsertIndex != 0xFFFF); } - inline bool transition (StateTableDriver *driver, - const Entry *entry) + bool transition (StateTableDriver *driver, + const Entry *entry) { hb_buffer_t *buffer = driver->buffer; unsigned int flags = entry->flags; @@ -809,7 +809,7 @@ struct InsertionSubtable const UnsizedArrayOf &insertionAction; }; - inline bool apply (hb_aat_apply_context_t *c) const + bool apply (hb_aat_apply_context_t *c) const { TRACE_APPLY (this); @@ -821,7 +821,7 @@ struct InsertionSubtable return_trace (dc.ret); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); /* The rest of array sanitizations are done at run-time. */ @@ -842,7 +842,7 @@ struct InsertionSubtable struct Feature { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); @@ -868,9 +868,9 @@ struct ChainSubtable template 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_coverage (void) const { return coverage >> (sizeof (HBUINT) * 8 - 8); } + unsigned int get_size () const { return length; } + unsigned int get_type () const { return coverage & 0xFF; } + unsigned int get_coverage () const { return coverage >> (sizeof (HBUINT) * 8 - 8); } enum Coverage { @@ -897,7 +897,7 @@ struct ChainSubtable }; template - inline typename context_t::return_t dispatch (context_t *c) const + typename context_t::return_t dispatch (context_t *c) const { unsigned int subtable_type = get_type (); TRACE_DISPATCH (this, subtable_type); @@ -911,14 +911,14 @@ struct ChainSubtable } } - inline bool apply (hb_aat_apply_context_t *c) const + bool apply (hb_aat_apply_context_t *c) const { TRACE_APPLY (this); hb_sanitize_with_object_t with (&c->sanitizer, this); return_trace (dispatch (c)); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (!length.sanitize (c) || @@ -950,7 +950,7 @@ struct Chain { typedef typename Types::HBUINT HBUINT; - inline hb_mask_t compile_flags (const hb_aat_map_builder_t *map) const + hb_mask_t compile_flags (const hb_aat_map_builder_t *map) const { hb_mask_t flags = defaultFlags; { @@ -979,7 +979,7 @@ struct Chain return flags; } - inline void apply (hb_aat_apply_context_t *c, + void apply (hb_aat_apply_context_t *c, hb_mask_t flags) const { const ChainSubtable *subtable = &StructAfter > (featureZ.as_array (featureCount)); @@ -1049,9 +1049,9 @@ struct Chain } } - inline unsigned int get_size (void) const { return length; } + unsigned int get_size () const { return length; } - inline bool sanitize (hb_sanitize_context_t *c, unsigned int version HB_UNUSED) const + bool sanitize (hb_sanitize_context_t *c, unsigned int version HB_UNUSED) const { TRACE_SANITIZE (this); if (!length.sanitize (c) || @@ -1096,12 +1096,12 @@ struct Chain template struct mortmorx { - static const hb_tag_t tableTag = HB_AAT_TAG_morx; + enum { tableTag = HB_AAT_TAG_morx }; - inline bool has_data (void) const { return version != 0; } + bool has_data () const { return version != 0; } - inline void compile_flags (const hb_aat_map_builder_t *mapper, - hb_aat_map_t *map) const + void compile_flags (const hb_aat_map_builder_t *mapper, + hb_aat_map_t *map) const { const Chain *chain = &firstChain; unsigned int count = chainCount; @@ -1112,7 +1112,7 @@ struct mortmorx } } - inline void apply (hb_aat_apply_context_t *c) const + void apply (hb_aat_apply_context_t *c) const { if (unlikely (!c->buffer->successful)) return; c->set_lookup_index (0); @@ -1126,7 +1126,7 @@ struct mortmorx } } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (!version.sanitize (c) || !version || !chainCount.sanitize (c)) @@ -1158,11 +1158,11 @@ struct mortmorx struct morx : mortmorx { - static const hb_tag_t tableTag = HB_AAT_TAG_morx; + enum { tableTag = HB_AAT_TAG_morx }; }; struct mort : mortmorx { - static const hb_tag_t tableTag = HB_AAT_TAG_mort; + enum { tableTag = HB_AAT_TAG_mort }; }; 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 5474d1d11b8..0648f6175f7 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,25 +46,19 @@ struct TrackTableEntry { friend struct TrackData; - inline float get_track_value () const - { - return track.to_float (); - } + float get_track_value () const { return track.to_float (); } - inline int get_value (const void *base, - unsigned int index, - unsigned int nSizes) const - { - return (base+valuesZ).as_array (nSizes)[index]; - } + int get_value (const void *base, unsigned int index, + unsigned int table_size) const + { return (base+valuesZ).as_array (table_size)[index]; } public: - inline bool sanitize (hb_sanitize_context_t *c, const void *base, - unsigned int nSizes) const + bool sanitize (hb_sanitize_context_t *c, const void *base, + unsigned int table_size) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && - (valuesZ.sanitize (c, base, nSizes)))); + (valuesZ.sanitize (c, base, table_size)))); } protected: @@ -82,10 +76,10 @@ struct TrackTableEntry struct TrackData { - inline float interpolate_at (unsigned int idx, - float target_size, - const TrackTableEntry &trackTableEntry, - const void *base) const + float interpolate_at (unsigned int idx, + float target_size, + const TrackTableEntry &trackTableEntry, + const void *base) const { unsigned int sizes = nSizes; hb_array_t size_table ((base+sizeTable).arrayZ, sizes); @@ -97,7 +91,7 @@ struct TrackData (1.f - t) * trackTableEntry.get_value (base, idx, sizes); } - inline int get_tracking (const void *base, float ptem) const + int get_tracking (const void *base, float ptem) const { /* CoreText points are CSS pixels (96 per inch), * NOT typographic points (72 per inch). @@ -143,7 +137,7 @@ struct TrackData *trackTableEntry, base)); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -166,11 +160,11 @@ struct TrackData struct trak { - static const hb_tag_t tableTag = HB_AAT_TAG_trak; + enum { tableTag = HB_AAT_TAG_trak }; - inline bool has_data (void) const { return version.to_int (); } + bool has_data () const { return version.to_int (); } - inline bool apply (hb_aat_apply_context_t *c) const + bool apply (hb_aat_apply_context_t *c) const { TRACE_APPLY (this); @@ -211,7 +205,7 @@ struct trak return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); 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 fae67800c00..8de8205f574 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 @@ -29,6 +29,7 @@ #include "hb-ot-face.hh" #include "hb-aat-layout.hh" +#include "hb-aat-fdsc-table.hh" // Just so we compile it; unused otherwise. #include "hb-aat-layout-ankr-table.hh" #include "hb-aat-layout-bsln-table.hh" // Just so we compile it; unused otherwise. #include "hb-aat-layout-feat-table.hh" @@ -166,10 +167,8 @@ AAT::hb_aat_apply_context_t::hb_aat_apply_context_t (const hb_ot_shape_plan_t *p sanitizer.set_max_ops (HB_SANITIZE_MAX_OPS_MAX); } -AAT::hb_aat_apply_context_t::~hb_aat_apply_context_t (void) -{ - sanitizer.end_processing (); -} +AAT::hb_aat_apply_context_t::~hb_aat_apply_context_t () +{ sanitizer.end_processing (); } void AAT::hb_aat_apply_context_t::set_ankr_table (const AAT::ankr *ankr_table_, @@ -205,7 +204,14 @@ hb_aat_layout_compile_map (const hb_aat_map_builder_t *mapper, } -bool +/* + * hb_aat_layout_has_substitution: + * @face: + * + * Returns: + * Since: 2.3.0 + */ +hb_bool_t hb_aat_layout_has_substitution (hb_face_t *face) { return face->table.morx->has_data () || @@ -259,9 +265,14 @@ hb_aat_layout_remove_deleted_glyphs (hb_buffer_t *buffer) hb_ot_layout_delete_glyphs_inplace (buffer, is_deleted_glyph); } - - -bool +/* + * hb_aat_layout_has_positioning: + * @face: + * + * Returns: + * Since: 2.3.0 + */ +hb_bool_t hb_aat_layout_has_positioning (hb_face_t *face) { return face->table.kerx->has_data (); @@ -284,7 +295,14 @@ hb_aat_layout_position (const hb_ot_shape_plan_t *plan, } -bool +/* + * hb_aat_layout_has_tracking: + * @face: + * + * Returns: + * Since: 2.3.0 + */ +hb_bool_t hb_aat_layout_has_tracking (hb_face_t *face) { return face->table.trak->has_data (); @@ -341,7 +359,9 @@ hb_aat_layout_get_feature_types (hb_face_t *face, hb_ot_name_id_t hb_aat_layout_feature_type_get_name_id (hb_face_t *face, hb_aat_layout_feature_type_t feature_type) -{ return face->table.feat->get_feature_name_id (feature_type); } +{ + return face->table.feat->get_feature_name_id (feature_type); +} /** * hb_aat_layout_feature_type_get_selectors: diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout.h b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout.h index 696e9033409..760aaae40a6 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout.h +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout.h @@ -457,6 +457,30 @@ hb_aat_layout_feature_type_get_selector_infos (hb_face_t unsigned int *default_index /* OUT. May be NULL. */); +/* + * morx/mort + */ + +HB_EXTERN hb_bool_t +hb_aat_layout_has_substitution (hb_face_t *face); + + +/* + * kerx + */ + +HB_EXTERN hb_bool_t +hb_aat_layout_has_positioning (hb_face_t *face); + + +/* + * trak + */ + +HB_EXTERN hb_bool_t +hb_aat_layout_has_tracking (hb_face_t *face); + + HB_END_DECLS #endif /* HB_AAT_LAYOUT_H */ 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 5fd47ed62ad..8346d9f00b5 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 @@ -39,7 +39,7 @@ struct hb_aat_feature_mapping_t hb_aat_layout_feature_selector_t selectorToEnable; hb_aat_layout_feature_selector_t selectorToDisable; - static inline int cmp (const void *key_, const void *entry_) + static 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_; @@ -56,9 +56,6 @@ HB_INTERNAL void hb_aat_layout_compile_map (const hb_aat_map_builder_t *mapper, hb_aat_map_t *map); -HB_INTERNAL bool -hb_aat_layout_has_substitution (hb_face_t *face); - HB_INTERNAL void hb_aat_layout_substitute (const hb_ot_shape_plan_t *plan, hb_font_t *font, @@ -70,17 +67,11 @@ hb_aat_layout_zero_width_deleted_glyphs (hb_buffer_t *buffer); HB_INTERNAL void hb_aat_layout_remove_deleted_glyphs (hb_buffer_t *buffer); -HB_INTERNAL bool -hb_aat_layout_has_positioning (hb_face_t *face); - HB_INTERNAL void hb_aat_layout_position (const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer); -HB_INTERNAL bool -hb_aat_layout_has_tracking (hb_face_t *face); - HB_INTERNAL void hb_aat_layout_track (const hb_ot_shape_plan_t *plan, hb_font_t *font, 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 8a42b3510bf..3b00b55914e 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 @@ -43,7 +43,7 @@ struct FTStringRange { friend struct ltag; - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && (base+tag).sanitize (c, length)); @@ -60,16 +60,16 @@ struct FTStringRange struct ltag { - static const hb_tag_t tableTag = HB_AAT_TAG_ltag; + enum { tableTag = HB_AAT_TAG_ltag }; - inline hb_language_t get_language (unsigned int i) const + hb_language_t get_language (unsigned int i) const { const FTStringRange &range = tagRanges[i]; return hb_language_from_string ((const char *) (this+range.tag).arrayZ, range.length); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-map.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-map.hh index b033e336872..fa312dbec39 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-map.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-map.hh @@ -36,15 +36,12 @@ struct hb_aat_map_t public: - inline void init (void) + void init () { memset (this, 0, sizeof (*this)); chain_flags.init (); } - inline void fini (void) - { - chain_flags.fini (); - } + void fini () { chain_flags.fini (); } public: hb_vector_t chain_flags; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-array.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-array.hh new file mode 100644 index 00000000000..d4df16546cd --- /dev/null +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-array.hh @@ -0,0 +1,274 @@ +/* + * Copyright © 2018 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_ARRAY_HH +#define HB_ARRAY_HH + +#include "hb.hh" + + +template +struct hb_sorted_array_t; + +template +struct hb_array_t +{ + typedef Type ItemType; + enum { item_size = hb_static_size (Type) }; + + /* + * Constructors. + */ + hb_array_t () : arrayZ (nullptr), len (0) {} + hb_array_t (const hb_array_t &o) : arrayZ (o.arrayZ), len (o.len) {} + hb_array_t (Type *array_, unsigned int len_) : arrayZ (array_), len (len_) {} + template hb_array_t (Type (&array_)[len_]) : arrayZ (array_), len (len_) {} + + /* + * Operators. + */ + + Type& operator [] (int i_) const + { + unsigned int i = (unsigned int) i_; + if (unlikely (i >= len)) return CrapOrNull(Type); + return arrayZ[i]; + } + + explicit_operator bool () const { return len; } + Type * operator & () const { return arrayZ; } + Type & operator * () { return (this->operator [])[0]; } + operator hb_array_t () { return hb_array_t (arrayZ, len); } + template operator T * () const { return arrayZ; } + + hb_array_t & operator += (unsigned int count) + { + if (unlikely (count > len)) + count = len; + len -= count; + arrayZ += count; + return *this; + } + hb_array_t & operator -= (unsigned int count) + { + if (unlikely (count > len)) + count = len; + len -= count; + return *this; + } + hb_array_t & operator ++ () { *this += 1; } + hb_array_t & operator -- () { *this -= 1; } + hb_array_t operator + (unsigned int count) + { hb_array_t copy (*this); *this += count; return copy; } + hb_array_t operator - (unsigned int count) + { hb_array_t copy (*this); *this -= count; return copy; } + hb_array_t operator ++ (int) + { hb_array_t copy (*this); ++*this; return copy; } + hb_array_t operator -- (int) + { hb_array_t copy (*this); --*this; return copy; } + + /* + * Compare, Sort, and Search. + */ + + /* Note: our compare is NOT lexicographic; it also does NOT call Type::cmp. */ + int cmp (const hb_array_t &a) const + { + if (len != a.len) + return (int) a.len - (int) len; + return hb_memcmp (a.arrayZ, arrayZ, get_size ()); + } + static int cmp (const void *pa, const void *pb) + { + hb_array_t *a = (hb_array_t *) pa; + hb_array_t *b = (hb_array_t *) pb; + return b->cmp (*a); + } + + template + Type *lsearch (const T &x, Type *not_found = nullptr) + { + unsigned int count = len; + for (unsigned int i = 0; i < count; i++) + if (!this->arrayZ[i].cmp (x)) + return &this->arrayZ[i]; + return not_found; + } + template + const Type *lsearch (const T &x, const Type *not_found = nullptr) const + { + unsigned int count = len; + for (unsigned int i = 0; i < count; i++) + if (!this->arrayZ[i].cmp (x)) + return &this->arrayZ[i]; + return not_found; + } + + hb_sorted_array_t qsort (int (*cmp_)(const void*, const void*)) + { + ::qsort (arrayZ, len, item_size, cmp_); + return hb_sorted_array_t (*this); + } + hb_sorted_array_t qsort () + { + ::qsort (arrayZ, len, item_size, Type::cmp); + return hb_sorted_array_t (*this); + } + void qsort (unsigned int start, unsigned int end) + { + end = MIN (end, len); + assert (start <= end); + ::qsort (arrayZ + start, end - start, item_size, Type::cmp); + } + + /* + * Other methods. + */ + + unsigned int get_size () const { return len * item_size; } + + hb_array_t sub_array (unsigned int start_offset = 0, unsigned int *seg_count = nullptr /* IN/OUT */) const + { + if (!start_offset && !seg_count) + return *this; + + unsigned int count = len; + if (unlikely (start_offset > count)) + count = 0; + else + count -= start_offset; + if (seg_count) + count = *seg_count = MIN (count, *seg_count); + return hb_array_t (arrayZ + start_offset, count); + } + hb_array_t sub_array (unsigned int start_offset, unsigned int seg_count) const + { return sub_array (start_offset, &seg_count); } + + /* Only call if you allocated the underlying array using malloc() or similar. */ + void free () + { ::free ((void *) arrayZ); arrayZ = nullptr; len = 0; } + + template + bool sanitize (hb_sanitize_context_t *c) const + { return c->check_array (arrayZ, len); } + + /* + * Members + */ + + public: + Type *arrayZ; + unsigned int len; +}; +template +inline hb_array_t hb_array (T *array, unsigned int len) +{ return hb_array_t (array, len); } + + +enum hb_bfind_not_found_t +{ + HB_BFIND_NOT_FOUND_DONT_STORE, + HB_BFIND_NOT_FOUND_STORE, + HB_BFIND_NOT_FOUND_STORE_CLOSEST, +}; + +template +struct hb_sorted_array_t : hb_array_t +{ + hb_sorted_array_t () : hb_array_t () {} + hb_sorted_array_t (const hb_array_t &o) : hb_array_t (o) {} + hb_sorted_array_t (Type *array_, unsigned int len_) : hb_array_t (array_, len_) {} + + hb_sorted_array_t sub_array (unsigned int start_offset, unsigned int *seg_count /* IN/OUT */) const + { return hb_sorted_array_t (((const hb_array_t *) (this))->sub_array (start_offset, seg_count)); } + hb_sorted_array_t sub_array (unsigned int start_offset, unsigned int seg_count) const + { return sub_array (start_offset, &seg_count); } + + template + Type *bsearch (const T &x, Type *not_found = nullptr) + { + unsigned int i; + return bfind (x, &i) ? &this->arrayZ[i] : not_found; + } + template + const Type *bsearch (const T &x, const Type *not_found = nullptr) const + { + unsigned int i; + return bfind (x, &i) ? &this->arrayZ[i] : not_found; + } + template + bool bfind (const T &x, unsigned int *i = nullptr, + hb_bfind_not_found_t not_found = HB_BFIND_NOT_FOUND_DONT_STORE, + unsigned int to_store = (unsigned int) -1) const + { + int min = 0, max = (int) this->len - 1; + const Type *array = this->arrayZ; + while (min <= max) + { + int mid = ((unsigned int) min + (unsigned int) max) / 2; + int c = array[mid].cmp (x); + if (c < 0) + max = mid - 1; + else if (c > 0) + min = mid + 1; + else + { + if (i) + *i = mid; + return true; + } + } + if (i) + { + switch (not_found) + { + case HB_BFIND_NOT_FOUND_DONT_STORE: + break; + + case HB_BFIND_NOT_FOUND_STORE: + *i = to_store; + break; + + case HB_BFIND_NOT_FOUND_STORE_CLOSEST: + if (max < 0 || (max < (int) this->len && array[max].cmp (x) > 0)) + max++; + *i = max; + break; + } + } + return false; + } +}; +template +inline hb_sorted_array_t hb_sorted_array (T *array, unsigned int len) +{ return hb_sorted_array_t (array, len); } + + +typedef hb_array_t hb_bytes_t; +typedef hb_array_t hb_ubytes_t; + + +#endif /* HB_ARRAY_HH */ 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 265de1267ac..9321932e06f 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-atomic.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-atomic.hh @@ -104,7 +104,7 @@ _hb_atomic_ptr_impl_cmplexch (const void **P, const void *O_, const void *N) #include -static inline void _hb_memory_barrier (void) +static inline void _hb_memory_barrier () { #if !defined(MemoryBarrier) /* MinGW has a convoluted history of supporting MemoryBarrier. */ @@ -143,7 +143,7 @@ static_assert ((sizeof (LONG) == sizeof (int)), ""); static inline int _hb_fetch_and_add (int *AI, int V) { _hb_memory_w_barrier (); - int result = atomic_add_int_nv ((uint_t *) AI, V); + int result = atomic_add_int_nv ((uint_t *) AI, V) - V; _hb_memory_r_barrier (); return result; } @@ -267,12 +267,12 @@ inline void *hb_atomic_ptr_impl_get (void ** const P) { void *v = *P; _hb_memory #define HB_ATOMIC_INT_INIT(V) {V} struct hb_atomic_int_t { - inline void set_relaxed (int v_) { hb_atomic_int_impl_set_relaxed (&v, v_); } - inline void set (int v_) { 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); } + void set_relaxed (int v_) { hb_atomic_int_impl_set_relaxed (&v, v_); } + void set (int v_) { hb_atomic_int_impl_set (&v, v_); } + int get_relaxed () const { return hb_atomic_int_impl_get_relaxed (&v); } + int get () const { return hb_atomic_int_impl_get (&v); } + int inc () { return hb_atomic_int_impl_add (&v, 1); } + int dec () { return hb_atomic_int_impl_add (&v, -1); } int v; }; @@ -284,14 +284,14 @@ struct hb_atomic_ptr_t { typedef typename hb_remove_pointer (P) T; - inline void init (T* v_ = nullptr) { set_relaxed (v_); } - inline void set_relaxed (T* v_) { hb_atomic_ptr_impl_set_relaxed (&v, 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 ((void **) &v, (void *) old, (void *) new_); } + void init (T* v_ = nullptr) { set_relaxed (v_); } + void set_relaxed (T* v_) { hb_atomic_ptr_impl_set_relaxed (&v, v_); } + T *get_relaxed () const { return (T *) hb_atomic_ptr_impl_get_relaxed (&v); } + T *get () const { return (T *) hb_atomic_ptr_impl_get ((void **) &v); } + bool cmpexch (const T *old, T *new_) const { return hb_atomic_ptr_impl_cmpexch ((void **) &v, (void *) old, (void *) new_); } - inline T * operator -> (void) const { return get (); } - template inline operator C * (void) const { return get (); } + T * operator -> () const { return get (); } + template operator C * () const { return get (); } 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 8ebedca7887..b53b20bd147 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc @@ -188,7 +188,7 @@ hb_blob_copy_writable_or_fail (hb_blob_t *blob) * Since: 0.9.2 **/ hb_blob_t * -hb_blob_get_empty (void) +hb_blob_get_empty () { return const_cast (&Null(hb_blob_t)); } @@ -378,7 +378,7 @@ hb_blob_get_data_writable (hb_blob_t *blob, unsigned int *length) bool -hb_blob_t::try_make_writable_inplace_unix (void) +hb_blob_t::try_make_writable_inplace_unix () { #if defined(HAVE_SYS_MMAN_H) && defined(HAVE_MPROTECT) uintptr_t pagesize = -1, mask, length; @@ -421,7 +421,7 @@ hb_blob_t::try_make_writable_inplace_unix (void) } bool -hb_blob_t::try_make_writable_inplace (void) +hb_blob_t::try_make_writable_inplace () { DEBUG_MSG_FUNC (BLOB, this, "making writable inplace\n"); @@ -436,7 +436,7 @@ hb_blob_t::try_make_writable_inplace (void) } bool -hb_blob_t::try_make_writable (void) +hb_blob_t::try_make_writable () { if (hb_object_is_immutable (this)) return false; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.hh index bf2132bda99..4ea13f81370 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.hh @@ -38,12 +38,9 @@ struct hb_blob_t { - inline void fini_shallow (void) - { - destroy_user_data (); - } + void fini_shallow () { destroy_user_data (); } - inline void destroy_user_data (void) + void destroy_user_data () { if (destroy) { @@ -53,19 +50,17 @@ struct hb_blob_t } } - HB_INTERNAL bool try_make_writable (void); - HB_INTERNAL bool try_make_writable_inplace (void); - HB_INTERNAL bool try_make_writable_inplace_unix (void); + HB_INTERNAL bool try_make_writable (); + HB_INTERNAL bool try_make_writable_inplace (); + HB_INTERNAL bool try_make_writable_inplace_unix (); template - inline const Type* as (void) const + const Type* as () const { return length < hb_null_size (Type) ? &Null(Type) : reinterpret_cast (data); } - inline hb_bytes_t as_bytes (void) const - { - return hb_bytes_t (data, length); - } + hb_bytes_t as_bytes () const + { return hb_bytes_t (data, length); } public: hb_object_header_t header; @@ -88,16 +83,16 @@ struct hb_blob_ptr_t { typedef typename hb_remove_pointer (P) T; - inline hb_blob_ptr_t (hb_blob_t *b_ = nullptr) : b (b_) {} - inline hb_blob_t * operator = (hb_blob_t *b_) { return b = b_; } - inline const T * operator -> (void) const { return get (); } - inline const T & operator * (void) const { return *get (); } - template inline operator const C * (void) const { return get (); } - inline operator const char * (void) const { return (const char *) get (); } - inline const T * get (void) const { return b->as (); } - inline hb_blob_t * get_blob (void) const { return b.get_raw (); } - inline unsigned int get_length (void) const { return b.get ()->length; } - inline void destroy (void) { hb_blob_destroy (b.get ()); b = nullptr; } + hb_blob_ptr_t (hb_blob_t *b_ = nullptr) : b (b_) {} + hb_blob_t * operator = (hb_blob_t *b_) { return b = b_; } + const T * operator -> () const { return get (); } + const T & operator * () const { return *get (); } + template operator const C * () const { return get (); } + operator const char * () const { return (const char *) get (); } + const T * get () const { return b->as (); } + hb_blob_t * get_blob () const { return b.get_raw (); } + unsigned int get_length () const { return b.get ()->length; } + void destroy () { hb_blob_destroy (b.get ()); b = nullptr; } hb_nonnull_ptr_t b; }; 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 1bd603d4474..6e265e84c6c 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 @@ -44,7 +44,7 @@ static const char *serialize_formats[] = { * Since: 0.9.7 **/ const char ** -hb_buffer_serialize_list_formats (void) +hb_buffer_serialize_list_formats () { return serialize_formats; } @@ -246,7 +246,7 @@ _hb_buffer_serialize_glyphs_text (hb_buffer_t *buffer, if (flags & HB_BUFFER_SERIALIZE_FLAG_GLYPH_FLAGS) { - if (info[i].mask &HB_GLYPH_FLAG_DEFINED) + if (info[i].mask & HB_GLYPH_FLAG_DEFINED) p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "#%X", info[i].mask &HB_GLYPH_FLAG_DEFINED)); } 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 1a5547b35f3..2dc02e9d657 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc @@ -215,7 +215,7 @@ hb_buffer_t::get_scratch_buffer (unsigned int *size) /* HarfBuzz-Internal API */ void -hb_buffer_t::reset (void) +hb_buffer_t::reset () { if (unlikely (hb_object_is_immutable (this))) return; @@ -230,7 +230,7 @@ hb_buffer_t::reset (void) } void -hb_buffer_t::clear (void) +hb_buffer_t::clear () { if (unlikely (hb_object_is_immutable (this))) return; @@ -287,7 +287,7 @@ hb_buffer_t::add_info (const hb_glyph_info_t &glyph_info) void -hb_buffer_t::remove_output (void) +hb_buffer_t::remove_output () { if (unlikely (hb_object_is_immutable (this))) return; @@ -300,7 +300,7 @@ hb_buffer_t::remove_output (void) } void -hb_buffer_t::clear_output (void) +hb_buffer_t::clear_output () { if (unlikely (hb_object_is_immutable (this))) return; @@ -313,7 +313,7 @@ hb_buffer_t::clear_output (void) } void -hb_buffer_t::clear_positions (void) +hb_buffer_t::clear_positions () { if (unlikely (hb_object_is_immutable (this))) return; @@ -328,7 +328,7 @@ hb_buffer_t::clear_positions (void) } void -hb_buffer_t::swap_buffers (void) +hb_buffer_t::swap_buffers () { if (unlikely (!successful)) return; @@ -480,7 +480,7 @@ hb_buffer_t::reverse_range (unsigned int start, } void -hb_buffer_t::reverse (void) +hb_buffer_t::reverse () { if (unlikely (!len)) return; @@ -489,7 +489,7 @@ hb_buffer_t::reverse (void) } void -hb_buffer_t::reverse_clusters (void) +hb_buffer_t::reverse_clusters () { unsigned int i, start, count, last_cluster; @@ -636,7 +636,7 @@ hb_buffer_t::unsafe_to_break_from_outbuffer (unsigned int start, unsigned int en } void -hb_buffer_t::guess_segment_properties (void) +hb_buffer_t::guess_segment_properties () { assert (content_type == HB_BUFFER_CONTENT_TYPE_UNICODE || (!len && content_type == HB_BUFFER_CONTENT_TYPE_INVALID)); @@ -709,7 +709,7 @@ DEFINE_NULL_INSTANCE (hb_buffer_t) = * Since: 0.9.2 **/ hb_buffer_t * -hb_buffer_create (void) +hb_buffer_create () { hb_buffer_t *buffer; @@ -727,14 +727,14 @@ hb_buffer_create (void) /** * hb_buffer_get_empty: * - * + * * * Return value: (transfer full): * * Since: 0.9.2 **/ hb_buffer_t * -hb_buffer_get_empty (void) +hb_buffer_get_empty () { return const_cast (&Null(hb_buffer_t)); } @@ -785,14 +785,14 @@ hb_buffer_destroy (hb_buffer_t *buffer) /** * hb_buffer_set_user_data: (skip) * @buffer: an #hb_buffer_t. - * @key: - * @data: - * @destroy: - * @replace: + * @key: + * @data: + * @destroy: + * @replace: * - * * - * Return value: + * + * Return value: * * Since: 0.9.2 **/ @@ -809,11 +809,11 @@ hb_buffer_set_user_data (hb_buffer_t *buffer, /** * hb_buffer_get_user_data: (skip) * @buffer: an #hb_buffer_t. - * @key: + * @key: * - * * - * Return value: + * + * Return value: * * Since: 0.9.2 **/ @@ -863,9 +863,9 @@ hb_buffer_get_content_type (hb_buffer_t *buffer) /** * hb_buffer_set_unicode_funcs: * @buffer: an #hb_buffer_t. - * @unicode_funcs: + * @unicode_funcs: + * * - * * * Since: 0.9.2 **/ @@ -888,9 +888,9 @@ hb_buffer_set_unicode_funcs (hb_buffer_t *buffer, * hb_buffer_get_unicode_funcs: * @buffer: an #hb_buffer_t. * - * * - * Return value: + * + * Return value: * * Since: 0.9.2 **/ @@ -1094,7 +1094,7 @@ hb_buffer_set_flags (hb_buffer_t *buffer, * * See hb_buffer_set_flags(). * - * Return value: + * Return value: * The @buffer flags. * * Since: 0.9.7 @@ -1108,9 +1108,9 @@ hb_buffer_get_flags (hb_buffer_t *buffer) /** * hb_buffer_set_cluster_level: * @buffer: an #hb_buffer_t. - * @cluster_level: + * @cluster_level: + * * - * * * Since: 0.9.42 **/ @@ -1128,9 +1128,9 @@ hb_buffer_set_cluster_level (hb_buffer_t *buffer, * hb_buffer_get_cluster_level: * @buffer: an #hb_buffer_t. * - * * - * Return value: + * + * Return value: * * Since: 0.9.42 **/ @@ -1169,7 +1169,7 @@ hb_buffer_set_replacement_codepoint (hb_buffer_t *buffer, * * See hb_buffer_set_replacement_codepoint(). * - * Return value: + * Return value: * The @buffer replacement #hb_codepoint_t. * * Since: 0.9.31 @@ -1209,7 +1209,7 @@ hb_buffer_set_invisible_glyph (hb_buffer_t *buffer, * * See hb_buffer_set_invisible_glyph(). * - * Return value: + * Return value: * The @buffer invisible #hb_codepoint_t. * * Since: 2.0.0 @@ -1320,7 +1320,7 @@ hb_buffer_add (hb_buffer_t *buffer, * Similar to hb_buffer_pre_allocate(), but clears any new items added at the * end. * - * Return value: + * Return value: * %true if @buffer memory allocation succeeded, %false otherwise. * * Since: 0.9.2 @@ -2000,7 +2000,7 @@ hb_buffer_diff (hb_buffer_t *buffer, * @user_data: * @destroy: * - * + * * * Since: 1.1.3 **/ 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 37adeb083bf..8a3170ca9a5 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.hh @@ -137,7 +137,9 @@ struct hb_buffer_t /* Methods */ - inline void allocate_var (unsigned int start, unsigned int count) + bool in_error () const { return !successful; } + + void allocate_var (unsigned int start, unsigned int count) { #ifndef HB_NDEBUG unsigned int end = start + count; @@ -147,7 +149,7 @@ struct hb_buffer_t allocated_var_bits |= bits; #endif } - inline void deallocate_var (unsigned int start, unsigned int count) + void deallocate_var (unsigned int start, unsigned int count) { #ifndef HB_NDEBUG unsigned int end = start + count; @@ -157,7 +159,7 @@ struct hb_buffer_t allocated_var_bits &= ~bits; #endif } - inline void assert_var (unsigned int start, unsigned int count) + void assert_var (unsigned int start, unsigned int count) { #ifndef HB_NDEBUG unsigned int end = start + count; @@ -166,53 +168,51 @@ struct hb_buffer_t assert (bits == (allocated_var_bits & bits)); #endif } - inline void deallocate_var_all (void) + void deallocate_var_all () { #ifndef HB_NDEBUG allocated_var_bits = 0; #endif } - inline hb_glyph_info_t &cur (unsigned int i = 0) { return info[idx + i]; } - inline hb_glyph_info_t cur (unsigned int i = 0) const { return info[idx + i]; } + hb_glyph_info_t &cur (unsigned int i = 0) { return info[idx + i]; } + hb_glyph_info_t cur (unsigned int i = 0) const { return info[idx + i]; } - inline hb_glyph_position_t &cur_pos (unsigned int i = 0) { return pos[idx + i]; } - inline hb_glyph_position_t cur_pos (unsigned int i = 0) const { return pos[idx + i]; } + hb_glyph_position_t &cur_pos (unsigned int i = 0) { return pos[idx + i]; } + hb_glyph_position_t cur_pos (unsigned int i = 0) const { return pos[idx + i]; } - inline hb_glyph_info_t &prev (void) { return out_info[out_len ? out_len - 1 : 0]; } - inline hb_glyph_info_t prev (void) const { return out_info[out_len ? out_len - 1 : 0]; } + hb_glyph_info_t &prev () { return out_info[out_len ? out_len - 1 : 0]; } + hb_glyph_info_t prev () const { return out_info[out_len ? out_len - 1 : 0]; } - inline bool has_separate_output (void) const { return info != out_info; } + bool has_separate_output () const { return info != out_info; } - HB_INTERNAL void reset (void); - HB_INTERNAL void clear (void); + HB_INTERNAL void reset (); + HB_INTERNAL void clear (); - inline unsigned int backtrack_len (void) const - { return have_output? out_len : idx; } - inline unsigned int lookahead_len (void) const - { return len - idx; } - inline unsigned int next_serial (void) { return serial++; } + unsigned int backtrack_len () const { return have_output? out_len : idx; } + unsigned int lookahead_len () const { return len - idx; } + unsigned int next_serial () { return serial++; } HB_INTERNAL void add (hb_codepoint_t codepoint, unsigned int cluster); HB_INTERNAL void add_info (const hb_glyph_info_t &glyph_info); HB_INTERNAL void reverse_range (unsigned int start, unsigned int end); - HB_INTERNAL void reverse (void); - HB_INTERNAL void reverse_clusters (void); - HB_INTERNAL void guess_segment_properties (void); + HB_INTERNAL void reverse (); + HB_INTERNAL void reverse_clusters (); + HB_INTERNAL void guess_segment_properties (); - HB_INTERNAL void swap_buffers (void); - HB_INTERNAL void remove_output (void); - HB_INTERNAL void clear_output (void); - HB_INTERNAL void clear_positions (void); + HB_INTERNAL void swap_buffers (); + HB_INTERNAL void remove_output (); + HB_INTERNAL void clear_output (); + HB_INTERNAL void clear_positions (); HB_INTERNAL void replace_glyphs (unsigned int num_in, unsigned int num_out, const hb_codepoint_t *glyph_data); - inline void replace_glyph (hb_codepoint_t glyph_index) + void replace_glyph (hb_codepoint_t glyph_index) { if (unlikely (out_info != info || out_len != idx)) { if (unlikely (!make_room_for (1, 1))) return; @@ -224,7 +224,7 @@ struct hb_buffer_t out_len++; } /* Makes a copy of the glyph at idx to output and replace glyph_index */ - inline hb_glyph_info_t & output_glyph (hb_codepoint_t glyph_index) + hb_glyph_info_t & output_glyph (hb_codepoint_t glyph_index) { if (unlikely (!make_room_for (0, 1))) return Crap(hb_glyph_info_t); @@ -238,7 +238,7 @@ struct hb_buffer_t return out_info[out_len - 1]; } - inline void output_info (const hb_glyph_info_t &glyph_info) + void output_info (const hb_glyph_info_t &glyph_info) { if (unlikely (!make_room_for (0, 1))) return; @@ -247,7 +247,7 @@ struct hb_buffer_t out_len++; } /* Copies glyph at idx to output but doesn't advance idx */ - inline void copy_glyph (void) + void copy_glyph () { if (unlikely (!make_room_for (0, 1))) return; @@ -257,8 +257,8 @@ struct hb_buffer_t } /* Copies glyph at idx to output and advance idx. * If there's no output, just advance idx. */ - inline void - next_glyph (void) + void + next_glyph () { if (have_output) { @@ -274,7 +274,7 @@ struct hb_buffer_t } /* Copies n glyphs at idx to output and advance idx. * If there's no output, just advance idx. */ - inline void + void next_glyphs (unsigned int n) { if (have_output) @@ -290,16 +290,13 @@ struct hb_buffer_t idx += n; } /* Advance idx without copying to output. */ - inline void skip_glyph (void) - { - idx++; - } - inline void reset_masks (hb_mask_t mask) + void skip_glyph () { idx++; } + void reset_masks (hb_mask_t mask) { for (unsigned int j = 0; j < len; j++) info[j].mask = mask; } - inline void add_masks (hb_mask_t mask) + void add_masks (hb_mask_t mask) { for (unsigned int j = 0; j < len; j++) info[j].mask |= mask; @@ -307,7 +304,7 @@ struct hb_buffer_t HB_INTERNAL void set_masks (hb_mask_t value, hb_mask_t mask, unsigned int cluster_start, unsigned int cluster_end); - inline void merge_clusters (unsigned int start, unsigned int end) + void merge_clusters (unsigned int start, unsigned int end) { if (end - start < 2) return; @@ -316,9 +313,9 @@ struct hb_buffer_t HB_INTERNAL void merge_clusters_impl (unsigned int start, unsigned int end); HB_INTERNAL void merge_out_clusters (unsigned int start, unsigned int end); /* Merge clusters for deleting current glyph, and skip it. */ - HB_INTERNAL void delete_glyph (void); + HB_INTERNAL void delete_glyph (); - inline void unsafe_to_break (unsigned int start, + void unsafe_to_break (unsigned int start, unsigned int end) { if (end - start < 2) @@ -334,10 +331,10 @@ struct hb_buffer_t HB_INTERNAL bool enlarge (unsigned int size); - inline bool ensure (unsigned int size) + bool ensure (unsigned int size) { return likely (!size || size < allocated) ? true : enlarge (size); } - inline bool ensure_inplace (unsigned int size) + bool ensure_inplace (unsigned int size) { return likely (!size || size < allocated); } HB_INTERNAL bool make_room_for (unsigned int num_in, unsigned int num_out); @@ -346,12 +343,12 @@ struct hb_buffer_t typedef long scratch_buffer_t; HB_INTERNAL scratch_buffer_t *get_scratch_buffer (unsigned int *size); - inline void clear_context (unsigned int side) { context_len[side] = 0; } + void clear_context (unsigned int side) { context_len[side] = 0; } HB_INTERNAL void sort (unsigned int start, unsigned int end, int(*compar)(const hb_glyph_info_t *, const hb_glyph_info_t *)); - inline bool messaging (void) { return unlikely (message_func); } - inline bool message (hb_font_t *font, const char *fmt, ...) HB_PRINTF_FUNC(3, 4) + bool messaging () { return unlikely (message_func); } + bool message (hb_font_t *font, const char *fmt, ...) HB_PRINTF_FUNC(3, 4) { if (!messaging ()) return true; @@ -363,7 +360,7 @@ struct hb_buffer_t } HB_INTERNAL bool message_impl (hb_font_t *font, const char *fmt, va_list ap) HB_PRINTF_FUNC(3, 0); - static inline void + static void set_cluster (hb_glyph_info_t &inf, unsigned int cluster, unsigned int mask = 0) { if (inf.cluster != cluster) @@ -376,7 +373,7 @@ struct hb_buffer_t inf.cluster = cluster; } - inline int + int _unsafe_to_break_find_min_cluster (const hb_glyph_info_t *infos, unsigned int start, unsigned int end, unsigned int cluster) const @@ -385,7 +382,7 @@ struct hb_buffer_t cluster = MIN (cluster, infos[i].cluster); return cluster; } - inline void + void _unsafe_to_break_set_mask (hb_glyph_info_t *infos, unsigned int start, unsigned int end, unsigned int cluster) @@ -398,13 +395,9 @@ struct hb_buffer_t } } - inline void - unsafe_to_break_all (void) - { - unsafe_to_break_impl (0, len); - } - inline void - safe_to_break_all (void) + void unsafe_to_break_all () + { unsafe_to_break_impl (0, len); } + void safe_to_break_all () { for (unsigned int i = 0; i < len; i++) info[i].mask &= ~HB_GLYPH_FLAG_UNSAFE_TO_BREAK; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cache.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cache.hh index eb48f18cf94..bf26d96be46 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cache.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cache.hh @@ -39,16 +39,16 @@ struct hb_cache_t 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) {} + void init () { clear (); } + void fini () {} - inline void clear (void) + void clear () { for (unsigned i = 0; i < ARRAY_LENGTH (values); i++) values[i].set_relaxed (-1); } - inline bool get (unsigned int key, unsigned int *value) const + bool get (unsigned int key, unsigned int *value) const { unsigned int k = key & ((1u<> key_bits) || (value >> value_bits))) return false; /* Overflows */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff-interp-common.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff-interp-common.hh new file mode 100644 index 00000000000..c2be034a1ce --- /dev/null +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff-interp-common.hh @@ -0,0 +1,744 @@ +/* + * Copyright © 2018 Adobe Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Adobe Author(s): Michiharu Ariza + */ +#ifndef HB_CFF_INTERP_COMMON_HH +#define HB_CFF_INTERP_COMMON_HH + +namespace CFF { + +using namespace OT; + +typedef unsigned int OpCode; + + +/* === Dict operators === */ + +/* One byte operators (0-31) */ +#define OpCode_version 0 /* CFF Top */ +#define OpCode_Notice 1 /* CFF Top */ +#define OpCode_FullName 2 /* CFF Top */ +#define OpCode_FamilyName 3 /* CFF Top */ +#define OpCode_Weight 4 /* CFF Top */ +#define OpCode_FontBBox 5 /* CFF Top */ +#define OpCode_BlueValues 6 /* CFF Private, CFF2 Private */ +#define OpCode_OtherBlues 7 /* CFF Private, CFF2 Private */ +#define OpCode_FamilyBlues 8 /* CFF Private, CFF2 Private */ +#define OpCode_FamilyOtherBlues 9 /* CFF Private, CFF2 Private */ +#define OpCode_StdHW 10 /* CFF Private, CFF2 Private */ +#define OpCode_StdVW 11 /* CFF Private, CFF2 Private */ +#define OpCode_escape 12 /* All. Shared with CS */ +#define OpCode_UniqueID 13 /* CFF Top */ +#define OpCode_XUID 14 /* CFF Top */ +#define OpCode_charset 15 /* CFF Top (0) */ +#define OpCode_Encoding 16 /* CFF Top (0) */ +#define OpCode_CharStrings 17 /* CFF Top, CFF2 Top */ +#define OpCode_Private 18 /* CFF Top, CFF2 FD */ +#define OpCode_Subrs 19 /* CFF Private, CFF2 Private */ +#define OpCode_defaultWidthX 20 /* CFF Private (0) */ +#define OpCode_nominalWidthX 21 /* CFF Private (0) */ +#define OpCode_vsindexdict 22 /* CFF2 Private/CS */ +#define OpCode_blenddict 23 /* CFF2 Private/CS */ +#define OpCode_vstore 24 /* CFF2 Top */ +#define OpCode_reserved25 25 +#define OpCode_reserved26 26 +#define OpCode_reserved27 27 + +/* Numbers */ +#define OpCode_shortint 28 /* 16-bit integer, All */ +#define OpCode_longintdict 29 /* 32-bit integer, All */ +#define OpCode_BCD 30 /* Real number, CFF2 Top/FD */ +#define OpCode_reserved31 31 + +/* 1-byte integers */ +#define OpCode_OneByteIntFirst 32 /* All. beginning of the range of first byte ints */ +#define OpCode_OneByteIntLast 246 /* All. ending of the range of first byte int */ + +/* 2-byte integers */ +#define OpCode_TwoBytePosInt0 247 /* All. first byte of two byte positive int (+108 to +1131) */ +#define OpCode_TwoBytePosInt1 248 +#define OpCode_TwoBytePosInt2 249 +#define OpCode_TwoBytePosInt3 250 + +#define OpCode_TwoByteNegInt0 251 /* All. first byte of two byte negative int (-1131 to -108) */ +#define OpCode_TwoByteNegInt1 252 +#define OpCode_TwoByteNegInt2 253 +#define OpCode_TwoByteNegInt3 254 + +/* Two byte escape operators 12, (0-41) */ +#define OpCode_ESC_Base 256 +#define Make_OpCode_ESC(byte2) ((OpCode)(OpCode_ESC_Base + (byte2))) + +inline OpCode Unmake_OpCode_ESC (OpCode op) { return (OpCode)(op - OpCode_ESC_Base); } +inline bool Is_OpCode_ESC (OpCode op) { return op >= OpCode_ESC_Base; } +inline unsigned int OpCode_Size (OpCode op) { return Is_OpCode_ESC (op) ? 2: 1; } + +#define OpCode_Copyright Make_OpCode_ESC(0) /* CFF Top */ +#define OpCode_isFixedPitch Make_OpCode_ESC(1) /* CFF Top (false) */ +#define OpCode_ItalicAngle Make_OpCode_ESC(2) /* CFF Top (0) */ +#define OpCode_UnderlinePosition Make_OpCode_ESC(3) /* CFF Top (-100) */ +#define OpCode_UnderlineThickness Make_OpCode_ESC(4) /* CFF Top (50) */ +#define OpCode_PaintType Make_OpCode_ESC(5) /* CFF Top (0) */ +#define OpCode_CharstringType Make_OpCode_ESC(6) /* CFF Top (2) */ +#define OpCode_FontMatrix Make_OpCode_ESC(7) /* CFF Top, CFF2 Top (.001 0 0 .001 0 0)*/ +#define OpCode_StrokeWidth Make_OpCode_ESC(8) /* CFF Top (0) */ +#define OpCode_BlueScale Make_OpCode_ESC(9) /* CFF Private, CFF2 Private (0.039625) */ +#define OpCode_BlueShift Make_OpCode_ESC(10) /* CFF Private, CFF2 Private (7) */ +#define OpCode_BlueFuzz Make_OpCode_ESC(11) /* CFF Private, CFF2 Private (1) */ +#define OpCode_StemSnapH Make_OpCode_ESC(12) /* CFF Private, CFF2 Private */ +#define OpCode_StemSnapV Make_OpCode_ESC(13) /* CFF Private, CFF2 Private */ +#define OpCode_ForceBold Make_OpCode_ESC(14) /* CFF Private (false) */ +#define OpCode_reservedESC15 Make_OpCode_ESC(15) +#define OpCode_reservedESC16 Make_OpCode_ESC(16) +#define OpCode_LanguageGroup Make_OpCode_ESC(17) /* CFF Private, CFF2 Private (0) */ +#define OpCode_ExpansionFactor Make_OpCode_ESC(18) /* CFF Private, CFF2 Private (0.06) */ +#define OpCode_initialRandomSeed Make_OpCode_ESC(19) /* CFF Private (0) */ +#define OpCode_SyntheticBase Make_OpCode_ESC(20) /* CFF Top */ +#define OpCode_PostScript Make_OpCode_ESC(21) /* CFF Top */ +#define OpCode_BaseFontName Make_OpCode_ESC(22) /* CFF Top */ +#define OpCode_BaseFontBlend Make_OpCode_ESC(23) /* CFF Top */ +#define OpCode_reservedESC24 Make_OpCode_ESC(24) +#define OpCode_reservedESC25 Make_OpCode_ESC(25) +#define OpCode_reservedESC26 Make_OpCode_ESC(26) +#define OpCode_reservedESC27 Make_OpCode_ESC(27) +#define OpCode_reservedESC28 Make_OpCode_ESC(28) +#define OpCode_reservedESC29 Make_OpCode_ESC(29) +#define OpCode_ROS Make_OpCode_ESC(30) /* CFF Top_CID */ +#define OpCode_CIDFontVersion Make_OpCode_ESC(31) /* CFF Top_CID (0) */ +#define OpCode_CIDFontRevision Make_OpCode_ESC(32) /* CFF Top_CID (0) */ +#define OpCode_CIDFontType Make_OpCode_ESC(33) /* CFF Top_CID (0) */ +#define OpCode_CIDCount Make_OpCode_ESC(34) /* CFF Top_CID (8720) */ +#define OpCode_UIDBase Make_OpCode_ESC(35) /* CFF Top_CID */ +#define OpCode_FDArray Make_OpCode_ESC(36) /* CFF Top_CID, CFF2 Top */ +#define OpCode_FDSelect Make_OpCode_ESC(37) /* CFF Top_CID, CFF2 Top */ +#define OpCode_FontName Make_OpCode_ESC(38) /* CFF Top_CID */ + + +/* === CharString operators === */ + +#define OpCode_hstem 1 /* CFF, CFF2 */ +#define OpCode_Reserved2 2 +#define OpCode_vstem 3 /* CFF, CFF2 */ +#define OpCode_vmoveto 4 /* CFF, CFF2 */ +#define OpCode_rlineto 5 /* CFF, CFF2 */ +#define OpCode_hlineto 6 /* CFF, CFF2 */ +#define OpCode_vlineto 7 /* CFF, CFF2 */ +#define OpCode_rrcurveto 8 /* CFF, CFF2 */ +#define OpCode_Reserved9 9 +#define OpCode_callsubr 10 /* CFF, CFF2 */ +#define OpCode_return 11 /* CFF */ +//#define OpCode_escape 12 /* CFF, CFF2 */ +#define OpCode_Reserved13 13 +#define OpCode_endchar 14 /* CFF */ +#define OpCode_vsindexcs 15 /* CFF2 */ +#define OpCode_blendcs 16 /* CFF2 */ +#define OpCode_Reserved17 17 +#define OpCode_hstemhm 18 /* CFF, CFF2 */ +#define OpCode_hintmask 19 /* CFF, CFF2 */ +#define OpCode_cntrmask 20 /* CFF, CFF2 */ +#define OpCode_rmoveto 21 /* CFF, CFF2 */ +#define OpCode_hmoveto 22 /* CFF, CFF2 */ +#define OpCode_vstemhm 23 /* CFF, CFF2 */ +#define OpCode_rcurveline 24 /* CFF, CFF2 */ +#define OpCode_rlinecurve 25 /* CFF, CFF2 */ +#define OpCode_vvcurveto 26 /* CFF, CFF2 */ +#define OpCode_hhcurveto 27 /* CFF, CFF2 */ +//#define OpCode_shortint 28 /* CFF, CFF2 */ +#define OpCode_callgsubr 29 /* CFF, CFF2 */ +#define OpCode_vhcurveto 30 /* CFF, CFF2 */ +#define OpCode_hvcurveto 31 /* CFF, CFF2 */ + +#define OpCode_fixedcs 255 /* 32-bit fixed */ + +/* Two byte escape operators 12, (0-41) */ +#define OpCode_dotsection Make_OpCode_ESC(0) /* CFF (obsoleted) */ +#define OpCode_ReservedESC1 Make_OpCode_ESC(1) +#define OpCode_ReservedESC2 Make_OpCode_ESC(2) +#define OpCode_and Make_OpCode_ESC(3) /* CFF */ +#define OpCode_or Make_OpCode_ESC(4) /* CFF */ +#define OpCode_not Make_OpCode_ESC(5) /* CFF */ +#define OpCode_ReservedESC6 Make_OpCode_ESC(6) +#define OpCode_ReservedESC7 Make_OpCode_ESC(7) +#define OpCode_ReservedESC8 Make_OpCode_ESC(8) +#define OpCode_abs Make_OpCode_ESC(9) /* CFF */ +#define OpCode_add Make_OpCode_ESC(10) /* CFF */ +#define OpCode_sub Make_OpCode_ESC(11) /* CFF */ +#define OpCode_div Make_OpCode_ESC(12) /* CFF */ +#define OpCode_ReservedESC13 Make_OpCode_ESC(13) +#define OpCode_neg Make_OpCode_ESC(14) /* CFF */ +#define OpCode_eq Make_OpCode_ESC(15) /* CFF */ +#define OpCode_ReservedESC16 Make_OpCode_ESC(16) +#define OpCode_ReservedESC17 Make_OpCode_ESC(17) +#define OpCode_drop Make_OpCode_ESC(18) /* CFF */ +#define OpCode_ReservedESC19 Make_OpCode_ESC(19) +#define OpCode_put Make_OpCode_ESC(20) /* CFF */ +#define OpCode_get Make_OpCode_ESC(21) /* CFF */ +#define OpCode_ifelse Make_OpCode_ESC(22) /* CFF */ +#define OpCode_random Make_OpCode_ESC(23) /* CFF */ +#define OpCode_mul Make_OpCode_ESC(24) /* CFF */ +//#define OpCode_reservedESC25 Make_OpCode_ESC(25) +#define OpCode_sqrt Make_OpCode_ESC(26) /* CFF */ +#define OpCode_dup Make_OpCode_ESC(27) /* CFF */ +#define OpCode_exch Make_OpCode_ESC(28) /* CFF */ +#define OpCode_index Make_OpCode_ESC(29) /* CFF */ +#define OpCode_roll Make_OpCode_ESC(30) /* CFF */ +#define OpCode_reservedESC31 Make_OpCode_ESC(31) +#define OpCode_reservedESC32 Make_OpCode_ESC(32) +#define OpCode_reservedESC33 Make_OpCode_ESC(33) +#define OpCode_hflex Make_OpCode_ESC(34) /* CFF, CFF2 */ +#define OpCode_flex Make_OpCode_ESC(35) /* CFF, CFF2 */ +#define OpCode_hflex1 Make_OpCode_ESC(36) /* CFF, CFF2 */ +#define OpCode_flex1 Make_OpCode_ESC(37) /* CFF, CFF2 */ + + +#define OpCode_Invalid 0xFFFFu + + +struct Number +{ + void init () { set_real (0.0); } + void fini () {} + + void set_int (int v) { value = (double) v; } + int to_int () const { return (int) value; } + + void set_fixed (int32_t v) { value = v / 65536.0; } + int32_t to_fixed () const { return (int32_t) (value * 65536.0); } + + void set_real (double v) { value = v; } + double to_real () const { return value; } + + int ceil () const { return (int) ::ceil (value); } + int floor () const { return (int) ::floor (value); } + + bool in_int_range () const + { return ((double) (int16_t) to_int () == value); } + + bool operator > (const Number &n) const + { return value > n.to_real (); } + + bool operator < (const Number &n) const + { return n > *this; } + + bool operator >= (const Number &n) const + { return !(*this < n); } + + bool operator <= (const Number &n) const + { return !(*this > n); } + + const Number &operator += (const Number &n) + { + set_real (to_real () + n.to_real ()); + + return *this; + } + + protected: + double value; +}; + +/* byte string */ +struct UnsizedByteStr : UnsizedArrayOf +{ + // encode 2-byte int (Dict/CharString) or 4-byte int (Dict) + template + static bool serialize_int (hb_serialize_context_t *c, OpCode intOp, int value) + { + TRACE_SERIALIZE (this); + + if (unlikely ((value < minVal || value > maxVal))) + return_trace (false); + + HBUINT8 *p = c->allocate_size (1); + if (unlikely (p == nullptr)) return_trace (false); + p->set (intOp); + + INTTYPE *ip = c->allocate_size (INTTYPE::static_size); + if (unlikely (ip == nullptr)) return_trace (false); + ip->set ((unsigned int)value); + + return_trace (true); + } + + static bool serialize_int4 (hb_serialize_context_t *c, int value) + { return serialize_int (c, OpCode_longintdict, value); } + + static bool serialize_int2 (hb_serialize_context_t *c, int value) + { return serialize_int (c, OpCode_shortint, value); } + + /* Defining null_size allows a Null object may be created. Should be safe because: + * A descendent struct Dict uses a Null pointer to indicate a missing table, + * checked before access. + * ByteStr, a wrapper struct pairing a byte pointer along with its length, always + * checks the length before access. A Null pointer is used as the initial pointer + * along with zero length by the default ctor. + */ + DEFINE_SIZE_MIN(0); +}; + +struct ByteStr +{ + ByteStr () + : str (&Null(UnsizedByteStr)), len (0) {} + ByteStr (const UnsizedByteStr& s, unsigned int l) + : str (&s), len (l) {} + ByteStr (const char *s, unsigned int l=0) + : str ((const UnsizedByteStr *)s), len (l) {} + /* sub-string */ + ByteStr (const ByteStr &bs, unsigned int offset, unsigned int len_) + { + str = (const UnsizedByteStr *)&bs.str[offset]; + len = len_; + } + + bool sanitize (hb_sanitize_context_t *c) const { return str->sanitize (c, len); } + + const HBUINT8& operator [] (unsigned int i) const + { + if (likely (str && (i < len))) + return (*str)[i]; + else + return Null(HBUINT8); + } + + bool serialize (hb_serialize_context_t *c, const ByteStr &src) + { + TRACE_SERIALIZE (this); + HBUINT8 *dest = c->allocate_size (src.len); + if (unlikely (dest == nullptr)) + return_trace (false); + memcpy (dest, src.str, src.len); + return_trace (true); + } + + unsigned int get_size () const { return len; } + + bool check_limit (unsigned int offset, unsigned int count) const + { return (offset + count <= len); } + + const UnsizedByteStr *str; + unsigned int len; +}; + +struct SubByteStr +{ + SubByteStr () + { init (); } + + void init () + { + str = ByteStr (0); + offset = 0; + error = false; + } + + void fini () {} + + SubByteStr (const ByteStr &str_, unsigned int offset_ = 0) + : str (str_), offset (offset_), error (false) {} + + void reset (const ByteStr &str_, unsigned int offset_ = 0) + { + str = str_; + offset = offset_; + error = false; + } + + const HBUINT8& operator [] (int i) { + if (unlikely ((unsigned int)(offset + i) >= str.len)) + { + set_error (); + return Null(HBUINT8); + } + else + return str[offset + i]; + } + + operator ByteStr () const { return ByteStr (str, offset, str.len - offset); } + + bool avail (unsigned int count=1) const + { + return (!in_error () && str.check_limit (offset, count)); + } + void inc (unsigned int count=1) + { + if (likely (!in_error () && (offset <= str.len) && (offset + count <= str.len))) + { + offset += count; + } + else + { + offset = str.len; + set_error (); + } + } + + void set_error () { error = true; } + bool in_error () const { return error; } + + ByteStr str; + unsigned int offset; /* beginning of the sub-string within str */ + + protected: + bool error; +}; + +typedef hb_vector_t ByteStrArray; + +/* stack */ +template +struct Stack +{ + void init () + { + error = false; + count = 0; + elements.init (); + elements.resize (kSizeLimit); + for (unsigned int i = 0; i < elements.len; i++) + elements[i].init (); + } + + void fini () + { + elements.fini_deep (); + } + + ELEM& operator [] (unsigned int i) + { + if (unlikely (i >= count)) set_error (); + return elements[i]; + } + + void push (const ELEM &v) + { + if (likely (count < elements.len)) + elements[count++] = v; + else + set_error (); + } + + ELEM &push () + { + if (likely (count < elements.len)) + return elements[count++]; + else + { + set_error (); + return Crap(ELEM); + } + } + + ELEM& pop () + { + if (likely (count > 0)) + return elements[--count]; + else + { + set_error (); + return Crap(ELEM); + } + } + + void pop (unsigned int n) + { + if (likely (count >= n)) + count -= n; + else + set_error (); + } + + const ELEM& peek () + { + if (likely (count > 0)) + return elements[count-1]; + else + { + set_error (); + return Null(ELEM); + } + } + + void unpop () + { + if (likely (count < elements.len)) + count++; + else + set_error (); + } + + void clear () { count = 0; } + + bool in_error () const { return (error || elements.in_error ()); } + void set_error () { error = true; } + + unsigned int get_count () const { return count; } + bool is_empty () const { return count == 0; } + + static const unsigned int kSizeLimit = LIMIT; + + protected: + bool error; + unsigned int count; + hb_vector_t elements; +}; + +/* argument stack */ +template +struct ArgStack : Stack +{ + void push_int (int v) + { + ARG &n = S::push (); + n.set_int (v); + } + + void push_fixed (int32_t v) + { + ARG &n = S::push (); + n.set_fixed (v); + } + + void push_real (double v) + { + ARG &n = S::push (); + n.set_real (v); + } + + ARG& pop_num () { return this->pop (); } + + int pop_int () { return this->pop ().to_int (); } + + unsigned int pop_uint () + { + int i = pop_int (); + if (unlikely (i < 0)) + { + i = 0; + S::set_error (); + } + return (unsigned)i; + } + + void push_longint_from_substr (SubByteStr& substr) + { + push_int ((substr[0] << 24) | (substr[1] << 16) | (substr[2] << 8) | (substr[3])); + substr.inc (4); + } + + bool push_fixed_from_substr (SubByteStr& substr) + { + if (unlikely (!substr.avail (4))) + return false; + push_fixed ((int32_t)*(const HBUINT32*)&substr[0]); + substr.inc (4); + return true; + } + + hb_array_t get_subarray (unsigned int start) const + { + return S::elements.sub_array (start); + } + + private: + typedef Stack S; +}; + +/* an operator prefixed by its operands in a byte string */ +struct OpStr +{ + void init () {} + void fini () {} + + OpCode op; + ByteStr str; +}; + +/* base of OP_SERIALIZER */ +struct OpSerializer +{ + protected: + bool copy_opstr (hb_serialize_context_t *c, const OpStr& opstr) const + { + TRACE_SERIALIZE (this); + + HBUINT8 *d = c->allocate_size (opstr.str.len); + if (unlikely (d == nullptr)) return_trace (false); + memcpy (d, &opstr.str.str[0], opstr.str.len); + return_trace (true); + } +}; + +template +struct ParsedValues +{ + void init () + { + opStart = 0; + values.init (); + } + void fini () { values.fini_deep (); } + + void add_op (OpCode op, const SubByteStr& substr = SubByteStr ()) + { + VAL *val = values.push (); + val->op = op; + val->str = ByteStr (substr.str, opStart, substr.offset - opStart); + opStart = substr.offset; + } + + void add_op (OpCode op, const SubByteStr& substr, const VAL &v) + { + VAL *val = values.push (v); + val->op = op; + val->str = ByteStr (substr.str, opStart, substr.offset - opStart); + opStart = substr.offset; + } + + bool has_op (OpCode op) const + { + for (unsigned int i = 0; i < get_count (); i++) + if (get_value (i).op == op) return true; + return false; + } + + unsigned get_count () const { return values.len; } + const VAL &get_value (unsigned int i) const { return values[i]; } + const VAL &operator [] (unsigned int i) const { return get_value (i); } + + unsigned int opStart; + hb_vector_t values; +}; + +template +struct InterpEnv +{ + void init (const ByteStr &str_) + { + substr.reset (str_); + argStack.init (); + error = false; + } + void fini () { argStack.fini (); } + + bool in_error () const + { return error || substr.in_error () || argStack.in_error (); } + + void set_error () { error = true; } + + OpCode fetch_op () + { + OpCode op = OpCode_Invalid; + if (unlikely (!substr.avail ())) + return OpCode_Invalid; + op = (OpCode)(unsigned char)substr[0]; + if (op == OpCode_escape) { + if (unlikely (!substr.avail ())) + return OpCode_Invalid; + op = Make_OpCode_ESC(substr[1]); + substr.inc (); + } + substr.inc (); + return op; + } + + const ARG& eval_arg (unsigned int i) + { + return argStack[i]; + } + + ARG& pop_arg () + { + return argStack.pop (); + } + + void pop_n_args (unsigned int n) + { + argStack.pop (n); + } + + void clear_args () + { + pop_n_args (argStack.get_count ()); + } + + SubByteStr substr; + ArgStack argStack; + protected: + bool error; +}; + +typedef InterpEnv<> NumInterpEnv; + +template +struct OpSet +{ + static void process_op (OpCode op, InterpEnv& env) + { + switch (op) { + case OpCode_shortint: + env.argStack.push_int ((int16_t)((env.substr[0] << 8) | env.substr[1])); + env.substr.inc (2); + break; + + case OpCode_TwoBytePosInt0: case OpCode_TwoBytePosInt1: + case OpCode_TwoBytePosInt2: case OpCode_TwoBytePosInt3: + env.argStack.push_int ((int16_t)((op - OpCode_TwoBytePosInt0) * 256 + env.substr[0] + 108)); + env.substr.inc (); + break; + + case OpCode_TwoByteNegInt0: case OpCode_TwoByteNegInt1: + case OpCode_TwoByteNegInt2: case OpCode_TwoByteNegInt3: + env.argStack.push_int ((int16_t)(-(op - OpCode_TwoByteNegInt0) * 256 - env.substr[0] - 108)); + env.substr.inc (); + break; + + default: + /* 1-byte integer */ + if (likely ((OpCode_OneByteIntFirst <= op) && (op <= OpCode_OneByteIntLast))) + { + env.argStack.push_int ((int)op - 139); + } else { + /* invalid unknown operator */ + env.clear_args (); + env.set_error (); + } + break; + } + } +}; + +template +struct Interpreter { + + ~Interpreter() { fini (); } + + void fini () { env.fini (); } + + ENV env; +}; + +} /* namespace CFF */ + +#endif /* HB_CFF_INTERP_COMMON_HH */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff-interp-cs-common.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff-interp-cs-common.hh new file mode 100644 index 00000000000..e78d5571c94 --- /dev/null +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff-interp-cs-common.hh @@ -0,0 +1,904 @@ +/* + * Copyright © 2018 Adobe Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Adobe Author(s): Michiharu Ariza + */ +#ifndef HB_CFF_INTERP_CS_COMMON_HH +#define HB_CFF_INTERP_CS_COMMON_HH + +#include "hb.hh" +#include "hb-cff-interp-common.hh" + +namespace CFF { + +using namespace OT; + +enum CSType { + CSType_CharString, + CSType_GlobalSubr, + CSType_LocalSubr +}; + +struct CallContext +{ + void init (const SubByteStr substr_=SubByteStr (), CSType type_=CSType_CharString, unsigned int subr_num_=0) + { + substr = substr_; + type = type_; + subr_num = subr_num_; + } + + void fini () {} + + SubByteStr substr; + CSType type; + unsigned int subr_num; +}; + +/* call stack */ +const unsigned int kMaxCallLimit = 10; +struct CallStack : Stack {}; + +template +struct BiasedSubrs +{ + void init (const SUBRS &subrs_) + { + subrs = &subrs_; + unsigned int nSubrs = get_count (); + if (nSubrs < 1240) + bias = 107; + else if (nSubrs < 33900) + bias = 1131; + else + bias = 32768; + } + + void fini () {} + + unsigned int get_count () const { return (subrs == nullptr)? 0: subrs->count; } + unsigned int get_bias () const { return bias; } + + ByteStr operator [] (unsigned int index) const + { + if (unlikely ((subrs == nullptr) || index >= subrs->count)) + return Null(ByteStr); + else + return (*subrs)[index]; + } + + protected: + unsigned int bias; + const SUBRS *subrs; +}; + +struct Point +{ + void init () + { + x.init (); + y.init (); + } + + void set_int (int _x, int _y) + { + x.set_int (_x); + y.set_int (_y); + } + + void move_x (const Number &dx) { x += dx; } + void move_y (const Number &dy) { y += dy; } + void move (const Number &dx, const Number &dy) { move_x (dx); move_y (dy); } + void move (const Point &d) { move_x (d.x); move_y (d.y); } + + Number x; + Number y; +}; + +template +struct CSInterpEnv : InterpEnv +{ + void init (const ByteStr &str, const SUBRS &globalSubrs_, const SUBRS &localSubrs_) + { + InterpEnv::init (str); + + context.init (str, CSType_CharString); + seen_moveto = true; + seen_hintmask = false; + hstem_count = 0; + vstem_count = 0; + pt.init (); + callStack.init (); + globalSubrs.init (globalSubrs_); + localSubrs.init (localSubrs_); + } + void fini () + { + InterpEnv::fini (); + + callStack.fini (); + globalSubrs.fini (); + localSubrs.fini (); + } + + bool in_error () const + { + return callStack.in_error () || SUPER::in_error (); + } + + bool popSubrNum (const BiasedSubrs& biasedSubrs, unsigned int &subr_num) + { + int n = SUPER::argStack.pop_int (); + n += biasedSubrs.get_bias (); + if (unlikely ((n < 0) || ((unsigned int)n >= biasedSubrs.get_count ()))) + return false; + + subr_num = (unsigned int)n; + return true; + } + + void callSubr (const BiasedSubrs& biasedSubrs, CSType type) + { + unsigned int subr_num; + + if (unlikely (!popSubrNum (biasedSubrs, subr_num) + || callStack.get_count () >= kMaxCallLimit)) + { + SUPER::set_error (); + return; + } + context.substr = SUPER::substr; + callStack.push (context); + + context.init ( biasedSubrs[subr_num], type, subr_num); + SUPER::substr = context.substr; + } + + void returnFromSubr () + { + if (unlikely (SUPER::substr.in_error ())) + SUPER::set_error (); + context = callStack.pop (); + SUPER::substr = context.substr; + } + + void determine_hintmask_size () + { + if (!seen_hintmask) + { + vstem_count += SUPER::argStack.get_count() / 2; + hintmask_size = (hstem_count + vstem_count + 7) >> 3; + seen_hintmask = true; + } + } + + void set_endchar (bool endchar_flag_) { endchar_flag = endchar_flag_; } + bool is_endchar () const { return endchar_flag; } + + const Number &get_x () const { return pt.x; } + const Number &get_y () const { return pt.y; } + const Point &get_pt () const { return pt; } + + void moveto (const Point &pt_ ) { pt = pt_; } + + public: + CallContext context; + bool endchar_flag; + bool seen_moveto; + bool seen_hintmask; + + unsigned int hstem_count; + unsigned int vstem_count; + unsigned int hintmask_size; + CallStack callStack; + BiasedSubrs globalSubrs; + BiasedSubrs localSubrs; + + private: + Point pt; + + typedef InterpEnv SUPER; +}; + +template +struct PathProcsNull +{ + static void rmoveto (ENV &env, PARAM& param) {} + static void hmoveto (ENV &env, PARAM& param) {} + static void vmoveto (ENV &env, PARAM& param) {} + static void rlineto (ENV &env, PARAM& param) {} + static void hlineto (ENV &env, PARAM& param) {} + static void vlineto (ENV &env, PARAM& param) {} + static void rrcurveto (ENV &env, PARAM& param) {} + static void rcurveline (ENV &env, PARAM& param) {} + static void rlinecurve (ENV &env, PARAM& param) {} + static void vvcurveto (ENV &env, PARAM& param) {} + static void hhcurveto (ENV &env, PARAM& param) {} + static void vhcurveto (ENV &env, PARAM& param) {} + static void hvcurveto (ENV &env, PARAM& param) {} + static void moveto (ENV &env, PARAM& param, const Point &pt) {} + static void line (ENV &env, PARAM& param, const Point &pt1) {} + static void curve (ENV &env, PARAM& param, const Point &pt1, const Point &pt2, const Point &pt3) {} + static void hflex (ENV &env, PARAM& param) {} + static void flex (ENV &env, PARAM& param) {} + static void hflex1 (ENV &env, PARAM& param) {} + static void flex1 (ENV &env, PARAM& param) {} +}; + +template > +struct CSOpSet : OpSet +{ + static void process_op (OpCode op, ENV &env, PARAM& param) + { + switch (op) { + + case OpCode_return: + env.returnFromSubr (); + break; + case OpCode_endchar: + OPSET::check_width (op, env, param); + env.set_endchar (true); + OPSET::flush_args_and_op (op, env, param); + break; + + case OpCode_fixedcs: + env.argStack.push_fixed_from_substr (env.substr); + break; + + case OpCode_callsubr: + env.callSubr (env.localSubrs, CSType_LocalSubr); + break; + + case OpCode_callgsubr: + env.callSubr (env.globalSubrs, CSType_GlobalSubr); + break; + + case OpCode_hstem: + case OpCode_hstemhm: + OPSET::check_width (op, env, param); + OPSET::process_hstem (op, env, param); + break; + case OpCode_vstem: + case OpCode_vstemhm: + OPSET::check_width (op, env, param); + OPSET::process_vstem (op, env, param); + break; + case OpCode_hintmask: + case OpCode_cntrmask: + OPSET::check_width (op, env, param); + OPSET::process_hintmask (op, env, param); + break; + case OpCode_rmoveto: + OPSET::check_width (op, env, param); + PATH::rmoveto (env, param); + OPSET::process_post_move (op, env, param); + break; + case OpCode_hmoveto: + OPSET::check_width (op, env, param); + PATH::hmoveto (env, param); + OPSET::process_post_move (op, env, param); + break; + case OpCode_vmoveto: + OPSET::check_width (op, env, param); + PATH::vmoveto (env, param); + OPSET::process_post_move (op, env, param); + break; + case OpCode_rlineto: + PATH::rlineto (env, param); + process_post_path (op, env, param); + break; + case OpCode_hlineto: + PATH::hlineto (env, param); + process_post_path (op, env, param); + break; + case OpCode_vlineto: + PATH::vlineto (env, param); + process_post_path (op, env, param); + break; + case OpCode_rrcurveto: + PATH::rrcurveto (env, param); + process_post_path (op, env, param); + break; + case OpCode_rcurveline: + PATH::rcurveline (env, param); + process_post_path (op, env, param); + break; + case OpCode_rlinecurve: + PATH::rlinecurve (env, param); + process_post_path (op, env, param); + break; + case OpCode_vvcurveto: + PATH::vvcurveto (env, param); + process_post_path (op, env, param); + break; + case OpCode_hhcurveto: + PATH::hhcurveto (env, param); + process_post_path (op, env, param); + break; + case OpCode_vhcurveto: + PATH::vhcurveto (env, param); + process_post_path (op, env, param); + break; + case OpCode_hvcurveto: + PATH::hvcurveto (env, param); + process_post_path (op, env, param); + break; + + case OpCode_hflex: + PATH::hflex (env, param); + OPSET::process_post_flex (op, env, param); + break; + + case OpCode_flex: + PATH::flex (env, param); + OPSET::process_post_flex (op, env, param); + break; + + case OpCode_hflex1: + PATH::hflex1 (env, param); + OPSET::process_post_flex (op, env, param); + break; + + case OpCode_flex1: + PATH::flex1 (env, param); + OPSET::process_post_flex (op, env, param); + break; + + default: + SUPER::process_op (op, env); + break; + } + } + + static void process_hstem (OpCode op, ENV &env, PARAM& param) + { + env.hstem_count += env.argStack.get_count () / 2; + OPSET::flush_args_and_op (op, env, param); + } + + static void process_vstem (OpCode op, ENV &env, PARAM& param) + { + env.vstem_count += env.argStack.get_count () / 2; + OPSET::flush_args_and_op (op, env, param); + } + + static void process_hintmask (OpCode op, ENV &env, PARAM& param) + { + env.determine_hintmask_size (); + if (likely (env.substr.avail (env.hintmask_size))) + { + OPSET::flush_hintmask (op, env, param); + env.substr.inc (env.hintmask_size); + } + } + + static void process_post_flex (OpCode op, ENV &env, PARAM& param) + { + OPSET::flush_args_and_op (op, env, param); + } + + static void check_width (OpCode op, ENV &env, PARAM& param) + {} + + static void process_post_move (OpCode op, ENV &env, PARAM& param) + { + if (!env.seen_moveto) + { + env.determine_hintmask_size (); + env.seen_moveto = true; + } + OPSET::flush_args_and_op (op, env, param); + } + + static void process_post_path (OpCode op, ENV &env, PARAM& param) + { + OPSET::flush_args_and_op (op, env, param); + } + + static void flush_args_and_op (OpCode op, ENV &env, PARAM& param) + { + OPSET::flush_args (env, param); + OPSET::flush_op (op, env, param); + } + + static void flush_args (ENV &env, PARAM& param) + { + env.pop_n_args (env.argStack.get_count ()); + } + + static void flush_op (OpCode op, ENV &env, PARAM& param) + { + } + + static void flush_hintmask (OpCode op, ENV &env, PARAM& param) + { + OPSET::flush_args_and_op (op, env, param); + } + + static bool is_number_op (OpCode op) + { + switch (op) + { + case OpCode_shortint: + case OpCode_fixedcs: + case OpCode_TwoBytePosInt0: case OpCode_TwoBytePosInt1: + case OpCode_TwoBytePosInt2: case OpCode_TwoBytePosInt3: + case OpCode_TwoByteNegInt0: case OpCode_TwoByteNegInt1: + case OpCode_TwoByteNegInt2: case OpCode_TwoByteNegInt3: + return true; + + default: + /* 1-byte integer */ + return (OpCode_OneByteIntFirst <= op) && (op <= OpCode_OneByteIntLast); + } + } + + protected: + typedef OpSet SUPER; +}; + +template +struct PathProcs +{ + static void rmoveto (ENV &env, PARAM& param) + { + Point pt1 = env.get_pt (); + const Number &dy = env.pop_arg (); + const Number &dx = env.pop_arg (); + pt1.move (dx, dy); + PATH::moveto (env, param, pt1); + } + + static void hmoveto (ENV &env, PARAM& param) + { + Point pt1 = env.get_pt (); + pt1.move_x (env.pop_arg ()); + PATH::moveto (env, param, pt1); + } + + static void vmoveto (ENV &env, PARAM& param) + { + Point pt1 = env.get_pt (); + pt1.move_y (env.pop_arg ()); + PATH::moveto (env, param, pt1); + } + + static void rlineto (ENV &env, PARAM& param) + { + for (unsigned int i = 0; i + 2 <= env.argStack.get_count (); i += 2) + { + Point pt1 = env.get_pt (); + pt1.move (env.eval_arg (i), env.eval_arg (i+1)); + PATH::line (env, param, pt1); + } + } + + static void hlineto (ENV &env, PARAM& param) + { + Point pt1; + unsigned int i = 0; + for (; i + 2 <= env.argStack.get_count (); i += 2) + { + pt1 = env.get_pt (); + pt1.move_x (env.eval_arg (i)); + PATH::line (env, param, pt1); + pt1.move_y (env.eval_arg (i+1)); + PATH::line (env, param, pt1); + } + if (i < env.argStack.get_count ()) + { + pt1 = env.get_pt (); + pt1.move_x (env.eval_arg (i)); + PATH::line (env, param, pt1); + } + } + + static void vlineto (ENV &env, PARAM& param) + { + Point pt1; + unsigned int i = 0; + for (; i + 2 <= env.argStack.get_count (); i += 2) + { + pt1 = env.get_pt (); + pt1.move_y (env.eval_arg (i)); + PATH::line (env, param, pt1); + pt1.move_x (env.eval_arg (i+1)); + PATH::line (env, param, pt1); + } + if (i < env.argStack.get_count ()) + { + pt1 = env.get_pt (); + pt1.move_y (env.eval_arg (i)); + PATH::line (env, param, pt1); + } + } + + static void rrcurveto (ENV &env, PARAM& param) + { + for (unsigned int i = 0; i + 6 <= env.argStack.get_count (); i += 6) + { + Point pt1 = env.get_pt (); + pt1.move (env.eval_arg (i), env.eval_arg (i+1)); + Point pt2 = pt1; + pt2.move (env.eval_arg (i+2), env.eval_arg (i+3)); + Point pt3 = pt2; + pt3.move (env.eval_arg (i+4), env.eval_arg (i+5)); + PATH::curve (env, param, pt1, pt2, pt3); + } + } + + static void rcurveline (ENV &env, PARAM& param) + { + unsigned int i = 0; + for (; i + 6 <= env.argStack.get_count (); i += 6) + { + Point pt1 = env.get_pt (); + pt1.move (env.eval_arg (i), env.eval_arg (i+1)); + Point pt2 = pt1; + pt2.move (env.eval_arg (i+2), env.eval_arg (i+3)); + Point pt3 = pt2; + pt3.move (env.eval_arg (i+4), env.eval_arg (i+5)); + PATH::curve (env, param, pt1, pt2, pt3); + } + for (; i + 2 <= env.argStack.get_count (); i += 2) + { + Point pt1 = env.get_pt (); + pt1.move (env.eval_arg (i), env.eval_arg (i+1)); + PATH::line (env, param, pt1); + } + } + + static void rlinecurve (ENV &env, PARAM& param) + { + unsigned int i = 0; + unsigned int line_limit = (env.argStack.get_count () % 6); + for (; i + 2 <= line_limit; i += 2) + { + Point pt1 = env.get_pt (); + pt1.move (env.eval_arg (i), env.eval_arg (i+1)); + PATH::line (env, param, pt1); + } + for (; i + 6 <= env.argStack.get_count (); i += 6) + { + Point pt1 = env.get_pt (); + pt1.move (env.eval_arg (i), env.eval_arg (i+1)); + Point pt2 = pt1; + pt2.move (env.eval_arg (i+2), env.eval_arg (i+3)); + Point pt3 = pt2; + pt3.move (env.eval_arg (i+4), env.eval_arg (i+5)); + PATH::curve (env, param, pt1, pt2, pt3); + } + } + + static void vvcurveto (ENV &env, PARAM& param) + { + unsigned int i = 0; + Point pt1 = env.get_pt (); + if ((env.argStack.get_count () & 1) != 0) + pt1.move_x (env.eval_arg (i++)); + for (; i + 4 <= env.argStack.get_count (); i += 4) + { + pt1.move_y (env.eval_arg (i)); + Point pt2 = pt1; + pt2.move (env.eval_arg (i+1), env.eval_arg (i+2)); + Point pt3 = pt2; + pt3.move_y (env.eval_arg (i+3)); + PATH::curve (env, param, pt1, pt2, pt3); + pt1 = env.get_pt (); + } + } + + static void hhcurveto (ENV &env, PARAM& param) + { + unsigned int i = 0; + Point pt1 = env.get_pt (); + if ((env.argStack.get_count () & 1) != 0) + pt1.move_y (env.eval_arg (i++)); + for (; i + 4 <= env.argStack.get_count (); i += 4) + { + pt1.move_x (env.eval_arg (i)); + Point pt2 = pt1; + pt2.move (env.eval_arg (i+1), env.eval_arg (i+2)); + Point pt3 = pt2; + pt3.move_x (env.eval_arg (i+3)); + PATH::curve (env, param, pt1, pt2, pt3); + pt1 = env.get_pt (); + } + } + + static void vhcurveto (ENV &env, PARAM& param) + { + Point pt1, pt2, pt3; + unsigned int i = 0; + if ((env.argStack.get_count () % 8) >= 4) + { + Point pt1 = env.get_pt (); + pt1.move_y (env.eval_arg (i)); + Point pt2 = pt1; + pt2.move (env.eval_arg (i+1), env.eval_arg (i+2)); + Point pt3 = pt2; + pt3.move_x (env.eval_arg (i+3)); + i += 4; + + for (; i + 8 <= env.argStack.get_count (); i += 8) + { + PATH::curve (env, param, pt1, pt2, pt3); + pt1 = env.get_pt (); + pt1.move_x (env.eval_arg (i)); + pt2 = pt1; + pt2.move (env.eval_arg (i+1), env.eval_arg (i+2)); + pt3 = pt2; + pt3.move_y (env.eval_arg (i+3)); + PATH::curve (env, param, pt1, pt2, pt3); + + pt1 = pt3; + pt1.move_y (env.eval_arg (i+4)); + pt2 = pt1; + pt2.move (env.eval_arg (i+5), env.eval_arg (i+6)); + pt3 = pt2; + pt3.move_x (env.eval_arg (i+7)); + } + if (i < env.argStack.get_count ()) + pt3.move_y (env.eval_arg (i)); + PATH::curve (env, param, pt1, pt2, pt3); + } + else + { + for (; i + 8 <= env.argStack.get_count (); i += 8) + { + pt1 = env.get_pt (); + pt1.move_y (env.eval_arg (i)); + pt2 = pt1; + pt2.move (env.eval_arg (i+1), env.eval_arg (i+2)); + pt3 = pt2; + pt3.move_x (env.eval_arg (i+3)); + PATH::curve (env, param, pt1, pt2, pt3); + + pt1 = pt3; + pt1.move_x (env.eval_arg (i+4)); + pt2 = pt1; + pt2.move (env.eval_arg (i+5), env.eval_arg (i+6)); + pt3 = pt2; + pt3.move_y (env.eval_arg (i+7)); + if ((env.argStack.get_count () - i < 16) && ((env.argStack.get_count () & 1) != 0)) + pt3.move_x (env.eval_arg (i+8)); + PATH::curve (env, param, pt1, pt2, pt3); + } + } + } + + static void hvcurveto (ENV &env, PARAM& param) + { + Point pt1, pt2, pt3; + unsigned int i = 0; + if ((env.argStack.get_count () % 8) >= 4) + { + Point pt1 = env.get_pt (); + pt1.move_x (env.eval_arg (i)); + Point pt2 = pt1; + pt2.move (env.eval_arg (i+1), env.eval_arg (i+2)); + Point pt3 = pt2; + pt3.move_y (env.eval_arg (i+3)); + i += 4; + + for (; i + 8 <= env.argStack.get_count (); i += 8) + { + PATH::curve (env, param, pt1, pt2, pt3); + pt1 = env.get_pt (); + pt1.move_y (env.eval_arg (i)); + pt2 = pt1; + pt2.move (env.eval_arg (i+1), env.eval_arg (i+2)); + pt3 = pt2; + pt3.move_x (env.eval_arg (i+3)); + PATH::curve (env, param, pt1, pt2, pt3); + + pt1 = pt3; + pt1.move_x (env.eval_arg (i+4)); + pt2 = pt1; + pt2.move (env.eval_arg (i+5), env.eval_arg (i+6)); + pt3 = pt2; + pt3.move_y (env.eval_arg (i+7)); + } + if (i < env.argStack.get_count ()) + pt3.move_x (env.eval_arg (i)); + PATH::curve (env, param, pt1, pt2, pt3); + } + else + { + for (; i + 8 <= env.argStack.get_count (); i += 8) + { + pt1 = env.get_pt (); + pt1.move_x (env.eval_arg (i)); + pt2 = pt1; + pt2.move (env.eval_arg (i+1), env.eval_arg (i+2)); + pt3 = pt2; + pt3.move_y (env.eval_arg (i+3)); + PATH::curve (env, param, pt1, pt2, pt3); + + pt1 = pt3; + pt1.move_y (env.eval_arg (i+4)); + pt2 = pt1; + pt2.move (env.eval_arg (i+5), env.eval_arg (i+6)); + pt3 = pt2; + pt3.move_x (env.eval_arg (i+7)); + if ((env.argStack.get_count () - i < 16) && ((env.argStack.get_count () & 1) != 0)) + pt3.move_y (env.eval_arg (i+8)); + PATH::curve (env, param, pt1, pt2, pt3); + } + } + } + + /* default actions to be overridden */ + static void moveto (ENV &env, PARAM& param, const Point &pt) + { env.moveto (pt); } + + static void line (ENV &env, PARAM& param, const Point &pt1) + { PATH::moveto (env, param, pt1); } + + static void curve (ENV &env, PARAM& param, const Point &pt1, const Point &pt2, const Point &pt3) + { PATH::moveto (env, param, pt3); } + + static void hflex (ENV &env, PARAM& param) + { + if (likely (env.argStack.get_count () == 7)) + { + Point pt1 = env.get_pt (); + pt1.move_x (env.eval_arg (0)); + Point pt2 = pt1; + pt2.move (env.eval_arg (1), env.eval_arg (2)); + Point pt3 = pt2; + pt3.move_x (env.eval_arg (3)); + Point pt4 = pt3; + pt4.move_x (env.eval_arg (4)); + Point pt5 = pt4; + pt5.move_x (env.eval_arg (5)); + pt5.y = pt1.y; + Point pt6 = pt5; + pt6.move_x (env.eval_arg (6)); + + curve2 (env, param, pt1, pt2, pt3, pt4, pt5, pt6); + } + else + env.set_error (); + } + + static void flex (ENV &env, PARAM& param) + { + if (likely (env.argStack.get_count () == 13)) + { + Point pt1 = env.get_pt (); + pt1.move (env.eval_arg (0), env.eval_arg (1)); + Point pt2 = pt1; + pt2.move (env.eval_arg (2), env.eval_arg (3)); + Point pt3 = pt2; + pt3.move (env.eval_arg (4), env.eval_arg (5)); + Point pt4 = pt3; + pt4.move (env.eval_arg (6), env.eval_arg (7)); + Point pt5 = pt4; + pt5.move (env.eval_arg (8), env.eval_arg (9)); + Point pt6 = pt5; + pt6.move (env.eval_arg (10), env.eval_arg (11)); + + curve2 (env, param, pt1, pt2, pt3, pt4, pt5, pt6); + } + else + env.set_error (); + } + + static void hflex1 (ENV &env, PARAM& param) + { + if (likely (env.argStack.get_count () == 9)) + { + Point pt1 = env.get_pt (); + pt1.move (env.eval_arg (0), env.eval_arg (1)); + Point pt2 = pt1; + pt2.move (env.eval_arg (2), env.eval_arg (3)); + Point pt3 = pt2; + pt3.move_x (env.eval_arg (4)); + Point pt4 = pt3; + pt4.move_x (env.eval_arg (5)); + Point pt5 = pt4; + pt5.move (env.eval_arg (6), env.eval_arg (7)); + Point pt6 = pt5; + pt6.move_x (env.eval_arg (8)); + pt6.y = env.get_pt ().y; + + curve2 (env, param, pt1, pt2, pt3, pt4, pt5, pt6); + } + else + env.set_error (); + } + + static void flex1 (ENV &env, PARAM& param) + { + if (likely (env.argStack.get_count () == 11)) + { + Point d; + d.init (); + for (unsigned int i = 0; i < 10; i += 2) + d.move (env.eval_arg (i), env.eval_arg (i+1)); + + Point pt1 = env.get_pt (); + pt1.move (env.eval_arg (0), env.eval_arg (1)); + Point pt2 = pt1; + pt2.move (env.eval_arg (2), env.eval_arg (3)); + Point pt3 = pt2; + pt3.move (env.eval_arg (4), env.eval_arg (5)); + Point pt4 = pt3; + pt4.move (env.eval_arg (6), env.eval_arg (7)); + Point pt5 = pt4; + pt5.move (env.eval_arg (8), env.eval_arg (9)); + Point pt6 = pt5; + + if (fabs (d.x.to_real ()) > fabs (d.y.to_real ())) + { + pt6.move_x (env.eval_arg (10)); + pt6.y = env.get_pt ().y; + } + else + { + pt6.x = env.get_pt ().x; + pt6.move_y (env.eval_arg (10)); + } + + curve2 (env, param, pt1, pt2, pt3, pt4, pt5, pt6); + } + else + env.set_error (); + } + + protected: + static void curve2 (ENV &env, PARAM& param, + const Point &pt1, const Point &pt2, const Point &pt3, + const Point &pt4, const Point &pt5, const Point &pt6) + { + PATH::curve (env, param, pt1, pt2, pt3); + PATH::curve (env, param, pt4, pt5, pt6); + } +}; + +template +struct CSInterpreter : Interpreter +{ + bool interpret (PARAM& param) + { + SUPER::env.set_endchar (false); + + for (;;) { + OPSET::process_op (SUPER::env.fetch_op (), SUPER::env, param); + if (unlikely (SUPER::env.in_error ())) + return false; + if (SUPER::env.is_endchar ()) + break; + } + + return true; + } + + private: + typedef Interpreter SUPER; +}; + +} /* namespace CFF */ + +#endif /* HB_CFF_INTERP_CS_COMMON_HH */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff-interp-dict-common.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff-interp-dict-common.hh new file mode 100644 index 00000000000..8000d76b8bd --- /dev/null +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff-interp-dict-common.hh @@ -0,0 +1,294 @@ +/* + * Copyright © 2018 Adobe Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Adobe Author(s): Michiharu Ariza + */ +#ifndef HB_CFF_INTERP_DICT_COMMON_HH +#define HB_CFF_INTERP_DICT_COMMON_HH + +#include "hb-cff-interp-common.hh" +#include +#include + +namespace CFF { + +using namespace OT; + +/* an opstr and the parsed out dict value(s) */ +struct DictVal : OpStr +{ + void init () { single_val.set_int (0); } + void fini () {} + + Number single_val; +}; + +typedef DictVal NumDictVal; + +template struct DictValues : ParsedValues {}; + +template +struct TopDictValues : DictValues +{ + void init () + { + DictValues::init (); + charStringsOffset = 0; + FDArrayOffset = 0; + } + void fini () { DictValues::fini (); } + + unsigned int calculate_serialized_op_size (const OPSTR& opstr) const + { + switch (opstr.op) + { + case OpCode_CharStrings: + case OpCode_FDArray: + return OpCode_Size (OpCode_longintdict) + 4 + OpCode_Size (opstr.op); + + default: + return opstr.str.len; + } + } + + unsigned int charStringsOffset; + unsigned int FDArrayOffset; +}; + +struct DictOpSet : OpSet +{ + static void process_op (OpCode op, InterpEnv& env) + { + switch (op) { + case OpCode_longintdict: /* 5-byte integer */ + env.argStack.push_longint_from_substr (env.substr); + break; + + case OpCode_BCD: /* real number */ + env.argStack.push_real (parse_bcd (env.substr)); + break; + + default: + OpSet::process_op (op, env); + break; + } + } + + static double parse_bcd (SubByteStr& substr) + { + bool neg = false; + double int_part = 0; + uint64_t frac_part = 0; + uint32_t frac_count = 0; + bool exp_neg = false; + uint32_t exp_part = 0; + bool exp_overflow = false; + enum Part { INT_PART=0, FRAC_PART, EXP_PART } part = INT_PART; + enum Nibble { DECIMAL=10, EXP_POS, EXP_NEG, RESERVED, NEG, END }; + const uint64_t MAX_FRACT = 0xFFFFFFFFFFFFFull; /* 1^52-1 */ + const uint32_t MAX_EXP = 0x7FFu; /* 1^11-1 */ + + double value = 0.0; + unsigned char byte = 0; + for (uint32_t i = 0;; i++) + { + char d; + if ((i & 1) == 0) + { + if (!substr.avail ()) + { + substr.set_error (); + return 0.0; + } + byte = substr[0]; + substr.inc (); + d = byte >> 4; + } + else + d = byte & 0x0F; + + switch (d) + { + case RESERVED: + substr.set_error (); + return value; + + case END: + value = (double)(neg? -int_part: int_part); + if (frac_count > 0) + { + double frac = (frac_part / pow (10.0, (double)frac_count)); + if (neg) frac = -frac; + value += frac; + } + if (unlikely (exp_overflow)) + { + if (value == 0.0) + return value; + if (exp_neg) + return neg? -DBL_MIN: DBL_MIN; + else + return neg? -DBL_MAX: DBL_MAX; + } + if (exp_part != 0) + { + if (exp_neg) + value /= pow (10.0, (double)exp_part); + else + value *= pow (10.0, (double)exp_part); + } + return value; + + case NEG: + if (i != 0) + { + substr.set_error (); + return 0.0; + } + neg = true; + break; + + case DECIMAL: + if (part != INT_PART) + { + substr.set_error (); + return value; + } + part = FRAC_PART; + break; + + case EXP_NEG: + exp_neg = true; + HB_FALLTHROUGH; + + case EXP_POS: + if (part == EXP_PART) + { + substr.set_error (); + return value; + } + part = EXP_PART; + break; + + default: + switch (part) { + default: + case INT_PART: + int_part = (int_part * 10) + d; + break; + + case FRAC_PART: + if (likely (frac_part <= MAX_FRACT / 10)) + { + frac_part = (frac_part * 10) + (unsigned)d; + frac_count++; + } + break; + + case EXP_PART: + if (likely (exp_part * 10 + d <= MAX_EXP)) + { + exp_part = (exp_part * 10) + d; + } + else + exp_overflow = true; + break; + } + } + } + + return value; + } + + static bool is_hint_op (OpCode op) + { + switch (op) + { + case OpCode_BlueValues: + case OpCode_OtherBlues: + case OpCode_FamilyBlues: + case OpCode_FamilyOtherBlues: + case OpCode_StemSnapH: + case OpCode_StemSnapV: + case OpCode_StdHW: + case OpCode_StdVW: + case OpCode_BlueScale: + case OpCode_BlueShift: + case OpCode_BlueFuzz: + case OpCode_ForceBold: + case OpCode_LanguageGroup: + case OpCode_ExpansionFactor: + return true; + default: + return false; + } + } +}; + +template +struct TopDictOpSet : DictOpSet +{ + static void process_op (OpCode op, InterpEnv& env, TopDictValues & dictval) + { + switch (op) { + case OpCode_CharStrings: + dictval.charStringsOffset = env.argStack.pop_uint (); + env.clear_args (); + break; + case OpCode_FDArray: + dictval.FDArrayOffset = env.argStack.pop_uint (); + env.clear_args (); + break; + case OpCode_FontMatrix: + env.clear_args (); + break; + default: + DictOpSet::process_op (op, env); + break; + } + } +}; + +template +struct DictInterpreter : Interpreter +{ + bool interpret (PARAM& param) + { + param.init (); + while (SUPER::env.substr.avail ()) + { + OPSET::process_op (SUPER::env.fetch_op (), SUPER::env, param); + if (unlikely (SUPER::env.in_error ())) + return false; + } + + return true; + } + + private: + typedef Interpreter SUPER; +}; + +} /* namespace CFF */ + +#endif /* HB_CFF_INTERP_DICT_COMMON_HH */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff1-interp-cs.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff1-interp-cs.hh new file mode 100644 index 00000000000..68e1d81d762 --- /dev/null +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff1-interp-cs.hh @@ -0,0 +1,161 @@ +/* + * Copyright © 2018 Adobe Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Adobe Author(s): Michiharu Ariza + */ +#ifndef HB_CFF1_INTERP_CS_HH +#define HB_CFF1_INTERP_CS_HH + +#include "hb.hh" +#include "hb-cff-interp-cs-common.hh" + +namespace CFF { + +using namespace OT; + +typedef BiasedSubrs CFF1BiasedSubrs; + +struct CFF1CSInterpEnv : CSInterpEnv +{ + template + void init (const ByteStr &str, ACC &acc, unsigned int fd) + { + SUPER::init (str, *acc.globalSubrs, *acc.privateDicts[fd].localSubrs); + processed_width = false; + has_width = false; + arg_start = 0; + in_seac = false; + } + + void fini () { SUPER::fini (); } + + void set_width (bool has_width_) + { + if (likely (!processed_width && (SUPER::argStack.get_count () > 0))) + { + if (has_width_) + { + width = SUPER::argStack[0]; + has_width = true; + arg_start = 1; + } + } + processed_width = true; + } + + void clear_args () + { + arg_start = 0; + SUPER::clear_args (); + } + + void set_in_seac (bool _in_seac) { in_seac = _in_seac; } + + bool processed_width; + bool has_width; + unsigned int arg_start; + Number width; + bool in_seac; + + private: + typedef CSInterpEnv SUPER; +}; + +template > +struct CFF1CSOpSet : CSOpSet +{ + /* PostScript-originated legacy opcodes (OpCode_add etc) are unsupported */ + /* Type 1-originated deprecated opcodes, seac behavior of endchar and dotsection are supported */ + + static void process_op (OpCode op, CFF1CSInterpEnv &env, PARAM& param) + { + switch (op) { + case OpCode_dotsection: + SUPER::flush_args_and_op (op, env, param); + break; + + case OpCode_endchar: + OPSET::check_width (op, env, param); + if (env.argStack.get_count () >= 4) + { + OPSET::process_seac (env, param); + } + OPSET::flush_args_and_op (op, env, param); + env.set_endchar (true); + break; + + default: + SUPER::process_op (op, env, param); + } + } + + static void check_width (OpCode op, CFF1CSInterpEnv &env, PARAM& param) + { + if (!env.processed_width) + { + bool has_width = false; + switch (op) + { + case OpCode_endchar: + case OpCode_hstem: + case OpCode_hstemhm: + case OpCode_vstem: + case OpCode_vstemhm: + case OpCode_hintmask: + case OpCode_cntrmask: + has_width = ((env.argStack.get_count () & 1) != 0); + break; + case OpCode_hmoveto: + case OpCode_vmoveto: + has_width = (env.argStack.get_count () > 1); + break; + case OpCode_rmoveto: + has_width = (env.argStack.get_count () > 2); + break; + default: + return; + } + env.set_width (has_width); + } + } + + static void process_seac (CFF1CSInterpEnv &env, PARAM& param) + { + } + + static void flush_args (CFF1CSInterpEnv &env, PARAM& param) + { + SUPER::flush_args (env, param); + env.clear_args (); /* pop off width */ + } + + private: + typedef CSOpSet SUPER; +}; + +template +struct CFF1CSInterpreter : CSInterpreter {}; + +} /* namespace CFF */ + +#endif /* HB_CFF1_INTERP_CS_HH */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff2-interp-cs.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff2-interp-cs.hh new file mode 100644 index 00000000000..709bdefa1dc --- /dev/null +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cff2-interp-cs.hh @@ -0,0 +1,271 @@ +/* + * Copyright © 2018 Adobe Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Adobe Author(s): Michiharu Ariza + */ +#ifndef HB_CFF2_INTERP_CS_HH +#define HB_CFF2_INTERP_CS_HH + +#include "hb.hh" +#include "hb-cff-interp-cs-common.hh" + +namespace CFF { + +using namespace OT; + +struct BlendArg : Number +{ + void init () + { + Number::init (); + deltas.init (); + } + + void fini () + { + Number::fini (); + deltas.fini_deep (); + } + + void set_int (int v) { reset_blends (); Number::set_int (v); } + void set_fixed (int32_t v) { reset_blends (); Number::set_fixed (v); } + void set_real (double v) { reset_blends (); Number::set_real (v); } + + void set_blends (unsigned int numValues_, unsigned int valueIndex_, + unsigned int numBlends, hb_array_t blends_) + { + numValues = numValues_; + valueIndex = valueIndex_; + deltas.resize (numBlends); + for (unsigned int i = 0; i < numBlends; i++) + deltas[i] = blends_[i]; + } + + bool blending () const { return deltas.len > 0; } + void reset_blends () + { + numValues = valueIndex = 0; + deltas.resize (0); + } + + unsigned int numValues; + unsigned int valueIndex; + hb_vector_t deltas; +}; + +typedef InterpEnv BlendInterpEnv; +typedef BiasedSubrs CFF2BiasedSubrs; + +struct CFF2CSInterpEnv : CSInterpEnv +{ + template + void init (const ByteStr &str, ACC &acc, unsigned int fd, + const int *coords_=nullptr, unsigned int num_coords_=0) + { + SUPER::init (str, *acc.globalSubrs, *acc.privateDicts[fd].localSubrs); + + coords = coords_; + num_coords = num_coords_; + varStore = acc.varStore; + seen_blend = false; + seen_vsindex_ = false; + scalars.init (); + do_blend = (coords != nullptr) && num_coords && (varStore != &Null(CFF2VariationStore)); + set_ivs (acc.privateDicts[fd].ivs); + } + + void fini () + { + scalars.fini (); + SUPER::fini (); + } + + OpCode fetch_op () + { + if (this->substr.avail ()) + return SUPER::fetch_op (); + + /* make up return or endchar op */ + if (this->callStack.is_empty ()) + return OpCode_endchar; + else + return OpCode_return; + } + + const BlendArg& eval_arg (unsigned int i) + { + BlendArg &arg = argStack[i]; + blend_arg (arg); + return arg; + } + + const BlendArg& pop_arg () + { + BlendArg &arg = argStack.pop (); + blend_arg (arg); + return arg; + } + + void process_blend () + { + if (!seen_blend) + { + region_count = varStore->varStore.get_region_index_count (get_ivs ()); + if (do_blend) + { + scalars.resize (region_count); + varStore->varStore.get_scalars (get_ivs (), + (int *)coords, num_coords, + &scalars[0], region_count); + } + seen_blend = true; + } + } + + void process_vsindex () + { + unsigned int index = argStack.pop_uint (); + if (unlikely (seen_vsindex () || seen_blend)) + { + set_error (); + } + else + { + set_ivs (index); + } + seen_vsindex_ = true; + } + + unsigned int get_region_count () const { return region_count; } + void set_region_count (unsigned int region_count_) { region_count = region_count_; } + unsigned int get_ivs () const { return ivs; } + void set_ivs (unsigned int ivs_) { ivs = ivs_; } + bool seen_vsindex () const { return seen_vsindex_; } + + protected: + void blend_arg (BlendArg &arg) + { + if (do_blend && arg.blending ()) + { + if (likely (scalars.len == arg.deltas.len)) + { + double v = arg.to_real (); + for (unsigned int i = 0; i < scalars.len; i++) + { + v += (double)scalars[i] * arg.deltas[i].to_real (); + } + arg.set_real (v); + arg.deltas.resize (0); + } + } + } + + protected: + const int *coords; + unsigned int num_coords; + const CFF2VariationStore *varStore; + unsigned int region_count; + unsigned int ivs; + hb_vector_t scalars; + bool do_blend; + bool seen_vsindex_; + bool seen_blend; + + typedef CSInterpEnv SUPER; +}; +template > +struct CFF2CSOpSet : CSOpSet +{ + static void process_op (OpCode op, CFF2CSInterpEnv &env, PARAM& param) + { + switch (op) { + case OpCode_callsubr: + case OpCode_callgsubr: + /* a subroutine number shoudln't be a blended value */ + if (unlikely (env.argStack.peek ().blending ())) + { + env.set_error (); + break; + } + SUPER::process_op (op, env, param); + break; + + case OpCode_blendcs: + OPSET::process_blend (env, param); + break; + + case OpCode_vsindexcs: + if (unlikely (env.argStack.peek ().blending ())) + { + env.set_error (); + break; + } + OPSET::process_vsindex (env, param); + break; + + default: + SUPER::process_op (op, env, param); + } + } + + static void process_blend (CFF2CSInterpEnv &env, PARAM& param) + { + unsigned int n, k; + + env.process_blend (); + k = env.get_region_count (); + n = env.argStack.pop_uint (); + /* copy the blend values into blend array of the default values */ + unsigned int start = env.argStack.get_count () - ((k+1) * n); + /* let an obvious error case fail, but note CFF2 spec doesn't forbid n==0 */ + if (unlikely (start > env.argStack.get_count ())) + { + env.set_error (); + return; + } + for (unsigned int i = 0; i < n; i++) + { + const hb_array_t blends = env.argStack.get_subarray (start + n + (i * k)); + env.argStack[start + i].set_blends (n, i, k, blends); + } + + /* pop off blend values leaving default values now adorned with blend values */ + env.argStack.pop (k * n); + } + + static void process_vsindex (CFF2CSInterpEnv &env, PARAM& param) + { + env.process_vsindex (); + env.clear_args (); + } + + private: + typedef CSOpSet SUPER; +}; + +template +struct CFF2CSInterpreter : CSInterpreter {}; + +} /* namespace CFF */ + +#endif /* HB_CFF2_INTERP_CS_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 c3cffccb189..93f5b7939ca 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.cc @@ -51,7 +51,7 @@ hb_atomic_int_t _hb_options; void -_hb_options_init (void) +_hb_options_init () { hb_options_union_t u; u.i = 0; @@ -247,11 +247,10 @@ struct hb_language_item_t { struct hb_language_item_t *next; hb_language_t lang; - inline bool operator == (const char *s) const { - return lang_equal (lang, s); - } + bool operator == (const char *s) const + { return lang_equal (lang, s); } - inline hb_language_item_t & operator = (const char *s) { + hb_language_item_t & operator = (const char *s) { /* If a custom allocated is used calling strdup() pairs badly with a call to the custom free() in fini() below. Therefore don't call strdup(), implement its behavior. @@ -268,7 +267,7 @@ struct hb_language_item_t { return *this; } - void fini (void) { free ((void *) lang); } + void fini () { free ((void *) lang); } }; @@ -278,7 +277,7 @@ static hb_atomic_ptr_t langs; #if HB_USE_ATEXIT static void -free_langs (void) +free_langs () { retry: hb_language_item_t *first_lang = langs; @@ -404,7 +403,7 @@ hb_language_to_string (hb_language_t language) * Since: 0.9.2 **/ hb_language_t -hb_language_get_default (void) +hb_language_get_default () { static hb_atomic_ptr_t default_language; @@ -668,7 +667,7 @@ hb_version (unsigned int *major, * Since: 0.9.2 **/ const char * -hb_version_string (void) +hb_version_string () { return HB_VERSION_STRING; } @@ -781,13 +780,13 @@ parse_uint32 (const char **pp, const char *end, uint32_t *pv) #ifdef USE_XLOCALE #if HB_USE_ATEXIT -static void free_static_C_locale (void); +static void free_static_C_locale (); #endif static struct hb_C_locale_lazy_loader_t : hb_lazy_loader_t { - static inline HB_LOCALE_T create (void) + static HB_LOCALE_T create () { HB_LOCALE_T C_locale = HB_CREATE_LOCALE ("C"); @@ -797,11 +796,11 @@ static struct hb_C_locale_lazy_loader_t : hb_lazy_loader_tfeature); if (feature) - active_features.remove (feature - active_features); + active_features.remove (feature - active_features.arrayZ ()); } } } @@ -1163,20 +1163,8 @@ struct hb_coretext_aat_face_data_t {}; hb_coretext_aat_face_data_t * _hb_coretext_aat_shaper_face_data_create (hb_face_t *face) { - static const hb_tag_t tags[] = {HB_CORETEXT_TAG_MORX, HB_CORETEXT_TAG_MORT, HB_CORETEXT_TAG_KERX}; - - for (unsigned int i = 0; i < ARRAY_LENGTH (tags); i++) - { - hb_blob_t *blob = face->reference_table (tags[i]); - if (hb_blob_get_length (blob)) - { - hb_blob_destroy (blob); - return face->data.coretext ? (hb_coretext_aat_face_data_t *) HB_SHAPER_DATA_SUCCEEDED : nullptr; - } - hb_blob_destroy (blob); - } - - return nullptr; + return hb_aat_layout_has_substitution (face) || hb_aat_layout_has_positioning (face) ? + (hb_coretext_aat_face_data_t *) HB_SHAPER_DATA_SUCCEEDED : nullptr; } void 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 f13cfddb9c5..41a85b58c10 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-debug.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-debug.hh @@ -56,12 +56,12 @@ union hb_options_union_t { static_assert ((sizeof (hb_atomic_int_t) >= sizeof (hb_options_union_t)), ""); HB_INTERNAL void -_hb_options_init (void); +_hb_options_init (); extern HB_INTERNAL hb_atomic_int_t _hb_options; static inline hb_options_t -hb_options (void) +hb_options () { /* Make a local copy, so we can access bitfield threadsafely. */ hb_options_union_t u; @@ -284,7 +284,7 @@ struct hb_auto_trace_t _hb_debug_msg_va (what, obj, func, true, plevel ? *plevel : 0, +1, message, ap); va_end (ap); } - inline ~hb_auto_trace_t (void) + ~hb_auto_trace_t () { _hb_warn_no_return (returned); if (!returned) { @@ -293,9 +293,9 @@ struct hb_auto_trace_t if (plevel) --*plevel; } - inline ret_t ret (ret_t v, - const char *func = "", - unsigned int line = 0) + ret_t ret (ret_t v, + const char *func = "", + unsigned int line = 0) { if (unlikely (returned)) { fprintf (stderr, "OUCH, double calls to return_trace(). This is a bug, please report.\n"); @@ -327,18 +327,18 @@ struct hb_auto_trace_t<0, ret_t> const char *message, ...) HB_PRINTF_FUNC(6, 7) {} - inline ret_t ret (ret_t v, - const char *func HB_UNUSED = 0, - unsigned int line HB_UNUSED = 0) { return v; } + ret_t ret (ret_t v, + const char *func HB_UNUSED = nullptr, + unsigned int line HB_UNUSED = 0) { return v; } }; /* For disabled tracing; optimize out everything. * https://github.com/harfbuzz/harfbuzz/pull/605 */ template struct hb_no_trace_t { - inline ret_t ret (ret_t v, - const char *func HB_UNUSED = "", - unsigned int line HB_UNUSED = 0) { return v; } + ret_t ret (ret_t v, + const char *func HB_UNUSED = "", + unsigned int line HB_UNUSED = 0) { return v; } }; #define return_trace(RET) return trace.ret (RET, HB_FUNC, __LINE__) 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 9ceb264816c..4a5e702ffca 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-deprecated.h +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-deprecated.h @@ -52,6 +52,7 @@ HB_BEGIN_DECLS #ifndef HB_DISABLE_DEPRECATED + #define HB_SCRIPT_CANADIAN_ABORIGINAL HB_SCRIPT_CANADIAN_SYLLABICS #define HB_BUFFER_FLAGS_DEFAULT HB_BUFFER_FLAG_DEFAULT @@ -217,66 +218,6 @@ hb_font_get_glyph_kerning_for_direction (hb_font_t *font, 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); - - -typedef unsigned int hb_ot_name_id_t; /* Since is in hb-ot.h */ - -/** - * HB_OT_VAR_NO_AXIS_INDEX: - * - * Since: 1.4.2 - * Deprecated: 2.2.0 - */ -#define HB_OT_VAR_NO_AXIS_INDEX 0xFFFFFFFFu - -/** - * hb_ot_var_axis_t: - * - * Since: 1.4.2 - * Deprecated: 2.2.0 - */ -typedef struct hb_ot_var_axis_t -{ - hb_tag_t tag; - hb_ot_name_id_t name_id; - float min_value; - float default_value; - float max_value; -} hb_ot_var_axis_t; - -HB_EXTERN HB_DEPRECATED_FOR (hb_ot_var_get_axis_infos) unsigned int -hb_ot_var_get_axes (hb_face_t *face, - unsigned int start_offset, - unsigned int *axes_count /* IN/OUT */, - hb_ot_var_axis_t *axes_array /* OUT */); - -HB_EXTERN HB_DEPRECATED_FOR (hb_ot_var_find_axis_info) hb_bool_t -hb_ot_var_find_axis (hb_face_t *face, - hb_tag_t axis_tag, - unsigned int *axis_index, - hb_ot_var_axis_t *axis_info); #endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-directwrite.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-directwrite.cc index f9b2d261a99..e93cf90a30f 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-directwrite.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-directwrite.cc @@ -35,9 +35,9 @@ * to override malloc/free, we will redefine new/delete so users * won't need to do that by their own. */ -void* operator new (size_t size) { return malloc (size); } -void* operator new [] (size_t size) { return malloc (size); } -void operator delete (void* pointer) { free (pointer); } +void* operator new (size_t size) { return malloc (size); } +void* operator new [] (size_t size) { return malloc (size); } +void operator delete (void* pointer) { free (pointer); } void operator delete [] (void* pointer) { free (pointer); } @@ -54,19 +54,19 @@ private: IDWriteFontFileStream *mFontFileStream; public: DWriteFontFileLoader (IDWriteFontFileStream *fontFileStream) - { - mFontFileStream = fontFileStream; - } + { mFontFileStream = fontFileStream; } // IUnknown interface - IFACEMETHOD (QueryInterface) (IID const& iid, OUT void** ppObject) { return S_OK; } - IFACEMETHOD_ (ULONG, AddRef) () { return 1; } + IFACEMETHOD (QueryInterface) (IID const& iid, OUT void** ppObject) + { return S_OK; } + IFACEMETHOD_ (ULONG, AddRef) () { return 1; } IFACEMETHOD_ (ULONG, Release) () { return 1; } // IDWriteFontFileLoader methods - virtual HRESULT STDMETHODCALLTYPE CreateStreamFromKey (void const* fontFileReferenceKey, - uint32_t fontFileReferenceKeySize, - OUT IDWriteFontFileStream** fontFileStream) + virtual HRESULT STDMETHODCALLTYPE + CreateStreamFromKey (void const* fontFileReferenceKey, + uint32_t fontFileReferenceKeySize, + OUT IDWriteFontFileStream** fontFileStream) { *fontFileStream = mFontFileStream; return S_OK; @@ -86,19 +86,20 @@ public: } // IUnknown interface - IFACEMETHOD (QueryInterface) (IID const& iid, OUT void** ppObject) { return S_OK; } - IFACEMETHOD_ (ULONG, AddRef) () { return 1; } + IFACEMETHOD (QueryInterface) (IID const& iid, OUT void** ppObject) + { return S_OK; } + IFACEMETHOD_ (ULONG, AddRef) () { return 1; } IFACEMETHOD_ (ULONG, Release) () { return 1; } // IDWriteFontFileStream methods - virtual HRESULT STDMETHODCALLTYPE ReadFileFragment (void const** fragmentStart, - UINT64 fileOffset, - UINT64 fragmentSize, - OUT void** fragmentContext) + virtual HRESULT STDMETHODCALLTYPE + ReadFileFragment (void const** fragmentStart, + UINT64 fileOffset, + UINT64 fragmentSize, + OUT void** fragmentContext) { // We are required to do bounds checking. - if (fileOffset + fragmentSize > mSize) - return E_FAIL; + if (fileOffset + fragmentSize > mSize) return E_FAIL; // truncate the 64 bit fileOffset to size_t sized index into mData size_t index = static_cast (fileOffset); @@ -109,18 +110,18 @@ public: return S_OK; } - virtual void STDMETHODCALLTYPE ReleaseFileFragment (void* fragmentContext) { } + virtual void STDMETHODCALLTYPE + ReleaseFileFragment (void* fragmentContext) {} - virtual HRESULT STDMETHODCALLTYPE GetFileSize (OUT UINT64* fileSize) + virtual HRESULT STDMETHODCALLTYPE + GetFileSize (OUT UINT64* fileSize) { *fileSize = mSize; return S_OK; } - virtual HRESULT STDMETHODCALLTYPE GetLastWriteTime (OUT UINT64* lastWriteTime) - { - return E_NOTIMPL; - } + virtual HRESULT STDMETHODCALLTYPE + GetLastWriteTime (OUT UINT64* lastWriteTime) { return E_NOTIMPL; } }; @@ -147,17 +148,14 @@ _hb_directwrite_shaper_face_data_create (hb_face_t *face) // TODO: factory and fontFileLoader should be cached separately IDWriteFactory* dwriteFactory; - DWriteCreateFactory ( - DWRITE_FACTORY_TYPE_SHARED, - __uuidof (IDWriteFactory), - (IUnknown**) &dwriteFactory - ); + DWriteCreateFactory (DWRITE_FACTORY_TYPE_SHARED, __uuidof (IDWriteFactory), + (IUnknown**) &dwriteFactory); HRESULT hr; hb_blob_t *blob = hb_face_reference_blob (face); - DWriteFontFileStream *fontFileStream = new DWriteFontFileStream ( - (uint8_t *) hb_blob_get_data (blob, nullptr), - hb_blob_get_length (blob)); + DWriteFontFileStream *fontFileStream; + fontFileStream = new DWriteFontFileStream ((uint8_t *) hb_blob_get_data (blob, nullptr), + hb_blob_get_length (blob)); DWriteFontFileLoader *fontFileLoader = new DWriteFontFileLoader (fontFileStream); dwriteFactory->RegisterFontFileLoader (fontFileLoader); @@ -165,7 +163,7 @@ _hb_directwrite_shaper_face_data_create (hb_face_t *face) IDWriteFontFile *fontFile; uint64_t fontFileKey = 0; hr = dwriteFactory->CreateCustomFontFileReference (&fontFileKey, sizeof (fontFileKey), - fontFileLoader, &fontFile); + fontFileLoader, &fontFile); #define FAIL(...) \ HB_STMT_START { \ @@ -188,7 +186,7 @@ _hb_directwrite_shaper_face_data_create (hb_face_t *face) IDWriteFontFace *fontFace; dwriteFactory->CreateFontFace (faceType, 1, &fontFile, 0, - DWRITE_FONT_SIMULATIONS_NONE, &fontFace); + DWRITE_FONT_SIMULATIONS_NONE, &fontFace); data->dwriteFactory = dwriteFactory; data->fontFile = fontFile; @@ -228,9 +226,7 @@ _hb_directwrite_shaper_face_data_destroy (hb_directwrite_face_data_t *data) * shaper font data */ -struct hb_directwrite_font_data_t -{ -}; +struct hb_directwrite_font_data_t {}; hb_directwrite_font_data_t * _hb_directwrite_shaper_font_data_create (hb_font_t *font) @@ -251,12 +247,12 @@ _hb_directwrite_shaper_font_data_destroy (hb_directwrite_font_data_t *data) // Most of TextAnalysis is originally written by Bas Schouten for Mozilla project // but now is relicensed to MIT for HarfBuzz use -class TextAnalysis - : public IDWriteTextAnalysisSource, public IDWriteTextAnalysisSink +class TextAnalysis : public IDWriteTextAnalysisSource, public IDWriteTextAnalysisSink { public: - IFACEMETHOD (QueryInterface) (IID const& iid, OUT void** ppObject) { return S_OK; } + IFACEMETHOD (QueryInterface) (IID const& iid, OUT void** ppObject) + { return S_OK; } IFACEMETHOD_ (ULONG, AddRef) () { return 1; } IFACEMETHOD_ (ULONG, Release) () { return 1; } @@ -273,7 +269,7 @@ public: uint8_t mBidiLevel; bool mIsSideways; - inline bool ContainsTextPosition (uint32_t aTextPosition) const + bool ContainsTextPosition (uint32_t aTextPosition) const { return aTextPosition >= mTextStart && aTextPosition < mTextStart + mTextLength; @@ -283,16 +279,10 @@ public: }; public: - TextAnalysis (const wchar_t* text, - uint32_t textLength, - const wchar_t* localeName, - DWRITE_READING_DIRECTION readingDirection) - : mText (text) - , mTextLength (textLength) - , mLocaleName (localeName) - , mReadingDirection (readingDirection) - , mCurrentRun (nullptr) { }; - + TextAnalysis (const wchar_t* text, uint32_t textLength, + const wchar_t* localeName, DWRITE_READING_DIRECTION readingDirection) + : mText (text), mTextLength (textLength), mLocaleName (localeName), + mReadingDirection (readingDirection), mCurrentRun (nullptr) {} ~TextAnalysis () { // delete runs, except mRunHead which is part of the TextAnalysis object @@ -304,8 +294,8 @@ public: } } - STDMETHODIMP GenerateResults (IDWriteTextAnalyzer* textAnalyzer, - Run **runHead) + STDMETHODIMP + GenerateResults (IDWriteTextAnalyzer* textAnalyzer, Run **runHead) { // Analyzes the text using the script analyzer and returns // the result as a series of runs. @@ -330,9 +320,10 @@ public: // IDWriteTextAnalysisSource implementation - IFACEMETHODIMP GetTextAtPosition (uint32_t textPosition, - OUT wchar_t const** textString, - OUT uint32_t* textLength) + IFACEMETHODIMP + GetTextAtPosition (uint32_t textPosition, + OUT wchar_t const** textString, + OUT uint32_t* textLength) { if (textPosition >= mTextLength) { @@ -348,9 +339,10 @@ public: return S_OK; } - IFACEMETHODIMP GetTextBeforePosition (uint32_t textPosition, - OUT wchar_t const** textString, - OUT uint32_t* textLength) + IFACEMETHODIMP + GetTextBeforePosition (uint32_t textPosition, + OUT wchar_t const** textString, + OUT uint32_t* textLength) { if (textPosition == 0 || textPosition > mTextLength) { @@ -368,19 +360,16 @@ public: } IFACEMETHODIMP_ (DWRITE_READING_DIRECTION) - GetParagraphReadingDirection () { return mReadingDirection; } + GetParagraphReadingDirection () { return mReadingDirection; } - IFACEMETHODIMP GetLocaleName (uint32_t textPosition, - uint32_t* textLength, - wchar_t const** localeName) - { - return S_OK; - } + IFACEMETHODIMP GetLocaleName (uint32_t textPosition, uint32_t* textLength, + wchar_t const** localeName) + { return S_OK; } IFACEMETHODIMP - GetNumberSubstitution (uint32_t textPosition, - OUT uint32_t* textLength, - OUT IDWriteNumberSubstitution** numberSubstitution) + GetNumberSubstitution (uint32_t textPosition, + OUT uint32_t* textLength, + OUT IDWriteNumberSubstitution** numberSubstitution) { // We do not support number substitution. *numberSubstitution = nullptr; @@ -392,9 +381,8 @@ public: // IDWriteTextAnalysisSink implementation IFACEMETHODIMP - SetScriptAnalysis (uint32_t textPosition, - uint32_t textLength, - DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis) + SetScriptAnalysis (uint32_t textPosition, uint32_t textLength, + DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis) { SetCurrentRun (textPosition); SplitCurrentRun (textPosition); @@ -408,19 +396,19 @@ public: } IFACEMETHODIMP - SetLineBreakpoints (uint32_t textPosition, - uint32_t textLength, - const DWRITE_LINE_BREAKPOINT* lineBreakpoints) { return S_OK; } + SetLineBreakpoints (uint32_t textPosition, + uint32_t textLength, + const DWRITE_LINE_BREAKPOINT* lineBreakpoints) + { return S_OK; } - IFACEMETHODIMP SetBidiLevel (uint32_t textPosition, - uint32_t textLength, - uint8_t explicitLevel, - uint8_t resolvedLevel) { return S_OK; } + IFACEMETHODIMP SetBidiLevel (uint32_t textPosition, uint32_t textLength, + uint8_t explicitLevel, uint8_t resolvedLevel) + { return S_OK; } IFACEMETHODIMP - SetNumberSubstitution (uint32_t textPosition, - uint32_t textLength, - IDWriteNumberSubstitution* numberSubstitution) { return S_OK; } + SetNumberSubstitution (uint32_t textPosition, uint32_t textLength, + IDWriteNumberSubstitution* numberSubstitution) + { return S_OK; } protected: Run *FetchNextRun (IN OUT uint32_t* textLength) @@ -520,11 +508,11 @@ static inline uint32_t hb_uint32_swap (const uint32_t v) static hb_bool_t _hb_directwrite_shape_full (hb_shape_plan_t *shape_plan, - hb_font_t *font, - hb_buffer_t *buffer, - const hb_feature_t *features, - unsigned int num_features, - float lineWidth) + hb_font_t *font, + hb_buffer_t *buffer, + const hb_feature_t *features, + unsigned int num_features, + float lineWidth) { hb_face_t *face = font->face; const hb_directwrite_face_data_t *face_data = face->data.directwrite; @@ -580,9 +568,10 @@ _hb_directwrite_shape_full (hb_shape_plan_t *shape_plan, // TODO: Handle TEST_DISABLE_OPTIONAL_LIGATURES - DWRITE_READING_DIRECTION readingDirection = buffer->props.direction ? - DWRITE_READING_DIRECTION_RIGHT_TO_LEFT : - DWRITE_READING_DIRECTION_LEFT_TO_RIGHT; + DWRITE_READING_DIRECTION readingDirection; + readingDirection = buffer->props.direction ? + DWRITE_READING_DIRECTION_RIGHT_TO_LEFT : + DWRITE_READING_DIRECTION_LEFT_TO_RIGHT; /* * There's an internal 16-bit limit on some things inside the analyzer, @@ -611,10 +600,8 @@ _hb_directwrite_shape_full (hb_shape_plan_t *shape_plan, const wchar_t localeName[20] = {0}; if (buffer->props.language != nullptr) - { mbstowcs ((wchar_t*) localeName, - hb_language_to_string (buffer->props.language), 20); - } + hb_language_to_string (buffer->props.language), 20); // TODO: it does work but doesn't care about ranges DWRITE_TYPOGRAPHIC_FEATURES typographic_features; @@ -625,27 +612,29 @@ _hb_directwrite_shape_full (hb_shape_plan_t *shape_plan, for (unsigned int i = 0; i < num_features; ++i) { typographic_features.features[i].nameTag = (DWRITE_FONT_FEATURE_TAG) - hb_uint32_swap (features[i].tag); + hb_uint32_swap (features[i].tag); typographic_features.features[i].parameter = features[i].value; } } - const DWRITE_TYPOGRAPHIC_FEATURES* dwFeatures = - (const DWRITE_TYPOGRAPHIC_FEATURES*) &typographic_features; + const DWRITE_TYPOGRAPHIC_FEATURES* dwFeatures; + dwFeatures = (const DWRITE_TYPOGRAPHIC_FEATURES*) &typographic_features; const uint32_t featureRangeLengths[] = { textLength }; // - uint16_t* clusterMap = new uint16_t[textLength]; - DWRITE_SHAPING_TEXT_PROPERTIES* textProperties = - new DWRITE_SHAPING_TEXT_PROPERTIES[textLength]; + uint16_t* clusterMap; + clusterMap = new uint16_t[textLength]; + DWRITE_SHAPING_TEXT_PROPERTIES* textProperties; + textProperties = new DWRITE_SHAPING_TEXT_PROPERTIES[textLength]; retry_getglyphs: uint16_t* glyphIndices = new uint16_t[maxGlyphCount]; - DWRITE_SHAPING_GLYPH_PROPERTIES* glyphProperties = - new DWRITE_SHAPING_GLYPH_PROPERTIES[maxGlyphCount]; + DWRITE_SHAPING_GLYPH_PROPERTIES* glyphProperties; + glyphProperties = new DWRITE_SHAPING_GLYPH_PROPERTIES[maxGlyphCount]; hr = analyzer->GetGlyphs (textString, textLength, fontFace, false, - isRightToLeft, &runHead->mScript, localeName, nullptr, &dwFeatures, - featureRangeLengths, 1, maxGlyphCount, clusterMap, textProperties, glyphIndices, - glyphProperties, &glyphCount); + isRightToLeft, &runHead->mScript, localeName, + nullptr, &dwFeatures, featureRangeLengths, 1, + maxGlyphCount, clusterMap, textProperties, + glyphIndices, glyphProperties, &glyphCount); if (unlikely (hr == HRESULT_FROM_WIN32 (ERROR_INSUFFICIENT_BUFFER))) { @@ -665,30 +654,28 @@ retry_getglyphs: /* The -2 in the following is to compensate for possible * alignment needed after the WORD array. sizeof (WORD) == 2. */ unsigned int glyphs_size = (scratch_size * sizeof (int) - 2) - / (sizeof (WORD) + - sizeof (DWRITE_SHAPING_GLYPH_PROPERTIES) + - sizeof (int) + - sizeof (DWRITE_GLYPH_OFFSET) + - sizeof (uint32_t)); + / (sizeof (WORD) + + sizeof (DWRITE_SHAPING_GLYPH_PROPERTIES) + + sizeof (int) + + sizeof (DWRITE_GLYPH_OFFSET) + + sizeof (uint32_t)); ALLOCATE_ARRAY (uint32_t, vis_clusters, glyphs_size); #undef ALLOCATE_ARRAY int fontEmSize = font->face->get_upem (); - if (fontEmSize < 0) - fontEmSize = -fontEmSize; + if (fontEmSize < 0) fontEmSize = -fontEmSize; - if (fontEmSize < 0) - fontEmSize = -fontEmSize; + if (fontEmSize < 0) fontEmSize = -fontEmSize; double x_mult = (double) font->x_scale / fontEmSize; double y_mult = (double) font->y_scale / fontEmSize; - hr = analyzer->GetGlyphPlacements (textString, - clusterMap, textProperties, textLength, glyphIndices, - glyphProperties, glyphCount, fontFace, fontEmSize, - false, isRightToLeft, &runHead->mScript, localeName, - &dwFeatures, featureRangeLengths, 1, - glyphAdvances, glyphOffsets); + hr = analyzer->GetGlyphPlacements (textString, clusterMap, textProperties, + textLength, glyphIndices, glyphProperties, + glyphCount, fontFace, fontEmSize, + false, isRightToLeft, &runHead->mScript, localeName, + &dwFeatures, featureRangeLengths, 1, + glyphAdvances, glyphOffsets); if (FAILED (hr)) FAIL ("Analyzer failed to get glyph placements."); @@ -698,12 +685,12 @@ retry_getglyphs: if (analyzer1 && lineWidth) { - DWRITE_JUSTIFICATION_OPPORTUNITY* justificationOpportunities = new DWRITE_JUSTIFICATION_OPPORTUNITY[maxGlyphCount]; - hr = analyzer1->GetJustificationOpportunities (fontFace, fontEmSize, - runHead->mScript, textLength, glyphCount, textString, clusterMap, - glyphProperties, justificationOpportunities); + hr = analyzer1->GetJustificationOpportunities (fontFace, fontEmSize, runHead->mScript, + textLength, glyphCount, textString, + clusterMap, glyphProperties, + justificationOpportunities); if (FAILED (hr)) FAIL ("Analyzer failed to get justification opportunities."); @@ -711,15 +698,14 @@ retry_getglyphs: float* justifiedGlyphAdvances = new float[maxGlyphCount]; DWRITE_GLYPH_OFFSET* justifiedGlyphOffsets = new DWRITE_GLYPH_OFFSET[glyphCount]; hr = analyzer1->JustifyGlyphAdvances (lineWidth, glyphCount, justificationOpportunities, - glyphAdvances, glyphOffsets, justifiedGlyphAdvances, justifiedGlyphOffsets); + glyphAdvances, glyphOffsets, justifiedGlyphAdvances, + justifiedGlyphOffsets); - if (FAILED (hr)) - FAIL ("Analyzer failed to get justified glyph advances."); + if (FAILED (hr)) FAIL ("Analyzer failed to get justify glyph advances."); DWRITE_SCRIPT_PROPERTIES scriptProperties; hr = analyzer1->GetScriptProperties (runHead->mScript, &scriptProperties); - if (FAILED (hr)) - FAIL ("Analyzer failed to get script properties."); + if (FAILED (hr)) FAIL ("Analyzer failed to get script properties."); uint32_t justificationCharacter = scriptProperties.justificationCharacter; // if a script justificationCharacter is not space, it can have GetJustifiedGlyphs @@ -729,14 +715,15 @@ retry_getglyphs: retry_getjustifiedglyphs: uint16_t* modifiedGlyphIndices = new uint16_t[maxGlyphCount]; float* modifiedGlyphAdvances = new float[maxGlyphCount]; - DWRITE_GLYPH_OFFSET* modifiedGlyphOffsets = - new DWRITE_GLYPH_OFFSET[maxGlyphCount]; + DWRITE_GLYPH_OFFSET* modifiedGlyphOffsets = new DWRITE_GLYPH_OFFSET[maxGlyphCount]; uint32_t actualGlyphsCount; hr = analyzer1->GetJustifiedGlyphs (fontFace, fontEmSize, runHead->mScript, - textLength, glyphCount, maxGlyphCount, clusterMap, glyphIndices, - glyphAdvances, justifiedGlyphAdvances, justifiedGlyphOffsets, - glyphProperties, &actualGlyphsCount, modifiedClusterMap, modifiedGlyphIndices, - modifiedGlyphAdvances, modifiedGlyphOffsets); + textLength, glyphCount, maxGlyphCount, + clusterMap, glyphIndices, glyphAdvances, + justifiedGlyphAdvances, justifiedGlyphOffsets, + glyphProperties, &actualGlyphsCount, + modifiedClusterMap, modifiedGlyphIndices, + modifiedGlyphAdvances, modifiedGlyphOffsets); if (hr == HRESULT_FROM_WIN32 (ERROR_INSUFFICIENT_BUFFER)) { @@ -776,7 +763,6 @@ retry_getglyphs: } delete [] justificationOpportunities; - } /* Ok, we've got everything we need, now compose output buffer, @@ -826,13 +812,11 @@ retry_getglyphs: /* TODO vertical */ pos->x_advance = x_mult * (int32_t) info->mask; - pos->x_offset = - x_mult * (isRightToLeft ? -info->var1.i32 : info->var1.i32); + pos->x_offset = x_mult * (isRightToLeft ? -info->var1.i32 : info->var1.i32); pos->y_offset = y_mult * info->var2.i32; } - if (isRightToLeft) - hb_buffer_reverse (buffer); + if (isRightToLeft) hb_buffer_reverse (buffer); delete [] clusterMap; delete [] glyphIndices; @@ -850,13 +834,13 @@ retry_getglyphs: hb_bool_t _hb_directwrite_shape (hb_shape_plan_t *shape_plan, - hb_font_t *font, - hb_buffer_t *buffer, - const hb_feature_t *features, - unsigned int num_features) + hb_font_t *font, + hb_buffer_t *buffer, + const hb_feature_t *features, + unsigned int num_features) { return _hb_directwrite_shape_full (shape_plan, font, buffer, - features, num_features, 0); + features, num_features, 0); } /* @@ -865,16 +849,17 @@ _hb_directwrite_shape (hb_shape_plan_t *shape_plan, hb_bool_t hb_directwrite_shape_experimental_width (hb_font_t *font, - hb_buffer_t *buffer, - const hb_feature_t *features, - unsigned int num_features, - float width) + hb_buffer_t *buffer, + const hb_feature_t *features, + unsigned int num_features, + float width) { static const char *shapers = "directwrite"; - hb_shape_plan_t *shape_plan = hb_shape_plan_create_cached (font->face, - &buffer->props, features, num_features, &shapers); + hb_shape_plan_t *shape_plan; + shape_plan = hb_shape_plan_create_cached (font->face, &buffer->props, + features, num_features, &shapers); hb_bool_t res = _hb_directwrite_shape_full (shape_plan, font, buffer, - features, num_features, width); + features, num_features, width); buffer->unsafe_to_break_all (); 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 5773596019d..48ce9897d5e 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-dsalgs.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-dsalgs.hh @@ -46,7 +46,7 @@ template static inline HB_CONST_FUNC unsigned int hb_popcount (T v) { -#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) && defined(__OPTIMIZE__) +#if (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) if (sizeof (T) <= sizeof (unsigned int)) return __builtin_popcount (v); @@ -89,7 +89,7 @@ hb_bit_storage (T v) { if (unlikely (!v)) return 0; -#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__OPTIMIZE__) +#if (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) if (sizeof (T) <= sizeof (unsigned int)) return sizeof (unsigned int) * 8 - __builtin_clz (v); @@ -163,7 +163,7 @@ hb_ctz (T v) { if (unlikely (!v)) return 0; -#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__OPTIMIZE__) +#if (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) if (sizeof (T) <= sizeof (unsigned int)) return __builtin_ctz (v); @@ -234,6 +234,15 @@ hb_ctz (T v) * Tiny stuff. */ +template +static inline T* hb_addressof (T& arg) +{ + /* https://en.cppreference.com/w/cpp/memory/addressof */ + return reinterpret_cast( + &const_cast( + reinterpret_cast(arg))); +} + /* ASCII tag/character handling */ static inline bool ISALPHA (unsigned char c) { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); } @@ -287,11 +296,25 @@ hb_ceil_to_4 (unsigned int v) return ((v - 1) | 3) + 1; } -template class hb_assert_unsigned_t; -template <> class hb_assert_unsigned_t {}; -template <> class hb_assert_unsigned_t {}; -template <> class hb_assert_unsigned_t {}; -template <> class hb_assert_unsigned_t {}; +template struct hb_is_signed; +template <> struct hb_is_signed { enum { value = true }; }; +template <> struct hb_is_signed { enum { value = true }; }; +template <> struct hb_is_signed { enum { value = true }; }; +template <> struct hb_is_signed { enum { value = true }; }; +template <> struct hb_is_signed { enum { value = false }; }; +template <> struct hb_is_signed { enum { value = false }; }; +template <> struct hb_is_signed { enum { value = false }; }; +template <> struct hb_is_signed { enum { value = false }; }; +/* We need to define hb_is_signed for the typedefs we use on pre-Visual + * Studio 2010 for the int8_t type, since __int8/__int64 is not considered + * the same as char/long. The previous lines will suffice for the other + * types, though. Note that somehow, unsigned __int8 is considered same + * as unsigned char. + * https://github.com/harfbuzz/harfbuzz/pull/1499 + */ +#if defined(_MSC_VER) && (_MSC_VER < 1600) +template <> struct hb_is_signed<__int8> { enum { value = true }; }; +#endif template static inline bool hb_in_range (T u, T lo, T hi) @@ -301,7 +324,7 @@ hb_in_range (T u, T lo, T hi) * one right now. Declaring a variable won't work as HB_UNUSED * is unusable on some platforms and unused types are less likely * to generate a warning than unused variables. */ - static_assert ((sizeof (hb_assert_unsigned_t) >= 0), ""); + static_assert (!hb_is_signed::value, ""); /* The casts below are important as if T is smaller than int, * the subtract results will become a signed int! */ @@ -529,232 +552,28 @@ hb_codepoint_parse (const char *s, unsigned int len, int base, hb_codepoint_t *o } -struct hb_bytes_t -{ - 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 * sizeof (array.arrayZ[0])) {} - - inline operator const void * (void) const { return arrayZ; } - inline operator const char * (void) const { return arrayZ; } - - 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 hb_memcmp (a.arrayZ, arrayZ, len); - } - static inline int cmp (const void *pa, const void *pb) - { - hb_bytes_t *a = (hb_bytes_t *) pa; - hb_bytes_t *b = (hb_bytes_t *) pb; - return b->cmp (*a); - } - - const char *arrayZ; - unsigned int len; -}; - -template -struct hb_sorted_array_t; - -template -struct hb_array_t -{ - static_assert ((bool) (unsigned) hb_static_size (Type), ""); - - inline hb_array_t (void) : arrayZ (nullptr), len (0) {} - inline hb_array_t (const hb_array_t &o) : arrayZ (o.arrayZ), len (o.len) {} - inline hb_array_t (Type *array_, unsigned int len_) : arrayZ (array_), len (len_) {} - - inline Type& operator [] (unsigned int i) const - { - if (unlikely (i >= len)) return Null(Type); - return arrayZ[i]; - } - - template inline operator T * (void) const { return arrayZ; } - - inline Type * operator & (void) const { return arrayZ; } - - inline unsigned int get_size (void) const { return len * sizeof (Type); } - - inline hb_array_t sub_array (unsigned int start_offset, unsigned int *seg_count /* IN/OUT */) const - { - if (!seg_count) return hb_array_t (); - - unsigned int count = len; - if (unlikely (start_offset > count)) - count = 0; - else - count -= start_offset; - count = *seg_count = MIN (count, *seg_count); - return hb_array_t (arrayZ + start_offset, count); - } - inline hb_array_t sub_array (unsigned int start_offset, unsigned int seg_count) const - { return sub_array (start_offset, &seg_count); } - - inline hb_bytes_t as_bytes (void) const - { return hb_bytes_t (arrayZ, len * sizeof (Type)); } - - template - inline Type *lsearch (const T &x, - Type *not_found = nullptr) - { - unsigned int count = len; - for (unsigned int i = 0; i < count; i++) - if (!this->arrayZ[i].cmp (x)) - return &this->arrayZ[i]; - return not_found; - } - template - inline const Type *lsearch (const T &x, - const Type *not_found = nullptr) const - { - unsigned int count = len; - for (unsigned int i = 0; i < count; i++) - if (!this->arrayZ[i].cmp (x)) - return &this->arrayZ[i]; - return not_found; - } - - inline hb_sorted_array_t qsort (int (*cmp)(const void*, const void*)) - { - ::qsort (arrayZ, len, sizeof (Type), cmp); - return hb_sorted_array_t (*this); - } - inline hb_sorted_array_t qsort (void) - { - ::qsort (arrayZ, len, sizeof (Type), Type::cmp); - return hb_sorted_array_t (*this); - } - inline void qsort (unsigned int start, unsigned int end) - { - end = MIN (end, len); - assert (start <= end); - ::qsort (arrayZ + start, end - start, sizeof (Type), Type::cmp); - } - - inline void free (void) - { ::free ((void *) arrayZ); arrayZ = nullptr; len = 0; } - - template - inline bool sanitize (hb_sanitize_context_t *c) const - { return c->check_array (arrayZ, len); } - - public: - Type *arrayZ; - unsigned int len; -}; -template -inline hb_array_t hb_array (T *array, unsigned int len) -{ return hb_array_t (array, len); } - -enum hb_bfind_not_found_t -{ - HB_BFIND_NOT_FOUND_DONT_STORE, - HB_BFIND_NOT_FOUND_STORE, - HB_BFIND_NOT_FOUND_STORE_CLOSEST, -}; - -template -struct hb_sorted_array_t : hb_array_t -{ - inline hb_sorted_array_t (void) : hb_array_t () {} - inline hb_sorted_array_t (const hb_array_t &o) : hb_array_t (o) {} - inline hb_sorted_array_t (Type *array_, unsigned int len_) : hb_array_t (array_, len_) {} - - inline hb_sorted_array_t sub_array (unsigned int start_offset, unsigned int *seg_count /* IN/OUT */) const - { return hb_sorted_array_t (((const hb_array_t *) (this))->sub_array (start_offset, seg_count)); } - inline hb_sorted_array_t sub_array (unsigned int start_offset, unsigned int seg_count) const - { return sub_array (start_offset, &seg_count); } - - template - inline Type *bsearch (const T &x, Type *not_found = nullptr) - { - unsigned int i; - return bfind (x, &i) ? &this->arrayZ[i] : not_found; - } - template - inline const Type *bsearch (const T &x, const Type *not_found = nullptr) const - { - unsigned int i; - return bfind (x, &i) ? &this->arrayZ[i] : not_found; - } - template - inline bool bfind (const T &x, unsigned int *i = nullptr, - hb_bfind_not_found_t not_found = HB_BFIND_NOT_FOUND_DONT_STORE, - unsigned int to_store = (unsigned int) -1) const - { - int min = 0, max = (int) this->len - 1; - const Type *array = this->arrayZ; - while (min <= max) - { - int mid = ((unsigned int) min + (unsigned int) max) / 2; - int c = array[mid].cmp (x); - if (c < 0) - max = mid - 1; - else if (c > 0) - min = mid + 1; - else - { - if (i) - *i = mid; - return true; - } - } - if (i) - { - switch (not_found) - { - case HB_BFIND_NOT_FOUND_DONT_STORE: - break; - - case HB_BFIND_NOT_FOUND_STORE: - *i = to_store; - break; - - case HB_BFIND_NOT_FOUND_STORE_CLOSEST: - if (max < 0 || (max < (int) this->len && array[max].cmp (x) > 0)) - max++; - *i = max; - break; - } - } - return false; - } -}; -template -inline hb_sorted_array_t hb_sorted_array (T *array, unsigned int len) -{ return hb_sorted_array_t (array, len); } - - struct HbOpOr { - static const bool passthru_left = true; - static const bool passthru_right = true; + enum { passthru_left = true }; + enum { passthru_right = true }; template static void process (T &o, const T &a, const T &b) { o = a | b; } }; struct HbOpAnd { - static const bool passthru_left = false; - static const bool passthru_right = false; + enum { passthru_left = false }; + enum { passthru_right = false }; template static void process (T &o, const T &a, const T &b) { o = a & b; } }; struct HbOpMinus { - static const bool passthru_left = true; - static const bool passthru_right = false; + enum { passthru_left = true }; + enum { passthru_right = false }; template static void process (T &o, const T &a, const T &b) { o = a & ~b; } }; struct HbOpXor { - static const bool passthru_left = true; - static const bool passthru_right = true; + enum { passthru_left = true }; + enum { passthru_right = true }; template static void process (T &o, const T &a, const T &b) { o = a ^ b; } }; @@ -767,13 +586,13 @@ struct HbOpXor template struct hb_vector_size_t { - inline elt_t& operator [] (unsigned int i) { return u.v[i]; } - inline const elt_t& operator [] (unsigned int i) const { return u.v[i]; } + elt_t& operator [] (unsigned int i) { return u.v[i]; } + const elt_t& operator [] (unsigned int i) const { return u.v[i]; } - inline void clear (unsigned char v = 0) { memset (this, v, sizeof (*this)); } + void clear (unsigned char v = 0) { memset (this, v, sizeof (*this)); } template - inline hb_vector_size_t process (const hb_vector_size_t &o) const + hb_vector_size_t process (const hb_vector_size_t &o) const { hb_vector_size_t r; #if HB_VECTOR_SIZE @@ -786,13 +605,13 @@ struct hb_vector_size_t Op::process (r.u.v[i], u.v[i], o.u.v[i]); return r; } - inline hb_vector_size_t operator | (const hb_vector_size_t &o) const + hb_vector_size_t operator | (const hb_vector_size_t &o) const { return process (o); } - inline hb_vector_size_t operator & (const hb_vector_size_t &o) const + hb_vector_size_t operator & (const hb_vector_size_t &o) const { return process (o); } - inline hb_vector_size_t operator ^ (const hb_vector_size_t &o) const + hb_vector_size_t operator ^ (const hb_vector_size_t &o) const { return process (o); } - inline hb_vector_size_t operator ~ () const + hb_vector_size_t operator ~ () const { hb_vector_size_t r; #if HB_VECTOR_SIZE && 0 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 5b33784f45c..8bb8c512106 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc @@ -224,7 +224,7 @@ hb_face_create (hb_blob_t *blob, * Since: 0.9.2 **/ hb_face_t * -hb_face_get_empty (void) +hb_face_get_empty () { return const_cast (&Null(hb_face_t)); } @@ -588,7 +588,7 @@ struct hb_face_builder_data_t { struct table_entry_t { - inline int cmp (hb_tag_t t) const + int cmp (hb_tag_t t) const { if (t < tag) return -1; if (t > tag) return -1; @@ -603,7 +603,7 @@ struct hb_face_builder_data_t }; static hb_face_builder_data_t * -_hb_face_builder_data_create (void) +_hb_face_builder_data_create () { hb_face_builder_data_t *data = (hb_face_builder_data_t *) calloc (1, sizeof (hb_face_builder_data_t)); if (unlikely (!data)) @@ -642,18 +642,13 @@ _hb_face_builder_data_reference_blob (hb_face_builder_data_t *data) return nullptr; hb_serialize_context_t c (buf, face_length); + c.propagate_error (data->tables); OT::OpenTypeFontFile *f = c.start_serialize (); bool is_cff = data->tables.lsearch (HB_TAG ('C','F','F',' ')) || data->tables.lsearch (HB_TAG ('C','F','F','2')); hb_tag_t sfnt_tag = is_cff ? OT::OpenTypeFontFile::CFFTag : OT::OpenTypeFontFile::TrueTypeTag; - Supplier tags_supplier (&data->tables[0].tag, table_count, sizeof (data->tables[0])); - Supplier blobs_supplier (&data->tables[0].blob, table_count, sizeof (data->tables[0])); - bool ret = f->serialize_single (&c, - sfnt_tag, - tags_supplier, - blobs_supplier, - table_count); + bool ret = f->serialize_single (&c, sfnt_tag, data->tables.as_array ()); c.end_serialize (); @@ -694,7 +689,7 @@ _hb_face_builder_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void * Since: 1.9.0 **/ hb_face_t * -hb_face_builder_create (void) +hb_face_builder_create () { hb_face_builder_data_t *data = _hb_face_builder_data_create (); if (unlikely (!data)) return hb_face_get_empty (); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.hh index 0b672336f3e..68834baeb83 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.hh @@ -67,7 +67,7 @@ struct hb_face_t }; hb_atomic_ptr_t shape_plans; - inline hb_blob_t *reference_table (hb_tag_t tag) const + hb_blob_t *reference_table (hb_tag_t tag) const { hb_blob_t *blob; @@ -81,7 +81,7 @@ struct hb_face_t return blob; } - inline HB_PURE_FUNC unsigned int get_upem (void) const + HB_PURE_FUNC unsigned int get_upem () const { unsigned int ret = upem.get_relaxed (); if (unlikely (!ret)) @@ -91,7 +91,7 @@ struct hb_face_t return ret; } - inline unsigned int get_num_glyphs (void) const + unsigned int get_num_glyphs () const { unsigned int ret = num_glyphs.get_relaxed (); if (unlikely (ret == (unsigned int) -1)) @@ -100,8 +100,8 @@ struct hb_face_t } private: - HB_INTERNAL unsigned int load_upem (void) const; - HB_INTERNAL unsigned int load_num_glyphs (void) const; + HB_INTERNAL unsigned int load_upem () const; + HB_INTERNAL unsigned int load_num_glyphs () const; }; DECLARE_NULL_INSTANCE (hb_face_t); 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 237b2a50929..0f0bcadc1b5 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc @@ -523,7 +523,7 @@ static const hb_font_funcs_t _hb_font_funcs_default = { * Since: 0.9.2 **/ hb_font_funcs_t * -hb_font_funcs_create (void) +hb_font_funcs_create () { hb_font_funcs_t *ffuncs; @@ -545,7 +545,7 @@ hb_font_funcs_create (void) * Since: 0.9.2 **/ hb_font_funcs_t * -hb_font_funcs_get_empty (void) +hb_font_funcs_get_empty () { return const_cast (&_hb_font_funcs_default); } @@ -1408,7 +1408,7 @@ hb_font_create_sub_font (hb_font_t *parent) * Since: 0.9.2 **/ hb_font_t * -hb_font_get_empty (void) +hb_font_get_empty () { return const_cast (&Null(hb_font_t)); } 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 73733b34bb3..aaa0fd91cac 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.hh @@ -86,7 +86,7 @@ struct hb_font_funcs_t #define HB_FONT_FUNC_IMPLEMENT(name) +1 HB_FONT_FUNCS_IMPLEMENT_CALLBACKS #undef HB_FONT_FUNC_IMPLEMENT - ]) (void); + ]) (); } get; }; DECLARE_NULL_INSTANCE (hb_font_funcs_t); @@ -127,40 +127,42 @@ struct hb_font_t /* Convert from font-space to user-space */ - inline int dir_scale (hb_direction_t direction) + int dir_scale (hb_direction_t direction) { return HB_DIRECTION_IS_VERTICAL(direction) ? y_scale : x_scale; } - inline hb_position_t em_scale_x (int16_t v) { return em_scale (v, x_scale); } - inline hb_position_t em_scale_y (int16_t v) { return em_scale (v, y_scale); } - inline hb_position_t em_scalef_x (float v) { return em_scalef (v, this->x_scale); } - inline hb_position_t em_scalef_y (float v) { return em_scalef (v, this->y_scale); } - inline float em_fscale_x (int16_t v) { return em_fscale (v, x_scale); } - inline float em_fscale_y (int16_t v) { return em_fscale (v, y_scale); } - inline hb_position_t em_scale_dir (int16_t v, hb_direction_t direction) + hb_position_t em_scale_x (int16_t v) { return em_scale (v, x_scale); } + hb_position_t em_scale_y (int16_t v) { return em_scale (v, y_scale); } + hb_position_t em_scalef_x (float v) { return em_scalef (v, this->x_scale); } + hb_position_t em_scalef_y (float v) { return em_scalef (v, this->y_scale); } + float em_fscale_x (int16_t v) { return em_fscale (v, x_scale); } + float em_fscale_y (int16_t v) { return em_fscale (v, y_scale); } + hb_position_t em_scale_dir (int16_t v, hb_direction_t direction) { return em_scale (v, dir_scale (direction)); } /* Convert from parent-font user-space to our user-space */ - inline hb_position_t parent_scale_x_distance (hb_position_t v) { + hb_position_t parent_scale_x_distance (hb_position_t v) + { if (unlikely (parent && parent->x_scale != x_scale)) return (hb_position_t) (v * (int64_t) this->x_scale / this->parent->x_scale); return v; } - inline hb_position_t parent_scale_y_distance (hb_position_t v) { + hb_position_t parent_scale_y_distance (hb_position_t v) + { if (unlikely (parent && parent->y_scale != y_scale)) return (hb_position_t) (v * (int64_t) this->y_scale / this->parent->y_scale); return v; } - inline hb_position_t parent_scale_x_position (hb_position_t v) { - return parent_scale_x_distance (v); - } - inline hb_position_t parent_scale_y_position (hb_position_t v) { - return parent_scale_y_distance (v); - } + hb_position_t parent_scale_x_position (hb_position_t v) + { return parent_scale_x_distance (v); } + hb_position_t parent_scale_y_position (hb_position_t v) + { return parent_scale_y_distance (v); } - inline void parent_scale_distance (hb_position_t *x, hb_position_t *y) { + void parent_scale_distance (hb_position_t *x, hb_position_t *y) + { *x = parent_scale_x_distance (*x); *y = parent_scale_y_distance (*y); } - inline void parent_scale_position (hb_position_t *x, hb_position_t *y) { + void parent_scale_position (hb_position_t *x, hb_position_t *y) + { *x = parent_scale_x_position (*x); *y = parent_scale_y_position (*y); } @@ -174,14 +176,14 @@ struct hb_font_t /* has_* ... */ #define HB_FONT_FUNC_IMPLEMENT(name) \ bool \ - has_##name##_func (void) \ + has_##name##_func () \ { \ hb_font_funcs_t *funcs = this->klass; \ unsigned int i = offsetof (hb_font_funcs_t::get_t::get_funcs_t, name) / sizeof (funcs->get.array[0]); \ return has_func (i); \ } \ bool \ - has_##name##_func_set (void) \ + has_##name##_func_set () \ { \ hb_font_funcs_t *funcs = this->klass; \ unsigned int i = offsetof (hb_font_funcs_t::get_t::get_funcs_t, name) / sizeof (funcs->get.array[0]); \ @@ -190,14 +192,14 @@ struct hb_font_t HB_FONT_FUNCS_IMPLEMENT_CALLBACKS #undef HB_FONT_FUNC_IMPLEMENT - inline hb_bool_t get_font_h_extents (hb_font_extents_t *extents) + hb_bool_t get_font_h_extents (hb_font_extents_t *extents) { memset (extents, 0, sizeof (*extents)); return klass->get.f.font_h_extents (this, user_data, extents, klass->user_data.font_h_extents); } - inline hb_bool_t get_font_v_extents (hb_font_extents_t *extents) + hb_bool_t get_font_v_extents (hb_font_extents_t *extents) { memset (extents, 0, sizeof (*extents)); return klass->get.f.font_v_extents (this, user_data, @@ -205,13 +207,13 @@ struct hb_font_t klass->user_data.font_v_extents); } - inline bool has_glyph (hb_codepoint_t unicode) + bool has_glyph (hb_codepoint_t unicode) { hb_codepoint_t glyph; return get_nominal_glyph (unicode, &glyph); } - inline hb_bool_t get_nominal_glyph (hb_codepoint_t unicode, + hb_bool_t get_nominal_glyph (hb_codepoint_t unicode, hb_codepoint_t *glyph) { *glyph = 0; @@ -219,11 +221,11 @@ 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) + 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, @@ -232,8 +234,8 @@ struct hb_font_t 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) + hb_bool_t get_variation_glyph (hb_codepoint_t unicode, hb_codepoint_t variation_selector, + hb_codepoint_t *glyph) { *glyph = 0; return klass->get.f.variation_glyph (this, user_data, @@ -241,25 +243,25 @@ struct hb_font_t klass->user_data.variation_glyph); } - inline hb_position_t get_glyph_h_advance (hb_codepoint_t glyph) + hb_position_t get_glyph_h_advance (hb_codepoint_t glyph) { return klass->get.f.glyph_h_advance (this, user_data, glyph, klass->user_data.glyph_h_advance); } - inline hb_position_t get_glyph_v_advance (hb_codepoint_t glyph) + hb_position_t get_glyph_v_advance (hb_codepoint_t glyph) { return klass->get.f.glyph_v_advance (this, user_data, glyph, klass->user_data.glyph_v_advance); } - inline void get_glyph_h_advances (unsigned int count, - const hb_codepoint_t *first_glyph, - unsigned int glyph_stride, - hb_position_t *first_advance, - unsigned int advance_stride) + void get_glyph_h_advances (unsigned int count, + const hb_codepoint_t *first_glyph, + unsigned int glyph_stride, + hb_position_t *first_advance, + unsigned int advance_stride) { return klass->get.f.glyph_h_advances (this, user_data, count, @@ -268,11 +270,11 @@ struct hb_font_t klass->user_data.glyph_h_advances); } - inline void get_glyph_v_advances (unsigned int count, - const hb_codepoint_t *first_glyph, - unsigned int glyph_stride, - hb_position_t *first_advance, - unsigned int advance_stride) + void get_glyph_v_advances (unsigned int count, + const hb_codepoint_t *first_glyph, + unsigned int glyph_stride, + hb_position_t *first_advance, + unsigned int advance_stride) { return klass->get.f.glyph_v_advances (this, user_data, count, @@ -281,7 +283,7 @@ struct hb_font_t klass->user_data.glyph_v_advances); } - inline hb_bool_t get_glyph_h_origin (hb_codepoint_t glyph, + hb_bool_t get_glyph_h_origin (hb_codepoint_t glyph, hb_position_t *x, hb_position_t *y) { *x = *y = 0; @@ -290,8 +292,8 @@ struct hb_font_t klass->user_data.glyph_h_origin); } - inline hb_bool_t get_glyph_v_origin (hb_codepoint_t glyph, - hb_position_t *x, hb_position_t *y) + hb_bool_t get_glyph_v_origin (hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y) { *x = *y = 0; return klass->get.f.glyph_v_origin (this, user_data, @@ -299,21 +301,23 @@ struct hb_font_t klass->user_data.glyph_v_origin); } - inline hb_position_t get_glyph_h_kerning (hb_codepoint_t left_glyph, hb_codepoint_t right_glyph) + hb_position_t get_glyph_h_kerning (hb_codepoint_t left_glyph, + hb_codepoint_t right_glyph) { return klass->get.f.glyph_h_kerning (this, user_data, left_glyph, right_glyph, klass->user_data.glyph_h_kerning); } - inline hb_position_t get_glyph_v_kerning (hb_codepoint_t top_glyph, hb_codepoint_t bottom_glyph) + hb_position_t get_glyph_v_kerning (hb_codepoint_t top_glyph, + hb_codepoint_t bottom_glyph) { return klass->get.f.glyph_v_kerning (this, user_data, top_glyph, bottom_glyph, klass->user_data.glyph_v_kerning); } - inline hb_bool_t get_glyph_extents (hb_codepoint_t glyph, + hb_bool_t get_glyph_extents (hb_codepoint_t glyph, hb_glyph_extents_t *extents) { memset (extents, 0, sizeof (*extents)); @@ -323,7 +327,7 @@ struct hb_font_t klass->user_data.glyph_extents); } - inline hb_bool_t get_glyph_contour_point (hb_codepoint_t glyph, unsigned int point_index, + hb_bool_t get_glyph_contour_point (hb_codepoint_t glyph, unsigned int point_index, hb_position_t *x, hb_position_t *y) { *x = *y = 0; @@ -333,8 +337,8 @@ struct hb_font_t klass->user_data.glyph_contour_point); } - inline hb_bool_t get_glyph_name (hb_codepoint_t glyph, - char *name, unsigned int size) + hb_bool_t get_glyph_name (hb_codepoint_t glyph, + char *name, unsigned int size) { if (size) *name = '\0'; return klass->get.f.glyph_name (this, user_data, @@ -343,8 +347,8 @@ struct hb_font_t klass->user_data.glyph_name); } - inline hb_bool_t get_glyph_from_name (const char *name, int len, /* -1 means nul-terminated */ - hb_codepoint_t *glyph) + hb_bool_t get_glyph_from_name (const char *name, int len, /* -1 means nul-terminated */ + hb_codepoint_t *glyph) { *glyph = 0; if (len == -1) len = strlen (name); @@ -357,7 +361,7 @@ struct hb_font_t /* A bit higher-level, and with fallback */ - inline void get_h_extents_with_fallback (hb_font_extents_t *extents) + void get_h_extents_with_fallback (hb_font_extents_t *extents) { if (!get_font_h_extents (extents)) { @@ -366,7 +370,7 @@ struct hb_font_t extents->line_gap = 0; } } - inline void get_v_extents_with_fallback (hb_font_extents_t *extents) + void get_v_extents_with_fallback (hb_font_extents_t *extents) { if (!get_font_v_extents (extents)) { @@ -376,8 +380,8 @@ struct hb_font_t } } - inline void get_extents_for_direction (hb_direction_t direction, - hb_font_extents_t *extents) + void get_extents_for_direction (hb_direction_t direction, + hb_font_extents_t *extents) { if (likely (HB_DIRECTION_IS_HORIZONTAL (direction))) get_h_extents_with_fallback (extents); @@ -385,9 +389,9 @@ struct hb_font_t get_v_extents_with_fallback (extents); } - inline void get_glyph_advance_for_direction (hb_codepoint_t glyph, - hb_direction_t direction, - hb_position_t *x, hb_position_t *y) + void get_glyph_advance_for_direction (hb_codepoint_t glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y) { *x = *y = 0; if (likely (HB_DIRECTION_IS_HORIZONTAL (direction))) @@ -395,12 +399,12 @@ struct hb_font_t else *y = get_glyph_v_advance (glyph); } - inline void get_glyph_advances_for_direction (hb_direction_t direction, - unsigned int count, - const hb_codepoint_t *first_glyph, - unsigned glyph_stride, - hb_position_t *first_advance, - unsigned advance_stride) + void get_glyph_advances_for_direction (hb_direction_t direction, + unsigned int count, + const hb_codepoint_t *first_glyph, + unsigned glyph_stride, + hb_position_t *first_advance, + unsigned advance_stride) { if (likely (HB_DIRECTION_IS_HORIZONTAL (direction))) get_glyph_h_advances (count, first_glyph, glyph_stride, first_advance, advance_stride); @@ -408,8 +412,8 @@ struct hb_font_t get_glyph_v_advances (count, first_glyph, glyph_stride, first_advance, advance_stride); } - inline void guess_v_origin_minus_h_origin (hb_codepoint_t glyph, - hb_position_t *x, hb_position_t *y) + void guess_v_origin_minus_h_origin (hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y) { *x = get_glyph_h_advance (glyph) / 2; @@ -419,8 +423,8 @@ struct hb_font_t *y = extents.ascender; } - inline void get_glyph_h_origin_with_fallback (hb_codepoint_t glyph, - hb_position_t *x, hb_position_t *y) + void get_glyph_h_origin_with_fallback (hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y) { if (!get_glyph_h_origin (glyph, x, y) && get_glyph_v_origin (glyph, x, y)) @@ -430,8 +434,8 @@ struct hb_font_t *x -= dx; *y -= dy; } } - inline void get_glyph_v_origin_with_fallback (hb_codepoint_t glyph, - hb_position_t *x, hb_position_t *y) + void get_glyph_v_origin_with_fallback (hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y) { if (!get_glyph_v_origin (glyph, x, y) && get_glyph_h_origin (glyph, x, y)) @@ -442,9 +446,9 @@ struct hb_font_t } } - inline void get_glyph_origin_for_direction (hb_codepoint_t glyph, - hb_direction_t direction, - hb_position_t *x, hb_position_t *y) + void get_glyph_origin_for_direction (hb_codepoint_t glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y) { if (likely (HB_DIRECTION_IS_HORIZONTAL (direction))) get_glyph_h_origin_with_fallback (glyph, x, y); @@ -452,8 +456,8 @@ struct hb_font_t get_glyph_v_origin_with_fallback (glyph, x, y); } - inline void add_glyph_h_origin (hb_codepoint_t glyph, - hb_position_t *x, hb_position_t *y) + void add_glyph_h_origin (hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y) { hb_position_t origin_x, origin_y; @@ -462,8 +466,8 @@ struct hb_font_t *x += origin_x; *y += origin_y; } - inline void add_glyph_v_origin (hb_codepoint_t glyph, - hb_position_t *x, hb_position_t *y) + void add_glyph_v_origin (hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y) { hb_position_t origin_x, origin_y; @@ -472,9 +476,9 @@ struct hb_font_t *x += origin_x; *y += origin_y; } - inline void add_glyph_origin_for_direction (hb_codepoint_t glyph, - hb_direction_t direction, - hb_position_t *x, hb_position_t *y) + void add_glyph_origin_for_direction (hb_codepoint_t glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y) { hb_position_t origin_x, origin_y; @@ -484,8 +488,8 @@ struct hb_font_t *y += origin_y; } - inline void subtract_glyph_h_origin (hb_codepoint_t glyph, - hb_position_t *x, hb_position_t *y) + void subtract_glyph_h_origin (hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y) { hb_position_t origin_x, origin_y; @@ -494,8 +498,8 @@ struct hb_font_t *x -= origin_x; *y -= origin_y; } - inline void subtract_glyph_v_origin (hb_codepoint_t glyph, - hb_position_t *x, hb_position_t *y) + void subtract_glyph_v_origin (hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y) { hb_position_t origin_x, origin_y; @@ -504,9 +508,9 @@ struct hb_font_t *x -= origin_x; *y -= origin_y; } - inline void subtract_glyph_origin_for_direction (hb_codepoint_t glyph, - hb_direction_t direction, - hb_position_t *x, hb_position_t *y) + void subtract_glyph_origin_for_direction (hb_codepoint_t glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y) { hb_position_t origin_x, origin_y; @@ -516,9 +520,9 @@ struct hb_font_t *y -= origin_y; } - inline void get_glyph_kerning_for_direction (hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, - hb_direction_t direction, - hb_position_t *x, hb_position_t *y) + void get_glyph_kerning_for_direction (hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y) { if (likely (HB_DIRECTION_IS_HORIZONTAL (direction))) { *y = 0; @@ -529,9 +533,9 @@ struct hb_font_t } } - inline hb_bool_t get_glyph_extents_for_origin (hb_codepoint_t glyph, - hb_direction_t direction, - hb_glyph_extents_t *extents) + hb_bool_t get_glyph_extents_for_origin (hb_codepoint_t glyph, + hb_direction_t direction, + hb_glyph_extents_t *extents) { hb_bool_t ret = get_glyph_extents (glyph, extents); @@ -541,9 +545,9 @@ struct hb_font_t return ret; } - inline hb_bool_t get_glyph_contour_point_for_origin (hb_codepoint_t glyph, unsigned int point_index, - hb_direction_t direction, - hb_position_t *x, hb_position_t *y) + hb_bool_t get_glyph_contour_point_for_origin (hb_codepoint_t glyph, unsigned int point_index, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y) { hb_bool_t ret = get_glyph_contour_point (glyph, point_index, x, y); @@ -554,7 +558,7 @@ struct hb_font_t } /* Generates gidDDD if glyph has no name. */ - inline void + void glyph_to_string (hb_codepoint_t glyph, char *s, unsigned int size) { @@ -565,7 +569,7 @@ struct hb_font_t } /* Parses gidDDD and uniUUUU strings automatically. */ - inline hb_bool_t + hb_bool_t glyph_from_string (const char *s, int len, /* -1 means nul-terminated */ hb_codepoint_t *glyph) { @@ -595,21 +599,17 @@ struct hb_font_t return false; } - inline hb_position_t em_scale (int16_t v, int scale) + hb_position_t em_scale (int16_t v, int scale) { int upem = face->get_upem (); int64_t scaled = v * (int64_t) scale; scaled += scaled >= 0 ? upem/2 : -upem/2; /* Round. */ return (hb_position_t) (scaled / upem); } - inline hb_position_t em_scalef (float v, int scale) - { - return (hb_position_t) round (v * scale / face->get_upem ()); - } - inline float em_fscale (int16_t v, int scale) - { - return (float) v * scale / face->get_upem (); - } + hb_position_t em_scalef (float v, int scale) + { return (hb_position_t) round (v * scale / face->get_upem ()); } + float em_fscale (int16_t v, int scale) + { return (float) v * scale / face->get_upem (); } }; DECLARE_NULL_INSTANCE (hb_font_t); 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 633e0ecd2c8..5f6e3808756 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc @@ -479,12 +479,12 @@ hb_ft_get_font_h_extents (hb_font_t *font HB_UNUSED, } #if HB_USE_ATEXIT -static void free_static_ft_funcs (void); +static void free_static_ft_funcs (); #endif static struct hb_ft_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t { - static inline hb_font_funcs_t *create (void) + static hb_font_funcs_t *create () { hb_font_funcs_t *funcs = hb_font_funcs_create (); @@ -514,14 +514,14 @@ static struct hb_ft_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t { - static inline FT_Library create (void) + static FT_Library create () { FT_Library l; if (FT_Init_FreeType (&l)) @@ -763,11 +763,11 @@ static struct hb_ft_library_lazy_loader_t : hb_lazy_loader_t { - static inline hb_unicode_funcs_t *create (void) + static hb_unicode_funcs_t *create () { hb_unicode_funcs_t *funcs = hb_unicode_funcs_create (nullptr); @@ -365,14 +365,14 @@ static struct hb_glib_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader #if HB_USE_ATEXIT static -void free_static_glib_funcs (void) +void free_static_glib_funcs () { static_glib_funcs.free_instance (); } #endif hb_unicode_funcs_t * -hb_glib_get_unicode_funcs (void) +hb_glib_get_unicode_funcs () { return static_glib_funcs.get_unconst (); } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-gobject-enums.cc.tmpl b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-gobject-enums.cc.tmpl index e056df47891..e3a9a6b3fc0 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-gobject-enums.cc.tmpl +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-gobject-enums.cc.tmpl @@ -46,7 +46,7 @@ /*** BEGIN value-header ***/ GType -@enum_name@_get_type (void) +@enum_name@_get_type () { static gsize type_id = 0; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-gobject-enums.h.tmpl b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-gobject-enums.h.tmpl index 606727cd32d..7ef9dfc0295 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-gobject-enums.h.tmpl +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-gobject-enums.h.tmpl @@ -43,7 +43,7 @@ HB_BEGIN_DECLS /*** BEGIN value-header ***/ HB_EXTERN GType -@enum_name@_get_type (void) G_GNUC_CONST; +@enum_name@_get_type () G_GNUC_CONST; #define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ()) /*** END value-header ***/ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-gobject-structs.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-gobject-structs.cc index 23ca43656d0..846240e9322 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-gobject-structs.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-gobject-structs.cc @@ -51,7 +51,7 @@ #define HB_DEFINE_BOXED_TYPE(name,copy_func,free_func) \ GType \ -hb_gobject_##name##_get_type (void) \ +hb_gobject_##name##_get_type () \ { \ static gsize type_id = 0; \ if (g_once_init_enter (&type_id)) { \ 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 287f863404d..c26c91d484a 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-icu.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-icu.cc @@ -302,12 +302,12 @@ hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED, #if HB_USE_ATEXIT -static void free_static_icu_funcs (void); +static void free_static_icu_funcs (); #endif static struct hb_icu_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader_t { - static inline hb_unicode_funcs_t *create (void) + static hb_unicode_funcs_t *create () { void *user_data = nullptr; #if U_ICU_VERSION_MAJOR_NUM >= 49 @@ -337,14 +337,14 @@ static struct hb_icu_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader_ #if HB_USE_ATEXIT static -void free_static_icu_funcs (void) +void free_static_icu_funcs () { static_icu_funcs.free_instance (); } #endif hb_unicode_funcs_t * -hb_icu_get_unicode_funcs (void) +hb_icu_get_unicode_funcs () { return static_icu_funcs.get_unconst (); } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-iter.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-iter.hh deleted file mode 100644 index 6fd6aed79a7..00000000000 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-iter.hh +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright © 2018 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_ITER_HH -#define HB_ITER_HH - -#include "hb.hh" - - -/* Unified iterator object. - * - * The goal of this template is to make the same iterator interface - * available to all types, and make it very easy and compact to use. - * Iterator objects are small, light-weight, objects that can be - * copied by value. If the collection / object being iterated on - * is writable, then the iterator points to lvalues, otherwise it - * returns rvalues. - * - * The way to declare, initialize, and use iterators, eg.: - * - * Iter s (src); - * Iter t (dst); - * for (; s && t; s++, t++) - * *s = *t; - */ - -template -struct Iter; - -#if 0 -template -struct Iter -{ - explicit inline Iter (const T &c); -}; -#endif - -template -struct Iter -{ - /* Type of items. */ - typedef T Value; - - /* Constructors. */ - inline Iter (T *array_, int length_) : - array (array_), length (MAX (length_, 0)) {} - template - explicit inline Iter (T (&array_)[length_]) : - array (array_), length (length_) {} - - /* Emptiness. */ - explicit_operator inline operator bool (void) const { return bool (length); } - - /* Current item. */ - inline T &operator * (void) - { - if (unlikely (!length)) return CrapOrNull(T); - return *array; - } - inline T &operator -> (void) - { - return (operator *); - } - - /* Next. */ - inline Iter & operator ++ (void) - { - if (unlikely (!length)) return *this; - array++; - length--; - return *this; - } - /* Might return void, or a copy of pre-increment iterator. */ - inline void operator ++ (int) - { - if (unlikely (!length)) return; - array++; - length--; - } - - /* Some iterators might implement len(). */ - inline unsigned int len (void) const { return length; } - - /* Some iterators might implement fast-forward. - * Only implement it if it's constant-time. */ - inline void operator += (unsigned int n) - { - n = MIN (n, length); - array += n; - length -= n; - } - - /* Some iterators might implement random-access. - * Only implement it if it's constant-time. */ - inline Iter & operator [] (unsigned int i) - { - if (unlikely (i >= length)) return CrapOrNull(T); - return array[i]; - } - - private: - T *array; - unsigned int length; -}; - -/* XXX Remove - * Just to test these compile. */ -static inline void -m (void) -{ - const int src[10] = {}; - int dst[20]; - - Iter s (src); - Iter s2 (src, 5); - Iter t (dst); - - s2 = s; - - for (; s && t; ++s, ++t) - { - *t = *s; - } -} - -#endif /* HB_ITER_HH */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-kern.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-kern.hh index aa01b470f29..fd5bb9e45ef 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-kern.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-kern.hh @@ -44,10 +44,10 @@ struct hb_kern_machine_t crossStream (crossStream_) {} 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 + 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); 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 39e962936db..9d2ae95556b 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-machinery.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-machinery.hh @@ -32,7 +32,7 @@ #include "hb.hh" #include "hb-blob.hh" -#include "hb-iter.hh" +#include "hb-array.hh" #include "hb-vector.hh" @@ -81,14 +81,14 @@ static inline Type& StructAfter(TObject &X) /* Check _assertion in a method environment */ #define _DEFINE_INSTANCE_ASSERTION1(_line, _assertion) \ - inline void _instance_assertion_on_line_##_line (void) const \ + void _instance_assertion_on_line_##_line () const \ { static_assert ((_assertion), ""); } # define _DEFINE_INSTANCE_ASSERTION0(_line, _assertion) _DEFINE_INSTANCE_ASSERTION1 (_line, _assertion) # define DEFINE_INSTANCE_ASSERTION(_assertion) _DEFINE_INSTANCE_ASSERTION0 (__LINE__, _assertion) /* Check that _code compiles in a method environment */ #define _DEFINE_COMPILES_ASSERTION1(_line, _code) \ - inline void _compiles_assertion_on_line_##_line (void) const \ + void _compiles_assertion_on_line_##_line () const \ { _code; } # define _DEFINE_COMPILES_ASSERTION0(_line, _code) _DEFINE_COMPILES_ASSERTION1 (_line, _code) # define DEFINE_COMPILES_ASSERTION(_code) _DEFINE_COMPILES_ASSERTION0 (__LINE__, _code) @@ -96,7 +96,7 @@ static inline Type& StructAfter(TObject &X) #define DEFINE_SIZE_STATIC(size) \ DEFINE_INSTANCE_ASSERTION (sizeof (*this) == (size)) \ - inline unsigned int get_size (void) const { return (size); } \ + unsigned int get_size () const { return (size); } \ enum { null_size = (size) }; \ enum { min_size = (size) }; \ enum { static_size = (size) } @@ -123,7 +123,7 @@ static inline Type& StructAfter(TObject &X) enum { min_size = (size) } #define DEFINE_SIZE_ARRAY_SIZED(size, array) \ - inline unsigned int get_size (void) const { return (size - (array).min_size + (array).get_size ()); } \ + unsigned int get_size () const { return (size - (array).min_size + (array).get_size ()); } \ DEFINE_SIZE_ARRAY(size, array) @@ -137,8 +137,9 @@ struct hb_dispatch_context_t enum { max_debug_depth = MaxDebugDepth }; typedef Return return_t; template - inline bool may_dispatch (const T *obj HB_UNUSED, const F *format HB_UNUSED) { return true; } - static return_t no_dispatch_return_value (void) { return Context::default_return_value (); } + bool may_dispatch (const T *obj HB_UNUSED, const F *format HB_UNUSED) { return true; } + static return_t no_dispatch_return_value () { return Context::default_return_value (); } + static bool stop_sublookup_iteration (const return_t r HB_UNUSED) { return false; } }; @@ -225,7 +226,7 @@ struct hb_dispatch_context_t struct hb_sanitize_context_t : hb_dispatch_context_t { - inline hb_sanitize_context_t (void) : + hb_sanitize_context_t () : debug_depth (0), start (nullptr), end (nullptr), max_ops (0), @@ -234,33 +235,33 @@ struct hb_sanitize_context_t : num_glyphs (65536), num_glyphs_set (false) {} - inline const char *get_name (void) { return "SANITIZE"; } + const char *get_name () { return "SANITIZE"; } template - inline bool may_dispatch (const T *obj HB_UNUSED, const F *format) + bool may_dispatch (const T *obj HB_UNUSED, const F *format) { return format->sanitize (this); } template - inline return_t dispatch (const T &obj) { return obj.sanitize (this); } - static return_t default_return_value (void) { return true; } - static return_t no_dispatch_return_value (void) { return false; } + return_t dispatch (const T &obj) { return obj.sanitize (this); } + static return_t default_return_value () { return true; } + static return_t no_dispatch_return_value () { return false; } bool stop_sublookup_iteration (const return_t r) const { return !r; } - inline void init (hb_blob_t *b) + void init (hb_blob_t *b) { this->blob = hb_blob_reference (b); this->writable = false; } - inline void set_num_glyphs (unsigned int num_glyphs_) + void set_num_glyphs (unsigned int num_glyphs_) { num_glyphs = num_glyphs_; num_glyphs_set = true; } - inline unsigned int get_num_glyphs (void) { return num_glyphs; } + unsigned int get_num_glyphs () { return num_glyphs; } - inline void set_max_ops (int max_ops_) { max_ops = max_ops_; } + void set_max_ops (int max_ops_) { max_ops = max_ops_; } template - inline void set_object (const T *obj) + void set_object (const T *obj) { reset_object (); @@ -279,14 +280,14 @@ struct hb_sanitize_context_t : } } - inline void reset_object (void) + void reset_object () { this->start = this->blob->data; this->end = this->start + this->blob->length; assert (this->start <= this->end); /* Must not overflow. */ } - inline void start_processing (void) + void start_processing () { reset_object (); this->max_ops = MAX ((unsigned int) (this->end - this->start) * HB_SANITIZE_MAX_OPS_FACTOR, @@ -300,7 +301,7 @@ struct hb_sanitize_context_t : (unsigned long) (this->end - this->start)); } - inline void end_processing (void) + void end_processing () { DEBUG_MSG_LEVEL (SANITIZE, this->start, 0, -1, "end [%p..%p] %u edit requests", @@ -311,7 +312,7 @@ struct hb_sanitize_context_t : this->start = this->end = nullptr; } - inline bool check_range (const void *base, + bool check_range (const void *base, unsigned int len) const { const char *p = (const char *) base; @@ -330,7 +331,7 @@ struct hb_sanitize_context_t : } template - inline bool check_range (const T *base, + bool check_range (const T *base, unsigned int a, unsigned int b) const { @@ -339,7 +340,7 @@ struct hb_sanitize_context_t : } template - inline bool check_range (const T *base, + bool check_range (const T *base, unsigned int a, unsigned int b, unsigned int c) const @@ -349,27 +350,24 @@ struct hb_sanitize_context_t : } template - inline bool check_array (const T *base, - unsigned int len) const + bool check_array (const T *base, unsigned int len) const { - return this->check_range (base, len, T::static_size); + return this->check_range (base, len, hb_static_size (T)); } template - inline bool check_array (const T *base, - unsigned int a, - unsigned int b) const + bool check_array (const T *base, + unsigned int a, + unsigned int b) const { - return this->check_range (base, a, b, T::static_size); + return this->check_range (base, a, b, hb_static_size (T)); } template - inline bool check_struct (const Type *obj) const - { - return likely (this->check_range (obj, obj->min_size)); - } + bool check_struct (const Type *obj) const + { return likely (this->check_range (obj, obj->min_size)); } - inline bool may_edit (const void *base, unsigned int len) + bool may_edit (const void *base, unsigned int len) { if (this->edit_count >= HB_SANITIZE_MAX_EDITS) return false; @@ -388,16 +386,18 @@ struct hb_sanitize_context_t : } template - inline bool try_set (const Type *obj, const ValueType &v) { - if (this->may_edit (obj, obj->static_size)) { - const_cast (obj)->set (v); + bool try_set (const Type *obj, const ValueType &v) + { + if (this->may_edit (obj, hb_static_size (Type))) + { + hb_assign (* const_cast (obj), v); return true; } return false; } template - inline hb_blob_t *sanitize_blob (hb_blob_t *blob) + hb_blob_t *sanitize_blob (hb_blob_t *blob) { bool sane; @@ -464,7 +464,7 @@ struct hb_sanitize_context_t : } template - inline hb_blob_t *reference_table (const hb_face_t *face, hb_tag_t tableTag = Type::tableTag) + hb_blob_t *reference_table (const hb_face_t *face, hb_tag_t tableTag = Type::tableTag) { if (!num_glyphs_set) set_num_glyphs (hb_face_get_glyph_count (face)); @@ -485,15 +485,11 @@ struct hb_sanitize_context_t : struct hb_sanitize_with_object_t { template - inline hb_sanitize_with_object_t (hb_sanitize_context_t *c, + hb_sanitize_with_object_t (hb_sanitize_context_t *c, const T& obj) : c (c) - { - c->set_object (obj); - } - inline ~hb_sanitize_with_object_t (void) - { - c->reset_object (); - } + { c->set_object (obj); } + ~hb_sanitize_with_object_t () + { c->reset_object (); } private: hb_sanitize_context_t *c; @@ -506,25 +502,42 @@ struct hb_sanitize_with_object_t struct hb_serialize_context_t { - inline hb_serialize_context_t (void *start_, unsigned int size) + hb_serialize_context_t (void *start_, unsigned int size) { this->start = (char *) start_; this->end = this->start + size; reset (); } - inline void reset (void) + bool in_error () const { return !this->successful; } + + void reset () { - this->ran_out_of_room = false; + this->successful = true; this->head = this->start; this->debug_depth = 0; } - inline bool err (bool e) { return this->ran_out_of_room = this->ran_out_of_room || e; } + bool propagate_error (bool e) + { return this->successful = this->successful && e; } + template bool propagate_error (const T &obj) + { return this->successful = this->successful && !obj.in_error (); } + template bool propagate_error (const T *obj) + { return this->successful = this->successful && !obj->in_error (); } + template bool propagate_error (T1 &o1, T2 &o2) + { return propagate_error (o1) && propagate_error (o2); } + template bool propagate_error (T1 *o1, T2 *o2) + { return propagate_error (o1) && propagate_error (o2); } + template + bool propagate_error (T1 &o1, T2 &o2, T3 &o3) + { return propagate_error (o1) && propagate_error (o2, o3); } + template + bool propagate_error (T1 *o1, T2 *o2, T3 *o3) + { return propagate_error (o1) && propagate_error (o2, o3); } /* To be called around main operation. */ template - inline Type *start_serialize (void) + Type *start_serialize () { DEBUG_MSG_LEVEL (SERIALIZE, this->start, 0, +1, "start [%p..%p] (%lu bytes)", @@ -533,18 +546,18 @@ struct hb_serialize_context_t return start_embed (); } - inline void end_serialize (void) + void end_serialize () { DEBUG_MSG_LEVEL (SERIALIZE, this->start, 0, -1, "end [%p..%p] serialized %d bytes; %s", this->start, this->end, (int) (this->head - this->start), - this->ran_out_of_room ? "RAN OUT OF ROOM" : "did not ran out of room"); + this->successful ? "successful" : "UNSUCCESSFUL"); } - inline unsigned int length (void) const { return this->head - this->start; } + unsigned int length () const { return this->head - this->start; } - inline void align (unsigned int alignment) + void align (unsigned int alignment) { unsigned int l = length () % alignment; if (l) @@ -552,17 +565,17 @@ struct hb_serialize_context_t } template - inline Type *start_embed (void) const + Type *start_embed (const Type *_ HB_UNUSED = nullptr) const { Type *ret = reinterpret_cast (this->head); return ret; } template - inline Type *allocate_size (unsigned int size) + Type *allocate_size (unsigned int size) { - if (unlikely (this->ran_out_of_room || this->end - this->head < ptrdiff_t (size))) { - this->ran_out_of_room = true; + if (unlikely (!this->successful || this->end - this->head < ptrdiff_t (size))) { + this->successful = false; return nullptr; } memset (this->head, 0, size); @@ -572,13 +585,13 @@ struct hb_serialize_context_t } template - inline Type *allocate_min (void) + Type *allocate_min () { return this->allocate_size (Type::min_size); } template - inline Type *embed (const Type &obj) + Type *embed (const Type &obj) { unsigned int size = obj.get_size (); Type *ret = this->allocate_size (size); @@ -586,50 +599,50 @@ struct hb_serialize_context_t memcpy (ret, &obj, size); return ret; } + template + hb_serialize_context_t &operator << (const Type &obj) { embed (obj); return *this; } template - inline Type *extend_min (Type &obj) + Type *extend_size (Type &obj, unsigned int size) { - unsigned int size = obj.min_size; - assert (this->start <= (char *) &obj && (char *) &obj <= this->head && (char *) &obj + size >= this->head); + assert (this->start <= (char *) &obj); + assert ((char *) &obj <= this->head); + assert ((char *) &obj + size >= this->head); if (unlikely (!this->allocate_size (((char *) &obj) + size - this->head))) return nullptr; return reinterpret_cast (&obj); } template - inline Type *extend (Type &obj) - { - unsigned int size = obj.get_size (); - assert (this->start < (char *) &obj && (char *) &obj <= this->head && (char *) &obj + size >= this->head); - if (unlikely (!this->allocate_size (((char *) &obj) + size - this->head))) return nullptr; - return reinterpret_cast (&obj); - } + Type *extend_min (Type &obj) { return extend_size (obj, obj.min_size); } + + template + Type *extend (Type &obj) { return extend_size (obj, obj.get_size ()); } /* Output routines. */ template - inline Type *copy (void) const + Type *copy () const { - assert (!this->ran_out_of_room); + assert (this->successful); unsigned int len = this->head - this->start; void *p = malloc (len); if (p) memcpy (p, this->start, len); return reinterpret_cast (p); } - inline hb_bytes_t copy_bytes (void) const + hb_bytes_t copy_bytes () const { - assert (!this->ran_out_of_room); + assert (this->successful); unsigned int len = this->head - this->start; void *p = malloc (len); if (p) memcpy (p, this->start, len); else return hb_bytes_t (); - return hb_bytes_t (p, len); + return hb_bytes_t ((char *) p, len); } - inline hb_blob_t *copy_blob (void) const + hb_blob_t *copy_blob () const { - assert (!this->ran_out_of_room); + assert (this->successful); return hb_blob_create (this->start, this->head - this->start, HB_MEMORY_MODE_DUPLICATE, @@ -639,54 +652,10 @@ struct hb_serialize_context_t public: unsigned int debug_depth; char *start, *end, *head; - bool ran_out_of_room; + bool successful; }; -/* - * Supplier - */ - -template -struct Supplier -{ - inline Supplier (const Type *array, unsigned int len_, unsigned int stride_=sizeof (Type)) - { - head = array; - len = len_; - stride = stride_; - } - inline Supplier (const hb_vector_t *v) - { - head = *v; - len = v->len; - stride = sizeof (Type); - } - - inline const Type operator [] (unsigned int i) const - { - if (unlikely (i >= len)) return Type (); - return * (const Type *) (const void *) ((const char *) head + stride * i); - } - - inline Supplier & operator += (unsigned int count) - { - if (unlikely (count > len)) - count = len; - len -= count; - head = (const Type *) (const void *) ((const char *) head + stride * count); - return *this; - } - - private: - inline Supplier (const Supplier &); /* Disallow copy */ - inline Supplier& operator= (const Supplier &); /* Disallow copy */ - - unsigned int len; - unsigned int stride; - const Type *head; -}; - /* * Big-endian integers. @@ -699,14 +668,8 @@ struct BEInt { public: typedef Type type; - inline void set (Type V) - { - v = V; - } - inline operator Type (void) const - { - return v; - } + void set (Type V) { v = V; } + operator Type () const { return v; } private: uint8_t v; }; template @@ -714,18 +677,24 @@ struct BEInt { public: typedef Type type; - inline void set (Type V) + void set (Type V) { v[0] = (V >> 8) & 0xFF; v[1] = (V ) & 0xFF; } - inline operator Type (void) const + operator Type () const { -#if defined(__GNUC__) || defined(__clang__) +#if ((defined(__GNUC__) && __GNUC__ >= 5) || defined(__clang__)) && \ + defined(__BYTE_ORDER) && \ + (__BYTE_ORDER == __LITTLE_ENDIAN || __BYTE_ORDER == __BIG_ENDIAN) /* Spoon-feed the compiler a big-endian integer with alignment 1. * https://github.com/harfbuzz/harfbuzz/pull/1398 */ struct __attribute__((packed)) packed_uint16_t { uint16_t v; }; +#if __BYTE_ORDER == __LITTLE_ENDIAN return __builtin_bswap16 (((packed_uint16_t *) this)->v); +#else /* __BYTE_ORDER == __BIG_ENDIAN */ + return ((packed_uint16_t *) this)->v; +#endif #endif return (v[0] << 8) + (v[1] ); @@ -737,13 +706,13 @@ struct BEInt { public: typedef Type type; - inline void set (Type V) + void set (Type V) { v[0] = (V >> 16) & 0xFF; v[1] = (V >> 8) & 0xFF; v[2] = (V ) & 0xFF; } - inline operator Type (void) const + operator Type () const { return (v[0] << 16) + (v[1] << 8) @@ -756,14 +725,14 @@ struct BEInt { public: typedef Type type; - inline void set (Type V) + void set (Type V) { v[0] = (V >> 24) & 0xFF; v[1] = (V >> 16) & 0xFF; v[2] = (V >> 8) & 0xFF; v[3] = (V ) & 0xFF; } - inline operator Type (void) const + operator Type () const { return (v[0] << 24) + (v[1] << 16) @@ -783,23 +752,21 @@ struct hb_data_wrapper_t { static_assert (WheresData > 0, ""); - inline Data * get_data (void) const - { - return *(((Data **) (void *) this) - WheresData); - } + Data * get_data () const + { return *(((Data **) (void *) this) - WheresData); } - inline bool is_inert (void) const { return !get_data (); } + bool is_inert () const { return !get_data (); } template - inline Stored * call_create (void) const { return Subclass::create (get_data ()); } + Stored * call_create () const { return Subclass::create (get_data ()); } }; template <> struct hb_data_wrapper_t { - inline bool is_inert (void) const { return false; } + bool is_inert () const { return false; } template - inline Stored * call_create (void) const { return Funcs::create (); } + Stored * call_create () const { return Funcs::create (); } }; template struct hb_non_void_t { typedef T1 value; }; @@ -816,13 +783,11 @@ struct hb_lazy_loader_t : hb_data_wrapper_t hb_lazy_loader_t >::value Funcs; - inline void init0 (void) {} /* Init, when memory is already set to 0. No-op for us. */ - inline void init (void) { instance.set_relaxed (nullptr); } - inline void fini (void) - { - do_destroy (instance.get ()); - } - inline void free_instance (void) + void init0 () {} /* Init, when memory is already set to 0. No-op for us. */ + void init () { instance.set_relaxed (nullptr); } + void fini () { do_destroy (instance.get ()); } + + void free_instance () { retry: Stored *p = instance.get (); @@ -831,19 +796,19 @@ struct hb_lazy_loader_t : hb_data_wrapper_t do_destroy (p); } - static inline void do_destroy (Stored *p) + static void do_destroy (Stored *p) { if (p && p != const_cast (Funcs::get_null ())) Funcs::destroy (p); } - inline const Returned * operator -> (void) const { return get (); } - inline const Returned & operator * (void) const { return *get (); } - explicit_operator inline operator bool (void) const + const Returned * operator -> () const { return get (); } + const Returned & operator * () const { return *get (); } + explicit_operator bool () const { return get_stored () != Funcs::get_null (); } - template inline operator const C * (void) const { return get (); } + template operator const C * () const { return get (); } - inline Stored * get_stored (void) const + Stored * get_stored () const { retry: Stored *p = this->instance.get (); @@ -864,41 +829,41 @@ struct hb_lazy_loader_t : hb_data_wrapper_t } return p; } - inline Stored * get_stored_relaxed (void) const + Stored * get_stored_relaxed () const { return this->instance.get_relaxed (); } - inline bool cmpexch (Stored *current, Stored *value) const + bool cmpexch (Stored *current, Stored *value) const { /* This *must* be called when there are no other threads accessing. */ return this->instance.cmpexch (current, value); } - inline const Returned * get (void) const { return Funcs::convert (get_stored ()); } - inline const Returned * get_relaxed (void) const { return Funcs::convert (get_stored_relaxed ()); } - inline Returned * get_unconst (void) const { return const_cast (Funcs::convert (get_stored ())); } + const Returned * get () const { return Funcs::convert (get_stored ()); } + const Returned * get_relaxed () const { return Funcs::convert (get_stored_relaxed ()); } + Returned * get_unconst () const { return const_cast (Funcs::convert (get_stored ())); } /* To be possibly overloaded by subclasses. */ - static inline Returned* convert (Stored *p) { return p; } + static Returned* convert (Stored *p) { return p; } /* By default null/init/fini the object. */ - static inline const Stored* get_null (void) { return &Null(Stored); } - static inline Stored *create (Data *data) + static const Stored* get_null () { return &Null(Stored); } + static Stored *create (Data *data) { Stored *p = (Stored *) calloc (1, sizeof (Stored)); if (likely (p)) p->init (data); return p; } - static inline Stored *create (void) + static Stored *create () { Stored *p = (Stored *) calloc (1, sizeof (Stored)); if (likely (p)) p->init (); return p; } - static inline void destroy (Stored *p) + static void destroy (Stored *p) { p->fini (); free (p); @@ -922,52 +887,34 @@ struct hb_table_lazy_loader_t : hb_lazy_loader_t { - static inline hb_blob_t *create (hb_face_t *face) - { - return hb_sanitize_context_t ().reference_table (face); - } - static inline void destroy (hb_blob_t *p) - { - hb_blob_destroy (p); - } - static inline const hb_blob_t *get_null (void) - { - return hb_blob_get_empty (); - } - static inline const T* convert (const hb_blob_t *blob) - { - return blob->as (); - } + static hb_blob_t *create (hb_face_t *face) + { return hb_sanitize_context_t ().reference_table (face); } + static void destroy (hb_blob_t *p) { hb_blob_destroy (p); } - inline hb_blob_t* get_blob (void) const - { - return this->get_stored (); - } + static const hb_blob_t *get_null () + { return hb_blob_get_empty (); } + + static const T* convert (const hb_blob_t *blob) + { return blob->as (); } + + hb_blob_t* get_blob () const { return this->get_stored (); } }; template struct hb_font_funcs_lazy_loader_t : hb_lazy_loader_t { - static inline void destroy (hb_font_funcs_t *p) - { - hb_font_funcs_destroy (p); - } - static inline const hb_font_funcs_t *get_null (void) - { - return hb_font_funcs_get_empty (); - } + static void destroy (hb_font_funcs_t *p) + { hb_font_funcs_destroy (p); } + static const hb_font_funcs_t *get_null () + { return hb_font_funcs_get_empty (); } }; template struct hb_unicode_funcs_lazy_loader_t : hb_lazy_loader_t { - static inline void destroy (hb_unicode_funcs_t *p) - { - hb_unicode_funcs_destroy (p); - } - static inline const hb_unicode_funcs_t *get_null (void) - { - return hb_unicode_funcs_get_empty (); - } + static void destroy (hb_unicode_funcs_t *p) + { hb_unicode_funcs_destroy (p); } + static const hb_unicode_funcs_t *get_null () + { return hb_unicode_funcs_get_empty (); } }; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-map.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-map.cc index 067a2b37169..a2c770c586d 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-map.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-map.cc @@ -47,7 +47,7 @@ * Since: 1.7.7 **/ hb_map_t * -hb_map_create (void) +hb_map_create () { hb_map_t *map; @@ -67,7 +67,7 @@ hb_map_create (void) * Since: 1.7.7 **/ hb_map_t * -hb_map_get_empty (void) +hb_map_get_empty () { return const_cast (&Null(hb_map_t)); } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-map.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-map.hh index c54c9d7b640..3b119daa8e2 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-map.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-map.hh @@ -45,16 +45,16 @@ inline uint32_t Hash (const T &v) struct hb_map_t { HB_NO_COPY_ASSIGN (hb_map_t); - inline hb_map_t (void) { init (); } - inline ~hb_map_t (void) { fini (); } + hb_map_t () { init (); } + ~hb_map_t () { fini (); } struct item_t { hb_codepoint_t key; hb_codepoint_t value; - inline bool is_unused (void) const { return key == INVALID; } - inline bool is_tombstone (void) const { return key != INVALID && value == INVALID; } + bool is_unused () const { return key == INVALID; } + bool is_tombstone () const { return key != INVALID && value == INVALID; } }; hb_object_header_t header; @@ -65,7 +65,7 @@ struct hb_map_t unsigned int prime; item_t *items; - inline void init_shallow (void) + void init_shallow () { successful = true; population = occupancy = 0; @@ -73,24 +73,26 @@ struct hb_map_t prime = 0; items = nullptr; } - inline void init (void) + void init () { hb_object_init (this); init_shallow (); } - inline void fini_shallow (void) + void fini_shallow () { free (items); items = nullptr; } - inline void fini (void) + void fini () { population = occupancy = 0; hb_object_fini (this); fini_shallow (); } - inline bool resize (void) + bool in_error () const { return !successful; } + + bool resize () { if (unlikely (!successful)) return false; @@ -124,7 +126,7 @@ struct hb_map_t return true; } - inline void set (hb_codepoint_t key, hb_codepoint_t value) + void set (hb_codepoint_t key, hb_codepoint_t value) { if (unlikely (!successful)) return; if (unlikely (key == INVALID)) return; @@ -149,46 +151,36 @@ struct hb_map_t population++; } - inline hb_codepoint_t get (hb_codepoint_t key) const + hb_codepoint_t get (hb_codepoint_t key) const { if (unlikely (!items)) return INVALID; unsigned int i = bucket_for (key); return items[i].key == key ? items[i].value : INVALID; } - inline void del (hb_codepoint_t key) - { - set (key, INVALID); - } - inline bool has (hb_codepoint_t key) const - { - return get (key) != INVALID; - } + void del (hb_codepoint_t key) { set (key, INVALID); } - inline hb_codepoint_t operator [] (unsigned int key) const + bool has (hb_codepoint_t key) const + { return get (key) != INVALID; } + + hb_codepoint_t operator [] (unsigned int key) const { return get (key); } - static const hb_codepoint_t INVALID = HB_MAP_VALUE_INVALID; + enum { INVALID = HB_MAP_VALUE_INVALID }; - inline void clear (void) + void clear () { memset (items, 0xFF, ((size_t) mask + 1) * sizeof (item_t)); population = occupancy = 0; } - inline bool is_empty (void) const - { - return population == 0; - } + bool is_empty () const { return population == 0; } - inline unsigned int get_population () const - { - return population; - } + unsigned int get_population () const { return population; } protected: - inline unsigned int bucket_for (hb_codepoint_t key) const + unsigned int bucket_for (hb_codepoint_t key) const { unsigned int i = Hash (key) % prime; unsigned int step = 0; @@ -204,7 +196,7 @@ struct hb_map_t return tombstone == INVALID ? i : tombstone; } - static inline unsigned int prime_for (unsigned int shift) + static unsigned int prime_for (unsigned int shift) { /* Following comment and table copied from glib. */ /* Each table size has an associated prime modulo (the first prime 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 b529091d44a..35f1fded1ef 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-mutex.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-mutex.hh @@ -131,16 +131,16 @@ struct hb_mutex_t hb_mutex_impl_t m; - inline void init (void) { hb_mutex_impl_init (&m); } - inline void lock (void) { hb_mutex_impl_lock (&m); } - inline void unlock (void) { hb_mutex_impl_unlock (&m); } - inline void fini (void) { hb_mutex_impl_finish (&m); } + void init () { hb_mutex_impl_init (&m); } + void lock () { hb_mutex_impl_lock (&m); } + void unlock () { hb_mutex_impl_unlock (&m); } + void fini () { 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 (); } + hb_lock_t (hb_mutex_t &mutex_) : mutex (mutex_) { mutex.lock (); } + ~hb_lock_t () { mutex.unlock (); } private: hb_mutex_t &mutex; }; 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 1583d5b90e0..8a3e0d4056e 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 1024 +#define HB_NULL_POOL_SIZE 9880 /* Use SFINAE to sniff whether T has min_size; in which case return T::null_size, * otherwise return sizeof(T). */ @@ -59,7 +59,10 @@ struct hb_null_size { enum { value = _hb_null_size >::value }; }; #define hb_null_size(T) hb_null_size::value -/* This doesn't belong here, but since is copy/paste from above, put it here. */ +/* These doesn't belong here, but since is copy/paste from above, put it here. */ + +/* hb_static_size (T) + * Returns T::static_size if T::min_size is defined, or sizeof (T) otherwise. */ template struct _hb_static_size @@ -74,26 +77,52 @@ struct hb_static_size #define hb_static_size(T) hb_static_size::value +/* hb_assign (obj, value) + * Calls obj.set (value) if obj.min_size is defined and value has different type + * from obj, or obj = v otherwise. */ + +template +struct _hb_assign +{ static inline void value (T &o, const V v) { o = v; } }; +template +struct _hb_assign > +{ static inline void value (T &o, const V v) { o.set (v); } }; +template +struct _hb_assign > +{ static inline void value (T &o, const T v) { o = v; } }; + +template +static inline void hb_assign (T &o, const V v) +{ _hb_assign >::value (o, v); }; + + /* * Null() */ + 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)]; /* Generic nul-content Null objects. */ template -static inline Type const & Null (void) { +static inline Type const & Null () { static_assert (hb_null_size (Type) <= HB_NULL_POOL_SIZE, "Increase HB_NULL_POOL_SIZE."); return *reinterpret_cast (_hb_NullPool); } -#define Null(Type) Null () +template +struct NullHelper +{ + typedef typename hb_remove_const (typename hb_remove_reference (QType)) Type; + static const Type & get_null () { return Null (); } +}; +#define Null(Type) NullHelper::get_null () /* Specializations for arbitrary-content Null objects expressed in bytes. */ #define DECLARE_NULL_NAMESPACE_BYTES(Namespace, Type) \ } /* Close namespace. */ \ extern HB_INTERNAL const unsigned char _hb_Null_##Namespace##_##Type[Namespace::Type::null_size]; \ template <> \ - /*static*/ inline const Namespace::Type& Null (void) { \ + /*static*/ inline const Namespace::Type& Null () { \ return *reinterpret_cast (_hb_Null_##Namespace##_##Type); \ } \ namespace Namespace { \ @@ -105,7 +134,7 @@ static inline Type const & Null (void) { #define DECLARE_NULL_INSTANCE(Type) \ extern HB_INTERNAL const Type _hb_Null_##Type; \ template <> \ - /*static*/ inline const Type& Null (void) { \ + /*static*/ inline const Type& Null () { \ return _hb_Null_##Type; \ } \ static_assert (true, "Just so we take semicolon after.") @@ -123,23 +152,29 @@ extern HB_INTERNAL /* CRAP pool: Common Region for Access Protection. */ template -static inline Type& Crap (void) { +static inline Type& Crap () { static_assert (hb_null_size (Type) <= HB_NULL_POOL_SIZE, "Increase HB_NULL_POOL_SIZE."); Type *obj = reinterpret_cast (_hb_CrapPool); memcpy (obj, &Null(Type), sizeof (*obj)); return *obj; } -#define Crap(Type) Crap () +template +struct CrapHelper +{ + typedef typename hb_remove_const (typename hb_remove_reference (QType)) Type; + static Type & get_crap () { return Crap (); } +}; +#define Crap(Type) CrapHelper::get_crap () template -struct CrapOrNull { - static inline Type & get (void) { return Crap(Type); } +struct CrapOrNullHelper { + static Type & get () { return Crap(Type); } }; template -struct CrapOrNull { - static inline Type const & get (void) { return Null(Type); } +struct CrapOrNullHelper { + static const Type & get () { return Null(Type); } }; -#define CrapOrNull(Type) CrapOrNull::get () +#define CrapOrNull(Type) CrapOrNullHelper::get () /* @@ -151,16 +186,16 @@ struct hb_nonnull_ptr_t { typedef typename hb_remove_pointer (P) T; - inline hb_nonnull_ptr_t (T *v_ = nullptr) : v (v_) {} - inline T * operator = (T *v_) { return v = v_; } - inline T * operator -> (void) const { return get (); } - inline T & operator * (void) const { return *get (); } - inline T ** operator & (void) const { return &v; } + hb_nonnull_ptr_t (T *v_ = nullptr) : v (v_) {} + T * operator = (T *v_) { return v = v_; } + T * operator -> () const { return get (); } + T & operator * () const { return *get (); } + T ** operator & () const { return &v; } /* Only auto-cast to const types. */ - template inline operator const C * (void) const { return get (); } - inline operator const char * (void) const { return (const char *) get (); } - inline T * get (void) const { return v ? v : const_cast (&Null(T)); } - inline T * get_raw (void) const { return v; } + template operator const C * () const { return get (); } + operator const char * () const { return (const char *) get (); } + T * get () const { return v ? v : const_cast (&Null(T)); } + T * get_raw () const { return v; } T *v; }; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-object.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-object.hh index cdacf49f4c1..6eb1173d82f 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-object.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-object.hh @@ -47,10 +47,10 @@ struct hb_lockable_set_t { hb_vector_t items; - inline void init (void) { items.init (); } + void init () { items.init (); } template - inline item_t *replace_or_insert (T v, lock_t &l, bool replace) + item_t *replace_or_insert (T v, lock_t &l, bool replace) { l.lock (); item_t *item = items.find (v); @@ -73,7 +73,7 @@ struct hb_lockable_set_t } template - inline void remove (T v, lock_t &l) + void remove (T v, lock_t &l) { l.lock (); item_t *item = items.find (v); @@ -89,7 +89,7 @@ struct hb_lockable_set_t } template - inline bool find (T v, item_t *i, lock_t &l) + bool find (T v, item_t *i, lock_t &l) { l.lock (); item_t *item = items.find (v); @@ -100,7 +100,7 @@ struct hb_lockable_set_t } template - inline item_t *find_or_insert (T v, lock_t &l) + item_t *find_or_insert (T v, lock_t &l) { l.lock (); item_t *item = items.find (v); @@ -111,7 +111,7 @@ struct hb_lockable_set_t return item; } - inline void fini (lock_t &l) + void fini (lock_t &l) { if (!items.len) { /* No need for locking. */ @@ -145,14 +145,14 @@ struct hb_reference_count_t { mutable hb_atomic_int_t ref_count; - inline void init (int v = 1) { ref_count.set_relaxed (v); } - inline int get_relaxed (void) const { return ref_count.get_relaxed (); } - inline int inc (void) const { return ref_count.inc (); } - inline int dec (void) const { return ref_count.dec (); } - inline void fini (void) { ref_count.set_relaxed (HB_REFERENCE_COUNT_POISON_VALUE); } + void init (int v = 1) { ref_count.set_relaxed (v); } + int get_relaxed () const { return ref_count.get_relaxed (); } + int inc () const { return ref_count.inc (); } + int dec () const { return ref_count.dec (); } + void fini () { ref_count.set_relaxed (HB_REFERENCE_COUNT_POISON_VALUE); } - inline bool is_inert (void) const { return ref_count.get_relaxed () == HB_REFERENCE_COUNT_INERT_VALUE; } - inline bool is_valid (void) const { return ref_count.get_relaxed () > 0; } + bool is_inert () const { return ref_count.get_relaxed () == HB_REFERENCE_COUNT_INERT_VALUE; } + bool is_valid () const { return ref_count.get_relaxed () > 0; } }; @@ -165,16 +165,16 @@ struct hb_user_data_array_t void *data; hb_destroy_func_t destroy; - inline bool operator == (hb_user_data_key_t *other_key) const { return key == other_key; } - inline bool operator == (hb_user_data_item_t &other) const { return key == other.key; } + bool operator == (hb_user_data_key_t *other_key) const { return key == other_key; } + bool operator == (hb_user_data_item_t &other) const { return key == other.key; } - void fini (void) { if (destroy) destroy (data); } + void fini () { if (destroy) destroy (data); } }; hb_mutex_t lock; hb_lockable_set_t items; - inline void init (void) { lock.init (); items.init (); } + void init () { lock.init (); items.init (); } HB_INTERNAL bool set (hb_user_data_key_t *key, void * data, @@ -183,7 +183,7 @@ struct hb_user_data_array_t HB_INTERNAL void *get (hb_user_data_key_t *key); - inline void fini (void) { items.fini (lock); lock.fini (); } + void fini () { items.fini (lock); lock.fini (); } }; @@ -219,7 +219,7 @@ static inline void hb_object_trace (const Type *obj, const char *function) } template -static inline Type *hb_object_create (void) +static inline Type *hb_object_create () { Type *obj = (Type *) calloc (1, sizeof (Type)); 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 af68892ab11..822a92d3946 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 @@ -54,8 +54,7 @@ struct TTCHeader; typedef struct TableRecord { - int cmp (Tag t) const - { return -t.cmp (tag); } + int cmp (Tag t) const { return -t.cmp (tag); } static int cmp (const void *pa, const void *pb) { @@ -64,7 +63,7 @@ typedef struct TableRecord return b->cmp (a->tag); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); @@ -83,13 +82,10 @@ typedef struct OffsetTable { friend struct OpenTypeFontFile; - inline unsigned int get_table_count (void) const - { return tables.len; } - inline const TableRecord& get_table (unsigned int i) const - { - return tables[i]; - } - inline unsigned int get_table_tags (unsigned int start_offset, + unsigned int get_table_count () const { return tables.len; } + const TableRecord& get_table (unsigned int i) const + { return tables[i]; } + unsigned int get_table_tags (unsigned int start_offset, unsigned int *table_count, /* IN/OUT */ hb_tag_t *table_tags /* OUT */) const { @@ -107,13 +103,13 @@ typedef struct OffsetTable } return tables.len; } - inline bool find_table_index (hb_tag_t tag, unsigned int *table_index) const + bool find_table_index (hb_tag_t tag, unsigned int *table_index) const { Tag t; t.set (tag); return tables.bfind (t, table_index, HB_BFIND_NOT_FOUND_STORE, Index::NOT_FOUND_INDEX); } - inline const TableRecord& get_table_by_tag (hb_tag_t tag) const + const TableRecord& get_table_by_tag (hb_tag_t tag) const { unsigned int table_index; find_table_index (tag, &table_index); @@ -122,11 +118,10 @@ typedef struct OffsetTable public: - inline bool serialize (hb_serialize_context_t *c, - hb_tag_t sfnt_tag, - Supplier &tags, - Supplier &blobs, - unsigned int table_count) + template + bool serialize (hb_serialize_context_t *c, + hb_tag_t sfnt_tag, + hb_array_t items) { TRACE_SERIALIZE (this); /* Alloc 12 for the OTHeader. */ @@ -135,17 +130,17 @@ typedef struct OffsetTable sfnt_version.set (sfnt_tag); /* Take space for numTables, searchRange, entrySelector, RangeShift * and the TableRecords themselves. */ - if (unlikely (!tables.serialize (c, table_count))) return_trace (false); + if (unlikely (!tables.serialize (c, items.len))) return_trace (false); const char *dir_end = (const char *) c->head; HBUINT32 *checksum_adjustment = nullptr; /* Write OffsetTables, alloc for and write actual table blobs. */ - for (unsigned int i = 0; i < table_count; i++) + for (unsigned int i = 0; i < tables.len; i++) { TableRecord &rec = tables.arrayZ[i]; - hb_blob_t *blob = blobs[i]; - rec.tag.set (tags[i]); + hb_blob_t *blob = items[i].blob; + rec.tag.set (items[i].tag); rec.length.set (hb_blob_get_length (blob)); rec.offset.serialize (c, this); @@ -159,7 +154,7 @@ typedef struct OffsetTable c->align (4); const char *end = (const char *) c->head; - if (tags[i] == HB_OT_TAG_head && end - start >= head::static_size) + if (items[i].tag == HB_OT_TAG_head && end - start >= head::static_size) { head *h = (head *) start; checksum_adjustment = &h->checkSumAdjustment; @@ -168,8 +163,6 @@ typedef struct OffsetTable rec.checkSum.set_for_data (start, end - start); } - tags += table_count; - blobs += table_count; tables.qsort (); @@ -180,7 +173,7 @@ typedef struct OffsetTable /* The following line is a slower version of the following block. */ //checksum.set_for_data (this, (const char *) c->head - (const char *) this); checksum.set_for_data (this, dir_end - (const char *) this); - for (unsigned int i = 0; i < table_count; i++) + for (unsigned int i = 0; i < items.len; i++) { TableRecord &rec = tables.arrayZ[i]; checksum.set (checksum + rec.checkSum); @@ -192,7 +185,7 @@ typedef struct OffsetTable return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && tables.sanitize (c)); @@ -215,10 +208,10 @@ struct TTCHeaderVersion1 { friend struct TTCHeader; - inline unsigned int get_face_count (void) const { return table.len; } - inline const OpenTypeFontFace& get_face (unsigned int i) const { return this+table[i]; } + unsigned int get_face_count () const { return table.len; } + const OpenTypeFontFace& get_face (unsigned int i) const { return this+table[i]; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (table.sanitize (c, this)); @@ -241,7 +234,7 @@ struct TTCHeader private: - inline unsigned int get_face_count (void) const + unsigned int get_face_count () const { switch (u.header.version.major) { case 2: /* version 2 is compatible with version 1 */ @@ -249,7 +242,7 @@ struct TTCHeader default:return 0; } } - inline const OpenTypeFontFace& get_face (unsigned int i) const + const OpenTypeFontFace& get_face (unsigned int i) const { switch (u.header.version.major) { case 2: /* version 2 is compatible with version 1 */ @@ -258,7 +251,7 @@ struct TTCHeader } } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (unlikely (!u.header.version.sanitize (c))) return_trace (false); @@ -288,10 +281,10 @@ struct TTCHeader struct ResourceRecord { - inline const OpenTypeFontFace & get_face (const void *data_base) const + const OpenTypeFontFace & get_face (const void *data_base) const { return CastR ((data_base+offset).arrayZ); } - inline bool sanitize (hb_sanitize_context_t *c, + bool sanitize (hb_sanitize_context_t *c, const void *data_base) const { TRACE_SANITIZE (this); @@ -317,20 +310,18 @@ struct ResourceRecord struct ResourceTypeRecord { - inline unsigned int get_resource_count (void) const + unsigned int get_resource_count () const { return tag == HB_TAG_sfnt ? resCountM1 + 1 : 0; } - inline bool is_sfnt (void) const { return tag == HB_TAG_sfnt; } + bool is_sfnt () const { return tag == HB_TAG_sfnt; } - inline const ResourceRecord& get_resource_record (unsigned int i, - const void *type_base) const - { - return (type_base+resourcesZ).as_array (get_resource_count ())[i]; - } + const ResourceRecord& get_resource_record (unsigned int i, + const void *type_base) const + { return (type_base+resourcesZ).as_array (get_resource_count ())[i]; } - inline bool sanitize (hb_sanitize_context_t *c, - const void *type_base, - const void *data_base) const + bool sanitize (hb_sanitize_context_t *c, + const void *type_base, + const void *data_base) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -351,7 +342,7 @@ struct ResourceTypeRecord struct ResourceMap { - inline unsigned int get_face_count (void) const + unsigned int get_face_count () const { unsigned int count = get_type_count (); for (unsigned int i = 0; i < count; i++) @@ -363,8 +354,8 @@ struct ResourceMap return 0; } - inline const OpenTypeFontFace& get_face (unsigned int idx, - const void *data_base) const + const OpenTypeFontFace& get_face (unsigned int idx, + const void *data_base) const { unsigned int count = get_type_count (); for (unsigned int i = 0; i < count; i++) @@ -378,7 +369,7 @@ struct ResourceMap return Null (OpenTypeFontFace); } - inline bool sanitize (hb_sanitize_context_t *c, const void *data_base) const + bool sanitize (hb_sanitize_context_t *c, const void *data_base) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -388,9 +379,9 @@ struct ResourceMap } private: - inline unsigned int get_type_count (void) const { return (this+typeList).lenM1 + 1; } + unsigned int get_type_count () const { return (this+typeList).lenM1 + 1; } - inline const ResourceTypeRecord& get_type_record (unsigned int i) const + const ResourceTypeRecord& get_type_record (unsigned int i) const { return (this+typeList)[i]; } protected: @@ -409,11 +400,11 @@ struct ResourceMap struct ResourceForkHeader { - inline unsigned int get_face_count (void) const + unsigned int get_face_count () const { return (this+map).get_face_count (); } - inline const OpenTypeFontFace& get_face (unsigned int idx, - unsigned int *base_offset = nullptr) const + const OpenTypeFontFace& get_face (unsigned int idx, + unsigned int *base_offset = nullptr) const { const OpenTypeFontFace &face = (this+map).get_face (idx, &(this+data)); if (base_offset) @@ -421,7 +412,7 @@ struct ResourceForkHeader return face; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -457,9 +448,9 @@ struct OpenTypeFontFile Typ1Tag = HB_TAG ('t','y','p','1') /* Obsolete Apple Type1 font in SFNT container */ }; - inline hb_tag_t get_tag (void) const { return u.tag; } + hb_tag_t get_tag () const { return u.tag; } - inline unsigned int get_face_count (void) const + unsigned int get_face_count () const { switch (u.tag) { case CFFTag: /* All the non-collection tags */ @@ -471,7 +462,7 @@ struct OpenTypeFontFile default: return 0; } } - inline const OpenTypeFontFace& get_face (unsigned int i, unsigned int *base_offset = nullptr) const + const OpenTypeFontFace& get_face (unsigned int i, unsigned int *base_offset = nullptr) const { if (base_offset) *base_offset = 0; @@ -489,19 +480,18 @@ struct OpenTypeFontFile } } - inline bool serialize_single (hb_serialize_context_t *c, - hb_tag_t sfnt_tag, - Supplier &tags, - Supplier &blobs, - unsigned int table_count) + template + bool serialize_single (hb_serialize_context_t *c, + hb_tag_t sfnt_tag, + hb_array_t items) { TRACE_SERIALIZE (this); assert (sfnt_tag != TTCTag); if (unlikely (!c->extend_min (*this))) return_trace (false); - return_trace (u.fontFace.serialize (c, sfnt_tag, tags, blobs, table_count)); + return_trace (u.fontFace.serialize (c, sfnt_tag, items)); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (unlikely (!u.tag.sanitize (c))) return_trace (false); 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 f4d0238ea07..7f88279a792 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 @@ -52,18 +52,24 @@ namespace OT { * Int types */ +template struct hb_signedness_int; +template <> struct hb_signedness_int { typedef unsigned int value; }; +template <> struct hb_signedness_int { typedef signed int value; }; + /* Integer types in big-endian order and no alignment requirement */ template struct IntType { typedef Type type; - inline void set (Type i) { v.set (i); } - inline operator Type (void) const { return v; } - inline bool operator == (const IntType &o) const { return (Type) v == (Type) o.v; } - inline bool operator != (const IntType &o) const { return !(*this == o); } - static inline int cmp (const IntType *a, const IntType *b) { return b->cmp (*a); } + typedef typename hb_signedness_int::value>::value wide_type; + + void set (wide_type i) { v.set (i); } + operator wide_type () const { return v; } + bool operator == (const IntType &o) const { return (Type) v == (Type) o.v; } + bool operator != (const IntType &o) const { return !(*this == o); } + static int cmp (const IntType *a, const IntType *b) { return b->cmp (*a); } template - inline int cmp (Type2 a) const + int cmp (Type2 a) const { Type b = v; if (sizeof (Type) < sizeof (int) && sizeof (Type2) < sizeof (int)) @@ -71,7 +77,7 @@ struct IntType else return a < b ? -1 : a == b ? 0 : +1; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -88,6 +94,8 @@ typedef IntType HBUINT16; /* 16-bit unsigned integer. */ typedef IntType HBINT16; /* 16-bit signed integer. */ typedef IntType HBUINT32; /* 32-bit unsigned integer. */ typedef IntType HBINT32; /* 32-bit signed integer. */ +/* Note: we cannot defined a signed HBINT24 because there's no corresponding C type. + * Works for unsigned, but not signed, since we rely on compiler for sign-extension. */ typedef IntType HBUINT24; /* 24-bit unsigned integer. */ /* 16-bit signed integer (HBINT16) that describes a quantity in FUnits. */ @@ -103,8 +111,8 @@ typedef HBUINT16 UFWORD; struct F2DOT14 : HBINT16 { // 16384 means 1<<14 - inline float to_float (void) const { return ((int32_t) v) / 16384.f; } - inline void set_float (float f) { v.set (round (f * 16384.f)); } + float to_float () const { return ((int32_t) v) / 16384.f; } + void set_float (float f) { v.set (round (f * 16384.f)); } public: DEFINE_SIZE_STATIC (2); }; @@ -113,8 +121,8 @@ struct F2DOT14 : HBINT16 struct Fixed : HBINT32 { // 65536 means 1<<16 - inline float to_float (void) const { return ((int32_t) v) / 65536.f; } - inline void set_float (float f) { v.set (round (f * 65536.f)); } + float to_float () const { return ((int32_t) v) / 65536.f; } + void set_float (float f) { v.set (round (f * 65536.f)); } public: DEFINE_SIZE_STATIC (4); }; @@ -123,7 +131,7 @@ struct Fixed : HBINT32 * 1904. The value is represented as a signed 64-bit integer. */ struct LONGDATETIME { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -140,8 +148,8 @@ struct LONGDATETIME struct Tag : HBUINT32 { /* What the char* converters return is NOT nul-terminated. Print using "%.4s" */ - inline operator const char* (void) const { return reinterpret_cast (&this->v); } - inline operator char* (void) { return reinterpret_cast (&this->v); } + operator const char* () const { return reinterpret_cast (&this->v); } + operator char* () { return reinterpret_cast (&this->v); } public: DEFINE_SIZE_STATIC (4); }; @@ -163,9 +171,9 @@ struct Offset : Type { typedef Type type; - inline bool is_null (void) const { return has_null && 0 == *this; } + bool is_null () const { return has_null && 0 == *this; } - inline void *serialize (hb_serialize_context_t *c, const void *base) + void *serialize (hb_serialize_context_t *c, const void *base) { void *t = c->start_embed (); this->set ((char *) t - (char *) base); /* TODO(serialize) Overflow? */ @@ -184,7 +192,7 @@ typedef Offset Offset32; struct CheckSum : HBUINT32 { /* This is reference implementation from the spec. */ - static inline uint32_t CalcTableChecksum (const HBUINT32 *Table, uint32_t Length) + static uint32_t CalcTableChecksum (const HBUINT32 *Table, uint32_t Length) { uint32_t Sum = 0L; assert (0 == (Length & 3)); @@ -196,7 +204,7 @@ struct CheckSum : HBUINT32 } /* Note: data should be 4byte aligned and have 4byte padding at the end. */ - inline void set_for_data (const void *data, unsigned int length) + void set_for_data (const void *data, unsigned int length) { set (CalcTableChecksum ((const HBUINT32 *) data, length)); } public: @@ -211,9 +219,9 @@ struct CheckSum : HBUINT32 template struct FixedVersion { - inline uint32_t to_int (void) const { return (major << (sizeof (FixedType) * 8)) + minor; } + uint32_t to_int () const { return (major << (sizeof (FixedType) * 8)) + minor; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); @@ -234,38 +242,37 @@ struct FixedVersion template struct _hb_has_null { - static inline const Type *get_null (void) { return nullptr; } - static inline Type *get_crap (void) { return nullptr; } + static const Type *get_null () { return nullptr; } + static Type *get_crap () { return nullptr; } }; template struct _hb_has_null { - static inline const Type *get_null (void) { return &Null(Type); } - static inline Type *get_crap (void) { return &Crap(Type); } + static const Type *get_null () { return &Null(Type); } + static Type *get_crap () { return &Crap(Type); } }; template struct OffsetTo : Offset { - inline const Type& operator () (const void *base) const + const Type& operator () (const void *base) const { if (unlikely (this->is_null ())) return *_hb_has_null::get_null (); return StructAtOffset (base, *this); } - inline Type& operator () (void *base) const + Type& operator () (void *base) const { - if (unlikely (this->is_null ())) return Crap (Type); if (unlikely (this->is_null ())) return *_hb_has_null::get_crap (); return StructAtOffset (base, *this); } - inline Type& serialize (hb_serialize_context_t *c, const void *base) + Type& serialize (hb_serialize_context_t *c, const void *base) { return * (Type *) Offset::serialize (c, base); } template - inline void serialize_subset (hb_subset_context_t *c, const T &src, const void *base) + void serialize_subset (hb_subset_context_t *c, const T &src, const void *base) { if (&src == &Null (T)) { @@ -277,7 +284,7 @@ struct OffsetTo : Offset this->set (0); } - inline bool sanitize_shallow (hb_sanitize_context_t *c, const void *base) const + bool sanitize_shallow (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); if (unlikely (!c->check_struct (this))) return_trace (false); @@ -286,7 +293,7 @@ struct OffsetTo : Offset return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (sanitize_shallow (c, base) && @@ -295,7 +302,7 @@ struct OffsetTo : Offset neuter (c))); } template - inline bool sanitize (hb_sanitize_context_t *c, const void *base, T1 d1) const + bool sanitize (hb_sanitize_context_t *c, const void *base, T1 d1) const { TRACE_SANITIZE (this); return_trace (sanitize_shallow (c, base) && @@ -304,7 +311,7 @@ struct OffsetTo : Offset neuter (c))); } template - inline bool sanitize (hb_sanitize_context_t *c, const void *base, T1 d1, T2 d2) const + bool sanitize (hb_sanitize_context_t *c, const void *base, T1 d1, T2 d2) const { TRACE_SANITIZE (this); return_trace (sanitize_shallow (c, base) && @@ -313,7 +320,7 @@ struct OffsetTo : Offset neuter (c))); } template - inline bool sanitize (hb_sanitize_context_t *c, const void *base, T1 d1, T2 d2, T3 d3) const + 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) && @@ -323,7 +330,7 @@ struct OffsetTo : Offset } /* Set the offset to Null */ - inline bool neuter (hb_sanitize_context_t *c) const + bool neuter (hb_sanitize_context_t *c) const { if (!has_null) return false; return c->try_set (this, 0); @@ -345,47 +352,49 @@ static inline Type& operator + (Base &base, OffsetTo template struct UnsizedArrayOf { - static_assert ((bool) (unsigned) hb_static_size (Type), ""); - - enum { item_size = Type::static_size }; + typedef Type ItemType; + enum { item_size = hb_static_size (Type) }; HB_NO_CREATE_COPY_ASSIGN_TEMPLATE (UnsizedArrayOf, Type); - inline const Type& operator [] (unsigned int i) const + const Type& operator [] (int i_) const { + unsigned int i = (unsigned int) i_; const Type *p = &arrayZ[i]; if (unlikely (p < arrayZ)) return Null (Type); /* Overflowed. */ return *p; } - inline Type& operator [] (unsigned int i) + Type& operator [] (int i_) { + unsigned int i = (unsigned int) i_; Type *p = &arrayZ[i]; if (unlikely (p < arrayZ)) return Crap (Type); /* Overflowed. */ return *p; } - template inline operator T * (void) { return arrayZ; } - template inline operator const T * (void) const { return arrayZ; } - - inline unsigned int get_size (unsigned int len) const + unsigned int get_size (unsigned int len) const { return len * Type::static_size; } - inline hb_array_t as_array (unsigned int len) + template operator T * () { return arrayZ; } + template operator const T * () const { return arrayZ; } + hb_array_t as_array (unsigned int len) { return hb_array (arrayZ, len); } - inline hb_array_t as_array (unsigned int len) const + hb_array_t as_array (unsigned int len) const { return hb_array (arrayZ, len); } + operator hb_array_t () { return as_array (); } + operator hb_array_t () const { return as_array (); } template - inline Type &lsearch (unsigned int len, const T &x, Type ¬_found = Crap (Type)) + Type &lsearch (unsigned int len, const T &x, Type ¬_found = Crap (Type)) { return *as_array (len).lsearch (x, ¬_found); } template - inline const Type &lsearch (unsigned int len, const T &x, const Type ¬_found = Null (Type)) const + const Type &lsearch (unsigned int len, const T &x, const Type ¬_found = Null (Type)) const { return *as_array (len).lsearch (x, ¬_found); } - inline void qsort (unsigned int len, unsigned int start = 0, unsigned int end = (unsigned int) -1) + void qsort (unsigned int len, unsigned int start = 0, unsigned int end = (unsigned int) -1) { as_array (len).qsort (start, end); } - inline bool sanitize (hb_sanitize_context_t *c, unsigned int count) const + bool sanitize (hb_sanitize_context_t *c, unsigned int count) const { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c, count))) return_trace (false); @@ -401,7 +410,7 @@ struct UnsizedArrayOf return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c, unsigned int count, const void *base) const + bool sanitize (hb_sanitize_context_t *c, unsigned int count, const void *base) const { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c, count))) return_trace (false); @@ -411,7 +420,7 @@ struct UnsizedArrayOf return_trace (true); } template - inline bool sanitize (hb_sanitize_context_t *c, unsigned int count, const void *base, T user_data) const + bool sanitize (hb_sanitize_context_t *c, unsigned int count, const void *base, T user_data) const { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c, count))) return_trace (false); @@ -421,7 +430,7 @@ struct UnsizedArrayOf return_trace (true); } - inline bool sanitize_shallow (hb_sanitize_context_t *c, unsigned int count) const + bool sanitize_shallow (hb_sanitize_context_t *c, unsigned int count) const { TRACE_SANITIZE (this); return_trace (c->check_array (arrayZ, count)); @@ -441,27 +450,29 @@ struct UnsizedOffsetArrayOf : UnsizedArrayOf struct UnsizedOffsetListOf : UnsizedOffsetArrayOf { - inline const Type& operator [] (unsigned int i) const + const Type& operator [] (int i_) const { + unsigned int i = (unsigned int) i_; const OffsetTo *p = &this->arrayZ[i]; if (unlikely (p < this->arrayZ)) return Null (Type); /* Overflowed. */ return this+*p; } - inline Type& operator [] (unsigned int i) + Type& operator [] (int i_) { + unsigned int i = (unsigned int) i_; const OffsetTo *p = &this->arrayZ[i]; if (unlikely (p < this->arrayZ)) return Crap (Type); /* Overflowed. */ return this+*p; } - inline bool sanitize (hb_sanitize_context_t *c, unsigned int count) const + bool sanitize (hb_sanitize_context_t *c, unsigned int count) const { TRACE_SANITIZE (this); return_trace ((UnsizedOffsetArrayOf::sanitize (c, count, this))); } template - inline bool sanitize (hb_sanitize_context_t *c, unsigned int count, T user_data) const + 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))); @@ -472,19 +483,21 @@ struct UnsizedOffsetListOf : UnsizedOffsetArrayOf template struct SortedUnsizedArrayOf : UnsizedArrayOf { - inline hb_sorted_array_t as_array (unsigned int len) + hb_sorted_array_t as_array (unsigned int len) { return hb_sorted_array (this->arrayZ, len); } - inline hb_sorted_array_t as_array (unsigned int len) const + hb_sorted_array_t as_array (unsigned int len) const { return hb_sorted_array (this->arrayZ, len); } + operator hb_sorted_array_t () { return as_array (); } + operator hb_sorted_array_t () const { return as_array (); } template - inline Type &bsearch (unsigned int len, const T &x, Type ¬_found = Crap (Type)) + Type &bsearch (unsigned int len, const T &x, Type ¬_found = Crap (Type)) { return *as_array (len).bsearch (x, ¬_found); } template - inline const Type &bsearch (unsigned int len, const T &x, const Type ¬_found = Null (Type)) const + const Type &bsearch (unsigned int len, const T &x, const Type ¬_found = Null (Type)) const { return *as_array (len).bsearch (x, ¬_found); } template - inline bool bfind (unsigned int len, const T &x, unsigned int *i = nullptr, + bool bfind (unsigned int len, const T &x, unsigned int *i = nullptr, hb_bfind_not_found_t not_found = HB_BFIND_NOT_FOUND_DONT_STORE, unsigned int to_store = (unsigned int) -1) const { return as_array (len).bfind (x, i, not_found, to_store); } @@ -495,42 +508,44 @@ struct SortedUnsizedArrayOf : UnsizedArrayOf template struct ArrayOf { - static_assert ((bool) (unsigned) hb_static_size (Type), ""); - - enum { item_size = Type::static_size }; + typedef Type ItemType; + enum { item_size = hb_static_size (Type) }; HB_NO_CREATE_COPY_ASSIGN_TEMPLATE2 (ArrayOf, Type, LenType); - inline const Type& operator [] (unsigned int i) const + const Type& operator [] (int i_) const { + unsigned int i = (unsigned int) i_; if (unlikely (i >= len)) return Null (Type); return arrayZ[i]; } - inline Type& operator [] (unsigned int i) + Type& operator [] (int i_) { + unsigned int i = (unsigned int) i_; if (unlikely (i >= len)) return Crap (Type); return arrayZ[i]; } - inline unsigned int get_size (void) const + unsigned int get_size () const { return len.static_size + len * Type::static_size; } - inline hb_array_t as_array (void) + hb_array_t as_array () { return hb_array (arrayZ, len); } - inline hb_array_t as_array (void) const + hb_array_t as_array () const { return hb_array (arrayZ, len); } + operator hb_array_t (void) { return as_array (); } + operator hb_array_t (void) const { return as_array (); } - inline hb_array_t sub_array (unsigned int start_offset, unsigned int count) const + hb_array_t sub_array (unsigned int start_offset, unsigned int count) const { return as_array ().sub_array (start_offset, count);} - inline hb_array_t sub_array (unsigned int start_offset, unsigned int *count /* IN/OUT */) const + hb_array_t sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) const { return as_array ().sub_array (start_offset, count);} - inline hb_array_t sub_array (unsigned int start_offset, unsigned int count) + hb_array_t sub_array (unsigned int start_offset, unsigned int count) { return as_array ().sub_array (start_offset, count);} - inline hb_array_t sub_array (unsigned int start_offset, unsigned int *count /* IN/OUT */) + hb_array_t sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) { return as_array ().sub_array (start_offset, count);} - inline bool serialize (hb_serialize_context_t *c, - unsigned int items_len) + bool serialize (hb_serialize_context_t *c, unsigned int items_len) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (*this))) return_trace (false); @@ -538,19 +553,17 @@ struct ArrayOf if (unlikely (!c->extend (*this))) return_trace (false); return_trace (true); } - inline bool serialize (hb_serialize_context_t *c, - Supplier &items, - unsigned int items_len) + template + bool serialize (hb_serialize_context_t *c, hb_array_t items) { TRACE_SERIALIZE (this); - if (unlikely (!serialize (c, items_len))) return_trace (false); - for (unsigned int i = 0; i < items_len; i++) - arrayZ[i] = items[i]; - items += items_len; + if (unlikely (!serialize (c, items.len))) return_trace (false); + for (unsigned int i = 0; i < items.len; i++) + hb_assign (arrayZ[i], items[i]); return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c))) return_trace (false); @@ -566,7 +579,7 @@ struct ArrayOf return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c))) return_trace (false); @@ -577,7 +590,7 @@ struct ArrayOf return_trace (true); } template - inline bool sanitize (hb_sanitize_context_t *c, const void *base, T user_data) const + 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); @@ -589,16 +602,16 @@ struct ArrayOf } template - inline Type &lsearch (const T &x, Type ¬_found = Crap (Type)) + Type &lsearch (const T &x, Type ¬_found = Crap (Type)) { return *as_array ().lsearch (x, ¬_found); } template - inline const Type &lsearch (const T &x, const Type ¬_found = Null (Type)) const + const Type &lsearch (const T &x, const Type ¬_found = Null (Type)) const { return *as_array ().lsearch (x, ¬_found); } - inline void qsort (unsigned int start = 0, unsigned int end = (unsigned int) -1) + void qsort (unsigned int start = 0, unsigned int end = (unsigned int) -1) { as_array ().qsort (start, end); } - inline bool sanitize_shallow (hb_sanitize_context_t *c) const + bool sanitize_shallow (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (len.sanitize (c) && c->check_array (arrayZ, len)); @@ -625,18 +638,20 @@ struct LOffsetLArrayOf : ArrayOf, HBUINT32> {}; template struct OffsetListOf : OffsetArrayOf { - inline const Type& operator [] (unsigned int i) const + const Type& operator [] (int i_) const { + unsigned int i = (unsigned int) i_; if (unlikely (i >= this->len)) return Null (Type); return this+this->arrayZ[i]; } - inline const Type& operator [] (unsigned int i) + const Type& operator [] (int i_) { + unsigned int i = (unsigned int) i_; if (unlikely (i >= this->len)) return Crap (Type); return this+this->arrayZ[i]; } - inline bool subset (hb_subset_context_t *c) const + bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); struct OffsetListOf *out = c->serializer->embed (*this); @@ -647,13 +662,13 @@ struct OffsetListOf : OffsetArrayOf return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (OffsetArrayOf::sanitize (c, this)); } template - inline bool sanitize (hb_sanitize_context_t *c, T user_data) const + bool sanitize (hb_sanitize_context_t *c, T user_data) const { TRACE_SANITIZE (this); return_trace (OffsetArrayOf::sanitize (c, this, user_data)); @@ -668,35 +683,34 @@ struct HeadlessArrayOf HB_NO_CREATE_COPY_ASSIGN_TEMPLATE2 (HeadlessArrayOf, Type, LenType); - inline const Type& operator [] (unsigned int i) const + const Type& operator [] (int i_) const { + unsigned int i = (unsigned int) i_; if (unlikely (i >= lenP1 || !i)) return Null (Type); return arrayZ[i-1]; } - inline Type& operator [] (unsigned int i) + Type& operator [] (int i_) { + unsigned int i = (unsigned int) i_; if (unlikely (i >= lenP1 || !i)) return Crap (Type); return arrayZ[i-1]; } - inline unsigned int get_size (void) const + unsigned int get_size () const { return lenP1.static_size + (lenP1 ? lenP1 - 1 : 0) * Type::static_size; } - inline bool serialize (hb_serialize_context_t *c, - Supplier &items, - unsigned int items_len) + bool serialize (hb_serialize_context_t *c, + hb_array_t items) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (*this))) return_trace (false); - lenP1.set (items_len); /* TODO(serialize) Overflow? */ - if (unlikely (!items_len)) return_trace (true); + lenP1.set (items.len + 1); /* TODO(serialize) Overflow? */ if (unlikely (!c->extend (*this))) return_trace (false); - for (unsigned int i = 0; i < items_len - 1; i++) + for (unsigned int i = 0; i < items.len; i++) arrayZ[i] = items[i]; - items += items_len - 1; return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c))) return_trace (false); @@ -714,7 +728,7 @@ struct HeadlessArrayOf } private: - inline bool sanitize_shallow (hb_sanitize_context_t *c) const + bool sanitize_shallow (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (lenP1.sanitize (c) && @@ -734,21 +748,23 @@ struct ArrayOfM1 { HB_NO_CREATE_COPY_ASSIGN_TEMPLATE2 (ArrayOfM1, Type, LenType); - inline const Type& operator [] (unsigned int i) const + const Type& operator [] (int i_) const { + unsigned int i = (unsigned int) i_; if (unlikely (i > lenM1)) return Null (Type); return arrayZ[i]; } - inline Type& operator [] (unsigned int i) + Type& operator [] (int i_) { + unsigned int i = (unsigned int) i_; if (unlikely (i > lenM1)) return Crap (Type); return arrayZ[i]; } - inline unsigned int get_size (void) const + unsigned int get_size () 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 + 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); @@ -760,7 +776,7 @@ struct ArrayOfM1 } private: - inline bool sanitize_shallow (hb_sanitize_context_t *c) const + bool sanitize_shallow (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (lenM1.sanitize (c) && @@ -778,28 +794,30 @@ struct ArrayOfM1 template struct SortedArrayOf : ArrayOf { - inline hb_sorted_array_t as_array (void) + hb_sorted_array_t as_array () { return hb_sorted_array (this->arrayZ, this->len); } - inline hb_sorted_array_t as_array (void) const + hb_sorted_array_t as_array () const { return hb_sorted_array (this->arrayZ, this->len); } + operator hb_sorted_array_t () { return as_array (); } + operator hb_sorted_array_t () const { return as_array (); } - inline hb_array_t sub_array (unsigned int start_offset, unsigned int count) const + hb_array_t sub_array (unsigned int start_offset, unsigned int count) const { return as_array ().sub_array (start_offset, count);} - inline hb_array_t sub_array (unsigned int start_offset, unsigned int *count /* IN/OUT */) const + hb_array_t sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) const { return as_array ().sub_array (start_offset, count);} - inline hb_array_t sub_array (unsigned int start_offset, unsigned int count) + hb_array_t sub_array (unsigned int start_offset, unsigned int count) { return as_array ().sub_array (start_offset, count);} - inline hb_array_t sub_array (unsigned int start_offset, unsigned int *count /* IN/OUT */) + hb_array_t sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) { return as_array ().sub_array (start_offset, count);} template - inline Type &bsearch (const T &x, Type ¬_found = Crap (Type)) + Type &bsearch (const T &x, Type ¬_found = Crap (Type)) { return *as_array ().bsearch (x, ¬_found); } template - inline const Type &bsearch (const T &x, const Type ¬_found = Null (Type)) const + const Type &bsearch (const T &x, const Type ¬_found = Null (Type)) const { return *as_array ().bsearch (x, ¬_found); } template - inline bool bfind (const T &x, unsigned int *i = nullptr, + bool bfind (const T &x, unsigned int *i = nullptr, hb_bfind_not_found_t not_found = HB_BFIND_NOT_FOUND_DONT_STORE, unsigned int to_store = (unsigned int) -1) const { return as_array ().bfind (x, i, not_found, to_store); } @@ -812,15 +830,15 @@ struct SortedArrayOf : ArrayOf template struct BinSearchHeader { - inline operator uint32_t (void) const { return len; } + operator uint32_t () const { return len; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); } - inline void set (unsigned int v) + void set (unsigned int v) { len.set (v); assert (len == v); @@ -848,7 +866,7 @@ struct BinSearchArrayOf : SortedArrayOf > {}; struct VarSizedBinSearchHeader { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); @@ -874,7 +892,7 @@ struct VarSizedBinSearchArrayOf HB_NO_CREATE_COPY_ASSIGN_TEMPLATE (VarSizedBinSearchArrayOf, Type); - inline bool last_is_terminator (void) const + bool last_is_terminator () const { if (unlikely (!header.nUnits)) return false; @@ -890,24 +908,24 @@ struct VarSizedBinSearchArrayOf return true; } - inline const Type& operator [] (unsigned int i) const + const Type& operator [] (int i_) const { + unsigned int i = (unsigned int) i_; if (unlikely (i >= get_length ())) return Null (Type); return StructAtOffset (&bytesZ, i * header.unitSize); } - inline Type& operator [] (unsigned int i) + Type& operator [] (int i_) { + unsigned int i = (unsigned int) i_; if (unlikely (i >= get_length ())) return Crap (Type); return StructAtOffset (&bytesZ, i * header.unitSize); } - inline unsigned int get_length (void) const - { - return header.nUnits - last_is_terminator (); - } - inline unsigned int get_size (void) const + unsigned int get_length () const + { return header.nUnits - last_is_terminator (); } + unsigned int get_size () const { return header.static_size + header.nUnits * header.unitSize; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c))) return_trace (false); @@ -923,7 +941,7 @@ struct VarSizedBinSearchArrayOf return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c))) return_trace (false); @@ -934,7 +952,7 @@ struct VarSizedBinSearchArrayOf return_trace (true); } template - inline bool sanitize (hb_sanitize_context_t *c, const void *base, T user_data) const + 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); @@ -946,7 +964,7 @@ struct VarSizedBinSearchArrayOf } template - inline const Type *bsearch (const T &key) const + const Type *bsearch (const T &key) const { unsigned int size = header.unitSize; int min = 0, max = (int) get_length () - 1; @@ -963,7 +981,7 @@ struct VarSizedBinSearchArrayOf } private: - inline bool sanitize_shallow (hb_sanitize_context_t *c) const + bool sanitize_shallow (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (header.sanitize (c) && diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff-common.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff-common.hh new file mode 100644 index 00000000000..db04b3eb239 --- /dev/null +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff-common.hh @@ -0,0 +1,711 @@ +/* + * Copyright © 2018 Adobe Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Adobe Author(s): Michiharu Ariza + */ +#ifndef HB_OT_CFF_COMMON_HH +#define HB_OT_CFF_COMMON_HH + +#include "hb-open-type.hh" +#include "hb-ot-layout-common.hh" +#include "hb-cff-interp-dict-common.hh" +#include "hb-subset-plan.hh" + +namespace CFF { + +using namespace OT; + +#define CFF_UNDEF_CODE 0xFFFFFFFF + +/* utility macro */ +template +static inline const Type& StructAtOffsetOrNull(const void *P, unsigned int offset) +{ return offset? (* reinterpret_cast ((const char *) P + offset)): Null(Type); } + +inline unsigned int calcOffSize(unsigned int dataSize) +{ + unsigned int size = 1; + unsigned int offset = dataSize + 1; + while ((offset & ~0xFF) != 0) + { + size++; + offset >>= 8; + } + /* format does not support size > 4; caller should handle it as an error */ + return size; +} + +struct code_pair +{ + hb_codepoint_t code; + hb_codepoint_t glyph; +}; + +typedef hb_vector_t StrBuff; +struct StrBuffArray : hb_vector_t +{ + void fini () { SUPER::fini_deep (); } + + unsigned int total_size () const + { + unsigned int size = 0; + for (unsigned int i = 0; i < len; i++) + size += (*this)[i].len; + return size; + } + + private: + typedef hb_vector_t SUPER; +}; + +/* CFF INDEX */ +template +struct CFFIndex +{ + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (likely ((count.sanitize (c) && count == 0) || /* empty INDEX */ + (c->check_struct (this) && offSize >= 1 && offSize <= 4 && + c->check_array (offsets, offSize, count + 1) && + c->check_array ((const HBUINT8*)data_base (), 1, max_offset () - 1)))); + } + + static unsigned int calculate_offset_array_size (unsigned int offSize, unsigned int count) + { return offSize * (count + 1); } + + unsigned int offset_array_size () const + { return calculate_offset_array_size (offSize, count); } + + static unsigned int calculate_serialized_size (unsigned int offSize, unsigned int count, unsigned int dataSize) + { + if (count == 0) + return COUNT::static_size; + else + return min_size + calculate_offset_array_size (offSize, count) + dataSize; + } + + bool serialize (hb_serialize_context_t *c, const CFFIndex &src) + { + TRACE_SERIALIZE (this); + unsigned int size = src.get_size (); + CFFIndex *dest = c->allocate_size (size); + if (unlikely (dest == nullptr)) return_trace (false); + memcpy (dest, &src, size); + return_trace (true); + } + + bool serialize (hb_serialize_context_t *c, + unsigned int offSize_, + const ByteStrArray &byteArray) + { + TRACE_SERIALIZE (this); + if (byteArray.len == 0) + { + COUNT *dest = c->allocate_min (); + if (unlikely (dest == nullptr)) return_trace (false); + dest->set (0); + } + else + { + /* serialize CFFIndex header */ + if (unlikely (!c->extend_min (*this))) return_trace (false); + this->count.set (byteArray.len); + this->offSize.set (offSize_); + if (!unlikely (c->allocate_size (offSize_ * (byteArray.len + 1)))) + return_trace (false); + + /* serialize indices */ + unsigned int offset = 1; + unsigned int i = 0; + for (; i < byteArray.len; i++) + { + set_offset_at (i, offset); + offset += byteArray[i].get_size (); + } + set_offset_at (i, offset); + + /* serialize data */ + for (unsigned int i = 0; i < byteArray.len; i++) + { + ByteStr *dest = c->start_embed (); + if (unlikely (dest == nullptr || + !dest->serialize (c, byteArray[i]))) + return_trace (false); + } + } + return_trace (true); + } + + bool serialize (hb_serialize_context_t *c, + unsigned int offSize_, + const StrBuffArray &buffArray) + { + ByteStrArray byteArray; + byteArray.init (); + byteArray.resize (buffArray.len); + for (unsigned int i = 0; i < byteArray.len; i++) + { + byteArray[i] = ByteStr (buffArray[i].arrayZ (), buffArray[i].len); + } + bool result = this->serialize (c, offSize_, byteArray); + byteArray.fini (); + return result; + } + + void set_offset_at (unsigned int index, unsigned int offset) + { + HBUINT8 *p = offsets + offSize * index + offSize; + unsigned int size = offSize; + for (; size; size--) + { + --p; + p->set (offset & 0xFF); + offset >>= 8; + } + } + + unsigned int offset_at (unsigned int index) const + { + assert (index <= count); + const HBUINT8 *p = offsets + offSize * index; + unsigned int size = offSize; + unsigned int offset = 0; + for (; size; size--) + offset = (offset << 8) + *p++; + return offset; + } + + unsigned int length_at (unsigned int index) const + { + if (likely ((offset_at (index + 1) >= offset_at (index)) && + (offset_at (index + 1) <= offset_at (count)))) + return offset_at (index + 1) - offset_at (index); + else + return 0; + } + + const char *data_base () const + { return (const char *)this + min_size + offset_array_size (); } + + unsigned int data_size () const { return HBINT8::static_size; } + + ByteStr operator [] (unsigned int index) const + { + if (likely (index < count)) + return ByteStr (data_base () + offset_at (index) - 1, length_at (index)); + else + return Null(ByteStr); + } + + unsigned int get_size () const + { + if (this != &Null(CFFIndex)) + { + if (count > 0) + return min_size + offset_array_size () + (offset_at (count) - 1); + else + return count.static_size; /* empty CFFIndex contains count only */ + } + else + return 0; + } + + protected: + unsigned int max_offset () const + { + unsigned int max = 0; + for (unsigned int i = 0; i < count + 1u; i++) + { + unsigned int off = offset_at (i); + if (off > max) max = off; + } + return max; + } + + public: + COUNT count; /* Number of object data. Note there are (count+1) offsets */ + HBUINT8 offSize; /* The byte size of each offset in the offsets array. */ + HBUINT8 offsets[VAR]; /* The array of (count + 1) offsets into objects array (1-base). */ + /* HBUINT8 data[VAR]; Object data */ + public: + DEFINE_SIZE_ARRAY (COUNT::static_size + HBUINT8::static_size, offsets); +}; + +template +struct CFFIndexOf : CFFIndex +{ + const ByteStr operator [] (unsigned int index) const + { + if (likely (index < CFFIndex::count)) + return ByteStr (CFFIndex::data_base () + CFFIndex::offset_at (index) - 1, CFFIndex::length_at (index)); + return Null(ByteStr); + } + + template + bool serialize (hb_serialize_context_t *c, + unsigned int offSize_, + const DATA *dataArray, + unsigned int dataArrayLen, + const hb_vector_t &dataSizeArray, + const PARAM1 ¶m1, + const PARAM2 ¶m2) + { + TRACE_SERIALIZE (this); + /* serialize CFFIndex header */ + if (unlikely (!c->extend_min (*this))) return_trace (false); + this->count.set (dataArrayLen); + this->offSize.set (offSize_); + if (!unlikely (c->allocate_size (offSize_ * (dataArrayLen + 1)))) + return_trace (false); + + /* serialize indices */ + unsigned int offset = 1; + unsigned int i = 0; + for (; i < dataArrayLen; i++) + { + CFFIndex::set_offset_at (i, offset); + offset += dataSizeArray[i]; + } + CFFIndex::set_offset_at (i, offset); + + /* serialize data */ + for (unsigned int i = 0; i < dataArrayLen; i++) + { + TYPE *dest = c->start_embed (); + if (unlikely (dest == nullptr || + !dest->serialize (c, dataArray[i], param1, param2))) + return_trace (false); + } + return_trace (true); + } + + /* in parallel to above */ + template + static unsigned int calculate_serialized_size (unsigned int &offSize_ /* OUT */, + const DATA *dataArray, + unsigned int dataArrayLen, + hb_vector_t &dataSizeArray, /* OUT */ + const PARAM ¶m) + { + /* determine offset size */ + unsigned int totalDataSize = 0; + for (unsigned int i = 0; i < dataArrayLen; i++) + { + unsigned int dataSize = TYPE::calculate_serialized_size (dataArray[i], param); + dataSizeArray[i] = dataSize; + totalDataSize += dataSize; + } + offSize_ = calcOffSize (totalDataSize); + + return CFFIndex::calculate_serialized_size (offSize_, dataArrayLen, totalDataSize); + } +}; + +/* Top Dict, Font Dict, Private Dict */ +struct Dict : UnsizedByteStr +{ + template + bool serialize (hb_serialize_context_t *c, + const DICTVAL &dictval, + OP_SERIALIZER& opszr, + PARAM& param) + { + TRACE_SERIALIZE (this); + for (unsigned int i = 0; i < dictval.get_count (); i++) + { + if (unlikely (!opszr.serialize (c, dictval[i], param))) + return_trace (false); + } + return_trace (true); + } + + /* in parallel to above */ + template + static unsigned int calculate_serialized_size (const DICTVAL &dictval, + OP_SERIALIZER& opszr, + PARAM& param) + { + unsigned int size = 0; + for (unsigned int i = 0; i < dictval.get_count (); i++) + size += opszr.calculate_serialized_size (dictval[i], param); + return size; + } + + template + static unsigned int calculate_serialized_size (const DICTVAL &dictval, + OP_SERIALIZER& opszr) + { + unsigned int size = 0; + for (unsigned int i = 0; i < dictval.get_count (); i++) + size += opszr.calculate_serialized_size (dictval[i]); + return size; + } + + template + static bool serialize_int_op (hb_serialize_context_t *c, OpCode op, int value, OpCode intOp) + { + // XXX: not sure why but LLVM fails to compile the following 'unlikely' macro invocation + if (/*unlikely*/ (!serialize_int (c, intOp, value))) + return false; + + TRACE_SERIALIZE (this); + /* serialize the opcode */ + HBUINT8 *p = c->allocate_size (OpCode_Size (op)); + if (unlikely (p == nullptr)) return_trace (false); + if (Is_OpCode_ESC (op)) + { + p->set (OpCode_escape); + op = Unmake_OpCode_ESC (op); + p++; + } + p->set (op); + return_trace (true); + } + + static bool serialize_uint4_op (hb_serialize_context_t *c, OpCode op, int value) + { return serialize_int_op (c, op, value, OpCode_longintdict); } + + static bool serialize_uint2_op (hb_serialize_context_t *c, OpCode op, int value) + { return serialize_int_op (c, op, value, OpCode_shortint); } + + static bool serialize_offset4_op (hb_serialize_context_t *c, OpCode op, int value) + { + return serialize_uint4_op (c, op, value); + } + + static bool serialize_offset2_op (hb_serialize_context_t *c, OpCode op, int value) + { + return serialize_uint2_op (c, op, value); + } +}; + +struct TopDict : Dict {}; +struct FontDict : Dict {}; +struct PrivateDict : Dict {}; + +struct TableInfo +{ + void init () { offSize = offset = size = 0; } + + unsigned int offset; + unsigned int size; + unsigned int offSize; +}; + +/* used to remap font index or SID from fullset to subset. + * set to CFF_UNDEF_CODE if excluded from subset */ +struct Remap : hb_vector_t +{ + void init () { SUPER::init (); } + + void fini () { SUPER::fini (); } + + bool reset (unsigned int size) + { + if (unlikely (!SUPER::resize (size))) + return false; + for (unsigned int i = 0; i < len; i++) + (*this)[i] = CFF_UNDEF_CODE; + count = 0; + return true; + } + + bool identity (unsigned int size) + { + if (unlikely (!SUPER::resize (size))) + return false; + unsigned int i; + for (i = 0; i < len; i++) + (*this)[i] = i; + count = i; + return true; + } + + bool excludes (hb_codepoint_t id) const + { return (id < len) && ((*this)[id] == CFF_UNDEF_CODE); } + + bool includes (hb_codepoint_t id) const + { return !excludes (id); } + + unsigned int add (unsigned int i) + { + if ((*this)[i] == CFF_UNDEF_CODE) + (*this)[i] = count++; + return (*this)[i]; + } + + hb_codepoint_t get_count () const { return count; } + + protected: + hb_codepoint_t count; + + private: + typedef hb_vector_t SUPER; +}; + +template +struct FDArray : CFFIndexOf +{ + /* used by CFF1 */ + template + bool serialize (hb_serialize_context_t *c, + unsigned int offSize_, + const hb_vector_t &fontDicts, + OP_SERIALIZER& opszr) + { + TRACE_SERIALIZE (this); + if (unlikely (!c->extend_min (*this))) return_trace (false); + this->count.set (fontDicts.len); + this->offSize.set (offSize_); + if (!unlikely (c->allocate_size (offSize_ * (fontDicts.len + 1)))) + return_trace (false); + + /* serialize font dict offsets */ + unsigned int offset = 1; + unsigned int fid = 0; + for (; fid < fontDicts.len; fid++) + { + CFFIndexOf::set_offset_at (fid, offset); + offset += FontDict::calculate_serialized_size (fontDicts[fid], opszr); + } + CFFIndexOf::set_offset_at (fid, offset); + + /* serialize font dicts */ + for (unsigned int i = 0; i < fontDicts.len; i++) + { + FontDict *dict = c->start_embed (); + if (unlikely (!dict->serialize (c, fontDicts[i], opszr, fontDicts[i]))) + return_trace (false); + } + return_trace (true); + } + + /* used by CFF2 */ + template + bool serialize (hb_serialize_context_t *c, + unsigned int offSize_, + const hb_vector_t &fontDicts, + unsigned int fdCount, + const Remap &fdmap, + OP_SERIALIZER& opszr, + const hb_vector_t &privateInfos) + { + TRACE_SERIALIZE (this); + if (unlikely (!c->extend_min (*this))) return_trace (false); + this->count.set (fdCount); + this->offSize.set (offSize_); + if (!unlikely (c->allocate_size (offSize_ * (fdCount + 1)))) + return_trace (false); + + /* serialize font dict offsets */ + unsigned int offset = 1; + unsigned int fid = 0; + for (unsigned i = 0; i < fontDicts.len; i++) + if (fdmap.includes (i)) + { + CFFIndexOf::set_offset_at (fid++, offset); + offset += FontDict::calculate_serialized_size (fontDicts[i], opszr); + } + CFFIndexOf::set_offset_at (fid, offset); + + /* serialize font dicts */ + for (unsigned int i = 0; i < fontDicts.len; i++) + if (fdmap.includes (i)) + { + FontDict *dict = c->start_embed (); + if (unlikely (!dict->serialize (c, fontDicts[i], opszr, privateInfos[fdmap[i]]))) + return_trace (false); + } + return_trace (true); + } + + /* in parallel to above */ + template + static unsigned int calculate_serialized_size (unsigned int &offSize_ /* OUT */, + const hb_vector_t &fontDicts, + unsigned int fdCount, + const Remap &fdmap, + OP_SERIALIZER& opszr) + { + unsigned int dictsSize = 0; + for (unsigned int i = 0; i < fontDicts.len; i++) + if (fdmap.includes (i)) + dictsSize += FontDict::calculate_serialized_size (fontDicts[i], opszr); + + offSize_ = calcOffSize (dictsSize); + return CFFIndex::calculate_serialized_size (offSize_, fdCount, dictsSize); + } +}; + +/* FDSelect */ +struct FDSelect0 { + bool sanitize (hb_sanitize_context_t *c, unsigned int fdcount) const + { + TRACE_SANITIZE (this); + if (unlikely (!(c->check_struct (this)))) + return_trace (false); + for (unsigned int i = 0; i < c->get_num_glyphs (); i++) + if (unlikely (!fds[i].sanitize (c))) + return_trace (false); + + return_trace (true); + } + + hb_codepoint_t get_fd (hb_codepoint_t glyph) const + { + return (hb_codepoint_t)fds[glyph]; + } + + unsigned int get_size (unsigned int num_glyphs) const + { return HBUINT8::static_size * num_glyphs; } + + HBUINT8 fds[VAR]; + + DEFINE_SIZE_MIN (1); +}; + +template +struct FDSelect3_4_Range { + bool sanitize (hb_sanitize_context_t *c, unsigned int fdcount) const + { + TRACE_SANITIZE (this); + return_trace (likely (c->check_struct (this) && (first < c->get_num_glyphs ()) && (fd < fdcount))); + } + + GID_TYPE first; + FD_TYPE fd; + + DEFINE_SIZE_STATIC (GID_TYPE::static_size + FD_TYPE::static_size); +}; + +template +struct FDSelect3_4 { + unsigned int get_size () const + { return GID_TYPE::static_size * 2 + FDSelect3_4_Range::static_size * nRanges; } + + bool sanitize (hb_sanitize_context_t *c, unsigned int fdcount) const + { + TRACE_SANITIZE (this); + if (unlikely (!(c->check_struct (this) && (nRanges > 0) && (ranges[0].first == 0)))) + return_trace (false); + + for (unsigned int i = 0; i < nRanges; i++) + { + if (unlikely (!ranges[i].sanitize (c, fdcount))) + return_trace (false); + if ((0 < i) && unlikely (ranges[i - 1].first >= ranges[i].first)) + return_trace (false); + } + if (unlikely (!sentinel().sanitize (c) || (sentinel() != c->get_num_glyphs ()))) + return_trace (false); + + return_trace (true); + } + + hb_codepoint_t get_fd (hb_codepoint_t glyph) const + { + unsigned int i; + for (i = 1; i < nRanges; i++) + if (glyph < ranges[i].first) + break; + + return (hb_codepoint_t)ranges[i - 1].fd; + } + + GID_TYPE &sentinel () { return StructAfter (ranges[nRanges - 1]); } + const GID_TYPE &sentinel () const { return StructAfter (ranges[nRanges - 1]); } + + GID_TYPE nRanges; + FDSelect3_4_Range ranges[VAR]; + /* GID_TYPE sentinel */ + + DEFINE_SIZE_ARRAY (GID_TYPE::static_size, ranges); +}; + +typedef FDSelect3_4 FDSelect3; +typedef FDSelect3_4_Range FDSelect3_Range; + +struct FDSelect { + bool sanitize (hb_sanitize_context_t *c, unsigned int fdcount) const + { + TRACE_SANITIZE (this); + + return_trace (likely (c->check_struct (this) && (format == 0 || format == 3) && + (format == 0)? + u.format0.sanitize (c, fdcount): + u.format3.sanitize (c, fdcount))); + } + + bool serialize (hb_serialize_context_t *c, const FDSelect &src, unsigned int num_glyphs) + { + TRACE_SERIALIZE (this); + unsigned int size = src.get_size (num_glyphs); + FDSelect *dest = c->allocate_size (size); + if (unlikely (dest == nullptr)) return_trace (false); + memcpy (dest, &src, size); + return_trace (true); + } + + unsigned int calculate_serialized_size (unsigned int num_glyphs) const + { return get_size (num_glyphs); } + + unsigned int get_size (unsigned int num_glyphs) const + { + unsigned int size = format.static_size; + if (format == 0) + size += u.format0.get_size (num_glyphs); + else + size += u.format3.get_size (); + return size; + } + + hb_codepoint_t get_fd (hb_codepoint_t glyph) const + { + if (this == &Null(FDSelect)) + return 0; + if (format == 0) + return u.format0.get_fd (glyph); + else + return u.format3.get_fd (glyph); + } + + HBUINT8 format; + union { + FDSelect0 format0; + FDSelect3 format3; + } u; + + DEFINE_SIZE_MIN (1); +}; + +template +struct Subrs : CFFIndex +{ + typedef COUNT count_type; + typedef CFFIndex SUPER; +}; + +} /* namespace CFF */ + +#endif /* HB_OT_CFF_COMMON_HH */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff1-table.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff1-table.cc new file mode 100644 index 00000000000..51cecb6f5b4 --- /dev/null +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff1-table.cc @@ -0,0 +1,385 @@ +/* + * Copyright © 2018 Adobe Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Adobe Author(s): Michiharu Ariza + */ + +#include "hb-ot-cff1-table.hh" +#include "hb-cff1-interp-cs.hh" + +using namespace CFF; + +/* SID to code */ +static const uint8_t standard_encoding_to_code [] = +{ + 0, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 177, + 178, 179, 180, 182, 183, 184, 185, 186, 187, 188, 189, 191, 193, 194, 195, 196, + 197, 198, 199, 200, 202, 203, 205, 206, 207, 208, 225, 227, 232, 233, 234, 235, + 241, 245, 248, 249, 250, 251 +}; + +/* SID to code */ +static const uint8_t expert_encoding_to_code [] = +{ + 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 45, 46, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, 59, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 88, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 201, 0, 0, 0, 0, 189, 0, 0, 188, 0, + 0, 0, 0, 190, 202, 0, 0, 0, 0, 203, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 33, 34, 36, 37, 38, 39, 40, 41, 42, 43, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 61, 62, 63, 65, 66, 67, + 68, 69, 73, 76, 77, 78, 79, 82, 83, 84, 86, 89, 90, 91, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 161, 162, 163, 166, 167, 168, 169, 170, 172, 175, 178, 179, 182, 183, 184, 191, + 192, 193, 194, 195, 196, 197, 200, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 +}; + +/* glyph ID to SID */ +static const uint16_t expert_charset_to_sid [] = +{ + 0, 1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 13, 14, 15, 99, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 27, 28, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 109, 110, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 158, 155, 163, 319, 320, 321, 322, 323, 324, 325, 326, 150, + 164, 169, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, + 373, 374, 375, 376, 377, 378 +}; + +/* glyph ID to SID */ +static const uint16_t expert_subset_charset_to_sid [] = +{ + 0, 1, 231, 232, 235, 236, 237, 238, 13, 14, 15, 99, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 27, 28, 249, 250, 251, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 109, 110, 267, 268, 269, 270, 272, + 300, 301, 302, 305, 314, 315, 158, 155, 163, 320, 321, 322, 323, 324, 325, 326, + 150, 164, 169, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 341, 342, 343, 344, 345, 346 +}; + +/* code to SID */ +static const uint8_t standard_encoding_to_sid [] = +{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 0, 111, 112, 113, 114, 0, 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, + 0, 124, 125, 126, 127, 128, 129, 130, 131, 0, 132, 133, 0, 134, 135, 136, + 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 138, 0, 139, 0, 0, 0, 0, 140, 141, 142, 143, 0, 0, 0, 0, + 0, 144, 0, 0, 0, 145, 0, 0, 146, 147, 148, 149, 0, 0, 0, 0 +}; + +hb_codepoint_t OT::cff1::lookup_standard_encoding_for_code (hb_codepoint_t sid) +{ + if (sid < ARRAY_LENGTH (standard_encoding_to_code)) + return (hb_codepoint_t)standard_encoding_to_code[sid]; + else + return 0; +} + +hb_codepoint_t OT::cff1::lookup_expert_encoding_for_code (hb_codepoint_t sid) +{ + if (sid < ARRAY_LENGTH (expert_encoding_to_code)) + return (hb_codepoint_t)expert_encoding_to_code[sid]; + else + return 0; +} + +hb_codepoint_t OT::cff1::lookup_expert_charset_for_sid (hb_codepoint_t glyph) +{ + if (glyph < ARRAY_LENGTH (expert_charset_to_sid)) + return (hb_codepoint_t)expert_charset_to_sid[glyph]; + else + return 0; +} + +hb_codepoint_t OT::cff1::lookup_expert_subset_charset_for_sid (hb_codepoint_t glyph) +{ + if (glyph < ARRAY_LENGTH (expert_subset_charset_to_sid)) + return (hb_codepoint_t)expert_subset_charset_to_sid[glyph]; + else + return 0; +} + +hb_codepoint_t OT::cff1::lookup_standard_encoding_for_sid (hb_codepoint_t code) +{ + if (code < ARRAY_LENGTH (standard_encoding_to_sid)) + return (hb_codepoint_t)standard_encoding_to_sid[code]; + else + return CFF_UNDEF_SID; +} + +struct Bounds +{ + void init () + { + min.set_int (0x7FFFFFFF, 0x7FFFFFFF); + max.set_int (-0x80000000, -0x80000000); + } + + void update (const Point &pt) + { + if (pt.x < min.x) min.x = pt.x; + if (pt.x > max.x) max.x = pt.x; + if (pt.y < min.y) min.y = pt.y; + if (pt.y > max.y) max.y = pt.y; + } + + void merge (const Bounds &b) + { + if (empty ()) + *this = b; + else if (!b.empty ()) + { + if (b.min.x < min.x) min.x = b.min.x; + if (b.max.x > max.x) max.x = b.max.x; + if (b.min.y < min.y) min.y = b.min.y; + if (b.max.y > max.y) max.y = b.max.y; + } + } + + void offset (const Point &delta) + { + if (!empty ()) + { + min.move (delta); + max.move (delta); + } + } + + bool empty () const + { return (min.x >= max.x) || (min.y >= max.y); } + + Point min; + Point max; +}; + +struct ExtentsParam +{ + void init (const OT::cff1::accelerator_t *_cff) + { + path_open = false; + cff = _cff; + bounds.init (); + } + + void start_path () { path_open = true; } + void end_path () { path_open = false; } + bool is_path_open () const { return path_open; } + + bool path_open; + Bounds bounds; + + const OT::cff1::accelerator_t *cff; +}; + +struct CFF1PathProcs_Extents : PathProcs +{ + static void moveto (CFF1CSInterpEnv &env, ExtentsParam& param, const Point &pt) + { + param.end_path (); + env.moveto (pt); + } + + static void line (CFF1CSInterpEnv &env, ExtentsParam& param, const Point &pt1) + { + if (!param.is_path_open ()) + { + param.start_path (); + param.bounds.update (env.get_pt ()); + } + env.moveto (pt1); + param.bounds.update (env.get_pt ()); + } + + static void curve (CFF1CSInterpEnv &env, ExtentsParam& param, const Point &pt1, const Point &pt2, const Point &pt3) + { + if (!param.is_path_open ()) + { + param.start_path (); + param.bounds.update (env.get_pt ()); + } + /* include control points */ + param.bounds.update (pt1); + param.bounds.update (pt2); + env.moveto (pt3); + param.bounds.update (env.get_pt ()); + } +}; + +static bool _get_bounds (const OT::cff1::accelerator_t *cff, hb_codepoint_t glyph, Bounds &bounds, bool in_seac=false); + +struct CFF1CSOpSet_Extents : CFF1CSOpSet +{ + static void process_seac (CFF1CSInterpEnv &env, ExtentsParam& param) + { + unsigned int n = env.argStack.get_count (); + Point delta; + delta.x = env.argStack[n-4]; + delta.y = env.argStack[n-3]; + hb_codepoint_t base = param.cff->std_code_to_glyph (env.argStack[n-2].to_int ()); + hb_codepoint_t accent = param.cff->std_code_to_glyph (env.argStack[n-1].to_int ()); + + Bounds base_bounds, accent_bounds; + if (likely (!env.in_seac && base && accent + && _get_bounds (param.cff, base, base_bounds, true) + && _get_bounds (param.cff, accent, accent_bounds, true))) + { + param.bounds.merge (base_bounds); + accent_bounds.offset (delta); + param.bounds.merge (accent_bounds); + } + else + env.set_error (); + } +}; + +bool _get_bounds (const OT::cff1::accelerator_t *cff, hb_codepoint_t glyph, Bounds &bounds, bool in_seac) +{ + bounds.init (); + if (unlikely (!cff->is_valid () || (glyph >= cff->num_glyphs))) return false; + + unsigned int fd = cff->fdSelect->get_fd (glyph); + CFF1CSInterpreter interp; + const ByteStr str = (*cff->charStrings)[glyph]; + interp.env.init (str, *cff, fd); + interp.env.set_in_seac (in_seac); + ExtentsParam param; + param.init (cff); + if (unlikely (!interp.interpret (param))) return false; + bounds = param.bounds; + return true; +} + +bool OT::cff1::accelerator_t::get_extents (hb_codepoint_t glyph, hb_glyph_extents_t *extents) const +{ + Bounds bounds; + + if (!_get_bounds (this, glyph, bounds)) + return false; + + if (bounds.min.x >= bounds.max.x) + { + extents->width = 0; + extents->x_bearing = 0; + } + else + { + extents->x_bearing = (int32_t)bounds.min.x.floor (); + extents->width = (int32_t)bounds.max.x.ceil () - extents->x_bearing; + } + if (bounds.min.y >= bounds.max.y) + { + extents->height = 0; + extents->y_bearing = 0; + } + else + { + extents->y_bearing = (int32_t)bounds.max.y.ceil (); + extents->height = (int32_t)bounds.min.y.floor () - extents->y_bearing; + } + + return true; +} + +struct GetSeacParam +{ + void init (const OT::cff1::accelerator_t *_cff) + { + cff = _cff; + base = 0; + accent = 0; + } + + bool has_seac () const { return base && accent; } + + const OT::cff1::accelerator_t *cff; + hb_codepoint_t base; + hb_codepoint_t accent; +}; + +struct CFF1CSOpSet_Seac : CFF1CSOpSet +{ + static void process_seac (CFF1CSInterpEnv &env, GetSeacParam& param) + { + unsigned int n = env.argStack.get_count (); + hb_codepoint_t base_char = (hb_codepoint_t)env.argStack[n-2].to_int (); + hb_codepoint_t accent_char = (hb_codepoint_t)env.argStack[n-1].to_int (); + + param.base = param.cff->std_code_to_glyph (base_char); + param.accent = param.cff->std_code_to_glyph (accent_char); + } +}; + +bool OT::cff1::accelerator_t::get_seac_components (hb_codepoint_t glyph, hb_codepoint_t *base, hb_codepoint_t *accent) const +{ + if (unlikely (!is_valid () || (glyph >= num_glyphs))) return false; + + unsigned int fd = fdSelect->get_fd (glyph); + CFF1CSInterpreter interp; + const ByteStr str = (*charStrings)[glyph]; + interp.env.init (str, *this, fd); + GetSeacParam param; + param.init (this); + if (unlikely (!interp.interpret (param))) return false; + + if (param.has_seac ()) + { + *base = param.base; + *accent = param.accent; + return true; + } + return false; +} diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff1-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff1-table.hh new file mode 100644 index 00000000000..72dc0ef3e01 --- /dev/null +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff1-table.hh @@ -0,0 +1,1300 @@ +/* + * Copyright © 2018 Adobe Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Adobe Author(s): Michiharu Ariza + */ + +#ifndef HB_OT_CFF1_TABLE_HH +#define HB_OT_CFF1_TABLE_HH + +#include "hb-ot-head-table.hh" +#include "hb-ot-cff-common.hh" +#include "hb-subset-cff1.hh" + +namespace CFF { + +/* + * CFF -- Compact Font Format (CFF) + * http://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5176.CFF.pdf + */ +#define HB_OT_TAG_cff1 HB_TAG('C','F','F',' ') + +#define CFF_UNDEF_SID CFF_UNDEF_CODE + +enum EncodingID { StandardEncoding = 0, ExpertEncoding = 1 }; +enum CharsetID { ISOAdobeCharset = 0, ExpertCharset = 1, ExpertSubsetCharset = 2 }; + +typedef CFFIndex CFF1Index; +template struct CFF1IndexOf : CFFIndexOf {}; + +typedef CFFIndex CFF1Index; +typedef CFF1Index CFF1CharStrings; +typedef FDArray CFF1FDArray; +typedef Subrs CFF1Subrs; + +struct CFF1FDSelect : FDSelect {}; + +/* Encoding */ +struct Encoding0 { + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && codes[nCodes - 1].sanitize (c)); + } + + hb_codepoint_t get_code (hb_codepoint_t glyph) const + { + assert (glyph > 0); + glyph--; + if (glyph < nCodes) + { + return (hb_codepoint_t)codes[glyph]; + } + else + return CFF_UNDEF_CODE; + } + + unsigned int get_size () const + { return HBUINT8::static_size * (nCodes + 1); } + + HBUINT8 nCodes; + HBUINT8 codes[VAR]; + + DEFINE_SIZE_ARRAY(1, codes); +}; + +struct Encoding1_Range { + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this)); + } + + HBUINT8 first; + HBUINT8 nLeft; + + DEFINE_SIZE_STATIC (2); +}; + +struct Encoding1 { + unsigned int get_size () const + { return HBUINT8::static_size + Encoding1_Range::static_size * nRanges; } + + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && ((nRanges == 0) || (ranges[nRanges - 1]).sanitize (c))); + } + + hb_codepoint_t get_code (hb_codepoint_t glyph) const + { + assert (glyph > 0); + glyph--; + for (unsigned int i = 0; i < nRanges; i++) + { + if (glyph <= ranges[i].nLeft) + { + return (hb_codepoint_t)ranges[i].first + glyph; + } + glyph -= (ranges[i].nLeft + 1); + } + return CFF_UNDEF_CODE; + } + + HBUINT8 nRanges; + Encoding1_Range ranges[VAR]; + + DEFINE_SIZE_ARRAY (1, ranges); +}; + +struct SuppEncoding { + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this)); + } + + HBUINT8 code; + HBUINT16 glyph; + + DEFINE_SIZE_STATIC (3); +}; + +struct CFF1SuppEncData { + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && ((nSups == 0) || (supps[nSups - 1]).sanitize (c))); + } + + void get_codes (hb_codepoint_t sid, hb_vector_t &codes) const + { + for (unsigned int i = 0; i < nSups; i++) + if (sid == supps[i].glyph) + codes.push (supps[i].code); + } + + unsigned int get_size () const + { return HBUINT8::static_size + SuppEncoding::static_size * nSups; } + + HBUINT8 nSups; + SuppEncoding supps[VAR]; + + DEFINE_SIZE_ARRAY (1, supps); +}; + +struct Encoding { + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + + if (unlikely (!c->check_struct (this))) + return_trace (false); + unsigned int fmt = format & 0x7F; + if (unlikely (fmt > 1)) + return_trace (false); + if (unlikely (!((fmt == 0)? u.format0.sanitize (c): u.format1.sanitize (c)))) + return_trace (false); + return_trace (((format & 0x80) == 0) || suppEncData ().sanitize (c)); + } + + /* serialize a fullset Encoding */ + bool serialize (hb_serialize_context_t *c, const Encoding &src) + { + TRACE_SERIALIZE (this); + unsigned int size = src.get_size (); + Encoding *dest = c->allocate_size (size); + if (unlikely (dest == nullptr)) return_trace (false); + memcpy (dest, &src, size); + return_trace (true); + } + + /* serialize a subset Encoding */ + bool serialize (hb_serialize_context_t *c, + uint8_t format, + unsigned int enc_count, + const hb_vector_t& code_ranges, + const hb_vector_t& supp_codes) + { + TRACE_SERIALIZE (this); + Encoding *dest = c->extend_min (*this); + if (unlikely (dest == nullptr)) return_trace (false); + dest->format.set (format | ((supp_codes.len > 0)? 0x80: 0)); + if (format == 0) + { + Encoding0 *fmt0 = c->allocate_size (Encoding0::min_size + HBUINT8::static_size * enc_count); + if (unlikely (fmt0 == nullptr)) return_trace (false); + fmt0->nCodes.set (enc_count); + unsigned int glyph = 0; + for (unsigned int i = 0; i < code_ranges.len; i++) + { + hb_codepoint_t code = code_ranges[i].code; + for (int left = (int)code_ranges[i].glyph; left >= 0; left--) + fmt0->codes[glyph++].set (code++); + if (unlikely (!((glyph <= 0x100) && (code <= 0x100)))) + return_trace (false); + } + } + else + { + Encoding1 *fmt1 = c->allocate_size (Encoding1::min_size + Encoding1_Range::static_size * code_ranges.len); + if (unlikely (fmt1 == nullptr)) return_trace (false); + fmt1->nRanges.set (code_ranges.len); + for (unsigned int i = 0; i < code_ranges.len; i++) + { + if (unlikely (!((code_ranges[i].code <= 0xFF) && (code_ranges[i].glyph <= 0xFF)))) + return_trace (false); + fmt1->ranges[i].first.set (code_ranges[i].code); + fmt1->ranges[i].nLeft.set (code_ranges[i].glyph); + } + } + if (supp_codes.len > 0) + { + CFF1SuppEncData *suppData = c->allocate_size (CFF1SuppEncData::min_size + SuppEncoding::static_size * supp_codes.len); + if (unlikely (suppData == nullptr)) return_trace (false); + suppData->nSups.set (supp_codes.len); + for (unsigned int i = 0; i < supp_codes.len; i++) + { + suppData->supps[i].code.set (supp_codes[i].code); + suppData->supps[i].glyph.set (supp_codes[i].glyph); /* actually SID */ + } + } + return_trace (true); + } + + /* parallel to above: calculate the size of a subset Encoding */ + static unsigned int calculate_serialized_size (uint8_t format, + unsigned int enc_count, + unsigned int supp_count) + { + unsigned int size = min_size; + if (format == 0) + size += Encoding0::min_size + HBUINT8::static_size * enc_count; + else + size += Encoding1::min_size + Encoding1_Range::static_size * enc_count; + if (supp_count > 0) + size += CFF1SuppEncData::min_size + SuppEncoding::static_size * supp_count; + return size; + } + + unsigned int get_size () const + { + unsigned int size = min_size; + if (table_format () == 0) + size += u.format0.get_size (); + else + size += u.format1.get_size (); + if (has_supplement ()) + size += suppEncData ().get_size (); + return size; + } + + hb_codepoint_t get_code (hb_codepoint_t glyph) const + { + if (table_format () == 0) + return u.format0.get_code (glyph); + else + return u.format1.get_code (glyph); + } + + uint8_t table_format () const { return (format & 0x7F); } + bool has_supplement () const { return (format & 0x80) != 0; } + + void get_supplement_codes (hb_codepoint_t sid, hb_vector_t &codes) const + { + codes.resize (0); + if (has_supplement ()) + suppEncData().get_codes (sid, codes); + } + + protected: + const CFF1SuppEncData &suppEncData () const + { + if ((format & 0x7F) == 0) + return StructAfter (u.format0.codes[u.format0.nCodes-1]); + else + return StructAfter (u.format1.ranges[u.format1.nRanges-1]); + } + + public: + HBUINT8 format; + + union { + Encoding0 format0; + Encoding1 format1; + } u; + /* CFF1SuppEncData suppEncData; */ + + DEFINE_SIZE_MIN (1); +}; + +/* Charset */ +struct Charset0 { + bool sanitize (hb_sanitize_context_t *c, unsigned int num_glyphs) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && sids[num_glyphs - 1].sanitize (c)); + } + + hb_codepoint_t get_sid (hb_codepoint_t glyph) const + { + if (glyph == 0) + return 0; + else + return sids[glyph - 1]; + } + + hb_codepoint_t get_glyph (hb_codepoint_t sid, unsigned int num_glyphs) const + { + if (sid == 0) + return 0; + + for (unsigned int glyph = 1; glyph < num_glyphs; glyph++) + { + if (sids[glyph-1] == sid) + return glyph; + } + return 0; + } + + unsigned int get_size (unsigned int num_glyphs) const + { + assert (num_glyphs > 0); + return HBUINT16::static_size * (num_glyphs - 1); + } + + HBUINT16 sids[VAR]; + + DEFINE_SIZE_ARRAY(0, sids); +}; + +template +struct Charset_Range { + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this)); + } + + HBUINT16 first; + TYPE nLeft; + + DEFINE_SIZE_STATIC (HBUINT16::static_size + TYPE::static_size); +}; + +template +struct Charset1_2 { + bool sanitize (hb_sanitize_context_t *c, unsigned int num_glyphs) const + { + TRACE_SANITIZE (this); + if (unlikely (!c->check_struct (this))) + return_trace (false); + num_glyphs--; + for (unsigned int i = 0; num_glyphs > 0; i++) + { + if (unlikely (!ranges[i].sanitize (c) || (num_glyphs < ranges[i].nLeft + 1))) + return_trace (false); + num_glyphs -= (ranges[i].nLeft + 1); + } + return_trace (true); + } + + hb_codepoint_t get_sid (hb_codepoint_t glyph) const + { + if (glyph == 0) return 0; + glyph--; + for (unsigned int i = 0;; i++) + { + if (glyph <= ranges[i].nLeft) + return (hb_codepoint_t)ranges[i].first + glyph; + glyph -= (ranges[i].nLeft + 1); + } + + return 0; + } + + hb_codepoint_t get_glyph (hb_codepoint_t sid, unsigned int num_glyphs) const + { + if (sid == 0) return 0; + hb_codepoint_t glyph = 1; + for (unsigned int i = 0;; i++) + { + if (glyph >= num_glyphs) + return 0; + if ((ranges[i].first <= sid) && (sid <= ranges[i].first + ranges[i].nLeft)) + return glyph + (sid - ranges[i].first); + glyph += (ranges[i].nLeft + 1); + } + + return 0; + } + + unsigned int get_size (unsigned int num_glyphs) const + { + unsigned int size = HBUINT8::static_size; + int glyph = (int)num_glyphs; + + assert (glyph > 0); + glyph--; + for (unsigned int i = 0; glyph > 0; i++) + { + glyph -= (ranges[i].nLeft + 1); + size += Charset_Range::static_size; + } + + return size; + } + + Charset_Range ranges[VAR]; + + DEFINE_SIZE_ARRAY (0, ranges); +}; + +typedef Charset1_2 Charset1; +typedef Charset1_2 Charset2; +typedef Charset_Range Charset1_Range; +typedef Charset_Range Charset2_Range; + +struct Charset { + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + + if (unlikely (!c->check_struct (this))) + return_trace (false); + if (format == 0) + return_trace (u.format0.sanitize (c, c->get_num_glyphs ())); + else if (format == 1) + return_trace (u.format1.sanitize (c, c->get_num_glyphs ())); + else if (likely (format == 2)) + return_trace (u.format2.sanitize (c, c->get_num_glyphs ())); + else + return_trace (false); + } + + /* serialize a fullset Charset */ + bool serialize (hb_serialize_context_t *c, const Charset &src, unsigned int num_glyphs) + { + TRACE_SERIALIZE (this); + unsigned int size = src.get_size (num_glyphs); + Charset *dest = c->allocate_size (size); + if (unlikely (dest == nullptr)) return_trace (false); + memcpy (dest, &src, size); + return_trace (true); + } + + /* serialize a subset Charset */ + bool serialize (hb_serialize_context_t *c, + uint8_t format, + unsigned int num_glyphs, + const hb_vector_t& sid_ranges) + { + TRACE_SERIALIZE (this); + Charset *dest = c->extend_min (*this); + if (unlikely (dest == nullptr)) return_trace (false); + dest->format.set (format); + if (format == 0) + { + Charset0 *fmt0 = c->allocate_size (Charset0::min_size + HBUINT16::static_size * (num_glyphs - 1)); + if (unlikely (fmt0 == nullptr)) return_trace (false); + unsigned int glyph = 0; + for (unsigned int i = 0; i < sid_ranges.len; i++) + { + hb_codepoint_t sid = sid_ranges[i].code; + for (int left = (int)sid_ranges[i].glyph; left >= 0; left--) + fmt0->sids[glyph++].set (sid++); + } + } + else if (format == 1) + { + Charset1 *fmt1 = c->allocate_size (Charset1::min_size + Charset1_Range::static_size * sid_ranges.len); + if (unlikely (fmt1 == nullptr)) return_trace (false); + for (unsigned int i = 0; i < sid_ranges.len; i++) + { + if (unlikely (!(sid_ranges[i].glyph <= 0xFF))) + return_trace (false); + fmt1->ranges[i].first.set (sid_ranges[i].code); + fmt1->ranges[i].nLeft.set (sid_ranges[i].glyph); + } + } + else /* format 2 */ + { + Charset2 *fmt2 = c->allocate_size (Charset2::min_size + Charset2_Range::static_size * sid_ranges.len); + if (unlikely (fmt2 == nullptr)) return_trace (false); + for (unsigned int i = 0; i < sid_ranges.len; i++) + { + if (unlikely (!(sid_ranges[i].glyph <= 0xFFFF))) + return_trace (false); + fmt2->ranges[i].first.set (sid_ranges[i].code); + fmt2->ranges[i].nLeft.set (sid_ranges[i].glyph); + } + } + return_trace (true); + } + + /* parallel to above: calculate the size of a subset Charset */ + static unsigned int calculate_serialized_size ( + uint8_t format, + unsigned int count) + { + unsigned int size = min_size; + if (format == 0) + size += Charset0::min_size + HBUINT16::static_size * (count - 1); + else if (format == 1) + size += Charset1::min_size + Charset1_Range::static_size * count; + else + size += Charset2::min_size + Charset2_Range::static_size * count; + + return size; + } + + unsigned int get_size (unsigned int num_glyphs) const + { + unsigned int size = min_size; + if (format == 0) + size += u.format0.get_size (num_glyphs); + else if (format == 1) + size += u.format1.get_size (num_glyphs); + else + size += u.format2.get_size (num_glyphs); + return size; + } + + hb_codepoint_t get_sid (hb_codepoint_t glyph) const + { + if (format == 0) + return u.format0.get_sid (glyph); + else if (format == 1) + return u.format1.get_sid (glyph); + else + return u.format2.get_sid (glyph); + } + + hb_codepoint_t get_glyph (hb_codepoint_t sid, unsigned int num_glyphs) const + { + if (format == 0) + return u.format0.get_glyph (sid, num_glyphs); + else if (format == 1) + return u.format1.get_glyph (sid, num_glyphs); + else + return u.format2.get_glyph (sid, num_glyphs); + } + + HBUINT8 format; + union { + Charset0 format0; + Charset1 format1; + Charset2 format2; + } u; + + DEFINE_SIZE_MIN (1); +}; + +struct CFF1StringIndex : CFF1Index +{ + bool serialize (hb_serialize_context_t *c, const CFF1StringIndex &strings, + unsigned int offSize_, const Remap &sidmap) + { + TRACE_SERIALIZE (this); + if (unlikely ((strings.count == 0) || (sidmap.get_count () == 0))) + { + if (!unlikely (c->extend_min (this->count))) + return_trace (false); + count.set (0); + return_trace (true); + } + + ByteStrArray bytesArray; + bytesArray.init (); + if (!bytesArray.resize (sidmap.get_count ())) + return_trace (false); + for (unsigned int i = 0; i < strings.count; i++) + { + hb_codepoint_t j = sidmap[i]; + if (j != CFF_UNDEF_CODE) + bytesArray[j] = strings[i]; + } + + bool result = CFF1Index::serialize (c, offSize_, bytesArray); + bytesArray.fini (); + return_trace (result); + } + + /* in parallel to above */ + unsigned int calculate_serialized_size (unsigned int &offSize /*OUT*/, const Remap &sidmap) const + { + offSize = 0; + if ((count == 0) || (sidmap.get_count () == 0)) + return count.static_size; + + unsigned int dataSize = 0; + for (unsigned int i = 0; i < count; i++) + if (sidmap[i] != CFF_UNDEF_CODE) + dataSize += length_at (i); + + offSize = calcOffSize(dataSize); + return CFF1Index::calculate_serialized_size (offSize, sidmap.get_count (), dataSize); + } +}; + +struct CFF1TopDictInterpEnv : NumInterpEnv +{ + CFF1TopDictInterpEnv () + : NumInterpEnv(), prev_offset(0), last_offset(0) {} + + unsigned int prev_offset; + unsigned int last_offset; +}; + +struct NameDictValues +{ + enum NameDictValIndex + { + version, + notice, + copyright, + fullName, + familyName, + weight, + postscript, + fontName, + baseFontName, + registry, + ordering, + + ValCount + }; + + void init () + { + for (unsigned int i = 0; i < ValCount; i++) + values[i] = CFF_UNDEF_SID; + } + + unsigned int& operator[] (unsigned int i) + { assert (i < ValCount); return values[i]; } + + unsigned int operator[] (unsigned int i) const + { assert (i < ValCount); return values[i]; } + + static enum NameDictValIndex name_op_to_index (OpCode op) + { + switch (op) { + default: // can't happen - just make some compiler happy + case OpCode_version: + return version; + case OpCode_Notice: + return notice; + case OpCode_Copyright: + return copyright; + case OpCode_FullName: + return fullName; + case OpCode_FamilyName: + return familyName; + case OpCode_Weight: + return weight; + case OpCode_PostScript: + return postscript; + case OpCode_FontName: + return fontName; + case OpCode_BaseFontName: + return baseFontName; + } + } + + unsigned int values[ValCount]; +}; + +struct CFF1TopDictVal : OpStr +{ + unsigned int last_arg_offset; +}; + +struct CFF1TopDictValues : TopDictValues +{ + void init () + { + TopDictValues::init (); + + nameSIDs.init (); + ros_supplement = 0; + cidCount = 8720; + EncodingOffset = 0; + CharsetOffset = 0; + FDSelectOffset = 0; + privateDictInfo.init (); + } + void fini () { TopDictValues::fini (); } + + bool is_CID () const + { return nameSIDs[NameDictValues::registry] != CFF_UNDEF_SID; } + + NameDictValues nameSIDs; + unsigned int ros_supplement_offset; + unsigned int ros_supplement; + unsigned int cidCount; + + unsigned int EncodingOffset; + unsigned int CharsetOffset; + unsigned int FDSelectOffset; + TableInfo privateDictInfo; +}; + +struct CFF1TopDictOpSet : TopDictOpSet +{ + static void process_op (OpCode op, CFF1TopDictInterpEnv& env, CFF1TopDictValues& dictval) + { + CFF1TopDictVal val; + val.last_arg_offset = (env.last_offset-1) - dictval.opStart; /* offset to the last argument */ + + switch (op) { + case OpCode_version: + case OpCode_Notice: + case OpCode_Copyright: + case OpCode_FullName: + case OpCode_FamilyName: + case OpCode_Weight: + case OpCode_PostScript: + case OpCode_BaseFontName: + dictval.nameSIDs[NameDictValues::name_op_to_index (op)] = env.argStack.pop_uint (); + env.clear_args (); + break; + case OpCode_isFixedPitch: + case OpCode_ItalicAngle: + case OpCode_UnderlinePosition: + case OpCode_UnderlineThickness: + case OpCode_PaintType: + case OpCode_CharstringType: + case OpCode_UniqueID: + case OpCode_StrokeWidth: + case OpCode_SyntheticBase: + case OpCode_CIDFontVersion: + case OpCode_CIDFontRevision: + case OpCode_CIDFontType: + case OpCode_UIDBase: + case OpCode_FontBBox: + case OpCode_XUID: + case OpCode_BaseFontBlend: + env.clear_args (); + break; + + case OpCode_CIDCount: + dictval.cidCount = env.argStack.pop_uint (); + env.clear_args (); + break; + + case OpCode_ROS: + dictval.ros_supplement = env.argStack.pop_uint (); + dictval.nameSIDs[NameDictValues::ordering] = env.argStack.pop_uint (); + dictval.nameSIDs[NameDictValues::registry] = env.argStack.pop_uint (); + env.clear_args (); + break; + + case OpCode_Encoding: + dictval.EncodingOffset = env.argStack.pop_uint (); + env.clear_args (); + if (unlikely (dictval.EncodingOffset == 0)) return; + break; + + case OpCode_charset: + dictval.CharsetOffset = env.argStack.pop_uint (); + env.clear_args (); + if (unlikely (dictval.CharsetOffset == 0)) return; + break; + + case OpCode_FDSelect: + dictval.FDSelectOffset = env.argStack.pop_uint (); + env.clear_args (); + break; + + case OpCode_Private: + dictval.privateDictInfo.offset = env.argStack.pop_uint (); + dictval.privateDictInfo.size = env.argStack.pop_uint (); + env.clear_args (); + break; + + default: + env.last_offset = env.substr.offset; + TopDictOpSet::process_op (op, env, dictval); + /* Record this operand below if stack is empty, otherwise done */ + if (!env.argStack.is_empty ()) return; + break; + } + + if (unlikely (env.in_error ())) return; + + dictval.add_op (op, env.substr, val); + } +}; + +struct CFF1FontDictValues : DictValues +{ + void init () + { + DictValues::init (); + privateDictInfo.init (); + fontName = CFF_UNDEF_SID; + } + void fini () { DictValues::fini (); } + + TableInfo privateDictInfo; + unsigned int fontName; +}; + +struct CFF1FontDictOpSet : DictOpSet +{ + static void process_op (OpCode op, NumInterpEnv& env, CFF1FontDictValues& dictval) + { + switch (op) { + case OpCode_FontName: + dictval.fontName = env.argStack.pop_uint (); + env.clear_args (); + break; + case OpCode_FontMatrix: + case OpCode_PaintType: + env.clear_args (); + break; + case OpCode_Private: + dictval.privateDictInfo.offset = env.argStack.pop_uint (); + dictval.privateDictInfo.size = env.argStack.pop_uint (); + env.clear_args (); + break; + + default: + DictOpSet::process_op (op, env); + if (!env.argStack.is_empty ()) return; + break; + } + + if (unlikely (env.in_error ())) return; + + dictval.add_op (op, env.substr); + } +}; + +template +struct CFF1PrivateDictValues_Base : DictValues +{ + void init () + { + DictValues::init (); + subrsOffset = 0; + localSubrs = &Null(CFF1Subrs); + } + void fini () { DictValues::fini (); } + + unsigned int calculate_serialized_size () const + { + unsigned int size = 0; + for (unsigned int i = 0; i < DictValues::get_count; i++) + if (DictValues::get_value (i).op == OpCode_Subrs) + size += OpCode_Size (OpCode_shortint) + 2 + OpCode_Size (OpCode_Subrs); + else + size += DictValues::get_value (i).str.len; + return size; + } + + unsigned int subrsOffset; + const CFF1Subrs *localSubrs; +}; + +typedef CFF1PrivateDictValues_Base CFF1PrivateDictValues_Subset; +typedef CFF1PrivateDictValues_Base CFF1PrivateDictValues; + +struct CFF1PrivateDictOpSet : DictOpSet +{ + static void process_op (OpCode op, NumInterpEnv& env, CFF1PrivateDictValues& dictval) + { + NumDictVal val; + val.init (); + + switch (op) { + case OpCode_BlueValues: + case OpCode_OtherBlues: + case OpCode_FamilyBlues: + case OpCode_FamilyOtherBlues: + case OpCode_StemSnapH: + case OpCode_StemSnapV: + env.clear_args (); + break; + case OpCode_StdHW: + case OpCode_StdVW: + case OpCode_BlueScale: + case OpCode_BlueShift: + case OpCode_BlueFuzz: + case OpCode_ForceBold: + case OpCode_LanguageGroup: + case OpCode_ExpansionFactor: + case OpCode_initialRandomSeed: + case OpCode_defaultWidthX: + case OpCode_nominalWidthX: + val.single_val = env.argStack.pop_num (); + env.clear_args (); + break; + case OpCode_Subrs: + dictval.subrsOffset = env.argStack.pop_uint (); + env.clear_args (); + break; + + default: + DictOpSet::process_op (op, env); + if (!env.argStack.is_empty ()) return; + break; + } + + if (unlikely (env.in_error ())) return; + + dictval.add_op (op, env.substr, val); + } +}; + +struct CFF1PrivateDictOpSet_Subset : DictOpSet +{ + static void process_op (OpCode op, NumInterpEnv& env, CFF1PrivateDictValues_Subset& dictval) + { + switch (op) { + case OpCode_BlueValues: + case OpCode_OtherBlues: + case OpCode_FamilyBlues: + case OpCode_FamilyOtherBlues: + case OpCode_StemSnapH: + case OpCode_StemSnapV: + case OpCode_StdHW: + case OpCode_StdVW: + case OpCode_BlueScale: + case OpCode_BlueShift: + case OpCode_BlueFuzz: + case OpCode_ForceBold: + case OpCode_LanguageGroup: + case OpCode_ExpansionFactor: + case OpCode_initialRandomSeed: + case OpCode_defaultWidthX: + case OpCode_nominalWidthX: + env.clear_args (); + break; + + case OpCode_Subrs: + dictval.subrsOffset = env.argStack.pop_uint (); + env.clear_args (); + break; + + default: + DictOpSet::process_op (op, env); + if (!env.argStack.is_empty ()) return; + break; + } + + if (unlikely (env.in_error ())) return; + + dictval.add_op (op, env.substr); + } +}; + +typedef DictInterpreter CFF1TopDict_Interpreter; +typedef DictInterpreter CFF1FontDict_Interpreter; +typedef DictInterpreter CFF1PrivateDict_Interpreter; + +typedef CFF1Index CFF1NameIndex; +typedef CFF1IndexOf CFF1TopDictIndex; + +}; /* namespace CFF */ + +namespace OT { + +using namespace CFF; + +struct cff1 +{ + static const hb_tag_t tableTag = HB_OT_TAG_cff1; + + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && + likely (version.major == 1)); + } + + template + struct accelerator_templ_t + { + void init (hb_face_t *face) + { + topDict.init (); + fontDicts.init (); + privateDicts.init (); + + this->blob = sc.reference_table (face); + + /* setup for run-time santization */ + sc.init (this->blob); + sc.start_processing (); + + const OT::cff1 *cff = this->blob->template as (); + + if (cff == &Null(OT::cff1)) + { fini (); return; } + + nameIndex = &cff->nameIndex (cff); + if ((nameIndex == &Null (CFF1NameIndex)) || !nameIndex->sanitize (&sc)) + { fini (); return; } + + topDictIndex = &StructAtOffset (nameIndex, nameIndex->get_size ()); + if ((topDictIndex == &Null (CFF1TopDictIndex)) || !topDictIndex->sanitize (&sc) || (topDictIndex->count == 0)) + { fini (); return; } + + { /* parse top dict */ + const ByteStr topDictStr = (*topDictIndex)[0]; + if (unlikely (!topDictStr.sanitize (&sc))) { fini (); return; } + CFF1TopDict_Interpreter top_interp; + top_interp.env.init (topDictStr); + topDict.init (); + if (unlikely (!top_interp.interpret (topDict))) { fini (); return; } + } + + if (is_predef_charset ()) + charset = &Null(Charset); + else + { + charset = &StructAtOffsetOrNull (cff, topDict.CharsetOffset); + if (unlikely ((charset == &Null (Charset)) || !charset->sanitize (&sc))) { fini (); return; } + } + + fdCount = 1; + if (is_CID ()) + { + fdArray = &StructAtOffsetOrNull (cff, topDict.FDArrayOffset); + fdSelect = &StructAtOffsetOrNull (cff, topDict.FDSelectOffset); + if (unlikely ((fdArray == &Null(CFF1FDArray)) || !fdArray->sanitize (&sc) || + (fdSelect == &Null(CFF1FDSelect)) || !fdSelect->sanitize (&sc, fdArray->count))) + { fini (); return; } + + fdCount = fdArray->count; + } + else + { + fdArray = &Null(CFF1FDArray); + fdSelect = &Null(CFF1FDSelect); + } + + stringIndex = &StructAtOffset (topDictIndex, topDictIndex->get_size ()); + if ((stringIndex == &Null (CFF1StringIndex)) || !stringIndex->sanitize (&sc)) + { fini (); return; } + + globalSubrs = &StructAtOffset (stringIndex, stringIndex->get_size ()); + if ((globalSubrs != &Null (CFF1Subrs)) && !globalSubrs->sanitize (&sc)) + { fini (); return; } + + charStrings = &StructAtOffsetOrNull (cff, topDict.charStringsOffset); + + if ((charStrings == &Null(CFF1CharStrings)) || unlikely (!charStrings->sanitize (&sc))) + { fini (); return; } + + num_glyphs = charStrings->count; + if (num_glyphs != sc.get_num_glyphs ()) + { fini (); return; } + + privateDicts.resize (fdCount); + for (unsigned int i = 0; i < fdCount; i++) + privateDicts[i].init (); + + // parse CID font dicts and gather private dicts + if (is_CID ()) + { + for (unsigned int i = 0; i < fdCount; i++) + { + ByteStr fontDictStr = (*fdArray)[i]; + if (unlikely (!fontDictStr.sanitize (&sc))) { fini (); return; } + CFF1FontDictValues *font; + CFF1FontDict_Interpreter font_interp; + font_interp.env.init (fontDictStr); + font = fontDicts.push (); + if (unlikely (font == &Crap(CFF1FontDictValues))) { fini (); return; } + font->init (); + if (unlikely (!font_interp.interpret (*font))) { fini (); return; } + PRIVDICTVAL *priv = &privateDicts[i]; + const ByteStr privDictStr (StructAtOffset (cff, font->privateDictInfo.offset), font->privateDictInfo.size); + if (unlikely (!privDictStr.sanitize (&sc))) { fini (); return; } + DictInterpreter priv_interp; + priv_interp.env.init (privDictStr); + priv->init (); + if (unlikely (!priv_interp.interpret (*priv))) { fini (); return; } + + priv->localSubrs = &StructAtOffsetOrNull (privDictStr.str, priv->subrsOffset); + if (priv->localSubrs != &Null(CFF1Subrs) && + unlikely (!priv->localSubrs->sanitize (&sc))) + { fini (); return; } + } + } + else /* non-CID */ + { + CFF1TopDictValues *font = &topDict; + PRIVDICTVAL *priv = &privateDicts[0]; + + const ByteStr privDictStr (StructAtOffset (cff, font->privateDictInfo.offset), font->privateDictInfo.size); + if (unlikely (!privDictStr.sanitize (&sc))) { fini (); return; } + DictInterpreter priv_interp; + priv_interp.env.init (privDictStr); + priv->init (); + if (unlikely (!priv_interp.interpret (*priv))) { fini (); return; } + + priv->localSubrs = &StructAtOffsetOrNull (privDictStr.str, priv->subrsOffset); + if (priv->localSubrs != &Null(CFF1Subrs) && + unlikely (!priv->localSubrs->sanitize (&sc))) + { fini (); return; } + } + } + + void fini () + { + sc.end_processing (); + topDict.fini (); + fontDicts.fini_deep (); + privateDicts.fini_deep (); + hb_blob_destroy (blob); + blob = nullptr; + } + + bool is_valid () const { return blob != nullptr; } + bool is_CID () const { return topDict.is_CID (); } + + bool is_predef_charset () const { return topDict.CharsetOffset <= ExpertSubsetCharset; } + + unsigned int std_code_to_glyph (hb_codepoint_t code) const + { + hb_codepoint_t sid = lookup_standard_encoding_for_sid (code); + if (unlikely (sid == CFF_UNDEF_SID)) + return 0; + + if (charset != &Null(Charset)) + return charset->get_glyph (sid, num_glyphs); + else if ((topDict.CharsetOffset == ISOAdobeCharset) + && (code <= 228 /*zcaron*/)) return sid; + return 0; + } + + protected: + hb_blob_t *blob; + hb_sanitize_context_t sc; + + public: + const Charset *charset; + const CFF1NameIndex *nameIndex; + const CFF1TopDictIndex *topDictIndex; + const CFF1StringIndex *stringIndex; + const CFF1Subrs *globalSubrs; + const CFF1CharStrings *charStrings; + const CFF1FDArray *fdArray; + const CFF1FDSelect *fdSelect; + unsigned int fdCount; + + CFF1TopDictValues topDict; + hb_vector_t fontDicts; + hb_vector_t privateDicts; + + unsigned int num_glyphs; + }; + + struct accelerator_t : accelerator_templ_t + { + HB_INTERNAL bool get_extents (hb_codepoint_t glyph, hb_glyph_extents_t *extents) const; + HB_INTERNAL bool get_seac_components (hb_codepoint_t glyph, hb_codepoint_t *base, hb_codepoint_t *accent) const; + }; + + struct accelerator_subset_t : accelerator_templ_t + { + void init (hb_face_t *face) + { + SUPER::init (face); + if (blob == nullptr) return; + + const OT::cff1 *cff = this->blob->as (); + encoding = &Null(Encoding); + if (is_CID ()) + { + if (unlikely (charset == &Null(Charset))) { fini (); return; } + } + else + { + if (!is_predef_encoding ()) + { + encoding = &StructAtOffsetOrNull (cff, topDict.EncodingOffset); + if (unlikely ((encoding == &Null (Encoding)) || !encoding->sanitize (&sc))) { fini (); return; } + } + } + } + + bool is_predef_encoding () const { return topDict.EncodingOffset <= ExpertEncoding; } + + hb_codepoint_t glyph_to_code (hb_codepoint_t glyph) const + { + if (encoding != &Null(Encoding)) + return encoding->get_code (glyph); + else + { + hb_codepoint_t sid = glyph_to_sid (glyph); + if (sid == 0) return 0; + hb_codepoint_t code = 0; + switch (topDict.EncodingOffset) + { + case StandardEncoding: + code = lookup_standard_encoding_for_code (sid); + break; + case ExpertEncoding: + code = lookup_expert_encoding_for_code (sid); + break; + default: + break; + } + return code; + } + } + + hb_codepoint_t glyph_to_sid (hb_codepoint_t glyph) const + { + if (charset != &Null(Charset)) + return charset->get_sid (glyph); + else + { + hb_codepoint_t sid = 0; + switch (topDict.CharsetOffset) + { + case ISOAdobeCharset: + if (glyph <= 228 /*zcaron*/) sid = glyph; + break; + case ExpertCharset: + sid = lookup_expert_charset_for_sid (glyph); + break; + case ExpertSubsetCharset: + sid = lookup_expert_subset_charset_for_sid (glyph); + break; + default: + break; + } + return sid; + } + } + + const Encoding *encoding; + + private: + typedef accelerator_templ_t SUPER; + }; + + bool subset (hb_subset_plan_t *plan) const + { + hb_blob_t *cff_prime = nullptr; + + bool success = true; + if (hb_subset_cff1 (plan, &cff_prime)) { + success = success && plan->add_table (HB_OT_TAG_cff1, cff_prime); + hb_blob_t *head_blob = hb_sanitize_context_t().reference_table (plan->source); + success = success && head_blob && plan->add_table (HB_OT_TAG_head, head_blob); + hb_blob_destroy (head_blob); + } else { + success = false; + } + hb_blob_destroy (cff_prime); + + return success; + } + + protected: + HB_INTERNAL static hb_codepoint_t lookup_standard_encoding_for_code (hb_codepoint_t sid); + HB_INTERNAL static hb_codepoint_t lookup_expert_encoding_for_code (hb_codepoint_t sid); + HB_INTERNAL static hb_codepoint_t lookup_expert_charset_for_sid (hb_codepoint_t glyph); + HB_INTERNAL static hb_codepoint_t lookup_expert_subset_charset_for_sid (hb_codepoint_t glyph); + HB_INTERNAL static hb_codepoint_t lookup_standard_encoding_for_sid (hb_codepoint_t code); + + public: + FixedVersion version; /* Version of CFF table. set to 0x0100u */ + OffsetTo nameIndex; /* headerSize = Offset to Name INDEX. */ + HBUINT8 offSize; /* offset size (unused?) */ + + public: + DEFINE_SIZE_STATIC (4); +}; + +struct cff1_accelerator_t : cff1::accelerator_t {}; +} /* namespace OT */ + +#endif /* HB_OT_CFF1_TABLE_HH */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff2-table.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff2-table.cc new file mode 100644 index 00000000000..7188a3bfe86 --- /dev/null +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff2-table.cc @@ -0,0 +1,136 @@ +/* + * Copyright © 2018 Adobe Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Adobe Author(s): Michiharu Ariza + */ + +#include "hb-ot-cff2-table.hh" +#include "hb-cff2-interp-cs.hh" + +using namespace CFF; + +struct ExtentsParam +{ + void init () + { + path_open = false; + min_x.set_int (0x7FFFFFFF); + min_y.set_int (0x7FFFFFFF); + max_x.set_int (-0x80000000); + max_y.set_int (-0x80000000); + } + + void start_path () { path_open = true; } + void end_path () { path_open = false; } + bool is_path_open () const { return path_open; } + + void update_bounds (const Point &pt) + { + if (pt.x < min_x) min_x = pt.x; + if (pt.x > max_x) max_x = pt.x; + if (pt.y < min_y) min_y = pt.y; + if (pt.y > max_y) max_y = pt.y; + } + + bool path_open; + Number min_x; + Number min_y; + Number max_x; + Number max_y; +}; + +struct CFF2PathProcs_Extents : PathProcs +{ + static void moveto (CFF2CSInterpEnv &env, ExtentsParam& param, const Point &pt) + { + param.end_path (); + env.moveto (pt); + } + + static void line (CFF2CSInterpEnv &env, ExtentsParam& param, const Point &pt1) + { + if (!param.is_path_open ()) + { + param.start_path (); + param.update_bounds (env.get_pt ()); + } + env.moveto (pt1); + param.update_bounds (env.get_pt ()); + } + + static void curve (CFF2CSInterpEnv &env, ExtentsParam& param, const Point &pt1, const Point &pt2, const Point &pt3) + { + if (!param.is_path_open ()) + { + param.start_path (); + param.update_bounds (env.get_pt ()); + } + /* include control points */ + param.update_bounds (pt1); + param.update_bounds (pt2); + env.moveto (pt3); + param.update_bounds (env.get_pt ()); + } +}; + +struct CFF2CSOpSet_Extents : CFF2CSOpSet {}; + +bool OT::cff2::accelerator_t::get_extents (hb_font_t *font, + hb_codepoint_t glyph, + hb_glyph_extents_t *extents) const +{ + if (unlikely (!is_valid () || (glyph >= num_glyphs))) return false; + + unsigned int num_coords; + const int *coords = hb_font_get_var_coords_normalized (font, &num_coords); + unsigned int fd = fdSelect->get_fd (glyph); + CFF2CSInterpreter interp; + const ByteStr str = (*charStrings)[glyph]; + interp.env.init (str, *this, fd, coords, num_coords); + ExtentsParam param; + param.init (); + if (unlikely (!interp.interpret (param))) return false; + + if (param.min_x >= param.max_x) + { + extents->width = 0; + extents->x_bearing = 0; + } + else + { + extents->x_bearing = (int32_t)param.min_x.floor (); + extents->width = (int32_t)param.max_x.ceil () - extents->x_bearing; + } + if (param.min_y >= param.max_y) + { + extents->height = 0; + extents->y_bearing = 0; + } + else + { + extents->y_bearing = (int32_t)param.max_y.ceil (); + extents->height = (int32_t)param.min_y.floor () - extents->y_bearing; + } + + return true; +} diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff2-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff2-table.hh new file mode 100644 index 00000000000..25c41ef8cc1 --- /dev/null +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff2-table.hh @@ -0,0 +1,565 @@ +/* + * Copyright © 2018 Adobe Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Adobe Author(s): Michiharu Ariza + */ + +#ifndef HB_OT_CFF2_TABLE_HH +#define HB_OT_CFF2_TABLE_HH + +#include "hb-ot-head-table.hh" +#include "hb-ot-cff-common.hh" +#include "hb-subset-cff2.hh" + +namespace CFF { + +/* + * CFF2 -- Compact Font Format (CFF) Version 2 + * https://docs.microsoft.com/en-us/typography/opentype/spec/cff2 + */ +#define HB_OT_TAG_cff2 HB_TAG('C','F','F','2') + +typedef CFFIndex CFF2Index; +template struct CFF2IndexOf : CFFIndexOf {}; + +typedef CFF2Index CFF2CharStrings; +typedef FDArray CFF2FDArray; +typedef Subrs CFF2Subrs; + +typedef FDSelect3_4 FDSelect4; +typedef FDSelect3_4_Range FDSelect4_Range; + +struct CFF2FDSelect +{ + bool sanitize (hb_sanitize_context_t *c, unsigned int fdcount) const + { + TRACE_SANITIZE (this); + + return_trace (likely (c->check_struct (this) && (format == 0 || format == 3 || format == 4) && + (format == 0)? + u.format0.sanitize (c, fdcount): + ((format == 3)? + u.format3.sanitize (c, fdcount): + u.format4.sanitize (c, fdcount)))); + } + + bool serialize (hb_serialize_context_t *c, const CFF2FDSelect &src, unsigned int num_glyphs) + { + TRACE_SERIALIZE (this); + unsigned int size = src.get_size (num_glyphs); + CFF2FDSelect *dest = c->allocate_size (size); + if (unlikely (dest == nullptr)) return_trace (false); + memcpy (dest, &src, size); + return_trace (true); + } + + unsigned int calculate_serialized_size (unsigned int num_glyphs) const + { return get_size (num_glyphs); } + + unsigned int get_size (unsigned int num_glyphs) const + { + unsigned int size = format.static_size; + if (format == 0) + size += u.format0.get_size (num_glyphs); + else if (format == 3) + size += u.format3.get_size (); + else + size += u.format4.get_size (); + return size; + } + + hb_codepoint_t get_fd (hb_codepoint_t glyph) const + { + if (this == &Null(CFF2FDSelect)) + return 0; + if (format == 0) + return u.format0.get_fd (glyph); + else if (format == 3) + return u.format3.get_fd (glyph); + else + return u.format4.get_fd (glyph); + } + + HBUINT8 format; + union { + FDSelect0 format0; + FDSelect3 format3; + FDSelect4 format4; + } u; + + DEFINE_SIZE_MIN (2); +}; + +struct CFF2VariationStore +{ + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (likely (c->check_struct (this)) && c->check_range (&varStore, size) && varStore.sanitize (c)); + } + + bool serialize (hb_serialize_context_t *c, const CFF2VariationStore *varStore) + { + TRACE_SERIALIZE (this); + unsigned int size_ = varStore->get_size (); + CFF2VariationStore *dest = c->allocate_size (size_); + if (unlikely (dest == nullptr)) return_trace (false); + memcpy (dest, varStore, size_); + return_trace (true); + } + + unsigned int get_size () const { return HBUINT16::static_size + size; } + + HBUINT16 size; + VariationStore varStore; + + DEFINE_SIZE_MIN (2 + VariationStore::min_size); +}; + +struct CFF2TopDictValues : TopDictValues<> +{ + void init () + { + TopDictValues<>::init (); + vstoreOffset = 0; + FDSelectOffset = 0; + } + void fini () { TopDictValues<>::fini (); } + + unsigned int calculate_serialized_size () const + { + unsigned int size = 0; + for (unsigned int i = 0; i < get_count (); i++) + { + OpCode op = get_value (i).op; + switch (op) + { + case OpCode_vstore: + case OpCode_FDSelect: + size += OpCode_Size (OpCode_longintdict) + 4 + OpCode_Size (op); + break; + default: + size += TopDictValues<>::calculate_serialized_op_size (get_value (i)); + break; + } + } + return size; + } + + unsigned int vstoreOffset; + unsigned int FDSelectOffset; +}; + +struct CFF2TopDictOpSet : TopDictOpSet<> +{ + static void process_op (OpCode op, NumInterpEnv& env, CFF2TopDictValues& dictval) + { + switch (op) { + case OpCode_FontMatrix: + { + DictVal val; + val.init (); + dictval.add_op (op, env.substr); + env.clear_args (); + } + break; + + case OpCode_vstore: + dictval.vstoreOffset = env.argStack.pop_uint (); + env.clear_args (); + break; + case OpCode_FDSelect: + dictval.FDSelectOffset = env.argStack.pop_uint (); + env.clear_args (); + break; + + default: + SUPER::process_op (op, env, dictval); + /* Record this operand below if stack is empty, otherwise done */ + if (!env.argStack.is_empty ()) return; + } + + if (unlikely (env.in_error ())) return; + + dictval.add_op (op, env.substr); + } + + typedef TopDictOpSet<> SUPER; +}; + +struct CFF2FontDictValues : DictValues +{ + void init () + { + DictValues::init (); + privateDictInfo.init (); + } + void fini () { DictValues::fini (); } + + TableInfo privateDictInfo; +}; + +struct CFF2FontDictOpSet : DictOpSet +{ + static void process_op (OpCode op, NumInterpEnv& env, CFF2FontDictValues& dictval) + { + switch (op) { + case OpCode_Private: + dictval.privateDictInfo.offset = env.argStack.pop_uint (); + dictval.privateDictInfo.size = env.argStack.pop_uint (); + env.clear_args (); + break; + + default: + SUPER::process_op (op, env); + if (!env.argStack.is_empty ()) + return; + } + + if (unlikely (env.in_error ())) return; + + dictval.add_op (op, env.substr); + } + + private: + typedef DictOpSet SUPER; +}; + +template +struct CFF2PrivateDictValues_Base : DictValues +{ + void init () + { + DictValues::init (); + subrsOffset = 0; + localSubrs = &Null(CFF2Subrs); + ivs = 0; + } + void fini () { DictValues::fini (); } + + unsigned int calculate_serialized_size () const + { + unsigned int size = 0; + for (unsigned int i = 0; i < DictValues::get_count; i++) + if (DictValues::get_value (i).op == OpCode_Subrs) + size += OpCode_Size (OpCode_shortint) + 2 + OpCode_Size (OpCode_Subrs); + else + size += DictValues::get_value (i).str.len; + return size; + } + + unsigned int subrsOffset; + const CFF2Subrs *localSubrs; + unsigned int ivs; +}; + +typedef CFF2PrivateDictValues_Base CFF2PrivateDictValues_Subset; +typedef CFF2PrivateDictValues_Base CFF2PrivateDictValues; + +struct CFF2PrivDictInterpEnv : NumInterpEnv +{ + void init (const ByteStr &str) + { + NumInterpEnv::init (str); + ivs = 0; + seen_vsindex = false; + } + + void process_vsindex () + { + if (likely (!seen_vsindex)) + { + set_ivs (argStack.pop_uint ()); + } + seen_vsindex = true; + } + + unsigned int get_ivs () const { return ivs; } + void set_ivs (unsigned int ivs_) { ivs = ivs_; } + + protected: + unsigned int ivs; + bool seen_vsindex; +}; + +struct CFF2PrivateDictOpSet : DictOpSet +{ + static void process_op (OpCode op, CFF2PrivDictInterpEnv& env, CFF2PrivateDictValues& dictval) + { + NumDictVal val; + val.init (); + + switch (op) { + case OpCode_StdHW: + case OpCode_StdVW: + case OpCode_BlueScale: + case OpCode_BlueShift: + case OpCode_BlueFuzz: + case OpCode_ExpansionFactor: + case OpCode_LanguageGroup: + val.single_val = env.argStack.pop_num (); + env.clear_args (); + break; + case OpCode_BlueValues: + case OpCode_OtherBlues: + case OpCode_FamilyBlues: + case OpCode_FamilyOtherBlues: + case OpCode_StemSnapH: + case OpCode_StemSnapV: + env.clear_args (); + break; + case OpCode_Subrs: + dictval.subrsOffset = env.argStack.pop_uint (); + env.clear_args (); + break; + case OpCode_vsindexdict: + env.process_vsindex (); + dictval.ivs = env.get_ivs (); + env.clear_args (); + break; + case OpCode_blenddict: + break; + + default: + DictOpSet::process_op (op, env); + if (!env.argStack.is_empty ()) return; + break; + } + + if (unlikely (env.in_error ())) return; + + dictval.add_op (op, env.substr, val); + } +}; + +struct CFF2PrivateDictOpSet_Subset : DictOpSet +{ + static void process_op (OpCode op, CFF2PrivDictInterpEnv& env, CFF2PrivateDictValues_Subset& dictval) + { + switch (op) { + case OpCode_BlueValues: + case OpCode_OtherBlues: + case OpCode_FamilyBlues: + case OpCode_FamilyOtherBlues: + case OpCode_StdHW: + case OpCode_StdVW: + case OpCode_BlueScale: + case OpCode_BlueShift: + case OpCode_BlueFuzz: + case OpCode_StemSnapH: + case OpCode_StemSnapV: + case OpCode_LanguageGroup: + case OpCode_ExpansionFactor: + env.clear_args (); + break; + + case OpCode_blenddict: + env.clear_args (); + return; + + case OpCode_Subrs: + dictval.subrsOffset = env.argStack.pop_uint (); + env.clear_args (); + break; + + default: + SUPER::process_op (op, env); + if (!env.argStack.is_empty ()) return; + break; + } + + if (unlikely (env.in_error ())) return; + + dictval.add_op (op, env.substr); + } + + private: + typedef DictOpSet SUPER; +}; + +typedef DictInterpreter CFF2TopDict_Interpreter; +typedef DictInterpreter CFF2FontDict_Interpreter; + +}; /* namespace CFF */ + +namespace OT { + +using namespace CFF; + +struct cff2 +{ + static const hb_tag_t tableTag = HB_OT_TAG_cff2; + + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && + likely (version.major == 2)); + } + + template + struct accelerator_templ_t + { + void init (hb_face_t *face) + { + topDict.init (); + fontDicts.init (); + privateDicts.init (); + + this->blob = sc.reference_table (face); + + /* setup for run-time santization */ + sc.init (this->blob); + sc.start_processing (); + + const OT::cff2 *cff2 = this->blob->template as (); + + if (cff2 == &Null(OT::cff2)) + { fini (); return; } + + { /* parse top dict */ + ByteStr topDictStr (cff2 + cff2->topDict, cff2->topDictSize); + if (unlikely (!topDictStr.sanitize (&sc))) { fini (); return; } + CFF2TopDict_Interpreter top_interp; + top_interp.env.init (topDictStr); + topDict.init (); + if (unlikely (!top_interp.interpret (topDict))) { fini (); return; } + } + + globalSubrs = &StructAtOffset (cff2, cff2->topDict + cff2->topDictSize); + varStore = &StructAtOffsetOrNull (cff2, topDict.vstoreOffset); + charStrings = &StructAtOffsetOrNull (cff2, topDict.charStringsOffset); + fdArray = &StructAtOffsetOrNull (cff2, topDict.FDArrayOffset); + fdSelect = &StructAtOffsetOrNull (cff2, topDict.FDSelectOffset); + + if (((varStore != &Null(CFF2VariationStore)) && unlikely (!varStore->sanitize (&sc))) || + (charStrings == &Null(CFF2CharStrings)) || unlikely (!charStrings->sanitize (&sc)) || + (globalSubrs == &Null(CFF2Subrs)) || unlikely (!globalSubrs->sanitize (&sc)) || + (fdArray == &Null(CFF2FDArray)) || unlikely (!fdArray->sanitize (&sc)) || + (((fdSelect != &Null(CFF2FDSelect)) && unlikely (!fdSelect->sanitize (&sc, fdArray->count))))) + { fini (); return; } + + num_glyphs = charStrings->count; + if (num_glyphs != sc.get_num_glyphs ()) + { fini (); return; } + + fdCount = fdArray->count; + privateDicts.resize (fdCount); + + /* parse font dicts and gather private dicts */ + for (unsigned int i = 0; i < fdCount; i++) + { + const ByteStr fontDictStr = (*fdArray)[i]; + if (unlikely (!fontDictStr.sanitize (&sc))) { fini (); return; } + CFF2FontDictValues *font; + CFF2FontDict_Interpreter font_interp; + font_interp.env.init (fontDictStr); + font = fontDicts.push (); + if (unlikely (font == &Crap(CFF2FontDictValues))) { fini (); return; } + font->init (); + if (unlikely (!font_interp.interpret (*font))) { fini (); return; } + + const ByteStr privDictStr (StructAtOffsetOrNull (cff2, font->privateDictInfo.offset), font->privateDictInfo.size); + if (unlikely (!privDictStr.sanitize (&sc))) { fini (); return; } + DictInterpreter priv_interp; + priv_interp.env.init(privDictStr); + privateDicts[i].init (); + if (unlikely (!priv_interp.interpret (privateDicts[i]))) { fini (); return; } + + privateDicts[i].localSubrs = &StructAtOffsetOrNull (privDictStr.str, privateDicts[i].subrsOffset); + if (privateDicts[i].localSubrs != &Null(CFF2Subrs) && + unlikely (!privateDicts[i].localSubrs->sanitize (&sc))) + { fini (); return; } + } + } + + void fini () + { + sc.end_processing (); + fontDicts.fini_deep (); + privateDicts.fini_deep (); + hb_blob_destroy (blob); + blob = nullptr; + } + + bool is_valid () const { return blob != nullptr; } + + protected: + hb_blob_t *blob; + hb_sanitize_context_t sc; + + public: + CFF2TopDictValues topDict; + const CFF2Subrs *globalSubrs; + const CFF2VariationStore *varStore; + const CFF2CharStrings *charStrings; + const CFF2FDArray *fdArray; + const CFF2FDSelect *fdSelect; + unsigned int fdCount; + + hb_vector_t fontDicts; + hb_vector_t privateDicts; + + unsigned int num_glyphs; + }; + + struct accelerator_t : accelerator_templ_t + { + HB_INTERNAL bool get_extents (hb_font_t *font, + hb_codepoint_t glyph, + hb_glyph_extents_t *extents) const; + }; + + typedef accelerator_templ_t accelerator_subset_t; + + bool subset (hb_subset_plan_t *plan) const + { + hb_blob_t *cff2_prime = nullptr; + + bool success = true; + if (hb_subset_cff2 (plan, &cff2_prime)) { + success = success && plan->add_table (HB_OT_TAG_cff2, cff2_prime); + hb_blob_t *head_blob = hb_sanitize_context_t().reference_table (plan->source); + success = success && head_blob && plan->add_table (HB_OT_TAG_head, head_blob); + hb_blob_destroy (head_blob); + } else { + success = false; + } + hb_blob_destroy (cff2_prime); + + return success; + } + + public: + FixedVersion version; /* Version of CFF2 table. set to 0x0200u */ + OffsetTo topDict; /* headerSize = Offset to Top DICT. */ + HBUINT16 topDictSize; /* Top DICT size */ + + public: + DEFINE_SIZE_STATIC (5); +}; + +struct cff2_accelerator_t : cff2::accelerator_t {}; +} /* namespace OT */ + +#endif /* HB_OT_CFF2_TABLE_HH */ 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 cdc610be3ea..7567e52cf1e 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 @@ -41,7 +41,7 @@ namespace OT { struct CmapSubtableFormat0 { - inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const + bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const { hb_codepoint_t gid = codepoint < 256 ? glyphIdArray[codepoint] : 0; if (!gid) @@ -49,14 +49,14 @@ struct CmapSubtableFormat0 *glyph = gid; return true; } - inline void collect_unicodes (hb_set_t *out) const + void collect_unicodes (hb_set_t *out) const { for (unsigned int i = 0; i < 256; i++) if (glyphIdArray[i]) out->add (i); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); @@ -154,7 +154,7 @@ struct CmapSubtableFormat4 return_trace (true); } - static inline size_t get_sub_table_size (const hb_vector_t &segments) + static size_t get_sub_table_size (const hb_vector_t &segments) { size_t segment_size = 0; for (unsigned int i = 0; i < segments.len; i++) @@ -176,8 +176,8 @@ struct CmapSubtableFormat4 + segment_size; } - static inline bool create_sub_table_plan (const hb_subset_plan_t *plan, - hb_vector_t *segments) + static bool create_sub_table_plan (const hb_subset_plan_t *plan, + hb_vector_t *segments) { segment_plan *segment = nullptr; hb_codepoint_t last_gid = 0; @@ -226,11 +226,11 @@ struct CmapSubtableFormat4 struct accelerator_t { - inline accelerator_t (void) {} - inline accelerator_t (const CmapSubtableFormat4 *subtable) { init (subtable); } - inline ~accelerator_t (void) { fini (); } + accelerator_t () {} + accelerator_t (const CmapSubtableFormat4 *subtable) { init (subtable); } + ~accelerator_t () { fini (); } - inline void init (const CmapSubtableFormat4 *subtable) + void init (const CmapSubtableFormat4 *subtable) { segCount = subtable->segCountX2 / 2; endCount = subtable->values.arrayZ; @@ -240,9 +240,9 @@ struct CmapSubtableFormat4 glyphIdArray = idRangeOffset + segCount; glyphIdArrayLength = (subtable->length - 16 - 8 * segCount) / 2; } - inline void fini (void) {} + void fini () {} - inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const + bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const { /* Custom two-array bsearch. */ int min = 0, max = (int) this->segCount - 1; @@ -286,11 +286,11 @@ struct CmapSubtableFormat4 *glyph = gid; return true; } - static inline bool get_glyph_func (const void *obj, hb_codepoint_t codepoint, hb_codepoint_t *glyph) + static bool get_glyph_func (const void *obj, hb_codepoint_t codepoint, hb_codepoint_t *glyph) { return ((const accelerator_t *) obj)->get_glyph (codepoint, glyph); } - inline void collect_unicodes (hb_set_t *out) const + void collect_unicodes (hb_set_t *out) const { unsigned int count = this->segCount; if (count && this->startCount[count - 1] == 0xFFFFu) @@ -327,18 +327,18 @@ struct CmapSubtableFormat4 unsigned int glyphIdArrayLength; }; - inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const + bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const { accelerator_t accel (this); return accel.get_glyph_func (&accel, codepoint, glyph); } - inline void collect_unicodes (hb_set_t *out) const + void collect_unicodes (hb_set_t *out) const { accelerator_t accel (this); accel.collect_unicodes (out); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (unlikely (!c->check_struct (this))) @@ -403,7 +403,7 @@ struct CmapSubtableLongGroup return 0; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); @@ -422,7 +422,7 @@ DECLARE_NULL_NAMESPACE_BYTES (OT, CmapSubtableLongGroup); template struct CmapSubtableTrimmed { - inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const + bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const { /* Rely on our implicit array bound-checking. */ hb_codepoint_t gid = glyphIdArray[codepoint - startCharCode]; @@ -431,7 +431,7 @@ struct CmapSubtableTrimmed *glyph = gid; return true; } - inline void collect_unicodes (hb_set_t *out) const + void collect_unicodes (hb_set_t *out) const { hb_codepoint_t start = startCharCode; unsigned int count = glyphIdArray.len; @@ -440,7 +440,7 @@ struct CmapSubtableTrimmed out->add (start + i); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && glyphIdArray.sanitize (c)); @@ -466,7 +466,7 @@ struct CmapSubtableLongSegmented { friend struct cmap; - inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const + bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const { hb_codepoint_t gid = T::group_get_glyph (groups.bsearch (codepoint), codepoint); if (!gid) @@ -475,7 +475,7 @@ struct CmapSubtableLongSegmented return true; } - inline void collect_unicodes (hb_set_t *out) const + void collect_unicodes (hb_set_t *out) const { for (unsigned int i = 0; i < this->groups.len; i++) { out->add_range (this->groups[i].startCharCode, @@ -484,19 +484,18 @@ struct CmapSubtableLongSegmented } } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && groups.sanitize (c)); } - inline bool serialize (hb_serialize_context_t *c, - const hb_vector_t &group_data) + bool serialize (hb_serialize_context_t *c, + const hb_vector_t &group_data) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (*this))) return_trace (false); - Supplier supplier (group_data, group_data.len); - if (unlikely (!groups.serialize (c, supplier, group_data.len))) return_trace (false); + if (unlikely (!groups.serialize (c, group_data.as_array ()))) return_trace (false); return true; } @@ -513,8 +512,8 @@ struct CmapSubtableLongSegmented struct CmapSubtableFormat12 : CmapSubtableLongSegmented { - static inline hb_codepoint_t group_get_glyph (const CmapSubtableLongGroup &group, - hb_codepoint_t u) + static hb_codepoint_t group_get_glyph (const CmapSubtableLongGroup &group, + hb_codepoint_t u) { return likely (group.startCharCode <= group.endCharCode) ? group.glyphID + (u - group.startCharCode) : 0; } @@ -531,13 +530,13 @@ struct CmapSubtableFormat12 : CmapSubtableLongSegmented return CmapSubtableLongSegmented::serialize (c, groups); } - static inline size_t get_sub_table_size (const hb_vector_t &groups) + static size_t get_sub_table_size (const hb_vector_t &groups) { return 16 + 12 * groups.len; } - static inline bool create_sub_table_plan (const hb_subset_plan_t *plan, - hb_vector_t *groups) + static bool create_sub_table_plan (const hb_subset_plan_t *plan, + hb_vector_t *groups) { CmapSubtableLongGroup *group = nullptr; @@ -570,9 +569,9 @@ struct CmapSubtableFormat12 : CmapSubtableLongSegmented } private: - static inline bool _is_gid_consecutive (CmapSubtableLongGroup *group, - hb_codepoint_t cp, - hb_codepoint_t new_gid) + static bool _is_gid_consecutive (CmapSubtableLongGroup *group, + hb_codepoint_t cp, + hb_codepoint_t new_gid) { return (cp - 1 == group->endCharCode) && new_gid == group->glyphID + (cp - group->startCharCode); @@ -582,8 +581,8 @@ struct CmapSubtableFormat12 : CmapSubtableLongSegmented struct CmapSubtableFormat13 : CmapSubtableLongSegmented { - static inline hb_codepoint_t group_get_glyph (const CmapSubtableLongGroup &group, - hb_codepoint_t u HB_UNUSED) + static hb_codepoint_t group_get_glyph (const CmapSubtableLongGroup &group, + hb_codepoint_t u HB_UNUSED) { return group.glyphID; } }; @@ -596,14 +595,14 @@ typedef enum struct UnicodeValueRange { - inline int cmp (const hb_codepoint_t &codepoint) const + int cmp (const hb_codepoint_t &codepoint) const { if (codepoint < startUnicodeValue) return -1; if (codepoint > startUnicodeValue + additionalCount) return +1; return 0; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); @@ -618,7 +617,7 @@ struct UnicodeValueRange struct DefaultUVS : SortedArrayOf { - inline void collect_unicodes (hb_set_t *out) const + void collect_unicodes (hb_set_t *out) const { unsigned int count = len; for (unsigned int i = 0; i < count; i++) @@ -636,12 +635,12 @@ struct DefaultUVS : SortedArrayOf struct UVSMapping { - inline int cmp (const hb_codepoint_t &codepoint) const + int cmp (const hb_codepoint_t &codepoint) const { return unicodeValue.cmp (codepoint); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); @@ -655,7 +654,7 @@ struct UVSMapping struct NonDefaultUVS : SortedArrayOf { - inline void collect_unicodes (hb_set_t *out) const + void collect_unicodes (hb_set_t *out) const { unsigned int count = len; for (unsigned int i = 0; i < count; i++) @@ -668,9 +667,9 @@ struct NonDefaultUVS : SortedArrayOf struct VariationSelectorRecord { - inline glyph_variant_t get_glyph (hb_codepoint_t codepoint, - hb_codepoint_t *glyph, - const void *base) const + glyph_variant_t get_glyph (hb_codepoint_t codepoint, + hb_codepoint_t *glyph, + const void *base) const { if ((base+defaultUVS).bfind (codepoint)) return GLYPH_VARIANT_USE_DEFAULT; @@ -683,18 +682,18 @@ struct VariationSelectorRecord return GLYPH_VARIANT_NOT_FOUND; } - inline void collect_unicodes (hb_set_t *out, const void *base) const + void collect_unicodes (hb_set_t *out, const void *base) const { (base+defaultUVS).collect_unicodes (out); (base+nonDefaultUVS).collect_unicodes (out); } - inline int cmp (const hb_codepoint_t &variation_selector) const + int cmp (const hb_codepoint_t &variation_selector) const { return varSelector.cmp (variation_selector); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -713,26 +712,26 @@ struct VariationSelectorRecord struct CmapSubtableFormat14 { - inline glyph_variant_t get_glyph_variant (hb_codepoint_t codepoint, - hb_codepoint_t variation_selector, - hb_codepoint_t *glyph) const + glyph_variant_t get_glyph_variant (hb_codepoint_t codepoint, + hb_codepoint_t variation_selector, + hb_codepoint_t *glyph) const { return record.bsearch (variation_selector).get_glyph (codepoint, glyph, this); } - inline void collect_variation_selectors (hb_set_t *out) const + void collect_variation_selectors (hb_set_t *out) const { unsigned int count = record.len; for (unsigned int i = 0; i < count; i++) out->add (record.arrayZ[i].varSelector); } - inline void collect_variation_unicodes (hb_codepoint_t variation_selector, - hb_set_t *out) const + void collect_variation_unicodes (hb_codepoint_t variation_selector, + hb_set_t *out) const { record.bsearch (variation_selector).collect_unicodes (out, this); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -753,8 +752,8 @@ struct CmapSubtable { /* Note: We intentionally do NOT implement subtable formats 2 and 8. */ - inline bool get_glyph (hb_codepoint_t codepoint, - hb_codepoint_t *glyph) const + bool get_glyph (hb_codepoint_t codepoint, + hb_codepoint_t *glyph) const { switch (u.format) { case 0: return u.format0 .get_glyph (codepoint, glyph); @@ -767,7 +766,7 @@ struct CmapSubtable default: return false; } } - inline void collect_unicodes (hb_set_t *out) const + void collect_unicodes (hb_set_t *out) const { switch (u.format) { case 0: u.format0 .collect_unicodes (out); return; @@ -781,7 +780,7 @@ struct CmapSubtable } } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (!u.format.sanitize (c)) return_trace (false); @@ -815,7 +814,7 @@ struct CmapSubtable struct EncodingRecord { - inline int cmp (const EncodingRecord &other) const + int cmp (const EncodingRecord &other) const { int ret; ret = platformID.cmp (other.platformID); @@ -825,7 +824,7 @@ struct EncodingRecord return 0; } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -842,11 +841,11 @@ struct EncodingRecord struct cmap { - static const hb_tag_t tableTag = HB_OT_TAG_cmap; + enum { tableTag = HB_OT_TAG_cmap }; struct subset_plan { - inline size_t final_size () const + size_t final_size () const { return 4 // header + 8 * 3 // 3 EncodingRecord @@ -858,8 +857,8 @@ struct cmap hb_vector_t format12_groups; }; - inline bool _create_plan (const hb_subset_plan_t *plan, - subset_plan *cmap_plan) const + bool _create_plan (const hb_subset_plan_t *plan, + subset_plan *cmap_plan) const { if (unlikely (!CmapSubtableFormat4::create_sub_table_plan (plan, &cmap_plan->format4_segments))) return false; @@ -867,10 +866,10 @@ struct cmap return CmapSubtableFormat12::create_sub_table_plan (plan, &cmap_plan->format12_groups); } - inline bool _subset (const hb_subset_plan_t *plan, - const subset_plan &cmap_subset_plan, - size_t dest_sz, - void *dest) const + bool _subset (const hb_subset_plan_t *plan, + const subset_plan &cmap_subset_plan, + size_t dest_sz, + void *dest) const { hb_serialize_context_t c (dest, dest_sz); @@ -928,7 +927,7 @@ struct cmap return true; } - inline bool subset (hb_subset_plan_t *plan) const + bool subset (hb_subset_plan_t *plan) const { subset_plan cmap_subset_plan; @@ -995,7 +994,7 @@ struct cmap struct accelerator_t { - inline void init (hb_face_t *face) + void init (hb_face_t *face) { this->table = hb_sanitize_context_t ().reference_table (face); bool symbol; @@ -1031,22 +1030,19 @@ struct cmap } } - inline void fini (void) - { - this->table.destroy (); - } + void fini () { this->table.destroy (); } - inline bool get_nominal_glyph (hb_codepoint_t unicode, + bool get_nominal_glyph (hb_codepoint_t unicode, hb_codepoint_t *glyph) const { if (unlikely (!this->get_glyph_funcZ)) return false; return this->get_glyph_funcZ (this->get_glyph_data, unicode, 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) const + 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) const { if (unlikely (!this->get_glyph_funcZ)) return 0; @@ -1064,9 +1060,9 @@ struct cmap return done; } - inline bool get_variation_glyph (hb_codepoint_t unicode, - hb_codepoint_t variation_selector, - hb_codepoint_t *glyph) const + bool get_variation_glyph (hb_codepoint_t unicode, + hb_codepoint_t variation_selector, + hb_codepoint_t *glyph) const { switch (this->subtable_uvs->get_glyph_variant (unicode, variation_selector, @@ -1080,16 +1076,16 @@ struct cmap return get_nominal_glyph (unicode, glyph); } - inline void collect_unicodes (hb_set_t *out) const + void collect_unicodes (hb_set_t *out) const { subtable->collect_unicodes (out); } - inline void collect_variation_selectors (hb_set_t *out) const + void collect_variation_selectors (hb_set_t *out) const { subtable_uvs->collect_variation_selectors (out); } - inline void collect_variation_unicodes (hb_codepoint_t variation_selector, - hb_set_t *out) const + void collect_variation_unicodes (hb_codepoint_t variation_selector, + hb_set_t *out) const { subtable_uvs->collect_variation_unicodes (variation_selector, out); } @@ -1100,16 +1096,16 @@ struct cmap hb_codepoint_t *glyph); template - static inline bool get_glyph_from (const void *obj, - hb_codepoint_t codepoint, - hb_codepoint_t *glyph) + static bool get_glyph_from (const void *obj, + hb_codepoint_t codepoint, + hb_codepoint_t *glyph) { const Type *typed_obj = (const Type *) obj; return typed_obj->get_glyph (codepoint, glyph); } template - static inline bool get_glyph_from_symbol (const void *obj, + static bool get_glyph_from_symbol (const void *obj, hb_codepoint_t codepoint, hb_codepoint_t *glyph) { @@ -1144,8 +1140,8 @@ struct cmap protected: - inline const CmapSubtable *find_subtable (unsigned int platform_id, - unsigned int encoding_id) const + const CmapSubtable *find_subtable (unsigned int platform_id, + unsigned int encoding_id) const { EncodingRecord key; key.platformID.set (platform_id); @@ -1160,7 +1156,7 @@ struct cmap public: - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && 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 47774fd8f0a..b1971a7615b 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 @@ -45,13 +45,13 @@ namespace OT { struct SmallGlyphMetrics { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); } - inline void get_extents (hb_glyph_extents_t *extents) const + void get_extents (hb_glyph_extents_t *extents) const { extents->x_bearing = bearingX; extents->y_bearing = bearingY; @@ -79,7 +79,7 @@ struct BigGlyphMetrics : SmallGlyphMetrics struct SBitLineMetrics { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); @@ -108,7 +108,7 @@ struct SBitLineMetrics struct IndexSubtableHeader { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); @@ -124,7 +124,7 @@ struct IndexSubtableHeader template struct IndexSubtableFormat1Or3 { - inline bool sanitize (hb_sanitize_context_t *c, unsigned int glyph_count) const + bool sanitize (hb_sanitize_context_t *c, unsigned int glyph_count) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -155,7 +155,7 @@ struct IndexSubtableFormat3 : IndexSubtableFormat1Or3 {}; struct IndexSubtable { - inline bool sanitize (hb_sanitize_context_t *c, unsigned int glyph_count) const + bool sanitize (hb_sanitize_context_t *c, unsigned int glyph_count) const { TRACE_SANITIZE (this); if (!u.header.sanitize (c)) return_trace (false); @@ -166,7 +166,7 @@ struct IndexSubtable } } - inline bool get_extents (hb_glyph_extents_t *extents HB_UNUSED) const + bool get_extents (hb_glyph_extents_t *extents HB_UNUSED) const { switch (u.header.indexFormat) { case 2: case 5: /* TODO */ @@ -201,7 +201,7 @@ struct IndexSubtable struct IndexSubtableRecord { - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -209,8 +209,8 @@ struct IndexSubtableRecord offsetToSubtable.sanitize (c, base, lastGlyphIndex - firstGlyphIndex + 1)); } - inline bool get_extents (hb_glyph_extents_t *extents, - const void *base) const + bool get_extents (hb_glyph_extents_t *extents, + const void *base) const { return (base+offsetToSubtable).get_extents (extents); } @@ -237,7 +237,7 @@ struct IndexSubtableArray { friend struct CBDT; - inline bool sanitize (hb_sanitize_context_t *c, unsigned int count) const + bool sanitize (hb_sanitize_context_t *c, unsigned int count) const { TRACE_SANITIZE (this); return_trace (indexSubtablesZ.sanitize (c, count, this)); @@ -265,7 +265,7 @@ struct BitmapSizeTable friend struct CBLC; friend struct CBDT; - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -332,9 +332,9 @@ struct CBLC { friend struct CBDT; - static const hb_tag_t tableTag = HB_OT_TAG_CBLC; + enum { tableTag = HB_OT_TAG_CBLC }; - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -378,11 +378,11 @@ struct CBLC struct CBDT { - static const hb_tag_t tableTag = HB_OT_TAG_CBDT; + enum { tableTag = HB_OT_TAG_CBDT }; struct accelerator_t { - inline void init (hb_face_t *face) + void init (hb_face_t *face) { cblc = hb_sanitize_context_t().reference_table (face); cbdt = hb_sanitize_context_t().reference_table (face); @@ -390,14 +390,14 @@ struct CBDT upem = hb_face_get_upem (face); } - inline void fini (void) + void fini () { this->cblc.destroy (); this->cbdt.destroy (); } - inline bool get_extents (hb_font_t *font, hb_codepoint_t glyph, - hb_glyph_extents_t *extents) const + bool get_extents (hb_font_t *font, hb_codepoint_t glyph, + hb_glyph_extents_t *extents) const { const void *base; const BitmapSizeTable &strike = this->cblc->choose_strike (font); @@ -452,7 +452,7 @@ struct CBDT return true; } - inline hb_blob_t* reference_png (hb_font_t *font, + hb_blob_t* reference_png (hb_font_t *font, hb_codepoint_t glyph) const { const void *base; @@ -505,7 +505,7 @@ struct CBDT return hb_blob_get_empty (); } - inline bool has_data () const { return cbdt.get_length (); } + bool has_data () const { return cbdt.get_length (); } private: hb_blob_ptr_t cblc; @@ -514,7 +514,7 @@ struct CBDT unsigned int upem; }; - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && 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 84c34332556..3883604a535 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-colr-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-colr-table.hh @@ -39,7 +39,7 @@ namespace OT { struct LayerRecord { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); @@ -63,10 +63,10 @@ struct LayerRecord struct BaseGlyphRecord { - inline int cmp (hb_codepoint_t g) const + int cmp (hb_codepoint_t g) const { return g < glyphId ? -1 : g > glyphId ? 1 : 0; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -87,14 +87,14 @@ struct BaseGlyphRecord struct COLR { - static const hb_tag_t tableTag = HB_OT_TAG_COLR; + enum { tableTag = HB_OT_TAG_COLR }; - inline bool has_data (void) const { return numBaseGlyphs; } + bool has_data () const { return numBaseGlyphs; } - inline unsigned int get_glyph_layers (hb_codepoint_t glyph, - unsigned int start_offset, - unsigned int *count, /* IN/OUT. May be NULL. */ - hb_ot_color_layer_t *layers /* OUT. May be NULL. */) const + unsigned int get_glyph_layers (hb_codepoint_t glyph, + unsigned int start_offset, + unsigned int *count, /* IN/OUT. May be NULL. */ + hb_ot_color_layer_t *layers /* OUT. May be NULL. */) const { const BaseGlyphRecord &record = (this+baseGlyphsZ).bsearch (numBaseGlyphs, glyph); @@ -114,7 +114,7 @@ struct COLR return glyph_layers.len; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && 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 332f0dd7452..bd57d8a3591 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 @@ -48,39 +48,36 @@ struct CPALV1Tail friend struct CPAL; private: - inline hb_ot_color_palette_flags_t - get_palette_flags (const void *base, - unsigned int palette_index, - unsigned int palette_count) const + hb_ot_color_palette_flags_t get_palette_flags (const void *base, + unsigned int palette_index, + unsigned int palette_count) const { if (!paletteFlagsZ) return HB_OT_COLOR_PALETTE_FLAG_DEFAULT; return (hb_ot_color_palette_flags_t) (uint32_t) (base+paletteFlagsZ).as_array (palette_count)[palette_index]; } - inline hb_ot_name_id_t - get_palette_name_id (const void *base, - unsigned int palette_index, - unsigned int palette_count) const + hb_ot_name_id_t get_palette_name_id (const void *base, + unsigned int palette_index, + unsigned int palette_count) const { if (!paletteLabelsZ) return HB_OT_NAME_ID_INVALID; return (base+paletteLabelsZ).as_array (palette_count)[palette_index]; } - inline hb_ot_name_id_t - get_color_name_id (const void *base, - unsigned int color_index, - unsigned int color_count) const + hb_ot_name_id_t get_color_name_id (const void *base, + unsigned int color_index, + unsigned int color_count) const { if (!colorLabelsZ) return HB_OT_NAME_ID_INVALID; return (base+colorLabelsZ).as_array (color_count)[color_index]; } public: - inline bool sanitize (hb_sanitize_context_t *c, - const void *base, - unsigned int palette_count, - unsigned int color_count) const + bool sanitize (hb_sanitize_context_t *c, + const void *base, + unsigned int palette_count, + unsigned int color_count) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -110,29 +107,29 @@ typedef HBUINT32 BGRAColor; struct CPAL { - static const hb_tag_t tableTag = HB_OT_TAG_CPAL; + enum { tableTag = HB_OT_TAG_CPAL }; - inline bool has_data (void) const { return numPalettes; } + bool has_data () const { return numPalettes; } - inline unsigned int get_size (void) const + unsigned int get_size () const { return min_size + numPalettes * sizeof (colorRecordIndicesZ[0]); } - inline unsigned int get_palette_count () const { return numPalettes; } - inline unsigned int get_color_count () const { return numColors; } + unsigned int get_palette_count () const { return numPalettes; } + unsigned int get_color_count () const { return numColors; } - inline hb_ot_color_palette_flags_t get_palette_flags (unsigned int palette_index) const + hb_ot_color_palette_flags_t get_palette_flags (unsigned int palette_index) const { return v1 ().get_palette_flags (this, palette_index, numPalettes); } - inline hb_ot_name_id_t get_palette_name_id (unsigned int palette_index) const + hb_ot_name_id_t get_palette_name_id (unsigned int palette_index) const { return v1 ().get_palette_name_id (this, palette_index, numPalettes); } - inline hb_ot_name_id_t get_color_name_id (unsigned int color_index) const + hb_ot_name_id_t get_color_name_id (unsigned int color_index) const { return v1 ().get_color_name_id (this, color_index, numColors); } - inline unsigned int get_palette_colors (unsigned int palette_index, - unsigned int start_offset, - unsigned int *color_count, /* IN/OUT. May be NULL. */ - hb_color_t *colors /* OUT. May be NULL. */) const + unsigned int get_palette_colors (unsigned int palette_index, + unsigned int start_offset, + unsigned int *color_count, /* IN/OUT. May be NULL. */ + hb_color_t *colors /* OUT. May be NULL. */) const { if (unlikely (palette_index >= numPalettes)) { @@ -156,14 +153,14 @@ struct CPAL } private: - inline const CPALV1Tail& v1 (void) const + const CPALV1Tail& v1 () const { if (version == 0) return Null(CPALV1Tail); return StructAfter (*this); } public: - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-sbix-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-sbix-table.hh index 08dee2a0c67..ed93d6526b5 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-sbix-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-sbix-table.hh @@ -62,20 +62,20 @@ struct SBIXGlyph struct SBIXStrike { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && imageOffsetsZ.sanitize_shallow (c, c->get_num_glyphs () + 1)); } - inline hb_blob_t *get_glyph_blob (unsigned int glyph_id, - hb_blob_t *sbix_blob, - hb_tag_t file_type, - int *x_offset, - int *y_offset, - unsigned int num_glyphs, - unsigned int *strike_ppem) const + hb_blob_t *get_glyph_blob (unsigned int glyph_id, + hb_blob_t *sbix_blob, + hb_tag_t file_type, + int *x_offset, + int *y_offset, + unsigned int num_glyphs, + unsigned int *strike_ppem) const { if (unlikely (!ppem)) return hb_blob_get_empty (); /* To get Null() object out of the way. */ @@ -130,43 +130,36 @@ struct SBIXStrike struct sbix { - static const hb_tag_t tableTag = HB_OT_TAG_sbix; + enum { tableTag = HB_OT_TAG_sbix }; - inline bool has_data (void) const { return version; } + bool has_data () const { return version; } - inline const SBIXStrike &get_strike (unsigned int i) const { return this+strikes[i]; } + const SBIXStrike &get_strike (unsigned int i) const { return this+strikes[i]; } struct accelerator_t { - inline void init (hb_face_t *face) + void init (hb_face_t *face) { table = hb_sanitize_context_t().reference_table (face); num_glyphs = face->get_num_glyphs (); } + void fini () { table.destroy (); } - inline void fini (void) - { - table.destroy (); - } - - inline bool has_data () const - { - return table->has_data (); - } + bool has_data () const { return table->has_data (); } - inline bool get_extents (hb_font_t *font, - hb_codepoint_t glyph, - hb_glyph_extents_t *extents) const + bool get_extents (hb_font_t *font, + hb_codepoint_t glyph, + hb_glyph_extents_t *extents) const { /* We only support PNG right now, and following function checks type. */ return get_png_extents (font, glyph, extents); } - inline hb_blob_t *reference_png (hb_font_t *font, - hb_codepoint_t glyph_id, - int *x_offset, - int *y_offset, - unsigned int *available_ppem) const + hb_blob_t *reference_png (hb_font_t *font, + hb_codepoint_t glyph_id, + int *x_offset, + int *y_offset, + unsigned int *available_ppem) const { return choose_strike (font).get_glyph_blob (glyph_id, table.get_blob (), HB_TAG ('p','n','g',' '), @@ -176,7 +169,7 @@ struct sbix private: - inline const SBIXStrike &choose_strike (hb_font_t *font) const + const SBIXStrike &choose_strike (hb_font_t *font) const { unsigned count = table->strikes.len; if (unlikely (!count)) @@ -226,9 +219,9 @@ struct sbix DEFINE_SIZE_STATIC (29); }; - inline bool get_png_extents (hb_font_t *font, - hb_codepoint_t glyph, - hb_glyph_extents_t *extents) const + bool get_png_extents (hb_font_t *font, + hb_codepoint_t glyph, + hb_glyph_extents_t *extents) const { /* Following code is safe to call even without data. * But faster to short-circuit. */ @@ -267,7 +260,7 @@ struct sbix unsigned int num_glyphs; }; - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && 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 ad3551035c8..554453f7594 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 @@ -40,17 +40,17 @@ namespace OT { struct SVGDocumentIndexEntry { - inline int cmp (hb_codepoint_t g) const + int cmp (hb_codepoint_t g) const { return g < startGlyphID ? -1 : g > endGlyphID ? 1 : 0; } - inline hb_blob_t *reference_blob (hb_blob_t *svg_blob, unsigned int index_offset) const + hb_blob_t *reference_blob (hb_blob_t *svg_blob, unsigned int index_offset) const { return hb_blob_create_sub_blob (svg_blob, index_offset + (unsigned int) svgDoc, svgDocLength); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -73,40 +73,32 @@ struct SVGDocumentIndexEntry struct SVG { - static const hb_tag_t tableTag = HB_OT_TAG_SVG; + enum { tableTag = HB_OT_TAG_SVG }; - inline bool has_data (void) const { return svgDocEntries; } + bool has_data () const { return svgDocEntries; } struct accelerator_t { - inline void init (hb_face_t *face) - { - table = hb_sanitize_context_t().reference_table (face); - } + void init (hb_face_t *face) + { table = hb_sanitize_context_t().reference_table (face); } + void fini () { table.destroy (); } - inline void fini (void) - { - table.destroy (); - } - - inline hb_blob_t *reference_blob_for_glyph (hb_codepoint_t glyph_id) const + hb_blob_t *reference_blob_for_glyph (hb_codepoint_t glyph_id) const { return table->get_glyph_entry (glyph_id).reference_blob (table.get_blob (), table->svgDocEntries); } - inline bool has_data () const { return table->has_data (); } + bool has_data () const { return table->has_data (); } private: hb_blob_ptr_t table; }; - inline const SVGDocumentIndexEntry &get_glyph_entry (hb_codepoint_t glyph_id) const - { - return (this+svgDocEntries).bsearch (glyph_id); - } + const SVGDocumentIndexEntry &get_glyph_entry (hb_codepoint_t glyph_id) const + { return (this+svgDocEntries).bsearch (glyph_id); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color.h b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color.h index a4f2053291e..49646bf3ac2 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color.h +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color.h @@ -71,7 +71,7 @@ hb_ot_color_palette_color_get_name_id (hb_face_t *face, typedef enum { /*< flags >*/ HB_OT_COLOR_PALETTE_FLAG_DEFAULT = 0x00000000u, HB_OT_COLOR_PALETTE_FLAG_USABLE_WITH_LIGHT_BACKGROUND = 0x00000001u, - HB_OT_COLOR_PALETTE_FLAG_USABLE_WITH_DARK_BACKGROUND = 0x00000002u, + HB_OT_COLOR_PALETTE_FLAG_USABLE_WITH_DARK_BACKGROUND = 0x00000002u } hb_ot_color_palette_flags_t; HB_EXTERN hb_ot_color_palette_flags_t diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-deprecated.h b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-deprecated.h new file mode 100644 index 00000000000..bce51b71e78 --- /dev/null +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-deprecated.h @@ -0,0 +1,107 @@ +/* + * Copyright © 2018 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_OT_H_IN +#error "Include instead." +#endif + +#ifndef HB_OT_DEPRECATED_H +#define HB_OT_DEPRECATED_H + +#include "hb.h" +#include "hb-ot-name.h" + + +HB_BEGIN_DECLS + +#ifndef HB_DISABLE_DEPRECATED + + +/* 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); + + +/** + * HB_OT_VAR_NO_AXIS_INDEX: + * + * Since: 1.4.2 + * Deprecated: 2.2.0 + */ +#define HB_OT_VAR_NO_AXIS_INDEX 0xFFFFFFFFu + +/** + * hb_ot_var_axis_t: + * + * Since: 1.4.2 + * Deprecated: 2.2.0 + */ +typedef struct hb_ot_var_axis_t +{ + hb_tag_t tag; + hb_ot_name_id_t name_id; + float min_value; + float default_value; + float max_value; +} hb_ot_var_axis_t; + +HB_EXTERN HB_DEPRECATED_FOR (hb_ot_var_get_axis_infos) unsigned int +hb_ot_var_get_axes (hb_face_t *face, + unsigned int start_offset, + unsigned int *axes_count /* IN/OUT */, + hb_ot_var_axis_t *axes_array /* OUT */); + +HB_EXTERN HB_DEPRECATED_FOR (hb_ot_var_find_axis_info) hb_bool_t +hb_ot_var_find_axis (hb_face_t *face, + hb_tag_t axis_tag, + unsigned int *axis_index, + hb_ot_var_axis_t *axis_info); + + +#endif + +HB_END_DECLS + +#endif /* HB_OT_DEPRECATED_H */ 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 c7dafdd4ab9..9b17526b7e4 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 @@ -28,6 +28,8 @@ #include "hb-ot-cmap-table.hh" #include "hb-ot-glyf-table.hh" +#include "hb-ot-cff1-table.hh" +#include "hb-ot-cff2-table.hh" #include "hb-ot-hmtx-table.hh" #include "hb-ot-kern-table.hh" #include "hb-ot-name-table.hh" @@ -49,7 +51,7 @@ void hb_ot_face_t::init0 (hb_face_t *face) #undef HB_OT_ACCELERATOR #undef HB_OT_TABLE } -void hb_ot_face_t::fini (void) +void hb_ot_face_t::fini () { #define HB_OT_TABLE(Namespace, Type) Type.fini (); #define HB_OT_ACCELERATOR(Namespace, Type) HB_OT_TABLE (Namespace, Type) 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 4a3260626c2..7f47ba6cb8e 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 @@ -47,6 +47,8 @@ HB_OT_ACCELERATOR(OT, post) \ HB_OT_TABLE(OT, kern) \ HB_OT_ACCELERATOR(OT, glyf) \ + HB_OT_ACCELERATOR(OT, cff1) \ + HB_OT_ACCELERATOR(OT, cff2) \ HB_OT_TABLE(OT, VORG) \ HB_OT_ACCELERATOR(OT, name) \ HB_OT_TABLE(OT, OS2) \ @@ -90,7 +92,7 @@ HB_OT_TABLES struct hb_ot_face_t { HB_INTERNAL void init0 (hb_face_t *face); - HB_INTERNAL void fini (void); + HB_INTERNAL void fini (); #define HB_OT_TABLE_ORDER(Namespace, Type) \ HB_PASTE (ORDER_, HB_PASTE (Namespace, HB_PASTE (_, Type))) 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 7c91362509c..c080f0fd937 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 @@ -34,6 +34,8 @@ #include "hb-ot-cmap-table.hh" #include "hb-ot-glyf-table.hh" +#include "hb-ot-cff1-table.hh" +#include "hb-ot-cff2-table.hh" #include "hb-ot-hmtx-table.hh" #include "hb-ot-kern-table.hh" #include "hb-ot-os2-table.hh" @@ -181,6 +183,10 @@ hb_ot_get_glyph_extents (hb_font_t *font, bool ret = ot_face->sbix->get_extents (font, glyph, extents); if (!ret) ret = ot_face->glyf->get_extents (glyph, extents); + if (!ret) + ret = ot_face->cff1->get_extents (glyph, extents); + if (!ret) + ret = ot_face->cff2->get_extents (font, glyph, extents); if (!ret) ret = ot_face->CBDT->get_extents (font, glyph, extents); // TODO Hook up side-bearings variations. @@ -244,12 +250,12 @@ hb_ot_get_font_v_extents (hb_font_t *font, } #if HB_USE_ATEXIT -static void free_static_ot_funcs (void); +static void free_static_ot_funcs (); #endif static struct hb_ot_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t { - static inline hb_font_funcs_t *create (void) + static hb_font_funcs_t *create () { hb_font_funcs_t *funcs = hb_font_funcs_create (); @@ -279,14 +285,14 @@ static struct hb_ot_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_tcheck_struct (this)); + } + + public: + HBUINT16 rangeMaxPPEM; /* Upper limit of range, in PPEM */ + HBUINT16 rangeGaspBehavior; + /* Flags describing desired rasterizer behavior. */ + public: + DEFINE_SIZE_STATIC (4); +}; + +struct gasp +{ + enum { tableTag = HB_OT_TAG_gasp }; + + const GaspRange &get_gasp_range (unsigned int i) const + { return gaspRanges[i]; } + + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && + gaspRanges.sanitize (c)); + } + + protected: + HBUINT16 version; /* Version number (set to 1) */ + ArrayOf + gaspRanges; /* Number of records to follow + * Sorted by ppem */ + public: + DEFINE_SIZE_ARRAY (4, gaspRanges); +}; + +} /* namespace OT */ + + +#endif /* HB_OT_GASP_TABLE_HH */ 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 c88f43385b4..a6dec40d240 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 @@ -45,9 +45,9 @@ struct loca { friend struct glyf; - static const hb_tag_t tableTag = HB_OT_TAG_loca; + enum { tableTag = HB_OT_TAG_loca }; - inline bool sanitize (hb_sanitize_context_t *c HB_UNUSED) const + bool sanitize (hb_sanitize_context_t *c HB_UNUSED) const { TRACE_SANITIZE (this); return_trace (true); @@ -71,9 +71,9 @@ struct loca struct glyf { - static const hb_tag_t tableTag = HB_OT_TAG_glyf; + enum { tableTag = HB_OT_TAG_glyf }; - inline bool sanitize (hb_sanitize_context_t *c HB_UNUSED) const + bool sanitize (hb_sanitize_context_t *c HB_UNUSED) const { TRACE_SANITIZE (this); /* We don't check for anything specific here. The users of the @@ -81,7 +81,7 @@ struct glyf return_trace (true); } - inline bool subset (hb_subset_plan_t *plan) const + bool subset (hb_subset_plan_t *plan) const { hb_blob_t *glyf_prime = nullptr; hb_blob_t *loca_prime = nullptr; @@ -153,7 +153,7 @@ struct glyf HBUINT16 flags; GlyphID glyphIndex; - inline unsigned int get_size (void) const + unsigned int get_size () const { unsigned int size = min_size; // arg1 and 2 are int16 @@ -177,7 +177,7 @@ struct glyf const char *glyph_end; const CompositeGlyphHeader *current; - inline bool move_to_next () + bool move_to_next () { if (current->flags & CompositeGlyphHeader::MORE_COMPONENTS) { @@ -191,7 +191,7 @@ struct glyf return false; } - inline bool in_range (const CompositeGlyphHeader *composite) const + bool in_range (const CompositeGlyphHeader *composite) const { return (const char *) composite >= glyph_start && ((const char *) composite + CompositeGlyphHeader::min_size) <= glyph_end @@ -199,7 +199,7 @@ struct glyf } }; - static inline bool get_iterator (const char * glyph_data, + static bool get_iterator (const char * glyph_data, unsigned int length, CompositeGlyphHeader::Iterator *iterator /* OUT */) { @@ -228,7 +228,7 @@ struct glyf struct accelerator_t { - inline void init (hb_face_t *face) + void init (hb_face_t *face) { memset (this, 0, sizeof (accelerator_t)); @@ -244,7 +244,7 @@ struct glyf num_glyphs = MAX (1u, loca_table.get_length () / (short_offset ? 2 : 4)) - 1; } - inline void fini (void) + void fini () { loca_table.destroy (); glyf_table.destroy (); @@ -255,8 +255,8 @@ struct glyf * If true is returned a pointer to the composite glyph will be written into * composite. */ - inline bool get_composite (hb_codepoint_t glyph, - CompositeGlyphHeader::Iterator *composite /* OUT */) const + bool get_composite (hb_codepoint_t glyph, + CompositeGlyphHeader::Iterator *composite /* OUT */) const { if (unlikely (!num_glyphs)) return false; @@ -271,15 +271,18 @@ struct glyf } enum simple_glyph_flag_t { + FLAG_ON_CURVE = 0x01, FLAG_X_SHORT = 0x02, FLAG_Y_SHORT = 0x04, FLAG_REPEAT = 0x08, FLAG_X_SAME = 0x10, - FLAG_Y_SAME = 0x20 + FLAG_Y_SAME = 0x20, + FLAG_RESERVED1 = 0x40, + FLAG_RESERVED2 = 0x80 }; /* based on FontTools _g_l_y_f.py::trim */ - inline bool remove_padding (unsigned int start_offset, + bool remove_padding (unsigned int start_offset, unsigned int *end_offset) const { if (*end_offset - start_offset < GlyphHeader::static_size) return true; @@ -351,7 +354,7 @@ struct glyf return true; } - inline bool get_offsets (hb_codepoint_t glyph, + bool get_offsets (hb_codepoint_t glyph, unsigned int *start_offset /* OUT */, unsigned int *end_offset /* OUT */) const { @@ -378,10 +381,10 @@ struct glyf return true; } - inline bool get_instruction_offsets (unsigned int start_offset, - unsigned int end_offset, - unsigned int *instruction_start /* OUT */, - unsigned int *instruction_end /* OUT */) const + bool get_instruction_offsets (unsigned int start_offset, + unsigned int end_offset, + unsigned int *instruction_start /* OUT */, + unsigned int *instruction_end /* OUT */) const { if (end_offset - start_offset < GlyphHeader::static_size) { @@ -437,8 +440,7 @@ struct glyf return true; } - inline bool get_extents (hb_codepoint_t glyph, - hb_glyph_extents_t *extents) const + bool get_extents (hb_codepoint_t glyph, hb_glyph_extents_t *extents) const { unsigned int start_offset, end_offset; if (!get_offsets (glyph, &start_offset, &end_offset)) 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 0fea24bca24..48421ee2cbb 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 @@ -47,21 +47,19 @@ struct DeviceRecord unsigned int sizeDeviceRecord; hb_subset_plan_t *subset_plan; - inline void init (const DeviceRecord *source_device_record, - unsigned int sizeDeviceRecord, - hb_subset_plan_t *subset_plan) + void init (const DeviceRecord *source_device_record, + unsigned int sizeDeviceRecord, + hb_subset_plan_t *subset_plan) { this->source_device_record = source_device_record; this->sizeDeviceRecord = sizeDeviceRecord; this->subset_plan = subset_plan; } - inline unsigned int len () const - { - return this->subset_plan->glyphs.len; - } + unsigned int len () const + { return this->subset_plan->glyphs.len; } - inline const HBUINT8* operator [] (unsigned int i) const + const HBUINT8* operator [] (unsigned int i) const { if (unlikely (i >= len ())) return nullptr; hb_codepoint_t gid = this->subset_plan->glyphs [i]; @@ -72,12 +70,10 @@ struct DeviceRecord } }; - static inline unsigned int get_size (unsigned int count) - { - return hb_ceil_to_4 (min_size + count * HBUINT8::static_size); - } + static unsigned int get_size (unsigned int count) + { return hb_ceil_to_4 (min_size + count * HBUINT8::static_size); } - inline bool serialize (hb_serialize_context_t *c, const SubsetView &subset_view) + bool serialize (hb_serialize_context_t *c, const SubsetView &subset_view) { TRACE_SERIALIZE (this); @@ -106,7 +102,7 @@ struct DeviceRecord return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c, unsigned int sizeDeviceRecord) const + bool sanitize (hb_sanitize_context_t *c, unsigned int sizeDeviceRecord) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -123,14 +119,12 @@ struct DeviceRecord struct hdmx { - static const hb_tag_t tableTag = HB_OT_TAG_hdmx; + enum { tableTag = HB_OT_TAG_hdmx }; - inline unsigned int get_size (void) const - { - return min_size + numRecords * sizeDeviceRecord; - } + unsigned int get_size () const + { return min_size + numRecords * sizeDeviceRecord; } - inline const DeviceRecord& operator [] (unsigned int i) const + const DeviceRecord& operator [] (unsigned int i) const { /* XXX Null(DeviceRecord) is NOT safe as it's num-glyphs lengthed. * https://github.com/harfbuzz/harfbuzz/issues/1300 */ @@ -138,7 +132,7 @@ struct hdmx return StructAtOffset (&this->firstDeviceRecord, i * sizeDeviceRecord); } - inline bool serialize (hb_serialize_context_t *c, const hdmx *source_hdmx, hb_subset_plan_t *plan) + bool serialize (hb_serialize_context_t *c, const hdmx *source_hdmx, hb_subset_plan_t *plan) { TRACE_SERIALIZE (this); @@ -160,12 +154,12 @@ struct hdmx return_trace (true); } - static inline size_t get_subsetted_size (const hdmx *source_hdmx, hb_subset_plan_t *plan) + static size_t get_subsetted_size (const hdmx *source_hdmx, hb_subset_plan_t *plan) { return min_size + source_hdmx->numRecords * DeviceRecord::get_size (plan->glyphs.len); } - inline bool subset (hb_subset_plan_t *plan) const + bool subset (hb_subset_plan_t *plan) const { size_t dest_size = get_subsetted_size (this, plan); hdmx *dest = (hdmx *) malloc (dest_size); @@ -196,7 +190,7 @@ struct hdmx return result; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-head-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-head-table.hh index 602e365ce5d..41062ca326a 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-head-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-head-table.hh @@ -45,16 +45,29 @@ struct head { friend struct OffsetTable; - static const hb_tag_t tableTag = HB_OT_TAG_head; + enum { tableTag = HB_OT_TAG_head }; - inline unsigned int get_upem (void) const + unsigned int get_upem () const { unsigned int upem = unitsPerEm; /* If no valid head table found, assume 1000, which matches typical Type1 usage. */ return 16 <= upem && upem <= 16384 ? upem : 1000; } - inline bool sanitize (hb_sanitize_context_t *c) const + enum mac_style_flag_t { + BOLD = 1u<<0, + ITALIC = 1u<<1, + UNDERLINE = 1u<<2, + OUTLINE = 1u<<3, + SHADOW = 1u<<4, + CONDENSED = 1u<<5 + }; + + bool is_bold () const { return macStyle & BOLD; } + bool is_italic () const { return macStyle & ITALIC; } + bool is_condensed () const { return macStyle & CONDENSED; } + + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hhea-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hhea-table.hh index 3336cadd472..7bc1817eefe 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hhea-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hhea-table.hh @@ -45,7 +45,7 @@ namespace OT { template struct _hea { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && likely (version.major == 1)); @@ -86,10 +86,10 @@ struct _hea }; struct hhea : _hea { - static const hb_tag_t tableTag = HB_OT_TAG_hhea; + enum { tableTag = HB_OT_TAG_hhea }; }; struct vhea : _hea { - static const hb_tag_t tableTag = HB_OT_TAG_vhea; + enum { tableTag = HB_OT_TAG_vhea }; }; 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 091b601173f..fa74a0e3858 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 @@ -56,7 +56,7 @@ struct LongMetric template struct hmtxvmtx { - inline bool sanitize (hb_sanitize_context_t *c HB_UNUSED) const + bool sanitize (hb_sanitize_context_t *c HB_UNUSED) const { TRACE_SANITIZE (this); /* We don't check for anything specific here. The users of the @@ -65,7 +65,7 @@ struct hmtxvmtx } - inline bool subset_update_header (hb_subset_plan_t *plan, + bool subset_update_header (hb_subset_plan_t *plan, unsigned int num_hmetrics) const { hb_blob_t *src_blob = hb_sanitize_context_t ().reference_table (plan->source, H::tableTag); @@ -86,7 +86,7 @@ struct hmtxvmtx return result; } - inline bool subset (hb_subset_plan_t *plan) const + bool subset (hb_subset_plan_t *plan) const { typename T::accelerator_t _mtx; _mtx.init (plan->source); @@ -186,22 +186,18 @@ struct hmtxvmtx { friend struct hmtxvmtx; - inline void init (hb_face_t *face, + void init (hb_face_t *face, unsigned int default_advance_ = 0) { default_advance = default_advance_ ? default_advance_ : hb_face_get_upem (face); bool got_font_extents = false; - if (T::os2Tag) + if (T::os2Tag != HB_TAG_NONE && face->table.OS2->is_typo_metrics ()) { -#define USE_TYPO_METRICS (1u<<7) - if (0 != (face->table.OS2->fsSelection & USE_TYPO_METRICS)) - { - ascender = abs (face->table.OS2->sTypoAscender); - descender = -abs (face->table.OS2->sTypoDescender); - line_gap = face->table.OS2->sTypoLineGap; - got_font_extents = (ascender | descender) != 0; - } + ascender = abs (face->table.OS2->sTypoAscender); + descender = -abs (face->table.OS2->sTypoDescender); + line_gap = face->table.OS2->sTypoLineGap; + got_font_extents = (ascender | descender) != 0; } hb_blob_t *_hea_blob = hb_sanitize_context_t().reference_table (face); @@ -238,14 +234,14 @@ struct hmtxvmtx var_table = hb_sanitize_context_t().reference_table (face, T::variationsTag); } - inline void fini (void) + void fini () { table.destroy (); var_table.destroy (); } /* TODO Add variations version. */ - inline unsigned int get_side_bearing (hb_codepoint_t glyph) const + unsigned int get_side_bearing (hb_codepoint_t glyph) const { if (glyph < num_advances) return table->longMetricZ[glyph].sb; @@ -257,7 +253,7 @@ struct hmtxvmtx return bearings[glyph - num_advances]; } - inline unsigned int get_advance (hb_codepoint_t glyph) const + unsigned int get_advance (hb_codepoint_t glyph) const { if (unlikely (glyph >= num_metrics)) { @@ -273,8 +269,8 @@ struct hmtxvmtx return table->longMetricZ[MIN (glyph, (uint32_t) num_advances - 1)].advance; } - inline unsigned int get_advance (hb_codepoint_t glyph, - hb_font_t *font) const + unsigned int get_advance (hb_codepoint_t glyph, + hb_font_t *font) const { unsigned int advance = get_advance (glyph); if (likely (glyph < num_metrics)) @@ -327,14 +323,14 @@ struct hmtxvmtx }; struct hmtx : hmtxvmtx { - static const hb_tag_t tableTag = HB_OT_TAG_hmtx; - static const hb_tag_t variationsTag = HB_OT_TAG_HVAR; - static const hb_tag_t os2Tag = HB_OT_TAG_OS2; + enum { tableTag = HB_OT_TAG_hmtx }; + enum { variationsTag = HB_OT_TAG_HVAR }; + enum { os2Tag = HB_OT_TAG_OS2 }; }; struct vmtx : hmtxvmtx { - static const hb_tag_t tableTag = HB_OT_TAG_vmtx; - static const hb_tag_t variationsTag = HB_OT_TAG_VVAR; - static const hb_tag_t os2Tag = HB_TAG_NONE; + enum { tableTag = HB_OT_TAG_vmtx }; + enum { variationsTag = HB_OT_TAG_VVAR }; + enum { os2Tag = HB_TAG_NONE }; }; struct hmtx_accelerator_t : hmtx::accelerator_t {}; 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 b57ebaea8dc..5e75d083b76 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 @@ -44,7 +44,7 @@ namespace OT { template struct KernSubTableFormat3 { - inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const + int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const { hb_array_t kernValue = kernValueZ.as_array (kernValueCount); hb_array_t leftClass = StructAfter > (kernValue).as_array (glyphCount); @@ -59,7 +59,7 @@ struct KernSubTableFormat3 return kernValue[kernIndex[i]]; } - inline bool apply (AAT::hb_aat_apply_context_t *c) const + bool apply (AAT::hb_aat_apply_context_t *c) const { TRACE_APPLY (this); @@ -75,7 +75,7 @@ struct KernSubTableFormat3 return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -109,10 +109,10 @@ struct KernSubTableFormat3 template struct KernSubTable { - inline unsigned int get_size (void) const { return u.header.length; } - inline unsigned int get_type (void) const { return u.header.format; } + unsigned int get_size () const { return u.header.length; } + unsigned int get_type () const { return u.header.format; } - inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const + int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const { switch (get_type ()) { /* This method hooks up to hb_font_t's get_h_kerning. Only support Format0. */ @@ -122,7 +122,7 @@ struct KernSubTable } template - inline typename context_t::return_t dispatch (context_t *c) const + typename context_t::return_t dispatch (context_t *c) const { unsigned int subtable_type = get_type (); TRACE_DISPATCH (this, subtable_type); @@ -135,7 +135,7 @@ struct KernSubTable } } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (unlikely (!u.header.sanitize (c) || @@ -160,11 +160,11 @@ struct KernSubTable struct KernOTSubTableHeader { - static const bool apple = false; + enum { apple = false }; typedef AAT::ObsoleteTypes Types; - inline unsigned int tuple_count (void) const { return 0; } - inline bool is_horizontal (void) const { return (coverage & Horizontal); } + unsigned int tuple_count () const { return 0; } + bool is_horizontal () const { return (coverage & Horizontal); } enum Coverage { @@ -178,7 +178,7 @@ struct KernOTSubTableHeader Variation = 0x00u, }; - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); @@ -197,8 +197,8 @@ struct KernOT : AAT::KerxTable { friend struct AAT::KerxTable; - static const hb_tag_t tableTag = HB_OT_TAG_kern; - static const uint16_t minVersion = 0; + enum { tableTag = HB_OT_TAG_kern }; + enum { minVersion = 0u }; typedef KernOTSubTableHeader SubTableHeader; typedef SubTableHeader::Types Types; @@ -215,11 +215,11 @@ struct KernOT : AAT::KerxTable struct KernAATSubTableHeader { - static const bool apple = true; + enum { apple = true }; typedef AAT::ObsoleteTypes Types; - inline unsigned int tuple_count (void) const { return 0; } - inline bool is_horizontal (void) const { return !(coverage & Vertical); } + unsigned int tuple_count () const { return 0; } + bool is_horizontal () const { return !(coverage & Vertical); } enum Coverage { @@ -231,7 +231,7 @@ struct KernAATSubTableHeader Backwards = 0x00u, }; - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); @@ -252,8 +252,8 @@ struct KernAAT : AAT::KerxTable { friend struct AAT::KerxTable; - static const hb_tag_t tableTag = HB_OT_TAG_kern; - static const uint32_t minVersion = 0x00010000u; + enum { tableTag = HB_OT_TAG_kern }; + enum { minVersion = 0x00010000u }; typedef KernAATSubTableHeader SubTableHeader; typedef SubTableHeader::Types Types; @@ -269,12 +269,12 @@ struct KernAAT : AAT::KerxTable struct kern { - static const hb_tag_t tableTag = HB_OT_TAG_kern; + enum { tableTag = HB_OT_TAG_kern }; - inline bool has_data (void) const { return u.version32; } - inline unsigned int get_type (void) const { return u.major; } + bool has_data () const { return u.version32; } + unsigned int get_type () const { return u.major; } - inline bool has_state_machine (void) const + bool has_state_machine () const { switch (get_type ()) { case 0: return u.ot.has_state_machine (); @@ -283,7 +283,7 @@ struct kern } } - inline bool has_cross_stream (void) const + bool has_cross_stream () const { switch (get_type ()) { case 0: return u.ot.has_cross_stream (); @@ -292,7 +292,7 @@ struct kern } } - inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const + int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const { switch (get_type ()) { case 0: return u.ot.get_h_kerning (left, right); @@ -301,11 +301,11 @@ struct kern } } - inline bool apply (AAT::hb_aat_apply_context_t *c) const + bool apply (AAT::hb_aat_apply_context_t *c) const { return dispatch (c); } template - inline typename context_t::return_t dispatch (context_t *c) const + typename context_t::return_t dispatch (context_t *c) const { unsigned int subtable_type = get_type (); TRACE_DISPATCH (this, subtable_type); @@ -316,7 +316,7 @@ struct kern } } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (!u.version32.sanitize (c)) return_trace (false); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-base-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-base-table.hh index fb57e76242e..6c39932670f 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-base-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-base-table.hh @@ -44,9 +44,9 @@ namespace OT { struct BaseCoordFormat1 { - inline hb_position_t get_coord () const { return coordinate; } + hb_position_t get_coord () const { return coordinate; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -61,13 +61,13 @@ struct BaseCoordFormat1 struct BaseCoordFormat2 { - inline hb_position_t get_coord () const + hb_position_t get_coord () const { /* TODO */ return coordinate; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); @@ -85,9 +85,9 @@ struct BaseCoordFormat2 struct BaseCoordFormat3 { - inline hb_position_t get_coord (hb_font_t *font, - const VariationStore &var_store, - hb_direction_t direction) const + hb_position_t get_coord (hb_font_t *font, + const VariationStore &var_store, + hb_direction_t direction) const { const Device &device = this+deviceTable; return coordinate + (HB_DIRECTION_IS_VERTICAL (direction) ? @@ -96,7 +96,7 @@ struct BaseCoordFormat3 } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -116,9 +116,9 @@ struct BaseCoordFormat3 struct BaseCoord { - inline hb_position_t get_coord (hb_font_t *font, - const VariationStore &var_store, - hb_direction_t direction) const + hb_position_t get_coord (hb_font_t *font, + const VariationStore &var_store, + hb_direction_t direction) const { switch (u.format) { case 1: return u.format1.get_coord (); @@ -128,7 +128,7 @@ struct BaseCoord } } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (unlikely (!u.format.sanitize (c))) return_trace (false); @@ -162,13 +162,13 @@ struct FeatMinMaxRecord 0; } - inline void get_min_max (const BaseCoord **min, const BaseCoord **max) const + void get_min_max (const BaseCoord **min, const BaseCoord **max) const { if (likely (min)) *min = &(this+minCoord); if (likely (max)) *max = &(this+maxCoord); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -194,7 +194,7 @@ struct FeatMinMaxRecord struct MinMax { - inline void get_min_max (hb_tag_t feature_tag, + void get_min_max (hb_tag_t feature_tag, const BaseCoord **min, const BaseCoord **max) const { @@ -213,7 +213,7 @@ struct MinMax } } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -241,13 +241,13 @@ struct MinMax struct BaseValues { - inline const BaseCoord &get_base_coord (int baseline_tag_index) const + const BaseCoord &get_base_coord (int baseline_tag_index) const { if (baseline_tag_index == -1) baseline_tag_index = defaultIndex; return this+baseCoords[baseline_tag_index]; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -280,10 +280,10 @@ struct BaseLangSysRecord 0; } - inline const MinMax &get_min_max () const + const MinMax &get_min_max () const { return this+minMax; } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -301,7 +301,7 @@ struct BaseLangSysRecord struct BaseScript { - inline const MinMax &get_min_max (hb_tag_t language_tag) const + const MinMax &get_min_max (hb_tag_t language_tag) const { /* TODO Replace hb_bsearch() with .bsearch(). */ const BaseLangSysRecord* record = (const BaseLangSysRecord *) @@ -312,13 +312,12 @@ struct BaseScript return record ? record->get_min_max () : this+defaultMinMax; } - inline const BaseCoord &get_base_coord (int baseline_tag_index) const + const BaseCoord &get_base_coord (int baseline_tag_index) const { return (this+baseValues).get_base_coord (baseline_tag_index); } - inline bool is_empty () const - { return !baseValues; } + bool is_empty () const { return !baseValues; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -355,10 +354,10 @@ struct BaseScriptRecord 0; } - inline const BaseScript &get_base_script (const BaseScriptList *list) const + const BaseScript &get_base_script (const BaseScriptList *list) const { return list+baseScript; } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -377,7 +376,7 @@ struct BaseScriptRecord struct BaseScriptList { - inline const BaseScriptRecord *find_record (hb_tag_t script) const + const BaseScriptRecord *find_record (hb_tag_t script) const { /* TODO Replace hb_bsearch() with .bsearch(). */ return (const BaseScriptRecord *) hb_bsearch (&script, baseScriptRecords.arrayZ, @@ -387,7 +386,7 @@ struct BaseScriptList } /* TODO: Or client should handle fallback? */ - inline const BaseScript &get_base_script (hb_tag_t script) const + const BaseScript &get_base_script (hb_tag_t script) const { const BaseScriptRecord *record = find_record (script); if (!record) record = find_record ((hb_script_t) HB_TAG ('D','F','L','T')); @@ -395,7 +394,7 @@ struct BaseScriptList return record ? record->get_base_script (this) : Null (BaseScript); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -412,7 +411,7 @@ struct BaseScriptList struct Axis { - inline bool get_baseline (hb_ot_layout_baseline_t baseline, + bool get_baseline (hb_ot_layout_baseline_t baseline, hb_tag_t script_tag, hb_tag_t language_tag, const BaseCoord **coord) const @@ -425,11 +424,11 @@ struct Axis return true; } - inline bool get_min_max (hb_tag_t script_tag, - hb_tag_t language_tag, - hb_tag_t feature_tag, - const BaseCoord **min_coord, - const BaseCoord **max_coord) const + bool get_min_max (hb_tag_t script_tag, + hb_tag_t language_tag, + hb_tag_t feature_tag, + const BaseCoord **min_coord, + const BaseCoord **max_coord) const { const BaseScript &base_script = (this+baseScriptList).get_base_script (script_tag); if (base_script.is_empty ()) return false; @@ -439,7 +438,7 @@ struct Axis return true; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -465,20 +464,20 @@ struct Axis struct BASE { - static const hb_tag_t tableTag = HB_OT_TAG_BASE; + enum { tableTag = HB_OT_TAG_BASE }; - inline const Axis &get_axis (hb_direction_t direction) const + const Axis &get_axis (hb_direction_t direction) const { return HB_DIRECTION_IS_VERTICAL (direction) ? this+vAxis : this+hAxis; } - inline const VariationStore &get_var_store () const + const VariationStore &get_var_store () const { return version.to_int () < 0x00010001u ? Null (VariationStore) : this+varStore; } - inline bool get_baseline (hb_font_t *font, - hb_ot_layout_baseline_t baseline, - hb_direction_t direction, - hb_tag_t script_tag, - hb_tag_t language_tag, - hb_position_t *base) const + bool get_baseline (hb_font_t *font, + hb_ot_layout_baseline_t baseline, + hb_direction_t direction, + hb_tag_t script_tag, + hb_tag_t language_tag, + hb_position_t *base) const { const BaseCoord *base_coord; if (!get_axis (direction).get_baseline (baseline, script_tag, language_tag, &base_coord)) @@ -491,13 +490,13 @@ struct BASE } /* TODO: Expose this separately sometime? */ - inline bool get_min_max (hb_font_t *font, - hb_direction_t direction, - hb_tag_t script_tag, - hb_tag_t language_tag, - hb_tag_t feature_tag, - hb_position_t *min, - hb_position_t *max) + bool get_min_max (hb_font_t *font, + hb_direction_t direction, + hb_tag_t script_tag, + hb_tag_t language_tag, + hb_tag_t feature_tag, + hb_position_t *min, + hb_position_t *max) { const BaseCoord *min_coord, *max_coord; if (!get_axis (direction).get_min_max (script_tag, language_tag, feature_tag, @@ -510,7 +509,7 @@ struct BASE return true; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && 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 b5af73af64a..d9f5728b65c 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 @@ -86,11 +86,9 @@ struct Record_sanitize_closure_t { template struct Record { - inline int cmp (hb_tag_t a) const { - return tag.cmp (a); - } + int cmp (hb_tag_t a) const { return tag.cmp (a); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); const Record_sanitize_closure_t closure = {tag, base}; @@ -108,15 +106,15 @@ struct Record template struct RecordArrayOf : SortedArrayOf > { - inline const OffsetTo& get_offset (unsigned int i) const + const OffsetTo& get_offset (unsigned int i) const { return (*this)[i].offset; } - inline OffsetTo& get_offset (unsigned int i) + OffsetTo& get_offset (unsigned int i) { return (*this)[i].offset; } - inline const Tag& get_tag (unsigned int i) const + const Tag& get_tag (unsigned int i) const { return (*this)[i].tag; } - inline unsigned int get_tags (unsigned int start_offset, - unsigned int *record_count /* IN/OUT */, - hb_tag_t *record_tags /* OUT */) const + unsigned int get_tags (unsigned int start_offset, + unsigned int *record_count /* IN/OUT */, + hb_tag_t *record_tags /* OUT */) const { if (record_count) { const Record *arr = this->sub_array (start_offset, record_count); @@ -126,7 +124,7 @@ struct RecordArrayOf : SortedArrayOf > } return this->len; } - inline bool find_index (hb_tag_t tag, unsigned int *index) const + bool find_index (hb_tag_t tag, unsigned int *index) const { return this->bfind (tag, index, HB_BFIND_NOT_FOUND_STORE, Index::NOT_FOUND_INDEX); } @@ -135,10 +133,10 @@ struct RecordArrayOf : SortedArrayOf > template struct RecordListOf : RecordArrayOf { - inline const Type& operator [] (unsigned int i) const + const Type& operator [] (unsigned int i) const { return this+this->get_offset (i); } - inline bool subset (hb_subset_context_t *c) const + bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); struct RecordListOf *out = c->serializer->embed (*this); @@ -149,7 +147,7 @@ struct RecordListOf : RecordArrayOf return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (RecordArrayOf::sanitize (c, this)); @@ -159,23 +157,21 @@ struct RecordListOf : RecordArrayOf struct RangeRecord { - inline int cmp (hb_codepoint_t g) const { - return g < start ? -1 : g <= end ? 0 : +1 ; - } + int cmp (hb_codepoint_t g) const + { return g < start ? -1 : g <= end ? 0 : +1; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); } - inline bool intersects (const hb_set_t *glyphs) const + bool intersects (const hb_set_t *glyphs) const { return glyphs->intersects (start, end); } template - inline bool add_coverage (set_t *glyphs) const { - return glyphs->add_range (start, end); - } + bool add_coverage (set_t *glyphs) const + { return glyphs->add_range (start, end); } GlyphID start; /* First GlyphID in the range */ GlyphID end; /* Last GlyphID in the range */ @@ -188,9 +184,9 @@ DECLARE_NULL_NAMESPACE_BYTES (OT, RangeRecord); struct IndexArray : ArrayOf { - inline unsigned int get_indexes (unsigned int start_offset, - unsigned int *_count /* IN/OUT */, - unsigned int *_indexes /* OUT */) const + unsigned int get_indexes (unsigned int start_offset, + unsigned int *_count /* IN/OUT */, + unsigned int *_indexes /* OUT */) const { if (_count) { const HBUINT16 *arr = this->sub_array (start_offset, _count); @@ -201,7 +197,7 @@ struct IndexArray : ArrayOf return this->len; } - inline void add_indexes_to (hb_set_t* output /* OUT */) const + void add_indexes_to (hb_set_t* output /* OUT */) const { output->add_array (arrayZ, len); } @@ -215,33 +211,33 @@ struct Feature; struct LangSys { - inline unsigned int get_feature_count (void) const + unsigned int get_feature_count () const { return featureIndex.len; } - inline hb_tag_t get_feature_index (unsigned int i) const + hb_tag_t get_feature_index (unsigned int i) const { return featureIndex[i]; } - inline unsigned int get_feature_indexes (unsigned int start_offset, - unsigned int *feature_count /* IN/OUT */, - unsigned int *feature_indexes /* OUT */) const + unsigned int get_feature_indexes (unsigned int start_offset, + unsigned int *feature_count /* IN/OUT */, + unsigned int *feature_indexes /* OUT */) const { return featureIndex.get_indexes (start_offset, feature_count, feature_indexes); } - inline void add_feature_indexes_to (hb_set_t *feature_indexes) const + void add_feature_indexes_to (hb_set_t *feature_indexes) const { featureIndex.add_indexes_to (feature_indexes); } - inline bool has_required_feature (void) const { return reqFeatureIndex != 0xFFFFu; } - inline unsigned int get_required_feature_index (void) const + bool has_required_feature () const { return reqFeatureIndex != 0xFFFFu; } + unsigned int get_required_feature_index () const { if (reqFeatureIndex == 0xFFFFu) return Index::NOT_FOUND_INDEX; return reqFeatureIndex;; } - inline bool subset (hb_subset_context_t *c) const + bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); return_trace (c->serializer->embed (*this)); } - inline bool sanitize (hb_sanitize_context_t *c, - const Record_sanitize_closure_t * = nullptr) const + bool sanitize (hb_sanitize_context_t *c, + const Record_sanitize_closure_t * = nullptr) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && featureIndex.sanitize (c)); @@ -260,26 +256,26 @@ DECLARE_NULL_NAMESPACE_BYTES (OT, LangSys); struct Script { - inline unsigned int get_lang_sys_count (void) const + unsigned int get_lang_sys_count () const { return langSys.len; } - inline const Tag& get_lang_sys_tag (unsigned int i) const + const Tag& get_lang_sys_tag (unsigned int i) const { return langSys.get_tag (i); } - inline unsigned int get_lang_sys_tags (unsigned int start_offset, - unsigned int *lang_sys_count /* IN/OUT */, - hb_tag_t *lang_sys_tags /* OUT */) const + unsigned int get_lang_sys_tags (unsigned int start_offset, + unsigned int *lang_sys_count /* IN/OUT */, + hb_tag_t *lang_sys_tags /* OUT */) const { return langSys.get_tags (start_offset, lang_sys_count, lang_sys_tags); } - inline const LangSys& get_lang_sys (unsigned int i) const + const LangSys& get_lang_sys (unsigned int i) const { if (i == Index::NOT_FOUND_INDEX) return get_default_lang_sys (); return this+langSys[i].offset; } - inline bool find_lang_sys_index (hb_tag_t tag, unsigned int *index) const + bool find_lang_sys_index (hb_tag_t tag, unsigned int *index) const { return langSys.find_index (tag, index); } - inline bool has_default_lang_sys (void) const { return defaultLangSys != 0; } - inline const LangSys& get_default_lang_sys (void) const { return this+defaultLangSys; } + bool has_default_lang_sys () const { return defaultLangSys != 0; } + const LangSys& get_default_lang_sys () const { return this+defaultLangSys; } - inline bool subset (hb_subset_context_t *c) const + bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); struct Script *out = c->serializer->embed (*this); @@ -291,8 +287,8 @@ struct Script return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c, - const Record_sanitize_closure_t * = nullptr) const + bool sanitize (hb_sanitize_context_t *c, + const Record_sanitize_closure_t * = nullptr) const { TRACE_SANITIZE (this); return_trace (defaultLangSys.sanitize (c, this) && langSys.sanitize (c, this)); @@ -315,7 +311,7 @@ typedef RecordListOf