Merge branch 'master' into var-subset

This commit is contained in:
Michiharu Ariza 2019-03-15 10:12:19 -07:00
commit 079c386ca8
6 changed files with 64 additions and 27 deletions

17
.ci/build-freetype.sh Normal file
View File

@ -0,0 +1,17 @@
#!/bin/bash
set -x
set -o errexit -o nounset
# 22.0.16 is the libtool version of 2.9.0
if pkg-config --atleast-version 22.0.16 freetype2; then exit; fi
pushd $HOME
wget http://download.savannah.gnu.org/releases/freetype/freetype-2.9.tar.bz2
tar xf freetype-2.9.tar.bz2
pushd freetype-2.9
./autogen.sh
./configure --prefix=$HOME/.local
make -j4 install
popd
popd

View File

@ -16,9 +16,10 @@ matrix:
- os: linux - os: linux
compiler: gcc compiler: gcc
script: script:
# Remove these two lines when Travis updated its distro # Remove the following three lines when Travis updates its distro
- wget http://download.savannah.gnu.org/releases/freetype/freetype-2.9.tar.bz2 && tar xf freetype-2.9.tar.bz2 && cd freetype-2.9 && ./autogen.sh && ./configure && make -j4 && cd .. - export PKG_CONFIG_PATH="$HOME/.local/lib/pkgconfig"
- export LD_LIBRARY_PATH="$PWD/freetype-2.9/objs/.libs" - export LD_LIBRARY_PATH="$HOME/.local/lib"
- bash .ci/build-freetype.sh
- ./autogen.sh - ./autogen.sh
- ./configure $CONFIGURE_OPTS --enable-gtk-doc --enable-code-coverage - ./configure $CONFIGURE_OPTS --enable-gtk-doc --enable-code-coverage
@ -34,9 +35,10 @@ matrix:
- os: linux - os: linux
compiler: clang compiler: clang
script: script:
# Remove these two lines when Travis updated its distro # Remove the following three lines when Travis updates its distro
- wget http://download.savannah.gnu.org/releases/freetype/freetype-2.9.tar.bz2 && tar xf freetype-2.9.tar.bz2 && cd freetype-2.9 && ./autogen.sh && ./configure && make -j4 && cd .. - export PKG_CONFIG_PATH="$HOME/.local/lib/pkgconfig"
- export LD_LIBRARY_PATH="$PWD/freetype-2.9/objs/.libs" - export LD_LIBRARY_PATH="$HOME/.local/lib"
- bash .ci/build-freetype.sh
- ./autogen.sh - ./autogen.sh
- ./configure $CONFIGURE_OPTS - ./configure $CONFIGURE_OPTS
@ -46,13 +48,7 @@ matrix:
- os: osx - os: osx
compiler: clang compiler: clang
install: install:
- brew update; - brew link --force icu4c
# Workaround Travis/brew bug
- brew uninstall libtool && brew install libtool
- brew install ragel freetype glib gobject-introspection cairo graphite2 || true
- brew upgrade icu4c || true
- export PATH="/usr/local/opt/icu4c/sbin:/usr/local/opt/icu4c/bin:$PATH"
- export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig"
script: script:
- ./autogen.sh - ./autogen.sh
- ./configure $CONFIGURE_OPTS --with-coretext - ./configure $CONFIGURE_OPTS --with-coretext
@ -63,6 +59,10 @@ notifications:
irc: "irc.freenode.org#harfbuzz" irc: "irc.freenode.org#harfbuzz"
email: harfbuzz-bots-chatter@googlegroups.com email: harfbuzz-bots-chatter@googlegroups.com
cache:
directories:
- /home/travis/.local
addons: addons:
apt: apt:
packages: packages:
@ -76,6 +76,14 @@ addons:
- libicu-dev # for extra unicode functions - libicu-dev # for extra unicode functions
- libgraphite2-dev # for extra shapers - libgraphite2-dev # for extra shapers
#- libgirepository1.0-dev # for gobject-introspection #- libgirepository1.0-dev # for gobject-introspection
homebrew:
packages:
- cairo
- freetype
- glib
- graphite2
- icu4c
#- gobject-introspection
coverity_scan: coverity_scan:
project: project:

View File

@ -329,13 +329,15 @@ struct hb_sanitize_context_t :
unsigned int len) const unsigned int len) const
{ {
const char *p = (const char *) base; const char *p = (const char *) base;
bool ok = this->start <= p && bool ok = !len ||
(this->start <= p &&
p <= this->end && p <= this->end &&
(unsigned int) (this->end - p) >= len && (unsigned int) (this->end - p) >= len &&
this->max_ops-- > 0; this->max_ops-- > 0);
DEBUG_MSG_LEVEL (SANITIZE, p, this->debug_depth+1, 0, DEBUG_MSG_LEVEL (SANITIZE, p, this->debug_depth+1, 0,
"check_range [%p..%p] (%d bytes) in [%p..%p] -> %s", "check_range [%p..%p]"
" (%d bytes) in [%p..%p] -> %s",
p, p + len, len, p, p + len, len,
this->start, this->end, this->start, this->end,
ok ? "OK" : "OUT-OF-RANGE"); ok ? "OK" : "OUT-OF-RANGE");

View File

@ -362,6 +362,7 @@ set_indic_properties (hb_glyph_info_t &info)
else if (unlikely (u == 0x0AFBu)) cat = OT_N; /* https://github.com/harfbuzz/harfbuzz/issues/552 */ else if (unlikely (u == 0x0AFBu)) cat = OT_N; /* https://github.com/harfbuzz/harfbuzz/issues/552 */
else if (unlikely (u == 0x0980u)) cat = OT_PLACEHOLDER; /* https://github.com/harfbuzz/harfbuzz/issues/538 */ else if (unlikely (u == 0x0980u)) cat = OT_PLACEHOLDER; /* https://github.com/harfbuzz/harfbuzz/issues/538 */
else if (unlikely (u == 0x09FCu)) cat = OT_PLACEHOLDER; /* https://github.com/harfbuzz/harfbuzz/pull/1613 */
else if (unlikely (u == 0x0C80u)) cat = OT_PLACEHOLDER; /* https://github.com/harfbuzz/harfbuzz/pull/623 */ else if (unlikely (u == 0x0C80u)) cat = OT_PLACEHOLDER; /* https://github.com/harfbuzz/harfbuzz/pull/623 */
else if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x2010u, 0x2011u))) else if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x2010u, 0x2011u)))
cat = OT_PLACEHOLDER; cat = OT_PLACEHOLDER;

BIN
test/api/fonts/Zycon.ttf Normal file

Binary file not shown.

View File

@ -110,12 +110,21 @@ test_ot_face_empty (void)
test_face (hb_face_get_empty (), 0); test_face (hb_face_get_empty (), 0);
} }
static void
test_ot_var_axis_on_zero_named_instance ()
{
hb_face_t *face = hb_test_open_font_file ("fonts/Zycon.ttf");
g_assert (hb_ot_var_get_axis_count (face));
hb_face_destroy (face);
}
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
hb_test_init (&argc, &argv); hb_test_init (&argc, &argv);
hb_test_add (test_ot_face_empty); hb_test_add (test_ot_face_empty);
hb_test_add (test_ot_var_axis_on_zero_named_instance);
return hb_test_run(); return hb_test_run();
} }