summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source')
-rw-r--r--Build/source/libs/README2
-rw-r--r--Build/source/libs/harfbuzz/ChangeLog5
-rw-r--r--Build/source/libs/harfbuzz/Makefile.am2
-rw-r--r--Build/source/libs/harfbuzz/Makefile.in2
-rw-r--r--Build/source/libs/harfbuzz/TLpatches/ChangeLog5
-rw-r--r--Build/source/libs/harfbuzz/TLpatches/TL-Changes2
-rwxr-xr-xBuild/source/libs/harfbuzz/configure24
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/CMakeLists.txt306
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog589
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/Makefile.am1
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/NEWS13
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/configure.ac5
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/replace-enum-strings.cmake21
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources6
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc12
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-json.hh4
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-text.hh4
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-private.hh4
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-serialize.cc16
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc12
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.h4
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cache-private.hh74
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.cc18
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.h2
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc68
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-deprecated.h4
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-directwrite.cc28
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc10
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc36
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc58
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-glib.cc2
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-gobject-structs.cc2
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.cc26
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-icu.cc16
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-mutex-private.hh2
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-object-private.hh2
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-type-private.hh41
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cbdt-table.hh4
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cmap-table.hh2
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc42
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-common-private.hh16
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gdef-table.hh6
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsub-table.hh2
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos-private.hh54
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-jstf-table.hh4
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-private.hh21
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout.cc44
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-map-private.hh10
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-map.cc6
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-math-table.hh12
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-arabic-fallback.hh14
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-arabic.cc36
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-default.cc22
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-hangul.cc12
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-hebrew.cc18
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-indic.cc26
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-myanmar.cc42
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-private.hh26
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-thai.cc22
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-tibetan.cc20
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-use.cc20
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-private.hh2
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.cc8
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-tag.cc2
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var.cc2
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-private.hh286
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set-digest-private.hh144
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set-private.hh535
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set.cc3
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set.h3
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shape-plan.cc24
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shape.cc8
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper-private.hh6
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper.cc6
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ucdn.cc2
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode-private.hh4
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode.cc4
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-uniscribe.cc52
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/main.cc4
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/test-buffer-serialize.cc8
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/test-size-params.cc6
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/test-would-substitute.cc8
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/test.cc12
-rw-r--r--Build/source/libs/harfbuzz/version.ac2
84 files changed, 2132 insertions, 908 deletions
diff --git a/Build/source/libs/README b/Build/source/libs/README
index 0a9fca8579b..bb468f5aaca 100644
--- a/Build/source/libs/README
+++ b/Build/source/libs/README
@@ -24,7 +24,7 @@ gmp 6.1.2 - checked 16dec16
graphite2 1.3.10 - checked 20jun17
http://sourceforge.net/projects/silgraphite/files/graphite2/
-harfbuzz 1.6.0 - checked 13oct17
+harfbuzz 1.6.1 - checked 23oct17
http://www.freedesktop.org/software/harfbuzz/release/
icu 58.2 - checked 13mar17
diff --git a/Build/source/libs/harfbuzz/ChangeLog b/Build/source/libs/harfbuzz/ChangeLog
index ddde964b716..1109f2ba008 100644
--- a/Build/source/libs/harfbuzz/ChangeLog
+++ b/Build/source/libs/harfbuzz/ChangeLog
@@ -1,3 +1,8 @@
+2017-10-23 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
+
+ Import harfbuzz-1.6.1.
+ * Makefile.am, version.ac: Adjusted.
+
2017-10-13 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
Import harfbuzz-1.6.0.
diff --git a/Build/source/libs/harfbuzz/Makefile.am b/Build/source/libs/harfbuzz/Makefile.am
index 20db1260d2b..f9a21085062 100644
--- a/Build/source/libs/harfbuzz/Makefile.am
+++ b/Build/source/libs/harfbuzz/Makefile.am
@@ -38,7 +38,6 @@ libharfbuzz_a_SOURCES = \
@HARFBUZZ_TREE@/src/hb-buffer-private.hh \
@HARFBUZZ_TREE@/src/hb-buffer-serialize.cc \
@HARFBUZZ_TREE@/src/hb-buffer.cc \
- @HARFBUZZ_TREE@/src/hb-cache-private.hh \
@HARFBUZZ_TREE@/src/hb-common.cc \
@HARFBUZZ_TREE@/src/hb-face-private.hh \
@HARFBUZZ_TREE@/src/hb-face.cc \
@@ -60,6 +59,7 @@ libharfbuzz_a_SOURCES = \
@HARFBUZZ_TREE@/src/hb-ot-var-mvar-table.hh \
@HARFBUZZ_TREE@/src/hb-ot-tag.cc \
@HARFBUZZ_TREE@/src/hb-private.hh \
+ @HARFBUZZ_TREE@/src/hb-set-digest-private.hh \
@HARFBUZZ_TREE@/src/hb-set-private.hh \
@HARFBUZZ_TREE@/src/hb-set.cc \
@HARFBUZZ_TREE@/src/hb-shape.cc \
diff --git a/Build/source/libs/harfbuzz/Makefile.in b/Build/source/libs/harfbuzz/Makefile.in
index 4b4da3592bd..4d0894a2505 100644
--- a/Build/source/libs/harfbuzz/Makefile.in
+++ b/Build/source/libs/harfbuzz/Makefile.in
@@ -650,7 +650,6 @@ libharfbuzz_a_SOURCES = @HARFBUZZ_TREE@/src/hb-atomic-private.hh \
@HARFBUZZ_TREE@/src/hb-buffer-private.hh \
@HARFBUZZ_TREE@/src/hb-buffer-serialize.cc \
@HARFBUZZ_TREE@/src/hb-buffer.cc \
- @HARFBUZZ_TREE@/src/hb-cache-private.hh \
@HARFBUZZ_TREE@/src/hb-common.cc \
@HARFBUZZ_TREE@/src/hb-face-private.hh \
@HARFBUZZ_TREE@/src/hb-face.cc \
@@ -672,6 +671,7 @@ libharfbuzz_a_SOURCES = @HARFBUZZ_TREE@/src/hb-atomic-private.hh \
@HARFBUZZ_TREE@/src/hb-ot-var-mvar-table.hh \
@HARFBUZZ_TREE@/src/hb-ot-tag.cc \
@HARFBUZZ_TREE@/src/hb-private.hh \
+ @HARFBUZZ_TREE@/src/hb-set-digest-private.hh \
@HARFBUZZ_TREE@/src/hb-set-private.hh \
@HARFBUZZ_TREE@/src/hb-set.cc @HARFBUZZ_TREE@/src/hb-shape.cc \
@HARFBUZZ_TREE@/src/hb-shape-plan-private.hh \
diff --git a/Build/source/libs/harfbuzz/TLpatches/ChangeLog b/Build/source/libs/harfbuzz/TLpatches/ChangeLog
index ae72eb2fb82..35c2a5446d1 100644
--- a/Build/source/libs/harfbuzz/TLpatches/ChangeLog
+++ b/Build/source/libs/harfbuzz/TLpatches/ChangeLog
@@ -1,3 +1,8 @@
+2017-10-14 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
+
+ Imported harfbuzz-1.6.1 source tree from:
+ http://www.freedesktop.org/software/harfbuzz/release/
+
2017-10-13 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
Imported harfbuzz-1.6.0 source tree from:
diff --git a/Build/source/libs/harfbuzz/TLpatches/TL-Changes b/Build/source/libs/harfbuzz/TLpatches/TL-Changes
index 83a9a4486e5..cd830ea0f19 100644
--- a/Build/source/libs/harfbuzz/TLpatches/TL-Changes
+++ b/Build/source/libs/harfbuzz/TLpatches/TL-Changes
@@ -1,4 +1,4 @@
-Changes applied to the harfbuzz-1.6.0/ tree as obtained from:
+Changes applied to the harfbuzz-1.6.1/ 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 6a5dc22921c..07cd82845f8 100755
--- a/Build/source/libs/harfbuzz/configure
+++ b/Build/source/libs/harfbuzz/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for harfbuzz (TeX Live) 1.6.0.
+# Generated by GNU Autoconf 2.69 for harfbuzz (TeX Live) 1.6.1.
#
# 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='1.6.0'
-PACKAGE_STRING='harfbuzz (TeX Live) 1.6.0'
+PACKAGE_VERSION='1.6.1'
+PACKAGE_STRING='harfbuzz (TeX Live) 1.6.1'
PACKAGE_BUGREPORT='tex-k@tug.org'
PACKAGE_URL=''
@@ -1312,7 +1312,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures harfbuzz (TeX Live) 1.6.0 to adapt to many kinds of systems.
+\`configure' configures harfbuzz (TeX Live) 1.6.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1383,7 +1383,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of harfbuzz (TeX Live) 1.6.0:";;
+ short | recursive ) echo "Configuration of harfbuzz (TeX Live) 1.6.1:";;
esac
cat <<\_ACEOF
@@ -1490,7 +1490,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-harfbuzz (TeX Live) configure 1.6.0
+harfbuzz (TeX Live) configure 1.6.1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2080,7 +2080,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by harfbuzz (TeX Live) $as_me 1.6.0, which was
+It was created by harfbuzz (TeX Live) $as_me 1.6.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -4003,7 +4003,7 @@ fi
# Define the identity of the package.
PACKAGE='harfbuzz--tex-live-'
- VERSION='1.6.0'
+ VERSION='1.6.1'
cat >>confdefs.h <<_ACEOF
@@ -4206,8 +4206,8 @@ WARNING_CFLAGS=$kpse_cv_warning_cflags
HB_VERSION_MAJOR=1
HB_VERSION_MINOR=6
-HB_VERSION_MICRO=0
-HB_VERSION=1.6.0
+HB_VERSION_MICRO=1
+HB_VERSION=1.6.1
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -6866,7 +6866,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by harfbuzz (TeX Live) $as_me 1.6.0, which was
+This file was extended by harfbuzz (TeX Live) $as_me 1.6.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -6932,7 +6932,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-harfbuzz (TeX Live) config.status 1.6.0
+harfbuzz (TeX Live) config.status 1.6.1
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 650def81b57..8d2825758ab 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/CMakeLists.txt
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/CMakeLists.txt
@@ -41,7 +41,7 @@ if (APPLE)
endif ()
if (WIN32)
option(HB_HAVE_UNISCRIBE "Enable Uniscribe shaper backend on Windows" OFF)
- option(HB_HAVE_DIRECWRITE "Enable DirectWrite shaper backend on Windows" OFF)
+ option(HB_HAVE_DIRECTWRITE "Enable DirectWrite shaper backend on Windows" OFF)
endif ()
option(HB_BUILD_UTILS "Build harfbuzz utils, needs cairo, freetype, and glib properly be installed" OFF)
if (HB_BUILD_UTILS)
@@ -49,12 +49,24 @@ if (HB_BUILD_UTILS)
set(HB_HAVE_FREETYPE ON)
endif ()
+option(HB_HAVE_GOBJECT "Enable GObject Bindings" OFF)
+if (HB_HAVE_GOBJECT)
+ set(HB_HAVE_GLIB ON)
+endif ()
+
+option(HB_HAVE_INTROSPECTION "Enable building introspection (.gir/.typelib) files" OFF)
+if (HB_HAVE_INTROSPECTION)
+ set(HB_HAVE_GOBJECT ON)
+ set(HB_HAVE_GLIB ON)
+endif ()
+
include_directories(AFTER
${PROJECT_SOURCE_DIR}/src
${PROJECT_BINARY_DIR}/src
)
add_definitions(-DHAVE_OT)
+add_definitions(-DHAVE_FALLBACK)
if (BUILD_SHARED_LIBS)
add_definitions(-DHAVE_ATEXIT)
@@ -101,6 +113,7 @@ file(READ ${PROJECT_SOURCE_DIR}/src/hb-ucdn/Makefile.sources UCDNSOURCES)
extract_make_variable(HB_BASE_sources ${SRCSOURCES} "${PROJECT_SOURCE_DIR}/src/")
extract_make_variable(HB_BASE_headers ${SRCSOURCES} "${PROJECT_SOURCE_DIR}/src/")
+extract_make_variable(HB_FALLBACK_sources ${SRCSOURCES} "${PROJECT_SOURCE_DIR}/src/")
extract_make_variable(HB_OT_sources ${SRCSOURCES} "${PROJECT_SOURCE_DIR}/src/")
extract_make_variable(HB_OT_headers ${SRCSOURCES} "${PROJECT_SOURCE_DIR}/src/")
@@ -169,10 +182,13 @@ set(project_sources
${HB_BASE_sources}
${HB_BASE_RAGEL_GENERATED_sources}
+ ${HB_FALLBACK_sources}
${HB_OT_sources}
${HB_OT_RAGEL_GENERATED_sources}
)
+set(project_extra_sources)
+
set(project_headers
${HB_VERSION_H}
@@ -218,10 +234,8 @@ if (HB_BUILTIN_UCDN)
include_directories(src/hb-ucdn)
add_definitions(-DHAVE_UCDN)
- list(APPEND project_sources
- ${PROJECT_SOURCE_DIR}/src/hb-ucdn.cc
- ${LIBHB_UCDN_sources}
- )
+ list(APPEND project_sources ${PROJECT_SOURCE_DIR}/src/hb-ucdn.cc)
+ list(APPEND project_extra_sources ${LIBHB_UCDN_sources})
endif ()
if (HB_HAVE_GLIB)
@@ -298,6 +312,110 @@ if (WIN32 AND HB_HAVE_DIRECTWRITE)
list(APPEND THIRD_PARTY_LIBS dwrite rpcrt4)
endif ()
+if (HB_HAVE_GOBJECT)
+ include(FindPythonInterp)
+ include(FindPerl)
+
+ # Use the hints from glib-2.0.pc to find glib-mkenums
+ find_package(PkgConfig)
+ pkg_check_modules(PC_GLIB QUIET glib-2.0)
+ find_program(GLIB_MKENUMS glib-mkenums
+ HINTS ${PC_glib_mkenums}
+ )
+ set(GLIB_MKENUMS_CMD)
+
+ if (WIN32 AND NOT MINGW)
+ # In Visual Studio builds, shebang lines are not supported
+ # in the standard cmd.exe shell that we use, so we need to
+ # first determine whether glib-mkenums is a Python or PERL
+ # script
+ execute_process(COMMAND "${PYTHON_EXECUTABLE}" "${GLIB_MKENUMS}" --version
+ RESULT_VARIABLE GLIB_MKENUMS_PYTHON
+ OUTPUT_QUIET ERROR_QUIET
+ )
+ if (GLIB_MKENUMS_PYTHON EQUAL 0)
+ message("${GLIB_MKENUMS} is a Python script.")
+ set(GLIB_MKENUMS_CMD "${PYTHON_EXECUTABLE}" "${GLIB_MKENUMS}")
+ else ()
+ execute_process(COMMAND "${PERL_EXECUTABLE}" "${GLIB_MKENUMS}" --version
+ RESULT_VARIABLE GLIB_MKENUMS_PERL
+ OUTPUT_QUIET ERROR_QUIET
+ )
+ if (GLIB_MKENUMS_PERL EQUAL 0)
+ message("${GLIB_MKENUMS} is a PERL script.")
+ set(GLIB_MKENUMS_CMD "${PERL_EXECUTABLE}" "${GLIB_MKENUMS}")
+ endif ()
+ if (NOT GLIB_MKENUMS_PERL EQUAL 0 AND NOT GLIB_MKENUMS_PYTHON EQUAL 0)
+ message(FATAL_ERROR "Unable to determine type of glib-mkenums script")
+ endif ()
+ endif ()
+ else ()
+ set(GLIB_MKENUMS_CMD "${GLIB_MKENUMS}")
+ endif ()
+ if (NOT GLIB_MKENUMS_CMD)
+ message(FATAL_ERROR "HB_HAVE_GOBJECT was set, but we failed to find glib-mkenums, which is required")
+ endif()
+
+ pkg_check_modules(PC_GOBJECT QUIET gobject-2.0)
+
+ find_library(GOBJECT_LIBRARIES NAMES gobject-2.0 HINTS ${PC_GLIB_LIBDIR} ${PC_GLIB_LIBRARY_DIRS})
+ find_path(GOBJECT_INCLUDE_DIR NAMES glib-object.h HINTS ${PC_GLIB_INCLUDEDIR} ${PC_GLIB_INCLUDE_DIRS} PATH_SUFFIXES glib-2.0)
+
+ include_directories(${GOBJECTCONFIG_INCLUDE_DIR} ${GOBJECT_INCLUDE_DIR})
+ mark_as_advanced(GOBJECT_LIBRARIES GOBJECT_INCLUDE_DIR)
+
+ list(APPEND hb_gobject_sources ${PROJECT_SOURCE_DIR}/src/hb-gobject-structs.cc)
+ list(APPEND hb_gobject_gen_sources
+ ${CMAKE_CURRENT_BINARY_DIR}/src/hb-gobject-enums.cc
+ )
+ list(APPEND hb_gobject_structs_headers
+ ${PROJECT_SOURCE_DIR}/src/hb-gobject-structs.h
+ )
+ list(APPEND hb_gobject_headers
+ ${PROJECT_SOURCE_DIR}/src/hb-gobject.h
+ ${hb_gobject_structs_headers}
+ )
+ list(APPEND hb_gobject_gen_headers
+ ${CMAKE_CURRENT_BINARY_DIR}/src/hb-gobject-enums.h
+ )
+
+ add_custom_command (
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/src/hb-gobject-enums.h
+ COMMAND ${GLIB_MKENUMS_CMD}
+ --template=${PROJECT_SOURCE_DIR}/src/hb-gobject-enums.h.tmpl
+ --identifier-prefix hb_
+ --symbol-prefix hb_gobject
+ ${hb_gobject_structs_headers}
+ ${project_headers}
+ > ${CMAKE_CURRENT_BINARY_DIR}/src/hb-gobject-enums.h.tmp
+ COMMAND "${CMAKE_COMMAND}"
+ "-DENUM_INPUT_SRC=${CMAKE_CURRENT_BINARY_DIR}/src/hb-gobject-enums.h.tmp"
+ "-DENUM_OUTPUT_SRC=${CMAKE_CURRENT_BINARY_DIR}/src/hb-gobject-enums.h"
+ -P ${PROJECT_SOURCE_DIR}/replace-enum-strings.cmake
+ DEPENDS ${PROJECT_SOURCE_DIR}/src/hb-gobject-enums.h.tmpl
+ ${hb_gobject_header}
+ ${project_headers}
+ )
+
+ add_custom_command (
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/src/hb-gobject-enums.cc
+ COMMAND ${GLIB_MKENUMS_CMD}
+ --template=${PROJECT_SOURCE_DIR}/src/hb-gobject-enums.cc.tmpl
+ --identifier-prefix hb_
+ --symbol-prefix hb_gobject
+ ${hb_gobject_header}
+ ${project_headers}
+ > ${CMAKE_CURRENT_BINARY_DIR}/src/hb-gobject-enums.cc.tmp
+ COMMAND "${CMAKE_COMMAND}"
+ "-DENUM_INPUT_SRC=${CMAKE_CURRENT_BINARY_DIR}/src/hb-gobject-enums.cc.tmp"
+ "-DENUM_OUTPUT_SRC=${CMAKE_CURRENT_BINARY_DIR}/src/hb-gobject-enums.cc"
+ -P ${PROJECT_SOURCE_DIR}/replace-enum-strings.cmake
+ DEPENDS ${PROJECT_SOURCE_DIR}/src/hb-gobject-enums.cc.tmpl
+ ${CMAKE_CURRENT_BINARY_DIR}/src/hb-gobject-enums.h
+ ${hb_gobject_header}
+ ${project_headers}
+ )
+endif ()
## Atomic ops availability detection
file(WRITE "${PROJECT_BINARY_DIR}/try_compile_intel_atomic_primitives.c"
@@ -332,9 +450,144 @@ endif ()
## Define harfbuzz library
-add_library(harfbuzz ${project_sources} ${project_headers})
+add_library(harfbuzz ${project_sources} ${project_extra_sources} ${project_headers})
target_link_libraries(harfbuzz ${THIRD_PARTY_LIBS})
+## Define harfbuzz-gobject library
+if (HB_HAVE_GOBJECT)
+ add_library(harfbuzz-gobject
+ ${hb_gobject_sources}
+ ${hb_gobject_gen_sources}
+ ${hb_gobject_headers}
+ ${hb_gobject_gen_headers}
+ )
+ include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/src)
+ add_dependencies(harfbuzz-gobject harfbuzz)
+ target_link_libraries(harfbuzz-gobject harfbuzz ${GOBJECT_LIBRARIES} ${THIRD_PARTY_LIBS})
+endif ()
+
+# On Windows, g-ir-scanner requires a DLL build in order for it to work
+if (WIN32)
+ if (NOT BUILD_SHARED_LIBS)
+ message("Building introspection files on Windows requires BUILD_SHARED_LIBS to be enabled.")
+ set(HB_HAVE_INTROSPECTION OFF)
+ endif ()
+endif ()
+
+if (HB_HAVE_INTROSPECTION)
+
+ find_package(PkgConfig)
+ pkg_check_modules(PC_GI QUIET gobject-introspection-1.0)
+
+ find_program(G_IR_SCANNER g-ir-scanner
+ HINTS ${PC_g_ir_scanner}
+ )
+
+ find_program(G_IR_COMPILER g-ir-compiler
+ HINTS ${PC_g_ir_compiler}
+ )
+
+ if (WIN32 AND NOT MINGW)
+ # Note that since we already enable HB_HAVE_GOBJECT
+ # we would already have PYTHON_EXECUTABLE handy
+ set(G_IR_SCANNER_CMD "${PYTHON_EXECUTABLE}" "${G_IR_SCANNER}")
+ else ()
+ set(G_IR_SCANNER_CMD "${G_IR_SCANNER}")
+ endif ()
+
+ # We need to account for the varying output directories
+ # when we build using Visual Studio projects
+ if("${CMAKE_GENERATOR}" MATCHES "Visual Studio*")
+ set (hb_libpath "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>")
+ else ()
+ set (hb_libpath "$<TARGET_FILE_DIR:harfbuzz-gobject>")
+ endif ()
+
+ # Get the CFlags that we used to build HarfBuzz/HarfBuzz-GObject
+ set (hb_defines_cflags "")
+ foreach(hb_cflag ${hb_cflags})
+ list(APPEND hb_defines_cflags "-D${hb_cflag}")
+ endforeach(hb_cflag)
+
+ # Get the other dependent libraries we used to build HarfBuzz/HarfBuzz-GObject
+ set (extra_libs "")
+ foreach (extra_lib ${THIRD_PARTY_LIBS})
+ # We don't want the .lib extension here...
+ string(REPLACE ".lib" "" extra_lib_stripped "${extra_lib}")
+ list(APPEND extra_libs "--extra-library=${extra_lib_stripped}")
+ endforeach ()
+
+ set(introspected_sources)
+ foreach (f
+ ${project_headers}
+ ${project_sources}
+ ${hb_gobject_gen_sources}
+ ${hb_gobject_gen_headers}
+ ${hb_gobject_sources}
+ ${hb_gobject_headers}
+ )
+ if (WIN32)
+ # Nasty issue: We need to make drive letters lower case,
+ # otherwise g-ir-scanner won't like it and give us a bunch
+ # of invalid items and unresolved types...
+ STRING(SUBSTRING "${f}" 0 1 drive)
+ STRING(SUBSTRING "${f}" 1 -1 path)
+ if (drive MATCHES "[A-Z]")
+ STRING(TOLOWER ${drive} drive_lower)
+ list(APPEND introspected_sources "${drive_lower}${path}")
+ else ()
+ list(APPEND introspected_sources "${f}")
+ endif ()
+ else ()
+ list(APPEND introspected_sources "${f}")
+ endif ()
+ endforeach ()
+
+ # Finally, build the introspection files...
+ add_custom_command (
+ TARGET harfbuzz-gobject
+ POST_BUILD
+ COMMAND ${G_IR_SCANNER_CMD}
+ --warn-all --no-libtool --verbose
+ -n hb
+ --namespace=HarfBuzz
+ --nsversion=0.0
+ --identifier-prefix=hb_
+ --include GObject-2.0
+ --pkg-export=harfbuzz
+ --cflags-begin
+ -I${PROJECT_SOURCE_DIR}/src
+ -I${PROJECT_BINARY_DIR}/src
+ ${hb_includedir_cflags}
+ ${hb_defines_cflags}
+ -DHB_H
+ -DHB_H_IN
+ -DHB_OT_H
+ -DHB_OT_H_IN
+ -DHB_GOBJECT_H
+ -DHB_GOBJECT_H_IN
+ -DHB_EXTERN=
+ --cflags-end
+ --library=harfbuzz-gobject
+ --library=harfbuzz
+ -L${hb_libpath}
+ ${extra_libs}
+ ${introspected_sources}
+ -o ${hb_libpath}/HarfBuzz-0.0.gir
+ DEPENDS harfbuzz-gobject harfbuzz
+ )
+
+ add_custom_command (
+ TARGET harfbuzz-gobject
+ POST_BUILD
+ COMMAND "${G_IR_COMPILER}"
+ --verbose --debug
+ --includedir ${CMAKE_CURRENT_BINARY_DIR}
+ ${hb_libpath}/HarfBuzz-0.0.gir
+ -o ${hb_libpath}/HarfBuzz-0.0.typelib
+ DEPENDS ${hb_libpath}/HarfBuzz-0.0.gir harfbuzz-gobject
+ )
+endif ()
## Additional framework build configs
if (BUILD_FRAMEWORK)
@@ -379,6 +632,9 @@ endif ()
## Install
if (NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL)
install(FILES ${project_headers} DESTINATION include/harfbuzz)
+ if (HB_HAVE_GOBJECT)
+ install(FILES ${hb_gobject_headers} ${hb_gobject_gen_headers} DESTINATION include/harfbuzz)
+ endif ()
endif ()
if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
@@ -388,4 +644,42 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
RUNTIME DESTINATION bin
FRAMEWORK DESTINATION Library/Frameworks
)
+ if (HB_BUILD_UTILS)
+ install(TARGETS hb-view
+ RUNTIME DESTINATION bin
+ )
+ install(TARGETS hb-view
+ RUNTIME DESTINATION bin
+ )
+
+ install(TARGETS hb-shape
+ RUNTIME DESTINATION bin
+ )
+
+ install(TARGETS hb-ot-shape-closure
+ RUNTIME DESTINATION bin
+ )
+ endif ()
+ if (HB_HAVE_GOBJECT)
+ install(TARGETS harfbuzz-gobject
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+ RUNTIME DESTINATION bin
+ )
+ if (HB_HAVE_INTROSPECTION)
+ if("${CMAKE_GENERATOR}" MATCHES "Visual Studio*")
+ set (hb_libpath "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>")
+ else ()
+ set (hb_libpath "$<TARGET_FILE_DIR:harfbuzz-gobject>")
+ endif ()
+
+ install(FILES "${hb_libpath}/HarfBuzz-0.0.gir"
+ DESTINATION share/gir-1.0
+ )
+
+ install(FILES "${hb_libpath}/HarfBuzz-0.0.typelib"
+ DESTINATION lib/girepository-1.0
+ )
+ endif ()
+ endif ()
endif ()
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog b/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog
index a1158c8cf3e..83425f3cf49 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog
@@ -1,3 +1,592 @@
+commit d59d5dc7d339deb45cc84cffd084b52752765a08
+Merge: ced86da7 3ee15a60
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 22 17:08:29 2017 -0400
+
+ Merge commit '3ee15a60358f4d894bbf2431d7a7df38b7acc4ce'
+
+commit ced86da7ddbbd0d64f8ba1290b8e67600b1db2d4
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 22 17:03:36 2017 -0400
+
+ Another try at fixing mingw32 build bot fail
+
+ src/hb-private.hh | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+commit bc1183aa6ba45a527084d391d6e7f801d6196060
+Merge: d45a2138 bfe0faf1
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 22 17:06:00 2017 -0400
+
+ Merge commit 'bfe0faf1a2d39302129a7202994456afd96694ca'
+
+commit 3ee15a60358f4d894bbf2431d7a7df38b7acc4ce
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 22 17:03:36 2017 -0400
+
+ Another try at fixing mingw32 build bot fail
+
+ src/hb-private.hh | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+commit bfe0faf1a2d39302129a7202994456afd96694ca
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 22 15:54:50 2017 -0400
+
+ [docs] Deprecate hb_set_invert()
+
+ docs/harfbuzz-sections.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit d45a2138d9d54eab158046d6503f1bb104efce25
+Merge: d8adaa97 41b18251
+Author: ebraminio <ebrahim@gnu.org>
+Date: Sat Oct 21 10:19:55 2017 +0330
+
+ Merge pull request #572 from fanc999/master.msvc
+
+ builds: Support HarfBuzz-GObject and introspection in CMake builds
+
+commit d8adaa97fbf33071b8a4b5c05c3f2f15f2fd22ea
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Fri Oct 20 13:57:43 2017 -0400
+
+ Another try at fixing build bots
+
+ hb-ot-shape.cc:287:18: error: comparison of constant 32 with
+ expression of type 'hb_unicode_general_category_t' is always true
+ [-Werror,-Wtautological-constant-out-of-range-compare]
+
+ src/hb-private.hh | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit 6058f98825e8f134893a1bbfb402e45d85b56ff0
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Thu Oct 19 11:39:52 2017 -0700
+
+ Remove FLAG_SAFE()
+
+ No flag is safe, over time... See previous commit.
+
+ src/hb-ot-shape-complex-arabic.cc | 4 ++--
+ src/hb-ot-shape-complex-indic.cc | 12 ++++++------
+ src/hb-ot-shape-complex-use.cc | 2 +-
+ src/hb-private.hh | 5 ++---
+ src/hb-unicode-private.hh | 4 ++--
+ 5 files changed, 13 insertions(+), 14 deletions(-)
+
+commit 7c561dacc3c5fb9306db8bda27b7289331bd523f
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Thu Oct 19 11:35:51 2017 -0700
+
+ [myanmar] Fix unsafe usage of FLAG_SAFE()
+
+ The commit f559c633073f63b9d87cb2440048b4413cfa1c05 caused
+ "undefined-shift" errors in Myanmar shaper as we changed the
+ numeric value of type D from 19 to 32 there, making the
+ "FLAG_SAFE (info.myanmar_category())" wrong.
+
+ Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3546
+
+ src/hb-ot-shape-complex-myanmar.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 41b1825196235d4337c76f97e09f0b7c6d6c56ae
+Author: Chun-wei Fan <fanchunwei@src.gnome.org>
+Date: Thu Oct 19 18:36:32 2017 +0800
+
+ CMake builds: Support introspection builds
+
+ This adds support for introspection builds on Windows that is
+ enabled by
+ the HB_HAVE_INTROSPECTION option, which will also enable
+ HB_HAVE_GOBJECT
+ (and so HB_HAVE_GLIB) as they are required for introspection.
+
+ In order for this to work one must ensure that the Python installation
+ listed in PYTHON_EXECUTABLE is the same Python release series that was
+ used to build _giscanner.pyd (the Python module that is used by
+ g-ir-scanner), with the same architecture. PKG_CONFIG_PATH and PATH
+ must be set correctly if $(PREFIX)\bin and/or $(PREFIX)\lib\pkgconfig
+ are not in the standard PATH and PKG_CONFIG_PATH, which is actually
+ in-line with the *NIX builds.
+
+ CMakeLists.txt | 161
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++---
+ 1 file changed, 154 insertions(+), 7 deletions(-)
+
+commit 53db221259b5eea4d2244321b2fe96beb39aef7d
+Author: Chun-wei Fan <fanchunwei@src.gnome.org>
+Date: Wed Oct 18 15:43:57 2017 +0800
+
+ CMake: Support building HarfBuzz-GObject
+
+ This adds support to the CMake build files to support building
+ HarfBuzz-GObject, which is actually a little bit complicated,
+ as we need to:
+
+ -Run glib-mkenums, which is a Python (for newer GLib/GObject) or PERL
+ (for older, pre 2.53.4, GLib/GObject) script. This matters more for
+ Visual Studio builds as shebang lines are not supported, so we
+ need to
+ test-run it with PERL or Python to determine which is the correct
+ interpretor to use.
+
+ -Next, we need to replace strings in the sources that we obtain from
+ running glib-mkenums. So, the solution here is to use a small
+ utility
+ CMake script for our purposes here, to maintain maximum
+ compatibility.
+
+ -Ensure that things do work in the Visual Studio IDE builds.
+
+ CMakeLists.txt | 128
+ +++++++++++++++++++++++++++++++++++++++++++++
+ Makefile.am | 1 +
+ replace-enum-strings.cmake | 21 ++++++++
+ 3 files changed, 150 insertions(+)
+
+commit 162575f2c69f519aae1b18ff1c501e7e4c2cdd4b
+Author: Chun-wei Fan <fanchunwei@src.gnome.org>
+Date: Wed Oct 18 22:27:28 2017 +0800
+
+ CMake builds: Fix builds
+
+ Include the fallback sources in the build, and update
+ src/Makefile.sources so that it can be read by the CMake build files.
+
+ Fix a typo in the DirectWrite configure option so that we can properly
+ enable DirectWrite builds.
+
+ Also, when building the utility program, install them as well.
+
+ CMakeLists.txt | 21 ++++++++++++++++++++-
+ src/Makefile.sources | 4 +++-
+ 2 files changed, 23 insertions(+), 2 deletions(-)
+
+commit d6f612fac800c31989c298b5101845baed2297b1
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Tue Oct 17 16:32:12 2017 -0700
+
+ [bsearch] Micro-optimization
+
+ src/hb-open-type-private.hh | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit 41b1984be946cc2f53313dd48eac392cc8a3ad2b
+Author: Fredrik Roubert <fredrik@roubert.name>
+Date: Tue Oct 17 15:06:31 2017 -0700
+
+ Switch from ICU deprecated unorm_normalize to unorm2_normalize. (#569)
+
+ The new unorm2_normalize has been public API since ICU 4.4, while
+ the old unorm_normalize has been deprecated since ICU 56.
+
+ Now, beginning with ICU 60, unorm_normalize will also be annotated
+ U_DEPRECATED and trigger the compiler -Wdeprecated-declarations
+ warning.
+
+ src/hb-icu.cc | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+commit b98adefbb9ee45fc1e800a52f701bf4224e9bb81
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Tue Oct 17 12:00:34 2017 -0700
+
+ Update docs symbols
+
+ docs/harfbuzz-sections.txt | 2 ++
+ 1 file changed, 2 insertions(+)
+
+commit ba8b56960733b25bbb88fbdb60e7e244127d6e0c
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Tue Oct 17 11:16:36 2017 -0700
+
+ Try fixing build on VC
+
+ c:\projects\harfbuzz\src\hb-set-private.hh(151): error C2327:
+ 'hb_set_t::page_t::v': is not a type name, static, or enumerator
+ [C:\projects\harfbuzz\build\harfbuzz.vcxproj]
+
+ src/hb-set-private.hh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 80cc0a7e3e05fb7fcfbdc0188cb60b115ad47d04
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Tue Oct 17 11:14:48 2017 -0700
+
+ [coretext] Fix build
+
+ error: static_assert expression is not an integral constant expression
+
+ src/hb-coretext.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit a11249ee93439856ea2410524b993ac1f1379961
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Mon Oct 16 01:33:32 2017 -0400
+
+ [set] Fix merge logic
+
+ src/hb-set-private.hh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit ab8f327eb47184409d9e9208ca46b631d1afd0d4
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 15 18:21:35 2017 -0400
+
+ Ouch.
+
+ src/hb-set-private.hh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit bb9917913f735855aea54f41f10e0c7be3632e88
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 15 18:20:25 2017 -0400
+
+ [set] Disable vectorization
+
+ Fixes clang "non-const reference cannot bind to vector element" error.
+
+ src/hb-set-private.hh | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+commit 221ce6c18f2a1e878b68eb0a97f235efa4c044d3
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 15 17:58:58 2017 -0400
+
+ Fix bots
+
+ src/hb-private.hh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 0cf7d957b7ffb17c4cec75b631c9829327ab5d52
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 15 17:01:31 2017 -0400
+
+ [set] Remove TODO items not worth pursuing
+
+ src/hb-set-private.hh | 2 --
+ 1 file changed, 2 deletions(-)
+
+commit 10d43658e7655b36cb86e674dde8af4036b7cc52
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 15 16:56:05 2017 -0400
+
+ [set] Speed up intersects()
+
+ src/hb-set-private.hh | 8 ++------
+ 1 file changed, 2 insertions(+), 6 deletions(-)
+
+commit 56ef4e0c52d5b474518bf0c1e4adba80f2ae6946
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 15 16:38:29 2017 -0400
+
+ Simplify hb_prealloced_array_t initialization
+
+ src/hb-private.hh | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+commit 7737e87ac4582d57945f3ffbbae1012f62c6b482
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 15 16:21:03 2017 -0400
+
+ Properly detect vector_size attribute and use fallback otherwise
+
+ src/hb-private.hh | 67
+ +++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/hb-set-private.hh | 62
+ ++---------------------------------------------
+ 2 files changed, 69 insertions(+), 60 deletions(-)
+
+commit f8a0ec50e23264fdfe9e3a5a2e0453a87f415b3d
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 15 16:10:35 2017 -0400
+
+ [set] Add fallback implementation of int-vector type
+
+ src/hb-set-private.hh | 64
+ ++++++++++++++++++++++++++++++++++++---------------
+ 1 file changed, 45 insertions(+), 19 deletions(-)
+
+commit deed4a48d15d4a475f8695aa3269547adf63867a
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 15 16:53:09 2017 +0200
+
+ Faster hb_set_t
+
+ Fixes https://github.com/behdad/harfbuzz/pull/23
+
+ src/hb-private.hh | 56 ++++---
+ src/hb-set-private.hh | 431
+ +++++++++++++++++++++++++++++++++++++++++---------
+ test/api/test-set.c | 6 -
+ 3 files changed, 391 insertions(+), 102 deletions(-)
+
+commit 1d3971200be5b1c949d3eca185654e48584a0868
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 15 16:15:24 2017 +0200
+
+ Deprecate hb_set_invert()
+
+ src/hb-deprecated.h | 4 ++++
+ src/hb-set.cc | 3 ++-
+ src/hb-set.h | 3 ---
+ 3 files changed, 6 insertions(+), 4 deletions(-)
+
+commit 5e74044b6bd78c495561eb7d2981415d2c3336f4
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 15 16:15:06 2017 +0200
+
+ Add bfind() to prealloaced_array_t
+
+ src/hb-private.hh | 31 ++++++++++++++++---------------
+ 1 file changed, 16 insertions(+), 15 deletions(-)
+
+commit db5f7ef18916abb0907bc8b569a65c9c6bbd4015
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 15 16:00:22 2017 +0200
+
+ Inline another bsearch()
+
+ src/hb-ot-map-private.hh | 4 ++--
+ src/hb-private.hh | 32 ++++++++++++++++++++++++++++----
+ 2 files changed, 30 insertions(+), 6 deletions(-)
+
+commit 6fb4ac73f94636d19fcac143472b84f9d91985c9
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 15 16:00:09 2017 +0200
+
+ Add popcount for 64bit ints
+
+ src/hb-private.hh | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+commit 473b17af4d421f4ce7ac18c769731bb2aa4088f8
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 15 14:10:34 2017 +0200
+
+ Remove unused hb_cache_t
+
+ src/Makefile.sources | 1 -
+ src/hb-cache-private.hh | 74
+ -------------------------------------------------
+ src/hb-ft.cc | 2 --
+ 3 files changed, 77 deletions(-)
+
+commit a433e60a43c4594c41a82c3741d3f870f6eec247
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 15 14:09:46 2017 +0200
+
+ Remove unused hb_frozen_set_t
+
+ src/hb-set-private.hh | 55
+ ---------------------------------------------------
+ 1 file changed, 55 deletions(-)
+
+commit 826a1daf2f2075459ff25a20ed8abec030d95c52
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 15 14:09:05 2017 +0200
+
+ Move set-digests into their own header file
+
+ src/Makefile.sources | 1 +
+ src/hb-ot-layout-private.hh | 2 +-
+ src/hb-set-digest-private.hh | 144
+ +++++++++++++++++++++++++++++++++++++++++++
+ src/hb-set-private.hh | 113 ---------------------------------
+ 4 files changed, 146 insertions(+), 114 deletions(-)
+
+commit 3c13e153fe89d559d33027c0a5b30a19a6de1bad
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 15 14:02:58 2017 +0200
+
+ Try fixing AppVeyor bots
+
+ src/hb-private.hh | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit 7e3015a315afe2312134ac33b9cb2d73689a044f
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 15 12:13:19 2017 +0200
+
+ Fix warnings
+
+ src/hb-font.cc | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit 2075008f3e0b1cfbd7006f1d8c1fa22ac014f4bb
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 15 12:12:10 2017 +0200
+
+ Use C++11
+
+ configure.ac | 3 +++
+ 1 file changed, 3 insertions(+)
+
+commit dbdbfe3d7b36613d893832dcb1884c756c20bfda
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 15 12:11:08 2017 +0200
+
+ Use nullptr instead of NULL
+
+ src/hb-blob.cc | 12 ++--
+ src/hb-buffer-serialize.cc | 16 ++---
+ src/hb-buffer.cc | 10 +--
+ src/hb-common.cc | 18 ++---
+ src/hb-coretext.cc | 66 ++++++++---------
+ src/hb-directwrite.cc | 28 ++++----
+ src/hb-face.cc | 10 +--
+ src/hb-font.cc | 32 ++++-----
+ src/hb-ft.cc | 56 +++++++--------
+ src/hb-glib.cc | 2 +-
+ src/hb-gobject-structs.cc | 2 +-
+ src/hb-graphite2.cc | 26 +++----
+ src/hb-icu.cc | 4 +-
+ src/hb-mutex-private.hh | 2 +-
+ src/hb-object-private.hh | 2 +-
+ src/hb-open-type-private.hh | 32 ++++-----
+ src/hb-ot-cbdt-table.hh | 4 +-
+ src/hb-ot-cmap-table.hh | 2 +-
+ src/hb-ot-font.cc | 42 +++++------
+ src/hb-ot-layout-common-private.hh | 14 ++--
+ src/hb-ot-layout-gsub-table.hh | 2 +-
+ src/hb-ot-layout-gsubgpos-private.hh | 54 +++++++-------
+ src/hb-ot-layout-jstf-table.hh | 4 +-
+ src/hb-ot-layout.cc | 30 ++++----
+ src/hb-ot-map-private.hh | 6 +-
+ src/hb-ot-map.cc | 4 +-
+ src/hb-ot-math-table.hh | 8 +--
+ src/hb-ot-shape-complex-arabic-fallback.hh | 8 +--
+ src/hb-ot-shape-complex-arabic.cc | 32 ++++-----
+ src/hb-ot-shape-complex-default.cc | 22 +++---
+ src/hb-ot-shape-complex-hangul.cc | 12 ++--
+ src/hb-ot-shape-complex-hebrew.cc | 18 ++---
+ src/hb-ot-shape-complex-indic.cc | 12 ++--
+ src/hb-ot-shape-complex-myanmar.cc | 40 +++++------
+ src/hb-ot-shape-complex-private.hh | 26 +++----
+ src/hb-ot-shape-complex-thai.cc | 22 +++---
+ src/hb-ot-shape-complex-tibetan.cc | 20 +++---
+ src/hb-ot-shape-complex-use.cc | 16 ++---
+ src/hb-ot-shape-private.hh | 2 +-
+ src/hb-ot-shape.cc | 8 +--
+ src/hb-ot-tag.cc | 2 +-
+ src/hb-ot-var.cc | 2 +-
+ src/hb-private.hh | 37 +++++-----
+ src/hb-set-private.hh | 2 +-
+ src/hb-shape-plan.cc | 24 +++----
+ src/hb-shape.cc | 8 +--
+ src/hb-shaper-private.hh | 6 +-
+ src/hb-shaper.cc | 6 +-
+ src/hb-ucdn.cc | 2 +-
+ src/hb-unicode.cc | 4 +-
+ src/hb-uniscribe.cc | 50 ++++++-------
+ src/main.cc | 4 +-
+ src/test-buffer-serialize.cc | 8 +--
+ src/test-size-params.cc | 6 +-
+ src/test-would-substitute.cc | 8 +--
+ src/test.cc | 12 ++--
+ util/ansi-print.cc | 2 +-
+ util/hb-fc.cc | 6 +-
+ util/hb-ot-shape-closure.cc | 10 +--
+ util/hb-shape.cc | 14 ++--
+ util/helper-cairo.cc | 12 ++--
+ util/main-font-text.hh | 4 +-
+ util/options.cc | 110
+ ++++++++++++++---------------
+ util/options.hh | 56 +++++++--------
+ util/shape-consumer.hh | 10 +--
+ 65 files changed, 563 insertions(+), 568 deletions(-)
+
+commit fbb937b6807597c9ae002280c6a6278a97b701f3
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 15 12:04:16 2017 +0200
+
+ Don't use NULL in public headers
+
+ src/hb-buffer.h | 4 ++--
+ src/hb-common.h | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+commit c3448e8d21963eb7fc357a37a7a426a4bf130ef3
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 15 12:02:00 2017 +0200
+
+ Use static_assert instead of custom ASSERT_STATIC
+
+ src/hb-buffer-private.hh | 4 ++--
+ src/hb-buffer.cc | 2 +-
+ src/hb-cache-private.hh | 4 ++--
+ src/hb-coretext.cc | 2 +-
+ src/hb-open-type-private.hh | 6 +++---
+ src/hb-ot-layout-common-private.hh | 2 +-
+ src/hb-ot-layout-gdef-table.hh | 6 +++---
+ src/hb-ot-layout.cc | 14 ++++++------
+ src/hb-ot-map.cc | 2 +-
+ src/hb-ot-math-table.hh | 4 ++--
+ src/hb-ot-shape-complex-arabic-fallback.hh | 6 +++---
+ src/hb-ot-shape-complex-indic.cc | 2 +-
+ src/hb-ot-shape-complex-use.cc | 2 +-
+ src/hb-private.hh | 34
+ +++++++++++++-----------------
+ src/hb-set-private.hh | 8 +++----
+ src/hb-uniscribe.cc | 2 +-
+ util/options.cc | 3 ++-
+ 17 files changed, 50 insertions(+), 53 deletions(-)
+
+commit 76dcbf8b23475b25f8f1918f982bfd8f0dd3456e
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 15 11:24:35 2017 +0200
+
+ Add polyfill for static_assert and nullptr
+
+ Also fix hb_assert_constant_t.
+
+ src/hb-private.hh | 38 ++++++++++++++++++++++++++++++++++----
+ 1 file changed, 34 insertions(+), 4 deletions(-)
+
+commit dad431e75bf998dcb09cff795c0f1083b3bd5449
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 15 10:55:32 2017 +0200
+
+ [util] Include hb-private.hh
+
+ Simplifies compatibility issues by centralizing all boilerplate code
+ in hb-private.hh.
+
+ util/options.hh | 31 +++++--------------------------
+ 1 file changed, 5 insertions(+), 26 deletions(-)
+
+commit 81e2b9b8a959cb7d7503f58fca70761238697fc1
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Sun Oct 15 10:48:19 2017 +0200
+
+ Never skip over CGJ
+
+ We might want to tweak this some more. For now, never skipping over
+ it is better behavior than always skipping.
+
+ Part of https://github.com/behdad/harfbuzz/issues/554
+
+ src/hb-ot-layout-private.hh | 19
+ +++++++++++--------
+ .../bf962d3202883a820aed019d9b5c1838c2ff69c6.ttf | Bin 0 ->
+ 2468 bytes
+ test/shaping/tests/default-ignorables.tests | 1 +
+ 3 files changed, 12 insertions(+), 8 deletions(-)
+
+commit 25846cc39fb8a9516b8de4333f909851d471156f
+Author: Behdad Esfahbod <behdad@behdad.org>
+Date: Fri Oct 13 16:30:33 2017 +0200
+
+ 1.6.0
+
+ NEWS | 35 +++++++++++++++++++++++++++++++++++
+ configure.ac | 2 +-
+ docs/harfbuzz-docs.xml | 4 ++++
+ 3 files changed, 40 insertions(+), 1 deletion(-)
+
commit 74f1b88e3720103562552780af7058131c5492d5
Author: Behdad Esfahbod <behdad@behdad.org>
Date: Fri Oct 13 11:01:55 2017 +0200
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/Makefile.am b/Build/source/libs/harfbuzz/harfbuzz-src/Makefile.am
index 07b38c287df..fde5256422b 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 = \
BUILD.md \
RELEASING.md \
CMakeLists.txt \
+ replace-enum-strings.cmake \
$(NULL)
MAINTAINERCLEANFILES = \
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/NEWS b/Build/source/libs/harfbuzz/harfbuzz-src/NEWS
index 4973d124202..19daabf7620 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/NEWS
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/NEWS
@@ -1,3 +1,16 @@
+Overview of changes leading to 1.6.1
+Sunday, October 22nd, 2017
+====================================
+
+- Don't skip over COMBINING GRAPHEME JOINER when ligating, etc.
+ To be refined: https://github.com/behdad/harfbuzz/issues/554
+- Faster hb_set_t implementation.
+- Don't use deprecated ICU API.
+- Fix undefined-behavior in Myanmar shaper, introduced in 1.6.0
+- Deprecated API:
+ hb_set_invert()
+
+
Overview of changes leading to 1.6.0
Friday, October the 13th, 2017
====================================
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac b/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac
index 5b0797f995d..1e00e3d5fce 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac
@@ -1,6 +1,6 @@
AC_PREREQ([2.64])
AC_INIT([HarfBuzz],
- [1.6.0],
+ [1.6.1],
[https://github.com/behdad/harfbuzz/issues/new],
[harfbuzz],
[http://harfbuzz.org/])
@@ -80,6 +80,9 @@ if test "x$GCC" = "xyes"; then
# Make symbols link locally
LDFLAGS="$LDFLAGS -Bsymbolic-functions"
+ # Choose C++ version
+ CXXFLAGS="$CXXFLAGS -std=c++11"
+
# Make sure we don't link to libstdc++
CXXFLAGS="$CXXFLAGS -fno-rtti -fno-exceptions"
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/replace-enum-strings.cmake b/Build/source/libs/harfbuzz/harfbuzz-src/replace-enum-strings.cmake
new file mode 100644
index 00000000000..42fdbff9002
--- /dev/null
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/replace-enum-strings.cmake
@@ -0,0 +1,21 @@
+# CMake script to replace items
+# in sources generated by glib-mkenums
+
+FILE(READ ${ENUM_INPUT_SRC} enum_in)
+
+STRING(REPLACE
+ "_t_get_type"
+ "_get_type"
+ enum_out_tmp
+ "${enum_in}"
+ )
+
+STRING(REPLACE
+ "_T ("
+ " ("
+ enum_out
+ "${enum_out_tmp}"
+ )
+
+FILE(WRITE ${ENUM_OUTPUT_SRC} "${enum_out}")
+FILE(REMOVE ${ENUM_INPUT_SRC}) \ No newline at end of file
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources b/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources
index 51e687b4a14..9fe8a40e3b0 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources
@@ -8,7 +8,6 @@ HB_BASE_sources = \
hb-buffer-private.hh \
hb-buffer-serialize.cc \
hb-buffer.cc \
- hb-cache-private.hh \
hb-common.cc \
hb-face-private.hh \
hb-face.cc \
@@ -30,6 +29,7 @@ HB_BASE_sources = \
hb-ot-post-table.hh \
hb-ot-tag.cc \
hb-private.hh \
+ hb-set-digest-private.hh \
hb-set-private.hh \
hb-set.cc \
hb-shape.cc \
@@ -72,7 +72,9 @@ HB_NODIST_headers = \
hb-version.h \
$(NULL)
-HB_FALLBACK_sources = hb-fallback-shape.cc
+HB_FALLBACK_sources = \
+ hb-fallback-shape.cc \
+ $(NULL)
HB_OT_sources = \
hb-ot-font.cc \
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 41e99da0dda..e390d7520c5 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc
@@ -72,8 +72,8 @@ _hb_blob_destroy_user_data (hb_blob_t *blob)
{
if (blob->destroy) {
blob->destroy (blob->user_data);
- blob->user_data = NULL;
- blob->destroy = NULL;
+ blob->user_data = nullptr;
+ blob->destroy = nullptr;
}
}
@@ -194,12 +194,12 @@ hb_blob_get_empty (void)
true, /* immutable */
- NULL, /* data */
+ nullptr, /* data */
0, /* length */
HB_MEMORY_MODE_READONLY, /* mode */
- NULL, /* user_data */
- NULL /* destroy */
+ nullptr, /* user_data */
+ nullptr /* destroy */
};
return const_cast<hb_blob_t *> (&_hb_blob_nil);
@@ -379,7 +379,7 @@ hb_blob_get_data_writable (hb_blob_t *blob, unsigned int *length)
if (length)
*length = 0;
- return NULL;
+ return nullptr;
}
if (length)
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-json.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-json.hh
index 3f626bda40d..125a4192911 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-json.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-json.hh
@@ -448,7 +448,7 @@ _hb_buffer_deserialize_glyphs_json (hb_buffer_t *buffer,
const char *p = buf, *pe = buf + buf_len;
/* Ensure we have positions. */
- (void) hb_buffer_get_glyph_positions (buffer, NULL);
+ (void) hb_buffer_get_glyph_positions (buffer, nullptr);
while (p < pe && ISSPACE (*p))
p++;
@@ -457,7 +457,7 @@ _hb_buffer_deserialize_glyphs_json (hb_buffer_t *buffer,
*end_ptr = ++p;
}
- const char *tok = NULL;
+ const char *tok = nullptr;
int cs;
hb_glyph_info_t info = {0};
hb_glyph_position_t pos = {0};
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-text.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-text.hh
index d2d8daae7ed..426b1375876 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-text.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-deserialize-text.hh
@@ -325,7 +325,7 @@ _hb_buffer_deserialize_glyphs_text (hb_buffer_t *buffer,
const char *p = buf, *pe = buf + buf_len;
/* Ensure we have positions. */
- (void) hb_buffer_get_glyph_positions (buffer, NULL);
+ (void) hb_buffer_get_glyph_positions (buffer, nullptr);
while (p < pe && ISSPACE (*p))
p++;
@@ -334,7 +334,7 @@ _hb_buffer_deserialize_glyphs_text (hb_buffer_t *buffer,
*end_ptr = ++p;
}
- const char *eof = pe, *tok = NULL;
+ const char *eof = pe, *tok = nullptr;
int cs;
hb_glyph_info_t info = {0};
hb_glyph_position_t pos = {0};
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-private.hh
index 37380b40d1c..1aa87b65c50 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-private.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-private.hh
@@ -45,8 +45,8 @@
#define HB_BUFFER_MAX_LEN_DEFAULT 0x3FFFFFFF /* Shaping more than a billion chars? Let us know! */
#endif
-ASSERT_STATIC (sizeof (hb_glyph_info_t) == 20);
-ASSERT_STATIC (sizeof (hb_glyph_info_t) == sizeof (hb_glyph_position_t));
+static_assert ((sizeof (hb_glyph_info_t) == 20), "");
+static_assert ((sizeof (hb_glyph_info_t) == sizeof (hb_glyph_position_t)), "");
HB_MARK_AS_FLAG_T (hb_buffer_flags_t);
HB_MARK_AS_FLAG_T (hb_buffer_serialize_flags_t);
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 517d746efd5..ea62e9ffdb2 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
@@ -30,7 +30,7 @@
static const char *serialize_formats[] = {
"text",
"json",
- NULL
+ nullptr
};
/**
@@ -90,7 +90,7 @@ hb_buffer_serialize_format_to_string (hb_buffer_serialize_format_t format)
case HB_BUFFER_SERIALIZE_FORMAT_TEXT: return serialize_formats[0];
case HB_BUFFER_SERIALIZE_FORMAT_JSON: return serialize_formats[1];
default:
- case HB_BUFFER_SERIALIZE_FORMAT_INVALID: return NULL;
+ case HB_BUFFER_SERIALIZE_FORMAT_INVALID: return nullptr;
}
}
@@ -104,9 +104,9 @@ _hb_buffer_serialize_glyphs_json (hb_buffer_t *buffer,
hb_font_t *font,
hb_buffer_serialize_flags_t flags)
{
- hb_glyph_info_t *info = hb_buffer_get_glyph_infos (buffer, NULL);
+ hb_glyph_info_t *info = hb_buffer_get_glyph_infos (buffer, nullptr);
hb_glyph_position_t *pos = (flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS) ?
- NULL : hb_buffer_get_glyph_positions (buffer, NULL);
+ nullptr : hb_buffer_get_glyph_positions (buffer, nullptr);
*buf_consumed = 0;
for (unsigned int i = start; i < end; i++)
@@ -194,9 +194,9 @@ _hb_buffer_serialize_glyphs_text (hb_buffer_t *buffer,
hb_font_t *font,
hb_buffer_serialize_flags_t flags)
{
- hb_glyph_info_t *info = hb_buffer_get_glyph_infos (buffer, NULL);
+ hb_glyph_info_t *info = hb_buffer_get_glyph_infos (buffer, nullptr);
hb_glyph_position_t *pos = (flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS) ?
- NULL : hb_buffer_get_glyph_positions (buffer, NULL);
+ nullptr : hb_buffer_get_glyph_positions (buffer, nullptr);
*buf_consumed = 0;
for (unsigned int i = start; i < end; i++)
@@ -422,8 +422,8 @@ hb_bool_t
hb_buffer_deserialize_glyphs (hb_buffer_t *buffer,
const char *buf,
int buf_len, /* -1 means nul-terminated */
- const char **end_ptr, /* May be NULL */
- hb_font_t *font, /* May be NULL */
+ const char **end_ptr, /* May be nullptr */
+ hb_font_t *font, /* May be nullptr */
hb_buffer_serialize_format_t format)
{
const char *end;
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc
index 171d1016e3f..73b3e4bd55b 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc
@@ -120,8 +120,8 @@ hb_buffer_t::enlarge (unsigned int size)
}
unsigned int new_allocated = allocated;
- hb_glyph_position_t *new_pos = NULL;
- hb_glyph_info_t *new_info = NULL;
+ hb_glyph_position_t *new_pos = nullptr;
+ hb_glyph_info_t *new_info = nullptr;
bool separate_out = out_info != info;
if (unlikely (_hb_unsigned_int_mul_overflows (size, sizeof (info[0]))))
@@ -130,7 +130,7 @@ hb_buffer_t::enlarge (unsigned int size)
while (size >= new_allocated)
new_allocated += (new_allocated >> 1) + 32;
- ASSERT_STATIC (sizeof (info[0]) == sizeof (pos[0]));
+ static_assert ((sizeof (info[0]) == sizeof (pos[0])), "");
if (unlikely (_hb_unsigned_int_mul_overflows (new_allocated, sizeof (info[0]))))
goto done;
@@ -1993,9 +1993,9 @@ hb_buffer_set_message_func (hb_buffer_t *buffer,
buffer->message_data = user_data;
buffer->message_destroy = destroy;
} else {
- buffer->message_func = NULL;
- buffer->message_data = NULL;
- buffer->message_destroy = NULL;
+ buffer->message_func = nullptr;
+ buffer->message_data = nullptr;
+ buffer->message_destroy = nullptr;
}
}
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.h b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.h
index 42564bb19be..a8a4b84e97b 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.h
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.h
@@ -132,8 +132,8 @@ typedef struct hb_segment_properties_t {
#define HB_SEGMENT_PROPERTIES_DEFAULT {HB_DIRECTION_INVALID, \
HB_SCRIPT_INVALID, \
HB_LANGUAGE_INVALID, \
- NULL, \
- NULL}
+ (void *) 0, \
+ (void *) 0}
HB_EXTERN hb_bool_t
hb_segment_properties_equal (const hb_segment_properties_t *a,
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cache-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cache-private.hh
deleted file mode 100644
index 24957e1e96f..00000000000
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cache-private.hh
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright © 2012 Google, Inc.
- *
- * This is part of HarfBuzz, a text shaping library.
- *
- * Permission is hereby granted, without written agreement and without
- * license or royalty fees, to use, copy, modify, and distribute this
- * software and its documentation for any purpose, provided that the
- * above copyright notice and the following two paragraphs appear in
- * all copies of this software.
- *
- * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
- * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
- * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
- * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
- * DAMAGE.
- *
- * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
- * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
- * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
- * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
- *
- * Google Author(s): Behdad Esfahbod
- */
-
-#ifndef HB_CACHE_PRIVATE_HH
-#define HB_CACHE_PRIVATE_HH
-
-#include "hb-private.hh"
-
-
-/* Implements a lock-free cache for int->int functions. */
-
-template <unsigned int key_bits, unsigned int value_bits, unsigned int cache_bits>
-struct hb_cache_t
-{
- ASSERT_STATIC (key_bits >= cache_bits);
- ASSERT_STATIC (key_bits + value_bits - cache_bits < 8 * sizeof (unsigned int));
-
- inline void clear (void)
- {
- memset (values, 255, sizeof (values));
- }
-
- inline bool get (unsigned int key, unsigned int *value)
- {
- unsigned int k = key & ((1u<<cache_bits)-1);
- unsigned int v = values[k];
- if ((v >> value_bits) != (key >> cache_bits))
- return false;
- *value = v & ((1u<<value_bits)-1);
- return true;
- }
-
- inline bool set (unsigned int key, unsigned int value)
- {
- if (unlikely ((key >> key_bits) || (value >> value_bits)))
- return false; /* Overflows */
- unsigned int k = key & ((1u<<cache_bits)-1);
- unsigned int v = ((key>>cache_bits)<<value_bits) | value;
- values[k] = v;
- return true;
- }
-
- private:
- unsigned int values[1u<<cache_bits];
-};
-
-typedef hb_cache_t<21, 16, 8> hb_cmap_cache_t;
-typedef hb_cache_t<16, 24, 8> hb_advance_cache_t;
-
-
-#endif /* HB_CACHE_PRIVATE_HH */
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.cc
index 8e8e5565331..2f9b3b85319 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.cc
@@ -274,13 +274,13 @@ retry:
/* Not found; allocate one. */
hb_language_item_t *lang = (hb_language_item_t *) calloc (1, sizeof (hb_language_item_t));
if (unlikely (!lang))
- return NULL;
+ return nullptr;
lang->next = first_lang;
*lang = key;
if (unlikely (!lang->lang))
{
free (lang);
- return NULL;
+ return nullptr;
}
if (!hb_atomic_ptr_cmpexch (&langs, first_lang, lang)) {
@@ -318,7 +318,7 @@ hb_language_from_string (const char *str, int len)
if (!str || !len || !*str)
return HB_LANGUAGE_INVALID;
- hb_language_item_t *item = NULL;
+ hb_language_item_t *item = nullptr;
if (len >= 0)
{
/* NUL-terminate it. */
@@ -349,7 +349,7 @@ hb_language_from_string (const char *str, int len)
const char *
hb_language_to_string (hb_language_t language)
{
- /* This is actually NULL-safe! */
+ /* This is actually nullptr-safe! */
return language->s;
}
@@ -369,7 +369,7 @@ hb_language_get_default (void)
hb_language_t language = (hb_language_t) hb_atomic_ptr_get (&default_language);
if (unlikely (language == HB_LANGUAGE_INVALID)) {
- language = hb_language_from_string (setlocale (LC_CTYPE, NULL), -1);
+ language = hb_language_from_string (setlocale (LC_CTYPE, nullptr), -1);
(void) hb_atomic_ptr_cmpexch (&default_language, HB_LANGUAGE_INVALID, language);
}
@@ -562,9 +562,9 @@ hb_user_data_array_t::set (hb_user_data_key_t *key,
void *
hb_user_data_array_t::get (hb_user_data_key_t *key)
{
- hb_user_data_item_t item = {NULL, NULL, NULL};
+ hb_user_data_item_t item = {nullptr, nullptr, nullptr};
- return items.find (key, &item, lock) ? item.data : NULL;
+ return items.find (key, &item, lock) ? item.data : nullptr;
}
@@ -722,9 +722,9 @@ retry:
if (unlikely (!C))
{
- C = newlocale (LC_ALL_MASK, "C", NULL);
+ C = newlocale (LC_ALL_MASK, "C", nullptr);
- if (!hb_atomic_ptr_cmpexch (&C_locale, NULL, C))
+ if (!hb_atomic_ptr_cmpexch (&C_locale, nullptr, C))
{
freelocale (C_locale);
goto retry;
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.h b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.h
index 614a63aa60b..26200ce125b 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.h
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-common.h
@@ -134,7 +134,7 @@ hb_language_from_string (const char *str, int len);
HB_EXTERN const char *
hb_language_to_string (hb_language_t language);
-#define HB_LANGUAGE_INVALID ((hb_language_t) NULL)
+#define HB_LANGUAGE_INVALID ((hb_language_t) 0)
HB_EXTERN hb_language_t
hb_language_get_default (void);
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 22661407dea..937822b8673 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc
@@ -65,12 +65,12 @@ reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data)
CGFontRef cg_font = reinterpret_cast<CGFontRef> (user_data);
CFDataRef cf_data = CGFontCopyTableForTag (cg_font, tag);
if (unlikely (!cf_data))
- return NULL;
+ return nullptr;
const char *data = reinterpret_cast<const char*> (CFDataGetBytePtr (cf_data));
const size_t length = CFDataGetLength (cf_data);
if (!data || !length)
- return NULL;
+ return nullptr;
return hb_blob_create (data, length, HB_MEMORY_MODE_READONLY,
reinterpret_cast<void *> (const_cast<__CFData *> (cf_data)),
@@ -125,7 +125,7 @@ static void
release_data (void *info, const void *data, size_t size)
{
assert (hb_blob_get_length ((hb_blob_t *) info) == size &&
- hb_blob_get_data ((hb_blob_t *) info, NULL) == data);
+ hb_blob_get_data ((hb_blob_t *) info, nullptr) == data);
hb_blob_destroy ((hb_blob_t *) info);
}
@@ -133,7 +133,7 @@ release_data (void *info, const void *data, size_t size)
static CGFontRef
create_cg_font (hb_face_t *face)
{
- CGFontRef cg_font = NULL;
+ CGFontRef cg_font = nullptr;
if (face->destroy == _hb_cg_font_release)
{
cg_font = CGFontRetain ((CGFontRef) face->user_data);
@@ -161,7 +161,7 @@ create_cg_font (hb_face_t *face)
static CTFontRef
create_ct_font (CGFontRef cg_font, CGFloat font_size)
{
- CTFontRef ct_font = NULL;
+ CTFontRef ct_font = nullptr;
/* CoreText does not enable trak table usage / tracking when creating a CTFont
* using CTFontCreateWithGraphicsFont. The only way of enabling tracking seems
@@ -174,23 +174,23 @@ create_ct_font (CGFontRef cg_font, CGFloat font_size)
if (CFStringHasSuffix (cg_postscript_name, CFSTR ("-Bold")))
font_type = kCTFontUIFontEmphasizedSystem;
- ct_font = CTFontCreateUIFontForLanguage (font_type, font_size, NULL);
+ ct_font = CTFontCreateUIFontForLanguage (font_type, font_size, nullptr);
CFStringRef ct_result_name = CTFontCopyPostScriptName(ct_font);
if (CFStringCompare (ct_result_name, cg_postscript_name, 0) != kCFCompareEqualTo)
{
CFRelease(ct_font);
- ct_font = NULL;
+ ct_font = nullptr;
}
CFRelease (ct_result_name);
}
CFRelease (cg_postscript_name);
if (!ct_font)
- ct_font = CTFontCreateWithGraphicsFont (cg_font, font_size, NULL, NULL);
+ ct_font = CTFontCreateWithGraphicsFont (cg_font, font_size, nullptr, nullptr);
if (unlikely (!ct_font)) {
DEBUG_MSG (CORETEXT, cg_font, "Font CTFontCreateWithGraphicsFont() failed");
- return NULL;
+ return nullptr;
}
/* crbug.com/576941 and crbug.com/625902 and the investigation in the latter
@@ -200,7 +200,7 @@ create_ct_font (CGFontRef cg_font, CGFloat font_size)
* reconfiguring the cascade list causes CoreText crashes. For details, see
* crbug.com/549610 */
// 0x00070000 stands for "kCTVersionNumber10_10", see CoreText.h
- if (&CTGetCoreTextVersion != NULL && CTGetCoreTextVersion() < 0x00070000) {
+ if (&CTGetCoreTextVersion != nullptr && CTGetCoreTextVersion() < 0x00070000) {
CFStringRef fontName = CTFontCopyPostScriptName (ct_font);
bool isEmojiFont = CFStringCompare (fontName, CFSTR("AppleColorEmoji"), 0) == kCFCompareEqualTo;
CFRelease (fontName);
@@ -214,7 +214,7 @@ create_ct_font (CGFontRef cg_font, CGFloat font_size)
* font fallback which we don't need anyway. */
{
CTFontDescriptorRef last_resort_font_desc = get_last_resort_font_desc ();
- CTFontRef new_ct_font = CTFontCreateCopyWithAttributes (ct_font, 0.0, NULL, last_resort_font_desc);
+ CTFontRef new_ct_font = CTFontCreateCopyWithAttributes (ct_font, 0.0, nullptr, last_resort_font_desc);
CFRelease (last_resort_font_desc);
if (new_ct_font)
{
@@ -257,7 +257,7 @@ _hb_coretext_shaper_face_data_create (hb_face_t *face)
if (unlikely (!cg_font))
{
DEBUG_MSG (CORETEXT, face, "CGFont creation failed..");
- return NULL;
+ return nullptr;
}
return (hb_coretext_shaper_face_data_t *) cg_font;
@@ -275,7 +275,7 @@ _hb_coretext_shaper_face_data_destroy (hb_coretext_shaper_face_data_t *data)
CGFontRef
hb_coretext_face_get_cg_font (hb_face_t *face)
{
- if (unlikely (!hb_coretext_shaper_face_data_ensure (face))) return NULL;
+ if (unlikely (!hb_coretext_shaper_face_data_ensure (face))) return nullptr;
return (CGFontRef) HB_SHAPER_DATA_GET (face);
}
@@ -288,7 +288,7 @@ hb_coretext_shaper_font_data_t *
_hb_coretext_shaper_font_data_create (hb_font_t *font)
{
hb_face_t *face = font->face;
- if (unlikely (!hb_coretext_shaper_face_data_ensure (face))) return NULL;
+ if (unlikely (!hb_coretext_shaper_face_data_ensure (face))) return nullptr;
CGFontRef cg_font = (CGFontRef) HB_SHAPER_DATA_GET (face);
CTFontRef ct_font = create_ct_font (cg_font, coretext_font_size (font->ptem));
@@ -296,7 +296,7 @@ _hb_coretext_shaper_font_data_create (hb_font_t *font)
if (unlikely (!ct_font))
{
DEBUG_MSG (CORETEXT, font, "CGFont creation failed..");
- return NULL;
+ return nullptr;
}
return (hb_coretext_shaper_font_data_t *) ct_font;
@@ -333,7 +333,7 @@ _hb_coretext_shaper_shape_plan_data_destroy (hb_coretext_shaper_shape_plan_data_
CTFontRef
hb_coretext_font_get_ct_font (hb_font_t *font)
{
- if (unlikely (!hb_coretext_shaper_font_data_ensure (font))) return NULL;
+ if (unlikely (!hb_coretext_shaper_font_data_ensure (font))) return nullptr;
return (CTFontRef)HB_SHAPER_DATA_GET (font);
}
@@ -678,7 +678,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &active_features[j].rec.feature),
CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &active_features[j].rec.setting)
};
- ASSERT_STATIC (ARRAY_LENGTH (keys) == ARRAY_LENGTH (values));
+ static_assert ((ARRAY_LENGTH_CONST (keys) == ARRAY_LENGTH_CONST (values)), "");
CFDictionaryRef dict = CFDictionaryCreate (kCFAllocatorDefault,
(const void **) keys,
(const void **) values,
@@ -704,12 +704,12 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
CTFontDescriptorRef font_desc = CTFontDescriptorCreateWithAttributes (attributes);
CFRelease (attributes);
- range->font = CTFontCreateCopyWithAttributes (ct_font, 0.0, NULL, font_desc);
+ range->font = CTFontCreateCopyWithAttributes (ct_font, 0.0, nullptr, font_desc);
CFRelease (font_desc);
}
else
{
- range->font = NULL;
+ range->font = nullptr;
}
range->index_first = last_index;
@@ -779,14 +779,14 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
#define FAIL(...) \
HB_STMT_START { \
- DEBUG_MSG (CORETEXT, NULL, __VA_ARGS__); \
+ DEBUG_MSG (CORETEXT, nullptr, __VA_ARGS__); \
ret = false; \
goto fail; \
} HB_STMT_END;
bool ret = true;
- CFStringRef string_ref = NULL;
- CTLineRef line = NULL;
+ CFStringRef string_ref = nullptr;
+ CTLineRef line = nullptr;
if (0)
{
@@ -798,8 +798,8 @@ resize_and_retry:
assert (line);
CFRelease (string_ref);
CFRelease (line);
- string_ref = NULL;
- line = NULL;
+ string_ref = nullptr;
+ line = nullptr;
/* Get previous start-of-scratch-area, that we use later for readjusting
* our existing scratch arrays. */
@@ -820,7 +820,7 @@ resize_and_retry:
scratch_size -= old_scratch_used;
}
{
- string_ref = CFStringCreateWithCharactersNoCopy (NULL,
+ string_ref = CFStringCreateWithCharactersNoCopy (nullptr,
pchars, chars_len,
kCFAllocatorNull);
if (unlikely (!string_ref))
@@ -937,7 +937,7 @@ resize_and_retry:
CFArrayRef glyph_runs = CTLineGetGlyphRuns (line);
unsigned int num_runs = CFArrayGetCount (glyph_runs);
- DEBUG_MSG (CORETEXT, NULL, "Num runs: %d", num_runs);
+ DEBUG_MSG (CORETEXT, nullptr, "Num runs: %d", num_runs);
buffer->len = 0;
uint32_t status_and = ~0, status_or = 0;
@@ -963,7 +963,7 @@ resize_and_retry:
status_or |= run_status;
status_and &= run_status;
DEBUG_MSG (CORETEXT, run, "CTRunStatus: %x", run_status);
- double run_advance = CTRunGetTypographicBounds (run, range_all, NULL, NULL, NULL);
+ double run_advance = CTRunGetTypographicBounds (run, range_all, nullptr, nullptr, nullptr);
if (HB_DIRECTION_IS_VERTICAL (buffer->props.direction))
run_advance = -run_advance;
DEBUG_MSG (CORETEXT, run, "Run advance: %g", run_advance);
@@ -1089,7 +1089,7 @@ resize_and_retry:
/* Testing used to indicate that CTRunGetGlyphsPtr, etc (almost?) always
* succeed, and so copying data to our own buffer will be rare. Reports
- * have it that this changed in OS X 10.10 Yosemite, and NULL is returned
+ * have it that this changed in OS X 10.10 Yosemite, and nullptr is returned
* frequently. At any rate, we can test that codepath by setting USE_PTR
* to false. */
@@ -1105,13 +1105,13 @@ resize_and_retry:
{ /* Setup glyphs */
SCRATCH_SAVE();
- const CGGlyph* glyphs = USE_PTR ? CTRunGetGlyphsPtr (run) : NULL;
+ const CGGlyph* glyphs = USE_PTR ? CTRunGetGlyphsPtr (run) : nullptr;
if (!glyphs) {
ALLOCATE_ARRAY (CGGlyph, glyph_buf, num_glyphs, goto resize_and_retry);
CTRunGetGlyphs (run, range_all, glyph_buf);
glyphs = glyph_buf;
}
- const CFIndex* string_indices = USE_PTR ? CTRunGetStringIndicesPtr (run) : NULL;
+ const CFIndex* string_indices = USE_PTR ? CTRunGetStringIndicesPtr (run) : nullptr;
if (!string_indices) {
ALLOCATE_ARRAY (CFIndex, index_buf, num_glyphs, goto resize_and_retry);
CTRunGetStringIndices (run, range_all, index_buf);
@@ -1133,7 +1133,7 @@ resize_and_retry:
* advance (in the advance direction only), and for last glyph we set
* whatever is needed to make the whole run's advance add up. */
SCRATCH_SAVE();
- const CGPoint* positions = USE_PTR ? CTRunGetPositionsPtr (run) : NULL;
+ const CGPoint* positions = USE_PTR ? CTRunGetPositionsPtr (run) : nullptr;
if (!positions) {
ALLOCATE_ARRAY (CGPoint, position_buf, num_glyphs, goto resize_and_retry);
CTRunGetPositions (run, range_all, position_buf);
@@ -1300,12 +1300,12 @@ _hb_coretext_aat_shaper_face_data_create (hb_face_t *face)
if (hb_blob_get_length (blob))
{
hb_blob_destroy (blob);
- return hb_coretext_shaper_face_data_ensure (face) ? (hb_coretext_aat_shaper_face_data_t *) HB_SHAPER_DATA_SUCCEEDED : NULL;
+ return hb_coretext_shaper_face_data_ensure (face) ? (hb_coretext_aat_shaper_face_data_t *) HB_SHAPER_DATA_SUCCEEDED : nullptr;
}
hb_blob_destroy (blob);
}
- return NULL;
+ return nullptr;
}
void
@@ -1323,7 +1323,7 @@ struct hb_coretext_aat_shaper_font_data_t {};
hb_coretext_aat_shaper_font_data_t *
_hb_coretext_aat_shaper_font_data_create (hb_font_t *font)
{
- return hb_coretext_shaper_font_data_ensure (font) ? (hb_coretext_aat_shaper_font_data_t *) HB_SHAPER_DATA_SUCCEEDED : NULL;
+ return hb_coretext_shaper_font_data_ensure (font) ? (hb_coretext_aat_shaper_font_data_t *) HB_SHAPER_DATA_SUCCEEDED : nullptr;
}
void
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 0398dfae60b..eac7efb42f1 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-deprecated.h
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-deprecated.h
@@ -34,6 +34,7 @@
#include "hb-common.h"
#include "hb-unicode.h"
#include "hb-font.h"
+#include "hb-set.h"
HB_BEGIN_DECLS
@@ -54,6 +55,9 @@ hb_font_funcs_set_glyph_func (hb_font_funcs_t *ffuncs,
hb_font_get_glyph_func_t func,
void *user_data, hb_destroy_func_t destroy);
+HB_EXTERN void
+hb_set_invert (hb_set_t *set);
+
#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 14df8221b1d..a6693ef3aed 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-directwrite.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-directwrite.cc
@@ -140,7 +140,7 @@ _hb_directwrite_shaper_face_data_create(hb_face_t *face)
hb_directwrite_shaper_face_data_t *data =
(hb_directwrite_shaper_face_data_t *) malloc (sizeof (hb_directwrite_shaper_face_data_t));
if (unlikely (!data))
- return NULL;
+ return nullptr;
// TODO: factory and fontFileLoader should be cached separately
IDWriteFactory* dwriteFactory;
@@ -153,7 +153,7 @@ _hb_directwrite_shaper_face_data_create(hb_face_t *face)
HRESULT hr;
hb_blob_t *blob = hb_face_reference_blob (face);
IDWriteFontFileStream *fontFileStream = new DWriteFontFileStream (
- (uint8_t*) hb_blob_get_data (blob, NULL), hb_blob_get_length (blob));
+ (uint8_t*) hb_blob_get_data (blob, nullptr), hb_blob_get_length (blob));
IDWriteFontFileLoader *fontFileLoader = new DWriteFontFileLoader (fontFileStream);
dwriteFactory->RegisterFontFileLoader (fontFileLoader);
@@ -165,7 +165,7 @@ _hb_directwrite_shaper_face_data_create(hb_face_t *face)
#define FAIL(...) \
HB_STMT_START { \
- DEBUG_MSG (DIRECTWRITE, NULL, __VA_ARGS__); \
+ DEBUG_MSG (DIRECTWRITE, nullptr, __VA_ARGS__); \
return false; \
} HB_STMT_END;
@@ -233,12 +233,12 @@ struct hb_directwrite_shaper_font_data_t {
hb_directwrite_shaper_font_data_t *
_hb_directwrite_shaper_font_data_create (hb_font_t *font)
{
- if (unlikely (!hb_directwrite_shaper_face_data_ensure (font->face))) return NULL;
+ if (unlikely (!hb_directwrite_shaper_face_data_ensure (font->face))) return nullptr;
hb_directwrite_shaper_font_data_t *data =
(hb_directwrite_shaper_font_data_t *) malloc (sizeof (hb_directwrite_shaper_font_data_t));
if (unlikely (!data))
- return NULL;
+ return nullptr;
return data;
}
@@ -313,7 +313,7 @@ public:
, mTextLength(textLength)
, mLocaleName(localeName)
, mReadingDirection(readingDirection)
- , mCurrentRun(NULL) { };
+ , mCurrentRun(nullptr) { };
~TextAnalysis() {
// delete runs, except mRunHead which is part of the TextAnalysis object
@@ -337,7 +337,7 @@ public:
mRunHead.mTextLength = mTextLength;
mRunHead.mBidiLevel =
(mReadingDirection == DWRITE_READING_DIRECTION_RIGHT_TO_LEFT);
- mRunHead.nextRun = NULL;
+ mRunHead.nextRun = nullptr;
mCurrentRun = &mRunHead;
// Call each of the analyzers in sequence, recording their results.
@@ -356,7 +356,7 @@ public:
{
if (textPosition >= mTextLength) {
// No text at this position, valid query though.
- *textString = NULL;
+ *textString = nullptr;
*textLength = 0;
}
else {
@@ -373,7 +373,7 @@ public:
if (textPosition == 0 || textPosition > mTextLength) {
// Either there is no text before here (== 0), or this
// is an invalid position. The query is considered valid thouh.
- *textString = NULL;
+ *textString = nullptr;
*textLength = 0;
}
else {
@@ -399,7 +399,7 @@ public:
OUT IDWriteNumberSubstitution** numberSubstitution)
{
// We do not support number substitution.
- *numberSubstitution = NULL;
+ *numberSubstitution = nullptr;
*textLength = mTextLength - textPosition;
return S_OK;
@@ -617,14 +617,14 @@ _hb_directwrite_shape_full(hb_shape_plan_t *shape_plan,
*/
uint32_t textLength = buffer->len;
- TextAnalysis analysis(textString, textLength, NULL, readingDirection);
+ TextAnalysis analysis(textString, textLength, nullptr, readingDirection);
TextAnalysis::Run *runHead;
HRESULT hr;
hr = analysis.GenerateResults(analyzer, &runHead);
#define FAIL(...) \
HB_STMT_START { \
- DEBUG_MSG (DIRECTWRITE, NULL, __VA_ARGS__); \
+ DEBUG_MSG (DIRECTWRITE, nullptr, __VA_ARGS__); \
return false; \
} HB_STMT_END;
@@ -639,7 +639,7 @@ _hb_directwrite_shape_full(hb_shape_plan_t *shape_plan,
bool isRightToLeft = HB_DIRECTION_IS_BACKWARD (buffer->props.direction);
const wchar_t localeName[20] = {0};
- if (buffer->props.language != NULL)
+ if (buffer->props.language != nullptr)
{
mbstowcs ((wchar_t*) localeName,
hb_language_to_string (buffer->props.language), 20);
@@ -672,7 +672,7 @@ retry_getglyphs:
malloc (maxGlyphCount * sizeof (DWRITE_SHAPING_GLYPH_PROPERTIES));
hr = analyzer->GetGlyphs (textString, textLength, fontFace, false,
- isRightToLeft, &runHead->mScript, localeName, NULL, &dwFeatures,
+ isRightToLeft, &runHead->mScript, localeName, nullptr, &dwFeatures,
featureRangeLengths, 1, maxGlyphCount, clusterMap, textProperties, glyphIndices,
glyphProperties, &glyphCount);
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 e96c8acd386..26fddbe5292 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc
@@ -43,9 +43,9 @@ const hb_face_t _hb_face_nil = {
true, /* immutable */
- NULL, /* reference_table_func */
- NULL, /* user_data */
- NULL, /* destroy */
+ nullptr, /* reference_table_func */
+ nullptr, /* user_data */
+ nullptr, /* destroy */
0, /* index */
1000, /* upem */
@@ -57,7 +57,7 @@ const hb_face_t _hb_face_nil = {
#undef HB_SHAPER_IMPLEMENT
},
- NULL, /* shape_plans */
+ nullptr, /* shape_plans */
};
@@ -109,7 +109,7 @@ _hb_face_for_data_closure_create (hb_blob_t *blob, unsigned int index)
closure = (hb_face_for_data_closure_t *) calloc (1, sizeof (hb_face_for_data_closure_t));
if (unlikely (!closure))
- return NULL;
+ return nullptr;
closure->blob = blob;
closure->index = index;
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 5673e66e3d0..f3534b686bf 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc
@@ -36,7 +36,7 @@
*/
static hb_bool_t
-hb_font_get_font_h_extents_nil (hb_font_t *font,
+hb_font_get_font_h_extents_nil (hb_font_t *font HB_UNUSED,
void *font_data HB_UNUSED,
hb_font_extents_t *metrics,
void *user_data HB_UNUSED)
@@ -60,7 +60,7 @@ hb_font_get_font_h_extents_parent (hb_font_t *font,
}
static hb_bool_t
-hb_font_get_font_v_extents_nil (hb_font_t *font,
+hb_font_get_font_v_extents_nil (hb_font_t *font HB_UNUSED,
void *font_data HB_UNUSED,
hb_font_extents_t *metrics,
void *user_data HB_UNUSED)
@@ -347,12 +347,12 @@ static const hb_font_funcs_t _hb_font_funcs_nil = {
true, /* immutable */
{
-#define HB_FONT_FUNC_IMPLEMENT(name) NULL,
+#define HB_FONT_FUNC_IMPLEMENT(name) nullptr,
HB_FONT_FUNCS_IMPLEMENT_CALLBACKS
#undef HB_FONT_FUNC_IMPLEMENT
},
{
-#define HB_FONT_FUNC_IMPLEMENT(name) NULL,
+#define HB_FONT_FUNC_IMPLEMENT(name) nullptr,
HB_FONT_FUNCS_IMPLEMENT_CALLBACKS
#undef HB_FONT_FUNC_IMPLEMENT
},
@@ -370,12 +370,12 @@ static const hb_font_funcs_t _hb_font_funcs_parent = {
true, /* immutable */
{
-#define HB_FONT_FUNC_IMPLEMENT(name) NULL,
+#define HB_FONT_FUNC_IMPLEMENT(name) nullptr,
HB_FONT_FUNCS_IMPLEMENT_CALLBACKS
#undef HB_FONT_FUNC_IMPLEMENT
},
{
-#define HB_FONT_FUNC_IMPLEMENT(name) NULL,
+#define HB_FONT_FUNC_IMPLEMENT(name) nullptr,
HB_FONT_FUNCS_IMPLEMENT_CALLBACKS
#undef HB_FONT_FUNC_IMPLEMENT
},
@@ -563,8 +563,8 @@ hb_font_funcs_set_##name##_func (hb_font_funcs_t *ffuncs, \
ffuncs->destroy.name = destroy; \
} else { \
ffuncs->get.f.name = hb_font_get_##name##_parent; \
- ffuncs->user_data.name = NULL; \
- ffuncs->destroy.name = NULL; \
+ ffuncs->user_data.name = nullptr; \
+ ffuncs->destroy.name = nullptr; \
} \
}
@@ -1161,7 +1161,7 @@ hb_font_create_sub_font (hb_font_t *parent)
font->num_coords = parent->num_coords;
if (!font->num_coords)
- font->coords = NULL;
+ font->coords = nullptr;
else
{
unsigned int size = parent->num_coords * sizeof (parent->coords[0]);
@@ -1192,7 +1192,7 @@ hb_font_get_empty (void)
true, /* immutable */
- NULL, /* parent */
+ nullptr, /* parent */
const_cast<hb_face_t *> (&_hb_face_nil),
1000, /* x_scale */
@@ -1203,11 +1203,11 @@ hb_font_get_empty (void)
0, /* ptem */
0, /* num_coords */
- NULL, /* coords */
+ nullptr, /* coords */
const_cast<hb_font_funcs_t *> (&_hb_font_funcs_nil), /* klass */
- NULL, /* user_data */
- NULL, /* destroy */
+ nullptr, /* user_data */
+ nullptr, /* destroy */
{
#define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_INVALID,
@@ -1639,13 +1639,13 @@ hb_font_set_variations (hb_font_t *font,
if (!variations_length)
{
- hb_font_set_var_coords_normalized (font, NULL, 0);
+ hb_font_set_var_coords_normalized (font, nullptr, 0);
return;
}
unsigned int coords_length = hb_ot_var_get_axis_count (font->face);
- int *normalized = coords_length ? (int *) calloc (coords_length, sizeof (int)) : NULL;
+ int *normalized = coords_length ? (int *) calloc (coords_length, sizeof (int)) : nullptr;
if (unlikely (coords_length && !normalized))
return;
@@ -1668,7 +1668,7 @@ hb_font_set_var_coords_design (hb_font_t *font,
if (font->immutable)
return;
- int *normalized = coords_length ? (int *) calloc (coords_length, sizeof (int)) : NULL;
+ int *normalized = coords_length ? (int *) calloc (coords_length, sizeof (int)) : nullptr;
if (unlikely (coords_length && !normalized))
return;
@@ -1689,7 +1689,7 @@ hb_font_set_var_coords_normalized (hb_font_t *font,
if (font->immutable)
return;
- int *copy = coords_length ? (int *) calloc (coords_length, sizeof (coords[0])) : NULL;
+ int *copy = coords_length ? (int *) calloc (coords_length, sizeof (coords[0])) : nullptr;
if (unlikely (coords_length && !copy))
return;
@@ -1749,7 +1749,7 @@ trampoline_create (FuncType func,
trampoline_t *trampoline = (trampoline_t *) calloc (1, sizeof (trampoline_t));
if (unlikely (!trampoline))
- return NULL;
+ return nullptr;
trampoline->closure.user_data = user_data;
trampoline->closure.destroy = destroy;
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 83af9942ec5..f578e9dc49b 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc
@@ -33,8 +33,6 @@
#include "hb-font-private.hh"
-#include "hb-cache-private.hh" // Maybe use in the future?
-
#include FT_ADVANCES_H
#include FT_MULTIPLE_MASTERS_H
#include FT_TRUETYPE_TABLES_H
@@ -83,7 +81,7 @@ _hb_ft_font_create (FT_Face ft_face, bool symbol, bool unref)
hb_ft_font_t *ft_font = (hb_ft_font_t *) calloc (1, sizeof (hb_ft_font_t));
if (unlikely (!ft_font))
- return NULL;
+ return nullptr;
ft_font->ft_face = ft_face;
ft_font->symbol = symbol;
@@ -158,7 +156,7 @@ FT_Face
hb_ft_font_get_face (hb_font_t *font)
{
if (font->destroy != _hb_ft_font_destroy)
- return NULL;
+ return nullptr;
const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font->user_data;
@@ -424,7 +422,7 @@ hb_ft_get_font_h_extents (hb_font_t *font HB_UNUSED,
return true;
}
-static hb_font_funcs_t *static_ft_funcs = NULL;
+static hb_font_funcs_t *static_ft_funcs = nullptr;
#ifdef HB_USE_ATEXIT
static
@@ -444,24 +442,24 @@ retry:
{
funcs = hb_font_funcs_create ();
- hb_font_funcs_set_font_h_extents_func (funcs, hb_ft_get_font_h_extents, NULL, NULL);
- //hb_font_funcs_set_font_v_extents_func (funcs, hb_ft_get_font_v_extents, NULL, NULL);
- hb_font_funcs_set_nominal_glyph_func (funcs, hb_ft_get_nominal_glyph, NULL, NULL);
- hb_font_funcs_set_variation_glyph_func (funcs, hb_ft_get_variation_glyph, NULL, NULL);
- hb_font_funcs_set_glyph_h_advance_func (funcs, hb_ft_get_glyph_h_advance, NULL, NULL);
- hb_font_funcs_set_glyph_v_advance_func (funcs, hb_ft_get_glyph_v_advance, NULL, NULL);
- //hb_font_funcs_set_glyph_h_origin_func (funcs, hb_ft_get_glyph_h_origin, NULL, NULL);
- hb_font_funcs_set_glyph_v_origin_func (funcs, hb_ft_get_glyph_v_origin, NULL, NULL);
- hb_font_funcs_set_glyph_h_kerning_func (funcs, hb_ft_get_glyph_h_kerning, NULL, NULL);
- //hb_font_funcs_set_glyph_v_kerning_func (funcs, hb_ft_get_glyph_v_kerning, NULL, NULL);
- hb_font_funcs_set_glyph_extents_func (funcs, hb_ft_get_glyph_extents, NULL, NULL);
- hb_font_funcs_set_glyph_contour_point_func (funcs, hb_ft_get_glyph_contour_point, NULL, NULL);
- hb_font_funcs_set_glyph_name_func (funcs, hb_ft_get_glyph_name, NULL, NULL);
- hb_font_funcs_set_glyph_from_name_func (funcs, hb_ft_get_glyph_from_name, NULL, NULL);
+ hb_font_funcs_set_font_h_extents_func (funcs, hb_ft_get_font_h_extents, nullptr, nullptr);
+ //hb_font_funcs_set_font_v_extents_func (funcs, hb_ft_get_font_v_extents, nullptr, nullptr);
+ hb_font_funcs_set_nominal_glyph_func (funcs, hb_ft_get_nominal_glyph, nullptr, nullptr);
+ hb_font_funcs_set_variation_glyph_func (funcs, hb_ft_get_variation_glyph, nullptr, nullptr);
+ hb_font_funcs_set_glyph_h_advance_func (funcs, hb_ft_get_glyph_h_advance, nullptr, nullptr);
+ 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);
+ hb_font_funcs_set_glyph_h_kerning_func (funcs, hb_ft_get_glyph_h_kerning, nullptr, nullptr);
+ //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);
+ hb_font_funcs_set_glyph_from_name_func (funcs, hb_ft_get_glyph_from_name, nullptr, nullptr);
hb_font_funcs_make_immutable (funcs);
- if (!hb_atomic_ptr_cmpexch (&static_ft_funcs, NULL, funcs)) {
+ if (!hb_atomic_ptr_cmpexch (&static_ft_funcs, nullptr, funcs)) {
hb_font_funcs_destroy (funcs);
goto retry;
}
@@ -490,17 +488,17 @@ reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data)
/* Note: FreeType like HarfBuzz uses the NONE tag for fetching the entire blob */
- error = FT_Load_Sfnt_Table (ft_face, tag, 0, NULL, &length);
+ error = FT_Load_Sfnt_Table (ft_face, tag, 0, nullptr, &length);
if (error)
- return NULL;
+ return nullptr;
buffer = (FT_Byte *) malloc (length);
if (!buffer)
- return NULL;
+ return nullptr;
error = FT_Load_Sfnt_Table (ft_face, tag, 0, buffer, &length);
if (error)
- return NULL;
+ return nullptr;
return hb_blob_create ((const char *) buffer, length,
HB_MEMORY_MODE_WRITABLE,
@@ -581,7 +579,7 @@ hb_ft_face_create_cached (FT_Face ft_face)
if (ft_face->generic.finalizer)
ft_face->generic.finalizer (ft_face);
- ft_face->generic.data = hb_ft_face_create (ft_face, NULL);
+ ft_face->generic.data = hb_ft_face_create (ft_face, nullptr);
ft_face->generic.finalizer = (FT_Generic_Finalizer) hb_ft_face_finalize;
}
@@ -633,7 +631,7 @@ hb_ft_font_changed (hb_font_t *font)
#endif
#ifdef HAVE_FT_GET_VAR_BLEND_COORDINATES
- FT_MM_Var *mm_var = NULL;
+ FT_MM_Var *mm_var = nullptr;
if (!FT_Get_MM_Var (ft_face, &mm_var))
{
FT_Fixed *ft_coords = (FT_Fixed *) calloc (mm_var->num_axis, sizeof (FT_Fixed));
@@ -694,9 +692,9 @@ retry:
{
/* Not found; allocate one. */
if (FT_Init_FreeType (&library))
- return NULL;
+ return nullptr;
- if (!hb_atomic_ptr_cmpexch (&ft_library, NULL, library)) {
+ if (!hb_atomic_ptr_cmpexch (&ft_library, nullptr, library)) {
FT_Done_FreeType (library);
goto retry;
}
@@ -724,7 +722,7 @@ hb_ft_font_set_funcs (hb_font_t *font)
if (unlikely (!blob_length))
DEBUG_MSG (FT, font, "Font face has empty blob");
- FT_Face ft_face = NULL;
+ FT_Face ft_face = nullptr;
FT_Error err = FT_New_Memory_Face (get_ft_library (),
(const FT_Byte *) blob_data,
blob_length,
@@ -751,7 +749,7 @@ hb_ft_font_set_funcs (hb_font_t *font)
{
FT_Matrix matrix = { font->x_scale < 0 ? -1 : +1, 0,
0, font->y_scale < 0 ? -1 : +1};
- FT_Set_Transform (ft_face, &matrix, NULL);
+ FT_Set_Transform (ft_face, &matrix, nullptr);
}
unsigned int num_coords;
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 8b499558b1b..5b0a1eb3253 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-glib.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-glib.cc
@@ -370,7 +370,7 @@ hb_glib_get_unicode_funcs (void)
static const hb_unicode_funcs_t _hb_glib_unicode_funcs = {
HB_OBJECT_HEADER_STATIC,
- NULL, /* parent */
+ nullptr, /* parent */
true, /* immutable */
{
#define HB_UNICODE_FUNC_IMPLEMENT(name) hb_glib_unicode_##name,
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 fef00245b79..a96c35804d5 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
@@ -58,7 +58,7 @@ hb_gobject_##name##_get_type (void) \
static hb_##name##_t *_hb_##name##_reference (const hb_##name##_t *l) \
{ \
hb_##name##_t *c = (hb_##name##_t *) calloc (1, sizeof (hb_##name##_t)); \
- if (unlikely (!c)) return NULL; \
+ if (unlikely (!c)) return nullptr; \
*c = *l; \
return c; \
} \
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 bc247c60cbc..6f0598dd0b8 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-graphite2.cc
@@ -59,7 +59,7 @@ static const void *hb_graphite2_get_table (const void *data, unsigned int tag, s
hb_graphite2_shaper_face_data_t *face_data = (hb_graphite2_shaper_face_data_t *) data;
hb_graphite2_tablelist_t *tlist = face_data->tlist;
- hb_blob_t *blob = NULL;
+ hb_blob_t *blob = nullptr;
for (hb_graphite2_tablelist_t *p = tlist; p; p = p->next)
if (p->tag == tag) {
@@ -74,7 +74,7 @@ static const void *hb_graphite2_get_table (const void *data, unsigned int tag, s
hb_graphite2_tablelist_t *p = (hb_graphite2_tablelist_t *) calloc (1, sizeof (hb_graphite2_tablelist_t));
if (unlikely (!p)) {
hb_blob_destroy (blob);
- return NULL;
+ return nullptr;
}
p->blob = blob;
p->tag = tag;
@@ -100,20 +100,20 @@ _hb_graphite2_shaper_face_data_create (hb_face_t *face)
if (!hb_blob_get_length (silf_blob))
{
hb_blob_destroy (silf_blob);
- return NULL;
+ return nullptr;
}
hb_blob_destroy (silf_blob);
hb_graphite2_shaper_face_data_t *data = (hb_graphite2_shaper_face_data_t *) calloc (1, sizeof (hb_graphite2_shaper_face_data_t));
if (unlikely (!data))
- return NULL;
+ return nullptr;
data->face = face;
data->grface = gr_make_face (data, &hb_graphite2_get_table, gr_face_preloadAll);
if (unlikely (!data->grface)) {
free (data);
- return NULL;
+ return nullptr;
}
return data;
@@ -143,7 +143,7 @@ _hb_graphite2_shaper_face_data_destroy (hb_graphite2_shaper_face_data_t *data)
gr_face *
hb_graphite2_face_get_gr_face (hb_face_t *face)
{
- if (unlikely (!hb_graphite2_shaper_face_data_ensure (face))) return NULL;
+ if (unlikely (!hb_graphite2_shaper_face_data_ensure (face))) return nullptr;
return HB_SHAPER_DATA_GET (face)->grface;
}
@@ -171,7 +171,7 @@ _hb_graphite2_shaper_font_data_destroy (hb_graphite2_shaper_font_data_t *data HB
gr_font *
hb_graphite2_font_get_gr_font (hb_font_t *font)
{
- return NULL;
+ return nullptr;
}
@@ -221,7 +221,7 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan,
gr_face *grface = HB_SHAPER_DATA_GET (face)->grface;
const char *lang = hb_language_to_string (hb_buffer_get_language (buffer));
- const char *lang_end = lang ? strchr (lang, '-') : NULL;
+ const char *lang_end = lang ? strchr (lang, '-') : nullptr;
int lang_len = lang_end ? lang_end - lang : -1;
gr_feature_val *feats = gr_face_featureval_for_lang (grface, lang ? hb_tag_from_string (lang, lang_len) : 0);
@@ -232,7 +232,7 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan,
gr_fref_set_feature_value (fref, features[i].value, feats);
}
- gr_segment *seg = NULL;
+ gr_segment *seg = nullptr;
const gr_slot *is;
unsigned int ci = 0, ic = 0;
float curradvx = 0., curradvy = 0.;
@@ -250,7 +250,7 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan,
hb_tag_t script_tag[2];
hb_ot_tags_from_script (hb_buffer_get_script (buffer), &script_tag[0], &script_tag[1]);
- seg = gr_make_seg (NULL, grface,
+ seg = gr_make_seg (nullptr, grface,
script_tag[1] == HB_TAG_NONE ? script_tag[0] : script_tag[1],
feats,
gr_utf32, chars, buffer->len,
@@ -368,7 +368,7 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan,
/* Positioning. */
unsigned int currclus = (unsigned int) -1;
const hb_glyph_info_t *info = buffer->info;
- hb_glyph_position_t *pPos = hb_buffer_get_glyph_positions (buffer, NULL);
+ hb_glyph_position_t *pPos = hb_buffer_get_glyph_positions (buffer, nullptr);
if (!HB_DIRECTION_IS_BACKWARD(buffer->props.direction))
{
curradvx = 0;
@@ -383,7 +383,7 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan,
} else
pPos->x_advance = 0.;
- pPos->y_advance = gr_slot_advance_Y (is, grface, NULL) * yscale;
+ pPos->y_advance = gr_slot_advance_Y (is, grface, nullptr) * yscale;
curradvy += pPos->y_advance;
}
}
@@ -400,7 +400,7 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan,
} else
pPos->x_advance = 0.;
- pPos->y_advance = gr_slot_advance_Y (is, grface, NULL) * yscale;
+ pPos->y_advance = gr_slot_advance_Y (is, grface, nullptr) * yscale;
curradvy -= pPos->y_advance;
pPos->x_offset = (gr_slot_origin_X (is) - info->var1.i32) * xscale - curradvx + pPos->x_advance;
pPos->y_offset = gr_slot_origin_Y (is) * yscale - curradvy;
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 ee54721fd4c..a00803c98d0 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-icu.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-icu.cc
@@ -34,7 +34,7 @@
#include "hb-unicode-private.hh"
#include <unicode/uchar.h>
-#include <unicode/unorm.h>
+#include <unicode/unorm2.h>
#include <unicode/ustring.h>
#include <unicode/utf16.h>
#include <unicode/uversion.h>
@@ -200,7 +200,7 @@ hb_icu_unicode_compose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
if (err) return false;
icu_err = U_ZERO_ERROR;
- len = unorm_normalize (utf16, len, UNORM_NFC, 0, normalized, ARRAY_LENGTH (normalized), &icu_err);
+ len = unorm2_normalize (unorm2_getNFCInstance (&icu_err), utf16, len, normalized, ARRAY_LENGTH (normalized), &icu_err);
if (U_FAILURE (icu_err))
return false;
if (u_countChar32 (normalized, len) == 1) {
@@ -261,7 +261,7 @@ hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
if (err) return false;
icu_err = U_ZERO_ERROR;
- len = unorm_normalize (utf16, len, UNORM_NFD, 0, normalized, ARRAY_LENGTH (normalized), &icu_err);
+ len = unorm2_normalize (unorm2_getNFDInstance (&icu_err), utf16, len, normalized, ARRAY_LENGTH (normalized), &icu_err);
if (U_FAILURE (icu_err))
return false;
@@ -281,7 +281,7 @@ hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
* the second part :-(. */
UChar recomposed[20];
icu_err = U_ZERO_ERROR;
- unorm_normalize (normalized, len, UNORM_NFC, 0, recomposed, ARRAY_LENGTH (recomposed), &icu_err);
+ unorm2_normalize (unorm2_getNFCInstance (&icu_err), normalized, len, recomposed, ARRAY_LENGTH (recomposed), &icu_err);
if (U_FAILURE (icu_err))
return false;
hb_codepoint_t c;
@@ -297,7 +297,7 @@ hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
U16_PREV_UNSAFE (normalized, len, *b); /* Changes len in-place. */
UChar recomposed[18 * 2];
icu_err = U_ZERO_ERROR;
- len = unorm_normalize (normalized, len, UNORM_NFC, 0, recomposed, ARRAY_LENGTH (recomposed), &icu_err);
+ len = unorm2_normalize (unorm2_getNFCInstance (&icu_err), normalized, len, recomposed, ARRAY_LENGTH (recomposed), &icu_err);
if (U_FAILURE (icu_err))
return false;
/* We expect that recomposed has exactly one character now. */
@@ -331,7 +331,7 @@ hb_icu_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs HB_UNUSED,
/* Normalise the codepoint using NFKD mode. */
icu_err = U_ZERO_ERROR;
- len = unorm_normalize (utf16, len, UNORM_NFKD, 0, normalized, ARRAY_LENGTH (normalized), &icu_err);
+ len = unorm2_normalize (unorm2_getNFKDInstance (&icu_err), utf16, len, normalized, ARRAY_LENGTH (normalized), &icu_err);
if (icu_err)
return 0;
@@ -351,7 +351,7 @@ hb_icu_get_unicode_funcs (void)
static const hb_unicode_funcs_t _hb_icu_unicode_funcs = {
HB_OBJECT_HEADER_STATIC,
- NULL, /* parent */
+ nullptr, /* parent */
true, /* immutable */
{
#define HB_UNICODE_FUNC_IMPLEMENT(name) hb_icu_unicode_##name,
@@ -364,7 +364,7 @@ hb_icu_get_unicode_funcs (void)
if (!hb_atomic_ptr_get (&normalizer)) {
UErrorCode icu_err = U_ZERO_ERROR;
/* We ignore failure in getNFCInstace(). */
- (void) hb_atomic_ptr_cmpexch (&normalizer, NULL, unorm2_getNFCInstance (&icu_err));
+ (void) hb_atomic_ptr_cmpexch (&normalizer, nullptr, unorm2_getNFCInstance (&icu_err));
}
#endif
return const_cast<hb_unicode_funcs_t *> (&_hb_icu_unicode_funcs);
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-mutex-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-mutex-private.hh
index ed2703571c1..49ed10e08a6 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-mutex-private.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-mutex-private.hh
@@ -68,7 +68,7 @@ typedef CRITICAL_SECTION hb_mutex_impl_t;
#include <pthread.h>
typedef pthread_mutex_t hb_mutex_impl_t;
#define HB_MUTEX_IMPL_INIT PTHREAD_MUTEX_INITIALIZER
-#define hb_mutex_impl_init(M) pthread_mutex_init (M, NULL)
+#define hb_mutex_impl_init(M) pthread_mutex_init (M, nullptr)
#define hb_mutex_impl_lock(M) pthread_mutex_lock (M)
#define hb_mutex_impl_unlock(M) pthread_mutex_unlock (M)
#define hb_mutex_impl_finish(M) pthread_mutex_destroy (M)
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-object-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-object-private.hh
index 6b73ff92d09..d678ae3692e 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-object-private.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-object-private.hh
@@ -193,7 +193,7 @@ static inline void *hb_object_get_user_data (Type *obj,
hb_user_data_key_t *key)
{
if (unlikely (!obj || hb_object_is_inert (obj)))
- return NULL;
+ return nullptr;
assert (hb_object_is_valid (obj));
return obj->header.user_data.get (key);
}
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-type-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-type-private.hh
index d90d68c592c..f25341a8aa9 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-type-private.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-type-private.hh
@@ -85,7 +85,7 @@ static inline Type& StructAfter(TObject &X)
#define _DEFINE_INSTANCE_ASSERTION1(_line, _assertion) \
inline void _instance_assertion_on_line_##_line (void) const \
{ \
- ASSERT_STATIC (_assertion); \
+ static_assert ((_assertion), ""); \
ASSERT_INSTANCE_POD (*this); /* Make sure it's POD. */ \
}
# define _DEFINE_INSTANCE_ASSERTION0(_line, _assertion) _DEFINE_INSTANCE_ASSERTION1 (_line, _assertion)
@@ -136,7 +136,7 @@ static const void *_NullPool[(256+8) / sizeof (void *)];
/* Generic nul-content Null objects. */
template <typename Type>
static inline const Type& Null (void) {
- ASSERT_STATIC (sizeof (Type) <= sizeof (_NullPool));
+ static_assert ((sizeof (Type) <= sizeof (_NullPool)), "");
return *CastP<Type> (_NullPool);
}
@@ -147,7 +147,7 @@ template <> \
/*static*/ inline const Type& Null<Type> (void) { \
return *CastP<Type> (_Null##Type); \
} /* The following line really exists such that we end in a place needing semicolon */ \
-ASSERT_STATIC (Type::min_size + 1 <= sizeof (_Null##Type))
+static_assert (Type::min_size + 1 <= sizeof (_Null##Type), "Null pool too small. Enlarge.")
/* Accessor macro. */
#define Null(Type) Null<Type>()
@@ -192,9 +192,9 @@ struct hb_sanitize_context_t :
{
inline hb_sanitize_context_t (void) :
debug_depth (0),
- start (NULL), end (NULL),
+ start (nullptr), end (nullptr),
writable (false), edit_count (0),
- blob (NULL) {}
+ blob (nullptr) {}
inline const char *get_name (void) { return "SANITIZE"; }
template <typename T, typename F>
@@ -214,7 +214,7 @@ struct hb_sanitize_context_t :
inline void start_processing (void)
{
- this->start = hb_blob_get_data (this->blob, NULL);
+ this->start = hb_blob_get_data (this->blob, nullptr);
this->end = this->start + hb_blob_get_length (this->blob);
assert (this->start <= this->end); /* Must not overflow. */
this->edit_count = 0;
@@ -233,8 +233,8 @@ struct hb_sanitize_context_t :
this->start, this->end, this->edit_count);
hb_blob_destroy (this->blob);
- this->blob = NULL;
- this->start = this->end = NULL;
+ this->blob = nullptr;
+ this->start = this->end = nullptr;
}
inline bool check_range (const void *base, unsigned int len) const
@@ -349,7 +349,7 @@ struct Sanitizer
} else {
unsigned int edit_count = c->edit_count;
if (edit_count && !c->writable) {
- c->start = hb_blob_get_data_writable (blob, NULL);
+ c->start = hb_blob_get_data_writable (blob, nullptr);
c->end = c->start + hb_blob_get_length (blob);
if (c->start) {
@@ -374,7 +374,7 @@ struct Sanitizer
static const Type* lock_instance (hb_blob_t *blob) {
hb_blob_make_immutable (blob);
- const char *base = hb_blob_get_data (blob, NULL);
+ const char *base = hb_blob_get_data (blob, nullptr);
return unlikely (!base) ? &Null(Type) : CastP<Type> (base);
}
};
@@ -445,7 +445,7 @@ struct hb_serialize_context_t
{
if (unlikely (this->ran_out_of_room || this->end - this->head < ptrdiff_t (size))) {
this->ran_out_of_room = true;
- return NULL;
+ return nullptr;
}
memset (this->head, 0, size);
char *ret = this->head;
@@ -471,7 +471,7 @@ struct hb_serialize_context_t
{
unsigned int size = obj.get_size ();
Type *ret = this->allocate_size<Type> (size);
- if (unlikely (!ret)) return NULL;
+ if (unlikely (!ret)) return nullptr;
memcpy (ret, obj, size);
return ret;
}
@@ -481,7 +481,7 @@ struct hb_serialize_context_t
{
unsigned int size = obj.min_size;
assert (this->start <= (char *) &obj && (char *) &obj <= this->head && (char *) &obj + size >= this->head);
- if (unlikely (!this->allocate_size<Type> (((char *) &obj) + size - this->head))) return NULL;
+ if (unlikely (!this->allocate_size<Type> (((char *) &obj) + size - this->head))) return nullptr;
return reinterpret_cast<Type *> (&obj);
}
@@ -490,7 +490,7 @@ struct hb_serialize_context_t
{
unsigned int size = obj.get_size ();
assert (this->start < (char *) &obj && (char *) &obj <= this->head && (char *) &obj + size >= this->head);
- if (unlikely (!this->allocate_size<Type> (((char *) &obj) + size - this->head))) return NULL;
+ if (unlikely (!this->allocate_size<Type> (((char *) &obj) + size - this->head))) return nullptr;
return reinterpret_cast<Type *> (&obj);
}
@@ -1047,11 +1047,12 @@ struct SortedArrayOf : ArrayOf<Type, LenType>
inline int bsearch (const SearchType &x) const
{
/* Hand-coded bsearch here since this is in the hot inner loop. */
+ const Type *array = this->array;
int min = 0, max = (int) this->len - 1;
while (min <= max)
{
int mid = (min + max) / 2;
- int c = this->array[mid].cmp (x);
+ int c = array[mid].cmp (x);
if (c < 0)
max = mid - 1;
else if (c > 0)
@@ -1073,7 +1074,7 @@ struct hb_lazy_loader_t
inline void init (hb_face_t *face_)
{
face = face_;
- instance = NULL;
+ instance = nullptr;
}
inline void fini (void)
@@ -1096,7 +1097,7 @@ struct hb_lazy_loader_t
p = const_cast<T *> (&OT::Null(T));
else
p->init (face);
- if (unlikely (!hb_atomic_ptr_cmpexch (const_cast<T **>(&instance), NULL, p)))
+ if (unlikely (!hb_atomic_ptr_cmpexch (const_cast<T **>(&instance), nullptr, p)))
{
if (p != &OT::Null(T))
p->fini ();
@@ -1123,8 +1124,8 @@ struct hb_lazy_table_loader_t
inline void init (hb_face_t *face_)
{
face = face_;
- instance = NULL;
- blob = NULL;
+ instance = nullptr;
+ blob = nullptr;
}
inline void fini (void)
@@ -1140,7 +1141,7 @@ struct hb_lazy_table_loader_t
{
hb_blob_t *blob_ = OT::Sanitizer<T>::sanitize (face->reference_table (T::tableTag));
p = const_cast<T *>(OT::Sanitizer<T>::lock_instance (blob_));
- if (!hb_atomic_ptr_cmpexch (const_cast<T **>(&instance), NULL, p))
+ if (!hb_atomic_ptr_cmpexch (const_cast<T **>(&instance), nullptr, p))
{
hb_blob_destroy (blob_);
goto retry;
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cbdt-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cbdt-table.hh
index 0a7fbf5b72a..3c6855b0549 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cbdt-table.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cbdt-table.hh
@@ -245,7 +245,7 @@ struct IndexSubtableArray
return &indexSubtablesZ[i];
}
}
- return NULL;
+ return nullptr;
}
protected:
@@ -344,7 +344,7 @@ struct CBLC
}
}
- return NULL;
+ return nullptr;
}
protected:
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 3a53a1cb561..93f38c56ab7 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
@@ -508,7 +508,7 @@ struct cmap
* unsorted subtable list. */
int result = encodingRecord./*bsearch*/lsearch (key);
if (result == -1 || !encodingRecord[result].subtable)
- return NULL;
+ return nullptr;
return &(this+encodingRecord[result].subtable);
}
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 a56f4c07f70..06d1b80650a 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
@@ -235,8 +235,8 @@ struct hb_ot_face_cbdt_accelerator_t
cbdt_len = hb_blob_get_length (cbdt_blob);
if (hb_blob_get_length (cblc_blob) == 0) {
- cblc = NULL;
- cbdt = NULL;
+ cblc = nullptr;
+ cbdt = nullptr;
return; /* Not a bitmap font. */
}
cblc = OT::Sanitizer<OT::CBLC>::lock_instance (cblc_blob);
@@ -349,8 +349,8 @@ struct hb_ot_face_cmap_accelerator_t
{
this->blob = OT::Sanitizer<OT::cmap>::sanitize (face->reference_table (HB_OT_TAG_cmap));
const OT::cmap *cmap = OT::Sanitizer<OT::cmap>::lock_instance (this->blob);
- const OT::CmapSubtable *subtable = NULL;
- const OT::CmapSubtableFormat14 *subtable_uvs = NULL;
+ const OT::CmapSubtable *subtable = nullptr;
+ const OT::CmapSubtableFormat14 *subtable_uvs = nullptr;
bool symbol = false;
/* 32-bit subtables. */
@@ -445,7 +445,7 @@ _hb_ot_font_create (hb_face_t *face)
hb_ot_font_t *ot_font = (hb_ot_font_t *) calloc (1, sizeof (hb_ot_font_t));
if (unlikely (!ot_font))
- return NULL;
+ return nullptr;
ot_font->cmap.init (face);
ot_font->h_metrics.init (face, HB_OT_TAG_hhea, HB_OT_TAG_hmtx, HB_OT_TAG_HVAR, HB_OT_TAG_os2);
@@ -563,7 +563,7 @@ hb_ot_get_font_v_extents (hb_font_t *font HB_UNUSED,
return ot_font->v_metrics.has_font_extents;
}
-static hb_font_funcs_t *static_ot_funcs = NULL;
+static hb_font_funcs_t *static_ot_funcs = nullptr;
#ifdef HB_USE_ATEXIT
static
@@ -583,24 +583,24 @@ retry:
{
funcs = hb_font_funcs_create ();
- hb_font_funcs_set_font_h_extents_func (funcs, hb_ot_get_font_h_extents, NULL, NULL);
- hb_font_funcs_set_font_v_extents_func (funcs, hb_ot_get_font_v_extents, NULL, NULL);
- hb_font_funcs_set_nominal_glyph_func (funcs, hb_ot_get_nominal_glyph, NULL, NULL);
- hb_font_funcs_set_variation_glyph_func (funcs, hb_ot_get_variation_glyph, NULL, NULL);
- hb_font_funcs_set_glyph_h_advance_func (funcs, hb_ot_get_glyph_h_advance, NULL, NULL);
- hb_font_funcs_set_glyph_v_advance_func (funcs, hb_ot_get_glyph_v_advance, NULL, NULL);
- //hb_font_funcs_set_glyph_h_origin_func (funcs, hb_ot_get_glyph_h_origin, NULL, NULL);
- //hb_font_funcs_set_glyph_v_origin_func (funcs, hb_ot_get_glyph_v_origin, NULL, NULL);
- //hb_font_funcs_set_glyph_h_kerning_func (funcs, hb_ot_get_glyph_h_kerning, NULL, NULL); TODO
- //hb_font_funcs_set_glyph_v_kerning_func (funcs, hb_ot_get_glyph_v_kerning, NULL, NULL);
- hb_font_funcs_set_glyph_extents_func (funcs, hb_ot_get_glyph_extents, NULL, NULL);
- //hb_font_funcs_set_glyph_contour_point_func (funcs, hb_ot_get_glyph_contour_point, NULL, NULL); TODO
- //hb_font_funcs_set_glyph_name_func (funcs, hb_ot_get_glyph_name, NULL, NULL); TODO
- //hb_font_funcs_set_glyph_from_name_func (funcs, hb_ot_get_glyph_from_name, NULL, NULL); TODO
+ hb_font_funcs_set_font_h_extents_func (funcs, hb_ot_get_font_h_extents, nullptr, nullptr);
+ hb_font_funcs_set_font_v_extents_func (funcs, hb_ot_get_font_v_extents, nullptr, nullptr);
+ hb_font_funcs_set_nominal_glyph_func (funcs, hb_ot_get_nominal_glyph, nullptr, nullptr);
+ hb_font_funcs_set_variation_glyph_func (funcs, hb_ot_get_variation_glyph, nullptr, nullptr);
+ hb_font_funcs_set_glyph_h_advance_func (funcs, hb_ot_get_glyph_h_advance, nullptr, nullptr);
+ hb_font_funcs_set_glyph_v_advance_func (funcs, hb_ot_get_glyph_v_advance, nullptr, nullptr);
+ //hb_font_funcs_set_glyph_h_origin_func (funcs, hb_ot_get_glyph_h_origin, nullptr, nullptr);
+ //hb_font_funcs_set_glyph_v_origin_func (funcs, hb_ot_get_glyph_v_origin, nullptr, nullptr);
+ //hb_font_funcs_set_glyph_h_kerning_func (funcs, hb_ot_get_glyph_h_kerning, nullptr, nullptr); TODO
+ //hb_font_funcs_set_glyph_v_kerning_func (funcs, hb_ot_get_glyph_v_kerning, 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); TODO
+ //hb_font_funcs_set_glyph_name_func (funcs, hb_ot_get_glyph_name, nullptr, nullptr); TODO
+ //hb_font_funcs_set_glyph_from_name_func (funcs, hb_ot_get_glyph_from_name, nullptr, nullptr); TODO
hb_font_funcs_make_immutable (funcs);
- if (!hb_atomic_ptr_cmpexch (&static_ot_funcs, NULL, funcs)) {
+ if (!hb_atomic_ptr_cmpexch (&static_ot_funcs, nullptr, funcs)) {
hb_font_funcs_destroy (funcs);
goto retry;
}
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-common-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-common-private.hh
index 578d850c184..ed18bd88f8c 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-common-private.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-common-private.hh
@@ -214,7 +214,7 @@ struct LangSys
}
inline bool sanitize (hb_sanitize_context_t *c,
- const Record<LangSys>::sanitize_closure_t * = NULL) const
+ const Record<LangSys>::sanitize_closure_t * = nullptr) const
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this) && featureIndex.sanitize (c));
@@ -254,7 +254,7 @@ struct Script
inline const LangSys& get_default_lang_sys (void) const { return this+defaultLangSys; }
inline bool sanitize (hb_sanitize_context_t *c,
- const Record<Script>::sanitize_closure_t * = NULL) const
+ const Record<Script>::sanitize_closure_t * = nullptr) const
{
TRACE_SANITIZE (this);
return_trace (defaultLangSys.sanitize (c, this) && langSys.sanitize (c, this));
@@ -435,17 +435,17 @@ struct FeatureParamsCharacterVariants
* specifies a string (or strings,
* for multiple languages) for a
* user-interface label for this
- * feature. (May be NULL.) */
+ * feature. (May be nullptr.) */
USHORT featUITooltipTextNameID;/* The ‘name’ table name ID that
* specifies a string (or strings,
* for multiple languages) that an
* application can use for tooltip
* text for this feature. (May be
- * NULL.) */
+ * nullptr.) */
USHORT sampleTextNameID; /* The ‘name’ table name ID that
* specifies sample text that
* illustrates the effect of this
- * feature. (May be NULL.) */
+ * feature. (May be nullptr.) */
USHORT numNamedParameters; /* Number of named parameters. (May
* be zero.) */
USHORT firstParamUILabelNameID;/* The first ‘name’ table name ID
@@ -507,7 +507,7 @@ struct Feature
{ return this+featureParams; }
inline bool sanitize (hb_sanitize_context_t *c,
- const Record<Feature>::sanitize_closure_t *closure = NULL) const
+ const Record<Feature>::sanitize_closure_t *closure = nullptr) const
{
TRACE_SANITIZE (this);
if (unlikely (!(c->check_struct (this) && lookupIndex.sanitize (c))))
@@ -690,7 +690,7 @@ struct CoverageFormat1
inline unsigned int get_coverage (hb_codepoint_t glyph_id) const
{
int i = glyphArray.bsearch (glyph_id);
- ASSERT_STATIC (((unsigned int) -1) == NOT_COVERED);
+ static_assert ((((unsigned int) -1) == NOT_COVERED), "");
return i;
}
@@ -1458,7 +1458,7 @@ struct FeatureTableSubstitution
if (record.featureIndex == feature_index)
return &(this+record.feature);
}
- return NULL;
+ return nullptr;
}
inline bool sanitize (hb_sanitize_context_t *c) const
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gdef-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gdef-table.hh
index 552df0fd89b..99dda3a74bb 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gdef-table.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gdef-table.hh
@@ -404,9 +404,9 @@ struct GDEF
{
unsigned int klass = get_glyph_class (glyph);
- ASSERT_STATIC ((unsigned int) HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH == (unsigned int) LookupFlag::IgnoreBaseGlyphs);
- ASSERT_STATIC ((unsigned int) HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE == (unsigned int) LookupFlag::IgnoreLigatures);
- ASSERT_STATIC ((unsigned int) HB_OT_LAYOUT_GLYPH_PROPS_MARK == (unsigned int) LookupFlag::IgnoreMarks);
+ static_assert (((unsigned int) HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH == (unsigned int) LookupFlag::IgnoreBaseGlyphs), "");
+ static_assert (((unsigned int) HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE == (unsigned int) LookupFlag::IgnoreLigatures), "");
+ static_assert (((unsigned int) HB_OT_LAYOUT_GLYPH_PROPS_MARK == (unsigned int) LookupFlag::IgnoreMarks), "");
switch (klass) {
default: return 0;
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsub-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsub-table.hh
index 85be7e7ea98..4ae45b9eff0 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsub-table.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsub-table.hh
@@ -658,7 +658,7 @@ struct Ligature
if (likely (!match_input (c, count,
&component[1],
match_glyph,
- NULL,
+ nullptr,
&match_length,
match_positions,
&is_mark_ligature,
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos-private.hh
index cedf96e3fb9..4abd4b715df 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos-private.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos-private.hh
@@ -77,7 +77,7 @@ struct hb_closure_context_t :
unsigned int nesting_level_left_ = HB_MAX_NESTING_LEVEL) :
face (face_),
glyphs (glyphs_),
- recurse_func (NULL),
+ recurse_func (nullptr),
nesting_level_left (nesting_level_left_),
debug_depth (0) {}
@@ -146,7 +146,7 @@ struct hb_collect_glyphs_context_t :
if (unlikely (nesting_level_left == 0 || !recurse_func))
return default_return_value ();
- /* Note that GPOS sets recurse_func to NULL already, so it doesn't get
+ /* Note that GPOS sets recurse_func to nullptr already, so it doesn't get
* past the previous check. For GSUB, we only want to collect the output
* glyphs in the recursion. If output is not requested, we can go home now.
*
@@ -192,17 +192,17 @@ struct hb_collect_glyphs_context_t :
unsigned int debug_depth;
hb_collect_glyphs_context_t (hb_face_t *face_,
- hb_set_t *glyphs_before, /* OUT. May be NULL */
- hb_set_t *glyphs_input, /* OUT. May be NULL */
- hb_set_t *glyphs_after, /* OUT. May be NULL */
- hb_set_t *glyphs_output, /* OUT. May be NULL */
+ hb_set_t *glyphs_before, /* OUT. May be nullptr */
+ hb_set_t *glyphs_input, /* OUT. May be nullptr */
+ hb_set_t *glyphs_after, /* OUT. May be nullptr */
+ hb_set_t *glyphs_output, /* OUT. May be nullptr */
unsigned int nesting_level_left_ = HB_MAX_NESTING_LEVEL) :
face (face_),
before (glyphs_before ? glyphs_before : hb_set_get_empty ()),
input (glyphs_input ? glyphs_input : hb_set_get_empty ()),
after (glyphs_after ? glyphs_after : hb_set_get_empty ()),
output (glyphs_output ? glyphs_output : hb_set_get_empty ()),
- recurse_func (NULL),
+ recurse_func (nullptr),
recursed_lookups (),
nesting_level_left (nesting_level_left_),
debug_depth (0)
@@ -273,8 +273,8 @@ struct hb_apply_context_t :
#define arg1(arg) (arg) /* Remove the macro to see why it's needed! */
syllable arg1(0),
#undef arg1
- match_func (NULL),
- match_data (NULL) {};
+ match_func (nullptr),
+ match_data (nullptr) {};
typedef bool (*match_func_t) (hb_codepoint_t glyph_id, const USHORT &value, const void *data);
@@ -342,8 +342,8 @@ struct hb_apply_context_t :
inline void init (hb_apply_context_t *c_, bool context_match = false)
{
c = c_;
- match_glyph_data = NULL;
- matcher.set_match_func (NULL, NULL);
+ match_glyph_data = nullptr;
+ matcher.set_match_func (nullptr, nullptr);
matcher.set_lookup_props (c->lookup_props);
/* Ignore ZWNJ if we are matching GSUB context, or matching GPOS. */
matcher.set_ignore_zwnj (c->table_index == 1 || (context_match && c->auto_zwnj));
@@ -491,7 +491,7 @@ struct hb_apply_context_t :
hb_buffer_t *buffer_) :
iter_input (), iter_context (),
font (font_), face (font->face), buffer (buffer_),
- recurse_func (NULL),
+ recurse_func (nullptr),
gdef (*hb_ot_layout_from_face (face)->gdef),
var_store (gdef.get_var_store ()),
direction (buffer_->props.direction),
@@ -719,10 +719,10 @@ static inline bool match_input (hb_apply_context_t *c,
const void *match_data,
unsigned int *end_offset,
unsigned int match_positions[HB_MAX_CONTEXT_LENGTH],
- bool *p_is_mark_ligature = NULL,
- unsigned int *p_total_component_count = NULL)
+ bool *p_is_mark_ligature = nullptr,
+ unsigned int *p_total_component_count = nullptr)
{
- TRACE_APPLY (NULL);
+ TRACE_APPLY (nullptr);
if (unlikely (count > HB_MAX_CONTEXT_LENGTH)) return_trace (false);
@@ -846,7 +846,7 @@ static inline bool ligate_input (hb_apply_context_t *c,
bool is_mark_ligature,
unsigned int total_component_count)
{
- TRACE_APPLY (NULL);
+ TRACE_APPLY (nullptr);
hb_buffer_t *buffer = c->buffer;
@@ -943,7 +943,7 @@ static inline bool match_backtrack (hb_apply_context_t *c,
const void *match_data,
unsigned int *match_start)
{
- TRACE_APPLY (NULL);
+ TRACE_APPLY (nullptr);
hb_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_context;
skippy_iter.reset (c->buffer->backtrack_len (), count);
@@ -966,7 +966,7 @@ static inline bool match_lookahead (hb_apply_context_t *c,
unsigned int offset,
unsigned int *end_index)
{
- TRACE_APPLY (NULL);
+ TRACE_APPLY (nullptr);
hb_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_context;
skippy_iter.reset (c->buffer->idx + offset - 1, count);
@@ -1016,7 +1016,7 @@ static inline bool apply_lookup (hb_apply_context_t *c,
const LookupRecord lookupRecord[], /* Array of LookupRecords--in design order */
unsigned int match_length)
{
- TRACE_APPLY (NULL);
+ TRACE_APPLY (nullptr);
hb_buffer_t *buffer = c->buffer;
int end;
@@ -1334,7 +1334,7 @@ struct ContextFormat1
struct ContextClosureLookupContext lookup_context = {
{intersects_glyph},
- NULL
+ nullptr
};
unsigned int count = ruleSet.len;
@@ -1352,7 +1352,7 @@ struct ContextFormat1
struct ContextCollectGlyphsLookupContext lookup_context = {
{collect_glyph},
- NULL
+ nullptr
};
unsigned int count = ruleSet.len;
@@ -1367,7 +1367,7 @@ struct ContextFormat1
const RuleSet &rule_set = this+ruleSet[(this+coverage).get_coverage (c->glyphs[0])];
struct ContextApplyLookupContext lookup_context = {
{match_glyph},
- NULL
+ nullptr
};
return_trace (rule_set.would_apply (c, lookup_context));
}
@@ -1387,7 +1387,7 @@ struct ContextFormat1
const RuleSet &rule_set = this+ruleSet[index];
struct ContextApplyLookupContext lookup_context = {
{match_glyph},
- NULL
+ nullptr
};
return_trace (rule_set.apply (c, lookup_context));
}
@@ -1892,7 +1892,7 @@ struct ChainContextFormat1
struct ChainContextClosureLookupContext lookup_context = {
{intersects_glyph},
- {NULL, NULL, NULL}
+ {nullptr, nullptr, nullptr}
};
unsigned int count = ruleSet.len;
@@ -1910,7 +1910,7 @@ struct ChainContextFormat1
struct ChainContextCollectGlyphsLookupContext lookup_context = {
{collect_glyph},
- {NULL, NULL, NULL}
+ {nullptr, nullptr, nullptr}
};
unsigned int count = ruleSet.len;
@@ -1925,7 +1925,7 @@ struct ChainContextFormat1
const ChainRuleSet &rule_set = this+ruleSet[(this+coverage).get_coverage (c->glyphs[0])];
struct ChainContextApplyLookupContext lookup_context = {
{match_glyph},
- {NULL, NULL, NULL}
+ {nullptr, nullptr, nullptr}
};
return_trace (rule_set.would_apply (c, lookup_context));
}
@@ -1944,7 +1944,7 @@ struct ChainContextFormat1
const ChainRuleSet &rule_set = this+ruleSet[index];
struct ChainContextApplyLookupContext lookup_context = {
{match_glyph},
- {NULL, NULL, NULL}
+ {nullptr, nullptr, nullptr}
};
return_trace (rule_set.apply (c, lookup_context));
}
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-jstf-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-jstf-table.hh
index c3068491bec..adbaad64f39 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-jstf-table.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-jstf-table.hh
@@ -124,7 +124,7 @@ struct JstfPriority
struct JstfLangSys : OffsetListOf<JstfPriority>
{
inline bool sanitize (hb_sanitize_context_t *c,
- const Record<JstfLangSys>::sanitize_closure_t * = NULL) const
+ const Record<JstfLangSys>::sanitize_closure_t * = nullptr) const
{
TRACE_SANITIZE (this);
return_trace (OffsetListOf<JstfPriority>::sanitize (c));
@@ -165,7 +165,7 @@ struct JstfScript
inline const JstfLangSys& get_default_lang_sys (void) const { return this+defaultLangSys; }
inline bool sanitize (hb_sanitize_context_t *c,
- const Record<JstfScript>::sanitize_closure_t * = NULL) const
+ const Record<JstfScript>::sanitize_closure_t * = nullptr) const
{
TRACE_SANITIZE (this);
return_trace (extenderGlyphs.sanitize (c, this) &&
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-private.hh
index 6717adeb930..460028a61b0 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-private.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-private.hh
@@ -33,7 +33,7 @@
#include "hb-font-private.hh"
#include "hb-buffer-private.hh"
-#include "hb-set-private.hh"
+#include "hb-set-digest-private.hh"
#include "hb-open-type-private.hh"
@@ -226,7 +226,9 @@ _next_syllable (hb_buffer_t *buffer, unsigned int start)
* - General_Category: 5 bits.
* - A bit each for:
* * Is it Default_Ignorable(); we have a modified Default_Ignorable().
- * * Whether it's one of the three Mongolian Free Variation Selectors.
+ * * Whether it's one of the three Mongolian Free Variation Selectors,
+ * CGJ, or other characters that are hidden but should not be ignored
+ * like most other Default_Ignorable()s do during matching.
* * One free bit right now.
*
* The high-byte has different meanings, switched by the Gen-Cat:
@@ -264,20 +266,21 @@ _hb_glyph_info_set_unicode_props (hb_glyph_info_t *info, hb_buffer_t *buffer)
buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_DEFAULT_IGNORABLES;
props |= UPROPS_MASK_IGNORABLE;
if (u == 0x200Cu) props |= UPROPS_MASK_Cf_ZWNJ;
- if (u == 0x200Du) props |= UPROPS_MASK_Cf_ZWJ;
+ else if (u == 0x200Du) props |= UPROPS_MASK_Cf_ZWJ;
/* Mongolian Free Variation Selectors need to be remembered
* because although we need to hide them like default-ignorables,
* they need to non-ignorable during shaping. This is similar to
* what we do for joiners in Indic-like shapers, but since the
* FVSes are GC=Mn, we have use a separate bit to remember them.
* Fixes:
- * https://github.com/behdad/harfbuzz/issues/234
- */
- if (unlikely (hb_in_range (u, 0x180Bu, 0x180Du))) props |= UPROPS_MASK_HIDDEN;
+ * https://github.com/behdad/harfbuzz/issues/234 */
+ else if (unlikely (hb_in_range (u, 0x180Bu, 0x180Du))) props |= UPROPS_MASK_HIDDEN;
/* TAG characters need similar treatment. Fixes:
- * https://github.com/behdad/harfbuzz/issues/463
- */
- if (unlikely (hb_in_range (u, 0xE0020u, 0xE007Fu))) props |= UPROPS_MASK_HIDDEN;
+ * https://github.com/behdad/harfbuzz/issues/463 */
+ else if (unlikely (hb_in_range (u, 0xE0020u, 0xE007Fu))) props |= UPROPS_MASK_HIDDEN;
+ /* COMBINING GRAPHEME JOINER should not be skipped; at least some times.
+ * https://github.com/behdad/harfbuzz/issues/554 */
+ else if (unlikely (u == 0x034Fu)) props |= UPROPS_MASK_HIDDEN;
}
else if (unlikely (HB_UNICODE_GENERAL_CATEGORY_IS_NON_ENCLOSING_MARK_OR_MODIFIER_SYMBOL (gen_cat)))
{
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 977e5830150..71e782686c7 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
@@ -44,7 +44,7 @@ _hb_ot_layout_create (hb_face_t *face)
{
hb_ot_layout_t *layout = (hb_ot_layout_t *) calloc (1, sizeof (hb_ot_layout_t));
if (unlikely (!layout))
- return NULL;
+ return nullptr;
layout->gdef_blob = OT::Sanitizer<OT::GDEF>::sanitize (face->reference_table (HB_OT_TAG_GDEF));
layout->gdef = OT::Sanitizer<OT::GDEF>::lock_instance (layout->gdef_blob);
@@ -176,7 +176,7 @@ _hb_ot_layout_create (hb_face_t *face)
(layout->gpos_lookup_count && !layout->gpos_accels)))
{
_hb_ot_layout_destroy (layout);
- return NULL;
+ return nullptr;
}
for (unsigned int i = 0; i < layout->gsub_lookup_count; i++)
@@ -321,7 +321,7 @@ hb_ot_layout_table_find_script (hb_face_t *face,
hb_tag_t script_tag,
unsigned int *script_index)
{
- ASSERT_STATIC (OT::Index::NOT_FOUND_INDEX == HB_OT_LAYOUT_NO_SCRIPT_INDEX);
+ static_assert ((OT::Index::NOT_FOUND_INDEX == HB_OT_LAYOUT_NO_SCRIPT_INDEX), "");
const OT::GSUBGPOS &g = get_gsubgpos_table (face, table_tag);
if (g.find_script_index (script_tag, script_index))
@@ -352,7 +352,7 @@ hb_ot_layout_table_choose_script (hb_face_t *face,
unsigned int *script_index,
hb_tag_t *chosen_script)
{
- ASSERT_STATIC (OT::Index::NOT_FOUND_INDEX == HB_OT_LAYOUT_NO_SCRIPT_INDEX);
+ static_assert ((OT::Index::NOT_FOUND_INDEX == HB_OT_LAYOUT_NO_SCRIPT_INDEX), "");
const OT::GSUBGPOS &g = get_gsubgpos_table (face, table_tag);
while (*script_tags)
@@ -411,7 +411,7 @@ hb_ot_layout_table_find_feature (hb_face_t *face,
hb_tag_t feature_tag,
unsigned int *feature_index)
{
- ASSERT_STATIC (OT::Index::NOT_FOUND_INDEX == HB_OT_LAYOUT_NO_FEATURE_INDEX);
+ static_assert ((OT::Index::NOT_FOUND_INDEX == HB_OT_LAYOUT_NO_FEATURE_INDEX), "");
const OT::GSUBGPOS &g = get_gsubgpos_table (face, table_tag);
unsigned int num_features = g.get_feature_count ();
@@ -448,7 +448,7 @@ hb_ot_layout_script_find_language (hb_face_t *face,
hb_tag_t language_tag,
unsigned int *language_index)
{
- ASSERT_STATIC (OT::Index::NOT_FOUND_INDEX == HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX);
+ static_assert ((OT::Index::NOT_FOUND_INDEX == HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX), "");
const OT::Script &s = get_gsubgpos_table (face, table_tag).get_script (script_index);
if (s.find_lang_sys_index (language_tag, language_index))
@@ -474,7 +474,7 @@ hb_ot_layout_language_get_required_feature_index (hb_face_t *face,
script_index,
language_index,
feature_index,
- NULL);
+ nullptr);
}
/**
@@ -527,7 +527,7 @@ hb_ot_layout_language_get_feature_tags (hb_face_t *face,
const OT::GSUBGPOS &g = get_gsubgpos_table (face, table_tag);
const OT::LangSys &l = g.get_script (script_index).get_lang_sys (language_index);
- ASSERT_STATIC (sizeof (unsigned int) == sizeof (hb_tag_t));
+ static_assert ((sizeof (unsigned int) == sizeof (hb_tag_t)), "");
unsigned int ret = l.get_feature_indexes (start_offset, feature_count, (unsigned int *) feature_tags);
if (feature_tags) {
@@ -548,7 +548,7 @@ hb_ot_layout_language_find_feature (hb_face_t *face,
hb_tag_t feature_tag,
unsigned int *feature_index)
{
- ASSERT_STATIC (OT::Index::NOT_FOUND_INDEX == HB_OT_LAYOUT_NO_FEATURE_INDEX);
+ static_assert ((OT::Index::NOT_FOUND_INDEX == HB_OT_LAYOUT_NO_FEATURE_INDEX), "");
const OT::GSUBGPOS &g = get_gsubgpos_table (face, table_tag);
const OT::LangSys &l = g.get_script (script_index).get_lang_sys (language_index);
@@ -652,7 +652,7 @@ _hb_ot_layout_collect_lookups_features (hb_face_t *face,
script_index,
language_index,
&required_feature_index,
- NULL))
+ nullptr))
_hb_ot_layout_collect_lookups_lookups (face,
table_tag,
required_feature_index,
@@ -721,7 +721,7 @@ _hb_ot_layout_collect_lookups_languages (hb_face_t *face,
unsigned int count = hb_ot_layout_script_get_language_tags (face,
table_tag,
script_index,
- 0, NULL, NULL);
+ 0, nullptr, nullptr);
for (unsigned int language_index = 0; language_index < count; language_index++)
_hb_ot_layout_collect_lookups_features (face,
table_tag,
@@ -768,7 +768,7 @@ hb_ot_layout_collect_lookups (hb_face_t *face,
/* All scripts */
unsigned int count = hb_ot_layout_table_get_script_tags (face,
table_tag,
- 0, NULL, NULL);
+ 0, nullptr, nullptr);
for (unsigned int script_index = 0; script_index < count; script_index++)
_hb_ot_layout_collect_lookups_languages (face,
table_tag,
@@ -805,10 +805,10 @@ void
hb_ot_layout_lookup_collect_glyphs (hb_face_t *face,
hb_tag_t table_tag,
unsigned int lookup_index,
- hb_set_t *glyphs_before, /* OUT. May be NULL */
- hb_set_t *glyphs_input, /* OUT. May be NULL */
- hb_set_t *glyphs_after, /* OUT. May be NULL */
- hb_set_t *glyphs_output /* OUT. May be NULL */)
+ hb_set_t *glyphs_before, /* OUT. May be nullptr */
+ hb_set_t *glyphs_input, /* OUT. May be nullptr */
+ hb_set_t *glyphs_after, /* OUT. May be nullptr */
+ hb_set_t *glyphs_output /* OUT. May be nullptr */)
{
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return;
@@ -859,7 +859,7 @@ hb_ot_layout_feature_with_variations_get_lookups (hb_face_t *face,
unsigned int *lookup_count /* IN/OUT */,
unsigned int *lookup_indexes /* OUT */)
{
- ASSERT_STATIC (OT::FeatureVariations::NOT_FOUND_INDEX == HB_OT_LAYOUT_NO_VARIATIONS_INDEX);
+ static_assert ((OT::FeatureVariations::NOT_FOUND_INDEX == HB_OT_LAYOUT_NO_VARIATIONS_INDEX), "");
const OT::GSUBGPOS &g = get_gsubgpos_table (face, table_tag);
const OT::Feature &f = g.get_feature_variation (feature_index, variations_index);
@@ -967,11 +967,11 @@ hb_ot_layout_position_finish_offsets (hb_font_t *font, hb_buffer_t *buffer)
**/
hb_bool_t
hb_ot_layout_get_size_params (hb_face_t *face,
- unsigned int *design_size, /* OUT. May be NULL */
- unsigned int *subfamily_id, /* OUT. May be NULL */
- unsigned int *subfamily_name_id, /* OUT. May be NULL */
- unsigned int *range_start, /* OUT. May be NULL */
- unsigned int *range_end /* OUT. May be NULL */)
+ unsigned int *design_size, /* OUT. May be nullptr */
+ unsigned int *subfamily_id, /* OUT. May be nullptr */
+ unsigned int *subfamily_name_id, /* OUT. May be nullptr */
+ unsigned int *range_start, /* OUT. May be nullptr */
+ unsigned int *range_end /* OUT. May be nullptr */)
{
const OT::GPOS &gpos = _get_gpos (face);
const hb_tag_t tag = HB_TAG ('s','i','z','e');
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-map-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-map-private.hh
index 6f774dde02f..105909a1fdb 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-map-private.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-map-private.hh
@@ -53,8 +53,8 @@ struct hb_ot_map_t
unsigned int auto_zwnj : 1;
unsigned int auto_zwj : 1;
- static int cmp (const feature_map_t *a, const feature_map_t *b)
- { return a->tag < b->tag ? -1 : a->tag > b->tag ? 1 : 0; }
+ inline int cmp (const hb_tag_t *tag_) const
+ { return *tag_ < tag ? -1 : *tag_ > tag ? 1 : 0; }
};
struct lookup_map_t {
@@ -79,7 +79,7 @@ struct hb_ot_map_t
inline hb_mask_t get_global_mask (void) const { return global_mask; }
- inline hb_mask_t get_mask (hb_tag_t feature_tag, unsigned int *shift = NULL) const {
+ inline hb_mask_t get_mask (hb_tag_t feature_tag, unsigned int *shift = nullptr) const {
const feature_map_t *map = features.bsearch (&feature_tag);
if (shift) *shift = map ? map->shift : 0;
return map ? map->mask : 0;
@@ -108,14 +108,14 @@ struct hb_ot_map_t
inline void get_stage_lookups (unsigned int table_index, unsigned int stage,
const struct lookup_map_t **plookups, unsigned int *lookup_count) const {
if (unlikely (stage == (unsigned int) -1)) {
- *plookups = NULL;
+ *plookups = nullptr;
*lookup_count = 0;
return;
}
assert (stage <= stages[table_index].len);
unsigned int start = stage ? stages[table_index][stage - 1].last_lookup : 0;
unsigned int end = stage < stages[table_index].len ? stages[table_index][stage].last_lookup : lookups[table_index].len;
- *plookups = end == start ? NULL : &lookups[table_index][start];
+ *plookups = end == start ? nullptr : &lookups[table_index][start];
*lookup_count = end - start;
}
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-map.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-map.cc
index 5764a110478..ea9bde9a662 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-map.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-map.cc
@@ -138,7 +138,7 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m,
const int *coords,
unsigned int num_coords)
{
- ASSERT_STATIC (!(HB_GLYPH_FLAG_DEFINED & (HB_GLYPH_FLAG_DEFINED + 1)));
+ static_assert ((!(HB_GLYPH_FLAG_DEFINED & (HB_GLYPH_FLAG_DEFINED + 1))), "");
unsigned int global_bit_mask = HB_GLYPH_FLAG_DEFINED + 1;
unsigned int global_bit_shift = _hb_popcount32 (HB_GLYPH_FLAG_DEFINED);
@@ -269,8 +269,8 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m,
feature_infos.shrink (0); /* Done with these */
- add_gsub_pause (NULL);
- add_gpos_pause (NULL);
+ add_gsub_pause (nullptr);
+ add_gpos_pause (nullptr);
for (unsigned int table_index = 0; table_index < 2; table_index++)
{
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-math-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-math-table.hh
index 191d79e98a0..b3c8571bcbe 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-math-table.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-math-table.hh
@@ -50,7 +50,7 @@ struct MathValueRecord
protected:
SHORT value; /* The X or Y value in design units */
OffsetTo<Device> deviceTable; /* Offset to the device table - from the
- * beginning of parent table. May be NULL.
+ * beginning of parent table. May be nullptr.
* Suggested format for device table is 1. */
public:
@@ -319,7 +319,7 @@ struct MathKernInfoRecord
protected:
/* Offset to MathKern table for each corner -
- * from the beginning of MathKernInfo table. May be NULL. */
+ * from the beginning of MathKernInfo table. May be nullptr. */
OffsetTo<MathKern> mathKern[4];
public:
@@ -402,7 +402,7 @@ struct MathGlyphInfo
* from the beginning of MathGlyphInfo table. When the left or right glyph of
* a box is an extended shape variant, the (ink) box (and not the default
* position defined by values in MathConstants table) should be used for
- * vertical positioning purposes. May be NULL.. */
+ * vertical positioning purposes. May be nullptr.. */
OffsetTo<Coverage> extendedShapeCoverage;
/* Offset to MathKernInfo table -
@@ -463,8 +463,8 @@ struct MathGlyphPartRecord
out.end_connector_length = font->em_scale (endConnectorLength, scale);
out.full_advance = font->em_scale (fullAdvance, scale);
- ASSERT_STATIC ((unsigned int) HB_MATH_GLYPH_PART_FLAG_EXTENDER ==
- (unsigned int) PartFlags::Extender);
+ static_assert ((unsigned int) HB_MATH_GLYPH_PART_FLAG_EXTENDER ==
+ (unsigned int) PartFlags::Extender, "");
out.flags = (hb_ot_math_glyph_part_flags_t)
(unsigned int)
@@ -571,7 +571,7 @@ struct MathGlyphConstruction
protected:
/* Offset to MathGlyphAssembly table for this shape - from the beginning of
- MathGlyphConstruction table. May be NULL. */
+ MathGlyphConstruction table. May be nullptr. */
OffsetTo<MathGlyphAssembly> glyphAssembly;
/* MathGlyphVariantRecords for alternative variants of the glyphs. */
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-arabic-fallback.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-arabic-fallback.hh
index d97d2852105..b7638b7be6a 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-arabic-fallback.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-arabic-fallback.hh
@@ -73,7 +73,7 @@ arabic_fallback_synthesize_lookup_single (const hb_ot_shape_plan_t *plan HB_UNUS
}
if (!num_glyphs)
- return NULL;
+ return nullptr;
/* Bubble-sort or something equally good!
* May not be good-enough for presidential candidate interviews, but good-enough for us... */
@@ -94,7 +94,7 @@ arabic_fallback_synthesize_lookup_single (const hb_ot_shape_plan_t *plan HB_UNUS
c.end_serialize ();
/* TODO sanitize the results? */
- return ret ? c.copy<OT::SubstLookup> () : NULL;
+ return ret ? c.copy<OT::SubstLookup> () : nullptr;
}
static OT::SubstLookup *
@@ -153,7 +153,7 @@ arabic_fallback_synthesize_lookup_ligature (const hb_ot_shape_plan_t *plan HB_UN
}
if (!num_ligatures)
- return NULL;
+ return nullptr;
OT::Supplier<OT::GlyphID> first_glyphs_supplier (first_glyphs, num_first_glyphs);
OT::Supplier<unsigned int > ligature_per_first_glyph_count_supplier (ligature_per_first_glyph_count_list, num_first_glyphs);
@@ -177,7 +177,7 @@ arabic_fallback_synthesize_lookup_ligature (const hb_ot_shape_plan_t *plan HB_UN
c.end_serialize ();
/* TODO sanitize the results? */
- return ret ? c.copy<OT::SubstLookup> () : NULL;
+ return ret ? c.copy<OT::SubstLookup> () : nullptr;
}
static OT::SubstLookup *
@@ -237,8 +237,8 @@ arabic_fallback_plan_init_win1256 (arabic_fallback_plan_t *fallback_plan,
return false;
const Manifest &manifest = reinterpret_cast<const Manifest&> (arabic_win1256_gsub_lookups.manifest);
- ASSERT_STATIC (sizeof (arabic_win1256_gsub_lookups.manifestData) / sizeof (ManifestLookup)
- <= ARABIC_FALLBACK_MAX_LOOKUPS);
+ static_assert (sizeof (arabic_win1256_gsub_lookups.manifestData) / sizeof (ManifestLookup)
+ <= ARABIC_FALLBACK_MAX_LOOKUPS, "");
/* TODO sanitize the table? */
unsigned j = 0;
@@ -271,7 +271,7 @@ arabic_fallback_plan_init_unicode (arabic_fallback_plan_t *fallback_plan,
const hb_ot_shape_plan_t *plan,
hb_font_t *font)
{
- ASSERT_STATIC (ARRAY_LENGTH_CONST(arabic_fallback_features) <= ARABIC_FALLBACK_MAX_LOOKUPS);
+ static_assert ((ARRAY_LENGTH_CONST(arabic_fallback_features) <= ARABIC_FALLBACK_MAX_LOOKUPS), "");
unsigned int j = 0;
for (unsigned int i = 0; i < ARRAY_LENGTH(arabic_fallback_features) ; i++)
{
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-arabic.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-arabic.cc
index f7419611203..4a92d41095d 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-arabic.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-arabic.cc
@@ -41,7 +41,7 @@
/* See:
* https://github.com/behdad/harfbuzz/commit/6e6f82b6f3dde0fc6c3c7d991d9ec6cfff57823d#commitcomment-14248516 */
#define HB_ARABIC_GENERAL_CATEGORY_IS_WORD(gen_cat) \
- (FLAG_SAFE (gen_cat) & \
+ (FLAG_UNSAFE (gen_cat) & \
(FLAG (HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED) | \
FLAG (HB_UNICODE_GENERAL_CATEGORY_PRIVATE_USE) | \
/*FLAG (HB_UNICODE_GENERAL_CATEGORY_LOWERCASE_LETTER) |*/ \
@@ -90,7 +90,7 @@ static unsigned int get_joining_type (hb_codepoint_t u, hb_unicode_general_categ
if (likely (j_type != JOINING_TYPE_X))
return j_type;
- return (FLAG_SAFE(gen_cat) &
+ return (FLAG_UNSAFE(gen_cat) &
(FLAG(HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) |
FLAG(HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) |
FLAG(HB_UNICODE_GENERAL_CATEGORY_FORMAT))
@@ -212,13 +212,13 @@ collect_features_arabic (hb_ot_shape_planner_t *plan)
map->add_global_bool_feature (HB_TAG('c','c','m','p'));
map->add_global_bool_feature (HB_TAG('l','o','c','l'));
- map->add_gsub_pause (NULL);
+ map->add_gsub_pause (nullptr);
for (unsigned int i = 0; i < ARABIC_NUM_FEATURES; i++)
{
bool has_fallback = plan->props.script == HB_SCRIPT_ARABIC && !FEATURE_IS_SYRIAC (arabic_features[i]);
map->add_feature (arabic_features[i], 1, has_fallback ? F_HAS_FALLBACK : F_NONE);
- map->add_gsub_pause (NULL);
+ map->add_gsub_pause (nullptr);
}
map->add_feature (HB_TAG('r','l','i','g'), 1, F_GLOBAL|F_HAS_FALLBACK);
@@ -228,7 +228,7 @@ collect_features_arabic (hb_ot_shape_planner_t *plan)
/* No pause after rclt. See 98460779bae19e4d64d29461ff154b3527bf8420. */
map->add_global_bool_feature (HB_TAG('r','c','l','t'));
map->add_global_bool_feature (HB_TAG('c','a','l','t'));
- map->add_gsub_pause (NULL);
+ map->add_gsub_pause (nullptr);
/* The spec includes 'cswh'. Earlier versions of Windows
* used to enable this by default, but testing suggests
@@ -265,7 +265,7 @@ data_create_arabic (const hb_ot_shape_plan_t *plan)
{
arabic_shape_plan_t *arabic_plan = (arabic_shape_plan_t *) calloc (1, sizeof (arabic_shape_plan_t));
if (unlikely (!arabic_plan))
- return NULL;
+ return nullptr;
arabic_plan->do_fallback = plan->props.script == HB_SCRIPT_ARABIC;
arabic_plan->has_stch = !!plan->map.get_1_mask (HB_TAG ('s','t','c','h'));
@@ -412,7 +412,7 @@ retry:
{
/* This sucks. We need a font to build the fallback plan... */
fallback_plan = arabic_fallback_plan_create (plan, font);
- if (unlikely (!hb_atomic_ptr_cmpexch (&(const_cast<arabic_shape_plan_t *> (arabic_plan))->fallback_plan, NULL, fallback_plan))) {
+ if (unlikely (!hb_atomic_ptr_cmpexch (&(const_cast<arabic_shape_plan_t *> (arabic_plan))->fallback_plan, nullptr, fallback_plan))) {
arabic_fallback_plan_destroy (fallback_plan);
goto retry;
}
@@ -532,11 +532,11 @@ apply_stch (const hb_ot_shape_plan_t *plan,
}
i++; // Don't touch i again.
- DEBUG_MSG (ARABIC, NULL, "%s stretch at (%d,%d,%d)",
+ DEBUG_MSG (ARABIC, nullptr, "%s stretch at (%d,%d,%d)",
step == MEASURE ? "measuring" : "cutting", context, start, end);
- DEBUG_MSG (ARABIC, NULL, "rest of word: count=%d width %d", start - context, w_total);
- DEBUG_MSG (ARABIC, NULL, "fixed tiles: count=%d width=%d", n_fixed, w_fixed);
- DEBUG_MSG (ARABIC, NULL, "repeating tiles: count=%d width=%d", n_repeating, w_repeating);
+ DEBUG_MSG (ARABIC, nullptr, "rest of word: count=%d width %d", start - context, w_total);
+ DEBUG_MSG (ARABIC, nullptr, "fixed tiles: count=%d width=%d", n_fixed, w_fixed);
+ DEBUG_MSG (ARABIC, nullptr, "repeating tiles: count=%d width=%d", n_repeating, w_repeating);
/* Number of additional times to repeat each repeating tile. */
int n_copies = 0;
@@ -559,7 +559,7 @@ apply_stch (const hb_ot_shape_plan_t *plan,
if (step == MEASURE)
{
extra_glyphs_needed += n_copies * n_repeating;
- DEBUG_MSG (ARABIC, NULL, "will add extra %d copies of repeating tiles", n_copies);
+ DEBUG_MSG (ARABIC, nullptr, "will add extra %d copies of repeating tiles", n_copies);
}
else
{
@@ -572,7 +572,7 @@ apply_stch (const hb_ot_shape_plan_t *plan,
if (info[k - 1].arabic_shaping_action() == STCH_REPEATING)
repeat += n_copies;
- DEBUG_MSG (ARABIC, NULL, "appending %d copies of glyph %d; j=%d",
+ DEBUG_MSG (ARABIC, nullptr, "appending %d copies of glyph %d; j=%d",
repeat, info[k - 1].codepoint, j);
for (unsigned int n = 0; n < repeat; n++)
{
@@ -691,16 +691,16 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_arabic =
{
"arabic",
collect_features_arabic,
- NULL, /* override_features */
+ nullptr, /* override_features */
data_create_arabic,
data_destroy_arabic,
- NULL, /* preprocess_text */
+ nullptr, /* preprocess_text */
postprocess_glyphs_arabic,
HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
- NULL, /* decompose */
- NULL, /* compose */
+ nullptr, /* decompose */
+ nullptr, /* compose */
setup_masks_arabic,
- NULL, /* disable_otl */
+ nullptr, /* disable_otl */
reorder_marks_arabic,
HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
true, /* fallback_position */
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-default.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-default.cc
index 857980cfcbe..99b53a5a8e7 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-default.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-default.cc
@@ -30,18 +30,18 @@
const hb_ot_complex_shaper_t _hb_ot_complex_shaper_default =
{
"default",
- NULL, /* collect_features */
- NULL, /* override_features */
- NULL, /* data_create */
- NULL, /* data_destroy */
- NULL, /* preprocess_text */
- NULL, /* postprocess_glyphs */
+ nullptr, /* collect_features */
+ nullptr, /* override_features */
+ nullptr, /* data_create */
+ nullptr, /* data_destroy */
+ nullptr, /* preprocess_text */
+ nullptr, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
- NULL, /* decompose */
- NULL, /* compose */
- NULL, /* setup_masks */
- NULL, /* disable_otl */
- NULL, /* reorder_marks */
+ nullptr, /* decompose */
+ nullptr, /* compose */
+ nullptr, /* setup_masks */
+ nullptr, /* disable_otl */
+ nullptr, /* reorder_marks */
HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
true, /* fallback_position */
};
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-hangul.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-hangul.cc
index 63850d36ac8..0f3337ff04e 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-hangul.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-hangul.cc
@@ -80,7 +80,7 @@ data_create_hangul (const hb_ot_shape_plan_t *plan)
{
hangul_shape_plan_t *hangul_plan = (hangul_shape_plan_t *) calloc (1, sizeof (hangul_shape_plan_t));
if (unlikely (!hangul_plan))
- return NULL;
+ return nullptr;
for (unsigned int i = 0; i < HANGUL_FEATURE_COUNT; i++)
hangul_plan->mask_array[i] = plan->map.get_1_mask (hangul_features[i]);
@@ -420,13 +420,13 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_hangul =
data_create_hangul,
data_destroy_hangul,
preprocess_text_hangul,
- NULL, /* postprocess_glyphs */
+ nullptr, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_NONE,
- NULL, /* decompose */
- NULL, /* compose */
+ nullptr, /* decompose */
+ nullptr, /* compose */
setup_masks_hangul,
- NULL, /* disable_otl */
- NULL, /* reorder_marks */
+ nullptr, /* disable_otl */
+ nullptr, /* reorder_marks */
HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE,
false, /* fallback_position */
};
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-hebrew.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-hebrew.cc
index b8ddadc1e29..fccd76a4505 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-hebrew.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-hebrew.cc
@@ -170,18 +170,18 @@ disable_otl_hebrew (const hb_ot_shape_plan_t *plan)
const hb_ot_complex_shaper_t _hb_ot_complex_shaper_hebrew =
{
"hebrew",
- NULL, /* collect_features */
- NULL, /* override_features */
- NULL, /* data_create */
- NULL, /* data_destroy */
- NULL, /* preprocess_text */
- NULL, /* postprocess_glyphs */
+ nullptr, /* collect_features */
+ nullptr, /* override_features */
+ nullptr, /* data_create */
+ nullptr, /* data_destroy */
+ nullptr, /* preprocess_text */
+ nullptr, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
- NULL, /* decompose */
+ nullptr, /* decompose */
compose_hebrew,
- NULL, /* setup_masks */
+ nullptr, /* setup_masks */
disable_otl_hebrew,
- NULL, /* reorder_marks */
+ nullptr, /* reorder_marks */
HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
true, /* fallback_position */
};
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-indic.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-indic.cc
index 051db22fcbe..05a51369299 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-indic.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-indic.cc
@@ -142,7 +142,7 @@ is_one_of (const hb_glyph_info_t &info, unsigned int flags)
{
/* If it ligated, all bets are off. */
if (_hb_glyph_info_ligated (&info)) return false;
- return !!(FLAG_SAFE (info.indic_category()) & flags);
+ return !!(FLAG_UNSAFE (info.indic_category()) & flags);
}
static inline bool
@@ -198,7 +198,7 @@ set_indic_properties (hb_glyph_info_t &info)
0x1CEEu, 0x1CF1u)))
{
cat = OT_Symbol;
- ASSERT_STATIC ((int) INDIC_SYLLABIC_CATEGORY_AVAGRAHA == OT_Symbol);
+ static_assert (((int) INDIC_SYLLABIC_CATEGORY_AVAGRAHA == OT_Symbol), "");
}
else if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x17CDu, 0x17D1u) ||
u == 0x17CBu || u == 0x17D3u || u == 0x17DDu)) /* Khmer Various signs */
@@ -233,7 +233,7 @@ set_indic_properties (hb_glyph_info_t &info)
* Re-assign position.
*/
- if ((FLAG_SAFE (cat) & CONSONANT_FLAGS))
+ if ((FLAG_UNSAFE (cat) & CONSONANT_FLAGS))
{
pos = POS_BASE_C;
if (is_ra (u))
@@ -243,7 +243,7 @@ set_indic_properties (hb_glyph_info_t &info)
{
pos = matra_position (u, pos);
}
- else if ((FLAG_SAFE (cat) & (FLAG (OT_SM) | FLAG (OT_VD) | FLAG (OT_A) | FLAG (OT_Symbol))))
+ else if ((FLAG_UNSAFE (cat) & (FLAG (OT_SM) | FLAG (OT_VD) | FLAG (OT_A) | FLAG (OT_Symbol))))
{
pos = POS_SMVD;
}
@@ -435,7 +435,7 @@ collect_features_indic (hb_ot_shape_planner_t *plan)
map->add_gsub_pause (initial_reordering);
for (; i < INDIC_BASIC_FEATURES; i++) {
map->add_feature (indic_features[i].tag, 1, indic_features[i].flags | F_MANUAL_ZWJ | F_MANUAL_ZWNJ);
- map->add_gsub_pause (NULL);
+ map->add_gsub_pause (nullptr);
}
map->add_gsub_pause (final_reordering);
for (; i < INDIC_NUM_FEATURES; i++) {
@@ -533,7 +533,7 @@ data_create_indic (const hb_ot_shape_plan_t *plan)
{
indic_shape_plan_t *indic_plan = (indic_shape_plan_t *) calloc (1, sizeof (indic_shape_plan_t));
if (unlikely (!indic_plan))
- return NULL;
+ return nullptr;
indic_plan->config = &indic_configs[0];
for (unsigned int i = 1; i < ARRAY_LENGTH (indic_configs); i++)
@@ -968,7 +968,7 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
indic_position_t last_pos = POS_START;
for (unsigned int i = start; i < end; i++)
{
- if ((FLAG_SAFE (info[i].indic_category()) & (JOINER_FLAGS | FLAG (OT_N) | FLAG (OT_RS) | MEDIAL_FLAGS | HALANT_OR_COENG_FLAGS)))
+ if ((FLAG_UNSAFE (info[i].indic_category()) & (JOINER_FLAGS | FLAG (OT_N) | FLAG (OT_RS) | MEDIAL_FLAGS | HALANT_OR_COENG_FLAGS)))
{
info[i].indic_position() = last_pos;
if (unlikely (info[i].indic_category() == OT_H &&
@@ -1538,7 +1538,7 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan,
{
new_reph_pos = base;
while (new_reph_pos + 1 < end &&
- !( FLAG_SAFE (info[new_reph_pos + 1].indic_position()) & (FLAG (POS_POST_C) | FLAG (POS_AFTER_POST) | FLAG (POS_SMVD))))
+ !( FLAG_UNSAFE (info[new_reph_pos + 1].indic_position()) & (FLAG (POS_POST_C) | FLAG (POS_AFTER_POST) | FLAG (POS_SMVD))))
new_reph_pos++;
if (new_reph_pos < end)
goto reph_move;
@@ -1688,7 +1688,7 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan,
/* Apply 'init' to the Left Matra if it's a word start. */
if (info[start].indic_position () == POS_PRE_M &&
(!start ||
- !(FLAG_SAFE (_hb_glyph_info_get_general_category (&info[start - 1])) &
+ !(FLAG_UNSAFE (_hb_glyph_info_get_general_category (&info[start - 1])) &
FLAG_RANGE (HB_UNICODE_GENERAL_CATEGORY_FORMAT, HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK))))
info[start].mask |= indic_plan->mask_array[INIT];
@@ -1848,14 +1848,14 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_indic =
override_features_indic,
data_create_indic,
data_destroy_indic,
- NULL, /* preprocess_text */
- NULL, /* postprocess_glyphs */
+ nullptr, /* preprocess_text */
+ nullptr, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT,
decompose_indic,
compose_indic,
setup_masks_indic,
- NULL, /* disable_otl */
- NULL, /* reorder_marks */
+ nullptr, /* disable_otl */
+ nullptr, /* reorder_marks */
HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE,
false, /* fallback_position */
};
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-myanmar.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-myanmar.cc
index 4081ed03de5..f446fe625bb 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-myanmar.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-myanmar.cc
@@ -103,7 +103,7 @@ collect_features_myanmar (hb_ot_shape_planner_t *plan)
for (unsigned int i = 0; i < ARRAY_LENGTH (basic_features); i++)
{
map->add_feature (basic_features[i], 1, F_GLOBAL | F_MANUAL_ZWJ);
- map->add_gsub_pause (NULL);
+ map->add_gsub_pause (nullptr);
}
map->add_gsub_pause (final_reordering);
for (unsigned int i = 0; i < ARRAY_LENGTH (other_features); i++)
@@ -154,7 +154,7 @@ is_one_of (const hb_glyph_info_t &info, unsigned int flags)
{
/* If it ligated, all bets are off. */
if (_hb_glyph_info_ligated (&info)) return false;
- return !!(FLAG_SAFE (info.myanmar_category()) & flags);
+ return !!(FLAG_UNSAFE (info.myanmar_category()) & flags);
}
static inline bool
@@ -513,18 +513,18 @@ final_reordering (const hb_ot_shape_plan_t *plan,
const hb_ot_complex_shaper_t _hb_ot_complex_shaper_myanmar_old =
{
"default",
- NULL, /* collect_features */
- NULL, /* override_features */
- NULL, /* data_create */
- NULL, /* data_destroy */
- NULL, /* preprocess_text */
- NULL, /* postprocess_glyphs */
+ nullptr, /* collect_features */
+ nullptr, /* override_features */
+ nullptr, /* data_create */
+ nullptr, /* data_destroy */
+ nullptr, /* preprocess_text */
+ nullptr, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
- NULL, /* decompose */
- NULL, /* compose */
- NULL, /* setup_masks */
- NULL, /* disable_otl */
- NULL, /* reorder_marks */
+ nullptr, /* decompose */
+ nullptr, /* compose */
+ nullptr, /* setup_masks */
+ nullptr, /* disable_otl */
+ nullptr, /* reorder_marks */
HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
true, /* fallback_position */
};
@@ -534,16 +534,16 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_myanmar =
"myanmar",
collect_features_myanmar,
override_features_myanmar,
- NULL, /* data_create */
- NULL, /* data_destroy */
- NULL, /* preprocess_text */
- NULL, /* postprocess_glyphs */
+ nullptr, /* data_create */
+ nullptr, /* data_destroy */
+ nullptr, /* preprocess_text */
+ nullptr, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT,
- NULL, /* decompose */
- NULL, /* compose */
+ nullptr, /* decompose */
+ nullptr, /* compose */
setup_masks_myanmar,
- NULL, /* disable_otl */
- NULL, /* reorder_marks */
+ nullptr, /* disable_otl */
+ nullptr, /* reorder_marks */
HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY,
false, /* fallback_position */
};
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-private.hh
index 9792067110b..4951cb5f11a 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-private.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-private.hh
@@ -70,7 +70,7 @@ struct hb_ot_complex_shaper_t
/* collect_features()
* Called during shape_plan().
* Shapers should use plan->map to add their features and callbacks.
- * May be NULL.
+ * May be nullptr.
*/
void (*collect_features) (hb_ot_shape_planner_t *plan);
@@ -78,7 +78,7 @@ struct hb_ot_complex_shaper_t
* Called during shape_plan().
* Shapers should use plan->map to override features and add callbacks after
* common features are added.
- * May be NULL.
+ * May be nullptr.
*/
void (*override_features) (hb_ot_shape_planner_t *plan);
@@ -86,15 +86,15 @@ struct hb_ot_complex_shaper_t
/* data_create()
* Called at the end of shape_plan().
* Whatever shapers return will be accessible through plan->data later.
- * If NULL is returned, means a plan failure.
+ * If nullptr is returned, means a plan failure.
*/
void *(*data_create) (const hb_ot_shape_plan_t *plan);
/* data_destroy()
* Called when the shape_plan is being destroyed.
* plan->data is passed here for destruction.
- * If NULL is returned, means a plan failure.
- * May be NULL.
+ * If nullptr is returned, means a plan failure.
+ * May be nullptr.
*/
void (*data_destroy) (void *data);
@@ -102,7 +102,7 @@ struct hb_ot_complex_shaper_t
/* preprocess_text()
* Called during shape().
* Shapers can use to modify text before shaping starts.
- * May be NULL.
+ * May be nullptr.
*/
void (*preprocess_text) (const hb_ot_shape_plan_t *plan,
hb_buffer_t *buffer,
@@ -111,7 +111,7 @@ struct hb_ot_complex_shaper_t
/* postprocess_glyphs()
* Called during shape().
* Shapers can use to modify glyphs after shaping ends.
- * May be NULL.
+ * May be nullptr.
*/
void (*postprocess_glyphs) (const hb_ot_shape_plan_t *plan,
hb_buffer_t *buffer,
@@ -122,7 +122,7 @@ struct hb_ot_complex_shaper_t
/* decompose()
* Called during shape()'s normalization.
- * May be NULL.
+ * May be nullptr.
*/
bool (*decompose) (const hb_ot_shape_normalize_context_t *c,
hb_codepoint_t ab,
@@ -131,7 +131,7 @@ struct hb_ot_complex_shaper_t
/* compose()
* Called during shape()'s normalization.
- * May be NULL.
+ * May be nullptr.
*/
bool (*compose) (const hb_ot_shape_normalize_context_t *c,
hb_codepoint_t a,
@@ -142,7 +142,7 @@ struct hb_ot_complex_shaper_t
* Called during shape().
* Shapers should use map to get feature masks and set on buffer.
* Shapers may NOT modify characters.
- * May be NULL.
+ * May be nullptr.
*/
void (*setup_masks) (const hb_ot_shape_plan_t *plan,
hb_buffer_t *buffer,
@@ -152,14 +152,14 @@ struct hb_ot_complex_shaper_t
* Called during shape().
* If set and returns true, GDEF/GSUB/GPOS of the font are ignored
* and fallback operations used.
- * May be NULL.
+ * May be nullptr.
*/
bool (*disable_otl) (const hb_ot_shape_plan_t *plan);
/* reorder_marks()
* Called during shape().
* Shapers can use to modify ordering of combining marks.
- * May be NULL.
+ * May be nullptr.
*/
void (*reorder_marks) (const hb_ot_shape_plan_t *plan,
hb_buffer_t *buffer,
@@ -286,7 +286,7 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner)
planner->map.script_index[0],
planner->map.language_index[0],
HB_TAG ('p','r','e','f'),
- NULL))
+ nullptr))
return &_hb_ot_complex_shaper_indic;
else
return &_hb_ot_complex_shaper_default;
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-thai.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-thai.cc
index 651c47f8f51..58a0a41e312 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-thai.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-thai.cc
@@ -97,7 +97,7 @@ thai_pua_shape (hb_codepoint_t u, thai_action_t action, hb_font_t *font)
hb_codepoint_t u;
hb_codepoint_t win_pua;
hb_codepoint_t mac_pua;
- } const *pua_mappings = NULL;
+ } const *pua_mappings = nullptr;
static const thai_pua_mapping_t SD_mappings[] = {
{0x0E48u, 0xF70Au, 0xF88Bu}, /* MAI EK */
{0x0E49u, 0xF70Bu, 0xF88Eu}, /* MAI THO */
@@ -367,18 +367,18 @@ preprocess_text_thai (const hb_ot_shape_plan_t *plan,
const hb_ot_complex_shaper_t _hb_ot_complex_shaper_thai =
{
"thai",
- NULL, /* collect_features */
- NULL, /* override_features */
- NULL, /* data_create */
- NULL, /* data_destroy */
+ nullptr, /* collect_features */
+ nullptr, /* override_features */
+ nullptr, /* data_create */
+ nullptr, /* data_destroy */
preprocess_text_thai,
- NULL, /* postprocess_glyphs */
+ nullptr, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
- NULL, /* decompose */
- NULL, /* compose */
- NULL, /* setup_masks */
- NULL, /* disable_otl */
- NULL, /* reorder_marks */
+ nullptr, /* decompose */
+ nullptr, /* compose */
+ nullptr, /* setup_masks */
+ nullptr, /* disable_otl */
+ nullptr, /* reorder_marks */
HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
false,/* fallback_position */
};
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-tibetan.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-tibetan.cc
index a85ac0f4b86..e87f1a4e3cc 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-tibetan.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-tibetan.cc
@@ -48,17 +48,17 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_tibetan =
{
"default",
collect_features_tibetan,
- NULL, /* override_features */
- NULL, /* data_create */
- NULL, /* data_destroy */
- NULL, /* preprocess_text */
- NULL, /* postprocess_glyphs */
+ nullptr, /* override_features */
+ nullptr, /* data_create */
+ nullptr, /* data_destroy */
+ nullptr, /* preprocess_text */
+ nullptr, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
- NULL, /* decompose */
- NULL, /* compose */
- NULL, /* setup_masks */
- NULL, /* disable_otl */
- NULL, /* reorder_marks */
+ nullptr, /* decompose */
+ nullptr, /* compose */
+ nullptr, /* setup_masks */
+ nullptr, /* disable_otl */
+ nullptr, /* reorder_marks */
HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
true, /* fallback_position */
};
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-use.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-use.cc
index ac3a2486737..a2cacac59af 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-use.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-use.cc
@@ -144,7 +144,7 @@ collect_features_use (hb_ot_shape_planner_t *plan)
/* "Topographical features" */
for (unsigned int i = 0; i < ARRAY_LENGTH (arabic_features); i++)
map->add_feature (arabic_features[i], 1, F_NONE);
- map->add_gsub_pause (NULL);
+ map->add_gsub_pause (nullptr);
/* "Standard typographic presentation" and "Positional feature application" */
for (unsigned int i = 0; i < ARRAY_LENGTH (other_features); i++)
@@ -199,7 +199,7 @@ data_create_use (const hb_ot_shape_plan_t *plan)
{
use_shape_plan_t *use_plan = (use_shape_plan_t *) calloc (1, sizeof (use_shape_plan_t));
if (unlikely (!use_plan))
- return NULL;
+ return nullptr;
use_plan->rphf_mask = plan->map.get_1_mask (HB_TAG('r','p','h','f'));
@@ -209,7 +209,7 @@ data_create_use (const hb_ot_shape_plan_t *plan)
if (unlikely (!use_plan->arabic_plan))
{
free (use_plan);
- return NULL;
+ return nullptr;
}
}
@@ -292,7 +292,7 @@ setup_topographical_masks (const hb_ot_shape_plan_t *plan,
if (use_plan->arabic_plan)
return;
- ASSERT_STATIC (INIT < 4 && ISOL < 4 && MEDI < 4 && FINA < 4);
+ static_assert ((INIT < 4 && ISOL < 4 && MEDI < 4 && FINA < 4), "");
hb_mask_t masks[4], all_masks = 0;
for (unsigned int i = 0; i < 4; i++)
{
@@ -424,7 +424,7 @@ reorder_syllable (hb_buffer_t *buffer, unsigned int start, unsigned int end)
{
syllable_type_t syllable_type = (syllable_type_t) (buffer->info[start].syllable() & 0x0F);
/* Only a few syllable types need reordering. */
- if (unlikely (!(FLAG_SAFE (syllable_type) &
+ if (unlikely (!(FLAG_UNSAFE (syllable_type) &
(FLAG (virama_terminated_cluster) |
FLAG (standard_cluster) |
FLAG (broken_cluster) |
@@ -597,17 +597,17 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_use =
{
"use",
collect_features_use,
- NULL, /* override_features */
+ nullptr, /* override_features */
data_create_use,
data_destroy_use,
- NULL, /* preprocess_text */
- NULL, /* postprocess_glyphs */
+ nullptr, /* preprocess_text */
+ nullptr, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT,
decompose_use,
compose_use,
setup_masks_use,
- NULL, /* disable_otl */
- NULL, /* reorder_marks */
+ nullptr, /* disable_otl */
+ nullptr, /* reorder_marks */
HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY,
false, /* fallback_position */
};
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-private.hh
index 594e54c026a..d0fe9e6a900 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-private.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-private.hh
@@ -73,7 +73,7 @@ struct hb_ot_shape_planner_t
hb_ot_shape_planner_t (const hb_shape_plan_t *master_plan) :
face (master_plan->face_unsafe),
props (master_plan->props),
- shaper (NULL),
+ shaper (nullptr),
map (face, &props) {}
~hb_ot_shape_planner_t (void) { map.finish (); }
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 8fc9d464f51..9d1d6f74846 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
@@ -70,7 +70,7 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner,
hb_ot_map_builder_t *map = &planner->map;
map->add_global_bool_feature (HB_TAG('r','v','r','n'));
- map->add_gsub_pause (NULL);
+ map->add_gsub_pause (nullptr);
switch (props->direction) {
case HB_DIRECTION_LTR:
@@ -176,7 +176,7 @@ _hb_ot_shaper_shape_plan_data_create (hb_shape_plan_t *shape_plan,
{
hb_ot_shape_plan_t *plan = (hb_ot_shape_plan_t *) calloc (1, sizeof (hb_ot_shape_plan_t));
if (unlikely (!plan))
- return NULL;
+ return nullptr;
hb_ot_shape_planner_t planner (shape_plan);
@@ -190,7 +190,7 @@ _hb_ot_shaper_shape_plan_data_create (hb_shape_plan_t *shape_plan,
if (plan->shaper->data_create) {
plan->data = plan->shaper->data_create (plan);
if (unlikely (!plan->data))
- return NULL;
+ return nullptr;
}
return plan;
@@ -928,7 +928,7 @@ hb_ot_shape_glyphs_closure (hb_font_t *font,
{
hb_ot_shape_plan_t plan;
- const char *shapers[] = {"ot", NULL};
+ const char *shapers[] = {"ot", nullptr};
hb_shape_plan_t *shape_plan = hb_shape_plan_create_cached (font->face, &buffer->props,
features, num_features, shapers);
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 59b7d6a6df9..64c6ce0a4c6 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
@@ -1020,7 +1020,7 @@ hb_ot_tag_to_language (hb_tag_t tag)
unsigned int i;
if (tag == HB_OT_TAG_DEFAULT_LANGUAGE)
- return NULL;
+ return nullptr;
/* struct LangTag has only room for 3-letter language tags. */
switch (tag) {
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 691196d9bb6..90ba0bd02c6 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
@@ -130,7 +130,7 @@ hb_ot_var_normalize_variations (hb_face_t *face,
for (unsigned int i = 0; i < variations_length; i++)
{
unsigned int axis_index;
- if (hb_ot_var_find_axis (face, variations[i].tag, &axis_index, NULL) &&
+ if (hb_ot_var_find_axis (face, variations[i].tag, &axis_index, nullptr) &&
axis_index < coords_length)
coords[axis_index] = fvar.normalize_axis_value (axis_index, variations[i].value);
}
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-private.hh
index b5dccc556b4..3d617e2a595 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-private.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-private.hh
@@ -74,6 +74,39 @@ extern "C" void hb_free_impl(void *ptr);
/* Compiler attributes */
+#if __cplusplus < 201103L
+
+// Null pointer literal
+// Source: SC22/WG21/N2431 = J16/07-0301
+// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf
+
+const // this is a const object...
+class {
+public:
+ template<class T> // convertible to any type
+ operator T*() const { // of null non-member
+ return 0; // pointer...
+ }
+ template<class C, class T> // or any type of null
+ operator T C::*() const { // member pointer...
+ return 0;
+ }
+private:
+ void operator&() const; // whose address can't be taken
+} _hb_nullptr = {}; // and whose name is nullptr
+#define nullptr _hb_nullptr
+
+// Static assertions
+#ifndef static_assert
+#define _PASTE1(a,b) a##b
+#define _PASTE(a,b) _PASTE1(a,b)
+#define static_assert(e, msg) \
+ HB_UNUSED typedef int _PASTE(static_assertion_failed_at_line_, __LINE__) [(e) ? 1 : -1]
+#endif // static_assert
+
+#endif // __cplusplus < 201103L
+
+
#if (defined(__GNUC__) || defined(__clang__)) && defined(__OPTIMIZE__)
#define likely(expr) (__builtin_expect (!!(expr), 1))
#define unlikely(expr) (__builtin_expect (!!(expr), 0))
@@ -168,13 +201,13 @@ extern "C" void hb_free_impl(void *ptr);
# if defined(_WIN32_WCE)
/* Some things not defined on Windows CE. */
# define vsnprintf _vsnprintf
-# define getenv(Name) NULL
+# define getenv(Name) nullptr
# if _WIN32_WCE < 0x800
# define setlocale(Category, Locale) "C"
static int errno = 0; /* Use something better? */
# endif
# elif defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP)
-# define getenv(Name) NULL
+# define getenv(Name) nullptr
# endif
# if defined(_MSC_VER) && _MSC_VER < 1900
# define snprintf _snprintf
@@ -209,11 +242,6 @@ static int errno = 0; /* Use something better? */
/* Basics */
-
-#ifndef NULL
-# define NULL ((void *) 0)
-#endif
-
#undef MIN
template <typename Type>
static inline Type MIN (const Type &a, const Type &b) { return a < b ? a : b; }
@@ -235,32 +263,26 @@ static inline unsigned int ARRAY_LENGTH (const Type (&)[n]) { return n; }
#define HB_STMT_START do
#define HB_STMT_END while (0)
-#define _ASSERT_STATIC1(_line, _cond) HB_UNUSED typedef int _static_assert_on_line_##_line##_failed[(_cond)?1:-1]
-#define _ASSERT_STATIC0(_line, _cond) _ASSERT_STATIC1 (_line, (_cond))
-#define ASSERT_STATIC(_cond) _ASSERT_STATIC0 (__LINE__, (_cond))
-
-template <unsigned int cond> class hb_assert_constant_t {};
+template <unsigned int cond> class hb_assert_constant_t;
+template <> class hb_assert_constant_t<1> {};
#define ASSERT_STATIC_EXPR_ZERO(_cond) (0 * (unsigned int) sizeof (hb_assert_constant_t<_cond>))
-#define _PASTE1(a,b) a##b
-#define PASTE(a,b) _PASTE1(a,b)
-
/* Lets assert int types. Saves trouble down the road. */
-ASSERT_STATIC (sizeof (int8_t) == 1);
-ASSERT_STATIC (sizeof (uint8_t) == 1);
-ASSERT_STATIC (sizeof (int16_t) == 2);
-ASSERT_STATIC (sizeof (uint16_t) == 2);
-ASSERT_STATIC (sizeof (int32_t) == 4);
-ASSERT_STATIC (sizeof (uint32_t) == 4);
-ASSERT_STATIC (sizeof (int64_t) == 8);
-ASSERT_STATIC (sizeof (uint64_t) == 8);
+static_assert ((sizeof (int8_t) == 1), "");
+static_assert ((sizeof (uint8_t) == 1), "");
+static_assert ((sizeof (int16_t) == 2), "");
+static_assert ((sizeof (uint16_t) == 2), "");
+static_assert ((sizeof (int32_t) == 4), "");
+static_assert ((sizeof (uint32_t) == 4), "");
+static_assert ((sizeof (int64_t) == 8), "");
+static_assert ((sizeof (uint64_t) == 8), "");
-ASSERT_STATIC (sizeof (hb_codepoint_t) == 4);
-ASSERT_STATIC (sizeof (hb_position_t) == 4);
-ASSERT_STATIC (sizeof (hb_mask_t) == 4);
-ASSERT_STATIC (sizeof (hb_var_int_t) == 4);
+static_assert ((sizeof (hb_codepoint_t) == 4), "");
+static_assert ((sizeof (hb_position_t) == 4), "");
+static_assert ((sizeof (hb_mask_t) == 4), "");
+static_assert ((sizeof (hb_var_int_t) == 4), "");
/* We like our types POD */
@@ -295,7 +317,7 @@ ASSERT_STATIC (sizeof (hb_var_int_t) == 4);
/* Void! */
struct _hb_void_t {};
typedef const _hb_void_t *hb_void_t;
-#define HB_VOID ((const _hb_void_t *) NULL)
+#define HB_VOID ((const _hb_void_t *) nullptr)
/* Return the number of 1 bits in mask. */
static inline HB_CONST_FUNC unsigned int
@@ -311,6 +333,18 @@ _hb_popcount32 (uint32_t mask)
return (((y + (y >> 3)) & 030707070707) % 077);
#endif
}
+static inline HB_CONST_FUNC unsigned int
+_hb_popcount64 (uint64_t mask)
+{
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+ if (sizeof (long) >= sizeof (mask))
+ return __builtin_popcountl (mask);
+#endif
+ return _hb_popcount32 (mask) + _hb_popcount32 (mask >> 32);
+}
+template <typename T> static inline unsigned int _hb_popcount (T mask);
+template <> inline unsigned int _hb_popcount<uint32_t> (uint32_t mask) { return _hb_popcount32 (mask); }
+template <> inline unsigned int _hb_popcount<uint64_t> (uint64_t mask) { return _hb_popcount64 (mask); }
/* Returns the number of bits needed to store number */
static inline HB_CONST_FUNC unsigned int
@@ -361,7 +395,7 @@ typedef int (*hb_compare_func_t) (const void *, const void *);
/* arrays and maps */
-#define HB_PREALLOCED_ARRAY_INIT {0, 0, NULL}
+#define HB_PREALLOCED_ARRAY_INIT {0, 0, nullptr}
template <typename Type, unsigned int StaticSize=16>
struct hb_prealloced_array_t
{
@@ -370,41 +404,56 @@ struct hb_prealloced_array_t
Type *array;
Type static_array[StaticSize];
- void init (void) { memset (this, 0, sizeof (*this)); }
+ void init (void)
+ {
+ len = 0;
+ allocated = ARRAY_LENGTH (static_array);
+ array = static_array;
+ }
inline Type& operator [] (unsigned int i) { return array[i]; }
inline const Type& operator [] (unsigned int i) const { return array[i]; }
inline Type *push (void)
{
- if (!array) {
- array = static_array;
- allocated = ARRAY_LENGTH (static_array);
- }
- if (likely (len < allocated))
- return &array[len++];
+ if (unlikely (!resize (len + 1)))
+ return nullptr;
- /* Need to reallocate */
- unsigned int new_allocated = allocated + (allocated >> 1) + 8;
- Type *new_array = NULL;
+ return &array[len - 1];
+ }
- if (array == static_array) {
- new_array = (Type *) calloc (new_allocated, sizeof (Type));
- if (new_array)
- memcpy (new_array, array, len * sizeof (Type));
- } else {
- bool overflows = (new_allocated < allocated) || _hb_unsigned_int_mul_overflows (new_allocated, sizeof (Type));
- if (likely (!overflows)) {
- new_array = (Type *) realloc (array, new_allocated * sizeof (Type));
+ inline bool resize (unsigned int size)
+ {
+ if (unlikely (size > allocated))
+ {
+ /* Need to reallocate */
+
+ unsigned int new_allocated = allocated;
+ while (size >= new_allocated)
+ new_allocated += (new_allocated >> 1) + 8;
+
+ Type *new_array = nullptr;
+
+ if (array == static_array) {
+ new_array = (Type *) calloc (new_allocated, sizeof (Type));
+ if (new_array)
+ memcpy (new_array, array, len * sizeof (Type));
+ } else {
+ bool overflows = (new_allocated < allocated) || _hb_unsigned_int_mul_overflows (new_allocated, sizeof (Type));
+ if (likely (!overflows)) {
+ new_array = (Type *) realloc (array, new_allocated * sizeof (Type));
+ }
}
- }
- if (unlikely (!new_array))
- return NULL;
+ if (unlikely (!new_array))
+ return false;
+
+ array = new_array;
+ allocated = new_allocated;
+ }
- array = new_array;
- allocated = new_allocated;
- return &array[len++];
+ len = size;
+ return true;
}
inline void pop (void)
@@ -433,14 +482,14 @@ struct hb_prealloced_array_t
for (unsigned int i = 0; i < len; i++)
if (array[i] == v)
return &array[i];
- return NULL;
+ return nullptr;
}
template <typename T>
inline const Type *find (T v) const {
for (unsigned int i = 0; i < len; i++)
if (array[i] == v)
return &array[i];
- return NULL;
+ return nullptr;
}
inline void qsort (void)
@@ -454,21 +503,46 @@ struct hb_prealloced_array_t
}
template <typename T>
- inline Type *bsearch (T *key)
+ inline Type *bsearch (T *x)
{
- return (Type *) ::bsearch (key, array, len, sizeof (Type), (hb_compare_func_t) Type::cmp);
+ unsigned int i;
+ return bfind (x, &i) ? &array[i] : nullptr;
}
template <typename T>
- inline const Type *bsearch (T *key) const
+ inline const Type *bsearch (T *x) const
{
- return (const Type *) ::bsearch (key, array, len, sizeof (Type), (hb_compare_func_t) Type::cmp);
+ unsigned int i;
+ return bfind (x, &i) ? &array[i] : nullptr;
+ }
+ template <typename T>
+ inline bool bfind (T *x, unsigned int *i) const
+ {
+ int min = 0, max = (int) this->len - 1;
+ while (min <= max)
+ {
+ int mid = (min + max) / 2;
+ int c = this->array[mid].cmp (x);
+ if (c < 0)
+ max = mid - 1;
+ else if (c > 0)
+ min = mid + 1;
+ else
+ {
+ *i = mid;
+ return true;
+ }
+ }
+ if (max < 0 || (max < (int) this->len && this->array[max].cmp (x) > 0))
+ max++;
+ *i = max;
+ return false;
}
inline void finish (void)
{
if (array != static_array)
free (array);
- array = NULL;
+ array = nullptr;
allocated = len = 0;
}
};
@@ -502,7 +576,7 @@ struct hb_lockable_set_t
old.finish ();
}
else {
- item = NULL;
+ item = nullptr;
l.unlock ();
}
} else {
@@ -765,8 +839,8 @@ _hb_debug_msg<0> (const char *what HB_UNUSED,
const char *message HB_UNUSED,
...) {}
-#define DEBUG_MSG_LEVEL(WHAT, OBJ, LEVEL, LEVEL_DIR, ...) _hb_debug_msg<HB_DEBUG_##WHAT> (#WHAT, (OBJ), NULL, true, (LEVEL), (LEVEL_DIR), __VA_ARGS__)
-#define DEBUG_MSG(WHAT, OBJ, ...) _hb_debug_msg<HB_DEBUG_##WHAT> (#WHAT, (OBJ), NULL, false, 0, 0, __VA_ARGS__)
+#define DEBUG_MSG_LEVEL(WHAT, OBJ, LEVEL, LEVEL_DIR, ...) _hb_debug_msg<HB_DEBUG_##WHAT> (#WHAT, (OBJ), nullptr, true, (LEVEL), (LEVEL_DIR), __VA_ARGS__)
+#define DEBUG_MSG(WHAT, OBJ, ...) _hb_debug_msg<HB_DEBUG_##WHAT> (#WHAT, (OBJ), nullptr, false, 0, 0, __VA_ARGS__)
#define DEBUG_MSG_FUNC(WHAT, OBJ, ...) _hb_debug_msg<HB_DEBUG_##WHAT> (#WHAT, (OBJ), HB_FUNC, false, 0, 0, __VA_ARGS__)
@@ -825,7 +899,7 @@ struct hb_auto_trace_t {
{
_hb_warn_no_return<ret_t> (returned);
if (!returned) {
- _hb_debug_msg<max_level> (what, obj, NULL, true, plevel ? *plevel : 1, -1, " ");
+ _hb_debug_msg<max_level> (what, obj, nullptr, true, plevel ? *plevel : 1, -1, " ");
}
if (plevel) --*plevel;
}
@@ -837,11 +911,11 @@ struct hb_auto_trace_t {
return v;
}
- _hb_debug_msg<max_level> (what, obj, NULL, true, plevel ? *plevel : 1, -1,
+ _hb_debug_msg<max_level> (what, obj, nullptr, true, plevel ? *plevel : 1, -1,
"return %s (line %d)",
hb_printer_t<ret_t>().print (v), line);
if (plevel) --*plevel;
- plevel = NULL;
+ plevel = nullptr;
returned = true;
return v;
}
@@ -882,7 +956,7 @@ hb_in_range (T u, T lo, T hi)
* one right now. Declaring a variable won't work as HB_UNUSED
* is unusable on some platforms and unused types are less likely
* to generate a warning than unused variables. */
- ASSERT_STATIC (sizeof (hb_assert_unsigned_t<T>) >= 0);
+ static_assert ((sizeof (hb_assert_unsigned_t<T>) >= 0), "");
/* The casts below are important as if T is smaller than int,
* the subtract results will become a signed int! */
@@ -927,11 +1001,10 @@ hb_in_ranges (T u, T lo1, T hi1, T lo2, T hi2, T lo3, T hi3)
/* Useful for set-operations on small enums.
* For example, for testing "x ∈ {x1, x2, x3}" use:
- * (FLAG_SAFE(x) & (FLAG(x1) | FLAG(x2) | FLAG(x3)))
+ * (FLAG_UNSAFE(x) & (FLAG(x1) | FLAG(x2) | FLAG(x3)))
*/
-#define FLAG(x) (ASSERT_STATIC_EXPR_ZERO ((x) < 32) + (1U << (x)))
-#define FLAG_SAFE(x) (1U << (x))
-#define FLAG_UNSAFE(x) ((x) < 32 ? FLAG_SAFE(x) : 0)
+#define FLAG(x) (ASSERT_STATIC_EXPR_ZERO ((unsigned int)(x) < 32) + (1U << (unsigned int)(x)))
+#define FLAG_UNSAFE(x) ((unsigned int)(x) < 32 ? (1U << (unsigned int)(x)) : 0)
#define FLAG_RANGE(x,y) (ASSERT_STATIC_EXPR_ZERO ((x) < (y)) + FLAG(y+1) - FLAG(x))
@@ -963,7 +1036,7 @@ hb_stable_sort (T *array, unsigned int len, int(*compar)(const T *, const T *),
template <typename T> static inline void
hb_stable_sort (T *array, unsigned int len, int(*compar)(const T *, const T *))
{
- hb_stable_sort (array, len, compar, (int *) NULL);
+ hb_stable_sort (array, len, compar, (int *) nullptr);
}
static inline hb_bool_t
@@ -985,6 +1058,73 @@ hb_codepoint_parse (const char *s, unsigned int len, int base, hb_codepoint_t *o
}
+/* Vectorization */
+
+struct HbOpOr
+{
+ static const bool passthru_left = true;
+ static const bool passthru_right = true;
+ template <typename T> static void process (T &o, const T &a, const T &b) { o = a | b; }
+};
+struct HbOpAnd
+{
+ static const bool passthru_left = false;
+ static const bool passthru_right = false;
+ template <typename T> static void process (T &o, const T &a, const T &b) { o = a & b; }
+};
+struct HbOpMinus
+{
+ static const bool passthru_left = true;
+ static const bool passthru_right = false;
+ template <typename T> static void process (T &o, const T &a, const T &b) { o = a & ~b; }
+};
+struct HbOpXor
+{
+ static const bool passthru_left = true;
+ static const bool passthru_right = true;
+ template <typename T> static void process (T &o, const T &a, const T &b) { o = a ^ b; }
+};
+
+/* Type behaving similar to vectorized vars defined using __attribute__((vector_size(...))). */
+template <typename elt_t, unsigned int byte_size>
+struct hb_vector_size_t
+{
+ elt_t& operator [] (unsigned int i) { return v[i]; }
+ const elt_t& operator [] (unsigned int i) const { return v[i]; }
+
+ template <class Op>
+ inline hb_vector_size_t process (const hb_vector_size_t &o) const
+ {
+ hb_vector_size_t r;
+ for (unsigned int i = 0; i < ARRAY_LENGTH (v); i++)
+ Op::process (r.v[i], v[i], o.v[i]);
+ return r;
+ }
+ inline hb_vector_size_t operator | (const hb_vector_size_t &o) const
+ { return process<HbOpOr> (o); }
+ inline hb_vector_size_t operator & (const hb_vector_size_t &o) const
+ { return process<HbOpAnd> (o); }
+ inline hb_vector_size_t operator ^ (const hb_vector_size_t &o) const
+ { return process<HbOpXor> (o); }
+ inline hb_vector_size_t operator ~ () const
+ {
+ hb_vector_size_t r;
+ for (unsigned int i = 0; i < ARRAY_LENGTH (v); i++)
+ r.v[i] = ~v[i];
+ return r;
+ }
+
+ private:
+ static_assert (byte_size / sizeof (elt_t) * sizeof (elt_t) == byte_size, "");
+ elt_t v[byte_size / sizeof (elt_t)];
+};
+
+/* The `vector_size' attribute was introduced in gcc 3.1. */
+#if defined( __GNUC__ ) && ( __GNUC__ >= 4 )
+#define HAVE_VECTOR_SIZE 1
+#endif
+
+
/* Global runtime options. */
struct hb_options_t
@@ -997,7 +1137,7 @@ union hb_options_union_t {
unsigned int i;
hb_options_t opts;
};
-ASSERT_STATIC (sizeof (int) == sizeof (hb_options_union_t));
+static_assert ((sizeof (int) == sizeof (hb_options_union_t)), "");
HB_INTERNAL void
_hb_options_init (void);
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set-digest-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set-digest-private.hh
new file mode 100644
index 00000000000..9135136c00a
--- /dev/null
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set-digest-private.hh
@@ -0,0 +1,144 @@
+/*
+ * Copyright © 2012 Google, Inc.
+ *
+ * This is part of HarfBuzz, a text shaping library.
+ *
+ * Permission is hereby granted, without written agreement and without
+ * license or royalty fees, to use, copy, modify, and distribute this
+ * software and its documentation for any purpose, provided that the
+ * above copyright notice and the following two paragraphs appear in
+ * all copies of this software.
+ *
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
+ * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
+ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * Google Author(s): Behdad Esfahbod
+ */
+
+#ifndef HB_SET_DIGEST_PRIVATE_HH
+#define HB_SET_DIGEST_PRIVATE_HH
+
+#include "hb-private.hh"
+
+/*
+ * The set digests here implement various "filters" that support
+ * "approximate member query". Conceptually these are like Bloom
+ * Filter and Quotient Filter, however, much smaller, faster, and
+ * designed to fit the requirements of our uses for glyph coverage
+ * queries.
+ *
+ * Our filters are highly accurate if the lookup covers fairly local
+ * set of glyphs, but fully flooded and ineffective if coverage is
+ * all over the place.
+ *
+ * The frozen-set can be used instead of a digest, to trade more
+ * memory for 100% accuracy, but in practice, that doesn't look like
+ * an attractive trade-off.
+ */
+
+template <typename mask_t, unsigned int shift>
+struct hb_set_digest_lowest_bits_t
+{
+ ASSERT_POD ();
+
+ static const unsigned int mask_bytes = sizeof (mask_t);
+ static const unsigned int mask_bits = sizeof (mask_t) * 8;
+ static const unsigned int num_bits = 0
+ + (mask_bytes >= 1 ? 3 : 0)
+ + (mask_bytes >= 2 ? 1 : 0)
+ + (mask_bytes >= 4 ? 1 : 0)
+ + (mask_bytes >= 8 ? 1 : 0)
+ + (mask_bytes >= 16? 1 : 0)
+ + 0;
+
+ static_assert ((shift < sizeof (hb_codepoint_t) * 8), "");
+ static_assert ((shift + num_bits <= sizeof (hb_codepoint_t) * 8), "");
+
+ inline void init (void) {
+ mask = 0;
+ }
+
+ inline void add (hb_codepoint_t g) {
+ mask |= mask_for (g);
+ }
+
+ inline void add_range (hb_codepoint_t a, hb_codepoint_t b) {
+ if ((b >> shift) - (a >> shift) >= mask_bits - 1)
+ mask = (mask_t) -1;
+ else {
+ mask_t ma = mask_for (a);
+ mask_t mb = mask_for (b);
+ mask |= mb + (mb - ma) - (mb < ma);
+ }
+ }
+
+ inline bool may_have (hb_codepoint_t g) const {
+ return !!(mask & mask_for (g));
+ }
+
+ private:
+
+ static inline mask_t mask_for (hb_codepoint_t g) {
+ return ((mask_t) 1) << ((g >> shift) & (mask_bits - 1));
+ }
+ mask_t mask;
+};
+
+template <typename head_t, typename tail_t>
+struct hb_set_digest_combiner_t
+{
+ ASSERT_POD ();
+
+ inline void init (void) {
+ head.init ();
+ tail.init ();
+ }
+
+ inline void add (hb_codepoint_t g) {
+ head.add (g);
+ tail.add (g);
+ }
+
+ inline void add_range (hb_codepoint_t a, hb_codepoint_t b) {
+ head.add_range (a, b);
+ tail.add_range (a, b);
+ }
+
+ inline bool may_have (hb_codepoint_t g) const {
+ return head.may_have (g) && tail.may_have (g);
+ }
+
+ private:
+ head_t head;
+ tail_t tail;
+};
+
+
+/*
+ * hb_set_digest_t
+ *
+ * This is a combination of digests that performs "best".
+ * There is not much science to this: it's a result of intuition
+ * and testing.
+ */
+typedef hb_set_digest_combiner_t
+<
+ hb_set_digest_lowest_bits_t<unsigned long, 4>,
+ hb_set_digest_combiner_t
+ <
+ hb_set_digest_lowest_bits_t<unsigned long, 0>,
+ hb_set_digest_lowest_bits_t<unsigned long, 9>
+ >
+> hb_set_digest_t;
+
+
+#endif /* HB_SET_DIGEST_PRIVATE_HH */
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set-private.hh
index e2010d76267..689766c130c 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set-private.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set-private.hh
@@ -1,5 +1,5 @@
/*
- * Copyright © 2012 Google, Inc.
+ * Copyright © 2012,2017 Google, Inc.
*
* This is part of HarfBuzz, a text shaping library.
*
@@ -32,157 +32,181 @@
/*
- * The set digests here implement various "filters" that support
- * "approximate member query". Conceptually these are like Bloom
- * Filter and Quotient Filter, however, much smaller, faster, and
- * designed to fit the requirements of our uses for glyph coverage
- * queries.
- *
- * Our filters are highly accurate if the lookup covers fairly local
- * set of glyphs, but fully flooded and ineffective if coverage is
- * all over the place.
- *
- * The frozen-set can be used instead of a digest, to trade more
- * memory for 100% accuracy, but in practice, that doesn't look like
- * an attractive trade-off.
+ * hb_set_t
*/
-template <typename mask_t, unsigned int shift>
-struct hb_set_digest_lowest_bits_t
+struct hb_set_t
{
- ASSERT_POD ();
-
- static const unsigned int mask_bytes = sizeof (mask_t);
- static const unsigned int mask_bits = sizeof (mask_t) * 8;
- static const unsigned int num_bits = 0
- + (mask_bytes >= 1 ? 3 : 0)
- + (mask_bytes >= 2 ? 1 : 0)
- + (mask_bytes >= 4 ? 1 : 0)
- + (mask_bytes >= 8 ? 1 : 0)
- + (mask_bytes >= 16? 1 : 0)
- + 0;
-
- ASSERT_STATIC (shift < sizeof (hb_codepoint_t) * 8);
- ASSERT_STATIC (shift + num_bits <= sizeof (hb_codepoint_t) * 8);
-
- inline void init (void) {
- mask = 0;
- }
+ struct page_map_t
+ {
+ inline int cmp (const page_map_t *o) const { return (int) o->major - (int) major; }
- inline void add (hb_codepoint_t g) {
- mask |= mask_for (g);
- }
+ uint32_t major;
+ uint32_t index;
+ };
- inline void add_range (hb_codepoint_t a, hb_codepoint_t b) {
- if ((b >> shift) - (a >> shift) >= mask_bits - 1)
- mask = (mask_t) -1;
- else {
- mask_t ma = mask_for (a);
- mask_t mb = mask_for (b);
- mask |= mb + (mb - ma) - (mb < ma);
+ struct page_t
+ {
+ inline void init (void) {
+ memset (&v, 0, sizeof (v));
}
- }
-
- inline bool may_have (hb_codepoint_t g) const {
- return !!(mask & mask_for (g));
- }
- private:
+ inline unsigned int len (void) const
+ { return ARRAY_LENGTH_CONST (v); }
- static inline mask_t mask_for (hb_codepoint_t g) {
- return ((mask_t) 1) << ((g >> shift) & (mask_bits - 1));
- }
- mask_t mask;
-};
-
-template <typename head_t, typename tail_t>
-struct hb_set_digest_combiner_t
-{
- ASSERT_POD ();
-
- inline void init (void) {
- head.init ();
- tail.init ();
- }
-
- inline void add (hb_codepoint_t g) {
- head.add (g);
- tail.add (g);
- }
+ inline bool is_empty (void) const
+ {
+ for (unsigned int i = 0; i < len (); i++)
+ if (v[i])
+ return false;
+ return true;
+ }
- inline void add_range (hb_codepoint_t a, hb_codepoint_t b) {
- head.add_range (a, b);
- tail.add_range (a, b);
- }
+ inline void add (hb_codepoint_t g) { elt (g) |= mask (g); }
+ inline void del (hb_codepoint_t g) { elt (g) &= ~mask (g); }
+ inline bool has (hb_codepoint_t g) const { return !!(elt (g) & mask (g)); }
- inline bool may_have (hb_codepoint_t g) const {
- return head.may_have (g) && tail.may_have (g);
- }
+ inline bool is_equal (const page_t *other) const
+ {
+ return 0 == memcmp (&v, &other->v, sizeof (v));
+ }
- private:
- head_t head;
- tail_t tail;
-};
+ inline unsigned int get_population (void) const
+ {
+ unsigned int pop = 0;
+ for (unsigned int i = 0; i < len (); i++)
+ pop += _hb_popcount (v[i]);
+ return pop;
+ }
+ inline bool next (hb_codepoint_t *codepoint) const
+ {
+ unsigned int m = (*codepoint + 1) & MASK;
+ if (!m)
+ {
+ *codepoint = INVALID;
+ return false;
+ }
+ unsigned int i = m / ELT_BITS;
+ unsigned int j = m & ELT_MASK;
+
+ for (; j < ELT_BITS; j++)
+ if (v[i] & (elt_t (1) << j))
+ goto found;
+ for (i++; i < len (); i++)
+ if (v[i])
+ for (unsigned int j = 0; j < ELT_BITS; j++)
+ if (v[i] & (elt_t (1) << j))
+ goto found;
+
+ *codepoint = INVALID;
+ return false;
-/*
- * hb_set_digest_t
- *
- * This is a combination of digests that performs "best".
- * There is not much science to this: it's a result of intuition
- * and testing.
- */
-typedef hb_set_digest_combiner_t
-<
- hb_set_digest_lowest_bits_t<unsigned long, 4>,
- hb_set_digest_combiner_t
- <
- hb_set_digest_lowest_bits_t<unsigned long, 0>,
- hb_set_digest_lowest_bits_t<unsigned long, 9>
- >
-> hb_set_digest_t;
+ found:
+ *codepoint = i * ELT_BITS + j;
+ return true;
+ }
+ inline hb_codepoint_t get_min (void) const
+ {
+ for (unsigned int i = 0; i < len (); i++)
+ if (v[i])
+ {
+ elt_t e = v[i];
+ for (unsigned int j = 0; j < ELT_BITS; j++)
+ if (e & (elt_t (1) << j))
+ return i * ELT_BITS + j;
+ }
+ return INVALID;
+ }
+ inline hb_codepoint_t get_max (void) const
+ {
+ for (int i = len () - 1; i >= 0; i--)
+ if (v[i])
+ {
+ elt_t e = v[i];
+ for (int j = ELT_BITS - 1; j >= 0; j--)
+ if (e & (elt_t (1) << j))
+ return i * ELT_BITS + j;
+ }
+ return 0;
+ }
+ static const unsigned int PAGE_BITS = 512; /* Use to tune. */
+ static_assert ((PAGE_BITS & ((PAGE_BITS) - 1)) == 0, "");
+ typedef uint64_t elt_t;
-/*
- * hb_set_t
- */
+#if 0 && HAVE_VECTOR_SIZE
+ /* The vectorized version does not work with clang as non-const
+ * elt() errs "non-const reference cannot bind to vector element". */
+ typedef elt_t vector_t __attribute__((vector_size (PAGE_BITS / 8)));
+#else
+ typedef hb_vector_size_t<elt_t, PAGE_BITS / 8> vector_t;
+#endif
+ vector_t v;
-/* TODO Make this faster and memmory efficient. */
+ static const unsigned int ELT_BITS = sizeof (elt_t) * 8;
+ static const unsigned int ELT_MASK = ELT_BITS - 1;
+ static const unsigned int BITS = sizeof (vector_t) * 8;
+ static const unsigned int MASK = BITS - 1;
+ static_assert (PAGE_BITS == BITS, "");
-struct hb_set_t
-{
- friend struct hb_frozen_set_t;
+ elt_t &elt (hb_codepoint_t g) { return v[(g & MASK) / ELT_BITS]; }
+ elt_t const &elt (hb_codepoint_t g) const { return v[(g & MASK) / ELT_BITS]; }
+ elt_t mask (hb_codepoint_t g) const { return elt_t (1) << (g & ELT_MASK); }
+ };
hb_object_header_t header;
ASSERT_POD ();
bool in_error;
+ hb_prealloced_array_t<page_map_t, 8> page_map;
+ hb_prealloced_array_t<page_t, 8> pages;
+
+ inline bool resize (unsigned int count)
+ {
+ if (unlikely (in_error)) return false;
+ if (!pages.resize (count) || !page_map.resize (count))
+ {
+ pages.resize (page_map.len);
+ in_error = true;
+ return false;
+ }
+ return true;
+ }
inline void init (void) {
hb_object_init (this);
- clear ();
+ page_map.init ();
+ pages.init ();
}
inline void fini (void) {
+ page_map.finish ();
+ pages.finish ();
}
inline void clear (void) {
if (unlikely (hb_object_is_inert (this)))
return;
in_error = false;
- memset (elts, 0, sizeof elts);
+ page_map.resize (0);
+ pages.resize (0);
}
inline bool is_empty (void) const {
- for (unsigned int i = 0; i < ARRAY_LENGTH (elts); i++)
- if (elts[i])
+ unsigned int count = pages.len;
+ for (unsigned int i = 0; i < count; i++)
+ if (!pages[i].is_empty ())
return false;
return true;
}
+
inline void add (hb_codepoint_t g)
{
if (unlikely (in_error)) return;
if (unlikely (g == INVALID)) return;
- if (unlikely (g > MAX_G)) return;
- elt (g) |= mask (g);
+ page_t *page = page_for_insert (g);
+ if (!page)
+ return;
+ page->add (g);
}
inline void add_range (hb_codepoint_t a, hb_codepoint_t b)
{
@@ -194,92 +218,178 @@ struct hb_set_t
inline void del (hb_codepoint_t g)
{
if (unlikely (in_error)) return;
- if (unlikely (g > MAX_G)) return;
- elt (g) &= ~mask (g);
+ page_t *p = page_for (g);
+ if (!p)
+ return;
+ p->del (g);
}
inline void del_range (hb_codepoint_t a, hb_codepoint_t b)
{
if (unlikely (in_error)) return;
- /* TODO Speedup */
for (unsigned int i = a; i < b + 1; i++)
del (i);
}
inline bool has (hb_codepoint_t g) const
{
- if (unlikely (g > MAX_G)) return false;
- return !!(elt (g) & mask (g));
+ const page_t *p = page_for (g);
+ if (!p)
+ return false;
+ return p->has (g);
}
inline bool intersects (hb_codepoint_t first,
hb_codepoint_t last) const
{
- if (unlikely (first > MAX_G)) return false;
- if (unlikely (last > MAX_G)) last = MAX_G;
- unsigned int end = last + 1;
- for (hb_codepoint_t i = first; i < end; i++)
- if (has (i))
- return true;
- return false;
+ hb_codepoint_t c = first - 1;
+ return next (&c) && c <= last;
+ }
+ inline void set (const hb_set_t *other)
+ {
+ if (unlikely (in_error)) return;
+ unsigned int count = other->pages.len;
+ if (!resize (count))
+ return;
+
+ memcpy (pages.array, other->pages.array, count * sizeof (pages.array[0]));
+ memcpy (page_map.array, other->page_map.array, count * sizeof (page_map.array[0]));
}
+
inline bool is_equal (const hb_set_t *other) const
{
- for (unsigned int i = 0; i < ELTS; i++)
- if (elts[i] != other->elts[i])
+ unsigned int na = pages.len;
+ unsigned int nb = other->pages.len;
+
+ unsigned int a = 0, b = 0;
+ for (; a < na && b < nb; )
+ {
+ if (page_at (a).is_empty ()) { a++; continue; }
+ if (other->page_at (b).is_empty ()) { b++; continue; }
+ if (page_map[a].major != other->page_map[b].major ||
+ !page_at (a).is_equal (&other->page_at (b)))
return false;
+ a++;
+ b++;
+ }
+ for (; a < na; a++)
+ if (!page_at (a).is_empty ()) { return false; }
+ for (; b < nb; b++)
+ if (!other->page_at (b).is_empty ()) { return false; }
+
return true;
}
- inline void set (const hb_set_t *other)
+
+ template <class Op>
+ inline void process (const hb_set_t *other)
{
if (unlikely (in_error)) return;
- for (unsigned int i = 0; i < ELTS; i++)
- elts[i] = other->elts[i];
+
+ int na = pages.len;
+ int nb = other->pages.len;
+
+ unsigned int count = 0;
+ int a = 0, b = 0;
+ for (; a < na && b < nb; )
+ {
+ if (page_map[a].major == other->page_map[b].major)
+ {
+ count++;
+ a++;
+ b++;
+ }
+ else if (page_map[a].major < other->page_map[b].major)
+ {
+ if (Op::passthru_left)
+ count++;
+ a++;
+ }
+ else
+ {
+ if (Op::passthru_right)
+ count++;
+ b++;
+ }
+ }
+ if (Op::passthru_left)
+ count += na - a;
+ if (Op::passthru_right)
+ count += nb - b;
+
+ if (!resize (count))
+ return;
+
+ /* Process in-place backward. */
+ a = na - 1, b = nb - 1;
+ for (; a >= 0 && b >= 0; )
+ {
+ if (page_map[a].major == other->page_map[b].major)
+ {
+ Op::process (page_at (--count).v, page_at (a).v, other->page_at (b).v);
+ a--;
+ b--;
+ }
+ else if (page_map[a].major > other->page_map[b].major)
+ {
+ if (Op::passthru_left)
+ page_at (--count).v = page_at (a).v;
+ a--;
+ }
+ else
+ {
+ if (Op::passthru_right)
+ page_at (--count).v = other->page_at (b).v;
+ b--;
+ }
+ }
+ while (a >= 0)
+ page_at (--count).v = page_at (--a).v;
+ while (b >= 0)
+ page_at (--count).v = other->page_at (--b).v;
+ assert (!count);
}
+
inline void union_ (const hb_set_t *other)
{
- if (unlikely (in_error)) return;
- for (unsigned int i = 0; i < ELTS; i++)
- elts[i] |= other->elts[i];
+ process<HbOpOr> (other);
}
inline void intersect (const hb_set_t *other)
{
- if (unlikely (in_error)) return;
- for (unsigned int i = 0; i < ELTS; i++)
- elts[i] &= other->elts[i];
+ process<HbOpAnd> (other);
}
inline void subtract (const hb_set_t *other)
{
- if (unlikely (in_error)) return;
- for (unsigned int i = 0; i < ELTS; i++)
- elts[i] &= ~other->elts[i];
+ process<HbOpMinus> (other);
}
inline void symmetric_difference (const hb_set_t *other)
{
- if (unlikely (in_error)) return;
- for (unsigned int i = 0; i < ELTS; i++)
- elts[i] ^= other->elts[i];
- }
- inline void invert (void)
- {
- if (unlikely (in_error)) return;
- for (unsigned int i = 0; i < ELTS; i++)
- elts[i] = ~elts[i];
+ process<HbOpXor> (other);
}
inline bool next (hb_codepoint_t *codepoint) const
{
if (unlikely (*codepoint == INVALID)) {
- hb_codepoint_t i = get_min ();
- if (i != INVALID) {
- *codepoint = i;
- return true;
- } else {
- *codepoint = INVALID;
- return false;
+ *codepoint = get_min ();
+ return *codepoint != INVALID;
+ }
+
+ page_map_t map = {major (*codepoint), 0};
+ unsigned int i;
+ page_map.bfind (&map, &i);
+ if (i < page_map.len)
+ {
+ if (pages[page_map[i].index].next (codepoint))
+ {
+ *codepoint += page_map[i].major * PAGE_SIZE;
+ return true;
}
+ i++;
}
- for (hb_codepoint_t i = *codepoint + 1; i < MAX_G + 1; i++)
- if (has (i)) {
- *codepoint = i;
+ for (; i < page_map.len; i++)
+ {
+ hb_codepoint_t m = pages[page_map[i].index].get_min ();
+ if (m != INVALID)
+ {
+ *codepoint = page_map[i].major * PAGE_SIZE + m;
return true;
}
+ }
*codepoint = INVALID;
return false;
}
@@ -303,99 +413,66 @@ struct hb_set_t
inline unsigned int get_population (void) const
{
- unsigned int count = 0;
- for (unsigned int i = 0; i < ELTS; i++)
- count += _hb_popcount32 (elts[i]);
- return count;
+ unsigned int pop = 0;
+ unsigned int count = pages.len;
+ for (unsigned int i = 0; i < count; i++)
+ pop += pages[i].get_population ();
+ return pop;
}
inline hb_codepoint_t get_min (void) const
{
- for (unsigned int i = 0; i < ELTS; i++)
- if (elts[i])
- for (unsigned int j = 0; j < BITS; j++)
- if (elts[i] & (1u << j))
- return i * BITS + j;
+ unsigned int count = pages.len;
+ for (unsigned int i = 0; i < count; i++)
+ if (!page_at (i).is_empty ())
+ return page_map[i].major * PAGE_SIZE + page_at (i).get_min ();
return INVALID;
}
inline hb_codepoint_t get_max (void) const
{
- for (unsigned int i = ELTS; i; i--)
- if (elts[i - 1])
- for (unsigned int j = BITS; j; j--)
- if (elts[i - 1] & (1u << (j - 1)))
- return (i - 1) * BITS + (j - 1);
+ unsigned int count = pages.len;
+ for (int i = count - 1; i >= 0; i++)
+ if (!page_at (i).is_empty ())
+ return page_map[i].major * PAGE_SIZE + page_at (i).get_max ();
return INVALID;
}
- typedef uint32_t elt_t;
- static const unsigned int MAX_G = 65536 - 1; /* XXX Fix this... */
- static const unsigned int SHIFT = 5;
- static const unsigned int BITS = (1 << SHIFT);
- static const unsigned int MASK = BITS - 1;
- static const unsigned int ELTS = (MAX_G + 1 + (BITS - 1)) / BITS;
+ static const unsigned int PAGE_SIZE = sizeof (page_t) * 8;
static const hb_codepoint_t INVALID = HB_SET_VALUE_INVALID;
- elt_t &elt (hb_codepoint_t g) { return elts[g >> SHIFT]; }
- elt_t const &elt (hb_codepoint_t g) const { return elts[g >> SHIFT]; }
- elt_t mask (hb_codepoint_t g) const { return elt_t (1) << (g & MASK); }
-
- elt_t elts[ELTS]; /* XXX 8kb */
-
- ASSERT_STATIC (sizeof (elt_t) * 8 == BITS);
- ASSERT_STATIC (sizeof (elt_t) * 8 * ELTS > MAX_G);
-};
-
-struct hb_frozen_set_t
-{
- static const unsigned int SHIFT = hb_set_t::SHIFT;
- static const unsigned int BITS = hb_set_t::BITS;
- static const unsigned int MASK = hb_set_t::MASK;
- typedef hb_set_t::elt_t elt_t;
-
- inline void init (const hb_set_t &set)
+ page_t *page_for_insert (hb_codepoint_t g)
{
- start = count = 0;
- elts = NULL;
-
- unsigned int max = set.get_max ();
- if (max == set.INVALID)
- return;
- unsigned int min = set.get_min ();
- const elt_t &min_elt = set.elt (min);
-
- start = min & ~MASK;
- count = max - start + 1;
- unsigned int num_elts = (count + BITS - 1) / BITS;
- unsigned int elts_size = num_elts * sizeof (elt_t);
- elts = (elt_t *) malloc (elts_size);
- if (unlikely (!elts))
+ page_map_t map = {major (g), pages.len};
+ unsigned int i;
+ if (!page_map.bfind (&map, &i))
{
- start = count = 0;
- return;
+ if (!resize (pages.len + 1))
+ return nullptr;
+
+ pages[map.index].init ();
+ memmove (&page_map[i + 1], &page_map[i], (page_map.len - 1 - i) * sizeof (page_map[0]));
+ page_map[i] = map;
}
- memcpy (elts, &min_elt, elts_size);
+ return &pages[page_map[i].index];
}
-
- inline void fini (void)
+ page_t *page_for (hb_codepoint_t g)
{
- if (elts)
- free (elts);
+ page_map_t key = {major (g)};
+ const page_map_t *found = page_map.bsearch (&key);
+ if (found)
+ return &pages[found->index];
+ return nullptr;
}
-
- inline bool has (hb_codepoint_t g) const
+ const page_t *page_for (hb_codepoint_t g) const
{
- /* hb_codepoint_t is unsigned. */
- g -= start;
- if (unlikely (g > count)) return false;
- return !!(elt (g) & mask (g));
- }
-
- elt_t const &elt (hb_codepoint_t g) const { return elts[g >> SHIFT]; }
- elt_t mask (hb_codepoint_t g) const { return elt_t (1) << (g & MASK); }
-
- private:
- hb_codepoint_t start, count;
- elt_t *elts;
+ page_map_t key = {major (g)};
+ const page_map_t *found = page_map.bsearch (&key);
+ if (found)
+ return &pages[found->index];
+ return nullptr;
+ }
+ page_t &page_at (unsigned int i) { return pages[page_map[i].index]; }
+ const page_t &page_at (unsigned int i) const { return pages[page_map[i].index]; }
+ unsigned int major (hb_codepoint_t g) const { return g / PAGE_SIZE; }
};
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set.cc
index f3fe1ba4335..d33e525de4a 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set.cc
@@ -376,11 +376,12 @@ hb_set_symmetric_difference (hb_set_t *set,
*
*
* Since: 0.9.10
+ *
+ * Deprecated: 1.6.1
**/
void
hb_set_invert (hb_set_t *set)
{
- set->invert ();
}
/**
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set.h b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set.h
index 2164c1a6549..2ce406073ce 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set.h
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set.h
@@ -126,9 +126,6 @@ HB_EXTERN void
hb_set_symmetric_difference (hb_set_t *set,
const hb_set_t *other);
-HB_EXTERN void
-hb_set_invert (hb_set_t *set);
-
HB_EXTERN unsigned int
hb_set_get_population (const hb_set_t *set);
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shape-plan.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shape-plan.cc
index 5573cd22441..e58f9ff80b1 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shape-plan.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shape-plan.cc
@@ -115,7 +115,7 @@ hb_shape_plan_create (hb_face_t *face,
{
return hb_shape_plan_create2 (face, props,
user_features, num_user_features,
- NULL, 0,
+ nullptr, 0,
shaper_list);
}
@@ -128,7 +128,7 @@ hb_shape_plan_create2 (hb_face_t *face,
unsigned int num_coords,
const char * const *shaper_list)
{
- DEBUG_MSG_FUNC (SHAPE_PLAN, NULL,
+ DEBUG_MSG_FUNC (SHAPE_PLAN, nullptr,
"face=%p num_features=%d num_coords=%d shaper_list=%p",
face,
num_user_features,
@@ -136,8 +136,8 @@ hb_shape_plan_create2 (hb_face_t *face,
shaper_list);
hb_shape_plan_t *shape_plan;
- hb_feature_t *features = NULL;
- int *coords = NULL;
+ hb_feature_t *features = nullptr;
+ int *coords = nullptr;
if (unlikely (!face))
face = hb_face_get_empty ();
@@ -196,16 +196,16 @@ hb_shape_plan_get_empty (void)
HB_OBJECT_HEADER_STATIC,
true, /* default_shaper_list */
- NULL, /* face */
+ nullptr, /* face */
HB_SEGMENT_PROPERTIES_DEFAULT, /* props */
- NULL, /* shaper_func */
- NULL, /* shaper_name */
+ nullptr, /* shaper_func */
+ nullptr, /* shaper_name */
- NULL, /* user_features */
+ nullptr, /* user_features */
0, /* num_user_featurs */
- NULL, /* coords */
+ nullptr, /* coords */
0, /* num_coords */
{
@@ -470,7 +470,7 @@ hb_shape_plan_create_cached (hb_face_t *face,
{
return hb_shape_plan_create_cached2 (face, props,
user_features, num_user_features,
- NULL, 0,
+ nullptr, 0,
shaper_list);
}
@@ -483,7 +483,7 @@ hb_shape_plan_create_cached2 (hb_face_t *face,
unsigned int num_coords,
const char * const *shaper_list)
{
- DEBUG_MSG_FUNC (SHAPE_PLAN, NULL,
+ DEBUG_MSG_FUNC (SHAPE_PLAN, nullptr,
"face=%p num_features=%d shaper_list=%p",
face,
num_user_features,
@@ -494,7 +494,7 @@ hb_shape_plan_create_cached2 (hb_face_t *face,
shaper_list,
user_features,
num_user_features,
- NULL
+ nullptr
};
if (shaper_list) {
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shape.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shape.cc
index f080a15e367..39355b337d6 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shape.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shape.cc
@@ -76,7 +76,7 @@ retry:
/* Not found; allocate one. */
shaper_list = (const char **) calloc (1 + HB_SHAPERS_COUNT, sizeof (const char *));
if (unlikely (!shaper_list)) {
- static const char *nil_shaper_list[] = {NULL};
+ static const char *nil_shaper_list[] = {nullptr};
return nil_shaper_list;
}
@@ -84,9 +84,9 @@ retry:
unsigned int i;
for (i = 0; i < HB_SHAPERS_COUNT; i++)
shaper_list[i] = shapers[i].name;
- shaper_list[i] = NULL;
+ shaper_list[i] = nullptr;
- if (!hb_atomic_ptr_cmpexch (&static_shaper_list, NULL, shaper_list)) {
+ if (!hb_atomic_ptr_cmpexch (&static_shaper_list, nullptr, shaper_list)) {
free (shaper_list);
goto retry;
}
@@ -157,5 +157,5 @@ hb_shape (hb_font_t *font,
const hb_feature_t *features,
unsigned int num_features)
{
- hb_shape_full (font, buffer, features, num_features, NULL);
+ hb_shape_full (font, buffer, features, num_features, nullptr);
}
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper-private.hh
index 2481ef8ac8f..ce2d9f28395 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper-private.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper-private.hh
@@ -100,7 +100,7 @@ HB_SHAPER_DATA_ENSURE_FUNC(shaper, object) (hb_##object##_t *object) \
/* Drop and recreate. */ \
/* If someone dropped it in the mean time, throw it away and don't touch it. \
* Otherwise, destruct it. */ \
- if (hb_atomic_ptr_cmpexch (&HB_SHAPER_DATA (shaper, object), data, NULL)) { \
+ if (hb_atomic_ptr_cmpexch (&HB_SHAPER_DATA (shaper, object), data, nullptr)) { \
HB_SHAPER_DATA_DESTROY_FUNC (shaper, object) (data); \
} \
goto retry; \
@@ -109,7 +109,7 @@ HB_SHAPER_DATA_ENSURE_FUNC(shaper, object) (hb_##object##_t *object) \
data = HB_SHAPER_DATA_CREATE_FUNC (shaper, object) (object); \
if (unlikely (!data)) \
data = (HB_SHAPER_DATA_TYPE (shaper, object) *) HB_SHAPER_DATA_INVALID; \
- if (!hb_atomic_ptr_cmpexch (&HB_SHAPER_DATA (shaper, object), NULL, data)) { \
+ if (!hb_atomic_ptr_cmpexch (&HB_SHAPER_DATA (shaper, object), nullptr, data)) { \
if (data && \
data != HB_SHAPER_DATA_INVALID && \
data != HB_SHAPER_DATA_SUCCEEDED) \
@@ -117,7 +117,7 @@ HB_SHAPER_DATA_ENSURE_FUNC(shaper, object) (hb_##object##_t *object) \
goto retry; \
} \
} \
- return data != NULL && !HB_SHAPER_DATA_IS_INVALID (data); \
+ return data != nullptr && !HB_SHAPER_DATA_IS_INVALID (data); \
}
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper.cc
index b25566d8a7c..2c44cf26533 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-shaper.cc
@@ -59,14 +59,14 @@ retry:
{
char *env = getenv ("HB_SHAPER_LIST");
if (!env || !*env) {
- (void) hb_atomic_ptr_cmpexch (&static_shapers, NULL, &all_shapers[0]);
+ (void) hb_atomic_ptr_cmpexch (&static_shapers, nullptr, &all_shapers[0]);
return (const hb_shaper_pair_t *) all_shapers;
}
/* Not found; allocate one. */
shapers = (hb_shaper_pair_t *) calloc (1, sizeof (all_shapers));
if (unlikely (!shapers)) {
- (void) hb_atomic_ptr_cmpexch (&static_shapers, NULL, &all_shapers[0]);
+ (void) hb_atomic_ptr_cmpexch (&static_shapers, nullptr, &all_shapers[0]);
return (const hb_shaper_pair_t *) all_shapers;
}
@@ -97,7 +97,7 @@ retry:
p = end + 1;
}
- if (!hb_atomic_ptr_cmpexch (&static_shapers, NULL, shapers)) {
+ if (!hb_atomic_ptr_cmpexch (&static_shapers, nullptr, shapers)) {
free (shapers);
goto retry;
}
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ucdn.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ucdn.cc
index d41cf5b9328..c237ee82545 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ucdn.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ucdn.cc
@@ -238,7 +238,7 @@ hb_ucdn_get_unicode_funcs (void)
static const hb_unicode_funcs_t _hb_ucdn_unicode_funcs = {
HB_OBJECT_HEADER_STATIC,
- NULL, /* parent */
+ nullptr, /* parent */
true, /* immutable */
{
#define HB_UNICODE_FUNC_IMPLEMENT(name) hb_ucdn_##name,
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode-private.hh
index 44a7471cf6e..ac17f283f85 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode-private.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode-private.hh
@@ -357,13 +357,13 @@ extern HB_INTERNAL const hb_unicode_funcs_t _hb_unicode_funcs_nil;
/* Misc */
#define HB_UNICODE_GENERAL_CATEGORY_IS_MARK(gen_cat) \
- (FLAG_SAFE (gen_cat) & \
+ (FLAG_UNSAFE (gen_cat) & \
(FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) | \
FLAG (HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) | \
FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)))
#define HB_UNICODE_GENERAL_CATEGORY_IS_NON_ENCLOSING_MARK_OR_MODIFIER_SYMBOL(gen_cat) \
- (FLAG_SAFE (gen_cat) & \
+ (FLAG_UNSAFE (gen_cat) & \
(FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) | \
FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) | \
FLAG (HB_UNICODE_GENERAL_CATEGORY_MODIFIER_SYMBOL)))
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode.cc
index d553a7172f0..726baeb0f19 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode.cc
@@ -188,7 +188,7 @@ hb_unicode_funcs_create (hb_unicode_funcs_t *parent)
const hb_unicode_funcs_t _hb_unicode_funcs_nil = {
HB_OBJECT_HEADER_STATIC,
- NULL, /* parent */
+ nullptr, /* parent */
true, /* immutable */
{
#define HB_UNICODE_FUNC_IMPLEMENT(name) hb_unicode_##name##_nil,
@@ -365,7 +365,7 @@ hb_unicode_funcs_set_##name##_func (hb_unicode_funcs_t *ufuncs, \
} else { \
ufuncs->func.name = ufuncs->parent->func.name; \
ufuncs->user_data.name = ufuncs->parent->user_data.name; \
- ufuncs->destroy.name = NULL; \
+ ufuncs->destroy.name = nullptr; \
} \
}
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 d25accd56b1..b19c394b18f 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-uniscribe.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-uniscribe.cc
@@ -202,9 +202,9 @@ struct hb_uniscribe_shaper_funcs_t {
inline void init (void)
{
HMODULE hinstLib;
- this->ScriptItemizeOpenType = NULL;
- this->ScriptShapeOpenType = NULL;
- this->ScriptPlaceOpenType = NULL;
+ this->ScriptItemizeOpenType = nullptr;
+ this->ScriptShapeOpenType = nullptr;
+ this->ScriptPlaceOpenType = nullptr;
hinstLib = GetModuleHandle (TEXT ("usp10.dll"));
if (hinstLib)
@@ -217,7 +217,7 @@ struct hb_uniscribe_shaper_funcs_t {
!this->ScriptShapeOpenType ||
!this->ScriptPlaceOpenType)
{
- DEBUG_MSG (UNISCRIBE, NULL, "OpenType versions of functions not found; falling back.");
+ DEBUG_MSG (UNISCRIBE, nullptr, "OpenType versions of functions not found; falling back.");
this->ScriptItemizeOpenType = hb_ScriptItemizeOpenType;
this->ScriptShapeOpenType = hb_ScriptShapeOpenType;
this->ScriptPlaceOpenType = hb_ScriptPlaceOpenType;
@@ -242,11 +242,11 @@ retry:
{
funcs = (hb_uniscribe_shaper_funcs_t *) calloc (1, sizeof (hb_uniscribe_shaper_funcs_t));
if (unlikely (!funcs))
- return NULL;
+ return nullptr;
funcs->init ();
- if (!hb_atomic_ptr_cmpexch (&uniscribe_funcs, NULL, funcs)) {
+ if (!hb_atomic_ptr_cmpexch (&uniscribe_funcs, nullptr, funcs)) {
free (funcs);
goto retry;
}
@@ -316,7 +316,7 @@ _hb_generate_unique_face_name (wchar_t *face_name, unsigned int *plen)
const char *enc = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-";
UUID id;
UuidCreate ((UUID*) &id);
- ASSERT_STATIC (2 + 3 * (16/2) < LF_FACESIZE);
+ static_assert ((2 + 3 * (16/2) < LF_FACESIZE), "");
unsigned int name_str_len = 0;
face_name[name_str_len++] = 'F';
face_name[name_str_len++] = '_';
@@ -369,7 +369,7 @@ _hb_rename_font (hb_blob_t *blob, wchar_t *new_name)
if (!new_sfnt_data)
{
hb_blob_destroy (blob);
- return NULL;
+ return nullptr;
}
memcpy(new_sfnt_data, orig_sfnt_data, length);
@@ -417,7 +417,7 @@ _hb_rename_font (hb_blob_t *blob, wchar_t *new_name)
{
free (new_sfnt_data);
hb_blob_destroy (blob);
- return NULL;
+ return nullptr;
}
}
@@ -427,7 +427,7 @@ _hb_rename_font (hb_blob_t *blob, wchar_t *new_name)
hb_blob_destroy (blob);
return hb_blob_create ((const char *) new_sfnt_data, new_length,
- HB_MEMORY_MODE_WRITABLE, NULL, free);
+ HB_MEMORY_MODE_WRITABLE, nullptr, free);
}
hb_uniscribe_shaper_face_data_t *
@@ -435,13 +435,13 @@ _hb_uniscribe_shaper_face_data_create (hb_face_t *face)
{
hb_uniscribe_shaper_face_data_t *data = (hb_uniscribe_shaper_face_data_t *) calloc (1, sizeof (hb_uniscribe_shaper_face_data_t));
if (unlikely (!data))
- return NULL;
+ return nullptr;
data->funcs = hb_uniscribe_shaper_get_funcs ();
if (unlikely (!data->funcs))
{
free (data);
- return NULL;
+ return nullptr;
}
hb_blob_t *blob = hb_face_reference_blob (face);
@@ -452,18 +452,18 @@ _hb_uniscribe_shaper_face_data_create (hb_face_t *face)
if (unlikely (!blob))
{
free (data);
- return NULL;
+ return nullptr;
}
DWORD num_fonts_installed;
- data->fh = AddFontMemResourceEx ((void *) hb_blob_get_data (blob, NULL),
+ data->fh = AddFontMemResourceEx ((void *) hb_blob_get_data (blob, nullptr),
hb_blob_get_length (blob),
0, &num_fonts_installed);
if (unlikely (!data->fh))
{
DEBUG_MSG (UNISCRIBE, face, "Face AddFontMemResourceEx() failed");
free (data);
- return NULL;
+ return nullptr;
}
return data;
@@ -509,11 +509,11 @@ populate_log_font (LOGFONTW *lf,
hb_uniscribe_shaper_font_data_t *
_hb_uniscribe_shaper_font_data_create (hb_font_t *font)
{
- if (unlikely (!hb_uniscribe_shaper_face_data_ensure (font->face))) return NULL;
+ if (unlikely (!hb_uniscribe_shaper_face_data_ensure (font->face))) return nullptr;
hb_uniscribe_shaper_font_data_t *data = (hb_uniscribe_shaper_font_data_t *) calloc (1, sizeof (hb_uniscribe_shaper_font_data_t));
if (unlikely (!data))
- return NULL;
+ return nullptr;
int font_size = font->face->get_upem (); /* Default... */
/* No idea if the following is even a good idea. */
@@ -525,25 +525,25 @@ _hb_uniscribe_shaper_font_data_create (hb_font_t *font)
data->x_mult = (double) font->x_scale / font_size;
data->y_mult = (double) font->y_scale / font_size;
- data->hdc = GetDC (NULL);
+ data->hdc = GetDC (nullptr);
if (unlikely (!populate_log_font (&data->log_font, font, font_size))) {
DEBUG_MSG (UNISCRIBE, font, "Font populate_log_font() failed");
_hb_uniscribe_shaper_font_data_destroy (data);
- return NULL;
+ return nullptr;
}
data->hfont = CreateFontIndirectW (&data->log_font);
if (unlikely (!data->hfont)) {
DEBUG_MSG (UNISCRIBE, font, "Font CreateFontIndirectW() failed");
_hb_uniscribe_shaper_font_data_destroy (data);
- return NULL;
+ return nullptr;
}
if (!SelectObject (data->hdc, data->hfont)) {
DEBUG_MSG (UNISCRIBE, font, "Font SelectObject() failed");
_hb_uniscribe_shaper_font_data_destroy (data);
- return NULL;
+ return nullptr;
}
return data;
@@ -553,7 +553,7 @@ void
_hb_uniscribe_shaper_font_data_destroy (hb_uniscribe_shaper_font_data_t *data)
{
if (data->hdc)
- ReleaseDC (NULL, data->hdc);
+ ReleaseDC (nullptr, data->hdc);
if (data->hfont)
DeleteObject (data->hfont);
if (data->script_cache)
@@ -564,7 +564,7 @@ _hb_uniscribe_shaper_font_data_destroy (hb_uniscribe_shaper_font_data_t *data)
LOGFONTW *
hb_uniscribe_font_get_logfontw (hb_font_t *font)
{
- if (unlikely (!hb_uniscribe_shaper_font_data_ensure (font))) return NULL;
+ if (unlikely (!hb_uniscribe_shaper_font_data_ensure (font))) return nullptr;
hb_uniscribe_shaper_font_data_t *font_data = HB_SHAPER_DATA_GET (font);
return &font_data->log_font;
}
@@ -572,7 +572,7 @@ hb_uniscribe_font_get_logfontw (hb_font_t *font)
HFONT
hb_uniscribe_font_get_hfont (hb_font_t *font)
{
- if (unlikely (!hb_uniscribe_shaper_font_data_ensure (font))) return NULL;
+ if (unlikely (!hb_uniscribe_shaper_font_data_ensure (font))) return nullptr;
hb_uniscribe_shaper_font_data_t *font_data = HB_SHAPER_DATA_GET (font);
return font_data->hfont;
}
@@ -738,7 +738,7 @@ _hb_uniscribe_shape (hb_shape_plan_t *shape_plan,
#define FAIL(...) \
HB_STMT_START { \
- DEBUG_MSG (UNISCRIBE, NULL, __VA_ARGS__); \
+ DEBUG_MSG (UNISCRIBE, nullptr, __VA_ARGS__); \
return false; \
} HB_STMT_END;
@@ -960,7 +960,7 @@ retry:
/* out */
advances + glyphs_offset,
offsets + glyphs_offset,
- NULL);
+ nullptr);
if (unlikely (FAILED (hr)))
FAIL ("ScriptPlaceOpenType() failed: 0x%08xL", hr);
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/main.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/main.cc
index f9708cc948e..93c3b46af2c 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/main.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/main.cc
@@ -47,11 +47,11 @@ main (int argc, char **argv)
exit (1);
}
- const char *font_data = NULL;
+ const char *font_data = nullptr;
int len = 0;
#ifdef HAVE_GLIB
- GMappedFile *mf = g_mapped_file_new (argv[1], false, NULL);
+ GMappedFile *mf = g_mapped_file_new (argv[1], false, nullptr);
font_data = g_mapped_file_get_contents (mf);
len = g_mapped_file_get_length (mf);
#else
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 18c46e9524b..c52d88a0fc8 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
@@ -45,7 +45,7 @@
int
main (int argc, char **argv)
{
- hb_blob_t *blob = NULL;
+ hb_blob_t *blob = nullptr;
if (argc != 2) {
fprintf (stderr, "usage: %s font-file\n", argv[0]);
@@ -61,7 +61,7 @@ main (int argc, char **argv)
hb_memory_mode_t mm;
#ifdef HAVE_GLIB
- GMappedFile *mf = g_mapped_file_new (argv[1], false, NULL);
+ GMappedFile *mf = g_mapped_file_new (argv[1], false, nullptr);
font_data = g_mapped_file_get_contents (mf);
len = g_mapped_file_get_length (mf);
destroy = (hb_destroy_func_t) g_mapped_file_unref;
@@ -86,7 +86,7 @@ main (int argc, char **argv)
hb_face_t *face = hb_face_create (blob, 0 /* first face */);
hb_blob_destroy (blob);
- blob = NULL;
+ blob = nullptr;
unsigned int upem = hb_face_get_upem (face);
hb_font_t *font = hb_font_create (face);
@@ -115,7 +115,7 @@ main (int argc, char **argv)
ret = false;
hb_buffer_serialize_glyphs (buf, 0, hb_buffer_get_length (buf),
- out, sizeof (out), NULL,
+ out, sizeof (out), nullptr,
font, HB_BUFFER_SERIALIZE_FORMAT_JSON,
HB_BUFFER_SERIALIZE_FLAG_DEFAULT);
puts (out);
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/test-size-params.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/test-size-params.cc
index 35d9e3c8e25..faa828051c5 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/test-size-params.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/test-size-params.cc
@@ -43,7 +43,7 @@
int
main (int argc, char **argv)
{
- hb_blob_t *blob = NULL;
+ hb_blob_t *blob = nullptr;
if (argc != 2) {
fprintf (stderr, "usage: %s font-file\n", argv[0]);
@@ -59,7 +59,7 @@ main (int argc, char **argv)
hb_memory_mode_t mm;
#ifdef HAVE_GLIB
- GMappedFile *mf = g_mapped_file_new (argv[1], false, NULL);
+ GMappedFile *mf = g_mapped_file_new (argv[1], false, nullptr);
font_data = g_mapped_file_get_contents (mf);
len = g_mapped_file_get_length (mf);
destroy = (hb_destroy_func_t) g_mapped_file_unref;
@@ -85,7 +85,7 @@ main (int argc, char **argv)
/* Create the face */
hb_face_t *face = hb_face_create (blob, 0 /* first face */);
hb_blob_destroy (blob);
- blob = NULL;
+ blob = nullptr;
unsigned int p[5];
bool ret = hb_ot_layout_get_size_params (face, p, p+1, p+2, p+3, p+4);
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/test-would-substitute.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/test-would-substitute.cc
index 8ea87cdf397..cad5b5a048b 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/test-would-substitute.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/test-would-substitute.cc
@@ -47,7 +47,7 @@
int
main (int argc, char **argv)
{
- hb_blob_t *blob = NULL;
+ hb_blob_t *blob = nullptr;
if (argc != 4 && argc != 5) {
fprintf (stderr, "usage: %s font-file lookup-index first-glyph [second-glyph]\n", argv[0]);
@@ -63,7 +63,7 @@ main (int argc, char **argv)
hb_memory_mode_t mm;
#ifdef HAVE_GLIB
- GMappedFile *mf = g_mapped_file_new (argv[1], false, NULL);
+ GMappedFile *mf = g_mapped_file_new (argv[1], false, nullptr);
font_data = g_mapped_file_get_contents (mf);
len = g_mapped_file_get_length (mf);
destroy = (hb_destroy_func_t) g_mapped_file_unref;
@@ -89,7 +89,7 @@ main (int argc, char **argv)
/* Create the face */
hb_face_t *face = hb_face_create (blob, 0 /* first face */);
hb_blob_destroy (blob);
- blob = NULL;
+ blob = nullptr;
hb_font_t *font = hb_font_create (face);
#ifdef HAVE_FREETYPE
@@ -102,5 +102,5 @@ main (int argc, char **argv)
(argc > 4 &&
!hb_font_glyph_from_string (font, argv[4], -1, &glyphs[1])))
return 2;
- return !hb_ot_layout_lookup_would_substitute (face, strtol (argv[2], NULL, 0), glyphs, len, false);
+ return !hb_ot_layout_lookup_would_substitute (face, strtol (argv[2], nullptr, 0), glyphs, len, false);
}
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/test.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/test.cc
index 0c90f8ff428..2c24fdac82b 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/test.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/test.cc
@@ -46,7 +46,7 @@
int
main (int argc, char **argv)
{
- hb_blob_t *blob = NULL;
+ hb_blob_t *blob = nullptr;
if (argc != 2) {
fprintf (stderr, "usage: %s font-file.ttf\n", argv[0]);
@@ -62,7 +62,7 @@ main (int argc, char **argv)
hb_memory_mode_t mm;
#ifdef HAVE_GLIB
- GMappedFile *mf = g_mapped_file_new (argv[1], false, NULL);
+ GMappedFile *mf = g_mapped_file_new (argv[1], false, nullptr);
font_data = g_mapped_file_get_contents (mf);
len = g_mapped_file_get_length (mf);
destroy = (hb_destroy_func_t) g_mapped_file_unref;
@@ -90,7 +90,7 @@ main (int argc, char **argv)
/* Create the face */
hb_face_t *face = hb_face_create (blob, 0 /* first face */);
hb_blob_destroy (blob);
- blob = NULL;
+ blob = nullptr;
unsigned int upem = hb_face_get_upem (face);
hb_font_t *font = hb_font_create (face);
@@ -105,11 +105,11 @@ main (int argc, char **argv)
hb_buffer_add_utf8 (buffer, "\xe0\xa4\x95\xe0\xa5\x8d\xe0\xa4\xb0\xe0\xa5\x8d\xe0\xa4\x95", -1, 0, -1);
hb_buffer_guess_segment_properties (buffer);
- hb_shape (font, buffer, NULL, 0);
+ hb_shape (font, buffer, nullptr, 0);
unsigned int count = hb_buffer_get_length (buffer);
- hb_glyph_info_t *infos = hb_buffer_get_glyph_infos (buffer, NULL);
- hb_glyph_position_t *positions = hb_buffer_get_glyph_positions (buffer, NULL);
+ hb_glyph_info_t *infos = hb_buffer_get_glyph_infos (buffer, nullptr);
+ hb_glyph_position_t *positions = hb_buffer_get_glyph_positions (buffer, nullptr);
for (unsigned int i = 0; i < count; i++)
{
diff --git a/Build/source/libs/harfbuzz/version.ac b/Build/source/libs/harfbuzz/version.ac
index 684e91eae43..20e28d08054 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], [1.6.0])
+m4_define([harfbuzz_version], [1.6.1])