Commit Graph

108 Commits

Author SHA1 Message Date
Behdad Esfahbod c632a164b9 [subset/cff] Support instancing 2023-01-06 11:01:25 -07:00
Qunxin Liu 8eadb83640 [subset] Update hb_subset_input_override_name_table API
Override the name string for the NameRecord identified by name_id,
platform_id, encoding_id and language_ids specified by the user.
If a record with specified name_id does not exist, this API will create
a new NameRecord with provided info and insert it to the name table.
2022-12-02 18:05:53 -07:00
Behdad Esfahbod ff419789ef [subset-plan] Sort unicode_to_new_gid_list when needed 2022-12-02 16:43:33 -07:00
Behdad Esfahbod 00f2657bb8 [subset] Accelerate sanitize-table-cache
Big wins all across small subsets

BM_subset/subset_codepoints/Roboto-Regular.ttf/nohinting/10                              -0.1140         -0.1129             0             0             0             0
BM_subset/subset_codepoints/Amiri-Regular.ttf/nohinting/10                               -0.4717         -0.4714             0             0             0             0
BM_subset/subset_codepoints/NotoNastaliqUrdu-Regular.ttf/nohinting/10                    -0.8147         -0.8146             0             0             0             0
BM_subset/subset_codepoints/NotoSansDevanagari-Regular.ttf/nohinting/10                  -0.3248         -0.3242             0             0             0             0
BM_subset/subset_codepoints/Mplus1p-Regular.ttf/nohinting/10                             -0.1262         -0.1260             0             0             0             0
BM_subset/subset_codepoints/SourceHanSans-Regular_subset.otf/nohinting/10                -0.0308         -0.0309             0             0             0             0
BM_subset/subset_codepoints/SourceSansPro-Regular.otf/nohinting/10                       -0.1374         -0.1373             0             0             0             0
BM_subset/subset_codepoints/AdobeVFPrototype.otf/nohinting/10                            -0.4555         -0.4555             0             0             0             0
BM_subset/subset_codepoints/MPLUS1-Variable.ttf/nohinting/10                             -0.4175         -0.4174             0             0             0             0
BM_subset/subset_codepoints/RobotoFlex-Variable.ttf/nohinting/10                         -0.4214         -0.4214             0             0             0
2022-11-29 15:20:13 -07:00
Garret Rieger 2c0afde737 [subset] add an inprogress accelerator to plan.
This allows subset code to cache information into the accelerator during preprocess subset. Previously the accelerator was created at the end of subsetting.
2022-11-23 13:41:52 -07:00
Garret Rieger 463ae07e99 [subset] In the preprocess subset call always use long loca.
Long loca is needed so that we can store the trimmed glyph bytes to allow us to safely skip trimming in the later subset.
2022-11-23 12:52:55 -07:00
Behdad Esfahbod a750cb0128 Simplify rvalue creation 2022-11-21 21:03:32 -07:00
Behdad Esfahbod cf20d2ec5d [map] Take const key 2022-11-21 20:47:17 -07:00
Behdad Esfahbod e0b06bd1b1 [subset] Cache has_seac in accelerator
Speeds up SourceHanSans-Regular/10000 benchmark by %25.
2022-11-21 16:30:34 -07:00
Behdad Esfahbod f6076890c5 Hide all mentions of name_table_overrides behind EXPERIMENTAL_API
Fixes https://github.com/harfbuzz/harfbuzz/issues/3872
2022-11-14 16:06:39 -07:00
Behdad Esfahbod ebc382a847 Revert "Avoid use values () in hb-hashmap if value_t has an overriden operator &"
This reverts commit b92e4cc009.
2022-11-14 15:59:46 -07:00
Qunxin Liu b92e4cc009 Avoid use values () in hb-hashmap if value_t has an overriden operator & 2022-11-14 13:19:55 -07:00
Qunxin Liu 6314aa7da4 [subset] add an experimental API that can override name strings for specified name_id 2022-11-08 14:10:25 -07:00
Garret Rieger 515863e57c [subset] Remove add accelerator flag, replace with new api method.
Adds hb_subset_preprocess() which preprocesses the face and attaches accelerator data.
2022-10-13 23:42:00 +00:00
Garret Rieger 01481db582 [subset] use accelerator unicode to gid map if available. 2022-10-13 21:12:22 +00:00
Qunxin Liu f4813e3b7f [instance] update collect_lookups/prune_features()/closure_features() with variations
Some features will be substituted with variations, so we do not collect
lookups from the original feature tables.
2022-09-29 12:14:43 -06:00
Qunxin Liu 64e2f2fc58 [instance] store active featurevariation record/condition idxes in the plan 2022-09-29 12:14:43 -06:00
Qunxin Liu 0a6c16a313 [instance] instantiate fvar table
Added an old->new axes_indices mapping in the subset plan
2022-09-29 12:14:43 -06:00
Qunxin Liu e03043bd0b [subset] don't let VariationStore subset() produce inner_maps
Make it a subset-planning object so VariationStore can subset to
specified inner_maps.

Also add a layout_variation_idx_delta_map in subset_plan
2022-09-01 09:32:41 -07:00
Qunxin Liu ac0e22fa8e [instance] update glyf/hmtx/vmtx tables 2022-08-22 09:29:37 -07:00
Garret Rieger 37d61afd5e [subset] add destructor to subset plan.
This ensures that it's members get destructed before the plan itself is destructed, as hb_object_destroy calls the destructor for plan.
2022-08-18 16:09:36 -06:00
Qunxin Liu df55f840cb [instance] instantiate STAT table when axes are pinned at fixed locations
restricting ranges is not supported yet.
2022-07-18 14:59:07 -06:00
Qunxin Liu 2a4773e43d add option "--instance", store axes_location in subset_plan and drop all
variation tables when all axes are pinned at default
2022-07-18 14:59:07 -06:00
Garret Rieger 29f149c16c [subset] cache sanitized tables in subset plan to avoid sanitizing tables multiple times. 2022-07-08 13:42:38 -06:00
Garret Rieger 1bf051ef3b [subset] refactor feature tag filtering so it can be used for scripts as well. 2022-06-30 20:03:33 +00:00
Behdad Esfahbod f13a79548f [subset] Convert another use of hashmap to unique_ptr 2022-06-03 01:17:20 -06:00
Garret Rieger adae2f2272 [subset-perf] Cache a glyph map for gsub.
This allows us in some cases to avoid using glyph_set_gsub as a filter.
2022-05-18 18:25:36 -06:00
Garret Rieger f0c04114bc [subset] Embed unicode to gid list vector in subset plan. 2022-05-03 22:02:59 +00:00
Garret Rieger 088133d939 [subset] cache cp to new gid list in subset plan.
This avoids having to recompute the ordered list multiple times during cmap generation.
2022-05-02 21:29:16 +00:00
Garret Rieger b65e48a786 [subset] Add subset plan to public API.
Add the ability to create a subset plan which an be used to gather info on things like glyph mappings in the final subset. The plan can then be passed on to perform the subsetting operation.
2022-02-11 14:37:21 -08:00
Qunxin Liu 51655a078e [subset] COLR : only include glyphs after COLR closure 2021-12-06 13:29:21 -07:00
Behdad Esfahbod 394f772937 [map] Allow storing classes in the hashmap
Fixes https://github.com/harfbuzz/harfbuzz/issues/3293

The trick was to change the type of the invalid key/value to be non-class.
2021-11-19 11:49:23 -07:00
Qunxin Liu ca7b9daef0 [subset] subset MATH table 2021-09-22 18:08:30 -04:00
Garret Rieger f9d8e4a976 [subset] switch ..._set_flags to not take a mask. 2021-07-29 18:30:27 -07:00
Garret Rieger 46d4a5e673 [subset] Convert subset plan to use a flags bit set. 2021-07-29 18:02:34 -07:00
Qunxin Liu 71b5509c19 [subset] support option --glyph-names 2021-07-23 13:57:39 -07:00
Garret Rieger a6c6cda486 [subset] Add no subset tables and passthrough unrecognized tables to the subset api.
Matches fontTools options.
2021-07-22 12:12:37 -07:00
Garret Rieger edb57a8d9a Make subset input const in the subsetting operation. Don't modify the subset input's sets. 2021-07-22 12:11:43 -07:00
Qunxin Liu eee7b459ee [subset] add option --no-prune-unicode-ranges 2021-06-24 11:44:20 -07:00
Qunxin Liu d07f789ae3 [subset] support option "--notdef-outline" 2021-06-18 15:35:02 -07:00
Qunxin Liu cb5a6b5a27 [subset] support option --layout-features 2021-05-26 18:04:18 -06:00
Garret Rieger 73ff04a324 [subset] add option to have the subsetter set the mac overlaps flag on each glyph. 2021-05-26 16:04:56 -06:00
Qunxin Liu f739e1dc6a [subset] subset both CPAL and COLRv1 2021-05-26 15:39:42 -06:00
Qunxin Liu e59ffe5482 [subset] COLRv1 layer/palette indices closure 2021-05-12 15:29:53 -06:00
Qunxin Liu 56ca435787 [subset] fix for collect_features and remove_redundant_lamngsys
previously remove_redundant_sys () is missing in harfbuzz, after
redundant langsys removal, some features are removed as well in
prune_features() in fonttools. This change is trying to get the same
result between harfbuzz and fonttools.
2021-03-17 14:24:04 -07:00
Behdad Esfahbod 7a60f4e3a4 [subset] Remove debug burden
Fixes https://github.com/harfbuzz/harfbuzz/issues/2360
2021-02-12 14:14:17 -07:00
Garret Rieger 32f052b033 [ENOMEM] Fix several instances of not checking resize in CFF. 2020-07-31 02:04:06 +04:30
Ebrahim Byagowi 5a7cc7fd8b minor spacing tweak 2020-07-29 08:33:38 +04:30
Garret Rieger dae32b4f12 [subset] bail out of subsetting if plan allocation fails. 2020-07-29 06:37:25 +04:30
Qunxin Liu 8200e48ffc [subset] GDEF Variation Store: step 1
closure device variation indexes, create old->new variation idx mapping
and store them in subset-plan
2020-05-21 12:43:24 -07:00