From 4d73b3d9b1575b9b71ba21886cc130f8bb7591ee Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 12 Aug 2021 10:39:46 -0600 Subject: [PATCH] [util] Add --batch to hb-view / hb-ot-shape-closure --- util/batch.hh | 2 ++ util/hb-ot-shape-closure.cc | 8 +++++--- util/hb-shape.cc | 8 ++++---- util/hb-subset.cc | 6 ++---- util/hb-view.cc | 10 ++++++---- 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/util/batch.hh b/util/batch.hh index 2cbb12077..9543a0524 100644 --- a/util/batch.hh +++ b/util/batch.hh @@ -25,6 +25,8 @@ #ifndef BATCH_HH #define BATCH_HH +#include "options.hh" + typedef int (*main_func_t) (int argc, char **argv); template diff --git a/util/hb-ot-shape-closure.cc b/util/hb-ot-shape-closure.cc index 776e67017..a77fc8213 100644 --- a/util/hb-ot-shape-closure.cc +++ b/util/hb-ot-shape-closure.cc @@ -24,10 +24,11 @@ * Google Author(s): Behdad Esfahbod */ -#include "shape-options.hh" +#include "batch.hh" #include "font-options.hh" -#include "text-options.hh" #include "main-font-text.hh" +#include "shape-options.hh" +#include "text-options.hh" const unsigned DEFAULT_FONT_SIZE = FONT_SIZE_NONE; const unsigned SUBPIXEL_BITS = 0; @@ -115,5 +116,6 @@ struct shape_closure_consumer_t int main (int argc, char **argv) { - return main_font_text_t () (argc, argv); + using main_t = main_font_text_t; + return batch_main (argc, argv); } diff --git a/util/hb-shape.cc b/util/hb-shape.cc index 0e8263be2..d8922dc71 100644 --- a/util/hb-shape.cc +++ b/util/hb-shape.cc @@ -25,13 +25,13 @@ * Google Author(s): Behdad Esfahbod */ -#include "output-options.hh" +#include "batch.hh" #include "font-options.hh" -#include "text-options.hh" +#include "main-font-text.hh" +#include "output-options.hh" #include "shape-consumer.hh" #include "shape-format.hh" -#include "batch.hh" -#include "main-font-text.hh" +#include "text-options.hh" const unsigned DEFAULT_FONT_SIZE = FONT_SIZE_UPEM; const unsigned SUBPIXEL_BITS = 0; diff --git a/util/hb-subset.cc b/util/hb-subset.cc index d65ee8215..9d8d0c229 100644 --- a/util/hb-subset.cc +++ b/util/hb-subset.cc @@ -25,12 +25,10 @@ * Google Author(s): Garret Rieger, Rod Sheeter */ -#include - -#include "output-options.hh" -#include "face-options.hh" #include "batch.hh" +#include "face-options.hh" #include "main-font-text.hh" +#include "output-options.hh" #include diff --git a/util/hb-view.cc b/util/hb-view.cc index 2664c7c81..82761fbff 100644 --- a/util/hb-view.cc +++ b/util/hb-view.cc @@ -25,11 +25,12 @@ * Google Author(s): Behdad Esfahbod */ -#include "shape-consumer.hh" -#include "view-cairo.hh" +#include "batch.hh" #include "font-options.hh" -#include "text-options.hh" #include "main-font-text.hh" +#include "shape-consumer.hh" +#include "text-options.hh" +#include "view-cairo.hh" const unsigned DEFAULT_FONT_SIZE = 256; const unsigned SUBPIXEL_BITS = 6; @@ -37,5 +38,6 @@ const unsigned SUBPIXEL_BITS = 6; int main (int argc, char **argv) { - return main_font_text_t, font_options_t, shape_text_options_t> () (argc, argv); + using main_t = main_font_text_t, font_options_t, shape_text_options_t>; + return batch_main (argc, argv); }