diff options
98 files changed, 3121 insertions, 1333 deletions
diff --git a/Build/source/libs/README b/Build/source/libs/README index 20657ee56f0..aa9cc32969e 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.5.1 - checked 01jun19 +harfbuzz 2.5.2 - checked 21jun19 http://www.freedesktop.org/software/harfbuzz/release/ icu 63.1 - checked 8jan19 diff --git a/Build/source/libs/harfbuzz/ChangeLog b/Build/source/libs/harfbuzz/ChangeLog index c235b3cd6cb..ad59f2cfcea 100644 --- a/Build/source/libs/harfbuzz/ChangeLog +++ b/Build/source/libs/harfbuzz/ChangeLog @@ -1,3 +1,8 @@ +2019-06-21 Akira Kakuto <kakuto@w32tex.org> + + Import harfbuzz-2.5.2. + * version.ac, Makefile.am: Adjusted. + 2019-06-01 Akira Kakuto <kakuto@w32tex.org> Import harfbuzz-2.5.1. diff --git a/Build/source/libs/harfbuzz/Makefile.am b/Build/source/libs/harfbuzz/Makefile.am index 80394d67f9b..8194a0d8abf 100644 --- a/Build/source/libs/harfbuzz/Makefile.am +++ b/Build/source/libs/harfbuzz/Makefile.am @@ -73,6 +73,7 @@ libharfbuzz_a_SOURCES = \ @HARFBUZZ_TREE@/src/hb-ot-cmap-table.hh \ @HARFBUZZ_TREE@/src/hb-ot-face.cc \ @HARFBUZZ_TREE@/src/hb-ot-face.hh \ + @HARFBUZZ_TREE@/src/hb-ot-face-table-list.hh \ @HARFBUZZ_TREE@/src/hb-ot-glyf-table.hh \ @HARFBUZZ_TREE@/src/hb-ot-hdmx-table.hh \ @HARFBUZZ_TREE@/src/hb-ot-head-table.hh \ diff --git a/Build/source/libs/harfbuzz/Makefile.in b/Build/source/libs/harfbuzz/Makefile.in index 345a9d0df6d..f3dc800db89 100644 --- a/Build/source/libs/harfbuzz/Makefile.in +++ b/Build/source/libs/harfbuzz/Makefile.in @@ -741,6 +741,7 @@ libharfbuzz_a_SOURCES = @HARFBUZZ_TREE@/src/hb-algs.hh \ @HARFBUZZ_TREE@/src/hb-ot-cmap-table.hh \ @HARFBUZZ_TREE@/src/hb-ot-face.cc \ @HARFBUZZ_TREE@/src/hb-ot-face.hh \ + @HARFBUZZ_TREE@/src/hb-ot-face-table-list.hh \ @HARFBUZZ_TREE@/src/hb-ot-glyf-table.hh \ @HARFBUZZ_TREE@/src/hb-ot-hdmx-table.hh \ @HARFBUZZ_TREE@/src/hb-ot-head-table.hh \ diff --git a/Build/source/libs/harfbuzz/TLpatches/ChangeLog b/Build/source/libs/harfbuzz/TLpatches/ChangeLog index 40c2ec0e294..5c56265b8c9 100644 --- a/Build/source/libs/harfbuzz/TLpatches/ChangeLog +++ b/Build/source/libs/harfbuzz/TLpatches/ChangeLog @@ -1,3 +1,8 @@ +2019-06-21 Akira Kakuto <kakuto@w32tex.org> + + Imported harfbuzz-2.5.2 source tree from: + http://www.freedesktop.org/software/harfbuzz/release/ + 2019-06-01 Akira Kakuto <kakuto@w32tex.org> Imported harfbuzz-2.5.1 source tree from: diff --git a/Build/source/libs/harfbuzz/TLpatches/TL-Changes b/Build/source/libs/harfbuzz/TLpatches/TL-Changes index c3bd0bc15c3..55620760385 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.5.1/ tree as obtained from: +Changes applied to the harfbuzz-2.5.2/ 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 99434ffd35e..218caea4f6e 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.5.1. +# Generated by GNU Autoconf 2.69 for harfbuzz (TeX Live) 2.5.2. # # Report bugs to <tex-k@tug.org>. # @@ -580,8 +580,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='harfbuzz (TeX Live)' PACKAGE_TARNAME='harfbuzz--tex-live-' -PACKAGE_VERSION='2.5.1' -PACKAGE_STRING='harfbuzz (TeX Live) 2.5.1' +PACKAGE_VERSION='2.5.2' +PACKAGE_STRING='harfbuzz (TeX Live) 2.5.2' PACKAGE_BUGREPORT='tex-k@tug.org' PACKAGE_URL='' @@ -1311,7 +1311,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.5.1 to adapt to many kinds of systems. +\`configure' configures harfbuzz (TeX Live) 2.5.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1382,7 +1382,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of harfbuzz (TeX Live) 2.5.1:";; + short | recursive ) echo "Configuration of harfbuzz (TeX Live) 2.5.2:";; esac cat <<\_ACEOF @@ -1487,7 +1487,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -harfbuzz (TeX Live) configure 2.5.1 +harfbuzz (TeX Live) configure 2.5.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2123,7 +2123,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.5.1, which was +It was created by harfbuzz (TeX Live) $as_me 2.5.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -4047,7 +4047,7 @@ fi # Define the identity of the package. PACKAGE='harfbuzz--tex-live-' - VERSION='2.5.1' + VERSION='2.5.2' # Some tools Automake needs. @@ -4241,8 +4241,8 @@ WARNING_CFLAGS=$kpse_cv_warning_cflags HB_VERSION_MAJOR=2 HB_VERSION_MINOR=5 -HB_VERSION_MICRO=1 -HB_VERSION=2.5.1 +HB_VERSION_MICRO=2 +HB_VERSION=2.5.2 ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -7919,7 +7919,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.5.1, which was +This file was extended by harfbuzz (TeX Live) $as_me 2.5.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7985,7 +7985,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.5.1 +harfbuzz (TeX Live) config.status 2.5.2 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 4ffabad1063..c9ba0160c72 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/CMakeLists.txt +++ b/Build/source/libs/harfbuzz/harfbuzz-src/CMakeLists.txt @@ -88,8 +88,6 @@ include_directories(AFTER ${PROJECT_BINARY_DIR}/src ) -add_definitions(-DHAVE_FALLBACK) - # We need PYTHON_EXECUTABLE to be set for running the tests... include (FindPythonInterp) @@ -108,7 +106,7 @@ endmacro () if (UNIX) list(APPEND CMAKE_REQUIRED_LIBRARIES m) endif () -check_funcs(atexit mprotect sysconf getpagesize mmap isatty newlocale strtod_l round) +check_funcs(atexit mprotect sysconf getpagesize mmap isatty newlocale strtod_l) check_include_file(unistd.h HAVE_UNISTD_H) if (${HAVE_UNISTD_H}) add_definitions(-DHAVE_UNISTD_H) @@ -163,8 +161,6 @@ extract_make_variable(HB_BASE_sources ${SRCSOURCES}) add_prefix_to_list(HB_BASE_sources "${PROJECT_SOURCE_DIR}/src/") extract_make_variable(HB_BASE_headers ${SRCSOURCES}) add_prefix_to_list(HB_BASE_headers "${PROJECT_SOURCE_DIR}/src/") -extract_make_variable(HB_FALLBACK_sources ${SRCSOURCES}) -add_prefix_to_list(HB_FALLBACK_sources "${PROJECT_SOURCE_DIR}/src/") extract_make_variable(HB_SUBSET_sources ${SRCSOURCES}) add_prefix_to_list(HB_SUBSET_sources "${PROJECT_SOURCE_DIR}/src/") @@ -231,8 +227,6 @@ set (HB_VERSION_MICRO ${CMAKE_MATCH_4}) set (project_sources ${HB_BASE_sources} ${HB_BASE_RAGEL_GENERATED_sources} - - ${HB_FALLBACK_sources} ) set (subset_project_sources diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/CONFIG.md b/Build/source/libs/harfbuzz/harfbuzz-src/CONFIG.md new file mode 100644 index 00000000000..98be0363e69 --- /dev/null +++ b/Build/source/libs/harfbuzz/harfbuzz-src/CONFIG.md @@ -0,0 +1,132 @@ +# Configuring HarfBuzz + +Most of the time you will not need any custom configuration. The configuration +options provided by `configure` or `cmake` should be enough. In particular, +if you just want HarfBuzz library plus hb-shape / hb-view utilities, make sure +FreeType and Cairo are available and found during configuration. + +If you are building for distribution, you should more carefully consider whether +you need Glib, ICU, Graphite2, as well as CoreText / Uniscribe / DWrite. Make +sure the relevant ones are enabled. + +If you are building for custom environment (embedded, downloadable app, etc) +where you mostly just want to call `hb_shape()` and the binary size of the +resulting library is very important to you, the rest of this file guides you +through your options to disable features you may not need, in exchange for +binary size savings. + +## Compiler Options + +Make sure you build with your compiler's "optimize for size" option. On `gcc` +this is `-Os`, and can be enabled by passing `CXXFLAGS=-Os` either to `configure` +(sticky) or to `make` (non-sticky). On clang there is an even more extreme flag, +`-Oz`. + +HarfBuzz heavily uses inline functions and the optimize-size flag can make the +library smaller by 20% or more. Moreover, sometimes, based on the target CPU, +the optimize-size builds perform *faster* as well, thanks to lower code +footprint and caching effects. So, definitely try that even if size is not +extremely tight but you have a huge application. For example, Chrome does +that. Note that this configuration also automatically enables certain internal +optimizations. Search for `HB_OPTIMIZE_SIZE` for details, if you are using +other compilers, or continue reading. + +Another compiler option to consider is "link-time optimization", also known as +'lto'. To enable that, with `gcc` or `clang`, add `-flto` to both `CXXFLAGS` +and `LDFLAGS`, either on `configure` invocation (sticky) or on `make` (non-sticky). +This, also, can have a huge impact on the final size, 20% or more. + +Finally, if you are making a static library build or otherwise linking the +library into your app, make sure your linker removes unused functions. This +can be tricky and differ from environment to environment, but you definitely +want to make sure this happens. Otherwise, every unused public function will +be adding unneeded bytes to your binary. + +Combining the above three build options should already shrink your library a lot. +The rest of this file shows you ways to shrink the library even further at the +expense of removing functionality (that may not be needed). The remaining +options are all enabled by defining pre-processor macros, which can be done +via `CXXFLAGS` or `CPPFLAGS` similarly. + + +## Unicode-functions + +Access to Unicode data can be configured at compile time as well as run-time. +By default, HarfBuzz ships with its own compact subset of properties from +Unicode Character Database that it needs. This is a highly-optimized +implementation that depending on compile settings (optimize-size or not) +takes around ~40kb or ~60kb. Using this implementation (default) is highly +recommended, as HarfBuzz always ships with data from latest version of Unicode. +This implementation can be disabled by defining `HB_NO_UCD`. + +For example, if you are enabling ICU as a built-in option, or GLib, those +can provide Unicode data as well, so defining `HB_NO_UCD` might save you +space without reducing functionality (to the extent that the Unicode version +of those implementations is recent.) + +If, however, you provide your own Unicode data to HarfBuzz at run-time by +calling `hb_buffer_set_unicode_funcs` on every buffer you create, and you do +not rely on `hb_unicode_funcs_get_default()` results, you can disable the +internal implementation by defining both `HB_NO_UCD` and `HB_NO_UNICODE_FUNCS`. +The latter is needed to guard against accidentally building a library without +any default Unicode implementations. + + +## Font-functions + +Access to certain font functionalities can also be configured at run-time. By +default, HarfBuzz uses an efficient internal implementation of OpenType +functionality for this. This internal implementation is called `hb-ot-font`. +All newly-created `hb_font_t` objects by default use `hb-ot-font`. Using this +is highly recommended, and is what fonts use by default when they are created. + +Most embedded uses will probably use HarfBuzz with FreeType using `hb-ft.h`. +In that case, or if you otherwise provide those functions by calling +`hb_font_set_funcs()` on every font you create, you can disable `hb-ot-font` +without loss of functionality by defining `HB_NO_OT_FONT`. + + +## Thread-safety + +By default HarfBuzz builds as a thread-safe library. The exception is that +the `HB_TINY` predefined configuring (more below) disables thread-safety. + +If you do /not/ need thread-safety in the library (eg. you always call into +HarfBuzz from the same thread), you can disable thread-safety by defining +`HB_NO_MT`. As noted already, this is enabled by `HB_TINY`. + + +## Pre-defined configurations + +The [`hb-config.hh`](src/hb-config.hh) internal header supports three +pre-defined configurations as well grouping of various configuration options. +The pre-defined configurations are: + + * `HB_MINI`: Disables shaping of AAT as well as legacy fonts. Ie. it produces + a capable OpenType shaper only. + + * `HB_LEAN`: Disables various non-shaping functionality in the library, as well + as esoteric or rarely-used shaping features. See the definition for details. + + * `HB_TINY`: Enables both `HB_MINI` and `HB_LEAN` configurations, as well as + disabling thread-safety and debugging, and use size-optimized data tables. + + +## Tailoring configuration + +Most of the time, one of the pre-defined configuration is exactly what one needs. +Sometimes, however, the pre-defined configuration cuts out features that might +be desired in the library. Unfortunately there is no quick way to undo those +configurations from the command-line. But one can add a header file called +`config-override.h` to undefine certain `HB_NO_*` symbols as desired. Then +define `HAVE_CONFIG_OVERRIDE_H` to make `hb-config.hh` include your configuration +overrides at the end. + + +## Notes + +Note that the config option `HB_NO_CFF`, which is enabled by `HB_LEAN` and +`HB_TINY` does /not/ mean that the resulting library won't work with CFF fonts. +The library can shape valid CFF fonts just fine, with or without this option. +This option disables (among other things) the code to calculate glyph exntents +for CFF fonts. diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog b/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog index ff09cf7e9ba..1280bfa50c7 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog +++ b/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog @@ -1,3 +1,1365 @@ +commit 6b44bf85382146b355a5a3cbbfde48166721ce52 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Thu Jun 20 11:57:19 2019 -0700 + + 2.5.2 + + NEWS | 12 ++++++++++++ + configure.ac | 2 +- + src/hb-version.h | 4 ++-- + 3 files changed, 15 insertions(+), 3 deletions(-) + +commit e9f7b338ef599b9cbffa125fe594a9939b8517cb +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Thu Jun 20 11:48:44 2019 -0700 + + [config] Adjust description of HB_LEAN + + https://github.com/harfbuzz/harfbuzz/commit/d84932ba50482b3b47e393714eb77b19173d1f14 + + CONFIG.md | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit fce3bf8127321bb53b14eb8a5528a2347cd9be8a +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Wed Jun 19 20:34:29 2019 -0700 + + [config] Add HB_NO_LAYOUT_COLLECT_GLYPHS + + Part of + + src/hb-config.hh | 1 + + src/hb-ot-layout.cc | 2 ++ + 2 files changed, 3 insertions(+) + +commit 6c725c7799bf4870fb8b4f896a537a2c0f7a1ccc +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Wed Jun 19 20:12:25 2019 -0700 + + [config] Add HB_NO_LAYOUT_FEATURE_PARAMS + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-config.hh | 1 + + src/hb-ot-layout-common.hh | 7 +++++-- + src/hb-ot-layout.cc | 6 ++---- + 3 files changed, 8 insertions(+), 6 deletions(-) + +commit 27de7c44fe80e69c527578c99c26280ba9f26c15 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Wed Jun 19 20:07:02 2019 -0700 + + [config] Add HB_NO_FACE_COLLECT_UNICODES + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-config.hh | 1 + + src/hb-face.cc | 5 ++--- + src/hb-ot-face-table-list.hh | 2 ++ + 3 files changed, 5 insertions(+), 3 deletions(-) + +commit 3caa32d737e7c2b4fe6ccd10950760998524f573 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Wed Jun 19 19:50:54 2019 -0700 + + [config] Add HB_NO_CMAP_LEGACY_SUBTABLES + + Part of https://vimeo.com/331852453/06eec89c65 + + src/hb-config.hh | 1 + + src/hb-ot-cmap-table.hh | 16 ++++++++++++---- + 2 files changed, 13 insertions(+), 4 deletions(-) + +commit 8e3cde67dfa4aa17c0f1156b4a4acd0c95bdbe6f +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Wed Jun 19 19:58:24 2019 -0700 + + Fix MSVC build + + MSVC warning: + + c:\projects\harfbuzz\src\hb-ot-layout-gsubgpos.hh(2732): error C2121: '#': invalid character: possibly the result of a macro expansion [C:\projects\harfbuzz\build\harfbuzz.vcxproj] + + Clang warning for it: + + ./hb-ot-layout-gsubgpos.hh:2729:2: error: embedding a directive within macro arguments has undefined behavior [-Werror,-Wembedded-directive] + + src/hb-ot-layout-gsubgpos.hh | 18 +++++++++++------- + src/hb.hh | 1 + + 2 files changed, 12 insertions(+), 7 deletions(-) + +commit c8f529a07eca06acf2216935921377e7cad8436f +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Wed Jun 19 19:33:15 2019 -0700 + + [config] Add HB_NO_HINTING, enabled by HB_TINY + + Disables HintingDevice tables and Anchors addressing contour points. + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-config.hh | 3 ++- + src/hb-ot-layout-common.hh | 6 ++++++ + src/hb-ot-layout-gpos-table.hh | 7 +++++++ + 3 files changed, 15 insertions(+), 1 deletion(-) + +commit a849873124efea6577b4938b23501d9e4f4af2f4 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Wed Jun 19 19:26:22 2019 -0700 + + [config] Add HB_NO_VAR to disable variations support, enabled by HB_TINY + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-config.hh | 1 + + src/hb-font.cc | 3 ++- + src/hb-ot-face-table-list.hh | 2 ++ + src/hb-ot-layout-common.hh | 34 ++++++++++++++++++++++++++++------ + src/hb-ot-layout-gsubgpos.hh | 18 +++++++++++++++--- + src/hb-ot-var.cc | 7 ++++++- + src/hb-subset-plan.cc | 2 ++ + 7 files changed, 56 insertions(+), 11 deletions(-) + +commit 230adf2c417bbb6b5f367eb857dd6f98bea3ef26 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Wed Jun 19 18:49:52 2019 -0700 + + [config] Add HB_NO_OT_FONT_GLYPH_NAMES + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-config.hh | 1 + + src/hb-ot-face-table-list.hh | 4 +++- + src/hb-ot-font.cc | 5 ++++- + 3 files changed, 8 insertions(+), 2 deletions(-) + +commit b0debc32f6cedfa76a4851aa391f88ed1860955d +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Wed Jun 19 18:42:39 2019 -0700 + + [subset] Simplify collect_name_ids + + src/hb-subset-plan.cc | 19 ++----------------- + 1 file changed, 2 insertions(+), 17 deletions(-) + +commit a5897463d4d0b83cb1bfe4ae1477dac4e3851252 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Wed Jun 19 18:36:35 2019 -0700 + + [config] Add HB_NO_STAT + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-config.hh | 1 + + src/hb-ot-face-table-list.hh | 2 ++ + src/hb-subset-plan.cc | 2 ++ + 3 files changed, 5 insertions(+) + +commit ffc2b8d56e5d35b4dc19499c830d8fc4b643213a +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Wed Jun 19 18:33:29 2019 -0700 + + [config] Don't include name table in face if HB_NO_NAME + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-ot-face-table-list.hh | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 1432df102ebf206592f92677f48bb950871675b3 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Wed Jun 19 18:32:40 2019 -0700 + + [config] Disable hb-ot-font code if HB_NO_OT_FONT + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-ot-font.cc | 5 +++++ + 1 file changed, 5 insertions(+) + +commit b1a2384a5244ea3ea63ca94eb095c4add2cd451d +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Wed Jun 19 17:34:12 2019 -0700 + + [ucd] Print out table sizes + + src/gen-ucd-table.py | 27 +++++++++++++++++++-------- + src/hb-ucd-table.hh | 1 - + 2 files changed, 19 insertions(+), 9 deletions(-) + +commit f4de0c775408e34474a688361fa319251e1a9c18 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Wed Jun 19 17:08:26 2019 -0700 + + [config] Disable AAT map + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-aat-map.cc | 15 +++++++-------- + src/hb-ot-shape.cc | 6 ++++++ + 2 files changed, 13 insertions(+), 8 deletions(-) + +commit d8bf6723a1176ca26e97e8015044c8829ec77c36 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Wed Jun 19 17:04:16 2019 -0700 + + [config] Disable more legacy kerning + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-ot-shape.cc | 4 +++- + src/hb-ot-shape.hh | 8 ++++++++ + 2 files changed, 11 insertions(+), 1 deletion(-) + +commit 43d7048d59b1a0af62b80bd914805bdec74a29d2 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Wed Jun 19 17:02:32 2019 -0700 + + [config] More trak disabling + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-ot-shape.cc | 4 +++- + src/hb-ot-shape.hh | 8 ++++++++ + 2 files changed, 11 insertions(+), 1 deletion(-) + +commit d84932ba50482b3b47e393714eb77b19173d1f14 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Wed Jun 19 16:57:48 2019 -0700 + + [config] add HB_NO_OT_SHAPE_FRACTIONS, enabled in HB_LEAN + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-config.hh | 1 + + src/hb-ot-shape.cc | 9 +++++++++ + src/hb-ot-shape.hh | 10 ++++++++++ + 3 files changed, 20 insertions(+) + +commit eaf4a7364c28663720a9da57bf4d576b6009e17d +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Wed Jun 19 16:51:13 2019 -0700 + + [config] Minor trak disable + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-ot-shape.cc | 2 ++ + 1 file changed, 2 insertions(+) + +commit 971330c0588307bcd73934e44c6343db55b1f5b6 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Wed Jun 19 16:37:35 2019 -0700 + + [config] Add HB_NO_LANGUAGE_PRIVATE_SUBTAG + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-config.hh | 1 + + src/hb-ot-tag.cc | 4 ++++ + 2 files changed, 5 insertions(+) + +commit f642a5fa6c42b145574593a0e18815dc74d3c617 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Wed Jun 19 16:36:09 2019 -0700 + + Restructure code + + src/hb-ot-tag.cc | 44 ++++++++++++++++++++------------------------ + 1 file changed, 20 insertions(+), 24 deletions(-) + +commit d2ff73b256599a655e4ddedbe1ca75abdf837d23 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Wed Jun 19 16:28:08 2019 -0700 + + [config] Remove remaining AAT context bits if HB_NO_OT_KERN + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-aat-layout.cc | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 588697afd0ddf411e8201866ade1f593ccb61aab +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Wed Jun 19 16:24:51 2019 -0700 + + [config] Add HB_NO_OT_KERN, enabled by HB_MINI / HB_NO_LEGACY + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-config.hh | 1 + + src/hb-ot-face-table-list.hh | 6 +++++- + src/hb-ot-layout.cc | 4 ++-- + src/hb-ot-shape.cc | 16 ++++++++++++++-- + src/hb-ot-shape.hh | 4 ++++ + 5 files changed, 26 insertions(+), 5 deletions(-) + +commit 2e3e929d2b0fa6026c55eb92f91de0498fb22646 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Wed Jun 19 15:50:13 2019 -0700 + + Fix build + + src/hb-ot-face-table-list.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 631da9d816da381c5fd4b3cc640c41fda736a96f +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Wed Jun 19 15:36:14 2019 -0700 + + [config] Remove tables from hb_face_t for disabled features + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/Makefile.sources | 1 + + src/hb-ot-face-table-list.hh | 112 +++++++++++++++++++++++++++++++++++++++++++ + src/hb-ot-face.cc | 8 +--- + src/hb-ot-face.hh | 52 ++------------------ + src/hb-ot-layout.cc | 2 + + 5 files changed, 120 insertions(+), 55 deletions(-) + +commit e710888188ff3285a162c25c89d886d9535d9f02 +Author: Misty De Meo <mistydemeo@gmail.com> +Date: Tue Jun 18 15:20:38 2019 -0700 + + coretext: remove trailing macro from SCRATCH_RESTORE + + src/hb-coretext.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 10bac21bb5b25cf20c2198934e99e444625dfd97 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Tue Jun 18 15:15:06 2019 -0700 + + [coretext/uniscribe/directwrite] Remove extra semicolons + + Fixes https://github.com/harfbuzz/harfbuzz/pull/1783 + + src/hb-coretext.cc | 2 +- + src/hb-directwrite.cc | 2 +- + src/hb-uniscribe.cc | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +commit f0b0fd4e78e94315c9d01b9232ebfb09bbfef556 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Tue Jun 18 14:40:24 2019 -0700 + + Remove dead code + + src/hb-ot-layout.cc | 10 ++-------- + 1 file changed, 2 insertions(+), 8 deletions(-) + +commit d7e27cd65a085a76c85cddd93cea48ce4b7be03f +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Tue Jun 18 14:38:05 2019 -0700 + + [config] Don't use VORG table if HB_NO_OT_FONT_CFF + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-ot-font.cc | 2 ++ + 1 file changed, 2 insertions(+) + +commit 37f8ebff5f1973423c7e4ed9dea88881d0642b61 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Tue Jun 18 14:33:49 2019 -0700 + + [config] Fixup for AAT ltag table access + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-aat-layout.hh | 8 -------- + src/hb-ot-name-table.hh | 2 +- + 2 files changed, 1 insertion(+), 9 deletions(-) + +commit f08066ce9a41469e2a7396f0accd61e1c02e5649 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Tue Jun 18 14:29:27 2019 -0700 + + [config] One more morx disabling + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-ot-layout.cc | 3 +++ + 1 file changed, 3 insertions(+) + +commit 231d0257883ec9e8904afae1adfd73f3c225f177 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Tue Jun 18 14:25:52 2019 -0700 + + [config] Don't compile AAT API if HB_NO_AAT + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-aat-layout.cc | 131 ++++++++++++++++----------------------------------- + src/hb-ot-shape.cc | 19 ++++++-- + 2 files changed, 56 insertions(+), 94 deletions(-) + +commit bf9424a9a198b99d49c005536a10f27387630064 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Tue Jun 18 13:31:35 2019 -0700 + + [config] Don't compile unused layout API if HB_NO_LAYOUT_UNUSED + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-ot-layout.cc | 16 ++-------------- + 1 file changed, 2 insertions(+), 14 deletions(-) + +commit eb9798ef733da53e69966054b67752cd8937eb7b +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Tue Jun 18 13:29:55 2019 -0700 + + [config] Dont' compile buffer message API if HB_NO_BUFFER_MESSAGE + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-buffer.cc | 2 ++ + src/hb-buffer.hh | 5 ++++- + 2 files changed, 6 insertions(+), 1 deletion(-) + +commit be1c0ab2186a728eabdf6666632a9f759474f901 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Tue Jun 18 13:26:03 2019 -0700 + + [config] Don't compile buffer serialize API if HB_NO_BUFFER_SERIALIZE + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-buffer-serialize.cc | 19 +++++++------------ + src/test-buffer-serialize.cc | 7 ++++++- + 2 files changed, 13 insertions(+), 13 deletions(-) + +commit bdbabd110cfdb4c59cf24bd500ce63073a5213e4 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Tue Jun 18 13:21:25 2019 -0700 + + Minor header include cleanup + + src/hb-aat-layout.cc | 1 - + src/hb-ot-math.cc | 3 --- + src/hb-ot-name.cc | 1 - + src/hb-ot-var.cc | 4 ++-- + 4 files changed, 2 insertions(+), 7 deletions(-) + +commit 83de3a60ab7383cf3ee25c1f8c33a45a7778d003 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Tue Jun 18 13:18:15 2019 -0700 + + [config] Don't compile color API if HB_NO_COLOR + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-ot-color.cc | 55 +++++++++------------------------------------------- + src/test-ot-color.cc | 9 ++++++++- + 2 files changed, 17 insertions(+), 47 deletions(-) + +commit 350f98ea47aaf0fe008065b92c8b6fe2bc519fa7 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Tue Jun 18 13:11:41 2019 -0700 + + [config] Don't compile name table API if HB_NO_NAME + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-ot-name.cc | 25 +++++-------------------- + src/test-ot-name.cc | 5 ++++- + 2 files changed, 9 insertions(+), 21 deletions(-) + +commit da51a2cb0efae664d4ee83c6036f29a21621e993 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Tue Jun 18 13:09:22 2019 -0700 + + [config] Don't compile math API if HB_NO_MATH + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/hb-ot-math.cc | 47 +++++++---------------------------------------- + 1 file changed, 7 insertions(+), 40 deletions(-) + +commit 737436d3f8aacfd0bd586cd54d7034bae3afc4e1 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Tue Jun 18 13:07:44 2019 -0700 + + Streamline HB_NO_CFF + + src/hb-ot-cff1-table.cc | 7 +++++-- + src/hb-ot-cff2-table.cc | 7 +++++-- + src/hb-subset-cff-common.cc | 7 +++++++ + src/hb-subset-cff1.cc | 7 +++++-- + src/hb-subset-cff2.cc | 7 +++++-- + 5 files changed, 27 insertions(+), 8 deletions(-) + +commit 60653a7adbbd8143d187b3edf33cb7a2dddadf74 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Tue Jun 18 13:01:11 2019 -0700 + + Remove HB_VECTOR_SIZE + + It was cumbersome to get it to work reliably, for dubious performance + gain, mostly in the subsetter maybe... + + Life is easier without. It was disabled forever anyway. + + src/hb-algs.hh | 36 +++++++++--------------------------- + src/hb-null.hh | 4 ++-- + src/hb-static.cc | 4 ++-- + src/hb.hh | 32 -------------------------------- + 4 files changed, 13 insertions(+), 63 deletions(-) + +commit 24060d3aa77f1e1a18960cc61c3d1ac241875507 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Tue Jun 18 12:50:42 2019 -0700 + + Add hb_bitwise_neg + + src/hb-algs.hh | 33 +++++++++++++++++++++------------ + 1 file changed, 21 insertions(+), 12 deletions(-) + +commit 7cf9169078f35299ec0633a7b212256acdd71661 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Tue Jun 18 12:44:03 2019 -0700 + + Remove accidentally left cruft + + src/hb-algs.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6172ec5d879653c536d7cb3d3b3760fbb6d0f3f3 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Tue Jun 18 12:41:56 2019 -0700 + + Remove (unused) posix_memalign fallback + + Was wrong. The returned pointer couldn't be passed to free(). Ouch! + + configure.ac | 2 +- + src/hb.hh | 34 ---------------------------------- + 2 files changed, 1 insertion(+), 35 deletions(-) + +commit eb28d6e48b02a8c49875cfcd084a16c1c66c367e +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Tue Jun 18 12:14:10 2019 +0430 + + [ci] Test no build system builds + + Introduced in aa3450c, let's preserve it + + .circleci/config.yml | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit efef672911dd6c3b80e53294f3fcd59dbb64597a +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Mon Jun 17 22:57:51 2019 -0700 + + Fix cmake build + + Hopefullly. + + CMakeLists.txt | 4 ---- + 1 file changed, 4 deletions(-) + +commit aa3450cac148280f747fb88864b6fcc4ec70cc51 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Mon Jun 17 22:41:49 2019 -0700 + + [config] Don't compile disabled features + + This makes it possible to include all .cc files into build, even if not + building CoreText, Uniscribe, etc. + + This was mostly to help custom builders. But also means that we can + include all files in our own build system. Not sure if we should. + Definitely simplifies things, but slightly only. + + src/Makefile.am | 1 + + src/hb-coretext.cc | 6 ++++++ + src/hb-directwrite.cc | 6 ++++++ + src/hb-ft.cc | 5 +++++ + src/hb-glib.cc | 5 +++++ + src/hb-gobject-enums.cc.tmpl | 7 +++++++ + src/hb-gobject-structs.cc | 5 +++++ + src/hb-graphite2.cc | 7 +++++++ + src/hb-icu.cc | 5 +++++ + src/hb-uniscribe.cc | 4 ++++ + 10 files changed, 51 insertions(+) + +commit 33d8b76e74579a27b06fa788d0bf696a9dd44cc4 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Mon Jun 17 21:54:20 2019 -0700 + + [config] Flesh out CONFIG.md + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + CONFIG.md | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 84 insertions(+), 3 deletions(-) + +commit 23ccd00a3d5033b812f2bebcc5b793a4415b252b +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Mon Jun 17 20:35:04 2019 -0700 + + Minor + + src/hb-config.hh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 23768a99e08cbe691772b7514c023d3184989ff8 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Mon Jun 17 20:29:29 2019 -0700 + + [config] Replace HAVE_FALLBACK with HB_NO_FALLBACK_SHAPE + + This disables fallback shaper in tiny builds. Projects that don't + use our build system and want to disable fallback shaper (eg. Firefox) + should define HB_NO_FALLBACK_SHAPE now. + + Part of https://github.com/harfbuzz/harfbuzz/issues/1652 + + CMakeLists.txt | 2 -- + configure.ac | 8 -------- + src/Makefile.am | 4 ---- + src/Makefile.sources | 5 +---- + src/hb-config.hh | 1 + + src/hb-fallback-shape.cc | 3 +++ + src/hb-shaper-list.hh | 2 +- + 7 files changed, 6 insertions(+), 19 deletions(-) + +commit 3a9394635ffd663d8acd0715236dd01d9f22f3b8 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Mon Jun 17 20:10:36 2019 -0700 + + Add CONFIG.md + + https://github.com/harfbuzz/harfbuzz/issues/1652 + + CONFIG.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ + Makefile.am | 1 + + README.md | 2 ++ + 3 files changed, 54 insertions(+) + +commit 1c56b5d1d8307efd12519556e41fc50c5371f136 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Mon Jun 17 14:23:04 2019 -0700 + + [serialize] Fix copy() calling operator= + + https://github.com/googlefonts/harfbuzz/commit/9f610ae239a11e86f94621e26bc15849b65ce41b#commitcomment-33944686 + + src/hb-serialize.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6492b2345cd913223b0eb931e9e11f7e5ad33049 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Mon Jun 17 14:19:13 2019 -0700 + + Minor + + src/hb-open-type.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 8938dd23c64f80dbd31f87133d9df88cd0c98c1a +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Mon Jun 17 14:12:11 2019 -0700 + + Use injected class name + + src/hb-open-type.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit bfb5569d530a2b65dafd0d9be45d594af9e742ce +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Mon Jun 17 14:06:04 2019 -0700 + + Disable non-OpenType kerning with hb-ft in HB_TINY + + src/hb-ft.cc | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 0819f3ca863af520fe546e6ef0596300e9e28b01 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Mon Jun 17 14:02:47 2019 -0700 + + Deprecate v_kerning callback again + + Part of https://github.com/harfbuzz/harfbuzz/issues/1682 + + docs/harfbuzz-sections.txt | 6 +++--- + src/hb-deprecated.h | 23 +++++++++++++++++++++++ + src/hb-font.cc | 7 +++---- + src/hb-font.h | 20 -------------------- + src/hb-font.hh | 2 +- + 5 files changed, 30 insertions(+), 28 deletions(-) + +commit eb2825c7f140185f41922a371434873a0114ef67 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Mon Jun 17 13:42:53 2019 -0700 + + Minor + + src/hb-ot-font.cc | 1 - + 1 file changed, 1 deletion(-) + +commit 896416bd4c6ac486eb4e1926eaa09d5a9b693763 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Mon Jun 17 13:39:49 2019 -0700 + + Partially revert "[ft/ot] Remove implementation of deprecated kerning funcs" + + This reverts commit 47030b1855f04c0d75899ffb6f5021fea3c19b90. + + Reverts only the hb-ft part, to reinstate non-OpenType kerning with + FreeType. + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1682 + + src/hb-ft.cc | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +commit 2682efb02df72fb254c819cb76fc23592c30fc45 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Mon Jun 17 13:38:08 2019 -0700 + + Revert "Deprecate font kern API" + + This reverts commit d219f899f4b2fb4b39ebc1dff9fb648fc5d6d112. + + API change: Un-deprecate font kern API. + + Part of https://github.com/harfbuzz/harfbuzz/issues/1682 + + We should document that this API is only necessary to hook up + non-OpenType kerning. hb-ot-font will continue to NOT implement them. + + docs/harfbuzz-sections.txt | 16 +++++++------- + src/hb-deprecated.h | 54 ---------------------------------------------- + src/hb-font.cc | 3 --- + src/hb-font.h | 51 +++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 59 insertions(+), 65 deletions(-) + +commit d6cb244f7d63338e0cbfa774c2a32e6e7e06f15b +Author: David Corbett <corbett.dav@husky.neu.edu> +Date: Sat Jun 15 21:38:27 2019 -0400 + + Canonically reorder U+0C55 and U+0C56 + + src/hb-unicode.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 82d4bfb8f3ac30fecce41f8abe59f58ad64ba98a +Author: Michiharu Ariza <ariza@adobe.com> +Date: Fri Jun 14 10:49:42 2019 -0700 + + enable cff subset tests + + add Unicode UCS-4 cmap + fix Unicode bits in OS/2 + add Unicode cmap sub-table in SourceHanSans-Regular_subset.otf + regenerate cff subset test expected results + + src/hb-ot-cmap-table.hh | 73 +++++++++++++++++---- + src/hb-ot-os2-table.hh | 10 ++- + test/subset/data/Makefile.am | 2 + + test/subset/data/Makefile.sources | 2 + + ...subroutinize-retain-gids.1FC,21,41,20,62,63.otf | Bin 32124 -> 20000 bytes + ...Regular.desubroutinize-retain-gids.61,62,63.otf | Bin 29688 -> 2196 bytes + ...r.desubroutinize-retain-gids.D7,D8,D9,DA,DE.otf | Bin 33316 -> 30412 bytes + ...subroutinize-retain-gids.1FC,21,41,20,62,63.otf | Bin 31960 -> 19840 bytes + ...p-hints-desubroutinize-retain-gids.61,62,63.otf | Bin 29564 -> 2072 bytes + ...s-desubroutinize-retain-gids.D7,D8,D9,DA,DE.otf | Bin 33168 -> 30264 bytes + ...r.drop-hints-retain-gids.1FC,21,41,20,62,63.otf | Bin 32052 -> 19932 bytes + ...Pro-Regular.drop-hints-retain-gids.61,62,63.otf | Bin 29632 -> 2108 bytes + ...gular.drop-hints-retain-gids.D7,D8,D9,DA,DE.otf | Bin 33180 -> 30276 bytes + ...sPro-Regular.retain-gids.1FC,21,41,20,62,63.otf | Bin 32276 -> 20152 bytes + .../SourceSansPro-Regular.retain-gids.61,62,63.otf | Bin 29788 -> 2264 bytes + ...eSansPro-Regular.retain-gids.D7,D8,D9,DA,DE.otf | Bin 33332 -> 30428 bytes + ...ubset.default.3042,3044,3046,3048,304A,304B.otf | Bin 3028 -> 3036 bytes + ...ubset.default.3042,3044,3046,73E0,5EA6,8F38.otf | Bin 3240 -> 3248 bytes + ...eHanSans-Regular_subset.default.61,63,65,6B.otf | Bin 2200 -> 2208 bytes + ...ubset.default.660E,6975,73E0,5EA6,8F38,6E05.otf | Bin 3460 -> 3468 bytes + .../SourceHanSans-Regular_subset.default.660E.otf | Bin 1920 -> 1928 bytes + ...e-retain-gids.3042,3044,3046,3048,304A,304B.otf | Bin 90956 -> 8932 bytes + ...e-retain-gids.3042,3044,3046,73E0,5EA6,8F38.otf | Bin 125820 -> 116080 bytes + ...bset.desubroutinize-retain-gids.61,63,65,6B.otf | Bin 88392 -> 3016 bytes + ...e-retain-gids.660E,6975,73E0,5EA6,8F38,6E05.otf | Bin 126004 -> 116264 bytes + ...ular_subset.desubroutinize-retain-gids.660E.otf | Bin 103780 -> 50224 bytes + ...esubroutinize.3042,3044,3046,3048,304A,304B.otf | Bin 2952 -> 2960 bytes + ...esubroutinize.3042,3044,3046,73E0,5EA6,8F38.otf | Bin 3136 -> 3144 bytes + ...s-Regular_subset.desubroutinize.61,63,65,6B.otf | Bin 2132 -> 2140 bytes + ...esubroutinize.660E,6975,73E0,5EA6,8F38,6E05.otf | Bin 3256 -> 3264 bytes + ...eHanSans-Regular_subset.desubroutinize.660E.otf | Bin 1896 -> 1904 bytes + ...e-retain-gids.3042,3044,3046,3048,304A,304B.otf | Bin 90656 -> 8672 bytes + ...e-retain-gids.3042,3044,3046,73E0,5EA6,8F38.otf | Bin 125468 -> 115768 bytes + ...ints-desubroutinize-retain-gids.61,63,65,6B.otf | Bin 88156 -> 2892 bytes + ...e-retain-gids.660E,6975,73E0,5EA6,8F38,6E05.otf | Bin 125584 -> 115884 bytes + ....drop-hints-desubroutinize-retain-gids.660E.otf | Bin 103556 -> 50040 bytes + ...esubroutinize.3042,3044,3046,3048,304A,304B.otf | Bin 2792 -> 2800 bytes + ...esubroutinize.3042,3044,3046,73E0,5EA6,8F38.otf | Bin 2896 -> 2904 bytes + ...ubset.drop-hints-desubroutinize.61,63,65,6B.otf | Bin 2028 -> 2036 bytes + ...esubroutinize.660E,6975,73E0,5EA6,8F38,6E05.otf | Bin 2964 -> 2972 bytes + ...gular_subset.drop-hints-desubroutinize.660E.otf | Bin 1804 -> 1812 bytes + ...s-retain-gids.3042,3044,3046,3048,304A,304B.otf | Bin 90724 -> 8740 bytes + ...s-retain-gids.3042,3044,3046,73E0,5EA6,8F38.otf | Bin 125560 -> 115864 bytes + ...r_subset.drop-hints-retain-gids.61,63,65,6B.otf | Bin 88196 -> 2852 bytes + ...s-retain-gids.660E,6975,73E0,5EA6,8F38,6E05.otf | Bin 125780 -> 116084 bytes + ...-Regular_subset.drop-hints-retain-gids.660E.otf | Bin 103572 -> 50060 bytes + ...et.drop-hints.3042,3044,3046,3048,304A,304B.otf | Bin 2848 -> 2856 bytes + ...et.drop-hints.3042,3044,3046,73E0,5EA6,8F38.otf | Bin 2988 -> 2996 bytes + ...nSans-Regular_subset.drop-hints.61,63,65,6B.otf | Bin 2060 -> 2068 bytes + ...et.drop-hints.660E,6975,73E0,5EA6,8F38,6E05.otf | Bin 3164 -> 3172 bytes + ...ourceHanSans-Regular_subset.drop-hints.660E.otf | Bin 1824 -> 1832 bytes + ...t.retain-gids.3042,3044,3046,3048,304A,304B.otf | Bin 91040 -> 9016 bytes + ...t.retain-gids.3042,3044,3046,73E0,5EA6,8F38.otf | Bin 125924 -> 116184 bytes + ...Sans-Regular_subset.retain-gids.61,63,65,6B.otf | Bin 88468 -> 3012 bytes + ...t.retain-gids.660E,6975,73E0,5EA6,8F38,6E05.otf | Bin 126208 -> 116468 bytes + ...urceHanSans-Regular_subset.retain-gids.660E.otf | Bin 103800 -> 50244 bytes + .../data/fonts/SourceHanSans-Regular_subset.otf | Bin 2707728 -> 2707736 bytes + 57 files changed, 70 insertions(+), 17 deletions(-) + +commit 6bcbe495bff221169f8c0769dde1b4b2c165a211 +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Thu Jun 13 15:04:51 2019 +0430 + + [cff] minor format (#1774) + + src/hb-subset-cff-common.cc | 104 ++++++++++++++++++++------------------------ + 1 file changed, 48 insertions(+), 56 deletions(-) + +commit 4f37c0db9bf4e3d536a50126d17b36009b12f9cb +Author: David Corbett <corbett.dav@husky.neu.edu> +Date: Tue Jun 11 17:55:31 2019 -0400 + + Remove 'mym3' + + src/hb-ot-tag.cc | 4 +++- + test/api/test-ot-tag.c | 2 +- + 2 files changed, 4 insertions(+), 2 deletions(-) + +commit 90872a29ee5d0bef6df1c2900f7001c11106c4da +Author: Michiharu Ariza <ariza@adobe.com> +Date: Tue Jun 11 12:28:30 2019 -0700 + + change assert(false) to failure + + src/hb-subset-cff-common.cc | 2 +- + ...z-testcase-minimized-hb-subset-fuzzer-5680398559870976 | Bin 0 -> 145 bytes + 2 files changed, 1 insertion(+), 1 deletion(-) + +commit 0c5da57d1aab91d7677a5c6517a3da254d53267f +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Mon Jun 10 14:06:25 2019 -0700 + + Fix typo :) + + src/hb-blob.cc | 3 ++- + src/hb-config.hh | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +commit 19b8eb08e5457cd643aee5f9b9ad1c80b2243895 +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Tue Jun 11 01:33:30 2019 +0430 + + Move HB_NO_SETLOCALE to closer place to its to unbreak HB_TINY build (#1768) + + src/hb-common.cc | 3 +++ + src/hb.hh | 4 ---- + 2 files changed, 3 insertions(+), 4 deletions(-) + +commit b4a5a69ad8625e3b90eb907a1b70e3ed24d4ff97 +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Tue Jun 11 01:33:09 2019 +0430 + + Add HB_NO_OEPN (#1767) + + src/hb-blob.cc | 3 +++ + src/hb-config.hh | 2 ++ + 2 files changed, 5 insertions(+) + +commit a36ff941710b5a5f7e464e6d72aff36cf5549a91 +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Mon Jun 10 15:48:28 2019 +0430 + + Add HB_NO_SETLOCALE + + src/hb-config.hh | 1 + + src/hb.hh | 6 +++++- + 2 files changed, 6 insertions(+), 1 deletion(-) + +commit c4cae81a26a816979f3206418c47856b5ed2d8bb +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Mon Jun 10 15:32:54 2019 +0430 + + Remove round polyfill + + Added in 01dff1e and 19256bef, this was targeted at older + msvc versions that don't support C99 but now as we require + C++11 we don't target places those envs thus removing this. + + CMakeLists.txt | 2 +- + configure.ac | 6 ------ + src/hb.hh | 14 -------------- + 3 files changed, 1 insertion(+), 21 deletions(-) + +commit ff9b9b1c89d5529fafc74ce84c0acb71b5d6031b +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Mon Jun 10 12:48:25 2019 -0700 + + Simplify HB_PARTIALIZE impl + + +this works on gcc 4.8 as well as default code path. + + src/hb-algs.hh | 17 +++++------------ + 1 file changed, 5 insertions(+), 12 deletions(-) + +commit 451edbd4d063a4b43c1ca3d2b60c7392602ae7b7 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Mon Jun 10 12:46:54 2019 -0700 + + Revert "Test new solution for HB_PARTIALIZE" + + This reverts commit a0c4900799c26e4ff34180842a5ff21048fe31a0. + + src/hb-algs.hh | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +commit a0c4900799c26e4ff34180842a5ff21048fe31a0 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Mon Jun 10 12:33:23 2019 -0700 + + Test new solution for HB_PARTIALIZE + + Just testing bots. Will finish based on results. + + src/hb-algs.hh | 18 +----------------- + 1 file changed, 1 insertion(+), 17 deletions(-) + +commit 4a2b58555f173b692b767c933d280a51142926dd +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Mon Jun 10 08:16:51 2019 -0700 + + [ci] Use HB_OPTIMIZE_SIZE instead of __OPTIMIZE_SIZE__ + + .circleci/config.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a228bb5f1d471a334bc9727f5d4f5b59dbe829ff +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Mon Jun 10 15:56:36 2019 +0430 + + [ci] Test -Os and optimize size in Alpine bot + + __OPTIMIZE_SIZE__ should be defined whenever -Os but some Internet thread + indicate may not so lets do that ourselves as that is the main intention + + .circleci/config.yml | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit 9407ef8d4bb96346b1f8b07757d79d3f8cc61cf7 +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Mon Jun 10 15:17:43 2019 +0430 + + minor, add HB_USE_INTERNAL_QSORT + + The only thing I need for a working wasm in a minimum libc, + otherwise I have to provide the very same qsort inside that libc + + src/hb-algs.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 801d93fc58aa13082dea86fb2c3821bc6362f593 +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Mon Jun 10 14:53:14 2019 +0430 + + [ci] remove wine from fedora bot + + We are not testing Windows exes in fedora mingw bot, we don't have to as + probably won't go that smoothly and we have real Windows bots anyway + and as wine installation itself is time taking let's remove it + + .circleci/config.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 7dcfc5357df879491f847bd7d2941645e58f268c +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Sun Jun 9 11:58:08 2019 +0430 + + [stat] minor format + + src/hb-ot-stat-table.hh | 72 ++++++++++++++++++++++++------------------------- + 1 file changed, 36 insertions(+), 36 deletions(-) + +commit 2646c7149ce49d3b6cf90e354658df35254bcce0 +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Sun Jun 9 11:51:58 2019 +0430 + + [stat] minor + + src/hb-ot-stat-table.hh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit c4669fda7890bc741ef934ebc360e366eba94866 +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Sun Jun 9 11:50:36 2019 +0430 + + [algs] minor + + src/hb-algs.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 9b853f755dd05ccef3429d3d3d0d561a99cc4c2d +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Sun Jun 9 11:49:25 2019 +0430 + + [cff] Use switch on multi-format structs (#1762) + + src/hb-cff-interp-cs-common.hh | 4 +- + src/hb-cff-interp-dict-common.hh | 12 +-- + src/hb-ot-cff-common.hh | 135 ++++++++++++------------ + src/hb-ot-cff1-table.hh | 215 ++++++++++++++++++++++----------------- + src/hb-ot-cff2-table.hh | 68 +++++++------ + src/hb-subset-cff1.cc | 2 +- + src/hb-subset-cff2.cc | 2 +- + 7 files changed, 233 insertions(+), 205 deletions(-) + +commit eff579f743a91c0b1c543f4b69ab33580cae6392 +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Fri Jun 7 12:58:09 2019 +0430 + + Update and use internal qsort everywhere + + src/hb-algs.hh | 210 +++++++++++++++++++++++++++++++++++------------- + src/hb-array.hh | 6 +- + src/hb-ot-post-table.hh | 2 +- + 3 files changed, 158 insertions(+), 60 deletions(-) + +commit 5074d665a8b0980f202a5986bda52808674cfb54 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Fri Jun 7 14:20:45 2019 -0700 + + [ucd] Save another 1.5kb + + https://github.com/harfbuzz/harfbuzz/issues/1652 + + src/gen-ucd-table.py | 8 +++++--- + src/hb-ucd-table.hh | 37 +++++++++++++++++++++---------------- + src/hb-ucd.cc | 12 +++++++++--- + 3 files changed, 35 insertions(+), 22 deletions(-) + +commit 6d58b45782833f8c6c8efd9426e2785c78e6462a +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Sat Jun 8 00:40:18 2019 +0430 + + [ci] use trusty for its gcc 4.8 again + + .travis.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 973699c49b905e142ecc5cefd1f4fa15aad8e309 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Fri Jun 7 12:49:06 2019 -0700 + + Disable clang gcc impersonator + + src/hb-algs.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e4e518f33d933a02058bad86a6aae714e59814db +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Fri Jun 7 12:41:09 2019 -0700 + + Fix build on gcc 4.8 + + Fixes https://github.com/harfbuzz/harfbuzz/issues/1724 + + src/hb-algs.hh | 29 +++++++++++++++++++++++++++-- + 1 file changed, 27 insertions(+), 2 deletions(-) + +commit 3c240bd3dc0aaca38154da555d0aef350da62ee6 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Fri Jun 7 10:56:24 2019 -0700 + + Downgrade double-promotion from error to warning + + https://github.com/harfbuzz/harfbuzz/issues/1740 + + src/hb.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 385e436692e94588fc4cb3a7afbeb862035db09b +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Fri Jun 7 10:44:53 2019 -0700 + + Minor, fix gcc maybe-uninitialized complain + + I guess all of its field will be initialized anyway here but lets make it more defensive + + src/hb-ot-glyf-table.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 1bada656a86e9cb27d4a6b9fcc50748f0bd9c1d9 +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Fri Jun 7 02:01:27 2019 +0430 + + Minor, remove unnecessary semicolon + + Causing -Wextra-semi-stmt build error when no primitive has chosen + Interesting that nobody has noticed it yet. + + src/hb-mutex.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f9b1ae73360054d9f121a2d36820377909888b35 +Author: Garret Rieger <grieger@google.com> +Date: Wed Jun 5 17:40:59 2019 -0700 + + [subset] Move OS/2 to subset2. + + src/hb-ot-os2-table.hh | 32 ++++++++++++++++---------------- + src/hb-subset.cc | 2 +- + 2 files changed, 17 insertions(+), 17 deletions(-) + +commit 93d592e0e181f436ea47038fef419134007208aa +Author: Qunxin Liu <qxliu@google.com> +Date: Wed Jun 5 16:51:31 2019 -0700 + + [subset] post table to use _subset2 + + src/hb-ot-post-table.hh | 31 +++++++++++++++---------------- + src/hb-subset.cc | 2 +- + 2 files changed, 16 insertions(+), 17 deletions(-) + +commit db938479d7b1e3ec35a39a9ad31c945e09e6d5e5 +Author: Qunxin Liu <qxliu@google.com> +Date: Tue Jun 4 10:30:53 2019 -0700 + + [subset] maxp table to use _subset2 + + src/hb-ot-maxp-table.hh | 48 ++++++++++++++++++++++-------------------------- + src/hb-subset.cc | 2 +- + 2 files changed, 23 insertions(+), 27 deletions(-) + +commit d5e5f378329b6ce21944b79b568369ea7bc36cf3 +Author: Eli Zaretskii <eliz@gnu.org> +Date: Wed Jun 5 22:20:03 2019 +0300 + + This makes minor changes to allow building HarfBuzz with + mingw.org's MinGW. + + src/hb-algs.hh: Don't compile _BitScanForward and _BitScanReverse + for GCC >= 4. mingw.org's MinGW doesn't have these functions. + + src/hb-atomic.hh: MemoryBarrier does exist in mingw.org's MinGW, + but it is not a macro, it is an inline function. __MINGW32_VERSION + is a macro that exists only in mingw.org's MinGW, so conditioning + on it should not affect MinGW64, where MemoryBarrier is a macro. + + src/hb-uniscribe.cc: Define E_NOT_SUFFICIENT_BUFFER if it is not + defined (mingw.org's MinGW doesn't). + + src/hb.hh: Don't include intrin.h for mingw.org's MinGW, since that + header is not available; instead, include windows.h. Conditioned + on __MINGW32_VERSION to avoid affecting MinGW64. + + src/hb-algs.hh | 4 ++-- + src/hb-atomic.hh | 2 +- + src/hb-uniscribe.cc | 4 ++++ + src/hb.hh | 7 +++++++ + 4 files changed, 14 insertions(+), 3 deletions(-) + +commit c7439d4e3a76d596845aad4e4bc860bd61ee47e3 +Author: Behdad Esfahbod <behdad@behdad.org> +Date: Wed Jun 5 12:13:49 2019 -0700 + + Slightly massage buffer-messaging commit + + Saves a few bytes. + + src/hb-buffer.cc | 3 --- + src/hb-buffer.hh | 8 +++++++- + 2 files changed, 7 insertions(+), 4 deletions(-) + +commit 4b1b0bf2f51f806d3285a7e7dec378b9eab9333e +Merge: 659eeddb 815f002b +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Wed Jun 5 12:57:28 2019 +0430 + + Merge pull request #1755 from ebraminio/slim + + Don't use vsnprintf when HB_NO_BUFFER_MESSAGE is defined + +commit 815f002bb9230a52768a165383497cc98c58eadb +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Wed Jun 5 10:38:06 2019 +0430 + + Don't use vsnprintf when HB_NO_BUFFER_MESSAGE is defined + + src/hb-buffer.cc | 5 ++++- + src/hb-config.hh | 1 + + 2 files changed, 5 insertions(+), 1 deletion(-) + +commit 659eeddb2df5b97cc01bd39e106381f65c9f41f1 +Author: Bruce Mitchener <bruce.mitchener@gmail.com> +Date: Mon Jun 3 22:31:50 2019 +0700 + + Use C++11 override keyword. + + util/hb-ot-shape-closure.cc | 2 +- + util/options.hh | 30 +++++++++++++++--------------- + 2 files changed, 16 insertions(+), 16 deletions(-) + +commit 2e16593b70688dfcee1788f38c6af03c5a589f6e +Author: David Corbett <corbett.dav@husky.neu.edu> +Date: Sat Jun 1 20:54:46 2019 -0400 + + [myanmar] Make medial_group match the OT spec + + Sometime between [July 2018] and [January 2019], the OpenType Myanmar + grammar changed: one asat is now allowed after a medial ya, before any + other medial consonant. + + [July 2018]: http://web.archive.org/web/20180711011550/https://docs.microsoft.com/en-us/typography/script-development/myanmar + [January 2019]: http://web.archive.org/web/20190115044451/https://docs.microsoft.com/en-us/typography/script-development/myanmar + + This also reverts commit 439b05867c0856a81fa8f9bea3a7465b4b4bdd91, which + allowed an asat immediately after a medial ra. + + src/hb-ot-shape-complex-myanmar-machine.hh | 249 +++++++++++++++-------------- + src/hb-ot-shape-complex-myanmar-machine.rl | 2 +- + 2 files changed, 129 insertions(+), 122 deletions(-) + +commit 209491fc37c46281e063c3e6707d686d5f2b2ba4 +Author: Qunxin Liu <qxliu@google.com> +Date: Wed May 29 14:03:17 2019 -0700 + + [subset] Hmtx/vmtx tables to use subset2 and new iterator frameworks + + src/hb-ot-hmtx-table.hh | 115 +++++++++++++++++++++++------------------------- + src/hb-subset.cc | 6 +-- + 2 files changed, 59 insertions(+), 62 deletions(-) + +commit 89a7a880a1d5cd5e585d43fdde6d44c6dba559cf +Merge: 760eb1bf 12febd68 +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Tue Jun 4 10:52:16 2019 +0430 + + Merge pull request #1747 from harfbuzz/cff2-fdselect-fix + + fixed faulty FDSelect::sanitize + +commit 12febd68d694cc1bae44b0b672d88bf9fbe8568d +Author: Michiharu Ariza <ariza@adobe.com> +Date: Mon Jun 3 16:40:03 2019 -0700 + + added parentheses to FDSelect::sanitize as well + + src/hb-ot-cff-common.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 65e66a2d371f42d018b1a22f31a6428d19a90284 +Author: Michiharu Ariza <ariza@adobe.com> +Date: Mon Jun 3 16:31:41 2019 -0700 + + added test data + + ...zz-testcase-minimized-harfbuzz_fuzzer-6252118652092416 | Bin 0 -> 126 bytes + 1 file changed, 0 insertions(+), 0 deletions(-) + +commit be82a2fc0c7ad3553f2e6dc8082a3255cb6c917c +Author: Michiharu Ariza <ariza@adobe.com> +Date: Mon Jun 3 15:52:23 2019 -0700 + + parenthesized cond-exp in CFF2FDSelect::sanitize + + src/hb-ot-cff2-table.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 760eb1bf9398bd37103ca879e825fad9bef4bfdd +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Mon Jun 3 05:48:04 2019 -0700 + + Reapply possible bsearch overflow fix + + Originally introduced in 21ede86 (#1314) but as it wasn't applied to hb_bsearch + accidentally removed while merging hb_bsearch_r to it. + + src/hb-algs.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5846884f86cae61c1b0c369c81427712fb97ed83 +Author: Bruce Mitchener <bruce.mitchener@gmail.com> +Date: Mon Jun 3 15:00:25 2019 +0700 + + test: Use nullptr in C++ code. (#1744) + + src/test-ot-color.cc | 8 ++++---- + test/fuzzing/hb-shape-fuzzer.cc | 6 +++--- + test/fuzzing/hb-subset-fuzzer.cc | 2 +- + util/options-subset.cc | 2 +- + 4 files changed, 9 insertions(+), 9 deletions(-) + +commit 7c14b9014587e1423ef7481058e48dae84a65fce +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Sun Jun 2 13:51:26 2019 +0430 + + [ci] revert to xenial + + It should've done in a branch + + .travis.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 8278ff7dce41e6694eba15a7c94a0c0eb3bca427 +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Sun Jun 2 00:36:30 2019 +0430 + + minor + + src/hb-algs.hh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 33d38e793e2e4882337e5f42fbbae7d00d343940 +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Sun Jun 2 00:19:57 2019 +0430 + + Use a unified bsearch (#1741) + + A part of #593 + + src/hb-aat-layout.cc | 10 +++++----- + src/hb-algs.hh | 29 ++++------------------------- + src/hb-ot-post-table.hh | 4 ++-- + src/hb-ot-var-mvar-table.hh | 6 +++--- + 4 files changed, 14 insertions(+), 35 deletions(-) + +commit 97b92685775983a280f335423263a6a8d82c3941 +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Sat Jun 1 21:25:09 2019 +0430 + + [ci] Downgrade Travis distribution upon Behdad request + + .travis.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit faf69e03f5ab9f3926442525f6c6e30fbc7a93d5 +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Sat Jun 1 11:02:25 2019 +0430 + + [ci] Install ragel on appveyor mingw bots + + Hopefully autotools timestamps issues will go + + appveyor.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c91f3fa3eaf77fa255292c779f88da4feaaae8a0 +Author: Ebrahim Byagowi <ebrahim@gnu.org> +Date: Sat Jun 1 10:55:37 2019 +0430 + + [dwrite] Replace REPLACEME with release version the symbol had + + src/hb-directwrite.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + commit 93c455567fe3d92a7efe65bf0e9ac2af794e2c4f Author: Behdad Esfahbod <behdad@behdad.org> Date: Fri May 31 22:53:27 2019 -0700 diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/Makefile.am b/Build/source/libs/harfbuzz/harfbuzz-src/Makefile.am index 26ebdc6e79a..2bbd3c55da3 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/Makefile.am +++ b/Build/source/libs/harfbuzz/harfbuzz-src/Makefile.am @@ -13,6 +13,7 @@ EXTRA_DIST = \ README.mingw.md \ README.python.md \ BUILD.md \ + CONFIG.md \ RELEASING.md \ TESTING.md \ CMakeLists.txt \ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/NEWS b/Build/source/libs/harfbuzz/harfbuzz-src/NEWS index 51929738a53..0835378a155 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/NEWS +++ b/Build/source/libs/harfbuzz/harfbuzz-src/NEWS @@ -1,3 +1,15 @@ +Overview of changes leading to 2.5.2 +Thursday, June 20, 2019 +==================================== +- More hb-config.hh facilities to shrink library size, namely when built as + HB_TINY. +- New documentation of custom configurations in CONFIG.md. +- Fix build on gcc 4.8. That's supported again. +- Universal Shaping Engine improvements thanks to David Corbett. +- API Changes: Undeprecate some horizontal-kerning API and re-enable in hb-ft, + such that Type1 fonts will continue kerning. + + Overview of changes leading to 2.5.1 Friday, May 31, 2019 ==================================== diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/README b/Build/source/libs/harfbuzz/harfbuzz-src/README index ce0a04d1f09..ce3e84dde5a 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/README +++ b/Build/source/libs/harfbuzz/harfbuzz-src/README @@ -17,6 +17,8 @@ For license information, see [COPYING](COPYING). For build information, see [BUILD.md](BUILD.md). +For custom configurations, see [CONFIG.md](CONFIG.md). + For test execution, see [TESTING.md](TESTING.md). Documentation: https://harfbuzz.github.io diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/README.md b/Build/source/libs/harfbuzz/harfbuzz-src/README.md index ce0a04d1f09..ce3e84dde5a 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/README.md +++ b/Build/source/libs/harfbuzz/harfbuzz-src/README.md @@ -17,6 +17,8 @@ For license information, see [COPYING](COPYING). For build information, see [BUILD.md](BUILD.md). +For custom configurations, see [CONFIG.md](CONFIG.md). + For test execution, see [TESTING.md](TESTING.md). Documentation: https://harfbuzz.github.io diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/config.h.in b/Build/source/libs/harfbuzz/harfbuzz-src/config.h.in index 0dca65fc120..6e91e2e9f7f 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/config.h.in +++ b/Build/source/libs/harfbuzz/harfbuzz-src/config.h.in @@ -18,10 +18,6 @@ /* define if the compiler supports basic C++11 syntax */ #undef HAVE_CXX11 -/* Define to 1 if you have the declaration of `round', and to 0 if you don't. - */ -#undef HAVE_DECL_ROUND - /* Have DirectWrite library */ #undef HAVE_DIRECTWRITE @@ -31,9 +27,6 @@ /* Define to 1 if you have the <dwrite.h> header file. */ #undef HAVE_DWRITE_H -/* Have simple TrueType Layout backend */ -#undef HAVE_FALLBACK - /* Have fontconfig library */ #undef HAVE_FONTCONFIG @@ -88,18 +81,12 @@ /* Define to 1 if you have the `newlocale' function. */ #undef HAVE_NEWLOCALE -/* Define to 1 if you have the `posix_memalign' function. */ -#undef HAVE_POSIX_MEMALIGN - /* Have POSIX threads */ #undef HAVE_PTHREAD /* Have PTHREAD_PRIO_INHERIT. */ #undef HAVE_PTHREAD_PRIO_INHERIT -/* Define to 1 if you have the `round' function. */ -#undef HAVE_ROUND - /* Define to 1 if you have the <sched.h> header file. */ #undef HAVE_SCHED_H diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac b/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac index 6a68df79e63..426b8503845 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.5.1], + [2.5.2], [https://github.com/harfbuzz/harfbuzz/issues/new], [harfbuzz], [http://harfbuzz.org/]) @@ -77,13 +77,7 @@ GTK_DOC_CHECK([1.15],[--flavour no-tmpl]) ]) # Functions and headers -AC_CHECK_FUNCS(atexit mprotect sysconf getpagesize mmap isatty newlocale strtod_l posix_memalign) - -save_libs="$LIBS" -LIBS="$LIBS -lm" -AC_CHECK_FUNCS([round], ,[AC_CHECK_DECLS([round], , ,[#include <math.h>])]) -LIBS="$save_libs" - +AC_CHECK_FUNCS(atexit mprotect sysconf getpagesize mmap isatty newlocale strtod_l) AC_CHECK_HEADERS(unistd.h sys/mman.h xlocale.h stdbool.h) # Compiler flags @@ -142,14 +136,6 @@ AM_CONDITIONAL(HAVE_PTHREAD, $have_pthread) dnl ========================================================================== -have_fallback=true -if $have_fallback; then - AC_DEFINE(HAVE_FALLBACK, 1, [Have simple TrueType Layout backend]) -fi -AM_CONDITIONAL(HAVE_FALLBACK, $have_fallback) - -dnl =========================================================================== - AC_ARG_WITH(glib, [AS_HELP_STRING([--with-glib=@<:@yes/no/auto@:>@], [Use glib @<:@default=auto@:>@])],, diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am b/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am index d126c40172d..14cafb83365 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) -if HAVE_FALLBACK -HBSOURCES += $(HB_FALLBACK_sources) -endif - if HAVE_PTHREAD HBCFLAGS += $(PTHREAD_CFLAGS) HBNONPCLIBS += $(PTHREAD_LIBS) @@ -428,6 +424,7 @@ HarfBuzz_0_0_gir_CFLAGS = \ -DHB_AAT_H_IN \ -DHB_GOBJECT_H \ -DHB_GOBJECT_H_IN \ + -DHAVE_GOBJECT \ -DHB_EXTERN= \ $(NULL) HarfBuzz_0_0_gir_LIBS = \ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources b/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources index 70983f1356d..ab228ce7e96 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources @@ -36,6 +36,7 @@ HB_BASE_sources = \ hb-dispatch.hh \ hb-face.cc \ hb-face.hh \ + hb-fallback-shape.cc \ hb-font.cc \ hb-font.hh \ hb-iter.hh \ @@ -63,6 +64,7 @@ HB_BASE_sources = \ hb-ot-color.cc \ hb-ot-face.cc \ hb-ot-face.hh \ + hb-ot-face-table-list.hh \ hb-ot-font.cc \ hb-ot-gasp-table.hh \ hb-ot-glyf-table.hh \ @@ -200,10 +202,6 @@ HB_BASE_headers = \ hb.h \ $(NULL) -HB_FALLBACK_sources = \ - hb-fallback-shape.cc \ - $(NULL) - # Optional Sources and Headers with external deps HB_FT_sources = hb-ft.cc diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-ucd-table.py b/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-ucd-table.py index 3f821802d7d..c98c715e112 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-ucd-table.py +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-ucd-table.py @@ -3,19 +3,22 @@ from __future__ import print_function, division, absolute_import import io, os.path, sys, re +import logging +logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO) if len (sys.argv) != 2: print("usage: ./gen-ucd-table ucd.nonunihan.grouped.xml", file=sys.stderr) sys.exit(1) - # https://github.com/harfbuzz/packtab import packTab import packTab.ucdxml +logging.info('Loading UCDXML...') ucdxml = packTab.ucdxml.load_ucdxml(sys.argv[1]) ucd = packTab.ucdxml.ucdxml_get_repertoire(ucdxml) +logging.info('Preparing data tables...') gc = [u['gc'] for u in ucd] ccc = [int(u['ccc']) for u in ucd] @@ -31,14 +34,15 @@ ce = {i for i,u in enumerate(ucd) if u['Comp_Ex'] == 'Y'} assert not any(v for v in dm.values() if len(v) not in (1,2)) dm1 = sorted(set(v for v in dm.values() if len(v) == 1)) -dm1_array = ['0x%04Xu' % v for v in dm1] +dm1_u16_array = ['0x%04Xu' % v for v in dm1 if v[0] <= 0xFFFF] +dm1_u32_array = ['0x%04Xu' % v for v in dm1 if v[0] > 0xFFFF] dm1_order = {v:i+1 for i,v in enumerate(dm1)} dm2 = sorted((v, i) for i,v in dm.items() if len(v) == 2) dm2 = [("HB_CODEPOINT_ENCODE3 (0x%04Xu, 0x%04Xu, 0x%04Xu)" % (v+(i if i not in ce and not ccc[i] else 0,)), v) for v,i in dm2] dm2_array = [s for s,v in dm2] -l = 1 + len(dm1_array) +l = 1 + len(dm1_u16_array) + len(dm1_u32_array) dm2_order = {v[1]:i+l for i,v in enumerate(dm2)} dm_order = {None: 0} dm_order.update(dm1_order) @@ -70,6 +74,7 @@ DEFAULT = 1 COMPACT = 3 +logging.info('Generating output...') print("/* == Start of generated table == */") print("/*") print(" * The following table is generated by running:") @@ -82,18 +87,26 @@ print() print("#ifndef HB_UCD_TABLE_HH") print("#define HB_UCD_TABLE_HH") print() - -print() print('#include "hb.hh"') print() code = packTab.Code('_hb_ucd') sc_array, _ = code.addArray('hb_script_t', 'sc_map', sc_array) -dm1_array, _ = code.addArray('hb_codepoint_t', 'dm1_map', dm1_array) +dm1_16_array, _ = code.addArray('uint16_t', 'dm1_u16_map', dm1_u16_array) +dm1_32_array, _ = code.addArray('uint32_t', 'dm1_u32_map', dm1_u32_array) dm2_array, _ = code.addArray('uint64_t', 'dm2_map', dm2_array) code.print_c(linkage='static inline') +datasets = [ + ('gc', gc, 'Cn', gc_order), + ('ccc', ccc, 0, None), + ('bmg', bmg, 0, None), + ('sc', sc, 'Zzzz', sc_order), + ('dm', dm, None, dm_order), +] + for compression in (DEFAULT, COMPACT): + logging.info(' Compression=%d:' % compression) print() if compression == DEFAULT: print('#ifndef HB_OPTIMIZE_SIZE') @@ -103,11 +116,10 @@ for compression in (DEFAULT, COMPACT): code = packTab.Code('_hb_ucd') - packTab.pack_table(gc, 'Cn', mapping=gc_order, compression=compression).genCode(code, 'gc') - packTab.pack_table(ccc, 0, compression=compression).genCode(code, 'ccc') - packTab.pack_table(bmg, 0, compression=compression).genCode(code, 'bmg') - packTab.pack_table(sc, 'Zzzz', mapping=sc_order, compression=compression).genCode(code, 'sc') - packTab.pack_table(dm, None, mapping=dm_order, compression=compression).genCode(code, 'dm') + for name,data,default,mapping in datasets: + sol = packTab.pack_table(data, default, mapping=mapping, compression=compression) + logging.info(' Dataset=%-8s FullCost=%d' % (name, sol.fullCost)) + sol.genCode(code, name) code.print_c(linkage='static inline') @@ -121,3 +133,4 @@ print() print("#endif /* HB_UCD_TABLE_HH */") print() print("/* == End of generated table == */") +logging.info('Done.') 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 22cbd733883..c08bb11f460 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 @@ -25,9 +25,8 @@ * Google Author(s): Behdad Esfahbod */ -#include "hb-open-type.hh" +#include "hb.hh" -#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" @@ -40,6 +39,45 @@ #include "hb-aat-ltag-table.hh" +/* + * hb_aat_apply_context_t + */ + +/* Note: This context is used for kerning, even without AAT, hence the condition. */ +#if !defined(HB_NO_AAT) || !defined(HB_NO_OT_KERN) + +AAT::hb_aat_apply_context_t::hb_aat_apply_context_t (const hb_ot_shape_plan_t *plan_, + hb_font_t *font_, + hb_buffer_t *buffer_, + hb_blob_t *blob) : + plan (plan_), + font (font_), + face (font->face), + buffer (buffer_), + sanitizer (), + ankr_table (&Null(AAT::ankr)), + lookup_index (0), + debug_depth (0) +{ + sanitizer.init (blob); + sanitizer.set_num_glyphs (face->get_num_glyphs ()); + sanitizer.start_processing (); + sanitizer.set_max_ops (HB_SANITIZE_MAX_OPS_MAX); +} + +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_) +{ ankr_table = ankr_table_; } + +#endif + + +#ifndef HB_NO_AAT + + /** * SECTION:hb-aat-layout * @title: hb-aat-layout @@ -135,52 +173,15 @@ static const hb_aat_feature_mapping_t feature_mappings[] = const hb_aat_feature_mapping_t * hb_aat_layout_find_feature_mapping (hb_tag_t tag) { -#ifdef HB_NO_SHAPE_AAT - return nullptr; -#endif - - return (const hb_aat_feature_mapping_t *) bsearch (&tag, - feature_mappings, - ARRAY_LENGTH (feature_mappings), - sizeof (feature_mappings[0]), - hb_aat_feature_mapping_t::cmp); + return (const hb_aat_feature_mapping_t *) hb_bsearch (&tag, + feature_mappings, + ARRAY_LENGTH (feature_mappings), + sizeof (feature_mappings[0]), + hb_aat_feature_mapping_t::cmp); } /* - * hb_aat_apply_context_t - */ - -/* Note: This context is used for kerning, even without AAT. */ - -AAT::hb_aat_apply_context_t::hb_aat_apply_context_t (const hb_ot_shape_plan_t *plan_, - hb_font_t *font_, - hb_buffer_t *buffer_, - hb_blob_t *blob) : - plan (plan_), - font (font_), - face (font->face), - buffer (buffer_), - sanitizer (), - ankr_table (&Null(AAT::ankr)), - lookup_index (0), - debug_depth (0) -{ - sanitizer.init (blob); - sanitizer.set_num_glyphs (face->get_num_glyphs ()); - sanitizer.start_processing (); - sanitizer.set_max_ops (HB_SANITIZE_MAX_OPS_MAX); -} - -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_) -{ ankr_table = ankr_table_; } - - -/* * mort/morx/kerx/trak */ @@ -189,10 +190,6 @@ void hb_aat_layout_compile_map (const hb_aat_map_builder_t *mapper, hb_aat_map_t *map) { -#ifdef HB_NO_SHAPE_AAT - return; -#endif - const AAT::morx& morx = *mapper->face->table.morx; if (morx.has_data ()) { @@ -219,10 +216,6 @@ hb_aat_layout_compile_map (const hb_aat_map_builder_t *mapper, hb_bool_t hb_aat_layout_has_substitution (hb_face_t *face) { -#ifdef HB_NO_SHAPE_AAT - return false; -#endif - return face->table.morx->has_data () || face->table.mort->has_data (); } @@ -232,10 +225,6 @@ hb_aat_layout_substitute (const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) { -#ifdef HB_NO_SHAPE_AAT - return; -#endif - hb_blob_t *morx_blob = font->face->table.morx.get_blob (); const AAT::morx& morx = *morx_blob->as<AAT::morx> (); if (morx.has_data ()) @@ -258,10 +247,6 @@ hb_aat_layout_substitute (const hb_ot_shape_plan_t *plan, void hb_aat_layout_zero_width_deleted_glyphs (hb_buffer_t *buffer) { -#ifdef HB_NO_SHAPE_AAT - return; -#endif - unsigned int count = buffer->len; hb_glyph_info_t *info = buffer->info; hb_glyph_position_t *pos = buffer->pos; @@ -279,10 +264,6 @@ is_deleted_glyph (const hb_glyph_info_t *info) void hb_aat_layout_remove_deleted_glyphs (hb_buffer_t *buffer) { -#ifdef HB_NO_SHAPE_AAT - return; -#endif - hb_ot_layout_delete_glyphs_inplace (buffer, is_deleted_glyph); } @@ -296,10 +277,6 @@ hb_aat_layout_remove_deleted_glyphs (hb_buffer_t *buffer) hb_bool_t hb_aat_layout_has_positioning (hb_face_t *face) { -#ifdef HB_NO_SHAPE_AAT - return false; -#endif - return face->table.kerx->has_data (); } @@ -308,10 +285,6 @@ hb_aat_layout_position (const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) { -#ifdef HB_NO_SHAPE_AAT - return; -#endif - hb_blob_t *kerx_blob = font->face->table.kerx.get_blob (); const AAT::kerx& kerx = *kerx_blob->as<AAT::kerx> (); @@ -331,10 +304,6 @@ hb_aat_layout_position (const hb_ot_shape_plan_t *plan, hb_bool_t hb_aat_layout_has_tracking (hb_face_t *face) { -#ifdef HB_NO_SHAPE_AAT - return false; -#endif - return face->table.trak->has_data (); } @@ -343,10 +312,6 @@ hb_aat_layout_track (const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) { -#ifdef HB_NO_SHAPE_AAT - return; -#endif - const AAT::trak& trak = *font->face->table.trak; AAT::hb_aat_apply_context_t c (plan, font, buffer); @@ -370,12 +335,6 @@ hb_aat_layout_get_feature_types (hb_face_t *face, unsigned int *feature_count, /* IN/OUT. May be NULL. */ hb_aat_layout_feature_type_t *features /* OUT. May be NULL. */) { -#ifdef HB_NO_SHAPE_AAT - if (feature_count) - *feature_count = 0; - return 0; -#endif - return face->table.feat->get_feature_types (start_offset, feature_count, features); } @@ -392,10 +351,6 @@ 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) { -#ifdef HB_NO_SHAPE_AAT - return HB_OT_NAME_ID_INVALID; -#endif - return face->table.feat->get_feature_name_id (feature_type); } @@ -424,11 +379,8 @@ hb_aat_layout_feature_type_get_selector_infos (hb_face_t hb_aat_layout_feature_selector_info_t *selectors, /* OUT. May be NULL. */ unsigned int *default_index /* OUT. May be NULL. */) { -#ifdef HB_NO_SHAPE_AAT - if (selector_count) - *selector_count = 0; - return 0; -#endif - return face->table.feat->get_selector_infos (feature_type, start_offset, selector_count, selectors, default_index); } + + +#endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout.hh index 9a0e4468f0b..8310bfcc2d2 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 @@ -78,12 +78,4 @@ hb_aat_layout_track (const hb_ot_shape_plan_t *plan, hb_buffer_t *buffer); -inline hb_language_t -_hb_aat_language_get (hb_face_t *face, - unsigned int i) -{ - return face->table.ltag->get_language (i); -} - - #endif /* HB_AAT_LAYOUT_HH */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-map.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-map.cc index d57ee849da4..e16ecfe0420 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-map.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-map.cc @@ -26,6 +26,10 @@ * Google Author(s): Behdad Esfahbod */ +#include "hb.hh" + +#ifndef HB_NO_SHAPE_AAT + #include "hb-aat-map.hh" #include "hb-aat-layout.hh" @@ -34,10 +38,6 @@ void hb_aat_map_builder_t::add_feature (hb_tag_t tag, unsigned int value) { -#ifdef HB_NO_SHAPE_AAT - return; -#endif - if (tag == HB_TAG ('a','a','l','t')) { feature_info_t *info = features.push(); @@ -57,10 +57,6 @@ void hb_aat_map_builder_t::add_feature (hb_tag_t tag, void hb_aat_map_builder_t::compile (hb_aat_map_t &m) { -#ifdef HB_NO_SHAPE_AAT - return; -#endif - /* Sort features and merge duplicates */ if (features.length) { @@ -74,3 +70,6 @@ hb_aat_map_builder_t::compile (hb_aat_map_t &m) hb_aat_layout_compile_map (this, &m); } + + +#endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-algs.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-algs.hh index 38104fdb82e..4a537baf3ac 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-algs.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-algs.hh @@ -1,6 +1,6 @@ /* * Copyright © 2017 Google, Inc. - * Copyright © 2019 Google, Inc. + * Copyright © 2019 Facebook, Inc. * * This is part of HarfBuzz, a text shaping library. * @@ -167,19 +167,37 @@ template <unsigned Pos=1, typename Appl, typename V> auto hb_partial (Appl&& a, V&& v) HB_AUTO_RETURN (( hb_partial_t<Pos, Appl, V> (a, v) )) -/* The following hacky replacement version is to make Visual Stuiod build:. */ \ -/* https://github.com/harfbuzz/harfbuzz/issues/1730 */ \ +/* The following, HB_PARTIALIZE, macro uses a particular corner-case + * of C++11 that is not particularly well-supported by all compilers. + * What's happening is that it's using "this" in a trailing return-type + * via decltype(). Broken compilers deduce the type of "this" pointer + * in that context differently from what it resolves to in the body + * of the function. + * + * One probable cause of this is that at the time of trailing return + * type declaration, "this" points to an incomplete type, whereas in + * the function body the type is complete. That doesn't justify the + * error in any way, but is probably what's happening. + * + * In the case of MSVC, we get around this by using C++14 "decltype(auto)" + * which deduces the type from the actual return statement. For gcc 4.8 + * we use "+this" instead of "this" which produces an rvalue that seems + * to be deduced as the same type with this particular compiler, and seem + * to be fine as default code path as well. + */ #ifdef _MSC_VER +/* https://github.com/harfbuzz/harfbuzz/issues/1730 */ \ #define HB_PARTIALIZE(Pos) \ template <typename _T> \ decltype(auto) operator () (_T&& _v) const \ { return hb_partial<Pos> (this, hb_forward<_T> (_v)); } \ static_assert (true, "") #else +/* https://github.com/harfbuzz/harfbuzz/issues/1724 */ #define HB_PARTIALIZE(Pos) \ template <typename _T> \ auto operator () (_T&& _v) const HB_AUTO_RETURN \ - (hb_partial<Pos> (this, hb_forward<_T> (_v))) \ + (hb_partial<Pos> (+this, hb_forward<_T> (_v))) \ static_assert (true, "") #endif @@ -400,7 +418,7 @@ hb_bit_storage (T v) return sizeof (unsigned long long) * 8 - __builtin_clzll (v); #endif -#if (defined(_MSC_VER) && _MSC_VER >= 1500) || defined(__MINGW32__) +#if (defined(_MSC_VER) && _MSC_VER >= 1500) || (defined(__MINGW32__) && (__GNUC__ < 4)) if (sizeof (T) <= sizeof (unsigned int)) { unsigned long where; @@ -474,7 +492,7 @@ hb_ctz (T v) return __builtin_ctzll (v); #endif -#if (defined(_MSC_VER) && _MSC_VER >= 1500) || defined(__MINGW32__) +#if (defined(_MSC_VER) && _MSC_VER >= 1500) || (defined(__MINGW32__) && (__GNUC__ < 4)) if (sizeof (T) <= sizeof (unsigned int)) { unsigned long where; @@ -603,40 +621,19 @@ hb_in_ranges (T u, T lo1, T hi1, T lo2, T hi2, T lo3, T hi3) /* * Sort and search. */ - +template <typename ...Ts> static inline void * hb_bsearch (const void *key, const void *base, size_t nmemb, size_t size, - int (*compar)(const void *_key, const void *_item)) -{ - int min = 0, max = (int) nmemb - 1; - while (min <= max) - { - int mid = (min + max) / 2; - const void *p = (const void *) (((const char *) base) + (mid * size)); - int c = compar (key, p); - if (c < 0) - max = mid - 1; - else if (c > 0) - min = mid + 1; - else - return (void *) p; - } - return nullptr; -} - -static inline void * -hb_bsearch_r (const void *key, const void *base, - size_t nmemb, size_t size, - int (*compar)(const void *_key, const void *_item, void *_arg), - void *arg) + int (*compar)(const void *_key, const void *_item, Ts... _ds), + Ts... ds) { int min = 0, max = (int) nmemb - 1; while (min <= max) { int mid = ((unsigned int) min + (unsigned int) max) / 2; const void *p = (const void *) (((const char *) base) + (mid * size)); - int c = compar (key, p, arg); + int c = compar (key, p, ds...); if (c < 0) max = mid - 1; else if (c > 0) @@ -649,115 +646,213 @@ hb_bsearch_r (const void *key, const void *base, /* From https://github.com/noporpoise/sort_r - * With following modifications: - * - * 10 November 2018: - * https://github.com/noporpoise/sort_r/issues/7 - */ + Feb 5, 2019 (c8c65c1e) + Modified to support optional argument using templates */ /* Isaac Turner 29 April 2014 Public Domain */ /* - -hb_sort_r function to be exported. - +hb_qsort function to be exported. Parameters: base is the array to be sorted nel is the number of elements in the array width is the size in bytes of each element of the array compar is the comparison function - arg is a pointer to be passed to the comparison function + arg (optional) is a pointer to be passed to the comparison function -void hb_sort_r(void *base, size_t nel, size_t width, - int (*compar)(const void *_a, const void *_b, void *_arg), - void *arg); +void hb_qsort(void *base, size_t nel, size_t width, + int (*compar)(const void *_a, const void *_b, [void *_arg]), + [void *arg]); */ +#define SORT_R_SWAP(a,b,tmp) ((tmp) = (a), (a) = (b), (b) = (tmp)) + +/* swap a and b */ +/* a and b must not be equal! */ +static inline void sort_r_swap(char *__restrict a, char *__restrict b, + size_t w) +{ + char tmp, *end = a+w; + for(; a < end; a++, b++) { SORT_R_SWAP(*a, *b, tmp); } +} /* swap a, b iff a>b */ +/* a and b must not be equal! */ /* __restrict is same as restrict but better support on old machines */ -static int sort_r_cmpswap(char *__restrict a, char *__restrict b, size_t w, - int (*compar)(const void *_a, const void *_b, - void *_arg), - void *arg) +template <typename ...Ts> +static inline int sort_r_cmpswap(char *__restrict a, + char *__restrict b, size_t w, + int (*compar)(const void *_a, + const void *_b, + Ts... _ds), + Ts... ds) { - char tmp, *end = a+w; - if(compar(a, b, arg) > 0) { - for(; a < end; a++, b++) { tmp = *a; *a = *b; *b = tmp; } + if(compar(a, b, ds...) > 0) { + sort_r_swap(a, b, w); return 1; } return 0; } +/* +Swap consecutive blocks of bytes of size na and nb starting at memory addr ptr, +with the smallest swap so that the blocks are in the opposite order. Blocks may +be internally re-ordered e.g. + 12345ab -> ab34512 + 123abc -> abc123 + 12abcde -> deabc12 +*/ +static inline void sort_r_swap_blocks(char *ptr, size_t na, size_t nb) +{ + if(na > 0 && nb > 0) { + if(na > nb) { sort_r_swap(ptr, ptr+na, nb); } + else { sort_r_swap(ptr, ptr+nb, na); } + } +} + +/* Implement recursive quicksort ourselves */ /* Note: quicksort is not stable, equivalent values may be swapped */ +template <typename ...Ts> static inline void sort_r_simple(void *base, size_t nel, size_t w, - int (*compar)(const void *_a, const void *_b, - void *_arg), - void *arg) + int (*compar)(const void *_a, + const void *_b, + Ts... _ds), + Ts... ds) { char *b = (char *)base, *end = b + nel*w; - if(nel < 7) { + + /* for(size_t i=0; i<nel; i++) {printf("%4i", *(int*)(b + i*sizeof(int)));} + printf("\n"); */ + + if(nel < 10) { /* Insertion sort for arbitrarily small inputs */ char *pi, *pj; for(pi = b+w; pi < end; pi += w) { - for(pj = pi; pj > b && sort_r_cmpswap(pj-w,pj,w,compar,arg); pj -= w) {} + for(pj = pi; pj > b && sort_r_cmpswap(pj-w,pj,w,compar,ds...); pj -= w) {} } } else { - /* nel > 6; Quicksort */ + /* nel > 9; Quicksort */ - /* Use median of first, middle and last items as pivot */ - char *x, *y, *xend, ch; - char *pl, *pm, *pr; + int cmp; + char *pl, *ple, *pr, *pre, *pivot; char *last = b+w*(nel-1), *tmp; + + /* + Use median of second, middle and second-last items as pivot. + First and last may have been swapped with pivot and therefore be extreme + */ char *l[3]; - l[0] = b; + l[0] = b + w; l[1] = b+w*(nel/2); - l[2] = last; + l[2] = last - w; - if(compar(l[0],l[1],arg) > 0) { tmp=l[0]; l[0]=l[1]; l[1]=tmp; } - if(compar(l[1],l[2],arg) > 0) { - tmp=l[1]; l[1]=l[2]; l[2]=tmp; /* swap(l[1],l[2]) */ - if(compar(l[0],l[1],arg) > 0) { tmp=l[0]; l[0]=l[1]; l[1]=tmp; } - } + /* printf("pivots: %i, %i, %i\n", *(int*)l[0], *(int*)l[1], *(int*)l[2]); */ - /* swap l[id], l[2] to put pivot as last element */ - for(x = l[1], y = last, xend = x+w; x<xend; x++, y++) { - ch = *x; *x = *y; *y = ch; + if(compar(l[0],l[1],ds...) > 0) { SORT_R_SWAP(l[0], l[1], tmp); } + if(compar(l[1],l[2],ds...) > 0) { + SORT_R_SWAP(l[1], l[2], tmp); + if(compar(l[0],l[1],ds...) > 0) { SORT_R_SWAP(l[0], l[1], tmp); } } - pl = b; - pr = last; - + /* swap mid value (l[1]), and last element to put pivot as last element */ + if(l[1] != last) { sort_r_swap(l[1], last, w); } + + /* + pl is the next item on the left to be compared to the pivot + pr is the last item on the right that was compared to the pivot + ple is the left position to put the next item that equals the pivot + ple is the last right position where we put an item that equals the pivot + v- end (beyond the array) + EEEEEELLLLLLLLuuuuuuuuGGGGGGGEEEEEEEE. + ^- b ^- ple ^- pl ^- pr ^- pre ^- last (where the pivot is) + Pivot comparison key: + E = equal, L = less than, u = unknown, G = greater than, E = equal + */ + pivot = last; + ple = pl = b; + pre = pr = last; + + /* + Strategy: + Loop into the list from the left and right at the same time to find: + - an item on the left that is greater than the pivot + - an item on the right that is less than the pivot + Once found, they are swapped and the loop continues. + Meanwhile items that are equal to the pivot are moved to the edges of the + array. + */ while(pl < pr) { - pm = pl+((pr-pl+1)>>1); - for(; pl < pm; pl += w) { - if(sort_r_cmpswap(pl, pr, w, compar, arg)) { - pr -= w; /* pivot now at pl */ - break; + /* Move left hand items which are equal to the pivot to the far left. + break when we find an item that is greater than the pivot */ + for(; pl < pr; pl += w) { + cmp = compar(pl, pivot, ds...); + if(cmp > 0) { break; } + else if(cmp == 0) { + if(ple < pl) { sort_r_swap(ple, pl, w); } + ple += w; } } - pm = pl+((pr-pl)>>1); - for(; pm < pr; pr -= w) { - if(sort_r_cmpswap(pl, pr, w, compar, arg)) { - pl += w; /* pivot now at pr */ + /* break if last batch of left hand items were equal to pivot */ + if(pl >= pr) { break; } + /* Move right hand items which are equal to the pivot to the far right. + break when we find an item that is less than the pivot */ + for(; pl < pr; ) { + pr -= w; /* Move right pointer onto an unprocessed item */ + cmp = compar(pr, pivot, ds...); + if(cmp == 0) { + pre -= w; + if(pr < pre) { sort_r_swap(pr, pre, w); } + } + else if(cmp < 0) { + if(pl < pr) { sort_r_swap(pl, pr, w); } + pl += w; break; } } } - sort_r_simple(b, (pl-b)/w, w, compar, arg); - sort_r_simple(pl+w, (end-(pl+w))/w, w, compar, arg); + pl = pr; /* pr may have gone below pl */ + + /* + Now we need to go from: EEELLLGGGGEEEE + to: LLLEEEEEEEGGGG + Pivot comparison key: + E = equal, L = less than, u = unknown, G = greater than, E = equal + */ + sort_r_swap_blocks(b, ple-b, pl-ple); + sort_r_swap_blocks(pr, pre-pr, end-pre); + + /*for(size_t i=0; i<nel; i++) {printf("%4i", *(int*)(b + i*sizeof(int)));} + printf("\n");*/ + + sort_r_simple(b, (pl-ple)/w, w, compar, ds...); + sort_r_simple(end-(pre-pr), (pre-pr)/w, w, compar, ds...); } } static inline void -hb_sort_r (void *base, size_t nel, size_t width, - int (*compar)(const void *_a, const void *_b, void *_arg), - void *arg) +hb_qsort (void *base, size_t nel, size_t width, + int (*compar)(const void *_a, const void *_b)) { - sort_r_simple(base, nel, width, compar, arg); +#if defined(__OPTIMIZE_SIZE__) && !defined(HB_USE_INTERNAL_QSORT) + qsort (base, nel, width, compar); +#else + sort_r_simple (base, nel, width, compar); +#endif +} + +static inline void +hb_qsort (void *base, size_t nel, size_t width, + int (*compar)(const void *_a, const void *_b, void *_arg), + void *arg) +{ +#ifdef HAVE_GNU_QSORT_R + qsort_r (base, nel, width, compar, arg); +#else + sort_r_simple (base, nel, width, compar, arg); +#endif } @@ -845,6 +940,12 @@ struct hb_bitwise_sub operator () (const T &a, const T &b) const HB_AUTO_RETURN (a & ~b) } HB_FUNCOBJ (hb_bitwise_sub); +struct +{ + template <typename T> auto + operator () (const T &a) const HB_AUTO_RETURN (~a) +} +HB_FUNCOBJ (hb_bitwise_neg); struct { HB_PARTIALIZE(2); @@ -893,28 +994,29 @@ HB_FUNCOBJ (hb_neg); /* Compiler-assisted vectorization. */ /* Type behaving similar to vectorized vars defined using __attribute__((vector_size(...))), - * using vectorized operations if HB_VECTOR_SIZE is set to **bit** numbers (eg 128). - * Define that to 0 to disable. */ + * basically a fixed-size bitset. */ template <typename elt_t, unsigned int byte_size> struct hb_vector_size_t { - elt_t& operator [] (unsigned int i) { return u.v[i]; } - const elt_t& operator [] (unsigned int i) const { return u.v[i]; } + elt_t& operator [] (unsigned int i) { return v[i]; } + const elt_t& operator [] (unsigned int i) const { return v[i]; } void clear (unsigned char v = 0) { memset (this, v, sizeof (*this)); } template <typename Op> + hb_vector_size_t process (const Op& op) const + { + hb_vector_size_t r; + for (unsigned int i = 0; i < ARRAY_LENGTH (v); i++) + r.v[i] = op (v[i]); + return r; + } + template <typename Op> hb_vector_size_t process (const Op& op, const hb_vector_size_t &o) const { hb_vector_size_t r; -#if HB_VECTOR_SIZE - if (HB_VECTOR_SIZE && 0 == (byte_size * 8) % HB_VECTOR_SIZE) - for (unsigned int i = 0; i < ARRAY_LENGTH (u.vec); i++) - r.u.vec[i] = op (u.vec[i], o.u.vec[i]); - else -#endif - for (unsigned int i = 0; i < ARRAY_LENGTH (u.v); i++) - r.u.v[i] = op (u.v[i], o.u.v[i]); + for (unsigned int i = 0; i < ARRAY_LENGTH (v); i++) + r.v[i] = op (v[i], o.v[i]); return r; } hb_vector_size_t operator | (const hb_vector_size_t &o) const @@ -924,27 +1026,11 @@ struct hb_vector_size_t hb_vector_size_t operator ^ (const hb_vector_size_t &o) const { return process (hb_bitwise_xor, o); } hb_vector_size_t operator ~ () const - { - hb_vector_size_t r; -#if HB_VECTOR_SIZE && 0 - if (HB_VECTOR_SIZE && 0 == (byte_size * 8) % HB_VECTOR_SIZE) - for (unsigned int i = 0; i < ARRAY_LENGTH (u.vec); i++) - r.u.vec[i] = ~u.vec[i]; - else -#endif - for (unsigned int i = 0; i < ARRAY_LENGTH (u.v); i++) - r.u.v[i] = ~u.v[i]; - return r; - } + { return process (hb_bitwise_neg); } private: - static_assert (byte_size / sizeof (elt_t) * sizeof (elt_t) == byte_size, ""); - union { - elt_t v[byte_size / sizeof (elt_t)]; -#if HB_VECTOR_SIZE - hb_vector_size_impl_t vec[byte_size / sizeof (hb_vector_size_impl_t)]; -#endif - } u; + static_assert (0 == byte_size % sizeof (elt_t), ""); + elt_t v[byte_size / sizeof (elt_t)]; }; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-array.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-array.hh index 587000cd428..d60c2494946 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-array.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-array.hh @@ -141,13 +141,13 @@ struct hb_array_t : hb_iter_with_fallback_t<hb_array_t<Type>, Type&> hb_sorted_array_t<Type> qsort (int (*cmp_)(const void*, const void*)) { if (likely (length)) - ::qsort (arrayZ, length, this->item_size, cmp_); + hb_qsort (arrayZ, length, this->item_size, cmp_); return hb_sorted_array_t<Type> (*this); } hb_sorted_array_t<Type> qsort () { if (likely (length)) - ::qsort (arrayZ, length, this->item_size, Type::cmp); + hb_qsort (arrayZ, length, this->item_size, Type::cmp); return hb_sorted_array_t<Type> (*this); } void qsort (unsigned int start, unsigned int end) @@ -155,7 +155,7 @@ struct hb_array_t : hb_iter_with_fallback_t<hb_array_t<Type>, Type&> end = hb_min (end, length); assert (start <= end); if (likely (start < end)) - ::qsort (arrayZ + start, end - start, this->item_size, Type::cmp); + hb_qsort (arrayZ + start, end - start, this->item_size, Type::cmp); } /* 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 45413d5e73d..09d88937c23 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-atomic.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-atomic.hh @@ -107,7 +107,7 @@ _hb_atomic_ptr_impl_cmplexch (const void **P, const void *O_, const void *N) static inline void _hb_memory_barrier () { -#ifndef MemoryBarrier +#if !defined(MemoryBarrier) && !defined(__MINGW32_VERSION) /* MinGW has a convoluted history of supporting MemoryBarrier. */ LONG dummy = 0; InterlockedExchange (&dummy, 1); 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 5783fb2947f..497df65fd43 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc @@ -543,6 +543,10 @@ _hb_mapped_file_destroy (void *file_) hb_blob_t * hb_blob_create_from_file (const char *file_name) { +#ifdef HB_NO_OPEN + return hb_blob_get_empty (); +#endif + /* Adopted from glib's gmappedfile.c with Matthias Clasen and Allison Lortie permission but changed a lot to suit our need. */ #if defined(HAVE_MMAP) && !defined(HB_NO_MMAP) 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 d3732fd02d6..77d997c90fa 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 @@ -24,14 +24,16 @@ * Google Author(s): Behdad Esfahbod */ +#include "hb.hh" + +#ifndef HB_NO_BUFFER_SERIALIZE + #include "hb-buffer.hh" static const char *serialize_formats[] = { -#ifndef HB_NO_BUFFER_SERIALIZE "text", "json", -#endif nullptr }; @@ -89,10 +91,8 @@ hb_buffer_serialize_format_to_string (hb_buffer_serialize_format_t format) { switch ((unsigned) format) { -#ifndef HB_NO_BUFFER_SERIALIZE case HB_BUFFER_SERIALIZE_FORMAT_TEXT: return serialize_formats[0]; case HB_BUFFER_SERIALIZE_FORMAT_JSON: return serialize_formats[1]; -#endif default: case HB_BUFFER_SERIALIZE_FORMAT_INVALID: return nullptr; } @@ -348,10 +348,6 @@ hb_buffer_serialize_glyphs (hb_buffer_t *buffer, if (buf_size) *buf = '\0'; -#ifdef HB_NO_BUFFER_SERIALIZE - return 0; -#endif - assert ((!buffer->len && buffer->content_type == HB_BUFFER_CONTENT_TYPE_INVALID) || buffer->content_type == HB_BUFFER_CONTENT_TYPE_GLYPHS); @@ -457,10 +453,6 @@ hb_buffer_deserialize_glyphs (hb_buffer_t *buffer, end_ptr = &end; *end_ptr = buf; -#ifdef HB_NO_BUFFER_SERIALIZE - return false; -#endif - assert ((!buffer->len && buffer->content_type == HB_BUFFER_CONTENT_TYPE_INVALID) || buffer->content_type == HB_BUFFER_CONTENT_TYPE_GLYPHS); @@ -496,3 +488,6 @@ hb_buffer_deserialize_glyphs (hb_buffer_t *buffer, } } + + +#endif 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 d95404f5ca2..d1dbd078811 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc @@ -1993,6 +1993,7 @@ hb_buffer_diff (hb_buffer_t *buffer, * Debugging. */ +#ifndef HB_NO_BUFFER_MESSAGE /** * hb_buffer_set_message_func: * @buffer: an #hb_buffer_t. @@ -2027,6 +2028,7 @@ bool hb_buffer_t::message_impl (hb_font_t *font, const char *fmt, va_list ap) { char buf[100]; - vsnprintf (buf, sizeof (buf), fmt, ap); + vsnprintf (buf, sizeof (buf), fmt, ap); return (bool) this->message_func (this, font, buf, this->message_data); } +#endif 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 b2b190ace7a..bc0c7eddcc8 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.hh @@ -124,7 +124,9 @@ struct hb_buffer_t unsigned int context_len[2]; /* Debugging API */ +#ifndef HB_NO_BUFFER_MESSAGE hb_buffer_message_func_t message_func; +#endif void *message_data; hb_destroy_func_t message_destroy; @@ -347,7 +349,14 @@ struct hb_buffer_t HB_INTERNAL void sort (unsigned int start, unsigned int end, int(*compar)(const hb_glyph_info_t *, const hb_glyph_info_t *)); - bool messaging () { return unlikely (message_func); } + bool messaging () + { +#ifdef HB_NO_BUFFER_MESSAGE + return false; +#else + return unlikely (message_func); +#endif + } bool message (hb_font_t *font, const char *fmt, ...) HB_PRINTF_FUNC(3, 4) { if (!messaging ()) 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 index 61bdba5f519..1cfbba6030d 100644 --- 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 @@ -76,8 +76,8 @@ struct biased_subrs_t void fini () {} - unsigned int get_count () const { return (subrs == nullptr)? 0: subrs->count; } - unsigned int get_bias () const { return bias; } + unsigned int get_count () const { return (subrs == nullptr) ? 0 : subrs->count; } + unsigned int get_bias () const { return bias; } byte_str_t operator [] (unsigned int index) const { 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 index 2c54909a1bc..ea0db13f85b 100644 --- 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 @@ -134,10 +134,10 @@ struct dict_opset_t : opset_t<number_t> return value; case END: - value = (double)(neg? -int_part: int_part); + value = (double) (neg ? -int_part : int_part); if (frac_count > 0) { - double frac = (frac_part / pow (10.0, (double)frac_count)); + double frac = (frac_part / pow (10.0, (double) frac_count)); if (neg) frac = -frac; value += frac; } @@ -146,16 +146,16 @@ struct dict_opset_t : opset_t<number_t> if (value == 0.0) return value; if (exp_neg) - return neg? -DBL_MIN: DBL_MIN; + return neg ? -DBL_MIN : DBL_MIN; else - return neg? -DBL_MAX: DBL_MAX; + return neg ? -DBL_MAX : DBL_MAX; } if (exp_part != 0) { if (exp_neg) - value /= pow (10.0, (double)exp_part); + value /= pow (10.0, (double) exp_part); else - value *= pow (10.0, (double)exp_part); + value *= pow (10.0, (double) exp_part); } return value; 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 71791dba1d6..fb6377e399f 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.cc @@ -35,6 +35,9 @@ #include <xlocale.h> #endif +#ifdef HB_NO_SETLOCALE +#define setlocale(Category, Locale) "C" +#endif /** * SECTION:hb-common diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-config.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-config.hh index fd5a7134192..66af29aaa92 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-config.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-config.hh @@ -52,15 +52,28 @@ #define HB_DISABLE_DEPRECATED #define HB_NDEBUG #define HB_NO_ATEXIT +#define HB_NO_BUFFER_MESSAGE #define HB_NO_BUFFER_SERIALIZE #define HB_NO_BITMAP #define HB_NO_CFF #define HB_NO_COLOR +#define HB_NO_FACE_COLLECT_UNICODES #define HB_NO_GETENV +#define HB_NO_HINTING +#define HB_NO_LANGUAGE_PRIVATE_SUBTAG +#define HB_NO_LAYOUT_FEATURE_PARAMS +#define HB_NO_LAYOUT_COLLECT_GLYPHS #define HB_NO_LAYOUT_UNUSED #define HB_NO_MATH +#define HB_NO_MMAP #define HB_NO_NAME +#define HB_NO_OPEN +#define HB_NO_SETLOCALE +#define HB_NO_OT_FONT_GLYPH_NAMES +#define HB_NO_OT_SHAPE_FRACTIONS +#define HB_NO_STAT #define HB_NO_SUBSET_LAYOUT +#define HB_NO_VAR #endif #ifdef HB_MINI @@ -68,7 +81,8 @@ #define HB_NO_LEGACY #endif -/* Closure. */ + +/* Closure of options. */ #ifdef HB_DISABLE_DEPRECATED #define HB_IF_NOT_DEPRECATED(x) @@ -95,6 +109,9 @@ #endif #ifdef HB_NO_LEGACY +#define HB_NO_CMAP_LEGACY_SUBTABLES +#define HB_NO_FALLBACK_SHAPE +#define HB_NO_OT_KERN #define HB_NO_OT_LAYOUT_BLACKLIST #define HB_NO_OT_SHAPE_FALLBACK #endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc index 85993d1964e..a57b97026b7 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc @@ -27,6 +27,9 @@ */ #include "hb.hh" + +#ifdef HAVE_CORETEXT + #include "hb-shaper-impl.hh" #include "hb-coretext.h" @@ -649,7 +652,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan, DEBUG_MSG (CORETEXT, nullptr, __VA_ARGS__); \ ret = false; \ goto fail; \ - } HB_STMT_END; + } HB_STMT_END bool ret = true; CFStringRef string_ref = nullptr; @@ -977,7 +980,7 @@ resize_and_retry: #define SCRATCH_RESTORE() \ scratch_size = scratch_size_saved; \ - scratch = scratch_saved; + scratch = scratch_saved { /* Setup glyphs */ SCRATCH_SAVE(); @@ -1148,3 +1151,6 @@ fail: return ret; } + + +#endif 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 026a62c74e5..43f89a4c4e0 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-deprecated.h +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-deprecated.h @@ -165,30 +165,9 @@ hb_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs, hb_codepoint_t *decomposed); -typedef hb_position_t (*hb_font_get_glyph_kerning_func_t) (hb_font_t *font, void *font_data, - hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, - void *user_data); -typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_h_kerning_func_t; typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_v_kerning_func_t; /** - * hb_font_funcs_set_glyph_h_kerning_func: - * @ffuncs: font functions. - * @func: (closure user_data) (destroy destroy) (scope notified): - * @user_data: - * @destroy: - * - * - * - * Since: 0.9.2 - * Deprecated: 2.0.0 - **/ -HB_EXTERN void -hb_font_funcs_set_glyph_h_kerning_func (hb_font_funcs_t *ffuncs, - hb_font_get_glyph_h_kerning_func_t func, - void *user_data, hb_destroy_func_t destroy); - -/** * hb_font_funcs_set_glyph_v_kerning_func: * @ffuncs: font functions. * @func: (closure user_data) (destroy destroy) (scope notified): @@ -206,19 +185,9 @@ hb_font_funcs_set_glyph_v_kerning_func (hb_font_funcs_t *ffuncs, void *user_data, hb_destroy_func_t destroy); HB_EXTERN hb_position_t -hb_font_get_glyph_h_kerning (hb_font_t *font, - hb_codepoint_t left_glyph, hb_codepoint_t right_glyph); -HB_EXTERN hb_position_t hb_font_get_glyph_v_kerning (hb_font_t *font, hb_codepoint_t top_glyph, hb_codepoint_t bottom_glyph); -HB_EXTERN void -hb_font_get_glyph_kerning_for_direction (hb_font_t *font, - hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, - hb_direction_t direction, - hb_position_t *x, hb_position_t *y); - - #endif HB_END_DECLS 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 057ae3305f9..9b851148b41 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-directwrite.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-directwrite.cc @@ -23,6 +23,9 @@ */ #include "hb.hh" + +#ifdef HAVE_DIRECTWRITE + #include "hb-shaper-impl.hh" #include <DWrite_1.h> @@ -173,7 +176,7 @@ _hb_directwrite_shaper_face_data_create (hb_face_t *face) HB_STMT_START { \ DEBUG_MSG (DIRECTWRITE, nullptr, __VA_ARGS__); \ return nullptr; \ - } HB_STMT_END; + } HB_STMT_END if (FAILED (hr)) FAIL ("Failed to load font file from data!"); @@ -951,10 +954,13 @@ hb_directwrite_face_create (IDWriteFontFace *font_face) * * Return value: DirectWrite IDWriteFontFace object corresponding to the given input * -* Since: REPLACEME +* Since: 2.5.0 **/ IDWriteFontFace * hb_directwrite_face_get_font_face (hb_face_t *face) { return face->data.directwrite->fontFace; } + + +#endif 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 375ef9293a9..1098adb33eb 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc @@ -531,6 +531,7 @@ hb_face_get_table_tags (const hb_face_t *face, */ +#ifndef HB_NO_FACE_COLLECT_UNICODES /** * hb_face_collect_unicodes: * @face: font face. @@ -544,7 +545,6 @@ hb_face_collect_unicodes (hb_face_t *face, { face->table.cmap->collect_unicodes (out); } - /** * hb_face_collect_variation_selectors: * @face: font face. @@ -560,7 +560,6 @@ hb_face_collect_variation_selectors (hb_face_t *face, { face->table.cmap->collect_variation_selectors (out); } - /** * hb_face_collect_variation_unicodes: * @face: font face. @@ -577,7 +576,7 @@ hb_face_collect_variation_unicodes (hb_face_t *face, { face->table.cmap->collect_variation_unicodes (variation_selector, out); } - +#endif /* diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-fallback-shape.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-fallback-shape.cc index 09f02900fac..c5b7c2c2307 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-fallback-shape.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-fallback-shape.cc @@ -26,6 +26,7 @@ #include "hb-shaper-impl.hh" +#ifndef HB_NO_FALLBACK_SHAPE /* * shaper face data @@ -120,3 +121,5 @@ _hb_fallback_shape (hb_shape_plan_t *shape_plan HB_UNUSED, return true; } + +#endif 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 19ee353eb9f..f450d888945 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc @@ -336,7 +336,6 @@ hb_font_get_glyph_v_origin_default (hb_font_t *font, return ret; } -#ifndef HB_DISABLE_DEPRECATED static hb_position_t hb_font_get_glyph_h_kerning_nil (hb_font_t *font HB_UNUSED, void *font_data HB_UNUSED, @@ -356,6 +355,7 @@ hb_font_get_glyph_h_kerning_default (hb_font_t *font, return font->parent_scale_x_distance (font->parent->get_glyph_h_kerning (left_glyph, right_glyph)); } +#ifndef HB_DISABLE_DEPRECATED static hb_position_t hb_font_get_glyph_v_kerning_nil (hb_font_t *font HB_UNUSED, void *font_data HB_UNUSED, @@ -927,7 +927,6 @@ hb_font_get_glyph_v_origin (hb_font_t *font, return font->get_glyph_v_origin (glyph, x, y); } -#ifndef HB_DISABLE_DEPRECATED /** * hb_font_get_glyph_h_kerning: * @font: a font. @@ -939,7 +938,6 @@ hb_font_get_glyph_v_origin (hb_font_t *font, * Return value: * * Since: 0.9.2 - * Deprecated: 2.0.0 **/ hb_position_t hb_font_get_glyph_h_kerning (hb_font_t *font, @@ -948,6 +946,7 @@ hb_font_get_glyph_h_kerning (hb_font_t *font, return font->get_glyph_h_kerning (left_glyph, right_glyph); } +#ifndef HB_DISABLE_DEPRECATED /** * hb_font_get_glyph_v_kerning: * @font: a font. @@ -1177,7 +1176,6 @@ hb_font_subtract_glyph_origin_for_direction (hb_font_t *font, return font->subtract_glyph_origin_for_direction (glyph, direction, x, y); } -#ifndef HB_DISABLE_DEPRECATED /** * hb_font_get_glyph_kerning_for_direction: * @font: a font. @@ -1190,7 +1188,6 @@ hb_font_subtract_glyph_origin_for_direction (hb_font_t *font, * * * Since: 0.9.2 - * Deprecated: 2.0.0 **/ void hb_font_get_glyph_kerning_for_direction (hb_font_t *font, @@ -1200,7 +1197,6 @@ hb_font_get_glyph_kerning_for_direction (hb_font_t *font, { return font->get_glyph_kerning_for_direction (first_glyph, second_glyph, direction, x, y); } -#endif /** * hb_font_get_glyph_extents_for_origin: @@ -1828,6 +1824,7 @@ _hb_font_adopt_var_coords_normalized (hb_font_t *font, font->num_coords = coords_length; } +#ifndef HB_NO_VAR /** * hb_font_set_variations: * @@ -1858,7 +1855,6 @@ hb_font_set_variations (hb_font_t *font, normalized, coords_length); _hb_font_adopt_var_coords_normalized (font, normalized, coords_length); } - /** * hb_font_set_var_coords_design: * @@ -1879,6 +1875,7 @@ hb_font_set_var_coords_design (hb_font_t *font, hb_ot_var_normalize_coords (font->face, coords_length, coords, normalized); _hb_font_adopt_var_coords_normalized (font, normalized, coords_length); } +#endif /** * hb_font_set_var_coords_normalized: diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.h b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.h index e2086d8184f..5bd8cbbcfa1 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.h +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.h @@ -157,6 +157,11 @@ typedef hb_bool_t (*hb_font_get_glyph_origin_func_t) (hb_font_t *font, void *fon typedef hb_font_get_glyph_origin_func_t hb_font_get_glyph_h_origin_func_t; typedef hb_font_get_glyph_origin_func_t hb_font_get_glyph_v_origin_func_t; +typedef hb_position_t (*hb_font_get_glyph_kerning_func_t) (hb_font_t *font, void *font_data, + hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, + void *user_data); +typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_h_kerning_func_t; + typedef hb_bool_t (*hb_font_get_glyph_extents_func_t) (hb_font_t *font, void *font_data, hb_codepoint_t glyph, @@ -357,6 +362,22 @@ hb_font_funcs_set_glyph_v_origin_func (hb_font_funcs_t *ffuncs, void *user_data, hb_destroy_func_t destroy); /** + * hb_font_funcs_set_glyph_h_kerning_func: + * @ffuncs: font functions. + * @func: (closure user_data) (destroy destroy) (scope notified): + * @user_data: + * @destroy: + * + * + * + * Since: 0.9.2 + **/ +HB_EXTERN void +hb_font_funcs_set_glyph_h_kerning_func (hb_font_funcs_t *ffuncs, + hb_font_get_glyph_h_kerning_func_t func, + void *user_data, hb_destroy_func_t destroy); + +/** * hb_font_funcs_set_glyph_extents_func: * @ffuncs: font functions. * @func: (closure user_data) (destroy destroy) (scope notified): @@ -469,6 +490,10 @@ hb_font_get_glyph_v_origin (hb_font_t *font, hb_codepoint_t glyph, hb_position_t *x, hb_position_t *y); +HB_EXTERN hb_position_t +hb_font_get_glyph_h_kerning (hb_font_t *font, + hb_codepoint_t left_glyph, hb_codepoint_t right_glyph); + HB_EXTERN hb_bool_t hb_font_get_glyph_extents (hb_font_t *font, hb_codepoint_t glyph, @@ -531,6 +556,12 @@ hb_font_subtract_glyph_origin_for_direction (hb_font_t *font, hb_direction_t direction, hb_position_t *x, hb_position_t *y); +HB_EXTERN void +hb_font_get_glyph_kerning_for_direction (hb_font_t *font, + hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y); + HB_EXTERN hb_bool_t hb_font_get_glyph_extents_for_origin (hb_font_t *font, hb_codepoint_t glyph, diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.hh index 95551bfd2bb..3b917d12930 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.hh @@ -51,7 +51,7 @@ HB_FONT_FUNC_IMPLEMENT (glyph_v_advances) \ HB_FONT_FUNC_IMPLEMENT (glyph_h_origin) \ HB_FONT_FUNC_IMPLEMENT (glyph_v_origin) \ - HB_IF_NOT_DEPRECATED (HB_FONT_FUNC_IMPLEMENT (glyph_h_kerning)) \ + HB_FONT_FUNC_IMPLEMENT (glyph_h_kerning) \ HB_IF_NOT_DEPRECATED (HB_FONT_FUNC_IMPLEMENT (glyph_v_kerning)) \ HB_FONT_FUNC_IMPLEMENT (glyph_extents) \ HB_FONT_FUNC_IMPLEMENT (glyph_contour_point) \ 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 d70c38a7aef..c01f02991a7 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc @@ -29,6 +29,8 @@ #include "hb.hh" +#ifdef HAVE_FREETYPE + #include "hb-ft.h" #include "hb-font.hh" @@ -346,6 +348,25 @@ hb_ft_get_glyph_v_origin (hb_font_t *font, return true; } +#ifndef HB_NO_OT_SHAPE_FALLBACK +static hb_position_t +hb_ft_get_glyph_h_kerning (hb_font_t *font, + void *font_data, + hb_codepoint_t left_glyph, + hb_codepoint_t right_glyph, + void *user_data HB_UNUSED) +{ + const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data; + FT_Vector kerningv; + + FT_Kerning_Mode mode = font->x_ppem ? FT_KERNING_DEFAULT : FT_KERNING_UNFITTED; + if (FT_Get_Kerning (ft_font->ft_face, left_glyph, right_glyph, mode, &kerningv)) + return 0; + + return kerningv.x; +} +#endif + static hb_bool_t hb_ft_get_glyph_extents (hb_font_t *font, void *font_data, @@ -497,6 +518,10 @@ static struct hb_ft_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t<hb_ft hb_font_funcs_set_glyph_v_advance_func (funcs, hb_ft_get_glyph_v_advance, nullptr, nullptr); //hb_font_funcs_set_glyph_h_origin_func (funcs, hb_ft_get_glyph_h_origin, nullptr, nullptr); hb_font_funcs_set_glyph_v_origin_func (funcs, hb_ft_get_glyph_v_origin, nullptr, nullptr); +#ifndef HB_NO_OT_SHAPE_FALLBACK + hb_font_funcs_set_glyph_h_kerning_func (funcs, hb_ft_get_glyph_h_kerning, nullptr, nullptr); +#endif + //hb_font_funcs_set_glyph_v_kerning_func (funcs, hb_ft_get_glyph_v_kerning, nullptr, nullptr); hb_font_funcs_set_glyph_extents_func (funcs, hb_ft_get_glyph_extents, nullptr, nullptr); hb_font_funcs_set_glyph_contour_point_func (funcs, hb_ft_get_glyph_contour_point, nullptr, nullptr); hb_font_funcs_set_glyph_name_func (funcs, hb_ft_get_glyph_name, nullptr, nullptr); @@ -854,3 +879,6 @@ hb_ft_font_set_funcs (hb_font_t *font) _hb_ft_font_set_funcs (font, ft_face, true); hb_ft_font_set_load_flags (font, FT_LOAD_DEFAULT | FT_LOAD_NO_HINTING); } + + +#endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-glib.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-glib.cc index 576375460bc..db02b6760e3 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-glib.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-glib.cc @@ -28,6 +28,8 @@ #include "hb.hh" +#ifdef HAVE_GLIB + #include "hb-glib.h" #include "hb-machinery.hh" @@ -404,3 +406,6 @@ hb_glib_blob_create (GBytes *gbytes) _hb_g_bytes_unref); } #endif + + +#endif 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 e3a9a6b3fc0..17f1adeb1dc 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 @@ -27,6 +27,8 @@ #include "hb.hh" +#ifdef HAVE_GOBJECT + /* g++ didn't like older gtype.h gcc-only code path. */ #include <glib.h> #if !GLIB_CHECK_VERSION(2,29,16) @@ -44,6 +46,11 @@ /* enumerations from "@filename@" */ /*** END file-production ***/ +/*** BEGIN file-tail ***/ + +#endif +/*** END file-tail ***/ + /*** BEGIN value-header ***/ GType @enum_name@_get_type () 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 3cff880aac3..7f4922ef192 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 @@ -26,6 +26,8 @@ #include "hb.hh" +#ifdef HAVE_GOBJECT + /** * SECTION:hb-gobject @@ -94,3 +96,6 @@ HB_DEFINE_VALUE_TYPE (user_data_key) HB_DEFINE_VALUE_TYPE (ot_math_glyph_variant) HB_DEFINE_VALUE_TYPE (ot_math_glyph_part) + + +#endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.cc index f799f8b227e..9588fa4d6fe 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.cc @@ -26,6 +26,10 @@ * Google Author(s): Behdad Esfahbod */ +#include "hb.hh" + +#ifdef HAVE_GRAPHITE2 + #include "hb-shaper-impl.hh" #include "hb-graphite2.h" @@ -447,3 +451,6 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan HB_UNUSED, return true; } + + +#endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-icu.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-icu.cc index 399829a81bf..e98908de743 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-icu.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-icu.cc @@ -29,6 +29,8 @@ #include "hb.hh" +#ifdef HAVE_ICU + #include "hb-icu.h" #include "hb-machinery.hh" @@ -351,3 +353,6 @@ hb_icu_get_unicode_funcs () { return static_icu_funcs.get_unconst (); } + + +#endif 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 cbbfa26810a..e1362673180 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-mutex.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-mutex.hh @@ -106,7 +106,7 @@ typedef volatile int hb_mutex_impl_t; #define HB_MUTEX_IMPL_INIT 0 #define hb_mutex_impl_init(M) *(M) = 0 #define hb_mutex_impl_lock(M) HB_STMT_START { while (*(M)) HB_SCHED_YIELD (); (*(M))++; } HB_STMT_END -#define hb_mutex_impl_unlock(M) (*(M))--; +#define hb_mutex_impl_unlock(M) (*(M))-- #define hb_mutex_impl_finish(M) HB_STMT_START {} HB_STMT_END 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 674b4dffcd1..d4578205e33 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-null.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-null.hh @@ -74,7 +74,7 @@ using hb_static_size = _hb_static_size<T, void>; */ 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)]; +uint64_t const _hb_NullPool[(HB_NULL_POOL_SIZE + sizeof (uint64_t) - 1) / sizeof (uint64_t)]; /* Generic nul-content Null objects. */ template <typename Type> @@ -128,7 +128,7 @@ struct NullHelper * causing bad memory access. So, races there are not actually introducing incorrectness * in the code. Has ~12kb binary size overhead to have it, also clang build fails with it. */ extern HB_INTERNAL -/*thread_local*/ hb_vector_size_impl_t _hb_CrapPool[(HB_NULL_POOL_SIZE + sizeof (hb_vector_size_impl_t) - 1) / sizeof (hb_vector_size_impl_t)]; +/*thread_local*/ uint64_t _hb_CrapPool[(HB_NULL_POOL_SIZE + sizeof (uint64_t) - 1) / sizeof (uint64_t)]; /* CRAP pool: Common Region for Access Protection. */ template <typename Type> 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 de2d25638a3..e235a97c320 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 @@ -59,11 +59,11 @@ struct IntType typedef Type type; typedef hb_conditional<hb_is_signed (Type), signed, unsigned> wide_type; - IntType<Type, Size>& operator = (wide_type i) { v = i; return *this; } + IntType& operator = (wide_type i) { v = i; return *this; } operator wide_type () const { return v; } - bool operator == (const IntType<Type,Size> &o) const { return (Type) v == (Type) o.v; } - bool operator != (const IntType<Type,Size> &o) const { return !(*this == o); } - HB_INTERNAL static int cmp (const IntType<Type,Size> *a, const IntType<Type,Size> *b) + bool operator == (const IntType &o) const { return (Type) v == (Type) o.v; } + bool operator != (const IntType &o) const { return !(*this == o); } + HB_INTERNAL static int cmp (const IntType *a, const IntType *b) { return b->cmp (*a); } template <typename Type2> int cmp (Type2 a) const @@ -146,7 +146,7 @@ struct LONGDATETIME * system, feature, or baseline */ struct Tag : HBUINT32 { - Tag& operator = (uint32_t i) { HBUINT32::operator= (i); return *this; } + Tag& operator = (hb_tag_t i) { HBUINT32::operator= (i); return *this; } /* What the char* converters return is NOT nul-terminated. Print using "%.4s" */ operator const char* () const { return reinterpret_cast<const char *> (&this->v); } operator char* () { return reinterpret_cast<char *> (&this->v); } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff-common.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff-common.hh index ddec517a166..919cb815025 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff-common.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff-common.hh @@ -82,22 +82,14 @@ struct str_buff_vec_t : hb_vector_t<str_buff_t> template <typename COUNT> 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) + static unsigned int calculate_serialized_size (unsigned int offSize_, unsigned int count, + unsigned int dataSize) { if (count == 0) return COUNT::static_size; @@ -199,11 +191,11 @@ struct CFFIndex 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; + 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 unsigned char *data_base () const @@ -216,12 +208,12 @@ struct CFFIndex if (likely (index < count)) return byte_str_t (data_base () + offset_at (index) - 1, length_at (index)); else - return Null(byte_str_t); + return Null (byte_str_t); } unsigned int get_size () const { - if (this != &Null(CFFIndex)) + if (this != &Null (CFFIndex)) { if (count > 0) return min_size + offset_array_size () + (offset_at (count) - 1); @@ -232,6 +224,15 @@ struct CFFIndex return 0; } + 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)))); + } + protected: unsigned int max_offset () const { @@ -245,10 +246,10 @@ struct CFFIndex } 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 */ + 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); }; @@ -293,7 +294,7 @@ struct CFFIndexOf : CFFIndex<COUNT> /* serialize data */ for (unsigned int i = 0; i < dataArrayLen; i++) { - TYPE *dest = c->start_embed<TYPE> (); + TYPE *dest = c->start_embed<TYPE> (); if (unlikely (dest == nullptr || !dest->serialize (c, dataArray[i], param1, param2))) return_trace (false); @@ -310,7 +311,7 @@ struct CFFIndexOf : CFFIndex<COUNT> const PARAM ¶m) { /* determine offset size */ - unsigned int totalDataSize = 0; + unsigned int totalDataSize = 0; for (unsigned int i = 0; i < dataArrayLen; i++) { unsigned int dataSize = TYPE::calculate_serialized_size (dataArray[i], param); @@ -334,10 +335,9 @@ struct Dict : UnsizedByteStr { 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); } @@ -391,14 +391,10 @@ struct Dict : UnsizedByteStr { return serialize_int_op<HBUINT16, 0, 0x7FFF> (c, op, value, OpCode_shortint); } static bool serialize_offset4_op (hb_serialize_context_t *c, op_code_t op, int value) - { - return serialize_uint4_op (c, op, value); - } + { return serialize_uint4_op (c, op, value); } static bool serialize_offset2_op (hb_serialize_context_t *c, op_code_t op, int value) - { - return serialize_uint2_op (c, op, value); - } + { return serialize_uint2_op (c, op, value); } }; struct TopDict : Dict {}; @@ -483,7 +479,7 @@ struct FDArray : CFFIndexOf<COUNT, FontDict> return_trace (false); /* serialize font dict offsets */ - unsigned int offset = 1; + unsigned int offset = 1; unsigned int fid = 0; for (; fid < fontDicts.length; fid++) { @@ -575,9 +571,7 @@ struct FDSelect0 { } hb_codepoint_t get_fd (hb_codepoint_t glyph) const - { - return (hb_codepoint_t)fds[glyph]; - } + { return (hb_codepoint_t) fds[glyph]; } unsigned int get_size (unsigned int num_glyphs) const { return HBUINT8::static_size * num_glyphs; } @@ -588,7 +582,8 @@ struct FDSelect0 { }; template <typename GID_TYPE, typename FD_TYPE> -struct FDSelect3_4_Range { +struct FDSelect3_4_Range +{ bool sanitize (hb_sanitize_context_t *c, const void * /*nullptr*/, unsigned int fdcount) const { TRACE_SANITIZE (this); @@ -597,12 +592,13 @@ struct FDSelect3_4_Range { GID_TYPE first; FD_TYPE fd; - + public: DEFINE_SIZE_STATIC (GID_TYPE::static_size + FD_TYPE::static_size); }; template <typename GID_TYPE, typename FD_TYPE> -struct FDSelect3_4 { +struct FDSelect3_4 +{ unsigned int get_size () const { return GID_TYPE::static_size * 2 + ranges.get_size (); } @@ -614,10 +610,8 @@ struct FDSelect3_4 { return_trace (false); for (unsigned int i = 1; i < nRanges (); i++) - { if (unlikely (ranges[i - 1].first >= ranges[i].first)) - return_trace (false); - } + return_trace (false); if (unlikely (!sentinel().sanitize (c) || (sentinel() != c->get_num_glyphs ()))) return_trace (false); @@ -649,17 +643,8 @@ struct FDSelect3_4 { typedef FDSelect3_4<HBUINT16, HBUINT8> FDSelect3; typedef FDSelect3_4_Range<HBUINT16, HBUINT8> 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))); - } - +struct FDSelect +{ bool serialize (hb_serialize_context_t *c, const FDSelect &src, unsigned int num_glyphs) { TRACE_SERIALIZE (this); @@ -675,30 +660,46 @@ struct FDSelect { 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; + switch (format) + { + case 0: return format.static_size + u.format0.get_size (num_glyphs); + case 3: return format.static_size + u.format3.get_size (); + default:return 0; + } } hb_codepoint_t get_fd (hb_codepoint_t glyph) const { - if (this == &Null(FDSelect)) + if (this == &Null (FDSelect)) return 0; - if (format == 0) - return u.format0.get_fd (glyph); - else - return u.format3.get_fd (glyph); + switch (format) + { + case 0: return u.format0.get_fd (glyph); + case 3: return u.format3.get_fd (glyph); + default:return 0; + } } - HBUINT8 format; + bool sanitize (hb_sanitize_context_t *c, unsigned int fdcount) const + { + TRACE_SANITIZE (this); + if (unlikely (!c->check_struct (this))) + return_trace (false); + + switch (format) + { + case 0: return_trace (u.format0.sanitize (c, fdcount)); + case 3: return_trace (u.format3.sanitize (c, fdcount)); + default:return_trace (false); + } + } + + HBUINT8 format; union { - FDSelect0 format0; - FDSelect3 format3; + FDSelect0 format0; + FDSelect3 format3; } u; - + public: DEFINE_SIZE_MIN (1); }; 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 index e6dd6a7b8c2..3238ad73a7b 100644 --- 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 @@ -24,11 +24,13 @@ * Adobe Author(s): Michiharu Ariza */ -#include "hb-ot-cff1-table.hh" -#include "hb-cff1-interp-cs.hh" +#include "hb.hh" #ifndef HB_NO_CFF +#include "hb-ot-cff1-table.hh" +#include "hb-cff1-interp-cs.hh" + using namespace CFF; /* SID to code */ @@ -391,4 +393,5 @@ bool OT::cff1::accelerator_t::get_seac_components (hb_codepoint_t glyph, hb_code return false; } + #endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff1-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff1-table.hh index 3a887d3d0ca..31d9d879dcc 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff1-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff1-table.hh @@ -161,21 +161,8 @@ struct CFF1SuppEncData { DEFINE_SIZE_ARRAY_SIZED (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)); - } - +struct Encoding +{ /* serialize a fullset Encoding */ bool serialize (hb_serialize_context_t *c, const Encoding &src) { @@ -197,11 +184,12 @@ struct Encoding { TRACE_SERIALIZE (this); Encoding *dest = c->extend_min (*this); if (unlikely (dest == nullptr)) return_trace (false); - dest->format = format | ((supp_codes.length > 0)? 0x80: 0); - if (format == 0) + dest->format = format | ((supp_codes.length > 0) ? 0x80 : 0); + switch (format) { + case 0: { Encoding0 *fmt0 = c->allocate_size<Encoding0> (Encoding0::min_size + HBUINT8::static_size * enc_count); - if (unlikely (fmt0 == nullptr)) return_trace (false); + if (unlikely (fmt0 == nullptr)) return_trace (false); fmt0->nCodes () = enc_count; unsigned int glyph = 0; for (unsigned int i = 0; i < code_ranges.length; i++) @@ -213,7 +201,9 @@ struct Encoding { return_trace (false); } } - else + break; + + case 1: { Encoding1 *fmt1 = c->allocate_size<Encoding1> (Encoding1::min_size + Encoding1_Range::static_size * code_ranges.length); if (unlikely (fmt1 == nullptr)) return_trace (false); @@ -226,7 +216,11 @@ struct Encoding { fmt1->ranges[i].nLeft = code_ranges[i].glyph; } } - if (supp_codes.length > 0) + break; + + } + + if (supp_codes.length) { CFF1SuppEncData *suppData = c->allocate_size<CFF1SuppEncData> (CFF1SuppEncData::min_size + SuppEncoding::static_size * supp_codes.length); if (unlikely (suppData == nullptr)) return_trace (false); @@ -237,6 +231,7 @@ struct Encoding { suppData->supps[i].glyph = supp_codes[i].glyph; /* actually SID */ } } + return_trace (true); } @@ -245,11 +240,13 @@ struct Encoding { 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; + unsigned int size = min_size; + switch (format) + { + case 0: size += Encoding0::min_size + HBUINT8::static_size * enc_count; break; + case 1: size += Encoding1::min_size + Encoding1_Range::static_size * enc_count; break; + default:return 0; + } if (supp_count > 0) size += CFF1SuppEncData::min_size + SuppEncoding::static_size * supp_count; return size; @@ -258,10 +255,11 @@ struct Encoding { 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 (); + switch (table_format ()) + { + case 0: size += u.format0.get_size (); break; + case 1: size += u.format1.get_size (); break; + } if (has_supplement ()) size += suppEncData ().get_size (); return size; @@ -269,14 +267,16 @@ struct Encoding { 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); + switch (table_format ()) + { + case 0: return u.format0.get_code (glyph); + case 1: return u.format1.get_code (glyph); + default:return 0; + } } - uint8_t table_format () const { return (format & 0x7F); } - bool has_supplement () const { return (format & 0x80) != 0; } + uint8_t table_format () const { return format & 0x7F; } + bool has_supplement () const { return format & 0x80; } void get_supplement_codes (hb_codepoint_t sid, hb_vector_t<hb_codepoint_t> &codes) const { @@ -285,21 +285,37 @@ struct Encoding { suppEncData().get_codes (sid, codes); } + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + if (unlikely (!c->check_struct (this))) + return_trace (false); + + switch (table_format ()) + { + case 0: if (unlikely (!u.format0.sanitize (c))) { return_trace (false); } break; + case 1: if (unlikely (!u.format1.sanitize (c))) { return_trace (false); } break; + default:return_trace (false); + } + return_trace (likely (!has_supplement () || suppEncData ().sanitize (c))); + } + protected: const CFF1SuppEncData &suppEncData () const { - if ((format & 0x7F) == 0) - return StructAfter<CFF1SuppEncData> (u.format0.codes[u.format0.nCodes ()-1]); - else - return StructAfter<CFF1SuppEncData> (u.format1.ranges[u.format1.nRanges ()-1]); + switch (table_format ()) + { + case 0: return StructAfter<CFF1SuppEncData> (u.format0.codes[u.format0.nCodes ()-1]); + case 1: return StructAfter<CFF1SuppEncData> (u.format1.ranges[u.format1.nRanges ()-1]); + default:return Null (CFF1SuppEncData); + } } public: - HBUINT8 format; - + HBUINT8 format; union { - Encoding0 format0; - Encoding1 format1; + Encoding0 format0; + Encoding1 format1; } u; /* CFF1SuppEncData suppEncData; */ @@ -433,23 +449,8 @@ typedef Charset1_2<HBUINT16> Charset2; typedef Charset_Range<HBUINT8> Charset1_Range; typedef Charset_Range<HBUINT16> 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); - } - +struct Charset +{ /* serialize a fullset Charset */ bool serialize (hb_serialize_context_t *c, const Charset &src, unsigned int num_glyphs) { @@ -471,10 +472,12 @@ struct Charset { Charset *dest = c->extend_min (*this); if (unlikely (dest == nullptr)) return_trace (false); dest->format = format; - if (format == 0) + switch (format) + { + case 0: { Charset0 *fmt0 = c->allocate_size<Charset0> (Charset0::min_size + HBUINT16::static_size * (num_glyphs - 1)); - if (unlikely (fmt0 == nullptr)) return_trace (false); + if (unlikely (fmt0 == nullptr)) return_trace (false); unsigned int glyph = 0; for (unsigned int i = 0; i < sid_ranges.length; i++) { @@ -483,7 +486,9 @@ struct Charset { fmt0->sids[glyph++] = sid++; } } - else if (format == 1) + break; + + case 1: { Charset1 *fmt1 = c->allocate_size<Charset1> (Charset1::min_size + Charset1_Range::static_size * sid_ranges.length); if (unlikely (fmt1 == nullptr)) return_trace (false); @@ -495,7 +500,9 @@ struct Charset { fmt1->ranges[i].nLeft = sid_ranges[i].glyph; } } - else /* format 2 */ + break; + + case 2: { Charset2 *fmt2 = c->allocate_size<Charset2> (Charset2::min_size + Charset2_Range::static_size * sid_ranges.length); if (unlikely (fmt2 == nullptr)) return_trace (false); @@ -507,55 +514,71 @@ struct Charset { fmt2->ranges[i].nLeft = sid_ranges[i].glyph; } } + break; + + } 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) + 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; + switch (format) + { + case 0: return min_size + Charset0::min_size + HBUINT16::static_size * (count - 1); + case 1: return min_size + Charset1::min_size + Charset1_Range::static_size * count; + case 2: return min_size + Charset2::min_size + Charset2_Range::static_size * count; + default:return 0; + } } 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; + switch (format) + { + case 0: return min_size + u.format0.get_size (num_glyphs); + case 1: return min_size + u.format1.get_size (num_glyphs); + case 2: return min_size + u.format2.get_size (num_glyphs); + default:return 0; + } } 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); + switch (format) + { + case 0: return u.format0.get_sid (glyph); + case 1: return u.format1.get_sid (glyph); + case 2: return u.format2.get_sid (glyph); + default:return 0; + } } 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); + switch (format) + { + case 0: return u.format0.get_glyph (sid, num_glyphs); + case 1: return u.format1.get_glyph (sid, num_glyphs); + case 2: return u.format2.get_glyph (sid, num_glyphs); + default:return 0; + } + } + + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + if (unlikely (!c->check_struct (this))) + return_trace (false); + + switch (format) + { + case 0: return_trace (u.format0.sanitize (c, c->get_num_glyphs ())); + case 1: return_trace (u.format1.sanitize (c, c->get_num_glyphs ())); + case 2: return_trace (u.format2.sanitize (c, c->get_num_glyphs ())); + default:return_trace (false); + } } HBUINT8 format; 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 index f1fa6ec30b8..9c9e37bd0c4 100644 --- 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 @@ -24,11 +24,13 @@ * Adobe Author(s): Michiharu Ariza */ -#include "hb-ot-cff2-table.hh" -#include "hb-cff2-interp-cs.hh" +#include "hb.hh" #ifndef HB_NO_OT_FONT_CFF +#include "hb-ot-cff2-table.hh" +#include "hb-cff2-interp-cs.hh" + using namespace CFF; struct extents_param_t @@ -142,4 +144,5 @@ bool OT::cff2::accelerator_t::get_extents (hb_font_t *font, return true; } + #endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff2-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff2-table.hh index a7b0ba9beb6..8646cde58d6 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff2-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cff2-table.hh @@ -51,18 +51,6 @@ typedef FDSelect3_4_Range<HBUINT32, HBUINT16> 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); @@ -78,35 +66,51 @@ struct CFF2FDSelect 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; + switch (format) + { + case 0: return format.static_size + u.format0.get_size (num_glyphs); + case 3: return format.static_size + u.format3.get_size (); + case 4: return format.static_size + u.format4.get_size (); + default:return 0; + } } hb_codepoint_t get_fd (hb_codepoint_t glyph) const { - if (this == &Null(CFF2FDSelect)) + 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); + + switch (format) + { + case 0: return u.format0.get_fd (glyph); + case 3: return u.format3.get_fd (glyph); + case 4: return u.format4.get_fd (glyph); + default:return 0; + } } - HBUINT8 format; + bool sanitize (hb_sanitize_context_t *c, unsigned int fdcount) const + { + TRACE_SANITIZE (this); + if (unlikely (!c->check_struct (this))) + return_trace (false); + + switch (format) + { + case 0: return_trace (u.format0.sanitize (c, fdcount)); + case 3: return_trace (u.format3.sanitize (c, fdcount)); + case 4: return_trace (u.format4.sanitize (c, fdcount)); + default:return_trace (false); + } + } + + HBUINT8 format; union { - FDSelect0 format0; - FDSelect3 format3; - FDSelect4 format4; + FDSelect0 format0; + FDSelect3 format3; + FDSelect4 format4; } u; - + public: DEFINE_SIZE_MIN (2); }; 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 9e9679f8b27..ac75bd96a43 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 @@ -756,10 +756,12 @@ struct CmapSubtable hb_codepoint_t *glyph) const { switch (u.format) { +#ifndef HB_NO_CMAP_LEGACY_SUBTABLES case 0: return u.format0 .get_glyph (codepoint, glyph); - case 4: return u.format4 .get_glyph (codepoint, glyph); case 6: return u.format6 .get_glyph (codepoint, glyph); case 10: return u.format10.get_glyph (codepoint, glyph); +#endif + case 4: return u.format4 .get_glyph (codepoint, glyph); case 12: return u.format12.get_glyph (codepoint, glyph); case 13: return u.format13.get_glyph (codepoint, glyph); case 14: @@ -769,10 +771,12 @@ struct CmapSubtable void collect_unicodes (hb_set_t *out) const { switch (u.format) { +#ifndef HB_NO_CMAP_LEGACY_SUBTABLES case 0: u.format0 .collect_unicodes (out); return; - case 4: u.format4 .collect_unicodes (out); return; case 6: u.format6 .collect_unicodes (out); return; case 10: u.format10.collect_unicodes (out); return; +#endif + case 4: u.format4 .collect_unicodes (out); return; case 12: u.format12.collect_unicodes (out); return; case 13: u.format13.collect_unicodes (out); return; case 14: @@ -785,10 +789,12 @@ struct CmapSubtable TRACE_SANITIZE (this); if (!u.format.sanitize (c)) return_trace (false); switch (u.format) { +#ifndef HB_NO_CMAP_LEGACY_SUBTABLES case 0: return_trace (u.format0 .sanitize (c)); - case 4: return_trace (u.format4 .sanitize (c)); case 6: return_trace (u.format6 .sanitize (c)); case 10: return_trace (u.format10.sanitize (c)); +#endif + case 4: return_trace (u.format4 .sanitize (c)); case 12: return_trace (u.format12.sanitize (c)); case 13: return_trace (u.format13.sanitize (c)); case 14: return_trace (u.format14.sanitize (c)); @@ -799,10 +805,12 @@ struct CmapSubtable public: union { HBUINT16 format; /* Format identifier */ +#ifndef HB_NO_CMAP_LEGACY_SUBTABLES CmapSubtableFormat0 format0; - CmapSubtableFormat4 format4; CmapSubtableFormat6 format6; CmapSubtableFormat10 format10; +#endif + CmapSubtableFormat4 format4; CmapSubtableFormat12 format12; CmapSubtableFormat13 format13; CmapSubtableFormat14 format14; @@ -848,11 +856,16 @@ struct cmap size_t final_size () const { return 4 // header - + 8 * 3 // 3 EncodingRecord + + 8 * num_enc_records + CmapSubtableFormat4::get_sub_table_size (this->format4_segments) + CmapSubtableFormat12::get_sub_table_size (this->format12_groups); } + unsigned int num_enc_records; + bool has_unicode_bmp; + bool has_unicode_ucs4; + bool has_ms_bmp; + bool has_ms_ucs4; hb_sorted_vector_t<CmapSubtableFormat4::segment_plan> format4_segments; hb_sorted_vector_t<CmapSubtableLongGroup> format12_groups; }; @@ -860,6 +873,12 @@ struct cmap bool _create_plan (const hb_subset_plan_t *plan, subset_plan *cmap_plan) const { + cmap_plan->has_unicode_bmp = find_subtable (0, 3); + cmap_plan->has_unicode_ucs4 = find_subtable (0, 4); + cmap_plan->has_ms_bmp = find_subtable (3, 1); + cmap_plan->has_ms_ucs4 = find_subtable (3, 10); + cmap_plan->num_enc_records = cmap_plan->has_unicode_bmp + cmap_plan->has_unicode_ucs4 + cmap_plan->has_ms_bmp + cmap_plan->has_ms_ucs4; + if (unlikely (!CmapSubtableFormat4::create_sub_table_plan (plan, &cmap_plan->format4_segments))) return false; @@ -882,32 +901,60 @@ struct cmap table->version = 0; - if (unlikely (!table->encodingRecord.serialize (&c, /* numTables */ cmap_subset_plan.format12_groups ? 3 : 2))) return false; + if (unlikely (!table->encodingRecord.serialize (&c, cmap_subset_plan.num_enc_records))) return false; // TODO(grieger): Convert the below to a for loop + int enc_index = 0; + int unicode_bmp_index = 0; + int unicode_ucs4_index = 0; + int ms_bmp_index = 0; + int ms_ucs4_index = 0; // Format 4, Plat 0 Encoding Record - EncodingRecord &format4_plat0_rec = table->encodingRecord[0]; - format4_plat0_rec.platformID = 0; // Unicode - format4_plat0_rec.encodingID = 3; + if (cmap_subset_plan.has_unicode_bmp) + { + unicode_bmp_index = enc_index; + EncodingRecord &format4_plat0_rec = table->encodingRecord[enc_index++]; + format4_plat0_rec.platformID = 0; // Unicode + format4_plat0_rec.encodingID = 3; + } + + // Format 12, Plat 0 Encoding Record + if (cmap_subset_plan.has_unicode_ucs4) + { + unicode_ucs4_index = enc_index; + EncodingRecord &format12_rec = table->encodingRecord[enc_index++]; + format12_rec.platformID = 0; // Unicode + format12_rec.encodingID = 4; // Unicode UCS-4 + } // Format 4, Plat 3 Encoding Record - EncodingRecord &format4_plat3_rec = table->encodingRecord[1]; - format4_plat3_rec.platformID = 3; // Windows - format4_plat3_rec.encodingID = 1; // Unicode BMP + if (cmap_subset_plan.has_ms_bmp) + { + ms_bmp_index = enc_index; + EncodingRecord &format4_plat3_rec = table->encodingRecord[enc_index++]; + format4_plat3_rec.platformID = 3; // Windows + format4_plat3_rec.encodingID = 1; // Unicode BMP + } - // Format 12 Encoding Record - if (cmap_subset_plan.format12_groups) + // Format 12, Plat 3 Encoding Record + if (cmap_subset_plan.has_ms_ucs4) { - EncodingRecord &format12_rec = table->encodingRecord[2]; + ms_ucs4_index = enc_index; + EncodingRecord &format12_rec = table->encodingRecord[enc_index++]; format12_rec.platformID = 3; // Windows format12_rec.encodingID = 10; // Unicode UCS-4 } // Write out format 4 sub table { - CmapSubtable &subtable = format4_plat0_rec.subtable.serialize (&c, table); - format4_plat3_rec.subtable = (unsigned int) format4_plat0_rec.subtable; + if (unlikely (!cmap_subset_plan.has_unicode_bmp && !cmap_subset_plan.has_ms_bmp)) return false; + EncodingRecord &format4_rec = cmap_subset_plan.has_unicode_bmp? + table->encodingRecord[unicode_bmp_index]: + table->encodingRecord[ms_bmp_index]; + CmapSubtable &subtable = format4_rec.subtable.serialize (&c, table); + if (cmap_subset_plan.has_unicode_bmp && cmap_subset_plan.has_ms_bmp) + table->encodingRecord[ms_bmp_index].subtable = (unsigned int) format4_rec.subtable; subtable.u.format = 4; CmapSubtableFormat4 &format4 = subtable.u.format4; @@ -918,8 +965,14 @@ struct cmap // Write out format 12 sub table. if (cmap_subset_plan.format12_groups) { - EncodingRecord &format12_rec = table->encodingRecord[2]; + if (unlikely (!cmap_subset_plan.has_unicode_ucs4 && !cmap_subset_plan.has_ms_ucs4)) return false; + EncodingRecord &format12_rec = cmap_subset_plan.has_unicode_ucs4? + table->encodingRecord[unicode_ucs4_index]: + table->encodingRecord[ms_ucs4_index]; + CmapSubtable &subtable = format12_rec.subtable.serialize (&c, table); + if (cmap_subset_plan.has_unicode_ucs4 && cmap_subset_plan.has_ms_ucs4) + table->encodingRecord[ms_ucs4_index].subtable = (unsigned int) format12_rec.subtable; subtable.u.format = 12; CmapSubtableFormat12 &format12 = subtable.u.format12; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color.cc index 20c602cdc9b..0e7203a88bf 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color.cc @@ -25,20 +25,21 @@ * Google Author(s): Sascha Brawer, Behdad Esfahbod */ -#include "hb-open-type.hh" +#include "hb.hh" + +#ifndef HB_NO_COLOR + +#include "hb-ot.h" + #include "hb-ot-color-cbdt-table.hh" #include "hb-ot-color-colr-table.hh" #include "hb-ot-color-cpal-table.hh" #include "hb-ot-color-sbix-table.hh" #include "hb-ot-color-svg-table.hh" -#include "hb-ot-face.hh" -#include "hb-ot.h" #include <stdlib.h> #include <string.h> -#include "hb-ot-layout.hh" - /** * SECTION:hb-ot-color @@ -70,9 +71,6 @@ hb_bool_t hb_ot_color_has_palettes (hb_face_t *face) { -#ifdef HB_NO_COLOR - return false; -#endif return face->table.CPAL->has_data (); } @@ -89,9 +87,6 @@ hb_ot_color_has_palettes (hb_face_t *face) unsigned int hb_ot_color_palette_get_count (hb_face_t *face) { -#ifdef HB_NO_COLOR - return 0; -#endif return face->table.CPAL->get_palette_count (); } @@ -115,9 +110,6 @@ hb_ot_name_id_t hb_ot_color_palette_get_name_id (hb_face_t *face, unsigned int palette_index) { -#ifdef HB_NO_COLOR - return HB_OT_NAME_ID_INVALID; -#endif return face->table.CPAL->get_palette_name_id (palette_index); } @@ -140,9 +132,6 @@ hb_ot_name_id_t hb_ot_color_palette_color_get_name_id (hb_face_t *face, unsigned int color_index) { -#ifdef HB_NO_COLOR - return HB_OT_NAME_ID_INVALID; -#endif return face->table.CPAL->get_color_name_id (color_index); } @@ -161,9 +150,6 @@ hb_ot_color_palette_flags_t hb_ot_color_palette_get_flags (hb_face_t *face, unsigned int palette_index) { -#ifdef HB_NO_COLOR - return HB_OT_COLOR_PALETTE_FLAG_DEFAULT; -#endif return face->table.CPAL->get_palette_flags (palette_index); } @@ -195,11 +181,6 @@ hb_ot_color_palette_get_colors (hb_face_t *face, unsigned int *colors_count /* IN/OUT. May be NULL. */, hb_color_t *colors /* OUT. May be NULL. */) { -#ifdef HB_NO_COLOR - if (colors_count) - *colors_count = 0; - return 0; -#endif return face->table.CPAL->get_palette_colors (palette_index, start_offset, colors_count, colors); } @@ -221,9 +202,6 @@ hb_ot_color_palette_get_colors (hb_face_t *face, hb_bool_t hb_ot_color_has_layers (hb_face_t *face) { -#ifdef HB_NO_COLOR - return false; -#endif return face->table.COLR->has_data (); } @@ -250,11 +228,6 @@ hb_ot_color_glyph_get_layers (hb_face_t *face, unsigned int *layer_count, /* IN/OUT. May be NULL. */ hb_ot_color_layer_t *layers /* OUT. May be NULL. */) { -#ifdef HB_NO_COLOR - if (layer_count) - *layer_count = 0; - return 0; -#endif return face->table.COLR->get_glyph_layers (glyph, start_offset, layer_count, layers); } @@ -276,9 +249,6 @@ hb_ot_color_glyph_get_layers (hb_face_t *face, hb_bool_t hb_ot_color_has_svg (hb_face_t *face) { -#ifdef HB_NO_COLOR - return false; -#endif return face->table.SVG->has_data (); } @@ -296,9 +266,6 @@ hb_ot_color_has_svg (hb_face_t *face) hb_blob_t * hb_ot_color_glyph_reference_svg (hb_face_t *face, hb_codepoint_t glyph) { -#ifdef HB_NO_COLOR - return hb_blob_get_empty (); -#endif return face->table.SVG->reference_blob_for_glyph (glyph); } @@ -320,9 +287,6 @@ hb_ot_color_glyph_reference_svg (hb_face_t *face, hb_codepoint_t glyph) hb_bool_t hb_ot_color_has_png (hb_face_t *face) { -#ifdef HB_NO_COLOR - return false; -#endif return face->table.CBDT->has_data () || face->table.sbix->has_data (); } @@ -342,10 +306,6 @@ hb_ot_color_has_png (hb_face_t *face) hb_blob_t * hb_ot_color_glyph_reference_png (hb_font_t *font, hb_codepoint_t glyph) { -#ifdef HB_NO_COLOR - return hb_blob_get_empty (); -#endif - hb_blob_t *blob = hb_blob_get_empty (); if (font->face->table.sbix->has_data ()) @@ -356,3 +316,6 @@ hb_ot_color_glyph_reference_png (hb_font_t *font, hb_codepoint_t glyph) return blob; } + + +#endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-face-table-list.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-face-table-list.hh new file mode 100644 index 00000000000..d07f53c2bae --- /dev/null +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-face-table-list.hh @@ -0,0 +1,126 @@ +/* + * Copyright © 2007,2008,2009 Red Hat, Inc. + * Copyright © 2012,2013 Google, Inc. + * Copyright © 2019, Facebook 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. + * + * Red Hat Author(s): Behdad Esfahbod + * Google Author(s): Behdad Esfahbod + * Facebook Author(s): Behdad Esfahbod + */ + +#ifndef HB_OT_FACE_TABLE_LIST_HH +#define HB_OT_FACE_TABLE_LIST_HH +#endif /* HB_OT_FACE_TABLE_LIST_HH */ /* Dummy header guards */ + +#ifndef HB_OT_ACCELERATOR +#define HB_OT_ACCELERATOR(Namespace, Type) HB_OT_TABLE (Namespace, Type) +#define _HB_OT_ACCELERATOR_UNDEF +#endif + + +/* This lists font tables that the hb_face_t will contain and lazily + * load. Don't add a table unless it's used though. This is not + * exactly free. */ + +/* v--- Add new tables in the right place here. */ + + +/* OpenType fundamentals. */ +HB_OT_TABLE (OT, head) +#if !defined(HB_NO_FACE_COLLECT_UNICODES) || !defined(HB_NO_OT_FONT) +HB_OT_ACCELERATOR (OT, cmap) +#endif +HB_OT_ACCELERATOR (OT, hmtx) +HB_OT_TABLE (OT, OS2) +#ifndef HB_NO_OT_FONT_GLYPH_NAMES +HB_OT_ACCELERATOR (OT, post) +#endif +#ifndef HB_NO_NAME +HB_OT_ACCELERATOR (OT, name) +#endif +#ifndef HB_NO_STAT +HB_OT_TABLE (OT, STAT) +#endif + +/* Vertical layout. */ +HB_OT_ACCELERATOR (OT, vmtx) + +/* TrueType outlines. */ +HB_OT_ACCELERATOR (OT, glyf) + +/* CFF outlines. */ +#ifndef HB_NO_CFF +HB_OT_ACCELERATOR (OT, cff1) +HB_OT_ACCELERATOR (OT, cff2) +HB_OT_TABLE (OT, VORG) +#endif + +/* OpenType variations. */ +#ifndef HB_NO_VAR +HB_OT_TABLE (OT, fvar) +HB_OT_TABLE (OT, avar) +HB_OT_TABLE (OT, MVAR) +#endif + +/* Legacy kern. */ +#ifndef HB_NO_OT_KERN +HB_OT_TABLE (OT, kern) +#endif + +/* OpenType shaping. */ +HB_OT_ACCELERATOR (OT, GDEF) +HB_OT_ACCELERATOR (OT, GSUB) +HB_OT_ACCELERATOR (OT, GPOS) +//HB_OT_TABLE (OT, BASE) +//HB_OT_TABLE (OT, JSTF) + +/* AAT shaping. */ +#ifndef HB_NO_AAT +HB_OT_TABLE (AAT, morx) +HB_OT_TABLE (AAT, mort) +HB_OT_TABLE (AAT, kerx) +HB_OT_TABLE (AAT, ankr) +HB_OT_TABLE (AAT, trak) +HB_OT_TABLE (AAT, lcar) +HB_OT_TABLE (AAT, ltag) +HB_OT_TABLE (AAT, feat) +#endif + +/* OpenType color fonts. */ +#ifndef HB_NO_COLOR +HB_OT_TABLE (OT, COLR) +HB_OT_TABLE (OT, CPAL) +HB_OT_ACCELERATOR (OT, CBDT) +HB_OT_ACCELERATOR (OT, sbix) +HB_OT_ACCELERATOR (OT, SVG) +#endif + +/* OpenType math. */ +#ifndef HB_NO_MATH +HB_OT_TABLE (OT, MATH) +#endif + + +#ifdef _HB_OT_ACCELERATOR_UNDEF +#undef HB_OT_ACCELERATOR +#endif 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 9b17526b7e4..f54d0b63939 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 @@ -46,16 +46,12 @@ void hb_ot_face_t::init0 (hb_face_t *face) { this->face = face; #define HB_OT_TABLE(Namespace, Type) Type.init0 (); -#define HB_OT_ACCELERATOR(Namespace, Type) HB_OT_TABLE (Namespace, Type) - HB_OT_TABLES -#undef HB_OT_ACCELERATOR +#include "hb-ot-face-table-list.hh" #undef HB_OT_TABLE } 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) - HB_OT_TABLES -#undef HB_OT_ACCELERATOR +#include "hb-ot-face-table-list.hh" #undef HB_OT_TABLE } 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 7f47ba6cb8e..e24d380bca8 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 @@ -38,54 +38,10 @@ * hb_ot_face_t */ -#define HB_OT_TABLES \ - /* OpenType fundamentals. */ \ - HB_OT_TABLE(OT, head) \ - HB_OT_ACCELERATOR(OT, cmap) \ - HB_OT_ACCELERATOR(OT, hmtx) \ - HB_OT_ACCELERATOR(OT, vmtx) \ - 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) \ - HB_OT_TABLE(OT, STAT) \ - /* OpenType shaping. */ \ - HB_OT_ACCELERATOR(OT, GDEF) \ - HB_OT_ACCELERATOR(OT, GSUB) \ - HB_OT_ACCELERATOR(OT, GPOS) \ - HB_OT_TABLE(OT, BASE) \ - HB_OT_TABLE(OT, JSTF) \ - /* AAT shaping. */ \ - HB_OT_TABLE(AAT, mort) \ - HB_OT_TABLE(AAT, morx) \ - HB_OT_TABLE(AAT, kerx) \ - HB_OT_TABLE(AAT, ankr) \ - HB_OT_TABLE(AAT, trak) \ - HB_OT_TABLE(AAT, lcar) \ - HB_OT_TABLE(AAT, ltag) \ - HB_OT_TABLE(AAT, feat) \ - /* OpenType variations. */ \ - HB_OT_TABLE(OT, fvar) \ - HB_OT_TABLE(OT, avar) \ - HB_OT_TABLE(OT, MVAR) \ - /* OpenType math. */ \ - HB_OT_TABLE(OT, MATH) \ - /* OpenType color fonts. */ \ - HB_OT_TABLE(OT, COLR) \ - HB_OT_TABLE(OT, CPAL) \ - HB_OT_ACCELERATOR(OT, CBDT) \ - HB_OT_ACCELERATOR(OT, sbix) \ - HB_OT_ACCELERATOR(OT, SVG) \ - /* */ - /* Declare tables. */ #define HB_OT_TABLE(Namespace, Type) namespace Namespace { struct Type; } #define HB_OT_ACCELERATOR(Namespace, Type) HB_OT_TABLE (Namespace, Type##_accelerator_t) -HB_OT_TABLES +#include "hb-ot-face-table-list.hh" #undef HB_OT_ACCELERATOR #undef HB_OT_TABLE @@ -100,9 +56,7 @@ struct hb_ot_face_t { ORDER_ZERO, #define HB_OT_TABLE(Namespace, Type) HB_OT_TABLE_ORDER (Namespace, Type), -#define HB_OT_ACCELERATOR(Namespace, Type) HB_OT_TABLE (Namespace, Type) - HB_OT_TABLES -#undef HB_OT_ACCELERATOR +#include "hb-ot-face-table-list.hh" #undef HB_OT_TABLE }; @@ -111,7 +65,7 @@ struct hb_ot_face_t hb_table_lazy_loader_t<Namespace::Type, HB_OT_TABLE_ORDER (Namespace, Type)> Type; #define HB_OT_ACCELERATOR(Namespace, Type) \ hb_face_lazy_loader_t<Namespace::Type##_accelerator_t, HB_OT_TABLE_ORDER (Namespace, Type)> Type; - HB_OT_TABLES +#include "hb-ot-face-table-list.hh" #undef HB_OT_ACCELERATOR #undef HB_OT_TABLE }; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc index 3344c4b6bfe..999bfac2909 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 @@ -26,6 +26,8 @@ #include "hb.hh" +#ifndef HB_NO_OT_FONT + #include "hb-ot.h" #include "hb-font.hh" @@ -37,7 +39,6 @@ #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" #include "hb-ot-post-table.hh" #include "hb-ot-stat-table.hh" // Just so we compile it; unused otherwise. @@ -149,12 +150,14 @@ hb_ot_get_glyph_v_origin (hb_font_t *font, *x = font->get_glyph_h_advance (glyph) / 2; +#ifndef HB_NO_OT_FONT_CFF const OT::VORG &VORG = *ot_face->VORG; if (VORG.has_data ()) { *y = font->em_scale_y (VORG.get_y_origin (glyph)); return true; } +#endif hb_glyph_extents_t extents = {0}; if (ot_face->glyf->get_extents (glyph, &extents)) @@ -202,6 +205,7 @@ hb_ot_get_glyph_extents (hb_font_t *font, return ret; } +#ifndef HB_NO_OT_FONT_GLYPH_NAMES static hb_bool_t hb_ot_get_glyph_name (hb_font_t *font HB_UNUSED, void *font_data, @@ -212,7 +216,6 @@ hb_ot_get_glyph_name (hb_font_t *font HB_UNUSED, const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data; return ot_face->post->get_glyph_name (glyph, name, size); } - static hb_bool_t hb_ot_get_glyph_from_name (hb_font_t *font HB_UNUSED, void *font_data, @@ -223,6 +226,7 @@ hb_ot_get_glyph_from_name (hb_font_t *font HB_UNUSED, const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data; return ot_face->post->get_glyph_from_name (name, len, glyph); } +#endif static hb_bool_t hb_ot_get_font_h_extents (hb_font_t *font, @@ -275,8 +279,10 @@ static struct hb_ot_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t<hb_ot hb_font_funcs_set_glyph_v_origin_func (funcs, hb_ot_get_glyph_v_origin, nullptr, nullptr); hb_font_funcs_set_glyph_extents_func (funcs, hb_ot_get_glyph_extents, nullptr, nullptr); //hb_font_funcs_set_glyph_contour_point_func (funcs, hb_ot_get_glyph_contour_point, nullptr, nullptr); +#ifndef HB_NO_OT_FONT_GLYPH_NAMES hb_font_funcs_set_glyph_name_func (funcs, hb_ot_get_glyph_name, nullptr, nullptr); hb_font_funcs_set_glyph_from_name_func (funcs, hb_ot_get_glyph_from_name, nullptr, nullptr); +#endif hb_font_funcs_make_immutable (funcs); @@ -316,3 +322,6 @@ hb_ot_font_set_funcs (hb_font_t *font) &font->face->table, nullptr); } + + +#endif 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 1ac9f6ba204..76efdc9b8eb 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 @@ -180,7 +180,7 @@ struct glyf + hb_range (plan->num_output_glyphs ()) | hb_map ([&] (hb_codepoint_t new_gid) { - SubsetGlyph subset_glyph; + SubsetGlyph subset_glyph = {0}; subset_glyph.new_gid = new_gid; // should never fail: all old gids should be mapped 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 b3a97109b87..754a3762832 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 @@ -86,74 +86,71 @@ struct hmtxvmtx return result; } - bool subset (hb_subset_plan_t *plan) const + template<typename Iterator, + hb_requires (hb_is_iterator (Iterator))> + void serialize (hb_serialize_context_t *c, + Iterator it, + unsigned num_advances) { - typename T::accelerator_t _mtx; - _mtx.init (plan->source); - - /* All the trailing glyphs with the same advance can use one LongMetric - * and just keep LSB */ - unsigned int num_output_glyphs = plan->num_output_glyphs (); - unsigned int num_advances = _mtx.num_advances_for_subset (plan); - - /* alloc the new table */ - size_t dest_sz = num_advances * 4 - + (num_output_glyphs - num_advances) * 2; - void *dest = (void *) malloc (dest_sz); - if (unlikely (!dest)) - { - return false; - } - DEBUG_MSG(SUBSET, nullptr, "%c%c%c%c in src has %d advances, %d lsbs", HB_UNTAG(T::tableTag), _mtx.num_advances, _mtx.num_metrics - _mtx.num_advances); - DEBUG_MSG(SUBSET, nullptr, "%c%c%c%c in dest has %d advances, %d lsbs, %u bytes", - HB_UNTAG(T::tableTag), num_advances, num_output_glyphs - num_advances, (unsigned int) dest_sz); - - // Copy everything over - char * dest_pos = (char *) dest; + unsigned idx = 0; + + it + | hb_apply ([c, &idx, num_advances] (const hb_item_type<Iterator>& _) + { + if (idx < num_advances) + { + LongMetric lm; + lm.advance = _.first; + lm.sb = _.second; + if (unlikely (!c->embed<LongMetric> (&lm))) return; + } + else + { + FWORD *sb = c->allocate_size<FWORD> (FWORD::static_size); + if (unlikely (!sb)) return; + *sb = _.second; + } + idx++; + }) + ; + } - bool failed = false; - for (unsigned int i = 0; i < num_output_glyphs; i++) - { - unsigned int side_bearing = 0; - unsigned int advance = 0; - hb_codepoint_t old_gid; - if (plan->old_gid_for_new_gid (i, &old_gid)) - { - // Glyph is not an empty glyph so copy advance and side bearing - // from the input font. - side_bearing = _mtx.get_side_bearing (old_gid); - advance = _mtx.get_advance (old_gid); - } + bool subset (hb_subset_context_t *c) const + { + TRACE_SUBSET (this); + + T *table_prime = c->serializer->start_embed <T> (); + if (unlikely (!table_prime)) return_trace (false); + + accelerator_t _mtx; + _mtx.init (c->plan->source); + unsigned num_advances = _mtx.num_advances_for_subset (c->plan); + + auto it = + + hb_range (c->plan->num_output_glyphs ()) + | hb_map ([c, &_mtx] (unsigned _) + { + hb_codepoint_t old_gid; + if (c->plan->old_gid_for_new_gid (_, &old_gid)) + return hb_pair (_mtx.get_advance (old_gid), _mtx.get_side_bearing (old_gid)); + else + return hb_pair (0u, 0u); + }) + ; + + table_prime->serialize (c->serializer, it, num_advances); - bool has_advance = i < num_advances; - if (has_advance) - { - ((LongMetric *) dest_pos)->advance = advance; - ((LongMetric *) dest_pos)->sb = side_bearing; - } - else - { - *((FWORD *) dest_pos) = side_bearing; - } - dest_pos += (has_advance ? 4 : 2); - } _mtx.fini (); + if (unlikely (c->serializer->ran_out_of_room || c->serializer->in_error ())) + return_trace (false); + // Amend header num hmetrics - if (failed || unlikely (!subset_update_header (plan, num_advances))) + if (unlikely (!subset_update_header (c->plan, num_advances))) { - free (dest); - return false; + return_trace (false); } - hb_blob_t *result = hb_blob_create ((const char *)dest, - dest_sz, - HB_MEMORY_MODE_READONLY, - dest, - free); - bool success = plan->add_table (T::tableTag, result); - hb_blob_destroy (result); - return success; + return_trace (true); } struct accelerator_t diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-common.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-common.hh index f801f5af896..0866760bdc7 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 @@ -499,6 +499,9 @@ struct FeatureParams { bool sanitize (hb_sanitize_context_t *c, hb_tag_t tag) const { +#ifdef HB_NO_LAYOUT_FEATURE_PARAMS + return true; +#endif TRACE_SANITIZE (this); if (tag == HB_TAG ('s','i','z','e')) return_trace (u.size.sanitize (c)); @@ -509,26 +512,26 @@ struct FeatureParams return_trace (true); } +#ifndef HB_NO_LAYOUT_FEATURE_PARAMS const FeatureParamsSize& get_size_params (hb_tag_t tag) const { if (tag == HB_TAG ('s','i','z','e')) return u.size; return Null (FeatureParamsSize); } - const FeatureParamsStylisticSet& get_stylistic_set_params (hb_tag_t tag) const { if ((tag & 0xFFFF0000u) == HB_TAG ('s','s','\0','\0')) /* ssXX */ return u.stylisticSet; return Null (FeatureParamsStylisticSet); } - const FeatureParamsCharacterVariants& get_character_variants_params (hb_tag_t tag) const { if ((tag & 0xFFFF0000u) == HB_TAG ('c','v','\0','\0')) /* cvXX */ return u.characterVariants; return Null (FeatureParamsCharacterVariants); } +#endif private: union { @@ -1747,11 +1750,11 @@ struct VarData float *scalars /*OUT */, unsigned int num_scalars) const { - assert (num_scalars == regionIndices.len); - for (unsigned int i = 0; i < num_scalars; i++) - { - scalars[i] = regions.evaluate (regionIndices.arrayZ[i], coords, coord_count); - } + unsigned count = hb_min (num_scalars, regionIndices.len); + for (unsigned int i = 0; i < count; i++) + scalars[i] = regions.evaluate (regionIndices.arrayZ[i], coords, coord_count); + for (unsigned int i = count; i < num_scalars; i++) + scalars[i] = 0.f; } bool sanitize (hb_sanitize_context_t *c) const @@ -1779,8 +1782,12 @@ struct VariationStore float get_delta (unsigned int outer, unsigned int inner, const int *coords, unsigned int coord_count) const { +#ifdef HB_NO_VAR + return 0.f; +#endif + if (unlikely (outer >= dataSets.len)) - return 0.; + return 0.f; return (this+dataSets[outer]).get_delta (inner, coords, coord_count, @@ -1797,6 +1804,10 @@ struct VariationStore bool sanitize (hb_sanitize_context_t *c) const { +#ifdef HB_NO_VAR + return true; +#endif + TRACE_SANITIZE (this); return_trace (c->check_struct (this) && format == 1 && @@ -1812,6 +1823,12 @@ struct VariationStore float *scalars /*OUT*/, unsigned int num_scalars) const { +#ifdef HB_NO_VAR + for (unsigned i = 0; i < num_scalars; i++) + scalars[i] = 0.f; + return; +#endif + (this+dataSets[ivs]).get_scalars (coords, coord_count, this+regions, &scalars[0], num_scalars); } @@ -2152,10 +2169,14 @@ struct Device { switch (u.b.format) { +#ifndef HB_NO_HINTING case 1: case 2: case 3: return u.hinting.get_x_delta (font); +#endif +#ifndef HB_NO_VAR case 0x8000: return u.variation.get_x_delta (font, store); +#endif default: return 0; } @@ -2165,9 +2186,13 @@ struct Device switch (u.b.format) { case 1: case 2: case 3: +#ifndef HB_NO_HINTING return u.hinting.get_y_delta (font); +#endif +#ifndef HB_NO_VAR case 0x8000: return u.variation.get_y_delta (font, store); +#endif default: return 0; } @@ -2178,10 +2203,14 @@ struct Device TRACE_SANITIZE (this); if (!u.b.format.sanitize (c)) return_trace (false); switch (u.b.format) { +#ifndef HB_NO_HINTING case 1: case 2: case 3: return_trace (u.hinting.sanitize (c)); +#endif +#ifndef HB_NO_VAR case 0x8000: return_trace (u.variation.sanitize (c)); +#endif default: return_trace (true); } @@ -2191,7 +2220,9 @@ struct Device union { DeviceHeader b; HintingDevice hinting; +#ifndef HB_NO_VAR VariationDevice variation; +#endif } u; public: DEFINE_SIZE_UNION (6, b); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gpos-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gpos-table.hh index 86c45be29c6..d371c4b5fca 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gpos-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gpos-table.hh @@ -267,6 +267,13 @@ struct AnchorFormat2 float *x, float *y) const { hb_font_t *font = c->font; + +#ifdef HB_NO_HINTING + *x = font->em_fscale_x (xCoordinate); + *y = font->em_fscale_y (yCoordinate); + return; +#endif + unsigned int x_ppem = font->x_ppem; unsigned int y_ppem = font->y_ppem; hb_position_t cx = 0, cy = 0; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos.hh index 4bc3d7e157e..9a82a4d6773 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos.hh @@ -2661,11 +2661,17 @@ struct GSUBGPOS bool find_variations_index (const int *coords, unsigned int num_coords, unsigned int *index) const - { return (version.to_int () >= 0x00010001u ? this+featureVars : Null(FeatureVariations)) - .find_index (coords, num_coords, index); } + { +#ifdef HB_NOVAR + return false; +#endif + return (version.to_int () >= 0x00010001u ? this+featureVars : Null(FeatureVariations)) + .find_index (coords, num_coords, index); + } const Feature& get_feature_variation (unsigned int feature_index, unsigned int variations_index) const { +#ifndef HB_NO_VAR if (FeatureVariations::NOT_FOUND_INDEX != variations_index && version.to_int () >= 0x00010001u) { @@ -2674,6 +2680,7 @@ struct GSUBGPOS if (feature) return *feature; } +#endif return get_feature (feature_index); } @@ -2695,8 +2702,10 @@ struct GSUBGPOS this, out); +#ifndef HB_NO_VAR if (version.to_int () >= 0x00010001u) out->featureVars.serialize_copy (c->serializer, featureVars, this, out); +#endif return_trace (true); } @@ -2712,12 +2721,19 @@ struct GSUBGPOS { TRACE_SANITIZE (this); typedef OffsetListOf<TLookup> TLookupList; - return_trace (version.sanitize (c) && - likely (version.major == 1) && - scriptList.sanitize (c, this) && - featureList.sanitize (c, this) && - CastR<OffsetTo<TLookupList>> (lookupList).sanitize (c, this) && - (version.to_int () < 0x00010001u || featureVars.sanitize (c, this))); + if (unlikely (!(version.sanitize (c) && + likely (version.major == 1) && + scriptList.sanitize (c, this) && + featureList.sanitize (c, this) && + CastR<OffsetTo<TLookupList>> (lookupList).sanitize (c, this)))) + return_trace (false); + +#ifndef HB_NO_VAR + if (unlikely (!(version.to_int () < 0x00010001u || featureVars.sanitize (c, this)))) + return_trace (false); +#endif + + return_trace (true); } template <typename T> diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout.cc index 1945df4feee..10b9ba092b3 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout.cc @@ -62,6 +62,7 @@ * kern */ +#ifndef HB_NO_OT_KERN /** * hb_ot_layout_has_kerning: * @face: The #hb_face_t to work on @@ -78,7 +79,6 @@ hb_ot_layout_has_kerning (hb_face_t *face) return face->table.kern->has_data (); } - /** * hb_ot_layout_has_machine_kerning: * @face: The #hb_face_t to work on @@ -95,7 +95,6 @@ hb_ot_layout_has_machine_kerning (hb_face_t *face) return face->table.kern->has_state_machine (); } - /** * hb_ot_layout_has_cross_kerning: * @face: The #hb_face_t to work on @@ -128,6 +127,7 @@ hb_ot_layout_kern (const hb_ot_shape_plan_t *plan, kern.apply (&c); } +#endif /* @@ -311,6 +311,7 @@ hb_ot_layout_get_glyphs_in_class (hb_face_t *face, } +#ifndef HB_NO_LAYOUT_UNUSED /** * hb_ot_layout_get_attach_points: * @face: The #hb_face_t to work on @@ -333,19 +334,11 @@ hb_ot_layout_get_attach_points (hb_face_t *face, unsigned int *point_count /* IN/OUT */, unsigned int *point_array /* OUT */) { -#ifdef HB_NO_LAYOUT_UNUSED - if (point_count) - *point_count = 0; - return 0; -#endif - return face->table.GDEF->table->get_attach_points (glyph, start_offset, point_count, point_array); } - - /** * hb_ot_layout_get_ligature_carets: * @font: The #hb_font_t to work on @@ -368,22 +361,19 @@ hb_ot_layout_get_ligature_carets (hb_font_t *font, unsigned int *caret_count /* IN/OUT */, hb_position_t *caret_array /* OUT */) { -#ifdef HB_NO_LAYOUT_UNUSED - if (caret_count) - *caret_count = 0; - return 0; -#endif - unsigned int result_caret_count = 0; unsigned int result = font->face->table.GDEF->table->get_lig_carets (font, direction, glyph, start_offset, &result_caret_count, caret_array); if (result) { if (caret_count) *caret_count = result_caret_count; } +#ifndef HB_NO_AAT else result = font->face->table.lcar->get_lig_carets (font, direction, glyph, start_offset, caret_count, caret_array); +#endif return result; } +#endif /* @@ -397,6 +387,8 @@ OT::GSUB::is_blacklisted (hb_blob_t *blob HB_UNUSED, #ifdef HB_NO_OT_LAYOUT_BLACKLIST return false; #endif + +#ifndef HB_NO_SHAPE_AAT /* Mac OS X prefers morx over GSUB. It also ships with various Indic fonts, * all by 'MUTF' foundry (Tamil MN, Tamil Sangam MN, etc.), that have broken * GSUB/GPOS tables. Some have GSUB with zero scripts, those are ignored by @@ -414,6 +406,7 @@ OT::GSUB::is_blacklisted (hb_blob_t *blob HB_UNUSED, if (unlikely (face->table.OS2->achVendID == HB_TAG ('M','U','T','F') && face->table.morx->has_data ())) return true; +#endif return false; } @@ -1210,6 +1203,7 @@ hb_ot_layout_collect_lookups (hb_face_t *face, } +#ifndef HB_NO_LAYOUT_COLLECT_GLYPHS /** * hb_ot_layout_lookup_collect_glyphs: * @face: #hb_face_t to work upon @@ -1256,6 +1250,7 @@ hb_ot_layout_lookup_collect_glyphs (hb_face_t *face, } } } +#endif /* Variations support */ @@ -1564,6 +1559,7 @@ hb_ot_layout_position_finish_offsets (hb_font_t *font, hb_buffer_t *buffer) } +#ifndef HB_NO_LAYOUT_FEATURE_PARAMS /** * hb_ot_layout_get_size_params: * @face: #hb_face_t to work upon @@ -1626,8 +1622,6 @@ hb_ot_layout_get_size_params (hb_face_t *face, return false; } - - /** * hb_ot_layout_feature_get_name_ids: * @face: #hb_face_t to work upon @@ -1702,8 +1696,6 @@ hb_ot_layout_feature_get_name_ids (hb_face_t *face, if (first_param_id) *first_param_id = HB_OT_NAME_ID_INVALID; return false; } - - /** * hb_ot_layout_feature_get_characters: * @face: #hb_face_t to work upon @@ -1757,6 +1749,7 @@ hb_ot_layout_feature_get_characters (hb_face_t *face, if (char_count) *char_count = len; return cv_params.characters.len; } +#endif /* @@ -1941,11 +1934,6 @@ hb_ot_layout_substitute_lookup (OT::hb_ot_apply_context_t *c, } #if 0 -static const OT::BASE& _get_base (hb_face_t *face) -{ - return *face->table.BASE; -} - hb_bool_t hb_ot_layout_get_baseline (hb_font_t *font, hb_ot_layout_baseline_t baseline, @@ -1954,9 +1942,8 @@ hb_ot_layout_get_baseline (hb_font_t *font, hb_tag_t language_tag, hb_position_t *coord /* OUT. May be NULL. */) { - const OT::BASE &base = _get_base (font->face); - bool result = base.get_baseline (font, baseline, direction, script_tag, - language_tag, coord); + bool result = font->face->table.BASE->get_baseline (font, baseline, direction, script_tag, + language_tag, coord); /* TODO: Simulate https://docs.microsoft.com/en-us/typography/opentype/spec/baselinetags#ideographic-em-box */ if (!result && coord) *coord = 0; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-math.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-math.cc index 7f279232777..9d8c6e735a6 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-math.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-math.cc @@ -24,9 +24,10 @@ * Igalia Author(s): Frédéric Wang */ -#include "hb-open-type.hh" +#include "hb.hh" + +#ifndef HB_NO_MATH -#include "hb-ot-face.hh" #include "hb-ot-math-table.hh" @@ -62,10 +63,6 @@ hb_bool_t hb_ot_math_has_data (hb_face_t *face) { -#ifdef HB_NO_MATH - return false; -#endif - return face->table.MATH->has_data (); } @@ -90,10 +87,6 @@ hb_position_t hb_ot_math_get_constant (hb_font_t *font, hb_ot_math_constant_t constant) { -#ifdef HB_NO_MATH - return 0; -#endif - return font->face->table.MATH->get_constant(constant, font); } @@ -113,10 +106,6 @@ hb_position_t hb_ot_math_get_glyph_italics_correction (hb_font_t *font, hb_codepoint_t glyph) { -#ifdef HB_NO_MATH - return 0; -#endif - return font->face->table.MATH->get_glyph_info().get_italics_correction (glyph, font); } @@ -143,10 +132,6 @@ hb_position_t hb_ot_math_get_glyph_top_accent_attachment (hb_font_t *font, hb_codepoint_t glyph) { -#ifdef HB_NO_MATH - return 0; -#endif - return font->face->table.MATH->get_glyph_info().get_top_accent_attachment (glyph, font); } @@ -165,10 +150,6 @@ hb_bool_t hb_ot_math_is_glyph_extended_shape (hb_face_t *face, hb_codepoint_t glyph) { -#ifdef HB_NO_MATH - return false; -#endif - return face->table.MATH->get_glyph_info().is_extended_shape (glyph); } @@ -197,10 +178,6 @@ hb_ot_math_get_glyph_kerning (hb_font_t *font, hb_ot_math_kern_t kern, hb_position_t correction_height) { -#ifdef HB_NO_MATH - return 0; -#endif - return font->face->table.MATH->get_glyph_info().get_kerning (glyph, kern, correction_height, @@ -238,12 +215,6 @@ hb_ot_math_get_glyph_variants (hb_font_t *font, unsigned int *variants_count, /* IN/OUT */ hb_ot_math_glyph_variant_t *variants /* OUT */) { -#ifdef HB_NO_MATH - if (variants_count) - *variants_count = 0; - return 0; -#endif - return font->face->table.MATH->get_variants().get_glyph_variants (glyph, direction, font, start_offset, variants_count, @@ -272,10 +243,6 @@ hb_position_t hb_ot_math_get_min_connector_overlap (hb_font_t *font, hb_direction_t direction) { -#ifdef HB_NO_MATH - return 0; -#endif - return font->face->table.MATH->get_variants().get_min_connector_overlap (direction, font); } @@ -313,12 +280,6 @@ hb_ot_math_get_glyph_assembly (hb_font_t *font, hb_ot_math_glyph_part_t *parts, /* OUT */ hb_position_t *italics_correction /* OUT */) { -#ifdef HB_NO_MATH - if (parts_count) - *parts_count = 0; - return 0; -#endif - return font->face->table.MATH->get_variants().get_glyph_parts (glyph, direction, font, @@ -327,3 +288,6 @@ hb_ot_math_get_glyph_assembly (hb_font_t *font, parts, italics_correction); } + + +#endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-maxp-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-maxp-table.hh index a2d9167c52c..2ba2cf44d0d 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-maxp-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-maxp-table.hh @@ -94,39 +94,35 @@ struct maxp return_trace (likely (version.major == 0 && version.minor == 0x5000u)); } - bool subset (hb_subset_plan_t *plan) const + bool subset (hb_subset_context_t *c) const { - hb_blob_t *maxp_blob = hb_sanitize_context_t().reference_table<maxp> (plan->source); - hb_blob_t *maxp_prime_blob = hb_blob_copy_writable_or_fail (maxp_blob); - hb_blob_destroy (maxp_blob); + TRACE_SUBSET (this); + maxp *maxp_prime = c->serializer->embed (this); + if (unlikely (!maxp_prime)) return_trace (false); - if (unlikely (!maxp_prime_blob)) { - return false; - } - maxp *maxp_prime = (maxp *) hb_blob_get_data (maxp_prime_blob, nullptr); + maxp_prime->numGlyphs = c->plan->num_output_glyphs (); + if (maxp_prime->version.major == 1) + { + const maxpV1Tail *src_v1 = &StructAfter<maxpV1Tail> (*this); + maxpV1Tail *dest_v1 = c->serializer->embed<maxpV1Tail> (src_v1); + if (unlikely (!dest_v1)) return_trace (false); - maxp_prime->set_num_glyphs (plan->num_output_glyphs ()); - if (plan->drop_hints) - drop_hint_fields (plan, maxp_prime); + if (c->plan->drop_hints) + drop_hint_fields (dest_v1); + } - bool result = plan->add_table (HB_OT_TAG_maxp, maxp_prime_blob); - hb_blob_destroy (maxp_prime_blob); - return result; + return_trace (true); } - static void drop_hint_fields (hb_subset_plan_t *plan HB_UNUSED, maxp *maxp_prime) + static void drop_hint_fields (maxpV1Tail* dest_v1) { - if (maxp_prime->version.major == 1) - { - maxpV1Tail &v1 = StructAfter<maxpV1Tail> (*maxp_prime); - v1.maxZones = 1; - v1.maxTwilightPoints = 0; - v1.maxStorage = 0; - v1.maxFunctionDefs = 0; - v1.maxInstructionDefs = 0; - v1.maxStackElements = 0; - v1.maxSizeOfInstructions = 0; - } + dest_v1->maxZones = 1; + dest_v1->maxTwilightPoints = 0; + dest_v1->maxStorage = 0; + dest_v1->maxFunctionDefs = 0; + dest_v1->maxInstructionDefs = 0; + dest_v1->maxStackElements = 0; + dest_v1->maxSizeOfInstructions = 0; } protected: diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-name-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-name-table.hh index 68d7b3a65a8..59bf4387f39 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-name-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-name-table.hh @@ -63,7 +63,7 @@ struct NameRecord #ifndef HB_NO_OT_NAME_LANGUAGE_AAT if (p == 0) - return _hb_aat_language_get (face, l); + return face->table.ltag->get_language (l); #endif #endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-name.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-name.cc index 5cd1cc1188a..0b5ce810e2f 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-name.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-name.cc @@ -26,9 +26,10 @@ #include "hb.hh" +#ifndef HB_NO_NAME + #include "hb-ot-name-table.hh" -#include "hb-ot-face.hh" #include "hb-utf.hh" @@ -58,11 +59,6 @@ const hb_ot_name_entry_t * hb_ot_name_list_names (hb_face_t *face, unsigned int *num_entries /* OUT */) { -#ifdef HB_NO_NAME - if (num_entries) - *num_entries = 0; - return 0; -#endif const OT::name_accelerator_t &name = *face->table.name; if (num_entries) *num_entries = name.names.length; return (const hb_ot_name_entry_t *) name.names; @@ -172,11 +168,6 @@ hb_ot_name_get_utf8 (hb_face_t *face, unsigned int *text_size /* IN/OUT */, char *text /* OUT */) { -#ifdef HB_NO_NAME - if (text_size) - *text_size = 0; - return 0; -#endif return hb_ot_name_get_utf<hb_utf8_t> (face, name_id, language, text_size, (hb_utf8_t::codepoint_t *) text); } @@ -204,11 +195,6 @@ hb_ot_name_get_utf16 (hb_face_t *face, unsigned int *text_size /* IN/OUT */, uint16_t *text /* OUT */) { -#ifdef HB_NO_NAME - if (text_size) - *text_size = 0; - return 0; -#endif return hb_ot_name_get_utf<hb_utf16_t> (face, name_id, language, text_size, text); } @@ -235,10 +221,8 @@ hb_ot_name_get_utf32 (hb_face_t *face, unsigned int *text_size /* IN/OUT */, uint32_t *text /* OUT */) { -#ifdef HB_NO_NAME - if (text_size) - *text_size = 0; - return 0; -#endif return hb_ot_name_get_utf<hb_utf32_t> (face, name_id, language, text_size, text); } + + +#endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-os2-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-os2-table.hh index 3b6a3727a41..16e29caf367 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-os2-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-os2-table.hh @@ -145,36 +145,28 @@ struct OS2 } } - bool subset (hb_subset_plan_t *plan) const + bool subset (hb_subset_context_t *c) const { - hb_blob_t *os2_blob = hb_sanitize_context_t ().reference_table<OS2> (plan->source); - hb_blob_t *os2_prime_blob = hb_blob_create_sub_blob (os2_blob, 0, -1); - // TODO(grieger): move to hb_blob_copy_writable_or_fail - hb_blob_destroy (os2_blob); - - OS2 *os2_prime = (OS2 *) hb_blob_get_data_writable (os2_prime_blob, nullptr); - if (unlikely (!os2_prime)) { - hb_blob_destroy (os2_prime_blob); - return false; - } + TRACE_SUBSET (this); + OS2 *os2_prime = c->serializer->embed (this); + if (unlikely (!os2_prime)) return_trace (false); uint16_t min_cp, max_cp; - find_min_and_max_codepoint (plan->unicodes, &min_cp, &max_cp); + find_min_and_max_codepoint (c->plan->unicodes, &min_cp, &max_cp); os2_prime->usFirstCharIndex = min_cp; os2_prime->usLastCharIndex = max_cp; - _update_unicode_ranges (plan->unicodes, os2_prime->ulUnicodeRange); - bool result = plan->add_table (HB_OT_TAG_OS2, os2_prime_blob); + _update_unicode_ranges (c->plan->unicodes, os2_prime->ulUnicodeRange); - hb_blob_destroy (os2_prime_blob); - return result; + return_trace (true); } void _update_unicode_ranges (const hb_set_t *codepoints, HBUINT32 ulUnicodeRange[4]) const { + HBUINT32 newBits[4]; for (unsigned int i = 0; i < 4; i++) - ulUnicodeRange[i] = 0; + newBits[i] = 0; hb_codepoint_t cp = HB_SET_VALUE_INVALID; while (codepoints->next (&cp)) { @@ -184,16 +176,19 @@ struct OS2 unsigned int block = bit / 32; unsigned int bit_in_block = bit % 32; unsigned int mask = 1 << bit_in_block; - ulUnicodeRange[block] = ulUnicodeRange[block] | mask; + newBits[block] = newBits[block] | mask; } if (cp >= 0x10000 && cp <= 0x110000) { /* the spec says that bit 57 ("Non Plane 0") implies that there's at least one codepoint beyond the BMP; so I also include all the non-BMP codepoints here */ - ulUnicodeRange[1] = ulUnicodeRange[1] | (1 << 25); + newBits[1] = newBits[1] | (1 << 25); } } + + for (unsigned int i = 0; i < 4; i++) + ulUnicodeRange[i] = ulUnicodeRange[i] & newBits[i]; // set bits only if set in the original } static void find_min_and_max_codepoint (const hb_set_t *codepoints, @@ -218,6 +213,15 @@ struct OS2 font_page_t get_font_page () const { return (font_page_t) (version == 0 ? fsSelection & 0xFF00 : 0); } + unsigned get_size () const + { + unsigned result = min_size; + if (version >= 1) result += v1X.get_size (); + if (version >= 2) result += v2X.get_size (); + if (version >= 5) result += v5X.get_size (); + return result; + } + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-post-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-post-table.hh index 12e08316af5..720e03bac53 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-post-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-post-table.hh @@ -73,26 +73,25 @@ struct post { static constexpr hb_tag_t tableTag = HB_OT_TAG_post; - bool subset (hb_subset_plan_t *plan) const + void serialize (hb_serialize_context_t *c) const { - unsigned int post_prime_length; - hb_blob_t *post_blob = hb_sanitize_context_t ().reference_table<post>(plan->source); - hb_blob_t *post_prime_blob = hb_blob_create_sub_blob (post_blob, 0, post::min_size); - post *post_prime = (post *) hb_blob_get_data_writable (post_prime_blob, &post_prime_length); - hb_blob_destroy (post_blob); - - if (unlikely (!post_prime || post_prime_length != post::min_size)) - { - hb_blob_destroy (post_prime_blob); - DEBUG_MSG(SUBSET, nullptr, "Invalid source post table with length %d.", post_prime_length); - return false; - } + post *post_prime = c->allocate_min<post> (); + if (unlikely (!post_prime)) return; + memcpy (post_prime, this, post::min_size); post_prime->version.major = 3; // Version 3 does not have any glyph names. - bool result = plan->add_table (HB_OT_TAG_post, post_prime_blob); - hb_blob_destroy (post_prime_blob); + } + + bool subset (hb_subset_context_t *c) const + { + TRACE_SUBSET (this); + post *post_prime = c->serializer->start_embed<post> (); + if (unlikely (!post_prime)) return_trace (false); + + serialize (c->serializer); + if (c->serializer->in_error () || c->serializer->ran_out_of_room) return_trace (false); - return result; + return_trace (true); } struct accelerator_t @@ -158,7 +157,7 @@ struct post for (unsigned int i = 0; i < count; i++) gids[i] = i; - hb_sort_r (gids, count, sizeof (gids[0]), cmp_gids, (void *) this); + hb_qsort (gids, count, sizeof (gids[0]), cmp_gids, (void *) this); if (unlikely (!gids_sorted_by_name.cmpexch (nullptr, gids))) { @@ -168,8 +167,8 @@ struct post } hb_bytes_t st (name, len); - const uint16_t *gid = (const uint16_t *) hb_bsearch_r (hb_addressof (st), gids, count, - sizeof (gids[0]), cmp_key, (void *) this); + const uint16_t *gid = (const uint16_t *) hb_bsearch (hb_addressof (st), gids, count, + sizeof (gids[0]), cmp_key, (void *) this); if (gid) { *glyph = *gid; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-myanmar-machine.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-myanmar-machine.hh index d03832fa7c6..b7b04cb6d0c 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-myanmar-machine.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-myanmar-machine.hh @@ -36,31 +36,31 @@ static const unsigned char _myanmar_syllable_machine_trans_keys[] = { 1u, 32u, 3u, 30u, 5u, 29u, 5u, 8u, 5u, 29u, 3u, 25u, 5u, 25u, 5u, 25u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 1u, 16u, 3u, 29u, 3u, 29u, 3u, 29u, - 3u, 29u, 3u, 29u, 3u, 30u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 5u, 29u, - 5u, 8u, 5u, 29u, 3u, 25u, 5u, 25u, 5u, 25u, 3u, 29u, 3u, 29u, 3u, 29u, - 3u, 29u, 1u, 16u, 3u, 30u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, - 3u, 30u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 30u, 3u, 29u, 1u, 32u, - 1u, 32u, 8u, 8u, 0 + 3u, 29u, 3u, 29u, 3u, 30u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, + 5u, 29u, 5u, 8u, 5u, 29u, 3u, 25u, 5u, 25u, 5u, 25u, 3u, 29u, 3u, 29u, + 3u, 29u, 3u, 29u, 1u, 16u, 3u, 30u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, + 3u, 29u, 3u, 30u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 30u, + 3u, 29u, 1u, 32u, 1u, 32u, 8u, 8u, 0 }; static const char _myanmar_syllable_machine_key_spans[] = { 32, 28, 25, 4, 25, 23, 21, 21, 27, 27, 27, 27, 16, 27, 27, 27, - 27, 27, 28, 27, 27, 27, 27, 25, - 4, 25, 23, 21, 21, 27, 27, 27, - 27, 16, 28, 27, 27, 27, 27, 27, - 28, 27, 27, 27, 27, 28, 27, 32, - 32, 1 + 27, 27, 28, 27, 27, 27, 27, 27, + 25, 4, 25, 23, 21, 21, 27, 27, + 27, 27, 16, 28, 27, 27, 27, 27, + 27, 28, 27, 27, 27, 27, 27, 28, + 27, 32, 32, 1 }; static const short _myanmar_syllable_machine_index_offsets[] = { 0, 33, 62, 88, 93, 119, 143, 165, 187, 215, 243, 271, 299, 316, 344, 372, 400, 428, 456, 485, 513, 541, 569, 597, - 623, 628, 654, 678, 700, 722, 750, 778, - 806, 834, 851, 880, 908, 936, 964, 992, - 1020, 1049, 1077, 1105, 1133, 1161, 1190, 1218, - 1251, 1284 + 625, 651, 656, 682, 706, 728, 750, 778, + 806, 834, 862, 879, 908, 936, 964, 992, + 1020, 1048, 1077, 1105, 1133, 1161, 1189, 1217, + 1246, 1274, 1307, 1340 }; static const char _myanmar_syllable_machine_indicies[] = { @@ -126,116 +126,123 @@ static const char _myanmar_syllable_machine_indicies[] = { 21, 21, 21, 21, 21, 21, 32, 33, 34, 35, 36, 43, 21, 22, 21, 24, 24, 21, 25, 21, 26, 21, 21, 21, - 21, 21, 21, 21, 43, 21, 21, 28, + 21, 21, 21, 21, 21, 21, 21, 28, 21, 30, 21, 32, 33, 34, 35, 36, 21, 22, 21, 24, 24, 21, 25, 21, 26, 21, 21, 21, 21, 21, 21, 21, 43, 21, 21, 28, 21, 21, 21, 32, 33, 34, 35, 36, 21, 22, 21, 24, 24, 21, 25, 21, 26, 21, 21, 21, - 21, 21, 21, 21, 43, 21, 21, 28, + 21, 21, 21, 21, 44, 21, 21, 28, 29, 30, 21, 32, 33, 34, 35, 36, - 21, 22, 23, 24, 24, 21, 25, 21, + 21, 22, 21, 24, 24, 21, 25, 21, 26, 21, 21, 21, 21, 21, 21, 21, - 27, 21, 21, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 21, 45, 45, 44, - 5, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 46, 44, 44, 44, 44, 44, - 44, 14, 44, 44, 44, 18, 44, 45, - 45, 44, 5, 44, 45, 45, 44, 5, - 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, - 14, 44, 44, 44, 18, 44, 47, 44, - 45, 45, 44, 5, 44, 14, 44, 44, - 44, 44, 44, 44, 44, 48, 44, 44, - 44, 44, 44, 44, 14, 44, 45, 45, - 44, 5, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 48, 44, 44, 44, 44, - 44, 44, 14, 44, 45, 45, 44, 5, - 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, - 14, 44, 2, 44, 45, 45, 44, 5, - 44, 6, 44, 44, 44, 44, 44, 44, - 44, 49, 44, 44, 49, 44, 44, 44, - 14, 50, 44, 44, 18, 44, 2, 44, - 45, 45, 44, 5, 44, 6, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 14, 44, 44, 44, - 18, 44, 2, 44, 45, 45, 44, 5, - 44, 6, 44, 44, 44, 44, 44, 44, - 44, 49, 44, 44, 44, 44, 44, 44, - 14, 50, 44, 44, 18, 44, 2, 44, - 45, 45, 44, 5, 44, 6, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 14, 50, 44, 44, - 18, 44, 51, 51, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, - 44, 51, 44, 2, 3, 45, 45, 44, - 5, 44, 6, 44, 44, 44, 44, 44, - 44, 44, 8, 44, 44, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 44, - 2, 44, 45, 45, 44, 5, 44, 6, - 44, 44, 44, 44, 44, 44, 44, 8, - 44, 44, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 44, 2, 44, 45, 45, - 44, 5, 44, 6, 44, 44, 44, 44, - 44, 44, 44, 52, 44, 44, 44, 44, - 44, 44, 14, 15, 16, 17, 18, 44, - 2, 44, 45, 45, 44, 5, 44, 6, - 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 14, 15, - 16, 17, 18, 44, 2, 44, 45, 45, - 44, 5, 44, 6, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 14, 15, 16, 44, 18, 44, - 2, 44, 45, 45, 44, 5, 44, 6, - 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 14, 44, - 16, 44, 18, 44, 2, 44, 45, 45, - 44, 5, 44, 6, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 14, 15, 16, 17, 18, 52, - 44, 2, 44, 45, 45, 44, 5, 44, - 6, 44, 44, 44, 44, 44, 44, 44, - 52, 44, 44, 10, 44, 12, 44, 14, - 15, 16, 17, 18, 44, 2, 44, 45, - 45, 44, 5, 44, 6, 44, 44, 44, - 44, 44, 44, 44, 52, 44, 44, 10, - 44, 44, 44, 14, 15, 16, 17, 18, - 44, 2, 44, 45, 45, 44, 5, 44, - 6, 44, 44, 44, 44, 44, 44, 44, - 52, 44, 44, 10, 11, 12, 44, 14, - 15, 16, 17, 18, 44, 2, 3, 45, - 45, 44, 5, 44, 6, 44, 44, 44, - 44, 44, 44, 44, 8, 44, 44, 10, + 21, 21, 21, 28, 29, 30, 21, 32, + 33, 34, 35, 36, 21, 22, 23, 24, + 24, 21, 25, 21, 26, 21, 21, 21, + 21, 21, 21, 21, 27, 21, 21, 28, + 29, 30, 31, 32, 33, 34, 35, 36, + 21, 46, 46, 45, 5, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 47, 45, + 45, 45, 45, 45, 45, 14, 45, 45, + 45, 18, 45, 46, 46, 45, 5, 45, + 46, 46, 45, 5, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 14, 45, 45, 45, + 18, 45, 48, 45, 46, 46, 45, 5, + 45, 14, 45, 45, 45, 45, 45, 45, + 45, 49, 45, 45, 45, 45, 45, 45, + 14, 45, 46, 46, 45, 5, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 49, + 45, 45, 45, 45, 45, 45, 14, 45, + 46, 46, 45, 5, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 14, 45, 2, 45, + 46, 46, 45, 5, 45, 6, 45, 45, + 45, 45, 45, 45, 45, 50, 45, 45, + 50, 45, 45, 45, 14, 51, 45, 45, + 18, 45, 2, 45, 46, 46, 45, 5, + 45, 6, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, + 14, 45, 45, 45, 18, 45, 2, 45, + 46, 46, 45, 5, 45, 6, 45, 45, + 45, 45, 45, 45, 45, 50, 45, 45, + 45, 45, 45, 45, 14, 51, 45, 45, + 18, 45, 2, 45, 46, 46, 45, 5, + 45, 6, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, + 14, 51, 45, 45, 18, 45, 52, 52, + 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 52, 45, 2, + 3, 46, 46, 45, 5, 45, 6, 45, + 45, 45, 45, 45, 45, 45, 8, 45, + 45, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 45, 2, 45, 46, 46, + 45, 5, 45, 6, 45, 45, 45, 45, + 45, 45, 45, 8, 45, 45, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 45, + 2, 45, 46, 46, 45, 5, 45, 6, + 45, 45, 45, 45, 45, 45, 45, 53, + 45, 45, 45, 45, 45, 45, 14, 15, + 16, 17, 18, 45, 2, 45, 46, 46, + 45, 5, 45, 6, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 14, 15, 16, 17, 18, 45, + 2, 45, 46, 46, 45, 5, 45, 6, + 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 14, 15, + 16, 45, 18, 45, 2, 45, 46, 46, + 45, 5, 45, 6, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 14, 45, 16, 45, 18, 45, + 2, 45, 46, 46, 45, 5, 45, 6, + 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 14, 15, + 16, 17, 18, 53, 45, 2, 45, 46, + 46, 45, 5, 45, 6, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 10, + 45, 12, 45, 14, 15, 16, 17, 18, + 45, 2, 45, 46, 46, 45, 5, 45, + 6, 45, 45, 45, 45, 45, 45, 45, + 53, 45, 45, 10, 45, 45, 45, 14, + 15, 16, 17, 18, 45, 2, 45, 46, + 46, 45, 5, 45, 6, 45, 45, 45, + 45, 45, 45, 45, 54, 45, 45, 10, + 11, 12, 45, 14, 15, 16, 17, 18, + 45, 2, 45, 46, 46, 45, 5, 45, + 6, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 10, 11, 12, 45, 14, + 15, 16, 17, 18, 45, 2, 3, 46, + 46, 45, 5, 45, 6, 45, 45, 45, + 45, 45, 45, 45, 8, 45, 45, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 44, 22, 23, 24, 24, 21, 25, 21, + 45, 22, 23, 24, 24, 21, 25, 21, 26, 21, 21, 21, 21, 21, 21, 21, - 53, 21, 21, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 21, 22, 54, + 55, 21, 21, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 21, 22, 56, 24, 24, 21, 25, 21, 26, 21, 21, 21, 21, 21, 21, 21, 27, 21, 21, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 21, 1, 1, 2, 3, 45, 45, - 44, 5, 44, 6, 1, 44, 44, 44, - 44, 1, 44, 8, 44, 44, 10, 11, + 36, 21, 1, 1, 2, 3, 46, 46, + 45, 5, 45, 6, 1, 45, 45, 45, + 45, 1, 45, 8, 45, 45, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 44, 1, 44, 1, 1, 55, 55, 55, - 55, 55, 55, 55, 55, 1, 55, 55, - 55, 55, 1, 55, 55, 55, 55, 55, - 55, 55, 55, 55, 55, 55, 55, 55, - 55, 55, 1, 55, 56, 55, 0 + 45, 1, 45, 1, 1, 57, 57, 57, + 57, 57, 57, 57, 57, 1, 57, 57, + 57, 57, 1, 57, 57, 57, 57, 57, + 57, 57, 57, 57, 57, 57, 57, 57, + 57, 57, 1, 57, 58, 57, 0 }; static const char _myanmar_syllable_machine_trans_targs[] = { - 0, 1, 23, 33, 0, 24, 30, 45, - 35, 48, 36, 41, 42, 43, 26, 38, - 39, 40, 29, 44, 49, 0, 2, 12, + 0, 1, 24, 34, 0, 25, 31, 47, + 36, 50, 37, 42, 43, 44, 27, 39, + 40, 41, 30, 46, 51, 0, 2, 12, 0, 3, 9, 13, 14, 19, 20, 21, - 5, 16, 17, 18, 8, 22, 4, 6, - 7, 10, 11, 15, 0, 0, 25, 27, - 28, 31, 32, 34, 37, 46, 47, 0, - 0 + 5, 16, 17, 18, 8, 23, 4, 6, + 7, 10, 11, 15, 22, 0, 0, 26, + 28, 29, 32, 33, 35, 38, 45, 48, + 49, 0, 0 }; static const char _myanmar_syllable_machine_trans_actions[] = { @@ -244,9 +251,9 @@ static const char _myanmar_syllable_machine_trans_actions[] = { 0, 0, 0, 0, 0, 5, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 7, 8, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 9, - 10 + 0, 0, 0, 0, 0, 7, 8, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 9, 10 }; static const char _myanmar_syllable_machine_to_state_actions[] = { @@ -256,7 +263,7 @@ static const char _myanmar_syllable_machine_to_state_actions[] = { 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 }; static const char _myanmar_syllable_machine_from_state_actions[] = { @@ -266,17 +273,17 @@ static const char _myanmar_syllable_machine_from_state_actions[] = { 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 }; static const short _myanmar_syllable_machine_eof_trans[] = { 0, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 45, - 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 22, 22, 45, - 56, 56 + 22, 22, 22, 22, 22, 22, 22, 22, + 46, 46, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 46, 46, 46, 46, 22, + 22, 46, 58, 58 }; static const int myanmar_syllable_machine_start = 0; @@ -309,7 +316,7 @@ find_syllables (hb_buffer_t *buffer) int cs; hb_glyph_info_t *info = buffer->info; -#line 313 "hb-ot-shape-complex-myanmar-machine.hh" +#line 320 "hb-ot-shape-complex-myanmar-machine.hh" { cs = myanmar_syllable_machine_start; ts = 0; @@ -325,7 +332,7 @@ find_syllables (hb_buffer_t *buffer) unsigned int syllable_serial = 1; -#line 329 "hb-ot-shape-complex-myanmar-machine.hh" +#line 336 "hb-ot-shape-complex-myanmar-machine.hh" { int _slen; int _trans; @@ -339,7 +346,7 @@ _resume: #line 1 "NONE" {ts = p;} break; -#line 343 "hb-ot-shape-complex-myanmar-machine.hh" +#line 350 "hb-ot-shape-complex-myanmar-machine.hh" } _keys = _myanmar_syllable_machine_trans_keys + (cs<<1); @@ -389,7 +396,7 @@ _eof_trans: #line 90 "hb-ot-shape-complex-myanmar-machine.rl" {te = p;p--;{ found_syllable (non_myanmar_cluster); }} break; -#line 393 "hb-ot-shape-complex-myanmar-machine.hh" +#line 400 "hb-ot-shape-complex-myanmar-machine.hh" } _again: @@ -398,7 +405,7 @@ _again: #line 1 "NONE" {ts = 0;} break; -#line 402 "hb-ot-shape-complex-myanmar-machine.hh" +#line 409 "hb-ot-shape-complex-myanmar-machine.hh" } if ( ++p != pe ) diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-myanmar-machine.rl b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-myanmar-machine.rl index c4e300fda93..66599893853 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-myanmar-machine.rl +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-myanmar-machine.rl @@ -69,7 +69,7 @@ k = (Ra As H); # Kinzi c = C|Ra; # is_consonant -medial_group = MY? MR? MW? MH? As?; +medial_group = MY? As? MR? ((MW MH? | MH) As?)?; main_vowel_group = (VPre.VS?)* VAbv* VBlw* A* (DB As?)?; post_vowel_group = VPst MH? As* VAbv* A* (DB As?)?; pwo_tone_group = PT A* DB? As?; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.cc index c63c3adee0c..7690c22294a 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.cc @@ -98,21 +98,30 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan, plan.props = props; plan.shaper = shaper; map.compile (plan.map, key); +#ifndef HB_NO_SHAPE_AAT if (apply_morx) aat_map.compile (plan.aat_map); +#endif +#ifndef HB_NO_OT_SHAPE_FRACTIONS plan.frac_mask = plan.map.get_1_mask (HB_TAG ('f','r','a','c')); plan.numr_mask = plan.map.get_1_mask (HB_TAG ('n','u','m','r')); plan.dnom_mask = plan.map.get_1_mask (HB_TAG ('d','n','o','m')); plan.has_frac = plan.frac_mask || (plan.numr_mask && plan.dnom_mask); +#endif + plan.rtlm_mask = plan.map.get_1_mask (HB_TAG ('r','t','l','m')); hb_tag_t kern_tag = HB_DIRECTION_IS_HORIZONTAL (props.direction) ? HB_TAG ('k','e','r','n') : HB_TAG ('v','k','r','n'); +#ifndef HB_NO_OT_KERN plan.kern_mask = plan.map.get_mask (kern_tag); - plan.trak_mask = plan.map.get_mask (HB_TAG ('t','r','a','k')); - plan.requested_kerning = !!plan.kern_mask; +#endif +#ifndef HB_NO_SHAPE_AAT + plan.trak_mask = plan.map.get_mask (HB_TAG ('t','r','a','k')); plan.requested_tracking = !!plan.trak_mask; +#endif + bool has_gpos_kern = plan.map.get_feature_index (1, kern_tag) != HB_OT_LAYOUT_NO_FEATURE_INDEX; bool disable_gpos = plan.shaper->gpos_tag && plan.shaper->gpos_tag != plan.map.chosen_script[1]; @@ -152,24 +161,33 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan, if (!plan.apply_kerx && !has_gpos_kern) { /* Apparently Apple applies kerx if GPOS kern was not applied. */ - if (0) - ; #ifndef HB_NO_SHAPE_AAT - else if (hb_aat_layout_has_positioning (face)) + if (hb_aat_layout_has_positioning (face)) plan.apply_kerx = true; + else #endif - else if (hb_ot_layout_has_kerning (face)) +#ifndef HB_NO_OT_KERN + if (hb_ot_layout_has_kerning (face)) plan.apply_kern = true; +#endif } plan.zero_marks = script_zero_marks && !plan.apply_kerx && - (!plan.apply_kern || !hb_ot_layout_has_machine_kerning (face)); + (!plan.apply_kern +#ifndef HB_NO_OT_KERN + || !hb_ot_layout_has_machine_kerning (face) +#endif + ); plan.has_gpos_mark = !!plan.map.get_1_mask (HB_TAG ('m','a','r','k')); plan.adjust_mark_positioning_when_zeroing = !plan.apply_gpos && !plan.apply_kerx && - (!plan.apply_kern || !hb_ot_layout_has_cross_kerning (face)); + (!plan.apply_kern +#ifndef HB_NO_OT_KERN + || !hb_ot_layout_has_cross_kerning (face) +#endif + ); plan.fallback_mark_positioning = plan.adjust_mark_positioning_when_zeroing && script_fallback_mark_positioning; @@ -185,7 +203,9 @@ hb_ot_shape_plan_t::init0 (hb_face_t *face, const hb_shape_plan_key_t *key) { map.init (); +#ifndef HB_NO_SHAPE_AAT aat_map.init (); +#endif hb_ot_shape_planner_t planner (face, &key->props); @@ -213,16 +233,20 @@ hb_ot_shape_plan_t::fini () shaper->data_destroy (const_cast<void *> (data)); map.fini (); +#ifndef HB_NO_SHAPE_AAT aat_map.fini (); +#endif } void hb_ot_shape_plan_t::substitute (hb_font_t *font, hb_buffer_t *buffer) const { +#ifndef HB_NO_SHAPE_AAT if (unlikely (apply_morx)) hb_aat_layout_substitute (this, font, buffer); else +#endif map.substitute (this, font, buffer); } @@ -232,15 +256,21 @@ hb_ot_shape_plan_t::position (hb_font_t *font, { if (this->apply_gpos) map.position (this, font, buffer); +#ifndef HB_NO_SHAPE_AAT else if (this->apply_kerx) hb_aat_layout_position (this, font, buffer); +#endif +#ifndef HB_NO_OT_KERN else if (this->apply_kern) hb_ot_layout_kern (this, font, buffer); +#endif else _hb_ot_shape_fallback_kern (this, font, buffer); +#ifndef HB_NO_SHAPE_AAT if (this->apply_trak) hb_aat_layout_track (this, font, buffer); +#endif } @@ -292,18 +322,22 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner, break; } +#ifndef HB_NO_OT_SHAPE_FRACTIONS /* Automatic fractions. */ map->add_feature (HB_TAG ('f','r','a','c')); map->add_feature (HB_TAG ('n','u','m','r')); map->add_feature (HB_TAG ('d','n','o','m')); +#endif /* Random! */ map->enable_feature (HB_TAG ('r','a','n','d'), F_RANDOM, HB_OT_MAP_MAX_VALUE); +#ifndef HB_NO_SHAPE_AAT /* Tracking. We enable dummy feature here just to allow disabling * AAT 'trak' table using features. * https://github.com/harfbuzz/harfbuzz/issues/1303 */ map->enable_feature (HB_TAG ('t','r','a','k'), F_HAS_FALLBACK); +#endif map->enable_feature (HB_TAG ('H','A','R','F')); @@ -336,6 +370,7 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner, feature->value); } +#ifndef HB_NO_SHAPE_AAT if (planner->apply_morx) { hb_aat_map_builder_t *aat_map = &planner->aat_map; @@ -345,6 +380,7 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner, aat_map->add_feature (feature->tag, feature->value); } } +#endif if (planner->shaper->override_features) planner->shaper->override_features (planner); @@ -569,6 +605,10 @@ hb_ot_mirror_chars (const hb_ot_shape_context_t *c) static inline void hb_ot_shape_setup_masks_fraction (const hb_ot_shape_context_t *c) { +#ifdef HB_NO_OT_SHAPE_FRACTIONS + return; +#endif + if (!(c->buffer->scratch_flags & HB_BUFFER_SCRATCH_FLAG_HAS_NON_ASCII) || !c->plan->has_frac) return; @@ -779,8 +819,10 @@ static inline void hb_ot_substitute_post (const hb_ot_shape_context_t *c) { hb_ot_hide_default_ignorables (c->buffer, c->font); +#ifndef HB_NO_SHAPE_AAT if (c->plan->apply_morx) hb_aat_layout_remove_deleted_glyphs (c->buffer); +#endif if (c->plan->shaper->postprocess_glyphs) c->plan->shaper->postprocess_glyphs (c->plan, c->buffer, c->font); @@ -914,8 +956,10 @@ hb_ot_position_complex (const hb_ot_shape_context_t *c) /* Finish off. Has to follow a certain order. */ hb_ot_layout_position_finish_advances (c->font, c->buffer); hb_ot_zero_width_default_ignorables (c->buffer); +#ifndef HB_NO_SHAPE_AAT if (c->plan->apply_morx) hb_aat_layout_zero_width_deleted_glyphs (c->buffer); +#endif hb_ot_layout_position_finish_offsets (c->font, c->buffer); /* The nil glyph_h_origin() func returns 0, so no need to apply it. */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.hh index b7c0f106531..fec8983c604 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.hh @@ -65,14 +65,40 @@ struct hb_ot_shape_plan_t hb_ot_map_t map; hb_aat_map_t aat_map; const void *data; +#ifndef HB_NO_OT_SHAPE_FRACTIONS hb_mask_t frac_mask, numr_mask, dnom_mask; +#else + static constexpr hb_mask_t frac_mask = 0; + static constexpr hb_mask_t numr_mask = 0; + static constexpr hb_mask_t dnom_mask = 0; +#endif hb_mask_t rtlm_mask; +#ifndef HB_NO_OT_KERN hb_mask_t kern_mask; +#else + static constexpr hb_mask_t kern_mask = 0; +#endif +#ifndef HB_NO_SHAPE_AAT hb_mask_t trak_mask; +#else + static constexpr hb_mask_t trak_mask = 0; +#endif +#ifndef HB_NO_OT_KERN bool requested_kerning : 1; +#else + static constexpr bool requested_kerning = false; +#endif +#ifndef HB_NO_SHAPE_AAT bool requested_tracking : 1; +#else + static constexpr bool requested_tracking = false; +#endif +#ifndef HB_NO_OT_SHAPE_FRACTIONS bool has_frac : 1; +#else + static constexpr bool has_frac = false; +#endif bool has_gpos_mark : 1; bool zero_marks : 1; bool fallback_glyph_classes : 1; @@ -80,7 +106,11 @@ struct hb_ot_shape_plan_t bool adjust_mark_positioning_when_zeroing : 1; bool apply_gpos : 1; +#ifndef HB_NO_OT_KERN bool apply_kern : 1; +#else + static constexpr bool apply_kern = false; +#endif #ifndef HB_NO_SHAPE_AAT bool apply_kerx : 1; bool apply_morx : 1; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-stat-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-stat-table.hh index 03604a0adf9..98bdfa32469 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-stat-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-stat-table.hh @@ -59,14 +59,14 @@ enum struct AxisValueFormat1 { + hb_ot_name_id_t get_value_name_id () const { return valueNameID; } + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); } - hb_ot_name_id_t get_value_name_id () const { return valueNameID; } - protected: HBUINT16 format; /* Format identifier — set to 1. */ HBUINT16 axisIndex; /* Zero-base index into the axis record array @@ -84,14 +84,14 @@ struct AxisValueFormat1 struct AxisValueFormat2 { + hb_ot_name_id_t get_value_name_id () const { return valueNameID; } + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); } - hb_ot_name_id_t get_value_name_id () const { return valueNameID; } - protected: HBUINT16 format; /* Format identifier — set to 2. */ HBUINT16 axisIndex; /* Zero-base index into the axis record array @@ -113,14 +113,14 @@ struct AxisValueFormat2 struct AxisValueFormat3 { + hb_ot_name_id_t get_value_name_id () const { return valueNameID; } + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); } - hb_ot_name_id_t get_value_name_id () const { return valueNameID; } - protected: HBUINT16 format; /* Format identifier — set to 3. */ HBUINT16 axisIndex; /* Zero-base index into the axis record array @@ -157,14 +157,14 @@ struct AxisValueRecord struct AxisValueFormat4 { + hb_ot_name_id_t get_value_name_id () const { return valueNameID; } + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); } - hb_ot_name_id_t get_value_name_id () const { return valueNameID; } - protected: HBUINT16 format; /* Format identifier — set to 4. */ HBUINT16 axisCount; /* The total number of axes contributing to @@ -183,31 +183,31 @@ struct AxisValueFormat4 struct AxisValue { - bool sanitize (hb_sanitize_context_t *c) const + hb_ot_name_id_t get_value_name_id () const { - TRACE_SANITIZE (this); - if (unlikely (!c->check_struct (this))) - return_trace (false); - switch (u.format) { - case 1: return_trace (likely (u.format1.sanitize (c))); - case 2: return_trace (likely (u.format2.sanitize (c))); - case 3: return_trace (likely (u.format3.sanitize (c))); - case 4: return_trace (likely (u.format4.sanitize (c))); - default: return_trace (true); + case 1: return u.format1.get_value_name_id (); + case 2: return u.format2.get_value_name_id (); + case 3: return u.format3.get_value_name_id (); + case 4: return u.format4.get_value_name_id (); + default:return HB_OT_NAME_ID_INVALID; } } - hb_ot_name_id_t get_value_name_id () const + bool sanitize (hb_sanitize_context_t *c) const { + TRACE_SANITIZE (this); + if (unlikely (!c->check_struct (this))) + return_trace (false); + switch (u.format) { - case 1: return u.format1.get_value_name_id (); - case 2: return u.format2.get_value_name_id (); - case 3: return u.format3.get_value_name_id (); - case 4: return u.format4.get_value_name_id (); - default: return HB_OT_NAME_ID_INVALID; + case 1: return_trace (u.format1.sanitize (c)); + case 2: return_trace (u.format2.sanitize (c)); + case 3: return_trace (u.format3.sanitize (c)); + case 4: return_trace (u.format4.sanitize (c)); + default:return_trace (true); } } @@ -226,14 +226,14 @@ struct AxisValue struct StatAxisRecord { + hb_ot_name_id_t get_name_id () const { return nameID; } + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); } - hb_ot_name_id_t get_name_id () const { return nameID; } - protected: Tag tag; /* A tag identifying the axis of design variation. */ NameID nameID; /* The name ID for entries in the 'name' table that @@ -249,16 +249,6 @@ struct STAT { static constexpr hb_tag_t tableTag = HB_OT_TAG_STAT; - bool sanitize (hb_sanitize_context_t *c) const - { - TRACE_SANITIZE (this); - return_trace (likely (c->check_struct (this) && - version.major == 1 && - version.minor > 0 && - designAxesOffset.sanitize (c, this, designAxisCount) && - offsetToAxisValueOffsets.sanitize (c, this, axisValueCount, &(this+offsetToAxisValueOffsets)))); - } - bool has_data () const { return version.to_int (); } unsigned get_design_axis_count () const { return designAxisCount; } @@ -295,6 +285,16 @@ struct STAT ; } + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (likely (c->check_struct (this) && + version.major == 1 && + version.minor > 0 && + designAxesOffset.sanitize (c, this, designAxisCount) && + offsetToAxisValueOffsets.sanitize (c, this, axisValueCount, &(this+offsetToAxisValueOffsets)))); + } + protected: hb_array_t<const StatAxisRecord> const get_design_axes () const { return (this+designAxesOffset).as_array (designAxisCount); } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-tag.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-tag.cc index ad3635bdabb..e630458941b 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-tag.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-tag.cc @@ -145,7 +145,9 @@ hb_ot_all_tags_from_script (hb_script_t script, hb_tag_t new_tag = hb_ot_new_tag_from_script (script); if (unlikely (new_tag != HB_OT_TAG_DEFAULT_SCRIPT)) { - tags[i++] = new_tag | '3'; + /* HB_SCRIPT_MYANMAR maps to 'mym2', but there is no 'mym3'. */ + if (new_tag != HB_TAG('m','y','m','2')) + tags[i++] = new_tag | '3'; if (*count > i) tags[i++] = new_tag; } @@ -303,28 +305,28 @@ parse_private_use_subtag (const char *private_use_subtag, const char *prefix, unsigned char (*normalize) (unsigned char)) { - if (private_use_subtag && count && tags && *count) - { - const char *s = strstr (private_use_subtag, prefix); - if (s) - { - char tag[4]; - int i; - s += strlen (prefix); - for (i = 0; i < 4 && ISALNUM (s[i]); i++) - tag[i] = normalize (s[i]); - if (i) - { - for (; i < 4; i++) - tag[i] = ' '; - tags[0] = HB_TAG (tag[0], tag[1], tag[2], tag[3]); - if ((tags[0] & 0xDFDFDFDF) == HB_OT_TAG_DEFAULT_SCRIPT) - tags[0] ^= ~0xDFDFDFDF; - *count = 1; - return false; - } - } - } +#ifdef HB_NO_LANGUAGE_PRIVATE_SUBTAG + return false; +#endif + + if (!(private_use_subtag && count && tags && *count)) return false; + + const char *s = strstr (private_use_subtag, prefix); + if (!s) return false; + + char tag[4]; + int i; + s += strlen (prefix); + for (i = 0; i < 4 && ISALNUM (s[i]); i++) + tag[i] = normalize (s[i]); + if (!i) return false; + + for (; i < 4; i++) + tag[i] = ' '; + tags[0] = HB_TAG (tag[0], tag[1], tag[2], tag[3]); + if ((tags[0] & 0xDFDFDFDF) == HB_OT_TAG_DEFAULT_SCRIPT) + tags[0] ^= ~0xDFDFDFDF; + *count = 1; return true; } @@ -392,8 +394,8 @@ hb_ot_tags_from_script_and_language (hb_script_t script, limit = s; } - needs_script = parse_private_use_subtag (private_use_subtag, script_count, script_tags, "-hbsc", TOLOWER); - needs_language = parse_private_use_subtag (private_use_subtag, language_count, language_tags, "-hbot", TOUPPER); + needs_script = !parse_private_use_subtag (private_use_subtag, script_count, script_tags, "-hbsc", TOLOWER); + needs_language = !parse_private_use_subtag (private_use_subtag, language_count, language_tags, "-hbot", TOUPPER); if (needs_language && language_count && language_tags && *language_count) hb_ot_tags_from_language (lang_str, limit, language_count, language_tags); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-mvar-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-mvar-table.hh index 0dd63e510b4..5a9d2afb7c6 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-mvar-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-mvar-table.hh @@ -77,9 +77,9 @@ struct MVAR const int *coords, unsigned int coord_count) const { const VariationValueRecord *record; - record = (VariationValueRecord *) bsearch (&tag, valuesZ.arrayZ, - valueRecordCount, valueRecordSize, - tag_compare); + record = (VariationValueRecord *) hb_bsearch (&tag, valuesZ.arrayZ, + valueRecordCount, valueRecordSize, + tag_compare); if (!record) return 0.; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var.cc index 25a246a2130..6b8b09b6ba8 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var.cc @@ -24,13 +24,15 @@ * Google Author(s): Behdad Esfahbod */ -#include "hb-open-type.hh" +#include "hb.hh" + +#ifndef HB_NO_VAR + +#include "hb-ot-var.h" -#include "hb-ot-face.hh" #include "hb-ot-var-avar-table.hh" #include "hb-ot-var-fvar-table.hh" #include "hb-ot-var-mvar-table.hh" -#include "hb-ot-var.h" /** @@ -213,3 +215,6 @@ hb_ot_var_normalize_coords (hb_face_t *face, face->table.avar->map_coords (normalized_coords, coords_length); } + + +#endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-serialize.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-serialize.hh index 76f70160842..5764a90f6eb 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-serialize.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-serialize.hh @@ -375,7 +375,7 @@ struct hb_serialize_context_t (Type *, src.copy (this, hb_forward<Ts> (ds)...)) template <typename Type> auto - _copy (const Type &src, hb_priority<0>) -> decltype (&(src = src)) + _copy (const Type &src, hb_priority<0>) -> decltype (&(hb_declval<Type> () = src)) { Type *ret = this->allocate_size<Type> (sizeof (Type)); if (unlikely (!ret)) return nullptr; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper-list.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper-list.hh index 25c584bc054..4108e7aab73 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper-list.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper-list.hh @@ -47,6 +47,6 @@ HB_SHAPER_IMPLEMENT (directwrite) HB_SHAPER_IMPLEMENT (coretext) #endif -#ifdef HAVE_FALLBACK +#ifndef HB_NO_FALLBACK_SHAPE HB_SHAPER_IMPLEMENT (fallback) /* <--- This should be last. */ #endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-static.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-static.cc index 6b89183cab8..08a2f21363e 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-static.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-static.cc @@ -39,8 +39,8 @@ #ifndef HB_NO_VISIBILITY #include "hb-ot-name-language-static.hh" -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)] = {}; -/*thread_local*/ hb_vector_size_impl_t _hb_CrapPool[(HB_NULL_POOL_SIZE + sizeof (hb_vector_size_impl_t) - 1) / sizeof (hb_vector_size_impl_t)] = {}; +uint64_t const _hb_NullPool[(HB_NULL_POOL_SIZE + sizeof (uint64_t) - 1) / sizeof (uint64_t)] = {}; +/*thread_local*/ uint64_t _hb_CrapPool[(HB_NULL_POOL_SIZE + sizeof (uint64_t) - 1) / sizeof (uint64_t)] = {}; DEFINE_NULL_NAMESPACE_BYTES (OT, Index) = {0xFF,0xFF}; DEFINE_NULL_NAMESPACE_BYTES (OT, LangSys) = {0x00,0x00, 0xFF,0xFF, 0x00,0x00}; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff-common.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff-common.cc index aa5d27b36ac..54f6dc2a7cd 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff-common.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff-common.cc @@ -24,6 +24,10 @@ * Adobe Author(s): Michiharu Ariza */ +#include "hb.hh" + +#ifndef HB_NO_SUBSET_CFF + #include "hb-ot-cff-common.hh" #include "hb-ot-cff2-table.hh" #include "hb-subset-cff-common.hh" @@ -44,18 +48,18 @@ using namespace CFF; bool hb_plan_subset_cff_fdselect (const hb_subset_plan_t *plan, - unsigned int fdCount, - const FDSelect &src, /* IN */ - unsigned int &subset_fd_count /* OUT */, - unsigned int &subset_fdselect_size /* OUT */, - unsigned int &subset_fdselect_format /* OUT */, - hb_vector_t<code_pair_t> &fdselect_ranges /* OUT */, - remap_t &fdmap /* OUT */) + unsigned int fdCount, + const FDSelect &src, /* IN */ + unsigned int &subset_fd_count /* OUT */, + unsigned int &subset_fdselect_size /* OUT */, + unsigned int &subset_fdselect_format /* OUT */, + hb_vector_t<code_pair_t> &fdselect_ranges /* OUT */, + remap_t &fdmap /* OUT */) { subset_fd_count = 0; subset_fdselect_size = 0; subset_fdselect_format = 0; - unsigned int num_ranges = 0; + unsigned int num_ranges = 0; unsigned int subset_num_glyphs = plan->num_output_glyphs (); if (subset_num_glyphs == 0) @@ -63,14 +67,14 @@ hb_plan_subset_cff_fdselect (const hb_subset_plan_t *plan, { /* use hb_set to determine the subset of font dicts */ - hb_set_t *set = hb_set_create (); + hb_set_t *set = hb_set_create (); if (set == &Null (hb_set_t)) return false; - hb_codepoint_t prev_fd = CFF_UNDEF_CODE; + hb_codepoint_t prev_fd = CFF_UNDEF_CODE; for (hb_codepoint_t i = 0; i < subset_num_glyphs; i++) { - hb_codepoint_t glyph; - hb_codepoint_t fd; + hb_codepoint_t glyph; + hb_codepoint_t fd; if (!plan->old_gid_for_new_gid (i, &glyph)) { /* fonttools retains FDSelect & font dicts for missing glyphs. do the same */ @@ -104,7 +108,7 @@ hb_plan_subset_cff_fdselect (const hb_subset_plan_t *plan, return false; } - hb_codepoint_t fd = CFF_UNDEF_CODE; + hb_codepoint_t fd = CFF_UNDEF_CODE; while (set->next (&fd)) fdmap.add (fd); hb_set_destroy (set); @@ -152,10 +156,10 @@ hb_plan_subset_cff_fdselect (const hb_subset_plan_t *plan, template <typename FDSELECT3_4> static inline bool serialize_fdselect_3_4 (hb_serialize_context_t *c, - const unsigned int num_glyphs, - const FDSelect &src, - unsigned int size, - const hb_vector_t<code_pair_t> &fdselect_ranges) + const unsigned int num_glyphs, + const FDSelect &src, + unsigned int size, + const hb_vector_t<code_pair_t> &fdselect_ranges) { TRACE_SERIALIZE (this); FDSELECT3_4 *p = c->allocate_size<FDSELECT3_4> (size); @@ -166,7 +170,7 @@ serialize_fdselect_3_4 (hb_serialize_context_t *c, p->ranges[i].first = fdselect_ranges[i].glyph; p->ranges[i].fd = fdselect_ranges[i].code; } - p->sentinel() = num_glyphs; + p->sentinel () = num_glyphs; return_trace (true); } @@ -176,15 +180,15 @@ serialize_fdselect_3_4 (hb_serialize_context_t *c, **/ bool hb_serialize_cff_fdselect (hb_serialize_context_t *c, - const unsigned int num_glyphs, - const FDSelect &src, - unsigned int fd_count, - unsigned int fdselect_format, - unsigned int size, - const hb_vector_t<code_pair_t> &fdselect_ranges) + const unsigned int num_glyphs, + const FDSelect &src, + unsigned int fd_count, + unsigned int fdselect_format, + unsigned int size, + const hb_vector_t<code_pair_t> &fdselect_ranges) { TRACE_SERIALIZE (this); - FDSelect *p = c->allocate_min<FDSelect> (); + FDSelect *p = c->allocate_min<FDSelect> (); if (unlikely (p == nullptr)) return_trace (false); p->format = fdselect_format; size -= FDSelect::min_size; @@ -192,42 +196,37 @@ hb_serialize_cff_fdselect (hb_serialize_context_t *c, switch (fdselect_format) { #if CFF_SERIALIZE_FDSELECT_0 - case 0: + case 0: + { + FDSelect0 *p = c->allocate_size<FDSelect0> (size); + if (unlikely (p == nullptr)) return_trace (false); + unsigned int range_index = 0; + unsigned int fd = fdselect_ranges[range_index++].code; + for (unsigned int i = 0; i < num_glyphs; i++) { - FDSelect0 *p = c->allocate_size<FDSelect0> (size); - if (unlikely (p == nullptr)) return_trace (false); - unsigned int range_index = 0; - unsigned int fd = fdselect_ranges[range_index++].code; - for (unsigned int i = 0; i < num_glyphs; i++) + if ((range_index < fdselect_ranges.len) && + (i >= fdselect_ranges[range_index].glyph)) { - if ((range_index < fdselect_ranges.len) && - (i >= fdselect_ranges[range_index].glyph)) - { - fd = fdselect_ranges[range_index++].code; - } - p->fds[i] = fd; + fd = fdselect_ranges[range_index++].code; } - break; + p->fds[i] = fd; } + return_trace (true); + } #endif /* CFF_SERIALIZE_FDSELECT_0 */ - case 3: - return serialize_fdselect_3_4<FDSelect3> (c, - num_glyphs, - src, - size, - fdselect_ranges); - - case 4: - return serialize_fdselect_3_4<FDSelect4> (c, - num_glyphs, - src, - size, - fdselect_ranges); - - default: - assert(false); - } + case 3: + return serialize_fdselect_3_4<FDSelect3> (c, num_glyphs, src, + size, fdselect_ranges); - return_trace (true); + case 4: + return serialize_fdselect_3_4<FDSelect4> (c, num_glyphs, src, + size, fdselect_ranges); + + default: + return_trace (false); + } } + + +#endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff1.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff1.cc index cfecab6ba36..ab46808d2ec 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff1.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff1.cc @@ -24,6 +24,10 @@ * Adobe Author(s): Michiharu Ariza */ +#include "hb.hh" + +#ifndef HB_NO_SUBSET_CFF + #include "hb-open-type.hh" #include "hb-ot-cff1-table.hh" #include "hb-set.h" @@ -32,8 +36,6 @@ #include "hb-subset-cff-common.hh" #include "hb-cff1-interp-cs.hh" -#ifndef HB_NO_SUBSET_CFF - using namespace CFF; struct remap_sid_t : remap_t @@ -1040,7 +1042,7 @@ static inline bool _write_cff1 (const cff_subset_plan &plan, bool result; cff_private_dict_op_serializer_t privSzr (plan.desubroutinize, plan.drop_hints); /* N.B. local subrs immediately follows its corresponding private dict. i.e., subr offset == private dict size */ - unsigned int subroffset = (plan.offsets.localSubrsInfos[i].size > 0)? priv_size: 0; + unsigned int subroffset = (plan.offsets.localSubrsInfos[i].size > 0) ? priv_size : 0; result = pd->serialize (&c, acc.privateDicts[i], privSzr, subroffset); if (unlikely (!result)) { @@ -1121,4 +1123,5 @@ hb_subset_cff1 (hb_subset_plan_t *plan, return result; } + #endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff2.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff2.cc index 5977b5669e6..afb23ae3c02 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff2.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff2.cc @@ -24,6 +24,10 @@ * Adobe Author(s): Michiharu Ariza */ +#include "hb.hh" + +#ifndef HB_NO_SUBSET_CFF + #include "hb-open-type.hh" #include "hb-ot-cff2-table.hh" #include "hb-set.h" @@ -32,8 +36,6 @@ #include "hb-subset-cff-common.hh" #include "hb-cff2-interp-cs.hh" -#ifndef HB_NO_SUBSET_CFF - using namespace CFF; struct cff2_sub_table_offsets_t : cff_sub_table_offsets_t @@ -547,7 +549,7 @@ static inline bool _write_cff2 (const cff2_subset_plan &plan, bool result; cff_private_dict_op_serializer_t privSzr (plan.desubroutinize, plan.drop_hints); /* N.B. local subrs immediately follows its corresponding private dict. i.e., subr offset == private dict size */ - unsigned int subroffset = (plan.offsets.localSubrsInfos[i].size > 0)? priv_size: 0; + unsigned int subroffset = (plan.offsets.localSubrsInfos[i].size > 0) ? priv_size : 0; result = pd->serialize (&c, acc.privateDicts[i], privSzr, subroffset); if (unlikely (!result)) { @@ -629,4 +631,5 @@ hb_subset_cff2 (hb_subset_plan_t *plan, return result; } + #endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-plan.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-plan.cc index 7c1ed872c3a..6b33c17b6a2 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-plan.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-plan.cc @@ -194,23 +194,12 @@ static void _nameid_closure (hb_face_t *face, hb_set_t *nameids) { - hb_tag_t table_tags[32]; - unsigned count = ARRAY_LENGTH (table_tags); - hb_face_get_table_tags (face, 0, &count, table_tags); - for (unsigned int i = 0; i < count; i++) - { - hb_tag_t tag = table_tags[i]; - switch (tag) { - case HB_OT_TAG_STAT: - face->table.STAT->collect_name_ids (nameids); - break; - case HB_OT_TAG_fvar: - face->table.fvar->collect_name_ids (nameids); - break; - default: - break; - } - } +#ifndef HB_NO_STAT + face->table.STAT->collect_name_ids (nameids); +#endif +#ifndef HB_NO_VAR + face->table.fvar->collect_name_ids (nameids); +#endif } /** diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset.cc index 794369550b1..3f4c2e40bbf 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset.cc @@ -67,7 +67,7 @@ template<typename TableType> static bool _subset2 (hb_subset_plan_t *plan) { - bool result = true; + bool result = false; hb_blob_t *source_blob = hb_sanitize_context_t ().reference_table<TableType> (plan->source); const TableType *table = source_blob->as<TableType> (); @@ -172,16 +172,16 @@ _subset_table (hb_subset_plan_t *plan, DEBUG_MSG(SUBSET, nullptr, "skip hhea handled by hmtx"); return true; case HB_OT_TAG_hmtx: - result = _subset<const OT::hmtx> (plan); + result = _subset2<const OT::hmtx> (plan); break; case HB_OT_TAG_vhea: DEBUG_MSG(SUBSET, nullptr, "skip vhea handled by vmtx"); return true; case HB_OT_TAG_vmtx: - result = _subset<const OT::vmtx> (plan); + result = _subset2<const OT::vmtx> (plan); break; case HB_OT_TAG_maxp: - result = _subset<const OT::maxp> (plan); + result = _subset2<const OT::maxp> (plan); break; case HB_OT_TAG_loca: DEBUG_MSG(SUBSET, nullptr, "skip loca handled by glyf"); @@ -190,10 +190,10 @@ _subset_table (hb_subset_plan_t *plan, result = _subset<const OT::cmap> (plan); break; case HB_OT_TAG_OS2: - result = _subset<const OT::OS2> (plan); + result = _subset2<const OT::OS2> (plan); break; case HB_OT_TAG_post: - result = _subset<const OT::post> (plan); + result = _subset2<const OT::post> (plan); break; #ifndef HB_NO_SUBSET_CFF diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ucd-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ucd-table.hh index 95c4bf86eab..e9d0975422a 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ucd-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ucd-table.hh @@ -10,7 +10,6 @@ #ifndef HB_UCD_TABLE_HH #define HB_UCD_TABLE_HH - #include "hb.hh" static const hb_script_t @@ -86,8 +85,8 @@ _hb_ucd_sc_map[138] = HB_SCRIPT_MARCHEN, HB_SCRIPT_OSAGE, HB_SCRIPT_TANGUT, HB_SCRIPT_NEWA, }; -static const hb_codepoint_t -_hb_ucd_dm1_map[935] = +static const uint16_t +_hb_ucd_dm1_u16_map[825] = { 0x003Bu, 0x004Bu, 0x0060u, 0x00B4u, 0x00B7u, 0x00C5u, 0x02B9u, 0x0300u, 0x0301u, 0x0313u, 0x0385u, 0x0386u, 0x0388u, 0x0389u, 0x038Au, 0x038Cu, @@ -192,20 +191,25 @@ _hb_ucd_dm1_map[935] = 0x9A6Au, 0x9B12u, 0x9B6Fu, 0x9C40u, 0x9C57u, 0x9CFDu, 0x9D67u, 0x9DB4u, 0x9DFAu, 0x9E1Eu, 0x9E7Fu, 0x9E97u, 0x9E9Fu, 0x9EBBu, 0x9ECEu, 0x9EF9u, 0x9EFEu, 0x9F05u, 0x9F0Fu, 0x9F16u, 0x9F3Bu, 0x9F43u, 0x9F8Du, 0x9F8Eu, - 0x9F9Cu,0x20122u,0x2051Cu,0x20525u,0x2054Bu,0x2063Au,0x20804u,0x208DEu, - 0x20A2Cu,0x20B63u,0x214E4u,0x216A8u,0x216EAu,0x219C8u,0x21B18u,0x21D0Bu, - 0x21DE4u,0x21DE6u,0x22183u,0x2219Fu,0x22331u,0x226D4u,0x22844u,0x2284Au, - 0x22B0Cu,0x22BF1u,0x2300Au,0x232B8u,0x2335Fu,0x23393u,0x2339Cu,0x233C3u, - 0x233D5u,0x2346Du,0x236A3u,0x238A7u,0x23A8Du,0x23AFAu,0x23CBCu,0x23D1Eu, - 0x23ED1u,0x23F5Eu,0x23F8Eu,0x24263u,0x242EEu,0x243ABu,0x24608u,0x24735u, - 0x24814u,0x24C36u,0x24C92u,0x24FA1u,0x24FB8u,0x25044u,0x250F2u,0x250F3u, - 0x25119u,0x25133u,0x25249u,0x2541Du,0x25626u,0x2569Au,0x256C5u,0x2597Cu, - 0x25AA7u,0x25BABu,0x25C80u,0x25CD0u,0x25F86u,0x261DAu,0x26228u,0x26247u, - 0x262D9u,0x2633Eu,0x264DAu,0x26523u,0x265A8u,0x267A7u,0x267B5u,0x26B3Cu, - 0x26C36u,0x26CD5u,0x26D6Bu,0x26F2Cu,0x26FB1u,0x270D2u,0x273CAu,0x27667u, - 0x278AEu,0x27966u,0x27CA8u,0x27ED3u,0x27F2Fu,0x285D2u,0x285EDu,0x2872Eu, - 0x28BFAu,0x28D77u,0x29145u,0x291DFu,0x2921Au,0x2940Au,0x29496u,0x295B6u, - 0x29B30u,0x2A0CEu,0x2A105u,0x2A20Eu,0x2A291u,0x2A392u,0x2A600u, + 0x9F9Cu, +}; +static const uint32_t +_hb_ucd_dm1_u32_map[110] = +{ + 0x20122u,0x2051Cu,0x20525u,0x2054Bu,0x2063Au,0x20804u,0x208DEu,0x20A2Cu, + 0x20B63u,0x214E4u,0x216A8u,0x216EAu,0x219C8u,0x21B18u,0x21D0Bu,0x21DE4u, + 0x21DE6u,0x22183u,0x2219Fu,0x22331u,0x226D4u,0x22844u,0x2284Au,0x22B0Cu, + 0x22BF1u,0x2300Au,0x232B8u,0x2335Fu,0x23393u,0x2339Cu,0x233C3u,0x233D5u, + 0x2346Du,0x236A3u,0x238A7u,0x23A8Du,0x23AFAu,0x23CBCu,0x23D1Eu,0x23ED1u, + 0x23F5Eu,0x23F8Eu,0x24263u,0x242EEu,0x243ABu,0x24608u,0x24735u,0x24814u, + 0x24C36u,0x24C92u,0x24FA1u,0x24FB8u,0x25044u,0x250F2u,0x250F3u,0x25119u, + 0x25133u,0x25249u,0x2541Du,0x25626u,0x2569Au,0x256C5u,0x2597Cu,0x25AA7u, + 0x25BABu,0x25C80u,0x25CD0u,0x25F86u,0x261DAu,0x26228u,0x26247u,0x262D9u, + 0x2633Eu,0x264DAu,0x26523u,0x265A8u,0x267A7u,0x267B5u,0x26B3Cu,0x26C36u, + 0x26CD5u,0x26D6Bu,0x26F2Cu,0x26FB1u,0x270D2u,0x273CAu,0x27667u,0x278AEu, + 0x27966u,0x27CA8u,0x27ED3u,0x27F2Fu,0x285D2u,0x285EDu,0x2872Eu,0x28BFAu, + 0x28D77u,0x29145u,0x291DFu,0x2921Au,0x2940Au,0x29496u,0x295B6u,0x29B30u, + 0x2A0CEu,0x2A105u,0x2A20Eu,0x2A291u,0x2A392u,0x2A600u, }; static const uint64_t _hb_ucd_dm2_map[1025] = diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ucd.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ucd.cc index 134e043d89c..4d35017a640 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ucd.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ucd.cc @@ -148,13 +148,19 @@ hb_ucd_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED, if (likely (!i)) return false; i--; - if (i < ARRAY_LENGTH (_hb_ucd_dm1_map)) + if (i < ARRAY_LENGTH (_hb_ucd_dm1_u16_map) + ARRAY_LENGTH (_hb_ucd_dm1_u32_map)) { - *a = _hb_ucd_dm1_map[i]; + if (i < ARRAY_LENGTH (_hb_ucd_dm1_u16_map)) + *a = _hb_ucd_dm1_u16_map[i]; + else + { + i -= ARRAY_LENGTH (_hb_ucd_dm1_u16_map); + *a = _hb_ucd_dm1_u32_map[i]; + } *b = 0; return true; } - i -= ARRAY_LENGTH (_hb_ucd_dm1_map); + i -= ARRAY_LENGTH (_hb_ucd_dm1_u16_map) + ARRAY_LENGTH (_hb_ucd_dm1_u32_map); uint64_t v = _hb_ucd_dm2_map[i]; *a = HB_CODEPOINT_DECODE3_1 (v); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode.hh index 80624c0ec3d..021fa461de8 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode.hh @@ -326,11 +326,11 @@ DECLARE_NULL_INSTANCE (hb_unicode_funcs_t); * * Modify Telugu length marks (ccc=84, ccc=91). * These are the only matras in the main Indic scripts range that have - * a non-zero ccc. That makes them reorder with the Halant that is - * ccc=9. Just zero them, we don't need them in our Indic shaper. + * a non-zero ccc. That makes them reorder with the Halant (ccc=9). + * Assign 5 and 6, which are otherwise unassigned. */ -#define HB_MODIFIED_COMBINING_CLASS_CCC84 0 /* length mark */ -#define HB_MODIFIED_COMBINING_CLASS_CCC91 0 /* ai length mark */ +#define HB_MODIFIED_COMBINING_CLASS_CCC84 5 /* length mark */ +#define HB_MODIFIED_COMBINING_CLASS_CCC91 6 /* ai length mark */ /* Thai * diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-uniscribe.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-uniscribe.cc index f97ed91fcc0..88f429401aa 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-uniscribe.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-uniscribe.cc @@ -25,12 +25,19 @@ */ #include "hb.hh" + +#ifdef HAVE_UNISCRIBE + #include "hb-shaper-impl.hh" #include <windows.h> #include <usp10.h> #include <rpc.h> +#ifndef E_NOT_SUFFICIENT_BUFFER +#define E_NOT_SUFFICIENT_BUFFER HRESULT_FROM_WIN32 (ERROR_INSUFFICIENT_BUFFER) +#endif + #include "hb-uniscribe.h" #include "hb-open-file.hh" @@ -717,7 +724,7 @@ _hb_uniscribe_shape (hb_shape_plan_t *shape_plan, HB_STMT_START { \ DEBUG_MSG (UNISCRIBE, nullptr, __VA_ARGS__); \ return false; \ - } HB_STMT_END; + } HB_STMT_END HRESULT hr; @@ -1019,3 +1026,4 @@ retry: } +#endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb.hh index e6d22fe3b33..bee39cd463b 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb.hh @@ -66,7 +66,7 @@ #pragma GCC diagnostic error "-Wcast-align" #pragma GCC diagnostic error "-Wcast-function-type" #pragma GCC diagnostic error "-Wdelete-non-virtual-dtor" -#pragma GCC diagnostic error "-Wdouble-promotion" +#pragma GCC diagnostic error "-Wembedded-directive" #pragma GCC diagnostic error "-Wextra-semi-stmt" #pragma GCC diagnostic error "-Wformat-security" #pragma GCC diagnostic error "-Wimplicit-function-declaration" @@ -99,6 +99,7 @@ #pragma GCC diagnostic warning "-Wbuiltin-macro-redefined" #pragma GCC diagnostic warning "-Wdeprecated" #pragma GCC diagnostic warning "-Wdisabled-optimization" +#pragma GCC diagnostic warning "-Wdouble-promotion" #pragma GCC diagnostic warning "-Wformat=2" #pragma GCC diagnostic warning "-Wignored-pragma-optimize" #pragma GCC diagnostic warning "-Wlogical-op" @@ -183,8 +184,15 @@ #include <stdarg.h> #if (defined(_MSC_VER) && _MSC_VER >= 1500) || defined(__MINGW32__) +#ifdef __MINGW32_VERSION +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN 1 +#endif +#include <windows.h> +#else #include <intrin.h> #endif +#endif #define HB_PASTE1(a,b) a##b #define HB_PASTE(a,b) HB_PASTE1(a,b) @@ -204,14 +212,6 @@ extern "C" void hb_free_impl(void *ptr); #define calloc hb_calloc_impl #define realloc hb_realloc_impl #define free hb_free_impl - -#ifdef hb_memalign_impl -extern "C" int hb_memalign_impl(void **memptr, size_t alignment, size_t size); -#define posix_memalign hb_memalign_impl -#else -#undef HAVE_POSIX_MEMALIGN -#endif - #endif @@ -352,7 +352,7 @@ extern "C" int hb_memalign_impl(void **memptr, size_t alignment, size_t size); # define HB_NO_GETENV # endif # if _WIN32_WCE < 0x800 -# define setlocale(Category, Locale) "C" +# define HB_NO_SETLOCALE static int errno = 0; /* Use something better? */ # endif # elif defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP) @@ -436,38 +436,6 @@ static_assert ((sizeof (hb_var_int_t) == 4), ""); void operator=(const TypeName&) = delete -/* - * Compiler-assisted vectorization parameters. - */ - -/* - * Disable vectorization for now. To correctly use them, we should - * use posix_memalign() to allocate in hb_vector_t. Otherwise, can - * cause misaligned access. - * - * https://bugs.chromium.org/p/chromium/issues/detail?id=860184 - */ -#ifndef HB_VECTOR_SIZE -# define HB_VECTOR_SIZE 0 -#endif - -/* The `vector_size' attribute was introduced in gcc 3.1. */ -#ifndef HB_VECTOR_SIZE -# if defined( __GNUC__ ) && ( __GNUC__ >= 4 ) -# define HB_VECTOR_SIZE 128 -# else -# define HB_VECTOR_SIZE 0 -# endif -#endif -static_assert (0 == (HB_VECTOR_SIZE & (HB_VECTOR_SIZE - 1)), "HB_VECTOR_SIZE is not power of 2."); -static_assert (0 == (HB_VECTOR_SIZE % 64), "HB_VECTOR_SIZE is not multiple of 64."); -#if HB_VECTOR_SIZE -typedef uint64_t hb_vector_size_impl_t __attribute__((vector_size (HB_VECTOR_SIZE / 8))); -#else -typedef uint64_t hb_vector_size_impl_t; -#endif - - /* Flags */ /* Enable bitwise ops on enums marked as flags_t */ @@ -508,46 +476,6 @@ typedef uint64_t hb_vector_size_impl_t; #define VAR 1 -/* fallback for round() */ -static inline double -_hb_round (double x) -{ - if (x >= 0) - return floor (x + 0.5); - else - return ceil (x - 0.5); -} -#if !defined (HAVE_ROUND) && !defined (HAVE_DECL_ROUND) -#define round(x) _hb_round(x) -#endif - - -/* fallback for posix_memalign() */ -static inline int -_hb_memalign(void **memptr, size_t alignment, size_t size) -{ - if (unlikely (0 != (alignment & (alignment - 1)) || - !alignment || - 0 != (alignment & (sizeof (void *) - 1)))) - return EINVAL; - - char *p = (char *) malloc (size + alignment - 1); - if (unlikely (!p)) - return ENOMEM; - - size_t off = (size_t) p & (alignment - 1); - if (off) - p += alignment - off; - - *memptr = (void *) p; - - return 0; -} -#if !defined(posix_memalign) && !defined(HAVE_POSIX_MEMALIGN) -#define posix_memalign _hb_memalign -#endif - - /* * Big-endian integers. Here because fundamental. */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/test-buffer-serialize.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/test-buffer-serialize.cc index a91f4f7e938..28826be8d2c 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/test-buffer-serialize.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/test-buffer-serialize.cc @@ -37,6 +37,10 @@ int main (int argc, char **argv) { + bool ret = true; + +#ifndef HB_NO_BUFFER_SERIALIZE + if (argc != 2) { fprintf (stderr, "usage: %s font-file\n", argv[0]); exit (1); @@ -59,7 +63,6 @@ main (int argc, char **argv) hb_buffer_t *buf; buf = hb_buffer_create (); - bool ret = true; char line[BUFSIZ], out[BUFSIZ]; while (fgets (line, sizeof(line), stdin) != nullptr) { @@ -85,5 +88,7 @@ main (int argc, char **argv) hb_font_destroy (font); +#endif + return !ret; } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/test-ot-color.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/test-ot-color.cc index 4050a664d82..44bd2eb6988 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/test-ot-color.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/test-ot-color.cc @@ -23,7 +23,10 @@ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ -#include "hb.h" +#include "hb.hh" + +#ifndef HB_NO_COLOR + #include "hb-ot.h" #include "hb-ft.h" @@ -133,7 +136,7 @@ layered_glyph_dump (hb_face_t *face, cairo_font_face_t *cairo_face, unsigned int unsigned glyph_count = hb_face_get_glyph_count (face); for (hb_codepoint_t gid = 0; gid < glyph_count; ++gid) { - unsigned int num_layers = hb_ot_color_glyph_get_layers (face, gid, 0, NULL, NULL); + unsigned int num_layers = hb_ot_color_glyph_get_layers (face, gid, 0, nullptr, nullptr); if (!num_layers) continue; @@ -169,7 +172,7 @@ layered_glyph_dump (hb_face_t *face, cairo_font_face_t *cairo_face, unsigned int unsigned int palette_count = hb_ot_color_palette_get_count (face); for (unsigned int palette = 0; palette < palette_count; palette++) { - unsigned int num_colors = hb_ot_color_palette_get_colors (face, palette, 0, NULL, NULL); + unsigned int num_colors = hb_ot_color_palette_get_colors (face, palette, 0, nullptr, nullptr); if (!num_colors) continue; @@ -271,14 +274,14 @@ main (int argc, char **argv) FILE *font_name_file = fopen ("out/.dumped_font_name", "r"); - if (font_name_file != NULL) + if (font_name_file != nullptr) { fprintf (stderr, "Purge or move ./out folder in order to run a new dump\n"); exit (1); } font_name_file = fopen ("out/.dumped_font_name", "w"); - if (font_name_file == NULL) + if (font_name_file == nullptr) { fprintf (stderr, "./out is not accessible as a folder, create it please\n"); exit (1); @@ -334,3 +337,7 @@ main (int argc, char **argv) return 0; } + +#else +int main (int argc, char **argv) { return 0; } +#endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/test-ot-name.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/test-ot-name.cc index 518e4eb6e64..44c2c179c85 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/test-ot-name.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/test-ot-name.cc @@ -43,7 +43,9 @@ main (int argc, char **argv) hb_blob_destroy (blob); blob = nullptr; - unsigned int count; + unsigned int count = 0; + +#ifndef HB_NO_NAME const hb_ot_name_entry_t *entries = hb_ot_name_list_names (face, &count); for (unsigned int i = 0; i < count; i++) @@ -62,6 +64,7 @@ main (int argc, char **argv) printf ("%s\n", buf); } +#endif hb_face_destroy (face); diff --git a/Build/source/libs/harfbuzz/version.ac b/Build/source/libs/harfbuzz/version.ac index bb8c767ebc5..724bba10822 100644 --- a/Build/source/libs/harfbuzz/version.ac +++ b/Build/source/libs/harfbuzz/version.ac @@ -8,4 +8,4 @@ dnl dnl -------------------------------------------------------- dnl dnl m4-include this file to define the current harfbuzz version -m4_define([harfbuzz_version], [2.5.1]) +m4_define([harfbuzz_version], [2.5.2]) |