[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
(mgp-users 00201) Re: printable copies of slides
- To: mgp-users@mew.org
- Subject: (mgp-users 00201) Re: printable copies of slides
- From: nishida@wide.ad.jp
- Date: Tue, 19 Oct 1999 00:56:08 +0900
- In-reply-to: Your message of "Mon, 18 Oct 1999 12:28:09 +0900" <>
- Posted: Tue, 19 Oct 1999 00:56:06 +0900
- References: <>
- Reply-to: mgp-users@mew.org
- Sender: Yoshifumi Nishida <nishida@sfc.wide.ad.jp>
>>>>> On Mon, 18 Oct 1999 12:28:09 +0900, Alan Robertson <alanr@bell-labs.com> said:
>> Please fix this in the next release. This fix works fine for me.
Hmm, I don't think this patch is correct.
Could you please try my patch attached to this mail?
I think you can apply this patch to mgp-1.06a and current snapshot.
If this seems to be better, I'll merge this in the next release.
>> I am still having trouble with graphics being printed correctly.
>> Whom should I send the source files to?
Please send to the developers-list: mgp@mew.org.
--
Yoshifumi Nishida
nishida@wide.ad.jp
*** print.c.orig Mon Oct 18 18:50:23 1999
--- print.c Mon Oct 18 19:17:47 1999
***************
*** 448,453 ****
--- 448,459 ----
fprintf(fp, "/XBODY WIDTH XMARGIN 2 mul sub def\n");
fprintf(fp, "/vertgap %d def /horizgap %d def\n", vert_gap[0], horiz_gap[0]);
+ fprintf(fp, "/resety {/ymin 0 def /ymax 0 def} def\n");
+ fprintf(fp, "/setymax {dup ymax gt {dup /ymax exch def} if pop} def\n");
+ fprintf(fp, "/setymin {dup ymin lt {dup /ymin exch def} if pop} def\n");
+ fprintf(fp, "/calcy {false charpath flattenpath pathbbox setymax pop setymin pop} def\n");
+ fprintf(fp, "resety\n");
+
/* define writebox */
fprintf(fp, "/writebox {\n");
fprintf(fp, " XMARGIN YMARGIN -1 mul moveto "
***************
*** 467,474 ****
/* ypos = ypos - (charsize * (1 + vert_gap / 100)) */
fprintf(fp, "/NL {\n");
fprintf(fp, " charsize imgsize gt\n");
! fprintf(fp, " { vertgap 100 div 1 add charsize mul }\n");
! fprintf(fp, " { vertgap 100 div charsize mul imgsize add }\n");
fprintf(fp, " ifelse\n");
fprintf(fp, " ypos exch sub /ypos exch def\n");
fprintf(fp, "} bind def\n");
--- 473,482 ----
/* ypos = ypos - (charsize * (1 + vert_gap / 100)) */
fprintf(fp, "/NL {\n");
fprintf(fp, " charsize imgsize gt\n");
! fprintf(fp, " ymax ymin sub /csize exch def\n");
! fprintf(fp, " csize 0 eq {/csize charsize def} if\n");
! fprintf(fp, " { vertgap 100 div 1 add csize mul }\n");
! fprintf(fp, " { vertgap 100 div csize mul imgsize add }\n");
fprintf(fp, " ifelse\n");
fprintf(fp, " ypos exch sub /ypos exch def\n");
fprintf(fp, "} bind def\n");
***************
*** 794,799 ****
--- 802,808 ----
*/
fprintf(fp, "initcharsize\n");
fprintf(fp, "0 %% sentinel for text width computation\n");
+ fprintf(fp, "gsave newpath 0 0 moveto resety\n");
for (i = ntextpool - 1; 0 <= i; i--) {
if (!textpool[i].text) {
***************
*** 803,814 ****
--- 812,831 ----
#if 0
loadfont(textpool[i].font, textpool[i].charset);
#endif
+
+ fprintf(fp, "%d setcharsize %d %s %s calcy\n",
+ textpool[i].size, textpool[i].size,
+ fontstring(textpool[i].font),
+ textpool[i].text);
+
fprintf(fp, "%d setcharsize %d %s %s "
"1 copy stringwidth pop 3 2 roll add\n",
textpool[i].size, textpool[i].size,
fontstring(textpool[i].font),
textpool[i].text);
}
+ fprintf(fp, "grestore\n");
+
if (mgp_flag & FL_VERBOSE) {
fprintf(fp, "%% stack should have: str3 str2 str1 width\n");
fprintf(fp, "%% alignment: %s\n", alignstr);
***************
*** 829,835 ****
fprintf(fp, "/totlen exch def\n");
fprintf(fp, "/inmargin true def /fillzero XMARGIN def\n");
fprintf(fp, "%sdefxpos ", alignstr);
! fprintf(fp, "xpos ypos charsize sub moveto\n");
for (i = 0; i < ntextpool; i++) {
if (textpool[i].text) {
--- 846,852 ----
fprintf(fp, "/totlen exch def\n");
fprintf(fp, "/inmargin true def /fillzero XMARGIN def\n");
fprintf(fp, "%sdefxpos ", alignstr);
! fprintf(fp, "xpos ypos ymax sub moveto\n");
for (i = 0; i < ntextpool; i++) {
if (textpool[i].text) {