rpms/paps/devel paps-0.6.6-font-option.patch, NONE, 1.1 paps-0.6.6-lcctype.patch, NONE, 1.1 paps-typo-font-scale.patch, NONE, 1.1 paps-0.6.6-encoding.patch, 1.1, 1.2 paps.spec, 1.14, 1.15

Akira Tagoh (tagoh) fedora-extras-commits at redhat.com
Mon Jun 19 19:43:00 UTC 2006


Author: tagoh

Update of /cvs/extras/rpms/paps/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv23748

Modified Files:
	paps-0.6.6-encoding.patch paps.spec 
Added Files:
	paps-0.6.6-font-option.patch paps-0.6.6-lcctype.patch 
	paps-typo-font-scale.patch 
Log Message:
* Tue Jun 20 2006 Akira TAGOH <tagoh at redhat.com> - 0.6.6-5
- paps-typo-font-scale.patch: backported from CVS.
- paps-0.6.6-font-option.patch: integrated --font-family and --font-scale
  options to --font.
- paps-0.6.6-lcctype.patch: follow LC_CTYPE to determine the default language.

paps-0.6.6-font-option.patch:

--- NEW FILE paps-0.6.6-font-option.patch ---
diff -ruN paps-0.6.6.orig/src/paps.1 paps-0.6.6/src/paps.1
--- paps-0.6.6.orig/src/paps.1	2006-06-20 04:09:58.000000000 +0900
+++ paps-0.6.6/src/paps.1	2006-06-20 04:12:23.000000000 +0900
@@ -34,11 +34,8 @@
 .B \-\-columns=cl
 Number of columns output. Default is 1.
 .TP
-.B \-\-font\-scale=fs
-Font scaling. Default is 12.
-.TP
-.B \-\-family=f
-Pango ft2 font family. Default is Monospace.
+.B \-\-font=desc
+Set the font description. Default is Monospace 12.
 .TP
 .B \-\-rtl
 Do rtl layout.
diff -ruN paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c
--- paps-0.6.6.orig/src/paps.c	2006-06-20 04:09:58.000000000 +0900
+++ paps-0.6.6/src/paps.c	2006-06-20 04:01:57.000000000 +0900
@@ -30,7 +30,11 @@
 #include <time.h>
 
 #define BUFSIZE 1024
-#define HEADER_FONT_SCALE 12
+#define DEFAULT_FONT_FAMILY	"Monospace"
+#define DEFAULT_FONT_SIZE	12
+#define HEADER_FONT_FAMILY	"Monospace Bold"
+#define HEADER_FONT_SCALE	12
+#define MAKE_FONT_NAME(f,s)	f " " #s
 
 typedef enum {
     PAPER_TYPE_A4 = 0,
@@ -187,15 +191,14 @@
 int main(int argc, char *argv[])
 {
   gboolean do_landscape = FALSE, do_rtl = FALSE, do_justify = FALSE, do_draw_header = FALSE;
-  int num_columns = 1, font_scale = 12;
+  int num_columns = 1;
   int top_margin = 36, bottom_margin = 36, right_margin = 36, left_margin = 36;
-  char *font_family = "Monospace", *encoding = NULL;
+  gchar *font = MAKE_FONT_NAME (DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE), *encoding = NULL;
   GOptionContext *ctxt = g_option_context_new("[text file]");
   GOptionEntry entries[] = {
     {"landscape", 0, 0, G_OPTION_ARG_NONE, &do_landscape, "Landscape output. (Default: portrait)", NULL},
     {"columns", 0, 0, G_OPTION_ARG_INT, &num_columns, "Number of columns output. (Default: 1)", "NUM"},
-    {"font-scale", 0, 0, G_OPTION_ARG_INT, &font_scale, "Font scaling. (Default: 12)", "NUM"},
-    {"family", 0, 0, G_OPTION_ARG_STRING, &font_family, "Pango FT2 font family. (Default: Monospace)", "FAMILY"},
+    {"font", 0, 0, G_OPTION_ARG_STRING, &font, "Set the font description. (Default: Monospace 12)", "DESC"},
     {"rtl", 0, 0, G_OPTION_ARG_NONE, &do_rtl, "Do rtl layout.", NULL},
     {"justify", 0, 0, G_OPTION_ARG_NONE, &do_justify, "Do justify the lines.", NULL},
     {"paper", 0, 0, G_OPTION_ARG_CALLBACK, _paps_arg_paper_cb,
@@ -210,11 +213,8 @@
     {NULL}
   };
   GError *error = NULL;
-  char *filename_in;
-  char *title;
   FILE *IN, *OUT = NULL;
   page_layout_t page_layout;
-  char *text;
   GList *paragraphs;
   GList *pango_lines;
   PangoContext *pango_context;
@@ -228,7 +228,8 @@
   int do_tumble = -1;   /* -1 means not initialized */
   int do_duplex = -1;
   gchar *paps_header = NULL;
-  gchar *header_font_desc = "Monospace Bold 12";
+  gchar *header_font_desc = MAKE_FONT_NAME (HEADER_FONT_FAMILY, HEADER_FONT_SIZE);
+  gchar *filename_in, *title, *text;
   int header_sep = 20;
   GIConv *cvh = NULL;
 
@@ -271,13 +272,12 @@
   pango_context_set_language (pango_context, pango_language_from_string ("en_US"));
   pango_context_set_base_dir (pango_context, pango_dir);
   
-  font_description = pango_font_description_new ();
-  pango_font_description_set_family (font_description, g_strdup(font_family));
-  pango_font_description_set_style (font_description, PANGO_STYLE_NORMAL);
-  pango_font_description_set_variant (font_description, PANGO_VARIANT_NORMAL);
-  pango_font_description_set_weight (font_description, PANGO_WEIGHT_NORMAL);
-  pango_font_description_set_stretch (font_description, PANGO_STRETCH_NORMAL);
-  pango_font_description_set_size (font_description, font_scale * PANGO_SCALE);
+  /* create the font description */
+  font_description = pango_font_description_from_string (font);
+  if ((pango_font_description_get_set_fields (font_description) & PANGO_FONT_MASK_FAMILY) == 0)
+    pango_font_description_set_family (font_description, DEFAULT_FONT_FAMILY);
+  if ((pango_font_description_get_set_fields (font_description) & PANGO_FONT_MASK_SIZE) == 0)
+    pango_font_description_set_size (font_description, DEFAULT_FONT_SIZE * PANGO_SCALE);
 
   pango_context_set_font_description (pango_context, font_description);
 

paps-0.6.6-lcctype.patch:

--- NEW FILE paps-0.6.6-lcctype.patch ---
diff -ruN paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c
--- paps-0.6.6.orig/src/paps.c	2006-06-20 04:17:28.000000000 +0900
+++ paps-0.6.6/src/paps.c	2006-06-20 04:24:27.000000000 +0900
@@ -28,6 +28,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <time.h>
+#include <locale.h>

 #define BUFSIZE 1024
 #define DEFAULT_FONT_FAMILY    "Monospace"
@@ -188,6 +188,26 @@
   return retval;
 }
 
+static PangoLanguage *
+get_language(void)
+{
+  PangoLanguage *retval;
+  gchar *lang = g_strdup (setlocale (LC_CTYPE, NULL));
+  gchar *p;
+
+  p = strchr (lang, '.');
+  if (p)
+    *p = 0;
+  p = strchr (lang, '@');
+  if (p)
+    *p = 0;
+
+  retval = pango_language_from_string (lang);
+  g_free (lang);
+
+  return retval;
+}
+
 int main(int argc, char *argv[])
 {
   gboolean do_landscape = FALSE, do_rtl = FALSE, do_justify = FALSE, do_draw_header = FALSE;
@@ -269,7 +289,7 @@
   pango_context = paps_get_pango_context (paps);
   
   /* Setup pango */
-  pango_context_set_language (pango_context, pango_language_from_string ("en_US"));
+  pango_context_set_language (pango_context, get_language ());
   pango_context_set_base_dir (pango_context, pango_dir);
   
   /* create the font description */

paps-typo-font-scale.patch:

--- NEW FILE paps-typo-font-scale.patch ---
Index: src/paps.c
===================================================================
RCS file: /cvsroot/paps/paps/paps/src/paps.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- src/paps.c	17 Apr 2006 07:42:08 -0000	1.4
+++ src/paps.c	25 May 2006 07:26:55 -0000	1.5
@@ -190,7 +190,7 @@
   GOptionEntry entries[] = {
     {"landscape", 0, 0, G_OPTION_ARG_NONE, &do_landscape, "Landscape output. (Default: portrait)", NULL},
     {"columns", 0, 0, G_OPTION_ARG_INT, &num_columns, "Number of columns output. (Default: 1)", "NUM"},
-    {"font_scale", 0, 0, G_OPTION_ARG_INT, &font_scale, "Font scaling. (Default: 12)", "NUM"},
+    {"font-scale", 0, 0, G_OPTION_ARG_INT, &font_scale, "Font scaling. (Default: 12)", "NUM"},
     {"family", 0, 0, G_OPTION_ARG_STRING, &font_family, "Pango FT2 font family. (Default: Monospace)", "FAMILY"},
     {"rtl", 0, 0, G_OPTION_ARG_NONE, &do_rtl, "Do rtl layout.", NULL},
     {"justify", 0, 0, G_OPTION_ARG_NONE, &do_justify, "Do justify the lines.", NULL},
Index: src/paps.1
===================================================================
RCS file: /cvsroot/paps/paps/paps/src/paps.1,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- src/paps.1	17 Apr 2006 19:21:43 -0000	1.1
+++ src/paps.1	25 May 2006 07:26:55 -0000	1.2
@@ -34,7 +34,7 @@
 .B \-\-columns=cl
 Number of columns output. Default is 1.
 .TP
-.B \-\-fontscale=fs
+.B \-\-font\-scale=fs
 Font scaling. Default is 12.
 .TP
 .B \-\-family=f

paps-0.6.6-encoding.patch:

Index: paps-0.6.6-encoding.patch
===================================================================
RCS file: /cvs/extras/rpms/paps/devel/paps-0.6.6-encoding.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- paps-0.6.6-encoding.patch	25 May 2006 07:49:13 -0000	1.1
+++ paps-0.6.6-encoding.patch	19 Jun 2006 19:43:00 -0000	1.2
@@ -7,7 +7,7 @@
  GList        *split_paragraphs_into_lines  (GList           *paragraphs);
 -static char  *read_file                    (FILE            *file);
 +static char  *read_file                    (FILE            *file,
-+                                            GIConv          *handle);
++                                            GIConv           handle);
  static GList *split_text_into_paragraphs   (PangoContext    *pango_context,
                                              page_layout_t   *page_layout,
                                              int              paint_width,
@@ -32,7 +32,7 @@
    gchar *paps_header = NULL;
    gchar *header_font_desc = "Monospace Bold 12";
    int header_sep = 20;
-+  GIConv *cvh = NULL;
++  GIConv cvh = NULL;
  
    /* Prerequisite when using glib. */
    g_type_init();
@@ -65,7 +65,7 @@
  static char *
 -read_file (FILE *file)
 +read_file (FILE   *file,
-+           GIConv *handle)
++           GIConv  handle)
  {
    GString *inbuf;
    char *text;


Index: paps.spec
===================================================================
RCS file: /cvs/extras/rpms/paps/devel/paps.spec,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- paps.spec	16 Jun 2006 05:15:11 -0000	1.14
+++ paps.spec	19 Jun 2006 19:43:00 -0000	1.15
@@ -1,6 +1,6 @@
 Name:		paps
 Version:	0.6.6
-Release:	4%{?dist}
+Release:	5%{?dist}
 
 License:	LGPL
 URL:		http://paps.sourceforge.net/
@@ -10,7 +10,10 @@
 Patch0:		paps-makefile.patch
 Patch2:		paps-0.6.3-formfeed.patch
 Patch3:		paps-0.6.6-encoding.patch
-Patch4:		paps-0.6.6-segfault.patch
+Patch4:		paps-typo-font-scale.patch
+Patch5:		paps-0.6.6-segfault.patch
+Patch6:		paps-0.6.6-font-option.patch
+Patch7:		paps-0.6.6-lcctype.patch
 
 Summary:	Plain Text to PostScript converter
 Group:		Applications/Publishing
@@ -23,7 +26,10 @@
 %patch0 -p1 -b .makefile
 %patch2 -p1 -b .formfeed
 %patch3 -p1 -b .encoding
-%patch4 -p1 -b .segfault
+%patch4 -p0 -b .typo
+%patch5 -p1 -b .segfault
+%patch6 -p1 -b .fontopt
+%patch7 -p1 -b .lcctype
 aclocal
 automake
 autoconf
@@ -51,6 +57,12 @@
 
 
 %changelog
+* Tue Jun 20 2006 Akira TAGOH <tagoh at redhat.com> - 0.6.6-5
+- paps-typo-font-scale.patch: backported from CVS.
+- paps-0.6.6-font-option.patch: integrated --font-family and --font-scale
+  options to --font.
+- paps-0.6.6-lcctype.patch: follow LC_CTYPE to determine the default language.
+
 * Fri Jun 16 2006 Akira TAGOH <tagoh at redhat.com> - 0.6.6-4
 - added libtool and doxygen to BuildReq.
 - removed NEWS file which is empty.




More information about the fedora-extras-commits mailing list