2008-01-10 14:19:25 +00:00
|
|
|
diff -pruN paps-0.6.8.orig/src/libpaps.c paps-0.6.8/src/libpaps.c
|
2008-05-16 02:43:31 +00:00
|
|
|
--- paps-0.6.8.orig/src/libpaps.c 2008-05-14 23:07:14.000000000 +0900
|
|
|
|
+++ paps-0.6.8/src/libpaps.c 2008-05-14 23:11:12.000000000 +0900
|
2008-01-10 14:19:25 +00:00
|
|
|
@@ -118,7 +118,6 @@ gchar *paps_get_postscript_header_strdup
|
|
|
|
gchar *ret_str;
|
|
|
|
g_string_append_printf(paps->header,
|
|
|
|
"end end\n"
|
|
|
|
- "%%%%EndPrologue\n"
|
|
|
|
);
|
|
|
|
ret_str = g_strdup(paps->header->str);
|
|
|
|
g_string_truncate(paps->header, old_len);
|
|
|
|
@@ -247,7 +246,6 @@ static void
|
|
|
|
add_postscript_prologue(paps_private_t *paps)
|
|
|
|
{
|
|
|
|
g_string_append_printf(paps->header,
|
|
|
|
- "%%%%BeginProlog\n"
|
|
|
|
"/papsdict 1 dict def\n"
|
|
|
|
"papsdict begin\n"
|
|
|
|
"\n"
|
|
|
|
@@ -272,10 +270,10 @@ add_postscript_prologue(paps_private_t *
|
|
|
|
"/start_ol { gsave } bind def\n"
|
|
|
|
"/end_ol { closepath fill grestore } bind def\n"
|
|
|
|
/* Specify both x and y. */
|
|
|
|
- "/draw_char { fontdict begin gsave %f dup scale last_x last_y translate load exec end grestore} def\n"
|
|
|
|
- "/goto_xy { fontdict begin /last_y exch def /last_x exch def end } def\n"
|
|
|
|
- "/goto_x { fontdict begin /last_x exch def end } def\n"
|
|
|
|
- "/fwd_x { fontdict begin /last_x exch last_x add def end } def\n"
|
|
|
|
+ "/draw_char { fontdict begin gsave %f dup scale last_x cvi last_y cvi translate load exec end grestore} def\n"
|
2008-01-23 02:15:05 +00:00
|
|
|
+ "/goto_xy { fontdict begin /last_y exch string_y cvs def /last_x exch string_x cvs def end } def\n"
|
|
|
|
+ "/goto_x { fontdict begin /last_x exch string_x cvs def end } def\n"
|
|
|
|
+ "/fwd_x { fontdict begin /last_x exch last_x cvi add string_x cvs def end } def\n"
|
2008-01-10 14:19:25 +00:00
|
|
|
"/c /curveto load def\n"
|
|
|
|
"/x /conicto load def\n"
|
|
|
|
"/l /lineto load def\n"
|
|
|
|
@@ -344,7 +342,7 @@ add_postscript_prologue(paps_private_t *
|
|
|
|
|
|
|
|
/* Open up dictionaries */
|
|
|
|
g_string_append(paps->header,
|
|
|
|
- "/fontdict 1 dict def\n"
|
2008-01-23 02:15:05 +00:00
|
|
|
+ "/fontdict 1 dict dup begin 16 string dup /string_x exch def /last_x exch def 16 string dup /string_y exch def /last_y exch def end def\n"
|
2008-01-10 14:19:25 +00:00
|
|
|
"papsdict begin fontdict begin\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
diff -pruN paps-0.6.8.orig/src/paps.c paps-0.6.8/src/paps.c
|
2008-05-16 02:43:31 +00:00
|
|
|
--- paps-0.6.8.orig/src/paps.c 2008-05-14 23:07:14.000000000 +0900
|
|
|
|
+++ paps-0.6.8/src/paps.c 2008-05-14 23:12:53.000000000 +0900
|
|
|
|
@@ -659,7 +659,7 @@ int main(int argc, char *argv[])
|
2008-01-10 14:19:25 +00:00
|
|
|
fprintf(OUT, "%s", paps_header);
|
|
|
|
g_free(paps_header);
|
|
|
|
|
|
|
|
- fprintf(OUT, "%%%%EndPrologue\n");
|
|
|
|
+ fprintf(OUT, "%%%%EndSetup\n");
|
|
|
|
fprintf(OUT, "%s", ps_pages_string->str);
|
|
|
|
print_postscript_trailer(OUT, num_pages);
|
|
|
|
|
2008-05-16 02:43:31 +00:00
|
|
|
@@ -1089,8 +1089,9 @@ void print_postscript_header(FILE *OUT,
|
2008-01-10 14:19:25 +00:00
|
|
|
"%%%%Creator: paps version 0.6.7 by Dov Grobgeld\n"
|
|
|
|
"%%%%Pages: (atend)\n"
|
|
|
|
"%%%%BoundingBox: 0 0 %d %d\n%s"
|
|
|
|
- "%%%%BeginProlog\n"
|
|
|
|
"%%%%Orientation: %s\n"
|
|
|
|
+ "%%%%EndComments\n"
|
|
|
|
+ "%%%%BeginProlog\n"
|
|
|
|
"/papsdict 1 dict def\n"
|
|
|
|
"papsdict begin\n"
|
|
|
|
"\n"
|
2008-05-16 02:43:31 +00:00
|
|
|
@@ -1134,7 +1135,8 @@ void print_postscript_header(FILE *OUT,
|
2008-01-10 14:19:25 +00:00
|
|
|
"/turnpage {\n"
|
|
|
|
" 90 rotate\n"
|
|
|
|
" 0 pageheight neg translate\n"
|
|
|
|
- "} def\n",
|
|
|
|
+ "} def\n"
|
|
|
|
+ "%%%%EndProlog\n",
|
2008-05-16 02:43:31 +00:00
|
|
|
/*
|
|
|
|
* Put %%cupsRotation tag to prevent the rotation in pstops.
|
|
|
|
* This breaks paps's behavior to make it in landscape say.
|
|
|
|
@@ -1150,6 +1152,7 @@ void print_postscript_header(FILE *OUT,
|
2008-01-10 14:19:25 +00:00
|
|
|
g_free(owner);
|
|
|
|
|
|
|
|
fprintf(OUT,
|
|
|
|
+ "%%%%BeginSetup\n"
|
|
|
|
"%% User settings\n"
|
|
|
|
"/pagewidth %d def\n"
|
|
|
|
"/pageheight %d def\n"
|
2008-05-16 02:43:31 +00:00
|
|
|
@@ -1232,8 +1235,8 @@ void print_postscript_trailer(FILE *OUT,
|
2008-01-15 02:16:55 +00:00
|
|
|
int num_pages)
|
|
|
|
{
|
|
|
|
fprintf(OUT,
|
|
|
|
- "%%%%Pages: %d\n"
|
|
|
|
"%%%%Trailer\n"
|
|
|
|
+ "%%%%Pages: %d\n"
|
|
|
|
"%%%%EOF\n",
|
|
|
|
num_pages
|
|
|
|
);
|