Commit Graph

10500 Commits

Author SHA1 Message Date
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
Evgeniy Reizner
f44e1dc07d Fix spelling. 2020-02-27 13:33:56 +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
Garret Rieger
50129b03a1 Add a reverse () call to hb_array_t. 2020-02-26 11:09:54 -08:00
Garret Rieger
38c6598c1c Switch to C style comments. 2020-02-26 11:09:54 -08:00
Garret Rieger
52b6e0baa0 When serializing cmap14 order the offsets from smallest to largest.
Current versions of OTS fail fonts with cmap 14's who's last offset does not point to the a block at the end of the table.
2020-02-26 11:09:54 -08:00
ariza
a99134c5be add oss-fuzz 20886 test file 2020-02-26 09:58:03 -08:00
ariza
d0aaba5c50 fixes oss-fuzz 20886
hb_set_t::resize () is needed after compact()
2020-02-26 09:35:32 -08:00
Ebrahim Byagowi
05a25c1a5b
[cff] minor, remove unused fields 2020-02-26 19:35:27 +03:30
Ebrahim Byagowi
9fe0dc3464 [draw] Pass draw_helper_t itself around instead recreating it
Specially helpful if we want to change the design
2020-02-26 17:40:46 +03:30
Ebrahim Byagowi
1b8b863898 minor 2020-02-26 16:36:48 +03:30
Ebrahim Byagowi
4cdaa9d1f4 [glyf] Simplify contour end logic
So no need for infinite loop here
2020-02-26 16:29:14 +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
Ebrahim Byagowi
073d4954e0 [draw] Port glyf path extract to draw_helper_t 2020-02-26 15:40:40 +03:30
Ebrahim Byagowi
0ebf3a4e62 [draw] Move common CFF path building logic to draw_helper_t 2020-02-26 15:15:22 +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
Ebrahim Byagowi
c21eb86bfd
Merge pull request #2163 from harfbuzz/absolute-link
added add_link_abs()
2020-02-26 02:54:38 +03:30
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
de896278f7 coding & comment tweaks 2020-02-25 07:12:20 -08:00
Ebrahim Byagowi
2f97aa65e5 [cff] Make sure previous is ended on processing a seac 2020-02-25 18:07:44 +03:30
Ebrahim Byagowi
acc2d4738e [cff] Make path extract easier to read and more defensive 2020-02-25 18:05:48 +03:30
Ebrahim Byagowi
b59eb54f70 [glyf] Refactor, move get_points inside Glyph 2020-02-25 12:56:32 +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
f00eb4ebfa [gvar] Don't compare against Null address 2020-02-24 09:25:19 +03:30
Ebrahim Byagowi
19b78d56cd [gvar] Accept coord_count even if is higher than gvar's axisCount 2020-02-24 09:25:18 +03:30
Ebrahim Byagowi
197e2e929b [gvar] Return gracefully even if gvar wasn't used at all 2020-02-24 08:55:35 +03:30
Ebrahim Byagowi
346ab9884b [gvar] Return gracefully even if coords_count != gvar's axis count
It shouldn't be that common to have the situation, even so, no need to
reject entire a glyph even if gvar isn't used.
2020-02-24 08:48:54 +03:30
Ebrahim Byagowi
5f23a76e99 [cff] Don't remove coords const qualification
We should find some way to audit all the const removals, perhaps by
enabling -Wold-style-cast warning on the project and turning all the
implicit const removals to const_cast.
2020-02-24 08:23:25 +03:30
Michiharu Ariza
ff5223ba60
remove invalid glyphs from closure (#2188)
fix issue #2186
2020-02-23 15:53:21 -08:00
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
Ebrahim Byagowi
a46ba770ab [number] minor 2020-02-22 17:15:06 +03:30
ariza
4aa354beba chain second OffsetTo::serialize_copy() to first 2020-02-21 10:17:26 -08:00
ariza
6120f50c8f fix Head with link.bias 2020-02-21 10:17:26 -08:00
ariza
e65bff0943 workaround whence_t as bit-field 2020-02-21 10:17:26 -08:00
ariza
1aed6d223c fix whence=Head; position as 28 bits 2020-02-21 10:17:25 -08:00
ariza
4ca8e0d989 re-implement Tail; rewrote name table with it 2020-02-21 10:17:25 -08:00
ariza
c1313e4be2 minor: undid unintended change 2020-02-21 10:17:25 -08:00
ariza
9c65680b48 rename enums to avoid conflict on win 2020-02-21 10:17:25 -08:00
ariza
555f6f1daa merge add_link_abs() into add_link() 2020-02-21 10:17:25 -08:00
ariza
017cd945bf added add_link_abs() 2020-02-21 10:17:25 -08:00
Ebrahim Byagowi
07504569d5 [gsub] minor format 2020-02-21 13:05:44 +03:30