src/hb-ot-glyf-table.hh


Log

Author Commit Date CI Message
Behdad Esfahbod 00cb8c62 2022-05-05T10:33:50 [subset] Don't go into glyf table if it's empty
Behdad Esfahbod a02fb4a0 2022-03-25T12:56:19 [glyf] Don't bail rendering glyf even if gvar failed Part of https://github.com/harfbuzz/harfbuzz/issues/3506
Behdad Esfahbod d2998faa 2022-02-16T14:37:09 Merge pull request #3410 from harfbuzz/boring-expansion [Boring Expansion] >64k loca & hmtx tables This does two things: The num-glyphs reported by the face now is the maximum reported by the maxp and that deduced from the length of the loca table; I think this is the right thing to do anyway; According to OpenType such loca tables are invalid. The interpretation hmtx tables that have excessive bytes at the end, again, invalid according to OpenType, has changed. Previously we were interpreting those excessive bytes as extra lsb values. Now we interpret them as extra advance values, the last of which is repeated for all missing glyphs. Again, these are tables that are invalid according to OpenType, and the advances are for glyph indices beyond maxp table's num-glyphs. The combined effect is that the font can have shapes and advances for gid's beyond the maxp limit of 64k. In fact, maxp table becomes optional.
Behdad Esfahbod c8fd8c13 2022-02-15T18:02:53 [ot-face] Use core tables
Ebrahim Byagowi d4588204 2022-02-13T23:49:41 [draw/glyf] Emit empty contours This makes it actually match freetype behaviour even though rasterizer should filter such contours specially for stroking. See https://github.com/harfbuzz/harfbuzz/pull/3411#discussion_r802283827 for the context.
Behdad Esfahbod 0858463a 2022-02-11T14:42:15 [draw/glyf] Don't skip empty contours of size 2 See: https://github.com/harfbuzz/harfbuzz/pull/3411#discussion_r804988217
Behdad Esfahbod 370bec93 2022-02-04T18:40:44 [draw] Rename internal draw_session_t to hb_draw_session_t
Behdad Esfahbod c681331c 2022-02-03T14:36:12 [draw] Rename internal draw_helper_t to draw_session_t
Behdad Esfahbod a9dd9f0b 2022-02-03T13:58:36 [draw] Add public move_to/line_to/... API that take a draw-state
Behdad Esfahbod 35190dc9 2022-02-02T16:08:40 [draw] Convert API to float instead of hb_position_t
Behdad Esfahbod dd7b6e2c 2022-02-02T14:46:10 [draw] Remove EXPERIMENTAL_API tag
Behdad Esfahbod e59da287 2022-02-01T16:32:39 [glyf] Don't store face in accelerator
Behdad Esfahbod ac1bb3e3 2022-01-20T11:47:17 [machinery] Move accelerators to constructor/destructor
Behdad Esfahbod e062376e 2022-01-19T17:09:34 [machinery] Make accelerator lazy-loader call Xinit/Xfini Instead of init/fini. To isolate those functions. To be turned into constructor/destructors, ideally one per commit (after some SFINAE foo.)
Garret Rieger 94ba4d5a 2022-01-18T16:35:30 [subset] Fix bound check when setting overlap bit. length() shouldn't be used again as the end of instruction offset is already included in flags_offset.
Behdad Esfahbod 6ed22de1 2021-12-08T10:40:40 [CONFIG] Fix HB_NO_VERTICAL build without HB_TINY
Behdad Esfahbod 53eebc7c 2021-12-08T08:32:41 [CONFIG] Add HB_NO_VERTICAL
Garret Rieger 59914382 2021-11-26T14:19:39 [subset] Don't pad glyphs when using long loca.
Garret Rieger a52c6df3 2021-09-27T11:22:05 [subset] Fix bug in composite operation counting. Adding the result of add_gid_and_children to operation count over counts the number of operations.
Behdad Esfahbod c852b868 2021-09-19T16:30:12 Rename HBGlyphID to HBGlyphID16
Garret Rieger c0f3af91 2021-08-11T16:20:05 [subset] speed up add_gid_and_children and adjust op limit. Fix for fuzzer timeout: https://oss-fuzz.com/testcase-detail/5001604901240832. - Operation limit is per glyph, so 100,000 should still be far more than needed. - Switches from for(...) to while(...) loop for iteration. for(...) calls it.end() which in this case triggers a complete iteration. - Cache CompositeGlyph size in the iterator to avoid needing to recalculate it.
Garret Rieger e39c3bde 2021-08-10T11:41:55 [subset] fix bug in parsing glyf flags. the bytes of the flag stream were being treated as signed integers instead of unsigned as specified in the spec.
Garret Rieger 46d4a5e6 2021-07-29T15:07:13 [subset] Convert subset plan to use a flags bit set.
Garret Rieger 09474d8d 2021-06-29T16:07:14 [subset] Fix fuzzer timeout in add_gid_and_children. The composite glyph graph isn't check for max operations by sanitize so track an operations count during the graph traversal.
Behdad Esfahbod 2337f0d0 2021-07-08T10:58:50 Internally use hb_malloc/.../hb_free instead of malloc/.../free Redefining those stock names as macros was conflicting with gcc 10 headers. Fixes https://github.com/harfbuzz/harfbuzz/issues/3044
Behdad Esfahbod bb48bf52 2021-07-08T10:53:45 Rename misc uses of "free" In preparation for fixing https://github.com/harfbuzz/harfbuzz/issues/3044
Qunxin Liu d07f789a 2021-06-09T15:36:40 [subset] support option "--notdef-outline"
Garret Rieger 73ff04a3 2021-05-18T16:54:01 [subset] add option to have the subsetter set the mac overlaps flag on each glyph.
justvanrossum d01ebeae 2021-02-17T10:13:54 calculate extents based on scaled then rounded values; undo two of the earlier test result adjustments
Behdad Esfahbod d7e2a51d 2021-02-11T10:55:03 [minor] Add unlikely() when checking for error
ebraminio d03eecb4 2020-08-11T16:40:40 [glyf] minor style improvement
ebraminio 0c156189 2020-08-10T08:52:01 [glyf] minor
Ebrahim Byagowi f06d7331 2020-08-10T08:35:06 [glyf] minor
Ebrahim Byagowi db96c7f6 2020-08-10T08:23:21 [glyf] protect CompositeGlyph fields Introduce methods instead
ebraminio e5fe363a 2020-08-10T07:39:36 [glyf] Minor, don't pass accelerator_t to points_aggregator_t No need to pass it to aggregator itself
ebraminio 2b9927f7 2020-08-10T06:26:21 [glyf] minor No need to pass glyph_for_gid as a lambda now that we are passing the accelerator itself
Ebrahim Byagowi ffe06c8f 2020-08-08T13:17:34 [glyf] Guard all the public APIs against null pool runs Fixes https://crbug.com/oss-fuzz/24575 and https://crbug.com/oss-fuzz/24737
Ebrahim Byagowi 1f519c25 2020-08-07T01:21:19 [glyf] Optimize retrieval of hmtx/vmtx/gvar This should make glyf/gvar faster as makes it to invoke less table wrapper atomic operations and things. $ meson build -Dexperimental_api=true --buildtype=release && ninja -Cbuild && build/perf/perf "--benchmark_filter=glyf.*- ot -" Before: extents/glyf - ot - SourceSerifVariable 46091 ns 46036 ns 16173 extents/glyf/vf - ot - SourceSerifVariable 4160142 ns 4154913 ns 174 extents/glyf - ot - Comfortaa 25754 ns 25726 ns 27030 extents/glyf/vf - ot - Comfortaa 2627804 ns 2624596 ns 265 extents/glyf - ot - Roboto 33556 ns 33540 ns 18513 draw/glyf - ot - SourceSerifVariable 2716848 ns 2715438 ns 256 draw/glyf/vf - ot - SourceSerifVariable 4602379 ns 4598907 ns 151 draw/glyf - ot - Comfortaa 1659364 ns 1658142 ns 417 draw/glyf/vf - ot - Comfortaa 2845100 ns 2842549 ns 246 draw/glyf - ot - Roboto 1571509 ns 1570060 ns 442 After: extents/glyf - ot - SourceSerifVariable 34738 ns 34713 ns 21332 extents/glyf/vf - ot - SourceSerifVariable 3700510 ns 3698104 ns 187 extents/glyf - ot - Comfortaa 21604 ns 21595 ns 31907 extents/glyf/vf - ot - Comfortaa 2324787 ns 2323440 ns 296 extents/glyf - ot - Roboto 31259 ns 31246 ns 21814 draw/glyf - ot - SourceSerifVariable 2689230 ns 2687589 ns 260 draw/glyf/vf - ot - SourceSerifVariable 4625135 ns 4622036 ns 131 draw/glyf - ot - Comfortaa 1690336 ns 1689454 ns 402 draw/glyf/vf - ot - Comfortaa 2898748 ns 2897074 ns 241 draw/glyf - ot - Roboto 1570911 ns 1570138 ns 440
Ebrahim Byagowi 55c41f21 2020-08-06T23:37:43 [glyf] Clamp advance value result Fixes a sanitizer complain https://circleci.com/gh/harfbuzz/harfbuzz/150247 revealed by 02d1ec1
Ebrahim Byagowi ec17b624 2020-08-06T20:16:11 [var] Apply variations on empty glyphs It was ignoring empty glyphs for no good reason, this fixes it. Fixes #2618
Ebrahim Byagowi 2dda6dd7 2020-04-20T14:12:45 minor, tweak spacing turn 8 spaces to tab, add space before Null/Crap
Behdad Esfahbod 6f6e78a2 2020-04-18T16:12:18 Fix float-to-double warnings ./hb-ot-glyf-table.hh:978:37: warning: implicit conversion increases floating-point precision: 'float' to 'double' [-Wdouble-promotion]
Behdad Esfahbod c37100e7 2020-04-18T16:02:55 Clean up math.h and float.h includes
Ebrahim Byagowi 755a77d6 2020-01-29T22:26:04 Move outline draw API behind HB_EXPERIMENTAL_API directive
Ebrahim Byagowi b7617f6b 2020-03-05T12:07:33 [glyf] Update to latests of ttf-parser
Ebrahim Byagowi 90048485 2020-03-04T12:12:35 [gvar] Make sure font's num_coords matches with gvar.axisCount
Ebrahim Byagowi 60262e4c 2020-02-29T22:57:59 [var] Build end-points array on gvar itself
Ebrahim Byagowi 44169f33 2020-02-29T16:04:03 [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
Ebrahim Byagowi 758fda72 2020-02-28T23:19:06 [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
Evgeniy Reizner f44e1dc0 2020-02-27T02:02:22 Fix spelling.
Ebrahim Byagowi 9fe0dc34 2020-02-26T17:40:44 [draw] Pass draw_helper_t itself around instead recreating it Specially helpful if we want to change the design
Ebrahim Byagowi 4cdaa9d1 2020-02-26T16:27:04 [glyf] Simplify contour end logic So no need for infinite loop here
Ebrahim Byagowi 073d4954 2020-02-26T15:40:40 [draw] Port glyf path extract to draw_helper_t
Ebrahim Byagowi b59eb54f 2020-02-25T10:30:59 [glyf] Refactor, move get_points inside Glyph
Ebrahim Byagowi da37880e 2020-02-20T19:01:43 [draw] Add a private bit field instead null-checking quad-to callback This doesn't imply the the design is good or stable just is better to not fail due to null quad-to callback so as our quad-cubic curves translation is currently table limited which can be revisited anytime.
Qunxin Liu 493e40ff 2020-02-18T13:09:08 [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.
Ebrahim Byagowi a7dec0cb 2020-02-18T16:22:12 [glyf] Tweak path_builder_t
Ebrahim Byagowi d52ea2a4 2020-02-18T15:46:02 [glyf] minor
Ebrahim Byagowi 3b0c58f8 2020-02-18T15:42:48 [glyf] minor, use private font coords to simplify
Ebrahim Byagowi dcd2729e 2020-02-18T15:38:57 [glyf] Move contour_bounds_t into scope it is actually used
Ebrahim Byagowi 8bb47fa1 2020-02-18T15:06:43 [glyf] minor, spacing
Ebrahim Byagowi 21a5fe4f 2020-02-18T14:38:55 [glyf] Make returning phantoms to not require another vector
Ebrahim Byagowi 5c03fbe7 2020-02-18T13:55:28 [glyf] do a phantom only iteration when possible
Ebrahim Byagowi 11f3fca0 2020-02-18T12:53:20 [glyf/gvar] Remove need of passing end points vector around
Ebrahim Byagowi 0f2c2d98 2020-02-18T11:52:16 [glyf] Push consumer machine one more level further
Ebrahim Byagowi 11f5f7c5 2020-02-17T23:44:31 [glyf] Adopt a state machine like style for the path builder Toward making glyf path reader alloc free at least on gvar absence.
Ebrahim Byagowi 60f8f384 2020-02-17T10:11:49 [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
ariza 9c6499d9 2020-02-16T00:56:31 rewrite read_points() to take lambda & consts args replacing awkward x/y_setter_t structs
Ebrahim Byagowi 3a98c7fa 2020-02-06T01:11:00 [glyf] Skip empty contours As https://savannah.nongnu.org/bugs/index.php?57701
Ebrahim Byagowi 7f9b2228 2020-02-04T23:05:46 [glyf] minor Improve using https://developer.blender.org/diffusion/B/browse/master/source/blender/blenlib/intern/freetypefont.c$572
Qunxin Liu 0216a96b 2020-01-30T12:36:58 [subset] Fix simple glyph trim_padding in glyf table Detail: when numOfContours = 1 and flag = 0x31 xCoordinates and yCoordinates would be empty
Ebrahim Byagowi d106900b 2020-01-28T15:26:13 [draw][glyf] Implement quadratic to cubic call translation
Ebrahim Byagowi 74fdcdca 2020-01-28T13:45:22 [draw] Rename conic_to to quadratic_to
Ebrahim Byagowi ac81e940 2020-01-28T12:34:47 Rename hb_outline_decompose to hb_font_draw_glyph and hb_outline_decompose_funcs_t to hb_draw_funcs_t
Ebrahim Byagowi 981125aa 2020-01-25T21:31:36 Rename hb_ot_glyph_* to hb_outline_*
Ebrahim Byagowi 02f324c9 2020-01-23T15:12:12 [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.
Ebrahim Byagowi 79fed9a1 2020-01-14T17:23:30 [ot-glyph] Add open/close callbacks
Ebrahim Byagowi ec1fba13 2020-01-13T19:31:18 [ot-glyph] make hb_ot_glyph_decompose_funcs_t struct opaque
Ebrahim Byagowi 42f4f1ea 2020-01-11T00:00:51 [ot-glyph] Add tests for hb_ot_glyph_decompose
Ebrahim Byagowi 61185235 2020-01-10T21:08:21 [ot-glyph] move glyph decompose logic of glyf to itself One less vector allocation yet isn't zero alloc yet which needs more work.
Ebrahim Byagowi fddf79fc 2019-10-21T14:11:27 [glyf] minor
Ebrahim Byagowi 04ac7fb1 2019-10-21T13:06:12 [ot-glyph] Add cff2 support
Ebrahim Byagowi b8b3ff1a 2019-10-14T15:37:41 [glyph] Don't copy, write directly into result
Ebrahim Byagowi f883c31c 2019-10-13T12:31:53 Implement glyph outline path API Got help from https://github.com/opentypejs/opentype.js/blob/4e0bb99/src/tables/glyf.js#L222
Ebrahim Byagowi 57b15341 2020-01-06T12:46:50 [glyf] minor, fix unlikely statements
Ebrahim Byagowi d67ba649 2019-12-05T13:15:21 Rename hb_array_t::in_range to hb_array_t::check_range
Ebrahim Byagowi 3958f6fb 2019-10-29T22:36:50 Add in_range in hb_bytes_t to merge range_checker_t with it
Ebrahim Byagowi aa3831e2 2019-10-29T21:37:07 [glyf] Use contour_bounds_t::empty to simplify get_extents logic
Ebrahim Byagowi d59ae583 2019-10-29T21:30:04 [glyf] Refactor contour_bounds_t use to make its fields protected
Ebrahim Byagowi 0efbda7a 2019-10-29T21:03:26 Remove contour_point_t so we won't need to zero its unused var
Ebrahim Byagowi b0b8551a 2019-10-12T21:12:19 [glyf] Use range_checker_t in composite_iter_t
Ebrahim Byagowi 06e35ce0 2019-10-12T15:16:31 [glyf] minor
Ebrahim Byagowi d13bb4bd 2019-10-12T12:13:57 [glyf] other cleanups
Ebrahim Byagowi e7aa8c5d 2019-10-12T11:25:32 [glyf] Introduce glyf::Glyph, a hb_bytes_t/GlyphHeader pair
Ebrahim Byagowi 546ffc9f 2019-10-12T09:51:57 [glyf] minor
Ebrahim Byagowi 4299ea26 2019-10-12T09:51:27 [glyf] Move get_contour_points to GlyphHeader
Ebrahim Byagowi dc45f225 2019-10-08T23:27:37 [ot-metrics] Don't use mixed scaled and not scaled for generating extents
Ebrahim Byagowi 6961766d 2019-10-08T16:26:48 [glyf] fix scaling direction
Ebrahim Byagowi b2628f1a 2019-10-08T15:09:09 [glyf] Move glyph bytes drop hints logic to GlyphHeader
Ebrahim Byagowi 1fb9c3b6 2019-10-08T13:50:16 [glyf] Implement depth limit for add_gid_and_children