util/hb-subset.cc

Branch


Log

Author Commit Date CI Message
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.
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 fd9903fc 2025-04-06T16:04:17 [hb-subset] Try to fix leak
Behdad Esfahbod 00b4f86e 2025-04-05T15:58:55 [hb-subset] In batch mode preprocess font once Speeds up cmap.tests from 3s to under .5s.
Behdad Esfahbod fa737da0 2025-04-05T15:26:07 [hb-subset] Speed up parsing glyphs-file Cache the font used to load glyph names.
Behdad Esfahbod 54295ccf 2025-04-05T15:26:07 [hb-subset] Speed up parsing glyphs-file Cache the font used to load glyph names.
Behdad Esfahbod 0fecd2ec 2025-04-05T15:20:49 [hb-subset] Accept gidXXX-style glyph names
Behdad Esfahbod a637c08d 2025-04-05T15:01:54 [hb-subset] Fix leak
Behdad Esfahbod 32075759 2025-04-04T17:59:46 [subset] Allow options before --font-file Fixes https://github.com/harfbuzz/harfbuzz/issues/4913
Behdad Esfahbod 59001aa9 2025-03-26T12:33:06 [util] Add brief --help descriptions Part of https://github.com/harfbuzz/harfbuzz/issues/5208
Behdad Esfahbod 3d3f2419 2025-03-26T01:18:09 [util] Improve help messages a bit Part of https://github.com/harfbuzz/harfbuzz/issues/5208
Behdad Esfahbod 39ea4cdd 2024-08-14T10:13:27 [hb-subset] Fix a resource leak Part of https://github.com/harfbuzz/harfbuzz/issues/4832
Behdad Esfahbod d5596dfb 2024-08-06T15:15:41 [hb-subset] Report "Invalid font file." Fixes https://github.com/harfbuzz/harfbuzz/issues/4824#issuecomment-2272156543
Garret Rieger 4cf606f6 2024-05-02T20:46:29 [instancer] Promote partial instancing api out of experimental.
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 2dabbdfc 2024-02-02T13:39:04 [instancer] fix help message for --optimize
Qunxin Liu c7a6030b 2024-01-26T09:27:27 [instancer] add a flag HB_SUBSET_FLAGS_IUP_DELTA_OPT
Garret Rieger d30c1dac 2023-11-15T20:16:07 Add test suite for instancing option parsing.
Garret Rieger 43236ce3 2023-11-01T22:34:39 [instancer] add the option to leave blanks in the min:def:max syntax. When parsing axis positions in the --variations flag recognize empty values as meaning the existing value for that part. For example: :300:500 Specifies min = existing, def = 300, max = 500. See: https://github.com/fonttools/fonttools/issues/3322
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.
Garret Rieger 7b46d772 2023-11-01T20:07:07 [instancer] Update help message for --instance. Remove note about partial instancing not being supported. Add --variations flag as an alternate name for --instance. This matches other hb utils.
Behdad Esfahbod 598de82f 2023-10-27T12:13:13 [hb-subset] Fix warning
Qunxin Liu 0aa5dafe 2023-08-08T08:33:11 fix bots. -Also disable partial instancing tests for now, cause the command option is wrapped by experimental_api
Qunxin Liu 32cfa37e 2023-05-08T13:30:39 [instancer] command line support for partial instancing -Also updated hb_subset_input_set_axis_range (), so user can define default value as well
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 98e73192 2023-05-04T22:20:06 [subset] Add command line flag to provide a gid mapping.
Garret Rieger 90356eb2 2023-04-14T20:52:35 [subset] Note --no-layout-closure is only for GSUB.
Garret Rieger 14b9d8d5 2023-04-14T20:44:15 [subset] add --no-layout-closure flag. Disables layout glyph closure. Fixes #4192.
Behdad Esfahbod 30d4a734 2023-01-06T16:00:53 [hb-subset] Adjust help for instancing
Behdad Esfahbod aba6cbe8 2023-01-06T13:09:10 [hb-subset] Adjust --help-all formatting Meh.
Behdad Esfahbod 85e8f2b5 2023-01-01T18:26:08 [hb-subset] Initialize preprocess variable
Behdad Esfahbod 4a5bd7a9 2023-01-01T16:53:28 [subset] Add hb_subset_input_keep_everything() Fixes https://github.com/harfbuzz/harfbuzz/issues/3998 New API: + hb_subset_input_keep_everything()
Behdad Esfahbod d87add41 2023-01-01T16:27:26 [hb-subset] Rename --preprocess-face to --preprocess Keep old name working but hidden.
Garret Rieger 1a51f71a 2022-12-19T22:40:11 [subset] don't segfault when --help-all is specified w/ instancing options.
Garret Rieger 9fbe52b8 2022-12-12T20:24:24 [subset] enable instancing tests by default.
Garret Rieger eda02c2e 2022-12-05T20:18:41 [subset] Move hb_subset_preprocess to be non-experimental.
Behdad Esfahbod 1b867530 2022-12-05T11:44:52 [hb-subset] Support -u, -g, -t For --unicodes, --gids, --text.
Garret Rieger 4c49daf7 2022-11-23T22:33:57 [subset] actually use the preprocessed face in hb-subset. Tests weren't actually using the preprocessed face due to this typo in util/hb-subset.
Garret Rieger 515863e5 2022-10-13T23:42:00 [subset] Remove add accelerator flag, replace with new api method. Adds hb_subset_preprocess() which preprocesses the face and attaches accelerator data.
Garret Rieger 3394ec70 2022-10-13T23:02:54 [subset] use subset accelerator in tests. This ensures it produces equivalent subsets as without the accelerator.
Behdad Esfahbod a66ba594 2022-07-19T16:32:32 [util] Fix stack-underflow Fixes https://github.com/harfbuzz/harfbuzz/issues/3737
Qunxin Liu 2a4773e4 2022-06-21T19:29:52 add option "--instance", store axes_location in subset_plan and drop all variation tables when all axes are pinned at default
jfkthame 0cd404d0 2022-07-09T20:23:22 Typo fix in hb-subset s/substract/subtract/
Garret Rieger 38e81f2b 2022-06-30T21:09:11 [subset] Add --layout-scripts command line flag.
Cosimo Lupo cc0f1f3b 2022-04-12T10:45:43 Expose --passthrough-tables option to hb-subset CLI tool
luz paz e2e30506 2022-01-16T07:00:53 Fix various typos Found via `codespell -q 3 -S ./perf/texts -L actualy,ba,beng,fo,gir,inout,nd,ot,pres,ro,te,teh,timne`
Garret Rieger d700646c 2021-09-16T11:23:09 [subset] In preperation for 3.0.0 release remove legacy subsetting api methods.
Khaled Hosny 838d6707 2021-09-08T15:12:52 [subset] Improve alignment of --help-all message
Behdad Esfahbod 04cf6212 2021-08-30T18:35:08 [util/hb-subset] Fix --version and --help again https://github.com/harfbuzz/harfbuzz/commit/38ad093216d8204df2dce18a112ee43964031357
Behdad Esfahbod 38ad0932 2021-08-29T09:44:07 [util/hb-subset] Don't ignore errors during face parsing Was ignoring file-not-found errors.
Garret Rieger 1e1438c4 2021-08-26T14:59:29 [subset] fix --*-file options in hb-subset. (#3176) The previous change to add -/+ versions of each set type broke all of the --*-file input options since all of the parse functions now default to replacing the set if the + variant is not being used. This fixes the issue by changing parse_file_for to pass '+' as the name to the parsing function. This triggers the append mode.
Garret Rieger 9db494f5 2021-08-26T10:51:38 [subset] Update remaining subset input sets to use inversion for all. (#3172) * [subset] Update remaining subset input sets to use inversion for all. * [subset] Update flag help for remaining sets to mention -=.
Garret Rieger 75efade7 2021-08-25T14:51:21 [subset] format --gids and --unicodes help messages better.
Garret Rieger fa4bf7cf 2021-08-25T14:31:11 [subset] use inverted sets for glyph id input. Adds --gids-=, --glyphs-=, --text-=, --unicodes-= options. Use inverted sets to represent all glyphs and/or all unicodes.
Garret Rieger 8f4f47df 2021-08-25T13:34:05 [subset] use inverted set for all unicodes. Modify the code that handles input->unicodes to be safe with possibly inverted sets. Also adds --unicodes-= and --unicodes+= flags.
Garret Rieger f2441a4b 2021-08-24T15:53:32 [subset] Remove retain all layout features flag. Instead use inverted sets to handle requesting all features. Modifies feature collection in subset plan to intersect the set of requested features against the features in the font. This prevents iterating a fully filled feature tag set.
Behdad Esfahbod 7115af23 2021-08-19T15:55:21 [util] Fix glib deprecation warning re g_memdup()
Behdad Esfahbod ccc2a192 2021-08-12T12:44:52 [util/hb-subset] Whitespace
Behdad Esfahbod 4dfc668e 2021-08-12T12:40:21 [util/hb-subset] Move glyph name parsing inline instead of post_parse Now that we have face around we can just do it as it happens.
Behdad Esfahbod 08d43d1b 2021-08-12T11:40:56 [util/hb-subset] Move add_all_unicodes inline, instead of post_parse Now that we have the font loaded, we can do it as it happens.
Behdad Esfahbod 11b0b688 2021-08-12T11:38:28 [util/hb-subset] Pre-parse font-face so we can use it during main parsing
Behdad Esfahbod c45d2a9c 2021-08-12T11:17:26 [util] Allow setting cli summary / description
Behdad Esfahbod 1cb621d3 2021-08-12T10:58:19 [util/hb-subset] Minor move parsing
Behdad Esfahbod 4d73b3d9 2021-08-12T10:39:46 [util] Add --batch to hb-view / hb-ot-shape-closure
Behdad Esfahbod 23282c9c 2021-08-11T22:49:47 [util/hb-subset] Support ranges in --unicodes / --unicodes-file Fixes https://github.com/harfbuzz/harfbuzz/issues/3109
Behdad Esfahbod f60f005b 2021-08-11T22:36:00 [util/hb-subset] Remove wrong hb_set_destroy() in error paths
Behdad Esfahbod 49cf3602 2021-08-11T22:34:14 [util/hb-subset] Parse --gids-file, --glyphs-file, --text-file, --unicodes-file Fixes https://github.com/harfbuzz/harfbuzz/issues/2455 Fixes https://github.com/harfbuzz/harfbuzz/issues/3002
Behdad Esfahbod bf80b7ea 2021-08-11T22:07:45 [util/hb-subset] Add --glyphs for passing glyph names Part of https://github.com/harfbuzz/harfbuzz/issues/2455
Behdad Esfahbod 5b07c3c7 2021-08-11T21:14:55 [util/hb-subset] Parse --text & --unicodes
Behdad Esfahbod c98773eb 2021-08-11T20:22:03 [util/hb-subset] Move output-file validation code into post_parse
Behdad Esfahbod 58bfe407 2021-08-11T19:48:28 [util] Move hb-subset away from main-font-text
Behdad Esfahbod 97a9e4e4 2021-08-11T19:28:16 [util] Separate shape_text_options_t from text_options_t
Behdad Esfahbod e4b33d9d 2021-08-11T18:35:11 [util] Use post_parse in face_options_t
Behdad Esfahbod 9468e469 2021-08-11T16:46:04 [util] Rename main_font_text back to main_font_text_t
Behdad Esfahbod 9d8bbe3e 2021-08-11T11:53:32 [util] Make main_font_text a struct again Going to move to G_OPTION_REMAINING.
Behdad Esfahbod 5bd463f1 2021-08-10T14:26:48 [util/hb-subset] Access input directly
Behdad Esfahbod b83fd3a5 2021-08-10T02:21:05 [util] Refactor batch-processing code into batch.hh
Behdad Esfahbod d92ee726 2021-08-09T19:08:34 [util/hb-shape] Treat as single-paragraph text other than provided by a file Fixes https://github.com/harfbuzz/harfbuzz/issues/3129
Behdad Esfahbod 7d2e9164 2021-08-07T13:38:19 [util] Move text options into text_options_t Remove now empty options.cc.
Behdad Esfahbod 93bc62e9 2021-08-07T13:13:58 [util] Move output options into output-options.hh
Behdad Esfahbod af9d2495 2021-08-07T12:29:52 [util] Use inheritance for output_options_t
Behdad Esfahbod 5545eea7 2021-08-07T11:04:46 [util] Remove main_font_text_t class, use bare function
Behdad Esfahbod 58c22335 2021-08-06T23:45:59 [util] Move face/font options into face/font-options.hh
Behdad Esfahbod 798bb89c 2021-08-06T23:29:29 [util] Move shape format options into shape-format.hh
Behdad Esfahbod 167f58a2 2021-08-06T23:03:30 [util] Move subset options into subset-options.hh
Behdad Esfahbod 4e97678e 2021-08-06T22:53:44 [util] Use inheritence to embed inherent options of objects
Behdad Esfahbod 6500f68f 2021-08-06T18:46:31 [util] Change hb-subset to use face_options_t instead of font_options_t
Behdad Esfahbod 71440dbd 2021-08-05T13:48:59 [util] Move font-size and upem to be extern variables
Behdad Esfahbod fc0339ee 2021-08-05T13:35:46 [util] Simplify shape-consumer by removing buffer arg
Behdad Esfahbod e014c6fa 2021-08-05T13:24:59 [util/main-font-text] Move eol from template arg to main() arg
Behdad Esfahbod e109f9a6 2021-08-05T11:05:51 [util] Collect cmdline arg options outside of constructor
Behdad Esfahbod e57dd668 2021-08-05T10:33:31 [util] Initialize struct members inline
Behdad Esfahbod 21f1054d 2021-08-04T20:23:48 [util/hb-subset] Keep face around instead of font
Behdad Esfahbod db6fbe29 2021-08-03T10:13:17 [util/hb-subset] Use driver_t<> in outer block as well https://github.com/harfbuzz/harfbuzz/commit/a363ce573c3aa706de3aecf0515519a5d7842af2#r54282223
Behdad Esfahbod 47d47e8c 2021-08-01T22:12:08 [util/hb-shape/hb-subset] Don't terminate on first error in batch mode There's no reason to quit processing. The failure is already communicated via stdout in both cases.
Behdad Esfahbod a363ce57 2021-08-01T22:11:13 [util/hb-subset] Minor refactor of batch mode To match recent changes to hb-shape.
Khaled Hosny 10e73d18 2021-08-01T11:11:12 [test] Add batch mode to hb-subset and use it time meson test --suite=subset down from: real 0m22.822s user 0m44.561s sys 0m9.255s to: real 0m19.418s user 0m38.171s sys 0m3.587s Does not seem to help much, but it is something. Part of https://github.com/harfbuzz/harfbuzz/issues/3089
Garret Rieger 3d534b14 2021-07-29T11:52:14 [subset] convert subset input flags into bit flags. Store the flags in a bit set. Updates the public api to work with the bit set directly.
Garret Rieger 668f2bd9 2021-06-09T16:33:50 [subset] Add hb_subset_or_fail () to public subset api.
Garret Rieger 1bb00cd5 2021-05-26T14:18:32 [subset] add num-iterations flag to util/hb-subset.