summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2008-01-08 21:32:27 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2008-01-08 21:32:27 +0000
commitca4707911136cc7e951a83e7ae907524ab352662 (patch)
treeebbe0e6522469df2f155684f4474e1055689c34f
parentc3e8fa757a02f2a99a2ec7dc9f3281eeb0554af7 (diff)
downloadpango-ca4707911136cc7e951a83e7ae907524ab352662.tar.gz
Bug 508007 – Add option for single-paragraph mode to pango-view
2008-01-08 Behdad Esfahbod <behdad@gnome.org> Bug 508007 – Add option for single-paragraph mode to pango-view * pango-view/viewer-render.c (make_layout), (parse_options): Add --single-par option to pango-view. svn path=/trunk/; revision=2537
-rw-r--r--ChangeLog7
-rw-r--r--pango-view/viewer-render.c4
2 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 2b45d865..d0741bda 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2008-01-08 Behdad Esfahbod <behdad@gnome.org>
+ Bug 508007 – Add option for single-paragraph mode to pango-view
+
+ * pango-view/viewer-render.c (make_layout), (parse_options): Add
+ --single-par option to pango-view.
+
+2008-01-08 Behdad Esfahbod <behdad@gnome.org>
+
* pango/pango-layout.c (ensure_tab_width), (process_line),
(pango_layout_get_effective_attributes),
(pango_layout_check_lines): Minor cleanup. Attributes are initialized
diff --git a/pango-view/viewer-render.c b/pango-view/viewer-render.c
index 1c29c4e6..bc98da85 100644
--- a/pango-view/viewer-render.c
+++ b/pango-view/viewer-render.c
@@ -66,6 +66,7 @@ gboolean opt_wrap_set = FALSE;
const char *opt_pangorc = NULL;
const PangoViewer *opt_viewer = NULL;
const char *opt_language = NULL;
+gboolean opt_single_par = FALSE;
/* Text (or markup) to render */
static char *text;
@@ -115,6 +116,7 @@ make_layout(PangoContext *context,
pango_layout_set_auto_dir (layout, opt_auto_dir);
pango_layout_set_ellipsize (layout, opt_ellipsize);
pango_layout_set_justify (layout, opt_justify);
+ pango_layout_set_single_paragraph_mode (layout, opt_single_par);
font_description = get_font_description ();
if (size > 0)
@@ -612,6 +614,8 @@ parse_options (int argc, char *argv[])
"Angle at which to rotate results", "degrees"},
{"runs", 'n', 0, G_OPTION_ARG_INT, &opt_runs,
"Run Pango layout engine this many times", "integer"},
+ {"single-par", 0, 0, G_OPTION_ARG_NONE, &opt_single_par,
+ "Enable single-paragraph mode", NULL},
{"text", 't', 0, G_OPTION_ARG_STRING, &opt_text,
"Text to display (instead of a file)", "string"},
{"version", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, &show_version,