Commit Graph

20 Commits

Author SHA1 Message Date
Behdad Esfahbod 3c972867b9 More s/hb_font_get_glyph_shape/hb_font_draw_glyph/ 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 3c84aa8416 [cff] Add a max work counter
Set to 10,000 per interpretation right now.

Fixes https://github.com/harfbuzz/harfbuzz/issues/3700
Fixes https://oss-fuzz.com/testcase-detail/5667125715927040
2022-07-18 13:57:59 -06:00
Behdad Esfahbod b8c7c0a0e6 [fuzzer] In 50% of runs don't fail the allocator 2022-07-01 15:25:09 -06:00
Behdad Esfahbod 151f205819 [draw] Emit move_to immediately, like other operators 2022-02-13 13:21:15 -06:00
Behdad Esfahbod f1a9a9ccaf [draw-state] Pass state down to callbacks 2022-02-13 13:21:14 -06:00
Behdad Esfahbod 1740916ede [draw] Remove check for no-op
This is unnecessary overhead. Up to rasterizers to handle this.  Plus,
this throws off point-numbers in uses that rely on it.

Disabled one test that broke with this.
2022-02-13 13:21:14 -06:00
Behdad Esfahbod 8b4f429000 [draw] Virtualize hb_font_draw_glyph() into hb_font_get_glyph_shape()
To be implemented in hb-ft.
2022-02-13 13:21:14 -06:00
Behdad Esfahbod 2bed4f46fb [draw] Fix draw signatures 2022-02-13 13:21:14 -06:00
Behdad Esfahbod 08e1096609 [draw-fuzzer] Fix signatures 2022-02-13 13:21:14 -06:00
Behdad Esfahbod e0ac6c587b Remove remaining traces of HB_EXPERIMENTAL_API 2022-02-13 13:21:14 -06:00
Ebrahim Byagowi 057769b1a3 [fuzzer] minor 2020-08-12 02:40:55 +04:30
Ebrahim Byagowi c33e8006fd [fuzz] Implement failing allocator 2020-07-29 07:35:34 +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 755a77d660 Move outline draw API behind HB_EXPERIMENTAL_API directive 2020-03-13 08:25:53 +03:30
Ebrahim Byagowi cb65150fec
[draw] minor 2020-02-29 16:12:54 +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
Ebrahim Byagowi 1b8b863898 minor 2020-02-26 16:36:48 +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 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