From ec34a32e9d1bd685a982b1bc60dcfe2a363799a9 Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Thu, 26 Oct 2017 23:41:55 +0000 Subject: harfbuzz 1.6.3. c++11 configuration is not yet done git-svn-id: svn://tug.org/texlive/trunk@45614 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/libs/README | 2 +- Build/source/libs/harfbuzz/ChangeLog | 7 + Build/source/libs/harfbuzz/TLpatches/ChangeLog | 5 + Build/source/libs/harfbuzz/TLpatches/TL-Changes | 2 +- Build/source/libs/harfbuzz/configure | 24 +-- Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog | 199 +++++++++++++++++++++ Build/source/libs/harfbuzz/harfbuzz-src/NEWS | 9 + .../source/libs/harfbuzz/harfbuzz-src/configure.ac | 2 +- .../harfbuzz-src/src/check-c-linkage-decls.sh | 4 +- .../harfbuzz/harfbuzz-src/src/check-externs.sh | 5 +- .../harfbuzz-src/src/check-header-guards.sh | 2 +- .../harfbuzz/harfbuzz-src/src/check-includes.sh | 4 +- .../libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc | 65 ++++++- .../harfbuzz/harfbuzz-src/src/hb-ot-post-table.hh | 173 +++++++++++++++++- .../harfbuzz/harfbuzz-src/src/hb-set-private.hh | 6 +- Build/source/libs/harfbuzz/version.ac | 2 +- 16 files changed, 481 insertions(+), 30 deletions(-) (limited to 'Build') diff --git a/Build/source/libs/README b/Build/source/libs/README index 5a6f584d176..52487ed5cc5 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.2 - checked 24oct17 +harfbuzz 1.6.3 - checked 26oct17 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 0a723c40395..3217f432414 100644 --- a/Build/source/libs/harfbuzz/ChangeLog +++ b/Build/source/libs/harfbuzz/ChangeLog @@ -1,3 +1,10 @@ +2017-10-26 Akira Kakuto + + Import harfbuzz-1.6.3. + * version.ac: Adjusted. + Note that c++11 is required from the version 1.6.1. Works for + the c++11 configuration are not yet done. + 2017-10-24 Akira Kakuto Import harfbuzz-1.6.2. diff --git a/Build/source/libs/harfbuzz/TLpatches/ChangeLog b/Build/source/libs/harfbuzz/TLpatches/ChangeLog index 640ec67e90d..906a9ed5460 100644 --- a/Build/source/libs/harfbuzz/TLpatches/ChangeLog +++ b/Build/source/libs/harfbuzz/TLpatches/ChangeLog @@ -1,3 +1,8 @@ +2017-10-26 Akira Kakuto + + Imported harfbuzz-1.6.3 source tree from: + http://www.freedesktop.org/software/harfbuzz/release/ + 2017-10-24 Akira Kakuto Imported harfbuzz-1.6.2 source tree from: diff --git a/Build/source/libs/harfbuzz/TLpatches/TL-Changes b/Build/source/libs/harfbuzz/TLpatches/TL-Changes index adc2bc7fce0..cabc236b736 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.2/ tree as obtained from: +Changes applied to the harfbuzz-1.6.3/ 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 b20c265a55a..19ba3fe485d 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.2. +# Generated by GNU Autoconf 2.69 for harfbuzz (TeX Live) 1.6.3. # # Report bugs to . # @@ -580,8 +580,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='harfbuzz (TeX Live)' PACKAGE_TARNAME='harfbuzz--tex-live-' -PACKAGE_VERSION='1.6.2' -PACKAGE_STRING='harfbuzz (TeX Live) 1.6.2' +PACKAGE_VERSION='1.6.3' +PACKAGE_STRING='harfbuzz (TeX Live) 1.6.3' 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.2 to adapt to many kinds of systems. +\`configure' configures harfbuzz (TeX Live) 1.6.3 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.2:";; + short | recursive ) echo "Configuration of harfbuzz (TeX Live) 1.6.3:";; 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.2 +harfbuzz (TeX Live) configure 1.6.3 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.2, which was +It was created by harfbuzz (TeX Live) $as_me 1.6.3, 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.2' + VERSION='1.6.3' 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=2 -HB_VERSION=1.6.2 +HB_VERSION_MICRO=3 +HB_VERSION=1.6.3 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.2, which was +This file was extended by harfbuzz (TeX Live) $as_me 1.6.3, 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.2 +harfbuzz (TeX Live) config.status 1.6.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog b/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog index 7702acdf214..5b302575f21 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog +++ b/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog @@ -1,3 +1,202 @@ +commit 729c9e13355eefafdc0fdef9aa68bd792ca4dba4 +Author: David Corbett +Date: Thu Oct 26 10:29:28 2017 -0400 + + Include all relevant glyphs in the subsetted font + + test/shaping/record-test.sh | 2 ++ + 1 file changed, 2 insertions(+) + +commit cb6c6b0c425e560f32b297c15dc6775e297d5b1d +Author: Behdad Esfahbod +Date: Thu Oct 26 11:43:33 2017 -0600 + + Fix warning + + https://github.com/behdad/harfbuzz/commit/49a41dc75931cc2d2f7e74b7801f8cc327039e8e#commitcomment-25203194 + + test/api/test-set.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit dfd234a97d2e2f9908eaf0598de765f76ba86c82 +Author: Jonathan Kew +Date: Thu Oct 26 16:59:50 2017 +0100 + + [set] Fix page_map[] indexing in backward loop. + + Fixes https://github.com/behdad/harfbuzz/issues/579. + + src/hb-set-private.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 7339926525416620aa7922371775ed65eed4eae4 +Author: Jonathan Kew +Date: Thu Oct 26 12:55:36 2017 +0100 + + [test] Extend hb_set test for issue 579 (currently failing) + + test/api/test-set.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +commit 3d6f7df42a87ef366197581cb4696c5f30c3bcbb +Author: Jonathan Kew +Date: Thu Oct 26 17:54:55 2017 +0100 + + [test] Additional coverage in test_set_iter. + + This adds a couple extra entries to the set used, such that iteration + would fail in 1.6.2 due to the bug in hb_set_t::page_t::next(). + + test/api/test-set.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit d511cfb5577a58e31d8dd4214750b0ad4efa625a +Author: Jonathan Kew +Date: Thu Oct 26 15:08:29 2017 +0100 + + [set] Bugfix for hb_set_next + + src/hb-set-private.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 92bac64bd2d5fffe70229790be27d335aa6c6de3 +Author: Behdad Esfahbod +Date: Wed Oct 25 18:22:47 2017 -0600 + + [post] Oops! + + https://ci.appveyor.com/project/behdad/harfbuzz/build/1.0.668/job/ikfj8peowgrp059t + + src/hb-ot-post-table.hh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 543bd58d7a4fbe285ec9304ff3223a728dbdbb76 +Author: Behdad Esfahbod +Date: Wed Oct 25 17:40:50 2017 -0600 + + [post] Touch up and fixes + + The get_glyph_from_name() is incorrect; needs fixing. + + src/hb-ot-font.cc | 9 ++-- + src/hb-ot-post-table.hh | 139 + +++++++++++++++++++++++++++--------------------- + 2 files changed, 81 insertions(+), 67 deletions(-) + +commit d9e166f74c3ba3128c9ef3ccd8d7799e67f14eab +Author: Khaled Hosny +Date: Wed Oct 18 20:49:16 2017 +0200 + + [ot-font] Implement hb_ot_get_glyph_from_name + + src/hb-ot-font.cc | 22 ++++++++++++++++++- + src/hb-ot-post-table.hh | 58 + +++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 79 insertions(+), 1 deletion(-) + +commit 9d4d2fb9af446d5d41058fbb1da8117b3af048d3 +Author: Khaled Hosny +Date: Mon Oct 16 10:05:42 2017 +0200 + + [ot-font] Implement hb_ot_get_glyph_name + + Turns out we already have support for “post” table, it just + needed to be + activated and put in use. + + src/hb-ot-font.cc | 46 ++++++++++++- + src/hb-ot-post-table.hh | 96 + +++++++++++++++++++++++++++ + test/shaping/tests/fallback-positioning.tests | 2 +- + test/shaping/tests/indic-syllable.tests | 2 +- + test/shaping/tests/use.tests | 2 +- + 5 files changed, 143 insertions(+), 5 deletions(-) + +commit bf133497e53e8b1dcd22df62080d33e7f3d85b68 +Merge: fd786c76 49a41dc7 +Author: Behdad Esfahbod +Date: Wed Oct 25 17:23:20 2017 -0600 + + Merge commit '49a41dc75931cc2d2f7e74b7801f8cc327039e8e' + +commit 49a41dc75931cc2d2f7e74b7801f8cc327039e8e +Author: Behdad Esfahbod +Date: Wed Oct 25 16:17:45 2017 -0600 + + [test] Add more hb-set tests + + https://github.com/behdad/harfbuzz/issues/579 + + test/api/test-set.c | 40 ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 40 insertions(+) + +commit fd786c768f838ab61090004dd46b8cefeb270dfd +Author: David Corbett +Date: Wed Oct 25 14:31:22 2017 -0400 + + Use `mktemp -d` instead of `mktemp --directory` + + test/shaping/record-test.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c4944920c0c11d6424d600ebc9130c9055382f80 +Author: David Corbett +Date: Wed Oct 25 16:06:40 2017 -0400 + + Fix and run indic-script-extensions.tests + + test/shaping/Makefile.am | 1 + + test/shaping/tests/indic-script-extensions.tests | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +commit d8df714251c61e13d7d12eb3f7393dd3a75a3719 +Author: David Corbett +Date: Wed Oct 25 16:06:01 2017 -0400 + + Fix code point iteration in narrow Python + + test/shaping/hb_test_tools.py | 27 ++++++++++++++++++++++++++- + 1 file changed, 26 insertions(+), 1 deletion(-) + +commit 33ca3b67bfb5d9ae4e490c796c93793a7e03ef2c +Author: Behdad Esfahbod +Date: Wed Oct 25 12:09:11 2017 -0400 + + Check for headers in builddir first, in check-*.sh + + Fixes https://bugs.freedesktop.org/show_bug.cgi?id=103346 + + src/check-c-linkage-decls.sh | 4 ++-- + src/check-externs.sh | 2 +- + src/check-header-guards.sh | 2 +- + src/check-includes.sh | 4 ++-- + 4 files changed, 6 insertions(+), 6 deletions(-) + +commit 9ac2e5c6c01db3ebe419e3aa07f4d1a3777d2bb6 +Author: Behdad Esfahbod +Date: Tue Oct 24 10:06:25 2017 -0400 + + check-externs.sh: Make output more verbose + + Trying to figure out why this is failing on some Debian bots: + https://bugs.freedesktop.org/show_bug.cgi?id=103346 + + Maybe I should check for GNU grep specifically now that I'm using + -n as well. + + src/check-externs.sh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 3b7388aab6889b5d1fc602b5780a7b29da84e100 +Author: Behdad Esfahbod +Date: Mon Oct 23 14:35:16 2017 -0400 + + 1.6.2 + + NEWS | 10 ++++++++++ + configure.ac | 2 +- + 2 files changed, 11 insertions(+), 1 deletion(-) + commit 30a591e3cef67818ef1ffec92c6a022b5a5f5e77 Author: Behdad Esfahbod Date: Mon Oct 23 14:28:35 2017 -0400 diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/NEWS b/Build/source/libs/harfbuzz/harfbuzz-src/NEWS index 51cec0d376a..af27961e1b1 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/NEWS +++ b/Build/source/libs/harfbuzz/harfbuzz-src/NEWS @@ -1,3 +1,12 @@ +Overview of changes leading to 1.6.3 +Thursday, October 26th, 2017 +==================================== + +- Fix hb_set_t some more. Should be solid now. +- Implement get_glyph_name() for hb-ot-font. +- Misc fixes. + + Overview of changes leading to 1.6.2 Monday, October 23nd, 2017 ==================================== diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac b/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac index 41ace120726..d3dec0af63b 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.2], + [1.6.3], [https://github.com/behdad/harfbuzz/issues/new], [harfbuzz], [http://harfbuzz.org/]) diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/check-c-linkage-decls.sh b/Build/source/libs/harfbuzz/harfbuzz-src/src/check-c-linkage-decls.sh index b10310f5384..cd550867af2 100755 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/check-c-linkage-decls.sh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/check-c-linkage-decls.sh @@ -11,14 +11,14 @@ test "x$HBSOURCES" = x && HBSOURCES=`cd "$srcdir"; find . -maxdepth 1 -name 'hb* for x in $HBHEADERS; do - test -f $srcdir/$x && x=$srcdir/$x + test -f "$srcdir/$x" -a ! -f "$x" && x="$srcdir/$x" if ! grep -q HB_BEGIN_DECLS "$x" || ! grep -q HB_END_DECLS "$x"; then echo "Ouch, file $x does not have HB_BEGIN_DECLS / HB_END_DECLS, but it should" stat=1 fi done for x in $HBSOURCES; do - test -f $srcdir/$x && x=$srcdir/$x + test -f "$srcdir/$x" -a ! -f "$x" && x="$srcdir/$x" if grep -q HB_BEGIN_DECLS "$x" || grep -q HB_END_DECLS "$x"; then echo "Ouch, file $x has HB_BEGIN_DECLS / HB_END_DECLS, but it shouldn't" stat=1 diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/check-externs.sh b/Build/source/libs/harfbuzz/harfbuzz-src/src/check-externs.sh index 63cc7d5bb02..a6de375350c 100755 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/check-externs.sh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/check-externs.sh @@ -13,8 +13,9 @@ test "x$EGREP" = x && EGREP='grep -E' echo 'Checking that all public symbols are exported with HB_EXTERN' for x in $HBHEADERS; do - test -f "$srcdir/$x" && x="$srcdir/$x" - $EGREP -B1 '^hb_' "$x" | $EGREP -E -v '^(--|hb_|HB_EXTERN )' -A1 + test -f "$srcdir/$x" -a ! -f "$x" && x="$srcdir/$x" + $EGREP -B1 -n '^hb_' /dev/null "$x" | + $EGREP -v '(^--|:hb_|-HB_EXTERN )' -A1 done | grep . >&2 && stat=1 diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/check-header-guards.sh b/Build/source/libs/harfbuzz/harfbuzz-src/src/check-header-guards.sh index 09c5ea8b2b5..355d81b525d 100755 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/check-header-guards.sh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/check-header-guards.sh @@ -10,7 +10,7 @@ test "x$HBHEADERS" = x && HBHEADERS=`cd "$srcdir"; find . -maxdepth 1 -name 'hb* test "x$HBSOURCES" = x && HBSOURCES=`cd "$srcdir"; find . -maxdepth 1 -name 'hb-*.cc' -or -name 'hb-*.hh'` for x in $HBHEADERS $HBSOURCES; do - test -f "$srcdir/$x" && x="$srcdir/$x" + test -f "$srcdir/$x" -a ! -f "$x" && x="$srcdir/$x" echo "$x" | grep -q '[^h]$' && continue; xx=`echo "$x" | sed 's@.*/@@'` tag=`echo "$xx" | tr 'a-z.-' 'A-Z_'` diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/check-includes.sh b/Build/source/libs/harfbuzz/harfbuzz-src/src/check-includes.sh index 902f2357e2a..37e372d5122 100755 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/check-includes.sh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/check-includes.sh @@ -13,7 +13,7 @@ test "x$HBSOURCES" = x && HBSOURCES=`cd "$srcdir"; find . -maxdepth 1 -name 'hb- echo 'Checking that public header files #include "hb-common.h" or "hb.h" first (or none)' for x in $HBHEADERS; do - test -f "$srcdir/$x" && x="$srcdir/$x" + test -f "$srcdir/$x" -a ! -f "$x" && x="$srcdir/$x" grep '#.*\' "$x" /dev/null | head -n 1 done | grep -v '"hb-common[.]h"' | @@ -26,7 +26,7 @@ grep . >&2 && stat=1 echo 'Checking that source files #include "hb-*private.hh" first (or none)' for x in $HBSOURCES; do - test -f "$srcdir/$x" && x="$srcdir/$x" + test -f "$srcdir/$x" -a ! -f "$x" && x="$srcdir/$x" grep '#.*\' "$x" /dev/null | grep -v 'include _' | head -n 1 done | grep -v '"hb-.*private[.]hh"' | 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 06d1b80650a..c0ce89df3b5 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 @@ -38,7 +38,7 @@ #include "hb-ot-hmtx-table.hh" #include "hb-ot-os2-table.hh" #include "hb-ot-var-hvar-table.hh" -//#include "hb-ot-post-table.hh" +#include "hb-ot-post-table.hh" struct hb_ot_face_metrics_accelerator_t @@ -301,6 +301,40 @@ struct hb_ot_face_cbdt_accelerator_t } }; +struct hb_ot_face_post_accelerator_t +{ + hb_blob_t *post_blob; + unsigned int post_len; + const OT::post *post; + + inline void init (hb_face_t *face) + { + this->post_blob = OT::Sanitizer::sanitize (face->reference_table (HB_OT_TAG_post)); + this->post = OT::Sanitizer::lock_instance (this->post_blob); + this->post_len = hb_blob_get_length (this->post_blob); + } + + inline void fini (void) + { + hb_blob_destroy (this->post_blob); + } + + inline bool get_glyph_name (hb_codepoint_t glyph, + char *name, unsigned int size) const + { + return this->post->get_glyph_name (glyph, name, size, this->post_len); + } + + inline bool get_glyph_from_name (const char *name, int len, + hb_codepoint_t *glyph) const + { + if (unlikely (!len)) + return false; + + return this->post->get_glyph_from_name (name, len, glyph, this->post_len); + } +}; + typedef bool (*hb_cmap_get_glyph_func_t) (const void *obj, hb_codepoint_t codepoint, hb_codepoint_t *glyph); @@ -436,6 +470,7 @@ struct hb_ot_font_t hb_ot_face_metrics_accelerator_t v_metrics; OT::hb_lazy_loader_t glyf; OT::hb_lazy_loader_t cbdt; + OT::hb_lazy_loader_t post; }; @@ -453,6 +488,7 @@ _hb_ot_font_create (hb_face_t *face) ot_font->h_metrics.ascender - ot_font->h_metrics.descender); /* TODO Can we do this lazily? */ ot_font->glyf.init (face); ot_font->cbdt.init (face); + ot_font->post.init (face); return ot_font; } @@ -467,6 +503,7 @@ _hb_ot_font_destroy (void *data) ot_font->v_metrics.fini (); ot_font->glyf.fini (); ot_font->cbdt.fini (); + ot_font->post.fini (); free (ot_font); } @@ -535,6 +572,28 @@ hb_ot_get_glyph_extents (hb_font_t *font HB_UNUSED, return ret; } +static hb_bool_t +hb_ot_get_glyph_name (hb_font_t *font HB_UNUSED, + void *font_data, + hb_codepoint_t glyph, + char *name, unsigned int size, + void *user_data HB_UNUSED) +{ + const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data; + return ot_font->post->get_glyph_name (glyph, name, size); +} + +static hb_bool_t +hb_ot_get_glyph_from_name (hb_font_t *font HB_UNUSED, + void *font_data, + const char *name, int len, + hb_codepoint_t *glyph, + void *user_data HB_UNUSED) +{ + const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data; + return ot_font->post->get_glyph_from_name (name, len, glyph); +} + static hb_bool_t hb_ot_get_font_h_extents (hb_font_t *font HB_UNUSED, void *font_data, @@ -595,8 +654,8 @@ retry: //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_set_glyph_name_func (funcs, hb_ot_get_glyph_name, nullptr, nullptr); + hb_font_funcs_set_glyph_from_name_func (funcs, hb_ot_get_glyph_from_name, nullptr, nullptr); hb_font_funcs_make_immutable (funcs); diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-post-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-post-table.hh index 82ab3882a80..3eae7f7f101 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-post-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-post-table.hh @@ -29,6 +29,48 @@ #include "hb-open-type-private.hh" +#define NUM_FORMAT1_NAMES 258 + +static const char* const format1_names[NUM_FORMAT1_NAMES] = +{ + ".notdef", ".null", "nonmarkingreturn", "space", "exclam", "quotedbl", + "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", + "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", + "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", + "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", + "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", + "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", + "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", + "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", + "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", + "braceright", "asciitilde", "Adieresis", "Aring", "Ccedilla", "Eacute", + "Ntilde", "Odieresis", "Udieresis", "aacute", "agrave", "acircumflex", + "adieresis", "atilde", "aring", "ccedilla", "eacute", "egrave", + "ecircumflex", "edieresis", "iacute", "igrave", "icircumflex", "idieresis", + "ntilde", "oacute", "ograve", "ocircumflex", "odieresis", "otilde", "uacute", + "ugrave", "ucircumflex", "udieresis", "dagger", "degree", "cent", "sterling", + "section", "bullet", "paragraph", "germandbls", "registered", "copyright", + "trademark", "acute", "dieresis", "notequal", "AE", "Oslash", "infinity", + "plusminus", "lessequal", "greaterequal", "yen", "mu", "partialdiff", + "summation", "product", "pi", "integral", "ordfeminine", "ordmasculine", + "Omega", "ae", "oslash", "questiondown", "exclamdown", "logicalnot", + "radical", "florin", "approxequal", "Delta", "guillemotleft", + "guillemotright", "ellipsis", "nonbreakingspace", "Agrave", "Atilde", + "Otilde", "OE", "oe", "endash", "emdash", "quotedblleft", "quotedblright", + "quoteleft", "quoteright", "divide", "lozenge", "ydieresis", "Ydieresis", + "fraction", "currency", "guilsinglleft", "guilsinglright", "fi", "fl", + "daggerdbl", "periodcentered", "quotesinglbase", "quotedblbase", + "perthousand", "Acircumflex", "Ecircumflex", "Aacute", "Edieresis", "Egrave", + "Iacute", "Icircumflex", "Idieresis", "Igrave", "Oacute", "Ocircumflex", + "apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave", "dotlessi", + "circumflex", "tilde", "macron", "breve", "dotaccent", "ring", "cedilla", + "hungarumlaut", "ogonek", "caron", "Lslash", "lslash", "Scaron", "scaron", + "Zcaron", "zcaron", "brokenbar", "Eth", "eth", "Yacute", "yacute", "Thorn", + "thorn", "minus", "multiply", "onesuperior", "twosuperior", "threesuperior", + "onehalf", "onequarter", "threequarters", "franc", "Gbreve", "gbreve", + "Idotaccent", "Scedilla", "scedilla", "Cacute", "cacute", "Ccaron", "ccaron", + "dcroat", +}; namespace OT { @@ -71,12 +113,141 @@ struct post return_trace (false); if (version.to_int () == 0x00020000) { - const postV2Tail &v2 = StructAfter(*this); + const postV2Tail &v2 = StructAfter (*this); return_trace (v2.sanitize (c)); } return_trace (true); } + inline bool get_glyph_name (hb_codepoint_t glyph, + char *buffer, unsigned int buffer_length, + unsigned int blob_len) const + { + if (version.to_int () == 0x00010000) + { + if (glyph >= NUM_FORMAT1_NAMES) + return false; + + if (!buffer_length) + return true; + strncpy (buffer, format1_names[glyph], buffer_length); + buffer[buffer_length - 1] = '\0'; + return true; + } + + if (version.to_int () == 0x00020000) + { + const postV2Tail &v2 = StructAfter (*this); + + if (glyph >= v2.numberOfGlyphs) + return false; + + if (!buffer_length) + return true; + + unsigned int index = v2.glyphNameIndex[glyph]; + if (index < NUM_FORMAT1_NAMES) + { + if (!buffer_length) + return true; + strncpy (buffer, format1_names[index], buffer_length); + buffer[buffer_length - 1] = '\0'; + return true; + } + index -= NUM_FORMAT1_NAMES; + + unsigned int offset = min_size + v2.min_size + 2 * v2.numberOfGlyphs; + unsigned char *data = (unsigned char *) this + offset; + unsigned char *end = (unsigned char *) this + blob_len; + for (unsigned int i = 0; data < end; i++) + { + unsigned int name_length = data[0]; + data++; + if (i == index) + { + if (unlikely (!name_length)) + return false; + + unsigned int remaining = end - data; + name_length = MIN (name_length, buffer_length - 1); + name_length = MIN (name_length, remaining); + memcpy (buffer, data, name_length); + buffer[name_length] = '\0'; + return true; + } + data += name_length; + } + + return false; + } + + return false; + } + + inline bool get_glyph_from_name (const char *name, int len, + hb_codepoint_t *glyph, + unsigned int blob_len) const + { + if (len < 0) + len = strlen (name); + + if (version.to_int () == 0x00010000) + { + for (int i = 0; i < NUM_FORMAT1_NAMES; i++) + { + if (strncmp (name, format1_names[i], len) == 0 && format1_names[i][len] == '\0') + { + *glyph = i; + return true; + } + } + return false; + } + + if (version.to_int () == 0x00020000) + { + const postV2Tail &v2 = StructAfter (*this); + unsigned int offset = min_size + v2.min_size + 2 * v2.numberOfGlyphs; + char* data = (char*) this + offset; + + + /* XXX The following code is wrong. */ + return false; + for (hb_codepoint_t gid = 0; gid < v2.numberOfGlyphs; gid++) + { + unsigned int index = v2.glyphNameIndex[gid]; + if (index < NUM_FORMAT1_NAMES) + { + if (strncmp (name, format1_names[index], len) == 0 && format1_names[index][len] == '\0') + { + *glyph = gid; + return true; + } + continue; + } + index -= NUM_FORMAT1_NAMES; + + for (unsigned int i = 0; data < (char*) this + blob_len; i++) + { + unsigned int name_length = data[0]; + unsigned int remaining = (char*) this + blob_len - data - 1; + name_length = MIN (name_length, remaining); + if (name_length == (unsigned int) len && strncmp (name, data + 1, len) == 0) + { + *glyph = gid; + return true; + } + data += name_length + 1; + } + return false; + } + + return false; + } + + return false; + } + public: FixedVersion<>version; /* 0x00010000 for version 1.0 * 0x00020000 for version 2.0 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 0454a1896e0..c970b89dda7 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 @@ -95,7 +95,7 @@ struct hb_set_t goto found; for (i++; i < len (); i++) if (v[i]) - for (unsigned int j = 0; j < ELT_BITS; j++) + for (j = 0; j < ELT_BITS; j++) if (v[i] & (elt_t (1) << j)) goto found; @@ -313,13 +313,13 @@ struct hb_set_t b = nb; for (; a && b; ) { - if (page_map[a].major == other->page_map[b].major) + if (page_map[a - 1].major == other->page_map[b - 1].major) { a--; b--; Op::process (page_at (--count).v, page_at (a).v, other->page_at (b).v); } - else if (page_map[a].major > other->page_map[b].major) + else if (page_map[a - 1].major > other->page_map[b - 1].major) { a--; if (Op::passthru_left) diff --git a/Build/source/libs/harfbuzz/version.ac b/Build/source/libs/harfbuzz/version.ac index edbb2c2f8b4..0d5b64a581b 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.2]) +m4_define([harfbuzz_version], [1.6.3]) -- cgit v1.2.3