summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-07-16 15:02:13 -0400
committerMatthias Clasen <mclasen@redhat.com>2019-07-16 15:03:11 -0400
commit9459852f3c89f909f4bb22a11cde5db3328abaca (patch)
treed8ea13296cac88af3d0e4e1a8eeae431f08035a3 /utils
parent54a26115da1d11657a502d09995bfe8344d5a9b8 (diff)
downloadpango-9459852f3c89f909f4bb22a11cde5db3328abaca.tar.gz
pango-view: Make it possible to turn line-spacing off
Diffstat (limited to 'utils')
-rw-r--r--utils/viewer-render.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/utils/viewer-render.c b/utils/viewer-render.c
index 5a556cd8..8fd6cfaf 100644
--- a/utils/viewer-render.c
+++ b/utils/viewer-render.c
@@ -52,7 +52,7 @@ int opt_width = -1;
int opt_height = -1;
int opt_indent = 0;
int opt_spacing = 0;
-double opt_line_spacing = 0.0;
+double opt_line_spacing = -1.0;
gboolean opt_justify = 0;
int opt_runs = 1;
PangoAlignment opt_align = PANGO_ALIGN_LEFT;
@@ -125,9 +125,11 @@ make_layout(PangoContext *context,
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);
-
- if (opt_line_spacing != 0.0)
+ {
+ pango_layout_set_spacing (layout, (opt_spacing * opt_dpi * PANGO_SCALE + 36) / 72);
+ pango_layout_set_line_spacing (layout, 0.0);
+ }
+ if (opt_line_spacing >= 0.0)
pango_layout_set_line_spacing (layout, (float)opt_line_spacing);
align = opt_align;