summaryrefslogtreecommitdiff
path: root/pango-view
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2010-01-05 13:21:35 +0100
committerBehdad Esfahbod <behdad@behdad.org>2010-01-11 17:40:47 -0500
commit2b3154b4b7cd9ad1cd532f095c10bedfccfae190 (patch)
treed14dcc7bc9a817d30930c49d9693c0c141e2742a /pango-view
parent0f0b9f963db52024f348359ce61c66bff6ce0531 (diff)
downloadpango-2b3154b4b7cd9ad1cd532f095c10bedfccfae190.tar.gz
Bug 582697 - Add pango-view --pixels option
Diffstat (limited to 'pango-view')
-rw-r--r--pango-view/viewer-render.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/pango-view/viewer-render.c b/pango-view/viewer-render.c
index c698b459..e672dcd4 100644
--- a/pango-view/viewer-render.c
+++ b/pango-view/viewer-render.c
@@ -34,6 +34,7 @@
gboolean opt_display = TRUE;
int opt_dpi = 96;
+gboolean opt_pixels = FALSE;
const char *opt_font = "";
gboolean opt_header = FALSE;
const char *opt_output = NULL;
@@ -622,7 +623,7 @@ parse_backend (const char *name G_GNUC_UNUSED,
}
-static gboolean
+static G_GNUC_NORETURN gboolean
show_version(const char *name G_GNUC_UNUSED,
const char *arg G_GNUC_UNUSED,
gpointer data G_GNUC_UNUSED,
@@ -687,6 +688,8 @@ parse_options (int argc, char *argv[])
"Save rendered image to output file", "file"},
{"pangorc", 0, 0, G_OPTION_ARG_STRING, &opt_pangorc,
"pangorc file to use (default is ./pangorc)", "file"},
+ {"pixels", 0, 0, G_OPTION_ARG_NONE, &opt_pixels,
+ "Use pixel units instead of points (sets dpi to 72)", NULL},
{"rtl", 0, 0, G_OPTION_ARG_NONE, &opt_rtl,
"Set base direction to right-to-left", NULL},
{"rotate", 0, 0, G_OPTION_ARG_DOUBLE, &opt_rotate,
@@ -736,6 +739,9 @@ parse_options (int argc, char *argv[])
g_free(backend_options);
g_free(backend_desc);
+ if (opt_pixels)
+ opt_dpi = 72;
+
if ((opt_text && argc != 1) || (!opt_text && argc != 2))
{
if (opt_text && argc != 1)