src/hb-subset-plan.cc

Branch


Log

Author Commit Date CI Message
Khaled Hosny 46e3882f 2025-10-23T02:11:13 [subset] Don’t collect name IDs from STAT table if it is dropped (#5623)
Behdad Esfahbod 82370913 2025-09-15T20:16:52 [vector] Simplify resize()
Garret Rieger aa58b43d 2025-09-12T14:24:41 [subset] Introduce HB_SUBSET_FLAGS_RETAIN_NUM_GLYPHS. (#5547) Used in conjunction with retain gids, when set the num glyphs from the input font will be preserved. Empty glyphs will be inserted as necessary to maintain the num glyphs value. Put under experimental for now.
Behdad Esfahbod 47089fe7 2025-05-28T17:10:22 Big misc changes - Make geometry types into templates taking float or double. - Changes to paint() transform elimination. - Add font->has_nonzero_coords and use it across. - Extensions to avar processing for otherwise invalid mappings.
Behdad Esfahbod aef3df50 2025-04-20T00:37:24 Merge branch 'main' into HVF
Garret Rieger efcb7d3d 2025-04-11T23:34:06 [subset] close unicodes over bidi mirror variants during subsetting. Fixes #5281. Does the closure by default, but I've introduced a new flag and option to disable this behaviour since some users may want to get the minimal set if they know they don't need the mirrored variants.
Behdad Esfahbod 04cdcbf0 2025-04-10T18:40:03 Merge branch 'main' into HVF
Garret Rieger 5afbd187 2025-04-09T22:48:27 [subset] Split subset plan variations function into separate file. Compile times for hb-subset-plan.cc go from 16s -> 13s.
Garret Rieger d3ccdcdd 2025-04-09T22:26:59 [subset] Move GDEF subset planning into hb-subset-plan-layout.cc
Garret Rieger b33f2e26 2025-04-09T22:11:12 [subset] Start splitting layout specific subset plan functionality. The aim is to reduce the compiled time of hb-subset-plan.cc which on my machine takes almost 30s to compile.
Behdad Esfahbod 178364ce 2025-04-03T22:51:11 Merge branch 'main' into HVF
Behdad Esfahbod 9cae040b 2025-04-03T22:18:14 [ItemVariationStore] Make cache atomic floats Doesn't work with intrinsic atomic implementations. Disabled that. Going through the C++11 atomics path now. Will fix in next commit.
Behdad Esfahbod 19b4c6e5 2025-02-25T13:39:59 [subset] "Fix" subset tests after recent fvar/avar precision changes
Behdad Esfahbod d7b15b0e 2025-02-08T21:14:59 [font/fvar/avar] Increase axis coordinate normalization precision Spec requires 16.16; we were doing 2.14. Fix up. Now we do math in float, but do the 16.16 and final 2.14 rounding as required by the spec.
Garret Rieger b0d52abe 2024-10-23T20:49:44 [subset] consider variation selectors subsetting cmap14 cmap14 subsetting code was not considering variation selectors in the input unicode set when deciding which variant glyphs to keep. This updates subsetting to only keeps variant glyphs if their variation selector code point is in the input unicodes set. For https://github.com/harfbuzz/harfbuzz/issues/4911
Qunxin Liu 93930fb1 2024-06-24T10:48:45 fix build with HB_TINY
Behdad Esfahbod 49c8493f 2024-06-20T11:16:40 [test] Build with HB_MINI Also add CONFIG.md instructions for building configs with meson. Fixes https://github.com/harfbuzz/harfbuzz/issues/4760
Garret Rieger 7946a284 2024-06-18T23:10:46 Move constant for max composite ops per glyph to hb-limits.hh
Garret Rieger 6289e475 2024-06-17T18:56:51 In _fill_unicode_and_glyph_map add a second unicode -> gid lookup which is general.
Garret Rieger 7be12b33 2024-06-06T22:57:03 [subset] refactor populate_unicodes_to_retain. Pulls out commonly repeated pattern of filling the gid and unicode maps into a templated helper.
Behdad Esfahbod 8a9bc523 2024-06-06T13:56:33 [normalizer] Move a couple functions around
Behdad Esfahbod 0037ee28 2024-05-24T08:10:15 Merge pull request #4578 from harfbuzz/varc-table `VARC` table
Garret Rieger 0660a4d4 2024-05-13T19:28:57 [subset] fix fuzzer found heap use after free in BASE subsetting.
Qunxin Liu 7975c9ca 2024-05-08T10:11:03 [instancer] bug fix for COLRv1, add missing mapping to VarIdx::NO_VARIATION
Garret Rieger a3d8a59d 2024-05-07T18:32:56 Fix double to float cast warning.
Qunxin Liu 247039de 2024-04-26T13:36:52 [instancer] partial instantiating support for COLRv1 Also add subset support for COLRv1 VarStore/DeltaSetIndexMap
Qunxin Liu c5a85a73 2024-05-03T09:44:14 [instancer] support BASE table
Garret Rieger 4cf606f6 2024-05-02T20:46:29 [instancer] Promote partial instancing api out of experimental.
Qunxin Liu c04d0a29 2024-04-25T14:57:36 [subset] generate colrv1 varsotre inner_maps in the plan Also merge remap_variation_indices APIs used by GDEF and BASE into 1
Qunxin Liu 690893e3 2023-10-02T09:09:53 [subset] collect variation indices for COLRv1
Behdad Esfahbod bb3bfe8c 2024-03-16T14:02:16 [glyf] Remove old glyf1 VarComposites support
Qunxin Liu cfbb6a68 2024-03-14T17:33:34 [subset] support BASE table subsetting (#4618) * [subset] support BASE table * [subset] add tests for BASE table subsetting
Qunxin Liu 97309483 2024-02-02T16:59:19 [instancer] rename HB_SUBSET_FLAGS_IUP_DELTA_OPT to HB_SUBSET_FLAGS_OPTIMIZE_IUP_DELTAS
Qunxin Liu 4d5fb233 2024-01-26T16:00:58 fix build
Qunxin Liu 52c3cda3 2024-01-26T10:55:57 [instancer] add composite_new_gids set in subset plan This is only used by iup delta optimization where we need to know whether glyph is composite or not
Ozkan Sezer 1cc7ddb3 2024-01-07T18:55:40 hb-subset-plan.cc: Fix -Wparentheses warning. In file included from hb-subset-plan.hh:30:0, from hb-subset-plan.cc:27: hb-subset-plan.cc: In function 'void _update_instance_metrics_map_from_cff2(hb_subset_plan_t*)': hb-subset-plan.cc:998:81: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if (unlikely (!plan->check_success (font = _get_hb_font_with_variations (plan)))) ^ hb.hh:263:25: note: in definition of macro 'unlikely' #define unlikely(expr) (expr) ^ Fixes: https://github.com/harfbuzz/harfbuzz/issues/4545
Behdad Esfahbod 2b5af6f4 2023-11-10T15:23:27 [subset-plan] Micro-optimize set iteration Getting ranges is faster even with the current trivial implementation.
Behdad Esfahbod 6d3b7931 2023-11-10T14:51:34 [subset-plan] Add a couple of allocs
Garret Rieger c6884377 2023-11-06T20:21:46 [subset] Add HB_SUBSET_FLAGS_IFTB_REQUIREMENTS flag. When enabled the output subset conforms to the requirements for a base font to be patched by IFTB patches. IFTB is a proposed incremental font transfer patch. This new flag is set as experimental. Currently, setting this flag causes the output subset to also use long offsets for outline data in loca/glyf, gvar, CFF, and CFF2. This change is a version of https://github.com/skef/harfbuzz/commit/3ae2fe2084d96f61d8ad1bbe42a6ef4e62ec830a rebased onto head w/ tests added.
Qunxin Liu aca55dbe 2023-11-03T10:51:37 [instancer] fix feature variations collect lookups We already know which record to keep, so just collect lookups and no need to check the substitutes_map
Qunxin Liu 6c017a11 2023-11-01T09:54:46 [instancer] SinglePos/PairPos: do not strip_hints for partial instancing
Qunxin Liu 091e538d 2023-10-26T12:52:08 [instancer] support partial instancing for FeatureVariations
Qunxin Liu 8ceed6ee 2023-10-18T15:43:40 [subset] fix Lookup.MarkFilteringSet to use the new indices
Qunxin Liu 77f24d82 2023-09-22T14:47:11 [instancer] remap layout var_idxes code update make hb_collect_variation_indices_context_t only collect layout variation indices.
Qunxin Liu 23268792 2023-08-31T15:28:06 [instancer] add serialize() for VarRegionList The region list argument comes from item_variations_t.get_region_list()
Qunxin Liu eb116e16 2023-07-28T15:27:07 [instancer] Add new_gid->contour_points vector map in subset plan - Add an API in Glyph to export original contour_points vector, which is needed by infer_deltas when merging tuple variations with the same tent
Qunxin Liu 730f579f 2023-07-18T15:09:36 [instancer] store float value rather than F2DOT14 int value in axes_location map
Qunxin Liu 165f3e60 2023-07-17T09:46:03 [instancer-solver] add renormalizeValue() and store axis->distances map
Behdad Esfahbod a5628848 2023-07-15T13:59:10 [subset] Speed up a couple of set iteration loops Need to speed up set::next_range() for the second one to have any effect.
Behdad Esfahbod 6783701b 2023-06-26T12:31:22 [subset] Handle an error condition Fixes https://oss-fuzz.com/testcase-detail/6306810588692480
Behdad Esfahbod 393f0f9f 2023-06-25T18:14:56 [map] Rename resize() to alloc() Better matches the functionality, and hb_vector_t.
Behdad Esfahbod ecb46f70 2023-06-23T12:18:33 [subset/cff1] Comment
Behdad Esfahbod c4b2950d 2023-06-23T11:55:39 [subset/cff1] Use cached subset-accel for seac calculations Before we were creating a new (non-subset) accel each time.
Behdad Esfahbod 5f399139 2023-06-23T11:22:01 [subset/cff] Move lazy cff-accelerator to cff-subset-accelerator Fixes https://github.com/harfbuzz/harfbuzz/issues/4295
Behdad Esfahbod 7344411c 2023-06-23T10:27:44 [subset] Sprinkle some HB_NO_SUBSET_CFF
Behdad Esfahbod 43ec78f9 2023-06-23T10:22:30 [subset/cff] Cache CFF accelerator in hb_subset_plan_t This shows 7% speedup in: BM_subset/subset_glyphs/SourceHanSans-Regular_subset.otf/retaingids/10
Behdad Esfahbod abd6c305 2023-06-22T16:44:29 [subset-plan] Micro-optimize
Behdad Esfahbod 7b53d2db 2023-06-22T16:35:11 [subset] Avoid copying gid_to_unicode multimap Construct it in the accelerator directly.
Behdad Esfahbod 272e159c 2023-06-22T16:31:50 [subset] Speed up populating reverse cmap
Behdad Esfahbod 0e16be9b 2023-06-03T19:45:44 [subset-plan] Reuse glyph_for_gid result
Behdad Esfahbod ca27925d 2023-06-03T16:18:15 Use hb_codepoint_pair_t in more places
Behdad Esfahbod 24b069cd 2023-06-02T15:55:53 [subset] Pre-alloc a few maps
Behdad Esfahbod 7319d0d7 2023-06-02T15:41:47 [subset-plan] Add a couple of map pre-allocations Approximate...
Behdad Esfahbod 76904b04 2023-06-02T15:30:12 [subset-plan] Simplify / speedup planning glyphset
Behdad Esfahbod 965ce7bb 2023-06-02T15:24:00 [subset-plan] Speed up planning new_to_old_gid_list
Behdad Esfahbod b67e464b 2023-06-02T15:11:06 [subset/retaingid] Regain perf lost In 0f12fd5a66a5dd1c3c9ac5ea8a52341bafcfe567
Behdad Esfahbod 9f54ab92 2023-06-01T17:45:03 [subset-plan] Keep a reverse-gid vector To speed up iteration.
Behdad Esfahbod 5543d058 2023-05-17T17:29:44 [subset] Use vector instead of map for glyph bounds (#4232) * [subset] Use vector instead of map for glyph bounds Is faster. Part of https://github.com/harfbuzz/harfbuzz/issues/4231 * [subset] initialize bounds_vec value to 0xFFFFFFFF Some non-EMPTY glyph might have 0 bounds width/height --------- Co-authored-by: Qunxin Liu <qxliu@google.com>
Qunxin Liu 39ac79a7 2023-05-10T10:22:49 address review comments
Qunxin Liu efc77dc6 2023-05-04T10:59:09 [instancer] update code for collecting FeatureVariationRecord
Qunxin Liu 51c7451b 2023-05-01T13:38:02 [instancer] update fvar table to accept Tripe for axes positions
Qunxin Liu 779e8ba0 2023-04-27T13:48:24 [instancer] update subset-plan.cc to accept Triple as axes positions
Behdad Esfahbod 62bc2841 2023-05-08T09:12:34 Merge pull request #4221 from googlefonts/user_glyph_map [subset] Add API method to allow a custom glyph map to be specified.
Behdad Esfahbod f772071f 2023-05-07T13:42:00 [subset-plan] Another error check
Behdad Esfahbod cda646a5 2023-05-05T15:57:13 [subset-plan] Check success of all object members
Behdad Esfahbod 5f5660fc 2023-05-05T15:52:17 [subset] In glyf-closure always add current glyph Bad things can happen otherwise if one composite glyph depleted the op count.
Garret Rieger 3021b2db 2023-05-05T05:57:05 [subset] change glyph mapping api to return a mutable map. Maintains consistency with our other set based api methods.
Garret Rieger 77a81554 2023-05-04T23:01:56 [subset] Add some basic tests for a provided glyph map.
Garret Rieger 779e8297 2023-05-04T19:31:23 [subset] fix requested_glyph_map presence check.
Garret Rieger 68266347 2023-05-04T19:18:54 [subset] apply the user supplied glyph map.
Qunxin Liu b9b85da3 2023-04-27T11:17:24 [instancer] no need to create hb_font_t object when fetching delta from varstore
Behdad Esfahbod 1e9a0511 2023-04-20T17:47:04 [subset] Fix HB_TINY build
Behdad Esfahbod 106a237e 2023-04-20T17:44:59 [subset/glyf] Close over VarComposite glyphs Subsetting VarComposite glyphs works now.
Garret Rieger 14b9d8d5 2023-04-14T20:44:15 [subset] add --no-layout-closure flag. Disables layout glyph closure. Fixes #4192.
Qunxin Liu 96ed2072 2023-04-04T10:33:58 [instancer] update bound metrics for CFF2 instancing
Garret Rieger 2cd81fdf 2023-03-30T22:11:43 [subset] fix memory leak. Fixes fuzzer issue https://oss-fuzz.com/testcase-detail/6169920089227264
Garret Rieger be872001 2023-03-24T17:30:53 [subset] fix buffer overflow fuzzer reported issue.
Garret Rieger 79ae6b65 2023-03-24T17:14:55 [subset] Fix fuzzer found memory leaks.
Garret Rieger f0f7f225 2023-03-20T18:39:49 [subset] fix fuzzer found null deref. https://oss-fuzz.com/testcase-detail/5844352760152064
Garret Rieger a84cae42 2023-03-15T02:39:57 [subset] Don't add invalid gids (-1) to the glyphset when loading glyph map from the accelerator.
Qunxin Liu 125450d2 2023-03-13T15:43:29 [subset] collect name_ids for FeratureParams
Qunxin Liu de6533d8 2023-03-13T13:36:00 [subset] collect name_ids from CPAL table
Qunxin Liu 840e1b6b 2023-02-07T13:49:19 [instancer] bug fix
Garret Rieger ea1ee0d4 2023-01-14T00:23:53 [instance] drop and don't collect lookups from feature variations when fully instancing. This previously incorrectly collected lookups that could be reached via feature variations that are dropped and not activated by the current instance position.
Behdad Esfahbod c5281052 2023-01-12T12:53:46 [subset-plan] Move construction to constructor
Behdad Esfahbod 1426f1c8 2023-01-11T13:23:34 [subset-plan] Simplify name_table_overrides allocation
Behdad Esfahbod 5cab4a55 2023-01-11T13:21:57 [subset-input] Simplify axes_location allocation
Behdad Esfahbod 4e7c8039 2023-01-11T12:38:26 [subset-plan] Simplify name_table_overrides allocation
Behdad Esfahbod 65d3db37 2023-01-11T12:36:54 [subset-plan] Simplify user_axes_location allocation
Behdad Esfahbod 60418fcb 2023-01-11T12:33:25 [subset-plan] Simplify axes_index_map allocation