[pango/pango-view-spacing] pango-view: Add a --spacing option
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/pango-view-spacing] pango-view: Add a --spacing option
- Date: Thu, 4 Jul 2019 18:52:03 +0000 (UTC)
commit f0e00a7998590d79e04e3c466da29ff1233fab78
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Jul 4 18:51:30 2019 +0000
pango-view: Add a --spacing option
utils/viewer-render.c | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/utils/viewer-render.c b/utils/viewer-render.c
index 573cb59a..51ba00fb 100644
--- a/utils/viewer-render.c
+++ b/utils/viewer-render.c
@@ -51,6 +51,7 @@ gboolean opt_waterfall = FALSE;
int opt_width = -1;
int opt_height = -1;
int opt_indent = 0;
+int opt_spacing = 0;
gboolean opt_justify = 0;
int opt_runs = 1;
PangoAlignment opt_align = PANGO_ALIGN_LEFT;
@@ -122,6 +123,9 @@ make_layout(PangoContext *context,
if (opt_indent != 0)
pango_layout_set_indent (layout, (opt_indent * opt_dpi * PANGO_SCALE + 36) / 72);
+ if (opt_spacing != 0)
+ pango_layout_set_spacing (layout, (opt_spacing * opt_dpi * PANGO_SCALE + 36) / 72);
+
align = opt_align;
if (align != PANGO_ALIGN_CENTER &&
pango_context_get_base_dir (context) != PANGO_DIRECTION_LTR) {
@@ -704,6 +708,8 @@ parse_options (int argc, char *argv[])
"Hinting style", "none/auto/full"},
{"indent", 0, 0, G_OPTION_ARG_INT, &opt_indent,
"Width in points to indent paragraphs", "points"},
+ {"spacing", 0, 0, G_OPTION_ARG_INT, &opt_spacing,
+ "Spacing in points between lines", "points"},
{"justify", 0, 0, G_OPTION_ARG_NONE, &opt_justify,
"Align paragraph lines to be justified", NULL},
{"language", 0, 0, G_OPTION_ARG_STRING, &opt_language,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]