Commit Graph

1664 Commits

Author SHA1 Message Date
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