Commit Graph

1930 Commits

Author SHA1 Message Date
Ebrahim Byagowi 2264a7011f [tests] some more ligature carets tests 2020-05-23 12:15:18 +04:30
Qunxin Liu d7c012a08e [subset] GDEF Variation Store: step 2
do subset based on variation indices collected in step 1
2020-05-21 12:43:24 -07:00
Ebrahim Byagowi 887aa0214f [meson] Use find_program for locating python script
Apparently that is the simplest and supported way of finding python scripts.
2020-05-21 20:03:11 +04:30
Ebrahim Byagowi cc53fd158c
[meson] Normalize options names
As https://github.com/harfbuzz/harfbuzz/pull/2412#discussion_r426275027
2020-05-21 19:33:18 +04:30
Ebrahim Byagowi f7562672f9 [meson] Use / instead join_paths
We need some of the very recent features of meson, let's use the new features also
2020-05-21 18:52:31 +04:30
Ebrahim Byagowi b8d1760bc0 [meson/ci] Increase cmap fuzzer timeout even more 2020-05-21 14:45:41 +04:30
Ebrahim Byagowi 4b12b8466f [meson] Increase timeout in hope to resolve Actions' bot timeout 2020-05-21 14:23:36 +04:30
Ebrahim Byagowi 1c4dd79cfb [ci] Increase timeout as gh bot issue isn't resolved by serial test 2020-05-21 08:52:05 +04:30
Ebrahim Byagowi 759ab4fe56 [meson] Use subdir_done to simplify test/api/meson.build 2020-05-21 08:24:15 +04:30
Ebrahim Byagowi 8667df552c [meson] Unbreak the build, oops 2020-05-21 07:19:37 +04:30
Ebrahim Byagowi 37f9cccc21
[meson] Don't run subset tests in parallel
Hopefully resolves https://github.com/harfbuzz/harfbuzz/runs/695051808#step:6:700 for now
2020-05-21 07:17:18 +04:30
Ebrahim Byagowi 791debdc4a
[meson][ci] Don't run subset fuzzer test in parallel
resolves https://github.com/harfbuzz/harfbuzz/runs/695051808#step:6:595 failure
2020-05-21 07:15:09 +04:30
Ebrahim Byagowi 8a5368e2d6 [tests] Enable more gid misc calls on draw fuzzer 2020-05-21 07:00:40 +04:30
Ebrahim Byagowi c68ab4b52b Fix _get_ligature_caret's oob read issue
AAT::Lookup has no other way to detect whether it is returned from
a real and sanitized font data or from a null pool, this checks if
the table has been recognized valid by sanitizer by checking
table's major version which is zero if returned from a null pool and
non-zero if is from a sanitized font data, it is expected the other
calls of the table (unlikely to have more calls however) also do a
similar version check before calling the lookups used on the table.
2020-05-21 06:56:09 +04:30
Ebrahim Byagowi 57886e2162 [test] Enable tests fixed by 461cd5a which was regressed by b986fea 2020-05-21 06:29:56 +04:30
Qunxin Liu 8b5d3ebd96 [subset] GSUB5/GPOS7 Contextual Subst/Pos Subtbale Subsetting support 2020-05-20 15:12:54 -07:00
Ebrahim Byagowi ca2705f1fb [tests] Add more tests for _get_ligature_carets 2020-05-21 00:05:54 +04:30
David Corbett b207eab842 Round-trip OpenType tags through BCP 47 2020-05-15 15:00:15 -07:00
Ebrahim Byagowi 0722889a6e
[meson] increase subset tests timeout
https://github.com/harfbuzz/harfbuzz/runs/676665822#step:6:570

fails because meson runs the tests in parallel, correct fix will be making the tests smaller
2020-05-15 10:10:27 +04:30
Behdad Esfahbod c15146448b
Merge pull request #2264 from harfbuzz/unicode-13
Update to Unicode 13.0.0
2020-05-14 19:12:41 -07:00
Qunxin Liu b2a965df5e [subset] Add support for "--gids" option
cmap subsetting now retains entries associated with any glyph ids explicitly requested
2020-05-11 15:28:58 -07:00
jfkthame 100d40c827
[aat] Fix implementation of AAT kerning for Geeza Pro. (#2388)
* [aat] Fix implementation of AAT kerning for Geeza Pro.

Despite what the comment in the code used to say, it appears that Geeza Pro
does rely on accumulating kerning values from successive subtables. With
this change, the results now match Core Text rendering (and avoid the clear
visual breakage reported in #2358).

Testcase: U+0644,U+064E,U+0645,U+064E,U+0651,U+0627

Fixes #2358.

* [aat] Update test expectations, add new testcase.
2020-05-05 17:48:24 -07:00
David Corbett fd748fac41 Update to Unicode 13.0.0 2020-04-29 17:17:03 -04:00
Qunxin Liu e53c44e326 [subset] temporarily revert previous cmap commit
Required in https://github.com/harfbuzz/harfbuzz/issues/2356
2020-04-25 12:21:22 +04:30
Evgeniy Reizner 05be05eb65 [kern] Test format 3. 2020-04-22 09:30:25 -07:00
ckitagawa b22f61d86a Fix bug 2020-04-21 16:51:55 -07:00
Ebrahim Byagowi 750bb73e32 [meson] Add an experimental-api option 2020-04-21 01:26:08 +04:30
Ebrahim Byagowi 0181f03019 [test] Workaround Windows pipe issue by storing ttx in a file 2020-04-20 18:32:35 +04:30
Ebrahim Byagowi ac26f19c9e Refactor test/api/meson.build and always run test-unicode test 2020-04-19 23:19:18 +04:30
Ebrahim Byagowi c6b3f73b09 [meson] Make harfbuzz-icu separate module optout-able 2020-04-19 02:06:01 +04:30
Christoph Reiter 8ae06c9489 meson: build a separate library for harfbuzz-icu
This adds a seperate library like with autotools.

This also fixes the ico feature option which was just set to required:false
when disabled instead of really disabling it.
Disabling is still broken with msvc because it then tries to find the library
another way, but that's broken for all other deps as well so I left it as is.

For tests only test-unicode.c is using icu specific functions so split it out
into its own category which depends on harfbuzz-icu.

Fixes #2338
2020-04-18 23:34:31 +04:30
Christoph Reiter 2354a90008 tests: fix subset/run-tests.py under Windows
It assumed that stdout of a subprocess in binary mode was using
utf-8 which isn't the case. Instead open stdout of the subprocess
in text mode and let Python handle the decoding.
2020-04-18 23:34:26 +04:30
ariza 22f7c61acf implement SID to glyph ID mapping with predefined Charset
Also fixes oss-fuzz 21769
2020-04-18 15:42:30 +04:30
Ebrahim Byagowi fefaa8c835
[test] define G_APPROX_VALUE and EPSILON only when used
resolves -Weverything bot complain
2020-04-17 22:28:09 +04:30
Ebrahim Byagowi 29c903223b Move hb_ot_layout_closure_{features,lookups} behind EXPERIMENTAL flag 2020-04-17 22:25:45 +04:30
Ebrahim Byagowi 9b7fb5c23f Move hb_font_get_var_coords_design behind HB_EXPERIMENTAL_API 2020-04-17 20:29:04 +04:30
Ebrahim Byagowi a5e5a79004
[tests] Enable the just added macOS test for older version
The test is added in 7035c9cd but the same font is available in older versions of macOS
so let's run it in older versions also.

It doesn't matter much, more for consistency reasons.
2020-04-16 01:38:43 +04:30
Jonathan Kew 7035c9cdfe Add test for #2290.
This tests that we can set two separate Type=Ligature selectors at the same time,
common=off + discretionary=on.
2020-04-16 01:33:01 +04:30
Qunxin Liu 0d5695983e [subset] fixes dangling object_t issue in FeatureVariationRecord
Fixes https://crbug.com/oss-fuzz/21560
revert () does not clean up useless object_t. Adjust the order of
subsetting substitutions and conditions to avoid dangling object_t.
2020-04-06 13:41:33 +04:30
Ebrahim Byagowi 57b7de032f [subset] Fail ClassDefFormat1 serialization if no space available
Fixes https://crbug.com/oss-fuzz/21580
2020-04-05 17:38:04 +04:30
Qunxin Liu c8cc1e378d fix issues in ClassDefFormat1 serialize:
glyph ids in Iterator may be non-consecutive,
so the number in classValue might be larger than length of the Iterator
2020-04-03 12:31:48 -07:00
Ebrahim Byagowi 4a49b36a9e [tests/macos] Adopt added Apple Chancery tests with older macos versions 2020-04-03 21:32:34 +04:30
Jonathan Kew 548a25259e Add a test for #2307. 2020-04-03 19:57:43 +04:30
Jonathan Kew 120d86fa18 Add tests for #2305. 2020-04-03 19:20:48 +04:30
Ebrahim Byagowi 89fa70f511 [aat] minor over previous feat related changes 2020-04-03 01:08:01 +04:30
Jonathan Kew 58b4d18b53 Add a couple testcases for issue 2285.
A few simple testcases to confirm that setting liga=0 does not break shaping with
the Tibetan AAT font Kokonor, but does still disable common ligatures in Times.
2020-04-02 23:58:32 +04:30
Garret Rieger 014e038b2c [subset] Bail out of context lookup expansion once the lookup limit is encountered. 2020-04-01 11:14:41 +04:30
Garret Rieger 5d345d0cd1 [subset] Limit the number of lookup indices processed subsetting Feature.
> Also, remove two unnessecary full iterations of the lookup index iterator during serialization of the index array. Fixes fuzzer found timeout.
2020-04-01 11:13:05 +04:30
Ebrahim Byagowi 96d792ae80 [avar] Prevent mul overflow
Fixes https://crbug.com/oss-fuzz/21350
2020-03-26 15:01:14 +00:00
Garret Rieger 4ad686b9c0
[subset] fix fuzzer timeout in layout closure
Bail out of chain context lookup expansion once the lookup limit is encountered.
2020-03-26 06:32:28 +00:00
Ebrahim Byagowi 7054b12206 [meson] Mark rest of non-install executables explicitly 2020-03-24 19:06:09 +00:00
Ebrahim Byagowi 68df3f7dac [meson] test/api, separate subset tests 2020-03-24 19:06:09 +00:00
Ebrahim Byagowi 600bf21fbc [meson] Add draw-fuzzer runner 2020-03-24 19:06:09 +00:00
Ebrahim Byagowi 28deb6b718 [meson] test/fuzzing simplify 2020-03-24 19:06:09 +00:00
Ebrahim Byagowi 78622231ac [meson] More comment on tests are causing timeout failure 2020-03-24 19:06:09 +00:00
Ebrahim Byagowi 9bc792f416 [meson] Don't set MALLOC_PERTURB_ as it is already set by meson 2020-03-24 19:06:09 +00:00
Ebrahim Byagowi e8808c1c20 [meson] Minor, replace tabs with spaces 2020-03-24 19:06:09 +00:00
Ebrahim Byagowi 4dfda9feaa [meson] Update and simplify test/shaping 2020-03-24 19:06:09 +00:00
Ebrahim Byagowi f22e92bb30 [meson] Update test/api from autotools 2020-03-24 19:06:09 +00:00
Ebrahim Byagowi e248a4e46c [make] Minor reordering on test/api/Makefile.am 2020-03-24 19:06:09 +00:00
Ebrahim Byagowi d57fc627e9 [meson] raise timeout value of subset fuzzer 2020-03-24 19:06:09 +00:00
Ebrahim Byagowi 761695264b [tests] Remove py2 workaround for lack of timeout in subprocess 2020-03-19 10:32:46 +00:00
Ebrahim Byagowi b5526a09ff [tools] Remove in-house 'which' now that we have py3 2020-03-19 10:32:46 +00:00
Ebrahim Byagowi a0c58be371 [tools] Remove py2 remains 2020-03-18 23:41:20 +03:30
Ebrahim Byagowi 03564fd2cf
[test] fix misspell 2020-03-14 20:09:00 +03:30
Ebrahim Byagowi 1b8a37f75f
[test] minor fix
oops...
2020-03-14 20:06:41 +03:30
Ebrahim Byagowi 0423da3373
[test] minor fix
macos tests are using absolute path which aren't relevant in Windows
2020-03-14 20:05:23 +03:30
Ebrahim Byagowi 74fdd34f4d
[test] make run-tests.py work on Windows 2020-03-14 20:03:14 +03:30
Tim-Philipp Müller a3892be701 [meson] fix spurious warning when building test/api C sources
Fixes compiler warning

  test-unicode.c:589:1: warning: ‘test_unicode_properties_lenient’ defined but not used

which didn't happen with autotools.

Reason it does with meson is that the setup for C was slightly wrong.
We would only add -DHAVE_CONFIG_H to cpp_args which is only valid when
compiling C++ code, but not plain C code, and many of these tests were
plain C.

Instead pass -DHAVE_CONFIG_H via add_project_arguments() and make sure
to set both c_args and cpp_args when building test executables.

Fixes https://github.com/harfbuzz/harfbuzz/issues/2257
2020-03-14 15:16:00 +03:30
Garret Rieger 430bf69653 Add potentially crashing font as a fuzzer seed. 2020-03-14 00:55:47 +03:30
Chun-wei Fan da95a8c239 Shaping tests: Skip FreeType tests if support not present
HarfBuzz could have been built without FreeType, so we skip the test
when hb-shape reports that the font function `ft' is unknown
2020-03-13 14:30:17 +03:30
Ebrahim Byagowi 755a77d660 Move outline draw API behind HB_EXPERIMENTAL_API directive 2020-03-13 08:25:53 +03:30
Garret Rieger 834a224a50
[subset] Put a limit on the number of lookup indices that can be visited during closures
Fixes https://crbug.com/oss-fuzz/21025
2020-03-12 13:32:36 +03:30
Ebrahim Byagowi 12df69e59c
Minor, delete not needed cmake testing file 2020-03-11 21:52:43 +03:30
Ebrahim Byagowi 943bfeda53 [meson] Enable more of the subset tests 2020-03-11 21:49:26 +03:30
Ebrahim Byagowi c494d7abcd Remove cmake testing and add meson build bot
CMake tests are broken anyway as py3 changes so let's get rid of them
2020-03-11 20:15:10 +03:30
Ebrahim Byagowi 1c3f80ba13 [meson] Minor updates 2020-03-11 20:15:10 +03:30
Tim-Philipp Müller f1e5f4a784 meson: tests: shaping: add aots tests 2020-03-11 19:18:57 +03:30
Tim-Philipp Müller 84725fb005 meson: tests: shaping: add missing in-house tests 2020-03-11 19:18:57 +03:30
Tim-Philipp Müller 8fc66dbf9f meson: tests: subset: no need to check for 'which' command any more
Test runner script now handles that.
2020-03-11 19:18:57 +03:30
Khaled Hosny 04438554c8 meson: Update build files after rebase 2020-03-11 19:18:57 +03:30
Tim-Philipp Müller 618584e923 meson: rename incbase to incconfig
Makes it clearer what it's for: config.h. See #4.
2020-03-11 19:18:57 +03:30
Mathieu Duponchelle d4a7237327 meson: all tests passing on Windows / MSVC 2020-03-11 19:18:57 +03:30
Mathieu Duponchelle 7ee650b173 meson: refactor fuzzing test 2020-03-11 19:18:57 +03:30
Mathieu Duponchelle 920efc0ef7 Add Meson build definitions
Fixes #490

http://mesonbuild.com
2020-03-11 19:18:57 +03:30
Ebrahim Byagowi 78eabf247e [test] Enable OT funcs on tests that are working 2020-03-10 14:07:37 +03:30
Ebrahim Byagowi 0d729b4b72 [avar] Fix out-of-bound read when input is bigger than all the coords
'i' shouldn't become equal to array's length which as the increament
is happened at end of the loop, if the input is bigger than all the
table coords, it will be equal to array's length.

Fixes https://crbug.com/oss-fuzz/21092
2020-03-07 13:20:41 +03:30
Ebrahim Byagowi 6924e29f62 [var] Fix hb_ot_var_get_axis_infos's offset semantic
The API was adding offset to input's infos buffer index also which is
unusual between our APIs and wrong.
2020-03-06 02:01:04 +03:30
ariza c05458ec7f update cff & cff2 subsetters 2020-03-05 01:22:51 +03:30
Ebrahim Byagowi 446d1e3bbc [fuzz] Add more of fixed cases 2020-03-05 00:49:03 +03:30
Ebrahim Byagowi 99b5b3f1b1 [gvar] Make sure TupleVarHeader has the needed size
Fixes https://crbug.com/oss-fuzz/21026
2020-03-04 12:43:26 +03:30
Ebrahim Byagowi 558f922788 [fuzz] Avoid empty memcpy and ubsan complain by length checking before memcpy 2020-03-03 21:39:22 +03:30
Ebrahim Byagowi 6543d166fd [fuzz] Remove the not yet fixed timeout, going to investigate 2020-03-03 21:39:22 +03:30
Ebrahim Byagowi 2bbf1c8673 [fuzz] Add more of supposed to already be fixed cases from Chromium bug tracker 2020-03-03 21:39:22 +03:30
Ebrahim Byagowi f253f06cf3 [fuzz] Add another fixed case
https://crbug.com/oss-fuzz/14626

another numerous subtables count which is fixed by d38360397
2020-03-03 19:12:04 +03:30
Ebrahim Byagowi d383603976
Limit OT::Lookup subtables (#2219)
Fixes https://crbug.com/oss-fuzz/13943
2020-03-02 22:41:08 +03:30
Ebrahim Byagowi 29efd964f2
[fuzz] Add cases that marked as wontfix
Let's see if they were really false alarms, if so, let's just have them.
2020-03-02 14:22:29 +03:30
Ebrahim Byagowi cb65150fec
[draw] minor 2020-02-29 16:12:54 +03:30
Ebrahim Byagowi 44169f3396
[draw] Fix invalid rendering of some glyph on Estedad-VF
Basically reverts 11f3fca so I can do the same tested and better later

Fixes #2215
2020-02-29 16:04:03 +03:30
Ebrahim Byagowi 86c40b3a1d [fuzz/draw] Call _get_glyph_extents
Other render related APIs also may be added also later such
as ot-color and future rendering things.
2020-02-29 14:53:34 +03:30
Michiharu Ariza 5ab50eebd7
collect_unicodes() with clamp, calling add_range()
Use add_range instead an inner loop, clamp its input number by
number of glyphs a face has.

Even the face cmap12 and 13 have 32-bit hb_codepoint_t, which is here
used to make timeout, face's maxp has 16-bit gid limitation at least for now,
using that makes sure we both fix and the timeout and don't need to change
much things here also in order to support 32-bit gids also someday.

Fixes #2204
2020-02-29 13:02:29 +03:30
Garret Rieger 410b4881d0 [subset] Add fuzzer timeout testcase. 2020-02-28 16:10:14 -08:00
Ebrahim Byagowi e57ced5fc0
[gvar] Add other possibly fixed fuzzer case
Speculatively should've been fixed by 61208401

https://crbug.com/oss-fuzz/20924 related
2020-02-28 23:29:05 +03:30
Ebrahim Byagowi 758fda728b
[glyf] Don't accept gids higher than maxp's glyphs number
This specially becomes concerning on sub-components where a gvar table
that is sanitized using maxp's glyphs number overflows when a high gid
accepted here goes to it, maybe an additional check can be put there
also, this however feels to be enough.

Fixes https://crbug.com/oss-fuzz/20944
2020-02-28 23:19:06 +03:30
Ebrahim Byagowi e90213868b Revert "collect_unicodes() to check gid < num_glyphs with cmap 12"
Didn't fix the case actually, making bots to fail.

This reverts commit 15b43a4104.
2020-02-28 21:24:51 +03:30
Ebrahim Byagowi 61208401f4
[gvar] Use hb_bytes_t.check_range instead having in house one
And use TupleVarHeader calculated size for validity check.

Fixes https://crbug.com/oss-fuzz/20919 and possibly other gvar related issues
2020-02-28 21:09:07 +03:30
Michiharu Ariza 15b43a4104
collect_unicodes() to check gid < num_glyphs with cmap 12
fixes #2204
2020-02-28 20:15:39 +03:30
Ebrahim Byagowi 868ecf7b26 [draw] Add fuzzer runner 2020-02-28 19:57:56 +03:30
Ebrahim Byagowi 8eba66c1c6 [gvar] Fix invalid memory access by refactoring GlyphVarData fetch logic
Fixes https://crbug.com/oss-fuzz/20906
2020-02-27 20:26:54 +03:30
Qunxin Liu 5ad761b943 [subset] GDEF MarkGlyphSets subsetting support 2020-02-26 15:15:21 -08:00
Qunxin Liu fcd7f33bbb [subset] GDEF glyphClassDef subsetting support
glyphClassDef uses the same ClassDef format. However, glyphClassDef table
uses predefined class values so we do not remap class values.
2020-02-26 11:10:31 -08:00
ariza a99134c5be add oss-fuzz 20886 test file 2020-02-26 09:58:03 -08:00
Ebrahim Byagowi 1b8b863898 minor 2020-02-26 16:36:48 +03:30
Ebrahim Byagowi 132fcfbc47 [fuzz] minor don't abort main.cc when the file was empty or not found 2020-02-26 16:15:17 +03:30
Ebrahim Byagowi 84163c83d3 [draw] Skip commands and paths not contributing anything
They aren't contributing to rendering and making issue for stroking, let's skip them
ourselves as Skia does also https://skia-review.googlesource.com/c/skia/+/268166

They are useful for extracting extents and so which that functionality won't be effected by this change.
2020-02-26 16:09:28 +03:30
Michiharu Ariza c400cb8863
Re-implement hb_set_t::del_range (#2194)
* optimize hb_set_del_range()

fix issue #2193

* fixed bug & added tests

* coding & comment tweaks
2020-02-25 16:06:03 -08:00
ariza 4081439d2a tweak reflecting review & add test cases 2020-02-25 15:03:12 -08:00
Ebrahim Byagowi 152000d9c7 [fuzz] Practice variations on font object 2020-02-25 21:16:57 +03:30
Ebrahim Byagowi 036d868913 [draw] Add a fuzzer
Specially checks correctness of the API semantics:
* no move happens when a path is already opened with move-to.
* no path will be left open and close-path will happen at the end of opened paths.
* no path opens with a move-to and will be closed with no length.
* paths start and ending points matches.
* no line/quadratic/cubic command will be issued when no path is started.
2020-02-25 19:09:44 +03:30
ariza 173b745da8 fixed bug & added tests 2020-02-24 22:56:57 -08:00
ariza a5012e97c4 optimize hb_set_del_range()
fix issue #2193
2020-02-24 17:09:48 -08:00
Ebrahim Byagowi 96b71e802f [fuzz] make the custom loader to handle multiple files
Actually this was the way it used to work :)
2020-02-24 23:01:02 +03:30
Ebrahim Byagowi 1f5a54c768 [gvar] fix infinite loop introduced by 11f3fca
The attempt on removing end_points had made the code unreadable
and has intrdouced infinite, fixed by making the code clear what
it tries to achieve.
2020-02-24 14:30:07 +03:30
Ebrahim Byagowi e17fd0d91c [tools] More on py3 compatibility 2020-02-24 00:10:11 +03:30
Ebrahim Byagowi 0cf050a7b1 [draw] Merge consequent move-to commands of CFF/CFF2 2020-02-23 23:23:50 +03:30
Ebrahim Byagowi 86bd5a0ba1 [draw] End CFF paths with a line-to
Issue a line-to command when start and end point of a path isn't same, matches freetype also.
2020-02-23 23:23:50 +03:30
Garret Rieger 411225426f Fix glyph closure for alternate substitution.
It was not filtering on the glyphs to be retained.
2020-02-21 13:01:23 +03:30
Ebrahim Byagowi 8c652f72fc Minor, switch to https links where possible 2020-02-19 16:32:44 +03:30
Ebrahim Byagowi 8d19907704 Remove python2 support from tests/utils scripts 2020-02-19 16:17:45 +03:30
Qunxin Liu 493e40ff78 [subset] add one empty byte to glyf table
if it's going to end up empty after subsetting
This will make OTS happy and match what fontTools is doing now.
2020-02-19 12:24:38 +03:30
Ebrahim Byagowi 60f8f384f9 [glyf] Switch to ttf-parser's glyf to path algorithm
It consumes each point at a time and doesn't need to know contour size before hand
2020-02-18 00:49:09 +03:30
Ebrahim Byagowi a94d1af193 [fuzz] minor style fixes 2020-02-12 19:30:31 +03:30
Ebrahim Byagowi 1c015d3e9f [fuzz] minor fuzzer case move, oops 2020-02-12 19:19:37 +03:30
Ebrahim Byagowi 49341faee2 [fuzz] minor, move two fuzzer cases to their correct place 2020-02-12 19:17:18 +03:30
Ebrahim Byagowi 97229244eb [fuzzer] Fix hb-set-fuzzer minor overflow issue
Size shouldn't be smaller than the struct not its pointer size.

Fixes https://crbug.com/oss-fuzz/20655
2020-02-12 15:41:51 +03:30
Garret Rieger 7b42403c1c Add explicit values to the set fuzzer enums. 2020-02-11 13:25:44 -08:00
Garret Rieger e805923310 Add a few basic seeds for the set fuzzer. 2020-02-11 13:25:44 -08:00
Ebrahim Byagowi ff984ed3cd Use multiplication to avoid undefined behaviour per clang
Newer versions of MSVC with /we4146 don't like putting negative sign behind a
unsigned number as https://github.com/harfbuzz/harfbuzz/pull/2069
That however have made https://crbug.com/1050424 this complain:
  src/hb-ot-color-sbix-table.hh:304:28: runtime error: negation of -2147483648 cannot be represented in type 'int';
                                        cast to an unsigned type to negate this value to itself
which apparently can be fixed using this change.

Let's see if this won't make another ubsan complain!
2020-02-11 19:51:52 +03:30
Garret Rieger bca9bc6b92 Add hb-set-fuzzer.
It fuzzes all of the hb_set process methods (intersection, subtraction, union, and symmetric difference).
2020-02-11 03:08:39 +03:30
Ebrahim Byagowi ab2d3ec542 [var] Implement hb_font_get_var_coords_design
Hold design coords and simulate when normalized coords are set directly.
2020-02-08 11:04:34 +03:30
Garret Rieger 2742c81624 Fix page_map corruption in hb_set_t during process().
If a process operation results in less pages then the current set has, it will likely corrupt the page_map since it overwrites page_map entries ahead of where it's processing. This fixes that problem by removing page_map entries that will be dropped. Then dropping orphaned pages and re-indexing retained pages.
2020-02-08 10:27:44 +03:30
Qunxin Liu eb7849a806 [subset] GPOS6 MarkToMark subsetting support 2020-02-06 10:46:05 -08:00
Qunxin Liu 82afc75835 [subset] GPOS4 MarkBase subsetting support 2020-02-06 10:46:05 -08:00
Ebrahim Byagowi b4d3bf1d8a [draw] Add hb_draw_funcs_is_immutable and hb_draw_funcs_make_immutable 2020-02-06 11:52:32 +03:30
Ebrahim Byagowi 63b8190db8 [test] minor
Remained from previous naming.
2020-02-06 11:38:35 +03:30
Ebrahim Byagowi 3a98c7fae1 [glyf] Skip empty contours
As https://savannah.nongnu.org/bugs/index.php?57701
2020-02-06 11:35:48 +03:30
Ebrahim Byagowi c31762e9e8
[test] minor
don't test first ten glyph, just testing cp just like other API calls is enough
2020-02-05 23:12:37 +03:30
Ebrahim Byagowi 43253e404d Merge remote-tracking branch 'upstream/master' 2020-02-05 17:45:19 +03:30
Ebrahim Byagowi a7f694d4b0 Merge branch 'subset_cblc' into master 2020-02-05 16:31:21 +03:30
ckitagawa-work 774725b43a
[subset] Avoid incorrectly dropping cmap for NotoColorEmoji.ttf
NotoColorEmoji.ttf uses two cmap subtables

 Format 14 | Platform ID 0 | Platform Encoding ID  5
 Format 12 | Platform ID 3 | Platform Encoding ID 10

This combination results in the cmap table being dropped during subsetting despite being valid/required.
2020-02-05 16:13:10 +03:30
Qunxin Liu 490ef1cc23 [subset] Fix namerecord ordering
This will fix inconsistency with fontTools.
Also according to the spec, namerecords must be sorted
first by platform ID, then by platform-specific ID,
then by language ID, and then by name ID.
2020-02-01 23:07:47 +03:30
ckitagawa e128f80278 parent 777ba47b50
author ckitagawa <ckitagawa@chromium.org> 1579631743 -0500
committer ckitagawa <ckitagawa@chromium.org> 1580506176 -0500

[subset] Add CBLC support
2020-01-31 16:37:30 -05:00
Qunxin Liu b6a8f5e63c [subset] CMAP table subsetting fix
Not all codepoints smaller than 0xFFFF go to cmap4 table.
Only subset codepoints existing in each table.
This will also make harfbuzz consistent with fontTools' behavior
2020-01-31 10:49:44 -08:00
ckitagawa 7d542a5274 Refactor to two iterators 2020-01-29 10:21:00 -05:00
ckitagawa 49b98e8650 Fix nullptr de-reference failure if both blobs in a subset test are 0 in size 2020-01-28 15:35:53 -05:00
ckitagawa ed857c4680 [subset] Add COLR support 2020-01-28 15:35:53 -05:00
Ebrahim Byagowi d106900bfd [draw][glyf] Implement quadratic to cubic call translation 2020-01-28 15:27:27 +03:30
Ebrahim Byagowi 74fdcdcac8 [draw] Rename conic_to to quadratic_to 2020-01-28 13:45:22 +03:30
Ebrahim Byagowi ac81e94016 Rename hb_outline_decompose to hb_font_draw_glyph and hb_outline_decompose_funcs_t to hb_draw_funcs_t 2020-01-28 13:24:49 +03:30
Ebrahim Byagowi 981125aa2a Rename hb_ot_glyph_* to hb_outline_* 2020-01-27 23:43:54 +03:30
Ebrahim Byagowi 30857089a5 [test][glyph] add subcomponent scale test 2020-01-27 21:16:57 +03:30
Ebrahim Byagowi d809aca8d0
[test] test for not applying morx on horizontal runs if gsub exists
https://github.com/harfbuzz/harfbuzz/pull/2130
2020-01-27 20:52:56 +03:30
Ebrahim Byagowi 1438bae7a5 [ot-glyph] Add fontkit non variables fonts tests 2020-01-26 23:58:34 +03:30
Ebrahim Byagowi 9bb1c79a2c [ot-glyph][test] Avoid sprintf use 2020-01-26 23:58:34 +03:30
Ebrahim Byagowi 99f8e52d5e [ot-glyph] Add fontkits's variations toSVG tests 2020-01-26 23:58:34 +03:30
Ebrahim Byagowi e44982f548 [ot-glyph] Add ttf-parser's outline_glyph tests 2020-01-26 23:58:34 +03:30
Ebrahim Byagowi 5897697250
[test] Increase subset timeout
No random timeout please
2020-01-25 00:32:46 +03:30
Ebrahim Byagowi d1830437c9 [tests] Apply expected results of Mplus1p-Regular subset
Related to #2131
2020-01-25 00:09:50 +03:30
Qunxin Liu 36a5c042d7 [subset] Add "--name-languages" and "--name-legacy" options
Make name table subsetting consistent with fontTools
2020-01-24 23:17:04 +03:30
ckitagawa-work 0e4b2676bd [subset] sbix fix missed offset is_null() check 2020-01-24 20:46:07 +03:30
Ebrahim Byagowi 5532374f61 [ot-glyph] Add a test for #2053 2020-01-24 20:42:12 +03:30
Ebrahim Byagowi e171beeb5f Revert "[subset] Add "--name-languages" and "--name-legacy" options"
Causes tests failures, please reapply when tests are fixed, thanks.

This reverts commit fd85818b5b.
2020-01-24 19:51:32 +03:30
Qunxin Liu fd85818b5b [subset] Add "--name-languages" and "--name-legacy" options
Make name table subsetting consistent with fontTools
2020-01-23 17:24:05 -08:00
Qunxin Liu c370da45ff [subset] Cmap table: remove encodingRecord entry for empty cmap4 subtable 2020-01-23 17:23:55 -08:00
ckitagawa 7dc341fe74 [subset] Fix UBSAN issue in sbix 2020-01-23 23:46:22 +03:30
ariza acb4627eba add api test 2020-01-23 10:50:52 -08:00
ariza 1ab3924b31 refix PR #2087 subset PairPos1
also added oss-fuzz 20211 data fixed by this
2020-01-23 10:50:52 -08:00
Ebrahim Byagowi 7633b7695e
Merge pull request #2016 from ebraminio/glyf
Implement glyph outline path API
2020-01-23 18:51:40 +03:30
Ebrahim Byagowi 02f324c949 [ot-glyph] remove open callback
Apparently it wasn't requested actually and can be detected easily
as paths are opened usually when move command is issued anyway.
2020-01-23 15:12:15 +03:30
Ebrahim Byagowi 684ff3e0cd [ot-glyph] noop->nil, fix close path 2020-01-23 14:48:59 +03:30
ckitagawa b18cb5b5ee Add second fixed test 2020-01-22 10:11:15 -08:00
ckitagawa 8614a30bc9 [subset] Fix sbix fuzz problem 2020-01-22 10:11:15 -08:00
ariza 72cbfb9059 remove empty lookup subtables
Added a variant of subset_offset_array which takes an extra arg passed to serialize_subset for this impl.
Added a new api test "test-subset-gpos" for this.
2020-01-21 16:53:19 -08:00
Qunxin Liu a3cf4ae080 [subset] Add more tests for GPOS1 subsetting
These tests were left out because of issue: https://github.com/fonttools/fonttools/issues/1709
Now re-adding these tests since the issue is resolved.
2020-01-17 13:33:46 -08:00
Qunxin Liu e565d1f9bc [subset] subset lookup/feature/script lists for GSUB/GPOS 2020-01-15 14:04:33 -08:00
ckitagawa 93376a6436 Add unittests 2020-01-15 13:36:01 -08:00
ckitagawa 6bcf57eaa3 Simplify copy and add fuzzing coverage 2020-01-15 13:36:01 -08:00
ckitagawa 78b50a67be Address initial comments 2020-01-15 13:36:01 -08:00
ckitagawa 43b6c865ae [subset] Support sbix subsetting 2020-01-15 13:36:01 -08:00
Ebrahim Byagowi 79fed9a1e4 [ot-glyph] Add open/close callbacks 2020-01-14 17:34:59 +03:30
Ebrahim Byagowi ec1fba1388 [ot-glyph] make hb_ot_glyph_decompose_funcs_t struct opaque 2020-01-14 15:55:23 +03:30
Ebrahim Byagowi d7c3cb18ee [ot-glyph] minor on tests 2020-01-13 18:17:21 +03:30
Ebrahim Byagowi dc03a993d0
Fix collect lookups logic of FeatureTableSubstitution (#2097)
https://crbug.com/oss-fuzz/20036
2020-01-12 14:21:29 +03:30
Ebrahim Byagowi a32ecc15ae
Fix collect lookups logic of FeatureVariationRecord
As "Offset to a feature table substitution table, from beginning of the FeatureVariations table."
from https://docs.microsoft.com/en-us/typography/opentype/spec/chapter2 the record should
match its sanitize logic not the reverse way.

Fixes https://crbug.com/oss-fuzz/20021 and https://crbug.com/oss-fuzz/20022
2020-01-11 15:37:24 +03:30
Qunxin Liu 0b39c48064 [subset] closure lookups for GSUB/GPOS 2020-01-10 13:11:06 -08:00
Ebrahim Byagowi 42f4f1ea50 [ot-glyph] Add tests for hb_ot_glyph_decompose 2020-01-11 00:33:31 +03:30
Ebrahim Byagowi 06a1fcb3b4 [ot-glyphs] fix the tests 2020-01-10 23:12:30 +03:30
Ebrahim Byagowi fddf79fc37 [glyf] minor 2020-01-10 14:25:07 +03:30
Michiharu Ariza d2ab1ec65b fixes oss-fuzz 19978: Null-dereference READ (#2091) 2020-01-10 07:54:16 +03:30
Ebrahim Byagowi 257a197ae7
Fail serialize when map has incorrect value
fixes https://crbug.com/oss-fuzz/19956

am not super happy with the fix, guess we should do some check
before the memcpy anyway as @blueshade7 thinks also,
so let's have it or revert it when we have a better approach for the case.
2020-01-09 22:55:45 +03:30
Qunxin Liu 1db2c1d0da fix for cmap4 and OS_2 subsetting: maximum character code allowed is 0xFFFF 2020-01-09 10:00:32 -08:00
Ebrahim Byagowi 8ed46c3678
[fuzz] minor, add another already fixed case
https://crbug.com/oss-fuzz/19907
2020-01-07 23:43:53 +03:30
Ebrahim Byagowi 341407f7a5
[fuzz] minor, upload another fixed case
https://crbug.com/oss-fuzz/19878
2020-01-07 09:10:24 +03:30
Ebrahim Byagowi 7950beecfc
[subset] Fix null pointer dereference in hvar/vvar subset (#2085)
Rest of the code assumes there is at least one subtable, lets return here if not.

* https://crbug.com/oss-fuzz/19827
* https://crbug.com/oss-fuzz/19847
2020-01-06 21:25:00 +03:30
Ebrahim Byagowi 33c3d63a0a
Merge pull request #1594 from harfbuzz/var-subset
Issue 1558: [subset] TrueType/CFF2 variable font
2019-12-31 13:52:50 +03:30
Evgeniy Reizner b79ceac3c6 Prefer UINT_MAX instead of uint overflow.
Also, prefer HB_FEATURE_GLOBAL_START and HB_FEATURE_GLOBAL_END.
2019-12-15 11:46:05 -08:00
Ebrahim Byagowi 6f76c325e5
[test] Update 10.15 results
Turned out only SFNS, which wasn't available in 10.14 anyway, needed an update
See https://crbug.com/1005969#c37 also
2019-12-10 21:43:11 +03:30
Ebrahim Byagowi 2241a676ba
[test] Add macOS 10.15 related fonts
breaks the test and 10.15 bot, will add the fix in next commit, also adds a broken test for f47cbade1
2019-12-10 19:50:34 +03:30
Behdad Esfahbod b1167d19e9 Fix! 2019-12-05 15:46:58 +00:00
Behdad Esfahbod 5ff410b493 Add files, oops 2019-12-05 15:37:56 +00:00
Behdad Esfahbod 2dc20e632e Implement fallback vertical shaping from Firefox
Fixes https://github.com/harfbuzz/harfbuzz/issues/355
2019-12-05 15:28:42 +00:00
blueshade7 ed94e41065 fixed api test test-ot-glyphname 2019-11-26 18:34:06 +00:00
blueshade7 7a4745ba8d added api test test-ot-glyphname 2019-11-26 18:34:06 +00:00
blueshade7 ea8fdfa079 Merge branch 'master' into var-subset 2019-11-22 15:59:09 -08:00
Ebrahim Byagowi 64a45be519
[ubsan] Don't decrease pointer if match_glyph_data is null (#2048)
Similar to fix on https://github.com/harfbuzz/harfbuzz/pull/2022

Fixes https://crbug.com/1023070
2019-11-09 12:25:33 +03:30
Ebrahim Byagowi 84b86a12d9
[fuzz] Remove just added case
It didn't fail locally but on bots causing timeout, let remove for now.
2019-11-06 09:22:34 +03:30
Ebrahim Byagowi a8f049c9a1
[fuzz] Upload testcase of https://crbug.com/oss-fuzz/18529
Apparently false alarm per last comment and was ok locally also but lets have it here also
2019-11-05 22:26:36 +03:30
Khaled Hosny dd288840d6 [cmap] Check GID before adding ranges in format 4 & 12
Fixes https://github.com/harfbuzz/harfbuzz/issues/2031
2019-10-29 02:09:13 +02:00
Qunxin Liu defe9b6da0 crash fix : Heap-buffer-overflow READ 2
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18513
2019-10-25 13:09:47 -07:00
Qunxin Liu b2fcca6e14 fuzzer crash fix
https://oss-fuzz.com/testcase-detail/5643107869917184
2019-10-24 16:11:30 -07:00
Ebrahim Byagowi 9815ca0338 [ci] Use custom subset fuzzer timeout for failing sanitizer bots 2019-10-25 00:16:23 +03:30
Garret Rieger 95ab110cd9 Optimize intersects_array to fix fuzzer timeout. 2019-10-22 13:33:50 -07:00
Qunxin Liu b33a0d628e fuzzer crash fix: Null-dereference WRITE
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18363
2019-10-22 01:01:08 +03:30
Qunxin Liu 1f0a9d9be9 [subset] GPOS Lookup Type 2: PairPos 2019-10-21 12:35:28 -07:00
Ebrahim Byagowi e766783152 [fuzz] Add https://crbug.com/oss-fuzz/17898 testcase 2019-10-21 22:17:06 +03:30
Qunxin Liu b66094ada0 [subset] GSUB Lookup Type 6: ChainContextSubst 2019-10-18 16:52:55 -07:00
Garret Rieger 831daf4c76 Enforce HB_MAX_LANGSYS limit during layout subsetting. 2019-10-18 15:10:30 -07:00
Ebrahim Byagowi 453050ad30 Merge remote-tracking branch 'upstream/master' into var-subset 2019-10-13 08:45:29 +03:30
Ebrahim Byagowi dc45f22521 [ot-metrics] Don't use mixed scaled and not scaled for generating extents 2019-10-08 23:27:39 +03:30
Ebrahim Byagowi d73cdcf361 [ot-font] Apply font scaling before turning to int 2019-10-08 11:11:18 +03:30
Michiharu Ariza b9ff43c162 Implement gvar table and variable glyf
Split from Ariza's "[subset] TrueType/CFF2 variable font" work on #1594
2019-10-06 08:58:40 +03:30
Ebrahim Byagowi 19d45dcab7 Merge remote-tracking branch 'upstream/master' into var-subset 2019-10-03 13:39:17 +03:30
Qunxin Liu b0c3eb06b6 [subset] GPOS Lookup Type 3: CursivePos 2019-09-25 05:43:25 +09:00
Ebrahim Byagowi 0665dce116 [fuzzer] Don't process output in debug mode as it causes timeout 2019-09-21 17:36:33 +04:30
Qunxin Liu bf66d1bf58 [subset] Add integration tests for cmap14 2019-09-20 07:55:11 +09:00
Evgeniy Reizner 7d4da8b862 Remove duplicated tests from test-ot-tag (#1958) 2019-09-06 12:24:32 -04:00
Behdad Esfahbod 52d19ba459 Minor 2019-09-04 11:28:40 -04:00
Ebrahim Byagowi d3b984d379 Revert in-house pow10 (d80a3ea) and fix oss-fuzz/16922
Probably can be fixed but merging it was wrong so let's revert.
2019-09-02 18:28:03 +04:30
Ebrahim Byagowi 9ff32b79b3 Merge remote-tracking branch 'upstream/master' into glyf-rebase 2019-08-29 19:53:18 +04:30
Ebrahim Byagowi 28620310b8
[test] Avoid alloca use as clang complain
Fixes https://circleci.com/gh/harfbuzz/harfbuzz/108171 complain
2019-08-29 14:55:54 +04:30
Ebrahim Byagowi 875985cd48
[subset] Don't allow malicious fonts to insert unlimited table headers
Fixes https://crbug.com/oss-fuzz/16810
2019-08-29 14:51:22 +04:30
Ebrahim Byagowi a0b4ac4dce Turn 8 spaces to tab across the project
According to the current code style of the project
2019-08-27 02:40:41 +04:30
Ebrahim Byagowi 269a120f13
[subset] Raise the bar in new vs old table size
https://crbug.com/oss-fuzz/16740

This is actually an interesting thing that {h,v}mtx allocates as
much as a font pretends to have glyphs but the solution is not
that obvious as regular fonts can have less than actually containing
metrics in their {h,v}mtx. This change raises the bar to consider this
hmtx 4 byte for every glyph case.

Initially we wanted to just find things allocating crazy amount of
memory but having the assert has led to interesting findings also
so let's don't remove the assert and see what we can find elsewhere.
2019-08-25 20:37:00 +04:30
Ebrahim Byagowi 28aba780c4 [subset] Fix blob leak of _subset2 when returns early
Fixes https://crbug.com/oss-fuzz/16639
2019-08-24 16:11:21 +04:30
Behdad Esfahbod 163a66dc73 [test] Add test for aaa85931f3 2019-08-20 14:22:57 -07:00
Ebrahim Byagowi d59d89b281
[test] Rebase 10.14 trak related test 2019-08-20 13:07:17 +04:30
Ebrahim Byagowi 37de38adea
Merge branch 'master' into remove-coretext-96dpi-assumption 2019-08-20 12:59:33 +04:30
Khaled Hosny da5118da77 [ot-shape] Enable abvm/blwm features by default
Core Text seems to apply them to Latin text, but Uniscribe doesn’t.

See https://github.com/harfbuzz/harfbuzz/pull/1908#issuecomment-521819343
2019-08-16 02:17:32 +02:00
Khaled Hosny 2164bd6f29
[ot-shape] Enable dist feature by default (#1908)
Fixes https://github.com/harfbuzz/harfbuzz/issues/1907
2019-08-16 00:28:41 +02:00
Behdad Esfahbod e56d4ff43b Rename hb_ot_meta_get_entries() to +hb_ot_meta_get_entry_tags() 2019-08-13 21:02:47 -07:00
Ebrahim Byagowi b31d627f15
Increase subset fuzzer timeout to 16s
To satisfy -valgrind and -tsan bots, very ugly
2019-08-11 23:34:48 +04:30
Qunxin Liu 321d5588d4 [subset] Add subsetting for GPOS Lookup Type 1: Single Adjustment Positioning Subtable 2019-08-06 14:06:35 -07:00
Qunxin Liu 37572882e7 [subset] cmap table to use _subset2 and new iterator frameworks 2019-08-05 11:26:34 -07:00
Michiharu Ariza 6b3e093911 Merge branch 'master' into var-subset 2019-07-31 16:04:48 -07:00
Ebrahim Byagowi 8c0a2e68ad
[fuzz] Add dummy call of the added APIs (#1886) 2019-07-30 13:16:15 +04:30
Ebrahim Byagowi 9f2b4956b4
[base] Add hb_ot_layout_get_baseline API 2019-07-30 04:42:51 +04:30
Ebrahim Byagowi 40a4b6ddbd [var] Add a new API, hb_font_set_var_named_instance 2019-07-29 16:23:47 -07:00
Ebrahim Byagowi b6a2281f1a [meta] Make values match their enum type naming 2019-07-30 03:48:23 +04:30
Ebrahim Byagowi 20072a2eca [metrics] Make values match their enum type naming 2019-07-30 03:48:23 +04:30
blueshade7 6e3bfecf35 Merge branch 'master' into var-subset 2019-07-29 12:25:43 -07:00
Ebrahim Byagowi 2c2a2b97db [meta] Rename hb_ot_meta_t to hb_ot_meta_tag_t 2019-07-29 22:43:09 +04:30
Ebrahim Byagowi e21bdf500d
Increase subset fuzzer timeout to 8s
Probably we should just remove timeout when running tsan and vaglrind here, the flaky bots
2019-07-28 22:59:09 +04:30
Ebrahim Byagowi 62932c14bd [meta] Rename ot-metadata to ot-meta per review 2019-07-25 17:49:51 -07:00
Ebrahim Byagowi bc65ebbce7 [meta] hb_ot_metadata_get_entries, tags iteration API 2019-07-25 17:49:51 -07:00
Ebrahim Byagowi 3ac03bd67c [meta] New API, hb_ot_metadata_reference_entry for fetching meta entries 2019-07-25 17:49:51 -07:00
Ebrahim Byagowi 356b68a00a
[metrics] Add a test that actually practices variation (#1858) 2019-07-25 23:22:00 +04:30
blueshade7 5988ab8a4e Merge branch 'master' into var-subset 2019-07-22 14:36:16 -07:00
Khaled Hosny 04c11a19b7
Merge pull request #1851 from khaledhosny/fix-sbix-extents
Fix sbix glyph extents
2019-07-22 16:44:47 +02:00
Ebrahim Byagowi a51aa951b5
[metrics] Fix _get_variation API to works with actual coord values 2019-07-22 18:35:55 +04:30
Khaled Hosny c9796d15e1 Fix sbix glyph extents
* The ‘height’ needs to be negated since the API returns “distance from
  top to bottom side”.
* Similarly, the ‘y_offset‘ needs to be added to the height to get the
  ‘y_bearing’, since sbix’s offset is “the point in the glyph relative
  to its lower-left corner which corresponds to the origin” while
  ‘y_bearing’ is the “top side of glyph from origin”.

With these changes the sbix glyph metrics return values similar to other
tables, as they were otherwise unusable.
2019-07-22 05:42:34 +02:00
Ebrahim Byagowi bdfdac0f26
[ci][fuzzer] print valgrind failure if an error happened 2019-07-19 10:33:00 +04:30
Ebrahim Byagowi 87e628436e Implement a simple API for fetching opentype metrics
Fixes https://github.com/harfbuzz/harfbuzz/pull/1432
2019-07-18 14:15:58 -07:00
blueshade7 4cba7bdae9 regenerate Confortaa subset test expected results 2019-07-18 14:03:33 -07:00
blueshade7 a76d8b0d55 Merge commit '504bb17287c978d60a4a515555852465319f74ed' into var-subset 2019-07-17 14:12:06 -07:00
Qunxin Liu 1da1b4dc94 [subset] For option "--unicodes", add support for "*" to retain all code points 2019-07-15 11:18:50 -07:00
blueshade7 386a4a64f5 regenerate subset api test result SourceHanSans-Regular.41,4C2E.retaingids.otf 2019-07-12 17:05:34 -07:00
blueshade7 670768e5b9 fix inc-bimap for subsetting VarStore with retain-gids 2019-07-12 16:14:23 -07:00
Ebrahim Byagowi f8242b61ab
[fuzz] Increase subset runner timeout for tsan bot
Now is flaky let's just increase and maybe investigate later
2019-07-11 15:10:36 +04:30
Ebrahim Byagowi b65bad18aa
[fuzz] Don't fail when blob is empty
And enable more tests able to trig the issue.
2019-07-11 14:31:55 +04:30
Ebrahim Byagowi c85f624b51 Force blob generation and memory check in hb-subset-fuzzer 2019-07-10 23:38:07 +04:30
blueshade7 0eef8113d8 retain gids in HVAR so in sync with fontTools
regenerate Comfortaa subset test results
2019-07-09 11:43:59 -07:00
blueshade7 6e35668b45 fix var-subset build 2019-07-09 09:47:54 -07:00
blueshade7 8bf989ea70 update from master 2019-07-08 17:13:29 -07:00
Michiharu Ariza 5763a92749 Merge branch 'master' into var-subset 2019-07-01 15:17:19 -07:00
Behdad Esfahbod f53590971c [test] Make Unicode tests strict against internal UCD
https://github.com/harfbuzz/harfbuzz/pull/1799
2019-06-27 13:42:51 -07:00
David Corbett d42264f151 Test at least one character per Unicode version 2019-06-27 13:38:03 -07:00
Michiharu Ariza 8341c0b304 add test case file 2019-06-27 08:43:31 -07:00
Michiharu Ariza 82d4bfb8f3 enable cff subset tests
add Unicode UCS-4 cmap
fix Unicode bits in OS/2
add Unicode cmap sub-table in SourceHanSans-Regular_subset.otf
regenerate cff subset test expected results
2019-06-14 11:08:59 -07:00
David Corbett 4f37c0db9b Remove 'mym3' 2019-06-11 15:41:37 -07:00
Michiharu Ariza 90872a29ee change assert(false) to failure 2019-06-11 12:42:28 -07:00
Michiharu Ariza 6f35cf7a63 regenerate SourceSerifVariable expected subset results 2019-06-06 09:15:34 -07:00
Michiharu Ariza 66361c72f6 restore gvar/MVAR/HVAR tables in subset tests 2019-06-05 14:51:04 -07:00
Michiharu Ariza 4ddab6facc Merge branch 'master' into var-subset 2019-06-05 11:21:27 -07:00
Michiharu Ariza 65e66a2d37 added test data 2019-06-03 16:31:41 -07:00
Bruce Mitchener 5846884f86 test: Use nullptr in C++ code. (#1744) 2019-06-03 12:30:25 +04:30
Behdad Esfahbod 87dd4bff1c [math] Rename HB_MATH_GLYPH_PART_FLAG_EXTENDER
To HB_OT_MATH_GLYPH_PART_FLAG_EXTENDER.  Added a deprecated macro.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1734
2019-05-30 11:26:17 -04:00
Ebrahim Byagowi 8a13371847
[test] minor, fix copyright
nothing important, fixing a copy paste error inconsistency
2019-05-28 13:54:45 +04:30
Ebrahim Byagowi 13316ac5d4
[test] minor style improve 2019-05-28 13:48:39 +04:30
David Corbett d64fb9db52 [use] Allow U+1A60 TAI THAM SIGN SAKOT after vowel 2019-05-27 13:14:03 -04:00
Qunxin Liu e1a5ce6aa6 Fix fuzzer crash testcase
Add a check for stringOffSet(uint16) overflow,
return early if overflow happens
2019-05-24 15:26:20 -04:00
rsheeter 96de94768b
Merge pull request #1722 from googlefonts/glyf
[subset] Use iterators in glyf/loca subsetting
2019-05-24 11:22:41 -07:00
Rod Sheeter e662532833 [subset] Cppcheck complaints 2019-05-24 10:39:56 -07:00
Qunxin Liu 993d81b9c5 [subset] Add one ttf file with fvar/STAT tables to integration test
Ignore gvar/MVAR/HVAR table
add support for --nameIDs=* option
2019-05-22 17:20:45 -07:00
Rod Sheeter 51a0129f73 [subset] Thar be comparison of integers of different signs 2019-05-21 20:12:19 -07:00
Garret Rieger b928de91a7 [subset] Add test/subset/data/expected/layout to dist list. 2019-05-21 13:02:11 -07:00
Garret Rieger c740c8636b [subset] Add integration tests for SingleSubst. 2019-05-21 13:02:11 -07:00
Rod Sheeter 349d692b0e [subset] Iter in and out for loca 2019-05-21 12:38:53 -07:00
Rod Sheeter d1b12a5465 Merge branch 'master' of https://github.com/harfbuzz/harfbuzz into glyf 2019-05-20 21:29:54 -07:00
Rod Sheeter 5cedda5e4a [subset] Fix null pointer deref, tidy up a bit 2019-05-20 21:25:42 -07:00
Rod Sheeter 8a84b540c7 [subset] Tests passing using iterator based glyf 2019-05-20 21:25:42 -07:00
Rod Sheeter 82bbec3063 Merge branch 'master' of https://github.com/harfbuzz/harfbuzz into glyf 2019-05-20 21:25:42 -07:00
rsheeter 3a4c928fcf [subset] Fix glyf tests except hint stripping & local test asan 2019-05-20 21:25:42 -07:00
Garret Rieger 0ff3618c2d [subset] Use hb_subset_input_t inside of subset_options_t so that input defaults are shared between the library and cli. 2019-05-20 13:35:46 -07:00
Garret Rieger 3be0ffe45d [subset] Add drop tables to subset input. 2019-05-20 13:35:46 -07:00
Behdad Esfahbod 9ef241cd40 [test] Add one more 2019-05-20 11:38:02 -04:00
Behdad Esfahbod 3efb7af7e2 [STAT] Fix sanitize condition
Oops!

Fixes https://oss-fuzz.com/testcase-detail/5696825891225600
2019-05-20 11:37:16 -04:00
Garret Rieger 6555f20958 [subset] Truncate empty gids at the end in retain-gids mode. 2019-05-16 10:34:53 -07:00
David Corbett 125c45ed36 Convert Consonant_Initial_Postfixed to CONS_MED 2019-05-15 14:34:25 -07:00
David Corbett 99ca956c13 Fix record-test.sh on machines without sha1sum 2019-05-15 14:34:25 -07:00
Behdad Esfahbod f39934983f [ucdn] Fix Hangul composition
https://github.com/grigorig/ucdn/issues/23
2019-05-14 00:13:21 -07:00
Behdad Esfahbod 148d883680 [test] Don't call deprecated API 2019-05-13 14:34:53 -07:00
Ebrahim Byagowi 30c059a978
[test] minor, fix -Weverything bot 2019-05-11 18:48:41 -04:00
Ebrahim Byagowi 25531a3039
[test] minor
style fix and add return statement
2019-05-11 19:50:42 +00:00
Behdad Esfahbod 25a5b287f2 Fix sanitize fail of extension sublookups
Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=960331
2019-05-10 16:03:20 -07:00
Garret Rieger e8ef0e627c [subset] WIP convert hdmx subsetting to use iterators. 2019-05-08 15:47:24 -07:00
Ebrahim Byagowi df237d2fe7
[test] Add https://crbug.com/oss-fuzz/14641 testcase
As 503748d fix
2019-05-08 14:17:14 -07:00
Behdad Esfahbod 5ac4ab6868 [subset] fix for name table serializing with new serializer machinery 2019-05-07 10:59:03 -07:00
Behdad Esfahbod 49b1c763a0 [test] Run "fonttools ttx" instead of "ttx" 2019-05-02 16:19:34 -07:00
Michiharu Ariza 1223a352b7 Merge branch 'master' into var-subset 2019-04-29 16:43:48 -07:00
Ebrahim Byagowi 6d6edc8b25
[valgrind] Use libtool and support run-subset-fuzzer-tests (#1668) 2019-04-28 11:54:07 -07:00
Ebrahim Byagowi 62c6e17072 [test] Add crbug.com/oss-fuzz/14474 testcase
Fixed at 6977a95f
2019-04-28 10:55:07 -07:00
Qunxin Liu 1ca4b5c770 [subset] Add unit test for str de-dup
Also move the implementation of some methods from the .cc to the .hh
2019-04-26 15:24:47 -07:00
Qunxin Liu 6faac8df83 [subset] Subsetting Name Table Step 4
Add unit test and integration test
2019-04-26 15:24:47 -07:00
Behdad Esfahbod 42f4bd6b80 Minor warning fix again 2019-04-18 19:06:07 -04:00
Michiharu Ariza ba0386060d fix oss-fuzz issue 14345 2019-04-18 18:18:05 -04:00
Michiharu Ariza c87488b46d Merge branch 'master' into var-subset 2019-04-17 12:07:15 -07:00
Michiharu Ariza 49fe81fdeb updated api test results for HVAR/VVAR subset changes 2019-04-17 11:48:12 -07:00
David Corbett 6745a600bf Comment out ot_languages where fallback suffices 2019-04-17 10:28:59 -04:00
Michiharu Ariza 6cde814a36 Merge branch 'master' into var-subset 2019-04-16 11:35:07 -07:00
Behdad Esfahbod b7384c89e2 [fuzzing] Run valgrind with --leak-check=full 2019-04-15 16:53:10 -04:00
Behdad Esfahbod 3ff66c0029 [fuzzing] Fail if valgrind is requested but not found 2019-04-15 16:52:21 -04:00
Michiharu Ariza 3e524bf772 fix VarData serialize to remove unused data sets
add api test case for that
2019-04-12 12:48:48 -07:00
Michiharu Ariza 9e79285ef3 Merge branch 'master' into var-subset 2019-04-10 17:24:29 -07:00
Michiharu Ariza ab9d30965d Add tt var metrics test cases & bug fixes 2019-04-10 17:21:37 -07:00
Michiharu Ariza e44b83aac0 replace test font SourceHanSans with its subet 2019-04-05 10:15:08 -07:00
Behdad Esfahbod 3bed03dc6a [indic] Add back medial-consonant to grammar
Fixes https://github.com/harfbuzz/harfbuzz/issues/1592
2019-03-29 18:27:21 -07:00
Behdad Esfahbod f8803fbace [khmer] Add trailing Coeng to syllable grammar
Fixes https://github.com/harfbuzz/harfbuzz/issues/1541
2019-03-29 18:27:21 -07:00
Michiharu Ariza 0008963b28 add support of anchor point & SCALED/UNSCALED_COMPONENT_OFFSET
some code cleanup
2019-03-29 18:27:21 -07:00
Behdad Esfahbod ea281aa8d0 Use class templates for Null objects
This allows partial-instantiating custom Null object for template Lookup<T>.
Before, this had to be handcoded per instantiation.  Apparently I missed
adding one for AAT::ankr.lookupTable, so it was getting the wrong (generic)
null for Lookup object, which is wrong and unsafe.

Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=944346
2019-03-29 18:27:21 -07:00
Michiharu Ariza 9c5d694af2 add HVAR & VVAR advance width api test 2019-03-29 18:27:21 -07:00
Michiharu Ariza ae3db1f4e3 added api test for subset VVAR & bug fix
added a mod copy of SourceSerifVariable-Roman.ttf with VVAR as a test font
2019-03-29 18:27:08 -07:00
Michiharu Ariza b3007ec209 regenerated expected full fonts data after fontTools bug 1550 fixed 2019-03-29 18:26:46 -07:00
Michiharu Ariza fe5aa8b36c added TT VF full font test & fixed bugs
updated CFF2 VF api test results too
2019-03-29 18:26:46 -07:00
Michiharu Ariza 2bd2e656f9 update CFF2 test results 2019-03-29 18:26:20 -07:00
Michiharu Ariza 212dcb758c add api test cases for HVAR with index map (and fix) 2019-03-29 18:26:20 -07:00
Michiharu Ariza dc10a7ef60 add gvar & HVAR retain-gids test cases 2019-03-29 18:26:20 -07:00
Michiharu Ariza 43420dfa96 fix test build 2019-03-29 18:26:20 -07:00
Michiharu Ariza 6ee71166b0 add api tests for subset gvar & HVAR; bug fixes 2019-03-29 18:26:20 -07:00
Michiharu Ariza 6e066464f0 replaced tt var api test with a composite glyph
for better coverage
2019-03-29 18:26:20 -07:00
Michiharu Ariza 511518c759 add api test for tt var advance widths
stripped HVAR from SourceSansVariable-Roman.abc.ttf so glyf gets parsed
2019-03-29 18:26:20 -07:00
Michiharu Ariza 139e87b56c fix tt var extents & add test 2019-03-29 18:25:35 -07:00
Michiharu Ariza 9584b090bb cff2 subset fuzzer issues (#1619)
* add check to FDArray::serialize

* add test files

* fix off by one
2019-03-29 18:25:21 -07:00
Ebrahim Byagowi 5bbe78a0f3 Allow zero length ranges in sanitization (#1617)
Fixes fvar table sanitization where there are no named instance
by allowing zero length ranges starting from Null() address.

Fixes #1607
2019-03-29 18:15:00 -07:00
Ebrahim Byagowi 9b5556d985 Add a macOS 10.14.3 fonts tests (#1608) 2019-03-29 18:15:00 -07:00
Garret Rieger d0b6d539f6 Make hb_subset_input_glyph_set () actually do something. 2019-03-29 18:14:59 -07:00
Behdad Esfahbod 21bb80ebf2 [indic] Add back medial-consonant to grammar
Fixes https://github.com/harfbuzz/harfbuzz/issues/1592
2019-03-28 20:50:04 -07:00
Behdad Esfahbod 5ab6de7a6f [khmer] Add trailing Coeng to syllable grammar
Fixes https://github.com/harfbuzz/harfbuzz/issues/1541
2019-03-28 20:23:12 -07:00
Behdad Esfahbod ec2a5dc859 Use class templates for Null objects
This allows partial-instantiating custom Null object for template Lookup<T>.
Before, this had to be handcoded per instantiation.  Apparently I missed
adding one for AAT::ankr.lookupTable, so it was getting the wrong (generic)
null for Lookup object, which is wrong and unsafe.

Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=944346
2019-03-26 16:23:40 -07:00
Michiharu Ariza bcb4e505d6
cff2 subset fuzzer issues (#1619)
* add check to FDArray::serialize

* add test files

* fix off by one
2019-03-15 13:46:25 -07:00
Ebrahim Byagowi 8aaab78efc
Allow zero length ranges in sanitization (#1617)
Fixes fvar table sanitization where there are no named instance
by allowing zero length ranges starting from Null() address.

Fixes #1607
2019-03-14 16:49:42 -07:00
Ebrahim Byagowi 8b6eb6cf46
Add a macOS 10.14.3 fonts tests (#1608) 2019-03-08 01:33:41 +03:30
Garret Rieger 4f37ab63de Make hb_subset_input_glyph_set () actually do something. 2019-03-01 10:49:46 -08:00
Michiharu Ariza a5e933eba0 Updated expected/cff-japanese fonts with retained FDs 2019-02-08 14:44:13 -08:00
Michiharu Ariza e2856c2d85 retain FDSelect & FDArray with --retain-gids
so in sync with fonttools behavior
2019-02-07 15:32:32 -08:00
Michiharu Ariza 9328354a83 separate CFF from TrueType in full font tests 2019-02-04 11:28:15 -08:00
Michiharu Ariza ec30a8a9ac removed unused test data 2019-02-01 15:58:03 -08:00
Michiharu Ariza c12862657f added desubroutinize & retain-gids full test cases with CFF fonts
and CFF retain-gids fixes
2019-02-01 14:50:01 -08:00
Michiharu Ariza f2908b4d8f Implement subset --regain-gids option with CFF1/2
along with api tests & expected results
2019-01-31 14:16:37 -08:00
Garret Rieger dc04261a5b [subset] Update the subset fuzzer to determine which options to use based on data in the fuzzing test case.
Add support for toggling retain_gids.
2019-01-30 15:23:19 -08:00
Garret Rieger e6ffcc5904 [subset] Add expected files for retain-gids integration tests. 2019-01-29 13:19:21 -08:00
Garret Rieger a903f9c228 [subset] Add some subsetting integration tests covering retain gids. 2019-01-29 13:19:21 -08:00
Garret Rieger ccc59dc612 [subset] Add unit test for glyf subsetting and retain gids. 2019-01-29 13:19:21 -08:00
Behdad Esfahbod a9321cb5f8 Fix mac test 2019-01-25 16:11:45 +01:00
Behdad Esfahbod 06358ae974 [AAT] Add test for recent Ligature stack fix, using Zapfino on Mac 2019-01-25 15:11:47 +01:00
Behdad Esfahbod 00f06d1aa6 Fix test 2019-01-24 16:11:05 +01:00
Behdad Esfahbod 9f31417733 Form cluster for Emoji sub-region tag sequences
Fixes https://github.com/harfbuzz/harfbuzz/issues/1556
2019-01-24 16:08:33 +01:00
Behdad Esfahbod 5034f8f2ab Fix macos tests with previous commit 2019-01-24 12:50:38 +01:00
Behdad Esfahbod 3ecda71041 Adjust mark offsets when zeroing from fallback mark positioning code
Adjust tests.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1532
2019-01-24 12:28:24 +01:00
Behdad Esfahbod cbe0ed117a [AAT] Re-enable tests MORX-31 and MORX-41 2019-01-23 20:45:18 +01:00
Behdad Esfahbod 410731d3fb [test/text-rendering-tests] Update from upstream 2019-01-23 20:31:06 +01:00
Behdad Esfahbod 789396ed6b Remove wrongly added files 2019-01-22 10:51:21 +01:00
Michiharu Ariza 28917e58f9 init interp_env_t::hintmask_size
fixes issue #1547
2019-01-18 09:43:51 -08:00
Behdad Esfahbod 6879efc2c1 [AAT] Fix anchor bound checking, again
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12532
Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=922303
2019-01-17 14:08:02 -05:00
Tor Arne Vestbø f401f85a5a Remove assumption about Core Text working in 96 DPI
Core Text doesn't actually have a concept of DPI internally, as it
doesn't rasterize anything by itself, it just generates vector paths
that get passed along to Core Graphics.

In practice this means Core Text operates in the classical macOS
logical DPI of 72, with one typographic point corresponding to one
point in the Core Graphics coordinate system, which for a normal
bitmap context then corresponds to one pixel -- or two pixels for
a "retina" context with a 2x scale transform.

Scaling the font point sizes given to HarfBuzz to an assumed DPI
of 96 is problematic with this in mind, as fonts with optical
features such as 'trak' tables for tracking, or color glyphs,
will then base the metrics off of the wrong point size compared
to what the client asked for.

This in turn causes mismatches between the metrics of the shaped
text and the actual rasterization, which doesn't include the 72
to 96 DPI scaling.

If a 96 DPI is needed, such as on the Web, the scaling should be
done outside of HarfBuzz, allowing the client to keep the DPI of
the shaping in sync with the rasterization.

The recommended way to do that is by scaling the font point size,
not by applying a transform to the target Core Graphics context,
to let Core Text choose the right optical features of the target
point size, as described in WWDC 2015 session 804:

  https://developer.apple.com/videos/play/wwdc2015/804/
2019-01-15 13:26:35 +01:00
Behdad Esfahbod 91d774712f [test] Add test for previous commit 2019-01-14 15:31:31 -05:00
Behdad Esfahbod 7a6686a589 [AAT] Fix mort ContextualSubtable offset access
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12312
2019-01-14 15:09:14 -05:00
Behdad Esfahbod a3fa7d3336 [AAT] Fix ankr table access
Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=918340
2019-01-14 14:37:36 -05:00
cclauss 26c5b54fb0 CircleCI: Test for Python 3 syntax errors and undefined names (#1522)
Catch missing imports and errors like #1520 and #1521

__E901,E999,F821,F822,F823__ are the "_showstopper_" [flake8](http://flake8.pycqa.org) issues that can halt the runtime with a SyntaxError, NameError, etc. Most other flake8 issues are merely "style violations" -- useful for readability but they do not effect runtime safety.
* F821: undefined name `name`
* F822: undefined name `name` in `__all__`
* F823: local variable name referenced before assignment
* E901: SyntaxError or IndentationError
* E999: SyntaxError -- failed to compile a file into an Abstract Syntax Tree
2018-12-31 07:00:43 +03:30
Behdad Esfahbod 686e6f2e40 Fix automake warnings
[skip ci]
2018-12-30 11:28:06 -05:00
cclauss b5c12b9f4d print() is a function in Python 3 (#1520) 2018-12-30 15:37:28 +03:30