summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-07-05 00:08:17 +0000
committerMatthias Clasen <mclasen@redhat.com>2019-07-05 15:48:48 -0400
commit531261e5dbcb39abb46eb4113a4bd33ba63d171f (patch)
tree868ef0341e53834ea4fa55d163cfd0baa09f9170
parent59e2b1aecfd38e0ca20cfe3e0356346f629e158f (diff)
downloadpango-531261e5dbcb39abb46eb4113a4bd33ba63d171f.tar.gz
pango-view: Add a --line-spacing option
Add a way to try pango_layout_set_line_spacing().
-rw-r--r--utils/viewer-render.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/utils/viewer-render.c b/utils/viewer-render.c
index 51ba00fb..5a556cd8 100644
--- a/utils/viewer-render.c
+++ b/utils/viewer-render.c
@@ -52,6 +52,7 @@ int opt_width = -1;
int opt_height = -1;
int opt_indent = 0;
int opt_spacing = 0;
+double opt_line_spacing = 0.0;
gboolean opt_justify = 0;
int opt_runs = 1;
PangoAlignment opt_align = PANGO_ALIGN_LEFT;
@@ -126,6 +127,9 @@ make_layout(PangoContext *context,
if (opt_spacing != 0)
pango_layout_set_spacing (layout, (opt_spacing * opt_dpi * PANGO_SCALE + 36) / 72);
+ if (opt_line_spacing != 0.0)
+ pango_layout_set_line_spacing (layout, (float)opt_line_spacing);
+
align = opt_align;
if (align != PANGO_ALIGN_CENTER &&
pango_context_get_base_dir (context) != PANGO_DIRECTION_LTR) {
@@ -710,6 +714,8 @@ parse_options (int argc, char *argv[])
"Width in points to indent paragraphs", "points"},
{"spacing", 0, 0, G_OPTION_ARG_INT, &opt_spacing,
"Spacing in points between lines", "points"},
+ {"line-spacing", 0, 0, G_OPTION_ARG_DOUBLE, &opt_line_spacing,
+ "Spread factor for line height", "factor"},
{"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,