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

[orca-dev:00589] Re: Monpe 0.6.2 の印刷速度



島谷@恵庭です.

ちょっと実験をしてみました.
RKSJ-H だったら,全角も半角も両方
印刷できますね.
(プリンタによって違うかも...)

> 
> diffをここに書いてもらえると喜びます。
> 

はーーい.(長い行が改行されてしまいました...)

--- monpe-0.6.2/app/render_eps.c	Wed Nov 19 14:26:47 2003
+++ render_eps.c	Tue Jun  8 15:51:15 2004
@@ -524,8 +524,8 @@
 	  "/gs {gsave} bind def\n"
 	  "/sa {save} bind def\n"
 	  "/rs {restore} bind def\n"
-	  "/l {lineto} bind def\n"
-	  "/m {moveto} bind def\n"
+	  "/l {%f exch sub lineto} bind def\n"
+	  "/m {%f exch sub moveto} bind def\n"
 	  "/rm {rmoveto} bind def\n"
 	  "/n {newpath} bind def\n"
 	  "/s {stroke} bind def\n"
@@ -554,7 +554,7 @@
           "   /y exch def\n"
           "   /x exch def"
 	  "   /savematrix mtrx currentmatrix def\n"
-          "   x y tr xrad yrad sc\n"
+          "   x y %f exch sub tr xrad yrad sc\n"
           "   0 0 1 startangle endangle arc\n"
           "   savematrix setmatrix\n"
           "   end\n"
@@ -606,7 +606,7 @@
 	    "} bind def\n\n"
 	  */
 	
-	  "%%%%EndProlog\n\n\n");
+	  "%%%%EndProlog\n\n\n", dia->data->paper.height,
dia->data->paper.height, dia->data->paper.height );

   return renderer;
 }
@@ -991,6 +991,8 @@
   fprintf(renderer->file, " f\n");
 }

+Color last_color;
+
 #ifdef JAPANESE
 void
 local_draw_string(RendererEPS *renderer,
@@ -1012,10 +1014,15 @@
   int len;

   /* TODO: Use latin-1 encoding */
-
-  fprintf(renderer->file, "%f %f %f srgb\n",
-	  (double) color->red, (double) color->green, (double) color->blue);

+  if ( ( color->red   != last_color.red )   ||
+       ( color->green != last_color.green ) ||
+       ( color->blue  != last_color.blue ) )
+  {
+    last_color = *color;
+    fprintf(renderer->file, "%f %f %f srgb\n",
+	  (double) color->red, (double) color->green, (double) color->blue);
+  }

   /* Escape all '(' and ')':  */
   buffer = g_malloc(2*strlen(text)+1);
@@ -1048,12 +1055,14 @@
     break;
   }

-  fprintf(renderer->file, " gs 1 -1 sc sh gr\n");
+  fprintf(renderer->file, " sh\n");
 }

 #ifdef JAPANESE

 extern int dia_no_x_display;
+char last_fontname[256];
+real last_font_height;

 static void
 draw_string(RendererEPS *renderer,
@@ -1140,12 +1149,23 @@
       if (text[i-1] > 0) {
  	/* printing ASCII chars */
 	is_single = TRUE;
-	fprintf(renderer->file, "/%s-latin1 ff %f scf sf\n",
font_get_psfontname(renderer->font)[0], (double)renderer->font_height);
-      } else {
- 	/* printging 16bits chars */
+	if ( strcmp( font_get_psfontname(renderer->font)[0], last_fontname )  ||
+          renderer->font_height != last_font_height ) {
+          strcpy( last_fontname,  font_get_psfontname(renderer->font)[0] );
+          last_font_height = renderer->font_height;
+	  fprintf(renderer->file, "/%s-latin1 ff %f scf sf\n",
font_get_psfontname(renderer->font)[0], (double)renderer->font_height);
+        }
+      } else {
+ 	/* printging 16bits chars */
 	is_single = FALSE;
-	fprintf(renderer->file, "/%s-EUC-H ff %f scf sf\n",
font_get_psfontname(renderer->font)[1], (double)renderer->font_height);
-      }
+        if ( strcmp( font_get_psfontname(renderer->font)[1],
last_fontname ) ||
+          renderer->font_height != last_font_height ) {
+          strcpy( last_fontname,
font_get_psfontname(renderer->font)[1] );
+          last_font_height = renderer->font_height;
+	  fprintf(renderer->file, "/%s-EUC-H ff %f scf sf\n",
font_get_psfontname(renderer->font)[1], (double)renderer->font_height);
+        }
+      }
+
       buff[s] = '\0';
       local_draw_string(renderer,
 			buff,
@@ -1169,11 +1189,21 @@
     }
   }
   if (text[i-1] > 0) {
-    /* printing ASCII chars */
-    fprintf(renderer->file, "/%s-latin1 ff %f scf sf\n",
font_get_psfontname(renderer->font)[0], (double)renderer->font_height);
+    /* printing ASCII chars */
+    if ( strcmp( font_get_psfontname(renderer->font)[0], last_fontname ) ||
+         renderer->font_height != last_font_height ) {
+      strcpy( last_fontname,  font_get_psfontname(renderer->font)[0] );
+      last_font_height = renderer->font_height;
+      fprintf(renderer->file, "/%s-latin1 ff %f scf sf\n",
font_get_psfontname(renderer->font)[0], (double)renderer->font_height);
+    }
   } else {
-    /* printging 16bits chars */
-    fprintf(renderer->file, "/%s-EUC-H ff %f scf sf\n",
font_get_psfontname(renderer->font)[1], (double)renderer->font_height);
+    /* printging 16bits chars */
+    if ( strcmp( font_get_psfontname(renderer->font)[1], last_fontname ) ||
+         renderer->font_height != last_font_height ) {
+      strcpy( last_fontname,  font_get_psfontname(renderer->font)[1] );
+      last_font_height = renderer->font_height;
+      fprintf(renderer->file, "/%s-EUC-H ff %f scf sf\n",
font_get_psfontname(renderer->font)[1], (double)renderer->font_height);
+    }
   }
   buff[s] = '\0';
   local_draw_string(renderer,

--- monpe-0.6.2/app/paginate_psprint.c	Wed Nov 19 14:26:46 2003
+++ paginate_psprint.c	Tue Jun  8 15:36:53 2004
@@ -92,14 +92,18 @@

   /* transform coordinate system */
   if (data->paper.is_portrait) {
-    fprintf(rend->file, "%f %f scale\n", 28.346457*scale,
-28.346457*scale);
+    fprintf(rend->file, "%f %f scale\n", 28.346457*scale, 28.346457*scale);
+  /*
     fprintf(rend->file, "%f %f translate\n", lmargin/scale - bounds->left,
 	    -bmargin/scale - bounds->bottom);
+  */
   } else {
     fprintf(rend->file, "90 rotate\n");
-    fprintf(rend->file, "%f %f scale\n", 28.346457*scale,
-28.346457*scale);
+    fprintf(rend->file, "%f %f scale\n", 28.346457*scale, 28.346457*scale);
+  /*
     fprintf(rend->file, "%f %f translate\n", lmargin/scale - bounds->left,
 	    tmargin/scale - bounds->top);
+  */
   }

   /* set up clip mask */