[pango] Bug 582697 - Add pango-view --pixels option



commit 2b3154b4b7cd9ad1cd532f095c10bedfccfae190
Author: Behdad Esfahbod <behdad behdad org>
Date:   Tue Jan 5 13:21:35 2010 +0100

    Bug 582697 - Add pango-view --pixels option

 pango-view/viewer-render.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/pango-view/viewer-render.c b/pango-view/viewer-render.c
index c698b45..e672dcd 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)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]