Commit Graph

514 Commits

Author SHA1 Message Date
Behdad Esfahbod b9b005f3a4 Fix Context lookup application when moving back after a glyph delete
This was broken forever, since days that we did not allow moving
tape backwards. Works now. Reported by Doug Felt.
2017-03-01 14:27:23 -08:00
Behdad Esfahbod a11501444c Add few tests found by libFuzzer and oss-fuzz 2017-02-25 13:37:54 -08:00
jfkthame 44f7d6ecde Guard against underflow when adjusting length (#421)
* Guard against underflow when adjusting length

With the fuzz-testcase in mozilla bug 1295299, we end up with a recursed lookup that removes 3 items, when `match_positions[idx]` is 0, which results in (unsigned) `end` wrapping to a huge value.

Making `end` a signed int is probably the simplest route to a fix.

Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1295299.

* Add testcase for #421.
2017-02-16 19:03:24 -08:00
jfkthame 45766b673f [indic] Add support for Grantha marks that may be used in Tamil to th… (#401)
* [indic] Add support for Grantha marks that may be used in Tamil to the Indic table.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1331339.

Testcase: U+0BA4,U+0BC6,U+1133c,U+0BAA,U+1133c,U+0BC6,U+1133c

* [indic] Add test for Grantha nukta that is allowed in Tamil by ScriptExtensions.txt
2017-02-16 09:40:21 -08:00
Philip Withnall a6ced90efc test: Fix some memory leaks in test-font.c (#409)
Coverity IDs: 141039, 141040, 141041
2017-02-07 18:18:33 -08:00
Behdad Esfahbod e888f642db Route Adlam through Arabic shaper
Fixes joined Adlam rendering.

Fixes https://github.com/googlei18n/noto-fonts/issues/828
2017-01-26 14:50:14 -08:00
Behdad Esfahbod a8a5e81a52 [test-ot-math] Add test with nil face/font 2017-01-19 16:55:04 -08:00
Behdad Esfahbod 331d07bd40 Minor 2017-01-19 16:51:36 -08:00
Behdad Esfahbod b5ecf1bfa4 Fix warnings 2017-01-19 16:50:29 -08:00
Behdad Esfahbod 2f2ceee185 Minor 2017-01-19 16:48:01 -08:00
Khaled Hosny 2452543fdd [ot] Fix automatic fraction for RTL scripts (#405)
The numbers for right-to-left scripts are processed also from right to
left, so the order of applying “numr” and “dnom” features should be
reversed in such case.

Fixes https://github.com/behdad/harfbuzz/issues/395
2017-01-18 12:48:13 -08:00
Sascha Brawer 1337428e4f Update language tags to OpenType 1.8.1 (#403)
Resolves https://github.com/behdad/harfbuzz/issues/324
2017-01-18 04:51:02 -08:00
Behdad Esfahbod 31f7b1bb94 Add tests for USE using Marchen font and text
From http://www.babelstone.co.uk/Fonts/Marchen.html
2017-01-05 20:20:06 -08:00
Behdad Esfahbod 4b4a1b9f23 Fix assert fail with contextual matching
As discovered by libFuzzer / Chromium fuzzing.

Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=659496
CC https://github.com/behdad/harfbuzz/issues/139
2016-12-21 23:14:16 -06:00
Behdad Esfahbod a0688e8e7b Ouch, finish previous change 2016-12-20 20:52:50 -06:00
Behdad Esfahbod de14c19d14 [fuzzer] Separate main() into a new file 2016-12-20 20:50:38 -06:00
Mike Hommey 1c98ff87c7 Support building with older glib versions
It is desirable to be able to build against older versions of glib.

fd7a245 changed the configure check to require glib > 2.38 for
G_TEST_DIST. Before that, version 2.16 was required, but in fact,
since aafe395, G_PASTE is being used, which was introduced in 2.19.1.
And since 0ef179e2, hb-glib uses GBytes, which were introduced in
2.31.10.

2.19.1 is rather old, but 2.38 is rather new. For Firefox, building
against 2.22 is still supported, although we could probably get away
with bumping that to 2.28. Either way, GBytes is not available.

Arguably, if you build against a glib that doesn't support GBytes,
you're not going to use the hb_glib_blob_create function, so we hide
the function when building against such a glib.

As for G_TEST_DIST, when building against versions of glib that don't
support it, we can fallback to the previous behavior, which, AIUI, was
just making the test not work when building in a separate directory.
2016-12-18 01:37:07 -06:00
Behdad Esfahbod 8c842e4a44 [hb-fuzzer] Get glyph extents for output glyphs
To exercise glyph-extents codepaths (glyf / CBLC+CBDT).
2016-12-04 20:28:38 -08:00
Behdad Esfahbod 9f6144cdb9 [CBDT] Add test for fetching glyph extents 2016-12-04 19:55:17 -08:00
Behdad Esfahbod d163cd9562 [tests] Add tests for vertical origin with ft and ot font-funcs 2016-10-26 18:27:48 +02:00
Frédéric Wang c3fa5d0e03 Remove inexistent file ttx file from test/api/Makefile.am 2016-10-24 21:42:04 +02:00
Behdad Esfahbod 34fc4a2cfa Fix dist 2016-10-04 14:47:12 -07:00
Behdad Esfahbod 46cc4a3a2a [MATH] Rename hb_math_*_t types to hb_ot_math_*_t
With this, I believe MATH table API is not ready to be merged.
2016-09-27 16:44:22 +02:00
Frédéric Wang 8d622f1114 Add tests for get_mathvariant (#329) 2016-09-27 13:53:34 +02:00
Frédéric Wang 485e4873fb Add tests for hb_ot_math_get_glyph_variants (#328) 2016-09-27 13:18:00 +02:00
Behdad Esfahbod a5629a2ed9 [MATH] Simplify test 2016-09-27 11:31:29 +02:00
Frédéric Wang edcfa789bf test-ot-math: Use different scales for vertical and horizontal directions and add test for hb_ot_math_get_min_connector_overlap. (#327) 2016-09-27 11:02:08 +02:00
Behdad Esfahbod cdc9eef7da [MATH] Enable tests for glyph-assembly italics-correction 2016-09-26 22:18:41 +02:00
Behdad Esfahbod 86106c7528 [MATH] Rename all API to hb_ot_math_* 2016-09-26 22:14:29 +02:00
Frédéric Wang 51da7a1cd6 MATH table: Add API to access math variants. 2016-09-26 15:18:16 +01:00
Frédéric Wang 722e620f20 Use G_TEST_DIST to build the path of math test fonts 2016-09-26 13:49:18 +01:00
Behdad Esfahbod 17ff30e9af [MATH] Clean up get_top_accent_attachment()
Note, the function now returns "half of horizontal advance width"
if top accent attachment for glyph is not explicitly defined.
This is what the spec requires.  Updated tests.
2016-09-26 12:21:27 +01:00
Behdad Esfahbod 8bcf517fe5 [MATH] Clean up get_italics_correction() 2016-09-26 12:13:14 +01:00
Frédéric Wang d7182d1296 MATH Table: Add API to access glyph info. 2016-09-26 11:32:25 +01:00
Frédéric Wang 319ff59161 MATH Table: Add API to access math contants. 2016-09-26 10:49:09 +01:00
Behdad Esfahbod 4d3892e9b0 [MATH] Fixups for previous commit 2016-09-26 10:45:58 +01:00
Frédéric Wang 5fbcb992bd MATH Table: Add API to check availability of math data. 2016-09-26 10:27:33 +01:00
Sascha Brawer e7ecbba2cc Support Americanist Phonetic Notation
OpenType language system tag: `APPH`
https://www.microsoft.com/typography/otspec/languagetags.htm

IETF BCP47 variant tag: `fonnapa`
http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry
2016-08-18 14:13:26 +02:00
Behdad Esfahbod 18c19dd34d Fix build 2016-08-09 13:03:14 -07:00
Behdad Esfahbod 91f2585411 Actually add test 2016-08-08 18:08:08 -07:00
Behdad Esfahbod f1b76275da Add tests for Chinese language tags
Using font from https://github.com/behdad/harfbuzz/issues/300
2016-08-08 18:06:09 -07:00
Khaled Hosny 988350586f [tests] Workaround Python 2 “narrow” builds
The so-called Python 2 “narrow” builds support UCS2 only, this is a
workaround to allow unichr to work with any Unicode character in such
builds. This fixes Travis-CI failure as it has narrow Python 2 builds.

Copied from:
https://github.com/behdad/fonttools/blob/master/Lib/fontTools/misc/py23.py
2016-06-18 23:01:58 +02:00
Behdad Esfahbod 6c0aa9e92b Fix build on droid.io 2016-05-06 17:50:53 +01:00
Behdad Esfahbod 9b6312f945 [use] Update to draft spec from Andrew Glass from August 2015 2016-05-06 17:41:49 +01:00
Behdad Esfahbod 30e6e29f0f [indic/use] Move Javanese from Indic shaper to USE
Fixes https://github.com/behdad/harfbuzz/issues/243

With javatext.ttf, the reodering medial Ra gets its advance width
zero'ed in Uniscribe implementation, and the font adds the advance
back.  Our Indic shaper does not do that, but USE does.  So, route
Javanese through USE.  That's what Microsoft does anyway.  Test:

  U+A9A5,U+A9BA

This also seems to fix the following sequence, and variations thereof:

  U+A99F,U+A9C0,U+A9A2,U+A9BF
2016-05-06 15:52:27 +01:00
Behdad Esfahbod c6ee5f5f06 Add Javanese sample text 2016-05-06 15:39:02 +01:00
Behdad Esfahbod f8061ae797 [tests] Fix test 2016-05-02 10:28:24 +02:00
Behdad Esfahbod f00ab2a33a [hb-ot-font] Make 'glyf' table loading lazy
Apparently some clients have reference-table callbacks that copy the table.
As such, avoid loading 'glyf' table which is only needed if fallback positioning
happens.
2016-05-02 10:24:00 +02:00
Behdad Esfahbod f68390f196 [test] Add text for Tibetan shorthand contractions
From http://www.babelstone.co.uk/Tibetan/Contractions.html
2016-04-27 02:44:35 -07:00
Behdad Esfahbod b20305022a Do NOT ignore Mongolian Free Variation Selectors during matching
Fixes https://github.com/behdad/harfbuzz/issues/234
2016-04-26 16:41:17 -07:00