[HarfBuzz] harfbuzz: Branch 'master' - 9 commits
Behdad Esfahbod
behdad at kemper.freedesktop.org
Thu Oct 4 10:19:48 UTC 2018
.circleci/config.yml | 2
.travis.yml | 2
configure.ac | 4 -
src/dump-emoji.cc | 2
src/hb-aat-layout-morx-table.hh | 9 ++
src/hb-aat-layout.cc | 6 +
src/hb-aat-layout.hh | 2
src/hb-common.cc | 2
src/hb-graphite2.cc | 28 ++++++++
src/hb-ot-shape.cc | 23 +++++--
src/hb-ot-shape.hh | 5 +
src/hb-ot-var-fvar-table.hh | 2
test/shaping/data/text-rendering-tests/DISABLED | 32 ----------
test/shaping/data/text-rendering-tests/Makefile.sources | 16 +++--
test/shaping/data/text-rendering-tests/extract-tests.py | 18 ++++-
test/shaping/data/text-rendering-tests/fonts/TestGSUBThree.ttf |binary
test/shaping/data/text-rendering-tests/fonts/TestMORXThirtyfour.ttf |binary
test/shaping/data/text-rendering-tests/fonts/TestMORXThirtythree.ttf |binary
test/shaping/data/text-rendering-tests/fonts/TestMORXTwentyfour.ttf |binary
test/shaping/data/text-rendering-tests/tests/GSUB-3.tests | 1
test/shaping/data/text-rendering-tests/tests/MORX-24.tests | 1
test/shaping/data/text-rendering-tests/tests/MORX-32.tests | 8 +-
test/shaping/data/text-rendering-tests/tests/MORX-33.tests | 3
test/shaping/data/text-rendering-tests/tests/MORX-34.tests | 1
test/shaping/run-tests.py | 15 ++--
25 files changed, 115 insertions(+), 67 deletions(-)
New commits:
commit 55468ca01b4cdf274900fb752fbf9ae05a78705e
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Thu Oct 4 12:13:55 2018 +0200
[test/text-rendering-tests] Update from upstream
diff --git a/test/shaping/data/text-rendering-tests/Makefile.sources b/test/shaping/data/text-rendering-tests/Makefile.sources
index 6fe174e4..79f22adb 100644
--- a/test/shaping/data/text-rendering-tests/Makefile.sources
+++ b/test/shaping/data/text-rendering-tests/Makefile.sources
@@ -15,6 +15,7 @@ TESTS = \
tests/GPOS-5.tests \
tests/GSUB-1.tests \
tests/GSUB-2.tests \
+ tests/GSUB-3.tests \
tests/GVAR-1.tests \
tests/GVAR-2.tests \
tests/GVAR-3.tests \
@@ -42,6 +43,7 @@ TESTS = \
tests/MORX-21.tests \
tests/MORX-22.tests \
tests/MORX-23.tests \
+ tests/MORX-24.tests \
tests/MORX-25.tests \
tests/MORX-26.tests \
tests/MORX-27.tests \
@@ -50,6 +52,9 @@ TESTS = \
tests/MORX-2.tests \
tests/MORX-30.tests \
tests/MORX-31.tests \
+ tests/MORX-32.tests \
+ tests/MORX-33.tests \
+ tests/MORX-34.tests \
tests/MORX-3.tests \
tests/MORX-4.tests \
tests/MORX-5.tests \
@@ -68,5 +73,4 @@ DISBALED_TESTS = \
tests/SHBALI-2.tests \
tests/SHKNDA-2.tests \
tests/SHKNDA-3.tests \
- tests/MORX-32.tests \
$(NULL)
diff --git a/test/shaping/data/text-rendering-tests/extract-tests.py b/test/shaping/data/text-rendering-tests/extract-tests.py
index 2292cf45..27d56861 100755
--- a/test/shaping/data/text-rendering-tests/extract-tests.py
+++ b/test/shaping/data/text-rendering-tests/extract-tests.py
@@ -28,6 +28,7 @@ def glyphstr(glyphs):
html = ET.fromstring(sys.stdin.read())
found = False
+
for elt in html.findall(".//*[@class='expected'][@ft:id]", namespaces):
found = True
name = elt.get(ns('ft:id'))
@@ -47,4 +48,15 @@ for elt in html.findall(".//*[@class='expected'][@ft:id]", namespaces):
opts = opts + ' --variations=%s' % variations
print ("../fonts/%s:%s:%s:%s" % (font, opts, unistr(text), glyphstr(glyphs)))
+for elt in html.findall(".//*[@class='should-not-crash'][@ft:id]", namespaces):
+ found = True
+ name = elt.get(ns('ft:id'))
+ text = elt.get(ns('ft:render'))
+ font = elt.get(ns('ft:font'))
+ variations = elt.get(ns('ft:var'), '').replace(':', '=').replace(';', ',')
+ opts = ''
+ if variations:
+ opts = '--variations=%s' % variations
+ print ("../fonts/%s:%s:%s:*" % (font, opts, unistr(text)))
+
sys.exit(0 if found else 1)
diff --git a/test/shaping/data/text-rendering-tests/fonts/TestGSUBThree.ttf b/test/shaping/data/text-rendering-tests/fonts/TestGSUBThree.ttf
new file mode 100644
index 00000000..8fce4ac4
Binary files /dev/null and b/test/shaping/data/text-rendering-tests/fonts/TestGSUBThree.ttf differ
diff --git a/test/shaping/data/text-rendering-tests/fonts/TestMORXThirtyfour.ttf b/test/shaping/data/text-rendering-tests/fonts/TestMORXThirtyfour.ttf
new file mode 100644
index 00000000..a70dadcc
Binary files /dev/null and b/test/shaping/data/text-rendering-tests/fonts/TestMORXThirtyfour.ttf differ
diff --git a/test/shaping/data/text-rendering-tests/fonts/TestMORXThirtythree.ttf b/test/shaping/data/text-rendering-tests/fonts/TestMORXThirtythree.ttf
new file mode 100644
index 00000000..5cab73e5
Binary files /dev/null and b/test/shaping/data/text-rendering-tests/fonts/TestMORXThirtythree.ttf differ
diff --git a/test/shaping/data/text-rendering-tests/fonts/TestMORXTwentyfour.ttf b/test/shaping/data/text-rendering-tests/fonts/TestMORXTwentyfour.ttf
new file mode 100644
index 00000000..271dddb0
Binary files /dev/null and b/test/shaping/data/text-rendering-tests/fonts/TestMORXTwentyfour.ttf differ
diff --git a/test/shaping/data/text-rendering-tests/tests/GSUB-3.tests b/test/shaping/data/text-rendering-tests/tests/GSUB-3.tests
new file mode 100644
index 00000000..c2f7e6ef
--- /dev/null
+++ b/test/shaping/data/text-rendering-tests/tests/GSUB-3.tests
@@ -0,0 +1 @@
+../fonts/TestGSUBThree.ttf::U+006C,U+006F,U+006C:*
diff --git a/test/shaping/data/text-rendering-tests/tests/MORX-24.tests b/test/shaping/data/text-rendering-tests/tests/MORX-24.tests
new file mode 100644
index 00000000..79a3d7bb
--- /dev/null
+++ b/test/shaping/data/text-rendering-tests/tests/MORX-24.tests
@@ -0,0 +1 @@
+../fonts/TestMORXTwentyfour.ttf::U+0041,U+0042,U+0043,U+0044,U+0045:*
diff --git a/test/shaping/data/text-rendering-tests/tests/MORX-32.tests b/test/shaping/data/text-rendering-tests/tests/MORX-32.tests
index 6f3ae888..87c11525 100644
--- a/test/shaping/data/text-rendering-tests/tests/MORX-32.tests
+++ b/test/shaping/data/text-rendering-tests/tests/MORX-32.tests
@@ -1,4 +1,4 @@
-../fonts/TestMORXThirtytwo.ttf:--font-size=1000 --ned --remove-default-ignorables --font-funcs=ft:U+0041:[I|N at 830,0|S at 1660,0|A at 2490,0]
-../fonts/TestMORXThirtytwo.ttf:--font-size=1000 --ned --remove-default-ignorables --font-funcs=ft:U+0058,U+0041,U+0059:[I|N at 830,0|S at 1660,0|X at 2490,0|A at 2854,0|Y at 3684,0]
-../fonts/TestMORXThirtytwo.ttf:--font-size=1000 --ned --remove-default-ignorables --font-funcs=ft:U+0042:[B|I at 830,0|N at 1660,0|S at 2490,0]
-../fonts/TestMORXThirtytwo.ttf:--font-size=1000 --ned --remove-default-ignorables --font-funcs=ft:U+0058,U+0042,U+0059:[X|I at 364,0|N at 1194,0|S at 2024,0|B at 2854,0|Y at 3684,0]
+../fonts/TestMORXThirtytwo.ttf:--font-size=1000 --ned --remove-default-ignorables --font-funcs=ft:U+0041:[A]
+../fonts/TestMORXThirtytwo.ttf:--font-size=1000 --ned --remove-default-ignorables --font-funcs=ft:U+0058,U+0041,U+0059:[X|A at 364,0|Y at 1194,0]
+../fonts/TestMORXThirtytwo.ttf:--font-size=1000 --ned --remove-default-ignorables --font-funcs=ft:U+0042:[B]
+../fonts/TestMORXThirtytwo.ttf:--font-size=1000 --ned --remove-default-ignorables --font-funcs=ft:U+0058,U+0042,U+0059:[X|B at 364,0|Y at 1194,0]
diff --git a/test/shaping/data/text-rendering-tests/tests/MORX-33.tests b/test/shaping/data/text-rendering-tests/tests/MORX-33.tests
new file mode 100644
index 00000000..17d080a6
--- /dev/null
+++ b/test/shaping/data/text-rendering-tests/tests/MORX-33.tests
@@ -0,0 +1,3 @@
+../fonts/TestMORXThirtythree.ttf:--font-size=1000 --ned --remove-default-ignorables --font-funcs=ft:U+0068,U+0061:[h|a at 618,0|h at 1179,0|a at 1797,0]
+../fonts/TestMORXThirtythree.ttf:--font-size=1000 --ned --remove-default-ignorables --font-funcs=ft:U+0068,U+0061,U+0068,U+0061:[h|a at 618,0|h at 1179,0|a at 1797,0|h at 2358,0|a at 2976,0|h at 3537,0|a at 4155,0]
+../fonts/TestMORXThirtythree.ttf:--font-size=1000 --ned --remove-default-ignorables --font-funcs=ft:U+0061,U+0068:[a|h at 561,0]
diff --git a/test/shaping/data/text-rendering-tests/tests/MORX-34.tests b/test/shaping/data/text-rendering-tests/tests/MORX-34.tests
new file mode 100644
index 00000000..8c309df8
--- /dev/null
+++ b/test/shaping/data/text-rendering-tests/tests/MORX-34.tests
@@ -0,0 +1 @@
+../fonts/TestMORXThirtyfour.ttf::U+0068,U+0061:*
diff --git a/test/shaping/run-tests.py b/test/shaping/run-tests.py
index ffe622a2..5592aea5 100755
--- a/test/shaping/run-tests.py
+++ b/test/shaping/run-tests.py
@@ -19,8 +19,6 @@ if not args or sys.argv[1].find('hb-shape') == -1 or not os.path.exists (sys.arg
sys.exit (1)
hb_shape, args = args[0], args[1:]
-extra_options = "--verify"
-
fails = 0
reference = False
@@ -48,6 +46,11 @@ for filename in args:
cwd = os.path.dirname(filename)
fontfile = os.path.normpath (os.path.join (cwd, fontfile))
+ extra_options = []
+ glyphs_expected = glyphs_expected.strip()
+ if glyphs_expected != '*':
+ extra_options.append("--verify")
+
if line.startswith ("#"):
if not reference:
print ("# %s %s --unicodes %s" % (hb_shape, fontfile, unicodes))
@@ -55,10 +58,10 @@ for filename in args:
if not reference:
print ("%s %s %s %s --unicodes %s" %
- (hb_shape, fontfile, extra_options, options, unicodes))
+ (hb_shape, fontfile, ' '.join(extra_options), options, unicodes))
glyphs1, returncode = cmd ([hb_shape, "--font-funcs=ft",
- fontfile, extra_options, "--unicodes",
+ fontfile] + extra_options + ["--unicodes",
unicodes] + (options.split (' ') if options else []))
if returncode:
@@ -67,7 +70,7 @@ for filename in args:
#continue
glyphs2, returncode = cmd ([hb_shape, "--font-funcs=ot",
- fontfile, extra_options, "--unicodes",
+ fontfile] + extra_options + ["--unicodes",
unicodes] + (options.split (' ') if options else []))
if returncode:
@@ -84,7 +87,7 @@ for filename in args:
print (":".join ([fontfile, options, unicodes, glyphs1]))
continue
- if glyphs1.strip() != glyphs_expected.strip() and glyphs_expected.strip() != '*':
+ if glyphs1.strip() != glyphs_expected and glyphs_expected != '*':
print ("Actual: " + glyphs1) # file=sys.stderr
print ("Expected: " + glyphs_expected) # file=sys.stderr
fails = fails + 1
commit 6ff8a8a10b62a54a87d53b0af66ccaba5d58b107
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Thu Oct 4 12:09:45 2018 +0200
Minor
diff --git a/test/shaping/data/text-rendering-tests/extract-tests.py b/test/shaping/data/text-rendering-tests/extract-tests.py
index 36963e5e..2292cf45 100755
--- a/test/shaping/data/text-rendering-tests/extract-tests.py
+++ b/test/shaping/data/text-rendering-tests/extract-tests.py
@@ -33,7 +33,7 @@ for elt in html.findall(".//*[@class='expected'][@ft:id]", namespaces):
name = elt.get(ns('ft:id'))
text = elt.get(ns('ft:render'))
font = elt.get(ns('ft:font'))
- vars = elt.get(ns('ft:var'), '').replace(':', '=').replace(';', ',')
+ variations = elt.get(ns('ft:var'), '').replace(':', '=').replace(';', ',')
glyphs = []
for use in elt.findall(".//use"):
x = int(use.get('x'))
@@ -43,8 +43,8 @@ for elt in html.findall(".//*[@class='expected'][@ft:id]", namespaces):
glyphname = '.'.join(href[1:].split('/')[1].split('.')[1:])
glyphs.append((glyphname, x, y))
opts = '--font-size=1000 --ned --remove-default-ignorables --font-funcs=ft'
- if vars:
- opts = opts + ' --variations=%s' % vars
+ if variations:
+ opts = opts + ' --variations=%s' % variations
print ("../fonts/%s:%s:%s:%s" % (font, opts, unistr(text), glyphstr(glyphs)))
sys.exit(0 if found else 1)
commit 14ff3cbe0f30dea24e1bb175b1e8e41039f6afdc
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Thu Oct 4 11:34:21 2018 +0200
Apply morx if there's no GSUB!
diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc
index 748af969..9e87b300 100644
--- a/src/hb-ot-shape.cc
+++ b/src/hb-ot-shape.cc
@@ -63,9 +63,14 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan,
plan.kerning_requested = !!plan.kern_mask;
plan.has_gpos_mark = !!plan.map.get_1_mask (HB_TAG ('m','a','r','k'));
+ plan.apply_morx = !hb_ot_layout_has_substitution (face) &&
+ hb_aat_layout_has_substitution (face);
+
bool disable_gpos = plan.shaper->gpos_tag &&
plan.shaper->gpos_tag != plan.map.chosen_script[1];
- plan.fallback_positioning = disable_gpos || !hb_ot_layout_has_positioning (face);
+ plan.apply_gpos = !disable_gpos && hb_ot_layout_has_positioning (face);
+
+ plan.fallback_positioning = !plan.apply_gpos;
plan.fallback_glyph_classes = !hb_ot_layout_has_glyph_classes (face);
}
@@ -217,7 +222,13 @@ _hb_ot_shaper_shape_plan_data_create (hb_shape_plan_t *shape_plan,
hb_ot_shape_planner_t planner (shape_plan);
- planner.shaper = hb_ot_shape_complex_categorize (&planner);
+ /* Ugly that we have to do this here...
+ * If we are going to apply morx, choose default shaper. */
+ if (!hb_ot_layout_has_substitution (planner.face) &&
+ hb_aat_layout_has_substitution (planner.face))
+ planner.shaper = &_hb_ot_complex_shaper_default;
+ else
+ planner.shaper = hb_ot_shape_complex_categorize (&planner);
hb_ot_shape_collect_features (&planner, &shape_plan->props,
user_features, num_user_features);
@@ -661,10 +672,10 @@ hb_ot_substitute_complex (hb_ot_shape_context_t *c)
if (c->plan->fallback_glyph_classes)
hb_synthesize_glyph_classes (c);
- c->plan->substitute (c->font, buffer);
-
- if (0) /* XXX Call morx instead. */
+ if (unlikely (c->plan->apply_morx))
hb_aat_layout_substitute (c->font, c->buffer);
+ else
+ c->plan->substitute (c->font, buffer);
}
static inline void
@@ -784,7 +795,7 @@ hb_ot_position_complex (hb_ot_shape_context_t *c)
break;
}
- if (likely (!c->plan->fallback_positioning))
+ if (c->plan->apply_gpos)
c->plan->position (c->font, c->buffer);
switch (c->plan->shaper->zero_width_marks)
diff --git a/src/hb-ot-shape.hh b/src/hb-ot-shape.hh
index 88c72dc1..23c385aa 100644
--- a/src/hb-ot-shape.hh
+++ b/src/hb-ot-shape.hh
@@ -49,6 +49,11 @@ struct hb_ot_shape_plan_t
bool fallback_positioning : 1;
bool fallback_glyph_classes : 1;
+ bool apply_morx : 1;
+
+ bool apply_gpos : 1;
+
+
inline void collect_lookups (hb_tag_t table_tag, hb_set_t *lookups) const
{
unsigned int table_index;
diff --git a/test/shaping/data/text-rendering-tests/DISABLED b/test/shaping/data/text-rendering-tests/DISABLED
index 1ce62e07..8539c0ee 100644
--- a/test/shaping/data/text-rendering-tests/DISABLED
+++ b/test/shaping/data/text-rendering-tests/DISABLED
@@ -1,38 +1,6 @@
# Non-Unicode cmap
tests/CMAP-3.tests
-# Not hooked up
-tests/MORX-1.tests
-tests/MORX-2.tests
-tests/MORX-3.tests
-tests/MORX-4.tests
-tests/MORX-5.tests
-tests/MORX-6.tests
-tests/MORX-7.tests
-tests/MORX-8.tests
-tests/MORX-9.tests
-tests/MORX-10.tests
-tests/MORX-11.tests
-tests/MORX-12.tests
-tests/MORX-13.tests
-tests/MORX-14.tests
-tests/MORX-16.tests
-tests/MORX-17.tests
-tests/MORX-18.tests
-tests/MORX-19.tests
-tests/MORX-20.tests
-tests/MORX-21.tests
-tests/MORX-22.tests
-tests/MORX-23.tests
-tests/MORX-25.tests
-tests/MORX-26.tests
-tests/MORX-27.tests
-tests/MORX-28.tests
-tests/MORX-29.tests
-tests/MORX-30.tests
-tests/MORX-31.tests
-tests/MORX-32.tests
-
# Rounding differences
tests/SHARAN-1.tests
tests/SHBALI-1.tests
diff --git a/test/shaping/data/text-rendering-tests/Makefile.sources b/test/shaping/data/text-rendering-tests/Makefile.sources
index 5c8cd03f..6fe174e4 100644
--- a/test/shaping/data/text-rendering-tests/Makefile.sources
+++ b/test/shaping/data/text-rendering-tests/Makefile.sources
@@ -28,12 +28,6 @@ TESTS = \
tests/HVAR-2.tests \
tests/KERN-1.tests \
tests/KERN-2.tests \
- tests/SHBALI-3.tests \
- tests/SHKNDA-1.tests \
- $(NULL)
-
-DISBALED_TESTS = \
- tests/CMAP-3.tests \
tests/MORX-10.tests \
tests/MORX-11.tests \
tests/MORX-12.tests \
@@ -56,7 +50,6 @@ DISBALED_TESTS = \
tests/MORX-2.tests \
tests/MORX-30.tests \
tests/MORX-31.tests \
- tests/MORX-32.tests \
tests/MORX-3.tests \
tests/MORX-4.tests \
tests/MORX-5.tests \
@@ -64,9 +57,16 @@ DISBALED_TESTS = \
tests/MORX-7.tests \
tests/MORX-8.tests \
tests/MORX-9.tests \
+ tests/SHBALI-3.tests \
+ tests/SHKNDA-1.tests \
+ $(NULL)
+
+DISBALED_TESTS = \
+ tests/CMAP-3.tests \
tests/SHARAN-1.tests \
tests/SHBALI-1.tests \
tests/SHBALI-2.tests \
tests/SHKNDA-2.tests \
tests/SHKNDA-3.tests \
+ tests/MORX-32.tests \
$(NULL)
commit 3417037eb13a59dce6add0b1691ddb1b2b54c1e4
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Thu Oct 4 11:08:15 2018 +0200
[aat] Add +hb_aat_layout_has_substitution
diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh
index 85f1f579..e9869036 100644
--- a/src/hb-aat-layout-morx-table.hh
+++ b/src/hb-aat-layout-morx-table.hh
@@ -947,6 +947,8 @@ struct morx
{
static const hb_tag_t tableTag = HB_AAT_TAG_morx;
+ inline bool has_data (void) const { return version != 0; }
+
inline void apply (hb_aat_apply_context_t *c) const
{
if (unlikely (!c->buffer->successful)) return;
diff --git a/src/hb-aat-layout.cc b/src/hb-aat-layout.cc
index a5e36a40..faf418d6 100644
--- a/src/hb-aat-layout.cc
+++ b/src/hb-aat-layout.cc
@@ -55,6 +55,12 @@ _get_morx (hb_face_t *face, hb_blob_t **blob = nullptr)
return morx;
}
+hb_bool_t
+hb_aat_layout_has_substitution (hb_face_t *face)
+{
+ return _get_morx (face).has_data ();
+}
+
void
hb_aat_layout_substitute (hb_font_t *font, hb_buffer_t *buffer)
{
diff --git a/src/hb-aat-layout.hh b/src/hb-aat-layout.hh
index ac9c5353..553832f1 100644
--- a/src/hb-aat-layout.hh
+++ b/src/hb-aat-layout.hh
@@ -33,6 +33,8 @@
#include "hb-buffer.hh"
#include "hb-open-type.hh"
+HB_INTERNAL hb_bool_t
+hb_aat_layout_has_substitution (hb_face_t *face);
HB_INTERNAL void
hb_aat_layout_substitute (hb_font_t *font, hb_buffer_t *buffer);
commit 1f14107f71a6c3da8270ed21c3588f945fa91733
Author: Sascha Brawer <sascha at brawer.ch>
Date: Thu Oct 4 09:17:08 2018 +0200
Minor: Fix autoconf warning
Before this change, autoconf was emitting the following warnings:
```
configure.ac:22: warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
../../lib/autoconf/specific.m4:368: AC_USE_SYSTEM_EXTENSIONS is expanded from...
configure.ac:22: the top level
configure.ac:22: warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
../../lib/autoconf/specific.m4:368: AC_USE_SYSTEM_EXTENSIONS is expanded from...
configure.ac:22: the top level
configure.ac:22: warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
../../lib/autoconf/specific.m4:368: AC_USE_SYSTEM_EXTENSIONS is expanded from...
configure.ac:22: the top level
configure.ac:22: warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
../../lib/autoconf/specific.m4:368: AC_USE_SYSTEM_EXTENSIONS is expanded from...
configure.ac:22: the top level
configure.ac:22: warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
../../lib/autoconf/specific.m4:368: AC_USE_SYSTEM_EXTENSIONS is expanded from...
configure.ac:22: the top level
configure.ac:22: warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
../../lib/autoconf/specific.m4:368: AC_USE_SYSTEM_EXTENSIONS is expanded from...
configure.ac:22: the top level
configure.ac:22: warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
../../lib/autoconf/specific.m4:368: AC_USE_SYSTEM_EXTENSIONS is expanded from...
configure.ac:22: the top level
configure.ac:22: warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
../../lib/autoconf/specific.m4:368: AC_USE_SYSTEM_EXTENSIONS is expanded from...
configure.ac:22: the top level
```
diff --git a/configure.ac b/configure.ac
index 4ebb21df..3aa41ff2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,6 +12,7 @@ AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([1.13.0 gnits tar-ustar dist-bzip2 no-dist-gzip -Wall no-define color-tests -Wno-portability])
AM_SILENT_RULES([yes])
AX_CODE_COVERAGE
+AC_USE_SYSTEM_EXTENSIONS
# Initialize libtool
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
@@ -19,7 +20,6 @@ LT_PREREQ([2.2])
LT_INIT([disable-static])
# Check for programs
-AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CC
AC_PROG_CC_C99
AM_PROG_CC_C_O
commit 7810bb1a59ea71afeed7ea489400801ebdf642e4
Author: Sascha Brawer <sascha at brawer.ch>
Date: Thu Oct 4 09:24:08 2018 +0200
[morx] Only insert glyphs at mark when a mark has been set before
This reverts commit f4072e8cb81072cd6d51a2607efedb76c02e7db1.
https://github.com/harfbuzz/harfbuzz/issues/1195
diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh
index c58e6744..85f1f579 100644
--- a/src/hb-aat-layout-morx-table.hh
+++ b/src/hb-aat-layout-morx-table.hh
@@ -592,6 +592,7 @@ struct InsertionSubtable
hb_aat_apply_context_t *c_) :
ret (false),
c (c_),
+ mark_set (false),
mark (0),
insertionAction (table+table->insertionAction) {}
@@ -607,7 +608,7 @@ struct InsertionSubtable
hb_buffer_t *buffer = driver->buffer;
unsigned int flags = entry->flags;
- if (entry->data.markedInsertIndex != 0xFFFF)
+ if (entry->data.markedInsertIndex != 0xFFFF && mark_set)
{
unsigned int count = (flags & MarkedInsertCount);
unsigned int start = entry->data.markedInsertIndex;
@@ -668,7 +669,10 @@ struct InsertionSubtable
}
if (flags & SetMark)
+ {
+ mark_set = true;
mark = buffer->out_len;
+ }
return true;
}
@@ -677,6 +681,7 @@ struct InsertionSubtable
bool ret;
private:
hb_aat_apply_context_t *c;
+ bool mark_set;
unsigned int mark;
const UnsizedArrayOf<GlyphID> &insertionAction;
};
commit 5de2d9cdbdca870901c0ba9472f5b78c48ba0a58
Author: Ebrahim Byagowi <ebrahim at gnu.org>
Date: Thu Oct 4 02:14:18 2018 +0330
Minor, fix double-promotion warnings (#1221)
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 6b63f1ae..af443ad9 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -91,7 +91,7 @@ jobs:
- run: apt update || true
- run: apt install -y clang lld binutils libtool autoconf automake make pkg-config gtk-doc-tools ragel libfreetype6-dev libfontconfig1-dev libglib2.0-dev libcairo2-dev libicu-dev libgraphite2-dev python python-pip
- run: pip install fonttools
- - run: CFLAGS="-Weverything -Wno-reserved-id-macro -Wno-conversion -Wno-padded -Wno-sign-conversion -Wno-cast-qual -Wno-documentation -Wno-documentation-unknown-command" CXXFLAGS="-Weverything -Wno-old-style-cast -Wno-documentation -Wno-documentation-unknown-command -Wno-c++98-compat -Wno-cast-qual -Wno-c++98-compat-pedantic -Wno-sign-conversion -Wno-padded -Wno-shorten-64-to-32 -Wno-extra-semi -Wno-reserved-id-macro -Wno-float-conversion -Wno-format-pedantic -Wno-shadow -Wno-conversion -Wno-zero-as-null-pointer-constant -Wno-missing-field-initializers -Wno-double-promotion -Wno-used-but-marked-unused -Wno-unused-macros -Wno-comma -Wno-float-equal -Wno-disabled-macro-expansion -Wno-weak-vtables -Wno-unused-parameter -Wno-covered-switch-default -Wno-unreachable-code" CC=clang CXX=clang++ ./autogen.sh --with-freetype --with-glib --with-cairo --with-icu --with-graphite2 --with-fontconfig
+ - run: CFLAGS="-Weverything -Wno-reserved-id-macro -Wno-conversion -Wno-padded -Wno-sign-conversion -Wno-cast-qual -Wno-documentation -Wno-documentation-unknown-command" CXXFLAGS="-Weverything -Wno-old-style-cast -Wno-documentation -Wno-documentation-unknown-command -Wno-c++98-compat -Wno-cast-qual -Wno-c++98-compat-pedantic -Wno-sign-conversion -Wno-padded -Wno-shorten-64-to-32 -Wno-extra-semi -Wno-reserved-id-macro -Wno-float-conversion -Wno-format-pedantic -Wno-shadow -Wno-conversion -Wno-zero-as-null-pointer-constant -Wno-missing-field-initializers -Wno-used-but-marked-unused -Wno-unused-macros -Wno-comma -Wno-float-equal -Wno-disabled-macro-expansion -Wno-weak-vtables -Wno-unused-parameter -Wno-covered-switch-default -Wno-unreachable-code" CC=clang CXX=clang++ ./autogen.sh --with-freetype --with-glib --with-cairo --with-icu --with-graphite2 --with-fontconfig
- run: make -j32 CPPFLAGS="-Werror"
- run: make check CPPFLAGS="-Werror" || .ci/fail.sh
diff --git a/src/dump-emoji.cc b/src/dump-emoji.cc
index 3e0d668f..b5ec30ea 100644
--- a/src/dump-emoji.cc
+++ b/src/dump-emoji.cc
@@ -146,7 +146,7 @@ static void colr_cpal_rendering (cairo_font_face_t *cairo_face, unsigned int upe
int r = (color >> 8) & 0xFF;
int g = (color >> 16) & 0xFF;
int b = (color >> 24) & 0xFF;
- cairo_set_source_rgba (cr, r / 255.f, g / 255.f, b / 255.f, alpha);
+ cairo_set_source_rgba (cr, r / 255., g / 255., b / 255., alpha);
cairo_glyph_t glyph;
glyph.index = glyph_id;
diff --git a/src/hb-common.cc b/src/hb-common.cc
index 16f87014..41b1601d 100644
--- a/src/hb-common.cc
+++ b/src/hb-common.cc
@@ -1072,7 +1072,7 @@ hb_variation_to_string (hb_variation_t *variation,
while (len && s[len - 1] == ' ')
len--;
s[len++] = '=';
- len += MAX (0, snprintf (s + len, ARRAY_LENGTH (s) - len, "%g", variation->value));
+ len += MAX (0, snprintf (s + len, ARRAY_LENGTH (s) - len, "%g", (double) variation->value));
assert (len < ARRAY_LENGTH (s));
len = MIN (len, size - 1);
diff --git a/src/hb-ot-var-fvar-table.hh b/src/hb-ot-var-fvar-table.hh
index 1d17a97e..96c39c10 100644
--- a/src/hb-ot-var-fvar-table.hh
+++ b/src/hb-ot-var-fvar-table.hh
@@ -177,7 +177,7 @@ struct fvar
v = (v - axis.default_value) / (axis.default_value - axis.min_value);
else
v = (v - axis.default_value) / (axis.max_value - axis.default_value);
- return (int) (v * 16384. + (v >= 0. ? .5 : -.5));
+ return (int) (v * 16384.f + (v >= 0.f ? .5f : -.5f));
}
protected:
commit c2c7e6471ca912c91c82f6d71338082978f13dc6
Author: Ebrahim Byagowi <ebrahim at gnu.org>
Date: Thu Oct 4 00:29:40 2018 +0330
State our graphite2 dependency no-deprecated compile flag (#1220)
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 3696d288..6b63f1ae 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -91,7 +91,7 @@ jobs:
- run: apt update || true
- run: apt install -y clang lld binutils libtool autoconf automake make pkg-config gtk-doc-tools ragel libfreetype6-dev libfontconfig1-dev libglib2.0-dev libcairo2-dev libicu-dev libgraphite2-dev python python-pip
- run: pip install fonttools
- - run: CFLAGS="-Weverything -Wno-reserved-id-macro -Wno-conversion -Wno-padded -Wno-sign-conversion -Wno-cast-qual -Wno-documentation -Wno-documentation-unknown-command" CXXFLAGS="-Weverything -Wno-old-style-cast -Wno-documentation -Wno-documentation-unknown-command -Wno-c++98-compat -Wno-cast-qual -Wno-c++98-compat-pedantic -Wno-sign-conversion -Wno-padded -Wno-shorten-64-to-32 -Wno-extra-semi -Wno-reserved-id-macro -Wno-float-conversion -Wno-format-pedantic -Wno-shadow -Wno-conversion -Wno-zero-as-null-pointer-constant -Wno-missing-field-initializers -Wno-double-promotion -Wno-used-but-marked-unused -Wno-unused-macros -Wno-comma -Wno-float-equal -Wno-disabled-macro-expansion -Wno-weak-vtables -Wno-unused-parameter -Wno-covered-switch-default -Wno-unreachable-code -Wno-deprecated-declarations" CC=clang CXX=clang++ ./autogen.sh --with-freetype --with-glib --with-cairo --with-icu --with-graphite2 --with-fontconfig
+ - run: CFLAGS="-Weverything -Wno-reserved-id-macro -Wno-conversion -Wno-padded -Wno-sign-conversion -Wno-cast-qual -Wno-documentation -Wno-documentation-unknown-command" CXXFLAGS="-Weverything -Wno-old-style-cast -Wno-documentation -Wno-documentation-unknown-command -Wno-c++98-compat -Wno-cast-qual -Wno-c++98-compat-pedantic -Wno-sign-conversion -Wno-padded -Wno-shorten-64-to-32 -Wno-extra-semi -Wno-reserved-id-macro -Wno-float-conversion -Wno-format-pedantic -Wno-shadow -Wno-conversion -Wno-zero-as-null-pointer-constant -Wno-missing-field-initializers -Wno-double-promotion -Wno-used-but-marked-unused -Wno-unused-macros -Wno-comma -Wno-float-equal -Wno-disabled-macro-expansion -Wno-weak-vtables -Wno-unused-parameter -Wno-covered-switch-default -Wno-unreachable-code" CC=clang CXX=clang++ ./autogen.sh --with-freetype --with-glib --with-cairo --with-icu --with-graphite2 --with-fontconfig
- run: make -j32 CPPFLAGS="-Werror"
- run: make check CPPFLAGS="-Werror" || .ci/fail.sh
diff --git a/.travis.yml b/.travis.yml
index 83b479ee..eadfa767 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -47,8 +47,6 @@ matrix:
- os: osx
compiler: clang
install:
- # https://github.com/harfbuzz/harfbuzz/issues/345
- - export CXXFLAGS="$CXXFLAGS -Wno-deprecated-declarations"
- brew update;
# Workaround Travis/brew bug
- brew uninstall libtool && brew install libtool
diff --git a/configure.ac b/configure.ac
index 1c698087..4ebb21df 100644
--- a/configure.ac
+++ b/configure.ac
@@ -330,7 +330,7 @@ AC_ARG_WITH(graphite2,
[Use the graphite2 library @<:@default=no@:>@])],,
[with_graphite2=no])
have_graphite2=false
-GRAPHITE2_DEPS="graphite2"
+GRAPHITE2_DEPS="graphite2 >= 1.2.0"
AC_SUBST(GRAPHITE2_DEPS)
if test "x$with_graphite2" = "xyes" -o "x$with_graphite2" = "xauto"; then
PKG_CHECK_MODULES(GRAPHITE2, $GRAPHITE2_DEPS, have_graphite2=true, :)
commit e4e74c2751ac24178086cce2811d34d8019b6f85
Author: mhosken <mhosken at users.noreply.github.com>
Date: Thu Oct 4 02:33:26 2018 +0700
Update Graphite API to latest (#1215)
diff --git a/src/hb-graphite2.cc b/src/hb-graphite2.cc
index 817278f3..fd5cec1a 100644
--- a/src/hb-graphite2.cc
+++ b/src/hb-graphite2.cc
@@ -95,6 +95,32 @@ retry:
return d;
}
+static void hb_graphite2_release_table(const void *data, const void *table_buffer)
+{
+ hb_graphite2_face_data_t *face_data = (hb_graphite2_face_data_t *) data;
+ hb_graphite2_tablelist_t *tlist = face_data->tlist.get();
+
+ hb_graphite2_tablelist_t *prev = nullptr;
+ hb_graphite2_tablelist_t *curr = tlist;
+ while (curr)
+ {
+ if (hb_blob_get_data(curr->blob, nullptr) == table_buffer)
+ {
+ if (prev == nullptr)
+ face_data->tlist.cmpexch(tlist, curr->next);
+ else
+ prev->next = curr->next;
+ hb_blob_destroy(curr->blob);
+ free(curr);
+ break;
+ }
+ prev = curr;
+ curr = curr->next;
+ }
+}
+
+static gr_face_ops hb_graphite2_face_ops = { sizeof(gr_face_ops), hb_graphite2_get_table, hb_graphite2_release_table };
+
hb_graphite2_face_data_t *
_hb_graphite2_shaper_face_data_create (hb_face_t *face)
{
@@ -113,7 +139,7 @@ _hb_graphite2_shaper_face_data_create (hb_face_t *face)
return nullptr;
data->face = face;
- data->grface = gr_make_face (data, &hb_graphite2_get_table, gr_face_preloadAll);
+ data->grface = gr_make_face_with_ops (data, &hb_graphite2_face_ops, gr_face_preloadAll);
if (unlikely (!data->grface)) {
free (data);
More information about the HarfBuzz
mailing list