Commit Graph

146 Commits

Author SHA1 Message Date
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
Qunxin Liu b2a965df5e [subset] Add support for "--gids" option
cmap subsetting now retains entries associated with any glyph ids explicitly requested
2020-05-11 15:28:58 -07:00
Qunxin Liu 36a5c042d7 [subset] Add "--name-languages" and "--name-legacy" options
Make name table subsetting consistent with fontTools
2020-01-24 23:17:04 +03:30
Ebrahim Byagowi e171beeb5f Revert "[subset] Add "--name-languages" and "--name-legacy" options"
Causes tests failures, please reapply when tests are fixed, thanks.

This reverts commit fd85818b5b.
2020-01-24 19:51:32 +03:30
Qunxin Liu fd85818b5b [subset] Add "--name-languages" and "--name-legacy" options
Make name table subsetting consistent with fontTools
2020-01-23 17:24:05 -08:00
Qunxin Liu 8ffc9add22 [subset] layout closure_features and store them in subset-plan 2020-01-14 07:24:48 +03:30
Qunxin Liu 0b39c48064 [subset] closure lookups for GSUB/GPOS 2020-01-10 13:11:06 -08:00
Ebrahim Byagowi a0b4ac4dce Turn 8 spaces to tab across the project
According to the current code style of the project
2019-08-27 02:40:41 +04:30
rsheeter 96de94768b
Merge pull request #1722 from googlefonts/glyf
[subset] Use iterators in glyf/loca subsetting
2019-05-24 11:22:41 -07:00
Garret Rieger 0af9de13b7 [subset] For gsub subsetting only consider glyphs reachable via gsub closure. 2019-05-21 13:02:11 -07:00
Rod Sheeter d1b12a5465 Merge branch 'master' of https://github.com/harfbuzz/harfbuzz into glyf 2019-05-20 21:29:54 -07:00
rsheeter 02d4d4f3e6 [subset] Starting to sketch glyf as iter 2019-05-20 21:24:59 -07:00
Garret Rieger 0ff3618c2d [subset] Use hb_subset_input_t inside of subset_options_t so that input defaults are shared between the library and cli. 2019-05-20 13:35:46 -07:00
Garret Rieger 3be0ffe45d [subset] Add drop tables to subset input. 2019-05-20 13:35:46 -07:00
Qunxin Liu e501ea143d [subset] Subset name table step 3, add --nameids option to guide the
selection of which name records to keep in the subset method.
2019-04-26 15:24:47 -07:00
Michiharu Ariza 474f3587cd copy retain_gids from input to plan 2019-04-26 10:12:38 -07:00
Qunxin Liu 2d9034491e completely remove lines that are commented out 2019-03-26 13:39:33 -07:00
Qunxin Liu 79a6c25849 try to remove deprecated variable from struct definition 2019-03-26 13:39:33 -07:00
Garret Rieger bdbe047d6c [subset] Update hb-subset-plan.cc to match hb-subset-plan.hh. 2019-01-29 13:19:21 -08:00
Garret Rieger 846e05a298 [subset] Re-add glyphs array to subset plan, with new name 'glyphs_deprecated'. Switch CFF subsetting to use it. 2019-01-29 13:19:21 -08:00
Garret Rieger 03e88eab5c Re-implement HMTX/VMTX subsetting. Update it to support glyph renumbering and simplify the implementation. 2019-01-29 13:19:21 -08:00
Garret Rieger 4af3be6ef8 Remove glyph array from subset plan, make num_glyphs and glyphset private. 2019-01-29 13:19:21 -08:00
Garret Rieger 23f364429d [subset] Fix hdmx subsetting when retain gids is enabled. 2019-01-29 13:19:21 -08:00
Garret Rieger 2da1654aef [subset] Compute num_glyphs during subset plan construction.
Update maxp to use the correct num glyphs.
2019-01-29 13:19:21 -08:00
Ebrahim Byagowi b2ebaa9afa Remove redundant 'inline' from methods (#1483) 2018-12-16 14:08:10 -05:00
Michiharu Ariza b403be8ad9 Merge branch 'master' into cff-subset 2018-11-16 12:29:18 -08:00
Ebrahim Byagowi 11aa0468ac [subset] minor, adjust spaces 2018-11-16 00:02:47 +03:30
Michiharu Ariza e600e5440b Merge branch 'master' into cff-subset 2018-11-01 16:13:56 -07:00
Michiharu Ariza d56e338a90 CFF1 no-desubroutinize + no-hinting
no-desubroutinize option is disabled for now
code cleanup (esp. CFF1 width handling)
bug fixes & renaming
2018-10-31 22:30:34 -07:00
Behdad Esfahbod 35d410f2ba Remove ASSERT_POD
Newer compilers / language allows structs with constructor in union.
So, this was not actually testing anything.  Indeed, the recent
change in DISALLOW_COPY *is* making some of our types non-POD.
That broke some bots.

Just remove this since it wasn't doing much, and I'd rather have
DISALLOW_COPY.
2018-10-29 14:45:44 -07:00
Behdad Esfahbod 3f00d0b0df [subset] Keep glyph set in plan
Should remove the vector version at some point...
2018-09-03 18:54:32 -07:00
Behdad Esfahbod aba0a945c5 [subset] Add hb-subset-input.hh and make hb-subset.hh toplevel include 2018-08-31 13:25:19 -07:00
Behdad Esfahbod 93fe0faaee [subset] Clean up hb_subset_input_t API 2018-08-29 18:24:03 -07:00
Behdad Esfahbod f39166f0c0 [subset] Remove unused hb_subset_profile_t
We might reintroduce it later, but for now remove, as it was unused.
Some things that should have been in this object (drop_hints, etc)
are already in hb_subset_input_t.  So, for now, keep everything there.
2018-08-29 18:09:55 -07:00
Behdad Esfahbod c77ae40852 Rename hb-*private.hh to hb-*.hh
Sorry for the noise, downstream custom builders.  Please adjust.
2018-08-25 22:36:36 -07:00
Behdad Esfahbod aadb2a9188 Add face-builder
New API:
+hb_face_builder_create
+hb_face_builder_add_table
2018-08-25 08:18:53 -07:00
Behdad Esfahbod be458eb059 Include more basic internal headers from hb-private.hh 2018-07-10 14:41:04 +02:00
Garret Rieger a5673da9be [subset] Add drop_ot_layout setting to subset input. 2018-06-08 12:09:34 -06:00
Behdad Esfahbod 58400a2ad8 Remove DISALLOW_* from vector, set, and map
Some of the build bots, still fail on this.  I suppose mine pass because
I enable C++11...

Anyway, remove these again.
2018-06-02 20:30:09 -07:00
Garret Rieger 251cc977e9 [subset] Switch to using hb_map_t inside of hb_subset_plan_t. 2018-05-30 17:23:59 -06:00
Garret Rieger 03b2754812 [subset] Add const to the hb_subset_plan_t input to a couple functions in hb-subset-plan. 2018-05-04 11:18:25 -07:00
Behdad Esfahbod 5c3112aec8 s/hb_prealloced_array_t/hb_vector_t/g
Part of https://github.com/harfbuzz/harfbuzz/issues/1017
2018-05-01 19:07:04 -04:00
Rod Sheeter 74e0c13a4a [subset] drop hint tables if so flagged. Still need to dump glyf instructions. 2018-02-21 11:19:18 -08:00
Behdad Esfahbod 4fcbd22b18 Fix build after previous commit 2018-02-19 11:49:25 -08:00
Garret Rieger dcac9fe964 [subset] Use complex glyph closure to populate gids_to_retain_sorted. 2018-02-16 18:29:29 -08:00
Rod Sheeter 66e282df32 [subset] remove TODO that was already done 2018-02-14 15:31:13 -08:00
Rod Sheeter fa87770372 [subset] First pass at hmtx 2018-02-14 14:53:10 -08:00
Rod Sheeter 1330edc4fe Use functions to get new gids. Avoid 0; fonttools drops it from cmap. 2018-02-12 14:29:23 -08:00
Behdad Esfahbod c31fcf4c58 [subset] Replace auto_array with prealloced_array
auto_array has constructor/destructor. Cannot be used in POD object, as the clang
bots all noticed...
2018-02-10 14:20:10 -06:00
Behdad Esfahbod bfa871634c Minor 2018-02-10 14:06:53 -06:00
Ebrahim Byagowi 844f48ea9a
Fix symbol exporting and libstdc++ linkage of hb-subset (#769) 2018-02-10 23:13:12 +03:30
Garret Rieger 0089443756 Keep a second set of glyph ids in subset plan which is sorted by glyph id and always has gid 0 2018-02-09 16:22:09 -08:00
Rod Sheeter 59c658c8d5 capture codepoints sorted so we can use them for cmap later. one day we will have a map 2018-02-08 19:22:47 -08:00
Garret Rieger 42234424a0 Fix include gaurds and include order in hb-subset-glyf and hb-subset-plan 2018-02-08 17:31:11 -06:00
Garret Rieger 217ed5e3c8 Cleanups in hb-subset-glyf and hb-subset-plan. 2018-02-08 17:31:11 -06:00
Behdad Esfahbod af02812fc5 [subset] Change hb_subset API to remove hb_subset_face_t 2018-02-07 13:07:46 -05:00
Rod Sheeter eb485bb9e9 Horrid hack to assign new gids. Use DEBUG_MSG over fprintf 2018-02-07 12:41:21 -05:00
Rod Sheeter d0ce3c66e2 Resolve codepoints:glyph ids. Does not compile; undefined reference to OT::_hb_NullPool 2018-02-07 12:41:21 -05:00
Garret Rieger 25e9173fe8 Make hb-subset-plan private. 2018-02-07 12:41:21 -05:00