Commit Graph

170 Commits

Author SHA1 Message Date
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 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 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 869e20e09f [util] separate face options from font options 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 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 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
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
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
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
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
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
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 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
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 67064294a0 [subset] Add drop-tables option to hb-subset util. 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
David Corbett 45adc18526 Fix or document unsupported font-feature-settings 2019-02-25 17:48:16 -05:00
Garret Rieger 490d52f908 [subset] Add retain-gids option to hb-subset executable. 2019-01-29 13:19:21 -08:00
Ebrahim Byagowi e412008599 Remove redundant void from C++ sources (#1486) 2018-12-17 13:01:01 -05:00
Behdad Esfahbod 3f8e7a98d3 [util/hb-subset] Add --layout to keep GDEF/GSUB/GPOS
Will become default and option removed in the future.
2018-12-12 11:32:57 -05:00
Michiharu Ariza 43ee0e4d00 Merge branch 'master' into cff-subset 2018-11-06 09:57:17 -08:00
Behdad Esfahbod 9bddfde25d [util] Fix up previous commit 2018-11-06 11:03:34 -05:00
Behdad Esfahbod 3ec2e4fa7b [util] Don't terminate string after a a 0 in -u
Fixes https://github.com/harfbuzz/harfbuzz/issues/1361
2018-11-06 10:49:19 -05:00
Michiharu Ariza 6186dbf1be added hb_subset_input_set_desubroutinize API
hooked up with CFF1 subroutinizer
a renaming
2018-11-01 17:25:23 -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 83a612739a [util] Minor 2018-10-30 01:29:58 -07:00
Behdad Esfahbod 6131fb6283 [util] Don't close stdin/stdout 2018-10-30 00:52:22 -07:00
Ebrahim Byagowi eeddda3ec6
[util] Better file-not-found error from hb-shape / hb-view
fixes #1266
2018-10-18 07:38:47 +03:30
Behdad Esfahbod 1e8fdd285f Remove HAVE_OT
We never tested compiling without it.  Just kill it.  We always build
our own shaper.
2018-10-10 16:32:35 -04:00
Behdad Esfahbod e42cd58c99 Rename invisible_codepoint to invisible_glyph in API
Deleted recently added API:
    hb_buffer_set_invisible_codepoint()
    hb_buffer_get_invisible_codepoint()

    hb-shape / hb-view --invisible-codepoint

New API:
    hb_buffer_set_invisible_glyph()
    hb_buffer_get_invisible_glyph()

    hb-shape / hb-view --invisible-glyph

Fixes https://github.com/harfbuzz/harfbuzz/issues/1216
2018-10-07 20:47:30 -04:00
Behdad Esfahbod 71b65eb27d Add API for setting invisible-codepoint
Fixes https://github.com/harfbuzz/harfbuzz/issues/1216

New API:
hb_buffer_set_invisible_codepoint()
hb_buffer_get_invisible_codepoint()

hb-shape / hb-view --invisible-codepoint
2018-10-07 18:43:26 +02:00
Behdad Esfahbod 9caa432d0c [util] Use HB_FALLTHROUGH
Sure, gcc knows to warn about this as well:

../../util/options.cc:175:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
     case 1: m.r = m.t;
             ~~~~^~~~~
../../util/options.cc:176:5: note: here
     case 2: m.b = m.t;
     ^~~~

But HOLY SMOKES, look at clang -Weverything bot message:

options.cc:176:5: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
    case 2: m.b = m.t;
    ^
options.cc:176:5: note: insert 'HB_FALLTHROUGH;' to silence this warning
    case 2: m.b = m.t;
    ^
    HB_FALLTHROUGH;

Right, it's telling me to insert "HB_FALLTHROUGH;" there!!!!!!!!!
2018-09-30 06:08:11 -04:00
Behdad Esfahbod 2e728a7d86 [util] Mark var static
From clang -Weverything bot:

options.cc:39:3: warning: no previous extern declaration for non-static variable 'supported_font_funcs' [-Wmissing-variable-declarations]
2018-09-30 06:08:11 -04:00
Behdad Esfahbod 606bf57430 Revert forcing use of single-parameter static_assert()
Some clang versions define static_assert as a macro apparently, so we cannot
redefine it...

This reverts commit 94bfea0ce6.
This reverts commit 4e62627831.
2018-09-16 19:34:39 +02:00