Commit Graph

430 Commits

Author SHA1 Message Date
Behdad Esfahbod 720ab0883b [util] Add --single-par
Use it in aots tests

Fixes https://github.com/harfbuzz/harfbuzz/issues/3129
Related https://github.com/harfbuzz/harfbuzz/issues/3298
2021-11-25 11:49:16 -07:00
Behdad Esfahbod b58afe586f [util] Undo treat as single-paragraph text provided on cmdline
Reverts d92ee726ce
except that it does so even in batch mode.

Am going to add a --single-par mode that will affect all input
modes.

Part of https://github.com/harfbuzz/harfbuzz/issues/3129
Fixes https://github.com/harfbuzz/harfbuzz/issues/3298
2021-11-25 11:34:24 -07:00
Behdad Esfahbod da500568de [API] Add hb_buffer_[sg]et_not_found_glyph() and --not-found-glyph
Instead of using gid=0 when a character is not found in the font,
client can now set a custom value.  This is useful for shaper-driven
font fallback and to differentiate that from .notdef glyph.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1360
2021-10-26 08:02:29 -06:00
Garret Rieger d700646c33 [subset] In preperation for 3.0.0 release remove legacy subsetting api methods. 2021-09-16 15:31:29 -06:00
Behdad Esfahbod cd77846bd9 [util] Fix leak of an hb_font_t 2021-09-14 08:35:19 -04:00
Behdad Esfahbod da285d511f [util/shape-consumer] Simplify font tracking 2021-09-14 08:28:12 -04:00
Khaled Hosny 838d670752 [subset] Improve alignment of --help-all message 2021-09-08 15:12:52 +02:00
Behdad Esfahbod 04cf6212d7 [util/hb-subset] Fix --version and --help again
38ad093216
2021-08-30 18:35:26 -06:00
Behdad Esfahbod fdce294120 [util/hb-subset] Print error and suggest filing github issue if operation fails
https://github.com/harfbuzz/harfbuzz/issues/3173#issuecomment-906715780
2021-08-29 09:46:42 -06:00
Behdad Esfahbod 38ad093216 [util/hb-subset] Don't ignore errors during face parsing
Was ignoring file-not-found errors.
2021-08-29 09:46:42 -06:00
Garret Rieger 1e1438c4fb
[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.
2021-08-26 14:59:29 -06:00
Garret Rieger 9db494f517
[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 -=.
2021-08-26 10:51:38 -06:00
Behdad Esfahbod 99356ea5f0
Merge pull request #3150 from harfbuzz/item-context-tests
[test] Add tests for item context
2021-08-25 17:19:06 -06:00
Garret Rieger 75efade7a4 [subset] format --gids and --unicodes help messages better. 2021-08-25 14:51:21 -07:00
Garret Rieger fa4bf7cf58 [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.
2021-08-25 14:31:11 -07:00
Garret Rieger 8f4f47df7c [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.
2021-08-25 13:34:05 -07:00
Garret Rieger f2441a4b65 [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.
2021-08-24 18:17:07 -06:00
Khaled Hosny 430224b1a0 [buffer] Handle pre/post-context in buffer_append
Fixes https://github.com/harfbuzz/harfbuzz/issues/1843
2021-08-24 02:11:17 +02:00
Khaled Hosny 6ca0ffd42e [util] Add --unicodes-before/after
Parallel to --unicodes for --text-before/after. To be used in tests.
2021-08-24 02:08:01 +02:00
Behdad Esfahbod 829b0f3353
Merge pull request #3154 from harfbuzz/set-invert
Resurrect hb_set_invert()
2021-08-20 01:28:15 -06:00
Behdad Esfahbod 7115af23eb [util] Fix glib deprecation warning re g_memdup() 2021-08-19 15:55:21 -06:00
Simon Cozens e29f56354a Replace "langstr" with more helpful help. 2021-08-18 09:31:44 -06:00
Behdad Esfahbod ccc2a1921a [util/hb-subset] Whitespace 2021-08-12 13:00:28 -06:00
Behdad Esfahbod 4dfc668e0a [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.
2021-08-12 13:00:28 -06:00
Behdad Esfahbod 08d43d1ba1 [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.
2021-08-12 13:00:28 -06:00
Behdad Esfahbod 11b0b68853 [util/hb-subset] Pre-parse font-face so we can use it during main parsing 2021-08-12 13:00:28 -06:00
Behdad Esfahbod c45d2a9c9d [util] Allow setting cli summary / description 2021-08-12 11:19:59 -06:00
Behdad Esfahbod 4f3b7b7035 [util] Remove unused usage 2021-08-12 11:05:31 -06:00
Behdad Esfahbod 1cb621d35d [util/hb-subset] Minor move parsing 2021-08-12 10:58:19 -06:00
Behdad Esfahbod 3f94177ee8 [util] Use g_set_error() in one more place 2021-08-12 10:43:31 -06:00
Behdad Esfahbod 4d73b3d9b1 [util] Add --batch to hb-view / hb-ot-shape-closure 2021-08-12 10:39:46 -06:00
Behdad Esfahbod 23282c9c9d [util/hb-subset] Support ranges in --unicodes / --unicodes-file
Fixes https://github.com/harfbuzz/harfbuzz/issues/3109
2021-08-11 22:49:47 -06:00
Behdad Esfahbod f60f005b1f [util/hb-subset] Remove wrong hb_set_destroy() in error paths 2021-08-11 22:36:00 -06:00
Behdad Esfahbod 49cf36027c [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
2021-08-11 22:34:14 -06:00
Behdad Esfahbod bf80b7ea45 [util/hb-subset] Add --glyphs for passing glyph names
Part of https://github.com/harfbuzz/harfbuzz/issues/2455
2021-08-11 22:07:45 -06:00
Behdad Esfahbod 5b07c3c7d0 [util/hb-subset] Parse --text & --unicodes 2021-08-11 21:32:28 -06:00
Behdad Esfahbod 4ec727e55f [util] Minor edit of failure messages 2021-08-11 20:46:16 -06:00
Behdad Esfahbod b83f25c749 [util/hb-subset] Revamp option groups 2021-08-11 20:42:20 -06:00
Behdad Esfahbod 9a6055caa8 [util/hb-ot-shape-closure] Remove unnecessary include 2021-08-11 20:30:25 -06:00
Behdad Esfahbod c98773ebb0 [util/hb-subset] Move output-file validation code into post_parse 2021-08-11 20:22:03 -06:00
Behdad Esfahbod 58bfe40794 [util] Move hb-subset away from main-font-text 2021-08-11 20:12:36 -06:00
Behdad Esfahbod ba418cfc52 [util] Use automatic casts 2021-08-11 19:29:07 -06:00
Behdad Esfahbod 97a9e4e41e [util] Separate shape_text_options_t from text_options_t 2021-08-11 19:28:16 -06:00
Behdad Esfahbod 6ba7ddafed [util] Move text-file opening to post_parse 2021-08-11 19:06:57 -06:00
Behdad Esfahbod 23298bc846 [util] Remove unnecessary check 2021-08-11 18:58:25 -06:00
Behdad Esfahbod fd0778aa2a [util] Use post_parse in output_options_t 2021-08-11 18:54:46 -06:00
Behdad Esfahbod 24a9d8c78d [util] Use post_parse in font_options_t 2021-08-11 18:49:59 -06:00
Behdad Esfahbod e4b33d9d36 [util] Use post_parse in face_options_t 2021-08-11 18:49:58 -06:00
Behdad Esfahbod c0ea4e2d33 [util] Use post_parse to validate 2021-08-11 18:30:08 -06:00
Behdad Esfahbod 9468e46998 [util] Rename main_font_text back to main_font_text_t 2021-08-11 16:46:04 -06:00