Commit Graph

428 Commits

Author SHA1 Message Date
Behdad Esfahbod 9d8bbe3e53 [util] Make main_font_text a struct again
Going to move to G_OPTION_REMAINING.
2021-08-11 11:53:32 -06:00
Behdad Esfahbod 5bd463f130 [util/hb-subset] Access input directly 2021-08-10 14:26:48 -06:00
Behdad Esfahbod 6905f6fa60 [util/hb-subset] Use templated function to parse flags directly 2021-08-10 14:24:42 -06:00
Behdad Esfahbod 3e3e1801a5 [util] Small tweaks in --help output 2021-08-10 14:24:42 -06:00
Behdad Esfahbod f3acb977ec [test/shaping;util] Use ';' instead of ':' to separate test fields
Accept that in --batch mode. Also in batch mode don't send the 0th arg.

Related discussion: https://github.com/harfbuzz/harfbuzz/pull/3102
2021-08-10 11:08:36 -06:00
Behdad Esfahbod b83fd3a564 [util] Refactor batch-processing code into batch.hh 2021-08-10 02:32:55 -06:00
Behdad Esfahbod d92ee726ce [util/hb-shape] Treat as single-paragraph text other than provided by a file
Fixes https://github.com/harfbuzz/harfbuzz/issues/3129
2021-08-09 19:16:13 -06:00
Behdad Esfahbod 7d2e9164ab [util] Move text options into text_options_t
Remove now empty options.cc.
2021-08-07 13:38:19 -06:00
Behdad Esfahbod 93bc62e9b2 [util] Move output options into output-options.hh 2021-08-07 13:13:58 -06:00
Behdad Esfahbod af9d2495dc [util] Use inheritance for output_options_t 2021-08-07 13:09:56 -06:00
Behdad Esfahbod 9db0fd4821 [util] Don't show --output-format if no supported formats provided 2021-08-07 12:22:17 -06:00
Behdad Esfahbod 5545eea7e5 [util] Remove main_font_text_t class, use bare function 2021-08-07 11:04:46 -06:00
Behdad Esfahbod 58c223357b [util] Move face/font options into face/font-options.hh 2021-08-06 23:47:48 -06:00
Behdad Esfahbod 6edd50ae7f [util] Move option_parser_t code into options.hh 2021-08-06 23:36:45 -06:00
Behdad Esfahbod 798bb89c96 [util] Move shape format options into shape-format.hh 2021-08-06 23:30:55 -06:00
Behdad Esfahbod c3599fded7 [util] Move shape options into shape-options.hh 2021-08-06 23:24:28 -06:00
Behdad Esfahbod cfb2d6ad9e [util] Move view options into view-options.hh 2021-08-06 23:14:30 -06:00
Behdad Esfahbod 167f58a2ca [util] Move subset options into subset-options.hh 2021-08-06 23:10:49 -06:00
Behdad Esfahbod 370e961faf [util/hb-subset] Use hb-subset.h public API instead of poking inside
Oops.
2021-08-06 22:59:50 -06:00
Behdad Esfahbod 4e97678ebb [util] Use inheritence to embed inherent options of objects 2021-08-06 22:53:44 -06:00
Behdad Esfahbod 06d661803c [util] Fix compiler error
../util/options.cc:588:3: error: narrowing conversion of ‘font_size_flags’ from ‘unsigned int’ to ‘gint {aka int}’ inside { } [-Werror=narrowing]
2021-08-06 19:20:47 -06:00
Behdad Esfahbod c5337c43e9 [util] Fold helper-cairo.cc into helper-cairo.hh 2021-08-06 19:19:50 -06:00
Behdad Esfahbod c329ce1000 [util] Also hide ppem settings in hb-ot-shape-closure
Leaving ptem, as that can in theory change shape closure if we apply it
to optical-size axis (we currently don't).
2021-08-06 19:17:12 -06:00
Behdad Esfahbod c40e00796c [util] Fold helper-cairo-ansi.cc into helper-cairo-ansi.hh 2021-08-06 19:17:12 -06:00
Behdad Esfahbod 4fe43ccbf1 [util] Fold ansi-print.cc into ansi-print.hh 2021-08-06 19:17:12 -06:00
Behdad Esfahbod b1db0e4a0f [util] Fold view-cairo.cc into view-cairo.hh 2021-08-06 19:17:12 -06:00
Behdad Esfahbod 6500f68f1f [util] Change hb-subset to use face_options_t instead of font_options_t 2021-08-06 19:17:12 -06:00
Behdad Esfahbod 869e20e09f [util] separate face options from font options 2021-08-06 19:17:12 -06:00
Behdad Esfahbod b3a2f2bfcf [util/main-font-text] Simplify 2021-08-06 19:17:12 -06:00
Behdad Esfahbod 71440dbd90 [util] Move font-size and upem to be extern variables 2021-08-06 19:17:12 -06:00
Behdad Esfahbod fc0339eef0 [util] Simplify shape-consumer by removing buffer arg 2021-08-06 19:17:12 -06:00
Behdad Esfahbod e014c6fa2d [util/main-font-text] Move eol from template arg to main() arg 2021-08-06 19:17:12 -06:00
Behdad Esfahbod 463411a1de [util] Remove unused option_group_t 2021-08-06 19:17:12 -06:00
Behdad Esfahbod 8588173ee6 [util] Rework post_parse() handling 2021-08-06 19:17:12 -06:00
Behdad Esfahbod 3362b48f5a [util] Templatize add_group logic 2021-08-06 19:17:12 -06:00
Behdad Esfahbod fe90fbeba3 [util] Remove unused pre_parse callback logic 2021-08-06 19:17:12 -06:00
Behdad Esfahbod 09e4d7dd30 [util] Simplify output_options_t 2021-08-06 19:17:12 -06:00
Behdad Esfahbod e109f9a6f9 [util] Collect cmdline arg options outside of constructor 2021-08-06 19:17:12 -06:00
Behdad Esfahbod e57dd66889 [util] Initialize struct members inline 2021-08-06 19:17:12 -06:00
Behdad Esfahbod 21f1054d47 [util/hb-subset] Keep face around instead of font 2021-08-06 19:17:12 -06:00
Behdad Esfahbod db6fbe29e4 [util/hb-subset] Use driver_t<> in outer block as well
a363ce573c (r54282223)
2021-08-04 10:25:03 -06:00
Behdad Esfahbod 47d47e8c43 [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.
2021-08-01 22:12:08 -06:00
Behdad Esfahbod a363ce573c [util/hb-subset] Minor refactor of batch mode
To match recent changes to hb-shape.
2021-08-01 22:11:13 -06:00
Khaled Hosny 10e73d188a [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
2021-08-01 22:08:28 -06:00
Behdad Esfahbod ed99c80623 [util/hb-shape] Refactor driver type duplication 2021-08-01 08:14:59 -06:00
Behdad Esfahbod 05cf81283b [util/hb-shape] Fix use of EOF as end-of-line
EOF is -1, which was being treated as a valid char (255).
Use int instead.
2021-08-01 08:12:40 -06:00
Garret Rieger f9d8e4a976 [subset] switch ..._set_flags to not take a mask. 2021-07-29 18:30:27 -07:00
Garret Rieger 3d534b146c [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.
2021-07-29 18:02:34 -07:00
Behdad Esfahbod d7541f7b55 [util/hb-shape] Free cached resources on termination 2021-07-29 00:34:52 -06:00
Behdad Esfahbod ad03f34df7 [util/hb-shape] Cache blob/face in batch mode 2021-07-29 00:34:52 -06:00
Behdad Esfahbod 5dae8297bb [util] Minor followup to https://github.com/harfbuzz/harfbuzz/pull/3083 2021-07-28 11:35:40 -06:00
Khaled Hosny 50379fbb15 [util] Don’t split text at new lines in batch mode
In batch mode (which is used for testing) we are probably not interested
in splitting text into lines as we could have split the string into
different tests. This fixes a bunch of AOTS tests that use newlines as
input.
2021-07-28 11:35:09 -06:00
Khaled Hosny 92b85749f2 [util] Strip quotes when parsing features
When running in batch mode, the quotes are not stripped by the shell and
end up in the feature string. This breaks one of the AOTS tests.

Alternatively, we can remove the quotes from the test files, not sure
which is less hacky, though!
2021-07-28 11:35:09 -06:00
Qunxin Liu 71b5509c19 [subset] support option --glyph-names 2021-07-23 13:57:39 -07:00
Garret Rieger 668f2bd93e [subset] Add hb_subset_or_fail () to public subset api. 2021-07-22 12:12:36 -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
Behdad Esfahbod bdfed8f113 [blob] Add failing versions of create API
Fixes https://github.com/harfbuzz/harfbuzz/issues/2567

New API:
+hb_blob_create_or_fail()
+hb_blob_create_from_file_or_fail()

Use these in util/ to distinguish empty file from not-found file.
Only err on the latter.
2021-06-15 13:56:30 -06:00
Behdad Esfahbod c61ce962cf [buffer] In hb_buffer_get_positions(), return NULL if inside message callback
As discussed in https://github.com/harfbuzz/harfbuzz/issues/2468#issuecomment-645666066

Part of fixing https://github.com/harfbuzz/harfbuzz/issues/2468
2021-06-10 17:36:38 -06: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
Garret Rieger 1bb00cd54b [subset] add num-iterations flag to util/hb-subset. 2021-05-26 15:20:44 -06:00
Behdad Esfahbod 42bf8e3d49 [util] Disable chafa's truecolor mode
See https://github.com/harfbuzz/harfbuzz/pull/2959#issuecomment-827056111
2021-04-26 12:31:44 -06:00
Hans Petter Jansson 8298c2f93b [hb-view] Use Chafa for terminal graphics if available
This produces high-quality terminal graphics using symbols or sixels
according to the detected terminal capabilities.

Fixes #2430.
2021-04-26 12:13:10 -06:00
Behdad Esfahbod b3159ed8d2 [util] Silence compiler warning 2021-03-30 20:52:56 -06:00
Khaled Hosny c30349d54e [hb-view] Support kitty inline images protocol
https://github.com/harfbuzz/harfbuzz/issues/2758
2021-03-29 15:55:40 -06:00
Khaled Hosny f7d5889b3e [hb-view] Support iTerm2 inline images protocol
https://github.com/harfbuzz/harfbuzz/issues/2758
2021-03-29 15:55:40 -06:00
Khaled Hosny 97a093c52f [hb-subset] Improve error handling a bit
* Check that output-file option is actually set before trying to open
  it.
* Print file name and errno when opening the output file fails.
* Be more resilient when writing output file and use ferror() to check
  for errors.

Fixes https://github.com/harfbuzz/harfbuzz/issues/2711
2020-10-13 11:18:59 -07:00
Simon Cozens c0716bb5dc Move delimiter addition into hb-buffer-serialize 2020-10-09 22:27:55 -06:00
Simon Cozens a0203a28bb Use hb_buffer_serialize to trace in utils 2020-10-09 22:27:55 -06:00
Ebrahim Byagowi 5193357832 Revert "Remove autotools build support"
This reverts commit 01ac32aab2.
2020-08-11 23:51:59 +04:30
Ebrahim Byagowi 01ac32aab2 Remove autotools build support 2020-08-07 23:28:12 +04:30
Ebrahim Byagowi 58a5961ca1 minor spacing tweak 2020-07-29 08:44:23 +04:30
Ebrahim Byagowi 07c43b8cf6 minor spacing tweak 2020-07-29 08:42:52 +04:30
Ebrahim Byagowi 5a7cc7fd8b minor spacing tweak 2020-07-29 08:33:38 +04:30
Ebrahim Byagowi ba810ce83d [tests] Replace space with colon in batch mode 2020-07-06 13:53:19 +04:30
Christoph Reiter 03bd6ead44 [meson] Only pass required dependencies to everything
Instead of passing dependencies as required we used one giant shared
dependency list containing all dependencies for every library/executable.
While this kinda works, the specified deps are also used for generating
the pkg-config files and this leads to lots of Requires.private and Libs.private
entries which aren't really needed.

This removes the "deps" array and replaces it with a few smaller ones and
makes sure the public libraries only get passed the dependencies actually
needed.

Fixes #2441
2020-06-04 23:28:57 +04:30
Behdad Esfahbod 069c5de9f8 [util/hb-view] Add --font-extents
Fixes https://github.com/harfbuzz/harfbuzz/issues/2402
2020-05-14 19:00:37 -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
David Corbett 5a0936f53e Increase the size of the serialization buffer 2020-04-23 16:32:20 -07:00
Ebrahim Byagowi 2a549aadd3
minor 2020-04-21 00:32:34 +04:30
Ebrahim Byagowi 2be859d289 minor, replace nullptr checks with implicit ones 2020-04-21 00:30:34 +04:30
Ebrahim Byagowi 1dd3896688 [meson] Make it work on autotools dist 2020-03-12 14:49:40 +03:30
Aaron Boxer 68f982415b meson: update to latest master 2020-03-11 19:18:57 +03:30
Tim-Philipp Müller 618584e923 meson: rename incbase to incconfig
Makes it clearer what it's for: config.h. See #4.
2020-03-11 19:18:57 +03:30
Tim-Philipp Müller 49ba211a9d meson: add options to enable/disable various features
And fix build without GLib. Fixes #2.
2020-03-11 19:18:57 +03:30
Mathieu Duponchelle 484313ff36 meson: install 2020-03-11 19:18:57 +03:30
Mathieu Duponchelle 99b26789d2 meson: more windows fixes 2020-03-11 19:18:57 +03:30
Mathieu Duponchelle 920efc0ef7 Add Meson build definitions
Fixes #490

http://mesonbuild.com
2020-03-11 19:18:57 +03:30
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
Ebrahim Byagowi ce114d6b27 minor, tweak spaces 2019-12-31 15:53:02 +03:30
Evgeniy Reizner b79ceac3c6 Prefer UINT_MAX instead of uint overflow.
Also, prefer HB_FEATURE_GLOBAL_START and HB_FEATURE_GLOBAL_END.
2019-12-15 11:46:05 -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
Zero King 6d53cda1ba [util] Fix memory leak 2019-07-26 08:56:47 -07:00
Qunxin Liu 1da1b4dc94 [subset] For option "--unicodes", add support for "*" to retain all code points 2019-07-15 11:18:50 -07:00
Bruce Mitchener 659eeddb2d Use C++11 override keyword. 2019-06-04 20:31:32 -07:00
Bruce Mitchener 5846884f86 test: Use nullptr in C++ code. (#1744) 2019-06-03 12:30:25 +04:30
Qunxin Liu 993d81b9c5 [subset] Add one ttf file with fvar/STAT tables to integration test
Ignore gvar/MVAR/HVAR table
add support for --nameIDs=* option
2019-05-22 17:20:45 -07:00