Commit Graph

58 Commits

Author SHA1 Message Date
Behdad Esfahbod c45d2a9c9d [util] Allow setting cli summary / description 2021-08-12 11:19:59 -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 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 97a9e4e41e [util] Separate shape_text_options_t from text_options_t 2021-08-11 19:28:16 -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 9468e46998 [util] Rename main_font_text back to main_font_text_t 2021-08-11 16:46:04 -06:00
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 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 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 798bb89c96 [util] Move shape format options into shape-format.hh 2021-08-06 23:30:55 -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 e014c6fa2d [util/main-font-text] Move eol from template arg to main() arg 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 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 ed99c80623 [util/hb-shape] Refactor driver type duplication 2021-08-01 08:14:59 -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
Simon Cozens a0203a28bb Use hb_buffer_serialize to trace in utils 2020-10-09 22:27:55 -06:00
Ebrahim Byagowi ba810ce83d [tests] Replace space with colon in batch mode 2020-07-06 13:53:19 +04:30
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
Ebrahim Byagowi e412008599 Remove redundant void from C++ sources (#1486) 2018-12-17 13:01:01 -05:00
Behdad Esfahbod edaa768253 [util] Use fgets instead of getline such that windows passes 2018-10-30 01:35:58 -07:00
Behdad Esfahbod 58e20f53bf [util] Add hb-shape --batch 2018-10-30 00:52:22 -07:00
Behdad Esfahbod 71fd6325b6 Add option to buffer serialization to not output glyph advances
When advances are not printed, glyph offsets reflect absolute glyph
positions.

New API:
HB_BUFFER_SERIALIZE_FLAG_NO_ADVANCES
hb-shape --no-advances
2018-01-10 02:50:49 +01:00
Behdad Esfahbod dbdbfe3d7b Use nullptr instead of NULL 2017-10-15 12:11:08 +02:00
Behdad Esfahbod a9e52a1af4 [util] Prefix trace lines with "trace:", and error lines with "error:" 2017-08-15 17:30:18 -07:00
Behdad Esfahbod d2052278f2 [util] Add --verify to hb-shape / hb-view that verifies shape results
Right now it checks for monotone cluster values.  Other checks to be added.
2017-08-11 15:12:25 -07:00
Behdad Esfahbod 40bd7e9a1c [unsafe-to-break] Add UNSAFE_TO_BREAK flag
Not all shapers code is updated to set this properly.
GSUB and Arabic shaper are updated.
GPOS and other shapers are NOT.

Fixes https://github.com/behdad/harfbuzz/issues/224
2017-08-10 15:02:28 -07:00
Behdad Esfahbod 6f38845d9c [hb-shape] Rename --show-messages to --trace
https://github.com/behdad/harfbuzz/issues/506
2017-07-19 17:20:55 -07:00
Behdad Esfahbod e60350551a [hb-shape] Improve shaping-debug output
Before, that was printed using --debug (and in both hb-shape and hb-view).
Changed it, now hb-shape has a new command-line argument called --show-messages.
When invoked, it also respects other output formatting options.  The messages
are better formatted and printed to te same place that hb-shape output is
directed to.  Previously they were written to stderr.

Fixes https://github.com/behdad/harfbuzz/issues/506
2017-07-18 19:16:09 -07:00
Philip Withnall 925ceacfed util: Add missing field initialisers in constructor (#410)
Coverity ID: 141042
2017-02-07 18:17:48 -08:00
Behdad Esfahbod fdd1770e00 Add API/cmdline to show glyph extents when serializing buffer
New API: HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS

hb-shape now accepts --show-extents.

Patch from Simon Cozens.
2015-08-24 13:49:55 +01:00
Behdad Esfahbod cd4eb96abb [util] Add --font-size to hb-shape
Also makes hb-view to use 8 bits of subpixel precision and shape at
requested size, instead of always shaping at upem and scaling results.
2015-01-20 12:45:13 -08:00
Behdad Esfahbod 0afedaa96c [util/hb-shape] Fix crash; oops 2014-07-09 17:00:48 -04:00
Behdad Esfahbod 9109f1e944 [util/hb-shape] Accept an empty output-format that would skip output
Useful for benchmarking, to avoid buffer serialization overhead (which
seems to by far dominate shaping!)
2014-07-08 20:02:29 -04:00
Behdad Esfahbod ea5e8a02eb [util] Plug minor leak 2014-03-19 15:38:02 -07:00
Behdad Esfahbod 4dc798de19 Add hb-deprecated.h, and rename a couple enum values
Add deprecated alias for old name.
2013-08-27 11:46:08 -04:00
Behdad Esfahbod 7235f33f9e Fix misc warnings reported by cppcheck
https://bugs.freedesktop.org/show_bug.cgi?id=65544
2013-06-10 15:08:49 -04:00
Behdad Esfahbod 4a765f092d Minor 2012-12-21 16:48:47 -05:00
Behdad Esfahbod 9815a88111 [util] List supported output formats in --help output 2012-12-21 16:46:53 -05:00
Behdad Esfahbod 6bad092aa8 [util] Default to "text" output format in hb-shape
If you say:

  hb-shape font.ttf text --output-file out.txt

This was previously failing:

  Unknown output format `txt'; supported formats are: TEXT / JSON

Now we simply fallback to TEXT if no explicit format was requested.
2012-12-21 16:01:52 -05:00
Behdad Esfahbod a4bef84e37 [util] Make hb-shape err if output-format is not understood
And list supported formats.
2012-11-15 13:29:51 -08:00