🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fj.lang.postscript
Article #164

Re: Ghostscript driver for L-880S

#164
From: Yoshihiro Ohmi
Date: Thu, 09 Jul 1992 08:03
189 lines
7586 bytes
$@Bg8+!wK-665;2JBg$G$9!#(J
Followup-to $@$r(J fj.lang.postscript $@$K$7$^$7$?$N$GCm0U$7$F2<$5$$!#(J
$@$^$?!"(Jfj.sources.d $@$K$b%/%m%9%]%9%H$7$F$*$-$^$9!#(J

In article <KEIBUN.92JUL9092323@kek.ac.jp> keibun@kek.ac.jp (HIROFUMI FUJII (KEK ON-LINE)) writes:
 >$@F#0f!w#K#E#K$G$9(J
 >
 >$@$"$j$,$H$&$4$6$$$^$9!#AaB.MxMQ$5$;$F$$$?$@$-$^$7$?!#$?$@!"2f!9$N$H$3$m(J
 >$@$O(J L-880S $@$@$1$G$O$J$/(J$@$F!"$=$N0l$DA0$N%b%G%k$G$"$k(J L-880  $@$b$"$C$F!";D(J
 >$@G0$J$3$H$K!"$=$A$i$G$O=P$^$;$s(J

$@AaB.$G$9$,!"%i%9%?(J$@%G!<%?$r(J10$@?JI=8=$G$b=P$;$k$h$&$KD>$7$^$7$?!#(J

 >>$@$=$NBe$o$j!"CY$$$G$9!#(J(^_^;)
 >
 >$@$D$$$G$K5$IU$$$?E@(J$@$O!"%W%m%0%i%`$G$O#1%i%9%?9T$,A4It%V%i%s%/$N>l9g$O(J
 >$@%A%'%C%/$7$F$$$^$9$,!"1&C<$N%V%i%s%/$r@Z$jMn$H$9(J$@$3$H$r$7$F$$$^$;$s$M!#(J

$@K:$l$F$$$^$7$?!#(J (^_^;) $@$H$$$&$h$j!":G=i$K$&$^$/=P$k$h$&$K$J$C$F$+$i(J
$@!V$b$&$$(J$@$$$d!W$H$$$&46$8$G!"2~NI$9$k$N$rBU$C$F$$$^$7$?!#(J

 >$@$^$?!"$b$&>/$7$_$_$C$A$$@aLs$H$7$F!"%V%i%s%/9T$K(J
 >$@BP$7$F(J 319,; $@$H$$$&%3!<%I$,$G$^$9$,!"$3$l$b(J 1,; $@$K$9$l$P#19T$"$?$j(J
 >$@#2%P%$%H8:$j$^$9!#(J

$@$O$$!#$3$l(J$@$bD>$7$^$7$?!#(J

$@$H$$$&$o$1$G!"2~NIHG(J ver1.1 $@$r%]%9%H$7$^$9!#(J($@:G=i$NHG$r(J ver1.0 $@$H$7$^$9(J)

-------------------------------------------------------------------------
	gdevkcr.c  -  Kyocera laser printer $@MQ(J$@%G%P%$%9%I%i%$%P(J

$@!{%$%s%9%H!<%kJ}K!(J

1. gdevkcr.c $@$r(J gs241 $@$N%=!<%9%W%m%0%i%`$,$"$k%G%#%l%/%H%j$K%3%T(J$@!<$7$F(J
   $@2<$5$$!#(J

2. Makefile $@$N(J DEVICE_DEVS $@$K(J kcr.dev l880.dev l880s.dev l980.dev $@$r2C(J
   $@$($F2<$5(J$@$$!#(J($@I,MW$G$J$$$b$N$O2C$($J$/$F$b7k9=$G$9(J)

$@Nc(J: DEVICE_DEVS=x11.dev kcr.dev l880s.dev

   $@$5$i$K!"(JMakefile$@$K(Jgdevkcr.mak$@$rDI2C$7$F2<$5$$!#(J

3. make $@%3%^%s%I$G(J gs $@$r%3%s%Q%$%k$7!"%$%s%9%H!<%k$7$F2<$5$$!#(J

$@!{;H$$J}(J

* $@%G%P%$%9$NA*Br$O(J -sDEVICE $@%*%W%7%g%s$K$h$C$F9T$J$$$^$9!#(J

    $@Nc(J) gs -sDEVICE=l880

$@%G%P(J$@%$%9$K$O!"0J2<$N$b$N$,$"$j$^$9!#(J
	kcr	- L-880S$@MQ(J
	l880	- L-880$@MQ!"%i%9%?%G!<%?$r(J10$@?JI=5-$G=PNO$9$k(J 
	l880s	- L-880S$@MQ(J
	l980	- L-980$@MQ!"$H$$$C$F$b8=:_$O(J L-880S $@$HA4$/F1$8F0:n$r$9$k!#(J

$@!z!z!z(J gdevkcr.mak $@!z!z!z(J
---- $@$3$3$+$i(J ----
### ----------------- The Kyocera Laser printer device ----------------- ###

kcr_=gdevkcr.$(OBJ) gdevprn.$(OBJ)
kcr.dev: $(kcr_)
	$(SHP)gssetdev kcr $(kcr_)
l880.dev: $(kcr_)
	$(SHP)gssetdev l880 $(kcr_)
l880s.dev: $(kcr_)
	$(SHP)gssetdev l880s $(kcr_)
l980.dev: $(kcr_)
	$(SHP)gssetdev l980 $(kcr_)

gdevkcr.$(OBJ): gdevkcr.c $(PDEVH) devs.mak
---- $@$3$3$^$G(J ----
$@$3$l$r!"(JMakefile $@$KF~$l$F2<$5$$!#(J

$@!z!z!z(J gdevkcr.c $@!z!z!z(J
---- $@$3$3$+$i(J ----
/* Copyright (C) 1989, 1990 Aladdin Enterprises.  All rights reserved.
   Distributed by Free Software Foundation, Inc.

This file is part of Ghostscript.

Ghostscript is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
to anyone for the consequences of using it or for whether it serves any
particular purpose or works at all, unless he says so in writing.  Refer
to the Ghostscript General Public License for full details.

Everyone is granted permission to copy, modify and redistribute
Ghostscript, but only under the conditions described in the Ghostscript
General Public License.  A copy of this license is supposed to have been
given to you along with Ghostscript so you can know your rights and
responsibilities.  It should be in a file named COPYING.  Among other
things, the copyright notice and this notice must be preserved on all
copies.  */

/* gdevkcr.c */
/* Kyocera laser printer driver for GhostScript ver 1.1 */
#include "gdevprn.h"

#define RES 300

#ifndef X_DPI
#  define X_DPI RES			/* pixels per inch */
#endif
#ifndef Y_DPI
#  define Y_DPI RES		        /* pixels per inch */
#endif

/* The device descriptor */
private dev_proc_print_page(kcr_print_page);
#define kcr_device(name) prn_device(prn_std_procs, name, \
	85,				/* width_10ths, 8.5" */ \
	110,				/* height_10ths, 11" */ \
        X_DPI, Y_DPI,                   /* x_dpi, y_dpi */ \
        0, 0, 0.5, 0,		        /* margins */ \
	1, kcr_print_page)

gx_device_printer gs_kcr_device = kcr_device("kcr");
gx_device_printer gs_l880_device = kcr_device("l880");
gx_device_printer gs_l880s_device = kcr_device("l880s");
gx_device_printer gs_l980_device = kcr_device("l980");

#define PRN_CLOSE gdev_prn_close
#define PRN_OUTPUT_PAGE kcr_output_page
#define DRIVER				/* see gdevprn.h */

/* Send the page to the printer. */
private int
kcr_print_page(gx_device_printer *pdev, FILE *prn_stream)
{
	int line_size = gdev_mem_bytes_per_scan_line((gx_device *)pdev);
	int in_size = (line_size + 3)*8;
	byte *in = (byte *)gs_malloc(in_size, 1, "kcr_print_page(in)");
	byte *in_p;
	int line, col, col_size;
	byte x,y,z;

	/* Set Top Margin */
	fprintf(prn_stream, "!R! UNIT C; STM 0.1; EXIT,E;\n");

	fprintf(prn_stream, "!R! STR %d;RVRD;\n", RES);

	/* Print lines of graphics */
	for ( line = 0; line < pdev->height; line++ ){

	    gdev_prn_copy_scan_lines(pdev, line, in, line_size);

	    in_p = in;

	    for (col_size = line_size-1;
		 col_size >= 0 && !(*(in_p+col_size)); col_size--);
	    col_size++;
	    if (col_size == 0){
		fprintf(prn_stream, "1,;\n");
		continue;
	    }
	    if (!strcmp(pdev->dname, "l880")){
		fprintf(prn_stream, "%d,", col_size);
		for (col = 0; col < col_size; col++, in_p++){
		    if (*in_p)
			fprintf(prn_stream, "%d", *in_p);
		    if (col < col_size-1)
			fputc(',', prn_stream);
		}
	    } else {
		fprintf(prn_stream, "%d;", col_size);
		for (col = 0; col < col_size; col+=2, in_p+=2){
		    x = *in_p >> 2;
		    y = ((*in_p & 3)<< 4) | (*(in_p+1) >> 4);
		    z = *(in_p+1) & 0x0f;
		    if (x) fputc(x < 63 ? x+64 : '/' , prn_stream);
		    if (x || y) fputc(y < 63 ? y+64 : '/' , prn_stream);
		    fputc(z+48, prn_stream);
		}
	    }
	    fprintf(prn_stream, ";\n");
	}
	/* Reinitialize the printer */
	fprintf(prn_stream, "ENDR;RES;exit;\n");

	return 0;
}
---- $@$3$3$^(J$@$G(J ----
--
OHMI IMHO OHMI  // $@K-665;=Q2J3XBg3XBg3X1!9)3X8&5f2J(J //
IMHO OHMI IMHO // $@>pJs9)3X@l96(J  $@#M#2(J   $@Bg8+(J $@2E90(J   //
E-mail: ohmi@ita.tutkie.tut.ac.jp
Technical Details
Message-ID: <OHMI.92Jul9165956@ita.tutkie.tut.ac.jp>
Path: arc1-ca.pugleaf.net!sparky!uunet!ccut!sh.wide!wnoc-kyo!kuis!kudpc!nuis!tutgw!tutkie!ohmi
References: <OHMI.92Jul3205602@ita.tutkie.tut.ac.jp> <ne7.9role@lab.ntt.jp> <OHMI.92Jul6181350@ita.tutkie.tut.ac.jp> <KEIBUN.92JUL9092323@kek.ac.jp>

Show Full Headers
Complete Article Headers
X-Google-Language: Japanese,JIS
X-Google-Thread: fa2ca,fbb1c1770aa0ec01
X-Google-Attributes: gidfa2ca,public
X-Google-Thread: 10d5fe,fbb1c1770aa0ec01
X-Google-Attributes: gid10d5fe,public
X-Google-Thread: fbb7e,f409c606ab467e29,start
X-Google-Attributes: gidfbb7e,public
X-Google-ArrivalTime: 1992-07-08 22:06:16 PST
Path: arc1-ca.pugleaf.net!sparky!uunet!ccut!sh.wide!wnoc-kyo!kuis!kudpc!nuis!tutgw!tutkie!ohmi
From: ohmi@ita.tutkie.tut.ac.jp (Yoshihiro Ohmi)
Newsgroups: fj.lang.postscript,fj.comp.printers,fj.sources.d
Subject: Re: Ghostscript driver for L-880S
Message-ID: <OHMI.92Jul9165956@ita.tutkie.tut.ac.jp>
Date: 9 Jul 92 08:03:26 GMT
References: <OHMI.92Jul3205602@ita.tutkie.tut.ac.jp> <ne7.9role@lab.ntt.jp>
 <OHMI.92Jul6181350@ita.tutkie.tut.ac.jp>
 <KEIBUN.92JUL9092323@kek.ac.jp>
Sender: news@tutkie.tut.ac.jp (Usenet News System)
Followup-To: fj.lang.postscript
Distribution: fj
Organization: Kawai Lab., Toyohashi Univ. of Tech., Japan
Lines: 189
In-Reply-To: keibun@kek.ac.jp's message of 9 Jul 92 00: 23:23 GMT