[pango/pango2: 89/301] pango-view: Bring line spacing back
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/pango2: 89/301] pango-view: Bring line spacing back
- Date: Wed, 22 Jun 2022 15:53:35 +0000 (UTC)
commit 8974d49c2ad854554dcfcbea6b566f306f03d74a
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Jan 24 07:49:18 2022 -0500
pango-view: Bring line spacing back
utils/viewer-render.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
---
diff --git a/utils/viewer-render.c b/utils/viewer-render.c
index c162f28a8..86fb0bc5e 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);
@@ -894,6 +904,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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]