From 8f8956a55fff95e5ad529d2f124c9528d1f4f81d Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 25 May 2012 14:30:24 -0400 Subject: [PATCH] [util] Add hidden --shaper that is equivalent of --shapers --- util/helper-cairo.cc | 2 +- util/options.cc | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/util/helper-cairo.cc b/util/helper-cairo.cc index de45fb315..77fd1a6e0 100644 --- a/util/helper-cairo.cc +++ b/util/helper-cairo.cc @@ -297,7 +297,7 @@ helper_cairo_create_context (double w, double h, unsigned int fr, fg, fb, fa, br, bg, bb, ba; - br = bg = bb = ba = 255; + br = bg = bb = 0; ba = 255; sscanf (view_opts->back + (*view_opts->back=='#'), "%2x%2x%2x%2x", &br, &bg, &bb, &ba); fr = fg = fb = 0; fa = 255; sscanf (view_opts->fore + (*view_opts->fore=='#'), "%2x%2x%2x%2x", &fr, &fg, &fb, &fa); diff --git a/util/options.cc b/util/options.cc index 363a150ee..463daee35 100644 --- a/util/options.cc +++ b/util/options.cc @@ -1,5 +1,5 @@ /* - * Copyright © 2011 Google, Inc. + * Copyright © 2011,2012 Google, Inc. * * This is part of HarfBuzz, a text shaping library. * @@ -178,6 +178,7 @@ parse_shapers (const char *name G_GNUC_UNUSED, GError **error G_GNUC_UNUSED) { shape_options_t *shape_opts = (shape_options_t *) data; + g_free (shape_opts->shapers); shape_opts->shapers = g_strsplit (arg, ",", 0); return TRUE; } @@ -330,6 +331,7 @@ parse_features (const char *name G_GNUC_UNUSED, char *p; shape_opts->num_features = 0; + g_free (shape_opts->features); shape_opts->features = NULL; if (!*s) @@ -387,6 +389,8 @@ shape_options_t::add_options (option_parser_t *parser) { {"list-shapers", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, (gpointer) &list_shapers, "List available shapers and quit", NULL}, + {"shaper", 0, G_OPTION_FLAG_HIDDEN, + G_OPTION_ARG_CALLBACK, (gpointer) &parse_shapers, "Hidden duplicate of --shapers", NULL}, {"shapers", 0, 0, G_OPTION_ARG_CALLBACK, (gpointer) &parse_shapers, "Comma-separated list of shapers to try","list"}, {"direction", 0, 0, G_OPTION_ARG_STRING, &this->direction, "Set text direction (default: auto)", "ltr/rtl/ttb/btt"}, {"language", 0, 0, G_OPTION_ARG_STRING, &this->language, "Set text language (default: $LANG)", "langstr"},