diff options
author | Matthias Clasen <mclasen@redhat.com> | 2022-01-24 07:49:18 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2022-01-25 15:29:16 -0500 |
commit | 84bcdfd9cab1d1cdd36b0d0b96654ec5aaef3b8a (patch) | |
tree | 0e05c5b61c733c6a1206ca3289164338c31ed07b | |
parent | 288a537e5178eafa8193c69b6298c3592bdd4296 (diff) | |
download | pango-84bcdfd9cab1d1cdd36b0d0b96654ec5aaef3b8a.tar.gz |
pango-view: Bring line spacing back
-rw-r--r-- | utils/viewer-render.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/utils/viewer-render.c b/utils/viewer-render.c index d75a886a..4c84d9b3 100644 --- a/utils/viewer-render.c +++ b/utils/viewer-render.c @@ -52,6 +52,7 @@ gboolean opt_waterfall = FALSE; int opt_width = -1; int opt_height = -1; int opt_indent = 0; +int opt_spacing = 0; double opt_line_spacing = -1.0; int opt_runs = 1; PangoAlignment opt_align = PANGO_ALIGN_LEFT; @@ -161,6 +162,15 @@ make_layout(PangoContext *context, pango_layout_set_indent (layout, (opt_indent * opt_dpi * PANGO_SCALE + 36) / 72); } + if (opt_spacing != 0) + { + if (opt_pango_units) + pango_layout_set_spacing (layout, opt_spacing); + else + pango_layout_set_spacing (layout, (opt_spacing * opt_dpi * PANGO_SCALE + 36) / 72); + pango_layout_set_line_height (layout, 0.0); + } + if (opt_line_spacing >= 0.0) pango_layout_set_line_height (layout, (float)opt_line_spacing); @@ -848,6 +858,8 @@ parse_options (int argc, char *argv[]) "Subpixel order", "rgb/bgr/vrgb/vbgr"}, {"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"}, {"line-spacing", 0, 0, G_OPTION_ARG_DOUBLE, &opt_line_spacing, "Spread factor for line height", "factor"}, {"language", 0, 0, G_OPTION_ARG_STRING, &opt_language, |