Commit Graph

12186 Commits

Author SHA1 Message Date
Behdad Esfahbod 8a2efbd8a1 [upem] More docs 2023-01-10 13:10:36 -07:00
Behdad Esfahbod ccffce58cc [scale] More docs 2023-01-10 13:09:30 -07:00
Behdad Esfahbod c4580d8670 [scale] More docs 2023-01-10 12:56:02 -07:00
Behdad Esfahbod f0e695a3a9 [scale] Comment 2023-01-10 12:55:17 -07:00
Behdad Esfahbod 8c47580ac8 [scale] Document 2023-01-10 12:53:54 -07:00
Behdad Esfahbod 8b17c6ca30 [aat] Comment 2023-01-10 12:17:38 -07:00
Behdad Esfahbod 0e11d317ee [aat] Optimize feature application 2023-01-10 12:16:04 -07:00
Behdad Esfahbod a70543daf3 [aat] Always unsafe-to-concat in state machine 2023-01-10 11:49:48 -07:00
Behdad Esfahbod 62383315fa [aat] Try fix leak on memory allocation failure 2023-01-10 11:29:04 -07:00
Behdad Esfahbod e122fe2acf [aat] Adjust last range
Otherwise a user cluster value of -1 would have tripped us.
2023-01-10 11:08:21 -07:00
Behdad Esfahbod e28c158c35 [aat] Run subtable across ranges if flags match 2023-01-10 11:08:21 -07:00
Behdad Esfahbod 2c9c49fd32 [aat] Support ranges in NonContextual subtable as well 2023-01-10 11:08:21 -07:00
Behdad Esfahbod c08308a83c [aat] Always generate a feature range 2023-01-10 11:08:21 -07:00
Behdad Esfahbod db4c874758 Revert "Revert "[aat] Support feature ranges""
This reverts commit 6a7a38521f.
2023-01-10 11:08:21 -07:00
Behdad Esfahbod 0728098e45 [Coverage] Speed up subset for too-large Coverage tables
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54980
2023-01-10 10:19:00 -07:00
Behdad Esfahbod 6a7a38521f Revert "[aat] Support feature ranges"
This reverts commit 1b7994cb3a.

Broke Zapfino with partial ligature disabling. Debugging.
2023-01-09 21:29:39 -07:00
Behdad Esfahbod adfd5dd7a9 Fix TINY build 2023-01-09 21:18:12 -07:00
Behdad Esfahbod 1b7994cb3a [aat] Support feature ranges
The hard way...

A bit uglier than I liked it to be, but is proper at least.

Fixes https://github.com/harfbuzz/harfbuzz/issues/4020
2023-01-09 21:16:20 -07:00
Behdad Esfahbod 622a686952 Revert "Revert "Revert "[aat] Allow disable feature ranges"""
This reverts commit 5202053c2c.
2023-01-09 21:16:20 -07:00
Behdad Esfahbod 5202053c2c Revert "Revert "[aat] Allow disable feature ranges""
This reverts commit 82b3e8af69.

Another try.

Fixes https://github.com/harfbuzz/harfbuzz/issues/4020
2023-01-09 17:59:09 -07:00
Behdad Esfahbod 82b3e8af69 Revert "[aat] Allow disable feature ranges"
This reverts commit 24a4d397ba.

This was broken.
2023-01-09 17:28:52 -07:00
Behdad Esfahbod 24a4d397ba [aat] Allow disable feature ranges
Fixes https://github.com/harfbuzz/harfbuzz/issues/4020

This is a hack.

To implement this properly we need to treat runs with different features
as independent runs for running the state machine, as the subtable flags
might be different. That would be a significant change to our internal
implementation.
2023-01-09 17:26:48 -07:00
Behdad Esfahbod 3ff713ab80 [coretext] Remove unused variable 2023-01-09 14:19:25 -07:00
Behdad Esfahbod 4148487556 [ft] Comment 2023-01-09 13:47:59 -07:00
Behdad Esfahbod d2aa2397ba Optimize non-slant extents code 2023-01-09 13:44:44 -07:00
Behdad Esfahbod 73dab7f784 [ft] Fix slanting code 2023-01-09 13:44:44 -07:00
Behdad Esfahbod 0275151490 [paint] Align deptch/edge count conditions across two backends 2023-01-09 12:27:09 -07:00
Behdad Esfahbod 839f4b6494 [ft] Fix slanting clip box 2023-01-09 12:01:46 -07:00
Behdad Esfahbod 30adbc22d9 hb-font: Fix scale_glyph_extents() again
And better fix this time.
2023-01-09 11:54:44 -07:00
Behdad Esfahbod 6c1a4bed4a Better rounding clip boxes 2023-01-09 11:37:39 -07:00
Behdad Esfahbod f46dcf147b [paint/COLR] Fix clip transform
Sigh. So complicated.
2023-01-08 14:35:42 -07:00
Behdad Esfahbod f283d4d366 [paint] Try to adjust both renderers to use same clip order 2023-01-08 12:42:34 -07:00
Behdad Esfahbod 5d94eb61b8 [hb-cairo] Fix hb_cairo_glyphs_from_buffer() when utf8 missing
Fixes https://github.com/harfbuzz/harfbuzz/issues/4016
2023-01-08 11:56:01 -07:00
Behdad Esfahbod 5bd6fc1ace Comment 2023-01-07 16:32:50 -07:00
Behdad Esfahbod 432afa9dff [paint] Fix paint_extents usage
It was broken all this time :(.

The two backends do this slightly differently...
2023-01-07 16:25:30 -07:00
Behdad Esfahbod a63d329261 [paint-extents] Simplify transform_extents 2023-01-07 16:05:24 -07:00
Behdad Esfahbod e062f98260 [paint-extents] Fix transform_extents
Ouch!
2023-01-07 16:02:21 -07:00
Behdad Esfahbod 823a9b18d9 [cairo] Return COMPOSITE mode CLEAR for unknown values
As per the spec.
2023-01-07 14:50:30 -07:00
Behdad Esfahbod 65c3cde5da [COLRv1] Fix scale variation 2023-01-07 14:29:18 -07:00
Behdad Esfahbod 004cdc10f8 [open-type] More tweaks to fixed types
Add set_int().
2023-01-07 14:27:15 -07:00
Behdad Esfahbod c8486b6301 [open-type] Add to_int to fixed types
To make sure we don't accidentally forget to_float().
As we did recently in COLRv1 code.
2023-01-07 14:15:17 -07:00
Behdad Esfahbod dfd9bf8a50 [COLRv1] Fix a couple of missing to_float() calls
Ouch!
2023-01-07 14:05:02 -07:00
Behdad Esfahbod d045de78c1 [paint] Optimize PAINT_COMPOSITE
At the start of each paint call the current group is clear.
So we don't need to start a new group for the backdrop paint.

A paint composite really needs one group push, not two.
2023-01-07 13:56:43 -07:00
Behdad Esfahbod 5ea5aacda9 [ft-colr] Adjust for FreeType master color-stop change
Part of https://github.com/harfbuzz/harfbuzz/issues/4013
2023-01-07 13:25:11 -07:00
Qunxin Liu 1eb5445e75 [subset] Fix issue in hb_subset_input_override_name_table()
If a nameRecord with provided name_id/platform_id/encoding_id/lang_id
is not retained after subsetting, create it and insert it to
the name table. So we need to check against retained name_records
rather than name_record in the original name table.
2023-01-06 19:17:14 -07:00
Khaled Hosny 02948263f9 [subset] Document that CFF2 instancing is now supported 2023-01-06 13:58:29 -07:00
Behdad Esfahbod 82c863a50b Whitespace 2023-01-06 12:51:58 -07:00
Behdad Esfahbod 76879c5763 [subset-cff] Minor hide num_coords again 2023-01-06 11:47:04 -07:00
Behdad Esfahbod 576b36a31b [cff2] Undo rounding change in draw() codepath 2023-01-06 11:40:21 -07:00
Behdad Esfahbod 4867e0b192 [subset-cff2] Faster instancing
Instantiate blends during parsing. Dedups code as well.
2023-01-06 11:39:13 -07:00
Behdad Esfahbod 3757baab2c [subset-cff2] Better condition
Previous condition wasn't working for dropping axes.
2023-01-06 11:23:37 -07:00
Behdad Esfahbod acc6c13f05 [subset-cff] Round numbers when instancing 2023-01-06 11:20:41 -07:00
Behdad Esfahbod 2f174f23c3 Rename 2023-01-06 11:11:14 -07:00
Behdad Esfahbod a59116cd8f Oops 2023-01-06 11:09:09 -07:00
Behdad Esfahbod c632a164b9 [subset/cff] Support instancing 2023-01-06 11:01:25 -07:00
Behdad Esfahbod 5153218b41 [set] Add hb_set_is_inverted() 2023-01-05 16:26:41 -07:00
Behdad Esfahbod e8ac0ef2fd [face] Minor rename a variable 2023-01-05 16:20:59 -07:00
Behdad Esfahbod 14ff747024 [set] Add tests for inverted set range iteration 2023-01-05 16:20:59 -07:00
Matthias Clasen 381ac2fd78 docs: Fix a typo 2023-01-05 15:55:57 -07:00
Behdad Esfahbod 2764a61691 Revert "[gsubgpos] Use swap instead of move"
This reverts commit 8a17cc4ecf.
2023-01-05 15:14:54 -07:00
Behdad Esfahbod 167b7c6046 Revert "[gsubgpos] Reduce hb_set_t allocations"
This reverts commit 0b7f6d6cf0.

Not much benefit as the main allocations come from other places.
2023-01-05 14:48:20 -07:00
Behdad Esfahbod 3947cedd09 Revert "[gsubgpos] Cache pos_glyphs allocation in closure"
This reverts commit 3961cc46bf.

This was wrong...
2023-01-05 14:47:47 -07:00
Behdad Esfahbod 097fb8b8aa [priority-queue] Use resize instead of shrink
To avoid reallocation of smaller array. Not desirable here.
2023-01-05 14:38:10 -07:00
Behdad Esfahbod 8a17cc4ecf [gsubgpos] Use swap instead of move
Move is wrong when we want to reuse the object.
2023-01-05 14:15:38 -07:00
Behdad Esfahbod 4401dd2482 [gsubgpos] Minor use ->clear() directly 2023-01-05 14:13:57 -07:00
Behdad Esfahbod 207ae11ab9 [set] Allocate first page exact 2023-01-05 14:08:47 -07:00
Behdad Esfahbod 0b7f6d6cf0 [gsubgpos] Reduce hb_set_t allocations 2023-01-05 14:05:11 -07:00
Behdad Esfahbod 3961cc46bf [gsubgpos] Cache pos_glyphs allocation in closure
Saves some 3% in Gulzar-Regular subsetting.
2023-01-05 13:58:57 -07:00
Behdad Esfahbod a90f149e1b [gsubgpos] Minor drop an allocation 2023-01-05 13:52:11 -07:00
Behdad Esfahbod c54debc76d [face] Add hb_face_collect_nominal_glyph_mapping
Fixes https://github.com/harfbuzz/harfbuzz/issues/3973
2023-01-05 11:57:48 -07:00
Behdad Esfahbod ec70a3f797 [map] Include 2023-01-05 11:52:12 -07:00
Behdad Esfahbod 8b12c19573 [face] Split hb-face-builder.cc 2023-01-05 11:42:21 -07:00
Behdad Esfahbod dc7b3a627d [test-map] Another test 2023-01-05 10:49:10 -07:00
Behdad Esfahbod a8df5cb07d [test-map] Test keys() / values() 2023-01-05 10:47:47 -07:00
Konstantin Käfer a349eef6a6 Disable hb_paint_extents_* functions if HB_NO_PAINT is defined 2023-01-05 10:18:47 -07:00
Behdad Esfahbod 9420966f5b [map] Fix next() 2023-01-05 10:17:24 -07:00
Behdad Esfahbod 35f46e74d1 [map] Add hb_map_keys() and hb_map_values() 2023-01-04 17:12:08 -07:00
Behdad Esfahbod 07f2d8d538 Comment 2023-01-04 15:42:56 -07:00
Behdad Esfahbod 4f6079138d [map] Add hb_map_update() 2023-01-04 13:58:46 -07:00
Behdad Esfahbod c350458539 [subset-plan] Relax const return type of a few functions
Fixes https://github.com/harfbuzz/harfbuzz/issues/4003
2023-01-04 13:25:03 -07:00
Behdad Esfahbod dbf0964a0f [map] Doc 2023-01-04 13:17:14 -07:00
Behdad Esfahbod 0875a420f7 [map] Doc 2023-01-04 13:11:37 -07:00
Behdad Esfahbod ffafcf9633 [map] Add hb_map_next() 2023-01-04 12:56:42 -07:00
Behdad Esfahbod 3e471bbc08 [vector] Better test 2023-01-04 11:53:49 -07:00
Behdad Esfahbod 45fc919a10 [bit-set] Minor setting length on allocation failure 2023-01-04 11:35:44 -07:00
Behdad Esfahbod d8509061e6 [vector] It's okay if shrinking fails 2023-01-04 11:33:54 -07:00
Behdad Esfahbod 6c272b920d [set] Don't discard allocation in operator=
That had caused memory thrashing.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54789
2023-01-03 13:00:41 -07:00
Behdad Esfahbod e6bbf112ea [buffer] Better document set_content_type
Fixes https://github.com/harfbuzz/harfbuzz/issues/4000
2023-01-03 12:35:48 -07:00
Behdad Esfahbod 8f2345ca36 Use more vector resize_exact 2023-01-02 18:08:45 -07:00
Behdad Esfahbod b6be455020 [vector] Add resize_exact() 2023-01-02 18:05:43 -07:00
Behdad Esfahbod a516ce97e0 [subset-cff] Add a few exact-allocation calls 2023-01-02 17:58:51 -07:00
Behdad Esfahbod 4a435dc024 [subset-cff] Remove an unlikely 2023-01-02 17:41:31 -07:00
Behdad Esfahbod f8c578fd93 [subset-cff] Remove commented-out line 2023-01-02 17:33:04 -07:00
Behdad Esfahbod d5e1748f31 [cff] Simplify add_op() 2023-01-02 12:26:43 -07:00
Behdad Esfahbod 27531d853e [subset-cff] Move code around 2023-01-02 12:05:11 -07:00
Behdad Esfahbod 9afe5f973e [vector] Fix leak
Discovered by https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54767
2023-01-02 11:46:45 -07:00
Behdad Esfahbod 4f013c42f0 [subset-cff] Always compact charstrings
Reduces non-preprocessed subsetting memory footprint significantly.
2023-01-02 10:39:14 -07:00
Behdad Esfahbod d3ed6eed43 [cff] Initialize a member variable
For good hygiene.
2023-01-02 10:39:14 -07:00
Behdad Esfahbod 55a7d81740 [vector] Allocate exact size in operator= 2023-01-01 23:07:42 -07:00
Behdad Esfahbod 449910d431 [vector] Allocate exact size in constructor 2023-01-01 19:27:10 -07:00
Behdad Esfahbod 4dda1f7881 [cff-subset] Compact charstrings just after parsing
Massive peak-memory saving when processing face.
2023-01-01 19:00:04 -07:00
Behdad Esfahbod a7617c3cf1 [cff-subset] Drop hints just after parsing charstring
In prep for next commit.
2023-01-01 18:58:08 -07:00
Behdad Esfahbod b1c4cb0cae [cff2] Use a shrink instead of resize
Such that we can free the allocation.
2023-01-01 18:41:19 -07:00
Behdad Esfahbod b87360763e [vector] Support shrinking storage if exact size provided
Only do it if requested size is less than quarter of allocated size.

This has massive benefit during CFF subset preprocessing.
2023-01-01 18:38:28 -07:00
Behdad Esfahbod 1119e60296 [subset-cff] Tweak another storage allocation 2023-01-01 18:31:32 -07:00
Behdad Esfahbod f0b5286b36 [features] Sort 2023-01-01 17:04:59 -07:00
Behdad Esfahbod 4a5bd7a926 [subset] Add hb_subset_input_keep_everything()
Fixes https://github.com/harfbuzz/harfbuzz/issues/3998

New API:
+ hb_subset_input_keep_everything()
2023-01-01 16:53:28 -07:00
Behdad Esfahbod 52110f13b0 [subset-input] Refactor copy-pasta code 2023-01-01 16:22:02 -07:00
Matthias Clasen 4adc748b13 Move Color tables to src/OT/Color/ 2023-01-01 14:57:53 -07:00
Behdad Esfahbod a5f1f3a05c [ft] Conditionalize all COLOR code on >= 2.11.1
Fixes https://github.com/harfbuzz/harfbuzz/issues/3994
2023-01-01 13:14:04 -07:00
Matthias Clasen dc5179d465 Drop hb-ot-color-colr-table.cc
Move everything into the .hh file.
2023-01-01 20:18:33 +02:00
Khaled Hosny 27684f14be [introspection] Skip sources not usable with GObject Introspection
There is no point in generating GIR for code interfacing with libraries
without introspection integration. This fixes spurious warnings on macOS
when g-ir-scanner mistakenly tries to scan system headers.
2023-01-01 20:08:19 +02:00
Matthias Clasen f60e7e3f8c Drop an unused file 2023-01-01 09:51:03 -05:00
Behdad Esfahbod 3ff91c449f [paint] Optimize transform operations again 2022-12-31 14:49:41 -07:00
Behdad Esfahbod 1a0dd49f1e
Merge pull request #3991 from harfbuzz/paint-optimize-transform
Paint optimize transform
2022-12-31 14:38:06 -07:00
Behdad Esfahbod edb812345a [subset-cff] Another exact allocation 2022-12-31 13:55:41 -07:00
Behdad Esfahbod 54dd01b865 [set] Use exact-allocation in copying
Significantly reduces memory consumption.
2022-12-31 13:33:40 -07:00
Behdad Esfahbod 2c64048bc4 [subset] Another exact-allocation 2022-12-31 13:26:00 -07:00
Behdad Esfahbod 0ec0214f10 [cff-subset] Adjust pre-allocation
Reduces memory use significantly.
2022-12-31 13:19:38 -07:00
Behdad Esfahbod b88ca81814 [paint-extents] Minor reorder 2022-12-31 12:53:00 -07:00
Behdad Esfahbod 0c6a721337 [set] Another exact-size allocation 2022-12-31 12:42:29 -07:00
Behdad Esfahbod b803024caf [cff2] Another exact-size allocation 2022-12-31 12:40:07 -07:00
Behdad Esfahbod 3d4659beaa [cff2] Use exact-size vector allocation for blends 2022-12-31 12:38:58 -07:00
Behdad Esfahbod 92e5933ee6 [vector] A couple more exact-size allocations 2022-12-31 12:35:30 -07:00
Behdad Esfahbod 2eacc37e08 [vector] Add internal API for exact-size allocation
Use it from a couple of places.
2022-12-31 12:30:31 -07:00
Behdad Esfahbod a0b46f3f6b [machinery] Refactor shared code into a macro 2022-12-31 12:15:14 -07:00
Behdad Esfahbod ebb475bae7 [multimap] Add consts 2022-12-31 12:11:14 -07:00
Behdad Esfahbod 9e3ff0e9f0 [paint] Fixup 2022-12-31 11:55:45 -07:00
Behdad Esfahbod 6b47fcb17a [paint] Add internal push_skew/pop_skew API 2022-12-31 11:40:12 -07:00
Behdad Esfahbod 46adf31b4c [paint] Add internal push_rotate/pop_rotate API 2022-12-31 11:35:39 -07:00
Behdad Esfahbod ce7835124a [paint] Add internal push_scale/pop_scale API 2022-12-31 11:32:15 -07:00
Behdad Esfahbod 7363eb373a [paint] Add internal push_translate/pop_translate 2022-12-31 11:24:42 -07:00
Behdad Esfahbod df91677997 [paint] Call internal API internally 2022-12-31 11:12:02 -07:00
Behdad Esfahbod 99da0e6cc3 [paint] Avoid div-by-zero 2022-12-31 11:04:40 -07:00
Behdad Esfahbod 4e94b65cff [paint-extents] Const-correctness 2022-12-31 10:53:40 -07:00
Behdad Esfahbod f6dc4698ef [paint-extents] Minor move variable 2022-12-31 10:52:32 -07:00
Behdad Esfahbod 4e7807a090 [paint-extents] Rename variable 2022-12-31 10:50:30 -07:00
Behdad Esfahbod c86d1892ad [paint-extents] Move code around 2022-12-31 10:46:46 -07:00
Behdad Esfahbod d9a9bd8fa8 [paint-extents] Add HB_UNUSED 2022-12-31 10:41:30 -07:00
Behdad Esfahbod 37e90c64c1 [cairo] Fix warnings 2022-12-30 15:41:40 -07:00
Behdad Esfahbod 04464c55b2 [pool] Change chunk-len from 16 to 32 2022-12-30 14:55:32 -07:00
Behdad Esfahbod d7941e04df [paint-extents] Unlikely 2022-12-30 14:47:47 -07:00
Behdad Esfahbod ca844b6975 [paint-extents] Whitespace 2022-12-30 14:47:24 -07:00
Behdad Esfahbod 62ca2be39d [paint-extents] Implement quadratic callback 2022-12-30 14:41:36 -07:00
Behdad Esfahbod 7389efd8e0 [post] Pre-alloc name index array 2022-12-30 13:58:52 -07:00
Behdad Esfahbod 36bef5dccf [gsubgpos] Prealloc subtables vector 2022-12-30 13:58:52 -07:00
Behdad Esfahbod a45bf5b04c [ft-colr] Require FreeType >= 2.11.1
Fixes https://github.com/harfbuzz/harfbuzz/issues/3989
2022-12-30 11:19:36 -07:00
Behdad Esfahbod ceba6c9a90 [config] Sort 2022-12-30 10:44:34 -07:00
Behdad Esfahbod f2a6643fc1 [cairo] Docs 2022-12-29 18:00:39 -07:00
Behdad Esfahbod bfce4a6046 [cairo] Remove error path
Assume cairo API always returns non-NULL.
2022-12-29 10:43:37 -07:00