[pango] pango-view: Make it possible to turn line-spacing off
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango] pango-view: Make it possible to turn line-spacing off
- Date: Tue, 16 Jul 2019 19:04:38 +0000 (UTC)
commit 9459852f3c89f909f4bb22a11cde5db3328abaca
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Jul 16 15:02:13 2019 -0400
pango-view: Make it possible to turn line-spacing off
utils/viewer-render.c | 10 ++++++----
1 file 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]