From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] printing via local attached printer with gs driver From: "Russ Cox" Date: Mon, 18 Jun 2007 14:00:30 -0400 In-Reply-To: <82c890d00706181054s3ba18e59tdc4127bc232e7358@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20070618180031.7874F1E8C4D@holo.morphisms.net> Topicbox-Message-UUID: 8018f17c-ead2-11e9-9d60-3106f5b1d025 Did you compile your own copy of ghostscript? This is a common problem if you compile directly from the gs sources; there are some Plan 9 specific changes that must be made. See /sys/src/cmd/gs/mkfile: # If you get weird floating point errors, the culprit is usually the # halftone code, which converts double to uint, something 8c handles # incorrectly (treats as double to int). Look in src/gshtscr.c for a line like # # sample = (ht_sample_t)((value+1) * max_ht_sample); # # and change it to one of: # # sample = (int)(vlong)((value+1) * max_ht_sample); # sample = (ht_sample_t)(value * max_ht_sample) + max_ht_sample; # # depending on your preference. # # Also, recent versions of src/gxshade1.c cause the compiler to run out # of registers. Brucee is looking into this. In the meantime, use this # replacement: # # private inline void # make_other_poles(patch_curve_t curve[4]) # { # int i, j; # # for (i = 0; i < 4; i++) { # j = (i + 1) % 4; # curve[i].control[0].x = (curve[i].vertex.p.x * 2 + curve[j].vertex.p.x); # curve[i].control[0].x /= 3; # curve[i].control[0].y = (curve[i].vertex.p.y * 2 + curve[j].vertex.p.y); # curve[i].control[0].y /= 3; # curve[i].control[1].x = (curve[i].vertex.p.x + curve[j].vertex.p.x * 2); # curve[i].control[1].y /= 3; # curve[i].control[1].y = (curve[i].vertex.p.y + curve[j].vertex.p.y * 2); # curve[i].control[1].y /= 3; # curve[i].straight = true; # } # } # # (the original includes the /3 in the big expressions). The source in the distribution should be patched already. Also I thought I fixed 8c to do the right float -> uint conversion, but it would have been quite a while ago and I don't remember. Russ