texlive[42643] Build/source/libs/harfbuzz: HarfBuzz 1.3.4

commits+kakuto at tug.org commits+kakuto at tug.org
Tue Dec 6 06:59:31 CET 2016


Revision: 42643
          http://tug.org/svn/texlive?view=revision&revision=42643
Author:   kakuto
Date:     2016-12-06 06:59:31 +0100 (Tue, 06 Dec 2016)
Log Message:
-----------
HarfBuzz 1.3.4

Modified Paths:
--------------
    trunk/Build/source/libs/harfbuzz/ChangeLog
    trunk/Build/source/libs/harfbuzz/Makefile.am
    trunk/Build/source/libs/harfbuzz/Makefile.in
    trunk/Build/source/libs/harfbuzz/configure
    trunk/Build/source/libs/harfbuzz/harfbuzz-PATCHES/ChangeLog
    trunk/Build/source/libs/harfbuzz/harfbuzz-PATCHES/TL-Changes
    trunk/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog
    trunk/Build/source/libs/harfbuzz/harfbuzz-src/NEWS
    trunk/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac
    trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources
    trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font-private.hh
    trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-type-private.hh
    trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc
    trunk/Build/source/libs/harfbuzz/version.ac

Added Paths:
-----------
    trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cbdt-table.hh

Modified: trunk/Build/source/libs/harfbuzz/ChangeLog
===================================================================
--- trunk/Build/source/libs/harfbuzz/ChangeLog	2016-12-06 01:02:38 UTC (rev 42642)
+++ trunk/Build/source/libs/harfbuzz/ChangeLog	2016-12-06 05:59:31 UTC (rev 42643)
@@ -1,3 +1,8 @@
+2016-12-06  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	Import harfbuzz-1.3.4.
+	* Makefile.am, version.ac: Adjusted.
+
 2016-10-31  Karl Berry  <karl at tug.org>
 
 	* include/Makefile.am (hdr_links): add hb-ot-math.h

Modified: trunk/Build/source/libs/harfbuzz/Makefile.am
===================================================================
--- trunk/Build/source/libs/harfbuzz/Makefile.am	2016-12-06 01:02:38 UTC (rev 42642)
+++ trunk/Build/source/libs/harfbuzz/Makefile.am	2016-12-06 05:59:31 UTC (rev 42643)
@@ -47,6 +47,7 @@
 	@HARFBUZZ_TREE@/src/hb-object-private.hh \
 	@HARFBUZZ_TREE@/src/hb-open-file-private.hh \
 	@HARFBUZZ_TREE@/src/hb-open-type-private.hh \
+	@HARFBUZZ_TREE@/src/hb-ot-cbdt-table.hh \
 	@HARFBUZZ_TREE@/src/hb-ot-head-table.hh \
 	@HARFBUZZ_TREE@/src/hb-ot-hhea-table.hh \
 	@HARFBUZZ_TREE@/src/hb-ot-hmtx-table.hh \

Modified: trunk/Build/source/libs/harfbuzz/Makefile.in
===================================================================
--- trunk/Build/source/libs/harfbuzz/Makefile.in	2016-12-06 01:02:38 UTC (rev 42642)
+++ trunk/Build/source/libs/harfbuzz/Makefile.in	2016-12-06 05:59:31 UTC (rev 42643)
@@ -659,6 +659,7 @@
 	@HARFBUZZ_TREE@/src/hb-object-private.hh \
 	@HARFBUZZ_TREE@/src/hb-open-file-private.hh \
 	@HARFBUZZ_TREE@/src/hb-open-type-private.hh \
+	@HARFBUZZ_TREE@/src/hb-ot-cbdt-table.hh \
 	@HARFBUZZ_TREE@/src/hb-ot-head-table.hh \
 	@HARFBUZZ_TREE@/src/hb-ot-hhea-table.hh \
 	@HARFBUZZ_TREE@/src/hb-ot-hmtx-table.hh \

Modified: trunk/Build/source/libs/harfbuzz/configure
===================================================================
--- trunk/Build/source/libs/harfbuzz/configure	2016-12-06 01:02:38 UTC (rev 42642)
+++ trunk/Build/source/libs/harfbuzz/configure	2016-12-06 05:59:31 UTC (rev 42643)
@@ -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.3.3.
+# Generated by GNU Autoconf 2.69 for harfbuzz (TeX Live) 1.3.4.
 #
 # Report bugs to <tex-k at tug.org>.
 #
@@ -580,8 +580,8 @@
 # Identity of this package.
 PACKAGE_NAME='harfbuzz (TeX Live)'
 PACKAGE_TARNAME='harfbuzz--tex-live-'
-PACKAGE_VERSION='1.3.3'
-PACKAGE_STRING='harfbuzz (TeX Live) 1.3.3'
+PACKAGE_VERSION='1.3.4'
+PACKAGE_STRING='harfbuzz (TeX Live) 1.3.4'
 PACKAGE_BUGREPORT='tex-k at tug.org'
 PACKAGE_URL=''
 
@@ -1312,7 +1312,7 @@
   # 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.3.3 to adapt to many kinds of systems.
+\`configure' configures harfbuzz (TeX Live) 1.3.4 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1383,7 +1383,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of harfbuzz (TeX Live) 1.3.3:";;
+     short | recursive ) echo "Configuration of harfbuzz (TeX Live) 1.3.4:";;
    esac
   cat <<\_ACEOF
 
@@ -1490,7 +1490,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-harfbuzz (TeX Live) configure 1.3.3
+harfbuzz (TeX Live) configure 1.3.4
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2080,7 +2080,7 @@
 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.3.3, which was
+It was created by harfbuzz (TeX Live) $as_me 1.3.4, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -4003,7 +4003,7 @@
 
 # Define the identity of the package.
  PACKAGE='harfbuzz--tex-live-'
- VERSION='1.3.3'
+ VERSION='1.3.4'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -4206,8 +4206,8 @@
 
 HB_VERSION_MAJOR=1
 HB_VERSION_MINOR=3
-HB_VERSION_MICRO=3
-HB_VERSION=1.3.3
+HB_VERSION_MICRO=4
+HB_VERSION=1.3.4
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -6866,7 +6866,7 @@
 # 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.3.3, which was
+This file was extended by harfbuzz (TeX Live) $as_me 1.3.4, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -6932,7 +6932,7 @@
 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.3.3
+harfbuzz (TeX Live) config.status 1.3.4
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-PATCHES/ChangeLog
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-PATCHES/ChangeLog	2016-12-06 01:02:38 UTC (rev 42642)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-PATCHES/ChangeLog	2016-12-06 05:59:31 UTC (rev 42643)
@@ -1,3 +1,8 @@
+2016-12-06  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	Imported harfbuzz-1.3.4 source tree from:
+	  http://www.freedesktop.org/software/harfbuzz/release/
+
 2016-10-26  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
 
 	Imported harfbuzz-1.3.3 source tree from:

Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-PATCHES/TL-Changes
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-PATCHES/TL-Changes	2016-12-06 01:02:38 UTC (rev 42642)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-PATCHES/TL-Changes	2016-12-06 05:59:31 UTC (rev 42643)
@@ -1,4 +1,4 @@
-Changes applied to the harfbuzz-1.3.3/ tree as obtained from:
+Changes applied to the harfbuzz-1.3.4/ tree as obtained from:
 	http://www.freedesktop.org/software/harfbuzz/release/
 
 Removed:

Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog	2016-12-06 01:02:38 UTC (rev 42642)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog	2016-12-06 05:59:31 UTC (rev 42643)
@@ -1,3 +1,260 @@
+commit b843c6d8b66c2833cd35407ee494546465e6d775
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Mon Dec 5 13:42:28 2016 -0800
+
+    1.3.4
+
+ NEWS         | 8 ++++++++
+ configure.ac | 2 +-
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+commit 8c842e4a44908cce0f416481c73dc0866a0a9c95
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Sun Dec 4 20:28:38 2016 -0800
+
+    [hb-fuzzer] Get glyph extents for output glyphs
+
+    To exercise glyph-extents codepaths (glyf / CBLC+CBDT).
+
+ test/fuzzing/hb-fuzzer.cc | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+commit 9f6144cdb9dd2bc8cd147306e678d76ae82663d8
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Sun Dec 4 19:55:17 2016 -0800
+
+    [CBDT] Add test for fetching glyph extents
+
+ test/shaping/Makefile.am                                 |   1 +
+ .../sha1sum/ee39587d13b2afa5499cc79e45780aa79293bbd4.ttf | Bin 0 ->
+ 3724 bytes
+ test/shaping/tests/color-fonts.tests                     |   1 +
+ 3 files changed, 2 insertions(+)
+
+commit e4bfccfb2a0f425ff69b0a50ca8a4731c4001069
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Sun Dec 4 19:43:33 2016 -0800
+
+    [CBDT] Minor
+
+ src/hb-ot-cbdt-table.hh | 21 ++++++++++++++-------
+ src/hb-ot-font.cc       | 38 ++++++++++++++++++++------------------
+ 2 files changed, 34 insertions(+), 25 deletions(-)
+
+commit b7068af423dba30fd831041aabf4b805d26fe349
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Sun Dec 4 19:36:30 2016 -0800
+
+    [CBDT] Fix thinko!
+
+ src/hb-ot-cbdt-table.hh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit a141d1da9bb0f91521a9a7749f9533c75cfe6a2f
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Sun Dec 4 19:26:54 2016 -0800
+
+    [CBDT] Implement IndexSubtableFormat3
+
+ src/hb-ot-cbdt-table.hh | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+commit 9eda74c92c9024ffb8ec6e9344c99d51dd763f0c
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Sun Dec 4 19:12:52 2016 -0800
+
+    [cbdt] Move some more code around
+
+ src/hb-ot-cbdt-table.hh | 61
+ ++++++++++++++++++++++++++++++++++---------------
+ src/hb-ot-font.cc       | 18 ++++++---------
+ 2 files changed, 49 insertions(+), 30 deletions(-)
+
+commit 654f9ab0d8d5ee032b5da763e34e7b1f454416b9
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Sun Dec 4 18:56:24 2016 -0800
+
+    [cbdt] Fix sign bug
+
+    Was introduced in d495fc5e38038f4cfb20425b1109324fa70bf2f9
+
+ src/hb-ot-cbdt-table.hh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit c27d6fcf8db6f02e075dd1868ae67d878fff39d4
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Fri Dec 2 22:43:05 2016 -0800
+
+    [cbdt] Last of sanitization fixes
+
+    Should be all good now..
+
+ src/hb-ot-font.cc | 23 ++++++++++++++++-------
+ 1 file changed, 16 insertions(+), 7 deletions(-)
+
+commit d495fc5e38038f4cfb20425b1109324fa70bf2f9
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Fri Dec 2 21:36:42 2016 -0800
+
+    [cbdt] Clean up some more
+
+    Almost there..
+
+ src/hb-ot-cbdt-table.hh | 134
+ +++++++++++++++++++++++++++++++++++++++++++-----
+ src/hb-ot-font.cc       |  38 ++++----------
+ 2 files changed, 131 insertions(+), 41 deletions(-)
+
+commit ce09e90e1502d5f944bafd64e51c29e365a963ae
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Fri Dec 2 20:12:57 2016 -0800
+
+    [cbdt] More sanitize work
+
+ src/hb-ot-cbdt-table.hh | 65
+ +++++++++++++++++++++++++++++--------------------
+ src/hb-ot-font.cc       | 46 ++++++++++++++++++----------------
+ 2 files changed, 63 insertions(+), 48 deletions(-)
+
+commit 70eb2ff682344688635cebb716fee0b73557c925
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Fri Dec 2 19:51:23 2016 -0800
+
+    Check for offset overflows during sanitize
+
+ src/hb-open-type-private.hh | 2 ++
+ 1 file changed, 2 insertions(+)
+
+commit 4b58c9e326acde09d389c699014e4e7f6259f50a
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Fri Dec 2 19:25:54 2016 -0800
+
+    [cbdt] Start fixing sanitization (or lack thereof)
+
+ src/hb-ot-cbdt-table.hh | 77
+ ++++++++++++++++++++++++++++++++++++-------------
+ src/hb-ot-font.cc       | 22 +++++++-------
+ 2 files changed, 68 insertions(+), 31 deletions(-)
+
+commit b92ba7bafcd9545a401fb871eb342e6284032c47
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Fri Dec 2 15:21:43 2016 -0800
+
+    [CBDT] Use CHAR instead of int8_t
+
+ src/hb-open-type-private.hh |  1 +
+ src/hb-ot-cbdt-table.hh     | 28 ++++++++++++++--------------
+ 2 files changed, 15 insertions(+), 14 deletions(-)
+
+commit efca7bf97f9967af4fa399a6665b723af643cecd
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Fri Dec 2 15:11:37 2016 -0800
+
+    Rename 'ebdt' to 'cbdt' since we only support the PNG format
+
+ src/Makefile.sources                             |  2 +-
+ src/{hb-ot-ebdt-table.hh => hb-ot-cbdt-table.hh} |  6 +++---
+ src/hb-ot-font.cc                                | 12 ++++++------
+ 3 files changed, 10 insertions(+), 10 deletions(-)
+
+commit 831852594b777f250efedb76d19bee1cfc8eeaa4
+Author: Seigo Nonaka <nona at google.com>
+Date:   Fri Dec 2 15:03:50 2016 -0800
+
+    Introduce get_extent support for color bitmap font. (#351)
+
+    hb_font_get_glyph_extents now works for color bitmap fonts.
+    Currently only font having index format 1 and image format 17
+    is supported.
+
+ src/Makefile.sources    |   1 +
+ src/hb-ot-ebdt-table.hh | 193
+ ++++++++++++++++++++++++++++++++++++++++++++++++
+ src/hb-ot-font.cc       |  96 ++++++++++++++++++++++++
+ 3 files changed, 290 insertions(+)
+
+commit 261837e7202ec584f653f379851e1c6457396b07
+Author: Ebrahim Byagowi <ebrahim at gnu.org>
+Date:   Fri Oct 28 21:49:11 2016 +0330
+
+    Fix "nmake install" when ADDITIONAL_LIB_DIR is provided and test it
+    on CI (#356)
+
+ appveyor.yml             | 1 +
+ win32/detectenv-msvc.mak | 4 ++--
+ win32/generate-msvc.mak  | 2 +-
+ 3 files changed, 4 insertions(+), 3 deletions(-)
+
+commit d163cd956246449e3e48b54ce6eb5cdb14e3a0a6
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Wed Oct 26 18:27:48 2016 +0200
+
+    [tests] Add tests for vertical origin with ft and ot font-funcs
+
+ .../sha1sum/f9b1dd4dcb515e757789a22cb4241107746fd3d0.ttf | Bin 0 ->
+ 1004 bytes
+ test/shaping/tests/vertical.tests                        |   2 ++
+ 2 files changed, 2 insertions(+)
+
+commit 2b117720c03869c7714304fd7fbfb2b01199bb3a
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Wed Oct 26 18:12:50 2016 +0200
+
+    Use horizontal ascent as fallback vertical origin
+
+ src/hb-font-private.hh | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+commit a7b32f2057098012b3ab43121397766ae45b3559
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Wed Oct 26 18:08:41 2016 +0200
+
+    Move code around
+
+ src/hb-font-private.hh | 38 +++++++++++++++++++++++---------------
+ 1 file changed, 23 insertions(+), 15 deletions(-)
+
+commit 63635c763dd9393df236f49d491510cca18a1ccc
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Wed Oct 26 17:54:04 2016 +0200
+
+    [hb-ot-font] Use ascent+descent as fallback vertical advance
+
+ src/hb-ot-font.cc | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+commit 9ee23c49a7a7b2479ae0d36a64720e92eb8a36e7
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Wed Oct 26 17:44:16 2016 +0200
+
+    Fix vertical glyph origin with hb-ot-font
+
+ src/hb-font-private.hh | 51
+ ++++++++++++++++++++++++++++----------------------
+ 1 file changed, 29 insertions(+), 22 deletions(-)
+
+commit b3b0816d5fc00298621f738cf400de60f8a42c5d
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Wed Oct 26 17:19:07 2016 +0200
+
+    Fix vertical font metrics
+
+    Ouch!
+
+ src/hb-font-private.hh | 4 ++--
+ src/hb-ot-font.cc      | 8 ++++++--
+ 2 files changed, 8 insertions(+), 4 deletions(-)
+
+commit 966ac7ecd3d0128a3adacdd26aacef2bd8afa4d4
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Wed Oct 26 16:17:15 2016 +0200
+
+    1.3.3
+
+ NEWS         | 24 ++++++++++++++++++++++++
+ configure.ac |  2 +-
+ 2 files changed, 25 insertions(+), 1 deletion(-)
+
 commit 118164293cc7eb18ba03896f602aff816400134b
 Author: Behdad Esfahbod <behdad at behdad.org>
 Date:   Wed Oct 26 16:04:30 2016 +0200

Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/NEWS
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/NEWS	2016-12-06 01:02:38 UTC (rev 42642)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/NEWS	2016-12-06 05:59:31 UTC (rev 42643)
@@ -1,3 +1,11 @@
+Overview of changes leading to 1.3.4
+Monday, December 5, 2016
+====================================
+
+- Fix vertical glyph origin in hb-ot-font.
+- Implement CBDT/CBLC color font glyph extents in hb-ot-font.
+
+
 Overview of changes leading to 1.3.3
 Wednesday, September 28, 2016
 ====================================

Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac	2016-12-06 01:02:38 UTC (rev 42642)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac	2016-12-06 05:59:31 UTC (rev 42643)
@@ -1,6 +1,6 @@
 AC_PREREQ([2.64])
 AC_INIT([HarfBuzz],
-        [1.3.3],
+        [1.3.4],
         [https://github.com/behdad/harfbuzz/issues/new],
         [harfbuzz],
         [http://harfbuzz.org/])

Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources	2016-12-06 01:02:38 UTC (rev 42642)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.sources	2016-12-06 05:59:31 UTC (rev 42643)
@@ -20,6 +20,7 @@
 	hb-object-private.hh \
 	hb-open-file-private.hh \
 	hb-open-type-private.hh \
+	hb-ot-cbdt-table.hh \
 	hb-ot-cmap-table.hh \
 	hb-ot-glyf-table.hh \
 	hb-ot-head-table.hh \

Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font-private.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font-private.hh	2016-12-06 01:02:38 UTC (rev 42642)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font-private.hh	2016-12-06 05:59:31 UTC (rev 42643)
@@ -296,24 +296,32 @@
 
   /* A bit higher-level, and with fallback */
 
+  inline void get_h_extents_with_fallback (hb_font_extents_t *extents)
+  {
+    if (!get_font_h_extents (extents))
+    {
+      extents->ascender = y_scale * .8;
+      extents->descender = extents->ascender - y_scale;
+      extents->line_gap = 0;
+    }
+  }
+  inline void get_v_extents_with_fallback (hb_font_extents_t *extents)
+  {
+    if (!get_font_v_extents (extents))
+    {
+      extents->ascender = x_scale / 2;
+      extents->descender = extents->ascender - x_scale;
+      extents->line_gap = 0;
+    }
+  }
+
   inline void get_extents_for_direction (hb_direction_t direction,
 					 hb_font_extents_t *extents)
   {
-    if (likely (HB_DIRECTION_IS_HORIZONTAL (direction))) {
-      if (!get_font_h_extents (extents))
-      {
-	extents->ascender = y_scale * .8;
-	extents->descender = y_scale - extents->ascender;
-	extents->line_gap = 0;
-      }
-    } else {
-      if (!get_font_v_extents (extents))
-      {
-	extents->ascender = x_scale / 2;
-	extents->descender = x_scale - extents->ascender;
-	extents->line_gap = 0;
-      }
-    }
+    if (likely (HB_DIRECTION_IS_HORIZONTAL (direction)))
+      get_h_extents_with_fallback (extents);
+    else
+      get_v_extents_with_fallback (extents);
   }
 
   inline void get_glyph_advance_for_direction (hb_codepoint_t glyph,
@@ -329,40 +337,48 @@
     }
   }
 
-  /* Internal only */
   inline void guess_v_origin_minus_h_origin (hb_codepoint_t glyph,
 					     hb_position_t *x, hb_position_t *y)
   {
     *x = get_glyph_h_advance (glyph) / 2;
 
-    /* TODO use font_extents.ascender */
-    *y = y_scale;
+    /* TODO cache this somehow?! */
+    hb_font_extents_t extents;
+    get_h_extents_with_fallback (&extents);
+    *y = extents.ascender;
   }
 
+  inline void get_glyph_h_origin_with_fallback (hb_codepoint_t glyph,
+						hb_position_t *x, hb_position_t *y)
+  {
+    if (!get_glyph_h_origin (glyph, x, y) &&
+	 get_glyph_v_origin (glyph, x, y))
+    {
+      hb_position_t dx, dy;
+      guess_v_origin_minus_h_origin (glyph, &dx, &dy);
+      *x -= dx; *y -= dy;
+    }
+  }
+  inline void get_glyph_v_origin_with_fallback (hb_codepoint_t glyph,
+						hb_position_t *x, hb_position_t *y)
+  {
+    if (!get_glyph_v_origin (glyph, x, y) &&
+	 get_glyph_h_origin (glyph, x, y))
+    {
+      hb_position_t dx, dy;
+      guess_v_origin_minus_h_origin (glyph, &dx, &dy);
+      *x += dx; *y += dy;
+    }
+  }
+
   inline void get_glyph_origin_for_direction (hb_codepoint_t glyph,
 					      hb_direction_t direction,
 					      hb_position_t *x, hb_position_t *y)
   {
     if (likely (HB_DIRECTION_IS_HORIZONTAL (direction)))
-    {
-      if (!get_glyph_h_origin (glyph, x, y) &&
-	   get_glyph_v_origin (glyph, x, y))
-      {
-	hb_position_t dx, dy;
-	guess_v_origin_minus_h_origin (glyph, &dx, &dy);
-	*x -= dx; *y -= dy;
-      }
-    }
+      get_glyph_h_origin_with_fallback (glyph, x, y);
     else
-    {
-      if (!get_glyph_v_origin (glyph, x, y) &&
-	   get_glyph_h_origin (glyph, x, y))
-      {
-	hb_position_t dx, dy;
-	guess_v_origin_minus_h_origin (glyph, &dx, &dy);
-	*x += dx; *y += dy;
-      }
-    }
+      get_glyph_v_origin_with_fallback (glyph, x, y);
   }
 
   inline void add_glyph_h_origin (hb_codepoint_t glyph,
@@ -370,7 +386,7 @@
   {
     hb_position_t origin_x, origin_y;
 
-    get_glyph_h_origin (glyph, &origin_x, &origin_y);
+    get_glyph_h_origin_with_fallback (glyph, &origin_x, &origin_y);
 
     *x += origin_x;
     *y += origin_y;
@@ -380,7 +396,7 @@
   {
     hb_position_t origin_x, origin_y;
 
-    get_glyph_v_origin (glyph, &origin_x, &origin_y);
+    get_glyph_v_origin_with_fallback (glyph, &origin_x, &origin_y);
 
     *x += origin_x;
     *y += origin_y;
@@ -402,7 +418,7 @@
   {
     hb_position_t origin_x, origin_y;
 
-    get_glyph_h_origin (glyph, &origin_x, &origin_y);
+    get_glyph_h_origin_with_fallback (glyph, &origin_x, &origin_y);
 
     *x -= origin_x;
     *y -= origin_y;
@@ -412,7 +428,7 @@
   {
     hb_position_t origin_x, origin_y;
 
-    get_glyph_v_origin (glyph, &origin_x, &origin_y);
+    get_glyph_v_origin_with_fallback (glyph, &origin_x, &origin_y);
 
     *x -= origin_x;
     *y -= origin_y;

Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-type-private.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-type-private.hh	2016-12-06 01:02:38 UTC (rev 42642)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-type-private.hh	2016-12-06 05:59:31 UTC (rev 42643)
@@ -650,6 +650,7 @@
   DEFINE_SIZE_STATIC (Size);
 };
 
+typedef	IntType<int8_t	, 1> CHAR;	/* 8-bit signed integer. */
 typedef	IntType<uint8_t	, 1> BYTE;	/* 8-bit unsigned integer. */
 typedef IntType<uint16_t, 2> USHORT;	/* 16-bit unsigned integer. */
 typedef IntType<int16_t,  2> SHORT;	/* 16-bit signed integer. */
@@ -805,6 +806,7 @@
     if (unlikely (!c->check_struct (this))) return_trace (false);
     unsigned int offset = *this;
     if (unlikely (!offset)) return_trace (true);
+    if (unlikely (!c->check_range (base, offset))) return_trace (false);
     const Type &obj = StructAtOffset<Type> (base, offset);
     return_trace (likely (obj.sanitize (c)) || neuter (c));
   }
@@ -815,6 +817,7 @@
     if (unlikely (!c->check_struct (this))) return_trace (false);
     unsigned int offset = *this;
     if (unlikely (!offset)) return_trace (true);
+    if (unlikely (!c->check_range (base, offset))) return_trace (false);
     const Type &obj = StructAtOffset<Type> (base, offset);
     return_trace (likely (obj.sanitize (c, user_data)) || neuter (c));
   }

Added: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cbdt-table.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cbdt-table.hh	                        (rev 0)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-cbdt-table.hh	2016-12-06 05:59:31 UTC (rev 42643)
@@ -0,0 +1,384 @@
+/*
+ * Copyright © 2016  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): Seigo Nonaka
+ */
+
+#ifndef HB_OT_CBDT_TABLE_HH
+#define HB_OT_CBDT_TABLE_HH
+
+#include "hb-open-type-private.hh"
+
+namespace OT {
+
+struct SmallGlyphMetrics
+{
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this));
+  }
+
+  inline void get_extents (hb_glyph_extents_t *extents) const
+  {
+    extents->x_bearing = bearingX;
+    extents->y_bearing = bearingY;
+    extents->width = width;
+    extents->height = -height;
+  }
+
+  BYTE height;
+  BYTE width;
+  CHAR bearingX;
+  CHAR bearingY;
+  BYTE advance;
+
+  DEFINE_SIZE_STATIC(5);
+};
+
+struct BigGlyphMetrics : SmallGlyphMetrics
+{
+  CHAR vertBearingX;
+  CHAR vertBearingY;
+  BYTE vertAdvance;
+
+  DEFINE_SIZE_STATIC(8);
+};
+
+struct SBitLineMetrics
+{
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this));
+  }
+
+  CHAR ascender;
+  CHAR decender;
+  BYTE widthMax;
+  CHAR caretSlopeNumerator;
+  CHAR caretSlopeDenominator;
+  CHAR caretOffset;
+  CHAR minOriginSB;
+  CHAR minAdvanceSB;
+  CHAR maxBeforeBL;
+  CHAR minAfterBL;
+  CHAR padding1;
+  CHAR padding2;
+
+  DEFINE_SIZE_STATIC(12);
+};
+
+
+/*
+ * Index Subtables.
+ */
+
+struct IndexSubtableHeader
+{
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this));
+  }
+
+  USHORT indexFormat;
+  USHORT imageFormat;
+  ULONG imageDataOffset;
+
+  DEFINE_SIZE_STATIC(8);
+};
+
+template <typename OffsetType>
+struct IndexSubtableFormat1Or3
+{
+  inline bool sanitize (hb_sanitize_context_t *c, unsigned int glyph_count) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this) &&
+		  c->check_array (offsetArrayZ, offsetArrayZ[0].static_size, glyph_count + 1));
+  }
+
+  bool get_image_data (unsigned int idx,
+		       unsigned int *offset,
+		       unsigned int *length) const
+  {
+    if (unlikely (offsetArrayZ[idx + 1] <= offsetArrayZ[idx]))
+      return false;
+
+    *offset = header.imageDataOffset + offsetArrayZ[idx];
+    *length = offsetArrayZ[idx + 1] - offsetArrayZ[idx];
+    return true;
+  }
+
+  IndexSubtableHeader header;
+  Offset<OffsetType> offsetArrayZ[VAR];
+
+  DEFINE_SIZE_ARRAY(8, offsetArrayZ);
+};
+
+struct IndexSubtableFormat1 : IndexSubtableFormat1Or3<ULONG> {};
+struct IndexSubtableFormat3 : IndexSubtableFormat1Or3<USHORT> {};
+
+struct IndexSubtable
+{
+  inline bool sanitize (hb_sanitize_context_t *c, unsigned int glyph_count) const
+  {
+    TRACE_SANITIZE (this);
+    if (!u.header.sanitize (c)) return_trace (false);
+    switch (u.header.indexFormat) {
+    case 1: return_trace (u.format1.sanitize (c, glyph_count));
+    case 3: return_trace (u.format3.sanitize (c, glyph_count));
+    default:return_trace (true);
+    }
+  }
+
+  inline bool get_extents (hb_glyph_extents_t *extents) const
+  {
+    switch (u.header.indexFormat) {
+    case 2: case 5: /* TODO */
+    case 1: case 3: case 4: /* Variable-metrics formats do not have metrics here. */
+    default:return (false);
+    }
+  }
+
+  bool get_image_data (unsigned int idx,
+		       unsigned int *offset,
+		       unsigned int *length,
+		       unsigned int *format) const
+  {
+    *format = u.header.imageFormat;
+    switch (u.header.indexFormat) {
+    case 1: return u.format1.get_image_data (idx, offset, length);
+    case 3: return u.format3.get_image_data (idx, offset, length);
+    default: return false;
+    }
+  }
+
+  protected:
+  union {
+  IndexSubtableHeader	header;
+  IndexSubtableFormat1	format1;
+  IndexSubtableFormat3	format3;
+  /* TODO: Format 2, 4, 5. */
+  } u;
+  public:
+  DEFINE_SIZE_UNION (8, header);
+};
+
+struct IndexSubtableRecord
+{
+  inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this) &&
+		  firstGlyphIndex <= lastGlyphIndex &&
+		  offsetToSubtable.sanitize (c, this, lastGlyphIndex - firstGlyphIndex + 1));
+  }
+
+  inline bool get_extents (hb_glyph_extents_t *extents) const
+  {
+    return (this+offsetToSubtable).get_extents (extents);
+  }
+
+  bool get_image_data (unsigned int gid,
+		       unsigned int *offset,
+		       unsigned int *length,
+		       unsigned int *format) const
+  {
+    if (gid < firstGlyphIndex || gid > lastGlyphIndex)
+    {
+      return false;
+    }
+    return (this+offsetToSubtable).get_image_data (gid - firstGlyphIndex,
+						   offset, length, format);
+  }
+
+  USHORT firstGlyphIndex;
+  USHORT lastGlyphIndex;
+  OffsetTo<IndexSubtable, ULONG> offsetToSubtable;
+
+  DEFINE_SIZE_STATIC(8);
+};
+
+struct IndexSubtableArray
+{
+  inline bool sanitize (hb_sanitize_context_t *c, unsigned int count) const
+  {
+    TRACE_SANITIZE (this);
+    if (unlikely (!c->check_array (&indexSubtablesZ, indexSubtablesZ[0].static_size, count)))
+      return_trace (false);
+    for (unsigned int i = 0; i < count; i++)
+      if (unlikely (!indexSubtablesZ[i].sanitize (c, this)))
+	return_trace (false);
+    return_trace (true);
+  }
+
+  public:
+  const IndexSubtableRecord* find_table (hb_codepoint_t glyph, unsigned int numTables) const
+  {
+    for (unsigned int i = 0; i < numTables; ++i)
+    {
+      unsigned int firstGlyphIndex = indexSubtablesZ[i].firstGlyphIndex;
+      unsigned int lastGlyphIndex = indexSubtablesZ[i].lastGlyphIndex;
+      if (firstGlyphIndex <= glyph && glyph <= lastGlyphIndex) {
+        return &indexSubtablesZ[i];
+      }
+    }
+    return NULL;
+  }
+
+  protected:
+  IndexSubtableRecord indexSubtablesZ[VAR];
+
+  public:
+  DEFINE_SIZE_ARRAY(0, indexSubtablesZ);
+};
+
+struct BitmapSizeTable
+{
+  friend struct CBLC;
+
+  inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this) &&
+		  indexSubtableArrayOffset.sanitize (c, base, numberOfIndexSubtables) &&
+		  c->check_range (&(base+indexSubtableArrayOffset), indexTablesSize) &&
+		  horizontal.sanitize (c) &&
+		  vertical.sanitize (c));
+  }
+
+  const IndexSubtableRecord *find_table (hb_codepoint_t glyph, const void *base) const
+  {
+    return (base+indexSubtableArrayOffset).find_table (glyph, numberOfIndexSubtables);
+  }
+
+  protected:
+  OffsetTo<IndexSubtableArray, ULONG> indexSubtableArrayOffset;
+  ULONG indexTablesSize;
+  ULONG numberOfIndexSubtables;
+  ULONG colorRef;
+  SBitLineMetrics horizontal;
+  SBitLineMetrics vertical;
+  USHORT startGlyphIndex;
+  USHORT endGlyphIndex;
+  BYTE ppemX;
+  BYTE ppemY;
+  BYTE bitDepth;
+  CHAR flags;
+
+public:
+  DEFINE_SIZE_STATIC(48);
+};
+
+
+/*
+ * Glyph Bitmap Data Formats.
+ */
+
+struct GlyphBitmapDataFormat17
+{
+  SmallGlyphMetrics glyphMetrics;
+  ULONG dataLen;
+  BYTE dataZ[VAR];
+
+  DEFINE_SIZE_ARRAY(9, dataZ);
+};
+
+
+/*
+ * CBLC -- Color Bitmap Location Table
+ */
+
+#define HB_OT_TAG_CBLC HB_TAG('C','B','L','C')
+
+struct CBLC
+{
+  static const hb_tag_t tableTag = HB_OT_TAG_CBLC;
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this) &&
+		  likely (version.major == 2 || version.major == 3) &&
+		  sizeTables.sanitize (c, this));
+  }
+
+  public:
+  const IndexSubtableRecord *find_table (hb_codepoint_t glyph,
+					 unsigned int *x_ppem, unsigned int *y_ppem) const
+  {
+    /* TODO: Make it possible to select strike. */
+
+    unsigned int count = sizeTables.len;
+    for (uint32_t i = 0; i < count; ++i)
+    {
+      unsigned int startGlyphIndex = sizeTables.array[i].startGlyphIndex;
+      unsigned int endGlyphIndex = sizeTables.array[i].endGlyphIndex;
+      if (startGlyphIndex <= glyph && glyph <= endGlyphIndex)
+      {
+	*x_ppem = sizeTables[i].ppemX;
+	*y_ppem = sizeTables[i].ppemY;
+	return sizeTables[i].find_table (glyph, this);
+      }
+    }
+
+    return NULL;
+  }
+
+  protected:
+  FixedVersion<>version;
+  ArrayOf<BitmapSizeTable, ULONG> sizeTables;
+
+  public:
+  DEFINE_SIZE_ARRAY(8, sizeTables);
+};
+
+/*
+ * CBDT -- Color Bitmap Data Table
+ */
+#define HB_OT_TAG_CBDT HB_TAG('C','B','D','T')
+
+struct CBDT
+{
+  static const hb_tag_t tableTag = HB_OT_TAG_CBDT;
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this) &&
+		  likely (version.major == 2 || version.major == 3));
+  }
+
+  protected:
+  FixedVersion<>version;
+  BYTE dataZ[VAR];
+
+  public:
+  DEFINE_SIZE_ARRAY(4, dataZ);
+};
+
+} /* namespace OT */
+
+#endif /* HB_OT_CBDT_TABLE_HH */

Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc	2016-12-06 01:02:38 UTC (rev 42642)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc	2016-12-06 05:59:31 UTC (rev 42643)
@@ -31,6 +31,7 @@
 #include "hb-font-private.hh"
 
 #include "hb-ot-cmap-table.hh"
+#include "hb-ot-cbdt-table.hh"
 #include "hb-ot-glyf-table.hh"
 #include "hb-ot-head-table.hh"
 #include "hb-ot-hhea-table.hh"
@@ -47,6 +48,7 @@
   unsigned short ascender;
   unsigned short descender;
   unsigned short line_gap;
+  bool has_font_extents;
 
   const OT::_mtx *table;
   hb_blob_t *blob;
@@ -54,9 +56,10 @@
   inline void init (hb_face_t *face,
 		    hb_tag_t _hea_tag,
 		    hb_tag_t _mtx_tag,
-		    hb_tag_t os2_tag)
+		    hb_tag_t os2_tag,
+		    unsigned int default_advance = 0)
   {
-    this->default_advance = face->get_upem ();
+    this->default_advance = default_advance ? default_advance : face->get_upem ();
 
     bool got_font_extents = false;
     if (os2_tag)
@@ -82,9 +85,12 @@
       this->ascender = _hea->ascender;
       this->descender = _hea->descender;
       this->line_gap = _hea->lineGap;
+      got_font_extents = (this->ascender | this->descender) != 0;
     }
     hb_blob_destroy (_hea_blob);
 
+    this->has_font_extents = got_font_extents;
+
     this->blob = OT::Sanitizer<OT::_mtx>::sanitize (face->reference_table (_mtx_tag));
 
     /* Cap num_metrics() and num_advances() based on table length. */
@@ -202,6 +208,91 @@
   }
 };
 
+struct hb_ot_face_cbdt_accelerator_t
+{
+  hb_blob_t *cblc_blob;
+  hb_blob_t *cbdt_blob;
+  const OT::CBLC *cblc;
+  const OT::CBDT *cbdt;
+
+  unsigned int cbdt_len;
+  float upem;
+
+  inline void init (hb_face_t *face)
+  {
+    upem = face->get_upem();
+
+    cblc_blob = OT::Sanitizer<OT::CBLC>::sanitize (face->reference_table (HB_OT_TAG_CBLC));
+    cbdt_blob = OT::Sanitizer<OT::CBDT>::sanitize (face->reference_table (HB_OT_TAG_CBDT));
+    cbdt_len = hb_blob_get_length (cbdt_blob);
+
+    if (hb_blob_get_length (cblc_blob) == 0) {
+      cblc = NULL;
+      cbdt = NULL;
+      return;  /* Not a bitmap font. */
+    }
+    cblc = OT::Sanitizer<OT::CBLC>::lock_instance (cblc_blob);
+    cbdt = OT::Sanitizer<OT::CBDT>::lock_instance (cbdt_blob);
+
+  }
+
+  inline void fini (void)
+  {
+    hb_blob_destroy (this->cblc_blob);
+    hb_blob_destroy (this->cbdt_blob);
+  }
+
+  inline bool get_extents (hb_codepoint_t glyph, hb_glyph_extents_t *extents) const
+  {
+    unsigned int x_ppem = upem, y_ppem = upem; /* TODO Use font ppem if available. */
+
+    if (cblc == NULL)
+      return false;  // Not a color bitmap font.
+
+    const OT::IndexSubtableRecord *subtable_record = this->cblc->find_table(glyph, &x_ppem, &y_ppem);
+    if (subtable_record == NULL)
+      return false;
+
+    if (subtable_record->get_extents (extents))
+      return true;
+
+    unsigned int image_offset = 0, image_length = 0, image_format = 0;
+    if (!subtable_record->get_image_data (glyph, &image_offset, &image_length, &image_format))
+      return false;
+
+    {
+      /* TODO Move the following into CBDT struct when adding more formats. */
+
+      if (unlikely (image_offset > cbdt_len || cbdt_len - image_offset < image_length))
+	return false;
+
+      switch (image_format)
+      {
+	case 17: {
+	  if (unlikely (image_length < OT::GlyphBitmapDataFormat17::min_size))
+	    return false;
+
+	  const OT::GlyphBitmapDataFormat17& glyphFormat17 =
+	      OT::StructAtOffset<OT::GlyphBitmapDataFormat17> (this->cbdt, image_offset);
+	  glyphFormat17.glyphMetrics.get_extents (extents);
+	}
+	break;
+	default:
+	  // TODO: Support other image formats.
+	  return false;
+      }
+    }
+
+    /* Convert to the font units. */
+    extents->x_bearing *= upem / (float) x_ppem;
+    extents->y_bearing *= upem / (float) y_ppem;
+    extents->width *= upem / (float) x_ppem;
+    extents->height *= upem / (float) y_ppem;
+
+    return true;
+  }
+};
+
 typedef bool (*hb_cmap_get_glyph_func_t) (const void *obj,
 					  hb_codepoint_t codepoint,
 					  hb_codepoint_t *glyph);
@@ -374,6 +465,7 @@
   hb_ot_face_metrics_accelerator_t h_metrics;
   hb_ot_face_metrics_accelerator_t v_metrics;
   hb_lazy_loader_t<hb_ot_face_glyf_accelerator_t> glyf;
+  hb_lazy_loader_t<hb_ot_face_cbdt_accelerator_t> cbdt;
 };
 
 
@@ -387,8 +479,10 @@
 
   ot_font->cmap.init (face);
   ot_font->h_metrics.init (face, HB_OT_TAG_hhea, HB_OT_TAG_hmtx, HB_OT_TAG_os2);
-  ot_font->v_metrics.init (face, HB_OT_TAG_vhea, HB_OT_TAG_vmtx, HB_TAG_NONE); /* TODO Can we do this lazily? */
+  ot_font->v_metrics.init (face, HB_OT_TAG_vhea, HB_OT_TAG_vmtx, HB_TAG_NONE,
+			   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);
 
   return ot_font;
 }
@@ -400,6 +494,7 @@
   ot_font->h_metrics.fini ();
   ot_font->v_metrics.fini ();
   ot_font->glyf.fini ();
+  ot_font->cbdt.fini ();
 
   free (ot_font);
 }
@@ -458,6 +553,8 @@
 {
   const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
   bool ret = ot_font->glyf->get_extents (glyph, extents);
+  if (!ret)
+    ret = ot_font->cbdt->get_extents (glyph, extents);
   extents->x_bearing = font->em_scale_x (extents->x_bearing);
   extents->y_bearing = font->em_scale_y (extents->y_bearing);
   extents->width     = font->em_scale_x (extents->width);
@@ -475,7 +572,7 @@
   metrics->ascender = font->em_scale_y (ot_font->h_metrics.ascender);
   metrics->descender = font->em_scale_y (ot_font->h_metrics.descender);
   metrics->line_gap = font->em_scale_y (ot_font->h_metrics.line_gap);
-  return true;
+  return ot_font->h_metrics.has_font_extents;
 }
 
 static hb_bool_t
@@ -488,7 +585,7 @@
   metrics->ascender = font->em_scale_x (ot_font->v_metrics.ascender);
   metrics->descender = font->em_scale_x (ot_font->v_metrics.descender);
   metrics->line_gap = font->em_scale_x (ot_font->v_metrics.line_gap);
-  return true;
+  return ot_font->v_metrics.has_font_extents;
 }
 
 static hb_font_funcs_t *static_ot_funcs = NULL;

Modified: trunk/Build/source/libs/harfbuzz/version.ac
===================================================================
--- trunk/Build/source/libs/harfbuzz/version.ac	2016-12-06 01:02:38 UTC (rev 42642)
+++ trunk/Build/source/libs/harfbuzz/version.ac	2016-12-06 05:59:31 UTC (rev 42643)
@@ -8,4 +8,4 @@
 dnl --------------------------------------------------------
 dnl
 dnl  m4-include this file to define the current harfbuzz version
-m4_define([harfbuzz_version], [1.3.3])
+m4_define([harfbuzz_version], [1.3.4])



More information about the tex-live-commits mailing list