summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTill Kamppeter <till.kamppeter@gmail.com>2007-05-08 18:13:10 +0000
committerTill Kamppeter <till.kamppeter@gmail.com>2007-05-08 18:13:10 +0000
commitff4e77a33b1c2a4d8baac437a82d79f3d5efe92f (patch)
tree6b832883cdf4376ae2617e82b96bcbdbec35a208
parente68c99e22b84a83147fbf305aad5ee6b08e75a61 (diff)
downloadghostpdl-ff4e77a33b1c2a4d8baac437a82d79f3d5efe92f.tar.gz
Back out everything after rev 7909
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@7919 a1074d23-0009-0410-80fe-cf8c14f379e6
-rw-r--r--gs/contrib/chp2200/AUTHORS1
-rw-r--r--gs/contrib/chp2200/COPYING340
-rw-r--r--gs/contrib/chp2200/INSTALL104
-rw-r--r--gs/contrib/contrib.mak1095
-rw-r--r--gs/contrib/cups/cups.mak53
-rw-r--r--gs/contrib/cups/gdevcups.c4726
-rwxr-xr-xgs/contrib/cups/pstopxl67
-rwxr-xr-xgs/contrib/cups/pstopxl.in67
-rwxr-xr-xgs/contrib/cups/pstoraster62
-rw-r--r--gs/contrib/cups/pstoraster.convs29
-rwxr-xr-xgs/contrib/cups/pstoraster.in62
-rw-r--r--gs/contrib/cups/pxlcolor.ppd206
-rw-r--r--gs/contrib/cups/pxlmono.ppd200
-rw-r--r--gs/contrib/defs.h327
-rw-r--r--gs/contrib/eplaser/gdevescv.c3044
-rw-r--r--gs/contrib/eplaser/gdevescv.h186
-rw-r--r--gs/contrib/epson740/README25
-rw-r--r--gs/contrib/epson740/printerdb_rh5.21173
-rw-r--r--gs/contrib/epson740/printerdb_rh6.01166
-rwxr-xr-xgs/contrib/epson740/ps-to-printer.fpi_rh5.295
-rw-r--r--gs/contrib/epson740/upp-HowTo-to-be59
-rw-r--r--gs/contrib/gdevbjc_.c953
-rw-r--r--gs/contrib/gdevbjc_.h230
-rw-r--r--gs/contrib/gdevbjca.c875
-rw-r--r--gs/contrib/gdevcd8.c3907
-rw-r--r--gs/contrib/gdevcd8.h11
-rw-r--r--gs/contrib/gdevdj9.c2656
-rw-r--r--gs/contrib/gdevgdi.c1462
-rw-r--r--gs/contrib/gdevhl12.c742
-rw-r--r--gs/contrib/gdevln03.c395
-rw-r--r--gs/contrib/gdevlx32.c3362
-rw-r--r--gs/contrib/gdevlx50.c2732
-rw-r--r--gs/contrib/gdevlx7.c850
-rw-r--r--gs/contrib/gdevmd2k.c792
-rw-r--r--gs/contrib/gdevop4w.c367
-rw-r--r--gs/contrib/gdevxes.c219
-rw-r--r--gs/contrib/gomni.c2073
-rw-r--r--gs/contrib/japanese/dmp_init.ps206
-rw-r--r--gs/contrib/japanese/dmp_site.ps14
-rw-r--r--gs/contrib/japanese/doc/Gdevlips.htm1901
-rw-r--r--gs/contrib/japanese/doc/README.gs550j35
-rw-r--r--gs/contrib/japanese/doc/cdj880.txt120
-rw-r--r--gs/contrib/japanese/doc/dj505j.txt62
-rw-r--r--gs/contrib/japanese/doc/djgpp.txt510
-rw-r--r--gs/contrib/japanese/doc/gdev10v.txt52
-rw-r--r--gs/contrib/japanese/doc/gdevalps.txt50
-rw-r--r--gs/contrib/japanese/doc/gdevcd8.txt146
-rw-r--r--gs/contrib/japanese/doc/gdevdmpr.txt545
-rw-r--r--gs/contrib/japanese/doc/gdevfmlbp.txt81
-rw-r--r--gs/contrib/japanese/doc/gdevj100.txt28
-rw-r--r--gs/contrib/japanese/doc/gdevlbp3.txt37
-rw-r--r--gs/contrib/japanese/doc/gdevmag.txt40
-rw-r--r--gs/contrib/japanese/doc/gdevmd2k.txt179
-rw-r--r--gs/contrib/japanese/doc/gdevmjc.txt58
-rw-r--r--gs/contrib/japanese/doc/gdevml6.txt47
-rw-r--r--gs/contrib/japanese/doc/gdevp201.txt30
-rw-r--r--gs/contrib/japanese/doc/gs261j.euc559
-rw-r--r--gs/contrib/japanese/doc/gs261j.txt494
-rw-r--r--gs/contrib/japanese/dviprlib.c2834
-rw-r--r--gs/contrib/japanese/dviprlib.h361
-rw-r--r--gs/contrib/japanese/escp_24.src12
-rw-r--r--gs/contrib/japanese/gdev10v.c334
-rw-r--r--gs/contrib/japanese/gdevalps.c392
-rw-r--r--gs/contrib/japanese/gdevdmpr.c881
-rw-r--r--gs/contrib/japanese/gdevespg.c301
-rw-r--r--gs/contrib/japanese/gdevfmlbp.c229
-rw-r--r--gs/contrib/japanese/gdevfmpr.c210
-rw-r--r--gs/contrib/japanese/gdevj100.c200
-rw-r--r--gs/contrib/japanese/gdevlbp3.c277
-rw-r--r--gs/contrib/japanese/gdevmag.c335
-rw-r--r--gs/contrib/japanese/gdevmjc.c1809
-rw-r--r--gs/contrib/japanese/gdevmjc.h3220
-rw-r--r--gs/contrib/japanese/gdevml6.c353
-rw-r--r--gs/contrib/japanese/gdevnpdl.c715
-rw-r--r--gs/contrib/japanese/gdevp201.c273
-rw-r--r--gs/contrib/japanese/gdevrpdl.c296
-rw-r--r--gs/contrib/lips4/gdevl4r.c1358
-rw-r--r--gs/contrib/lips4/gdevl4v.c2490
-rw-r--r--gs/contrib/lips4/gdevl4v.c.orig2487
-rw-r--r--gs/contrib/lips4/gdevlips.c211
-rw-r--r--gs/contrib/lips4/gdevlips.h197
-rw-r--r--gs/contrib/lips4/gdevlprn.c433
-rw-r--r--gs/contrib/lips4/gdevlprn.h199
-rw-r--r--gs/contrib/lxm3200-tweaked/LICENSE342
-rw-r--r--gs/contrib/lxm3200-tweaked/README88
-rw-r--r--gs/contrib/lxm3200-tweaked/RELEASE_NOTES225
-rw-r--r--gs/contrib/lxm3200-tweaked/Z12-Z31-QuickSetup58
-rw-r--r--gs/contrib/md2k_md5k/README.jis179
-rw-r--r--gs/contrib/opvp/gdevopvp.c4634
-rw-r--r--gs/contrib/opvp/opvp_common.h299
-rw-r--r--gs/contrib/opvp/opvp_media.def166
-rw-r--r--gs/contrib/pcl3/BUGS57
-rw-r--r--gs/contrib/pcl3/LGPL504
-rw-r--r--gs/contrib/pcl3/NEWS379
-rw-r--r--gs/contrib/pcl3/README342
-rw-r--r--gs/contrib/pcl3/doc/gs-mods.txt161
-rw-r--r--gs/contrib/pcl3/doc/gs-pcl3.12143
-rw-r--r--gs/contrib/pcl3/doc/gs-pcl3.html6277
-rw-r--r--gs/contrib/pcl3/doc/gs-pcl3.ref2972
-rw-r--r--gs/contrib/pcl3/doc/how-to-report.txt256
-rw-r--r--gs/contrib/pcl3/doc/notes.bbl70
-rw-r--r--gs/contrib/pcl3/doc/notes.tex2052
-rw-r--r--gs/contrib/pcl3/doc/pcl3opts.1104
-rw-r--r--gs/contrib/pcl3/doc/pcl3opts.html175
-rw-r--r--gs/contrib/pcl3/doc/pcl3opts.ref132
-rw-r--r--gs/contrib/pcl3/doc/reports.txt489
-rw-r--r--gs/contrib/pcl3/eprn/eprnfs.c592
-rw-r--r--gs/contrib/pcl3/eprn/eprnparm.c1231
-rw-r--r--gs/contrib/pcl3/eprn/eprnrend.c1160
-rw-r--r--gs/contrib/pcl3/eprn/eprnrend.c.orig1141
-rw-r--r--gs/contrib/pcl3/eprn/gdeveprn.c1189
-rw-r--r--gs/contrib/pcl3/eprn/gdeveprn.h827
-rw-r--r--gs/contrib/pcl3/eprn/mediasize.c430
-rw-r--r--gs/contrib/pcl3/eprn/mediasize.h290
-rw-r--r--gs/contrib/pcl3/eprn/pagecount.c293
-rw-r--r--gs/contrib/pcl3/eprn/pagecount.h35
-rwxr-xr-xgs/contrib/pcl3/lib/cups-pcl3303
-rw-r--r--gs/contrib/pcl3/lib/example.mcf136
-rwxr-xr-xgs/contrib/pcl3/lib/if-pcl3417
-rw-r--r--gs/contrib/pcl3/pcl3.tar.sig8
-rw-r--r--gs/contrib/pcl3/ppd/README228
-rwxr-xr-xgs/contrib/pcl3/ppd/catppd71
-rw-r--r--gs/contrib/pcl3/ppd/fonts.ppd91
-rw-r--r--gs/contrib/pcl3/ppd/gs-5.50.ppd26
-rw-r--r--gs/contrib/pcl3/ppd/gs-6.01.ppd26
-rw-r--r--gs/contrib/pcl3/ppd/gs-6.50.ppd26
-rw-r--r--gs/contrib/pcl3/ppd/gs-6.51.ppd26
-rw-r--r--gs/contrib/pcl3/ppd/gs-7.00.ppd26
-rw-r--r--gs/contrib/pcl3/ppd/gs-common.ppd132
-rw-r--r--gs/contrib/pcl3/ppd/gs-pcl3-common.ppd116
-rw-r--r--gs/contrib/pcl3/ppd/gs-pcl3-hpdj1120c.ppd264
-rw-r--r--gs/contrib/pcl3/ppd/gs-pcl3-hpdj3xx.ppd96
-rw-r--r--gs/contrib/pcl3/ppd/gs-pcl3-hpdj400.ppd102
-rw-r--r--gs/contrib/pcl3/ppd/gs-pcl3-hpdj500.ppd88
-rw-r--r--gs/contrib/pcl3/ppd/gs-pcl3-hpdj500c.ppd95
-rw-r--r--gs/contrib/pcl3/ppd/gs-pcl3-hpdj510.ppd94
-rw-r--r--gs/contrib/pcl3/ppd/gs-pcl3-hpdj540.ppd149
-rw-r--r--gs/contrib/pcl3/ppd/gs-pcl3-hpdj550c.ppd103
-rw-r--r--gs/contrib/pcl3/ppd/gs-pcl3-hpdj600.ppd165
-rw-r--r--gs/contrib/pcl3/ppd/gs-pcl3-hpdj660c.ppd169
-rw-r--r--gs/contrib/pcl3/ppd/gs-pcl3-hpdj680c.ppd191
-rw-r--r--gs/contrib/pcl3/ppd/gs-pcl3-hpdj8xxc.ppd214
-rw-r--r--gs/contrib/pcl3/ppd/gs-pcl3-hpdjportable.ppd88
-rw-r--r--gs/contrib/pcl3/ppd/gs-pcl3-unspec.ppd270
-rw-r--r--gs/contrib/pcl3/ppd/gs-pcl3-unspecold.ppd109
-rw-r--r--gs/contrib/pcl3/ps/calign.ps232
-rw-r--r--gs/contrib/pcl3/ps/dumppdd.ps62
-rw-r--r--gs/contrib/pcl3/ps/levels-test.ps464
-rw-r--r--gs/contrib/pcl3/ps/margins-A4.ps76
-rw-r--r--gs/contrib/pcl3/ps/margins-A4Rotated.ps73
-rw-r--r--gs/contrib/pcl3/ps/margins-Env10Rotated.ps73
-rw-r--r--gs/contrib/pcl3/ps/margins-EnvDLRotated.ps73
-rw-r--r--gs/contrib/pcl3/ps/margins-Letter.ps76
-rw-r--r--gs/contrib/pcl3/ps/margins-LetterRotated.ps73
-rw-r--r--gs/contrib/pcl3/src/contrib.mak-5.50.add237
-rw-r--r--gs/contrib/pcl3/src/contrib.mak-6.01.add237
-rw-r--r--gs/contrib/pcl3/src/contrib.mak-6.50.add237
-rw-r--r--gs/contrib/pcl3/src/contrib.mak-6.51.add239
-rw-r--r--gs/contrib/pcl3/src/contrib.mak-7.00.add239
-rw-r--r--gs/contrib/pcl3/src/gdevpcl3.c1579
-rw-r--r--gs/contrib/pcl3/src/pcl3opts-de.msg42
-rw-r--r--gs/contrib/pcl3/src/pcl3opts-en.msg42
-rw-r--r--gs/contrib/pcl3/src/pcl3opts.c1176
-rw-r--r--gs/contrib/pcl3/src/pclcap.c872
-rw-r--r--gs/contrib/pcl3/src/pclcap.h74
-rw-r--r--gs/contrib/pcl3/src/pclcomp.c757
-rw-r--r--gs/contrib/pcl3/src/pclgen.c1141
-rw-r--r--gs/contrib/pcl3/src/pclgen.h435
-rw-r--r--gs/contrib/pcl3/src/pclscan.c331
-rw-r--r--gs/contrib/pcl3/src/pclscan.h98
-rw-r--r--gs/contrib/pcl3/src/pclsize.c201
-rw-r--r--gs/contrib/pcl3/src/pclsize.h36
-rw-r--r--gs/contrib/pcl3/src/zmedia2.c-5.50.diff33
-rw-r--r--gs/contrib/pcl3/src/zmedia2.c-6.01.diff33
-rw-r--r--gs/contrib/pcl3/src/zmedia2.c-6.50.diff33
-rw-r--r--gs/contrib/pcl3/src/zmedia2.c-6.51.diff33
-rw-r--r--gs/contrib/pcl3/src/zmedia2.c-7.00.diff33
-rw-r--r--gs/contrib/uniprint/PM760p.upp34
-rw-r--r--gs/contrib/uniprint/PM760pl.upp34
-rw-r--r--gs/contrib/uniprint/PM820p.upp34
-rw-r--r--gs/contrib/uniprint/PM820pl.upp34
-rw-r--r--gs/contrib/uniprint/Stc670p.upp35
-rw-r--r--gs/contrib/uniprint/Stc670pl.upp35
-rw-r--r--gs/contrib/uniprint/Stc680p.upp34
-rw-r--r--gs/contrib/uniprint/Stc680pl.upp34
-rw-r--r--gs/contrib/uniprint/Stc740p.upp34
-rw-r--r--gs/contrib/uniprint/Stc740pl.upp35
-rw-r--r--gs/contrib/uniprint/Stc760p.upp35
-rw-r--r--gs/contrib/uniprint/Stc760pl.upp34
-rw-r--r--gs/contrib/uniprint/Stc777p.upp34
-rw-r--r--gs/contrib/uniprint/Stc777pl.upp34
-rw-r--r--gs/contrib/uniprint/Stp720p.upp34
-rw-r--r--gs/contrib/uniprint/Stp720pl.upp34
-rw-r--r--gs/contrib/uniprint/Stp870p.upp34
-rw-r--r--gs/contrib/uniprint/Stp870pl.upp34
-rw-r--r--gs/contrib/uniprint/bjc6000a1.upp48
-rw-r--r--gs/contrib/uniprint/bjc6000b1.upp48
-rw-r--r--gs/contrib/uniprint/s400a1.upp44
-rw-r--r--gs/contrib/uniprint/s400b1.upp48
-rw-r--r--gs/contrib/uniprint/sharp.upp58
-rw-r--r--gs/contrib/uniprint/sipixa6.upp23
-rw-r--r--gs/contrib/uniprint/stc740ih.upp58
-rwxr-xr-xgs/ijs/autogen.sh18
-rw-r--r--gs/lib/gs_init.ps18
-rw-r--r--gs/lib/gs_setpd.ps75
-rw-r--r--gs/src/Makefile.in126
-rw-r--r--gs/src/configure.ac486
-rw-r--r--gs/src/contrib.mak31
-rw-r--r--gs/src/devs.mak30
-rw-r--r--gs/src/gconf.c25
-rw-r--r--gs/src/gdevcdj.c143
-rw-r--r--gs/src/gdevdjet.c45
-rw-r--r--gs/src/gdevdljm.c4
-rw-r--r--gs/src/gdevdljm.h7
-rw-r--r--gs/src/gdevl256.c9
-rw-r--r--gs/src/gdevlbp8.c8
-rw-r--r--gs/src/gdevlj56.c2
-rw-r--r--gs/src/gdevpx.c161
-rw-r--r--gs/src/gdevpxut.c19
-rw-r--r--gs/src/gdevpxut.h3
-rw-r--r--gs/src/gdevvglb.c9
-rw-r--r--gs/src/gdevxalt.c18
-rw-r--r--gs/src/gp_unix.c45
-rw-r--r--gs/src/gs.mak4
-rw-r--r--gs/src/lib.mak2
-rw-r--r--gs/src/unix-aux.mak2
-rw-r--r--gs/src/unix-gcc.mak9
-rw-r--r--gs/src/unixinst.mak8
-rw-r--r--gs/src/version.mak (renamed from gs/src/version.mak.in)8
229 files changed, 164 insertions, 104869 deletions
diff --git a/gs/contrib/chp2200/AUTHORS b/gs/contrib/chp2200/AUTHORS
deleted file mode 100644
index 2e65e465b..000000000
--- a/gs/contrib/chp2200/AUTHORS
+++ /dev/null
@@ -1 +0,0 @@
-Siow-Kiat Tan <siow-kiat_tan@hp.com>
diff --git a/gs/contrib/chp2200/COPYING b/gs/contrib/chp2200/COPYING
deleted file mode 100644
index d60c31a97..000000000
--- a/gs/contrib/chp2200/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/gs/contrib/chp2200/INSTALL b/gs/contrib/chp2200/INSTALL
deleted file mode 100644
index d823dda74..000000000
--- a/gs/contrib/chp2200/INSTALL
+++ /dev/null
@@ -1,104 +0,0 @@
-Ghostscript driver for HP Business Inkjet 2200
-
-=============================================================================
-Building the source code
-=============================================================================
-The source code for the HP 2200 Ghostscript driver consists of 3 files
-(gs-hp2200.tar.gz).
- 1. gdevcd8.c
- 2. contrib.mak
- 3. unix-gcc.mak
-
-Follow these steps to build Ghostscript 6.01 in Linux:
-1. Download and install the Ghostscript 6.01 source code
- (http://www.cs.wisc.edu/~ghost/aladdin/get601.html) according to the
- official instructions shown on the Ghostscript home page. To build for
- the Linux platform, you will need the Unix & VMS sources:
- a. Ghostscript-6.01-1.src.rpm
- b. Ghostscript-fonts-6.0-2.src.rpm
-
-2. Copy the HP 2200 Ghostscript driver source files (gdevcd8.c, contrib.mak
- and unix-gcc.mak) into the Ghostscript source directory, overwriting the
- original versions.
-
-3. Build Ghostscript.
-
-Here is a summary of the steps to build Ghostscript 6.01 in Linux:
- # cd /usr/local/src
- # tar zxvf /tmp/ghostscript-6.01.tar.gz
- # cd gs6.01
- # tar zxvf /tmp/ghostscript-6.01jpeg.tar.gz
- # tar zxvf /tmp/ghostscript-6.01libpng.tar.gz
- # tar zxvf /tmp/ghostscript-6.01zlib.tar.gz
- # mv jpeg-6b jpeg
- # mv libpng-1.0.5 libpng
- # mv zlib-1.1.3 zlib
- # cd src
- # cp /tmp/gdevcd8.c ./
- # cp /tmp/contrib.mak ./
- # cp /tmp/unix-gcc.mak ./
- # cd ..
- # ln -s /usr/X11R6 /usr/X11 (needed by some Linux distributions)
- # make -f src/unix-gcc.mak
-
-When the build completes, the binary output is:
- /usr/local/src/gs6.01/bin/gs
-
-=============================================================================
-Installation
-=============================================================================
-1. Download and install Ghostscript 6.01
- (http://www.cs.wisc.edu/~ghost/aladdin/get601.html) according to the
- official instructions shown on the Ghostscript home page.
- a. Ghostscript-6.01-1.i386.rpm
- b. Ghostscript-fonts-6.0-2.noarch.rpm
-
-2. Copy the HP 2200 Ghostscript binary (gs) and overwrite the original
- Ghostscript 6.01 executable:
- # type gs
- gs is /usr/bin/gs
- # cd /usr/bin/gs
- # cp gs gs.backup
- # cp /usr/local/src/gs6.01/bin/gs .
- cp: overwrite `./gs'? y
-
-3. Run printtool and add a print queue, e.g. lp0
- a. In the Configure Filter dialog box, select
- "HP DeskJet 850/855/870/1100 series".
- b. In the Paper Size list box, choose the desired paper size,
- e.g. Letter
- c. In the Extra GS options edit box:
- specify "-sDEVICE=chp2200"
- d. Enable the checkboxes: "Send EOF after job to eject page" and "Fix
- stair-stepping text".
-
-=============================================================================
-Using the driver
-=============================================================================
-Selecting paper size:
-Run printtool and edit the lp0 printer queue. In the Paper Size list box,
-choose the desired size.
-
-Selecting paper type:
-Run printtool and edit the lp0 printer queue. In the Extra GS options edit
-box, specify:
- "-dPapertype=x"
-Possible values of x are:
- 0=Plain Paper (*default), 1=Bond paper, 2=special paper, 3=photo paper,
- 4=transparency
-
-Selecting print quality:
-Run printtool and edit the lp0 printer queue. In the Extra GS options edit
-box, specify:
- "-dQuality=x"
-Possible values of x are:
- -1=Draft, 0=Normal (*default), 1=Best
-
-Printing from an application:
-From the application, select File -> Print. In the Print Command field,
-specify:
- "lpr -Plp0"
-
-Printing a file from a console window:
- # gs -q -sDEVICE=chp2200 -dNOPAUSE -dSAFER -dBATCH -sOutputFile=- test.ps |lpr
-
diff --git a/gs/contrib/contrib.mak b/gs/contrib/contrib.mak
deleted file mode 100644
index fc1a9e585..000000000
--- a/gs/contrib/contrib.mak
+++ /dev/null
@@ -1,1095 +0,0 @@
-# $Id: contrib.mak,v 1.28 2002/10/16 23:26:33 giles Exp $
-
-# Makefile for device drivers which are not in the original GPL GhostScript
-# distributiion
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-
-# Define the name of this makefile.
-CONTRIB_MAK=$(CONTRIBDIR)$(D)contrib.mak
-CONTRIBSRC=$(CONTRIBDIR)$(D)
-
-###### --------------------------- Catalog -------------------------- ######
-
-# The following drivers are user-contributed, and maintained (if at all) by
-# users. Please report problems in these drivers to their authors, whose
-# e-mail addresses appear below: do not report them to mailing lists or
-# mailboxes for general Ghostscript problems.
-
-# Displays:
-#
-# None currently
-#
-# Printers:
-#
-# bj10v Canon BubbleJet BJ10v/BJ15v (japanese)
-# bj10vh Canon BubbleJet BJ10v/BJ15v/BJ35v (japanese)
-# bjc880j Canon Color BubbleJet BJC-880J (japanese)
-# bjccolor Canon BJC-250, BJC-250ex, BJC-1000, ... Floyd-Steinberg
-# dithering
-# bjccmyk Canon BJC-250, BJC-250ex, BJC-1000, ... GhostScript
-# standard dithering
-# bjcgray Canon BJC-250, BJC-250ex, BJC-1000, ... Grayscale mode
-# bjcmono Canon BJC-250, BJC-250ex, BJC-1000, ... Monochrome mode
-# cdj1600 HP DeskJet 1600
-# cdj670 HP DeskJet 670
-# cdj850 HP DeskJet 850
-# cdj880 HP DeskJet 880
-# cdj890 HP DeskJet 890
-# cdj970 HP DeskJet 970
-# chp2200 HP Business Inkjet 2200
-# dl2100 DEC DL2100
-# dmprt dot matrix printer driver for Ghostscript (it can use
-# dviprt printer config files, japanese)
-# escpage Epson ESC/Page driver for Ghostscript (japanese)
-# fmpr Fujitsu FMPR (japanese)
-# fmlbp Fujitsu FMLBP2xx Page Printer (japanese)
-# gdi Samsung's old driver for their SmartGDI laser printers:
-# ML-4500, ML-2xx, ML-1xxx, ML-5080, ML-6040, ... and
-# Lexmark E210, same as "samsunggdi"
-# hl1240 Brother HL-1240 and compatible 600-dpi PCL-5 printers
-# hl1250 Brother HL-1250 and compatible 1200x600-dpi PCL-5 printers
-# hpdj1120c HP DeskJet 1120 ("pcl3" driver)
-# hpdj310 HP DeskJet 310 ("pcl3" driver)
-# hpdj320 HP DeskJet 320 ("pcl3" driver)
-# hpdj340 HP DeskJet 340 ("pcl3" driver)
-# hpdj400 HP DeskJet 400 ("pcl3" driver)
-# hpdj500 HP DeskJet 500 ("pcl3" driver)
-# hpdj500c HP DeskJet 500c ("pcl3" driver)
-# hpdj510 HP DeskJet 510 ("pcl3" driver)
-# hpdj520 HP DeskJet 520 ("pcl3" driver)
-# hpdj540 HP DeskJet 540 ("pcl3" driver)
-# hpdj550c HP DeskJet 550c ("pcl3" driver)
-# hpdj560c HP DeskJet 560c ("pcl3" driver)
-# hpdj600 HP DeskJet 600 ("pcl3" driver)
-# hpdj660c HP DeskJet 660c ("pcl3" driver)
-# hpdj670c HP DeskJet 670c ("pcl3" driver)
-# hpdj680c HP DeskJet 680c ("pcl3" driver)
-# hpdj690c HP DeskJet 690c ("pcl3" driver)
-# hpdj850c HP DeskJet 850c ("pcl3" driver)
-# hpdj855c HP DeskJet 855c ("pcl3" driver)
-# hpdj870c HP DeskJet 870c ("pcl3" driver)
-# hpdj890c HP DeskJet 890c ("pcl3" driver)
-# hpdjplus HP DeskJet Plus ("pcl3" driver)
-# hpdjportable HP DeskJet Portable ("pcl3" driver)
-# jj100 Star JJ-100 (japanese)
-# la50 DEC LA50
-# la70 DEC LA70
-# la75 DEC LA75
-# la75plus DEC LA75+
-# lbp310 Canon LBP-310 (japanese)
-# lbp320 Canon LBP-320 Pro/LBP-350 (japanese)
-# lex2050 Lexmark 2050
-# lex3200 Lexmark 3200
-# lex5700 Lexmark 5700
-# lex7000 Lexmark 7000, Lexmark IJ900, Compaq A900, Z51
-# lips2p Canon LIPS-II+ (japanese)
-# lips4v Canon LIPS IV vector mode driver
-# lips4 Canon LIPS IV raster mode driver
-# ln03 DEC LN03
-# lx5000 Lexmark 5000
-# lxm3200 Lexmark 3200, Z31, Z12
-# md1xMono Alps MD-1000/1300/1500 (monochrome mode, japanese)
-# md2k Alps MD-2000/2010/4000/1000/1300/1500
-# md50Mono Alps MD-5000, Oki DP-5000 (monochrome mode, japanese)
-# md50Eco Alps MD-5000, Oki DP-5000 (economy mode, japanese)
-# md5k Alps MD-5000, Oki DP-5000
-# mj500c Epson Stylus Color IIs, 200, 1500 (japanese)
-# mj700v2c Epson Stylus, Epson MachJet (japanese)
-# mj6000c Epson Stylus Color 400, 800, 1520 (japanese)
-# mj8000c Epson Stylus Color 3000 (japanese)
-# ml600 Okidata Microline 600CL/620CL (japanese)
-# npdl NEC MultiWriter, PC-PR1000/2000 (japanese)
-# oki4w Okidata OkiPage 4w+
-# opvp Gluecode for Vector Driver API
-# pcl3 PCL-3(+) printers: Many, especially older HP inkjets,
-# non-HP inkjets as Sharp AJ, Xerox DocuPrint, ...
-# pr1000 NEC PC-PR 1000 (japanese)
-# pr1000_4 NEC PC-PR 1000/4 (japanese)
-# pr150 NEC PC-PR 150 (japanese)
-# pr201 NEC PC-PR 201 (japanese)
-# rpdl Ricoh RPDL I/II/III/IV drver for Ghostscript (japanese)
-# samsunggdi Samsung's old driver for their SmartGDI laser printers:
-# ML-4500, ML-2xx, ML-1xxx, ML-5080, ML-6040, ... and
-# Lexmark E210, same as "gdi"
-# xes Xerox XES (2700, 3700, 4045, etc.)
-#
-# Fax systems:
-#
-# None currently
-#
-# Other raster file formats and devices:
-#
-# mag16 MAG file format (from Red Hat's japanese driver pack)
-# mag256 MAG file format (from Red Hat's japanese driver pack)
-#
-# Special features
-#
-# uniprint/: Some additional .upp files
-#
-
-# If you add drivers, it would be nice if you kept each list
-# in alphabetical order.
-
-###### ----------------------- End of catalog ----------------------- ######
-
-### ----------------- The BJC-210/240/250/250ex/265/1000 ---------------- ###
-
-###
-### For questions about the driver, mailto://szaszg@hu.inter.net
-### http://bjc250gs.sourceforge.net
-###
-
-bjc_h=$(CONTRIBSRC)gdevbjc_.h
-
-bjc_=$(GLOBJ)gdevbjc_.$(OBJ) $(GLOBJ)gdevbjca.$(OBJ)
-
-$(GLOBJ)gdevbjc_.$(OBJ) : $(CONTRIBSRC)gdevbjc_.c $(PDEVH) $(bjc_h)
- $(GLCC) $(GLO_)gdevbjc_.$(OBJ) $(C_) $(CONTRIBSRC)gdevbjc_.c
-
-$(GLOBJ)gdevbjca.$(OBJ) : $(CONTRIBSRC)gdevbjca.c $(PDEVH) $(bjc_h)
- $(GLCC) $(GLO_)gdevbjca.$(OBJ) $(C_) $(CONTRIBSRC)gdevbjca.c
-
-$(DD)bjcmono.dev : $(bjc_) $(DD)page.dev
- $(SETPDEV) $(DD)bjcmono $(bjc_)
-
-$(DD)bjcgray.dev : $(bjc_) $(DD)page.dev
- $(SETPDEV) $(DD)bjcgray $(bjc_)
-
-$(DD)bjccmyk.dev : $(bjc_) $(DD)page.dev
- $(SETPDEV) $(DD)bjccmyk $(bjc_)
-
-$(DD)bjccolor.dev : $(bjc_) $(DD)page.dev
- $(SETPDEV) $(DD)bjccolor $(bjc_)
-
-
-### -------------- cdj850 - HP 850c Driver under development ------------- ###
-
-cdeskjet8_=$(GLOBJ)gdevcd8.$(OBJ) $(HPPCL)
-
-# Author: Uli Wortmann (uliw@erdw.ethz.ch), Martin Gerbershagen (ger@ulm.temic.de)
-# Printer: HP 670
-$(DD)cdj670.dev : $(cdeskjet8_) $(DD)page.dev
- $(SETPDEV2) $(DD)cdj670 $(cdeskjet8_)
-
-# Author: Uli Wortmann (uliw@erdw.ethz.ch)
-# Printer: HP 850
-$(DD)cdj850.dev : $(cdeskjet8_) $(DD)page.dev
- $(SETPDEV2) $(DD)cdj850 $(cdeskjet8_)
-
-# Author: Uli Wortmann (uliw@erdw.ethz.ch), Martin Gerbershagen (ger@ulm.temic.de)
-# Printer: HP 890
-$(DD)cdj890.dev : $(cdeskjet8_) $(DD)page.dev
- $(SETPDEV2) $(DD)cdj890 $(cdeskjet8_)
-
-# Author: Uli Wortmann (uliw@erdw.ethz.ch), Martin Gerbershagen (ger@ulm.temic.de)
-# Printer: HP 1600
-$(DD)cdj1600.dev : $(cdeskjet8_) $(DD)page.dev
- $(SETPDEV2) $(DD)cdj1600 $(cdeskjet8_)
-
-$(GLOBJ)gdevcd8.$(OBJ) : $(CONTRIBSRC)gdevcd8.c $(PDEVH) $(math__h)\
- $(gsparam_h) $(gxlum_h) $(gdevpcl_h)
- $(GLCC) $(GLO_)gdevcd8.$(OBJ) $(C_) $(CONTRIBSRC)gdevcd8.c
-
-
-### -------------- cdj880 - HP 880c Driver under development ------------- ###
-### Since this driver is in the development phase it is not distributed ###
-### with Ghostscript, but is available from ###
-### http://www.proaxis.com/~mgelhaus/linux/software/hp880c/hp880c.html ###
-
-### NOTE: Depends on the presence of the cdj850 section above. ###
-
-# Author: Matthew Gelhaus (mgelhaus@proaxis.com)
-# Printer: HP 880c
-$(DD)cdj880.dev : $(cdeskjet8_) $(DD)page.dev
- $(SETPDEV2) $(DD)cdj880 $(cdeskjet8_)
-
-
-### ------------- cdj970 - HP 970Cxi Driver under development ------------- ###
-
-cdeskjet9_=$(GLOBJ)gdevdj9.$(OBJ) $(HPPCL)
-
-# Author: Rene Harsch (rene@harsch.net)
-# Printer: HP 970Cxi
-$(DD)cdj970.dev : $(cdeskjet9_) $(DD)page.dev
- $(SETPDEV2) $(DD)cdj970 $(cdeskjet9_)
-
-$(GLOBJ)gdevdj9.$(OBJ) : $(CONTRIBSRC)gdevdj9.c $(PDEVH) $(math__h) $(string__h)\
- $(gsparam_h) $(gxlum_h) $(gdevpcl_h)
- $(GLCC) $(GLO_)gdevdj9.$(OBJ) $(C_) $(CONTRIBSRC)gdevdj9.c
-
-
-### -------------- chp2200 - HP Business Inkjet 2200 ------------- ###
-
-### NOTE: Depends on the presence of the cdj850 section.
-
-$(DD)chp2200.dev : $(cdeskjet8_) $(DD)page.dev
- $(SETPDEV2) $(DD)chp2200 $(cdeskjet8_)
-
-
-### ---------------- The Samsung SmartGDI laser printer devices --------- ###
-### Note : this driver is used by Samsung SmartGDI compatible printers. ###
-###
-
-GDIMONO=$(GLOBJ)gdevgdi.$(OBJ) $(HPPCL)
-
-$(DD)gdi.dev: $(GDIMONO) $(DD)page.dev
- $(SETPDEV) $(DD)gdi $(GDIMONO)
-
-$(DD)samsunggdi.dev: $(GDIMONO) $(DD)page.dev
- $(SETPDEV) $(DD)samsunggdi $(GDIMONO)
-
-$(GLOBJ)gdevgdi.$(OBJ): $(CONTRIBSRC)gdevgdi.c $(PDEVH) $(gdevpcl_h)
- $(GLCC) $(GLO_)gdevgdi.$(OBJ) $(C_) $(CONTRIBSRC)gdevgdi.c
-
-
-### ---------------- The Brother HL-1240/HL-1250 printers --------------- ###
-### These printers are ljet4-compatible, plus support for source tray ###
-### selection and special 1200x600 dpi mode. ###
-
-hl1250_=$(GLOBJ)gdevhl12.$(OBJ) $(HPDLJM)
-$(DD)hl1250.dev : $(hl1250_) $(DD)page.dev
- $(SETPDEV) $(DD)hl1250 $(hl1250_)
-
-$(DD)hl1240.dev : $(hl1250_) $(DD)page.dev
- $(SETPDEV) $(DD)hl1240 $(hl1250_)
-
-# Author: Marek Michalkiewicz <marekm@linux.org.pl>
-# Printer: Brother HL-1250 (may work with some other models too)
-$(GLOBJ)gdevhl12.$(OBJ) : $(CONTRIBSRC)gdevhl12.c $(PDEVH) $(gdevdljm_h)
- $(GLCC) $(GLO_)gdevhl12.$(OBJ) $(C_) $(CONTRIBSRC)gdevhl12.c
-
-
-### -------- The DEC LN03/DL2100/LA50/LA70/LA75 printer devices -------- ###
-
-ln03_=$(GLOBJ)gdevln03.$(OBJ)
-
-# Author: Ulrich Mueller (ulm@vsnhd1.cern.ch)
-# Printer: DEC LN03
-$(DD)ln03.dev : $(ln03_) $(DD)page.dev
- $(SETPDEV) $(DD)ln03 $(ln03_)
-
-# Author: Nick Brown (nick.brown@coe.int)
-# Printer: DEClaser 2100
-$(DD)dl2100.dev : $(ln03_) $(DD)page.dev
- $(SETPDEV) $(DD)dl2100 $(ln03_)
-
-# Author: Ian MacPhedran (macphed@dvinci.USask.CA)
-# Printer: DEC LA50
-$(DD)la50.dev : $(ln03_) $(DD)page.dev
- $(SETPDEV) $(DD)la50 $(ln03_)
-
-# Author: Bruce Lowekamp (lowekamp@csugrad.cs.vt.edu)
-# Printer: DEC LA70
-$(DD)la70.dev : $(ln03_) $(DD)page.dev
- $(SETPDEV) $(DD)la70 $(ln03_)
-
-# Author: Ian MacPhedran (macphed@dvinci.USask.CA)
-# Printer: DEC LA75
-$(DD)la75.dev : $(ln03_) $(DD)page.dev
- $(SETPDEV) $(DD)la75 $(ln03_)
-
-# Author: Andre' Beck (Andre_Beck@IRS.Inf.TU-Dresden.de)
-# Printer: DEC LA75plus
-$(DD)la75plus.dev : $(ln03_) $(DD)page.dev
- $(SETPDEV) $(DD)la75plus $(ln03_)
-
-$(GLOBJ)gdevln03.$(OBJ) : $(CONTRIBSRC)gdevln03.c $(PDEVH)
- $(GLCC) $(GLO_)gdevln03.$(OBJ) $(C_) $(CONTRIBSRC)gdevln03.c
-
-
-### -------------------------- EPSON Page/Color -------------------------- ###
-###
-###
-
-ESCV_DIR=$(CONTRIBSRC)eplaser
-ESCV_SRC=$(ESCV_DIR)$(D)
-escv_opts=-DGS_VERSION_MAJOR=$(GS_VERSION_MAJOR)
-
-escv_=$(GLOBJ)gdevescv.$(OBJ)
-
-$(GLOBJ)gdevescv.$(OBJ): $(ESCV_SRC)gdevescv.c $(ESCV_SRC)gdevescv.h $(PDEVH)
- $(GLCC) -DA4 $(GLO_)gdevescv.$(OBJ) $(C_) $(escv_opts) $(ESCV_SRC)gdevescv.c
-
-$(DD)alc1900.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)alc1900 $(escv_)
-
-$(DD)alc2000.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)alc2000 $(escv_)
-
-$(DD)alc4000.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)alc4000 $(escv_)
-
-$(DD)alc4100.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)alc4100 $(escv_)
-
-$(DD)alc8500.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)alc8500 $(escv_)
-
-$(DD)alc8600.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)alc8600 $(escv_)
-
-$(DD)alc9100.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)alc9100 $(escv_)
-
-$(DD)lp3000c.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp3000c $(escv_)
-
-$(DD)lp8000c.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp8000c $(escv_)
-
-$(DD)lp8200c.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp8200c $(escv_)
-
-$(DD)lp8300c.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp8300c $(escv_)
-
-$(DD)lp8500c.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp8500c $(escv_)
-
-$(DD)lp8800c.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp8800c $(escv_)
-
-$(DD)lp9000c.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp9000c $(escv_)
-
-$(DD)lp9200c.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp9200c $(escv_)
-
-$(DD)lp9500c.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp9500c $(escv_)
-
-$(DD)lp9800c.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp9800c $(escv_)
-
-$(DD)lps6500.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lps6500 $(escv_)
-
-$(DD)epl2050.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)epl2050 $(escv_)
-
-$(DD)epl2050p.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)epl2050p $(escv_)
-
-$(DD)epl2120.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)epl2120 $(escv_)
-
-$(DD)epl2500.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)epl2500 $(escv_)
-
-$(DD)epl2750.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)epl2750 $(escv_)
-
-$(DD)epl5800.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)epl5800 $(escv_)
-
-$(DD)epl5900.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)epl5900 $(escv_)
-
-$(DD)epl6100.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)epl6100 $(escv_)
-
-$(DD)epl6200.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)epl6200 $(escv_)
-
-$(DD)lp1800.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp1800 $(escv_)
-
-$(DD)lp1900.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp1900 $(escv_)
-
-$(DD)lp2200.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp2200 $(escv_)
-
-$(DD)lp2400.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp2400 $(escv_)
-
-$(DD)lp2500.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp2500 $(escv_)
-
-$(DD)lp7500.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp7500 $(escv_)
-
-$(DD)lp7700.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp7700 $(escv_)
-
-$(DD)lp7900.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp7900 $(escv_)
-
-$(DD)lp8100.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp8100 $(escv_)
-
-$(DD)lp8300f.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp8300f $(escv_)
-
-$(DD)lp8400f.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp8400f $(escv_)
-
-$(DD)lp8600.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp8600 $(escv_)
-
-$(DD)lp8600f.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp8600f $(escv_)
-
-$(DD)lp8700.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp8700 $(escv_)
-
-$(DD)lp8900.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp8900 $(escv_)
-
-$(DD)lp9000b.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp9000b $(escv_)
-
-$(DD)lp9100.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp9100 $(escv_)
-
-$(DD)lp9200b.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp9200b $(escv_)
-
-$(DD)lp9300.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp9300 $(escv_)
-
-$(DD)lp9400.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp9400 $(escv_)
-
-$(DD)lp9600.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp9600 $(escv_)
-
-$(DD)lp9600s.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lp9600s $(escv_)
-
-$(DD)lps4500.dev: $(escv_) $(DD)page.dev
- $(SETPDEV) $(DD)lps4500 $(escv_)
-
-
-# ------ The Lexmark 5700 and 7000 devices ------ #
-
-lex7000_=$(GLOBJ)gdevlx7.$(OBJ)
-$(DD)lex7000.dev: $(lex7000_) $(DD)page.dev
- $(SETPDEV) $(DD)lex7000 $(lex7000_)
-
-lex5700_=$(GLOBJ)gdevlx7.$(OBJ)
-$(DD)lex5700.dev: $(lex5700_) $(DD)page.dev
- $(SETPDEV) $(DD)lex5700 $(lex5700_)
-
-lex3200_=$(GLOBJ)gdevlx7.$(OBJ)
-$(DD)lex3200.dev: $(lex3200_) $(DD)page.dev
- $(SETPDEV) $(DD)lex3200 $(lex3200_)
-
-lex2050_=$(GLOBJ)gdevlx7.$(OBJ)
-$(DD)lex2050.dev: $(lex2050_) $(DD)page.dev
- $(SETPDEV) $(DD)lex2050 $(lex2050_)
-
-$(GLOBJ)gdevlx7.$(OBJ): $(CONTRIBSRC)gdevlx7.c $(PDEVH)
- $(GLCC) $(GLO_)gdevlx7.$(OBJ) $(C_) $(CONTRIBSRC)gdevlx7.c
-
-
-### ----------------- LexMark 5000 printer ----------------------------- ###
-### Note: this driver was contributed by users. Please contact: ###
-### Peter B. West <p.west@uq.net.au> ###
-
-lx5000_=$(GLOBJ)gdevlx50.$(OBJ)
-$(DD)lx5000.dev: $(lx5000_)
- $(SETPDEV) $(DD)lx5000 $(lx5000_)
-
-$(GLOBJ)gdevlx50.$(OBJ): $(CONTRIBSRC)gdevlx50.c $(PDEVH)
- $(GLCC) $(GLO_)gdevlx50.$(OBJ) $(C_) $(CONTRIBSRC)gdevlx50.c
-
-
-### ----------- Lexmark 3200 device ------------ ###
-
-lxm3200_=$(GLOBJ)gdevlx32.$(OBJ)
-
-$(GLOBJ)gdevlx32.$(OBJ): $(CONTRIBSRC)gdevlx32.c $(PDEVH) $(gsparam_h)
- $(GLCC) $(GLO_)gdevlx32.$(OBJ) $(C_) $(CONTRIBSRC)gdevlx32.c
-
-$(DD)lxm3200.dev: $(lxm3200_) $(DD)page.dev
- $(SETPDEV) $(DD)lxm3200 $(lxm3200_)
-
-
-### -------------- The Canon LIPS IV laser printer device -------------- ###
-### ###
-LIPS_DIR=$(CONTRIBSRC)lips4
-LIPS_SRC=$(LIPS_DIR)$(D)
-LIPS_OPT=-DGS_VERSION_MAJOR=$(GS_VERSION_MAJOR) $(I_) $(LIPS_SRC)
-
-$(GLOBJ)gdevlprn.$(OBJ): $(LIPS_SRC)gdevlprn.c $(LIPS_SRC)gdevlprn.h\
- $(gdevprn_h) $(PDEVH)
- $(GLCC) $(GLO_)gdevlprn.$(OBJ) $(LIPS_OPT) $(C_) $(LIPS_SRC)gdevlprn.c
-
-lipsr_=$(GLOBJ)gdevl4r.$(OBJ) $(GLOBJ)gdevlips.$(OBJ) $(GLOBJ)gdevlprn.$(OBJ)
-
-$(GLOBJ)gdevl4r.$(OBJ): $(LIPS_SRC)gdevl4r.c $(LIPS_SRC)gdevlips.h $(PDEVH)
- $(GLCC) -DA4 $(GLO_)gdevl4r.$(OBJ) $(LIPS_OPT) $(C_)\
- $(LIPS_SRC)gdevl4r.c
-
-$(GLOBJ)gdevlips.$(OBJ): $(LIPS_SRC)gdevlips.c
- $(GLCC) $(GLO_)gdevlips.$(OBJ) $(LIPS_OPT) $(C_) $(LIPS_SRC)gdevlips.c
-
-$(DD)lips4.dev: $(lipsr_) $(DD)page.dev
- $(SETPDEV) $(DD)lips4 $(lipsr_)
-
-lipsv_=$(GLOBJ)gdevl4v.$(OBJ) $(GLOBJ)gdevlips.$(OBJ)
-
-$(DD)lips4v.dev: $(ECHOGS_XE) $(lipsv_) $(DD)vector.dev
- $(SETDEV) $(DD)lips4v $(lipsv_)
- $(ADDMOD) $(DD)lips4v -include $(GLD)vector
-
-$(GLOBJ)gdevl4v.$(OBJ): $(LIPS_SRC)gdevl4v.c $(LIPS_SRC)gdevlips.h $(GDEV)\
- $(math__h) $(gscspace_h) $(gsutil_h) $(gsparam_h) $(gsmatrix_h) $(gdevvec_h)\
- $(ghost_h) $(gzstate_h) $(igstate_h)
- $(GLCC) -DA4 $(GLO_)gdevl4v.$(OBJ) $(LIPS_OPT) $(C_)\
- $(LIPS_SRC)gdevl4v.c
-
-### --------------- Some extra devices: lips2p, bjc880j ---------------- ###
-
-$(DD)lips2p.dev: $(lipsr_) $(DD)page.dev
- $(SETPDEV) $(DD)lips2p $(lipsr_)
-
-$(DD)bjc880j.dev: $(lipsr_) $(DD)page.dev
- $(SETPDEV) $(DD)bjc880j $(lipsr_)
-
-
-### ------------ ALPS MD series printer devices ------------ ###
-
-md2k_=$(GLOBJ)gdevmd2k.$(OBJ)
-
-$(DD)md2k.dev: $(md2k_) $(DD)page.dev
- $(SETPDEV) $(DD)md2k $(md2k_)
-
-$(DD)md5k.dev: $(md2k_) $(DD)page.dev
- $(SETPDEV) $(DD)md5k $(md2k_)
-
-$(GLOBJ)gdevmd2k.$(OBJ): $(CONTRIBSRC)gdevmd2k.c $(PDEVH) $(gsparam_h)
- $(GLCC) $(GLO_)gdevmd2k.$(OBJ) $(C_) $(CONTRIBSRC)gdevmd2k.c
-
-
-###--------------- IBM Omni Driver Framework --------------------------###
-
-epclr_h1=$(CONTRIBSRC)defs.h
-
-$(DD)omni.dev : $(GLOBJ)gomni.$(OBJ) $(DD)page.dev
- $(SETPDEV) $(DD)omni $(GLOBJ)gomni.$(OBJ)
-
-$(GLOBJ)gomni.$(OBJ) : $(CONTRIBSRC)gomni.c $(epclr_h1) $(PDEVH)
- $(GLCC) $(GLO_)gomni.$(OBJ) $(C_) $(CONTRIBSRC)gomni.c
-
-### ----------------- The Okidata OkiPage 4w+ device ------------------- ###
-
-oki4w_=$(GLOBJ)gdevop4w.$(OBJ)
-$(DD)oki4w.dev : $(oki4w_) $(DD)page.dev
- $(SETPDEV) $(DD)oki4w $(oki4w_)
-
-# Author: Ivan Schreter (ivan@shadow.sk)
-# Printer: Okidata OkiPage 4w+
-$(GLOBJ)gdevop4w.$(OBJ) : $(CONTRIBSRC)gdevop4w.c $(PDEVH)
- $(GLCC) $(GLO_)gdevop4w.$(OBJ) $(C_) $(CONTRIBSRC)gdevop4w.c
-
-
-### ---------------- OpenPrinting Vector Printer Driver ---------------- ###
-### ###
-OPVP_DIR=$(CONTRIBSRC)opvp
-OPVP_SRC=$(OPVP_DIR)$(D)
-OPVP_OPT=-DGS_VERSION_MAJOR=$(GS_VERSION_MAJOR)
-
-opvp_=$(GLOBJ)gdevopvp.$(OBJ)
-
-$(GLOBJ)gdevopvp.$(OBJ) : $(OPVP_SRC)gdevopvp.c $(OPVP_SRC)opvp_common.h\
- $(PDEVH)
- $(GLCC) $(GLO_)gdevopvp.$(OBJ) $(OPVP_OPT) $(C_) $(OPVP_SRC)gdevopvp.c
-
-$(DD)opvp.dev : $(opvp_) $(DD)page.dev
- $(SETPDEV) $(DD)opvp $(opvp_)
-
-$(DD)oprp.dev : $(opvp_) $(DD)page.dev
- $(SETPDEV) $(DD)oprp $(opvp_)
-
-
-### Driver "pcl3" for various PCL-3+ printers #################################
-#
-# Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-# Germany, e-mail: Martin.Lottermoser@t-online.de.
-#
-# Read the file README in the pcl3 distribution for general installation
-# instructions. If you don't have a distribution, visit
-# http://home.t-online.de/home/Martin.Lottermoser/pcl3.html.
-#
-# If you are including both, hpdj and pcl3, in the compilation, you should
-# disable the rules for pclcomp.$(OBJ) and pagecount.$(OBJ) in the hpdj
-# section. The versions of these files contained in the pcl3 distribution are
-# binary compatible with what hpdj 2.6 expects.
-#
-# You can add compilation options to the variable "pcl3_options" below.
-#
-# NDEBUG
-# Define this to remove certain runtime checks from the code which might
-# then become slightly faster. Don't define this for pcl3 beta releases
-# or ghostscript test releases.
-#
-# PCL3_MEDIA_FILE
-# Define this to be a C string containing the absolute path name of a
-# media configuration file if you want the "unspec" subdevice to use this
-# file instead of its default HP DeskJet 850C/855C/870C/890C media
-# configuration. An example definition for UNIX systems is:
-#
-# pcl3_options=-DPCL3_MEDIA_FILE='"$(gsdatadir)/pcl3.mcf"'
-#
-# A detailed description of the meaning and the syntax of this file can
-# be found in the reference page gs-pcl3(1). Briefly, it tells the
-# driver which media sizes your printer supports and how. You can
-# override this at run time with the option "-sMediaConfigurationFile".
-#
-# The variable "eprn_fs_options" is intended for optimization options used only
-# when compiling eprnfs.c. Choose the combination producing the fastest code.
-# You should leave this variable empty unless (a) you definitely know which
-# options produce the fastest code from eprnfs.c, and (b) ghostscript does not
-# use the same options anyway.
-#
-# You should also look at the section below containing the rules for the *.dev
-# files in order to find out which values you can add to the DEVICE_DEVS*
-# variables in the platform-specific make file. You should always add at least
-# the "pcl3" device but you may add others; the latter are shortcuts to the
-# subdevices of pcl3.
-#
-#
-# Remarks for Microsoft Windows
-# =============================
-# When compiling on Microsoft Windows and unless you are using Cygwin, you must
-# define the preprocessor symbol "EPRN_NO_PAGECOUNTFILE" and either remove the
-# dependency of pcl3 on pagecount.obj or replace pagecount.c with an empty
-# file.
-#
-###############################################################################
-
-# Compilation options
-pcl3_options=
-eprn_fs_options=
-
-# Version of the pcl3 rules: $Revision: 1.29 $.
-
-#==============================================================================
-
-# eprn rules
-# This is the part you need if you are developing another eprn-based driver.
-
-# Complete set of compilation options
-eprn_opts=-DGS_REVISION=$(GS_REVISION) $(pcl3_options)
-
-# Directory with eprn's source code as seen from the gs directory. The name
-# does not include a trailing path separator.
-eprn_dir=$(CONTRIBSRC)pcl3$(D)eprn
-# Same as above but with a separator
-eprn_src=$(eprn_dir)$(D)
-
-# List of all eprn object files
-eprn_=$(GLOBJ)gdeveprn.$(OBJ) $(GLOBJ)pagecount.$(OBJ) \
- $(GLOBJ)mediasize.$(OBJ) $(GLOBJ)eprnparm.$(OBJ) $(GLOBJ)eprnrend.$(OBJ) \
- $(GLOBJ)eprnfs.$(OBJ)
-
-# List of eprn headers needed when gdeveprn.h is included:
-eprn_headers=$(eprn_src)mediasize.h $(eprn_src)gdeveprn.h
-
-#------------------------------------------------------------------------------
-
-# Rules for individual files
-
-$(GLOBJ)mediasize.$(OBJ): $(eprn_src)mediasize.c $(eprn_src)mediasize.h
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)mediasize.c
-
-$(GLOBJ)gdeveprn.$(OBJ): $(eprn_src)gdeveprn.c $(eprn_headers) \
- $(eprn_src)pagecount.h
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)gdeveprn.c
-
-$(GLOBJ)eprnparm.$(OBJ): $(eprn_src)eprnparm.c $(eprn_headers)
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)eprnparm.c
-
-$(GLOBJ)eprnrend.$(OBJ): $(eprn_src)eprnrend.c $(eprn_headers)
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)eprnrend.c
-
-$(GLOBJ)eprnfs.$(OBJ): $(eprn_src)eprnfs.c $(eprn_headers)
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_fs_options) \
- $(eprn_src)eprnfs.c
-
-# File also used by hpdj:
-$(GLOBJ)pagecount.$(OBJ): $(eprn_src)pagecount.c $(eprn_src)pagecount.h
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)pagecount.c
-
-#==============================================================================
-
-# pcl3 rules
-
-# Complete set of compilation options
-pcl3_opts=-DGS_REVISION=$(GS_REVISION) -I$(eprn_dir) $(pcl3_options)
-
-# Root directory of pcl3 distribution as seen from the gs directory. The
-# variable includes a trailing path separator.
-pcl3_root=$(CONTRIBSRC)pcl3$(D)
-
-# Directory with pcl3's source code (name includes a trailing path separator)
-pcl3_src=$(pcl3_root)src$(D)
-
-# Headers used by most pcl3 files
-pcl3_headers=$(eprn_headers) \
- $(pcl3_src)pclgen.h $(pcl3_src)pclcap.h $(pcl3_src)pclsize.h
-
-# List of all object files needed for pcl3
-pcl3_=$(eprn_) $(GLOBJ)gdevpcl3.$(OBJ) $(GLOBJ)pclcap.$(OBJ) \
- $(GLOBJ)pclgen.$(OBJ) $(GLOBJ)pclcomp.$(OBJ) $(GLOBJ)pclsize.$(OBJ)
-
-#------------------------------------------------------------------------------
-
-# Rules for individual files
-
-$(GLOBJ)pclgen.$(OBJ): $(pcl3_src)pclgen.c $(pcl3_src)pclgen.h
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclgen.c
-
-$(GLOBJ)pclsize.$(OBJ): $(pcl3_src)pclsize.c $(eprn_src)mediasize.h \
- $(pcl3_src)pclsize.h $(pcl3_src)pclgen.h
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclsize.c
-
-$(GLOBJ)pclcap.$(OBJ): $(pcl3_src)pclcap.c $(pcl3_headers)
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclcap.c
-
-$(GLOBJ)gdevpcl3.$(OBJ): $(pcl3_src)gdevpcl3.c $(pcl3_headers)
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)gdevpcl3.c
-
-# File also used by hpdj:
-$(GLOBJ)pclcomp.$(OBJ): $(pcl3_src)pclcomp.c $(pcl3_src)pclgen.h
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclcomp.c
-
-#------------------------------------------------------------------------------
-
-# Device rules. The targets here (e.g., "$(DD)pcl3.dev") are the values you
-# can add to the DEVICE_DEVS* variables in the platform-specific make file.
-
-# The generic pcl3 device with selectable subdevices
-$(DD)pcl3.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)pcl3 $(pcl3_)
-
-# Fixed devices for specific printers
-$(DD)hpdjplus.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdjplus $(pcl3_)
-$(DD)hpdjportable.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdjportable $(pcl3_)
-$(DD)hpdj310.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj310 $(pcl3_)
-$(DD)hpdj320.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj320 $(pcl3_)
-$(DD)hpdj340.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj340 $(pcl3_)
-$(DD)hpdj400.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj400 $(pcl3_)
-$(DD)hpdj500.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj500 $(pcl3_)
-$(DD)hpdj500c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj500c $(pcl3_)
-$(DD)hpdj510.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj510 $(pcl3_)
-$(DD)hpdj520.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj520 $(pcl3_)
-$(DD)hpdj540.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj540 $(pcl3_)
-$(DD)hpdj550c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj550c $(pcl3_)
-$(DD)hpdj560c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj560c $(pcl3_)
-$(DD)hpdj600.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj600 $(pcl3_)
-$(DD)hpdj660c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj660c $(pcl3_)
-$(DD)hpdj670c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj670c $(pcl3_)
-$(DD)hpdj680c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj680c $(pcl3_)
-$(DD)hpdj690c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj690c $(pcl3_)
-$(DD)hpdj850c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj850c $(pcl3_)
-$(DD)hpdj855c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj855c $(pcl3_)
-$(DD)hpdj870c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj870c $(pcl3_)
-$(DD)hpdj890c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj890c $(pcl3_)
-$(DD)hpdj1120c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj1120c $(pcl3_)
-
-#------------------------------------------------------------------------------
-
-# The pcl3opts command.
-# This is deliberately not included in the normal compilation because (a) the
-# rule is unlikely to work and (b) the code is unlikely to compile on any but
-# UNIX systems.
-
-pcl3opts: $(BINDIR)$(D)pcl3opts$(XE)
-pcl3opts_=$(pcl3_src)pcl3opts.c $(pcl3_src)pclscan.c $(eprn_src)mediasize.c \
- $(pcl3_src)pclsize.c
-
-$(BINDIR)$(D)pcl3opts$(XE): $(pcl3opts_)
- $(CC_) -o $@ -I$(eprn_src) $(pcl3opts_)
- gencat $(GLOBJ)pcl3opts-en.cat $(pcl3_src)pcl3opts-en.msg
- #gencat $(GLOBJ)pcl3opts-de.cat $(pcl3_src)pcl3opts-de.msg
-
-#------------------------------------------------------------------------------
-
-# Installation rules (work only for UNIX). Note that the PostScript examples
-# and the PPD files are not copied.
-pcl3-install:
- for f in gs-pcl3 pcl3opts; do \
- $(INSTALL_DATA) $(pcl3_root)doc$(D)$$f.1 $(install_prefix)$(man1dir)/$$f.$(man1ext) \
- || exit 1; \
- $(INSTALL_DATA) $(pcl3_root)doc$(D)$$f.html $(install_prefix)$(docdir) || exit 1; done
- $(INSTALL_PROGRAM) $(BINDIR)$(D)pcl3opts$(XE) $(install_prefix)$(bindir)
-
-
-### ----------------- The Xerox XES printer device --------------------- ###
-
-xes_=$(GLOBJ)gdevxes.$(OBJ)
-$(DD)xes.dev : $(xes_) $(DD)page.dev
- $(SETPDEV) $(DD)xes $(xes_)
-
-# Author: Peter Flass (flass@lbdrscs.bitnet)
-# Printer: Xerox XES (2700, 3700, 4045, etc.)
-$(GLOBJ)gdevxes.$(OBJ) : $(CONTRIBSRC)gdevxes.c $(PDEVH)
- $(GLCC) $(GLO_)gdevxes.$(OBJ) $(C_) $(CONTRIBSRC)gdevxes.c
-
-#########################################################################
-### --------------------Japanese printer addons --------------------- ###
-#########################################################################
-
-JAPDIR=$(CONTRIBSRC)japanese
-JAPSRC=$(JAPDIR)$(D)
-
-### ----------------- The NEC PC-PR201 printer device ----------------- ###
-
-pr201_=$(GLOBJ)gdevp201.$(OBJ) $(GLOBJ)gdevprn.$(OBJ)
-
-$(DD)pr201.dev: $(pr201_)
- $(SETPDEV) $(DD)pr201 $(pr201_)
-
-$(DD)pr150.dev: $(pr201_)
- $(SETPDEV) $(DD)pr150 $(pr201_)
-
-$(DD)pr1000.dev: $(pr201_)
- $(SETPDEV) $(DD)pr1000 $(pr201_)
-
-$(DD)pr1000_4.dev: $(pr201_)
- $(SETPDEV) $(DD)pr1000_4 $(pr201_)
-
-$(GLO_)gdevp201.$(OBJ): $(JAPSRC)gdevp201.c $(PDEVH)
- $(GLCC) $(GLO_)gdevp201.$(OBJ) $(C_) $(JAPSRC)gdevp201.c
-
-### ----------------- The Star JJ-100 printer device ----------------- ###
-
-jj100_=$(GLOBJ)gdevj100.$(OBJ) $(GLOBJ)gdevprn.$(OBJ)
-
-$(DD)jj100.dev: $(jj100_)
- $(SETPDEV) $(DD)jj100 $(jj100_)
-
-$(GLOBJ)gdevj100.$(OBJ): $(JAPSRC)gdevj100.c $(PDEVH)
- $(GLCC) $(O_)$@ $(C_) $(JAPSRC)gdevj100.c
-
-### ----------------- The Canon BubbleJet BJ10v device ----------------- ###
-
-bj10v_=$(GLOBJ)gdev10v.$(OBJ) $(GLOBJ)gdevprn.$(OBJ)
-
-$(DD)bj10v.dev: $(bj10v_)
- $(SETPDEV) $(DD)bj10v $(bj10v_)
-
-$(DD)bj10vh.dev: $(bj10v_)
- $(SETPDEV) $(DD)bj10vh $(bj10v_)
-
-# Uncomment the following line if you are using MS-DOS on PC9801 series.
-
-$(GLOBJ)gdev10v.$(OBJ): $(JAPSRC)gdev10v.c $(PDEVH)
- $(GLCC) $(O_)$@ $(C_) $(JAPSRC)gdev10v.c
-# $(GLCC) -DPC9801 $(O_)$@ $(C_) $(JAPSRC)gdev10v.c
-
-
-### ------------------------- MAG file formats ------------------------- ###
-
-maguro_=$(GLOBJ)gdevmag.$(OBJ) $(GLOBJ)gdevpccm.$(OBJ) $(GLOBJ)gdevprn.$(OBJ)
-$(GLOBJ)gdevmag.$(OBJ): $(JAPSRC)gdevmag.c $(PDEVH)
- $(GLCC) $(O_)$@ $(C_) $(JAPSRC)gdevmag.c
-
-$(DD)mag16.dev: $(maguro_)
- $(SETDEV) $(DD)mag16 $(maguro_)
-
-$(DD)mag256.dev: $(maguro_)
- $(SETDEV) $(DD)mag256 $(maguro_)
-
-### ---------------- Dot matrix printer device ---------------- ###
-dmprt_=$(GLOBJ)gdevdmpr.$(OBJ) $(GLOBJ)dviprlib.$(OBJ) $(GLOBJ)gdevprn.$(OBJ)
-
-$(DD)dmprt.dev: $(dmprt_) $(DD)page.dev
- $(SETDEV) $(DD)dmprt $(dmprt_)
- $(ADDMOD) $(DD)dmprt -ps dmp_init
-
-$(GLOBJ)gdevdmpr.$(OBJ): $(JAPSRC)gdevdmpr.c $(JAPSRC)dviprlib.h $(PDEVH)
- $(GLCC) $(O_)$@ $(C_) $(JAPSRC)gdevdmpr.c
-
-$(GLOBJ)dviprlib.$(OBJ): $(JAPSRC)dviprlib.c $(JAPSRC)dviprlib.h
- $(GLCC) $(O_)$@ $(C_) $(JAPSRC)dviprlib.c
-
-extra-dmprt-install:
- $(INSTALL_DATA) $(JAPSRC)dmp_init.ps $(install_prefix)$(gsdatadir)$(D)lib || exit 1
- $(INSTALL_DATA) $(JAPSRC)dmp_site.ps $(install_prefix)$(gsdatadir)$(D)lib || exit 1
- $(INSTALL_DATA) $(JAPSRC)escp_24.src $(install_prefix)$(gsdatadir)$(D)lib || exit 1
-
-
-
-##
-## EPSON MachJet driver
-##
-
-mj700v2c_=$(GLOBJ)gdevmjc.$(OBJ) $(HPPCL)
-
-$(GLOBJ)gdevmjc.$(OBJ): $(JAPSRC)gdevmjc.c $(JAPSRC)gdevmjc.h $(PDEVH) $(gdevpcl_h)
- $(GLCC) -DA4 $(GLO_)gdevmjc.$(OBJ) $(C_) $(JAPSRC)gdevmjc.c
-
-$(DD)mj700v2c.dev: $(mj700v2c_) $(DD)page.dev
- $(SETPDEV) $(DD)mj700v2c $(mj700v2c_)
-
-$(DD)mj500c.dev: $(mj700v2c_) $(DD)page.dev
- $(SETPDEV) $(DD)mj500c $(mj700v2c_)
-
-$(DD)mj6000c.dev: $(mj700v2c_) $(DD)page.dev
- $(SETPDEV) $(DD)mj6000c $(mj700v2c_)
-
-$(DD)mj8000c.dev: $(mj700v2c_) $(DD)page.dev
- $(SETPDEV) $(DD)mj8000c $(mj700v2c_)
-
-### ----------------- The Fujitsu FMPR printer device ----------------- ###
-
-fmpr_=$(GLOBJ)gdevfmpr.$(OBJ) $(GLOBJ)gdevprn.$(OBJ)
-
-$(DD)fmpr.dev: $(fmpr_) $(DD)page.dev
- $(SETPDEV) $(DD)fmpr $(fmpr_)
-
-$(GLOBJ)gdevfmpr.$(OBJ): $(JAPSRC)gdevfmpr.c $(PDEVH)
- $(GLCC) $(GLO_)gdevfmpr.$(OBJ) $(C_) $(JAPSRC)gdevfmpr.c
-
-### --------------- The Fujitsu FMLBP-2xx printer device --------------- ###
-
-fmlbp_=$(GLOBJ)gdevfmlbp.$(OBJ) $(GLOBJ)gdevprn.$(OBJ)
-
-$(DD)fmlbp.dev: $(fmlbp_) $(DD)page.dev
- $(SETPDEV) $(DD)fmlbp $(fmlbp_)
-
-$(GLOBJ)gdevfmlbp.$(OBJ): $(JAPSRC)gdevfmlbp.c $(PDEVH)
- $(GLCC) -DFMLBP_NOADJUST_MARGIN $(O_)$@ $(C_) $(JAPSRC)gdevfmlbp.c
-
-### ------ The OKI MICROLINE620CL (IPL) printer device ------- ###
-#
-# by N.Tagawa
-#
-# $Id: gdevml6.mak,v 1.2 1998/03/16 13:32:33 tagawa Exp $
-#
-
-ml6_=$(GLOBJ)gdevml6.$(OBJ) $(GLOBJ)gdevprn.$(OBJ)
-
-$(DD)ml600.dev: $(ml6_) $(DD)page.dev
- $(SETPDEV) $(DD)ml600 $(ml6_)
-
-$(GLOBJ)gdevml6.$(OBJ): $(JAPSRC)gdevml6.c $(PDEVH)
- $(GLCC) $(O_)$@ $(C_) $(JAPSRC)gdevml6.c
-
-
-#----------------------------------------------------------------------#
-
-lbp3x0_=$(GLOBJ)gdevlbp3.$(OBJ)
-
-$(DD)lbp310.dev:$(lbp3x0_) $(DD)page.dev
- $(SETPDEV) $(DD)lbp310 $(lbp3x0_)
-
-$(DD)lbp320.dev:$(lbp3x0_) $(DD)page.dev
- $(SETPDEV) $(DD)lbp320 $(lbp3x0_)
-
-$(GLOBJ)gdevlbp3.$(OBJ): $(JAPSRC)gdevlbp3.c $(PDEVH)
- $(GLCC) $(O_)$@ $(C_) $(JAPSRC)gdevlbp3.c
-
-### --- The NEC NPDL language printer device ------ ###
-
-npdl_=$(GLOBJ)gdevnpdl.$(OBJ) $(GLOBJ)gdevlprn.$(OBJ)
-
-$(GLOBJ)gdevnpdl.$(OBJ): $(JAPSRC)gdevnpdl.c $(LIPS_SRC)gdevlprn.h $(PDEVH)
- $(GLCC) -DA4 $(GLO_)gdevnpdl.$(OBJ) $(LIPS_OPT) $(C_) $(JAPSRC)gdevnpdl.c
-
-$(DD)npdl.dev: $(npdl_) $(DD)page.dev
- $(SETPDEV) $(DD)npdl $(npdl_)
-
-### ------- EPSON ESC/Page printer device ----------------- ###
-
-escpage_=$(GLOBJ)gdevespg.$(OBJ) $(GLOBJ)gdevlprn.$(OBJ) $(GLOBJ)gdevlips.$(OBJ)
-
-$(GLOBJ)gdevespg.$(OBJ): $(JAPSRC)gdevespg.c $(LIPS_SRC)gdevlprn.h $(PDEVH)
- $(GLCC) -DA4 $(GLO_)gdevespg.$(OBJ) $(LIPS_OPT) $(C_) $(JAPSRC)gdevespg.c
-
-$(DD)escpage.dev: $(escpage_) $(DD)page.dev
- $(SETPDEV) $(DD)escpage $(escpage_)
-
-$(DD)lp2000.dev: $(escpage_) $(DD)page.dev
- $(SETPDEV) $(DD)lp2000 $(escpage_)
-
-### --- The RICOH RPDL language printer device ------ ###
-
-rpdl_=$(GLOBJ)gdevrpdl.$(OBJ) $(GLOBJ)gdevlprn.$(OBJ)
-$(GLOBJ)gdevrpdl.$(OBJ): $(JAPSRC)gdevrpdl.c $(LIPS_SRC)gdevlprn.h $(PDEVH)
- $(GLCC) $(GLO_)gdevrpdl.$(OBJ) $(LIPS_OPT) $(C_) $(JAPSRC)gdevrpdl.c
-
-$(DD)rpdl.dev: $(rpdl_) $(DD)page.dev
- $(SETPDEV) $(DD)rpdl $(rpdl_)
-
-### ---------- RICOH RPDL IV(600dpi) printer devices ---------- ###
-#rpdl_=$(GLOBJ)gdevrpdl.$(OBJ)
-#$(GLOBJ)gdevrpdl.$(OBJ) : $(JAPSRC)gdevrpdl.c
-# $(GLCC) $(GLO_)gdevrpdl.$(OBJ) $(C_) $(JAPSRC)gdevrpdl.c
-#
-#$(DD)nx100f.dev: $(rpdl_) $(DD)page.dev
-# $(SETPDEV2) $(DD)nx100f $(rpdl_)
-#
-#$(DD)nx100v.dev: $(rpdl_) $(DD)page.dev
-# $(SETPDEV2) $(DD)nx100v $(rpdl_)
-
-### ------------ The ALPS Micro Dry printer devices ------------ ###
-
-alps_=$(GLOBJ)gdevalps.$(OBJ)
-
-$(DD)md50Mono.dev: $(alps_) $(DD)page.dev
- $(SETPDEV) $(DD)md50Mono $(alps_)
-
-$(DD)md50Eco.dev: $(alps_) $(DD)page.dev
- $(SETPDEV) $(DD)md50Eco $(alps_)
-
-$(DD)md1xMono.dev: $(alps_) $(DD)page.dev
- $(SETPDEV) $(DD)md1xMono $(alps_)
-
-$(GLOBJ)gdevalps.$(OBJ): $(JAPSRC)gdevalps.c $(PDEVH)
- $(GLCC) $(O_)$@ $(C_) $(JAPSRC)gdevalps.c
-
-#########################################################################
-#########################################################################
-
-### ----------------- Additional .upp files ---------------- ###
-
-extra-upp-install:
- for f in $(CONTRIBSRC)uniprint$(D)*.upp; do \
- $(INSTALL_DATA) $$f $(install_prefix)$(gsdatadir)$(D)lib || exit 1; \
- done
-
-### ------------ Build/Install special features ------------ ###
-
-install-contrib-extras: extra-dmprt-install extra-upp-install
diff --git a/gs/contrib/cups/cups.mak b/gs/contrib/cups/cups.mak
deleted file mode 100644
index bfa66f8d9..000000000
--- a/gs/contrib/cups/cups.mak
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# "$Id: cups.mak,v 1.1.2.4 2003/07/20 22:54:43 mike Exp $"
-#
-# CUPS driver makefile for Ghostscript.
-#
-# Copyright 2001-2005 by Easy Software Products.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-
-### ----------------- CUPS Ghostscript Driver ---------------------- ###
-
-cups_= $(GLOBJ)gdevcups.$(OBJ)
-
-CUPSSERVER= $(install_prefix)`cups-config --serverbin`
-CUPSCONFIG= $(install_prefix)`cups-config --serverroot`
-CUPSDATA= $(install_prefix)`cups-config --datadir`
-
-$(DD)cups.dev: $(cups_) $(GLD)page.dev
- $(ADDMOD) $(DD)cups -lib cupsimage -lib cups
- $(SETPDEV2) $(DD)cups $(cups_)
-
-$(GLOBJ)gdevcups.$(OBJ): contrib/cups/gdevcups.c $(PDEVH)
- $(GLCC) $(GLO_)gdevcups.$(OBJ) $(C_) contrib/cups/gdevcups.c
-
-install: install-cups
-
-install-cups:
- -mkdir -p $(CUPSSERVER)/filter
- $(INSTALL_PROGRAM) contrib/cups/pstoraster $(CUPSSERVER)/filter
- $(INSTALL_PROGRAM) contrib/cups/pstopxl $(CUPSSERVER)/filter
- -mkdir -p $(CUPSCONFIG)
- $(INSTALL_DATA) contrib/cups/pstoraster.convs $(CUPSCONFIG)
- -mkdir -p $(CUPSDATA)/model
- $(INSTALL_DATA) contrib/cups/pxlcolor.ppd $(CUPSDATA)/model
- $(INSTALL_DATA) contrib/cups/pxlmono.ppd $(CUPSDATA)/model
-
-
-#
-# End of "$Id: cups.mak,v 1.1.2.4 2003/07/20 22:54:43 mike Exp $".
-#
diff --git a/gs/contrib/cups/gdevcups.c b/gs/contrib/cups/gdevcups.c
deleted file mode 100644
index 5a66118a6..000000000
--- a/gs/contrib/cups/gdevcups.c
+++ /dev/null
@@ -1,4726 +0,0 @@
-/*
- * "$Id: gdevcups.c,v 1.43.2.23 2004/06/29 13:15:10 mike Exp $"
- *
- * GNU Ghostscript raster output driver for the Common UNIX Printing
- * System (CUPS).
- *
- * Copyright 1993-2006 by Easy Software Products.
- *
- * These coded instructions, statements, and computer programs are the
- * property of Easy Software Products and are protected by Federal
- * copyright law. Distribution and use rights are outlined in the file
- * "LICENSE.txt" which should have been included with this file. If this
- * file is missing or damaged please contact Easy Software Products
- * at:
- *
- * Attn: CUPS Licensing Information
- * Easy Software Products
- * 44141 Airport View Drive, Suite 204
- * Hollywood, Maryland 20636 USA
- *
- * Voice: (301) 373-9600
- * EMail: cups-info@cups.org
- * WWW: http://www.cups.org/
- *
- * This code and any derivative of it may be used and distributed
- * freely under the terms of the GNU General Public License when
- * used with GNU Ghostscript or its derivatives. Use of the code
- * (or any derivative of it) with software other than GNU
- * GhostScript (or its derivatives) is governed by the CUPS license
- * agreement.
- *
- * Contents:
- *
- * cups_close() - Close the output file.
- * cups_decode_color() - Decode a color value.
- * cups_encode_color() - Encode a color value.
- * cups_get_color_mapping_procs()
- * - Get the list of color mapping procedures.
- * cups_get_matrix() - Generate the default page matrix.
- * cups_get_params() - Get pagedevice parameters.
- * cups_get_space_params() - Get space parameters from the RIP_CACHE env var.
- * cups_map_cielab() - Map CIE Lab transformation...
- * cups_map_cmyk() - Map a CMYK color value to device colors.
- * cups_map_gray() - Map a grayscale value to device colors.
- * cups_map_rgb() - Map a RGB color value to device colors.
- * cups_map_cmyk_color() - Map a CMYK color to a color index.
- * cups_map_color_rgb() - Map a color index to an RGB color.
- * cups_map_rgb_color() - Map an RGB color to a color index. We map the
- * RGB color to the output colorspace & bits (we
- * figure out the format when we output a page).
- * cups_open() - Open the output file and initialize things.
- * cups_print_pages() - Send one or more pages to the output file.
- * cups_put_params() - Set pagedevice parameters.
- * cups_set_color_info() - Set the color information structure based on
- * the required output.
- * cups_sync_output() - Keep the user informed of our status...
- * cups_print_chunked() - Print a page of chunked pixels.
- * cups_print_banded() - Print a page of banded pixels.
- * cups_print_planar() - Print a page of planar pixels.
- */
-
-/*
- * Include necessary headers...
- */
-
-#include "std.h" /* to stop stdlib.h redefining types */
-#include "gdevprn.h"
-#include "gsparam.h"
-#include "gsexit.h"
-#include "arch.h"
-
-#include <stdlib.h>
-#include <ctype.h>
-#include <cups/raster.h>
-#include <cups/ppd.h>
-#include <math.h>
-
-#undef private
-#define private
-
-
-/*
- * Check if we are compiling against CUPS 1.2. If so, enable
- * certain extended attributes and use a different page header
- * structure and write function...
- */
-
-#ifdef CUPS_RASTER_SYNCv1
-# define cups_page_header_t cups_page_header2_t
-# define cupsRasterWriteHeader cupsRasterWriteHeader2
-#else
-/* The RGBW colorspace is not defined until CUPS 1.2... */
-# define CUPS_CSPACE_RGBW 17
-#endif /* CUPS_RASTER_SYNCv1 */
-
-
-/*
- * Newer versions of Ghostscript don't provide gs_exit() function anymore.
- * It has been renamed to gs_to_exit()...
- */
-
-#ifdef dev_t_proc_encode_color
-# define gs_exit gs_to_exit
-#endif /* dev_t_proc_encode_color */
-
-
-/*
- * CIE XYZ color constants...
- */
-
-#define D65_X (0.412453 + 0.357580 + 0.180423)
-#define D65_Y (0.212671 + 0.715160 + 0.072169)
-#define D65_Z (0.019334 + 0.119193 + 0.950227)
-
-
-/*
- * Size of a tile in pixels...
- */
-
-#define CUPS_TILE_SIZE 256
-
-
-/*
- * Size of profile LUTs...
- */
-
-#ifdef dev_t_proc_encode_color
-# define CUPS_MAX_VALUE frac_1
-#else
-# define CUPS_MAX_VALUE gx_max_color_value
-#endif /* dev_t_proc_encode_color */
-
-
-/*
- * Macros...
- */
-
-#define x_dpi (pdev->HWResolution[0])
-#define y_dpi (pdev->HWResolution[1])
-#define cups ((gx_device_cups *)pdev)
-
-/*
- * Macros from <macros.h>; we can't include <macros.h> because it also
- * defines DEBUG, one of our flags to insert various debugging code.
- */
-
-#ifndef max
-# define max(a,b) ((a)<(b) ? (b) : (a))
-#endif /* !max */
-
-#ifndef min
-# define min(a,b) ((a)>(b) ? (b) : (a))
-#endif /* !min */
-
-#ifndef abs
-# define abs(x) ((x)>=0 ? (x) : -(x))
-#endif /* !abs */
-
-
-/*
- * Procedures
- */
-
-private dev_proc_close_device(cups_close);
-private dev_proc_get_initial_matrix(cups_get_matrix);
-private int cups_get_params(gx_device *, gs_param_list *);
-private dev_proc_open_device(cups_open);
-private int cups_print_pages(gx_device_printer *, FILE *, int);
-private int cups_put_params(gx_device *, gs_param_list *);
-private void cups_set_color_info(gx_device *);
-private dev_proc_sync_output(cups_sync_output);
-private prn_dev_proc_get_space_params(cups_get_space_params);
-
-#ifdef dev_t_proc_encode_color
-private cm_map_proc_gray(cups_map_gray);
-private cm_map_proc_rgb(cups_map_rgb);
-private cm_map_proc_cmyk(cups_map_cmyk);
-private dev_proc_decode_color(cups_decode_color);
-private dev_proc_encode_color(cups_encode_color);
-private dev_proc_get_color_mapping_procs(cups_get_color_mapping_procs);
-
-static const gx_cm_color_map_procs cups_color_mapping_procs =
-{
- cups_map_gray,
- cups_map_rgb,
- cups_map_cmyk
-};
-#else
-private dev_proc_map_cmyk_color(cups_map_cmyk_color);
-private dev_proc_map_color_rgb(cups_map_color_rgb);
-private dev_proc_map_rgb_color(cups_map_rgb_color);
-#endif /* dev_t_proc_encode_color */
-
-
-/*
- * The device descriptors...
- */
-
-typedef struct gx_device_cups_s
-{
- gx_device_common; /* Standard GhostScript device stuff */
- gx_prn_device_common; /* Standard printer device stuff */
- int page; /* Page number */
- cups_raster_t *stream; /* Raster stream */
- cups_page_header_t header; /* PostScript page device info */
- int landscape; /* Non-zero if this is landscape */
-} gx_device_cups;
-
-private gx_device_procs cups_procs =
-{
- cups_open,
- cups_get_matrix,
- cups_sync_output,
- gdev_prn_output_page,
- cups_close,
-#ifdef dev_t_proc_encode_color
- NULL, /* map_rgb_color */
- NULL, /* map_color_rgb */
-#else
- cups_map_rgb_color,
- cups_map_color_rgb,
-#endif /* dev_t_proc_encode_color */
- NULL, /* fill_rectangle */
- NULL, /* tile_rectangle */
- NULL, /* copy_mono */
- NULL, /* copy_color */
- NULL, /* draw_line */
- gx_default_get_bits,
- cups_get_params,
- cups_put_params,
-#ifdef dev_t_proc_encode_color
- NULL, /* map_cmyk_color */
-#else
- cups_map_cmyk_color,
-#endif /* dev_t_proc_encode_color */
- NULL, /* get_xfont_procs */
- NULL, /* get_xfont_device */
- NULL, /* map_rgb_alpha_color */
- gx_page_device_get_page_device,
- NULL, /* get_alpha_bits */
- NULL, /* copy_alpha */
- NULL, /* get_band */
- NULL, /* copy_rop */
- NULL, /* fill_path */
- NULL, /* stroke_path */
- NULL, /* fill_mask */
- NULL, /* fill_trapezoid */
- NULL, /* fill_parallelogram */
- NULL, /* fill_triangle */
- NULL, /* draw_thin_line */
- NULL, /* begin_image */
- NULL, /* image_data */
- NULL, /* end_image */
- NULL, /* strip_tile_rectangle */
- NULL /* strip_copy_rop */
-#ifdef dev_t_proc_encode_color
- ,
- NULL, /* get_clipping_box */
- NULL, /* begin_typed_image */
- NULL, /* get_bits_rectangle */
- NULL, /* map_color_rgb_alpha */
- NULL, /* create_compositor */
- NULL, /* get_hardware_params */
- NULL, /* text_begin */
- NULL, /* finish_copydevice */
- NULL, /* begin_transparency_group */
- NULL, /* end_transparency_group */
- NULL, /* begin_transparency_mask */
- NULL, /* end_transparency_mask */
- NULL, /* discard_transparency_layer */
- cups_get_color_mapping_procs,
- NULL, /* get_color_comp_index */
- cups_encode_color,
- cups_decode_color
-#endif /* dev_t_proc_encode_color */
-};
-
-#define prn_device_body_copies(dtype, procs, dname, w10, h10, xdpi, ydpi, lo, to, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_pages)\
- std_device_full_body_type(dtype, &procs, dname, &st_device_printer,\
- (int)((long)(w10) * (xdpi) / 10),\
- (int)((long)(h10) * (ydpi) / 10),\
- xdpi, ydpi,\
- ncomp, depth, mg, mc, dg, dc,\
- -(lo) * (xdpi), -(to) * (ydpi),\
- (lm) * 72.0, (bm) * 72.0,\
- (rm) * 72.0, (tm) * 72.0\
- ),\
- prn_device_body_copies_rest_(print_pages)
-
-gx_device_cups gs_cups_device =
-{
- prn_device_body_copies(gx_device_cups,/* type */
- cups_procs, /* procedures */
- "cups", /* device name */
- 85, /* initial width */
- 110, /* initial height */
- 100, /* initial x resolution */
- 100, /* initial y resolution */
- 0, /* initial left offset */
- 0, /* initial top offset */
- 0, /* initial left margin */
- 0, /* initial bottom margin */
- 0, /* initial right margin */
- 0, /* initial top margin */
- 1, /* number of color components */
- 1, /* number of color bits */
- 1, /* maximum gray value */
- 0, /* maximum color value */
- 2, /* number of gray values */
- 0, /* number of color values */
- cups_print_pages),
- /* print procedure */
- 0, /* page */
- NULL, /* stream */
- { /* header */
- "", /* MediaClass */
- "", /* MediaColor */
- "", /* MediaType */
- "", /* OutputType */
- 0, /* AdvanceDistance */
- CUPS_ADVANCE_NONE, /* AdvanceMedia */
- CUPS_FALSE, /* Collate */
- CUPS_CUT_NONE, /* CutMedia */
- CUPS_FALSE, /* Duplex */
- { 100, 100 }, /* HWResolution */
- { 0, 0, 612, 792 }, /* ImagingBoundingBox */
- CUPS_FALSE, /* InsertSheet */
- CUPS_JOG_NONE, /* Jog */
- CUPS_EDGE_TOP, /* LeadingEdge */
- { 0, 0 }, /* Margins */
- CUPS_FALSE, /* ManualFeed */
- 0, /* MediaPosition */
- 0, /* MediaWeight */
- CUPS_FALSE, /* MirrorPrint */
- CUPS_FALSE, /* NegativePrint */
- 1, /* NumCopies */
- CUPS_ORIENT_0, /* Orientation */
- CUPS_FALSE, /* OutputFaceUp */
- { 612, 792 }, /* PageSize */
- CUPS_FALSE, /* Separations */
- CUPS_FALSE, /* TraySwitch */
- CUPS_FALSE, /* Tumble */
- 850, /* cupsWidth */
- 1100, /* cupsHeight */
- 0, /* cupsMediaType */
- 1, /* cupsBitsPerColor */
- 1, /* cupsBitsPerPixel */
- 107, /* cupsBytesPerLine */
- CUPS_ORDER_CHUNKED, /* cupsColorOrder */
- CUPS_CSPACE_K, /* cupsColorSpace */
- 0, /* cupsCompression */
- 0, /* cupsRowCount */
- 0, /* cupsRowFeed */
- 0 /* cupsRowStep */
- }
-};
-
-/*
- * Globals...
- */
-
-#ifdef GX_COLOR_INDEX_TYPE
-static gx_color_value cupsDecodeLUT[65536];
- /* Output color to RGB value LUT */
-#else
-static gx_color_value cupsDecodeLUT[256];
- /* Output color to RGB value LUT */
-#endif /* GX_COLOR_INDEX_TYPE */
-static unsigned short cupsEncodeLUT[gx_max_color_value + 1];
- /* RGB value to output color LUT */
-
-static ppd_file_t *cupsPPD = 0; /* PPD file for this device */
-static char *cupsProfile = NULL;
- /* Current simple color profile string */
-static int cupsHaveProfile = 0;
- /* Has a color profile been defined? */
-static int cupsMatrix[3][3][CUPS_MAX_VALUE + 1];
- /* Color transform matrix LUT */
-static int cupsDensity[CUPS_MAX_VALUE + 1];
- /* Density LUT */
-static unsigned char cupsRevLower1[16] =
- { /* Lower 1-bit reversal table */
- 0x00, 0x08, 0x04, 0x0c, 0x02, 0x0a, 0x06, 0x0e,
- 0x01, 0x09, 0x05, 0x0d, 0x03, 0x0b, 0x07, 0x0f
- },
- cupsRevUpper1[16] =
- { /* Upper 1-bit reversal table */
- 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
- 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0
- },
- cupsRevLower2[16] =
- { /* Lower 2-bit reversal table */
- 0x00, 0x04, 0x08, 0x0c, 0x01, 0x05, 0x09, 0x0d,
- 0x02, 0x06, 0x0a, 0x0e, 0x03, 0x07, 0x0b, 0x0f
- },
- cupsRevUpper2[16] =
- { /* Upper 2-bit reversal table */
- 0x00, 0x40, 0x80, 0xc0, 0x10, 0x50, 0x90, 0xd0,
- 0x20, 0x60, 0xa0, 0xe0, 0x30, 0x70, 0xb0, 0xf0
- };
-
-
-/*
- * Local functions...
- */
-
-static double cups_map_cielab(double, double);
-static void cups_print_chunked(gx_device_printer *, unsigned char *,
- unsigned char *, int);
-static void cups_print_banded(gx_device_printer *, unsigned char *,
- unsigned char *, int);
-static void cups_print_planar(gx_device_printer *, unsigned char *,
- unsigned char *, int);
-
-/*static void cups_set_margins(gx_device *);*/
-
-
-/*
- * 'cups_close()' - Close the output file.
- */
-
-private int
-cups_close(gx_device *pdev) /* I - Device info */
-{
- fprintf(stderr, "DEBUG2: cups_close(%p)\n", pdev);
-
- if (cups->stream != NULL)
- {
- cupsRasterClose(cups->stream);
- cups->stream = NULL;
- }
-
-#if 0 /* Can't do this here because put_params() might close the device */
- if (cupsPPD != NULL)
- {
- ppdClose(cupsPPD);
- cupsPPD = NULL;
- }
-
- if (cupsProfile != NULL)
- {
- free(cupsProfile);
- cupsProfile = NULL;
- }
-#endif /* 0 */
-
- return (gdev_prn_close(pdev));
-}
-
-
-#ifdef dev_t_proc_encode_color
-/*
- * 'cups_decode_color()' - Decode a color value.
- */
-
-private int /* O - Status (0 = OK) */
-cups_decode_color(gx_device *pdev, /* I - Device info */
- gx_color_index ci, /* I - Color index */
- gx_color_value *cv) /* O - Colors */
-{
- int i; /* Looping var */
- int shift; /* Bits to shift */
- int mask; /* Bits to mask */
-
-
- if (cups->header.cupsColorSpace == CUPS_CSPACE_KCMYcm &&
- cups->header.cupsBitsPerColor == 1)
- {
- /*
- * KCMYcm data is represented internally by Ghostscript as CMYK...
- */
-
- cv[0] = (ci & 0x20) ? frac_1 : frac_0;
- cv[1] = (ci & 0x12) ? frac_1 : frac_0;
- cv[2] = (ci & 0x09) ? frac_1 : frac_0;
- cv[3] = (ci & 0x04) ? frac_1 : frac_0;
- }
- else
- {
- shift = cups->header.cupsBitsPerColor;
- mask = (1 << shift) - 1;
-
- for (i = cups->color_info.num_components - 1; i > 0; i --, ci >>= shift)
- cv[i] = cupsDecodeLUT[ci & mask];
-
- cv[0] = cupsDecodeLUT[ci & mask];
- }
-
- return (0);
-}
-
-
-/*
- * 'cups_encode_color()' - Encode a color value.
- */
-
-private gx_color_index /* O - Color index */
-cups_encode_color(gx_device *pdev,
- /* I - Device info */
- const gx_color_value *cv)
- /* I - Colors */
-{
- int i; /* Looping var */
- gx_color_index ci; /* Color index */
- int shift; /* Bits to shift */
-
-
- /*
- * Encode the color index...
- */
-
- shift = cups->header.cupsBitsPerColor;
-
- for (ci = cupsEncodeLUT[cv[0]], i = 1;
- i < cups->color_info.num_components;
- i ++)
- ci = (ci << shift) | cupsEncodeLUT[cv[i]];
-
-#ifdef DEBUG
- fprintf(stderr, "DEBUG2: cv[0]=%d -> %llx\n", cv[0], ci);
-#endif /* DEBUG */
-
- /*
- * Handle 6-color output...
- */
-
- if (cups->header.cupsColorSpace == CUPS_CSPACE_KCMYcm &&
- cups->header.cupsBitsPerColor == 1)
- {
- /*
- * Welcome to hackville, where we map CMYK data to the
- * light inks in draft mode... Map blue to light magenta and
- * cyan and green to light cyan and yellow...
- */
-
- ci <<= 2; /* Leave room for light inks */
-
- if (ci == 0x18) /* Blue */
- ci = 0x11; /* == cyan + light magenta */
- else if (ci == 0x14) /* Green */
- ci = 0x06; /* == light cyan + yellow */
- }
-
- /*
- * Range check the return value...
- */
-
- if (ci == gx_no_color_index)
- ci --;
-
- /*
- * Return the color index...
- */
-
- return (ci);
-}
-
-
-/*
- * 'cups_get_color_mapping_procs()' - Get the list of color mapping procedures.
- */
-
-private const gx_cm_color_map_procs * /* O - List of device procedures */
-cups_get_color_mapping_procs(const gx_device *pdev)
- /* I - Device info */
-{
- return (&cups_color_mapping_procs);
-}
-#endif /* dev_t_proc_encode_color */
-
-
-/*
- * 'cups_get_matrix()' - Generate the default page matrix.
- */
-
-private void
-cups_get_matrix(gx_device *pdev, /* I - Device info */
- gs_matrix *pmat) /* O - Physical transform matrix */
-{
- fprintf(stderr, "DEBUG2: cups_get_matrix(%p, %p)\n", pdev, pmat);
-
- /*
- * Set the raster width and height...
- */
-
- cups->header.cupsWidth = cups->width;
- cups->header.cupsHeight = cups->height;
-
- /*
- * Set the transform matrix...
- */
-
- fprintf(stderr, "DEBUG: cups->header.Duplex = %d\n", cups->header.Duplex);
- fprintf(stderr, "DEBUG: cups->page = %d\n", cups->page);
-
- if (cupsPPD)
- {
- fprintf(stderr, "DEBUG: cupsPPD = %p\n", cupsPPD);
- fprintf(stderr, "DEBUG: cupsPPD->flip_duplex = %d\n", cupsPPD->flip_duplex);
- }
-
- if (cups->landscape)
- {
- /*
- * Do landscape orientation...
- */
-
- if (cups->header.Duplex && !cups->header.Tumble &&
- cupsPPD && cupsPPD->flip_duplex && !(cups->page & 1))
- {
- pmat->xx = 0.0;
- pmat->xy = (float)cups->header.HWResolution[0] / 72.0;
- pmat->yx = -(float)cups->header.HWResolution[1] / 72.0;
- pmat->yy = 0.0;
- pmat->tx = -(float)cups->header.HWResolution[0] * pdev->HWMargins[2] / 72.0;
- pmat->ty = (float)cups->header.HWResolution[1] *
- ((float)cups->header.PageSize[0] - pdev->HWMargins[3]) / 72.0;
- }
- else
- {
- pmat->xx = 0.0;
- pmat->xy = (float)cups->header.HWResolution[0] / 72.0;
- pmat->yx = (float)cups->header.HWResolution[1] / 72.0;
- pmat->yy = 0.0;
- pmat->tx = -(float)cups->header.HWResolution[0] * pdev->HWMargins[0] / 72.0;
- pmat->ty = -(float)cups->header.HWResolution[1] * pdev->HWMargins[1] / 72.0;
- }
- }
- else if (cups->header.Duplex && !cups->header.Tumble &&
- cupsPPD && cupsPPD->flip_duplex && !(cups->page & 1))
- {
- pmat->xx = (float)cups->header.HWResolution[0] / 72.0;
- pmat->xy = 0.0;
- pmat->yx = 0.0;
- pmat->yy = (float)cups->header.HWResolution[1] / 72.0;
- pmat->tx = -(float)cups->header.HWResolution[0] * pdev->HWMargins[2] / 72.0;
- pmat->ty = -(float)cups->header.HWResolution[1] * pdev->HWMargins[3] / 72.0;
- }
- else
- {
- pmat->xx = (float)cups->header.HWResolution[0] / 72.0;
- pmat->xy = 0.0;
- pmat->yx = 0.0;
- pmat->yy = -(float)cups->header.HWResolution[1] / 72.0;
- pmat->tx = -(float)cups->header.HWResolution[0] * pdev->HWMargins[0] / 72.0;
- pmat->ty = (float)cups->header.HWResolution[1] *
- ((float)cups->header.PageSize[1] - pdev->HWMargins[3]) / 72.0;
- }
-
-#ifdef CUPS_RASTER_SYNCv1
- if (cups->header.cupsBorderlessScalingFactor > 1.0)
- {
- pmat->xx *= cups->header.cupsBorderlessScalingFactor;
- pmat->xy *= cups->header.cupsBorderlessScalingFactor;
- pmat->yx *= cups->header.cupsBorderlessScalingFactor;
- pmat->yy *= cups->header.cupsBorderlessScalingFactor;
- pmat->tx *= cups->header.cupsBorderlessScalingFactor;
- pmat->ty *= cups->header.cupsBorderlessScalingFactor;
- }
-#endif /* CUPS_RASTER_SYNCv1 */
-
- fprintf(stderr, "DEBUG: width = %d, height = %d\n", cups->width,
- cups->height);
- fprintf(stderr, "DEBUG: PageSize = [ %d %d ], HWResolution = [ %d %d ]\n",
- cups->header.PageSize[0], cups->header.PageSize[1],
- cups->header.HWResolution[0], cups->header.HWResolution[1]);
- fprintf(stderr, "DEBUG: HWMargins = [ %.3f %.3f %.3f %.3f ]\n",
- pdev->HWMargins[0], pdev->HWMargins[1], pdev->HWMargins[2],
- pdev->HWMargins[3]);
- fprintf(stderr, "DEBUG: matrix = [ %.3f %.3f %.3f %.3f %.3f %.3f ]\n",
- pmat->xx, pmat->xy, pmat->yx, pmat->yy, pmat->tx, pmat->ty);
-}
-
-
-/*
- * 'cups_get_params()' - Get pagedevice parameters.
- */
-
-private int /* O - Error status */
-cups_get_params(gx_device *pdev, /* I - Device info */
- gs_param_list *plist) /* I - Parameter list */
-{
-#ifdef CUPS_RASTER_SYNCv1
- int i; /* Looping var */
- char name[255]; /* Attribute name */
-#endif /* CUPS_RASTER_SYNCv1 */
- int code; /* Return code */
- gs_param_string s; /* Temporary string value */
- bool b; /* Temporary boolean value */
-
-
- fprintf(stderr, "DEBUG2: cups_get_params(%p, %p)\n", pdev, plist);
-
- /*
- * First process the "standard" page device parameters...
- */
-
- fputs("DEBUG2: before gdev_prn_get_params()\n", stderr);
-
- if ((code = gdev_prn_get_params(pdev, plist)) < 0)
- return (code);
-
- fputs("DEBUG2: after gdev_prn_get_params()\n", stderr);
-
- /*
- * Then write the CUPS parameters...
- */
-
- param_string_from_string(s, cups->header.MediaClass);
- if ((code = param_write_string(plist, "MediaClass", &s)) < 0)
- return (code);
-
- param_string_from_string(s, cups->header.MediaColor);
- if ((code = param_write_string(plist, "MediaColor", &s)) < 0)
- return (code);
-
- param_string_from_string(s, cups->header.MediaType);
- if ((code = param_write_string(plist, "MediaType", &s)) < 0)
- return (code);
-
- param_string_from_string(s, cups->header.OutputType);
- if ((code = param_write_string(plist, "OutputType", &s)) < 0)
- return (code);
-
- if ((code = param_write_int(plist, "AdvanceDistance",
- (int *)&(cups->header.AdvanceDistance))) < 0)
- return (code);
-
- if ((code = param_write_int(plist, "AdvanceMedia",
- (int *)&(cups->header.AdvanceMedia))) < 0)
- return (code);
-
- b = cups->header.Collate;
- if ((code = param_write_bool(plist, "Collate", &b)) < 0)
- return (code);
-
- if ((code = param_write_int(plist, "CutMedia",
- (int *)&(cups->header.CutMedia))) < 0)
- return (code);
-
- b = cups->header.InsertSheet;
- if ((code = param_write_bool(plist, "InsertSheet", &b)) < 0)
- return (code);
-
- if ((code = param_write_int(plist, "Jog",
- (int *)&(cups->header.Jog))) < 0)
- return (code);
-
- if ((code = param_write_int(plist, "LeadingEdge",
- (int *)&(cups->header.LeadingEdge))) < 0)
- return (code);
-
- b = cups->header.ManualFeed;
- if ((code = param_write_bool(plist, "ManualFeed", &b)) < 0)
- return (code);
-
- if ((code = param_write_int(plist, "MediaPosition",
- (int *)&(cups->header.MediaPosition))) < 0)
- return (code);
-
- b = cups->header.MirrorPrint;
- if ((code = param_write_bool(plist, "MirrorPrint", &b)) < 0)
- return (code);
-
- b = cups->header.NegativePrint;
- if ((code = param_write_bool(plist, "NegativePrint", &b)) < 0)
- return (code);
-
- b = cups->header.OutputFaceUp;
- if ((code = param_write_bool(plist, "OutputFaceUp", &b)) < 0)
- return (code);
-
- b = cups->header.Separations;
- if ((code = param_write_bool(plist, "Separations", &b)) < 0)
- return (code);
-
- b = cups->header.TraySwitch;
- if ((code = param_write_bool(plist, "TraySwitch", &b)) < 0)
- return (code);
-
- b = cups->header.Tumble;
- if ((code = param_write_bool(plist, "Tumble", &b)) < 0)
- return (code);
-
-#if 0 /* Don't include read-only parameters... */
- if ((code = param_write_int(plist, "cupsWidth",
- (int *)&(cups->header.cupsWidth))) < 0)
- return (code);
-
- if ((code = param_write_int(plist, "cupsHeight",
- (int *)&(cups->header.cupsHeight))) < 0)
- return (code);
-
- if ((code = param_write_int(plist, "cupsBitsPerPixel",
- (int *)&(cups->header.cupsBitsPerPixel))) < 0)
- return (code);
-
- if ((code = param_write_int(plist, "cupsBytesPerLine",
- (int *)&(cups->header.cupsBytesPerLine))) < 0)
- return (code);
-#endif /* 0 */
-
- if ((code = param_write_int(plist, "cupsMediaType",
- (int *)&(cups->header.cupsMediaType))) < 0)
- return (code);
-
- if ((code = param_write_int(plist, "cupsBitsPerColor",
- (int *)&(cups->header.cupsBitsPerColor))) < 0)
- return (code);
-
- if ((code = param_write_int(plist, "cupsColorOrder",
- (int *)&(cups->header.cupsColorOrder))) < 0)
- return (code);
-
- if ((code = param_write_int(plist, "cupsColorSpace",
- (int *)&(cups->header.cupsColorSpace))) < 0)
- return (code);
-
- if ((code = param_write_int(plist, "cupsCompression",
- (int *)&(cups->header.cupsCompression))) < 0)
- return (code);
-
- if ((code = param_write_int(plist, "cupsRowCount",
- (int *)&(cups->header.cupsRowCount))) < 0)
- return (code);
-
- if ((code = param_write_int(plist, "cupsRowFeed",
- (int *)&(cups->header.cupsRowFeed))) < 0)
- return (code);
-
- if ((code = param_write_int(plist, "cupsRowStep",
- (int *)&(cups->header.cupsRowStep))) < 0)
- return (code);
-
-#ifdef CUPS_RASTER_SYNCv1
- if ((code = param_write_int(plist, "cupsNumColors",
- (int *)&(cups->header.cupsNumColors))) < 0)
- return (code);
-
- if ((code = param_write_float(plist, "cupsBorderlessScalingFactor",
- &(cups->header.cupsBorderlessScalingFactor))) < 0)
- return (code);
-
- for (i = 0; i < 16; i ++)
- {
- sprintf(name, "cupsInteger%d", i);
- if ((code = param_write_int(plist, name,
- (int *)(cups->header.cupsInteger + i))) < 0)
- return (code);
- }
-
- for (i = 0; i < 16; i ++)
- {
- sprintf(name, "cupsReal%d", i);
- if ((code = param_write_float(plist, name,
- cups->header.cupsReal + i)) < 0)
- return (code);
- }
-
- for (i = 0; i < 16; i ++)
- {
- sprintf(name, "cupsReal%d", i);
- param_string_from_string(s, cups->header.cupsString[i]);
- if ((code = param_write_string(plist, name, &s)) < 0)
- return (code);
- }
-
- param_string_from_string(s, cups->header.cupsMarkerType);
- if ((code = param_write_string(plist, "cupsMarkerType", &s)) < 0)
- return (code);
-
- param_string_from_string(s, cups->header.cupsRenderingIntent);
- if ((code = param_write_string(plist, "cupsRenderingIntent", &s)) < 0)
- return (code);
-
- param_string_from_string(s, cups->header.cupsPageSizeName);
- if ((code = param_write_string(plist, "cupsPageSizeName", &s)) < 0)
- return (code);
-#endif /* CUPS_RASTER_SYNCv1 */
-
- fputs("DEBUG2: Leaving cups_get_params()\n", stderr);
-
- return (0);
-}
-
-
-/*
- * 'cups_get_space_params()' - Get space parameters from the RIP_CACHE env var.
- */
-
-void
-cups_get_space_params(const gx_device_printer *pdev,
- /* I - Printer device */
- gdev_prn_space_params *space_params)
- /* O - Space parameters */
-{
- float cache_size; /* Size of tile cache in bytes */
- char *cache_env, /* Cache size environment variable */
- cache_units[255]; /* Cache size units */
-
-
- fprintf(stderr, "DEBUG2: cups_get_space_params(%p, %p)\n", pdev, space_params);
-
- if ((cache_env = getenv("RIP_MAX_CACHE")) != NULL)
- {
- switch (sscanf(cache_env, "%f%254s", &cache_size, cache_units))
- {
- case 0 :
- cache_size = 8 * 1024 * 1024;
- break;
- case 1 :
- cache_size *= 4 * CUPS_TILE_SIZE * CUPS_TILE_SIZE;
- break;
- case 2 :
- if (tolower(cache_units[0]) == 'g')
- cache_size *= 1024 * 1024 * 1024;
- else if (tolower(cache_units[0]) == 'm')
- cache_size *= 1024 * 1024;
- else if (tolower(cache_units[0]) == 'k')
- cache_size *= 1024;
- else if (tolower(cache_units[0]) == 't')
- cache_size *= 4 * CUPS_TILE_SIZE * CUPS_TILE_SIZE;
- break;
- }
- }
- else
- cache_size = 8 * 1024 * 1024;
-
- fprintf(stderr, "DEBUG: cache_size = %.0f\n", cache_size);
-
- space_params->MaxBitmap = (int)cache_size;
- space_params->BufferSpace = (int)cache_size / 10;
-}
-
-
-/*
- * 'cups_map_cielab()' - Map CIE Lab transformation...
- */
-
-static double /* O - Adjusted color value */
-cups_map_cielab(double x, /* I - Raw color value */
- double xn) /* I - Whitepoint color value */
-{
- double x_xn; /* Fraction of whitepoint */
-
-
- x_xn = x / xn;
-
- if (x_xn > 0.008856)
- return (cbrt(x_xn));
- else
- return (7.787 * x_xn + 16.0 / 116.0);
-}
-
-
-#ifdef dev_t_proc_encode_color
-/*
- * 'cups_map_cmyk()' - Map a CMYK color value to device colors.
- */
-
-private void
-cups_map_cmyk(gx_device *pdev, /* I - Device info */
- frac c, /* I - Cyan value */
- frac m, /* I - Magenta value */
- frac y, /* I - Yellow value */
- frac k, /* I - Black value */
- frac *out) /* O - Device colors */
-{
- int c0, c1, c2; /* Temporary color values */
- float rr, rg, rb, /* Real RGB colors */
- ciex, ciey, ciez, /* CIE XYZ colors */
- ciey_yn, /* Normalized luminance */
- ciel, ciea, cieb; /* CIE Lab colors */
-
-
-#ifdef DEBUG
- fprintf(stderr, "DEBUG2: cups_map_cmyk(%p, %d, %d, %d, %d, %p)\n",
- pdev, c, m, y, k, out);
-#endif /* DEBUG */
-
- /*
- * Convert the CMYK color to the destination colorspace...
- */
-
- switch (cups->header.cupsColorSpace)
- {
- case CUPS_CSPACE_W :
- c0 = frac_1 - (c * 31 + m * 61 + y * 8) / 100 - k;
-
- if (c0 < 0)
- out[0] = 0;
- else if (c0 > frac_1)
- out[0] = (frac)cupsDensity[frac_1];
- else
- out[0] = (frac)cupsDensity[c0];
- break;
-
- case CUPS_CSPACE_RGBA :
- out[3] = frac_1;
-
- case CUPS_CSPACE_RGB :
- c0 = frac_1 - c - k;
- c1 = frac_1 - m - k;
- c2 = frac_1 - y - k;
-
- if (c0 < 0)
- out[0] = 0;
- else if (c0 > frac_1)
- out[0] = (frac)cupsDensity[frac_1];
- else
- out[0] = (frac)cupsDensity[c0];
-
- if (c1 < 0)
- out[1] = 0;
- else if (c1 > frac_1)
- out[1] = (frac)cupsDensity[frac_1];
- else
- out[1] = (frac)cupsDensity[c1];
-
- if (c2 < 0)
- out[2] = 0;
- else if (c2 > frac_1)
- out[2] = (frac)cupsDensity[frac_1];
- else
- out[2] = (frac)cupsDensity[c2];
- break;
-
- default :
- case CUPS_CSPACE_K :
- c0 = (c * 31 + m * 61 + y * 8) / 100 + k;
-
- if (c0 < 0)
- out[0] = 0;
- else if (c0 > frac_1)
- out[0] = (frac)cupsDensity[frac_1];
- else
- out[0] = (frac)cupsDensity[c0];
- break;
-
- case CUPS_CSPACE_CMY :
- c0 = c + k;
- c1 = m + k;
- c2 = y + k;
-
- if (c0 < 0)
- out[0] = 0;
- else if (c0 > frac_1)
- out[0] = (frac)cupsDensity[frac_1];
- else
- out[0] = (frac)cupsDensity[c0];
-
- if (c1 < 0)
- out[1] = 0;
- else if (c1 > frac_1)
- out[1] = (frac)cupsDensity[frac_1];
- else
- out[1] = (frac)cupsDensity[c1];
-
- if (c2 < 0)
- out[2] = 0;
- else if (c2 > frac_1)
- out[2] = (frac)cupsDensity[frac_1];
- else
- out[2] = (frac)cupsDensity[c2];
- break;
-
- case CUPS_CSPACE_YMC :
- c0 = y + k;
- c1 = m + k;
- c2 = c + k;
-
- if (c0 < 0)
- out[0] = 0;
- else if (c0 > frac_1)
- out[0] = (frac)cupsDensity[frac_1];
- else
- out[0] = (frac)cupsDensity[c0];
-
- if (c1 < 0)
- out[1] = 0;
- else if (c1 > frac_1)
- out[1] = (frac)cupsDensity[frac_1];
- else
- out[1] = (frac)cupsDensity[c1];
-
- if (c2 < 0)
- out[2] = 0;
- else if (c2 > frac_1)
- out[2] = (frac)cupsDensity[frac_1];
- else
- out[2] = (frac)cupsDensity[c2];
- break;
-
- case CUPS_CSPACE_RGBW :
- c = frac_1 - c;
- m = frac_1 - m;
- y = frac_1 - y;
- k = frac_1 - k;
- case CUPS_CSPACE_CMYK :
- if (c < 0)
- out[0] = 0;
- else if (c > frac_1)
- out[0] = (frac)cupsDensity[frac_1];
- else
- out[0] = (frac)cupsDensity[c];
-
- if (m < 0)
- out[1] = 0;
- else if (m > frac_1)
- out[1] = (frac)cupsDensity[frac_1];
- else
- out[1] = (frac)cupsDensity[m];
-
- if (y < 0)
- out[2] = 0;
- else if (y > frac_1)
- out[2] = (frac)cupsDensity[frac_1];
- else
- out[2] = (frac)cupsDensity[y];
-
- if (k < 0)
- out[3] = 0;
- else if (k > frac_1)
- out[3] = (frac)cupsDensity[frac_1];
- else
- out[3] = (frac)cupsDensity[k];
- break;
-
- case CUPS_CSPACE_YMCK :
- case CUPS_CSPACE_GMCK :
- case CUPS_CSPACE_GMCS :
- if (y < 0)
- out[0] = 0;
- else if (y > frac_1)
- out[0] = (frac)cupsDensity[frac_1];
- else
- out[0] = (frac)cupsDensity[y];
-
- if (m < 0)
- out[1] = 0;
- else if (m > frac_1)
- out[1] = (frac)cupsDensity[frac_1];
- else
- out[1] = (frac)cupsDensity[m];
-
- if (c < 0)
- out[2] = 0;
- else if (c > frac_1)
- out[2] = (frac)cupsDensity[frac_1];
- else
- out[2] = (frac)cupsDensity[c];
-
- if (k < 0)
- out[3] = 0;
- else if (k > frac_1)
- out[3] = (frac)cupsDensity[frac_1];
- else
- out[3] = (frac)cupsDensity[k];
- break;
-
- case CUPS_CSPACE_KCMYcm :
- case CUPS_CSPACE_KCMY :
- if (k < 0)
- out[0] = 0;
- else if (k > frac_1)
- out[0] = (frac)cupsDensity[frac_1];
- else
- out[0] = (frac)cupsDensity[k];
-
- if (c < 0)
- out[1] = 0;
- else if (c > frac_1)
- out[1] = (frac)cupsDensity[frac_1];
- else
- out[1] = (frac)cupsDensity[c];
-
- if (m < 0)
- out[2] = 0;
- else if (m > frac_1)
- out[2] = (frac)cupsDensity[frac_1];
- else
- out[2] = (frac)cupsDensity[m];
-
- if (y < 0)
- out[3] = 0;
- else if (y > frac_1)
- out[3] = (frac)cupsDensity[frac_1];
- else
- out[3] = (frac)cupsDensity[y];
- break;
-
-# ifdef CUPS_RASTER_HAVE_COLORIMETRIC
- case CUPS_CSPACE_CIEXYZ :
- case CUPS_CSPACE_CIELab :
- case CUPS_CSPACE_ICC1 :
- case CUPS_CSPACE_ICC2 :
- case CUPS_CSPACE_ICC3 :
- case CUPS_CSPACE_ICC4 :
- case CUPS_CSPACE_ICC5 :
- case CUPS_CSPACE_ICC6 :
- case CUPS_CSPACE_ICC7 :
- case CUPS_CSPACE_ICC8 :
- case CUPS_CSPACE_ICC9 :
- case CUPS_CSPACE_ICCA :
- case CUPS_CSPACE_ICCB :
- case CUPS_CSPACE_ICCC :
- case CUPS_CSPACE_ICCD :
- case CUPS_CSPACE_ICCE :
- case CUPS_CSPACE_ICCF :
- /*
- * Convert CMYK to sRGB...
- */
-
- c0 = frac_1 - c - k;
- c1 = frac_1 - m - k;
- c2 = frac_1 - y - k;
-
- if (c0 < 0)
- c0 = 0;
-
- if (c1 < 0)
- c1 = 0;
-
- if (c2 < 0)
- c2 = 0;
-
- /*
- * Convert sRGB to linear RGB...
- */
-
- rr = pow(((double)c0 / (double)frac_1 + 0.055) / 1.055, 2.4);
- rg = pow(((double)c1 / (double)frac_1 + 0.055) / 1.055, 2.4);
- rb = pow(((double)c2 / (double)frac_1 + 0.055) / 1.055, 2.4);
-
- /*
- * Convert to CIE XYZ...
- */
-
- ciex = 0.412453 * rr + 0.357580 * rg + 0.180423 * rb;
- ciey = 0.212671 * rr + 0.715160 * rg + 0.072169 * rb;
- ciez = 0.019334 * rr + 0.119193 * rg + 0.950227 * rb;
-
- if (cups->header.cupsColorSpace == CUPS_CSPACE_CIEXYZ)
- {
- /*
- * Convert to an integer XYZ color value...
- */
-
- if (cups->header.cupsBitsPerColor == 8)
- {
- if (ciex <= 0.0f)
- c0 = 0;
- else if (ciex < 1.1)
- c0 = (int)(ciex * 231.8181 + 0.5);
- else
- c0 = 255;
-
- if (ciey <= 0.0f)
- c1 = 0;
- else if (ciey < 1.1)
- c1 = (int)(ciey * 231.8181 + 0.5);
- else
- c1 = 255;
-
- if (ciez <= 0.0f)
- c2 = 0;
- else if (ciez < 1.1)
- c2 = (int)(ciez * 231.8181 + 0.5);
- else
- c2 = 255;
- }
- else
- {
- if (ciex <= 0.0f)
- c0 = 0;
- else if (ciex < 1.1)
- c0 = (int)(ciex * 59577.2727 + 0.5);
- else
- c0 = 65535;
-
- if (ciey <= 0.0f)
- c1 = 0;
- else if (ciey < 1.1)
- c1 = (int)(ciey * 59577.2727 + 0.5);
- else
- c1 = 65535;
-
- if (ciez <= 0.0f)
- c2 = 0;
- else if (ciez < 1.1)
- c2 = (int)(ciez * 59577.2727 + 0.5);
- else
- c2 = 65535;
- }
- }
- else
- {
- /*
- * Convert CIE XYZ to Lab...
- */
-
- ciey_yn = ciey / D65_Y;
-
- if (ciey_yn > 0.008856)
- ciel = 116 * cbrt(ciey_yn) - 16;
- else
- ciel = 903.3 * ciey_yn;
-
- ciea = 500 * (cups_map_cielab(ciex, D65_X) -
- cups_map_cielab(ciey, D65_Y));
- cieb = 200 * (cups_map_cielab(ciey, D65_Y) -
- cups_map_cielab(ciez, D65_Z));
-
- if (cups->header.cupsBitsPerColor == 8)
- {
- /*
- * Scale the L value and bias the a and b values by 128
- * so that all values are in the range of 0 to 255.
- */
-
- ciel = ciel * 2.55 + 0.5;
- ciea += 128.5;
- cieb += 128.5;
-
- if (ciel <= 0.0)
- c0 = 0;
- else if (ciel < 255.0)
- c0 = (int)ciel;
- else
- c0 = 255;
-
- if (ciea <= 0.0)
- c1 = 0;
- else if (ciea < 255.0)
- c1 = (int)ciea;
- else
- c1 = 255;
-
- if (cieb <= 0.0)
- c2 = 0;
- else if (cieb < 255.0)
- c2 = (int)cieb;
- else
- c2 = 255;
- }
- else
- {
- /*
- * Scale the L value and bias the a and b values by 128 so that all
- * numbers are from 0 to 65535.
- */
-
- ciel = ciel * 655.35 + 0.5;
- ciea = (ciea + 128.0) * 256.0 + 0.5;
- cieb = (cieb + 128.0) * 256.0 + 0.5;
-
- /*
- * Output 16-bit values...
- */
-
- if (ciel <= 0.0)
- c0 = 0;
- else if (ciel < 65535.0)
- c0 = (int)ciel;
- else
- c0 = 65535;
-
- if (ciea <= 0.0)
- c1 = 0;
- else if (ciea < 65535.0)
- c1 = (int)ciea;
- else
- c1 = 65535;
-
- if (cieb <= 0.0)
- c2 = 0;
- else if (cieb < 65535.0)
- c2 = (int)cieb;
- else
- c2 = 65535;
- }
- }
-
- out[0] = cupsDecodeLUT[c0];
- out[1] = cupsDecodeLUT[c1];
- out[2] = cupsDecodeLUT[c2];
- break;
-# endif /* CUPS_RASTER_HAVE_COLORIMETRIC */
- }
-
-#ifdef DEBUG
- switch (cups->color_info.num_components)
- {
- default :
- case 1 :
- fprintf(stderr, "DEBUG2: \\=== COLOR %d\n", out[0]);
- break;
-
- case 3 :
- fprintf(stderr, "DEBUG2: \\=== COLOR %d, %d, %d\n",
- out[0], out[1], out[2]);
- break;
-
- case 4 :
- fprintf(stderr, "DEBUG2: \\=== COLOR %d, %d, %d, %d\n",
- out[0], out[1], out[2], out[3]);
- break;
- }
-#endif /* DEBUG */
-}
-
-
-/*
- * 'cups_map_gray()' - Map a grayscale value to device colors.
- */
-
-private void
-cups_map_gray(gx_device *pdev, /* I - Device info */
- frac g, /* I - Grayscale value */
- frac *out) /* O - Device colors */
-{
-#ifdef DEBUG2
- fprintf(stderr, "DEBUG2: cups_map_gray(%p, %d, %p)\n",
- pdev, g, out);
-#endif /* DEBUG2 */
-
- /*
- * Just use the CMYK mapper...
- */
-
- cups_map_cmyk(pdev, 0, 0, 0, frac_1 - g, out);
-}
-
-
-/*
- * 'cups_map_rgb()' - Map a RGB color value to device colors.
- */
-
-private void
-cups_map_rgb(gx_device *pdev,
- /* I - Device info */
- const gs_imager_state *pis,/* I - Device state */
- frac r, /* I - Red value */
- frac g, /* I - Green value */
- frac b, /* I - Blue value */
- frac *out)/* O - Device colors */
-{
- frac c, m, y, k; /* CMYK values */
- frac mk; /* Maximum K value */
- int tc, tm, ty; /* Temporary color values */
-
-
-#ifdef DEBUG
- fprintf(stderr, "DEBUG2: cups_map_rgb(%p, %p, %d, %d, %d, %p)\n",
- pdev, pis, r, g, b, out);
-#endif /* DEBUG */
-
- /*
- * Compute CMYK values...
- */
-
- c = frac_1 - r;
- m = frac_1 - g;
- y = frac_1 - b;
- k = min(c, min(m, y));
-
- if ((mk = max(c, max(m, y))) > k)
- k = (int)((float)k * (float)k * (float)k / ((float)mk * (float)mk));
-
- c -= k;
- m -= k;
- y -= k;
-
- /*
- * Do color correction as needed...
- */
-
- if (cupsHaveProfile)
- {
- /*
- * Color correct CMY...
- */
-
- tc = cupsMatrix[0][0][c] +
- cupsMatrix[0][1][m] +
- cupsMatrix[0][2][y];
- tm = cupsMatrix[1][0][c] +
- cupsMatrix[1][1][m] +
- cupsMatrix[1][2][y];
- ty = cupsMatrix[2][0][c] +
- cupsMatrix[2][1][m] +
- cupsMatrix[2][2][y];
-
- if (tc < 0)
- c = 0;
- else if (tc > frac_1)
- c = frac_1;
- else
- c = (frac)tc;
-
- if (tm < 0)
- m = 0;
- else if (tm > frac_1)
- m = frac_1;
- else
- m = (frac)tm;
-
- if (ty < 0)
- y = 0;
- else if (ty > frac_1)
- y = frac_1;
- else
- y = (frac)ty;
- }
-
- /*
- * Use the CMYK mapping function to produce the device colors...
- */
-
- cups_map_cmyk(pdev, c, m, y, k, out);
-}
-#else
-/*
- * 'cups_map_cmyk_color()' - Map a CMYK color to a color index.
- *
- * This function is only called when a 4 or 6 color colorspace is
- * selected for output. CMYK colors are *not* corrected but *are*
- * density adjusted.
- */
-
-private gx_color_index /* O - Color index */
-cups_map_cmyk_color(gx_device *pdev,
- /* I - Device info */
- gx_color_value c, /* I - Cyan value */
- gx_color_value m, /* I - Magenta value */
- gx_color_value y, /* I - Yellow value */
- gx_color_value k) /* I - Black value */
-{
- gx_color_index i; /* Temporary index */
- gx_color_value ic, im, iy, ik; /* Integral CMYK values */
-
-
-#ifdef DEBUG
- fprintf(stderr, "DEBUG2: cups_map_cmyk_color(%p, %d, %d, %d, %d)\n", pdev,
- c, m, y, k);
-#endif /* DEBUG */
-
- /*
- * Setup the color info data as needed...
- */
-
- if (pdev->color_info.num_components == 0)
- cups_set_color_info(pdev);
-
- /*
- * Density correct...
- */
-
- if (cupsHaveProfile)
- {
- c = cupsDensity[c];
- m = cupsDensity[m];
- y = cupsDensity[y];
- k = cupsDensity[k];
- }
-
- ic = cupsEncodeLUT[c];
- im = cupsEncodeLUT[m];
- iy = cupsEncodeLUT[y];
- ik = cupsEncodeLUT[k];
-
- /*
- * Convert the CMYK color to a color index...
- */
-
- switch (cups->header.cupsColorSpace)
- {
- default :
- switch (cups->header.cupsBitsPerColor)
- {
- default :
- i = (((((ic << 1) | im) << 1) | iy) << 1) | ik;
- break;
- case 2 :
- i = (((((ic << 2) | im) << 2) | iy) << 2) | ik;
- break;
- case 4 :
- i = (((((ic << 4) | im) << 4) | iy) << 4) | ik;
- break;
- case 8 :
- i = (((((ic << 8) | im) << 8) | iy) << 8) | ik;
- break;
-#ifdef GX_COLOR_INDEX_TYPE
- case 16 :
- i = (((((ic << 16) | im) << 16) | iy) << 16) | ik;
- break;
-#endif /* GX_COLOR_INDEX_TYPE */
- }
- break;
-
- case CUPS_CSPACE_YMCK :
- case CUPS_CSPACE_GMCK :
- case CUPS_CSPACE_GMCS :
- switch (cups->header.cupsBitsPerColor)
- {
- default :
- i = (((((iy << 1) | im) << 1) | ic) << 1) | ik;
- break;
- case 2 :
- i = (((((iy << 2) | im) << 2) | ic) << 2) | ik;
- break;
- case 4 :
- i = (((((iy << 4) | im) << 4) | ic) << 4) | ik;
- break;
- case 8 :
- i = (((((iy << 8) | im) << 8) | ic) << 8) | ik;
- break;
-#ifdef GX_COLOR_INDEX_TYPE
- case 16 :
- i = (((((iy << 16) | im) << 16) | ic) << 16) | ik;
- break;
-#endif /* GX_COLOR_INDEX_TYPE */
- }
- break;
-
- case CUPS_CSPACE_KCMYcm :
- if (cups->header.cupsBitsPerColor == 1)
- {
- if (ik)
- i = 32;
- else
- i = 0;
-
- if (ic && im)
- i |= 17;
- else if (ic && iy)
- i |= 6;
- else if (im && iy)
- i |= 12;
- else if (ic)
- i |= 16;
- else if (im)
- i |= 8;
- else if (iy)
- i |= 4;
- break;
- }
-
- case CUPS_CSPACE_KCMY :
- switch (cups->header.cupsBitsPerColor)
- {
- default :
- i = (((((ik << 1) | ic) << 1) | im) << 1) | iy;
- break;
- case 2 :
- i = (((((ik << 2) | ic) << 2) | im) << 2) | iy;
- break;
- case 4 :
- i = (((((ik << 4) | ic) << 4) | im) << 4) | iy;
- break;
- case 8 :
- i = (((((ik << 8) | ic) << 8) | im) << 8) | iy;
- break;
-#ifdef GX_COLOR_INDEX_TYPE
- case 16 :
- i = (((((ik << 16) | ic) << 16) | im) << 16) | iy;
- break;
-#endif /* GX_COLOR_INDEX_TYPE */
- }
- break;
- }
-
-#ifdef DEBUG
- fprintf(stderr, "DEBUG2: CMYK (%d,%d,%d,%d) -> CMYK %08x (%d,%d,%d,%d)\n",
- c, m, y, k, (unsigned)i, ic, im, iy, ik);
-#endif /* DEBUG */
-
- /*
- * Make sure we don't get a CMYK color of 255, 255, 255, 255...
- */
-
- if (i == gx_no_color_index)
- i --;
-
- return (i);
-}
-
-
-/*
- * 'cups_map_color_rgb()' - Map a color index to an RGB color.
- */
-
-private int
-cups_map_color_rgb(gx_device *pdev,/* I - Device info */
- gx_color_index color,/* I - Color index */
- gx_color_value prgb[3])
- /* O - RGB values */
-{
- unsigned char c0, c1, c2, c3; /* Color index components */
- gx_color_value k, divk; /* Black & divisor */
-
-
-#ifdef DEBUG
- fprintf(stderr, "DEBUG2: cups_map_color_rgb(%p, %d, %p)\n", pdev,
- (unsigned)color, prgb);
-#endif /* DEBUG */
-
- /*
- * Setup the color info data as needed...
- */
-
- if (pdev->color_info.num_components == 0)
- cups_set_color_info(pdev);
-
-#ifdef DEBUG
- fprintf(stderr, "DEBUG2: COLOR %08x = ", (unsigned)color);
-#endif /* DEBUG */
-
- /*
- * Extract the color components from the color index...
- */
-
- switch (cups->header.cupsBitsPerColor)
- {
- default :
- c3 = color & 1;
- color >>= 1;
- c2 = color & 1;
- color >>= 1;
- c1 = color & 1;
- color >>= 1;
- c0 = color;
- break;
- case 2 :
- c3 = color & 3;
- color >>= 2;
- c2 = color & 3;
- color >>= 2;
- c1 = color & 3;
- color >>= 2;
- c0 = color;
- break;
- case 4 :
- c3 = color & 15;
- color >>= 4;
- c2 = color & 15;
- color >>= 4;
- c1 = color & 15;
- color >>= 4;
- c0 = color;
- break;
- case 8 :
- c3 = color & 255;
- color >>= 8;
- c2 = color & 255;
- color >>= 8;
- c1 = color & 255;
- color >>= 8;
- c0 = color;
- break;
-#ifdef GX_COLOR_INDEX_TYPE
- case 16 :
- c3 = color & 0xffff;
- color >>= 16;
- c2 = color & 0xffff;
- color >>= 16;
- c1 = color & 0xffff;
- color >>= 16;
- c0 = color;
- break;
-#endif /* GX_COLOR_INDEX_TYPE */
- }
-
- /*
- * Convert the color components to RGB...
- */
-
- switch (cups->header.cupsColorSpace)
- {
- case CUPS_CSPACE_K :
- case CUPS_CSPACE_WHITE :
- case CUPS_CSPACE_GOLD :
- case CUPS_CSPACE_SILVER :
- prgb[0] =
- prgb[1] =
- prgb[2] = cupsDecodeLUT[c3];
- break;
-
- case CUPS_CSPACE_W :
- prgb[0] =
- prgb[1] =
- prgb[2] = cupsDecodeLUT[c3];
- break;
-
- case CUPS_CSPACE_RGB :
- prgb[0] = cupsDecodeLUT[c1];
- prgb[1] = cupsDecodeLUT[c2];
- prgb[2] = cupsDecodeLUT[c3];
- break;
-
- case CUPS_CSPACE_RGBA :
- prgb[0] = cupsDecodeLUT[c0];
- prgb[1] = cupsDecodeLUT[c1];
- prgb[2] = cupsDecodeLUT[c2];
- break;
-
- case CUPS_CSPACE_CMY :
- prgb[0] = cupsDecodeLUT[c1];
- prgb[1] = cupsDecodeLUT[c2];
- prgb[2] = cupsDecodeLUT[c3];
- break;
-
- case CUPS_CSPACE_YMC :
- prgb[0] = cupsDecodeLUT[c3];
- prgb[1] = cupsDecodeLUT[c2];
- prgb[2] = cupsDecodeLUT[c1];
- break;
-
- case CUPS_CSPACE_KCMY :
- case CUPS_CSPACE_KCMYcm :
- k = cupsDecodeLUT[c0];
- divk = gx_max_color_value - k;
- if (divk == 0)
- {
- prgb[0] = 0;
- prgb[1] = 0;
- prgb[2] = 0;
- }
- else
- {
- prgb[0] = gx_max_color_value + divk -
- gx_max_color_value * c1 / divk;
- prgb[1] = gx_max_color_value + divk -
- gx_max_color_value * c2 / divk;
- prgb[2] = gx_max_color_value + divk -
- gx_max_color_value * c3 / divk;
- }
- break;
-
- case CUPS_CSPACE_RGBW :
- /*
- * cupsDecodeLUT actually maps to RGBW, not CMYK...
- */
-
- k = cupsDecodeLUT[c3];
- c = cupsDecodeLUT[c0] + k;
- m = cupsDecodeLUT[c1] + k;
- y = cupsDecodeLUT[c2] + k;
-
- if (c > gx_max_color_value)
- prgb[0] = gx_max_color_value;
- else
- prgb[0] = c;
-
- if (m > gx_max_color_value)
- prgb[1] = gx_max_color_value;
- else
- prgb[1] = m;
-
- if (y > gx_max_color_value)
- prgb[2] = gx_max_color_value;
- else
- prgb[2] = y;
- break;
-
- case CUPS_CSPACE_CMYK :
- k = cupsDecodeLUT[c3];
- divk = gx_max_color_value - k;
- if (divk == 0)
- {
- prgb[0] = 0;
- prgb[1] = 0;
- prgb[2] = 0;
- }
- else
- {
- prgb[0] = gx_max_color_value + divk -
- gx_max_color_value * c0 / divk;
- prgb[1] = gx_max_color_value + divk -
- gx_max_color_value * c1 / divk;
- prgb[2] = gx_max_color_value + divk -
- gx_max_color_value * c2 / divk;
- }
- break;
-
- case CUPS_CSPACE_YMCK :
- case CUPS_CSPACE_GMCK :
- case CUPS_CSPACE_GMCS :
- k = cupsDecodeLUT[c3];
- divk = gx_max_color_value - k;
- if (divk == 0)
- {
- prgb[0] = 0;
- prgb[1] = 0;
- prgb[2] = 0;
- }
- else
- {
- prgb[0] = gx_max_color_value + divk -
- gx_max_color_value * c2 / divk;
- prgb[1] = gx_max_color_value + divk -
- gx_max_color_value * c1 / divk;
- prgb[2] = gx_max_color_value + divk -
- gx_max_color_value * c0 / divk;
- }
- break;
-
-# ifdef CUPS_RASTER_HAVE_COLORIMETRIC
- case CUPS_CSPACE_CIEXYZ :
- case CUPS_CSPACE_CIELab :
- case CUPS_CSPACE_ICC1 :
- case CUPS_CSPACE_ICC2 :
- case CUPS_CSPACE_ICC3 :
- case CUPS_CSPACE_ICC4 :
- case CUPS_CSPACE_ICC5 :
- case CUPS_CSPACE_ICC6 :
- case CUPS_CSPACE_ICC7 :
- case CUPS_CSPACE_ICC8 :
- case CUPS_CSPACE_ICC9 :
- case CUPS_CSPACE_ICCA :
- case CUPS_CSPACE_ICCB :
- case CUPS_CSPACE_ICCC :
- case CUPS_CSPACE_ICCD :
- case CUPS_CSPACE_ICCE :
- case CUPS_CSPACE_ICCF :
- break;
-# endif /* CUPS_RASTER_HAVE_COLORIMETRIC */
- }
-
- fprintf(stderr, "%d,%d,%d\n", prgb[0], prgb[1], prgb[2]);
-
- return (0);
-}
-
-
-/*
- * 'cups_map_rgb_color()' - Map an RGB color to a color index. We map the
- * RGB color to the output colorspace & bits (we
- * figure out the format when we output a page).
- */
-
-private gx_color_index /* O - Color index */
-cups_map_rgb_color(gx_device *pdev,/* I - Device info */
- gx_color_value r, /* I - Red value */
- gx_color_value g, /* I - Green value */
- gx_color_value b) /* I - Blue value */
-{
- gx_color_index i; /* Temporary index */
- gx_color_value ic, im, iy, ik; /* Integral CMYK values */
- gx_color_value mk; /* Maximum K value */
- int tc, tm, ty; /* Temporary color values */
- float rr, rg, rb, /* Real RGB colors */
- ciex, ciey, ciez,
- /* CIE XYZ colors */
- ciey_yn, /* Normalized luminance */
- ciel, ciea, cieb;
- /* CIE Lab colors */
-
-
-#ifdef DEBUG
- fprintf(stderr, "DEBUG2: cups_map_rgb_color(%p, %d, %d, %d)\n", pdev, r, g, b);
-#endif /* DEBUG */
-
- /*
- * Setup the color info data as needed...
- */
-
- if (pdev->color_info.num_components == 0)
- cups_set_color_info(pdev);
-
- /*
- * Do color correction as needed...
- */
-
- if (cupsHaveProfile)
- {
- /*
- * Compute CMYK values...
- */
-
- ic = gx_max_color_value - r;
- im = gx_max_color_value - g;
- iy = gx_max_color_value - b;
- ik = min(ic, min(im, iy));
-
- if ((mk = max(ic, max(im, iy))) > ik)
- ik = (int)((float)ik * (float)ik * (float)ik / ((float)mk * (float)mk));
-
- ic -= ik;
- im -= ik;
- iy -= ik;
-
- /*
- * Color correct CMY...
- */
-
- tc = cupsMatrix[0][0][ic] +
- cupsMatrix[0][1][im] +
- cupsMatrix[0][2][iy] +
- ik;
- tm = cupsMatrix[1][0][ic] +
- cupsMatrix[1][1][im] +
- cupsMatrix[1][2][iy] +
- ik;
- ty = cupsMatrix[2][0][ic] +
- cupsMatrix[2][1][im] +
- cupsMatrix[2][2][iy] +
- ik;
-
- /*
- * Density correct combined CMYK...
- */
-
- if (tc < 0)
- r = gx_max_color_value;
- else if (tc > gx_max_color_value)
- r = gx_max_color_value - cupsDensity[gx_max_color_value];
- else
- r = gx_max_color_value - cupsDensity[tc];
-
- if (tm < 0)
- g = gx_max_color_value;
- else if (tm > gx_max_color_value)
- g = gx_max_color_value - cupsDensity[gx_max_color_value];
- else
- g = gx_max_color_value - cupsDensity[tm];
-
- if (ty < 0)
- b = gx_max_color_value;
- else if (ty > gx_max_color_value)
- b = gx_max_color_value - cupsDensity[gx_max_color_value];
- else
- b = gx_max_color_value - cupsDensity[ty];
- }
-
- /*
- * Convert the RGB color to a color index...
- */
-
- switch (cups->header.cupsColorSpace)
- {
- case CUPS_CSPACE_W :
- i = cupsEncodeLUT[(r * 31 + g * 61 + b * 8) / 100];
- break;
-
- case CUPS_CSPACE_RGB :
- ic = cupsEncodeLUT[r];
- im = cupsEncodeLUT[g];
- iy = cupsEncodeLUT[b];
-
- switch (cups->header.cupsBitsPerColor)
- {
- default :
- i = (((ic << 1) | im) << 1) | iy;
- break;
- case 2 :
- i = (((ic << 2) | im) << 2) | iy;
- break;
- case 4 :
- i = (((ic << 4) | im) << 4) | iy;
- break;
- case 8 :
- i = (((ic << 8) | im) << 8) | iy;
- break;
-#ifdef GX_COLOR_INDEX_TYPE
- case 16 :
- i = (((ic << 16) | im) << 16) | iy;
- break;
-#endif /* GX_COLOR_INDEX_TYPE */
- }
- break;
-
- case CUPS_CSPACE_RGBW :
- if (!r && !g && !b)
- {
- /*
- * Map black to W...
- */
-
- switch (cups->header.cupsBitsPerColor)
- {
- default :
- i = 0x0e;
- break;
- case 2 :
- i = 0xfc;
- break;
- case 4 :
- i = 0xfff0;
- break;
- case 8 :
- i = 0xffffff00;
- break;
-#ifdef GX_COLOR_INDEX_TYPE
- case 16 :
- i = 0xffffffffffff0000;
- break;
-#endif /* GX_COLOR_INDEX_TYPE */
- }
- break;
- }
-
- case CUPS_CSPACE_RGBA :
- ic = cupsEncodeLUT[r];
- im = cupsEncodeLUT[g];
- iy = cupsEncodeLUT[b];
-
- switch (cups->header.cupsBitsPerColor)
- {
- default :
- i = (((((ic << 1) | im) << 1) | iy) << 1) | 0x01;
- break;
- case 2 :
- i = (((((ic << 2) | im) << 2) | iy) << 2) | 0x03;
- break;
- case 4 :
- i = (((((ic << 4) | im) << 4) | iy) << 4) | 0x0f;
- break;
- case 8 :
- i = (((((ic << 8) | im) << 8) | iy) << 8) | 0xff;
- break;
-#ifdef GX_COLOR_INDEX_TYPE
- case 16 :
- i = (((((ic << 16) | im) << 16) | iy) << 16) | 0xffff;
- break;
-#endif /* GX_COLOR_INDEX_TYPE */
- }
- break;
-
- default :
- i = cupsEncodeLUT[gx_max_color_value - (r * 31 + g * 61 + b * 8) / 100];
- break;
-
- case CUPS_CSPACE_CMY :
- ic = cupsEncodeLUT[gx_max_color_value - r];
- im = cupsEncodeLUT[gx_max_color_value - g];
- iy = cupsEncodeLUT[gx_max_color_value - b];
-
- switch (cups->header.cupsBitsPerColor)
- {
- default :
- i = (((ic << 1) | im) << 1) | iy;
- break;
- case 2 :
- i = (((ic << 2) | im) << 2) | iy;
- break;
- case 4 :
- i = (((ic << 4) | im) << 4) | iy;
- break;
- case 8 :
- i = (((ic << 8) | im) << 8) | iy;
- break;
-#ifdef GX_COLOR_INDEX_TYPE
- case 16 :
- i = (((ic << 16) | im) << 16) | iy;
- break;
-#endif /* GX_COLOR_INDEX_TYPE */
- }
- break;
-
- case CUPS_CSPACE_YMC :
- ic = cupsEncodeLUT[gx_max_color_value - r];
- im = cupsEncodeLUT[gx_max_color_value - g];
- iy = cupsEncodeLUT[gx_max_color_value - b];
-
- switch (cups->header.cupsBitsPerColor)
- {
- default :
- i = (((iy << 1) | im) << 1) | ic;
- break;
- case 2 :
- i = (((iy << 2) | im) << 2) | ic;
- break;
- case 4 :
- i = (((iy << 4) | im) << 4) | ic;
- break;
- case 8 :
- i = (((iy << 8) | im) << 8) | ic;
- break;
- }
- break;
-
- case CUPS_CSPACE_CMYK :
- ic = gx_max_color_value - r;
- im = gx_max_color_value - g;
- iy = gx_max_color_value - b;
- ik = min(ic, min(im, iy));
-
- if ((mk = max(ic, max(im, iy))) > ik)
- ik = (int)((float)ik * (float)ik * (float)ik /
- ((float)mk * (float)mk));
-
- ic = cupsEncodeLUT[ic - ik];
- im = cupsEncodeLUT[im - ik];
- iy = cupsEncodeLUT[iy - ik];
- ik = cupsEncodeLUT[ik];
-
- switch (cups->header.cupsBitsPerColor)
- {
- default :
- i = (((((ic << 1) | im) << 1) | iy) << 1) | ik;
- break;
- case 2 :
- i = (((((ic << 2) | im) << 2) | iy) << 2) | ik;
- break;
- case 4 :
- i = (((((ic << 4) | im) << 4) | iy) << 4) | ik;
- break;
- case 8 :
- i = (((((ic << 8) | im) << 8) | iy) << 8) | ik;
- break;
-#ifdef GX_COLOR_INDEX_TYPE
- case 16 :
- i = (((((ic << 16) | im) << 16) | iy) << 16) | ik;
- break;
-#endif /* GX_COLOR_INDEX_TYPE */
- }
-
-#ifdef DEBUG
- fprintf(stderr, "DEBUG2: CMY (%d,%d,%d) -> CMYK %08x (%d,%d,%d,%d)\n",
- r, g, b, (unsigned)i, ic, im, iy, ik);
-#endif /* DEBUG */
- break;
-
- case CUPS_CSPACE_YMCK :
- case CUPS_CSPACE_GMCK :
- case CUPS_CSPACE_GMCS :
- ic = gx_max_color_value - r;
- im = gx_max_color_value - g;
- iy = gx_max_color_value - b;
- ik = min(ic, min(im, iy));
-
- if ((mk = max(ic, max(im, iy))) > ik)
- ik = (int)((float)ik * (float)ik * (float)ik /
- ((float)mk * (float)mk));
-
- ic = cupsEncodeLUT[ic - ik];
- im = cupsEncodeLUT[im - ik];
- iy = cupsEncodeLUT[iy - ik];
- ik = cupsEncodeLUT[ik];
-
- switch (cups->header.cupsBitsPerColor)
- {
- default :
- i = (((((iy << 1) | im) << 1) | ic) << 1) | ik;
- break;
- case 2 :
- i = (((((iy << 2) | im) << 2) | ic) << 2) | ik;
- break;
- case 4 :
- i = (((((iy << 4) | im) << 4) | ic) << 4) | ik;
- break;
- case 8 :
- i = (((((iy << 8) | im) << 8) | ic) << 8) | ik;
- break;
-#ifdef GX_COLOR_INDEX_TYPE
- case 16 :
- i = (((((iy << 16) | im) << 16) | ic) << 16) | ik;
- break;
-#endif /* GX_COLOR_INDEX_TYPE */
- }
- break;
-
- case CUPS_CSPACE_KCMYcm :
- if (cups->header.cupsBitsPerColor == 1)
- {
- ic = gx_max_color_value - r;
- im = gx_max_color_value - g;
- iy = gx_max_color_value - b;
- ik = min(ic, min(im, iy));
-
- if ((mk = max(ic, max(im, iy))) > ik)
- ik = (int)((float)ik * (float)ik * (float)ik /
- ((float)mk * (float)mk));
-
- ic = cupsEncodeLUT[ic - ik];
- im = cupsEncodeLUT[im - ik];
- iy = cupsEncodeLUT[iy - ik];
- ik = cupsEncodeLUT[ik];
- if (ik)
- i = 32;
- else if (ic && im)
- i = 17;
- else if (ic && iy)
- i = 6;
- else if (im && iy)
- i = 12;
- else if (ic)
- i = 16;
- else if (im)
- i = 8;
- else if (iy)
- i = 4;
- else
- i = 0;
- break;
- }
-
- case CUPS_CSPACE_KCMY :
- ic = gx_max_color_value - r;
- im = gx_max_color_value - g;
- iy = gx_max_color_value - b;
- ik = min(ic, min(im, iy));
-
- if ((mk = max(ic, max(im, iy))) > ik)
- ik = (int)((float)ik * (float)ik * (float)ik /
- ((float)mk * (float)mk));
-
- ic = cupsEncodeLUT[ic - ik];
- im = cupsEncodeLUT[im - ik];
- iy = cupsEncodeLUT[iy - ik];
- ik = cupsEncodeLUT[ik];
-
- switch (cups->header.cupsBitsPerColor)
- {
- default :
- i = (((((ik << 1) | ic) << 1) | im) << 1) | iy;
- break;
- case 2 :
- i = (((((ik << 2) | ic) << 2) | im) << 2) | iy;
- break;
- case 4 :
- i = (((((ik << 4) | ic) << 4) | im) << 4) | iy;
- break;
- case 8 :
- i = (((((ik << 8) | ic) << 8) | im) << 8) | iy;
- break;
-#ifdef GX_COLOR_INDEX_TYPE
- case 16 :
- i = (((((ik << 16) | ic) << 16) | im) << 16) | iy;
- break;
-#endif /* GX_COLOR_INDEX_TYPE */
- }
- break;
-
-# ifdef CUPS_RASTER_HAVE_COLORIMETRIC
- case CUPS_CSPACE_CIEXYZ :
- case CUPS_CSPACE_CIELab :
- case CUPS_CSPACE_ICC1 :
- case CUPS_CSPACE_ICC2 :
- case CUPS_CSPACE_ICC3 :
- case CUPS_CSPACE_ICC4 :
- case CUPS_CSPACE_ICC5 :
- case CUPS_CSPACE_ICC6 :
- case CUPS_CSPACE_ICC7 :
- case CUPS_CSPACE_ICC8 :
- case CUPS_CSPACE_ICC9 :
- case CUPS_CSPACE_ICCA :
- case CUPS_CSPACE_ICCB :
- case CUPS_CSPACE_ICCC :
- case CUPS_CSPACE_ICCD :
- case CUPS_CSPACE_ICCE :
- case CUPS_CSPACE_ICCF :
- /*
- * Convert sRGB to linear RGB...
- */
-
- rr = pow(((double)r / (double)gx_max_color_value + 0.055) / 1.055, 2.4);
- rg = pow(((double)g / (double)gx_max_color_value + 0.055) / 1.055, 2.4);
- rb = pow(((double)b / (double)gx_max_color_value + 0.055) / 1.055, 2.4);
-
- /*
- * Convert to CIE XYZ...
- */
-
- ciex = 0.412453 * rr + 0.357580 * rg + 0.180423 * rb;
- ciey = 0.212671 * rr + 0.715160 * rg + 0.072169 * rb;
- ciez = 0.019334 * rr + 0.119193 * rg + 0.950227 * rb;
-
- if (cups->header.cupsColorSpace == CUPS_CSPACE_CIEXYZ)
- {
- /*
- * Convert to an integer XYZ color value...
- */
-
- if (ciex > 1.1)
- ic = 255;
- else if (ciex > 0.0)
- ic = (int)(ciex / 1.1 * 255.0 + 0.5);
- else
- ic = 0;
-
- if (ciey > 1.1)
- im = 255;
- else if (ciey > 0.0)
- im = (int)(ciey / 1.1 * 255.0 + 0.5);
- else
- im = 0;
-
- if (ciez > 1.1)
- iy = 255;
- else if (ciez > 0.0)
- iy = (int)(ciez / 1.1 * 255.0 + 0.5);
- else
- iy = 0;
- }
- else
- {
- /*
- * Convert CIE XYZ to Lab...
- */
-
- ciey_yn = ciey / D65_Y;
-
- if (ciey_yn > 0.008856)
- ciel = 116 * cbrt(ciey_yn) - 16;
- else
- ciel = 903.3 * ciey_yn;
-
- ciea = 500 * (cups_map_cielab(ciex, D65_X) -
- cups_map_cielab(ciey, D65_Y));
- cieb = 200 * (cups_map_cielab(ciey, D65_Y) -
- cups_map_cielab(ciez, D65_Z));
-
- /*
- * Scale the L value and bias the a and b values by 128
- * so that all values are in the range of 0 to 255.
- */
-
- ciel = ciel * 2.55 + 0.5;
- ciea += 128.5;
- cieb += 128.5;
-
- /*
- * Convert to 8-bit values...
- */
-
- if (ciel < 0.0)
- ic = 0;
- else if (ciel < 255.0)
- ic = (int)ciel;
- else
- ic = 255;
-
- if (ciea < 0.0)
- im = 0;
- else if (ciea < 255.0)
- im = (int)ciea;
- else
- im = 255;
-
- if (cieb < 0.0)
- iy = 0;
- else if (cieb < 255.0)
- iy = (int)cieb;
- else
- iy = 255;
- }
-
- /*
- * Put the final color value together...
- */
-
- switch (cups->header.cupsBitsPerColor)
- {
- default :
- i = (((ic << 1) | im) << 1) | iy;
- break;
- case 2 :
- i = (((ic << 2) | im) << 2) | iy;
- break;
- case 4 :
- i = (((ic << 4) | im) << 4) | iy;
- break;
- case 8 :
- i = (((ic << 8) | im) << 8) | iy;
- break;
-#ifdef GX_COLOR_INDEX_TYPE
- case 16 :
- i = (((((ic << 16) | im) << 16) | iy) << 16) | ik;
- break;
-#endif /* GX_COLOR_INDEX_TYPE */
- }
- break;
-# endif /* CUPS_RASTER_HAVE_COLORIMETRIC */
- }
-
-#ifdef DEBUG
- fprintf(stderr, "DEBUG2: RGB %d,%d,%d = %08x\n", r, g, b, (unsigned)i);
-#endif /* DEBUG */
-
- return (i);
-}
-#endif /* dev_t_proc_encode_color */
-
-
-/*
- * 'cups_open()' - Open the output file and initialize things.
- */
-
-private int /* O - Error status */
-cups_open(gx_device *pdev) /* I - Device info */
-{
- int code; /* Return status */
-
-
- fprintf(stderr, "DEBUG2: cups_open(%p)\n", pdev);
-
- cups->printer_procs.get_space_params = cups_get_space_params;
-
- if (cups->page == 0)
- {
- fputs("INFO: Processing page 1...\n", stderr);
- cups->page = 1;
- }
-
- cups_set_color_info(pdev);
-
- if ((code = gdev_prn_open(pdev)) != 0)
- return (code);
-
- if (cupsPPD == NULL)
- cupsPPD = ppdOpenFile(getenv("PPD"));
-
- return (0);
-}
-
-
-/*
- * 'cups_print_pages()' - Send one or more pages to the output file.
- */
-
-private int /* O - 0 if everything is OK */
-cups_print_pages(gx_device_printer *pdev,
- /* I - Device info */
- FILE *fp, /* I - Output file */
- int num_copies)
- /* I - Number of copies */
-{
- int copy; /* Copy number */
- int srcbytes; /* Byte width of scanline */
- unsigned char *src, /* Scanline data */
- *dst; /* Bitmap data */
-
-
- (void)fp; /* reference unused file pointer to prevent compiler warning */
-
- fprintf(stderr, "DEBUG2: cups_print_pages(%p, %p, %d)\n", pdev, fp,
- num_copies);
-
- /*
- * Figure out the number of bytes per line...
- */
-
- switch (cups->header.cupsColorOrder)
- {
- case CUPS_ORDER_CHUNKED :
- cups->header.cupsBytesPerLine = (cups->header.cupsBitsPerPixel *
- cups->header.cupsWidth + 7) / 8;
- break;
-
- case CUPS_ORDER_BANDED :
- if (cups->header.cupsColorSpace == CUPS_CSPACE_KCMYcm &&
- cups->header.cupsBitsPerColor == 1)
- cups->header.cupsBytesPerLine = (cups->header.cupsBitsPerColor *
- cups->header.cupsWidth + 7) / 8 * 6;
- else
- cups->header.cupsBytesPerLine = (cups->header.cupsBitsPerColor *
- cups->header.cupsWidth + 7) / 8 *
- cups->color_info.num_components;
- break;
-
- case CUPS_ORDER_PLANAR :
- cups->header.cupsBytesPerLine = (cups->header.cupsBitsPerColor *
- cups->header.cupsWidth + 7) / 8;
- break;
- }
-
- /*
- * Compute the width of a scanline and allocate input/output buffers...
- */
-
- srcbytes = gdev_prn_raster(pdev);
-
- fprintf(stderr, "DEBUG2: cupsBitsPerPixel = %d, cupsWidth = %d, cupsBytesPerLine = %d, srcbytes = %d\n",
- cups->header.cupsBitsPerPixel, cups->header.cupsWidth,
- cups->header.cupsBytesPerLine, srcbytes);
-
- src = (unsigned char *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), srcbytes, 1, "cups_print_pages");
-
- if (src == NULL) /* can't allocate input buffer */
- return_error(gs_error_VMerror);
-
- /*
- * Need an output buffer, too...
- */
-
- dst = (unsigned char *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), cups->header.cupsBytesPerLine, 2,
- "cups_print_pages");
-
- if (dst == NULL) /* can't allocate working area */
- return_error(gs_error_VMerror);
-
- /*
- * See if the stream has been initialized yet...
- */
-
- if (cups->stream == NULL)
- {
- if ((cups->stream = cupsRasterOpen(fileno(cups->file),
- CUPS_RASTER_WRITE)) == NULL)
- {
- perror("ERROR: Unable to open raster stream - ");
- gs_exit(gs_lib_ctx_get_non_gc_memory_t(), 0);
- }
- }
-
- /*
- * Output a page of graphics...
- */
-
- if (num_copies < 1)
- num_copies = 1;
-
- if (cupsPPD != NULL && !cupsPPD->manual_copies)
- {
- cups->header.NumCopies = num_copies;
- num_copies = 1;
- }
-
- fprintf(stderr, "DEBUG2: cupsWidth = %d, cupsHeight = %d, cupsBytesPerLine = %d\n",
- cups->header.cupsWidth, cups->header.cupsHeight,
- cups->header.cupsBytesPerLine);
-
- for (copy = num_copies; copy > 0; copy --)
- {
- cupsRasterWriteHeader(cups->stream, &(cups->header));
-
- if (pdev->color_info.num_components == 1)
- cups_print_chunked(pdev, src, dst, srcbytes);
- else
- switch (cups->header.cupsColorOrder)
- {
- case CUPS_ORDER_CHUNKED :
- cups_print_chunked(pdev, src, dst, srcbytes);
- break;
- case CUPS_ORDER_BANDED :
- cups_print_banded(pdev, src, dst, srcbytes);
- break;
- case CUPS_ORDER_PLANAR :
- cups_print_planar(pdev, src, dst, srcbytes);
- break;
- }
- }
-
- /*
- * Free temporary storage and return...
- */
-
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)src, srcbytes, 1, "cups_print_pages");
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)dst, cups->header.cupsBytesPerLine, 1, "cups_print_pages");
-
- cups->page ++;
- fprintf(stderr, "INFO: Processing page %d...\n", cups->page);
-
- return (0);
-}
-
-
-/*
- * 'cups_put_params()' - Set pagedevice parameters.
- */
-
-private int /* O - Error status */
-cups_put_params(gx_device *pdev, /* I - Device info */
- gs_param_list *plist) /* I - Parameter list */
-{
- int i; /* Looping var */
-#ifdef CUPS_RASTER_SYNCv1
- char name[255]; /* Name of attribute */
- float sf; /* cupsBorderlessScalingFactor */
-#endif /* CUPS_RASTER_SYNCv1 */
- float margins[4]; /* Physical margins of print */
- ppd_size_t *size; /* Page size */
- int code; /* Error code */
- int intval; /* Integer value */
- bool boolval; /* Boolean value */
- float floatval; /* Floating point value */
- gs_param_string stringval; /* String value */
- gs_param_float_array arrayval; /* Float array value */
- int margins_set; /* Were the margins set? */
- int size_set; /* Was the size set? */
- int color_set; /* Were the color attrs set? */
- gdev_prn_space_params sp; /* Space parameter data */
- int width, /* New width of page */
- height; /* New height of page */
-
-
- fprintf(stderr, "DEBUG2: cups_put_params(%p, %p)\n", pdev, plist);
-
- /*
- * Process other options for CUPS...
- */
-
-#define stringoption(name, sname) \
- if ((code = param_read_string(plist, sname, &stringval)) < 0) \
- { \
- param_signal_error(plist, sname, code); \
- return (code); \
- } \
- else if (code == 0) \
- { \
- strncpy(cups->header.name, (const char *)stringval.data, \
- stringval.size); \
- cups->header.name[stringval.size] = '\0'; \
- }
-
-#define intoption(name, sname, type) \
- if ((code = param_read_int(plist, sname, &intval)) < 0) \
- { \
- param_signal_error(plist, sname, code); \
- return (code); \
- } \
- else if (code == 0) \
- { \
- fprintf(stderr, "DEBUG: Setting %s to %d...\n", sname, intval); \
- cups->header.name = (type)intval; \
- }
-
-#define floatoption(name, sname) \
- if ((code = param_read_float(plist, sname, &floatval)) < 0) \
- { \
- param_signal_error(plist, sname, code); \
- return (code); \
- } \
- else if (code == 0) \
- cups->header.name = (unsigned)floatval;
-
-#define booloption(name, sname) \
- if ((code = param_read_bool(plist, sname, &boolval)) < 0) \
- { \
- if ((code = param_read_null(plist, sname)) < 0) \
- { \
- param_signal_error(plist, sname, code); \
- return (code); \
- } \
- if (code == 0) \
- cups->header.name = CUPS_FALSE; \
- } \
- else if (code == 0) \
- cups->header.name = (cups_bool_t)boolval;
-
-#define arrayoption(name, sname, count) \
- if ((code = param_read_float_array(plist, sname, &arrayval)) < 0) \
- { \
- if ((code = param_read_null(plist, sname)) < 0) \
- { \
- param_signal_error(plist, sname, code); \
- return (code); \
- } \
- if (code == 0) \
- for (i = 0; i < count; i ++) \
- cups->header.name[i] = 0; \
- } \
- else if (code == 0) \
- { \
- for (i = 0; i < count; i ++) \
- cups->header.name[i] = (unsigned)arrayval.data[i]; \
- }
-
- size_set = param_read_float_array(plist, ".MediaSize", &arrayval) == 0 ||
- param_read_float_array(plist, "PageSize", &arrayval) == 0;
- margins_set = param_read_float_array(plist, "Margins", &arrayval) == 0;
- color_set = param_read_int(plist, "cupsColorSpace", &intval) == 0 ||
- param_read_int(plist, "cupsBitsPerColor", &intval) == 0;
-
- stringoption(MediaClass, "MediaClass")
- stringoption(MediaColor, "MediaColor")
- stringoption(MediaType, "MediaType")
- stringoption(OutputType, "OutputType")
- floatoption(AdvanceDistance, "AdvanceDistance")
- intoption(AdvanceMedia, "AdvanceMedia", cups_adv_t)
- booloption(Collate, "Collate")
- intoption(CutMedia, "CutMedia", cups_cut_t)
- booloption(Duplex, "Duplex")
- arrayoption(ImagingBoundingBox, "ImagingBoundingBox", 4)
- booloption(InsertSheet, "InsertSheet")
- intoption(Jog, "Jog", cups_jog_t)
- intoption(LeadingEdge, "LeadingEdge", cups_edge_t)
- arrayoption(Margins, "Margins", 2)
- booloption(ManualFeed, "ManualFeed")
- intoption(MediaPosition, "cupsMediaPosition", unsigned) /* Compatibility */
- intoption(MediaPosition, "MediaPosition", unsigned)
- floatoption(MediaWeight, "MediaWeight")
- booloption(MirrorPrint, "MirrorPrint")
- booloption(NegativePrint, "NegativePrint")
- intoption(Orientation, "Orientation", cups_orient_t)
- booloption(OutputFaceUp, "OutputFaceUp")
- booloption(Separations, "Separations")
- booloption(TraySwitch, "TraySwitch")
- booloption(Tumble, "Tumble")
- intoption(cupsMediaType, "cupsMediaType", unsigned)
- intoption(cupsBitsPerColor, "cupsBitsPerColor", unsigned)
- intoption(cupsColorOrder, "cupsColorOrder", cups_order_t)
- intoption(cupsColorSpace, "cupsColorSpace", cups_cspace_t)
- intoption(cupsCompression, "cupsCompression", unsigned)
- intoption(cupsRowCount, "cupsRowCount", unsigned)
- intoption(cupsRowFeed, "cupsRowFeed", unsigned)
- intoption(cupsRowStep, "cupsRowStep", unsigned)
-
-#ifdef GX_COLOR_INDEX_TYPE
- /*
- * Support cupsPreferredBitsPerColor - basically, allows you to
- * request 16-bits per color in a backwards-compatible way...
- */
-
- if (!param_read_int(plist, "cupsPreferredBitsPerColor", &intval))
- if (intval > cups->header.cupsBitsPerColor && intval <= 16)
- cups->header.cupsBitsPerColor = intval;
-#endif /* GX_COLOR_INDEX_TYPE */
-
-#ifdef CUPS_RASTER_SYNCv1
- floatoption(cupsBorderlessScalingFactor, "cupsBorderlessScalingFactor");
-
- for (i = 0; i < 16; i ++)
- {
- sprintf(name, "cupsInteger%d", i);
- intoption(cupsInteger[i], name, unsigned)
- }
-
- for (i = 0; i < 16; i ++)
- {
- sprintf(name, "cupsReal%d", i);
- floatoption(cupsReal[i], name)
- }
-
- for (i = 0; i < 16; i ++)
- {
- sprintf(name, "cupsString%d", i);
- stringoption(cupsString[i], name)
- }
-
- stringoption(cupsMarkerType, "cupsMarkerType");
- stringoption(cupsRenderingIntent, "cupsRenderingIntent");
- stringoption(cupsPageSizeName, "cupsPageSizeName");
-#endif /* CUPS_RASTER_SYNCv1 */
-
- if ((code = param_read_string(plist, "cupsProfile", &stringval)) < 0)
- {
- param_signal_error(plist, "cupsProfile", code);
- return (code);
- }
- else if (code == 0)
- {
- if (cupsProfile != NULL)
- free(cupsProfile);
-
- cupsProfile = strdup((char *)stringval.data);
- }
-
- cups_set_color_info(pdev);
-
- /*
- * Then process standard page device options...
- */
-
- if ((code = gdev_prn_put_params(pdev, plist)) < 0)
- return (code);
-
- /*
- * Update margins/sizes as needed...
- */
-
- if (size_set)
- {
- /*
- * Compute the page margins...
- */
-
- fprintf(stderr, "DEBUG: Updating PageSize to [%.0f %.0f]...\n",
- cups->MediaSize[0], cups->MediaSize[1]);
-
- memset(margins, 0, sizeof(margins));
-
- cups->landscape = 0;
-
- if (cupsPPD != NULL)
- {
- /*
- * Find the matching page size...
- */
-
- for (i = cupsPPD->num_sizes, size = cupsPPD->sizes;
- i > 0;
- i --, size ++)
- if (fabs(cups->MediaSize[1] - size->length) < 5.0 &&
- fabs(cups->MediaSize[0] - size->width) < 5.0 &&
- (!margins_set ||
- (fabs(cups->HWMargins[0] - size->left) < 1.0 &&
- fabs(cups->HWMargins[1] - size->bottom) < 1.0)))
- break;
-
- if (i > 0)
- {
- /*
- * Standard size...
- */
-
- fprintf(stderr, "DEBUG: size = %s\n", size->name);
-
- gx_device_set_media_size(pdev, size->width, size->length);
-
- margins[0] = size->left / 72.0;
- margins[1] = size->bottom / 72.0;
- margins[2] = (size->width - size->right) / 72.0;
- margins[3] = (size->length - size->top) / 72.0;
- }
- else
- {
- /*
- * No matching portrait size; look for a matching size in
- * landscape orientation...
- */
-
- for (i = cupsPPD->num_sizes, size = cupsPPD->sizes;
- i > 0;
- i --, size ++)
- if (fabs(cups->MediaSize[0] - size->length) < 5.0 &&
- fabs(cups->MediaSize[1] - size->width) < 5.0 &&
- (!margins_set ||
- (fabs(cups->HWMargins[0] - size->left) < 1.0 &&
- fabs(cups->HWMargins[1] - size->bottom) < 1.0)))
- break;
-
- if (i > 0)
- {
- /*
- * Standard size in landscape orientation...
- */
-
- fprintf(stderr, "DEBUG: landscape size = %s\n", size->name);
-
- gx_device_set_media_size(pdev, size->length, size->width);
-
- cups->landscape = 1;
-
- margins[0] = size->left / 72.0;
- margins[1] = size->bottom / 72.0;
- margins[2] = (size->width - size->right) / 72.0;
- margins[3] = (size->length - size->top) / 72.0;
- }
- else
- {
- /*
- * Custom size...
- */
-
- fputs("DEBUG: size = Custom\n", stderr);
-
- for (i = 0; i < 4; i ++)
- margins[i] = cupsPPD->custom_margins[i] / 72.0;
- }
- }
-
- fprintf(stderr, "DEBUG: margins[] = [ %f %f %f %f ]\n",
- margins[0], margins[1], margins[2], margins[3]);
- }
-
- /*
- * Set the margins to update the bitmap size...
- */
-
- gx_device_set_margins(pdev, margins, false);
- }
-
- /*
- * Set CUPS raster header values...
- */
-
- cups->header.HWResolution[0] = pdev->HWResolution[0];
- cups->header.HWResolution[1] = pdev->HWResolution[1];
-
-#ifdef CUPS_RASTER_SYNCv1
- cups->header.cupsPageSize[0] = pdev->MediaSize[0];
- cups->header.cupsPageSize[1] = pdev->MediaSize[1];
-
- cups->header.cupsImagingBBox[0] = pdev->HWMargins[0];
- cups->header.cupsImagingBBox[1] = pdev->HWMargins[3];
- cups->header.cupsImagingBBox[2] = pdev->MediaSize[0] - pdev->HWMargins[2];
- cups->header.cupsImagingBBox[3] = pdev->MediaSize[1] - pdev->HWMargins[1];
-
- if ((sf = cups->header.cupsBorderlessScalingFactor) < 1.0)
- sf = 1.0;
-
- cups->header.Margins[0] = pdev->HWMargins[0] * sf;
- cups->header.Margins[1] = pdev->HWMargins[1] * sf;
-
- cups->header.PageSize[0] = pdev->MediaSize[0] * sf;
- cups->header.PageSize[1] = pdev->MediaSize[1] * sf;
-
- cups->header.ImagingBoundingBox[0] = pdev->HWMargins[0] * sf;
- cups->header.ImagingBoundingBox[1] = pdev->HWMargins[3] * sf;
- cups->header.ImagingBoundingBox[2] = (pdev->MediaSize[0] -
- pdev->HWMargins[2]) * sf;
- cups->header.ImagingBoundingBox[3] = (pdev->MediaSize[1] -
- pdev->HWMargins[1]) * sf;
-#else
- cups->header.Margins[0] = pdev->HWMargins[0];
- cups->header.Margins[1] = pdev->HWMargins[1];
-
- cups->header.PageSize[0] = pdev->MediaSize[0];
- cups->header.PageSize[1] = pdev->MediaSize[1];
-
- cups->header.ImagingBoundingBox[0] = pdev->HWMargins[0];
- cups->header.ImagingBoundingBox[1] = pdev->HWMargins[3];
- cups->header.ImagingBoundingBox[2] = pdev->MediaSize[0] - pdev->HWMargins[2];
- cups->header.ImagingBoundingBox[3] = pdev->MediaSize[1] - pdev->HWMargins[1];
-#endif /* CUPS_RASTER_SYNCv1 */
-
- /*
- * Reallocate memory if the size or color depth was changed...
- */
-
- if (color_set || size_set)
- {
- /*
- * Make sure the page image is the correct size - current Ghostscript
- * does not keep track of the margins in the bitmap size...
- */
-
- if (cups->landscape)
- {
- width = (pdev->MediaSize[1] - pdev->HWMargins[0] - pdev->HWMargins[2]) *
- pdev->HWResolution[0] / 72.0f + 0.499f;
- height = (pdev->MediaSize[0] - pdev->HWMargins[1] - pdev->HWMargins[3]) *
- pdev->HWResolution[1] / 72.0f + 0.499f;
- }
- else
- {
- width = (pdev->MediaSize[0] - pdev->HWMargins[0] - pdev->HWMargins[2]) *
- pdev->HWResolution[0] / 72.0f + 0.499f;
- height = (pdev->MediaSize[1] - pdev->HWMargins[1] - pdev->HWMargins[3]) *
- pdev->HWResolution[1] / 72.0f + 0.499f;
- }
-
-#ifdef CUPS_RASTER_SYNCv1
- if (cups->header.cupsBorderlessScalingFactor > 1.0)
- {
- width *= cups->header.cupsBorderlessScalingFactor;
- height *= cups->header.cupsBorderlessScalingFactor;
- }
-#endif /* CUPS_RASTER_SYNCv1 */
-
- /*
- * Don't reallocate memory unless the device has been opened...
- */
-
- if (pdev->is_open)
- {
- /*
- * Device is open, so reallocate...
- */
-
- fprintf(stderr, "DEBUG: Reallocating memory, [%.0f %.0f] = %dx%d pixels...\n",
- pdev->MediaSize[0], pdev->MediaSize[1], width, height);
-
- sp = ((gx_device_printer *)pdev)->space_params;
-
- if ((code = gdev_prn_reallocate_memory(pdev, &sp, width, height)) < 0)
- return (code);
- }
- else
- {
- /*
- * Device isn't yet open, so just save the new width and height...
- */
-
- fprintf(stderr, "DEBUG: Setting initial media size, [%.0f %.0f] = %dx%d pixels...\n",
- pdev->MediaSize[0], pdev->MediaSize[1], width, height);
-
- pdev->width = width;
- pdev->height = height;
- }
- }
-
- fprintf(stderr, "DEBUG2: ppd = %p\n", cupsPPD);
- fprintf(stderr, "DEBUG2: PageSize = [ %.3f %.3f ]\n",
- pdev->MediaSize[0], pdev->MediaSize[1]);
- fprintf(stderr, "DEBUG2: margins = [ %.3f %.3f %.3f %.3f ]\n",
- margins[0], margins[1], margins[2], margins[3]);
- fprintf(stderr, "DEBUG2: HWResolution = [ %.3f %.3f ]\n",
- pdev->HWResolution[0], pdev->HWResolution[1]);
- fprintf(stderr, "DEBUG2: width = %d, height = %d\n",
- pdev->width, pdev->height);
- fprintf(stderr, "DEBUG2: HWMargins = [ %.3f %.3f %.3f %.3f ]\n",
- pdev->HWMargins[0], pdev->HWMargins[1],
- pdev->HWMargins[2], pdev->HWMargins[3]);
-
- return (0);
-}
-
-
-/*
- * 'cups_set_color_info()' - Set the color information structure based on
- * the required output.
- */
-
-private void
-cups_set_color_info(gx_device *pdev) /* I - Device info */
-{
- int i, j, k; /* Looping vars */
- int max_lut; /* Maximum LUT value */
- float d, g; /* Density and gamma correction */
- float m[3][3]; /* Color correction matrix */
- char resolution[41]; /* Resolution string */
- ppd_profile_t *profile; /* Color profile information */
-
-
- fprintf(stderr, "DEBUG2: cups_set_color_info(%p)\n", pdev);
-
-#ifndef GX_COLOR_INDEX_TYPE
- if (cups->header.cupsBitsPerColor > 8)
- cups->header.cupsBitsPerColor = 8;
-#endif /* !GX_COLOR_INDEX_TYPE */
-
- switch (cups->header.cupsColorSpace)
- {
- default :
- case CUPS_CSPACE_W :
- case CUPS_CSPACE_K :
- case CUPS_CSPACE_WHITE :
- case CUPS_CSPACE_GOLD :
- case CUPS_CSPACE_SILVER :
-#ifdef CUPS_RASTER_SYNCv1
- cups->header.cupsNumColors = 1;
-#endif /* CUPS_RASTER_SYNCv1 */
- cups->header.cupsBitsPerPixel = cups->header.cupsBitsPerColor;
- cups->color_info.depth = cups->header.cupsBitsPerPixel;
- cups->color_info.num_components = 1;
- break;
-
- case CUPS_CSPACE_CMY :
- case CUPS_CSPACE_YMC :
- case CUPS_CSPACE_RGB :
-#ifdef CUPS_RASTER_SYNCv1
- cups->header.cupsNumColors = 3;
-#endif /* CUPS_RASTER_SYNCv1 */
- if (cups->header.cupsColorOrder != CUPS_ORDER_CHUNKED)
- cups->header.cupsBitsPerPixel = cups->header.cupsBitsPerColor;
- else if (cups->header.cupsBitsPerColor < 8)
- cups->header.cupsBitsPerPixel = 4 * cups->header.cupsBitsPerColor;
- else
- cups->header.cupsBitsPerPixel = 3 * cups->header.cupsBitsPerColor;
-
- if (cups->header.cupsBitsPerColor < 8)
- cups->color_info.depth = 4 * cups->header.cupsBitsPerColor;
- else
- cups->color_info.depth = 3 * cups->header.cupsBitsPerColor;
-
- cups->color_info.num_components = 3;
- break;
-
- case CUPS_CSPACE_KCMYcm :
- if (cups->header.cupsBitsPerColor == 1)
- {
-#ifdef CUPS_RASTER_SYNCv1
- cups->header.cupsNumColors = 6;
-#endif /* CUPS_RASTER_SYNCv1 */
- cups->header.cupsBitsPerPixel = 8;
- cups->color_info.depth = 8;
- cups->color_info.num_components = 4;
- break;
- }
-
- case CUPS_CSPACE_RGBA :
- case CUPS_CSPACE_RGBW :
- case CUPS_CSPACE_CMYK :
- case CUPS_CSPACE_YMCK :
- case CUPS_CSPACE_KCMY :
- case CUPS_CSPACE_GMCK :
- case CUPS_CSPACE_GMCS :
-#ifdef CUPS_RASTER_SYNCv1
- cups->header.cupsNumColors = 4;
-#endif /* CUPS_RASTER_SYNCv1 */
- if (cups->header.cupsColorOrder != CUPS_ORDER_CHUNKED)
- cups->header.cupsBitsPerPixel = cups->header.cupsBitsPerColor;
- else
- cups->header.cupsBitsPerPixel = 4 * cups->header.cupsBitsPerColor;
-
- cups->color_info.depth = 4 * cups->header.cupsBitsPerColor;
- cups->color_info.num_components = 4;
- break;
-
-#ifdef CUPS_RASTER_HAVE_COLORIMETRIC
- case CUPS_CSPACE_CIEXYZ :
- case CUPS_CSPACE_CIELab :
- case CUPS_CSPACE_ICC1 :
- case CUPS_CSPACE_ICC2 :
- case CUPS_CSPACE_ICC3 :
- case CUPS_CSPACE_ICC4 :
- case CUPS_CSPACE_ICC5 :
- case CUPS_CSPACE_ICC6 :
- case CUPS_CSPACE_ICC7 :
- case CUPS_CSPACE_ICC8 :
- case CUPS_CSPACE_ICC9 :
- case CUPS_CSPACE_ICCA :
- case CUPS_CSPACE_ICCB :
- case CUPS_CSPACE_ICCC :
- case CUPS_CSPACE_ICCD :
- case CUPS_CSPACE_ICCE :
- case CUPS_CSPACE_ICCF :
- /*
- * Colorimetric color spaces currently are implemented as 24-bit
- * mapping to XYZ or Lab, which are then converted as needed to
- * the final representation...
- *
- * This code enforces a minimum output depth of 8 bits per
- * component...
- */
-
-#ifdef CUPS_RASTER_SYNCv1
- cups->header.cupsNumColors = 3;
-#endif /* CUPS_RASTER_SYNCv1 */
-
- if (cups->header.cupsBitsPerColor < 8)
- cups->header.cupsBitsPerColor = 8;
-
- if (cups->header.cupsColorOrder != CUPS_ORDER_CHUNKED)
- cups->header.cupsBitsPerPixel = cups->header.cupsBitsPerColor;
- else
- cups->header.cupsBitsPerPixel = 3 * cups->header.cupsBitsPerColor;
-
- cups->color_info.depth = 24;
- cups->color_info.num_components = 3;
- break;
-#endif /* CUPS_RASTER_HAVE_COLORIMETRIC */
- }
-
-#ifdef dev_t_proc_encode_color
- switch (cups->header.cupsColorSpace)
- {
- default :
- cups->color_info.gray_index = GX_CINFO_COMP_NO_INDEX;
- break;
-
- case CUPS_CSPACE_W :
- case CUPS_CSPACE_WHITE :
- case CUPS_CSPACE_K :
- case CUPS_CSPACE_GOLD :
- case CUPS_CSPACE_SILVER :
- case CUPS_CSPACE_KCMYcm :
- case CUPS_CSPACE_KCMY :
- cups->color_info.gray_index = 0;
- break;
-
- case CUPS_CSPACE_RGBW :
- case CUPS_CSPACE_CMYK :
- case CUPS_CSPACE_YMCK :
- case CUPS_CSPACE_GMCK :
- case CUPS_CSPACE_GMCS :
- cups->color_info.gray_index = 3;
- break;
- }
-
- switch (cups->header.cupsColorSpace)
- {
- default :
- case CUPS_CSPACE_W :
- case CUPS_CSPACE_WHITE :
- case CUPS_CSPACE_RGB :
- case CUPS_CSPACE_RGBA :
- case CUPS_CSPACE_RGBW :
-# ifdef CUPS_RASTER_HAVE_COLORIMETRIC
- case CUPS_CSPACE_CIEXYZ :
- case CUPS_CSPACE_CIELab :
- case CUPS_CSPACE_ICC1 :
- case CUPS_CSPACE_ICC2 :
- case CUPS_CSPACE_ICC3 :
- case CUPS_CSPACE_ICC4 :
- case CUPS_CSPACE_ICC5 :
- case CUPS_CSPACE_ICC6 :
- case CUPS_CSPACE_ICC7 :
- case CUPS_CSPACE_ICC8 :
- case CUPS_CSPACE_ICC9 :
- case CUPS_CSPACE_ICCA :
- case CUPS_CSPACE_ICCB :
- case CUPS_CSPACE_ICCC :
- case CUPS_CSPACE_ICCD :
- case CUPS_CSPACE_ICCE :
- case CUPS_CSPACE_ICCF :
-# endif /* CUPS_RASTER_HAVE_COLORIMETRIC */
- cups->color_info.polarity = GX_CINFO_POLARITY_ADDITIVE;
- break;
-
- case CUPS_CSPACE_K :
- case CUPS_CSPACE_GOLD :
- case CUPS_CSPACE_SILVER :
- case CUPS_CSPACE_CMY :
- case CUPS_CSPACE_YMC :
- case CUPS_CSPACE_KCMYcm :
- case CUPS_CSPACE_CMYK :
- case CUPS_CSPACE_YMCK :
- case CUPS_CSPACE_KCMY :
- case CUPS_CSPACE_GMCK :
- case CUPS_CSPACE_GMCS :
- cups->color_info.polarity = GX_CINFO_POLARITY_SUBTRACTIVE;
- break;
- }
-
- cups->color_info.separable_and_linear = GX_CINFO_SEP_LIN_NONE;
-#endif /* dev_t_proc_encode_color */
-
- i = cups->header.cupsBitsPerColor;
- max_lut = (1 << i) - 1;
-
- switch (cups->color_info.num_components)
- {
- default :
- case 1 :
- cups->color_info.max_gray = max_lut;
- cups->color_info.max_color = 0;
- cups->color_info.dither_grays = max_lut + 1;
- cups->color_info.dither_colors = 0;
- break;
-
- case 3 :
- cups->color_info.max_gray = 0;
- cups->color_info.max_color = max_lut;
- cups->color_info.dither_grays = 0;
- cups->color_info.dither_colors = max_lut + 1;
- break;
-
- case 4 :
- cups->color_info.max_gray = max_lut;
- cups->color_info.max_color = max_lut;
- cups->color_info.dither_grays = max_lut + 1;
- cups->color_info.dither_colors = max_lut + 1;
- break;
- }
-
- /*
- * Enable/disable CMYK color support...
- */
-
-#ifdef dev_t_proc_encode_color
- cups->color_info.max_components = cups->color_info.num_components;
-#endif /* dev_t_proc_encode_color */
-
- /*
- * Tell Ghostscript to forget any colors it has cached...
- */
-
- gx_device_decache_colors(pdev);
-
- /*
- * Compute the lookup tables...
- */
-
- for (i = 0; i <= gx_max_color_value; i ++)
- {
- j = (max_lut * i + gx_max_color_value / 2) / gx_max_color_value;
-
-#if !ARCH_IS_BIG_ENDIAN
- if (max_lut > 255)
- j = ((j & 255) << 8) | ((j >> 8) & 255);
-#endif /* !ARCH_IS_BIG_ENDIAN */
-
- cupsEncodeLUT[i] = j;
-
-#ifdef DEBUG
- if (i == 0 || cupsEncodeLUT[i] != cupsEncodeLUT[i - 1])
- fprintf(stderr, "DEBUG2: cupsEncodeLUT[%d] = %d\n", i, (int)cupsEncodeLUT[i]);
-#endif /* DEBUG */
- }
-
- fprintf(stderr, "DEBUG: cupsEncodeLUT[0] = %d\n", (int)cupsEncodeLUT[0]);
- fprintf(stderr, "DEBUG: cupsEncodeLUT[%d] = %d\n", gx_max_color_value,
- (int)cupsEncodeLUT[gx_max_color_value]);
-
- for (i = 0; i < cups->color_info.dither_grays; i ++)
- cupsDecodeLUT[i] = gx_max_color_value * i / max_lut;
-
- fprintf(stderr, "DEBUG: num_components = %d, depth = %d\n",
- cups->color_info.num_components, cups->color_info.depth);
- fprintf(stderr, "DEBUG: cupsColorSpace = %d, cupsColorOrder = %d\n",
- cups->header.cupsColorSpace, cups->header.cupsColorOrder);
- fprintf(stderr, "DEBUG: cupsBitsPerPixel = %d, cupsBitsPerColor = %d\n",
- cups->header.cupsBitsPerPixel, cups->header.cupsBitsPerColor);
- fprintf(stderr, "DEBUG: max_gray = %d, dither_grays = %d\n",
- cups->color_info.max_gray, cups->color_info.dither_grays);
- fprintf(stderr, "DEBUG: max_color = %d, dither_colors = %d\n",
- cups->color_info.max_color, cups->color_info.dither_colors);
-
- /*
- * Set the color profile as needed...
- */
-
- cupsHaveProfile = 0;
-
-#ifdef dev_t_proc_encode_color
- if (cupsProfile)
-#else
- if (cupsProfile && cups->header.cupsBitsPerColor == 8)
-#endif /* dev_t_proc_encode_color */
- {
- fprintf(stderr, "DEBUG: Using user-defined profile \"%s\"...\n", cupsProfile);
-
- if (sscanf(cupsProfile, "%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f", &d, &g,
- m[0] + 0, m[0] + 1, m[0] + 2,
- m[1] + 0, m[1] + 1, m[1] + 2,
- m[2] + 0, m[2] + 1, m[2] + 2) != 11)
- fputs("DEBUG: User-defined profile does not contain 11 integers!\n", stderr);
- else
- {
- cupsHaveProfile = 1;
-
- d *= 0.001f;
- g *= 0.001f;
- m[0][0] *= 0.001f;
- m[0][1] *= 0.001f;
- m[0][2] *= 0.001f;
- m[1][0] *= 0.001f;
- m[1][1] *= 0.001f;
- m[1][2] *= 0.001f;
- m[2][0] *= 0.001f;
- m[2][1] *= 0.001f;
- m[2][2] *= 0.001f;
- }
- }
-#ifdef dev_t_proc_encode_color
- else if (cupsPPD)
-#else
- else if (cupsPPD && cups->header.cupsBitsPerColor == 8)
-#endif /* dev_t_proc_encode_color */
- {
- /*
- * Find the appropriate color profile...
- */
-
- if (pdev->HWResolution[0] != pdev->HWResolution[1])
- sprintf(resolution, "%.0fx%.0fdpi", pdev->HWResolution[0],
- pdev->HWResolution[1]);
- else
- sprintf(resolution, "%.0fdpi", pdev->HWResolution[0]);
-
- for (i = 0, profile = cupsPPD->profiles;
- i < cupsPPD->num_profiles;
- i ++, profile ++)
- if ((strcmp(profile->resolution, resolution) == 0 ||
- profile->resolution[0] == '-') &&
- (strcmp(profile->media_type, cups->header.MediaType) == 0 ||
- profile->media_type[0] == '-'))
- break;
-
- /*
- * If we found a color profile, use it!
- */
-
- if (i < cupsPPD->num_profiles)
- {
- fputs("DEBUG: Using color profile in PPD file!\n", stderr);
-
- cupsHaveProfile = 1;
-
- d = profile->density;
- g = profile->gamma;
-
- memcpy(m, profile->matrix, sizeof(m));
- }
- }
-
- if (cupsHaveProfile)
- {
- for (i = 0; i < 3; i ++)
- for (j = 0; j < 3; j ++)
- for (k = 0; k <= CUPS_MAX_VALUE; k ++)
- {
- cupsMatrix[i][j][k] = (int)((float)k * m[i][j] + 0.5);
-
- if ((k & 4095) == 0)
- fprintf(stderr, "DEBUG2: cupsMatrix[%d][%d][%d] = %d\n",
- i, j, k, cupsMatrix[i][j][k]);
- }
-
-
- for (k = 0; k <= CUPS_MAX_VALUE; k ++)
- {
- cupsDensity[k] = (int)((float)CUPS_MAX_VALUE * d *
- pow((float)k / (float)CUPS_MAX_VALUE, g) +
- 0.5);
-
- if ((k & 4095) == 0)
- fprintf(stderr, "DEBUG2: cupsDensity[%d] = %d\n", k, cupsDensity[k]);
- }
- }
- else
- {
- for (k = 0; k <= CUPS_MAX_VALUE; k ++)
- cupsDensity[k] = k;
- }
-}
-
-
-/*
- * 'cups_sync_output()' - Keep the user informed of our status...
- */
-
-private int /* O - Error status */
-cups_sync_output(gx_device *pdev) /* I - Device info */
-{
- fprintf(stderr, "INFO: Processing page %d...\n", cups->page);
-
- return (0);
-}
-
-
-/*
- * 'cups_print_chunked()' - Print a page of chunked pixels.
- */
-
-static void
-cups_print_chunked(gx_device_printer *pdev,
- /* I - Printer device */
- unsigned char *src,
- /* I - Scanline buffer */
- unsigned char *dst,
- /* I - Bitmap buffer */
- int srcbytes)
- /* I - Number of bytes in src */
-{
- int y; /* Looping var */
- unsigned char *srcptr, /* Pointer to data */
- *dstptr; /* Pointer to bits */
- int count; /* Count for loop */
- int flip; /* Flip scanline? */
-
-
- if (cups->header.Duplex && !cups->header.Tumble &&
- cupsPPD && cupsPPD->flip_duplex && !(cups->page & 1))
- flip = 1;
- else
- flip = 0;
-
- fprintf(stderr, "DEBUG: cups_print_chunked - flip = %d, height = %d\n",
- flip, cups->height);
-
- /*
- * Loop through the page bitmap and write chunked pixels, reversing as
- * needed...
- */
-
- for (y = 0; y < cups->height; y ++)
- {
- /*
- * Grab the scanline data...
- */
-
- if (gdev_prn_get_bits((gx_device_printer *)pdev, y, src, &srcptr) < 0)
- {
- fprintf(stderr, "ERROR: Unable to get scanline %d!\n", y);
- gs_exit(gs_lib_ctx_get_non_gc_memory_t(), 1);
- }
-
- if (flip)
- {
- /*
- * Flip the raster data before writing it...
- */
-
- if (srcptr[0] == 0 && memcmp(srcptr, srcptr + 1, srcbytes - 1) == 0)
- memset(dst, 0, cups->header.cupsBytesPerLine);
- else
- {
- dstptr = dst;
- count = srcbytes;
-
- switch (cups->color_info.depth)
- {
- case 1 : /* B&W bitmap */
- for (srcptr += srcbytes - 1;
- count > 0;
- count --, srcptr --, dstptr ++)
- {
- *dstptr = cupsRevUpper1[*srcptr & 15] |
- cupsRevLower1[*srcptr >> 4];
- }
- break;
-
- case 2 : /* 2-bit W/K image */
- for (srcptr += srcbytes - 1;
- count > 0;
- count --, srcptr --, dstptr ++)
- {
- *dstptr = cupsRevUpper2[*srcptr & 15] |
- cupsRevLower2[*srcptr >> 4];
- }
- break;
-
- case 4 : /* 1-bit RGB/CMY/CMYK bitmap or 4-bit W/K image */
- for (srcptr += srcbytes - 1;
- count > 0;
- count --, srcptr --, dstptr ++)
- *dstptr = (*srcptr >> 4) | (*srcptr << 4);
- break;
-
- case 8 : /* 2-bit RGB/CMY/CMYK or 8-bit W/K image */
- for (srcptr += srcbytes - 1;
- count > 0;
- count --, srcptr --, dstptr ++)
- *dstptr = *srcptr;
- break;
-
- case 16 : /* 4-bit RGB/CMY/CMYK or 16-bit W/K image */
- for (srcptr += srcbytes - 2;
- count > 0;
- count -= 2, srcptr -= 2, dstptr += 2)
- {
- dstptr[0] = srcptr[0];
- dstptr[1] = srcptr[1];
- }
- break;
-
- case 24 : /* 8-bit RGB or CMY image */
- for (srcptr += srcbytes - 3;
- count > 0;
- count -= 3, srcptr -= 3, dstptr += 3)
- {
- dstptr[0] = srcptr[0];
- dstptr[1] = srcptr[1];
- dstptr[2] = srcptr[2];
- }
- break;
-
- case 32 : /* 8-bit CMYK image */
- for (srcptr += srcbytes - 4;
- count > 0;
- count -= 4, srcptr -= 4, dstptr += 4)
- {
- dstptr[0] = srcptr[0];
- dstptr[1] = srcptr[1];
- dstptr[2] = srcptr[2];
- dstptr[3] = srcptr[3];
- }
- break;
-
- case 48 : /* 16-bit RGB or CMY image */
- for (srcptr += srcbytes - 6;
- count > 0;
- count -= 6, srcptr -= 6, dstptr += 6)
- {
- dstptr[0] = srcptr[0];
- dstptr[1] = srcptr[1];
- dstptr[2] = srcptr[2];
- dstptr[3] = srcptr[3];
- dstptr[4] = srcptr[4];
- dstptr[5] = srcptr[5];
- }
- break;
-
- case 64 : /* 16-bit CMYK image */
- for (srcptr += srcbytes - 8;
- count > 0;
- count -= 8, srcptr -= 8, dstptr += 8)
- {
- dstptr[0] = srcptr[0];
- dstptr[1] = srcptr[1];
- dstptr[2] = srcptr[2];
- dstptr[3] = srcptr[3];
- dstptr[4] = srcptr[4];
- dstptr[5] = srcptr[5];
- dstptr[6] = srcptr[6];
- dstptr[7] = srcptr[7];
- }
- break;
- }
- }
-
- /*
- * Write the bitmap data to the raster stream...
- */
-
- cupsRasterWritePixels(cups->stream, dst, cups->header.cupsBytesPerLine);
- }
- else
- {
- /*
- * Write the scanline data to the raster stream...
- */
-
- cupsRasterWritePixels(cups->stream, srcptr, cups->header.cupsBytesPerLine);
- }
- }
-}
-
-
-/*
- * 'cups_print_banded()' - Print a page of banded pixels.
- */
-
-static void
-cups_print_banded(gx_device_printer *pdev,
- /* I - Printer device */
- unsigned char *src,
- /* I - Scanline buffer */
- unsigned char *dst,
- /* I - Bitmap buffer */
- int srcbytes)
- /* I - Number of bytes in src */
-{
- int x; /* Looping var */
- int y; /* Looping var */
- int bandbytes; /* Bytes per band */
- unsigned char bit; /* Current bit */
- unsigned char temp; /* Temporary variable */
- unsigned char *srcptr; /* Pointer to data */
- unsigned char *cptr, *mptr, *yptr, /* Pointer to components */
- *kptr, *lcptr, *lmptr; /* ... */
- int flip; /* Flip scanline? */
-
-
- if (cups->header.Duplex && !cups->header.Tumble &&
- cupsPPD && cupsPPD->flip_duplex && !(cups->page & 1))
- flip = 1;
- else
- flip = 0;
-
- fprintf(stderr, "DEBUG: cups_print_banded - flip = %d, height = %d\n",
- flip, cups->height);
-
- /*
- * Loop through the page bitmap and write banded pixels... We have
- * to separate each chunked color as needed...
- */
-
-#ifdef CUPS_RASTER_SYNCv1
- bandbytes = cups->header.cupsBytesPerLine / cups->header.cupsNumColors;
-#else
- if (cups->header.cupsColorSpace == CUPS_CSPACE_KCMYcm &&
- cups->header.cupsBitsPerColor == 1)
- bandbytes = cups->header.cupsBytesPerLine / 6;
- else
- bandbytes = cups->header.cupsBytesPerLine / cups->color_info.num_components;
-#endif /* CUPS_RASTER_SYNCv1 */
-
- for (y = 0; y < cups->height; y ++)
- {
- /*
- * Grab the scanline data...
- */
-
- if (gdev_prn_get_bits((gx_device_printer *)pdev, y, src, &srcptr) < 0)
- {
- fprintf(stderr, "ERROR: Unable to get scanline %d!\n", y);
- gs_exit(gs_lib_ctx_get_non_gc_memory_t(), 1);
- }
-
- /*
- * Separate the chunked colors into their components...
- */
-
- if (srcptr[0] == 0 && memcmp(srcptr, srcptr + 1, srcbytes - 1) == 0)
- memset(dst, 0, cups->header.cupsBytesPerLine);
- else
- {
- if (flip)
- cptr = dst + bandbytes - 1;
- else
- cptr = dst;
-
- mptr = cptr + bandbytes;
- yptr = mptr + bandbytes;
- kptr = yptr + bandbytes;
- lcptr = kptr + bandbytes;
- lmptr = lcptr + bandbytes;
-
- switch (cups->header.cupsBitsPerColor)
- {
- default :
- memset(dst, 0, cups->header.cupsBytesPerLine);
-
- switch (cups->header.cupsColorSpace)
- {
- default :
- for (x = cups->width, bit = flip ? 1 << (x & 7) : 128;
- x > 0;
- x --, srcptr ++)
- {
- if (*srcptr & 0x40)
- *cptr |= bit;
- if (*srcptr & 0x20)
- *mptr |= bit;
- if (*srcptr & 0x10)
- *yptr |= bit;
-
- if (flip)
- {
- if (bit < 128)
- bit <<= 1;
- else
- {
- cptr --;
- mptr --;
- yptr --;
- bit = 1;
- }
- }
- else
- bit >>= 1;
-
- x --;
- if (x == 0)
- break;
-
- if (*srcptr & 0x4)
- *cptr |= bit;
- if (*srcptr & 0x2)
- *mptr |= bit;
- if (*srcptr & 0x1)
- *yptr |= bit;
-
- if (flip)
- {
- if (bit < 128)
- bit <<= 1;
- else
- {
- cptr --;
- mptr --;
- yptr --;
- bit = 1;
- }
- }
- else if (bit > 1)
- bit >>= 1;
- else
- {
- cptr ++;
- mptr ++;
- yptr ++;
- bit = 128;
- }
- }
- break;
- case CUPS_CSPACE_GMCK :
- case CUPS_CSPACE_GMCS :
- case CUPS_CSPACE_RGBA :
- case CUPS_CSPACE_RGBW :
- case CUPS_CSPACE_CMYK :
- case CUPS_CSPACE_YMCK :
- case CUPS_CSPACE_KCMY :
- for (x = cups->width, bit = flip ? 1 << (x & 7) : 128;
- x > 0;
- x --, srcptr ++)
- {
- if (*srcptr & 0x80)
- *cptr |= bit;
- if (*srcptr & 0x40)
- *mptr |= bit;
- if (*srcptr & 0x20)
- *yptr |= bit;
- if (*srcptr & 0x10)
- *kptr |= bit;
-
- if (flip)
- {
- if (bit < 128)
- bit <<= 1;
- else
- {
- cptr --;
- mptr --;
- yptr --;
- kptr --;
- bit = 1;
- }
- }
- else
- bit >>= 1;
-
- x --;
- if (x == 0)
- break;
-
- if (*srcptr & 0x8)
- *cptr |= bit;
- if (*srcptr & 0x4)
- *mptr |= bit;
- if (*srcptr & 0x2)
- *yptr |= bit;
- if (*srcptr & 0x1)
- *kptr |= bit;
-
- if (flip)
- {
- if (bit < 128)
- bit <<= 1;
- else
- {
- cptr --;
- mptr --;
- yptr --;
- kptr --;
- bit = 1;
- }
- }
- else if (bit > 1)
- bit >>= 1;
- else
- {
- cptr ++;
- mptr ++;
- yptr ++;
- kptr ++;
- bit = 128;
- }
- }
- break;
- case CUPS_CSPACE_KCMYcm :
- for (x = cups->width, bit = flip ? 1 << (x & 7) : 128;
- x > 0;
- x --, srcptr ++)
- {
- /*
- * Note: Because of the way the pointers are setup,
- * the following code is correct even though
- * the names don't match...
- */
-
- if (*srcptr & 0x20)
- *cptr |= bit;
- if (*srcptr & 0x10)
- *mptr |= bit;
- if (*srcptr & 0x08)
- *yptr |= bit;
- if (*srcptr & 0x04)
- *kptr |= bit;
- if (*srcptr & 0x02)
- *lcptr |= bit;
- if (*srcptr & 0x01)
- *lmptr |= bit;
-
- if (flip)
- {
- if (bit < 128)
- bit <<= 1;
- else
- {
- cptr --;
- mptr --;
- yptr --;
- kptr --;
- lcptr --;
- lmptr --;
- bit = 1;
- }
- }
- else if (bit > 1)
- bit >>= 1;
- else
- {
- cptr ++;
- mptr ++;
- yptr ++;
- kptr ++;
- lcptr ++;
- lmptr ++;
- bit = 128;
- }
- }
- break;
- }
- break;
-
- case 2 :
- memset(dst, 0, cups->header.cupsBytesPerLine);
-
- switch (cups->header.cupsColorSpace)
- {
- default :
- for (x = cups->width, bit = flip ? 3 << (2 * (x & 3)) : 0xc0;
- x > 0;
- x --, srcptr ++)
- switch (bit)
- {
- case 0xc0 :
- if ((temp = *srcptr & 0x30) != 0)
- *cptr |= temp << 2;
- if ((temp = *srcptr & 0x0c) != 0)
- *mptr |= temp << 4;
- if ((temp = *srcptr & 0x03) != 0)
- *yptr |= temp << 6;
-
- if (flip)
- {
- bit = 0x03;
- cptr --;
- mptr --;
- yptr --;
- }
- else
- bit = 0x30;
- break;
- case 0x30 :
- if ((temp = *srcptr & 0x30) != 0)
- *cptr |= temp;
- if ((temp = *srcptr & 0x0c) != 0)
- *mptr |= temp << 2;
- if ((temp = *srcptr & 0x03) != 0)
- *yptr |= temp << 4;
-
- if (flip)
- bit = 0xc0;
- else
- bit = 0x0c;
- break;
- case 0x0c :
- if ((temp = *srcptr & 0x30) != 0)
- *cptr |= temp >> 2;
- if ((temp = *srcptr & 0x0c) != 0)
- *mptr |= temp;
- if ((temp = *srcptr & 0x03) != 0)
- *yptr |= temp << 2;
-
- if (flip)
- bit = 0x30;
- else
- bit = 0x03;
- break;
- case 0x03 :
- if ((temp = *srcptr & 0x30) != 0)
- *cptr |= temp >> 4;
- if ((temp = *srcptr & 0x0c) != 0)
- *mptr |= temp >> 2;
- if ((temp = *srcptr & 0x03) != 0)
- *yptr |= temp;
-
- if (flip)
- bit = 0x0c;
- else
- {
- bit = 0xc0;
- cptr ++;
- mptr ++;
- yptr ++;
- }
- break;
- }
- break;
- case CUPS_CSPACE_GMCK :
- case CUPS_CSPACE_GMCS :
- case CUPS_CSPACE_RGBA :
- case CUPS_CSPACE_RGBW :
- case CUPS_CSPACE_CMYK :
- case CUPS_CSPACE_YMCK :
- case CUPS_CSPACE_KCMY :
- case CUPS_CSPACE_KCMYcm :
- for (x = cups->width, bit = flip ? 3 << (2 * (x & 3)) : 0xc0;
- x > 0;
- x --, srcptr ++)
- switch (bit)
- {
- case 0xc0 :
- if ((temp = *srcptr & 0xc0) != 0)
- *cptr |= temp;
- if ((temp = *srcptr & 0x30) != 0)
- *mptr |= temp << 2;
- if ((temp = *srcptr & 0x0c) != 0)
- *yptr |= temp << 4;
- if ((temp = *srcptr & 0x03) != 0)
- *kptr |= temp << 6;
-
- if (flip)
- {
- bit = 0x03;
- cptr --;
- mptr --;
- yptr --;
- kptr --;
- }
- else
- bit = 0x30;
- break;
- case 0x30 :
- if ((temp = *srcptr & 0xc0) != 0)
- *cptr |= temp >> 2;
- if ((temp = *srcptr & 0x30) != 0)
- *mptr |= temp;
- if ((temp = *srcptr & 0x0c) != 0)
- *yptr |= temp << 2;
- if ((temp = *srcptr & 0x03) != 0)
- *kptr |= temp << 4;
-
- if (flip)
- bit = 0xc0;
- else
- bit = 0x0c;
- break;
- case 0x0c :
- if ((temp = *srcptr & 0xc0) != 0)
- *cptr |= temp >> 4;
- if ((temp = *srcptr & 0x30) != 0)
- *mptr |= temp >> 2;
- if ((temp = *srcptr & 0x0c) != 0)
- *yptr |= temp;
- if ((temp = *srcptr & 0x03) != 0)
- *kptr |= temp << 2;
-
- if (flip)
- bit = 0x30;
- else
- bit = 0x03;
- break;
- case 0x03 :
- if ((temp = *srcptr & 0xc0) != 0)
- *cptr |= temp >> 6;
- if ((temp = *srcptr & 0x30) != 0)
- *mptr |= temp >> 4;
- if ((temp = *srcptr & 0x0c) != 0)
- *yptr |= temp >> 2;
- if ((temp = *srcptr & 0x03) != 0)
- *kptr |= temp;
-
- if (flip)
- bit = 0x0c;
- else
- {
- bit = 0xc0;
- cptr ++;
- mptr ++;
- yptr ++;
- kptr ++;
- }
- break;
- }
- break;
- }
- break;
-
- case 4 :
- memset(dst, 0, cups->header.cupsBytesPerLine);
-
- switch (cups->header.cupsColorSpace)
- {
- default :
- for (x = cups->width, bit = flip && (x & 1) ? 0xf0 : 0x0f;
- x > 0;
- x --, srcptr += 2)
- switch (bit)
- {
- case 0xf0 :
- if ((temp = srcptr[0] & 0x0f) != 0)
- *cptr |= temp << 4;
- if ((temp = srcptr[1] & 0xf0) != 0)
- *mptr |= temp;
- if ((temp = srcptr[1] & 0x0f) != 0)
- *yptr |= temp << 4;
-
- bit = 0x0f;
-
- if (flip)
- {
- cptr --;
- mptr --;
- yptr --;
- }
- break;
- case 0x0f :
- if ((temp = srcptr[0] & 0x0f) != 0)
- *cptr |= temp;
- if ((temp = srcptr[1] & 0xf0) != 0)
- *mptr |= temp >> 4;
- if ((temp = srcptr[1] & 0x0f) != 0)
- *yptr |= temp;
-
- bit = 0xf0;
-
- if (!flip)
- {
- cptr ++;
- mptr ++;
- yptr ++;
- }
- break;
- }
- break;
- case CUPS_CSPACE_GMCK :
- case CUPS_CSPACE_GMCS :
- case CUPS_CSPACE_RGBA :
- case CUPS_CSPACE_RGBW :
- case CUPS_CSPACE_CMYK :
- case CUPS_CSPACE_YMCK :
- case CUPS_CSPACE_KCMY :
- case CUPS_CSPACE_KCMYcm :
- for (x = cups->width, bit = flip && (x & 1) ? 0xf0 : 0x0f;
- x > 0;
- x --, srcptr += 2)
- switch (bit)
- {
- case 0xf0 :
- if ((temp = srcptr[0] & 0xf0) != 0)
- *cptr |= temp;
- if ((temp = srcptr[0] & 0x0f) != 0)
- *mptr |= temp << 4;
- if ((temp = srcptr[1] & 0xf0) != 0)
- *yptr |= temp;
- if ((temp = srcptr[1] & 0x0f) != 0)
- *kptr |= temp << 4;
-
- bit = 0x0f;
-
- if (flip)
- {
- cptr --;
- mptr --;
- yptr --;
- kptr --;
- }
- break;
- case 0x0f :
- if ((temp = srcptr[0] & 0xf0) != 0)
- *cptr |= temp >> 4;
- if ((temp = srcptr[0] & 0x0f) != 0)
- *mptr |= temp;
- if ((temp = srcptr[1] & 0xf0) != 0)
- *yptr |= temp >> 4;
- if ((temp = srcptr[1] & 0x0f) != 0)
- *kptr |= temp;
-
- bit = 0xf0;
-
- if (!flip)
- {
- cptr ++;
- mptr ++;
- yptr ++;
- kptr ++;
- }
- break;
- }
- break;
- }
- break;
-
- case 8 :
- switch (cups->header.cupsColorSpace)
- {
- default :
- if (flip)
- for (x = cups->width; x > 0; x --)
- {
- *cptr-- = *srcptr++;
- *mptr-- = *srcptr++;
- *yptr-- = *srcptr++;
- }
- else
- for (x = cups->width; x > 0; x --)
- {
- *cptr++ = *srcptr++;
- *mptr++ = *srcptr++;
- *yptr++ = *srcptr++;
- }
- break;
- case CUPS_CSPACE_GMCK :
- case CUPS_CSPACE_GMCS :
- case CUPS_CSPACE_RGBA :
- case CUPS_CSPACE_RGBW :
- case CUPS_CSPACE_CMYK :
- case CUPS_CSPACE_YMCK :
- case CUPS_CSPACE_KCMY :
- case CUPS_CSPACE_KCMYcm :
- if (flip)
- for (x = cups->width; x > 0; x --)
- {
- *cptr-- = *srcptr++;
- *mptr-- = *srcptr++;
- *yptr-- = *srcptr++;
- *kptr-- = *srcptr++;
- }
- else
- for (x = cups->width; x > 0; x --)
- {
- *cptr++ = *srcptr++;
- *mptr++ = *srcptr++;
- *yptr++ = *srcptr++;
- *kptr++ = *srcptr++;
- }
- break;
- }
- break;
-
- case 16 :
- switch (cups->header.cupsColorSpace)
- {
- default :
- if (flip)
- for (x = cups->width; x > 0; x --, srcptr += 6)
- {
- *cptr-- = srcptr[1];
- *cptr-- = srcptr[0];
- *mptr-- = srcptr[3];
- *mptr-- = srcptr[2];
- *yptr-- = srcptr[5];
- *yptr-- = srcptr[4];
- }
- else
- for (x = cups->width; x > 0; x --)
- {
- *cptr++ = *srcptr++;
- *cptr++ = *srcptr++;
- *mptr++ = *srcptr++;
- *mptr++ = *srcptr++;
- *yptr++ = *srcptr++;
- *yptr++ = *srcptr++;
- }
- break;
- case CUPS_CSPACE_GMCK :
- case CUPS_CSPACE_GMCS :
- case CUPS_CSPACE_RGBA :
- case CUPS_CSPACE_RGBW :
- case CUPS_CSPACE_CMYK :
- case CUPS_CSPACE_YMCK :
- case CUPS_CSPACE_KCMY :
- case CUPS_CSPACE_KCMYcm :
- if (flip)
- for (x = cups->width; x > 0; x --, srcptr += 8)
- {
- *cptr-- = srcptr[1];
- *cptr-- = srcptr[0];
- *mptr-- = srcptr[3];
- *mptr-- = srcptr[2];
- *yptr-- = srcptr[5];
- *yptr-- = srcptr[4];
- *kptr-- = srcptr[7];
- *kptr-- = srcptr[6];
- }
- else
- for (x = cups->width; x > 0; x --)
- {
- *cptr++ = *srcptr++;
- *cptr++ = *srcptr++;
- *mptr++ = *srcptr++;
- *mptr++ = *srcptr++;
- *yptr++ = *srcptr++;
- *yptr++ = *srcptr++;
- *kptr++ = *srcptr++;
- *kptr++ = *srcptr++;
- }
- break;
- }
- break;
- }
- }
-
- /*
- * Write the bitmap data to the raster stream...
- */
-
- cupsRasterWritePixels(cups->stream, dst, cups->header.cupsBytesPerLine);
- }
-}
-
-
-/*
- * 'cups_print_planar()' - Print a page of planar pixels.
- */
-
-static void
-cups_print_planar(gx_device_printer *pdev,
- /* I - Printer device */
- unsigned char *src,
- /* I - Scanline buffer */
- unsigned char *dst,
- /* I - Bitmap buffer */
- int srcbytes)
- /* I - Number of bytes in src */
-{
- int x; /* Looping var */
- int y; /* Looping var */
- int z; /* Looping var */
- unsigned char srcbit; /* Current source bit */
- unsigned char dstbit; /* Current destination bit */
- unsigned char temp; /* Temporary variable */
- unsigned char *srcptr; /* Pointer to data */
- unsigned char *dstptr; /* Pointer to bitmap */
-
-
- /**** NOTE: Currently planar output doesn't support flipped duplex!!! ****/
-
- /*
- * Loop through the page bitmap and write planar pixels... We have
- * to separate each chunked color as needed...
- */
-
- for (z = 0; z < pdev->color_info.num_components; z ++)
- for (y = 0; y < cups->height; y ++)
- {
- /*
- * Grab the scanline data...
- */
-
- if (gdev_prn_get_bits((gx_device_printer *)pdev, y, src, &srcptr) < 0)
- {
- fprintf(stderr, "ERROR: Unable to get scanline %d!\n", y);
- gs_exit(gs_lib_ctx_get_non_gc_memory_t(), 1);
- }
-
- /*
- * Pull the individual color planes out of the pixels...
- */
-
- if (srcptr[0] == 0 && memcmp(srcptr, srcptr + 1, srcbytes - 1) == 0)
- memset(dst, 0, cups->header.cupsBytesPerLine);
- else
- switch (cups->header.cupsBitsPerColor)
- {
- default :
- memset(dst, 0, cups->header.cupsBytesPerLine);
-
- switch (cups->header.cupsColorSpace)
- {
- default :
- for (dstptr = dst, x = cups->width, srcbit = 64 >> z,
- dstbit = 128;
- x > 0;
- x --)
- {
- if (*srcptr & srcbit)
- *dstptr |= dstbit;
-
- if (srcbit >= 16)
- srcbit >>= 4;
- else
- {
- srcbit = 64 >> z;
- srcptr ++;
- }
-
- if (dstbit > 1)
- dstbit >>= 1;
- else
- {
- dstbit = 128;
- dstptr ++;
- }
- }
- break;
- case CUPS_CSPACE_GMCK :
- case CUPS_CSPACE_GMCS :
- case CUPS_CSPACE_RGBA :
- case CUPS_CSPACE_RGBW :
- case CUPS_CSPACE_CMYK :
- case CUPS_CSPACE_YMCK :
- case CUPS_CSPACE_KCMY :
- for (dstptr = dst, x = cups->width, srcbit = 128 >> z,
- dstbit = 128;
- x > 0;
- x --)
- {
- if (*srcptr & srcbit)
- *dstptr |= dstbit;
-
- if (srcbit >= 16)
- srcbit >>= 4;
- else
- {
- srcbit = 128 >> z;
- srcptr ++;
- }
-
- if (dstbit > 1)
- dstbit >>= 1;
- else
- {
- dstbit = 128;
- dstptr ++;
- }
- }
- break;
- case CUPS_CSPACE_KCMYcm :
- for (dstptr = dst, x = cups->width, srcbit = 32 >> z,
- dstbit = 128;
- x > 0;
- x --, srcptr ++)
- {
- if (*srcptr & srcbit)
- *dstptr |= dstbit;
-
- if (dstbit > 1)
- dstbit >>= 1;
- else
- {
- dstbit = 128;
- dstptr ++;
- }
- }
- break;
- }
- break;
-
- case 2 :
- memset(dst, 0, cups->header.cupsBytesPerLine);
-
- switch (cups->header.cupsColorSpace)
- {
- default :
- for (dstptr = dst, x = cups->width, srcbit = 48 >> (z * 2),
- dstbit = 0xc0;
- x > 0;
- x --, srcptr ++)
- {
- if ((temp = *srcptr & srcbit) != 0)
- {
- if (srcbit == dstbit)
- *dstptr |= temp;
- else
- {
- switch (srcbit)
- {
- case 0x30 :
- temp >>= 4;
- break;
- case 0x0c :
- temp >>= 2;
- break;
- }
-
- switch (dstbit)
- {
- case 0xc0 :
- *dstptr |= temp << 6;
- break;
- case 0x30 :
- *dstptr |= temp << 4;
- break;
- case 0x0c :
- *dstptr |= temp << 2;
- break;
- case 0x03 :
- *dstptr |= temp;
- break;
- }
- }
- }
-
- if (dstbit > 0x03)
- dstbit >>= 2;
- else
- {
- dstbit = 0xc0;
- dstptr ++;
- }
- }
- break;
- case CUPS_CSPACE_GMCK :
- case CUPS_CSPACE_GMCS :
- case CUPS_CSPACE_RGBA :
- case CUPS_CSPACE_RGBW :
- case CUPS_CSPACE_CMYK :
- case CUPS_CSPACE_YMCK :
- case CUPS_CSPACE_KCMY :
- case CUPS_CSPACE_KCMYcm :
- for (dstptr = dst, x = cups->width, srcbit = 192 >> (z * 2),
- dstbit = 0xc0;
- x > 0;
- x --, srcptr ++)
- {
- if ((temp = *srcptr & srcbit) != 0)
- {
- if (srcbit == dstbit)
- *dstptr |= temp;
- else
- {
- switch (srcbit)
- {
- case 0xc0 :
- temp >>= 6;
- break;
- case 0x30 :
- temp >>= 4;
- break;
- case 0x0c :
- temp >>= 2;
- break;
- }
-
- switch (dstbit)
- {
- case 0xc0 :
- *dstptr |= temp << 6;
- break;
- case 0x30 :
- *dstptr |= temp << 4;
- break;
- case 0x0c :
- *dstptr |= temp << 2;
- break;
- case 0x03 :
- *dstptr |= temp;
- break;
- }
- }
- }
-
- if (dstbit > 0x03)
- dstbit >>= 2;
- else
- {
- dstbit = 0xc0;
- dstptr ++;
- }
- }
- break;
- }
- break;
-
- case 4 :
- memset(dst, 0, cups->header.cupsBytesPerLine);
-
- switch (cups->header.cupsColorSpace)
- {
- default :
- if (z > 0)
- srcptr ++;
-
- if (z == 1)
- srcbit = 0xf0;
- else
- srcbit = 0x0f;
-
- for (dstptr = dst, x = cups->width, dstbit = 0xf0;
- x > 0;
- x --, srcptr += 2)
- {
- if ((temp = *srcptr & srcbit) != 0)
- {
- if (srcbit == dstbit)
- *dstptr |= temp;
- else
- {
- if (srcbit == 0xf0)
- temp >>= 4;
-
- if (dstbit == 0xf0)
- *dstptr |= temp << 4;
- else
- *dstptr |= temp;
- }
- }
-
- if (dstbit == 0xf0)
- dstbit = 0x0f;
- else
- {
- dstbit = 0xf0;
- dstptr ++;
- }
- }
- break;
- case CUPS_CSPACE_GMCK :
- case CUPS_CSPACE_GMCS :
- case CUPS_CSPACE_RGBA :
- case CUPS_CSPACE_RGBW :
- case CUPS_CSPACE_CMYK :
- case CUPS_CSPACE_YMCK :
- case CUPS_CSPACE_KCMY :
- case CUPS_CSPACE_KCMYcm :
- if (z > 1)
- srcptr ++;
-
- if (z & 1)
- srcbit = 0x0f;
- else
- srcbit = 0xf0;
-
- for (dstptr = dst, x = cups->width, dstbit = 0xf0;
- x > 0;
- x --, srcptr += 2)
- {
- if ((temp = *srcptr & srcbit) != 0)
- {
- if (srcbit == dstbit)
- *dstptr |= temp;
- else
- {
- if (srcbit == 0xf0)
- temp >>= 4;
-
- if (dstbit == 0xf0)
- *dstptr |= temp << 4;
- else
- *dstptr |= temp;
- }
- }
-
- if (dstbit == 0xf0)
- dstbit = 0x0f;
- else
- {
- dstbit = 0xf0;
- dstptr ++;
- }
- }
- break;
- }
- break;
-
- case 8 :
- for (srcptr += z, dstptr = dst, x = cups->header.cupsBytesPerLine;
- x > 0;
- srcptr += pdev->color_info.num_components, x --)
- *dstptr++ = *srcptr;
- break;
-
- case 16 :
- for (srcptr += 2 * z, dstptr = dst, x = cups->header.cupsBytesPerLine;
- x > 0;
- srcptr += 2 * pdev->color_info.num_components, x --)
- {
- *dstptr++ = srcptr[0];
- *dstptr++ = srcptr[1];
- }
- break;
- }
-
- /*
- * Write the bitmap data to the raster stream...
- */
-
- cupsRasterWritePixels(cups->stream, dst, cups->header.cupsBytesPerLine);
- }
-}
-
-
-/*
- * End of "$Id: gdevcups.c,v 1.43.2.23 2004/06/29 13:15:10 mike Exp $".
- */
diff --git a/gs/contrib/cups/pstopxl b/gs/contrib/cups/pstopxl
deleted file mode 100755
index 693d86ffe..000000000
--- a/gs/contrib/cups/pstopxl
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/sh
-#
-# "$Id: pstopxl.in,v 1.1.2.2 2004/06/29 13:15:10 mike Exp $"
-#
-# CUPS PCL XL/PCL 6 filter script for Ghostscript.
-#
-# Copyright 2001-2005 by Easy Software Products.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-
-# Installation directories...
-prefix=/usr/local
-exec_prefix=${prefix}
-bindir=${exec_prefix}/bin
-
-# Set the library/font path...
-GS_LIB="${CUPS_FONTPATH:=/usr/share/cups/fonts}"
-export GS_LIB
-
-# Determine the PCL XL/PCL 6 driver to use...
-if test "x$PPD" != x; then
- colordevice=`grep '^*ColorDevice:' "$PPD" | awk -F: '{print $2}'`
- case "$colordevice" in
- *True* | *true*)
- device="pxlcolor"
- ;;
- *)
- device="pxlmono"
- ;;
- esac
-else
- device="pxlmono"
-fi
-
-# Options we use with Ghostscript...
-gsopts="-dQUIET -dDEBUG -dPARANOIDSAFER -dNOPAUSE -dBATCH"
-gsopts="$gsopts -dNOMEDIAATTRS -sDEVICE=$device -sstdout=%stderr"
-
-# See if we have a filename on the command-line...
-if test -z "$6"; then
- ifile="-"
-else
- ifile="$6"
-fi
-
-echo INFO: Starting GPL Ghostscript 8.57... 1>&2
-echo DEBUG: Running $bindir/gs $gsopts -sOUTPUTFILE="%stdout" "$ifile" 1>&2
-
-# Now run Ghostscript...
-exec $bindir/gs $gsopts -sOUTPUTFILE="%stdout" "$ifile"
-
-#
-# End of "$Id: pstopxl.in,v 1.1.2.2 2004/06/29 13:15:10 mike Exp $".
-#
diff --git a/gs/contrib/cups/pstopxl.in b/gs/contrib/cups/pstopxl.in
deleted file mode 100755
index dfa1f3781..000000000
--- a/gs/contrib/cups/pstopxl.in
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/sh
-#
-# "$Id: pstopxl.in,v 1.1.2.2 2004/06/29 13:15:10 mike Exp $"
-#
-# CUPS PCL XL/PCL 6 filter script for Ghostscript.
-#
-# Copyright 2001-2005 by Easy Software Products.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-
-# Installation directories...
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-bindir=@bindir@
-
-# Set the library/font path...
-GS_LIB="${CUPS_FONTPATH:=/usr/share/cups/fonts}"
-export GS_LIB
-
-# Determine the PCL XL/PCL 6 driver to use...
-if test "x$PPD" != x; then
- colordevice=`grep '^*ColorDevice:' "$PPD" | awk -F: '{print $2}'`
- case "$colordevice" in
- *True* | *true*)
- device="pxlcolor"
- ;;
- *)
- device="pxlmono"
- ;;
- esac
-else
- device="pxlmono"
-fi
-
-# Options we use with Ghostscript...
-gsopts="-dQUIET -dDEBUG -dPARANOIDSAFER -dNOPAUSE -dBATCH"
-gsopts="$gsopts -dNOMEDIAATTRS -sDEVICE=$device -sstdout=%stderr"
-
-# See if we have a filename on the command-line...
-if test -z "$6"; then
- ifile="-"
-else
- ifile="$6"
-fi
-
-echo INFO: Starting GPL Ghostscript @GS_VERSION_MAJOR@.@GS_VERSION_MINOR0@... 1>&2
-echo DEBUG: Running $bindir/@GS@ $gsopts -sOUTPUTFILE="%stdout" "$ifile" 1>&2
-
-# Now run Ghostscript...
-exec $bindir/@GS@ $gsopts -sOUTPUTFILE="%stdout" "$ifile"
-
-#
-# End of "$Id: pstopxl.in,v 1.1.2.2 2004/06/29 13:15:10 mike Exp $".
-#
diff --git a/gs/contrib/cups/pstoraster b/gs/contrib/cups/pstoraster
deleted file mode 100755
index 5fde1430d..000000000
--- a/gs/contrib/cups/pstoraster
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/sh
-#
-# "$Id: pstoraster.in,v 1.3.2.4 2004/06/29 13:15:10 mike Exp $"
-#
-# CUPS raster filter script for Ghostscript.
-#
-# Copyright 2001-2005 by Easy Software Products.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-
-# Installation directories...
-prefix=/usr/local
-exec_prefix=${prefix}
-bindir=${exec_prefix}/bin
-
-# Set the library/font path...
-GS_LIB="${CUPS_FONTPATH:=/usr/share/cups/fonts}"
-export GS_LIB
-
-# Options we use with Ghostscript...
-gsopts="-dQUIET -dDEBUG -dPARANOIDSAFER -dNOPAUSE -dBATCH"
-gsopts="$gsopts -dNOMEDIAATTRS -sDEVICE=cups -sstdout=%stderr"
-
-# See if we have a profile=n,n,n,n,n,n,n,n,n,n,n option...
-profile=""
-for option in $5; do
- case $option in
- profile=*)
- profile="<</cupsProfile(`echo $option | awk -F= '{print $2}'`)>>setpagedevice"
- ;;
- esac
-done
-
-# See if we have a filename on the command-line...
-if test -z "$6"; then
- ifile="-"
-else
- ifile="$6"
-fi
-
-echo INFO: Starting GPL Ghostscript 8.57... 1>&2
-echo DEBUG: Running $bindir/gs $gsopts -sOUTPUTFILE="%stdout" -c"$profile" "$ifile" 1>&2
-
-# Now run Ghostscript...
-exec $bindir/gs $gsopts -sOUTPUTFILE="%stdout" -c"$profile" "$ifile"
-
-#
-# End of "$Id: pstoraster.in,v 1.3.2.4 2004/06/29 13:15:10 mike Exp $".
-#
diff --git a/gs/contrib/cups/pstoraster.convs b/gs/contrib/cups/pstoraster.convs
deleted file mode 100644
index ae06f283c..000000000
--- a/gs/contrib/cups/pstoraster.convs
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# "$Id: pstoraster.convs,v 1.1.2.3 2003/07/20 22:54:45 mike Exp $"
-#
-# MIME converts file for Ghostscript.
-#
-# Copyright 1997-2005 by Easy Software Products.
-#
-# These coded instructions, statements, and computer programs are the
-# property of Easy Software Products and are protected by Federal
-# copyright law. Distribution and use rights are outlined in the file
-# "LICENSE.txt" which should have been included with this file. If this
-# file is missing or damaged please contact Easy Software Products
-# at:
-#
-# Attn: CUPS Licensing Information
-# Easy Software Products
-# 44141 Airport View Drive, Suite 204
-# Hollywood, Maryland 20636 USA
-#
-# Voice: (301) 373-9600
-# EMail: cups-info@cups.org
-# WWW: http://www.cups.org
-#
-
-application/vnd.cups-postscript application/vnd.cups-raster 100 pstoraster
-
-#
-# End of "$Id: pstoraster.convs,v 1.1.2.3 2003/07/20 22:54:45 mike Exp $".
-#
diff --git a/gs/contrib/cups/pstoraster.in b/gs/contrib/cups/pstoraster.in
deleted file mode 100755
index d8062e964..000000000
--- a/gs/contrib/cups/pstoraster.in
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/sh
-#
-# "$Id: pstoraster.in,v 1.3.2.4 2004/06/29 13:15:10 mike Exp $"
-#
-# CUPS raster filter script for Ghostscript.
-#
-# Copyright 2001-2005 by Easy Software Products.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-
-# Installation directories...
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-bindir=@bindir@
-
-# Set the library/font path...
-GS_LIB="${CUPS_FONTPATH:=/usr/share/cups/fonts}"
-export GS_LIB
-
-# Options we use with Ghostscript...
-gsopts="-dQUIET -dDEBUG -dPARANOIDSAFER -dNOPAUSE -dBATCH"
-gsopts="$gsopts -dNOMEDIAATTRS -sDEVICE=cups -sstdout=%stderr"
-
-# See if we have a profile=n,n,n,n,n,n,n,n,n,n,n option...
-profile=""
-for option in $5; do
- case $option in
- profile=*)
- profile="<</cupsProfile(`echo $option | awk -F= '{print $2}'`)>>setpagedevice"
- ;;
- esac
-done
-
-# See if we have a filename on the command-line...
-if test -z "$6"; then
- ifile="-"
-else
- ifile="$6"
-fi
-
-echo INFO: Starting GPL Ghostscript @GS_VERSION_MAJOR@.@GS_VERSION_MINOR0@... 1>&2
-echo DEBUG: Running $bindir/@GS@ $gsopts -sOUTPUTFILE="%stdout" -c"$profile" "$ifile" 1>&2
-
-# Now run Ghostscript...
-exec $bindir/@GS@ $gsopts -sOUTPUTFILE="%stdout" -c"$profile" "$ifile"
-
-#
-# End of "$Id: pstoraster.in,v 1.3.2.4 2004/06/29 13:15:10 mike Exp $".
-#
diff --git a/gs/contrib/cups/pxlcolor.ppd b/gs/contrib/cups/pxlcolor.ppd
deleted file mode 100644
index 5b80c639d..000000000
--- a/gs/contrib/cups/pxlcolor.ppd
+++ /dev/null
@@ -1,206 +0,0 @@
-*PPD-Adobe: "4.3"
-*%
-*% "$Id: pxlcolor.ppd,v 1.1.2.1 2003/07/20 22:54:45 mike Exp $"
-*%
-*% Sample color PCL XL/PCL 6 driver PPD file for the Common UNIX
-*% Printing System (CUPS).
-*%
-*% Copyright 1997-2005 by Easy Software Products.
-*%
-*% These coded instructions, statements, and computer programs are the
-*% property of Easy Software Products and are protected by Federal
-*% copyright law. Distribution and use rights are outlined in the file
-*% "LICENSE.txt" which should have been included with this file. If this
-*% file is missing or damaged please contact Easy Software Products
-*% at:
-*%
-*% Attn: CUPS Licensing Information
-*% Easy Software Products
-*% 44141 Airport View Drive, Suite 204
-*% Hollywood, Maryland 20636 USA
-*%
-*% Voice: (301) 373-9600
-*% EMail: cups-info@cups.org
-*% WWW: http://www.cups.org
-*%
-*FormatVersion: "4.3"
-*FileVersion: "1.1"
-*LanguageVersion: English
-*LanguageEncoding: ISOLatin1
-*PCFileName: "PXLCOLOR.PPD"
-*Manufacturer: "ESP"
-*Product: "(ESP Ghostscript)"
-*cupsVersion: 1.1
-*cupsManualCopies: False
-*cupsFilter: "application/vnd.cups-postscript 0 pstopxl"
-*ModelName: "HP Color LaserJet Series PCL 6"
-*ShortNickName: "HP Color LaserJet Series PCL 6"
-*NickName: "HP Color LaserJet Series PCL 6 CUPS"
-*PSVersion: "(3010.000) 81500"
-*LanguageLevel: "3"
-*ColorDevice: True
-*DefaultColorSpace: RGB
-*FileSystem: False
-*Throughput: "8"
-*LandscapeOrientation: Plus90
-*TTRasterizer: Type42
-
-*UIConstraints: *PageSize Executive *InputSlot Envelope
-*UIConstraints: *PageSize Letter *InputSlot Envelope
-*UIConstraints: *PageSize Legal *InputSlot Envelope
-*UIConstraints: *PageSize Tabloid *InputSlot Envelope
-*UIConstraints: *PageSize A3 *InputSlot Envelope
-*UIConstraints: *PageSize A4 *InputSlot Envelope
-*UIConstraints: *PageSize A5 *InputSlot Envelope
-*UIConstraints: *PageSize B5 *InputSlot Envelope
-*UIConstraints: *Duplex *OptionDuplex False
-
-*OpenUI *PageSize/Media Size: PickOne
-*OrderDependency: 10 AnySetup *PageSize
-*DefaultPageSize: Letter
-*PageSize Letter/US Letter: "<</PageSize[612 792]/ImagingBBox null>>setpagedevice"
-*PageSize Legal/US Legal: "<</PageSize[612 1008]/ImagingBBox null>>setpagedevice"
-*PageSize Executive/US Executive: "<</PageSize[522 756]/ImagingBBox null>>setpagedevice"
-*PageSize Tabloid/US Tabloid: "<</PageSize[792 1224]/ImagingBBox null>>setpagedevice"
-*PageSize A3/A3: "<</PageSize[842 1191]/ImagingBBox null>>setpagedevice"
-*PageSize A4/A4: "<</PageSize[595 842]/ImagingBBox null>>setpagedevice"
-*PageSize A5/A5: "<</PageSize[421 595]/ImagingBBox null>>setpagedevice"
-*PageSize B5/B5 (JIS): "<</PageSize[516 729]/ImagingBBox null>>setpagedevice"
-*PageSize EnvISOB5/Envelope B5: "<</PageSize[499 709]/ImagingBBox null>>setpagedevice"
-*PageSize Env10/Envelope #10: "<</PageSize[297 684]/ImagingBBox null>>setpagedevice"
-*PageSize EnvC5/Envelope C5: "<</PageSize[459 649]/ImagingBBox null>>setpagedevice"
-*PageSize EnvDL/Envelope DL: "<</PageSize[312 624]/ImagingBBox null>>setpagedevice"
-*PageSize EnvMonarch/Envelope Monarch: "<</PageSize[279 540]/ImagingBBox null>>setpagedevice"
-*CloseUI: *PageSize
-
-*OpenUI *PageRegion: PickOne
-*OrderDependency: 10 AnySetup *PageRegion
-*DefaultPageRegion: Letter
-*PageRegion Letter/US Letter: "<</PageSize[612 792]/ImagingBBox null>>setpagedevice"
-*PageRegion Legal/US Legal: "<</PageSize[612 1008]/ImagingBBox null>>setpagedevice"
-*PageRegion Executive/US Executive: "<</PageSize[522 756]/ImagingBBox null>>setpagedevice"
-*PageRegion Tabloid/US Tabloid: "<</PageSize[792 1224]/ImagingBBox null>>setpagedevice"
-*PageRegion A3/A3: "<</PageSize[842 1191]/ImagingBBox null>>setpagedevice"
-*PageRegion A4/A4: "<</PageSize[595 842]/ImagingBBox null>>setpagedevice"
-*PageRegion A5/A5: "<</PageSize[421 595]/ImagingBBox null>>setpagedevice"
-*PageRegion B5/B5 (JIS): "<</PageSize[516 729]/ImagingBBox null>>setpagedevice"
-*PageRegion EnvISOB5/Envelope B5: "<</PageSize[499 709]/ImagingBBox null>>setpagedevice"
-*PageRegion Env10/Envelope #10: "<</PageSize[297 684]/ImagingBBox null>>setpagedevice"
-*PageRegion EnvC5/Envelope C5: "<</PageSize[459 649]/ImagingBBox null>>setpagedevice"
-*PageRegion EnvDL/Envelope DL: "<</PageSize[312 624]/ImagingBBox null>>setpagedevice"
-*PageRegion EnvMonarch/Envelope Monarch: "<</PageSize[279 540]/ImagingBBox null>>setpagedevice"
-*CloseUI: *PageRegion
-
-*DefaultImageableArea: Letter
-*ImageableArea Letter/US Letter: "12 12 600 780"
-*ImageableArea Legal/US Legal: "12 12 600 996"
-*ImageableArea Executive/US Executive: "12 12 510 708"
-*ImageableArea Tabloid/US Tabloid: "12 12 780 1212"
-*ImageableArea A3/A3: "12 12 830 1179"
-*ImageableArea A4/A4: "12 12 583 830"
-*ImageableArea A5/A5: "12 12 409 583"
-*ImageableArea B5/JIS B5: "12 12 504 717"
-*ImageableArea EnvISOB5/B5 (ISO): "12 12 469 697"
-*ImageableArea Env10/Com-10: "12 12 285 672"
-*ImageableArea EnvC5/EnvC5: "12 12 447 637"
-*ImageableArea EnvDL/EnvDL: "12 12 300 612"
-*ImageableArea EnvMonarch/Envelope Monarch: "12 12 267 528"
-
-*DefaultPaperDimension: Letter
-*PaperDimension Letter/US Letter: "612 792"
-*PaperDimension Legal/US Legal: "612 1008"
-*PaperDimension Executive/US Executive: "522 756"
-*PaperDimension Tabloid/US Tabloid: "792 1224"
-*PaperDimension A3/A3: "842 1191"
-*PaperDimension A4/A4: "595 842"
-*PaperDimension A5/A5: "421 595"
-*PaperDimension B5/B5 (JIS): "516 729"
-*PaperDimension EnvISOB5/Envelope B5: "499 709"
-*PaperDimension Env10/Envelope #10: "297 684"
-*PaperDimension EnvC5/Envelope C5: "459 649"
-*PaperDimension EnvDL/Envelope DL: "312 624"
-*PaperDimension EnvMonarch/Envelope Monarch: "279 540"
-
-*OpenUI *InputSlot/Media Source: PickOne
-*OrderDependency: 10 AnySetup *InputSlot
-*DefaultInputSlot: Default
-*InputSlot Default/Default: "<</MediaPosition 0>>setpagedevice"
-*InputSlot Auto/Automatically Select: "<</MediaPosition 1>>setpagedevice"
-*InputSlot MultiPurpose/Tray 1: "<</MediaPosition 3>>setpagedevice"
-*InputSlot Upper/Tray 2: "<</MediaPosition 4>>setpagedevice"
-*InputSlot Lower/Tray 3: "<</MediaPosition 5>>setpagedevice"
-*InputSlot LargeCapacity/Tray 4: "<</MediaPosition 7>>setpagedevice"
-*InputSlot Manual/Manual Feed: "<</MediaPosition 2>>setpagedevice"
-*InputSlot Envelope/Envelope Feed: "<</MediaPosition 6>>setpagedevice"
-*CloseUI: *InputSlot
-
-*OpenUI *ColorModel/Output Mode: PickOne
-*OrderDependency: 10 AnySetup *ColorModel
-*DefaultColorModel: RGB
-*ColorModel RGB/Color: "<</BitsPerPixel 24>>setpagedevice"
-*ColorModel Gray/Grayscale: "<</BitsPerPixel 8>>setpagedevice"
-*CloseUI: *ColorModel
-
-*OpenUI *Resolution/Output Resolution: PickOne
-*OrderDependency: 20 AnySetup *Resolution
-*DefaultResolution: 300dpi
-*Resolution 150dpi/150 DPI: "<</HWResolution[150 150]>>setpagedevice"
-*Resolution 300dpi/300 DPI: "<</HWResolution[300 300]>>setpagedevice"
-*Resolution 600dpi/600 DPI: "<</HWResolution[600 600]>>setpagedevice"
-*CloseUI: *Resolution
-
-*OpenUI *Duplex/Double-Sided Printing: PickOne
-*OrderDependency: 20 AnySetup *Duplex
-*DefaultDuplex: None
-*Duplex None/Off: "<</Duplex false>>setpagedevice"
-*Duplex DuplexNoTumble/Long Edge (Standard): "<</Duplex true/Tumble false>>setpagedevice"
-*Duplex DuplexTumble/Short Edge (Flip): "<</Duplex true/Tumble true>>setpagedevice"
-*CloseUI: *Duplex
-
-*OpenGroup: InstallableOptions
-*OpenUI *OptionDuplex/Duplexer: Boolean
-*DefaultOptionDuplex: False
-*OptionDuplex True/Installed: ""
-*OptionDuplex False/Not Installed: ""
-*CloseUI: *OptionDuplex
-*CloseGroup: InstallableOptions
-
-*DefaultFont: Courier
-*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
-*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
-*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
-*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
-*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
-*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
-*Font Bookman-Light: Standard "(001.004S)" Standard ROM
-*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
-*Font Courier: Standard "(002.004S)" Standard ROM
-*Font Courier-Bold: Standard "(002.004S)" Standard ROM
-*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
-*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
-*Font Helvetica: Standard "(001.006S)" Standard ROM
-*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
-*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
-*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
-*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
-*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
-*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
-*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
-*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
-*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
-*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
-*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
-*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
-*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
-*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
-*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
-*Font Symbol: Special "(001.007S)" Special ROM
-*Font Times-Bold: Standard "(001.007S)" Standard ROM
-*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
-*Font Times-Italic: Standard "(001.007S)" Standard ROM
-*Font Times-Roman: Standard "(001.007S)" Standard ROM
-*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
-*Font ZapfDingbats: Special "(001.004S)" Standard ROM
-*%
-*% End of "$Id: pxlcolor.ppd,v 1.1.2.1 2003/07/20 22:54:45 mike Exp $".
-*%
diff --git a/gs/contrib/cups/pxlmono.ppd b/gs/contrib/cups/pxlmono.ppd
deleted file mode 100644
index 806df0f4d..000000000
--- a/gs/contrib/cups/pxlmono.ppd
+++ /dev/null
@@ -1,200 +0,0 @@
-*PPD-Adobe: "4.3"
-*%
-*% "$Id: pxlmono.ppd,v 1.1.2.1 2003/07/20 22:54:45 mike Exp $"
-*%
-*% Sample monochrome PCL XL/PCL 6 driver PPD file for the Common UNIX
-*% Printing System (CUPS).
-*%
-*% Copyright 1997-2005 by Easy Software Products.
-*%
-*% These coded instructions, statements, and computer programs are the
-*% property of Easy Software Products and are protected by Federal
-*% copyright law. Distribution and use rights are outlined in the file
-*% "LICENSE.txt" which should have been included with this file. If this
-*% file is missing or damaged please contact Easy Software Products
-*% at:
-*%
-*% Attn: CUPS Licensing Information
-*% Easy Software Products
-*% 44141 Airport View Drive, Suite 204
-*% Hollywood, Maryland 20636 USA
-*%
-*% Voice: (301) 373-9600
-*% EMail: cups-info@cups.org
-*% WWW: http://www.cups.org
-*%
-*FormatVersion: "4.3"
-*FileVersion: "1.1"
-*LanguageVersion: English
-*LanguageEncoding: ISOLatin1
-*PCFileName: "PXLMONO.PPD"
-*Manufacturer: "ESP"
-*Product: "(ESP Ghostscript)"
-*cupsVersion: 1.1
-*cupsManualCopies: False
-*cupsFilter: "application/vnd.cups-postscript 0 pstopxl"
-*ModelName: "HP LaserJet Series PCL 6"
-*ShortNickName: "HP LaserJet Series PCL 6"
-*NickName: "HP LaserJet Series PCL 6 CUPS"
-*PSVersion: "(3010.000) 81500"
-*LanguageLevel: "3"
-*ColorDevice: False
-*DefaultColorSpace: Gray
-*FileSystem: False
-*Throughput: "8"
-*LandscapeOrientation: Plus90
-*TTRasterizer: Type42
-
-*UIConstraints: *PageSize Executive *InputSlot Envelope
-*UIConstraints: *PageSize Letter *InputSlot Envelope
-*UIConstraints: *PageSize Legal *InputSlot Envelope
-*UIConstraints: *PageSize Tabloid *InputSlot Envelope
-*UIConstraints: *PageSize A3 *InputSlot Envelope
-*UIConstraints: *PageSize A4 *InputSlot Envelope
-*UIConstraints: *PageSize A5 *InputSlot Envelope
-*UIConstraints: *PageSize B5 *InputSlot Envelope
-*UIConstraints: *Duplex *OptionDuplex False
-
-*OpenUI *PageSize/Media Size: PickOne
-*OrderDependency: 10 AnySetup *PageSize
-*DefaultPageSize: Letter
-*PageSize Letter/US Letter: "<</PageSize[612 792]/ImagingBBox null>>setpagedevice"
-*PageSize Legal/US Legal: "<</PageSize[612 1008]/ImagingBBox null>>setpagedevice"
-*PageSize Executive/US Executive: "<</PageSize[522 756]/ImagingBBox null>>setpagedevice"
-*PageSize Tabloid/US Tabloid: "<</PageSize[792 1224]/ImagingBBox null>>setpagedevice"
-*PageSize A3/A3: "<</PageSize[842 1191]/ImagingBBox null>>setpagedevice"
-*PageSize A4/A4: "<</PageSize[595 842]/ImagingBBox null>>setpagedevice"
-*PageSize A5/A5: "<</PageSize[421 595]/ImagingBBox null>>setpagedevice"
-*PageSize B5/B5 (JIS): "<</PageSize[516 729]/ImagingBBox null>>setpagedevice"
-*PageSize EnvISOB5/Envelope B5: "<</PageSize[499 709]/ImagingBBox null>>setpagedevice"
-*PageSize Env10/Envelope #10: "<</PageSize[297 684]/ImagingBBox null>>setpagedevice"
-*PageSize EnvC5/Envelope C5: "<</PageSize[459 649]/ImagingBBox null>>setpagedevice"
-*PageSize EnvDL/Envelope DL: "<</PageSize[312 624]/ImagingBBox null>>setpagedevice"
-*PageSize EnvMonarch/Envelope Monarch: "<</PageSize[279 540]/ImagingBBox null>>setpagedevice"
-*CloseUI: *PageSize
-
-*OpenUI *PageRegion: PickOne
-*OrderDependency: 10 AnySetup *PageRegion
-*DefaultPageRegion: Letter
-*PageRegion Letter/US Letter: "<</PageSize[612 792]/ImagingBBox null>>setpagedevice"
-*PageRegion Legal/US Legal: "<</PageSize[612 1008]/ImagingBBox null>>setpagedevice"
-*PageRegion Executive/US Executive: "<</PageSize[522 756]/ImagingBBox null>>setpagedevice"
-*PageRegion Tabloid/US Tabloid: "<</PageSize[792 1224]/ImagingBBox null>>setpagedevice"
-*PageRegion A3/A3: "<</PageSize[842 1191]/ImagingBBox null>>setpagedevice"
-*PageRegion A4/A4: "<</PageSize[595 842]/ImagingBBox null>>setpagedevice"
-*PageRegion A5/A5: "<</PageSize[421 595]/ImagingBBox null>>setpagedevice"
-*PageRegion B5/B5 (JIS): "<</PageSize[516 729]/ImagingBBox null>>setpagedevice"
-*PageRegion EnvISOB5/Envelope B5: "<</PageSize[499 709]/ImagingBBox null>>setpagedevice"
-*PageRegion Env10/Envelope #10: "<</PageSize[297 684]/ImagingBBox null>>setpagedevice"
-*PageRegion EnvC5/Envelope C5: "<</PageSize[459 649]/ImagingBBox null>>setpagedevice"
-*PageRegion EnvDL/Envelope DL: "<</PageSize[312 624]/ImagingBBox null>>setpagedevice"
-*PageRegion EnvMonarch/Envelope Monarch: "<</PageSize[279 540]/ImagingBBox null>>setpagedevice"
-*CloseUI: *PageRegion
-
-*DefaultImageableArea: Letter
-*ImageableArea Letter/US Letter: "12 12 600 780"
-*ImageableArea Legal/US Legal: "12 12 600 996"
-*ImageableArea Executive/US Executive: "12 12 510 708"
-*ImageableArea Tabloid/US Tabloid: "12 12 780 1212"
-*ImageableArea A3/A3: "12 12 830 1179"
-*ImageableArea A4/A4: "12 12 583 830"
-*ImageableArea A5/A5: "12 12 409 583"
-*ImageableArea B5/JIS B5: "12 12 504 717"
-*ImageableArea EnvISOB5/B5 (ISO): "12 12 469 697"
-*ImageableArea Env10/Com-10: "12 12 285 672"
-*ImageableArea EnvC5/EnvC5: "12 12 447 637"
-*ImageableArea EnvDL/EnvDL: "12 12 300 612"
-*ImageableArea EnvMonarch/Envelope Monarch: "12 12 267 528"
-
-*DefaultPaperDimension: Letter
-*PaperDimension Letter/US Letter: "612 792"
-*PaperDimension Legal/US Legal: "612 1008"
-*PaperDimension Executive/US Executive: "522 756"
-*PaperDimension Tabloid/US Tabloid: "792 1224"
-*PaperDimension A3/A3: "842 1191"
-*PaperDimension A4/A4: "595 842"
-*PaperDimension A5/A5: "421 595"
-*PaperDimension B5/B5 (JIS): "516 729"
-*PaperDimension EnvISOB5/Envelope B5: "499 709"
-*PaperDimension Env10/Envelope #10: "297 684"
-*PaperDimension EnvC5/Envelope C5: "459 649"
-*PaperDimension EnvDL/Envelope DL: "312 624"
-*PaperDimension EnvMonarch/Envelope Monarch: "279 540"
-
-*OpenUI *InputSlot/Media Source: PickOne
-*OrderDependency: 10 AnySetup *InputSlot
-*DefaultInputSlot: Default
-*InputSlot Default/Default: "<</MediaPosition 0>>setpagedevice"
-*InputSlot Auto/Automatically Select: "<</MediaPosition 1>>setpagedevice"
-*InputSlot MultiPurpose/Tray 1: "<</MediaPosition 3>>setpagedevice"
-*InputSlot Upper/Tray 2: "<</MediaPosition 4>>setpagedevice"
-*InputSlot Lower/Tray 3: "<</MediaPosition 5>>setpagedevice"
-*InputSlot LargeCapacity/Tray 4: "<</MediaPosition 7>>setpagedevice"
-*InputSlot Manual/Manual Feed: "<</MediaPosition 2>>setpagedevice"
-*InputSlot Envelope/Envelope Feed: "<</MediaPosition 6>>setpagedevice"
-*CloseUI: *InputSlot
-
-*OpenUI *Resolution/Output Resolution: PickOne
-*OrderDependency: 20 AnySetup *Resolution
-*DefaultResolution: 600dpi
-*Resolution 150dpi/150 DPI: "<</HWResolution[150 150]>>setpagedevice"
-*Resolution 300dpi/300 DPI: "<</HWResolution[300 300]>>setpagedevice"
-*Resolution 600dpi/600 DPI: "<</HWResolution[600 600]>>setpagedevice"
-*Resolution 1200dpi/1200 DPI: "<</HWResolution[1200 1200]>>setpagedevice"
-*CloseUI: *Resolution
-
-*OpenUI *Duplex/Double-Sided Printing: PickOne
-*OrderDependency: 20 AnySetup *Duplex
-*DefaultDuplex: None
-*Duplex None/Off: "<</Duplex false>>setpagedevice"
-*Duplex DuplexNoTumble/Long Edge (Standard): "<</Duplex true/Tumble false>>setpagedevice"
-*Duplex DuplexTumble/Short Edge (Flip): "<</Duplex true/Tumble true>>setpagedevice"
-*CloseUI: *Duplex
-
-*OpenGroup: InstallableOptions
-*OpenUI *OptionDuplex/Duplexer: Boolean
-*DefaultOptionDuplex: False
-*OptionDuplex True/Installed: ""
-*OptionDuplex False/Not Installed: ""
-*CloseUI: *OptionDuplex
-*CloseGroup: InstallableOptions
-
-*DefaultFont: Courier
-*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
-*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
-*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
-*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
-*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
-*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
-*Font Bookman-Light: Standard "(001.004S)" Standard ROM
-*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
-*Font Courier: Standard "(002.004S)" Standard ROM
-*Font Courier-Bold: Standard "(002.004S)" Standard ROM
-*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
-*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
-*Font Helvetica: Standard "(001.006S)" Standard ROM
-*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
-*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
-*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
-*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
-*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
-*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
-*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
-*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
-*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
-*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
-*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
-*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
-*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
-*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
-*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
-*Font Symbol: Special "(001.007S)" Special ROM
-*Font Times-Bold: Standard "(001.007S)" Standard ROM
-*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
-*Font Times-Italic: Standard "(001.007S)" Standard ROM
-*Font Times-Roman: Standard "(001.007S)" Standard ROM
-*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
-*Font ZapfDingbats: Special "(001.004S)" Standard ROM
-*%
-*% End of "$Id: pxlmono.ppd,v 1.1.2.1 2003/07/20 22:54:45 mike Exp $".
-*%
diff --git a/gs/contrib/defs.h b/gs/contrib/defs.h
deleted file mode 100644
index f7e781051..000000000
--- a/gs/contrib/defs.h
+++ /dev/null
@@ -1,327 +0,0 @@
-/*******************************************************************************/
-/* */
-/* FILE: defs.h */
-/* */
-/* Header file to satisfy defines for gomni.c .*/
-/* */
-/* */
-/* Created: 03-21-2000 */
-/* */
-/* */
-/* */
-/*******************************************************************************/
-/*
- * IBM Omni driver
- * Copyright (c) International Business Machines Corp., 2000
- *
- * This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- * the GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Portions of this file are used with permission granted by Aladdin
- * Enterprises
- *
- */
-
-#define APIENTRY
-#define LOCAL
-
-#ifndef FALSE
-#define FALSE (0)
-#endif
-
-#ifndef TRUE
-#define TRUE (!FALSE)
-#endif
-
-typedef unsigned char BYTE;
-
-typedef unsigned char *PBYTE;
-
-typedef int INT;
-typedef unsigned int UINT;
-
-typedef INT *PINT;
-
-typedef INT BOOL;
-typedef BOOL *PBOOL;
-typedef unsigned short WORD;
-typedef unsigned long DWORD;
-
-typedef char CHAR;
-typedef unsigned char UCHAR;
-typedef short SHORT;
-typedef SHORT *PSHORT;
-typedef unsigned short USHORT;
-typedef USHORT *PUSHORT;
-typedef long LONG;
-typedef LONG *PLONG;
-typedef unsigned long ULONG;
-typedef ULONG *PULONG;
-typedef unsigned long HFILE;
-typedef HFILE *PHFILE;
-
-typedef void VOID;
-typedef VOID *PVOID;
-typedef PVOID *PPVOID;
-
-typedef struct _SIZEL /* sizl */
-{
- LONG cx;
- LONG cy;
-} SIZEL;
-typedef SIZEL *PSIZEL;
-
-
-typedef struct _POINTL {
- LONG x;
- LONG y;
-} POINTL;
-typedef POINTL *PPOINTL;
-
-typedef struct _RECTL { /* rcl */
- LONG xLeft;
- LONG yBottom;
- LONG xRight;
- LONG yTop;
-} RECTL;
-typedef RECTL *PRECTL;
-
-typedef struct _RGB { /* rgb */
- BYTE bBlue;
- BYTE bGreen;
- BYTE bRed;
-} RGB;
-/* typedef RGB *PRGB; */
-
-typedef LONG APIRET;
-
-/* Extract high and low order parts of 16 and 32 bit quantity */
-#define LOBYTE(w) LOUCHAR(w)
-#define HIBYTE(w) HIUCHAR(w)
-#define LOUCHAR(w) ((UCHAR)(w))
-#define HIUCHAR(w) ((UCHAR)(((USHORT)(w) >> 8) & 0xff))
-#define LOUSHORT(l) ((USHORT)((ULONG)l))
-#define HIUSHORT(l) ((USHORT)(((ULONG)(l) >> 16) & 0xffff))
-
-
-#define CLR_FALSE (-5L)
-#define CLR_TRUE (-4L)
-
-#define CLR_ERROR (-255L)
-#define CLR_DEFAULT (-3L)
-#define CLR_WHITE (-2L)
-#define CLR_BLACK (-1L)
-#define CLR_BACKGROUND 0L
-#define CLR_BLUE 1L
-#define CLR_RED 2L
-#define CLR_PINK 3L
-#define CLR_GREEN 4L
-#define CLR_CYAN 5L
-#define CLR_YELLOW 6L
-#define CLR_NEUTRAL 7L
-
-#define CLR_DARKGRAY 8L
-#define CLR_DARKBLUE 9L
-#define CLR_DARKRED 10L
-#define CLR_DARKPINK 11L
-#define CLR_DARKGREEN 12L
-#define CLR_DARKCYAN 13L
-#define CLR_BROWN 14L
-#define CLR_PALEGRAY 15L
-
-/* rgb colors */
-#define RGB_ERROR (-255L)
-#define RGB_BLACK 0x00000000L
-#define RGB_BLUE 0x000000FFL
-#define RGB_GREEN 0x0000FF00L
-#define RGB_CYAN 0x0000FFFFL
-#define RGB_RED 0x00FF0000L
-#define RGB_PINK 0x00FF00FFL
-#define RGB_YELLOW 0x00FFFF00L
-#define RGB_WHITE 0x00FFFFFFL
-
-
-
-#define BMAP_MEMORY 0x00000001
-
-/* bitmap parameterization used by GpiCreateBitmap and others */
-typedef struct _BITMAPINFOHEADER /* bmp */
-{
- ULONG cbFix;
- USHORT cx;
- USHORT cy;
- USHORT cPlanes;
- USHORT cBitCount;
-} BITMAPINFOHEADER;
-typedef BITMAPINFOHEADER *PBITMAPINFOHEADER;
-
-
-typedef struct _BMAPINFO /* bmapinfo */
-{
- ULONG ulLength;
- ULONG ulType;
- ULONG ulWidth;
- ULONG ulHeight;
- ULONG ulBpp;
- ULONG ulBytesPerLine;
- PBYTE pBits;
-} BMAPINFO;
-typedef BMAPINFO *PBMAPINFO;
-
-typedef struct _BITMAPINFOHEADER2 /* bmp2 */
-{
- ULONG cbFix; /* Length of structure */
- ULONG cx; /* Bit-map width in pels */
- ULONG cy; /* Bit-map height in pels */
- USHORT cPlanes; /* Number of bit planes */
- USHORT cBitCount; /* Number of bits per pel within a plane */
- ULONG ulCompression; /* Compression scheme used to store the bitmap */
- ULONG cbImage; /* Length of bit-map storage data in bytes*/
- ULONG cxResolution; /* x resolution of target device */
- ULONG cyResolution; /* y resolution of target device */
- ULONG cclrUsed; /* Number of color indices used */
- ULONG cclrImportant; /* Number of important color indices */
- USHORT usUnits; /* Units of measure */
- USHORT usReserved; /* Reserved */
- USHORT usRecording; /* Recording algorithm */
- USHORT usRendering; /* Halftoning algorithm */
- ULONG cSize1; /* Size value 1 */
- ULONG cSize2; /* Size value 2 */
- ULONG ulColorEncoding; /* Color encoding */
- ULONG ulIdentifier; /* Reserved for application use */
-} BITMAPINFOHEADER2;
-typedef BITMAPINFOHEADER2 *PBITMAPINFOHEADER2;
-
-typedef struct _RGB2 /* rgb2 */
-{
- BYTE bBlue; /* Blue component of the color definition */
- BYTE bGreen; /* Green component of the color definition*/
- BYTE bRed; /* Red component of the color definition */
- BYTE fcOptions; /* Reserved, must be zero */
-} RGB2;
-typedef RGB2 *PRGB2;
-
-typedef struct _BITMAPINFO2 /* bmi2 */
-{
- int cbFix;
- int cx;
- int cy;
- int cPlanes;
- int cBitCount;
- int ulCompresstion;
- int cclrUsed;
- int cclrImportant;
- RGB2 argbColor[1];
-} BITMAPINFO2;
-typedef BITMAPINFO2 *PBITMAPINFO2;
-
-
-/******************************************************************************/
-/* PPOINTL pptlSrc; // src left, bottom, width and height. */
-/* PPOINTL pptlDst; // dst left, bottom, width and height. */
-/* ULONG ulSrcBytesPerLine; // src bytes per line */
-/* PBYTE pbSrcBits; // pointer to src image data */
-/* ULONG ulTrgBytesPerLine; // dst bytes per line */
-/* PBYTE pbTrgBits; // pointer to dst image data */
-/* ULONG ulOptions; // options */
-/* ULONG ulcClrs; // count of colors in rgb2 table */
-/* PRGB2 pargb2; // rgb2 table */
-/******************************************************************************/
-
-typedef struct _IMAGEINFOS /* imginfo */
-{
- PPOINTL pptlSrc;
- PPOINTL pptlDst;
- ULONG ulSrcBpp;
- ULONG ulSrcBytesPerLine;
- PBYTE pbSrcBits;
- ULONG ulcSrcClrs;
- ULONG ulSrcClrType;
- PRGB2 pargb2Src;
- ULONG ulTrgBpp;
- ULONG ulTrgBytesPerLine;
- PBYTE pbTrgBits;
- ULONG ulcTrgClrs;
- ULONG ulTrgClrType;
- PRGB2 pargb2Trg;
- ULONG ulOptions;
- ULONG ulPelSizeCorrection;
-} IMAGEINFOS;
-typedef IMAGEINFOS * PIMAGEINFO; /* pimginfo */
-
-#define GDM_NO_DITHER 0x0000 /* No dithering in system */
-#define GDM_USERDEF_DITHER 0x0001 /* Users supplies own Dithering routines */
-#define GDM_MATRIX_DITHER 0x0002 /* Use System ordered dithering */
-#define GDM_ERRORDIF_DITHER 0x0004 /* Use System error diffusion dithering */
-#define GDM_DITHER_BEGIN 0x0008 /* Use System Floyd-Steinberg dithering */
-#define GDM_DITHER_END 0x0010 /* Use System error propigation dithering */
-#define GDM_COLOR_CONVERT 0x0020 /* use device's clr mapping functions */
-
-
-/*******************************************************************************************/
-/* ULONG ulLength; // length of structure - 88 */
-/* ULONG ulType; // type of dither info structure - GDM_MATRIX_DITHER*/
-/* ULONG fOptions; // dither info options - DI_MONOINVERT - 00 */
-/* ULONG ulIntensity; // RGB Gama Correction Value - 00 */
-/* BYTE bRedWt; // weight of primary color red - 25 */
-/* BYTE bGreenWt; // weight of primary color green - 60 */
-/* BYTE bBlueWt; // weight of primary color blue - 15 */
-/* BYTE bPad; // 4 byte align - 00 */
-/* SIZEL szMatrix; // halftone pattern size - 8 */
-/* BYTE bHalftone[]; // array of halftone patterns - see 32gdata.c */
-/*******************************************************************************************/
-
-typedef struct _MATRIXDITHERINFO /* mtrxdi */
-{
- ULONG ulLength;
- ULONG ulType;
- ULONG fOptions;
- ULONG ulIntensity;
- BYTE bRedWt;
- BYTE bGreenWt;
- BYTE bBlueWt;
- BYTE bPad;
- SIZEL szMatrix;
- BYTE bHalftone[1];
-} MATRIXDITHERINFO;
-typedef MATRIXDITHERINFO *PMDI; /* pmtrxdi */
-
-#define STUCKI_DIF 0x01
-#define JJN_DIF 0x02
-#define RND_DIF 0x04
-#define USER_DIF 0x08
-
-typedef struct _DIFFUSIONDITHERINFO /* difdi */
-{
- ULONG ulLength;
- ULONG ulType; /* Stucki, user defined, etc. */
- ULONG fOptions;
- ULONG ulIntensity;
- BYTE bRedWt;
- BYTE bGreenWt;
- BYTE bBlueWt;
- BYTE bPad;
- PBYTE pBuffer;
- SIZEL szFilter;
- BYTE bFilterArry[1];
-
-} DIFFUSIONDITHERINFO;
-typedef DIFFUSIONDITHERINFO *PDDI; /* pdifdi */
-
-/* bitblt type */
-typedef enum {
- BITBLT_BITMAP,
- BITBLT_AREA,
- BITBLT_TEXT
-} BITBLT_TYPE;
diff --git a/gs/contrib/eplaser/gdevescv.c b/gs/contrib/eplaser/gdevescv.c
deleted file mode 100644
index 150a28c62..000000000
--- a/gs/contrib/eplaser/gdevescv.c
+++ /dev/null
@@ -1,3044 +0,0 @@
-/* Copyright (C) EPSON SOFTWARE DEVELOPMENT LABORATORY, INC. 1999,2000.
- Copyright (C) SEIKO EPSON CORPORATION 2000-2006.
-
- Ghostscript printer driver for EPSON ESC/Page and ESC/Page-Color.
-
- This software 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 GNU General Public License for full details.
-
- Everyone is granted permission to copy, modify and redistribute
- this software, but only under the conditions described in the GNU
- General Public License. A copy of this license is supposed to have been
- given to you along with this software 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.
-
-
- SPECIAL THANKS:
-
- Ëܥɥ饤¥Ð¤ÎºîÀ®¤Ë¤¢¤¿¤ê¡¢Â翹µª¿Í¤µ¤ó¤Î gdevlips, gdevl4v.c ¤ò»²¹Í¤Ë
- ¤µ¤»¤Æ夭¤Þ¤·¤¿¡£
-
-
- NOTES:
-
- - About Ghostscript 5.10/5.50 BUGS
- Ghostscript 5.10/5.50 ¤Î Vector driver ¤Î setlinewidth ´Ø¿ô¤Ë¤Ï
- ¥Ð¥°¤¬¤¢¤ê¤Þ¤¹¡£ËÜÍ襹¥±¡¼¥ë¤¬Êѹ¹¤µ¤ì¤ë¤Ë¤·¤¿¤¬¤Ã¤ÆÀþ¤ÎÂÀ¤µ¤âÊѹ¹¤µ¤ì
- ¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¤¬¡¢Ghostscript 5.10/5.50 ¤Ç¤Ï¥¹¥±¡¼¥ë¤ò¹Íθ¤¹¤ë¤Î¤ò
- ˺¤ì¤Æ¤¤¤Þ¤¹¡£
- ¤³¤Î¥É¥é¥¤¥Ð¤Ï¤½¤Î¥Ð¥°¤ò²óÈò¤¹¤ë¤¿¤á¤Ë¥¹¥±¡¼¥ë¤ò¼«Ê¬¤Ç½èÍý¤·¤Æ¤¤¤Þ¤¹¡£
-
- */
-
-#if ( 6 > GS_VERSION_MAJOR )
-
-#include <string.h>
-#include <sys/utsname.h> /* for uname(2) */
-#include <ctype.h> /* for toupper(3) */
-
-#include "math_.h"
-#include "gx.h"
-#include "gserrors.h"
-#include "gsmatrix.h"
-#include "gsparam.h"
-#include "gxdevice.h"
-#include "gscspace.h"
-#include "gsutil.h"
-#include "gdevvec.h"
-#include "gdevpstr.h"
-#include "ghost.h"
-#include "gzstate.h"
-#include "imemory.h"
-#include "igstate.h"
-#include "gdevescv.h"
-#include "gspath.h"
-#include "gzpath.h"
-
-#else /* 6 <= GS_VERSION_MAJOR */
-
-#include "math_.h"
-#include <stdlib.h> /* for abs() */
-#include <sys/utsname.h> /* for uname(2) */
-#include <ctype.h> /* for toupper(3) */
-
-#include "time_.h"
-#include "memory_.h"
-#include "gx.h"
-#include "gserrors.h"
-#include "gzpath.h"
-#include "gxdevice.h"
-#include "gdevvec.h"
-
-#if ( 7 >= GS_VERSION_MAJOR )
-#include "gscspace.h"
-#endif
-
-#include "gdevescv.h"
-
-#endif /* GS_VERSION_MAJOR */
-
-
-#define ESCV_FORCEDRAWPATH 0 /* 0: correct LP-9200C path trouble. */
-
-
-/* ---------------- Device definition ---------------- */
-
-/* Device procedures */
-private dev_proc_open_device(escv_open);
-private dev_proc_output_page(escv_output_page);
-private dev_proc_close_device(escv_close);
-private dev_proc_copy_mono(escv_copy_mono);
-private dev_proc_copy_color(escv_copy_color);
-private dev_proc_put_params(escv_put_params);
-private dev_proc_get_params(escv_get_params);
-private dev_proc_fill_mask(escv_fill_mask);
-private dev_proc_begin_image(escv_begin_image);
-
-
-gs_public_st_suffix_add0_final(st_device_escv, gx_device_escv,
- "gx_device_escv", device_escv_enum_ptrs, device_escv_reloc_ptrs,
- gx_device_finalize, st_device_vector);
-
-
-/* for ESC/Page-Color
-** ¸¶ÅÀ¤ÎÃͤò 0 ¤È¤·¤¿¾ì¹ç,·×»»¸íº¹¡©¤ÎÌäÂ꤫¤éÉÁ²è¥¨¥ê¥¢¤¬¶¸¤¦¤¿¤á
-** ¸¶ÅÀ¤ò 0.001 ¤È¤·¤Æ¤ª¤¯¡£
-*/
-#define escv_device_full_body(dtype, pprocs, dname, stype, w, h, xdpi, ydpi, \
- ncomp, depth, mg, mc, dg, dc, lm, bm, rm, tm)\
- std_device_part1_(dtype, pprocs, dname, stype, open_init_closed),\
- dci_values(ncomp, depth, mg, mc, dg, dc),\
- std_device_part2_(w, h, xdpi, ydpi),\
- offset_margin_values(0.001, 0.001, lm, 0, 0, tm),\
- std_device_part3_()
-
-
-/* for ESC/Page (Monochrome) */
-#define esmv_device_full_body(dtype, pprocs, dname, stype, w, h, xdpi, ydpi, \
- ncomp, depth, mg, mc, dg, dc, lm, bm, rm, tm)\
- std_device_part1_(dtype, pprocs, dname, stype, open_init_closed),\
- dci_values(ncomp, depth, mg, mc, dg, dc),\
- std_device_part2_(w, h, xdpi, ydpi),\
- offset_margin_values(-lm * xdpi / 72.0, -tm * ydpi / 72.0, 5.0 / (MMETER_PER_INCH / POINT),\
- 0, 0, 5.0 / (MMETER_PER_INCH / POINT)), /* LPD.2. 041203 saito */\
- std_device_part3_()
-
-
-/* for ESC/Page-Color */
-#define escv_device_body(name) \
- escv_device_full_body(gx_device_escv, 0, name, \
- &st_device_escv,\
-/* width & height */ ESCPAGE_DEFAULT_WIDTH, ESCPAGE_DEFAULT_HEIGHT,\
-/* default resolution */ X_DPI, Y_DPI,\
-/* color info */ 3, 24, 255, 255, 256, 256,\
- ESCPAGE_LEFT_MARGIN_DEFAULT,\
- ESCPAGE_BOTTOM_MARGIN_DEFAULT,\
- ESCPAGE_RIGHT_MARGIN_DEFAULT,\
- ESCPAGE_TOP_MARGIN_DEFAULT)
-
-
-/* for ESC/Page (Monochrome) */
-#define esmv_device_body(name) \
- esmv_device_full_body(gx_device_escv, 0, name, \
- &st_device_escv,\
-/* width & height */ ESCPAGE_DEFAULT_WIDTH, ESCPAGE_DEFAULT_HEIGHT,\
-/* default resolution */ X_DPI, Y_DPI,\
-/* color info */ 1, 8, 255, 255, 256, 256,\
- ESCPAGE_LEFT_MARGIN_DEFAULT,\
- ESCPAGE_BOTTOM_MARGIN_DEFAULT,\
- ESCPAGE_RIGHT_MARGIN_DEFAULT,\
- ESCPAGE_TOP_MARGIN_DEFAULT)
-
-
-
-#define escv_procs_part1 \
- escv_open, /* open_device */\
- gx_default_get_initial_matrix, /* get_initial_matrix */\
- NULL, /* sync_output */\
- escv_output_page, /* output_page */\
- escv_close /* close_device */
-
-#define escv_procs_part2 \
- gdev_vector_fill_rectangle, /* fill_rectangle */\
- NULL, /* tile_rectangle */\
- escv_copy_mono, /* dev_t_proc_copy_mono */\
- escv_copy_color, /* dev_t_proc_copy_color */\
- NULL, /* draw_line */\
- NULL, /* get_bits */\
- escv_get_params, /* dev_t_proc_get_params */\
- escv_put_params, /* dev_t_proc_put_params */\
- NULL, /* map_cmyk_color */\
- NULL, /* get_xfont_procs */\
- NULL, /* get_xfont_device */\
- NULL, /* map_rgb_alpha_color */\
- gx_page_device_get_page_device, /* dev_t_proc_get_page_device */\
- NULL, /* get_alpha_bits */\
- NULL, /* copy_alpha */\
- NULL, /* get_band */\
- NULL, /* copy_rop */\
- gdev_vector_fill_path, /* fill_path */\
- gdev_vector_stroke_path, /* stroke_path */\
- escv_fill_mask, /* fill_mask */\
- gdev_vector_fill_trapezoid, /* fill_trapezoid */\
- gdev_vector_fill_parallelogram, /* fill_parallelogram */\
- gdev_vector_fill_triangle, /* fill_triangle */\
- NULL, /****** WRONG ******/ /* draw_thin_line */\
- escv_begin_image, /* begin_image */\
- NULL, /* image_data */\
- NULL, /* end_image */\
- NULL, /* strip_tile_rectangle */\
- NULL /******strip_copy_rop******/
-
-
-
-/* for ESC/Page-Color */
-#define escv_procs \
-{\
- escv_procs_part1,\
- gx_default_rgb_map_rgb_color, /* map_rgb_color */\
- gx_default_rgb_map_color_rgb, /* map_color_rgb */\
- escv_procs_part2\
-}
-
-
-/* for ESC/Page (Monochrome) */
-#define esmv_procs \
-{\
- escv_procs_part1,\
- gx_default_gray_map_rgb_color, /* map_rgb_color */\
- gx_default_gray_map_color_rgb, /* map_color_rgb */\
- escv_procs_part2\
-}
-
-
-#define escv_init_code_common \
- ESCPAGE_MANUALFEED_DEFAULT, /* bool manualFeed; * Use manual feed * */\
- ESCPAGE_CASSETFEED_DEFAULT, /* int cassetFeed; * Input Casset * */\
- ESCPAGE_RIT_DEFAULT, /* bool RITOff; * RIT Control * */\
- FALSE, /* bool Collate; */\
- 0, /* int toner_density; */\
- FALSE, /* bool toner_saving; */\
- 0, /* int prev_paper_size; */\
- 0, /* int prev_paper_width; */\
- 0, /* int prev_paper_height; */\
- 0, /* int prev_num_copies; */\
- -1, /* int prev_feed_mode; */\
- 0, /* int orientation; */\
- ESCPAGE_FACEUP_DEFAULT, /* bool faceup; */\
- ESCPAGE_MEDIATYPE_DEFAULT, /* int MediaType; */\
- 0, /* bool first_page; */\
- 0, /* bool Duplex; */\
- ESCPAGE_TUMBLE_DEFAULT, /* bool Tumble; */\
- 0, /* int ncomp; */\
- 0, /* int MaskReverse; */\
- 0, /* int MaskState; */\
- TRUE, /* bool c4map; * 4bit ColorMap * */\
- TRUE, /* bool c8map; * 8bit ColorMap * */\
- 0, /* int prev_x; */\
- 0, /* int prev_y; */\
- 0, /* gx_color_index prev_color; */\
- 0, /* gx_color_index current_color; */\
- 3, /* floatp lwidth; */\
- 0, /* long cap; */\
- 3, /* long join; */\
- 0, /* long reverse_x; */\
- 0, /* long reverse_y; */\
- {0,}, /* gs_matrix xmat; * matrix * */\
- 0, /* int bx; */\
- 0, /* int by; */\
- 0, /* int w; * width * */\
- 0, /* int h; * height * */\
- 0, /* int roll; */\
- 0, /* float sx; * scale x * */\
- 0, /* float sy; * scale y * */\
- 0, /* long dd; */\
- 0, /* int ispath */\
- {0,}, /* gx_bitmap_id id_cache[VCACHE + 1]; * for Font Downloading * */\
- {0,}, /* char JobID[ESCPAGE_JOBID_MAX + 1]; */\
- {0,}, /* char UserName[ESCPAGE_USERNAME_MAX + 1]; */\
- {0,}, /* char HostName[ESCPAGE_HOSTNAME_MAX + 1]; */\
- {0,}, /* char Document[ESCPAGE_DOCUMENT_MAX + 1]; */\
- {0,}, /* char Comment[ESCPAGE_COMMENT_MAX + 1]; */\
- {0,0,0}, /* gs_param_string gpsJobID; */\
- {0,0,0}, /* gs_param_string gpsUserName; */\
- {0,0,0}, /* gs_param_string gpsHostName; */\
- {0,0,0}, /* gs_param_string gpsDocument; */\
- {0,0,0} /* gs_param_string gpsComment; */
-
-
-/* for ESC/Page-Color */
-#define escv_init_code \
- vector_initial_values,\
- 1, /* int colormode; 1=ESC/Page-Color */\
- escv_init_code_common
-
-
-/* for ESC/Page (Monochrome) */
-#define esmv_init_code \
- vector_initial_values,\
- 0, /* int colormode; 0=ESC/Page(Monochrome) */\
- escv_init_code_common
-
-
-/* for ESC/Page (Monochrome) */
-gx_device_escv far_data gs_epl2050_device ={esmv_device_body("epl2050"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_epl2050p_device={esmv_device_body("epl2050p"),esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_epl2120_device ={esmv_device_body("epl2120"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_epl2500_device ={esmv_device_body("epl2500"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_epl2750_device ={esmv_device_body("epl2750"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_epl5800_device ={esmv_device_body("epl5800"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_epl5900_device ={esmv_device_body("epl5900"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_epl6100_device ={esmv_device_body("epl6100"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_epl6200_device ={esmv_device_body("epl6200"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_lp1800_device ={esmv_device_body("lp1800"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_lp1900_device ={esmv_device_body("lp1900"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_lp2200_device ={esmv_device_body("lp2200"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_lp2400_device ={esmv_device_body("lp2400"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_lp2500_device ={esmv_device_body("lp2500"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_lp7500_device ={esmv_device_body("lp7500"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_lp7700_device ={esmv_device_body("lp7700"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_lp7900_device ={esmv_device_body("lp7900"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_lp8100_device ={esmv_device_body("lp8100"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_lp8300f_device ={esmv_device_body("lp8300f"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_lp8400f_device ={esmv_device_body("lp8400f"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_lp8600_device ={esmv_device_body("lp8600"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_lp8600f_device ={esmv_device_body("lp8600f"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_lp8700_device ={esmv_device_body("lp8700"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_lp8900_device ={esmv_device_body("lp8900"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_lp9000b_device ={esmv_device_body("lp9000b"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_lp9100_device ={esmv_device_body("lp9100"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_lp9200b_device ={esmv_device_body("lp9200b"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_lp9300_device ={esmv_device_body("lp9300"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_lp9400_device ={esmv_device_body("lp9400"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_lp9600_device ={esmv_device_body("lp9600"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_lp9600s_device ={esmv_device_body("lp9600s"), esmv_procs, esmv_init_code};
-gx_device_escv far_data gs_lps4500_device ={esmv_device_body("lps4500"), esmv_procs, esmv_init_code};
-
-/* for ESC/Page-Color */
-gx_device_escv far_data gs_alc1900_device ={escv_device_body("alc1900"), escv_procs, escv_init_code};
-gx_device_escv far_data gs_alc2000_device ={escv_device_body("alc2000"), escv_procs, escv_init_code};
-gx_device_escv far_data gs_alc4000_device ={escv_device_body("alc4000"), escv_procs, escv_init_code};
-gx_device_escv far_data gs_alc4100_device ={escv_device_body("alc4100"), escv_procs, escv_init_code};
-gx_device_escv far_data gs_alc8500_device ={escv_device_body("alc8500"), escv_procs, escv_init_code};
-gx_device_escv far_data gs_alc8600_device ={escv_device_body("alc8600"), escv_procs, escv_init_code};
-gx_device_escv far_data gs_alc9100_device ={escv_device_body("alc9100"), escv_procs, escv_init_code};
-gx_device_escv far_data gs_lp3000c_device ={escv_device_body("lp3000c"), escv_procs, escv_init_code};
-gx_device_escv far_data gs_lp8000c_device ={escv_device_body("lp8000c"), escv_procs, escv_init_code};
-gx_device_escv far_data gs_lp8200c_device ={escv_device_body("lp8200c"), escv_procs, escv_init_code};
-gx_device_escv far_data gs_lp8300c_device ={escv_device_body("lp8300c"), escv_procs, escv_init_code};
-gx_device_escv far_data gs_lp8500c_device ={escv_device_body("lp8500c"), escv_procs, escv_init_code};
-gx_device_escv far_data gs_lp8800c_device ={escv_device_body("lp8800c"), escv_procs, escv_init_code};
-gx_device_escv far_data gs_lp9000c_device ={escv_device_body("lp9000c"), escv_procs, escv_init_code};
-gx_device_escv far_data gs_lp9200c_device ={escv_device_body("lp9200c"), escv_procs, escv_init_code};
-gx_device_escv far_data gs_lp9500c_device ={escv_device_body("lp9500c"), escv_procs, escv_init_code};
-gx_device_escv far_data gs_lp9800c_device ={escv_device_body("lp9800c"), escv_procs, escv_init_code};
-gx_device_escv far_data gs_lps6500_device ={escv_device_body("lps6500"), escv_procs, escv_init_code};
-
-
-/* Vector device implementation */
-#if ( 6 > GS_VERSION_MAJOR )
-private int escv_beginpage(P1(gx_device_vector * vdev));
-private int escv_setfillcolor(P2(gx_device_vector * vdev, const gx_drawing_color * pdc));
-private int escv_setstrokecolor(P2(gx_device_vector * vdev, const gx_drawing_color * pdc));
-private int escv_setdash(P4(gx_device_vector * vdev, const float *pattern,
- uint count, floatp offset));
-private int escv_setflat(P2(gx_device_vector * vdev, floatp flatness));
-private int escv_setlogop(P3(gx_device_vector * vdev, gs_logical_operation_t lop,
- gs_logical_operation_t diff));
-private int escv_vector_dorect(gx_device_vector * vdev, fixed x0, fixed y0, fixed x1,
- fixed y1, gx_path_type_t type);
-private int escv_vector_dopath(gx_device_vector * vdev, const gx_path * ppath,
- gx_path_type_t type);
-private int escv_beginpath(P2(gx_device_vector * vdev, gx_path_type_t type));
-private int escv_moveto(P6(gx_device_vector * vdev, floatp x0, floatp y0,
- floatp x, floatp y, gx_path_type_t type));
-private int escv_lineto(P6(gx_device_vector * vdev, floatp x0, floatp y0,
- floatp x, floatp y, gx_path_type_t type));
-private int escv_curveto(P10(gx_device_vector * vdev, floatp x0, floatp y0,
- floatp x1, floatp y1, floatp x2, floatp y2,
- floatp x3, floatp y3, gx_path_type_t type));
-private int escv_closepath(P6(gx_device_vector * vdev, floatp x, floatp y,
- floatp x_start, floatp y_start, gx_path_type_t type));
-
-private int escv_endpath(P2(gx_device_vector * vdev, gx_path_type_t type));
-private int escv_setlinewidth(gx_device_vector * vdev, floatp width);
-private int escv_setlinecap(gx_device_vector * vdev, gs_line_cap cap);
-private int escv_setlinejoin(gx_device_vector * vdev, gs_line_join join);
-private int escv_setmiterlimit(gx_device_vector * vdev, floatp limit);
-
-#else /* 6 <= GS_VERSION_MAJOR */
-
-/* Page management */
-private int escv_beginpage (gx_device_vector * vdev);
-/* Imager state */
-private int escv_setlinewidth (gx_device_vector * vdev, floatp width);
-private int escv_setlinecap (gx_device_vector * vdev, gs_line_cap cap);
-private int escv_setlinejoin (gx_device_vector * vdev, gs_line_join join);
-private int escv_setmiterlimit (gx_device_vector * vdev, floatp limit);
-private int escv_setdash (gx_device_vector * vdev, const float *pattern,
- uint count, floatp offset);
-private int escv_setflat (gx_device_vector * vdev, floatp flatness);
-private int escv_setlogop (gx_device_vector * vdev, gs_logical_operation_t lop,
- gs_logical_operation_t diff);
-/* Other state */
-#if ( 8 <= GS_VERSION_MAJOR )
-private bool escv_can_handle_hl_color (gx_device_vector * vdev, const gs_imager_state * pis,
- const gx_drawing_color * pdc);
-private int escv_setfillcolor (gx_device_vector * vdev, const gs_imager_state * pis,
- const gx_drawing_color * pdc);
-private int escv_setstrokecolor (gx_device_vector * vdev, const gs_imager_state * pis,
- const gx_drawing_color * pdc);
-#else
-private int escv_setfillcolor (gx_device_vector * vdev, const gx_drawing_color * pdc);
-private int escv_setstrokecolor (gx_device_vector * vdev, const gx_drawing_color * pdc);
-#endif
-/* Paths */
-/* dopath and dorect are normally defaulted */
-private int escv_vector_dopath (gx_device_vector * vdev, const gx_path * ppath,
- gx_path_type_t type, const gs_matrix *pmat);
-private int escv_vector_dorect (gx_device_vector * vdev, fixed x0, fixed y0, fixed x1,
- fixed y1, gx_path_type_t type);
-private int escv_beginpath (gx_device_vector * vdev, gx_path_type_t type);
-private int escv_moveto (gx_device_vector * vdev, floatp x0, floatp y0,
- floatp x, floatp y, gx_path_type_t type);
-private int escv_lineto (gx_device_vector * vdev, floatp x0, floatp y0,
- floatp x, floatp y, gx_path_type_t type);
-private int escv_curveto (gx_device_vector * vdev, floatp x0, floatp y0,
- floatp x1, floatp y1, floatp x2, floatp y2,
- floatp x3, floatp y3, gx_path_type_t type);
-private int escv_closepath (gx_device_vector * vdev, floatp x0, floatp y0,
- floatp x_start, floatp y_start, gx_path_type_t type);
-private int escv_endpath (gx_device_vector * vdev, gx_path_type_t type);
-
-#endif /* GS_VERSION_MAJOR */
-
-private const gx_device_vector_procs escv_vector_procs =
- {
- /* Page management */
- escv_beginpage,
- /* Imager state */
- escv_setlinewidth,
- escv_setlinecap,
- escv_setlinejoin,
- escv_setmiterlimit,
- escv_setdash,
- escv_setflat,
- escv_setlogop,
- /* Other state */
-#if ( 8 <= GS_VERSION_MAJOR )
- escv_can_handle_hl_color, /* add gs815 */
-#endif
- escv_setfillcolor, /* fill & stroke colors are the same */
- escv_setstrokecolor,
- /* Paths */
- escv_vector_dopath,
- escv_vector_dorect,
- escv_beginpath,
- escv_moveto,
- escv_lineto,
- escv_curveto,
- escv_closepath,
- escv_endpath
- };
-
-private void escv_write_begin(gx_device *dev, int bits, int x, int y, int sw, int sh, int dw, int dh, int roll);
-private void escv_write_data(gx_device *dev, int bits, char *buf, int bsize, int w, int ras);
-private void escv_write_end(gx_device *dev, int bits);
-
-
-/* ---------------- Utilities ---------------- */
-
-/* Put a string on a stream.
- This function is copy of `pputs' in gdevpstr.c */
-private int
-lputs(stream * s, const char *str)
-{
- uint len = strlen(str);
- uint used;
- int status;
-
- status = sputs(s, (const byte *)str, len, &used);
-
- return (status >= 0 && used == len ? 0 : EOF);
-}
-
-/* Write a string on a stream. */
-private void
-put_bytes(stream * s, const byte * data, uint count)
-{
- uint used;
-
- sputs(s, data, count, &used);
-}
-
-
-private int
-escv_range_check(gx_device * dev)
-{
- int width = dev->MediaSize[0];
- int height = dev->MediaSize[1];
- int xdpi = dev->x_pixels_per_inch;
- int ydpi = dev->y_pixels_per_inch;
-
- /* Paper Size Check */
- if (width <= height) { /* portrait */
- if ((width < ESCPAGE_WIDTH_MIN ||
- width > ESCPAGE_WIDTH_MAX ||
- height < ESCPAGE_HEIGHT_MIN ||
- height > ESCPAGE_HEIGHT_MAX)) {
- return_error(gs_error_rangecheck);
- }
- } else { /* landscape */
- if ((width < ESCPAGE_HEIGHT_MIN ||
- width > ESCPAGE_HEIGHT_MAX ||
- height < ESCPAGE_WIDTH_MIN ||
- height > ESCPAGE_WIDTH_MAX )) {
- return_error(gs_error_rangecheck);
- }
- }
-
- /* Resolution Check */
- if (xdpi != ydpi) {
- return_error(gs_error_rangecheck);
- }
-
- if ((xdpi < ESCPAGE_DPI_MIN ||
- xdpi > ESCPAGE_DPI_MAX)) {
- return_error(gs_error_rangecheck);
- }
-
- return 0; /* pass */
-}
-
-
-/* ---------------- Vector device implementation ---------------- */
-
-private int
-escv_vector_dopath(gx_device_vector * vdev, const gx_path * ppath,
- gx_path_type_t type
-#if ( 6 <= GS_VERSION_MAJOR )
- , const gs_matrix *pmat
-#endif
- )
-{
- gx_device_escv *pdev = (gx_device_escv *) vdev;
- bool do_close = (type & gx_path_type_stroke) != 0;
- gs_fixed_rect rect;
- gs_point scale;
- double x_start = 0, y_start = 0, x_prev = 0, y_prev = 0;
- bool first = true;
- gs_path_enum cenum;
- int code;
-
- stream *s = gdev_vector_stream(vdev);
- char obuf[128];
-
- if (gx_path_is_rectangle(ppath, &rect))
- return (*vdev_proc(vdev, dorect)) (vdev, rect.p.x, rect.p.y, rect.q.x, rect.q.y, type);
- scale = vdev->scale;
- code = (*vdev_proc(vdev, beginpath)) (vdev, type);
- gx_path_enum_init(&cenum, ppath);
-
- for (;;) {
- double x, y;
- fixed vs[6];
- int pe_op, cnt;
- const segment *pseg;
-
-
- pe_op = gx_path_enum_next(&cenum, (gs_fixed_point *) vs);
-
- sw:switch (pe_op) {
- case 0: /* done */
- return (*vdev_proc(vdev, endpath)) (vdev, type);
-
- case gs_pe_moveto:
- x = fixed2float(vs[0]) / scale.x;
- y = fixed2float(vs[1]) / scale.y;
-
- /* ¥µ¥Ö¥Ñ¥¹³«»ÏÌ¿Îá p1 */
- (void)sprintf(obuf, ESC_GS "0;%d;%dmvpG", (int)x, (int)y);
- lputs(s, obuf);
-
- if (first)
- x_start = x, y_start = y, first = false;
- break;
-
- case gs_pe_lineto:
- cnt = 1;
- for (pseg = cenum.pseg; pseg != 0 && pseg->type == s_line; cnt++, pseg = pseg->next);
-
- (void)sprintf(obuf, ESC_GS "0;%d", cnt);
- lputs(s, obuf);
-
- do {
- (void)sprintf(obuf, ";%d;%d",
- (int)(fixed2float(vs[0]) / scale.x),
- (int)(fixed2float(vs[1]) / scale.y));
- lputs(s, obuf);
-
- pe_op = gx_path_enum_next(&cenum, (gs_fixed_point *) vs);
- } while (pe_op == gs_pe_lineto);
-
- /* ¥Ñ¥¹¡¦¥Ý¥ê¥é¥¤¥óÌ¿Îá */
- lputs(s, "lnpG");
- pdev->ispath = 1;
-
- goto sw;
-
- case gs_pe_curveto:
- cnt = 1;
- for (pseg = cenum.pseg; pseg != 0 && pseg->type == s_curve; cnt++, pseg = pseg->next);
- (void)sprintf(obuf, ESC_GS "0;%d", cnt * 3);
- lputs(s, obuf);
-
- do {
- (void)sprintf(obuf, ";%d;%d;%d;%d;%d;%d",
- (int)(fixed2float(vs[0]) / scale.x), (int)(fixed2float(vs[1]) / scale.y),
- (int)(fixed2float(vs[2]) / scale.x), (int)(fixed2float(vs[3]) / scale.y),
- (int)(fixed2float(vs[4]) / scale.x), (int)(fixed2float(vs[5]) / scale.y));
- lputs(s, obuf);
-
- pe_op = gx_path_enum_next(&cenum, (gs_fixed_point *) vs);
- } while (pe_op == gs_pe_curveto);
-
- /* ¥Ù¥¸¥§¶ÊÀþ */
- lputs(s, "bzpG");
- pdev->ispath = 1;
-
- goto sw;
-
- case gs_pe_closepath:
- x = x_start, y = y_start;
- if (do_close) {
- lputs(s, ESC_GS "clpG");
- break;
- }
-
- pe_op = gx_path_enum_next(&cenum, (gs_fixed_point *) vs);
- if (pe_op != 0) {
- lputs(s, ESC_GS "clpG");
-
- if (code < 0)
- return code;
- goto sw;
- }
- return (*vdev_proc(vdev, endpath)) (vdev, type);
- default: /* can't happen */
- return_error(gs_error_unknownerror);
- }
- if (code < 0)
- return code;
- x_prev = x, y_prev = y;
- }
-}
-
-
-private int
-escv_vector_dorect(gx_device_vector * vdev, fixed x0, fixed y0, fixed x1,
- fixed y1, gx_path_type_t type)
-{
- gx_device_escv *pdev = (gx_device_escv *) vdev;
- int code;
- char obuf[128];
- gs_point scale;
- stream *s = gdev_vector_stream(vdev);
-
- code = (*vdev_proc(vdev, beginpath))(vdev, type);
- if (code < 0)
- return code;
-
- scale = vdev->scale;
-
- (void)sprintf(obuf, ESC_GS "0;%d;%d;%d;%d;0;0rrpG",
- (int)(fixed2float(x0) / scale.x),
- (int)(fixed2float(y0) / scale.y),
- (int)(fixed2float(x1) / scale.x),
- (int)(fixed2float(y1) / scale.y));
- lputs(s, obuf);
- pdev->ispath = 1;
-
-#if 0
- /* Ghostscript ¦¤Î¥Ð¥°¤Ç closepath ¤ò¸Æ¤ó¤Ç¤¤¤Ê¤¤¤Î¤Ç½èÍý¤ò²ñ¤ï¤»¤ë¡£ */
-
- /* ËÜÍè¤Ï (*vdev_proc(vdev, closepath))() ¤ò¸Æ¤Ö¤Ù¤­ */
- lputs(s, ESC_GS "clpG");
-#endif
-
- return (*vdev_proc(vdev, endpath))(vdev, type);
-}
-
-
-/* ---------- */
-
-private const EPaperTable ePaperTable[NUM_OF_PAPER_TABLES] =
- {
- {933, 1369, 72, "A3PLUS"}, /* A3 NOBI */
- {842, 1191, 13, "A3"}, /* A3 */
- {792, 1224, 36, "B"}, /* Ledger */
- {729, 1032, 24, "B4"}, /* B4 JIS */
- {709, 1001, 24, "B4"}, /* B4 */
- {612, 1008, 32, "LGL"}, /* Legal */
- {612, 936, 34, "GLG"}, /* Government Letter */ /* LPD.1. */
- {612, 792, 30, "LT"}, /* Letter */
- {595, 935, 37, "F4"}, /* F4 */
- {595, 842, 14, "A4"}, /* A4 */
- {576, 756, 35, "GLT"}, /* Government Legal */ /* LPD.1. */
- {522, 756, 33, "EXE"}, /* Executive */
- {516, 729, 25, "B5"}, /* B5 JIS */
- {499, 709, 99, "IB5"}, /* Envelope ISO B5 */
- {459, 649, 91, "C5"}, /* Envelope C5 */
- {420, 595, 15, "A5"}, /* A5 */
- {396, 612, 31, "HLT"}, /* Half Letter */
- {312, 624, 90, "DL"}, /* DL */
- {298, 666, 64, "YOU4"}, /* Japanese Envelope You4 */
- {297, 684, 81, "C10"}, /* Commercial 10 */
- {283, 420, 38, "POSTCARD"},/* PostCard */
- {279, 540, 80, "MON"}, /* Monarch */
- { 0, 0, -1, ""} /* Undefined */
- };
-
-private const EPaperTable *
-escv_checkpapersize(gx_device_vector * vdev)
-{
- gx_device_escv *const pdev = (gx_device_escv *)vdev;
- int devw, devh;
- paper_candidate candidate[NUM_OF_PAPER_TABLES];
- int num_candidate;
-
-
- if (pdev->MediaSize[0] < pdev->MediaSize[1]) {
- /* portrait */
- devw = pdev->MediaSize[0];
- devh = pdev->MediaSize[1];
- } else {
- /* landscape */
- devw = pdev->MediaSize[1];
- devh = pdev->MediaSize[0];
- }
-
- /* pick up papersize candidate */
- {
- const EPaperTable *pt;
- int delta;
-
- num_candidate = 0;
-
- for (delta = 0; delta <= MAX_PAPER_SIZE_DELTA; delta++) {
- for (pt = ePaperTable; 0 <= pt->escpage; pt++) {
- if ( (pt->width + delta) >= devw &&
- (pt->width - delta) <= devw &&
- (pt->height + delta) >= devh &&
- (pt->height - delta) <= devh) {
-
- candidate[num_candidate].paper = pt;
- candidate[num_candidate].absw = abs(pt->width - devw);
- candidate[num_candidate].absh = abs(pt->height - devh);
- candidate[num_candidate].score = 0;
- candidate[num_candidate].isfillw = false;
- candidate[num_candidate].isfillh = false;
- candidate[num_candidate].isminw = false;
- candidate[num_candidate].isminh = false;
-
- if( 0 <= (pt->width - devw) ){
- candidate[num_candidate].isfillw = true;
- }
- if( 0 <= (pt->height - devh) ){
- candidate[num_candidate].isfillh = true;
- }
- num_candidate++;
- }
- }
- if ( 0 < num_candidate ) {
- break;
- }
- }
- }
-
- /* no papersize match, so use default paper size */
- if ( 0 == num_candidate ) {
- return (const EPaperTable *)0; /* not found */
- }
-
- if ( 1 == num_candidate ) {
- return candidate[0].paper; /* find */
- }
-
- /* search abstruct minw & minh */
- {
- int absminw;
- int absminh;
- int i;
-
- absminw = candidate[0].absw;
- absminh = candidate[0].absh;
- for (i = 1; i < num_candidate; i++) {
- if (absminw > candidate[i].absw) {
- absminw = candidate[i].absw;
- }
- if (absminh > candidate[i].absh) {
- absminh = candidate[i].absh;
- }
- }
-
- /* check isminw & isminh flag */
- for (i = 0; i < num_candidate; i++) {
- if (absminw == candidate[i].absw) {
- candidate[i].isminw = true;
- }
- if (absminh == candidate[i].absh) {
- candidate[i].isminh = true;
- }
- }
-
- /* add score */
- for (i = 0; i < num_candidate; i++) {
- if (candidate[i].isminw == true) {
- candidate[i].score += 100;
- }
- if (candidate[i].isminh == true) {
- candidate[i].score += 100;
- }
- if (candidate[i].isfillw == true) {
- candidate[i].score += 10;
- }
- if (candidate[i].isfillh == true) {
- candidate[i].score += 10;
- }
- if (absminw < absminh) {
- if (candidate[i].isminw == true) {
- candidate[i].score += 1;
- }
- } else {
- if (candidate[i].isminh == true) {
- candidate[i].score += 1;
- }
- }
- }
- }
-
- /* select highest score papersize */
- {
- int best_candidate;
- int i;
-
- best_candidate = 0;
- for (i = 1; i < num_candidate; i++) {
- if ( candidate[best_candidate].score <= candidate[i].score ) {
- best_candidate = i;
- }
- }
- return candidate[best_candidate].paper;
- }
-}
-
-private char *
-get_sysname ( void )
-{
- char *result = NULL;
- struct utsname utsn;
-
- if (0 == uname (&utsn))
- {
- result = strdup (utsn.sysname);
- }
- return result;
-}
-
-/* EPSON printer model name translation.
- return: 0 unknown model, not translated.
- 1 completed.
- -1 error. ... This value not return now.
- */
-private int
-trans_modelname ( char *dest, const char * src, size_t dest_len )
-{
- const char *cp = src;
-
- dest[0] = '\0';
-
- if ( 0 == strncmp( cp, "epl", 3 ) ) {
- strcat( dest, "EPSON EPL-" );
- cp = &cp[3];
- } else if ( 0 == strncmp( cp, "al", 2 ) ) {
- strcat( dest, "EPSON AL-" );
- cp = &cp[2];
- } else if ( 0 == strncmp( cp, "lp", 2 ) ) {
- strcat( dest, "EPSON LP-" );
- cp = &cp[2];
- } else {
- strncpy( dest, src, dest_len );
- dest[dest_len] = '\0';
- return 0;
- }
-
- {
- char * pdest = strchr( dest, '\0' );
- size_t len = strlen( dest );
-
- while ( ( len < (dest_len -1) ) && *cp && ( '_' != *cp) ) {
- *pdest = toupper( *cp );
- pdest++;
- cp++;
- }
- *pdest = '\0';
- }
-
- return 1;
-}
-
-
-private int
-escv_beginpage(gx_device_vector * vdev)
-{
- gx_device_escv *const pdev = (gx_device_escv *)vdev;
-
- if (pdev -> first_page) {
-
- /* not use gdev_vector_stream */
- stream *s = vdev->strm;
- char ebuf[1024];
- int MaxRes;
- int Local;
- int Duplex;
- int FaceUp;
-
- const struct {
- const char *name;
- const int resolution;
- const int locale;
- const int duplex;
- const int faceup;
- } model_resource[] = {
- /* model, resolution, loca,deplex,faceup */
- { "alc1900", RES600, ENG, TRUE, FALSE },
- { "alc2000", RES600, ENG, TRUE, FALSE },
- { "alc4000", RES1200, ENG, TRUE, FALSE },
- { "alc4100", RES600, ENG, TRUE, FALSE },
- { "alc8500", RES600, ENG, TRUE, TRUE },
- { "alc8600", RES600, ENG, TRUE, TRUE },
- { "alc9100", RES600, ENG, TRUE, TRUE },
- { "epl2050", RES1200, ENG, TRUE, FALSE },
- { "epl2050p",RES1200, ENG, TRUE, FALSE },
- { "epl2120", RES1200, ENG, TRUE, FALSE },
- { "epl2500", RES600, ENG, TRUE, FALSE },
- { "epl2750", RES600, ENG, TRUE, FALSE },
- { "epl5800", RES1200, ENG, FALSE, FALSE },
- { "epl5900", RES1200, ENG, FALSE, FALSE },
- { "epl6100", RES1200, ENG, FALSE, FALSE },
- { "epl6200", RES1200, ENG, FALSE, FALSE },
- { "lp1800", RES600, JPN, FALSE, FALSE },
- { "lp1900", RES1200, JPN, FALSE, FALSE },
- { "lp2200", RES1200, JPN, FALSE, FALSE },
- { "lp2400", RES1200, JPN, FALSE, FALSE },
- { "lp2500", RES1200, JPN, FALSE, FALSE },
- { "lp3000c", RES600, JPN, TRUE, FALSE },
- { "lp7500", RES600, JPN, TRUE, FALSE },
- { "lp7700", RES600, JPN, TRUE, FALSE },
- { "lp7900", RES600, JPN, TRUE, FALSE },
- { "lp8000c", RES600, JPN, FALSE, TRUE },
- { "lp8100", RES600, JPN, TRUE, FALSE },
- { "lp8200c", RES600, JPN, FALSE, TRUE },
- { "lp8300c", RES600, JPN, TRUE, TRUE },
- { "lp8300f", RES600, JPN, TRUE, FALSE },
- { "lp8400f", RES600, JPN, TRUE, FALSE },
- { "lp8500c", RES600, JPN, TRUE, TRUE },
- { "lp8600", RES600, JPN, TRUE, FALSE },
- { "lp8600f", RES600, JPN, TRUE, FALSE },
- { "lp8700", RES1200, JPN, TRUE, FALSE },
- { "lp8800c", RES600, JPN, TRUE, TRUE },
- { "lp8900", RES600, JPN, TRUE, FALSE },
- { "lp9000b", RES600, JPN, TRUE, FALSE },
- { "lp9000c", RES600, JPN, TRUE, FALSE },
- { "lp9100", RES600, JPN, TRUE, FALSE },
- { "lp9200b", RES600, JPN, TRUE, FALSE },
- { "lp9200c", RES600, JPN, TRUE, FALSE },
- { "lp9300", RES600, JPN, TRUE, FALSE },
- { "lp9400", RES600, JPN, TRUE, FALSE },
- { "lp9500c", RES600, JPN, TRUE, TRUE },
- { "lp9600", RES600, JPN, TRUE, FALSE },
- { "lp9600s", RES600, JPN, TRUE, FALSE },
- { "lp9800c", RES600, JPN, TRUE, TRUE },
- { "lps4500", RES600, JPN, TRUE, FALSE },
- { "lps6500", RES600, JPN, TRUE, FALSE },
- { "", -1, -1, FALSE, FALSE }
- };
-
- /* set default */
- MaxRes = RES600;
- Local = JPN;
- Duplex = FALSE;
- FaceUp = FALSE;
-
- if ( !*pdev->JobID )
- strcpy(pdev->JobID, "0");
-
-
- lputs(s, "\033\001@EJL \012");
-
- lputs(s, "@EJL SJ ID=\"");
- lputs(s, pdev->JobID);
- lputs(s, "\"\012");
-
- lputs(s, "@EJL JI ID=\"");
- lputs(s, pdev->JobID);
- lputs(s, "\"");
-
- {
- time_t t;
-
- time(&t);
-
- lputs(s, " DATE=\"");
- {
- struct tm *tm;
- char str[32];
- size_t i;
-
- tm = localtime( &t );
- i = strftime(str, 30, "%Y/%m/%d %H:%M:%S", tm);
- if ( 30 >= i )
- str[i] = '\0';
-
- lputs(s, str);
- }
- lputs(s, "\"");
-
- lputs(s, "\012");
- }
-
- lputs(s, "@EJL JI");
- {
- lputs(s, " USER=\"");
- if ( *pdev->UserName )
- lputs(s, pdev->UserName);
- lputs(s, "\"");
-
- lputs(s, " MACHINE=\"");
- if ( *pdev->HostName )
- lputs(s, pdev->HostName);
- lputs(s, "\"");
-
- lputs(s, " DOCUMENT=\"");
- if ( *pdev->Document )
- lputs(s, pdev->Document);
- lputs(s, "\"");
- }
- lputs(s, "\012");
-
- lputs(s, "@EJL JI OS=\"");
- {
- char *sysname = get_sysname ();
- if (sysname)
- {
- lputs(s, sysname );
- free (sysname);
- sysname = NULL;
- }
- }
- lputs(s, "\"\012");
-
- lputs(s, "@EJL JI DRIVER=\"");
- {
- char _modelname[ ESCPAGE_MODELNAME_MAX + 1 ] = {0,};
- const char *modelname;
- int i;
-
- modelname = pdev->dname;
-
- for ( i = 0; (-1) != model_resource[i].resolution; i++ ) {
- if ( 0 == strcmp( pdev->dname, model_resource[i].name ) )
- break;
- }
-
- if ( (-1) != model_resource[i].resolution ) {
- MaxRes = model_resource[i].resolution;
- Local = model_resource[i].locale;
- Duplex = model_resource[i].duplex;
- FaceUp = model_resource[i].faceup;
-
- if ( 0 <= trans_modelname( _modelname, model_resource[i].name, ESCPAGE_MODELNAME_MAX ) )
- modelname = _modelname;
-
- lputs(s, modelname);
- } else {
- lputs(s, "Ghostscript");
- }
- lputs(s, "\"\012");
-
- lputs(s, "@EJL JI PRINTER=\"");
- lputs(s, modelname);
- lputs(s, "\"\012");
- }
-
- if ( *pdev->Comment ) {
- lputs(s, "@EJL CO ");
- lputs(s, pdev->Comment );
- lputs(s, "\012");
- }
-
- lputs(s, "@EJL SE LA=ESC/PAGE\012");
-
- lputs(s, "@EJL SET");
-
- /* Resolusion */
- if (vdev->x_pixels_per_inch == 1200){
- if (MaxRes == 1200){
- lputs(s, " RS=1200");
- } else {
- lputs(s, " RS=FN");
- }
- } else if (vdev->x_pixels_per_inch == 600) {
- lputs(s, " RS=FN");
- } else {
- lputs(s, " RS=QK");
- }
-
- /* Output Unit */
- if ((pdev->faceup && FaceUp) || (pdev->MediaType && FaceUp)) {
- lputs(s, " OU=FU");
- } else {
- lputs(s, " OU=FD");
- }
-
- /* Paper unit */
- if (pdev->MediaType){
- if (Local == ENG){
- lputs(s, " PU=1");
- } else {
- lputs(s, " PU=15");
- }
- }else{
- if (pdev->manualFeed) {
- if (Local == ENG){
- lputs(s, " PU=1");
- } else {
- lputs(s, " PU=15");
- }
- } else if (pdev->cassetFeed) {
- (void)sprintf(ebuf, " PU=%d", pdev->cassetFeed);
- lputs(s, ebuf);
- } else {
- lputs(s, " PU=AU");
- }
- }
-
- if (Duplex && pdev->Duplex) {
- /* Duplex ON */
- lputs(s, " DX=ON");
-
- /* binding type */
- if (pdev->Tumble) {
- lputs(s, " BD=SE");
- } else {
- lputs(s, " BD=LE");
- }
- } else {
- /* Duplex off */
- lputs(s, " DX=OFF");
- }
-
- /* Number of copies */
- if (pdev->NumCopies) {
- if (pdev->NumCopies >= 1000) {
- pdev->NumCopies = 999;
- }
-
- /* lp8000c not have QT */
- if (strcmp(pdev->dname, "lp8000c") == 0) {
- (void)sprintf(ebuf, " QT=1 CO=%d", pdev->NumCopies);
- } else {
- if (pdev->Collate) {
- /* CO is 1, when set QT */
- (void)sprintf(ebuf, " QT=%d CO=1", pdev->NumCopies);
- } else {
- /* QT is 1, when not specified QT */
- (void)sprintf(ebuf, " QT=1 CO=%d", pdev->NumCopies);
- }
- }
- lputs(s, ebuf);
- } else {
- lputs(s, " QT=1 CO=1");
- }
-
- if (pdev->toner_density) {
- (void)sprintf(ebuf, " DL=%d", pdev->toner_density);
- lputs(s, ebuf);
- }
-
- if (pdev->orientation) {
- lputs(s, " OR=LA");
- }
-
- if (pdev->toner_saving) {
- lputs(s, " SN=ON");
- }
-
- if (pdev->RITOff) {
- lputs(s, " RI=OFF");
- } else {
- lputs(s, " RI=ON");
- }
-
- if (pdev->MediaType == 1) {
- lputs(s, " PK=TH");
- } else if (pdev->MediaType == 2) {
- lputs(s, " PK=TR");
- } else {
- lputs(s, " PK=NM");
- }
-
- lputs(s, " PS=");
- {
- const EPaperTable *pt;
-
- pt = escv_checkpapersize(vdev);
- if ( 0 == pt ) {
- lputs(s, "A4");
- } else {
- lputs(s, pt->name);
- }
- }
-
-
- if( 0 == pdev->colormode ) { /* ESC/Page (Monochrome) */
-
-#define START_CODE1 ESC_GS "1tsE" ESC_GS "1owE" ESC_GS "0alfP" ESC_GS "0affP" ESC_GS "0;0;0clfP" ESC_GS "0pmP" ESC_GS "1024ibI" ESC_GS "2cmE" ESC_GS "0bcI" ESC_GS "1;10mlG"
-
-#define STRAT_CODE ESC_GS "1mmE" ESC_GS "1csE"
-
- lputs(s, " ZO=OFF EC=ON SZ=OFF SL=YES TO=0.0MM LO=0.0MM\012");
- lputs(s, "@EJL EN LA=ESC/PAGE\012");
-
- lputs(s, ESC_GS "rhE");
-
- lputs(s, STRAT_CODE);
-
- if (vdev->x_pixels_per_inch == 1200) {
- /* 1200 dpi */
- lputs(s, ESC_GS "0;0.06muE");
- lputs(s, ESC_GS "1;45;156htmE");
- lputs(s, ESC_GS "9;1200;1200drE" ESC_GS "2;1200;1200drE" ESC_GS "1;1200;1200drE" ESC_GS "0;1200;1200drE");
- lputs(s, ESC_GS "1;1;raE");
- } else if (vdev->x_pixels_per_inch == 600) {
- /* 600 dpi */
- lputs(s, ESC_GS "0;0.12muE");
- lputs(s, ESC_GS "1;45;106htmE");
- lputs(s, ESC_GS "9;600;600drE" ESC_GS "2;600;600drE" ESC_GS "1;600;600drE" ESC_GS "0;600;600drE");
- } else {
- /* 300 dpi */
- lputs(s, ESC_GS "0;0.24muE");
- lputs(s, ESC_GS "1;45;71htmE");
- lputs(s, ESC_GS "9;300;300drE" ESC_GS "2;300;300drE" ESC_GS "1;300;300drE" ESC_GS "0;300;300drE");
- }
-
- lputs(s, START_CODE1);
-
- lputs(s, ESC_GS "0sarG"); /* ÀäÂкÂɸ»ØÄê */
- /* lputs(s, ESC_GS "1owE");*/
-
- } else { /* ESC/Page-Color */
-
-#define COLOR_START_CODE1 ESC_GS "1tsE" ESC_GS "0alfP" ESC_GS "0affP" ESC_GS "0;0;0clfP" ESC_GS "0pmP" ESC_GS "1024ibI" ESC_GS "2cmE" ESC_GS "0bcI" ESC_GS "1;10mlG"
-
-#define LP8000_CODE ESC_GS "0pddO" ESC_GS "0;0mmE" ESC_GS "2csE" ESC_GS "0;1;3cmmE" ESC_GS "0;1raE" ESC_GS "0;2;4ccmE"
-
-#define LP8200_CODE ESC_GS "0pddO" ESC_GS "0;0cmmE" ESC_GS "1;2;3ccmE" ESC_GS "2;2;3ccmE" ESC_GS "3;2;4ccmE" ESC_GS "1;1raE" ESC_GS "2;1raE" ESC_GS "3;1raE"
-
-
- lputs(s, " ZO=OFF EC=ON SZ=OFF SL=YES TO=0 LO=0\012");
- lputs(s, "@EJL EN LA=ESC/PAGE-COLOR\012");
-
- lputs(s, ESC_GS "rhE");
-
- if (strcmp(vdev -> dname, "lp8000c") == 0) {
- lputs(s, LP8000_CODE);
- } else {
- lputs(s, LP8200_CODE);
- }
-
- put_bytes(s, ESC_GS "7;0;2;0cam{E\012\000\000\000\000\000\000", 20);
- lputs(s, ESC_GS "0;0cmmE");
-
- if (vdev->x_pixels_per_inch == 1200) {
- /* 1200 dpi */
- lputs(s, ESC_GS "0;0.06muE");
- lputs(s, ESC_GS "3;1200;1200drE" ESC_GS "2;1200;1200drE" ESC_GS "1;1200;1200drE" ESC_GS "0;1200;1200drE");
- } else if (vdev->x_pixels_per_inch == 600) {
- /* 600 dpi */
- lputs(s, ESC_GS "0;0.12muE");
- lputs(s, ESC_GS "3;600;600drE" ESC_GS "2;600;600drE" ESC_GS "1;600;600drE" ESC_GS "0;600;600drE");
- } else {
- /* 300 dpi */
- lputs(s, ESC_GS "0;0.24muE");
- lputs(s, ESC_GS "3;300;300drE" ESC_GS "2;300;300drE" ESC_GS "1;300;300drE" ESC_GS "0;300;300drE");
- }
- lputs(s, ESC_GS "0;0loE");
-
-/* lputs(s, ESC_GS "0poE"); *//* for TEST */
-
- lputs(s, COLOR_START_CODE1);
- lputs(s, ESC_GS "8;1;2;2;2plr{E");
- put_bytes(s, "\377\377\377\377\000\000\000\000", 8);
-
- lputs(s, ESC_GS "0sarG"); /* ÀäÂкÂɸ»ØÄê */
- lputs(s, ESC_GS "2;204wfE"); /* rop »ØÄê */
-
- } /* ESC/Page-Color */
-
- }
-
- return 0;
-}
-
-
-private int
-escv_setlinewidth(gx_device_vector * vdev, floatp width)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_escv *const pdev = (gx_device_escv *) vdev;
- char obuf[64];
-
-#if GS_VERSION_MAJOR == 5
- /* Scale ¤ò³Ý¤±¤Æ¤¤¤ë¤Î¤Ï, Ghostscript 5.10/5.50 ¤Î¥Ð¥°¤Î¤¿¤á */
- floatp xscale, yscale;
-
- xscale = fabs(igs->ctm.xx);
- yscale = fabs(igs->ctm.xy);
-
- if (xscale == 0 || yscale > xscale) /* if portrait */
- width = ceil(width * yscale);
- else
- width = ceil(width * xscale);
-#endif
-
- if (width < 1) width = 1;
-
- /* ESC/Page ¤Ç¤ÏÀþÉý¡¿½ªÃ¼¡¿ÀܹçÉô¤ÎÀßÄê¤Ï£±¤Ä¤Î¥³¥Þ¥ó¥É¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤¿¤áÊÝ»ý¤·¤Æ¤ª¤¯¡£ */
- pdev -> lwidth = width;
-
- (void)sprintf(obuf, ESC_GS "%d;%d;%dlwG",
- (int)(pdev -> lwidth),
- (int)(pdev -> cap),
- (int)(pdev -> join));
- lputs(s, obuf);
-
- return 0;
-}
-
-
-private int
-escv_setlinecap(gx_device_vector * vdev, gs_line_cap cap)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_escv *const pdev = (gx_device_escv *) vdev;
- char obuf[64];
-
- /* ESC/Page ¤Ç¤ÏÀþÉý¡¿½ªÃ¼¡¿ÀܹçÉô¤ÎÀßÄê¤Ï£±¤Ä¤Î¥³¥Þ¥ó¥É¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤¿¤áÊÝ»ý¤·¤Æ¤ª¤¯¡£ */
- pdev -> cap = cap;
-
- if (pdev -> cap >= 3) return -1;
-
- (void)sprintf(obuf, ESC_GS "%d;%d;%dlwG",
- (int)(pdev -> lwidth),
- (int)(pdev -> cap),
- (int)(pdev -> join));
- lputs(s, obuf);
-
- return 0;
-}
-
-
-private int
-escv_setlinejoin(gx_device_vector * vdev, gs_line_join join)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_escv *const pdev = (gx_device_escv *) vdev;
- char obuf[64];
-
- /* ESC/Page ¤Ç¤ÏÀþÉý¡¿½ªÃ¼¡¿ÀܹçÉô¤ÎÀßÄê¤Ï£±¤Ä¤Î¥³¥Þ¥ó¥É¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤¿¤áÊÝ»ý¤·¤Æ¤ª¤¯¡£ */
- switch (join) {
- case 0:
- pdev -> join = 3; /* miter */
- break;
- case 1:
- pdev -> join = 1; /* round */
- break;
- case 2:
- pdev -> join = 2; /* bevel */
- break;
- default:
- return -1;
- }
-
- (void)sprintf(obuf, ESC_GS "%d;%d;%dlwG",
- (int)(pdev -> lwidth),
- (int)(pdev -> cap),
- (int)(pdev -> join));
- lputs(s, obuf);
-
- return 0;
-}
-
-
-private int
-escv_setmiterlimit(gx_device_vector * vdev, floatp limit)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_escv *const pdev = (gx_device_escv *) vdev;
- char obuf[128];
-
- /* ¥Þ¥¤¥¿¡¼¥ê¥ß¥Ã¥ÈÃͤòÀßÄꤹ¤ë¤Ë¤Ï lwG ¤Ë¤Æ ÀܹçÉô»ØÄê(n3) ¤¬ 3 ¤Ë¤Ê¤Ã¤Æ¤¤¤ë
- ** ɬÍפ¬¤¢¤ë¡£
- */
- if (pdev -> join != 3) {
- /* ¶¯À©Åª¤ËÀܹçÉô»ØÄê¤ò¹Ô¤¦ */
- pdev -> join = 3;
- (void)sprintf(obuf, ESC_GS "%d;%d;%dlwG",
- (int)(pdev -> lwidth),
- (int)(pdev -> cap),
- (int)(pdev -> join));
- lputs(s, obuf);
- }
-
- (void)sprintf(obuf, ESC_GS "1;%dmlG", (int)limit);
- lputs(s, obuf);
-
- return 0;
-}
-
-
-#if ( 8 <= GS_VERSION_MAJOR )
-private bool
-escv_can_handle_hl_color(gx_device_vector * vdev, const gs_imager_state * pis,
- const gx_drawing_color * pdc)
-{
- return false;
-}
-#endif
-
-
-private int
-escv_setfillcolor(gx_device_vector * vdev,
-#if ( 8 <= GS_VERSION_MAJOR )
- const gs_imager_state * pis,
-#endif
- const gx_drawing_color * pdc)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_escv *const pdev = (gx_device_escv *) vdev;
- gx_color_index color = gx_dc_pure_color(pdc);
- char obuf[64];
-
- if (!gx_dc_is_pure(pdc)) return_error(gs_error_rangecheck);
- pdev->current_color = color;
-
- if( 0 == pdev->colormode ) { /* ESC/Page (Monochrome) */
-
- (void)sprintf(obuf, /*ESC_GS "1owE"*/ ESC_GS "0;0;100spE" ESC_GS "1;0;%ldccE" ,color);
- lputs(s, obuf);
-
- if (vdev->x_pixels_per_inch == 1200) {
- lputs(s, ESC_GS "1;45;156htmE");
- } else if (vdev->x_pixels_per_inch == 600) {
- lputs(s, ESC_GS "1;45;106htmE");
- } else {
- lputs(s, ESC_GS "1;45;71htmE");
- }
-
- } else { /* ESC/Page-Color */
-
-
- /* ¥Ñ¥¿¡¼¥ó£Ï£Î»ØÄê¡¿¥½¥ê¥Ã¥É¥Ñ¥¿¡¼¥ó»ØÄê */
- (void)sprintf(obuf, ESC_GS "1;2;3;%d;%d;%dfpE",
- (unsigned char)(color >> 16 & 0xff),
- (unsigned char)(color >> 8 & 0xff),
- (unsigned char)(color & 0xff));
- lputs(s, obuf);
- lputs(s, ESC_GS "3;2;1;0;0cpE" ESC_GS "1;2;1;0;0cpE" ESC_GS "5;2;1;0;0cpE");
-
- } /* ESC/Page-Color */
-
- return 0;
-}
-
-
-private int
-escv_setstrokecolor(gx_device_vector * vdev,
-#if ( 8 <= GS_VERSION_MAJOR )
- const gs_imager_state * pis,
-#endif
- const gx_drawing_color * pdc)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_escv *const pdev = (gx_device_escv *) vdev;
- gx_color_index color = gx_dc_pure_color(pdc);
- char obuf[64];
-
- if (!gx_dc_is_pure(pdc)) return_error(gs_error_rangecheck);
-
- if( 0 == pdev->colormode ) { /* ESC/Page (Monochrome) */
-
- pdev->current_color = color;
-
- (void)sprintf(obuf, /*ESC_GS "1owE"*/ ESC_GS "0;0;100spE" ESC_GS "1;1;%ldccE" , color);
- lputs(s, obuf);
-
- if (vdev->x_pixels_per_inch == 1200) {
- lputs(s, ESC_GS "1;45;156htmE");
- } else if (vdev->x_pixels_per_inch == 600) {
- lputs(s, ESC_GS "1;45;106htmE");
- } else {
- lputs(s, ESC_GS "1;45;71htmE");
- }
-
- } else { /* ESC/Page-Color */
-
- if (vdev->color_info.depth == 24) {
-
- pdev->current_color = color;
- /* ¥Ñ¥¿¡¼¥ó£Ï£Î¿§»ØÄê¡¿¥½¥ê¥Ã¥É¥Ñ¥¿¡¼¥ó»ØÄê */
- (void)sprintf(obuf, ESC_GS "1;2;3;%d;%d;%dfpE" ESC_GS "2;2;1;0;0cpE",
- (unsigned char)(color >> 16 & 0xff),
- (unsigned char)(color >> 8 & 0xff),
- (unsigned char)(color & 0xff));
- lputs(s, obuf);
-
- }
- } /* ESC/Page-Color */
-
- return 0;
-}
-
-
-/* Àþ¼ï»ØÄêÌ¿Îá */
-private int
-escv_setdash(gx_device_vector * vdev, const float *pattern, uint count, floatp offset)
-{
- stream *s = gdev_vector_stream(vdev);
- int i;
- char obuf[64];
-
-#if GS_VERSION_MAJOR == 5
- float scale, xscale, yscale;
- /* Scale ¤ò³Ý¤±¤Æ¤¤¤ë¤Î¤Ï, Ghostscript 5.10/5.50 ¤Î¥Ð¥°¤Î¤¿¤á */
- xscale = fabs(igs->ctm.xx);
- yscale = fabs(igs->ctm.xy);
-
- if (xscale == 0) /* if portrait */
- scale = yscale;
- else
- scale = xscale;
-#endif
-
- if (count == 0){
- /* ¼ÂÀþ */
- lputs(s, ESC_GS "0;0lpG");
- return 0;
- }
-
- /* offset ¤¬£°°Ê³°¤Î¾ì¹ç¤ÏÉÁ²èÉԲĤȤ·¤ÆÊÖµÑ */
- if (offset != 0) return -1;
-
- if (count) {
- if (count == 1) {
-#if GS_VERSION_MAJOR == 5
- (void)sprintf(obuf, ESC_GS "1;%d;%ddlG",
- (int)(pattern[0] * scale / vdev->x_pixels_per_inch + 0.5),
- (int)(pattern[0] * scale / vdev->x_pixels_per_inch + 0.5));
-#else
- (void)sprintf(obuf, ESC_GS "1;%d;%ddlG", pattern[0], pattern[0]);
-#endif
- lputs(s, obuf);
- } else {
- /* pattern ¤Ë£°¤¬¤¢¤Ã¤¿¾ì¹ç¤ÏÉÁ²èÉԲĤȤ·¤ÆÊÖµÑ */
- for (i = 0; i < count; ++i) {
- if (pattern[i] == 0) return -1;
- }
-
- lputs(s, ESC_GS "1");
- for (i = 0; i < count; ++i) {
-#if GS_VERSION_MAJOR == 5
- (void)sprintf(obuf, ";%d", (int)(pattern[i] * scale / vdev->x_pixels_per_inch + 0.5));
-
-#else
- (void)sprintf(obuf, ";%d", pattern[i]);
-#endif
- lputs(s, obuf);
- }
- lputs(s, "dlG");
- }
- lputs(s, ESC_GS "1;1lpG");
- }
- return 0;
-}
-
-
-/* ¥Ñ¥¹Ê¿³êÅÙ»ØÄê */
-private int
-escv_setflat(gx_device_vector * vdev, floatp flatness)
-{
- return 0;
-}
-
-
-private int
-escv_setlogop(gx_device_vector * vdev, gs_logical_operation_t lop,
- gs_logical_operation_t diff)
-{
- /****** SHOULD AT LEAST DETECT SET-0 & SET-1 ******/
- return 0;
-}
-
-
-private int
-escv_beginpath(gx_device_vector * vdev, gx_path_type_t type)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_escv *pdev = (gx_device_escv *) vdev;
-
- /* ¥Ñ¥¹¹½ÃÛ³«»ÏÌ¿Îá */
- if (type & gx_path_type_clip) {
- lputs(s, ESC_GS "1bgpG"); /* ¥¯¥ê¥Ã¥×ÅÐÏ¿ */
- } else {
- lputs(s, ESC_GS "0bgpG"); /* ÉÁ²èÅÐÏ¿ */
- }
- pdev->ispath = 0;
-
- return 0;
-}
-
-
-private int
-escv_moveto(gx_device_vector * vdev,
- floatp x0, floatp y0, floatp x1, floatp y1, gx_path_type_t type)
-{
- stream *s = gdev_vector_stream(vdev);
- char obuf[64];
-
- /* ¥µ¥Ö¥Ñ¥¹³«»ÏÌ¿Îá */
- (void)sprintf(obuf, ESC_GS "0;%d;%dmvpG", (int)x1, (int)y1);
- lputs(s, obuf);
-
- return 0;
-}
-
-
-private int
-escv_lineto(gx_device_vector * vdev,
- floatp x0, floatp y0, floatp x1, floatp y1, gx_path_type_t type)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_escv *pdev = (gx_device_escv *) vdev;
- char obuf[64];
-
- (void)sprintf(obuf, ESC_GS "0;1;%d;%dlnpG", (int)x1, (int)y1);
- lputs(s, obuf);
- pdev->ispath = 1;
-
- return 0;
-}
-
-
-private int
-escv_curveto(gx_device_vector * vdev, floatp x0, floatp y0,
- floatp x1, floatp y1, floatp x2, floatp y2, floatp x3, floatp y3,
- gx_path_type_t type)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_escv *pdev = (gx_device_escv *) vdev;
- char obuf[128];
-
- /* ¥Ù¥¸¥§¶ÊÀþ */
- (void)sprintf(obuf, ESC_GS "0;3;%d;%d;%d;%d;%d;%dbzpG",
- (int)x1, (int)y1, (int)x2, (int)y2, (int)x3, (int)y3);
- lputs(s, obuf);
- pdev->ispath = 1;
-
- return 0;
-}
-
-
-private int
-escv_closepath(gx_device_vector * vdev, floatp x, floatp y,
- floatp x_start, floatp y_start, gx_path_type_t type)
-{
- stream *s = gdev_vector_stream(vdev);
-
- lputs(s, ESC_GS "clpG");
- return 0;
-}
-
-
-private int
-escv_endpath(gx_device_vector * vdev, gx_path_type_t type)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_escv *pdev = (gx_device_escv *) vdev;
-
- if (type & gx_path_type_fill || type & gx_path_type_clip) {
- /* default ¤Ç½èÍý¤µ¤ì¤ë¤¬½ÐÎϤ·¤Æ¤ª¤¯ */
- lputs(s, ESC_GS "clpG");
- }
-
- /* ¥Ñ¥¹¥¯¥í¡¼¥º */
- lputs(s, ESC_GS "enpG");
-
- /* ¥Ñ¥¹ÉÁ²è */
- if (type & gx_path_type_clip) {
-
- if ( ( 0 != ESCV_FORCEDRAWPATH ) || ( 0 != pdev->ispath ) ) {
- /* ¥¯¥ê¥Ã¥×»ØÄê
- ** ¥¯¥ê¥Ã¥×¤Ë¤â gx_path_type_winding_number, gx_path_type_even_odd ¤ÎȽÃǤ¬
- ** ɬÍפÀ¤È»×¤¦¤¬ gs ¦¤¬Éղ䷤Ƥ³¤Ê¤¤¡£
- ** ¤È¤ê¤¢¤¨¤º gx_path_type_even_odd ¤ò¥Ç¥Õ¥©¥ë¥È¤Ë¤¹¤ë¡£
- */
- lputs(s, ESC_GS "1;2capG");
- }
- } else if (type & gx_path_type_fill) {
-
- /* Åɤê¤Ä¤Ö¤·µ¬Â§ÀßÄê */
- if (type & gx_path_type_even_odd) {
- lputs(s, ESC_GS "0;2drpG"); /* Åɤê¤Ä¤Ö¤·ÉÁ²è */
- } else {
- lputs(s, ESC_GS "0;1drpG"); /* Åɤê¤Ä¤Ö¤·ÉÁ²è */
- }
- } else {
- lputs(s, ESC_GS "0;0drpG"); /* ÎسÔÀþÉÁ²è */
- }
-
- return 0;
-}
-
-/* ---------------- Driver procedures ---------------- */
-
-/* ------ Open/close/page ------ */
-
-/* Open the device. */
-private int
-escv_open(gx_device * dev)
-{
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- gx_device_escv *const pdev = (gx_device_escv *) dev;
- int code;
- /* char *error, *path;*/
- float width, height;
-
- code = escv_range_check(dev);
- if (code < 0) return code;
-
- vdev->v_memory = dev->memory;
- /****** VERY WRONG ******/
- vdev->vec_procs = &escv_vector_procs;
-
- code = gdev_vector_open_file_bbox(vdev, 512, true);
- if (code < 0) return code;
-
- gdev_vector_init(vdev);
- pdev->first_page = true;
-
- if(pdev->orientation){
-
- if( 0 == pdev->colormode ) { /* ESC/Page (Monochrome) */
-
- pdev->Margins[1] = (pdev->width - pdev->height - \
- ESCPAGE_LEFT_MARGIN_DEFAULT * vdev->x_pixels_per_inch / 72.0) * \
- X_DPI / vdev->x_pixels_per_inch;
-
- } else { /* ESC/Page-Color */
-
- /* pdev->Margins[1] = pdev->width - pdev->height + dev->HWMargins[0];
- */
- pdev->Margins[1] = (pdev->width - pdev->height) * \
- X_DPI / vdev->x_pixels_per_inch;
-
- } /* ESC/Page-Color */
-
- width = dev->MediaSize[0];
- height = dev->MediaSize[1];
- dev->MediaSize[0] = height;
- dev->MediaSize[1] = width;
- }
-
- return 0;
-}
-
-
-/* Wrap up ("output") a page. */
-private int
-escv_output_page(gx_device * dev, int num_copies, int flush)
-{
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- gx_device_escv *const pdev = (gx_device_escv *) dev;
- stream *s = gdev_vector_stream(vdev);
-
- /* ÀþÉý,½ªÃ¼½èÍý,ÀܹçÉô½èÍý¤ò½é´ü²½¤·¤Æ¤ª¤¯ */
- lputs(s, ESC_GS "3;0;0lwG" ESC_GS "1;10mlG" ESC_FF);
-
- sflush(s);
- vdev->in_page = false;
- pdev->first_page = false;
-
- gdev_vector_reset(vdev);
-
- return 0;
-}
-
-
-private int
-escv_close(gx_device *dev)
-{
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- FILE *f = vdev->file;
-
- /* ½ªÎ»½èÍý¥³¡¼¥É¤Ï·è¤áÂǤÁ */
- (void)fprintf(f, ESC_GS "rhE" "\033\001@EJL \012@EJL EJ \012\033\001@EJL \012");
-
- gdev_vector_close_file(vdev);
-
- return 0;
-}
-
-/* Close the device. */
-/* Note that if this is being called as a result of finalization, */
-/* the stream may no longer exist; but the file will still be open. */
-
-/* ---------------- Get/put parameters ---------------- */
-
-
-private int
-escv_get_str_param( gs_param_list * plist, gs_param_name key, gs_param_string *pgsstr, int code )
-{
- int ncode;
-
- ncode = param_write_string(plist, key, pgsstr);
-
- if ( ncode < 0)
- code = ncode;
-
- return code;
-}
-
-/* Get parameters. */
-private int
-escv_get_params(gx_device * dev, gs_param_list * plist)
-{
- gx_device_escv *const pdev = (gx_device_escv *) dev;
- int code;
- int ncode;
-
- code = gdev_vector_get_params(dev, plist);
- if (code < 0) return code;
-
- if ((ncode = param_write_bool(plist, ESCPAGE_OPTION_MANUALFEED, &pdev->manualFeed)) < 0)
- code = ncode;
-
- if ((ncode = param_write_int(plist, ESCPAGE_OPTION_CASSETFEED, &pdev->cassetFeed)) < 0)
- code = ncode;
-
- if ((ncode = param_write_bool(plist, ESCPAGE_OPTION_RIT, &pdev->RITOff)) < 0)
- code = ncode;
-
- if ((ncode = param_write_bool(plist, ESCPAGE_OPTION_COLLATE, &pdev->Collate)) < 0)
- code = ncode;
-
- if ((ncode = param_write_int(plist, ESCPAGE_OPTION_TONERDENSITY, &pdev->toner_density)) < 0)
- code = ncode;
-
- if ((ncode = param_write_bool(plist, ESCPAGE_OPTION_LANDSCAPE, &pdev->orientation)) < 0)
- code = ncode;
-
- if ( param_write_bool(plist, ESCPAGE_OPTION_TONERSAVING, &pdev->toner_saving)< 0)
- code = ncode;
-
- if ((ncode = param_write_bool(plist, ESCPAGE_OPTION_DUPLEX, &pdev->Duplex)) < 0)
- code = ncode;
-
- if ((ncode = param_write_bool(plist, ESCPAGE_OPTION_DUPLEX_TUMBLE, &pdev->Tumble)) < 0)
- code = ncode;
-
- if ((ncode = param_write_bool(plist, ESCPAGE_OPTION_FACEUP, &pdev->faceup)) < 0)
- code = ncode;
-
- if ((ncode = param_write_int(plist, ESCPAGE_OPTION_MEDIATYPE, &pdev->MediaType)) < 0)
- code = ncode;
-
- code = escv_get_str_param( plist, ESCPAGE_OPTION_JOBID, &pdev->gpsJobID, code );
- code = escv_get_str_param( plist, ESCPAGE_OPTION_USERNAME, &pdev->gpsUserName, code );
- code = escv_get_str_param( plist, ESCPAGE_OPTION_HOSTNAME, &pdev->gpsHostName, code );
- code = escv_get_str_param( plist, ESCPAGE_OPTION_DOCUMENT, &pdev->gpsDocument, code );
- code = escv_get_str_param( plist, ESCPAGE_OPTION_COMMENT, &pdev->gpsComment, code );
-
- return code;
-}
-
-
-private int
-escv_set_str_param( gs_param_list * plist, const char * key, char *strvalue, int bufmax, int ecode )
-{
- gs_param_name param_name;
- gs_param_string gsstr;
- int code;
- int writesize = bufmax;
-
- switch (code = param_read_string(plist, (param_name = key), &gsstr)) {
- case 0:
- writesize = ( bufmax < gsstr.size )? bufmax : gsstr.size ;
- strncpy( strvalue, gsstr.data, writesize );
- strvalue[ writesize ] = '\0';
- break;
- default:
- ecode = code;
- param_signal_error(plist, param_name, ecode);
- case 1:
- break;
- }
- return ecode;
-}
-
-/* Put parameters. */
-private int
-escv_put_params(gx_device * dev, gs_param_list * plist)
-{
- gx_device_escv *const pdev = (gx_device_escv *) dev;
- int ecode = 0;
- int code;
- gs_param_name param_name;
- gs_param_string pmedia;
- bool mf = pdev->manualFeed;
- int cass = pdev->cassetFeed;
- bool tum = pdev->Tumble;
- bool collate = pdev->Collate;
- int toner_density = pdev->toner_density;
- bool toner_saving = pdev->toner_saving;
- bool landscape = pdev->orientation;
- bool faceup = pdev->faceup;
- bool duplex = pdev->Duplex;
- bool RITOff = pdev->RITOff;
- int old_bpp = dev->color_info.depth;
- int bpp = 0;
-
- ecode = escv_set_str_param( plist, ESCPAGE_OPTION_JOBID, pdev->JobID, ESCPAGE_JOBID_MAX, ecode );
- ecode = escv_set_str_param( plist, ESCPAGE_OPTION_USERNAME, pdev->UserName, ESCPAGE_USERNAME_MAX, ecode );
- ecode = escv_set_str_param( plist, ESCPAGE_OPTION_HOSTNAME, pdev->HostName, ESCPAGE_HOSTNAME_MAX, ecode );
- ecode = escv_set_str_param( plist, ESCPAGE_OPTION_DOCUMENT, pdev->Document, ESCPAGE_DOCUMENT_MAX, ecode );
- ecode = escv_set_str_param( plist, ESCPAGE_OPTION_COMMENT, pdev->Comment, ESCPAGE_COMMENT_MAX, ecode );
-
- if ((code = param_read_bool(plist, (param_name = ESCPAGE_OPTION_MANUALFEED), &mf)) < 0) {
- param_signal_error(plist, param_name, ecode = code);
- }
- switch (code = param_read_int(plist, (param_name = ESCPAGE_OPTION_CASSETFEED), &cass)) {
- case 0:
- if (cass < -1 || cass > 15)
- ecode = gs_error_limitcheck;
- else
- break;
- goto casse;
- default:
- ecode = code;
- casse:param_signal_error(plist, param_name, ecode);
- case 1:
- break;
- }
-
- if((code = param_read_bool(plist, (param_name = ESCPAGE_OPTION_COLLATE), &collate)) < 0) {
- param_signal_error(plist, param_name, ecode = code);
- }
-
- if ((code = param_read_bool(plist, (param_name = ESCPAGE_OPTION_RIT), &RITOff)) < 0) {
- param_signal_error(plist, param_name, ecode = code);
- }
-
- switch (code = param_read_string(plist, (param_name = ESCPAGE_OPTION_MEDIATYPE), &pmedia)) {
- case 0:
- if (pmedia.size > ESCPAGE_MEDIACHAR_MAX)
- ecode = gs_error_limitcheck;
- else { /* Check the validity of ``MediaType'' characters */
-
- if (strcmp(pmedia.data, "TRANS") == 0) {
- pdev->MediaType = 2;
- } else if (strcmp(pmedia.data, "THICK") == 0) {
- pdev->MediaType = 1;
- } else {
- ecode = gs_error_rangecheck;
- goto pmediae;
- }
- }
- break;
- goto pmediae;
- default:
- ecode = code;
- pmediae:param_signal_error(plist, param_name, ecode);
- case 1:
- if(!pdev->MediaType){
- pdev->MediaType = 0;
- pmedia.data = 0;
- }
- break;
- }
-
- switch (code = param_read_int(plist,
- (param_name = ESCPAGE_OPTION_TONERDENSITY), &toner_density)) {
- case 0:
- if (toner_density < 0 || toner_density > 5)
- ecode = gs_error_rangecheck;
- else
- break;
- goto tden;
- default:
- ecode = code;
- tden:
- param_signal_error(plist, param_name, ecode);
- case 1:
- break;
- }
-
- switch (code = param_read_bool(plist, (param_name = ESCPAGE_OPTION_TONERSAVING), &toner_saving)) {
- case 0:
- break;
- default:
- if ((code = param_read_null(plist, param_name)) == 0) {
- break;
- }
- ecode = code;
- param_signal_error(plist, param_name, ecode);
- case 1:
- break;
- }
-
- if ((code = param_read_bool(plist, (param_name = ESCPAGE_OPTION_DUPLEX), &duplex)) < 0)
- param_signal_error(plist, param_name, ecode = code);
-
- if ((code = param_read_bool(plist, (param_name = ESCPAGE_OPTION_DUPLEX_TUMBLE), &tum)) < 0)
- param_signal_error(plist, param_name, ecode = code);
-
- if ((code = param_read_bool(plist, (param_name = ESCPAGE_OPTION_LANDSCAPE), &landscape)) < 0)
- param_signal_error(plist, param_name, ecode = code);
-
- if ((code = param_read_bool(plist, (param_name = ESCPAGE_OPTION_FACEUP), &faceup)) < 0) {
- param_signal_error(plist, param_name, ecode = code);
- }
-
-
- switch (code = param_read_int(plist, (param_name = "BitsPerPixel"), &bpp)) {
- case 0:
- if (bpp != 8 && bpp != 24)
- ecode = gs_error_rangecheck;
- else
- break;
- goto bppe;
- default:
- ecode = code;
- bppe:param_signal_error(plist, param_name, ecode);
- case 1:
- break;
- }
-
- if (bpp != 0) {
- dev->color_info.depth = bpp;
- dev->color_info.num_components = ((bpp == 8) ? 1 : 3);
- dev->color_info.max_gray = (bpp > 8 ? 255 : 1000);
- dev->color_info.max_color = (bpp > 8 ? 255 : 1000);
- dev->color_info.dither_grays = (bpp > 8 ? 256 : 5);
- dev->color_info.dither_colors = (bpp > 8 ? 256 : 2);
- dev_proc(pdev, map_rgb_color) = ((bpp == 8) ? gx_default_gray_map_rgb_color : gx_default_rgb_map_rgb_color);
- dev_proc(pdev, map_color_rgb) = ((bpp == 8) ? gx_default_gray_map_color_rgb : gx_default_rgb_map_color_rgb);
- }
-
- if (ecode < 0) return ecode;
- code = gdev_vector_put_params(dev, plist);
- if (code < 0) return code;
-
- pdev->manualFeed = mf;
- pdev->cassetFeed = cass;
- pdev->faceup = faceup;
- pdev->RITOff = RITOff;
- pdev->orientation = landscape;
- pdev->toner_density = toner_density;
- pdev->toner_saving = toner_saving;
- pdev->Collate = collate;
- pdev->Duplex = duplex;
- pdev->Tumble = tum;
-
- if (bpp != 0 && bpp != old_bpp && pdev->is_open)
- return gs_closedevice(dev);
-
- return 0;
-}
-
-/* ---------------- Images ---------------- */
-
-
-private int
-escv_copy_mono(gx_device * dev, const byte * data,
- int data_x, int raster, gx_bitmap_id id, int x, int y, int w, int h,
- gx_color_index zero, gx_color_index one)
-{
- gx_device_escv *const pdev = (gx_device_escv *) dev;
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- stream *s = gdev_vector_stream(vdev);
- gx_drawing_color color;
- int code = 0;
- gx_color_index c_color = 0;
- char obuf[128];
- int depth = 1;
-#if ( 8 <= GS_VERSION_MAJOR )
- /* FIXME! add for gs815 */
- const gs_imager_state * pis = (const gs_imager_state *)0;
-#endif
-
- if (id != gs_no_id && zero == gx_no_color_index && one != gx_no_color_index && data_x == 0) {
- gx_drawing_color dcolor;
-
- color_set_pure(&dcolor, one);
- escv_setfillcolor(vdev,
-#if ( 8 <= GS_VERSION_MAJOR )
- pis,
-#endif
- &dcolor); /* FIXME! gs815 */
- }
-
- if (zero == gx_no_color_index) {
-
- if (one == gx_no_color_index) return 0;
- if (pdev->MaskState != 1) {
-
- if( 0 == pdev->colormode ) { /* ESC/Page (Monochrome) */
-
- /* lputs(s, ESC_GS "1owE");*/
- (void)sprintf(obuf, ESC_GS "1;1;%ldccE", c_color);
- lputs(s, obuf);
-
- if (vdev->x_pixels_per_inch == 1200) {
- lputs(s, ESC_GS "1;45;156htmE");
- } else if (vdev->x_pixels_per_inch == 600) {
- lputs(s, ESC_GS "1;45;106htmE");
- } else {
- lputs(s, ESC_GS "1;45;71htmE");
- }
-
- } else { /* ESC/Page-Color */
-
- lputs(s, ESC_GS "2;184wfE" ESC_GS "3;184wfE" ESC_GS "5;184wfE");
-
- } /* ESC/Page-Color */
-
- pdev->MaskState = 1;
- }
- c_color = one;
-
- } else if (one == gx_no_color_index)
- /* 1bit ¤ÏÆ©ÌÀ ¥Ó¥Ã¥Èȿž¡¦zero ¿§¤ËÀ÷¤á¤ë */
- {
- if (pdev->MaskState != 1) {
-
- if( 0 == pdev->colormode ) { /* ESC/Page (Monochrome) */
-
- /* lputs(s, ESC_GS "1owE");*/
-
- } else { /* ESC/Page-Color */
-
- lputs(s, ESC_GS "3;184wfE" ESC_GS "5;184wfE");
-
- } /* ESC/Page-Color */
-
- pdev->MaskState = 1;
- }
- c_color = zero;
- } else if (one == vdev->white) {
-
- if (pdev->MaskState != 0) {
-
- if( 0 == pdev->colormode ) { /* ESC/Page (Monochrome) */
-
- /* lputs(s, ESC_GS "1owE");*/
-
- } else { /* ESC/Page-Color */
-
- lputs(s, ESC_GS "3;204wfE" ESC_GS "5;204wfE");
-
- } /* ESC/Page-Color */
-
- pdev->MaskState = 0;
- }
- c_color = zero;
- } else {
-
- if (pdev->MaskState != 1) {
-
- if( 0 == pdev->colormode ) { /* ESC/Page (Monochrome) */
-
- /* lputs(s, ESC_GS "1owE");*/
-
- } else { /* ESC/Page-Color */
-
- lputs(s, ESC_GS "3;184wfE" ESC_GS "5;184wfE");
-
- } /* ESC/Page-Color */
-
- pdev->MaskState = 1;
- }
- color_set_pure(&color, one);
- code = gdev_vector_update_fill_color((gx_device_vector *) pdev,
-#if ( 8 <= GS_VERSION_MAJOR )
- pis,
-#endif
- &color);
-
- /* ¤³¤³¤òÄ̲ᤷ¤¿¤é°Ê²¼¤Î¿§ÀßÄê¤Ï̵°ÕÌ£¡© */
- }
- if (code < 0) return 0;
-
- if( 0 == pdev->colormode ) { /* ESC/Page (Monochrome) */
- } else { /* ESC/Page-Color */
-
- /* ¥Ñ¥¿¡¼¥ó£Ï£Î»ØÄê¡¿¥½¥ê¥Ã¥É¥Ñ¥¿¡¼¥ó»ØÄê */
- (void)sprintf(obuf, ESC_GS "1;2;3;%d;%d;%dfpE",
- (unsigned char)(c_color >> 16 & 0xff),
- (unsigned char)(c_color >> 8 & 0xff),
- (unsigned char)(c_color & 0xff));
- lputs(s, obuf);
-
- lputs(s, ESC_GS "5;2;1;0;0cpE");
-
- } /* ESC/Page-Color */
-
- escv_write_begin(dev, depth, (int)x, (int)y, w, h, w, h, 0);
- {
- int i, j;
- uint width_bytes = (w + 7) >> 3;
- uint num_bytes = width_bytes * h;
-
- byte *buf = gs_alloc_bytes(vdev->memory, num_bytes, "escv_copy_mono(buf)");
-
- if (data_x % 8 == 0) {
- for (i = 0; i < h; ++i) {
- memcpy(buf + i * width_bytes, data + (data_x >> 3) + i * raster, width_bytes);
- }
- } else {
- for (i = 0; i < h; ++i) {
- for (j = 0; j < width_bytes; j++) {
- *(buf + i * width_bytes + j) =
- *(data + (data_x >> 3) + i * raster + j) << (data_x % 8) |
- *(data + (data_x >> 3) + i * raster + j + 1) >> (8 - data_x % 8);
- }
- }
- }
-
- escv_write_data(dev, depth, buf, num_bytes, w, h);
- gs_free_object(vdev->memory, buf, "escv_copy_mono(buf)");
- }
- escv_write_end(dev, depth);
- return 0;
-}
-
-
-/* Copy a color bitmap. */
-private int
-escv_copy_color(gx_device * dev,
- const byte * data, int data_x, int raster, gx_bitmap_id id,
- int x, int y, int w, int h)
-{
- gx_device_escv *const pdev = (gx_device_escv *) dev;
- gx_device_vector *const vdev = (gx_device_vector *) dev;
-
- int depth = dev->color_info.depth;
- int num_components = (depth < 24 ? 1 : 3);
- uint width_bytes = w * num_components;
-
- if (pdev->MaskState != 0) {
-
- if( 0 == pdev->colormode ) { /* ESC/Page (Monochrome) */
-
- /* lputs(s, ESC_GS "1owE");*/
-
- } else { /* ESC/Page-Color */
- stream *s = gdev_vector_stream(vdev);
-
- lputs(s, ESC_GS "3;204wfE" ESC_GS "5;204wfE");
-
- } /* ESC/Page-Color */
- pdev->MaskState = 0;
- }
-
- escv_write_begin(dev, depth, (int)x, (int)y, w, h, w, h, 0);
-
- {
- int i;
- uint num_bytes = width_bytes * h;
- byte *buf = gs_alloc_bytes(vdev->memory, num_bytes, "escv_copy_color(buf)");
-
- for (i = 0; i < h; ++i) {
- memcpy(buf + i * width_bytes, data + ((data_x * depth) >> 3) + i * raster, width_bytes);
- }
-
- escv_write_data(dev, depth, buf, num_bytes, w, h);
- gs_free_object(vdev->memory, buf, "escv_copy_color(buf)");
- }
-
- escv_write_end(dev, depth);
- return 0;
-}
-
-
-/* Fill a mask. */
-private int
-escv_fill_mask(gx_device * dev,
- const byte * data, int data_x, int raster, gx_bitmap_id id,
- int x, int y, int w, int h,
- const gx_drawing_color * pdcolor, int depth,
- gs_logical_operation_t lop, const gx_clip_path * pcpath)
-{
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- gx_device_escv *const pdev = (gx_device_escv *) dev;
- stream *s = gdev_vector_stream(vdev);
-
- gx_color_index color = gx_dc_pure_color(pdcolor);
- char obuf[64];
-
-#if ( 8 <= GS_VERSION_MAJOR )
- /* FIXME! add for gs815 */
- const gs_imager_state * pis = (const gs_imager_state *)0;
-#endif
-
- if (w <= 0 || h <= 0) return 0;
-
- if (depth > 1 ||
- gdev_vector_update_fill_color(vdev,
-#if ( 8 <= GS_VERSION_MAJOR )
- pis,
-#endif
- pdcolor) < 0 ||
- gdev_vector_update_clip_path(vdev, pcpath) < 0 ||
- gdev_vector_update_log_op(vdev, lop) < 0
- )
- return gx_default_fill_mask(dev, data, data_x, raster, id,
- x, y, w, h, pdcolor, depth, lop, pcpath);
-
- if( 0 == pdev->colormode ) { /* ESC/Page (Monochrome) */
-
- if (!gx_dc_is_pure(pdcolor)) return_error(gs_error_rangecheck);
- pdev->current_color = color;
-
- (void)sprintf(obuf, ESC_GS "0;0;100spE" ESC_GS "1;1;%ldccE" ,color);
- lputs(s, obuf);
-
-
- if (vdev->x_pixels_per_inch == 1200) {
- lputs(s, ESC_GS "1;45;156htmE");
- } else if (vdev->x_pixels_per_inch == 600) {
- lputs(s, ESC_GS "1;45;106htmE");
- } else {
- lputs(s, ESC_GS "1;45;71htmE");
- }
-
- if(pdev->MaskState != 1) {
- /* lputs(s, ESC_GS "1owE");*/
- pdev->MaskState = 1;
- }
-
- } else { /* ESC/Page-Color */
-
- if (pdev->MaskState != 1) {
-
- lputs(s, ESC_GS "3;184wfE" ESC_GS "5;184wfE");
- pdev->MaskState = 1;
- }
-
- if (id != gs_no_id && data_x == 0 && depth == 1) {
- char obuf[128];
- int i;
- uint width_bytes = (w + 7) >> 3;
- uint num_bytes = width_bytes * h;
- byte *buf;
-
- if (pdev -> id_cache[id & VCACHE] != id) {
-
- buf = gs_alloc_bytes(vdev->memory, num_bytes, "escv_fill_mask(buf)");
-
- /* cache entry */
- for (i = 0; i < h; ++i) {
- memcpy(buf + i * width_bytes, data + (data_x >> 3) + i * raster, width_bytes);
- }
-
- (void)sprintf(obuf, ESC_GS "%d;%d;%d;%d;0db{F", num_bytes, (int)(id & VCACHE), w, h);
- lputs(s, obuf);
- put_bytes(s, buf, num_bytes);
-
- gs_free_object(vdev->memory, buf, "escv_fill_mask(buf)");
- pdev -> id_cache[id & VCACHE] = id;
- }
-
- (void)sprintf(obuf, ESC_GS "%dX" ESC_GS "%dY", x, y);
- lputs(s, obuf);
- (void)sprintf(obuf, ESC_GS "%lddbF", id & VCACHE);
- lputs(s, obuf);
-
- return 0;
- }
- } /* ESC/Page-Color */
-
- escv_write_begin(dev, depth, (int)x, (int)y, w, h, w, h, 0);
- {
- int i;
- uint width_bytes = (w + 7) >> 3;
- uint num_bytes = width_bytes * h;
- byte *buf = gs_alloc_bytes(vdev->memory, num_bytes, "escv_fill_mask(buf)");
-
- for (i = 0; i < h; ++i) {
- memcpy(buf + i * width_bytes, data + (data_x >> 3) + i * raster, width_bytes);
- }
-
- escv_write_data(dev, depth, buf, num_bytes, w, h);
- escv_write_end(dev, depth);
- gs_free_object(vdev->memory, buf, "escv_fill_mask(buf)");
- }
-
- return 0;
-}
-
-/* ---------------- High-level images ---------------- */
-
-private image_enum_proc_plane_data(escv_image_plane_data);
-private image_enum_proc_end_image(escv_image_end_image);
-private const gx_image_enum_procs_t escv_image_enum_procs =
- {
- escv_image_plane_data, escv_image_end_image
- };
-
-
-/* Start processing an image. */
-private int
-escv_begin_image(gx_device * dev,
- const gs_imager_state * pis, const gs_image_t * pim,
- gs_image_format_t format, const gs_int_rect * prect,
- const gx_drawing_color * pdcolor, const gx_clip_path * pcpath,
- gs_memory_t * mem, gx_image_enum_common_t **pinfo)
-{
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- gx_device_escv *const pdev = (gx_device_escv *) dev;
- stream *s = gdev_vector_stream((gx_device_vector *) pdev);
- gdev_vector_image_enum_t *pie =
- gs_alloc_struct(mem, gdev_vector_image_enum_t, &st_vector_image_enum, "escv_begin_image");
- const gs_color_space *pcs = pim->ColorSpace;
- gs_color_space_index index;
- int num_components = 1;
- bool can_do = prect == 0 &&
- (pim->format == gs_image_format_chunky ||
- pim->format == gs_image_format_component_planar);
-
- gs_matrix imat;
- int code;
- int ty, bx, by, cx, cy, dx, dy, sx, sy;
-
- gx_color_index color = gx_dc_pure_color(pdcolor);
- char obuf[128];
-
- if (pie == 0) return_error(gs_error_VMerror);
- pie->memory = mem;
- code = gdev_vector_begin_image(vdev, pis, pim, format, prect,
- pdcolor, pcpath, mem, &escv_image_enum_procs, pie);
- if (code < 0) return code;
-
- *pinfo = (gx_image_enum_common_t *) pie;
-
- if (!pim->ImageMask) {
- index = gs_color_space_get_index(pcs);
- num_components = gs_color_space_num_components(pcs);
-
- if (pim->CombineWithColor) {
- can_do = false;
- } else {
- switch (index) {
- case gs_color_space_index_DeviceGray:
- if ((pim->Decode[0] != 0 || pim->Decode[1] != 1)
- && (pim->Decode[0] != 1 || pim->Decode[1] != 0))
- can_do = false;
- break;
- case gs_color_space_index_DeviceRGB:
- if (pim->Decode[0] != 0 || pim->Decode[1] != 1 ||
- pim->Decode[2] != 0 || pim->Decode[3] != 1 ||
- pim->Decode[4] != 0)
- can_do = false;
- break;
- default:
- can_do = false;
- }
- }
- }
- if (!can_do) {
- return gx_default_begin_image(dev, pis, pim, format, prect,
- pdcolor, pcpath, mem, &pie->default_info);
- }
-
- if (pim->ImageMask || (pim->BitsPerComponent == 1 && num_components == 1)) {
- if (pim->Decode[0] > pim->Decode[1]) {
- pdev->MaskReverse = 1;
- } else {
- if( 0 == pdev->colormode ) { /* ESC/Page (Monochrome) */
- } else { /* ESC/Page-Color */
- lputs(s, ESC_GS "8;1;2;2;2plr{E");
- put_bytes(s, "\000\000\000\000\377\377\377\377", 8);
- } /* ESC/Page-Color */
- pdev->MaskReverse = 0;
- }
- }
-
- /* Write the image/colorimage/imagemask preamble. */
- gs_matrix_invert(&pim->ImageMatrix, &imat);
- gs_matrix_multiply(&imat, &ctm_only(pis), &imat);
-
- ty = imat.ty;
- bx = imat.xx * pim->Width + imat.yx * pim->Height + imat.tx;
- by = imat.xy * pim->Width + imat.yy * pim->Height + imat.ty;
- cx = imat.yx * pim->Height + imat.tx;
- cy = imat.yy * pim->Height + imat.ty;
- dx = imat.xx * pim->Width + imat.tx;
- dy = imat.xy * pim->Width + imat.ty;
-
- sx = bx - (int)imat.tx;
- sy = by - (int)imat.ty;
-
- /* ¤È¤ê¤¢¤¨¤º³¨¤Î°ÌÃ֤˼ý¤Þ¤ë¤è¤¦¤Ë¶¯À©Åª¤ËºÂɸ¤òÊѹ¹¤¹¤ë¡£ */
- pdev -> roll = 0;
- pdev -> reverse_x = pdev -> reverse_y = 0;
- if (imat.tx > bx) {
- pdev -> reverse_x = 1;
- sx = -sx;
- imat.tx = bx;
- }
-
- if (imat.ty > by) {
- pdev -> reverse_y = 1;
- sy = -sy;
- imat.ty = by;
- }
-
- (void)memcpy(&pdev -> xmat, &imat, sizeof(gs_matrix));
- pdev -> sx = sx;
- pdev -> sy = sy;
- pdev -> h = pim->Height;
- pdev -> w = pim->Width;
- pdev -> dd = 0;
- pdev -> bx = 0;
- pdev -> by = 0;
-
- if (ty == cy) {
- /* ²óž»þ¤ÎÉÁ²è¤Ë¤Ä¤¤¤Æ¤Ï¸½ºß̤¼ÂÁõ¡£GS ¦¤Îµ¡Ç½¤ò»ÈÍѤ¹¤ë */
- return -1;
- }
-
- if (pim->ImageMask) {
- pdev->ncomp = 1;
-
- /* ÉÁ²èÏÀÍýÀßÄêÌ¿Îá - Æ©²á */
- if (pdev->MaskState != 1) {
-
- if( 0 == pdev->colormode ) { /* ESC/Page (Monochrome) */
-
- /* lputs(s, ESC_GS "1owE");*/
- (void)sprintf(obuf, ESC_GS "1;1;%ldccE", color);
- lputs(s, obuf);
-
- if (vdev->x_pixels_per_inch == 1200) {
- lputs(s, ESC_GS "1;45;156htmE");
- } else if (vdev->x_pixels_per_inch == 600) {
- lputs(s, ESC_GS "1;45;106htmE");
- } else {
- lputs(s, ESC_GS "1;45;71htmE");
- }
-
- } else { /* ESC/Page-Color */
-
- lputs(s, ESC_GS "3;184wfE" ESC_GS "5;184wfE");
- pdev->MaskState = 1;
-
- } /* ESC/Page-Color */
-
- }
-
- } else {
-
- /* ÉÁ²èÏÀÍýÀßÄêÌ¿Îá - ÇòÅɤê */
- if (pdev->MaskState != 0) {
-
- if( 0 == pdev->colormode ) { /* ESC/Page (Monochrome) */
- /* lputs(s, ESC_GS "1owE");*/ /* 184->204 */
- } else { /* ESC/Page-Color */
- lputs(s, ESC_GS "3;204wfE" ESC_GS "5;204wfE");
- } /* ESC/Page-Color */
-
- pdev->MaskState = 0;
- }
- pdev->ncomp = num_components;
- }
-
- if (pdev -> reverse_y) return 0;
-
- escv_write_begin(dev, pie->bits_per_pixel, (int)imat.tx, (int)imat.ty, pie->width, pie->height, sx, sy, pdev -> roll);
-
- return 0;
-}
-
-
-/* Process the next piece of an image. */
-private int
-#if GS_VERSION_MAJOR >= 6
-escv_image_plane_data(gx_image_enum_common_t *info, const gx_image_plane_t *planes, int height, int *rows_used)
-#else
- escv_image_plane_data(gx_device *dev, gx_image_enum_common_t *info, const gx_image_plane_t *planes, int height)
-#endif
-{
-#if GS_VERSION_MAJOR >= 6
- gx_device *dev = info->dev;
-#endif
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- gx_device_escv *const pdev = (gx_device_escv *) dev;
- gdev_vector_image_enum_t *pie = (gdev_vector_image_enum_t *) info;
-
- int y;
- int plane;
- int width_bytes, tbyte;
- byte *buf;
-
- if (pie->default_info) return gx_image_plane_data(pie->default_info, planes, height);
-
- gx_image_plane_data(pie->bbox_info, planes, height);
-
- {
-
-#if GS_VERSION_MAJOR >= 6
- if (height == 260)
- height = 1;
-#endif
- width_bytes = (pie->width * pie->bits_per_pixel / pdev->ncomp + 7) / 8 * pdev->ncomp;
- tbyte = width_bytes * height;
- buf = gs_alloc_bytes(vdev->memory, tbyte, "escv_image_data(buf)");
-
- if (pdev -> reverse_y) {
-
- if (pdev -> h == height) {
- if( 0 == pdev->colormode ) { /* ESC/Page (Monochrome) */
-
- if(tbyte == 1){
- if(strcmp(pdev->dname, "lp1800") != 0 &&
- strcmp(pdev->dname, "lp9600") != 0) {
- pdev->w += pdev->sx / 2048;
- height += pdev->sy / 2048;
- }
- }
-
- } else { /* ESC/Page-Color */
-
- if(tbyte == 1){
- pdev->w += pdev->sx / 2048;
- height += pdev->sy / 2048;
- }
-
- } /* ESC/Page-Color */
-
-
- escv_write_begin(dev, pie->bits_per_pixel, (int)pdev -> xmat.tx, (int)pdev -> xmat.ty, pdev -> w, height, (int)pdev -> sx, (int)pdev -> sy, pdev -> roll);
-
- } else {
- float yy, sy;
-
- yy = (pdev -> h * pdev->xmat.yy) - (pdev -> dd * pdev -> xmat.yy) - (height * pdev -> xmat.yy);
- if (yy == 0) {
- yy = (pdev -> h * pdev->xmat.yx) - (pdev -> dd * pdev -> xmat.yx) - (height * pdev -> xmat.yx);
- }
-
- if (pdev -> by) {
- sy = (int)pdev -> xmat.ty - (int)yy;
- sy = pdev -> by - (int)sy;
- } else {
- sy = height * pdev -> xmat.yy + 0.5;
- }
- if (sy < 0) {
- sy = -sy;
- }
-
- escv_write_begin(dev, pie->bits_per_pixel, (int)pdev -> xmat.tx, (int)pdev -> xmat.ty - (int)yy, pdev -> w, height, (int)pdev -> sx, (int)sy, pdev -> roll);
-
- pdev -> by = (int)pdev -> xmat.ty - (int)yy;
- }
- }
- pdev -> dd += height;
-
- for (plane = 0; plane < pie->num_planes; ++plane) {
-
- for (y = 0; y < height; ++y) {
-
- int bit, w;
- const byte *p;
- byte *d;
- byte c;
-
- p = planes[plane].data + ((planes[plane].data_x * pie->bits_per_pixel) >> 3) + y * planes[plane].raster;
- if (pdev -> reverse_y) {
-
- d = buf + (height - y) * width_bytes;
-
- if (!pdev -> reverse_x) {
- (void)memcpy(buf + (height - y - 1) * width_bytes,
- planes[plane].data + ((planes[plane].data_x * pie->bits_per_pixel) >> 3)
- + y * planes[plane].raster, width_bytes);
-
- }
-
- } else {
-
- d = buf + (y + 1) * width_bytes;
-
- if (!pdev -> reverse_x) {
-
- (void)memcpy(buf + y * width_bytes,
- planes[plane].data + ((planes[plane].data_x * pie->bits_per_pixel) >> 3)
- + y * planes[plane].raster, width_bytes);
-
- }
- }
- if (pdev -> reverse_x) {
- if (pie->bits_per_pixel == 1) {
- for (w = 0; w < width_bytes; w++) {
- c = 0;
- for (bit = 0; bit < 8; bit++) {
- if (*p & 1 << (7 - bit)) {
- c |= 1 << bit;
- }
- }
- p++;
- *--d = c;
- }
- } else if (pie->bits_per_pixel == 8){
- for (w = 0; w < width_bytes; w++) {
- *--d = *p++;
- }
- } else {
- for (w = 0; w < width_bytes / 3; w++) {
- *--d = *(p + 2);
- *--d = *(p + 1);
- *--d = *p;
- p += 3;
- }
- }
- }
- }
- }
-
- if(tbyte == 1){
- int t;
-
- if( 0 == pdev->colormode ) { /* ESC/Page (Monochrome) */
-
- gs_free_object(vdev->memory, buf, "escv_image_data(buf)");
- if(strcmp(pdev->dname, "lp1800") == 0 ||
- strcmp(pdev->dname, "lp9600") == 0) {
- if(pdev->sx > pdev->sy){
- height = pdev->sy;
- pdev->w = pdev->sx;
- tbyte = ((pdev->sx + 7) / 8) * pdev->sy;
- } else {
- if(pdev->sx < pdev->sy){
- height = pdev->sy;
- pdev->w = pdev->sx;
- tbyte = ((pdev->sx + 7) / 8) * pdev->sy;
- } else {
- tbyte = 1;
- }
- }
-
- } else {
- if(pdev->sx > pdev->sy){
- tbyte = 1;
- } else {
- if(pdev->sx < pdev->sy){
- tbyte = tbyte * height;
- } else {
- tbyte = 1;
- }
- }
- }
- buf = gs_alloc_bytes(vdev->memory, tbyte, "escv_image_data(buf)");
- for(t = 0; t < tbyte; t++){
- buf[t] = 0xff;
- }
-
- } else { /* ESC/Page-Color */
-
- gs_free_object(vdev->memory, buf, "escv_image_data(buf)");
- if(pdev->sx > pdev->sy){
- tbyte = 1;
- } else {
- if(pdev->sx < pdev->sy){
- tbyte = tbyte * height;
- } else {
- tbyte = 1;
- }
- }
-
- buf = gs_alloc_bytes(vdev->memory, tbyte, "escv_image_data(buf)");
- for(t = 0; t < tbyte; t++){
- buf[t] = 0x00;
- }
-
- } /* ESC/Page-Color */
-
- }
-
- escv_write_data(dev, pie->bits_per_pixel, buf, tbyte, pdev -> w, height);
-
- if (pdev -> reverse_y) {
- escv_write_end(dev, pie->bits_per_pixel);
- }
-
- gs_free_object(vdev->memory, buf, "escv_image_data(buf)");
- }
- return (pie->y += height) >= pie->height;
-}
-
-
-private int
-#if GS_VERSION_MAJOR >= 6
-escv_image_end_image(gx_image_enum_common_t * info, bool draw_last)
-#else
- escv_image_end_image(gx_device *dev, gx_image_enum_common_t * info, bool draw_last)
-#endif
-{
-#if GS_VERSION_MAJOR >= 6
- gx_device *dev = info->dev;
-#endif
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- gx_device_escv *const pdev = (gx_device_escv *) dev;
- gdev_vector_image_enum_t *pie = (gdev_vector_image_enum_t *) info;
- int code;
-
- if (!(pdev -> reverse_y)) {
- escv_write_end(dev, pie->bits_per_pixel);
- }
-
- pdev->reverse_x = pdev->reverse_y = 0;
- if (pdev->MaskReverse == 0) {
- if( 0 == pdev->colormode ) { /* ESC/Page (Monochrome) */
- ;
- } else { /* ESC/Page-Color */
-
- stream *s = gdev_vector_stream((gx_device_vector *)pdev);
-
- lputs(s, ESC_GS "8;1;2;2;2plr{E");
- put_bytes(s, "\377\377\377\377\000\000\000\000", 8);
- } /* ESC/Page-Color */
- }
- pdev->MaskReverse = -1;
-
- code = gdev_vector_end_image(vdev, (gdev_vector_image_enum_t *) pie, draw_last, pdev->white);
- return code;
-}
-
-
-private void escv_write_begin(gx_device *dev, int bits, int x, int y, int sw, int sh, int dw, int dh, int roll)
-{
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- gx_device_escv *const pdev = (gx_device_escv *)dev;
- stream *s = gdev_vector_stream((gx_device_vector *)dev);
- char obuf[128], *tmp, *p;
- int i, comp;
-
- if( 0 == pdev->colormode ) { /* ESC/Page (Monochrome) */
-
- (void)sprintf(obuf, ESC_GS "%dX" ESC_GS "%dY", x, y);
- lputs(s, obuf);
-
- comp = 10;
-
- if (bits == 1) {
- if (strcmp(pdev->dname, "lp1800") == 0 ||
- strcmp(pdev->dname, "lp9600") == 0) {
- (void)sprintf(obuf, ESC_GS "0bcI");
- }else{
- (void)sprintf(obuf, ESC_GS "5;%d;%d;%d;%d;%dsrI", sw, sh, dw, dh, roll);
- }
- } else if (bits == 4) {
- if (pdev -> c4map) {
- pdev -> c4map = FALSE;
- }
- (void)sprintf(obuf, ESC_GS "1;1;1;0;%d;%d;%d;%d;%d;%dscrI", comp, sw, sh, dw, dh, roll);
- } else if (bits == 8) {
- if (pdev -> c8map) {
- pdev -> c8map = FALSE;
- }
- (void)sprintf(obuf, ESC_GS "1;1;1;0;%d;%d;%d;%d;%d;%dscrI", comp, sw, sh, dw, dh, roll);
- } else {
- /* 24 bit */
- (void)sprintf(obuf, ESC_GS "1;1;1;0;%d;%d;%d;%d;%d;%dscrI", comp, sw, sh, dw, dh, roll);
- }
-
- } else { /* ESC/Page-Color */
-
- (void)sprintf(obuf, ESC_GS "%dX" ESC_GS "%dY", x, y);
- lputs(s, obuf);
-
- comp = 0;
-
- if (bits == 1) {
- (void)sprintf(obuf, ESC_GS "2;201;1;%d;%d;%d;%d;%d;%dscrI", comp, sw, sh, dw, dh, roll);
- } else if (bits == 4) {
- if (pdev -> c4map) {
- /* ¥«¥é¡¼¥Þ¥Ã¥×ÅÐÏ¿ */
- lputs(s, ESC_GS "64;2;2;16;16plr{E");
- p = tmp = gs_alloc_bytes(vdev->memory, 64, "escv_write_begin(tmp4)");
- for (i = 0; i < 16; i++) {
- *p++ = i << 4;
- *p++ = i << 4;
- *p++ = i << 4;
- *p++ = i << 4;
- }
- put_bytes(s, tmp, 64);
- gs_free_object(vdev->memory, tmp, "escv_write_begin(tmp4)");
- pdev -> c4map = FALSE;
- }
- (void)sprintf(obuf, ESC_GS "2;203;2;%d;%d;%d;%d;%d;%dscrI", comp, sw, sh, dw, dh, roll);
- } else if (bits == 8) {
- if (pdev -> c8map) {
- /* ¥«¥é¡¼¥Þ¥Ã¥×ÅÐÏ¿ */
- lputs(s, ESC_GS "1024;4;2;256;256plr{E");
- p = tmp = gs_alloc_bytes(vdev->memory, 1024, "escv_write_begin(tmp)");
- for (i = 0; i < 256; i++) {
- *p++ = i;
- *p++ = i;
- *p++ = i;
- *p++ = i;
- }
- put_bytes(s, tmp, 1024);
- gs_free_object(vdev->memory, tmp, "escv_write_begin(tmp)");
- pdev -> c8map = FALSE;
- }
- (void)sprintf(obuf, ESC_GS "2;204;4;%d;%d;%d;%d;%d;%dscrI", comp, sw, sh, dw, dh, roll);
- } else {
- /* 24 bit */
- (void)sprintf(obuf, ESC_GS "2;102;0;%d;%d;%d;%d;%d;%dscrI", comp, sw, sh, dw, dh, roll);
- }
-
- } /* ESC/Page-Color */
-
- lputs(s, obuf);
-
- return;
-}
-
-
-private void escv_write_data(gx_device *dev, int bits, char *buf, int bsize, int w, int ras)
-{
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- gx_device_escv *const pdev = (gx_device_escv *) dev;
- stream *s = gdev_vector_stream((gx_device_vector *)pdev);
- char obuf[128];
- int size;
- char *tmps, *p;
-
- if( 0 == pdev->colormode ) { /* ESC/Page (Monochrome) */
-
- tmps = 0;
-
- if (bits == 12) {
- p = tmps = gs_alloc_bytes(vdev->memory, bsize * 2, "escv_write_data(tmp)");
- for (size = 0; size < bsize; size++) {
- *p++ = buf[size] & 0xF0;
- *p++ = buf[size] << 4;
- }
- bsize = bsize * 2;
- buf = tmps;
- }
-
- if(bits == 4) {
- p = tmps = gs_alloc_bytes(vdev->memory, bsize * 2, "escv_write_data(tmp)");
- for (size = 0; size < bsize; size++) {
- *p++ = ((buf[size] & 0xF0) * 0xFF / 0xF0);
- *p++ = ((buf[size] << 4 & 0xF0) * 0xFF / 0xF0);
- }
- bsize = bsize * 2;
- buf = tmps;
- }
-
-
- if(bits == 1){
- if (strcmp(pdev->dname, "lp1800") == 0 || \
- strcmp(pdev->dname, "lp9600") == 0) {
- (void)sprintf(obuf, ESC_GS "%d;1;%d;%d;0db{I", bsize, w, ras);
- }else{
- (void)sprintf(obuf, ESC_GS "%d;%du{I", bsize, ras);
- }
- }else{
- (void)sprintf(obuf, ESC_GS "%d;%dcu{I", bsize, ras);
- }
- lputs(s, obuf);
-
- put_bytes(s, buf, bsize);
-
- if (bits == 12 || bits == 4) {
- gs_free_object(vdev->memory, tmps, "escv_write_data(tmp)");
- }
-
- } else { /* ESC/Page-Color */
-
- char tmp;
-
- tmps = 0;
- if (bits == 12) {
- p = tmps = gs_alloc_bytes(vdev->memory, bsize * 2, "escv_write_data(tmp)");
- for (size = 0; size < bsize; size++) {
- tmp = buf[size] & 0xF0;
- *p++ = (tmp + (tmp >> 4 & 0x0F));
- tmp = buf[size] << 4;
- *p++ = (tmp + (tmp >> 4 & 0x0F));
- }
- bsize = bsize * 2;
- buf = tmps;
- }
-
- (void)sprintf(obuf, ESC_GS "%d;%dcu{I", bsize, ras);
- lputs(s, obuf);
- put_bytes(s, buf, bsize);
-
- if (bits == 12) {
- gs_free_object(vdev->memory, tmps, "escv_write_data(tmp)");
- }
- } /* ESC/Page-Color */
-
- return;
-}
-
-
-private void escv_write_end(gx_device *dev, int bits)
-{
- gx_device_escv *const pdev = (gx_device_escv *) dev;
- stream *s = gdev_vector_stream((gx_device_vector *)pdev);
-
- if( 0 == pdev->colormode ) { /* ESC/Page (Monochrome) */
-
- if(bits == 1){
- if (strcmp(pdev->dname, "lp1800") == 0 || \
- strcmp(pdev->dname, "lp9600") == 0) {
- lputs(s, ESC_GS "1dbI");
- } else {
- lputs(s, ESC_GS "erI");
- }
- }else{
- lputs(s, ESC_GS "ecrI");
- }
-
- } else { /* ESC/Page-Color */
-
- lputs(s, ESC_GS "ecrI");
-
- } /* ESC/Page-Color */
-
- return;
-}
-
-/* end of file */
diff --git a/gs/contrib/eplaser/gdevescv.h b/gs/contrib/eplaser/gdevescv.h
deleted file mode 100644
index 482a65fe4..000000000
--- a/gs/contrib/eplaser/gdevescv.h
+++ /dev/null
@@ -1,186 +0,0 @@
-/* Copyright (C) EPSON SOFTWARE DEVELOPMENT LABORATORY, INC. 1999,2000.
- Copyright (C) SEIKO EPSON CORPORATION 2000-2006.
-
- Ghostscript printer driver for EPSON ESC/Page and ESC/Page-Color.
-
- This software 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 GNU General Public License for full details.
-
- Everyone is granted permission to copy, modify and redistribute
- this software, but only under the conditions described in the GNU
- General Public License. A copy of this license is supposed to have been
- given to you along with this software 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.
- */
-
-#ifndef gdevescv_INCLUDED
-#define gdevescv_INCLUDED
-
-#ifndef TRUE
-# define TRUE 1
-#endif
-
-#ifndef FALSE
-# define FALSE 0
-#endif
-
-#define GS (0x1d)
-#define ESC_GS "\035"
-#define ESC_FF "\014"
-#define ESC_CR "\015"
-#define ESC_LF "\012"
-#define ESC_BS "\010"
-
-#define POINT 72
-#define MMETER_PER_INCH 25.4
-
-#define ESCPAGE_DEFAULT_WIDTH (4840)
-#define ESCPAGE_DEFAULT_HEIGHT (6896)
-
-#define ESCPAGE_LEFT_MARGIN_DEFAULT 5. / (MMETER_PER_INCH / POINT)
-#define ESCPAGE_BOTTOM_MARGIN_DEFAULT 5. / (MMETER_PER_INCH / POINT)
-#define ESCPAGE_RIGHT_MARGIN_DEFAULT 5. / (MMETER_PER_INCH / POINT)
-#define ESCPAGE_TOP_MARGIN_DEFAULT 5. / (MMETER_PER_INCH / POINT)
-
-#define NUM_OF_PAPER_TABLES 23
-#define MAX_PAPER_SIZE_DELTA 5
-
-#define ESCPAGE_OPTION_MANUALFEED "ManualFeed"
-#define ESCPAGE_OPTION_CASSETFEED "Casset"
-#define ESCPAGE_OPTION_FACEUP "FaceUp"
-#define ESCPAGE_OPTION_DUPLEX "Duplex"
-#define ESCPAGE_OPTION_DUPLEX_TUMBLE "Tumble"
-#define ESCPAGE_OPTION_MEDIATYPE "MediaType"
-#define ESCPAGE_OPTION_RIT "RITOff"
-#define ESCPAGE_OPTION_LANDSCAPE "Landscape"
-#define ESCPAGE_OPTION_TONERDENSITY "TonerDensity"
-#define ESCPAGE_OPTION_TONERSAVING "TonerSaving"
-#define ESCPAGE_OPTION_COLLATE "Collate"
-#define ESCPAGE_OPTION_JOBID "JobID"
-#define ESCPAGE_OPTION_USERNAME "UserName"
-#define ESCPAGE_OPTION_DOCUMENT "Document"
-#define ESCPAGE_OPTION_HOSTNAME "HostName"
-#define ESCPAGE_OPTION_COMMENT "eplComment"
-
-#define ESCPAGE_JOBID_MAX 255
-#define ESCPAGE_USERNAME_MAX 255
-#define ESCPAGE_HOSTNAME_MAX 255
-#define ESCPAGE_DOCUMENT_MAX 255
-#define ESCPAGE_MODELNAME_MAX 255
-#define ESCPAGE_COMMENT_MAX 255
-
-#define ESCPAGE_TUMBLE_DEFAULT FALSE /* Long age */
-#define ESCPAGE_RIT_DEFAULT FALSE
-#define ESCPAGE_FACEUP_DEFAULT FALSE
-#define ESCPAGE_FACEUP_DEFAULT FALSE
-
-#define ESCPAGE_MEDIATYPE_DEFAULT 0 /* NORMAL */
-#define ESCPAGE_MEDIACHAR_MAX 32
-
-#define ESCPAGE_MANUALFEED_DEFAULT FALSE
-#define ESCPAGE_CASSETFEED_DEFAULT 0
-
-#define ESCPAGE_DPI_MIN 60
-#define ESCPAGE_DPI_MAX 1200
-
-#define ESCPAGE_HEIGHT_MAX ( 1369 + MAX_PAPER_SIZE_DELTA ) /* A3PLUS */
-#define ESCPAGE_WIDTH_MAX ( 933 + MAX_PAPER_SIZE_DELTA ) /* A3PLUS */
-#define ESCPAGE_HEIGHT_MIN ( 420 - MAX_PAPER_SIZE_DELTA ) /* POSTCARD */
-#define ESCPAGE_WIDTH_MIN ( 279 - MAX_PAPER_SIZE_DELTA ) /* MON */
-
-#define RES1200 1200
-#define RES600 600
-#define JPN TRUE
-#define ENG FALSE
-
-#define X_DPI 600
-#define Y_DPI 600
-#define VCACHE 0x3FF
-
-/* ---------------- Device definition ---------------- */
-
-typedef struct gx_device_escv_s {
- gx_device_vector_common;
-
- int colormode; /* 0=ESC/Page(Monochrome), 1=ESC/Page-Color */
- bool manualFeed; /* Use manual feed */
- int cassetFeed; /* Input Casset */
- bool RITOff; /* RIT Control */
- bool Collate;
- int toner_density;
- bool toner_saving;
- int prev_paper_size;
- int prev_paper_width;
- int prev_paper_height;
- int prev_num_copies;
- int prev_feed_mode;
- int orientation;
- bool faceup;
- int MediaType;
- bool first_page;
- bool Duplex;
- bool Tumble;
- int ncomp;
- int MaskReverse;
- int MaskState;
- bool c4map; /* 4bit ColorMap */
- bool c8map; /* 8bit ColorMap */
- int prev_x;
- int prev_y;
- gx_color_index prev_color;
- gx_color_index current_color;
- floatp lwidth;
- long cap;
- long join;
- long reverse_x;
- long reverse_y;
- gs_matrix xmat; /* matrix */
- int bx;
- int by;
- int w; /* width */
- int h; /* height */
- int roll;
- float sx; /* scale x */
- float sy; /* scale y */
- long dd;
- int ispath;
- gx_bitmap_id id_cache[VCACHE + 1]; /* for Font Downloading */
- char JobID[ESCPAGE_JOBID_MAX + 1];
- char UserName[ESCPAGE_USERNAME_MAX + 1];
- char HostName[ESCPAGE_HOSTNAME_MAX + 1];
- char Document[ESCPAGE_DOCUMENT_MAX + 1];
- char Comment[ESCPAGE_COMMENT_MAX + 1];
- gs_param_string gpsJobID;
- gs_param_string gpsUserName;
- gs_param_string gpsHostName;
- gs_param_string gpsDocument;
- gs_param_string gpsComment;
-} gx_device_escv;
-
-typedef struct EPaperTable_s{
- int width; /* paper width (unit: point) */
- int height; /* paper height (unit: point) */
- int escpage; /* number of papersize in ESC/PAGE */
- const char *name; /* Paper Name */
-} EPaperTable;
-
-typedef struct paper_candidate_s {
- const EPaperTable *paper;
- int absw; /* absolute delta width */
- int absh; /* absolute delta height */
- int score; /* select priority score */
- bool isfillw; /* inside printable area width? */
- bool isfillh; /* inside printable area height? */
- bool isminw; /* best fit width? */
- bool isminh; /* best fit height? */
-} paper_candidate;
-
-
-#endif /* gdevescv_INCLUDED */
-
-/* end of file */
diff --git a/gs/contrib/epson740/README b/gs/contrib/epson740/README
deleted file mode 100644
index ec78c7f4e..000000000
--- a/gs/contrib/epson740/README
+++ /dev/null
@@ -1,25 +0,0 @@
-Really short instructions...
-(I hope to do better one of these days)
-
-Changes:
- 7/11/99 DEP An update!! Separated the RH5.2 stuff, and added
- the new RH6.0 stuff. Also, the beginnings of a
- description of how to write a Uniprint file. In
- desparation, I've also removed the color trans-
- lations from the 360*360 upp file. It seems to
- do a better job than I did.
-
-These locations are for RedHat 5.2 with Ghostscript 5.10 added,
-or RH 6.0, which comes with 5.10. I've had a report of someone
-adding Ghostscript 5.5 and using this stuff successfully.
-
-The *.upp files go into /usr/share/ghostscript/5.10
-The other two files go into /usr/lib/rhs/rhs-printfilters
-(I'd suggest saving the original files, first)
-
-I've made several virtual printers, all connected to the same
-physical printer. The RedHat printtool did this just fine.
-
-Dale Pontius
-DEPontius@usa.net
-edgehp@together.net
diff --git a/gs/contrib/epson740/printerdb_rh5.2 b/gs/contrib/epson740/printerdb_rh5.2
deleted file mode 100644
index c245f6cb5..000000000
--- a/gs/contrib/epson740/printerdb_rh5.2
+++ /dev/null
@@ -1,1173 +0,0 @@
-#
-# Printer database for printtool
-#
-#
-# FORMAT:
-#
-# Lines starting with a '#' are considered comments
-#
-# A printer description is formated as (case-sensitive throughout)
-#
-# StartEntry: PrinterEntryName
-# GSDriver: gsdrivername
-# Description: {This should be a one-line description in braces}
-# About: {
-# This is a longer description, giving details for the \
-# user about specific features of this printer entry \
-# It can be many lines long, and a continuation character \
-# is needed in that case. A brace closes the string. \
-# Whitespace and newlines are removed when read in. \
-# The description will be stroed as one long string. \
-# }
-# Resolution: {XDPI} {YDPI} {Optional text comment}
-# Resolution: {XDPI} {YDPI} {Optional text comment}
-# Resolution: {XPDI} {YDPI} {Just keep adding these}
-# Resolution: {XPDI} {YDPI} {No checking if added twice}
-# BitsPerPixel: {BitsPerPixel} {Optional comment}
-# BitsPerPixel: {BitsPerPixel} {Can have arbitrary number}
-#
-# Possibly allow other gs params to be input like BitsPerPixel is in future
-#
-# EndEntry:
-#
-
-#
-# Some printer types are commented out because by default ghostscript
-# is not built with support for those printers. If you compile
-# ghostscript with support, uncomment the entry in this file so
-# that it will appear as an option in printtool.
-#
-# Printtool should filter this list for only those available through
-# the currently installed ghostscript
-#
-
-#
-# Changes:
-#
-# Wed Mar 12 - Added DeskJet500Mono entry - it is a B&W only driver (djet500)
-#
-
-
-
-#
-# Newer HP deskjets
-#
-# gdevcdj.c
-#
-# For newer HP deskjet printers, the old names
-# cdeskjet, cdjcolor, and cdjmono
-# have been replaced by the following printers.
-#
-# to get the same behavior now, use
-# gs -sDEVICE=cdj500 -dBitsPerPixel=24 ... for cdjcolor, and
-# gs -sDEVICE=cdj500 -dBitsPerPixel=1 ... for cdjmono
-#
-# so use the -dBitsPerPixel= to set color/mono options
-# also can set BlackCorrect, Shingling, and Depletion for best output
-# described in drivers.doc with gs-3.33
-# Also have PrintQuality and RenderType for xpaintjet XL300/XL too...
-#
-# Resolution: 300x300 except declj250 is 180x180, canon bjc-600 is 360x360
-# laserjet 4 dithered is 600x600.
-#
-# Color Support: 1, 3, 8, 16, 24, and 32( last is dj550c only)
-# see the devices.doc for descriptions of what these do!
-#
-
-StartEntry: DeskJet500Mono
- GSDriver: djet500
- Description: {HP DeskJet 500}
- About: { \
- This driver supports the HP DeskJet 500 inkjet printer. \
- It does does not support color printing. \
- Ghostscript supports several optional parameters for \
- this driver: see the document 'devices.doc' \
- in the ghostscript directory under /usr/doc. \
- }
- Resolution: {300} {300} {}
- BitsPerPixel: {1} {Normal B&W printing}
- BitsPerPixel: {8} {Floyd-Steinberg B&W printing for better greys}
-EndEntry
-
-StartEntry: DeskJet500
- GSDriver: cdj500
- Description: {HP DeskJet 400/500C/520/540C}
- About: { \
- This driver supports the HP inkjet printers which have \
- color capability with an optional color cartridge. \
- If your DeskJet can use EITHER a B&W cartridge or \
- a color cartridge, but not both simultaneously, \
- this driver may work for you. \
- Ghostscript supports several optional parameters for \
- this driver: see the document 'devices.doc' \
- in the ghostscript directory under /usr/doc. \
- }
- Resolution: {300} {300} {}
- BitsPerPixel: {1} {Normal B&W printing}
- BitsPerPixel: {3} {Normal color printing with color cartridge}
- BitsPerPixel: {8} {Floyd-Steinberg B&W printing for better greys}
- BitsPerPixel: {24} {Floyd-Steinberg Color printing (best, but slow)}
-EndEntry
-
-StartEntry: DeskJet550
- GSDriver: cdj550
- Description: {HP DeskJet 550C/560C/6xxC series}
- About: { \
- This driver supports the HP inkjet printers which have \
- color capability using both black and color cartridges \
- simultaneously. Known to work with the 682C and the 694C. \
- Other 600 and 800 series printers may work \
- if they have this feature. \
- If your printer seems to be saturating the paper with ink, \
- try added an extra GS option of '-dDepletion=2'. \
- Ghostscript supports several optional parameters for \
- this driver: see the document 'devices.doc' \
- in the ghostscript directory under /usr/doc. \
- }
- Resolution: {300} {300} {}
- BitsPerPixel: {1} {Normal B&W printing}
- BitsPerPixel: {3} {Normal color printing with color cartridge}
- BitsPerPixel: {8} {Floyd-Steinberg B&W printing for better greys}
- BitsPerPixel: {24} {Floyd-Steinberg Color printing (best, but slow)}
- BitsPerPixel: {32} {Sometimes provides better output than 24}
-EndEntry
-
-StartEntry: PaintJet
- GSDriver: pj
- Description: {HP PaintJet}
- About: { \
- Driver for the HP PaintJet printer. More information \
- on this driver is available in the file 'devices.doc' \
- in the ghostscript directory under /usr/doc. \
- }
- Resolution: {300} {300} {}
- BitsPerPixel: {1} {Normal B&W printing}
- BitsPerPixel: {3} {Normal color printing with color cartridge}
- BitsPerPixel: {8} {Floyd-Steinberg B&W printing for better greys}
- BitsPerPixel: {24} {Floyd-Steinberg Color printing (best, but slow)}
-EndEntry
-
-StartEntry: PaintJetXL
- GSDriver: pjxl
- Description: {HP PaintJet XL}
- About: { \
- Driver for the HP PaintJet XL printer. More information \
- on this driver is available in the file 'devices.doc' \
- in the ghostscript directory under /usr/doc. \
- }
- Resolution: {300} {300} {}
- BitsPerPixel: {1} {Normal B&W printing}
- BitsPerPixel: {3} {Normal color printing with color cartridge}
- BitsPerPixel: {8} {Floyd-Steinberg B&W printing for better greys}
- BitsPerPixel: {24} {Floyd-Steinberg Color printing (best, but slow)}
-EndEntry
-
-StartEntry: PaintJetXL300
- GSDriver: pjxl300
- Description: {HP PaintJet XL300 and DeskJet 1200C}
- About: { \
- Driver for the HP PaintJet XL300 and DeskJet 1200C printers.\
- More information \
- on this driver is available in the file 'devices.doc' \
- in the ghostscript directory under /usr/doc. \
- }
- Resolution: {300} {300} {}
- BitsPerPixel: {1} {Normal B&W printing}
- BitsPerPixel: {3} {Normal color printing with color cartridge}
- BitsPerPixel: {8} {Floyd-Steinberg B&W printing for better greys}
- BitsPerPixel: {24} {Floyd-Steinberg Color printing (best, but slow)}
-EndEntry
-
-StartEntry: DECLJ250
- GSDriver: declj250
- Description: {DEC LJ250}
- About: { \
- Driver for the DEC LJ250 printer.\
- More information \
- on this driver is available in the file 'devices.doc' \
- in the ghostscript directory under /usr/doc. \
- }
- Resolution: {180} {180} {}
- BitsPerPixel: {1} {Normal B&W printing}
- BitsPerPixel: {3} {Normal color printing with color cartridge}
- BitsPerPixel: {8} {Floyd-Steinberg B&W printing for better greys}
- BitsPerPixel: {24} {Floyd-Steinberg Color printing (best, but slow)}
-EndEntry
-
-StartEntry: HPDesignJet650C
- GSDriver: dnj650c
- Description: {HP DesignJet 650C}
- About: { \
- Driver for the HP DesignJet 650C printer.\
- More information \
- on this driver is available in the file 'devices.doc' \
- in the ghostscript directory under /usr/doc. \
- }
- Resolution: {300} {300} {}
- BitsPerPixel: {1} {Normal B&W printing}
- BitsPerPixel: {3} {Normal color printing with color cartridge}
- BitsPerPixel: {8} {Floyd-Steinberg B&W printing for better greys}
- BitsPerPixel: {24} {Floyd-Steinberg Color printing (best, but slow)}
-EndEntry
-
-StartEntry: LaserJet4dither
- GSDriver: lj4dith
- Description: {HP LaserJet 4 - dithered}
- About: { \
- Driver for the HP LaserJet 4 printer.\
- This driver does Floyd-Steinberg dithering for better \
- greys. \
- }
- Resolution: {600} {600} {}
-EndEntry
-
-#
-# Not sure how to get color to work on this printer yet...
-#
-
-StartEntry: BJC600
- GSDriver: bjc600
- Description: {Canon BJC-600 and BJC-4000}
- About: { \
- Driver for the Canon BJC-600 and BJC-4000 printers.\
- Should work for later 600 and 4000 series printers, but this \
- is untested. \
- }
- Resolution: {360} {360} {}
- BitsPerPixel: {1} {Normal B&W printing}
- BitsPerPixel: {3} {Normal color printing with color cartridge}
- BitsPerPixel: {8} {Floyd-Steinberg B&W printing for better greys}
- BitsPerPixel: {24} {Floyd-Steinberg Color printing (best, but slow)}
-EndEntry
-
-#
-# PCL printers are in
-#
-# gdevdjet.c
-#
-# Supports older deskjets (500, PLUS, and prior) and LaserJets too.
-# LaserJet
-# LaserJet Plus
-# LaserJet 2p
-# LaserJet 3
-# DeskJet
-# DeskJet 500
-# LaserJet 4
-# LaserJet 3D
-#
-# Resoltion: 75, 100, 150, 300 or 600 (LJ4 only) dpi
-#
-StartEntry: DeskJet
- GSDriver: deskjet
- Description: {HP DeskJet/DeskJet Plus}
- About: { \
- Driver for the HP DeskJet and DeskJet Plus. \
- For the 500, 600, and 800 series DeskJets,\
- consider looking at the alternative drivers available \
- for the 500 series before using this one. This driver for \
- an older model. \
- }
- Resolution: {300} {300} {}
-EndEntry
-
-StartEntry: LaserJet
- GSDriver: laserjet
- Description: {HP LaserJet}
- About: { \
- Driver for the HP LaserJet. \
- }
- Resolution: {300} {300} {}
-EndEntry
-
-StartEntry: LaserJetPlus
- GSDriver: laserjetplus
- Description: {HP LaserJet Plus}
- About: { \
- Driver for the HP LaserJet Plus. \
- }
- Resolution: {300} {300} {}
-EndEntry
-
-StartEntry: LaserJet2p
- GSDriver: ljet2p
- Description: {HP LaserJet IId/IIp/III* with TIFF compression}
- About: { \
- Driver for the HP LaserJet II series printers. \
- }
- Resolution: {300} {300} {}
-EndEntry
-
-StartEntry: LaserJet3
- GSDriver: ljet3
- Description: {HP LaserJet III* with Delta Row Compression}
- About: { \
- Driver for the HP LaserJet III printer.\
- This driver features Delta Row Compression. \
- There is another LaserJet III driver available, \
- so if this one does not work properly, try the other. \
- }
- Resolution: {300} {300} {}
-EndEntry
-
-StartEntry: LaserJet3d
- GSDriver: ljet3d
- Description: {HP LaserJet III* with duplex capability}
- About: { \
- Driver for the HP LaserJet IIId printer.\
- This driver features duplex capability. \
- There is another LaserJet III driver available, \
- so if this one does not work properly, try the other. \
- }
- Resolution: {300} {300} {}
-EndEntry
-
-StartEntry: LaserJet4
- GSDriver: ljet4
- Description: {HP LaserJet 4/5/6 series}
- About: { \
- Driver for the HP LaserJet 4 printer.\
- It also may support the LaserJet 5 or 6 printer as well. \
- For these you may need to upgrade to ghostscript 4.03 \
- to get the correct margins. \
- There is another LaserJet 4 driver available \
- which may provide better greyscale output. \
- Early LaserJet 4 models can only do 300x300 resolution. \
- }
- Resolution: {300} {300} {}
- Resolution: {600} {600} {}
-EndEntry
-
-#
-# Epson Stylus Color
-#
-# gdevstc.c
-#
-# Supports BitsPerPixel, SpotSize, and OutputCode params
-#
-# Resolutions: 180x90, 180x180, 180x360, 180x720
-# 360x90, 360x180, 360x360, 360x720
-# 720x90, 720x180, 720x360, 720x720
-# Default is 360x360
-#
-# NOTE : In devices.doc, it is recommended to avoid SpotSize and 720x720
-# due to buggy behavior as of 3.33?
-#
-# See devices.doc, special care needed for certain resolutions.
-# SpotSize and OutputCode are important too for best output.
-#
-
-stcolor
- "Epson Epson Stylus-Color"
-
-StartEntry: EpsonStylusColor
- GSDriver: stcolor
- Description: {Epson Stylus Color}
- About: { \
- Driver for the Epson Stylus Color printer.\
- This driver supports many parameters to control \
- the style and quality of output. The defaults \
- used here will produce reasonable output, but \
- for information on customizing these settings \
- see the document 'devices.doc' \
- in the ghostscript directory under /usr/doc. \
- \n \n NOTE: This driver requires ghostscript 3.53 or \
- later. Red Hat can only ship ghostscript 3.33. \
- }
-#
-# many of the below are commented out as I've been unable to test them
-# uncomment and try at your own risk. Let me know (msf@redhat.com) if
-# they work!
-#
- Resolution: {180} {180} {}
-# Resolution: {180} {360} {}
- Resolution: {360} {360} {}
-# Resolution: {360} {720} {}
-# Resolution: {720} {360} {}
-# Resolution: {720} {720} {Requires special paper}
-# BitsPerPixel: {1} {Normal B&W printing}
-# BitsPerPixel: {4} {Normal Color printing}
-# BitsPerPixel: {8} {Floyd-Steinberg B&W printing}
-# BitsPerPixel: {24} {Floyd-Steinberg Color printer}
-EndEntry
-
-
-#
-# Epson Stylus Color Uni
-#
-# gdevupd.c
-#
-# This is a cheesy hack of the printerdb to allow choosing
-# the uniprint driver and a proper stc800*.upp for ghostscript
-# via the red hat printtool control panel.
-# Selecting a resolution in the printtool control panel
-# will select the proper stc800*.upp file.
-# ps-to-printer.fpi must be hacked also. An
-# if-then clause must be added to ps-to-printer.fpi which senses
-# the uniprint driver assigned to $GSDEVICE and selects the proper
-# stc800*.upp based on the value assigned to $RESOLUTION
-# in /var/spool/lpd/stc800-spool-directory/postscript.cfg.
-# Like I said, cheesy. But it works, and works well.
-#
-
-uniprint
- "Epson Stylus Color Uni"
-
-StartEntry: EpsonStylusColorUni
- GSDriver: uniprint
- Description: {Epson Stylus Color Uni}
- About: { \
- Uniprint driver used with \
- Epson Stylus Color 600/800. \
- Uses stc?00*.upp for configurating ghostscript. \
- Must be used with a hacked ps-to-printer.fpi file.\
- \
- }
- Resolution: {360} {360} {Plain Paper Standard-res}
- Resolution: {720} {720} {Plain Paper High-res}
- Resolution: {1440} {720} {Special Paper SuperHigh-res}
-# if BitsPerPixel worked it could be used to select the model, eh?
-EndEntry
-
-
-#
-# Epson "ESC/P 2" driver
-#
-# gdevescp.c
-#
-# Resolutions: 180x180, 180x360, 360x180, 360x360
-#
-#
-
-StartEntry: EpsonStylus800
- GSDriver: st800
- Description: {Epson Stylus 800 & ESC/P 2 printers}
- About: { \
- Driver for the Epson Stylus 800. \
- This driver may work with printers supporting \
- the ESC/P 2 specification.\
- }
- Resolution: {180} {180} {}
- Resolution: {180} {360} {}
- Resolution: {360} {180} {}
- Resolution: {360} {360} {}
-EndEntry
-
-StartEntry: EpsonAP3250
- GSDriver: ap3250
- Description: {Epson AP3250 & ESC/P 2 printers}
- About: { \
- Driver for the Epson AP3250.\
- This driver may work with printers supporting \
- the ESC/P 2 specification.\
- }
- Resolution: {180} {180} {}
- Resolution: {180} {360} {}
- Resolution: {360} {180} {}
- Resolution: {360} {360} {}
-EndEntry
-
-
-#
-# IBM 3853 JetPrinter (color)
-#
-# gdev3852.c
-#
-# Resolution: 84x84
-#
-# Uses 3 bit color?
-#
-StartEntry: IBMJetPrinter3853
- GSDriver: jetp3852
- Description: {IBM 3853 JetPrinter}
- About: { \
- Driver for the IBM 3853 JetPrinter.\
- }
- Resolution: {84} {84} {}
-EndEntry
-
-
-#
-# Ricoh 4081 laser printer
-#
-# gdev4081.c
-#
-# Resolution: 300x300
-#
-# Colors: 1 bit
-#
-StartEntry: Ricoh4081
- GSDriver: r4081
- Description: {Ricoh 4081 laser printer}
- About: { \
- Driver for the Ricoh 4081 laser printer.\
- }
- Resolution: {300} {300} {}
-EndEntry
-
-
-#
-# Tektronix 4693d color plotter
-#
-# gdev4693.c
-#
-# Resolution: 100x100
-#
-# Color: 2, 4, 8 bits per R/B/G component
-#
-StartEntry: Tek4693d2
- GSDriver: t4693d2
- Description: {Tek 4693d color printer, 2 bit mode}
- About: { \
- Driver for the Tektronix 4693d color printer, using \
- 2 bits per R/G/B component. \
- }
- Resolution: {100} {100} {}
-EndEntry
-
-StartEntry: Tek4693d4
- GSDriver: t4693d4
- Description: {Tek 4693d color printer, 4 bit mode}
- About: { \
- Driver for the Tektronix 4693d color printer, using \
- 4 bits per R/G/B component. \
- }
- Resolution: {100} {100} {}
-EndEntry
-
-StartEntry: Tek4693d8
- GSDriver: t4693d8
- Description: {Tek 4693d color printer, 8 bit mode}
- About: { \
- Driver for the Tektronix 4693d color printer, using \
- 8 bits per R/G/B component. \
- }
- Resolution: {100} {100} {}
-EndEntry
-
-
-
-#
-# C.Itoh M8510 printer
-#
-# gdev8510.c
-#
-# Resolution: 160x144
-#
-# Color: 1 bit
-#
-
-StartEntry: CItohM8510
- GSDriver: m8510
- Description: {C.Itoh M8510}
- About: { \
- Driver for the C.Itoh M8510 printer.\
- }
- Resolution: {100} {100} {}
-EndEntry
-
-#
-# Apple Imagewriters
-#
-# gdevadmp.c
-#
-# Resolution:
-# appledmp 120x72
-# iwlo 160x72
-# iwhi 160x144
-# iwlq 320x216
-#
-# Color: 1
-#
-
-StartEntry: AppleDMP
- GSDriver: appledmp
- Description: {Apple Dot Matrix}
- About: { \
- Driver for the Apple Dot Matrix printers, including \
- the ImageWriter. There are several other ImageWriter \
- drivers available which you may want to consider. \
- }
- Resolution: {120} {72} {}
-EndEntry
-
-StartEntry: ImageWriterLO
- GSDriver: iwlo
- Description: {Apple Imagewriter, low-resolution}
- About: { \
- Driver for the Apple ImageWriter. \
- This driver supports the low-resolution setting of \
- 120x72 dpi. \
- There are several other ImageWriter \
- drivers available which you may want to consider. \
- }
- Resolution: {120} {72} {}
-EndEntry
-
-StartEntry: ImageWriterHI
- GSDriver: iwhi
- Description: {Apple Imagewriter, high-resolution}
- About: { \
- Driver for the Apple ImageWriter. \
- This driver supports the high-resolution setting of \
- 120x144 dpi. \
- There are several other ImageWriter \
- drivers available which you may want to consider. \
- }
- Resolution: {120} {144} {}
-EndEntry
-
-StartEntry: ImageWriterLQ
- GSDriver: iwlq
- Description: {Apple Imagewriter, letter quality}
- About: { \
- Driver for the Apple ImageWriter. \
- This driver supports the letter quality setting of \
- 320x216 dpi. \
- There are several other ImageWriter \
- drivers available which you may want to consider. \
- }
- Resolution: {320} {216} {}
-EndEntry
-
-#
-# Canon BJ-10e and BJ200
-#
-# gdevbj10.c
-#
-#
-# Resolution: 360x360, 180x180, 180x360, 360x180
-#
-# Color: 1 bit
-#
-
-StartEntry: CanonBJ10e
- GSDriver: bj10e
- Description: {Canon BJ-10e}
- About: { \
- Driver for the Canon BJ-10e. \
- }
- Resolution: {180} {180} {}
- Resolution: {360} {180} {}
- Resolution: {180} {360} {}
- Resolution: {360} {360} {}
-EndEntry
-
-StartEntry: CanonBJ200
- GSDriver: bj200
- Description: {Canon BJ-100/200/210/240}
- About: { \
- Driver for the Canon BJ-200/210/240 printers. \
- Reportedly also works for the BJ-100 as well. \
- Does NOT support color on the 210 or 240 printers. \
- }
- Resolution: {180} {180} {}
- Resolution: {360} {180} {}
- Resolution: {180} {360} {}
- Resolution: {360} {360} {}
-EndEntry
-
-#
-# Mitsubishi CP50 color printer
-#
-# gdevcp50.c
-#
-# Resolution: 154x187
-#
-# Color: 24 bit
-#
-#
-
-StartEntry: MitCP50
- GSDriver: cp50
- Description: {Mitsubishi CP50}
- About: { \
- Driver for the Mitsubishi CP50 color printer. \
- }
- Resolution: {154} {187} {}
-EndEntry
-
-
-#
-# Epson LQ-2550 and Fujitsu 3400/2400/1200 color printers
-#
-# gdevepsc.c
-#
-# Resolution: Several multiples of 60 and 72, depending on # of pins (9,24)
-#
-# Color: 3 bit ?
-#
-#
-
-StartEntry: EpsonLQ9
- GSDriver: epsonc
- Description: {Epson Color Dot Matrix, 9 pin}
- About: { \
- This driver supports Epson and some Epson compatible \
- color dot-matrix printers. The \
- Epson LQ-2550 and Fujitsu 3400/2400/1200 color printers\
- are among those supported. \
- \n\n This driver is for 9 pin printers.\
- \n\n NOTE: A given printer will support a Y resolution of \
- 60 and 180, or 72 and 216, but not both! If your output \
- appears distorted, try the alternate Y resolution setting. \
- The two printer types are marked by Type A or Type B in \
- the list of printer resolution settings. \
- }
- Resolution: {60} {60} {Type A}
- Resolution: {120} {60} {Type A}
- Resolution: {240} {60} {Type A}
- Resolution: {60} {72} {Type B}
- Resolution: {120} {72} {Type B}
- Resolution: {240} {72} {Type B}
-EndEntry
-
-StartEntry: EpsonLQ24
- GSDriver: epsonc
- Description: {Epson Color Dot Matrix, 24 pin}
- About: { \
- This driver supports Epson and some Epson compatible \
- color dot-matrix printers. The \
- Epson LQ-2550 and Fujitsu 3400/2400/1200 color printers \
- are among those supported. \
- \n\n This driver is for 24 pin printers.\
- \n\n NOTE: A given printer will support a Y resolution of \
- 60 and 180, or 72 and 216, but not both! If your output \
- appears distorted, try the alternate Y resolution setting. \
- The two printer types are marked by Type A or Type B in \
- the list of printer resolution settings.\
- }
- Resolution: {60} {60} {Type A}
- Resolution: {60} {180} {Type A}
- Resolution: {120} {60} {Type A}
- Resolution: {120} {180} {Type A}
- Resolution: {180} {60} {Type A}
- Resolution: {180} {180} {Type A}
- Resolution: {240} {60} {Type A}
- Resolution: {240} {180} {Type A}
- Resolution: {60} {72} {Type B}
- Resolution: {60} {216} {Type B}
- Resolution: {120} {72} {Type B}
- Resolution: {120} {216} {Type B}
- Resolution: {180} {72} {Type B}
- Resolution: {180} {216} {Type B}
- Resolution: {240} {72} {Type B}
- Resolution: {240} {216} {Type B}
-EndEntry
-
-
-# Epson (and similar) dot-matrix printer driver for Ghostscript.
-#
-# gdevepsn.c
-#
-# Resolutions: (depends on driver I think too)
-# 9 pin: XDPI - 60, 120, 240, YDPI either 60 or 72
-# 24 pin: XDPI - 60, 120, 180, 240, 360, YPID either 60,180 or 72,216
-#
-# Color: 1 bit
-#
-
-StartEntry: IBMPro
- GSDriver: ibmpro
- Description: {IBM Proprinter, 9 pin}
- About: { \
- This driver supports Epson and some Epson compatible \
- dot-matrix printers. \
- \n\n This driver is for 9 pin printers.\
- \n\n NOTE: A given printer will support a Y resolution of \
- 60 and 180, or 72 and 216, but not both! If your output \
- appears distorted, try the alternate Y resolution setting. \
- The two printer types are marked by Type A or Type B in \
- the list of printer resolution settings. \
- }
- Resolution: {60} {72} {}
- Resolution: {120} {72} {}
- Resolution: {240} {72} {}
-EndEntry
-
-StartEntry: Epson9
- GSDriver: epson
- Description: {Epson Dot Matrix, 9 pin}
- About: { \
- This driver supports Epson and some Epson compatible \
- dot-matrix printers. \
- \n\n This driver is for 9 pin printers.\
- \n\n NOTE: A given printer will support a Y resolution of \
- 60 and 180, or 72 and 216, but not both! If your output \
- appears distorted, try the alternate Y resolution setting. \
- The two printer types are marked by Type A or Type B in \
- the list of printer resolution settings. \
- }
- Resolution: {60} {60} {Type A}
- Resolution: {120} {60} {Type A}
- Resolution: {240} {60} {Type A}
- Resolution: {60} {72} {Type B}
- Resolution: {120} {72} {Type B}
- Resolution: {240} {72} {Type B}
-EndEntry
-
-StartEntry: Epson24
- GSDriver: epson
- Description: {Epson Dot Matrix, 24 pin}
- About: { \
- This driver supports Epson and some Epson compatible \
- dot-matrix printers. \
- \n\n This driver is for 24 pin printers.\
- \n\n NOTE: A given printer will support a Y resolution of \
- 60 and 180, or 72 and 216, but not both! If your output \
- appears distorted, try the alternate Y resolution setting. \
- The two printer types are marked by Type A or Type B in \
- the list of printer resolution settings.\
- }
- Resolution: {60} {60} {Type A}
- Resolution: {60} {180} {Type A}
- Resolution: {120} {60} {Type A}
- Resolution: {120} {180} {Type A}
- Resolution: {180} {60} {Type A}
- Resolution: {180} {180} {Type A}
- Resolution: {240} {60} {Type A}
- Resolution: {240} {180} {Type A}
- Resolution: {360} {60} {Type A}
- Resolution: {360} {180} {Type A}
- Resolution: {60} {72} {Type B}
- Resolution: {60} {216} {Type B}
- Resolution: {120} {72} {Type B}
- Resolution: {120} {216} {Type B}
- Resolution: {180} {72} {Type B}
- Resolution: {180} {216} {Type B}
- Resolution: {240} {72} {Type B}
- Resolution: {240} {216} {Type B}
- Resolution: {360} {72} {Type A}
- Resolution: {360} {216} {Type A}
-EndEntry
-
-StartEntry: Epson9MedRes
- GSDriver: eps9mid
- Description: {Epson Dot Matrix, 9 pin, med-res}
- About: { \
- This driver supports Epson and some Epson compatible \
- dot-matrix printers. This driver implements an \
- intermediate resolution by making multiple passes. \
- It has better, but slower, output than the standard Epson\
- 9 pin driver. \
- \n\n This driver is for 9 pin printers.\
- \n\n NOTE: A given printer will support a Y resolution of \
- 180 or 216, but not both! If your output \
- appears distorted, try the alternate Y resolution setting. \
- The two printer types are marked by Type A or Type B in \
- the list of printer resolution settings. \
- }
- Resolution: {60} {180} {Type A}
- Resolution: {120} {180} {Type A}
- Resolution: {240} {180} {Type A}
- Resolution: {60} {216} {Type B}
- Resolution: {120} {216} {Type B}
- Resolution: {240} {216} {Type B}
-EndEntry
-
-StartEntry: Epson9HiRes
- GSDriver: eps9high
- Description: {Epson Dot Matrix, 9 pin, hi-res}
- About: { \
- This driver supports Epson and some Epson compatible \
- dot-matrix printers. This driver implements an \
- intermediate resolution by making multiple passes. \
- It has better, but slower, output than the standard \
- or the intermediate resolution \
- Epson 9 pin driver. \
- \n\n This driver is for 9 pin printers.\
- \n\n NOTE: A given printer will support a Y resolution of \
- 180 or 216, but not both! If your output \
- appears distorted, try the alternate Y resolution setting. \
- The two printer types are marked by Type A or Type B in \
- the list of printer resolution settings. \
- }
- Resolution: {60} {180} {Type A}
- Resolution: {120} {180} {Type A}
- Resolution: {240} {180} {Type A}
- Resolution: {60} {216} {Type B}
- Resolution: {120} {216} {Type B}
- Resolution: {240} {216} {Type B}
-EndEntry
-
-
-#
-# Imagen ImPress printers
-#
-# gdevimgn.c
-#
-#
-# Resolution: 75, 150, 300
-#
-# Color: 1 bit
-#
-
-StartEntry: Imagen
- GSDriver: imagen
- Description: {Imagen ImPress}
- About: { \
- Driver for the Imagen ImPress.\
- }
- Resolution: {75} {75} {}
- Resolution: {150} {150} {}
- Resolution: {300} {300} {}
-EndEntry
-
-#
-# Canon LBP-*II and LIPS III printer
-#
-# gdevlbp8.c
-#
-# Resolution: 300x300
-#
-# Color: 1 bit
-#
-
-StartEntry: CanonLBP8
- GSDriver: lpb8
- Description: {Canon LBP-8II}
- About: { \
- Driver for the Canon LBP-8II laser printer.\
- }
- Resolution: {300} {300} {}
-EndEntry
-
-StartEntry: CanonLIPS
- GSDriver: lips3
- Description: {Canon LIPS III}
- About: { \
- Driver for the Canon LIPS III laser printer \
- in English mode.\
- }
- Resolution: {300} {300} {}
-EndEntry
-
-#
-# DEC LN03 (sixel printers)
-#
-# gdevln03.c
-#
-# Resolution:
-# ln03 300x300
-# la50 144x72
-# la70 144x144
-# la75 144x72
-# la75plus 180x180
-#
-# Color: 1 bit
-#
-
-StartEntry: DECLN03
- GSDriver: ln03
- Description: {DEC LN03}
- About: { \
- Driver for the DEC LN03 laser printer. \
- }
- Resolution: {300} {300} {}
-EndEntry
-
-StartEntry: DECLA50
- GSDriver: la50
- Description: {DEC LA50 dot matrix}
- About: { \
- Driver for the DEC LA50 dot matrix printer. \
- }
- Resolution: {144} {72} {}
-EndEntry
-
-StartEntry: DECLA70
- GSDriver: la70
- Description: {DEC LA70 dot matrix}
- About: { \
- Driver for the DEC LA70 dot matrix printer. \
- }
- Resolution: {144} {144} {}
-EndEntry
-
-StartEntry: DECLA75
- GSDriver: la75
- Description: {DEC LA75 dot matrix}
- About: { \
- Driver for the DEC LA75 dot matrix printer. \
- }
- Resolution: {144} {72} {}
-EndEntry
-
-StartEntry: DECLA75P
- GSDriver: la75plus
- Description: {DEC LA75 Plus dot matrix}
- About: { \
- Driver for the DEC LA75 Plus dot matrix printer. \
- }
- Resolution: {180} {180} {}
-EndEntry
-
-
-#
-# NEC P6 printers
-#
-# gdevnp6.c
-#
-# Resolution: 360x360
-#
-# Color: 1 bit
-#
-
-StartEntry: NECP6
- GSDriver: necp6
- Description: {NEC P6/P6+/P60}
- About: { \
- Driver for the NEC P6/P6+/P60 printers. \
- }
- Resolution: {360} {360} {}
-EndEntry
-
-#
-# Okidata Microline 182
-#
-# gdevo182.c
-#
-# Resolution: 72x72 144x144
-#
-# Color: 1 bit
-#
-
-StartEntry: OKI182
- GSDriver: oki182
- Description: {Okidata Microline 182}
- About: { \
- Driver for the Okidata Microline 182 printer. \
- }
- Resolution: {72} {72} {}
- Resolution: {144} {144} {}
-EndEntry
-
-#
-# HP PaintJet drivers (older alternative?)
-#
-# gdevpjet.c
-#
-# Resolution: 90x90 or 180x180
-#
-# Color: 3 bits
-
-StartEntry: DECLJ250
- GSDriver: lj250
- Description: {DEC LJ250}
- About: { \
- Driver for the DEC LJ250 Companion color printer. \
- }
- Resolution: {90} {90} {}
- Resolution: {180} {180} {}
-EndEntry
-
-#paintjet
-# "(alternative) HP PaintJet color printer"
-
-#pjetxl
-# "(alternative) HP PaintJet XL"
-
-#
-# StarJet SJ48
-#
-# gdevsj48.c
-#
-# Resolution: (180,360)x(180,360)
-#
-# Color: 1 bit
-#
-
-StartEntry: StarJet48
- GSDriver: sj48
- Description: {StarJet 48}
- About: { \
- Driver for the StarJet 48 printer. \
- }
- Resolution: {180} {180} {}
- Resolution: {360} {180} {}
- Resolution: {180} {360} {}
- Resolution: {360} {360} {}
-EndEntry
-
-#
-# Tektronix Ink-jet plotter
-#
-# gdevtknk.c
-#
-# Resolution: 120x120
-#
-# Color: 4 bits
-#
-
-StartEntry: Tek4696
- GSDriver: tek4696
- Description: {Tektronics 4695/4696 inkjet plotter}
- About: { \
- Driver for the Tektronix 4695/4696 inkjet plotter. \
- }
- Resolution: {120} {120} {}
-EndEntry
-
-
-#
-# Xerox XES
-#
-# gdevxes.c
-#
-# Resolution: 300x300
-#
-# Color: 1 bit
-#
-
-StartEntry: XeroxXES
- GSDriver: xes
- Description: {Xerox XES printers}
- About: { \
- Driver for the Xerox XES printers (2700, 3700, 4045, etc).\
- }
- Resolution: {300} {300} {}
-EndEntry
-
-#
-# postscript
-#
-# This is for a real postscript printer - no ghostscript involved
-#
-# resolutions are there so user can specify, no way to tell what their
-# printer can really do
-#
-# same for color, no way to know
-#
-StartEntry: PostScript
- GSDriver: POSTSCRIPT
- Description: {PostScript printer}
- About: { \
- Driver for the PostScript printers.\
- Does not use ghostscript. \
- Use if your printer has a PostScript interpreter built-in. \
- Choose the resolution which corresponds to your printer from \
- these list. \
- }
- Resolution: {300} {300} {}
- Resolution: {600} {600} {}
- Resolution: {1200} {1200} {}
-EndEntry
-
-
-
-#
-# text
-#
-# This is for a real text printer - no ghostscript involved
-#
-# use this if you DO NOT want postscript printed at all
-#
-StartEntry: TextPrinter
- GSDriver: TEXT
- Description: {Text-only printer}
- About: { \
- Driver for the text-only printers.\
- Does not use ghostscript. \
- Outputs ASCII text straight to the printer. \
- }
- Resolution: {NA} {NA} {}
-EndEntry
diff --git a/gs/contrib/epson740/printerdb_rh6.0 b/gs/contrib/epson740/printerdb_rh6.0
deleted file mode 100644
index dc0426f20..000000000
--- a/gs/contrib/epson740/printerdb_rh6.0
+++ /dev/null
@@ -1,1166 +0,0 @@
-#
-# Printer database for printtool
-#
-#
-# FORMAT:
-#
-# Lines starting with a '#' are considered comments
-#
-# A printer description is formated as (case-sensitive throughout)
-#
-# StartEntry and Description must be unique to each other.
-# Change in code may allow Description to be same but
-# currently this is required.
-#
-# StartEntry: PrinterEntryName
-# GSDriver: gsdrivername
-# Description: {This should be a one-line description in braces}
-# About: {
-# This is a longer description, giving details for the \
-# user about specific features of this printer entry \
-# It can be many lines long, and a continuation character \
-# is needed in that case. A brace closes the string. \
-# Whitespace and newlines are removed when read in. \
-# The description will be stroed as one long string. \
-# }
-# Resolution: {XDPI} {YDPI} {Optional text comment}
-# Resolution: {XDPI} {YDPI} {Optional text comment}
-# Resolution: {XPDI} {YDPI} {Just keep adding these}
-# Resolution: {XPDI} {YDPI} {No checking if added twice}
-# BitsPerPixel: {BitsPerPixel} {Optional comment}
-# BitsPerPixel: {BitsPerPixel} {Can have arbitrary number}
-# or, (for unipriner drivers)
-# BitsPerPixel: {upp_file} {Comment copied from upp file}
-#
-# Possibly allow other gs params to be input like BitsPerPixel is in future
-#
-# EndEntry:
-#
-
-#
-# Some printer types are commented out because by default ghostscript
-# is not built with support for those printers. If you compile
-# ghostscript with support, uncomment the entry in this file so
-# that it will appear as an option in printtool.
-#
-# Printtool should filter this list for only those available through
-# the currently installed ghostscript
-#
-
-#
-# Changes:
-#
-# Wed Mar 12 - Added DeskJet500Mono entry - it is a B&W only driver (djet500)
-#
-
-
-
-#
-# Newer HP deskjets
-#
-# gdevcdj.c
-#
-# For newer HP deskjet printers, the old names
-# cdeskjet, cdjcolor, and cdjmono
-# have been replaced by the following printers.
-#
-# to get the same behavior now, use
-# gs -sDEVICE=cdj500 -dBitsPerPixel=24 ... for cdjcolor, and
-# gs -sDEVICE=cdj500 -dBitsPerPixel=1 ... for cdjmono
-#
-# so use the -dBitsPerPixel= to set color/mono options
-# also can set BlackCorrect, Shingling, and Depletion for best output
-# described in drivers.doc with gs-3.33
-# Also have PrintQuality and RenderType for xpaintjet XL300/XL too...
-#
-# Resolution: 300x300 except declj250 is 180x180, canon bjc-600 is 360x360
-# laserjet 4 dithered is 600x600.
-#
-# Color Support: 1, 3, 8, 16, 24, and 32( last is dj550c only)
-# see the devices.doc for descriptions of what these do!
-#
-
-StartEntry: DeskJet500Mono
- GSDriver: djet500
- Description: {HP DeskJet 500}
- About: { \
- This driver supports the HP DeskJet 500 inkjet printer. \
- It does does not support color printing. \
- Ghostscript supports several optional parameters for \
- this driver: see the document 'devices.doc' \
- in the ghostscript directory under /usr/doc. \
- }
- Resolution: {300} {300} {}
-EndEntry
-
-StartEntry: DeskJet500
- GSDriver: cdj500
- Description: {HP DeskJet 400/500C/520/540C}
- About: { \
- This driver supports the HP inkjet printers which have \
- color capability with an optional color cartridge. \
- If your DeskJet can use EITHER a B&W cartridge or \
- a color cartridge, but not both simultaneously, \
- this driver may work for you. \
- Ghostscript supports several optional parameters for \
- this driver: see the document 'devices.doc' \
- in the ghostscript directory under /usr/doc. \
- }
- Resolution: {300} {300} {}
- BitsPerPixel: {3} {Normal color printing with color cartridge}
- BitsPerPixel: {8} {Floyd-Steinberg B&W printing for better greys}
- BitsPerPixel: {24} {Floyd-Steinberg Color printing (best, but slow)}
-EndEntry
-
-StartEntry: DeskJet550
- GSDriver: cdj550
- Description: {HP DeskJet 550C/560C/6xxC series}
- About: { \
- This driver supports the HP inkjet printers which have \
- color capability using both black and color cartridges \
- simultaneously. Known to work with the 682C and the 694C. \
- Other 600 and 800 series printers may work \
- if they have this feature. \
- If your printer seems to be saturating the paper with ink, \
- try added an extra GS option of '-dDepletion=2'. \
- Ghostscript supports several optional parameters for \
- this driver: see the document 'devices.doc' \
- in the ghostscript directory under /usr/doc. \
- }
- Resolution: {300} {300} {}
- BitsPerPixel: {3} {Normal color printing with color cartridge}
- BitsPerPixel: {8} {Floyd-Steinberg B&W printing for better greys}
- BitsPerPixel: {24} {Floyd-Steinberg Color printing (best, but slow)}
- BitsPerPixel: {32} {Sometimes provides better output than 24}
-EndEntry
-
-StartEntry: PaintJet
- GSDriver: pj
- Description: {HP PaintJet}
- About: { \
- Driver for the HP PaintJet printer. More information \
- on this driver is available in the file 'devices.doc' \
- in the ghostscript directory under /usr/doc. \
- }
- Resolution: {300} {300} {}
- BitsPerPixel: {3} {Normal color printing with color cartridge}
- BitsPerPixel: {8} {Floyd-Steinberg B&W printing for better greys}
- BitsPerPixel: {24} {Floyd-Steinberg Color printing (best, but slow)}
-EndEntry
-
-StartEntry: PaintJetXL
- GSDriver: pjxl
- Description: {HP PaintJet XL}
- About: { \
- Driver for the HP PaintJet XL printer. More information \
- on this driver is available in the file 'devices.doc' \
- in the ghostscript directory under /usr/doc. \
- }
- Resolution: {300} {300} {}
- BitsPerPixel: {3} {Normal color printing with color cartridge}
- BitsPerPixel: {8} {Floyd-Steinberg B&W printing for better greys}
- BitsPerPixel: {24} {Floyd-Steinberg Color printing (best, but slow)}
-EndEntry
-
-StartEntry: PaintJetXL300
- GSDriver: pjxl300
- Description: {HP PaintJet XL300 and DeskJet 1200C}
- About: { \
- Driver for the HP PaintJet XL300 and DeskJet 1200C printers.\
- More information \
- on this driver is available in the file 'devices.doc' \
- in the ghostscript directory under /usr/doc. \
- }
- Resolution: {300} {300} {}
- BitsPerPixel: {3} {Normal color printing with color cartridge}
- BitsPerPixel: {8} {Floyd-Steinberg B&W printing for better greys}
- BitsPerPixel: {24} {Floyd-Steinberg Color printing (best, but slow)}
-EndEntry
-
-StartEntry: DECLJ250
- GSDriver: declj250
- Description: {DEC LJ250 (Alt)}
- About: { \
- Driver for the DEC LJ250 printer(Alternate).\
- More information \
- on this driver is available in the file 'devices.doc' \
- in the ghostscript directory under /usr/doc. \
- }
- Resolution: {180} {180} {}
- BitsPerPixel: {3} {Normal color printing with color cartridge}
- BitsPerPixel: {8} {Floyd-Steinberg B&W printing for better greys}
- BitsPerPixel: {24} {Floyd-Steinberg Color printing (best, but slow)}
-EndEntry
-
-StartEntry: HPDesignJet650C
- GSDriver: dnj650c
- Description: {HP DesignJet 650C}
- About: { \
- Driver for the HP DesignJet 650C printer.\
- More information \
- on this driver is available in the file 'devices.doc' \
- in the ghostscript directory under /usr/doc. \
- }
- Resolution: {300} {300} {}
- BitsPerPixel: {3} {Normal color printing with color cartridge}
- BitsPerPixel: {8} {Floyd-Steinberg B&W printing for better greys}
- BitsPerPixel: {24} {Floyd-Steinberg Color printing (best, but slow)}
-EndEntry
-
-StartEntry: LaserJet4dither
- GSDriver: lj4dith
- Description: {HP LaserJet 4 - dithered}
- About: { \
- Driver for the HP LaserJet 4 printer.\
- This driver does Floyd-Steinberg dithering for better \
- greys. \
- }
- Resolution: {600} {600} {}
-EndEntry
-
-#
-# Not sure how to get color to work on this printer yet...
-#
-
-StartEntry: BJC600
- GSDriver: bjc600
- Description: {Canon BJC-600 and BJC-4000}
- About: { \
- Driver for the Canon BJC-600 and BJC-4000 printers.\
- Should work for later 600 and 4000 series printers, but this \
- is untested. \
- }
- Resolution: {360} {360} {}
- BitsPerPixel: {8} {Floyd-Steinberg B&W printing for better greys}
- BitsPerPixel: {24} {Floyd-Steinberg Color printing (best, but slow)}
-EndEntry
-
-#
-# PCL printers are in
-#
-# gdevdjet.c
-#
-# Supports older deskjets (500, PLUS, and prior) and LaserJets too.
-# LaserJet
-# LaserJet Plus
-# LaserJet 2p
-# LaserJet 3
-# DeskJet
-# DeskJet 500
-# LaserJet 4
-# LaserJet 3D
-#
-# Resoltion: 75, 100, 150, 300 or 600 (LJ4 only) dpi
-#
-StartEntry: DeskJet
- GSDriver: deskjet
- Description: {HP DeskJet/DeskJet Plus}
- About: { \
- Driver for the HP DeskJet and DeskJet Plus. \
- For the 500, 600, and 800 series DeskJets,\
- consider looking at the alternative drivers available \
- for the 500 series before using this one. This driver for \
- an older model. \
- }
- Resolution: {300} {300} {}
-EndEntry
-
-StartEntry: LaserJet
- GSDriver: laserjet
- Description: {HP LaserJet}
- About: { \
- Driver for the HP LaserJet. \
- }
- Resolution: {300} {300} {}
-EndEntry
-
-StartEntry: LaserJetPlus
- GSDriver: laserjetplus
- Description: {HP LaserJet Plus}
- About: { \
- Driver for the HP LaserJet Plus. \
- }
- Resolution: {300} {300} {}
-EndEntry
-
-StartEntry: LaserJet2p
- GSDriver: ljet2p
- Description: {HP LaserJet IId/IIp/III* with TIFF compression}
- About: { \
- Driver for the HP LaserJet II series printers. \
- }
- Resolution: {300} {300} {}
-EndEntry
-
-StartEntry: LaserJet3
- GSDriver: ljet3
- Description: {HP LaserJet III* with Delta Row Compression}
- About: { \
- Driver for the HP LaserJet III printer.\
- This driver features Delta Row Compression. \
- There is another LaserJet III driver available, \
- so if this one does not work properly, try the other. \
- }
- Resolution: {300} {300} {}
-EndEntry
-
-StartEntry: LaserJet3d
- GSDriver: ljet3d
- Description: {HP LaserJet III* with duplex capability}
- About: { \
- Driver for the HP LaserJet IIId printer.\
- This driver features duplex capability. \
- There is another LaserJet III driver available, \
- so if this one does not work properly, try the other. \
- }
- Resolution: {300} {300} {}
-EndEntry
-
-StartEntry: LaserJet4
- GSDriver: ljet4
- Description: {HP LaserJet 4/5/6 series}
- About: { \
- Driver for the HP LaserJet 4 printer.\
- It also may support the LaserJet 5 or 6 printer as well. \
- Early LaserJet 4 models can only do 300x300 resolution. \
- }
- Resolution: {300} {300} {}
- Resolution: {600} {600} {}
-EndEntry
-
-
-#
-# Epson "ESC/P 2" driver
-#
-# gdevescp.c
-#
-# Resolutions: 180x180, 180x360, 360x180, 360x360
-#
-#
-
-StartEntry: EpsonStylus800
- GSDriver: st800
- Description: {Epson Stylus 800 & ESC/P 2 printers}
- About: { \
- Driver for the Epson Stylus 800. \
- This driver may work with printers supporting \
- the ESC/P 2 specification.\
- }
- Resolution: {180} {180} {}
- Resolution: {180} {360} {}
- Resolution: {360} {180} {}
- Resolution: {360} {360} {}
-EndEntry
-
-StartEntry: EpsonAP3250
- GSDriver: ap3250
- Description: {Epson AP3250 & ESC/P 2 printers}
- About: { \
- Driver for the Epson AP3250.\
- This driver may work with printers supporting \
- the ESC/P 2 specification.\
- }
- Resolution: {180} {180} {}
- Resolution: {180} {360} {}
- Resolution: {360} {180} {}
- Resolution: {360} {360} {}
-EndEntry
-
-
-#
-# IBM 3853 JetPrinter (color)
-#
-# gdev3852.c
-#
-# Resolution: 84x84
-#
-# Uses 3 bit color?
-#
-StartEntry: IBMJetPrinter3853
- GSDriver: jetp3852
- Description: {IBM 3853 JetPrinter}
- About: { \
- Driver for the IBM 3853 JetPrinter.\
- }
- Resolution: {84} {84} {}
-EndEntry
-
-
-#
-# Ricoh 4081 laser printer
-#
-# gdev4081.c
-#
-# Resolution: 300x300
-#
-# Colors: 1 bit
-#
-StartEntry: Ricoh4081
- GSDriver: r4081
- Description: {Ricoh 4081 laser printer}
- About: { \
- Driver for the Ricoh 4081 laser printer.\
- }
- Resolution: {300} {300} {}
-EndEntry
-
-
-#
-# Tektronix 4693d color plotter
-#
-# gdev4693.c
-#
-# Resolution: 100x100
-#
-# Color: 2, 4, 8 bits per R/B/G component
-#
-StartEntry: Tek4693d2
- GSDriver: t4693d2
- Description: {Tek 4693d color printer, 2 bit mode}
- About: { \
- Driver for the Tektronix 4693d color printer, using \
- 2 bits per R/G/B component. \
- }
- Resolution: {100} {100} {}
-EndEntry
-
-StartEntry: Tek4693d4
- GSDriver: t4693d4
- Description: {Tek 4693d color printer, 4 bit mode}
- About: { \
- Driver for the Tektronix 4693d color printer, using \
- 4 bits per R/G/B component. \
- }
- Resolution: {100} {100} {}
-EndEntry
-
-StartEntry: Tek4693d8
- GSDriver: t4693d8
- Description: {Tek 4693d color printer, 8 bit mode}
- About: { \
- Driver for the Tektronix 4693d color printer, using \
- 8 bits per R/G/B component. \
- }
- Resolution: {100} {100} {}
-EndEntry
-
-
-
-#
-# C.Itoh M8510 printer
-#
-# gdev8510.c
-#
-# Resolution: 160x144
-#
-# Color: 1 bit
-#
-
-StartEntry: CItohM8510
- GSDriver: m8510
- Description: {C.Itoh M8510}
- About: { \
- Driver for the C.Itoh M8510 printer.\
- }
- Resolution: {100} {100} {}
-EndEntry
-
-#
-# Apple Imagewriters
-#
-# gdevadmp.c
-#
-# Resolution:
-# appledmp 120x72
-# iwlo 160x72
-# iwhi 160x144
-# iwlq 320x216
-#
-# Color: 1
-#
-
-StartEntry: AppleDMP
- GSDriver: appledmp
- Description: {Apple Dot Matrix}
- About: { \
- Driver for the Apple Dot Matrix printers, including \
- the ImageWriter. There are several other ImageWriter \
- drivers available which you may want to consider. \
- }
- Resolution: {120} {72} {}
-EndEntry
-
-StartEntry: ImageWriterLO
- GSDriver: iwlo
- Description: {Apple Imagewriter, low-resolution}
- About: { \
- Driver for the Apple ImageWriter. \
- This driver supports the low-resolution setting of \
- 120x72 dpi. \
- There are several other ImageWriter \
- drivers available which you may want to consider. \
- }
- Resolution: {120} {72} {}
-EndEntry
-
-StartEntry: ImageWriterHI
- GSDriver: iwhi
- Description: {Apple Imagewriter, high-resolution}
- About: { \
- Driver for the Apple ImageWriter. \
- This driver supports the high-resolution setting of \
- 120x144 dpi. \
- There are several other ImageWriter \
- drivers available which you may want to consider. \
- }
- Resolution: {120} {144} {}
-EndEntry
-
-StartEntry: ImageWriterLQ
- GSDriver: iwlq
- Description: {Apple Imagewriter, letter quality}
- About: { \
- Driver for the Apple ImageWriter. \
- This driver supports the letter quality setting of \
- 320x216 dpi. \
- There are several other ImageWriter \
- drivers available which you may want to consider. \
- }
- Resolution: {320} {216} {}
-EndEntry
-
-#
-# Canon BJ-10e and BJ200
-#
-# gdevbj10.c
-#
-#
-# Resolution: 360x360, 180x180, 180x360, 360x180
-#
-# Color: 1 bit
-#
-
-StartEntry: CanonBJ10e
- GSDriver: bj10e
- Description: {Canon BJ-10e}
- About: { \
- Driver for the Canon BJ-10e. \
- }
- Resolution: {180} {180} {}
- Resolution: {360} {180} {}
- Resolution: {180} {360} {}
- Resolution: {360} {360} {}
-EndEntry
-
-StartEntry: CanonBJ200
- GSDriver: bj200
- Description: {Canon BJ-100/200/210/240}
- About: { \
- Driver for the Canon BJ-200/210/240 printers. \
- Reportedly also works for the BJ-100 as well. \
- Does NOT support color on the 210 or 240 printers. \
- }
- Resolution: {180} {180} {}
- Resolution: {360} {180} {}
- Resolution: {180} {360} {}
- Resolution: {360} {360} {}
-EndEntry
-
-#
-# Mitsubishi CP50 color printer
-#
-# gdevcp50.c
-#
-# Resolution: 154x187
-#
-# Color: 24 bit
-#
-#
-
-StartEntry: MitCP50
- GSDriver: cp50
- Description: {Mitsubishi CP50}
- About: { \
- Driver for the Mitsubishi CP50 color printer. \
- }
- Resolution: {154} {187} {}
-EndEntry
-
-
-#
-# Epson LQ-2550 and Fujitsu 3400/2400/1200 color printers
-#
-# gdevepsc.c
-#
-# Resolution: Several multiples of 60 and 72, depending on # of pins (9,24)
-#
-# Color: 3 bit ?
-#
-#
-
-StartEntry: EpsonLQ9
- GSDriver: epsonc
- Description: {Epson Color Dot Matrix, 9 pin}
- About: { \
- This driver supports Epson and some Epson compatible \
- color dot-matrix printers. The \
- Epson LQ-2550 and Fujitsu 3400/2400/1200 color printers\
- are among those supported. \
- \n\n This driver is for 9 pin printers.\
- \n\n NOTE: A given printer will support a Y resolution of \
- 60 and 180, or 72 and 216, but not both! If your output \
- appears distorted, try the alternate Y resolution setting. \
- The two printer types are marked by Type A or Type B in \
- the list of printer resolution settings. \
- }
- Resolution: {60} {60} {Type A}
- Resolution: {120} {60} {Type A}
- Resolution: {240} {60} {Type A}
- Resolution: {60} {72} {Type B}
- Resolution: {120} {72} {Type B}
- Resolution: {240} {72} {Type B}
-EndEntry
-
-StartEntry: EpsonLQ24
- GSDriver: epsonc
- Description: {Epson Color Dot Matrix, 24 pin}
- About: { \
- This driver supports Epson and some Epson compatible \
- color dot-matrix printers. The \
- Epson LQ-2550 and Fujitsu 3400/2400/1200 color printers \
- are among those supported. \
- \n\n This driver is for 24 pin printers.\
- \n\n NOTE: A given printer will support a Y resolution of \
- 60 and 180, or 72 and 216, but not both! If your output \
- appears distorted, try the alternate Y resolution setting. \
- The two printer types are marked by Type A or Type B in \
- the list of printer resolution settings.\
- }
- Resolution: {60} {60} {Type A}
- Resolution: {60} {180} {Type A}
- Resolution: {120} {60} {Type A}
- Resolution: {120} {180} {Type A}
- Resolution: {180} {60} {Type A}
- Resolution: {180} {180} {Type A}
- Resolution: {240} {60} {Type A}
- Resolution: {240} {180} {Type A}
- Resolution: {60} {72} {Type B}
- Resolution: {60} {216} {Type B}
- Resolution: {120} {72} {Type B}
- Resolution: {120} {216} {Type B}
- Resolution: {180} {72} {Type B}
- Resolution: {180} {216} {Type B}
- Resolution: {240} {72} {Type B}
- Resolution: {240} {216} {Type B}
-EndEntry
-
-
-# Epson (and similar) dot-matrix printer driver for Ghostscript.
-#
-# gdevepsn.c
-#
-# Resolutions: (depends on driver I think too)
-# 9 pin: XDPI - 60, 120, 240, YDPI either 60 or 72
-# 24 pin: XDPI - 60, 120, 180, 240, 360, YPID either 60,180 or 72,216
-#
-# Color: 1 bit
-#
-
-StartEntry: Epson9
- GSDriver: epson
- Description: {Epson Dot Matrix, 9 pin}
- About: { \
- This driver supports Epson and some Epson compatible \
- dot-matrix printers. \
- \n\n This driver is for 9 pin printers.\
- \n\n NOTE: A given printer will support a Y resolution of \
- 60 and 180, or 72 and 216, but not both! If your output \
- appears distorted, try the alternate Y resolution setting. \
- The two printer types are marked by Type A or Type B in \
- the list of printer resolution settings. \
- }
- Resolution: {60} {60} {Type A}
- Resolution: {120} {60} {Type A}
- Resolution: {240} {60} {Type A}
- Resolution: {60} {72} {Type B}
- Resolution: {120} {72} {Type B}
- Resolution: {240} {72} {Type B}
-EndEntry
-
-StartEntry: Epson24
- GSDriver: epson
- Description: {Epson Dot Matrix, 24 pin}
- About: { \
- This driver supports Epson and some Epson compatible \
- dot-matrix printers. \
- \n\n This driver is for 24 pin printers.\
- \n\n NOTE: A given printer will support a Y resolution of \
- 60 and 180, or 72 and 216, but not both! If your output \
- appears distorted, try the alternate Y resolution setting. \
- The two printer types are marked by Type A or Type B in \
- the list of printer resolution settings.\
- }
- Resolution: {60} {60} {Type A}
- Resolution: {60} {180} {Type A}
- Resolution: {120} {60} {Type A}
- Resolution: {120} {180} {Type A}
- Resolution: {180} {60} {Type A}
- Resolution: {180} {180} {Type A}
- Resolution: {240} {60} {Type A}
- Resolution: {240} {180} {Type A}
- Resolution: {360} {60} {Type A}
- Resolution: {360} {180} {Type A}
- Resolution: {60} {72} {Type B}
- Resolution: {60} {216} {Type B}
- Resolution: {120} {72} {Type B}
- Resolution: {120} {216} {Type B}
- Resolution: {180} {72} {Type B}
- Resolution: {180} {216} {Type B}
- Resolution: {240} {72} {Type B}
- Resolution: {240} {216} {Type B}
- Resolution: {360} {72} {Type A}
- Resolution: {360} {216} {Type A}
-EndEntry
-
-StartEntry: Epson9MedRes
- GSDriver: eps9mid
- Description: {Epson Dot Matrix, 9 pin, med-res}
- About: { \
- This driver supports Epson and some Epson compatible \
- dot-matrix printers. This driver implements an \
- intermediate resolution by making multiple passes. \
- It has better, but slower, output than the standard Epson\
- 9 pin driver. \
- \n\n This driver is for 9 pin printers.\
- \n\n NOTE: A given printer will support a Y resolution of \
- 180 or 216, but not both! If your output \
- appears distorted, try the alternate Y resolution setting. \
- The two printer types are marked by Type A or Type B in \
- the list of printer resolution settings. \
- }
- Resolution: {60} {180} {Type A}
- Resolution: {120} {180} {Type A}
- Resolution: {240} {180} {Type A}
- Resolution: {60} {216} {Type B}
- Resolution: {120} {216} {Type B}
- Resolution: {240} {216} {Type B}
-EndEntry
-
-StartEntry: Epson9HiRes
- GSDriver: eps9high
- Description: {Epson Dot Matrix, 9 pin, hi-res}
- About: { \
- This driver supports Epson and some Epson compatible \
- dot-matrix printers. This driver implements an \
- intermediate resolution by making multiple passes. \
- It has better, but slower, output than the standard \
- or the intermediate resolution \
- Epson 9 pin driver. \
- \n\n This driver is for 9 pin printers.\
- \n\n NOTE: A given printer will support a Y resolution of \
- 180 or 216, but not both! If your output \
- appears distorted, try the alternate Y resolution setting. \
- The two printer types are marked by Type A or Type B in \
- the list of printer resolution settings. \
- }
- Resolution: {60} {180} {Type A}
- Resolution: {120} {180} {Type A}
- Resolution: {240} {180} {Type A}
- Resolution: {60} {216} {Type B}
- Resolution: {120} {216} {Type B}
- Resolution: {240} {216} {Type B}
-EndEntry
-
-
-#
-# Imagen ImPress printers
-#
-# gdevimgn.c
-#
-#
-# Resolution: 75, 150, 300
-#
-# Color: 1 bit
-#
-
-StartEntry: Imagen
- GSDriver: imagen
- Description: {Imagen ImPress}
- About: { \
- Driver for the Imagen ImPress.\
- }
- Resolution: {75} {75} {}
- Resolution: {150} {150} {}
- Resolution: {300} {300} {}
-EndEntry
-
-#
-# Canon LBP-*II and LIPS III printer
-#
-# gdevlbp8.c
-#
-# Resolution: 300x300
-#
-# Color: 1 bit
-#
-
-StartEntry: CanonLBP8
- GSDriver: lbp8
- Description: {Canon LBP-8II}
- About: { \
- Driver for the Canon LBP-8II laser printer.\
- }
- Resolution: {300} {300} {}
-EndEntry
-
-StartEntry: CanonLIPS
- GSDriver: lips3
- Description: {Canon LIPS III}
- About: { \
- Driver for the Canon LIPS III laser printer \
- in English mode.\
- }
- Resolution: {300} {300} {}
-EndEntry
-
-#
-# DEC LN03 (sixel printers)
-#
-# gdevln03.c
-#
-# Resolution:
-# ln03 300x300
-# la50 144x72
-# la70 144x144
-# la75 144x72
-# la75plus 180x180
-#
-# Color: 1 bit
-#
-
-StartEntry: DECLN03
- GSDriver: ln03
- Description: {DEC LN03}
- About: { \
- Driver for the DEC LN03 laser printer. \
- }
- Resolution: {300} {300} {}
-EndEntry
-
-StartEntry: DECLA50
- GSDriver: la50
- Description: {DEC LA50 dot matrix}
- About: { \
- Driver for the DEC LA50 dot matrix printer. \
- }
- Resolution: {144} {72} {}
-EndEntry
-
-StartEntry: DECLA70
- GSDriver: la70
- Description: {DEC LA70 dot matrix}
- About: { \
- Driver for the DEC LA70 dot matrix printer. \
- }
- Resolution: {144} {144} {}
-EndEntry
-
-StartEntry: DECLA75
- GSDriver: la75
- Description: {DEC LA75 dot matrix}
- About: { \
- Driver for the DEC LA75 dot matrix printer. \
- }
- Resolution: {144} {72} {}
-EndEntry
-
-StartEntry: DECLA75P
- GSDriver: la75plus
- Description: {DEC LA75 Plus dot matrix}
- About: { \
- Driver for the DEC LA75 Plus dot matrix printer. \
- }
- Resolution: {180} {180} {}
-EndEntry
-
-
-#
-# NEC P6 printers
-#
-# gdevnp6.c
-#
-# Resolution: 360x360
-#
-# Color: 1 bit
-#
-
-StartEntry: NECP6
- GSDriver: necp6
- Description: {NEC P6/P6+/P60}
- About: { \
- Driver for the NEC P6/P6+/P60 printers. \
- }
- Resolution: {360} {360} {}
-EndEntry
-
-#
-# Okidata Microline 182
-#
-# gdevo182.c
-#
-# Resolution: 72x72 144x144
-#
-# Color: 1 bit
-#
-
-StartEntry: OKI182
- GSDriver: oki182
- Description: {Okidata Microline 182}
- About: { \
- Driver for the Okidata Microline 182 printer. \
- }
- Resolution: {72} {72} {}
- Resolution: {144} {144} {}
-EndEntry
-
-#
-# HP PaintJet drivers (older alternative?)
-#
-# gdevpjet.c
-#
-# Resolution: 90x90 or 180x180
-#
-# Color: 3 bits
-
-StartEntry: LJ250
- GSDriver: lj250
- Description: {DEC LJ250}
- About: { \
- Driver for the DEC LJ250 Companion color printer \
- using HP PaintJet compatible mode. \
- }
- Resolution: {90} {90} {}
- Resolution: {180} {180} {}
-EndEntry
-
-#paintjet
-# "(alternative) HP PaintJet color printer"
-
-#pjetxl
-# "(alternative) HP PaintJet XL"
-
-#
-# StarJet SJ48
-#
-# gdevsj48.c
-#
-# Resolution: (180,360)x(180,360)
-#
-# Color: 1 bit
-#
-
-StartEntry: StarJet48
- GSDriver: sj48
- Description: {StarJet 48}
- About: { \
- Driver for the StarJet 48 printer. \
- }
- Resolution: {180} {180} {}
- Resolution: {360} {180} {}
- Resolution: {180} {360} {}
- Resolution: {360} {360} {}
-EndEntry
-
-#
-# Tektronix Ink-jet plotter
-#
-# gdevtknk.c
-#
-# Resolution: 120x120
-#
-# Color: 4 bits
-#
-
-StartEntry: Tek4696
- GSDriver: tek4696
- Description: {Tektronics 4695/4696 inkjet plotter}
- About: { \
- Driver for the Tektronix 4695/4696 inkjet plotter. \
- }
- Resolution: {120} {120} {}
-EndEntry
-
-
-#
-# Xerox XES
-#
-# gdevxes.c
-#
-# Resolution: 300x300
-#
-# Color: 1 bit
-#
-
-StartEntry: XeroxXES
- GSDriver: xes
- Description: {Xerox XES printers}
- About: { \
- Driver for the Xerox XES printers (2700, 3700, 4045, etc).\
- }
- Resolution: {300} {300} {}
-EndEntry
-
-#
-# postscript
-#
-# This is for a real postscript printer - no ghostscript involved
-#
-# resolutions are there so user can specify, no way to tell what their
-# printer can really do
-#
-# same for color, no way to know
-#
-StartEntry: PostScript
- GSDriver: POSTSCRIPT
- Description: {PostScript printer}
- About: { \
- Driver for the PostScript printers.\
- Does not use ghostscript. \
- Use if your printer has a PostScript interpreter built-in. \
- Choose the resolution which corresponds to your printer from \
- these list. \
- }
- Resolution: {300} {300} {}
- Resolution: {600} {600} {}
- Resolution: {1200} {1200} {}
-EndEntry
-
-
-
-#
-# text
-#
-# This is for a real text printer - no ghostscript involved
-#
-# use this if you DO NOT want postscript printed at all
-#
-StartEntry: TextPrinter
- GSDriver: TEXT
- Description: {Text-only printer}
- About: { \
- Driver for the text-only printers.\
- Does not use ghostscript. \
- Outputs ASCII text straight to the printer. \
- }
- Resolution: {NA} {NA} {}
-EndEntry
-#
-#
-# uniprint drivers
-#
-# Followings are to accomodate uniprint drivers in ghostscript-5.50.
-# to patched printtool and ps-to-printer.fpi by Osamu Aoki.
-# For the ease of setting, I chose to break entry into several sections.
-# Data base entry format has changed for this section.
-#
-# BitsPerPixel: {upp_file} {Comment copied from upp file}
-#
-# In order to update followings for future updates,
-# First cd /usr/share/ghostscript/5.50 (5.50 may change...)
-# Then get list of *.upp driver by
-# # ls -m *.upp in /usr/share/ghostscript/5.50
-# Finally get the meaning of each driver by
-# # head -1 `ls *.upp` (man gs also gives good information)
-# Then edit with keyboad macro to make this file.
-#
-
-StartEntry: U_CanonBJC610
- GSDriver: uniprint
- Description: {Canon BJC-610 (UP)}
- About: { \
- Canon BJC-610 uniprint driver settings.\
- }
- Resolution: {NA} {NA} {}
- BitsPerPixel: {bjc610a0} {360x360DpI, plain paper high speed, color, rendered}
- BitsPerPixel: {bjc610a1} {360x360DpI, plain paper, color, rendered}
- BitsPerPixel: {bjc610a2} {360x360DpI, coated paper, color, rendered}
- BitsPerPixel: {bjc610a3} {360x360DpI, transparency film, color, rendered}
- BitsPerPixel: {bjc610a4} {360x360DpI, back print film, color, rendered}
- BitsPerPixel: {bjc610a5} {360x360DpI, fabric sheet, color, rendered}
- BitsPerPixel: {bjc610a6} {360x360DpI, glossy paper, color, rendered}
- BitsPerPixel: {bjc610a7} {360x360DpI, high gloss film, color, rendered}
- BitsPerPixel: {bjc610a8} {360x360DpI, high resolution paper, color, rendered}
- BitsPerPixel: {bjc610b1} {720x720DpI, plain paper, color, rendered}
- BitsPerPixel: {bjc610b2} {720x720DpI, coated paper, color, rendered}
- BitsPerPixel: {bjc610b3} {720x720DpI, transparency film, color, rendered}
- BitsPerPixel: {bjc610b4} {720x720DpI, back print film, color, rendered}
- BitsPerPixel: {bjc610b6} {720x720DpI, glossy paper, color, rendered}
- BitsPerPixel: {bjc610b7} {720x720DpI, high gloss paper, color, rendered}
- BitsPerPixel: {bjc610b8} {720x720DpI, high resolution paper, color, rendered}
-EndEntry
-#
-StartEntry: U_HPDeskjet550c
- GSDriver: uniprint
- Description: {HP Deskjet 550C (UP)}
- About: { \
- HP Deskjet 550C uniprint driver settings.\
- }
- Resolution: {NA} {NA} {}
- BitsPerPixel: {cdj550} {300x300DpI, Gamma=2}
-EndEntry
-#
-StartEntry: U_NECPrinwriter2X
- GSDriver: uniprint
- Description: {NEC Prinwriter 2X (UP)}
- About: { \
- NEC Printwriter 2X uniprint driver settings. \
- Check sorce code for explanation of necp2x6.\
- }
- Resolution: {NA} {NA} {}
- BitsPerPixel: {necp2x} {360x360DpI, Plain Paper}
- BitsPerPixel: {necp2x6} {360x360DpI, Plain Paper}
-EndEntry
-#
-#StartEntry: U_SUNrasterfile
-# GSDriver: uniprint
-# Description: {SUN rasterfile (UP)}
-# About: { \
-# SUN raster file uniprint driver settings.\
-# }
-# Resolution: {NA} {NA} {}
-# BitsPerPixel: {ras1} {1 Bit, 2 Colors (Ghostscript-Rendering)}
-# BitsPerPixel: {ras24} {24 Bit, 7 Colors (RGB-Error-Diffusion)}
-# BitsPerPixel: {ras3} {3 Bit, 7 Colors (RGB-Ghostscript)}
-# BitsPerPixel: {ras32} {32 Bit, 6+1 Colors (CMYK-Error-Diffusion)}
-# BitsPerPixel: {ras4} {4 Bit, 6+1 Colors (CMYK-Ghostscript)}
-# BitsPerPixel: {ras8m} {8 Bit, 2 Colors (Error-Diffusion)}
-#EndEntry
-#
-StartEntry: U_EpsonStylusColor
- GSDriver: uniprint
- Description: {Epson Stylus Color (UP)}
- About: { \
- Epson Stylus Color uniprint driver settings.\
- }
- Resolution: {NA} {NA} {}
- BitsPerPixel: {stcany} {Stylus Color any type, 360x360DpI}
- BitsPerPixel: {stc} {Stylus Color I / PRO Series, 360x360DpI, Plain Paper}
- BitsPerPixel: {stc_h} {Stylus Color I / PRO Series, 720x720DpI, Special Paper}
- BitsPerPixel: {stc_l} {Stylus Color I / PRO Series, 360x360DpI, noWeave}
- BitsPerPixel: {stc2} {Stylus Color II / IIs, 360x360DpI, Plain Paper}
- BitsPerPixel: {stc2_h} {Stylus Color II, 720x720DpI, Special Paper}
- BitsPerPixel: {stc2s_h} {Stylus Color IIs, 720x720DpI, Special Paper}
- BitsPerPixel: {stc500p} {Stylus Color 500, 360x360DpI, not Weaved, Plain Paper}
- BitsPerPixel: {stc500ph} {Stylus Color 500, 720x720DpI, not Weaved, Plain Paper}
- BitsPerPixel: {stc600ih} {Stylus Color 600, 1440x720DpI, Inkjet Paper}
- BitsPerPixel: {stc600p} {Stylus Color 600, 720x720DpI, Plain Paper}
- BitsPerPixel: {stc600pl} {Stylus Color 600, 360x360DpI, Plain Paper}
- BitsPerPixel: {stc740ih} {Stylus Color 740, 1440x720DpI, Inkjet Paper}
- BitsPerPixel: {stc740p} {Stylus Color 740, 720x720DpI, Plain Paper}
- BitsPerPixel: {stc740pl} {Stylus Color 740, 360x360DpI, Plain Paper}
- BitsPerPixel: {stc800ih} {Stylus Color 800, 1440x720DpI, Inkjet Paper}
- BitsPerPixel: {stc800p} {Stylus Color 800, 720x720DpI, Plain Paper}
- BitsPerPixel: {stc800pl} {Stylus Color 800, 360x360DpI, Plain Paper}
- BitsPerPixel: {stc1520h} {Stylus Color 1520, 1440x720DpI, Inkjet Paper}
-EndEntry
-#
diff --git a/gs/contrib/epson740/ps-to-printer.fpi_rh5.2 b/gs/contrib/epson740/ps-to-printer.fpi_rh5.2
deleted file mode 100755
index c5fdaa156..000000000
--- a/gs/contrib/epson740/ps-to-printer.fpi_rh5.2
+++ /dev/null
@@ -1,95 +0,0 @@
-#!/bin/sh
-#
-# convert ps to the format required by the printer on this queue
-#
-# if the printer is a PostScript printer, just cat it through
-# if the printer uses ghostscript, we'll run it now
-# if the printer is neither, we die (with good message to someone)
-#
-
-#
-# read in PostScript configuration settings
-#
-. ${SPOOLDIR}/postscript.cfg
-
-#
-# see if we should reverse order
-#
-# support will be added for this in the future
-# psorder needed and is part of netatalk, which we dont currently ship
-#
-
-if [ "$PAPERSIZE" = "letter" ]; then
- mpage_paper="Letter"
-elif [ "$PAPERSIZE" = "a4" ]; then
- mpage_paper="A4"
-elif [ "$PAPERSIZE" = "legal" ]; then
- mpage_paper="Legal"
-else
- mpage_paper="Letter"
-fi
-
-#
-# weird case - some PS doesnt get handled by mpage well
-# so we allow nup=1 to just cat PS to printer w/o mpage interferring
-#
-if [ "$NUP" = "1" ]; then
- border="-o"
- mpage_cmd="cat -"
-else
- border=""
- mpage_cmd="mpage -b$mpage_paper $border -$NUP -m${RTLFTMAR}lr -m${TOPBOTMAR}tb"
-fi
-
-#
-# if the driver is "POSTSCRIPT" it means the printer handles Postscript
-# natively, no need to run gs.
-# if the driver is "TEXT" then it means the printer cannot handle PS input
-#
-if [ "$GSDEVICE" = "POSTSCRIPT" ]; then
- eval $mpage_cmd
-elif [ "$GSDEVICE" = "TEXT" ]; then
- echo "Error - ps-to-printer.fpi - this printer cannot print postscript"
- echo " and ghostscript does not have support"
- exit 1
-else
-# we're using ghostscript
-# stc740p.upp 740*740 mine
-# stc740pl.upp 360*360 mine
-# stc740_m.upp 740*740 from the net
-
- if [ "$GSDEVICE" = "uniprint" ]; then
- if [ "$RESOLUTION" = "720x720" ]; then
- configfile="stc740p.upp"
- elif [ "$RESOLUTION" = "1440x720" ]; then
- configfile="stc740ih.upp"
- else
- configfile="stc740pl.upp"
- fi
- eval "$mpage_cmd | gs -q @$configfile \
- -sPAPERSIZE=$PAPERSIZE \
- -sOutputFile=- \
- $EXTRA_GS_OPTIONS \
- -"
- else
- eval "$mpage_cmd | gs -q -sDEVICE=$GSDEVICE \
- -r$RESOLUTION \
- -sPAPERSIZE=$PAPERSIZE \
- -dNOPAUSE \
- -dSAFER \
- -sOutputFile=- \
- $COLOR \
- $EXTRA_GS_OPTIONS \
- -"
- fi
-fi
-
-#
-#
-# see if we need to send a form feed to eject the page from printer
-#
- if [ "$PS_SEND_EOF" = "YES" ]; then
- printf "\004"
- fi
-
-exit 0
diff --git a/gs/contrib/epson740/upp-HowTo-to-be b/gs/contrib/epson740/upp-HowTo-to-be
deleted file mode 100644
index 75c6b0c54..000000000
--- a/gs/contrib/epson740/upp-HowTo-to-be
+++ /dev/null
@@ -1,59 +0,0 @@
-
-How to write Uniprint files.
-
- or The Ignorant Man's Guide to Weaving
-
-Disclaimer: This is not yet a How-To, not even a mini-How-To. But if
-I can manage to keep trying and get some work put into it, and if we
-have less atmospheric electrical activity than we have recently, it
-just might grow up to be one.
-
-First off, this information came about because the Epson 740 met the
-price-performance ratio I was looking for, and I ASSUMED that since
-the ESC 600 and ESC 800 were supported, the ESC 740 would be, too.
-
-Wrong!
-
-So I guess it was up to me. A few evenings with some scratch paper,
-and then some time on the plane to and from the 1999 International
-Solid State Circuits Conference in San Francisco, (from Vermont) and
-I had an Epson 740 functioning under Linux.
-
-This work came from examining the upp files that came for the ESC
-600 and 800, sort of figuring out what they were up to, and then
-trying to do the same thing for the 740. So without all of the
-original Uniprint work by <insert name here>, this never would have
-even left the ground.
-
-A Few Words About Weaving
-
-The Epson Stylus Color printers have some number of inkjets, which
-varies from model to model. Unfortunately, all models have jet
-pitches which are significantly coarser than the desired resolution.
-(Except for the ESC 900, which I don't know how to make print at
-360*360.) As a result, printing is a combination between stepping
-the paper in some appropriate pattern, and using the appropriate
-ink jets.
-
-I have worked with three examples, the 600, 740, and 800. To begin
-with, let's consider 720*720 resolution. The 600 does this in 8
-passes. That means that the jet pitch in the print head is 8 times
-coarser than the dot pitch, or 90 jets/inch. At that same resolut-
-ion, the 740 takes 6 passes, or 120 jets/inch and the 800 takes
-4 passes, or 180 jets/inch. I have reason to believe that the new
-ESC 900 will take 3 passes, or 180 jets/inch.
-
-One way to weave this would be to paint a row, step 1/720 inch,
-paint the next row, etc, until 8 rows are done, using the 600
-for reference. After this, one would step past all that has been
-printed and begin the next swath. The problem with this scheme
-is that each head would be printing 8 adjacent rows. If one jet
-was undersized, there would be fine white lines visible between
-the printed rows. If a jet was oversized, there would be dark
-lines.
-
-Microweaving
-
-It's much better if adjacent rows were never printed by the same
-jet. That way, things would average out better.
-
diff --git a/gs/contrib/gdevbjc_.c b/gs/contrib/gdevbjc_.c
deleted file mode 100644
index 3ac1431ae..000000000
--- a/gs/contrib/gdevbjc_.c
+++ /dev/null
@@ -1,953 +0,0 @@
-/* BJC-210/240/250/265/1000 Bubble Jet Printer driver for GhostScript
- * main subroutines for GS
- *
- * Copyright 2000, 2001, 2002 Gergely Szász (Gergely Sza'sz)
- * mailto://szaszg@hu.inter.net http://bjc250gs.sourceforge.net
- *
- * This program may be distributed and/or modified under the terms of
- * the GNU General Public License as published by the Free Software
- * Foundation (the "GPL"); either version 2 of the GPL, or (at your option)
- * any later version.
- *
- * When distributed under the terms of the GPL, this program is distributed
- * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
- * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GPL for more details.
- *
- * If this program is being distributed under the terms of the GPL, you
- * should have received a copy of the GPL along with this program, normally
- * in a plain ASCII text file named COPYING; if not, write to the Free
- * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111
- * U.S.A.
- */
-
-/* Copyright (C) 1989, 2000 Aladdin Enterprises. All rights reserved.
-
- This program may also be distributed as part of AFPL Ghostscript, under the
- terms of the Aladdin Free Public License (the "License").
-
- AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND. No
- author or distributor accepts any responsibility for the consequences of
- using it, or for whether it serves any particular purpose or works at
- all, unless he or she says so in writing. Refer to the License for full
- details.
-
- Every copy of AFPL Ghostscript must include a copy of the License,
- normally in a plain ASCII text file named PUBLIC. The License grants you
- the right to copy, modify and redistribute AFPL Ghostscript, but only
- under certain conditions described in the License. Among other things,
- the License requires that the copyright notice and this notice be
- preserved on all copies.
-*/
-
-/* BJC printers drivers */
-#include "gdevprn.h"
-#include "gsparam.h"
-#include "gdevbjc_.h"
-
-/* ------ The device descriptors ------ */
-private dev_proc_print_page(bjc_print_page);
-private dev_proc_print_page(bjc_print_page_mono);
-private dev_proc_print_page(bjc_print_page_gray);
-private dev_proc_print_page(bjc_print_page_cmyk);
-private dev_proc_print_page(bjc_print_page_color);
-private dev_proc_put_params(gdev_bjc_put_params);
-private dev_proc_get_params(gdev_bjc_get_params);
-const stringParamDescription *
- paramValueToParam(const stringParamDescription *, int);
-const stringParamDescription *
- paramStringToParam(const stringParamDescription *, const char *, uint);
-
-BJL_command BJL_command_set[] = {
- { "@Cleaning=1", BJC_BJL_CLEANING, 11},
- { "@PowerOff", BJC_BJL_POWER_OFF, 9},
- { "@RollerCleaning", BJC_BJL_ROCLEANING, 15},
- { "@TestPrint=NozzleCheck", BJC_BJL_NOZZLECHK, 22},
- { "@TestPrint=A", BJC_BJL_TESTA, 12},
- { "@TestPrint=B", BJC_BJL_TESTB, 12},
- { "@TestPrint=C", BJC_BJL_TESTC, 12},
- { "@TestPrint=DemoPrint", BJC_BJL_DEMO, 20},
-
-#define BJL_CMC_AP "ControlMode=Common\012AutoPower" /*+28*/
-
- { BJL_CMC_AP "On=Enable", BJC_BJL_ON_ENABLE, 37},
- { BJL_CMC_AP "On=Disable", BJC_BJL_ON_DISABLE, 38},
- { BJL_CMC_AP "Off=1", BJC_BJL_OFF_1MIN, 33},
- { BJL_CMC_AP "Off=10", BJC_BJL_OFF_10MIN, 34},
- { BJL_CMC_AP "Off=30", BJC_BJL_OFF_30MIN, 34},
- { BJL_CMC_AP "Off=60", BJC_BJL_OFF_60MIN, 34},
- { BJL_CMC_AP "Off=Disable", BJC_BJL_OFF_DISABLE, 39},
- { NULL }
-};
-
-
-/* String parameter definitions */
-
-stringParamDescription strPrinterType[] = {
- { { "BJC-250", 7, false }, 0 },
- { { "BJC-250ex", 9, false }, 1 },
- { { "BJC-1000", 8, false }, 2 },
-
- { { "250", 3, false }, 0 },
- { { "250ex", 5, false }, 1 },
- { { "1000", 4, false }, 2 },
- { {0} }
-};
-
-stringParamDescription strFeeder[] = {
- { { "Manual", 6, false }, 0x11 },
- { { "Auto", 4, false }, 0x10 },
-
- { { "m", 1, false }, 0x11 },
- { { "a", 1, false }, 0x10 },
- { {0} }
-};
-
-stringParamDescription strQuality[] = {
- { { "Normal", 6, false }, 0 },
- { { "High", 4, false }, 1 },
- { { "Draft", 5, false }, 2 },
- { { "NonBleed", 8, false }, 8 },
-
- { { "n", 1, false }, 0 },
- { { "h", 1, false }, 1 },
- { { "d", 1, false }, 2 },
- { { "b", 1, false }, 8 },
- { {0} }
-};
-
-stringParamDescription strInk[] = {
- { { "Black", 5, false }, 8 },
- { { "Cyan", 4, false }, 1 },
- { { "Magenta", 7, false }, 2 },
- { { "Yellow", 6, false }, 4 },
- { { "Red", 3, false }, 6 },
- { { "Green", 5, false }, 5 },
- { { "Blue", 4, false }, 3 },
-
- { { "K", 1, false }, 8 },
- { { "C", 1, false }, 1 },
- { { "M", 1, false }, 2 },
- { { "Y", 1, false }, 4 },
- { { "R", 1, false }, 6 },
- { { "G", 1, false }, 5 },
- { { "B", 1, false }, 3 },
- { { "CK", 2, false }, 9 },
- { { "MK", 2, false }, 10 },
- { { "YK", 2, false }, 12 },
- { { "RK", 2, false }, 14 },
- { { "GK", 2, false }, 13 },
- { { "BK", 2, false }, 11 },
- { { "CMY", 3, false }, 7 },
- { { "CMYK", 4, false }, 15 },
- { {0} }
-};
-
-private stringParamDescription strMedia[] = {
- {{"PlainPaper", 10, false}, 0},
- {{"CoatedPaper", 11, false}, 1},
- {{"TransparencyFilm", 16, false}, 2},
- {{"BackprintFilm", 13, false}, 3},
- {{"T-ShirtTransfer", 15, false}, 3},
- {{"FabricSheet", 11, false}, 4},
- {{"GlossyPaper", 11, false}, 5},
- {{"GlossyPhotoPaper", 16, false}, 5},
- {{"HighGlossPaper", 14, false}, 5},
- {{"HighGlossyFilm", 14, false}, 6},
- {{"Envelope", 8, false}, 7},
- {{"OtherPaper", 10, false}, 8},
- {{"HighResolutionPaper", 19, false}, 9},
-/* { { "HighResPaper", 12, false }, 11 }, */
- {{"GlossyPhotoCard", 15, false}, 10},
-/* { { "FullBleed", 9, false }, 12 }, */
- {{"Banner", 6, false}, 11},
-
- {{"Plain", 5, false}, 0},
- {{"Coated", 6, false}, 1},
- {{"Trans", 5, false}, 2},
- {{"Back", 4, false}, 3},
- {{"Shirt", 4, false}, 3},
-/* { { "Lead", 4, false }, 4 }, */
- {{"Fabric", 6, false}, 4},
- {{"Glossy", 6, false}, 5},
- {{"HGloss", 6, false}, 6},
- {{"Env", 3, false}, 7},
- {{"Oth", 3, false}, 8},
- {{"HiRes", 5, false}, 9},
-/* { { "Bleed", 5, false }, 12 }, */
- {{"Card", 4, false}, 10},
- {{"Ban", 3, false}, 11},
-
- {{"p", 1, false}, 0},
- {{"c", 1, false}, 1},
- {{"t", 1, false}, 2},
- {{"b", 1, false}, 3},
- {{"s", 1, false}, 3},
- {{"f", 1, false}, 4},
- {{"g", 1, false}, 5},
- {{"F", 1, false}, 6},
- {{"e", 1, false}, 7},
- {{"o", 1, false}, 8},
- {{"h", 1, false}, 9},
- {{"C", 1, false}, 10},
- {{"B", 1, false}, 11},
- {{0}}
-};
-
-static media_t media_codes[] = {
- {0x00, 0x00}, /* Plain paper */
- {0x10, 0x10}, /* Coated paper */
- {0x20, 0x20}, /* Transp */
- {0x30, 0x30}, /* Backprint or T-shirt */
- {0x50, 0x40}, /* Fabric */
- {0x60, 0x50}, /* Glossy (Photo) Paper */
- {0x70, 0x60}, /* High gloss film */
- {0x80, 0x00}, /* Envelope */
- {0x90, 0x10}, /* Other */
- {0xb0, 0x70}, /* Hi Res */
- {0xc0, 0x50}, /* Glossy Photo Cards */
- {0xd0, 0x00}, /* Banner */
-};
-
-/***************************************************************************/
-/* ------------------------- 1 bit Monochrome ---------------------------- */
-/***************************************************************************/
-
-private const gx_device_procs bjcmono_procs =
-prn_color_params_procs(gdev_prn_open, gdev_prn_output_page, gdev_prn_close,
- NULL, NULL,
- gdev_bjc_get_params, gdev_bjc_put_params);
-
-const gx_device_bjc_printer gs_bjcmono_device =
-bjc_device(bjcmono_procs, "bjcmono",
- DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,
- X_DPI, Y_DPI,
- (3.4 / 25.4), (7.0 / 25.4), (3.4 / 25.4), (3.0 / 25.4),
- 1, /* num components */
- 1, /* depth */
- 1, /* max gray */
- 0, /* max color */
- 2, /* dither gray */
- 0, /* dither color */
- bjc_print_page_mono, INK_K); /* printer rutin, default ink */
-
-
-/***************************************************************************/
-/* -------------------------- 8 bit Grayscale ---------------------------- */
-/***************************************************************************/
-
-private const gx_device_procs bjcgray_procs =
-prn_color_params_procs(gdev_prn_open, gdev_prn_output_page, gdev_prn_close,
- gx_default_gray_map_rgb_color, gx_default_gray_map_color_rgb,
- gdev_bjc_get_params, gdev_bjc_put_params);
-
-const gx_device_bjc_printer gs_bjcgray_device =
-bjc_device(bjcgray_procs, "bjcgray",
- DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,
- X_DPI, Y_DPI,
- (3.4 / 25.4), (7.0 / 25.4), (3.4 / 25.4), (3.0 / 25.4),
- 1, /* num components */
- 8, /* depth */
- 255, /* max gray */
- 0, /* max color */
- 256, /* dither gray */
- 0, /* dither color */
- bjc_print_page_gray, INK_K);
-
-
-/***************************************************************************/
-/* --------------------------- 3 bit CMYK Color -------------------------- */
-/***************************************************************************/
-
-
-
-private const gx_device_procs bjc_cmykcolor_procs =
-bjc_cmyk_param_procs(gdev_prn_open, gdev_prn_output_page, gdev_prn_close,
- cmyk_1bit_map_color_rgb, cmyk_1bit_map_cmyk_color,
- gdev_bjc_get_params, gdev_bjc_put_params);
-
-const gx_device_bjc_printer gs_bjccmyk_device =
-bjc_device(bjc_cmykcolor_procs, "bjccmyk",
- DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,
- X_DPI, Y_DPI,
- (3.4 / 25.4), (7.0 / 25.4), (3.4 / 25.4), (3.0 / 25.4),
- 4, /* num components */
- 4, /* depth */
- 1, /* max gray */
- 1, /* max color */
- 2, /* dither gray */
- 2, /* dither color */
- bjc_print_page_cmyk, (INK_K|INK_C|INK_M|INK_Y));
-
-
-/***************************************************************************/
-/* --------------------------- 24 bit TrueColor -------------------------- */
-/***************************************************************************/
-
-
-
-private const gx_device_procs bjc_truecolor_procs =
-bjc_cmyk_param_procs(gdev_prn_open, gdev_prn_output_page, gdev_prn_close,
- cmyk_8bit_map_color_rgb, cmyk_8bit_map_cmyk_color,
- gdev_bjc_get_params, gdev_bjc_put_params);
-
-const gx_device_bjc_printer gs_bjccolor_device =
-bjc_device(bjc_truecolor_procs, "bjccolor",
- DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,
- X_DPI, Y_DPI,
- (3.4 / 25.4), (7.0 / 25.4), (3.4 / 25.4), (3.0 / 25.4),
- 4, /* num components */
- 32, /* depth */
- 255, /* max gray */
- 255, /* max color */
- 256, /* dither gray */
- 256, /* dither color */
- bjc_print_page_color, (INK_K|INK_C|INK_M|INK_Y));
-
-
-/***************************************************************************/
-/* ---------------------------Print a page routine------------------------ */
-/***************************************************************************/
-
-/*
-private int
-bjc_print_page(gx_device_printer * pdev, FILE * file)
-{
-#define ppdev ((gx_device_bjc_printer *) pdev)
-#define prdev ((gx_device_printer *) pdev)
-
- uint raster = gdev_prn_raster(pdev);
- uint bjc_raster = raster + (-raster & 3);
- byte *row = gs_alloc_bytes(pdev->memory, bjc_raster, "bjc file buffer");
- int y;
- int code;
- char alma[512];
-
- sprintf(alma, "\nNumC: %d, Depth: %d, Mgray: %d, Mrgb: %d\n"
- "Dgray: %d, Drgb: %d", pdev->color_info.num_components,
- pdev->color_info.depth,
- pdev->color_info.max_gray,
- pdev->color_info.max_color,
- pdev->color_info.dither_grays,
- pdev->color_info.dither_colors
- );
-
- if (row == 0)
- return_error(gs_error_VMerror);
-
-
-done:
- gs_free_object(pdev->memory, row, "bjc file buffer");
-
-
- fwrite((const char *) alma, 512, 1, file);
- return code;
-
-#undef ppdev
-}
-*/
-
-void
-bjc_put_bjl_command(FILE * file, int bjl_command)
-{
- BJL_command *command = BJL_command_set;
- for( ; command->string; command++)
- if(command->numeric == bjl_command) break;
- if(command->string) {
- fwrite((const char *)"\033[K\002\000\000\037BJLSTART\012", 16, 1, file);
- fwrite(command->string, command->length, 1, file);
- fwrite((const char *)"\012BJLEND\012", 8, 1, file); }
-}
-
-
-/* ------ Get/put parameters ------ */
-
-
-/* Functions for manipulation params strings */
-
-const stringParamDescription *
-paramValueToParam(const stringParamDescription * params, int value)
-{
-
- for (; params->p_string.data; ++params) {
- if (params->p_value == value) {
- return params;
- }
- }
-
- return (stringParamDescription *) NULL;
-}
-
-const stringParamDescription *
-paramStringToParam(const stringParamDescription * params,
- const char * name, uint len)
-{
- for (; params->p_string.data; ++params) {
- if (len == params->p_string.size)
- if (!(strncmp((const char *)params->p_string.data,
- name, len))) {
- return params;
- }
- }
-
- return (stringParamDescription *) NULL;
-}
-
-
-/* Get parameters. BJC printer devices add several more parameters */
-/* to the default set. */
-private int
-gdev_bjc_get_params(gx_device * pdev, gs_param_list * plist)
-{
- const gx_device_bjc_printer * ppdev = (gx_device_bjc_printer *)pdev;
-
- int code = gdev_prn_get_params(pdev, plist);
- if (code < 0 ||
- (code = param_write_string(plist, "PrinterType",
- &paramValueToParam(strPrinterType, ppdev->printerType)->p_string)) < 0 ||
- (code = param_write_string(plist, "Feeder",
- &paramValueToParam(strFeeder, ppdev->feeder)->p_string)) < 0 ||
- (code = param_write_string(plist, "Media",
- &paramValueToParam(strMedia, ppdev->mediaType)->p_string)) < 0 ||
- (code = param_write_string(plist, "Quality",
- &paramValueToParam(strQuality, ppdev->quality)->p_string)) < 0 ||
- (code = param_write_string(plist, "InkColor",
- &paramValueToParam(strInk, ppdev->ink)->p_string)) < 0 ||
-
- (code = param_write_bool(plist, "Inverse", &ppdev->inverse)) < 0 ||
- (code = param_write_bool(plist, "Smooth", &ppdev->smooth)) < 0 ||
- (code = param_write_bool(plist, "Compress", &ppdev->compress)) < 0 ||
- (code = param_write_bool(plist, "LimitCheck", &ppdev->limit)) < 0 ||
- (code = param_write_bool(plist, "DecomposeK", &ppdev->compose)) < 0 ||
-
- (code = param_write_int(plist, "PaperRed", &ppdev->paperColor.red)) < 0 ||
- (code = param_write_int(plist, "PaperGreen", &ppdev->paperColor.green)) < 0 ||
- (code = param_write_int(plist, "PaperBlue", &ppdev->paperColor.blue)) < 0 ||
- (code = param_write_int(plist, "Random", &ppdev->rnd)) < 0 ||
-
- (code = param_write_float(plist, "Gamma", &ppdev->gamma)) < 0 ||
- (code = param_write_float(plist, "RedGamma", &ppdev->redGamma)) < 0 ||
- (code = param_write_float(plist, "GreenGamma", &ppdev->greenGamma)) < 0 ||
- (code = param_write_float(plist, "BlueGamma", &ppdev->blueGamma)) < 0)
- return code;
- return code;
-
-}
-
-/* Put parameters. */
-private int
-gdev_bjc_put_params(gx_device * pdev, gs_param_list * plist)
-{
- int code, ecode = 0;
- const char *param_name;
- gs_param_string tmppar;
- uint parsize;
- stringParamDescription *tmpstr=NULL;
-
-# define ppdev ((gx_device_bjc_printer *)pdev)
-
-#define CHECK_PARAM_CASES(good, label) \
- case 1: \
- break; \
- case 0: \
- if ( good ) break; \
- ecode = gs_error_rangecheck; goto label; \
- default: \
- ecode = code; \
-label: \
- param_signal_error(plist, param_name, ecode)
-
-#define CHECK_str_PARAM_CASES(set, str, label) \
- case 1: \
- break; \
- case 0: \
- parsize = tmppar.size; \
- tmpstr = paramStringToParam(str, \
- (const char *)tmppar.data, \
- parsize); \
- if ( tmpstr ) { set = tmpstr->p_value; break;} \
- ecode = gs_error_rangecheck; goto label; \
- default: \
- ecode = code; \
-label: \
- param_signal_error(plist, param_name, ecode)
-
- switch ( code = param_read_string(plist, (param_name = "PrinterType"),
- &tmppar)) {
- CHECK_str_PARAM_CASES(ppdev->printerType, strPrinterType, label_Type);
- }
- switch (code = param_read_string(plist, (param_name = "Feeder"),
- &tmppar)) {
- CHECK_str_PARAM_CASES(ppdev->feeder, strFeeder, label_Feeder);
- }
- switch (code = param_read_string(plist, (param_name = "Media"),
- &tmppar)) {
- CHECK_str_PARAM_CASES(ppdev->mediaType, strMedia, label_Paper);
- }
- switch (code = param_read_string(plist, (param_name = "Quality"),
- &tmppar)) {
- CHECK_str_PARAM_CASES(ppdev->quality, strQuality, label_Quality);
- }
- switch (code = param_read_string(plist, (param_name = "InkColor"),
- &tmppar)) {
- CHECK_str_PARAM_CASES(ppdev->ink, strInk, label_Ink);
- }
-
- switch (code = param_read_bool(plist, (param_name = "Inverse"),
- &ppdev->inverse)) {
- CHECK_PARAM_CASES( ppdev->inverse == true ||
- ppdev->inverse == false , label_Inverse);
- }
- switch (code = param_read_bool(plist, (param_name = "Compress"),
- &ppdev->compress)) {
- CHECK_PARAM_CASES( ppdev->compress == true ||
- ppdev->compress == false , label_Compress);
- }
- switch (code = param_read_bool(plist, (param_name = "Smooth"),
- &ppdev->smooth)) {
- CHECK_PARAM_CASES( ppdev->smooth == true ||
- ppdev->smooth == false , label_Smooth);
- }
-
- switch (code = param_read_bool(plist, (param_name = "LimitCheck"),
- &ppdev->limit)) {
- CHECK_PARAM_CASES( ppdev->limit == true ||
- ppdev->limit == false , label_Limit);
- }
-
- switch (code = param_read_bool(plist, (param_name = "DecomposeK"),
- &ppdev->compose)) {
- CHECK_PARAM_CASES( ppdev->compose == true ||
- ppdev->compose == false , label_Compose);
- }
-
- switch (code = param_read_int(plist, (param_name = "PaperRed"),
- &ppdev->paperColor.red)) {
- CHECK_PARAM_CASES( ppdev->paperColor.red >= 0 &&
- ppdev->paperColor.red <= 255 , label_Red);
- }
- switch (code = param_read_int(plist, (param_name = "PaperGreen"),
- &ppdev->paperColor.green)) {
- CHECK_PARAM_CASES(ppdev->paperColor.green >= 0 &&
- ppdev->paperColor.green <= 255 , label_Green);
- }
- switch (code = param_read_int(plist, (param_name = "PaperBlue"),
- &ppdev->paperColor.blue)) {
- CHECK_PARAM_CASES(ppdev->paperColor.blue >= 0 &&
- ppdev->paperColor.blue <= 255 , label_Blue);
- }
- switch (code = param_read_int(plist, (param_name = "Random"),
- &ppdev->rnd)) {
- CHECK_PARAM_CASES(ppdev->rnd >= 0 &&
- ppdev->rnd <= 100 , label_Random);
- }
- switch (code = param_read_float(plist, (param_name = "Gamma"),
- &ppdev->gamma)) {
- CHECK_PARAM_CASES(ppdev->gamma >= 0.0 &&
- ppdev->gamma <= 10.0 , label_Gamma);
- }
- switch (code = param_read_float(plist, (param_name = "RedGamma"),
- &ppdev->redGamma)) {
- CHECK_PARAM_CASES(ppdev->redGamma >= 0.0 &&
- ppdev->redGamma <= 10.0 , label_Rgamma);
- }
- switch (code = param_read_float(plist, (param_name = "GreenGamma"),
- &ppdev->greenGamma)) {
- CHECK_PARAM_CASES(ppdev->greenGamma >= 0.0 &&
- ppdev->greenGamma <= 10.0 , label_Ggamma);
- }
- switch (code = param_read_float(plist, (param_name = "BlueGamma"),
- &ppdev->blueGamma)) {
- CHECK_PARAM_CASES(ppdev->blueGamma >= 0.0 &&
- ppdev->blueGamma <= 10.0 , label_Bgamma);
- }
- if (ecode < 0) return ecode;
-
- return gdev_prn_put_params(pdev, plist);
-#undef ppdev
-}
-
-private int
-bjc_print_page_mono(gx_device_printer * pdev, FILE * file)
-{
-#define ppdev ((gx_device_bjc_printer *) pdev)
-#define prdev ((gx_device_printer *) pdev)
-
- uint raster = gdev_prn_raster(pdev);
- uint cmplen;
- byte *row = gs_alloc_bytes(pdev->memory, raster, "bjc mono file buffer");
- byte *cmp = gs_alloc_bytes(pdev->memory, (raster << 1) + 1,
- "bjc mono comp buffer"); /*worst case */
- byte *outrow; /* misc variable for send a row */
- int y;
- int skip; /* empty raster lines */
- char color = (ppdev->smooth == true ? 0x12 : /* smooted black */
- ((ppdev->ink & INK_K) ? 0x11: 0x10)); /* black or color */
- char ink = 0x01; /* regular ink type */
- char compress = (ppdev->compress == true ? 0x01 : 0x00); /* compression or not */
- int x_resolution = pdev->HWResolution[0];
- int y_resolution = pdev->HWResolution[1];
- int length = 0/*x71*/, lm = 0/*x01*/, rm = 0/*x01*/, top = 0/*x50*/;
- byte inkc = ppdev->ink;
- byte mask_array[] = { 0xff, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe };
- byte lastmask = mask_array[pdev->width % 8];
-
- if (row == 0 || cmp == 0) /* can't allocate row buffer */
- return_error(gs_error_VMerror);
-
- /* Write the setup data. */
-
- bjc_put_set_initial (file); /* start printing */
- bjc_put_print_method(file, color, media_codes[ppdev->mediaType].c, ppdev->quality, 0);
- bjc_put_media_supply(file, ppdev->feeder, media_codes[ppdev->mediaType].l);
- bjc_put_raster_resolution(file, x_resolution, y_resolution);
- bjc_put_page_margins(file, length, lm, rm, top);
- bjc_put_set_compression(file, compress);
- bjc_put_image_format(file, 0, 0, ink); /* normal ink */
-
-
- /* Write the contents of the image. */
- skip = 0;
- for (y = 0; y < pdev->height ; y++) {
- gdev_prn_copy_scan_lines(pdev, y, row, raster);
- if (bjc_invert_bytes(row, raster, ppdev->inverse, lastmask)) /* black -> K and check empty line*/
- { /* empty line raster */
- if (skip) bjc_put_raster_skip(file, skip);
- skip = 1;
- if(compress) cmplen = bjc_compress(row, raster, cmp), outrow = cmp;
- else outrow = row, cmplen = raster; /* compress or not */
- if(inkc & INK_K) bjc_put_cmyk_image(file, CMYK_K, outrow, cmplen),
- bjc_put_CR(file);
- if(inkc & INK_C) bjc_put_cmyk_image(file, CMYK_C, outrow, cmplen),
- bjc_put_CR(file);
- if(inkc & INK_M) bjc_put_cmyk_image(file, CMYK_M, outrow, cmplen),
- bjc_put_CR(file);
- if(inkc & INK_Y) bjc_put_cmyk_image(file, CMYK_Y, outrow, cmplen),
- bjc_put_CR(file); /* use the needed ink(s) */
- }
- else skip++; /* +1 empty line */
- }
- if (skip) bjc_put_raster_skip(file, skip);
- bjc_put_FF(file); /* eject a page */
- bjc_put_initialize (file);
-
- gs_free_object(pdev->memory, cmp, "bjc mono comp buffer");
- gs_free_object(pdev->memory, row, "bjc mono file buffer");
-
- return 0;
-
-#undef ppdev
-}
-
-private int
-bjc_print_page_gray(gx_device_printer * pdev, FILE * file)
-{
-#define ppdev ((gx_device_bjc_printer *) pdev)
-#define prdev ((gx_device_printer *) pdev)
-
- uint width = pdev->width; /* Because grayscale */
- uint raster = (pdev->width >> 3) + ( (pdev->width % 8) ? 1:0);
- uint cmplen;
- byte *row = gs_alloc_bytes(pdev->memory, width, "bjc gray file buffer");
- byte *dit = gs_alloc_bytes(pdev->memory, raster, "bjc gray dither buffer");
- byte *cmp = gs_alloc_bytes(pdev->memory, (raster << 1) + 1,
- "bjc gray comp buffer"); /*worst case */
- byte *out; /* misc variable for send a row */
- int y;
- int skip; /* empty raster lines */
- char color = (ppdev->smooth == true ? 0x12 : /* smooted black */
- ((ppdev->ink & INK_K) ? 0x11: 0x10)); /* black or color */
- char ink = 0x01; /* regular ink type */
- char compress = (ppdev->compress == true ? 0x01 : 0x00); /* compression or not */
- int x_resolution = pdev->HWResolution[0];
- int y_resolution = pdev->HWResolution[1];
- int length = 0/*x71*/, lm = 0/*x01*/, rm = 0/*x01*/, top = 0/*x50*/;
- byte inkc = ppdev->ink;
- byte mask_array[] = { 0xff, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe };
- byte lastmask = mask_array[pdev->width % 8];
-
- if (row == 0 || cmp == 0 ||
- dit == 0 ) /* can't allocate row buffers */
- return_error(gs_error_VMerror);
-
- /* Write the setup data. */
-
- bjc_build_gamma_table(ppdev->gamma, CMYK_K); /* set up the gamma table */
-
- bjc_put_set_initial (file); /* start printing */
- bjc_put_print_method(file, color, media_codes[ppdev->mediaType].c, ppdev->quality, 0);
- bjc_put_media_supply(file, ppdev->feeder, media_codes[ppdev->mediaType].l);
- bjc_put_raster_resolution(file, x_resolution, y_resolution);
- bjc_put_page_margins(file, length, lm, rm, top);
- bjc_put_set_compression(file, compress);
- bjc_put_image_format(file, 0, 0, ink); /* normal ink */
-
-
- /* Write the contents of the image. */
- skip = 0;
- if(FloydSteinbergInitG(pdev) == -1)
- return_error(gs_error_VMerror); /* initiate the dithering */
-
- for (y = 0; y < pdev->height ; y++) {
- gdev_prn_copy_scan_lines(pdev, y, row, width); /* image -> row */
- FloydSteinbergDitheringG(row, dit, width, raster, ppdev->limit); /* gray */
- if (bjc_invert_bytes(dit, raster, ppdev->inverse, lastmask)) /* black -> K and check empty line*/
- { /* end of empty lines */
- if (skip) bjc_put_raster_skip(file, skip);
- skip = 1;
-
- if(compress) cmplen = bjc_compress(dit, raster, cmp), out = cmp;
- else cmplen = raster, out = dit; /* compress or not */
-
- if(inkc & INK_K) bjc_put_cmyk_image(file, CMYK_K, out, cmplen),
- bjc_put_CR(file);
- if(inkc & INK_C) bjc_put_cmyk_image(file, CMYK_C, out, cmplen),
- bjc_put_CR(file);
- if(inkc & INK_M) bjc_put_cmyk_image(file, CMYK_M, out, cmplen),
- bjc_put_CR(file);
- if(inkc & INK_Y) bjc_put_cmyk_image(file, CMYK_Y, out, cmplen),
- bjc_put_CR(file); /* use the needed ink(s) */
-
- } else skip++; /* +1 empty line */
- }
- if (skip) bjc_put_raster_skip(file, skip);
- bjc_put_FF(file); /* eject a page */
- bjc_put_initialize (file);
-
- FloydSteinbergCloseG(pdev);
- gs_free_object(pdev->memory, dit, "bjc gray dither buffer");
- gs_free_object(pdev->memory, cmp, "bjc gray comp buffer");
- gs_free_object(pdev->memory, row, "bjc gray file buffer");
-
- return 0;
-
-#undef ppdev
-}
-
-private int
-bjc_print_page_cmyk(gx_device_printer * pdev, FILE * file)
-{
-#define ppdev ((gx_device_bjc_printer *) pdev)
-#define prdev ((gx_device_printer *) pdev)
-
- uint raster = bitmap_raster(pdev->width);
- uint a_raster; /* a tmp variable */
- uint cmplen;
- byte *row = gs_alloc_bytes(pdev->memory, raster*4,
- "bjc cmyk file buffer"); /* one for each component */
- byte *cmp = gs_alloc_bytes(pdev->memory, (raster << 1) + 1,
- "bjc cmyk comp buffer"); /*worst case */
- byte *rows[4];
- byte *outrow; /* misc variable for send a row */
- int y;
- int skip; /* empty raster lines */
- char color = 0x10; /* color */
- char ink = 0x01; /* regular ink type */
- char compress = (ppdev->compress == true ? 0x01 : 0x00); /* compression or not */
- char skip_x;
- int x_resolution = pdev->HWResolution[0];
- int y_resolution = pdev->HWResolution[1];
- int length = 0/*x71*/, lm = 0/*x01*/, rm = 0/*x01*/, top = 0/*x50*/;
- int plane;
- byte mask_array[] = { 0xff, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe };
- byte lastmask = mask_array[pdev->width % 8];
- skip_t skipc;
- byte inkc = ppdev->ink;
- bool inverse = ppdev->inverse;
- gx_render_plane_t render_plane;
-
- if (row == 0 || cmp == 0) /* can't allocate row buffer */
- return_error(gs_error_VMerror);
-
- /* Write the setup data. */
-
- bjc_put_set_initial (file); /* start printing */
- bjc_put_print_method(file, color, media_codes[ppdev->mediaType].c, ppdev->quality, 0);
- bjc_put_media_supply(file, ppdev->feeder, media_codes[ppdev->mediaType].l);
- bjc_put_raster_resolution(file, x_resolution, y_resolution);
- bjc_put_page_margins(file, length, lm, rm, top);
- bjc_put_set_compression(file, compress);
- bjc_put_image_format(file, 0, 0, ink); /* normal ink */
-
-
- /* Write the contents of the image. */
- skip = 0;
-
- for (y = 0; y < pdev->height ; y++) {
-
- skip_x = 0;
- for (plane = 0; plane < 4; plane++) { /* print each color component */
- gx_render_plane_init(&render_plane, (gx_device *)pdev, plane);
- gdev_prn_get_lines(pdev, y, 1, row + raster*plane, raster,
- &rows[plane], &a_raster, &render_plane);
- }
-
- {
- int i;
- byte *byteC=rows[0], *byteM=rows[1],
- *byteY=rows[2], *byteK=rows[3];
- for(i=0; i<raster; i++, byteC++, byteM++, byteY++, byteK++) {
- if (ppdev->compose) {
- *byteK = *byteC & *byteM & *byteY;
- *byteC &= ~(*byteK);
- *byteM &= ~(*byteK);
- *byteY &= ~(*byteK);
- }
- else {
- *byteC |= *byteK;
- *byteM |= *byteK;
- *byteY |= *byteK;
- *byteK = 0;
- }
- }
- }
-
- if(bjc_invert_cmyk_bytes(rows[0], rows[1], rows[2], rows[3],
- raster, inverse, lastmask, &skipc)) {
-
- if (skip) bjc_put_raster_skip(file, skip);
- skip = 1;
- if(skipc.skipC && (inkc & INK_C)) {
- if(compress) cmplen = bjc_compress(rows[0], raster, cmp), outrow = cmp;
- else outrow = rows[0], cmplen = raster; /* compress or not */
- bjc_put_cmyk_image(file, CMYK_C, outrow, cmplen), bjc_put_CR(file);
- }
- if(skipc.skipM && (inkc & INK_M)) {
- if(compress) cmplen = bjc_compress(rows[1], raster, cmp), outrow = cmp;
- else outrow = rows[1], cmplen = raster; /* compress or not */
- bjc_put_cmyk_image(file, CMYK_M, outrow, cmplen), bjc_put_CR(file);
- }
- if(skipc.skipY && (inkc & INK_Y)) {
- if(compress) cmplen = bjc_compress(rows[2], raster, cmp), outrow = cmp;
- else outrow = rows[2], cmplen = raster; /* compress or not */
- bjc_put_cmyk_image(file, CMYK_Y, outrow, cmplen), bjc_put_CR(file);
- }
- if(skipc.skipK && (inkc & INK_K)) {
- if(compress) cmplen = bjc_compress(rows[3], raster, cmp), outrow = cmp;
- else outrow = rows[3], cmplen = raster; /* compress or not */
- bjc_put_cmyk_image(file, CMYK_K, outrow, cmplen), bjc_put_CR(file);
- }
- }
- else skip++; /* +1 empty line */
- }
-
- if (skip) bjc_put_raster_skip(file, skip);
- bjc_put_FF(file); /* eject a page */
- bjc_put_initialize (file);
-
- gs_free_object(pdev->memory, cmp, "bjc cmyk comp buffer");
- gs_free_object(pdev->memory, row, "bjc cmyk file buffer");
-
- return 0;
-
-#undef ppdev
-}
-
-private int
-bjc_print_page_color(gx_device_printer * pdev, FILE * file)
-{
-#define ppdev ((gx_device_bjc_printer *) pdev)
-#define prdev ((gx_device_printer *) pdev)
-
- uint width = pdev->width; /* Because grayscale */
- uint raster = (pdev->width >> 3) + ( (pdev->width % 8) ? 1:0);
- uint cmplen;
- byte *row = gs_alloc_bytes(pdev->memory, width*4,
- "bjc true file buffer"); /* one for each component */
- byte *dit = gs_alloc_bytes(pdev->memory, raster*4,
- "bjc true dither buffer");
- byte *cmp = gs_alloc_bytes(pdev->memory, (raster << 1) + 1,
- "bjc true comp buffer"); /*worst case */
- byte *rowC = dit; /*C*/
- byte *rowM = dit + raster; /*M*/
- byte *rowY = dit + 2*raster; /*Y*/
- byte *rowK = dit + 3*raster; /*K*/
- byte *outrow; /* misc variable for send a row */
- int y;
- int skip; /* empty raster lines */
- char color = 0x10; /* color */
- char ink = 0x01; /* regular ink type */
- char compress = (ppdev->compress == true ? 0x01 : 0x00); /* compression or not */
- int x_resolution = pdev->HWResolution[0];
- int y_resolution = pdev->HWResolution[1];
- int length = 0/*x71*/, lm = 0/*x01*/, rm = 0/*x01*/, top = 0/*x50*/;
- byte mask_array[] = { 0xff, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe };
- byte lastmask = mask_array[pdev->width % 8];
- skip_t skipc;
- byte inkc = ppdev->ink;
- float rgamma = ppdev->gamma != 1.0 ? ppdev->gamma:ppdev->redGamma;
- float ggamma = ppdev->gamma != 1.0 ? ppdev->gamma:ppdev->greenGamma;
- float bgamma = ppdev->gamma != 1.0 ? ppdev->gamma:ppdev->blueGamma;
-
- if (row == 0 || cmp == 0 || dit == 0) /* can't allocate row buffer */
- return_error(gs_error_VMerror);
-
- bjc_build_gamma_table(rgamma, CMYK_C); /* set up the gamma table */
- bjc_build_gamma_table(ggamma, CMYK_M); /* set up the gamma table */
- bjc_build_gamma_table(bgamma, CMYK_Y); /* set up the gamma table */
-
- /* Write the setup data. */
-
- bjc_put_set_initial (file); /* start printing */
- bjc_put_print_method(file, color, media_codes[ppdev->mediaType].c, ppdev->quality, 0);
- bjc_put_media_supply(file, ppdev->feeder, media_codes[ppdev->mediaType].l);
- bjc_put_raster_resolution(file, x_resolution, y_resolution);
- bjc_put_page_margins(file, length, lm, rm, top);
- bjc_put_set_compression(file, compress);
- bjc_put_image_format(file, 0, 0, ink); /* normal ink */
-
-
- /* Write the contents of the image. */
- skip = 0;
-
- if(FloydSteinbergInitC(pdev) == -1)
- return_error(gs_error_VMerror); /* initiate the dithering */
-
- for (y = 0; y < pdev->height ; y++) {
- gdev_prn_copy_scan_lines(pdev, y, row, gdev_prn_raster(pdev));
- /* image -> row */
- FloydSteinbergDitheringC(row, dit, width, raster, ppdev->limit,
- ppdev->compose);
-
- if(bjc_invert_cmyk_bytes(rowC, rowM, rowY, rowK,
- raster, ~ppdev->inverse, lastmask,
- &skipc)) {
- if (skip) bjc_put_raster_skip(file, skip);
- skip = 1;
- if(skipc.skipC && (inkc & INK_C) ) {
- if(compress) cmplen = bjc_compress(rowC, raster, cmp), outrow = cmp;
- else outrow = rowC, cmplen = raster; /* compress or not */
- bjc_put_cmyk_image(file, CMYK_C, outrow, cmplen), bjc_put_CR(file);
- }
- if(skipc.skipM && (inkc & INK_M) ) {
- if(compress) cmplen = bjc_compress(rowM, raster, cmp), outrow = cmp;
- else outrow = rowM, cmplen = raster; /* compress or not */
- bjc_put_cmyk_image(file, CMYK_M, outrow, cmplen), bjc_put_CR(file);
- }
- if(skipc.skipY && (inkc & INK_Y) ) {
- if(compress) cmplen = bjc_compress(rowY, raster, cmp), outrow = cmp;
- else outrow = rowY, cmplen = raster; /* compress or not */
- bjc_put_cmyk_image(file, CMYK_Y, outrow, cmplen), bjc_put_CR(file);
- }
- if(skipc.skipK && (inkc & INK_K) ) {
- if(compress) cmplen = bjc_compress(rowK, raster, cmp), outrow = cmp;
- else outrow = rowK, cmplen = raster; /* compress or not */
- bjc_put_cmyk_image(file, CMYK_K, outrow, cmplen), bjc_put_CR(file);
- }
- }
- else skip++; /* +1 empty line */
- }
-
- if (skip) bjc_put_raster_skip(file, skip);
- bjc_put_FF(file); /* eject a page */
- bjc_put_initialize (file);
-
- FloydSteinbergCloseC(pdev);
- gs_free_object(pdev->memory, cmp, "bjc true comp buffer");
- gs_free_object(pdev->memory, dit, "bjc true dither buffer");
- gs_free_object(pdev->memory, row, "bjc true file buffer");
-
- return 0;
-
-#undef ppdev
-}
diff --git a/gs/contrib/gdevbjc_.h b/gs/contrib/gdevbjc_.h
deleted file mode 100644
index d61a94a5d..000000000
--- a/gs/contrib/gdevbjc_.h
+++ /dev/null
@@ -1,230 +0,0 @@
-/* BJC-210/240/250/265/1000 Bubble Jet Printer driver for GhostScript
- * header file
- *
- * Copyright 2000, 2001, 2002 Gergely Szász (Gergely Sza'sz)
- * mailto://szaszg@hu.inter.net http://bjc250gs.sourceforge.net
- *
- * This program may be distributed and/or modified under the terms of
- * the GNU General Public License as published by the Free Software
- * Foundation (the "GPL"); either version 2 of the GPL, or (at your option)
- * any later version.
- *
- * When distributed under the terms of the GPL, this program is distributed
- * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
- * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GPL for more details.
- *
- * If this program is being distributed under the terms of the GPL, you
- * should have received a copy of the GPL along with this program, normally
- * in a plain ASCII text file named COPYING; if not, write to the Free
- * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111
- * U.S.A.
- */
-
-/* Copyright (C) 1989, 2000 Aladdin Enterprises. All rights reserved.
-
- This program may also be distributed as part of AFPL Ghostscript, under the
- terms of the Aladdin Free Public License (the "License").
-
- AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND. No
- author or distributor accepts any responsibility for the consequences of
- using it, or for whether it serves any particular purpose or works at
- all, unless he or she says so in writing. Refer to the License for full
- details.
-
- Every copy of AFPL Ghostscript must include a copy of the License,
- normally in a plain ASCII text file named PUBLIC. The License grants you
- the right to copy, modify and redistribute AFPL Ghostscript, but only
- under certain conditions described in the License. Among other things,
- the License requires that the copyright notice and this notice be
- preserved on all copies.
-*/
-
-/* BJC printer drivers definitions and utility interfaces */
-
-#ifndef gdevbjc_INCLUDED
-# define gdevbjc_INCLUDED
-
-/* Define the default X and Y resolution. */
-#define X_DPI 360
-#define Y_DPI 360
-
-#define CMYK_K 'K'
-#define CMYK_C 'C'
-#define CMYK_M 'M'
-#define CMYK_Y 'Y'
-
-#define INK_K 8
-#define INK_C 1
-#define INK_M 2
-#define INK_Y 4
-
-typedef struct {
- gs_param_string p_string;
- int p_value;
-} stringParamDescription;
-
-/* Definitions of device parameters */
-struct skip_s {
- bool skipC;
- bool skipM;
- bool skipY;
- bool skipK;
-};
-
-typedef struct skip_s skip_t;
-
-typedef struct {
- unsigned char l;
- unsigned char c;
-} media_t;
-
-struct gx_device_bjc_printer_s {
- gx_device_common;
- gx_prn_device_common;
- int printerType; /* BJC-250, BJC-250ex, BJC1000, ... */
- int feeder; /* Needed paper feeder */
- int mediaType; /* paper type */
- int quality;
- int ink;
- int rnd;
- bool inverse;
- bool compress;
- bool smooth;
- bool limit; /* paper color correction limit check */
- bool compose; /* color K decomposition */
- float gamma;
- float redGamma;
- float greenGamma;
- float blueGamma;
- struct {
- int red;
- int green;
- int blue;
- } paperColor; /* paper color for color correction */
-};
-
-typedef struct gx_device_bjc_printer_s gx_device_bjc_printer;
-
-#define bjc_device_margins_body(dtype, procs, dname, w10, h10, xdpi, ydpi, lo, to, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_page)\
- std_device_full_body_type(dtype, &procs, dname, &st_device_printer,\
- (int)((long)(w10) * (xdpi) / 10),\
- (int)((long)(h10) * (ydpi) / 10),\
- xdpi, ydpi,\
- ncomp, depth, mg, mc, dg, dc,\
- -(lo) * (xdpi), -(to) * (ydpi),\
- (lm) * 72.0, (bm) * 72.0,\
- (rm) * 72.0, (tm) * 72.0\
- ),\
- prn_device_body_rest_(print_page)
-
-#define bjc_device_margins(procs, dname, w10, h10, xdpi, ydpi, lo, to, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_page, def_ink)\
-{ bjc_device_margins_body(gx_device_bjc_printer, procs, dname,\
- w10, h10, xdpi, ydpi, lo, to, lm, bm, rm, tm, \
- ncomp, depth, mg, mc, dg, dc, print_page),\
- (int) 0, /* def, printer: BJC250 */ \
- (int) 0x10, /* Auto Feeder */ \
- (int) 0, /* Plain paper */ \
- (int) 0, /* Normal quality */ \
- (int) def_ink, /* Black monochrome ink */ \
- (int) 15, /* Randomness is 15% */ \
- (bool) false, /* Normal printing */ \
- (bool) true, /* Use compression */ \
- (bool) false, /* no smoothing */ \
- (bool) false, /* no limit check */ \
- (bool) true, /* yes we run decomp */ \
- (float) 1.0, /* initiaal gamma */ \
- (float) 1.0, /* initiaal gamma */ \
- (float) 1.0, /* initiaal gamma */ \
- (float) 1.0, /* initiaal gamma */ \
- { (int) 255, /* White paper */ \
- (int) 255, /* */ \
- (int) 255 } /* */ \
-};
-
-
-#define bjc_device(procs, dname, w10, h10, xdpi, ydpi, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_page, def_ink)\
- bjc_device_margins(procs, dname, w10, h10, xdpi, ydpi,\
- lm, tm, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_page, def_ink)
-
-
-#define bjc_cmyk_param_procs(v_prn_open, v_prn_output_page, v_prn_close, \
- p_map_color_rgb, p_map_cmyk_color, \
- v_prn_get_params, v_prn_put_params)\
- {v_prn_open, NULL, NULL, v_prn_output_page, v_prn_close,\
- NULL, p_map_color_rgb, NULL, NULL, NULL, NULL, NULL, NULL,\
- v_prn_get_params, v_prn_put_params,\
- p_map_cmyk_color, NULL, NULL, NULL, gx_page_device_get_page_device}
-
-
-/* There are the definitions of commands for the Canon BJC printers. */
-
-#define BJC_BJL_CLEANING 0x00 /* "@Cleaning=1\n" */
-#define BJC_BJL_POWER_OFF 0x01 /* "@PowerOff\n" */
-#define BJC_BJL_ROCLEANING 0x02 /* "@RollerCleaning\n" */
-#define BJC_BJL_NOZZLECHK 0x03 /* "@TestPrint=NozzleCheck\n" */
-#define BJC_BJL_TESTA 0x04 /* "@TestPrint=A\012" */
-#define BJC_BJL_TESTB 0x05 /* "@TestPrint=B\012" */
-#define BJC_BJL_TESTC 0x06 /* "@TestPrint=A\012" */
-#define BJC_BJL_DEMO 0x07 /* "@TestPrint=DemoPrint\012" */
-
-#define BJC_BJL_ON_ENABLE 0x20 /* "AutoPowerOn=Enable\n" */
-#define BJC_BJL_ON_DISABLE 0x21 /* "AutoPowerOn=Disable\n" */
-#define BJC_BJL_OFF_1MIN 0x22 /* "AutoPowerOff=1\n" */
-#define BJC_BJL_OFF_10MIN 0x23 /* "AutoPowerOff=10\n" */
-#define BJC_BJL_OFF_30MIN 0x24 /* "AutoPowerOff=30\n" */
-#define BJC_BJL_OFF_60MIN 0x25 /* "AutoPowerOff=60\n" */
-#define BJC_BJL_OFF_DISABLE 0x26 /* "AutoPowerOff=Disable\n" */
-
-typedef struct {
- const char *string;
- int numeric;
- int length; } BJL_command;
-
-/* Put a BJL command to stream */
-
-void bjc_put_bjl_command(FILE * file, int bjl_command);
-
-void bjc_put_LF(FILE *file);
-void bjc_put_FF(FILE *file);
-void bjc_put_CR(FILE *file);
-void bjc_put_initialize(FILE *file);
-void bjc_put_set_initial(FILE *file);
-void bjc_put_set_compression(FILE *file, char compression);
-void bjc_put_print_method_short(FILE *file, char color);
-void bjc_put_print_method(FILE *file, char color, char media, char quality, char density);
-void bjc_put_raster_resolution(FILE *file, int x_resolution, int y_resolution);
-void bjc_put_raster_skip(FILE *file, int skip);
-void bjc_put_page_margins(FILE *file, int length, int lm, int rm, int top);
-void bjc_put_media_supply(FILE *file, char supply, char type);
-void bjc_put_cmyk_image(FILE *file, char component, const char *data, int count);
-void bjc_put_move_lines(FILE *file, int lines);
-void bjc_put_move_lines_unit(FILE *file, int unit);
-void bjc_put_extended_margins(FILE *file, int length, int lm, int rm, int top);
-void bjc_put_image_format(FILE *file, char depth, char format, char ink);
-void bjc_put_page_id(FILE *file, int id);
-void bjc_put_continue_image(FILE *file, const char *data, int count);
-void bjc_put_indexed_image(FILE *file, int dot_rows, int dot_cols, int layers);
-
-bool bjc_invert_bytes(byte *row, uint raster, bool inverse, byte lastmask);
-bool bjc_invert_cmyk_bytes(byte *rowC,byte *rowM, byte *rowY, byte *rowK, uint raster,
- bool inverse, byte lastmask, skip_t *skip);
-uint bjc_compress(const byte *row, uint raster, byte *compressed);
-
-int FloydSteinbergInitG(gx_device_printer * pdev);
-void FloydSteinbergDitheringG(byte *row, byte *dithered, uint width, uint raster, bool limit_extr);
-void FloydSteinbergCloseG(gx_device_printer *pdev);
-
-int FloydSteinbergForwardCut(int error, int *Errors, int i, byte *dithered, byte bitmask);
-int FloydSteinbergBckwardCut(int error, int *Errors, int i, byte *dithered, byte bitmask);
-int FloydSteinbergInitC(gx_device_printer * pdev);
-void FloydSteinbergDitheringC(byte *row, byte *dithered, uint width, uint raster,
- bool limit_extr, bool composeK);
-void FloydSteinbergCloseC(gx_device_printer *pdev);
-
-void bjc_build_gamma_table(float gamma, char color);
-void bjc_rgb_to_cmy (byte r, byte g, byte b, int *c, int *m, int *y);
-void bjc_rgb_to_gray(byte r, byte g, byte b, int *k);
-uint bjc_rand(void);
-void bjc_init_tresh(int rnd);
-#endif /* gdevbjc_INCLUDED */
diff --git a/gs/contrib/gdevbjca.c b/gs/contrib/gdevbjca.c
deleted file mode 100644
index 0aa010520..000000000
--- a/gs/contrib/gdevbjca.c
+++ /dev/null
@@ -1,875 +0,0 @@
-/* BJC-210/240/250/265/1000 Bubble Jet Printer driver for GhostScript
- * utility subroutines and dithering code
- *
- * Copyright 2000, 2001, 2002 Gergely Szász (Gergely Sza'sz)
- * mailto://szaszg@hu.inter.net http://bjc250gs.sourceforge.net
- *
- * This program may be distributed and/or modified under the terms of
- * the GNU General Public License as published by the Free Software
- * Foundation (the "GPL"); either version 2 of the GPL, or (at your option)
- * any later version.
- *
- * When distributed under the terms of the GPL, this program is distributed
- * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
- * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GPL for more details.
- *
- * If this program is being distributed under the terms of the GPL, you
- * should have received a copy of the GPL along with this program, normally
- * in a plain ASCII text file named COPYING; if not, write to the Free
- * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111
- * U.S.A.
- */
-
-/* Copyright (C) 1989, 2000 Aladdin Enterprises. All rights reserved.
-
- This program may also be distributed as part of AFPL Ghostscript, under the
- terms of the Aladdin Free Public License (the "License").
-
- AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND. No
- author or distributor accepts any responsibility for the consequences of
- using it, or for whether it serves any particular purpose or works at
- all, unless he or she says so in writing. Refer to the License for full
- details.
-
- Every copy of AFPL Ghostscript must include a copy of the License,
- normally in a plain ASCII text file named PUBLIC. The License grants you
- the right to copy, modify and redistribute AFPL Ghostscript, but only
- under certain conditions described in the License. Among other things,
- the License requires that the copyright notice and this notice be
- preserved on all copies.
-*/
-
-/* BJC printer drivers utilities */
-#include "gdevprn.h"
-#include "gdevbjc_.h"
-#include <math.h>
-#include <time.h>
-
-private void bjc_put_bytes(FILE *file, const char *data, int count);
-private void bjc_put_hi_lo(FILE *file, int value);
-private void bjc_put_lo_hi(FILE *file, int value);
-private void bjc_put_command(FILE *file, char command, int count);
-
-/* ---------------- Utilities ---------------- */
-
-private void
-bjc_put_bytes(FILE *file, const char *data, int count)
-{
-
- fwrite(data, count, 1, file);
-}
-
-private void
-bjc_put_hi_lo(FILE *file, int value)
-{
- fputc(((value & 0xffff) >> 8), file);
- fputc(value & 0xff, file);
-}
-
-private void
-bjc_put_lo_hi(FILE *file, int value)
-{
- fputc(value & 0xff, file);
- fputc(((value & 0xffff) >> 8), file);
-}
-
-private void
-bjc_put_command(FILE *file, char command, int count)
-{ char tmp[3] = { '\033', '(', ' '};
- tmp[2] = command;
- fwrite( tmp, 3, 1, file);
- bjc_put_lo_hi(file, count);
-}
-
-/* ---------------- Commands ---------------- */
-
-/* Line feed (^J) */
-void
-bjc_put_LF(FILE *file)
-{
- fputc(0x0a, file);
-}
-
-/* Form feed (^L) */
-void
-bjc_put_FF(FILE *file)
-{
- fputc(0x0c, file);
-}
-
-/* Carriage return (^M) */
-void
-bjc_put_CR(FILE *file)
-{
- fputc(0x0d, file);
-}
-
-/* Return to initial condition (ESC @) */
-void
-bjc_put_initialize(FILE *file)
-{
- bjc_put_bytes(file, "\033@", 2);
-}
-
-/* Set initial condition (ESC [ K <count> <init> <id> <parm1> <parm2>) */
-void
-bjc_put_set_initial(FILE *file)
-{
- bjc_put_bytes(file, "\033[K\002\000\000\017", 7);
-}
-
-/* Set data compression (ESC [ b <count> <state>) */
-void
-bjc_put_set_compression(FILE *file, char compression)
-{
- bjc_put_command(file, 'b', 1);
- fputc(compression, file);
-}
-
-/* Select print method (ESC ( c <count> <parm1> <parm2> [<parm3>]) */
-void
-bjc_put_print_method_short(FILE *file, char color)
-{
- bjc_put_command(file, 'c', 1);
- fputc(color, file);
-}
-void
-bjc_put_print_method(FILE *file, char color, char media, char quality,
- char density)
-{
- bjc_put_command(file, 'c', 2 + (density != 0));
- fputc(color, file);
- fputc(media | quality, file);
- if (density)
- fputc(density, file);
-}
-
-/* Set raster resolution (ESC ( d <count> <y_res> [<x_res>]) */
-void
-bjc_put_raster_resolution(FILE *file, int x_resolution, int y_resolution)
-{
- if (x_resolution == y_resolution) {
- bjc_put_command(file, 'd', 2);
- } else {
- bjc_put_command(file, 'd', 4);
- bjc_put_hi_lo(file, y_resolution);
- }
- bjc_put_hi_lo(file, x_resolution);
-}
-
-/* Raster skip (ESC ( e <count> <skip>) */
-void
-bjc_put_raster_skip(FILE *file, int skip)
-{
- bjc_put_command(file, 'e', 2);
- bjc_put_hi_lo(file, skip);
-}
-
-/* Set page margins (ESC ( g <count> <length> <lm> <rm> <top>) */
-void
-bjc_put_page_margins(FILE *file, int length, int lm, int rm, int top)
-{
- char parms[4];
-
- parms[0] = length, parms[1] = lm, parms[2] = rm, parms[3] = top;
-/* count = 4; */ /* could be 1..3 */
- bjc_put_command(file, 'g', 4);
- bjc_put_bytes(file, parms, 4);
-}
-
-/* Set media supply method (ESC * l <count> <parm1> <parm2>) */
-void
-bjc_put_media_supply(FILE *file, char supply, char type)
-{
- bjc_put_command(file, 'l', 2);
- fputc(supply, file);
- fputc(type << 4, file);
-}
-
-/* Identify ink cartridge (ESC ( m <count> <type>) */ /*
-void
-bjc_put_identify_cartridge(FILE *file,
- bjc_identify_cartridge_command_t command)
-{
- bjc_put_command(s, 'm', 1);
- spputc(s, command);
-} */
-
-/* CMYK raster image (ESC ( A <count> <color>) */
-void
-bjc_put_cmyk_image(FILE *file, char component,
- const char *data, int count)
-{
- bjc_put_command(file, 'A', count + 1);
- fputc(component, file);
- bjc_put_bytes(file, data, count);
-}
-
-/* Move by raster lines (ESC ( n <count> <lines>) */
-void
-bjc_put_move_lines(FILE *file, int lines)
-{
- bjc_put_command(file, 'n', 2);
- bjc_put_hi_lo(file, lines);
-}
-
-/* Set unit for movement by raster lines (ESC ( o <count> <unit>) */
-void
-bjc_put_move_lines_unit(FILE *file, int unit)
-{
- bjc_put_command(file, 'o', 2);
- bjc_put_hi_lo(file, unit);
-}
-
-/* Set extended margins (ESC ( p <count> <length60ths> <lm60ths> */
-/* <rm60ths> <top60ths>) */
-void
-bjc_put_extended_margins(FILE *file, int length, int lm, int rm, int top)
-{
- bjc_put_command(file, 'p', 8);
- bjc_put_hi_lo(file, length);
- bjc_put_hi_lo(file, lm);
- bjc_put_hi_lo(file, rm);
- bjc_put_hi_lo(file, top);
-}
-
-/* Set image format (ESC ( t <count> <depth> <format> <ink>) */
-void
-bjc_put_image_format(FILE *file, char depth, char format, char ink)
-{
- bjc_put_command(file, 't', 3);
- fputc(depth, file);
- fputc(format, file);
- fputc(ink, file);
-}
-
-/* Page ID (ESC ( q <count> <id>) */
-void
-bjc_put_page_id(FILE *file, int id)
-{
- bjc_put_command(file, 'q', 1);
- fputc(id, file);
-}
-
-/* Continue raster image (ESC ( F <count> <data>) */
-void
-bjc_put_continue_image(FILE *file, const char *data, int count)
-{
- bjc_put_command(file, 'F', count);
- bjc_put_bytes(file, data, count);
-}
-
-/* BJ indexed image (ESC ( f <count> R <dot_rows> <dot_cols> <layers> */
-/* <index>) */
-void
-bjc_put_indexed_image(FILE *file, int dot_rows, int dot_cols, int layers)
-{
- bjc_put_command(file, 'f', 5);
- fputc('R', file); /* per spec */
- fputc(dot_rows, file);
- fputc(dot_cols, file);
- fputc(layers, file);
-}
-
-
-/* ------------------------------------------------------------------ */
-
-/* Invert a raster line ( we need it for Black -> K ) */
-bool
-bjc_invert_bytes(byte *row, uint raster, bool inverse, byte lastmask)
-{ bool ret=false;
-
- for(; raster > 1; row++, raster--) {
- if(!(inverse)) *row = ~(*row);
- if(*row) ret = true;
- }
- if(!(inverse)) *row ^= 0xff;
- *row &= lastmask;
- return ret;
-}
-
-bool
-bjc_invert_cmyk_bytes(byte *rowC, byte *rowM, byte *rowY, byte *rowK,
- uint raster, bool inverse, byte lastmask,
- skip_t *skip)
-{ bool ret=false;
- byte tmpC, tmpM, tmpY;
-
- skip->skipC=false;
- skip->skipM=false;
- skip->skipY=false;
- skip->skipK=false;
-
- for(; raster > 1; rowC++, rowM++, rowY++, rowK++, raster--) {
- if(inverse) {
- tmpC = ~(*rowC|*rowK);
- tmpM = ~(*rowM|*rowK);
- tmpY = ~(*rowY|*rowK);
- *rowK = ~(*rowC|*rowM|*rowY|*rowK);
- *rowC = tmpC;
- *rowM = tmpM;
- *rowY = tmpY;
- }
- if(*rowC) skip->skipC=true;
- if(*rowM) skip->skipM=true;
- if(*rowY) skip->skipY=true;
- if(*rowK) skip->skipK=true;
- if(*rowC|*rowM|*rowY|*rowK) ret = true;
- }
- return ret;
-}
-
-/* "1D runlength compression for BJC-600
- * this code is borrowed from gdevpcl.c:gdev_pcl_mode2compress."
- * I copy it from gdevcdj.c
- * It is return with the compressed length. 'compressed' point to the
- * compression buffer
- */
-uint
-bjc_compress(const byte *row, uint raster, byte *compressed)
-{
- const byte *end_row = row;
- register const byte *exam = row;
- register byte *cptr = compressed; /* output pointer into compressed bytes */
-
- end_row += raster;
-
- while ( exam < end_row ) {
- /* Search ahead in the input looking for a run */
- /* of at least 4 identical bytes. */
- const byte *compr = exam;
- const byte *end_dis;
- const byte *next;
- register byte test, test2;
-
- test = *exam;
- while ( exam < end_row ) {
- test2 = *++exam;
- if ( test == test2 )
- break;
- test = test2;
- }
-
-
- /* Find out how long the run is */
- end_dis = exam - 1;
- if ( exam == end_row ) { /* no run */
- next = --end_row;
- } else {
-
- next = exam + 1;
- while ( next < end_row && *next == test ) next++;
- }
-
-
- /* Now [compr..end_dis) should be encoded as dissimilar, */
- /* and [end_dis..next) should be encoded as similar. */
- /* Note that either of these ranges may be empty. */
-
-
- for ( ; ; ) { /* Encode up to 128 dissimilar bytes */
- uint count = end_dis - compr; /* uint for faster switch */
- switch ( count ) { /* Use memcpy only if it's worthwhile. */
- case 6: cptr[6] = compr[5];
- case 5: cptr[5] = compr[4];
- case 4: cptr[4] = compr[3];
- case 3: cptr[3] = compr[2];
- case 2: cptr[2] = compr[1];
- case 1: cptr[1] = compr[0];
- *cptr = count - 1;
- cptr += count + 1;
- case 0: /* all done */
- break;
- default:
- if ( count > 128 ) count = 128;
- *cptr++ = count - 1;
- memcpy(cptr, compr, count);
- cptr += count, compr += count;
- continue;
- }
- break;
- }
-
-
- { /* Encode up to 128 similar bytes. */
- /* Note that count may be <0 at end of row. */
- int count = next - end_dis;
- if (next < end_row || test != 0)
- while ( count > 0 ) {
-
- int this = (count > 128 ? 128 : count);
- *cptr++ = 257 - this;
- *cptr++ = (byte)test;
- count -= this;
- }
- exam = next;
- }
- }
- return (uint)(cptr - compressed);
-}
-
-void bjc_rgb_to_cmy(byte r, byte g, byte b,
- int *c, int *m, int *y)
-{ *c=255-r;
- *m=255-g;
- *y=255-b;
-}
-
-void bjc_rgb_to_gray(byte r, byte g, byte b,
- int *k)
-{
- *k = ( (int)r * 77 + (int)g * 151 + (int)b * 28) >> 8;
-}
-
-int bjc_gamma_tableC[256];
-int bjc_gamma_tableM[256];
-int bjc_gamma_tableY[256];
-#define bjc_gamma_tableK bjc_gamma_tableC
-
-void bjc_build_gamma_table(float gamma, char color)
-{ int i;
- int *table;
-
- switch(color) {
- case CMYK_C:
- table = bjc_gamma_tableC;
- break;
- case CMYK_M:
- table = bjc_gamma_tableM;
- break;
- case CMYK_Y:
- table = bjc_gamma_tableY;
- break;
- case CMYK_K:
- default:
- table = bjc_gamma_tableK;
- break;
- }
-
- if(gamma == 1.0) for (i = 0; i < 256; i++) table[i] = (255 - i) << 4;
- else for (i = 0; i < 256; i++) table[i] =
- 4080 - (int)(pow((double)i / 255.0, gamma) * 4080.0 + .5);
-}
-
-/* -------------------------------------------------------------------------*/
-/* Subroutines and tables for randomization */
-/* -------------------------------------------------------------------------*/
-
-int bjc_rand_seed[55] = {
-3627, 15177, 6104, 15555, 14210, 9940, 11987, 7070, 6147, 15691, 14536, 12896,
-8959, 14926, 9034, 13544, 13665, 3175, 10177, 14856, 16042, 4265, 13976, 10805,
-14817, 8216, 695, 8656, 9189, 15304, 1469, 9641, 1648, 16218, 12421, 5451,
-255, 11268, 16121, 11645, 1855, 5982, 9983, 1052, 5255, 15264, 6123, 3577,
-9712, 14629, 4593, 15670
-};
-int bjc_j=0, bjc_k=31;
-
-int bjc_treshold[1024];
-
-uint bjc_rand(void)
-{
- uint ret=bjc_rand_seed[bjc_j] = bjc_rand_seed[bjc_j++] +
- bjc_rand_seed[bjc_k++];
- if(bjc_j==55) bjc_j = 0;
- if(bjc_k==55) bjc_k = 0;
- return ret & 0x03ff;
-} /* random numbers 0-1023 */
-
-
-void bjc_init_tresh(int rnd)
-{
- int i=(int)(time(NULL) & 0x0ff);
- float delta=40.64*rnd;
- for(;i>0;i--) bjc_rand();
- for(i=-512; i<512; i++) bjc_treshold[i+512] =
- (int)(delta * i / 1024.0 + 2040);
-} /* init treshold array ~rnd% around halfway (127*16) */
-
-
-/* Declarations for Floyd-Steinberg dithering.
- *
- * Errors are accumulated into the array fserrors[], at a resolution of
- * 1/16th of a pixel count. The error at a given pixel is propagated
- * to its not-yet-processed neighbors using the standard F-S fractions,
- * ... (here) 7/16
- * 3/16 5/16 1/16
- * We work left-to-right on even rows, right-to-left on odd rows.
- *
- * We can get away with a single array (holding one row's worth of errors)
- * by using it to store the current row's errors at pixel columns not yet
- * processed, but the next row's errors at columns already processed. We
- * need only a few extra variables to hold the errors immediately around the
- * current column. (If we are lucky, those variables are in registers, but
- * even if not, they're probably cheaper to access than array elements are.)
- *
- * The fserrors[] array has (#columns + 2) entries; the extra entry at
- * each end saves us from special-casing the first and last pixels.
- * Each entry is three values long, one value for each color component.
- */
-
-bool FloydSteinbergDirectionForward = true;
-
-int *FloydSteinbergErrorsC;
-int *FloydSteinbergErrorsM;
-int *FloydSteinbergErrorsY;
-int *FloydSteinbergErrorsK;
-int *FloydSteinbergErrorsG;
-
-int FloydSteinbergC;
-int FloydSteinbergM;
-int FloydSteinbergY;
-int FloydSteinbergK;
-int FloydSteinbergG;
-
-int
-FloydSteinbergInitG(gx_device_printer * pdev)
-{ int i;
-#define ppdev ((gx_device_bjc_printer *) pdev)
-
-FloydSteinbergErrorsG = (int *) gs_alloc_bytes(pdev->memory,
- sizeof(int)*(pdev->width+3),
- "bjc error buffer");
-if (FloydSteinbergErrorsG == 0) /* can't allocate error buffer */
- return -1;
-FloydSteinbergDirectionForward=true;
-
-for (i=0; i < pdev->width+3; i++) FloydSteinbergErrorsG[i] = 0;
- /* clear */
-bjc_rgb_to_gray(ppdev->paperColor.red,
- ppdev->paperColor.green,
- ppdev->paperColor.blue,
- &FloydSteinbergG);
-FloydSteinbergG = (255 - FloydSteinbergG) << 4; /* Maybe */
-bjc_init_tresh(ppdev->rnd);
-return 0;
-#undef ppdev
-}
-
-void
-FloydSteinbergDitheringG(byte *row, byte *dithered, uint width,
- uint raster, bool limit_extr)
-{
- byte byteG=0, bitmask = 0x80; /* first bit */
- int i;
- int error = 0, delta;
- int err_corr;
- int *err_vect;
-
- if (FloydSteinbergDirectionForward) {
- /* First point */
- err_vect = FloydSteinbergErrorsG + 1;
-
- for( i=width; i>0; i--, row++, err_vect++) { /* i, sample, error */
- err_corr = bjc_gamma_tableK[255-(*row)] + FloydSteinbergG;
- if(err_corr > 4080 && limit_extr) err_corr = 4080;
- error += err_corr + *(err_vect+1); /* the error in 1/16 */
-
- if(error > bjc_treshold[bjc_rand()]) {
- error -= 4080;
- byteG |= bitmask;
- }
-
- *(err_vect+1) = (error + 8) >> 4;
- delta = error << 1; /* 2 err */
- error += delta; /* 3/16 */
- *(err_vect-1) += (error + 8) >> 4;
- error += delta; /* 5/16 */
- *err_vect += (error + 8) >> 4;
- error += delta + 8; /* 7/16 */
- error >>= 4;
-
- if (bitmask == 0x01) {
- *dithered = byteG;
- bitmask = 0x80;
- byteG = 0;
- dithered++;
- }
- else if (i == 1) {
- *dithered = byteG;
- }
- else bitmask >>= 1;
- }
- FloydSteinbergDirectionForward=false;
- }
- else {
- row += width - 1; /* point to the end of the row */
- dithered += raster - 1;
- bitmask = 1 << ((raster << 3 ) - width) ;
- err_vect = FloydSteinbergErrorsG + width + 1;
-
- for( i=width; i>0; i--, row--, err_vect--) {
- err_corr = bjc_gamma_tableK[255-(*row)] + FloydSteinbergG;
- if(err_corr > 4080 && limit_extr) err_corr = 4080;
-
- error += err_corr + *(err_vect - 1);
-
- if(error > bjc_treshold[bjc_rand()]) {
- error -= 4080;
- byteG |= bitmask;
- }
-
- *(err_vect-1) = (error + 8) >> 4; /* 1/16 */
- delta = error << 1; /* 2 err */
- error += delta;
- *(err_vect+1) += (error +8) >> 4; /* 3/16 */
- error += delta;
- *err_vect += (error + 8) >> 4; /* 5/16 */
- error += delta + 8; /* 7/16 */
- error >>= 4;
-
- if (bitmask == 0x80) {
- *dithered = byteG;
- bitmask = 0x01;
- byteG = 0;
- dithered--;
- } else if(i==1) {
- *dithered = byteG;
- }
- else bitmask <<= 1;
- }
- FloydSteinbergDirectionForward=true;
- }
-}
-
-void FloydSteinbergCloseG(gx_device_printer *pdev)
-{
- gs_free_object(pdev->memory, FloydSteinbergErrorsG, "bjc error buffer");
-}
-
-int
-FloydSteinbergInitC(gx_device_printer * pdev)
-{ int i;
-#define ppdev ((gx_device_bjc_printer *) pdev)
-
-FloydSteinbergErrorsC = (int *) gs_alloc_bytes(pdev->memory,
- 3*sizeof(int)*(pdev->width+3),
- "bjc CMY error buffer");
-if (FloydSteinbergErrorsC == 0 ) /* can't allocate error buffer */
- return -1;
-
-for (i=0; i < 3 * (pdev->width+3); i++) FloydSteinbergErrorsC[i] = 0;
-
-FloydSteinbergDirectionForward=true;
-bjc_rgb_to_cmy(ppdev->paperColor.red,
- ppdev->paperColor.green,
- ppdev->paperColor.blue,
- &FloydSteinbergC,
- &FloydSteinbergM,
- &FloydSteinbergY);
-
-FloydSteinbergC <<= 4;
-FloydSteinbergM <<= 4;
-FloydSteinbergY <<= 4;
-bjc_init_tresh(ppdev->rnd);
-return 0;
-#undef ppdev
-}
-
-void
-FloydSteinbergDitheringC(byte *row, byte *dithered, uint width,
- uint raster, bool limit_extr, bool composeK)
-{ byte byteC=0, byteM=0, byteY=0, byteK=0, bitmask = 0x80; /* first bit */
- int i;
- int errorC = 0, errorM = 0, errorY = 0, delta;
- int err_corrC, err_corrM, err_corrY;
- int *err_vect;
-
- if (FloydSteinbergDirectionForward) {
- err_vect = FloydSteinbergErrorsC + 3; /* errCMY */
- /* First point */
-
- for( i=width; i>0; i--, row+=4, err_vect+=3) { /*separate components */
-
-/* C + K */
- err_corrC = bjc_gamma_tableC[ (*row) + (*(row+3))]
- + FloydSteinbergC;
- err_corrM = bjc_gamma_tableM[(*(row+1)) + (*(row+3))]
- + FloydSteinbergM;
- err_corrY = bjc_gamma_tableY[(*(row+2)) + (*(row+3))]
- + FloydSteinbergY;
-
- if(err_corrC > 4080 && limit_extr) err_corrC = 4080;
- if(err_corrM > 4080 && limit_extr) err_corrM = 4080;
- if(err_corrY > 4080 && limit_extr) err_corrY = 4080;
-
- errorC += err_corrC + (*(err_vect + 3)); /* CMYCMYCMY */
- errorM += err_corrM + (*(err_vect + 4)); /* | ^ ! */
- errorY += err_corrY + (*(err_vect + 5));
-
- if(errorC > bjc_treshold[bjc_rand()]) {
- errorC -= 4080;
- byteC |= bitmask;
- }
-
- if(errorM > bjc_treshold[bjc_rand()]) {
- errorM -= 4080;
- byteM |= bitmask;
- }
-
- if(errorY > bjc_treshold[bjc_rand()]) {
- errorY -= 4080;
- byteY |= bitmask;
- }
-
- *(err_vect+3) = (errorC + 8) >> 4; /* 1/16 */
- delta = errorC << 1; /* 2 err */
- errorC += delta;
- *(err_vect-3) += (errorC + 8) >> 4; /* 3/16 */
- errorC += delta;
- *err_vect += (errorC + 8) >> 4; /* 5/16 */
- errorC += delta + 8; /* 7/16 */
- errorC >>= 4;
-
- *(err_vect+4) = (errorM + 8) >> 4; /* 1/16 */
- delta = errorM << 1; /* 2 err */
- errorM += delta;
- *(err_vect-2) += (errorM + 8) >> 4; /* 3/16 */
- errorM += delta;
- *(err_vect+1) += (errorM + 8) >> 4; /* 5/16 */
- errorM += delta + 8; /* 7/16 */
- errorM >>= 4;
-
- *(err_vect+5) = (errorY + 8) >> 4; /* 1/16 */
- delta = errorY << 1; /* 2 err */
- errorY += delta;
- *(err_vect-1) += (errorY + 8) >> 4; /* 3/16 */
- errorY += delta;
- *(err_vect+2) += (errorY + 8) >> 4; /* 5/16 */
- errorY += delta + 8; /* 7/16 */
- errorY >>= 4;
-
- if (bitmask == 0x01) {
- bitmask = 0x80;
- if(composeK) {
- byteK = byteC & byteM & byteY;
- byteC = byteC & ~byteK;
- byteM = byteM & ~byteK;
- byteY = byteY & ~byteK;
- } /* if no K byteK always 0 */
- *dithered = byteC;
- *(dithered+ raster) = byteM;
- *(dithered+2*raster) = byteY;
- *(dithered+3*raster) = byteK;
- byteC = byteM = byteY = byteK = 0;
- dithered++;
- }
- else if(i == 1) {
- if(composeK) {
- byteK = byteC & byteM & byteY;
- byteC = byteC & ~byteK;
- byteM = byteM & ~byteK;
- byteY = byteY & ~byteK;
- } /* if no K byteK always 0 */
- *dithered = byteC;
- *(dithered+ raster) = byteM;
- *(dithered+2*raster) = byteY;
- *(dithered+3*raster) = byteK;
- }
- else bitmask >>= 1;
- }
- FloydSteinbergDirectionForward=false;
- }
- else {
- row += (width << 2) - 4; /* point to the end of the row */
- dithered += raster - 1;
- err_vect = FloydSteinbergErrorsC + 3 * width + 3; /* errCMY */
- bitmask = 1 << ((raster << 3 ) - width) ;
-
- for( i=width; i>0; i--, row-=4, err_vect-=3) {
-
- err_corrC = bjc_gamma_tableC[ (*row) + (*(row+3))]
- + FloydSteinbergC;
- err_corrM = bjc_gamma_tableM[(*(row+1)) + (*(row+3))]
- + FloydSteinbergM;
- err_corrY = bjc_gamma_tableY[(*(row+2)) + (*(row+3))]
- + FloydSteinbergY;
-
- if(err_corrC > 4080 && limit_extr) err_corrC = 4080;
- if(err_corrM > 4080 && limit_extr) err_corrM = 4080;
- if(err_corrY > 4080 && limit_extr) err_corrY = 4080;
-
- errorC += err_corrC + (*(err_vect - 3)); /* CMYCMYCMY */
- errorM += err_corrM + (*(err_vect - 2)); /* ! ^ | */
- errorY += err_corrY + (*(err_vect - 1));
-
- if(errorC > bjc_treshold[bjc_rand()]) {
- errorC -= 4080;
- byteC |= bitmask;
- }
-
- if(errorM > bjc_treshold[bjc_rand()]) {
- errorM -= 4080;
- byteM |= bitmask;
- }
-
- if(errorY > bjc_treshold[bjc_rand()]) {
- errorY -= 4080;
- byteY |= bitmask;
- }
-
- *(err_vect-3) = (errorC + 8) >> 4; /* 1/16 */
- delta = errorC << 1; /* 2 err */
- errorC += delta;
- *(err_vect+3) += (errorC + 8) >> 4; /* 3/16 */
- errorC += delta;
- *err_vect += (errorC + 8) >> 4; /* 5/16 */
- errorC += delta + 8; /* 7/16 */
- errorC >>= 4;
-
- *(err_vect-2) = (errorM + 8) >> 4; /* 1/16 */
- delta = errorM << 1; /* 2 err */
- errorM += delta;
- *(err_vect+4) += (errorM + 8) >> 4; /* 3/16 */
- errorM += delta;
- *(err_vect+1) += (errorM + 8) >> 4; /* 5/16 */
- errorM += delta + 8; /* 7/16 */
- errorM >>= 4;
-
- *(err_vect-1) = (errorY + 8) >> 4; /* 1/16 */
- delta = errorY << 1; /* 2 err */
- errorY += delta;
- *(err_vect+5) += (errorY + 8) >> 4; /* 3/16 */
- errorY += delta;
- *(err_vect+2) += (errorY + 8) >> 4; /* 5/16 */
- errorY += delta + 8; /* 7/16 */
- errorY >>= 4;
-
- if (bitmask == 0x80) {
- bitmask = 0x01;
- if(composeK) {
- byteK = byteC & byteM & byteY;
- byteC = byteC & ~byteK;
- byteM = byteM & ~byteK;
- byteY = byteY & ~byteK;
- } /* if no K byteK always 0 */
- *dithered = byteC;
- *(dithered+ raster) = byteM;
- *(dithered+2*raster) = byteY;
- *(dithered+3*raster) = byteK;
- byteC = byteM = byteY = byteK = 0;
- dithered--;
- }
- else if(i == 1) {
- if(composeK) {
- byteK = byteC & byteM & byteY;
- byteC = byteC & ~byteK;
- byteM = byteM & ~byteK;
- byteY = byteY & ~byteK;
- } /* if no K byteK always 0 */
- *dithered = byteC;
- *(dithered+ raster) = byteM;
- *(dithered+2*raster) = byteY;
- *(dithered+3*raster) = byteK;
- }
- else bitmask <<= 1;
- }
- FloydSteinbergDirectionForward=true;
- }
-}
-
-void FloydSteinbergCloseC(gx_device_printer *pdev)
-{
- gs_free_object(pdev->memory, FloydSteinbergErrorsC,
- "bjc CMY error buffer");
-}
diff --git a/gs/contrib/gdevcd8.c b/gs/contrib/gdevcd8.c
deleted file mode 100644
index 78e114f99..000000000
--- a/gs/contrib/gdevcd8.c
+++ /dev/null
@@ -1,3907 +0,0 @@
-/* $Id: gdevcd8.c,v 1.5 2002/07/30 18:53:21 easysw Exp $ */
-/*
- Copyright (C) 2000 Hewlett-Packard Company
- Portions Copyright (C) 1996-1998 <Uli Wortmann uliw@erdw.ethz.ch>.
- Portions Copyright (C) 1999 Aladdin Enterprises. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- This program may also be distributed as part of Aladdin Ghostscript,
- under the terms of the Aladdin Free Public License (the "License").
-
- Every copy of Aladdin Ghostscript must include a copy of the
- License, normally in a plain ASCII text file named PUBLIC. The
- License grants you the right to copy, modify and redistribute
- Aladdin Ghostscript, but only under certain conditions described in
- the License. Among other things, the License requires that the
- copyright notice and this notice be preserved on all copies.
- */
-
-/* gdevcd8.c */
-
-/*----------------------------------------------------------------
-
- A printer driver for the HP670, HP690, HP850, HP855
- HP870, HP890, HP1100, HP1600 and HP2200 color printers.
- To be used with the Ghostscript printing system.
-
- CREDITS: Much of the driver is based on ideas derived
- from the cdj550 driver of George Cameron.
-
- The support for the hp670, hp690, hp890
- and hp1600 was added by Martin Gerbershagen.
-
- The support for the hp2200 was added by Siow-Kiat Tan.
-
--------------------------------------------------------------------*/
-
-/* Note: Depending on how you transfered the files,
- you might need to remove some CR-codes used on intel-based machines:
-
- simply type: unzip -a hp850.zip
-
- to compile with gs5.x, simply add
-
- DEVICE_DEVS4=cdj850.dev cdj670.dev cdj890.dev cdj1600.dev
-
- to your makefile.
-
- BTW, it is always a good idea to read Make.htm found in the
- gs-distrib before attempting to recompile.....
-
- */
-
-/* 1999-01-07 edited by L. Peter Deutsch <ghost@aladdin.com> to eliminate
- non-const statics and otherwise bring up to date with Ghostscript coding
- style guidelines. */
-
-/* 01.06.98 Version 1.3 Due to the most welcome contribution
- of Martin Gerbershagen (ger@ulm.temic.de),
- support for the hp670, hp690 and hp890
- and hp1600 has been added. Martin has also
- resolved all known bugs.
-
- Problems : Dark colors are still pale.
-
-
- The driver no longer needs special switches to be invoked
- except -sDEVICE=cdj850, or -sDEVICE=CDJ890, or sDEVICE=CDJ670
- or -sDEVICE=CDJ1600
-
- The hp690 is supported through the hp670 device, the hp855, hp870
- and the hp1100 through the hp850 device.
-
- The driver implements the following switches:
-
- -dPapertype= 0 plain paper [default]
- 1 bond paper
- 2 special paper
- 3 glossy film
- 4 transparency film
-
- Note, currently the lookuptables are not suited
- for printing on special paper or transperencies.
- Please revert to the gamma functions in this case.
-
- -dQuality= -1 draft
- 0 normal [default]
- 1 presentation
-
- -dRetStatus= 0 C-RET off
- 1 C-RET on [default]
-
- -dMasterGamma= 3.0 [default = 1.0]
- __Note__: To take advantage of the calibrated color-transfer
- functions, be sure not to have any Gamma-Statements
- left! If you need to (i.e. overhead sheets),
- you still can use the gamma-functions, but they will
- override the built-in calibration. To use gamma in the
- traditional way, set MasterGamma to any value greater
- 1.0 and less 10.0. To adjust individual gamma-values,
- you have to additionally set MasterGamma to a value
- greater 1.0 and less 10.0
-
- With the next release, gamma functions will be dropped.
-
- When using the driver, be aware that printing in 600dpi involves
- processing of large amounts of data (> 188MB !). Therefore, the
- driver is not what you would expect to be a fast driver ;-)
- This is no problem when printing a full sized color page (because
- printing itself is slow), but it's really annoying if yoy print only
- text pages. Maybe I can optimize the code for text-only pages in a
- later release. Right now, it is recommended to use the highest
- possible optimisation level your compiler offers....
- For the time beeing, use the cdj550 device with -sBitsPerPixel=3
- for fast proof-prints. If you simply want to print 600dpi b/w data,
- use the cdj550 device with -sBitsPerPixel=8 (or 1).
-
- Since the printer itself is slow, it may help to set the
- process-priority of the gs-process to regular or even less. On a
- 486/100MHZ this is still sufficient to maintain a continuos
- data-flow.
- Note to OS/2 users: Simply put the gs-window into the background,
- or minimize it. Also make sure, that print01.sys is invoked without
- the /irq switch (great speed improvement under warp4).
-
- The printer default settings compensate for dot-gain by a
- calibrated color-transfer function. If this appears to be to light
- for your business-graphs, or for overhead-sheets, feel free to set
- -dMasterGamma=1.7.
-
- Furthermore, you may tweak the gammavalues independently by setting
- -dGammaValC, -dGammaValM, -dGammaValY or -dGammaValK (if not set,
- the values default to MasterGamma). This will only work, when
- -dMasterGamma is set to a value greater than 1.0.
-
- If you want to learn more about gamma, see:
-
- http://www.erdw.ethz.ch/~bonk/ftp/misc/gammafaq.pdf
- http://www.erdw.ethz.ch/~bonk/ftp/misc/colorfaq.pdf
-
- Further information, bugs, tips etc, can be found
- at my website.
-
- Have fun!
-
- Uli
-
- http://www.erdw.ethz.ch/~bonk/bonk.html
-
- */
-
-/* 25.08.97 Version 1.2. Resolved all but one of the
- known bugs, introduced a couple
- of perfomance improvements. Complete
- new color-transfer-function handling.
- (see gamma). */
-
-/* 04.05.97 Version 1.1. For added features, */
-/* resolved bugs and so forth, please see */
-/* http://bonk.ethz.ch */
-
-/* 11.11.96. Initial release of the driver */
-
-#include "math_.h"
-#include <stdlib.h> /* for rand() */
-#include <assert.h>
-#include "gdevprn.h"
-#include "gdevpcl.h"
-#include "gsparam.h"
-
-#include "gdebug.h"
-#include <string.h>
-
-/* Conversion stuff. */
-#include "gxlum.h"
-
-#define near
-
-/* This holds the initialisation data of the hp850. These are sent to
- * the printer with the Config Raster command (Esc * g # W ...) during
- * printer initialization. See the functions cdj850_start_raster_mode(),
- * cdj880_start_raster_mode(), and cdj1600_start_raster_mode().
- */
-typedef struct hp850_cmyk_init_s {
- byte a[26];
-} hp850_cmyk_init_t;
-private const hp850_cmyk_init_t hp850_cmyk_init =
-{
- {
- 0x02, /* format */
- 0x04, /* number of components */
- /* black */
- 0x01, /* MSB x resolution */
- 0x2c, /* LSB x resolution */
- 0x01, /* MSB y resolution */
- 0x2c, /* LSB y resolution */
- 0x00, /* MSB intensity levels */
- 0x02, /* LSB intensity levels */
-
- /* cyan */
- 0x01, /* MSB x resolution */
- 0x2c, /* LSB x resolution */
- 0x01, /* MSB y resolution */
- 0x2c, /* LSB y resolution */
- 0x00, /* MSB intensity levels */
- 0x02, /* LSB intensity levels */
-
- /* magenta */
- 0x01, /* MSB x resolution */
- 0x2c, /* LSB x resolution */
- 0x01, /* MSB y resolution */
- 0x2c, /* LSB y resolution */
- 0x00, /* MSB intensity levels */
- 0x02, /* LSB intensity levels */
-
- /* yellow */
- 0x01, /* MSB x resolution */
- 0x2c, /* LSB x resolution */
- 0x01, /* MSB y resolution */
- 0x2c, /* LSB y resolution */
- 0x00, /* MSB intensity levels */
- 0x02 /* LSB intensity levels */
- }
-};
-
-/* this holds the color lookuptable data of the hp850 */
-typedef struct {
- byte c[256]; /* Lookuptable for cyan */
- byte m[256]; /* dito for magenta */
- byte y[256]; /* dito for yellow */
- byte k[256]; /* dito for black */
- int correct[256]; /* potential undercolor black correction */
-} Gamma;
-
-private const Gamma gammat850 =
-{
- /* Lookup values for cyan */
- {0, 0, 0, 2, 2, 2, 3, 3, 3, 5, 5, 5, 7, 7, 6, 7, 7, 6, 7, 7, 7, 8, 8,
- 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 12, 12, 12,
- 12, 12, 12, 13, 13, 14, 14, 14, 15, 15, 16, 16, 15, 16, 16, 17, 17,
- 17, 17, 17, 18, 18, 18, 19, 19, 20, 20, 20, 20, 20, 21, 21, 21, 22,
- 22, 23, 23, 23, 23, 23, 24, 24, 25, 25, 26, 26, 26, 26, 26, 27, 27,
- 27, 27, 28, 28, 29, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 34,
- 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 42,
- 43, 43, 43, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 50, 50, 51, 51,
- 52, 52, 53, 54, 54, 54, 55, 55, 56, 57, 58, 58, 59, 60, 60, 61, 62,
- 62, 63, 65, 65, 66, 67, 67, 68, 69, 69, 70, 72, 73, 73, 74, 75, 75,
- 76, 77, 79, 79, 80, 81, 82, 83, 83, 84, 86, 87, 88, 88, 89, 90, 91,
- 92, 93, 94, 95, 96, 97, 97, 99, 100, 101, 102, 103, 104, 105, 106,
- 108, 109, 110, 111, 112, 114, 115, 117, 119, 120, 122, 124, 125, 127,
- 129, 131, 132, 135, 136, 138, 140, 142, 144, 146, 147, 150, 152, 154,
- 157, 159, 162, 164, 166, 168, 171, 174, 176, 180, 182, 187, 192, 197,
- 204, 215, 255},
- /* Lookup values for magenta */
- {0, 0, 0, 1, 1, 1, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 7,
- 7, 8, 8, 8, 9, 9, 10, 10, 9, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12,
- 12, 13, 13, 13, 14, 14, 15, 15, 15, 16, 16, 16, 16, 16, 17, 17, 17,
- 17, 17, 18, 18, 19, 19, 19, 19, 19, 20, 20, 20, 21, 21, 22, 22, 22,
- 23, 23, 24, 24, 25, 25, 25, 26, 26, 27, 27, 28, 29, 29, 29, 29, 30,
- 30, 31, 30, 31, 31, 32, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36,
- 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44,
- 45, 45, 46, 46, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 53, 53, 54,
- 54, 55, 55, 56, 57, 57, 58, 58, 59, 60, 60, 61, 61, 62, 63, 64, 65,
- 66, 66, 67, 68, 68, 70, 71, 71, 72, 73, 73, 74, 76, 77, 77, 78, 79,
- 79, 80, 81, 82, 83, 84, 85, 86, 87, 87, 88, 89, 90, 91, 91, 92, 93,
- 94, 95, 96, 97, 98, 99, 100, 100, 101, 102, 103, 105, 106, 107, 108,
- 109, 112, 113, 114, 115, 116, 118, 119, 121, 123, 124, 125, 128, 129,
- 130, 133, 134, 135, 138, 139, 142, 144, 145, 148, 150, 152, 154, 157,
- 159, 162, 164, 168, 169, 170, 172, 175, 177, 179, 182, 185, 189, 193,
- 198, 204, 215, 255},
- /* Lookup values for yellow */
- {0, 0, 0, 2, 2, 2, 3, 3, 3, 5, 5, 5, 7, 7, 6, 7, 7, 6, 7, 7, 7, 8, 8,
- 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11,
- 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 16, 16, 16, 17, 17, 18, 18,
- 18, 19, 18, 19, 19, 19, 20, 20, 21, 21, 21, 22, 22, 22, 22, 22, 23,
- 23, 24, 24, 25, 25, 25, 26, 27, 28, 28, 29, 29, 29, 30, 30, 30, 30,
- 31, 31, 32, 32, 33, 33, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37,
- 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 45,
- 45, 46, 46, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 53, 53, 54, 54,
- 55, 55, 56, 57, 58, 59, 59, 60, 61, 61, 62, 62, 63, 64, 65, 66, 67,
- 67, 68, 69, 69, 70, 71, 72, 73, 74, 74, 75, 76, 77, 77, 78, 79, 79,
- 80, 81, 82, 83, 84, 85, 86, 87, 87, 88, 89, 90, 91, 91, 93, 94, 95,
- 96, 97, 98, 100, 101, 102, 102, 103, 104, 106, 107, 108, 109, 110,
- 111, 113, 114, 115, 116, 117, 118, 119, 121, 123, 124, 126, 128, 130,
- 131, 134, 135, 137, 139, 140, 143, 145, 146, 148, 150, 152, 154, 156,
- 158, 160, 163, 166, 167, 169, 171, 173, 176, 178, 181, 184, 188, 192,
- 198, 204, 215, 255},
- /* Lookup values for black */
- {0, 0, 0, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 2, 4, 3, 3, 3, 3, 3, 4, 4,
- 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 9, 9, 8,
- 8, 8, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 13, 13,
- 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 16, 16,
- 16, 17, 17, 17, 17, 18, 18, 18, 19, 19, 20, 20, 20, 20, 20, 21, 21,
- 21, 21, 22, 22, 22, 22, 23, 22, 23, 23, 24, 24, 24, 24, 25, 25, 26,
- 26, 26, 26, 27, 27, 28, 28, 28, 28, 29, 29, 30, 30, 31, 31, 31, 32,
- 32, 33, 33, 34, 34, 35, 36, 36, 36, 37, 37, 37, 38, 38, 40, 40, 40,
- 41, 41, 42, 43, 43, 43, 43, 44, 45, 45, 46, 47, 47, 48, 49, 49, 50,
- 52, 52, 53, 54, 54, 56, 56, 57, 58, 59, 60, 60, 61, 62, 63, 63, 64,
- 65, 66, 67, 68, 69, 70, 71, 72, 72, 73, 75, 75, 76, 77, 78, 80, 81,
- 82, 82, 83, 84, 85, 86, 88, 89, 90, 91, 94, 95, 96, 98, 99, 100, 101,
- 103, 105, 106, 107, 110, 111, 112, 115, 116, 118, 120, 121, 124, 126,
- 127, 131, 133, 134, 138, 140, 141, 146, 148, 151, 154, 156, 160, 163,
- 166, 169, 174, 177, 182, 187, 194, 203, 215, 255}
-};
-
-
-private const Gamma gammat890 =
-{
-/* Lookup values for cyan */
-{0, 2, 3, 5, 7, 8, 10, 12, 13, 15, 16, 18, 20, 21, 23, 25, 26, 28, 29,
-31, 32, 34, 36, 37, 39, 40, 42, 43, 45, 46, 48, 50, 51, 53, 54, 56, 57,
-59, 60, 62, 63, 65, 66, 68, 69, 70, 72, 73, 75, 76, 78, 79, 81, 82, 83,
-85, 86, 88, 89, 91, 92, 93, 95, 96, 97, 99, 100, 102, 103, 104, 106,
-107, 108, 110, 111, 112, 114, 115, 116, 118, 119, 120, 121, 123, 124,
-125, 127, 128, 129, 130, 132, 133, 134, 135, 137, 138, 139, 140, 141,
-143, 144, 145, 146, 147, 149, 150, 151, 152, 153, 154, 155, 157, 158,
-159, 160, 161, 162, 163, 164, 166, 167, 168, 169, 170, 171, 172, 173,
-174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
-188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
-201, 202, 203, 204, 205, 206, 207, 208, 208, 209, 210, 211, 212, 213,
-213, 214, 215, 216, 217, 217, 218, 219, 220, 220, 221, 222, 223, 223,
-224, 225, 225, 226, 227, 228, 228, 229, 230, 230, 231, 231, 232, 233,
-233, 234, 235, 235, 236, 236, 237, 238, 238, 239, 239, 240, 240, 241,
-241, 242, 242, 243, 243, 244, 244, 245, 245, 246, 246, 247, 247, 247,
-248, 248, 249, 249, 249, 250, 250, 250, 251, 251, 251, 252, 252, 252,
-252, 253, 253, 253, 253, 254, 254, 254, 254, 254, 255, 255, 255, 255,
-255, 255, 255},
-
-/* Lookup values for magenta */ /* gamma 0.6 */ /* 0.8 */
-
-{0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
-21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
-40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 52, 53, 54, 55, 56, 57, 58,
-59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
-77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 86, 87, 88, 89, 90, 91, 92, 93,
-94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
-109, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
-122, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 132, 133,
-134, 135, 136, 137, 138, 139, 140, 140, 141, 142, 143, 144, 145, 146,
-147, 147, 148, 149, 150, 151, 152, 153, 153, 154, 155, 156, 157, 158,
-158, 159, 160, 161, 162, 163, 163, 164, 165, 166, 167, 168, 168, 169,
-170, 171, 172, 172, 173, 174, 175, 176, 176, 177, 178, 179, 179, 180,
-181, 182, 182, 183, 184, 185, 185, 186, 187, 188, 188, 189, 190, 191,
-191, 192, 193, 193, 194, 195, 196, 196, 197, 198, 198, 199, 200, 200,
-201, 202, 202, 203, 204, 204, 205, 205, 206, 207, 207, 208, 209, 209,
-210, 210, 211, 211, 212, 213, 213, 214, 214, 215, 215, 216, 216, 217,
-217, 218, 218, 218, 219, 219, 219, 220, 220},
-
-/* Lookup values for yellow */
-/* gamma 0.7 */
-
-{0, 1, 3, 4, 6, 7, 9, 10, 11, 13, 14, 16, 17, 18, 20, 21, 23, 24, 25,
-27, 28, 29, 31, 32, 34, 35, 36, 38, 39, 40, 42, 43, 44, 46, 47, 48, 50,
-51, 52, 54, 55, 56, 58, 59, 60, 62, 63, 64, 66, 67, 68, 70, 71, 72, 73,
-75, 76, 77, 79, 80, 81, 82, 84, 85, 86, 88, 89, 90, 91, 93, 94, 95, 96,
-97, 99, 100, 101, 102, 104, 105, 106, 107, 109, 110, 111, 112, 113, 115,
-116, 117, 118, 119, 120, 122, 123, 124, 125, 126, 127, 129, 130, 131,
-132, 133, 134, 136, 137, 138, 139, 140, 141, 142, 143, 145, 146, 147,
-148, 149, 150, 151, 152, 153, 154, 155, 157, 158, 159, 160, 161, 162,
-163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176,
-177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190,
-191, 192, 193, 194, 195, 196, 196, 197, 198, 199, 200, 201, 202, 203,
-204, 205, 205, 206, 207, 208, 209, 210, 211, 211, 212, 213, 214, 215,
-216, 216, 217, 218, 219, 220, 220, 221, 222, 223, 223, 224, 225, 226,
-226, 227, 228, 229, 229, 230, 231, 232, 232, 233, 234, 234, 235, 236,
-236, 237, 238, 238, 239, 239, 240, 241, 241, 242, 242, 243, 244, 244,
-245, 245, 246, 246, 247, 247, 248, 248, 249, 249, 250, 250, 251, 251,
-251, 252, 252, 253, 253, 253, 254, 254, 254, 254, 255, 255, 255, 255},
-
-/* Lookup values for black */
-/* gamma 3.3 */
-
-{0, 0, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7,
-8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 13, 13, 13, 14, 14,
-14, 15, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 20, 20, 20,
-21, 21, 21, 22, 22, 22, 23, 23, 24, 24, 24, 25, 25, 26, 26, 26, 27, 27,
-27, 28, 28, 29, 29, 29, 30, 30, 31, 31, 32, 32, 32, 33, 33, 34, 34, 34,
-35, 35, 36, 36, 37, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 41, 42, 42,
-43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51,
-52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 57, 57, 58, 58, 59, 60, 60, 61,
-61, 62, 62, 63, 64, 64, 65, 65, 66, 67, 67, 68, 68, 69, 70, 70, 71, 72,
-72, 73, 74, 74, 75, 76, 76, 77, 78, 78, 79, 80, 80, 81, 82, 83, 83, 84,
-85, 86, 86, 87, 88, 89, 90, 91, 91, 92, 93, 94, 95, 96, 97, 97, 98, 99,
-100, 101, 102, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114,
-115, 117, 118, 119, 120, 122, 123, 124, 126, 127, 129, 130, 132, 134,
-135, 137, 139, 141, 143, 145, 147, 149, 152, 154, 157, 159, 162, 166,
-169, 173, 178, 183, 189, 196, 207, 255},
-};
-
-private const Gamma * const gammat[] =
-{
- &gammat850, /* CDJ670 */
- &gammat850, /* CDJ850 */
- &gammat850, /* CDJ880 */
- &gammat890, /* CDJ890 */
- &gammat850 /* CDJ1600 */
-};
-
-private int
- rescale_byte_wise1x1(int bytecount, const byte * inbytea,
- const byte * inbyteb, byte * outbyte);
-private int
- rescale_byte_wise2x1(int bytecount, const byte * inbytea,
- const byte * inbyteb, byte * outbyte);
-private int
- rescale_byte_wise1x2(int bytecount, const byte * inbytea,
- const byte * inbyteb, byte * outbyte);
-private int
- rescale_byte_wise2x2(int bytecount, const byte * inbytea,
- const byte * inbyteb, byte * outbyte);
-
-private int (* const rescale_color_plane[2][2]) (int, const byte *, const byte *, byte *) = {
- {
- rescale_byte_wise1x1, rescale_byte_wise1x2
- },
- {
- rescale_byte_wise2x1, rescale_byte_wise2x2
- }
-};
-
-/*
- * Drivers stuff.
- *
- */
-#define DESKJET_PRINT_LIMIT 0.04 /* 'real' top margin? */
-/* Margins are left, bottom, right, top. */
-#define DESKJET_MARGINS_LETTER 0.25, 0.50, 0.25, 0.167
-#define DESKJET_MARGINS_A4 0.13, 0.46, 0.13, 0.04
-/* Define bits-per-pixel - default is 32-bit cmyk-mode */
-#ifndef BITSPERPIXEL
-# define BITSPERPIXEL 32
-#endif
-#define DOFFSET (dev_t_margin(pdev) - DESKJET_PRINT_LIMIT) /* Print position */
-
-
-#define W sizeof(word)
-#define I sizeof(int)
-
-/* paper types */
-typedef enum {
- PLAIN_PAPER, BOND_PAPER, SPECIAL_PAPER, GLOSSY_FILM, TRANSPARENCY_FILM
-} cdj_paper_type_t;
-
-/* quality */
-typedef enum {
- DRAFT = -1, NORMAL = 0, PRESENTATION = 1
-} cdj_quality_t;
-
-/* Printer types */
-typedef enum {
- DJ670C, DJ850C, DJ880C, DJ890C, DJ1600C, HP2200C
-} cdj_printer_type_t;
-
-
-/* No. of ink jets (used to minimise head movements)
- * NOTE: These don't appear to actually be used anywhere. Can they
- * be removed?
- */
-#define HEAD_ROWS_MONO 50
-#define HEAD_ROWS_COLOUR 16
-
-
-/*
- * Colour mapping procedures
- */
-private dev_proc_map_cmyk_color(gdev_cmyk_map_cmyk_color);
-private dev_proc_map_rgb_color(gdev_cmyk_map_rgb_color);
-private dev_proc_map_color_rgb(gdev_cmyk_map_color_rgb);
-
-private dev_proc_map_rgb_color(gdev_pcl_map_rgb_color);
-private dev_proc_map_color_rgb(gdev_pcl_map_color_rgb);
-
-
-/*
- * Print-page, parameters and miscellaneous procedures
- */
-private dev_proc_open_device(hp_colour_open);
-
-private dev_proc_get_params(cdj850_get_params);
-private dev_proc_put_params(cdj850_put_params);
-
-private dev_proc_print_page(cdj850_print_page);
-private dev_proc_print_page(chp2200_print_page);
-
-/* The device descriptors */
-
-/* The basic structure for all printers. Note the presence of the cmyk, depth
- and correct fields even if some are not used by all printers. */
-
-#define prn_colour_device_body(dtype, procs, dname, w10, h10, xdpi, ydpi, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_page, cmyk, correct)\
- prn_device_body(dtype, procs, dname, w10, h10, xdpi, ydpi, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_page), cmyk, depth /* default */, correct
-
-
-
-#define gx_prn_colour_device_common \
- gx_prn_device_common; \
- int cmyk; /* 0: not CMYK-capable, > 0: printing CMYK, */ \
- /* < 0 : CMYK-capable, not printing CMYK */ \
- uint default_depth; /* Used only for CMYK-capable printers now. */ \
- uint correction
-
-
-/* some definitions needed later */
-struct error_val_field {
- int c; /* Current value of Cyan error during dithering */
- int m; /* Current value of Magenta error during dithering */
- int y; /* Current value of Yellow error during dithering */
- int k; /* Current value of Black error during dithering */
-};
-
-/* this structure holds all the pointers to the different values
- in all those data fields */
- /*
- * The principal data pointers are stored as pairs of values, with
- * the selection being made by the 'scan' variable. The function of the
- * scan variable is overloaded, as it controls both the alternating
- * raster scan direction used in the Floyd-Steinberg dithering and also
- * the buffer alternation required for line-difference compression.
- *
- * Thus, the number of pointers required is as follows:
- */
-
-struct ptr_arrays {
- byte *data[4]; /* 4 600dpi data, scan direction and alternating buffers */
- byte *data_c[4]; /* 4 300dpi data, as above, */
- byte *plane_data[4][4]; /*4 b/w-planes, scan direction and alternating buffers */
- byte *plane_data_c[4][8]; /* as above, but for 8 planes */
- byte *out_data; /* output buffer for the b/w data, one 600dpi plane */
- byte *test_data[4]; /* holds a copy of the last plane */
- int *errors[2]; /* 2 b/w dithering erros (scan direction only) */
- int *errors_c[2]; /* 2 color dithering errors (scan direction only) */
- word *storage; /* pointer to the beginning of the b/w-buffer */
- word *storage_start; /* used for debugging */
- word *storage_end; /* used for debugging */
- word *storage_size; /* used for debugging */
-};
-
-/* Some miscellaneous variables */
-struct misc_struct {
- int line_size; /* size of scan_line */
- int line_size_c; /* size of rescaled scan_line */
- int line_size_words; /* size of scan_line in words */
- int paper_size; /* size of paper */
- int num_comps; /* number of color components (1 - 4) */
- int bits_per_pixel; /* bits per pixel 1,4,8,16,24,32 */
- int storage_bpp; /* = bits_per_pixel */
- int expanded_bpp; /* = bits_per_pixel */
- int plane_size; /* size of b/w bit plane */
- int plane_size_c; /* size of color bit plane */
- int databuff_size; /* size of databuffer for b/w data */
- int databuff_size_c; /* size of databuffer for color data */
- int errbuff_size; /* size of error buffer b/w -data */
- int errbuff_size_c; /* size of error buffer color -data */
- int outbuff_size; /* size of output buffer for b/w data */
- int scan; /* scan-line variable [0,1] */
- int cscan; /* dito for the color-planes */
- int is_two_pass; /* checks if b/w data has already been printed */
- int zero_row_count; /* How many empty lines */
- uint storage_size_words; /* size of storage in words for b/w data */
- uint storage_size_words_c; /* size of storage in words for c-data */
- int is_color_data; /* indicates whether there is color data */
-};
-
- /* function pointer typedefs for device driver struct */
-typedef void (*StartRasterMode) (gx_device_printer * pdev, int paper_size,
- FILE * prn_stream);
-typedef void (*PrintNonBlankLines) (gx_device_printer * pdev,
- struct ptr_arrays *data_ptrs,
- struct misc_struct *misc_vars,
- struct error_val_field *error_values,
- const Gamma *gamma,
- FILE * prn_stream);
-
-typedef void (*TerminatePage) (gx_device_printer * pdev, FILE * prn_stream);
-
-typedef struct gx_device_cdj850_s {
- gx_device_common;
- gx_prn_colour_device_common;
- int /*cdj_quality_t*/ quality; /* -1 draft, 0 normal, 1 best */
- int /*cdj_paper_type_t*/ papertype; /* papertype [0,4] */
- int intensities; /* intensity values per pixel [2,4] */
- int xscal; /* boolean to indicate x scaling by 2 */
- int yscal; /* boolean to indicate y scaling by 2 */
- int /*cdj_printer_type_t*/ ptype; /* printer type, one of DJ670C, DJ850C, DJ890C, DJ1600C */
- int compression; /* compression level */
- float mastergamma; /* Gammavalue applied to all colors */
- float gammavalc; /* range to which gamma-correction is
- applied to bw values */
- float gammavalm; /* amount of gamma correction for bw */
- float gammavaly; /* range to which gamma-correction i
- applied to color values */
- float gammavalk; /* amount of gamma correction for color */
- float blackcorrect; /* amount of gamma correction for color */
- StartRasterMode start_raster_mode; /* output function to start raster mode */
- PrintNonBlankLines print_non_blank_lines; /* output function to print a non blank line */
- TerminatePage terminate_page; /* page termination output function */
-} gx_device_cdj850;
-
-typedef struct {
- gx_device_common;
- gx_prn_colour_device_common;
-} gx_device_colour_prn;
-
-
-/* Use the cprn_device macro to access generic fields (like cmyk,
- default_depth and correction), and specific macros for specific
- devices. */
-
-#define cprn_device ((gx_device_colour_prn*) pdev)
-#define cdj850 ((gx_device_cdj850 *)pdev)
-
-#define prn_cmyk_colour_device(dtype, procs, dev_name, x_dpi, y_dpi, bpp, print_page, correct)\
- prn_colour_device_body(dtype, procs, dev_name,\
- DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, x_dpi, y_dpi, 0, 0, 0, 0,\
- ((bpp == 1 || bpp == 4) ? 1 : 4), bpp,\
- (bpp > 8 ? 255 : 1), (1 << (bpp >> 2)) - 1, /* max_gray, max_color */\
- (bpp > 8 ? 5 : 2), (bpp > 8 ? 5 : bpp > 1 ? 2 : 0),\
- print_page, 1 /* cmyk */, correct)
-
-#define prn_cmy_colour_device(dtype, procs, dev_name, x_dpi, y_dpi, bpp, print_page, correct)\
- prn_colour_device_body(dtype, procs, dev_name,\
- DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, x_dpi, y_dpi, 0, 0, 0, 0,\
- ((bpp == 1 || bpp == 4) ? 1 : 3), bpp,\
- (bpp > 8 ? 255 : 1), (bpp > 8 ? 255 : 1), /* max_gray, max_color */\
- (bpp > 8 ? 5 : 2), (bpp > 8 ? 5 : bpp > 1 ? 2 : 0),\
- print_page, -1 /* cmyk */, correct)
-
-/* The prn_rgb_color_device is used by the HP2200 */
-#define prn_rgb_colour_device(dtype, procs, dev_name, x_dpi, y_dpi, bpp, print_page, correct)\
- prn_colour_device_body(dtype, procs, dev_name,\
- DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, x_dpi, y_dpi, 0, 0, 0, 0,\
- 3 /*3=rgb*/, bpp,\
- 255, 255, /* max_gray, max_color */\
- 256, 256,\
- print_page, 0 /* no cmyk */, correct)
-
-#define cdj_850_device(procs, dev_name, x_dpi, y_dpi, bpp, print_page, correction, quality, papertype, intensities,ptype,compression,mastergamma,gammavalc,gammavalm,gammavaly,gammavalk,blackcorrect,start_raster_mode,print_non_blank_line,terminate_page)\
-{ prn_cmyk_colour_device(gx_device_cdj850, procs, dev_name, x_dpi, y_dpi, bpp, print_page, correction),\
- quality,\
- papertype,\
- intensities,\
- 0, 0, /* xscal, yscal */\
- ptype,\
- compression,\
- mastergamma,\
- gammavalc,\
- gammavalm,\
- gammavaly,\
- gammavalk,\
- blackcorrect,\
- start_raster_mode,\
- print_non_blank_line,\
- terminate_page\
-}
-
-#define cdj_1600_device(procs, dev_name, x_dpi, y_dpi, bpp, print_page, correction, quality, papertype, intensities,ptype,compression,mastergamma,gammavalc,gammavalm,gammavaly,gammavalk,blackcorrect,start_raster_mode,print_non_blank_line,terminate_page)\
-{ prn_cmy_colour_device(gx_device_cdj850, procs, dev_name, x_dpi, y_dpi, bpp, print_page, correction),\
- quality,\
- papertype,\
- intensities,\
- 0, 0, /* xscal, yscal */\
- ptype,\
- compression,\
- mastergamma,\
- gammavalc,\
- gammavalm,\
- gammavaly,\
- gammavalk,\
- blackcorrect,\
- start_raster_mode,\
- print_non_blank_line,\
- terminate_page\
-}
-
-/* HP2200 is a RGB printer */
-#define chp_2200_device(procs, dev_name, x_dpi, y_dpi, bpp, print_page, correction, quality, papertype, intensities,ptype,compression,mastergamma,gammavalc,gammavalm,gammavaly,gammavalk,blackcorrect,start_raster_mode,print_non_blank_line,terminate_page)\
-{ prn_rgb_colour_device(gx_device_cdj850, procs, dev_name, x_dpi, y_dpi, bpp, print_page, correction),\
- quality,\
- papertype,\
- intensities,\
- 0, 0, /* xscal, yscal */\
- ptype,\
- compression,\
- mastergamma,\
- gammavalc,\
- gammavalm,\
- gammavaly,\
- gammavalk,\
- blackcorrect,\
- start_raster_mode,\
- print_non_blank_line,\
- terminate_page\
-}
-
-#define cmyk_colour_procs(proc_colour_open, proc_get_params, proc_put_params, \
- map_rgb_color, map_color_rgb, map_cmyk_color)\
-{ proc_colour_open,\
- gx_default_get_initial_matrix,\
- gx_default_sync_output,\
- gdev_prn_output_page,\
- gdev_prn_close,\
- map_rgb_color,\
- map_color_rgb,\
- NULL /* fill_rectangle */,\
- NULL /* tile_rectangle */,\
- NULL /* copy_mono */,\
- NULL /* copy_color */,\
- NULL /* draw_line */,\
- gx_default_get_bits,\
- proc_get_params,\
- proc_put_params,\
- map_cmyk_color\
-}
-
-
-/* Printer-specific functions. Most printers are handled by the cdj850_xx()
- * functions.
- */
-private void
- cdj850_start_raster_mode(gx_device_printer * pdev,
- int papersize, FILE * prn_stream);
-
-private void
- cdj850_print_non_blank_lines(gx_device_printer * pdev,
- struct ptr_arrays *data_ptrs,
- struct misc_struct *misc_vars,
- struct error_val_field *error_values,
- const Gamma *gamma,
- FILE * prn_stream);
-
-private void
- cdj850_terminate_page(gx_device_printer * pdev, FILE * prn_stream);
-
-/* The 880C and siblings need a separate set of functions because they seem
- * to require a somewhat different version of PCL3+.
- */
-private void
- cdj880_start_raster_mode(gx_device_printer * pdev,
- int papersize, FILE * prn_stream);
-
-private void
- cdj880_print_non_blank_lines(gx_device_printer * pdev,
- struct ptr_arrays *data_ptrs,
- struct misc_struct *misc_vars,
- struct error_val_field *error_values,
- const Gamma *gamma,
- FILE * prn_stream);
-
-private void
- cdj880_terminate_page(gx_device_printer * pdev, FILE * prn_stream);
-
-/* Functions for the 1600C.
- */
-private void
- cdj1600_start_raster_mode(gx_device_printer * pdev,
- int papersize, FILE * prn_stream);
-private void
- cdj1600_print_non_blank_lines(gx_device_printer * pdev,
- struct ptr_arrays *data_ptrs,
- struct misc_struct *misc_vars,
- struct error_val_field *error_values,
- const Gamma *gamma,
- FILE * prn_stream);
-private void
- cdj1600_terminate_page(gx_device_printer * pdev, FILE * prn_stream);
-
-/* Functions for the HP2200C */
-private void
- chp2200_start_raster_mode(gx_device_printer * pdev,
- int papersize, FILE * prn_stream);
-
-private void
- chp2200_terminate_page(gx_device_printer * pdev, FILE * prn_stream);
-
-
-private const gx_device_procs cdj670_procs =
-cmyk_colour_procs(hp_colour_open, cdj850_get_params, cdj850_put_params,
- NULL, gdev_cmyk_map_color_rgb, gdev_cmyk_map_cmyk_color);
-
-private const gx_device_procs cdj850_procs =
-cmyk_colour_procs(hp_colour_open, cdj850_get_params, cdj850_put_params,
- NULL, gdev_cmyk_map_color_rgb, gdev_cmyk_map_cmyk_color);
-
-private const gx_device_procs cdj880_procs =
-cmyk_colour_procs(hp_colour_open, cdj850_get_params, cdj850_put_params,
- NULL, gdev_cmyk_map_color_rgb, gdev_cmyk_map_cmyk_color);
-
-private const gx_device_procs cdj890_procs =
-cmyk_colour_procs(hp_colour_open, cdj850_get_params, cdj850_put_params,
- NULL, gdev_cmyk_map_color_rgb, gdev_cmyk_map_cmyk_color);
-
-private const gx_device_procs cdj1600_procs =
-cmyk_colour_procs(hp_colour_open, cdj850_get_params, cdj850_put_params,
- gdev_pcl_map_rgb_color, gdev_pcl_map_color_rgb, NULL);
-
-/* HP2200 is a RGB printer */
-private const gx_device_procs chp2200_procs =
-cmyk_colour_procs(hp_colour_open, cdj850_get_params, cdj850_put_params,
- gx_default_rgb_map_rgb_color, gx_default_rgb_map_color_rgb, NULL);
-
-
-const gx_device_cdj850 gs_cdj670_device =
-cdj_850_device(cdj670_procs, "cdj670", 600, 600, 32, cdj850_print_page, 0,
- PRESENTATION, PLAIN_PAPER, 2, DJ670C, 9,
- 1.0, 0.0, 0.0, 0.0, 0.0, 1.0,
- cdj850_start_raster_mode, cdj850_print_non_blank_lines,
- cdj850_terminate_page);
-
-const gx_device_cdj850 gs_cdj850_device =
-cdj_850_device(cdj850_procs, "cdj850", 600, 600, 32, cdj850_print_page, 0,
- PRESENTATION, PLAIN_PAPER, 4, DJ850C, 9,
- 1.0, 0.0, 0.0, 0.0, 0.0, 1.0,
- cdj850_start_raster_mode, cdj850_print_non_blank_lines,
- cdj850_terminate_page);
-
-const gx_device_cdj850 gs_cdj880_device =
-cdj_850_device(cdj880_procs, "cdj880", 600, 600, 32, cdj850_print_page, 0,
- PRESENTATION, PLAIN_PAPER, 4, DJ880C, 2,
- 1.0, 0.0, 0.0, 0.0, 0.0, 1.0,
- cdj880_start_raster_mode, cdj880_print_non_blank_lines,
- cdj880_terminate_page);
-
-const gx_device_cdj850 gs_cdj890_device =
-cdj_850_device(cdj890_procs, "cdj890", 600, 600, 32, cdj850_print_page, 0,
- PRESENTATION, PLAIN_PAPER, 4, DJ890C, 9,
- 1.0, 0.0, 0.0, 0.0, 0.0, 1.0,
- cdj850_start_raster_mode, cdj850_print_non_blank_lines,
- cdj850_terminate_page);
-
-const gx_device_cdj850 gs_cdj1600_device =
-cdj_1600_device(cdj1600_procs, "cdj1600", 300, 300, 24, cdj850_print_page, 0,
- PRESENTATION, PLAIN_PAPER, 2, DJ1600C, 3,
- 1.0, 0.0, 0.0, 0.0, 0.0, 1.0,
- cdj1600_start_raster_mode, cdj1600_print_non_blank_lines,
- cdj1600_terminate_page);
-
-/* HP2200 does not need color matching and halftoning parameters */
-const gx_device_cdj850 gs_chp2200_device =
-chp_2200_device(chp2200_procs, "chp2200", 300, 300, 24, chp2200_print_page, 0,
- NORMAL, PLAIN_PAPER, 0 /*unused*/, HP2200C, 10,
- 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, /*all unused*/
- chp2200_start_raster_mode, NULL /*unused*/,
- chp2200_terminate_page);
-
-/* Forward references */
-private int cdj_put_param_int(gs_param_list *, gs_param_name,
- int *, int, int, int);
-private int cdj_put_param_float(gs_param_list *, gs_param_name, float
- *, float, float, int);
-private int cdj_put_param_bpp(gx_device *, gs_param_list *, int, int, int);
-private int cdj_set_bpp(gx_device *, int, int);
-
-
-/* hp_colour_open()
- *
- * Open the printer and set up the margins. Also, set parameters for
- * the printer depending on document type and print settings.
- *
- * Inputs: gx_device ptr to the device
- */
-private int
-hp_colour_open(gx_device * pdev)
-{ /* Change the margins if necessary. */
- static const float dj_a4[4] = {
- DESKJET_MARGINS_A4
- };
- static const float dj_letter[4] = {
- DESKJET_MARGINS_LETTER
- };
-
- /* margins for DJ1600C from manual */
- static const float m_cdj1600[4] = {
- 0.25, 0.5, 0.25, 0.5
- };
-
- /* margins for HP2200C */
- static const float chp2200_a4[4] = {
- 0.13, 0.46, 0.13, 0.08
- };
- static const float chp2200_letter[4] = {
- 0.25, 0.46, 0.25, 0.08
- };
-
- const float *m = (float *)0;
-
- /* Set up colour params if put_params has not already done so */
- if (pdev->color_info.num_components == 0) {
- int code = cdj_set_bpp(pdev, pdev->color_info.depth,
- pdev->color_info.num_components);
-
- if (code < 0)
- return code;
- }
- /* assign printer type and set resolution dependent on printer type */
- switch (cdj850->ptype) {
- case DJ670C:
- if (cdj850->papertype <= SPECIAL_PAPER) { /* paper */
- if (cdj850->quality == DRAFT) {
- gx_device_set_resolution(pdev, 300.0, 300.0);
- cdj850->xscal = 0;
- cdj850->yscal = 0;
- } else if (cdj850->quality == NORMAL) {
- gx_device_set_resolution(pdev, 600.0, 300.0);
- cdj850->xscal = 1;
- cdj850->yscal = 0;
- } else { /* quality == PRESENTATION */
- gx_device_set_resolution(pdev, 600.0, 600.0);
- cdj850->xscal = 1;
- cdj850->yscal = 1;
- }
- } else { /* film */
- gx_device_set_resolution(pdev, 600.0, 300.0);
- cdj850->xscal = 1;
- cdj850->yscal = 0;
- }
- m = (gdev_pcl_paper_size(pdev) == PAPER_SIZE_A4 ? dj_a4 : dj_letter);
- break;
- case DJ850C:
- if (cdj850->quality == DRAFT) {
- gx_device_set_resolution(pdev, 300.0, 300.0);
- cdj850->xscal = 0;
- cdj850->yscal = 0;
- cdj850->intensities = 2;
- } else if (cdj850->quality == NORMAL) {
- gx_device_set_resolution(pdev, 600.0, 600.0);
- cdj850->xscal = 1;
- cdj850->yscal = 1;
- /* only 3 intensities for normal paper */
- if (cdj850->papertype <= PLAIN_PAPER) {
- cdj850->intensities = 3;
- } /* else cdj850->intensities = 4 from initialization */
- } else { /* quality == PRESENTATION */
- gx_device_set_resolution(pdev, 600.0, 600.0);
- cdj850->xscal = 1;
- cdj850->yscal = 1;
- /* intensities = 4 from initialization */
- }
- m = (gdev_pcl_paper_size(pdev) == PAPER_SIZE_A4 ? dj_a4 : dj_letter);
- break;
- case DJ880C:
- if (cdj850->quality == DRAFT) {
- gx_device_set_resolution(pdev, 300.0, 300.0);
- cdj850->xscal = 0;
- cdj850->yscal = 0;
- cdj850->intensities = 2;
- } else if (cdj850->quality == NORMAL) {
- gx_device_set_resolution(pdev, 600.0, 300.0);
- cdj850->xscal = 1;
- cdj850->yscal = 0;
- /* only 3 intensities for normal paper */
- if (cdj850->papertype <= PLAIN_PAPER) {
- cdj850->intensities = 4;
- } /* else cdj850->intensities = 4 from initialization */
- } else { /* quality == PRESENTATION */
- gx_device_set_resolution(pdev, 600.0, 600.0);
- cdj850->xscal = 0; /* color is also 600dpi in PRESENTATION mode */
- cdj850->yscal = 0;
- cdj850->intensities = 4;
- }
- m = (gdev_pcl_paper_size(pdev) == PAPER_SIZE_A4 ? dj_a4 : dj_letter);
- break;
- case DJ890C:
- if (cdj850->quality == DRAFT) {
- gx_device_set_resolution(pdev, 300.0, 300.0);
- cdj850->xscal = 0;
- cdj850->yscal = 0;
- cdj850->intensities = 2;
- } else if (cdj850->quality == NORMAL) {
- gx_device_set_resolution(pdev, 600.0, 300.0);
- cdj850->xscal = 1;
- cdj850->yscal = 0;
- /* only 3 intensities for normal paper */
- if (cdj850->papertype <= PLAIN_PAPER) {
- cdj850->intensities = 3;
- } /* else cdj850->intensities = 4 from initialization */
- } else { /* quality == PRESENTATION */
- gx_device_set_resolution(pdev, 600.0, 600.0);
- cdj850->xscal = 1;
- cdj850->yscal = 1;
- /* intensities = 4 from initialization */
- }
- m = (gdev_pcl_paper_size(pdev) == PAPER_SIZE_A4 ? dj_a4 : dj_letter);
- break;
- case DJ1600C:
- gx_device_set_resolution(pdev, 300.0, 300.0);
- m = m_cdj1600;
- break;
- /* HP2200 supports 300dpi draft/normal and 600dpi normal/best
- for all media types. For normal, we are only using 300dpi here*/
- case HP2200C:
- cdj850->xscal = 0; /* unused */
- cdj850->yscal = 0; /* unused */
- cdj850->intensities = 0; /* unused */
- if (cdj850->quality == DRAFT) {
- gx_device_set_resolution(pdev, 300.0, 300.0);
- } else if (cdj850->quality == NORMAL) {
- gx_device_set_resolution(pdev, 300.0, 300.0);
- } else { /* quality == PRESENTATION */
- gx_device_set_resolution(pdev, 600.0, 600.0);
- }
- m = (gdev_pcl_paper_size(pdev) == PAPER_SIZE_A4 ? chp2200_a4 : chp2200_letter);
- break;
- default:
- assert(0);
- }
- gx_device_set_margins(pdev, m, true);
- return gdev_prn_open(pdev);
-}
-
-/* Added parameters for DeskJet 850C */
-private int
-cdj850_get_params(gx_device * pdev, gs_param_list * plist)
-{
- int code = gdev_prn_get_params(pdev, plist);
-
- if (code < 0 ||
- (code = param_write_int(plist, "Quality", &cdj850->quality)) < 0 ||
- (code = param_write_int(plist, "Papertype", &cdj850->papertype)) < 0 ||
- (code = param_write_float(plist, "MasterGamma", &cdj850->gammavalc))
- < 0 ||
- (code = param_write_float(plist, "GammaValC", &cdj850->gammavalc)) <
- 0 ||
- (code = param_write_float(plist, "GammaValM", &cdj850->gammavalm)) <
- 0 ||
- (code = param_write_float(plist, "GammaValY", &cdj850->gammavaly)) <
- 0 ||
- (code = param_write_float(plist, "GammaValK", &cdj850->gammavalk)) <
- 0 ||
- (code = param_write_float(plist, "BlackCorrect",
- &cdj850->blackcorrect)) < 0
- )
- return code;
-
- return code;
-}
-
-private int
-cdj850_put_params(gx_device * pdev, gs_param_list * plist)
-{
- int quality = cdj850->quality;
- int papertype = cdj850->papertype;
- float mastergamma = cdj850->mastergamma;
- float gammavalc = cdj850->gammavalc;
- float gammavalm = cdj850->gammavalm;
- float gammavaly = cdj850->gammavaly;
- float gammavalk = cdj850->gammavalk;
- float blackcorrect = cdj850->blackcorrect;
- int bpp = 0;
- int code = 0;
-
- code = cdj_put_param_int(plist, "BitsPerPixel", &bpp, 1, 32, code);
- code = cdj_put_param_int(plist, "Quality", &quality, 0, 2, code);
- code = cdj_put_param_int(plist, "Papertype", &papertype, 0, 4, code);
- code = cdj_put_param_float(plist, "MasterGamma", &mastergamma, 0.1, 9.0, code);
- code = cdj_put_param_float(plist, "GammaValC", &gammavalc, 0.0, 9.0, code);
- code = cdj_put_param_float(plist, "GammaValM", &gammavalm, 0.0, 9.0, code);
- code = cdj_put_param_float(plist, "GammaValY", &gammavaly, 0.0, 9.0, code);
- code = cdj_put_param_float(plist, "GammaValK", &gammavalk, 0.0, 9.0, code);
- code = cdj_put_param_float(plist, "BlackCorrect", &blackcorrect, 0.0,
- 9.0, code);
-
-
- if (code < 0)
- return code;
- code = cdj_put_param_bpp(pdev, plist, bpp, bpp, 0);
- if (code < 0)
- return code;
-
- cdj850->quality = quality;
- cdj850->papertype = papertype;
- cdj850->mastergamma = mastergamma;
- cdj850->gammavalc = gammavalc;
- cdj850->gammavalm = gammavalm;
- cdj850->gammavaly = gammavaly;
- cdj850->gammavalk = gammavalk;
- cdj850->blackcorrect = blackcorrect;
- return 0;
-}
-
-/* ------ Internal routines ------ */
-/* The DeskJet850C can compress (mode 9) */
-
-
-/* Some convenient shorthand .. */
-#define x_dpi (pdev->x_pixels_per_inch)
-#define y_dpi (pdev->y_pixels_per_inch)
-
-/* To calculate buffer size as next greater multiple of both parameter and W */
-#define calc_buffsize(a, b) (((((a) + ((b) * W) - 1) / ((b) * W))) * W)
-
-/* internal functions */
-private void
- FSDlinebw(int scan, int plane_size,
- struct error_val_field *error_values,
- byte * kP,
- int n, int *ep, byte * dp);
-private void
- FSDlinec2(int scan, int plane_size,
- struct error_val_field *error_values,
- byte * cPa, byte * mPa, byte * yPa, int n,
- byte * dp, int *ep);
-private void
- FSDlinec3(int scan, int plane_size,
- struct error_val_field *error_values,
- byte * cPa, byte * mPa, byte * yPa,
- byte * cPb, byte * mPb, byte * yPb,
- int n, byte * dp, int *ep);
-private void
- FSDlinec4(int scan, int plane_size,
- struct error_val_field *error_values,
- byte * cPa, byte * mPa, byte * yPa,
- byte * cPb, byte * mPb, byte * yPb,
- int n, byte * dp, int *ep);
-private void
- init_error_buffer(struct misc_struct *misc_vars,
- struct ptr_arrays *data_ptrs);
-private void
- do_floyd_steinberg(int scan, int cscan, int plane_size,
- int plane_size_c, int n,
- struct ptr_arrays *data_ptrs,
- gx_device_printer * pdev,
- struct error_val_field *error_values);
-private int
- do_gcr(int bytecount, byte * inbyte, const byte * kvalues,
- const byte * cvalues, const byte * mvalues,
- const byte * yvalues, const int *kcorrect,
- word * inword);
-
-/* UNUSED
- *private int
- *test_scan (P4(int size,
- * byte * current,
- * byte * last,
- * byte * control));
- *private void
- *save_color_data(P3(int size,
- * byte * current,
- * byte * saved));
- *
- */
-private void
- send_scan_lines(gx_device_printer * pdev,
- struct ptr_arrays *data_ptrs,
- struct misc_struct *misc_vars,
- struct error_val_field *error_values,
- const Gamma *gamma,
- FILE * prn_stream);
-private void
- do_gamma(float mastergamma, float gammaval, byte * values);
-private void
- do_black_correction(float kvalue, int *kcorrect);
-
-private void
- init_data_structure(gx_device_printer * pdev,
- struct ptr_arrays *data_ptrs,
- struct misc_struct *misc_vars);
-private void
- calculate_memory_size(gx_device_printer * pdev,
- struct misc_struct *misc_vars);
-
-
-private void
-assign_dpi(int dpi, byte * msb)
-{
- if (dpi == 600) {
- msb[0] = 0x02;
- msb[1] = 0x58;
- } else {
- msb[0] = 0x01;
- msb[1] = 0x2c;
- }
-}
-
-private void
-cdj850_terminate_page(gx_device_printer * pdev, FILE * prn_stream)
-{
- fputs("0M", prn_stream); /* Reset compression */
- fputs("\033*rC\033E", prn_stream); /* End Graphics, Reset */
- fputs("\033&l0H", prn_stream); /* eject page */
-}
-
-private void
-cdj880_terminate_page(gx_device_printer * pdev, FILE * prn_stream)
-{
- fputs("\033*rC\f\033E", prn_stream); /* End graphics, FF, Reset */
- fputs("\033%-12345X", prn_stream);
-}
-
-/* HP2200 terminate page routine */
-private void
-chp2200_terminate_page(gx_device_printer * pdev, FILE * prn_stream)
-{
- fputs("\033*rC\f\033E", prn_stream); /* End graphics, FF, Reset */
- fputs("\033%-12345X@PJL EOJ\012\033%-12345X", prn_stream); /* Send the PJL EOJ */
-}
-
-/* Here comes the hp850 output routine -------------------- */
-private int
-cdj850_print_page(gx_device_printer * pdev, FILE * prn_stream)
-{
-
- struct error_val_field error_values;
- struct ptr_arrays data_ptrs;
- struct misc_struct misc_vars;
- int i;
-
- Gamma gamma;
-
- /* make a local writable copy of the Gamma tables */
- memcpy(&gamma, gammat[cdj850->ptype], sizeof(Gamma));
- for (i=0; i<256; i++)
- gamma.k[i] = (int)(((float)(i*i*i))/(256.0*256.0));
-/* gamma.k[i] = (int)(sqrt((float)i)/16);*/
- /* if mastergamma, don't use the built in functions */
-/* if (cdj850->mastergamma > 1.0) {*/
- /* prepare the bw lookup table */
-/* do_gamma(cdj850->mastergamma, cdj850->gammavalk, gamma.k);*/
- /* prepare the color lookup table */
- for (i=0; i<256; i++)
- gamma.c[i] = (int)(((float)(i*i*i))/(256.0*256.0));
-/* do_gamma(cdj850->mastergamma, cdj850->gammavalc, gamma.c);*/
- for (i=0; i<256; i++)
- gamma.m[i] = (int)(((float)(i*i*i))/(256.0*256.0));
-/* do_gamma(cdj850->mastergamma, cdj850->gammavalm, gamma.m);*/
- for (i=0; i<256; i++)
- gamma.y[i] = (int)(((float)(i*i*i))/(256.0*256.0));
-/* do_gamma(cdj850->mastergamma, cdj850->gammavaly, gamma.y);*/
-/* }*/
- /* prepare the black correction table for the unbunt mask */
- do_black_correction(cdj850->blackcorrect, gamma.correct);
-
- /* Calculate the needed memory */
- calculate_memory_size(pdev, &misc_vars);
-
- /* and allocate the memory */
-
- /* Since we need 600 and 300 dpi, we set up several buffers:
- storage contains the data as copied from gs, as well as the
- plane-data and the out_row buffer.
- storagec will contain the rescaled color data. It also contains the
- plane_data for the color-planes - these are needed by the
- compression routine, but would be overwritten by the
- b/w-dithering. The color planes allow for overwriting the
- color-data by the error-data. Since we might use the
- 2bpp feature of the hp850 someday, it is sized like storage.
- storagee contains the errors from b/w fs-ditherng */
-
- data_ptrs.storage = (ulong *) gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), misc_vars.storage_size_words, W,
- "cdj850_print_page");
-
- /* if we can't allocate working area */
- if (data_ptrs.storage == 0) {
- return_error(gs_error_VMerror);
- }
- /* Initialise the needed pointers */
- init_data_structure(pdev, &data_ptrs, &misc_vars);
-
- /* Start Raster mode */
- (*cdj850->start_raster_mode) (pdev, misc_vars.paper_size, prn_stream);
-
- /* Send each scan line in turn */
- send_scan_lines(pdev, &data_ptrs, &misc_vars,
- &error_values, &gamma, prn_stream);
-
- /* terminate page and eject paper */
- (*cdj850->terminate_page) (pdev, prn_stream);
-
- /* Free Memory */
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)data_ptrs.storage, misc_vars.storage_size_words, W,
- "hp850_print_page");
-
- return 0;
-}
-
-/* HP2200C compression routines*/
-
-#define kWhite 0x00FFFFFE
-#define MIN(x,y) ((x)<(y) ? (x) : (y))
-#define MAX(x,y) ((x)>(y) ? (x) : (y))
-
-enum
-{
- eLiteral = 0,
- eRLE = 0x80
-};
-
-enum
-{
- eeNewPixel = 0x0,
- eeWPixel = 0x20,
- eeNEPixel = 0x40,
- eeCachedColor = 0x60,
-};
-
-enum
-{
- eNewColor = 0x0,
- eWestColor = 0x1,
- eNorthEastColor = 0x2,
- eCachedColor = 0x3
-};
-
-private inline unsigned int
-getPixel(byte* pixAddress, unsigned int pixelOffset)
-{
- pixAddress += (pixelOffset*3); /* assume 3 bytes for each RGB pixel */
- /* RGBRGB format */
- return (((unsigned int)(*(pixAddress)) << 16) +
- ((unsigned int)(*(pixAddress+1)) << 8 ) +
- ((*(pixAddress+2)) & kWhite));
-
- /* BGRBGR format */
- /*
- return (((unsigned int)(*(pixAddress+2)) << 16) +
- ((unsigned int)(*(pixAddress+1)) << 8 ) +
- ((*(pixAddress)) & kWhite));
- */
-}
-
-private inline void
-putPixel(byte* pixAddress, unsigned int pixelOffset, unsigned int pixel)
-{
- pixAddress += (pixelOffset*3); /* assume 3 bytes for each RGB pixel*/
- /* RGBRGB format */
- *(pixAddress) = (byte) (pixel >> 16);
- *(pixAddress+1) = (byte) (pixel >> 8);
- *(pixAddress+2) = (byte) (pixel & 0xFE);
-
- /* BGRBGR format */
- /*
- *(pixAddress+2) = (byte) (pixel >> 16);
- *(pixAddress+1) = (byte) (pixel >> 8);
- *(pixAddress) = (byte) (pixel & 0xFE);
- */
-}
-
-private inline unsigned int
-ShortDelta(byte* curPtr, byte* seedPtr, unsigned int pixelOffset)
-{
- int dr, dg, db;
- curPtr += (pixelOffset*3);
- seedPtr += (pixelOffset*3);
- /* RGBRGB format */
- dr = (int)((unsigned int)(*(curPtr)) - (unsigned int)(*(seedPtr)));
- dg = (int)((unsigned int)(*(curPtr+1)) - (unsigned int)(*(seedPtr+1)));
- db = (int)((unsigned int)((*(curPtr+2))&0xFE) - (unsigned int)((*(seedPtr+2))&0xFE));
-
- /* BGRBGR format */
- /*
- dr = (int)((unsigned int)(*(curPtr+2)) - (unsigned int)(*(seedPtr+2)));
- dg = (int)((unsigned int)(*(curPtr+1)) - (unsigned int)(*(seedPtr+1)));
- db = (int)((unsigned int)((*(curPtr))&0xFE) - (unsigned int)((*(seedPtr))&0xFE));
- */
-
- if ((dr <= 15) && (dr >= -16) && (dg <= 15) && (dg >= -16) && (db <= 30) && (db >= -32))
- { /* Note db is divided by 2 to double it's range from -16..15 to -32..30 */
- return (unsigned int)(((dr << 10) & 0x7C00) | (((dg << 5) & 0x03E0) | ((db >> 1) & 0x001F) | 0x8000)); /* set upper bit to signify short delta*/
- }
- return 0;
-}
-
-/* HP2200C - mode 10 compression for RGB data */
-private unsigned int
-Mode10(unsigned int planeWidthInPixels,
- byte * pbyColorScanPtr, /*input scanline in RGBRGBRGB format*/
- byte * pbyColorSeedPtr,
- byte * pbyColorOutputPtr)
-{
- unsigned int curPixel = 0;
- unsigned int seedRowPixelCopyCount;
- unsigned int cachedColor = kWhite;
- unsigned int lastPixel = planeWidthInPixels - 1;
- unsigned int realLastPixel = 0;
- unsigned int temp1, temp2, temp3;
-
- byte * curPtr = pbyColorScanPtr;
- byte * compressedDataPtr = pbyColorOutputPtr;
- byte * seedPtr = pbyColorSeedPtr;
-
- byte * compressedDataStart = compressedDataPtr;
-
- /* Setup sentinal value to replace last pixel of curRow.
- Simplifies future end condition checking.*/
- realLastPixel = getPixel(curPtr, lastPixel);
-
- temp1 = getPixel(curPtr, lastPixel-1);
- temp2 = getPixel(seedPtr, lastPixel);
- temp3 = realLastPixel;
- while ( (temp1 == temp3) || (temp2 == temp3))
- {
- *(curPtr+1+lastPixel*3) += 1; /* add one to green. */
- temp3 = getPixel(curPtr, lastPixel);
- }
-
- do /* all pixels in row */
- {
- byte CMDByte = eLiteral;
- unsigned int replacementCount = 0;
- int pixelSource = 0;
-
- /* Find seedRowPixelCopyCount for upcoming copy */
- seedRowPixelCopyCount = curPixel;
- while ( getPixel(seedPtr, curPixel) ==
- getPixel(curPtr, curPixel))
- {
- curPixel++;
- }
- seedRowPixelCopyCount = curPixel - seedRowPixelCopyCount;
-
- /* On last pixel of row. RLE could also leave us on the last pixel of the row
- from the previous iteration. */
- if (curPixel == lastPixel)
- {
- putPixel(curPtr, lastPixel, realLastPixel);
-
- if (getPixel(seedPtr, curPixel) ==
- realLastPixel)
- {
- return compressedDataPtr - compressedDataStart;
- }
- else /* code last pix as a literal */
- {
- CMDByte = eLiteral;
- pixelSource = eeNewPixel;
- replacementCount = 1;
- curPixel++;
- }
- }
- else /* prior to last pixel of row */
- {
- unsigned int RLERun = 0;
- replacementCount = curPixel;
- RLERun = getPixel(curPtr, curPixel);
-
- curPixel++; /* Adjust for next pixel.*/
- while (RLERun == getPixel(curPtr, curPixel))
- {
- curPixel++;
- }
- curPixel--; /* snap back to current.*/
- replacementCount = curPixel - replacementCount;
-
- if (replacementCount > 0) /* Adjust for total occurance and move to next pixel to do.*/
- {
- curPixel++;
- replacementCount++;
-
- if (cachedColor == RLERun)
- pixelSource = eeCachedColor;
- else if (getPixel(seedPtr, curPixel-replacementCount+1) == RLERun)
- pixelSource = eeNEPixel;
- else if ((curPixel-replacementCount > 0) && (getPixel(curPtr, curPixel-replacementCount-1) == RLERun))
- pixelSource = eeWPixel;
- else
- {
- pixelSource = eeNewPixel;
- cachedColor = RLERun;
- }
-
- CMDByte = eRLE; /* Set default for later.*/
- }
-
- if (curPixel == lastPixel)
- {
- /* Already found some RLE pixels */
- /* Add to current RLE. Otherwise it'll be part of the literal
- from the seedrow section above on the next iteration.*/
- if (realLastPixel == RLERun)
- {
- putPixel(curPtr, lastPixel, realLastPixel);
- replacementCount++;
- curPixel++;
- }
- }
-
- if (0 == replacementCount) /* no RLE so it's a literal by default.*/
- {
- unsigned int tempPixel = getPixel(curPtr, curPixel);
- unsigned int tempPixel2 = 0;
- CMDByte = eLiteral;
-
- if (cachedColor == tempPixel)
- {
- pixelSource = (byte) eeCachedColor;
- }
- else if (getPixel(seedPtr, curPixel+1) == tempPixel)
- {
- pixelSource = (byte)eeNEPixel;
- }
- else if ((curPixel > 0) && (getPixel(curPtr, curPixel-1) == tempPixel))
- {
- pixelSource = (byte) eeWPixel;
- }
- else
- {
- pixelSource = (byte) eeNewPixel;
- cachedColor = tempPixel;
- }
-
- replacementCount = curPixel;
- do
- {
- if (++curPixel == lastPixel)
- {
- putPixel(curPtr, lastPixel, realLastPixel);
- curPixel++;
- break;
- }
-
- tempPixel2 = getPixel(curPtr, curPixel);
-
- } while ((tempPixel2 != getPixel(curPtr, curPixel+1)) &&
- (tempPixel2 != getPixel(seedPtr, curPixel)));
-
- replacementCount = curPixel - replacementCount;
- }
- }
-
- /* Write out compressed data next.*/
- if (eLiteral == CMDByte)
- {
- unsigned int totalReplacementCount = 0;
- unsigned int upwardPixelCount = 0;
-
- replacementCount --; /* normalize it*/
-
- CMDByte |= (byte) pixelSource; /* Could put this directly into CMDByte above.*/
- CMDByte |= (byte)(MIN(3, seedRowPixelCopyCount) << 3);
- CMDByte |= (byte)MIN(7, replacementCount);
-
- *compressedDataPtr++ = (byte)CMDByte;
-
- if (seedRowPixelCopyCount >= 3)
- {
- byte temp;
- int number = seedRowPixelCopyCount - 3;
- do
- {
- *compressedDataPtr++ = temp = (byte)(MIN(number, 255));
- if (255 == number)
- {
- *compressedDataPtr++ = 0;
- }
- } while(number -= temp);
- }
-
- replacementCount ++; /* denormalize it*/
-
- totalReplacementCount = replacementCount;
- upwardPixelCount = 1;
-
- if (eeNewPixel != pixelSource)
- {
- /* Do not encode 1st pixel of run since it comes from an alternate location.*/
- replacementCount --;
-
- upwardPixelCount = 2;
- }
-
- for ( ; upwardPixelCount <= totalReplacementCount; upwardPixelCount++)
- {
- unsigned int tempCount = curPixel-replacementCount;
- unsigned int compressedPixel = ShortDelta(curPtr, seedPtr, tempCount);
-
- if (compressedPixel)
- {
- *compressedDataPtr++ = (byte)(compressedPixel >> 8);
- *compressedDataPtr++ = (byte)(compressedPixel);
- }
- else
- {
- unsigned int uncompressedPixel = getPixel(curPtr, tempCount) >>1;
- *compressedDataPtr++ = (byte)(uncompressedPixel >> 16);
- *compressedDataPtr++ = (byte)(uncompressedPixel >> 8);
- *compressedDataPtr++ = (byte)(uncompressedPixel);
- }
- /* See if it's time to spill a single VLI byte.*/
- if (upwardPixelCount>=8 && ((upwardPixelCount-8) % 255) == 0)
- {
- *compressedDataPtr++ = (byte)(MIN(255, totalReplacementCount - upwardPixelCount));
- }
-
- replacementCount--;
- }
- }
- else /* RLE */
- {
- replacementCount -= 2; /* normalize it*/
-
- CMDByte |= pixelSource; /* Could put this directly into CMDByte above.*/
- CMDByte |= MIN(3, seedRowPixelCopyCount) << 3;
- CMDByte |= MIN(7, replacementCount);
-
- *compressedDataPtr++ = (byte)CMDByte;
-
- if (seedRowPixelCopyCount >= 3)
- {
- byte temp;
- int number = seedRowPixelCopyCount - 3;
- do
- {
- *compressedDataPtr++ = temp = (byte)(MIN(number, 255));
- if (255 == number)
- {
- *compressedDataPtr++ = 0;
- }
-
- } while(number -= temp);
- }
-
- replacementCount += 2; /* denormalize it*/
-
- if (eeNewPixel == pixelSource)
- {
- unsigned int tempCount = curPixel - replacementCount;
- unsigned int compressedPixel = ShortDelta(curPtr, seedPtr, tempCount);
-
- if (compressedPixel)
- {
- *compressedDataPtr++ = (byte)(compressedPixel >> 8);
- *compressedDataPtr++ = (byte)compressedPixel;
- }
- else
- {
- unsigned int uncompressedPixel = getPixel(curPtr, tempCount) >>1;
- *compressedDataPtr++ = (byte)(uncompressedPixel >> 16);
- *compressedDataPtr++ = (byte)(uncompressedPixel >> 8);
- *compressedDataPtr++ = (byte)uncompressedPixel;
- }
- }
-
- if (replacementCount >= 9)
- {
- byte temp;
- int number = replacementCount - 9;
- do
- {
- *compressedDataPtr++ = temp = (byte)(MIN(number, 255));
- if (255 == number)
- {
- *compressedDataPtr++ = 0;
- }
-
- } while(number -= temp);
- }
- }
- } while (curPixel <= lastPixel);
-
- /*return # of compressed bytes*/
- return compressedDataPtr - compressedDataStart;
-}
-
-/* HP2200 helper function to check if a scanline has any non-white pixels.
- This allows us to optimise printing by using PCL moves instead of sending
- white rasters.
-
- Since white is 0xFFFFFF (24 bits), there must be non-white pixels if
- there is a byte which is not 0xFF
-*/
-private int
-IsScanlineDirty(byte* pScanline, int iWidth)
-{
- byte * pCurr = pScanline;
- byte * pStop = pCurr + iWidth;
-
- while (pStop-pCurr)
- {
- if (*pCurr - 0xFF)
- {
- /* not 0xFF => dirty */
- return 1;
- }
- ++pCurr;
- }
- return 0;
-}
-
-#define INIT_WHITE(pBuf, uiWidth) memset((void*)(pBuf), 0xFF, (uiWidth))
-
-/* HP2200 output routine -------------------- */
-private int
-chp2200_print_page(gx_device_printer * pdev, FILE * prn_stream)
-{
- gs_memory_t *mem = pdev->memory;
- int width_in_pixels = pdev->width;
- int width_in_bytes = width_in_pixels * 3; /* assume 24 bits (3 bytes per pixel) */
- byte *lbuf = gs_alloc_bytes(mem, width_in_bytes,
- "(input)chp2200_print_page");
- byte *lseedbuf = gs_alloc_bytes(mem, width_in_bytes,
- "(seed)chp2200_print_page");
- /* allocate twice the input size for worse case compressed output*/
- byte *loutputbuf = gs_alloc_bytes(mem, width_in_bytes*2,
- "(output)chp2200_print_page");
-
- int lnum = 0;
- int iEmptyRows = 0;
- byte *data = lbuf;
-
- if ((lbuf == 0) || (lseedbuf == 0) || (loutputbuf == 0))
- return_error(gs_error_VMerror);
-
- /* Start Raster mode */
- (*cdj850->start_raster_mode) (pdev,
- gdev_pcl_paper_size((gx_device *)pdev),
- prn_stream);
-
- /* start the scanline */
- fputs("\033*b", prn_stream);
-
- /* initialise buffers */
- INIT_WHITE(lseedbuf, width_in_bytes);
-
- for (lnum = 0; lnum < pdev->height; ++lnum)
- {
- int result = -1;
-
- /*gdev_prn_get_bits(pdev, lnum, lbuf, &data);*/
- result = gdev_prn_copy_scan_lines(pdev, lnum, data, width_in_bytes);
-
- if ((result == 1) && IsScanlineDirty(data, width_in_bytes))
- {
- unsigned int OutputLen = 0;
-
- if (iEmptyRows)
- {
- /* send vertical Y move */
- fprintf(prn_stream, "%dy", iEmptyRows);
-
- /* reset empty row count */
- iEmptyRows = 0;
-
- /* reset seed buffer */
- INIT_WHITE(lseedbuf, width_in_bytes);
- }
-
- OutputLen = Mode10(width_in_pixels,
- data,
- lseedbuf,
- loutputbuf);
-
- if (OutputLen)
- {
- fprintf(prn_stream, "%dw", OutputLen);
- fwrite(loutputbuf, sizeof(byte), OutputLen, prn_stream);
-
- /* save the current scanline as the seed for the next scanline*/
- memcpy((void*)lseedbuf, (const void*)data, width_in_bytes);
- }
- else
- {
- fputs("0w", prn_stream);
- }
- }
- else
- {
- iEmptyRows++;
- }
- }
-
- /* terminate the scanline */
- fputs("0Y", prn_stream);
-
- /* terminate page and eject paper */
- (*cdj850->terminate_page) (pdev, prn_stream);
-
- gs_free_object(mem, lbuf, "(input)chp2200_print_page");
- gs_free_object(mem, lseedbuf, "(seed)chp2200_print_page");
- gs_free_object(mem, loutputbuf, "(output)chp2200_print_page");
-
- return 0;
-}
-
-
-#define odd(i) ((i & 01) != 0)
-
-private int
-GetScanLine(gx_device_printer * pdev, int *lnum,
- struct ptr_arrays *data_ptrs,
- struct misc_struct *misc_vars,
- word rmask)
-{
- word *data_words = (word *) data_ptrs->data[misc_vars->scan];
- register word *end_data = data_words + misc_vars->line_size_words;
-
- ++(*lnum);
- gdev_prn_copy_scan_lines(pdev, *lnum, (byte *) data_words, misc_vars->line_size);
-
- misc_vars->scan = !misc_vars->scan; /* toggle scan direction */
- misc_vars->is_two_pass = odd(*lnum); /* color output for odd lines */
-
- /* Mask off 1-bits beyond the line width. */
- end_data[-1] &= rmask;
-
- /* Remove trailing 0s. */
- while (end_data > data_words && end_data[-1] == 0)
- end_data--;
-
- return end_data - data_words;
-}
-
-/* Send the scan lines to the printer */
-private void
-send_scan_lines(gx_device_printer * pdev,
- struct ptr_arrays *data_ptrs,
- struct misc_struct *misc_vars,
- struct error_val_field *error_values,
- const Gamma *gamma,
- FILE * prn_stream)
-{
- int lnum, lend, llen;
- int num_blank_lines = 0;
-
- word rmask =
- ~(word) 0 << ((-pdev->width * misc_vars->storage_bpp) & (W * 8 - 1));
-
- lend = pdev->height - (dev_t_margin(pdev) + dev_b_margin(pdev)) * y_dpi;
-
- error_values->c = error_values->m = error_values->y =
- error_values->k = 0;
-
- /* init the error buffer */
- init_error_buffer(misc_vars, data_ptrs);
-
- misc_vars->zero_row_count = 0;
- lnum = -1;
- llen = GetScanLine(pdev, &lnum, data_ptrs, misc_vars, rmask);
- while (lnum < lend) {
- num_blank_lines = 0;
- while (lnum < lend && llen == 0) {
- ++num_blank_lines;
- llen = GetScanLine(pdev, &lnum, data_ptrs, misc_vars, rmask);
- }
- if (lnum >= lend) {
- break;
- }
- /* Skip blank lines if any */
- if (num_blank_lines > 0) {
- fprintf(prn_stream, "\033*b%dY", num_blank_lines / (cdj850->yscal + 1));
- memset(data_ptrs->plane_data[0][0], 0,
- (misc_vars->plane_size * 2 * misc_vars->num_comps));
- memset(data_ptrs->plane_data_c[0][0], 0,
- (misc_vars->plane_size_c * 2 * misc_vars->num_comps));
-
- }
- /* all blank lines printed, now for the non-blank lines */
- if (cdj850->yscal && odd(lnum)) {
- /* output a blank black plane for odd lines */
- fprintf(prn_stream, "\033*b0V");
- }
- /* now output all non blank lines */
- while (lnum < lend && llen != 0) {
- misc_vars->is_color_data = 0; /* maybe we have color ? */
- (*cdj850->print_non_blank_lines) (pdev, data_ptrs, misc_vars,
- error_values, gamma, prn_stream);
- llen = GetScanLine(pdev, &lnum, data_ptrs, misc_vars, rmask);
- }
- if (cdj850->yscal && odd(lnum)) { /* output empty line for odd lines */
- (*cdj850->print_non_blank_lines) (pdev, data_ptrs, misc_vars,
- error_values, gamma, prn_stream);
- }
- /* the current line is empty => run the next iteration */
- }
-}
-
-/* print_line compresses (mode 9) and outputs one plane */
-private void
-print_c9plane(FILE * prn_stream, char plane_code, int plane_size,
- const byte * curr, const byte * prev, byte * out_data)
-{
- /* Compress the output data */
- int out_count = gdev_pcl_mode9compress(plane_size, curr, prev, out_data);
-
- /* and output the data */
- fprintf(prn_stream, "%d%c", out_count, plane_code);
- if (out_count > 0) {
- fwrite(out_data, sizeof(byte), out_count, prn_stream);
- }
-}
-
-
-/* print_c2plane()
- *
- * Compresses a single plane with mode 2 (TIFF 4 format) and sends the
- * result to the output.
- */
-private void
-print_c2plane(FILE *prn_stream, char plane_code, int plane_size,
- const byte *curr, byte *out_data)
-{
- /*
- * Compress the output data
- */
- int out_count = gdev_pcl_mode2compress((const word *)curr,
- (const word *)(curr +plane_size -2), out_data);
-
- /*
- * Send it out
- */
- fprintf(prn_stream, "%d%c", out_count, plane_code);
- if (out_count > 0)
- fwrite(out_data, sizeof(byte), out_count, prn_stream);
-}
-
-
-/* print_c0plane()
- *
- * Outputs a plane with no compression.
- */
-private void
-print_c0plane(FILE *prn_stream, char plane_code, int plane_size,
- const byte *curr, byte *out_data)
-{
- fprintf(prn_stream, "%d%c", plane_size, plane_code);
- if (plane_size > 0)
- fwrite(curr, sizeof(byte), plane_size, prn_stream);
-}
-
-
-/* Printing non-blank lines */
-private void
-cdj850_print_non_blank_lines(gx_device_printer * pdev,
- struct ptr_arrays *data_ptrs,
- struct misc_struct *misc_vars,
- struct error_val_field *error_values,
- const Gamma *gamma,
- FILE * prn_stream)
-{
- static const char *const plane_code[2] =
- {"wvvv", "vvvv"};
-
- int i;
- byte *kP = data_ptrs->plane_data[misc_vars->scan + 2][3];
- byte *dp = data_ptrs->data[misc_vars->scan + 2];
- int *ep = data_ptrs->errors[misc_vars->scan];
-
- /* we need cmyk color separation befor all the rest, since
- black may be contained in the color fields. This needs to
- be done on all pixel-rows, since even unused color-bytes
- might generate black */
-
- misc_vars->is_color_data =
- do_gcr(misc_vars->databuff_size, data_ptrs->data[misc_vars->scan],
- gamma->k, gamma->c, gamma->m, gamma->y, gamma->correct,
- (word *) data_ptrs->data[misc_vars->scan]);
-
- /* dithering the black-plane */
- FSDlinebw(misc_vars->scan, misc_vars->plane_size,
- error_values, kP, misc_vars->num_comps, ep, dp);
-
- /* output the black plane */
- print_c9plane(prn_stream, 'v', misc_vars->plane_size,
- data_ptrs->plane_data[misc_vars->scan][3],
- data_ptrs->plane_data[1 - misc_vars->scan][3],
- data_ptrs->out_data);
-
- /* since color resolution is only half of the b/w-resolution,
- we only output every second row */
- if (!cdj850->yscal || misc_vars->is_two_pass) {
-
- int plane_size_c = (*rescale_color_plane[cdj850->xscal][cdj850->yscal])
- (misc_vars->databuff_size,
- data_ptrs->data[misc_vars->scan],
- data_ptrs->data[!misc_vars->scan],
- data_ptrs->data_c[misc_vars->cscan]) / misc_vars->storage_bpp;
-
- /* dither the color planes */
- do_floyd_steinberg(misc_vars->scan, misc_vars->cscan,
- misc_vars->plane_size, plane_size_c,
- misc_vars->num_comps, data_ptrs, pdev, error_values);
-
- /* Transfer raster graphics in the order C, M, Y, that is
- planes 2,1,0 */
- for (i = misc_vars->num_comps - 2; i >= 0; i--) {
-
- /* output the lower color planes */
- print_c9plane(prn_stream, plane_code[cdj850->intensities > 2][i],
- plane_size_c,
- data_ptrs->plane_data_c[misc_vars->cscan][i],
- data_ptrs->plane_data_c[1 - misc_vars->cscan][i],
- data_ptrs->out_data);
-
- /* output the upper color planes */
- if (cdj850->intensities > 2) {
- print_c9plane(prn_stream, plane_code[0][i], plane_size_c,
- data_ptrs->plane_data_c[misc_vars->cscan][i + 4],
- data_ptrs->plane_data_c[1 -
- misc_vars->cscan][i
- + 4],
- data_ptrs->out_data);
- } /* end cdj850->intensities > 2 */
- } /* End For i = num_comps */
- misc_vars->cscan = 1 - misc_vars->cscan;
- } /* End of is_two_pass */
- return;
-}
-
-/* Printing non-blank lines */
-private void
-cdj880_print_non_blank_lines(gx_device_printer * pdev,
- struct ptr_arrays *data_ptrs,
- struct misc_struct *misc_vars,
- struct error_val_field *error_values,
- const Gamma *gamma,
- FILE * prn_stream)
-{
- static const char *const plane_code[2] =
- {"WVVV", "VVVV"};
-
- int i;
- byte *kP = data_ptrs->plane_data[misc_vars->scan + 2][3];
- byte *dp = data_ptrs->data[misc_vars->scan + 2];
- int *ep = data_ptrs->errors[misc_vars->scan];
-
- /* we need cmyk color separation befor all the rest, since
- black may be contained in the color fields. This needs to
- be done on all pixel-rows, since even unused color-bytes
- might generate black */
-
- misc_vars->is_color_data =
- do_gcr(misc_vars->databuff_size, data_ptrs->data[misc_vars->scan],
- gamma->k, gamma->c, gamma->m, gamma->y, gamma->correct,
- (word *) data_ptrs->data[misc_vars->scan]);
-
- /* dithering the black-plane */
- FSDlinebw(misc_vars->scan, misc_vars->plane_size,
- error_values, kP, misc_vars->num_comps, ep, dp);
-
- /* output the black plane */
- fputs("\033*b", prn_stream);
- print_c2plane(prn_stream, 'V', misc_vars->plane_size,
- data_ptrs->plane_data[misc_vars->scan][3],
-/* data_ptrs->plane_data[1 - misc_vars->scan][3],*/
- data_ptrs->out_data);
-/* fputs("\033*b0V", prn_stream);*/
-
- /* since color resolution is only half of the b/w-resolution,
- we only output every second row */
- if (!cdj850->yscal || misc_vars->is_two_pass) {
-
- int plane_size_c = (*rescale_color_plane[cdj850->xscal][cdj850->yscal])
- (misc_vars->databuff_size,
- data_ptrs->data[misc_vars->scan],
- data_ptrs->data[!misc_vars->scan],
- data_ptrs->data_c[misc_vars->cscan]) / misc_vars->storage_bpp;
-
- /* dither the color planes */
- do_floyd_steinberg(misc_vars->scan, misc_vars->cscan,
- misc_vars->plane_size, plane_size_c,
- misc_vars->num_comps, data_ptrs, pdev, error_values);
-
- /* Transfer raster graphics in the order C, M, Y, that is
- planes 2,1,0 */
- for (i = misc_vars->num_comps - 2; i >= 0; i--) {
-
- /* output the lower color planes */
- fputs("\033*b", prn_stream);
- print_c2plane(prn_stream, plane_code[cdj850->intensities > 2][i],
- plane_size_c,
- data_ptrs->plane_data_c[misc_vars->cscan][i],
-/* data_ptrs->plane_data_c[1 - misc_vars->cscan][i],*/
- data_ptrs->out_data);
-
- /* output the upper color planes */
- if (cdj850->intensities > 2) {
- fputs("\033*b", prn_stream);
- print_c2plane(prn_stream, plane_code[0][i], plane_size_c,
- data_ptrs->plane_data_c[misc_vars->cscan][i + 4],
-/* data_ptrs->plane_data_c[1 -
- misc_vars->cscan][i
- + 4],*/
- data_ptrs->out_data);
- } /* end cdj850->intensities > 2 */
- } /* End For i = num_comps */
- misc_vars->cscan = 1 - misc_vars->cscan;
- } /* End of is_two_pass */
- return;
-}
-
-/* moved that code into his own subroutine, otherwise things get
- somewhat clumsy */
-private void
-do_floyd_steinberg(int scan, int cscan, int plane_size,
- int plane_size_c, int n,
- struct ptr_arrays *data_ptrs,
- gx_device_printer * pdev,
- struct error_val_field *error_values)
-{
- /* the color pointers */
- byte *cPa, *mPa, *yPa, *cPb, *mPb, *yPb;
- byte *dpc;
- int *epc;
-
- /* the b/w pointers */
- byte *kP, *dp;
- int *ep;
-
- /* the color pointers, lower byte */
- cPa = data_ptrs->plane_data_c[cscan + 2][2];
- mPa = data_ptrs->plane_data_c[cscan + 2][1];
- yPa = data_ptrs->plane_data_c[cscan + 2][0];
- /* upper byte */
- cPb = data_ptrs->plane_data_c[cscan + 2][6];
- mPb = data_ptrs->plane_data_c[cscan + 2][5];
- yPb = data_ptrs->plane_data_c[cscan + 2][4];
- /* data and error */
- dpc = data_ptrs->data_c[cscan + 2];
- epc = data_ptrs->errors_c[cscan];
- /* the b/w pointers */
- kP = data_ptrs->plane_data[scan + 2][3];
- dp = data_ptrs->data[scan + 2];
- ep = data_ptrs->errors[scan];
-
- switch (cdj850->intensities) {
- case 2:
- FSDlinec2(cscan, plane_size_c, error_values,
- cPa, mPa, yPa, n, dpc, epc);
- break;
- case 3:
- FSDlinec3(cscan, plane_size_c, error_values,
- cPa, mPa, yPa, cPb, mPb, yPb, n, dpc, epc);
- break;
- case 4:
- FSDlinec4(cscan, plane_size_c, error_values,
- cPa, mPa, yPa, cPb, mPb, yPb, n, dpc, epc);
- break;
- default:
- assert(0);
- }
- return;
-}
-
-/* here we do our own gamma-correction */
-private void
-do_gamma(float mastergamma, float gammaval, byte values[256])
-{
- int i;
- float gamma;
-
- if (gammaval > 0.0) {
- gamma = gammaval;
- } else {
- gamma = mastergamma;
- }
-
- for (i = 0; i < 256; i++) {
- values[i] = (byte) (255.0 *
- (1.0 - pow(((double)(255.0 - (float)i) / 255.0),
- (double)(1.0 / gamma))));
- }
-
- return;
-}
-
-/* here we calculate a lookup-table which is used to compensate the
- relative loss of color due to undercolor-removal */
-private void
-do_black_correction(float kvalue, int kcorrect[256])
-{
- int i;
-
- for (i = 0; i < 256; i++) {
- kcorrect[i] = 0;
-#if 0
- kcorrect[i] = (int)
- (100.0 * kvalue * (
- pow(10.0,
- pow((i / 255.0), 3.0)
- )
- - 1.0
- )
- );
-#endif /* 0 */
- }
-
- return;
-}
-
-/* For Better Performance we use a macro here */
-#define DOUCR(col1, col2, col3, col4)\
-{\
- /* determine how far we are from the grey axis. This is */\
- /* traditionally done by computing MAX(CMY)-MIN(CMY). */\
- /* However, if two colors are very similar, we could */\
- /* as either CMYRGB and K. Therefore we calculate the */\
- /* the distance col1-col2 and col2-col3, and use the */\
- /* smaller one. */\
- a = *col1 - *col2;\
- b = *col2 - *col3;\
- if (a >= b) {\
- grey_distance = 1.0 - (b/255.0);\
- } else {\
- grey_distance = 1.0 - (a/255.0);\
- }\
- ucr = (byte) (*col3 * grey_distance); \
- *col4 = *col4 + ucr; /* add removed black to black */\
- /* remove only as much color as black is surviving the */\
- /* gamma correction */\
- ucr = *(kvalues + ucr);\
- *col1 = *col1 - ucr ;\
- *col2 = *col2 - ucr ;\
- *col3 = *col3 - ucr ;\
-}
-
-/* For Better Performance we use a macro here */
-#define DOGCR(col1, col2, col3, col4)\
-{\
- int ucr = (int) *col3;\
- *col1 -= ucr ;\
- *col2 -= ucr ;\
- *col3 -= ucr ;\
- *col4 += ucr; /* add removed black to black */\
- kadd = ucr + *(kcorrect + ucr);\
- uca_fac = 1.0 + (kadd/255.0);\
- *col1 *= uca_fac;\
- *col2 *= uca_fac;\
-}
-
-#define NOBLACK(col1, col2, col3, col4)\
-{\
- ucr = (int) *col4;\
- *col1 += ucr;\
- *col2 += ucr;\
- *col3 += ucr;\
- *col4 = 0;\
-}
-
-/* Since resolution can be different on different planes, we need to
- do real color separation, here we try a real grey component
- replacement */
-private int
-do_gcr(int bytecount, byte * inbyte, const byte kvalues[256],
- const byte cvalues[256], const byte mvalues[256],
- const byte yvalues[256], const int kcorrect[256],
- word * inword)
-{
- int i, ucr, kadd, is_color = 0;
- float uca_fac;
- byte *black, *cyan, *magenta, *yellow;
- word last_color_value = 0;
- word *last_color;
- char output[255], out2[128];
-
- /* initialise *last_color with a dummmy value */
- last_color = &last_color_value;
- /* Grey component replacement */
- for (i = 0; i < bytecount; i += 4) {
-
- /* Assign to black the current address of inbyte */
- black = inbyte++;
- cyan = inbyte++;
- magenta = inbyte++;
- yellow = inbyte++;
-
- if (black > 0)
- NOBLACK(cyan, magenta, yellow, black);
-
- if (*magenta + *yellow + *cyan > 0) { /* if any color at all */
-
-#if 0
- if ((*cyan > 0) && (*magenta > 0) && (*yellow > 0))
- {
- sprintf(output, "%3d %3d %3d %3d - ", *cyan, *magenta, *yellow, *black);
- debug_print_string(output, strlen(output));
- }
-#endif /* 0 */
-
- is_color = 1;
-
- /* Test whether we 've already computet the value */
- if (*inword == last_color_value) {
- /* save a copy of the current color before it will be modified */
- last_color_value = *inword;
-/* debug_print_string("\n", 1);*/
- /* copy the result of the old value onto the new position */
- *inword = *last_color;
- } else {
- /* save a copy of the current color before it will be modified */
- last_color_value = *inword;
- NOBLACK(cyan, magenta, yellow, black);
- if ((*cyan >= *magenta)
- && (*magenta >= *yellow)
- && (*yellow > 0)) { /* if any grey component */
- NOBLACK(cyan, magenta, yellow, black);
- } else if ((*cyan >= *yellow)
- && (*yellow >= *magenta)
- && (*magenta > 0)) {
- NOBLACK(cyan, yellow, magenta, black);
- } else if ((*yellow >= *magenta)
- && (*magenta >= *cyan)
- && (*cyan > 0)) {
- NOBLACK(yellow, magenta, cyan, black);
- } else if ((*yellow >= *cyan)
- && (*cyan >= *magenta)
- && (*magenta > 0)) {
- NOBLACK(yellow, cyan, magenta, black);
- } else if ((*magenta >= *yellow)
- && (*yellow >= *cyan)
- && (*cyan > 0)) {
- NOBLACK(magenta, yellow, cyan, black);
- } else if ((*magenta >= *cyan)
- && (*cyan >= *yellow)
- && (*yellow > 0)) {
- NOBLACK(magenta, cyan, yellow, black);
- } else { /* do gamma only if no black */
- }
-#if 0
- if (ucr > 0)
- {
- sprintf(output, "%3d %3d %3d %3d - %5d\n", *cyan, *magenta, *yellow, *black, ucr);
- debug_print_string(output, strlen(output));
- }
-#endif /* 0 */
- if ( *cyan > 255) *cyan = 255;
- if (*magenta > 255) *magenta = 255;
- if ( *yellow > 255) *yellow = 255;
-
- *cyan = *(cvalues + *cyan);
- *magenta = *(mvalues + *magenta);
- *yellow = *(yvalues + *yellow);
- last_color = inword; /* save pointer */
- }/* end current_color */
- } /* end of if c+m+y > 0 */
- *black = *(kvalues + *black);
- inword = inword + 1;
- } /* end of for bytecount */
- return is_color;
-}
-
-/* Since resolution can be different on different planes, we need to
- rescale the data byte by byte */
-private int
-rescale_byte_wise2x2(int bytecount, const byte * inbytea, const byte * inbyteb,
- byte * outbyte)
-{
- register int i, j;
- int max = bytecount / 2;
-
- for (i = 0; i < max; i += 4) {
- j = 2 * i;
- /* cyan */
- outbyte[i + 1] = (inbytea[j + 1] + inbytea[j + 5] + inbyteb[j + 1] +
- inbyteb[j + 5]) / 4;
- /* magenta */
- outbyte[i + 2] = (inbytea[j + 2] + inbytea[j + 6] + inbyteb[j + 2] +
- inbyteb[j + 6]) / 4;
- /* yellow */
- outbyte[i + 3] = (inbytea[j + 3] + inbytea[j + 7] + inbyteb[j + 3] +
- inbyteb[j + 7]) / 4;
- }
- return max;
-}
-
-/* Since resolution can be different on different planes, we need to
- rescale the data byte by byte */
-private int
-rescale_byte_wise2x1(int bytecount, const byte * inbytea, const byte * inbyteb,
- byte * outbyte)
-{
- register int i, j;
- int max = bytecount / 2;
-
- for (i = 0; i < max; i += 4) {
- j = 2 * i;
- /* cyan */
- outbyte[i + 1] = (inbytea[j + 1] + inbytea[j + 5]) / 2;
- /* magenta */
- outbyte[i + 2] = (inbytea[j + 2] + inbytea[j + 6]) / 2;
- /* yellow */
- outbyte[i + 3] = (inbytea[j + 3] + inbytea[j + 7]) / 2;
- }
- return max;
-}
-
-/* Since resolution can be different on different planes, we need to
- rescale the data byte by byte */
-private int
-rescale_byte_wise1x2(int bytecount, const byte * inbytea, const byte * inbyteb,
- byte * outbyte)
-{
- register int i;
-
- for (i = 0; i < bytecount; i += 4) {
- /* cyan */
- outbyte[i + 1] = (inbytea[i + 1] + inbyteb[i + 1]) / 2;
- /* magenta */
- outbyte[i + 2] = (inbytea[i + 2] + inbyteb[i + 2]) / 2;
- /* yellow */
- outbyte[i + 3] = (inbytea[i + 3] + inbyteb[i + 3]) / 2;
- }
- return bytecount;
-}
-
-/* Since resolution can be different on different planes, we need to
- rescale the data byte by byte */
-private int
-rescale_byte_wise1x1(int bytecount, const byte * inbytea, const byte * inbyteb,
- byte * outbyte)
-{
- register int i;
-
- for (i = 0; i < bytecount; i += 4) {
- /* cyan */
- outbyte[i + 1] = inbytea[i + 1];
- /* magenta */
- outbyte[i + 2] = inbytea[i + 2];
- /* yellow */
- outbyte[i + 3] = inbytea[i + 3];
- }
- return bytecount;
-}
-
-/* MACROS FOR DITHERING (we use macros for compact source and faster code) */
-/* Floyd-Steinberg dithering. Often results in a dramatic improvement in
- * subjective image quality, but can also produce dramatic increases in
- * amount of printer data generated and actual printing time!! Mode 9 2D
- * compression is still useful for fairly flat colour or blank areas but its
- * compression is much less effective in areas where the dithering has
- * effectively randomised the dot distribution. */
-
-#define SHIFT ((I * 8) - 13)
-#define C 8
-
-#define BLACKOFFSET (128 << SHIFT) /* distance from min to max */
-#define THRESHOLD (128 << SHIFT)
-#define MAXVALUE (THRESHOLD + BLACKOFFSET)
-
-/* -64 to 64 */
-#define RANDOM ((rand() << SHIFT) % THRESHOLD - (THRESHOLD >> 1))
-
-/* --- needed for the hp850 color -- */
-/*
-
-Mode Planes Intensity
-Low A 1.0
-Medium B 1.5
-High A&B 2.0
-
-Note that planes A&B is not the sum of the intensities of plane A and plane B.
-
-Range Planes Max Intensity
-0-63 A < 50% 0.5
-64-127 A > 50% 1.0
-128-191 B > 50% 1.5
-192-255 A&B > 50% 2.0
-
-Note some specific values:
-Value Planes Intensity
-0 0 0.0
-32 25% A 0.25
-64 50% A 0.5
-128 100% A 1.0
-129 99% A, 1% B 1.01
-192 100% B 1.5
-255 100% C 2.0
-
-Keep in mind that only the range 0-63 has a pixel rate <50%. All others
-have a pixel rate >50%.
-
-*/
-
-#define COLOROFFSET ( 64 << SHIFT) /* distance between color intensities */
-
-#define THRESHOLDS ( 64 << SHIFT) /* intensity A */
-#define THRESHOLDM (128 << SHIFT) /* intensity B */
-#define THRESHOLDL (192 << SHIFT) /* intensities A & B */
-
-#define MAXVALUES (THRESHOLDS + COLOROFFSET)
-#define MAXVALUEM (THRESHOLDM + COLOROFFSET)
-#define MAXVALUEL (THRESHOLDL + COLOROFFSET)
-
-#define CRANDOM ((rand() << SHIFT) % THRESHOLDS - (THRESHOLDS >> 1))
-
-/* --------------------------- */
-
-/* initialise the error_buffer */
-private void
-init_error_buffer(struct misc_struct * misc_vars,
- struct ptr_arrays * data_ptrs)
-{
- int i;
- int *ep;
- int *epc;
-
- ep = data_ptrs->errors[0];
- epc = data_ptrs->errors_c[0];
-
- if (misc_vars->bits_per_pixel > 4) { /* Randomly seed initial error
- buffer */
- /* Otherwise, the first dithered rows would look rather uniform */
- for (i = 0; i < misc_vars->databuff_size; i++) { /* 600dpi planes */
- *ep++ = RANDOM;
- }
-
- /* Now for the 2 * 300dpi color planes */
- for (i = 0; i < misc_vars->databuff_size_c; i++) {
- *epc++ = CRANDOM;
- }
- }
- return;
-}
-
-#define FSdither(inP, out, errP, Err, Bit, Offset, Element)\
-{\
- oldErr = Err;\
- Err = (*(errP + Element)\
- + ((Err * 7 + C) >> 4)\
- + ((int)*(inP + Element) << SHIFT));\
- if (Err > THRESHOLD || *(inP + Element) == 255 /* b/w optimization */) {\
- out |= Bit;\
- Err -= MAXVALUE;\
- }\
- *(errP + (Element + Offset)) += ((Err * 3 + C) >> 4);\
- *(errP + Element) = ((Err * 5 + oldErr + C) >> 4);\
-}
-
-
-/* FSDlinebw()
- *
- * Floyd-steinberg dithering for the black plane. The 850C has 600dpi
- * black and 300dpi color, but the 880C and siblings have 600dpi black
- * AND color. Therefore, we need an adapted dither algorithm.
- *
- * Inputs: scan
- *
- * plane_size
- *
- * error_values
- *
- * kP
- *
- * n
- *
- * ep
- *
- * dp
- *
- * Returns: Nothing.
- */
-private void
-FSDlinebw(int scan, int plane_size,
- struct error_val_field * error_values,
- byte * kP, int n, int * ep, byte * dp)
-{
- if (scan == 0) { /* going_up */
- byte k, bitmask; /* k = outbyte byte, whereas bitmask defines the
- bit to be set within k */
- int oldErr, i;
-
- for (i = 0; i < plane_size; i++) {
- bitmask = 0x80;
- for (k = 0; bitmask != 0; bitmask >>= 1) {
- /* dp points to the first word of the input data which is in
- kcmy-format */
- /* k points to the beginning of the first outbut byte, which
- is filled up, bit by bit while looping over bytemask */
- /* ep points to the first word of the error-plane which
- contains the errors kcmy format */
- /* err_values->k tempararily holds the error-value */
- /* bitmask selects the bit to be set in the outbyte */
- /* n gives the offset for the byte selection within
- words. With simple cmyk-printing, this should be 4 */
- /* 0 points to the active color within the input-word, i.e. 0
- = black, 1 = cyan, 2 = yellow, 3 = magenta */
-
- FSdither(dp, k, ep, error_values->k, bitmask, -n, 0);
- dp += n, ep += n; /* increment the input and error pointer one
- word (=4 byte) further, in order to
- convert the next word into an bit */
- }
- *kP++ = k; /* fill the output-plane byte with the computed byte
- and increment the output plane pointer one byte */
- }
-
- } else { /* going_down */
- byte k, bitmask;
- int oldErr, i;
- for (i = 0; i < plane_size; i++) {
- bitmask = 0x01;
- for (k = 0; bitmask != 0; bitmask <<= 1) {
- dp -= n, ep -= n;
- FSdither(dp, k, ep, error_values->k, bitmask, n, 0);
- }
- *--kP = k;
- }
- }
- return;
-}
-
-/* Since bw has already been dithered for the hp850c, we need
- an adapted dither algorythm */
-private void
-FSDlinec2(int scan, int plane_size,
- struct error_val_field *error_values,
- byte * cPa, byte * mPa, byte * yPa, int n,
- byte * dp, int *ep)
-{
- if (scan == 0) { /* going_up */
- int oldErr, i;
- byte ca, ya, ma, bitmask;
-
- for (i = 0; i < plane_size; i++) {
- bitmask = 0x80;
- ca = ya = ma = 0;
- for (ca = 0; bitmask != 0; bitmask >>= 1) {
- FSdither(dp, ca, ep, error_values->c, bitmask, -n, n - 3);
- FSdither(dp, ma, ep, error_values->m, bitmask, -n, n - 2);
- FSdither(dp, ya, ep, error_values->y, bitmask, -n, n - 1);
- dp += n, ep += n;
- }
- *cPa++ = ca;
- *mPa++ = ma;
- *yPa++ = ya;
- }
-
- } else { /* going_down */
- byte ca, ya, ma, bitmask;
- int oldErr, i;
-
- for (i = 0; i < plane_size; i++) {
- bitmask = 0x01;
- ca = ya = ma = 0;
- for (ca = 0; bitmask != 0; bitmask <<= 1) {
- dp -= n, ep -= n;
- FSdither(dp, ya, ep, error_values->y, bitmask, n, n - 1);
- FSdither(dp, ma, ep, error_values->m, bitmask, n, n - 2);
- FSdither(dp, ca, ep, error_values->c, bitmask, n, n - 3);
- }
- *--yPa = ya;
- *--mPa = ma;
- *--cPa = ca;
- }
- }
- return;
-}
-
-/* while printing on paper, we only use 3 -intensities */
-#define FSdither8503(inP, outa, outb, errP, Err, Bit, Offset, Element)\
-{\
- oldErr = Err;\
- Err = (*(errP + Element)\
- + ((Err * 7 + C) >> 4)\
- + ((int) *(inP + Element) << SHIFT));\
- if ((Err > THRESHOLDS) && (Err <= THRESHOLDM)) {\
- outa |= Bit;\
- Err -= MAXVALUES;\
- }\
- if (Err > THRESHOLDM) {\
- outb |= Bit;\
- Err -= MAXVALUEM;\
- }\
- *(errP + (Element + Offset)) += ((Err * 3 + C) >> 4);\
- *(errP + Element) = ((Err * 5 + oldErr + C) >> 4);\
-}
-
-/* On ordinary paper, we'll only use 3 intensities with the hp850 */
-private void
-FSDlinec3(int scan, int plane_size,
- struct error_val_field *error_values,
- byte * cPa, byte * mPa, byte * yPa,
- byte * cPb, byte * mPb, byte * yPb,
- int n, byte * dp, int *ep)
-{
- if (scan == 0) { /* going_up */
- byte ca, ya, ma, cb, yb, mb, bitmask;
- int oldErr, i;
-
- for (i = 0; i < plane_size; i++) {
- bitmask = 0x80;
- ca = ya = ma = cb = yb = mb = 0;
- for (ca = 0; bitmask != 0; bitmask >>= 1) {
- FSdither8503(dp, ca, cb, ep, error_values->c, bitmask, -n, n
- - 3);
- FSdither8503(dp, ma, mb, ep, error_values->m, bitmask, -n, n
- - 2);
- FSdither8503(dp, ya, yb, ep, error_values->y, bitmask, -n, n
- - 1);
- dp += n, ep += n;
- }
- *cPa++ = ca;
- *mPa++ = ma;
- *yPa++ = ya;
- *cPb++ = cb;
- *mPb++ = mb;
- *yPb++ = yb;
- }
- } else { /* going_down */
- byte ca, ya, ma, cb, yb, mb, bitmask;
- int oldErr, i;
-
- for (i = 0; i < plane_size; i++) {
- bitmask = 0x01;
- ca = ya = ma = cb = yb = mb = 0;
- for (ca = 0; bitmask != 0; bitmask <<= 1) {
- dp -= n, ep -= n;
- FSdither8503(dp, ya, yb, ep, error_values->y, bitmask, n, n
- - 1);
- FSdither8503(dp, ma, mb, ep, error_values->m, bitmask, n, n
- - 2);
- FSdither8503(dp, ca, cb, ep, error_values->c, bitmask, n, n
- - 3);
- }
- *--yPa = ya;
- *--mPa = ma;
- *--cPa = ca;
- *--yPb = yb;
- *--mPb = mb;
- *--cPb = cb;
- }
- }
- return;
-}
-
-
-/* the hp850 knows about 4 different color intensities per color */
-#define FSdither8504(inP, outa, outb, errP, Err, Bit, Offset, Element)\
-{\
- oldErr = Err;\
- Err = (*(errP + Element)\
- + ((Err * 7 + C) >> 4)\
- + ((int) *(inP + Element) << SHIFT));\
- if ((Err > THRESHOLDS) && (Err <= THRESHOLDM)) {\
- outa |= Bit;\
- Err -= MAXVALUES;\
- }\
- if ((Err > THRESHOLDM) && (Err <= THRESHOLDL)) {\
- outb |= Bit;\
- Err -= MAXVALUEM;\
- }\
- if (Err > THRESHOLDL) {\
- outa |= Bit;\
- outb |= Bit;\
- Err -= MAXVALUEL;\
- }\
- *(errP + (Element + Offset)) += ((Err * 3 + C) >> 4);\
- *(errP + Element) = ((Err * 5 + oldErr + C) >> 4);\
-}
-
-/* The hp850c knows about 4 intensity levels per color. Once more, we need
- an adapted dither algorythm */
-private void
-FSDlinec4(int scan, int plane_size,
- struct error_val_field *error_values,
- byte * cPa, byte * mPa, byte * yPa,
- byte * cPb, byte * mPb, byte * yPb,
- int n, byte * dp, int *ep)
-{
- if (scan == 0) { /* going_up */
- byte ca, ya, ma, cb, yb, mb, bitmask;
- int oldErr, i;
-
- for (i = 0; i < plane_size; i++) {
- bitmask = 0x80;
- ca = ya = ma = cb = yb = mb = 0;
- for (ca = 0; bitmask != 0; bitmask >>= 1) {
- FSdither8504(dp, ca, cb, ep, error_values->c, bitmask, -n, n
- - 3);
- FSdither8504(dp, ma, mb, ep, error_values->m, bitmask, -n, n
- - 2);
- FSdither8504(dp, ya, yb, ep, error_values->y, bitmask, -n, n
- - 1);
- dp += n, ep += n;
- }
- *cPa++ = ca;
- *mPa++ = ma;
- *yPa++ = ya;
- *cPb++ = cb;
- *mPb++ = mb;
- *yPb++ = yb;
- }
- } else { /* going_down */
- byte ca, ya, ma, cb, yb, mb, bitmask;
- int oldErr, i;
-
- for (i = 0; i < plane_size; i++) {
- bitmask = 0x01;
- ca = ya = ma = cb = yb = mb = 0;
- for (ca = 0; bitmask != 0; bitmask <<= 1) {
- dp -= n, ep -= n;
- FSdither8504(dp, ya, yb, ep, error_values->y, bitmask, n, n
- - 1);
- FSdither8504(dp, ma, mb, ep, error_values->m, bitmask, n, n
- - 2);
- FSdither8504(dp, ca, cb, ep, error_values->c, bitmask, n, n
- - 3);
- }
- *--yPa = ya;
- *--mPa = ma;
- *--cPa = ca;
- *--yPb = yb;
- *--mPb = mb;
- *--cPb = cb;
- }
- }
- return;
-}
-
-
-/* calculate the needed memory */
-private void
-calculate_memory_size(gx_device_printer * pdev,
- struct misc_struct *misc_vars)
-{
- int xfac = cdj850->xscal ? 2 : 1;
-
- misc_vars->line_size = gdev_prn_raster(pdev);
- misc_vars->line_size_c = misc_vars->line_size / xfac;
- misc_vars->line_size_words = (misc_vars->line_size + W - 1) / W;
- misc_vars->paper_size = gdev_pcl_paper_size((gx_device *) pdev);
- misc_vars->num_comps = pdev->color_info.num_components;
- misc_vars->bits_per_pixel = pdev->color_info.depth;
- misc_vars->storage_bpp = misc_vars->num_comps * 8;
- misc_vars->expanded_bpp = misc_vars->num_comps * 8;
- misc_vars->errbuff_size = 0;
- misc_vars->errbuff_size_c = 0;
-
- misc_vars->plane_size = calc_buffsize(misc_vars->line_size, misc_vars->storage_bpp);
-
- /* plane_size_c is dependedend on the bits used for
- dithering. Currently 2 bits are sufficient */
- misc_vars->plane_size_c = 2 * misc_vars->plane_size / xfac;
-
- /* 4n extra values for line ends */
- /* might be wrong, see gdevcdj.c */
- misc_vars->errbuff_size =
- calc_buffsize((misc_vars->plane_size * misc_vars->expanded_bpp +
- misc_vars->num_comps * 4) * I, 1);
-
- /* 4n extra values for line ends */
- misc_vars->errbuff_size_c =
- calc_buffsize((misc_vars->plane_size_c / 2 * misc_vars->expanded_bpp
- + misc_vars->num_comps * 4) * I, 1);
-
- misc_vars->databuff_size =
- misc_vars->plane_size * misc_vars->storage_bpp;
-
- misc_vars->databuff_size_c =
- misc_vars->plane_size_c / 2 * misc_vars->storage_bpp;
-
-
- misc_vars->outbuff_size = misc_vars->plane_size * 4;
-
- misc_vars->storage_size_words = (((misc_vars->plane_size)
- * 2
- * misc_vars->num_comps)
- + misc_vars->databuff_size
- + misc_vars->errbuff_size
- + misc_vars->outbuff_size
- + ((misc_vars->plane_size_c)
- * 2
- * misc_vars->num_comps)
- + misc_vars->databuff_size_c
- + misc_vars->errbuff_size_c
- + (4 * misc_vars->plane_size_c))
- / W;
-
- return;
-}
-
-
-/* Initialise the needed pointers */
-private void
-init_data_structure(gx_device_printer * pdev,
- struct ptr_arrays *data_ptrs,
- struct misc_struct *misc_vars)
-{
- int i;
- byte *p = (byte *) data_ptrs->storage;
-
- misc_vars->scan = 0;
- misc_vars->cscan = 0;
- misc_vars->is_two_pass = 0;
-
- /* the b/w pointer */
- data_ptrs->data[0] = data_ptrs->data[1] = data_ptrs->data[2] = p;
- data_ptrs->data[3] = p + misc_vars->databuff_size;
- /* Note: The output data will overwrite part of the input-data */
-
- if (misc_vars->bits_per_pixel > 1) {
- p += misc_vars->databuff_size;
- }
- if (misc_vars->bits_per_pixel > 4) {
- data_ptrs->errors[0] = (int *)p + misc_vars->num_comps * 2;
- data_ptrs->errors[1] = data_ptrs->errors[0] + misc_vars->databuff_size;
- p += misc_vars->errbuff_size;
- }
- for (i = 0; i < misc_vars->num_comps; i++) {
- data_ptrs->plane_data[0][i] = data_ptrs->plane_data[2][i] = p;
- p += misc_vars->plane_size;
- }
- for (i = 0; i < misc_vars->num_comps; i++) {
- data_ptrs->plane_data[1][i] = p;
- data_ptrs->plane_data[3][i] = p + misc_vars->plane_size;
- p += misc_vars->plane_size;
- }
- data_ptrs->out_data = p;
- p += misc_vars->outbuff_size;
-
- /* ---------------------------------------------------------
- now for the color pointers
- --------------------------------------------------------- */
-
- data_ptrs->data_c[0] = data_ptrs->data_c[1] = data_ptrs->data_c[2] = p;
- data_ptrs->data_c[3] = p + misc_vars->databuff_size_c;
- /* Note: The output data will overwrite part of the input-data */
-
- if (misc_vars->bits_per_pixel > 1) {
- p += misc_vars->databuff_size_c;
- }
- if (misc_vars->bits_per_pixel > 4) {
- data_ptrs->errors_c[0] = (int *)p + misc_vars->num_comps * 2;
- data_ptrs->errors_c[1] = data_ptrs->errors_c[0] + misc_vars->databuff_size_c;
- p += misc_vars->errbuff_size_c;
- }
- /* pointer for the lower bits of the output data */
- for (i = 0; i < misc_vars->num_comps; i++) {
- data_ptrs->plane_data_c[0][i] = data_ptrs->plane_data_c[2][i] = p;
- p += misc_vars->plane_size_c / 2;
- }
- for (i = 0; i < misc_vars->num_comps; i++) {
- data_ptrs->plane_data_c[1][i] = p;
- data_ptrs->plane_data_c[3][i] = p + misc_vars->plane_size_c / 2;
- p += misc_vars->plane_size_c / 2;
- }
-
- /* pointer for the upper bits of the output data */
- for (i = 0; i < misc_vars->num_comps; i++) {
- data_ptrs->plane_data_c[0][i + 4] = data_ptrs->plane_data_c[2][i +
- 4] = p;
- p += misc_vars->plane_size_c / 2;
- }
- for (i = 0; i < misc_vars->num_comps; i++) {
- data_ptrs->plane_data_c[1][i + 4] = p;
- data_ptrs->plane_data_c[3][i + 4] = p + misc_vars->plane_size_c / 2;
- p += misc_vars->plane_size_c / 2;
- }
-
- for (i = 0; i < misc_vars->num_comps; i++) {
- data_ptrs->test_data[i] = p;
- p += misc_vars->plane_size_c / 2;
- }
-
- /* Clear temp storage */
- memset(data_ptrs->storage, 0, misc_vars->storage_size_words * W);
-
- return;
-} /* end init_data_structure */
-
-/* Configure the printer and start Raster mode */
-private void
-cdj850_start_raster_mode(gx_device_printer * pdev, int paper_size,
- FILE * prn_stream)
-{
- int xres, yres; /* x,y resolution for color planes */
- hp850_cmyk_init_t init;
-
- init = hp850_cmyk_init;
- init.a[13] = cdj850->intensities; /* Intensity levels cyan */
- init.a[19] = cdj850->intensities; /* Intensity levels magenta */
- init.a[25] = cdj850->intensities; /* Intensity levels yellow */
-
- /* black plane resolution */
- assign_dpi(cdj850->x_pixels_per_inch, init.a + 2);
- assign_dpi(cdj850->y_pixels_per_inch, init.a + 4);
- /* color plane resolution */
- xres = cdj850->x_pixels_per_inch / (cdj850->xscal + 1);
- yres = cdj850->y_pixels_per_inch / (cdj850->yscal + 1);
- /* cyan */
- assign_dpi(xres, init.a + 8);
- assign_dpi(yres, init.a + 10);
- /* magenta */
- assign_dpi(xres, init.a + 14);
- assign_dpi(yres, init.a + 16);
- /* yellow */
- assign_dpi(xres, init.a + 20);
- assign_dpi(yres, init.a + 22);
-
- fputs("\033*rbC", prn_stream); /* End raster graphics */
- fputs("\033E", prn_stream); /* Reset */
- /* Page size, orientation, top margin & perforation skip */
- fprintf(prn_stream, "\033&l%daolE", paper_size);
-
- /* Print Quality, -1 = draft, 0 = normal, 1 = presentation */
- fprintf(prn_stream, "\033*o%dM", cdj850->quality);
- /* Media Type,0 = plain paper, 1 = bond paper, 2 = special
- paper, 3 = glossy film, 4 = transparency film */
- fprintf(prn_stream, "\033&l%dM", cdj850->papertype);
-
- /* Move to top left of printed area */
- fprintf(prn_stream, "\033*p%dY", (int)(600 * DOFFSET));
-
- /* This will start and configure the raster-mode */
- fprintf(prn_stream, "\033*g%dW", (int)sizeof(init.a)); /* The new configure
- raster data comand */
- fwrite(init.a, sizeof(byte), sizeof(init.a),
- prn_stream); /* Transmit config
- data */
- /* From now on, all escape commands start with \033*b, so we
- * combine them (if the printer supports this). */
- fputs("\033*b", prn_stream);
- /* Set compression if the mode has been defined. */
- if (cdj850->compression)
- fprintf(prn_stream, "%dm", cdj850->compression);
-
- return;
-} /* end configure raster-mode */
-
-/* Configure the printer and start Raster mode */
-private void
-cdj880_start_raster_mode(gx_device_printer * pdev, int paper_size,
- FILE * prn_stream)
-{
- int xres, yres; /* x,y resolution for color planes */
- hp850_cmyk_init_t init;
-
- init = hp850_cmyk_init;
- init.a[13] = cdj850->intensities; /* Intensity levels cyan */
- init.a[19] = cdj850->intensities; /* Intensity levels magenta */
- init.a[25] = cdj850->intensities; /* Intensity levels yellow */
-
- /* black plane resolution */
- assign_dpi(cdj850->x_pixels_per_inch, init.a + 2);
- assign_dpi(cdj850->y_pixels_per_inch, init.a + 4);
- /* color plane resolution */
- xres = cdj850->x_pixels_per_inch / (cdj850->xscal + 1);
- yres = cdj850->y_pixels_per_inch / (cdj850->yscal + 1);
- /* cyan */
- assign_dpi(xres, init.a + 8);
- assign_dpi(yres, init.a + 10);
- /* magenta */
- assign_dpi(xres, init.a + 14);
- assign_dpi(yres, init.a + 16);
- /* yellow */
- assign_dpi(xres, init.a + 20);
- assign_dpi(yres, init.a + 22);
-
- fputs("\033*rbC", prn_stream); /* End raster graphics */
- fputs("\033E", prn_stream); /* Reset */
-
- /* Set the language to PCL3 enhanced, DeskJet 880 style */
- fprintf(prn_stream, "\033%%-12345X@PJL ENTER LANGUAGE=PCL3GUI\n");
-
- /* Page size, orientation, top margin & perforation skip */
- fprintf(prn_stream, "\033&l%daolE", paper_size);
-
- /* Print Quality, -1 = draft, 0 = normal, 1 = presentation */
- fprintf(prn_stream, "\033*o%dM", cdj850->quality);
- /* Media Type,0 = plain paper, 1 = bond paper, 2 = special
- paper, 3 = glossy film, 4 = transparency film */
- fprintf(prn_stream, "\033&l%dM", cdj850->papertype);
-
- /* Move to top left of printed area */
- fprintf(prn_stream, "\033*p%dY", (int)(600 * DOFFSET));
-
- /* This will configure the raster-mode */
- fprintf(prn_stream, "\033*g%dW", (int)sizeof(init.a)); /* The new configure
- raster data comand */
- fwrite(init.a, sizeof(byte), sizeof(init.a),
- prn_stream); /* Transmit config
- data */
-
- /* Start the raster graphics mode. The 880C needs this explicit command.
- */
- fputs("\033*r1A", prn_stream);
-
- /* From now on, all escape commands start with \033*b, so we
- * combine them (if the printer supports this). */
-/* fputs("\033*b", prn_stream);*/
-
- /* Set compression if the mode has been defined. */
-/* if (cdj850->compression)*/
- fprintf(prn_stream, "\033*b%dm", cdj850->compression);
-
- return;
-} /* end configure raster-mode */
-
-#define HIBYTE(w) ((byte)(((unsigned int) (w) >> 8) & 0xFF))
-#define LOBYTE(w) ((byte)(w))
-
-/* Start Raster mode for HP2200 */
-private void
-chp2200_start_raster_mode(gx_device_printer * pdev, int paper_size,
- FILE * prn_stream)
-{
- byte CRD_SeqC[] = {0x1b, 0x2a, 0x67, 0x31, 0x32, 0x57, 0x06, 0x07, 0x00, 0x01,
- /* Esc * |g |# of bytes |W |frmt |SP |# of cmpnts*/
- 0x00, 0x00, 0x00, 0x00, 0x0a, 0x01, 0x20, 0x01};
- /* |Horz Res |Vert Rez |compr|orien|bits |planes*/
-
- /* x,y resolution for color planes, assume x=y */
- int xres = cdj850->x_pixels_per_inch;
- int yres = cdj850->y_pixels_per_inch;
- int width_in_pixels = cdj850->width;
-
- /* Exit from any previous language */
- fprintf(prn_stream, "\033%%-12345X");
-
- /* send @PJL JOB NAME before entering the language
- * this will be matched by a @PJL EOJ after leaving the language
- */
- fprintf(prn_stream, "@PJL JOB NAME=\"ghostscript job\"\012");
-
- /* Set timeout value */
- fprintf(prn_stream, "@PJL SET TIMEOUT=90\n");
-
- /* Set the language to PCL3 enhanced */
- fprintf(prn_stream, "@PJL ENTER LANGUAGE=PCL3GUI\n");
-
- /* Paper source: assume AutoFeed */
- fprintf(prn_stream, "\033&l7H");
-
- /* Media Type,0 = plain paper, 1 = bond paper, 2 = special
- paper, 3 = glossy film, 4 = transparency film */
- fprintf(prn_stream, "\033&l%dM", cdj850->papertype);
-
- /* Print Quality, -1 = draft, 0 = normal, 1 = presentation */
- fprintf(prn_stream, "\033*o%dM", cdj850->quality);
-
- /* Raster Width */
- fprintf(prn_stream, "\033*r%dS", width_in_pixels);
-
- /* Page size */
- fprintf(prn_stream, "\033&l%dA", paper_size);
-
- /* Load paper */
- fprintf(prn_stream, "\033&l-2H");
-
- /* Unit of Measure*/
- fprintf(prn_stream, "\033&u%dD", (int)xres);
-
- /* Move to top of form */
- fprintf(prn_stream, "\033*p%dY", (int)(yres * DOFFSET));
-
- /* This will configure the raster-mode */
- CRD_SeqC[10] = HIBYTE(xres);
- CRD_SeqC[11] = LOBYTE(xres);
- CRD_SeqC[12] = HIBYTE(yres);
- CRD_SeqC[13] = LOBYTE(yres);
- fwrite(CRD_SeqC, sizeof(byte), sizeof(CRD_SeqC), prn_stream);
-
- fputs("\033*r1A", prn_stream);
-
- return;
-} /* end configure raster-mode */
-
-private int near
-cdj_put_param_int(gs_param_list * plist, gs_param_name pname, int *pvalue,
- int minval, int maxval, int ecode)
-{
- int code, value;
-
- switch (code = param_read_int(plist, pname, &value)) {
- default:
- return code;
- case 1:
- return ecode;
- case 0:
- if (value < minval || value > maxval)
- param_signal_error(plist, pname, gs_error_rangecheck);
- *pvalue = value;
- return (ecode < 0 ? ecode : 1);
- }
-}
-
-private int near
-cdj_put_param_float(gs_param_list * plist, gs_param_name pname, float *pvalue,
- float minval, float maxval, int ecode)
-{
- int code;
- float value;
-
- switch (code = param_read_float(plist, pname, &value)) {
- default:
- return code;
- case 1:
- return ecode;
- case 0:
- if (value < minval || value > maxval)
- param_signal_error(plist, pname, gs_error_rangecheck);
- *pvalue = value;
- return (ecode < 0 ? ecode : 1);
- }
-}
-
-private int
-cdj_set_bpp(gx_device * pdev, int bpp, int ccomps)
-{
- gx_device_color_info *ci = &pdev->color_info;
-
- if (ccomps && bpp == 0) {
- if (cprn_device->cmyk) {
- switch (ccomps) {
- default:
- return gs_error_rangecheck;
- /*NOTREACHED */
- break;
-
- case 1:
- bpp = 1;
- break;
-
- case 3:
- bpp = 24;
- break;
-
- case 4:
- switch (ci->depth) {
- case 8:
- case 16:
- case 24:
- case 32:
- break;
-
- default:
- bpp = cprn_device->default_depth;
- break;
- }
- break;
- }
- }
- }
- if (bpp == 0) {
- bpp = ci->depth; /* Use the current setting. */
- }
- if (cprn_device->cmyk < 0) {
-
- /* Reset procedures because we may have been in another mode. */
-
- dev_proc(pdev, map_cmyk_color) = gdev_cmyk_map_cmyk_color;
- dev_proc(pdev, map_rgb_color) = NULL;
- dev_proc(pdev, map_color_rgb) = gdev_cmyk_map_color_rgb;
-
- if (pdev->is_open)
- gs_closedevice(pdev);
- }
- /* Check for valid bpp values */
-
- switch (bpp) {
- case 16:
- case 32:
- if (cprn_device->cmyk && ccomps && ccomps != 4)
- goto bppe;
- break;
-
- case 24:
- if (!cprn_device->cmyk || ccomps == 0 || ccomps == 4) {
- break;
- } else if (ccomps == 1) {
- goto bppe;
- } else {
-
- /* 3 components 24 bpp printing for CMYK device. */
-
- cprn_device->cmyk = -1;
- }
- break;
-
- case 8:
- if (cprn_device->cmyk) {
- if (ccomps) {
- if (ccomps == 3) {
- cprn_device->cmyk = -1;
- bpp = 3;
- } else if (ccomps != 1 && ccomps != 4) {
- goto bppe;
- }
- }
- if (ccomps != 1)
- break;
- } else {
- break;
- }
-
- case 1:
- if (ccomps != 1)
- goto bppe;
-
- if (cprn_device->cmyk && bpp != pdev->color_info.depth) {
- dev_proc(pdev, map_cmyk_color) = NULL;
- dev_proc(pdev, map_rgb_color) = gdev_cmyk_map_rgb_color;
-
- if (pdev->is_open) {
- gs_closedevice(pdev);
- }
- }
- break;
-
- case 3:
- if (!cprn_device->cmyk) {
- break;
- }
- default:
- bppe:return gs_error_rangecheck;
- }
-
-
- if (cprn_device->cmyk == -1) {
- dev_proc(pdev, map_cmyk_color) = NULL;
- dev_proc(pdev, map_rgb_color) = gdev_pcl_map_rgb_color;
- dev_proc(pdev, map_color_rgb) = gdev_pcl_map_color_rgb;
-
- if (pdev->is_open) {
- gs_closedevice(pdev);
- }
- }
- switch (ccomps) {
- case 0:
- break;
-
- case 1:
- if (bpp != 1 && bpp != 8)
- goto cce;
- break;
-
- case 4:
- if (cprn_device->cmyk) {
- if (bpp >= 8)
- break;
- }
- case 3:
- if (bpp == 1 || bpp == 3 || bpp == 8 || bpp == 16
- || bpp == 24 || bpp == 32) {
- break;
- }
- cce: default:
- return gs_error_rangecheck;
- }
-
- if (cprn_device->cmyk) {
- if (cprn_device->cmyk > 0) {
- ci->num_components = ccomps ? ccomps : (bpp < 8 ? 1 : 4);
- } else {
- ci->num_components = ccomps ? ccomps : (bpp < 8 ? 1 : 3);
- }
- if (bpp != 1 && ci->num_components == 1) { /* We do dithered grays. */
- bpp = bpp < 8 ? 8 : bpp;
- }
- ci->max_color = (1 << (bpp >> 2)) - 1;
- ci->max_gray = (bpp >= 8 ? 255 : 1);
-
- if (ci->num_components == 1) {
- ci->dither_grays = (bpp >= 8 ? 5 : 2);
- ci->dither_colors = (bpp >= 8 ? 5 : bpp > 1 ? 2 : 0);
- } else {
- ci->dither_grays = (bpp > 8 ? 5 : 2);
- ci->dither_colors = (bpp > 8 ? 5 : bpp > 1 ? 2 : 0);
- }
- } else {
- ci->num_components = (bpp == 1 || bpp == 8 ? 1 : 3);
- ci->max_color = (bpp >= 8 ? 255 : bpp > 1 ? 1 : 0);
- ci->max_gray = (bpp >= 8 ? 255 : 1);
- ci->dither_grays = (bpp >= 8 ? 5 : 2);
- ci->dither_colors = (bpp >= 8 ? 5 : bpp > 1 ? 2 : 0);
- }
-
- ci->depth = ((bpp > 1) && (bpp < 8) ? 8 : bpp);
-
- return 0;
-}
-
-/*
- * Map a CMYK color to a color index. We just use depth / 4 bits per color
- * to produce the color index.
- *
- * Important note: CMYK values are stored in the order K, C, M, Y because of
- * the way the HP drivers work.
- *
- */
-
-#define gx_color_value_to_bits(cv, b) \
- ((cv) >> (gx_color_value_bits - (b)))
-#define gx_bits_to_color_value(cv, b) \
- ((cv) << (gx_color_value_bits - (b)))
-
-#define gx_cmyk_value_bits(c, m, y, k, b) \
- ((gx_color_value_to_bits((k), (b)) << (3 * (b))) | \
- (gx_color_value_to_bits((c), (b)) << (2 * (b))) | \
- (gx_color_value_to_bits((m), (b)) << (b)) | \
- (gx_color_value_to_bits((y), (b))))
-
-#define gx_value_cmyk_bits(v, c, m, y, k, b) \
- (k) = gx_bits_to_color_value(((v) >> (3 * (b))) & ((1 << (b)) - 1), (b)), \
- (c) = gx_bits_to_color_value(((v) >> (2 * (b))) & ((1 << (b)) - 1), (b)), \
- (m) = gx_bits_to_color_value(((v) >> (b)) & ((1 << (b)) - 1), (b)), \
- (y) = gx_bits_to_color_value((v) & ((1 << (b)) - 1), (b))
-
-private gx_color_index
-gdev_cmyk_map_cmyk_color(gx_device * pdev,
- const gx_color_value cv[])
-{
-
- gx_color_index color;
- gx_color_value cyan, magenta, yellow, black;
-
- cyan = cv[0]; magenta = cv[1]; yellow = cv[2]; black = cv[3];
- switch (pdev->color_info.depth) {
- case 1:
- color = (cyan | magenta | yellow | black) > gx_max_color_value / 2 ?
- (gx_color_index) 1 : (gx_color_index) 0;
- break;
-
- default:{
- int nbits = pdev->color_info.depth;
-
- if (cyan == magenta && magenta == yellow) {
- /* Convert CMYK to gray -- Red Book 6.2.2 */
- float bpart = ((float)cyan) * (lum_red_weight / 100.) +
- ((float)magenta) * (lum_green_weight / 100.) +
- ((float)yellow) * (lum_blue_weight / 100.) +
- (float)black;
-
- cyan = magenta = yellow = (gx_color_index) 0;
- black = (gx_color_index) (bpart > gx_max_color_value ?
- gx_max_color_value : bpart);
- }
- color = gx_cmyk_value_bits(cyan, magenta, yellow, black,
- nbits >> 2);
- }
- }
-
- return color;
-}
-
-/* Mapping of RGB colors to gray values. */
-
-private gx_color_index
-gdev_cmyk_map_rgb_color(gx_device * pdev, const gx_color_value cv[])
-{
- gx_color_value r, g, b;
-
- r = cv[0]; g = cv[1]; b = cv[2];
- if (gx_color_value_to_byte(r & g & b) == 0xff) {
- return (gx_color_index) 0; /* White */
- } else {
- gx_color_value c = gx_max_color_value - r;
- gx_color_value m = gx_max_color_value - g;
- gx_color_value y = gx_max_color_value - b;
-
- switch (pdev->color_info.depth) {
- case 1:
- return (c | m | y) > gx_max_color_value / 2 ?
- (gx_color_index) 1 : (gx_color_index) 0;
- /*NOTREACHED */
- break;
-
- case 8:
- return ((ulong) c * lum_red_weight * 10
- + (ulong) m * lum_green_weight * 10
- + (ulong) y * lum_blue_weight * 10)
- >> (gx_color_value_bits + 2);
- /*NOTREACHED */
- break;
- }
- }
-
- return (gx_color_index) 0; /* This should never happen. */
-}
-
-/* Mapping of CMYK colors. */
-private int
-gdev_cmyk_map_color_rgb(gx_device * pdev, gx_color_index color,
- gx_color_value prgb[3])
-{
- switch (pdev->color_info.depth) {
- case 1:
- prgb[0] = prgb[1] = prgb[2] = gx_max_color_value * (1 - color);
- break;
-
- case 8:
- if (pdev->color_info.num_components == 1) {
- gx_color_value value = (gx_color_value) color ^ 0xff;
-
- prgb[0] = prgb[1] = prgb[2] = (value << 8) + value;
-
- break;
- }
- default:{
- unsigned long bcyan, bmagenta, byellow, black;
- int nbits = pdev->color_info.depth;
-
- gx_value_cmyk_bits(color, bcyan, bmagenta, byellow, black,
- nbits >> 2);
-
-#ifdef USE_ADOBE_CMYK_RGB
-
- /* R = 1.0 - min(1.0, C + K), etc. */
-
- bcyan += black, bmagenta += black, byellow += black;
- prgb[0] = (bcyan > gx_max_color_value ? (gx_color_value) 0 :
- gx_max_color_value - bcyan);
- prgb[1] = (bmagenta > gx_max_color_value ? (gx_color_value) 0 :
- gx_max_color_value - bmagenta);
- prgb[2] = (byellow > gx_max_color_value ? (gx_color_value) 0 :
- gx_max_color_value - byellow);
-
-#else
-
- /* R = (1.0 - C) * (1.0 - K), etc. */
-
- prgb[0] = (gx_color_value)
- ((ulong) (gx_max_color_value - bcyan) *
- (gx_max_color_value - black) / gx_max_color_value);
- prgb[1] = (gx_color_value)
- ((ulong) (gx_max_color_value - bmagenta) *
- (gx_max_color_value - black) / gx_max_color_value);
- prgb[2] = (gx_color_value)
- ((ulong) (gx_max_color_value - byellow) *
- (gx_max_color_value - black) / gx_max_color_value);
-
-#endif
-
- }
- }
-
- return 0;
-}
-
-private gx_color_index
-gdev_pcl_map_rgb_color(gx_device * pdev, const gx_color_value cv[])
-{
- gx_color_value r, g, b;
-
- r = cv[0]; g = cv[1]; b = cv[2];
- if (gx_color_value_to_byte(r & g & b) == 0xff)
- return (gx_color_index) 0; /* white */
- else {
- gx_color_value c = gx_max_color_value - r;
- gx_color_value m = gx_max_color_value - g;
- gx_color_value y = gx_max_color_value - b;
-
- switch (pdev->color_info.depth) {
- case 1:
- return ((c | m | y) > gx_max_color_value / 2 ?
- (gx_color_index) 1 : (gx_color_index) 0);
- case 8:
- if (pdev->color_info.num_components >= 3)
-#define gx_color_value_to_1bit(cv) ((cv) >> (gx_color_value_bits - 1))
- return (gx_color_value_to_1bit(c) +
- (gx_color_value_to_1bit(m) << 1) +
- (gx_color_value_to_1bit(y) << 2));
- else
-#define red_weight 306
-#define green_weight 601
-#define blue_weight 117
- return ((((ulong) c * red_weight +
- (ulong) m * green_weight +
- (ulong) y * blue_weight)
- >> (gx_color_value_bits + 2)));
- case 16:
-#define gx_color_value_to_5bits(cv) ((cv) >> (gx_color_value_bits - 5))
-#define gx_color_value_to_6bits(cv) ((cv) >> (gx_color_value_bits - 6))
- return (gx_color_value_to_5bits(y) +
- (gx_color_value_to_6bits(m) << 5) +
- (gx_color_value_to_5bits(c) << 11));
- case 24:
- return (gx_color_value_to_byte(y) +
- (gx_color_value_to_byte(m) << 8) +
- ((ulong) gx_color_value_to_byte(c) << 16));
- case 32:
- {
- return ((c == m && c == y) ? ((ulong)
- gx_color_value_to_byte(c) << 24)
- : (gx_color_value_to_byte(y) +
- (gx_color_value_to_byte(m) << 8) +
- ((ulong) gx_color_value_to_byte(c) << 16)));
- }
- }
- }
- return (gx_color_index) 0; /* This never happens */
-}
-
-/* Map a color index to a r-g-b color. */
-private int
-gdev_pcl_map_color_rgb(gx_device * pdev, gx_color_index color,
- gx_color_value prgb[3])
-{
- /* For the moment, we simply ignore any black correction */
- switch (pdev->color_info.depth) {
- case 1:
- prgb[0] = prgb[1] = prgb[2] = -((gx_color_value) color ^ 1);
- break;
- case 8:
- if (pdev->color_info.num_components >= 3) {
- gx_color_value c = (gx_color_value) color ^ 7;
-
- prgb[0] = -(c & 1);
- prgb[1] = -((c >> 1) & 1);
- prgb[2] = -(c >> 2);
- } else {
- gx_color_value value = (gx_color_value) color ^ 0xff;
-
- prgb[0] = prgb[1] = prgb[2] = (value << 8) + value;
- }
- break;
- case 16:
- {
- gx_color_value c = (gx_color_value) color ^ 0xffff;
- ushort value = c >> 11;
-
- prgb[0] = ((value << 11) + (value << 6) + (value << 1) +
- (value >> 4)) >> (16 - gx_color_value_bits);
- value = (c >> 6) & 0x3f;
- prgb[1] = ((value << 10) + (value << 4) + (value >> 2))
- >> (16 - gx_color_value_bits);
- value = c & 0x1f;
- prgb[2] = ((value << 11) + (value << 6) + (value << 1) +
- (value >> 4)) >> (16 - gx_color_value_bits);
- }
- break;
- case 24:
- {
- gx_color_value c = (gx_color_value) color ^ 0xffffff;
-
- prgb[0] = gx_color_value_from_byte(c >> 16);
- prgb[1] = gx_color_value_from_byte((c >> 8) & 0xff);
- prgb[2] = gx_color_value_from_byte(c & 0xff);
- }
- break;
- case 32:
-#define gx_maxcol gx_color_value_from_byte(gx_color_value_to_byte(gx_max_color_value))
- {
- gx_color_value w = gx_maxcol - gx_color_value_from_byte(color >> 24);
-
- prgb[0] = w - gx_color_value_from_byte((color >> 16) & 0xff);
- prgb[1] = w - gx_color_value_from_byte((color >> 8) & 0xff);
- prgb[2] = w - gx_color_value_from_byte(color & 0xff);
- }
- break;
- }
- return 0;
-}
-
-/* new_bpp == save_bpp or new_bpp == 0 means don't change bpp.
- ccomps == 0 means don't change number of color comps.
- If new_bpp != 0, it must be the value of the BitsPerPixel element of
- the plist; real_bpp may differ from new_bpp.
- */
-private int
-cdj_put_param_bpp(gx_device * pdev, gs_param_list * plist, int new_bpp,
- int real_bpp, int ccomps)
-{
- if (new_bpp == 0 && ccomps == 0)
- return gdev_prn_put_params(pdev, plist);
- else {
- gx_device_color_info save_info;
- int save_bpp;
- int code;
-
- save_info = pdev->color_info;
- save_bpp = save_info.depth;
-#define save_ccomps save_info.num_components
- if (save_bpp == 8 && save_ccomps == 3 && !cprn_device->cmyk)
- save_bpp = 3;
- code = cdj_set_bpp(pdev, real_bpp, ccomps);
- if (code < 0) {
- param_signal_error(plist, "BitsPerPixel", code);
- param_signal_error(plist, "ProcessColorModel", code);
- return code;
- }
- pdev->color_info.depth = new_bpp; /* cdj_set_bpp maps 3/6 to 8 */
- code = gdev_prn_put_params(pdev, plist);
- if (code < 0) {
- cdj_set_bpp(pdev, save_bpp, save_ccomps);
- return code;
- }
- cdj_set_bpp(pdev, real_bpp, ccomps); /* reset depth if needed */
- if ((cdj850->color_info.depth != save_bpp ||
- (ccomps != 0 && ccomps != save_ccomps))
- && pdev->is_open)
- return gs_closedevice(pdev);
- return 0;
-#undef save_ccomps
- }
-}
-
-/* the following code was in the original driver but is unused
-
- * private int
- * x_mul_div (int a, int b, int c)
- * {
- * int result;
- *
- * result = (int) ((a * b) / c) ;
- * return result;
- * }
- *
- * private void
- * save_color_data(int size,
- * byte * current,
- * byte * saved)
- * {
- * int i;
- * for (i=0;i<size;i++){
- * *saved++ = *current++;
- * }
- * return;
- * }
- *
- * private int
- * test_scan (int size,
- * byte * current,
- * byte * last,
- * byte * control)
- * {
- * int error = 0;
- * int i;
- *
- * for (i=0;i<size;i++){
- * if (*control != *last){
- * error = 1;
- * }
- * *control = *current;
- *
- * control++;
- * last++;
- * current++;
- * }
- * return error;
- * }
- *
- * * Transform from cmy into hsv
- * private void
- * cmy2hsv(int *c, int *m, int *y, int *h, int *s, int *v)
- * {
- * int hue;
- * int r, g, b;
- * int r1, g1, b1;
- * int maxValue, minValue, diff;
- *
- * r = 255 - *c;
- * g = 255 - *m;
- * b = 255 - *y;
- *
- * maxValue = max(r, max(g,b));
- * minValue = min(r,min(g,b));
- * diff = maxValue - minValue;
- * *v = maxValue;
- *
- * if (maxValue != 0)
- * *s = x_mul_div(diff,255,maxValue);
- * else
- * *s = 0;
- *
- * if (*s == 0)
- * {
- * hue = 0;
- * }
- * else
- * {
- * r1 = x_mul_div(maxValue - r,255,diff);
- * g1 = x_mul_div(maxValue - g,255,diff);
- * b1 = x_mul_div(maxValue - b,255,diff);
- *
- * if (r == maxValue)
- * hue = b1 - g1;
- * else if (g == maxValue)
- * hue = 510 + r1 - b1;
- * else
- * hue = 1020 + g1 - r1;
- *
- * if (hue < 0)
- * hue += 1530;
- * }
- *
- * *h = (hue + 3) / 6;
- *
- * return;
- * }
- * end of unused code */
-
-
-/************************ the routines for the cdj1600 printer ***************/
-
-/* Configure the printer and start Raster mode */
-private void
-cdj1600_start_raster_mode(gx_device_printer * pdev, int paper_size,
- FILE * prn_stream)
-{
- uint raster_width = pdev->width -
- pdev->x_pixels_per_inch * (dev_l_margin(pdev) + dev_r_margin(pdev));
-
- /* switch to PCL control language */
- fputs("\033%-12345X@PJL enter language = PCL\n", prn_stream);
-
- fputs("\033*rbC", prn_stream); /* End raster graphics */
- fputs("\033E", prn_stream); /* Reset */
-
- /* resolution */
- fprintf(prn_stream, "\033*t%dR", (int)cdj850->x_pixels_per_inch);
-
- /* Page size, orientation, top margin & perforation skip */
- fprintf(prn_stream, "\033&l%daolE", paper_size);
-
- /* no negative motion */
- fputs("\033&a1N", prn_stream);
-
- /* Print Quality, -1 = draft, 0 = normal, 1 = presentation */
- fprintf(prn_stream, "\033*o%dQ", cdj850->quality);
-
- /* Media Type,0 = plain paper, 1 = bond paper, 2 = special
- paper, 3 = glossy film, 4 = transparency film */
- fprintf(prn_stream, "\033&l%dM", cdj850->papertype);
-
- /* Move to top left of printed area */
- fprintf(prn_stream, "\033*p%dY", (int)(300.0 * DOFFSET));
-
- /* raster width and number of planes */
- fprintf(prn_stream, "\033*r%ds-%du0A",
- raster_width, pdev->color_info.num_components);
-
- /* start raster graphics */
- fputs("\033*r1A", prn_stream);
-
- /* From now on, all escape commands start with \033*b, so we
- * combine them (if the printer supports this). */
- fputs("\033*b", prn_stream);
-
- /* Set compression if the mode has been defined. */
- if (cdj850->compression)
- fprintf(prn_stream, "%dm", cdj850->compression);
-
- return;
-} /* end configure raster-mode */
-
-/* print_plane compresses (mode 3) and outputs one plane */
-private void
-print_c3plane(FILE * prn_stream, char plane_code, int plane_size,
- const byte * curr, byte * prev, byte * out_data)
-{
- /* Compress the output data */
- int out_count = gdev_pcl_mode3compress(plane_size, curr, prev, out_data);
-
- /* and output the data */
- if (out_count > 0) {
- fprintf(prn_stream, "%d%c", out_count, plane_code);
- fwrite(out_data, sizeof(byte), out_count, prn_stream);
- } else {
- putc(plane_code, prn_stream);
- }
-}
-
-private int
-copy_color_data(byte * dest, const byte * src, int n)
-{
- /* copy word by word */
- register int i = n / 4;
- register word *d = (word *) dest;
- register const word *s = (const word *)src;
-
- while (i-- > 0) {
- *d++ = *s++;
- }
- return n;
-}
-
-/* Printing non-blank lines */
-private void
-cdj1600_print_non_blank_lines(gx_device_printer * pdev,
- struct ptr_arrays *data_ptrs,
- struct misc_struct *misc_vars,
- struct error_val_field *error_values,
- const Gamma *gamma,
- FILE * prn_stream)
-{
- int i, plane_size_c;
-
- /* copy data to data_c in order to make do_floyd_steinberg work */
- plane_size_c = copy_color_data
- (data_ptrs->data_c[misc_vars->cscan],
- data_ptrs->data[misc_vars->scan],
- misc_vars->databuff_size) / misc_vars->storage_bpp;
-
- /* dither the color planes */
- do_floyd_steinberg(misc_vars->scan, misc_vars->cscan,
- misc_vars->plane_size, plane_size_c,
- misc_vars->num_comps, data_ptrs, pdev, error_values);
-
- /* Transfer raster graphics in the order C, M, Y, that is
- planes 2,1,0 */
- for (i = misc_vars->num_comps - 1; i >= 0; i--) {
-
- /* output the lower color planes */
- print_c3plane(prn_stream, "wvv"[i], plane_size_c,
- data_ptrs->plane_data_c[misc_vars->cscan][i],
- data_ptrs->plane_data_c[1 - misc_vars->cscan][i],
- data_ptrs->out_data);
- } /* End For i = num_comps */
- misc_vars->cscan = 1 - misc_vars->cscan;
-}
-
-private void
-cdj1600_terminate_page(gx_device_printer * pdev, FILE * prn_stream)
-{
- cdj850_terminate_page(pdev, prn_stream);
- fputs("\033%-12345X", prn_stream);
-}
diff --git a/gs/contrib/gdevcd8.h b/gs/contrib/gdevcd8.h
deleted file mode 100644
index 8a9796e45..000000000
--- a/gs/contrib/gdevcd8.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef _GDEVCD8_H
-#define _GDEVCD8_H
-
-/* a couple of definitions need in gdevcd8.c */
-
-/* this holds the initialisation data of the hp850 */
-struct hp850_cmyk_init {
- byte a[26];
-};
-
-#endif
diff --git a/gs/contrib/gdevdj9.c b/gs/contrib/gdevdj9.c
deleted file mode 100644
index 532577e35..000000000
--- a/gs/contrib/gdevdj9.c
+++ /dev/null
@@ -1,2656 +0,0 @@
-/*
- Copyright (C) 2000 <Rene Harsch, Switzerland>
- written by <Rene Harsch rene@harsch.net>
- modification by Mark Burton <markb@ordern.com>
-
- Portions Copyright (C) 1999 Aladdin Enterprises. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 U.S.A.
-
- This program may also be distributed as part of Aladdin Ghostscript,
- under the terms of the Aladdin Free Public License (the "License").
-
- Every copy of Aladdin Ghostscript must include a copy of the
- License, normally in a plain ASCII text file named PUBLIC. The
- License grants you the right to copy, modify and redistribute
- Aladdin Ghostscript, but only under certain conditions described in
- the License. Among other things, the License requires that the
- copyright notice and this notice be preserved on all copies.
- */
-
-/*$Id: gdevdj9.c,v 1.4 2002/09/03 02:23:05 easysw Exp $*/
-
-/*
- A printer driver for the HP970Cxi color printer.
-
- To be used with the Ghostscript printing system.
- Please report all problems to rene@harsch.net
-
- CREDITS: Much of the driver is based on ideas derived
- from the cdj550 driver of George Cameron
- and cdj850 of Uli Wortmann
-
-
- 2000-04-18 Version 1.0
-
- The driver implements the following switches:
- Please note this switches are all copied from Uli Wortmann driver
- for hp850 (gdevcd8.c).
-
- -dPapertype= 0 plain paper [default]
- 1 bond paper
- 2 special paper
- 3 glossy film
- 4 transparency film
-
- Note, currently the lookuptables are not suited
- for printing on special paper or transperencies.
- Please revert to the gamma functions in this case.
-
- -dQuality= -1 draft
- 0 normal [default]
- 1 presentation
-
- -dRetStatus= 0 C-RET off
- 1 C-RET on [default]
-
- -dMasterGamma= 3.0 [default = 1.0]
- __Note__: To take advantage of the calibrated color-transfer
- functions, be sure not to have any Gamma-Statements
- left! If you need to (i.e. overhead sheets),
- you still can use the gamma-functions, but they will
- override the built-in calibration. To use gamma in the
- traditional way, set MasterGamma to any value greater
- 1.0 and less 10.0. To adjust individual gamma-values,
- you have to additionally set MasterGamma to a value
- greater 1.0 and less 10.0
-
- new switches:
- -dDuplex= 0 [default] None Duplex Mode
- 1 Duplex Print Block Mode
- 2 Duplex Print Book Mode
-
-
- known bug: Black planes in duplex mode are still "clumsy"
-
- for further information please look on my homepage @
- http://www.harsch.net
-
- Have Fun.
-
- Rene
-
- 2001-12-24: Version 1.1
- Changes made by Mark Burton <markb@ordern.com>
- (many thanks :-)
-
- I have modified gdevdj9.c so that both the Quality and
- the Duplex parameter can be set using setpagedevice.
-
- One other minor fix was to the initialisation values for
- gs_cdj970_device which seemed to use PRESENTATION rather than NORMAL.
-*/
-
-#include "math_.h"
-#include "string.h"
-#include <stdlib.h> /* for rand() */
-#include <assert.h>
-#include "gdevprn.h"
-#include "gdevpcl.h"
-#include "gsparam.h"
-
-/* Conversion stuff. */
-#include "gxlum.h"
-
-/* this holds the initialisation data of the hp970 */
-typedef struct hp970_cmyk_init_s {
- byte a[26];
-} hp970_cmyk_init_t;
-private const hp970_cmyk_init_t hp970_cmyk_init =
-{
- {
- 0x02, /* format */
- 0x04, /* number of components */
- /* black */
- 0x01, /* MSB x resolution */
- 0x2c, /* LSB x resolution */
- 0x01, /* MSB y resolution */
- 0x2c, /* LSB y resolution */
- 0x00, /* MSB intensity levels */
- 0x02, /* LSB intensity levels */
-
- /* cyan */
- 0x01, /* MSB x resolution */
- 0x2c, /* LSB x resolution */
- 0x01, /* MSB y resolution */
- 0x2c, /* LSB y resolution */
- 0x00, /* MSB intensity levels */
- 0x02, /* LSB intensity levels */
-
- /* magenta */
- 0x01, /* MSB x resolution */
- 0x2c, /* LSB x resolution */
- 0x01, /* MSB y resolution */
- 0x2c, /* LSB y resolution */
- 0x00, /* MSB intensity levels */
- 0x02, /* LSB intensity levels */
-
- /* yellow */
- 0x01, /* MSB x resolution */
- 0x2c, /* LSB x resolution */
- 0x01, /* MSB y resolution */
- 0x2c, /* LSB y resolution */
- 0x00, /* MSB intensity levels */
- 0x02 /* LSB intensity levels */
- }
-};
-
-/* this holds the color lookuptable data of the hp970 */
-typedef struct {
- byte c[256]; /* Lookuptable for cyan */
- byte m[256]; /* dito for magenta */
- byte y[256]; /* dito for yellow */
- byte k[256]; /* dito for black */
- int correct[256]; /* potential undercolor black correction */
-} Gamma;
-
-private const Gamma gammat970 =
-{
- /* Lookup values for cyan */
- {0, 0, 0, 2, 2, 2, 3, 3, 3, 5, 5, 5, 7, 7, 6, 7, 7, 6, 7, 7, 7, 8, 8,
- 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 12, 12, 12,
- 12, 12, 12, 13, 13, 14, 14, 14, 15, 15, 16, 16, 15, 16, 16, 17, 17,
- 17, 17, 17, 18, 18, 18, 19, 19, 20, 20, 20, 20, 20, 21, 21, 21, 22,
- 22, 23, 23, 23, 23, 23, 24, 24, 25, 25, 26, 26, 26, 26, 26, 27, 27,
- 27, 27, 28, 28, 29, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 34,
- 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 42,
- 43, 43, 43, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 50, 50, 51, 51,
- 52, 52, 53, 54, 54, 54, 55, 55, 56, 57, 58, 58, 59, 60, 60, 61, 62,
- 62, 63, 65, 65, 66, 67, 67, 68, 69, 69, 70, 72, 73, 73, 74, 75, 75,
- 76, 77, 79, 79, 80, 81, 82, 83, 83, 84, 86, 87, 88, 88, 89, 90, 91,
- 92, 93, 94, 95, 96, 97, 97, 99, 100, 101, 102, 103, 104, 105, 106,
- 108, 109, 110, 111, 112, 114, 115, 117, 119, 120, 122, 124, 125, 127,
- 129, 131, 132, 135, 136, 138, 140, 142, 144, 146, 147, 150, 152, 154,
- 157, 159, 162, 164, 166, 168, 171, 174, 176, 180, 182, 187, 192, 197,
- 204, 215, 255},
- /* Lookup values for magenta */
- {0, 0, 0, 1, 1, 1, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 7,
- 7, 8, 8, 8, 9, 9, 10, 10, 9, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12,
- 12, 13, 13, 13, 14, 14, 15, 15, 15, 16, 16, 16, 16, 16, 17, 17, 17,
- 17, 17, 18, 18, 19, 19, 19, 19, 19, 20, 20, 20, 21, 21, 22, 22, 22,
- 23, 23, 24, 24, 25, 25, 25, 26, 26, 27, 27, 28, 29, 29, 29, 29, 30,
- 30, 31, 30, 31, 31, 32, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36,
- 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44,
- 45, 45, 46, 46, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 53, 53, 54,
- 54, 55, 55, 56, 57, 57, 58, 58, 59, 60, 60, 61, 61, 62, 63, 64, 65,
- 66, 66, 67, 68, 68, 70, 71, 71, 72, 73, 73, 74, 76, 77, 77, 78, 79,
- 79, 80, 81, 82, 83, 84, 85, 86, 87, 87, 88, 89, 90, 91, 91, 92, 93,
- 94, 95, 96, 97, 98, 99, 100, 100, 101, 102, 103, 105, 106, 107, 108,
- 109, 112, 113, 114, 115, 116, 118, 119, 121, 123, 124, 125, 128, 129,
- 130, 133, 134, 135, 138, 139, 142, 144, 145, 148, 150, 152, 154, 157,
- 159, 162, 164, 168, 169, 170, 172, 175, 177, 179, 182, 185, 189, 193,
- 198, 204, 215, 255},
- /* Lookup values for yellow */
- {0, 0, 0, 2, 2, 2, 3, 3, 3, 5, 5, 5, 7, 7, 6, 7, 7, 6, 7, 7, 7, 8, 8,
- 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11,
- 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 16, 16, 16, 17, 17, 18, 18,
- 18, 19, 18, 19, 19, 19, 20, 20, 21, 21, 21, 22, 22, 22, 22, 22, 23,
- 23, 24, 24, 25, 25, 25, 26, 27, 28, 28, 29, 29, 29, 30, 30, 30, 30,
- 31, 31, 32, 32, 33, 33, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37,
- 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 45,
- 45, 46, 46, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 53, 53, 54, 54,
- 55, 55, 56, 57, 58, 59, 59, 60, 61, 61, 62, 62, 63, 64, 65, 66, 67,
- 67, 68, 69, 69, 70, 71, 72, 73, 74, 74, 75, 76, 77, 77, 78, 79, 79,
- 80, 81, 82, 83, 84, 85, 86, 87, 87, 88, 89, 90, 91, 91, 93, 94, 95,
- 96, 97, 98, 100, 101, 102, 102, 103, 104, 106, 107, 108, 109, 110,
- 111, 113, 114, 115, 116, 117, 118, 119, 121, 123, 124, 126, 128, 130,
- 131, 134, 135, 137, 139, 140, 143, 145, 146, 148, 150, 152, 154, 156,
- 158, 160, 163, 166, 167, 169, 171, 173, 176, 178, 181, 184, 188, 192,
- 198, 204, 215, 255},
- /* Lookup values for black */
- {0, 0, 0, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 2, 4, 3, 3, 3, 3, 3, 4, 4,
- 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 9, 9, 8,
- 8, 8, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 13, 13,
- 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 16, 16,
- 16, 17, 17, 17, 17, 18, 18, 18, 19, 19, 20, 20, 20, 20, 20, 21, 21,
- 21, 21, 22, 22, 22, 22, 23, 22, 23, 23, 24, 24, 24, 24, 25, 25, 26,
- 26, 26, 26, 27, 27, 28, 28, 28, 28, 29, 29, 30, 30, 31, 31, 31, 32,
- 32, 33, 33, 34, 34, 35, 36, 36, 36, 37, 37, 37, 38, 38, 40, 40, 40,
- 41, 41, 42, 43, 43, 43, 43, 44, 45, 45, 46, 47, 47, 48, 49, 49, 50,
- 52, 52, 53, 54, 54, 56, 56, 57, 58, 59, 60, 60, 61, 62, 63, 63, 64,
- 65, 66, 67, 68, 69, 70, 71, 72, 72, 73, 75, 75, 76, 77, 78, 80, 81,
- 82, 82, 83, 84, 85, 86, 88, 89, 90, 91, 94, 95, 96, 98, 99, 100, 101,
- 103, 105, 106, 107, 110, 111, 112, 115, 116, 118, 120, 121, 124, 126,
- 127, 131, 133, 134, 138, 140, 141, 146, 148, 151, 154, 156, 160, 163,
- 166, 169, 174, 177, 182, 187, 194, 203, 215, 255}
-};
-
-private const Gamma * const gammat[] =
-{
- &gammat970, /* CDJ970Cxi */
-};
-
-private int
- rescale_byte_wise1x1(int bytecount, const byte * inbytea,
- const byte * inbyteb, byte * outbyte);
-private int
- rescale_byte_wise2x1(int bytecount, const byte * inbytea,
- const byte * inbyteb, byte * outbyte);
-private int
- rescale_byte_wise1x2(int bytecount, const byte * inbytea,
- const byte * inbyteb, byte * outbyte);
-private int
- rescale_byte_wise2x2(int bytecount, const byte * inbytea,
- const byte * inbyteb, byte * outbyte);
-
-private int (* const rescale_color_plane[2][2]) (int, const byte *, const byte *, byte *) = {
- {
- rescale_byte_wise1x1, rescale_byte_wise1x2
- },
- {
- rescale_byte_wise2x1, rescale_byte_wise2x2
- }
-};
-/*
-private int (* const rescale_color_plane[2][2]) (int, const byte *, const byte *, byte *) = {
- {
- rescale_byte_wise1x1, rescale_byte_wise1x1
- },
- {
- rescale_byte_wise1x1, rescale_byte_wise1x1
- }
-};
-*/
-private int cdj970_write_header(gx_device *, FILE *);
-private int cdj970_write_trailer(gx_device *, FILE *);
-
-/*
- * Drivers stuff.
- *
- */
-
-#define DUPLEX_BOTTOM_MARGIN_A4 205
-#define DUPLEX_LEFT_MARGIN_A4 120
-
-#define DUPLEX_BOTTOM_MARGIN_LETTER 205 /* ???? */
-#define DUPLEX_LEFT_MARGIN_LETTER 120 /* ???? */
-
-#define DESKJET_PRINT_LIMIT 0.04 /* 'real' top margin? */
-/* Margins are left, bottom, right, top. */
-#define DESKJET_MARGINS_LETTER 0.25, 0.50, 0.25, 0.167
-#define DESKJET_MARGINS_A4 0.13, 0.46, 0.13, 0.04
-/* Define bits-per-pixel - default is 32-bit cmyk-mode */
-#ifndef BITSPERPIXEL
-# define BITSPERPIXEL 32
-#endif
-#define DOFFSET (dev_t_margin(pdev) - DESKJET_PRINT_LIMIT) /* Print position */
-
-
-#define W sizeof(word)
-#define I sizeof(int)
-
-/* paper types */
-typedef enum {
- PLAIN_PAPER, BOND_PAPER, SPECIAL_PAPER, GLOSSY_FILM, TRANSPARENCY_FILM
-} cdj_paper_type_t;
-
-/* quality */
-typedef enum {
- DRAFT = -1, NORMAL = 0, PRESENTATION = 1
-} cdj_quality_t;
-
-/* duplex mode */
-typedef enum {
- NONE, BLOCK, BOOK
-} cdj_duplex_t;
-
-/* Printer types */
-typedef enum {
- DJ970C
-} cdj_printer_type_t;
-
-/* No. of ink jets (used to minimise head movements) */
-#define HEAD_ROWS_MONO 50
-#define HEAD_ROWS_COLOUR 16
-
-/* Colour mapping procedures */
-private dev_proc_map_cmyk_color(gdev_cmyk_map_cmyk_color);
-private dev_proc_map_rgb_color(gdev_cmyk_map_rgb_color);
-private dev_proc_map_color_rgb(gdev_cmyk_map_color_rgb);
-
-private dev_proc_map_rgb_color(gdev_pcl_map_rgb_color);
-private dev_proc_map_color_rgb(gdev_pcl_map_color_rgb);
-
-/* Print-page, parameters and miscellaneous procedures */
-private dev_proc_open_device(hp_colour_open);
-private dev_proc_close_device(cdj970_close);
-
-private dev_proc_get_params(cdj970_get_params);
-private dev_proc_put_params(cdj970_put_params);
-
-private dev_proc_print_page(cdj970_print_page);
-
-/* The device descriptors */
-
-/* The basic structure for all printers. Note the presence of the cmyk, depth
- and correct fields even if some are not used by all printers. */
-
-#define prn_colour_device_body(dtype, procs, dname, w10, h10, xdpi, ydpi, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_page, cmyk, correct)\
- prn_device_body(dtype, procs, dname, w10, h10, xdpi, ydpi, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_page), cmyk, depth /* default */, correct
-
-
-
-#define gx_prn_colour_device_common \
- gx_prn_device_common; \
- int cmyk; /* 0: not CMYK-capable, > 0: printing CMYK, */ \
- /* < 0 : CMYK-capable, not printing CMYK */ \
- uint default_depth; /* Used only for CMYK-capable printers now. */ \
- uint correction
-
-
-/* some definitions needed later */
-struct error_val_field {
- int c; /* Current value of Cyan error during dithering */
- int m; /* Current value of Magenta error during dithering */
- int y; /* Current value of Yellow error during dithering */
- int k; /* Current value of Black error during dithering */
-};
-
-/* this structure holds all the pointers to the different values
- in all those data fields */
- /*
- * The principal data pointers are stored as pairs of values, with
- * the selection being made by the 'scan' variable. The function of the
- * scan variable is overloaded, as it controls both the alternating
- * raster scan direction used in the Floyd-Steinberg dithering and also
- * the buffer alternation required for line-difference compression.
- *
- * Thus, the number of pointers required is as follows:
- */
-
-struct ptr_arrays {
- byte *data[4]; /* 4 600dpi data, scan direction and alternating buffers */
- byte *data_c[4]; /* 4 300dpi data, as above, */
- byte *plane_data[4][4]; /*4 b/w-planes, scan direction and alternating buffers */
- byte *plane_data_c[4][8]; /* as above, but for 8 planes */
- byte *out_data; /* output buffer for the b/w data, one 600dpi plane */
- byte *test_data[4]; /* holds a copy of the last plane */
- int *errors[2]; /* 2 b/w dithering erros (scan direction only) */
- int *errors_c[2]; /* 2 color dithering errors (scan direction only) */
- word *storage; /* pointer to the beginning of the b/w-buffer */
- word *storage_start; /* used for debugging */
- word *storage_end; /* used for debugging */
- word *storage_size; /* used for debugging */
-};
-
-/* Some miscellaneous variables */
-struct misc_struct {
- int line_size; /* size of scan_line */
- int line_size_c; /* size of rescaled scan_line */
- int line_size_words; /* size of scan_line in words */
- int paper_size; /* size of paper */
- int num_comps; /* number of color components (1 - 4) */
- int bits_per_pixel; /* bits per pixel 1,4,8,16,24,32 */
- int storage_bpp; /* = bits_per_pixel */
- int expanded_bpp; /* = bits_per_pixel */
- int plane_size; /* size of b/w bit plane */
- int plane_size_c; /* size of color bit plane */
- int databuff_size; /* size of databuffer for b/w data */
- int databuff_size_c; /* size of databuffer for color data */
- int errbuff_size; /* size of error buffer b/w -data */
- int errbuff_size_c; /* size of error buffer color -data */
- int outbuff_size; /* size of output buffer for b/w data */
- int scan; /* scan-line variable [0,1] */
- int cscan; /* dito for the color-planes */
- int is_two_pass; /* checks if b/w data has already been printed */
- int zero_row_count; /* How many empty lines */
- uint storage_size_words; /* size of storage in words for b/w data */
- uint storage_size_words_c; /* size of storage in words for c-data */
- int is_color_data; /* indicates whether there is color data */
-};
-
- /* function pointer typedefs for device driver struct */
-typedef void (*StartRasterMode) (gx_device_printer * pdev, int paper_size,
- FILE * prn_stream);
-typedef void (*PrintNonBlankLines) (gx_device_printer * pdev,
- struct ptr_arrays *data_ptrs,
- struct misc_struct *misc_vars,
- struct error_val_field *error_values,
- const Gamma *gamma,
- FILE * prn_stream);
-
-typedef void (*TerminatePage) (gx_device_printer * pdev, FILE * prn_stream);
-
-typedef struct gx_device_cdj970_s {
- gx_device_common;
- gx_prn_colour_device_common;
- int /*cdj_quality_t*/ quality; /* -1 draft, 0 normal, 1 best */
- int /*cdj_paper_type_t*/ papertype; /* papertype [0,4] */
- int /*cdj_duplex_t*/ duplex;
- int intensities; /* intensity values per pixel [2,4] */
- int xscal; /* boolean to indicate x scaling by 2 */
- int yscal; /* boolean to indicate y scaling by 2 */
- int /*cdj_printer_type_t*/ ptype; /* printer type, one of DJ670C, DJ970C, DJ890C, DJ1600C */
- int compression; /* compression level */
- float mastergamma; /* Gammavalue applied to all colors */
- float gammavalc; /* range to which gamma-correction is
- applied to bw values */
- float gammavalm; /* amount of gamma correction for bw */
- float gammavaly; /* range to which gamma-correction i
- applied to color values */
- float gammavalk; /* amount of gamma correction for color */
- float blackcorrect; /* amount of gamma correction for color */
- StartRasterMode start_raster_mode; /* output function to start raster mode */
- PrintNonBlankLines print_non_blank_lines; /* output function to print a non blank line */
- TerminatePage terminate_page; /* page termination output function */
-} gx_device_cdj970;
-
-typedef struct {
- gx_device_common;
- gx_prn_colour_device_common;
-} gx_device_colour_prn;
-
-
-/* Use the cprn_device macro to access generic fields (like cmyk,
- default_depth and correction), and specific macros for specific
- devices. */
-
-#define cprn_device ((gx_device_colour_prn*) pdev)
-#define cdj970 ((gx_device_cdj970 *)pdev)
-
-#define prn_cmyk_colour_device(dtype, procs, dev_name, x_dpi, y_dpi, bpp, print_page, correct)\
- prn_colour_device_body(dtype, procs, dev_name,\
- DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, x_dpi, y_dpi, 0, 0, 0, 0,\
- ((bpp == 1 || bpp == 4) ? 1 : 4), bpp,\
- (bpp > 8 ? 255 : 1), (1 << (bpp >> 2)) - 1, /* max_gray, max_color */\
- (bpp > 8 ? 5 : 2), (bpp > 8 ? 5 : bpp > 1 ? 2 : 0),\
- print_page, 1 /* cmyk */, correct)
-
-
-#define prn_cmy_colour_device(dtype, procs, dev_name, x_dpi, y_dpi, bpp, print_page, correct)\
- prn_colour_device_body(dtype, procs, dev_name,\
- DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, x_dpi, y_dpi, 0, 0, 0, 0,\
- ((bpp == 1 || bpp == 4) ? 1 : 3), bpp,\
- (bpp > 8 ? 255 : 1), (bpp > 8 ? 255 : 1), /* max_gray, max_color */\
- (bpp > 8 ? 5 : 2), (bpp > 8 ? 5 : bpp > 1 ? 2 : 0),\
- print_page, -1 /* cmyk */, correct)
-
-
-#define cdj_970_device(procs, dev_name, x_dpi, y_dpi, bpp, print_page, correction, quality, papertype, duplex, intensities,ptype,compression,mastergamma,gammavalc,gammavalm,gammavaly,gammavalk,blackcorrect,start_raster_mode,print_non_blank_line,terminate_page)\
-{ prn_cmyk_colour_device(gx_device_cdj970, procs, dev_name, x_dpi, y_dpi, bpp, print_page, correction),\
- quality,\
- papertype,\
- duplex,\
- intensities,\
- 0, 0, /* xscal, yscal */\
- ptype,\
- compression,\
- mastergamma,\
- gammavalc,\
- gammavalm,\
- gammavaly,\
- gammavalk,\
- blackcorrect,\
- start_raster_mode,\
- print_non_blank_line,\
- terminate_page\
-}
-
-#define cmyk_colour_procs(proc_colour_open, proc_get_params, proc_put_params, \
- proc_colour_close, map_rgb_color, map_color_rgb, map_cmyk_color) {\
- proc_colour_open,\
- gx_default_get_initial_matrix,\
- gx_default_sync_output,\
- gdev_prn_output_page,\
- proc_colour_close,\
- map_rgb_color,\
- map_color_rgb,\
- NULL /* fill_rectangle */,\
- NULL /* tile_rectangle */,\
- NULL /* copy_mono */,\
- NULL /* copy_color */,\
- NULL /* draw_line */,\
- gx_default_get_bits,\
- proc_get_params,\
- proc_put_params,\
- map_cmyk_color\
-}
-
-private void
- cdj970_start_raster_mode(gx_device_printer * pdev,
- int papersize, FILE * prn_stream);
-
-private void
- cdj970_print_non_blank_lines(gx_device_printer * pdev,
- struct ptr_arrays *data_ptrs,
- struct misc_struct *misc_vars,
- struct error_val_field *error_values,
- const Gamma *gamma,
- FILE * prn_stream);
-private void
- cdj970_terminate_page(gx_device_printer * pdev, FILE * prn_stream);
-
-
-private const gx_device_procs cdj970_procs =
-cmyk_colour_procs(hp_colour_open, cdj970_get_params, cdj970_put_params,
- cdj970_close, NULL, gdev_cmyk_map_color_rgb, gdev_cmyk_map_cmyk_color);
-
-const gx_device_cdj970 gs_cdj970_device =
- cdj_970_device(cdj970_procs, "cdj970", 600, 600, 32, cdj970_print_page, 0,
- NORMAL, PLAIN_PAPER, NONE, 4, DJ970C, 2,
- 1.0, 0.0, 0.0, 0.0, 0.0, 1.0,
- cdj970_start_raster_mode, cdj970_print_non_blank_lines,
- cdj970_terminate_page);
-
-/* Forward references */
-private int cdj_put_param_int(gs_param_list *, gs_param_name,
- int *, int, int, int);
-private int cdj_put_param_float(gs_param_list *, gs_param_name, float
- *, float, float, int);
-private int cdj_put_param_bpp(gx_device *, gs_param_list *, int, int, int);
-private int cdj_set_bpp(gx_device *, int, int);
-
-static int PageCtr = 0;
-
-/**********************************************************************************/
-/* */
-/* private functions */
-/* */
-/**********************************************************************************/
-
-/* hp_colour_open: Open the printer and set up the margins.
-----------------------------------------------------------------------------------*/
-private int hp_colour_open(gx_device * pdev)
-{
- int retCode;
-
- /* Set up colour params if put_params has not already done so */
- if (pdev->color_info.num_components == 0) {
- int code = cdj_set_bpp(pdev, pdev->color_info.depth,
- pdev->color_info.num_components);
-
- if (code < 0)
- return code;
- }
-
- retCode = gdev_prn_open (pdev);
- if (retCode < 0)
- return (retCode);
- else {
- retCode = gdev_prn_open_printer(pdev, true);
- if (retCode < 0)
- return (retCode);
- }
-
- return 0;
-}
-
-/* cdj970_get_params: Added parameters for DeskJet 970C
-----------------------------------------------------------------------------------*/
-private int cdj970_get_params(gx_device * pdev, gs_param_list * plist)
-{
- int code = gdev_prn_get_params(pdev, plist);
-
- if (code < 0 ||
- (code = param_write_int(plist, "Quality", &cdj970->quality)) < 0 ||
- (code = param_write_int(plist, "Duplex", &cdj970->duplex)) < 0 ||
- (code = param_write_int(plist, "Papertype", &cdj970->papertype)) < 0 ||
- (code = param_write_float(plist, "MasterGamma", &cdj970->gammavalc))
- < 0 ||
- (code = param_write_float(plist, "GammaValC", &cdj970->gammavalc)) <
- 0 ||
- (code = param_write_float(plist, "GammaValM", &cdj970->gammavalm)) <
- 0 ||
- (code = param_write_float(plist, "GammaValY", &cdj970->gammavaly)) <
- 0 ||
- (code = param_write_float(plist, "GammaValK", &cdj970->gammavalk)) <
- 0 ||
- (code = param_write_float(plist, "BlackCorrect",
- &cdj970->blackcorrect)) < 0)
-
- return (code);
- return (code);
-}
-
-/* cdj970_put_params:
-----------------------------------------------------------------------------------*/
-private int cdj970_put_params(gx_device * pdev, gs_param_list * plist)
-{
- int quality = cdj970->quality;
- int papertype = cdj970->papertype;
- int duplex = cdj970->duplex;
- float mastergamma = cdj970->mastergamma;
- float gammavalc = cdj970->gammavalc;
- float gammavalm = cdj970->gammavalm;
- float gammavaly = cdj970->gammavaly;
- float gammavalk = cdj970->gammavalk;
- float blackcorrect = cdj970->blackcorrect;
-
- int bpp = 0;
- int code = 0;
-
- code = cdj_put_param_int(plist, "BitsPerPixel", &bpp, 1, 32, code);
- code = cdj_put_param_int(plist, "Quality", &quality, 0, 2, code);
- code = cdj_put_param_int(plist, "Papertype", &papertype, 0, 4, code);
- code = cdj_put_param_int(plist, "Duplex", &duplex, 0, 2, code);
- code = cdj_put_param_float(plist, "MasterGamma", &mastergamma, 0.1, 9.0, code);
- code = cdj_put_param_float(plist, "GammaValC", &gammavalc, 0.0, 9.0, code);
- code = cdj_put_param_float(plist, "GammaValM", &gammavalm, 0.0, 9.0, code);
- code = cdj_put_param_float(plist, "GammaValY", &gammavaly, 0.0, 9.0, code);
- code = cdj_put_param_float(plist, "GammaValK", &gammavalk, 0.0, 9.0, code);
- code = cdj_put_param_float(plist, "BlackCorrect", &blackcorrect, 0.0,
- 9.0, code);
-
- if (code < 0)
- return code;
-
- code = cdj_put_param_bpp(pdev, plist, bpp, bpp, 0);
-
- if (code < 0)
- return code;
-
- cdj970->quality = quality;
- cdj970->papertype = papertype;
- cdj970->duplex = duplex;
- cdj970->mastergamma = mastergamma;
- cdj970->gammavalc = gammavalc;
- cdj970->gammavalm = gammavalm;
- cdj970->gammavaly = gammavaly;
- cdj970->gammavalk = gammavalk;
- cdj970->blackcorrect = blackcorrect;
-
- return 0;
-}
-
-/**********************************************************************************/
-/* */
-/* Internal routines */
-/* */
-/**********************************************************************************/
-
-/* The DeskJet970C can compress (mode 9) */
-
-
-/* Some convenient shorthand .. */
-#define x_dpi (pdev->x_pixels_per_inch)
-#define y_dpi (pdev->y_pixels_per_inch)
-
-/* To calculate buffer size as next greater multiple of both parameter and W */
-#define calc_buffsize(a, b) (((((a) + ((b) * W) - 1) / ((b) * W))) * W)
-
-/* internal functions */
-private void
- FSDlinebw(int scan, int plane_size,
- struct error_val_field *error_values,
- byte * kP,
- int n, int *ep, byte * dp);
-
-private void
- FSDlinec2(int scan, int plane_size,
- struct error_val_field *error_values,
- byte * cPa, byte * mPa, byte * yPa, int n,
- byte * dp, int *ep);
-
-private void
- FSDlinec3(int scan, int plane_size,
- struct error_val_field *error_values,
- byte * cPa, byte * mPa, byte * yPa,
- byte * cPb, byte * mPb, byte * yPb,
- int n, byte * dp, int *ep);
-
-private void
- FSDlinec4(int scan, int plane_size,
- struct error_val_field *error_values,
- byte * cPa, byte * mPa, byte * yPa,
- byte * cPb, byte * mPb, byte * yPb,
- int n, byte * dp, int *ep);
-
-private void
- init_error_buffer(struct misc_struct *misc_vars,
- struct ptr_arrays *data_ptrs);
-
-private void
- do_floyd_steinberg(int scan, int cscan, int plane_size,
- int plane_size_c, int n,
- struct ptr_arrays *data_ptrs,
- gx_device_printer * pdev,
- struct error_val_field *error_values);
-
-
-private int
- do_gcr(int bytecount, byte * inbyte, const byte * kvalues,
- const byte * cvalues, const byte * mvalues,
- const byte * yvalues, const int *kcorrect);
-
-private void
- send_scan_lines(gx_device_printer * pdev,
- struct ptr_arrays *data_ptrs,
- struct misc_struct *misc_vars,
- struct error_val_field *error_values,
- const Gamma *gamma,
- FILE * prn_stream);
-
-private void
- do_gamma(float mastergamma, float gammaval, byte * values);
-
-private void
- do_black_correction(float kvalue, int *kcorrect);
-
-private void
- init_data_structure(gx_device_printer * pdev,
- struct ptr_arrays *data_ptrs,
- struct misc_struct *misc_vars);
-
-private void
- calculate_memory_size(gx_device_printer * pdev,
- struct misc_struct *misc_vars);
-
-
-/* assign_dpi:
-----------------------------------------------------------------------------------*/
-private void assign_dpi(int dpi, byte * msb)
-{
- if (dpi == 600) {
- msb[0] = 0x02;
- msb[1] = 0x58;
- } else {
- msb[0] = 0x01;
- msb[1] = 0x2c;
- }
-}
-
-/* cdj970_terminate_page:
-----------------------------------------------------------------------------------*/
-private void cdj970_terminate_page(gx_device_printer * pdev, FILE * prn_stream)
-{
- fputs("\033*rC\f\033&l-2H", prn_stream); /* End Graphics, Reset */
-}
-
-/* cdj970_one_time_initialisation:
-----------------------------------------------------------------------------------*/
-private void cdj970_one_time_initialisation(gx_device_printer * pdev)
-{
- /* Change the margins if necessary. */
- static const float dj_a4[4] = {
- DESKJET_MARGINS_A4
- };
-
- static const float dj_letter[4] = {
- DESKJET_MARGINS_LETTER
- };
- const float *m = (float *)0;
-
- /* quality setup */
- if (cdj970->quality == DRAFT) {
- gx_device_set_resolution((gx_device *)pdev, 300.0, 300.0);
- cdj970->xscal = 0;
- cdj970->yscal = 0;
- cdj970->intensities = 2;
- } else if (cdj970->quality == NORMAL) {
- gx_device_set_resolution((gx_device *)pdev, 600.0, 600.0);
- cdj970->xscal = 1;
- cdj970->yscal = 1;
- /* intensities = 4 from initialization */
- } else { /* quality == PRESENTATION */
- gx_device_set_resolution((gx_device *)pdev, 600.0, 600.0);
- cdj970->xscal = 0;
- cdj970->yscal = 0 ;
- /* intensities = 4 from initialization */
- }
-
- m = (gdev_pcl_paper_size((gx_device *)pdev) == PAPER_SIZE_A4 ? dj_a4 : dj_letter);
-
- gx_device_set_margins((gx_device *)pdev, m, true);
-
- cdj970_write_header ((gx_device *)pdev, pdev->file);
-}
-
-/* cdj970_print_page: Here comes the hp970 output routine
-----------------------------------------------------------------------------------*/
-private int cdj970_print_page(gx_device_printer * pdev, FILE * prn_stream)
-{
- struct error_val_field error_values;
- struct ptr_arrays data_ptrs;
- struct misc_struct misc_vars;
-
- Gamma gamma;
-
- if (PageCtr == 0 && cdj970->ptype == DJ970C) {
- cdj970_one_time_initialisation(pdev);
- }
-
- /* make a local writable copy of the Gamma tables */
- memcpy(&gamma, gammat[cdj970->ptype], sizeof(Gamma));
-
- /* if mastergamma, don't use the built in functions */
- if (cdj970->mastergamma > 1.0) {
- /* prepare the bw lookup table */
- do_gamma(cdj970->mastergamma, cdj970->gammavalk, gamma.k);
- /* prepare the color lookup table */
- do_gamma(cdj970->mastergamma, cdj970->gammavalc, gamma.c);
- do_gamma(cdj970->mastergamma, cdj970->gammavalm, gamma.m);
- do_gamma(cdj970->mastergamma, cdj970->gammavaly, gamma.y);
- }
-
- /* prepare the black correction table for the unbunt mask */
- do_black_correction(cdj970->blackcorrect, gamma.correct);
-
- /* Calculate the needed memory */
- calculate_memory_size(pdev, &misc_vars);
-
- /* and allocate the memory */
-
- /* Since we need 600 and 300 dpi, we set up several buffers:
- storage contains the data as copied from gs, as well as the
- plane-data and the out_row buffer.
- storagec will contain the rescaled color data. It also contains the
- plane_data for the color-planes - these are needed by the
- compression routine, but would be overwritten by the
- b/w-dithering. The color planes allow for overwriting the
- color-data by the error-data. Since we might use the
- 2bpp feature of the hp970 someday, it is sized like storage.
- storagee contains the errors from b/w fs-ditherng */
-
- data_ptrs.storage = (ulong *) gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), misc_vars.storage_size_words, W,
- "cdj970_print_page");
-
- /* if we can't allocate working area */
- if (data_ptrs.storage == 0) {
- return_error(gs_error_VMerror);
- }
-
- /* Initialise the needed pointers */
- init_data_structure(pdev, &data_ptrs, &misc_vars);
-
- /* Start Raster mode */
- (*cdj970->start_raster_mode) (pdev, misc_vars.paper_size, prn_stream);
-
- /* Send each scan line in turn */
- send_scan_lines(pdev, &data_ptrs, &misc_vars, &error_values, &gamma, prn_stream);
-
- /* terminate page and eject paper */
- (*cdj970->terminate_page) (pdev, prn_stream);
-
- /* Free Memory */
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)data_ptrs.storage, misc_vars.storage_size_words, W,
- "hp970_print_page");
-
- PageCtr ++;
-
- return (0);
-}
-
-#define odd(i) ((i & 01) != 0)
-#define BUFFER_SIZE 5000
-
-/* GetScanLine:
-----------------------------------------------------------------------------------*/
-private int GetScanLine( gx_device_printer * pdev,
- int *lnum,
- struct ptr_arrays *data_ptrs,
- struct misc_struct *misc_vars,
- word rmask)
-{
- word *data_words = (word *) data_ptrs->data[misc_vars->scan];
- register word *end_data = data_words + misc_vars->line_size_words;
- unsigned long tempBuffer[BUFFER_SIZE];
- int i = 0;
- register word *enddata2;
-
- if ((cdj970->duplex == BOOK) && (PageCtr%2 == 1)) --(*lnum);
- else ++(*lnum);
-
- gdev_prn_copy_scan_lines(pdev, *lnum, (byte *) data_words, misc_vars->line_size);
-
- if (cdj970->quality == DRAFT)
- enddata2 = (unsigned long*)end_data - ((gdev_pcl_paper_size((gx_device*)pdev) ==
- PAPER_SIZE_A4 ? DUPLEX_LEFT_MARGIN_A4/2 : DUPLEX_LEFT_MARGIN_LETTER/2));
-
- else
- enddata2 = (unsigned long*)end_data - ((gdev_pcl_paper_size((gx_device*)pdev) ==
- PAPER_SIZE_A4 ? DUPLEX_LEFT_MARGIN_A4 : DUPLEX_LEFT_MARGIN_LETTER));
-
- end_data = enddata2;
-
- if ((cdj970->duplex == BOOK) && (PageCtr%2 == 1)) {
- memset (tempBuffer, 0, BUFFER_SIZE*sizeof(unsigned long));
-
- while (enddata2 > data_words) {
- tempBuffer[i++] = *((unsigned long*)enddata2);
- enddata2 --;
- }
-
- memcpy (data_words, tempBuffer, i*sizeof(unsigned long));
-
- }
-
- misc_vars->scan = 1 - misc_vars->scan; /* toggle scan direction */
- misc_vars->is_two_pass = odd(*lnum); /* color output for odd lines */
-
- /* Mask off 1-bits beyond the line width. */
- end_data[-1] &= rmask;
-
-
- /* Remove trailing 0s. */
- while (end_data > data_words && end_data[-1] == 0)
- end_data--;
-
-
- return (end_data - data_words);
-}
-
-
-#define PAGE_CTR_OK ( ((cdj970->duplex < BOOK) && (lnum < lend)) || ((cdj970->duplex == BOOK) && (lnum >= 0) && (PageCtr%2 == 1)) || ((cdj970->duplex == BOOK) && (PageCtr%2 == 0) && (lnum < lend)))
-
-/* send_scan_lines: Send the scan lines to the printer
-----------------------------------------------------------------------------------*/
-private void send_scan_lines( gx_device_printer *pdev,
- struct ptr_arrays *data_ptrs,
- struct misc_struct *misc_vars,
- struct error_val_field *error_values,
- const Gamma *gamma,
- FILE *prn_stream)
-{
- int lnum, lend, llen;
- int num_blank_lines = 0;
-
- word rmask = ~(word) 0 << ((-pdev->width * misc_vars->storage_bpp) & (W * 8 - 1));
-
- lend = pdev->height - (dev_t_margin(pdev) + dev_b_margin(pdev)) * y_dpi;
-
- error_values->c = error_values->m = error_values->y = error_values->k = 0;
-
- /* init the error buffer */
- init_error_buffer(misc_vars, data_ptrs);
-
- misc_vars->zero_row_count = 0;
-
- if ((cdj970->duplex == BOOK) && (PageCtr%2==1)) {
- lnum = lend;
-
- if (cdj970->quality == DRAFT)
- num_blank_lines = (gdev_pcl_paper_size((gx_device*)pdev) == PAPER_SIZE_A4
- ? DUPLEX_BOTTOM_MARGIN_A4/2 : DUPLEX_BOTTOM_MARGIN_LETTER/2);
- else
- num_blank_lines = (gdev_pcl_paper_size((gx_device*)pdev) == PAPER_SIZE_A4
- ? DUPLEX_BOTTOM_MARGIN_A4 : DUPLEX_BOTTOM_MARGIN_LETTER);
- } else lnum = -1;
-
- llen = GetScanLine(pdev, &lnum, data_ptrs, misc_vars, rmask);
-
- while ( PAGE_CTR_OK ) {
-
- while (PAGE_CTR_OK && llen == 0) {
- ++num_blank_lines;
- llen = GetScanLine(pdev, &lnum, data_ptrs, misc_vars, rmask);
- }
-
- if (! PAGE_CTR_OK) {
- break;
- }
-
- /* Skip blank lines if any */
- if (num_blank_lines > 0) {
- fprintf(prn_stream, "%dy", num_blank_lines / (cdj970->yscal + 1));
- memset(data_ptrs->plane_data[0][0], 0, (misc_vars->plane_size * 2 * misc_vars->num_comps));
- memset(data_ptrs->plane_data_c[0][0], 0, (misc_vars->plane_size_c * 2 * misc_vars->num_comps));
-
- }
-
- /* all blank lines printed, now for the non-blank lines */
- if (cdj970->yscal && odd(lnum)) {
- /* output a blank black plane for odd lines */
- putc('v', prn_stream);
- }
- /* now output all non blank lines */
- while (PAGE_CTR_OK && llen != 0) {
- misc_vars->is_color_data = 0; /* maybe we have color ? */
- (*cdj970->print_non_blank_lines) (pdev, data_ptrs, misc_vars,
- error_values, gamma, prn_stream);
- llen = GetScanLine(pdev, &lnum, data_ptrs, misc_vars, rmask);
- }
- if (cdj970->yscal && odd(lnum)) { /* output empty line for odd lines */
- (*cdj970->print_non_blank_lines) (pdev, data_ptrs, misc_vars,
- error_values, gamma, prn_stream);
- }
- /* the current line is empty => run the next iteration */
- num_blank_lines = 0;
- }
-}
-
-/* print_c2plane: Sprint_line compresses (mode 2) and outputs one plane
-----------------------------------------------------------------------------------*/
-private void print_c2plane( FILE *prn_stream,
- char plane_code,
- int plane_size,
- const byte *curr,
- const byte *prev,
- byte *out_data)
-{
- const word *row = (const word *)curr;
- const word *end_row = row + plane_size/W;
- int out_count;
-
- out_count = gdev_pcl_mode2compress(row, end_row, out_data);
-
- /* and output the data */
- if (out_count > 0) {
- fprintf(prn_stream, "%d%c", out_count, plane_code);
- fwrite(out_data, sizeof(byte), out_count, prn_stream);
- } else {
- putc(plane_code, prn_stream);
- }
-}
-
-#define SET_BLACK(n) *cPa=*cPa|n; *mPa=*mPa|n; *yPa=*yPa|n;
-
-/* cdj970_print_non_blank_lines: Printing non-blank lines
-----------------------------------------------------------------------------------*/
-private void cdj970_print_non_blank_lines( gx_device_printer *pdev,
- struct ptr_arrays *data_ptrs,
- struct misc_struct *misc_vars,
- struct error_val_field *error_values,
- const Gamma *gamma,
- FILE *prn_stream)
-{
- static const char *const plane_code[2] = {"vvvv", "wvvv"};
-
- int i;
- byte *kP = data_ptrs->plane_data[misc_vars->scan + 2][3];
- byte *dp = data_ptrs->data[misc_vars->scan + 2];
- int *ep = data_ptrs->errors[misc_vars->scan];
-
- /* we need cmyk color separation befor all the rest, since
- black may be contained in the color fields. This needs to
- be done on all pixel-rows, since even unused color-bytes
- might generate black */
-
- misc_vars->is_color_data =
- do_gcr(misc_vars->databuff_size, data_ptrs->data[misc_vars->scan],
- gamma->k, gamma->c, gamma->m, gamma->y, gamma->correct);
-
- /* dithering the black-plane */
- FSDlinebw(misc_vars->scan, misc_vars->plane_size,
- error_values, kP, misc_vars->num_comps, ep, dp);
- /* output the black plane */
- print_c2plane(prn_stream, 'v', misc_vars->plane_size,
- data_ptrs->plane_data[misc_vars->scan][3],
- data_ptrs->plane_data[1 - misc_vars->scan][3],
- data_ptrs->out_data);
-
-
- /* since color resolution is only half of the b/w-resolution,
- we only output every second row */
- if (!cdj970->yscal || misc_vars->is_two_pass) {
- int plane_size_c = (*rescale_color_plane[cdj970->xscal][cdj970->yscal])
- (misc_vars->databuff_size,
- data_ptrs->data[misc_vars->scan],
- data_ptrs->data[1 - misc_vars->scan],
- data_ptrs->data_c[misc_vars->cscan]) / misc_vars->storage_bpp;
-
- /* dither the color planes */
- do_floyd_steinberg(misc_vars->scan, misc_vars->cscan,
- misc_vars->plane_size, plane_size_c,
- misc_vars->num_comps, data_ptrs, pdev, error_values);
-
-
- /* the color pointers, lower byte */
- /* Transfer raster graphics in the order C, M, Y, that is planes 2,1,0 */
- for (i = misc_vars->num_comps - 2; i >= 0; i--) {
-
- /* output the lower color planes */
- if (cdj970->intensities > 2) {
- /* output the upper color planes */
- print_c2plane(prn_stream, plane_code[0][i], plane_size_c,
- data_ptrs->plane_data_c[misc_vars->cscan][i + 4],
- data_ptrs->plane_data_c[1 - misc_vars->cscan][i + 4],
- data_ptrs->out_data);
-
- }
- print_c2plane(prn_stream, plane_code[1][i],
- plane_size_c,
- data_ptrs->plane_data_c[misc_vars->cscan][i],
- data_ptrs->plane_data_c[1 - misc_vars->cscan][i],
- data_ptrs->out_data);
-
- } /* End For i = num_comps */
-
- misc_vars->cscan = 1 - misc_vars->cscan;
-
- } /* End of is_two_pass */
-
- return;
-}
-
-/* do_floyd_steinberg: moved that code into his own subroutine,
- * otherwise things get somewhat clumsy
-----------------------------------------------------------------------------------*/
-private void do_floyd_steinberg( int scan,
- int cscan,
- int plane_size,
- int plane_size_c,
- int n,
- struct ptr_arrays *data_ptrs,
- gx_device_printer *pdev,
- struct error_val_field *error_values)
-{
- /* the color pointers */
- byte *cPa, *mPa, *yPa, *cPb, *mPb, *yPb;
- byte *dpc;
- int *epc;
-
- /* the b/w pointers */
- byte *kP, *dp;
- int *ep;
-
- /* the color pointers, lower byte */
- cPa = data_ptrs->plane_data_c[cscan + 2][2];
- mPa = data_ptrs->plane_data_c[cscan + 2][1];
- yPa = data_ptrs->plane_data_c[cscan + 2][0];
-
- /* upper byte */
- cPb = data_ptrs->plane_data_c[cscan + 2][6];
- mPb = data_ptrs->plane_data_c[cscan + 2][5];
- yPb = data_ptrs->plane_data_c[cscan + 2][4];
-
- /* data and error */
- dpc = data_ptrs->data_c[cscan + 2];
- epc = data_ptrs->errors_c[cscan];
-
- /* the b/w pointers */
- kP = data_ptrs->plane_data[scan + 2][3];
- dp = data_ptrs->data[scan + 2];
- ep = data_ptrs->errors[scan];
-
- switch (cdj970->intensities) {
- case 2:
- FSDlinec2(cscan, plane_size_c, error_values,
- cPa, mPa, yPa, n, dpc, epc);
- break;
-
- case 3:
- FSDlinec3(cscan, plane_size_c, error_values,
- cPa, mPa, yPa, cPb, mPb, yPb, n, dpc, epc);
- break;
-
- case 4:
- FSDlinec4(cscan, plane_size_c, error_values,
- cPa, mPa, yPa, cPb, mPb, yPb, n, dpc, epc);
- break;
-
- default:
- assert(0);
- }
-
- return;
-}
-
-
-/* do_gamma: here we do our own gamma-correction
-----------------------------------------------------------------------------------*/
-private void do_gamma(float mastergamma, float gammaval, byte values[256])
-{
- int i;
- float gamma;
-
- if (gammaval > 0.0) {
- gamma = gammaval;
- } else {
- gamma = mastergamma;
- }
-
- for (i = 0; i < 256; i++) {
- values[i] = (byte) (255.0 * (1.0 - pow(((double)(255.0 - (float)i) / 255.0),
- (double)(1.0 / gamma))));
- }
-
- return;
-}
-
-
-/* do_black_correction: here we calculate a lookup-table which is used to
- * compensate the relativ loss of color due to
- * undercolor-removal
-----------------------------------------------------------------------------------*/
-private void do_black_correction(float kvalue, int kcorrect[256])
-{
- int i;
-
- for (i = 0; i < 256; i++) {
- kcorrect[i] = (int)(100.0 * kvalue * (pow(10.0, pow((i / 255.0), 3.0)) - 1.0));
- }
-
- return;
-}
-
-
-/* DOUCR: For Better Performance we use a macro here
-----------------------------------------------------------------------------------*/
-#define DOUCR(col1, col2, col3, col4)\
-{\
- /* determine how far we are from the grey axis. This is */\
- /* traditionally done by computing MAX(CMY)-MIN(CMY). */\
- /* However, if two colors are very similar, we could */\
- /* as either CMYRGB and K. Therefore we calculate the */\
- /* the distance col1-col2 and col2-col3, and use the */\
- /* smaller one. */\
- a = *col1 - *col2;\
- b = *col2 - *col3;\
- if (a >= b) {\
- grey_distance = 1.0 - (b/255.0);\
- } else {\
- grey_distance = 1.0 - (a/255.0);\
- }\
- ucr = (byte) (*col3 * grey_distance); \
- *col4 = *col4 + ucr; /* add removed black to black */\
- /* remove only as much color as black is surviving the */\
- /* gamma correction */\
- ucr = *(kvalues + ucr);\
- *col1 = *col1 - ucr ;\
- *col2 = *col2 - ucr ;\
- *col3 = *col3 - ucr ;\
-}
-
-
-/* DOGCR: For Better Performance we use a macro here
-----------------------------------------------------------------------------------*/
-#define DOGCR(col1, col2, col3, col4)\
-{\
- ucr = (int) *col3;\
- *col1 -= ucr ;\
- *col2 -= ucr ;\
- *col3 -= ucr ;\
- *col4 += ucr; /* add removed black to black */\
- kadd = ucr + *(kcorrect + ucr);\
- uca_fac = 1.0 + (kadd/255.0);\
- *col1 *= uca_fac;\
- *col2 *= uca_fac;\
-}
-
-
-/* do_gcr: Since resolution can be different on different planes, we need to
- * do real color separation, here we try a real grey component
- * replacement
-----------------------------------------------------------------------------------*/
-private int do_gcr( int bytecount,
- byte *inbyte,
- const byte kvalues[256],
- const byte cvalues[256],
- const byte mvalues[256],
- const byte yvalues[256],
- const int kcorrect[256])
-{
- int i, ucr, kadd, is_color = 0;
- byte *black, *cyan, *magenta, *yellow;
- float uca_fac;
-
- /* Grey component replacement */
- for (i = 0; i < bytecount; i += 4) {
- black = inbyte++; /* Assign to black the current address of inbyte */
- cyan = inbyte++;
- magenta = inbyte++;
- yellow = inbyte++;
-
- if (*magenta + *yellow + *cyan > 0) { /* if any color at all */
- is_color = 1;
-
- if ((*cyan >= *magenta) && (*magenta >= *yellow) && (*yellow > 0)) { /* if any grey component */
- DOGCR(cyan, magenta, yellow, black);
- } else if ((*cyan >= *yellow) && (*yellow >= *magenta) && (*magenta > 0)) {
- DOGCR(cyan, yellow, magenta, black);
- } else if ((*yellow >= *magenta) && (*magenta >= *cyan) && (*cyan > 0)) {
- DOGCR(yellow, magenta, cyan, black);
- } else if ((*yellow >= *cyan) && (*cyan >= *magenta) && (*magenta > 0)) {
- DOGCR(yellow, cyan, magenta, black);
- } else if ((*magenta >= *yellow) && (*yellow >= *cyan) && (*cyan > 0)) {
- DOGCR(magenta, yellow, cyan, black);
- } else if ((*magenta >= *cyan) && (*cyan >= *yellow) && (*yellow > 0)) {
- DOGCR(magenta, cyan, yellow, black);
- } else { /* do gamma only if no black */
- ;
- }
-
- *cyan = *(cvalues + *cyan);
- *magenta = *(mvalues + *magenta);
- *yellow = *(yvalues + *yellow);
- } /* end of if c+m+y > 0 */
-
- *black = *(kvalues + *black);
- } /* end of for bytecount */
-
- return (is_color);
-}
-
-/* rescale_byte_wise2x2: Since resolution can be different on different planes,
- * we need to rescale the data byte by byte
-----------------------------------------------------------------------------------*/
-private int rescale_byte_wise2x2( int bytecount,
- const byte *inbytea,
- const byte *inbyteb,
- byte *outbyte)
-{
- register int i, j;
- int max = bytecount / 2;
-
- for (i = 0; i < max; i += 4) {
- j = 2 * i;
- /* cyan */
- outbyte[i + 1] = (inbytea[j + 1] + inbytea[j + 5] + inbyteb[j + 1] + inbyteb[j + 5]) / 4;
-
- /* magenta */
- outbyte[i + 2] = (inbytea[j + 2] + inbytea[j + 6] + inbyteb[j + 2] + inbyteb[j + 6]) / 4;
-
- /* yellow */
- outbyte[i + 3] = (inbytea[j + 3] + inbytea[j + 7] + inbyteb[j + 3] + inbyteb[j + 7]) / 4;
- }
-
- return (max);
-}
-
-
-/* rescale_byte_wise2x1: Since resolution can be different on different planes,
- * we need to rescale the data byte by byte
-----------------------------------------------------------------------------------*/
-private int rescale_byte_wise2x1( int bytecount,
- const byte *inbytea,
- const byte *inbyteb,
- byte *outbyte)
-{
- register int i, j;
- int max = bytecount / 2;
-
- for (i = 0; i < max; i += 4) {
- j = 2 * i;
-
- /* cyan */
- outbyte[i + 1] = (inbytea[j + 1] + inbytea[j + 5]) / 2;
-
- /* magenta */
- outbyte[i + 2] = (inbytea[j + 2] + inbytea[j + 6]) / 2;
-
- /* yellow */
- outbyte[i + 3] = (inbytea[j + 3] + inbytea[j + 7]) / 2;
- }
-
- return (max);
-}
-
-/* rescale_byte_wise1x2: Since resolution can be different on different planes,
- * we need to rescale the data byte by byte
-----------------------------------------------------------------------------------*/
-private int rescale_byte_wise1x2( int bytecount,
- const byte *inbytea,
- const byte *inbyteb,
- byte *outbyte)
-{
- register int i;
-
- for (i = 0; i < bytecount; i += 4) {
- /* cyan */
- outbyte[i + 1] = (inbytea[i + 1] + inbyteb[i + 1]) / 2;
-
- /* magenta */
- outbyte[i + 2] = (inbytea[i + 2] + inbyteb[i + 2]) / 2;
-
- /* yellow */
- outbyte[i + 3] = (inbytea[i + 3] + inbyteb[i + 3]) / 2;
- }
-
- return bytecount;
-}
-
-/* rescale_byte_wise1x1: Since resolution can be different on different planes,
- * we need to rescale the data byte by byte
-----------------------------------------------------------------------------------*/
-private int rescale_byte_wise1x1( int bytecount,
- const byte *inbytea,
- const byte *inbyteb,
- byte *outbyte)
-{
- register int i;
-
- for (i = 0; i < bytecount; i += 4) {
- /* cyan */
- outbyte[i + 1] = inbytea[i + 1];
-
- /* magenta */
- outbyte[i + 2] = inbytea[i + 2];
-
- /* yellow */
- outbyte[i + 3] = inbytea[i + 3];
- }
-
- return (bytecount);
-}
-
-/* MACROS FOR DITHERING (we use macros for compact source and faster code) */
-/* Floyd-Steinberg dithering. Often results in a dramatic improvement in
- * subjective image quality, but can also produce dramatic increases in
- * amount of printer data generated and actual printing time!! Mode 9 2D
- * compression is still useful for fairly flat colour or blank areas but its
- * compression is much less effective in areas where the dithering has
- * effectively randomised the dot distribution. */
-
-#define RSHIFT ((I * 8) - 16)
-#define SHIFT ((I * 8) - 13)
-#define MAXVALUE (255 << SHIFT)
-#define RANDOM (((rand() << RSHIFT) % (MAXVALUE / 2)) - MAXVALUE /4);
-#define MINVALUE 0
-#define C 8
-
-#define THRESHOLD (128 << SHIFT)
-
-/* --- needed for the hp970 -- */
-#define SHIFTS ((I * 8) - 14)
-#define SHIFTM ((I * 8) - 13)
-#define SHIFTL ((I * 8) - 12)
-
-#define MAXVALUES (160 << SHIFTM)
-#define MAXVALUEM (226 << SHIFTM)
-#define MAXVALUEL (255 << SHIFTM)
-
-#define THRESHOLDS (128 << SHIFTM)
-#define THRESHOLDM (192 << SHIFTM)
-#define THRESHOLDL (226 << SHIFTM)
-
-
-/* --------------------------- */
-
-/* init_error_buffer: initialise the error_buffer
-----------------------------------------------------------------------------------*/
-private void init_error_buffer( struct misc_struct *misc_vars,
- struct ptr_arrays *data_ptrs)
-{
- int i;
- int *ep;
- int *epc;
-
- ep = data_ptrs->errors[0];
- epc = data_ptrs->errors_c[0];
-
- if (misc_vars->bits_per_pixel > 4) { /* Randomly seed initial error buffer */
- /* Otherwise, the first dithered rows would look rather uniform */
- for (i = 0; i < misc_vars->databuff_size; i++) { /* 600dpi planes */
- *ep++ = RANDOM;
- }
-
- /* Now for the 2 * 300dpi color planes */
- for (i = 0; i < misc_vars->databuff_size_c; i++) {
- *epc++ = RANDOM;
- }
- }
-
- return;
-}
-
-/* FSdither:
-----------------------------------------------------------------------------------*/
-#define FSdither(inP, out, errP, Err, Bit, Offset, Element)\
-{\
- oldErr = Err;\
- Err = (*(errP + Element)\
- + ((Err * 7 + C) >> 4)\
- + ((int)*(inP + Element) << SHIFT));\
- if (Err > THRESHOLD) {\
- out |= Bit;\
- Err -= MAXVALUE;\
- }\
- *(errP + (Element + Offset)) += ((Err * 3 + C) >> 4);\
- *(errP + Element) = ((Err * 5 + oldErr + C) >> 4);\
-}
-
-
-/* FSDlinebw: The hp970 has 600dpi black and 300 dpi color.
-----------------------------------------------------------------------------------*/
-private void FSDlinebw( int scan,
- int plane_size,
- struct error_val_field *error_values,
- byte *kP,
- int n,
- int *ep,
- byte *dp)
-{
- if (scan == 0) { /* going_up */
- byte k, bitmask; /* k = outbyte byte, whereas bitmask defines the
- bit to be set within k */
- int oldErr, i;
-
- for (i = 0; i < plane_size; i++) {
- bitmask = 0x80;
-
- for (k = 0; bitmask != 0; bitmask >>= 1) {
- /* dp points to the first word of the input data which is in kcmy-format */
- /* k points to the beginning of the first outbut byte, which
- is filled up, bit by bit while looping over bytemask */
- /* ep points to the first word of the error-plane which
- contains the errors kcmy format */
- /* err_values->k tempararily holds the error-value */
- /* bitmask selects the bit to be set in the outbyte */
- /* n gives the offset for the byte selection within
- words. With simple cmyk-printing, this should be 4 */
- /* 0 points to the active color within the input-word, i.e. 0
- = black, 1 = cyan, 2 = yellow, 3 = magenta */
-
- FSdither(dp, k, ep, error_values->k, bitmask, -n, 0);
- dp += n, ep += n; /* increment the input and error pointer one
- word (=4 byte) further, in order to
- convert the next word into an bit */
- }
- *kP++ = k; /* fill the output-plane byte with the computet byte
- and increment the output plane pointer one byte */
- }
- } else { /* going_down */
- byte k, bitmask;
- int oldErr, i;
-
- for (i = 0; i < plane_size; i++) {
- bitmask = 0x01;
-
- for (k = 0; bitmask != 0; bitmask <<= 1) {
- dp -= n, ep -= n;
- FSdither(dp, k, ep, error_values->k, bitmask, n, 0);
- }
- *--kP = k;
- }
- }
-
- return;
-}
-
-
-/* FSDlinec2: Since bw has already been dithered for the hp970c, we need
- * an adapted dither algorythm
-----------------------------------------------------------------------------------*/
-private void FSDlinec2( int scan,
- int plane_size,
- struct error_val_field *error_values,
- byte *cPa,
- byte *mPa,
- byte *yPa,
- int n,
- byte *dp,
- int *ep)
-{
- if (scan == 0) { /* going_up */
- int oldErr, i;
- byte ca, ya, ma, bitmask;
-
- for (i = 0; i < plane_size; i++) {
- bitmask = 0x80;
- ca = ya = ma = 0;
-
- for (ca = 0; bitmask != 0; bitmask >>= 1) {
- FSdither(dp, ca, ep, error_values->c, bitmask, -n, n - 3);
- FSdither(dp, ma, ep, error_values->m, bitmask, -n, n - 2);
- FSdither(dp, ya, ep, error_values->y, bitmask, -n, n - 1);
- dp += n, ep += n;
- }
-
- *cPa++ = ca;
- *mPa++ = ma;
- *yPa++ = ya;
- }
- } else { /* going_down */
- byte ca, ya, ma, bitmask;
- int oldErr, i;
-
- for (i = 0; i < plane_size; i++) {
- bitmask = 0x01;
- ca = ya = ma = 0;
-
- for (ca = 0; bitmask != 0; bitmask <<= 1) {
- dp -= n, ep -= n;
- FSdither(dp, ya, ep, error_values->y, bitmask, n, n - 1);
- FSdither(dp, ma, ep, error_values->m, bitmask, n, n - 2);
- FSdither(dp, ca, ep, error_values->c, bitmask, n, n - 3);
- }
-
- *--yPa = ya;
- *--mPa = ma;
- *--cPa = ca;
- }
- }
-
- return;
-}
-
-
-/* FSdither9703: while printing on paper, we only use 3 -intensities
-----------------------------------------------------------------------------------*/
-#define FSdither9703(inP, outa, outb, errP, Err, Bit, Offset, Element)\
-{\
- oldErr = Err;\
- Err = (*(errP + Element)\
- + ((Err * 7 + C) >> 4)\
- + ((int) *(inP + Element) << SHIFT));\
- if ((Err > THRESHOLDS) && (Err <= THRESHOLDM)) {\
- outa |= Bit;\
- Err -= MAXVALUES;\
- }\
- if (Err > THRESHOLDM) {\
- outb |= Bit;\
- Err -= MAXVALUEM;\
- }\
- *(errP + (Element + Offset)) += ((Err * 3 + C) >> 4);\
- *(errP + Element) = ((Err * 5 + oldErr + C) >> 4);\
-}
-
-
-/* FSDlinec3: On ordinary paper, we'll only use 3 intensities with the hp970
-----------------------------------------------------------------------------------*/
-private void FSDlinec3( int scan,
- int plane_size,
- struct error_val_field *error_values,
- byte *cPa,
- byte *mPa,
- byte *yPa,
- byte *cPb,
- byte *mPb,
- byte *yPb,
- int n,
- byte *dp,
- int *ep)
-{
- if (scan == 0) { /* going_up */
- byte ca, ya, ma, cb, yb, mb, bitmask;
- int oldErr, i;
-
- for (i = 0; i < plane_size; i++) {
- bitmask = 0x80;
- ca = ya = ma = cb = yb = mb = 0;
-
- for (ca = 0; bitmask != 0; bitmask >>= 1) {
- FSdither9703(dp, ca, cb, ep, error_values->c, bitmask, -n, n - 3);
- FSdither9703(dp, ma, mb, ep, error_values->m, bitmask, -n, n - 2);
- FSdither9703(dp, ya, yb, ep, error_values->y, bitmask, -n, n - 1);
- dp += n, ep += n;
- }
-
- *cPa++ = ca;
- *mPa++ = ma;
- *yPa++ = ya;
- *cPb++ = cb;
- *mPb++ = mb;
- *yPb++ = yb;
- }
- } else { /* going_down */
- byte ca, ya, ma, cb, yb, mb, bitmask;
- int oldErr, i;
-
- for (i = 0; i < plane_size; i++) {
- bitmask = 0x01;
- ca = ya = ma = cb = yb = mb = 0;
-
- for (ca = 0; bitmask != 0; bitmask <<= 1) {
- dp -= n, ep -= n;
- FSdither9703(dp, ya, yb, ep, error_values->y, bitmask, n, n - 1);
- FSdither9703(dp, ma, mb, ep, error_values->m, bitmask, n, n - 2);
- FSdither9703(dp, ca, cb, ep, error_values->c, bitmask, n, n - 3);
- }
-
- *--yPa = ya;
- *--mPa = ma;
- *--cPa = ca;
- *--yPb = yb;
- *--mPb = mb;
- *--cPb = cb;
- }
- }
-
- return;
-}
-
-
-/* FSdither9704: the hp970 knows about 4 different color intensities per color
-----------------------------------------------------------------------------------*/
-#define FSdither9704(inP, outa, outb, errP, Err, Bit, Offset, Element)\
-{\
- oldErr = Err;\
- Err = (*(errP + Element)\
- + ((Err * 7 + C) >> 4)\
- + ((int) *(inP + Element) << SHIFT));\
- if ((Err > THRESHOLDS) && (Err <= THRESHOLDM)) {\
- outa |= Bit;\
- Err -= MAXVALUES;\
- }\
- if ((Err > THRESHOLDM) && (Err <= THRESHOLDL)) {\
- outb |= Bit;\
- Err -= MAXVALUEM;\
- }\
- if (Err > THRESHOLDL) {\
- outa |= Bit;\
- outb |= Bit;\
- Err -= MAXVALUEL;\
- }\
- *(errP + (Element + Offset)) += ((Err * 3 + C) >> 4);\
- *(errP + Element) = ((Err * 5 + oldErr + C) >> 4);\
-}
-
-
-/* FSDlinec4: The hp970c knows about 4 intensity levels per color. Once more,
- * we need an adapted dither algorythm
-----------------------------------------------------------------------------------*/
-private void FSDlinec4( int scan,
- int plane_size,
- struct error_val_field *error_values,
- byte *cPa,
- byte *mPa,
- byte *yPa,
- byte *cPb,
- byte *mPb,
- byte *yPb,
- int n,
- byte *dp,
- int *ep)
-{
- if (scan == 0) { /* going_up */
- byte ca, ya, ma, cb, yb, mb, bitmask;
- int oldErr, i;
-
- for (i = 0; i < plane_size; i++) {
- bitmask = 0x80;
- ca = ya = ma = cb = yb = mb = 0;
-
- for (ca = 0; bitmask != 0; bitmask >>= 1) {
- FSdither9704(dp, ca, cb, ep, error_values->c, bitmask, -n, n - 3);
- FSdither9704(dp, ma, mb, ep, error_values->m, bitmask, -n, n - 2);
- FSdither9704(dp, ya, yb, ep, error_values->y, bitmask, -n, n - 1);
- dp += n, ep += n;
-
- }
-
- *cPa++ = ca;
- *mPa++ = ma;
- *yPa++ = ya;
- *cPb++ = cb;
- *mPb++ = mb;
- *yPb++ = yb;
- }
- } else { /* going_down */
- byte ca, ya, ma, cb, yb, mb, bitmask;
- int oldErr, i;
-
- for (i = 0; i < plane_size; i++) {
- bitmask = 0x01;
- ca = ya = ma = cb = yb = mb = 0;
-
- for (ca = 0; bitmask != 0; bitmask <<= 1) {
- dp -= n, ep -= n;
- FSdither9704(dp, ya, yb, ep, error_values->y, bitmask, n, n - 1);
- FSdither9704(dp, ma, mb, ep, error_values->m, bitmask, n, n - 2);
- FSdither9704(dp, ca, cb, ep, error_values->c, bitmask, n, n - 3);
- }
- *--yPa = ya;
- *--mPa = ma;
- *--cPa = ca;
- *--yPb = yb;
- *--mPb = mb;
- *--cPb = cb;
- }
- }
-
- return;
-}
-
-/* calculate_memory_size: calculate the needed memory
-----------------------------------------------------------------------------------*/
-private void calculate_memory_size( gx_device_printer *pdev,
- struct misc_struct *misc_vars)
-{
- int xfac = cdj970->xscal ? 2 : 1;
-
- misc_vars->line_size = gdev_prn_raster(pdev);
- misc_vars->line_size_c = misc_vars->line_size / xfac;
- misc_vars->line_size_words = (misc_vars->line_size + W - 1) / W;
- misc_vars->paper_size = gdev_pcl_paper_size((gx_device *) pdev);
- misc_vars->num_comps = pdev->color_info.num_components;
- misc_vars->bits_per_pixel = pdev->color_info.depth;
- misc_vars->storage_bpp = misc_vars->num_comps * 8;
- misc_vars->expanded_bpp = misc_vars->num_comps * 8;
- misc_vars->errbuff_size = 0;
- misc_vars->errbuff_size_c = 0;
-
- misc_vars->plane_size = calc_buffsize(misc_vars->line_size, misc_vars->storage_bpp);
-
- /* plane_size_c is dependedend on the bits used for
- dithering. Currently 2 bits are sufficient */
- misc_vars->plane_size_c = 2 * misc_vars->plane_size / xfac;
-
- /* 4n extra values for line ends */
- /* might be wrong, see gdevcdj.c */
- misc_vars->errbuff_size =
- calc_buffsize((misc_vars->plane_size * misc_vars->expanded_bpp +
- misc_vars->num_comps * 4) * I, 1);
-
- /* 4n extra values for line ends */
- misc_vars->errbuff_size_c =
- calc_buffsize((misc_vars->plane_size_c / 2 * misc_vars->expanded_bpp
- + misc_vars->num_comps * 4) * I, 1);
-
- misc_vars->databuff_size =
- misc_vars->plane_size * misc_vars->storage_bpp;
-
- misc_vars->databuff_size_c =
- misc_vars->plane_size_c / 2 * misc_vars->storage_bpp;
-
-
- misc_vars->outbuff_size = misc_vars->plane_size * 4;
-
- misc_vars->storage_size_words = (((misc_vars->plane_size) * 2
- * misc_vars->num_comps)
- + misc_vars->databuff_size
- + misc_vars->errbuff_size
- + misc_vars->outbuff_size
- + ((misc_vars->plane_size_c)
- * 2
- * misc_vars->num_comps)
- + misc_vars->databuff_size_c
- + misc_vars->errbuff_size_c
- + (4 * misc_vars->plane_size_c))
- / W;
-
- return;
-}
-
-/* init_data_structure: Initialise the needed pointers
-----------------------------------------------------------------------------------*/
-private void init_data_structure( gx_device_printer *pdev,
- struct ptr_arrays *data_ptrs,
- struct misc_struct *misc_vars)
-{
- int i;
- byte *p = (byte *) data_ptrs->storage;
-
- misc_vars->scan = 0;
- misc_vars->cscan = 0;
- misc_vars->is_two_pass = 1;
-
- /* the b/w pointer */
- data_ptrs->data[0] = data_ptrs->data[1] = data_ptrs->data[2] = p;
- data_ptrs->data[3] = p + misc_vars->databuff_size;
- /* Note: The output data will overwrite part of the input-data */
-
- if (misc_vars->bits_per_pixel > 1) {
- p += misc_vars->databuff_size;
- }
-
- if (misc_vars->bits_per_pixel > 4) {
- data_ptrs->errors[0] = (int *)p + misc_vars->num_comps * 2;
- data_ptrs->errors[1] = data_ptrs->errors[0] + misc_vars->databuff_size;
- p += misc_vars->errbuff_size;
- }
-
- for (i = 0; i < misc_vars->num_comps; i++) {
- data_ptrs->plane_data[0][i] = data_ptrs->plane_data[2][i] = p;
- p += misc_vars->plane_size;
- }
-
- for (i = 0; i < misc_vars->num_comps; i++) {
- data_ptrs->plane_data[1][i] = p;
- data_ptrs->plane_data[3][i] = p + misc_vars->plane_size;
- p += misc_vars->plane_size;
- }
-
- data_ptrs->out_data = p;
- p += misc_vars->outbuff_size;
-
- /* ---------------------------------------------------------
- now for the color pointers
- --------------------------------------------------------- */
-
- data_ptrs->data_c[0] = data_ptrs->data_c[1] = data_ptrs->data_c[2] = p;
- data_ptrs->data_c[3] = p + misc_vars->databuff_size_c;
- /* Note: The output data will overwrite part of the input-data */
-
- if (misc_vars->bits_per_pixel > 1) {
- p += misc_vars->databuff_size_c;
- }
-
- if (misc_vars->bits_per_pixel > 4) {
- data_ptrs->errors_c[0] = (int *)p + misc_vars->num_comps * 2;
- data_ptrs->errors_c[1] = data_ptrs->errors_c[0] + misc_vars->databuff_size_c;
- p += misc_vars->errbuff_size_c;
- }
-
- /* pointer for the lower bits of the output data */
- for (i = 0; i < misc_vars->num_comps; i++) {
- data_ptrs->plane_data_c[0][i] = data_ptrs->plane_data_c[2][i] = p;
- p += misc_vars->plane_size_c / 2;
- }
-
- for (i = 0; i < misc_vars->num_comps; i++) {
- data_ptrs->plane_data_c[1][i] = p;
- data_ptrs->plane_data_c[3][i] = p + misc_vars->plane_size_c / 2;
- p += misc_vars->plane_size_c / 2;
- }
-
- /* pointer for the upper bits of the output data */
- for (i = 0; i < misc_vars->num_comps; i++) {
- data_ptrs->plane_data_c[0][i + 4] = data_ptrs->plane_data_c[2][i + 4] = p;
- p += misc_vars->plane_size_c / 2;
- }
-
- for (i = 0; i < misc_vars->num_comps; i++) {
- data_ptrs->plane_data_c[1][i + 4] = p;
- data_ptrs->plane_data_c[3][i + 4] = p + misc_vars->plane_size_c / 2;
- p += misc_vars->plane_size_c / 2;
- }
-
- for (i = 0; i < misc_vars->num_comps; i++) {
- data_ptrs->test_data[i] = p;
- p += misc_vars->plane_size_c / 2;
- }
-
- /* Clear temp storage */
- memset(data_ptrs->storage, 0, misc_vars->storage_size_words * W);
-
- return;
-}
-
-
-/* cdj970_start_raster_mode: Configure the printer and start Raster mode
-----------------------------------------------------------------------------------*/
-private void cdj970_start_raster_mode( gx_device_printer *pdev,
- int paper_size,
- FILE *prn_stream)
-{
- int xres, yres; /* x,y resolution for color planes */
- hp970_cmyk_init_t init;
-
- init = hp970_cmyk_init;
-
- init.a[13] = cdj970->intensities; /* Intensity levels cyan */
- init.a[19] = cdj970->intensities; /* Intensity levels magenta */
- init.a[25] = cdj970->intensities; /* Intensity levels yellow */
-
- /* black plane resolution */
- assign_dpi(cdj970->x_pixels_per_inch, init.a + 2);
- assign_dpi(cdj970->y_pixels_per_inch, init.a + 4);
-
- /* color plane resolution */
- xres = cdj970->x_pixels_per_inch / (cdj970->xscal + 1);
- yres = cdj970->y_pixels_per_inch / (cdj970->yscal + 1);
-
- /* cyan */
- assign_dpi(xres, init.a + 8);
- assign_dpi(yres, init.a + 10);
-
- /* magenta */
- assign_dpi(xres, init.a + 14);
- assign_dpi(yres, init.a + 16);
-
- /* yellow */
- assign_dpi(xres, init.a + 20);
- assign_dpi(yres, init.a + 22);
-
- /* Page size, orientation, top margin & perforation skip */
- fprintf(prn_stream, "\033&l%dA", paper_size);
-
- /* Print Quality, -1 = draft, 0 = normal, 1 = presentation */
- fprintf(prn_stream, "\033*o%dM", cdj970->quality);
-
- /* Media Type,0 = plain paper, 1 = bond paper, 2 = special
- paper, 3 = glossy film, 4 = transparency film */
- fprintf(prn_stream, "\033&l%dM", cdj970->papertype);
-
- fprintf (prn_stream, "\033u%dD\033&l0e0L", xres);
-
- /* fputs("\033u%dD\033&l0e0L", prn_stream); */
-
- fprintf(prn_stream, "\033*p%dY", (int)(600 * DOFFSET));
-
- /* This will start and configure the raster-mode */
- fprintf(prn_stream, "\033*g%dW", (int)sizeof(init.a)); /* The new configure
- raster data comand */
- fwrite(init.a, sizeof(byte), sizeof(init.a), prn_stream); /* Transmit config
- data */
- fputs("\033&l0H", prn_stream);
- fputs("\033*r1A", prn_stream);
- /* From now on, all escape commands start with \033*b, so we
- * combine them (if the printer supports this). */
- fputs("\033*b", prn_stream);
-
- /* Set compression if the mode has been defined. */
- if (cdj970->compression)
- fprintf(prn_stream, "%dm", cdj970->compression);
-
- return;
-}
-
-/* cdj_put_param_int:
-----------------------------------------------------------------------------------*/
-private int cdj_put_param_int( gs_param_list *plist,
- gs_param_name pname,
- int *pvalue,
- int minval,
- int maxval,
- int ecode)
-{
- int code, value;
-
- switch (code = param_read_int(plist, pname, &value)) {
- default:
- return code;
-
- case 1:
- return ecode;
-
- case 0:
- if (value < minval || value > maxval)
- param_signal_error(plist, pname, gs_error_rangecheck);
- *pvalue = value;
- return (ecode < 0 ? ecode : 1);
- }
-}
-
-/* cdj_put_param_float:
-----------------------------------------------------------------------------------*/
-private int cdj_put_param_float( gs_param_list *plist,
- gs_param_name pname,
- float *pvalue,
- float minval,
- float maxval,
- int ecode)
-{
- int code;
- float value;
-
- switch (code = param_read_float(plist, pname, &value)) {
- default:
- return code;
-
- case 1:
- return ecode;
-
- case 0:
- if (value < minval || value > maxval)
- param_signal_error(plist, pname, gs_error_rangecheck);
- *pvalue = value;
- return (ecode < 0 ? ecode : 1);
- }
-}
-
-/* cdj_set_bpp:
-----------------------------------------------------------------------------------*/
-private int cdj_set_bpp(gx_device * pdev, int bpp, int ccomps)
-{
- gx_device_color_info *ci = &pdev->color_info;
-
- if (ccomps && bpp == 0) {
- if (cprn_device->cmyk) {
- switch (ccomps) {
-
- default:
- return gs_error_rangecheck;
- /*NOTREACHED */
- break;
-
- case 1:
- bpp = 1;
- break;
-
- case 3:
- bpp = 24;
- break;
-
- case 4:
- switch (ci->depth) {
- case 8:
- case 16:
- case 24:
- case 32:
- break;
-
- default:
- bpp = cprn_device->default_depth;
- break;
- }
- break;
- }
- }
- }
-
- if (bpp == 0) {
- bpp = ci->depth; /* Use the current setting. */
- }
-
- if (cprn_device->cmyk < 0) {
- /* Reset procedures because we may have been in another mode. */
- dev_proc(pdev, map_cmyk_color) = gdev_cmyk_map_cmyk_color;
- dev_proc(pdev, map_rgb_color) = NULL;
- dev_proc(pdev, map_color_rgb) = gdev_cmyk_map_color_rgb;
-
- if (pdev->is_open)
- gs_closedevice(pdev);
- }
- /* Check for valid bpp values */
-
- switch (bpp) {
- case 16:
- case 32:
- if (cprn_device->cmyk && ccomps && ccomps != 4)
- goto bppe;
- break;
-
- case 24:
- if (!cprn_device->cmyk || ccomps == 0 || ccomps == 4) {
- break;
- } else if (ccomps == 1) {
- goto bppe;
- } else {
- /* 3 components 24 bpp printing for CMYK device. */
- cprn_device->cmyk = -1;
- }
- break;
-
- case 8:
- if (cprn_device->cmyk) {
- if (ccomps) {
- if (ccomps == 3) {
- cprn_device->cmyk = -1;
- bpp = 3;
- } else if (ccomps != 1 && ccomps != 4) {
- goto bppe;
- }
- }
-
- if (ccomps != 1)
- break;
- } else {
- break;
- }
- case 1:
- if (ccomps != 1)
- goto bppe;
-
- if (cprn_device->cmyk && bpp != pdev->color_info.depth) {
- dev_proc(pdev, map_cmyk_color) = NULL;
- dev_proc(pdev, map_rgb_color) = gdev_cmyk_map_rgb_color;
-
- if (pdev->is_open) {
- gs_closedevice(pdev);
- }
- }
- break;
-
- case 3:
- if (!cprn_device->cmyk) {
- break;
- }
- default:
- bppe:return gs_error_rangecheck;
- }
-
-
- if (cprn_device->cmyk == -1) {
- dev_proc(pdev, map_cmyk_color) = NULL;
- dev_proc(pdev, map_rgb_color) = gdev_pcl_map_rgb_color;
- dev_proc(pdev, map_color_rgb) = gdev_pcl_map_color_rgb;
-
- if (pdev->is_open) {
- gs_closedevice(pdev);
- }
- }
-
- switch (ccomps) {
- case 0:
- break;
-
- case 1:
- if (bpp != 1 && bpp != 8)
- goto cce;
- break;
-
- case 4:
- if (cprn_device->cmyk) {
- if (bpp >= 8)
- break;
- }
-
- case 3:
- if (bpp == 1 || bpp == 3 || bpp == 8 || bpp == 16 || bpp == 24 || bpp == 32) {
- break;
- }
-
- cce:
- default:
- return gs_error_rangecheck;
- }
-
- if (cprn_device->cmyk) {
- if (cprn_device->cmyk > 0) {
- ci->num_components = ccomps ? ccomps : (bpp < 8 ? 1 : 4);
- } else {
- ci->num_components = ccomps ? ccomps : (bpp < 8 ? 1 : 3);
- }
-
- if (bpp != 1 && ci->num_components == 1) { /* We do dithered grays. */
- bpp = bpp < 8 ? 8 : bpp;
- }
-
- ci->max_color = (1 << (bpp >> 2)) - 1;
- ci->max_gray = (bpp >= 8 ? 255 : 1);
-
- if (ci->num_components == 1) {
- ci->dither_grays = (bpp >= 8 ? 5 : 2);
- ci->dither_colors = (bpp >= 8 ? 5 : bpp > 1 ? 2 : 0);
- } else {
- ci->dither_grays = (bpp > 8 ? 5 : 2);
- ci->dither_colors = (bpp > 8 ? 5 : bpp > 1 ? 2 : 0);
- }
- } else {
- ci->num_components = (bpp == 1 || bpp == 8 ? 1 : 3);
- ci->max_color = (bpp >= 8 ? 255 : bpp > 1 ? 1 : 0);
- ci->max_gray = (bpp >= 8 ? 255 : 1);
- ci->dither_grays = (bpp >= 8 ? 5 : 2);
- ci->dither_colors = (bpp >= 8 ? 5 : bpp > 1 ? 2 : 0);
- }
-
- ci->depth = ((bpp > 1) && (bpp < 8) ? 8 : bpp);
-
- return (0);
-}
-
-/*
- * Map a CMYK color to a color index. We just use depth / 4 bits per color
- * to produce the color index.
- *
- * Important note: CMYK values are stored in the order K, C, M, Y because of
- * the way the HP drivers work.
- *
- */
-
-#define gx_color_value_to_bits(cv, b) \
- ((cv) >> (gx_color_value_bits - (b)))
-#define gx_bits_to_color_value(cv, b) \
- ((cv) << (gx_color_value_bits - (b)))
-
-#define gx_cmyk_value_bits(c, m, y, k, b) \
- ((gx_color_value_to_bits((k), (b)) << (3 * (b))) | \
- (gx_color_value_to_bits((c), (b)) << (2 * (b))) | \
- (gx_color_value_to_bits((m), (b)) << (b)) | \
- (gx_color_value_to_bits((y), (b))))
-
-#define gx_value_cmyk_bits(v, c, m, y, k, b) \
- (k) = gx_bits_to_color_value(((v) >> (3 * (b))) & ((1 << (b)) - 1), (b)), \
- (c) = gx_bits_to_color_value(((v) >> (2 * (b))) & ((1 << (b)) - 1), (b)), \
- (m) = gx_bits_to_color_value(((v) >> (b)) & ((1 << (b)) - 1), (b)), \
- (y) = gx_bits_to_color_value((v) & ((1 << (b)) - 1), (b))
-
-/* gdev_cmyk_map_cmyk_color:
-----------------------------------------------------------------------------------*/
-private gx_color_index gdev_cmyk_map_cmyk_color(gx_device * pdev,
- const gx_color_value cv[])
-{
- gx_color_index color;
- gx_color_value cyan, magenta, yellow, black;
-
- cyan = cv[0]; magenta = cv[1]; yellow = cv[2]; black = cv[3];
- switch (pdev->color_info.depth) {
- case 1:
- color = (cyan | magenta | yellow | black) > gx_max_color_value / 2 ?
- ( gx_color_index) 1 : (gx_color_index) 0;
- break;
-
- default:{
- int nbits = pdev->color_info.depth;
-
- if (cyan == magenta && magenta == yellow) {
- /* Convert CMYK to gray -- Red Book 6.2.2 */
- float bpart = ((float)cyan) * (lum_red_weight / 100.) +
- ((float)magenta) * (lum_green_weight / 100.) +
- ((float)yellow) * (lum_blue_weight / 100.) +
- (float)black;
-
- cyan = magenta = yellow = (gx_color_index) 0;
- black = (gx_color_index) (bpart > gx_max_color_value ?
- gx_max_color_value : bpart);
- }
- color = gx_cmyk_value_bits(cyan, magenta, yellow, black,
- nbits >> 2);
- }
- }
-
- return (color);
-}
-
-
-/* gdev_cmyk_map_rgb_color: Mapping of RGB colors to gray values.
-----------------------------------------------------------------------------------*/
-private gx_color_index gdev_cmyk_map_rgb_color( gx_device * pdev,
- const gx_color_value cv[])
-{
- gx_color_value r, g, b;
-
- r = cv[0]; g = cv[1]; b = cv[2];
- if (gx_color_value_to_byte(r & g & b) == 0xff) {
- return (gx_color_index) 0; /* White */
- } else {
- gx_color_value c = gx_max_color_value - r;
- gx_color_value m = gx_max_color_value - g;
- gx_color_value y = gx_max_color_value - b;
-
- switch (pdev->color_info.depth) {
- case 1:
- return (c | m | y) > gx_max_color_value / 2 ? (gx_color_index) 1 : (gx_color_index) 0;
- /*NOTREACHED */
- break;
-
- case 8:
- return ((ulong) c * lum_red_weight * 10
- + (ulong) m * lum_green_weight * 10
- + (ulong) y * lum_blue_weight * 10)
- >> (gx_color_value_bits + 2);
- /*NOTREACHED */
- break;
- }
- }
-
- return (gx_color_index) 0; /* This should never happen. */
-}
-
-
-/* gdev_cmyk_map_rgb_color: Mapping of CMYK colors.
-----------------------------------------------------------------------------------*/
-private int gdev_cmyk_map_color_rgb( gx_device *pdev,
- gx_color_index color,
- gx_color_value prgb[3])
-{
- switch (pdev->color_info.depth) {
- case 1:
- prgb[0] = prgb[1] = prgb[2] = gx_max_color_value * (1 - color);
- break;
-
- case 8:
- if (pdev->color_info.num_components == 1) {
- gx_color_value value = (gx_color_value) color ^ 0xff;
- prgb[0] = prgb[1] = prgb[2] = (value << 8) + value;
- break;
- }
-
- default:{
- unsigned long bcyan, bmagenta, byellow, black;
- int nbits = pdev->color_info.depth;
-
- gx_value_cmyk_bits(color, bcyan, bmagenta, byellow, black, nbits >> 2);
-
-# ifdef USE_ADOBE_CMYK_RGB
-
- /* R = 1.0 - min(1.0, C + K), etc. */
-
- bcyan += black, bmagenta += black, byellow += black;
- prgb[0] = (bcyan > gx_max_color_value ? (gx_color_value) 0 :
- gx_max_color_value - bcyan);
- prgb[1] = (bmagenta > gx_max_color_value ? (gx_color_value) 0 :
- gx_max_color_value - bmagenta);
- prgb[2] = (byellow > gx_max_color_value ? (gx_color_value) 0 :
- gx_max_color_value - byellow);
-
-# else
-
- /* R = (1.0 - C) * (1.0 - K), etc. */
-
- prgb[0] = (gx_color_value)((ulong) (gx_max_color_value - bcyan) *
- (gx_max_color_value - black) / gx_max_color_value);
- prgb[1] = (gx_color_value)((ulong) (gx_max_color_value - bmagenta) *
- (gx_max_color_value - black) / gx_max_color_value);
- prgb[2] = (gx_color_value)((ulong) (gx_max_color_value - byellow) *
- (gx_max_color_value - black) / gx_max_color_value);
-
-#endif
-
- }
- }
-
- return (0);
-}
-
-#define gx_color_value_to_1bit(cv) ((cv) >> (gx_color_value_bits - 1))
-#define red_weight 306
-#define green_weight 601
-#define blue_weight 117
-#define gx_color_value_to_5bits(cv) ((cv) >> (gx_color_value_bits - 5))
-#define gx_color_value_to_6bits(cv) ((cv) >> (gx_color_value_bits - 6))
-
-/* gdev_pcl_map_rgb_color:
-----------------------------------------------------------------------------------*/
-private gx_color_index gdev_pcl_map_rgb_color( gx_device * pdev,
- const gx_color_value cv[])
-{
- gx_color_value r, g, b;
-
- r = cv[0]; g = cv[1]; b = cv[2];
- if (gx_color_value_to_byte(r & g & b) == 0xff)
- return (gx_color_index) 0; /* white */
- else {
- gx_color_value c = gx_max_color_value - r;
- gx_color_value m = gx_max_color_value - g;
- gx_color_value y = gx_max_color_value - b;
-
- switch (pdev->color_info.depth) {
- case 1:
- return ((c | m | y) > gx_max_color_value / 2 ? (gx_color_index) 1 : (gx_color_index) 0);
-
- case 8:
- if (pdev->color_info.num_components >= 3)
- return (gx_color_value_to_1bit(c)
- + (gx_color_value_to_1bit(m) << 1)
- + (gx_color_value_to_1bit(y) << 2));
- else
- return ((((ulong) c * red_weight + (ulong) m * green_weight + (ulong) y * blue_weight)
- >> (gx_color_value_bits + 2)));
-
- case 16:
- return (gx_color_value_to_5bits(y) +
- (gx_color_value_to_6bits(m) << 5) +
- (gx_color_value_to_5bits(c) << 11));
- case 24:
- return (gx_color_value_to_byte(y) +
- (gx_color_value_to_byte(m) << 8) +
- ((ulong) gx_color_value_to_byte(c) << 16));
- case 32: {
- return ((c == m && c == y) ? ((ulong) gx_color_value_to_byte(c) << 24)
- : (gx_color_value_to_byte(y) +
- (gx_color_value_to_byte(m) << 8) +
- ((ulong) gx_color_value_to_byte(c) << 16)));
- }
- }
- }
-
- return ((gx_color_index) 0); /* This never happens */
-}
-
-#define gx_maxcol gx_color_value_from_byte(gx_color_value_to_byte(gx_max_color_value))
-
-/* gdev_pcl_map_color_rgb: Map a color index to a r-g-b color.
-----------------------------------------------------------------------------------*/
-private int gdev_pcl_map_color_rgb( gx_device *pdev,
- gx_color_index color,
- gx_color_value prgb[3])
-{
- /* For the moment, we simply ignore any black correction */
- switch (pdev->color_info.depth) {
- case 1:
- prgb[0] = prgb[1] = prgb[2] = -((gx_color_value) color ^ 1);
- break;
-
- case 8:
- if (pdev->color_info.num_components >= 3) {
- gx_color_value c = (gx_color_value) color ^ 7;
-
- prgb[0] = -(c & 1);
- prgb[1] = -((c >> 1) & 1);
- prgb[2] = -(c >> 2);
- } else {
- gx_color_value value = (gx_color_value) color ^ 0xff;
- prgb[0] = prgb[1] = prgb[2] = (value << 8) + value;
- }
- break;
- case 16: {
- gx_color_value c = (gx_color_value) color ^ 0xffff;
- ushort value = c >> 11;
-
- prgb[0] = ((value << 11) + (value << 6) + (value << 1) +
- (value >> 4)) >> (16 - gx_color_value_bits);
- value = (c >> 6) & 0x3f;
- prgb[1] = ((value << 10) + (value << 4) + (value >> 2))
- >> (16 - gx_color_value_bits);
- value = c & 0x1f;
- prgb[2] = ((value << 11) + (value << 6) + (value << 1) +
- (value >> 4)) >> (16 - gx_color_value_bits);
- }
- break;
-
- case 24: {
- gx_color_value c = (gx_color_value) color ^ 0xffffff;
-
- prgb[0] = gx_color_value_from_byte(c >> 16);
- prgb[1] = gx_color_value_from_byte((c >> 8) & 0xff);
- prgb[2] = gx_color_value_from_byte(c & 0xff);
- }
- break;
-
- case 32: {
- gx_color_value w = gx_maxcol - gx_color_value_from_byte(color >> 24);
-
- prgb[0] = w - gx_color_value_from_byte((color >> 16) & 0xff);
- prgb[1] = w - gx_color_value_from_byte((color >> 8) & 0xff);
- prgb[2] = w - gx_color_value_from_byte(color & 0xff);
- }
- break;
- }
-
- return (0);
-}
-
-#define save_ccomps save_info.num_components
-
-
-/* cdj_put_param_bpp: new_bpp == save_bpp or new_bpp == 0 means don't change bpp.
- * ccomps == 0 means don't change number of color comps.
- * If new_bpp != 0, it must be the value of the BitsPerPixel element of
- * the plist; real_bpp may differ from new_bpp.
-----------------------------------------------------------------------------------*/
-private int cdj_put_param_bpp( gx_device *pdev,
- gs_param_list *plist,
- int new_bpp,
- int real_bpp,
- int ccomps)
-{
- if (new_bpp == 0 && ccomps == 0)
- return gdev_prn_put_params(pdev, plist);
- else {
- gx_device_color_info save_info;
- int save_bpp;
- int code;
-
- save_info = pdev->color_info;
- save_bpp = save_info.depth;
-
- if (save_bpp == 8 && save_ccomps == 3 && !cprn_device->cmyk)
- save_bpp = 3;
-
- code = cdj_set_bpp(pdev, real_bpp, ccomps);
-
- if (code < 0) {
- param_signal_error(plist, "BitsPerPixel", code);
- param_signal_error(plist, "ProcessColorModel", code);
- return (code);
- }
-
- pdev->color_info.depth = new_bpp; /* cdj_set_bpp maps 3/6 to 8 */
- code = gdev_prn_put_params(pdev, plist);
-
- if (code < 0) {
- cdj_set_bpp(pdev, save_bpp, save_ccomps);
- return (code);
- }
-
- cdj_set_bpp(pdev, real_bpp, ccomps); /* reset depth if needed */
- if ((cdj970->color_info.depth != save_bpp
- || (ccomps != 0 && ccomps != save_ccomps))
- && pdev->is_open)
- return (gs_closedevice(pdev));
-
- return (0);
-
-#undef save_ccomps
- }
-}
-
-
-/* cdj970_write_header:
-----------------------------------------------------------------------------------*/
-private int cdj970_write_header (gx_device *pdev, FILE * prn_stream)
-{
-
- char startbuffer[1260];
-
- memset (startbuffer, 0, 1260);
-
- sprintf (&(startbuffer[600]), "\033E\033%%-12345X@PJL JOB NAME = \"GHOST BY RENE HARSCH\"\n@PJL ENTER LANGUAGE=PCL3GUI\n");
-
- fwrite (startbuffer, sizeof(char), 678, prn_stream);
-
- fputs("\033&l1H\033&l-2H", prn_stream); /* reverse engineering */
-
- /* enter duplex mode / reverse engineering */
- if (cdj970->duplex > NONE) {
- fputs("\033&l2S\033&b16WPML", prn_stream);
-
- fputc (0x20, prn_stream);
- fputc (0x04, prn_stream);
- fputc (0x00, prn_stream);
- fputc (0x06, prn_stream);
- fputc (0x01, prn_stream);
- fputc (0x04, prn_stream);
- fputc (0x01, prn_stream);
- fputc (0x04, prn_stream);
- fputc (0x01, prn_stream);
- fputc (0x06, prn_stream);
- fputc (0x08, prn_stream);
- fputc (0x01, prn_stream);
- fputc (0x00, prn_stream);
- }
-
- return 0;
-}
-
-/* cdj970_write_trailer:
-----------------------------------------------------------------------------------*/
-private int cdj970_write_trailer (gx_device *pdev, FILE * prn_stream)
-{
- fprintf(prn_stream, "\033E\033%%-12345X"); /* reverse engineering */
-
- return 0;
-}
-
-
-/* cdj970_close:
-----------------------------------------------------------------------------------*/
-private int cdj970_close(gx_device *pdev)
-{
- gx_device_printer *const ppdev = (gx_device_printer *)pdev;
- int retCode = gdev_prn_open_printer (pdev, true);
-
- if (retCode < 0)
- return (retCode);
-
- cdj970_write_trailer (pdev, ppdev->file);
-
- return gdev_prn_close(pdev);
-
-}
-
diff --git a/gs/contrib/gdevgdi.c b/gs/contrib/gdevgdi.c
deleted file mode 100644
index 82622d373..000000000
--- a/gs/contrib/gdevgdi.c
+++ /dev/null
@@ -1,1462 +0,0 @@
-/*
- This file is part of GNU Ghostscript.
-
- GNU 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 GNU General Public License for full details.
-
- Everyone is granted permission to copy, modify and redistribute GNU
- Ghostscript, but only under the conditions described in the GNU General
- Public License. A copy of this license is supposed to have been given to
- you along with GNU 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.
-
- Aladdin Enterprises is not affiliated with the Free Software Foundation or
- the GNU Project. GNU Ghostscript, as distributed by Aladdin Enterprises,
- does not depend on any other GNU software.
-*/
-
-/* gdevgdi.c */
-/* SAMSUNG GDI driver for Ghostscript */
-#include "gdevprn.h"
-#include "gdevpcl.h"
-
-
-/*
- * You may select a default resolution of 300 or 600 DPI
- * in the makefile, or an actual resolution
- * on the gs command line.
- *
- * If the preprocessor symbol A4 is defined, the default paper size is
- * the European A4 size; otherwise it is the U.S. letter size (8.5"x11").
- *
- * To determine the proper "margin" settings for your printer, see the
- * file align.ps.
- */
-
-/* Define the default, maximum resolutions. */
-#ifdef X_DPI
-# define X_DPI2 X_DPI
-#else
-# define X_DPI 300
-# define X_DPI2 600
-#endif
-#ifdef Y_DPI
-# define Y_DPI2 Y_DPI
-#else
-# define Y_DPI 300
-# define Y_DPI2 600
-#endif
-
-#define GDI_FALSE 0
-#define GDI_TRUE 1
-#define GDI_MAX_COUNT 31
-#define GDI_NO_REPEAT_IDX 0x80000000L
-#define GDI_DATA_LENGTH 11
-#define GDI_REPEAT_LENGTH 2
-#define GDI_BAND_HEIGHT 128
-#define GDI_MAX_BAND 66
-/*#define GDI_BAND_WIDTH 4928*/
-/*#define GDI_BAND_WIDTH_BYTES (((GDI_BAND_WIDTH + 31)/32)*4)*/
-
-#define GDI_PRE_COMP 2
-#define GDI_REAL_COMP 0
-
-#define GDI_COMP_NONE 0
-#define GDI_COMP_TIFF 3
-#define GDI_COMP_SCANLINE 4
-#define GDI_COMP_MODITIFF 6
-#define GDI_COMP_NOSEND 0x7f
-
-#define GDI_MARGINS_A4 0.167, 0.167, 0.167, 0.167
-#define GDI_MARGINS_LETTER 0.167, 0.167, 0.167, 0.167
-/*#define GDI_MARGINS_A4 0.0, 0.0, 0.0, 0.0*/
-/*#define GDI_MARGINS_LETTER 0.0, 0.0, 0.0, 0.0*/
-
-/* The number of blank lines that make it worthwhile to reposition */
-/* the cursor. */
-#define MIN_SKIP_LINES 7
-
-/* We round up the LINE_SIZE to a multiple of a unsigned long for faster scanning. */
-#define W sizeof(word)
-
-int GDI_BAND_WIDTH[] = {4768, 4928};
-
-private int gdi_print_page(gx_device_printer *pdev, FILE *prn_stream);
-private int gdi_open(gx_device *pdev);
-private int gdi_close(gx_device *pdev);
-
-/* The device descriptors */
-private dev_proc_open_device(gdi_open);
-private dev_proc_close_device(gdi_close);
-private dev_proc_print_page(gdi_print_page);
-
-private gx_device_procs prn_gdi_procs =
- prn_params_procs(gdi_open, gdev_prn_output_page, gdi_close,
- gdev_prn_get_params, gdev_prn_put_params);
-
-gx_device_printer far_data gs_gdi_device =
- prn_device(prn_gdi_procs, "gdi",
- DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, /* paper size (unit : 10/72 inch size) */
- X_DPI2, Y_DPI2,
- 0.20, 0.25, 0.25, 0.25, /* margins filled in by gdi_open */
- 1, /* color bit */
- gdi_print_page);
-
-gx_device_printer far_data gs_samsunggdi_device =
- prn_device(prn_gdi_procs, "samsunggdi",
- DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, /* paper size (unit : 10/72 inch size) */
- X_DPI2, Y_DPI2,
- 0.20, 0.25, 0.25, 0.25, /* margins filled in by gdi_open */
- 1, /* color bit */
- gdi_print_page);
-
-private FILE *WritePJLHeaderData(gx_device_printer *pdev, FILE *fp);
-private FILE *WriteBandHeader(FILE *fp, unsigned int usBandNo,
- unsigned char ubCompMode, unsigned int usBandWidth,
- unsigned int usBandHeight, unsigned long ulBandSize);
-private FILE *WriteTrailerData(FILE *fp);
-private unsigned long FrameTiffComp(unsigned char *pubDest, unsigned char *pubSrc,
- unsigned int usTotalLines, unsigned int usBytesPerLine,
- unsigned char ubMode);
-private unsigned int FrameTiff_Comp(unsigned char *lpSrcBuf, unsigned char *lpTgtBuf,
- unsigned int nSrcBytes);
-private unsigned int PreTiffComp(unsigned char *lpSrcBuf, unsigned int nSrcBytes);
-private long bmp2run(unsigned char *out_buf, unsigned char *in_buf, unsigned int sizeY, unsigned int sizeX, unsigned char ubMode);
-
-#define ppdev ((gx_device_printer *)pdev)
-
-/* Open the printer, adjusting the margins if necessary. */
-private int
-gdi_open(gx_device *pdev)
-{ /* Change the margins if necessary. */
- const float *m = 0;
- bool move_origin = true;
-
- static const float m_a4[4] = { GDI_MARGINS_A4 };
- static const float m_letter[4] = { GDI_MARGINS_LETTER };
- m = (gdev_pcl_paper_size(pdev) == PAPER_SIZE_A4 ? m_a4 :
- m_letter);
- move_origin = false;
-
- if ( m != 0 )
- gx_device_set_margins(pdev, m, move_origin);
-
- return gdev_prn_open(pdev);
-}
-
-/* gdi_close is only here to eject odd numbered pages in duplex mode. */
-private int
-gdi_close(gx_device *pdev)
-{ if ( ppdev->Duplex_set >= 0 && ppdev->Duplex )
- { gdev_prn_open_printer(pdev, 1);
- fputs("\033&l0H", ppdev->file) ;
- }
- return gdev_prn_close(pdev);
-}
-
-#undef ppdev
-
-/* ------ Internal routines ------ */
-
-/* Samsung SmartGDI series compresses, and it needs a special sequence to */
-/* allow it to specify coordinates at 600 dpi. */
-/* It too needs its coordinate system translated slightly. */
-
-private int
-gdi_print_page(gx_device_printer *pdev, FILE *prn_stream)
-{
- int band_width_bytes;
- int band_height;
- int code=0, i, j, y, num_rows=0, band_num=0;
- int dots_per_inch = (int)pdev->y_pixels_per_inch;
- int raster = gx_device_raster((gx_device *)pdev, true);
- int real_line_width;
- long ul_band_size, ul_comp_size, ul_tiff_size, ul_min_size;
- byte *ibp=NULL, *obp=NULL, *tmp=NULL;
- byte paper_type=0, compression_type;
-
- switch (gdev_pcl_paper_size((gx_device*)pdev))
- {
- case PAPER_SIZE_A4 : paper_type = 0;
- break;
- case PAPER_SIZE_LETTER : paper_type = 1;
- break;
- case PAPER_SIZE_LEGAL : paper_type = 1;
- break;
- default:
- paper_type = 1;
- break;
- }
- if (dots_per_inch == 600) { /* 600dpi */
- band_width_bytes = (GDI_BAND_WIDTH[paper_type]+31)/32*4;
- band_height = GDI_BAND_HEIGHT;
- } else { /* 300dpi */
- band_width_bytes = (GDI_BAND_WIDTH[paper_type]+31)/32*4/2;
- band_height = GDI_BAND_HEIGHT*2;
- }
-
- ul_band_size = band_width_bytes * band_height;
- ibp = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), ul_band_size, 1, "gdi_print_page");
- obp = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), ul_band_size*13/10, 1, "gdi_print_page");
- tmp = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), raster, 1, "gdi_print_page");
-
- if (!ibp) return_error(gs_error_VMerror);
- if (!obp) return_error(gs_error_VMerror);
- if (!tmp) return_error(gs_error_VMerror);
-
- if (ibp ==0 || obp == 0) return_error(gs_error_VMerror);
-
- /* Header Output */
- prn_stream = WritePJLHeaderData(pdev, prn_stream);
- num_rows = dev_print_scan_lines(pdev);
- band_num = (num_rows + band_height -1)/band_height;
-
- if (raster > band_width_bytes)
- real_line_width = band_width_bytes;
- else
- real_line_width = raster;
-
- /* Real Data Output */
- y = 0;
- for (i=0; i< band_num; i++) {
- memset(ibp, 0x00, ul_band_size);
- memset(obp, 0x00, ul_band_size*13/10);
- for (j=0; j<band_height; j++) {
- memset(tmp, 0x00, raster);
- /*code = gdev_prn_copy_scan_lines(pdev, i*band_height+j, */
- if (y == num_rows) break;
- code = gdev_prn_copy_scan_lines(pdev, y++,
- (byte*)tmp, raster);
- if (code < 0) break;
- memcpy(ibp+j*band_width_bytes, tmp, real_line_width);
- }
-
- if ( i>= GDI_MAX_BAND) continue;
-
- /* Write Band Data
- Because of Scanline compression, extract Scanline compression mode */
- /*ul_tiff_size = FrameTiffComp(obp, ibp, band_height, band_width_bytes, GDI_PRE_COMP);*/
- /*ul_scan_size = (unsigned long)bmp2run(obp, ibp, band_height, band_width_bytes, GDI_PRE_COMP);*/
- /*ul_min_size = (ul_scan_size > ul_tiff_size) ? ul_tiff_size : ul_scan_size;*/
- ul_min_size = ul_tiff_size;
- compression_type = GDI_COMP_MODITIFF;
- /*compression_type = (ul_scan_size > ul_tiff_size) ? GDI_COMP_MODITIFF : GDI_COMP_SCANLINE;*/
- switch (compression_type) {
- case GDI_COMP_MODITIFF:
-#define FUDGE_BIG_BANDS
-#ifndef FUDGE_BIG_BANDS
- ul_comp_size = FrameTiffComp(obp, ibp, band_height, band_width_bytes, GDI_REAL_COMP);
-#else
- {
- /* Very ugly. The printer will hose if the compressed
- band size is over 65536, so we "fudge" the data in
- this case repeatedly until we get what we want.
-
- The fudge algorithm is simple, this is kinda-sorta
- RLE, so we just round groups of bits in groups of
- 2, then 3, then 4, etc until the thing works. */
-#define MAXBAND 0xffff
-#define ASSERT(x)
- int fudge=0;
- byte *use_band=ibp;
- do {
- ul_comp_size = FrameTiffComp(obp, use_band,
- band_height, band_width_bytes,
- GDI_REAL_COMP);
- if (ul_comp_size > MAXBAND-8) {
- int f, g, h;
- if (!fudge) {
- ASSERT(use_band == ibp);
- use_band = (byte*)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), ul_band_size, 1, "gdi_print_page/fudge");
- fudge=1;
- }
- memcpy(use_band, ibp, ul_band_size);
- fudge++;
- ASSERT(fudge>=2);
- {
-#define FUDGE2(x) ( (((((x)>>6)&0x3)?3:0)<<6) \
- | (((((x)>>4)&0x3)?3:0)<<4) \
- | (((((x)>>2)&0x3)?3:0)<<2) \
- | (((((x)>>0)&0x3)?3:0)) )
-#define FUDGE4(x) ( (((((x)>>4)&0xf)?0xf:0)<<4) \
- | (((((x)>>0)&0xf)?0xf:0)) )
-#define FUDGE8(x) ( (((((x)>>0)&0xff)?0xf:0)) )
-#define FUDGE(fudge, x) ( (fudge == 2 ? FUDGE2(x) \
- : fudge == 3 ? FUDGE4(x) \
- : fudge == 4 ? FUDGE8(x) \
- : 0 ) )
-
- for(f=0;f<ul_band_size; f++) {
- use_band[f] = FUDGE(fudge, ibp[f]);
- }
- }
- }
- } while (ul_comp_size > MAXBAND-8);
- oh_well:
- if (fudge > 1) {
- ASSERT(use_band != ibp);
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), use_band, ul_band_size, 1, "gdi_print_page/fudge");
- /*fprintf(stderr, "smartgdi: band %d fudge factor is %d\n", i, fudge);*/
- }
- }
-#endif
- break;
- case GDI_COMP_SCANLINE:
- ul_comp_size = bmp2run(obp, ibp, band_height, band_width_bytes, GDI_REAL_COMP);
- break;
- default:
- ul_comp_size = FrameTiffComp(obp, ibp, band_height, band_width_bytes, GDI_REAL_COMP);
- compression_type = GDI_COMP_MODITIFF;
- break;
- }
-
- prn_stream = WriteBandHeader(prn_stream, i, compression_type, (band_width_bytes * 8),
- band_height, ul_comp_size);
- /*fprintf(prn_stream, "[%d] band, size : %d\n", i, ul_tiff_size);*/
- fwrite(obp, ul_comp_size, 1, prn_stream);
- }
-
- /* Trailer Output */
- WriteTrailerData(prn_stream);
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), ibp, ul_band_size, 1, "gdi_line_buffer");
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), obp, ul_band_size*13/10, 1, "gdi_line_buffer");
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), tmp, raster, 1, "gdi_line_buffer");
- return code;
-}
-
-FILE *WritePJLHeaderData(gx_device_printer *pdev, FILE *fp)
-{
- unsigned long ulSize;
- unsigned char buffer[300];
- int dots_per_inch = (int)pdev->y_pixels_per_inch;
-
- strcpy(buffer, "\033%-12345X");
-
- /* Paper Type*/
- strcat(buffer, "@PJL SET PAPERTYPE = NORMAL ON\015\012");
- /*Density*/
- strcat(buffer, "@PJL SET DENSITY = 1\015\012");
- /* Toner Save*/
- strcat(buffer, "@PJL SET TONERSAVE = OFF\015\012");
- /* Enter Language SMART*/
- strcat(buffer, "@PJL ENTER LANGUAGE = SMART\015\012");
- /* JobStart*/
- strcat(buffer, "$PJL JOB START\015\012");
-
- /* Resolution*/
- if (dots_per_inch == 600)
- strcat(buffer, "$PJL RESOLUTION = 600\015\012");
- else
- strcat(buffer, "$PJL RESOLUTION = 300\015\012");
-
- /* Copies*/
- strcat(buffer, "$PJL COPIES = 1\015\012");
- /* Paper Size*/
- switch (gdev_pcl_paper_size((gx_device*)pdev))
- {
- case PAPER_SIZE_A4:
- strcat(buffer, "$PJL PAGE A4 AUTO\015\012");
- break;
- case PAPER_SIZE_LETTER:
- strcat(buffer, "$PJL PAGE LETTER AUTO\015\012");
- break;
- case PAPER_SIZE_LEGAL:
- strcat(buffer, "$PJL PAGE LEGAL AUTO\015\012");
- break;
- default:
- strcat(buffer, "$PJL PAGE LETTER AUTO\015\012");
- break;
- }
- /* bitmap start*/
- strcat(buffer, "$PJL BITMAP START\015\012");
- /* write buffer to file.*/
- ulSize = strlen(buffer);
- fwrite(buffer, 1, ulSize, fp );
- return(fp);
-} /* WritePJLHeaderData() */
-
-
-FILE *WriteBandHeader
-(
-FILE *fp,
-unsigned int usBandNo,
-unsigned char ubCompMode,
-unsigned int usBandWidth,
-unsigned int usBandHeight,
-unsigned long ulBandSize
-)
-{
- unsigned char ubLeft=0;
- unsigned int i = 0;
- unsigned char buf[50];
-
- memset(buf, 0x00, 50);
-
- ulBandSize += 8;
-
- /* bandsize*/
- buf[i++] = (unsigned char)((ulBandSize >> 24) & 0xff);
- buf[i++] = (unsigned char)((ulBandSize >> 16) & 0xff);
- buf[i++] = (unsigned char)((ulBandSize >> 8) & 0xff);
- buf[i++] = (unsigned char)(ulBandSize & 0xff);
-
- /* id */
- buf[i++] = (unsigned char)((usBandNo >> 8) & 0xff);
- buf[i++] = (unsigned char)(usBandNo & 0xff);
-
- /* compress mode */
- buf[i++] = (unsigned char)(ubCompMode & 0xff);
-
- /* ubLeft */
- buf[i++] = (unsigned char)(ubLeft & 0xff);
-
- /* height*/
- buf[i++] = (unsigned char)((usBandHeight >> 8) & 0xff);
- buf[i++] = (unsigned char)(usBandHeight & 0xff);
-
- /* width */
- buf[i++] = (unsigned char)((usBandWidth >> 8) & 0xff);
- buf[i++] = (unsigned char)(usBandWidth & 0xff);
-
- fwrite(buf, 1, i, fp);
- return(fp);
-} /* end of WriteBandHeader()*/
-
-FILE *WriteTrailerData(FILE *fp)
-{
- unsigned long ulSize;
- unsigned long buffer[200];
-
- memset((char*)buffer, 0x00, 200);
- strcpy((char*)buffer, "$PJL PRINT 4\015\012");
- strcat((char*)buffer, "$PJL EOJ\015\012");
- strcat((char*)buffer, "$PJL SYNC\015\012");
- strcat((char*)buffer, "$PJL RELEASE 0 2047\015\012");
- strcat((char*)buffer, "$PJL GARBAGE\015\012");
- strcat((char*)buffer, "\033%-12345X\015\012");
-
- ulSize = strlen((char*)buffer);
- fwrite(buffer, 1, ulSize, fp);
-
- return(fp);
-} /* WriteTrailerData()*/
-
-unsigned long FrameTiffComp(unsigned char *pubDest,
- unsigned char *pubSrc,
- unsigned int usTotalLines,
- unsigned int usBytesPerLine,
- unsigned char ubMode)
-{
- unsigned char *TgtPtr, *SrcPtr;
- unsigned int usLineSize;
- unsigned long ulret;
- unsigned int i;
-
- SrcPtr = pubSrc;
- TgtPtr = pubDest;
- ulret = 0;
-
- for (i = 0; i < usTotalLines; i++)
- {
- if (!(ubMode & 0x02))
- {
- usLineSize = FrameTiff_Comp(SrcPtr, TgtPtr, usBytesPerLine);
- }
- else
- {
- if(i == 0x253)
- {
- i = i;
- }
- usLineSize = PreTiffComp(SrcPtr, usBytesPerLine);
- }
- SrcPtr += usBytesPerLine;
- TgtPtr += usLineSize;
- ulret += usLineSize;
- }
-
- if (!(ubMode & 0x02))
- {
- switch (ulret%4)
- {
- case 1:
- *TgtPtr++ = 0x00;
- ulret++;
- case 2:
- *TgtPtr++ = 0x00;
- ulret++;
- case 3:
- *TgtPtr++ = 0x00;
- ulret++;
- default:
- break;
- }
- }
- else
- {
- switch (ulret%4)
- {
- case 1:
- ulret++;
- case 2:
- ulret++;
- case 3:
- ulret++;
- default:
- break;
- }
- }
- return(ulret);
-} /* FrameTiffComp()*/
-
-unsigned int FrameTiff_Comp(unsigned char *lpSrcBuf, unsigned char *lpTgtBuf, unsigned int nSrcBytes)
-{
- unsigned int usret;
- unsigned int usCount, usEndCnt;
- unsigned int usControl;
- unsigned int usCnt;
- unsigned char ubFirst, ubSecond, ubMisCnt;
- unsigned char *pubDst, *pubSrc, *pubOrg;
-
- pubDst = lpTgtBuf;
- pubSrc = lpSrcBuf;
- usCount = nSrcBytes;
- while(1)
- {
- if(!usCount)
- {
- break; /* exit while(1) loop */
- }
- else if (usCount == 1)
- {
- *pubDst++ = 0x00;
- *pubDst++ = *pubSrc++;
- break;
- }
-
- pubOrg = pubSrc;
- ubFirst = *pubSrc++;
- ubSecond = *pubSrc++;
-
- if(ubFirst == ubSecond) /* case of data match */
- {
- usEndCnt = usCount;
- if (usCount > 16384)
- {
- usEndCnt = 16384;
- }
- usEndCnt = usCount - 2;
- while (usEndCnt--)
- {
- if (ubFirst != *pubSrc++)
- {
- pubSrc--;
- break;
- }
- } /* of while */
-
- /* Save compressed data */
- usCnt = (unsigned int) (pubSrc - pubOrg);
- usCount -= usCnt;
- usCnt -=2;
- if (usCnt >= 64)
- {
- /* save control code code 1100 0000 0000 0000 | usCnt */
- usCnt = (~usCnt & 0x3fff) | 0xc000;
- *pubDst++ = (unsigned char)((usCnt & 0xff00) >> 8);
- *pubDst++ = (unsigned char)(usCnt & 0x00ff);
- *pubDst++ = ubFirst;
- }
- else
- {
- /* save control code 0100 0000 | (unsigned char)(usCnt) */
- usCnt = (~usCnt & 0x7f);
- *pubDst++ = (unsigned char)usCnt;
- *pubDst++ = ubFirst;
- }
- } /* of if (ubFirst == ubSecond) */
-
- else /* case of data mismatch */
- {
- ubMisCnt = 0;
- if (usCount > 2)
- {
- usEndCnt = usCount;
- if (usCount > 16384)
- {
- usEndCnt = 16384;
- }
- usEndCnt = usCount - 2;
- /* usEndCnt = usCount - 2; original*/
- /* 19990824 by LSM : for end file while (usEndCnt--)*/
- while (usEndCnt--)
- {
- /* read next data */
- ubFirst = ubSecond;
- ubSecond = *pubSrc++; /* read 3rd Data*/
- if (ubFirst == ubSecond)
- {
- if (usEndCnt <= 1)
- {
- ubMisCnt = 2;
- break;
- }
- else
- {
- ubSecond = *pubSrc++; /* read 4th Data*/
- usEndCnt--;
- if (ubFirst == ubSecond)
- {
- ubMisCnt = 3;
- break;
- }
- }
- }
- } /* of while */
- } /* of if (usCount > 2) */
- /* save data */
- usControl = (unsigned int) (pubSrc - pubOrg);
- usControl -= (unsigned int) ubMisCnt;
- if (usControl > usCount)
- {
- usCount = usControl;
- }
- usCount -= usControl;
- usCnt = usControl - 1;
- if ( usCnt >= 64)
- {
- /* save control code 1000 0000 0000 0000 | usCnt */
- usCnt = ((usCnt & 0xbfff) | 0x8000);
- *pubDst++ = (unsigned char)((usCnt & 0xff00) >> 8);
- *pubDst++ = (unsigned char)(usCnt & 0x00ff);
- }
- else
- {
- /* save control code 0000 0000 | (BYTE)usCnt */
- /* and invert it */
- *pubDst++ = (unsigned char)(usCnt & 0x003f);
- }
- pubSrc = pubOrg;
- while (usControl--)
- {
- *pubDst++ = *pubSrc++;
- } /* of while */
- } /* of else */
- } /* of while(1) */
-
- usret = (unsigned int) (pubDst - lpTgtBuf);
- return (usret);
-}
-
-unsigned int PreTiffComp(unsigned char *lpSrcBuf, unsigned int nSrcBytes)
-{
- unsigned int usret =0;
- unsigned int usCount, usEndCnt;
- unsigned int usControl;
- unsigned int usCnt;
- unsigned char ubFirst, ubSecond, ubMisCnt;
- unsigned char *pubSrc, *pubOrg;
-
- pubSrc = lpSrcBuf;
- usCount = nSrcBytes;
- while(1)
- {
- if(!usCount)
- {
- break; /* exit while(1) loop */
- }
- else if (usCount == 1)
- {
- usret +=2;
- pubSrc++;
- break;
- }
-
- pubOrg = pubSrc;
- ubFirst = *pubSrc++;
- ubSecond = *pubSrc++;
-
- if(ubFirst == ubSecond) /* case of data match */
- {
- usEndCnt = usCount;
- if (usCount > 16384)
- {
- usEndCnt = 16384;
- }
- usEndCnt = usCount - 2;
- while (usEndCnt--)
- {
- if (ubFirst != *pubSrc++)
- {
- pubSrc--;
- break;
- }
- } /* of while */
-
- /* Save compressed data */
- usCnt = (unsigned int) (pubSrc - pubOrg);
- usCount -= usCnt;
- usCnt -=2;
- if (usCnt >= 64)
- {
- /* save control code code 1100 0000 0000 0000 | usCnt */
- usret +=3;
- }
- else
- {
- /* save control code 0100 0000 | (unsigned char)(usCnt) */
- usret += 2;
- }
- } /* of if (ubFirst == ubSecond) */
-
- else /* case of data mismatch */
- {
- ubMisCnt = 0;
- if (usCount > 2)
- {
- usEndCnt = usCount;
- if (usCount > 16384)
- {
- usEndCnt = 16384;
- }
- /* usEndCnt = usCount - 2;*/
- usEndCnt = usCount - 2;
- /* 19990824 by LSM : for Last file while (usEndCnt--)*/
- while (usEndCnt--)
- {
- /* read next data */
- ubFirst = ubSecond;
- ubSecond = *pubSrc++; /* read 3rd Data*/
- if (ubFirst == ubSecond)
- {
- if (usEndCnt <= 1)
- {
- ubMisCnt = 2;
- break;
- }
- else
- {
- ubSecond = *pubSrc++; /* read 4th Data*/
- usEndCnt--; /* 19990824 by LSM*/
- if (ubFirst == ubSecond)
- {
- ubMisCnt = 3;
- break;
- }
- }
- }
- } /* of while */
- } /* of if (usCount > 2) */
- /* save data */
- usControl = (unsigned int) (pubSrc - pubOrg);
- usControl -= ubMisCnt;
- /* 19990824 by LSM : for fixing GPF on Photoshop*/
- if (usControl > usCount)
- {
- usControl = usCount;
- }
- usCount -= usControl;
- usCnt = usControl - 1;
- if ( usCnt >= 64)
- {
- /* save control code 1000 0000 0000 0000 | usCnt */
- usret += 2;
- }
- else
- {
- /* save control code 0000 0000 | (BYTE)usCnt */
- /* and invert it */
- usret++;
- }
- pubSrc = pubOrg;
- while (usControl--)
- {
- usret++;
- pubSrc++;
- } /* of while */
- } /* of else */
- } /* of while(1) */
- return (usret);
-}
-
-typedef struct
-{
- unsigned char ubDx;
- unsigned char ubRl;
- unsigned char ubLastBit;
-} sc_tbl;
-
-static sc_tbl gdi_ScanTbl[256] = {
-{ 8, 0, 0 }, { 7, 1, 1 }, { 6, 1, 0 }, { 6, 2, 1 }, /* 0x00*/
-{ 5, 1, 0 }, { 0, 0, 1 }, { 5, 2, 0 }, { 5, 3, 1 },
-{ 4, 1, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 4, 2, 0 }, { 0, 0, 1 }, { 4, 3, 0 }, { 4, 4, 1 },
-{ 3, 1, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, /* 0x10*/
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 3, 2, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 3, 3, 0 }, { 0, 0, 1 }, { 3, 4, 0 }, { 3, 5, 1 },
-{ 2, 1, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, /* 0x20*/
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 2, 2, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, /* 0x30*/
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 2, 3, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 2, 4, 0 }, { 0, 0, 1 }, { 2, 5, 0 }, { 2, 6, 1 },
-{ 1, 1, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, /* 0x40*/
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, /* 0x50*/
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 1, 2, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, /* 0x60*/
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 1, 3, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, /* 0x70*/
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 1, 4, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 1, 5, 0 }, { 0, 0, 1 }, { 1, 6, 0 }, { 1, 7, 1 },
-{ 0, 1, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, /* 0x80*/
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, /* 0x90*/
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, /* 0xa0*/
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, /* 0xb0*/
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 2, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, /* 0xc0*/
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, /* 0xd0*/
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 3, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, /* 0xe0*/
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 4, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, /* 0xf0*/
-{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 5, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 },
-{ 0, 6, 0 }, { 0, 0, 1 }, { 0, 7, 0 }, { 0, 8, 1 },
-};
-
-static sc_tbl gdi_ScanTbl4[16] = {
-{ 4, 0, 0 }, { 3, 1, 1 }, { 2, 1, 0 }, { 2, 2, 1 }, /* 0x00*/
-{ 1, 1, 0 }, { 0, 0, 1 }, { 1, 2, 0 }, { 1, 3, 1 }, /* 0x04*/
-{ 0, 1, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, /* 0x08*/
-{ 0, 2, 0 }, { 0, 0, 1 }, { 0, 3, 0 }, { 0, 4, 1 } /* 0x0c*/
-};
-
-long SaveScanData( unsigned char *, unsigned short, unsigned short, unsigned short, unsigned short, unsigned short );
-long UpdateScanSize( unsigned char *, unsigned short, unsigned short, unsigned short, unsigned short, unsigned short );
-typedef long (*funcptr)( unsigned char *, unsigned short, unsigned short, unsigned short, unsigned short, unsigned short );
-
-funcptr UpdateScanLine[2] = { SaveScanData, UpdateScanSize };
-
-long Save6Bytes(unsigned char *out_buf, unsigned short usDy, unsigned short usRl, short sDx, unsigned short usWarp)
-{
- unsigned long ultmp_dat;
- long lWarp, lDis;
- unsigned short ustmp_dat;
-
- lWarp = (long)(usWarp << 3);
- lDis = ((long)usDy * lWarp) + (long)sDx;
-
- /* 1st, 2nd, 3rd & 4th byte*/
- ultmp_dat = 0xc0000000ul;
- if (lDis < 0)
- {
- ultmp_dat |= 0x20000000ul;
- }
- ultmp_dat |= (lDis & 0x1ffffffful);
- *out_buf++ = (unsigned char)((ultmp_dat & 0xff000000ul) >> 24);
- *out_buf++ = (unsigned char)((ultmp_dat & 0xff0000ul) >> 16);
- *out_buf++ = (unsigned char)((ultmp_dat & 0xff00ul) >> 8);
- *out_buf++ = (unsigned char)(ultmp_dat & 0xfful);
-
- /* 5th & 6th byte*/
- ustmp_dat = 0xc000;
- ustmp_dat |= (usRl & 0x3fff);
- *out_buf++ = (unsigned char)((ustmp_dat & 0xff00) >> 8);
- *out_buf++ = (unsigned char)(ustmp_dat & 0xff);
-
- return(6);
-} /* Save6Bytes()*/
-
-long Save4Bytes(unsigned char *out_buf, unsigned short usDy, unsigned short usRl, short sDx)
-{
- unsigned short ustmp_dat;
-
- /* 1st & 2nd byte*/
- ustmp_dat = 0x8000;
- if (sDx < 0)
- {
- ustmp_dat |= 0x2000;
- }
- ustmp_dat |= (sDx & 0x1fff);
- *out_buf++ = (unsigned char)((ustmp_dat & 0xff00) >> 8);
- *out_buf++ = (unsigned char)(ustmp_dat & 0xff);
-
- /* 3rd & 4th byte*/
- ustmp_dat = 0x8000;
- ustmp_dat |= ((usDy & 0x03) << 12);
- ustmp_dat |= (usRl & 0xfff);
- *out_buf++ = (unsigned char)((ustmp_dat & 0xff00) >> 8);
- *out_buf++ = (unsigned char)(ustmp_dat & 0xff);
-
- return(4);
-} /* end of Save4Bytes()*/
-
-long Save2Bytes(unsigned char *out_buf, unsigned short usDy, unsigned short usRl, short sDx)
-{
- unsigned char ubtmp_dat;
-
- /* 1st byte*/
- ubtmp_dat = 0x00;
- if (usDy == 1)
- {
- ubtmp_dat |= 0x40;
- }
- ubtmp_dat |= (usRl & 0x3f);
- *out_buf++ = ubtmp_dat;
-
- /* 2nd byte*/
- if (sDx < 0)
- {
- ubtmp_dat = 0x80;
- }
- else
- {
- ubtmp_dat = 0x00;
- }
- ubtmp_dat |= ((unsigned char)sDx & 0x7f);
- *out_buf++ = ubtmp_dat;
- return(2);
-} /* end of Save2Bytes()*/
-
-long SaveScanData (unsigned char *out_buf,
- unsigned short us1Cnt,
- unsigned short usDy,
- unsigned short usPosX10,
- unsigned short usPosX01,
- unsigned short usWarp)
-{
- short sDisX;
- long lRet;
-
- sDisX = (int)usPosX01 - (int)usPosX10;
-
- /* 48 bit*/
- if ( (usDy > 3) || (us1Cnt > 4095) )
- {
- Save6Bytes(out_buf, usDy, us1Cnt, sDisX, usWarp);
- lRet = 6;
- }
- /* 32 bit*/
- else if ( (usDy > 1) || (us1Cnt > 63) || (sDisX > 127) || (sDisX < -128) )
- {
- Save4Bytes(out_buf, usDy, us1Cnt, sDisX);
- lRet = 4;
- }
- /* 16 bit*/
- else
- {
- Save2Bytes(out_buf, usDy, us1Cnt, sDisX);
- lRet = 2;
- }
- return(lRet);
-} /* end of SaveScanData()*/
-
-
-long UpdateScanSize (unsigned char *out_buf,
- unsigned short us1Cnt,
- unsigned short usDy,
- unsigned short usPosX10,
- unsigned short usPosX01,
- unsigned short usWarp)
-{
- short sDisX;
- long lRet;
-
- sDisX = usPosX01 - usPosX10;
-
- /* 48 bit*/
- if ( (usDy > 3) || (us1Cnt > 4095) )
- {
- lRet = 6;
- }
- /* 32 bit*/
- else if ( (usDy > 1) || (us1Cnt > 63) || (sDisX > 127) || (sDisX < -128) )
- {
- lRet = 4;
- }
- /* 16 bit*/
- else
- {
- lRet = 2;
- }
- return(lRet);
-} /* end of UpdateScanSize() by bglee 19981224*/
-
-long GetSimpleScan(unsigned char *out_buf,
- unsigned char ubSizeMode,
- unsigned short *us1Count,
- unsigned short *usDy,
- unsigned short *usPosX10,
- unsigned short *usPosX01,
- unsigned short usBytePos,
- unsigned char ubCrtByte,
- unsigned char ubSize,
- unsigned char ubPreBit,
- unsigned short usWidth)
-{
- long lScanSize;
- unsigned char ubDx, ubRl, ubLastBit;
-
- lScanSize = 0;
- if (ubSize == 8)
- {
- ubDx = gdi_ScanTbl[ubCrtByte].ubDx;
- ubRl = gdi_ScanTbl[ubCrtByte].ubRl;
- ubLastBit = gdi_ScanTbl[ubCrtByte].ubLastBit;
- }
- else
- {
- ubCrtByte &= 0x0f;
- ubDx = gdi_ScanTbl4[ubCrtByte].ubDx;
- ubRl = gdi_ScanTbl4[ubCrtByte].ubRl;
- ubLastBit = gdi_ScanTbl4[ubCrtByte].ubLastBit;
- }
-
-
- /* 1 X 1 X*/
- if (ubPreBit)
- {
- /* 1 0 1 X*/
- if (ubDx)
- {
- lScanSize += (*UpdateScanLine[ubSizeMode])(out_buf, *us1Count, *usDy, *usPosX10, *usPosX01, usWidth);
- *usPosX10 = usBytePos - *us1Count;
- *usPosX01 = usBytePos + ubDx;
- *us1Count = ubRl;
- *usDy = 0;
- /* 1 0 1 0*/
- if (!ubLastBit)
- {
- /* 19990330 by bglee*/
- out_buf = out_buf + lScanSize;
-
- lScanSize += (*UpdateScanLine[ubSizeMode])(out_buf, *us1Count, *usDy, *usPosX10, *usPosX01, usWidth);
- *usPosX10 = *usPosX01 ;
- *us1Count = 0;
- }
- /* 1 0 1 1*/
- }
- /* 1 1 1 X*/
- else
- {
- *us1Count += ubRl;
- /* 1 1 1 0*/
- if (!ubLastBit)
- {
- lScanSize += (*UpdateScanLine[ubSizeMode])(out_buf, *us1Count, *usDy, *usPosX10, *usPosX01, usWidth);
- *usPosX10 = usBytePos + ubRl - *us1Count;
- *us1Count = 0;
- *usDy = 0;
- }
- /* 1 1 1 1*/
- }
- }
- /* 0 X 1 X*/
- else
- {
- /* 0 X 1 X*/
- *usPosX01 = usBytePos + ubDx;
- *us1Count += ubRl;
- /* 0 X 1 0*/
- if (!ubLastBit)
- {
- lScanSize += (*UpdateScanLine[ubSizeMode])(out_buf, *us1Count, *usDy, *usPosX10, *usPosX01, usWidth);
- *usPosX10 = *usPosX01 + ubRl - *us1Count;
- *us1Count = 0;
- *usDy = 0;
- }
- /* 0 X 1 1*/
- }
-
- return(lScanSize);
-} /* end of GetSimpleScan() */
-
-
-long scan_map (unsigned char *in_buf,
- unsigned char *out_buf,
- unsigned short usWidth,
- unsigned short usHeight,
- unsigned char ubMode)
-{
- unsigned int i, j, k;
- unsigned char ubPreBit, ubCrtByte;/*, ubLastBit;*/
- long lScanSize, lTmp;
- long lCrtSize;
- unsigned short us1Count;
- unsigned short usPosX01, usPosX10;
- unsigned short usDy, usBytePos;
- unsigned char ubRevMode, ubSizeMode;
- unsigned char ubTemp;
-
- usDy = 0;
- usPosX01 = usPosX10 = 0;
- lScanSize = 0;
- ubRevMode = ubMode & 0x01;
- ubSizeMode = (ubMode & 0x02) >> 1;
- for (i = 0; i < usHeight; i++)
- {
- ubPreBit = 0;
- us1Count = 0;
- for (j = 0; j < usWidth; j++)
- {
- ubCrtByte = *in_buf++;
- if (ubRevMode)
- {
- ubCrtByte = ~ubCrtByte;
- }
-
- switch (ubCrtByte)
- {
- case 0x00:
- /* 1 0 */
- if (ubPreBit)
- {
- lTmp = (*UpdateScanLine[ubSizeMode])(out_buf, us1Count, usDy, usPosX10, usPosX01, usWidth);
- out_buf = out_buf + lTmp;
- lScanSize += lTmp;
- usPosX10 = (j << 3) - us1Count; /*by pkb*/
- us1Count = 0;
- usDy = 0;
- }
- /* 0 0*/
- break;
-
- case 0xff:
- /* 1 1*/
- if (ubPreBit)
- {
- us1Count += 8;
- }
- /* 0 1*/
- else
- {
- us1Count = 8;
- usPosX01 = (j << 3);
- }
- break;
-
- default:
- /* X X 1 X*/
- if (gdi_ScanTbl[ubCrtByte].ubRl)
- {
- usBytePos = (j << 3);
- lTmp = GetSimpleScan(out_buf, ubSizeMode, &us1Count, &usDy, &usPosX10, &usPosX01, usBytePos, ubCrtByte, 8, ubPreBit, usWidth);
- out_buf = out_buf + lTmp;
- lScanSize += lTmp;
- }
- /* complex pattern*/
- else
- {
- for (k = 0; k < 2; k++)
- { /*we calculate 4bit*/
- ubTemp = (ubCrtByte >> (4 - (k * 4)) ) & 0x0f;
- usBytePos = (j << 3) + (k << 2);
- switch (ubTemp)
- {
- case 0x00:
- /* 1 0*/
- if (ubPreBit)
- {
- lTmp = (*UpdateScanLine[ubSizeMode])(out_buf, us1Count, usDy, usPosX10, usPosX01, usWidth);
- out_buf = out_buf + lTmp;
- lScanSize += lTmp;
- usPosX10 = usBytePos - us1Count;
- us1Count = 0;
- usDy = 0;
- }
- /* 0 0*/
- break;
-
- case 0x0f:
- /* 1 1*/
- if (ubPreBit)
- {
- us1Count += 4;
- }
- /* 0 1*/
- else
- {
- us1Count = 4;
- usPosX01 = (j << 3) + (k << 2);
- }
- break;
-
- case 0x05:
- /* 1 0101*/
- if (ubPreBit)
- {
- lTmp = (*UpdateScanLine[ubSizeMode])(out_buf, us1Count, usDy, usPosX10, usPosX01, usWidth);
- out_buf = out_buf + lTmp;
- lScanSize += lTmp;
-
- usPosX10 = usBytePos - us1Count;
- usDy = 0;
- }
- /* 0 0101*/
- usPosX01 = usBytePos + 1;
- lTmp = (*UpdateScanLine[ubSizeMode])(out_buf, 1, usDy, usPosX10, usPosX01, usWidth);
- out_buf = out_buf + lTmp;
- lScanSize += lTmp;
-
- /* next*/
- usPosX10 = 0;
- usPosX01 = 2;
- usDy = 0;
- us1Count = 1;
- break;
-
- case 0x09:
- /* 1 1001*/
- if (ubPreBit)
- {
- us1Count++;
- }
- /* 0 1001*/
- else
- {
- usPosX01 = usBytePos;
- us1Count = 1;
- }
- lTmp = (*UpdateScanLine[ubSizeMode])(out_buf, us1Count, usDy, usPosX10, usPosX01, usWidth);
- out_buf = out_buf + lTmp;
- lScanSize += lTmp;
-
- /* next*/
- if (ubPreBit)
- {
- usPosX10 = usBytePos - us1Count + 1;
- usPosX01 = usBytePos + 3;
- }
- else
- {
- usPosX10 = 0;
- usPosX01 = 3;
- }
- usDy = 0;
- us1Count = 1;
- break;
-
- case 0x0a:
- /* 1 1010*/
- if (ubPreBit)
- {
- us1Count++;
- }
- /* 0 1010*/
- else
- {
- us1Count = 1;
- usPosX01 = usBytePos;
- }
- lTmp = (*UpdateScanLine[ubSizeMode])(out_buf, us1Count, usDy, usPosX10, usPosX01, usWidth);
- out_buf = out_buf + lTmp;
- lScanSize += lTmp;
-
- /* next*/
- usPosX10 = usBytePos - us1Count + 1;
- usPosX01 = usBytePos + 2;
- lTmp = (*UpdateScanLine[ubSizeMode])(out_buf, 1, 0, usPosX10, usPosX01, usWidth);
- out_buf = out_buf + lTmp;
- lScanSize += lTmp;
- /* next*/
- usPosX10 = usBytePos + 2;
- usDy = 0;
- us1Count = 0;
- break;
-
- case 0x0b:
- /* 1 1011*/
- if (ubPreBit)
- {
- us1Count++;
- }
- /* 0 1011*/
- else
- {
- us1Count = 1;
- usPosX01 = usBytePos;
- }
- lTmp = (*UpdateScanLine[ubSizeMode])(out_buf, us1Count, usDy, usPosX10, usPosX01, usWidth);
- out_buf = out_buf + lTmp;
- lScanSize += lTmp;
-
- /* next*/
- if (ubPreBit)
- {
- usPosX10 = usBytePos - us1Count + 1;
- usPosX01 = usBytePos + 2;
- }
- else
- {
- usPosX10 = 0;
- usPosX01 = 2;
- }
-
- usDy = 0;
- us1Count = 2;
- break;
-
- case 0x0d:
- /* 1 1101*/
- if (ubPreBit)
- {
- us1Count += 2;
- }
- /* 0 1101*/
- else
- {
- us1Count = 2;
- usPosX01 = usBytePos;
- }
- lTmp = (*UpdateScanLine[ubSizeMode])(out_buf, us1Count, usDy, usPosX10, usPosX01, usWidth);
- out_buf = out_buf + lTmp;
- lScanSize += lTmp;
-
- /* next*/
- if (ubPreBit)
- {
- usPosX10 = usBytePos - us1Count + 2;
- usPosX01 = usBytePos + 3;
- }
- else
- {
- usPosX10 = 0;
- usPosX01 = 3;
- }
- usDy = 0;
- us1Count = 1;
- break;
-
- default:
- /* X X 1 X*/
- lTmp = GetSimpleScan(out_buf, ubSizeMode, &us1Count, &usDy, &usPosX10, &usPosX01, usBytePos, ubTemp, 4, ubPreBit, usWidth);
- out_buf = out_buf + lTmp;
- lScanSize += lTmp;
- break;
- } /* end of switch()*/
- ubPreBit = ubTemp & 0x01;
- } /* end of k-loop*/
- }
- break;
- } /* end of switch()*/
-
- ubPreBit = ubCrtByte & 0x01;
- } /*for usWidth */
-
- if (us1Count)
- {
- lTmp = (*UpdateScanLine[ubSizeMode])(out_buf, us1Count, usDy, usPosX10, usPosX01, usWidth);
- out_buf = out_buf + lTmp;
- lScanSize += lTmp;
- usPosX10 = (j << 3) - us1Count;
-
- us1Count = 0;
- usDy = 0;
- usPosX01 = 0;
- }
- usDy++;
-
- /* check size over*/
- if ( (i % 5) == 4 )
- {
- lCrtSize = (long)((long)usWidth * (long)(i + 1));
- if ( lScanSize >= lCrtSize )
- {
- return(-1);
- }
- }
- } /* for usHeight */
- lCrtSize = (long)((long)usWidth * (long)usHeight);
- if ( (lScanSize + 4) >= lCrtSize )
- {
- lScanSize = -1;
- }
- return(lScanSize);
-} /* end of scan_map() */
-
-/*****************************************************************
- * H : bmp2run
- * I : unsigned char *in_buf - input buffer pointer
- * unsigned char *out_buf - output buffer pointer
- * unsigned int sizeX - image width by byte
- * unsigned int sizeY - image height by scanline
- * unsigned char ubMode - bit 0 & 1
- * 0 0 - normal compression
- * 0 1 - image reverse
- * 1 X - you get scanline table size
- * O : unsigned long lScanSize - scanline table size
- * P : scanline table compression
- ****************************************************************/
-long bmp2run(unsigned char *out_buf, unsigned char *in_buf, unsigned int sizeY, unsigned int sizeX, unsigned char ubMode)
-{
- unsigned char *tmp_buf1, *tmp_buf2;
- long scan_size;
-
- /*return(-1);*/ /* 19990323 by bglee - request from SM Lee*/
-
- tmp_buf1 = in_buf;
- tmp_buf2 = out_buf;
- scan_size = scan_map(tmp_buf1, tmp_buf2, sizeX, sizeY, ubMode);
- if (scan_size == -1)
- {
- return(-1);
- }
-
- if ( !(ubMode & 0x02) ) /* real compression */
- {
- out_buf = tmp_buf2 + scan_size;
- *out_buf++ = 0x00;
- *out_buf++ = 0x00;
- scan_size += 2;
- if (scan_size % 4)
- {
- *out_buf++ = 0x00;
- *out_buf++ = 0x00;
- scan_size += 2;
- }
- }
- else /* pre-compression*/
- {
- scan_size += 2;
- if (scan_size % 4)
- {
- scan_size += 2;
- }
- }
- return(scan_size);
-}
-
diff --git a/gs/contrib/gdevhl12.c b/gs/contrib/gdevhl12.c
deleted file mode 100644
index f44806ecc..000000000
--- a/gs/contrib/gdevhl12.c
+++ /dev/null
@@ -1,742 +0,0 @@
-/*
- Contributors:
- Created by Marek Michalkiewicz <marekm@amelek.gda.pl>
-
- THIS SOFTWARE IS NOT COPYRIGHTED
-
- This source code is offered for use in the public domain. You may
- use, modify or distribute it freely.
-
- This code is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
- DISCLAIMED. This includes but is not limited to warranties of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- (Legalese borrowed from the Mingw32 runtime libraries.)
- */
-
-/*$Id: gdevhl12.c,v 1.6 2002/07/30 18:53:21 easysw Exp $ */
-/* gdevhl12.c - Brother HL-1250 driver for Ghostscript */
-
-/*
- This driver handles the 1200x600 dpi mode, and some settings like
- paper source and toner save mode. 600x600 dpi and below is handled
- by gdevdljm.c (basically as in the ljet4 device, with minor changes
- in initialization and margins, and PCL wrapped in PJL).
-
- There are two device names made available by this driver, which
- differ only in the default (maximum) resolution:
-
- -sDEVICE=hl1240
- 600x600 dpi, for HL-1030/1240 (uses standard PCL modes 2 and 3)
-
- -sDEVICE=hl1250
- 1200x600 dpi, for HL-1050/1070/1250/1270N
- (uses special compression mode 1027 for 1200x600 dpi,
- otherwise modes 2 and 3 as above)
-
- Tested with a HL-1250, both 1200x600 and 600x600 dpi. Please test
- with other models and report results (both problems and success).
- Some notes on the other models:
-
- HL-1070 and HL-1270N
- can also print Postscript directly, at maximum 600x600 dpi
- (this driver can print 1200x600 dpi using mode 1027).
-
- HL-1240
- should no longer be limited to 300 dpi - this driver sends
- the recommended "@PJL SET RESOLUTION=..." command. PLEASE TEST.
- There have been some vague problem reports (wrong margins? not
- clear for what paper size, quite possibly Letter, not A4?) with
- this printer, if you have it and some Ghostscript hacking skills,
- _please_ try to help, fix it and send me a patch - thanks!
-
- HL-1030
- should no longer be "Paperweight" despite the "for Windows only"
- warning :-) - it knows enough PCL to print raster graphics, but
- *requires* "@PJL ENTER LANGUAGE=PCL", so it does not work with
- the ljet4 driver sending raw PCL. The windows driver uses an
- undocumented compression mode 1030, but modes 2 and 3 work too.
- PLEASE TEST.
-
- New models, still need to be tested:
- HL-1230 (GDI printer)
- HL-1440 (GDI printer)
- HL-1450 (PCL6 and PS2 emulation)
- HL-1470N (PCL6 and PS2 emulation)
-
- Additional settings (gs command line options) for this driver:
-
- -dEconoMode=0...2
- toner save mode: 0 = disabled (default), 1 = 25%, 2 = 50%
-
- -dPaperType=0...4
- paper type: 0 = plain (default), 1 = thin, 2 = thick, 3 = thicker,
- 4 = transparency
-
- -dSourceTray=0...4
- paper source: 0 = auto (default), 1 = dual, 2 = upper, 3 = lower,
- 4 = manual (not all models support the optional lower tray)
-
- The 1200x600 dpi mode may require a lot of printer memory - the manual
- recommends at least 10 MB; for me it seems to work well with 8 MB: 4 MB
- standard + 4 MB "finally found some good use for that old PS/2 SIMM" :-).
- Even at just 600x600 dpi (normal PCL 5 control codes) print quality is
- very good, at 1200x600 dpi it is difficult to see the difference (more
- visible on grayscale images). So 600x600 dpi is best for general use.
-
- The HL-1250 also supports PCL 6 (PCL XL) but
- - I don't have the documentation for that
- - the pxlmono driver works, but the output looks a bit different
- from that generated by the ljet4 or (this) 1200x600 dpi driver
- (lines appear very thin - not yet sure if this is a driver bug
- or differences in PCL 6 implementation, someone should check on
- a HP printer, does tiger.ps printed using the ljet4 and pxlmono
- drivers, both at 600x600 dpi, look the same?)
- so let's use the good old ljet4 (PCL 5) driver for now.
- (PCL 6 seems to offer better compression though.)
-
- To do: the undocumented mode 1030 may offer better compression
- (may help print complex graphics at 600 dpi - the HL-1030/1240 have
- only 2 MB of non-expandable RAM, which may not be enough for data
- that doesn't compress well). The windows driver uses this mode for
- all models, not just HL-1030. Documentation may be available later.
-
- Many thanks to Richard Thomas <richardt@brother.co.uk> for help
- (sending me a HL-1250, documentation, answering my questions).
-
- Thanks to L. Peter Deutsch <ghost@aladdin.com> for making gdevdjet.c
- and gdevdljm.[ch] available under a dual AFPL/GPL license.
- */
-
-#include "gdevprn.h"
-#include "gdevdljm.h"
-
-#ifdef X_DPI
-# define X_DPI2 X_DPI
-#else
-# define X_DPI 600
-# define X_DPI2 1200
-#endif
-
-#ifndef Y_DPI
-# define Y_DPI 600
-#endif
-
-typedef enum {
- ECONO_OFF = 0,
- ECONO_25,
- ECONO_50
-} hl1250_econo_t;
-
-typedef enum {
- PTYPE_PLAIN = 0,
- PTYPE_THIN,
- PTYPE_THICK,
- PTYPE_THICK2,
- PTYPE_TRANS
-} hl1250_paper_t;
-
-typedef enum {
- TRAY_AUTO = 0,
- TRAY_DUAL,
- TRAY_UPPER,
- TRAY_LOWER,
- TRAY_MANUAL
-} hl1250_tray_t;
-
-typedef struct gx_device_hl1250_s {
- gx_device_common;
- gx_prn_device_common;
- hl1250_econo_t econo_mode;
- hl1250_paper_t paper_type;
- hl1250_tray_t source_tray;
-} gx_device_hl1250;
-
-private dev_proc_open_device(hl1250_open);
-private dev_proc_close_device(hl1250_close);
-private dev_proc_print_page_copies(hl1250_print_page_copies);
-private dev_proc_get_params(hl1250_get_params);
-private dev_proc_put_params(hl1250_put_params);
-
-private const gx_device_procs prn_hl1250_procs =
-prn_params_procs(hl1250_open, gdev_prn_output_page, hl1250_close,
- hl1250_get_params, hl1250_put_params);
-
-#define hl1250_device_copies(dname, xdpi, ydpi)\
-{ prn_device_std_body_copies(gx_device_hl1250, prn_hl1250_procs,\
- dname,\
- DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,\
- xdpi, ydpi,\
- 0, 0, 0, 0,\
- 1, hl1250_print_page_copies),\
- ECONO_OFF, PTYPE_PLAIN, TRAY_AUTO\
-}
-
-const gx_device_hl1250 gs_hl1250_device =
-hl1250_device_copies("hl1250", X_DPI2, Y_DPI);
-
-const gx_device_hl1250 gs_hl1240_device =
-hl1250_device_copies("hl1240", X_DPI, Y_DPI);
-
-/* defines for the 1200x600 dpi mode (mode 1027) */
-
-/* max number of 16-bit words in one 1200 dpi scan line */
-#define SCAN_WORDS 640
-
-/* number of scan lines per band */
-#define BAND_SCANS 64
-
-/* max number of 16-bit words in one 64-line band after compression,
- limited by 16-bit length field - 7 bytes header + 0xFFF8 bytes data -
- note that we may have to lose some data if it can't compress well
- (maximum possible uncompressed data length is about 80K). */
-#define MAX_BAND_WORDS 0x7FFC
-
-/* codes (16-bit words) to send in the 1200x600 dpi data block: */
-
-/* vertical compression (copy COUNT words from the previous line) */
-#define HL_VERT(count) (0xE000 | (count))
-
-/* 16-bit horizontal compression (repeat the next word COUNT times) */
-#define HL_HOR16(count) (0x8000 | (count))
-
-/* 8-bit horiz. compression (repeat DATA byte COUNT*2 times, COUNT < 32) */
-#define HL_HOR8(count, data) (0xC000 | ((count) << 8) | ((data) & 0xFF))
-
-/* 4-bit horiz. compression (repeat DATA nibble COUNT*4 times, COUNT < 512) */
-#define HL_HOR4(count, data) (0xA000 | (count) | (((data) & 0x0F) << 9))
-
-/* no compression, COUNT words of data follow */
-#define HL_COPY(count) ((count) << 4)
-
-typedef unsigned short u16;
-
-/* The printer expects 16-bit data words in big endian order. */
-#if arch_is_big_endian
-#define cpu_to_be16(x) (x)
-#else
-private u16
-cpu_to_be16(u16 x)
-{
- return (x >> 8) | (x << 8);
-}
-#endif
-
-typedef struct hl1250_state_s {
- /* smallest area that contains all black dots of the band */
- /* x = xl..xr-1, y = yt..yb-1, width=xr-xl, height=yb-yt */
- unsigned int xl, xr, yt, yb;
-
- /* number of words in the output buffer */
- unsigned int out_count;
-
- /* output buffer for compressed data */
- u16 out_buf[MAX_BAND_WORDS];
-
- /* input buffer for one 64-line band */
- u16 in_buf[BAND_SCANS][SCAN_WORDS];
-} hl1250_state_t;
-
-/*
- find the smallest rectangle that contains all black dots of the
- band (in other words, the outside of that rectangle is all white)
- returns 0 if the band is completely white, else 1
- XXX - it should be faster to scan 32-bit (instead of 16-bit) words
- */
-private int
-hl1250_check_area(hl1250_state_t * s)
-{
- unsigned int x, y, xleft, xright, ytop, ybottom;
- int line_not_white, band_not_white;
-
- band_not_white = 0;
- xright = s->xl;
- xleft = s->xr;
- ybottom = s->yt;
- ytop = s->yb;
- for (y = s->yt; y < s->yb; y++) {
- line_not_white = 0;
- for (x = s->xl; x < s->xr; x++) {
- if (s->in_buf[y][x]) {
- if (xleft > x)
- xleft = x;
- if (xright <= x)
- xright = x + 1;
- line_not_white = 1;
- }
- }
- if (line_not_white) {
- if (ytop > y)
- ytop = y;
- if (ybottom <= y)
- ybottom = y + 1;
- band_not_white = 1;
- }
- }
- if (band_not_white) {
- s->xl = xleft;
- s->xr = xright;
- s->yt = ytop;
- s->yb = ybottom;
- } else {
- s->xr = s->xl;
- s->yb = s->yt;
- }
- return band_not_white;
-}
-
-/*
- Compressed data of this band is larger than MAX_BAND_WORDS.
- Repeat each line using vertical compression, effectively reducing
- resolution to 1200x300 dpi. This shouldn't happen too often.
- */
-private void
-hl1250_lose_resolution(hl1250_state_t * s)
-{
- unsigned int x, y;
- u16 data0, data1, mask;
- u16 *out;
- const u16 *line0;
- const u16 *line1;
- unsigned int width = s->xr - s->xl;
-
- out = s->out_buf;
- for (y = s->yt; y < s->yb; y += 2) {
- line0 = &s->in_buf[y][s->xl];
- line1 = line0;
- if (y + 1 < s->yb)
- line1 = &s->in_buf[y + 1][s->xl];
- mask = (y & 2) ? 0x5555 : 0xAAAA;
- *out++ = cpu_to_be16(HL_COPY(width));
- for (x = 0; x < width; x++) {
- data0 = line0[x];
- data1 = line1[x];
- *out++ = (data0 & data1) | (data0 & mask) | (data1 & mask);
- }
- *out++ = cpu_to_be16(HL_VERT(width));
- }
- s->out_count = out - s->out_buf;
-}
-
-/*
- Try to compress a single scan line.
- Return 1 on success, 0 on failure (data doesn't compress
- well enough to fit in MAX_BAND_WORDS words, truncated).
- */
-private int
-hl1250_compress_line(hl1250_state_t * s, unsigned int y)
-{
- unsigned int total_len; /* total data words after compression */
- unsigned int copy_len; /* number of words to copy uncompressed */
- unsigned int hlen, vlen; /* length for hor. and vert. compression */
- unsigned int clen, ulen; /* compressed and uncompressed words */
- u16 data; /* word currently being processed */
- u16 hl_code; /* code to send */
- int x, i;
- u16 *out;
- unsigned int width = s->xr - s->xl;
- const u16 *line = &s->in_buf[y][s->xl];
- const u16 *prev = (y > s->yt ? &s->in_buf[y - 1][s->xl] : NULL);
-
- out = &s->out_buf[s->out_count];
- x = 0;
- copy_len = 0;
- total_len = s->out_count;
- while (x < width) {
- data = line[x];
-
- /* how many words (hlen >= 1) to repeat */
- for (i = x + 1; i < width; i++) {
- if (line[i] != data)
- break;
- }
- hlen = i - x;
- /* if not the first line, try vertical compression */
- vlen = 0;
- if (prev) {
- for (i = x; i < width; i++) {
- if (line[i] != prev[i])
- break;
- }
- vlen = i - x;
- }
- /* find the best method to encode the data */
- ulen = hlen;
- clen = 1;
- if (vlen >= hlen) {
- /* vertical compression */
- ulen = vlen;
- hl_code = HL_VERT(vlen);
- } else if ((data ^ (data >> 8)) & 0xFF) {
- /* 16-bit horizontal compression */
- hl_code = HL_HOR16(hlen);
- clen = 2;
- } else if ((data ^ (data >> 4)) & 0x0F) {
- /* 8-bit horizontal compression (if possible) */
- if (hlen < 32) {
- hl_code = HL_HOR8(hlen, data);
- } else {
- hl_code = HL_HOR16(hlen);
- clen = 2;
- }
- } else {
- /* 4-bit horizontal compression (if possible) */
- if (hlen < 512) {
- hl_code = HL_HOR4(hlen, data);
- } else {
- hl_code = HL_HOR16(hlen);
- clen = 2;
- }
- }
- /*
- now see if we should copy the word without compression
- (the cost of leaving/re-entering copy mode is one word).
- */
- if (ulen < clen + (copy_len > 0)) {
- /* yes, copy */
- copy_len += ulen;
- } else {
- if (copy_len) {
- /* first, copy data (if any) */
- total_len += copy_len + 1;
- if (total_len > MAX_BAND_WORDS)
- goto error_out;
- *out++ = cpu_to_be16(HL_COPY(copy_len));
- memcpy(out, &line[x - copy_len], copy_len * sizeof(u16));
- out += copy_len;
- copy_len = 0;
- }
- /* now send the current code */
- total_len += clen;
- if (total_len > MAX_BAND_WORDS)
- goto error_out;
- *out++ = cpu_to_be16(hl_code);
- if (clen == 2) {
- /* 16-bit compression */
- *out++ = data;
- }
- }
- /* move to the next word to process */
- x += ulen;
- }
- /* copy anything left at the end */
- if (copy_len) {
- total_len += copy_len + 1;
- if (total_len > MAX_BAND_WORDS)
- goto error_out;
- *out++ = cpu_to_be16(HL_COPY(copy_len));
- memcpy(out, &line[width - copy_len], copy_len * sizeof(u16));
- out += copy_len;
- }
- error_out:
- s->out_count = out - s->out_buf;
- return (total_len <= MAX_BAND_WORDS);
-}
-
-/*
- send a 16-bit big endian value
- */
-private void
-put_be16(FILE * fp, u16 data)
-{
- putc(data >> 8, fp);
- putc(data & 0xFF, fp);
-}
-
-/*
- prn_stream = data sent to the printer
- s->xl,xr,yt,yb,in_buf = band (max 64 lines), coordinates band-relative
- band = Y coordinate of the band from top of page
- */
-private void
-hl1250_compress_band(FILE * prn_stream, hl1250_state_t * s, unsigned int band)
-{
- unsigned int y, ytop, ybottom;
-
- s->out_count = 0;
-
- if (!hl1250_check_area(s))
- return;
-
- /*
- It seems HL-1250 1200x600 dpi mode has an undocumented feature -
- it rounds the X left coordinate of the image up to next 32 dots.
- Probably the RISC inside likes 32-bit alignment. No big problem,
- we just have to round it down (it's in 16-bit words here).
- */
- s->xl &= ~1;
-
- ytop = s->yt;
- ybottom = s->yb;
- for (y = ytop; y < ybottom; y++) {
- if (hl1250_compress_line(s, y))
- continue;
-#if 1
- /* XXX - please report if you ever see this, then change to #if 0 */
- fprintf(stderr,
- "hl1250: compression failed (y=%u), doing 1200x300 dpi\n",
- band + y);
-#endif
- hl1250_lose_resolution(s);
- break;
- }
- if (s->out_count) {
- fprintf(prn_stream, "\033*b%uW", s->out_count * sizeof(u16) + 9);
- put_be16(prn_stream, s->out_count * sizeof(u16) + 7);
- put_be16(prn_stream, s->xl * 16);
- put_be16(prn_stream, band + ytop);
- putc(ybottom - ytop, prn_stream);
- put_be16(prn_stream, s->xr - s->xl);
- fwrite(s->out_buf, sizeof(u16), s->out_count, prn_stream);
- }
-}
-
-
-private int
-hl1250_print_1200dpi(gx_device_printer * pdev, FILE * prn_stream,
- int num_copies, const char *page_init)
-{
- int band, lnum;
- int code = 0;
- hl1250_state_t *s;
- int line_size = gdev_prn_raster(pdev);
- int num_rows = dev_print_scan_lines(pdev);
- int paper_size = gdev_pcl_paper_size((gx_device *) pdev);
-
- s = (hl1250_state_t *) gs_alloc_byte_array(pdev->memory, 1, sizeof(*s),
- "hl1250_print_1200dpi");
- if (!s)
- return_error(gs_error_VMerror);
-
- memset(s, 0, sizeof(*s));
-
- if (line_size > sizeof(s->in_buf[0]))
- line_size = sizeof(s->in_buf[0]);
-
- if (pdev->PageCount == 0) {
- /* reset, set paper size */
- fprintf(prn_stream, "\033E\033&l%dA", paper_size);
- }
- fputs("\033&u1200D", prn_stream);
- fputs("\033&l0o0l0E", prn_stream);
- fputs(page_init, prn_stream);
- fprintf(prn_stream, "\033&l%dX", num_copies);
- fputs("\033*rB\033*p0x0Y", prn_stream);
-
- /* set 600dpi (vertical) resolution */
- fputs("\033*t600R", prn_stream);
-
- /* start raster graphics */
- fputs("\033*r1A", prn_stream);
-
- /* transfer data in the special 1200x600 dpi format */
- fputs("\033*b1027M", prn_stream);
-
- for (band = 0; band < num_rows; band += BAND_SCANS) {
- int next_band = band + BAND_SCANS;
-
- if (next_band > num_rows)
- next_band = num_rows;
- for (lnum = band; lnum < next_band; lnum++) {
- code = gdev_prn_copy_scan_lines(pdev, lnum,
- (byte *) (s->in_buf[lnum - band]), line_size);
- if (code < 0)
- goto error_out;
- }
- s->yt = 0;
- s->yb = next_band - band;
- s->xl = 0;
- s->xr = 635; /* max width */
- hl1250_compress_band(prn_stream, s, band);
- }
- error_out:
- fputs("\033*rB\f", prn_stream);
- gs_free_object(pdev->memory, s, "hl1250_print_1200dpi");
- return code;
-}
-
-
-private int
-hl1250_open(gx_device * pdev)
-{
- /* margins: left, bottom, right, top */
- /* XXX - only A4 tested, letter size margins likely need to be tweaked */
- static const float margins_a4_600[4] = {0.05, 0.15, 0.25, 0.15};
- static const float margins_a4_1200[4] = {0.05, 0.2, 0.1, 0.15};
- static const float margins_letter_600[4] = {0.05, 0.15, 0.25, 0.15};
- static const float margins_letter_1200[4] = {0.05, 0.2, 0.1, 0.15};
-
- int x_dpi = (int)((gx_device_printer *) pdev)->x_pixels_per_inch;
- int paper_size = gdev_pcl_paper_size(pdev);
-
- if (x_dpi == 1200) {
- if (paper_size == PAPER_SIZE_A4)
- gx_device_set_margins(pdev, margins_a4_1200, true);
- else
- gx_device_set_margins(pdev, margins_letter_1200, true);
- } else {
- if (paper_size == PAPER_SIZE_A4)
- gx_device_set_margins(pdev, margins_a4_600, false);
- else
- gx_device_set_margins(pdev, margins_letter_600, false);
- }
- return gdev_prn_open(pdev);
-}
-
-#define UEL "\033%-12345X"
-
-/* XXX - how to get the name of the job (PS file) being printed? */
-#define PJL_JOB_NAME "Ghost"
-
-private int
-hl1250_close(gx_device * pdev)
-{
- int code = gdev_prn_open_printer(pdev, 1);
- FILE *fp;
-
- if (code < 0)
- return code;
- fp = ((gx_device_printer *) pdev)->file;
- /* job separation, reset, UEL */
- fputs("\033&l1T\033E", fp);
- fputs(UEL, fp);
- fprintf(fp, "@PJL EOJ NAME=\"%s\"\r\n", PJL_JOB_NAME);
- fputs(UEL, fp);
- return gdev_prn_close(pdev);
-}
-
-
-private int
-hl1250_print_page_copies(gx_device_printer * pdev, FILE * prn_stream,
- int num_copies)
-{
- int x_dpi = (int)pdev->x_pixels_per_inch;
- int y_dpi = (int)pdev->y_pixels_per_inch;
- const char *tray_pjl;
- const char *tray_pcl;
- const gx_device_hl1250 *hl1250 = (gx_device_hl1250 *) pdev;
- hl1250_econo_t econo_mode = hl1250->econo_mode;
- hl1250_paper_t paper_type = hl1250->paper_type;
- hl1250_tray_t source_tray = hl1250->source_tray;
- static const char * const onoff[2] = { "OFF", "ON" };
- static const char * const papertypes[5] =
- { "REGULAR", "THIN", "THICK", "THICK2", "TRANSPARENCY" };
-
- tray_pjl = "AUTO";
- tray_pcl = "";
- switch (source_tray) {
- case TRAY_DUAL:
- tray_pcl = "\033&l0H";
- break;
- case TRAY_UPPER:
- tray_pjl = "TRAY1";
- tray_pcl = "\033&l1H";
- break;
- case TRAY_LOWER:
- tray_pjl = "TRAY2";
- tray_pcl = "\033&l5H";
- break;
- case TRAY_MANUAL:
- tray_pcl = "\033&l2H";
- break;
- default:
- break;
- }
- if (pdev->PageCount == 0) {
- /* initialize printer */
- fputs(UEL, prn_stream);
- fputs("@PJL \r\n", prn_stream);
- fprintf(prn_stream, "@PJL JOB NAME=\"%s\"\r\n", PJL_JOB_NAME);
- fprintf(prn_stream, "@PJL SET ECONOMODE=%s\n", onoff[econo_mode != 0]);
- if (econo_mode)
- fprintf(prn_stream, "@PJL SET ECONOLEVEL=%d\n", 3 - (int)econo_mode);
- fprintf(prn_stream, "@PJL SET MEDIATYPE=%s\n", papertypes[paper_type]);
- fprintf(prn_stream, "@PJL SET SOURCETRAY=%s\n", tray_pjl);
- fprintf(prn_stream, "@PJL SET RESOLUTION=%d\n", y_dpi);
- fprintf(prn_stream, "@PJL SET RAS1200MODE=%s\n", onoff[x_dpi == 1200]);
-
- fputs("@PJL ENTER LANGUAGE=PCL\n", prn_stream);
- }
- if (x_dpi != 1200) {
- char page_init[100];
-
- /* We get the printer to translate the coordinate system for us.
- It seems the HL-1250 needs a slightly different translation
- (-120, 0) compared to the one in the ljet4 driver (-180, 36)
- (X, Y coordinates here are specified in 1/720-inch units). */
-
- sprintf(page_init, "\033&l-120U\033*r0F\033&u%dD%s", y_dpi, tray_pcl);
- return dljet_mono_print_page_copies(pdev, prn_stream, num_copies,
- y_dpi, PCL_LJ4_FEATURES, page_init);
- }
- return hl1250_print_1200dpi(pdev, prn_stream, num_copies, tray_pcl);
-}
-
-private int
-hl1250_put_param_int(gs_param_list * plist, gs_param_name pname,
- int *pvalue, int minval, int maxval, int ecode)
-{
- int code, value;
-
- code = param_read_int(plist, pname, &value);
- switch (code) {
- case 0:
- if (value < minval || value > maxval)
- param_signal_error(plist, pname, gs_error_rangecheck);
- *pvalue = value;
- return (ecode < 0 ? ecode : 1);
- case 1:
- return ecode;
- default:
- return code;
- }
-}
-
-private int
-hl1250_get_params(gx_device * pdev, gs_param_list * plist)
-{
- gx_device_hl1250 *hl1250 = (gx_device_hl1250 *) pdev;
- int code, val;
-
- code = gdev_prn_get_params(pdev, plist);
- if (code < 0)
- return code;
- val = hl1250->econo_mode;
- code = param_write_int(plist, "EconoMode", &val);
- if (code < 0)
- return code;
- val = hl1250->paper_type;
- code = param_write_int(plist, "PaperType", &val);
- if (code < 0)
- return code;
- val = hl1250->source_tray;
- code = param_write_int(plist, "SourceTray", &val);
- return code;
-}
-
-private int
-hl1250_put_params(gx_device * pdev, gs_param_list * plist)
-{
- int code = 0;
- gx_device_hl1250 *hl1250 = (gx_device_hl1250 *) pdev;
- int econo_mode = hl1250->econo_mode;
- int paper_type = hl1250->paper_type;
- int source_tray = hl1250->source_tray;
-
- code = hl1250_put_param_int(plist, "EconoMode", &econo_mode,
- ECONO_OFF, ECONO_50, code);
- code = hl1250_put_param_int(plist, "PaperType", &paper_type,
- PTYPE_PLAIN, PTYPE_TRANS, code);
- code = hl1250_put_param_int(plist, "SourceTray", &source_tray,
- TRAY_AUTO, TRAY_MANUAL, code);
- if (code < 0)
- return code;
- code = gdev_prn_put_params(pdev, plist);
- if (code < 0)
- return code;
- hl1250->econo_mode = econo_mode;
- hl1250->paper_type = paper_type;
- hl1250->source_tray = source_tray;
- return 0;
-}
diff --git a/gs/contrib/gdevln03.c b/gs/contrib/gdevln03.c
deleted file mode 100644
index 6ce46fd11..000000000
--- a/gs/contrib/gdevln03.c
+++ /dev/null
@@ -1,395 +0,0 @@
-/* Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc. All rights reserved.
-
-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 GNU General
-Public License for full details.
-
-Everyone is granted permission to copy, modify and redistribute Ghostscript,
-but only under the conditions described in the GNU 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 or COPYLEFT. Among other things, the copyright
-notice and this notice must be preserved on all copies.
- */
-
-/*
-gdevln03.c
-Ghostscript driver for DEC LN03 printer
-
-Ulrich Mueller, Div. PPE, CERN, CH-1211 Geneva 23 <ulm@vsnhd1.cern.ch>
-This code is subject to the GNU General Public License
-
-ulm 91-02-13 created as driver for gs 2.1.1
-ulm 91-07-23 adapted to gs 2.2
-ulm 91-08-21 changed memory allocation to gs_malloc,
- ported to VMS (contributed by Martin Stiftinger, TU Vienna)
-lpd 91-11-24 sped up by removing multiplies from inner loop
-ijmp 92-04-14 add support for la75/la50 (macphed@dvinci.usask.ca)
-ulm 92-09-25 support letter size paper (8.5" x 11")
-bbl 93-06-10 added la70 mode (bruce@csugrad.cs.vt.edu)
-lpd/ab 94-02-04 added la75plus mode (Andre_Beck@IRS.Inf.TU-Dresden.de)
-pbk 94-02-28 keep lines less than 80 chars for systems where files
- typed to terminal don't work otherwise; define separate
- eject string for each device for flexibility;
- add support for CRT sixels (keegstra@tonga.gsfc.nasa.gov)
-nb 1999-05-03 added dl2100 code (nick.brown@coe.int)
-*/
-
-#include "gdevprn.h"
-
-/* Forward references */
-private int sixel_print_page(gx_device_printer *pdev, FILE *prn_stream,
- const char *init, const char *eject);
-
-/* The device descriptor */
-private dev_proc_output_page(sixel_output_page);
-private dev_proc_print_page(ln03_print_page);
-/* We have to supply our own procs, since we have to intercept */
-/* output_page so we can open the printer in text mode. */
-private gx_device_procs sixel_procs =
- prn_procs(gdev_prn_open, sixel_output_page, gdev_prn_close);
-
-#ifdef A4
-# define BOTTOM_MARGIN 0.5
-#else
-# define BOTTOM_MARGIN 0.4
-#endif
-gx_device_printer gs_ln03_device =
- prn_device(sixel_procs, "ln03",
- DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,
- 300, 300, /* x_dpi, y_dpi */
- 0, BOTTOM_MARGIN, 0, 0, /* left, bottom, right, top margin */
- 1, ln03_print_page);
-
-/*
- * Initialization string: switch to graphics mode, 300 dpi
- * <ESC>[!p DECSTR soft terminal reset
- * <ESC>[11h PUM select unit of measurement
- * <ESC>[7 I SSU select pixel as size unit
- * <ESC>[?52h DECOPM origin is upper-left corner
- * <ESC>[0t DECSLPP set maximum form length
- * <ESC>[1;2475s DECSLRM set left and right margins
- * <ESC>P0;0;1q select sixel graphics mode
- * "1;1 DECGRA aspect ratio (1:1)
- */
-
-#define LN03_INIT \
- "\033[!p\033[11h\033[7 I\033[?52h\033[0t\033[1;2475s\033P0;0;1q\"1;1"
-
-/* leave sixel graphics mode, eject page
- <ESC>\ ST string terminator
- <FF> FF form feed */
-#define LN03_EJECT "\033\\\f"
-
-private int
-ln03_print_page(gx_device_printer *pdev, FILE *prn_stream)
-{
- return (sixel_print_page(pdev,prn_stream,LN03_INIT,LN03_EJECT));
-}
-
-/*
- * DEClaser 2100 printer - very similar to the LN03.
- */
-private dev_proc_print_page(dl2100_print_page);
-gx_device_printer gs_dl2100_device =
- prn_device(sixel_procs, "dl2100",
- DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,
- 300, 300, /* x_dpi, y_dpi */
- 0, 0, 0, 0, /* left, bottom, right, top margin */
- 1, dl2100_print_page);
-
-/*
- * Initialization string: same as for LN03, plus top/bottom margins.
- */
-
-#define DL2100_INIT \
- "\033[!p\033[11h\033[7 I\033[?52h\033[0t\033[1;2475s\033[1;3510r\033P0;0;1q\"1;1"
-
-private int
-dl2100_print_page(gx_device_printer *pdev, FILE *prn_stream)
-{
- return (sixel_print_page(pdev,prn_stream,DL2100_INIT,LN03_EJECT));
-}
-
-/*
- * LA50 dot matrix printer device.
- * This uses North American 8.5 x 11 inch paper size.
- */
-private dev_proc_print_page(la50_print_page);
-gx_device_printer gs_la50_device =
- prn_device(sixel_procs, "la50",
- 85,
- 110,
- 144, 72,
- 0, 0, 0.5, 0,
- 1, la50_print_page);
-/* LA50's use a very primitive form of initialization */
-
-#define LA50_INIT "\033Pq"
-
-/* leave sixel graphics mode, eject page
- <ESC>\ ST string terminator
- <FF> FF form feed */
-#define LA50_EJECT "\033\\\f"
-
-private int
-la50_print_page(gx_device_printer *pdev, FILE *prn_stream)
-{
- return (sixel_print_page(pdev,prn_stream,LA50_INIT,LA50_EJECT));
-}
-
-/*
- * LA70 dot matrix printer device.
- * This uses North American 8.5 x 11 inch paper size.
- */
-private dev_proc_print_page(la70_print_page);
-gx_device_printer gs_la70_device =
- prn_device(sixel_procs, "la70",
- 85,
- 110,
- 144, 144,
- 0, 0, 0.5, 0,
- 1, la70_print_page);
-
-#define LA70_INIT "\033P0;0;0q\"1;1"
-
-/* leave sixel graphics mode, eject page
- <ESC>\ ST string terminator
- <FF> FF form feed */
-#define LA70_EJECT "\033\\\f"
-
-private int
-la70_print_page(gx_device_printer *pdev, FILE *prn_stream)
-{
- return (sixel_print_page(pdev,prn_stream,LA70_INIT,LA70_EJECT));
-}
-
-/*
- * LA75 dot matrix printer device.
- * This uses North American 8.5 x 11 inch paper size.
- */
-private dev_proc_print_page(la75_print_page);
-gx_device_printer gs_la75_device =
- prn_device(sixel_procs, "la75",
- 85,
- 110,
- 144, 72,
- 0, 0, 0.5, 0,
- 1, la75_print_page);
-
-#define LA75_INIT "\033P0;0;0q"
-
-/* leave sixel graphics mode, eject page
- <ESC>\ ST string terminator
- <FF> FF form feed */
-#define LA75_EJECT "\033\\\f"
-
-private int
-la75_print_page(gx_device_printer *pdev, FILE *prn_stream)
-{
- return (sixel_print_page(pdev,prn_stream,LA75_INIT,LA75_EJECT));
-}
-
-/*
- * LA75+ dot matrix printer device (24 needles).
- * This uses either A4 or US paper size.
- * Last changed: 03.02.94 -abp
- */
-private dev_proc_print_page(la75plus_print_page);
-gx_device_printer gs_la75plus_device =
- prn_device(sixel_procs, "la75plus",
- 85,
- 110,
- 180, 180,
- 0, 0, BOTTOM_MARGIN, 0,
- 1, la75plus_print_page);
-
-/*
- * Init String:
- * <ESC>c full reset
- * <DCS>0;0;1q start sixel printing at max resolution
- * "1;1 aspect ratio 1:1
- */
-
-#define LA75PLUS_INIT "\033c\033P0;0;1q\"1;1"
-
-/* leave sixel graphics mode, eject page
- <ESC>\ ST string terminator
- <FF> FF form feed */
-#define LA75PLUS_EJECT "\033\\\f"
-
-private int
-la75plus_print_page(gx_device_printer *pdev, FILE *prn_stream)
-{
- return (sixel_print_page(pdev,prn_stream,LA75PLUS_INIT,LA75PLUS_EJECT));
-}
-
-/*
- * CRT sixels, e.g. for display by VT240-like terminals or MSKERMIT.
- * Parameters set so MSKERMIT using sixels matches native EGA.
- * COBE/DMR prefers (145, 100, 56.8, 28.5) to match its program DPSI.
- */
-private dev_proc_print_page(sxlcrt_print_page);
-gx_device_printer gs_sxlcrt_device =
- prn_device(sixel_procs,
- "sxlcrt",
- 180,
- 110,
- 42.6667, 32.0,
- 0, 0, 0, 0,
- 1, sxlcrt_print_page);
-
-/* Use init and eject strings similar to COBE/DMR program DQUSIXEL */
-/* Add an exit Tek emulation sequence so kermit displays properly */
-#define SXLCRT_INIT "\033[?38l\033P0q"
-/* leave sixel graphics mode, home cursor */
-#define SXLCRT_EJECT "\033\\\033[23;0H"
-
-private int
-sxlcrt_print_page(gx_device_printer *pdev, FILE *prn_stream)
-{
- return (sixel_print_page(pdev,prn_stream,SXLCRT_INIT,SXLCRT_EJECT));
-}
-
-/* ------ Internal routines ------ */
-
-/* Open the printer in text mode before gdev_prn_output_page */
-/* opens it in binary mode. */
-private int
-sixel_output_page(gx_device *pdev, int num_copies, int flush)
-{ int code = gdev_prn_open_printer(pdev, 0);
- if ( code < 0 )
- return code;
- return gdev_prn_output_page(pdev, num_copies, flush);
-}
-
-/* Send the page to the printer. */
-/* Keep all lines <= 80 chars */
-private int
-sixel_print_page(gx_device_printer *pdev, FILE *prn_stream,
- const char *init, const char *eject)
-{
- byte *in, *inp;
- int lnum, lcount, l, count, empty, mask, c, oldc, line_size, in_size;
- int ccount;
-
- line_size = gdev_mem_bytes_per_scan_line((gx_device *)pdev);
- in_size = line_size * 6;
- in = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), in_size, 1, "sixel_print_page");
-
- /* Check allocation */
- if (!in) return(-1);
-
- fputs(init,prn_stream);
- ccount = strlen(init);
-
- /* Print lines of graphics */
- for (lnum = lcount = 0; lnum < pdev->height; lnum+=6, lcount++) {
- gdev_prn_copy_scan_lines(pdev, lnum, inp = in, line_size * 6);
-
- mask = 0200;
- oldc = 077;
- empty = 1;
-
- for (l = pdev->width, count = 0; --l >= 0; count++) {
- /* transpose 6*8 rectangle */
- register byte *iptr = inp;
- c = 077;
- if (*iptr & mask)
- c += 1;
- if (*(iptr += line_size) & mask)
- c += 2;
- if (*(iptr += line_size) & mask)
- c += 4;
- if (*(iptr += line_size) & mask)
- c += 010;
- if (*(iptr += line_size) & mask)
- c += 020;
- if (*(iptr += line_size) & mask)
- c += 040;
- if (!(mask >>= 1)) {
- mask = 0200;
- inp++;
- }
-
- if (c != oldc) {
- if (empty) {
- while (--lcount >= 0) {
-
- /* terminate record.
- this LF is ignored by the LN03 */
- if (ccount > 78) {
- fputc('\n', prn_stream);
- ccount = 0;
- }
- /* terminate previous line */
- fputc('-', prn_stream);
- ccount++;
- }
- empty = lcount = 0;
- }
- if (count > 3) {
- /* use run length encoding */
- if (ccount > 74) {
- fputc('\n', prn_stream);
- ccount = 0;
- }
- /* we know lines will not exceed 10000 pixels */
- ccount = ccount + 3 + (count > 9)
- + (count > 99)
- + (count > 999);
- fprintf(prn_stream, "!%d%c", count, oldc);
- }
- else {
- while (--count >= 0) {
- if (ccount > 78) {
- fputc('\n', prn_stream);
- ccount = 0;
- }
- fputc(oldc, prn_stream);
- ccount++;
- }
- }
- oldc = c;
- count = 0;
- }
- }
- if (c != 077) {
- if (count > 3) {
- /* use run length encoding */
- if (ccount > 74) {
- fputc('\n', prn_stream);
- ccount = 0;
- }
- /* we know lines will not exceed 10000 pixels */
- ccount = ccount + 3 + (count > 9)
- + (count > 99)
- + (count > 999);
- fprintf(prn_stream, "!%d%c", count, c);
- }
- else {
- while (--count >= 0) {
- if (ccount > 78) {
- fputc('\n', prn_stream);
- ccount = 0;
- }
- fputc(c, prn_stream);
- ccount++;
- }
- }
- }
- }
-
- /* leave sixel graphics mode, eject page */
- if (ccount + strlen(eject) > 79) fputc('\n', prn_stream);
- fputs(eject, prn_stream);
- fflush(prn_stream);
-
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)in, in_size, 1, "sixel_print_page");
-
- return(0);
-}
diff --git a/gs/contrib/gdevlx32.c b/gs/contrib/gdevlx32.c
deleted file mode 100644
index 48463e5b1..000000000
--- a/gs/contrib/gdevlx32.c
+++ /dev/null
@@ -1,3362 +0,0 @@
-/*
- * Lexmark 3200 Color Jetprinter driver
- *
- * version 0.4.1
- *
- * Copyright 2000 by Daniel Gordini (dgordin@tin.it)
- *
- * --------------------------------------------------------------------
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * --------------------------------------------------------------------
- *
- * This driver is almost 100% original code but it is based
- * on protocol information partly discovered by Andrew Onifer III
- * (http://www.mindspring.com/~aonifer) and Peter B. West
- * (http://www.powerup.com.au/~pbwest) that were used as a starting
- * base for the reverse-engineering of the protocol.
- *
- * Please mail me bug reports, comments and suggestions.
- *
- * Don't forget to read the release notes before installing !!
- *
- */
-
-#include "gdevprn.h"
-#include "gsparams.h"
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-/* Prototypes for public routines */
-private dev_proc_map_rgb_color(lxm3200_map_rgb_color);
-private dev_proc_map_color_rgb(lxm3200_map_color_rgb);
-private dev_proc_print_page(lxm3200_print_page);
-private dev_proc_get_params(lxm3200_get_params);
-private dev_proc_put_params(lxm3200_put_params);
-private dev_proc_open_device(lxm3200_open);
-
-/* Prototypes for internal routines */
-private void freeresources(gx_device *pdev);
-private byte calccheck8(byte *data);
-private void outputepilogue(void);
-private void skiplines(int skipcol, int skipin);
-private void fillheader(int head, int numcol, int firstcol, int bytes);
-private void finalizeheader(int vskip, int newhead);
-private void convbuf(int head, int numcols, int firstcol);
-private void encode_bw_buf(void);
-private void encode_col_buf(int head);
-private int fill_mono_buffer(int vline);
-private int init_buffer(void);
-private int qualify_buffer(void);
-private int roll_buffer(void);
-private void calclinemargins(byte *data, int mask, int *left, int *right);
-private void calcbufmargins(int head);
-private void print_color_page(void);
-private void print_mono_page(void);
-private void print_photo_page(void);
-
-/* Codes for the color indexes. */
-#define WHITE 0x00 /* Pure white */
-#define MAGENTA 0x01 /* Standard magenta */
-#define CYAN 0x02 /* Standard cyan */
-#define YELLOW 0x04 /* Standard yellow */
-#define LIGHTCYAN 0x10 /* Light cyan (photo mode) */
-#define LIGHTMAGENTA 0x20 /* Light magenta (photo mode) */
-#define BLACK 0x40 /* Pure black */
-
-/* Modes for rendering: used by the common procedures to
- * discriminate from mono to color and photo modes.
- */
-#define LXM3200_M 0 /* Monochrome mode */
-#define LXM3200_C 1 /* Standard color mode */
-#define LXM3200_P 2 /* Photo color mode */
-
-/* Initial horizontal position for the printheads,
- * in 1200ths of an inch. Note that "left" and "right"
- * head here refers to paper margin, and so looking at
- * them from the front of printer they will appear reversed.
- */
-
-/* Left head (B&W/photo) start position */
-#define LHSTART (gendata.leftoffset+6254)
-/* added for Lexmark Z12 28.09.2002 */
-#define LHSTART_z12 (gendata.leftoffset+5000)
-
-/* Right head (color) start position. This is relative to
- * LHSTART so we only need to change one parameter to adjust
- * the head starting position. In the case of the Lexmark Z12
- * we have only one cartridge: black or color, so
- * LHSTART_Z12 = RHSTART_Z12
- */
-#define RHSTART (LHSTART-2120)
-#define RHSTART_z12 (LHSTART_z12) /* added for Lexmark Z12 28.9.2002 */
-
-/* Difference in starting position between left-to-right
- * and right-to-left passes, in 1200ths of an inch.
- * Obviously only used in bidirectional mode.
- */
-#define LRPASSHOFS 62
-
-/* Initial vertical position of the printheads,
- * in 1200ths of an inch.
- */
-#define BWTOPSTART (gendata.topoffset+420)
-#define COLTOPSTART (gendata.topoffset+476)
-
-/* Base alignment offset between the color cartridge
- * and the B&W cartridge in 192 nozzles mode.
- */
-#define COLORVALIGN_V 8
-#define BLACKVALIGN_V (gendata.vertalign+30)
-#define PHOTOVALIGN_V (gendata.vertalign)
-
-/* Values used to index the vertical aligment array */
-#define COLORVALIGN 0
-#define BLACKVALIGN 1
-#define PHOTOVALIGN 2
-
-/* Offset of color pens from first row, in 1/600ths of an inch.
- * Pen 0 is the topmost and is the CYAN or LIGHTCYAN pen (depending
- * on the cartridge: standard color or photo). Pen 1 is the middle
- * one, which carries MAGENTA or LIGHTMAGENTA color. Pen 2 is the
- * bottom one, which is YELLOW or BLACK.
- */
-#define PEN0OFS 0
-#define PEN1OFS 92
-#define PEN2OFS 184
-
-/* Number of nozzles in each pen type */
-#define COLORPEN 64 /* Each color pen of a color/photo cartridge */
-#define BWCOLPEN 192 /* Black cartridge used in color or 1200dpi modes */
-#define BWSTDPEN 208 /* Black cartridge used in mono non-1200dpi mode */
-
-/* Values used by the color mapping routines */
-#define HALFTONE (gx_max_color_value/2)
-#define FULLTONE (gx_max_color_value)
-#define ONETHIRD (FULLTONE/3)
-#define TWOTHIRD ((2*FULLTONE)/3)
-
-/* Printer head and printing direction selectors */
-#define LEFT 0 /* Left head (B/W or photo) or left-to-right direction */
-#define RIGHT 1 /* Right head (colour) or right-to-left direction */
-
-/* Qualificators for the scan buffer */
-#define LAST 0x01 /* The buffer is the last on the page */
-#define LHDATA 0x02 /* The buffer contains data for the left head */
-#define RHDATA 0x04 /* The buffer contains data for the right head */
-
-/* Printer's margins, in inches. The Lexmark 3200 has two settings
- * for the side margins: one is used with A4-sized paper and one
- * (here called conventionally "LETTER") is used for all other paper
- * sizes. Envelopes have different margins as well, but under ghostscript
- * it's quite hard to know, from inside a printer driver, if we are
- * printing on envelopes or on standard paper, so we just ignore that.
- */
-#define LXM3200_TOP_MARGIN 0.070
-#define LXM3200_BOTTOM_MARGIN 0.200
-#define LXM3200_A4_LEFT_MARGIN 0.135
-#define LXM3200_LETTER_LEFT_MARGIN 0.250
-#define LXM3200_A4_RIGHT_MARGIN 0.135
-#define LXM3200_LETTER_RIGHT_MARGIN 0.250
-
-/* Offsets for the top and bootom start of the printing frame. */
-#define LXM3200_A4_TOPOFFSET 84
-#define LXM3200_A4_LEFTOFFSET 162
-#define LXM3200_LETTER_TOPOFFSET 84
-#define LXM3200_LETTER_LEFTOFFSET 300
-
-
-/*
- * ------ The device descriptor ------
- */
-
-/* Device procedures */
-private gx_device_procs lxm3200_procs =
- prn_color_params_procs(lxm3200_open, gdev_prn_output_page, gdev_prn_close,
- lxm3200_map_rgb_color, lxm3200_map_color_rgb, lxm3200_get_params,
- lxm3200_put_params);
-
-/* Define an extension (subclass) of gx_device_printer. */
-typedef struct lxm_device_s
-{
- gx_device_common;
- gx_prn_device_common;
- int rendermode; /* Rendering mode (BW, CMYK, CcMmYK) */
- int algnA; /* Horizontal alignment between left and right cartridges */
- int algnB; /* Vertical alignment between left and right cartridges */
- int algnC; /* Nozzle column separation of left cartridge */
- int algnD; /* Nozzle column separation of right cartridge */
- int bidir; /* Bidirectional printing active ? */
- int numpass; /* Number of head passes for each stripe */
- int leftoffset; /* Offset of first column from left side of paper */
- int topoffset; /* Offset of first row from top of paper */
- int model; /* Parameter to choose the model - lxm3200=0, z12=1, z31=2 */
- int z31m; /* Alignment parameter for the Z31 */
-} lxm_device;
-
-/* Device definition: Lexmark 3200 */
-lxm_device far_data gs_lxm3200_device =
-{
- prn_device_body(lxm_device,
- lxm3200_procs,
- "lxm3200",
- DEFAULT_WIDTH_10THS,
- DEFAULT_HEIGHT_10THS,
- 600, /* default x dpi */
- 600, /* default y dpi */
- 0.0, /* left margin, inches (filled-in later) */
- 0.0, /* bottom margin, inches (filled-in later) */
- 0.0, /* right margin, inches (filled-in later) */
- 0.0, /* top margin, inches (filled-in later) */
- 1, /* number of color components (mono) */
- 8, /* bits per pixel */
- 1, /* number of gray levels-1: B&W only */
- 0, /* number of color levels-1: no color */
- 2, /* dither gray: maximum 2 distinct gray levels */
- 0, /* dither rgb: no RGB dithering in this mode */
- lxm3200_print_page),
- LXM3200_C, /* default printing mode */
- 16, 8, 16, 16, /* default aligment parameters value */
- 0, 1, /* default bidirectional and numpasses value */
- 0, 0, /* left and top offsets (filled-in later) */
- 0, /* default model = Lexmark 3200 */
- 100 /* default z31m */
-};
-
-/* --------- Static data --------- */
-
-/* Lookup tables to speed up bitwise operations */
-private byte bits[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
-private byte ibits[8] = { 0x7f, 0xbf, 0xdf, 0xef, 0xf7, 0xfb, 0xfd, 0xfe };
-
-/* Lookup table for masking color pens in color/photo cartridges.
- * This is used to check the raster buffer for the presence of a
- * particular color in the pixel we are encoding.
- * The first index is the head (LEFT or RIGHT) which is used to
- * distinguish between photo and color cartridges. The second index
- * is the pen number (0 is the upper pen, 1 the middle pen, 2 the
- * lower pen) on that cartridge.
- */
-private byte colmask[2][3] =
-{
- { LIGHTCYAN, LIGHTMAGENTA, BLACK},
- { CYAN, MAGENTA, YELLOW }
-};
-
-/* Lookup table for pen position offsets of color/photo cartridges.
- * Parameter is the pen number, as defined by the pen offsets above:
- * pen 0 is CYAN/LIGHTCYAN, pen 1 is MAGENTA/LIGHTMAGENTA, pen 2 is
- * YELLOW/BLACK. This is used to properly take account the position
- * of each color pen relative to the vertical position of the
- * color/photo cartridge.
- */
-private int penofs[3];
-
-/* Lookup table for vertical alignment of the cartridges relative to
- * each other. Parameter is the cartridge type: 0 = color cartridge,
- * 1 = black cartridge in color mode, 2 = photo cartridge.
- * Black cartridge in monochromatic mode is always aligned at 0
- * because in that mode we print with only one cartridge so there can
- * be no alignment problems (a single cartridge is always aligned
- * with itself, otherwise the printer tray is faulty).
- */
-private int valign[3];
-
-/* Lookup table for horizontal offsets. First parameter is the
- * head, second parameter the printing direction.
- */
-private int hoffset[2][2];
-
-/* Initialization sequence needed at the beginning of the data stream.
- * This is invariant and contains a reset sequence, meaning each single
- * page in a multiple page output is sent to the printer as an independent
- * print job.
- */
-private byte init_sequence[] =
-{
- 0x1b, 0x2a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x1b, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33,
- 0x1b, 0x30, 0x80, 0x0C, 0x02, 0x00, 0x00, 0xbe,
- 0x1b, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21
-};
-
-private byte z12_init_sequence[] =
-{
- 0x1b, 0x2a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x1b, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33,
- 0x1b, 0x63, 0x00, 0x01, 0x40, 0x02, 0x0d, 0xb3,
- 0x1b, 0x30, 0x80, 0x0c, 0x01, 0x00, 0x00, 0xbd,
- 0x1b, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21
-};
-
-/* General global data that must be accessible
- * by all routines.
- */
-typedef struct pagedata_s
-{
- /* General invariant data */
- int numbytes; /* Number of bytes in a scanline of the buffer */
- int numrbytes; /* Width (in bytes) of one rasterized scanline */
- int goffset; /* Guard offset at each side of each scanline (columns) */
- int numblines; /* Number of lines in a buffer */
- int numlines; /* Number of lines in a vertical head pass */
- int rendermode; /* Type of rendering */
- int numvlines; /* Number of lines in the page */
- int numcols; /* Number of columns in a row */
- int numpasses; /* Number of passes used to print one stripe */
- int bidirprint; /* Bidirectional printing enabled ? */
- int select; /* Resolution selector */
- int modelprint; /* which printer? - lxm3200=0, z12=1, z31=2 */
- int z31margin; /* margin for the Z31 */
-
- /* Printing offsets */
- int leftoffset; /* Start printing offset from left margin */
- int topoffset; /* Start printing offset from top margin */
-
- /* Resolution settings */
- int xres; /* Horizontal dots per inch */
- int yres; /* Vertical dots per inch */
- int xrmul; /* Horizontal coordinate multiplier */
- int yrmul; /* Vertical coordinate multiplier */
-
- /* Pagewide status */
- int curheadpos; /* Current absolute printhead position */
- int linetoeject; /* Number of lines for the eject command */
- int direction; /* Printing direction for next stripe */
-
- /* Alignment data */
- int bwsep; /* Nozzle columns separation in B&W/photo cartridge */
- int colsep; /* Nozzle columns separation in color cartridge */
- int vertalign; /* Vertical alignment offset of the two cartridges */
- int lrhalign; /* Horizontal alignment between left and right cartridges */
-
- /* Data pointers */
- byte *outdata; /* Buffer to output data codes for one full stripe */
- byte *scanbuf; /* Buffer to contain the rasterized scanlines */
- FILE *stream; /* Output stream */
- lxm_device *dev; /* Pointer to our device */
-
- /* Buffer data */
- int left, right; /* Actual left and right margins */
- int firstline; /* Head of the circular scanline buffer */
- int lastblack; /* Line of last black pass rendered in a color print */
- int curvline; /* Current vertical position */
-
- /* Stripe related data */
- byte header[24]; /* Stripe header data */
- int fullflag; /* A stripe is ready to be output */
- int stripebytes; /* Number of bytes in a stripe */
- int ileave; /* Interleaving pass: 0=even lines, 1=odd lines */
-
-} pagedata;
-
-private pagedata gendata;
-
-/* --------- Interface routines --------- */
-
-/* Function called by ghostscript to open the
- * printer device. We set the margins and offsets
- * here. Note that to guess which paper is loaded
- * into the printer, we calculate the line width
- * and then anything between 8.25 and 8.4 inches
- * is considered to be A4.
- * This routine is inspired by the omologous
- * routine from the "gdevbj10" driver.
- */
-private int
-lxm3200_open(gx_device *pdev)
-{
- float linewidth;
-
- static const float a4_margins[4] =
- {
- LXM3200_A4_LEFT_MARGIN, LXM3200_BOTTOM_MARGIN,
- LXM3200_A4_RIGHT_MARGIN, LXM3200_TOP_MARGIN
- };
-
- static const float letter_margins[4] =
- {
- LXM3200_LETTER_LEFT_MARGIN, LXM3200_BOTTOM_MARGIN,
- LXM3200_LETTER_RIGHT_MARGIN, LXM3200_TOP_MARGIN
- };
-
- linewidth = (float)(pdev->width) / (float)(pdev->x_pixels_per_inch);
-
- if(linewidth >= 8.25 && linewidth <= 8.4)
- {
- gx_device_set_margins(pdev, a4_margins, true);
- ((lxm_device *)pdev)->topoffset = LXM3200_A4_TOPOFFSET;
- ((lxm_device *)pdev)->leftoffset = LXM3200_A4_LEFTOFFSET;
- }
- else
- {
- gx_device_set_margins(pdev, letter_margins, true);
- ((lxm_device *)pdev)->topoffset = LXM3200_LETTER_TOPOFFSET;
- ((lxm_device *)pdev)->leftoffset = LXM3200_LETTER_LEFTOFFSET;
- }
-
- return gdev_prn_open(pdev);
-}
-
-/* Function used by ghostscript to map a RGB
- * value to the driver's internal representation
- * of the nearest color.
- */
-private gx_color_index
-lxm3200_map_rgb_color(gx_device *dev, const gx_color_value cv[])
-{
- gx_color_index col;
- gx_color_value r, g, b;
- int c, m, y;
- gx_color_value tmpcv[3];
-
- r = cv[0]; g = cv[1]; b = cv[2];
- /* In case R, G and B values are equal, ghostscript
- * prescribes that the color value must be turned
- * into a gray shade. In our case this means either
- * black or white
- */
- if(r == g && r == b)
- {
- if(r > HALFTONE)
- return(WHITE);
- else
- return(BLACK);
- }
-
- /* Calculate CMY values from RGB. This is *overly*
- * simple, but it's enough to print something.
- */
- c = FULLTONE - r;
- m = FULLTONE - g;
- y = FULLTONE - b;
-
- /* Now encode the calculated color into the internal
- * format. This means simply to turn on or off the
- * bits representing each color depending on the value
- * of the appropriate CMY component.
- * Note that we are not doing black separation or any
- * other fancy stuff: this is spartane code just to
- * make the printer work.
- */
- col = 0;
- if(y > HALFTONE)col |= YELLOW;
-
- switch(((lxm_device *)dev)->rendermode)
- {
- case LXM3200_C:
- if(c > HALFTONE)col |= CYAN;
- if(m > HALFTONE)col |= MAGENTA;
- break;
-
- case LXM3200_P:
- if(c > TWOTHIRD)
- col |= CYAN;
- else
- if(c > ONETHIRD)col |= LIGHTCYAN;
-
- if(m > TWOTHIRD)
- col |= MAGENTA;
- else
- if(m > ONETHIRD)col |= LIGHTMAGENTA;
- break;
-
- default:
- tmpcv[0] = r; tmpcv[1] = g; tmpcv[2] = b;
- col = gdev_prn_map_rgb_color(dev, tmpcv);
- break;
- }
-
- return(col);
-}
-
-/* Function called by ghostscript to map the
- * internal representation of a color to a
- * RGB value.
- */
-private int
-lxm3200_map_color_rgb(gx_device *dev, gx_color_index color,
- gx_color_value prgb[3])
-{
- int c, m, y;
-
- if(color == WHITE)
- {
- prgb[0] = FULLTONE;
- prgb[1] = FULLTONE;
- prgb[2] = FULLTONE;
- return(0);
- }
-
- if(color & BLACK)
- {
- prgb[0] = 0;
- prgb[1] = 0;
- prgb[2] = 0;
- return(0);
- }
-
- /* Calculate back CMY components from the internal
- * representation of the color
- */
- c = 0;
- m = 0;
- y = 0;
-
- switch(((lxm_device *)dev)->rendermode)
- {
- case LXM3200_C:
- color &= (CYAN|MAGENTA|YELLOW);
- if(color & CYAN)c = 2;
- if(color & MAGENTA)m = 2;
- if(color & YELLOW)y = 2;
- break;
-
- case LXM3200_P:
- default:
- color &= (CYAN|MAGENTA|YELLOW|LIGHTCYAN|LIGHTMAGENTA);
- if(color & LIGHTCYAN)c = 1;
- if(color & LIGHTMAGENTA)m = 1;
- if(color & YELLOW)y = 2;
- if(color & CYAN)c = 2;
- if(color & MAGENTA)m = 2;
- break;
- }
-
- /* And now turn CMY to RGB, in the usual spartane way */
-
- prgb[0] = (gx_color_value)((2 - c) * HALFTONE);
- prgb[1] = (gx_color_value)((2 - m) * HALFTONE);
- prgb[2] = (gx_color_value)((2 - y) * HALFTONE);
-
- return(0);
-}
-
-/* Main routine of the driver. This takes care of
- * all parameters and static data initialization
- * and calls the proper page printing routines
- * depending on the selected printing mode.
- */
-private int
-lxm3200_print_page(gx_device_printer *pdev, FILE *prn_stream)
-{
- /* Store data passed by ghostscript to the driver */
- gendata.dev = (lxm_device *)pdev;
- gendata.stream = prn_stream;
- gendata.rendermode = (gendata.dev)->rendermode;
-
- /* Snap resolution on one of the three supported setting
- * (300, 600, 1200 dpi) depending on the input resoution value.
- * Horizontal and vertical resolution are treated independently.
- */
- gendata.xres = 600;
- if((gendata.dev)->x_pixels_per_inch < 450)gendata.xres = 300;
- if((gendata.dev)->x_pixels_per_inch > 900)gendata.xres = 1200;
- gendata.xrmul = 1200 / gendata.xres;
-
- gendata.yres = 600;
- if((gendata.dev)->y_pixels_per_inch < 450)gendata.yres = 300;
- if((gendata.dev)->y_pixels_per_inch > 900)gendata.yres = 1200;
- gendata.yrmul = 1200 / gendata.yres;
-
- /* Cache horizontal and vertical starting offsets */
- gendata.topoffset = (gendata.dev)->topoffset;
- gendata.leftoffset = (gendata.dev)->leftoffset;
-
- /* Build lookup table for pen offset, adjusting for
- * vertical resolution setting
- */
- penofs[0] = (PEN0OFS * 2) / gendata.yrmul;
- penofs[1] = (PEN1OFS * 2) / gendata.yrmul;
- penofs[2] = (PEN2OFS * 2) / gendata.yrmul;
-
- /* Build lookup table for vertical heads alignment,
- * adjusting for vertical resolution setting
- */
- valign[COLORVALIGN] = (COLORVALIGN_V * 2) / gendata.yrmul;
- valign[BLACKVALIGN] = (BLACKVALIGN_V * 2) / gendata.yrmul;
- valign[PHOTOVALIGN] = (PHOTOVALIGN_V * 2) / gendata.yrmul;
-
- /* Build lookup tables for initial horizontal offsets,
- * adjusting for horizontal resolution setting
- */
- /* choose whether to use lxm3200 or Z12 settings */
- gendata.modelprint=(gendata.dev)->model; /* which model? */
- gendata.z31margin=(gendata.dev)->z31m; /*which additional margin for z31*/
- switch(gendata.modelprint){
- case 1: /* we use the Lexmark Z12 */
- hoffset[LEFT][LEFT] = LHSTART_z12;
- hoffset[RIGHT][LEFT] = RHSTART_z12 + gendata.lrhalign;
- break;
- default: /* default (if one uses the Lexmark 3200 or the Lexmark Z31) */
- hoffset[LEFT][LEFT] = LHSTART;
- hoffset[RIGHT][LEFT] = RHSTART + gendata.lrhalign;
- break;
- }
- hoffset[LEFT][RIGHT] = hoffset[LEFT][LEFT] - LRPASSHOFS;
- hoffset[RIGHT][RIGHT] = hoffset[RIGHT][LEFT] - LRPASSHOFS;
-
- /* Initialization of general parameters */
- gendata.outdata = NULL;
- gendata.scanbuf = NULL;
- gendata.curheadpos = 0;
- gendata.left = 0;
- gendata.right = 0;
- gendata.lastblack = 0;
- gendata.curvline = 0;
- gendata.firstline = 0;
- gendata.fullflag = FALSE;
- gendata.direction = LEFT;
- gendata.ileave = 0;
-
- gendata.bidirprint = (gendata.dev)->bidir;
- gendata.numpasses = (gendata.dev)->numpass;
-
-
- /* Set some parameters that depend on resolution and
- * printing mode. We calculate all at 600dpi (the native
- * resolution) and then correct later for different
- * resolution settings.
- */
- switch(gendata.rendermode)
- {
- /* In monochrome mode we try to use all 208 nozzles of
- * the black cartridge to speed up printing. But if we
- * are printing at 1200 dpi horizontal, only 192 nozzles
- * are available anyway (it seems an hardware limitation).
- * We print a full buffer at every pass, so the number of
- * lines in the buffer is the same as the number of nozzles
- * of the head.
- */
- case LXM3200_M:
- gendata.numblines = 208;
- gendata.numlines = 208;
- gendata.select = 0x10;
- if(gendata.xres == 1200)
- {
- gendata.numblines = 192;
- gendata.numlines = 192;
- gendata.select = 0x00;
- }
- break;
-
- /* In color or photo mode we must use 192 nozzles only in
- * the black cartridge, to cope with the color and photo
- * cartridges (which have 3 color pen of 64 nozzles each,
- * for a total of 192 nozzles). But the color pens are
- * vertically spaced and misaligned with respect to the
- * black pen. To solve this problem, we need a buffer which
- * is larger than 192 lines and then we print only the
- * proper "windows" from it. We choose to set the buffer
- * height to 256, which is the smallest power of two large
- * enough to hold all the needed data. We use a power of
- * two for speed, since in this way the modulo operation
- * in the inner loops (needed to take care of buffer rolling)
- * becomes a simple and much faster bitwise AND.
- */
- case LXM3200_P:
- case LXM3200_C:
- gendata.numblines = 256;
- gendata.numlines = 192;
- gendata.select = 0x00;
- break;
- }
-
- /* Correct the number of lines of the buffer to take care
- * of different vertical resolution modes. Since the buffer
- * does cover a constant vertical spacing, we must double the
- * number of lines at 1200dpi and half it at 300dpi, to take
- * into account the different thickness of the lines at the
- * three different vertical resolutions.
- */
- gendata.numblines = (gendata.numblines * 2) / gendata.yrmul;
-
- /* Now correct the "select" field to adjust the horizontal
- * motor speed depending on position. Meanwhile, if we are
- * at 1200 dpi, double the number of horizontal passes
- * because each stripe at 1200 dpi horizontal must be printed
- * in two passes.
- */
- switch(gendata.xres)
- {
- case 300:
- gendata.select |= 0x60;
- break;
-
- case 1200:
- gendata.select |= 0x40;
- gendata.numpasses *= 2;
- break;
- }
-
- /* Now store some useful info taken from the ghostscript
- * device structure to speed up access.
- */
- gendata.numcols = (gendata.dev)->width;
- gendata.numvlines = (gendata.dev)->height;
- gendata.lrhalign = (gendata.dev)->algnA;
- gendata.vertalign = (gendata.dev)->algnB;
- gendata.bwsep = (gendata.dev)->algnC;
- gendata.colsep = (gendata.dev)->algnD;
- gendata.goffset = (max(gendata.bwsep, gendata.colsep) * 2) / gendata.xrmul;
- gendata.numbytes = gendata.numcols + (2 * gendata.goffset);
- gendata.numrbytes = gdev_mem_bytes_per_scan_line(gendata.dev);
-
- /* Calculate number of lines in the page and initialize the
- * counter of the lines to eject. At the end of the printing,
- * to eject the paper sheet we must send to the printer a
- * command to move the paper forward. The amount to move is
- * the length of paper which is still inside the printer plus
- * two inches (the number is expressed in 1200ths of an inch,
- * so "plus two inches" means "add 2400").
- */
- gendata.linetoeject = gendata.numvlines * gendata.yrmul;
- gendata.linetoeject += 2400;
-
- /* Allocate memory for the buffers and
- * verify that the allocation was done properly.
- */
- gendata.scanbuf = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), gendata.numbytes, gendata.numblines,
- "lxm3200_print_page(scanbuf)");
-
- gendata.outdata = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), gendata.numbytes, 30,
- "lxm3200_print_page(outdata)");
-
- if(gendata.scanbuf == NULL ||
- gendata.outdata == NULL)
- {
- freeresources(pdev);
- return_error(gs_error_VMerror);
- }
-
- /* Send initialization sequence to the printer */
- if(gendata.modelprint==1) fwrite(z12_init_sequence, sizeof(z12_init_sequence), 1, prn_stream);
- else fwrite(init_sequence, sizeof(init_sequence), 1, prn_stream);
-
- /* Choose the right page printing routine
- * depending on the printing mode.
- */
- switch(gendata.rendermode)
- {
- case LXM3200_P:
- print_photo_page();
- break;
-
- case LXM3200_C:
- print_color_page();
- break;
-
- case LXM3200_M:
- default:
- print_mono_page();
- break;
- }
-
- /* Output the end-of-page epilogue */
- outputepilogue();
-
- /* Free the allocated resources */
- freeresources(pdev);
-
- /* Done. Bye bye, see you on next page. */
- return(0);
-}
-
-/* Function that Ghostscript calls to ask the driver
- * the value of its parameters. This function is based
- * on the equivalent from the HP850 driver (gdevcd8.c)
- * by Uli Wortmann.
- * I won't comment it because I haven't even tried
- * to understand this code... :)
- */
-private int
-lxm3200_get_params(gx_device *pdev, gs_param_list *plist)
-{
- int code;
-
- code = gdev_prn_get_params(pdev, plist);
-
- if(code < 0)return(code);
-
- code = param_write_int(plist, "algnA", &((lxm_device *)pdev)->algnA);
- if(code < 0)return(code);
-
- code = param_write_int(plist, "algnB", &((lxm_device *)pdev)->algnB);
- if(code < 0)return(code);
-
- code = param_write_int(plist, "algnC", &((lxm_device *)pdev)->algnC);
- if(code < 0)return(code);
-
- code = param_write_int(plist, "algnD", &((lxm_device *)pdev)->algnD);
- if(code < 0)return(code);
-
- code = param_write_int(plist, "bidir", &((lxm_device *)pdev)->bidir);
- if(code < 0)return(code);
-
- code = param_write_int(plist, "numpass", &((lxm_device *)pdev)->numpass);
- if(code < 0)return(code);
-
- code = param_write_int(plist, "mode", &((lxm_device *)pdev)->rendermode);
- if(code < 0)return(code);
-
- code = param_write_int(plist, "model", &((lxm_device *)pdev)->model);
- if(code < 0)return(code);
-
- code = param_write_int(plist, "z31m", &((lxm_device *)pdev)->z31m);
-
- return code;
-}
-
-/* Function that Ghostscript calls to let the driver
- * set the value of its parameters. This function is
- * based on the equivalent from the HP850 driver
- * (gdevcd8.c) by Uli Wortmann.
- * I won't comment it because I haven't even tried
- * to understand this code... :)
- */
-private int
-lxm3200_put_params(gx_device *pdev, gs_param_list *plist)
-{
- int algnA = ((lxm_device *)pdev)->algnA;
- int algnB = ((lxm_device *)pdev)->algnB;
- int algnC = ((lxm_device *)pdev)->algnC;
- int algnD = ((lxm_device *)pdev)->algnD;
- int bidir = ((lxm_device *)pdev)->bidir;
- int numpass = ((lxm_device *)pdev)->numpass;
- int mode = ((lxm_device *)pdev)->rendermode;
- int code = 0;
- int model = ((lxm_device *)pdev)->model; /* for model selection */
- int z31m = ((lxm_device *)pdev)->z31m; /* additional margin for the z31 */
-
- code = param_read_int(plist, "algnA", &algnA);
- if(code < 0)return(code);
- if(algnA < 0 || algnA > 30)
- param_signal_error(plist, "algnA", gs_error_rangecheck);
-
- code = param_read_int(plist, "algnB", &algnB);
- if(code < 0)return(code);
- if(algnB < 0 || algnB > 15)
- param_signal_error(plist, "algnB", gs_error_rangecheck);
-
- code = param_read_int(plist, "algnC", &algnC);
- if(code < 0)return(code);
- if(algnC < 0 || algnC > 30)
- param_signal_error(plist, "algnC", gs_error_rangecheck);
-
- code = param_read_int(plist, "algnD", &algnD);
- if(code < 0)return(code);
- if(algnD < 0 || algnD > 30)
- param_signal_error(plist, "algnD", gs_error_rangecheck);
-
- code = param_read_int(plist, "bidir", &bidir);
- if(code < 0)return(code);
- if(bidir != 0 && bidir != 1)
- param_signal_error(plist, "bidir", gs_error_rangecheck);
-
- code = param_read_int(plist, "numpass", &numpass);
- if(code < 0)return(code);
- if(numpass < 1 || numpass > 16)
- param_signal_error(plist, "numpass", gs_error_rangecheck);
-
- code = param_read_int(plist, "mode", &mode);
- if(code < 0)return(code);
- if(mode != LXM3200_M && mode != LXM3200_C && mode != LXM3200_P)
- param_signal_error(plist, "mode", gs_error_rangecheck);
-
- code = param_read_int(plist, "model", &model); /* asking for the model of printer: lxm3200 , Z12, Z31 */
- if(code < 0)return(code);
- if(model < 0 || model > 2 )
- param_signal_error(plist, "model", gs_error_rangecheck);
-
- code = param_read_int(plist, "z31m", &z31m); /* What additional margin for the Z31 */
- if(code < 0)return(code);
-
- code = gdev_prn_put_params(pdev, plist);
- if(code < 0)return code;
-
- ((lxm_device *)pdev)->algnA = algnA;
- ((lxm_device *)pdev)->algnB = algnB;
- ((lxm_device *)pdev)->algnC = algnC;
- ((lxm_device *)pdev)->algnD = algnD;
- ((lxm_device *)pdev)->bidir = bidir;
- ((lxm_device *)pdev)->numpass = numpass;
- ((lxm_device *)pdev)->rendermode = mode;
- ((lxm_device *)pdev)->model = model; /* Model selection: lxm3200, Z12, Z31. */
- ((lxm_device *)pdev)->z31m = z31m; /* Additional margin for the Z31 */
-
- /* Depending on the selected rendering mode, change the
- * driver's parameters that ghostscript needs for the
- * dithering. We need to do it here because the "get_params"
- * and "put_params" are the only routines in the driver that
- * ghostscript calls before using the dithering parameters.
- */
- switch(mode)
- {
- case LXM3200_M:
- pdev->color_info.num_components = 1;
- pdev->color_info.max_gray = 1;
- pdev->color_info.max_color = 0;
- pdev->color_info.dither_grays = 2;
- pdev->color_info.dither_colors = 0;
- break;
-
- case LXM3200_C:
- pdev->color_info.num_components = 3;
- pdev->color_info.max_gray = 1;
- pdev->color_info.max_color = 1;
- pdev->color_info.dither_grays = 2;
- pdev->color_info.dither_colors = 2;
- break;
-
- case LXM3200_P:
- pdev->color_info.num_components = 3;
- pdev->color_info.max_gray = 1;
- pdev->color_info.max_color = 2;
- pdev->color_info.dither_grays = 2;
- pdev->color_info.dither_colors = 3;
- break;
- }
-
- return 0;
-}
-
-
-/* --------- Internal routines --------- */
-
-/* Free the resources allocated by the driver */
-private void
-freeresources(gx_device *pdev)
-{
- if(gendata.scanbuf)
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)gendata.scanbuf, gendata.numbytes, gendata.numblines,
- "lxm3200:freeresources(scanbuf)");
-
- if(gendata.outdata)
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)gendata.outdata, gendata.numbytes, 30,
- "lxm3200:freeresources(outdata)");
-}
-
-/* Calculate the checksum of an escape sequence.
- * It is defined as the sum modulo 256 of the
- * six bytes following the escape character.
- *
- * data: pointer to the first of the 8 characters
- * of an escape sequence.
- */
-private byte
-calccheck8(byte *data)
-{
- int ck, i;
-
- ck = 0;
- for(i=1; i<7; i++)ck += data[i];
-
- return(ck);
-}
-
-/* Output the page epilogue. This procedure outputs
- * the escape sequence needed to eject the page and
- * take the printheads to the "park" position.
- */
-private void
-outputepilogue(void)
-{
- byte trailer[24];
- int pos;
-
- /* Page eject sequence */
- trailer[0] = 0x1b;
- trailer[1] = 0x22;
- trailer[2] = 0x80;
- trailer[3] = gendata.linetoeject >> 8;
- trailer[4] = gendata.linetoeject & 0xff;
- trailer[5] = 0x00;
- trailer[6] = 0x00;
- trailer[7] = calccheck8(trailer);
-
- /* Calculate the value we need to take the head back
- * to the park position. This is the current head position
- * if we printed the last stripe left-to-right, and the
- * current head position minus 168 (0xa8) if we printed the
- * last stripe right-to-left.
- */
- pos = gendata.curheadpos;
- if(gendata.bidirprint && gendata.direction == LEFT)pos -= 0xa8;
- if(pos < 0)pos = 0;
-
- /* Horizontal back sequence */
- trailer[8] = 0x1b;
- trailer[9] = 0x31;
- trailer[10] = 0x10;
- trailer[11] = pos >> 8;
- trailer[12] = pos & 0xff;
- trailer[13] = 0x00;
- trailer[14] = 0x00;
- trailer[15] = calccheck8(trailer+8);
-
- /* Reset sequence */
- trailer[16] = 0x1b;
- trailer[17] = 0x33;
- trailer[18] = 0x00;
- trailer[19] = 0x00;
- trailer[20] = 0x00;
- trailer[21] = 0x00;
- trailer[22] = 0x00;
- trailer[23] = 0x33;
-
- fwrite(trailer, 8, 3, gendata.stream);
-}
-
-/* Output a "page forward" escape sequence,
- * needed to move the paper forward some lines.
- *
- * skiprow: number of buffer lines to skip
- * vskip : fixed offset, in 1200ths of an inch
- */
-private void
-skiplines(int skiprow, int skipin)
-{
- byte escape[8];
- int vskip;
-
- /* The vertical skip command accepts a spacing expressed in
- * 1200ths of an inch, so we must convert lines to 1200ths
- * of an inch. After the conversion we sum an offset directly
- * expressed in 1200ths of an inch: this way we can use this
- * routine to skip both a certain amount of lines (which exact
- * spacing value depends on the vertical resolution) and a
- * fixed offset that we directly know in spacing units.
- */
- vskip = skiprow*gendata.yrmul + skipin;
-
- escape[0] = 0x1b;
- escape[1] = 0x23;
- escape[2] = 0x80;
- escape[3] = vskip >> 8;
- escape[4] = vskip & 0xff;
- escape[5] = 0x00;
- escape[6] = 0x00;
- escape[7] = calccheck8(escape);
-
- /* Adjust the number of lines still inside the printer */
- gendata.linetoeject -= vskip;
-
- fwrite(escape, 8, 1, gendata.stream);
-}
-
-/* Fill a stripe header with data.
- *
- * head: LEFT or RIGHT, chooses which head we are "feeding"
- * numcol: number of data columns in this stripe, including blank ones
- * firstcol: position of the first column in the stripe (the *very first*,
- * even if it's blank).
- * bytes: total number of bytes in the stripe, including directories
- * (but excluding the 24 bytes of the header).
- */
-private void
-fillheader(int head, int numcol, int firstcol, int bytes)
-{
- int len, offs1, startabs;
- int endabs, select, fwd;
- int back, nabspos, sep;
- byte *header;
-
- header = gendata.header;
-
- /* Correct the measures: firstcol and len need to
- * be in 1200ths of an inch.
- */
- firstcol *= gendata.xrmul;
- len = numcol * gendata.xrmul;
-
- /* Alter select to choose direction */
- select = gendata.select | (gendata.direction == LEFT ? 0x01 : 0x00);
-
- /* Calculate the proper horizontal offset */
- offs1 = hoffset[head][gendata.direction];
-
- /* Now calculate the correct separation depending on the
- * head type and adjust "select" to choose between left
- * or right head.
- */
- if(head == LEFT)
- {
- sep = (gendata.bwsep * 2) / gendata.xrmul;
- }
- else
- {
- sep = (gendata.colsep * 2) / gendata.xrmul;
- select |= 0x80;
- }
-
- /* Now calculate absolute starting and ending positions
- * of this stripe, taking into account the printing direction
- */
- startabs = firstcol + offs1;
-
- if(gendata.direction == LEFT)
- endabs = startabs + len;
- else
- endabs = startabs - len;
-
- /* And now, basing on current head position,
- * transform the absolute coordinates in a
- * relative movement of the head.
- * The formulas used for this are "black magic",
- * since this is a part of the protocol which is
- * still not well known. What you see here is an
- * empyrical formula devised by examination and
- * parameter fitting on the data output by the
- * Windows driver.
- */
- if(gendata.direction == LEFT)
- {
- nabspos = (((endabs - 3600) >> 3) & 0xfff0) + 9;
- fwd = nabspos - gendata.curheadpos;
- }
- else
- {
- if(endabs > 4816)
- nabspos = (((endabs - 4800) >> 3) & 0xfff0) + 9;
- else
- nabspos = (((endabs - 3600) >> 3) & 0xfff0) + 9;
- fwd = gendata.curheadpos - nabspos;
- }
-
- gendata.curheadpos += (gendata.direction == LEFT ? fwd : -fwd);
-
- /* If we are printing unidirectionally, calculate
- * the backward movement to return the printing head
- * at the beginning of this stripe.
- */
- back = 0;
- if(gendata.bidirprint == FALSE)
- {
- if(startabs > 4816)
- nabspos = ((startabs - 4800) >> 3) & 0xfff0;
- else
- nabspos = ((startabs - 3600) >> 3) & 0xfff0;
-
- if(gendata.direction == LEFT)
- back = gendata.curheadpos - nabspos;
- else
- back = nabspos - gendata.curheadpos;
- }
-
- gendata.curheadpos -= (gendata.direction == LEFT ? back : -back);
-
- /* First part of the header */
- header[0] = 0x1b;
- header[1] = 0x40;
- header[2] = select; /* Printing type flags */
- header[3] = numcol >> 8; /* MSB of the number of columns to print */
- header[4] = numcol & 0xff; /* LSB of the number of columns to print */
- header[5] = fwd >> 8; /* MSB of the relative forward head motion */
- header[6] = fwd & 0xff; /* LSB of the relative forward head motion */
- header[7] = calccheck8(&header[0]);
-
- /* Second part of the header */
- header[8] = 0x1b;
- header[9] = 0x42;
- header[10] = 0x00;
- if(gendata.modelprint==1) header[10] = 0x10; /* Lexmark Z12 protocol */
- header[11] = back >> 8; /* MSB of the relative backward head motion */
- header[12] = back & 0xff; /* LSB of the relative backward head motion */
- header[13] = 0x00; /* MSB of the relative downward head motion */
- header[14] = 0x00; /* LSB of the relative downward head motion */
- header[15] = calccheck8(&header[8]);
-
- /* Third (and last) part of the header */
- header[16] = 0x1b;
- header[17] = 0x43;
- header[18] = (bytes >> 16) & 0xff;
- header[19] = (bytes >> 8) & 0xff;
- header[20] = bytes & 0xff; /* LSB of the number of bytes in this stripe */
- header[21] = startabs >> 8; /* MSB of the starting column of this stripe */
- header[22] = startabs & 0xff; /* LSB of the starting column of this stripe */
- header[23] = calccheck8(&header[16]);
-
- /* Signal to other routines that the output buffer
- * is full and how many bytes it is long.
- */
- gendata.stripebytes = bytes;
- gendata.fullflag = TRUE;
-
- /* If bidirectional printing is in effect, change
- * the printing direction for the next stripe
- */
- if(gendata.bidirprint)
- gendata.direction = (gendata.direction == LEFT ? RIGHT : LEFT);
-}
-
-/* Set final information in the header and output all
- * the data passes. This routine is needed because the
- * actual values of two fields of the header (final
- * head position and number of vertical lines to reach
- * the next stripe) depend on the next stripe and are
- * therefore unknown when "fillheader" is called.
- *
- * vskip : number of lines to skip to reach next stripe
- * newhead: head used for the next stripe (LEFT or RIGHT)
- */
-private void
-finalizeheader(int vskip, int newhead)
-{
- int offs2, nstartabs, back, fwd;
- int habs, p, dir, endabs, col;
- int newstart, sep;
- byte *header;
-
- header = gendata.header;
-
- /* Check the printing direction this stripe
- * was originally intended for.
- */
- dir = (header[2] & 0x01 ? LEFT : RIGHT);
-
- /* Retrieve the horizontal offset for the next stripe */
- offs2 = hoffset[newhead][gendata.direction];
-
- /* Calculate the separation adjust in 1200ths of an inch */
- if(newhead == LEFT)
- sep = (gendata.bwsep * 2) / gendata.xrmul;
- else
- sep = (gendata.colsep * 2) / gendata.xrmul;
-
- /* Now calculate the correct starting column
- * of the next stripe
- */
- if(gendata.direction == LEFT)
- newstart = (gendata.left * gendata.xrmul) - sep;
- else
- newstart = (gendata.right * gendata.xrmul);
-
- vskip *= gendata.yrmul;
-
- /* Calculate absolute starting position of new stripe */
- nstartabs = newstart + offs2;
-
- /* Calculate absolute ending position of this stripe
- * by summing (with proper sign) the starting position
- * and the width.
- */
- endabs = header[21]*256 + header[22]; /* Starting position */
- col = (header[3]*256 + header[4]); /* Width in columns */
- col *= gendata.xrmul; /* Transformed in 1200ths of an inch */
-
- if(dir == LEFT)
- endabs += col; /* Printing left-to-right */
- else
- endabs -= col; /* Printing right-to-left */
-
- /* Correct head position neutralizing the effect
- * of the last issued head movement commands. The
- * head movement for this stripe needs to be
- * recalculated from scratch to take into account
- * the correct beginning position of the next stripe.
- */
- if(dir == LEFT)
- {
- gendata.curheadpos += header[11]*256 + header[12]; /* Back movement */
- gendata.curheadpos -= header[5]*256 + header[6]; /* Forward movement */
- }
- else
- {
- gendata.curheadpos -= header[11]*256 + header[12]; /* Back movement */
- gendata.curheadpos += header[5]*256 + header[6]; /* Forward movement */
- }
-
- /* We use a convention of passing a negative value for
- * "newhead" to mean that this is the last stripe of the
- * sheet, so we don't need to care for the next stripe.
- */
- if(newhead < 0)
- {
- /* Last stripe: we only need to calculate proper forward
- * motion to print all the current stripe.
- */
- fwd = ((header[5]*256 + header[6]) & 0xfff0) + 9;
- }
- else
- {
- /* This is not the last stripe, so we need to calculate
- * the forward (in the printing direction) movement
- * that will take the printing head at the end of the
- * current stripe or at the beginning of the next,
- * whichever is farther. Note that we are always
- * talking relative to printing direction, so we must
- * take into proper account if we are printing from left
- * to right or from right to left.
- */
- if(dir == LEFT)
- {
- p = max(endabs, nstartabs);
- habs = (((p - 3600) >> 3) & 0xfff0) + 9;
- fwd = habs - gendata.curheadpos;
-
- /* part for the Lexmark Z31!!! */
- if(gendata.modelprint==2) fwd += gendata.z31margin;
-
- }
- else
- {
- p = min(endabs, nstartabs);
- if(p > 4816)
- habs = (((p - 4800) >> 3) & 0xfff0);
- else
- habs = (((p - 3600) >> 3) & 0xfff0);
- fwd = gendata.curheadpos - habs;
- }
- }
-
- /* Now update the current head position to take into
- * account the forward movement just computed
- */
- gendata.curheadpos += (dir == LEFT ? fwd : -fwd);
-
- /* Now calculate the value of the needed backward movement
- * to poisition the head correctly for the start of the
- * next stripe.
- */
- if(newhead < 0 || gendata.bidirprint)
- {
- /* If this is the last stripe of the page,
- * there is no need to take back the head:
- * it will be done by the parking command.
- * Or if we are printing bidirectionally,
- * the forward command has taken the head to
- * the correct position, so no need to move it.
- */
- back = 0;
- }
- else
- {
- /* Calculate the right backward movement basing
- * on the start of the next stripe.
- */
- if(nstartabs > 4856)
- habs = ((nstartabs - 4840) >> 3) & 0xfff0;
- else
- habs = ((nstartabs - 3600) >> 3) & 0xfff0;
-
- back = gendata.curheadpos - habs;
-
- /* If the next stripe starts at the right
- * of this one, "back" will be too small or
- * negative, so correct it.
- * It appears that 16 is the minimum allowable
- * backward movement that does not make the 3200
- * misbehave in the next stripe. This does not hold
- * if we are changing printing direction (in such a
- * case backward movement may be zero). This means
- * we are moving the head a little more than needed,
- * but it seems unavoidable.
- */
- if(back < 16)back = 16;
- }
-
- /* Lastly, update the current head position with the
- * backward movement just calculated.
- */
- gendata.curheadpos -= (dir == LEFT ? back : -back);
-
- /* Modify first part of the header */
- header[5] = fwd >> 8;
- header[6] = fwd & 0xff;
- header[7] = calccheck8(&header[0]);
-
- /* Modify second part of the header */
- header[8] = 0x1b;
- header[9] = 0x42;
- header[10] = 0x00;
- if(gendata.modelprint==1) header[10] = 0x10; /* Lexmark Z12 protocol */
- header[11] = back >> 8; /* MSB of the relative backward head motion */
- header[12] = back & 0xff; /* LSB of the relative backward head motion */
- header[13] = vskip >> 8; /* MSB of the relative downward head motion */
- header[14] = vskip & 0xff; /* LSB of the relative downward head motion */
- header[15] = calccheck8(&header[8]);
-
- /* Now output the data, signalling that the output
- * buffer is now empty.
- */
- fwrite(header, 3, 8, gendata.stream);
- fwrite(gendata.outdata, gendata.stripebytes, 1, gendata.stream);
- gendata.fullflag = FALSE;
-}
-
-/* Convert a buffer data stream into
- * directory/data representation, using the
- * shortest coding (either direct or RLE)
- *
- * head : head we are printing with (left or right).
- * numcols : number of columns in the buffer.
- * firstcol: first column to print.
- */
-private void
-convbuf(int head, int numcols, int firstcol)
-{
- byte *read, *write;
- int x, i, c, p, q, cnt, rle, std;
- int nby, ofs, dts0, dtr0, dtr1;
- int bytes;
-
- /* Initialize the pointers. We use the same buffer
- * for both input and output (we can do it because
- * the output data is at most as long as the input).
- * Note that the encode routines skipped 4 bytes at
- * each column to make room for the directory word.
- */
- read = gendata.outdata + 4;
- write = gendata.outdata;
-
- /* Set the parameters that will be used to create the directory and
- * to access the data. These parameters define the structure of the
- * directory word (32 bit) and depend on the number of nozzles that
- * are used. Note that the directory bitfield is initialized to all
- * ones (but read below for further info) because it works in negative
- * logic (i.e. a change is marked by a zero bit).
- * Below, nby is the number of bytes needed in the input data to map
- * a column (each nozzle is 1 bit, so 208 nozzles are 26 bytes and
- * 192 nozzles are 24 bytes). Ofs is the number of the first bit of
- * the directory bitfield in the directory word (with 208 nozzles we
- * need 26 bits, from 6 to 31, with 192 nozzles we need 24 bits, from
- * 8 to 31). The other three parameters are the values needed to
- * initialize the directory word properly: the key is the first two
- * bits, which must be "10" for a directly encoded stripe and "01" for
- * a RLE encoded one. In the lexmark directory, each bit represents a
- * group of 8 nozzles: in a directly encoded stripe if the bit is "1"
- * it means none of the nozzles in the group are used, if it is a "0"
- * it means at least one is used and we need to append a data byte to
- * define the exact usage pattern. So, for direct encoded stripes we
- * start with the first two bits set to "10" and all the directory
- * bitfield set to "1" (we will unset to "0" only the needed bits in
- * the encoding loop). If we are using RLE encoding, each "0" bits
- * means that there is a data byte that defines a pattern for the
- * group of 8 nozzles associated to that bit, and an "1" means that
- * the pattern for the associated group of nozzles is the same as the
- * previous group. This means that for RLE encoded stripes we start the
- * directory word with two bits set to "01" and then initialize to "1"
- * all the directory bitfield, except the first one which must be 0
- * because we must have at least one data byte to define the initial
- * pattern that will be eventually repeated.
- */
- if(gendata.numlines == 208)
- {
- nby = 26;
- ofs = 6;
- dts0 = 0x83;
- dtr0 = 0x41;
- dtr1 = 0xff;
- }
- else
- {
- nby = 24;
- ofs = 8;
- dts0 = 0x80;
- dtr0 = 0x40;
- dtr1 = 0x7f;
- }
-
- /* The variable "bytes" will contain the total
- * number of output bytes in the data stripe.
- */
- bytes = 0;
-
- /* For all the columns in the stripe */
- for(x = 0; x < numcols; x++)
- {
- /* Calculate which representation is smaller by counting
- * the number of non zero data bytes for the direct encoding
- * and the number of changes between data bytes for the RLE.
- * At the end we have in "std" the length of the output data
- * if encoded with standard encoding, and in "rle" the length
- * of the output data if encoded with RLE.
- */
- rle = 1;
- c = read[0];
- std = (c ? 1 : 0);
- for(i=1; i<nby; i++)
- {
- if((p = read[i]))std++;
- if(p != c)
- {
- rle++;
- c = read[i];
- }
- }
-
- /* Now initialize the last two bytes in the directory
- * word. These always belong to the directory bitfield
- * and must be set to all ones.
- */
- write[2] = 0xff;
- write[3] = 0xff;
-
- /* And now encode the column, using the shortest encoding.
- * If the two encodings are of equal length we prefer the
- * standard encoding to the RLE one. No real reason for
- * this: it could have been done the other way, but it
- * seems the Windows driver does this way as well...
- */
- if(std > rle)
- {
- /* Run-length encoding */
-
- write[0] = dtr0;
- write[1] = dtr1;
-
- p = read[0];
- write[4] = p;
- cnt = 5;
- q = ofs + 1;
-
- for(i=1; i<nby; i++)
- {
- if(read[i] != p)
- {
- p = read[i];
- write[cnt] = p;
- write[q>>3] &= ibits[q & 7];
- cnt++;
- }
- q++;
- }
- }
- else
- {
- /* Standard encoding */
-
- write[0] = dts0;
- write[1] = 0xff;
-
- cnt = 4;
- q = ofs;
-
- for(i=0; i<nby; i++)
- {
- p = read[i];
- if(p)
- {
- write[cnt] = p;
- write[q>>3] &= ibits[q & 7];
- cnt++;
- }
- q++;
- }
- }
-
- /* Update the counters and pointers. Note that when
- * we are here "cnt" is the number of bytes that we
- * have actually output, including the directory word.
- */
- read += (nby + 4);
- write += cnt;
- bytes += cnt;
- }
-
- fillheader(head, numcols, firstcol, bytes);
-}
-
-/* This routine takes one full buffer of data and
- * prints the black part, which of course is the only
- * one if we are printing in monochrome mode.
- */
-private void
-encode_bw_buf(void)
-{
- int left, right, x, y, nn, mod;
- int nxp, yy, numcols, incr;
- int dy, dy2, csep, pass, f1;
- int f2, start, s1, s2, yincr;
- int q, mask, lines;
- byte *scan, *data;
-
- /* Set some parameters that depend on resolution and are
- * used in the inner loop to select lines to print.
- * We basically encode all the even nozzles in a loop and
- * all the odd nozzles in another loop. The values of s1
- * and s2 are the starting offset in the line buffer for
- * the first and second loop, and yincr is the number of lines
- * in the buffer we move on at each cycle.
- */
- switch(gendata.yres)
- {
- /* At 300 dpi we use only one nozzle column, and
- * each line in the buffer is printed. So both offsets
- * are zero (only one is used, actually) and yincr is 1.
- * The mask is set to 127 because the buffer is 128 lines.
- */
- case 300:
- yincr = 1;
- s1 = 0;
- s2 = 0;
- mask = 127;
- break;
-
- /* At 600 dpi we use both nozzle columns: each row goes
- * alternatively to the left or right nozzle column. So
- * the even offset is zero, the odd offset is 1 and the
- * increment is 2: in this way the even loop scans lines
- * 0, 2, 4, ... and the odd loop lines 1, 3, 5, ...
- * Here the buffer is 256 lines so mask is set to 255.
- */
- default:
- case 600:
- yincr = 2;
- s1 = 0;
- s2 = 1;
- mask = 255;
- break;
-
- /* At 1200 dpi we are printing two interleaved passes. Each
- * nozzle column sees every fourth line in the buffer (so
- * yincr is 4) and the starting offset varies depending on
- * which interleaved pass we are doing.
- * During the first pass, even nozzles are used to print
- * lines 0, 4, 8, ... and odd nozzles are used to print
- * lines 2, 6, 10, ... while in the second pass the even
- * nozzles print lines 1, 5, 9, ... and the odd nozzles
- * print lines 3, 7, 11, ...
- * The buffer is 512 lines, so mask is set to 511 */
- case 1200:
- yincr = 4;
- s1 = (gendata.ileave ? 1 : 0);
- s2 = (gendata.ileave ? 3 : 2);
- mask = 511;
- break;
- }
-
- /* Now we must calculate the offset q from the beginning of
- * the buffer of the first line to print in this pass, and
- * the total number of lines to be printed. We print as many
- * lines as we can in a single pass, i.e. the value of "lines"
- * is simply the number of lines that at the current vertical
- * resolution fully cover the printing pen.
- * Note that in case of monochrome printing we print all
- * buffer lines, from first to last, so we also need to set
- * the mask to a neutral value because we don't use wrapping.
- */
- if(gendata.rendermode == LXM3200_M)
- {
- mask = 511;
- q = 0;
- lines = gendata.numblines;
- }
- else
- {
- q = gendata.firstline + valign[BLACKVALIGN];
- lines = (BWCOLPEN * 2) / gendata.yrmul;
- }
-
- /* Adjust the value of the nozzle column separation to the
- * horizontal resolution we are using now.
- */
- csep = (gendata.bwsep * 2) / gendata.xrmul;
-
- /* Here we calculate how many "real" passes we are doing.
- * A "real" pass is a pass where a full column is printed
- * and then some columns (maybe zero) are skipped before
- * printing another one. If we are at 1200 dpi horizontal
- * then we must use only one nozzle column at a time, so each
- * real pass comprises two subpasses, one where we print with
- * even nozzles only and another where we print with odd
- * nozzles only. So at 1200 dpi the "real" passes are half the
- * total number of passes. Another way of looking at it: the
- * "nxp" variable holds the separation, in columns, between two
- * dot columns printed in the same head sweep.
- */
- nxp = gendata.numpasses;
- if(gendata.xres == 1200)nxp /= 2;
-
- /* Now calculate the byte increments for the *output* data
- * buffer (i.e. the encoded buffer). The first variable,
- * dy, is the number of bytes taken by a single data burst
- * (both even and odd nozzle columns). The second variable,
- * dy2, tells how many bytes we must skip from one column
- * to the other (if we are printing multipass we skip some
- * columns that will be printed in subsequent passes).
- */
- dy = (gendata.numlines / 8) + 4;
- dy2 = dy * nxp;
-
- /* Calculate the starting and ending horizontal positions for
- * this head pass. There are the margins corrected to take
- * into account the displacement between the odd and even
- * nozzle columns (csep). Moreover we start "csep" pixels
- * before the margin to give the head a little more room to
- * accelerate properly (not sure if this really works, but it
- * doesn't cost much, so I've left it in).
- */
- if(gendata.direction == LEFT)
- {
- left = gendata.left - 2*csep;
- right = gendata.right + csep;
- }
- else
- {
- left = gendata.left - csep;
- right = gendata.right + 2*csep;
- }
-
- /* Number of columns in a full row */
- numcols = right - left;
-
- /* Calculate the last pixel of the first pass of the
- * stripe. If we are printing bidirectionally, this
- * will be the base to calculate the start of the
- * passes printed right-to-left.
- */
- mod = numcols - (numcols % nxp);
-
- /* f1 and f2 are two flags that define which nozzle columns
- * we are using in this stripe, f1 for the even nozzle column
- * and f2 for the odd nozzle column: if they are zero that
- * nozzle column is not used in this pass.
- */
- f1 = 1;
- f2 = 1;
- if(gendata.yres == 300)
- {
- /* At 300 dpi we use only one nozzle column. As of now this
- * is always the even one, but maybe it could be tried to
- * alternate between columns at each pass, to improve the
- * output quality.
- */
- f1 = 1;
- f2 = 0;
- }
-
- /* Now start the passes to fill all the stripe */
- for(pass = 0; pass < gendata.numpasses; pass++)
- {
- /* If there is data in the buffer which has not been
- * sent to the printer yet, send it now.
- */
- if(gendata.fullflag)
- {
- fwrite(gendata.header, 3, 8, gendata.stream);
- fwrite(gendata.outdata, gendata.stripebytes, 1, gendata.stream);
- gendata.fullflag = FALSE;
- }
-
- /* Clear the output buffer to avoid problems with the bitwise
- * operations we will do later on.
- */
- memset(gendata.outdata, 0, gendata.numbytes * 30);
-
- /* Calculate standard increments, starting column
- * and start of output data. They will be corrected
- * later for 1200dpi or right-to-left printing direction.
- */
- incr = nxp;
- start = left + pass;
- data = gendata.outdata + (pass*dy) + 4;
-
- /* It appears that at 1200dpi, in addition of not being able
- * to use 208 nozzles mode for the black cartridge, the Lexmark
- * 3200 cannot print at full rate with all the 192 useable nozzles.
- * Maybe the reason is that the data rate of 1200dpi horizontal
- * resolution exceeds the mechanical/thermal limits of the heads.
- * So if we are printing at 1200dpi we need to use alternatively
- * only odd or even numbered nozzles, for each printed column, to
- * half the data rate towards the head.
- * This obviously means that, at 1200dpi horizontal, a minimum of
- * two passes are required to print each stripe. Since if we are
- * printing at 1200dpi vertical we need two interlaced passes, a
- * minimum grand total of 4 passes are needed to print one full
- * 1200x1200 dpi stripe with the Lexmark 3200.
- */
- if(gendata.xres == 1200)
- {
- f1 = pass & 1;
- f2 = 1 - f1;
-
- start = left + (pass/2);
- data = gendata.outdata + ((pass/2)*dy) + 4;
- }
-
- /* If printing right-to-left we need to present data
- * to the printer in that direction, inverting the
- * normal flow of data.
- */
- if(gendata.direction == RIGHT)
- {
- incr = -nxp;
- start += mod;
- }
-
- /* Start column scanning */
- x = start;
-
- /* Now we split the behaviour depending on the printing
- * direction. To be honest, the inner loops are almost
- * identical between left-to-right and right-to-left
- * directions. The only difference is where is computed
- * the contribute of the nozzle columns separation ("csep"),
- * but having the "if" outside the loop it's somehow better.
- */
- if(gendata.direction == LEFT)
- {
- /* For all the columns in this pass */
- for(nn = 0; nn < numcols; nn += nxp)
- {
- /* Encode the even numbered nozzles */
- if((x >= 0) && f1)
- {
- scan = gendata.scanbuf + x;
- yy = 0;
- for(y = s1; y < lines; y += yincr)
- {
- if(scan[((y+q) & mask) * gendata.numbytes] & BLACK)
- data[yy/8] |= bits[yy&7];
- yy += 2;
- }
- }
-
- /* Encode the odd numbered nozzles */
- if(((x+csep) < gendata.numbytes) && f2)
- {
- scan = gendata.scanbuf + x + csep;
- yy = 1;
- for(y = s2; y < lines; y += yincr)
- {
- if(scan[((y+q) & mask) * gendata.numbytes] & BLACK)
- data[yy/8] |= bits[yy&7];
- yy += 2;
- }
- }
-
- /* If we are in 1200dpi horizontal resolution,
- * alternate between nozzle columns to avoid
- * overstressing the printing head.
- */
- if(gendata.xres == 1200)
- {
- f1 = 1 - f1;
- f2 = 1 - f2;
- }
-
- /* Adjust data pointers */
- data += dy2;
- x += incr;
- }
- }
- else /* direction == RIGHT */
- {
- /* For all the columns in this pass */
- for(nn = 0; nn < numcols; nn += nxp)
- {
- /* Encode the odd numbered nozzles */
- if((x < gendata.numbytes) && f1)
- {
- scan = gendata.scanbuf + x;
- yy = 1;
- for(y = s1; y < lines; y += yincr)
- {
- if(scan[((y+q) & mask) * gendata.numbytes] & BLACK)
- data[yy/8] |= bits[yy&7];
- yy += 2;
- }
- }
-
- /* Encode the even numbered nozzles */
- if(((x-csep) >= 0) && f2)
- {
- scan = gendata.scanbuf + x - csep;
- yy = 0;
- for(y = s2; y < lines; y += yincr)
- {
- if(scan[((y+q) & mask)*gendata.numbytes] & BLACK)
- data[yy/8] |= bits[yy&7];
- yy += 2;
- }
- }
-
- /* If we are in 1200dpi horizontal resolution,
- * alternate between nozzle columns to avoid
- * overstressing the printing head.
- */
- if(gendata.xres == 1200)
- {
- f1 = 1 - f1;
- f2 = 1 - f2;
- }
-
- /* Adjust data pointers */
- data += dy2;
- x += incr;
- }
- }
-
- /* Convert the buffer to the shortest output format.
- * Which is the first column of the output depends
- * on the printing direction: it will be the left
- * margin if we are printing left to right or the
- * right margin if we are printing right to left.
- */
- if(gendata.direction == LEFT)
- convbuf(LEFT, numcols, left);
- else
- convbuf(LEFT, numcols, right);
- }
-}
-
-/* This routine is the equivalent of encode_bw_buf() but
- * for color or photo cartridge. Since this routine is
- * heavily based on the B/W one, the comments here will
- * be somewhat less esaurient. Please have a look at
- * encode_bw_buf() to understand better how this routine
- * works: I will only pinpoint the differences between this
- * routine and encode_bw_buf().
- *
- * head: the head we are calculating the buffer for. It will
- * be LEFT for a photo cartridge or RIGHT for a color one.
- */
-private void
-encode_col_buf(int head)
-{
- int left, right, x, y, nn, mod;
- int nxp, yy, numcols, incr;
- int dy, dy2, csep, pass, f1;
- int f2, start, s1, s2, yincr;
- int q, mask, k, align, lines;
- byte *scan, *data;
-
- /* Here there are two more parameters: mask and lines, that
- * for color cartridges are both dependent on vertical
- * resolution. Since the buffer is "rolling", i.e. it is
- * implemented as a circular array, all the coordinates of
- * the buffer lines must be taken modulo the buffer length.
- * We choose a buffer length that is a power of two to be
- * able to turn the modulo operation into a bitwise AND, so
- * we need to set "mask" to the correct value for the AND.
- * Another difference is that "lines", i.e. the number of
- * lines to print in each pass, is based on the height of a
- * color pen. Since there are three color pens in each cartridge,
- * each color pen is treated separately to fully cover the
- * printing head.
- */
- switch(gendata.yres)
- {
- case 300:
- yincr = 1;
- s1 = 0;
- s2 = 0;
- mask = 127;
- lines = COLORPEN/2;
- break;
-
- default:
- case 600:
- yincr = 2;
- s1 = 0;
- s2 = 1;
- mask = 255;
- lines = COLORPEN;
- break;
-
- case 1200:
- yincr = 4;
- s1 = (gendata.ileave ? 1 : 0);
- s2 = (gendata.ileave ? 3 : 2);
- mask = 511;
- lines = COLORPEN*2;
- break;
- }
-
- /* Choose the vertical alignment depending on the head.
- * This is needed to vertically align the color cartridge
- * with the photo or black cartridge.
- */
- if(head == LEFT)
- align = valign[PHOTOVALIGN];
- else
- align = valign[COLORVALIGN];
-
- /* All the stuff below is exactly the same as in
- * encode_bw_buf(), and is therefore commented there.
- */
-
- csep = (gendata.bwsep * 2) / gendata.xrmul;
- nxp = gendata.numpasses;
- if(gendata.xres == 1200)nxp /= 2;
-
- dy = (gendata.numlines / 8) + 4;
- dy2 = dy * nxp;
-
- if(gendata.direction == LEFT)
- {
- left = gendata.left - 2*csep;
- right = gendata.right + csep;
- }
- else
- {
- left = gendata.left - csep;
- right = gendata.right + 2*csep;
- }
-
- numcols = right - left;
- mod = numcols - (numcols % nxp);
-
- f1 = 1;
- f2 = 1;
- if(gendata.yres == 300)
- {
- f1 = 1;
- f2 = 0;
- }
-
- /* For all passes */
- for(pass = 0; pass < gendata.numpasses; pass++)
- {
- /* If there is data in the buffer which has not been
- * sent to the printer yet, do it now.
- */
- if(gendata.fullflag)
- {
- fwrite(gendata.header, 3, 8, gendata.stream);
- fwrite(gendata.outdata, gendata.stripebytes, 1, gendata.stream);
- gendata.fullflag = FALSE;
- }
-
- /* All the stuff below is exactly the same as in
- * encode_bw_buf(), and is therefore commented there.
- */
-
- memset(gendata.outdata, 0, gendata.numbytes * 30);
-
- incr = nxp;
- start = left + pass;
- data = gendata.outdata + (pass*dy) + 4;
-
- if(gendata.xres == 1200)
- {
- f1 = pass & 1;
- f2 = 1 - f1;
-
- start = left + (pass/2);
- data = gendata.outdata + ((pass/2)*dy) + 4;
- }
-
- if(gendata.direction == RIGHT)
- {
- incr = -nxp;
- start += mod;
- }
-
- /* Start column scanning */
- x = start;
-
- if(gendata.direction == LEFT)
- {
- /* For all the columns */
- for(nn = 0; nn < numcols; nn += nxp)
- {
- /* Encode the even numbered nozzles */
- if((x >= 0) && f1)
- {
- scan = gendata.scanbuf + x;
- yy = 0;
-
- /* In color printing there is one more loop to scan
- * all three color pens. We have to do exactly the
- * same things for all pens: the only differences are
- * the color encoding bit we are testing and the offset
- * from the beginning of the buffer and the offset of the
- * output data. All of this is stored into arrays. The
- * "penofs" array stores the offset of the first line of
- * each pen in the raster buffer. The array "colmask" stores
- * the encoding bits for the color of each pen, and it
- * is bidimensional because pen masks are different between
- * a color cartridge (where pens are Cyan, Magenta, Yellow)
- * and a photo cartridge (where pens are LightCyan,
- * LightMagenta and Black).
- */
- for(k=0; k<3; k++)
- {
- q = gendata.firstline + align + penofs[k];
- for(y = s1; y < lines; y += yincr)
- {
- if(scan[((y+q) & mask) * gendata.numbytes] & colmask[head][k])
- data[yy/8] |= bits[yy&7];
- yy += 2;
- }
- }
- }
-
- /* Encode the odd numbered nozzles */
- if(((x+csep) < gendata.numbytes) && f2)
- {
- scan = gendata.scanbuf + x + csep;
- yy = 1;
- for(k=0; k<3; k++)
- {
- q = gendata.firstline + align + penofs[k];
- for(y = s2; y < lines; y += yincr)
- {
- if(scan[((y+q) & mask) * gendata.numbytes] & colmask[head][k])
- data[yy/8] |= bits[yy&7];
- yy += 2;
- }
- }
- }
-
- /* If we are in 1200dpi horizontal resolution,
- * alternate between nozzle columns to avoid
- * overstressing the printing head.
- */
- if(gendata.xres == 1200)
- {
- f1 = 1 - f1;
- f2 = 1 - f2;
- }
-
- /* Adjust data pointers */
- data += dy2;
- x += incr;
- }
- }
- else
- {
- /* For all the columns */
- for(nn = 0; nn < numcols; nn += nxp)
- {
- /* Encode the odd numbered nozzles */
- if((x < gendata.numbytes) && f1)
- {
- scan = gendata.scanbuf + x;
- yy = 1;
- for(k=0; k<3; k++)
- {
- q = gendata.firstline + align + penofs[k];
- for(y = s1; y < lines; y += yincr)
- {
- if(scan[((y+q) & mask) * gendata.numbytes] & colmask[head][k])
- data[yy/8] |= bits[yy&7];
- yy += 2;
- }
- }
- }
-
- /* Encode the even numbered nozzles */
- if(((x-csep) >= 0) && f2)
- {
- scan = gendata.scanbuf + x - csep;
- yy = 0;
- for(k=0; k<3; k++)
- {
- q = gendata.firstline + align + penofs[k];
- for(y = s2; y < lines; y += yincr)
- {
- if(scan[((y+q) & mask) * gendata.numbytes] & colmask[head][k])
- data[yy/8] |= bits[yy&7];
- yy += 2;
- }
- }
- }
-
- /* If we are in 1200dpi horizontal resolution,
- * alternate between nozzle columns to avoid
- * overstressing the printing head.
- */
- if(gendata.xres == 1200)
- {
- f1 = 1 - f1;
- f2 = 1 - f2;
- }
-
- /* Adjust data pointers */
- data += dy2;
- x += incr;
- }
- }
-
- if(gendata.direction == LEFT)
- convbuf(head, numcols, left);
- else
- convbuf(head, numcols, right);
- }
-}
-
-/* Fill monochrome buffer: this routine fills the buffer
- * with rasterized lines, skipping over vertical spacing
- * (i.e. completely blank lines). The routine is only
- * used in monochrome mode, where we print a full buffer
- * at each stripe. The color printing needs a different
- * routine which makes use of a circular buffer.
- *
- * vline: the line from which to start searching for data.
- */
-private int
-fill_mono_buffer(int vline)
-{
- byte *in_data, *data;
- int i, ret, ofs;
-
- /* Initialize the "data" pointer, that will be used to
- * scan all the lines in the buffer, and the "ofs" pointer
- * that will be used to mark the start of the "real" rasterized
- * data into the buffer (see below). To compensate for the offsets
- * caused by the horizontal spacing between nozzle columns on a
- * cartridge, the head must start before the horizontal margin, so
- * the buffer width is slightly bigger than the width of the
- * rasterized lines. The difference is the "guard offset", and the
- * variables gendata.numbytes and gendata.numrbytes hold respectively
- * the number of bytes in a buffer line and the number of bytes in a
- * rasterized scanline, while gendata.goffset contains the number of
- * bytes reserved to the guard offset on each side of the scanline.
- */
- data = gendata.scanbuf;
- ofs = gendata.goffset;
-
- /* Cycle until we have no more lines on the page */
- while(vline < gendata.numvlines)
- {
- /* Ask Ghostscript for one rasterized line */
- gdev_prn_get_bits((gx_device_printer *)gendata.dev,
- vline, data+ofs, &in_data);
-
- /* And check if it's all zero: if not, break out of
- * the loop. This nice trick with memcpy it's by Stephen
- * Taylor (if I'm not wrong...)
-
- */
- if(in_data[0] != 0 ||
- memcmp(in_data, in_data+1,gendata.numrbytes-1))break;
- vline++;
- }
-
- /* If we are here because no non-empty lines were found before
- * the end of the page, our work is over. Return to the caller
- * saying that this is the last buffer (LAST bit set) and it's
- * empty (no LHDATA or RHDATA bit set).
- */
- if(vline >= gendata.numvlines)return(LAST);
-
- /* This buffer contains at least one non-empty line.
- * Adjust the current vertical position and load the first
- * line into the buffer.
- */
- gendata.curvline = vline;
- memset(data, 0, gendata.numbytes);
- if(in_data != data+ofs)memcpy(data+ofs, in_data, gendata.numrbytes);
-
- vline++;
- data += gendata.numbytes;
-
- /* Now initialize the return value to LHDATA (since at least
- * one non-blank line was found, this buffer contains data, and
- * it is obviously left-head data because we are in monochromatic
- * mode and so we are printing with left head only).
- * After that, get as many rasterized lines as needed to fill the
- * buffer, checking if in the process we have reached the end of
- * the page.
- */
- ret = LHDATA;
- for(i=1; i<gendata.numblines; i++)
- {
- memset(data, 0, gendata.numbytes);
- if(vline > gendata.numvlines)
- {
- /* Ok, we are at the end of the page, so set the LAST bit
- * in the return value but don't exit the loop because we
- * need to make sure all remaining lines in the buffer will
- * be blanked (exiting now would leave them untouched from
- * the previous stripe). This is needed to avoid printing
- * random data under the bottom margin.
- */
- ret = LHDATA | LAST;
- }
- else
- {
- /* If we are not at the end of the page, copy one more
- * scanline into the buffer.
- */
- gdev_prn_get_bits((gx_device_printer *)gendata.dev,
- vline, data+ofs, &in_data);
- if(in_data != data+ofs)memcpy(data+ofs, in_data, gendata.numrbytes);
- }
-
- vline++;
- data += gendata.numbytes;
-
- }
-
- return(ret);
-}
-
-/* Fill the buffer with initial data.
- * This routine is used to load the first buffer at the
- * beginning of the page. If we are printing in monochromatic
- * mode, we just call fill_mono_buffer for the first line.
- * If we are printing in color mode, we have a problem to
- * solve: since the color pen are stacked vertically, we
- * need multiple head passes to print all colors on the
- * same line. So, to simplify all, we start with the paper
- * at a fixed vertical position, even if it's blank, and
- * then we go down in fixed increments, equal to the height
- * of a color pen. This means we check all buffers without
- * skipping over blank ones, but since we actually send the
- * printing commands to the printer only when there is something
- * to print, there is no speed impact.
- */
-private int
-init_buffer(void)
-{
- byte *in_data, *data;
- int i, ret, p1, p2, ofs;
-
- data = gendata.scanbuf;
- ofs = gendata.goffset;
-
- if(gendata.rendermode == LXM3200_M)return(fill_mono_buffer(0));
-
- /* We position the heads with the bottom color pen (the
- * yellow one in the color cartridge and the black one
- * in the photo cartridge) just covering the first lines
- * of the paper sheet. So the first buffer is divided in
- * two parts: "p1" is the number of lines above the top
- * border and "p2" the number of lines below.
- */
- p1 = 368 / gendata.yrmul;
- p2 = 144 / gendata.yrmul;
-
- /* Initialize the counters */
- gendata.curvline = -p1;
- gendata.lastblack = gendata.curvline - 1;
- data = gendata.scanbuf;
-
- /* Clear the lines of the buffer that correspond to
- * lines above the top margin: of course we don't
- * want to print anything on the air...
- */
- for(i=0; i<p1; i++)
- {
- memset(data, 0, gendata.numbytes);
- data += gendata.numbytes;
- }
-
- /* And now load the last part of the buffer.
- * Note that here we don't check for blank lines,
- * this will be cared for later.
- */
- for(i=0; i<p2; i++)
- {
- memset(data, 0, gendata.numbytes);
-
- if(i < gendata.numvlines)
- {
- gdev_prn_get_bits((gx_device_printer *)gendata.dev,
- i, data+ofs, &in_data);
- if(in_data != data+ofs)memcpy(data+ofs, in_data, gendata.numrbytes);
- }
-
- data += gendata.numbytes;
- }
-
- gendata.firstline = 0;
-
- /* Now check the return value. If by chance we are under
- * the bottom margin, add the LAST bit to the return value.
- * Of course, since this is the first buffer of the page,
- * it's not likely we will reach the bottom margin in
- * this pass. Anyway this is code that will be executed
- * only once per page, so better safe than sorry.
- */
- ret = (gendata.numvlines < p2 ? LAST : 0) | qualify_buffer();
-
- return(ret);
-}
-
-/* This function checks if the current buffer contains
- * data to be printed with the left or right head.
- * It assumes that we are printing in color mode, and it
- * is useful to minimize the number of needed passes.
- * When we are printing in monochrome mode we directly skip
- * over blank lines, so this routine is not needed.
- */
-private int
-qualify_buffer(void)
-{
- int i, j, k, ret;
- int rmsk, q, v1;
- int bpsz, cpsz;
- byte *data;
-
- ret = 0;
-
- /* Set variables which contains the size, in rows, of
- * each color pen and of the black pen in color mode,
- * adjusting for different resolution settings.
- * Also set the mask used to rollover the buffer.
- */
- cpsz = (COLORPEN * 2) / gendata.yrmul;
- bpsz = (BWCOLPEN * 2) / gendata.yrmul;
- rmsk = gendata.numblines - 1;
-
- /* Check the right head data, it is always a color cartridge */
- for(k=0; k<3 && ret==0; k++)
- {
- /* For each pen, scan all the bytes on each row of
- * the buffer that is covered by the current pen,
- * ORing together all the bits.
- */
- v1 = 0;
- q = gendata.firstline + valign[COLORVALIGN] + penofs[k];
- for(i=0; i<cpsz; i++)
- {
- data = gendata.scanbuf + ((q+i) & rmsk)*gendata.numbytes;
- for(j=0; j<gendata.numbytes; j++)v1 |= *data++;
- }
- /* If the result of the OR has the proper color bit
- * set, it means that this buffer contains at least
- * one pixel of this pen, so we need a color pass.
- * Note that we exit as soon as we find a color bit
- * set, because if at least one color pen is used
- * in this buffer we need to do a color pass anyway,
- * so there's no need to check the other two pens.
- */
- if(v1 & colmask[RIGHT][k])ret |= RHDATA;
- }
-
- /* Check the left head data: it could be a black or
- * a photo cartridge, depending on the printing mode.
- */
- if(gendata.rendermode == LXM3200_C)
- {
- /* We are in standard color mode: the left cartridge
- * is a black cartridge used in 192 nozzles mode.
- * This is done exactly in the same way as above, but
- * without the outer loop because we have only one
- * color pen on this cartridge.
- */
- v1 = 0;
- q = gendata.firstline + valign[BLACKVALIGN];
- for(i=0; i<bpsz; i++)
- {
- data = gendata.scanbuf + ((q+i) & rmsk)*gendata.numbytes;
- for(j=0; j<gendata.numbytes; j++)v1 |= *data++;
- }
- if(v1 & BLACK)ret |= LHDATA;
- }
- else
- {
- /* If we are here we need to check for a photo cartridge
- * (this routine is never called in monochrome mode, so
- * if we are not in color mode we must be in photo mode).
- * This routine is identical to the color routine above.
- */
- for(k=0; k<3 && !(ret & LHDATA); k++)
- {
- v1 = 0;
- q = gendata.firstline + valign[PHOTOVALIGN] + penofs[k];
- for(i=0; i<cpsz; i++)
- {
- data = gendata.scanbuf + ((q+i) & rmsk)*gendata.numbytes;
- for(j=0; j<gendata.numbytes; j++)v1 |= *data++;
- }
- if(v1 & colmask[LEFT][k])ret |= LHDATA;
- }
- }
-
- return(ret);
-}
-
-/* This functions rolls the circular buffer by the
- * number of lines of one color pen, reading new
- * lines to refill the buffer.
- * In color mode we use a circular buffer because
- * we need to read the same lines more than once.
- * So when we are forwarding to the next pass we
- * simply read in the new lines and then update the
- * pointers, without actually moving data into memory.
- * The need to read the same data more than once arises
- * from the fact that the color pens are vertically
- * stacked, so we need to read a data line to lay down
- * the yellow component at the first pass. We need to
- * read it again at the next pass to lay down magenta,
- * and on the last pass we read the same line once more
- * to lay down the cyan component.
- */
-private int
-roll_buffer(void)
-{
- int i, ret, fline, vl, ofs;
- int cpen, cmask, lline;
- byte *data, *in_data;
-
- /* Adjust the size of the color pen and the
- * mask to take into account the current resolution
- */
- cpen = (COLORPEN * 2) / gendata.yrmul;
- cmask = (gendata.numblines) - 1;
-
- /* Calculate the line number corresponding to
- * the last buffer we can print before being
- * forced to eject the page. At 600dpi this
- * has been experimentally determined to be
- * 112 lines from the bottom of the page.
- */
- lline = gendata.numvlines - (224 / gendata.yrmul);
-
- /* Roll the buffer by advancing the first line
- * pointer by the height of one color pen.
- */
- fline = gendata.firstline;
- gendata.firstline = (fline + cpen) & cmask;
-
- /* Now calculate the pointer to the first "fresh"
- * line on the page, i.e. the first line we must
- * read into the buffer at this pass.
- */
- vl = gendata.curvline + cmask + 1;
-
- /* Take into account the guard offset */
- ofs = gendata.goffset;
-
- /* Initialize the return value and update the
- * current vertical position on the page, while
- * checking if we have reached the last printable
- * buffer.
- */
- ret = 0;
- gendata.curvline += cpen;
- if(gendata.curvline >= lline)ret = LAST;
-
- /* Now read "fresh" rasterized scanlines into the
- * input buffer.
- */
- for(i=0; i<cpen; i++)
- {
- data = gendata.scanbuf + ((fline + i) & cmask) * gendata.numbytes;
-
- memset(data, 0, gendata.numbytes);
- if(vl < gendata.numvlines)
- {
- gdev_prn_get_bits((gx_device_printer *)gendata.dev,
- vl, data+ofs, &in_data);
- if(in_data != data+ofs)memcpy(data+ofs, in_data, gendata.numrbytes);
- }
- vl++;
- }
-
- /* And test for the presence of actual data to print */
- ret |= qualify_buffer();
-
- return(ret);
-}
-
-/* Calculate the margins of one line, i.e. the leftmost
- * and the rightmost non-blank pixel on the line.
- *
- * data: the pointer to the data for this line
- * mask: the mask with the bits to check for: if the buffer
- * contains data which is not on the mask it will be
- * ignored (for the purpose of calculating margins)
- * left: calculated left margin (output variable)
- * right: calculated right margin (output variable)
- */
-private void
-calclinemargins(byte *data, int mask, int *left, int *right)
-{
- int l,r,num;
-
- num = gendata.numbytes - 1;
-
- l = 0;
- while((l <= num) && ((data[l] & mask) == 0))l++;
-
- r = num;
- while((r >= 0) && ((data[r] & mask) == 0))r--;
-
- *left = l;
- *right = r;
-}
-
-/* Calculate the margins of the whole buffer. The
- * calculation accounts separately for the data to
- * be printed with the left or with the right head,
- * so we can try to minimize the head movement even
- * on multiple passes.
- *
- * head: the code of the head we are calculating
- * margins for (LEFT or RIGHT)
- */
-private void
-calcbufmargins(int head)
-{
- int i, l1, r1, q, k;
- int mleft, mright, nl;
- int cpen, cmask, al;
- byte *scan;
-
- /* Adjust mask and pen height according to vertical resolution */
- cpen = (COLORPEN * 2) / gendata.yrmul;
- cmask = (gendata.numblines) - 1;
-
- /* Calculate margins for a color or photo cartridge */
- if(head == RIGHT || (gendata.rendermode == LXM3200_P))
- {
- /* Get correct vertical aligment */
- al = (head == LEFT ? PHOTOVALIGN : COLORVALIGN);
-
- q = gendata.firstline + valign[al];
-
- /* Calculate margins for first line, using those values
- * to initialize the max and min values.
- */
- scan = gendata.scanbuf + ((q+penofs[0]) & cmask)*gendata.numbytes;
- calclinemargins(scan, colmask[head][0], &mleft, &mright);
-
- /* And now scan all the remaining buffer. We scan according
- * to color pens, i.e. we calculate the margin on the rows
- * where magenta will be laid down taking into account magenta
- * pixels only, and this will be the magenta submargin. After
- * having done that for cyan and yellow as well, we take as the
- * global margin the smaller space that contains all the three
- * submargins.
- */
- for(k=0; k<3; k++)
- {
- for(i=0; i<cpen; i++)
- {
- scan = gendata.scanbuf + ((q+i+penofs[k]) & cmask)*gendata.numbytes;
- calclinemargins(scan, colmask[head][k], &l1, &r1);
- mleft = min(mleft, l1);
- mright = max(mright, r1);
- }
- }
-
- gendata.left = mleft;
- gendata.right = mright;
-
- return;
- }
-
- /* Calculate buffer margins for a black head. This is
- * almost exactly the same as before, but now we do
- * a single pass because we have only one black pen.
- */
- if(gendata.rendermode == LXM3200_M)
- {
- /* Monochromatic mode: we use 208 nozzles and
- * all the buffer, so the initial offset is zero.
- */
-
- scan = gendata.scanbuf;
- calclinemargins(scan, BLACK, &mleft, &mright);
-
- for(i=1; i<gendata.numblines; i++)
- {
- scan += gendata.numbytes;
- calclinemargins(scan, BLACK, &l1, &r1);
- mleft = min(mleft, l1);
- mright = max(mright, r1);
- }
-
- gendata.left = mleft;
- gendata.right = mright;
-
- return;
- }
-
- /* Standard color mode: we use 192 nozzles and must
- * take into account the vertical alignment.
- */
-
- nl = (gendata.numlines * 2) / gendata.yrmul;
- q = gendata.firstline + valign[BLACKVALIGN];
-
- scan = gendata.scanbuf + (q & cmask)*gendata.numbytes;
- calclinemargins(scan, BLACK, &mleft, &mright);
-
- for(i=1; i<nl; i++)
- {
- scan = gendata.scanbuf + ((q+i) & cmask)*gendata.numbytes;
- calclinemargins(scan, BLACK, &l1, &r1);
- mleft = min(mleft, l1);
- mright = max(mright, r1);
- }
- gendata.left = mleft;
- gendata.right = mright;
-}
-
-/*
- * This is the main routine that prints in
- * standard color mode.
- */
-private void
-print_color_page(void)
-{
- int res, lline, cmask;
- int i, j, nl, q, sk;
- byte *scan;
-
- /* Set the blackskip value depending on vertical resolution.
- * Since we have a black pen which is 3 times as high as
- * each color pen, we must print black only once every three
- * passes. So we take into account on which line we printed
- * the last black stripe and then we print another only if
- * the current line is at least "sk" lines after that.
- */
- sk = (BWCOLPEN * 2) / gendata.yrmul;
-
- /* Get the first buffer, and if it's empty continue
- * to skip forward without doing anything.
- */
- res = init_buffer();
- while(res == 0)res = roll_buffer();
-
- /* If this buffer happens to be the last one,
- * and empty as well, we had a blank page.
- * Just exit without ado.
- */
- if(res == LAST)return;
-
- /* This is the first non-blank line of the
- * page: issue a vertical skip command to
- * advance the paper to proper position.
- */
- skiplines(gendata.curvline, COLTOPSTART);
-
- /* "lline" holds the number of the first line of
- * the last buffer printed, either with left or
- * right head. This is needed to keep track of
- * how many lines we must skip from one stripe to
- * the next (if we encounter blank buffers we just
- * ignore them without moving the head, so we need
- * to do the proper vertical motion in one single
- * pass as soon as we encounter a non-blank buffer).
- */
- lline = gendata.curvline;
-
- /* Now depending on the data we have into the
- * buffer, print with the left head, right
- * head or both.
- * NOTE: this is the first buffer, and it needs
- * to be treated specially from the others.
- * The main difference is that we usually finalize
- * the buffer (issuing the print commands) at the
- * start of the next buffer, and not at the end of
- * the current one. This is because the Lexmark 3200
- * wants to know where to leave the printing head
- * at the end of each printing command, but we can't
- * know that until we start the next buffer so discovering
- * its margins and position. The solution is that we keep
- * "suspended" each buffer until we find another valid one.
- * The first buffer is special since there is no previous
- * buffer to finalize.
- * NOTE: I will comment the general case below, because
- * this code is simply a subset of the main loop.
- */
- switch(res)
- {
- case LHDATA:
- calcbufmargins(LEFT);
- gendata.ileave = 0;
- encode_bw_buf();
- gendata.lastblack = gendata.curvline + sk;
- lline = gendata.curvline;
- if(gendata.yres == 1200)
- {
- finalizeheader(1, LEFT);
- gendata.ileave = 1;
- encode_bw_buf();
- lline++;
- }
- break;
-
- case RHDATA:
- calcbufmargins(RIGHT);
- gendata.ileave = 0;
- encode_col_buf(RIGHT);
- lline = gendata.curvline;
- if(gendata.yres == 1200)
- {
- finalizeheader(1, RIGHT);
- gendata.ileave = 1;
- encode_col_buf(RIGHT);
- lline++;
- }
- break;
-
- case LHDATA|RHDATA:
- calcbufmargins(LEFT);
- gendata.ileave = 0;
- encode_bw_buf();
- gendata.lastblack = gendata.curvline + sk;
- calcbufmargins(RIGHT);
- finalizeheader(0, RIGHT);
- encode_col_buf(RIGHT);
- lline = gendata.curvline;
- if(gendata.yres == 1200)
- {
- calcbufmargins(LEFT);
- finalizeheader(1, LEFT);
- gendata.ileave = 1;
- encode_bw_buf();
- calcbufmargins(RIGHT);
- finalizeheader(0, RIGHT);
- encode_col_buf(RIGHT);
- lline++;
- }
- break;
- }
-
- /* Skip to next buffer */
- res = roll_buffer();
-
- /* Start the main loop. Here we do all the stuff required
- * to print buffers properly.
- */
- while(!(res & LAST))
- {
- /* If we haven't forwarded until "lastblack", do not
- * print black data because it has been printed on
- * previous passes. So, if we are below gendata.lastblack
- * clear the LHDATA flag to ignore left-head data.
- */
- if(gendata.curvline < gendata.lastblack)res &= ~LHDATA;
-
- /* And now start examining the buffer for data */
- switch(res)
- {
- /* We have left head data */
- case LHDATA:
-
- /* Calculate the margins of this buffer */
- calcbufmargins(LEFT);
-
- /* And then finalize the previous buffer. We can't
- * do this until now, because only now we know the
- * margins and vertical position of the next buffer,
- * which are required data to calculate the final
- * head position at the end of the previous buffer.
- */
- finalizeheader(gendata.curvline - lline, LEFT);
-
- /* Set interleave to zero (only meaningful in 1200dpi
- * vertical mode.
- */
- gendata.ileave = 0;
-
- /* Encode this buffer making it the current buffer */
- encode_bw_buf();
-
- /* Since we are printing a black buffer, update
- * gendata.lastblack to point to the first line
- * not covered by this black pass.
- */
- gendata.lastblack = gendata.curvline + sk;
-
- /* And update "lline" as well */
- lline = gendata.curvline;
-
- /* If we are printing at 1200 dpi vertical, we must
- * do one more pass, interleaved with the one before.
- */
- if(gendata.yres == 1200)
- {
- /* Finalize previous buffer, moving down 1/1200th
- * of an inch to properly interleave the two passes.
- * This is naive: we should do something here, because
- * this way two adjacent lines are printed by the same
- * nozzle, and there is the danger of having a slight
- * banding on output (no more than 1/600th of an inch,
- * but maybe noticeable).
- */
- finalizeheader(1, LEFT);
-
- /* Set interleave to 1 to start an interleaved pass */
- gendata.ileave = 1;
-
- /* Encode the buffer, and not finalize it: we leave
- * the buffer suspended until we find another buffer
- * to print.
- */
- encode_bw_buf();
-
- /* And adjust "lline" because to print the interleaved
- * pass we have moved down one line, so we need to
- * skip one line less to print the next buffer.
- */
- lline++;
- }
- break;
-
- /* Right head data. This is absolutely identical to the
- * code above for left head data, with two exceptions: all
- * the "LEFT" codes are changed to "RIGHT" and we don't
- * update gendata.lastblack because we are printing a
- * color stripe and not a black one.
- */
- case RHDATA:
- calcbufmargins(RIGHT);
- finalizeheader(gendata.curvline - lline, RIGHT);
- gendata.ileave = 0;
- encode_col_buf(RIGHT);
- lline = gendata.curvline;
- if(gendata.yres == 1200)
- {
- finalizeheader(1, RIGHT);
- gendata.ileave = 1;
- encode_col_buf(RIGHT);
- lline++;
- }
- break;
-
- /* We have both left and right head data (i.e. black and
- * color on the same stripe).
- * The code here is identical to the code for the left data
- * only and right data only cases above. But they are
- * interleaved, because since we can't take back the paper
- * once it's advanced, in case we are printing at 1200 dpi
- * vertical (and so we need two interlaced passes) we need
- * to do both the first black and the first color pass,
- * advance the paper and then do the second black and the
- * second color pass. Simply appendig the two code pieces
- * above would not work.
- */
- case LHDATA|RHDATA:
- calcbufmargins(LEFT);
- finalizeheader(gendata.curvline - lline, LEFT);
- gendata.ileave = 0;
- encode_bw_buf();
- gendata.lastblack = gendata.curvline + sk;
- calcbufmargins(RIGHT);
- finalizeheader(0, RIGHT);
- encode_col_buf(RIGHT);
- lline = gendata.curvline;
- if(gendata.yres == 1200)
- {
- calcbufmargins(LEFT);
- finalizeheader(1, LEFT);
- gendata.ileave = 1;
- encode_bw_buf();
- calcbufmargins(RIGHT);
- finalizeheader(0, RIGHT);
- encode_col_buf(RIGHT);
- lline++;
- }
- break;
- }
-
- /* Get another buffer */
- res = roll_buffer();
- }
-
- /* Last buffer. We treat this one specially as well,
- * because we don't have a subsequent buffer to print,
- * and so we need to finalize this buffers as soon as
- * possible.
- */
- res = qualify_buffer();
-
- /* Void the printed blacks. Since we are printing the
- * last buffer, it could happen that we have advanced
- * from the last time we printed a black stripe but
- * we are not yet at the point where another black
- * stripe would have been triggered. This would cause
- * an eventual black component in the last lines of
- * the page to be ignored.
- * To avoid the problem we do an unconditional black
- * pass, but we also must clear the black bits from the
- * lines we have already printed otherwise we would
- * print them twice.
- */
- if((res & LHDATA) && (gendata.curvline <= gendata.lastblack))
- {
- /* Find how many black lines we have yet printed
- * are still in the buffer
- */
- nl = gendata.lastblack - gendata.curvline;
-
- /* And now remove the BLACK bit from them */
-
- q = gendata.firstline + valign[BLACKVALIGN];
- cmask = (gendata.numblines) - 1;
- for(i=0; i<nl; i++)
- {
- scan = gendata.scanbuf + ((i+q) & cmask)*gendata.numbytes;
- for(j=0; j<gendata.numbytes; j++)
- {
- *scan &= ~BLACK;
- scan++;
- }
- }
- }
-
- /* Now we can print the last buffer as usual.
- * This is perfectly identical to the code
- * into the loop above: we are replicating it
- * only because we need the blanking code above
- * to be executed before this code.
- * Maybe there is a better way to do it...
- */
- switch(res)
- {
- case LHDATA:
- calcbufmargins(LEFT);
- finalizeheader(gendata.curvline - lline, LEFT);
- gendata.ileave = 0;
- encode_bw_buf();
- if(gendata.yres == 1200)
- {
- finalizeheader(1, LEFT);
- gendata.ileave = 1;
- encode_bw_buf();
- lline++;
- }
- break;
-
- case RHDATA:
- calcbufmargins(RIGHT);
- finalizeheader(gendata.curvline - lline, RIGHT);
- gendata.ileave = 0;
- encode_col_buf(RIGHT);
- if(gendata.yres == 1200)
- {
- finalizeheader(1, RIGHT);
- gendata.ileave = 1;
- encode_col_buf(RIGHT);
- lline++;
- }
- break;
-
- case LHDATA|RHDATA:
- calcbufmargins(LEFT);
- finalizeheader(gendata.curvline - lline, LEFT);
- gendata.ileave = 0;
- encode_bw_buf();
- calcbufmargins(RIGHT);
- finalizeheader(0, RIGHT);
- encode_col_buf(RIGHT);
- if(gendata.yres == 1200)
- {
- calcbufmargins(LEFT);
- finalizeheader(1, LEFT);
- gendata.ileave = 1;
- encode_bw_buf();
- calcbufmargins(RIGHT);
- finalizeheader(0, RIGHT);
- encode_col_buf(RIGHT);
- lline++;
- }
- break;
- }
-
- /* Now finalize the header using a value of "0" for
- * the vertical skip (no need to move down: the
- * paper is about to be ejected) and -1 for the
- * head (meaning: last buffer, don't care for the
- * final head position, it will be reset unconditionally
- * by the trailing sequence).
- */
- finalizeheader(0, -1);
-}
-
-/* This is the equivalent of print_color_page()
- * for monochrome output. It is almost identical,
- * only much simpler because now we are printing
- * with only one head.
- */
-private void
-print_mono_page(void)
-{
- int res, lline;
-
- /* Load the first buffer, skipping over
- * blank lines (if any).
- */
- res = init_buffer();
-
- /* If we happen to have a buffer which is LAST
- * and empty, we have a blank page to print:
- * just say goodbye.
- */
- if(res == LAST)return;
-
- /* Skip enough lines to reach the start of
- * the first stripe to print.
- */
- skiplines(gendata.curvline, BWTOPSTART);
- lline = gendata.curvline;
-
- /* And now print the first buffer. This part of
- * the code is identical to the LHDATA part in
- * print_color_page()
- */
- calcbufmargins(LEFT);
- gendata.ileave = 0;
- encode_bw_buf();
- lline = gendata.curvline;
- if(gendata.yres == 1200)
- {
- finalizeheader(1, LEFT);
- gendata.ileave = 1;
- encode_bw_buf();
- lline++;
- }
-
- /* And now load another buffer, starting to
- * look for it from the first line after the
- * pass we have just done.
- */
- res = fill_mono_buffer(gendata.curvline + gendata.numblines);
-
- /* Now loop. Even this code is identical
- * to the code above: the only difference
- * is that here we also finalize the previous
- * buffer before encoding this one. No need
- * to check if the buffer is empty because
- * a buffer is reported only if it's full
- * or if it is the last one, so if it's not
- * the last it must be full.
- */
- while(!(res & LAST))
- {
- calcbufmargins(LEFT);
- finalizeheader(gendata.curvline - lline, LEFT);
- gendata.ileave = 0;
- encode_bw_buf();
- lline = gendata.curvline;
- if(gendata.yres == 1200)
- {
- finalizeheader(1, LEFT);
- gendata.ileave = 1;
- encode_bw_buf();
- lline++;
- }
-
- /* Get another buffer, and so on */
- res = fill_mono_buffer(gendata.curvline + gendata.numblines);
- }
-
- /* Last buffer. This can be either empty or full.
- * If it's not empty (LHDATA bit set), print it.
- */
- if(res & LHDATA)
- {
- calcbufmargins(LEFT);
- finalizeheader(gendata.curvline - lline, LEFT);
- encode_bw_buf();
- if(gendata.yres == 1200)
- {
- finalizeheader(1, LEFT);
- gendata.ileave = 1;
- encode_bw_buf();
- lline++;
- }
- }
-
- /* Finalize the last buffer */
- finalizeheader(0, -1);
-}
-
-/* This is the equivalent of print_color_page()
- * for photoquality output. They are almost identical,
- * the only real difference is that we now are
- * printing with two identical heads, so there is
- * no need to care for different heights of the
- * printing pens (i.e.: no "lastblack" tricks).
- */
-private void
-print_photo_page(void)
-{
- int res, lline;
-
- res = init_buffer();
- while(res == 0)res = roll_buffer();
-
- if(res == LAST)return;
-
- skiplines(gendata.curvline, COLTOPSTART);
- lline = gendata.curvline;
-
- switch(res)
- {
- case LHDATA:
- calcbufmargins(LEFT);
- gendata.ileave = 0;
- encode_col_buf(LEFT);
- lline = gendata.curvline;
- if(gendata.yres == 1200)
- {
- finalizeheader(1, LEFT);
- gendata.ileave = 1;
- encode_col_buf(LEFT);
- lline++;
- }
- break;
-
- case RHDATA:
- calcbufmargins(RIGHT);
- gendata.ileave = 0;
- encode_col_buf(RIGHT);
- lline = gendata.curvline;
- if(gendata.yres == 1200)
- {
- finalizeheader(1, RIGHT);
- gendata.ileave = 1;
- encode_col_buf(RIGHT);
- lline++;
- }
- break;
-
- case LHDATA|RHDATA:
- calcbufmargins(LEFT);
- gendata.ileave = 0;
- encode_col_buf(LEFT);
- calcbufmargins(RIGHT);
- finalizeheader(0, RIGHT);
- encode_col_buf(RIGHT);
- lline = gendata.curvline;
- if(gendata.yres == 1200)
- {
- calcbufmargins(LEFT);
- finalizeheader(1, LEFT);
- gendata.ileave = 1;
- encode_col_buf(LEFT);
- calcbufmargins(RIGHT);
- finalizeheader(0, RIGHT);
- encode_col_buf(RIGHT);
- lline++;
- }
-
- break;
- }
-
- res = roll_buffer();
-
- while(!(res & LAST))
- {
- switch(res)
- {
- case LHDATA:
- calcbufmargins(LEFT);
- finalizeheader(gendata.curvline - lline, LEFT);
- gendata.ileave = 0;
- encode_col_buf(LEFT);
- lline = gendata.curvline;
- if(gendata.yres == 1200)
- {
- finalizeheader(1, LEFT);
- gendata.ileave = 1;
- encode_col_buf(LEFT);
- lline++;
- }
- break;
-
- case RHDATA:
- calcbufmargins(RIGHT);
- finalizeheader(gendata.curvline - lline, RIGHT);
- gendata.ileave = 0;
- encode_col_buf(RIGHT);
- lline = gendata.curvline;
- if(gendata.yres == 1200)
- {
- finalizeheader(1, RIGHT);
- gendata.ileave = 1;
- encode_col_buf(RIGHT);
- lline++;
- }
- break;
-
- case LHDATA|RHDATA:
- calcbufmargins(LEFT);
- finalizeheader(gendata.curvline - lline, LEFT);
- gendata.ileave = 0;
- encode_col_buf(LEFT);
- calcbufmargins(RIGHT);
- finalizeheader(0, RIGHT);
- encode_col_buf(RIGHT);
- lline = gendata.curvline;
- if(gendata.yres == 1200)
- {
- calcbufmargins(LEFT);
- finalizeheader(1, LEFT);
- gendata.ileave = 1;
- encode_col_buf(LEFT);
- calcbufmargins(RIGHT);
- finalizeheader(0, RIGHT);
- encode_col_buf(RIGHT);
- lline++;
- }
- break;
- }
-
- res = roll_buffer();
- }
-
- switch(res)
- {
- case LHDATA:
- calcbufmargins(LEFT);
- finalizeheader(gendata.curvline - lline, LEFT);
- gendata.ileave = 0;
- encode_col_buf(LEFT);
- if(gendata.yres == 1200)
- {
- finalizeheader(1, LEFT);
- gendata.ileave = 1;
- encode_col_buf(LEFT);
- lline++;
- }
-
- case RHDATA:
- calcbufmargins(RIGHT);
- finalizeheader(gendata.curvline - lline, RIGHT);
- gendata.ileave = 0;
- encode_col_buf(RIGHT);
- if(gendata.yres == 1200)
- {
- finalizeheader(1, RIGHT);
- gendata.ileave = 1;
- encode_col_buf(RIGHT);
- lline++;
- }
- break;
-
- case LHDATA|RHDATA:
- calcbufmargins(LEFT);
- finalizeheader(gendata.curvline - lline, LEFT);
- gendata.ileave = 0;
- encode_col_buf(LEFT);
- calcbufmargins(RIGHT);
- finalizeheader(0, RIGHT);
- encode_col_buf(RIGHT);
- if(gendata.yres == 1200)
- {
- calcbufmargins(LEFT);
- finalizeheader(1, LEFT);
- gendata.ileave = 1;
- encode_col_buf(LEFT);
- calcbufmargins(RIGHT);
- finalizeheader(0, RIGHT);
- encode_col_buf(RIGHT);
- lline++;
- }
- break;
- }
-
- finalizeheader(0, -1);
-}
diff --git a/gs/contrib/gdevlx50.c b/gs/contrib/gdevlx50.c
deleted file mode 100644
index 008a7cc37..000000000
--- a/gs/contrib/gdevlx50.c
+++ /dev/null
@@ -1,2732 +0,0 @@
-/*
-
- Copyright (C) 1999,2000 Peter B. West <pbwest@netscape.net>
- Portions Copyright (C) 1999 Aladdin Enterprises. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 U.S.A.
-
- This program may also be distributed as part of Aladdin Ghostscript,
- under the terms of the Aladdin Free Public License (the "License").
-
- Every copy of Aladdin Ghostscript must include a copy of the
- License, normally in a plain ASCII text file named PUBLIC. The
- License grants you the right to copy, modify and redistribute
- Aladdin Ghostscript, but only under certain conditions described in
- the License. Among other things, the License requires that the
- copyright notice and this notice be preserved on all copies.
-
- The author, Peter B. West, may be contacted via e-mail as
- pbwest@netscape.net
- or by post at
- 1/32 Bent Street
- Toowong, Brisbane,
- QLD, AUSTRALIA. 4066
-
- http://www.powerup.com.au/~pbwest
-
- Based on the driver for the Lexmark 5700, pioneered by
- Stephen Taylor setaylor@ma.ultranet.com staylor@cs.wpi.edu
- and on other pioneering work on the Lexmark 7000 by
- Henryk Paluch <paluch@bimbo.fjfi.cvut.cz>
-
- My heartfelt thanks to these blokes (i.e. guys, fellows).
-
- I should also like to thank Marija Svilans, through whom I discovered the
- work of Stephen and Henryk.
-
- My deepest praise and thanksgiving is reserved for the Author of all that
- is Good, Beautiful and True; my Lord and my God, Jesus Christ.
- "...all things were made through Him, and without Him was not anything
- made that was made." John 1:3
-
- Peter B. West pbwest@netscape.net
- (First release: Friday, 8th October, 1999.)
-
-*/
-
-/*$Id: gdevlx50.c,v 1.4 2002/07/30 18:53:21 easysw Exp $*/
-/*
- * Lexmark 5000 ink-jet printer driver for Ghostscript
- *
- * Black and colour cartridges supported - NO PHOTO CARTRIDGE support yet.
- *
- * defines the lx5000 device for printing in black-and-white and colour
- * at 600x600 (default), 1200x600 & 300x600 dpi, unidirectional.
- *
- * I use the command
- * gs -sOutputFile=/dev/lp0 -sDEVICE=lx5000 file.ps
- *
- * For black-only printing, use
- * gs -sOutputFile=/dev/lp0 -sDEVICE=lx5000 -dBitsPerPixel=1 file.ps
- * For compatibility with earlier versions of the code, the following
- * equivalent command is still supported.
- * gs -sOutputFile=/dev/lp0 -sDEVICE=lx5000 -dCMYK=false file.ps
- *
- * For 1200x600 printing, add the argument
- * -r1200x600
- * For 300x600 printing, add the argument
- * -r300x600
- *
- * A number of integer valued options are available.
- * These options are accessed as arguments of the form
- * -doptionname=optionvalue
- * Optionname Optionvalue range
- * BitsPerPixel 1 or 4
- * HeadSeparation 1 - 30
- * AlignA 0 - 30
- * AlignB 0 - 15
- * DryingTime 0 - 60
- *
- * BitsPerPixel currently only defines Black-only (1) or CMYK (4).
- * -dBitsPerPixel=4 is the default, and is eauivalent to the older form
- * -dCMYK=true
- * [ HeadSeparation varies from print-cartridge to print-cartridge and
- * 16 (the default) usually works fine. Stephen Taylor]
- *
- * AlignA is the horizontal alignment adjustment between the colour and
- * the black pens. This distance will vary with each pair of cartridges.
- *
- * AlignB is the vertical alignment distance between the colour and black
- * pens, and will also vary with each pair of cartridges.
- *
- * These values can be determined by running the alignment test; i.e,
- * by writing the printer data file blckalgn.out to the device.
- *
- * cat blckalgn.out >/dev/lp0
- *
- * This file is now part of the distribution for the driver.
- *
- * DryingTime is used to include a delay after printing a page, to allow the
- * page to dry to some extent before a subsequent page is printed and fed on
- * top of it. The range of values is 0-60.
- *
- * Ancilliary files:
- *
- * blckalgn.out As mentioned above,this is a file of printer commands
- * which will print the allignment page for the 5000.
- * Usage: cat blckalgn.out >/dev/lp0 (or appropriate printer device)
- *
- * blckhcln.out This is a file of printer commands to print the head
- * cleaning sequences.
- * Usage: cat blckhcln.out >/dev/lp0
- *
- * showcarts.out This is a file with the printer command to move the
- * printer cartridges into position for changing a
- * cartridge.
- * Usage: cat showcarts.out >/dev/lp0
- *
- * parkcarts.out This is a file with the printer command to move the
- * printer cartridges back to a parked position.
- * Usage: cat parkcarts.out >/dev/lp0
- *
- ================== K N O W N P R O B L E M S =======================
-
- PROBLEMS WITH 1200dpi horizontally
-
- This release was delayed by a bug in the production of black output
- (including black pixels in colour output) at 1200 Xdpi which
- manifested as the truncation of black swipes. In the RedHat test
- page, for example, the black background to the hat in the RedHat
- logo would abruptly halt, and no more of the black swipe would be
- printed. This was difficult to track down, because of the sheer
- size of the otuput file produced, and I ran out of time to find and
- fix it, although I was beginning to suspect a problem with the
- parallel driver. (It is always tempting to blame someone else.)
-
- When I recently returned to this problem, and tried the test print
- again on the unchanged binary, the bug had disappeared. In the
- meantime, I had added more physical memory to the system, and
- upgraded my 6.0 system to the 6.1 kernel (2.2.12), the 6.1 glibc
- version (2.1.2-11) and miscellaneous other 6.1 rpms.
-
- All was not lost, however. When I tested black-only printing at
- 1200dpi, the problem re-appeared. I have come to the conclusion
- that the 5000 simply cannot print at 1200dpi. I have tested this by
- printing solid bars of black at 600 and 1200 dpi. The 600dpi bar
- (all nozzles on for most of the width of the paper) produces the
- expected bar. Doing the same thing at 1200dpi produces movement of
- the printhead, but only the beginnings of a bar. Reducing the
- demand by printing from only every second nozzle get an intermediate
- result; the printing of the bar starts, but the nozzle lines trail
- off and dry up at various points in the traversal of the
- page. leaving an effect somthing like a tattered flag.
-
- How does the Windows driver do it? When printing a high density
- black-only page, the driver prints repeated overlays offset by half
- the height of the print swathe. Although I have not analysed these
- swathes in detail, I suspect that the function of this "halving" is
- simply to halve the printed pixel density, and thereby eliminate the
- problem discussed above.
-
- I have taken the "half-height" printing method for granted ever
- since I read a passing reference to it in the H-P Jounal articles on
- PPA, but I misunderstood it. I had thought that it was a way of
- performing a pseudo-doubling of the VERTICAL print density by
- overprinting adjacent pairs of lines. I was originally unaware that
- the 5000 supported native 1200x600 resolution. The problem, as far
- as I can determine, is that the 5000 does NOT support such printing.
- And if the printer is not going to support 1200dpi horizontally,
- neither am I.
-
- PROBLEMS WITH PRINTER DATA "JAMMING"
-
- I am experiencing an annoying problem with my 5000 on my AST Bravo
- P100 (yes, really) system under RedHat linux (6.0 with kernel
- 2.2.12-20 and glibc 2.1.2-11). The printer frequently fails to
- respond between print jobs, and sometimes between pages of the same
- print job. The only way to wake it up is to power cycle the
- printer. I have no idea why this is, of whether it is a general
- problem. I would appreciate all feedback on this problem.
-
- I have received feedback on this from Bob Clark
- <rlc@c317689-a.scllg1.pa.home.com>. He realised that the printer
- was queueing status data to be read from the same device. When this
- queue (which appears to be 64 bytes long) fills up, the printer
- stalls until it is reset (by a power cycle or by some as yet
- undiscovered escape sequence), or until the status data is read.
- That's the problem, but I do not have a clean solution yet.
-
- *=================================================
- Other requirements for compiling this driver:-
- =================================================
- The Ghostscript 6.0 source distribution, available from
- http://www.cs.wisc.edu/~ghost/aladdin/get600.html
-
- This includes reasonable html documentation on compiling GS.
-
- For users of RPM-based systems like Red Hat, I have a source RPM
- available which automates most of the process of compiling and
- installing Ghostscript. A discussion of the details of compiling
- and installing with this source RPM is available on my web page at
- <http://localhost:80/~pbw/ghostscript/compileGS.html>.
-
- The RPM includes a number of patch files which are applied to the
- pristine Ghostscript 6.0 sources. Users of non-RPM systems can
- extract these patches from the cpio archive which is also noted in
- the instructions.
-
- I have compiled and tested on a RedHat 6.0 i386 system, using
- egcs-2.91.66 19990314/Linux (egcs-1.1.2 release), so the relevant
- system-specific .mak file for me was unix-gcc.mak. The .mak file
- of general application is contrib.mak.
-
- */
-
-/************************************************************************
- * I N C L U D E F I L E S *
- ************************************************************************/
-#include <unistd.h>
-#include "gdevprn.h"
-#include "gsparam.h"
-#include "gsmalloc.h"
-
-/************************************************************************
- * R C S I D E N T S T R I N G S *
- ************************************************************************/
-const char Id[] =
- "$Id: gdevlx50.c,v 1.4 2002/07/30 18:53:21 easysw Exp $";
-const char RCSFile[] = "$RCSFile$";
-const char Revision[] = "$Revision: 1.4 $";
-const char Author[] =
- "Peter B. West pbwest@netscape.net\n"
- "$Author: easysw $\n";
-/*===========================================================================
- In gxdevice.h, the default width and height are expressed in 10ths of an
- inch. The conversion to mm will therefore, not be exact.
-
- These values are immediately converted to (x,y) pixels for storage in the
- width and height fields defined in the gx_device_common macro which is
- defined in gxdevcli.h. These in turn are converted to points and stored
- in the float MediaSize[2] array in gx_device_common by the
- std_device_part_2_ macro in gxdevice.h.
-
- The same macro stores the (x,y)dpi values in the float arrays
- HWResolution[2] and MarginsHWResolution[2].
-
- The macro prn_device_std_margins_body in gdevprn.h provides for X and Y
- offsets, as well as left, bottom, right and top margin values. X & Y are
- expressed in inches, as are all the other margin values.
-
- The X & Y offsets are known as Margins in gx_device_common. They provide
- the offset from the physical page corner (presumably top left, but may
- depend on the position of 0,0) to 0,0 in the device co-ordinate system.
- These values are converted by prn_device_std_margins_body into _negated_
- (x,y)dpi and stored in the float Margins[2] array.
-
- The left, bottom, right and top margin values are converted to points,
- and stored in the float HWMargins[4] array. Note that these values are
- defined relative to the physical paper, not the co-ordinate system. The
- Margins array is used to transform from physical page offsets to the
- device co-ordinate system.
-
- The implications of this are that the X & Y offset from page corner to
- 0,0 should be defined as accurately as possible. The other four margins
- should then be defined for a comprehensive coverage of the physical page.
- The definitions of paper size given in 10ths of an inch in gxdevice.h are
- a constraint.
-
- I presume that the intention of the transformation from 0,0 to
- the physical page is to leave the defined width and height mapped
- onto the physical page, and for the left and top margins to then restore
- those two dimensions of the accessible page. The result would be, if the
- values of X & Y offset precisely reversed the values of left and top
- HWMargins, that the top left hand printable point would be at device
- co-ordinates 0,0. The bottom and right HWMargins would then provide the
- necessary clipping of the co-ordinate system to keep output within the
- printable area.
-
- In fact, this is the way the x, Y offsets and the left and top margin
- values are set up in the default prn_device_std_body macro in gdevprn.h.
- In that macro, the X, Y offset values (expressed in inches) are simply
- copied from the left and top margins.
-
- What I have found with my 5000, is that it can print on virtually the
- whole area of the paper. This shows some remarkable paper handling cap-
- ability. This capability almost demands that 0,0 in the device co-ordin-
- ate system be _outside_ the paper area. It is. On my printer, the X
- offset from the physical page top left corner is 48 600ths of an inch -
- a little less than 6 points.
-
- The physical paper is a little narrower than 8.3 inches (210.82 mm), so
- the attempt to print right to the 8.3" margin falls short by about 16
- 600ths, or about 2 points. When 0,0 falls _within_ the page, the combin-
- ed margin clipping ensures that the driver will never issue printer com-
- mands which exceed the defined width and height of the page. What
- happens when 0,0 is outside the page? This implies, especially when the
- hardware is capable of printing to the edges of the paper, that the
- driver may issue print commands whose offsets exceed the defined width of
- the page, in order to print to the right edge of the paper. I don't know
- whether Ghostscript will allow this.
-
- Print width
- |<------------ 8.3" ----------->|
- | |
- | |
- +-------------- ~ --------------+
- |<-->| 2 pts
- | |<----- Paper width --------->|
- 6 pts |<---->| |
- +-------------- ~ ------------+
-
- In this case, the X offset is going to be negative, and the device co-
- ordinate value of X for the left edge of the paper is going to almost 50
- 600ths. It is a good idea to apply some restrictions on printing to the
- edge of the paper, so a HWMargin should be applied.
-
- The problem with setting the margins is this: Ghostscript knows where the
- top and left sides of the page are relative to 0,0, because it is spec-
- ifically informed of these values. It has no way of knowing where the
- bottom and right of the page are, except from the height and width values.
- These are only provided to an accuracy of a tenth of an inch, so the
- assumed right and bottom margins may fall short of or overrun the edge of
- the paper.
-
- In these circumstances, it seems a good idea to provide HWMargin values
- designed to enforce a uniform margin around all of the edges. The left &
- top margins can be given directly; the others must be worked out so that
- when applied with reference to the height and width parameters, they
- result in the same margin.
-
- For example, on my 5000, 0,0 is approximately 48/600" (about 6 points) to
- the left of the physical page. When I print at an offset from 0 of
- 8.3", the default A4 width, the print is approximately 32/600" (about 4
- points) inside the right edge of the page. That is, 8.3" is (48-32)/600"
- too wide for the physical page.
-
- 4 points (4/72") is 0.05555", and 32/600" is 0.053333". If I set a left
- HWMargin of 0.053", and Ghostscript obliges by mapping a new printable
- origin 4 points inside the left edge of the paper, with 8.3" of print-
- able line to the right of it, my left margin will need to account for the
- extra 16/600" that GS thinks exists on the right, and for the actual
- margin of 0.053" that I want to establish on the right. I think.
-
- The interest in the top margin is that it seems to be keyed to the colour
- pens. These form three blocks of nozzles vertically aligned in the
- colour print head.
-
- --- -- +-----+ v Alignment B
- ^ ^ | | v --- +-----+ ---
- | 64 | C | -- --- +-----+ --- | | ^
- | v v | | 40 ^ | | ^ | | |
- | -- -- +-----+ -- | | | | | |
- | 24 ^ | | | | | |
- | -- -- +-----+ | | | | | |
- | ^ ^ | | | | | | |
- 240 64 | M | 192 | K | | K | 208
- | v v | | | | | | |
- | -- -- +-----+ | | | | | |
- | 24 v | | | | | |
- | -- -- +-----+ -- | | | | | |
- | ^ ^ | | 40 v | | | | |
- | 64 | Y | -- --- +-----+ | | v
- v v | | ^ +-----+ ---
- --- -- +-----+
-
- The colour pens have 64 nozzles each, and the black has 208. Black can
- also be driven in colour compatibility mode, when it uses 192 nozzles
- only, the same as the total number of colour nozzles. In order to align
- the black nozzles with the colour, an alignment value is specified in the
- initialization sequence for the page. This value is in turn determined
- by printing an alignment page under control of the printer driver (See
- ancilliary files above.)
-
- Note that when an odd number is specified as Alignment B, an odd numbered
- nozzle will be mapped as nozzle 0 of the 192 nozzle black pen, so the
- even/odd association of nozzle numbers will be reversed; i.e., nozzle 0
- will become and ODD nozzle.
-
- The paper handler seems to assume that the paper load position is with
- the page lined up immediately before the lowest nozzle of the YELLOW pen.
- (Note that the paper is being fed in from the bottom of the printheads.)
- When I issue a paper feed instruction of 480 (240x2) 1200ths, and print a
- three-colour bar, the top of the CYAN pen is just on the physical page.
- Efectively, the Y component of 0,0 is right at the top of the page, with
- respect to the YELLOW pen. Y=0 with respect to the 192 nozzle black pen
- is always constant, and with respect to the 208 pen, can be determined
- from Alignment B.
-
-
- *===========================================================================*/
-
-/************************************************************************
- * B A S I C M A C R O S *
- ************************************************************************/
-
-#define A5_11_5000 1
-#define A5_11_5700 2
-
-
-#define ALIGN_A_DEF 15
-#define ALIGN_A_OFFSET 5 /* in pageinit escape sequence */
-#define ALIGN_B_DEF 8
-#define ALIGN_B_OFFSET 6 /* in pageinit escape sequence */
-
-#define HEADSEP_DEF 16
- /* number of pixels between even columns in */
- /* output and odd ones */
-#define DRY_TIME_DEF 0 /* Default pause for page to dry */
-
-
-/************************************************************************
- * P R I N T E R T Y P E D E F I N I T I O N S *
- ************************************************************************/
-
-#ifndef LX_BI
-# define LX_UNI
- /* or define LX_BI */
-#endif
-#define MIN_LX5000_X 300
-#define MAX_LX5000_X 1200
-#define DEF_LX5000_X 600
-#define MIN_LX5000_Y 600
-#define MAX_LX5000_Y 1200
-#define DEF_LX5000_Y MIN_LX5000_Y
-
-#ifndef LX5000_XDPI
-# define LX5000_XDPI DEF_LX5000_X
-#endif
-#ifndef LX5000_YDPI
-# define LX5000_YDPI DEF_LX5000_Y
-#endif
-
- /* Multiply lines by FEED_FACTOR when feeding
- paper. The 5000 feeds in 1200ths. */
-#define FEED_FACTOR ( 1200/LX5000_YDPI )
-
-#define LX5000_XOFFSET_TO_0_0_XDPI (-48.0)
-#define LX5000_YOFFSET_TO_0_0_YDPI (0.0)
-
-#define LX5000_XOFFSET_TO_0_0 ( LX5000_XOFFSET_TO_0_0_XDPI/LX5000_XDPI )
-#define LX5000_YOFFSET_TO_0_0 ( LX5000_YOFFSET_TO_0_0_YDPI/LX5000_YDPI )
-
-/* The theory */
-#define LX5000_LEFT_HWMARGIN_INS 0.053
-#define LX5000_BOTTOM_HWMARGIN_INS 0.067
-#define LX5000_RIGHT_HWMARGIN_INS 0.08
-#define LX5000_TOP_HWMARGIN_INS 0.053
-/**/
-/* The practice
-??
-*/
-
-#define LINE_PAD_BYTES 8
- /* number of bytes of padding on each end of */
- /* scan line to account for head separation */
- /* N.B. Keep this value 16-bit aligned. */
-
-#define RIGHTWARD 0
-#define LEFTWARD 1
-
-#define SWIPE_WORD_BITS 16
- /* Bits per directory word */
-#define BLACK_NOZZLES 208
- /* height of printhead in pixels */
-#define _1COLOUR_NOZZLES 64
- /* Height of one colour pen in pixels */
-
- /* Height of colour compatible black swipe */
-#define BLK_COLOUR_NOZZLES (_1COLOUR_NOZZLES * 3)
-
- /* number of shorts described by each */
- /* full black column directory */
-#define BLK_SWIPE_WORDS ( BLACK_NOZZLES / SWIPE_WORD_BITS )
-#define COLOUR_SWIPE_WORDS ( BLK_COLOUR_NOZZLES / SWIPE_WORD_BITS )
- /* and for a colour swipe command */
-#define _1COLOUR_WORDS ( _1COLOUR_NOZZLES / SWIPE_WORD_BITS )
- /* and for a single colour pen */
-
-#define BLK_DIRECTORY_MASK (( ~0 << BLK_SWIPE_WORDS ) ^ ~0 )
-#define COLOUR_DIRECTORY_MASK (( ~0 << COLOUR_SWIPE_WORDS ) ^ ~0 )
-#define DIRECTORY_TYPE_BIT 0x2000
- /* Directory type: Set = normal;
- unset = repeat compression */
-
-#define COLOUR_PEN_GAP 24 /* Defined in equivalent nozzles. This will */
- /* also be the offset from the top of the */
- /* first colour pen to the top of the colour */
- /* compatible black pen. */
-#define COLOUR_PEN_DIFF ( _1COLOUR_NOZZLES + COLOUR_PEN_GAP )
- /* The difference between corresponding */
- /* nozzle positions (e.g. bottom nozzle) on */
- /* contiguous colour pens. */
-
- /* The intial pen scanline positions are */
- /* defined with reference to the first */
- /* printable line (line 0) on the page. The */
- /* initial colour cartridge position is */
- /* immediately above line 0. */
-#define INITIAL_YELLOW_BOTTOM_LINE ( -1 )
-
- /* The pen buffer size must be a power of */
- /* 2, so that the index into the buffer */
- /* will either wrap within that size on */
- /* increment, or be able to be masked to */
- /* force a wrap of the index into the */
- /* circular pen buffers. See discussion */
- /* of pen buffers in lx5000_print_page(). */
-#define COLOUR_BUF_MASK 0xff
- /* 2^8 - 1 */
-#define COLOUR_BUF_LINES ( COLOUR_BUF_MASK + 1 )
-
-/************************************************************************
- * S W I P E C O M M A N D M A C R O S *
- ************************************************************************/
-
-#define SWIPE_LEADER 0x1b, '*', 4
- /* Lead-in bytes for swipe command */
-
-#define CMDLEN_X 3
- /* Index in swipe command of 4 byte */
-
-#define DIRECTION_X 7
- /* Index in swipe cmd of direction flag */
-
-#define UNIDIRECTIONAL 0
-#define BIDIRECTIONAL 1
-
-#define HEADSPEED_X 8
- /* Index in swipe cmd of head speed */
- /* Head speeds for various densities */
-#define _300X 1
-#define _600X 2
-#define _1200X 5
-
-#define PEN_X 9
- /* Index of 2 byte pen selectors */
-#define BLACK0 1
-#define BLACK1 1
-#define COLOUR0 2
-#define COLOUR1 0
-
-#define NOZZLE_COUNT_X 11
- /* Index of nozzle count selector */
-#define _192NOZZLES 0x18
-#define _208NOZZLES 0x1a
-
-#define UNKNOWN1_X 12
- /* Index of an unknown byte */
-#define UNKNOWN1VAL 0
-#define NUM_COLUMNS_X 13
- /* Index in swipe command of 2 byte */
- /* column count */
-#define _1ST_COLUMN_X 15
- /* Index in swipe command of 2 byte */
- /* first column horizontal offset */
-#define LAST_COLUMN_X 17
- /* Index in swipe command of 2 byte */
- /* last column horizontal offset */
-
-#define SWIPE_HDR_END_X 19
-#define SWIPE_HDR_END_LEN 7
-#define SWIPE_HDR_END 0, 0, '+', 'p', 'b', 'w', 1
- /* Final byte sequence of swipe cmd header */
-
-#define SWIPE_HDR_LEN ( SWIPE_HDR_END_X + SWIPE_HDR_END_LEN )
-
-/************************************************************************
- * C O L O U R H A N D L I N G M A C R O S *
- ************************************************************************/
-/* Macros for the relative position on the colour components in */
-/* gx_color_index, the driver defined representation of individual */
-/* colours. */
-
-#define BLACK_X 0
-#define YELLOW_X 1
-#define MAGENTA_X 2
-#define CYAN_X 3
-
-#define LO_PEN 0
-#define HI_PEN 1
-
- /* Colour defines for lx5000 black printer */
-
-# define NUM_COMPONENTS_BLK 1
-# define BITS_PER_PIXEL_BLK 1
-# define MAX_GREY_BLK 1
-# define MAX_RGB_BLK 0
-# define DITHER_GREYS_BLK 2
-# define DITHER_COLOURS_BLK 0
-
- /* Colour defines for lx5000 colour printer */
-# define NUM_COMPONENTS_CMY 4
-# define BITS_PER_PIXEL_CMY 4
-# define MAX_GREY_CMY 1
-# define MAX_RGB_CMY 1
-# define DITHER_GREYS_CMY 2
-# define DITHER_COLOURS_CMY 2
-
-# define MIN_COLOUR BLACK_X
-# define MAX_COLOUR CYAN_X
-# define BLACK_PEN BLACK_X
-# define _1ST_CMY_COLOUR YELLOW_X
-# define LAST_CMY_COLOUR CYAN_X
-
-#define BPP BITS_PER_PIXEL_CMY
- /* N.B. This is only required for
- processCMYKline */
-# define PIXEL_MASK (( 1 << BPP ) - 1 )
-# define INITIAL_PIXEL_SHIFT ( ( sizeof( uchar ) * 8 ) - BPP )
-
-#define NUM_COLOURS ( MAX_COLOUR - MIN_COLOUR + 1 )
-#define PENS_PER_COLOUR 2
-#define NUM_PENS ( NUM_COLOURS * PENS_PER_COLOUR )
-
-#define BITS_PER_COLOUR (BITS_PER_PIXEL_CMY / NUM_COMPONENTS_CMY)
-
-#define DEF_NUM_COLOURS NUM_COLOURS
-#define DEF_PENS_PER_COLOUR 1
-#define DEF_LINE_INCREMENT 1
-
-/* !!!!!!!!!!!!!!!!!!!!! WARNING, WARNING, WILL ROBINSON !!!!!!!!!!!!!!!!!!!!*/
- /* If BPP ever exceeds 8, this will break
- badly, as will the whole of processCMYKline.
- PIXELS_PER_BYTE is used when skipping over
- empty bytes in processCMYKline(). Each
- empty scanline byte skips over this many
- bits in the colourBufs. */
-#define PIXELS_PER_BYTE (8 / BPP)
-
-#define COLOUR_MASK (( 1 << ( BITS_PER_COLOUR ) ) - 1 )
-
-/************************************************************************
- * Memory allocation macros *
- * ( For use with getColourBufs & releaseAllocations ) *
- ************************************************************************/
-#define ALLOCATE true
-#define DEALLOCATE false
-
-/************************************************************************
- * " F U N C T I O N A L " M A C R O S *
- ************************************************************************/
-/************************************************************************
- * Macro to fill the swipe header *
- ************************************************************************/
-
-#define FILL_SWIPE_HEADER( swipeHdr, len, dir, speed, pen0, pen1, nozzles, \
- unknown, numcols, firstcol, lastcol ) \
- swipeHdr[ CMDLEN_X ] = ( ( len >> 24 ) & 0xff ); \
- swipeHdr[ CMDLEN_X + 1 ] = ( ( len >> 16 ) & 0xff ); \
- swipeHdr[ CMDLEN_X + 2 ] = ( ( len >> 8 ) & 0xff ); \
- swipeHdr[ CMDLEN_X + 3 ] = ( len & 0xff ); \
- swipeHdr[ DIRECTION_X ] = dir; \
- swipeHdr[ HEADSPEED_X ] = speed; \
- swipeHdr[ PEN_X ] = pen0; \
- swipeHdr[ PEN_X + 1 ] = pen1; \
- swipeHdr[ NOZZLE_COUNT_X ] = nozzles; \
- swipeHdr[ UNKNOWN1_X ] = unknown; \
- swipeHdr[ NUM_COLUMNS_X ] = ( numcols >> 8 ); \
- swipeHdr[ NUM_COLUMNS_X + 1 ] = ( numcols & 0xff ); \
- swipeHdr[ _1ST_COLUMN_X ] = ( firstcol >> 8 ); \
- swipeHdr[ _1ST_COLUMN_X + 1 ] = ( firstcol & 0xff ); \
- swipeHdr[ LAST_COLUMN_X ] = ( lastcol >> 8 ); \
- swipeHdr[ LAST_COLUMN_X + 1 ] = ( lastcol & 0xff )
-
-
-/************************************************************************
- * Macros to manipulate bit pointers in bitBuf & scanPixels structs *
- ************************************************************************/
-#define BIT_TO_MASK( n ) ( 0x80 >> ( n ) )
-#define INC_BIT( bitPtr ) \
-do { \
- if ( ! ((bitPtr).xBit >>= 1 )) \
- { (bitPtr).xByte++ ; (bitPtr).xBit = 0x80; } \
-} while (0)
-
-#define DEC_BIT( bitPtr ) \
-do { \
- if ( ! ( (bitPtr).xBit = (( (bitPtr).xBit << 1 ) & 0xff ))) \
- { (bitPtr).xByte-- ; (bitPtr).xBit = 1; } \
-} while (0)
-
-/************************************************************************
- * Macro for defining gx_device_procs structure *
- ************************************************************************/
-
-#define lx5000_proctab(get_params, put_params, map_color_rgb, map_cmyk_color)\
-{ gdev_prn_open,\
- gx_default_get_initial_matrix,\
- NULL, /* sync_output */\
- gdev_prn_output_page,\
- gdev_prn_close,\
- NULL, /* map_rgb_color */\
- map_color_rgb,\
- NULL, /* fill_rectangle */\
- NULL, /* tile_rectangle */\
- NULL, /* copy_mono */\
- NULL, /* copy_color */\
- NULL, /* draw_line */\
- NULL, /* get_bits */\
- get_params,\
- put_params,\
- map_cmyk_color,\
- NULL, /* get_xfont_procs */\
- NULL, /* get_xfont_device */\
- NULL, /* map_rgb_alpha_color */\
- gx_page_device_get_page_device /* get_page_device */\
-}
-
-/************************************************************************
- * T Y P E D E F S E N U M S & E X T E R N A L S T O R A G E *
- ************************************************************************/
- /* The procedure descriptors */
- /* declare functions */
-private dev_proc_print_page(lx5000_print_page);
-private dev_proc_get_params(lx5000_get_params);
-private dev_proc_put_params(lx5000_put_params);
-
-private dev_proc_map_cmyk_color(lx5000_map_cmyk_color);
-private dev_proc_map_color_rgb(lx5000_map_color_rgb);
-
-private const gx_device_procs lx5000_procs =
- lx5000_proctab(
- lx5000_get_params,
- lx5000_put_params,
- lx5000_map_color_rgb,
- lx5000_map_cmyk_color
- );
-
- /* The device descriptors */
- /* define a subclass containing useful state */
- /* a sub-class of gx_device_printer */
-typedef struct lx5000_device_s {
- gx_device_common;
- gx_prn_device_common;
- int alignA;
- int alignB;
- int headSeparation;
- int dryTime; /* Seconds delay at end of page for drying */
- int pensPerColour; /* 1 for 600Y; 2 for 1200Y */
- int lineIncrement; /* 1 for 600Y; 2 for 1200Y */
- int scanLineBytes; /* Returned by GS */
- int penLineBytes; /* When scanline colour elements are each
- reduced to a single bit, this is the result-
- ing line length in bytes. */
- int penLineLen; /* penLineBytes + BOL + EOL padding */
- int penBufSize; /* penLineLen * no. of lines */
- int swipeBufSize; /* calculated size of a swipe command buffer */
- bool isCMYK;
-} lx5000_device;
-
- /* Define a structure for a pointer to an */
- /* individual bit in a scanline */
-typedef struct bufBit_s {
- byte *xByte; /* Pointer to byte in buffer */
- uchar xBit; /* Mask for invidual bit in byte */
-} bufBit;
-
-
-typedef struct penData_s {
- int topLine; /* Top printable line of this pen */
- int bottomLine; /* Bottom printable line of this pen */
- int nextPrintLine; /* Next line to be printed, this pen */
-
- int initialBottomLine;
- int bottomToBottomYellow;
- int topToBottomYellow;
- int finalLine;
-} penData;
-
- /* Structure for extracting pixels from the
- initial scan line, which must be int
- aligned. */
-typedef struct scanPixels_s {
- uchar *scanByte; /* Pointer to a byte in the scan buffer */
- int pixShift; /* Shift required to get next pixel to */
-} scanPixels; /* the LSBits of the word. */
-
- /* Standard lx5000 device */
-lx5000_device far_data gs_lx5000_device = {
- prn_device_margins_body
- ( lx5000_device,
- lx5000_procs,
- "lx5000",
- DEFAULT_WIDTH_10THS,
- DEFAULT_HEIGHT_10THS,
- LX5000_XDPI, /* x dpi */
- LX5000_YDPI, /* y dpi */
- /* Offset inches from page left to 0,0 */
- LX5000_XOFFSET_TO_0_0,
- /* Offset inches from page top to 0,0 */
- LX5000_YOFFSET_TO_0_0,
- LX5000_LEFT_HWMARGIN_INS, /* margins */
- LX5000_BOTTOM_HWMARGIN_INS,
- LX5000_RIGHT_HWMARGIN_INS,
- LX5000_TOP_HWMARGIN_INS,
- NUM_COMPONENTS_CMY, /* colour info */
- BITS_PER_PIXEL_CMY, /* " */
- MAX_GREY_CMY, /* " */
- MAX_RGB_CMY, /* " */
- DITHER_GREYS_CMY, /* " */
- DITHER_COLOURS_CMY, /* " */
- lx5000_print_page
- ),
- ALIGN_A_DEF, /* default(!) horizontal pen alignment */
- ALIGN_B_DEF, /* default(!) vertical pen alignment */
- HEADSEP_DEF, /* default headSeparation value */
- DRY_TIME_DEF, /* Default page drying time */
- DEF_PENS_PER_COLOUR,
- DEF_LINE_INCREMENT,
- 0, /* scanLineBytes */
- 0, /* penLineBytes */
- 0, /* penLineLen */
- 0, /* penBufSize */
- 0, /* swipeBufSize */
- true /* isCMYK - defaults to using colour */
-};
-
-private const gx_device_color_info color_info_cmy =
- dci_values(NUM_COMPONENTS_CMY,
- BITS_PER_PIXEL_CMY,
- MAX_GREY_CMY,
- MAX_RGB_CMY,
- DITHER_GREYS_CMY,
- DITHER_COLOURS_CMY);
-
-private const gx_device_color_info color_info_blk =
- dci_values(NUM_COMPONENTS_BLK,
- BITS_PER_PIXEL_BLK,
- MAX_GREY_BLK,
- MAX_RGB_BLK,
- DITHER_GREYS_BLK,
- DITHER_COLOURS_BLK);
-
-/************************************************************************
- ************************************************************************
- * D R I V E R P R O C E D U R E S *
- ************************************************************************
- ************************************************************************/
-
-/************************************************************************
- * U T I L I T Y P R O C E D U R E S *
- ************************************************************************/
-
-/*----------------------------------------------------------------------*
- * i n i t P e n C o n s t a n t s ( ) *
- *----------------------------------------------------------------------*
- *----------------------------------------------------------------------*/
-private void
-initPenConstants( lx5000_device *lx5000dev,
- penData pens[NUM_COLOURS][PENS_PER_COLOUR] )
-{
- /* Indexed by pensPerColour. */
- static const int nozzleCount[ NUM_COLOURS ][ PENS_PER_COLOUR + 1 ] =
- {
- { -1, BLACK_NOZZLES, (BLACK_NOZZLES / 2) },
- { -1, _1COLOUR_NOZZLES, (_1COLOUR_NOZZLES / 2) },
- { -1, _1COLOUR_NOZZLES, (_1COLOUR_NOZZLES / 2) },
- { -1, _1COLOUR_NOZZLES, (_1COLOUR_NOZZLES / 2) }
- };
-
- int colour, pen;
- int pensPerColour = lx5000dev->pensPerColour;
-
- pens[YELLOW_X][LO_PEN].initialBottomLine = -1;
- pens[MAGENTA_X][LO_PEN].initialBottomLine =
- pens[YELLOW_X][LO_PEN].initialBottomLine
- - COLOUR_PEN_DIFF;
- pens[CYAN_X][LO_PEN].initialBottomLine =
- pens[MAGENTA_X][LO_PEN].initialBottomLine
- - COLOUR_PEN_DIFF;
- pens[BLACK_X][LO_PEN].initialBottomLine =
- pens[YELLOW_X][LO_PEN].initialBottomLine
- - COLOUR_PEN_GAP
- + ( SWIPE_WORD_BITS - lx5000dev->alignB );
-
- for ( colour = 0; colour < NUM_COLOURS; colour++ )
- {
- pens[colour][LO_PEN].bottomToBottomYellow
- = pens[YELLOW_X][LO_PEN].initialBottomLine
- - pens[colour][LO_PEN].initialBottomLine;
- }
-
- if ( pensPerColour == 1 )
- {
- pens[BLACK_X][LO_PEN].topToBottomYellow =
- BLK_COLOUR_NOZZLES + COLOUR_PEN_GAP
- + lx5000dev->alignB - 1;
- pens[YELLOW_X][LO_PEN].topToBottomYellow = _1COLOUR_NOZZLES - 1;
- pens[MAGENTA_X][LO_PEN].topToBottomYellow =
- pens[YELLOW_X][LO_PEN].topToBottomYellow
- + COLOUR_PEN_DIFF;
- pens[CYAN_X][LO_PEN].topToBottomYellow =
- pens[MAGENTA_X][LO_PEN].topToBottomYellow
- + COLOUR_PEN_DIFF;
-
- for ( colour = 0; colour < NUM_COLOURS; colour++ )
- {
- pens[colour][HI_PEN].topToBottomYellow
- = pens[colour][LO_PEN].topToBottomYellow;
- pens[colour][HI_PEN].initialBottomLine
- = pens[colour][LO_PEN].initialBottomLine;
- pens[colour][HI_PEN].bottomToBottomYellow
- = pens[colour][LO_PEN].bottomToBottomYellow;
- }
- }
- else /* pensPerColour > 1 */
- {
- pens[BLACK_X][HI_PEN].topToBottomYellow =
- BLK_COLOUR_NOZZLES + COLOUR_PEN_GAP
- + lx5000dev->alignB - 1;
- pens[BLACK_X][LO_PEN].topToBottomYellow =
- pens[BLACK_X][HI_PEN].topToBottomYellow
- - nozzleCount[BLACK_X][pensPerColour];
- pens[YELLOW_X][HI_PEN].topToBottomYellow = _1COLOUR_NOZZLES - 1;
- pens[YELLOW_X][LO_PEN].topToBottomYellow =
- pens[YELLOW_X][HI_PEN].topToBottomYellow
- - nozzleCount[YELLOW_X][pensPerColour];
- pens[MAGENTA_X][HI_PEN].topToBottomYellow =
- pens[YELLOW_X][HI_PEN].topToBottomYellow
- + COLOUR_PEN_DIFF;
- pens[MAGENTA_X][LO_PEN].topToBottomYellow =
- pens[MAGENTA_X][HI_PEN].topToBottomYellow
- -nozzleCount[MAGENTA_X][pensPerColour];
- pens[CYAN_X][HI_PEN].topToBottomYellow =
- pens[MAGENTA_X][HI_PEN].topToBottomYellow
- + COLOUR_PEN_DIFF;
- pens[CYAN_X][LO_PEN].topToBottomYellow =
- pens[CYAN_X][HI_PEN].topToBottomYellow
- - nozzleCount[CYAN_X][pensPerColour];
-
- for ( colour = 0; colour < NUM_COLOURS; colour++ )
- {
- pens[colour][HI_PEN].bottomToBottomYellow =
- pens[colour][LO_PEN].bottomToBottomYellow
- + nozzleCount[colour][pensPerColour];
- pens[colour][HI_PEN].initialBottomLine =
- pens[colour][LO_PEN].initialBottomLine
- - nozzleCount[colour][pensPerColour];
- }
- }
-
- for ( colour = 0; colour < NUM_COLOURS; colour++ )
- {
- for ( pen = 0; pen < PENS_PER_COLOUR; pen++ )
- {
- pens[colour][pen].finalLine =
- ( lx5000dev->height ) + pens[colour][pen].topToBottomYellow;
- }
- }
-}
-
-/*----------------------------------------------------------------------*
- * p a g e I n i t ( ) *
- *----------------------------------------------------------------------*
- *----------------------------------------------------------------------*/
-private void
-pageInit( unsigned int alignA, unsigned int alignB, FILE *prn_stream )
-{
- static char page_init[] = {
- 0x1b, '*', 'm', 0, 0x40, ALIGN_A_DEF, ALIGN_B_DEF, 0xf, 0xf
- };
-
- page_init[ALIGN_A_OFFSET] = (uchar)alignA;
- page_init[ALIGN_B_OFFSET] = (uchar)alignB;
-
- fwrite( page_init, 1, sizeof( page_init ), prn_stream );
-}
-
-/*----------------------------------------------------------------------*
- * p a g e E n d ( ) *
- *----------------------------------------------------------------------*
- *----------------------------------------------------------------------*/
-private void
-pageEnd( FILE *prn_stream )
-{
- static const char page_end[] = {
- 0x1b,'*', 7, 0x65
- };
-
- fwrite( page_end, 1, sizeof( page_end ), prn_stream );
- /* Do it twice - that's what the Windows */
- /* driver for the 5000 does */
- fwrite( page_end, 1, sizeof( page_end ), prn_stream );
-}
-
-/*----------------------------------------------------------------------*
- * f e e d P a p e r ( ) *
- *----------------------------------------------------------------------*
- *----------------------------------------------------------------------*/
-private void
-feedPaper( lx5000_device *lx5000dev, int newLine, int *currentLine,
- penData pens[NUM_COLOURS][PENS_PER_COLOUR],
- FILE *prn_stream )
-{
- static const char feed_paper[] = {
- 0x1b, '*', 3
- };
-
- ushort _1200ths;
- int colour, pen;
-
- if ( newLine >= *currentLine )
- {
- _1200ths = (ushort)(( newLine - *currentLine ) * FEED_FACTOR );
- fwrite( feed_paper, 1, sizeof( feed_paper ), prn_stream );
- putc( _1200ths >> 8 , prn_stream);
- putc( _1200ths & 0xff, prn_stream );
-
- *currentLine = newLine;
-
- for ( colour = 0;
- colour < lx5000dev->color_info.num_components;
- colour++ )
- for ( pen = 0; pen < lx5000dev->pensPerColour; pen++ )
- {
- pens[colour][pen].topLine =
- newLine - pens[colour][pen].topToBottomYellow;
- pens[colour][pen].bottomLine =
- newLine - pens[colour][pen].bottomToBottomYellow;
- }
-
- }
-}
-
-
-/*----------------------------------------------------------------------*
- * g e t C o l o u r B u f s ( ) *
- *----------------------------------------------------------------------*
- Return pointers to the allocated buffers in those pointers whose addresses
- have been passed as parameters, or release the allocations.
-
- Allocation is indicated by a true value of the argument `allocate'.
-
- The buffers themselves are allocated and the pointers to them are kept
- in static storage. On the first call, the buffers are allocated, and the
- pointers to them are maintained in static storage. On all subsequent
- calls, the pointer contents are simply returned.
-
- Deallocation is indicated by a false value of the argument `allocate'.
-
- If the pointers are non-null, the allocated memory is released, and
- the pointer values are set to NULL.
-
- N.B. The arrays are defined in terms of the maximum values for the array
- dimensions, even though the actual usage of each dimension is dynamically
- determined. E.g. colourBufs is dimensioned [NUM_COLOURS],
- even though the number of colour dimensions actually used is determined
- by the variable numColours, which will be 1 if the driver is being used
- in black-only mode.
- *----------------------------------------------------------------------*/
-int
-getColourBufs( lx5000_device *lx5000dev,
- byte **lineBufferPtr, byte *colourBufPtrs[],
- byte **swipeBufPtr, bool allocate )
-{
- static byte *colourBufs[ NUM_COLOURS ];
- /* Only an array of pointers; OK if too big */
- static byte *lineBuffer = NULL;
- static byte *swipeBuf = NULL;
-
- int colour;
- int colourBufNull = 0;
- int numColours = lx5000dev->color_info.num_components;
-
- if ( allocate )
- {
- if ( lineBuffer == NULL )
- {
- /* Initialise the pen buffers */
- for ( colour = 0; colour < numColours; colour++ )
- colourBufs[ colour ] = NULL;
-
- /*---------------------------------------------------------------*
- Derive the size of a colour buffer line: If the number of
- components is one and the number of bits per pixel is one, then
- there is only one bit per pixel in the scan line, so the colour
- buffer line is the same size.
-
- Otherwise, reduce each gx_color_index element in the scan line to
- one bit in the penprint buffer.
- *--------------------------------------------------------------*/
-
- if (lx5000dev->color_info.num_components > GX_DEVICE_COLOR_MAX_COMPONENTS)
- return_error(gs_error_limitcheck);
-
- lx5000dev->scanLineBytes = gdev_mem_bytes_per_scan_line(
- (gx_device *)lx5000dev );
- lx5000dev->penLineBytes =
- ( lx5000dev->color_info.num_components == 1
- && lx5000dev->color_info.depth == 1 )
- ? lx5000dev->scanLineBytes
- : ( lx5000dev->scanLineBytes / lx5000dev->color_info.num_components);
-
- lx5000dev->penLineLen =
- lx5000dev->penLineBytes + ( LINE_PAD_BYTES * 2);
-
- lx5000dev->penBufSize
- = lx5000dev->penLineLen * COLOUR_BUF_LINES;
-
- /* swipeBuf size:
- * No. of columns = No. of bits in the linebuf
- * Bits per column = maximum swipe height
- * Bytes per column = Bits per column / 8 + 2 byte directory
- * Total bytes = Bytes/column * no. of columns + header bytes
- */
- lx5000dev->swipeBufSize =
- ((lx5000dev->penLineLen * 8)
- * ((BLACK_NOZZLES / 8) + 2) + SWIPE_HDR_LEN);
-
- /* Allocate a buffer for a single scan line */
- lineBuffer = (byte *)gs_alloc_byte_array
- ( gs_lib_ctx_get_non_gc_memory_t(), lx5000dev->scanLineBytes, 1,
- "lx5000_print_page(lineBuffer)" );
-
- swipeBuf = (byte *)gs_alloc_byte_array
- ( gs_lib_ctx_get_non_gc_memory_t(), lx5000dev->swipeBufSize, 1,
- "lx5000_print_page(swipeBuf)" );
-
- for ( colour = 0 ; colour < numColours; colour++ )
- {
- if ( ( colourBufs[colour] =
- (byte *)gs_alloc_byte_array
- ( gs_lib_ctx_get_non_gc_memory_t(), lx5000dev->penBufSize, 1,
- "lx5000_print_page(colourBufs)"
- )
- ) == NULL )
- {
- colourBufNull = 1;
- colour = numColours;
- }
- }
- /* Check allocations */
- if ( lineBuffer == NULL || colourBufNull || swipeBuf == NULL ) {
- getColourBufs( lx5000dev, lineBufferPtr, colourBufPtrs,
- swipeBufPtr, DEALLOCATE );
- return_error( gs_error_VMerror );
- }
- }
- /* Clear the black buffer, iff ! isCMYK. If CMYK, scan lines are
- processed by processCMYKlines(), and buffer lines are cleared
- individually, before a new scan line is processed. As part of this
- clearing, the line EOL and BOL pads are also cleared.
- If ! CMYK, the black-only scan line is read or copied directly
- into the black buffer, without clearing the buffer. Therefore, the
- line pad regions must either be cleared individually for each line
- processed, or cleared once when the buffer is allocated.
- */
- if ( ! lx5000dev->isCMYK )
- memset( colourBufs[BLACK_X], 0, lx5000dev->penBufSize );
-
- /* Return the values */
- *lineBufferPtr = lineBuffer;
- *swipeBufPtr = swipeBuf;
- for ( colour = 0; colour < numColours; colour++ )
- colourBufPtrs[colour] = colourBufs[colour];
-
- return 0;
- }
- else /* Deallocate the buffers */
- {
- for ( colour = 0; colour < numColours; colour++ )
- {
- if ( colourBufs[colour] != NULL )
- gs_free_object( gs_lib_ctx_get_non_gc_memory_t(),
- (char *)colourBufs[colour],
- "lx5000_print_page(colourBufs)" );
- colourBufs[ colour ] = NULL;
- colourBufPtrs[ colour ] = NULL;
- }
- if ( swipeBuf != NULL )
- gs_free_object( gs_lib_ctx_get_non_gc_memory_t(),
- (char *)swipeBuf, "lx5000_print_page(swipeBuf)" );
- swipeBuf = NULL;
- *swipeBufPtr = NULL;
- if ( lineBuffer != NULL )
- gs_free_object( gs_lib_ctx_get_non_gc_memory_t(),
- (char *)lineBuffer, "lx5000_print_page(lineBuffer)" );
- lineBuffer = NULL;
- *lineBufferPtr = NULL;
- return 0;
- }
-}
-
-
-/*----------------------------------------------------------------------*
- * p r o c e s s C M Y K l i n e ( ) *
- *----------------------------------------------------------------------*
- Given a scan line number, a pointer to a scan line, an array of pointers to
- individual colour buffers, and an array of the individual pen scanBit
- arrays, distribute the scan line elements into the colour buffers.
-
- N.B. The empty indicator for each line for each pen buffer must also be
- set by this procedure.
-
- Things like dithering may well end up in here.
- *----------------------------------------------------------------------*/
-private void
-processCMYKline( lx5000_device *lx5000dev, int linenum,
- byte *lineBuffer, byte *scanLine,
- byte *colourBufs[NUM_COLOURS],
- bufBit
- colourLines[NUM_COLOURS][PENS_PER_COLOUR][COLOUR_BUF_LINES],
- penData pens[NUM_COLOURS][PENS_PER_COLOUR],
- bool lineEmpty[NUM_COLOURS][ COLOUR_BUF_LINES ] )
-{
- int colour;
- int numColours = lx5000dev->color_info.num_components;
-
- uchar colourBits[ 8 ];
- uchar lineIndex;
- uchar scanPixel;
- scanPixels nextPixel;
- bufBit nextBit[ 8 ];
- /* The end of the (scan)line. */
- uchar *scanEnd = scanLine + lx5000dev->scanLineBytes;
-
- nextPixel.scanByte = scanLine; /* Set up the moving pixel pointer. */
- nextPixel.pixShift = INITIAL_PIXEL_SHIFT;
- lineIndex = (uchar)( linenum & COLOUR_BUF_MASK );
-
- for ( colour = 0; colour < numColours; colour++ )
- {
- /* Set up the moving output bit pointer for
- each of the colours. */
- nextBit[ colour ].xByte = colourBufs[ colour ] + LINE_PAD_BYTES
- + ( lineIndex * lx5000dev->penLineLen );
- nextBit[ colour ].xBit = BIT_TO_MASK( 0 );
- /* Clear the colourBuf line if necessary */
- if ( ! lineEmpty[ colour ][ lineIndex ] )
- {
- memset( nextBit[ colour ].xByte - LINE_PAD_BYTES,
- 0, lx5000dev->penLineLen );
- lineEmpty[ colour ][ lineIndex ] = true;
- }
- }
- /* Is the line empty? */
- if (( ! *scanLine ) &&
- ! memcmp( scanLine, scanLine + 1, lx5000dev->scanLineBytes - 1 ))
- return; /* N.B. empty flag is pre-set to true */
-
- while ( nextPixel.scanByte < scanEnd )
- {
- int colour;
- int cmy; /* Used to detect if C+M+Y set */
- int skipPixels, skipBytes, skipBits;
- /* Number of consecutive empty pixels, equiv-
- alent bytes and remainder bits just skipped
- over in the CMYK line being processed. */
-
- /* Get next pixel and increment the pointer */
- scanPixel =
- ( ( *(nextPixel.scanByte) >> nextPixel.pixShift ) & PIXEL_MASK );
-
- /* pixShift is the number of bits to right-shift the scanByte
- before applying PIXEL_MASK. When we attempt to decrement
- it past 0, it's time to look at the next scanByte.
- N.B. We assume that the subtraction of BPP will end with
- zero, i.e., that there are an integral number of BPPs in
- INITIAL_PIXEL_SHIFT. We test for <= 0 just
- in case this condition gets violated.
- */
- skipPixels = 0;
- if ( nextPixel.pixShift <= 0 )
- {
- nextPixel.scanByte++;
- nextPixel.pixShift = INITIAL_PIXEL_SHIFT;
- /* If the next byte is empty, skip it */
- while (( ! *nextPixel.scanByte ) && nextPixel.scanByte < scanEnd )
- {
- nextPixel.scanByte++;
- skipPixels += PIXELS_PER_BYTE;
- }
- }
- else
- nextPixel.pixShift -= BPP;
- /* Get the black bit(s) */
- colourBits[ BLACK_X ] = scanPixel & COLOUR_MASK;
- scanPixel >>= BITS_PER_COLOUR;
- /* Set to catch all ANDed bits from colours */
- cmy = ~0;
- for ( colour = YELLOW_X; colour <= CYAN_X; colour++ )
- {
- colourBits[ colour ] = scanPixel & COLOUR_MASK;
- cmy &= scanPixel & COLOUR_MASK;
- scanPixel >>= BITS_PER_COLOUR;
- }
- if ( ( cmy ^ COLOUR_MASK ) == 0 ) /* C, M & Y all set == COLOUR_MASK */
- {
- colourBits[ YELLOW_X ] =
- colourBits[ MAGENTA_X ] = colourBits[ CYAN_X ] = 0;
- colourBits[ BLACK_X ] = COLOUR_MASK;
- }
- /* Now set the colourBuf bits */
- skipBytes = skipPixels >> 3;
- skipBits = skipPixels & 7;
- for ( colour = 0; colour < numColours; colour++ )
- {
- if ( colourBits[ colour ] )
- {
- *( nextBit[ colour ].xByte ) |= nextBit[ colour ].xBit;
- lineEmpty[ colour ][ lineIndex ] = false;
- }
- INC_BIT( nextBit[ colour ] );
- if ( skipPixels )
- {
- int bitSkip = skipBits;
-
- nextBit[ colour ].xByte += skipBytes;
- while ( bitSkip-- )
- {
- INC_BIT( nextBit[ colour ] );
- }
- }
- }
- }
-}
-
-
-/*----------------------------------------------------------------------*
- * r e f r e s h B u f f e r ( ) *
- *----------------------------------------------------------------------*
- Given pointers to the values of the next line to retrieve from GS, and
- the next printable line, the GS line buffer, the per colour bit buffers,
- the per colour arrays containing the per line `empty'
- indicators, and the per pen penData structs, containing the next print
- line for each pen, refresh the buffer, and perform initial processing on
- the lines read from GS.
-
- When the scan line is for a black-only device, the line bits can be read
- directly into the appropriate colour buffer at the appropriate place.
-
- When the scan lines hold colour info, each line must undergo CMYK pro-
- cessing to derive the individual arrays of single-colour bits.
-
- Refreshing the buffers involves reading lines into the circular colour
- buffers until COLOUR_BUF_LINES have been read, or until the available
- lines have been exhausted.
-
- On return, nextLineToPrint must be set to the said line number, or beyond
- the end of the page, if no more remain to be printed.
- *----------------------------------------------------------------------*/
-private void
-refreshBuffer( lx5000_device *lx5000dev,
- int *nextLineToGet, int *nextLineToPrint,
- byte *lineBuffer, byte *colourBufs[],
- bufBit
- colourLines[NUM_COLOURS][PENS_PER_COLOUR][COLOUR_BUF_LINES],
- penData pens[NUM_COLOURS][PENS_PER_COLOUR],
- bool lineEmpty[NUM_COLOURS][COLOUR_BUF_LINES] )
-{
- byte *lineBuf;
- uchar nextToGet; /* Circular buffer pointer, 0 to ff */
- int bufferOffset;
- int colour, pen;
- int _1stPrintable; /* Across all pens */
- int numColours = lx5000dev->color_info.num_components;
-
- /* Establish the next line to print, if it
- is already in the buffer. */
- _1stPrintable = pens[YELLOW_X][LO_PEN].finalLine;
- for ( colour = 0; colour < numColours; colour++ )
- {
- for ( pen = 0; pen < lx5000dev->pensPerColour; pen++ )
- if ( pens[ colour ][ pen ].nextPrintLine < _1stPrintable)
- _1stPrintable = pens[ colour ][ pen ].nextPrintLine;
- }
- *nextLineToPrint = _1stPrintable;
-
- nextToGet = (uchar)(*nextLineToGet & COLOUR_BUF_MASK);
- /* nextLineToPrint may be set high (i.e. not
- known), or may be a known print line. */
- while ( ( *nextLineToGet < *nextLineToPrint
- || ( *nextLineToGet - *nextLineToPrint ) < COLOUR_BUF_LINES )
- && *nextLineToGet < lx5000dev->height )
- {
- bufferOffset = LINE_PAD_BYTES + ( lx5000dev->penLineLen * nextToGet );
-
- if ( ! lx5000dev->isCMYK )
- {
- /* For black-only, read the bits directly into
- the colour buffer. */
- gdev_prn_get_bits( (gx_device_printer *)lx5000dev, *nextLineToGet,
- colourBufs[BLACK_X] + bufferOffset, &lineBuf );
- /* If necessary, copy the bits into the actual
- buffer. */
- if ( lineBuf != colourBufs[BLACK_X] + bufferOffset )
- memcpy(colourBufs[BLACK_X] + bufferOffset,
- lineBuf, lx5000dev->penLineBytes);
- /* Check for a printing line */
- if ( *(colourBufs[BLACK_X] + bufferOffset) != 0
- || memcmp( colourBufs[BLACK_X] + bufferOffset,
- colourBufs[BLACK_X] + bufferOffset + 1,
- lx5000dev->scanLineBytes - 1 ))
- lineEmpty[ BLACK_X ][ nextToGet ] = false;
- else
- lineEmpty[ BLACK_X ][ nextToGet ] = true;
- }
- else /* CMYK printing */
- {
- /* Process a CMYK line from GS */
- gdev_prn_get_bits( (gx_device_printer *)lx5000dev,
- *nextLineToGet, lineBuffer, &lineBuf );
- processCMYKline( lx5000dev, *nextLineToGet, lineBuffer, lineBuf,
- colourBufs, colourLines, pens, lineEmpty );
- }
- for (colour = 0; colour < numColours; colour++ )
- {
- /* Check for printing line -
- N.B. For two-pen colour, this becomes more
- complicated. The relationship between the
- first print line of the lower and of the
- upper pen is determined by odd/even line
- numbers, although this is not an essential
- relationship. Blank lines at the top of
- the lower pen could be skipped, and the
- first available line could be printed by
- the lower pen. */
- if ( ! lineEmpty[colour][nextToGet] )
- {
- if ( pens[colour][LO_PEN].nextPrintLine > *nextLineToGet )
- pens[colour][LO_PEN].nextPrintLine = *nextLineToGet;
- if ( *nextLineToPrint > *nextLineToGet )
- *nextLineToPrint = *nextLineToGet;
- }
- }
- ++*nextLineToGet;
- nextToGet = ( *nextLineToGet & COLOUR_BUF_MASK ); /* N.B. This is safer
- than just doing the increment, in case the
- buffer length changes. */
- }
- /* Check that no buffer padding is necessary */
- if ( *nextLineToPrint < lx5000dev->height )
- {
- while ( ( *nextLineToGet - *nextLineToPrint ) < COLOUR_BUF_LINES )
- { /* Last refresh fell short of COLOUR_BUF_LINES
- because last line of page was reached.
- Pad the buffer to COLOUR_BUF_LINES with 0
- (no print) bytes. */
- for ( colour = 0; colour < numColours; colour++ )
- { /* Fill the colour line buffer, incl pad */
- memset( colourBufs[colour]
- + ( lx5000dev->penLineLen * nextToGet ),
- 0, lx5000dev->penLineLen );
- /* Set empty indicator - note that firstBit
- is NOT set here. */
- lineEmpty[colour][nextToGet] = true;
- }
- ++*nextLineToGet;
- nextToGet = ( *nextLineToGet & COLOUR_BUF_MASK );
- }
- }
-}
-
-/*----------------------------------------------------------------------*
- * c a r t r i d g e M o v e T o ( ) *
- *----------------------------------------------------------------------*
- Given the array of penBits structures for each pen, containing the
- nextPrintLine value for the pen, return the line position to
- which the colour cartridge must be moved to print that line with the
- TOP nozzle of the required pen.
- If the print line for any pen is within the current range of that pen,
- a line less than the current colour head position will be returned.
- If colour is not defined, return a value off the end of the page.
- *----------------------------------------------------------------------*/
-private int
-cartridgeMoveTo( lx5000_device *lx5000dev,
- penData pens[NUM_COLOURS][PENS_PER_COLOUR],
- int _1stColour, int lastColour )
-{
- if ( _1stColour != BLACK_X && ! lx5000dev->isCMYK )
- /* Send back an off-the-page value */
- return pens[CYAN_X][LO_PEN].finalLine;
- else
- {
- int colour, pen, minLine;
-
- minLine = pens[CYAN_X][LO_PEN].finalLine; /* Initialise high */
- /* For each pen, calculate a moveto value
- which will print the next line with the
- first nozzle of that pen.
- Return the minimum of these values. */
- for ( colour = _1stColour; colour <= lastColour; colour++ )
- for ( pen = 0; pen < lx5000dev->pensPerColour; pen++ )
- if ( ( pens[colour][pen].nextPrintLine
- + pens[colour][pen].topToBottomYellow )
- < minLine )
- minLine =
- pens[colour][pen].nextPrintLine
- + pens[colour][pen].topToBottomYellow;
-
- return minLine;
- }
-}
-/*----------------------------------------------------------------------*
- * s e t C o l o u r C o l u m n E x t e n t ( ) *
- *----------------------------------------------------------------------*
- Given a colour buffer, a single array of colourBits structures,
- 1st and last lines, 1st nozzle, and the addresses of
- _1stColumn, lastColumn and columnExtent variables, calculate and set
- these column variables after stripping leading and trailing white space.
- *----------------------------------------------------------------------*/
-private void
-setColourColumnExtent( lx5000_device *lx5000dev, byte *colourBuf,
- bool lineEmpty[COLOUR_BUF_LINES],
- int _1stLine, int _1stNozzle, int lastLine,
- int *_1stColumn, int *lastColumn, int *columnExtent )
-{
- uchar _1stIndex;
- int firstPrintByte, lastPrintByte;
- int line;
-
- line = _1stLine;
- firstPrintByte = lx5000dev->penLineBytes;
- lastPrintByte = 0;
-
- for ( ; line <= lastLine; line += lx5000dev->lineIncrement )
- { /* For each active line in swipe */
- int columnByte;
-
- _1stIndex = line & COLOUR_BUF_MASK;
- if ( lineEmpty[ _1stIndex ] )
- continue; /* If the line is empty, skip it. */
- /* Otherwise, scan from the beginning to any
- previously found non-zero byte for the
- beginning of the active column extent. */
- for ( columnByte = 0; columnByte < firstPrintByte; columnByte++ )
- if ( colourBuf[ _1stIndex * lx5000dev->penLineLen
- + LINE_PAD_BYTES + columnByte ] )
- {
- firstPrintByte = columnByte;
- break;
- }
- /* Scan from the end of the line to any pre-
- viously found non-zero byte for the end of
- the active column extent. */
- for ( columnByte = lx5000dev->penLineBytes;
- columnByte > lastPrintByte; columnByte-- )
- if ( colourBuf[ _1stIndex * lx5000dev->penLineLen
- + LINE_PAD_BYTES + columnByte ] )
- {
- lastPrintByte = columnByte;
- break;
- }
- }
- /* If we have no extent, there are no
- printable lines for this pen. */
- if ( firstPrintByte > lastPrintByte )
- {
- *_1stColumn = firstPrintByte * 8;
- *lastColumn = lastPrintByte * 8;
- *columnExtent = 0;
- return;
- }
-
- *_1stColumn = firstPrintByte * 8;
- *lastColumn = lastPrintByte * 8 + 7 + lx5000dev->headSeparation;
- *columnExtent = ( *lastColumn - *_1stColumn ) + 1;
-
-}
-
-/*----------------------------------------------------------------------*
- * s e t C o l o u r L i n e s ( ) *
- *----------------------------------------------------------------------*
- Given a single colour/pen buffer, a single array of bufBit structures,
- 1st and last lines, 1st nozzle, print direction, and
- _1stColumn, lastColumn and columnExtent variables, set up the pointers
- to the first actual column of each line, taking account of even and odd
- nozzle numbers.
- *----------------------------------------------------------------------*/
-private void
-setColourLines( lx5000_device *lx5000dev,
- byte *colourBuf, bufBit colourLines[COLOUR_BUF_LINES],
- int _1stLine, int _1stNozzle, int lastLine, int direction,
- int _1stColumn, int lastColumn )
-{
- uchar _1stIndex;
- int line, nozzle, bit, headSep, headSepBytes, headSepBits;
- int firstPrintByte, lastPrintByte, lastPrintBit;
- bufBit startPtr;
-
- /* Now initialize the penBits bufBit structures to point to the
- beginning and end of the extent for each of the active lines in
- this swipe
-
- Adjust the beginning for all EVEN nozzles by moving it to the
- left by HeadSeparation bits.
- */
-
- headSep = lx5000dev->headSeparation;
- if ( lx5000dev->x_pixels_per_inch == 300.0 )
- headSep = headSep >> 1; /* Halve the value at 300 dpi */
- if ( lx5000dev->x_pixels_per_inch == 1200.0 )
- headSep = headSep << 1; /* Double the value at 1200dpi */
- headSepBytes = headSep / 8;
- headSepBits = headSep % 8;
-
- firstPrintByte = _1stColumn / 8;
- lastPrintByte = lastColumn / 8;
- lastPrintBit = lastColumn % 8;
-
- if ( direction == RIGHTWARD )
- {
- /* Set up the ODD columns first */
- startPtr.xByte = colourBuf + LINE_PAD_BYTES + firstPrintByte;
- startPtr.xBit = BIT_TO_MASK( 0 );
- line = _1stLine;
- nozzle = _1stNozzle; /* Is 1st nozzle effectively odd? */
- if ( ! ( nozzle & 1 ) ) /* Nozzle is even, so increment */
- line += lx5000dev->lineIncrement;
- for ( ; line <= lastLine; line += ( lx5000dev->lineIncrement << 1 ) )
- {
- _1stIndex = (uchar)( line & COLOUR_BUF_MASK );
- colourLines[_1stIndex].xByte =
- startPtr.xByte + _1stIndex * lx5000dev->penLineLen;
- colourLines[_1stIndex].xBit = startPtr.xBit;
- }
- /* Set up EVEN columns */
- startPtr.xByte -= headSepBytes;
- for ( bit = 0; bit < headSepBits; bit++ )
- {
- DEC_BIT( startPtr );
- }
- line = _1stLine;
- nozzle = _1stNozzle; /* Is 1st nozzle effectively even? */
- if ( nozzle & 1 ) /* Nozzle is odd, so increment */
- line += lx5000dev->lineIncrement;
- for ( ; line <= lastLine; line += ( lx5000dev->lineIncrement << 1 ) )
- {
- _1stIndex = (uchar)( line & COLOUR_BUF_MASK );
- colourLines[_1stIndex].xByte =
- startPtr.xByte + _1stIndex * lx5000dev->penLineLen;
- colourLines[_1stIndex].xBit = startPtr.xBit;
- }
- }
- else /* direction == LEFTWARD */
- {
- /* Set up the ODD columns first */
- startPtr.xByte = colourBuf + LINE_PAD_BYTES + lastPrintByte;
- startPtr.xBit = BIT_TO_MASK( lastPrintBit );
- line = _1stLine;
- nozzle = _1stNozzle; /* Is 1st nozzle effectively odd? */
- if ( ! ( nozzle & 1 ) ) /* Nozzle is even, so increment */
- line += lx5000dev->lineIncrement;
- for ( ; line <= lastLine; line += ( lx5000dev->lineIncrement << 1 ) )
- {
- _1stIndex = (uchar)( line & COLOUR_BUF_MASK );
- colourLines[_1stIndex].xByte =
- startPtr.xByte + _1stIndex * lx5000dev->penLineLen;
- colourLines[_1stIndex].xBit = startPtr.xBit;
- }
- /* Set up EVEN columns */
- startPtr.xByte -= headSepBytes;
- for ( bit = 0; bit < headSepBits; bit++ )
- {
- DEC_BIT( startPtr );
- }
- line = _1stLine;
- nozzle = _1stNozzle; /* Is 1st nozzle effectively even? */
- if ( nozzle & 1 ) /* Nozzle is odd, so increment */
- line += lx5000dev->lineIncrement;
- for ( ; line <= lastLine; line += ( lx5000dev->lineIncrement << 1 ) )
- {
- _1stIndex = (uchar)( line & COLOUR_BUF_MASK );
- colourLines[_1stIndex].xByte =
- startPtr.xByte + _1stIndex * lx5000dev->penLineLen;
- colourLines[_1stIndex].xBit = startPtr.xBit;
- }
- }
-}
-
-/*----------------------------------------------------------------------*
- * p r i n t S w i p e ( ) *
- *----------------------------------------------------------------------*
- *----------------------------------------------------------------------*/
-private void
-printSwipe( lx5000_device *lx5000dev, byte *colourBufs[NUM_COLOURS],
- bufBit
- colourLines[NUM_COLOURS][PENS_PER_COLOUR][COLOUR_BUF_LINES],
- penData pens[NUM_COLOURS][PENS_PER_COLOUR],
- bool lineEmpty[NUM_COLOURS][COLOUR_BUF_LINES], byte *swipeBuf,
- int *nextLineToPrint, int *nextLineToGet, int direction,
- int _1stColour, int lastColour, FILE *prn_stream )
-{
- /*--------------------------------------------------------------------*
- For unidirectional colour swathes, the effective print direction on
- a 5000 is reversed. The implication of this is that, once the extent
- of the printing columns has been determined, the data for the colour
- pens must be fed to the head bit-reversed; i.e., set the bit pointer
- to the last column to be printed, and decrement the bit pointer until
- all of the columns have been printed.
- *--------------------------------------------------------------------*/
-
- static const char swipeHeader[SWIPE_HDR_LEN] = {
- SWIPE_LEADER,
- 0, 0, 0, 0, /* command length */
- 0, /* direction */
- 0, /* head speed */
- 0, 0, /* pen selector */
- 0, /* nozzle count */
- 0, /* don't know */
- 0, 0, /* number of columns */
- 0, 0, /* 1st column */
- 0, 0, /* last column */
- SWIPE_HDR_END
- };
-
- static const int wordsPerPen[NUM_COLOURS][PENS_PER_COLOUR + 1] =
- {
- { -1,
- BLACK_NOZZLES / SWIPE_WORD_BITS,
- BLACK_NOZZLES / SWIPE_WORD_BITS / 2
- },
- { -1,
- _1COLOUR_NOZZLES / SWIPE_WORD_BITS,
- _1COLOUR_NOZZLES / SWIPE_WORD_BITS / 2
- },
- { -1,
- _1COLOUR_NOZZLES / SWIPE_WORD_BITS,
- _1COLOUR_NOZZLES / SWIPE_WORD_BITS / 2
- },
- { -1,
- _1COLOUR_NOZZLES / SWIPE_WORD_BITS,
- _1COLOUR_NOZZLES / SWIPE_WORD_BITS / 2
- }
- };
-
- int _1stNozzle[NUM_COLOURS][PENS_PER_COLOUR];
- /* 1st active nozzle for pen */
- int lastNozzle[NUM_COLOURS][PENS_PER_COLOUR];
- /* Last nozzle of this pen */
- int _1stLine[NUM_COLOURS][PENS_PER_COLOUR];
- /* Line no. of first print line for pen */
- int _1stPenColumn[NUM_COLOURS][PENS_PER_COLOUR];
- int lastPenColumn[NUM_COLOURS][PENS_PER_COLOUR];
- /* Per-pen values... */
- int penExtent[NUM_COLOURS][PENS_PER_COLOUR];
- int _1stColumn; /* ...and overall values of... */
- int lastColumn;
- int columnExtent; /* Column range after */
- /* stripping leading and trailing white space*/
- int column; /* Loop variable - current column */
- int line; /* Loop variables - line corresponding to
- current nozzle & temp line variable. */
- uchar lineIndex; /* Circular index into pen buffer,
- corresponding to current line. */
- int swipeCmdLen; /* Length of the swipe command */
- int colour, pen;
- byte *outp;
- int x_dpi = (int)( lx5000dev->x_pixels_per_inch + 0.1 );
-
- /* Initialize worst case values for column
- extremities. */
- _1stColumn = lx5000dev->penLineBytes * 8
- + 7 + lx5000dev->headSeparation;
- lastColumn = 0;
- /* Set up extents on a per-colour basis. */
- for ( colour = _1stColour; colour <= lastColour; colour++ )
- for ( pen = 0; pen < lx5000dev->pensPerColour; pen++ )
- {
- _1stLine[colour][pen] = pens[colour][pen].nextPrintLine;
- _1stNozzle[colour][pen] = _1stLine[colour][pen]
- - pens[colour][pen].topLine;
- lastNozzle[colour][pen] = pens[colour][pen].bottomLine
- - pens[colour][pen].topLine;
-
- setColourColumnExtent( lx5000dev, colourBufs[colour],
- lineEmpty[colour], _1stLine[colour][pen],
- _1stNozzle[colour][pen],
- pens[colour][pen].bottomLine,
- &_1stPenColumn[colour][pen],
- &lastPenColumn[colour][pen],
- &penExtent[colour][pen] );
- /* Get the overall extents for the swipe */
- if ( _1stPenColumn[colour][pen] < _1stColumn )
- _1stColumn = _1stPenColumn[colour][pen];
- if ( lastPenColumn[colour][pen] > lastColumn )
- lastColumn = lastPenColumn[colour][pen];
- }
- /* Set overall extent */
- columnExtent = ( lastColumn - _1stColumn ) + 1;
-
- /* Set the column range for each of the colour
- pens now that the full extent is known. */
- for ( colour = _1stColour; colour <= lastColour; colour++ )
- for ( pen = 0; pen < lx5000dev->pensPerColour; pen++ )
- {
- setColourLines( lx5000dev, colourBufs[colour],
- colourLines[colour][pen],
- _1stLine[colour][pen], _1stNozzle[colour][pen],
- pens[colour][pen].bottomLine, direction,
- _1stColumn, lastColumn );
- }
-
- memcpy( swipeBuf, swipeHeader, SWIPE_HDR_LEN );
- outp = swipeBuf + SWIPE_HDR_LEN;
- /* For each column of the output, build two
- stripes. One uses the standard directory
- scheme, and the other uses the repeat
- compression scheme. Output the more
- compact result. */
- for ( column = _1stColumn; column <= lastColumn; column++ )
- {
- ushort dataword; /* Loop transient - contents of swipe data
- word currently under construction. */
- ushort lastWord; /* Last data word constructed for repeat
- compression directory method. */
- int nozzle; /* Loop variable - current nozzle */
- /* The arrays of the two sets of data words
- generated by each of the swipe construction
- methods for a single swipe. Does not
- include the 16 bit directory word. */
- int wordCount1; /* The count of words in the column arrays, */
- int wordCount2; /* below. */
- ushort column1[BLK_SWIPE_WORDS];
- ushort column2[BLK_SWIPE_WORDS];
- int columnWord; /* Current word within column. */
- bufBit *lineBit; /* Loop transient - current scan line bit */
- ushort wordBit; /* Current bit within swipe word - incremented
- by right shifts. */
- ushort directoryBit; /* Current bit within directory word. It
- indicates the currently active set of 16
- nozzles. Incremented by left shifts. */
- ushort directory1; /* The directories for the two methods. Each */
- ushort directory2; /* bit controls one following 16bit word. */
-
- if ( _1stColour == BLACK_X )
- {
- directory1 = (ushort)(BLK_DIRECTORY_MASK); /* empty */
- directory2 = (ushort)(BLK_DIRECTORY_MASK); /* empty */
- }
- else
- {
- directory1 = (ushort)(COLOUR_DIRECTORY_MASK); /* empty */
- directory2 = (ushort)(COLOUR_DIRECTORY_MASK); /* empty */
- }
- directory1 |= DIRECTORY_TYPE_BIT; /* Normal directory */
- directory2 &= ~DIRECTORY_TYPE_BIT; /* Repeat compression
- directory */
- /* LSBit of directory refers to 1st following
- word */
- directoryBit = 1;
- lastWord = 0;
- wordCount1 = 0;
- wordCount2 = 0;
- /* Note that the order of the pens in the
- datawords (top nozzle to bottom) is
- CMY, the reverse of the numbering */
- /*------------------------------------------
- N.B. What are the implications of this for
- pen processing within a colour?
- -----------------------------------------*/
- for ( colour = lastColour; colour >= _1stColour; colour-- )
- for ( pen = 0; pen < lx5000dev->pensPerColour; pen++ )
- {
- dataword = 0;
- nozzle = 0;
- line = _1stLine[colour][pen];
- /* If there are any non-printing nozzles at
- the top of the printhead, set up the entries
- for them here. */
- while ( ( ( _1stNozzle[colour][pen] - nozzle )
- >= SWIPE_WORD_BITS )
- && ( nozzle <= lastNozzle[colour][pen] ) )
- {
- if ( lastWord != 0 )
- {
- directory2 &= ~directoryBit;
- column2[ wordCount2++ ] = dataword;
- lastWord = dataword;
- }
- nozzle += SWIPE_WORD_BITS;
- directoryBit <<= 1;
- }
- /* Shift over any remaining empty bits in
- the current column word. */
- wordBit = ( 1 << ( SWIPE_WORD_BITS - 1 ));
- wordBit >>= ( _1stNozzle[colour][pen] - nozzle );
-
- for ( columnWord = _1stNozzle[colour][pen] / SWIPE_WORD_BITS;
- columnWord <
- wordsPerPen[colour][lx5000dev->pensPerColour];
- columnWord++ )
- {
- while ( wordBit )
- {
- lineIndex = (uchar)( line & COLOUR_BUF_MASK );
- /* Get the bit from the next line */
- lineBit = &colourLines[colour][pen][lineIndex];
- if ( *(lineBit->xByte) & lineBit->xBit )
- dataword |= wordBit;
- wordBit >>= 1;
- if ( direction == LEFTWARD )
- {
- DEC_BIT( *lineBit );
- }
- else
- {
- INC_BIT( *lineBit );
- }
- line += lx5000dev->lineIncrement;
- }
- /* Do we have a non-null dataword? */
- if ( dataword )/* For normal compression, every nonempty */
- { /* dataword is noted and sent to printer */
- directory1 &= ~directoryBit;
- column1[ wordCount1++ ] = dataword;
- }
- if ( dataword != lastWord ) /* For repeat compression, */
- { /* only datawords which change are recorded */
- directory2 &= ~directoryBit;
- column2[ wordCount2++ ] = dataword;
- lastWord = dataword;
- }
- /* Look at next set of nozzles */
- directoryBit <<= 1;
- dataword = 0;
- /* Reset dataword bit mask to 1st bit */
- wordBit = ( 1 << ( SWIPE_WORD_BITS - 1 ));
- }
- }
- /* Output the smaller array of column words -
- is it normal or repeat compressed? */
- if ( wordCount1 < wordCount2 )
- { /* A normal directory + data */
- int i;
-
- *outp++ = directory1 >> 8;
- *outp++ = directory1 & 0xff;
- for ( i = 0; i < wordCount1; i++ )
- {
- *outp++ = column1[ i ] >> 8;
- *outp++ = column1[ i ] & 0xff;
- }
- }
- else
- { /* A repeat compression directory + data */
- int i;
-
- *outp++ = directory2 >> 8;
- *outp++ = directory2 & 0xff;
- for ( i = 0; i < wordCount2; i++ )
- {
- *outp++ = column2[ i ] >> 8;
- *outp++ = column2[ i ] & 0xff;
- }
- }
- }
- /* Set up the header and output the swipe */
- swipeCmdLen = outp - swipeBuf;
- {
- int ps1, ps2, direction, density, nozzles;
-
- direction = UNIDIRECTIONAL;
- if ( x_dpi == 300 )
- {
- density = _300X;
- }
- else
- {
- if ( x_dpi == 1200 )
- density = _1200X;
- else
- density = _600X;
- }
-
- if ( _1stColour == BLACK_X )
- {
- ps1 = BLACK0;
- ps2 = BLACK1;
- nozzles = _208NOZZLES;
- }
- else
- {
- ps1 = COLOUR0;
- ps2 = COLOUR1;
- nozzles = _192NOZZLES;
- }
- FILL_SWIPE_HEADER( swipeBuf, swipeCmdLen, direction, density,
- ps1, ps2, nozzles, UNKNOWN1VAL,
- columnExtent, _1stColumn, lastColumn );
- }
- fwrite( swipeBuf,1, outp - swipeBuf, prn_stream );
-
- for ( colour = _1stColour; colour <= lastColour; colour++ )
- for ( pen = 0; pen < lx5000dev->pensPerColour; pen++ )
- {
- /* Scan the buffer for the next print line,
- if present. If not, set sentinel value. */
- if ( pens[colour][pen].nextPrintLine
- <= pens[colour][pen].bottomLine
- || pens[colour][pen].nextPrintLine >= *nextLineToGet )
- {
- pens[colour][pen].nextPrintLine =
- pens[YELLOW_X][LO_PEN].finalLine;
- line = pens[colour][pen].bottomLine + 1;
- while ( line < *nextLineToGet )
- {
- lineIndex = (uchar)( line & COLOUR_BUF_MASK );
- if ( ! lineEmpty[colour][ lineIndex ] )
- {
- pens[colour][pen].nextPrintLine = line;
- break;
- }
- line += lx5000dev->lineIncrement;
- }
- }
- }
-}
-
-/*----------------------------------------------------------------------*
- * l x 5 0 0 0 _ p r i n t _ p a g e ( ) *
- *----------------------------------------------------------------------*
- Send the page to the printer.
- *----------------------------------------------------------------------*/
-private int
-lx5000_print_page( gx_device_printer *pdev, FILE *prn_stream )
-{
- /*
- Data structures for the buffer:
-
- ------------------------------------------------------------------*
- C O L O U R B U F F E R S
- ------------------------------------------------------------------*
- The colour buffers contain the individual colour bits that will
- actually be passed to the print heads; therefore, there is one bit
- per printable element. So far, the correspondence between the
- gx_color_index elements in the scan line and the individual print
- bits is 1-to-1.
-
- For the colour driver, the colour buffers will be:
- Cbuffer, Mbuffer, Ybuffer and Kbuffer
- while for the black driver, only Kbuffer is used.
- (See BUFFER HANDLING MACROS.)
-
- ------------------------------------------------------------------*
- D E T E R M I N I N G B U F F E R S I Z E
- ------------------------------------------------------------------*
- The colour buffers are circular buffers: in order to implement this
- characteristic, the size of the buffer must be 2^n. The buffers may
- then be indexed by the scan line number, masked by 2^n - 1.
-
- The buffer must be able to accommodate the maximum range of scan
- lines that might be affected by a single swipe command. For colour
- pens this is 240 ( 3 x 64 pens + 2 x 24 inter-pen gaps). For the
- black pen, this is 208. Therefore, the minimum buffer size is 256.
- In fact, this is probably also the optimal buffer size, as there seems
- to be no advantage in buffering twice the number of scan line required
- to hold any individual swipe.
-
- ------------------------------------------------------------------*
- S T R U C T U R E O F T H E C O L O U R B U F F E R S
- ------------------------------------------------------------------*
- The colour buffers hold the data for individual colour printheads,
- extracted from the original data provided as scan lines. When the
- data for each colour is extracted from the scan line, it is placed
- into a line of the colour buffer corresponding to the scan line.
-
- Within each line of the colour buffer, the data is structured like so:
- +-------+------------------- ~ ---------------------+-------+
- | Pad | Scan line data bits for one colour | Pad |
- | bytes | | bytes |
- +-------+-------------------------------------------+-------+
-
- When the scan line data is first processed, the colour data is copied
- into the colour buffer in the position indicated above. This line of
- data is padded on both ends. The size of the pad is sufficient to
- account for the number of bits of head separation between the EVEN
- and ODD rows of nozzles in each print head; by default 16.
-
- The individual lines are accessed through an array of colourLines struct-
- ures. This is defined in the TYPEDEFS & EXTERNAL STORAGE secion above.
-
- The colourLines structure contains a byte pointer which points to one of
- the bytes of an individual colour buffer line, and an unsigned char
- which is a single bit mask isolating one bit of the byte pointed to by
- the other element.
- typedef struct bufBit_s {
- byte * xByte;
- uchar xBit;
- } bufBit;
-
- The colourLines structure holds one instance of a bufBit; it points to
- the first bit of the scan line. In general, the bit pointers for the
- first bit of the EVEN columns will point to the beginning of the
- extracted scan line data. For the ODD columns, the first bit
- will point into the leading PAD bytes by 16 bits before the start of
- the actual scan line data.
-
- In this way, all of the complications of managing the separation
- between the EVEN and ODD columns on the heads is contained in the
- set-up procedures for the pointers in the scanLines array. If it is
- required to reverse the adjustments of EVEN and ODD columns (for bi-
- directional printing, for example) this is achieved by adjusting the
- firstBit entries in this array.
-
- That, at any rate, is the theory. It seemed like a good idea at the
- time.
-
- */
-
- static const unsigned char init_string[] = {
- 0xa5, 0, 6, 0x40, 3, 3, 0xc0, 0x0f, 0x0f,
- 0xa5, 0, 3, 0x40, 4, 5,
- 0xa5, 0, 3, 0x40, 4, 6,
- 0xa5, 0, 3, 0x40, 4, 7,
- 0xa5, 0, 3, 0x40, 4, 8,
- 0xa5, 0, 4, 0x40, 0xe0, 0xb, 3,
- 0xa5, 0, 11, 0x40, 0xe0, 0x41, 0, 0, 0, 0, 0, 0, 0, A5_11_5000,
- 0xa5, 0, 6, 0x40, 5, 0, 0, 0x80, 0,
- 0x1b, '*', 7, 0x73, 0x30,
- 0x1b, '*', 'm', 0, 0x14, 3, 0x84, 2, 0, 1, 0xf4,
- 0x1b, '*', 7, 0x63,
- 0x1b, '*', 'm', 0, 0x42, 0, 0,
- 0xa5, 0, 5, 0x40, 0xe0, 0x80, 8, 7
- };
-
- byte *lineBuffer;
- byte *swipeBuffer;
- byte *colourBufs[ NUM_COLOURS ];
- bufBit colourLines[NUM_COLOURS][PENS_PER_COLOUR][COLOUR_BUF_LINES];
- bool lineEmpty[ NUM_COLOURS ][ COLOUR_BUF_LINES ];
- penData pens[ NUM_COLOURS ][ PENS_PER_COLOUR ];
- /* nextLineToPrint is the top unprinted line
- in the buffers. It is adjusted as lines
- are processed and printed. Its sentinel
- value is pens[YELLOW_X][LO_PEN].finalLine.
- When any line
- which is not blank is read from GS &
- processed, nextLineToPrint will be set to
- this line if it is less than the current
- value.
-
- nextLineToGet is the next scanline to read
- from GS. */
- int nextLineToPrint;
- int nextLineToGet = 0;
- /* The current bottom line position of
- the colour cartridge. */
- int bottomYellowLine;
- int retval;
-
- lx5000_device *lx5000dev = (lx5000_device *)pdev;
-
- nextLineToPrint = pens[YELLOW_X][LO_PEN].finalLine;
- bottomYellowLine = INITIAL_YELLOW_BOTTOM_LINE;
- /* Allocate the buffer storage */
- if ( ( retval = getColourBufs( lx5000dev, &lineBuffer, colourBufs,
- &swipeBuffer, ALLOCATE ) ))
- return retval;
-
- initPenConstants( lx5000dev, pens );
- /* Initialize the lineEmpty[] and pens[] arrays -
- should happen during parameter setup process */
- {
- int colour, pen, line;
-
- for ( colour = 0;
- colour < lx5000dev->color_info.num_components;
- colour++ )
- {
- for ( pen = 0; pen < lx5000dev->pensPerColour; pen++ )
- {
- pens[colour][pen].nextPrintLine =
- pens[YELLOW_X][LO_PEN].finalLine;
-
- pens[colour][pen].bottomLine =
- pens[colour][pen].initialBottomLine;
- pens[colour][pen].topLine =
- bottomYellowLine
- - pens[colour][pen].topToBottomYellow;
- }
- for ( line = 0; line < COLOUR_BUF_LINES; line++ )
- /* Force the zeroing of the line first time through */
- lineEmpty[colour][line] = false;
- }
- }
-
- /* Initialize the printer and reset margins. */
- pageInit( (uchar)lx5000dev->alignA, (uchar)lx5000dev->alignB, prn_stream );
- fwrite( init_string, 1, sizeof( init_string ), prn_stream );
-
- /*--------------------------------------------------------------*
- Assume that COLOUR_BUF_LINES of data are available, starting with
- nextLineToPrint. Work out which cartridge will be doing the
- printing, and how far it will have to move.
-
- Something is available to be printed. This may (should?) involve
- initial paper movement to line up the appropriate pen. Deciding
- on when to move the paper and by how much is tricky. One aim is
- to minimize paper movements.
-
- Check for black vs colour printing first. If the required
- movement for any of the colour pens is less than the required
- movement for the black pen, print a colour swathe, adjust all of
- the colour buffer values, and the nextLineToPrint value if
- necessary.
-
- Then refreshBuffer() and take another look. Sooner or later,
- the next required movement of the colour cartridge will exceed
- the movement required of the black cartridge. Print a black
- swathe. Whether to move the black cartridge for this print is
- determined by checking on the subsequent colour cartridge
- movement.
-
- If the difference between the required movement for the black
- and the required movement for the colour is less than or equal
- to one colour pen depth, do not move the pen before printing the
- black swathe.
-
- Adjust black buffer values, including nextLineToPrint, which will
- (almost?) certainly change after a black print. refreshBuffer()
- and try again.
-
- A note on 192 vs 208 black swathes. I can see the reasons for
- using the 192 swathes. When printing solid blocks with some of
- each colour and black on each scan line, use of 192 nozzles
- obviates the need for any black-related head movement. A black
- swathe can be printed on every third movement of the heads, and,
- in the circumstances sketched above, will use all 192 nozzles.
-
- Obviously, the same simple algorithm can be used when the colours
- are less densely packed. The Alignment B value, coded into the
- header of every swipe command, automatically adjusts the first
- pen of the set of 192 within a range of 0-15, so that the 192
- nozzles are symmetrically arranged with respect to the colour
- pens. The complication is that the EVEN/ODD status of the
- nozzles in the 208 set is unaffected, even though the numbering
- may change.
-
- It originally seemed to me that it was completely unnecessary
- to use the 192 nozzle set. The alignment value was needed to
- get the positioning right, but for all other purposes, the
- 208 set could be used, and adjustments made on the fly.
- However, I when considering the printing of pseudo 1200Y
- pages, which involves the use of half-height pseudo-pens, it
- became clear that the calculation of the half-height of a
- pens would be greatly simplified by the use of 192 nozzles.
- This would leave the height of a pseudo-pen at an integral
- number of 16-bit datawords.
-
- As a result, I will use 192 nozzles only when printing at
- Nx1200Ydpi.
-
- *--------------------------------------------------------------*/
- refreshBuffer( lx5000dev, &nextLineToGet, &nextLineToPrint,
- lineBuffer, colourBufs, colourLines, pens, lineEmpty );
- while ( nextLineToPrint < pdev->height )
- {
- int blackDirection = RIGHTWARD;
- int colourDirection = LEFTWARD;
- /* Target of next move of colour cartridge */
- int nextColourLine;
- int nextBlack208Line = cartridgeMoveTo( lx5000dev, pens,
- BLACK_X,
- BLACK_X );
-
- /* In Black-only mode, cartridgeMoveTo
- will return an off-page value for the
- colour pens. */
- nextColourLine = cartridgeMoveTo( lx5000dev, pens,
- _1ST_CMY_COLOUR,
- LAST_CMY_COLOUR );
- if ( lx5000dev->isCMYK && nextColourLine <= nextBlack208Line )
- { /* Move the head & print a 3-colour swathe */
- feedPaper( lx5000dev, nextColourLine, &bottomYellowLine, pens,
- prn_stream );
- printSwipe( lx5000dev, colourBufs, colourLines, pens,
- lineEmpty, swipeBuffer,
- &nextLineToPrint, &nextLineToGet, colourDirection,
- _1ST_CMY_COLOUR, LAST_CMY_COLOUR,
- prn_stream );
- }
- else
- {
- feedPaper( lx5000dev, nextBlack208Line, &bottomYellowLine,
- pens, prn_stream );
- printSwipe( lx5000dev, colourBufs, colourLines, pens,
- lineEmpty, swipeBuffer,
- &nextLineToPrint, &nextLineToGet, blackDirection,
- BLACK_X, BLACK_X,
- prn_stream );
- }
- refreshBuffer( lx5000dev, &nextLineToGet, &nextLineToPrint,
- lineBuffer, colourBufs, colourLines, pens, lineEmpty );
- } /* ends the loop for swipes of the print head.*/
-
- /* Eject the page, reinitialize the printer */
- pageEnd( prn_stream );
- fflush( prn_stream );
- getColourBufs( lx5000dev, &lineBuffer, colourBufs, &swipeBuffer,
- DEALLOCATE );
- if ( lx5000dev->dryTime )
- sleep( lx5000dev->dryTime );
-
- return 0;
-}
-
-/*
- * There are a number of parameters which can differ between ink cartridges.
- * The Windows driver asks you to recalibrate every time you load a new
- * cartridge.
- *
- * [The Lexmark 5700 black
- * cartridge has two columns of dots, separated by about 16 pixels.
- * This `head separation' distance can vary between cartridges, so
- * we provide a parameter to set it. In my small experience I've not
- * set the corresponding parameter in windows to anything greater than 17
- * or smaller than 15, but it would seem that it can vary from 1 to 32,
- * based on the calibration choices offered.
- * Stephen Taylor's comment on the 5700 ]
- *
- * N.B. The above discussion relates to the 5700. On the 5000, in the
- * Windows driver at any rate, there is no adjustment for the pixel
- * distance between the rows of jets on the one print head.
- *
- * There are, however, two values which are always encoded into the initial
- * escape sequence that the Windows driver sends to the printer for each
- * new page: alignA the horizontal alignment between the colour and the
- * black pens, and alignB, the vertical alignment between the same pens.
- *
- * AlignC is a black-only alignment, which seems to have something to do
- * with bi-directional alignment.
- *
- * AlignD is a colour-only alignment, corresponding to AlignC.
- *
- * [As I understand the rules laid out in gsparams.h,
- * lx5000_get_params is supposed to return the current values of parameters
- * and lx5000_put_params is supposed to set up values in the lx5000_device
- * structure which can be used by the lx5000_print_page routine.
- * I've copied my routines from gdevcdj.c
- * Stephen Taylor]
- *
- * DryingTime is a delay to allow page drying before a new page is fed
- * through.
- *
- * CMYK is a boolean parameter which specifies colour capability. Set
- * -dCMYK=false for black-only printing.
- *
- * See lx5000_put_params() for the legal ranges of values for these parameters.
- *
- */
-
-/*----------------------------------------------------------------------*
- * l x 5 0 0 0 b _ g e t _ p a r a m s ( ) *
- *----------------------------------------------------------------------*/
-private int
-lx5000_get_params( gx_device *pdev, gs_param_list *plist )
-/*----------------------------------------------------------------------*/
-{
- lx5000_device *lx5000dev = (lx5000_device *)pdev;
- int code = gdev_prn_get_params( pdev, plist );
-
- if ( code < 0 ||
- ( code =
- param_write_int( plist, "HeadSeparation",
- &lx5000dev->headSeparation )) < 0 ||
- ( code = param_write_int(plist, "AlignA", &lx5000dev->alignA)) < 0 ||
- ( code = param_write_int(plist, "AlignB", &lx5000dev->alignB)) < 0 ||
- ( code = param_write_bool( plist, "CMYK", &lx5000dev->isCMYK )) < 0 ||
- ( code = param_write_bool( plist,
- "DryingTime", &lx5000dev->dryTime )) < 0
- )
- return code;
-
- return code;
-}
-
-/*----------------------------------------------------------------------*
- * l x 5 0 0 0 b _ p u t _ p a r a m _ i n t ( ) *
- *----------------------------------------------------------------------*/
-private int
-lx5000_put_param_int(
- gs_param_list *plist, gs_param_name pname,
- int *pvalue, int minval, int maxval, int ecode
- )
-/*----------------------------------------------------------------------*/
-{
- int code, value;
-
- switch ( code = param_read_int( plist, pname, &value ) )
- {
- default:
- return code;
- case 0:
- if ( value < minval || value > maxval )
- {
- code =
- param_signal_error( plist, pname, gs_error_rangecheck );
- ecode = ( code < 0 ? code : ecode );
- }
- else
- *pvalue = value;
- case 1:
- return ecode;
- }
-}
-
-/*----------------------------------------------------------------------*
- * l x 5 0 0 0 b _ p u t _ p a r a m _ b o o l ( ) *
- *----------------------------------------------------------------------*/
-private int
-lx5000_put_param_bool(
- gs_param_list *plist, gs_param_name pname,
- bool *pvalue, int ecode
- )
-/*----------------------------------------------------------------------*/
-{
- int code;
-
- switch ( code = param_read_bool( plist, pname, pvalue ) )
- {
- default:
- ecode = code;
- param_signal_error(plist, pname, ecode);
- return code;
- case 1:
- case 0:
- return ecode;
- }
-}
-
-/*----------------------------------------------------------------------*
- * l x 5 0 0 0 b _ p u t _ p a r a m s ( ) *
- *----------------------------------------------------------------------*/
-private int
-lx5000_put_params( gx_device *pdev, gs_param_list *plist )
-/*----------------------------------------------------------------------*/
-/* put_params is supposed to check all the parameters before setting any. */
-/*----------------------------------------------------------------------*/
-{
- lx5000_device *lx5000dev = (lx5000_device *)pdev;
-
- int ecode, code = 0;
- int headSeparation = lx5000dev->headSeparation;
- int alignA = lx5000dev->alignA;
- int alignB = lx5000dev->alignB;
- int dryTime = lx5000dev->dryTime;
- int bitsPerPixel = lx5000dev->isCMYK ? 4 : 1;
- int oldBPP = bitsPerPixel;
- bool isCMYK = lx5000dev->isCMYK;
- bool isCMYK_old = isCMYK;
-
- code = lx5000_put_param_int( plist, "HeadSeparation", &headSeparation,
- 8, 24, code ); /* 8 - 24 columns */
-
- code = lx5000_put_param_int( plist, "AlignA", &alignA, 0, 30, code );
- /* 0 - 30 columns */
-
- code = lx5000_put_param_int( plist, "AlignB", &alignB, 0, 15, code );
- /* 0 -15 nozzles */
-
- code = lx5000_put_param_int( plist, "DryingTime", &dryTime, 0, 60, code );
- /* 0 -60 seconds */
-
- code = lx5000_put_param_int
- ( plist, "BitsPerPixel", &bitsPerPixel, 1, 4, code );
- /* Black cartridge only */
-
- code = lx5000_put_param_bool( plist, "CMYK", &isCMYK, code );
- /* Black cartridge only */
-
- /* Take precautions against input errors */
- if ( bitsPerPixel != 1 ) { bitsPerPixel = 4; }
-
- if ( isCMYK != isCMYK_old || bitsPerPixel != oldBPP )
- {
- bool isCMYK_new;
- /* What has changed? Assume that initial values were consistent,
- and set isCMYK to a value consistent with the changed args
- If both have changed, give precedence to isCMYK
- */
- if ( bitsPerPixel != oldBPP )
- {
- if ( bitsPerPixel == 1 )
- { isCMYK_new = false; }
- else
- { isCMYK_new = true; };
- }
- if ( isCMYK != isCMYK_old )
- { isCMYK_new = isCMYK; }
-
- isCMYK = isCMYK_new;
- bitsPerPixel = isCMYK ? 4 : 1;
-
- if ( isCMYK )
- {
- lx5000dev->color_info = color_info_cmy;
- dev_proc(pdev, map_cmyk_color) = lx5000_map_cmyk_color;
- dev_proc(pdev, map_rgb_color) = NULL;
- dev_proc(pdev, map_color_rgb) = lx5000_map_color_rgb;
- }
- else
- {
- lx5000dev->color_info = color_info_blk;
- dev_proc(pdev, map_cmyk_color) = NULL;
- dev_proc(pdev, map_rgb_color) = gdev_prn_map_rgb_color;
- dev_proc(pdev, map_color_rgb) = gdev_prn_map_color_rgb;
- }
- if ( pdev->is_open )
- gs_closedevice(pdev);
- }
-
- /* call super class put_params */
- ecode = gdev_prn_put_params( pdev, plist );
-
- if ( ecode < 0 || code < 0 )
- {
- if ( isCMYK != isCMYK_old )
- {
- if ( ! isCMYK )
- {
- lx5000dev->color_info = color_info_cmy;
- dev_proc(pdev, map_cmyk_color) = lx5000_map_cmyk_color;
- dev_proc(pdev, map_rgb_color) = NULL;
- dev_proc(pdev, map_color_rgb) = lx5000_map_color_rgb;
- }
- else
- {
- lx5000dev->color_info = color_info_blk;
- dev_proc(pdev, map_cmyk_color) = NULL;
- dev_proc(pdev, map_rgb_color) = gdev_prn_map_rgb_color;
- dev_proc(pdev, map_color_rgb) = gdev_prn_map_color_rgb;
- }
- if ( pdev->is_open )
- gs_closedevice(pdev);
- }
- return ecode < 0 ? ecode : code;
- }
-
- /* looks like everything okay; */
- /* go ahead and set parameters */
- lx5000dev->headSeparation = headSeparation;
- lx5000dev->alignA = alignA;
- lx5000dev->alignB = alignB;
- lx5000dev->dryTime = dryTime;
- lx5000dev->isCMYK = isCMYK;
- /* N.B. I am only setting these values here -
- should they also be set as part of the "two
- phase commit" of parameter changes? My
- code is the only place these things are
- accessed. */
- if ( lx5000dev->y_pixels_per_inch == MAX_LX5000_Y )
- {
- lx5000dev->pensPerColour = 2;
- lx5000dev->lineIncrement = 2;
- }
- else
- {
- lx5000dev->pensPerColour = 1;
- lx5000dev->lineIncrement = 1;
- }
- if ( code == 1 ) return ecode;
- return 0;
-}
-
-
-/*----------------------------------------------------------------------*
- * The following colour handling procedures are lifted from gdevbit.c
- *----------------------------------------------------------------------*/
-/* Map color to RGB. This has 3 separate cases, but since it is rarely */
-/* used, we do a case test rather than providing 3 separate routines. */
-private int
-lx5000_map_color_rgb(gx_device * dev, gx_color_index color,
- gx_color_value rgb[3])
-{
- int depth = dev->color_info.depth;
- int ncomp = dev->color_info.num_components;
- int bpc = depth / ncomp;
- uint mask = (1 << bpc) - 1;
-
-#define cvalue(c) ((gx_color_value)((ulong)(c) * gx_max_color_value / mask))
-
- /* Map CMYK back to RGB. */
-
- gx_color_index cshift = color;
- uint c, m, y, k;
-
- k = cshift & mask;
- cshift >>= bpc;
- y = cshift & mask;
- cshift >>= bpc;
- m = cshift & mask;
- c = cshift >> bpc;
- /* We use our improved conversion rule.... */
- rgb[0] = cvalue((mask - c) * (mask - k) / mask);
- rgb[1] = cvalue((mask - m) * (mask - k) / mask);
- rgb[2] = cvalue((mask - y) * (mask - k) / mask);
-
- return 0;
-#undef cvalue
-}
-
-/* Map CMYK to color. */
-private gx_color_index
-lx5000_map_cmyk_color(gx_device * dev, const gx_color_value cv[])
-{
- int bpc = dev->color_info.depth / 4;
- int drop = sizeof(gx_color_value) * 8 - bpc;
- gx_color_value cyan = cv[0], magenta = cv[1], yellow = cv[2], black = cv[3];
- gx_color_index color =
- ((((((cyan >> drop) << bpc) +
- (magenta >> drop)) << bpc) +
- (yellow >> drop)) << bpc) +
- (black >> drop);
-
- return (color == gx_no_color_index ? color ^ 1 : color);
-}
-
-/*=============== Clean up my #define's =================*/
-#undef A5_11_5000
-#undef A5_11_5700
-#undef ALIGN_A_DEF
-#undef ALIGN_A_OFFSET
-#undef ALIGN_B_DEF
-#undef ALIGN_B_OFFSET
-#undef HEADSEP_DEF
-#undef DRY_TIME_DEF
-#undef LX_UNI
-#undef MIN_LX5000_X
-#undef MAX_LX5000_X
-#undef DEF_LX5000_X
-#undef MIN_LX5000_Y
-#undef MAX_LX5000_Y
-#undef DEF_LX5000_Y
-#undef LX5000_XDPI
-#undef LX5000_YDPI
-#undef FEED_FACTOR
-#undef LX5000_XOFFSET_TO_0_0_XDPI
-#undef LX5000_YOFFSET_TO_0_0_YDPI
-#undef LX5000_XOFFSET_TO_0_0
-#undef LX5000_YOFFSET_TO_0_0
-#undef LX5000_LEFT_HWMARGIN_INS
-#undef LX5000_BOTTOM_HWMARGIN_INS
-#undef LX5000_RIGHT_HWMARGIN_INS
-#undef LX5000_TOP_HWMARGIN_INS
-#undef LINE_PAD_BYTES
-#undef RIGHTWARD
-#undef LEFTWARD
-#undef SWIPE_WORD_BITS
-#undef BLACK_NOZZLES
-#undef _1COLOUR_NOZZLES
-#undef BLK_COLOUR_NOZZLES
-#undef BLK_SWIPE_WORDS
-#undef COLOUR_SWIPE_WORDS
-#undef _1COLOUR_WORDS
-#undef BLK_DIRECTORY_MASK
-#undef COLOUR_DIRECTORY_MASK
-#undef DIRECTORY_TYPE_BIT
-#undef COLOUR_PEN_GAP
-#undef COLOUR_PEN_DIFF
-#undef INITIAL_YELLOW_BOTTOM_LINE
-#undef COLOUR_BUF_MASK
-#undef COLOUR_BUF_LINES
-#undef SWIPE_LEADER
-#undef CMDLEN_X
-#undef DIRECTION_X
-#undef UNIDIRECTIONAL
-#undef BIDIRECTIONAL
-#undef HEADSPEED_X
-#undef _300X
-#undef _600X
-#undef _1200Y
-#undef PEN_X
-#undef BLACK0
-#undef BLACK1
-#undef COLOUR0
-#undef COLOUR1
-#undef NOZZLE_COUNT_X
-#undef _192NOZZLES
-#undef _208NOZZLES
-#undef UNKNOWN1_X
-#undef UNKNOWN1VAL
-#undef NUM_COLUMNS_X
-#undef _1ST_COLUMN_X
-#undef LAST_COLUMN_X
-#undef SWIPE_HDR_END_X
-#undef SWIPE_HDR_END_LEN
-#undef SWIPE_HDR_END
-#undef SWIPE_HDR_LEN
-#undef BLACK_X
-#undef YELLOW_X
-#undef MAGENTA_X
-#undef CYAN_X
-#undef LO_PEN
-#undef HI_PEN
-#undef NUM_COMPONENTS_BLK
-#undef BITS_PER_PIXEL_BLK
-#undef MAX_GREY_BLK
-#undef MAX_RGB_BLK
-#undef DITHER_GREYS_BLK
-#undef DITHER_COLOURS_BLK
-#undef NUM_COMPONENTS_CMY
-#undef BITS_PER_PIXEL_CMY
-#undef MAX_GREY_CMY
-#undef MAX_RGB_CMY
-#undef DITHER_GREYS_CMY
-#undef DITHER_COLOURS_CMY
-#undef MIN_COLOUR
-#undef MAX_COLOUR
-#undef BLACK_PEN
-#undef _1ST_CMY_COLOUR
-#undef LAST_CMY_COLOUR
-#undef BPP
-#undef PIXEL_MASK
-#undef INITIAL_PIXEL_SHIFT
-#undef NUM_COLOURS
-#undef PENS_PER_COLOUR
-#undef NUM_PENS
-#undef BITS_PER_COLOUR
-#undef DEF_NUM_COLOURS
-#undef DEF_PENS_PER_COLOUR
-#undef DEF_LINE_INCREMENT
-#undef PIXELS_PER_BYTE
-#undef COLOUR_MASK
-#undef ALLOCATE
-#undef DEALLOCATE
-#undef FILL_SWIPE_HEADER
-#undef BIT_TO_MASK
-#undef INC_BIT
-#undef DEC_BIT
-#undef lx5000_proctab
diff --git a/gs/contrib/gdevlx7.c b/gs/contrib/gdevlx7.c
deleted file mode 100644
index 830e9467e..000000000
--- a/gs/contrib/gdevlx7.c
+++ /dev/null
@@ -1,850 +0,0 @@
-#include "gdevprn.h"
-/* Copyright (C) 1989-1994, 1998, 1999 Aladdin Enterprises. All rights reserved.
- This file is part of GNU Ghostscript.
-
- GNU 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 GNU General Public License for full details.
-
- Everyone is granted permission to copy, modify and redistribute GNU
- Ghostscript, but only under the conditions described in the GNU General
- Public License. A copy of this license is supposed to have been given to
- you along with GNU 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.
-
- Aladdin Enterprises is not affiliated with the Free Software Foundation or
- the GNU Project. GNU Ghostscript, as distributed by Aladdin Enterprises,
- does not depend on any other GNU software.
-*/
-/*
- * $Id: gdevlx7.c,v 1.5 2002/08/03 03:08:26 tillkamppeter Exp $
- * Lexmark 7000 ink-jet "GDI" printer driver
- * * just started...
- *
- * Henryk Paluch paluch@bimbo.fjfi.cvut.cz
- * http://bimbo.fjfi.cvut.cz/~paluch/l7kdriver/
- *
- * BIG thanks to Peter B. West that discovered and described many
- * "funny" things of the Lexmark 5xxx protocol.
- *
- * THIS GHOSTSCRIPT DRIVER USES MANY THINGS FROM
- * STEPHEN'S LEXMARK 5700 GHOSCRIPT DRIVER:
- *
- * Stephen Taylor setaylor@ma.ultranet.com staylor@cs.wpi.edu
- * http://www.ultranet.com/~setaylor/papers.htm
- *
- * ALL INTRODUCED BUGS ARE PROPERTY OF HENRYK :-)
- */
-
-/* our private driver constants */
- /* Lexmark 7xxx,5xxx swipe height of Black & White cartridge */
-#define LX7_BSW_H 208
-
- /* Lexmark 7xxx,5xxx swipe height of Colour cartridge */
-#define LX7_CSW_H 192
-
- /* maximum data bytes per packet: 13 * 2 = 26
- * 13 - compression bits, 2 = data words
- */
-#define LX7_MAX_SWBYTES 26
- /* 13 * 2 databytes + 2 bytes for header = 28 bytes */
-#define LX7_MAX_PACKET 28
-#define LX7_MAX_SWWORDS 13
-
-/* interlaced printing for 1200dpi - vertical offset of lines */
-/* they must be odd. The sum must be 208 */
-/* these are for Ink Jet distance */
-#define LXH_SKIP1 99
-#define LXH_SKIP2 109
-/* doubled values for real paper shift */
-#define LXH_DSKIP1 (LXH_SKIP1*2-1)
-#define LXH_DSKIP2 (LXH_SKIP2*2+1)
-/* Lexmark 7000 prologue */
-/* 1st time initialization - INIT1 is common for all modes */
-#define LX7_INIT1 0x1b,0x2a,0x6d,0x00,0x40,0x10,0x03,0x10,0x11
-
-/* LX_INIT2 - for 1200dpi - currently not needed */
-#define LX7_INIT2 0xa5,0x00,0x06,0x50,0x03,0x03,0xc0,0x0f,0x0f, \
- 0xa5,0x00,0x03,0x50,0x04,0x05, \
- 0xa5,0x00,0x03,0x50,0x04,0x06, \
- 0xa5,0x00,0x03,0x50,0x04,0x07, \
- 0xa5,0x00,0x03,0x50,0x04,0x08, \
- 0xa5,0x00,0x04,0x50,0x04,0x0c,0x00, \
- 0xa5,0x00,0x04,0x50,0xe0,0x0b,0x03
-/* LX_INIT3 - after 1200dpi prologue, or immediately after INIT1
- * in other modes
- */
-#define LX7_INIT3 0xa5,0x00,0x0b,0x50,0xe0,0x41,0x00,\
- 0x00,0x00,0x00,0x00,0x00,0x00,0x02,\
- 0xa5,0x00,0x06,0x50,0x05,0x00,0x00,0x80,0x00, \
- 0xa5,0x00,0x04,0x50,0x04,0x0c,0x00
-/* this is used also for new page prologue ... */
-#define LX7_INIT4 0x1b,0x2a,0x07,0x73,0x30
-#define LX7_INIT5 0x1b,0x2a,0x07,0x63
-/* mysterious reinitialization ???? */
-#define LX7_INIT6 0x1b,0x2a,0x6d,0x00,0x42,0x00,0x00
-#define LX7_INIT7 0xa5,0x00,0x05,0x40,0xe0,0x80,0x07,0x08
-
-static byte lx7_fullinit[]={LX7_INIT1, /*LX7_INIT2, LX7_INIT3,*/ LX7_INIT4,
- LX7_INIT5, LX7_INIT6};
-static byte lx7_pageinit[]={LX7_INIT4, LX7_INIT4, LX7_INIT5, LX7_INIT6};
-
-#ifndef MIN
-#define MIN(x,y) ( (x) < (y) ? (x) : (y))
-#endif
-#ifndef MAX
-#define MAX(x,y) ( (x) > (y) ? (x) : (y))
-#endif
-
-/* The procedure descriptors */
-/* declare functions */
-private dev_proc_print_page(lxmgen_print_page);
-private dev_proc_get_params(lxm_get_params);
-private dev_proc_put_params(lxm_put_params);
-
-/* set up dispatch table. I follow gdevdjet in using gdev_prn_output_page */
-static const gx_device_procs lxm7000m_procs =
- prn_params_procs(gdev_prn_open, gdev_prn_output_page, gdev_prn_close,
- lxm_get_params, lxm_put_params);
-
-/* The device descriptors */
-
-/* define a subclass with useful state in it. */
-typedef struct lxm_device_s { /* a sub-class of gx_device_printer */
- gx_device_common;
- gx_prn_device_common;
- int headSeparation;
- byte *fullInit;
- int nfullInit;
- byte *pageInit;
- int npageInit;
- int printertype;
-} lxm_device;
-
-/* Lexmark types (faster lookup than strcmp("lex7000",...) ...
- * stored in 'printertype' variable
- */
-
-#define LXT_7000 0
-#define LXT_5700 1
-#define LXT_3200 2
-#define LXT_2050 3
-
-/* resolution map - used by "associate" arrays - do not modify */
-#define LXR_300 0
-#define LXR_600 1
-#define LXR_1200 2
-
-lxm_device far_data gs_lex7000_device = {
- prn_device_std_body(lxm_device, lxm7000m_procs, "lex7000",
- DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,
- /* total width & height in 10x " - A4 or letter compiled in.
- * may be overriden by -sPAPERSIZE=a4 of -sPAPERSIZE=letter
- */
- 600, 600, /* x dpi, y dpi */
- 0.0, 0.1, 0.3, 0.1, /* margins */
- /* unlike most other Ink printers Lexmark is able to print at
- * whole top and bottom of paper :-)
- */
- 1, lxmgen_print_page),
- /* 1 = bits per color, generic routines*/
-
- /* our extended attributes follow...*/
- 16, /* default headSeparation value */
- lx7_fullinit,
- sizeof(lx7_fullinit),
- lx7_pageinit,
- sizeof(lx7_pageinit),
- LXT_7000
-};
-
-lxm_device far_data gs_lex5700_device = {
- prn_device_std_body(lxm_device, lxm7000m_procs, "lex5700",
- DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,
- /* total width & height in 10x " - A4 or letter compiled in.
- * may be overriden by -sPAPERSIZE=a4 of -sPAPERSIZE=letter
- */
- 600, 600, /* x dpi, y dpi */
- 0.1, 0.1, 0.1, 0.0, /* margins */
- /* unlike most other Ink printers Lexmark is able to print at
- * whole top and bottom of paper :-)
- */
- 1, lxmgen_print_page),
- /* 1 = bits per color, generic routines*/
-
- /* our extended attributes follow...*/
- 16, /* default headSeparation value */
- lx7_fullinit,
- sizeof(lx7_fullinit),
- lx7_pageinit,
- sizeof(lx7_pageinit),
- LXT_5700
-};
-
-lxm_device far_data gs_lex3200_device = {
- prn_device_std_body(lxm_device, lxm7000m_procs, "lex3200",
- DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,
- /* total width & height in 10x " - A4 or letter compiled in.
- * may be overriden by -sPAPERSIZE=a4 of -sPAPERSIZE=letter
- */
- 600, 600, /* x dpi, y dpi */
- 0.1, 0.1, 0.1, 0.0, /* margins */
- /* unlike most other Ink printers Lexmark is able to print at
- * whole top and bottom of paper :-)
- */
- 1, lxmgen_print_page),
- /* 1 = bits per color, generic routines*/
-
- /* our extended attributes follow...*/
- 16, /* default headSeparation value */
- lx7_fullinit,
- sizeof(lx7_fullinit),
- lx7_pageinit,
- sizeof(lx7_pageinit),
- LXT_3200
-};
-
-lxm_device far_data gs_lex2050_device = {
- prn_device_std_body(lxm_device, lxm7000m_procs, "lex2050",
- DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,
- /* total width & height in 10x " - A4 or letter compiled in.
- * may be overriden by -sPAPERSIZE=a4 of -sPAPERSIZE=letter
- */
- 600, 600, /* x dpi, y dpi */
- 0.1, 0.1, 0.1, 0.0, /* margins */
- /* unlike most other Ink printers Lexmark is able to print at
- * whole top and bottom of paper :-)
- */
- 1, lxmgen_print_page),
- /* 1 = bits per color, generic routines*/
-
- /* our extended attributes follow...*/
- 16, /* default headSeparation value */
- lx7_fullinit,
- sizeof(lx7_fullinit),
- lx7_pageinit,
- sizeof(lx7_pageinit),
- LXT_2050
-};
-
-
-
-
-#define get_lx_type(pdev) \
- (((lxm_device*)pdev)->printertype)
-
-
-
-/* ------ Local Lexmark printer utilities ------*/
-
-#define LX_LINE_EMPTY(buf,len) \
- (buf[0]==0 && memcmp(buf,buf+1,len-1)==0)
-
-private byte ofs8[8]={128,64,32,16,8,4,2,1};
-/* Lexmark 5xxx, 7xxx page eject */
-private void lex_eject(FILE *out)
-{
- byte buf[4]={0x1b,0x2a,0x7,0x65};
-#ifdef DEBUG
- dprintf("Sending page eject.\n");
-#endif
- fwrite(buf,sizeof(buf),1,out);
-}
-
-/*
- * shift paper (skip empty lines)
- * offset is in pixels in 1200 dpi resolution, i. e.,
- * 384 for 192 pixels or
- * 416 for 208 pixels etc...
- */
-private void paper_shift(FILE *out,int offset)
-{
- byte buf[5]={0x1b,0x2a,0x3,0x0,0x0};
- buf[3]=(byte)(offset >> 8); /* just to be endian safe we don't use short */
- buf[4]=(byte)(offset & 0xFF);
-#ifdef DEBUG
- dprintf3("paper_shift() %d 1200dpi = %d 600dpi = %d 300dpi pixels\n",
- offset,offset/2,offset/4);
-#endif
- fwrite(buf,sizeof(buf),1,out);
-}
-
-/* return coordinate of leftmost pixel (in pixels) */
-private int leftmost_pixel(byte *buf, int bytelen)
-{
- int i;
- byte *r=buf;
- byte b;
- if (LX_LINE_EMPTY(buf,bytelen)) /* catch empty line */
- return bytelen*8-1;
-
- while( *r==0 && bytelen>0)
- {
- r++;
- bytelen--;
- }
-
- b= *r;
- for(i=0;i<8;i++)
- if ( ( b & ofs8[i])!=0)
- break;
- return (r-buf)*8+i;
-}
-
-/* return coordinate of rightmost pixel (in pixels) */
-private int rightmost_pixel(byte *buf, int bytelen)
-{
- int i;
- byte *r=buf+(bytelen-1);
- byte b;
- if (LX_LINE_EMPTY(buf,bytelen)) /* catch empty line */
- return 0;
-
- while( *r==0 && bytelen>1)
- {
- r--;
- bytelen--;
- }
-
- b= *r;
- for(i=7;i>=0;i--)
- if ( ( b & ofs8[i])!=0)
- break;
- return (r-buf)*8+i;
-}
-
-/* find leftmost and rightmost pixel in whole pass
- * buf - pixel buffer
- * bytelen - width of line (in bytes)
- * bufheight - buffer height (pixels)
- * interlaced - if even lines have different horizontal offset
- * than odd lines
- * intershift - horizontal offset between even/odd lines
- * leftmost,
- * rightmost - output
- */
-private void find_lr_pixels(byte *buf[],int bytelen,int bufheight,
- int interlaced, int intershift,
- int *leftmost, int *rightmost)
-{
- int maxright=bytelen*8-1;
- int left=maxright;
- int right=0;
- int i;
-
- for(i=0;i<bufheight;i++)
- {
- int ltmp,rtmp;
- ltmp=leftmost_pixel(buf[i],bytelen);
- rtmp=rightmost_pixel(buf[i],bytelen);
-#if 0
- dprintf3("buf[%d]: leftmost %d, rightmost %d\n",
- i,ltmp,rtmp);
-#endif
- if (interlaced && (i & 1)==1) /* interlaced && line is odd */
- {
- ltmp=MAX((ltmp-intershift),0);
- rtmp=MIN((rtmp+intershift),maxright);
- if (ltmp==maxright)
- ltmp--; /* print at least one pixel to avoid races ?? */
- }
- if (ltmp<left)
- left=ltmp;
- if (rtmp>right)
- right=rtmp;
- }
-
- *leftmost = left;
- *rightmost = right;
- return;
-}
-
-
-/* ------ Driver procedures ------ */
-
-/*** THIS NEED TO BE REWORKED SOON ***/
-private const int LEFT_MARGIN=50;
-private const int VERTSIZE=LX7_BSW_H;
-/* offsets to print line sequence (defined in outbuf)
- */
-private const int IDX_SEQLEN=5;
-private const int IDX_HORRES=8;
-private const int IDX_PACKETS=13;
-private const int IDX_5700DIF=12;
-private const int IDX_HSTART=15;
-private const int IDX_HEND=17;
-private const int IDX_DATA=26;
-private const int IDX_CARTRIDGE=10;
-
-#define DIV8(x) ( (x) >> 3 )
-#define MOD8(x) ( (x) & 0x7 )
-#define DIV16(x) ( (x) >> 4 )
-#define MOD16(x) ( (x) & 0xf )
- /* too large buffer may hang the printer ?! */
-#define OUT_BUF_SIZE 256000
-/* most important print packet
- * see lexmarkprotocol.txt for more information */
-/* length of complete sequence --- vvvvvvvvv */
-/* this is template now. Outbuf is allocated and initialized
- * by lxmgen_print_page() to avoid large static array
- * in gs binary
- */
-private byte outb[]={0x1B,0x2A,0x04,0x00,0x00,0xFF,0xFF,
- /* number of packets ---- vvvvvvvvv */
- 0x00,0x02,0x01,0x01,0x1A,0x11,0xFF,0xFF,
- /* horiz start, horiz end: packets = (horiz end - horiz start) +1 */
- 0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x22,0x33,0x44,0x55,0x01};
-
-#define BITSTART12 4096
-
-private int print_cols(FILE *prn_stream,gx_device_printer *pdev,
- byte *outbuf,
- int left,int right,int vstart, int vend,byte *buf[],
- int width,int LR_SHIFT)
-{
- unsigned char mask[8]={128,64,32,16,8,4,2,1};
- unsigned int mask16[16]={0x8000,0x4000,0x2000,0x1000,
- 0x0800,0x0400,0x0200,0x0100,
- 0x0080,0x0040,0x0020,0x0010,
- 0x0008,0x0004,0x0002,0x0001};
- int l8,r8,packets;
- byte *p=outbuf+IDX_DATA;
- int clen;
- int i,k;
- unsigned int vbuf[LX7_MAX_SWWORDS];
- int vi;
- unsigned char *vp,*vp2;
- int smask,smask2;
-
- l8=left+LEFT_MARGIN;
- r8=right+LEFT_MARGIN;
-
- packets=r8-l8+1;
-
-
- outbuf[IDX_PACKETS] =(unsigned char)(packets >> 8);
- outbuf[IDX_PACKETS+1]=(unsigned char)(packets & 0xFF);
- outbuf[IDX_HSTART] =(unsigned char)(l8 >> 8);
- outbuf[IDX_HSTART+1] =(unsigned char)(l8 & 0xFF);
- outbuf[IDX_HEND] =(unsigned char)(r8 >> 8);
- outbuf[IDX_HEND+1] =(unsigned char)(r8 & 0xFF);
-
- outbuf[IDX_5700DIF]= ( get_lx_type(pdev)==LXT_7000 ? 0x11 : 0x1 );
- /* fill columns */
- for(i=left;i<=right;i++)
- {
- int rle1size,rle2size;
- int bits=0;
- byte *tbits;
-
- if ( (p-outbuf)>=OUT_BUF_SIZE-28 ) /* 13*2+2 */
- {
- return -1;
- }
- tbits=p;
- p+=2; /* add room for RLE packet (2 bytes) */
-
- /* clear buffer of vertical points */
- memset(vbuf,0,sizeof(vbuf));
-
- smask=mask[MOD8(i)];
- smask2=mask[MOD8(i+LR_SHIFT)];
-
- vi=vstart*2; /* vbuf index in pixels (not array index) */
- for(k=vstart;k<vend;k++)
- {
- vp=buf[k*2]+DIV8(i);
- /* vp points to current column for Left Ink */
- vp2=buf[k*2+1]+DIV8(i+LR_SHIFT);
- /* vp2 for right Ink jets */
- if ( ( vp[0] & smask) != 0)
- vbuf[DIV16(vi)] |= mask16[MOD16(vi)];
- vi++;
- if (i+LR_SHIFT<width*8)
- {
- if ( (vp2[0] & smask2) !=0 )
- vbuf[DIV16(vi)] |=mask16[MOD16(vi)];
- }
- vi++;
- }
-
- /* every packet contains 13 info bits
- * 1 = 8x left white, 8x right white
- * 0 = 2 data bytes follow (8 bits left, 8 bits right)
- */
-
- for(k=0;k<LX7_MAX_SWWORDS;k++)
- {
- unsigned int t=vbuf[k];
-
- bits= (bits>>1);
- if (t==0) /* packet is empty */
- {
- bits+=BITSTART12;
- }
- else
- {
- *(p++)=(t >> 8) & 0xFF;
- *(p++)=(t & 0xFF);
- }
- }
- tbits[1]=(unsigned char)( (bits) & 0xFF);
- *tbits =(unsigned char)( ((bits>>8) & 0x1f) | 0x20 );
- rle1size=(p-tbits);
-#if 0
- dprintf1("RLE1(%d), ",rle1size);
-#endif
- if (rle1size>6) /* try to use RLE2 compression for larger packets */
- {
- byte ob[LX7_MAX_PACKET];
- unsigned int lastword=0x8FFF; /* impossible value */
- int byts=0;
- byte *pp=ob+2;
-
- memset(ob,0,LX7_MAX_PACKET);
- for(k=0;k<LX7_MAX_SWWORDS;k++)
- {
- unsigned int t=vbuf[k];
-
- byts= (byts>>1);
- if (t==lastword)
- {
- byts+=BITSTART12;
- }
- else
- {
- *(pp++)=(t >> 8) & 0xFF;
- *(pp++)=(t & 0xFF);
- lastword=t;
- }
- }
- ob[1]=(unsigned char)( (byts) & 0xFF);
- ob[0]=(unsigned char)( (byts>>8) & 0x1f );
- rle2size=(pp-ob);
-#if 0
- dprintf1("RLE2(%d), ",rle2size);
-#endif
-
- if (rle1size>rle2size)
- {
-#if 0
- dprintf2("\n**RLE2 WIN** %d > %d \n",rle1size,rle2size);
- dprintf("\nUsing RLE2 compression\n");
-#endif
- memcpy(tbits,ob,rle2size);
- p=tbits+rle2size;
- }
- }
- }
-
-
- /* ------------ */
- clen=p-outbuf;
- outbuf[IDX_SEQLEN-1] =(unsigned char)(clen >> 16);
- outbuf[IDX_SEQLEN] =(unsigned char)(clen >> 8);
- outbuf[IDX_SEQLEN+1]=(unsigned char)(clen & 0xFF);
- fwrite(outbuf,1,clen,prn_stream);
-#ifdef DEBUG
- dprintf1("\nSent %d data bytes\n",clen);
-#endif
- return 0;
-}
-
-
-/*** THIS NEED TO BE REWORKED SOON - END ***/
-
-/* Send the page to the printer. */
-/* Lexmark generic print page routine */
-private int
-lxmgen_print_page(gx_device_printer *pdev, FILE *prn_stream)
-{
- int pheight=pdev->height; /* page height (pixels) */
-#ifdef DEBUG
- int pwidth=pdev->width; /* page width (pixels) */
-#endif
- int bwidth=gdev_mem_bytes_per_scan_line((gx_device*)pdev);
- /* page width (bytes) */
-
- int prest=pheight; /* Page Rest number of lines to remain ... */
- int brest; /* Buffer rest for buffer copy */
- int skipline=208; /* number of empty lines, e.g. skip them */
- /* we need to move paper under cartridge..
- * about 208 pixels... */
- byte *pbuf; /* printer buffer - dynamic allocation */
- byte *ppbuf,*ppbuf2; /* pointer returned by _prn_get_bits() */
- byte *outbuf; /* output buffer - used by print_cols(),
- * but allocated here, to avoid unnecessary
- * de & allocation
- */
- int pbufsize,rpbufsize; /* printer buffer size */
- int hres,vres;
- int interlaced;
- int lr_shift=((lxm_device*)pdev)->headSeparation;
- byte *obp[LX7_BSW_H]; /* pointers to buffer lines */
- int bufHeight;
-
- /* initiate vres mapping variable */
- vres=LXR_600; /* default vertical resolution */
- if (pdev->y_pixels_per_inch<301.0)
- vres=LXR_300;
- if (pdev->y_pixels_per_inch>=601.0)
- vres=LXR_1200;
-
- bufHeight=LX7_BSW_H;
- if (vres==LXR_300)
- {
- bufHeight /= 2;
- skipline /= 2;
- }
- if (vres==LXR_1200)
- {
- bufHeight *= 2;
- skipline *=2;
- }
-
- pbufsize = bwidth * bufHeight;
- rpbufsize = bwidth * (bufHeight+1);
-#ifdef DEBUG
- dprintf1("[%s] print_page() start\n",pdev->dname);
- dprintf1("Is first page? %d\n",gdev_prn_file_is_new(pdev));
- dprintf1("Head Separation %d\n",((lxm_device*)pdev)->headSeparation);
- dprintf2("Width %d pixels, %d bytes\n",pwidth,bwidth);
- dprintf1("Height %d pixels\n",pheight);
- dprintf1("One pass buffer size %d\n",pbufsize);
- dprintf1("Output buffer size %d\n",OUT_BUF_SIZE);
- dprintf2("Current resolution is %f width x %f height dpi\n",
- pdev->x_pixels_per_inch, pdev->y_pixels_per_inch );
-#endif
- pbuf = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), rpbufsize, 1, "lxmgen_print_page(pbuf)");
- if (pbuf == NULL)
- return_error(gs_error_VMerror);
-
- outbuf = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), OUT_BUF_SIZE, 1, "lxmgen_print_page(outbuf)");
- if (outbuf == NULL)
- {
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char*)pbuf,pbufsize, 1, "lxmgen_print_page(pbuf)");
- return_error(gs_error_VMerror);
- }
- /* initialize begin of outbuf ... */
- memcpy(outbuf,outb,sizeof(outb));
-
- /* zero fake line (used for non-interlaced resolutions etc)...*/
- memset(pbuf+pbufsize,0,bwidth);
-
-
- /* initiate hres mapping variable */
- hres=LXR_600; /* default horizontal resolution */
- if (pdev->x_pixels_per_inch<301.0)
- hres=LXR_300;
- if (pdev->x_pixels_per_inch>=601.0)
- hres=LXR_1200;
- /* adjust headSeparation according to horizontal resolution */
- if (hres==LXR_300)
- lr_shift >>=1;
- if (hres==LXR_1200)
- lr_shift <<=1;
-
- interlaced=1; /* all resolutions except vert 300dpi are interlaced*/
-
- /* adjust horizontal motor speed for current resolution */
- if (get_lx_type(pdev)==LXT_7000 || get_lx_type(pdev)==LXT_5700)
- {
- byte mspeed[3]={1,2,5}; /* LXR_300=0, LXR_600=1, LXR_1200=2 */
- outbuf[IDX_HORRES]=mspeed[hres];
- }
-
-#ifdef DEBUG
- dprintf1("Choosed motor speed %d\n",(int)outbuf[IDX_HORRES]);
-#endif
-
-
- if(vres==LXR_600)
- {
- int i;
- for(i=0;i<LX7_BSW_H;i++)
- obp[i]=pbuf+(i*bwidth);
- }
-
- if(vres==LXR_300)
- {
- int i;
- for(i=0;i<LX7_BSW_H;i++)
- if ( (i & 1)!=0)
- obp[i]=pbuf+pbufsize; /* odd line is empty for 300dpi */
- else
- obp[i]=pbuf+(i/2*bwidth);
- }
-
-
-
-
- if(gdev_prn_file_is_new(pdev))
- fwrite(((lxm_device*)pdev)->fullInit,
- ((lxm_device*)pdev)->nfullInit,
- 1,prn_stream);
- else
- fwrite(((lxm_device*)pdev)->pageInit,
- ((lxm_device*)pdev)->npageInit,
- 1,prn_stream);
-
-
- while(prest>0)
- {
- int i;
- int leftmost; /* position of leftmost pixel */
- int rightmost; /* position of rightmost pixel */
- int c1200; /* testing empty line for 1200dpi... */
-
- /* copy one line & test for all zeroes */
- gdev_prn_get_bits(pdev, pheight-prest, /* current line No. */
- pbuf, /* our buffer if needed */
- &ppbuf); /* returns pointer to scanline
- * either our buffer or
- * gs internal data buffer
- */
- if (vres==LXR_1200 && (pheight-prest+LXH_DSKIP1<pheight))
- {
- gdev_prn_get_bits(pdev, pheight-prest+LXH_DSKIP1,
- /* current line No. */
- pbuf+bwidth, /* our buffer if needed */
- &ppbuf2);
- c1200=LX_LINE_EMPTY(ppbuf2,bwidth);
- }
- else
- c1200=1;
-
- /* test for empty line (nice Stephen's trick w/ memcmp() :-) */
- if (LX_LINE_EMPTY(ppbuf,bwidth) && c1200)
- { /* line empty */
- prest--;
- skipline++;
- continue; /* Loop thgrough the while(prest>0) ... */
- }
-
- /* 1pass printing for 300 & 600 dpi */
- /* 2pass printing for 1200dpi */
- for(i=0;i<(vres==LXR_1200 ? 2 : 1);i++)
- {
- /* skip empty lines on paper, if any */
- if (skipline>0)
- {
- int mult[3]={4,2,1}; /* multiply: 300dpi=4, 600dpi=2, 1200dpi=1 */
- paper_shift(prn_stream,skipline*mult[vres]);
- skipline=0;
- }
-
- /* for 1200dpi we need to setup interlaced buffer entries */
- if (vres==LXR_1200)
- {
- int j;
- for(j=0;j<LX7_BSW_H;j++)
- if ( (j & 1)!=i) /* i==0 for 1st pass i==1 for 2nd pass */
- obp[j]=pbuf+pbufsize; /* "odd" line is empty for 300dpi */
- else
- obp[j]=pbuf+(j*2*bwidth);
- }
-
-
- /* copy remaining lines to buffer */
- brest=MIN(bufHeight,prest);
-
-#ifdef DEBUG
- dprintf2("Copying %d lines to buffer, vertpos %d\n",brest,
- pheight-prest);
-#endif
- gdev_prn_copy_scan_lines(pdev,pheight-prest,pbuf,pbufsize);
- /* zero unused lines (on bottom of page) */
- if (bufHeight-brest>0)
- memset(pbuf+(brest*bwidth),0,(bufHeight-brest)*bwidth);
-
- /* look for leftmost and rightmost pixels */
- find_lr_pixels(obp,bwidth,LX7_BSW_H,interlaced,
- ((lxm_device*)pdev)->headSeparation,
- &leftmost,&rightmost);
-#ifdef DEBUG
- dprintf2("Leftmost pixel %d, rightmost pixel %d\n",
- leftmost,rightmost);
-#endif
-
- /* print the data */
- if (leftmost<rightmost)
- if (print_cols(prn_stream,pdev,outbuf,leftmost,rightmost,
- 0,VERTSIZE/2,obp,bwidth,lr_shift)==-1)
- {
- print_cols(prn_stream,pdev,outbuf,leftmost,rightmost,0,
- VERTSIZE/4,obp,bwidth,lr_shift);
-
- print_cols(prn_stream,pdev,outbuf,leftmost,rightmost,
- VERTSIZE/4,VERTSIZE/2,
- obp,bwidth,lr_shift);
-
-#ifdef DEBUG
- dprintf("Overflow workaround used\n");
-#endif
- }
-
- if (vres!=LXR_1200)
- {
- skipline=brest; /* skip already printed lines */
- }
- else
- {
- skipline+=( i==0 ? LXH_DSKIP1 : LXH_DSKIP2 );
- }
- prest-=skipline; /* decrease number of remaining lines */
- if (prest<=0)
- break;
- }
- }
-
- /* eject page */
- lex_eject(prn_stream);
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char*)pbuf,rpbufsize, 1, "lxmgen_print_page(pbuf)");
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char*)outbuf,OUT_BUF_SIZE, 1, "lxmgen_print_page(outbuf)");
-
-#ifdef DEBUG
- dprintf1("[%s] print_page() end\n",pdev->dname);
-#endif
- return 0;
-}
-
- private int
-lxm_get_params(gx_device *pdev, gs_param_list *plist)
-{
- lxm_device* const ldev = (lxm_device*)pdev;
- int code = gdev_prn_get_params(pdev, plist);
-
- if ( code < 0 ) return code;
- code = param_write_int(plist,
- "HeadSeparation",
- (int *)&(ldev->headSeparation));
-
- return code;
-}
-
-/* put_params is supposed to check all the parameters before setting any. */
-private int
-lxm_put_params(gx_device *pdev, gs_param_list *plist)
-{
- int ecode;
- lxm_device* const ldev = (lxm_device*)pdev;
- int trialHeadSeparation=ldev->headSeparation;
- int code = param_read_int(plist, "HeadSeparation", &trialHeadSeparation);
-
- if ( trialHeadSeparation < 1 || trialHeadSeparation > 32 )
- param_signal_error(plist, "HeadSeparation", gs_error_rangecheck);
- /* looks like param_signal_error is not expected to return */
- ecode = gdev_prn_put_params(pdev, plist); /* call super class put_params */
- if ( code < 0 ) return code;
- if (ecode < 0) return ecode;
-
- /* looks like everything okay; go ahead and set headSeparation */
- ldev->headSeparation = trialHeadSeparation;
- if ( code == 1) return ecode; /* I guess this means there is no "HeadSeparation" parameter */
- return 0;
-}
-
diff --git a/gs/contrib/gdevmd2k.c b/gs/contrib/gdevmd2k.c
deleted file mode 100644
index 4e8d4a89a..000000000
--- a/gs/contrib/gdevmd2k.c
+++ /dev/null
@@ -1,792 +0,0 @@
-/* Copyright (C) 1991, 1995-1999 Aladdin Enterprises. All rights reserved.
-
- This file is part of Aladdin Ghostscript.
-
- Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND. No author
- or distributor accepts any responsibility for the consequences of using it,
- or for whether it serves any particular purpose or works at all, unless he
- or she says so in writing. Refer to the Aladdin Ghostscript Free Public
- License (the "License") for full details.
-
- Every copy of Aladdin Ghostscript must include a copy of the License,
- normally in a plain ASCII text file named PUBLIC. The License grants you
- the right to copy, modify and redistribute Aladdin Ghostscript, but only
- under certain conditions described in the License. Among other things, the
- License requires that the copyright notice and this notice be preserved on
- all copies.
-*/
-
-/*$Id: gdevmd2k.c,v 1.4 2002/07/12 20:46:29 tillkamppeter Exp $*/
-/* ALPS MD series printer driver for Ghostscript 5.xx */
-/*
- * 1999-04-18 Ver. 0.1 Masakazu Higaki <higamasa@dd.mbn.or.jp>
- * 1999-05-02 Ver. 0.2a
- */
-
-#include "gdevprn.h"
-#include "gsparam.h"
-#include <stdlib.h>
-#include <limits.h>
-
-#define MM_PER_INCH 25.4
-#define TOP_MARGIN 12. / MM_PER_INCH
-#define BOTTOM_MARGIN 15. / MM_PER_INCH
-#define LEFT_MARGIN 3.4 / MM_PER_INCH
-#define RIGHT_MARGIN 3.4 / MM_PER_INCH
-
-/* The device descriptor */
-private dev_proc_open_device(alps_open);
-private dev_proc_get_params(alps_get_params);
-private dev_proc_put_params(alps_put_params);
-private dev_proc_print_page(md2k_print_page);
-private dev_proc_print_page(md5k_print_page);
-private dev_proc_map_cmyk_color(alps_map_cmyk_color);
-private dev_proc_map_cmyk_color(alps_map_cmy_color);
-private dev_proc_map_rgb_color(alps_map_rgb_color);
-private dev_proc_map_color_rgb(alps_map_color_rgb);
-
-
-struct gx_device_alps_s {
- gx_device_common;
- gx_prn_device_common;
- bool color; /* grayscale / color */
- bool dither;
- bool manualFeed;
- bool reverseSide;
- bool ecoBlack;
- int mediaType;
- int cyan; /* weight for cyan */
- int magenta; /* weight for magenta */
- int yellow; /* weight for yellow */
- int black; /* weight for black */
-};
-
-typedef struct gx_device_alps_s gx_device_alps;
-
-#define dev_alps ((gx_device_alps *) pdev)
-
-private gx_device_procs alps_procs = {
- alps_open,
- gx_default_get_initial_matrix,
- NULL, /* sync_output */
- gdev_prn_output_page,
- gdev_prn_close,
- NULL, /* map_rgb_color,*/
- alps_map_color_rgb,
- NULL, /* fill_rectangle */
- NULL, /* tile_rectangle */
- NULL, /* copy_mono */
- NULL, /* copy_color */
- NULL, /* draw_line */
- NULL, /* get_bits */
- alps_get_params,
- alps_put_params,
- alps_map_cmyk_color,
- NULL, /* get_xfont_procs */
- NULL, /* get_xfont_device */
- NULL, /* map_rgb_alpha_color */
- gx_page_device_get_page_device /* get_page_device */
-};
-
-#define alps_device(dname, print_page) \
-{\
- prn_device_body(gx_device_alps, alps_procs, dname,\
- DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,\
- 600, 600,\
- 0, 0, 0, 0, /* margin */\
- 4, 0, 0, 0, 0, 0, print_page),\
- true, false, false, false, false, 0, 1024, 1024, 1024, 1024\
-}
-
-gx_device_alps far_data gs_md2k_device = alps_device("md2k", md2k_print_page);
-gx_device_alps far_data gs_md5k_device = alps_device("md5k", md5k_print_page);
-
-/* Printer types */
-typedef enum {
- MD2000,
- MD1000,
- MD5000
-} alps_printer_type;
-
-
-private int
-alps_open(gx_device *pdev)
-{
- int xdpi = pdev->x_pixels_per_inch;
- int ydpi = pdev->y_pixels_per_inch;
- const float margins[4] = {
- LEFT_MARGIN,
- BOTTOM_MARGIN,
- RIGHT_MARGIN,
- TOP_MARGIN
- };
- float density;
-
- gx_device_set_margins(pdev, margins, true);
-
- /* resolution check */
- if ((ydpi != 300 || xdpi != 300)
- && (ydpi != 600 || xdpi != 600)
- && (ydpi != 600 || xdpi != 1200))
- return_error(gs_error_rangecheck);
-
- density = (xdpi == 300 ? 0.75 : xdpi == 600 ? 0.44 : 0.4);
- dev_alps->cyan *= density;
- dev_alps->magenta *= density;
- dev_alps->yellow *= density;
- dev_alps->black *= density;
-
- return gdev_prn_open(pdev);
-}
-
-
-private int
-alps_get_params(gx_device *pdev, gs_param_list *plist)
-{
- gs_param_string mediaType = { "", 1, false };
- int code = gdev_prn_get_params(pdev, plist);
- if (code < 0 ||
- (code = param_write_bool(plist, "Color", &dev_alps->color)) < 0 ||
- (code = param_write_bool(plist, "Dither", &dev_alps->dither)) < 0 ||
- (code = param_write_bool(plist, "ManualFeed",
- &dev_alps->manualFeed)) < 0 ||
- (code = param_write_bool(plist, "ReverseSide",
- &dev_alps->reverseSide)) < 0 ||
- (code = param_write_bool(plist, "EcoBlack",
- &dev_alps->ecoBlack)) < 0 ||
- (code = param_write_int (plist, "Cyan", &dev_alps->cyan)) < 0 ||
- (code = param_write_int (plist, "Magenta", &dev_alps->magenta)) < 0 ||
- (code = param_write_int (plist, "Yellow", &dev_alps->yellow)) < 0 ||
- (code = param_write_int (plist, "Black", &dev_alps->black)) < 0 ||
- (code = param_write_string(plist, "MediaType", &mediaType)) < 0)
- return code;
-
- return code;
-}
-
-private int
-alps_put_param_bool(gs_param_list *plist, gs_param_name pname, int *pvalue,
- int ecode)
-{
- int code, value;
- switch (code = param_read_bool(plist, pname, &value)) {
- default:
- return code;
- case 1:
- return ecode;
- case 0:
- *pvalue = value;
- return (ecode < 0 ? ecode : 1);
- }
-}
-
-private int
-alps_put_param_int(gs_param_list *plist, gs_param_name pname, int *pvalue,
- int minval, int maxval, int ecode)
-{
- int code, value;
- switch (code = param_read_int(plist, pname, &value)) {
- default:
- return code;
- case 1:
- return ecode;
- case 0:
- if (value < minval || value > maxval)
- param_signal_error(plist, pname, gs_error_rangecheck);
- *pvalue = value;
- return (ecode < 0 ? ecode : 1);
- }
-}
-
-/* Put properties. */
-private int
-alps_put_params(gx_device *pdev, gs_param_list *plist)
-{
- int code = 0;
- int bpp = dev_alps->color_info.depth;
- bool color = dev_alps->color;
- bool dither = dev_alps->dither;
- bool manualFeed = dev_alps->manualFeed;
- bool reverseSide = dev_alps->reverseSide;
- bool ecoBlack = dev_alps->ecoBlack;
- int cyan = dev_alps->cyan;
- int magenta = dev_alps->magenta;
- int yellow = dev_alps->yellow;
- int black = dev_alps->black;
- gs_param_string mediaType;
-
- code = alps_put_param_bool(plist, "Color", &color, code);
- code = alps_put_param_bool(plist, "Dither", &dither, code);
- code = alps_put_param_bool(plist, "ManualFeed", &manualFeed, code);
- code = alps_put_param_bool(plist, "ReverseSide", &reverseSide, code);
- code = alps_put_param_bool(plist, "EcoBlack", &ecoBlack, code);
- code = alps_put_param_int (plist, "BitsPerPixel", &bpp, 1, 32, code);
- code = alps_put_param_int (plist, "Cyan", &cyan, 0, 2048, code);
- code = alps_put_param_int (plist, "Magenta", &magenta, 0, 2048, code);
- code = alps_put_param_int (plist, "Yellow", &yellow, 0, 2048, code);
- code = alps_put_param_int (plist, "Black", &black, 0, 2048, code);
-
-#define mediaTypeCmp(mname) strncmp(mediaType.data, mname, mediaType.size)
- if (param_read_string(plist, "MediaType", &mediaType) == 0) {
- dev_alps->mediaType
- = (! mediaTypeCmp("PlainPaper" ) ? 0
- : ! mediaTypeCmp("OHP_MD2000" ) ? 1
- : ! mediaTypeCmp("IronSeal" ) ? 2
- : ! mediaTypeCmp("RebecaFree" ) ? 3
- : ! mediaTypeCmp("CardBoard" ) ? 5
- : ! mediaTypeCmp("PostCard" ) ? 6
- : ! mediaTypeCmp("FinePaper" ) ? 7
- : ! mediaTypeCmp("CoatedFilm" ) ? 9
- : ! mediaTypeCmp("GlossyPaper" ) ? 15
- : ! mediaTypeCmp("TransparencyFilm") ? 0x108
- : ! mediaTypeCmp("OHP" ) ? 0x108 : -1);
- switch (dev_alps->mediaType) {
- case -1:
- param_signal_error(plist, "MediaType", code = gs_error_rangecheck);
- break;
- case 1: /* MD-2000 transparency mode */
- dev_proc(pdev, map_cmyk_color) = alps_map_cmy_color;
- break;
- case 6: /* hagaki */
- pdev->MediaSize[0] = 284;
- pdev->MediaSize[1] = 419;
- default:
- break;
- }
- }
- if (code < 0)
- return code;
-
- dev_alps->color = color;
- dev_alps->dither = dither;
- dev_alps->manualFeed = manualFeed;
- dev_alps->reverseSide = reverseSide;
- dev_alps->ecoBlack = ecoBlack;
- dev_alps->cyan = cyan;
- dev_alps->magenta = magenta;
- dev_alps->yellow = yellow;
- dev_alps->black = black;
-
- if (bpp)
- /* Only valid bits-per-pixel are 1, 4, 8, 32 */
- bpp = (bpp < 4 ? 1 : bpp < 8 ? 4 : bpp > 8 ? 32 : 8);
- else
- bpp = (color ? 4 : 1) * (dither ? 8 : 1);
-
- if (ecoBlack && ! strcmp(pdev->dname, "md5k"))
- bpp = 1;
-
- if (bpp == 1 || bpp == 8)
- dev_proc(pdev, map_rgb_color) = alps_map_rgb_color;
-
- pdev->color_info.depth = bpp;
- pdev->color_info.num_components = (bpp == 1 || bpp == 8 ? 1 : 4);
- pdev->color_info.max_gray = (bpp >= 8 ? 255 : 1);
- pdev->color_info.max_color = (bpp >= 8 ? 255 : bpp > 1 ? 1 : 0);
- pdev->color_info.dither_grays = (bpp >= 8 ? 5 : 2);
- pdev->color_info.dither_colors = (bpp >= 8 ? 5 : bpp > 1 ? 2 : 0);
-
- gdev_prn_put_params(pdev, plist);
- return 0;
-}
-
-
-/*
- * these F/S dithering macros are based on gdevcdj.c
- */
-/* Floyd-Steinberg dithering. Often results in a dramatic improvement in
- * subjective image quality, but can also produce dramatic increases in
- * amount of printer data generated and actual printing time!! Mode 9 2D
- * compression is still useful for fairly flat color or blank areas but its
- * compression is much less effective in areas where the dithering has
- * effectively randomised the dot distribution. */
-
-#define I sizeof(int)
-#define SHIFT ((I * 8) - 13)
-#define RSHIFT ((I * 8) - 16)
-#define RANDOM() (((rand() << RSHIFT) % (MAXVALUE / 2)) - MAXVALUE / 4);
-#define MINVALUE 0
-#define MAXVALUE (255 << SHIFT)
-#define THRESHOLD (128 << SHIFT)
-#define C 8
-
-#define FSdither(inP, out, errP, Err, Bit, Offset)\
- oldErr = Err;\
- Err = (*errP + ((Err * 7 + C) >> 4) + (*inP << SHIFT));\
- inP += Offset;\
- if (Err > THRESHOLD) {\
- out |= Bit;\
- Err -= MAXVALUE;\
- }\
- errP[-Offset] += ((Err * 3 + C) >> 4);\
- *errP++ = ((Err * 5 + oldErr + C) >> 4);
-
-#define FSDline(i, j, len, outP, n)\
-{\
- byte c, bitmask;\
- int Err = 0, oldErr;\
- for (i = 0; i < len; i++) {\
- bitmask = 0x80;\
- for (c = j = 0; j < 8; j++) {\
- FSdither(dp, c, ep, Err, bitmask, n);\
- bitmask >>= 1;\
- }\
- *outP++ = c;\
- }\
-}
-/* END MACROS FOR DITHERING */
-
-/*
- * get a component of CMYK from raster data
- */
-private int
-cmyk_to_bit(byte *out, byte *in, int length, int c_comp)
-{
- byte *p_in = in, *p_out = out, *p_end;
- byte in_data, out_data;
- byte mask1, mask2;
-
- p_end = in + length;
- mask1 = 0x80 >> c_comp;
- mask2 = mask1 >> 4;
-
- while(p_in < p_end) {
- int i;
-
- out_data = 0;
- for(i = 0; i < 4; i ++) {
- in_data = (p_in < p_end ? *p_in++ : 0);
- out_data <<= 2;
- out_data |= (in_data & mask1) >> (6-c_comp)
- | (in_data & mask2) >> (3-c_comp);
- }
- *p_out ++ = out_data;
- }
-
- return p_out - out;
-}
-
-
-/*
- * run-length compression
- */
-private int
-runlength(byte *out, byte *in, int length)
-{
- byte *p_in = in, *p_out = out, *p_end;
- int count, climit, contflag;
-
- p_end = p_in + length;
-
- while(p_in < p_end) {
- /* loop until 3 same data found */
- count = 0;
- climit = min(128, p_end - p_in);
- for( ; count < climit; count++, p_in ++) {
- contflag = (*p_in == *(p_in+1) && *p_in == *(p_in+2));
- if (contflag)
- break;
- }
- if (count > 0) {
- *p_out ++ = count - 1;
- memcpy(p_out, p_in - count, count);
- p_out += count;
- }
-
- if (contflag) {
- climit = min(129, p_end - p_in);
- p_in += 3;
- count = 3;
- for( ; count < climit && *(p_in-1) == *p_in; count++, p_in++);
-
- *p_out ++ = (byte) (0x101 - count);
- *p_out ++ = *(p_in-1);
- }
- }
-
- return p_out - out;
-}
-
-
-#define write_short(data, stream) { \
- fputc((unsigned char) (data), stream); \
- fputc((unsigned short) (data) >> 8, stream); \
-}
-
-#define alps_cmd(cmd1, data, cmd2, stream) { \
- fwrite(cmd1, 1, 3, stream); \
- write_short(data, stream); \
- fputc(cmd2, stream); \
-}
-
-private void
-alps_init(gx_device_printer *pdev, FILE *prn_stream, alps_printer_type ptype)
-{
- short height; /* page height (unit: dots) */
-
- fwrite ("\033\145"
- "\033\045\200\101"
- "\033\032\0\0\114", 1, 11, prn_stream);
- /* paper feed (auto=1, manual=2) */
- alps_cmd("\033\046\154", (dev_alps->manualFeed ? 2 : 1), 0110, prn_stream);
- /* media type */
- alps_cmd("\033\046\154", dev_alps->mediaType, 0115, prn_stream);
-
- /* paper size */
- alps_cmd("\033\046\154", (pdev->MediaSize[0] == 612) ? 2 : /* letter */
- (pdev->MediaSize[0] >= 595 &&
- pdev->MediaSize[0] <= 598) ? 4 : /* A4 */
- (pdev->MediaSize[0] == 516 ||
- pdev->MediaSize[0] == 501) ? 5 : /* B5 */
- (pdev->MediaSize[0] == 284) ? 6 : 0, /* hagaki */
- 0101, prn_stream);
-
- /* monocrome=0, eco black=1, CMYK=4, CMYK(MD-5000)=8 */
- fwrite("\033\052\162", 1, 3, prn_stream);
- fputc((dev_alps->mediaType == 1 ? 4 :
- pdev->color_info.num_components == 1 ? dev_alps->ecoBlack ? 1 : 0
- : ptype == MD5000 ? 8 : 4),
- prn_stream);
- fputc(0125, prn_stream);
-
- /* set resolution (300dpi = 2, 600dpi = 3, 1200x600dpi = 4) */
- fwrite("\033\052\164", 1, 3, prn_stream);
- fputc((pdev->x_pixels_per_inch == 300 ? 2
- : pdev->x_pixels_per_inch == 600 ? 3 : 4), prn_stream);
- fputc(0122, prn_stream);
-
- height = (pdev->MediaSize[1] - pdev->HWMargins[1] - pdev->HWMargins[3])
- * pdev->y_pixels_per_inch / 72.;
- alps_cmd("\033\046\154", height, 0120, prn_stream);
-
- /* if -dReverseSide ... */
- fwrite("\033\032", 1, 2, prn_stream);
- fputc (dev_alps->reverseSide, prn_stream);
- fwrite("\0\101", 1, 2, prn_stream);
-
- if (ptype == MD5000) {
- if (dev_alps->ecoBlack) {
- fwrite("\033\032\001\0\103", 1, 5, prn_stream);
- fwrite("\033\046\154\001\0\103\027", 1, 7, prn_stream);
- } else if (pdev->color_info.num_components == 1)
- fwrite("\033\046\154\001\0\103\0", 1, 7, prn_stream);
- else
- fwrite("\033\046\154\004\0\103\003\002\001\0", 1, 10, prn_stream);
- fwrite("\033\032\0\0\125", 1, 5, prn_stream);
- fwrite("\033\052\162\1\101", 1, 5, prn_stream);
- fwrite("\033\052\142\0\0\115", 1, 6, prn_stream);
- } else {
- fwrite("\033\052\162\0\101", 1, 5, prn_stream);
- fwrite("\033\052\142\2\0\115", 1, 6, prn_stream);
- }
-}
-
-/* Send the page to the printer. */
-private int
-alps_print_page(gx_device_printer *pdev, FILE *prn_stream,
- alps_printer_type ptype)
-{
- int line_size = gdev_mem_bytes_per_scan_line((gx_device *)pdev);
- byte *in, *out, *work, *dp, *outP;
- int y, y_height = pdev->height;
- int c_comp, num_comp = pdev->color_info.num_components;
- int n_comp = (dev_alps->mediaType == 1 ? 3 : num_comp);
- int *error, *ep;
- int i, j;
-
- /* allocate memory */
- work = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), 3+sizeof(int), line_size,
- "alps_print_page(work)");
- if (work == 0)
- return_error(gs_error_VMerror);
- in = work + line_size;
- out = in + line_size;
- error = (int *)(out + line_size);
-
- /* initialize printer */
- alps_init(pdev, prn_stream, ptype);
-
- for(c_comp = 0; c_comp < n_comp; c_comp ++) {
- int yskip = 0;
- int color_weight;
-
- for(i = 0; i < line_size; i ++)
- error[i] = RANDOM();
-
- if (n_comp == 1)
- color_weight = dev_alps->black;
- else
- color_weight = (c_comp < 2
- ? c_comp == 0 ? dev_alps->cyan : dev_alps->magenta
- : c_comp == 2 ? dev_alps->yellow : dev_alps->black);
-
- /* select color (black=0, cyan=1, magenta=2, yellow=3,
- gold=4, metalic red=5, metalic blue=6, silver=7,
- rebeca black=8, rebeca red=9, rebeca blue=10,
- white=11, glossy=14) */
- fwrite("\033\032", 1, 2, prn_stream);
- fputc((n_comp == 1 ? dev_alps->ecoBlack ? 026 : 0 : (c_comp+1) % 4),
- prn_stream);
- fputc((c_comp == n_comp-1 && ptype == MD5000 ? 0200 : 0),
- prn_stream);
- fputc(0162, prn_stream);
-
- for(y = 0; y < y_height; y ++) {
- uint len = line_size;
-
- gdev_prn_get_bits(pdev, y, in, &dp);
-
- switch (pdev->color_info.depth) {
- case 4:
- /* get a component of CMYK from raster data */
- len = cmyk_to_bit(work, dp, len, c_comp);
- dp = work;
- case 1:
- /* remove trailing 0s */
- for( ; len > 0 && dp[len-1] == 0; len --);
- break;
- case 32:
- dp += c_comp;
- case 8:
- outP = work;
- ep = error;
-
- /* remove trailing 0s */
- for( ; len > 0 && dp[len-num_comp] == 0; len -= num_comp);
-
- for(i = 0; i < len; i += num_comp)
- dp[i] = (dp[i] * color_weight) >> 10;
- len = (len / num_comp + 7) >> 3;
-
- FSDline(i, j, len, outP, num_comp);
- dp = work;
- break;
- }
-
- if (len == 0)
- yskip ++;
- else {
- if (yskip) {
- alps_cmd("\033\052\142", yskip, 0131, prn_stream);
- yskip = 0;
- }
- if (ptype == MD5000) {
- int xskip = 0;
-
- /* Count pre print skip octets */
- for( ; len > 0 && *dp == 0; len --, dp ++, xskip ++);
-
- alps_cmd("\033\052\142", len, 0124, prn_stream);
- write_short(xskip, prn_stream);
- fwrite(dp, 1, len, prn_stream);
- } else {
- len = runlength(out, dp, len);
- alps_cmd("\033\052\142", len, 0127, prn_stream);
- fwrite(out, 1, len, prn_stream);
- }
- }
- }
-
- /* rewind */
- if (c_comp + 1 < n_comp)
- fwrite("\033\032\0\0\014", 1, 5, prn_stream);
- }
-
- /* end of print */
- fwrite("\014"
- "\033\052\162\103"
- "\033\045\0\130", 1, 9, prn_stream);
-
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)work, 3+sizeof(int), line_size, "alps_print_page(work)");
- return 0;
-}
-
-private int
-md2k_print_page(gx_device_printer *pdev, FILE *prn_stream)
-{
- return alps_print_page(pdev, prn_stream, MD2000);
-}
-
-private int
-md5k_print_page(gx_device_printer *pdev, FILE *prn_stream)
-{
- return alps_print_page(pdev, prn_stream, MD5000);
-}
-
-
-/* functions below are mainly based on gdevcdj.c */
-/*
- * Map a CMYK color to a color index. We just use depth / 4 bits per color
- * to produce the color index.
- */
-
-#define gx_color_value_to_bits(cv, b) \
- ((cv) >> (gx_color_value_bits - (b)))
-#define gx_bits_to_color_value(cv, b) \
- ((cv) << (gx_color_value_bits - (b)))
-
-#define gx_cmyk_value_bits(c, m, y, k, b) \
- ((gx_color_value_to_bits((c), (b)) << (3 * (b))) | \
- (gx_color_value_to_bits((m), (b)) << (2 * (b))) | \
- (gx_color_value_to_bits((y), (b)) << (b)) | \
- (gx_color_value_to_bits((k), (b))))
-
-#define gx_value_cmyk_bits(v, c, m, y, k, b) \
- (c) = gx_bits_to_color_value(((v) >> (3 * (b))) & ((1 << (b)) - 1), (b)), \
- (m) = gx_bits_to_color_value(((v) >> (2 * (b))) & ((1 << (b)) - 1), (b)), \
- (y) = gx_bits_to_color_value(((v) >> (b)) & ((1 << (b)) - 1), (b)), \
- (k) = gx_bits_to_color_value((v) & ((1 << (b)) - 1), (b))
-
-private gx_color_index
-alps_map_cmyk_color(gx_device* pdev,
- const gx_color_value cv[])
-{
- gx_color_index color;
- gx_color_value c, m, y, k;
-
- c = cv[0]; m = cv[1]; y = cv[2]; k = cv[3];
- switch (pdev->color_info.depth) {
- case 1:
- color = ((c | m | y | k) > gx_max_color_value / 2 ?
- (gx_color_index) 1 : (gx_color_index) 0);
- break;
-
- default:
- {
- int nbits = pdev->color_info.depth;
- ulong weight;
-
- ulong black = (c <= y ? c <= m ? c : m : m <= y ? m : y);
- weight = (black < gx_max_color_value
- ? (gx_max_color_value << 10) / (gx_max_color_value - black)
- : 0);
- c = ((c - black) * weight) >> 10;
- m = ((m - black) * weight) >> 10;
- y = ((y - black) * weight) >> 10;
-
- black += k;
- k = (gx_color_index) (black <= gx_max_color_value
- ? black : gx_max_color_value);
-
- color = gx_cmyk_value_bits(c, m, y, k, nbits >> 2);
- }
- }
-
- return color;
-}
-
-private gx_color_index
-alps_map_cmy_color(gx_device* pdev,
- const gx_color_value cv[])
-{
- int nbits = pdev->color_info.depth;
- gx_color_value c = cv[0], m = cv[1], y = cv[2], k = cv[3];
- ulong weight = ((gx_max_color_value - k) << 10) / gx_max_color_value;
- c = ((c * weight) >> 10) + k;
- m = ((m * weight) >> 10) + k;
- y = ((y * weight) >> 10) + k;
- if (c > gx_max_color_value) c = gx_max_color_value;
- if (m > gx_max_color_value) m = gx_max_color_value;
- if (y > gx_max_color_value) y = gx_max_color_value;
-
- return gx_cmyk_value_bits(c, m, y, 0, nbits >> 2);
-}
-
-/* Mapping of RGB colors to gray values. */
-
-private gx_color_index
-alps_map_rgb_color(gx_device *pdev,
- const gx_color_value cv[])
-{
- gx_color_value r, g, b;
-
- r = cv[0]; g = cv[1]; b = cv[2];
- if (gx_color_value_to_byte(r & g & b) == 0xff) {
- return (gx_color_index) 0; /* White */
- } else {
- gx_color_value c = gx_max_color_value - r;
- gx_color_value m = gx_max_color_value - g;
- gx_color_value y = gx_max_color_value - b;
-
- switch (pdev->color_info.depth) {
- case 1:
- return ((c | m | y) > gx_max_color_value / 2 ?
- (gx_color_index) 1 : (gx_color_index) 0);
- break;
-
- case 8:
-#define red_weight 306
-#define green_weight 601
-#define blue_weight 117
- return ((ulong)c * red_weight
- + (ulong)m * green_weight
- + (ulong)y * blue_weight)
- >> (gx_color_value_bits + 2);
- break;
- }
- }
-
- return (gx_color_index) 0; /* This should never happen. */
-}
-
-/* Mapping of CMYK colors. */
-
-private int
-alps_map_color_rgb(gx_device *pdev,
- gx_color_index color, gx_color_value prgb[3])
-{
- switch (pdev->color_info.depth) {
- case 1:
- prgb[0] = prgb[1] = prgb[2] = gx_max_color_value * (1 - color);
- break;
-
- case 8:
- if (pdev->color_info.num_components == 1) {
- gx_color_value value = (gx_color_value) color ^ 0xff;
-
- prgb[0] = prgb[1] = prgb[2] = (value << 8) + value;
-
- break;
- }
-
- default:
- {
- unsigned long bcyan, bmagenta, byellow, black;
- int nbits = pdev->color_info.depth;
-
- gx_value_cmyk_bits(color, bcyan, bmagenta, byellow, black,
- nbits >> 2);
-
-#ifdef USE_ADOBE_CMYK_RGB
-
- /* R = 1.0 - min(1.0, C + K), etc. */
-
- bcyan += black, bmagenta += black, byellow += black;
- prgb[0] = (bcyan > gx_max_color_value ? (gx_color_value) 0 :
- gx_max_color_value - bcyan);
- prgb[1] = (bmagenta > gx_max_color_value ? (gx_color_value) 0 :
- gx_max_color_value - bmagenta);
- prgb[2] = (byellow > gx_max_color_value ? (gx_color_value) 0 :
- gx_max_color_value - byellow);
-
-#else
-
- /* R = (1.0 - C) * (1.0 - K), etc. */
-
- prgb[0] = (gx_color_value)
- ((ulong)(gx_max_color_value - bcyan) *
- (gx_max_color_value - black) / gx_max_color_value);
- prgb[1] = (gx_color_value)
- ((ulong)(gx_max_color_value - bmagenta) *
- (gx_max_color_value - black) / gx_max_color_value);
- prgb[2] = (gx_color_value)
- ((ulong)(gx_max_color_value - byellow) *
- (gx_max_color_value - black) / gx_max_color_value);
-
-#endif
-
- }
- }
-
- return 0;
-}
diff --git a/gs/contrib/gdevop4w.c b/gs/contrib/gdevop4w.c
deleted file mode 100644
index 7e781f0ca..000000000
--- a/gs/contrib/gdevop4w.c
+++ /dev/null
@@ -1,367 +0,0 @@
-/*
- Copyright (C)1998 Ivan Schreter
-
- This file is part of GNU Ghostscript.
-
- GNU 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 GNU General Public License for full details.
-
- This source is partially based on deskjet device driver for Ghostscript.
-*/
-
-/* gdevop4w.c */
-/* OkiPage 4w/4w+ LED printer driver for Ghostscript */
-
-#include "gdevprn.h"
-#include "gdevpcl.h" /* for mode 2 compression */
-
-/*
- * Thanks for various improvements to:
- * (none so far)
- */
-
-/*
- * TODO: You may select a default resolution of 150, 300 or 600 DPI
- * TODO: in the makefile, or an actual resolution on the gs command line.
- *
- * If the preprocessor symbol A4 is defined, the default paper size is
- * the European A4 size; otherwise it is the U.S. letter size (8.5"x11").
- *
- * You may find the following test page useful in determining the exact
- * margin settings on your printer. It prints four big arrows which
- * point exactly to the for corners of an A4 sized paper. Of course the
- * arrows cannot appear in full on the paper, and they are truncated by
- * the margins. The margins measured on the testpage must match those
- * in gdevdjet.c. So the testpage indicates two facts: 1) the page is
- * not printed in the right position 2) the page is truncated too much
- * because the margins are wrong. Setting wrong margins in gdevop4w.c
- * will also move the page, so both facts should be matched with the
- * real world.
-
-%!
- newpath
- 0 0 moveto 144 72 lineto 72 144 lineto
- closepath fill stroke 0 0 moveto 144 144 lineto stroke
-
- 595.27 841.88 moveto 451.27 769.88 lineto 523.27 697.88 lineto
- closepath fill stroke 595.27 841.88 moveto 451.27 697.88 lineto stroke
-
- 0 841.88 moveto 144 769.88 lineto 72 697.88 lineto
- closepath fill stroke 0 841.88 moveto 144 697.88 lineto stroke
-
- 595.27 0 moveto 451.27 72 lineto 523.27 144 lineto
- closepath fill stroke 595.27 0 moveto 451.27 144 lineto stroke
-
- /Helvetica findfont
- 14 scalefont setfont
- 100 600 moveto
- (This is an A4 testpage. The arrows should point exactly to the) show
- 100 580 moveto
- (corners and the margins should match those given in gdev*.c) show
- showpage
-
- */
-
-/* Define the default, maximum resolutions. */
-#ifndef X_DPI
-# define X_DPI 300
-#endif
-#ifndef Y_DPI
-# define Y_DPI 300
-#endif
-
-/* Margins are left, bottom, right, top. */
-/* from Frans van Hoesel hoesel@rugr86.rug.nl. */
-/* A4 has a left margin of 1/8 inch and at a printing width of
- * 8 inch this give a right margin of 0.143. The 0.09 top margin is
- * not the actual margin - which is 0.07 - but compensates for the
- * inexact paperlength which is set to 117 10ths.
- * Somebody should check for letter sized paper. I left it at 0.07".
- */
-#define OKI4W_MARGINS_LETTER 0.125, 0.25, 0.125, 0.07
-#define OKI4W_MARGINS_A4 0.125, 0.25, 0.125, 0.07
-
-/* We round up the LINE_SIZE to a multiple of a ulong for faster scanning. */
-#define word ulong
-#define W sizeof(word)
-#define byte unsigned char
-
-/* The device descriptors */
-private dev_proc_open_device(oki4w_open);
-private dev_proc_close_device(oki4w_close);
-private dev_proc_print_page(oki4w_print_page);
-
-private gx_device_procs prn_hp_procs =
- prn_params_procs(oki4w_open, gdev_prn_output_page, oki4w_close,
- gdev_prn_get_params, gdev_prn_put_params);
-
-gx_device_printer far_data gs_oki4w_device =
- prn_device(prn_hp_procs, "oki4w",
- DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,
- X_DPI, Y_DPI,
- 0, 0, 0, 0, /* margins filled in by oki4w_open */
- 1, oki4w_print_page);
-
-#define ppdev ((gx_device_printer *)pdev)
-
-/* Find out paper size code */
-private int
-oki_paper_size(gx_device *dev)
-{
- float height_inches = dev->height / dev->y_pixels_per_inch;
- return
- height_inches >= 15.9 ? 0x1b/*PAPER_SIZE_A3*/ :
- height_inches >= 11.8 ? 0x03/*PAPER_SIZE_LEGAL*/ :
- height_inches >= 11.1 ? 0x1a /*PAPER_SIZE_A4*/ :
- height_inches >= 8.3 ? 0x02 /*PAPER_SIZE_LETTER*/ :
- 0x19 /*PAPER_SIZE_A5*/;
-}
-
-/* Open the printer, adjusting the margins if necessary. */
-private int
-oki4w_open(gx_device *pdev)
-{ /* Change the margins if necessary. */
- const float *m = 0;
- static const float m_a4[4] = { OKI4W_MARGINS_A4 };
- static const float m_letter[4] = { OKI4W_MARGINS_LETTER };
- m = (oki_paper_size(pdev) == 0x1a /*PAPER_SIZE_A4*/ ? m_a4 : m_letter);
- if ( m != 0 )
- gx_device_set_margins(pdev, m, true);
- return gdev_prn_open(pdev);
-}
-
-/* oki4w_close is only here to eject odd numbered pages in duplex mode. */
-private int
-oki4w_close(gx_device *pdev)
-{
-/*
- if ( pdev->Duplex_set >= 0 && pdev->Duplex )
- { gdev_prn_open_printer(pdev, 1);
- fputs("\033$B\033\177", ppdev->file);
- fputc(0, ppdev->file);
- return gdev_prn_close_printer(pdev);
- }
-*/
- return 0;
-}
-
-#undef ppdev
-
-/* ------ Internal routines ------ */
-
-private int
-oki_compress(byte *src, byte *dst, int count)
-{
- int dcnt = 0;
- byte lastval = *src;
- int run = 1;
- src++;
- count--;
- while (count-- > 0) {
- byte newval = *src++;
- if (newval == lastval) {
- run++;
- } else {
- /* end of run, flush data */
- if (run == 1) {
- byte *backptr = dst++;
- *dst++ = lastval;
- dcnt++;
- lastval = newval;
- while (run < 128 && count > 0) {
- run++;
- newval = *src++;
- *dst++ = newval;
- dcnt++;
- count--;
- if (newval == lastval) {
- break;
- }
- }
- if (newval == lastval) {
- run--;
- dst--;
- dcnt--;
- }
- *backptr = dst - backptr - 2;
- if (newval == lastval) {
- run = 2;
- } else {
- run = 1;
- }
- continue;
- }
- while (run > 128) {
- *dst++ = 0x81;
- *dst++ = lastval;
- run -= 128;
- dcnt += 2;
- }
- if (run > 0) {
- *dst++ = (0x101 - run) & 0xff;
- *dst++ = lastval;
- dcnt += 2;
- }
- lastval = newval;
- run = 1;
- }
- }
- /* end of run, flush data */
- while (run > 128) {
- *dst++ = 0x81;
- *dst++ = lastval;
- run -= 128;
- dcnt += 2;
- }
- if (run > 0) {
- *dst++ = (0x101 - run) & 0xff;
- *dst++ = lastval;
- dcnt += 2;
- }
-
- return dcnt;
-}
-
-/* Send the page to the printer. For speed, compress each scan line, */
-/* since computer-to-printer communication time is often a bottleneck. */
-private int
-oki4w_print_page(gx_device_printer *pdev, FILE *prn_stream)
-{
- int line_size = gdev_mem_bytes_per_scan_line((gx_device *)pdev);
- int line_size_words = (line_size + W - 1) / W;
- uint storage_size_words = line_size_words * 8; /* data, out_row, out_row_alt, prev_row */
- word *storage = (ulong *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), storage_size_words, W,
- "oki4w_print_page");
- word
- *data_words,
- *out_row_words,
- *out_row_alt_words,
- *prev_row_words;
-#define data ((byte *)data_words)
-#define out_row ((byte *)out_row_words)
-#define out_row_alt ((byte *)out_row_alt_words)
-#define prev_row ((byte *)prev_row_words)
- byte *out_data;
- int x_dpi = pdev->x_pixels_per_inch;
- int y_dpi = pdev->y_pixels_per_inch;
- int y_dots_per_pixel = x_dpi / y_dpi;
- int dpi_code, compress_code;
- int num_rows = dev_print_scan_lines(pdev);
-
- int out_count;
- int paper_size = oki_paper_size((gx_device *)pdev);
- int code = 0;
- /* bool dup = pdev->Duplex;
- bool dupset = pdev->Duplex_set >= 0; */
-
- if ( storage == 0 ) /* can't allocate working area */
- return_error(gs_error_VMerror);
- data_words = storage;
- out_row_words = data_words + (line_size_words * 2);
- out_row_alt_words = out_row_words + (line_size_words * 2);
- prev_row_words = out_row_alt_words + (line_size_words * 2);
- /* Clear temp storage */
- memset(data, 0, storage_size_words * W);
-
- out_data = out_row;
-
- if (y_dpi == 150) {
- dpi_code = 3;
- compress_code = 2;
- } else if (y_dpi == 300) {
- dpi_code = 5;
- compress_code = 2;
- } else {
- dpi_code = 7;
- compress_code = 2;
- }
-
- /* Initialize printer. */
-/* if ( pdev->PageCount == 0 ) { */
- /* Put out init string before page. */
- fprintf(prn_stream, "\x1B%%-98765X\x1C\x14\x03\x41i\x10\x1C"
- "\x14\x05\x41\x65%cf%c\x1C\x14\x09\x42\x61%cb\x02\x63"
- "\x01\x65%c\x1C\x7F\x39\x1B&B\x1B&A\x07%c\x01%c"
- "\x01%c%c%c%c\x1B$A",
- dpi_code, dpi_code, 0, 0, 0, paper_size,
- 0, dpi_code, dpi_code, 0);
-/* } */
-
- /* Send each scan line in turn */
- { int lnum;
- int num_blank_lines = 0;
- word rmask = ~(word)0 << (-pdev->width & (W * 8 - 1));
-
- /* Transfer raster graphics. */
- for ( lnum = 0; lnum < num_rows; lnum++ )
- { register word *end_data =
- data_words + line_size_words;
- int i;
- code = gdev_prn_copy_scan_lines(pdev, lnum,
- (byte *)data, line_size);
- if ( code < 0 )
- break;
- /* Mask off 1-bits beyond the line width. */
- end_data[-1] &= rmask;
- /* Remove trailing 0s. */
- while ( end_data > data_words && end_data[-1] == 0 )
- end_data--;
- if ( end_data == data_words )
- { /* Blank line */
- num_blank_lines++;
- continue;
- }
-
- /* We've reached a non-blank line. */
- /* Put out a spacing command if necessary. */
- if ( num_blank_lines == lnum )
- { /* We're at the top of a page. */
- /* TODO: skip top_margin lines... */
- /* num_blank_lines += xxx */
- /* Skip blank lines if any */
- if (num_blank_lines > 0) {
- fprintf(prn_stream, "\x1b*B%c%c",
- num_blank_lines & 0xff,
- num_blank_lines >> 8);
- }
- }
- else if ( num_blank_lines != 0 )
- {
- /* Skip blank lines if any */
- fprintf(prn_stream, "\x1b*B%c%c",
- num_blank_lines & 0xff,
- num_blank_lines >> 8);
- }
- num_blank_lines = 0;
-
- /* Compress the data */
- if (compress_code == 6) {
- out_count = oki_compress(data, out_data,
- (end_data - data_words) * W);
- } else {
- out_count = gdev_pcl_mode2compress(data_words,
- end_data, out_data);
- }
-
- /* Transfer the data */
- for (i = 0; i < y_dots_per_pixel; ++i) {
- fprintf(prn_stream, "\033*A%c%c%c",
- compress_code,
- out_count & 0xff, out_count >> 8);
- fwrite(out_data, sizeof(byte), out_count,
- prn_stream);
- }
- }
- }
-
- /* end raster graphics and eject page */
- fprintf(prn_stream, "\x1b$B\x1b\x7f%c", 0);
-
- /* free temporary storage */
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)storage, storage_size_words, W, "oki4w_print_page");
-
- return code;
-}
diff --git a/gs/contrib/gdevxes.c b/gs/contrib/gdevxes.c
deleted file mode 100644
index a51f4b8a4..000000000
--- a/gs/contrib/gdevxes.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. All rights reserved.
-
-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 GNU General
-Public License for full details.
-
-Everyone is granted permission to copy, modify and redistribute Ghostscript,
-but only under the conditions described in the GNU 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 or COPYLEFT. Among other things, the copyright
-notice and this notice must be preserved on all copies.
- */
-
-/*
-gdevxes.c
-Ghostscript driver for Xerox XES printer
- (2700, 3700, 4045, etc.)
-
-Peter Flass - NYS LBDC <flass@lbdrscs.bitnet>
-New York State Legislative Bill Drafting Commission
-1450 Western Avenue, 3rd floor
-Albany, NY 12203
-
-This code is subject to the GNU General Public License
-
-Operation: The page bitmap is scanned to determined the
-actual margins. A "graphics rectangle" is defined to
-contain the included data and positioned on the page.
-The bitmap is then re-read and "sixellized" by converting
-each three bytes to four six-bit chunks (zero padding on
-the right if necessary) and adding x'3F' to generate a
-printable code. Runs of up to 32767 identical characters
-are compressed to an ascii count and a single character.
-
-*/
-
-#include "gdevprn.h"
-
-/* Forward references */
-private int sixel_print_page(gx_device_printer *pdev,
- FILE *prn_stream, const char *init);
-
-/* The device descriptor */
-private dev_proc_output_page(sixel_output_page);
-private dev_proc_print_page(xes_print_page);
-private gx_device_procs xes_procs =
- prn_procs(gdev_prn_open, sixel_output_page, gdev_prn_close);
-
-#ifdef A4
-# define BOTTOM_MARGIN 0.5
-# define PAGE_LENGTH_PELS 3300
-#else
-# define BOTTOM_MARGIN 0.4
-# define PAGE_LENGTH_PELS 3300
-#endif
-
-gx_device_printer gs_xes_device =
- prn_device(xes_procs, "xes",
- DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,
- 300, 300, /* x_dpi, y_dpi */
- 0, BOTTOM_MARGIN, 0, 0, /* left, bottom, right, top margin */
- 1, xes_print_page);
-
-/*
- * Initialization string: switch to graphics mode, 300 dpi
- * <ESC>+X Reset soft terminal reset
- * <ESC>gw1;0,0, Graphic window
- */
-
-#define XES_RESET \
- "\033+X\n"
-#define XES_GRAPHICS \
- "\033gw1;"
-
-private int
-xes_print_page(gx_device_printer *pdev, FILE *prn_stream)
-{
- return (sixel_print_page(pdev,prn_stream,XES_RESET));
-}
-
-/* ------ Internal routines ------ */
-
-/* Open the printer in text mode before gdev_prn_output_page */
-/* opens it in binary mode. */
-private int
-sixel_output_page(gx_device *pdev, int num_copies, int flush)
-{ int code = gdev_prn_open_printer(pdev, 0);
- if ( code < 0 )
- return code;
- return gdev_prn_output_page(pdev, num_copies, flush);
-}
-
-/* Send the page to the printer. */
-private int
-sixel_print_page(gx_device_printer *pdev, FILE *prn_stream, const char *init)
-{
- byte *buf, *b, *end;
- byte last = '\0';
- byte tmp[4];
- char run[8], *t;
- int lnum, l, line_size;
- int width, height;
- int top, bottom, left, right;
- int count = 0;
-
- line_size = gdev_mem_bytes_per_scan_line(pdev);
- height = pdev->height;
- /* Default page rectangle */
- top = pdev->height;
- left = line_size;
- right = 0;
- bottom = 0;
-
- buf = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), line_size, 1, "sixel_print_page");
- end = buf + line_size - 1;
-
- /* Check allocation */
- if (!buf)
- return_error(gs_error_VMerror);
-
- /* Compute required window size */
- for (lnum=0; lnum < pdev->height; lnum++ ) {
- gdev_prn_copy_scan_lines(pdev, lnum, buf, line_size);
- for( b=buf; b<=end; b++ ) if(*b) break;
- if ( b<=end ) {
- top = min( top, lnum );
- left = min( left, (int)(b-buf));
- bottom = max( bottom, lnum );
- for( b=end; b>=buf; b-- ) if(*b) break;
- if ( b>=buf ) right = max( right, (int)(b-buf) );
- } /* endif */
- } /* endfor */
- width = right - left + 1; /* width in bytes */
- height= bottom- top + 1; /* height in pels */
- /* round width to multiple of 3 bytes */
- width = ( (width+2) / 3 ) * 3;
- right = min( line_size-1, left+width-1 );
- end = buf + right; /* recompute EOL */
-
- fputs( init, prn_stream );
-
- /* Position and size graphics window */
- fprintf( prn_stream, "%s%d,%d,%d,%d\n",
- XES_GRAPHICS,
- left*8, PAGE_LENGTH_PELS-top,
- width*8, height );
-
- /* Print lines of graphics */
- for (lnum = top; lnum <= bottom; lnum++ ) {
- gdev_prn_copy_scan_lines(pdev, lnum, buf, line_size);
- for ( b=buf+left; b<=end ; ) {
- /* grab data in 3-byte chunks */
- /* with zero pad at end-of-line */
- tmp[0]=tmp[1]=tmp[2]='\0';
- tmp[0]=*b++;
- if (b<=end) tmp[1]=*b++;
- if (b<=end) tmp[2]=*b++;
- /* sixellize data */
- tmp[3] = ( tmp[2] & 0x3F) + 0x3F;
- tmp[2] = ( tmp[2] >> 6 |
- (tmp[1] & 0x0F) << 2 ) + 0x3F;
- tmp[1] = ( tmp[1] >> 4 |
- (tmp[0] & 0x03) << 4 ) + 0x3F;
- tmp[0] = ( tmp[0] >> 2 ) + 0x3F;
- /* build runs of identical characters */
- /* longest run length is 32767 bytes */
- for ( l=0; l<4; l++) {
- if ( tmp[l] == last ) {
- count++;
- if (count==32767) {
- run[sprintf(run, "%d", count)]='\0';
- for (t=run; *t; t++)fputc( *t, prn_stream );
- fputc( last, prn_stream );
- last = '\0';
- count = 0;
- } /* end if count */
- } /* end if tmp[l] */
- else {
- /* emit single character or run */
- switch (count) {
- case 0: break;
- case 1: fputc( last, prn_stream );
- break;
- default:run[sprintf(run, "%d", count)]='\0';
- for (t=run; *t; t++) fputc( *t, prn_stream );
- fputc( last, prn_stream );
- break;
- } /* end switch */
- last = tmp[l];
- count = 1;
- } /* end else */
- } /* end for l */
- } /* end for b */
- } /* end for lnum */
-
- /* Write final run */
- switch (count) {
- case 0: break;
- case 1: fputc( last, prn_stream );
- break;
- default:run[sprintf(run, "%d", count)]='\0';
- for (t=run; *t; t++) fputc( *t, prn_stream );
- fputc( last, prn_stream );
- break;
- } /* end switch */
-
- /* Eject page and reset */
- fprintf( prn_stream, "\f%s", XES_RESET );
- fflush(prn_stream);
-
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)buf, line_size, 1, "sixel_print_page");
-
- return(0);
-}
diff --git a/gs/contrib/gomni.c b/gs/contrib/gomni.c
deleted file mode 100644
index 146b8370c..000000000
--- a/gs/contrib/gomni.c
+++ /dev/null
@@ -1,2073 +0,0 @@
-/*
- * IBM Omni driver
- * Copyright (c) International Business Machines Corp., 2000
- *
- * This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- * the GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Portions of this file are used with permission granted by Aladdin
- * Enterprises
- *
- *
- *
- *
- * Copyright (C) 1998, 1999, 2000 Aladdin Enterprises.
- *
- * The program in this file is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-/************************************************************************/
-/* FILE: gomni.c */
-/* */
-/* */
-/* Change History */
-/* ============= */
-/* */
-/* @@08162000 Changed device PageCount value so that we could */
-/* print multiple pages. The PageCount value was */
-/* not being updated internal to Ghostscript */
-/* */
-/* @@10172000 changed to flip coordinates from zero based top */
-/* to actual top of page */
-/* */
-/* @@10192000 adjusted dot size correction values for */
-/* monochrome mode */
-/* */
-/* @@10252000 added code to make sure that we have a full band */
-/* of data. Rendering high res is slow. */
-/* */
-/* @@10312000 correct line decrement and get_bits of a line */
-/* */
-/* 04062001 rewrote module to allow for sync and async */
-/* function since GS does not handle async at the */
-/* moment */
-/* */
-/* @@04062001 removed mono dither routines and support from */
-/* this module into the core omni code */
-/* */
-/* @@04162001 Added support for newFrame */
-/* */
-/* @@04252001 Added support for GS mono output */
-/* -smonodither=GSMONO on the command line */
-/* */
-/* @@05092001 Added the ability to have a client server */
-/* interaction instead of writing the data */
-/* directly to a file */
-/* */
-/* @@05052001A Update mulitplier for .0001 mm vs. .001 mm */
-/* */
-/* 1/28/2002 changed code to utilize a core omni structure */
-/* to allow for management of devices linked */
-/* to servers and allow device code re-entrancy */
-/* */
-/* @@01302002 Changed code to utilize -sserver from the */
-/* command line instead of having to provide a */
-/* file name along with the server */
-/* */
-/************************************************************************/
-
-#ifdef OMNI_USE_GLIB
-/* Include these first. Ghostscript redefines printf */
-#include <glib.h>
-#include <gmodule.h>
-#else
-#include <dlfcn.h>
-#define GModule void
-#define GModuleFlags int
-typedef void* gpointer;
-#define g_module_open dlopen
-#define g_module_close dlclose
-int dlsym_wrapper(void *lib, char const *name, void **symbol)
-{
- *symbol=dlsym(lib, name);
- return *symbol != 0;
-}
-#define g_module_symbol dlsym_wrapper
-#define g_module_error dlerror
-#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif /* HAVE_STDINT_H */
-
-#include "gdevprna.h"
-#include "gdevpccm.h"
-#include "gdevprn.h"
-#include "gsparam.h"
-#include "gdevbmp.h"
-#include "errors.h"
-#include "stdio_.h"
-#include "gserrors.h"
-#include "gpsync.h"
-
-#include "defs.h"
-
-#define MAX_LENGTH 65
-
-#define Signature "OMNI"
-
-const static int fDebugOutput = 0;
-
-#define DEVICES_DEFINED
-
-typedef struct _HWMAR {
- float fLeftClip;
- float fBottomClip;
- float fRightClip;
- float fTopClip;
- float fxWidth;
- float fyHeight;
-} HWMARGINS;
-
-typedef struct _HWRES {
- float xRes;
- float yRes;
- float fScanDots; /* number of dots in scan line */
-} HWRESOLUTION;
-
-typedef struct _PRTMODE {
- int iBitCount;
- int iPlanes;
-} PRINTMODE;
-
-long DiffusionDither (PDDI pdi, PIMAGEINFO pimg_infos, PBYTE *pBuffer, ULONG ulFlgs);
-
-/*
- * Prototypes for routines that we will be calling into the core Omni code
- * to resolve
- */
-typedef bool (*PFNGIINIT) (void *pDev);
-typedef bool (*PFNGITERM) (void *pDev);
-typedef bool (*PFNGETPRINTMODEINFO) (void *pDev,
- PRINTMODE *pPrtMode);
-typedef bool (*PFNGETRESOLUTIONINFO) (void *pDev,
- HWRESOLUTION *hwRes);
-typedef bool (*PFNGETMARGININFO) (void *pDev,
- HWMARGINS *hwMargins);
-typedef void (*PFNBEGINJOB) (void *pOmni,
- FILE *pfpOut);
-typedef void (*PFNNEWFRAME) (void *pDev); /*@@04162001*/
-typedef void (*PFNENDJOB) (void *pDev);
-typedef void (*PFNRASTERIZE) (void *pcoreOmni,
- PBYTE pbBits,
- PBITMAPINFO2 pbmi,
- PSIZEL psizelPage,
- PRECTL prectlPageLocation,
- BITBLT_TYPE eType);
-typedef void * (*PFNCREATEDEVICE) (void *pOmni,
- void **vhDevice,
- int iUsePDC);
-typedef void * (*PFNDELETEDEVICE) (void *pOmni);
-typedef long (*PFNMONODITHER) (PDDI pdi, /*@@04062001*/
- PIMAGEINFO pimg_infos,
- PBYTE *pBuffer,
- ULONG ulFlgs);
-
-ULONG FindBandSize (ULONG ulYHeight,
- ULONG ulXWidth,
- ULONG ulBitsPerPel,
- ULONG ulNumPlanes,
- ULONG ulModulus,
- ULONG ulMemoryLimit);
-
-typedef int (*PFNGETOMNIJOBPROPERTIES) (char *pszDriverName,
- char **pJobProperties);
-typedef int (*PFNFREEOMNIJOBPROPERTIES) (char **pJobProperties);
-
-#define uint32 unsigned long
-#define int32 long
-
-#define strcmpi strcasecmp
-
-/* ------ The device descriptors ------ */
-
-typedef struct omni_dev_struct {
- char cSignature[4];
- int cbSize; /* length of the structure */
- char cVersion[10];
- char cOmniVersion[10];
- bool bPDCDevice; /* boolean to tell if this is a PDC device or not */
- void *pDevice; /* pointer to a device */
- FILE *pfpOut; /* pointer to the output handle from beginjob */
- FILE *pfpErr;
- char *pszJobOptions; /* pointer to the job options */
- char cDebugFile[MAX_LENGTH]; /* debug file name */
- char cDeviceName[MAX_LENGTH];
- char cServer[64];
- void *pvReserved;
-} core_omni, core_omni_device;
-
-/* All omni specific data */
-typedef struct _DevStruct {
- char cAsyncOpt[MAX_LENGTH]; /* text value for dither */
- char cMonoDither[MAX_LENGTH];
- char cServerFile[256]; /*@@05092001 */
- core_omni_device *pcoreOmni;
- void *pCallPtr;
-
- GModule *hmodOmni; /* handle to libomni.so */
- GModule *hmodDevice; /* handle to libDeviceXXX.so */
- PFNGETPRINTMODEINFO pfnGetPrintModeInfo;
- PFNGETRESOLUTIONINFO pfnGetResolutionInfo;
- PFNGETMARGININFO pfnGetMarginInfo;
- PFNBEGINJOB pfnBeginJob;
- PFNNEWFRAME pfnNewFrame; /*@@04162001*/
- PFNENDJOB pfnEndJob;
- PFNRASTERIZE pfnRasterize;
- PFNCREATEDEVICE pfnCreateDevice;
- PFNDELETEDEVICE pfnDeleteDevice;
- PFNMONODITHER pfnMonoDither; /*@@04162001*/
- PFNGIINIT pfnGIInit;
- PFNGITERM pfnGITerm;
- unsigned long ulPelSizeCorrection;
-
- int iVertDots;
- int width;
- int height;
- int iSync;
- int iPageNumber; /*@@04162001 */
- int iGSMono; /*@@04252001 */
- int iUseServer; /*@@05092001 */
- int iUseDialog;
- FILE *ProxyFile; /*@@05092001 */
-
- byte *outbuf; /* Output-Buffer */
-
- int iPage;
- int iSetup;
-} Omni_Dev,
- *PDEVSTRUCT; /** Type & Pointer of device-specifics */
-
-/* Define data type for this device based on prn_device */
-typedef struct gx_device_omni_s {
- gx_device_common;
- gx_prn_device_common;
- int buffered_page_exists;
- long file_offset_to_data;
- int copies_printed;
- PDEVSTRUCT pDev; /** Omni specific extensions */
-} gx_device_omni;
-typedef gx_device_omni omni_device;
-
-
-/* Define initializer for device */
-#define omni_device(procs, dname, w10, h10, xdpi, ydpi, lm, bm, rm, tm, color_bits, print_page)\
-{ prn_device_std_margins_body(gx_device_omni, procs, dname,\
- w10, h10, xdpi, ydpi, lm, tm, lm, bm, rm, tm, color_bits, print_page),\
- 0, 0L\
-}
-
-private int PrintPage (gx_device_printer *pgx_prt_dev,
- FILE *prn_stream,
- int num_copies);
-private int omni_print_page (gx_device_printer *pdev,
- FILE *prn_stream);
-private int SetupDevice (gx_device *pgxdev,
- gs_param_list *plist);
-private int OpenDevice (gx_device *pdev);
-private int CloseDevice (gx_device *pdev);
-private int GetDeviceParams (gx_device *pgxdev,
- gs_param_list *plist);
-private int BufferPage (gx_device_printer *pgx_prt_dev,
- FILE *file,
- int num_copies);
-private void RenderThread (void *params);
-private int StartRenderThread (gdev_prn_start_render_params *params);
-private int OpenRenderDevice (gx_device_printer *ppdev);
-private void GetSpaceParams (const gx_device_printer *pgx_prt_dev,
- gdev_prn_space_params *space_params);
-
-/* Print-page, parameters and miscellaneous procedures */
-private dev_proc_print_page_copies (PrintPage);
-private prn_dev_proc_buffer_page (BufferPage);
-private prn_dev_proc_start_render_thread (StartRenderThread);
-private dev_proc_open_device (OpenDevice);
-private dev_proc_print_page (omni_print_page);
-private dev_proc_close_device (CloseDevice);
-private dev_proc_get_params (GetDeviceParams);
-private dev_proc_put_params (SetupDevice);
-private dev_proc_output_page (PrintPageMultiple);
-private prn_dev_proc_get_space_params (GetSpaceParams);
-
-/* 24-bit color. only want 16M colors */
-
-private gx_device_procs omni16m_procs = {
- OpenDevice, /* open_device */
- NULL, /* get_initial_matrix */
- NULL, /* sync_output */
- gdev_prn_output_page, /* output_page */
- CloseDevice, /* close_device */
- NULL, /* bmp_map_16m_rgb_color,*/ /* map_rgb_color @@04252001 */
- NULL, /* bmp_map_16m_color_rgb,*/ /* map_color_rgb @@04252001 */
- NULL, /** fill_rectangle */
- NULL, /** tile_rectangle */
- NULL, /** copy_mono */
- NULL, /** copy_color */
- NULL, /** draw_line */
- gx_default_get_bits, /* Reads scan lines */
- GetDeviceParams, /** Export parameters, special */
- SetupDevice /** Import parameters, special */
-};
-
-
-gx_device_omni far_data gs_omni_device =
- omni_device (omni16m_procs,
- "omni",
- DEFAULT_WIDTH_10THS, /* 85 x 110 - page physical area non clipped */
- DEFAULT_HEIGHT_10THS,
- X_DPI, Y_DPI, /* std resolution - 72 dpi */
- 0,0,0,0, /* margins - need defaults */
- 1, /* Bpp value */
- omni_print_page); /* sync routine for output of raster data */
-
-
-/* ------------------------------------------------------*/
-/* ------------------------------------------------------*/
-
-/* Generic routine to send the page to the printer. */
-private int
-PrintPageMultiple (gx_device *pDev, int iCopies, int flush)
-{
- /*
- * HACK: open the printer page with the positionable attribute since
- * we need to seek back & forth to support partial rendering.
- */
- if ( iCopies > 0
- || !flush
- )
- {
- int iRet = gdev_prn_open_printer_positionable (pDev, 1, 1);
-
- if (iRet < 0)
- return iRet;
- }
-
- return gdev_prn_output_page(pDev, iCopies, flush);
-}
-
-/* ------------ Writer Instance procedures ---------- */
-
-/* Writer's open procedure */
-private int
-OpenDevice (gx_device *pdev /* Driver instance to open */)
-{
- gx_device_omni * const pwdev = (gx_device_omni *)pdev;
- PDEVSTRUCT pDev = pwdev->pDev;
- int max_width;
- int max_raster;
- int min_band_height;
- int max_src_image_row;
-
- if (fDebugOutput) fprintf (stderr, "OpenDevice: pDev = %p, pDev->hmodOmni = %p\n", pDev, pDev->hmodOmni);
-
- if (!pDev)
- {
- fprintf (stderr, "\n<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: No pDev in OpenDevice.\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
-
- return e_Fatal;
- }
-
- if (!pDev->hmodOmni)
- {
- fprintf (stderr, "\n<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: Could not load libomni.so\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
-
- return e_Fatal;
- }
-
- if (!pDev->pcoreOmni->cDeviceName[0])
- {
- fprintf (stderr, "\n<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: -sDeviceName=XXX was not defined\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
-
- return e_Fatal;
- }
-
- pDev->iUseServer = 0;
- pDev->iPageNumber = 0;
- pDev->iUseDialog = 0;
-
- /*
- * Set up device's printer proc vector to point to this driver, since
- * there are no convenient macros for setting them up in static template.
- */
- if (pDev->iSync)
- {
- init_async_render_procs (pwdev,
- StartRenderThread,
- BufferPage,
- PrintPage);
- }
- else
- {
- /* don't really think this needs to be done but we'll do it anyway */
- set_dev_proc (pdev, sync_output, gx_default_sync_output);
- }
-
- set_dev_proc (pdev, put_params, SetupDevice);
- set_dev_proc (pdev, get_params, GetDeviceParams);
-
- if (!pDev->iGSMono)
- {
- if (fDebugOutput) fprintf(stderr, "Remapping color pointers\n");
-
- set_dev_proc(pdev, map_rgb_color, bmp_map_16m_rgb_color);
- set_dev_proc(pdev, map_color_rgb, bmp_map_16m_color_rgb);
- }
-
- if (pDev->iSync)
- {
- set_dev_proc(pdev, output_page, PrintPageMultiple);
- pwdev->printer_procs.get_space_params = GetSpaceParams;
- pwdev->printer_procs.open_render_device = OpenRenderDevice;
- }
-
- /*
- * Determine MAXIMUM parameters this device will have to support over
- * lifetime. See comments for GetSpaceParams().
- */
- max_width = DEFAULT_WIDTH_10THS * 60 * 16; /* figure max wid = default @ 600dpi */
- /* multiplied by 2 for 1200 dpi */
- min_band_height = max(1, (DEFAULT_HEIGHT_10THS * 60) / 100);
- max_raster = (max_width * pwdev->color_info.depth) / 8; /* doesn't need to be super accurate */
- max_src_image_row = max_width * 3 * 2;
-
-#ifdef OMNI_ASYNC
- if (pDev->iSync)
- {
- return gdev_prn_async_write_open ((gx_device_printer *)pdev,
- max_raster,
- min_band_height,
- max_src_image_row);
-
- }
- else
-#endif
- {
- return gdev_prn_open (pdev);
- }
-}
-
-private int
-CloseDevice (gx_device * pdev)
-{
- gx_device_omni * const pwdev = (gx_device_omni *)pdev;
- PDEVSTRUCT pDev = pwdev->pDev;
-
- if (fDebugOutput) fprintf (stderr, "CloseDevice: pDev = %p, pDev->pcoreOmni->pDevice = %p\n", pDev, pDev->pcoreOmni->pDevice);
-
- if (!pDev)
- {
- fprintf (stderr, "\n<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: No device handle in CloseDevice\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
-
- return_error (gs_error_Fatal); /* handle no pDev */
- }
-
- if ( pDev->pcoreOmni
- && pDev->pcoreOmni->pDevice
- && pDev->pfnEndJob
- )
- {
- pDev->pfnEndJob ((void*)pDev->pCallPtr);
- }
-
- if ( pDev->pcoreOmni
- && pDev->pcoreOmni->pszJobOptions
- )
- {
- gs_free (gs_lib_ctx_get_non_gc_memory_t(), pDev->pcoreOmni->pszJobOptions, strlen (pDev->pcoreOmni->pszJobOptions) + 1, 1, "Option String");
- }
-
- if ( pDev->pcoreOmni
- && pDev->pcoreOmni->pDevice
- && pDev->pfnDeleteDevice
- )
- {
- pDev->pfnDeleteDevice (pDev->pcoreOmni->pDevice);
- pDev->pcoreOmni->pDevice = 0;
- }
-
- if (pDev->pfnGITerm)
- {
- pDev->pfnGITerm (pDev->pcoreOmni);
- }
-
- if (pDev->pcoreOmni)
- {
- gs_free (gs_lib_ctx_get_non_gc_memory_t(), pDev->pcoreOmni, sizeof (core_omni_device), 1, "omni/device");
- pDev->pcoreOmni = 0;
- }
-
- if (pDev->hmodDevice)
- {
- g_module_close (pDev->hmodDevice);
- pDev->hmodDevice = 0;
- }
-
- if (pDev->hmodOmni)
- {
- g_module_close (pDev->hmodOmni);
- pDev->hmodOmni = 0;
- }
-
- return gdev_prn_close (pdev);
-}
-
-/* -------------------------------------------------------------------------*/
-/* */
-/* Function: GetDeviceParams */
-/* */
-/* This function calls back into Ghostscript to set the string values */
-/* so that next time Ghostscript calls SetupDevice, the correct */
-/* values can be pulled back out again */
-/* */
-/* -------------------------------------------------------------------------*/
-
-private int
-GetDeviceParams (gx_device *pgxdev, gs_param_list *plist)
-{
- omni_device *const odev = (omni_device *) pgxdev;
- PDEVSTRUCT pDev = odev->pDev;
- int iReturnCode = 0;
- gs_param_string strdata;
-
- const char *pszDeviceName = "";
- const char *pszDebug = "";
- const char *pszOther = "";
- const char *pszAsync = "";
- const char *pszMonoDither = "";
- const char *pszServer = "";
- char pszTemp[3];
- unsigned long ulPelSizeCorrection = 100;
- bool bPersist = false;
-
- if (fDebugOutput) fprintf (stderr, "GetDeviceParams: pDev = %p\n", pDev);
-
- iReturnCode = gdev_prn_get_params (pgxdev, plist);
-
- if (pDev)
- {
- bPersist = true;
- pszDeviceName = pDev->pcoreOmni->cDeviceName;
- pszDebug = pDev->pcoreOmni->cDebugFile;
- pszOther = pDev->pcoreOmni->pszJobOptions;
- pszAsync = pDev->cAsyncOpt;
- ulPelSizeCorrection = pDev->ulPelSizeCorrection;
- pszMonoDither = pDev->cMonoDither;
- pszServer = pDev->pcoreOmni->cServer;
- }
-
- if (fDebugOutput) fprintf (stderr, "GetDeviceParams: pszDeviceName = %s\n", pszDeviceName);
- if (fDebugOutput) fprintf (stderr, "GetDeviceParams: pszDebug = %s\n", pszDebug);
- if (fDebugOutput) fprintf (stderr, "GetDeviceParams: pszOther = %s\n", pszOther);
- if (fDebugOutput) fprintf (stderr, "GetDeviceParams: pszAsync = %s\n", pszAsync);
- if (fDebugOutput) fprintf (stderr, "GetDeviceParams: ulPelSizeCorrection = %ld\n", ulPelSizeCorrection);
- if (fDebugOutput) fprintf (stderr, "GetDeviceParams: pszMonoDither = %s\n", pszMonoDither);
- if (fDebugOutput) fprintf (stderr, "GetDeviceParams: pszServer = %s\n", pszServer);
-
- strdata.data = pszDeviceName;
- strdata.size = strlen(pszDeviceName);
- strdata.persistent = bPersist;
- iReturnCode = param_write_string(plist,"DeviceName",&strdata);
-
- strdata.data = pszDebug;
- strdata.size = strlen(pszDebug);
- strdata.persistent = bPersist;
- iReturnCode = param_write_string(plist,"dbgout",&strdata);
-
- if ( pDev
- && pDev->pcoreOmni->pszJobOptions
- )
- {
- strdata.size = strlen (pszOther);
- strdata.data = pszOther;
- }
- else
- {
- pszTemp[0] = '\0';
- strdata.size = 0;
- strdata.data = pszTemp;
- }
-
- strdata.persistent = bPersist;
- iReturnCode = param_write_string(plist,"properties",&strdata);
-
- strdata.data = pszAsync;
- strdata.size = strlen(pszAsync);
- strdata.persistent = bPersist;
- iReturnCode = param_write_string(plist,"async",&strdata);
-
- strdata.data = pszMonoDither;
- strdata.size = strlen(pszMonoDither);
- strdata.persistent = bPersist;
- iReturnCode = param_write_string(plist,"monodither",&strdata);
-
- strdata.data = pszServer;
- strdata.size = strlen(pszServer);
- strdata.persistent = bPersist;
- iReturnCode = param_write_string(plist,"server",&strdata);
-
- strdata.data = pszServer;
- strdata.size = strlen(pszServer);
- strdata.persistent = bPersist;
- iReturnCode = param_write_string(plist,"jobdialog",&strdata);
-
- iReturnCode = param_write_long(plist,"PelSizeCorrection",&ulPelSizeCorrection);
-
- if (fDebugOutput) fprintf (stderr, "GetDeviceParams returning %d\n", iReturnCode);
-
- return iReturnCode;
-}
-
-/*****************************************************************************/
-/* */
-/* FUNCTION: SetupDevice */
-/* */
-/* We need to set up our device and job specific information here */
-/* */
-/*****************************************************************************/
-
-/* Put device parameters. */
-/* IMPORTANT: async drivers must NOT CLOSE the device while doing put_params.*/
-
-private int
-SetupDevice (gx_device *pgxdev, gs_param_list *plist)
-{
- int iReturnCode,
- i;
- BOOL bRet;
- HWMARGINS hwMargins;
- HWRESOLUTION hwRes;
- gx_device_omni * const prgxdev = (gx_device_omni *)pgxdev;
- PDEVSTRUCT pDev = prgxdev->pDev;
- char *pszDeviceLib = 0;
- static char cOmnilib[] = "libomni.so";
- static char cDialogName[] = "libomnijobdialog.so";
- static const char *apszLibraryPaths[] = {
-#if __WORDSIZE == 64
- "/usr/lib64/ghostscript/",
-#else
- "/usr/lib/ghostscript/",
-#endif
- "/usr/lib/Omni/",
- "/opt/Omni/bin/",
- "/opt/Omni/lib/",
- "./",
- "" /* give a chance for $LD_LIBRARY_PATH to work*/
- };
- PRINTMODE prtMode; /* definition of printed output Bpp ..*/
- gs_param_string fname;
-
- if (fDebugOutput) fprintf (stderr, "SetupDevice: pDev = %p\n", pDev);
-
- /* Do we have a handle? */
- if (pDev == NULL)
- {
- PDEVSTRUCT p;
-
- p = (PDEVSTRUCT)gs_malloc (gs_lib_ctx_get_non_gc_memory_t(), 1, sizeof (Omni_Dev), "omni/instance");
- if (!p)
- {
- fprintf (stderr, "<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: Failed allocation in SetupDevice\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
-
- return_error (gs_error_VMerror);
- }
-
- pDev = prgxdev->pDev = p;
-
- memset (pDev, 0, sizeof (Omni_Dev));
-
- pDev->pcoreOmni = (core_omni_device *)gs_malloc (gs_lib_ctx_get_non_gc_memory_t(), 1, sizeof (core_omni_device), "omni/device");
-
- if (!pDev->pcoreOmni)
- {
- fprintf (stderr, "<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: Failed allocation in SetupDevice\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
-
- return_error (gs_error_VMerror);
- }
-
- memset (pDev->pcoreOmni, 0, sizeof (core_omni_device));
-
- memcpy ((void *)pDev->pcoreOmni->cSignature, (const void *)Signature, 4);
-
- pDev->pcoreOmni->cbSize = sizeof (core_omni_device);
- }
-
- if (fDebugOutput) fprintf (stderr, "SetupDevice: pDev->hmodOmni = %p\n", pDev->hmodOmni);
-
- /* Is the handle initialized? */
- if (!pDev->hmodOmni)
- {
- #define dimof(a) (sizeof (a)/sizeof (a[0]))
- typedef struct _EntryPointList {
- char *pszEntryPoint;
- gpointer *pfnEntryPoint;
- } ENTRYPOINTLIST, *PENTRYPOINTLIST;
- ENTRYPOINTLIST aeplEntryPoints[] = {
- { "GetPrintModeInfo", (gpointer *)&pDev->pfnGetPrintModeInfo },
- { "GetResolutionInfo", (gpointer *)&pDev->pfnGetResolutionInfo },
- { "GetMarginInfo", (gpointer *)&pDev->pfnGetMarginInfo },
- { "BeginJob", (gpointer *)&pDev->pfnBeginJob },
- { "NewFrame", (gpointer *)&pDev->pfnNewFrame },
- { "EndJob", (gpointer *)&pDev->pfnEndJob },
- { "Rasterize", (gpointer *)&pDev->pfnRasterize },
- { "CreateDevice", (gpointer *)&pDev->pfnCreateDevice },
- { "DeleteDevice", (gpointer *)&pDev->pfnDeleteDevice },
- { "DiffusionDither", (gpointer *)&pDev->pfnMonoDither },
- { "GhostscriptInferfaceInit", (gpointer *)&pDev->pfnGIInit },
- { "GhostscriptInferfaceTerm", (gpointer *)&pDev->pfnGITerm }
- };
- bool fFailure = FALSE;
- int i;
-
- pDev->ulPelSizeCorrection = 100;
-
- for (i = 0; i < sizeof (apszLibraryPaths)/sizeof (apszLibraryPaths[0]) && !pDev->hmodOmni; i++)
- {
- pszDeviceLib = (char *)gs_malloc (gs_lib_ctx_get_non_gc_memory_t(), 1,
- strlen (cOmnilib)
- + strlen (apszLibraryPaths[i])
- + 1,
- "Devicestring");
- if (pszDeviceLib)
- {
- sprintf (pszDeviceLib, "%s%s", apszLibraryPaths[i], cOmnilib);
-
- pDev->hmodOmni = g_module_open (pszDeviceLib, (GModuleFlags)0);
-
- if (fDebugOutput) fprintf (stderr, "SetupDevice: Trying to load %s = %p\n", pszDeviceLib, pDev->hmodOmni);
- }
- gs_free (gs_lib_ctx_get_non_gc_memory_t(), pszDeviceLib, strlen (pszDeviceLib) + 1, 1, "Devicestring");
- }
-
- if (!pDev->hmodOmni)
- {
- GModule *pModule = 0;
-
- /* Failure! */
- fprintf (stderr, "<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: Could not load libomni.so\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
-
- for (i = 0; i < sizeof (apszLibraryPaths)/sizeof (apszLibraryPaths[0]) && !pDev->hmodOmni; i++)
- {
- pszDeviceLib = (char *)gs_malloc (gs_lib_ctx_get_non_gc_memory_t(), 1,
- strlen (cOmnilib)
- + strlen (apszLibraryPaths[i])
- + 1,
- "Devicestring");
- if (pszDeviceLib)
- {
- sprintf (pszDeviceLib, "%s%s", apszLibraryPaths[i], cOmnilib);
-
- pModule = g_module_open (pszDeviceLib, (GModuleFlags)0);
-
- if (!pModule)
- {
- fprintf (stderr, "Error: Loading \"%s\" returns \"%s\"\n", pszDeviceLib, g_module_error ());
- }
- else
- {
- g_module_close (pModule);
- }
- }
- gs_free (gs_lib_ctx_get_non_gc_memory_t(), pszDeviceLib, strlen (pszDeviceLib) + 1, 1, "Devicestring");
- }
-
- return 1;
- }
-
- for (i = 0; i < (int)dimof (aeplEntryPoints); i++)
- {
- g_module_symbol (pDev->hmodOmni,
- aeplEntryPoints[i].pszEntryPoint,
- aeplEntryPoints[i].pfnEntryPoint);
-
- if (!*aeplEntryPoints[i].pfnEntryPoint)
- {
- if (!fFailure)
- {
- fprintf (stderr, "\n<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- }
-
- fprintf (stderr, "Error: Could not load required entry point \"%s\" from libomni.so\n", aeplEntryPoints[i].pszEntryPoint);
-
- fFailure = TRUE;
- }
-
- if (fDebugOutput)
- fprintf (stderr,
- "SetupDevice: g_module_symbol (%s) = %p\n",
- aeplEntryPoints[i].pszEntryPoint,
- *aeplEntryPoints[i].pfnEntryPoint);
- }
-
- if ( !pDev->pfnCreateDevice
- || !pDev->pfnBeginJob
- || !pDev->pfnNewFrame
- || !pDev->pfnEndJob
- || !pDev->pfnRasterize
- || !pDev->pfnGetPrintModeInfo
- || !pDev->pfnGetResolutionInfo
- || !pDev->pfnGetMarginInfo
- || !pDev->pfnMonoDither
- )
- {
- /* Failure! */
- g_module_close (pDev->hmodOmni);
- pDev->hmodOmni = 0;
-
- return 1;
- }
- }
-
- /* device name in structure*/
- if (!pDev->pcoreOmni->cDeviceName[0])
- {
- memset (&fname, 0, sizeof (fname));
- iReturnCode = param_read_string (plist, "DeviceName", &fname);
- if (fDebugOutput) fprintf (stderr, "param_read_string of DeviceName = %d, fname.size = %d\n", iReturnCode, fname.size);
-
- if ( (iReturnCode < 1)
- && (fname.size > 0)
- )
- {
- memcpy (pDev->pcoreOmni->cDeviceName, fname.data, fname.size);
- pDev->pcoreOmni->cDeviceName[fname.size] = '\0';
- }
- }
-
- /* set debugging file name */
- if (!pDev->pcoreOmni->cDebugFile[0])
- {
- memset (&fname, 0, sizeof (fname));
- iReturnCode = param_read_string (plist, "dbgout", &fname);
- if (fDebugOutput) fprintf (stderr, "param_read_string of dbgout = %d, fname.size = %d\n", iReturnCode, fname.size);
-
- if ( (iReturnCode < 1)
- && (fname.size > 0)
- )
- {
- memcpy (pDev->pcoreOmni->cDebugFile, fname.data, fname.size);
- pDev->pcoreOmni->cDebugFile[fname.size] = '\0';
- }
- }
-
- /* set Async option */
- if (!pDev->cAsyncOpt[0])
- {
- memset (&fname, 0, sizeof (fname));
- iReturnCode = param_read_string (plist, "async", &fname);
- if (fDebugOutput) fprintf (stderr, "param_read_string of async = %d, fname.size = %d\n", iReturnCode, fname.size);
- if ( (iReturnCode < 1)
- && (fname.size > 0)
- )
- {
- memcpy (pDev->cAsyncOpt, fname.data, fname.size);
- pDev->cAsyncOpt[fname.size] = '\0';
- if ( !strcmp (pDev->cAsyncOpt, "TRUE")
- || !strcmp (pDev->cAsyncOpt, "true")
- )
- {
- pDev->iSync = 1;
- }
- else
- {
- pDev->iSync = 0;
- }
- }
- }
-
- iReturnCode = param_read_long (plist, "PelSizeCorrection", &pDev->ulPelSizeCorrection);
- if (fDebugOutput) fprintf (stderr, "param_read_long of PelSizeCorrection = %d, ulPelSizeCorrection = %ld\n", iReturnCode, pDev->ulPelSizeCorrection);
-
- /*
- * Set user options for the job
- */
- if (!pDev->pcoreOmni->pszJobOptions)
- {
- memset (&fname, 0, sizeof (fname));
- iReturnCode = param_read_string (plist, "properties", &fname);
- if (fDebugOutput) fprintf (stderr, "param_read_string of properties = %d, fname.size = %d\n", iReturnCode, fname.size);
-
- if ( (iReturnCode < 1)
- && (fname.size > 0)
- )
- {
- if (!pDev->pcoreOmni->pszJobOptions)
- pDev->pcoreOmni->pszJobOptions = (char *)gs_malloc (gs_lib_ctx_get_non_gc_memory_t(), 1, fname.size + 1, "Option String");
- memcpy (pDev->pcoreOmni->pszJobOptions, fname.data, fname.size);
- pDev->pcoreOmni->pszJobOptions[fname.size] = '\0';
- }
- }
-
- /* Set user options for monodither by GS */
- if (!pDev->cMonoDither[0])
- {
- memset (&fname, 0, sizeof (fname));
- iReturnCode = param_read_string (plist, "monodither", &fname);
- if (fDebugOutput) fprintf (stderr, "param_read_string of monodither = %d, fname.size = %d\n", iReturnCode, fname.size);
-
- if ( (iReturnCode < 1)
- && (fname.size > 0)
- )
- {
- memcpy (pDev->cMonoDither, fname.data, fname.size);
- pDev->cMonoDither[fname.size] = '\0';
-
- if (!strcmp (pDev->cMonoDither, "GSMONO"))
- {
- if (fDebugOutput) fprintf (stderr, "turning on GSMONO dither\n");
-
- pDev->iGSMono = 1;
- }
- else
- {
- pDev->iGSMono = 0;
- }
- }
- }
-
- /* Set user options for client / server function */
- if (!pDev->pcoreOmni->cServer[0])
- {
- memset (&fname, 0, sizeof (fname));
- iReturnCode = param_read_string (plist, "server", &fname);
- if (fDebugOutput) fprintf (stderr, "param_read_string of server = %d, fname.size = %d\n", iReturnCode, fname.size);
-
- if ( (iReturnCode < 1)
- && (fname.size > 0)
- )
- {
- memcpy (pDev->pcoreOmni->cServer, fname.data, fname.size);
-
- pDev->pcoreOmni->cServer[fname.size] = '\0';
-
- fprintf (stderr, "Utilizing Server - %s \n", pDev->pcoreOmni->cServer);;
-
- pDev->iUseServer = 1;
- }
- }
-
- /*
- * Set user options for dialog function
- */
- if (!pDev->iUseDialog)
- {
- memset (&fname, 0, sizeof (fname));
- iReturnCode = param_read_string (plist, "jobdialog", &fname);
- if (fDebugOutput) fprintf (stderr, "param_read_string of jobdialog = %d, fname.size = %d\n", iReturnCode, fname.size);
-
- if (!iReturnCode)
- {
- if (fDebugOutput) fprintf (stderr, "Utilizing dialog\n");
-
- pDev->iUseDialog = 1;
- }
- }
-
- if ( pDev->pcoreOmni->cDeviceName[0]
- && pDev->iSetup != 1
- )
- {
- /* create a device based on the user supplied inputs */
- if (fDebugOutput) fprintf(stderr, "setting following options on CreateDevice\n");
- if (fDebugOutput) fprintf(stderr, "DeviceName = %s\n", pDev->pcoreOmni->cDeviceName );
- if (fDebugOutput) fprintf(stderr, "pszJobOptions = %s\n", pDev->pcoreOmni->pszJobOptions);
- if (fDebugOutput) fprintf(stderr, "debug parameter = %s \n", pDev->pcoreOmni->cDebugFile );
-
- if (pDev->iUseDialog)
- {
- int iLength = 0;
- char *pszSelectedJobProperties;
- PFNGETOMNIJOBPROPERTIES pfnJobDialog;
- PFNFREEOMNIJOBPROPERTIES pfnFreeDialogMemory;
- GModule *pModule = 0;
-
- for (i = 0; i < sizeof (apszLibraryPaths)/sizeof (apszLibraryPaths[0]) && !pModule; i++)
- {
- pszDeviceLib = (char *)gs_malloc (gs_lib_ctx_get_non_gc_memory_t(), 1,
- strlen (cDialogName)
- + strlen (apszLibraryPaths[i])
- + 1,
- "Devicestring");
- pszDeviceLib[0] = '\0';
-
- if (pszDeviceLib)
- {
- sprintf (pszDeviceLib, "%s%s", apszLibraryPaths[i], cDialogName);
-
- if (fDebugOutput) fprintf (stderr, "attempting to load - %s\n", pszDeviceLib);
-
- pModule = g_module_open (pszDeviceLib, (GModuleFlags)0);
- }
- gs_free (gs_lib_ctx_get_non_gc_memory_t(), pszDeviceLib, strlen (pszDeviceLib) + 1, 1, "Devicestring");
- }
-
- if (!pModule)
- {
- /* Print the error messages! */
- fprintf (stderr, "\n<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: Could not load %s\n", cDialogName);
-
- for (i = 0; i < sizeof (apszLibraryPaths)/sizeof (apszLibraryPaths[0]) && !pModule; i++)
- {
- pszDeviceLib = (char *)gs_malloc (gs_lib_ctx_get_non_gc_memory_t(), 1,
- strlen (cDialogName)
- + strlen (apszLibraryPaths[i])
- + 1,
- "Devicestring");
- pszDeviceLib[0] = '\0';
-
- if (pszDeviceLib)
- {
- sprintf (pszDeviceLib, "%s%s", apszLibraryPaths[i], cDialogName);
-
- pModule = g_module_open (pszDeviceLib, (GModuleFlags)0);
-
- if (!pModule)
- {
- fprintf (stderr, "Error: Loading \"%s\" returns \"%s\"\n", pszDeviceLib, g_module_error ());
- }
- else
- {
- g_module_close (pModule);
- }
- }
- gs_free (gs_lib_ctx_get_non_gc_memory_t(), pszDeviceLib, strlen (pszDeviceLib) + 1, 1, "Devicestring");
- }
- }
- else
- {
- g_module_symbol (pModule, "GetOmniJobProperties", (gpointer *)&pfnJobDialog);
-
- if (pfnJobDialog)
- {
- pszSelectedJobProperties = pDev->pcoreOmni->pszJobOptions;
-
- pfnJobDialog (pDev->pcoreOmni->cDeviceName, &pszSelectedJobProperties);
-
- if (pDev->pcoreOmni->pszJobOptions)
- {
- gs_free (gs_lib_ctx_get_non_gc_memory_t(), pDev->pcoreOmni->pszJobOptions, strlen (pDev->pcoreOmni->pszJobOptions) + 1, 1, "Option String");
- pDev->pcoreOmni->pszJobOptions = 0;
- }
-
- iLength = strlen (pszSelectedJobProperties);
-
- pDev->pcoreOmni->pszJobOptions = (char *)gs_malloc (gs_lib_ctx_get_non_gc_memory_t(), 1, iLength + 1, "Option String");
-
- strcpy (pDev->pcoreOmni->pszJobOptions, pszSelectedJobProperties);
-
- if (fDebugOutput) fprintf (stderr, "options = %s\n", pDev->pcoreOmni->pszJobOptions);
-
- g_module_symbol (pModule, "FreeOmniJobProperties", (gpointer *)&pfnFreeDialogMemory);
-
- if (pfnFreeDialogMemory)
- {
- pfnFreeDialogMemory (&pszSelectedJobProperties);
-
- if (fDebugOutput) fprintf (stderr, "Freeing Dialog Memory\n");
- }
- }
- else
- {
- fprintf (stderr, "Error: Unable to find <<GetOmniJobProperties>> in <<%s>>.\n", cDialogName);
- }
-
- g_module_close (pModule);
- }
- }
-
- if (pDev->iUseServer)
- {
- pDev->pcoreOmni->bPDCDevice = true;
- }
-
- /* get the omni version in case we need it */
- if (pDev->pfnGIInit)
- {
- pDev->pfnGIInit ((void*)pDev->pcoreOmni);
-
- if (fDebugOutput) fprintf(stderr, "core_omni_device size = %d\n",pDev->pcoreOmni->cbSize);
- if (fDebugOutput) fprintf(stderr, "GI version = %s\n",pDev->pcoreOmni->cVersion);
-
- pDev->pCallPtr = (void *)pDev->pcoreOmni;
- }
- else
- {
- pDev->pCallPtr = (void *)pDev->pcoreOmni->pDevice;
- }
-
- pDev->pcoreOmni->pDevice = pDev->pfnCreateDevice (pDev->pcoreOmni,
- (void **)&pDev->hmodDevice,
- pDev->iUseServer);
-
- if (!pDev->pcoreOmni->pDevice)
- {
- fprintf (stderr, "<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: Unable create a omni device\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
-
- return_error (gs_error_Fatal); /* fail if no device was created */
- }
-
- if (fDebugOutput) fprintf (stderr, "Device = %p\n", pDev->pcoreOmni->pDevice);
- if (fDebugOutput) fprintf (stderr, "Omni version = %s\n", pDev->pcoreOmni->cOmniVersion);
- if (fDebugOutput) fprintf (stderr, "Device = \"%s\"\n", pDev->pcoreOmni->cDeviceName);
-
- bRet = pDev->pfnGetPrintModeInfo ((void*)pDev->pCallPtr, &prtMode);
-
- if (fDebugOutput) fprintf(stderr, "GetPrintModeInfo returns %d\n", bRet);
- if (fDebugOutput) fprintf(stderr, "GetPrintModeInfo.iBitCount = %d\n", prtMode.iBitCount);
- if (fDebugOutput) fprintf(stderr, "GetPrintModeInfo.iPlanes = %d\n", prtMode.iPlanes);
-
- if (bRet)
- {
- /* turn off Ghostscript mono if we are not in mono mode */
- if ( (prtMode.iBitCount > 1)
- && pDev->iGSMono
- )
- {
- if (fDebugOutput) fprintf (stderr, "Turning off GSMONO - prtMode.iBitCount = %d\n", prtMode.iBitCount);
- pDev->iGSMono = 0;
- }
- }
- /* this routine is called multiple times */
- pDev->iSetup = 1; /* don't go setting up new devices */
-
- /* get the hardware resolution information */
-
- bRet = pDev->pfnGetResolutionInfo ((void*)pDev->pCallPtr, &hwRes);
-
- if (!bRet)
- {
- fprintf (stderr, "<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: Failed GetResolutionInfo in SetupDevice\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
-
- return_error (gs_error_Fatal);
- }
-
- /* get the hardware page margins information */
-
- bRet = pDev->pfnGetMarginInfo ((void*)pDev->pCallPtr, &hwMargins);
-
- if (!bRet)
- {
- fprintf (stderr, "<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: Failed GetMarginInfo in SetupDevice\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
-
- return_error (gs_error_Fatal);
- }
-
- if (fDebugOutput) fprintf (stderr, "GetMarginInfo returns %d\n", bRet);
- if (fDebugOutput) fprintf (stderr, "GetMarginInfo.fLeftClip = %f\n", hwMargins.fLeftClip);
- if (fDebugOutput) fprintf (stderr, "GetMarginInfo.fBottomClip = %f\n", hwMargins.fBottomClip);
- if (fDebugOutput) fprintf (stderr, "GetMarginInfo.fRightClip = %f\n", hwMargins.fRightClip);
- if (fDebugOutput) fprintf (stderr, "GetMarginInfo.fTopClip = %f\n", hwMargins.fTopClip);
- if (fDebugOutput) fprintf (stderr, "GetMarginInfo.fxWidth = %f\n", hwMargins.fxWidth);
- if (fDebugOutput) fprintf (stderr, "GetMarginInfo.fyHeight = %f\n", hwMargins.fyHeight);
-
- /*
- * We have to let GS know about our page and resolution parameters
- */
-
- /* setup the width and height of the page */
- prgxdev->width = (int)hwMargins.fxWidth;
- prgxdev->height = (int)hwMargins.fyHeight;
- prgxdev->MediaSize[1] = (hwMargins.fyHeight/(float)hwRes.yRes)*72.0;
- prgxdev->MediaSize[0] = (hwMargins.fxWidth/(float)hwRes.xRes)*72.0;
-
- /* does not seem like pels works correctly for margins so lets set the margins */
- /* using points instead */
-
- /* left margin */
- prgxdev->HWMargins[0] = (float)hwMargins.fLeftClip/25400.0 *72.0;
-
- /* bottom margin */
- prgxdev->HWMargins[1] = (float)hwMargins.fBottomClip/25400.0 *72.0;
-
- /* right margin */
- prgxdev->HWMargins[2] = (float)hwMargins.fRightClip/25400.0 *72.0;
-
- /* top margin */
- prgxdev->HWMargins[3] = (float)hwMargins.fTopClip/25400.0 *72.0;
-
- /* set x resolution */
- prgxdev->HWResolution[0] = (float)hwRes.xRes;
-
- /* set y resolution */
- prgxdev->HWResolution[1] = (float)hwRes.yRes;
-
- prgxdev->pDev->iVertDots = (float)hwRes.fScanDots; /* fill in the scan line */
-
- if (fDebugOutput) fprintf (stderr, "left margin pts = %f \n", prgxdev->HWMargins[0]);
- if (fDebugOutput) fprintf (stderr, "bottom margin pts = %f \n", prgxdev->HWMargins[1]);
- if (fDebugOutput) fprintf (stderr, "right margin pts = %f \n", prgxdev->HWMargins[2]);
- if (fDebugOutput) fprintf (stderr, "top margin pts = %f \n", prgxdev->HWMargins[3]);
-
- if (!pDev->iGSMono)
- {
- /* 1,1,1,0,2,0 - mono */
- /* 3, 24,255,255,5,5 - color */
- if (fDebugOutput) fprintf (stderr, "depth = %d \n", prgxdev->color_info.depth );
- if (fDebugOutput) fprintf (stderr, "num_comp = %d \n", prgxdev->color_info.num_components );
- if (fDebugOutput) fprintf (stderr, "max_gray = %d \n", prgxdev->color_info.max_gray );
- if (fDebugOutput) fprintf (stderr, "max_color = %d \n", prgxdev->color_info.max_color );
- if (fDebugOutput) fprintf (stderr, "dither_grays = %d \n", prgxdev->color_info.dither_grays );
- if (fDebugOutput) fprintf (stderr, "dither_colors = %d \n", prgxdev->color_info.dither_colors );
-
- prgxdev->color_info.depth = 24;
- prgxdev->color_info.num_components = 3;
- prgxdev->color_info.max_gray = 255;
- prgxdev->color_info.max_color = 255;
- prgxdev->color_info.dither_grays = 5;
- prgxdev->color_info.dither_colors = 5;
- }
- }
-
- iReturnCode = gdev_prn_put_params ((gx_device *)prgxdev, plist);
-
- if (fDebugOutput) fprintf (stderr, "SetupDevice returning %d\n", iReturnCode);
-
- return iReturnCode; /* likely not be a failure */
-}
-
-private int
-omni_print_page (gx_device_printer *pdev, FILE *prn_stream)
-{
- return PrintPage (pdev, prn_stream, 1);
-}
-
-/* ------------------------------------------------------*/
-/* ------------------------------------------------------*/
-
-private int
-PrintPage (gx_device_printer *pgx_prt_dev, FILE *prn_stream, int num_copies)
-{
- gx_device_omni * const pasyncDev = (gx_device_omni *)pgx_prt_dev;
- gx_device * const pgx_dev = (gx_device *)pgx_prt_dev;
- uint uiLineSize = gdev_prn_raster (pgx_prt_dev); /* Raster line size in bytes*/
-
- /* BMP scan lines need to be padded to 32 bits. */
-
- /*
- * The following variables are uses for outputting the bitmap information
- */
- uint uiBytesPerLine = uiLineSize + (-uiLineSize & 3); /*actual raster line size used for row */
-
- byte *pBitmapMem = NULL; /* bitmap memory for the bitmap band */
- bool bRet;
- RECTL rectPageLocation;
- SIZEL sizelPage;
- ULONG ulBandLength; /* number of scan-lines to match the memory threshold for a band */
- int iBytesToAlloc;
-
- int iYBand;
- int code = 0;
- int y,
- iNumColors;
- byte *pGSData = 0;
- byte *raster_data;
-
- /* MONO */
- byte *pMonoData = NULL;
- DIFFUSIONDITHERINFO DiffInfo;
- byte *pBuffer = NULL;
- IMAGEINFOS ImageInfo;
- POINTL ptlBounds;
- POINTL ptlTrgBounds;
-
- PRINTMODE prtMode; /* definition of printed output Bpp .. */
-
- /* Get things setup to call into the driver code */
- BITMAPINFO2 *pbmi;
-
- PDEVSTRUCT pDev = pasyncDev->pDev;
-
- ptlBounds.x = 0;
- ptlBounds.y = 0;
- ptlTrgBounds.x = 0;
- ptlTrgBounds.y = 0;
-
- if ( !pDev
- || !pDev->pcoreOmni->pDevice
- )
- {
- fprintf (stderr, "<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: -sDeviceName=XXX is not specified\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
-
- return_error (gs_error_Fatal);
- }
-
- pDev->iPage++;
- pDev->iPageNumber++; /*keep track of the page @@04162001 */
-
- bRet = pDev->pfnGetPrintModeInfo ((void*)pasyncDev->pDev->pCallPtr, &prtMode);
-
- iNumColors = 1 << prtMode.iBitCount;
-
- /* Allocate a full bitmapinfo2 and bitmap header message */
- iBytesToAlloc = sizeof (BITMAPINFO2);
- if (256 >= iNumColors)
- {
- iBytesToAlloc += (iNumColors - 1) * sizeof (RGB2);
- }
-
- pbmi = (PBITMAPINFO2)gs_malloc (gs_lib_ctx_get_non_gc_memory_t(), 1, iBytesToAlloc, "Bmpi Memory");
- if (!pbmi)
- {
- fprintf(stderr, "<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf(stderr, "Error: Failed allocation of pbmi in PrintPage\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
-
- return_error (gs_error_VMerror);
- }
-
- pbmi->cbFix = sizeof(BITMAPINFO2); /* Length of fixed portion of structure?? */
-
- if (256 >= iNumColors) /* must be 16 or 24 bit */
- {
- if (iNumColors == 2)
- {
- memset (&DiffInfo, 0xFF, sizeof (DiffInfo));
- memset (&ImageInfo, 0xFF, sizeof (ImageInfo));
-
- DiffInfo.ulLength = sizeof (DiffInfo);
- DiffInfo.ulType = GDM_MATRIX_DITHER;
- DiffInfo.fOptions = 0;
- DiffInfo.ulIntensity = 80;
- DiffInfo.bRedWt = 30; /*25 */
- DiffInfo.bGreenWt = 50; /*60 */
- DiffInfo.bBlueWt = 20; /*15 */
- DiffInfo.bPad = 0;
-
- if (!pDev->iGSMono)
- {
- pbmi->argbColor[0].bBlue = 0xFF; /* background */
- pbmi->argbColor[0].bRed = 0xFF;
- pbmi->argbColor[0].bGreen = 0xFF;
- pbmi->argbColor[1].bBlue = 0x00; /* foreground */
- pbmi->argbColor[1].bRed = 0x00;
- pbmi->argbColor[1].bGreen = 0x00;
- }
- else
- {
- pbmi->argbColor[1].bBlue = 0xFF; /* background */
- pbmi->argbColor[1].bRed = 0xFF;
- pbmi->argbColor[1].bGreen = 0xFF;
- pbmi->argbColor[0].bBlue = 0x00; /* foreground */
- pbmi->argbColor[0].bRed = 0x00;
- pbmi->argbColor[0].bGreen = 0x00;
- }
-
- ImageInfo.pptlSrc = &ptlBounds; /* rectangle extents */
- ImageInfo.pptlDst = &ptlTrgBounds; /* rectangle extents */
- ImageInfo.ulSrcBpp = 24;
- ImageInfo.ulSrcBytesPerLine = uiBytesPerLine; /* src bytes per line */
- ImageInfo.ulcSrcClrs = 0;
- ImageInfo.ulSrcClrType = 0;
- ImageInfo.pargb2Src = 0; /* if srcBPP != 24 */
- ImageInfo.ulTrgBpp = 1;
- ImageInfo.ulTrgBytesPerLine = pasyncDev->width + (-pasyncDev->width & 31);
- ImageInfo.ulTrgBytesPerLine /= 8;
- ImageInfo.ulcTrgClrs = 2;
- ImageInfo.ulTrgClrType = 0;
- ImageInfo.pargb2Trg = NULL;
- ImageInfo.ulOptions = 0; /* options */
- ImageInfo.ulPelSizeCorrection = pDev->ulPelSizeCorrection;
-
- ptlBounds.x = pasyncDev->width; /* Bounding rectangle for input bitmap */
- ptlTrgBounds.x = pasyncDev->width; /* Bounding rectangle for output bitmap */
- }
- else
- {
- /*
- * add for 256 color support -- @TBD ...
- */
- }
- }
- /* set the bitmap width to match the page */
-
- pbmi->cx = pgx_prt_dev->width;
-
- if (fDebugOutput) fprintf (stderr, "***************************************************************\n");
- if (fDebugOutput) fprintf (stderr, "ulTrgBytesPerLine = %ld\n", ImageInfo.ulTrgBytesPerLine);
- if (fDebugOutput) fprintf (stderr, "ulBytesPerLine = %d\n", uiBytesPerLine);
- if (fDebugOutput) fprintf (stderr, "ulLineSize = %d\n", uiLineSize);
- if (fDebugOutput) fprintf (stderr, "width = %d\n", pgx_prt_dev->width);
- if (fDebugOutput) fprintf (stderr, "height = %d\n", pgx_prt_dev->height);
- if (fDebugOutput) fprintf (stderr, "***************************************************************\n");
-
- pbmi->cPlanes = prtMode.iPlanes; /* Number of bit planes */
- pbmi->cBitCount = prtMode.iBitCount; /* number of bits per pel */
-
- /*
- * BMP format is single page, so discard all but 1st printable page
- * This logic isn't quite right, since we can't truncate file if
- * num_pages == 0.
- */
- if (pasyncDev->copies_printed > 0)
- return 0;
-
- if (pDev->iSync)
- {
- /* If there's data in buffer, need to process w/overlays */
- if (pasyncDev->buffered_page_exists)
- {
- code = BufferPage(pgx_prt_dev, prn_stream, num_copies);
- goto done;
- }
- }
-
- pGSData = (byte *)gs_malloc (gs_lib_ctx_get_non_gc_memory_t(), uiBytesPerLine, 1, "bmp file buffer");
-
- if (pGSData == 0)
- /* can't allocate row buffer */
- return_error (gs_error_VMerror);
-
- /* seek to the file's end */
- if (pDev->iPage == 1)
- {
- fseek (prn_stream, 0L, SEEK_SET);
- }
-
- /* need to calculate the correct bandsize needed for the device */
- ulBandLength = FindBandSize (pasyncDev->height,
- pasyncDev->width,
- 24, /* always use 24 bits for source bitmap */
- pbmi->cPlanes,
- pasyncDev->pDev->iVertDots,
- 8000*1024); /*eight meg buffer */
-
- pBitmapMem = (byte *) gs_malloc (gs_lib_ctx_get_non_gc_memory_t(), 1, uiBytesPerLine * ulBandLength, "Bitmap Memory");
-
- if(!pBitmapMem)
- {
- fprintf (stderr, "<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: Failed allocation of pBitmapMem in PrintPage\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
-
- return_error (gs_error_VMerror);
- }
-
- /* is the band bigger than the page ? */
-
- sizelPage.cx = pasyncDev->width;
- sizelPage.cy = pasyncDev->height;
-
- ulBandLength = ulBandLength >=sizelPage.cy ? sizelPage.cy : ulBandLength;
-
- if (pBitmapMem)
- {
- memset (pBitmapMem, 0xFF, uiBytesPerLine * ulBandLength ); /* memset the memory to white? maybe zero */
- }
- else
- {
- fprintf(stderr, "<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf(stderr, "Error: Bitmap memory alloc Failed\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
-
- return_error (gs_error_VMerror);
- }
-
- /* Do initial setup for Rasterize for dithering work on the page. */
-
- rectPageLocation.xLeft = 0;
- rectPageLocation.xRight = pasyncDev->width;
-
-
- if (pDev->iPageNumber == 1)
- {
- pDev->pcoreOmni->pfpOut = prn_stream;
-
- pDev->pfnBeginJob ((void*)pasyncDev->pDev->pCallPtr, prn_stream);
- }
- else
- {
- pDev->pfnNewFrame ((void*)pasyncDev->pDev->pCallPtr);
- }
-
-/* rectPageLocation.yTop = rectPageLocation.yBottom = 0; @@10172000 */
- rectPageLocation.yTop = pasyncDev->height-1; /* @@10172000 */
-
- /*
- * Banding Implementation based on bandsize - need to put bits in place so that we can
- * tell if this is a top to down or bottom to top printer.
- */
- {
- /*BEGIN BLOCK for Banding code */
-
-/* int iCurTop = 0, iCurBot = 0; @@10172000 */
-
- /*
- * Since this band needs to be flipped, we need to get a pointer to the top of memory
- * so that we can copy from the top down into the band
- * We also need to seek to the end of the file because this type of printer needs the
- * last lines in the bitmap sent first
- */
-
- byte * pBitmapTop = pBitmapMem + ((ulBandLength-1) * uiBytesPerLine);
-
- iYBand = 0;
-
- /* Call DiffusionDither to setup pBuffer - quick in and out @@04062001 */
- if (!pDev->iGSMono)
- pDev->pfnMonoDither (&DiffInfo,
- &ImageInfo,
- &pBuffer,
- (unsigned long)GDM_DITHER_BEGIN);
-
- /* Go through the bitmap that we have been given */
- for (y = pasyncDev->height - 1; y >= 0; y--)
- {
- if ( (iYBand < ulBandLength)
- && ((code = dev_proc(pgx_dev, get_bits)(pgx_dev, pasyncDev->height - 1 - y, pGSData, &raster_data)) >= 0)
- && (y != 0)
- )
- {
- memcpy (pBitmapTop - (iYBand * uiBytesPerLine), raster_data, uiBytesPerLine);
-
- iYBand++; /* keep track of lines in the band */
- }
- else
- {
- if ( (code < 0)
- && (y > 0)
- ) /* add back in the line we failed to get if an error was returned from get_bits */
- {
- if (iYBand != ulBandLength)
- {
- y++;
- continue;
- }
- }
-
- /* we always decrement y when we come through here even if this is just a complete band */
- if (iYBand == ulBandLength)
- y++;
-
- /* we currently support 24bit or mono so if this is the mono case, allocate memory to be */
- /* used for the gray-scaled bitmap buffer */
- if (!pDev->iGSMono)
- {
- if (prtMode.iBitCount < 16)
- {
- pMonoData = (byte *)gs_malloc (gs_lib_ctx_get_non_gc_memory_t(), 1, iYBand * ImageInfo.ulTrgBytesPerLine, "Mono Memory");
-
- if (pMonoData)
- {
- memset (pMonoData, 0xFF, iYBand * ImageInfo.ulTrgBytesPerLine );
- }
- else
- {
- fprintf (stderr, "<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: Failed allocation of pMonoData in PrintPage\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
-
- return_error (gs_error_VMerror);
- }
-
- ImageInfo.pptlSrc->y = ImageInfo.pptlDst->y = iYBand; /* exclusive?? */
- ImageInfo.pbSrcBits = pBitmapTop - ((iYBand-1) * uiBytesPerLine); /* pointer to src image data */
- ImageInfo.pbTrgBits = pMonoData; /* pointer to dst image data */
-
- /* Call DiffusionDither to generate a gray-scaled image from our 24bit bitmap */
-
- pDev->pfnMonoDither (&DiffInfo, &ImageInfo, &pBuffer, (unsigned long) 0);
- }
- }
-
- pbmi->cy = iYBand;
-
- /* set the page location to account for the new band size (cy) */
-
- rectPageLocation.yBottom = rectPageLocation.yTop - pbmi->cy ; /* @@10172000 */
-
- /* If this in a mono device, we need to send the mono data to the device and */
- /* not the color */
-
- if ( pMonoData
- && !pDev->iGSMono
- )
- {
- pDev->pfnRasterize ((void*)pasyncDev->pDev->pCallPtr,
- pMonoData,
- pbmi,
- &sizelPage,
- &rectPageLocation,
- BITBLT_BITMAP);
-
- /* We're done with the mono band */
- /* now free up the mono buffer so we can get clean data buffer if more lines are to be */
- /* gray-scaled */
- gs_free (gs_lib_ctx_get_non_gc_memory_t(), (char *)pMonoData, iYBand * ImageInfo.ulTrgBytesPerLine, 1, "Mono Memory");
-
- pMonoData = NULL;
- }
- else
- { /* non-mono device -- Send the rgb bitmap to the dither and rasterize routines */
- if (fDebugOutput) fprintf(stderr, "rendering band lines %d - %d w/%d \n", (int)rectPageLocation.yTop, (int)rectPageLocation.yBottom, iYBand);
-
- if (fDebugOutput) fprintf(stderr, "***************************************************************\n");
- if (fDebugOutput) fprintf(stderr, "***************************************************************\n");
- if (fDebugOutput) fprintf(stderr, "Number of lines in band = %d\n", iYBand);
- if (fDebugOutput) fprintf(stderr, "rectPageLocation - Top = %ld\n", rectPageLocation.yTop);
- if (fDebugOutput) fprintf(stderr, "rectPageLocation - Bot = %ld\n", rectPageLocation.yBottom);
- if (fDebugOutput) fprintf(stderr, "***************************************************************\n");
- if (fDebugOutput) fprintf(stderr, "***************************************************************\n");
-
- pDev->pfnRasterize ((void*)pasyncDev->pDev->pCallPtr,
- pBitmapTop - ((iYBand-1) * uiBytesPerLine),
- pbmi,
- &sizelPage,
- &rectPageLocation,
- BITBLT_BITMAP);
- /* memset the memory to white */
- memset (pBitmapMem, 0xFF, uiBytesPerLine * ulBandLength);
- }
-
- /*
- * implemented based on the number of lines sent to the
- * printer and not based on the bandsize
- */
-
- rectPageLocation.yTop -= iYBand;
-
- iYBand = 0;
- }
- }
-
- if (!pDev->iGSMono)
- pDev->pfnMonoDither (&DiffInfo,
- &ImageInfo,
- &pBuffer,
- (unsigned long)GDM_DITHER_END);
-
- pBuffer = NULL;
- } /*END BLOCK*/
-
-done:
-
- gs_free (gs_lib_ctx_get_non_gc_memory_t(), (char *) pBitmapMem, uiBytesPerLine * ulBandLength, 1, "Bitmap Memory");
- fprintf (stderr, "Page Completed\n");
-
- gs_free (gs_lib_ctx_get_non_gc_memory_t(), (char *)pGSData, uiBytesPerLine, 1, "bmp file buffer");
- gs_free (gs_lib_ctx_get_non_gc_memory_t(), (char *)pbmi, uiBytesPerLine, 1, "Bpmi Memory");
-
- /******************************************************************/
- /* Note: @@08162000 */
- /* GS has at least two threads for doing output on async devices.*/
- /* There is a writer and a render thread running at one time and */
- /* each have their own PageCount values. The PageCount on the */
- /* writer thread gets updated but the render thread (us) does */
- /* not receive the update. It looks like there needs to be a */
- /* way to update the thread's device structure that is doing the */
- /* output with the new value when PageCount is changed. */
- /* If the thread doing the rasterizing queries the PageCount */
- /* value (calling put_params from inside of gxclrast.c) it will */
- /* stop rendering the page -- BAD.... */
- /* There needs to be a way to synchronize the two threads so that*/
- /* when the writer's thread actually updates the PageCount value */
- /* in both threads device structures get updated so we don't */
- /* stop rasterizing the page. */
- /* */
- /* | | | | */
- /* V V V V */
- /******************************************************************/
- pgx_prt_dev->PageCount = pDev->iPage - 1;
-
- if (pasyncDev->copies_printed > 0)
- {
- pasyncDev->copies_printed = num_copies;
- }
-
- pasyncDev->buffered_page_exists = 0;
-
- return code;
-}
-
-/* -------------- Renderer instance procedures ----------*/
-
-/* Thread to do rendering, started by StartRenderThread */
-private void
-RenderThread (void *params)
-{
-#ifdef OMNI_ASYNC
- gdev_prn_async_render_thread ((gdev_prn_start_render_params *)params);
-#endif
-}
-
-/* ------------------------------------------------------*/
-/* ------------------------------------------------------*/
-
-private int /* rets 0 ok, -ve error if couldn't start thread */
-StartRenderThread (gdev_prn_start_render_params *params)
-{
- return gp_create_thread(RenderThread, params);
-}
-
-/* ------------------------------------------------------*/
-/* ------------------------------------------------------*/
-
-private int
-OpenRenderDevice (gx_device_printer *ppdev)
-{
- gx_device_omni * const pasyncDev = (gx_device_omni *)ppdev;
-
- /* Do anything that needs to be done at open time here... */
- pasyncDev->copies_printed = 0;
-
- /* Cascade down to the default handler */
-#ifdef OMNI_ASYNC
- return gdev_prn_async_render_open(ppdev);
-#else
- return gs_note_error(gs_error_undefined);
-#endif
-}
-
-/* ------------------------------------------------------*/
-/* ------------------------------------------------------*/
-
-/* Buffer a (partial) rasterized page & optionally print result multiple times. */
-private int
-BufferPage (gx_device_printer *pgx_prt_dev, FILE *file, int num_copies)
-{
-#ifndef OMNI_ASYNC
-
- /* locate_overlay_buffer is gone, so for now async printing is disabled */
- return gs_note_error (gs_error_undefined);
-
-#else
- gx_device_omni * const pasyncDev = (gx_device_omni *)pgx_prt_dev;
- gx_device * const pgx_dev = (gx_device *)pgx_prt_dev;
- int code = 0;
-
- /* BMP format is single page, so discard all but 1st page */
- if (pasyncDev->copies_printed > 0)
- return 0;
-
- /* If there's no data in buffer, no need to do any overlays */
- if (!pasyncDev->buffered_page_exists)
- {
- code = PrintPage(pgx_prt_dev, file, num_copies);
-
- goto done;
- }
-
- /*
- * Overlay file's bits on top of existing file There are two choices for
- * doing this: get_overlay_bits vs. the combination of
- * locate_overlay_buffer and get_bits. If you already have a buffer in a
- * format compatible with GS's format, use get_overlay_bits. If you'd
- * rather use the buffer already in the device, use
- * locate_overlay_buffer, copy the bits into the returned buffer, then
- * get_bits.
- *
- * Either way, try to do entire bands at a shot for much greater
- * efficiency.
- */
-
- /* Seek to beginning of data portion of file */
- if (fseek (file, pasyncDev->file_offset_to_data, SEEK_SET))
- {
- code = gs_note_error (gs_error_ioerror);
-
- goto done;
- }
-
- {
- byte *raster_data;
- int raster = gx_device_raster (pgx_dev, 1);
- ulong bmp_raster = raster + (-raster & 3); /* BMP scan lines are padded to 32 bits. */
- int max_band_height = (*pgx_prt_dev->printer_procs.locate_overlay_buffer) (pgx_prt_dev, 0, &raster_data);
- int band;
- int file_raster_good = min (raster, bmp_raster);
- long file_raster_slop = bmp_raster - file_raster_good;
-
- /*
- * iterate thru bands from top to bottom.
- * Do this an entire band at a time for efficiency.
- */
- for (band = (pgx_prt_dev->height - 1) / max_band_height; band >= 0; --band)
- {
- int band_base_line = max_band_height * band;
- int band_height = (*pgx_prt_dev->printer_procs.locate_overlay_buffer) (pgx_prt_dev, band_base_line, &raster_data);
- int line;
-
- /* Fill in overlay buffer with a band from the BMP file. */
- /* Need to do this backward since BMP is top to bottom */
- for (line = band_height - 1; line >= 0; --line)
- {
- if ( fread (raster_data + line * bmp_raster,
- file_raster_good,
- 1,
- file) < 1
- || fseek (file, file_raster_slop, SEEK_CUR)
- )
- {
- code = gs_note_error (gs_error_ioerror);
-
- goto done;
- }
- }
-
- /* Rewind & write out buffer with contents of get_bits */
- if (fseek (file,
- -(file_raster_good + file_raster_slop) * band_height,
- SEEK_CUR))
- {
- code = gs_note_error(gs_error_ioerror);
-
- goto done;
- }
-
- for (line = band_height - 1; line >= 0; --line)
- {
- if ((code = dev_proc (pgx_dev, get_bits) (pgx_dev, line + band_base_line, 0, &raster_data)) < 0 )
- goto done;
-
- if ( fwrite (raster_data, file_raster_good, 1, file) < 1
- || fseek(file, file_raster_slop, SEEK_CUR)
- )
- {
- code = gs_note_error(gs_error_ioerror);
-
- goto done;
- }
- }
- }
- }
-
-done:
- if ( code >= 0
- && pasyncDev->copies_printed > 0
- )
- pasyncDev->copies_printed = num_copies;
-
- pasyncDev->buffered_page_exists = (code >= 0);
-
- return code;
-
-#endif
-}
-
-/* ------------------------------------------------------*/
-/*------------ Procedures common to writer & renderer -------- */
-/* ------------------------------------------------------*/
-
-/* Compute space parameters */
-private void
-GetSpaceParams (const gx_device_printer *pgx_prt_dev,
- gdev_prn_space_params *space_params)
-{
- /* Plug params into device before opening it
- *
- * You ask "How did you come up with these #'s?" You asked, so...
- *
- * To answer clearly, let me begin by recapitulating how command list
- * (clist) device memory allocation works in the non-overlapped case:
- * When the device is opened, a buffer is allocated. How big? For
- * starters, it must be >= PRN_MIN_BUFFER_SPACE, and as we'll see, must
- * be sufficient to satisfy the rest of the band params. If you don't
- * specify a size for it in space_params.band.BandBufferSpace, the open
- * routine will use a heuristic where it tries to use PRN_BUFFER_SPACE,
- * then works its way down by factors of 2 if that much memory isn't
- * available.
- *
- * The device proceeds to divide the buffer into several parts: one of
- * them is used for the same thing during writing & rasterizing; the
- * other parts are redivided and used differently writing and
- * rasterizing. The limiting factor dictating memory requirements is the
- * rasterizer's render buffer. This buffer needs to be able to contain
- * a bitmap that covers an entire band. Memory consumption is whatever
- * is needed to hold N rows of data aligned on word boundaries, +
- * sizeof(pointer) for each of N rows. Whatever is left over in the
- * rasterized is allocated to a tile cache. You want to make sure that
- * cache is at least 50KB.
- *
- * For example, take a 600 dpi b/w device at 8.5 x 11 inches. For the
- * whole device, that's 6600 rows @ 638 bytes = ~4.2 MB total. If the
- * device is divided into 100 bands, each band's rasterizer buffer is
- * 62K. Add on a 50K tile cache, and you get a 112KB (+ add a little
- * slop) total device buffer size.
- *
- * Now that we've covered the rasterizer, let's switch back to the
- * writer. The writer must have a tile cache *exactly* the same size as
- * the reader. This means that the space to divide up for the writer is
- * equal is size to the rasterizer's band buffer. This space is divided
- * into 2 sections: per-band bookeeping info and a command buffer. The
- * bookeeping info currently uses ~72 bytes for each band. The rest is
- * the command buffer.
- *
- * To continue the same 112KB example, we have 62KB to slice up.
- * We need 72 bytes * 100 bands = 7.2KB, leaving a 55K command buffer.
- *
- * A larger command buffer has some performance (see gxclmem.c comments)
- * advantages in the general case, but is critical in one special case:
- * high-level images. Whenever possible, images are transmitted across
- * the band buffer in their original resolution and bits/pixel. The
- * alternative fallback behavior can be very slow. Here, the relevant
- * restriction is that at least one entire source image row must fit
- * into the command buffer. This means that, in our example, an RGB
- * source image would have to be <= 18K pixels wide. If the image is
- * sampled at the same resolution as the hardware (600 dpi), that means
- * the row would be limited to a very reasonable 30 inches. However, if
- * the source image is sampled at 2400 dpi, that limit is only 7.5
- * inches. The situation gets worse as bands get smaller, but the
- * implementor must decide on the tradeoff point.
- *
- * The moral of the story is that you should never make a band
- * so small that its buffer limits the command buffer excessively.
- * Again, Max image row bytes = band buffer size - # bands * 72.
- *
- * In the overlapped case, everything is exactly as above, except that
- * two identical devices, each with an identical buffer, are allocated:
- * one for the writer, and one for the rasterizer. Because it's critical
- * to allocate identical buffers, I *strongly* recommend setting these
- * params in the writer's open routine:
- * space_params.band.BandBufferSpace, .BandWidth and .BandHeight. If
- * you don't force these values to a known value, the memory allocation
- * heuristic may not come to the same result for both copies of the
- * device, since the first allocation will diminish the amount of free
- * memory.
- *
- * There is room for an important optimization here: allocate the
- * writer's space with enough memory for a generous command buffer, but
- * allocate the reader with only enough memory for a band rasterization
- * buffer and the tile cache. To do this, observe that the space_params
- * struct has two sizes: BufferSpace vs. BandBufferSpace. To start,
- * BandBufferSpace is always <= BufferSpace. On the reader side,
- * BandBufferSpace is divided between the tile cache and the rendering
- * buffer -- that's all the memory that's needed to rasterize. On the
- * writer's side, BandBufferSpace is divided the same way: the tile
- * cache (which must be identical to the reader's) is carved out, and
- * the space that would have been used for a rasterizing buffer is used
- * as a command buffer. However, you can further increase the cmd buf
- * further by setting BufferSize (not BandBufferSize) to a higher number
- * than BandBufferSize. In that case, the command buffer is increased by
- * the difference (BufferSize - BandBufferSize). There is logic in the
- * memory allocation for printers that will automatically use BufferSize
- * for writers (or non-async printers), and BandBufferSize for readers.
- *
- * Note: per the comments in gxclmem.c, the banding logic will perform
- * better with 1MB or better for the command list.
- */
-
- /* This will give us a very "ungenerous" buffer. */
- /* Here, my arbitrary rule for min image row is: twice the dest width */
- /* in full RGB. */
- int render_space;
- int writer_space;
- const int tile_cache_space = 50 * 1024;
- const int min_image_rows = 2;
- int min_row_space = min_image_rows * (3 * (pgx_prt_dev->width + sizeof (int) - 1));
- int min_band_count = max (1, pgx_prt_dev->height / 100); /* make bands >= 1% of total */
-
- space_params->band.BandWidth = pgx_prt_dev->width;
- space_params->band.BandHeight = (pgx_prt_dev->height + min_band_count - 1) / min_band_count;
-
- render_space = gdev_mem_data_size ((const gx_device_memory *)pgx_prt_dev,
- space_params->band.BandWidth,
- space_params->band.BandHeight);
-
- /* need to include minimal writer requirements to satisfy rasterizer init */
- writer_space = 5000 /* add 5K slop for good measure */
- + (72 + 8) * ((pgx_prt_dev->height / space_params->band.BandHeight) + 1);
-
- space_params->band.BandBufferSpace = max (render_space, writer_space) + tile_cache_space;
- space_params->BufferSpace = max (render_space, writer_space + min_row_space) + tile_cache_space;
-}
-
-/*-----------------------------------------------------------------------------*/
-/* */
-/* Function: FindBandSize */
-/* This function figures out the appropriate band size based on the amount */
-/* of memory that can be occupied by the band and bitmap information. */
-/* bitmap, and the specifics of the hardware */
-/* */
-/*-----------------------------------------------------------------------------*/
-ULONG
-FindBandSize (ULONG ulYHeight,
- ULONG ulXWidth,
- ULONG ulBitsPerPel,
- ULONG ulNumPlanes,
- ULONG ulModulus,
- ULONG ulMemoryLimit)
-{
- ULONG ulSizeScanLine;
- ULONG ulMemoryNeeded;
- ULONG ulNumLinesFit;
-
- if (0 == ulModulus)
- {
- ulModulus = 1;
- }
-
- /* figure out how much memory is needed fore each line */
- ulSizeScanLine = ((ulBitsPerPel*ulXWidth+31)/32)*ulNumPlanes*4;
-
- /* Figure out how much memory is needed for the page */
- ulMemoryNeeded = ulYHeight * ulSizeScanLine;
-
- /* How many lines can fit in the size given? */
- ulNumLinesFit = ulMemoryLimit / ulSizeScanLine;
-
- if (0 == ulNumLinesFit)
- /* Minimum of 1 scan line */
- ulNumLinesFit = 1;
-
- if (ulNumLinesFit <= ulModulus)
- /* Not enough lines... Promote it to a modulus. */
- ulNumLinesFit = ulModulus;
- else
- /* Bump down the number of lines so that it is a modulus. */
- ulNumLinesFit -= ulNumLinesFit % ulModulus;
-
- if ((ulYHeight % ulNumLinesFit) * 100 / ulYHeight <= 15)
- {
- USHORT usBumpUp;
-
- usBumpUp = ulYHeight % ulNumLinesFit;
- usBumpUp += ulModulus - 1;
- usBumpUp /= ulModulus;
- usBumpUp *= ulModulus;
- ulNumLinesFit += usBumpUp;
- }
-
- return ulNumLinesFit ; /* return the number of lines we want for the band */
-}
diff --git a/gs/contrib/japanese/dmp_init.ps b/gs/contrib/japanese/dmp_init.ps
deleted file mode 100644
index b7bebd6d8..000000000
--- a/gs/contrib/japanese/dmp_init.ps
+++ /dev/null
@@ -1,206 +0,0 @@
-%!
-% Copyright (C) 1989, 1992, 1993 Aladdin Enterprises. All rights reserved.
-%
-% 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.
-
-% dmp_init.ps
-% Initialization file for `dmprt' device driver.
-%
-% Written initial version by... ASAYAMA Kazunori 1993 Nov.
-% Modified for Ghostscript 4.03 by ... ASAYAMA Kazunori 1997 May.
-
-%%%%% check version %%%%%
-
-201 % version of this initialization file.
-
-/dmprt finddevice { /DmprtParams gsgetdeviceprop /Version get }
- stopped { pop pop 0 } if
-2 copy ne {
- (\ndmprt: driver version\() print
- dup 0 eq {pop (unknown) print }{==only}ifelse
- (\) does not match dmp_init.ps version\() print
- ==only (\).\n) print
- flush 1 .quit
-} { pop pop } ifelse
-
-%%%%% BODY %%%%%
-
-40 dict begin % .WorkDict .UserParams
- % .DmprtDevice
- % .GetDmprtParam .SetDmprtParam
- % .DmprtParams .Xdpi .Ydpi .Xdot .Ydot
- %
- % in cm mm pt bp dot
- % BeginMode EndMode
- % .ModeDataBase .CurrentMode
- % BeginConfig EndConfig
- % BeginPrinterProps EndPrinterProps
-
-/.WorkDict currentdict def
-/.ModeDataBase 10 dict def
-/.dicttomark {
- counttomark 2 idiv dup dict begin { def } repeat pop currentdict end
-} bind def
-
-%%%%% utilities for user customization. %%%%%
-
-/in { } bind def
-/cm { 2.54 div } bind def
-/mm { 25.4 div } bind def
-/pt { 72.27 div } bind def
-/bp { 72.0 div } bind def
-/dot { [ exch truncate cvi ] } bind def
-
-% the database of user customizations. (not implemented yet.)
-/BeginMode { % <name> -> <name> mark
- mark
-} bind def
-/EndMode { % <name> mark <item1> <value1> ... <itemN> <valueN> -> --
- .dicttomark .ModeDataBase
- dup dup maxlength exch length eq {
- % Expand capacity of database dictionaly.
- dup maxlength 10 add dict copy dup /.ModeDataBase exch def
- } if
- 3 1 roll put
-} bind def
-
-% these procedures are undocumented in the user's manual.
-% these are used in order to specify the propaties directly.
-/BeginPrinterProps { [ } bind def
-/EndPrinterProps { ] /printer exch } bind def
-
-%%%%% run the user customization file. %%%%%
-
-/BeginConfig mark def
-/EndConfig { .dicttomark /.UserParams exch def } bind def
-systemdict /DMPCONFIG 2 copy known
-{ get run } % -sDMPCONFIG=<filename>
-{ pop pop (dmp_site.ps) findlibfile { closefile run } if } ifelse
-
-%%%%% refer database %%%%%
-
-/.UsedMode .ModeDataBase length dict def
-/.ExpandUserParams { % <dict> -> <param1> <value1> ... <paramN> <valueN>
- /.InheritMode null def
- { 1 index /inherit eq {
- exch pop dup .UsedMode exch known { % check recursive reference.
- /.ExpandUserParams /rangecheck signalerror
- } if
- /.InheritMode exch def
- } if } forall
- .InheritMode type /nametype eq {
- .UsedMode .InheritMode true put
- .ModeDataBase .InheritMode get .ExpandUserParams
- } if
-} bind def
-
-systemdict /DMPMODE 2 copy known
- {get .ModeDataBase exch get} {pop pop .UserParams} ifelse
-mark exch .ExpandUserParams .dicttomark /.UserParams exch def
-
-%%%%% Local variables and procedures. %%%%%
-/.DmprtDevice /dmprt finddevice def
-/.SetDmprtParam { % <key> <value> -> --
- .DmprtParams 3 1 roll put
-} bind def
-/.SetLocalParam { .LocalParams 3 1 roll put } bind def
-/.GetDmprtParam { % <key> -> <value>
- .DmprtParams exch get
-} bind def
-/.GetUserParam { % <key> <default-value> -> <value>
- .UserParams 3 -1 roll 2 copy known {get exch pop}{pop pop} ifelse
-} bind def
-/.SetUserParam { % <prop-name> <key> <default-value> -> --
- .GetUserParam .SetDmprtParam
-} bind def
-
-%%%%% dviprt proparties %%%%%
-
-mark
-.UserParams /printer 2 copy known {
- get dup type /dicttype ne { mark /FileName 3 -1 roll .dicttomark } if
-}
-{ pop pop % Default printer is `ESC/P 24 pins'.
- mark
- /Name (ESC/P 24 pins)
- /Transpose true
- /Reverse false
- /NonMoving false
- /Encoding (Null)
- /HDpi 180
- /VDpi 180
- /Pins 24
- /MinimalUnit 1
- /MaximalUnit 180
- /Constant 1
- /BitImageMode (\007\0333\030\033?Z\047)
- /NormalMode (\004\015\014\0332)
- /SendBitImage (\002\033Z\002\001\200)
- /SkipSpaces (\002\033\\\002\001\200)
- /LineFeed (\002\015\012)
- /FormFeed (\002\015\014)
- /AfterBitImage ()
- /BitRowHeader ()
- .dicttomark
-} ifelse
-/DviprtParams exch .DmprtDevice putdeviceprops
-
-getdeviceprops .dicttomark /.DmprtParams exch def
-.DmprtParams /DviprtParams get /.DviprtParams exch def
-.DmprtParams /DmprtParams get /.LocalParams exch def
-
-% calcurate resolutions and define operators converting
-% from user-coordination to device-coordination(count by dots).
-/resolution [ .DviprtParams dup /HDpi get exch /VDpi get ]
- .GetUserParam {} forall /.Ydpi exch def /.Xdpi exch def
-/.Xdot { dup type /arraytype eq { 0 get } { .Xdpi mul truncate cvi } ifelse
-} bind def
-/.Ydot { dup type /arraytype eq { 0 get } { .Ydpi mul truncate cvi } ifelse
-} bind def
-
-%%%%% Standard Ghostscript device propaties. %%%%%
-
-/HWSize % default is A4.
- /defaultsize [8.3 11.7] .GetUserParam
- [ exch dup 0 get .Xdot exch 1 get .Ydot ] .SetDmprtParam
-
-%%%%% dmprt device propaties. %%%%%
-
-/MaxSize
- /maxsize [0.0 0.0] .GetUserParam [ exch dup 0 get .Xdot exch 1 get .Ydot ]
- .SetLocalParam
-/Margins /margin [0.0 0.0 0.0 0.0] .GetUserParam
- [ exch dup 0 get .Xdot exch dup 1 get .Ydot
- exch dup 2 get .Xdot exch 3 get .Ydot ] .SetLocalParam
-/Verbose QUIET {false}
- {/verbose false .GetUserParam} ifelse .SetLocalParam
-/Debug /debug false .GetUserParam .SetLocalParam
-
-%%%%% Page device propaties. %%%%%
-%%%%% See PostScript Reference Manual 2nd edition. %%%%%
-
-/HWResolution [ .Xdpi .Ydpi ] .SetDmprtParam
-/Offsets
- /offset [0.0 0.0] .GetUserParam [ exch dup 0 get .Xdot exch 1 get .Ydot ]
- .SetLocalParam
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-mark .DmprtParams {} forall .DmprtDevice putdeviceprops pop
-
-end
-%%%%%%%%%%%%%%%%%%%%%%%%%%%% End of file %%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/gs/contrib/japanese/dmp_site.ps b/gs/contrib/japanese/dmp_site.ps
deleted file mode 100644
index 05bdb4d67..000000000
--- a/gs/contrib/japanese/dmp_site.ps
+++ /dev/null
@@ -1,14 +0,0 @@
-%!
-BeginConfig
-%%%%%%%%%%%%%%%%%%%%%% Standard user cusomizations %%%%%%%%%%%%%%%%%%%%%
-/printer (escp_24.src)
-% horizontal / vertical
-% /resolution [ 180.0 180.0 ]
-% horizontal / vertical
-% /offset [ 0.0 0.0 ]
-% width / height
-% /defaultsize [ 8.0 in 11.0 in ]
-% width / height
-% /maxsize [ 8.0 -1 ]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-EndConfig
diff --git a/gs/contrib/japanese/doc/Gdevlips.htm b/gs/contrib/japanese/doc/Gdevlips.htm
deleted file mode 100644
index 456046201..000000000
--- a/gs/contrib/japanese/doc/Gdevlips.htm
+++ /dev/null
@@ -1,1901 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<HTML LANG="ja">
-<HEAD>
-<META http-equiv="Content-type" content="text/html; charset=iso-2022-jp">
-<LINK rev="made" href="mailto:ohmori@p.chiba-u.ac.jp">
-<TITLE lang="en">Ghostscript driver for LIPS &amp; ESC/Page &amp; NPDL</TITLE>
-<!-- $Id: Lips.htm $ -->
-</HEAD>
-<BODY lang="ja">
-
-<H1>LIPS &amp; ESC/Page &amp; NPDL $BBP1~(B Ghostscript $B%G%P%$%9%I%i%$%P(B</H1>
-<P>
-$B$3$N%=%U%H%&%'%"$O(B Ghostscript 5.10/5.50 $BMQ$N%G%P%$%9%I%i%$%P$H$7$F:n$i$l$F$$$^$9!#(B
-</P>
-<P>
-$B%G%P%$%9%I%i%$%P$H$7$F%i%9%?!<HG%G%P%$%9$N(B lips2p$B!"(Blips3$B!"(Bbjc880j$B!"(Blips4$B!"(B
-escpage$B!"(Blp2000$B!"(Bnpdl $B%G%P%$%9$H!"(B
-$B%Y%/%?!<HG%G%P%$%9$N(B lips4v $B$,4^$^$l$F$$$^$9!#(B
-</P>
-<P>
-$B3F5!<o$H%G%P%$%9$NBP1~$O!"(B<A HREF="#lbp_list">LIPS $BBP1~%W%j%s%?$H=PNO%G%P%$%9(B</A>$B!"(B
-<A HREF="#lp_list">ESC/Page $BBP1~%W%j%s%?$H=PNO%G%P%$%9(B</A>$B!"(B
-<A HREF="#mw_list">NPDL $BBP1~%W%j%s%?$H=PNO%G%P%$%9(B</A>$B$r8+$F2<$5$$!#(B
-</P>
-<HR>
-<H2>$B%$%s%G%C%/%9(B</H2>
-<UL>
- <LI><A HREF="#haifu" NAME="i_haifu">$BG[I[>r7o(B</A>
- <LI><A HREF="#difference" NAME="i_difference">gdevlips4-1.2.0 $B$H$N0c$$(B</A>
- <LI><A HREF="#diff_epag" NAME="i_diff_epag">epag-3.08 $B$H$N0c$$(B</A>
- <LI><A HREF="#diff_npdl" NAME="i_diff_npdl">gdevnpdl-1.5 $B$H$N0c$$(B</A>
- <LI><A HREF="#lbp_list" NAME="i_lbp_list">LIPS $BBP1~%W%j%s%?$H=PNO%G%P%$%9(B</A>
- <LI><A HREF="#lp_list" NAME="i_lp_list">ESC/Page $BBP1~%W%j%s%?$H=PNO%G%P%$%9(B</A>
- <LI><A HREF="#mw_list" NAME="i_mw_list">NPDL $BBP1~%W%j%s%?$H=PNO%G%P%$%9(B</A>
- <LI><A HREF="#unsupported" NAME="i_unsupported">$BBP1~$7$F$$$J$$%W%j%s%?(B</A>
- <LI><A HREF="#install" NAME="i_install">$B%$%s%9%H!<%k(B</A>
- <LI><A HREF="#usage" NAME="i_usage">$B;HMQJ}K!(B/$B;HMQ%*%W%7%g%s(B</A>
- <UL>
- <LI>LIPS$B!&(BESC/Page$B!&(BNPDL $B6&DL%*%W%7%g%s(B
- <UL>
- <LI><A HREF="#device" NAME="i_device">$B%G%P%$%9JQ99(B</A>
- <LI><A HREF="#pagesize" NAME="i_pagesize">$B%G%U%)%k%H%Z!<%8%5%$%:JQ99(B</A>
- <LI><A HREF="#numcopies" NAME="i_numcopies">$BJ#?tIt0u:~(B</A>
- <LI><A HREF="#resolution" NAME="i_resolution">$B2rA|EYJQ99(B</A>
- <LI><A HREF="#duplex" NAME="i_duplex">$BN>LL0u:~(B</A>
- <LI><A HREF="#negativeprint" NAME="i_negativeprint">$BGr9uH?E>0u:~(B</A>
- </UL>
- <LI>ESC/Page $B$N$_$N%*%W%7%g%s(B
- <UL>
- <LI><A HREF="#ritoff" NAME="i_ritoff">RIT ($BNX3TJd@55!G=(B) $B$r%*%U$K$9$k(B</A>
- </UL>
- <LI>LIPS $B$N$_$N%*%W%7%g%s(B
- <UL>
- <LI><A HREF="#bitsperpixel" NAME="i_bitsperpixel">$B%b%N%/%m$H%+%i!<=PNO$N@ZBX$((B</A>
- <LI><A HREF="#feed" NAME="i_feed">$B5k;fJ}K!$NA*Br(B</A>
- <LI><A HREF="#panel" NAME="i_panel">$B%Q%M%kI=<(JQ99(B</A>
- <LI><A HREF="#mediatype" NAME="i_mediatype">$BMQ;f<oN`@_Dj(B</A>
- <LI><A HREF="#faceup" NAME="i_faceup">$B%U%'%$%9%"%C%W%H%l%$$N=PNO(B</A>
- <LI><A HREF="#nup" NAME="i_nup">n $BLL0u:~(B</A>
- <LI><A HREF="#fontdl" NAME="i_fontdl">$B%U%)%s%H%@%&%s%m!<%I(B</A>
- <LI><A HREF="#pjl" NAME="i_pjl">PJL $B=PNO(B</A>
- <UL>
- <LI><A HREF="#tdensity" NAME="i_tdensity">$B%H%J!<G;EYD4@a(B</A>
- <LI><A HREF="#tsave" NAME="i_tsave">$B%H%J!<@aLs(B</A>
- </UL>
- </UL>
- <LI><A HREF="#netatalk" NAME="i_netatalk">Netatalk$B!&(BCAP $B$H(B Ghostscript + gdevlips</A>
- </UL>
- <LI><A HREF="#hireso" NAME="i_hireso">LIPS IV $B=PNO$K$*$1$k9b2rA|EY0u;z$K4X$9$kCm0U(B</A>
- <LI><A HREF="#change" NAME="i_change">$BJQ99MzNr(B</A>
- <LI><A HREF="#bug" NAME="i_bug">$B%P%0(B</A>
- <UL>
- <LI>npdl.dev
- <UL>
- <LI><A HREF="#marginbug" NAME="i_marginbug">1. $B0u:~0LCV$,$:$l$k(B</A>
- <LI><A HREF="#nonduplex" NAME="i_nonduplex">2. $BN>LL0u:~$G$-$J$$(B</A>
- </UL>
- <LI>bjc880j.dev
- <UL>
- <LI><A HREF="#landbug" NAME="i_landbug">1. $B%i%s%I%9%1!<%W2sE>;~$K0u:~0LCV$,$A$g$C$H$:$l$k(B</LI>
- </UL>
- <LI>lips4v.dev
- <UL>
- <LI><A HREF="#clipping" NAME="i_clipping">1. $B%Q%9$N%/%j%C%T%s%0=hM};~$N%a%b%jITB-(B ($B%7%9%F%`%a%b%j%U%k(B $B%(%i!<(B)</A>
- <LI><A HREF="#zeroline" NAME="i_zeroline">2. $BI}$,%<%m$N%Q%9$r%U%#%k$7$?$H$-2?$bIA$+$l$J$$(B</A>
- <LI><A HREF="#zeromove" NAME="i_zeromove">3. $B0\F05wN%(B 0 $B$N%Q%9$N07$$(B</A>
- <LI><A HREF="#square_cap" NAME="i_square_cap">4. Projecting square cap $B$N%P%0(B</A>
- <LI><A HREF="#round_cap" NAME="i_round_cap">5. Round cap $B$N%P%0(B</A>
- <LI><A HREF="#linewidth" NAME="i_linewidth">6. $B@~$NB@$5$,0c$&(B</A>
- <LI><A HREF="#setdash" NAME="i_setdash">7. $BGK@~$N%Q%?!<%s$,IA$+$l$J$$(B</A>
- <LI><A HREF="#pattern" NAME="i_pattern">8. lips4v $B%I%i%$%P$G%+%i!<$G%Q%?!<%s$rIA$$$?>l9g?'$,$*$+$7$$$3$H$,$"$k(B</A>
- </UL>
- </UL>
- <LI><A HREF="#faq" NAME="i_faq">FAQ</A>
- <UL>
- <LI><A HREF="#slow" NAME="i_slow">$B%W%j%s%?$N=PNO$OB.$/$J$i$J$$$N(B?</A>
- <LI><A HREF="#font" NAME="i_font">$B%W%j%s%?$NFbB"%U%)%s%H$O;H$($J$$$N(B?</A>
- <LI><A HREF="#bsize" NAME="i_bsize">B4 $B$^$?$O(B B5 $B%5%$%:$NMQ;f;XDj$,$&$^$/$$$+$J$$$s$@$1$I(B</A>
- <LI><A HREF="#nup_printing" NAME="i_nup_printing">n $BLL0u:~$r$9$k$K$O!"$I$&$7$?$i$$$$$N(B?</A>
- <LI><A HREF="#psresize" NAME="i_psresize">$BMQ;f%5%$%:$N3HBg!"=L>.0u:~$r$9$k$K$O$I$&$9$k$s$G$9$+(B?</A>
- <LI><A HREF="#offset" NAME="i_offset">$B0u:~0LCV$rD4@0$9$k$K$O$I$&$7$?$i$$$$$G$9$+(B?</A>
- <LI><A HREF="#vector" NAME="i_vector">$B%i%9%?!<HG%G%P%$%9$H%Y%/%?!<HG%G%P%$%9$N0c$$$O(B?</A>
- <LI><A HREF="#l3vmono" NAME="i_l3vmono">LIPS IV $B0J30%I%i%$%P$N%Y%/%?!<HG$O:n$i$J$$$N(B?</A>
- <LI><A HREF="#lbp2030" NAME="i_lbp2030">lbp2030.dev $B$O$I$3$$$C$?$N(B?</A>
- <LI><A HREF="#fig" NAME="i_fig">lips3fig$B!"(Blips4cfig$B!"(Blips4fig $B$,$J$$$s$@$1$I(B</A>
- <LI><A HREF="#lips2p" NAME="i_lips2p">$B$I$&$7$F(B LIPS II+ $BBP1~%I%i%$%P$O(B lips2+ $B$d(B lips2plus $B$H$$$&L>A0$8$c$J$$$N(B?</A>
- </UL>
- <LI><A HREF="#thanks" NAME="i_thanks">$B<U<-(B</A>
- <LI><A HREF="#reference" NAME="i_reference">$B;29MJ88%(B</A>
-</UL>
-
-<HR>
-<H2><A HREF="#i_haifu" NAME="haifu">$BG[I[>r7o(B</A></H2>
-<P>
-$B$3$N%=%U%H%&%'%"$NG[I[>r7o$O(B GNU General Public License (GPL) Ver.2 $B$K=`$8$^$9!#(B
-</P>
-<P>
-$B$^$?!"$3$N%I%i%$%P$N0l;~G[I[@h$OEvLL(B
-<A HREF="http://www.bukka.p.chiba-u.ac.jp/~ohmori/">&lt;URI:http://www.bukka.p.chiba-u.ac.jp/~ohmori/&gt;</A>
-$B$H$7$^$9!#(B
-</P>
-<P>
-$B$3$N%=%U%H%&%'%"$K4X$7$F$NLd$$9g$o$;$OBg?95*?M(B <A HREF="mailto:ohmori@p.chiba-u.ac.jp">&lt;URI:mailto:ohmori@p.chiba-u.ac.jp&gt;</A>$B$K$*4j$$$7$^$9!#(B
-<HR>
-<H2><A HREF="#i_difference" NAME="difference">gdevlips4-1.2.0 $B$H$N0c$$(B</A></H2>
-<P>
-lips3.dev lips4c.dev lips4.dev$B$K4X$7$F!"(Bgdevlips4-1.2.0 $B$G$N<!$N$h$&$JIT6q9g$,(B
-$BD>$C$F$$$^$9!#(B
-</P>
-<UL>
- <LI>$B>e%^!<%8%s$,0u;z8B3&$N(B 5mm $B$^$G0u:~$G$-$k$h$&$K$J$C$?!#(B(gdevlips4-1.2.0 $B$G$O(B63/300$B%$%s%A(B($BLs(B10.3mm))
- <LI>$B%^!<%8%sJQ99$KBP1~(B
- <LI>$B%Z!<%8%5%$%:JQ99$KBP1~!#=PNO$G$-$J$$%Z!<%8%5%$%:$K$O$A$c$s$H%(%i!<$rJV$9!#(B
- <LI>$B2rA|EYJQ99$KBP1~!#=PNO$G$-$J$$2rA|EY$K$O$A$c$s$H%(%i!<$rJV$9!#(B
- <LI>$B%W%j%s%?$NGr;f$r=PNO$7$J$$@_Dj$,$-$A$s$HH?1G$5$l$k!#(B
- <LI>BJC-880J $B$G(BA4$B$h$jBg$-$$MQ;f$K0u:~$9$k$H$-!V(B20 $B%Z!<%8(B $B%*!<%P!<!W$N%(%i!<$,H/@8$9$kLdBj$N2r7h(B
-</UL>
-<P>
-$B$^$?<!$N$h$&$J5!G=$,DI2C$5$l$F$$$^$9!#(B
-</P>
-<UL>
- <LI>$B=PNO$N9bB.2=(B
- <UL>
- <LI>Ghostscript $B$N=hM}$N9bB.2=(B
- <LI>$B%W%j%s%?$N=PNO$N9bB.2=(B
- <LI>$BJ#?tIt0u:~;~$N9bB.2=(B
- </UL>
- <LI>$B%G%P%$%9$NDI2C(B
- <UL>
- <LI>LIPS II+ $B$KBP1~(B
- <LI>LBP-840/LBP-850 $B$N%9!<%Q!<%U%!%$%s(B LIPS (1,200 dpi)$B$KBP1~(B
- <LI>$B%Y%/%?!<HG%G%P%$%9(B lips4v.dev
- </UL>
- <LI>$B5k;fJ}K!$NA*Br$KBP1~(B
- <LI>$B%i%9%?!<%$%a!<%8$N05=L$KBP1~(B
- <LI>$B%Q%M%kI=<(JQ99$KBP1~(B
- <LI>$BN>LL0u:~%f%K%C%H$KBP1~(B (LIPS IV $B$N$_(B)
- <LI>n $BLL0u:~5!G=$KBP1~(B (LIPS IV $B$N$_(B)
- <LI>$B%H%J!<G;EYD4@a5!G=$KBP1~(B (LIPS IV $B$N$_(B)
- <LI>$B%H%J!<@aLs5!G=$KBP1~(B (LIPS IV $B$N$_(B)
-</UL>
-<HR>
-<H2><A HREF="#i_diff_epag" NAME="diff_epag">epag-3.08 $B$H$N0c$$(B</A></H2>
-<P>
-ESC/Page $B%I%i%$%PItJ,$O(B epag-3.08 $B$r%Y!<%9$K<c43$N%P%0%U%#%C%/%9$r$7$^$7$?!#(B
-$B$5$i$KJ#?tIt0u:~$r8zN(E*$K=PNO$G$-$k$h$&$K$7$^$7$?!#Gr9uH?E>0u:~$KBP1~$7$^$7$?!#(B
-$B$^$?!"(Bepag-3.08 $B$O$+$J$j%(%i!<=hM}$,4E$$$N$G$=$3$K$b<j$rF~$l$F$"$j$^$9!#(B
-</P>
-<P>
-ESC/Page $BMQ$N%G%P%$%9$,Fs$D$KA}$($F$$$k$N$O(B Ghostscript $B$N;EMM$K9g$o$;$k$?$a$G$9!#(B
-$B5U$K$$$&$H(B epag-3.08 $B$O(B Ghostscript $B$N;EMM$K9g$C$F$$$^$;$s!#(B
-($BNc$($P(B LP-1700S $B$G$O(B epag-3.08 $B$G$O(B -r600 $B%*%W%7%g%s$r;XDj$7$?$@$1$G$O(B 600 dpi $B0u:~$,@5>o$K$G$-$^$;$s!#(B)
-</P>
-<HR>
-<H2><A HREF="#i_diff_npdl" NAME="diff_npdl">gdevnpdl-1.5 $B$H$N0c$$(B</A></H2>
-<P>
-$B$3$N%I%i%$%P$K4^$^$l$k(B npdl.dev $B$O(B gdevnpdl-1.5 $B$K<!$N$h$&$J5!G=$,DI2C$5$l$F$$$^$9!#(B
-</P>
-<UL>
- <LI>$B0u:~B.EY$N9bB.2=(B
- <LI>$B$O$,$-%5%$%:$N%5%]!<%H(B
- <LI>$B%i%s%I%9%1!<%W$N%5%]!<%H(B
- <LI>$BJ#?tIt0u:~;~$K%3%T!<%b!<%I$r;H$$9bB.$K0u:~$G$-$k(B
- <LI>$BGr9uH?E>0u:~$KBP1~(B
-</UL>
-<P>
-$B$^$?!"2rA|EY$N%G%U%)%k%H$,(B 240 dpi $B$K$J$C$F$$$k$H$3$m$,0[$J$j$^$9!#(B
-(gdevnpdl-1.5 $B$G$O(B 400 dpi)
-</P>
-<HR>
-<H2><A HREF="#i_lbp_list" NAME="lbp_list">LIPS $BBP1~%W%j%s%?$H=PNO%G%P%$%9(B</A></H2>
-<P>
-LIPS $BBP1~%W%j%s%?$H=PNO%G%P%$%9L>(B/$B2rA|EY$N%j%9%H$G$9!#(B
-$B$3$l$O!"$"$/$^$G$b5,3J>e=PNO$G$-$k$b$N$r%j%9%H$7$?$@$1$G!"A4$F$N%W%j%s%?$G<B:]$K=PNO$G$-$k$3$H$r3NG'$7$?$o$1$G$O$J$$$N$GCm0U$7$F2<$5$$!#(B
-</P>
-<TABLE BORDER SUMMARY="LIPS Priner and Output Device">
- <TR>
- <TH>$B5!<o(B</TH><TH>$B%G%P%$%9L>(B</TH><TH>$B2rA|EY(B (dpi)</TH><TH>$BHw9M(B</TH>
- </TR>
- <TR>
- <TH ROWSPAN=2><A HREF="http://www.canon-sales.co.jp/faq/lbp/980021/lbp406s.html">LBP-B406S</A></TH><TD>lips2p</TD><TD>240x240</TD>
- </TR>
- <TR>
- <TD>lips3</TD><TD>300x300</TD><TD>$B3HD%(BRAM$B5Z$S3HD%(BROM$B$NA}@_$,I,MW(B</TD>
- </TR>
- <TR>
- <TH ROWSPAN=2><A HREF="http://www.canon-sales.co.jp/faq/lbp/980021/lbp406d.html">LBP-B406D</A></TH><TD>lips2p</TD><TD>240x240</TD>
- </TR>
- <TR>
- <TD>lips3</TD><TD>300x300</TD><TD>$B3HD%(BRAM$B5Z$S3HD%(BROM$B$NA}@_$,I,MW(B</TD>
- </TR>
- <TR>
- <TH><A HREF="http://www.canon-sales.co.jp/faq/lbp/980021/lbp406e.html">LBP-B406E</A></TH><TD>lips3</TD><TD>300x300</TD>
- </TR>
- <TR>
- <TH><A HREF="http://www.canon-sales.co.jp/faq/lbp/980021/lbp406g.html">LBP-B406G</A></TH><TD>lips3</TD><TD>300x300</TD>
- </TR>
- <TR>
- <TH><A HREF="http://www.canon-sales.co.jp/faq/lbp/980021/lbp406eII.html">LBP-B406E II</A></TH><TD>lips3</TD><TD>300x300</TD>
- </TR>
- <TR>
- <TH><A HREF="http://www.canon-sales.co.jp/faq/lbp/980021/lbp406gII.html">LBP-B406G II</A></TH><TD>lips3</TD><TD>300x300</TD>
- </TR>
- <TR>
- <TH ROWSPAN=2><A HREF="http://www.canon-sales.co.jp/faq/lbp/980021/lbp404.html">LBP-A404</A></TH><TD>lips2p</TD><TD>240x240</TD>
- </TR>
- <TR>
- <TD>lips3</TD><TD>300x300</TD><TD>$B3HD%(BRAM$B5Z$S3HD%(BROM$B$NA}@_$,I,MW(B</TD>
- </TR>
- <TR>
- <TH><A HREF="http://www.canon-sales.co.jp/faq/lbp/980021/lbp404e.html">LBP-B404E</A></TH><TD>lips3</TD><TD>300x300</TD>
- </TR>
- <TR>
- <TH><A HREF="http://www.canon-sales.co.jp/faq/lbp/980021/lbp404gII.html">LBP-A404G II</A></TH><TD>lips3</TD><TD>300x300</TD>
- </TR>
- <TR>
- <TH><A HREF="http://www.canon-sales.co.jp/faq/lbp/980021/lbp404f.html">LBP-A404F</A></TH><TD>lips3</TD><TD>300x300</TD>
- </TR>
- <TR>
- <TH><A HREF="http://www.canon-sales.co.jp/faq/lbp/980021/lbp405jr.html">LBP-A405Jr.</A></TH><TD>lips3</TD><TD>300x300</TD>
- </TR>
- <TR>
- <TH><A HREF="http://www.canon-sales.co.jp/faq/lbp/980021/lbp304e.html">LBP-A304E</A></TH><TD>lips3</TD><TD>300x300</TD>
- </TR>
- <TR>
- <TH><A HREF="http://www.canon-sales.co.jp/faq/lbp/980021/lbp304eII.html">LBP-A304E II</A></TH><TD>lips3</TD><TD>300x300</TD>
- </TR>
- <TR>
- <TH><A HREF="http://www.canon-sales.co.jp/faq/lbp/980021/lbp304gII.html">LBP-A304G II</A></TH><TD>lips3</TD><TD>300x300</TD>
- </TR>
- <TR>
- <TH><A HREF="http://www.canon-sales.co.jp/faq/lbp/980021/lbp309gII.html">LBP-A309G II</A></TH><TD>lips3</TD><TD>300x300</TD>
- </TR>
- <TR>
- <TH><A HREF="http://www.canon-sales.co.jp/faq/lbp/980021/lbp310.html">LBP-310</A></TH><TD>lips3</TD><TD>300x300</TD>
- </TR>
- <TR>
- <TH><A HREF="http://www.canon-sales.co.jp/faq/lbp/980021/lbp320.html">LBP-320</A></TH><TD>lips3</TD><TD>300x300</TD>
- </TR>
- <TR>
- <TH><A HREF="http://www.canon-sales.co.jp/Product/LBP/LBP-320Pro.html">LBP-320Pro</A></TH><TD>lips3</TD><TD>300x300</TD>
- </TR>
- <TR>
- <TH ROWSPAN=2><A HREF="http://www.canon-sales.co.jp/faq/lbp/980021/lbp730.html">LBP-730</A></TH><TD>lips4</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD>lips4v</TD><TD>300x300, 600x600</TD><TD>MaxiMem $BHsBP1~$J$N$G(B<A HREF="#clipping">$B%Q%9%/%j%C%T%s%0;~$N%a%b%jITB-(B</A>$B$KCm0U(B</TD>
- </TR>
- <TR>
- <TH ROWSPAN=2><A HREF="http://www.canon-sales.co.jp/faq/lbp/980021/lbp720.html">LBP-720</A></TH><TD>lips4</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD>lips4v</TD><TD>300x300, 600x600</TD><TD>MaxiMem $BHsBP1~$J$N$G(B<A HREF="#clipping">$B%Q%9%/%j%C%T%s%0;~$N%a%b%jITB-(B</A>$B$KCm0U(B</TD>
- </TR>
- <TR>
- <TH ROWSPAN=2><A HREF="http://www.canon-sales.co.jp/Product/LBP/LBP-450.html">LBP-450</A></TH><TD>lips4</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD>lips4v</TD><TD>300x300, 600x600</TD><TD>MaxiMem $BHsBP1~$J$N$G(B<A HREF="#clipping">$B%Q%9%/%j%C%T%s%0;~$N%a%b%jITB-(B</A>$B$KCm0U(B</TD>
- </TR>
- <TR>
- <TH ROWSPAN=2><A HREF="http://www.canon-sales.co.jp/faq/lbp/980021/lbp830.html">LBP-830</A></TH><TD>lips4</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD>lips4v</TD><TD>300x300, 600x600</TD><TD>MaxiMem $BHsBP1~$J$N$G(B<A HREF="#clipping">$B%Q%9%/%j%C%T%s%0;~$N%a%b%jITB-(B</A>$B$KCm0U(B</TD>
- </TR>
- <TR>
- <TH ROWSPAN=2><A HREF="http://www.canon-sales.co.jp/Product/LBP/LBP-430.html">LBP-430</A></TH><TD>lips4</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD>lips4v</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TH ROWSPAN=2><A HREF="http://www.canon-sales.co.jp/faq/lbp/980021/lbp930.html">LBP-930</A></TH><TD>lips4</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD>lips4v</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TH ROWSPAN=2><A HREF="http://www.canon-sales.co.jp/Product/LBP/LBP-750.html">LBP-750</A></TH><TD>lips4</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD>lips4v</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TH ROWSPAN=2><A HREF="http://www.canon-sales.co.jp/Product/LBP/LBP-740.html">LBP-740</A></TH><TD>lips4</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD>lips4v</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TH ROWSPAN=2><A HREF="http://www.canon-sales.co.jp/Product/LBP/LBP-930EX.html">LBP-930EX</A></TH><TD>lips4</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD>lips4v</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TH ROWSPAN=2><A HREF="http://www.canon-sales.co.jp/Product/LBP/LBP-850.html">LBP-850</A></TH><TD>lips4</TD><TD>300x300, 600x600, 1200x1200</TD><TD>1200 dpi $B;~$O(B lips4v $B$N$[$&$,$$$$(B?</TD>
- </TR>
- <TR>
- <TD>lips4v</TD><TD>300x300, 600x600, 1200x1200</TD>
- </TR>
- <TR>
- <TH ROWSPAN=2><A HREF="http://www.canon-sales.co.jp/Product/LBP/LBP-840.html">LBP-840</A></TH><TD>lips4</TD><TD>300x300, 600x600, 1200x1200</TD><TD>1200 dpi $B;~$O(B lips4v $B$N$[$&$,$$$$(B?</TD>
- </TR>
- <TR>
- <TD>lips4v</TD><TD>300x300, 600x600, 1200x1200</TD>
- </TR>
- <TR>
- <TH ROWSPAN=2><A HREF="http://www.canon-sales.co.jp/Product/LBP/LBP-2030.html">LBP-2030</A></TH><TD>lips4</TD><TD>300x300, 600x600</TD><TD>$B%+%i!<=PNO$O(B -dBitsPerPixel=24 $B%*%W%7%g%s$G!#(B($B$3$N%I%i%$%P$G$OHs>o$KCY$$$G$9!#(B)</TD>
- </TR>
- <TR>
- <TD>lips4v</TD><TD>300x300, 600x600</TD><TD>$B%+%i!<=PNO$O(B -dBitsPerPixel=24 $B%*%W%7%g%s$G!#(BMaxiMem $BHsBP1~$J$N$G(B<A HREF="#clipping">$B%Q%9%/%j%C%T%s%0;~$N%a%b%jITB-(B</A>$B$KCm0U(B</TD>
- </TR>
- <TR>
- <TH ROWSPAN=2><A HREF="http://www.canon-sales.co.jp/Product/LBP/LBP-2160.html">LBP-2160</A></TH><TD>lips4</TD><TD>300x300, 600x600</TD><TD>$B%+%i!<=PNO$O(B -dBitsPerPixel=24 $B%*%W%7%g%s$G!#(B($B$3$N%I%i%$%P$G$OHs>o$KCY$$$G$9!#(B)</TD>
- </TR>
- <TR>
- <TD>lips4v</TD><TD>300x300, 600x600</TD><TD>$B%+%i!<=PNO$O(B -dBitsPerPixel=24 $B%*%W%7%g%s$G!#(B</TD>
- </TR>
- <TR>
- <TH ROWSPAN=2><A HREF="http://www.canon-sales.co.jp/Product/LBP/LBP-2040.html">LBP-2040</A></TH><TD>lips4</TD><TD>300x300, 600x600</TD><TD>$B%+%i!<=PNO$O(B -dBitsPerPixel=24 $B%*%W%7%g%s$G!#(B($B$3$N%I%i%$%P$G$OHs>o$KCY$$$G$9!#(B)</TD>
- </TR>
- <TR>
- <TD>lips4v</TD><TD>300x300, 600x600</TD><TD>$B%+%i!<=PNO$O(B -dBitsPerPixel=24 $B%*%W%7%g%s$G!#(B</TD>
- </TR>
- <TR>
- <TH><A HREF="http://www.canon-sales.co.jp/faq/bj/980026/bjc880j.html">BJC-880J</A></TH>
- <TD>bjc880j</TD><TD>360x360</TD><TD>$B%+%i!<=PNO$O(B -dBitsPerPixel=24 $B%*%W%7%g%s$G!#(B($BHs>o$KCY$$$G$9!#(B)</TD>
- </TR>
- <TR>
- <TH><A HREF="http://www.canon-sales.co.jp/faq/bj/980026/bjc680j.html">BJC-680J</A></TH>
- <TD>bjc880j</TD><TD>360x360</TD><TD>$B%+%i!<=PNO$O(B -dBitsPerPixel=24 $B%*%W%7%g%s$G!#(B($BHs>o$KCY$$$G$9!#(B)</TD>
- </TR>
-</TABLE>
-<HR>
-<H2><A HREF="#i_lp_list" NAME="lp_list">ESC/Page $BBP1~%W%j%s%?$H=PNO%G%P%$%9(B</A></H2>
-<P>
-ESC/Page $BBP1~%W%j%s%?$H=PNO%G%P%$%9L>(B/$B2rA|EY$N%j%9%H$G$9!#(B
-$B$3$l$O!"$"$/$^$G$b5,3J>e=PNO$G$-$k$b$N$r%j%9%H$7$?$@$1$G!"A4$F$N%W%j%s%?$G<B:]$K=PNO$G$-$k$3$H$r3NG'$7$?$o$1$G$O$J$$$N$GCm0U$7$F2<$5$$!#(B
-</P>
-<TABLE BORDER SUMMARY="ESC/Page Priner and Output Device">
- <TR>
- <TH>$B5!<o(B</TH><TH>$B%G%P%$%9L>(B</TH><TH>$B2rA|EY(B (dpi)</TH><TH>$BHw9M(B</TH>
- </TR>
- <TR>
- <TD>LP-7000</TD><TD>lp2000</TD><TD>240x240</TD>
- </TR>
- <TR>
- <TD>LP-7000G</TD><TD>lp2000</TD><TD>240x240</TD>
- </TR>
- <TR>
- <TD>LP-2000</TD><TD>lp2000</TD><TD>300x300</TD>
- </TR>
- <TR>
- <TD>LP-3000</TD><TD>lp2000</TD><TD>300x300</TD>
- </TR>
- <TR>
- <TD>LP-1500</TD><TD>escpage</TD><TD>300x300</TD>
- </TR>
- <TR>
- <TD>LP-1500S</TD><TD>escpage</TD><TD>300x300</TD>
- </TR>
- <TR>
- <TD>LP-8000</TD><TD>escpage</TD><TD>300x300</TD>
- </TR>
- <TR>
- <TD>LP-8000S</TD><TD>escpage</TD><TD>300x300</TD>
- </TR>
- <TR>
- <TD>LP-8000SE</TD><TD>escpage</TD><TD>300x300</TD>
- </TR>
- <TR>
- <TD>LP-8000SX</TD><TD>escpage</TD><TD>300x300</TD>
- </TR>
- <TR>
- <TD>LP-1000</TD><TD>escpage</TD><TD>300x300</TD>
- </TR>
- <TR>
- <TD>LP-1600</TD><TD>escpage</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD>LP-1700</TD><TD>escpage</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD>LP-1700S</TD><TD>escpage</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD><A HREF="http://www.i-love-epson.co.jp/products/seihin/printer/laser/esper/lp1800.htm">LP-1800</A></TD><TD>escpage</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD><A HREF="http://www.i-love-epson.co.jp/products/seihin/printer/laser/prospert/lp800.htm">LP-800</A></TD><TD>escpage</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD>LP-8200</TD><TD>escpage</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD><A HREF="http://www.i-love-epson.co.jp/products/seihin/printer/laser/esper/lp8300.htm">LP-8300</A></TD><TD>escpage</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD>LP-8300S</TD><TD>escpage</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD><A HREF="http://www.i-love-epson.co.jp/products/seihin/printer/laser/esper/lp8400.htm">LP-8400</A></TD><TD>escpage</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD>LP-8500</TD><TD>escpage</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD><A HREF="http://www.i-love-epson.co.jp/products/seihin/printer/laser/esper/lp8600.htm">LP-8600</A></TD><TD>escpage</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD>LP-9000</TD><TD>escpage</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD>LP-9200</TD><TD>escpage</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD>LP-9200S</TD><TD>escpage</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD><A HREF="http://www.i-love-epson.co.jp/products/seihin/printer/laser/esper/lp92sx.htm">LP-9200SX</A></TD><TD>escpage</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD><A HREF="http://www.i-love-epson.co.jp/products/seihin/printer/laser/inter/lp9300.htm">LP-9300</A></TD><TD>escpage</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD><A HREF="http://www.i-love-epson.co.jp/products/seihin/printer/laser/inter/lp9600.htm">LP-9600</A></TD><TD>escpage</TD><TD>300x300, 600x600</TD>
- </TR>
- <TR>
- <TD>LP-8000C</TD><TD>escpage</TD><TD>300x300, 600x600</TD><TD>$B%+%i!<=PNO$O$G$-$^$;$s(B</TD>
- </TR>
-</TABLE>
-<HR>
-<H2><A HREF="#i_mw_list" NAME="mw_list">NPDL $BBP1~%W%j%s%?$H=PNO%G%P%$%9(B</A></H2>
-<P>
-NPDL $BBP1~%W%j%s%?$H=PNO%G%P%$%9L>(B/$B2rA|EY$N%j%9%H$G$9!#(B
-$B$3$l$O!"$"$/$^$G$b5,3J>e=PNO$G$-$k$b$N$r%j%9%H$7$?$@$1$G!"A4$F$N%W%j%s%?$G<B:]$K=PNO$G$-$k$3$H$r3NG'$7$?$o$1$G$O$J$$$N$GCm0U$7$F2<$5$$!#(B
-</P>
-<TABLE BORDER SUMMARY="NPDL Priner and Output Device">
- <TR>
- <TH>$B5!<o(B</TH><TH>$B%G%P%$%9L>(B</TH><TH>$B2rA|EY(B (dpi)</TH><TH>$BHw9M(B</TH>
- </TR>
- <TR>
- <TD>PC-PR1000</TD><TD>npdl</TD><TD>240x240</TD><TD>$BGr9uH?E>0u:~(B(-dNegativePrint)$B$KHsBP1~(B</TD>
- </TR>
- <TR>
- <TD>PC-PR2000</TD><TD>npdl</TD><TD>240x240</TD><TD>$BGr9uH?E>0u:~(B(-dNegativePrint)$B$KHsBP1~(B</TD>
- </TR>
- <TR>
- <TD>PC-PR1000/2</TD><TD>npdl</TD><TD>240x240</TD><TD>$BGr9uH?E>0u:~(B(-dNegativePrint)$B$KHsBP1~(B</TD>
- </TR>
- <TR>
- <TD>PC-PR2000/2</TD><TD>npdl</TD><TD>240x240</TD>
- </TR>
- <TR>
- <TD>PC-PR2000/4</TD><TD>npdl</TD><TD>400x400</TD>
- </TR>
- <TR>
- <TD>PC-PR4000/4</TD><TD>npdl</TD><TD>400x400</TD>
- </TR>
- <TR>
- <TD>PC-PR3000PS/4F</TD><TD>npdl</TD><TD>400x400</TD><TD>PostScript $B$K$bBP1~(B</TD>
- </TR>
- <TR>
- <TD>PC-PR1000/4</TD><TD>npdl</TD><TD>400x400</TD>
- </TR>
- <TR>
- <TD>PC-PR3000PS/4</TD><TD>npdl</TD><TD>400x400</TD><TD>PostScript $B$K$bBP1~(B</TD>
- </TR>
- <TR>
- <TD>PC-PR4000E/4</TD><TD>npdl</TD><TD>400x400</TD>
- </TR>
- <TR>
- <TD>PC-PR1000E/4R</TD><TD>npdl</TD><TD>400x400</TD>
- </TR>
- <TR>
- <TD>PC-PR1000E/4</TD><TD>npdl</TD><TD>400x400</TD>
- </TR>
- <TR>
- <TD>PC-PR1000FX/4</TD><TD>npdl</TD><TD>400x400</TD>
- </TR>
- <TR>
- <TD>PC-PR2000/4R</TD><TD>npdl</TD><TD>400x400</TD>
- </TR>
- <TR>
- <TD>PC-PR2000/4W</TD><TD>npdl</TD><TD>400x400</TD>
- </TR>
- <TR>
- <TD>PC-PR2000/6W</TD><TD>npdl</TD><TD>600x600</TD>
- </TR>
- <TR>
- <TD>PC-PR1000E/4W</TD><TD>npdl</TD><TD>400x400</TD>
- </TR>
- <TR>
- <TD>MultiWriter 1000EW (PC-PR1000EW)</TD><TD>npdl</TD><TD>400x400</TD>
- </TR>
- <TR>
- <TD>MultiWriter 2000E (PC-PR2000E)</TD><TD>npdl</TD><TD>400x400</TD>
- </TR>
- <TR>
- <TD>MultiWriter 2000FW (PC-PR2000FW)</TD><TD>npdl</TD><TD>600x600</TD>
- </TR>
- <TR>
- <TD>MultiWriter 2000NW (PC-PR2000NW)</TD><TD>npdl</TD><TD>400x400</TD>
- </TR>
- <TR>
- <TD>MultiWriter 2200NW2 (PC-PR2200NW2)</TD><TD>npdl</TD><TD>400x400</TD>
- </TR>
- <TR>
- <TD>MultiWriter 2400 (PC-PR2400)</TD><TD>npdl</TD><TD>400x400</TD>
- </TR>
- <TR>
- <TD>MultiWriter 2000X (PC-PR2000X)</TD><TD>npdl</TD><TD>600x600</TD>
- </TR>
- <TR>
- <TD>MultiWriter 2200X (PC-PR2200X)</TD><TD>npdl</TD><TD>600x600</TD>
- </TR>
- <TR>
- <TD>MultiWriter 2400X (PC-PR2400X)</TD><TD>npdl</TD><TD>400x400</TD>
- </TR>
- <TR>
- <TD>MultiWriter 2200X2 (PR-L2200X2)</TD><TD>npdl</TD><TD>600x600</TD>
- </TR>
- <TR>
- <TD>MultiWriter 2200XE (PR-L2200X2)</TD><TD>npdl</TD><TD>600x600</TD>
- </TR>
- <TR>
- <TD>MultiWriter 2000X2 (PR-L2000X2)</TD><TD>npdl</TD><TD>600x600</TD>
- </TR>
- <TR>
- <TD><A HREF="http://www.pc98.nec.co.jp/PRODUCT/EXT/print/mw2000x/">MultiWriter 1400X (PR-L1400X)</A></TD><TD>npdl</TD><TD>600x600</TD>
- </TR>
- <TR>
- <TD><A HREF="http://www.pc98.nec.co.jp/PRODUCT/EXT/print/mw6050/spec1.htm">MultiWriter 6050 (PC-L6050A)</A></TD><TD>npdl</TD><TD>400x400, 600x600</TD>
- </TR>
- <TR>
- <TD><A HREF="http://www.pc98.nec.co.jp/PRODUCT/EXT/print/mw6050/spec1.htm">MultiWriter 4050 (PR-L4050)</A></TD><TD>npdl</TD><TD>400x400, 600x600</TD>
- </TR>
- <TR>
- <TD><A HREF="http://www.pc98.nec.co.jp/PRODUCT/EXT/print/mw2000x/">MultiWriter 2050 (PR-L2050)</A></TD><TD>npdl</TD><TD>600x600</TD>
- </TR>
- <TR>
- <TD><A HREF="http://www.pc98.nec.co.jp/PRODUCT/EXT/print/mw2000x/">MultiWriter 2250 (PR-L2250)</A></TD><TD>npdl</TD><TD>600x600</TD>
- </TR>
- <TR>
- <TD><A HREF="http://www.pc98.nec.co.jp/PRODUCT/EXT/print/mw2650e/">MultiWriter 2650 (PR-L2650)</A></TD><TD>npdl</TD><TD>600x600</TD>
- </TR>
- <TR>
- <TD><A HREF="http://www.pc98.nec.co.jp/PRODUCT/EXT/print/mw2650e/">MultiWriter 2650E (PR-L2650E)</A></TD><TD>npdl</TD><TD>600x600</TD>
- </TR>
-</TABLE>
-<HR>
-<H2><A HREF="#i_unsupported" NAME="unsupported">$BBP1~$7$F$$$J$$%W%j%s%?(B</A></H2>
-<P>
-$B<!$N%W%j%s%?$O%5%]!<%H$7$F$$$^$;$s!#(B
-</P>
-<UL>
- <LI>LIPS I/LIPS II $B%W%j%s%?(B
- <LI>Windows Printing System (WPS)$B@lMQ%W%j%s%?(B
- <UL>
- <LI><A HREF="http://www.canon-sales.co.jp/faq/lbp/980021/lbp210.html">Canon LBP-210</A>
- <LI><A HREF="http://www.canon-sales.co.jp/faq/lbp/980021/lbp220.html">Canon LBP-220</A>
- <LI>Canon LBP-220Pro
- <LI>NEC MultiWriter 1000LW(PC-PR1000LW)
- <LI>NEC MultiWriter 1100(PR-L1100)
- </UL>
- <LI><A HREF="http://www.canon-sales.co.jp/faq/lbp/980021/lbp310.html">Canon LBP-310</A>/<A HREF="http://www.canon-sales.co.jp/faq/lbp/980021/lbp320.html">LBP-320</A>/LBP-320Pro $B$N%$%a!<%8%b!<%I(B(LIPS III $B$G$O=PNO2DG=(B)
- <LI><A HREF="http://www.canon-sales.co.jp/faq/bj/980026/bjc680j.html">Canon BJC-680J</A>/<A HREF="http://www.canon-sales.co.jp/faq/bj/980026/bjc880j.html">BJC-880J</A> $B0J30$N%$%s%/%8%'%C%H%W%j%s%?(B
- <LI>EPSON LP-5000 ($B8E$9$.(B)
-</UL>
-<HR>
-<H2><A HREF="#i_install" NAME="install">$B%$%s%9%H!<%k(B</A></H2>
-<OL>
- <LI>Ghostscript $B$N%=!<%9%G%#%l%/%H%j$K(B
- gdevespg.c$B!"(B gdevl4r.c$B!"(B gdevl4v.c$B!"(Bgdevlips.c$B!"(Bgdevlips.h$B!"(B gdevlprn.c$B!"(Bgdevlprn.h$B!"(Bgdevnpdl.c $B$r%3%T!<$7$^$9!#(B($BMW$9$k$K(B *.c *.h $B$r%3%T!<$7$^$9!#(B)
-<PRE>
- $BNc(B:
- cp *.c *.h "Ghostscript $B$N%G%#%l%/%H%j(B"
-</PRE>
- <LI>Ghostscript 5.50 $B$N>l9g$O(B gdevlips.mak $B$r(B contrib.mak $B$KDI2C$7$^$9!#(B
-<PRE>
- $BNc(B:
- cat gdevlips.mak &gt;&gt;contrib.mak
-</PRE>
- <LI>Ghostscript 5.10 $B$N>l9g$O(B gdevlips.mak $B$r(B Makefile $B$KDI2C$7$^$9!#(B
-<PRE>
- $BNc(B:
- cat gdevlips.mak &gt;&gt;makefile
-</PRE>
- <LI>Makefile $B$N(B DEVICE_DEVS $B$K(B<A HREF="#dev">$B%G%P%$%9$H$=$N5!G=(B</A>$B$K=R$Y$i$l$k$N%G%P%$%9$N$&$AI,MW$J$b$N$r5-=R$7$^$9!#(B
- <LI>B4$B!"(BB5$B!"(BB6 $B%5%$%:$J$I$NMQ;f$r07$&>l9g$O(B gs_statd.ps $B$K%Q%C%A$r$"$F$^$9!#(B
-<PRE>
- $BNc(B:
- patch &lt;gs_statd.dif
-</PRE>
- <LI>Ghostscript $B$r%3%s%Q%$%k$7!"%$%s%9%H!<%k$7$^$9!#(B
-</OL>
-<HR>
-<H3><A NAME="dev">$B%G%P%$%9$H$=$N5!G=(B</A></H3>
-<H4>$B%i%9%?!<HG%I%i%$%P(B</H4>
-<DL>
- <DT>lips2p.dev</DT>
- <DD>LIPS II+ $B$N%3!<%I$r=PNO$7$^$9!#(B</DD>
- <DT>lips3.dev</DT>
- <DD>LIPS III $B$N%3!<%I$r=PNO$7$^$9!#(B</DD>
- <DT>bjc880j.dev</DT>
- <DD>LIPS IVc (BJC-680J/880J $BMQ(B)$B$N%3!<%I$r=PNO$7$^$9!#%+%i!<=PNO$K$bBP1~$7$F$$$^$9!#(B</DD>
- <DT>lips4.dev</DT>
- <DD>LIPS IV $B$N%3!<%I$r=PNO$7$^$9!#%+%i!<=PNO$K$bBP1~$7$F$$$^$9!#(B</DD>
- <DT>lp2000.dev</DT>
- <DD>ESC/Page $B$N%3!<%I$r=PNO$7$^$9!#(B(LP-2000/LP-3000/LP-7000/LP-7000G $BMQ$G$9!#(B)</DD>
- <DT>escpage.dev</DT>
- <DD>ESC/Page $B$N%3!<%I$r=PNO$7$^$9!#BP1~5!<o$O(B<A HREF="#lp_list">ESC/Page $BBP1~%W%j%s%?$H=PNO%G%P%$%9(B</A>$B$r;2>H$N$3$H!#(B</DD>
- <DT>npdl.dev</DT>
- <DD>NPDL $B$N%3!<%I$r=PNO$7$^$9!#BP1~5!<o$O(B<A HREF="#mw_list">NPDL $BBP1~%W%j%s%?$H=PNO%G%P%$%9(B</A>$B$r;2>H$N$3$H!#(B</DD>
-</DL>
-<H4>$B%Y%/%?!<HG%I%i%$%P(B</H4>
-<DL>
- <DT>lips4v.dev</DT>
- <DD>LIPS IV $B$N%3!<%I$r=PNO$7$^$9!#%+%i!<=PNO$K$bBP1~$7$F$$$^$9!#(B</DD>
-</DL>
-<HR>
-<H2><A HREF="#i_usage" NAME="usage">$B;HMQJ}K!(B/$B;HMQ%*%W%7%g%s(B</A></H2>
-<P>
-$B0J2<$K$+$+$l$F$$$k%*%W%7%g%s$O(B PostScript $B%U%!%$%k$NCf$N%*%Z%l!<%?$G$bJQ99$5$l$k$3$H$,$"$j$^$9!#(B
-lpd $B$N%U%#%k%?!<$H$7$F;H$&>l9g$O$3$NCf$G(B <A HREF="#device">-sDEVICE</A>$B!"(B
-<A HREF="#resolution">-r</A> $B$N$_$r;XDj$9$k$H$h$$$G$7$g$&!#(B
-</P>
-<H3>LIPS$B!&(BESC/Page$B!&(BNPDL $B%I%i%$%P6&DL%*%W%7%g%s(B</H3>
-<DL>
- <DT><A HREF="#device">-sDEVICE</A></DT>
- <DD>$B=PNO$9$k%G%P%$%9$NJQ99$K;HMQ$7$^$9!#(B<EM>$B:GDc8B$3$l$@$1$O;XDj$7$F2<$5$$!#(B</EM></DD>
- <DT><A HREF="#pagesize">-sPAPERSIZE</A></DT>
- <DD>$B=PNO$9$kMQ;f%5%$%:$NJQ99$K;HMQ$7$^$9(B</DD>
- <DT><A HREF="#numcopies">-dNumCopies</A></DT>
- <DD>$B0u:~It?t$r;XDj$9$k>l9g$K;HMQ$7$^$9(B</DD>
- <DT><A HREF="#resolution">-r</A></DT>
- <DD>$B2rA|EY$r;XDj$9$k>l9g$K;HMQ$7$^$9(B</DD>
- <DT><A HREF="#duplex">-dDuplex</A></DT>
- <DD>$BN>LL0u:~$9$k>l9g$K;HMQ$7$^$9(B</DD>
- <DT><A HREF="#tumble">-dTumble</A></DT>
- <DD>$BN>LL0u:~$9$k>l9g$K$H$8J}8~$rJQ99$9$k>l9g$K;HMQ$7$^$9(B</DD>
- <DT><A HREF="#negativeprint">-dNegativePrint</A></DT>
- <DD>$BGr9uH?E>0u:~$,$G$-$^$9!#(B</DD>
-</DL>
-<H3>ESC/Page $B%I%i%$%P$N$_$N%*%W%7%g%s(B</H3>
-<DL>
- <DT><A HREF="#ritoff">-dRITOff</A></DT>
- <DD>RIT ($BNX3TJd@55!G=(B)$B$r%*%U$K$9$k>l9g$K;HMQ$7$^$9(B</DD>
-</DL>
-<H3>LIPS $B%I%i%$%P$N$_$N%*%W%7%g%s(B</H3>
-<DL>
- <DT><A HREF="#bitsperpixel">-dBitsPerPixel</A><DT>
- <DD>LIPS IV $B$K$*$$$F%b%N%/%m$H%+%i!<=PNO$r@ZBX$($k$?$a$K;HMQ$7$^$9(B</DD>
- <DT><A HREF="#manualfeed">-dManualFeed</A></DT>
- <DD>$B5k;f%H%l%$$+$i5k;f$9$k>l9g$K;HMQ$7$^$9(B</DD>
- <DT><A HREF="#casset">-dCasset</A></DT>
- <DD>$B5k;f$9$k%H%l%$(B/$B%+%;%C%H$r;XDj$9$k>l9g$K;HMQ$7$^$9(B</DD>
- <DT><A HREF="#panel">-sUserName</A></DT>
- <DD>$B%W%j%s%?$N%Q%M%k$KI=<($9$kJ8;z$rJQ99$9$k>l9g$K;HMQ$7$^$9(B</DD>
- <DT><A HREF="#mediatype">-sMediaType</A></DT>
- <DD>LBP-2160 (LBP-2040 $B$b(B?)$B$G=PNO$9$kMQ;f$N<oN`$r;XDj$9$k$?$a$K;HMQ$7$^$9!#(B
- <DT><A HREF="#faceup">-dOutputFaceUp</A></DT>
- <DD>LBP-2160 (LBP-2040 $B$b(B?)$B$G%U%'%$%9%"%C%W%H%l%$$K=PNO$9$k$?$a$K;HMQ$7$^$9!#(B
- <DT><A HREF="#nup">-dNup</A></DT>
- <DD>N $BLL0u:~$r$9$k>l9g$K;HMQ$7$^$9(B</DD>
- <DT><A HREF="#pjl">-dPJL</A></DT>
- <DD>PJL $B$r=PNO$9$k>l9g$K;HMQ$7$^$9(B</DD>
- <DT><A HREF="#tdensity">-dTonerDensity</A></DT>
- <DD>$B%H%J!<G;EYD4@a$r$9$k>l9g$K(B -dPJL $B$H$H$b$K;HMQ$7$^$9(B</DD>
- <DT><A HREF="#tsave">-dTonerSaving</A></DT>
- <DD>$B%H%J!<@aLs$r$9$k>l9g$K(B -dPJL $B$H$H$b$K;HMQ$7$^$9(B</DD>
-</DL>
-<HR>
-<H3>LIPS$B!&(BESC/Page$B!&(BNPDL $B%I%i%$%P6&DL%*%W%7%g%s(B</H3>
-<H4><A HREF="#i_device" NAME="device">$B%G%P%$%9JQ99(B</A></H4>
-<P>
-$B$3$N%I%i%$%P$r;HMQ$9$k$?$a$K$O(B -sDEVICE $B%*%W%7%g%s$G%G%P%$%9$rJQ99$9$kI,MW$,$"$j$^$9!#$=$l$>$l<!$N$h$&$K;XDj$7$^$9!#(B
-</P>
-<DL>
- <DT>-sDEVICE=lips2p</DT>
- <DD>lips2p $B%G%P%$%9$r;HMQ$7$^$9(B</DD>
- <DT>-sDEVICE=lips3</DT>
- <DD>lips3 $B%G%P%$%9$r;HMQ$7$^$9(B</DD>
- <DT>-sDEVICE=bjc880j</DT>
- <DD>bjc880j $B%G%P%$%9$r;HMQ$7$^$9(B</DD>
- <DT>-sDEVICE=lips4</DT>
- <DD>lips4 $B%G%P%$%9$r;HMQ$7$^$9(B</DD>
- <DT>-sDEVICE=lips4v</DT>
- <DD>lips4v $B%G%P%$%9$r;HMQ$7$^$9(B</DD>
- <DT>-sDEVICE=lp2000</DT>
- <DD>lp2000 $B%G%P%$%9$r;HMQ$7$^$9(B</DD>
- <DT>-sDEVICE=escpage</DT>
- <DD>escpage $B%G%P%$%9$r;HMQ$7$^$9(B</DD>
- <DT>-sDEVICE=npdl</DT>
- <DD>npdl $B%G%P%$%9$r;HMQ$7$^$9(B</DD>
-</DL>
-<HR>
-<H4><A HREF="#i_pagesize" NAME="pagesize">$B%G%U%)%k%HMQ;f%5%$%:JQ99(B($B%G%U%)%k%H(B:A4$B%5%$%:(B)</A></H4>
-<P>
-$B$3$N%I%i%$%P$G$O(B-sPAPERSIZE$B%*%W%7%g%s$+(Bsetpagedevice$B%*%Z%l!<%?$K$h$C$F(B
-$B;XDj$7$?%5%$%:$r(B<EM>$BMQ;fJ}8~$b4^$a$F(B</EM>$B@5$7$/07$&$3$H$,$G$-$^$9!#(B
-$B$?$@$7!"5!<o$K$h$C$FBP1~$9$kMQ;f%5%$%:$K@)8B$,$"$j$^$9$N$G$I$NMQ;f%5%$%:$,;H$($k$+$O;HMQ$7$F$$$k%W%j%s%?$N@bL@=q$r;2>H$7$F2<$5$$!#(B($BNc$($P!"(BA4 $B5!$G$"$k(B LBP-450 $B$G$O(B A3 $B$NMQ;f$G$O=PNO$G$-$^$;$s$7!"(BLBP-2160 $B$G$O41@=$O$,$-$K$OBP1~$7$F$$$^$;$s!#(B)
-</P>
-<P>
-$B$^$?!"(B<KBD>-sPAPERSIZE</KBD> $B%*%W%7%g%s$O%G%U%)%k%H$NMQ;f%5%$%:$rJQ99$9$k$@$1$G$9!#(B
-$BMQ;f%5%$%:$r8GDj$7$?$$>l9g$O(B <KBD>-dFIXEDMEDIA</KBD> $B%*%W%7%g%s$H$H$b$KMQ$$$F2<$5$$!#(B
-</P>
-<P>
-$B<!$N%*%W%7%g%s$,;XDj$5$l$?$H$-$9$Y$F$N%I%i%$%P$G(B
-$B%W%j%s%?$K@5$7$/MQ;f%5%$%:$N>pJs$,Aw$i$l$^$9!#(B
-($B$?$@$7!"(BB $B%5%$%:$H41@=$O$,$-$OIUB0$N%Q%C%A$r$"$F$k$3$H(B)
-</P>
-<DL>
- <DT><KBD>-sPAPERSIZE=a3</KBD></DT><DD>A3</DD>
- <DT><KBD>-sPAPERSIZE=a4</KBD></DT><DD>A4</DD>
- <DT><KBD>-sPAPERSIZE=a5</KBD></DT><DD>A5</DD>
- <DT><KBD>-sPAPERSIZE=b4</KBD></DT><DD>B4</DD>
- <DT><KBD>-sPAPERSIZE=b5</KBD></DT><DD>B5</DD>
- <DT><KBD>-sPAPERSIZE=letter</KBD></DT><DD>$B%l%?!<(B</DD>
- <DT><KBD>-sPAPERSIZE=postcard</KBD></DT><DD>$B41@=$O$,$-(B</DD>
-</DL>
-<P>
-LIPS $B$H(B ESC/Page $B$N%I%i%$%P$G$O<!$N%5%$%:$K$bBP1~$7$F$$$^$9!#(B
-</P>
-<DL>
- <DT><KBD>-sPAPERSIZE=legal</KBD></DT><DD>$B%j!<%,%k(B</DD>
- <DT><KBD>-sPAPERSIZE=ledger</KBD></DT><DD>$B%l%8%c!<(B</DD>
- <DT><KBD>-sPAPERSIZE=b6</KBD></DT><DD>B6</DD>
-</DL>
-<P>
-LIPS $B$N%I%i%$%P$N$_<!$N%5%$%:$KBP1~$7$F$$$^$9!#(B
-</P>
-<DL>
- <DT><KBD>-sPAPERSIZE=envyou4</KBD></DT><DD>$BMN7A(B4$B9f(B($BIuE{(B)</DD>
-</DL>
-<P>
-$BG$0U$NMQ;f%5%$%:$O<!$N$h$&$K$7$F;XDj$7$^$9!#(B
-</P>
-<DL>
- <DT><KBD>-g</KBD><VAR>number1</VAR><KBD>x</KBD><VAR>number2</VAR></DT>
- <DD><KBD>-dDEVICEWIDTH=</KBD><VAR>number1</VAR> $B$H(B<KBD>-dDEVICEHEIGHT=</KBD><VAR>number2</VAR>
- $B$r;XDj$7$?>l9g$b0UL#$OF1$8$G$9!#(B
- $B$=$l$>$l%T%/%;%kC10L$GMQ;f$NI}(B(<VAR>number1</VAR>)$B$H(B
- $B9b$5(B(<VAR>number2</VAR>)$B$r;XDj$7$F2<$5$$!#(B</DD>
-</DL>
-<P>
-LIPS $B%I%i%$%P$K4X$7$F$O41@=$O$,$-%5%$%:$h$j>.$5$$%5%$%:$d(B A3 $B%5%$%:$h$j(B
-$BBg$-$J%5%$%:$O(B LIPS $B$N5,3J>e0u:~$G$-$J$$$3$H$K$J$C$F$$$k$N$G!"(B
-$B$=$N$h$&$J%5%$%:$,;XDj$5$l$?>l9g$O=hM}$r9T$J$$$^$;$s!#(B($B%(%i!<$K$J$j$^$9(B)
-</P>
-<HR>
-<H4><A HREF="#i_numcopies" NAME="numcopies">$BJ#?tIt0u:~(B($B%G%U%)%k%H(B:1$BIt(B)</A></H4>
-<P>
-$B$3$N%I%i%$%P$G$OJ#?tIt0u:~$K$*$$$F%W%j%s%?$N%3%T!<%b!<%I$r;HMQ$7!"9bB.$K0u:~$5$l$^$9!#(B
-</P>
-<P>
-$B%3%^%s%I%i%$%s$G$O!"(B<KBD>-dNumCopies=</KBD><VAR>number</VAR>$B$H$7$F(B
-$B0u:~It?t(B<VAR>number</VAR>$B$r;XDj$7$F2<$5$$!#(B<VAR>number</VAR>$B$N:GBgCM$O(B
-$B<!$N$h$&$K$J$C$F$$$^$9!#$3$l0J>e$NCM$r;XDj$7$F$b:GBgCM$NIt?t$7$+0u:~$5$l$^$;$s!#(B
-</P>
-<DL>
- <DT>LIPS$B!"(BESC/Page $B%W%j%s%?(B</DT><DD>255</DD>
- <DT>NPDL $B%W%j%s%?(B</DT><DD>99</DD>
-</DL>
-<HR>
-<H4><A HREF="#i_resolution" NAME="resolution">$B2rA|EYJQ99(B($B%G%U%)%k%H$O2<5-(B)</A></H4>
-<P>
-<KBD>-r</KBD><VAR>$B2rA|EY(B</VAR> $B%*%W%7%g%s$G2rA|EY$rJQ99$9$k$3$H$,$G$-$^$9!#(B
-</P>
-<DL>
-<DT>lips2p</DT><DD>240</DD>
-<DT>lips3</DT><DD>300</DD>
-<DT>bjc880j</DT><DD>60$B!A(B360 ($B%G%U%)%k%H(B 360 dpi)</DD>
-<DT>lips4</DT><DD>60$B!A(B600$B!"(B1200 ($B%G%U%)%k%H(B 600 dpi)</DD>
-<DT>lips4v</DT><DD>60$B!A(B600$B!"(B1200 ($B%G%U%)%k%H(B 600 dpi)</DD>
-<DT>lp2000</DT><DD>60$B!A(B300 ($B%G%U%)%k%H(B 300 dpi)</DD>
-<DT>escpage</DT><DD>60$B!A(B600 ($B%G%U%)%k%H(B 300 dpi)</DD>
-<DT>npdl</DT><DD>160$B!"(B200$B!"(B240$B!"(B400$B!"(B600 ($B%G%U%)%k%H(B 240 dpi)</DD>
-</DL>
-<P>
-LIPS IV $B$G(B $B9b2rA|EY(B (600 dpi$B!"(B1200 dpi) $B0u;z$r9T$J$&>l9g$O(B <A HREF="#hireso">LIPS IV $B=PNO$K$*$1$k9b2rA|EY0u;z$K4X$9$kCm0U(B</A>$B$rFI$s$G2<$5$$!#(B
-$B$b$7FbB"%a%b%j$,B-$j$J$$$h$&$G$7$?$i(B -r300 $B$H$7$F(B 300 dpi $B$G0u:~$9$k$3$H$r(B
-$B$*$9$9$a$7$^$9!#(B
-</P>
-<P>
-[$BHw9M(B]$B8=:_(B(1999$BG/(B4$B7n(B15$BF|(B)$B$N$H$3$m!"(BLIPS IV $B$G(B
-1200 dpi $B$G=PNO2DG=$J%W%j%s%?$O(B LBP-840/LBP-850 $B$7$+H/Gd$5$l$F$$$^$;$s!#(B
-</P>
-<HR>
-<H4><A HREF="#i_duplex" NAME="duplex">$BN>LL0u:~(B($B%G%U%)%k%H(B:$B%Q%M%k@_Dj(B)</A></H4>
-<P>
-$B%W%j%s%?$NCf$K$ON>LL0u:~%f%K%C%H$rAuHw$G$-$k$b$N$,$"$j$^$9$,!"(B
-$B$=$N5!G=$,;H$($^$9!#$H$8J}$O(B2$B<oN`A*Br$G$-$^$9!#(B
-$B$3$N5!G=$K4X78$9$k$N$O(B Duplex $B$H(B Tumble $B$G$9!#(B
-</P>
-<P>
-Ghostscript $B$N%*%W%7%g%s$H$7$FN>LL0u:~$r;XDj$9$k>l9g$K$O<!$N$h$&$J(B
-$B%*%W%7%g%s$r;H$C$F2<$5$$!#(B
-</P>
-<UL>
- <LI><KBD>-dDuplex</KBD>
-</UL>
-<P>
-$B$^$?!"JRLL0u:~$r;XDj$9$k>l9g$K$O<!$N$h$&$J%*%W%7%g%s$r;H$C$F2<$5$$!#(B
-<EM>$B8=:_$N$H$3$m(B NPDL $B%I%i%$%P$OJRLL0u:~$K$OBP1~$7$F$$$^$;$s!#(B</EM>
-</P>
-<UL>
- <LI><KBD>-dDuplex=false</KBD>
-</UL>
-<H5><A NAME="tumble">$B$H$8J}8~(B ($B%G%U%)%k%H(B: $BD9JU$H$8(B)</A></H5>
-<P>
-$BN>LL0u:~$r$9$k$H$-$H$8J}8~$rD9JU$H$8$+C;JU$H$8$r;XDj$G$-$^$9!#(B
-$B%G%U%)%k%H$G$OD9JU$H$8$G$9!#C;JU$H$8$r;XDj$9$k>l9g$K$O<!$N$h$&$J(B
-$B%*%W%7%g%s$r;H$C$F2<$5$$!#(B
-$BJRLL0u:~;~$K$3$N%*%W%7%g%s$r;XDj$7$F$b0UL#$O$"$j$^$;$s!#(B
-<EM>$B8=:_$N$H$3$m(B NPDL $B%I%i%$%P$OC;JU$H$8$K$OBP1~$7$F$$$^$;$s!#(B</EM>
-</P>
-<UL>
- <LI><KBD>-dTumble</KBD>
-</UL>
-<HR>
-<H4><A HREF="#i_negativeprint" NAME="negativeprint">$BGr9uH?E>0u:~(B ($B%G%U%)%k%H(B: $BH?E>$7$J$$(B)</A></H4>
-<P>
-lips4.dev($B%b%N%/%m$N$_(B)$B!"(Blp2000.dev$B!"(Bescpage.dev$B!"(Bnpdl.dev(NPDL (level2)$BBP1~5!<o$N$_(B) $B$K8B$j<!$N%*%W%7%g%s$rF~NO$9$k$3$H$GGr9u$rH?E>$5$;$k$3$H$,$G$-$^$9!#(B
-</P>
-<UL>
- <LI>-dNegativePrint
-</UL>
-<HR>
-<H3>ESC/Page $B%I%i%$%P$N$_BP1~$N%*%W%7%g%s(B</H3>
-<H4><A HREF="#i_ritoff" NAME="ritoff">RIT ($BNX3TJd@55!G=(B)$B$r%*%U$K$9$k(B ($B%G%U%)%k%H(B: RIT $B$r;H$&(B)</A></H4>
-<P>
-escpage.dev $B$K8B$j<!$N%*%W%7%g%s$r;H$&$3$H$K$h$j(B RIT (Resolution Improvement Technology$B!"NX3TJd@55!G=(B)$B$r%*%U$K$9$k$3$H$,$G$-$^$9!#(B
-</P>
-<P>
-$BDL>o$O(B RIT $B$O%*%s$N$^$^;H$($P$h$$$G$9$,!"%Q%?!<%sEI$j$D$V$7$J$N$G0U?^$7$?0u:~7k2L$H0c$&$b$N$,=PNO$5$l$k>l9g$O$3$N5!G=$r;H$C$F(B RIT $B$r%*%U$K$7$F$/$@$5$$!#(B
-</P>
-<UL>
- <LI>-dRITOff
-</UL>
-<HR>
-<H3>LIPS $B%I%i%$%P$N$_BP1~$N%*%W%7%g%s(B</H3>
-<H4><A HREF="#i_bitsperpixel" NAME="bitsperpixel">$B%b%N%/%m$H%+%i!<=PNO$N@ZBX$((B($B%G%U%)%k%H(B:$B%b%N%/%m(B)</A></H4>
-<P>
-<EM>$B$3$N%*%W%7%g%s$O(B bjc880j$B!"(Blips4$B!"(Blips4v $B$N$_BP1~$7$F$$$^$9!#(B</EM>
-</P>
-<P>
-<KBD>-dBitsPerPixel=</KBD><VAR>number</VAR>$B%*%W%7%g%s$K$h$j%b%N%/%m$H(B
-$B%+%i!<=PNO$N@ZBX$($,$G$-$^$9!#(B
-</P>
-<H5>bjc880j$B!"(Blips4</H5>
-<DL>
-<DT>-dBitsPerPixel=1</DT><DD>$B%b%N%/%m=PNO(B ($B%G%U%)%k%H(B)</DD>
-<DT>-dBitsPerPixel=24</DT><DD>$B%+%i!<=PNO(B</DD>
-</DL>
-<H5>lips4v</H5>
-<DL>
-<DT>-dBitsPerPixel=8</DT><DD>$B%b%N%/%m=PNO(B ($B%G%U%)%k%H(B)</DD>
-<DT>-dBitsPerPixel=24</DT><DD>$B%+%i!<=PNO(B</DD>
-</DL>
-<HR>
-<H4><A HREF="#i_feed" NAME="feed">$B5k;fJ}K!$NA*Br(B($B%G%U%)%k%H(B:$B<+F0A*Br(B)</A></H4>
-<P>
-<EM>$B$3$N%*%W%7%g%s$O(B LIPS $B$N%G%P%$%9$N$_BP1~$7$F$$$^$9!#(B</EM>
-</P>
-<P>
--dManualFeed$B%*%W%7%g%s$K$h$k(BMP$B%H%l%$(B($B5k;f%H%l%$(B)$B$+$i$N5k;f$H(B
--dCasset$B%*%W%7%g%s$K$h$k5k;f%+%;%C%H$NA*Br$KBP1~$7$^$7$?!#(B
-$B%G%U%)%k%H$G$N5k;f$O<+F0A*Br$K$J$j$^$9!#$^$?!"(B-dManualFeed$B%*%W%7%g%s$G$N(B
-$B;XDj$O(B-dCasset$B$K$h$k;XDj$h$j$bM%@h$9$k$3$H$KCm0U$7$F2<$5$$!#(B
-</P>
-<H5><A NAME="manualfeed">MP$B%H%l%$(B($B5k;f%H%l%$(B)$B$+$i$N5k;f(B</A></H5>
-<P>
-$B<!$N$h$&$J%*%W%7%g%s$r;XDj$9$k$3$H$G(BMP$B%H%l%$(B($B5k;f%H%l%$(B)$B$+$i(B
-$B5k;f$G$-$^$9!#(B
-</P>
-<UL>
- <LI><KBD>-dManualFeed</KBD>
-</UL>
-<H5><A NAME="casset">$B5k;f%+%;%C%H$NA*Br(B</A></H5>
-<P>
-<EM>$B$3$N%*%W%7%g%s$O(B LIPS $B$N%G%P%$%9$N$_BP1~$7$F$$$^$9!#(B</EM>
-</P>
-<P>
-<KBD>-dCasset=</KBD><VAR>number</VAR>$B%*%W%7%g%s$^$?$O(B<KBD>-DCasset=</KBD>
-<VAR>number</VAR>$B$K$h$j5k;f%+%;%C%H$r(B
-$BA*Br$G$-$^$9!#(B
-<VAR>number</VAR>$B$N;XDj$O<!$N$h$&$K$J$j$^$9!#$3$l$i0J30$N?tCM$r;XDj$9$k$H(B
-$B%(%i!<$K$J$j$^$9!#(B
-</P>
-<DL>
- <DT>-1</DT><DD>$B5k;f%+%;%C%H$NA*Br$r$9$k%3%^%s%I$r=PNO$7$J$$(B</DD>
- <DT>0</DT><DD>$B<+F05k;f(B</DD>
- <DT>1</DT><DD>$B<j:9$75k;f(B(MP$B%H%l%$(B)</DD>
- <DT>2</DT><DD>$B2<CJ%+%;%C%H5k;f(B</DD>
- <DT>3</DT><DD>$B>eCJ%+%;%C%H5k;f(B</DD>
- <DT>10</DT><DD>MP$B%H%l%$(B($B<j:9$75k;f$KAjEv(B)</DD>
- <DT>11</DT><DD>$B%+%;%C%H(B1</DD>
- <DT>12</DT><DD>$B%+%;%C%H(B2</DD>
- <DT>13</DT><DD>$B%+%;%C%H(B3</DD>
- <DT>14</DT><DD>$B%+%;%C%H(B4</DD>
- <DT>15</DT><DD>$B%+%;%C%H(B5</DD>
- <DT>16</DT><DD>$B%+%;%C%H(B6</DD>
- <DT>17</DT><DD>$B%+%;%C%H(B7</DD>
-</DL>
-<P>
--dCasset=-1 $B$O(B -dCasset=0 $B$G$O<+F05k;f$,F/$+$J$$>l9g$KMQ$$$F2<$5$$!#(B
-($B>/$J$/$H$b(B LBP-A405Jr. $B$G$OMQ$$$kI,MW$,$"$k$h$&$G$9(B)
-</P>
-<P>
-$B%W%m%0%i%^!<%:%^%K%e%"%k(B 4.2 $B$K$h$k$H;Y>c$N$J$$8B$j(B&quot;0&quot;$B$^$?$O(B&quot;10&quot;$B!A(B&quot;17&quot;$B$rMQ$$$F2<$5$$$H$$$&$3$H$J$N$G(B LIPS IV $BEk:\%W%j%s%?$G$O$=$N$h$&$K$7$?$[$&$,$h$$$G$7$g$&!#(B
-</P>
-<HR>
-<H4><A HREF="#i_panel" NAME="panel">$B%Q%M%kI=<(JQ99(B($B%G%U%)%k%H(B:Ghostscript)</A></H4>
-<P>
-<EM>$B$3$N%*%W%7%g%s$O(B LIPS $B$N%G%P%$%9$N$_BP1~$7$F$$$^$9!#(B</EM>
-</P>
-<P>
-$B%W%j%s%?$N%9%F!<%?%9I=<(It$KI=<($9$k%3%a%s%H$r(B-dUserName$B%*%W%7%g%s$r(B
-$BMQ$$$FF0E*$KI=<($9$k$3$H$,$G$-$k$h$&$K$J$j$^$7$?!#$3$l$K$h$C$F(B
-Ghostscript$B$r0u:~$N%U%#%k%?!<$H$7$F;H$C$F$$$k>l9g!"(B
-$B<!$N$h$&$J%$%s%W%C%H%U%#%k%?!<$r;H$&$3$H$K$h$C$F0u:~;~$K%f!<%6L>$r(B
-$B%W%j%s%?$N%9%F!<%?%9I=<(It$KI=<($G$-$k$h$&$K$J$j$^$9!#(B
-<PRE>
-<CODE>#!/bin/sh</CODE>
-
-<CODE><VAR>user</VAR>=/dev/null</CODE>
-
-<CODE>#</CODE>
-<CODE># Get username from filter parameters</CODE>
-<CODE>#</CODE>
-<CODE>while [ <VAR>$#</VAR> != 0 ]</CODE>
-<CODE>do case "<VAR>$1</VAR>" in</CODE>
- <CODE>-n) <VAR>user</VAR>=<VAR>$2</VAR> ; shift ;;</CODE>
- <CODE>*) ;;</CODE>
- <CODE>esac</CODE>
- <CODE>shift</CODE>
-<CODE>done</CODE>
-
-<CODE>gs -q -sDEVICE=lips4 -dSAFER -dNOPAUSE -sUserName=<VAR>$user</VAR> -sOutputFile=- -</CODE>
-
-<CODE>exit 0</CODE>
-</PRE>
-<HR>
-<H4><A HREF="#i_mediatype" NAME="mediatype">$BMQ;f<oN`;XDj(B</A></H4>
-<P>
-<EM>$B$3$N%*%W%7%g%s$O(B LBP-2160 ($B$b$7$+$7$?$i(B LBP-2040$B$b(B?)$B$KBP1~$7$F$$$^$9!#(B</EM>
-</P>
-<P>
-LBP-2160($B$b$7$+$7$?$i!"(BLPB-2040$B$b(B?) $B$G$OIaDL;f!"8|;f!"(BOHP$B!"8wBt%U%#%k%`$KBP1~$7$F$$$^$9$,!"(B
-$BE,@Z$J%3%^%s%I$r=PNO$7$J$$$H%H%J!<$NDjCe$KITET9g$,@8$8$^$9!#(B
-$B<!$N%*%W%7%g%s$rMQ$$$F$=$l$>$l$NMQ;f$K=PNO$7$F$/$@$5$$!#(B
-$B$J$*!"IaDL;f0J30$r;XDj$9$k$H<+F0E*$K5k;f%H%l%$$+$i5k;f$5$l$k$h$&$K$J$j$^$9!#(B
-</P>
-<DL>
- <DT><KBD>-sMediaType=PlanePaper</KBD></DT><DD>$BIaDL;f(B</DD>
- <DT><KBD>-sMediaType=CardBoard</KBD></DT><DD>$B8|;f(B</DD>
- <DT><KBD>-sMediaType=OHP</KBD></DT><DD>OHP</DD>
- <DT><KBD>-sMediaType=TransparencyFilm</KBD></DT><DD>OHP</DD>
- <DT><KBD>-sMediaType=GlossyFilm</KBD></DT><DD>$B8wBt%U%#%k%`(B</DD>
-</DL>
-<HR>
-<H4><A HREF="#i_faceup" NAME="faceup">$B%U%'%$%9%"%C%W%H%l%$$N=PNO(B</A></H4>
-<P>
-<EM>$B$3$N%*%W%7%g%s$O(B LBP-2160 ($B$b$7$+$7$?$i(B LBP-2040$B$b(B?)$B$N$_$KBP1~$7$F$$$^$9!#(B</EM>
-</P>
-<P>
-LPB-2160 $B$G$ODL>o$N%U%'%$%9%@%&%s%H%l%$$NB>$K%U%'%$%9%"%C%W%H%l%$$X$N=PNO$r%5%]!<%H$7$F$$$^$9!#<!$N%*%W%7%g%s$K$h$j%U%'%$%9%"%C%W%H%l%$$K=PNO$9$k$3$H$,$G$-$^$9!#(B
-</P>
-<P>
-$B$b$7$+$7$?$i!"(BLPB-2040 $B$G$b;HMQ$G$-$k$+$b$7$l$^$;$s!#(B
-</P>
-<UL>
- <LI>-dOutputFaceUp
-</UL>
-<HR>
-<H3><A HREF="#i_nup" NAME="nup">n $BLL0u:~(B ($B%G%U%)%k%H(B: $B%Q%M%k@_Dj(B)</A></H3>
-<P>
-<EM>$B$3$N%*%W%7%g%s$O(B LIPS IV $B$N%G%P%$%9$N$_BP1~$7$F$$$^$9!#(B</EM>
-</P>
-<P>
-<EM>[$B7Y9p(B]</EM>$B$3$l$O(B LIPS IV $B$NHs8x3+5!G=$r;H$C$F$$$k$?$a!";HMQ$K$O==J,$KCm0U$7$F2<$5$$!#BP1~$7$F$$$J$$5!<o$b$"$k$+$b$7$l$^$;$s!#(B
-$B$^$?!"(Bpsnup $B$G$&$^$/$$$/(B PostScript $B%U%!%$%k$N>l9g$O!"(Bpsnup $B$r;H$$$^$7$g$&!#(B
-psnup $B$r;H$&$[$&$,(B<EM>$BA4$F$NLL$G(B</EM>$BM%$l$F$$$^$9!#(B
-$B$3$N5!G=$O4pK\E*$K$O(B psnup $B$G$&$^$/$$$+$J$$(B PostScript $B%U%!%$%k$K;H$C$F2<$5$$!#(B
-$B>\$7$/$O(B FAQ $B$N(B<A HREF="#nup_printing">$B!V(B n $BLL0u:~$r$9$k$K$O!"$I$&$7$?$i$$$$$N(B? $B!W(B</A>$B$rFI$s$G2<$5$$!#(B
-$B$^$?!"Ek:\%a%b%jNL$K$h$j!"!V%7%9%F%`%a%b%j(B $B%U%k!W$J$I$N%(%i!<$K$J$k2DG=@-$b$"$k$+$b$7$l$^$;$s!#(B
-</P>
-<P>
-$B<!$N%*%W%7%g%s$r;H$&$3$H$K$h$j!"(Bn $BLL0u:~$,2DG=$G$9!#(B
-</P>
-<DL>
- <DT>-dNup=1</DT>
- <DD>1 $BLL0u:~(B ($B%G%U%)%k%H(B)</DD>
- <DT>-dNup=2</DT>
- <DD>2 $BLL0u:~(B</DD>
- <DT>-dNup=4</DT>
- <DD>4 $BLL0u:~(B</DD>
-</DL>
-<P>
-[$B:n<T$+$i$N=u8@(B]$B$3$N5!G=$G(B 4 $BLL0u:~$r$9$k>l9g!"(B300 dpi $B$H(B 600 dpi $B$N=PNO$KL@$i$+$J:9$O$J$$$N$G!"(B300 dpi $B$K2rA|EY$rMn$9$H$h$jB.$/=PNO$G$-$^$9!#(B2 $BLL0u:~$K$*$$$F$O$3$N8B$j$G$O$"$j$^$;$s!#(B
-1,200 dpi $B$H(B 600 dpi $B$N:9$O$I$&$J$C$F$$$k$+J,$+$j$^$;$s!#(B
-</P>
-<HR>
-<H4><A HREF="#i_fontdl" NAME="fontdl">$B%U%)%s%H%@%&%s%m!<%I(B($B%G%U%)%k%H(B: $B$7$J$$(B)</A></H4>
-<P>
-<EM>$B$3$N%*%W%7%g%s$O(B lips4v $B$N$_BP1~$7$F$$$^$9!#(B</EM>
-</P>
-<P>
-$B%Y%/%?!<HG%G%P%$%9(B lips4v $B$G$O%S%C%H%^%C%W%U%)%s%H$r%@%&%s%m!<%I$9$k$3$H$K$h$j!"F1$8J8;z$,7+$jJV$7$G$F$/$k>l9g!"$h$j9bB.$K0u:~$G$-$k$h$&$K$9$k$3$H$,$G$-$^$9!#FC$K1Q8l$NO@J8$J$I$G$O$3$N8z2L$O@dBg$G$9!#(B
-$B$7$+$7!"(BLIPS IV $B$N@)Ls$K$h$j%/%j%C%T%s%0=hM}$r9T$J$&>l9g!">/$7$G$b%/%j%C%T%s%0NN0hFb$K$"$kJ8;z$O%/%j%C%T%s%0NN0h30$NItJ,$,$"$C$?$H$7$F$b4]!9IA$+$l$F$7$^$&$H$$$&IT6q9g$,$"$j$^$9!#(B
-$B%/%j%C%T%s%0NN0h$r;H$$$3$J$7$??^7A$rIA$/$h$&$J>l9g$O$3$N%*%W%7%g%s$O;H$o$J$$J}$,$h$$$G$9!#(B
-$B$7$+$7$J$,$i!"%/%j%C%T%s%0NN0h$GJ8;z%+%C%H$7$J$,$iIA$/$H$$$&=hM}$O9T$J$o$J$$%f!<%6$NJ}$,B?$$$H;W$$$^$9!#(B
-</P>
-<P>
-$B$^$?!"(B18 point $B0J2<$N%-%c%i%/%?!<$7$+%@%&%s%m!<%I$O9T$J$$$^$;$s!#(B
-</P>
-<P>
-$B<!$N%*%W%7%g%s$r;H$&$3$H$K$h$j!"%U%)%s%H$N%@%&%s%m!<%I$,2DG=$G$9!#(B
-</P>
-<UL>
- <LI><KBD>-dFontDL</KBD>
-</UL>
-<HR>
-<H4><A HREF="#i_pjl" NAME="pjl">PJL $B=PNO(B ($B%G%U%)%k%H(B: $B=PNO$7$J$$(B)</A></H4>
-<P>
-<EM>[$B7Y9p(B]</EM>$B$3$l$OHs8x3+5!G=$r;H$C$F$$$k$?$a!";HMQ$K$O==J,$KCm0U$7$F2<$5$$!#BP1~$7$F$$$J$$5!<o$b$"$j$^$9!#(B
-$B>/$J$/$H$b(B LIPS IV $BEk:\5!<o$G$OA4$F$N%G%P%$%9(B(lips*.dev)$B$G!"(B
-$B$3$N5!G=$,;H$($k$h$&$G$9!#(B
-</P>
-<P>
-$B<!$N%*%W%7%g%s$r;H$&$3$H$K$h$j(B PJL $B$r=PNO$7$^$9!#(B
-PJL $B$r=PNO$9$k$3$H$K$h$j%W%j%s%?$N(B LIPS $B%b!<%I$X$N@ZBX$r@)8f$G$-$^$9!#(B
-$B$7$+$7$J$,$i!"(BLASER SHOT $B$N(B LIPS $B%b!<%I$N<+F0G'<1$O$+$J$jM%=($J$N$GI,$:$7$b(B
-$B$3$N%*%W%7%g%s$r;H$&I,MW$O$"$j$^$;$s!#(B
-</P>
-<UL>
- <LI><KBD>-dPJL</KBD>
-</UL>
-<P>
-$B$^$?!"(BPJL $B$rMQ$$$k$3$H$K$h$j!"(B<A HREF="#tdensity">$B%H%J!<G;EYD4@a5!G=(B</A>$B$d(B<A HREF="#tsave">$B%H%J!<@aLs5!G=(B</A>$B$r(B Ghostscript$B%I%i%$%P$GMQ$$$k$3$H$,$G$-$k$h$&$K$J$j$^$9!#(B
-</P>
-<H5><A HREF="#i_tdensity" NAME="tdensity">$B%H%J!<G;EYD4@a(B ($B%G%U%)%k%H(B: $B%Q%M%k@_Dj(B)</A></H5>
-<P>
-$B<!$N%*%W%7%g%s$r;H$&$3$H$K$h$j!"%H%J!<G;EYD4@a$,2DG=$G$9!#(B
-</P>
-<DL>
- <DT><KBD>-dPJL -dTonerDensity=<VAR>n</VAR></KBD></DT>
- <DD>n $B$O(B 0 $B$+$i(B 8, 0 $B$O%Q%M%k$N@_Dj!#?t;z$,Bg$-$$$[$IG;$/$J$j$^$9!#(B</DD>
-</DL>
-<H5><A HREF="#i_tsave" NAME="tsave">$B%H%J!<@aLs(B ($B%G%U%)%k%H(B: $B%Q%M%k@_Dj(B)</A></H5>
-<P>
-$B<!$N%*%W%7%g%s$r;H$&$3$H$K$h$j!"%H%J!<@aLs$,2DG=$G$9(B
-</P>
-<UL>
- <LI><KBD>-dPJL -dTonerSaving</KBD>
-</UL>
-<P>
-$B5U$K<!$N%*%W%7%g%s$r;H$&$3$H$K$h$j!"%H%J!<@aLs$r(B<EM>$B$7$J$$(B</EM>$B$3$H$,2DG=$G$9(B
-</P>
-<UL>
- <LI><KBD>-dPJL -dTonerSaving=false</KBD>
-</UL>
-<P>
-$B2?$b;XDj$7$J$$>l9g$O%W%j%s%?$N%Q%M%k@_Dj$K=>$$$^$9!#(B
-</P>
-<HR>
-<H4><A HREF="#i_netatalk" NAME="netatalk">Netatalk$B!&(BCAP $B$H(B Ghostscript + gdevlips</A></H4>
-<P>
-Netatalk $B$d(B CAP $B$rMQ$$$F(B Ghostscript + gdevlips $B$rMQ$$$k>l9g!"(B
-$BDL>o(B LaserWriter 8 $B$d(B Adobe PS $B$J$I$N%W%j%s%?%I%i%$%P$r;HMQ$7$^$9$,!"(B
-$B%W%j%s%?5-=R%U%!%$%k(B(PPD $B%U%!%$%k(B)$B$GE,@5$J$b$N$r=q$1$P>e5-$N%*%W%7%g%s$OA4$F(B Macintosh $B$+$i;XDj$G$-$k$h$&$K$J$j$^$9!#(B
-$B$^$??7$?$K%W%j%s%?5-=R%U%!%$%k$r=q$+$J$/$F$b4{B8$N$b$N$rMxMQ$9$l$P$+$J$j$N$3$H$,$G$-$^$9!#(B
-</P>
-<P>
-$B$^$?!"(BGhostscript $B%I%i%$%P$NCf$K$O(B LaserWrite 8 $B$N=PNO$9$k(B Landscape $B$,2sE>$G$-$J$$$b$N$,$"$j$^$9$,!"(B
-$B$3$N%I%i%$%P$G$O$-$A$s$H2sE>$7$F@5>o$K=PNO$9$k$h$&$K$J$C$F$$$k$N$G!"$=$NE@$O8f0B?42<$5$$!#(B
-</P>
-<P>
-$BNc$H$7$F(B<A HREF="ftp://ftp.adobe.com/pub/adobe/printerdrivers/mac/all/ppdlevel2/canon.sit.hqx">Canon LASER SHOT LBP-730PS$BMQ$N%W%j%s%?5-=R%U%!%$%k(B</A>$B$rMQ$$$?>l9g!"(B
-$BJQ99$J$7$G<!$N5!G=$,MxMQ$G$-$^$9!#(B
-</P>
-<UL>
- <LI>$B%Z!<%8%5%$%:JQ99(B(A3$B!A$O$,$-(B)
- <LI>$B<j:9$70u:~$H<+F00u:~$N@ZBX$((B(1$B%Z!<%8L\$H$=$l0J9_$N%Z!<%8$N=PNOJ}K!$r(B
- $BJQ99$9$k5!G=$b;H$($k!#$?$@$7!"$3$N5!G=$O(B LIPS $B%I%i%$%P$N$_(B)
- <LI>$B2rA|EYJQ99(B($B$?$@$7(B Ghostscript $B$N%*%W%7%g%s$K(B-dFIXEDRESOLUTION=false $B$r$D$1$k$3$H(B)
- <LI>$BN>LL0u:~(B($BD9JU$H$8!"C;JU$H$8(B)
-</UL>
-<P>
-$B5k;fJ}K!A*Br%*%W%7%g%s$N$&$A(B-dManualFeed$B%*%W%7%g%s$O(BPostScript$B8@8l$N:nK!$K(B
-$B=>$C$F$$$^$9$,!"(B-dCasset$B%*%W%7%g%s$O$=$&$G$O$J$$$N$GCm0U$7$F2<$5$$!#(B
--dCasset $B$rMQ$$$k$h$&$K(B PPD $B$r5-=R$9$l$P;H$($k$h$&$K$J$k$H;W$$$^$9!#(B
-</P>
-<HR>
-<H2><A HREF="#i_change" NAME="change">$BJQ99MzNr(B</A></H2>
-<H3>gdevlips-2.3.3 (1999/6/22 release)</H3>
-<UL>
- <LI>[lips4v.dev]$BMQ;f%5%$%:JQ99$9$k%*%Z%l!<%?$r;HMQ$7$?$H$-$N5sF0$,(B
- $B$*$+$7$/$J$k%P%0$N=$@5!#(B(Thanks to $B[X3@$5$s(B)
-</UL>
-<H3>gdevlips-2.3.2 (1999/5/18 release)</H3>
-<UL>
- <LI>[npdl.dev]$BN>LL0u:~$N%5%]!<%H(B
-</UL>
-<H3>gdevlips-2.3.1 (1999/5/16 release)</H3>
-<UL>
- <LI>[escpage.dev]-dRIP $B%*%W%7%g%s$K$h$k2rA|EYJd@55!G=@)8f$N%5%]!<%H(B($B%G%U%)%k%H$G$O%*%s$K$J$j$^$9(B)$B!#$3$l$O;04d$5$s$+$i>pJs$r$$$?$@$-$^$7$?!#(B
- <LI>[npdl.dev]-dNegativePrint $B%*%W%7%g%s$K$h$kGr9uH?E>0u:~$N%5%]!<%H(B
-</UL>
-<H3>gdevlips-2.3.0 (1999/5/10 release)</H3>
-<UL>
- <LI>NPDL $B@)8f8@8l$KBP1~$7$?%G%P%$%9(B npdl.dev $B$NDI2C(B
- <LI>[lips4c.dev, lips4vc.dev]$B$=$l$>$l(B lips4.dev lips4v.dev $B$KE}9g$7$^$7$?!#(B
- -dBitsPerPixel=24 $B%*%W%7%g%s$G%+%i!<$K@Z$jBX$o$j$^$9!#(B
- <LI>[lp2000.dev, escpage.dev, lips4.dev]-dNegativePrint $B%*%W%7%g%s$K$h$kGr9uH?E>0u:~$N%5%]!<%H(B
-</UL>
-<H3>gdevlips-2.2.1 (1999/4/28 release)</H3>
-<UL>
- <LI>[lp2000.dev, escpage.dev] $B5!<o$K$h$C$F$O0u:~$5$l$k:BI8$,$:$l$F$7$^$&(B
- $B%P%0$N=$@5(B
-</UL>
-<H3>gdevlips-2.2.0 (1999/4/8 release)</H3>
-<UL>
- <LI>ESC/Page $B@)8f8@8l$KBP1~$7$?%G%P%$%9(B lp2000.dev$B!"(Bescpage.dev $B$NDI2C(B
- <LI>[lips2p$B!"(Blips3$B!"(Blips4]$B=PNO%"%k%4%j%:%`$r@.>>;a$N$b$N$rMQ$$$k$h$&$K$7$?!#(B
- ($B<c439bB.$K$J$k(B?)
-</UL>
-<H3>gdevlips-2.1.2 (1999/3/1 release)</H3>
-<UL>
- <LI>LBP-2160 $BMQ$N5!G=3HD%$K$h$j(BLBP-840 $B$GN>LL0u:~$dFsLL0u:~$,F/$+$J$$%P%0$N=$@5!#(B($B;{@n$5$s$+$i$NJs9p(B)
-</UL>
-<H3>gdevlips-2.1.1 (1999/2/23 release)</H3>
-<UL>
- <LI>[lips4$B!"(Blips4c$B!"(Blips4v$B!"(Blips4vc] $B;3Fb!w2,;38)N)Bg$5$s$K(B LBP-2160 $B$NMM!9$JMQ;f=PNO$KBP1~$9$k%Q%C%A$r$$$?$@$$$?$N$G<h$j9~$s$@!#(B
- $B$^$?!"(BLBP-2160 $B$N%U%'%$%9%"%C%W%H%l%$=PNO$KBP1~$9$k(B -dOutputFaceUp $B%*%W%7%g%s$,DI2C$5$l$?!#(B
-</UL>
-
-<H3>gdevlips-2.1.0 (1999/2/13 release)</H3>
-<UL>
- <LI>[lips4v$B!"(Blips4vc] $B%Q%9$KBP$9$k%/%j%C%T%s%0$,@5>o$K$O$?$i$+$J$$%P%0$N=$@5(B
- <LI>[lips4v$B!"(Blips4vc] $BB?3Q7A$NFbIt$rEI$j$D$V$9>l9g!"Hs%<%m4,?tK!$,%G%U%)%k%H$K$J$C$F$$$J$$%P%0$N=$@5(B
- <LI>[lips4v$B!"(Blips4vc] $B%b%N%/%m2hA|$G%Q%?!<%s%U%#%k$J$I$7$?>l9g(B 1$B!A(B7 $B%I%C%H2hA|$,$:$l$k%P%0$N=$@5(B
- <LI>[lips4v$B!"(Blips4vc] $BF)2a(B/$BGr$NAH9g$;$G%Q%?!<%s%U%#%k$J$I$7$?>l9gF)2a$JItJ,$HGr$NItJ,$N=hM}$,5U$K$J$C$F$$$k%P%0$N=$@5(B
- <LI>[lips4v$B!"(Blips4vc] known bug $B$N5-=R$rDI2C(B
-</UL>
-<H3>gdevlips-2.0.12 (1999/2/11 release)</H3>
-<UL>
- <LI>[lips4v$B!"(Blips4vc] $B%$%a!<%8=hM}$r9T$J$&$H%/%i%C%7%e$7$?$j@5>o$KIA$+$l$J$$%P%0$N=$@5(B
- <LI>[lips4v$B!"(Blips4vc] $B6k7A$KBP$9$k3Q4]$aL?Na$d3Q@Z$jMn$H$7L?Na$J$I$,F/$+$J$$%P%0=$@5(B
-</UL>
-<H3>gdevlips-2.0.11 (1999/2/9 release)</H3>
-<UL>
- <LI>[lips4v$B!"(Blips4vc] gdevlips-2.0.10 $B$N%P%0%U%#%C%/%9!#J8;z$J$I$rIA$/$H%3%"%@%s%W$9$k%P%0$r=$@5!#(B
-</UL>
-<H3>gdevlips-2.0.10 (1999/2/9 release)</H3>
-<UL>
- <LI>[lips4v$B!"(Blips4vc] $BJ#;($J%$%a!<%8=hM}$r9T$J$&$H!"%3%"%@%s%W$9$k%P%0$r=$@5!#$^$?!"2hA|$N?'$,$*$+$7$/$J$k%P%0$H2hA|$,$:$l$FIA$+$l$k%P%0$r=$@5(B
-</UL>
-<H3>gdevlips-2.0.9 (1999/2/8 release)</H3>
-<UL>
- <LI>[lips4v$B!"(Blips4vc] gdevlips-2.0.8 $B$NJQ99$K$*$$$F(B Hi-Level bitmap Imaging $B$G0lEY$KJ#?t%i%$%s$r07$&$H$-$K:G=i$N%i%$%s$7$+IA$+$l$J$$%P%0$rF~$l9~$s$G$7$^$C$?$N$G$=$l$r=$@5!#(B
-</UL>
-<H3>gdevlips-2.0.8 (1999/2/7 release)</H3>
-<UL>
- <LI>[lips4v$B!"(Blips4vc] $BA4$F$N%S%C%H%^%C%W%k!<%A%s$,05=L$KBP1~(B
- <LI>[lips4v$B!"(Blips4vc] $B2hA|$N1&C<$K(B1$BK\M>7W$J@~$,IA$+$l$k%P%0$r=$@5(B
-</UL>
-<H3>gdevlips-2.0.7 (1999/2/4 release)</H3>
-<UL>
- <LI>[lips2p$B!"(Blips3$B!"(Blips4] $B$$$C$?$s05=L$7$F!"05=L8e$N7k2L$,0-$$>l9g$O05=L$5$l$F$$$J$$$b$N$rMQ$$$k$H$$$&%"%k%4%j%:%`$rF3F~!#(B
- $B$=$N7k2L!"(Blips2p$B!"(Blips3 $B%G%P%$%9$G05=LN($,$+$J$j8~>e$7$?!#(B
- $B05=L$7$?$?$a$K0u:~%9%T!<%I$,CY$/$J$k$H$$$&$3$H$b$+$J$j$N3d9g$GHr$1$i$l$k!#(B
- $B$3$N%"%k%4%j%:%`F3F~$KH<$$(B -dCompress $B%*%W%7%g%s$OGQ;_$5$l$?!#(B
-</UL>
-<H3>gdevlips-2.0.6 (1999/1/30 release)</H3>
-<UL>
- <LI>[lips4c] gdevlips-2.0.4 $B$N%P%0BP:v$G=PNO$,$=$l0JA0$N$b$NHf$Y$F(B 3 $BG\0J>eBg$-$/$J$C$F$7$^$&$N$G!"$b$C$H=PNO$,>.$5$/$J$k$h$&$KD4@0$7$?!#(B
-</UL>
-<H3>gdevlips-2.0.5 (1999/1/28 release)</H3>
-<UL>
- <LI>[lips2p$B!"(Blips3$B!"(Blips4]$B05=L(B(-dCompress) $B$N@_Dj$N$H$-$N%P%0(B(gdevlips-2.0.1 $B$K:.F~(B)$B!#@5>o$KIA$+$l$J$+$C$?!#(B
-</UL>
-<H3>gdevlips-2.0.4 (1999/1/16 release)</H3>
-<UL>
- <LI>[lips4c] $B05=L$r9T$J$&@_Dj$N$H$-$K!"(BVMError $B$,=P$?$j%3%"%@%s%W$7$?$j$9$k$3$H$,$"$k%P%0$N=$@5(B
-</UL>
-<H3>gdevlips-2.0.3 (1999/1/11 release)</H3>
-<UL>
- <LI>[lips4v$B!"(Blips4vc] RGB 3 plane$B!_(B4 bit $B$N%G!<%?$r=hM}$9$k$H$-%i%9%?!<$,(B 1 dot $B$:$D$:$l$F$$$C$F$7$^$&$3$H$,$"$k%P%0$N=$@5(B (LIPS $B$N;EMM=q$N5-:\%_%9(B)
- <LI>[lips4v$B!"(Blips4vc] $B0lIt$N%k!<%A%s$,05=L$KBP1~(B (1 bit $B$N%G!<%?$N$_(B)
-</UL>
-<H3>gdevlips-2.0.2 (1999/1/8 release)</H3>
-<UL>
- <LI>$B%Y%/%?!<HG%G%P%$%9(B lips4v lips4vc $B$NI|3h(B
- <UL>
- <LI>[lips4v$B!"(Blips4vc]setflat $B%*%Z%l!<%?$r;HMQ$9$k$H6J@~$,%,%?%,%?$9$k%P%0$N=$@5(B
- <LI>[lips4v$B!"(Blips4vc]$B%-%c%i%/%?!<$,@5>o$KIA$+$l$J$$%P%0$N2sHr(B
- <LI>[lips4v$B!"(Blips4vc]$B2hA|Jd@5$r9T$C$?>l9g$N%P%0=$@5(B
- </UL>
-</UL>
-<H3>gdevlips-2.0.1 (1998/11/30 release)</H3>
-<UL>
- <LI>[lips2p$B!"(B lips3]$B%*%W%7%g%s$,@5>o$K5!G=$7$J$+$C$?$j!"M>7W$JJ8;z$,0u:~$5$l$k%P%0$N=$@5(B(gdevlips4-19981015 $B$GF~$j$3$s$@%P%0(B)
- <LI>[lips2p$B!"(Blips3$B!"(Blips4]$B$A$g$C$H9bB.2=(B($BM>7W$J=hM}$,F~$C$F$$$?(B)
- <LI>[lips4c]$B2rA|EY$N%G%U%)%k%H$r(B 600 dpi $B$K$7$?!#(B
- <LI>$B<+F05k;f$,F/$+$J$$(B LASER SHOT $B$KBP1~$9$k%*%W%7%g%s(B -dCasset=-1 $B$NDI2C(B
- <LI>[$BA4%G%P%$%9(B]PJL$B$r=PNO$9$k%*%W%7%g%s(B -dPJL $B$NDI2C!#(B
- lips4.dev $B$G$O%G%U%)%k%H$G$O(B PJL $B$r=PNO$7$J$$$h$&$K$7$?!#(B
- $B%H%J!<@aLs5!G=$d%H%J!<G;EYD4@a5!G=$O(B -dPJL $B%*%W%7%g%s$r;XDj$7$J$$$H(B
- $B;H$($J$$$h$&$K$J$j$^$7$?!#(B
-</UL>
-<H3>gdevlips-2.0.0 (1998/11/16 release)</H3>
-<UL>
- <LI>$B%Y%/%?!<HG%G%P%$%9(B lips4v lips4vc $B$NGQ;_(B(PDL $B$N%P%0$N$?$a(B)
-</UL>
-<H3>gdevlips-2.0.0pre1 (1998/10/10 release)</H3>
-<UL>
- <LI>$B%P!<%8%g%sHV9f$N$D$1$+$?$rJQ99$7$?(B
- <LI>[$BA4%G%P%$%9(B]$B%^!<%8%sJQ99$KBP1~(B
- <LI>l4vmono $B"*(B lips4v$B!"(Bl4vcolor $B"*(B lips4vc $B$KL>>NJQ99(B
- <LI>[lips4v lips4vc]$B%U%)%s%H$N%@%&%s%m!<%I5!G=$KBP1~(B($B$?$@$7@)8B$"$j(B)
- <LI>[lips4v lips4vc]$B%^%$%?%j%_%C%H$,@5>o$K5!G=$7$J$$%P%0$N=$@5(B
- <LI>[lips4v lips4vc]$B0lIt$N5!<o$G5/$3$kJ8;z$d2hA|$,>C$($k(B LIPS IV $B$N%P%0$r2sHr$7$?(B
-</UL>
-<H3>gdevlips4-19981104 (release 27)</H3>
-<UL>
- <LI>Ghostscript 5.10 $BMQ$N(B Makefile $B$N5-=R$K8m$j$,$"$j!"%3%s%Q%$%k$G$-$J$$IT6q9g$r=$@5$7$?(B($B0KF#(B@$B72GOBg$5$s$NJs9p(B)
-</UL>
-<H3>gdevlips4-19981017 (release 26)</H3>
-<UL>
- <LI>[lips2p lips3 lips4] $B%i%9%?!<%$%a!<%8=hM}$N%P%0=$@5!#(B
- $B1&C<$N%i%9%?$,H4$1$?$j!"$R$I$$>l9g(B 1 $B%i%$%s4]!9IA$+$l$J$$$3$H$,$"$C$?!#(B
-</UL>
-<H3>gdevlips4-19981015 (release 25)</H3>
-<UL>
- <LI>[lips4 l4vmono l4vcolor] n $BLL0u:~5!G=!&%H%J!<G;EYD4@a5!G=!&%H%J!<%;!<%V5!G=$NDI2C(B
-</UL>
-<H3>gdevlips4-19981012 (release 24)</H3>
-<UL>
- <LI>[l4vmono] $B%Q%?!<%s$J$I$,Gv$$?'$K$J$C$?$j>C$($F$7$^$&%P%0$N=$@5(B
-</UL>
-<H3>gdevlips4-19981009 (release 23)</H3>
-<UL>
- <LI>[l4vmono l4vcolor] $B6k7A$N2sE>$,$&$^$/$$$+$J$$%P%0$N=$@5(B
- <LI>[l4vmono l4vcolor] $BJ8;z$K?'$,$D$+$J$$$3$H$,$"$k%P%0$N=$@5(B
-</UL>
-<H3>gdevlips4-19981006 (release 22)</H3>
-<UL>
- <LI>[l4vmono l4vcolor] $B6k7A$rIA$$$?8e$N?^7A$,IA$+$l$J$$%P%0$N=$@5(B
-</UL>
-<H3>gdevlips4-19981005 (release 21)</H3>
-<UL>
- <LI>[l4vmono l4vcolor] $B4q?t6v?tK!$G%Q%9$rEI$j$D$V$9=hM}$,Hs%<%m4,?tK!$G9T$J$o$l$k$h$&$K$J$C$F$$$k%P%0$rD>$7$?(B
- <LI>[l4vmono l4vcolor] $B%^%$%?%j%_%C%H$N;XDjJ}K!$,4V0c$C$F$$$?!#(B
- <LI>[lips4c] BJC-680J/BJC-880J $B$K$D$$$F!V(B20 $B%Z!<%8(B $B%*!<%P!<!W$N%(%i!<$,H/@8$9$kLdBj$N2r7h(B
- <LI>Ghostscript 5.50 $B$NG[I[$HF1MM$K%I%-%e%a%s%H$rA4$F(B HTML $B$K$7$?!#(B
- <LI>Ghostscript 5.10 $BBP1~%I%i%$%P$H(B Ghostscript 5.50 $BBP1~%I%i%$%P$rF1:-(B
- <LI>lips4g$B!"(Blips3fig$B!"(Blips4fig$B!"(Blips4cfig $B%I%i%$%P$NGQ;_(B
- <LI>$B$=$NB>:Y$+$$%P%0%U%#%C%/%9(B
-</UL>
-
-<H3>gdevlips4-19980924 (release 20)</H3>
-<UL>
- <LI>Ghostscript 5.50 $BBP1~$K$7$?$H$-$N%P%0%U%#%C%/%9(B
- <LI>$B%9!<%Q!<%U%!%$%s(B LIPS (1200 dpi) $BBP1~$N$?$a$N%F%9%H(B
-</UL>
-
-<H3>gdevlips4-19980922 (release 19)</H3>
-<UL>
- <LI>Ghostscript 5.50 $BBP1~!#(B
-</UL>
-
-<H3>gdevlips4-19980908 (release 18)</H3>
-<UL>
- <LI>[lips2p, lips3, lips4] $B9bB.$K=PNO$G$-$k%"%k%4%j%:%`$r:NMQ$7$?!#(B
-</UL>
-<H3>gdevlips4-19980904 (release 17)</H3>
-<UL>
- <LI>[lips4c, lips4, lips4g] $B2hA|$rJ,$1$FE>Aw$9$k;~6u9T$,@hF,$KMh$k$H(B
- $B4|BT$7$?=PNO$5$l$J$$(B LIPS IV $B$N;EMM$r2sHr$9$k$?$a!"(B-dcRowBuf $B$N%G%U%)%k%H(B
- $B$r(B 0 $B$K$7$?!#(B
- <LI>[l4vmono, l4vcolor] $B2hA|H?E>%P%0$N=$@5(B
- <LI>[l4vmono, l4vcolor] 1bit$B!&%b%N%/%m%0%i%U%#%C%/$G%^%9%/=hM}$r9T$J$&>l9g!"(B
- $B2?$b$G$J$$$3$H$,$"$k%P%0$N=$@5(B
- <LI>[l4vmono, l4vcolor] $B@~$NB@$5$,(B 720 dpi $B$rA[Dj$7$FIA$+$l$F$$$?$N$G(B
- 600 dpi $B$G(B 1.2 $BG\$NB@$5$K$J$C$F$7$^$&%P%0$r=$@5!#$=$NB>$N2rA|EY$K$bBP1~(B
- <LI>[l4vmono, l4vcolor] 600dpi $B0J30$GE@@~$,$*$+$7$$%P%0$r=$@5(B
- <LI>[l4vmono, l4vcolor] $B6k7A$r8zN(NI$/IA$1$k$h$&$K$7$?!#(B
-</UL>
-
-<H3>gdevlips4-19980822 (release 16)</H3>
-<UL>
- <LI>$B%0%l!<%9%1!<%k$N2hA|$r4^$s$@(B PostScript $B%U%!%$%k$G2hA|$,Gr9uH?E>$7$F$7$^$&(B
-$BLdBj$N2r7h(B
- <LI>TeX $B$G(B EPS $B$r4^$s$@(B DVI $B%U%!%$%k$r%I%i%U%H=PNO$7$?$H$-$KIA$+$l$k6k7A$,(B
-$B$*$+$7$/$J$k(B LIPS IV $B$N;EMM$r2sHr$7$FLdBj$r2r7h(B
-</UL>
-
-<H3>gdevlips4-19980821 (release 15)</H3>
-<UL>
- <LI>[l4vmono l4vcolor] $B1_$J$I$r@5>o$K%Q%?!<%s%U%#%k$G$-$J$$LdBj$N2r7h!#(B
-lips4v_copy_mono $B$H(B lips4v_copy_color $B4X?t$K%P%0$,$"$C$?!#(B
- <LI>[l4vmono l4vcolor] $B@~$NB@$5$,HyL/$KB@$/$J$C$F$7$^$&$3$H$,$"$kLdBj$N2r7h(B
-</UL>
-
-<H3>gdevlips4-19980729 (release 14)</H3>
-<UL>
- <LI>-sOutputFile=foo%d.xyz
- $B$N7A<0$G=PNO%U%!%$%k$r;XDj$7$?>l9g$K%3%"%@%s%W$9$k%P%0$N2r7h(B
- <LI>gdevlips4-19980707 $B$NJQ99$G(B lips4cfig$B!"(Blips4fig $B$,=PNO$G$-$J$/$J$C$?(B
- $B%P%0$N2r7h(B
- <LI>[l4vmono$B!"(Bl4vcolor] pswrite $BEy$N%G%P%$%9$,AH$_9~$^$l$F$$$J$$$H(B
- $B%3%s%Q%$%k$G$-$J$$LdBj$N2r7h(B
- <LI>[l4vmono$B!"(Bl4vcolor] $BJ8;z$N%^%9%/=hM}$,$*$+$7$$LdBj$N2r7h(B
-</UL>
-
-<H3>gdevlips4-19980716 (release 13)</H3>
-<UL>
- <LI>gdevlips4-19980707 $B$G(B gdevlips.mak $B$,$*$+$7$$$?$a$K%3%s%Q%$%k$G$-$J$$(B
- $BIT6q9g$r=$@5$7$?!#(B
-</UL>
-
-<H3>gdevlips4-19980707 (release 12)</H3>
-<UL>
- <LI>LIPS IV $B$G(B High-level drawing $B$H(B High-level bitmap imaging
- $B$r9T$J$&%Y%/%?!<%G%P%$%9(B $B$G$"$k(B l4vmono l4vcolor $B%G%P%$%9$rDI2C$7$?!#(B
-</UL>
-
-<H3>gdevlips4-19980704 (release 11)</H3>
-<UL>
- <LI>lips4c$B!"(Blips4$B!"(Blips4g$B!"(Blips4cfig$B!"(Blips4fig $B%G%P%$%9$K$*$$$F!"(B $B@5>o(B
- $B$K=PNO$G$-$J$$%P%0$,$"$C$?!#(B($BJ8K!4V0c$$!#(B)
-</UL>
-
-<H3>gdevlips4-19980623 (release 10)</H3>
-<UL>
- <LI>lips4* $B%G%P%$%9$N05=LJ}K!$r%G%k%?05=L$KJQ99$7$?!#Nc30E*$K(Blips4.dev $B$G$N(B
- tiger.ps $B$N05=LN($ONI$/$J$$$,!"$[$H$s$I$N>l9g0JA0$N%I%i%$%P$h$j$b(B
- $B05=LN($,9b$/$J$k!#(B
- <LI>lips4* $B%G%P%$%9$G(B gdevepag Ver. 3 $B$N$h$&$K(B -dcRowBuf $B%*%W%7%g%s$G(B
- $B%i%9%?!<%$%a!<%8$rJ,3d$9$k$h$&$K$7$?!#$3$l$K$h$j!"(Blips4c$B!"(Blips4cfig $B$N(B
- $B%i%9%?!<%$%a!<%8$r$^$H$a$FAw$l$k$h$&$K$J$C$?!#(B
- <LI>lips4* $B%G%P%$%9$G$bHs05=L(B(-dCompress=false)$B$,;H$($k$h$&$K$J$C$?!#(B
- ($B<g$K%G%P%C%0MQ(B)
- <LI>$BG[I[>r7o$,(B GPL Ver.2 $B$K$J$C$?!#(B
-</UL>
-
-<H3>gdevlips4-19980612 (release 9)</H3>
-<UL>
- <LI>lips2p $B%G%P%$%9$G(B LIPS II+ $B$KBP1~(B
- <LI>lbp2030 $B%G%P%$%9$r(B lips4c $B%G%P%$%9$KE}9g(B
- (600 dpi $B$G=PNO$9$k$H$-$O!"(B-r600 $B%*%W%7%g%s$r$D$1$k$3$H(B)
- <LI>lips4g $B%G%P%$%9$G(B LIPS IV $B$N%0%l!<%9%1!<%k(B(8 bit = 256 $B3,D4(B)$B$KBP1~(B
- <LI>$B%U%!%$%kL>$r(B 8.3 $B7A<0$KJQ99(B
- <UL>
- <LI>gdevlips4.c $B"*(B gdevlips.c
- <LI>gdevlips4.h $B"*(B gdevlips.h
- </UL>
-</UL>
-
-<H3>gdevlips4-19980429 (release 8)</H3>
-<UL>
- <LI>lips3fig $B%G%P%$%9$,%3%"%@%s%W$9$kLdBj$N2r7h(B
- <LI>lips3 $B%G%P%$%9$G05=L!&Hs05=L$r(B-dCompress$B%*%W%7%g%s$G@ZBX$($i$l$k$h$&$K$7$?!#(B
-</UL>
-
-<H3>gdevlips4-19980413 (release 7)</H3>
-<UL>
- <LI>$BIUB0$N(Bgs_statd.ps$B$r;H$&$H(BGhostscript$B$,%$%s%?%i%/%F%#%V%b!<%I$G(B
- $B5/F0$G$-$J$$%P%0$r=$@5(B($B@P4]$5$s$+$i$NJs9p(B)$B!#(B
- -sPAPERSIZE=executive $B%*%W%7%g%s$O;HMQ$G$-$J$/$J$k(B
- <LI>lbp2030 $B$G%G%U%)%k%H$,(B 360 dpi $B$K$J$C$F$$$?$N$r(B 600 dpi $B$K=$@5(B
- <LI>lips4c$B!"(Blips4cfig $B$G%i%9%?!<%$%a!<%8$N05=L$r%5%]!<%H(B
- ($B$H$$$&$h$j$b(Blbp2030$B$H$N%3!<%I$N6&DL2=(B)
- <LI>$BN>LL0u:~$G$H$80LCV$rJQ99$G$-$k$h$&$K$J$C$?!#(B
- (-dFlipBinding$B%*%W%7%g%s(B)
- <LI>$BMQ;f%5%$%:$KESCf$N%Z!<%8$GJQ99$,$J$$>l9g$O!"(B
- $B%Z!<%8!&%U%)!<%^%C%HA*BrL?Na$O0l2s$@$1H/9T$9$k$h$&$K$7$?!#(B
- $B$3$l$O3F%Z!<%8$4$H$K%Z!<%8!&%U%)!<%^%C%HA*BrL?Na$rH/9T$9$k$H(B
- $B0u;z8zN($,Dc2<$9$k$?$a$G$"$k(B
- <LI>$B>e5-$HF1MM$KN>LL0u:~L?Na!&5k;f%b!<%IL?Na$bESCf$GJQ99$,$J$$>l9g$O!"(B
- $B0l2s$NH/9T$7$+9T$J$o$J$$$h$&$K$7$?!#(B
-</UL>
-
-<H3>gdevlips4-19980403 (release 6)</H3>
-<UL>
- <LI>LIPS IV $B$N05=LJ}<0$r%P%$%H%i%s%l%s%0%905=LK!$+$i%Q%C%/%S%C%D(B
- (TIFF)$B05=LK!$KJQ99$7$?$?$a05=LN($,>e$,$j!";HMQ%a%b%j!<NL$,(B
- $B8:$C$?!#(B
- $B$3$l$O0KF#>M@2$5$s$,(Bfj$B$KEj9F$7$?(B<A HREF="news:605qpt$f50$1@kuma.fastnet.or.jp">gdevlips4-1.2.0$B$X$N%Q%C%A(B</A>&lt;605qpt$f50$1@kuma.fastnet.or.jp&gt;$B$+$i(B
- $B%^!<%8$7$?!#(B
- <LI>$B%W%j%s%?$N%9%F!<%?%9I=<(It$KI=<($9$k%3%a%s%H$rF0E*$KJQ99$9$k$3$H$,(B
- $B$G$-$k$h$&$K$J$C$?!#(B
- <LI>$B%b%N%/%m0u:~$K$*$$$F%S%C%H%^%C%W%9%`!<%8%s%0=hM}$r(BON/OFF$B$G$-$k$h$&$K$J$C$?!#(B
- <LI>$B%+%i!<0u:~$K$*$$$F9b@::Y%$%a!<%8=hM}$r(BON/OFF$B$G$-$k$h$&$K$J$C$?!#(B
-</UL>
-
-
-<H3>gdevlips4-19980401-2 (release 5)</H3>
-<UL>
- <LI>$BN>LL0u:~$N@_Dj$K$D$$$F%G%U%)%k%H$G$O%W%j%s%?B&$N@_Dj$r;H$&$h$&$K$7$?!#(B
-</UL>
-
-<H3>gdevlips4-19980401 (release 4)</H3>
-<UL>
- <LI>$B5k;f%+%;%C%H$NA*Br$KBP1~$7$?!#(B
- <LI>$BN>LL0u:~$K40A4BP1~$7$?!#(B
-</UL>
-
-<H3>gdevlips4-19980331-2 (release 3)</H3>
-<UL>
- <LI>$B8x3+;~$K(BDEFAULT_HEIGHT_10THS_A4$B$N$H$3$m$K(BDEFAULT_WIDTH_10THS_A4$B$r$$$l$F(B
- $B$7$^$C$?$?$a%G%U%)%k%H%5%$%:$,(BA4$B2#(BxA4$B2#$K$J$k$H$$$&CWL?E*$J%P%0$,$"$C$?!#(B
- <LI>$BG$0U$NMQ;f%5%$%:$N;XDj$K%P%0$,$"$C$?!#(B
-</UL>
-
-<H3>gdevlips4-19980331 (release 2)</H3>
-<UL>
- <LI>60dpi$B$h$jAF$$%5%$%:$r=hM}$G$-$J$$$h$&$K$7$?!#(B(LIPS$B$N5,3J$N$?$a(B)
- <LI>lips3$B$G$O(B300dpi$B!"(Blips4c$B$G$O(B360dpi$B!"(Blips4$B$H(Blbp2030$B$G$O(B600dpi$B$h$j:Y$+$$(B
- $B%5%$%:$r=hM}$G$-$J$$$h$&$K$7$?!#(B(LIPS$B$N5,3J$N$?$a(B)
- <LI>$BIuE{$NMN7A(B4$B9f%5%$%:$,$*$+$7$+$C$?$N$GD>$7$?!#(B
- <LI>$B=$@5$7$?(B gs_stad.ps $B$rImB0$7$?!#(B
-</UL>
-
-<H3>gdevlips4-19980330 (release 1)</H3>
-<UL>
- <LI>lips3, lips4, lips4c, lbp2030
- <UL>
- <LI>$B>e%^!<%8%s$,(B 63/300 inch ($BLs(B10.3 mm)$B$G$"$C$?$N$r(B 5 mm (lips4c $B$O(B 8 mm)
- $B$K$7$?!#(B
- <LI>$B%Z!<%8%5%$%:JQ99$K40A4BP1~$7$?!#(B
- <LI>$B%H%l%$5k;f$H<+F05k;f$N@ZBX$($KBP1~$7$?!#(B
- <LI>$BJ#?tIt0u:~$KBP1~$7$?!#(B
- </UL>
- <LI>lips4
- <UL>
- <LI>$B%i%9%?!<%$%a!<%8$N05=L$KBP1~$7$?!#(B
- <LI>$BN>LL0u:~%f%K%C%H$KBP1~$7$?!#(B
- </UL>
- <LI>lips3
- <UL>
- <LI>$B%i%9%?!<%$%a!<%8$N05=L$KBP1~$7$?!#(B
- </UL>
-</UL>
-<HR>
-<H2><A HREF="#i_hireso" NAME="hireso">LIPS IV $B=PNO$K$*$1$k9b2rA|EY0u;z$K4X$9$kCm0U(B</A></H2>
-<P>
-600dpi $B0u;z$d(B 1200dpi $B0u;z$r9T$&>l9g$O(B, $B%W%j%s%?$KEk:\$5$l$F$$$kFbB"(B
-$B%a%b%j$NMFNL$KCm0U$7$F2<$5$$!#(B
-</P>
-<P>
-$B$3$l$OFbB"%a%b%j$NMFNL$,>/$J$$>l9g$K!"(B
-$B%W%j%s%?$,%G!<%?NL$NB?$5$KBP1~$G$-$:<+F0E*$K2rA|EY$rMn$7$F0u;z$5$;$k$+$i$G$9(B
-($B0u;z%G!<%?$K0MB8$9$k$N$G0l35$K$O8@$($^$;$s(B)$B!#(B
-$B$3$N=hM}$,9T$o$l$k$H(B, $B0u;z2rA|EY$,JQ$o$kB>$K(B 2 $BE@$N%G%a%j%C%H$,$"$j$^$9!#(B
-<UL>
- <LI>$B0u;z$K;~4V$,$+$+$k$3$H$,B?$$(B($BFbIt=hM}$r(B 2 $BEY9T$C$F$$$k(B?)
- <LI>$B%i%9%?%G!<%?$r0u;z$9$k>l9g$OC1=c$K4V0z$/$h$&$G!"(B
- $B%0%l!<$NItJ,$,Gr$C$]$/(B/$B9u$C$]$/$J$C$?$j$J$I$7$F=jK>$N0u;z$,F@$i$l$J$$$3$H$,$"$k(B
-</UL>
-<P>
-$B$3$l$i$rHr$1$k$?$a$K$b!"Ek:\%a%b%j$K8+9g$C$?2rA|EY$G$N0u;z$r$*4+$a$7$^$9!#(B
-$B9b2rA|EY$G0u;z$r9T$&$?$a$KI,MW$J%a%b%jMFNL$O!"(B
-$B!V%W%j%s%?5!G=%^%K%e%"%k!W$X(B `$B0u;zJ]>Z%a%b%j(B' $B$H$7$F=q$+$l$F$$$^$9!#(B
-$B=PNOMQ;f%5%$%:$dN>LL0u;z$NM-L5$K$h$C$FJQ2=$9$kE@$bCm0U$7$F2<$5$$!#(B
-</P>
-<HR>
-<H2><A HREF="#i_bug" NAME="bug">$B%P%0(B</A></H2>
-<P>
-$B$3$3$K%j%9%H$5$l$F$$$k%P%0$O:n<T$,GD0.$7$F$$$k%P%0$G$9!#(B
-$B$3$l0J30$N%P%0$,$J$$$H$$$&0UL#$G$O$J$$$N$GCm0U$7$F2<$5$$!#(B
-</P>
-<P>
-$B$3$3$K%j%9%H$5$l$F$$$k0J30$G%P%0$rH/8+$7$^$7$?$i(B
-<A HREF="mailto:ohmori@p.chiba-u.ac.jp">$B:n<T(B</A>$B$^$GJs9p$r$*4j$$$7$^$9!#(B
-</P>
-<H3>[npdl.dev]</H3>
-<H4><A HREF="#i_marginbug" NAME="marginbug">1. $B0u:~0LCV$,$:$l$k(B</A></H4>
-<P>
-$B@)8f8@8l(B NPDL $B$G$O=PNO0LCV$N@_Dj$,5!<o0MB8$K$J$C$F$$$^$9!#(B
-$B5!<o$K$h$C$F0u:~2DG=HO0O$,0[$J$k$N$G0u:~0LCV$,$:$l$F$7$^$$$^$9!#(B
-<A HREF="#offset">$B0u:~0LCV$rD4@0$9$k$K$O$I$&$7$?$i$$$$$G$9$+(B?</A>
-$B$r;29M$K$7$FD4@0$9$k$+!"%=!<%9%U%!%$%k$rD>@\$$$8$C$FD>$7$F$/$@$5$$!#(B
-</P>
-<HR>
-<H4><A HREF="#i_nonduplex" NAME="nonduplex">2. $BJRLL0u:~$dN>LL0u:~;~$KC;JU$H$8$G0u:~$G$-$J$$(B</A></H4>
-<P>
-NPDL $BMQ$N%I%i%$%P$G$O8=:_$N$H$3$mJRLL0u:~$O$G$-$^$;$s!#(B
-$B$3$l$O(B NPDL $B$N;EMM=q$KJRLL0u:~$9$k$?$a$N%3%^%s%I$,5-:\$5$l$F$$$J$$$3$H$H!";d$,N>LL0u:~$G$-$k(B NPDL $BEk:\%W%j%s%?$,;H$($k4D6-$K$J$$$?$a$G$9!#(B
-$BF1MM$NM}M3$GN>LL0u:~;~$KC;JU$H$8$G0u:~$G$-$^$;$s!#(B
-</P>
-<P>
-$BN>LL0u:~$G$-$k(B NEC MultiWriter (NPDL(Level2) $BEk:\%W%j%s%?(B) $B$r$*;}$A$N$+$?$O(B
-$BN>LL0u:~$r@)8f$9$k%3%^%s%I(B($BJRLL0u:~%3%^%s%I$dC;JU$H$8$K$9$k%3%^%s%I(B)$B$r65$($F$$$?$@$1$k$H$3$N%I%i%$%P$KAH$_9~$`$3$H$,$G$-$^$9!#8f6(NO$h$m$7$/$*4j$$$7$^$9!#(B
-</P>
-<HR>
-<H3>[bjc880j.dev]</H3>
-<H4><A HREF="#i_landbug" NAME="landbug">1. $B%i%s%I%9%1!<%W2sE>;~$K0u:~0LCV$,$A$g$C$H$:$l$k(B</A></H4>
-<P>
-$BB>$N(B LIPS $B$N%I%i%$%P$G$O>e2<:81&$N%^!<%8%s$,6Q0l$J$N$G%i%s%I%9%1!<%W$O(B
-$B$=$N$^$^2sE>$7$F$d$l$P0u:~0LCV$,$"$$$^$9$,!"(B
-BJC-680J$B!"(BBJC-880J $B$G$O%^!<%8%s$,0c$&$N$G>/$7$:$l$F$7$^$$$^$9!#(B
-$B2sE>;~$K87L)$K0LCV$r7W;;$9$l$P$:$l$J$$(B?
-</P>
-<HR>
-<H3>[lips4v.dev]</H3>
-<H4><A HREF="#i_clipping" NAME="clipping">1. $B%Q%9$N%/%j%C%T%s%0=hM};~$N%a%b%jITB-(B ($B%7%9%F%`%a%b%j%U%k(B $B%(%i!<(B)</A></H4>
-<P>
-$B6k7A0J30$N%Q%9$GB?>/J#;($J%/%j%C%T%s%0=hM}$7$?$@$1$G%W%j%s%?$,%a%b%jITB-$K4Y$k!#(B
-$BNc$($P(B Tgif $B$G1_$r%Q%?!<%s%U%#%k$7$F=PNO$7$?(B PostScript $B%U%!%$%k$G$3$N8=>]$,$_$i$l$k!#(B
-</P>
-<P>
-$B$3$l$O(B Ghostsciprt 5.10 $B$,=PNO$9$k%/%j%C%T%s%0%Q%9$,8zN(0-$$$3$H$H!"(B
-LIPS IV $B$N%Q%9%/%j%C%T%s%0=hM}$,%a%b%j!<$r?)$$2a$.$k$?$a$K5/$3$j$^$9!#(B
-</P>
-<P>
-$B"($3$N%P%0$O(B Ghostscript 5.50 $B$G$O%Q%9$N%/%j%C%T%s%0=hM}$,8zN($h$/$J$C$?$?$a$KB?>/$^$7$K$J$C$F$$$^$9!#(B
-$B$^$?!"%-%d%N%s$K$h$k$H(B MaxiMem $BEk:\5!$G$O%/%j%C%T%s%0$K4X$9$k%a%b%j!<8zN($bNI$/$J$C$F$$$k$=$&$J$N$G$3$NLdBj$O2r7h$5$l$F$$$k$+$b$7$l$^$;$s!#(B($BL$3NG'(B)
-</P>
-<HR>
-<H4><A HREF="#i_zeroline" NAME="zeroline">2. $BI}$,%<%m$N%Q%9$r%U%#%k$7$?$H$-2?$bIA$+$l$J$$(B</A></H4>
-<P>
-PostScript $B$G$OI}$,%<%m$N%Q%9$r%U%#%k$7$?$H$-$bIA$+$l$J$1$l$P$J$i$J$$$,!"IA$+$l$J$$!#(B
-</P>
-<P>
-LIPS IV $B$G$OIA$+$l$J$$;EMM$G$9!#(B
-</P>
-<P>
-$B"((BGhostscript $B$KImB0$N(B zeroline.ps $B$r0u:~$9$k$H$3$N%P%0$,J,$+$j$^$9!#(B
-</P>
-<HR>
-<H4><A HREF="#i_zeromove" NAME="zeromove">3. $B0\F05wN%(B 0 $B$N%Q%9$N07$$(B</A></H4>
-<P>
-$B0\F05wN%(B 0 $B$N%Q%9$r%9%H%m!<%/$7$?;~!"(Bsetlinejoin $B$,(B 1 (Round join)
-$B$N$H$-$J$K$bIA$+$l$J$$!#(B
-</P>
-<P>
-PostScript $B$G$O$3$N$H$-1_$,IA$+$l$J$1$l$P$J$j$^$;$s$,!"(BLIPS IV $B$G$O(B
-$BIA$+$l$J$$;EMM$K$J$C$F$$$^$9!#(B
-</P>
-<P>
-$B"((BGhostscript $B$KImB0$N(B zeroline.ps $B$r0u:~$9$k$H$3$N%P%0$,J,$+$j$^$9!#(B
-</P>
-<HR>
-<H4><A HREF="#i_square_cap" NAME="square_cap">4. Projecting square cap $B$N%P%0(B</A></H4>
-<P>
-$B@~$N@\9gIt$G!"(Bsetlinecap $B$G(B 2 (Projecting square cap) $B$r;XDj$7$?;~!"%Q%9$r%/%m!<%:(B
-$B$7$?ItJ,$N@~@\9g$,$&$^$/$$$+$J$$!#$^$?!"%/%m!<%:$9$k:BI8$,%Q%9$N86E@$+$i(B
-$B0z$-?-$P$7$?J}8~$K$:$l$k!#(B
-</P>
-<P>
-LIPS IV $B$N%P%0$G$9!#(B
-</P>
-<P>
-$B"((BGhostscript $B$KImB0$N(B lines.ps $B$r0u:~$9$k$H$3$N%P%0$,J,$+$j$^$9!#(B
-</P>
-<HR>
-<H4><A HREF="#i_round_cap" NAME="round_cap">5. Round cap $B$N%P%0(B</A></H4>
-<P>
-$B@~$N@\9gIt$G(Bsetlinecap $B$G(B 1 (Round cap) $B$r;XDj$7$F!"(Bsetlinejoin $B$G(B 2 (Bevel join)$B$r;XDj$7$?$H$-!"(B
-$B%Q%9$r%/%m!<%:$7$?ItJ,$N@~@\9g$O(B $B!V%Y%Y%k(B($B@Z$jMn$H$7(B)$B!W(B $B$K$J$i$J$1$l$P$$$1$J$$$H$3$m!V4]!W$K$J$C$F$7$^$&!#(B
-</P>
-<P>
-LIPS IV $B$N%P%0$G$9!#(B
-</P>
-<P>
-$B"((BGhostscript $B$KImB0$N(B lines.ps $B$r0u:~$9$k$H$3$N%P%0$,J,$+$j$^$9!#(B
-</P>
-<HR>
-<H4><A HREF="#i_linewidth" NAME="linewidth">6. $B@~$NB@$5$,0c$&(B</A></H4>
-<P>
-LIPS IV $B$N@)8B$G@~$NB@$5$N>e8B$O(B 0.85 $B%$%s%A$H$J$C$F$$$^$9!#(B
-PostScript $B$K$O$=$N$h$&$J@)8B$,$J$$$N$G!"6KC<$KB@$$@~$rIA$/$H$-$K(B
-$B=PNO$N0c$$$,=P$F$7$^$$$^$9!#(B
-</P>
-<P>
-$B$^$?!"(BGhostscript $B$N(B $B%Y%/%?!<%I%i%$%P$N%P%0$K$h$j=D2#$N%9%1!<%k$,0[$J$k>l9g!"(B
-$B@~$NB@$5$,0c$C$F$-$F$7$^$$$9!#(B
-</P>
-<P>
-rectstroke $B%*%Z%l!<%?$r;H$C$?>l9g$G=D$H2#$NB@$5$,0c$&>l9g$b@5>o$KIA$+$l$^$;$s!#(B($B=D$H2#$NB@$5$,F1$8$K$J$C$F$7$^$$$^$9!#(B)
-</P>
-<HR>
-<H4><A HREF="#i_setdash" NAME="setdash">7. $BGK@~$N%Q%?!<%s$,IA$+$l$J$$(B</A></H4>
-<P>
-$BGK@~$N%Q%?!<%s$K(B 0 $B$,4^$^$l$F$$$k>l9g!"$3$N%I%i%$%P$G$OIA$+$l$^$;$s!#(B
-</P>
-<P>
-$BGK@~$N%Q%?!<%s$K(B 0 $B$,4^$^$l$F$$$k>l9g$N%*%Z%l!<%?$N5sF0$O$I$&$J$C$F$$$k$N$+(B
-Red Book $B$K=q$$$F$J$$$N$G;d$K$OJ,$+$j$^$;$s!#C/$+65$($F2<$5$$!#(B
-</P>
-<HR>
-<H4><A HREF="#i_pattern" NAME="pattern">8. lips4v $B%I%i%$%P$G%0%l!<%9%1!<%k=PNO$9$k$H$-$K%+%i!<%Q%?!<%s$rIA$$$?>l9g?'$,$*$+$7$$$3$H$,$"$k(B</A></H4>
-<P>
-$BB?J,!"(BGhostscript $B$N%P%0$G$9!#%+%i!<=PNO(B (-dBitsPerPixel=24) $B$G$O$3$N%P%0$O8+$i$l$^$;$s!#(B
-</P>
-<HR>
-<H2><A HREF="#i_faq" NAME="faq">FAQ</A></H2>
-<H3><A HREF="#i_slow" NAME="slow">$B%W%j%s%?$N=PNO$OB.$/$J$i$J$$$N(B?</A></H3>
-<P>
-LIPS IV $B5!$N>l9g(B -r300 $B%*%W%7%g%s$r$D$1$F2rA|EY$r(B 300 dpi ($B%/%$%C%/(B)
-$B$K$9$k$HB.$/$J$j$^$9!#(B($BEvA32h<A$OMn$A$^$9(B)
-</P>
-<P>
-LIPS IV $B5!$G(B 600 dpi $B0u:~$9$k>l9g$O(B lips4 $B%I%i%$%P$rMQ$$$k$N$,NI$$$G$7$g$&!#(B
-lips4v $B%I%i%$%P$r;H$C$F$bB.EYE*$J%a%j%C%H$O$"$j$^$;$s!#(B
-</P>
-<P>
-LIPS IV $B5!$G(B 1,200 dpi $B0u:~$9$k>l9g$O(B lips4v.dev $B$r;H$C$?$[$&$,(B
-$BB.$$$+$b$7$l$^$;$s$,!";d$O;H$C$?$3$H$J$$$N$GJ,$+$j$^$;$s!#(B
-</P>
-<P>
-Color LASER SHOT $B$G%+%i!<0u:~$9$k>l9g$O(B lips4.dev $B$G$J$/(B
-lips4v.dev $B$r;H$C$?J}$,9bB.$K=PNO$G$-$^$9!#(B
-($B$7$+$7!"%Y%/%?!<HG%I%i%$%P$O@)8B$,B?$$$N$GCm0U$7$F$/$@$5$$!#(B)
-</P>
-<HR>
-<H3><A HREF="#i_font" NAME="font">$B%W%j%s%?$NFbB"%U%)%s%H$O;H$($J$$$N(B?</A></H3>
-<P>
-$B;H$($^$;$s!#(B
-</P>
-<HR>
-<H3><A HREF="#i_nup_printing" NAME="nup_printing">n $BLL0u:~$r$9$k$K$O!"$I$&$7$?$i$$$$$N(B?</A></H3>
-<P>
-PSUtils $B$H$$$&%=%U%H%&%'%"$K4^$^$l$k(B psnup $B$rMQ$$$^$9!#(B
-PSUtils $B$O(B PostScript $B%U%!%$%k$NCf$+$iFCDj$N%Z!<%8$rCj=P$7$?$j!"(B
-$B%Z!<%8$NJB$S$rJQ99$7$?$j$G$-$k%3%^%s%I72$G$9!#(B
-</P>
-<P>
-PSUtils $B$O<!$N$H$3$m$+$iF@$i$l$^$9!#(B
-<UL>
- <LI><A HREF="http://www.dcs.ed.ac.uk/home/ajcd/psutils/">&lt;URI:http://www.dcs.ed.ac.uk/home/ajcd/psutils/&gt;</A>
-</UL>
-<P>
-psnup $B$O<!$N$h$&$K;H$$$^$9!#$h$j>\$7$$$3$H$O%^%K%e%"%k$rFI$s$G2<$5$$!#(B
-</P>
-<DL>
- <DT><KBD>psnup -2 [<VAR>infile</VAR>[<VAR>outfile</VAR>]]</KBD></DT>
- <DD>2 $B%Z!<%8$r(B 1 $B%Z!<%8$K$^$H$a$F0u:~$7$^$9(B</DD>
- <DT><KBD>psnup -4 [<VAR>infile</VAR>[<VAR>outfile</VAR>]]</KBD></DT>
- <DD>4 $B%Z!<%8$r(B 1 $B%Z!<%8$K$^$H$a$F0u:~$7$^$9(B</DD>
- <DT><KBD>psnup -8 [<VAR>infile</VAR>[<VAR>outfile</VAR>]]</KBD></DT>
- <DD>8 $B%Z!<%8$r(B 1 $B%Z!<%8$K$^$H$a$F0u:~$7$^$9(B</DD>
-</DL>
-<P>
-$B$?$@$7!"(Bpsnup $B$G$&$^$/$$$+$J$$(B PostScript $B%U%!%$%k$b$"$j$^$9!#(B
-$B$=$N$h$&$J>l9g$K(B LIPS IV $B$K8B$j!"(B<A HREF="#nup">-dNup $B%*%W%7%g%s(B</A>$B$K$h$j(B 2 $BLL0u:~$H(B 4 $BLL0u:~$,2DG=$G$9!#(B
-$B$7$+$7!"$3$l$OHs8x3+5!G=$r;H$C$F$$$?$j!"0u;zB.EY$,CY$$$H$$$&LdBj$,$"$j$^$9$N$G2DG=$J8B$j(B psnup $B$rMQ$$$^$7$g$&!#(B
-</P>
-<HR>
-<H3><A HREF="#i_psresize" NAME="psresize">$BMQ;f%5%$%:$N3HBg!"=L>.0u:~$r$9$k$K$O$I$&$9$k$s$G$9$+(B?</A></H3>
-<P>
-PSUtils $B$K4^$^$l$k%3%^%s%I(B psresize $B$rMQ$$$^$9!#(B
-</P>
-<P>
-PSUtils $B$O<!$N$H$3$m$+$iF@$i$l$^$9!#(B
-<UL>
- <LI><A HREF="http://www.dcs.ed.ac.uk/home/ajcd/psutils/">&lt;URI:http://www.dcs.ed.ac.uk/home/ajcd/psutils/&gt;</A>
-</UL>
-<P>
-psresize $B$O(B A3$B!&(BA4$B!&(BA5$B!&%l%?!<!&%j!<%,%k$dG$0U$N%5%$%:$KBP1~$7$F$$$^$9!#(B
-$B2<5-$K$$$/$D$+;HMQNc$r5s$2$^$9!#$/$o$7$/$O%^%K%e%"%k$r;2>H$7$F2<$5$$!#(B
-</P>
-<DL>
- <DT><KBD>psresize -q -PA4 -pletter <VAR>in.ps</VAR> &gt; <VAR>out.ps</VAR></KBD></DT>
- <DD>A4 $B%5%$%:$r%l%?!<%5%$%:$K$7$^$9!#(B</DD>
- <DT><KBD>psresize -q -PA3 -pA4 <VAR>in.ps</VAR> &gt; <VAR>out.ps</VAR></KBD></DT>
- <DD>A3 $B%5%$%:$r(B A4 $B%5%$%:$K$7$^$9!#(B</DD>
- <DT><KBD>psresize -q -W729 -H1032 -w516 -h729 <VAR>in.ps</VAR> &gt; <VAR>out.ps</VAR></KBD></DT>
- <DD>B4 $B%5%$%:$r(B B5 $B%5%$%:$K$7$^$9!#(B</DD>
-</DL>
-<P>
-NPDL $BEk:\%W%j%s%?$NCf$K$O;XDj$5$l$?MQ;f$,%[%C%Q(B($B5k;f%+%;%C%H(B)$B$K$J$$>l9g$G!"(B
-$B=L>.0u:~2DG=$JMQ;f%5%$%:$O$"$k>l9g!"=L>.0u:~$5$l$k$b$N$b$"$j$^$9!#(B
-</P>
-<HR>
-<H3><A HREF="#i_offset" NAME="offset">$B0u:~0LCV$rD4@0$9$k$K$O$I$&$7$?$i$$$$$G$9$+(B?</A></H3>
-<P>
-$B0u:~0LCV$,$:$l$F$7$^$&>l9g$O!"<!$NJ}K!$N$&$A$I$l$+$rMQ$$$FD4@0$7$^$9!#(B
-$B$J$*!"(BGhostscript $B$N86E@$OMQ;f$N(B<EM>$B:8>e(B</EM>$B$G$9$N$G(B<EM>$B:8>e(B</EM>$B$+$i$N0u:~0LCV$,$"$&$h$&$KD4@0$7$F$/$@$5$$!#(B
-</P>
-<OL>
- <LI>$B%W%j%s%?$N%Q%M%k@_Dj$N!V=DJd@5!W!V2#Jd@5!W$N5!G=$rMQ$$$k(B
- <LI>Ghostscript $B$N(B PageOffset $B%*%Z%l!<%?$GD4@0$9$k!#(B
-</OL>
-<P>
-$B%W%j%s%?$N%Q%M%k@_Dj$N!V=DJd@5!W!V2#Jd@5!W$N5!G=$rMQ$$$k>l9g!"(BGhostscript $B$NB>$K0u:~$9$k%=%U%H%&%'%"$r;H$&$H$=$N%=%U%H%&%'%"$G$bJd@5$,8z$$$F$7$^$&$N$GCm0U$,I,MW$G$9!#(B
-</P>
-<P>
-Ghostscript $B$G0u:~0LCV$rJQ99$7$?$$>l9g$O!"%U%!%$%k(B /usr/local/etc/offset.ps $B$J$I$HL>A0$r$D$1$?%U%!%$%k$r:n$C$F<!$N$h$&$JFbMF$r5-=R$7$^$9!#(B
-</P>
-<PRE>
-&lt;&lt;
-/PageOffset [0.0 0.0]
-&gt;&gt; setpagedevice
-</PRE>
-<P>
-$B<!$K$3$N%U%!%$%k$N(B [0.0 0.0] $B$H$J$C$F$$$kItJ,$K$:$i$7$?$$D9$5$r5-=R$7$^$9!#(B
-$BC10L$O%]%$%s%H(B(1/72 inch$B!"Ls(B 0.35 mm)$B$G$9!#Nc$($P1&$K(B 3 mm$B!">e$K(B 1.5 mm
-$B0u:~0LCV$r$:$i$7$?$$>l9g$O!"(B
-<PRE>
-3.0 $B!_(B 25.4 $B!`(B 72 $B!a(B 8.5039...
-1.5 $B!_(B 25.4 $B!`(B 72 $B!a(B 4.2519...
-</PRE>
-$B$J$N$G!"(B
-<PRE>
-&lt;&lt;
-/PageOffset [8.5 -4.25]
-&gt;&gt; setpagedevice
-</PRE>
-$B$H5-=R$7$^$9!#(B
-</P>
-<P>
-$B$=$7$F!"(BGhostscript $B$r5/F0$9$k$?$S$K$3$N(B offset.ps $B$r8F$S=P$7$F2<$5$$!#(B
-$BNc$($P<!$N$h$&$K$7$^$9!#(B
-</P>
-<PRE>
-<KBD>gs -q -dSAFER -dNOPAUSE -sDEVICE=lips4 -sOutputFile=- offset.ps -</KBD>
-</PRE>
-<HR>
-<H3><A HREF="#i_bsize" NAME="bsize">B4 $B$^$?$O(B B5 $B%5%$%:$NMQ;f;XDj$,$&$^$/$$$+$J$$$s$@$1$I(B</A></H3>
-<P>
-<A HREF="#install">$B%$%s%9%H!<%k(B</A>$B$N$H$3$m$G=R$Y$i$l$F$$$k$h$&$K!"(Bgs_statd.ps $B$K%Q%C%A$r$"$F$F2<$5$$!#(B
-Ghostscript $BI8=`$N(B B$B%5%$%:$O(B <EM>ISO</EM>$B$N(BB$B%5%$%:$G$"$C$F(B <EM>JIS</EM>$B$N(BB$B%5%$%:$G$O$"$j$^$;$s!#(B
-</P>
-<HR>
-<H3><A HREF="#i_vector" NAME="vector">$B%i%9%?!<HG%G%P%$%9$H%Y%/%?!<HG%G%P%$%9$N0c$$$O(B?</A></H3>
-<P>
-$B%i%9%?!<HG%G%P%$%9$O(B Ghostscript $B$,:n$k!"%Z!<%8$H$[$\F1$8Bg$-$5$N(B1$BKg$N%S%C%H%^%C%W$r0u:~$9$k%G%P%$%9$G$9!#(B
-LIPS $B$NL?Na$H$7$F$O<g$K%i%9%?!<!&%$%a!<%8IA2hL?Na$7$+;H$C$F$$$^$;$s!#(B
-$B$=$l$KBP$7$F%Y%/%?!<HG%G%P%$%9$O$h$j9b5!G=$J(B LIPS $B$NL?Na$r;H$C$F0u:~$9$k%G%P%$%9$G$9!#(B
-$B$=$l$>$l$KD9=j$HC;=j$,$"$k$N$G;H$$J,$1$F2<$5$$!#(B
-</P>
-<P>
-$B%Y%/%?!<HG%G%P%$%9$,(B LIPS $B$NL?Na$H$7$F;H$C$F$$$k$N$O<!$N$H$*$j$G$9!#(B
-</P>
-<UL>
- <LI>$BIA2h>r7o@_Dj(B
- <UL>
- <LI>$B%/%j%C%T%s%0L?Na(B
- <LI>$BIA2hO@M}@_DjL?Na(B
- </UL>
- <LI>$B?^7AIA2hB0@-@_Dj(B
- <UL>
- <LI>$B@~I};XDjL?Na(B
- <LI>$B@~@\B3;XDjL?Na(B
- <LI>$B%^%$%?!&%j%_%C%H;XDjL?Na(B
- <LI>$B@hC<7A>u;XDjL?Na(B
- <LI>$B%i%$%s!&%+%i!<;XDjL?Na(B
- <LI>$BEI$j$D$V$7%+%i!<;XDjL?Na(B
- <LI>$BB?3Q7AIA2h%b!<%I;XDjL?Na(B
- </UL>
- <LI>$B%Q%?!<%sEPO?(B
- <UL>
- <LI>$B@~%Q%?!<%sEPO?L?Na(B2
- </UL>
- <LI>$B?^7AIA2h(B
- <UL>
- <LI>$B6k7AIA2hL?Na(B
- <LI>$BB?3Q7AIA2hL?Na(B2
- </UL>
- <LI>$B%$%a!<%8IA2h(B
- <UL>
- <LI>$B%$%a!<%8NN0h3NJ]L?Na(B1
- <LI>$B%$%a!<%8NN0h3NJ]L?Na(B2
- <LI>$BC1?'%$%a!<%8!&%+%i!<;XDjL?Na(B
- <LI>$B%$%a!<%8IA2hL?Na(B
- </UL>
- <LI>$B%Q%99=C[(B
- <UL>
- <LI>$B%Q%99=C[3+;OL?Na(B
- <LI>$B%Q%99=C[=*N;L?Na(B
- <LI>$B%5%V%Q%93+;OL?Na(B
- <LI>$B%Q%9!&%]%j%i%$%sL?Na(B
- <LI>$B%Q%9!&%/%m!<%:L?Na(B
- </UL>
- <LI>$B%Q%9!&%W%l%$(B
- <UL>
- <LI>$B%Q%9!&%9%H%m!<%/L?Na(B
- <LI>$B%Q%9!&%U%#%kL?Na(B
- <LI>$B%Q%9!&%9%H%m!<%/!&%U%#%kL?Na(B
- <LI>$B%Q%9!&%/%j%C%T%s%0L?Na(B
- <LI>$B%Q%9J?3jEY;XDjL?Na(B
- </UL>
-</UL>
-<P>
-$B>e5-$N$h$&$J5!G=$K$h$C$F%Y%/%?!<HG%G%P%$%9$O%i%9%?!<%G%P%$%9$HHf3S$9$k$H<!$N$h$&$JFCD'$,$"$j$^$9!#(B($BB?>/$NNc30$O$"$j$^$9!#(B)
-</P>
-<UL>
- <LI>$B%W%j%s%?B&$NI,MW%a%b%jNL$,>/$J$/$F$9$`>l9g$,$"$k(B
- <LI>$B05=L$r9T$J$C$F$$$J$$$K$b4X$o$i$:!"%G!<%?NL$,>.$5$$!#(B
- <LI>$B0u:~;~4V$,C;=L$5$l$k>l9g$,$"$k!#FC$K(B lips4 $B$H(B lips4v $B$N%+%i!<=PNO$rHf3S$9$k$H05E]E*$J:9$,$G$k!#(B
- <LI>$B0u;zNN0h$r%a%b%j$K3NJ]$7$J$/$F$$$$$N$G!"(B Ghostscript $B$N5/F0;~4V$,Hs>o$KC;$$!#$^$?(B Ghostscript $B<+BN$N;HMQ%a%b%jNL$b>/$J$$!#(B
- <LI>$B%i%9%?!<HG%G%P%$%9$O0u:~B.EY$NN'B.CJ3,$,(B I/O $B$K$"$k$,!"(B
- $B%Y%/%?!<HG$O%W%j%s%?FbIt$NIA2h%k!<%A%s$K$"$k$?$a!"(B
- $B9bB.$J(B CPU $B$rEk:\$7$F$$$k%W%j%s%?$[$IB.$/$J$k!#(B
-</UL>
-<HR>
-<H3><A HREF="#i_l3vmono" NAME="l3vmono">LIPS IV $B0J30%I%i%$%P$N%Y%/%?!<HG$O:n$i$J$$$N(B?</A></H3>
-<P>
-$B:n$j$^$;$s!#$h$j@53N$K$$$&$H:n$l$^$;$s!#(B
-$B%Y%/%?!<HG%I%i%$%P$r:n$k$?$a$K$O(B PDL $B$,(B PostScript $B$K6a$$5!G=$r$b$C$F(B
-$B$$$J$1$l$P$$$1$^$;$s$,!"(BLIPS II+$B!"(BLIPS III$B!"(BLIPS IVc$B!"(BESC/Page$B!"(BNPDL
-$B$G$O5!G=$,B-$i$J$$$N$G:n$l$J$$$N$G$9!#(B
-</P>
-<HR>
-<H3><A HREF="#i_lbp2030" NAME="lbp2030">lbp2030.dev $B$O$I$3$$$C$?$N(B?</A></H3>
-<P>
-lbp2030.dev $B$O(B lips4.dev $B$N%+%i!<=PNO$H=PNO$9$kFbMF$,F1$8$K$J$C$?$N$GGQ;_$7$^$7$?!#(B
-$B$7$+$7$J$,$i!"(BColor LASER SHOT $B$G=PNO$9$k>l9g$O(B $B%Y%/%H%kHG%G%P%$%9$N(B lips4v.dev
-$B$G=PNO$9$k$[$&$,(B 10 $BG\0J>eB.$$$H;W$$$^$9!#(B
-</P>
-<HR>
-<H3><A HREF="#i_fig" NAME="fig">lips3fig$B!"(Blips4cfig$B!"(Blips4fig $B$,$J$$$s$@$1$I(B</A></H3>
-<P>
-*fig.dev $B$O(B dvipr $B$G$7$+MQ$$$i$l$^$;$s!#$^$?!"(Bdvipr $B<+BN$O$9$G$K;~BeCY$l$N(B
-$B%=%U%H%&%'%"$K$J$j$D$D$"$j$^$9!#(B
-$B$h$C$F%5%]!<%H$7$J$$$3$H$K$7$^$7$?!#(B
-</P>
-<HR>
-<H3><A HREF="#i_lips2p" NAME="lips2p">$B$I$&$7$F(B LIPS II+ $BBP1~%I%i%$%P$O(B lips2+ $B$d(B lips2plus $B$H$$$&L>A0$8$c$J$$$N(B?</A></H3>
-<P>
-Ghostscript $B$G$O%G%P%$%9$NL>A0$O(B1$B$+$i(B8$BJ8;z$H7h$^$C$F$$$^$9!#(B
-$B$^$?!"%"%s%@!<%9%3%"(B(_)$B0J30$N5-9f$O;H$($J$$$3$H$K$J$C$F$$$^$9!#(B
-</P>
-<HR>
-<H2><A HREF="#i_thanks" NAME="thanks">$B<U<-(B</A></H2>
-<P>
-$B0KF#>M@2;a$K$O05=L%k!<%A%sItJ,$NDs6!!"%9!<%Q!<%U%!%$%s(B LIPS $B$N%F%9%H$J$I$r<jEA$C$F$$$?$@$-$^$7$?!#(B
-$B$^$?!"(B<A HREF="#hireso">LIPS IV $B=PNO$K$*$1$k9b2rA|EY0u;z$K4X$9$kCm0U(B</A>$B$b0KF#;a$,=q$+$l$?J8=q$G$9!#(B
-</P>
-<P>
-$BFsLZ5*9T;a$K$O%W%m%0%i%_%s%0>e$NAjCL$K$N$C$F$$$?$@$-$^$7$?!#(B
-$B$^$?%Y%/%?!<HG%G%P%$%9$NIJ<A8~>e$K6(NO$7$F$$$?$@$-$^$7$?!#(B
-</P>
-<P>
-$B@.>>9(;a:n$N(B Ghostscript $B%I%i%$%P(B epag-3.08 $B$N%3!<%I$+$i=PNO%"%k%4%j%:%`ItJ,$HMQ;f%5%$%:7hDjItJ,$rMxMQ$5$;$F$$$?$@$-$^$7$?!#(B
-</P>
-<P>
-$BEOIt=$;a:n$N(B Ghostscript $B%I%i%$%P(B gdevnpdl-1.5 $B$N%3!<%I$r$b$H$K(B npdl $B%I%i%$%P$r:n@.$5$;$F$$$?$@$-$^$7$?!#(B
-</P>
-<P>
-$B:XF#1QIW;a$N(B Ghostscript $B%I%i%$%P(B gdevnpdl-1.5 $B$X$N(B $BN>LL0u:~BP1~%Q%C%A$rMxMQ$5$;$F$$$?$@$-$^$7$?!#(B
-</P>
-<P>
-$B$3$N%=%U%H%&%'%"$N2~A1$K4X$7$F!"0J2<$NJ}!9$+$i5.=E$J0U8+$r$$$?$@$-$^$7$?!#(B
-</P>
-<P>
-$BB@EDK'I'!"@P4]E/Li!";38}0lO:!"0KF#D>;K!"C]LnLP<#!"7'C+@5O/!";3Fb?N!"(B $B;{@n0&0u!";04d9,IW!"[X3@>-OB(B($B7I>NN,(B)
-</P>
-<HR>
-<H2><A HREF="#i_reference" NAME="reference">$B;29MJ88%(B</A></H2>
-<OL>
- <LI>PostScript Language Reference Manual SECOUND EDITION, Adobe Systems Incorporated
- <LI>LASER SHOT $B%W%m%0%i%^!<%:%^%K%e%"%k(B $B%=%U%H%&%'%"35@b=q(B 4.1, Canon
- <LI>LASER SHOT $B%W%m%0%i%^!<%:%^%K%e%"%k(B $B%=%U%H%&%'%"35@b=q(B 4.2, Canon
- <LI>LASER SHOT $B%W%m%0%i%^!<%:%^%K%e%"%k(B $B%3%^%s%I%j%U%!%l%s%9(B 4.1, Canon
- <LI>LASER SHOT $B%W%m%0%i%^!<%:%^%K%e%"%k(B $B%3%^%s%I%j%U%!%l%s%9(B 4.2, Canon
- <LI>LASER SHOT $B%W%m%0%i%^!<%:%^%K%e%"%k(B $B%/%C%/%V%C%/(B 4.1, Canon
- <LI>LASER SHOT $B%W%m%0%i%^!<%:%^%K%e%"%k(B $B%/%C%/%V%C%/(B 4.2, Canon
- <LI>ESC/Page $B%j%U%!%l%s%9%^%K%e%"%k(B $BBh(B4$BHG(B, EPSON
- <LI>EPSON Remote $B%b!<%I(B(P) $B%j%U%!%l%s%9%^%K%e%"%k(B, EPSON
- <LI>$BF|K\8l%Z!<%8%W%j%s%?8@8l(B NPDL(Level2) $B%j%U%!%l%s%9%^%K%e%"%k(B
- (PC-PRNPDL2-RM Rev.02), NEC
-</OL>
-<HR>
-<P>
-<!-- hhmts start -->
-Last modified: Tue Jun 22 03:26:59 JST 1999
-<!-- hhmts end -->
-</P>
-<ADDRESS>
-$B@iMUBg3XLt3XItLtIJJ*M}2=3X8&5f<<(B $BBg?95*?M(B
-<A HREF="mailto:ohmori@p.chiba-u.ac.jp">&lt;URI:mailto:ohmori@p.chiba-u.ac.jp&gt;</A>
-</ADDRESS>
-</BODY>
-</HTML>
diff --git a/gs/contrib/japanese/doc/README.gs550j b/gs/contrib/japanese/doc/README.gs550j
deleted file mode 100644
index 55c63bc12..000000000
--- a/gs/contrib/japanese/doc/README.gs550j
+++ /dev/null
@@ -1,35 +0,0 @@
-GNU Ghostscript version 5.50 ÆüËܸ첽¥Ñ¥Ã¥Á gs550j
-Version 0.3 Jun. 22, 1999 by Â翹µª¿Í (ohmori@p.chiba-u.ac.jp)
-Copyright (C) 1996-1999 Daisuke SUZUKI.
-Copyright (C) 1999 Norihito Ohmori.
-
-¡ü¤Ï¤¸¤á¤Ë
-
-¤³¤Î¥Ñ¥Ã¥Á¤ÏÊÒ»³µªÀ¸(katayama@nacsis.ac.jp)¤µ¤ó¤ÎºîÀ®¤µ¤ì¤¿¡¢
-ghostscript-2.6.1 ÆüËܸ첽¥Ñ¥Ã¥±¡¼¥¸¤Î¥É¥é¥¤¥Ð¤È¡¢ÞÉ»³ÏÂŵ¤µ¤ó¤Î
-ºîÀ®¤µ¤ì¤¿ ÆüËܸì Font Driver on VFlib version 1.0 ¤ò ghostscript 5.50 ¤Ë
-Âбþ¤µ¤»¤¿ ÅÄÃæů <akr@jaist.ac.jp> ¤µ¤ó¤Î gs5.50-vflib-1.1
-¤ò´ðËÜÉôʬ¤ËÍøÍѤ·¡¢¤¤¤¯¤Ä¤«¤Î¥Ñ¥Ã¥Á¤ò¤¢¤Æ¡¢Â¿¤¯¤Î¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð·²¤ò
-Ʊº­¤·¤¿¤â¤Î¤Ç¤¹¡£
-
-
-¡üChanges
-¡¦gs550j03
- gdevlips-2.3.3 (Update for lips4v.dev bugfix)
-¡¦gs550j02
- gdevlbp3-0.2 (Update)
-¡¦gs550j01
- ºÇ½é¤Î¥ê¥ê¡¼¥¹
-
-
-¡üºÇ¸å¤Ë
-
-¤³¤Î¥Ñ¥Ã¥Á¤Ë´Ø¤¹¤ëÃøºî¸¢¤½¤Î¾¤Ï GPL ¤Ë½¾¤¤¤Þ¤¹¡£
-¤Þ¤¿¡¢¤³¤Î¥Ñ¥Ã¥Á¤Ï̵ÊݾڤǤ¹¡£¤³¤ì¤ò»È¤Ã¤¿¤³¤È¤Ë¤è¤ê¤Ê¤ó¤é¤«¤ÎÉÔ¶ñ¹ç¤¬
-ȯÀ¸¤·¤¿¤È¤·¤Æ¤âºî¼Ô¤Ï¤Ê¤ó¤é¤ÎÀÕǤ¤âÉ餤¤Þ¤»¤ó¡£
-
-
-¡ü¼Õ¼­
-
-³Æ¥É¥é¥¤¥Ð¤ò¸ø³«¤·¤Æ夤¤¿ºî¼Ô¤Î³§Íͤ˴¶¼Õ¤·¤Þ¤¹¡£
-¤Þ¤¿¡¢¥Æ¥¹¥È¤ò¤·¤Æ¤¯¤À¤µ¤Ã¤¿³§ÍÍ¡¢ËÜÅö¤Ë¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
diff --git a/gs/contrib/japanese/doc/cdj880.txt b/gs/contrib/japanese/doc/cdj880.txt
deleted file mode 100644
index 1b425f236..000000000
--- a/gs/contrib/japanese/doc/cdj880.txt
+++ /dev/null
@@ -1,120 +0,0 @@
-Patched Ghostscript driver for HP DeskJet 880C/882C and 895C printers.
-
-Matthew J. Gelhaus (mgelhaus@proaxis.com)
-Updated March 30, 1999
-
-****************************************************
-* Ãí°Õ: *
-* cdj880 ¤Ë¤Ä¤¤¤Æ¤Î¤ß¼¡¤Î¤è¤¦¤ÊÊѹ¹¤ò¤·¤Æ¤¢¤ê¤Þ¤¹¡£*
-* 1. Time out Error ¤¬½Ð¤Ê¤¤¤è¤¦¤·¤¿¡£ *
-* 2. -r ¥ª¥×¥·¥ç¥ó¤Ç²òÁüÅÙ¤¬Êѹ¹¤Ç¤­¤ë¤è¤¦¤Ë¤·¤¿¡£ *
-* (¤è¤Ã¤Æ -dQuality ¥ª¥×¥·¥ç¥ó¤Ï»ÈÍѤǤ­¤Þ¤»¤ó¡£) *
-* *
-* Â翹µª¿Í <ohmori@p.chiba-u.ac.jp> *
-****************************************************
-
-This package is based very heavily on the work of Uli Wortmann
-(uli@bonk.ethz.ch), and I do not claim to be the original author of very
-much of this code. Uli has done a tremendous amount of excellent work, and
-this package is a modification to his driver by me to add the ability to print
-to the DeskJet 880C, 882C, and 895C printers. Under the terms of the GNU
-General Public License (see LICENSING TERMS below), I am distributing this
-package under the same license.
-
-Please also see the file readme.hp8 for Uli's notes about the package.
-
-It is my intent to submit this work as a patch to Uli Wortmann for inclusion
-in the original HP850C driver package.
-
-LICENSING TERMS:
-
- Copyright (C) 1999 <Matthew J. Gelhaus mgelhaus@proaxis.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- To view the General Public License in its entirety, check the file
- LICENSE.
-
-DISCLAIMER:
-
-This is a work still under development, and as such I do not guarantee
-it will work (see LICENSING TERMS above). However, please send bug
-reports to me (mgelhaus@proaxis.com), along with as much information
-as you can.
-
-SYSTEM REQUIREMENTS:
-
-This package is designed to work with Aladdin Ghostscript 5.50 (available
-from ftp://ftp.cs.wisc.edu/ghost/aladdin/gs550/). It may work with earlier
-versions of Ghostscript, but I have not tested it. You can follow the
-directions included to compile Ghostscript, but here are is a condensed
-version that worked for me:
-
-INSTALLATION INSTRUCTIONS:
-
-1. Obtain the files
-
- ghostscript-5.50.tar.gz 2826251 bytes
- jpegsrc.v6b.tar.gz 613261 bytes
- libpng-1.0.2.tar.gz 225386 bytes
- zlib-1.1.3.tar.gz 168463 bytes
- ghostscript-fonts-std-5.50.tar.gz 1444863 bytes
-
-2. Create a directory to perform the build in, for example,
- /usr/local/src/gs. Unpack each of the files into this directory:
-
- $ cd /usr/local/src
- $ mkdir gs ; cd gs
- $ tar zxvf $HOME/ghostscript-5.50.tar.gz
- $ tar zxvf $HOME/jpegsrc.v6b.tar.gz
- $ tar zxvf $HOME/libpng-1.0.2.tar.gz
- $ tar zxvf $HOME/zlib-1.1.3.tar.gz
-
-3. Copy all the files from this driver package into the ghostscript
- directory. For example,
-
- $ cp $HOME/hp850C-880p/* /usr/local/src/gs/gs5.50/
-
- This will overwrite the files contrib.mak and makefile. This is OK.
-
-4. If desired, edit the makefile. This should only be necessary if you
- want to build a ghostscript binary that uses your existing PNG and
- ZLIB libraries dynamically. Normally ghostscript compiles these in
- statically. Note that you still need to download the sources to those
- libraries (as listed in step 1) even if you want to link dynamically.
-
-5. There is a bug (I think) in the ghostscript source. If during the make
- it fails to build due to a missing "arch.h" in the file std.h, you can
- fix it by changing line 28 of std.h from
-
- #include "arch.h"
-
- to
-
- #include "obj/arch.h"
-
-6. Type 'make'.
-
-7. Type 'make install' (as root).
-
-7. To specify the 880C/882C/895C driver, use -sDEVICE=cdj880:
-
- $ gs test.ps -sDEVICE=cdj880 -dNOPAUSE -dSAFER -sOutputFile=- | lpr
-
-
-Please, please, please report any bugs to me at mgelhaus@proaxis.com. This
-includes installation instruction bugs, because I was doing this from
-memory!
-
diff --git a/gs/contrib/japanese/doc/dj505j.txt b/gs/contrib/japanese/doc/dj505j.txt
deleted file mode 100644
index 15155e0e8..000000000
--- a/gs/contrib/japanese/doc/dj505j.txt
+++ /dev/null
@@ -1,62 +0,0 @@
-¢£ ¢£
-¢£ Ghostscript 5.10 ¢£
-¢£ DeskJet 505J ¥É¥é¥¤¥Ð ¢£
-¢£ ¢£
-
- Â翹µª¿Í
- ohmori@p.chiba-u.ac.jp
-
-¢¨¤Û¤È¤ó¤É¤³¤Î¥É¥­¥å¥á¥ó¥È¤Ï¥ª¥ê¥¸¥Ê¥ë¤Î¤Þ¤Þ¤Ç¤¹¡£
-
- ¥ª¥ê¥¸¥Ê¥ë(Ghostscript 2.6.1 DeskJet 505J ¥É¥é¥¤¥Ð)¤Îºî¼Ô¤µ¤ó
- ÞÉ»³ ÏÂŵ
- TPM03937@pcvan.or.jp
- GHF01532@niftyserve.or.jp
-
-
-========================================================================
-¡ü £±¡¥ ¤Ï¤¸¤á¤Ë
-========================================================================
-
- Ghostscript 5.10 ¤ËÉÕ°¤Î DeskJet Íѥɥ饤¥Ð (gdevcdj.c) ¤Ë¼ê¤ò²Ã¤¨¤Æ
-Hewlett Packard ¼Ò¤Î DeskJet 505J (Plus) ÍѤΥɥ饤¥Ð¤òÄɲä·¤¿¤â¤Î¤Ç¤¹¡£
-¥«¥é¡¼°õºþ¤â²Äǽ¤Ç¤¹¡£
-
-========================================================================
-¡ü £²¡¥ Áȹþ¤ß
-========================================================================
-
- ¼¡¤Î¼ê½ç¤ÇÁȤ߹þ¤ß¤Þ¤¹¡£
-
-(1) gdevcdj.c ¤Ë¥Ñ¥Ã¥Á gdevcdj.dif ¤òÅö¤Æ¤ë¡£
-(2) gdev505j.mak ¤ò makefile ¤ËÄɲ乤롣
-(3) makefile ¤Î DEVICE_DEVS(¤Þ¤¿¤Ï DEVICE_DEVS1¡ÁDEVICE_DEVS9 ¤Î²¿¤ì¤«)
- ¤Ë dj505j.dev ¤òÄɲ乤롣
-(4) make ¤ò¼Â¹Ô¤¹¤ë¡£
-
-========================================================================
-¡ü £³¡¥ »È¤¤Êý
-========================================================================
-
- ¥â¥Î¥¯¥í°õ»ú¤Î¾ì¹ç¤Ï¾¤Î¥É¥é¥¤¥Ð¤ÈƱÍͤǤ¹¡£¥ª¥×¥·¥ç¥ó
-"-sDEVICE=dj505j" ÉÕ¤­¤Ç gs ¤òµ¯Æ°¤·¤Æ¤¯¤À¤µ¤¤¡£
-
- ¥«¥é¡¼°õ»ú¤Ï¡¢gs ¤Îµ¯Æ°¥ª¥×¥·¥ç¥ó¤Ë "-dBitsPerPixel=3" ¤òÄɲä·¤Þ¤¹¡£
-
- ¾Ü¤·¤¯¤Ï Ghostscript 5.10 ¤ÎÇÛÉۤ˴ޤޤì¤ë devices.txt ¤Î DeskJet ·Ï
-¥É¥é¥¤¥Ð¤Î»È¤¤Êý¤ÎÀâÌÀ¤ò¤´Í÷¤¯¤À¤µ¤¤¡£
-
-========================================================================
-¡ü £´¡¥ È÷¹Í
-========================================================================
-
- ¥«¥é¡¼°õºþ¤Î¾ì¹ç¡¢Á´ÂÎŪ¤Ë¿§¤¬ÎФ¬¤«¤ê¤Þ¤¹¤¬¡¢¤³¤ì¤Ï DeskJet ¤Î¥«¥é¡¼
-¥¤¥ó¥¯¤ÎÆÃÀ­¤Ç¤¹¡£DeskJet 505J ¤Ï CMY ¤Ë¤è¤ë 3 ¿§ºþ¤ê¤Ç¤¹¡£¤³¤Î¤¿¤á CMYK
-¤Î 4 ¿§ºþ¤ê¤ËÈæ¤Ù¤Æ¹õ¤¬¤­¤ì¤¤¤Ë½Ð¤Þ¤»¤ó¡£
-
- ¥«¥é¡¼°õºþ¤Ï¿¤¯¤Î¥á¥â¥ê¤òɬÍפȤ·¤Þ¤¹¡£1 pixel Åö¤¿¤ê 1byte ¤Î¥Õ¥ì¡¼
-¥à¥Ð¥Ã¥Õ¥¡¤ò³ÎÊݤ¹¤ë¤¿¤á¤Ç¤¹¤¬¡¢¤³¤Î¥É¥é¥¤¥Ð¤ËɬÍפʥá¥â¥ê¤Î¾¤Ë gs ËÜÂÎ
-¤ÎÆ°ºî¤ËɬÍפʥá¥â¥ê¤â¤¢¤ê¤Þ¤¹¤«¤é¡¢A4 ¥µ¥¤¥º¤Î½ÐÎϤò¹Ô¤¦¤¿¤á¤Ë¤Ï 10 ¿ô
-MB ¤Î¥á¥â¥ê¤¬É¬ÍפǤ¹¡£
-
-=========================== End of document ============================
diff --git a/gs/contrib/japanese/doc/djgpp.txt b/gs/contrib/japanese/doc/djgpp.txt
deleted file mode 100644
index 64e7fd337..000000000
--- a/gs/contrib/japanese/doc/djgpp.txt
+++ /dev/null
@@ -1,510 +0,0 @@
-¢£ ¢£
-¢£ Ghostscript 2.6.1 DJ's GPP ²½¥Ñ¥Ã¥±¡¼¥¸ ¢£
-¢£ version 1.3 ¢£
-¢£ ¢£
-¢£ Copyright (C) 1993,1994 ÞÉ»³ÏÂŵ ¢£
-¢£ TPM03937@pcvan.or.jp ¢£
-¢£ GHF01532@niftyserve.or.jp ¢£
-¢£ ¢£
-
-========================================================================
-¡ü £±¡¥ ¥Ñ¥Ã¥±¡¼¥¸ÆâÍÆ
-========================================================================
-
- ¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ë¤Ï°Ê²¼¤Î¥Õ¥¡¥¤¥ë¡¢¥Ç¥£¥ì¥¯¥È¥ê¤¬´Þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£¤³¤ì¤é
-¤ÎÃæ¤Ë¤Ï¡¢µ¡¼ï¡¦OS ¤Ë°Í¸¤»¤º¤Ë»È¤¨¤ë¥Õ¥¡¥¤¥ë¤â´Þ¤Þ¤ì¤Æ¤¤¤Þ¤¹ (¸å½Ò)¡£
-
- COPYING ¡¦GNU General Public License (GNU GPL)
- djgpp.sj ¡¦¤³¤Î¥Õ¥¡¥¤¥ë
- djgpp.mak ¡¦Makefile
- djgpp.dif ¡¦Ghostscript 2.6.1¥ª¥ê¥¸¥Ê¥ë¤Î¥³¡¼¥É¤ËÂФ¹¤ëº¹Ê¬
- gp_djgpp.c ¡¦DJ's GPP´Ä¶­°Í¸¤Î¥³¡¼¥É
- djgpp.h ¡¦Æ±¾å
- gp_djgpp.h ¡¦Æ±¾å
- gp_pc98.c ¡¦NEC PC-9801/PC-H98°Í¸¤Î¥³¡¼¥É
- gp_pcat.c ¡¦IBM PC/AT¸ß´¹µ¡°Í¸¤Î¥³¡¼¥É
- gs_djgpp.tr ¡¦¥ê¥ó¥«ÍѤΥ쥹¥Ý¥ó¥¹¥Õ¥¡¥¤¥ë
- gp_djgpp.ps ¡¦DJ's GPP´Ä¶­¤Î½é´ü²½PS¥Õ¥¡¥¤¥ë
- gp_site.ps ¡¦DJ's GPP´Ä¶­¤Î´Ä¶­ÀßÄê¥Õ¥¡¥¤¥ë
- gssetdjg.bat ¡¦Makefile ¤«¤é¸Æ¤Ó½Ð¤¹¥Ð¥Ã¥Á¥Õ¥¡¥¤¥ë
- gdevgppr.h ¡¦¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð¤òDJ's GPPÂбþ¤¹¤ë¤¿¤á¤Î¥Ø¥Ã¥À
- zkfpc98.c ¡¦NEC PC-9801/PC-H98 ´Á»úROM¥Õ¥©¥ó¥È¥É¥é¥¤¥Ð¤Î¥½¡¼¥¹
- zkfvflib.c ¡¦VFlib¤ò»ÈÍѤ¹¤ë¥Õ¥©¥ó¥È¥É¥é¥¤¥Ð
- zkfvflib.mak ¡¦Æ±¾å
- kfvflib.sj ¡¦VFlib»ÈÍѤΥե©¥ó¥È¥É¥é¥¤¥Ð¤Î¥É¥­¥å¥á¥ó¥È
- drivers/ ¡¦³Æ¼ï¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤¬¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê
- |---gdev10v/ ¡¦ÆüËܸ첽¥Ñ¥Ã¥±¡¼¥¸ÉÕ°¤Î Canon BJ10V ¥É¥é¥¤¥Ð¤Ø¤Î
- | º¹Ê¬
- |---gdev98hf/ ¡¦¥Ç¥¸¥¿¥ë¥¢¡¼¥Ä¼Ò Hyper-Frame+ Íѥե륫¥é¡¼¡¦¥Ç¥£¥¹
- | ¥×¥ì¥¤¥É¥é¥¤¥Ð
- |---gdevcdj/ ¡¦¥ª¥ê¥¸¥Ê¥ë¥Ñ¥Ã¥±¡¼¥¸¤ËÉÕ°¤Î HP DeskJet¥·¥ê¡¼¥ºÍÑ
- | ¤Î¥É¥é¥¤¥Ð¤ò DeskJet 505J ¤ËÂбþ¤µ¤»¤ë¤¿¤á¤Îº¹Ê¬
- |---gdevdjgp/ ¡¦IBM PC / AT¸ß´¹µ¡ ¤Î¥Ç¥£¥¹¥×¥ì¥¤¥É¥é¥¤¥Ð
- |---gdevdmpr/ ¡¦ÈÆÍÑ¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð
- |---gdevlips/ ¡¦ÆüËܸ첽¥Ñ¥Ã¥±¡¼¥¸ÉÕ°¤Î LIPS ¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð¤Ø¤Î
- | º¹Ê¬
- |---gdevmag/ ¡¦Ëî¥Õ¥©¡¼¥Þ¥Ã¥È¤Î²èÁü¥Ç¡¼¥¿¤ò½ÐÎϤ¹¤ë¤¿¤á¤Î¥É¥é¥¤¥Ð
- |---gdevp201/ ¡¦ÆüËܸ첽¥Ñ¥Ã¥±¡¼¥¸ÉÕ°¤Î NEC PC-PR 201 ¥É¥é¥¤¥Ð¤ò
- | PC-PR 150 / PC-PR 1000 / PC-PR 1000/4 ¤ËÂбþ¤µ¤»¤ë
- | ¤¿¤á¤Îº¹Ê¬
- +---gdevpc98/ ¡¦NEC PC-9801 / H98 ¤Î¥Ç¥£¥¹¥×¥ì¥¤¥É¥é¥¤¥Ð
- kanji/ ¡¦DJ's GPPÈǸÇÍ­¤Î´Á»ú½é´ü²½¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê
-
-
-========================================================================
-¡ü £²¡¥ ¤Ï¤¸¤á¤Ë
-========================================================================
-
- ¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ï Ghostscript version 2.6.1 ¤ò DJ's GPP ¤Ç¥³¥ó¥Ñ¥¤¥ë¤·¡¢
-NEC PC-9801/PC-H98¡¢IBM PC/AT ¸ß´¹µ¡¤ÇÍøÍѤǤ­¤ë¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Î¥Ñ¥Ã¥±¡¼
-¥¸¤Ç¤¹¡£
-
- ºîÀ®¤µ¤ì¤ë¥Ð¥¤¥Ê¥ê¤ÏÁ´µ¡¼ï¶¦Ä̤Ǥ¹¡£µ¡¼ï¤Ï¼«Æ°È½Ê̤µ¤ì¤Þ¤¹ (¥æ¡¼¥¶¤¬Ä¾
-Àܵ¡¼ï¤ò»ØÄꤹ¤ë¤³¤È¤â²Äǽ¤Ç¤¹)¡£
-
- ¤Þ¤¿ÊÒ»³µªÀ¸¤µ¤ó¤Ë¤è¤ëÆüËܸ첽¥Ñ¥Ã¥±¡¼¥¸ 1.0 ¤ÈÊ»ÍѤ¹¤ë¤³¤È¤òÁ°Äó¤È¤·
-¤Æ¤¤¤Þ¤¹¤¬¡¢Makefile ¤ò½ñ¤­´¹¤¨¤ì¤ÐÆüËܸ첽¤µ¤ì¤Æ¤¤¤Ê¤¤¤â¤Î¤â¥³¥ó¥Ñ¥¤¥ë
-²Äǽ¤Ç¤¹¡£
-
-
-========================================================================
-¡ü £³¡¥ µ¡¼ï¡¦OS°Í¸À­¤Ë´Ø¤·¤Æ
-========================================================================
-
- ¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤â¤Î¤Î¤¦¤Á¡¢°Ê²¼¤Î¤â¤Î¤ò½ü¤¤¤Æµ¡¼ï¤ä OS ¤Ë
-´Ø·¸¤Ê¤¯¤½¤Î¤Þ¤Þ»ÈÍѤ¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
-
- ¡¦ gp_djgpp.c gp_pc98.c gp_pcat.c gp_djgpp.h djgpp.h
- ¤³¤ì¤Ï¥×¥é¥Ã¥È¥Õ¥©¡¼¥à°Í¸¤Î¥³¡¼¥É (¤³¤³¤Ç¤Ï DJ's GPP+GO32 ÍÑ) ¤ò
- ÄêµÁ¤·¤¿¥Õ¥¡¥¤¥ë¤Ç¤¹¡£Ghostscript ¤Î¥ª¥ê¥¸¥Ê¥ë¥Ñ¥Ã¥±¡¼¥¸¤Ë¤Ï³Æ´Ä¶­ÍÑ
- ¤Î¤â¤Î¤¬ÍÑ°Õ¤µ¤ì¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢GO32 ´Ä¶­°Ê³°¤Î¤«¤¿¤Ï¤½¤Á¤é¤òÍøÍѤ·¤Æ
- ¤¯¤À¤µ¤¤¡£
- ¡¦ djgpp.mak djgpp.dif
- DJ's GPP ¤Ç¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤¿¤á¤Îº¹Ê¬¤È makefile ¤Ç¤¹¡£
- ¡¦ gp_djgpp.ps gp_site.ps
- ¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤ò»È¤Ã¤Æ DJ's GPP ¤Ç¥³¥ó¥Ñ¥¤¥ë¤·¤¿¼Â¹Ô·Á¼°¤Î¤¿¤á¤Î½é
- ´ü²½¥Õ¥¡¥¤¥ë¤Ç¤¹¡£
- ¡¦ gdevdjgp/ gdevpc98/ gdev98hf/
- ¥Ç¥£¥¹¥×¥ì¥¤¥É¥é¥¤¥Ð³Æ¼ï¡£µ¡¼ï°Í¸¤Ç¤¹¡£
-
-
-========================================================================
-¡ü £´¡¥ ¥³¥ó¥Ñ¥¤¥ë¤ÎÊýË¡
-========================================================================
-
- ¼¡¤Î¼ê½ç¤Ç¥³¥ó¥Ñ¥¤¥ë¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-(1) ¥ª¥ê¥¸¥Ê¥ë¤Î¥½¡¼¥¹¤Î¥¢¡¼¥«¥¤¥Ö¤òŸ³«¤¹¤ë¡£°Ê²¼¤Îºî¶È¤Ï¡¢¤³¤Îºî¶È¤Ë¤è
- ¤Ã¤Æºî¤é¤ì¤ë./gs261 ¤È¤¤¤¦¥Ç¥£¥ì¥¯¥È¥ê¤Ë°Ü¤Ã¤Æ¹Ô¤¤¤Þ¤¹¡£
-
-(2) ¥Ð¥°¥Õ¥£¥¯¥¹º¹Ê¬¤òÅö¤Æ¤Þ¤¹¡£
-
-(3) ¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ëµÚ¤ÓÆüËܸ첽¥Ñ¥Ã¥±¡¼¥¸¤Î¥Õ¥¡¥¤¥ë
- ¤ò¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥³¥Ô¡¼¤·¤Þ¤¹¡£
-
-(4) ¥Ñ¥Ã¥Á djgpp.dif¡¢µÚ¤ÓÆüËܸ첽º¹Ê¬¤ò¤¢¤Æ¤Þ¤¹ (½ç½ø¤ÏÌä¤ï¤Ê¤¤)¡£
- djgpp.dif ¤Ï genconf.c ¤ª¤è¤Ó ps2epsi.ps ¤ËÂФ¹¤ëº¹Ê¬¤Ç¤¹¡£
-
- ÆüËܸ첽¤ò¹Ô¤ï¤Ê¤¤¾ì¹ç¤Ë¤Ï djgpp.dif ¤À¤±¤òŬÍѤ·¤Æ¤¯¤À¤µ¤¤¡£
-
- patch < gs261j.dif
- patch < djgpp.dif
-
-
- ¢¨¥Ñ¥Ã¥Á¤¬¤¦¤Þ¤¯Åö¤¿¤é¤Ê¤¤¾ì¹ç¡£
-
- Ghostscript ¥ª¥ê¥¸¥Ê¥ë¤Î¥Õ¥¡¥¤¥ë (¥Ð¥°½¤Àµº¹Ê¬¤ò´Þ¤à)¡¢ÆüËܸì
- ²½¥Ñ¥Ã¥Á (gs261j.diff)¡¢DJ's GPP Âбþ¥Ñ¥Ã¥Á (djgpp.dif)¡¢¤ÏÁ´
- ¤Æ UN*X ·Á¼°¤Î²þ¹Ô¥³¡¼¥É (Line Feed ¤Î¤ß) ¤Ç¤¹¡£MS-DOS ÈǤÎ
- patch.exe ¤Ç¤Ï¡¢¤½¤Î¥Ý¡¼¥Æ¥£¥ó¥°¤Ë¤è¤Ã¤Æ¤Ï¤¦¤Þ¤¯¥Ñ¥Ã¥Á¤¬Åö¤¿¤é
- ¤Ê¤¤¤³¤È¤¬¤¢¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-
- ¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ï¡¢Áí¤Æ¤Î¥Õ¥¡¥¤¥ë¤Î²þ¹Ô¥³¡¼¥É¤ò MS-DOS ·Á¼°
- (Carriage Return + Line Feed) ¤ËÊѹ¹¤·¤Æ¤«¤é patch.exe ¤ò»È¤¦
- ¤«¡¢¤¢¤ë¤¤¤Ï UN*X ¾å¤Ç¥Ñ¥Ã¥Á¤òÅö¤Æ¤ë¤È¤³¤í¤Þ¤Ç¤Îºî¶È¤ò¹Ô¤Ã¤Æ¤½
- ¤ì¤«¤é MS-DOS ¾å¤Ë¥Õ¥¡¥¤¥ë¤ò»ý¤Ã¤Æ¤­¤Æ°Ê²¼¤Îºî¶È¤ò¹Ô¤Ê¤Ã¤Æ¤¯¤À
- ¤µ¤¤¡£
-
-(5) ÆüËܸ첽¥Ñ¥Ã¥±¡¼¥¸¡¢¤Þ¤¿¤Ï¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤ËÉÕ°¤·¤Æ¤¤¤ë¥Ç¥Ð¥¤¥¹¥É¥é¥¤
- ¥Ð¤òÁȤ߹þ¤à¾ì¹ç¤Ë¤Ï¡¢¤½¤ì¤ò¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥³¥Ô¡¼¤¹¤ë (¤³¤ì¤é
- ¤Î¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤Ï¥Ç¥£¥ì¥¯¥È¥ê drivers ¤Ë¤¢¤ê¤Þ¤¹)¡£
-
- ÆüËܸ첽¥Ñ¥Ã¥±¡¼¥¸¤ËÉÕ°¤Î¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð¤Î¤Ê¤«¤Ë¤Ï¤µ¤é¤Ëº¹Ê¬¤òÅö¤Æ
- ¤ëɬÍפ¬¤¢¤ë¤â¤Î¤¬¤¢¤ê¤Þ¤¹¡£¤Þ¤¿¥ª¥ê¥¸¥Ê¥ë¤Î¥Ñ¥Ã¥±¡¼¥¸¤ËÉÕ°¤Î¥×¥ê¥ó
- ¥¿¥É¥é¥¤¥Ð¤òÁȤ߹þ¤à¤¿¤á¤Ë¤ÏÁ°½èÍý¤¬É¬ÍפǤ¹¡£
-
- ¾Ü¤·¤¯¤Ï¤³¤Î¥É¥­¥å¥á¥ó¥È¤Î¡Ö¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð¤ÎÁȹþ¤ß¡×¤ò¤´Í÷¤¯¤À¤µ¤¤¡£
-
- ¤Ê¤ª¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤ËÉÕ°¤Î¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð¡¦¥Ç¥£¥¹¥×¥ì¥¤¥É¥é¥¤¥Ð¤ÏÁ°
- ½èÍý¤Ê¤·¤Ç¤½¤Î¤Þ¤ÞÁȤ߹þ¤á¤Þ¤¹¡£
-
-(6) djgpp.mak ¤òÊÔ½¸¤¹¤ë¡£
-
- DJ's gpp ´Ä¶­¤Î Makefile ¤Ï djgpp.mak ¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤Ç¤¹¡£¤³¤ÎÃæ¤Î°Ê
- ²¼¤Î¥Þ¥¯¥í¤ò½ñ¤­´¹¤¨¤Þ¤¹¡£
-
- (A)
- DJGPP_PLATFORMS= ...
-
- ¥×¥ê¥ó¥¿½ÐÎϥ롼¥Á¥ó¤Ê¤É¤Îµ¡¼ï°Í¸¥³¡¼¥É¤ò¤É¤Îµ¡¼ïÍѤΤâ¤Î¤òÁȤß
- ¹þ¤à¤«¤ò»ØÄꤷ¤Þ¤¹¡£¼ç¤Ë¥×¥ê¥ó¥¿½ÐÎÏ´Ø·¸¤Î¥³¡¼¥É¤Ç¤¹¡£¥Ç¥£¥¹¥×¥ì
- ¥¤½ÐÎϤ˴ؤ·¤Æ¤Ï¤³¤ì¤È¤ÏÊÌ¤Ë DEVICE_DEVS ¤Ç»ØÄꤷ¤Þ¤¹¡£NEC
- PC-9801¡¢IBM PC/AT ¸ß´¹µ¡ÍѤΥץê¥ó¥¿½ÐÎϥ롼¥Á¥ó¤¬ÍÑ°Õ¤µ¤ì¤Æ¤¤
- ¤Þ¤¹¡£
-
- pc98_¡¢pcat_ ¤«¤éÁª¤Ó¤Þ¤¹¡£Î¾Êý¤ò»ØÄꤹ¤ë¤³¤È¤â²Äǽ¤Ç¤¹¡£¤³¤Î¥Ñ
- ¥Ã¥±¡¼¥¸¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë djgpp.mak ¤Ç¤ÏξÊý¤òÁȤ߹þ¤à¤è¤¦¤Ë¤·¤Æ¤¢
- ¤ê¤Þ¤¹¡£
-
- ¤³¤Î»ØÄê¤ò¶õ¤Ë¤·¤Æ¤ª¤¯¤Èµ¡¼ï°Í¸¥³¡¼¥É¤òÁȤ߹þ¤Þ¤ºÁ´¤Æ¤Î¥×¥ê¥ó¥¿
- ¥³¡¼¥É¤Ïɸ½à¥×¥ê¥ó¥¿½ÐÎÏ ("PRN") ·Ðͳ¤Ç½ÐÎϤµ¤ì¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£
-
- (B)
- FEATURE_DEVS= ...
-
- ´Á»ú¥Õ¥©¥ó¥È¥É¥é¥¤¥Ð¤òÄɲä·¤¿¤¤¾ì¹ç¤Ë¤Ï¤³¤³¤Ë½ñ¤­²Ã¤¨¤Þ¤¹¡£
-
- ¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ë´Þ¤Þ¤ì¤ë djgpp.mak ¤Ç¤Ï¡¢½ñÂζæ³ÚÉô¥Õ¥©¥ó¥È¡¢JG
- ¥Õ¥©¥ó¥È¡¢NEC PC-9801 ROM ¥Õ¥©¥ó¥È¡¢¤òÍøÍѤ¹¤ë´Á»ú¥Õ¥©¥ó¥È¥É¥é¥¤
- ¥Ð¤òÁȤ߹þ¤à¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
-
- VFlib ver 2.13 °Ê¹ß¤ÈÊ»ÍѤ¹¤ë¤³¤È¤Ë¤è¤ê´Á»ú TrueType ¥Õ¥©¥ó¥È¤ò
- ÍøÍѤǤ­¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£¾Ü¤·¤¯¤Ï kfvflib.sj ¤ò¤´Í÷¤¯¤À¤µ¤¤¡£
-
- ¤Þ¤¿¡¢ÆüËܸ첽¤ò¹Ô¤ï¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢kanji.dev °Ê¹ß¹ÔËö¤Þ¤Ç¤òºï½ü¤·
- ¤Æ¤¯¤À¤µ¤¤¡£
-
- (C)
- DEVICE_DEVS= ...
- DEVICE_DEVS1=
- :
- :
- DEVICE_DEVS9=
-
- ¥×¥ì¥Ó¥å¡¼¥¢¡¢¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð¤Ê¤É¤Î½ÐÎϥɥ饤¥Ð¤ò¤³¤³¤Ë¶õÇòʸ»ú
- ¤Ç¶èÀڤäƤʤé¤Ù¤Þ¤¹¡£
-
- DEVICE_DEVS¡¢DEVICE_DEVS1¡ÁDEVICE_DEVS9 ¤Î 10 ¸Ä¤Î¥Þ¥¯¥í¤Ëʬ¤±¤Æ
- ¤¢¤ë¤Î¤Ï MS-DOS ¤Î¥³¥Þ¥ó¥É¥é¥¤¥óŤÎÀ©¸Â¤Î¤¿¤á¤Ç¤¹¡£¤¿¤¯¤µ¤ó¤Î¥Ç
- ¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤òÁȤ߹þ¤à¾ì¹ç¤Ë¤Ï¡¢°ì¤Ä¤Î¥Þ¥¯¥í¤ÎÄêµÁ¤¬Ä¹¤¯¤Ê¤ê¤¹
- ¤®¤Ê¤¤¤è¤¦¤Ë 10 ¸Ä¤ËŬÅö¤Ë¿¶¤êʬ¤±¤Æ¤¯¤À¤µ¤¤¡£
-
- ¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë djgpp.mak ¤Ç¤Ï²¿¤âÁȤ߹þ¤Þ¤Ê¤¤¤è¤¦
- ¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
-
- Ä̾ï¤Ï¥Ç¥£¥¹¥×¥ì¥¤¥É¥é¥¤¥Ð¤ÏÁȤ߹þ¤àɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-
- µ¡¼ï ¥Ç¥Ð¥¤¥¹Ì¾ ¥½¡¼¥¹¥³¡¼¥É¤¬¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê
- PC-9801/PC-H98 pc98.dev drivers/gdevpc98/
- IBM PC/AT djgpp.dev drivers/gdevdjgp/
-
- ÆüËܸ첽¥Ñ¥Ã¥±¡¼¥¸¡¢µÚ¤Ó¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤ËÉÕ°¤Î¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤ò
- ÁȤ߹þ¤à¾ì¹ç¤Ë¤Ï¡¢¤½¤ì¤¾¤ì¤Î¥½¡¼¥¹¥×¥í¥°¥é¥à¤ò¾¤Î Ghostscript
- ¤Î¥½¡¼¥¹¥×¥í¥°¥é¥à¤Î¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥³¥Ô¡¼¤·¡¢¤µ¤é¤Ë¤½¤ì¤¾¤ì¤Î
- ¥É¥é¥¤¥Ð¤ËÉÕ°¤Î Makefile ¤ÎÆâÍƤò djgpp.mak ¤ËÄɲᢤޤ¿¤Ï
- !include " ¥Õ¥¡¥¤¥ë̾ " ¤È¤·¤Æ¼è¤ê¹þ¤ó¤Ç¤¯¤À¤µ¤¤¡£
-
- DJ's GPP ¤Î 1.12 °Ê¹ß¤ò»È¤¦¾ì¹ç¤Ë¤Ï¡¢djgpp.mak Æâ¤Î¥Þ¥¯¥í AOUT2EXE
- ¤ÎÄêµÁ¤ò 'coff2exe' ¤Ë½ñ¤­´¹¤¨¤Æ¤¯¤À¤µ¤¤¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï 'aout2exe'
- ¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
-
-(7) djgpp.mak ¤ò Makefile ¤È¤·¤Æ make ¤ò¼Â¹Ô¤¹¤ë¡£
-
- make -f djgpp.mak
-
- djgpp.mak ¤Ï Borland make ÍѤǤ¹¡£¤½¤Î¾¤Î make ¤ò»È¤¦¾ì¹ç¤Ë¤Ï¡¢¤³
- ¤Î¥Ñ¥Ã¥±¡¼¥¸¤ËÉÕ°¤Î tarcat.pl ¤ò»È¤Ã¤Æ ¡Ö!include " ¥Õ¥¡¥¤¥ë̾ "¡×
- ¤ÎÉôʬ¤ò¤½¤ÎÃæÌ£¤ÇÃÖ¤­´¹¤¨¤Æ¡¢¤½¤ì¤ò Makefile ¤È¤·¤Æ»È¤Ã¤Æ¤¯¤À¤µ¤¤¡£
- perl ¥¹¥¯¥ê¥×¥È¤Ç¤¹¡£°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ»È¤¤¤Þ¤¹¡£¤³¤Î¥¹¥¯¥ê¥×¥È¤Ç¤Ï
- !include ¤ÏÆþ¤ì»Ò¤Ë¤Ê¤Ã¤Æ¤¤¤Æ¤â½èÍý¤Ç¤­¤Þ¤¹¡£
-
- jperl tarcat.pl djgpp.mak > merged.mak
-
- make ÍѤΥХåÁ¥Õ¥¡¥¤¥ë (gsaddmod.bat ¤Ê¤É) ¤Ï¥ª¥ê¥¸¥Ê¥ë¤Î¥Ñ¥Ã¥±¡¼
- ¥¸¤Ë´Þ¤Þ¤ì¤ë Turbo C++/Borland C++ ÍѤΤâ¤Î¤ò¤½¤Î¤Þ¤ÞÍѤ¤¤Þ¤¹¡£¤³¤Î
- ¥Ñ¥Ã¥±¡¼¥¸¤Ç¤Ï¤µ¤é¤Ë¥ª¥ê¥¸¥Ê¥ë¤Î¥Ñ¥Ã¥±¡¼¥¸¤Î¤â¤Î¤Ë²Ã¤¨¤Æ
- gssetdjg.bat ¤È¤¤¤¦¥Ð¥Ã¥Á¥Õ¥¡¥¤¥ë¤¬Äɲ䵤ì¤Æ¤¤¤Þ¤¹¡£¥«¥ì¥ó¥È¥Ç¥£¥ì
- ¥¯¥È¥ê (gs261) ¤Ë¤³¤ì¤é¤Î¥Ð¥Ã¥Á¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¤³¤È¤ò³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£
-
- ¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ë´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤ò PC-9801 ¤ä PC/AT
- ¸ß´¹µ¡¤ËÂбþ¤µ¤»¤ë¤¿¤á¤ÎÊýË¡¤ÏËܥɥ­¥å¥á¥ó¥È¤ÎºÇ¸å¤Ëµ­¤·¤Æ¤¢¤ê¤Þ¤¹¡£
-
-
-========================================================================
-¡ü £µ¡¥ »ÈÍÑË¡
-========================================================================
-
- ¤³¤³¤Ç¤Ï¡¢DJ's GPP ÈÇÆÃÍ­¤Î¤³¤È¤Ë¤Ä¤¤¤Æ¤Î¤ß½Ò¤Ù¤Þ¤¹¡£Ghostscript °ìÈÌ
-¤ÎÀßÄêºî¶È¡¢»ÈÍÑË¡¤Ë¤Ä¤¤¤Æ¤Ï¥ª¥ê¥¸¥Ê¥ë¤Î¥É¥­¥å¥á¥ó¥È¤ò¤´Í÷¤¯¤À¤µ¤¤¡£
-
------------
-¡ú 5.1 ÀßÄê
------------
-
-(1) ¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Î kanji ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë PostScript ¥Õ¥¡¥¤¥ë¤òÆüËÜ
- ¸ì²½¥Ñ¥Ã¥±¡¼¥¸¤Î kanji ¥Ç¥£¥ì¥¯¥È¥ê²¼¤Î¥Õ¥¡¥¤¥ë¤ÈƱ¤¸¥Ç¥£¥ì¥¯¥È¥ê¤Ë
- ¥³¥Ô¡¼¤¹¤ë¡£
-
-(2) ¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ë´Þ¤Þ¤ì¤ë gp_djgpp.ps ¤È gp_site.ps ¤ò Ghostscript ¤Î
- ¥é¥¤¥Ö¥é¥ê¤òÃÖ¤¯¥Ç¥£¥ì¥¯¥È¥ê (gs_init.ps ¤Ê¤É¤òÃÖ¤¯¥Ç¥£¥ì¥¯¥È¥ê) ¤Ë
- ¥³¥Ô¡¼¤¹¤ë¡£
-
-(3) ɬÍפǤ¢¤ì¤Ð gp_site.ps ¤Îµ¡¼ï»ØÄêÉôʬ¤Ê¤É¤òÊÔ½¸¤¹¤ë¡£
-
- ËܥС¼¥¸¥ç¥ó¤Ç¤Ïµ¡¼ï (98/PC/ ¤½¤Î¾) ¤Ï¼«Æ°È½Ê̤·¤Þ¤¹¡£¤·¤¿¤¬¤Ã¤Æ¡¢
- ±¿¤¬¤è¤±¤ì¤ÐÆäËÀßÄê¤ò¹Ô¤Ê¤¦É¬ÍפϤʤ¯¡¢¤½¤Î¤Þ¤Þ»È¤¨¤Þ¤¹¡£
-
- ¤¬¡¢¾ì¹ç¤Ë¤è¤Ã¤Æ¤ÏȽÄê¤ò¸í¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£¤½¤Î¾ì¹ç¤Ë¤Ï¡¢
- gp_site.ps ¤ò°Ê²¼¤Î¤è¤¦¤ËÊÔ½¸¤·¤Æ¡ÖÌÀ¼¨Åª¤Ë¡×µ¡¼ï¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£
-
- ¶ñÂÎŪ¤Ë¤Ï¡¢ÉÕ°¤Î gp_site.ps ¤Ë¤Ï²Äǽ¤ÊÀßÄ꤬¥³¥á¥ó¥È ('%' °Ê¹ß²þ
- ¹Ô¤Þ¤Ç) ²½¤µ¤ì¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢¤½¤ì¤é¤Î¤¦¤Á¤Ò¤È¤Ä¤ò Uncomment ¤·¤Æ¤¯¤À
- ¤µ¤¤¡£
-
- % /Name (PC-AT) % ...
- % /Name (PC-9801) % ...
- % /Name (OTHER) % ...
-
- ¤Î¹ÔƬ¤Î '%' ¤Î¤¦¤Á¤Ò¤È¤Ä¤ò¼è¤ê½ü¤­¤Þ¤¹¡£
-
- ¤Ê¤ª¡¢¼«Æ°È½Ê̤ò¹Ô¤Ê¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢¼«Æ°Åª¤Ë¤½¤Îµ¡¼ï¤Ë /Name ¤¬ÀßÄê
- ¤µ¤ì¤Þ¤¹¡£
-
-
- °Ê²¼¤Ï¥ª¥×¥·¥ç¥Ê¥ë¤ÊÀßÄê¤Ê¤Î¤ÇÄ̾ï¤ÏɬÍפ¢¤ê¤Þ¤»¤ó¡£¥Ç¥Õ¥©¥ë¥È¤ÎÀß
- Äê¤Ç¤¦¤Þ¤¯¤¤¤«¤Ê¤¤¾ì¹ç¤ä¥Ç¥Õ¥©¥ë¥È¤ÎÀßÄê¤ÇÉÔËþ¤Ê¤È¤­¤Ë¤³¤ì¤é¤ÎÀßÄê¤ò
- ¹Ô¤Ê¤Ã¤Æ¤¯¤À¤µ¤¤¡£
-
-(4) ¥×¥ê¥ó¥¿½ÐÎϤÎÊýË¡¤Î»ØÄê (/PrintTarget)
-(5) ¥×¥ê¥ó¥¿½ÐÎϥХåե¡¤Î¥µ¥¤¥º¤Î»ØÄê (/PrintBufferSize)
-(6) ¥×¥ê¥ó¥¿½ÐÎϤή¤µ¤Î»ØÄê (/PrintWait)
-(7) ¥Ç¥Õ¥©¥ë¥È¤Î¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤Î»ØÄê (/DefaultDevice)
-
- /Name ¤ÎÀßÄê¤ò¹Ô¤¦¤È¡¢
-
- ¡¦ ¥×¥ê¥ó¥¿½ÐÎϤÎÊýË¡ (/PrintTarget ¤Ê¤É)
- ¡¦ ¥Ç¥Õ¥©¥ë¥È¤Î¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð (/DefaultDevice)
-
-¤¬¡¢³Æµ¡¼ï¤Ë¤¢¤Ã¤¿¤â¤Î¤Ë¼«Æ°Åª¤ËÀßÄꤵ¤ì¤Þ¤¹¡£
-
- ¤³¤³¤Ç¡¢³ÆÀßÄê¤Î°ÕÌ£¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
-
- ¡¦ /PrintTarget
- ¥×¥ê¥ó¥¿½ÐÎϤò¡¢¥×¥ê¥ó¥¿¥Ý¡¼¥È¡¢¥×¥ê¥ó¥¿ BIOS¡¢É¸½à¥×¥ê¥ó¥¿½ÐÎÏ¡¢
- ¤Î¤¦¤Á¤Î¤É¤ì¤òÍѤ¤¤Æ¹Ô¤¦¤«¤òÀßÄꤷ¤Þ¤¹¡£
- (PORT),(PORT1),(PORT2),(PORT3),(BIOS),(STDPRN) ¤Î¤É¤ì¤«¤ÎÃͤò¤È¤ê
- ¤Þ¤¹¡£(PORT) ¤È (PORT1) ¤ÏÅù²Á¤Ç¤¹¡£
-
- ¥Ç¥Õ¥©¥ë¥È¤Ï PC-9801¡¢IBM PC/AT ¸ß´¹µ¡¤Ç¤Ï (BIOS)¡¢¤½¤ì°Ê³°¤Ç¤Ï
- (STDPRN) ¤Ç¤¹¡£
-
- ¡¦ /PrintBufferSize
- ¥×¥ê¥ó¥¿½ÐÎÏÍѤΥХåե¡¤Î¥Ð¥¤¥È¿ô¤Ç¤¹¡£¥×¥ê¥ó¥¿¤ËÁ÷¤é¤ì¤ë¥Ç¡¼¥¿¤Ï
- °ìö¤³¤Î¥Ð¥Ã¥Õ¥¡¤ËÃù¤¨¤é¤ì¡¢¥Ð¥Ã¥Õ¥¡¤¬¤¤¤Ã¤Ñ¤¤¤Ë¤Ê¤Ã¤¿¤È¤­¤Ë¤Þ¤È¤á¤Æ
- ¥×¥ê¥ó¥¿¤ËÁ÷¿®¤µ¤ì¤Þ¤¹¡£64 °Ê¾å 32767 °Ê²¼¤ÎÀ°¿ô¤Ç¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï
- 1024(bytes) ¤Ç¤¹¡£
-
- ¡¦ /PrintWait
- ¥×¥ê¥ó¥¿½ÐÎÏ»þ¤Î¡ÖÂÔ¤Á¡×¤Ç¤¹¡£¤³¤ÎÀßÄêÃͤ¬Â礭¤¤¤Û¤É¤æ¤Ã¤¯¤ê¤È½ÐÎÏ
- ¤µ¤ì¤Þ¤¹¡£¡ÖÂÔ¤Á¡×¤Ï /PrintBufferSize ¤Ö¤ó¤Î¥Ç¡¼¥¿¤ò½ÐÎϤ¹¤ë¤´¤È¤ËÆþ
- ¤ê¡¢ÂÔ¤Á»þ´Ö¤ÏÀßÄêÃͤÎÆó¾è¤Ë¤Û¤ÜÈæÎ㤷¤Þ¤¹¡£
-
- LAN ´Ä¶­¤ä¥×¥ê¥ó¥¿¥¹¥×¡¼¥é¤Ç¥×¥ê¥ó¥¿ BIOS ¤ò¥Õ¥Ã¥¯¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¥×
- ¥ê¥ó¥¿¥³¡¼¥É¤ò¤È¤ê¤³¤Ü¤·¤Æ¤·¤Þ¤¦¤è¤¦¤Ê¤È¤­¤Ë¤Ï¤³¤ÎÃͤòÂ礭¤¯ÀßÄꤹ¤ë
- ¤«¡¢¤³¤ÎÃͤò¤¢¤ëÄøÅÙ¤ÎÂ礭¤µ¤ËÀßÄꤷ¤Æ¤ª¤¤¤Æ /PrintBufferSize ¤ÎÃͤò
- ¾®¤µ¤¯¤·¤Þ¤¹¡£
-
- /PrintBufferSize ¤ÎÃͤ¬¾®¤µ¤¤¤Û¤ÉÉÑÈˤˡÖÂÔ¤Á¡×¤¬È¯À¸¤¹¤ë¤³¤È¤Ë¤Ê
- ¤ê¡¢/PrintWait ¤ÎÃͤ¬Â礭¤¤¤Û¤É°ì²ó¤¢¤¿¤ê¤Î¡ÖÂÔ¤Á¡×¤¬Ä¹¤¯¤Ê¤ë¤³¤È¤Ë
- ¤Ê¤ê¤Þ¤¹¡£
-
- ÀßÄê¤Ç¤­¤ëÃÍ¤Ï 0 °Ê¾å 2048 °Ê²¼¤ÎÀ°¿ô¤Ç¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï 0(ÂÔ¤Á¤Ê
- ¤·) ¤Ç¤¹¡£
-
- ¡¦ /DefaultDevice
- Ghostscript ¤ò -sDEVICE=<driver> ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤻ¤º¤Ë¡¢¤«¤Ä´Ä¶­
- ÊÑ¿ô GS_DEVICE ¤òÀßÄꤻ¤º¤ËΩ¤Á¾å¤²¤¿¾ì¹ç¤Ë»ÈÍѤ¹¤ë¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð
- ¤Ç¤¹¡£Ä̾ï¤Ïµ¡¼ï¤Ë¤¢¤Ã¤¿¥Ç¥£¥¹¥×¥ì¥¤¥É¥é¥¤¥Ð¤ò»ØÄꤷ¤Æ¤ª¤­¤Þ¤¹¡£
-
- ¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ç
-
- gs -h
-
- ¤È Ghostscript ¤òΩ¤Á¾å¤²¤¿¤È¤­¤Ë¡¢
-
- Available devices:
-
- ¤È¤¤¤¦Éôʬ¤Ë½ÐÎϤµ¤ì¤ë¤â¤ÎÃ椫¤éÁª¤Ó¤Þ¤¹¡£
-
- /Name Ëè¤Î³Æ¥Ç¥Õ¥©¥ë¥ÈÃͤϡ¢
-
- +---------+-----------------------------------------+
- |/Name |/PrintTarget /DefaultDevice |
- +---------+-----------------------------------------+
- |(PC-AT) |¥Ý¡¼¥È1ÈÖ (djgpp) -sDEVICE=djgpp |
- |(PC-9801)|¥Ý¡¼¥È (pc98) -sDEVICE=pc98 |
- |(OTHER) |ɸ½à¥×¥ê¥ó¥¿½ÐÎÏ nulldevice -dNODISPLAY |
- +---------+-----------------------------------------+
-
-¤Ç¡¢/Name ¤¬¤¤¤º¤ì¤Î¾ì¹ç¤â /PrintWait ¤Ï 0¡¢/PrintBufferSize ¤Ï 1024 ¤Ç
-¤¹¡£
-
- ¤³¤ì¤é¤Ï¥æ¡¼¥¶¤¬ gp_site.ps Ãæ¤Ç /PrintTarget¡¢/DefaultDevice ¤Ê¤É¤òÌÀ
-¼¨Åª¤Ë»ØÄꤹ¤ë¤³¤È¤Ë¤è¤Ã¤ÆÊѹ¹¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
-
- »ØÄê¤ÎÊýË¡¤Ï¡¢
-
- /DefaultDevice (pc98)
-
-¤Î¤è¤¦¤Ë¡¢
-
- /»ØÄê¹àÌÜ ÃÍ
-
-¤È¤·¤Þ¤¹¡£gp_site.ps ¤ËÀßÄêÎã¤ò¥³¥á¥ó¥È¤È¤·¤Æµ­½Ò¤·¤Æ¤¢¤ê¤Þ¤¹¤Î¤Ç»²¹Í¤Ë
-¤·¤Æ¤¯¤À¤µ¤¤¡£
-
- ¢¨ '%' °Ê¹ß¡¢¹ÔËö¤Þ¤Ç¤Ï¥³¥á¥ó¥È¤Ç¤¹¡£
-
- /Name ¤Ë (OTHER) ¤ò»ØÄꤷ¤¿¤È¤­¤Ë¤Ï¡¢µ¡¼ï°Í¸¤ÎÆ°ºî¤òÁ´¤¯¹Ô¤¤¤Þ¤»¤ó¡£
-NEC PC-9801 ¤ä IBM PC/AT ¸ß´¹µ¡°Ê³°¤Îµ¡¼ï¤ÇÍøÍѤ¹¤ë¾ì¹ç¤Ë¤Ï¤³¤ì¤ò»ØÄꤷ
-¤Æ¤¯¤À¤µ¤¤¡£¥×¥ê¥ó¥¿½ÐÎϤÏɸ½à¥×¥ê¥ó¥¿½ÐÎϤò»È¤¤¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥Ç¥Ð¥¤¥¹¤Ï
-nulldevice (¥°¥é¥Õ¥£¥Ã¥¯²èÌ̤ؤνÐÎϤò°ìÀÚ¹Ô¤ï¤Ê¤¤¥Ç¥Ð¥¤¥¹¡£¥³¥Þ¥ó¥É¥é¥¤
-¥ó¤Ç -dNODISPLAY ¤ò»ØÄꤷ¤¿¾ì¹ç¤ÈÅù²Á) ¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-
-========================================================================
-¡ü £¶¡¥ ¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð¤ÎÁȹþ¤ß
-========================================================================
------------------------------------------
-¡ú 6.1 Ëܥѥ屡¼¥¸ÉÕ°¤Î¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð
------------------------------------------
-
- ³Æ¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð¤Î¥É¥­¥å¥á¥ó¥È¤Ë¤·¤¿¤¬¤Ã¤ÆÁȤ߹þ¤ó¤Ç¤¯¤À¤µ¤¤¡£
-
-
------------------------------------------------
-¡ú 6.2 ÆüËܸ첽¥Ñ¥Ã¥±¡¼¥¸ÉÕ°¤Î¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð
------------------------------------------------
-
- drivers ¥Ç¥£¥ì¥¯¥È¥ê¤Î²¼¤Î³Æ¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤Ë³ÈÄ¥»Ò.dif ¤Î¥Õ¥¡¥¤¥ë¤¬
-¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢¤½¤ì¤Ï gs 2.6.1 ÆüËܸ첽¥Ñ¥Ã¥±¡¼¥¸¤ËÉÕ°¤Î¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð
-¤ËÂФ¹¤ëº¹Ê¬¤Ç¤¹¡£¤³¤Îº¹Ê¬¤ò¤¢¤Æ¤ë¤³¤È¤Ë¤è¤êÆüËܸ첽¥Ñ¥Ã¥±¡¼¥¸¤ËÉÕ°¤Î¥×
-¥ê¥ó¥¿¥É¥é¥¤¥Ð¤¬»È¤¨¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£
-
- ÆüËܸ첽º¹Ê¬¤ËÉÕ°¤Î¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð¤Ï¤Ï¤¸¤á¤«¤é NEC PC-9801 ¤ËÂбþ¤·
-¤Æ¤¤¤ë¾ì¹ç¤â¤¢¤ê¤Þ¤¹¤¬¡¢NEC PC-H98 ¤ä IBM PC/AT ¸ß´¹µ¡¤ËÂбþ¤µ¤»¤ë¤¿¤á¤Ë
-¤Ï¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤ËÉÕ°¤Îº¹Ê¬¤ò¤¢¤Æ¤Æ¤¯¤À¤µ¤¤¡£PC-9801 ¤Ç»ÈÍѤ¹¤ë¾ì¹ç¤Ë¤â¡¢
-BIOS ½ÐÎϤʤɤε¡Ç½¤ò»È¤¦¤Ë¤Ïº¹Ê¬¤ò¤¢¤Æ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-
- ¤Þ¤¿¡¢ÆüËܸ첽¥Ñ¥Ã¥±¡¼¥¸¤ËÉÕ°¤Î¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð¤ÎÃæ¤Ç¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ë
-ÆäËÂбþº¹Ê¬¤¬´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¤â¤Î¤Ï¼¡¤ÎÀâÌÀ¤Ë¤·¤¿¤¬¤Ã¤Æºî¶È¤¹¤ë¤³¤È¤Ë¤è¤Ã
-¤Æ PC-9801 ¤ä PC/AT ¤ÇÍøÍѤǤ­¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-
--------------------------------
-¡ú 6.3 ¤½¤Î¾¤Î¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð
--------------------------------
-
- º£¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¥×¥ê¥ó¥¿½ÐÎϤΤ¿¤á¤Î¥ë¡¼¥Á¥ó¤òÁ´¤Æ gp_djgpp.c ¤ÇÍÑ°Õ¤·
-¤Æ¤¤¤Þ¤¹¡£¤³¤Î¤¿¤á¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤Î¥½¡¼¥¹Æâ¤ÇÆɤ߹þ¤à¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ò°ì
-¤ÄÄɲ乤ë¤À¤±¤Ç¤³¤ì¤Þ¤Ç PC-9801 ¤Ê¤É¤ËÂбþ¤·¤Æ¤¤¤Ê¤«¤Ã¤¿¥×¥ê¥ó¥¿¥É¥é¥¤
-¥Ð¤âÍøÍѤ¹¤ë¤³¤È¤¬½ÐÍè¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£
-
- ¤³¤ÎÊýË¡¤ÇÂбþ¤Ç¤­¤ë¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð¤Ï¡¢¥³¡¼¥É¤Î½ÐÎϤò
-putc(),fputc(),fputs(),fwrite(),fprintf(),vfprintf(),fflush() ¤Î¥¹¥È¥ê¡¼
-¥à½ÐÎÏ´Ø¿ô¤ò»È¤Ã¤Æ¹Ô¤Ê¤Ã¤Æ¤¤¤ë¤â¤Î¤Ç¤¹¡£write() ¤Ê¤É¤ÎÄã¿å½à½ÐÎÏ´Ø¿ô¤ò»È
-¤¦¤â¤Î¤ÏÂбþ¤Ç¤­¤Þ¤»¤ó¡£
-
- ¤Þ¤¿¡¢¥×¥ê¥ó¥¿¤Î¥ª¡¼¥×¥ó¤Ë gp_printer_open()¡¢¥¯¥í¡¼¥º¤Ë
-gp_printer_close() ¤ò»È¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£gdevprn.c ¤ÇÄêµÁ¤µ¤ì¤Æ
-¤¤¤ë´Ø¿ô¤òÍøÍѤ·¤Æ¤¤¤ë¥É¥é¥¤¥Ð (gdevprn.h ¤ò¼è¤ê¹þ¤ó¤Ç¤¤¤ë¥É¥é¥¤¥Ð) ¤Ç¤¢
-¤ì¤Ð´Ö°ã¤¤¤Ê¤¯¤³¤Î¾ò·ï¤òËþ¤¿¤·¤Æ¤¤¤Þ¤¹¡£
-
- °Ê²¼¤Î¼ê½ç¤Ç (ºÆ) ¥³¥ó¥Ñ¥¤¥ë¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-(1) ¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤ËÉÕ°¤Î gdevgppr.h ¤ò¥É¥é¥¤¥Ð¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Ç¥¤¥ó¥¯
- ¥ë¡¼¥É¤¹¤ë¡£
-
- #include "gdevgppr.h"
-
-(2) (ºÆ) ¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¡£
-
-
-========================================================================
-¡ü £·¡¥ Á°¥Ð¡¼¥¸¥ç¥ó¤«¤é¤ÎÊѹ¹ÅÀ
-========================================================================
-
- DJ's GPP Âбþ¥Ñ¥Ã¥±¡¼¥¸¤ÎÁ°¥Ð¡¼¥¸¥ç¥ó (1.2) ¤«¤é°Ê²¼¤ÎÅÀ¤¬Êѹ¹¤µ¤ì¤Æ¤¤
-¤Þ¤¹¡£
-
- ¡¦ ÉÔ¶ñ¹ç¤Î½¤Àµ
- ¡¾ ¥æ¡¼¥Æ¥£¥ê¥Æ¥£ ps2epsi ¤¬Àµ¾ï¤ËÆ°ºî¤·¤Ê¤«¤Ã¤¿ÉÔ¶ñ¹ç¤ò½¤Àµ¡£
- ¡¾ VFlib ´Á»ú¥É¥é¥¤¥Ð¤Ç¡¢¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤Ë vfontcap ¤¬¤¢¤ë¤ÈÀµ
- ¾ï¤ËÆ°ºî¤·¤Ê¤«¤Ã¤¿ÉÔ¶ñ¹ç¤ò½¤Àµ¡£
- ¡¾ dmprt ¥É¥é¥¤¥Ð¤Ç°ìÉô¤Î¥×¥ê¥ó¥¿¤ÇÀµ¾ï¤ËÆ°ºî¤·¤Ê¤«¤Ã¤¿ÉÔ¶ñ¹ç¤ò½¤Àµ¡£
- ¡¦ ½ÐÎÏÊýË¡¤Ë´Ø¤¹¤ëµ¡Ç½³ÈÄ¥¡¦Êѹ¹
- ¡¾ IBM PC/AT ¸ß´¹µ¡¤Î¥×¥ê¥ó¥¿ BIOS ·Ðͳ¤Î½ÐÎϤËÂбþ¡£
- ¡¾ ¥×¥ê¥ó¥¿½ÐÎϤΥǥե©¥ë¥È¤ò BIOS ¤ËÊѹ¹¡£
- ¡¾ ¥×¥ê¥ó¥¿½ÐÎϤήÅÙ¤òÄ´Àá¤Ç¤­¤ë¤è¤¦¤ËÊѹ¹¡£
- ¡¾ ¥×¥ê¥ó¥¿½ÐÎϥХåե¡¤Î¥µ¥¤¥º¤òÄ´Àá¤Ç¤­¤ë¤è¤¦¤ËÊѹ¹¡£
- ¡¦ ¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤Îµ¡Ç½³ÈÄ¥
- ¡¾ dmprt ¥É¥é¥¤¥Ð¤ò dviprt 2.42 °Ê¹ß¤Î¥×¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë¤ËÂбþ¡£
- ¡¦ ¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤ÎÄɲÃ
- ¡¾ HP DeskJet 505J
- ¡¾ Hyper-Frame+
- ¡¾ Ëî ¥Õ¥©¡¼¥Þ¥Ã¥È¥Ç¡¼¥¿
- ¡¦ ¤½¤Î¾
- ¡¾ µ¡¼ï¤ò¼«Æ°È½Ê̤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
- ¡¾ PC-9801, IBM PC/AT ¸ß´¹µ¡ ¤ËÂбþ¤·¤Æ¤¤¤Ê¤¤¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð¤ÎÁȤß
- ¹þ¤ß¤«¤¿¤òÊѹ¹ (djdriver.pl ¤È gp_print.h ¤òºï½ü¡£gdevgppr.h ¤ò
- Äɲá£)
- ¡¾ ½é´ü²½¥Õ¥¡¥¤¥ë gp_djgpp.ps ¤«¤é¡¢¥æ¡¼¥¶¤¬ÊÔ½¸¤¹¤ëÉôʬ¤òÊÌ¥Õ¥¡¥¤
- ¥ë gp_site.ps ¤ËʬΥ¡£½ñ¼°¤â¼ã´³Êѹ¹¡£
-
-
-========================================================================
-¡ü £¸¡¥ ¼Õ¼­
-========================================================================
-GO32 ÈǤΥѥ屡¼¥¸¤òºîÀ®¤¹¤ë¤Ë¤¢¤¿¤ê¡¢ÂçÊÑ¿¤¯¤ÎÊý¤Ë¤ªÀ¤Ïäˤʤê¤Þ¤·¤¿¡£
-
- ¡¦ ÅìµþÂç³Ø¤ÎÊÒ»³µªÀ¸¤µ¤ó¤Ë¤Ï¡¢¤¿¤¯¤µ¤ó¤Î¤´½õ¸À¤ä¦Â¥Æ¥¹¥ÈÈǤ«¤é¤ÎÆüËܸì
- ²½¥Ñ¥Ã¥±¡¼¥¸¤ÎÄ󶡤ò¤·¤Æ¤¤¤¿¤À¤­¤Þ¤·¤¿¡£
-
- ¡¦ PC-VAN SSCIENCE ¤Î¤È¤¬¤·¤µ¤ó¤Ë¤Ï¡¢IBM PC/AT ¸ß´¹µ¡¤Ç¤ÎÆ°ºî³Îǧ¡¢¥Æ¥¹
- ¥È¥Ð¥¤¥Ê¥ê¤ÎºîÀ®¤Ê¤ÉÂçÊѤªÀ¤Ïäˤʤê¤Þ¤·¤¿¡£
-
- ¡¦ PC-VAN SSCIENCE ¤Î OkI ¤µ¤ó¤Ë¤Ï¡¢NEC H98 Âбþ¡¢Æ°ºî³ÎǧÅùÂçÊѤªÀ¤ÏÃ
- ¤Ë¤Ê¤ê¤Þ¤·¤¿¡£
-
- ¡¦ PC-VAN SSCIENCE ¤Î SOLITON ¤µ¤ó¤Ï¡¢IBM PC/AT ¸ß´¹µ¡ÍѤΥǥ£¥¹¥×¥ì¥¤
- ¥É¥é¥¤¥Ð¤ò¸ø³«¤·¤Æ¤¯¤À¤µ¤¤¤Þ¤·¤¿¡£¤Þ¤¿¡¢¥É¥é¥¤¥Ð¤Î½¤Àµ¤Ë¤¢¤¿¤Ã¤Æ¿¤¯
- ¤Î¤´½õ¸À¤ò¤¤¤¿¤À¤­¤Þ¤·¤¿¡£
-
- ¡¦ Nifty Serve FLABO ¤Î KEN ¤µ¤ó¤Ë¤Ï IBM PC/AT ¸ß´¹µ¡ÍѤΥǥ£¥¹¥×¥ì¥¤¥É
- ¥é¥¤¥Ð¤ÎÉÔ¶ñ¹ç½¤Àµ¤Ë¤¢¤¿¤Ã¤Æ¡¢µ®½Å¤Ê¤´½õ¸À¤ò¤¤¤¿¤À¤­¤Þ¤·¤¿¡£
-
- ¡¦ hero.h ¤µ¤ó¤Ë¤Ï¡¢IBM PC/AT ¸ß´¹µ¡ÍѤΥץê¥ó¥¿½ÐÎÏ¥³¡¼¥É¤òºîÀ®¤·¤Æ¤¤
- ¤¿¤À¤­¤Þ¤·¤¿¡£
-
- ¡¦ VFlib ¤Î¥¢¥¦¥È¥é¥¤¥ó¼èÆÀ´Ø¿ô¤Î¼ÂÁõ¤Î¤ª¤«¤²¤Ç´Á»ú TrueType ¥Õ¥©¥ó¥È¤ò
- ¥µ¥Ý¡¼¥È¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤·¤¿¡£VFlib ¤Îºî¼Ô¤Ç¤¢¤ë¹­ÅçÂç³Ø¤Î³ÑÀî͵¼¡¤µ
- ¤ó¡¢VFlib ¤Î´Á»ú TrueType Âбþ¤ò¹Ô¤Ã¤Æ¤¯¤À¤µ¤Ã¤¿ PC-VAN SSCIENCE ¤Î
- ¾¾ÅÄ°ìϺ¤µ¤ó¤ò»Ï¤á¤È¤¹¤ë VFlib ³«È¯¤Ë¤«¤«¤ï¤Ã¤Æ¤¤¤é¤Ã¤·¤ã¤ëÊý¡¹¤Ë´¶
- ¼Õ¤·¤Þ¤¹¡£
-
- ¡¦ ºÇ¸å¤Ë¤Ê¤ê¤Þ¤¹¤¬¡¢Louis IX ¤µ¤ó¤ò»Ï¤á¤È¤¹¤ë PC-VAN SSCIENCE ¤Î¤ß¤Ê¤µ
- ¤ó¤Ë¤Ï´öÅ٤ˤâÅϤëÆ°ºî¥Æ¥¹¥È¡¦Êó¹ð¡¢¤ò¹Ô¤Ã¤Æ¤¤¤¿¤À¤­¤Þ¤·¤¿¡£¤¢¤ê¤¬¤È
- ¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
-
-
-========================================================================
-¡ü £¹¡¥ ºÆÇÛÉÛ¡¦ÊݾÚ
-========================================================================
-
- DJ's GPP ÂбþÉôʬ¤Ë´Ø¤·¤Æ¤Ï GNU General Public License (GPL) ¤Ë½¾¤¤¤Þ
-¤¹¡£GNU GPL ¤Ë¤Ä¤¤¤Æ¤Ï COPYING ¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤Ëµ­¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-
- ³Æ¼ï¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¡¢¥Õ¥©¥ó¥È¥É¥é¥¤¥Ð¤Ë¤Ä¤¤¤Æ¤Ï¤½¤ì¤¾¤ì¤Î¥É¥­¥å¥á¥ó¥È¡¢
-¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Ëµ­¤·¤Æ¤¢¤ë¾ò·ï¤Ë½¾¤¤¤Þ¤¹¡£
-
-=========================== End of Document ============================
diff --git a/gs/contrib/japanese/doc/gdev10v.txt b/gs/contrib/japanese/doc/gdev10v.txt
deleted file mode 100644
index bfbe3911b..000000000
--- a/gs/contrib/japanese/doc/gdev10v.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-
- gdev10v.c - BJ10vÍѥǥХ¤¥¹¥É¥é¥¤¥Ð
-
-
-¡û¥¤¥ó¥¹¥È¡¼¥ëÊýË¡
-
-1. gdev10v.c ¤ò gs261 ¤Î¥½¡¼¥¹¥×¥í¥°¥é¥à¤¬¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥³¥Ô¡¼¤·
- ¤Æ²¼¤µ¤¤¡£
-
-2. Makefile ¤Ë gdev10v.mak ¤òÄɲ䷤Ʋ¼¤µ¤¤¡£ ¤³¤Î¤È¤­¡¢¤â¤·PC9801¾å¤Î
- MS-DOS¤Ç¤ª»È¤¤¤Ê¤é¡¢-DPC9801¤ò²Ã¤¨¤Æ¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤è¤¦¤Ë¤·¤Æ²¼¤µ¤¤
- (gdev10v.mak»²¾È)¡£
-
-3. Makefile ¤Î DEVICE_DEVS ¤Ë bj10v.dev, bj10vh.dev ¤ò²Ã¤¨¤Æ²¼¤µ¤¤¡£
-
- Îã) DEVICE_DEVS=pc98.dev bj10v.dev bj10vh.dev
- ^^^^^^^^^ ^^^^^^^^^^
-
-4. make ¥³¥Þ¥ó¥É¤Ç gs ¤ò¥³¥ó¥Ñ¥¤¥ë¤·¡¢¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ²¼¤µ¤¤¡£
-
-
-¡û»È¤¤Êý
-
-¡ö 2¤Ä¤Î¥Ç¥Ð¥¤¥¹¤òÍÑ°Õ¤·¤¿¤Î¤Ï BJ10v ¤Î DIP ¥¹¥¤¥Ã¥Á 4 ÈÖ(¾å¥Þ¡¼¥¸¥ó)
- ¤ÎÀßÄê¤Ë¤è¤Ã¤Æ°õ»úÎΰè¤Î¥µ¥¤¥º¤¬°Û¤Ê¤ë¤¿¤á¤Ç¡¢°Ê²¼¤Î¤è¤¦¤ËÂбþ¤·¤Æ
- ¤¤¤Þ¤¹¡£
-
- ¥Ç¥Ð¥¤¥¹Ì¾ DIP¥¹¥¤¥Ã¥Á4 °ÕÌ£
- ----------------------------------------------------------------
- bj10vh ON ¾å¥Þ¡¼¥¸¥ó 8.5mm, °õ»ú¹â 10.8 ¥¤¥ó¥Á
- bj10v OFF ¾å¥Þ¡¼¥¸¥ó 22mm, °õ»ú¹â 10.3 ¥¤¥ó¥Á
-
- ¤ª»È¤¤¤Î DIP ¥¹¥¤¥Ã¥ÁÀßÄê¤Ë¹ç¤ï¤»¤¿¥Ç¥Ð¥¤¥¹Ì¾¤òÁª¤ó¤Ç²¼¤µ¤¤¡£ ¤Ê¤ª¡¢
- BJ10v ¤Î½Ð²Ù»þ¤ÎÀßÄê¤Ç¤Ï DIP ¥¹¥¤¥Ã¥Á 4 ÈÖ¤Ï OFF ¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
-
-
-¡ö¥Ç¥Ð¥¤¥¹¤ÎÁªÂò¤Ï -sDEVICE ¥ª¥×¥·¥ç¥ó¤Ë¤è¤Ã¤Æ¹Ô¤Ê¤¤¤Þ¤¹¡£
-
- Îã) gs -sDEVICE=bj10v (bj10v¤ò»ØÄê)
-
-¡ö²òÁüÅÙ¤ÎÁªÂò¤Ï -r ¥ª¥×¥·¥ç¥ó¤Ë¤è¤Ã¤Æ¹Ô¤Ê¤¤¤Þ¤¹¡£
-
- Îã) gs -sDEVICE=bj10v -r360x180 (360x180dpi¤ò»ØÄê)
-
- Âбþ¤·¤Æ¤¤¤ë²òÁüÅÙ¤Ï 360x360 (¥Ç¥Õ¥©¥ë¥È), 360x180, 180x180¤Î3¼ïÎà
- ¤Ç¤¹¡£
-
-
-
- ´ä°æµ±ÃË (oteru@nak.math.keio.ac.jp)
- Á°ÅÄÆØ»Ê (mad@nak.math.keio.ac.jp)
- ¾¾°æ¹§Íº (mat@slis.flet.mita.keio.ac.jp)
diff --git a/gs/contrib/japanese/doc/gdevalps.txt b/gs/contrib/japanese/doc/gdevalps.txt
deleted file mode 100644
index e6af71462..000000000
--- a/gs/contrib/japanese/doc/gdevalps.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-
-ÇÛÉÛʪ·ï
-
- gdevalps-0.2.tar.gz
-
- README.gdevalps ¤³¤Î¥Õ¥¡¥¤¥ë
- gdevalps.c ¥É¥é¥¤¥Ð¥½¡¼¥¹
- gdevalps.mak ghostscript-5.10 ÍÑ Makefile ÄɲÃÉôʬ
- gdevalps.mak-5.50 ghostscript-5.50 ÍÑ Makefile ÄɲÃÉôʬ
-
-ÀâÌÀ
-
- ghostscript-5.10/ghostscript-5.50 ÍѤΠALPS MD¥·¥ê¡¼¥º¤Î¥â¥Î¥¯¥í 600x600dpi
- Âбþ¤Î¥É¥é¥¤¥Ð¤Ç¤¹¡£MD¥·¥ê¡¼¥ºÈÆÍÑ(?)¥â¥Î¥¯¥í¥â¡¼¥É¡¢MD5000ÀìÍÑ¥â¥Î¥¯¥í¥â¡¼
- ¥É¤Ç¤Î°õºþ¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£MD5000¤Ç¤Ï¥¨¥³¥Ö¥é¥Ã¥¯¥¤¥ó¥¯¤ÎÁªÂò¤â²Äǽ¤Ç¤¹¡£
- -sDEVICE ¥ª¥×¥·¥ç¥ó¤Ç²¼µ­3¼ïÎà¤Î¥â¡¼¥É¤ò»ØÄꤹ¤ë»ö¤¬²Äǽ¤Ç¤¹¡£
-
- md50Mono µì¥Ð¡¼¥¸¥ç¥óƱÍͤΠMD5000 ¤Ç¤Î¥â¥Î¥¯¥í°õºþ¥â¡¼¥É¡£
- md50Eco µì¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¥½¡¼¥¹Êѹ¹¤¬É¬ÍפÀ¤Ã¤¿¥¨¥³¥Ö¥é¥Ã¥¯¥â¡¼¥É¤ò¥Ç¥Ð
- ¥¤¥¹Ì¾¤Ç»ØÄê¤Ç¤­¤ë¤è¤¦¤Ë¤·¤¿¡£
- md1xMono º£²óÄɲ嵥ݡ¼¥È¤·¤¿ MD1300, MD5000 ¤Ç¤ÎÆ°ºî¤ò³Îǧ¤·¤¿¥â¡¼¥É¡£
- Kousuke Ikeda ¤µ¤ó¤«¤é¥½¡¼¥¹¥×¥í¥°¥é¥à¤ò夭¡¢µì¥Ð¡¼¥¸¥ç¥ó¤Î
- ¥½¡¼¥¹¤ÈÅý¹ç¤·¤¿¤â¤Î¤Ç¤¹¡£
- MD2000, MD4000 ¤Ê¤É¡¢¸Å¤¤¥·¥ê¡¼¥º¤â¤³¤Î¥â¡¼¥É¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë
- ²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£
-
-»È¤¤Êý
-
- ghostscript-5.10 ¤Þ¤¿¤Ï ghostscript-5.50 ¤òºîÀ®¤¹¤ë¤Î¤ËɬÍפʥ½¡¼¥¹Îà¤òŸ³«
- ¤·¤¿¾å¤Ç¡¢²¼µ­¼ê½ç¤ÇÇÛÉÛ¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ·¤Æ²¼¤µ¤¤¡£
-
- ¡¦makefile ¤Ø¤ÎÄɲÃÀßÄê
- * ghostscript-5.10 ¤Ç¤Ï makefile ¤Ë gdevalps.mk ¤ÎÆâÍƤòÄɲÃ
- * ghostscript-5.50 ¤Ç¤Ï contrib.mk ¤Ë gdevalps.mk-5.50 ¤ÎÆâÍƤòÄɲÃ
- ¡¦makefile Ãæ¤Î DEVICE_DEVS ¤Ë md50Mono.dev md50Eco.dev md1xMono.dev
- ¤òÄɲ乤롣
- ¡¦gdevalps.c ¤ò¥½¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥³¥Ô¡¼¤¹¤ë¡£
- ¡¦¥³¥ó¥Ñ¥¤¥ë¤¹¤ë
-
-TODO
- ¡¦¥¤¥ó¥¯¥«¡¼¥È¥ê¥Ã¥¸¤Î¥ª¥×¥·¥ç¥ó»ØÄê
- ¡¦¥«¥é¡¼¥â¡¼¥É¥µ¥Ý¡¼¥È
- ¡¦¤½¤Î¾
-
- ¥Ð¥°Êó¹ð¤½¤Î¾¸æ°Õ¸«¤Ê¤É¤¢¤ê¤Þ¤·¤¿¤é»ä°¸¤Ë¥á¥¤¥ë¤Ç¤ª´ê¤¤Ãפ·¤Þ¤¹¡£
-
- vVv
- > ..< NEC Computer Systems, LTD. / umi@mpd.necs.nec.co.jp
- o Umino, Shinya. / umi@necs.co.jp
-
diff --git a/gs/contrib/japanese/doc/gdevcd8.txt b/gs/contrib/japanese/doc/gdevcd8.txt
deleted file mode 100644
index 31cb14de9..000000000
--- a/gs/contrib/japanese/doc/gdevcd8.txt
+++ /dev/null
@@ -1,146 +0,0 @@
- A printer driver for the HP670, HP690, HP850, HP855
- HP870, HP890, HP1100 and HP1600 color printers.
- To be used with the ghostscript printing system.
- These drivers are currently not in the official distrib.
- Please report all problems to uli@bonk.ethz.ch
-
- CREDITS: Much of the driver is based on ideas derived
- from the cdj550 driver of George Cameron.
-
- The support for the hp670, hp690, hp890
- and hp1600 was added by Martin Gerbershagen.
-
- ----------------------------------------------------------------
-
- Copyright (C) 1996-1998 <Uli Wortmann uli@bonk.ethz.ch>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- -------------------------------------------------------------------
-
- 11.11.96. Initial release of the driver
-
- 25.08.97 Version 1.2. Resolved all but one of the
- known bugs, introduced a couple
- of perfomance improvements. Complete
- new color-transfer-function handling.
- (see gamma).
-
- 01.06.98 Version 1.3 Due to the most welcome contribution
- of Martin Gerbershagen (ger@ulm.temic.de),
- support for the hp670, hp690 and hp890
- and hp1600 has been added. Martin has also
- resolved all known bugs.
-
- Problems : Dark colors are still pale.
-
-
- The diver needs no longer special switches to be invoked
- except -sDEVICE=cdj850, or -sDEVICE=CDJ890, or sDEVICE=CDJ670
- or -sDevice=CDJ1600
-
- The hp690 is supported through the hp670 device, the hp855, hp870
- and the hp1100 trough the hp850 device.
-
- The following switches are supported.
-
- -dPapertype= 0 plain paper [default]
- 1 bond paper
- 2 special paper
- 3 glossy film
- 4 transparency film
-
- Note, currently the lookuptables are not suited
- for printing on special paper or transperencies.
- Please revert to the gamma functions in this case.
-
- -dQuality= -1 draft
- 0 normal [default]
- 1 presentation
-
- -dRetStatus= 0 C-RET off
- 1 C-RET on [default]
-
- -dMasterGamma= 3.0 [default = 1.0]
- __Note__: To take advantage of the calibrated color-transfer
- functions, be sure not to have any Gamma-Statements
- left! If you need to (i.e. overhead sheets),
- you still can use the gamma-functions, but they will
- override the built-in calibration. To use gamma in the
- traditional way, set MasterGamma to any value greater
- 1.0 and less 10.0. To adjust individual gamma-values,
- you have to additionally set MasterGamma to a value
- greater 1.0 and less 10.0
-
- With the next release, gamma functions will be dropped.
-
- When using the driver, be aware that printing in 600dpi involves
- processing of large amounts of data (> 188MB !). Therefore, the
- driver is not what you would expect to be a fast driver ;-)
- This is no problem when printing a full sized color page (because
- printing itself is slow), but it's really annoying if yoy print only
- text pages. Maybe I can optimize the code for text-only pages in a
- later release. Right now, it is recommended to use the highest
- possible optimisation level your compiler offers....
- For the time beeing, use the cdj550 device with -sBitsPerPixel=3
- for fast proof-prints. If you simply want to print 600dpi b/w data,
- use the cdj550 device with -sBitsPerPixel=8 (or 1).
-
- Since the printer itself is slow, it may help to set the
- process-priority of the gs-process to regular or even less. On a
- 486/100MHZ this is still sufficient to maintain a continuos
- data-flow.
- Note to OS/2 users: Simply put the gs-window into the background,
- or minimize it. Also make sure, that print01.sys is invoked without
- the /irq switch (great speed improvement under warp4).
-
- The printer default settings compensate for dot-gain by a
- calibrated color-transfer function. If this appears to be to light
- for your business-graphs, or for overhead-sheets, feel free to set
- -dMasterGamma=1.7.
-
- Furthermore, you may tweak the gammavalues independently by setting
- -dGammaValC, -dGammaValM, -dGammaValY or -dGammaValK (if not set,
- the values default to MasterGamma). This will only work, when
- -dMasterGamma is set to a value greater than 1.0.
-
- If you want to learn more about gamma, see:
-
- ftp://ftp.igd.fhg.de/pub/doc/colour/GammaFAQ.pdf
-
- Further information, bugs, tips etc, can be found
- at my website.
-
- Have fun!
-
- Uli
-
- uli@bonk.ethz.ch
- http://bonk.ethz.ch
-
- Note: Depending on how you transfered the files,
- you might need to remove some CR-codes used on intel-based machines:
-
- simply type: unzip -a hp850.zip
-
- to compile with gs5.x, simply add
-
- DEVICE_DEVS4=cdj850.dev cdj670.dev cdj890.dev cdj1600.dev
-
- to your makefile.
-
- BTW, it is always a good idea to read make.txt found in the
- gs-distrib before attempting to recompile.....
-
diff --git a/gs/contrib/japanese/doc/gdevdmpr.txt b/gs/contrib/japanese/doc/gdevdmpr.txt
deleted file mode 100644
index 5c64d5d4c..000000000
--- a/gs/contrib/japanese/doc/gdevdmpr.txt
+++ /dev/null
@@ -1,545 +0,0 @@
-¢£ ¢£
-¢£ ¥É¥Ã¥È¥Þ¥È¥ê¥¯¥¹¥×¥ê¥ó¥¿ÈÆÍѥɥ饤¥Ð ¢£
-¢£ dmprt version 2.01 ¢£
-¢£ for Ghostscript version 4.03 ¢£
-¢£ ¢£
-¢£ ÞÉ»³ÏÂŵ ¢£
-¢£ TPM03937@pcvan.or.jp ¢£
-¢£ GHF01532@niftyserve.or.jp ¢£
-¢£ asayama@vsp.cpg.sony.co.jp ¢£
-¢£ ¢£
-
-========================================================================
-¡ü £±¡¥ ¥Õ¥¡¥¤¥ë¹½À®
-========================================================================
-
- ¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ë¤Ï¼¡¤Î¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£Ëܥɥ­¥å¥á¥ó¥ÈÃæ¤Ç¡ÖËÜ
-¥Ñ¥Ã¥±¡¼¥¸¡×¤È¤¤¤¦¾ì¹ç¤Ë¤Ï¤³¤ì¤éÁ´¤Æ¤Î¥Õ¥¡¥¤¥ë¤ò»Ø¤·¤Æ¤¤¤ë¤â¤Î¤È¤·¤Þ¤¹¡£
-
- COPYING GNU General Public License
- gdevdmpr.sj ¤³¤Î¥Õ¥¡¥¤¥ë(Shift JIS)
- gdevdmpr.c ¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë
- dviprlib.c ¡·
- dviprlib.h ¡·
- gdevdmpr.mak Makefile
- escp_24.src dviprt¤Î¥×¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë¤Î¥µ¥ó¥×¥ë
- dmp_init.ps ½é´ü²½¥Õ¥¡¥¤¥ë
- dmp_site.ps ´Ä¶­ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥µ¥ó¥×¥ë
- testpage.ps °ÌÃÖ¹ç¤ï¤»¥Æ¥¹¥ÈÍѤÎPS¥Õ¥¡¥¤¥ë
-
-========================================================================
-¡ü £²¡¥ ³µÍ×
-========================================================================
-
- ¤³¤Î¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð¤Ï¡¢¥Ó¥Ã¥È¥Þ¥Ã¥×¥¤¥á¡¼¥¸¤Î°õ»ú¤Î¤¿¤á¤Î¥×¥ê¥ó¥¿Ì¿Îá
-¤ò¥æ¡¼¥¶¤¬ÄêµÁ¤Ç¤­¤ë¤è¤¦¤Ë¤·¡¢½ÐÍè¤ë¸Â¤ê¿¤¯¤Î¼ïÎà¤Î¥×¥ê¥ó¥¿¤ËÂбþ¤Ç¤­¤ë
-¤è¤¦¤Ë¤·¤¿¤â¤Î¤Ç¤¹¡£
-
- ¥×¥ê¥ó¥¿¥³¡¼¥É¤ÎÄêµÁ¤Ï¡¢MS-DOS ¾å¤Ç¹­¤¯ÍѤ¤¤é¤ì¤Æ¤¤¤ë TeX ÍÑ¥×¥ê¥ó¥¿¥É
-¥é¥¤¥Ð dviprt.exe ¤Î¥×¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë (³ÈÄ¥»Ò.cfg)¡¢¤Þ¤¿¤Ï¤½¤Î¥½¡¼¥¹
-¥Õ¥¡¥¤¥ë (³ÈÄ¥»Ò.src) ¤òÍѤ¤¤ë¡¢¤È¤¤¤¦ÊýË¡¤Ç¹Ô¤¤¤Þ¤¹¡£
-
- ¢¨ ¥×¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë¤Î½ñ¼°¤Ë¤Ä¤¤¤Æ¤Ï dviprt ¤Î¥Æ¥¯¥Ë¥«¥ë¥Þ¥Ë¥å¥¢
- ¥ë texjman.tex (ver. 2.42 °Ê¹ß) ¤ò¤´Í÷¤¯¤À¤µ¤¤¡£tex???ma.lzh(???
- ¤Ï¥Ð¡¼¥¸¥ç¥óÈÖ¹æ) ¤È¤¤¤¦¥Õ¥¡¥¤¥ë̾¤ÇÇÛÉÛ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-
- ¢¨ dviprt ¤Î¥×¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë¤Î»ÅÍͤ¬¥Ð¡¼¥¸¥ç¥ó 2.41.8 °Ê¹ß¤Ç³È
- Ä¥¤µ¤ì¤Þ¤·¤¿¡£dmprt ¤ÎËܥС¼¥¸¥ç¥ó¤Ç¤Ï¤³¤Î¿·¤·¤¤»ÅÍͤˤâÂбþ¤·¤Æ¤¤
- ¤Þ¤¹¡£
-
- ¢¨ dviprt.exe ¤Ï TSG(ÅìµþÂç³ØÍýÏÀ²Ê³Ø¥°¥ë¡¼¥×) µÚ¤Ó PC-VAN SSCIENCE
- ¤Î SHIMA ¤µ¤ó¤Ë¤è¤ë TeX ÍÑ¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð¤Ç¤¹¡£PC-VAN ¤Ç¤Ï
- SSCIENCE ¤Î OSL¡¢Nifty Serve ¤Ç¤Ï FLABO ¤Î¥é¥¤¥Ö¥é¥ê¤Î 11 ÈÖ (TeX
- ÀìÍÑ)¡¢ASCII NET ¤Ç¤Ï pool msdos ¤ÇÆþ¼ê²Äǽ¤Ç¤¹¡£¤Þ¤¿ annonymous
- FTP ¤Ç¤âÆþ¼ê¤Ç¤­¤Þ¤¹¡£
-
- ¢¨ ¥×¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë¤Ï dviprt.exe ¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¥Ñ¥Ã¥±¡¼¥¸
- tex???ut.lzh (??? ¤Ï¥Ð¡¼¥¸¥ç¥óÈÖ¹æ) ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£
-
- ¢¨ dviprt v2.42 ¤Î»þÅÀ¤ÇÇÛÉۥѥ屡¼¥¸¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¥×¥ê¥ó¥¿ÄêµÁ¥Õ
- ¥¡¥¤¥ë¤Ï°Ê²¼¤Î¤È¤ª¤ê¤Ç¤¹¡£
-
- ¤³¤ì¤éÁ´¤Æ¤Î¥×¥ê¥ó¥¿¤Ç¤ÎÆ°ºî³Îǧ¤¬½ÐÍè¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£¤³
- ¤ì¤é¤Î¥×¥ê¥ó¥¿¤ÎÃæ¤ÇÀµ¾ï¤Ë°õ»ú½ÐÍè¤Ê¤¤¾ì¹ç¤Ë¤Ï¤´Ï¢Íí¤¯¤À¤µ¤¤¡£½ÐÍè
- ¤ë¸Â¤êÂн褷¤Þ¤¹¡£
-
- ap850.src EPSON AP-850/MJ-500ÍÑ (48¥É¥Ã¥È)
- ap900.src EPSON AP-900ÍÑ (360dpi)
- art.src Xerox ART mode (240dpi)
- art2.src Xerox ART2 mode (240dpi, Hex mode)
- bj_10v48.src Canon BJ-10/BJ-15ÍÑ (48¥É¥Ã¥È)
- bj_130j.src Canon BJ-130J/BJ-330JÍÑ (48¥É¥Ã¥È)
- dj500.src HP DeskJet 500ÍÑ (300dpi)
- dj505j.src HP DeskJet 500J/300J/505J/505J plusÍÑ (300dpi)
- dj505j1.src HP DeskJet 505J plusÍÑ (300dpi PCL mode1 °µ½Ì)
- dj505j2.src HP DeskJet 505J plusÍÑ (300dpi PCl mode2 °µ½Ì)
- dvi2pbm.src raw PBM ½ÐÎÏÍÑ (118dpi)
- epsimage.src Encapsulated PostScript(TM) Image ½ÐÎÏÍÑ(118dpi)
- escp_24.src EPSON ESC/P (24¥É¥Ã¥È)¥×¥ê¥ó¥¿ÍÑ
- escp_48.src EPSON HG-4800ÍÑ (48¥É¥Ã¥È)
- escp_48a.src EPSON HG-5130ÍÑ (48¥É¥Ã¥È, ÎÙÀܥɥåȲÄ)
- escp_8.src EPSON ESC/P (8¥Ô¥ó)ÍÑ
- fmpr-351.src Fujitsu FMPR-351ÍÑ (48¥É¥Ã¥È)
- g3fax.src G3 FAXÍÑ(200dpi, Header ¤Ê¤·)
- hl_8e.src Brother HL-8eÍÑ (300dpi)
- hp_djp.src HP DeskJet PlusÍÑ (300dpi)
- hp_ljp.src HP LaserJet PlusÍÑ (300dpi)
- jt48escp.src Star JT-48 ESC/P (48 ¥É¥Ã¥È)
- jt48nm.src Star JT-48CL/NM (48 ¥É¥Ã¥È)
- lbp-b406.src Canon LBP-B406ÍÑ(240dpi)
- lbp8_240.src Canon LBP-8/LIPS IIÍÑ (240dpi)
- lbp8_300.src Canon LBP-8/LIPS IIÍÑ (300dpi)
- lcs240.src Casio LCS-240ÍÑ (240dpi)
- lips3.src Canon LIPS IIIÍÑ
- lp3000.src EPSON LP-3000(2000)ÍÑ
- lp7000.src EPSON LP-7000ÍÑ
- lp_rpdl.src RICOH LP3320-SP4 mark2
- / LP2310-SP5 (RPDL)ÍÑ (240dpi)
- l_880.src Kyocera L-880ÍÑ (300dpi)
- nec_page.src NEC PC-PR2000ÍÑ
- nec_pgr.src NEC PC-PR1000,2000,4000ÍÑ (240dpi)
- nec_pgr4.src NEC PC-PR2000,4000ÍÑ (400dpi)
- nm_24.src NEC NM(24¥É¥Ã¥È)ÍÑ
- pc-pr101.src NEC PC-PR101ÍÑ(24¥É¥Ã¥È)
- pc-pr_24.src NEC PC-PR(24¥É¥Ã¥È)ÍÑ
- pc150v48.src NEC PC-PR150V(48¥É¥Ã¥È)ÍÑ
- pc8821.src NEC PC-8821(16¥É¥Ã¥È)ÍÑ
- pc_pr406.src NEC PR406LM(48¥É¥Ã¥È)ÍÑ
- pc_pr602.src NEC PC-PR602RÍÑ (240dpi)
- pr_130ax.src SANYO PR_130AX, TOSHIBA PR-48(J31DPR02)ÍÑ (180dpi)
- pr-48.src Toshiba PR-48 (360dpi)
- r98_dma.src RICOH LP3320-SP4 R98 emulation mode
- Direct Memory Access
- rpdl_dma.src RICOH LP3320-SP4 Direct Memory Access (240dpi)
- smdfax.src SONY SMD50/70 ¥·¥ê¡¼¥ºFAX (200dpi)
- starfax.src StarfaxÍÑ (200dpi)
-
-
-========================================================================
-¡ü £³¡¥ Æ°ºî´Ä¶­
-========================================================================
-
- ¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Ï´ðËÜŪ¤ËÈ󵡼ï°Í¸¤Î¤Ä¤â¤ê¤Ç½ñ¤¤¤Æ¤¢¤ê¤Þ¤¹ (¤¿¤À¤·
-FreeBSD ¾å¤Ç¤·¤«Æ°ºî³Îǧ¤Ï¤ª¤³¤Ê¤Ã¤Æ¤¤¤Þ¤»¤ó)¡£
-
- ¤³¤Î¥É¥é¥¤¥Ð¤òÁȤ߹þ¤à¤³¤È¤¬½ÐÍè¤ë Ghostscript ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤¹¤¬¡¢
-Ghostscript ¤ÎËÜÂΤȥǥХ¤¥¹¥É¥é¥¤¥Ð¤È¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤¬ Ghostscript
-version 4.03 ¤ÈƱÍͤΤâ¤Î¤Ê¤é¤Ð²Äǽ¤Ç¤¹ (2.6.x ¤Ë¤ÏÁȤ߹þ¤á¤Þ¤»¤ó¡£
-2.6.x ¤Ç¤Ï½¾Íè¤Î¤â¤Î¤òÍѤ¤¤Æ²¼¤µ¤¤)¡£
-
-
-========================================================================
-¡ü £´¡¥ ƳÆþ¤Î¼ê½ç
-========================================================================
- ¤³¤³¤Ç¤Ï dmprt ¤¬ÁȤߤ³¤ó¤Ç¤¢¤ë¼Â¹Ô²Äǽ·Á¼°¤Î gs ¤¬´û¤Ë¼ê¸µ¤Ë¤¢¤ë¤â¤Î
-¤È¤·¤ÆÀâÌÀ¤·¤Þ¤¹¡£¥³¥ó¥Ñ¥¤¥ë¤¬É¬Íפʾì¹ç¤Ï¤³¤Î¥É¥­¥å¥á¥ó¥ÈËöÈø¤Î¡Ö¥³¥ó¥Ñ
-¥¤¥ë¡×¤Î¹àÌܤò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-
- dmprt ¤Ï¤ª¤ª¤è¤½ÈÆÍѤΥץê¥ó¥¿¥É¥é¥¤¥Ð¤Ç¤¹¤«¤é¡¢µÕ¤Ë¸À¤¦¤È¥æ¡¼¥¶¤¬ÀßÄê
-¤ò¤ª¤³¤Ê¤Ã¤Æ¤ä¤é¤Ê¤¤¤ÈÀµ¤·¤¯Æ°ºî¤·¤Æ¤¯¤ì¤Þ¤»¤ó¡£
-
- °Ê²¼¤Îºî¶È¤ò¹Ô¤¤¤Þ¤¹¡£
-
-(1) ´Ä¶­ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÊÔ½¸
-(2) ´Ä¶­ÀßÄê¥Õ¥¡¥¤¥ë¤Î»ØÄê
-
------------------------
-¡ú 4.1 ´Ä¶­ÀßÄê¥Õ¥¡¥¤¥ë
------------------------
-
- ´Ä¶­ÀßÄê¥Õ¥¡¥¤¥ë¤Ç¤Ï¡¢¥×¥ê¥ó¥¿¤Îµ¡¼ïÊ̾ðÊó¤Ê¤É¤ò»ØÄꤷ¤Þ¤¹¡£¤Þ¤¿¡¢°õ»ú
-°ÌÃÖ¤ÎÊäÀµ¤Ê¤É¤¬É¬Íפʤé¤Ð¤µ¤é¤Ë¤½¤ì¤ò»ØÄꤷ¤Þ¤¹¡£
-
-
------------------------------
-¡ú 4.2 ´Ä¶­ÀßÄê¥Õ¥¡¥¤¥ë¤Î½ñ¼°
------------------------------
-
- ´Ä¶­ÀßÄê¥Õ¥¡¥¤¥ë dmp_site.ps ¤ÎÂç¤Þ¤«¤Ê½ñ¼°¤òÀâÌÀ¤·¤Þ¤¹¡£¹àÌÜÊ̤ξܺÙ
-¤Ê½ñ¼°¤Ï³Æ¹àÌܤÎÀâÌÀ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-(1) ÀßÄê¥Õ¥¡¥¤¥ë¤Î³«»Ï¡¦½ªÎ»¥³¥Þ¥ó¥É
-
- ÉÕ°¤Î dmp_site.ps ¤ÎºÇ½é¤ÈºÇ¸å¤Î¹Ô¤Ë¤¢¤ë ¡ÖBeginConfig¡× ¤È
- ¡ÖEndConfig¡× ¤È¤¤¤¦Ê¸»úÎó¤Î¤³¤È¤Ç¤¹¡£ÀßÄê¥Õ¥¡¥¤¥ë¤ÎºÇ½é¤ÈºÇ¸å¤Î¹Ô
- ¤Ë¤½¤ì¤¾¤ì¤³¤ì¤é¤Îʸ»úÎ󤬤¢¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ÉÕ°¤Î dmp_site.ps ¤ò
- ÊÔ½¸¤·¤Æ»È¤¦¾ì¹ç¤Ë¤Ï¡¢¤³¤ì¤é¤Î¹Ô¤òºï½ü¤·¤Ê¤¤¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-(2) ¥³¥á¥ó¥È
-
- '%' °Ê¹ß¹ÔËö¤Þ¤Ç¤Ï¥³¥á¥ó¥È¤È¤·¤Æ̵»ë¤µ¤ì¤Þ¤¹¡£
-
-(3) ÏÀÍýÃÍ (¥¹¥¤¥Ã¥Á)
-
- true (¿¿ / on) Ëô¤Ï false (µ¶ / off) ¤Î¤É¤Á¤é¤«¤ÎÃͤǤ¹¡£
-
-(4) ʸ»úÎó
-
- '(' ¤È ')' ¤Ç°Ï¤Þ¤ì¤¿¤â¤Î¤¬Ê¸»úÎó¤Ç¤¹¡£¤³¤ì¤é¤Î³ç¸Ì¤Î´Ö¤Ë¤Ï;ʬ¤Ê
- ¶õÇò¤ò´Þ¤á¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£
-
-(5) Ťµ
- dmp_site.ps ¤ÎÃæ¤Ç¡ÖŤµ¡×¤Ç»ØÄꤹ¤ë¹àÌܤǤÏñ°Ì¤òÉÕ¤±¤ë¤³¤È¤¬½ÐÍè
- ¤Þ¤¹¡£»ÈÍѤǤ­¤ëñ°Ì¤Ï¡¢
-
- ¡¦ in ¥¤¥ó¥Á
- ¡¦ cm ¥»¥ó¥Á¥á¡¼¥È¥ë
- ¡¦ mm ¥ß¥ê¥á¡¼¥È¥ë
- ¡¦ pt ¥Ý¥¤¥ó¥È (1/72.27 ¥¤¥ó¥Á)
- ¡¦ bp ¥Ó¥Ã¥°¥Ý¥¤¥ó¥È (1/72 ¥¤¥ó¥Á)
- ¡¦ dot ¥É¥Ã¥È
-
- ¤Ç¤¹¡£Ã±°Ì¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ï¡Ö¥¤¥ó¥Á¡×¤òñ°Ì¤È¤·¤Æ½èÍý¤·¤Þ¤¹¡£
-
- ñ°Ì¤ò»ØÄꤹ¤ë¾ì¹ç¤Ë¤Ï¡¢¿ôÃͤȤδ֤˶õÇòʸ»ú¤ò¾¯¤Ê¤¯¤È¤â°ì¤ÄÁÞÆþ¤·
- ¤Æ¤¯¤À¤µ¤¤¡£¶õÇòʸ»ú¤¬¿ôÃͤȤδ֤ˤʤ¤¾ì¹ç¡¢¤¦¤Þ¤¯²ò¼á¤Ç¤­¤Þ¤»¤ó¡£
-
- (e.g.) /defaultsize [ 576 bp 792 bp ]
-
-
- ¢¨´Ä¶­ÀßÄê¥Õ¥¡¥¤¥ë¤Ï¼ÂºÝ¤Ë¤Ï PostScript ¥×¥í¥°¥é¥à¤È¤·¤Æ¼Â¹Ô¤µ¤ì²ò¼á
- ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£½¾¤Ã¤Æ¡¢´Ä¶­ÀßÄê¥Õ¥¡¥¤¥ëÃæ¤Ç¤Ï PostScript ¸À¸ì¤¬µö¤¹
- µ­½Ò¤Ï´ðËÜŪ¤Ëµö¤µ¤ì¤Þ¤¹¡£
-
- ¤¿¤À¤·¡¢¤½¤Î¾ì¹ç¤Ëºî¶È¤ÎÅÔ¹ç¾å¼­½ñ¤ËÅÐÏ¿¤ò¹Ô¤Ê¤¦É¬Íפ¬¤¢¤ë¾ì¹ç¤Ë¤Ï
- ´Ä¶­ÀßÄê¥Õ¥¡¥¤¥ëÃæ¤Ç¥í¡¼¥«¥ë¤Ê¼­½ñ¤òºî¤Ã¤Æ¡¢¤½¤Î¼­½ñ¤ËÂФ·¤ÆÅÐÏ¿¤ò
- ¹Ô¤Ê¤Ã¤Æ¤¯¤À¤µ¤¤ (dictfull ¥¨¥é¡¼¤ä»×¤ï¤ÌÉûºîÍѤ¬µ¯¤­¤ë²ÄǽÀ­¤¬¤¢
- ¤ê¤Þ¤¹)¡£¤Þ¤¿¡¢¥ª¥Ú¥é¥ó¥É¥¹¥¿¥Ã¥¯¤ä¼­½ñ¥¹¥¿¥Ã¥¯¤òÇ˲õ¤·¤Ê¤¤¤è¤¦¤Ë
- ½½Ê¬¤Ëµ¤¤òÉÕ¤±¤Æ¤¯¤À¤µ¤¤ (¥´¥ß¤ò»Ä¤µ¤Ê¤¤¤è¤¦¤Ë!!)¡£
-
- ´Ä¶­ÀßÄê¥Õ¥¡¥¤¥ëÃæ¤Ç¤Ï Level 2 ¤Î¥ª¥Ú¥ì¡¼¥¿¤Ï»È¤ï¤Ê¤¤¤è¤¦¤Ë¤·¤Æ¤¯
- ¤À¤µ¤¤¡£
-
------------------------------
-¡ú 4.3 ´Ä¶­ÀßÄê¥Õ¥¡¥¤¥ë¤Î¹àÌÜ
------------------------------
-
- ´Ä¶­ÀßÄê¥Õ¥¡¥¤¥ë dmp_site.ps ¤Ï°Ê²¼¤Î¹àÌܤȥ³¥á¥ó¥È¤«¤é¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
-
- /printer dviprt¤Î¥×¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë
- /resolution ²òÁüÅÙ
- /offset ¸¶ÅÀ°ÜÆ°ÎÌ
- /defaultsize ¥Ç¥Õ¥©¥ë¥È¤ÎÍѻ極¥¤¥º
- /margin °õ»úÉÔ²ÄǽÎΰè
- /maxsize °õ»ú²ÄǽÎΰè¤ÎºÇÂçÈÏ°Ï
- /verbose ¤ª¤·¤ã¤Ù¤ê¥â¡¼¥É(^^;
-
- ¤³¤ì¤é¤ÏÁ´¤Æ¾Êά²Äǽ¤Ê¹àÌܤǤ¹¡£¤¿¤À¤·¡¢/printer ¤òÀßÄꤷ¤Ê¤¤¾ì¹ç¤Ë¤Ï
-ESC/P 24 pins ¤Î¥×¥ê¥ó¥¿¥³¡¼¥É¤òÍѤ¤¤Æ½ÐÎϤ·¤Þ¤¹¤Î¤Ç¡¢¤³¤ì¤Ë³ºÅö¤·¤Ê¤¤¥×
-¥ê¥ó¥¿¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ë¤ÏºÇÄã¸Â¤³¤Î¹àÌܤÏÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£
-
- °Ê²¼¤Ë³Æ¹àÌܤλØÄêË¡¤òÀâÌÀ¤·¤Þ¤¹¡£³Æ¹àÌܤϹÔñ°Ì¤Ç»ØÄꤷ¡¢½ÅÊ£¤·¤¿»ØÄê
-¤ÏºÇ½é¤Î»ØÄê¤Î¤ß¤¬Í­¸ú¤È¤Ê¤ê¤Þ¤¹¡£¤Þ¤¿¡¢ÀßÄê¥Õ¥¡¥¤¥ëÃæ¤Îʸ»ú¤ÏÁ´¤ÆÂçʸ»ú¡¢
-¾®Ê¸»ú¤¬¶èÊ̤µ¤ì¤Þ¤¹¤Î¤ÇÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-(1) /printer
-
- ¡¦ ¡Ô»ØÄêË¡¡Õ
-
- /printer (¥Õ¥¡¥¤¥ë̾)
-
- dviprt ¤Î *.cfg/*.src ¤Î¥Õ¥¡¥¤¥ë̾¤òʸ»úÎó¤Ç»ØÄꤷ¤Þ¤¹¡£³ÈÄ¥»Ò
- ¤Î¾Êά¤Ï¤Ç¤­¤Þ¤»¤ó¡£
-
- MS-DOS ¾å¤Ç»ÈÍѤ¹¤ë¾ì¹ç¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Î¶èÀÚ¤ê¤Ë¤Ï '\' ¤Ç¤Ï¤Ê¤¯
- '/' ¤òÍѤ¤¤ë¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£
-
- ¡¦ ¡Ô»ØÄêÎã¡Õ
-
- /printer (/usr/local/lib/tex/dviprt/escp_24.cfg)
-
- ¡¦ ¡ÔÀâÌÀ¡Õ
-
- dviprt.exe ¤ÇÍѤ¤¤é¤ì¤ë¥×¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë¤Þ¤¿¤Ï¤½¤Î¥½¡¼¥¹¥Õ
- ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤¹¡£
-
- ¤³¤³¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï
-
- (A) Ghostscript ¤Î¥é¥¤¥Ö¥é¥ê¸¡º÷ (use.doc ¤Î File searching ¤Î¹à
- Ìܤò»²¾È) ¤Ë½¾¤Ã¤¿¸¡º÷
- (B) »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë̾¤ò´Ä¶­ÊÑ¿ô TEXCFG ¤ËÀßÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È
- ¥ê̾¤ËÏ¢·ë¤·¤¿¥Õ¥¡¥¤¥ë̾¤Î¥Õ¥¡¥¤¥ë (´Ä¶­ÊÑ¿ô¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë
- ¾ì¹ç¤Î¤ß)
-
- ¤Î½ç¤Ëõ¤µ¤ì¤Þ¤¹¡£
-
- ¤³¤Î¥Õ¥¡¥¤¥ë¤Ï»ÈÍѤ¹¤ë¥×¥ê¥ó¥¿¤Îµ¡¼ï¤Ë¤¢¤Ã¤¿¤â¤Î¤òÍÑ°Õ¤¹¤ëɬÍ×
- ¤¬¤¢¤ê¤Þ¤¹¡£
-
- dviprt ¤ÏÂçÊÑ¿¤¯¤Î¥æ¡¼¥¶¤ò»ý¤Ã¤Æ¤¤¤ë¤¿¤á¤¢¤ê¤¬¤¿¤¤¤³¤È¤Ë¤¿¤¯
- ¤µ¤ó¤Î¥×¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë¤¬´û¤ËºîÀ®¡¦¸ø³«¡¦ÇÛÉÛ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¤Þ
- ¤º¤Ï dviprt ¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¥Ñ¥Ã¥±¡¼¥¸ tex???ut.lzh ¤ËÌÜŪ¤Î¥×¥ê
- ¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë¤¬Ìµ¤¤¤«¤É¤¦¤«³Î¤«¤á¤Æ¤¯¤À¤µ¤¤¡£
-
- ±¿°­¤¯¤´»ÈÍѤΥץê¥ó¥¿ÍѤΥץê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë¤¬ tex???ut.lzh
- ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢¤½¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Ï¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Ç¤¹¤Î
- ¤Ç¥¨¥Ç¥£¥¿¤ÇºîÀ®¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
-
- ¥×¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤È¤½¤ì¤ò¥³¥ó¥Ð¡¼¥È¤·¤¿¥Ð¥¤
- ¥Ê¥ê¥Õ¥¡¥¤¥ë¤È¤Ï¤½¤ÎÆâÍƤ«¤é¼«Æ°È½Ê̤·¤Æ¤¤¤Þ¤¹¡£
-
-(2) /resolution
-
- ¡¦ ¡Ô»ØÄêË¡¡Õ
-
- /resolution [ ²£¤Î²òÁüÅÙ ½Ä¤Î²òÁüÅÙ ]
-
- dot/inch(dpi) ñ°Ì¤Ç¤Î¼Â¿ôɽ¸½¡£
-
- ¡¦ ¡ÔÀßÄêÎã¡Õ
-
- /resolution [ 160 180 ]
-
- ¡¦ ¡ÔÀâÌÀ¡Õ
-
- ²òÁüÅÙ¤ò»ØÄꤷ¤Þ¤¹¡£Ä̾ï¤Ï¥×¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë¤Ëµ­Ï¿¤·¤Æ¤¢¤ë¥×
- ¥ê¥ó¥¿¸ÇÍ­¤Î²òÁüÅÙ¤ò»²¾È¤·¤Þ¤¹¤Î¤Ç¤³¤Î¹àÌܤÎÀßÄê¤ÏɬÍפ¢¤ê¤Þ¤»¤ó
- ¤¬ dviprt ¤Î¥×¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë¤Ï½Ä²£¤Î²òÁüÅÙ¤¬Æ±¤¸¤Ç¤¢¤ë¤³¤È¤ò
- ²¾Äꤷ¤Æ¤¤¤Þ¤¹¤Î¤Ç¤³¤ì¤Ë³ºÅö¤·¤Ê¤¤¥×¥ê¥ó¥¿ (½Ä²£¤Î²òÁüÅÙ¤¬°Û¤Ê¤ë
- ¥×¥ê¥ó¥¿) ¤Ç¤Ï¼Â¹ÔËè¤Ë (Ghostscript ¤Î)-r ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Ê¤±
- ¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£¤Þ¤¿¡¢²òÁüÅÙ¤¬µ­Ï¿¤µ¤ì¤Æ¤¤¤Ê¤¤¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤Î¥×
- ¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ç¤âƱÍͤǤ¹¡£
-
- ²òÁüÅÙ¤ÎÍ¥Àè½ç°Ì¤Ï¡¢
-
- (A) Ghostscript µ¯Æ°»þ¤Î -r ¥ª¥×¥·¥ç¥ó¤Ë¤è¤ë»ØÄê
- (B) ´Ä¶­ÀßÄê¥Õ¥¡¥¤¥ëÃæ¤Î "/resolution" ¤Î¹àÌܤˤè¤ë»ØÄê
- (C) ¥×¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ëÃæ¤Î²òÁüÅÙ
- (D) 180dpi(¥Ç¥Õ¥©¥ë¥È)
-
- ¤Ç¤¹¡£
-
-(3) /offset
-
- ¡¦ ¡ÔÀßÄêË¡¡Õ
-
- /offset [ ²£¤Î°ÜÆ°ÎÌ ½Ä¤Î°ÜÆ°ÎÌ ]
-
- Ťµ¤Ë¤è¤ë»ØÄê¡£
-
- ¡¦ ¡ÔÀßÄêÎã¡Õ
-
- /offset [ 0.0 -0.2 ]
-
- ¡¦ ¡ÔÀâÌÀ¡Õ
-
- ¸¶ÅÀ (½ÐÎÏ¥¤¥á¡¼¥¸¤Îº¸²¼³Ñ) ¤Î²£ / ½ÄÊý¸þ¤Î°ÜÆ°Î̤ò»ØÄꤷ¤Þ¤¹¡£
-
- °õ»ú²ÄǽÎΰè¤ÎÏȤ«¤éÇÁ¤¤¤Æ¸«¤¨¤ëÉôʬ¤¬¤³¤³¤Ç»ØÄꤵ¤ì¤¿Ê¬¤À¤±Ê¿
- ¹Ô°ÜÆ°¤¹¤ë¡¢¤È¤¤¤¦¥¤¥á¡¼¥¸¤ò»ý¤Ã¤Æ¤¤¤¿¤À¤±¤Ð¤¤¤¤¤Ç¤·¤ç¤¦¡£
-
- Íѻ汦¡¢¾åÊý¸þ¤¬¤½¤ì¤¾¤ì¤ÎÀµÊý¸þ¤Ç¤¹¡£
-
- ¾Êά¤µ¤ì¤¿¾ì¹ç¤Ï½Ä²£ÁÐÊý¸þ 0 ¥¤¥ó¥Á¤Ç¤¹¡£
-
- ¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ë¤Ï°ÌÃÖ¹ç¤ï¤»¤Î¤¿¤á¤Î PS ¥Õ¥¡¥¤¥ë (testpage.ps)
- ¤¬ÉÕ°¤·¤Æ¤¤¤Þ¤¹¡£¤³¤Î¥Õ¥¡¥¤¥ë¤ÏÍÑ»æ¤Î±ï¤«¤é¡¢Æ⦠1.5cm¡¢1inch¡¢
- µÚ¤Ó 3cm ¤Î°ÌÃÖ¤Ë 1 dot Éý¤ÎºÙ¤¤Àþ¤ÇÏȤò½ñ¤¯¤À¤±¤Î¤â¤Î¤Ç¤¹¡£
-
- testpage.ps ¤Ç¤ÏÍѻ極¥¤¥º¤Ï¡¢¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤ÎÉÁ²èÈϰϤËÅù¤·
- ¤¤¤â¤Î¤È¤ß¤Ê¤µ¤ì¤Þ¤¹¡£Î㤨¤Ð -sPAPERSIZE=b5 ¤È¤¤¤¦¥ª¥×¥·¥ç¥ó¤òÉÕ
- ¤±¤Æ Ghostscript ¤òµ¯Æ°¤¹¤ì¤ÐÍѻ極¥¤¥º¤Ï B5 ¤Ç¤¢¤ë¤È²¾Äꤵ¤ì¡¢
- ¤Þ¤¿¡¢Ghostscript ¤ËÉÁ²èÈϰϤò»ØÄꤹ¤ë¥ª¥×¥·¥ç¥ó (-g¡¢
- -sPAPERSIZE) ¤òÉÕ¤±¤º¤Ëµ¯Æ°¤·¤¿¾ì¹ç¤Ë¤Ï¡¢¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤Î¥Ç¥Õ
- ¥©¥ë¥È¤ÎÉÁ²èÈϰϤ¬Íѻ極¥¤¥º¤Ç¤¢¤ë¤È¤µ¤ì¤Þ¤¹¡£
-
- -sPAPERSIZE ¥ª¥×¥·¥ç¥ó¤È -g ¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤Æ¤Ï Ghostscript
- ¤Î¥É¥­¥å¥á¥ó¥È use.doc ¤ò¤´Í÷¤¯¤À¤µ¤¤¡£
-
- Î㤨¤Ð¡¢¼¡¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡£
-
- gs -dNOPAUSE -sDEVICE=dmprt -sPAPERSIZE=b5 -- testpage.ps
-
- ¤³¤Î¥Õ¥¡¥¤¥ë testpage.ps ¤Î½ÐÎÏ°ÌÃÖ¤¬¤º¤ì¤ë¾ì¹ç¤Ë¤ÏÀµ¤·¤¤°ÌÃÖ
- ¤ËÏȤ¬¤¯¤ë¤è¤¦¤Ë /offset ¤ÎÃͤòÄ´Àᤷ¤Æ¤¯¤À¤µ¤¤¡£
-
-(4) /defaultsize
-
- ¡¦ ¡ÔÀßÄêË¡¡Õ
-
- /defaultsize [ Éý ¹â ]
-
- Ťµ¤Ë¤è¤ë»ØÄê¡£
-
- ¡¦ ¡ÔÀßÄêÎã¡Õ
-
- /defaultsize [ 8.0 11.0 ]
-
- ¡¦ ¡ÔÀâÌÀ¡Õ
-
- Ghostscript ¤Îµ¯Æ°¥ª¥×¥·¥ç¥ó¤Ç°õ»úÎΰè¤ÎÉý¡¦¹â¤Î»ØÄê (-g ¥ª¥×
- ¥·¥ç¥ó¡¢-sPAPERSIZE ¥ª¥×¥·¥ç¥ó) ¤¬¤Ê¤¤¾ì¹ç¤Î°õ»úÎΰè¤ò»ØÄꤷ¤Þ¤¹¡£
-
- »ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢Éý 8.3 ¥¤¥ó¥Á¡¢¹â 11.7 ¥¤¥ó¥Á¤Ç¤¹¡£
-
-(5) /margin
-
- ¡¦ ¡ÔÀßÄêË¡¡Õ
-
- /margin [ º¸ ²¼ ±¦ ¾å ]
-
- Ťµ¤Ë¤è¤ë»ØÄê¡£
-
- ¡¦ ¡ÔÀßÄêÎã¡Õ
-
- /margin [ 3.675 mm 12.7 mm 3.675 mm 6.5 mm ]
-
- ¡¦ ¡ÔÀâÌÀ¡Õ
-
- ÍÑ»æ¤Î¤¦¤Á¥×¥ê¥ó¥¿¤¬°õ»ú¤¹¤ë¤³¤È¤¬½ÐÍè¤Ê¤¤Éôʬ¤òÍÑ»æ¾å²¼º¸±¦¤Î
- ü¤«¤é¤ÎŤµ¤Ç»ØÄꤷ¤Þ¤¹¡£
-
- ¤³¤³¤Ç»ØÄꤵ¤ì¤¿Îΰè¤Î¥¤¥á¡¼¥¸¤Ï¥×¥ê¥ó¥¿¤Ë½ÐÎϤµ¤ì¤Þ¤»¤ó (c.f.
- /maxsize)¡£
-
- »ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¤Ï¾å²¼º¸±¦Á´¤Æ 0 ¥¤¥ó¥Á¤Ç¤¹¡£
-
-(6) /maxsize
-
- ¡¦ ¡ÔÀßÄêË¡¡Õ
-
- /maxsize [ Éý ¹â ]
-
- Ťµ¤Ë¤è¤ë»ØÄê¡£
-
- ¡¦ ¡ÔÀßÄêÎã¡Õ
-
- /maxsize [ 8.0 11.0 ]
-
- ¡¦ ¡ÔÀâÌÀ¡Õ
-
- ¥×¥ê¥ó¥¿¤Î°õ»ú²ÄǽÎΰè¤ÎºÇÂ祵¥¤¥º¤ò»ØÄꤷ¤Þ¤¹¡£¤³¤Î¥µ¥¤¥º¤«¤é
- ¤Ï¤ß½Ð¤¹Éôʬ¤Ï»ØÄꤵ¤ì¤¿Íѻ極¥¤¥º¤ä¥Þ¡¼¥¸¥ó¤Ë¤«¤«¤ï¤é¤º½ÐÎϤµ¤ì
- ¤Ê¤¯¤Ê¤ê¤Þ¤¹ (±¦¡¢¾å¤¬ÀÚ¤ì¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹)¡£
-
- Î㤨¤ÐºÇÂç°õ»ú²ÄǽÉý¤ò±Û¤¨¤ë¥¤¥á¡¼¥¸¤òÁ÷¤Ã¤¿¾ì¹ç¤Ë¤½¤Î¤Ö¤ó¤ò̵
- »ë¤»¤º¤Ë¼¡¤Î¹Ô¤ËÀÞ¤êÊÖ¤·¤Æ°õ»ú¤·¤Æ¤·¤Þ¤¦¥×¥ê¥ó¥¿¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì
- ¹ç¤ä¡¢Ä¹¤¹¤®¤ë¥Ú¡¼¥¸¤ò½ÐÎϤ·¤¿¾ì¹ç¤Ë¼¡¤ÎÍÑ»æ¤Ë³¤­¤ò½ÐÎϤ·¤Æ¤·¤Þ
- ¤¦¾ì¹ç¤Ê¤É¤Ë¤³¤Î¹àÌܤòÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£
-
- 0 Ëô¤ÏÉé¤ÎÃͤϡÖ̵¸ÂÂç¡×¤ò°ÕÌ£¤·¤Þ¤¹¡£Éý¡¢¹â¤µ¤Î»ØÄê¤ÏÆÈΩ¤Ç¤¹¡£
- ¤¹¤Ê¤ï¤ÁÎ㤨¤ÐÉý¤¬ 8 ¥¤¥ó¥Á¡¢¹â¤µ¤¬Ìµ¸ÂÂç¡¢¤È¤¤¤¦»ØÄê¤â²Äǽ¤Ç¤¹¡£
-
- (e.g.) /maxsize [ 8.0 0 ]
-
- »ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï½Ä²£ÁÐÊý¸þ¤¬Ìµ¸ÂÂç¤Ç¤¹¡£
-
- ½ÐÎϤµ¤ì¤ë¥¤¥á¡¼¥¸¤Î¥µ¥¤¥º¤¬Íѻ極¥¤¥º¤«¤é¥Þ¡¼¥¸¥ó¤òº¹¤·°ú¤¤¤¿
- ¥µ¥¤¥º¤è¤êÂ礭¤¤¤È¤­¤Ë½ÐÎÏ¥¤¥á¡¼¥¸¤Î¥µ¥¤¥º¤ò¤³¤³¤ÇÀßÄꤵ¤ì¤¿ÃͤË
- ÃÖ¤­´¹¤¨¤Æ½èÍý¤µ¤ì¤Þ¤¹ (ÀßÄꤵ¤ì¤¿Ãͤ¬ 0 °Ê²¼¤Ç¤¢¤ì¤Ð¤³¤ÎÃÖ¤­´¹
- ¤¨¤Ï¹Ô¤ï¤ì¤Þ¤»¤ó)¡£
-
-(7) /verbose
-
- ¡¦ ¡ÔÀßÄêË¡¡Õ
-
- /verbose ÏÀÍýÃÍ
-
- ¡¦ ¡ÔÀßÄêÎã¡Õ
-
- /verbose true
-
- ¡¦ ¡ÔÀâÌÀ¡Õ
-
- ¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤ÎÆ°ºî¾õÂÖ¤ò¾Ü¤·¤¯É½¼¨¤¹¤ë¤«¤É¤¦¤«¤Î»ØÄê¤Ç¤¹¡£½Ð
- ÎÏÃæ¤Î¥Ú¡¼¥¸¤ÎÄ̤·ÈÖ¹æ¤ä½ÐÎÏ¥³¡¼¥É¤Î¥Ð¥¤¥È¿ô¤Ê¤É¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£
-
- ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï false (off) ¤Ç¤¹ (²¿¤âɽ¼¨¤µ¤ì¤Þ¤»¤ó)¡£
-
- ¤³¤Î¹àÌܤ¬ true (on) ¤ËÀßÄꤷ¤Æ¤¢¤Ã¤Æ¤â¡¢Ghostscript ¤Îµ¯Æ°¥ª¥×
- ¥·¥ç¥ó¤Ç -q ¥ª¥×¥·¥ç¥ó (QUIET) ¤¬»ØÄꤷ¤Æ¤¢¤ì¤Ð¡¢¤³¤Î¹àÌܤÎÀßÄê
- ¤¬ off ¤Î¾ì¹ç¤ÈƱ¤¸Æ°ºî¤ò¤·¤Þ¤¹¡£
-
------------------------------
-¡ú 4.4 ´Ä¶­ÀßÄê¥Õ¥¡¥¤¥ë¤Î»ØÄê
------------------------------
- dmprt ¥É¥é¥¤¥Ð¤¬ÁȤ߹þ¤Þ¤ì¤¿ Ghostscript ¤Ïµ¯Æ°»þ¤Ë dmp_init.ps µÚ¤Ó
-dmp_site.ps ¤ò Ghostscript ¤Î¥Õ¥¡¥¤¥ë¸¡º÷¥Ñ¥¹¾å¤«¤éÆɤ߹þ¤ß¤Þ¤¹¡£¤³¤ì¤é
-¤Î¥Õ¥¡¥¤¥ë¤Ï Ghostscript ¤Î¥Õ¥¡¥¤¥ë¸¡º÷¥Ñ¥¹¾å¤ËÃÖ¤¤¤Æ¤¯¤À¤µ¤¤¡£
-dmp_site.ps(´Ä¶­ÄêµÁ¥Õ¥¡¥¤¥ë) ¤¬¸«¤Ä¤«¤é¤Ê¤±¤ì¤ÐÆɤ߹þ¤ß¤òÄü¤á¤Æ¥Ç¥Õ¥©¥ë
-¥È¤ÎÀßÄê (ESC/P 24 pin) ¤òÍѤ¤¤Þ¤¹¡£
-
- dmp_site.ps ¤ÎÂå¤ï¤ê¤ËÊ̤Υե¡¥¤¥ë¤ò»ØÄꤷ¤ÆÆɤ߹þ¤à¤³¤È¤â²Äǽ¤Ç¤¹¡£
-Ghostscript µ¯Æ°»þ¤Ë¤½¤Î¥Õ¥¡¥¤¥ë̾¤ò -sDMPCONFIG= ¥Õ¥¡¥¤¥ë̾ ¤Î¤è¤¦¤Ë»Ø
-Äꤷ¤Æ¤¯¤À¤µ¤¤¡£¤³¤Î¾ì¹ç¤Ë»ØÄꤹ¤ë¥Õ¥¡¥¤¥ë¤òÃÖ¤¯¥Ç¥£¥ì¥¯¥È¥ê¤â
-dmp_init.ps ¤Ê¤É¤ÈƱÍͤǤ¹¡£
-
- (e.g.) gs -sDEVICE=dmprt -sDMPCONFIG=dmp_local.ps -dNOPAUSE -- tiger.ps
-
-
-========================================================================
-¡ü £µ¡¥ »ÈÍÑË¡
-========================================================================
-
- dmp_site.ps ¤ÎÀßÄê°Ê³°¤Ë¤ÏÆÃÊ̤ʤ³¤È¤ò¹Ô¤¦É¬ÍפϤ¢¤ê¤Þ¤»¤ó¡£gs ¤Î¥Ç¥Ð
-¥¤¥¹¤È¤·¤Æ "dmprt" ¤ò»ØÄꤷ¤Æµ¯Æ°¤·¤Æ¤¯¤À¤µ¤¤ (¾¤Î¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤ÈƱ
-ÍͤλȤ¤Êý)¡£
-
- (e.g.) gs -sDEVICE=dmprt sample.ps
-
-
-========================================================================
-¡ü £¶¡¥ ¼Õ¼­
-========================================================================
-
- ¡þ PC-VAN SSCIENCE ¤Î FKR ¤µ¤ó¤Ë¤Ï 386BSD ¤Ç¤ÎÍøÍѤˤª¤±¤ëÉÔ¶ñ¹ç¤ò½¤Àµ
- ¤·¤Æ¤¤¤¿¤À¤­¤Þ¤·¤¿¡£
-
- ¡þ CCITTFax ¥¨¥ó¥³¡¼¥À¤Î¼ÂÁõ¤Ë¤¢¤¿¤Ã¤Æ¤Ï¡¢¤½¤Î¥³¡¼¥É¤ò Godohoji ¤µ¤óµÚ
- ¤Ó SHIMA ¤µ¤ó¤Ë¤è¤ë Fax Endode/Decode ¥é¥¤¥Ö¥é¥êÃæ¤Î¤â¤Î¤ò¸µ¤Ë¤µ¤»¤Æ
- ¤¤¤¿¤À¤­¤Þ¤·¤¿¡£
-
- ¡þ ¤½¤·¤Æ²¿¤è¤ê dviprt/dviout ¤È¤¤¤¦¹âµ¡Ç½ DVI ¥É¥é¥¤¥Ð¤ò³«È¯¡¦³ÈÄ¥¤·¤Æ
- ²¼¤µ¤Ã¤¿ PC-VAN SSCIENCE ¤Î SHIMA ¤µ¤ó¤ò¤Ï¤¸¤á¤È¤¹¤ë³«È¯¼Ô¤ÎÊý¡¹¤Ë´¶
- ¼Õ¤·¤Þ¤¹¡£
-
-
-========================================================================
-¡ü £·¡¥ ¥³¥ó¥Ñ¥¤¥ë
-========================================================================
-
- °Ê²¼¤Î¼ê½ç¤Ç¥³¥ó¥Ñ¥¤¥ë¤·¤Æ²¼¤µ¤¤¡£
-
-(1) gdevdmpr.c¡¢dviprlib.c¡¢dviprlib.h ¤ò¾¤Î Ghostscript ¤Î¥½¡¼¥¹¤ÈƱ¤¸
- ¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤¯¡£
-
-(2) devs.mak ¤Ë gdevdmpr.mak ¤ÎÆâÍƤòÄɲ乤롣
-
-(3) *-head.mak Ãæ¤Î¥Þ¥¯¥í "DEVICE_DEVS?" ¤Ë "dmprt.dev" ¤ò²Ã¤¨¤ë¡£
-
-(4) tar_cat ¤ò¼Â¹Ô¤¹¤ë¡£
-
-(5) make ¤¹¤ë¡£
-
-
-========================================================================
-¡ü £¸¡¥ Ãøºî¸¢¡¦Êݾڡ¦ºÆÇÛÉÛ¡¦²þÊÑ
-========================================================================
-
- Ãøºî¸¢¤Ïºî¼Ô¤Ç¤¢¤ëÞÉ»³ (TPM03937@pcvan.or.jp) ¤¬ÊÝÍ­¤·¤Þ¤¹¡£Ëܥѥ屡¼
-¥¸¤Ë´Þ¤Þ¤ì¤ëÁ´¤Æ¤Î¥×¥í¥°¥é¥àµÚ¤Ó¥É¥­¥å¥á¥ó¥È¤Ï̵ÊݾڤǤ¹¡£
-
- ÊݾڵڤӺÆÇÛÉÛ¡¦²þÊѤ˴ؤ¹¤ë¾ò·ï¤ÏÁ´¤Æ GNU General Public License (GNU
-GPL) ¤Ë½¾¤¤¤Þ¤¹¡£GNU GPL ¤ÏÉÕ°¤Î COPYING ¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤Þ
-¤¹¡£
-
-
-========================================================================
-¡ü £¸¡¥ ÍúÎò
-========================================================================
-
-1997.5.13.
-
- ¡þ Ghostscript 4.03 ¤ËÂбþ¡£
- ¡þ *.src ¤¬Àµ¤·¤¯Æɤ߹þ¤á¤Ê¤¤¾ì¹ç (line_feed, form_feed ¤¬Ì¤ÄêµÁ¤Î *.src)
- ¤¬¤¢¤ëÉÔ¶ñ¹ç¤ò½¤Àµ¡£
- ¡þ -sDMPSITE ¤Î½èÍý¤¬Àµ¤·¤¯¤ª¤³¤Ê¤ï¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿ÉÔ¶ñ¹ç¤ò½¤Àµ¡£
- ¡þ setpagedevice ¥ª¥Ú¥ì¡¼¥¿¤ÇÀßÄê²Äǽ¤ÊÀßÄê¹àÌܤο¤¯¤òºï½ü¡£
- ¡þ DJ's GPP ¤Ø¤ÎÂбþ¤òÅà·ë (³«È¯´Ä¶­¤È²Ë¤¬¤Ê¤¯¤Ê¤Ã¤¿¤¿¤á)¡£
- ¡þ testpage.ps ¤¬ Level 2 ¤Ç¤¦¤Þ¤¯½ÐÎϤǤ­¤Ê¤«¤Ã¤¿ÉÔ¶ñ¹ç¤ò½¤Àµ¡£
-
-
- ÞÉ»³ ÏÂŵ (ASAYAMA Kazunori)
- TPM03937@pcvan.or.jp
- GHF01532@niftyserve.or.jp
- asayama@vsp.cpg.sony.co.jp
diff --git a/gs/contrib/japanese/doc/gdevfmlbp.txt b/gs/contrib/japanese/doc/gdevfmlbp.txt
deleted file mode 100644
index 782867b7b..000000000
--- a/gs/contrib/japanese/doc/gdevfmlbp.txt
+++ /dev/null
@@ -1,81 +0,0 @@
-
- gdevfmlbp.c - Fujitsu FMLBP2xx ÍѥǥХ¤¥¹¥É¥é¥¤¥Ð
-
- Version 1.2 1998/03/30
-
-¢¡ ¤Ï¤¸¤á¤Ë
-
- ¤³¤ì¤Ï¡¢ghostscript 2.6.1 ¤Ç¡¢FMLBP2xx ·Ï¤Î¥Ú¡¼¥¸¥×¥ê¥ó¥¿¤ò»È¤¦¤¿¤á¤Î
- ¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤Ç¤¹¡£
-
-
-¢¡ ¥¤¥ó¥¹¥È¡¼¥ëÊýË¡
-
- 1. gdevfmlbp.c ¤ò ghostscript 2.6.1 ¤Î¥½¡¼¥¹¥×¥í¥°¥é¥à¤òŸ³«¤·¤¿
- ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥³¥Ô¡¼¤·¤Þ¤¹¡£
-
- 2. Makefile ¤Ë gdevfmlbp.mak ¤òÄɲä·¤Þ¤¹¡£
-
- 3. Makefile ¤Î DEVICE_DEVS ¤Ë fmlbp.dev ¤ò²Ã¤¨¤Þ¤¹¡£
-
- Îã: DEVICE_DEVS=x11.dev fmlbp.dev
- ~~~~~~~~~
- 4. make ¥³¥Þ¥ó¥É¤Ç gs ¤ò¥³¥ó¥Ñ¥¤¥ë¤·¡¢¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤¹¡£
-
-
-¢¡ »ÈÍÑÊýË¡
-
- ¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤ÎÁªÂò¤Ï -sDEVICE ¥ª¥×¥·¥ç¥ó¤Ë¤è¤Ã¤Æ¹Ô¤Ê¤¤¤Þ¤¹¡£
-
- Îã: gs -sDEVICE=fmlbp
-
- (Ãí°Õ)¥×¥ê¥ó¥¿ËÜÂΤΥ¨¥ß¥å¥ì¡¼¥·¥ç¥óÀßÄê¤ò FM¥â¡¼¥É¤ËÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£
-
- ¥Ç¥Õ¥©¥ë¥È¤Î²òÁüÅÙ¤Ï 400dpi ¤Ç¤¹¡£240dpi ¤Ç°õºþ¤¹¤ë¾ì¹ç¤Ï¡¢¼¡¤Î¤è¤¦¤Ë
- -r ¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤Þ¤¹¡£
-
- Îã: gs -sDEVICE=fmlbp -r240
-
- (Ãí°Õ) -r ¥ª¥×¥·¥ç¥ó¤ÎÃͤϥÁ¥§¥Ã¥¯¤·¤Æ¤¤¤Þ¤»¤ó¡£
-
- Íѻ極¥¤¥º¤ò»ØÄꤹ¤ë¾ì¹ç¤Ë¤Ï¡¢-sPAPERSIZE ¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤Þ¤¹¡£
- »ØÄê²Äǽ¤Ê¥µ¥¤¥º¤Ï¡¢a3, a4, a5, b4, b5, legal, letter ¤Ç¤¹¡£
- ¥Ç¥Õ¥©¥ë¥È¤ÎÍÑ»æ¤Ï a4 ¤Ç¤¹¡£a3 ¤ò»ØÄꤹ¤ë»þ¤Ï¼¡¤Î¤è¤¦¤Ë»ØÄꤷ¤Þ¤¹¡£
-
- Îã: gs -sDEVICE=fmlbp -sPAPERSIZE=a3
-
-
-¢¡ ¥Ð¥°/À©¸Â»ö¹à
-
- o Æ°ºî³Îǧ¤Ï¡¢Solaris¾å¤Î ghostscript 2.6.1j ¤È FMLBP226 ¤Ç¹Ô¤Ê¤Ã¤Æ¤Þ¤¹¡£
-
- o ¤ª¤½¤é¤¯ Aladdin ÈǤΠghostcript 5.01 ¤Ç¤âÆ°ºî¤¹¤ë¤È»×¤¤¤Þ¤¹¤¬¡¢³Îǧ
- ¤·¤Æ¤¤¤Þ¤»¤ó¡£5.01 ¤Ç¤Ï gdevfmlbp.mk5 ¤ò gdevfmlbp.mak ¤ÎÂå¤ê¤Ë»î¤·¤Æ
- ¤ß¤Æ¤¯¤À¤µ¤¤¡£
-
- o ÍÑ»æ¤Ï a3, a4, a5, b4, b5, legal, letter, ¥Ï¥¬¥­ ¤ËÂбþ¤µ¤»¤Þ¤·¤¿¤¬¡¢
- a4 °Ê³°¤Ï¡¢¤¢¤Þ¤ê¥Æ¥¹¥È¤·¤Æ¤¤¤Þ¤»¤ó¤Î¤Ç¡¢ÌäÂ꤬¤¢¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-
-
-¢¡ ¤ª¤ï¤ê¤Ë
-
- o ¤³¤Î FMLBP2xx Íѥɥ饤¥Ð¤Ï¡¢À®¾¾¹¨»á¤Î ESC/Page Íѥɥ饤¥Ð gdevepag ¤ò
- ¸åÆ£ÏÂÌлá <goto@statabo.rim.or.jp> ¤¬¡¢FMLBP2xx ÍѤ˲þ¤¤·¤¿Êª¤Ç¤¹¡£
- ½¤Àµ¤ª¤è¤Ó³ÈÄ¥¤ò Ã滳Àµ°ì <naka@fadev.fvd.fujitsu.co.jp> ¤¬¹Ô¤Ã¤Æ¤¤¤Þ¤¹¡£
-
- ¤Ê¤ª¡¢ESC/Page Íѥɥ饤¥Ð¤Ï¡¢Tom Quinn»á <trq@prg.oxford.ac.uk> ºîÀ®¤Î
- lbp8 Íѥɥ饤¥Ð¤òÀ®¾¾¹¨»á <nari@lsi.tmg.nec.co.jp> ¤¬¡¢ESC/Page ÍѤË
- ²þ¤¤·¤¿Êª¤Ç¤¹¡£
-
- o ÇÛÉÛ¾ò·ï¤Ï¡¢¤â¤È¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ÈƱÍÍ GPL ¤Ë½¾¤¤¤Þ¤¹¡£
-
- o »ä¤âÉÙ»ÎÄÌVLSI(³ô)¤âÉÙ»ÎÄÌ(³ô)¤â¡¢ËÜ¥½¥Õ¥È¥¦¥§¥¢¤Î½¤Àµ¤½¤Î¾¡¢Ç¡²¿¤Ê¤ë
- Êݼé¤Ë¤Ä¤¤¤Æ¤âµÁ̳¤òÉ餤¤Þ¤»¤ó¡£¤Þ¤¿¡¢ËÜ¥½¥Õ¥È¥¦¥§¥¢¤ò»ÈÍѤ¹¤ë¤³¤È¤Ë
- ¤è¤Ã¤ÆÇ¡²¿¤Ê¤ë»³²¤¬À¸¤¸¤Æ¤â°ìÀÚÀÕǤ¤òÉ餤¤Þ¤»¤ó¡£
- ³Æ¼«¤ÎÀÕǤ¤Ç¥×¥í¥°¥é¥à¤ò¤´»ÈÍѤ¯¤À¤µ¤¤¡£
-
- o ¤´°Õ¸«¡¦¤´Í×˾¤Ê¤É¤Ï¡¢naka@fadev.fvd.fujitsu.co.jp ¤Ø¤ª´ê¤¤¤·¤Þ¤¹¡£
-
-
- ÉÙ»ÎÄÌVLSI(³ô) Ã滳 Àµ°ì <naka@fadev.fvd.fujitsu.co.jp>
-[EOF]
diff --git a/gs/contrib/japanese/doc/gdevj100.txt b/gs/contrib/japanese/doc/gdevj100.txt
deleted file mode 100644
index 78b34cc7e..000000000
--- a/gs/contrib/japanese/doc/gdevj100.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-
- gdevj100.c - Star JJ-100 ÍѥǥХ¤¥¹¥É¥é¥¤¥Ð
-
-
-¡û¥¤¥ó¥¹¥È¡¼¥ëÊýË¡
-
-1. gdevj100.c ¤ò gs261 ¤Î¥½¡¼¥¹¥×¥í¥°¥é¥à¤¬¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥³¥Ô¡¼¤·
-¤Æ²¼¤µ¤¤¡£
-
-2. Makefile ¤Ë gdevj100.mak ¤òÄɲ䷤Ʋ¼¤µ¤¤¡£
-
-3. Makefile ¤Î DEVICE_DEVS ¤Ë jj100.dev ¤ò²Ã¤¨¤Æ²¼¤µ¤¤¡£
-
- Îã) DEVICE_DEVS=pc98.dev jj100.dev
- ^^^^^^^^^
-4. make ¥³¥Þ¥ó¥É¤Ç gs ¤ò¥³¥ó¥Ñ¥¤¥ë¤·¡¢¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ²¼¤µ¤¤¡£
-
-
-¡û»È¤¤Êý
-
-¡ö¥Ç¥Ð¥¤¥¹¤ÎÁªÂò¤Ï -sDEVICE ¥ª¥×¥·¥ç¥ó¤Ë¤è¤Ã¤Æ¹Ô¤Ê¤¤¤Þ¤¹¡£
-
- Îã) gs -sDEVICE=jj100 (jj100¤ò»ØÄê)
- gs -sDEVICE=pc98 (pc98¤ò»ØÄê)
-
-
-
- ²£»³ÏÂͳ (caz@psq.mei.co.jp)
diff --git a/gs/contrib/japanese/doc/gdevlbp3.txt b/gs/contrib/japanese/doc/gdevlbp3.txt
deleted file mode 100644
index df023fd85..000000000
--- a/gs/contrib/japanese/doc/gdevlbp3.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-+---------------------------------------------------------------------+
-| |
-| $BI8=`(B/$B%U%!%$%s%$%a!<%8%b!<%I(B $BBP1~(B Ghostscript $B%G%P%$%9%I%i%$%P(B |
-| Ver 1.0.0 1999/05/23 |
-+---------------------------------------------------------------------+
-
-$B@bL@(B
- LBP-310/320/Pro $B$N%$%a!<%8%b!<%I$r;H$C$F=PNO$r9T$&%I%i%$%P$G$9!#(B
- LIPS3 $B$G$N=PNO;~$KHf$Y$F(B 600dpi$B$N9b2rA|EY$,;H$($k$H$$$&MxE@$,$"$j$^$9!#(B
-
-$B%$%s%9%H!<%kJ}K!(B
- 1. Ghostscript $B$N%=!<%9%G%#%l%/%H%j$K(B gdevlbp3.c $B$r%3%T!<$9$k!#(B
- 2a. 5.10 $B0JA0$N>l9g$O(B Makefile $B$K(B gdevlbp3.mak $B$rDI2C$9$k!#(B
- 2b. 5.50 $B0J9_$N>l9g$O(B contrib.mak $B$K(B gdevlbp3.mak.gs55 $B$rDI2C$9$k!#(B
- 3. Makefile $B$N(B DEVICE_DEVS $B$K(B lbp310.dev $B$H(B lbp320.dev $B$rDI2C$9$k!#(B
- 4. Ghostscript $B$r%3%s%Q%$%k$9$k!#(B
-
-$B;HMQJ}K!(B
- $B%G%P%$%9L>$K$O(B lbp310 $B$^$?$O(B lbp320 $B$r;XDj$7$F$/$@$5$$!#(B
- [ $BNc(B ]
- gs -sDEVICE=lbp310 -sOutputFile=|lpr -dNOPAUSE -dBATCH -q hoge.ps
- $B2rA|EY$O(B -r $B$G;XDj$7$F$/$@$5$$!#(B
- $B;XDj$G$-$k2rA|EY$O(B300,600$B$G%G%U%)%k%H$O(B600$B$G$9!#(B
-
- $B!v$3$N%I%i%$%P$O0J2<$N4D6-$GF0:n3NG'$5$l$F$$$^$9!#(B
- FreeBSD 4.0-current/3.1-stable
- XFree86 3.3.3.1
- LBP-310
- Ghostscript 5.10/5.50($B6&$K(BVFlib$BBP1~(B)
- 2.x $B$G$O@5>o$K%3%s%Q%$%k$G$-$J$$$H;W$$$^$9!#(B
- $B!v(BB5$B%5%$%:$OF|K\%5%$%:$G$9!#(BGhostscript $B$N(B B5 $B$O(B ISO B5 $B$G$9$N$G!"0u;z(B
- $B7k2L$,>/$7:8>e$K4s$C$?46$8$K$J$j$^$9!#(B
- $B!v(BLBP-320 $B$K$D$$$F$OF0:n$9$k$H$$$&Js9p$r$$$?$@$-$^$7$?$,!"$^$@%P%0$,(B
- $B;D$C$F$$$k$+$b$7$l$^$;$s!#(B
- $B!v0l1~(B GPL $B=`5r$H$$$&$3$H$G;HMQ$7$F$/$@$5$$!#(B
-----------------------------------------
-$B@>B<(B $BD>Li(B <naoya@mahoroba.ne.jp> \ No newline at end of file
diff --git a/gs/contrib/japanese/doc/gdevmag.txt b/gs/contrib/japanese/doc/gdevmag.txt
deleted file mode 100644
index 09f0f16e8..000000000
--- a/gs/contrib/japanese/doc/gdevmag.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-¢£ ¢£
-¢£ Ëî¥Õ¥©¡¼¥Þ¥Ã¥È¥É¥é¥¤¥Ð version 1.0 ¢£
-¢£ Copyright (C) 1994 ÞÉ»³ÏÂŵ ¢£
-¢£ ¢£
-
-========================================================================
-¡ü £±¡¥ ³µÍ×
-========================================================================
-
-¤Þ¤°¤í¡¼¤À¡¼ (.mag) ¥Õ¥©¡¼¥Þ¥Ã¥È¤Î²èÁü¥Ç¡¼¥¿¤ò½ÐÎϤ¹¤ë¤¿¤á¤Î¥É¥é¥¤¥Ð¤Ç¤¹¡£
-16 ¿§¤È 256 ¿§¤ËÂбþ¤·¤Æ¤¤¤Þ¤¹¡£
-
-========================================================================
-¡ü £²¡¥ ÁȤ߹þ¤ß
-========================================================================
-
-gdevmag.c ¤ò¾¤Î¥½¡¼¥¹¥×¥í¥°¥é¥à¤ÈƱ¤¸¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤­¡¢Makefile ¤Î
-DEVICE_DEVS (¤Þ¤¿¤Ï¡¢DEVICE_DEVS1¡Á9) ¤Ë mag16.dev (16 ¿§)¡¢
-mag256.dev(256 ¿§) ¤òÄɲä·¡¢Makefile ¤Ë gdevmag.mak ¤ÎÆâÍƤòÄɲä·¤Æ
-make ¤ò¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-========================================================================
-¡ü £³¡¥ »È¤¤Êý
-========================================================================
-
-BMP ¤ä PCX ¤Ê¤É¤Î¾¤Î²èÁü¥Õ¥©¡¼¥Þ¥Ã¥È¥É¥é¥¤¥Ð¤ÈƱÍͤǤ¹¡£gs ¤òµ¯Æ°¤¹¤ë¤È
-¤­¤Ë -sDEVICE=mag16¡¢-sDEVICE=mag256 ¤È¤¤¤¦¥ª¥×¥·¥ç¥ó¤òÉÕ¤±¤Æ¤¯¤À¤µ¤¤¡£
-
- (Îã) gs -dNOPAUSE -sDEVICE=mag16 -sOutputFile=golfer.mag -- golfer.ps
-
- ¢¨°ì¤Ä¤Î *.mag ¥Õ¥¡¥¤¥ë¤Ë¤Ï°ì¤Ä¤Î²èÁü¤·¤«´Þ¤á¤ë¤³¤È¤¬½ÐÍè¤Þ¤»¤ó¤«¤é¡¢
- Ê£¿ô¥Ú¡¼¥¸¤«¤éÀ®¤ë PostScirpt ¥³¡¼¥É¤òËî·Á¼°¤ËÊÑ´¹¤¹¤ë¾ì¹ç¤Ë¤Ï
- -sOutputFile ¥ª¥×¥·¥ç¥ó¤ÇÊ£¿ô¤Î¥Õ¥¡¥¤¥ë¤Ë½ÐÎϤ¹¤ë¤è¤¦¤Ë»ØÄꤷ¤Æ¤¯
- ¤À¤µ¤¤¡£
-
- (Îã) gs -dNOPAUSE -sDEVICE=mag256 -sOutputFile=lines%d.mag -- lines.ps
-
- ÞÉ»³ ÏÂŵ (ASAYAMA Kazunori)
- TPM03937@pcvan.or.jp
- GHF01532@niftyserve.or.jp
diff --git a/gs/contrib/japanese/doc/gdevmd2k.txt b/gs/contrib/japanese/doc/gdevmd2k.txt
deleted file mode 100644
index 879cdfb2d..000000000
--- a/gs/contrib/japanese/doc/gdevmd2k.txt
+++ /dev/null
@@ -1,179 +0,0 @@
-
- ALPS MD series printer driver for Ghostscript 5.xx
-
- 1999/ 4/18
- 1999/ 5/ 2 ¹¹¿·
-
-³µÍ×
----
- Ëܥɥ饤¥Ð¤Ï Ghostscript 5.10/5.50(/5.82) ¤Ç ALPS MD ¥·¥ê¡¼¥º¥×¥ê¥ó¥¿¡¼¤Î
-½ÐÎϤò¤¹¤ë¤¿¤á¤Î¥É¥é¥¤¥Ð¤Ç¤¹¡£°Ê²¼¤Î¤è¤¦¤Êµ¡Ç½¤òÈ÷¤¨¤Æ¤¤¤Þ¤¹¡£
-
- ¥«¥é¡¼¡¿¥â¥Î¥¯¥í°õºþ¤¬²Äǽ
- 300dpi, 600dpi, 1200x600dpi ¤ËÂбþ
- ÍÑ»æ¤Î¼ïÎࡦ¥µ¥¤¥º¤Î»ØÄ꤬²Äǽ
- Floyd-Steinberg dithering ¤¬²Äǽ
- dithering »ÈÍÑ»þ¤Ë¿§¤ÎÇ»ÅÙÄ´À°¤¬²Äǽ
-
-¸½ºß¡¢MD-2000/2010/4000/1300/1500/5000 ¤ÇÆ°ºî¤¬³Îǧ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£(md2k¤Î¤ß)
-
-
-¥¤¥ó¥¹¥È¡¼¥ë
----
-1. ghostscript ¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤Î¤ËɬÍפʥ½¡¼¥¹Îà¤òŸ³«¤·¡¢
- Ŭµ¹É¬ÍפʥѥåÁ¤òÅö¤Æ¤Þ¤¹¡£
-2. gdevmd2k.c ¤ò gs ¤Î¥½¡¼¥¹¤Î¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥³¥Ô¡¼¤·¤Þ¤¹¡£
-3. gs5.10 ¤Î¾ì¹ç¤Ï¡¢gdevmd2k.dev ¤ò Makefile ¤ËÄɲä·¤Þ¤¹¡£
- gs5.50 ¤Î¾ì¹ç¤Ï¡¢gdevmd2k.mak-5.50 ¤ò contrib.mak ¤ËÄɲä·¤Þ¤¹¡£
- (gs5.8x ¤Î¾ì¹ç¤Ï¡¢gdevmd2k.mak-5.8x ¤ò contrib.mak ¤ËÄɲÃ)
-4. ¼«Ê¬¤Î¥µ¥¤¥ÈÍÑ¤Ë Makefile ¤òÄ´À°¤·¡¢ DEVICE_DEVS ¤Ë md2k.dev ¤òÄɲä·¤Þ¤¹¡£
- MD-5000 ¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ï¡¢md5k.dev ¤òÄɲä·¤Þ¤¹¡£
-5. make
-
-
-»ÈÍÑÊý
----
- ¥Ç¥Ð¥¤¥¹¤Î»ØÄê
- gs ¤ò¼Â¹Ô¤¹¤ëºÝ¤Ë¡¢-sDEVICE ¥ª¥×¥·¥ç¥ó¤Ç°Ê²¼¤Î¤¤¤º¤ì¤«¤Î¥Ç¥Ð¥¤¥¹¤ò
- ÁªÂò¤¹¤ë¤³¤È¤Ç¡¢ALPS MD ¥×¥ê¥ó¥¿¡¼ÍѤνÐÎϤ¬À¸À®¤µ¤ì¤Þ¤¹¡£
-
- -sDEVICE=md2k
- MD-2000/4000/1000 Åù¡¢MD-5000 °ÊÁ°¤Î MD ¥·¥ê¡¼¥º¤ËÂбþ¤·¤¿
- ·Á¼°¤Î½ÐÎϤò¹Ô¤¤¤Þ¤¹¡£(MD-5000 ¤Ç¤â½ÐÎϲÄǽ¤Ç¤¹)
- -sDEVICE=md5k
- MD-5000 ÀìÍѤηÁ¼°¤Ç½ÐÎϤ·¤Þ¤¹¡£¥¨¥³¥Ö¥é¥Ã¥¯¥â¡¼¥É¤ò»ÈÍѤ¹¤ë
- ¾ì¹ç¤Ï¡¢¤³¤Á¤é¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
- (Ãí) md5k.dev ¤Ï99/5/2¸½ºß¡¢¼ÂºÝ¤Î¥×¥ê¥ó¥¿¡¼¤Ç¥Æ¥¹¥È¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£
- MD-5000 ¤Ç¡¢ËܥǥХ¤¥¹¤ò¥Æ¥¹¥È¤·¤Æ²¼¤µ¤Ã¤¿Êý¤ÏÀ§Èó·ë²Ì¤ò
- ¤ªÃΤ餻²¼¤µ¤¤¡£
-
- ¥«¥é¡¼¡¿¥â¥Î¥¯¥í¡¦dithering ¤ÎÁªÂò
- -dBitsPerPixel=1 Ä̾ï¤Î¥â¥Î¥¯¥í°õºþ
- -dBitsPerPixel=4 Ä̾ï¤Î¥«¥é¡¼°õºþ (default)
- -dBitsPerPixel=8 Floyd-Steinberg dithering ¤òÍѤ¤¤¿¥â¥Î¥¯¥í°õºþ
- -dBitsPerPixel=32 Floyd-Steinberg dithering ¤òÍѤ¤¤¿¥«¥é¡¼°õºþ
-
- (Îã) tiger.ps ¤ò¥â¥Î¥¯¥í¡¦dithering »ÈÍѤǽÐÎÏ
- gs -q -dNOPAUSE -sDEVICE=md2k -dBitsPerPixel=8 \
- -sOutputFile=- tiger.ps -c quit | lpr
-
- -dColor, -dDither ¤ò»ÈÍѤ·¤Æ¤âƱÍͤÎÀßÄ꤬²Äǽ¤Ç¤¹¡£
- -dColor=false ¥â¥Î¥¯¥í
- -dColor(=true) ¥«¥é¡¼
- -dDither=false dithering¤·¤Ê¤¤
- -dDither(=true) dithering ¤ò»ÈÍÑ
-
- * ¥«¥é¡¼°õºþ¤òÁªÂò¤·¤Æ¤â PS ¥Õ¥¡¥¤¥ë¤¬¥â¥Î¥¯¥í¤Î¾ì¹ç¤Ë¤Ï¡¢
- CMY¤Î¥¤¥ó¥¯¥ê¥Ü¥ó¤Ï»ÈÍѤ·¤Þ¤»¤ó¡£
- * dithering ¤ò»ÈÍѤ¹¤ì¤Ð¡¢¼Ì¿¿Åù¤Î²èÁü¤Ï¤è¤êåºÎï¤Ë°õºþ¤µ¤ì¤ë¤Ï¤º
- ¤Ç¤¹¤¬¡¢²èÁü¤Ë¤è¤Ã¤Æ¤Ï»ÈÍѤ·¤Ê¤¤Êý¤¬åºÎï¤Ê¾ì¹ç¤â¤¢¤ê¤Þ¤¹¡£
-
- ²òÁüÅÙ¤ÎÁªÂò
- -r300 300dpi
- -r600 600dpi (default)
- -r1200x600 1200x600dpi
-
- (Îã) 1200x600dpi ¤Ç½ÐÎÏ
- gs -q -dNOPAUSE -sDEVICE=md2k -r1200x600 -dBitsPerPixel=1 \
- -sOutputFile=- tiger.ps -c quit | lpr
-
- * MD-2000 ¤Ç¤â¡¢¥«¥é¡¼ 1200x600dpi ¤¬°ì±þ»ØÄê¤Ç¤­¤Þ¤¹¤¬¡¢
- ²è¼Á¤Ï¤Û¤È¤ó¤É 600dpi ¤ÈÊѤï¤ê¤Þ¤»¤ó¡£
-
- ÍÑ»æ»ØÄê
- ÍÑ»æ¤Î¼ïÎà¤ò»ØÄꤷ¤Þ¤¹¡£Windows ¤Î¥É¥é¥¤¥Ð¤È°Û¤Ê¤ê¡¢
- ²òÁüÅÙ¤ÏÍÑ»æ¤Î¼ïÎफ¤é¼«Æ°Åª¤Ë·èÄꤵ¤ì¤Þ¤»¤ó¡£
- ²òÁüÅÙ¤Ï -r ¥ª¥×¥·¥ç¥ó¤ÇÊÌÅÓ»ØÄꤷ¤Æ²¼¤µ¤¤¡£
- (Ãí) ¥¢¥¤¥í¥ó¥·¡¼¥ë¡¢¥ì¥Ù¥«¥Õ¥ê¡¼Åù¡¢Æ°ºî³Îǧ¤·¤Æ¤¤¤Ê¤¤¤â¤Î¤â
- ¤¢¤ê¤Þ¤¹¡£
-
- -sMediaType=PlainPaper ¥³¥Ô¡¼»æ (default)
- -sMediaType=IronSeal ¥¢¥¤¥í¥ó¥·¡¼¥ë
- -sMediaType=RebecaFree ¥ì¥Ù¥«¥Õ¥ê¡¼
- -sMediaType=CardBoard ¸ü»æ
- -sMediaType=PostCard ¤Ï¤¬¤­
- -sMediaType=FinePaper ¾å¼Á»æ
- -sMediaType=CoatedFilm ¸÷Âô¥Õ¥£¥ë¥à
- -sMediaType=GlossyPaper ¸÷Âô»æ
- -sMediaType=TransparencyFilm OHPÍÑ»æ (MD-2000 °Ê³°)
- -sMediaType=OHP ¡·
- -sMediaType=OHP_MD2000 OHP (MD-2000¤ÇÀìÍÑ¥¤¥ó¥¯¤ò»ÈÍѤ¹¤ë¾ì¹ç)
-
- Íѻ極¥¤¥º¤Î»ØÄê
- -sPAPERSIZE=letter ¥ì¥¿¡¼¥µ¥¤¥º
- -sPAPERSIZE=a4 A4
- -sPAPERSIZE=b5 B5
- -sPAPERSIZE=postcard ¤Ï¤¬¤­ (*)
- -d.MediaSize='{xx yy}' Ǥ°Õ¥µ¥¤¥º¤Î»ØÄê (xx, yy ¤Ï 1/72 inch)
-
- (*) gdevlips ¤Ë´Þ¤Þ¤ì¤ë gs_statd.ps ¤Î¥Ñ¥Ã¥Á¤òÅö¤Æ¤¿¾ì¹ç¤Ë
- »ÈÍѲÄǽ
-
- ¿§¤ÎÇ»ÅÙÄ´À°
- dithering ¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Î¤ß¡¢°Ê²¼¤Îoption¤Çǻø¤ÎÄ´À°¤¬²Äǽ¡£
- ¿ô¤¬Â礭¤¤Äø¡¢¿§¤¬Ç»¤¯½ÐÎϤµ¤ì¤Þ¤¹¡£
-
- -dBlack=0-2048 (default 1024)
- -dCyan=0-2048 (default 1024)
- -dMagenta=0-2048 (default 1024)
- -dYellow=0-2048 (default 1024)
-
- (Îã) ¥·¥¢¥ó¤òÇ»¤¯¡¢¥Þ¥¼¥ó¥¿¤òÇö¤¯°õºþ¤¹¤ë
- gs -q -dNOPAUSE -sDEVICE=md2k -dBitsPerPixel=32 \
- -dCyan=1200 -dMagenta=800 -sOutputFile=- tiger.ps -c quit
-
- ¤½¤Î¾
- -dManualFeed ¼êº¹¤·°õºþ¤¹¤ë¾ì¹ç¤Ë»ØÄꤷ¤Þ¤¹¡£
-
- -dEcoBlack ¥¨¥³¥Ö¥é¥Ã¥¯°õºþ¤ò¹Ô¤¤¤Þ¤¹¡£
- ¥Ç¥Ð¥¤¥¹¤Ë md5k ¤ò»ÈÍѤ·¤¿»þ¤Î¤ßÍ­¸ú¤Ç¤¹¡£
-
- -dReverseSide ΢Ì̤˰õºþ¤ò¹Ô¤¦ºÝ¤Ë¡¢¥«¡¼¥ë¶ºÀµ¤ò¶Ø»ß¤¹¤ë¤¿¤á
- »ØÄꤷ¤Þ¤¹¡£
-
-
-Êѹ¹ÍúÎò
----
-1999-05-02 Ver.0.2a
- * MD-5000 ÍѥǥХ¤¥¹ md5k ¤ÎÄɲÃ
- * ÍÑ»æ»ØÄꥪ¥×¥·¥ç¥ó -sMediaType ¤ÎÄɲÃ
- * ¥ª¥×¥·¥ç¥ó -dManualFeed, -dEcoBlack, -dReverseSide ¤ÎÄɲÃ
- * ¥«¥é¡¼¡¦dithering ¤Î̵ͭ¤ò -dBitsPerPixel ¤Ç»ØÄꤹ¤ë¤è¤¦
- README ¤òÊѹ¹
- * -dColor, -dDither ¤ò int ·¿¤«¤é bool ·¿¤ËÊѹ¹
- * -dBitsPerPixel=1 ¤Î»þ¡¢Í¾Çò¤ò¥¹¥­¥Ã¥×¤·¤Ê¤¤¥Ð¥°¤ò½¤Àµ
- * Íѻ極¥¤¥º¤Ë letter ¤òÄɲÃ
- * MD-2000 ¤Ç¤Î OHP ½ÐÎϤËÂбþ
-
-1999-04-18 Ver.0.1
- * MD-2000 Âбþ¤Î gdevmd2k-0.1 ¤ò¸ø³«
-
-
-TODO (or NOT TODO ?)
----
-* ¸÷Âô°õºþ¤Ê¤ÉÆüì¤Ê¥â¡¼¥É¤Ø¤ÎÂбþ
-* dithering »þ¤Î²è¼Á¤Î¸þ¾å
-
-
-¼Õ¼­
----
- Floyd-Steinberg dithering ¤Î¥¢¥ë¥´¥ê¥º¥à¤Ï¡¢George Cameron »á¤Î½ñ¤«¤ì¤¿
- gdevcdj.c ¤ò»²¹Í¤Ë¤µ¤»¤Æ夭¤Þ¤·¤¿¡£
-
- MD-5000 Íѥɥ饤¥Ð gdevalps ¤Îºî¼Ô Shinya Umino¤µ¤ó¤«¤é¤Ï
- MD-5000 ¤Ç¤ÎÆ°ºîÊó¹ð¤ÈËܥɥ饤¥Ð¤Ë´Ø¤¹¤ë¸æ°Õ¸«¤ò夭¤Þ¤·¤¿¡£
- Ëܥɥ饤¥Ð¤Î MD-5000 ÂбþÉôʬ¤Ï gdevalps ¤ò¸µ¤Ëºî¤é¤ì¤Þ¤·¤¿¡£
-
- gdevlips ¤Îºî¼Ô Â翹µª¿Í¤µ¤ó¤«¤é¤Ï¥«¥é¡¼¤ÎÀßÄêÅù¤Ë¤Ä¤¤¤Æ¸æ°Õ¸«¤ò
- 夭¤Þ¤·¤¿¡£¤Þ¤¿¡¢gs ¤Î¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤Æ¤Ï¡¢gdevlips ¤ò»²¹Í¤Ë¤µ¤»¤Æ
- 夭¤Þ¤·¤¿¡£
-
- Kousuke Ikeda ¤µ¤ó¡¢Ê¡µïµ£»ê¤µ¤ó¡¢À¶¿å·òÆ󤵤ó¡¢MIHIRA Yoshiro ¤µ¤ó
- ¤«¤é¤Ï¡¢MD-1300, MD-1500, MD-4000 ¤Ç¤ÎÆ°ºîÊó¹ð¤ò夭¤Þ¤·¤¿¡£
-
----
- Ëܥɥ饤¥Ð¤Ë´Ø¤¹¤ë¸æ°Õ¸«¡¢¥Ð¥°Êó¹ð¡¢ALPS MD ³Æµ¡¼ï¤Ç¤Î¥Æ¥¹¥È·ë²ÌÅù
-¤¢¤ê¤Þ¤·¤¿¤é¡¢¥á¡¼¥ë¤Ë¤Æ¸æÏ¢Íí´ê¤¤¤Þ¤¹¡£
-
-ÛسÀ ¾­ÏÂ
-Masakazu Higaki <higamasa@dd.mbn.or.jp>
diff --git a/gs/contrib/japanese/doc/gdevmjc.txt b/gs/contrib/japanese/doc/gdevmjc.txt
deleted file mode 100644
index 11841a707..000000000
--- a/gs/contrib/japanese/doc/gdevmjc.txt
+++ /dev/null
@@ -1,58 +0,0 @@
-gdevmjc-0.8no2 Â翹µª¿Í ohmori@p.chiba-u.ac.jp
-
-¤³¤Î¥É¥é¥¤¥Ð¤Ï gdevmjc-0.8 ¤ò¤â¤È¤Ë¤·¤Æºî¤é¤ì¤Æ¤¤¤Þ¤¹¡£
-¿§¤¢¤¤¤Ê¤É¤Ï gdevmjc-0.8 ¤½¤Î¤Þ¤Þ¤Ç¤¹¡£
-¤Þ¤¿¡¢Ghostscript 5.10 ¤ÇÆ°ºî¤µ¤»¤ë¤³¤È¤òÁ°Äó¤È¤·¤Æ¤¤¤Þ¤¹¡£
-
-1. Âбþ¥Ç¥Ð¥¤¥¹
-mj700v2c : EPSON MachJet ¥·¥ê¡¼¥º¤Ç CMYK 4¿§¤ò°õºþ¤Ç¤­¤ë¥«¥é¡¼ÍѤΥɥ饤¥Ð
-mj500c : EPSON MachJet ¥·¥ê¡¼¥º¤Ç CMY or K, CMY + K ÍѤΥץê¥ó¥¿ÍѤΥɥ饤¥Ð
-mj6000c : EPSON MJ-830C/MJ-930C/MJ-6000C
- (¥â¥Î¥¯¥í°õºþ»þ¤Î¹â®²½¤ËÂбþ¤·¤Æ¤¤¤ë)
-mj8000c : EPSON MJ-8000C
- (mj6000c ¤È A2 ¥µ¥¤¥º¤Î¥Þ¡¼¥¸¥ó¤¬°Û¤Ê¤ë)
-
-**************************************************************
-*¢¨ CMY or K ¥×¥ê¥ó¥¿: MJ-500C, MJ-510C *
-* CMY + K ¥×¥ê¥ó¥¿: MJ-800C, MJ-3000C *
-* (¤³¤ì¤ÏÉáÄÌ»æ¤Ë¤Ï CMYK °õºþ¤Ç¤­¤Ê¤¤»ÅÍͤˤʤäƤ¤¤Þ¤¹¡£)*
-**************************************************************
-
-¤Þ¤¿¥«¥é¡¼¤ËÂбþ¤·¤Æ¤¤¤Ê¤¤ MachJet ¤Ç¤â -dBitsBitsPerPixel=8 ¤ò
-»ØÄꤹ¤ì¤Ð¥â¥Î¥¯¥í¤Ç»È¤¨¤ë¤è¤¦¤Ç¤¹¡£
-
-2. Âбþ²òÁüÅÙ
-mj700v2c, mj6000c, mj8000c : 180x180 dpi (-r180 ¥ª¥×¥·¥ç¥ó)
- 360x360 dpi (-r360 ¥ª¥×¥·¥ç¥ó) - ¥Ç¥Õ¥©¥ë¥È
- 720x720 dpi (-r720 ¥ª¥×¥·¥ç¥ó)
-mj500c : 360x360 dpi (-r360 ¥ª¥×¥·¥ç¥ó) - ¥Ç¥Õ¥©¥ë¥È
-
-
-3. ¥«¥é¡¼/¥â¥Î¥¯¥íÀÚÂؤ¨
--dBitsPerPixel=8 ¥â¥Î¥¯¥í°õºþ
--dBitsPerPixel=32 ¥«¥é¡¼°õºþ (¥Ç¥Õ¥©¥ë¥È)
-
-4. ¤½¤Î¾¤Î¥ª¥×¥·¥ç¥ó
--dMicroweave ¥Þ¥¤¥¯¥í¥¦¥£¡¼¥Ö¤ò¥ª¥ó¤Ë¤¹¤ë¡£
- (180 dpi ¤Ç¤Ï¥Þ¥¤¥¯¥í¥¦¥£¡¼¥Ö¤Ï»È¤¨¤Þ¤»¤ó)
- ¥Ç¥Õ¥©¥ë¥È¤Ç¥ª¥ó¤Ê¤Î¤Ç¥ª¥Õ¤Ë¤¹¤ë¤¿¤á¤Ë¤Ï¡¢
- -dMicroweave=false ¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£
--dUnidirectional ñÊý¸þ°õ»ú¤Ë¤¹¤ë¡£
--dDotSize ¥É¥Ã¥È¥µ¥¤¥º¤òÀ©¸æ¤¹¤ë¡£
--dDensity Á´ÂΤÎÇ»¤µ¤òÄ´À°¤¹¤ë - ¥Ç¥Õ¥©¥ë¥È 1024
--dCyan ¥·¥¢¥ó¤ÎÇ»¤µ¤òÄ´À°¤¹¤ë - ¥Ç¥Õ¥©¥ë¥È 1024
--dMagenta ¥Þ¥¼¥ó¥¿¤ÎÇ»¤µ¤òÄ´À°¤¹¤ë - ¥Ç¥Õ¥©¥ë¥È 1024
--dYellow ²«¿§¤ÎÇ»¤µ¤òÄ´À°¤¹¤ë - ¥Ç¥Õ¥©¥ë¥È 1024
--dBlack ¹õ¿§¤ÎÇ»¤µ¤òÄ´À°¤¹¤ë - ¥Ç¥Õ¥©¥ë¥È 1024
-
-¥â¥Î¥¯¥í°õºþ»þ¤Ë¤Ï -dDensity ¤ÏƯ¤­¤Þ¤»¤ó¡£-dBlack ¤Î¤ß¤Ç¿§Ä´À°¤ò
-¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-5. ºÇ¹â²è¼Á
-¤³¤Î¥É¥é¥¤¥Ð¤ÇºÇ¹â²è¼Á¤ò¤À¤¹¤¿¤á¤Ë¤Ï
--dMicroweave -dUnidirectional ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£
-
-6. gdevmjc-0.8 ¤Î¥Ð¥°¤Ç½¤Àµ¤·¤¿¤â¤Î
-¡ûCompaq Tru64 UNIX¡¢Alpha Linux ½ÐÎϤ¬¤ª¤«¤·¤¯¤Ê¤ë¥Ð¥°
-¡û¥â¥Î¥¯¥í°õºþ»þ¤Ë¿§Ä´À°¤¬¤Ç¤­¤Ê¤¤¥Ð¥°
-
diff --git a/gs/contrib/japanese/doc/gdevml6.txt b/gs/contrib/japanese/doc/gdevml6.txt
deleted file mode 100644
index 13f1bb915..000000000
--- a/gs/contrib/japanese/doc/gdevml6.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-
- MICROLINE620CL ÍÑ ghostscript ¥É¥é¥¤¥Ð
-
- Mar. 16, 1998 N.Tagawa
-
- $Id: README,v 1.1 1998/03/16 13:32:32 tagawa Exp $
-
-
- ¤³¤Î¥É¥é¥¤¥Ð¤Ï¡¢²­¥Ç¡¼¥¿¤Î MICROLINE620CL ¤ò ghostscript ¤Ç»È¤¦¤¿¤á
-¤Î¤â¤Î¤Ç¤¹¡£gs ¤Ï¡¢5.10 ¤ËÂбþ¤·¤Æ¤ª¤ê¡¢Linux-2.0.33(Debian-1.3.1) ¤Ç
-Æ°ºî¤ò³Îǧ¤·¤Æ¤¤¤Þ¤¹¡£
-
-
- (1) ¥³¥ó¥Ñ¥¤¥ëÊýË¡
- ¾¤Î¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð¤ÈƱÍͤμê½ç¤Ç¥³¥ó¥Ñ¥¤¥ë¤Ç¤­¤ë¤Ï¤º¤Ç¤¹¡£
-gdevml6.c ¥Õ¥¡¥¤¥ë¤ò gs ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤­¡¢gdevml6.mak ¤ÎÆâÍƤò
-devs.mak ¤ÎŬÅö¤Ê¾ì½ê¤ËÄɲä·¤Þ¤¹¡£
- gcc-head.mak ¤Ê¤É¤Î DEVICE_DEVS3 ¤¢¤¿¤ê¤Ë ml600.dev ¤òÄɲä·¡¢
-tar_cat ¤ò¼Â¹Ô¤·¤Þ¤¹¡£¤³¤³¤é¤Ø¤ó¤Ï¡¢´Ä¶­¤Ë¤è¤Ã¤ÆÊѤï¤Ã¤Æ¤¯¤ë¤Î¤Ç¡¢gs
-¤ËÉÕ°¤Î¥É¥­¥å¥á¥ó¥È¤ò»²¹Í¤Ë¤·¤Æ²¼¤µ¤¤¡£¸å¤Ï make ¤Ç¥³¥ó¥Ñ¥¤¥ë¤Ç¤­¤ë¤Ï
-¤º¤Ç¤¹¡£
-
-
- (2) »È¤¤Êý
- ¥Ç¥Ð¥¤¥¹¤È¤·¤Æ -sDEVICE=ml600 ¤ò»ØÄꤷ¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Î²òÁüÅÙ¤Ï 600
-x 600 DPI ¤Ç¤¹¤¬¡¢-r ¥ª¥×¥·¥ç¥ó¤Ç²òÁüÅÙ¤òÊѤ¨¤ë»ö¤¬¤Ç¤­¤Þ¤¹¡£-r300 ¤Ç
-300 DPI¡¢-r600x1200 ¤Ç 600 x 1200 DPI ¤Ë¤Ê¤ê¤Þ¤¹¡£
-
- ¤¢¤Þ¤êºÙ¤«¤¤»ö¤Ï¤ï¤«¤é¤Ê¤¤¤Î¤Ç¤¹¤¬¡¢¥È¥ì¡¼¤ÎÀÚÂؤ¨¤ä¡¢ÍÑ»æ¤Î¸ü¤µ¤Ê¤É
-¤âÊѤ¨¤é¤ì¤ë¤Ï¤º¤Ç¤¹¡£¤¿¤À¡¢PS ¤«¤é¤É¤¦¤ä¤Ã¤Æ»ØÄꤹ¤ì¤Ð¤¤¤¤¤«¤ï¤«¤é¤Ê
-¤¤¤Î¤Ç¡¢¤È¤ê¤¢¤¨¤º¥Ç¥Õ¥©¥ë¥È¤Ë¤·¤Æ¤¢¤ê¤Þ¤¹¡£Ç¯²ì¾õ¤ò°õºþ¤·¤¿¤¤»þ¤Ï¡¢¥³¡¼
-¥É¤òÊѹ¹¤·¤ÆºÆ¥³¥ó¥Ñ¥¤¥ë¤·¤Æ²¼¤µ¤¤¡£^^;
-
-
- (3) ¤½¤Î¾
- ¤³¤Î¥É¥é¥¤¥Ð¤Ï¡¢MICROLINE620CL ÍѤǤ¹¤¬¡¢¤¿¤Ö¤ó MICROLINE600CL ¤Ç¤â
-Æ°¤¯¤È»×¤¤¤Þ¤¹(ξÊý¶¦ IPL ¤À¤½¤¦¤Ç¤¹¤«¤é)¡£ML-4w ¤ÇÆ°¤¯¤«¤É¤¦¤«¤Ï¤ï¤«
-¤ê¤Þ¤»¤ó¡£»ý¤Ã¤Æ¤¤¤ë¿Í¤¬¤¤¤¿¤é¤¼¤Ò»î¤·¤Æ¤ß¤Æ²¼¤µ¤¤¡£
-
- ¤³¤Î¥É¥é¥¤¥Ð¤Ï̵ÊݾڤǤ¹¡¢¤¬¡¢¥Ð¥°¤Î»ØŦÅù¤¢¤ì¤Ð¤Ê¤ë¤Ù¤¯Âбþ¤·¤¿¤¤¤È
-»×¤Ã¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢¤è¤í¤·¤¯¤ª´ê¤¤¤·¤Þ¤¹¡£
-
-
- ¤Ç¤Ï¡¢¤ª³Ú¤·¤ß²¼¤µ¤¤:-¡Ë
-
-
- ÅÄÀî ŵÀ¸(tagawa@tcp-ip.or.jp)
diff --git a/gs/contrib/japanese/doc/gdevp201.txt b/gs/contrib/japanese/doc/gdevp201.txt
deleted file mode 100644
index d06bbf03a..000000000
--- a/gs/contrib/japanese/doc/gdevp201.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-
- gdevp201.c - PC-PR201ÍѥǥХ¤¥¹¥É¥é¥¤¥Ð
-
-
-¡û¥¤¥ó¥¹¥È¡¼¥ëÊýË¡
-
-1. gdevp201.c ¤ò gs241 ¤Î¥½¡¼¥¹¥×¥í¥°¥é¥à¤¬¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥³¥Ô¡¼¤·
-¤Æ²¼¤µ¤¤¡£
-
-2. Makefile ¤Ë gdevp201.mak ¤òÄɲ䷤Ʋ¼¤µ¤¤¡£
-
-3. Makefile ¤Î DEVICE_DEVS ¤Ë pr201.dev ¤ò²Ã¤¨¤Æ²¼¤µ¤¤¡£
-
- Îã) DEVICE_DEVS=pc98.dev pr201.dev
- ^^^^^^^^^
-4. make ¥³¥Þ¥ó¥É¤Ç gs ¤ò¥³¥ó¥Ñ¥¤¥ë¤·¡¢¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ²¼¤µ¤¤¡£
-
-
-¡û»È¤¤Êý
-
-¡ö¥Ç¥Ð¥¤¥¹¤ÎÁªÂò¤Ï -sDEVICE ¥ª¥×¥·¥ç¥ó¤Ë¤è¤Ã¤Æ¹Ô¤Ê¤¤¤Þ¤¹¡£
-
- Îã) gs -sDEVICE=pr201 (pr201¤ò»ØÄê)
- gs -sDEVICE=pc98 (pc98¤ò»ØÄê)
-
-
-
- ÊÒ»³ µªÀ¸(katayama@nacsis.ac.jp)
-
-
diff --git a/gs/contrib/japanese/doc/gs261j.euc b/gs/contrib/japanese/doc/gs261j.euc
deleted file mode 100644
index 1df9f95f1..000000000
--- a/gs/contrib/japanese/doc/gs261j.euc
+++ /dev/null
@@ -1,559 +0,0 @@
-Ghostscript version 2.6.1 ÆüËܸ첽¥Ñ¥Ã¥±¡¼¥¸ gs261j
-Version 1.0 Jan.11,1994 by ÊÒ»³µªÀ¸ (katayama@nacsis.ac.jp)
-Copyright (C) 1991,1992,1993,1994 Norio Katayama.
-
-
-¡ûµ¡Ç½
-
- 1. Ghostscript¤ÎÆüËܸì¤Ø¤Î³ÈÄ¥
- a. Ê£¹ç¥Õ¥©¥ó¥È¤Î¥µ¥Ý¡¼¥È
- b. ʸ»ú¥á¥È¥ê¥Ã¥¯¥¹(Metrics, Metrics2, CDevProc)¤Î¥µ¥Ý¡¼¥È
- c. ½Ä½ñ¤­¥â¡¼¥É¤Î¥µ¥Ý¡¼¥È
-
- 2. ´Á»ú¥Õ¥©¥ó¥È¤Î¥µ¥Ý¡¼¥È
- a. X11R5 PCF¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¤«¤é¤ÎÆɽФ·
- b. X11R4 SNF¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¤«¤é¤ÎÆɽФ·
- c. Sony(TM)¥Ù¥¯¥¿¡¼¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¤«¤é¤ÎÆɽФ·
- d. Zeit(TM)¥Õ¥©¡¼¥Þ¥Ã¥È¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¤«¤é¤ÎÆɽФ·
- ºî¼Ô: ÀîËÜÂöÆó(Ext)¤µ¤ó¡¢°æ¾å¹¯À®(K-ras)¤µ¤ó
- e Zeit(TM) JG ¥Õ¥©¡¼¥Þ¥Ã¥È¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¤«¤é¤ÎÆɽФ·
- ºî¼Ô: ÞÉ»³ÏÂŵ¤µ¤ó
- f. ÆüËܸìTeX PK¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¤«¤é¤ÎÆɽФ·
-
- 3. ¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð
- a. gdevnwp (Sony NWP-533/537 ¥×¥ê¥ó¥¿)
- b. gdevlips (Canon LIPS-II/II+/III ¥×¥ê¥ó¥¿)
- ºî¼Ô: ÁÒÅ縲¾°¤µ¤ó
- c. gdevp201 (NEC PC-PR201 ¥×¥ê¥ó¥¿)
- d. gdevp150 (NEC PC-PR150 ¥×¥ê¥ó¥¿)
- ºî¼Ô: ¹ÃËÜÂîÌ餵¤ó
- e. gdevepag (ESC/Page)
- ºî¼Ô: À®¾¾ ¹¨¤µ¤ó
- f. gdevj100 (Star JJ-100 ¥×¥ê¥ó¥¿)
- ºî¼Ô: ²£»³ÏÂͳ¤µ¤ó
- g. gdev10v (Canon BJ10v ¥×¥ê¥ó¥¿)
- ºî¼Ô: ´ä°æµ±Ãˤµ¤ó¡¢Á°ÅÄÆػʤµ¤ó¡¢¾¾°æ¹§Íº¤µ¤ó
-
-
-
-¡ûÆ°ºî³Îǧ
-
- +--------------+-----------------+-----------------+-------------+
- | OS | Machine | Compiler | Device |
- +--------------+-----------------+-----------------+-------------+
- | SunOS 4.1.3 | SPARC Station 2 | cc -O / gcc -O | X11 |
- +--------------+-----------------+-----------------+-------------+
-
-
-
-¡û¥³¥á¥ó¥È
-
-¡þ DJ's GPP ¤ò»È¤Ã¤Æ¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤Ë¤Ï¡¢ÞÉ»³ÏÂŵ¤µ¤ó¤¬ºî¤é¤ì¤¿
-¡ØGhostscript 2.6.1 DJ's GPP ²½¥Ñ¥Ã¥±¡¼¥¸¡Ù¤òÍøÍѤ¹¤ë¤³¤È¤Ç²Äǽ¤Ç¤¹¡£
-PC-VAN ¤Î¥µ¥¤¥¨¥ó¥¹ SIG (SSCIENCE) ¤ä Nifty Serve ¤Î¥½¥Õ¥È¥¦¥§¥¢¹©Ë¼
-(FLABO) ¤«¤éÆþ¼ê¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¤½¤¦¤Ç¤¹¡£
- ÞÉ»³¤µ¤ó¤Î¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ï¡¢NIFTY: GHF01532, PC-VAN: TPM03937 ¤Ç¤¹¡£
-
-¡þ zkfjtex.c ¤Ê¤É°ìÉô¤Î¥×¥í¥°¥é¥à¤Ï char ·¿¤¬ signed char ·¿¤Ç¤¢¤ë¤³¤È
-¤òÁ°Äó¤È¤·¤Æ¤¤¤Þ¤¹¡£¤½¤Î¤¿¤á¡¢MIPS ·Ï¤Î¥³¥ó¥Ñ¥¤¥é¤Ê¤É char ¤ò unsigned
-char ¤È¤·¤Æ½èÍý¤¹¤ë¥³¥ó¥Ñ¥¤¥é¤Ë¤Ä¤¤¤Æ¤Ï -signed ¥ª¥×¥·¥ç¥ó¤«²¿¤«¤òÍѤ¤
-¤Æ char ¤ò signed char ¤È¤·¤Æ½èÍý¤¹¤ë¤è¤¦¤ËÀßÄꤷ¤Æ²¼¤µ¤¤¡£
-
-¡þ X11R5 PCF¥Õ¥©¥ó¥È¤Þ¤¿¤ÏX11R4 SNF¥Õ¥©¥ó¥È¤òÍøÍѤ¹¤ëºÝ¡¢X11´Ä¶­(¥µ¡¼
-¥Ð¡¢¶¦Í­¥é¥¤¥Ö¥é¥ê¤Ê¤É)¤ÏɬÍפ¢¤ê¤Þ¤»¤ó¡£¥Õ¥©¥ó¥È¡¦¥Õ¥¡¥¤¥ë¤µ¤¨Æɤ߹þ
-¤à¤³¤È¤¬¤Ç¤­¤ì¤Ð´Á»ú¤òɽ¼¨¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-¡þ ¼ÁÌä¡¢Í×˾¡¢¥Ð¥°¥ê¥Ý¡¼¥È¡¢²þÎɰƤʤɴ¿·Þ¤·¤Þ¤¹¡£
- JUNET: katayama@nacsis.ac.jp NIFTY: NBB01613
-
-
-
-¡û¤´Ãí°Õ
-
-¡þ¤³¤ÎÆüËܸ첽¥Ñ¥Ã¥±¡¼¥¸¤Ë¤Ï¡¢»ÔÈΤδÁ»ú¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¤Î¥Ç¡¼¥¿¤òÆɽÐ
-¤¹µ¡Ç½¤¬´Þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¤¬¡¢¤½¤ì¤é¤òÍøÍѤ¹¤ëºÝ¤Ë¤ÏÈÎÇ丵¤Î¥é¥¤¥»¥ó¥¹µ¬Äê
-¤Ë¤Õ¤ì¤Ì¤è¤¦¤´Ãí°Õ²¼¤µ¤¤¡£(»²¾È ¡Ø¡û´Á»ú¥Õ¥©¥ó¥È¤Î¥é¥¤¥»¥ó¥¹¤Ë¤Ä¤¤¤Æ¡Ù)
-
-¡þ¤³¤ÎÆüËܸ첽¥Ñ¥Ã¥±¡¼¥¸¤Ï¡¢¥ª¥Õ¥£¥·¥ã¥ë¤Ê¤â¤Î¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤«¤é¡¢¥ª¥ê
-¥¸¥Ê¥ë¤Î¥Ð¥Ã¥¯¥¢¥Ã¥×¤ò¼è¤Ã¤Æ¤«¤éºî¶È¤ò¹Ô¤Ê¤Ã¤Æ²¼¤µ¤¤¡£
-
-¡þ¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Î»ÈÍѤˤè¤êÀ¸¤¸¤¿ÌäÂê¤Ë´Ø¤·¤Æ¤Ï¡¢ÅöÊý¤Ç¤Ï°ìÀÚÀÕǤ¤òÉé
-¤¤¤«¤Í¤Þ¤¹¤Î¤Ç¤¢¤é¤«¤¸¤á¤´Î»¾µ´ê¤¤¤Þ¤¹¡£
-
-¡þ¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤ÎÊ£¼Ì¡¢½¤Àµ¡¢ºÆÇÛÉۤϡ¢±ÄÍøÌÜŪ¤Ç¤Ê¤¤¾ì¹ç¤Ë¸Â¤ê¼«Í³¤Ë
-¹Ô¤Ê¤Ã¤Æ¹½¤¤¤Þ¤»¤ó¡£
-
-
-
-¡û¥¤¥ó¥¹¥È¡¼¥ëÊýË¡(UNIX)
-
-[1] Ghostscript¤Î¥³¥ó¥Ñ¥¤¥ë¤È¥¤¥ó¥¹¥È¡¼¥ë
-
-(1) Ghostscript version 2.6.1 ¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤òÍÑ°Õ¤·¤Æ²¼¤µ¤¤¡£
- ¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ï°Ê²¼¤Î¥Ñ¥Ã¥Á¤ò¤¢¤Æ¤¿¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤òÁ°Äó¤Ë¤·¤Æ¤¤¤Þ¤¹¡£
- ghostscript-2.6.1.fix-01.gz
- ghostscript-2.6.1.fix-02.gz
- ghostscript-2.6.1.fix-03.gz
- ghostscript-2.6.1.fix-04.gz
-
-(2) ¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤òÍÑ°Õ¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Ç¡¢¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤òŸ³«¤·¤Æ²¼
-¤µ¤¤¡£
-
-(3) ¥Ñ¥Ã¥Á¥Õ¥¡¥¤¥ë`gs261j.diff'¤ò¥ª¥ê¥¸¥Ê¥ë¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Ë¤¢¤Æ¤Æ²¼¤µ¤¤¡£
-
-(4) unix-cc.mak, unix-gcc.mak, unix-ansi.mak ¤Î¤¤¤º¤ì¤«¤ò Makefile ¤Ë
-¥³¥Ô¡¼¤·¡¢³Æ¥µ¥¤¥È¤Î´Ä¶­¤Ë¹ç¤ï¤»¤ÆÊÔ½¸¤·¤Æ²¼¤µ¤¤¡£Æäˡ¢¼¡¤Î»Í¤Ä¤ÎÀßÄê
-¤ò¹Ô¤Ê¤Ã¤Æ²¼¤µ¤¤¡£
-
- 1. prefix, exec_prefix, bindir, datadir, gsdatadir ¥Þ¥¯¥í¤Ë¤è¤Ã¤Æ¡¢
- Ghostscript ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄꤷ¤Æ²¼¤µ¤¤¡£
-
- Îã) ɸ½àÀßÄê¤Î¾ì¹ç
-
- prefix = /usr/local
- exec_prefix = $(prefix)
- bindir = $(exec_prefix)/bin
- datadir = $(prefix)/lib
- gsdatadir = $(datadir)/ghostscript
-
-
- 2. ³Æ¥µ¥¤¥È¤Î´Ä¶­¤Ë¹ç¤ï¤»¤Æ CFLAGS, LDFLAGS, EXTRALIBS, XINCLUDE,
- XLIBDIRS ¥Þ¥¯¥í¤òÀßÄꤷ¤Æ²¼¤µ¤¤¡£
-
-
- 3. FEATURE_DEVS ¤Ë¡¢»È¤¤¤¿¤¤´Á»ú¥Õ¥©¥ó¥È¤Ë¹ç¤ï¤»¤Æ°Ê²¼¤Î̾Á°¤ò²Ã¤¨¤Æ
- ²¼¤µ¤¤¡£
-
- kfpcf.dev X11R5 PCF¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë
- kfsnf.dev X11R4 SNF¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë
- kfsony.dev Sony¥Ù¥¯¥¿¡¼¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë
- kfzeit.dev Zeit¥Õ¥©¡¼¥Þ¥Ã¥È¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë
- kfztbez.dev Zeit JG ¥Õ¥©¡¼¥Þ¥Ã¥È¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë
- kfjtex.dev ÆüËܸìTeX PK¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë
-
- Îã) PCF¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¡¢SNF¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¡¢Zeit¥Õ¥©¡¼¥Þ¥Ã¥È¥Õ¥©¥ó
- ¥È¥Õ¥¡¥¤¥ë¡¢Zeit JG ¥Õ¥©¡¼¥Þ¥Ã¥È¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¡¢ÆüËܸìTeX PK¥Õ¥©
- ¥ó¥È¥Õ¥¡¥¤¥ë¤ò»È¤¨¤ë¤è¤¦¤Ë¤¹¤ë¾ì¹ç
-
- FEATURE_DEVS=filter.dev dps.dev level2.dev kanji.dev \
- kfpcf.dev kfsnf.dev kfzeit.dev kfztbez.dev kfjtex.dev
-
- Sony¥Ù¥¯¥¿¡¼¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¤Î¤ß¤ò»ÈÍѤ¹¤ë¾ì¹ç
-
- FEATURE_DEVS=filter.dev dps.dev level2.dev kanji.dev \
- kfsony.dev
-
- PCF¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¡¢SNF¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¡¢Zeit¥Õ¥©¡¼¥Þ¥Ã¥È¥Õ¥©¥ó
- ¥È¥Õ¥¡¥¤¥ë¡¢Zeit JG ¥Õ¥©¡¼¥Þ¥Ã¥È¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¡¢ÆüËܸìTeX PK¥Õ¥©
- ¥ó¥È¥Õ¥¡¥¤¥ë¡¢Sony¥Ù¥¯¥¿¡¼¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¤ò»È¤¨¤ë¤è¤¦¤Ë¤¹¤ë¾ì¹ç
-
- FEATURE_DEVS=filter.dev dps.dev level2.dev kanji.dev \
- kfpcf.dev kfsnf.dev kfzeit.dev kfztbez.dev kfjtex.dev \
- kfsony.dev
-
-
- 4. DEVICE_DEVS ¤Ë¡¢»È¤¤¤¿¤¤¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤òʤ٤Ʋ¼¤µ¤¤¡£
-
- Îã) X11ÍѤΥǥХ¤¥¹¥É¥é¥¤¥Ð¤ò»È¤¦¤È¤­
-
- DEVICE_DEVS=x11.dev
-
- ¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤ò»ÈÍѤ¹¤ë¤È¤­¤Ë¤Ï¡¢
- drivers ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë³Æ¥É¥é¥¤¥Ð¤Î¥É¥­¥å¥á¥ó¥È¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£
-
-
-(5) make ¥³¥Þ¥ó¥É¤Ç gs ¤ò¥³¥ó¥Ñ¥¤¥ë¤·¡¢make install ¤Ç¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ
-²¼¤µ¤¤¡£
-
-(6) Makefile ¤Î gsdatadir ¥Þ¥¯¥í¤Ë¤è¤Ã¤Æ»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Î²¼¤Ë
-ghostscript-fonts-2.6.1.tar.gz ¤òŸ³«¤·¤Æ²¼¤µ¤¤¡£
-
- Îã) gsdatadir ¤¬É¸½àÀßÄê¤Î /usr/local/lib/ghostscript ¤Ç¤¢¤ë¤È¤­
-
- % cd /usr/local/lib/ghostscript
- % gunzip < ghostscript-fonts-2.6.1.tar.gz | tar xvf -
-
-
-[2] ´Á»ú¥Õ¥©¥ó¥È¤Î¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥ó
-
-(1) Makefile ¤Î gsdatadir ¥Þ¥¯¥í¤Ë¤è¤Ã¤Æ»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Î²¼¤Ë
-kanji ¤È¤¤¤¦¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤¬¤¢¤ë¤Î¤Ç¡¢¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë°ÜÆ°¤·¤Æ²¼¤µ¤¤¡£
-
- Îã) gsdatadir ¤¬É¸½àÀßÄê¤Î /usr/local/lib/ghostscript ¤Ç¤¢¤ë¤È¤­
-
- % cd /usr/local/lib/ghostscript
- % cd kanji
-
-
-(2) ²¼¤ËÎóµó¤·¤¿¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¤ÎÃ椫¤é»È¤¤¤¿¤¤¥Õ¥©¥ó¥È¤Ë±þ¤¸¤Æ¡¢
-¤¤¤º¤ì¤«¤ò¥³¥Ô¡¼¤· kconfig.ps ¤ò¤Ä¤¯¤Ã¤Æ²¼¤µ¤¤¡£
-
- pcf.ps X11R5 PCF¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ëÍÑ
- snf.ps X11R4 SNF¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ëÍÑ
- sony.ps Sony¥Ù¥¯¥¿¡¼¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ëÍÑ
- zeit.ps Zeit¥Õ¥©¡¼¥Þ¥Ã¥È¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ëÍÑ
- ztbez.ps Zeit JG ¥Õ¥©¡¼¥Þ¥Ã¥È¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ëÍÑ
- jtex.ps ÆüËܸìTeX PK¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ëÍÑ
-
-(3) kconfig.ps ¤ò³Æ¥µ¥¤¥È¤Î´Ä¶­¤Ë¹ç¤ï¤»¤ÆÊÔ½¸¤·¤Æ²¼¤µ¤¤¡£Ä̾Êѹ¹¤·
-¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤Î¤Ï¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë̾¤À¤±¤Ç¤¹¡£
-
- kconfig.ps ¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¡Ö¡û´Á»ú¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤Ë
-¤Ä¤¤¤Æ¡×¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£
-
-
-[3] ´Á»ú¥Õ¥©¥ó¥È¤Îɽ¼¨¥Æ¥¹¥È
-
- ¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤ò gs ¤Ë¼Â¹Ô¤µ¤»¡¢´Á»ú¥Õ¥©¥ó¥È¤¬Àµ¤·¤¯É½¼¨¤µ¤ì¤ë¤³
-¤È¤ò³Î¤«¤á¤Æ²¼¤µ¤¤¡£
-
- hankaku.ps Ⱦ³Ñʸ»ú¤Î°ìÍ÷¤òɽ¼¨¤·¤Þ¤¹¡£
- allkanji.ps Á´³Ñ´Á»ú¤Î°ìÍ÷¤òɽ¼¨¤·¤Þ¤¹¡£
- fmaptype.ps Ê£¹ç¥Õ¥©¥ó¥È¤Î¥Õ¥©¥ó¥È¥Þ¥Ã¥Ô¥ó¥°¤Î¥Æ¥¹¥È¤Ç¤¹¡£
- vchars.ps ½Ä½ñ¤­Ê¸»ú¤Î°ìÍ÷¤òɽ¼¨¤·¤Þ¤¹¡£
- article9.ps ÆüËܹñ·ûË¡¤ÎÂè¶å¾ò¤Ç¤¹¡£
-
- ¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Ï¡¢´Á»ú¥Õ¥©¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë¤Î¤Ç¥Ç¥£¥ì¥¯¥È¥ê
-¥Ñ¥¹¤ò»ØÄꤹ¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£
-
- Îã) % gs hankaku.ps
-
-(Ãí) ¥Þ¥·¥ó¤ÎÀ½Â¤¸µ¤«¤éÄ󶡤µ¤ì¤Æ¤¤¤ëSNF¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ·¤¿¾ì¹ç¡¢Ê¸»ú¤¬
- Àµ¤·¤¯É½¼¨¤µ¤ì¤Ê¤¤¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£¤³¤ì¤Ï¡¢bdftosnf.h ¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ
- #define DEFAULTGLPAD 1
- #define DEFAULTBITORDER MSBFirst
- #define DEFAULTBYTEORDER MSBFirst
- #define DEFAULTSCANUNIT 1
- ¤¬¡¢SNF¥Õ¥¡¥¤¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤È°ìÃפ·¤Æ¤Ê¤¤¤³¤È¤¬¸¶°ø¤È¹Í¤¨¤é¤ì¤Þ¤¹¡£
- ¤â¤·¡¢Ê¸»ú¤Îɽ¼¨¤¬Àµ¤·¤¯¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢zkfsnf.c ¤Î37¹Ô¤á¡Á53¹Ô¤á¤òÊÑ
- ¹¹¤·¤Æ¤ß¤ë¤³¤È¤ò¤ª´«¤á¤·¤Þ¤¹¡£
-
-
-
-¡û´Á»ú¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ
-
- ¤³¤Î¥Õ¥¡¥¤¥ë¤Ï´Á»ú¥Õ¥©¥ó¥È¤òÄêµÁ¤¹¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢
-kconfig.ps ¤È¤¤¤¦Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¤¬»È¤ï¤ì¤Þ¤¹¤¬¡¢¥³¥Þ¥ó¥É¡¦¥ª¥×¥·¥ç¥ó¤Ë
-¤è¤Ã¤ÆÊѹ¹¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£
-
-
-[1] ´Á»ú¥Õ¥©¥ó¥È¤ÎÄêµÁ
-
- ´Á»ú¥Õ¥©¥ó¥È¤ÎÄêµÁ¤Ï¼¡¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë¤è¤Ã¤Æ¹Ô¤Ê¤¤¤Þ¤¹¡£
-
- ¥Õ¥©¥ó¥È̾ ¥æ¥Ë¡¼¥¯ID [ ¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë̾ ] ¥³¥Þ¥ó¥É
-
- ¡ý¥Õ¥©¥ó¥È̾
- ÄêµÁ¤¹¤ë´Á»ú¥Õ¥©¥ó¥È¤Î̾Á°¤Ç¤¹¡£É¸½àŪ¤Ê̾Á°¤Ï¡¢/Ryumin-Light
- ¤È /GothicBBB-Medium ¤ÎÆó¤Ä¤Ç¤¹¡£
-
- ¡ý¥æ¥Ë¡¼¥¯ID
- ÄêµÁ¤¹¤ë´Á»ú¥Õ¥©¥ó¥È¤ò¼±Ê̤¹¤ë¤¿¤á¤ÎÈÖ¹æ¤Ç¤¹¡£¼è¤ê´º¤¨¤º¡¢
- 4300000ÈÖÂ椫¤é200¤ª¤­¤Ë»ØÄꤹ¤ì¤Ð¤è¤¤¤Ç¤·¤ç¤¦¡£
-
- ¡ý¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë̾
- »ÈÍѤ¹¤ë¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¤Î̾Á°¤Ç¤¹¡£¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥³¥Þ¥ó¥É
- ¤Ë¤è¤Ã¤Æ½ñ¼°¤¬°Û¤Ê¤ê¤Þ¤¹¡£¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¤Î¥³¥á¥ó¥È¤ò»²¾È¤·
- ¤Æ²¼¤µ¤¤¡£
-
- ¡ý¥³¥Þ¥ó¥É
- ´Á»ú¥Õ¥©¥ó¥È¤òÄêµÁ¤¹¤ë¤¿¤á¤Î¥³¥Þ¥ó¥É¤Ç¤¹¡£
-
- Î㤨¤Ð¡¢"/usr/lib/X11/fonts/misc/k24.pcf"¤È¤¤¤¦Ì¾Á°¤ÎX11R5 PCF¥Õ¥©¥ó
-¥È¥Õ¥¡¥¤¥ë¤òÍøÍѤ·¤Æ /Ryumin-Light ¤È¤¤¤¦´Á»ú¥Õ¥©¥ó¥È¤òÄêµÁ¤¹¤ë¤È¤­¤Ë
-¤Ï¡¢¼¡¤Îʸ¤ò´Á»ú¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤Ë½ñ¤¤¤Æ¤ª¤­¤Þ¤¹¡£
-
- /Ryumin-Light 4300000 (/usr/lib/X11/fonts/misc/k24.pcf) pcfkanji
-
- ¤³¤Îʸ¤ò½ñ¤¯¤³¤È¤Ë¤è¤Ã¤Æ¡¢°Ê²¼¤Î´Á»ú¥Õ¥©¥ó¥È¤¬ÍøÍѤǤ­¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ
-¤¹¡£
-
- /Ryumin-Light.r## (## = 21¡Á7E) ²£½ñ¤­JIS¥³¡¼¥É´Á»ú
- /Ryumin-Light.r##v (## = 21, 22, 24, 25) ½Ä½ñ¤­JIS¥³¡¼¥É´Á»ú
- /Ryumin-Light.sr## (## = 81¡Á9F, E0¡ÁEA) ²£½ñ¤­¥·¥Õ¥ÈJIS´Á»ú
- /Ryumin-Light.sr##v (## = 81¡Á83) ½Ä½ñ¤­¥·¥Õ¥ÈJIS´Á»ú
-
- /Ryumin-Light.Roman Ⱦ³Ñ±Ñ¿ô
- /Ryumin-Light.Hiragana Ⱦ³Ñ¤Ò¤é¤¬¤Ê
- /Ryumin-Light.Katakana Ⱦ³Ñ¥«¥¿¥«¥Ê
- /Ryumin-Light.Hankaku Ⱦ³Ñ±Ñ¿ô¡¦¤Ò¤é¤¬¤Ê¡¦¥«¥¿¥«¥Ê
- /Ryumin-Light.SuppK ¥·¥Õ¥ÈJISÍÑȾ³Ñ¥«¥¿¥«¥Ê
-
- /Ryumin-Light-H ²£½ñ¤­JIS¥³¡¼¥É´Á»ú
- /Ryumin-Light-V ½Ä½ñ¤­JIS¥³¡¼¥É´Á»ú
- /Ryumin-Light-Ext-H ²£½ñ¤­³ÈÄ¥JIS¥³¡¼¥É´Á»ú
- /Ryumin-Light-Ext-V ½Ä½ñ¤­³ÈÄ¥JIS¥³¡¼¥É´Á»ú
- /Ryumin-Light-EUC-H ²£½ñ¤­EUC¥³¡¼¥É´Á»ú
- /Ryumin-Light-EUC-V ½Ä½ñ¤­EUC¥³¡¼¥É´Á»ú
- /Ryumin-Light-RKSJ-H ²£½ñ¤­È¾³Ñ±Ñ¿ô¡¦ÊÒ²¾Ì¾¡¦¥·¥Õ¥ÈJIS´Á»ú
- /Ryumin-Light-RKSJ-V ½Ä½ñ¤­È¾³Ñ±Ñ¿ô¡¦ÊÒ²¾Ì¾¡¦¥·¥Õ¥ÈJIS´Á»ú
- /Ryumin-Light-83pv-RKSJ-H ²£½ñ¤­È¾³Ñ±Ñ¿ô¡¦ÊÒ²¾Ì¾¡¦¥·¥Õ¥ÈJIS´Á»ú
-
- ³ÈÄ¥JIS¥³¡¼¥ÉÍѤδÁ»ú¥Õ¥©¥ó¥È¤âÄêµÁ¤µ¤ì¤Þ¤¹¤¬¡¢½ÐÎϤµ¤ì¤ëʸ»ú¤ÏÅöÁ³
-¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¤ÎÆâÍƤˤè¤Ã¤Æ·è¤Þ¤ê¤Þ¤¹¡£¤·¤¿¤¬¤Ã¤Æ¡¢¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë
-¤Ë´Þ¤Þ¤ì¤Ê¤¤Ê¸»ú¤Ïɽ¼¨¤µ¤ì¤Þ¤»¤ó¤·¡¢JIS-78¤Ë¤Ê¤ë¤«JIS-83¤Ë¤Ê¤ë¤«¤â¥Õ¥©
-¥ó¥È¥Õ¥¡¥¤¥ë¤Ë°Í¸¤·¤Þ¤¹¡£
-
-
-[2] ´Á»ú¥Õ¥©¥ó¥È¤ÎÊÌ̾¤ÎÄêµÁ
-
- ´Á»ú¥Õ¥©¥ó¥È¤ËÊÌ̾¤òÄêµÁ¤¹¤ë¤È¤­¤Ë¤Ï¡¢copyfont ¤È¤¤¤¦¥ª¥Ú¥ì¡¼¥¿¤ò»È¤¤
-¤Þ¤¹¡£copyfont ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¼¡¤ÎÄ̤ê¤Ç¤¹¡£
-
- ´û¸¤Î¥Õ¥©¥ó¥È̾ ÊÌ̾ copyfont
-
-Î㤨¤Ð¡¢/GothicBBB-Medium-83pv-RKSJ-H ¤ÎÊÌ̾¤È¤·¤Æ /ChuGothicBBB-Medium ¤ò
-ÄêµÁ¤¹¤ë¤È¤­¤Ë¤Ï¡¢´Á»ú¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤Ë¼¡¤Î¤è¤¦¤Ë½ñ¤­¤Þ¤¹¡£
-
- /GothicBBB-Medium-83pv-RKSJ-H /ChuGothicBBB-Medium copyfont
-
-
-
-¡û¥³¥Þ¥ó¥É¥ª¥×¥·¥ç¥ó
-
-gs ¥³¥Þ¥ó¥É¤Î¥ª¥×¥·¥ç¥ó¤È¤·¤Æ°Ê²¼¤Î¤â¤Î¤¬»È¤¨¤Þ¤¹¡£
-
- -dNOKANJI ´Á»ú¥Õ¥©¥ó¥È¤òÄêµÁ¤·¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£
- -sKCONFIG=pcf.ps ´Á»ú¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤¹¡£
-
-
-
-¡û´Á»ú¥Õ¥©¥ó¥È¤Î¥é¥¤¥»¥ó¥¹¤Ë¤Ä¤¤¤Æ
-
-°Ê²¼¤Ï´Á»ú¥Õ¥©¥ó¥È¤Î¥é¥¤¥»¥ó¥¹¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ç¤¹¡£»²¹Í¤Ë¤·¤Æ²¼¤µ¤¤¡£
-
-
-¡þ Zeit¡Ö½ñÂζæ³ÚÉô¡×
-
- Zeit¥Õ¥¡¥¤¥ëÍÑ¤Î¥×¥í¥°¥é¥à¤òºî¤é¤ì¤¿ÀîËܤµ¤ó¤¬Ì䤤¹ç¤ï¤»¤Æ²¼¤µ¤Ã¤¿¤È
-¤³¤í¡¢¡Ö¥Õ¥©¥ó¥È¥Ç¡¼¥¿¤ÎÆɽФ·¤Ï¡¢¥æ¡¼¥¶¤¬½ñÂζæ³ÚÉô¤ò¹ØÆþ¤·¥Õ¥ê¡¼¥¦¥§
-¥¢¤Ë¤è¤Ã¤ÆÆɽФ¹¤Î¤Ç¤¢¤ì¤Ð¹½¤ï¤Ê¤¤¡×¤È¤¤¤¦²óÅú¤À¤Ã¤¿¤½¤¦¤Ç¤¹¡£
-
-
-¡þ ÂçÆüËÜ°õºþ¡ÖJTeXÍÑ¥Õ¥©¥ó¥È¡×
-
- ÃÞÇÈÂç³Ø¤ÎÌÚËܹ뤵¤ó¤¬ÂçÆüËÜ°õºþ¤ËÌ䤤¹ç¤ï¤»¤Æ²¼¤µ¤Ã¤¿¤È¤³¤í¡¢¡Ö¤â¤È
-¤â¤È¤Î¥é¥¤¥»¥ó¥¹·ÀÌó¤¬TeXÍѤȤʤäƤ¤¤ë¤Î¤Ç¡¢¿·¤¿¤Ê·ÁÂ֤ǻÈÍѤ¹¤ë¾ì¹ç
-ÂçÆüËÜ°õºþ¤ÎÊý¤ØÏ¢Íí¤¹¤ëɬÍפ¬¤¢¤ë¡×¤È¤¤¤¦²óÅú¤À¤Ã¤¿¤½¤¦¤Ç¤¹¡£
-
-°Ê²¼¤Ï¡¢ÌÚËܤµ¤ó¤Î¥á¡¼¥ë¤«¤é¤Î°úÍѤǤ¹¡£
-
-ÂçÆüËÜ°õºþ¤Î¥Õ¥©¥ó¥È¤ò»È¤¦¤Ë¤¢¤¿¤Ã¤Æ¤Ï¡¢
----- ¤³¤³¤«¤é ----
-
-¡ÖTeX ¤Î¥Õ¥©¥ó¥È¤ò GhostScript ¤Î¥½¥Õ¥È¥¦¥¨¥¢¤Ç»È¤¦¤¿¤á¤Ë
-¤³¤¦¤³¤¦¤·¤Þ¤¹¡×
-¤È¤¤¤¦»Ý¤Î¥á¥â¤ò¡¢²¼µ­¤ËÁ÷¤Ã¤Æ¤¯¤ì¤ì¤Ð¤¤¤¤¤½¤¦¤Ç¤¹¡£
-
-¢©162-01 ¿·½É¶è»Ô¥öë²Ã²ìÄ® 1-1-1
-ÂçÆüËÜ°õºþ¡Ê³ô¡Ë CTS »ö¶ÈÉô CTS ³«È¯ËÜÉô¥·¥¹¥Æ¥à³«È¯Âè 1 Éô
-ÀÆÆ£ ²í
-
- ¤½¤¦¤¹¤ì¤Ð¡¢¡Ê¤¹¤Ç¤ËÂçÆüËÜ°õºþ¤Î¼ê¸µ¤Ë¤¢¤ë¡Ë»ÈÍѵöÂú·ÀÌó½ñ
-¤ËźÉÕ¤·¤Æ¤ª¤¯¡¢¤È¤Î¤³¤È¤Ç¤¹¡£
- ¡Ê¤¹¤Ç¤Ë¥é¥¤¥»¥ó¥¹¤ò»ý¤Ã¤Æ¤¤¤ë¤È¸À¤¦Á°Äó¤ÇÏäò¤·¤Þ¤·¤¿¡£¡Ë
- PK ¤òÊÑ´¹¤·¤Æ»È¤¦¤«¡¢GhostScript ¤ÎÊý¤ò PK ¤ËÂбþ¤µ¤»¤Æ
-»È¤¦¤«¡¢¤È¤¤¤¦¤³¤È¤Ë¤Ä¤¤¤Æ¤â¡¢¾å¤Î¥á¥â¤Ë¼ÂºÝ¤Î»ÈÍÑ·ÁÂÖ¤ò
-½ñ¤±¤Ð¤É¤Á¤é¤Ç¤â¤«¤Þ¤ï¤Ê¤¤¤½¤¦¤Ç¤¹¡£
-
----- ¤³¤³¤Þ¤Ç ----
-
-
-
-¡û¼Õ¼­
-
-¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤òºîÀ®¤¹¤ë¤Ë¤¢¤¿¤Ã¤Æ¤Ï°Ê²¼¤ÎÊý¡¹¤Ë¤´¶¨ÎϤò夭¤Þ¤·¤¿¡£
-¤³¤Î¾ì¤ò¤«¤ê¤Æ¤ªÎ鿽¤·¾å¤²¤Þ¤¹¡£¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
-
-gs23j10 ¤Î³«È¯¤Ë¶¨ÎϤ·¤Æ²¼¤µ¤Ã¤¿Êý
- IMAGICA¤Î°æÀ¤ó
- Å칩Âç¤Î±­»ô¤µ¤ó
- Ë­¶¶µ»²ÊÂç¤ÎÂ縫²Å¹°¤µ¤ó
- ¸Å²ÏÅŹ©¤ÎÂ绳ůÌ蘆¤ó
- ÅìÂç¤ÎÁÒÅ縲¾°¤µ¤ó
- ÅÅÄÌÂç¤Î·¬ÅÄÀµ¹Ô¤µ¤ó
- ·Ä±þ¤ÎÃæ´Ý¹¬¼£¤µ¤ó
- ÉÙ»ÎÄ̹ñºÝ¸¦¤ÎÌîϤ¤µ¤ó
- ÂçºåÅÅÄÌÂç¤ÎÆîÌ¤ó
-
-Zeit¥Õ¥©¡¼¥Þ¥Ã¥È¥Õ¥¡¥¤¥ëÍѤδÁ»ú¥Õ¥©¥ó¥È¥×¥í¥°¥é¥à¤òºî¤é¤ì¤¿Êý
- °æ¾å¹¯À®¤µ¤ó
- ¾¾²¼ÅÅ´ï¤ÎÀîËÜÂöÆ󤵤ó
-
-Zeit JG ¥Õ¥©¡¼¥Þ¥Ã¥È¥Õ¥¡¥¤¥ëÍѤδÁ»ú¥Õ¥©¥ó¥È¥×¥í¥°¥é¥à¤òºî¤é¤ì¤¿Êý
- ÞÉ»³ ÏÂŵ¤µ¤ó
-
-Canon LIPS-II/II+/III ¥×¥ê¥ó¥¿Íѥɥ饤¥Ð¤òºî¤é¤ì¤¿Êý
- ÆüËÜÅŵ¤¤ÎÁÒÅ縲¾°¤µ¤ó
-
-NEC PC-PR150 ¥×¥ê¥ó¥¿Íѥɥ饤¥Ð¤òºî¤é¤ì¤¿Êý
- ¿À¸ÍÂç³Ø¤Î¹ÃËÜÂîÌ餵¤ó
-
-ESC/Page Íѥɥ饤¥Ð¤òºî¤é¤ì¤¿Êý
- ÆüËÜÅŵ¤¥¢¥¤¥·¡¼¥Þ¥ó¥³¥ó¥·¥¹¥Æ¥à¶å½£LSI³«È¯¥»¥ó¥¿¡¼¤ÎÀ®¾¾ ¹¨¤µ¤ó
-
-Star JJ-100 ¥×¥ê¥ó¥¿Íѥɥ饤¥Ð¤òºî¤é¤ì¤¿Êý
- ²£»³ÏÂͳ¤µ¤ó
-
-Canon BJ10v ¥×¥ê¥ó¥¿Íѥɥ饤¥Ð¤òºî¤é¤ì¤¿Êý
- ·Ä±þÂç³Ø¤Î´ä°æµ±Ãˤµ¤ó¡¢Á°ÅÄÆػʤµ¤ó¡¢¾¾°æ¹§Íº¤µ¤ó
-
-
-
-¡û¥Õ¥¡¥¤¥ë¡¦¥ê¥¹¥È
-
-gs261j.doc ¥É¥­¥å¥á¥ó¥È(±Ñ¸ì)
-gs261j.jis ¥É¥­¥å¥á¥ó¥È(JIS)
-gs261j.sj ¥É¥­¥å¥á¥ó¥È(¥·¥Õ¥ÈJIS)
-gs261j.euc ¥É¥­¥å¥á¥ó¥È(EUC)
-
-gs261j.diff Ghostscript Ver. 2.6.1 º¹Ê¬¥Õ¥¡¥¤¥ë
-
-zcomp.c Ê£¹ç¥Õ¥©¥ó¥È¥ª¥Ú¥ì¡¼¥¿ÄêµÁ¥×¥í¥°¥é¥à
-kfutil.c ´Á»ú¥Õ¥©¥ó¥È¥æ¡¼¥Æ¥£¥ê¥Æ¥£¥×¥í¥°¥é¥à
-zkfimpath.c ¥¤¥á¡¼¥¸¥Ñ¥¹¥ª¥Ú¥ì¡¼¥¿ÄêµÁ¥×¥í¥°¥é¥à
-
-zkfpcf.c PCF¥Õ¥©¥ó¥ÈÍÑ¥ª¥Ú¥ì¡¼¥¿ÄêµÁ¥×¥í¥°¥é¥à
-zkfsnf.c SNF¥Õ¥©¥ó¥ÈÍÑ¥ª¥Ú¥ì¡¼¥¿ÄêµÁ¥×¥í¥°¥é¥à
-zkfsony.c Sony(TM)¥Ù¥¯¥¿¡¼¥Õ¥©¥ó¥ÈÍÑ¥ª¥Ú¥ì¡¼¥¿ÄêµÁ¥×¥í¥°¥é¥à
-zkfzeit.c Zeit(TM)¥Õ¥©¥ó¥ÈÍÑ¥ª¥Ú¥ì¡¼¥¿ÄêµÁ¥×¥í¥°¥é¥à
-zkfztbez.c Zeit(TM) JG ¥Õ¥©¥ó¥ÈÍÑ¥ª¥Ú¥ì¡¼¥¿ÄêµÁ¥×¥í¥°¥é¥à
-zkfjtex.c ÆüËܸìTeX PK¥Õ¥©¥ó¥ÈÍÑ¥ª¥Ú¥ì¡¼¥¿ÄêµÁ¥×¥í¥°¥é¥à
-
-drivers/
- gdevnwp/ Sony NWP-533/537 ¥×¥ê¥ó¥¿Íѥɥ饤¥Ð
- gdevlips/ Canon LIPS-II/II+/III ¥×¥ê¥ó¥¿Íѥɥ饤¥Ð
- gdevp201/ NEC PC-PR201 ¥×¥ê¥ó¥¿Íѥɥ饤¥Ð
- gdevp150/ NEC PC-PR150 ¥×¥ê¥ó¥¿Íѥɥ饤¥Ð
- gdevepag/ ESC/Page Íѥɥ饤¥Ð
- gdevj100/ Star JJ-100 ¥×¥ê¥ó¥¿Íѥɥ饤¥Ð
- gdev10v/ Canon BJ10v ¥×¥ê¥ó¥¿Íѥɥ饤¥Ð
-
-kanji/
- kinit.ps ´Á»ú²½ÍÑ¥×¥í¥°¥é¥à
- metrics2.ps ½Ä½ñ¤­ÍÑ¥×¥í¥°¥é¥à
- kbitmap.ps ¥Ó¥Ã¥È¥Þ¥Ã¥×´Á»ú¥Õ¥©¥ó¥ÈÍÑ¥×¥í¥°¥é¥à
- koutline.ps ¥¢¥¦¥È¥é¥¤¥ó¥Õ¥©¥ó¥ÈÍÑ¥×¥í¥°¥é¥à
- kbase.ps ´Á»ú¥Ù¡¼¥¹¥Õ¥©¥ó¥ÈÄêµÁÍÑ¥×¥í¥°¥é¥à
- kcomp.ps ´Á»úÊ£¹ç¥Õ¥©¥ó¥ÈÄêµÁÍÑ¥×¥í¥°¥é¥à
- kmapping.ps ´Á»úJIS¥³¡¼¥É¥Þ¥Ã¥Ô¥ó¥°ÍÑ¥×¥í¥°¥é¥à
-
- kfpcf.ps X11R5 PCF¥Õ¥©¥ó¥ÈÍÑ¥×¥í¥°¥é¥à
- kfsnf.ps X11R4 SNF¥Õ¥©¥ó¥ÈÍÑ¥×¥í¥°¥é¥à
- kfsony.ps Sony(TM)¥Ù¥¯¥¿¡¼¥Õ¥©¥ó¥ÈÍÑ¥×¥í¥°¥é¥à
- kfzeit.ps Zeit(TM)¥Õ¥©¥ó¥ÈÍÑ¥×¥í¥°¥é¥à
- kfztbez.ps Zeit(TM) JG ¥Õ¥©¥ó¥ÈÍÑ¥×¥í¥°¥é¥à
- kfjtex.ps ÆüËܸìTeX PK¥Õ¥©¥ó¥ÈÍÑ¥×¥í¥°¥é¥à
-
- pcf.ps X11R5 PCF¥Õ¥©¥ó¥ÈÍѥƥó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë
- snf.ps X11R4 SNF¥Õ¥©¥ó¥ÈÍѥƥó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë
- sony.ps Sony(TM)¥Ù¥¯¥¿¡¼¥Õ¥©¥ó¥ÈÍѥƥó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë
- zeit.ps Zeit(TM)¥Ù¥¯¥¿¡¼¥Õ¥©¥ó¥ÈÍѥƥó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë
- ztbez.ps Zeit(TM) JG ¥Õ¥©¥ó¥ÈÍѥƥó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë
- jtex.ps ÆüËܸìTeX PK¥Õ¥©¥ó¥ÈÍѥƥó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë
-
- hankaku.ps Ⱦ³Ñʸ»úɽ¼¨¥µ¥ó¥×¥ë
- allkanji.ps Á´´Á»úɽ¼¨¥µ¥ó¥×¥ë
- fmaptype.ps Ê£¹ç¥Õ¥©¥ó¥È¥Þ¥Ã¥Ô¥ó¥°¥µ¥ó¥×¥ë
- vchars.ps ½Ä½ñ¤­Ê¸»ú¤Î¥µ¥ó¥×¥ë
- article9.ps ½Ä½ñ¤­Ê¸¾Ï¤Î¥µ¥ó¥×¥ë
-
-include.pcf/ PCF¥Õ¥©¥ó¥ÈÍѥإåÀ¥Õ¥¡¥¤¥ë¤ò³ÊǼ¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê
-include.snf/ SNF¥Õ¥©¥ó¥ÈÍѥإåÀ¥Õ¥¡¥¤¥ë¤ò³ÊǼ¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê
-
-
-
-¡û¥Ð¡¼¥¸¥ç¥ó¤Ë¤Ä¤¤¤Æ
-
-gs23j10 (Oct. 4, 1991)
- Ghostscript ver. 2.3ÍÑ ÆüËܸ첽¥Ñ¥Ã¥±¡¼¥¸
-
-gs23j11 (Dec.24, 1991)
- ´Á»ú¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë̾¤ò¸¡º÷¤¹¤ë¥Ï¥Ã¥·¥å¥ë¡¼¥Á¥ó¤Î¥Ð¥°¤ò½¤Àµ¤·¤¿¡£
- ÊÑ¿ô̾ index ¤È´Ø¿ô̾ index ¤È¤¬¾×Æͤ¹¤ëÌäÂê¤ò²óÈò¤·¤¿¡£
-
-gs23j12 (Jan.17, 1992)
- ¥Õ¥©¥ó¥È¥á¥È¥ê¥Ã¥¯¥¹¤òñ°ì¤Î¿ôÃͤǻØÄꤷ¤¿¤È¤­¥¨¥é¡¼¤¬µ¯¤³¤ë¥Ð¥°¤ò
- ½¤Àµ¤·¤¿¡£
-
-
-gs24j10 (May.15, 1992)
- Ghostscript ver. 2.4.1ÍÑ ÆüËܸ첽¥Ñ¥Ã¥±¡¼¥¸
-
-gs241j11 (Jul. 1, 1992)
- gs24j10 ¤Î¥Ð¥°¤ò½¤Àµ¤·¤¿¡£
-
-
-gs261j01b (Aug.20, 1993)
- Ghostscript ver. 2.6.1ÍÑ ÆüËܸ첽¥Ñ¥Ã¥±¡¼¥¸ ¦Â¥Ð¡¼¥¸¥ç¥ó
-
-gs261j10 (Jan.11, 1994)
- Ghostscript ver. 2.6.1ÍÑ ÆüËܸ첽¥Ñ¥Ã¥±¡¼¥¸
-
-
-
-¡ûº¹Ê¬¤Ë¤Ä¤¤¤Æ
-
-bfont.h
- make_composite_font(), make_descender_fonts()¤Î¥×¥í¥È¥¿¥¤¥×Àë¸À¤òÄɲá£
-
-gs_init.ps
- ¥ª¥ê¥¸¥Ê¥ë¤Î¥Õ¥©¥ó¥È¥ª¥Ú¥ì¡¼¥¿¤òÊ£¹ç¥Õ¥©¥ó¥È¥ª¥Ú¥ì¡¼¥¿¤ËÃÖ´¹¡£
- kinit.ps ¤ª¤è¤Ó metrics2.ps ¤òÆɤ߹þ¤àÍѤËÊѹ¹¡£
-
-gs_fonts.ps
- QUIET ¥â¡¼¥É¤Ç¡¢¤«¤Ä¡¢¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¤¬¸«¤Ä¤«¤é¤Ê¤¤¤È¤­¡¢¥Õ¥©¥ó¥È̾¤ò
- ¥¹¥¿¥Ã¥¯¤Ë»Ä¤·¤Æ¤·¤Þ¤¦¤È¤¤¤¦ÉÔ¶ñ¹ç¤Î½¤Àµ¡£
-
-gschar.c
- gs_setcachedevice2 ¤ò½¤Àµ¡£½Ä½ñ¤­¥Õ¥©¥ó¥È(WMode=1)¤ËÂбþ¡£
- gs_setrootfont(), gs_currentrootfont()¤òÄêµÁ¡£
-
-gschar.h
- gs_setrootfont(), gs_currentrootfont()¤Î¥×¥í¥È¥¿¥¤¥×Àë¸À¤òÄɲá£
-
-gsfont.c
- ¥­¥ã¥Ã¥·¥å¥µ¥¤¥º¤ò³ÈÂç¡£
- UniqueID ¤ò»ý¤¿¤Ê¤¤¤Ï¤º¤ÎÊ£¹ç¥Õ¥©¥ó¥È¤ò¡¢¥Ù¡¼¥¹¥Õ¥©¥ó¥ÈƱÍÍ¥­¥ã¥Ã¥·¥å
-¤·¤Æ¤·¤Þ¤¦¤È¤¤¤¦ÉÔ¶ñ¹ç¤Î½¤Àµ¡£
-
-gzstate.h
- ¾õÂ֤Ȥ·¤Æ¡¢rootfont ¤òÄɲá£
-
-zchar2.c
- zrootfont() ¤¬ gs_currentrootfont() ¤ò»È¤¦¤è¤¦¤ËÊѹ¹¡£
-
-zfont.c
- ¥ë¡¼¥È¥Õ¥©¥ó¥È¤ËÂбþ¤¹¤ë¤¿¤á¡¢zsetfont¤òÊѹ¹¡£
- Ê£¹ç¥Õ¥©¥ó¥È¤ËÂФ·¤Æ makefont ¤ò¹Ô¤Ê¤¦ºÝ¡¢make_composite_font()¤ò¸Æ
-¤Ö¤è¤¦¤ËÊѹ¹¡£
- make_composite_font()¤òÄêµÁ¡£
-
-zfont0.c
- zbuildfont0¤ÎºÇ¸å¤Ç¡¢make_descender_fonts()¤ò¸Æ¤Ö¤è¤¦¤ËÊѹ¹¡£
- make_descender_fonts()¤òÄêµÁ¡£
-
-zfont2.c
- makefont¥­¥ã¥Ã¥·¥å¤Î¸úΨ²½¤Î¤¿¤áµ¶UniqueID¤òÀ¸À®¤¹¤ë¤è¤¦Êѹ¹¡£
-
-gs.mak
- Ê£¹ç¥Õ¥©¥ó¥Èµ¡Ç½¡¢´Á»ú¥Õ¥©¥ó¥Èµ¡Ç½¤òÄɲá£
-
-cc-head.mak
-gcc-head.mak
-ansihead.mak
- GS_LIB_DEFAULT ¤Ë $(gsdatadir)/kanji ¤òÄɲá£
- ¥³¥ó¥Ñ¥¤¥ë¡¦¥ª¥×¥·¥ç¥ó¤Ë -DCOMPFONT -DWMODE -DKANJI ¤òÄɲá£
- FEATURE_DEVS ¤Ë kanji.dev kfpcf.dev kfsnf.dev kfzeit.dev kfztbez.dev
- kfjtex.dev ¤òÄɲá£
-
-unixhead.mak
- °ÅÌۤΥ롼¥ë `.c.o' ¤Î°Í¸¥Õ¥¡¥¤¥ë $(AK) ¤òºï½ü¡£
-
-unixtail.mak
- ½ÐÎϤµ¤ì¤ë¼Â¹Ô¥Õ¥¡¥¤¥ë¤Î̾Á°¤ò `gs' ¤«¤é $(GS)$(XE) ¤ËÊѹ¹¡£
-
-unix-cc.mak
-unix-gcc.mak
-unix-ansi.mak
- gs.mak, cc-head.mak, gcc-head.mak, ansihead.mak ¤Ë¹ç¤ï¤»¤ÆÊѹ¹¡£
diff --git a/gs/contrib/japanese/doc/gs261j.txt b/gs/contrib/japanese/doc/gs261j.txt
deleted file mode 100644
index aab0e0588..000000000
--- a/gs/contrib/japanese/doc/gs261j.txt
+++ /dev/null
@@ -1,494 +0,0 @@
-Ghostscript Kanji Package gs261j
-Version 1.0 Jan.11,1994 by Norio KATAYAMA (katayama@nacsis.ac.jp)
-Copyright (C) 1991,1992,1993,1994 Norio Katayama.
-This document is translated into English on Jan.11,1994.
-
-
-Features
-========
-
- 1. Support for Japanese.
- a. composite fonts.
- b. font metrics (Metrics, Metrics2, CDevProc).
- c. vertical writing (WMode).
-
- 2. Support for Kanji font files.
- a. X11R5 PCF font files.
- b. X11R4 SNF font files.
- c. Sony(TM) vector font files.
- d. Zeit(TM) format font files.
- Authors: Takuji KAWAMOTO, and Yasunari INOUE.
- e. Zeit(TM) JG format font files.
- Author: Kazunori ASAYAMA
- f. JTeX PK font files.
-
- 3. Device drivers.
- a. gdevnwp (Sony NWP-533/537 printer)
- b. gdevlips (Canon LIPS-II/II+/III printer)
- Author: Akihisa KURASHIMA
- c. gdevp201 (NEC PC-PR201 printer)
- d. gdevp150 (NEC PC-PR150 printer)
- Author: Takuya KOUMOTO
- e. gdevepag (ESC/Page)
- Author: Hiroshi NARIMATSU
- f. gdevj100 (Star JJ-100 printer)
- Author: Caz Yokoyama
- g. gdev10v (Canon BJ10v printer)
- Authors: Teruo IWAI, Atusi MAEDA, Takao MATUI
-
-
-Tested Environments
-===================
-
- +--------------+-----------------+-----------------+-------------+
- | OS | Machine | Compiler | Device |
- +--------------+-----------------+-----------------+-------------+
- | SunOS 4.1.3 | SPARC Station 2 | cc -O / gcc -O | X11 |
- +--------------+-----------------+-----------------+-------------+
-
-
-
-Notes
-=====
-
-Any questions, requests, and bug reports are welcomed.
- JUNET: katayama@nacsis.ac.jp NIFTY: NBB01613
-
-
-
-Notices
-=======
-
-Sony vector font files, Zeit format font files, and JTeX PK font files
-are commercial products. Please be careful not to violate their
-licenses.
-
-This Kanji package is not an official patch. Therefore you should keep
-the original distribution.
-
-No author takes responsibility for the consequences of using this
-package.
-
-Everyone is permitted to copy, modify and redistribute this package
-only for nonprofit use.
-
-
-How to install (UNIX)
-=====================
-
-[1] Building Ghostscript
-
-(1) Extract source files from the original distribution of Ghostscript
- version 2.6.1.
- This package is based on the source files to which the following
- patches are applied.
- ghostscript-2.6.1.fix-01.gz
- ghostscript-2.6.1.fix-02.gz
- ghostscript-2.6.1.fix-03.gz
- ghostscript-2.6.1.fix-04.gz
-
-(2) Extract the contents of this package in the directory containing
- the original source files.
-
-(3) Apply a patch file `gs261j.diff' to the original source files.
-
-(4) Copy unix-cc.mak, unix-gcc.mak or unix-ansi.mak onto Makefile, and
- edit it appropriately. At least four configurations described
- below must be done.
-
- 1. Set prefix, exec_prefix, bindir, datadir, and gsdatadir macros to
- specify the directory to which Ghostscript will be installed.
-
-
- 2. Set CFLAGS, LDFLAGS, EXTRALIBS, XINCLUDE, and XLIBDIRS macros to
- configure compilation options.
-
- 3. Choose the features of Kanji font files to be included and add
- some of the symbols listed below to FEATURE_DEVS.
-
- kfpcf.dev X11R5 PCF font files.
- kfsnf.dev X11R4 SNF font files.
- kfsony.dev Sony vector font files.
- kfzeit.dev Zeit format font files.
- kfztbez.dev Zeit JG format font files.
- kfjtex.dev JTeX PK font files.
-
- Examples)
- To include the features of PCF font files, SNF font files, Zeit
- format font files, Zeit JG format font files, and JTeX PK font files.
-
- FEATURE_DEVS=filter.dev dps.dev level2.dev kanji.dev \
- kfpcf.dev kfsnf.dev kfzeit.dev kfztbez.dev kfjtex.dev
-
- To include the feature of Sony vector font files only.
-
- FEATURE_DEVS=filter.dev dps.dev level2.dev kanji.dev \
- kfsony.dev
-
- To include the features of PCF font files, SNF font files, Zeit
- format font files, Zeit JG format font files, JTeX PK font files,
- and Sony vector font files.
-
- FEATURE_DEVS=filter.dev dps.dev level2.dev kanji.dev \
- kfpcf.dev kfsnf.dev kfzeit.dev kfztbez.dev kfjtex.dev \
- kfsony.dev
-
-
- 4. Choose the devices to be included and add the symbols for them to
- DEVICE_DEVS.
-
- Example)
- To include the device driver of X11.
-
- DEVICE_DEVS=x11.dev
-
- If you want to use the device drivers contained in this package,
- see documents in the `drivers' subdirectory.
-
-
-(5) MAKE and install Ghostscript.
-
-(6) Extract font files from ghostscript-fonts-2.6.1.tar.gz into the
- directory specified by the gsdatadir macro in Makefile.
-
- Example)
- When gsdatadir is the default value (/usr/local/lib/ghostscript) :
-
- % cd /usr/local/lib/ghostscript
- % gunzip < ghostscript-fonts-2.6.1.tar.gz | tar xvf -
-
-
-[2] Configuring Kanji Fonts
-
-(1) Change the working directory to the `kanji' directory which is a
- subdirectory of the directory specified by the gsdatadir macro in
- Makefile.
-
- Example)
- When gsdatadir is the default value (/usr/local/lib/ghostscript) :
-
- % cd /usr/local/lib/ghostscript
- % cd kanji
-
-(2) Copy one of the following template files onto `kconfig.ps'.
-
- pcf.ps for X11R5 PCF font files.
- snf.ps for X11R4 SNF font files.
- sony.ps for Sony vector font files.
- zeit.ps for Zeit format font files.
- ztbez.ps for Zeit JG format font files.
- jtex.ps for JTeX PK font files.
-
-(3) Edit `kconfig.ps' appropriately. Normally, you have only to change
- the names of font files.
-
- The details of `kconfig.ps' are described in the section ``Kanji
- Configuration File''.
-
-
-[3] Testing Kanji fonts.
-
- Execute the following sample programs with gs and verify Kanji fonts
- are displayed correctly.
-
- hankaku.ps A list of half-width Kanji characters.
- allkanji.ps A list of Kanji characters.
- fmaptype.ps A test program of the composite font mapping.
- vchars.ps A list of characters for vertical writing.
- article9.ps Article 9 of the Constitution of Japan.
-
- Because sample programs are contained in the Kanji library directory,
- you need not specify a directory path.
-
- Example)
- % gs hankaku.ps
-
-Note
-----
- If you use X11R4 SNF font files which are provided by manufactures
- (i.e. not made from the MIT distribution), it is possible that
- Kanji characters are not displayed correctly. This is because the
- SNF format is dependent on X server and the default values defined
- in bdftosnf.h is not appropriate to the server. Edit lines from 37
- to 53 in zkfsnf.c to solve this problem.
-
-
-
-Kanji Configuration File
-========================
-
- Kanji fonts for Ghostscript are defined in the Kanji configuration
- file. The name of this file is `kconfig.ps' by default, but it can
- be changed by -sKCONFIG switch (see the section `Command switches').
-
-[1] Definition of Kanji Fonts
-
- Kanji fonts are defined in the following format.
-
- FontName UniqueID [ FileName ] Operator
-
- FontName
- is a name of the Kanji font to be defined.
- `/Ryumin-Light' and `/GothicBBB-Medium' are standard Kanji fonts.
-
- UniqueID
- is a unique identifier of the font.
- Normally, the identifiers may be set from 4300000 with 200
- differences.
-
- FileName
- is the name of the font file to be used.
- The rule of this field is determined by `Operator', so see
- comments in the template files for details
-
- Operator
- is a Ghostscript operator to define Kanji font.
-
- For example, if you want to define a Kanji font with a name
- `/Ryumin-Light' using a X11R5 PCF font file whose path name is
- "/usr/lib/X11/fonts/misc/k24.pcf", you will write the following line
- in the Kanji configuration file.
-
- /Ryumin-Light 4300000 (/usr/lib/X11/fonts/misc/k24.pcf) pcfkanji
-
- With this line, the following Kanji fonts will be available.
-
- /Ryumin-Light.r## (## = 21 - 7E) horizontal JIS base Kanji
- /Ryumin-Light.r##v (## = 21, 22, 24, 25) vertical JIS base Kanji
- /Ryumin-Light.sr## (## = 81 - 9F, E0 - EA) horizontal SJIS base Kanji
- /Ryumin-Light.sr##v (## = 81 - 83) vertical SJIS base Kanji
-
- /Ryumin-Light.Roman half-width alphanumeric characters
- /Ryumin-Light.Hiragana half-width Hiragana
- /Ryumin-Light.Katakana half-width Katakana
- /Ryumin-Light.Hankaku half-width alphanumerics, Hiragana, Katakana
- /Ryumin-Light.SuppK half-width Katakana for SJIS
-
- /Ryumin-Light-H horizontal JIS Kanji
- /Ryumin-Light-V vertical JIS Kanji
- /Ryumin-Light-Ext-H horizontal Extended JIS Kanji
- /Ryumin-Light-Ext-V vertical Extended JIS Kanji
- /Ryumin-Light-EUC-H horizontal EUC Kanji
- /Ryumin-Light-EUC-V vertical EUC Kanji
- /Ryumin-Light-RKSJ-H horizontal Roman, Katakana, SJIS Kanji
- /Ryumin-Light-RKSJ-V vertical Roman, Katakana, SJIS Kanji
- /Ryumin-Light-83pv-RKSJ-H horizontal Roman, Katakana, SJIS Kanji
-
- Although Kanji fonts in Extended JIS Encoding are defined,
- characters to be displayed are determined by the contents of font
- files. For the same reason, the Kanji encoding such as JIS-78 and
- JIS-83 are also determined by font files.
-
-[2] Definition of Aliases
-
- An operator `copykanji' can be used to define aliases of Kanji fonts.
- The following is the format of `copykanji'.
-
- FontName NewName copykanji
-
- For example, the following line defines an alias `/ChuGothicBBB-Medium'
- for the font `/GothicBBB-Medium-83pv-RKSJ-H'.
-
- /GothicBBB-Medium-83pv-RKSJ-H /ChuGothicBBB-Medium copykanji
-
-
-Command Switches
-================
-
-New command switches are available.
-
- -dNOKANJI Suppress installing Kanji fonts.
- -sKCONFIG=foo.ps Define the name of the Kanji configuration file.
-
-
-Acknowledgements
-================
-
-In developing this package I obtained cooperation from the following
-persons. I make my acknowledgement with thanks to them.
-
-Cooperators in developing gs23j10.
- IKAWA, Takanori UGAI, Yoshihiro OHMI, Tetsuya OHYAMA,
- Akihisa KURASHIMA, Masayuki KUWADA, NAKAMARU, NORO,
- and Hisashi MINAMINO
-
-Authors of the feature of Zeit format font files.
- Takuji KAWAMOTO, and Yasunari INOUE
-
-Author of the feature of Zeit JG format font files.
- Kazunori ASAYAMA
-
-Author of the Canon LIPS-II/II+/III printer driver.
- Akihisa KURASHIMA
-
-Author of the NEC PC-PR150 printer printer driver.
- Takuya KOUMOTO
-
-Author of the ESC/Page printer driver.
- Hiroshi NARIMATSU
-
-Author of the Star JJ-100 printer driver.
- Caz Yokoyama
-
-Author of the Canon BJ10v printer driver.
- Teruo IWAI, Atusi MAEDA, Takao MATUI
-
-
-File List
-=========
-
-gs261j.doc Document of this package (English)
-gs261j.jis Document of this package (Japanese in JIS Kanji)
-gs261j.sj Document of this package (Japanese in SJIS Kanji)
-gs261j.euc Document of this package (Japanese in EUC Kanji)
-
-gs261j.diff Patch file for Ghostscript version 2.4.1
-
-zcomp.c C program defining composite font operators.
-kfutil.c C program defining Kanji font utilities.
-zkfimpath.c C program defining imagepath operator.
-
-zkfpcf.c C program defining PCF font file operator.
-zkfsnf.c C program defining SNF font file operator.
-zkfsony.c C program defining Sony vector font file operator.
-zkfzeit.c C program defining Zeit font file operator.
-zkfztbez.c C program defining Zeit JG font file operator.
-zkfjtex.c C program defining JTeX PK font file operator.
-
-drivers/
- gdevnwp/ Sony NWP-533/537 printer driver
- gdevlips/ Canon LIPS-II/II+/III printer driver
- gdevp201/ NEC PC-PR201 printer driver
- gdevp150/ NEC PC-PR150 printer driver
- gdevpag/ ESC/Page printer driver
- gdevj100/ Star JJ-100 printer driver
- gdev10v/ Canon BJ10v printer
-
-kanji/
- kinit.ps GS program for Kanji environment.
- metrics2.ps GS program for vertical writing.
- kbitmap.ps GS program for bitmap Kanji fonts.
- koutline.ps GS program for outline Kanji fonts.
- kbase.ps GS program for defining Kanji base fonts.
- kcomp.ps GS program for defining Kanji composite fonts.
- kmapping.ps GS program for the mapping from symbols to JIS codes.
-
- kfpcf.ps GS program for X11R5 PCF font files.
- kfsnf.ps GS program for X11R4 SNF font files.
- kfsony.ps GS program for Sony vector font files.
- kfzeit.ps GS program for Zeit format font files.
- kfztbez.ps GS program for Zeit JG format font files.
- kfjtex.ps GS program for JTeX PK font files.
-
- pcf.ps Template file for X11R5 PCF font files.
- snf.ps Template file for X11R4 SNF font files.
- sony.ps Template file for Sony vector font files.
- zeit.ps Template file for Zeit format font files.
- ztbez.ps Template file for Zeit JG format font files.
- jtex.ps Template file for JTeX PK font files.
-
- hankaku.ps Sample of half-width Kanji characters.
- allkanji.ps Sample of Kanji characters.
- fmaptype.ps Sample of the composite font mapping.
- vchars.ps Sample of characters for vertical writing.
- article9.ps Sample of vertical writing.
-
-include.pcf/ Directory containing header files for PCF fonts.
-include.snf/ Directory containing header files for SNF fonts.
-
-
-History
-=======
-
-gs23j10 (Oct. 4, 1991)
- Kanji package for Ghostscript version 2.3.
-
-gs23j11 (Dec.24, 1991)
-
-gs23j12 (Jan.17, 1992)
-
-
-gs24j10 (May.15, 1992)
- Kanji package for Ghostscript version 2.4.1.
-
-gs241j11 (Jul. 1, 1992)
-
-
-gs261j01b (Aug.20, 1993)
- Kanji package for Ghostscript version 2.6.1. (beta version)
-
-gs261j10 (Jan.11, 1994)
- Kanji package for Ghostscript version 2.6.1.
-
-
-Patches
-=======
-
-bfont.h
- The prototype declaration of make_composite_font() and
- make_descender_fonts() are added.
-
-gs_init.ps
- Base font operators are replaced with composite font operators.
- `kinit.ps' and `metrics2.ps' are invoked.
-
-gs_fonts.ps
- The problem is fixed that the findfont operator leaves a font name
- in the stack when it is in QUIET mode and the font file is not found.
-
-gschar.c
- gs_setcachedevice2() is adapted to the vertical writing.
- The vertical writing feature is implemented.
- gs_setrootfont() and gs_currentrootfont() are defined.
-
-gschar.h
- The prototype declaration of gs_setrootfont() and gs_currentrootfont()
- are added.
-
-gsfont.c
- The font cache is enlarged for the efficiency of Kanji fonts.
- The problem is fixed that composite fonts, which have no UniqueID,
- are cached by makefont.
-
-gzstate.h
- rootfont is added into the graphics state.
-
-zchar.c
- zrootfont() is changed to call gs_currentrootfont().
-
-zfont.c
- zsetfont() is adapted to rootfont.
- make_font() calls make_composite_font() when it transforms composite
- fonts.
- make_composite_font() is defined.
-
-zfont0.c
- zbuildfont0() is changed to call make_descender_fonts().
- make_descender_fonts() is defined.
-
-zfont2.c
- A `fake UniqueID' facility is implemented to enhance the efficiency
- of the `makefont' cache.
-
-gs.mak
- The features of composite fonts and Kanji fonts are added.
-
-cc-head.mak
-gcc-head.mak
-ansihead.mak
- `$(gsdatadir)/kanji' is added to the GS_LIB_DEFAULT macro.
- `-DCOMPFONT -DWMODE -DKANJI' is added to the compilation flags.
- `kanji.dev kfpcf.dev kfsnf.dev kfzeit.dev kfztbez.dev kfjtex.dev' is
- added to the FEATURE_DEVS macro.
-
-unixhead.mak
- The dependency `$(AK)' is removed from the implicit rule `.c.o'.
-
-unixtail.mak
- The name of the output file is changed from `gs' to` $(GS)$(XE)'.
-
-unix-cc.mak
-unix-gcc.mak
-unix-ansi.mak
- These files are updated according to the changes of gs.mak,
- cc-head.mak, gcc-head.mak, and ansihead.mak.
diff --git a/gs/contrib/japanese/dviprlib.c b/gs/contrib/japanese/dviprlib.c
deleted file mode 100644
index 0e57056c7..000000000
--- a/gs/contrib/japanese/dviprlib.c
+++ /dev/null
@@ -1,2834 +0,0 @@
-/* COPYRIGHT (C) 1990, 1992 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. */
-
-/* dviprlib.c */
-
-#include "stdio_.h"
-#include "ctype_.h"
-#include "malloc_.h"
-#include "string_.h"
-#include "gstypes.h"
-#include "gsmemory.h"
-#include "gp.h"
-
-/* include library header. */
-#define dviprlib_implementation
-#include "dviprlib.h"
-
-/* The remainder of this file is a copy of the library for dviprt. */
-
-
-/***** From rcfg.c *****/
-/* $Id: RCFG.C 1.1 1994/08/30 02:27:02 kaz Exp kaz $ */
-
-
-/*--- forward declarations ---*/
-private int dviprt_read_S_cfg(dviprt_cfg_t *,dviprt_cfg_i *);
-private int dviprt_read_QR_cfg(dviprt_cfg_t *,dviprt_cfg_i *);
-
-/*--- library functions ---*/
-int
-dviprt_readcfg(char *ifname,dviprt_cfg_t *pcfg,uchar *pcodebuf,int codebuf_s,
- uchar *pworkbuf,int workbuf_s)
-{
- int code;
- int ver;
- dviprt_cfg_i info;
-
- info.fname = ifname;
- info.line_no = -1;
- if (ifname) {
- info.file = fopen(ifname,gp_fmode_rb);
- if (info.file == NULL) {
- dviprt_printcfgerror(&info,"Cannot open.\n",-1);
- return CFG_ERROR_FILE_OPEN;
- }
- }
- else {
- info.file = stdin;
- }
-
- fseek(info.file,16,0);
- ver = fgetc(info.file);
- fseek(info.file,0,0);
- info.codebuf = pcodebuf;
- info.readbuf = pworkbuf;
- info.codebuf_size = codebuf_s;
- info.readbuf_size = workbuf_s;
- code = (ver == 'S') ? dviprt_read_S_cfg(pcfg,&info)
- : dviprt_read_QR_cfg(pcfg,&info);
-
- if (ifname) fclose(info.file);
- return code;
-}
-
-/*--- internal routines ---*/
-private int
-dviprt_read_S_cfg(dviprt_cfg_t *pcfg,dviprt_cfg_i *pinfo)
-{
- FILE *ifp;
- long intoff,stroff,codeoff;
- int i,count;
- uchar *pbuf,*rbuf;
- int code;
- char *ptype;
- int n;
-
- if ((code = dviprt_setcfgbuffer_(pinfo,100,0)) < 0) return code;
- dviprt_initcfg_(pcfg,pinfo);
-
- ifp = pinfo->file;
- rbuf = pinfo->readbuf;
-
- if (fread(rbuf,20,1,ifp) < 1) {
- dviprt_printcfgerror(pinfo,"Read error.\n",-1);
- }
- if (rbuf[17] != 0xff || rbuf[18] != 0xff) {
- not_cfg:
- dviprt_printcfgerror(pinfo,"This file does not seem *.CFG.\n",-1);
- return CFG_ERROR_OTHER;
- }
- if (memcmp(rbuf,CFG_MAGIC_NUMBER,2))
- goto not_cfg;
- pcfg->version = rbuf[2] | ((uint)rbuf[3] << 8);
- if (pcfg->version > CFG_VERSION) {
- sprintf(dviprt_message_buffer,
- "This *.CFG file is too new version(ver.%u).\n",pcfg->version);
- dviprt_printcfgerror(pinfo,dviprt_message_buffer,-1);
- return CFG_ERROR_OTHER;
- }
-
-#define bytes2long(p) ((p)[0] | ((long)(p)[1]<<8) | \
- ((long)(p)[2]<<16) | ((long)(p)[3]<<24))
- intoff = bytes2long(rbuf+4);
- stroff = bytes2long(rbuf+8);
- codeoff = bytes2long(rbuf+12);
-#undef bytes2long
-
- fseek(ifp,intoff,0);
- count = fgetc(ifp);
- fread(rbuf,count*3,1,ifp);
-
- pbuf = rbuf;
- for (i=0;i<count;i++) {
- n = pbuf[0];
- if (n >= CFG_INTEGER_TYPE_COUNT) {
- ptype = "integer";
- unknown_no:
- sprintf(dviprt_message_buffer,
- "Unknown %s type value No.%d is found.\n",ptype,n);
- dviprt_printcfgerror(pinfo,dviprt_message_buffer,-1);
- return CFG_ERROR_OTHER;
- }
- pcfg->integer[n] = pbuf[1] | ((uint)pbuf[2]<<8);
- pbuf += 3;
- }
-
- fseek(ifp,stroff,0);
- count = fgetc(ifp);
- pbuf = NULL;
- for (i=0;i<count;i++) {
- int l;
- fread(rbuf,3,1,ifp);
- n = rbuf[0];
- l = rbuf[1] | ((uint)rbuf[2]<<8);
- if (n >= CFG_STRINGS_TYPE_COUNT) {
- ptype = "strings";
- goto unknown_no;
- }
- if (pinfo->codebuf == NULL) {
- pcfg->strings[n] = (uchar *)malloc(l+1);
- if (pcfg->strings[n] == NULL) {
- no_memory:
- dviprt_printcfgerror(pinfo,"Memory exhausted.\n",-1);
- return CFG_ERROR_MEMORY;
- }
- }
- else {
- pcfg->strings[n] = pinfo->pcodebuf;
- pinfo->pcodebuf += (l+1);
- }
- fread(pcfg->strings[n],l,1,ifp);
- *(pcfg->strings[n]+l) = 0;
- }
-
- fseek(ifp,codeoff,0);
- count = fgetc(ifp);
- for (i=0;i<count;i++) {
- int l;
- fread(rbuf,3,1,ifp);
- n = rbuf[0];
- l = rbuf[1] | ((uint)rbuf[2]<<8);
-
- if (n >= CFG_PRTCODE_TYPE_COUNT) {
- ptype = "printer code";
- goto unknown_no;
- }
- if (pinfo->codebuf == NULL) {
- pcfg->prtcode[n] = (uchar *)malloc(l+1);
- if (pcfg->prtcode[n] == NULL)
- goto no_memory;
- }
- else {
- pcfg->prtcode[n] = pinfo->pcodebuf;
- pinfo->pcodebuf += (l+1);
- }
- fread(pcfg->prtcode[n],l,1,ifp);
- *(pcfg->prtcode[n]+l) = 0;
- pcfg->prtcode_size[n] = l;
- }
- dviprt_resetcfgbuffer_(pinfo);
- return 0;
-}
-
-private int
-dviprt_read_QR_cfg(dviprt_cfg_t *pcfg,dviprt_cfg_i *pinfo)
-{
-#define TYPE_BIT 0xc0
-
-#define NO_NUM 0
-#define BINARY_LTOH 1
-#define BINARY_HTOL 2
-#define DECIMAL_3 3
-#define DECIMAL_4 4
-#define DECIMAL_5 5
-#define DECIMAL_V 6
-
-#define TOTAL_BYTE 0x80
-#define ISO_NUMBER 0x40
-#define DIVIDEBY_2 0x10
-#define DIVIDE_ALL 0x30
-#define MULT_CONST 0x08
- enum {
- BIT_IMAGE_MODE,
- NORML_MODE,
- SEND_BIT_IMAGE,
- SKIP_SPACES,
- LINE_FEED,
- FORM_FEED,
- AFTER_BIT_IMAGE,
- BIT_ROW_HEADER,
- };
- uchar *cfg_buf,*ptr;
- int ch, type, f_cont, f_type, pos, i, j, k, lens;
- int f_r_format;
- long offset;
- int old2new[] = {
- CFG_BIT_IMAGE_MODE,
- CFG_NORMAL_MODE,
- CFG_SEND_BIT_IMAGE,
- CFG_SKIP_SPACES,
- CFG_LINE_FEED,
- CFG_FORM_FEED,
- CFG_AFTER_BIT_IMAGE,
- CFG_BIT_ROW_HEADER,
- };
-
- ch =dviprt_setcfgbuffer_(pinfo,300,TEMP_CODEBUF_SIZE);
- if (ch < 0) return CFG_ERROR_MEMORY;
- dviprt_initcfg_(pcfg,pinfo);
- cfg_buf = pinfo->readbuf;
- if (fread(cfg_buf,30,1,pinfo->file) < 1) {
- dviprt_printcfgerror(pinfo,"Read error.\n",-1);
- }
- if (cfg_buf[16] == 'P') {
- dviprt_printcfgerror(pinfo,"This is made by old version.\n",-1);
- return CFG_ERROR_OTHER;
- }
- else if (cfg_buf[16] == 'Q')
- f_r_format = 0;
- else if (cfg_buf[16] == 'R')
- f_r_format = 1;
- else
- f_r_format = -1;
- if (f_r_format == -1 || cfg_buf[18] != 0xff) {
- dviprt_printcfgerror(pinfo,"This is not the *.CFG file for dviprt.\n",-1);
- return CFG_ERROR_OTHER;
- }
- cfg_buf[16] = '\0';
- pcfg->version = 0;
- if (pinfo->temp_codebuf_f) {
- pcfg->strings[CFG_NAME] = malloc(strlen(cfg_buf)+1);
- if (pcfg->strings[CFG_NAME] == NULL) {
- no_memory:
- dviprt_printcfgerror(pinfo,"Memory exhausted.\n",-1);
- return CFG_ERROR_MEMORY;
- }
- }
- else {
- pcfg->strings[CFG_NAME] = pinfo->pcodebuf;
- pinfo->pcodebuf += strlen(cfg_buf);
- pinfo->pcodebuf++;
- }
- strcpy(pcfg->strings[CFG_NAME],cfg_buf);
-
- pcfg->integer[CFG_UPPER_POS] =
- (cfg_buf[17] & (CFG_LEFT_IS_LOW|CFG_NON_MOVING));
- pcfg->integer[CFG_ENCODE] =
- (cfg_buf[17] & 0x10) ? CFG_ENCODE_HEX : CFG_ENCODE_NULL;
- pcfg->integer[CFG_PINS] = ((uint) (cfg_buf[17]) & 0x0f);
-
- ptr = cfg_buf+23;
- pcfg->integer[CFG_MINIMAL_UNIT] = (uint)ptr[0] | ((uint)ptr[1]<<8);
- pcfg->integer[CFG_MAXIMAL_UNIT] = (uint)ptr[2] | ((uint)ptr[3]<<8);
- pcfg->integer[CFG_DPI] =
- f_r_format ? ((uint)ptr[4] | ((uint)ptr[5]<<8)) : 180;
- if (cfg_buf[20])
- pcfg->integer[CFG_CONSTANT] = cfg_buf[20];
- offset = cfg_buf[19];
- fseek(pinfo->file,offset,0);
-
- for (i = 0; i <= BIT_ROW_HEADER; i++) {
- uchar *pstart,*plength;
- uchar prev = 1;
- if (pinfo->temp_codebuf_f) {
- pinfo->pcodebuf = pinfo->codebuf;
- }
- pstart = pinfo->pcodebuf;
- do {
- lens = fgetc(pinfo->file);
- if (lens == EOF) break;
- fread(cfg_buf,lens+3,1,pinfo->file);
- ptr = cfg_buf;
- f_cont = *ptr++;
- pos = *ptr++;
- f_type = *ptr++;
- type = f_type & 0x7;
-
- for (j = 0; j < lens; j++) {
- ch = *ptr++;
- if (pos == j && type != NO_NUM) {
- uchar *pfmt = pinfo->pcodebuf++;
- plength = pinfo->pcodebuf++;
- *pinfo->pcodebuf++ = CFG_VAL_DEFAULT;
- *plength = 1;
- j++;
- ptr++;
- switch (type) {
- case (BINARY_LTOH):
- *pfmt = CFG_FMT_BIT | CFG_FMT_BIN_LTOH | 2;
- break;
- case (BINARY_HTOL):
- *pfmt = CFG_FMT_BIT | CFG_FMT_BIN_HTOL | 2;
- break;
- case (DECIMAL_3):
- *pfmt = CFG_FMT_BIT | CFG_FMT_DECIMAL | 3;
- j++;
- ptr++;
- break;
- case (DECIMAL_4):
- *pfmt = CFG_FMT_BIT | CFG_FMT_DECIMAL | 4;
- j += 2;
- ptr += 2;
- break;
- case (DECIMAL_5):
- *pfmt = CFG_FMT_BIT | CFG_FMT_DECIMAL | 5;
- j += 3;
- ptr += 3;
- break;
- case (DECIMAL_V):
- *pfmt = CFG_FMT_BIT | CFG_FMT_DECIMAL;
- j++;
- ptr++;
- break;
- default:
- sprintf(dviprt_message_buffer,"Unknown format %02X",type);
- dviprt_printcfgerror(pinfo,dviprt_message_buffer,-1);
- goto ex_func;
- }
- if (f_type & TOTAL_BYTE) {
- *pinfo->pcodebuf++ = CFG_VAL_PINS_BYTE;
- *pinfo->pcodebuf++ = CFG_OP_MUL;
- (*plength) += 2;
- }
- if ((k = (f_type & DIVIDE_ALL)) != 0) {
- *pinfo->pcodebuf = 0;
- for (; k > 0; k -= DIVIDEBY_2) {
- (*pinfo->pcodebuf)++;
- }
- pinfo->pcodebuf++;
- *pinfo->pcodebuf++ = CFG_OP_SHR;
- (*plength) += 2;
- }
- if (f_type & ISO_NUMBER) {
- *pfmt |= CFG_FMT_ISO_BIT;
- }
- if (f_type & MULT_CONST) {
- *pinfo->pcodebuf++ = CFG_VAL_CONSTANT;
- *pinfo->pcodebuf++ = CFG_OP_MUL;
- (*plength) += 2;
- }
- prev = 1;
- }
- else {
- if (prev == 1 || *plength >= 127) {
- plength = pinfo->pcodebuf++;
- *plength = 0;
- }
- (*plength)++;
- *pinfo->pcodebuf++ = ch;
- prev = 0;
- }
- }
- } while (f_cont & 0x80);
- *pinfo->pcodebuf++ = 0;
- { int n = old2new[i];
- uint l = pinfo->pcodebuf-pstart;
- pcfg->prtcode_size[n] = l - 1;
- if (pinfo->temp_codebuf_f) { /* allocate buffer */
- pcfg->prtcode[n] = (uchar *)malloc(l);
- if (pcfg->prtcode[n] == NULL)
- goto no_memory;
- memcpy(pcfg->prtcode[n],pstart,l);
- }
- else {
- pcfg->prtcode[n] = pstart;
- }
- }
- }
- ex_func:
- dviprt_resetcfgbuffer_(pinfo);
- return 0;
-}
-/***** End of rcfg.c *****/
-
-
-/***** From rsrc.c *****/
-/* $Id: RSRC.C 1.1 1994/08/30 02:27:02 kaz Exp kaz $ */
-
-
-typedef struct {
- char *name;
- signed char type;
- uchar no;
- uchar spec_f;
- uchar req_f;
- char *info;
-} dviprt_cfg_item_t;
-
-typedef struct {
- long min;
- long max;
-} dviprt_cfg_limit_t;
-
-/*--- forward declarations ---*/
-private int dviprt_set_select
- (dviprt_cfg_item_t *,uchar **,dviprt_cfg_t *,dviprt_cfg_i *);
-private int dviprt_set_integer
- (dviprt_cfg_item_t *, uchar *, dviprt_cfg_t *,dviprt_cfg_i *);
-private int dviprt_set_strings
- (dviprt_cfg_item_t *,uchar *,dviprt_cfg_t *,dviprt_cfg_i *);
-private int dviprt_set_rpexpr
- (dviprt_cfg_item_t *,uchar *,int , dviprt_cfg_t *,dviprt_cfg_i *,int);
-private int dviprt_set_code
- (dviprt_cfg_item_t *,uchar *,dviprt_cfg_t *,dviprt_cfg_i *);
-
-private long dviprt_oct2long(uchar *,uchar *,uchar **);
-private long dviprt_dec2long(uchar *,uchar *,uchar **);
-private long dviprt_hex2long(uchar *,uchar *,uchar **);
-
-private int dviprt_printtokenerror(dviprt_cfg_i *,char *,int ,int);
-
-/*--- macros ---*/
-#define strlcmp(tmplt,str,len) \
- (!(strncmp(tmplt,str,(int)(len)) == 0 && (int)(len) == strlen(tmplt)))
-#define set_version(pcfg,v) ((pcfg)->version = MAX(v,(pcfg)->version))
-
-enum {
- ERROR_UNKNOWN_VALUE,ERROR_UNKNOWN_FORMAT,ERROR_UNKNOWN_ESCSEQ,
- ERROR_OUTOFRANGE,
- ERROR_INVALID_VALUE,
- ERROR_COMPLICATED_EXPR,
- ERROR_INCOMPLETE,
-};
-
-/*--- library functions ---*/
-int
-dviprt_readsrc(char *fname,dviprt_cfg_t *pcfg,uchar *pcodebuf,int codebuf_s,
- uchar *pworkbuf,int workbuf_s)
-{
- dviprt_cfg_i info;
- int code;
- FILE *ifp;
- dviprt_cfg_item_t *pitem;
- int enc = CFG_ENCODE_NULL;
- enum { T_INTEGER,T_STRINGS,T_CODE,T_SELECT,T_UPPERPOS};
- static dviprt_cfg_limit_t pins_limit = { 8, 128 };
- static dviprt_cfg_limit_t positive_limit = { 1, 0x7fff };
- static dviprt_cfg_limit_t nonnegative_limit = { 0, 0x7fff};
- static dviprt_cfg_item_t dviprt_items[] = {
- {NULL,T_STRINGS,CFG_NAME,0,1,NULL},
- {NULL,T_INTEGER,CFG_PINS,0,1,(char*)&pins_limit},
- {NULL,T_INTEGER,CFG_MINIMAL_UNIT,0,0,(char*)&positive_limit},
- {NULL,T_INTEGER,CFG_MAXIMAL_UNIT,0,0,(char*)&positive_limit},
- {NULL,T_INTEGER,CFG_DPI,0,0,(char*)&positive_limit},
- {NULL,T_INTEGER,CFG_CONSTANT,0,0,(char*)&nonnegative_limit},
- {NULL,T_INTEGER,CFG_Y_DPI,0,0,(char*)&positive_limit},
- {NULL,T_CODE,CFG_BIT_IMAGE_MODE,0,1,NULL},
- {NULL,T_CODE,CFG_SEND_BIT_IMAGE,0,1,NULL},
- {NULL,T_CODE,CFG_BIT_ROW_HEADER,0,0,NULL},
- {NULL,T_CODE,CFG_AFTER_BIT_IMAGE,0,0,NULL},
- {NULL,T_CODE,CFG_LINE_FEED,0,0,NULL},
- {NULL,T_CODE,CFG_FORM_FEED,0,0,NULL},
- {NULL,T_CODE,CFG_NORMAL_MODE,0,1,NULL},
- {NULL,T_CODE,CFG_SKIP_SPACES,0,1,NULL},
- {NULL,T_UPPERPOS,CFG_UPPER_POS,0,1,NULL},
- {NULL,T_SELECT,CFG_ENCODE,0,0,(char*)dviprt_encodename},
- {NULL,-1},
- };
- static dviprt_cfg_item_t encode_info = {
- "encode",T_STRINGS,CFG_ENCODE_INFO,0,0,NULL
- };
- int prtcode_output_bytes[CFG_PRTCODE_TYPE_COUNT];
-
- info.line_no = -1;
- info.fname = fname;
- if (fname) {
- info.file = fopen(fname,"r");
- if (info.file == NULL) {
- dviprt_printcfgerror(&info,"Cannot open.\n",-1);
- return CFG_ERROR_FILE_OPEN;
- }
- }
- else {
- ifp = stdin;
- }
- ifp = info.file;
-
- info.codebuf = pcodebuf;
- info.readbuf = pworkbuf;
- info.codebuf_size = codebuf_s;
- info.readbuf_size = workbuf_s;
- /* allocate buffer */
- if (dviprt_setcfgbuffer_(&info,TEMP_READBUF_SIZE,TEMP_CODEBUF_SIZE) < 0) {
- fclose(info.file);
- return CFG_ERROR_MEMORY;
- }
-
- /* initialize */
- dviprt_initcfg_(pcfg,&info);
- for (pitem = dviprt_items;pitem->type>=0;pitem++) {
- if (pitem->name == NULL) {
- switch (pitem->type) {
- case T_INTEGER:
- case T_SELECT:
- case T_UPPERPOS:
- pitem->name = dviprt_integername[pitem->no];
- break;
- case T_STRINGS:
- pitem->name = dviprt_stringsname[pitem->no];
- break;
- case T_CODE:
- pitem->name = dviprt_prtcodename[pitem->no];
- break;
- }
- }
- pitem->spec_f = 0;
- }
- encode_info.spec_f = 0;
- { int i;
- for (i=0;i<CFG_PRTCODE_TYPE_COUNT;i++)
- prtcode_output_bytes[i] = 0;
- }
-
- pcfg->version = 1;
- for ( ; ; ) {
- uchar *pbuf = info.readbuf;
- uchar *pchar;
-
- if (fgets(info.readbuf,info.readbuf_size,ifp) == NULL) break;
- info.line_no++;
- {
- int len = strlen(pbuf);
- if ((pbuf[0] < 'a' || pbuf[0] > 'z') && pbuf[0] != '_') {
- while (pbuf[len-1] != '\n') {
- if (fgets(info.readbuf,info.readbuf_size,ifp) == NULL)
- goto end_scan;
- len = strlen(pbuf);
- }
- continue;
- }
- if ( len > 0 && pbuf[len-1] == '\n')
- pbuf[len-1] = 0;
- }
- while (*pbuf && *pbuf != ':') pbuf++;
- if (*pbuf != ':') {
- dviprt_printcfgerror(&info,"Character ':' is expected.\n",-1);
- code = CFG_ERROR_SYNTAX;
- goto end_process;
- }
- pchar = pbuf-1;
- while (pchar >= info.readbuf && isspace(*pchar)) pchar--;
- *++pchar = 0;
- pbuf++;
- for (pitem = dviprt_items;pitem->name;pitem++) {
- if (strcmp(pitem->name,info.readbuf) == 0) break;
- }
- if (pitem->name == NULL) {
- dviprt_printcfgerror(&info,"Unknown item `",-1);
- dviprt_printmessage(info.readbuf,-1);
- dviprt_printmessage("'.\n",-1);
- code = CFG_ERROR_RANGE;
- goto end_process;
- }
- parse_more:
- while (*pbuf && isspace(*pbuf)) pbuf++;
- if (pitem->spec_f) {
- dviprt_printcfgerror(&info,NULL,0);
- sprintf(dviprt_message_buffer,
- "Item `%s' is specified twice.\n",pitem->name);
- dviprt_printmessage(dviprt_message_buffer,-1);
- code = CFG_ERROR_SYNTAX;
- goto end_process;
- }
- switch (pitem->type) {
- case T_INTEGER:
- if ((code = dviprt_set_integer(pitem,pbuf,pcfg,&info)) < 0)
- goto end_process;
- if (pitem->no == CFG_PINS) {
- if (pcfg->integer[CFG_PINS] % 8) {
- dviprt_printcfgerror(&info,"Value must be a multiple of 8.\n",-1);
- code = CFG_ERROR_RANGE;
- goto end_process;
- }
- pcfg->integer[CFG_PINS] /= 8;
- }
- break;
- case T_STRINGS:
- if (info.temp_codebuf_f)
- info.pcodebuf = info.codebuf;
- if ((code = dviprt_set_strings(pitem,pbuf,pcfg,&info)) < 0)
- goto end_process;
- if (info.temp_codebuf_f) {
- pcfg->strings[pitem->no] =
- (uchar*)malloc(strlen(pcfg->strings[pitem->no])+1);
- if (pcfg->strings[pitem->no] == NULL) {
- goto no_more_memory;
- }
- strcpy(pcfg->strings[pitem->no],info.codebuf);
- }
- break;
- case T_CODE:
- if (info.temp_codebuf_f)
- info.pcodebuf = info.codebuf;
- if ((code = dviprt_set_code(pitem,pbuf,pcfg,&info)) < 0)
- goto end_process;
- prtcode_output_bytes[pitem->no] = code;
- if (info.temp_codebuf_f) {
- pcfg->prtcode[pitem->no] =
- (uchar*)malloc(pcfg->prtcode_size[pitem->no]+1);
- if (pcfg->prtcode[pitem->no] == NULL) {
- no_more_memory:
- dviprt_printcfgerror(&info,"Memory exhausted.\n",-1);
- code = CFG_ERROR_MEMORY;
- goto end_process;
- }
- memcpy(pcfg->prtcode[pitem->no],info.codebuf,
- pcfg->prtcode_size[pitem->no]+1);
- }
- break;
- case T_SELECT:
- if ((code = dviprt_set_select(pitem,&pbuf,pcfg,&info)) < 0)
- goto end_process;
- if (pitem->no == CFG_ENCODE) {
- pitem = &encode_info;
- goto parse_more;
- }
- break;
- case T_UPPERPOS:
- { uchar *ptmp;
- uchar upos=0;
- uchar opt = 0;
- if (*pbuf == 0) {
- dviprt_printcfgerror(&info,"No value.\n",-1);
- code = CFG_ERROR_SYNTAX;
- goto end_process;
- }
- while (*pbuf) {
- ptmp = pbuf;
- while (*ptmp && !isspace(*ptmp)) ptmp++;
- if (strlcmp("HIGH_BIT",pbuf,ptmp-pbuf) == 0)
- upos = CFG_TOP_IS_HIGH;
- else if (strlcmp("LOW_BIT",pbuf,ptmp-pbuf) == 0)
- upos = CFG_TOP_IS_LOW;
- else if (strlcmp("LEFT_IS_HIGH",pbuf,ptmp-pbuf) == 0)
- upos = CFG_LEFT_IS_HIGH;
- else if (strlcmp("LEFT_IS_LOW",pbuf,ptmp-pbuf) == 0)
- upos = CFG_LEFT_IS_LOW;
- else if (strlcmp("NON_MOVING",pbuf,ptmp-pbuf) == 0)
- opt = CFG_NON_MOVING;
- else if (strlcmp("HEX_MODE",pbuf,ptmp-pbuf) == 0)
- enc = CFG_ENCODE_HEX;
- else {
- dviprt_printtokenerror(&info,pbuf,(int)(ptmp-pbuf),ERROR_UNKNOWN_VALUE);
- code = CFG_ERROR_RANGE;
- goto end_process;
- }
- pbuf = ptmp;
- while (*pbuf && isspace(*pbuf)) pbuf++;
- }
- pcfg->integer[CFG_UPPER_POS] = upos | opt;
- }
- break;
- }
- pitem->spec_f = 1;
- }
- end_scan:
-
- info.line_no = -1;
- code = 0;
- for (pitem = dviprt_items;pitem->name;pitem++) {
- if (!pitem->spec_f && pitem->req_f) {
- sprintf(dviprt_message_buffer,"%s not found.\n",pitem->name);
- dviprt_printcfgerror(&info,dviprt_message_buffer,-1);
- code++;
- }
- }
- if (code) { code = CFG_ERROR_RANGE; goto end_process; }
-
- if (pcfg->prtcode[CFG_LINE_FEED] == NULL) {
- if (info.temp_codebuf_f) {
- pcfg->prtcode[CFG_LINE_FEED] = info.pcodebuf;
- info.pcodebuf += 4;
- }
- else pcfg->prtcode[CFG_LINE_FEED] = (byte*)malloc(4);
- memcpy(pcfg->prtcode[CFG_LINE_FEED],"\002\x0d\x0a\000",4);
- pcfg->prtcode_size[CFG_LINE_FEED] = 3;
- }
- if (pcfg->prtcode[CFG_FORM_FEED] == NULL) {
- if (info.temp_codebuf_f) {
- pcfg->prtcode[CFG_FORM_FEED] = info.pcodebuf;
- info.pcodebuf += 4;
- }
- else pcfg->prtcode[CFG_FORM_FEED] = (byte*)malloc(4);
- memcpy(pcfg->prtcode[CFG_FORM_FEED],"\002\x0d\x0c\000",4);
- pcfg->prtcode_size[CFG_FORM_FEED] = 3;
- }
- if (pcfg->integer[CFG_DPI] < 0 && pcfg->integer[CFG_Y_DPI] < 0) {
- pcfg->integer[CFG_DPI] = 180;
- }
- else if (pcfg->integer[CFG_DPI] < 0 || pcfg->integer[CFG_Y_DPI] < 0) {
- if (pcfg->integer[CFG_DPI] < 0)
- pcfg->integer[CFG_DPI] = pcfg->integer[CFG_Y_DPI];
- pcfg->integer[CFG_Y_DPI] = -1;
- }
- else if (pcfg->integer[CFG_DPI] == pcfg->integer[CFG_Y_DPI]) {
- pcfg->integer[CFG_Y_DPI] = -1;
- }
- else if (pcfg->integer[CFG_Y_DPI] >= 0) { /* has y_dpi. */
- set_version(pcfg,2);
- }
- if (pcfg->integer[CFG_ENCODE] < 0) {
- pcfg->integer[CFG_ENCODE] = enc;
- }
- if (pcfg->integer[CFG_MAXIMAL_UNIT] < 0) {
- pcfg->integer[CFG_MAXIMAL_UNIT] = 0x7fff;
- }
- if (pcfg->integer[CFG_MINIMAL_UNIT] < 0) {
- uint v;
- v = (MAX(prtcode_output_bytes[CFG_SEND_BIT_IMAGE],0) +
- MAX(prtcode_output_bytes[CFG_AFTER_BIT_IMAGE],0) +
- MAX(prtcode_output_bytes[CFG_SKIP_SPACES],0))
- / (pcfg->integer[CFG_PINS]*8) +
- MAX(prtcode_output_bytes[CFG_BIT_ROW_HEADER],0);
- if (v == 0) v = 1;
- pcfg->integer[CFG_MINIMAL_UNIT] = v;
- }
-
- for (pitem = dviprt_items;pitem->type>=0;pitem++) {
- if (pitem->spec_f == 0) {
- sprintf(dviprt_message_buffer,": %s:",pitem->name);
- switch (pitem->type) {
- case T_INTEGER:
- if (pcfg->integer[pitem->no] >= 0) {
- uint v = pcfg->integer[pitem->no];
- dviprt_printmessage(fname,-1);
- dviprt_printmessage(dviprt_message_buffer,-1);
- sprintf(dviprt_message_buffer," %d\n",v);
- dviprt_printmessage(dviprt_message_buffer,-1);
- }
- break;
- default: break; /* do nothing */
- }
- }
- }
-
- end_process:
- if (fname) fclose(ifp);
- dviprt_resetcfgbuffer_(&info);
-
- return code;
-}
-
-/*--- internal routines ---*/
-private int
-dviprt_set_integer(dviprt_cfg_item_t *pitem,uchar *buf,dviprt_cfg_t *pcfg,
- dviprt_cfg_i *pinfo)
-{
- uchar *pbuf = buf;
- long v = 0;
- long max = -1 ,min = -1;
-
- if (pitem->info != NULL) {
- dviprt_cfg_limit_t *plimit = (dviprt_cfg_limit_t *)pitem->info;
- min = plimit->min;
- max = plimit->max;
- }
- if (min < 0) min = 0;
- if (max < 0) max = 0xffff;
- if (*pbuf == 0) {
- dviprt_printcfgerror(pinfo,"No value.\n",-1);
- return CFG_ERROR_SYNTAX;
- }
- while (*pbuf) {
- if (!isdigit(*pbuf)) {
- if (isspace(*pbuf)) break;
- else goto invalid_val;
- }
- v = v*10 + *pbuf - '0';
- if (v > max) {
- out_of_range:
- dviprt_printtokenerror(pinfo,buf,strlen(buf),ERROR_OUTOFRANGE);
- dviprt_printcfgerror(pinfo,"",-1);
- sprintf(dviprt_message_buffer,
- "(%u <= value <= %u).\n",(uint)min,(uint)max);
- dviprt_printmessage(dviprt_message_buffer,-1);
- return CFG_ERROR_RANGE;
- }
- pbuf++;
- }
- if (v < min) goto out_of_range;
-
- while (*pbuf) {
- if (!isspace(*pbuf)) {
- invalid_val:
- dviprt_printtokenerror(pinfo,buf,strlen(buf),ERROR_INVALID_VALUE);
- return CFG_ERROR_RANGE;
- }
- pbuf++;
- }
- pcfg->integer[pitem->no] = v;
-
- return 0;
-}
-
-private int
-dviprt_set_strings(dviprt_cfg_item_t *pitem,uchar *buf,dviprt_cfg_t *pcfg,
- dviprt_cfg_i *pinfo)
-{
- uchar *pend;
- long len;
- pend = buf+strlen(buf)-1;
- while (pend >= buf && isspace(*pend)) pend--;
- pend++;
- len = pend - buf;
- if (len > 0x7fffL) {
- dviprt_printcfgerror(pinfo,"Too long strings.\n",-1);
- return CFG_ERROR_RANGE;
- }
-
- pcfg->strings[pitem->no] = pinfo->pcodebuf;
- strncpy(pinfo->pcodebuf,buf,(int)len);
- pinfo->pcodebuf[len] = 0;
- pinfo->pcodebuf += len;
- pinfo->pcodebuf++;
- return 0;
-}
-
-private int
-dviprt_set_select(dviprt_cfg_item_t *pitem,uchar **buf,dviprt_cfg_t *pcfg,
- dviprt_cfg_i *pinfo)
-{
- int i;
- uchar *ptmp = *buf;
- uchar *pstart = *buf;
- uchar **opt;
- if (*pstart == 0) {
- dviprt_printcfgerror(pinfo,"No value.\n",-1);
- return CFG_ERROR_SYNTAX;
- }
- while (*ptmp && !isspace(*ptmp)) ptmp++;
-
- for (i=0,opt=(uchar**)pitem->info;*opt;i++,opt++) {
- if (strlcmp(*opt,pstart,ptmp-pstart) == 0) {
- pcfg->integer[pitem->no] = i;
- *buf = ptmp;
- return 0;
- }
- }
- dviprt_printtokenerror(pinfo,pstart,(int)(ptmp-pstart),ERROR_UNKNOWN_VALUE);
- return CFG_ERROR_RANGE;
-}
-
-#define CFG_TOKEN_ERROR -1
-#define CFG_TOKEN_LIMIT_BIT 0x100
-#define CFG_TOKEN_FMT 0x200
-
-private int
-dviprt_get_codetype_token(dviprt_cfg_i *pinfo,uchar *pstart,uchar *pend,uchar *stopescseqchars,
- uchar *limitchars)
-{
- while (pstart < pend && isspace(*pstart)) pstart++;
- if (pstart >= pend) {
- pinfo->token = pinfo->endtoken = pstart;
- return CFG_TOKEN_LIMIT_BIT;
- }
- else if (strchr(limitchars,*pstart)) {
- pinfo->token = pstart;
- pinfo->endtoken = pstart+1;
- return CFG_TOKEN_LIMIT_BIT | *pstart;
- }
- else if (*pstart == '\\') {
- int c;
- long v;
- uchar *pexpr,*pnext;
-
- pexpr = pinfo->token = pstart++;
- while (pstart < pend && !isspace(*pstart) &&
- *pstart != '\\' && !strchr(stopescseqchars,*pstart)) {
- pstart++;
- }
- pinfo->endtoken = pstart;
- if (pinfo->token + 1 == pinfo->endtoken) { /* '\\' only */
- return '\\';
- }
- pexpr++;
- if (pinfo->endtoken - pexpr == 1) {
- if (isdigit(*pexpr)) goto parse_decimal_numb;
- switch (*pexpr) {
- case 't': c = '\t'; break; /* tab */
- case 'v': c = '\v'; break; /* tab */
- case 'n': c = '\n'; break; /* line feed */
- case 'f': c = '\f'; break; /* form feed */
- case 'r': c = '\r'; break; /* carrige return */
- case 'e': c = 0x1b; break; /* escape code */
- case 's': c = 0x20; break; /* space */
- default:
- dviprt_printtokenerror(pinfo,pinfo->token,2,ERROR_UNKNOWN_ESCSEQ);
- return CFG_TOKEN_ERROR;
- }
- return c;
- }
- else if (strlcmp("SP",pexpr,pinfo->endtoken - pexpr) == 0)
- return 0x20;
- else if (strlcmp("ESC",pexpr,pinfo->endtoken - pexpr) == 0)
- return 0x1b;
- switch (*pexpr) {
- case 'x':
- case 'X':
- v = dviprt_hex2long(pexpr+1,pinfo->endtoken,&pnext);
- check_numb_range:
- if (pstart != pnext) {
- dviprt_printtokenerror(pinfo,pinfo->token,
- (int)(pinfo->endtoken - pinfo->token), ERROR_INVALID_VALUE);
- return CFG_TOKEN_ERROR;
- }
- if (v >= 256) {
- dviprt_printtokenerror(pinfo,pinfo->token,
- (int)(pinfo->endtoken - pinfo->token), ERROR_OUTOFRANGE);
- return CFG_TOKEN_ERROR;
- }
- pinfo->endtoken = pnext;
- return v;
- case '0':
- v = dviprt_oct2long(pexpr,pinfo->endtoken,&pnext);
- goto check_numb_range;
- case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- parse_decimal_numb:
- v = dviprt_dec2long(pexpr,pinfo->endtoken,&pnext);
- goto check_numb_range;
- default:
- return CFG_TOKEN_FMT;
- }
- }
- else {
- pinfo->token = pstart;
- pinfo->endtoken = pstart+1;
- return *pstart;
- }
-}
-
-private long
-dviprt_dec2long(uchar *start,uchar *end,uchar **next)
-{
- long v = 0;
- while (start < end) {
- int c = *start;
- if (isdigit(c)) v = v*10 + c - '0';
- else break;
- start++;
- }
- *next = start;
- return v;
-}
-
-private long
-dviprt_oct2long(uchar *start,uchar *end,uchar **next)
-{
- long v = 0;
- while (start < end) {
- int c = *start;
- if (c >= '0' && c <= '7') v = v*8 + c - '0';
- else break;
- start++;
- }
- *next = start;
- return v;
-}
-
-private long
-dviprt_hex2long(uchar *start,uchar *end,uchar **next)
-{
- long v = 0;
- while (start < end) {
- int c = *start;
- if (isdigit(c)) v = v*16 + c - '0';
- else if (c >= 'A' && c <= 'F') v = v*16 + c - 'A' + 10;
- else if (c >= 'a' && c <= 'f') v = v*16 + c - 'a' + 10;
- else break;
- start++;
- }
- *next = start;
- return v;
-}
-
-private int
-dviprt_set_rpexpr(dviprt_cfg_item_t *pitem,uchar *pbuf,int len,dviprt_cfg_t *pcfg,
- dviprt_cfg_i *pinfo,int sp)
-{
- uchar *pend = pbuf + len;
- uchar *plastop = NULL;
- int code;
-
- /* get left expr */
- while (pbuf < pend) {
- int par_count = 0;
- uchar *pcur = pbuf;
- while (pcur < pend) {
- if (*pcur == '(') par_count++;
- else if (*pcur == ')') par_count--;
- else if (!isdigit(*pcur) && !isalpha(*pcur) && par_count == 0) {
- /* operator */
- plastop = pcur;
- }
- pcur++;
- }
- if (par_count != 0) {
- dviprt_printtokenerror(pinfo,pbuf,(int)(pend-pbuf),ERROR_INCOMPLETE);
- return CFG_ERROR_SYNTAX;
- }
- if (plastop == NULL) {
- if (*pbuf != '(') break;
- pbuf++;
- pend--;
- }
- else break;
- }
-
- if (plastop == NULL) { /* no operator */
- ulong v;
- uchar *pdummy;
- if (*pbuf == '0') {
- uchar a,b,c;
- v = dviprt_oct2long(pbuf,pend,&pdummy);
- check_intval:
- if (pdummy != pend) goto unknown_value;
- if (v > 0xffff) {
- dviprt_printtokenerror(pinfo,pbuf,(int)(pend-pbuf),ERROR_OUTOFRANGE);
- return CFG_ERROR_RANGE;
- }
- a = v & 0x7f;
- b = (v>>7) & 0x7f;
- c = (v>>14) & 0x03;
- if (c) {
- *pinfo->pcodebuf++ = c;
- *pinfo->pcodebuf++ = 14;
- *pinfo->pcodebuf++ = CFG_OP_SHL;
- }
- if (b) {
- *pinfo->pcodebuf++ = b;
- *pinfo->pcodebuf++ = 7;
- *pinfo->pcodebuf++ = CFG_OP_SHL;
- if (c) *pinfo->pcodebuf++ = CFG_OP_OR;
- }
- if (a) {
- *pinfo->pcodebuf++ = a;
- if (b || c) *pinfo->pcodebuf++ = CFG_OP_OR;
- }
- code = 0;
- }
- else if (isdigit(*pbuf)) {
- v = dviprt_dec2long(pbuf,pend,&pdummy);
- goto check_intval;
- }
- else if (pend - pbuf > 1 && (*pbuf == 'x' || *pbuf == 'X')) {
- v = dviprt_hex2long(pbuf+1,pend,&pdummy);
- goto check_intval;
- }
- else if (pend - pbuf > 1) {
- unknown_value:
- dviprt_printtokenerror(pinfo,pbuf,(int)(pend-pbuf),ERROR_UNKNOWN_VALUE);
- return CFG_ERROR_RANGE;
- }
- else {
- switch (*pbuf) {
- case 'd': v = CFG_VAL_DEFAULT;
- if (pitem->no != CFG_SEND_BIT_IMAGE &&
- pitem->no != CFG_BIT_ROW_HEADER &&
- pitem->no != CFG_AFTER_BIT_IMAGE &&
- pitem->no != CFG_SKIP_SPACES)
- goto unavailable_value;
- break;
- case 'c': v = CFG_VAL_CONSTANT; break;
- case 'w': v = CFG_VAL_WIDTH; break;
- case 'h': v = CFG_VAL_HEIGHT; break;
- case 'r': v = CFG_VAL_X_DPI; break;
- case 'R': v = CFG_VAL_Y_DPI; break;
- case 'p': v = CFG_VAL_PAGE; break;
- case 'x': v = CFG_VAL_X_POS; break;
- case 'y': v = CFG_VAL_Y_POS; break;
- case 'v': v = CFG_VAL_PINS_BYTE; break;
- case 's':
- v = CFG_VAL_DATASIZE;
- if (pitem->no != CFG_SEND_BIT_IMAGE &&
- pitem->no != CFG_BIT_ROW_HEADER &&
- pitem->no != CFG_AFTER_BIT_IMAGE) {
- unavailable_value:
- dviprt_printcfgerror(pinfo,"",-1);
- sprintf(dviprt_message_buffer,"Variable `%c' in ",(int)*pbuf);
- dviprt_printmessage(dviprt_message_buffer,-1);
- dviprt_printmessage(pbuf,(int)(pend-pbuf));
- sprintf(dviprt_message_buffer," cannot be used in %s.\n",pitem->name);
- dviprt_printmessage(dviprt_message_buffer,-1);
- return CFG_ERROR_RANGE;
- }
- break;
- default:
- goto unknown_value;
- }
- *pinfo->pcodebuf++ = v;
- code = 0;
- }
- }
- else { /* has operator */
- uchar op;
-
- code = dviprt_set_rpexpr(pitem,pbuf,(int)(plastop-pbuf),pcfg,pinfo,sp+1);
- if (code < 0) return code;
- code = dviprt_set_rpexpr(pitem,plastop+1,(int)(pend-plastop-1),pcfg,pinfo,sp+2);
- if (code < 0) return code;
-
- switch (*plastop) {
- case '+': op = CFG_OP_ADD; break;
- case '-': op = CFG_OP_SUB; break;
- case '*': op = CFG_OP_MUL; break;
- case '/': op = CFG_OP_DIV; break;
- case '%': op = CFG_OP_MOD; break;
- case '<': op = CFG_OP_SHL; break;
- case '>': op = CFG_OP_SHR; break;
- case '&': op = CFG_OP_AND; break;
- case '|': op = CFG_OP_OR ; break;
- case '^': op = CFG_OP_XOR; break;
- default:
- dviprt_printcfgerror(pinfo,NULL,0);
- sprintf(dviprt_message_buffer,"Unknown operator %c in ",(int)*pbuf);
- dviprt_printmessage(dviprt_message_buffer,-1);
- dviprt_printmessage(pbuf,(int)(pend-pbuf));
- dviprt_printmessage(".\n",-1);
- return CFG_ERROR_SYNTAX;
- }
- *pinfo->pcodebuf++ = op;
- }
-
- return code;
-}
-
-private int
-dviprt_set_code(dviprt_cfg_item_t *pitem,uchar *buf,dviprt_cfg_t *pcfg,
- dviprt_cfg_i *pinfo)
-{
- long prev_line;
- int prev_type = 1;
- uchar *pcount;
- uchar *pcode_begin;
- uchar *rbuf;
- int obytes = 0;
-
- prev_line = ftell(pinfo->file);
- pcode_begin = pinfo->pcodebuf;
- rbuf = pinfo->readbuf;
-
- for ( ; ; ) {
- while (*buf) {
- int c;
- c = dviprt_get_codetype_token(pinfo,buf,buf+strlen(buf),",","");
- if (c == CFG_TOKEN_LIMIT_BIT) break; /* no elements remain */
- else if (c == CFG_TOKEN_ERROR) return CFG_ERROR_SYNTAX;
- if ( c < 256) { /* character code (raw data) */
- if (prev_type) {
- new_unit:
- pcount = pinfo->pcodebuf++;
- (*pcount) = 0;
- prev_type = 0;
- }
- if (*pcount == 127) goto new_unit;
- (*pcount)++;
- *pinfo->pcodebuf++ = c;
- buf = pinfo->endtoken;
- obytes++;
- }
- else if (c == CFG_TOKEN_FMT) { /* format */
- uchar *pexpr = pinfo->token;
- int div=0,iso=0,mul=0,tl=0;
- int cols=0;
- int fmt;
- uchar *plength;
- uchar *pstart;
-
- buf = pinfo->token+1;
-
- /* formats */
- switch (*buf) {
- case 'b': fmt = CFG_FMT_BIN_LTOH; break;
- case 'B': fmt = CFG_FMT_BIN_HTOL; break;
- case 'H': fmt = CFG_FMT_HEX_UPPER; break;
- case 'h': fmt = CFG_FMT_HEX_LOWER; break;
- case 'd': fmt = CFG_FMT_DECIMAL; break;
- case 'o': fmt = CFG_FMT_OCTAL; break;
- case 's':
- buf++;
- if (*buf != 't') goto unknown_format;
- fmt = CFG_FMT_STRINGS;
- break;
- default:
- unknown_format:
- dviprt_printtokenerror(pinfo,pexpr,(int)(pinfo->endtoken-pexpr),
- ERROR_UNKNOWN_FORMAT);
- return CFG_ERROR_SYNTAX;
- }
- buf++;
-
- /* columns */
- if (fmt == CFG_FMT_STRINGS) ;
- else {
- if (buf >= pinfo->endtoken) {
- dviprt_printtokenerror(pinfo,pexpr,(int)(pinfo->token-pexpr),ERROR_INCOMPLETE);
- return CFG_ERROR_SYNTAX;
- }
-
- if (!(*buf >= '1' && *buf <= '7') && *buf != '?') {
- invalid_cols:
- dviprt_printtokenerror(pinfo,pexpr,(int)(pinfo->endtoken-pexpr),
- ERROR_UNKNOWN_FORMAT);
- return CFG_ERROR_SYNTAX;
- }
- cols = (*buf == '?') ? 0 : *buf - '0';
- if (cols == 0 &&
- (fmt == CFG_FMT_BIN_LTOH || fmt == CFG_FMT_BIN_HTOL))
- goto invalid_cols;
-
- buf++;
- obytes += (cols == 0) ? 5 : cols;
- }
-
- /* additional format */
- while (buf < pinfo->endtoken) {
- switch (*buf) {
- case 'D': div++; break;
- case 'I': iso++; break;
- case 'M': mul++; break;
- case 'T': tl++; break;
- default:
- dviprt_printtokenerror(pinfo,pexpr,(int)(buf-pexpr),ERROR_UNKNOWN_FORMAT);
- return CFG_ERROR_SYNTAX;
- }
- if (div > 3 || iso > 1 || mul > 1 || tl > 1) {
- dviprt_printtokenerror(pinfo,pexpr,(int)(buf-pexpr),ERROR_UNKNOWN_FORMAT);
- return CFG_ERROR_SYNTAX;
- }
- buf++;
- }
- *pinfo->pcodebuf++ =
- CFG_FMT_BIT | fmt | (iso ? CFG_FMT_ISO_BIT : 0) | cols;
- plength = pinfo->pcodebuf;
- pinfo->pcodebuf++;
- pstart = pinfo->pcodebuf;
-
- if (*buf == ',' && *(buf+1) != '\"') {
- int code;
- buf++;
- pinfo->token = buf;
- while (*pinfo->token && *pinfo->token != ',' &&
- *pinfo->token != '\\' && !isspace(*pinfo->token))
- pinfo->token++;
- if (pinfo->token == buf) {
- dviprt_printcfgerror(pinfo,"No expression is specified in ",-1);
- dviprt_printmessage(pexpr,(int)(buf-pexpr));
- dviprt_printmessage(".\n",-1);
- return CFG_ERROR_SYNTAX;
- }
- if ((code = dviprt_set_rpexpr(pitem,buf,(int)(pinfo->token-buf),pcfg,pinfo,0)) < 0)
- return code;
- buf = pinfo->token;
- }
- else {
- *pinfo->pcodebuf++ = CFG_VAL_DEFAULT;
- }
- if (mul) {
- *pinfo->pcodebuf++ = CFG_VAL_CONSTANT;
- *pinfo->pcodebuf++ = CFG_OP_MUL;
- }
- if (tl) {
- *pinfo->pcodebuf++ = CFG_VAL_PINS_BYTE;
- *pinfo->pcodebuf++ = CFG_OP_MUL;
- }
- if (div) {
- *pinfo->pcodebuf++ = div;
- *pinfo->pcodebuf++ = CFG_OP_SHR;
- }
- {
- int length = pinfo->pcodebuf-pstart;
- if (length > 255) {
- dviprt_printtokenerror(pinfo,pexpr,(int)(buf-pexpr),ERROR_COMPLICATED_EXPR);
- return CFG_ERROR_RANGE;
- }
- *plength++ = length & 0xff;
- }
- if (fmt == CFG_FMT_STRINGS) {
- uchar *pslen = pinfo->pcodebuf++;
- int len;
- if (strlen(buf) < 2 || *buf != ',' || *(buf+1) != '\"') {
- dviprt_printcfgerror(pinfo,"No strings specified in ",-1);
- dviprt_printmessage(pexpr,(int)(buf-pexpr));
- dviprt_printmessage(".\n",-1);
- return CFG_ERROR_SYNTAX;
- }
- buf += 2;
- for (len=0; ;len++) {
- c = dviprt_get_codetype_token(pinfo,buf,buf+strlen(buf),"\"","\"");
- if (c == CFG_TOKEN_ERROR) return CFG_ERROR_SYNTAX;
- else if (c == CFG_TOKEN_FMT) {
- dviprt_printcfgerror(pinfo,"The format ",-1);
- dviprt_printmessage(pinfo->token,
- (int)(pinfo->endtoken-pinfo->token));
- dviprt_printmessage(" cannot to be specified here.\n",-1);
- return CFG_ERROR_SYNTAX;
- }
- else if (c & CFG_TOKEN_LIMIT_BIT) {
- if ((c & 0xff) != '\"') {
- dviprt_printcfgerror(pinfo,
- "Strings must be enclosed with "
- "double quotations (\").\n",-1);
- return CFG_ERROR_SYNTAX;
- }
- buf = pinfo->endtoken;
- break;
- }
- *pinfo->pcodebuf++ = c;
- buf = pinfo->endtoken;
- }
- if (len > 255) {
- dviprt_printcfgerror(pinfo,"Too long strings.\n",-1);
- return CFG_ERROR_RANGE;
- }
- *pslen = len;
- }
- prev_type = 1;
- }
- else {
- dviprt_printcfgerror(pinfo,"Parse error. Unexpected token ",-1);
- dviprt_printmessage(pinfo->token,(int)(pinfo->endtoken-pinfo->token));
- dviprt_printmessage(".\n",-1);
- return CFG_ERROR_SYNTAX;
- }
- }
- next_line:
- if (fgets(rbuf,pinfo->readbuf_size,pinfo->file) == NULL) break;
- if (!isspace(rbuf[0]) && rbuf[0] != ';') {
- fseek(pinfo->file,prev_line,0);
- break;
- }
- prev_line = ftell(pinfo->file);
- pinfo->line_no++;
- buf = rbuf;
- while (*buf && isspace(*buf)) buf++;
- if (*buf == ';')
- goto next_line; /* comment */
- {
- int len = strlen(rbuf);
- if (len > 0 && rbuf[len-1] == '\n')
- rbuf[len-1] = 0;
- }
- }
- pcfg->prtcode[pitem->no] = pcode_begin;
- pcfg->prtcode_size[pitem->no] = (pinfo->pcodebuf - pcode_begin) & 0xffff;
- *pinfo->pcodebuf++ = 0;
- return obytes;
-}
-
-private char *
-dviprt_src_errorno2message(int type)
-{
- switch (type) {
- case ERROR_OUTOFRANGE:
- return "Out of range.\n";
- case ERROR_UNKNOWN_VALUE:
- return "Unknown value.\n";
- case ERROR_UNKNOWN_ESCSEQ:
- return "Unknown escape sequence.\n";
- case ERROR_COMPLICATED_EXPR:
- return "Too complicated expression.\n";
- case ERROR_INCOMPLETE:
- return "Incomplete specification.\n";
- case ERROR_UNKNOWN_FORMAT:
- return "Unknown format.\n";
- case ERROR_INVALID_VALUE:
- return "Invalid value.\n";
- default:
- return NULL;
- }
-}
-
-private int
-dviprt_printtokenerror(dviprt_cfg_i *pinfo,char *token,int len,int type)
-{
- char *msg;
-
- dviprt_printcfgerror(pinfo,token,len);
- dviprt_printmessage("\n",-1);
-
- if ((msg = dviprt_src_errorno2message(type)) != NULL)
- dviprt_printcfgerror(pinfo,msg,-1);
- return 0;
-}
-
-#undef strlcmp
-#undef set_version
-/***** End of rsrc.c *****/
-
-
-/***** From util.c *****/
-/* $Id: UTIL.C 1.1 1994/08/30 02:27:02 kaz Exp kaz $ */
-
-
-char *dviprt_integername[] = { CFG_INTEGER_NAME, NULL };
-char *dviprt_stringsname[] = { CFG_STRINGS_NAME, NULL };
-char *dviprt_prtcodename[] = { CFG_PRTCODE_NAME, NULL };
-char *dviprt_encodename[] = { CFG_ENCODE_NAME, NULL };
-
-#if 0
-private FILE *dviprt_messagestream = stderr;
-#else /* patch for glibc 2.1.x by Shin Fukui <shita@april.co.jp> */
-private FILE *dviprt_messagestream;
-#endif
-
-/*--- library functions ---*/
-int
-dviprt_setmessagestream(FILE *fp)
-{
- dviprt_messagestream = fp;
- return 0;
-}
-
-/*--- internal routines ---*/
-liblocal int
-dviprt_initcfg_(dviprt_cfg_t *pcfg,dviprt_cfg_i *pinfo)
-{
- int i;
-
- for (i=0;i<CFG_INTEGER_TYPE_COUNT;i++)
- pcfg->integer[i] = -1;
- for (i=0;i<CFG_STRINGS_TYPE_COUNT;i++)
- pcfg->strings[i] = NULL;
- for (i=0;i<CFG_PRTCODE_TYPE_COUNT;i++) {
- pcfg->prtcode[i] = NULL;
- pcfg->prtcode_size[i] = 0;
- }
- pinfo->pcodebuf = pinfo->codebuf;
- pinfo->line_no = 0;
- return 0;
-}
-
-liblocal int
-dviprt_setcfgbuffer_(dviprt_cfg_i *pinfo,int rsize,int csize)
-{
- pinfo->temp_readbuf_f = pinfo->temp_codebuf_f = 0;
-
- if (pinfo->readbuf == NULL) {
- pinfo->readbuf_size = rsize;
- if (rsize>0) {
- pinfo->temp_readbuf_f = 1;
- pinfo->readbuf = (uchar *)malloc(rsize);
- if (pinfo->readbuf == NULL) {
- no_mem:
- dviprt_printmessage(pinfo->fname,-1);
- dviprt_printmessage("Memory exhausted.\n",-1);
- return CFG_ERROR_MEMORY;
- }
- }
- }
- if (pinfo->codebuf == NULL) {
- pinfo->codebuf_size = csize;
- if (csize>0) {
- pinfo->temp_codebuf_f = 1;
- pinfo->codebuf = (uchar *)malloc(csize);
- if (pinfo->codebuf == NULL) goto no_mem;
- }
- }
- return 0;
-}
-
-liblocal int
-dviprt_resetcfgbuffer_(dviprt_cfg_i *pinfo)
-{
- if (pinfo->temp_readbuf_f) free(pinfo->readbuf);
- if (pinfo->temp_codebuf_f) free(pinfo->codebuf);
- pinfo->temp_codebuf_f = pinfo->temp_readbuf_f = 0;
- return 0;
-}
-
-char dviprt_message_buffer[128];
-
-liblocal int
-dviprt_printmessage(char *str,int len)
-{
- if (dviprt_messagestream && str) {
- if (len >= 0) fwrite(str,len,1,dviprt_messagestream);
- else fputs(str,dviprt_messagestream);
- fflush(dviprt_messagestream);
- }
- return 0;
-}
-
-private int
-dviprt_printcfgerrorheader(dviprt_cfg_i *pinfo)
-{
- if (pinfo) {
- char *fn = pinfo->fname;
- if (fn == NULL) fn = "-";
- dviprt_printmessage(fn,-1);
- dviprt_printmessage(": ",-1);
- if (pinfo->line_no>0) {
- sprintf(dviprt_message_buffer,"%d: ",pinfo->line_no);
- dviprt_printmessage(dviprt_message_buffer,-1);
- }
- }
- return 0;
-}
-
-liblocal int
-dviprt_printerror(char *msg,int len)
-{
- dviprt_printmessage("*ERROR* ",-1);
- dviprt_printmessage(msg,len);
- return 0;
-}
-
-liblocal int
-dviprt_printcfgerror(dviprt_cfg_i *pinfo,char *msg,int len)
-{
- dviprt_printcfgerrorheader(pinfo);
- dviprt_printerror(msg,len);
- return 0;
-}
-
-liblocal int
-dviprt_printwarning(char *msg,int len)
-{
- dviprt_printmessage("*WARNING* ",-1);
- dviprt_printmessage(msg,len);
- return 0;
-}
-
-liblocal int
-dviprt_printcfgwarning(dviprt_cfg_i *pinfo,char *msg,int len)
-{
- dviprt_printcfgerrorheader(pinfo);
- dviprt_printwarning(msg,len);
- return 0;
-}
-/***** End of util.c *****/
-
-
-/***** From print.c *****/
-/* $Id: PRINT.C 1.1 1994/08/30 02:27:02 kaz Exp kaz $ */
-
-
-/*--- forward declarations ---*/
-private int dviprt_getmaximalwidth(dviprt_print *);
-private int dviprt_flush_buffer(dviprt_print *,uchar far *);
-private int dviprt_output_transpose(dviprt_print *,uchar far *,uint);
-private int dviprt_output_nontranspose(dviprt_print *,uchar far *,uint);
-private int dviprt_output_nontranspose_reverse(dviprt_print *,uchar far *,uint);
-private int dviprt_reverse_bits(uchar far *,uint);
-private int dviprt_transpose8x8(uchar far *,uint, uchar far *,uint);
-private int dviprt_output_expr(dviprt_print *,int,uint,uint);
-private int dviprt_default_outputproc(uchar far *,long ,void *);
-private long dviprt_getbuffersize(dviprt_print *);
-
-/*--- library functions ---*/
-long
-dviprt_initlibrary(dviprt_print *pprint,dviprt_cfg_t *pprt,uint width,uint height)
-{
- dviprt_encoder *pencode;
- uint pins = pprt->integer[CFG_PINS]*8;
-
- pprint->printer = pprt;
- height += (pins-1);
- height /= pins;
- height *= pins;
- pprint->bitmap_width = width; /* width by bytes */
- pprint->bitmap_height = height;
- pprint->buffer_width = MIN(width,pprt->integer[CFG_MAXIMAL_UNIT]);
- pprint->page_count = 0;
- pprint->output_bytes = 0;
- pprint->tempbuffer_f = 0;
- pencode = dviprt_getencoder_((int)pprt->integer[CFG_ENCODE]);
- if (pencode == NULL) return CFG_ERROR_NOT_SUPPORTED;
- pprint->encode_getbuffersize_proc = pencode->getworksize;
- pprint->encode_encode_proc = pencode->encode;
-
- pprint->output_bytes = 0;
- pprint->pstream = NULL;
- pprint->output_proc = NULL;
-
- if (pprt->integer[CFG_UPPER_POS] & CFG_NON_TRANSPOSE_BIT) {
- pprint->output_maximal_unit =
- (pprt->integer[CFG_UPPER_POS] & CFG_REVERSE_BIT) ?
- dviprt_output_nontranspose_reverse : dviprt_output_nontranspose;
- }
- else
- pprint->output_maximal_unit = dviprt_output_transpose;
- return dviprt_getbuffersize(pprint);
-}
-
-int
- dviprt_setstream
-#ifdef __PROTOTYPES__
- (dviprt_print *pprint,int (*func)(uchar far *,long ,void*),void *pstream)
-#else
-(pprint,func,pstream)
-dviprt_print *pprint;
-int (*func)();
-void *pstream;
-#endif
-{
- if (pprint->page_count) {
- int code = dviprt_output_expr(pprint,CFG_FORM_FEED,0,0);
- if (code < 0) return code;
- pprint->page_count = 0;
- }
- pprint->output_bytes = 0;
- pprint->pstream = pstream;
- pprint->output_proc = (func == NULL) ? dviprt_default_outputproc : func;
- return 0;
-}
-
-int
-dviprt_setbuffer(dviprt_print *pprint,uchar far *buf)
-{
- if (pprint->tempbuffer_f) {
- BufferFree(pprint->encode_buffer);
- }
- pprint->tempbuffer_f = 0;
- if (buf == NULL) {
- long s = dviprt_getbuffersize(pprint);
- if (s) {
- buf = (uchar far *)BufferAlloc(s);
- if (buf == NULL) return CFG_ERROR_MEMORY;
- pprint->tempbuffer_f = 1;
- }
- }
- pprint->encode_buffer = buf;
- pprint->source_buffer =
- buf + pprint->encode_getbuffersize_proc(pprint,dviprt_getmaximalwidth(pprint));
- return 0;
-}
-
-int
-dviprt_beginpage(dviprt_print *pprint)
-{
- int code;
- pprint->device_x = pprint->device_y = 0;
- pprint->bitmap_x = pprint->bitmap_y = 0;
- if (pprint->page_count == 0) { /* bit_image_mode */
- code = dviprt_output_expr(pprint,CFG_BIT_IMAGE_MODE,0,0);
- }
- else { /* form_feed */
- code = dviprt_output_expr(pprint,CFG_FORM_FEED,0,0);
- }
- pprint->page_count++;
- if (code < 0) return code;
- return 0;
-}
-
-int
-dviprt_outputscanlines(dviprt_print *pprint,uchar far *fb)
-{
- dviprt_cfg_t *pprt;
- int code;
- uint bw;
-
- pprt = pprint->printer;
- bw = pprint->bitmap_width;
-
- if (pprt->prtcode_size[CFG_SKIP_SPACES] <= 0) {
- pprint->bitmap_x = bw;
- pprint->last_x = 0;
- }
- else {
- uint uw,rw;
- uint mu;
- uint bx,lx;
- uint pins = dviprt_getscanlines(pprint);
- mu = pprt->integer[CFG_MINIMAL_UNIT];
- bx = lx = 0;
-
- for (rw= bw; rw > 0 ;rw -= uw) {
- uint x,y;
- uchar far *in;
-
- uw = MIN(mu,rw);
- in = fb + bx;
- for (x = uw; x>0 ; x--) {
- uchar far *test;
- test = in;
- for (y = pins ; y > 0 ;y--) {
- if (*test) goto next_unit;
- test += bw;
- }
- in++;
- }
-
- if (bx > lx) {
- pprint->bitmap_x = bx;
- pprint->last_x = lx;
- code = dviprt_flush_buffer(pprint,fb); /* output buffered unit */
- if (code < 0) return code;
- lx = pprint->last_x + uw;
- }
- else lx += uw;
-
- next_unit:
- bx += uw;
- }
- pprint->bitmap_x = bx;
- pprint->last_x = lx;
- }
- code = (pprint->last_x < pprint->bitmap_x) ? dviprt_flush_buffer(pprint,fb) : 0;
- pprint->bitmap_y++;
- return code;
-}
-
-int
-dviprt_endbitmap(dviprt_print *pprint)
-{
- if (pprint->page_count) {
- int code = dviprt_output_expr(pprint,CFG_NORMAL_MODE,0,0);
- if (code < 0) return code;
- }
- return 0;
-}
-
-int
-dviprt_unsetbuffer(dviprt_print *pprint)
-{
- if (pprint->tempbuffer_f) {
- BufferFree(pprint->encode_buffer);
- pprint->tempbuffer_f = 0;
- }
- return 0;
-}
-
-int
-dviprt_output(dviprt_print *pprint,uchar far *buf,long s)
-{
- int c = pprint->output_proc(buf,s,pprint->pstream);
- pprint->output_bytes += s;
- return c;
-}
-
-/*--- internal routines ---*/
-private int
-dviprt_getmaximalwidth(dviprt_print *pprint)
-{
- return MIN(pprint->printer->integer[CFG_MAXIMAL_UNIT],pprint->bitmap_width);
-}
-
-private long
-dviprt_getbuffersize(dviprt_print *pprint)
-{
- long w = dviprt_getmaximalwidth(pprint);
- long e = pprint->encode_getbuffersize_proc(pprint,w);
- switch (pprint->printer->integer[CFG_UPPER_POS]
- & (CFG_NON_TRANSPOSE_BIT | CFG_REVERSE_BIT)) {
- case CFG_LEFT_IS_HIGH:
- return e;
- default:
- return w * dviprt_getscanlines(pprint) + e;
- }
-}
-
-private int
-dviprt_flush_buffer(dviprt_print *pprint,uchar far *fb)
-{
- dviprt_cfg_t *pprt;
- int code;
-
- pprt = pprint->printer;
- while (pprint->device_y < pprint->bitmap_y) { /* skip vertical spaces */
- pprint->device_y++;
- code = dviprt_output_expr(pprint,CFG_LINE_FEED,0,0);
- pprint->device_x = 0;
- }
- while (pprint->last_x < pprint->bitmap_x) {
- int w;
- while (pprint->device_x < pprint->last_x) { /* skip horizontal spaces */
- w = MIN(pprt->integer[CFG_MAXIMAL_UNIT],
- pprint->last_x - pprint->device_x);
- code = dviprt_output_expr(pprint,CFG_SKIP_SPACES,w,0);
- pprint->device_x += w;
- }
- w = MIN(pprt->integer[CFG_MAXIMAL_UNIT],pprint->bitmap_x-pprint->last_x);
- code = pprint->output_maximal_unit(pprint,fb+pprint->last_x,w);
- if (code < 0) return code;
- pprint->last_x += w;
- if (!(pprt->integer[CFG_UPPER_POS] & CFG_NON_MOVING))
- pprint->device_x += w;
- }
- return 0;
-}
-
-private int
-dviprt_output_nontranspose(dviprt_print *pprint,uchar far *fb,uint width)
-{
- int code;
- uint dsize;
- uint y;
- uint pins;
-
- pins = dviprt_getscanlines(pprint);
-
- dsize = 0;
- pprint->psource = fb;
- for (y = pins ; y>0 ; y--) {
- int dsize_line;
- dsize_line = pprint->encode_encode_proc(pprint,(long)width,0);
- if (dsize_line < 0) return dsize_line;
- dsize += dsize_line;
- pprint->psource += pprint->bitmap_width;
- }
-
- code = dviprt_output_expr(pprint,CFG_SEND_BIT_IMAGE,width,dsize);
- if (code < 0) return code;
-
- pprint->psource = fb;
- for (y = pins ; y>0 ; y--) {
- int dsize_line;
- dsize_line = pprint->encode_encode_proc(pprint,(long)width,1);
- code = dviprt_output_expr(pprint,CFG_BIT_ROW_HEADER,width,dsize_line);
- if (code < 0) return code;
- code = dviprt_output(pprint,pprint->poutput,dsize_line);
- if (code < 0) return code;
- pprint->psource += pprint->bitmap_width;
- }
-
- code = dviprt_output_expr(pprint,CFG_AFTER_BIT_IMAGE,width,dsize);
- if (code < 0) return code;
-
- return 0;
-}
-
-
-private int
-dviprt_output_nontranspose_reverse(dviprt_print *pprint,uchar far *fb,uint width)
-{
- uchar far *psrc;
- uchar far *pbuf;
- int code;
- uint src_size;
- uint dsize;
- uint y;
- uint pins;
-
- pins = dviprt_getscanlines(pprint);
- src_size = width * pins;
-
- psrc = pprint->source_buffer;
- for (y = pins ; y > 0; y--) {
- uint i;
- pbuf = fb;
- for (i=width;i>0;i--) *psrc++ = *pbuf++;
- fb += pprint->bitmap_width;
- }
-
- /* here, reverse bits */
- psrc = pprint->source_buffer;
- dviprt_reverse_bits(psrc,src_size);
-
-
- dsize = 0;
- pprint->psource = pprint->source_buffer;
- for (y = pins ; y>0 ; y--) {
- int dsize_line;
- dsize_line = pprint->encode_encode_proc(pprint,(long)width,0);
- if (dsize_line < 0) return dsize_line;
- dsize += dsize_line;
- pprint->psource += width;
- }
-
- code = dviprt_output_expr(pprint,CFG_SEND_BIT_IMAGE,width,dsize);
- if (code < 0) return code;
-
- pprint->psource = pprint->source_buffer;
- for (y = pins ; y>0 ; y--) {
- int dsize_line;
- dsize_line = pprint->encode_encode_proc(pprint,(long)width,1);
- code = dviprt_output_expr(pprint,CFG_BIT_ROW_HEADER,width,dsize_line);
- if (code < 0) return code;
- code = dviprt_output(pprint,pprint->poutput,dsize_line);
- if (code < 0) return code;
- pprint->psource += width;
- }
-
- code = dviprt_output_expr(pprint,CFG_AFTER_BIT_IMAGE,width,dsize);
- if (code < 0) return code;
-
- return 0;
-}
-
-private int
-dviprt_output_transpose(dviprt_print *pprint,uchar far *fb,uint width)
-{
- uchar far *psrc;
- uchar far *pbuf;
- int code;
- uint src_size;
- uint dsize;
- uint pins,pins8;
- int y;
-
- pins8 = pprint->printer->integer[CFG_PINS];
- pins = pins8 * 8;
- src_size = width * pins;
- psrc = pprint->source_buffer;
- {
- uchar far *pdst;
- uint sskip;
- sskip = pprint->bitmap_width * 8;
- for (y = pins8-1; y >= 0 ; y--) {
- uint i;
- pbuf = fb;
- pdst = psrc;
- for (i=width;i>0;i--) {
- dviprt_transpose8x8(pbuf,pprint->bitmap_width,pdst,pins8);
- pbuf ++;
- pdst += pins;
- }
- fb += sskip;
- psrc++;
- }
- }
-
- psrc = pprint->source_buffer;
-
- /* here, reverse bits */
- if (pprint->printer->integer[CFG_UPPER_POS] & CFG_REVERSE_BIT)
- dviprt_reverse_bits(psrc,src_size);
-
- dsize = 0;
- pprint->psource = pprint->source_buffer;
- for (y = pins ; y>0 ; y--) {
- int dsize_line;
- dsize_line = pprint->encode_encode_proc(pprint,(long)width,0);
- if (dsize_line < 0) return dsize_line;
- dsize += dsize_line;
- pprint->psource += width;
- }
-
- code = dviprt_output_expr(pprint,CFG_SEND_BIT_IMAGE,width,dsize);
- if (code < 0) return code;
-
- pprint->psource = pprint->source_buffer;
- for (y = pins ; y>0 ; y--) {
- uint dsize_line;
- dsize_line = pprint->encode_encode_proc(pprint,(long)width,1);
- code = dviprt_output(pprint,pprint->poutput,dsize_line);
- if (code < 0) return code;
- pprint->psource += width;
- }
-
- code = dviprt_output_expr(pprint,CFG_AFTER_BIT_IMAGE,width,dsize);
- if (code < 0) return code;
-
- return 0;
-}
-
-private int
-dviprt_transpose8x8(uchar far *inp,uint line_size,uchar far *outp,uint dist)
-{
- register uint ae, bf, cg, dh;
- {
- uchar far *ptr4 = inp + (line_size << 2);
- ae = ((uint)*inp << 8) + *ptr4;
- inp += line_size, ptr4 += line_size;
- bf = ((uint)*inp << 8) + *ptr4;
- inp += line_size, ptr4 += line_size;
- cg = ((uint)*inp << 8) + *ptr4;
- inp += line_size, ptr4 += line_size;
- dh = ((uint)*inp << 8) + *ptr4;
- }
- /* Check for all 8 bytes being the same. */
- /* This is especially worth doing for the case where all are zero. */
- if ( ae == bf && ae == cg && ae == dh && (ae >> 8) == (ae & 0xff) ) {
- if ( ae == 0 ) goto store;
- *outp = -((ae >> 7) & 1);
- outp += dist;
- *outp = -((ae >> 6) & 1);
- outp += dist;
- *outp = -((ae >> 5) & 1);
- outp += dist;
- *outp = -((ae >> 4) & 1);
- outp += dist;
- *outp = -((ae >> 3) & 1);
- outp += dist;
- *outp = -((ae >> 2) & 1);
- outp += dist;
- *outp = -((ae >> 1) & 1);
- outp += dist;
- *outp = -(ae & 1);
- }
- else {
- register uint temp;
-
- /* Transpose a block of bits between registers. */
-#define transpose(r,s,mask,shift)\
- r ^= (temp = ((s >> shift) ^ r) & mask);\
- s ^= temp << shift
-
- /* Transpose blocks of 4 x 4 */
-#define transpose4(r) transpose(r,r,0x00f0,4)
- transpose4(ae);
- transpose4(bf);
- transpose4(cg);
- transpose4(dh);
-
- /* Transpose blocks of 2 x 2 */
- transpose(ae, cg, 0x3333, 2);
- transpose(bf, dh, 0x3333, 2);
-
- /* Transpose blocks of 1 x 1 */
- transpose(ae, bf, 0x5555, 1);
- transpose(cg, dh, 0x5555, 1);
-
- store: *outp = ae >> 8;
- outp += dist;
- *outp = bf >> 8;
- outp += dist;
- *outp = cg >> 8;
- outp += dist;
- *outp = dh >> 8;
- outp += dist;
- *outp = (uchar)ae;
- outp += dist;
- *outp = (uchar)bf;
- outp += dist;
- *outp = (uchar)cg;
- outp += dist;
- *outp = (uchar)dh;
- }
- return 0;
-}
-
-private int
-dviprt_reverse_bits(uchar far *buf,uint s)
-{
- static uchar rev[256] = {
- 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
- 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
- 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
- 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
- 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
- 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
- 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
- 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
- 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
- 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
- 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
- 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
- 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
- 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
- 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
- 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
- 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
- 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
- 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
- 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
- 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
- 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
- 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
- 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
- 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
- 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
- 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
- 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
- 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
- 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
- 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
- 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff,
- };
- while (s-- > 0) {
- *buf = rev[*buf];
- buf++;
- }
- return 0;
-}
-
-
-private int
-dviprt_output_expr(dviprt_print *pprint,int numb,uint width,uint dsize)
-{
- uchar *pcode;
- dviprt_cfg_t *pprt;
- uint v;
- uint len;
-
- pprt = pprint->printer;
- if (pprt->prtcode[numb] == NULL) return 0;
- pcode = pprt->prtcode[numb];
- len = pprt->prtcode_size[numb];
-
- while (*pcode && len>0) {
- if (*pcode & CFG_FMT_BIT) {
- uint stack[CFG_STACK_DEPTH];
- int stack_p = -1;
- uchar fmt = *pcode++;
- uint l = *pcode++;
- len -=2;
- while (l>0) {
- if ((*pcode & CFG_EXPR_TYPE_BIT) == CFG_OP) {
- uint v2 = stack[stack_p--];
- v = stack[stack_p--];
- switch (*pcode) {
- case CFG_OP_ADD: v += v2; break;
- case CFG_OP_SUB: v -= v2; break;
- case CFG_OP_MUL: v *= v2; break;
- case CFG_OP_DIV:
- if (v2 == 0) { /* divided by zero. */
- div_by_zero:
- return CFG_ERROR_DIV0;
- }
- v /= v2;
- break;
- case CFG_OP_MOD:
- if (v2 == 0) goto div_by_zero;
- v %= v2;
- break;
- case CFG_OP_SHL: v <<= v2; break;
- case CFG_OP_SHR: v >>= v2; break;
- case CFG_OP_AND: v &= v2; break;
- case CFG_OP_OR : v |= v2; break;
- case CFG_OP_XOR: v ^= v2; break;
- default:
- ;
- }
- stack[++stack_p] = v;
- }
- else if ((*pcode & CFG_EXPR_TYPE_BIT) == CFG_VAL) {
- {
- switch (*pcode) {
- case CFG_VAL_DEFAULT: v = width*8; break;
- case CFG_VAL_CONSTANT: v = pprt->integer[CFG_CONSTANT]; break;
- case CFG_VAL_WIDTH: v = pprint->bitmap_width*8; break;
- case CFG_VAL_HEIGHT: v = pprint->bitmap_height; break;
- case CFG_VAL_PAGE:
- case CFG_VAL_PAGECOUNT: v = pprint->page_count; break;
- case CFG_VAL_DATASIZE: v = dsize; break;
- case CFG_VAL_X_DPI: v = (int)pprt->integer[CFG_DPI]; break;
- case CFG_VAL_Y_DPI:
- v = pprt->integer[CFG_Y_DPI] > 0 ?
- pprt->integer[CFG_Y_DPI] : pprt->integer[CFG_DPI];
- break;
- case CFG_VAL_PINS_BYTE: v = pprt->integer[CFG_PINS]; break;
- case CFG_VAL_X_POS: v = pprint->device_x*8; break;
- case CFG_VAL_Y_POS:
- v = pprint->device_y * dviprt_getscanlines(pprint);
- break;
- }
- }
- stack[++stack_p] = v;
- }
- else {
- stack[++stack_p] = *pcode;
- }
- l--; pcode++; len--;
- }
- v = stack[stack_p];
- if ((fmt & CFG_FMT_FORMAT_BIT) == CFG_FMT_STRINGS) {
- uint l = *pcode++;
- len--;
- while (v-- > 0)
- dviprt_output(pprint,(uchar far *)pcode,l);
- pcode += l;
- len -= l;
- }
- else if ((fmt & CFG_FMT_FORMAT_BIT) == CFG_FMT_ASSIGNMENT) {
- pprint->uservar[fmt&0x0f] = v;
- }
- else { uchar valbuf[10];
- int cols = fmt & CFG_FMT_COLUMN_BIT;
- int i;
-
- switch (fmt & CFG_FMT_FORMAT_BIT) {
- case CFG_FMT_BIN_LTOH:
- for (i=0;i<cols;i++) {
- valbuf[i] = v&0xff;
- v >>= 8;
- }
- break;
- case CFG_FMT_BIN_HTOL:
- for (i=cols-1;i>=0;i--) {
- valbuf[i] = v&0xff;
- v >>= 8;
- }
- break;
- default:
- { char *f;
- char fmtbuf[10];
- switch(fmt & CFG_FMT_FORMAT_BIT) {
- case CFG_FMT_HEX_UPPER: f = "X"; break;
- case CFG_FMT_HEX_LOWER: f = "x"; break;
- case CFG_FMT_DECIMAL: f = "u"; break;
- case CFG_FMT_OCTAL: f = "o"; break;
- }
- if (cols == 0)
- strcpy(fmtbuf,"%");
- else
- sprintf(fmtbuf,"%%0%d",cols);
- strcat(fmtbuf,f);
- sprintf(valbuf,fmtbuf,stack[stack_p]);
- cols = strlen(valbuf);
- if (fmt & CFG_FMT_ISO_BIT)
- valbuf[cols-1] |= 0x10;
- }
- break;
- }
- dviprt_output(pprint,(uchar far *)valbuf, cols);
- }
- }
- else {
- uint l = *pcode++;
- len--;
- dviprt_output(pprint,(uchar far *)pcode,l);
- pcode += l;
- len -= l;
- }
- }
- return 0;
-}
-
-private int
-dviprt_default_outputproc(uchar far *buf,long s,void *fp)
-{
-#ifdef __MSDOS_REAL__
- while (s-- > 0) {
- if (fputc(*buf++,fp) == EOF)
- return CFG_ERROR_OUTPUT;
- }
- return 0;
-#else
- return fwrite(buf,s,1,fp) == 1 ? 0 : CFG_ERROR_OUTPUT;
-#endif
-}
-/***** End of print.c *****/
-
-
-/***** From encode.c *****/
-/* $Id: ENCODE.C 1.1 1994/08/30 02:27:02 kaz Exp kaz $ */
-
-
-#define DVIPRT_SUPPORT_FAX 1
-#define DVIPRT_SUPPORT_PCL 1
-
-/*--- forward declarations ---*/
-private long dviprt_null_getworksize(dviprt_print *,long );
-private long dviprt_null_encode(dviprt_print *,long ,int );
-private long dviprt_hex_getworksize(dviprt_print *,long );
-private long dviprt_hex_encode(dviprt_print *,long ,int );
-#if DVIPRT_SUPPORT_FAX
-private long dviprt_fax_getworksize(dviprt_print *,long );
-private long dviprt_fax_encode(dviprt_print *,long ,int );
-#endif
-#if DVIPRT_SUPPORT_PCL
-private long dviprt_pcl1_getworksize(dviprt_print *,long );
-private long dviprt_pcl1_encode(dviprt_print *,long ,int );
-private long dviprt_pcl2_getworksize(dviprt_print *,long );
-private long dviprt_pcl2_encode(dviprt_print *,long ,int );
-#endif
-
-private dviprt_encoder dviprt_encoder_list[] = {
- { CFG_ENCODE_NULL, dviprt_null_getworksize,dviprt_null_encode},
- { CFG_ENCODE_HEX, dviprt_hex_getworksize,dviprt_hex_encode},
-#if DVIPRT_SUPPORT_FAX
- { CFG_ENCODE_FAX, dviprt_fax_getworksize,dviprt_fax_encode},
-#endif
-#if DVIPRT_SUPPORT_PCL
- { CFG_ENCODE_PCL1, dviprt_pcl1_getworksize,dviprt_pcl1_encode},
- { CFG_ENCODE_PCL2, dviprt_pcl2_getworksize,dviprt_pcl2_encode},
-#endif
- { -1 },
-};
-
-/*--- internal routines ---*/
-/* The users MUST NOT USE these functions */
-liblocal dviprt_encoder *
-dviprt_getencoder_(int no)
-{
- int i;
- for (i=0;dviprt_encoder_list[i].no >= 0;i++)
- if (no == dviprt_encoder_list[i].no)
- return dviprt_encoder_list+i;
- return NULL;
-}
-
-private long
-dviprt_null_getworksize(dviprt_print *pprint,long s)
-{
- return 0;
-}
-private long
-dviprt_null_encode(dviprt_print *pprint,long s,int f)
-{
- pprint->poutput = pprint->psource;
- return s;
-}
-
-private long
-dviprt_hex_getworksize(dviprt_print *pprint,long s)
-{
- return s*2;
-}
-private long
-dviprt_hex_encode(dviprt_print *pprint,long s,int f)
-{
- if (f) {
- uchar far *w;
- uchar far *buf;
- static uchar hex[] = "0123456789ABCDEF";
- int i=s;
- w = pprint->poutput = pprint->encode_buffer;
- buf = pprint->psource;
- while (i-->0) {
- *w++ = hex[(*buf>>4)&0x0f];
- *w++ = hex[*buf&0x0f];
- buf++;
- }
- }
- return s*2;
-}
-
-#if DVIPRT_SUPPORT_PCL
-private long
-dviprt_pcl1_getworksize(dviprt_print *pprint,long s)
-{
- return s*2;
-}
-private long
-dviprt_pcl1_encode(dviprt_print *pprint,long s,int f)
-{
- uchar far *src;
- uchar far *end;
- uchar far *out;
- long total = 0;
-
- src = pprint->psource;
- end = src + s;
- out = pprint->poutput = pprint->encode_buffer;
-
- while ( src < end ) {
- uchar test = *src++;
- uchar far *run = src;
- while ( src < end && *src == test ) src++;
- if (f) {
- while ( src - run > 255 ) {
- *out++ = 255;
- *out++ = test;
- total += 2;
- run += 256;
- }
- *out++ = src - run;
- *out++ = test;
- total += 2;
- }
- else {
- total += (((src-run)/255 + ((src-run)%255) ? 1 : 0)) * 2;
- }
- }
- return total;
-}
-
-private long
-dviprt_pcl2_getworksize(dviprt_print *pprint,long s)
-{
- return s + s/127 + 1;
-}
-private long
-dviprt_pcl2_encode(dviprt_print *pprint,long s,int f)
-{
- uchar far *exam;
- uchar far *cptr;
- uchar far *end;
- uchar far *src;
- long total = 0;
-
- src = pprint->psource;
- exam = src;
- cptr = pprint->poutput = pprint->encode_buffer;
- end = exam + s;
-
- for ( ; ; ) {
- uchar test = *exam++;
- int len;
- while ((test != *exam) && (exam < end))
- test = *exam++;
- if (exam < end) exam--;
- len = exam - src;
- if (f) {
- while (len > 0){
- int i;
- int count = len;
- if (count>127) count=127;
- *cptr++=count-1;
- for (i = 0 ; i < count ; i++) *cptr++ = *src++;
- len -= count;
- total += (count+1);
- }
- }
- else {
- total += len + ((len/127)+(len%127 ? 1 : 0));
- }
- if (exam >= end) break;
- exam++;
- while ((test == *exam) && (exam < end))
- exam++;
- len = exam - src;
- if (f) {
- while (len > 0) {
- int count = len;
- if (count > 127) count = 127;
- *cptr++ = (257-count);
- *cptr++ = test;
- len -= count;
- total += 2;
- }
- }
- else {
- total += ((len/127 + (len%127) ? 1 : 0)) * 2;
- }
- if (exam >= end) break;
- src = exam;
- }
- return total;
-}
-#endif /* DVIPRT_SUPPORT_PCL */
-
-#if DVIPRT_SUPPORT_FAX
-private long
-dviprt_fax_getworksize(dviprt_print *pprint,long s)
-{
- long size = s * 8 + 7;
- return MAX(size*2/9+4,size/8) * dviprt_getscanlines(pprint) + 1;
-}
-
-#define MAX_FAX_WIDTH 2623
-typedef struct {
- int data;
- int length;
-} FaxEncode_t;
-typedef struct {
- uchar i_bitbuf;
- uchar far *i_buf;
- int i_count;
-
- uchar o_bitbuf;
- uchar far *o_buf;
- int o_count;
- int o_bufcount;
-} FaxEncodeInfo;
-private int dviprt_fax_set_white(int,FaxEncodeInfo *);
-private int dviprt_fax_set_black(int,FaxEncodeInfo *);
-private int dviprt_fax_set_bitcount(FaxEncode_t *,FaxEncodeInfo *);
-
-private long
-dviprt_fax_encode(dviprt_print *pprint,long s,int f)
-{
- static FaxEncode_t eol_code = {0x800,12};
- int allruns = 0;
- int width = s * 8;
- int top_bit_count = 8;
- FaxEncodeInfo info;
- uchar far *src_end;
- uchar recover;
-
- src_end = pprint->psource + s;
- recover = *src_end;
- *src_end = 0xaa;
-
- /* initializing */
- info.i_buf = pprint->psource;
- info.i_bitbuf = *info.i_buf++;
- info.i_count = 8;
- info.o_buf = pprint->poutput = pprint->encode_buffer;
- info.o_bitbuf = 0;
- info.o_count = 8;
- info.o_bufcount = 0;
-
- dviprt_fax_set_bitcount(&eol_code,&info);
-
- for(;;){
- static uchar ROW[9] =
- {0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
- static uchar MASK[9] =
- {0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff};
- int white_run_length;
- int black_run_length;
-
- /* count run-length */
- /* remaining bits in the current byte are white? */
- if (!(info.i_bitbuf &= MASK[info.i_count])){
- do{
- top_bit_count += 8; /* next byte is also white */
- } while(!(info.i_bitbuf = *info.i_buf++));
- info.i_count = 8;
- }
- /* current byte contains white and black bits */
- while(!(info.i_bitbuf & ROW[info.i_count]))
- info.i_count--; /* skip white bits */
- white_run_length = top_bit_count - (black_run_length = info.i_count);
-
- /* remaining bits in the current byte are black? */
- if (info.i_bitbuf == MASK[info.i_count]){
- do{
- black_run_length += 8;
- /* next byte is also black */
- } while((info.i_bitbuf = *info.i_buf++) == 0xff);
- info.i_count = 8;
- }
- else info.i_count--; /* skip the top black bit */
-
- /* current byte contains white and black bits */
- while(info.i_bitbuf & ROW[info.i_count])
- info.i_count--; /* skip black bits */
- black_run_length -= (top_bit_count = info.i_count);
-
- /* output */
- if((allruns += white_run_length) < width)
- dviprt_fax_set_white(white_run_length,&info);
- else{
- dviprt_fax_set_white(white_run_length + width - allruns,&info);
- break;
- }
- if((allruns += black_run_length) < width)
- dviprt_fax_set_black(black_run_length,&info);
- else{
- dviprt_fax_set_black(black_run_length + width - allruns,&info);
- break;
- }
- }
-
- info.o_bufcount++;
- if (info.o_count < 8)
- *info.o_buf++ = info.o_bitbuf;
- else
- *info.o_buf++ = 0;
- *src_end = recover;
-
- return info.o_bufcount;
-}
-
-private int
-dviprt_fax_set_bitcount(FaxEncode_t *pt,FaxEncodeInfo *info)
-{
- int data, length;
-
- data = pt->data;
- length = pt->length;
- while( (length -= info->o_count) >= 0 ){
- *info->o_buf++ = ((data << (8 - info->o_count))|info->o_bitbuf);
- info->o_bitbuf = 0;
- info->o_bufcount++;
- data >>= info->o_count;
- info->o_count = 8;
- }
- info->o_bitbuf |= (data << (8 - info->o_count));
- info->o_count = -length;
- return 0;
-}
-
-private int
-dviprt_fax_set_white(int count,FaxEncodeInfo *info)
-{
- static FaxEncode_t white_count_list[]={
- { 0x00AC, 8, }, /* 0 */
- { 0x0038, 6, }, /* 1 */
- { 0x000E, 4, }, /* 2 */
- { 0x0001, 4, }, /* 3 */
- { 0x000D, 4, }, /* 4 */
- { 0x0003, 4, }, /* 5 */
- { 0x0007, 4, }, /* 6 */
- { 0x000F, 4, }, /* 7 */
- { 0x0019, 5, }, /* 8 */
- { 0x0005, 5, }, /* 9 */
- { 0x001C, 5, }, /* 10 */
- { 0x0002, 5, }, /* 11 */
- { 0x0004, 6, }, /* 12 */
- { 0x0030, 6, }, /* 13 */
- { 0x000B, 6, }, /* 14 */
- { 0x002B, 6, }, /* 15 */
- { 0x0015, 6, }, /* 16 */
- { 0x0035, 6, }, /* 17 */
- { 0x0072, 7, }, /* 18 */
- { 0x0018, 7, }, /* 19 */
- { 0x0008, 7, }, /* 20 */
- { 0x0074, 7, }, /* 21 */
- { 0x0060, 7, }, /* 22 */
- { 0x0010, 7, }, /* 23 */
- { 0x000A, 7, }, /* 24 */
- { 0x006A, 7, }, /* 25 */
- { 0x0064, 7, }, /* 26 */
- { 0x0012, 7, }, /* 27 */
- { 0x000C, 7, }, /* 28 */
- { 0x0040, 8, }, /* 29 */
- { 0x00C0, 8, }, /* 30 */
- { 0x0058, 8, }, /* 31 */
- { 0x00D8, 8, }, /* 32 */
- { 0x0048, 8, }, /* 33 */
- { 0x00C8, 8, }, /* 34 */
- { 0x0028, 8, }, /* 35 */
- { 0x00A8, 8, }, /* 36 */
- { 0x0068, 8, }, /* 37 */
- { 0x00E8, 8, }, /* 38 */
- { 0x0014, 8, }, /* 39 */
- { 0x0094, 8, }, /* 40 */
- { 0x0054, 8, }, /* 41 */
- { 0x00D4, 8, }, /* 42 */
- { 0x0034, 8, }, /* 43 */
- { 0x00B4, 8, }, /* 44 */
- { 0x0020, 8, }, /* 45 */
- { 0x00A0, 8, }, /* 46 */
- { 0x0050, 8, }, /* 47 */
- { 0x00D0, 8, }, /* 48 */
- { 0x004A, 8, }, /* 49 */
- { 0x00CA, 8, }, /* 50 */
- { 0x002A, 8, }, /* 51 */
- { 0x00AA, 8, }, /* 52 */
- { 0x0024, 8, }, /* 53 */
- { 0x00A4, 8, }, /* 54 */
- { 0x001A, 8, }, /* 55 */
- { 0x009A, 8, }, /* 56 */
- { 0x005A, 8, }, /* 57 */
- { 0x00DA, 8, }, /* 58 */
- { 0x0052, 8, }, /* 59 */
- { 0x00D2, 8, }, /* 60 */
- { 0x004C, 8, }, /* 61 */
- { 0x00CC, 8, }, /* 62 */
- { 0x002C, 8, }, /* 63 */
-
- { 0x001B, 5, }, /* 64 */
- { 0x0009, 5, }, /* 128 */
- { 0x003A, 6, }, /* 192 */
- { 0x0076, 7, }, /* 256 */
- { 0x006C, 8, }, /* 320 */
- { 0x00EC, 8, }, /* 384 */
- { 0x0026, 8, }, /* 448 */
- { 0x00A6, 8, }, /* 512 */
- { 0x0016, 8, }, /* 576 */
- { 0x00E6, 8, }, /* 640 */
- { 0x0066, 9, }, /* 704 */
- { 0x0166, 9, }, /* 768 */
- { 0x0096, 9, }, /* 832 */
- { 0x0196, 9, }, /* 896 */
- { 0x0056, 9, }, /* 960 */
- { 0x0156, 9, }, /* 1024 */
- { 0x00D6, 9, }, /* 1088 */
- { 0x01D6, 9, }, /* 1152 */
- { 0x0036, 9, }, /* 1216 */
- { 0x0136, 9, }, /* 1280 */
- { 0x00B6, 9, }, /* 1344 */
- { 0x01B6, 9, }, /* 1408 */
- { 0x0032, 9, }, /* 1472 */
- { 0x0132, 9, }, /* 1536 */
- { 0x00B2, 9, }, /* 1600 */
- { 0x0006, 6, }, /* 1664 */
- { 0x01B2, 9, }, /* 1728 */
-
- { 0x0080, 11, }, /* 1792 */
- { 0x0180, 11, }, /* 1856 */
- { 0x0580, 11, }, /* 1920 */
- { 0x0480, 12, }, /* 1984 */
- { 0x0C80, 12, }, /* 2048 */
- { 0x0280, 12, }, /* 2112 */
- { 0x0A80, 12, }, /* 2176 */
- { 0x0680, 12, }, /* 2240 */
- { 0x0E80, 12, }, /* 2304 */
- { 0x0380, 12, }, /* 2368 */
- { 0x0B80, 12, }, /* 2432 */
- { 0x0780, 12, }, /* 2496 */
- { 0x0F80, 12, }, /* 2560 */
- };
- while (count >= 64){
- if(count <= MAX_FAX_WIDTH){
- dviprt_fax_set_bitcount((white_count_list + 63) + (count/64),info);
- break;
- }
- dviprt_fax_set_white(MAX_FAX_WIDTH,info);
- dviprt_fax_set_black(0,info);
- count -= MAX_FAX_WIDTH;
- }
- dviprt_fax_set_bitcount(white_count_list + (count & 63) ,info);
- return 0;
-}
-
-private int
-dviprt_fax_set_black(int count,FaxEncodeInfo *info)
-{
- static FaxEncode_t black_count_list[]={
- { 0x03B0, 10, }, /* 0 */
- { 0x0002, 3, }, /* 1 */
- { 0x0003, 2, }, /* 2 */
- { 0x0001, 2, }, /* 3 */
- { 0x0006, 3, }, /* 4 */
- { 0x000C, 4, }, /* 5 */
- { 0x0004, 4, }, /* 6 */
- { 0x0018, 5, }, /* 7 */
- { 0x0028, 6, }, /* 8 */
- { 0x0008, 6, }, /* 9 */
- { 0x0010, 7, }, /* 10 */
- { 0x0050, 7, }, /* 11 */
- { 0x0070, 7, }, /* 12 */
- { 0x0020, 8, }, /* 13 */
- { 0x00E0, 8, }, /* 14 */
- { 0x0030, 9, }, /* 15 */
- { 0x03A0, 10, }, /* 16 */
- { 0x0060, 10, }, /* 17 */
- { 0x0040, 10, }, /* 18 */
- { 0x0730, 11, }, /* 19 */
- { 0x00B0, 11, }, /* 20 */
- { 0x01B0, 11, }, /* 21 */
- { 0x0760, 11, }, /* 22 */
- { 0x00A0, 11, }, /* 23 */
- { 0x0740, 11, }, /* 24 */
- { 0x00C0, 11, }, /* 25 */
- { 0x0530, 12, }, /* 26 */
- { 0x0D30, 12, }, /* 27 */
- { 0x0330, 12, }, /* 28 */
- { 0x0B30, 12, }, /* 29 */
- { 0x0160, 12, }, /* 30 */
- { 0x0960, 12, }, /* 31 */
- { 0x0560, 12, }, /* 32 */
- { 0x0D60, 12, }, /* 33 */
- { 0x04B0, 12, }, /* 34 */
- { 0x0CB0, 12, }, /* 35 */
- { 0x02B0, 12, }, /* 36 */
- { 0x0AB0, 12, }, /* 37 */
- { 0x06B0, 12, }, /* 38 */
- { 0x0EB0, 12, }, /* 39 */
- { 0x0360, 12, }, /* 40 */
- { 0x0B60, 12, }, /* 41 */
- { 0x05B0, 12, }, /* 42 */
- { 0x0DB0, 12, }, /* 43 */
- { 0x02A0, 12, }, /* 44 */
- { 0x0AA0, 12, }, /* 45 */
- { 0x06A0, 12, }, /* 46 */
- { 0x0EA0, 12, }, /* 47 */
- { 0x0260, 12, }, /* 48 */
- { 0x0A60, 12, }, /* 49 */
- { 0x04A0, 12, }, /* 50 */
- { 0x0CA0, 12, }, /* 51 */
- { 0x0240, 12, }, /* 52 */
- { 0x0EC0, 12, }, /* 53 */
- { 0x01C0, 12, }, /* 54 */
- { 0x0E40, 12, }, /* 55 */
- { 0x0140, 12, }, /* 56 */
- { 0x01A0, 12, }, /* 57 */
- { 0x09A0, 12, }, /* 58 */
- { 0x0D40, 12, }, /* 59 */
- { 0x0340, 12, }, /* 60 */
- { 0x05A0, 12, }, /* 61 */
- { 0x0660, 12, }, /* 62 */
- { 0x0E60, 12, }, /* 63 */
-
- { 0x03C0, 10, }, /* 64 */
- { 0x0130, 12, }, /* 128 */
- { 0x0930, 12, }, /* 192 */
- { 0x0DA0, 12, }, /* 256 */
- { 0x0CC0, 12, }, /* 320 */
- { 0x02C0, 12, }, /* 384 */
- { 0x0AC0, 12, }, /* 448 */
- { 0x06C0, 13, }, /* 512 */
- { 0x16C0, 13, }, /* 576 */
- { 0x0A40, 13, }, /* 640 */
- { 0x1A40, 13, }, /* 704 */
- { 0x0640, 13, }, /* 768 */
- { 0x1640, 13, }, /* 832 */
- { 0x09C0, 13, }, /* 896 */
- { 0x19C0, 13, }, /* 960 */
- { 0x05C0, 13, }, /* 1024 */
- { 0x15C0, 13, }, /* 1088 */
- { 0x0DC0, 13, }, /* 1152 */
- { 0x1DC0, 13, }, /* 1216 */
- { 0x0940, 13, }, /* 1280 */
- { 0x1940, 13, }, /* 1344 */
- { 0x0540, 13, }, /* 1408 */
- { 0x1540, 13, }, /* 1472 */
- { 0x0B40, 13, }, /* 1536 */
- { 0x1B40, 13, }, /* 1600 */
- { 0x04C0, 13, }, /* 1664 */
- { 0x14C0, 13, }, /* 1728 */
-
- { 0x0080, 11, }, /* 1792 */
- { 0x0180, 11, }, /* 1856 */
- { 0x0580, 11, }, /* 1920 */
- { 0x0480, 12, }, /* 1984 */
- { 0x0C80, 12, }, /* 2048 */
- { 0x0280, 12, }, /* 2112 */
- { 0x0A80, 12, }, /* 2176 */
- { 0x0680, 12, }, /* 2240 */
- { 0x0E80, 12, }, /* 2304 */
- { 0x0380, 12, }, /* 2368 */
- { 0x0B80, 12, }, /* 2432 */
- { 0x0780, 12, }, /* 2496 */
- { 0x0F80, 12, }, /* 2560 */
- };
-
- while (count >= 64){
- if(count <= MAX_FAX_WIDTH){
- dviprt_fax_set_bitcount((black_count_list + 63) + (count/64),info);
- break;
- }
- dviprt_fax_set_black(MAX_FAX_WIDTH,info);
- dviprt_fax_set_white(0,info);
- count -= MAX_FAX_WIDTH;
- }
- dviprt_fax_set_bitcount(black_count_list + (count & 63),info);
- return 0;
-}
-#endif /* DVIPRT_SUPPORT_FAX */
-/***** End of encode.c *****/
diff --git a/gs/contrib/japanese/dviprlib.h b/gs/contrib/japanese/dviprlib.h
deleted file mode 100644
index 6db001d96..000000000
--- a/gs/contrib/japanese/dviprlib.h
+++ /dev/null
@@ -1,361 +0,0 @@
-/* COPYRIGHT (C) 1990, 1992 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. */
-
-/* dviprlib.h */
-
-/* $Id: S_CFGBLD.H 1.1 1994/08/30 02:27:18 kaz Exp kaz $ */
-
-#ifndef s_cfgbld_h_INCLUDED
-
-
-/* $Id: S_CFG.H 1.1 1994/08/30 02:27:18 kaz Exp kaz $ */
-
-#ifndef s_cfg_h_INCLUDED
-#define CFG_MAGIC_NUMBER ":K"
-#define CFG_VERSION 2
-
-#define CFG_NAME 0
-#define CFG_ENCODE_INFO 1
-#define CFG_STRINGS_TYPE_COUNT 2
-
-#define CFG_STRINGS_NAME "name", "encode_info"
-
-#define CFG_PINS 0
-#define CFG_MINIMAL_UNIT 1
-#define CFG_MAXIMAL_UNIT 2
-#define CFG_DPI 3
-#define CFG_UPPER_POS 4
-#define CFG_ENCODE 5
-#define CFG_CONSTANT 6
-#define CFG_Y_DPI 7
-#define CFG_INTEGER_TYPE_COUNT 8
-
-#define CFG_INTEGER_NAME "pins","minimal_unit","maximal_unit","dpi",\
-"upper_position","encode","constant","y_dpi"
-
-#define CFG_BIT_IMAGE_MODE 0
-#define CFG_SEND_BIT_IMAGE 1
-#define CFG_BIT_ROW_HEADER 2
-#define CFG_AFTER_BIT_IMAGE 3
-#define CFG_LINE_FEED 4
-#define CFG_FORM_FEED 5
-#define CFG_NORMAL_MODE 6
-#define CFG_SKIP_SPACES 7
-#define CFG_PRTCODE_TYPE_COUNT 8
-
-#define CFG_PRTCODE_NAME "bit_image_mode", "send_bit_image", "bit_row_header",\
- "after_bit_image", "line_feed", "form_feed",\
- "normal_mode", "skip_spaces"
-
-#define CFG_FMT_BIT 0x80
-#define CFG_FMT_FORMAT_BIT 0x70
-#define CFG_FMT_COLUMN_BIT 0x07
-#define CFG_FMT_ISO_BIT 0x08
-
-#define CFG_FMT_BIN_LTOH 0x00
-#define CFG_FMT_BIN_HTOL 0x10
-#define CFG_FMT_HEX_UPPER 0x20
-#define CFG_FMT_HEX_LOWER 0x30
-#define CFG_FMT_DECIMAL 0x40
-#define CFG_FMT_OCTAL 0x50
-#define CFG_FMT_ASSIGNMENT 0x60 /* assignment(user variables) */
-#define CFG_FMT_STRINGS 0x70
-
-#define CFG_EXPR_TYPE_BIT 0xe0
-#define CFG_EXPR_VAL_BIT 0x1f
-#define CFG_VAL 0x80
-#define CFG_VAL_DEFAULT (0x00 | CFG_VAL)
-#define CFG_VAL_CONSTANT (0x01 | CFG_VAL)
-#define CFG_VAL_WIDTH (0x02 | CFG_VAL)
-#define CFG_VAL_HEIGHT (0x03 | CFG_VAL)
-#define CFG_VAL_PAGE (0x04 | CFG_VAL)
-#define CFG_VAL_PAGECOUNT (0x05 | CFG_VAL)
-#define CFG_VAL_DATASIZE (0x06 | CFG_VAL)
-#define CFG_VAL_X_DPI (0x07 | CFG_VAL)
-#define CFG_VAL_Y_DPI (0x08 | CFG_VAL)
-#define CFG_VAL_PINS_BYTE (0x09 | CFG_VAL)
-#define CFG_VAL_X_POS (0x0a | CFG_VAL)
-#define CFG_VAL_Y_POS (0x0b | CFG_VAL)
-
-/* user variable 'A' -- 'P' (0xa0 -- 0xaf) */
-#define CFG_USERVAL (0x20 | CFG_VAL)
-#define CFG_USERVAL_COUNT 16
-
-#define CFG_OP 0xc0
-/* logic 2 operand */
-#define CFG_OP_ADD (0x00 | CFG_OP)
-#define CFG_OP_SUB (0x01 | CFG_OP)
-#define CFG_OP_MUL (0x02 | CFG_OP)
-#define CFG_OP_DIV (0x03 | CFG_OP)
-#define CFG_OP_MOD (0x04 | CFG_OP)
-
-#define CFG_OP_SHL (0x05 | CFG_OP)
-#define CFG_OP_SHR (0x06 | CFG_OP)
-#define CFG_OP_AND (0x07 | CFG_OP)
-#define CFG_OP_OR (0x08 | CFG_OP)
-#define CFG_OP_XOR (0x09 | CFG_OP)
-/* extra operation (user cannot use) */
-#define CFG_OP_POP (0x2e | CFG_OP)
-#define CFG_OP_NULL (0x2f | CFG_OP)
-
-#define CFG_OP_NAME "+","-","*","/",\
-"%","<",">","&",\
- "|","^",\
- /* 0x0a -- 0x0f */ NULL,NULL,\
- /* Undefined */ NULL,NULL,NULL,NULL,\
- \
- /* 0x10 -- 0x1f*/ NULL,NULL,NULL,NULL,\
- /* Undefined */ NULL,NULL,NULL,NULL,\
- NULL,NULL,NULL,NULL,\
- NULL,NULL,NULL,NULL,\
- \
- /* 0x20 -- 0x2d*/ NULL,NULL,NULL,NULL,\
- /* Undefined */ NULL,NULL,NULL,NULL,\
- NULL,NULL,NULL,NULL,\
- NULL,NULL,\
- \
- "pop","null"
-
-#define CFG_TOP_IS_HIGH 0x00
-#define CFG_TOP_IS_LOW 0x80
-#define CFG_LEFT_IS_HIGH 0x40
-#define CFG_LEFT_IS_LOW 0xc0
-#define CFG_NON_MOVING 0x20
-#define CFG_NON_TRANSPOSE_BIT 0x40
-#define CFG_REVERSE_BIT 0x80
-#define CFG_PIN_POSITION_BITS 0xc0
-
-#define CFG_ENCODE_NAME "NULL","HEX","FAX","PCL1","PCL2"
-#define CFG_ENCODE_NULL 0x00
-#define CFG_ENCODE_HEX 0x01
-#define CFG_ENCODE_FAX 0x02
-#define CFG_ENCODE_PCL1 0x03
-#define CFG_ENCODE_PCL2 0x04
-#define CFG_ENCODE_LIPS3 0x05 /* Not implemented yet. */
-#define CFG_ENCODE_ESCPAGE 0x06 /* Not implemented yet. */
-#define CFG_ENCODE_COUNT 0x05
-
-#define CFG_STACK_DEPTH 20
-
-#define CFG_ERROR_OTHER -1
-
-#define CFG_ERROR_SYNTAX -2
-#define CFG_ERROR_RANGE -3
-#define CFG_ERROR_TYPE -4
-
-#define CFG_ERROR_FILE_OPEN -5
-#define CFG_ERROR_OUTPUT -6
-#define CFG_ERROR_MEMORY -7
-#define CFG_ERROR_DIV0 -8
-#define CFG_ERROR_NOT_SUPPORTED -9
-
-#if defined(MSDOS) || defined(_MSDOS)
-# ifndef __MSDOS__
-# define __MSDOS__
-# endif
-#endif
-#if defined(__MSDOS__) || defined(__STDC__)
-# ifndef __PROTOTYPES__
-# define __PROTOTYPES__
-# endif
-#endif
-#ifdef __NO_PROTOTYPES__
-# undef __PROTOTYPES__
-#endif
-
-#if defined(__MSDOS__) && !defined(__GNUC__) && !defined(__WATCOMC__)
-# ifndef __MSDOS_REAL__
-# define __MSDOS_REAL__
-# endif
-#else
-# ifndef far
-# define far /* */
-# endif
-#endif
-
-typedef struct {
- unsigned int version;
-
- long integer[CFG_INTEGER_TYPE_COUNT];
- unsigned char *strings[CFG_STRINGS_TYPE_COUNT];
- unsigned char *prtcode[CFG_PRTCODE_TYPE_COUNT];
- unsigned int prtcode_size[CFG_PRTCODE_TYPE_COUNT];
-} dviprt_cfg_t;
-
-typedef struct dviprt_print_s dviprt_print;
-struct dviprt_print_s {
- dviprt_cfg_t *printer;
- unsigned int bitmap_width;
- unsigned int bitmap_height;
- unsigned int buffer_width;
-
- unsigned int device_x;
- unsigned int device_y;
- unsigned int bitmap_x;
- unsigned int bitmap_y;
- unsigned int last_x;
-
- int page_count;
- unsigned char far *source_buffer;
- unsigned char far *encode_buffer;
- unsigned char far *psource;
- unsigned char far *poutput;
- int tempbuffer_f;
-
-#ifdef __PROTOTYPES__
- int (*output_proc)(unsigned char far *,long ,void *);
- int (*output_maximal_unit)(dviprt_print *,unsigned char far *,unsigned int );
- long (*encode_getbuffersize_proc)(dviprt_print *,long);
- long (*encode_encode_proc)(dviprt_print *,long ,int);
-#else
- int (*output_proc)();
- int (*output_maximal_unit)();
- long (*encode_getbuffersize_proc)();
- long (*encode_encode_proc)();
-#endif
- void *pstream;
-
- unsigned long output_bytes;
- unsigned int uservar[CFG_USERVAL_COUNT];
-};
-
-#define dviprt_getscanlines(p) ((int)(p)->printer->integer[CFG_PINS]*8)
-#define dviprt_getoutputbytes(p) ((unsigned long)(p)->output_bytes)
-
-#ifdef __PROTOTYPES__
-extern int dviprt_readsrc(char *,dviprt_cfg_t *,
- unsigned char *,int ,unsigned char *, int);
-extern int dviprt_readcfg(char *,dviprt_cfg_t *,
- unsigned char *,int , unsigned char *,int);
-
-extern int dviprt_beginpage(dviprt_print *);
-extern long dviprt_initlibrary(dviprt_print *,dviprt_cfg_t *,
- unsigned int ,unsigned int );
-extern int dviprt_endbitmap(dviprt_print *);
-extern int dviprt_setstream
- (dviprt_print *p,int(*f)(unsigned char far*,long,void*),void *s);
-extern int dviprt_setbuffer(dviprt_print *,unsigned char far *);
-extern int dviprt_outputscanlines(dviprt_print *, unsigned char far *);
-extern int dviprt_output(dviprt_print *,unsigned char far *,long );
-extern int dviprt_unsetbuffer(dviprt_print *);
-
-extern int dviprt_setmessagestream(FILE *);
-extern int dviprt_writesrc(char *,char *,dviprt_cfg_t *,unsigned char *,int );
-extern int dviprt_writecfg(char *,char *,dviprt_cfg_t *,unsigned char *,int );
-extern int dviprt_writec(char *,char *,dviprt_cfg_t *,unsigned char *,int );
-#else /* !__PROTOTYPES__ */
-extern int dviprt_readsrc();
-extern int dviprt_readcfg();
-extern long dviprt_initlibrary();
-extern int dviprt_setstream();
-extern int dviprt_setbuffer();
-extern int dviprt_beginpage();
-extern int dviprt_outputscanlines();
-extern int dviprt_endbitmap();
-extern int dviprt_output ();
-extern int dviprt_unsetbuffer();
-extern int dviprt_setmessagestream();
-extern int dviprt_writesrc();
-extern int dviprt_writecfg();
-extern int dviprt_writec();
-#endif /* __PROTOTYPES__ */
-
-extern char *dviprt_integername[];
-extern char *dviprt_stringsname[];
-extern char *dviprt_prtcodename[];
-extern char *dviprt_encodename[];
-
-#define s_cfg_h_INCLUDED
-#endif /* s_cfg_h_INCLUDED */
-
-
-#define TEMP_CODEBUF_SIZE 2048
-#define TEMP_READBUF_SIZE 1024
-
-/* MS-DOS (real-mode) */
-#ifdef __MSDOS_REAL__
-# define BufferCpy(a,b,c) _fmemcpy(a,b,c)
-# define BufferCmp(a,b,c) _fmemcmp(a,b,c)
-# define BufferAlloc(a) _fmalloc(a)
-# define BufferFree(a) _ffree(a)
-#else
-# define BufferCpy(a,b,c) memcpy(a,b,c)
-# define BufferCmp(a,b,c) memcmp(a,b,c)
-# define BufferAlloc(a) malloc(a)
-# define BufferFree(a) free(a)
-#endif
-
-#ifndef MIN
-#define MIN(a,b) ((a)<(b) ? (a) : (b))
-#endif
-#ifndef MAX
-#define MAX(a,b) ((a)>(b) ? (a) : (b))
-#endif
-
-#define CFG_LIBERROR_UNKNOWN_VALUE -256
-#define CFG_LIBERROR_UNKNOWN_FORMAT -257
-#define CFG_LIBERROR_UNKNOWN_ESCSEQ -258
-#define CFG_LIBERROR_OUTOFRANGE -259
-#define CFG_LIBERROR_INVALID_VALUE -260
-#define CFG_LIBERROR_COMPLICATED_EXPR -261
-#define CFG_LIBERROR_INCOMPLETE -262
-
-typedef struct {
- uchar *fname;
- FILE *file;
- int line_no;
-
- char temp_readbuf_f;
- char temp_codebuf_f;
- uchar *readbuf;
- uchar *codebuf;
- int readbuf_size;
- int codebuf_size;
-
- uchar *pcodebuf;
-
- uchar *token;
- uchar *endtoken;
-} dviprt_cfg_i;
-
-#ifdef dviprlib_implementation
-typedef struct {
- int no;
- long (*getworksize)(dviprt_print *,long);
- long (*encode)(dviprt_print *,long,int);
-} dviprt_encoder;
-
-#define liblocal private
-
-liblocal dviprt_encoder *dviprt_getencoder_(int);
-liblocal int dviprt_setcfgbuffer_(dviprt_cfg_i *,int ,int);
-liblocal int dviprt_resetcfgbuffer_(dviprt_cfg_i *);
-liblocal int dviprt_initcfg_(dviprt_cfg_t *,dviprt_cfg_i *);
-liblocal int dviprt_printmessage(char *,int);
-liblocal int dviprt_printerror(char *,int);
-liblocal int dviprt_printwarning(char *,int);
-liblocal int dviprt_printcfgerror(dviprt_cfg_i *,char *,int);
-liblocal int dviprt_printcfgwarning(dviprt_cfg_i *,char *,int);
-
-extern int dviprt_print_headercomment_(char *,char *,char *,FILE *);
-extern char dviprt_message_buffer[];
-#endif dviprlib_implementation
-
-#define s_cfgbld_h_INCLUDED
-#endif /* s_cfgbld_h_INCLUDED */
diff --git a/gs/contrib/japanese/escp_24.src b/gs/contrib/japanese/escp_24.src
deleted file mode 100644
index 5536aa231..000000000
--- a/gs/contrib/japanese/escp_24.src
+++ /dev/null
@@ -1,12 +0,0 @@
-name : ESC/P 24 pin
-pins : 24
-minimal_unit : 1
-maximal_unit : 180
-dpi : 180
-upper_position : HIGH_BIT
-bit_image_mode : \e 3 \x18 \e ?Z'
-send_bit_image : \e Z \b2,d
-line_feed : \r \n
-form_feed : \r \f
-normal_mode : \r \f \e 2
-skip_spaces : \e \ \b2,d
diff --git a/gs/contrib/japanese/gdev10v.c b/gs/contrib/japanese/gdev10v.c
deleted file mode 100644
index e2e42ef73..000000000
--- a/gs/contrib/japanese/gdev10v.c
+++ /dev/null
@@ -1,334 +0,0 @@
-/* Copyright (C) 1990, 1992, 1993 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. */
-
-/* gdev10v.c */
-/* Canon Bubble Jet BJ-10v printer driver for Ghostscript.
-
- Based on BJ-10e driver (gdevbj10.c) and Epson driver (gdevepsn.c).
- Modified for BJ-10v by MAEDA Atusi (maeda@is.uec.ac.jp) and
- IWAI Teruo (oteru@nak.ics.keio.ac.jp). PC9801 support by MATUI
- Takao (mat@nuis.ac.jp).
- */
-
-/* Fixed for GNU Ghostscript 5.10
- by Norihito Ohmori (ohmori@p.chiba-u.ac.jp)
- */
-
-#include "gdevprn.h"
-
-/*
- The only available resolutions are 360x360, 360x180, and 180x180.
- No checking on resolutions are being made.
- */
-
-#if 0
-#define prn_matrix_procs(p_open, p_get_initial_matrix, p_output_page, p_close) {\
- p_open,\
- p_get_initial_matrix,\
- NULL, /* sync_output */\
- p_output_page,\
- p_close,\
- gdev_prn_map_rgb_color,\
- gdev_prn_map_color_rgb,\
- NULL, /* fill_rectangle */\
- NULL, /* tile_rectangle */\
- NULL, /* copy_mono */\
- NULL, /* copy_color */\
- NULL, /* draw_line */\
- NULL, /* get_bits */\
- gdev_prn_get_params,\
- gdev_prn_put_params,\
- NULL, /* map_cmyk_color */\
- NULL, /* get_xfont_procs */\
- NULL, /* get_xfont_device */\
- NULL, /* map_rgb_alpha_color */\
- gx_page_device_get_page_device\
-}
-#endif
-
-/* The device descriptor */
-private dev_proc_print_page(bj10v_print_page);
-#if 0
-private dev_proc_get_initial_matrix(bj10v_get_initial_matrix);
-#endif
-
-#if 0
-gx_device_procs prn_bj10v_procs =
- prn_matrix_procs(gdev_prn_open, bj10v_get_initial_matrix,
- gdev_prn_output_page, gdev_prn_close);
-#endif
-gx_device_procs prn_bj10v_procs =
- prn_procs(gdev_prn_open, gdev_prn_output_page, gdev_prn_close);
-
-gx_device_printer gs_bj10v_device =
- prn_device(prn_bj10v_procs, "bj10v",
- DEFAULT_WIDTH_10THS, /* width_10ths */
- DEFAULT_HEIGHT_10THS, /* height_10ths */
- 360, /* x_dpi */
- 360, /* y_dpi */
- 0.134, 0.507, 0.166, 0.867, /* l, b, r, t margins */
- 1, bj10v_print_page);
-
-gx_device_printer gs_bj10vh_device =
- prn_device(prn_bj10v_procs, "bj10vh",
- DEFAULT_WIDTH_10THS, /* width_10ths */
- DEFAULT_HEIGHT_10THS, /* height_10ths */
- 360, /* x_dpi */
- 360, /* y_dpi */
- 0.134, 0.507, 0.166, 0.335, /* l, b, r, t margins */
- 1, bj10v_print_page);
-
-/* ------ Internal routines ------ */
-
-#if 0
-/* Shift the origin from the top left corner of the pysical page to the
- first printable pixel, as defined by the top and left margins. */
-private void
-bj10v_get_initial_matrix(gx_device *dev, gs_matrix *pmat)
-{ gx_default_get_initial_matrix(dev, pmat);
- pmat->tx -= dev_l_margin(dev) * dev->x_pixels_per_inch;
- pmat->ty -= dev_t_margin(dev) * dev->y_pixels_per_inch;
-}
-#endif
-
-/* ---- Printer output routines ---- */
-
-/* Note: Following code is stolen from gdevp201.c. On NEC PC9801 series,
- which is very popular PC in Japan, DOS printer driver strips off
- some control characters. So we must bypass the driver and put
- data directly to get correct results. */
-
-#ifdef PC9801
-private int
-is_printer(gx_device_printer *pdev)
-{
- return (strlen(pdev->fname) == 0 || strcmp(pdev->fname, "PRN") == 0);
-}
-
-private void
-pc98_prn_out(int c)
-{
- while(!(inportb(0x42) & 0x04));
- outportb(0x40, c);
- outportb(0x46, 0x0e);
- outportb(0x46, 0x0f);
-}
-
-private int
-prn_putc(gx_device_printer *pdev, int c)
-{
- if(is_printer(pdev)) {
- pc98_prn_out(c);
- return 0;
- }
- return fputc(c, pdev->file);
-}
-
-private int
-prn_puts(gx_device_printer *pdev, char *ptr)
-{
- if(is_printer(pdev)) {
- while(*ptr)
- pc98_prn_out(*ptr ++);
- return 0;
- }
- return fputs(ptr, pdev->file);
-}
-
-private int
-prn_write(gx_device_printer *pdev, char *ptr, int size)
-{
- if(is_printer(pdev)) {
- while(size --)
- pc98_prn_out(*ptr ++);
- return size;
- }
- return fwrite(ptr, 1, size, pdev->file);
-}
-
-private int
-prn_flush(gx_device_printer *pdev)
-{
- if(is_printer(pdev))
- return 0;
- return fflush(pdev->file);
-}
-
-#else /* PC9801 */
-
-#define prn_putc(pdev, c) putc(c, pdev->file)
-#define prn_puts(pdev, ptr) fputs(ptr, pdev->file)
-#define prn_write(pdev, ptr, size) fwrite(ptr, 1, size, pdev->file)
-#define prn_flush(pdev) fflush(pdev->file)
-
-#endif
-
-/* ------ internal routines ------ */
-
-private void
-bj10v_output_run(byte *data, int dnum, int bytes,
- char *mode, gx_device_printer *pdev)
-{
- prn_putc(pdev, '\033');
- prn_puts(pdev, mode);
- prn_putc(pdev, dnum & 0xff);
- prn_putc(pdev, dnum >> 8);
- prn_write(pdev, data, bytes);
-}
-
-/* Send the page to the printer. */
-private int
-bj10v_print_page(gx_device_printer *pdev, FILE *prn_stream)
-{ int line_size = gdev_prn_raster((gx_device *)pdev);
- int xres = pdev->x_pixels_per_inch;
- int yres = pdev->y_pixels_per_inch;
- char *mode = (yres == 180 ?
- (xres == 180 ? "\052\047" : "\052\050") :
- "|*");
- int bits_per_column = 24 * (yres / 180);
- int bytes_per_column = bits_per_column / 8;
- int x_skip_unit = bytes_per_column * (xres / 180);
- int y_skip_unit = (yres / 180);
- byte *in = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), 8, line_size, "bj10v_print_page(in)");
- byte *out = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), bits_per_column, line_size, "bj10v_print_page(out)");
- int lnum = 0;
- int y_skip = 0;
- int code = 0;
- int blank_lines = 0;
- int bytes_per_data = ((xres == 360) && (yres == 360)) ? 1 : 3;
-
- if ( in == 0 || out == 0 )
- return -1;
-
- /* Initialize the printer. */
- prn_puts(pdev, "\033@");
- /* Transfer pixels to printer */
- while ( lnum < pdev->height )
- { byte *out_beg;
- byte *out_end;
- byte *outl, *outp;
- byte *zp;
- int count, bnum;
-
- /* Copy 1 scan line and test for all zero. */
- code = gdev_prn_get_bits(pdev, lnum + blank_lines, in, NULL);
- if ( code < 0 ) goto xit;
- /* The mem... or str... functions should be faster than */
- /* the following code, but all systems seem to implement */
- /* them so badly that this code is faster. */
- { register long *zip = (long *)in;
- register int zcnt = line_size;
- static long zeroes[4] = { 0, 0, 0, 0 };
- for ( ; zcnt >= 4 * sizeof(long); zip += 4, zcnt -= 4 * sizeof(long) )
- { if ( zip[0] | zip[1] | zip[2] | zip[3] )
- goto notz;
- }
- if ( !memcmp(in, (char *)zeroes, zcnt) )
- { /* Line is all zero, skip */
- if (++blank_lines >= y_skip_unit) {
- lnum += y_skip_unit;
- y_skip++;
- blank_lines = 0;
- }
- continue;
- }
- }
-notz:
- blank_lines = 0;
- out_end = out + bytes_per_column * pdev->width;
- /* Vertical tab to the appropriate position. */
- while ( y_skip > 255 )
- { prn_puts(pdev, "\033J\377");
- y_skip -= 255;
- }
- if ( y_skip ) {
- prn_puts(pdev, "\033J");
- prn_putc(pdev, y_skip);
- }
-
- /* Transpose in blocks of 8 scan lines. */
- for ( bnum = 0, outl = out; bnum < bits_per_column; bnum += 8, lnum += 8 )
- { int lcnt = gdev_prn_copy_scan_lines(pdev,
- lnum, in, 8 * line_size);
- byte *inp = in;
- if ( lcnt < 0 )
- { code = lcnt;
- goto xit;
- }
- if ( lcnt < 8 )
- memset(in + lcnt * line_size, 0,
- (8 - lcnt) * line_size);
- for (outp = outl ; inp < in + line_size; inp++, outp += bits_per_column )
- { memflip8x8(inp, line_size,
- outp, bytes_per_column);
- }
- outl++;
- }
-
- /* Remove trailing 0s. */
- /* Note that non zero byte always exists. */
- outl = out_end;
- while ( *--outl == 0 )
- ;
- count = ((out_end - (outl + 1)) / bytes_per_column) * bytes_per_column;
- out_end -= count;
- *out_end = 1; /* sentinel */
-
- for ( out_beg = outp = out; outp < out_end; )
- { /* Skip a run of leading 0s. */
- /* At least 10 bytes are needed to make tabbing worth it. */
- byte *zp = outp;
- int x_skip;
- while ( *outp == 0 )
- outp++;
- x_skip = ((outp - zp) / x_skip_unit) * x_skip_unit;
- outp = zp + x_skip;
- if (x_skip >= 10) {
- /* Output preceding bit data. */
- int bytes = zp - out_beg;
- if (bytes > 0)
- /* Only false at beginning of line. */
- bj10v_output_run(out_beg, bytes / bytes_per_data, bytes,
- mode, pdev);
- /* Tab over to the appropriate position. */
- { int skip = x_skip / x_skip_unit;
- prn_puts(pdev, "\033\\");
- prn_putc(pdev, skip & 0xff);
- prn_putc(pdev, skip >> 8);
- }
- out_beg = outp;
- } else
- outp += x_skip_unit;
- }
- if (out_end > out_beg) {
- int bytes = out_end - out_beg;
- bj10v_output_run(out_beg, bytes / bytes_per_data, bytes,
- mode, pdev);
- }
- prn_putc(pdev, '\r');
- y_skip = 24;
- }
-
- /* Eject the page */
-xit: prn_putc(pdev, 014); /* form feed */
- prn_flush(pdev);
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)out, bits_per_column, line_size, "bj10v_print_page(out)");
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)in, 8, line_size, "bj10v_print_page(in)");
- return code;
-}
diff --git a/gs/contrib/japanese/gdevalps.c b/gs/contrib/japanese/gdevalps.c
deleted file mode 100644
index 894720d85..000000000
--- a/gs/contrib/japanese/gdevalps.c
+++ /dev/null
@@ -1,392 +0,0 @@
-/* Copyright (C) 1990, 1995, 1997 Aladdin Enterprises. All rights reserved.
-
- This file is part of Aladdin Ghostscript.
-
- Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND. No author
- or distributor accepts any responsibility for the consequences of using it,
- or for whether it serves any particular purpose or works at all, unless he
- or she says so in writing. Refer to the Aladdin Ghostscript Free Public
- License (the "License") for full details.
-
- Every copy of Aladdin Ghostscript must include a copy of the License,
- normally in a plain ASCII text file named PUBLIC. The License grants you
- the right to copy, modify and redistribute Aladdin Ghostscript, but only
- under certain conditions described in the License. Among other things, the
- License requires that the copyright notice and this notice be preserved on
- all copies.
-*/
-
-/*
- This driver supports ALPS MD Series printer 600dpi monochrome mode only.
-
- Feb. 3 1999 Ver. 0.1 MD5000 monochrome mode support.
- Mar. 19 1999 Ver. 0.2 old MD series monochrome compressed mode
- support. contributed by Kousuke Ikeda.
-
- There is no printer command refernces, so the sequence of initializing,
- inc cartridge selecting, paper feeding and many specs are not clear yet.
-
- ESC 0x2a 0x62 n2 n1 0x59 raster line skip command.
- skip (n1 * 0x100 + n2) lines.
- ESC 0x2a 0x62 n2 n1 0x54 s2 s1 raster line print command.
- skip (s1 * 0x100 + s2) * 8 dots from
- paper side, then (n1 * 0x100 + n2) bytes
- of MSB first data streams following.
- ESC 0x2a 0x62 n2 n1 0x57 raster line print command for MD1300.
- (applicable to MD1xxx and MD2xxx ?)
- (n1 * 0x100 + n2) bytes of MSB first data
- streams following,
- but the data must be compressed.
-*/
-
-/* gdevalps.c */
-/* Alps Micro Dry 600dpi monochrome printer driver */
-#include "gdevprn.h"
-
-#define MD_TOP_MARGIN 0.47
-#define MD_BOTTOM_MARGIN 0.59
-#define MD_SIDE_MARGIN 0.13
-
-#define X_DPI 600
-#define Y_DPI 600
-#define LINE_SIZE ((X_DPI * 84 / 10 + 7) / 8) /* bytes per line for letter */
-
-private int md50_print_page(gx_device_printer *, FILE *, const char *, int);
-private dev_proc_open_device(md_open);
-private dev_proc_print_page(md50m_print_page);
-private dev_proc_print_page(md50e_print_page);
-private dev_proc_print_page(md1xm_print_page);
-
-private gx_device_procs prn_md_procs =
- prn_procs(md_open, gdev_prn_output_page, gdev_prn_close);
-
-gx_device_printer far_data gs_md50Mono_device =
- prn_device(prn_md_procs, "md50Mono",
- DEFAULT_WIDTH_10THS,
- DEFAULT_HEIGHT_10THS,
- 600, /* x_dpi */
- 600, /* y_dpi */
- 0, 0, 0, 0, /* margins */
- 1, md50m_print_page);
-
-gx_device_printer far_data gs_md50Eco_device =
- prn_device(prn_md_procs, "md50Eco",
- DEFAULT_WIDTH_10THS,
- DEFAULT_HEIGHT_10THS,
- 600, /* x_dpi */
- 600, /* y_dpi */
- 0, 0, 0, 0, /* margins */
- 1, md50e_print_page);
-
-gx_device_printer far_data gs_md1xMono_device =
- prn_device(prn_md_procs, "md1xMono",
- DEFAULT_WIDTH_10THS,
- DEFAULT_HEIGHT_10THS,
- 600, /* x_dpi */
- 600, /* y_dpi */
- 0, 0, 0, 0, /* margins */
- 1, md1xm_print_page);
-
-/* Normal black 600 x 600 dpi mode. */
-static const char init_50mono[] = {
-0x1b, 0x65,
-0x1b, 0x25, 0x80, 0x41,
-0x1b, 0x1a, 0x00, 0x00, 0x4c,
-0x1b, 0x26, 0x6c, 0x01, 0x00, 0x48,
-0x1b, 0x26, 0x6c, 0x07, 0x00, 0x4d,
-0x1b, 0x26, 0x6c, 0x04, 0x00, 0x41,
-0x1b, 0x2a, 0x72, 0x00, 0x55,
-0x1b, 0x2a, 0x74, 0x03, 0x52,
-0x1b, 0x26, 0x6c, 0xe5, 0x18, 0x50,
-0x1b, 0x1a, 0x00, 0x00, 0x41,
-0x1b, 0x26, 0x6c, 0x01, 0x00, 0x43, 0x00,
-0x1b, 0x1a, 0x00, 0x00, 0x55,
-0x1b, 0x2a, 0x72, 0x01, 0x41,
-0x1b, 0x2a, 0x62, 0x00, 0x00, 0x4d,
-0x1b, 0x1a, 0x00, 0x80, 0x72,
-};
-
-/* ECO black 600 x 600 dpi mode. */
-/* If you wanto to use ECO black casette, use this sequence for initialize. */
-static const char init_50eco[] = {
-0x1b, 0x65,
-0x1b, 0x25, 0x80, 0x41,
-0x1b, 0x1a, 0x00, 0x00, 0x4c,
-0x1b, 0x26, 0x6c, 0x01, 0x00, 0x48,
-0x1b, 0x26, 0x6c, 0x07, 0x00, 0x4d,
-0x1b, 0x26, 0x6c, 0x04, 0x00, 0x41,
-0x1b, 0x2a, 0x72, 0x01, 0x55,
-0x1b, 0x2a, 0x74, 0x03, 0x52,
-0x1b, 0x26, 0x6c, 0xe5, 0x18, 0x50,
-0x1b, 0x1a, 0x00, 0x00, 0x41,
-0x1b, 0x1a, 0x01, 0x00, 0x43,
-0x1b, 0x26, 0x6c, 0x01, 0x00, 0x43, 0x17,
-0x1b, 0x1a, 0x00, 0x00, 0x55,
-0x1b, 0x2a, 0x72, 0x01, 0x41,
-0x1b, 0x2a, 0x62, 0x00, 0x00, 0x4d,
-0x1b, 0x1a, 0x16, 0x80, 0x72,
-};
-
-/* Mono Black 600x600 mode for MD1300 */
-static const char init_md13[] = {
-0x1b, 0x65,
-0x1b, 0x25, 0x80, 0x41,
-0x1b, 0x1a, 0x00, 0x00, 0x4c,
-0x1b, 0x26, 0x6c, 0x01, 0x00, 0x48,
-0x1b, 0x26, 0x6c, 0x00, 0x00, 0x4d,
-0x1b, 0x26, 0x6c, 0x04, 0x00, 0x41,
-0x1b, 0x2a, 0x72, 0x00, 0x55,
-0x1b, 0x2a, 0x74, 0x03, 0x52,
-0x1b, 0x26, 0x6c, 0xe5, 0x18, 0x50,
-0x1b, 0x1a, 0x00, 0x00, 0x41,
-0x1b, 0x2a, 0x72, 0x00, 0x41,
-0x1b, 0x2a, 0x62, 0x02, 0x00, 0x4d,
-0x1b, 0x1a, 0x00, 0x00, 0x72,
-};
-
-static const char end_md[] = {
-0x0c,
-0x1b, 0x2a, 0x72, 0x43,
-0x1b, 0x25, 0x00, 0x58
-};
-/* ------ Internal routines ------ */
-
-/* Open the printer, and set the margins. */
-private int
-md_open(gx_device *pdev)
-{
- static const float md_margins[4] =
- { MD_SIDE_MARGIN, MD_BOTTOM_MARGIN,
- MD_SIDE_MARGIN, MD_TOP_MARGIN
- };
-
- gx_device_set_margins(pdev, md_margins, true);
- return gdev_prn_open(pdev);
-}
-
-/* MD5000 monochrome mode entrance. */
-private int
-md50m_print_page(gx_device_printer *pdev, FILE *prn_stream)
-{
- return(md50_print_page(pdev, prn_stream, init_50mono, sizeof(init_50mono)));
-}
-
-/* MD5000 Eco mode monochrome mode entrance. */
-private int
-md50e_print_page(gx_device_printer *pdev, FILE *prn_stream)
-{
- return(md50_print_page(pdev, prn_stream, init_50eco, sizeof(init_50eco)));
-}
-
-/* MD5000 monochrome mode print. */
-private int
-md50_print_page(gx_device_printer *pdev, FILE *prn_stream,
- const char *init_str, int init_size)
-{
- int lnum;
- int line_size = gdev_mem_bytes_per_scan_line((gx_device *)pdev);
- byte *data = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), 8, line_size, "md50_print_page(data)" );
- int skipping = 0;
- int nbyte;
- int nskip;
- int n;
-
- /* Load Paper & Select Inc Cartridge */
- fwrite(init_str, sizeof(char), init_size, prn_stream);
- fflush(prn_stream);
-
- for ( lnum = 0; lnum <= pdev->height; lnum++ ) {
- byte *end_data = data + line_size;
- byte *start_data = data;
- memset(data, 0, LINE_SIZE);
- n = gdev_prn_copy_scan_lines(pdev, lnum,
- (byte *)data, line_size);
-
- /* Remove trailing 0s. */
- while ( end_data > data && end_data[-1] == 0 )
- end_data--;
- /* Count pre print skip octets */
- while ( start_data < end_data && *start_data == 0 )
- start_data++;
- nbyte = end_data - start_data;
- nskip = start_data - data;
-
- if(nbyte == 0)
- {
- skipping++;
- continue;
- }
- else
- {
- if(skipping)
- {
- fprintf(prn_stream, "%c%c%c%c%c%c", 0x1b, 0x2a, 0x62,
- skipping & 0xff, (skipping & 0xff00) / 0x100, 0x59);
- skipping = 0;
- }
- fprintf(prn_stream, "%c%c%c%c%c%c%c%c", 0x1b, 0x2a, 0x62,
- nbyte & 0xff, (nbyte & 0xff00) / 0x100, 0x54,
- nskip & 0xff, (nskip & 0xff00) / 0x100);
- fwrite(start_data, sizeof(char), nbyte, prn_stream);
- }
- }
-
- /* Eject Page */
- fwrite(end_md, sizeof(char), sizeof(end_md), prn_stream);
- fflush(prn_stream);
-
- return 0;
-}
-
-/* all? MD series monochrome mode print with data compression. */
-private int
-md1xm_print_page(gx_device_printer *pdev, FILE *prn_stream)
-{
- int lnum;
- int line_size = gdev_mem_bytes_per_scan_line((gx_device *)pdev);
- byte *data = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), 8, line_size, "md1xm_print_page(data)");
- byte *out_start = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), 8, line_size, "md1xm_print_page(data)");
- int skipping = 0;
- int nbyte;
-
- /* Load Paper & Select Inc Cartridge */
- fwrite(&init_md13[0], sizeof(char), sizeof(init_md13), prn_stream);
- fflush(prn_stream);
-
- for ( lnum = 0; lnum <= pdev->height; lnum++ ) {
- byte *end_data = data + line_size;
- byte *data_p = data;
- byte *out_data = out_start;
- byte *p, *q;
- int count;
-
- gdev_prn_copy_scan_lines(pdev, lnum, data, line_size);
- /* Remove trailing 0s. */
- while ( end_data > data && end_data[-1] == 0 )
- end_data--;
-
- nbyte = end_data - data_p;
-
- if(nbyte == 0)
- {
- skipping++;
- continue;
- }
- else
- {
- if(skipping)
- {
- fprintf(prn_stream, "%c%c%c%c%c%c", 0x1b, 0x2a, 0x62,
- skipping & 0xff, (skipping & 0xff00) / 0x100, 0x59);
- skipping = 0;
- }
-
- /* Following codes are borrowed from gdevescp.c */
-
- for ( p = data_p, q = data_p + 1; q < end_data; ){
-
- if( *p != *q ) {
-
- p += 2;
- q += 2;
-
- } else {
- /*
- ** Check behind us, just in case:
- */
-
- if( p > data_p && *p == *(p-1) )
- p--;
-
- /*
- ** walk forward, looking for matches:
- */
-
- for( q++ ; *q == *p && q < end_data ; q++ ) {
- if( (q-p) >= 128 ) {
- if( p > data_p ) {
- count = p - data_p;
- while( count > 128 ) {
- *out_data++ = '\177';
- memcpy(out_data, data_p, 128); /* data */
- data_p += 128;
- out_data += 128;
- count -= 128;
- }
- *out_data++ = (char) (count - 1); /* count */
- memcpy(out_data, data_p, count); /* data */
- out_data += count;
- }
- *out_data++ = '\201'; /* Repeat 128 times */
- *out_data++ = *p;
- p += 128;
- data_p = p;
- }
- }
-
- if( (q - p) > 2 ) { /* output this sequence */
- if( p > data_p ) {
- count = p - data_p;
- while( count > 128 ) {
- *out_data++ = '\177';
- memcpy(out_data, data_p, 128); /* data */
- data_p += 128;
- out_data += 128;
- count -= 128;
- }
- *out_data++ = (char) (count - 1); /* byte count */
- memcpy(out_data, data_p, count); /* data */
- out_data += count;
- }
- count = q - p;
- *out_data++ = (char) (256 - count + 1);
- *out_data++ = *p;
- p += count;
- data_p = p;
- } else /* add to non-repeating data list */
- p = q;
- if( q < end_data )
- q++;
- }
- }
- /*
- ** copy remaining part of line:
- */
-
- if( data_p < end_data ) {
-
- count = end_data - data_p;
-
- /*
- ** If we've had a long run of varying data followed by a
- ** sequence of repeated data and then hit the end of line,
- ** it's possible to get data counts > 128.
- */
-
- while( count > 128 ) {
- *out_data++ = '\177';
- memcpy(out_data, data_p, 128); /* data */
- data_p += 128;
- out_data += 128;
- count -= 128;
- }
-
- *out_data++ = (char) (count - 1); /* byte count */
- memcpy(out_data, data_p, count); /* data */
- out_data += count;
- }
-
- nbyte = out_data - out_start;
-
- fprintf(prn_stream, "%c%c%c%c%c%c", 0x1b, 0x2a, 0x62,
- nbyte & 0xff, (nbyte & 0xff00) / 0x100, 0x57);
- fwrite(out_start, sizeof(char), nbyte, prn_stream);
- }
- }
-
- /* Eject Page */
- fwrite(end_md, sizeof(char), sizeof(end_md), prn_stream);
- fflush(prn_stream);
-
- return 0;
-}
diff --git a/gs/contrib/japanese/gdevdmpr.c b/gs/contrib/japanese/gdevdmpr.c
deleted file mode 100644
index 7b5cc7e6d..000000000
--- a/gs/contrib/japanese/gdevdmpr.c
+++ /dev/null
@@ -1,881 +0,0 @@
-/* COPYRIGHT (C) 1990, 1992 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. */
-
-/* gdevdmpr.c
- *
- * Dot matrix printer driver for Ghostscript
- *
- * The first version written by ... K.Asayama Nov 1992
- * NEC PC-H98 high resolution mode supported by ... OkI Dec 1992
- * IBM PC AT/Compatible machines supported by ... hero.h Mar 1993
- * Modified for 386BSD by ... FKR Mar 1993
- * Modified for Ghostscript version 2.5.2 by ... K.Asayama Mar 1993
- * Modified for Ghostscript version 2.6.1 by ... K.Asayama Oct 1993
- * Modified for Ghostscript version 4.03 by ... K.Asayama May 1997
- */
-
-#include "gdevprn.h"
-#include "gp.h"
-#include "errors.h"
-#include "gsparam.h"
-#include "gsstate.h"
-#include "math_.h"
-#include "malloc_.h"
-
-/* include library header. */
-#include "dviprlib.h"
-
-extern FILE *lib_fopen(const char *);
-
-#define LOCAL_DEBUG 0
-
-#define DEVICE_NAME "dmprt"
-#define DEVICE_VERSION 201 /* 2.01 */
-
-typedef struct gx_device_dmprt_local_s gx_device_dmprt_local;
-struct gx_device_dmprt_local_s {
- int orig_x_dpi;
- int orig_y_dpi;
-
- int x_offset;
- int y_offset;
-
- int spec_width;
- int spec_height;
- int max_width;
- int max_height;
- int dev_margin[4]; /* left bottom right top */
-
- int prtcfg_init_f;
- int verbose_f;
- int debug_f;
- dviprt_cfg_t prtcfg;
- dviprt_print prtinfo;
-};
-
-/* declaration of the structure to describe `DMPRT' device driver */
-typedef struct gx_device_dmprt_s gx_device_dmprt;
-struct gx_device_dmprt_s {
- gx_device_common;
- gx_prn_device_common;
-
- gx_device_dmprt_local dmprt;
-};
-
-/* declarations of main functions */
-private dev_proc_get_params(gdev_dmprt_get_params);
-private dev_proc_put_params(gdev_dmprt_put_params);
-private dev_proc_get_initial_matrix(gdev_dmprt_get_initial_matrix);
-private dev_proc_open_device(gdev_dmprt_open);
-private dev_proc_print_page(gdev_dmprt_print_page);
-private dev_proc_close_device(gdev_dmprt_close);
-
-/* declarations of sub functions to get printer properties. */
-private void gdev_dmprt_init_printer_props(gx_device_dmprt *);
-private int gdev_dmprt_get_printer_props(gx_device_dmprt *,char *);
-private int gdev_dmprt_check_code_props(byte * ,int );
-private FILE *gdev_dmprt_dviprt_lib_fopen(const char *,char *);
-
-private int gdev_dmprt_error_no_dviprt_to_gs(int );
-
-/* The device descriptor */
-gx_device_procs prn_dmprt_procs = {
- gdev_dmprt_open,
- gdev_dmprt_get_initial_matrix,
- 0, /* sync_output */
- gdev_prn_output_page,
- gdev_dmprt_close,
- gdev_prn_map_rgb_color,
- gdev_prn_map_color_rgb,
- 0, /* fill_rectangle */
- 0, /* tile_rectangle */
- 0, /* copy_mono */
- 0, /* copy_color */
- 0, /* draw_line */
- 0, /* get_bits */
- gdev_dmprt_get_params,
- gdev_dmprt_put_params,
- gx_default_map_cmyk_color,
- 0,
-};
-
-#define DEFAULT_DPI 180
-#define DEFAULT_WIDTH 8.3
-#define DEFAULT_HEIGHT 11.7
-
-gx_device_dmprt gs_dmprt_device = {
- prn_device_body(gx_device_dmprt, prn_dmprt_procs, DEVICE_NAME,
- DEFAULT_WIDTH*10, /* width 10'th */
- DEFAULT_HEIGHT*10, /* height 10'th */
- DEFAULT_DPI, /* X resolution */
- DEFAULT_DPI, /* Y resolution */
- 0,0,0,0, /* margins (top,left,bottom,right) */
- 1,1,1,1,2,2, /* color info. */
- gdev_dmprt_print_page),
-
- {
- DEFAULT_DPI, DEFAULT_DPI,
- 0, 0, /* offset */
- DEFAULT_DPI*DEFAULT_WIDTH, /* specified width */
- DEFAULT_DPI*DEFAULT_HEIGHT, /* specified height */
- -1,-1, /* maximal width,height */
- { 0,0,0,0 }, /* margins */
-
- /* status of the device */
- 0, /* printer configuration is not initialized */
- 0, /* verbose mode */
- 0, /* debug flag */
- },
-};
-
-#define ppdev ((gx_device_printer *)pdev)
-#define pddev ((gx_device_dmprt *)pdev)
-
-
-typedef struct {
- char *name;
- int no;
-} dmprt_encoding;
-private dmprt_encoding gdev_dmprt_encode_list[] = {
- {"Null",CFG_ENCODE_NULL},
- {"AsciiHex",CFG_ENCODE_HEX },
- {"CCITTFax",CFG_ENCODE_FAX },
- {"PCLMode1Compress",CFG_ENCODE_PCL1 },
- {"PCLMode2Compress",CFG_ENCODE_PCL2 },
- {0},
-};
-
-
-/* --- Get properties of printer device. --- */
-private int gdev_dmprt_get_dmprt_params(gx_device *pdev, gs_param_list *plist);
-private int
-gdev_dmprt_get_dviprt_params(gx_device *pdev, gs_param_list *plist);
-
-private int
-gdev_dmprt_get_params(gx_device *pdev, gs_param_list *plist)
-{
- int code;
- gs_param_dict dict;
- const char *param_name;
-
- if (!pddev->dmprt.prtcfg_init_f)
- gdev_dmprt_init_printer_props(pddev);
-
- dict.size = 30;
- code = param_begin_write_dict(plist, (param_name = "DmprtParams"),
- &dict, false);
- if (code < 0) return code;
- if (code == 0) {
- code = gdev_dmprt_get_dmprt_params(pdev, dict.list);
- param_end_write_dict(plist, param_name, &dict);
- if (code < 0) return code;
- }
-
- dict.size = 30;
- code = param_begin_write_dict(plist, (param_name = "DviprtParams"),
- &dict, false);
- if (code < 0) return code;
- if (code == 0) {
- code = gdev_dmprt_get_dviprt_params(pdev, dict.list);
- param_end_write_dict(plist, param_name, &dict);
- if (code < 0) return code;
- }
-
- {
- int w = pddev->width;
- int h = pddev->height;
- pddev->width = pddev->dmprt.spec_width;
- pddev->height = pddev->dmprt.spec_height;
- code = gdev_prn_get_params(pdev, plist);
- pddev->width = w;
- pddev->height = h;
- }
-
- return code;
-}
-
-/* internal routines for get_params */
-private int
-gdev_dmprt_get_dmprt_params(gx_device *pdev, gs_param_list *plist)
-{
- int code;
- long vlong;
- bool vbool;
- gs_param_int_array vaint;
- int int_data[4];
-
- vlong = DEVICE_VERSION;
- code = param_write_long(plist, "Version", &vlong);
- if (code < 0) return code;
-
- vbool = pddev->dmprt.debug_f;
- code = param_write_bool(plist, "Debug", &vbool);
- if (code < 0) return code;
-
- vbool = pddev->dmprt.verbose_f;
- code = param_write_bool(plist, "Verbose", &vbool);
- if (code < 0) return code;
-
- vaint.size = 2;
- vaint.data = int_data;
- vaint.persistent = false;
- int_data[0] = pddev->dmprt.max_width;
- int_data[1] = pddev->dmprt.max_height;
- code = param_write_int_array(plist, "MaxSize", &vaint);
- if (code < 0) return code;
-
- vaint.size = 2;
- vaint.data = int_data;
- vaint.persistent = false;
- int_data[0] = pddev->dmprt.x_offset;
- int_data[1] = pddev->dmprt.y_offset;
- code = param_write_int_array(plist, "Offsets", &vaint);
- if (code < 0) return code;
-
- vaint.size = 4;
- vaint.data = int_data;
- vaint.persistent = false;
- { int i;
- for (i=0;i<4;i++) int_data[i] = pddev->dmprt.dev_margin[i];
- }
- code = param_write_int_array(plist, "Margins", &vaint);
- if (code < 0) return code;
-
- return code;
-}
-
-private int
-gdev_dmprt_get_dviprt_params(gx_device *pdev, gs_param_list *plist)
-{
- dviprt_cfg_t *pprt = &pddev->dmprt.prtcfg;
- long vlong;
- bool vbool;
- gs_param_string vstr;
- const char *vchar;
- int code;
- int i;
-
- vlong = pprt->integer[CFG_PINS] * 8;
- code = param_write_long(plist,"Pins", &vlong);
- if (code < 0) return code;
- code = param_write_long(plist, "MinimalUnit",
- pprt->integer+CFG_MINIMAL_UNIT);
- if (code < 0) return code;
- code = param_write_long(plist,"MaximalUnit",
- pprt->integer+CFG_MAXIMAL_UNIT);
- if (code < 0) return code;
- code = param_write_int(plist,"HDpi" , &pddev->dmprt.orig_x_dpi);
- if (code < 0) return code;
- code = param_write_int(plist,"VDpi", &pddev->dmprt.orig_y_dpi);
- if (code < 0) return code;
- code = param_write_long(plist,"Constant", pprt->integer+CFG_CONSTANT);
- if (code < 0) return code;
-
- vbool = pprt->integer[CFG_UPPER_POS] & CFG_NON_TRANSPOSE_BIT ? 0 : 1;
- code = param_write_bool(plist,"Transpose", &vbool);
- if (code < 0) return code;
- vbool = pprt->integer[CFG_UPPER_POS] & CFG_REVERSE_BIT ? 1 : 0;
- code = param_write_bool(plist,"Reverse", &vbool);
- if (code < 0) return code;
- vbool = (pprt->integer[CFG_UPPER_POS] & CFG_NON_MOVING) ? 1 : 0;
- code = param_write_bool(plist,"NonMoving", &vbool);
- if (code < 0) return code;
-
- vchar = pprt->strings[CFG_NAME] ? (const char*)pprt->strings[CFG_NAME] : "";
- param_string_from_string(vstr, vchar);
- code = param_write_string(plist, "Name", &vstr);
- if (code < 0) return code;
-
- for (i=0;gdev_dmprt_encode_list[i].name;i++) {
- if (pprt->integer[CFG_ENCODE] == gdev_dmprt_encode_list[i].no)
- break;
- }
- if (gdev_dmprt_encode_list[i].name == 0) i = 0;
- param_string_from_string(vstr, gdev_dmprt_encode_list[i].name);
- code = param_write_string(plist, "Encoding", &vstr);
- if (code < 0) return code;
-
-#define param_string_from_prt(ps, pprt, n) \
- ((ps).data = pprt->prtcode[n] ? pprt->prtcode[n] : (const byte*)"", \
- (ps).size = pprt->prtcode[n] ? pprt->prtcode_size[n] : 0, \
- (ps).persistent = true)
-#define param_write_prt(plist, name, pprt, n) \
- (param_string_from_prt(vstr, pprt, n), \
- param_write_string(plist, name, &vstr))
-
- code = param_write_prt(plist, "BitImageMode",
- pprt, CFG_BIT_IMAGE_MODE);
- if (code < 0) return code;
- code = param_write_prt(plist, "SendBitImage",
- pprt, CFG_SEND_BIT_IMAGE);
- if (code < 0) return code;
- code = param_write_prt(plist, "BitRowHeader",
- pprt, CFG_BIT_ROW_HEADER);
- if (code < 0) return code;
- code = param_write_prt(plist, "AfterBitImage",
- pprt, CFG_AFTER_BIT_IMAGE);
- if (code < 0) return code;
- code = param_write_prt(plist, "LineFeed", pprt, CFG_LINE_FEED);
- if (code < 0) return code;
- code = param_write_prt(plist, "FormFeed", pprt, CFG_FORM_FEED);
- if (code < 0) return code;
- code = param_write_prt(plist, "NormalMode", pprt, CFG_NORMAL_MODE);
- if (code < 0) return code;
- code = param_write_prt(plist, "SkipSpaces", pprt, CFG_SKIP_SPACES);
- if (code < 0) return code;
-
- return code;
-}
-/* end of internal routines for get_params */
-
-
-/* --- Put properties of printer device. --- */
-private int gdev_dmprt_put_dmprt_params(gx_device *pdev, gs_param_list *plist);
-private int
-gdev_dmprt_put_dviprt_params(gx_device *pdev, gs_param_list *plist);
-private int gdev_dmprt_put_prt_code_param(gs_param_list *plist,
- dviprt_cfg_t *pprt,
- const char* name, int idx);
-private int
-gdev_dmprt_put_prt_string_param(gs_param_list *plist,
- dviprt_cfg_t *pprt, const char* name, int idx);
-
-private int
-gdev_dmprt_put_params(gx_device *pdev, gs_param_list *plist)
-{
- int code = 0;
- const char *param_name;
- gs_param_dict dict;
-
- if (!pddev->dmprt.prtcfg_init_f)
- gdev_dmprt_init_printer_props(pddev);
-
- /* dmprt parameters */
- code = param_begin_read_dict(plist, (param_name = "DmprtParams"),
- &dict, false);
- if (code < 0) return code;
- if (code == 0) {
- code = gdev_dmprt_put_dmprt_params(pdev, dict.list);
- param_end_read_dict(plist, param_name, &dict);
- if (code < 0) return code;
- }
-
- /* dviprt parameters */
- code = param_begin_read_dict(plist, (param_name = "DviprtParams"),
- &dict, false);
- if (code < 0) return code;
- if (code == 0) {
- code = gdev_dmprt_put_dviprt_params(pdev, dict.list);
- param_end_read_dict(plist, param_name, &dict);
- if (code < 0) return code;
- }
-
- if (pdev->is_open && code) {
- int ccode = gs_closedevice(pdev);
- if (ccode < 0) return ccode;
- }
-
- pddev->width = pddev->dmprt.spec_width;
- pddev->height = pddev->dmprt.spec_height;
- code = gdev_prn_put_params(pdev, plist);
- pddev->dmprt.spec_width = pddev->width;
- pddev->dmprt.spec_height = pddev->height;
- pddev->width -= (pddev->dmprt.dev_margin[0] + pddev->dmprt.dev_margin[2]);
- pddev->height -= (pddev->dmprt.dev_margin[1] + pddev->dmprt.dev_margin[3]);
- if (code < 0) return code;
-
- if (pddev->dmprt.max_width>0 && pddev->dmprt.max_width<pddev->width)
- pddev->width = pddev->dmprt.max_width;
- if (pddev->dmprt.max_height>0 && pddev->dmprt.max_height<pddev->height)
- pddev->height = pddev->dmprt.max_height;
-
- dviprt_setmessagestream(pddev->dmprt.debug_f ? stderr : NULL);
-
- return code;
-}
-
-/* internal routines for put_params */
-
-private int
-gdev_dmprt_put_dmprt_params(gx_device *pdev, gs_param_list *plist)
-{
- int code;
- long vlong;
- bool vbool;
- gs_param_int_array vaint;
-
- /* debug flag */
- code = param_read_bool(plist, "Debug", &vbool);
- if (code < 0) return code;
- if (code == 0) pddev->dmprt.debug_f = vbool;
-
- dviprt_setmessagestream(pddev->dmprt.debug_f ? stderr : NULL);
-
- code = param_read_bool(plist, "Verbose", &vbool);
- if (code < 0) return code;
- pddev->dmprt.verbose_f = vbool;
-
- /* dummy */
- code = param_read_long(plist, "Version", &vlong);
- if (code < 0) return code;
-
- code = param_read_int_array(plist, "MaxSize", &vaint);
- if (code < 0) return code;
- if (code == 0) {
- if (vaint.size != 2) return e_typecheck;
- pddev->dmprt.max_width = vaint.data[0];
- pddev->dmprt.max_height = vaint.data[1];
- }
-
- code = param_read_int_array(plist, "Offsets", &vaint);
- if (code < 0) return code;
- if (code == 0) {
- if (vaint.size != 2) return e_typecheck;
- pddev->dmprt.x_offset = vaint.data[0];
- pddev->dmprt.y_offset = vaint.data[1];
- }
-
- code = param_read_int_array(plist, "Margins", &vaint);
- if (code < 0) return code;
- if (code == 0) {
- int i;
- if (vaint.size != 4) return e_typecheck;
- for (i=0;i<4;i++) pddev->dmprt.dev_margin[i] = vaint.data[i];
- }
-
- return code;
-}
-
-private int
-gdev_dmprt_put_dviprt_params(gx_device *pdev, gs_param_list *plist)
-{
- int code;
- dviprt_cfg_t *pprt = &pddev->dmprt.prtcfg;
- gs_param_string vstr;
- long vlong;
- bool vbool;
-
- /* load .cfg/.src file */
- code = param_read_string(plist, "FileName", &vstr);
- if (code < 0) return code;
- if (code == 0) {
- char *filename = gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), vstr.size + 1, 1,
- "gdev_dmprt_put_props(filename)");
- int ccode;
- if (filename == 0) return e_VMerror;
- strncpy(filename, (const char*)vstr.data, vstr.size);
- filename[vstr.size] = '\0';
- ccode = gdev_dmprt_get_printer_props(pddev,filename);
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), filename, vstr.size+1, 1, "gdev_dmprt_put_props(filename)");
- if (ccode < 0) return ccode;
- }
-
- code = param_read_long(plist, "Pins", &vlong);
- if (code < 0) return code;
- if (code == 0) pprt->integer[CFG_PINS] = vlong / 8;
-
- code = param_read_long(plist, "MinimalUnit", &vlong);
- if (code < 0) return code;
- if (code == 0) pprt->integer[CFG_MINIMAL_UNIT] = vlong;
-
- code = param_read_long(plist, "MaximalUnit", &vlong);
- if (code < 0) return code;
- if (code == 0) pprt->integer[CFG_MAXIMAL_UNIT] = vlong;
-
- code = param_read_long(plist, "HDpi", &vlong);
- if (code < 0) return code;
- if (code == 0) pddev->dmprt.orig_x_dpi = vlong;
-
- code = param_read_long(plist, "VDpi", &vlong);
- if (code < 0) return code;
- if (code == 0) pddev->dmprt.orig_y_dpi = vlong;
-
- code = param_read_long(plist, "Constant", &vlong);
- if (code < 0) return code;
- if (code == 0) pprt->integer[CFG_CONSTANT] = vlong;
-
- {
- long tr = pprt->integer[CFG_UPPER_POS] & CFG_NON_TRANSPOSE_BIT;
- long rv = pprt->integer[CFG_UPPER_POS] & CFG_REVERSE_BIT;
- long nm = pprt->integer[CFG_UPPER_POS] & CFG_NON_MOVING;
- param_read_bool(plist,"Transpose", &vbool);
- if (code < 0) return code;
- if (code == 0) tr = vbool ? 0 : CFG_NON_TRANSPOSE_BIT;
- param_read_bool(plist,"Reverse", &vbool);
- if (code < 0) return code;
- if (code == 0) rv = vbool ? CFG_REVERSE_BIT : 0;
- param_read_bool(plist,"NonMoving", &vbool);
- if (code < 0) return code;
- if (code == 0) nm = vbool ? CFG_NON_MOVING : 0;
- pprt->integer[CFG_UPPER_POS] = tr | rv | nm;
- }
-
- code = gdev_dmprt_put_prt_code_param(plist, pprt, "BitImageMode",
- CFG_BIT_IMAGE_MODE);
- if (code < 0) return code;
- code = gdev_dmprt_put_prt_code_param(plist, pprt, "SendBitImage",
- CFG_SEND_BIT_IMAGE);
- if (code < 0) return code;
- code = gdev_dmprt_put_prt_code_param(plist, pprt, "BitRowHeader",
- CFG_BIT_ROW_HEADER);
- if (code < 0) return code;
- code = gdev_dmprt_put_prt_code_param(plist, pprt, "AfterBitImage",
- CFG_AFTER_BIT_IMAGE);
- if (code < 0) return code;
- code = gdev_dmprt_put_prt_code_param(plist, pprt, "LineFeed",
- CFG_LINE_FEED);
- if (code < 0) return code;
- code = gdev_dmprt_put_prt_code_param(plist, pprt, "FormFeed",
- CFG_FORM_FEED);
- if (code < 0) return code;
- code = gdev_dmprt_put_prt_code_param(plist, pprt, "NormalMode",
- CFG_NORMAL_MODE);
- if (code < 0) return code;
- code = gdev_dmprt_put_prt_code_param(plist, pprt, "SkipSpaces",
- CFG_SKIP_SPACES);
- if (code < 0) return code;
-
- code = gdev_dmprt_put_prt_string_param(plist, pprt, "Name",
- CFG_NAME);
- if (code < 0) return code;
-
- code = param_read_string(plist, "Encoding", &vstr);
- if (code < 0) return code;
- if (code == 0) {
- int i;
- for (i=0; gdev_dmprt_encode_list[i].name ; i++) {
- if (strlen(gdev_dmprt_encode_list[i].name) == vstr.size) {
- if (strncmp(gdev_dmprt_encode_list[i].name,
- vstr.data, vstr.size) == 0) {
- pprt->integer[CFG_ENCODE] = gdev_dmprt_encode_list[i].no;
- break;
- }
- }
- }
- if (gdev_dmprt_encode_list[i].name == 0)
- return e_rangecheck;
- }
-
- return code;
-}
-
-private int
-gdev_dmprt_put_prt_code_param(gs_param_list *plist,
- dviprt_cfg_t *pprt, const char* name, int idx)
-{
- gs_param_string vstr;
-
- int code = param_read_string(plist, name, &vstr);
- if (code == 0) {
- int ccode = gdev_dmprt_check_code_props(vstr.data, vstr.size);
- byte *pbyte;
- if (ccode < 0) return e_rangecheck;
- pbyte = (byte *)malloc(vstr.size+1);
- if (pbyte == 0) return e_VMerror;
- memcpy(pbyte, vstr.data, vstr.size);
- pbyte[vstr.size] = 0;
- pprt->prtcode[idx] = pbyte;
- pprt->prtcode_size[idx] = vstr.size;
- if (code == 0) code = 1;
- }
- return code;
-}
-
-private int
-gdev_dmprt_put_prt_string_param(gs_param_list *plist,
- dviprt_cfg_t *pprt, const char* name, int idx)
-{
- gs_param_string vstr;
-
- int code = param_read_string(plist, name, &vstr);
- if (code == 0) {
- byte *pbyte;
- pbyte = (byte *)malloc(vstr.size+1);
- if (pbyte == 0) return e_VMerror;
- memcpy(pbyte, vstr.data, vstr.size);
- pbyte[vstr.size] = 0;
- pprt->strings[idx] = pbyte;
- if (code == 0) code = 1;
- }
- return code;
-}
-/* end of internal routines for put_params */
-
-
-/* --- Get initial matrix. --- */
-private void
-gdev_dmprt_get_initial_matrix(gx_device *pdev, gs_matrix *pmat)
-{
- gx_default_get_initial_matrix(pdev,pmat);
- pmat->tx += (pddev->dmprt.x_offset - pddev->dmprt.dev_margin[0]);
- pmat->ty += (pddev->dmprt.y_offset + pddev->dmprt.dev_margin[3]);
-}
-
-/* --- Open printer device. --- */
-private int
-gdev_dmprt_open(gx_device *pdev)
-{
- int code;
- dviprt_cfg_t *pcfg;
- dviprt_print *pprint;
-
- pprint = &pddev->dmprt.prtinfo;
- pcfg = &pddev->dmprt.prtcfg;
-
- if ((code = gdev_prn_open(pdev)) < 0)
- return code;
- pcfg->integer[CFG_DPI] = (int)ppdev->x_pixels_per_inch;
- pcfg->integer[CFG_Y_DPI] = (int)ppdev->y_pixels_per_inch;
- code = dviprt_initlibrary(pprint,pcfg,gdev_prn_raster(pdev),pdev->height);
- if (code < 0) return gdev_dmprt_error_no_dviprt_to_gs(code);
- code = dviprt_setbuffer(pprint,NULL);
- if (code < 0) return gdev_dmprt_error_no_dviprt_to_gs(code);
-
- return 0;
-}
-
-/* --- Close printer device. --- */
-private int
-gdev_dmprt_close(gx_device *pdev)
-{
- int code;
- dviprt_print *pprint;
-
- pprint = &pddev->dmprt.prtinfo;
-
- if (!strchr(pddev->fname,'%')) {
- code = dviprt_endbitmap(pprint);
- if (code < 0) return gdev_dmprt_error_no_dviprt_to_gs(code);
- }
- if (pddev->dmprt.verbose_f && pddev->PageCount>0) {
- eprintf2("%s: Total %lu bytes output.\n",
- pddev->dname,dviprt_getoutputbytes(pprint));
- }
- code = dviprt_unsetbuffer(pprint);
- if (code < 0) return gdev_dmprt_error_no_dviprt_to_gs(code);
- return gdev_prn_close(pdev);
-}
-
-/* Output the PAGE. */
-private int
-gdev_dmprt_print_page(gx_device_printer *pdev, FILE *prn_stream)
-{
- int code = 0;
- dviprt_print *pprint = &pddev->dmprt.prtinfo;
- int line_size = gdev_prn_raster((gx_device *)pdev);
- int pins = dviprt_getscanlines(pprint);
- int i_buf_size = pins * line_size;
- int lnum = 0;
- ulong prev_bytes;
- byte *in;
-
- /* get work buffer */
- in = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), 1, i_buf_size ,"gdev_dmprt_print_page(in)");
- if ( in == 0 )
- return e_VMerror;
-
- /* Initialize this printer driver */
- if (pdev->file_is_new) {
- code = dviprt_setstream(pprint,NULL,prn_stream);
- if (code < 0) return gdev_dmprt_error_no_dviprt_to_gs(code);
- }
- if (pddev->dmprt.verbose_f) {
- if (pddev->PageCount == 1)
- eprintf2("%s: %s\n", pddev->dname, pddev->dmprt.prtcfg.strings[CFG_NAME]);
- eprintf2("%s: [%ld]",pddev->dname, pddev->PageCount);
- }
- prev_bytes = dviprt_getoutputbytes(pprint);
- code = dviprt_beginpage(pprint);
- if (code < 0) return gdev_dmprt_error_no_dviprt_to_gs(code);
-
- /* Transfer pixels to printer */
- while ( lnum < pdev->height ) {
- int num_lines;
-
- num_lines = pdev->height-lnum;
- if (num_lines > pins)
- num_lines = pins;
-
- code = gdev_prn_copy_scan_lines(pdev,lnum,in,line_size*num_lines);
- if (code < 0) goto error_ex;
-
- lnum += num_lines;
- if (num_lines < pins) {
- memset(in+line_size*num_lines,0,line_size*(pins-num_lines));
- }
-
- code = dviprt_outputscanlines(pprint,in);
- if (code < 0) {
- code = gdev_dmprt_error_no_dviprt_to_gs(code);
- goto error_ex;
- }
- }
-
- /* Eject the page and set printer normal mode. */
- if (strchr(pdev->fname,'%')) {
- code = dviprt_endbitmap(pprint);
- if (code < 0) return gdev_dmprt_error_no_dviprt_to_gs(code);
- }
- fflush(pddev->file);
- if (pddev->dmprt.verbose_f) {
- eprintf1(" %lu bytes\n",dviprt_getoutputbytes(pprint)-prev_bytes);
- }
-error_ex:
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)in, 1, i_buf_size,"gdev_dmprt_print_page(in)");
-
- return code;
-}
-
-
-/************************** Internal Routines **************************/
-
-/************************ Get printer properties. ***********************/
-private int
-gdev_dmprt_check_code_props(byte *str,int len)
-{
- byte *end = str+len;
- while (str < end) {
- byte fmt = *str++;
- if (fmt & CFG_FMT_BIT) {
- int s = *str++;
- str += s;
- if (str > end) return e_rangecheck;
- if ((fmt & CFG_FMT_FORMAT_BIT) == CFG_FMT_STRINGS) {
- s = *str++;
- str += s;
- if (str > end) return e_rangecheck;
- }
- }
- else {
- str += fmt;
- if (str > end) return e_rangecheck;
- }
- }
- return str == end ? 0 : e_rangecheck;
-}
-
-private void
-gdev_dmprt_init_printer_props(gx_device_dmprt *pdev)
-{
- dviprt_cfg_t *pprt;
- int i;
-
- pprt = &pdev->dmprt.prtcfg;
-
- for (i=0;i<CFG_INTEGER_TYPE_COUNT;i++)
- pprt->integer[i] = 0;
- for (i=0;i<CFG_STRINGS_TYPE_COUNT;i++)
- pprt->strings[i] = 0;
- for (i=0;i<CFG_PRTCODE_TYPE_COUNT;i++) {
- pprt->prtcode[i] = 0;
- pprt->prtcode_size[i] = 0;
- }
- pdev->dmprt.prtcfg_init_f = 1;
-}
-
-private int
-gdev_dmprt_get_printer_props(gx_device_dmprt *pdev,char *fnamebase)
-{
- int code;
- FILE *fp;
- dviprt_cfg_t cfg;
- char *fname;
-
- fname = gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), 256,1,"dviprt_lib_fname");
- if (fname == NULL) return e_VMerror;
-
- fp = gdev_dmprt_dviprt_lib_fopen(fnamebase,fname);
- if (fp == NULL) {
- return e_undefinedfilename;
- }
- if (fseek(fp,18,0) < 0)
- return e_ioerror;
- code = fgetc(fp);
- fclose(fp);
-
- if (code == EOF)
- code = e_ioerror;
- else if (code == 0xff) {
- code = dviprt_readcfg(fname,&cfg,NULL,0,NULL,0);
- }
- else {
- code = dviprt_readsrc(fname,&cfg,NULL,0,NULL,0);
- }
-
- if (code < 0) {
- code = gdev_dmprt_error_no_dviprt_to_gs(code);
- }
- else { /* success */
- memcpy(&pdev->dmprt.prtcfg,&cfg,sizeof(dviprt_cfg_t));
- pddev->dmprt.orig_x_dpi = cfg.integer[CFG_DPI];
- pddev->dmprt.orig_y_dpi =
- cfg.integer[CFG_Y_DPI] > 0 ? cfg.integer[CFG_Y_DPI] : pddev->dmprt.orig_x_dpi;
- }
-
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), fname,256,1,"dviprt_lib_fname");
-
- return code;
-}
-
-private const char * gp_file_name_concat_string(const char *, unsigned);
-private FILE *
-gdev_dmprt_dviprt_lib_fopen(const char *fnamebase,char *fname)
-{
- FILE *fp;
- char *env;
-
- strcpy(fname,fnamebase);
- fp = lib_fopen(fname);
- if (fp == NULL) {
- env = getenv("TEXCFG");
- if (env) {
- strcpy(fname,env);
- strcat(fname, gp_file_name_concat_string(env,strlen(env)));
- strcat(fname,fnamebase);
- fp = fopen(fname,gp_fmode_rb);
- }
- }
- return fp;
-}
-
-/* Misc. */
-private int
-gdev_dmprt_error_no_dviprt_to_gs(int code)
-{
- switch (code) {
- case CFG_ERROR_MEMORY:
- return e_VMerror;
- case CFG_ERROR_FILE_OPEN:
- case CFG_ERROR_OUTPUT:
- return e_ioerror;
- default:
- return -1;
- }
-}
-
-/* Answer the string to be used for combining a directory/device prefix */
-/* with a base file name. The prefix directory/device is examined to */
-/* determine if a separator is needed and may return an empty string */
-private const char *
-gp_file_name_concat_string(const char *prefix, unsigned plen)
-{
- if (plen > 0 && prefix[plen - 1] == '/')
- return "";
- return "/";
-}
diff --git a/gs/contrib/japanese/gdevespg.c b/gs/contrib/japanese/gdevespg.c
deleted file mode 100644
index 7374099c2..000000000
--- a/gs/contrib/japanese/gdevespg.c
+++ /dev/null
@@ -1,301 +0,0 @@
-/* Copyright (C) 1999 Norihito Ohmori.
-
- Ghostscript driver for EPSON ESC/Page printer.
-
- This software 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 GNU General Public License for full details.
-
- Everyone is granted permission to copy, modify and redistribute
- this software, but only under the conditions described in the GNU
- General Public License. A copy of this license is supposed to have been
- given to you along with this software 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.
- */
-
-/*$Id: gdevespg.c $ */
-/* EPSON ESC/Page driver for Ghostscript */
-
-/*
- Main part of this driver is taked from Hiroshi Narimatsu's
- Ghostscript driver, epag-3.08.
- <ftp://ftp.humblesoft.com/pub/epag-3.08.tar.gz>
- */
-
-#include "gdevlprn.h"
-#include "gdevlips.h"
-
-#define DPI 300
-
-/* The device descriptors */
-private dev_proc_open_device(escpage_open);
-private dev_proc_open_device(lp2000_open);
-private dev_proc_close_device(escpage_close);
-private dev_proc_print_page_copies(escpage_print_page_copies);
-private dev_proc_print_page_copies(lp2000_print_page_copies);
-private dev_proc_image_out(escpage_image_out);
-
-private void escpage_printer_initialize(gx_device_printer * pdev, FILE * fp, int);
-private void escpage_paper_set(gx_device_printer * pdev, FILE * fp);
-
-private gx_device_procs lp2000_prn_procs =
-lprn_procs(lp2000_open, gdev_prn_output_page, gdev_prn_close);
-
-private gx_device_procs escpage_prn_procs =
-lprn_procs(escpage_open, gdev_prn_output_page, escpage_close);
-
-gx_device_lprn far_data gs_lp2000_device =
-lprn_device(gx_device_lprn, lp2000_prn_procs, "lp2000",
- DPI, DPI, 0.0, 0.0, 0.0, 0.0, 1,
- lp2000_print_page_copies, escpage_image_out);
-
-gx_device_lprn far_data gs_escpage_device =
-lprn_duplex_device(gx_device_lprn, escpage_prn_procs, "escpage",
- DPI, DPI, 0.0, 0.0, 0.0, 0.0, 1,
- escpage_print_page_copies, escpage_image_out);
-
-#define ppdev ((gx_device_printer *)pdev)
-
-static char *epson_remote_start = "\033\001@EJL \r\n";
-
-/* Open the printer. */
-private int
-escpage_open(gx_device * pdev)
-{
- int xdpi = pdev->x_pixels_per_inch;
- int ydpi = pdev->y_pixels_per_inch;
-
- /* Resolution Check */
- if (xdpi != ydpi)
- return_error(gs_error_rangecheck);
- if (xdpi < 60 || xdpi > 600)
- return_error(gs_error_rangecheck);
-
- return gdev_prn_open(pdev);
-}
-
-private int
-lp2000_open(gx_device * pdev)
-{
- int xdpi = pdev->x_pixels_per_inch;
- int ydpi = pdev->y_pixels_per_inch;
-
- /* Resolution Check */
- if (xdpi != ydpi)
- return_error(gs_error_rangecheck);
- if (xdpi < 60 || xdpi > 300)
- return_error(gs_error_rangecheck);
-
- return gdev_prn_open(pdev);
-}
-
-private int
-escpage_close(gx_device * pdev)
-{
- gdev_prn_open_printer(pdev, 1);
- if (ppdev->Duplex && (pdev->PageCount & 1)) {
- fprintf(ppdev->file, "%c0dpsE", GS);
- }
- fputs(epson_remote_start, ppdev->file);
- fputs(epson_remote_start, ppdev->file);
- return gdev_prn_close(pdev);
-}
-
-private int
-escpage_print_page_copies(gx_device_printer * pdev, FILE * fp, int num_coipes)
-{
- gx_device_lprn *const lprn = (gx_device_lprn *) pdev;
-
- if (pdev->PageCount == 0) {
- double xDpi = pdev->x_pixels_per_inch;
-
- /* Goto REMOTE MODE */
- fputs(epson_remote_start, fp);
- fprintf(fp, "@EJL SELECT LANGUAGE=ESC/PAGE\r\n");
-
- /* RIT (Resolution Improvement Technology) Setting */
- if (lprn->RITOff)
- fprintf(fp, "@EJL SET RI=OFF\r\n");
- else
- fprintf(fp, "@EJL SET RI=ON\r\n");
-
- /* Resolution Setting */
- fprintf(fp, "@EJL SET RS=%s\r\n", xDpi > 300 ? "FN" : "QK");
- fprintf(fp, "@EJL ENTER LANGUAGE=ESC/PAGE\r\n");
- }
- return lp2000_print_page_copies(pdev, fp, num_coipes);
-}
-
-private int
-lp2000_print_page_copies(gx_device_printer * pdev, FILE * fp, int num_coipes)
-{
- gx_device_lprn *const lprn = (gx_device_lprn *) pdev;
- int code = 0;
- int bpl = gdev_mem_bytes_per_scan_line(pdev);
- int maxY = lprn->BlockLine / lprn->nBh * lprn->nBh;
-
- /* printer initialize */
- if (pdev->PageCount == 0)
- escpage_printer_initialize(pdev, fp, num_coipes);
-
- if (!(lprn->CompBuf = gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), bpl * 3 / 2 + 1, maxY, "lp2000_print_page_copies(CompBuf)")))
- return_error(gs_error_VMerror);
-
- if (lprn->NegativePrint) {
- fprintf(fp, "%c1dmG", GS);
- fprintf(fp, "%c0;0;%d;%d;0rG", GS, pdev->width, pdev->height);
- fprintf(fp, "%c2owE", GS);
- }
- code = lprn_print_image(pdev, fp);
- if (code < 0)
- return code;
-
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), lprn->CompBuf, bpl * 3 / 2 + 1, maxY, "lp2000_print_page_copies(CompBuf)");
-
- if (pdev->Duplex)
- fprintf(fp, "%c0dpsE", GS);
- else
- fprintf(fp, "\014"); /* eject page */
- return code;
-}
-
-/* Output data */
-private void
-escpage_image_out(gx_device_printer * pdev, FILE * fp, int x, int y, int width, int height)
-{
- gx_device_lprn *const lprn = (gx_device_lprn *) pdev;
- int Len;
-
- fprintf(fp, "%c%dY%c%dX", GS, y, GS, x);
-
- Len = lips_mode3format_encode(lprn->TmpBuf, lprn->CompBuf, width / 8 * height);
-
- fprintf(fp, "%c%d;%d;%d;0bi{I", GS, Len,
- width, height);
- fwrite(lprn->CompBuf, 1, Len, fp);
-
- if (lprn->ShowBubble) {
- fprintf(fp, "%c0dmG", GS);
- fprintf(fp, "%c%d;%d;%d;%d;0rG", GS,
- x, y, x + width, y + height);
- }
-}
-
-/* output printer initialize code */
-
-/* ------ Internal routines ------ */
-
-static char can_inits[] =
-{
- ESC, 'S', ESC, ESC, 'S', 034,
- ESC, 'z', 0, 0, /* Go to ESC/Page */
- GS, 'r', 'h', 'E', /* hard reset */
- GS, '1', 'm', 'm', 'E', /* Page Memory Mode (for LP-3000/7000/7000G) */
- GS, '3', 'b', 'c', 'I', /* Style of Compression */
- GS, '0', ';', '0', 'i', 'u', 'E', /* Paper Feed Unit (Auto) */
-};
-
-private void
-escpage_printer_initialize(gx_device_printer * pdev, FILE * fp, int copies)
-{
- gx_device_lprn *const lprn = (gx_device_lprn *) pdev;
- double xDpi, yDpi;
-
- xDpi = pdev->x_pixels_per_inch;
- yDpi = pdev->y_pixels_per_inch;
-
- /* Initialize */
- fwrite(can_inits, sizeof(can_inits), 1, fp);
- /* Duplex Setting */
- if (pdev->Duplex_set > 0) {
- if (pdev->Duplex) {
- fprintf(fp, "%c1sdE", GS);
- if (lprn->Tumble == 0)
- fprintf(fp, "%c0bdE", GS);
- else
- fprintf(fp, "%c1bdE", GS);
- } else
- fprintf(fp, "%c0sdE", GS);
- }
- /* Set the Size Unit */
- fprintf(fp, "%c0;%4.2fmuE", GS, 72.0 / xDpi);
- /* Set the Resolution */
- fprintf(fp, "%c0;%d;%ddrE", GS, (int)(xDpi + 0.5), (int)(yDpi + 0.5));
- /* Set the Paper Size */
- escpage_paper_set(pdev, fp);
- /* Set the desired number of Copies */
- fprintf(fp, "%c%dcoO", GS, copies < 256 ? copies : 255);
- /* Set the Position to (0, 0) */
- fprintf(fp, "%c0;0loE", GS);
-}
-
-typedef struct {
- int width; /* paper width (unit: point) */
- int height; /* paper height (unit: point) */
- int escpage; /* number of papersize in ESC/PAGE */
-} EpagPaperTable;
-
-static EpagPaperTable epagPaperTable[] =
-{
- {842, 1190, 13}, /* A3 */
- {595, 842, 14}, /* A4 */
- {597, 842, 14}, /* A4 (8.3x11.7 inch) */
- {421, 595, 15}, /* A5 */
- {297, 421, 16}, /* A6 */
- {729, 1032, 24}, /* B4 JIS */
- {516, 729, 25}, /* B5 JIS */
- {612, 792, 30}, /* Letter */
- {396, 612, 31}, /* Half Letter */
- {612, 1008, 32}, /* Legal */
- {522, 756, 33}, /* Executive */
- {612, 936, 34}, /* Government Legal */
- {576, 756, 35}, /* Government Letter */
- {792, 1224, 36}, /* Ledger */
- {593, 935, 37}, /* F4 */
- {284, 419, 38}, /* PostCard */
- {933, 1369, 72}, /* A3 NOBI */
- {279, 540, 80}, /* Monarch */
- {297, 684, 81}, /* Commercial 10 */
- {312, 624, 90}, /* DL */
- {459, 649, 91}, /* C5 */
- {0, 0, -1}, /* Undefined */
-};
-
-private void
-escpage_paper_set(gx_device_printer * pdev, FILE * fp)
-{
- int width, height, w, h, wp, hp, bLandscape;
- EpagPaperTable *pt;
-
- width = pdev->MediaSize[0];
- height = pdev->MediaSize[1];
-
- if (width < height) {
- bLandscape = 0;
- w = width;
- h = height;
- wp = width / 72.0 * pdev->x_pixels_per_inch;
- hp = height / 72.0 * pdev->y_pixels_per_inch;
- } else {
- bLandscape = 1;
- w = height;
- h = width;
- wp = height / 72.0 * pdev->y_pixels_per_inch;
- hp = width / 72.0 * pdev->x_pixels_per_inch;
- }
-
- for (pt = epagPaperTable; pt->escpage > 0; pt++)
- if (pt->width == w && pt->height == h)
- break;
-
- fprintf(fp, "%c%d", GS, pt->escpage);
- if (pt->escpage < 0)
- fprintf(fp, ";%d;%d", wp, hp);
- fprintf(fp, "psE");
-
- fprintf(fp, "%c%dpoE", GS, bLandscape);
-}
diff --git a/gs/contrib/japanese/gdevfmlbp.c b/gs/contrib/japanese/gdevfmlbp.c
deleted file mode 100644
index ff69f2b32..000000000
--- a/gs/contrib/japanese/gdevfmlbp.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/* Copyright (C) 1991 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. */
-
-/* gdevfmlbp.c */
-/* Fujitsu FMLBP2xx driver for Ghostscript */
-/*
- * Based on LBP-8II driver(gdevlbp8.c) and ESC/Page driver(gdevepag.c).
- * Modified for FMLBP by Kazushige Goto <goto@statabo.rim.or.jp> and
- * Shoichi Nakayama <naka@fadev.fvd.fujitsu.co.jp>.
- *
- * ver 0.9 1997/03/08 goto@statabo.rim.or.jp
- * -- Initial release.
- * ver 1.0 1997/12/24 naka@fadev.fvd.fujitsu.co.jp
- * -- Fixed bug.
- * ver 1.1 1998/03/12 naka@fadev.fvd.fujitsu.co.jp
- * -- Added 240dpi and paper size support.
- * ver 1.2 1998/03/30 naka@fadev.fvd.fujitsu.co.jp
- * -- Added adjust margin for gs261.
- */
-#include "gdevprn.h"
-
-#define X_DPI 400
-#define Y_DPI 400
-
-/* The device descriptors */
-private dev_proc_print_page(fmlbp_print_page);
-
-#ifdef FMLBP_NOADJUST_MARGIN
-#define PRNFMLBP prn_std_procs
-#else
-/* Adjust margin for ghostscript 2.6.1 */
-#define PRNFMLBP prn_fmlbp_procs
-private dev_proc_get_initial_matrix(fmlbp_get_initial_matrix);
-gx_device_procs prn_fmlbp_procs =
- prn_matrix_procs(gdev_prn_open, fmlbp_get_initial_matrix,
- gdev_prn_output_page, gdev_prn_close);
-
-/* Shift the origin from the top left corner of the pysical page to the
- first printable pixel, as defined by the top and left margins. */
-/* modified from gdevsppr.c. */
-private void
-fmlbp_get_initial_matrix(gx_device *dev, gs_matrix *pmat)
-{ gx_default_get_initial_matrix(dev, pmat);
- pmat->tx -= (dev->l_margin * dev->x_pixels_per_inch);
- pmat->ty -= (dev->t_margin * dev->y_pixels_per_inch);
-}
-#endif/*FMLBP_NOADJUST_MARGIN*/
-
-gx_device_printer gs_fmlbp_device =
- prn_device(PRNFMLBP, "fmlbp",
- DEFAULT_WIDTH_10THS_A4, /* width_10ths, 8.3" */
- DEFAULT_HEIGHT_10THS_A4, /* height_10ths, 11.7" */
- X_DPI, Y_DPI,
- 0.20, 0.35, 0.21, 0.20, /* left,bottom,right,top margins */
- 1, fmlbp_print_page);
-
-/* ------ Internal routines ------ */
-
-#define ESC 0x1b
-#define CEX 0x1c
-#define CSI 0x1b,0x5b
-#define PU1 0x1b,0x51
-
-static char can_inits[] ={ ESC, 'c', /* Software reset */
-#ifdef OLD_FMLBP_400DPI
- PU1, '4', '0', '0', '!', 'A' /* 400dpi */
-/*PU1, '0', ';','4', ';','0', ';','0','!','@' */ /* landscape */
-#endif/*OLD_FMLBP_400DPI*/
-};
-
-#ifdef FMLBP_NOPAPERSIZE
-#define LINE_SIZE ((4520+7) / 8) /* bytes per line */
-#else
-/* Paper sizes */
-#define PAPER_SIZE_A3 "0;3"
-#define PAPER_SIZE_A4 "0;4"
-#define PAPER_SIZE_A5 "0;5"
-#define PAPER_SIZE_B4 "1;4"
-#define PAPER_SIZE_B5 "1;5"
-#define PAPER_SIZE_LEGAL "2;0"
-#define PAPER_SIZE_LETTER "3;0"
-#define PAPER_SIZE_HAGAKI "4;0"
-
-/* Get the paper size code, based on width and height. */
-/* modified from gdevpcl.c, gdevmjc.c and gdevnpdl.c. */
-private char *
-gdev_fmlbp_paper_size(gx_device_printer *dev)
-{ static char paper[16];
- int landscape = 0; /* portrait */
- float height_inches = dev->height / dev->y_pixels_per_inch;
- float width_inches = dev->width / dev->x_pixels_per_inch;
-
- if (width_inches > height_inches){ /* landscape */
- float t = width_inches;
- width_inches = height_inches;
- height_inches = t;
- landscape = 1;
- }
- sprintf(paper, "%s;%d",
- (height_inches >= 15.9 ? PAPER_SIZE_A3 :
- height_inches >= 11.8 ?
- (width_inches >= 9.2 ? PAPER_SIZE_B4 : PAPER_SIZE_LEGAL) :
- height_inches >= 11.1 ? PAPER_SIZE_A4 :
- height_inches >= 10.4 ? PAPER_SIZE_LETTER :
- height_inches >= 9.2 ? PAPER_SIZE_B5 :
- height_inches >= 7.6 ? PAPER_SIZE_A5 : PAPER_SIZE_HAGAKI), landscape);
-#ifdef FMLBP_DEBUG
- fprintf(stderr, "w=%d(%f) x h=%d(%f) -> %s\n",
- dev->width, width_inches, dev->height, height_inches, paper);
-#endif/*FMLBP_DEBUG*/
- return paper;
-}
-#endif/*FMLBP_NOPAPERSIZE*/
-
-
-/* move down and move across */
-private void goto_xy(FILE *prn_stream,int x,int y)
- {
- unsigned char buff[20];
- unsigned char *p=buff;
-
- fputc(CEX,prn_stream);
- fputc('"',prn_stream);
- sprintf(buff,"%d",x);
- while (*p)
- {
- if (!*(p+1)) fputc((*p)+0x30,prn_stream);
- else
- fputc((*p)-0x10,prn_stream);
- p++;
- }
-
- p=buff;
- sprintf(buff,"%d",y);
- while (*p)
- {
- if (!*(p+1)) fputc((*p)+0x40,prn_stream);
- else
- fputc((*p)-0x10,prn_stream);
- p++;
- }
- }
-
-/* Send the page to the printer. */
-private int
-fmlbp_print_page(gx_device_printer *pdev, FILE *prn_stream)
-{
- int line_size = gdev_mem_bytes_per_scan_line((gx_device *)pdev);
-#ifdef FMLBP_NOPAPERSIZE
- char data[LINE_SIZE*2];
-#else
- byte *data = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), 1, line_size, "fmlpr_print_page(data)");
- if(data == NULL) return_error(gs_error_VMerror);
-#endif/*FMLBP_NOPAPERSIZE*/
-
- /* initialize */
- fwrite(can_inits, sizeof(can_inits), 1, prn_stream);
- fprintf(prn_stream, "%c%c%d!I", PU1, 0); /* 100% */
-#ifndef OLD_FMLBP_400DPI
- fprintf(prn_stream, "%c%c%d!A", PU1,
- (int)(pdev->x_pixels_per_inch)); /* 240dpi or 400dpi */
-#endif/*!OLD_FMLBP_400DPI*/
-#ifndef FMLBP_NOPAPERSIZE
- fprintf(prn_stream, "%c%c%s!F", PU1,
- gdev_fmlbp_paper_size(pdev)); /* Paper size */
-#endif/*!FMLBP_NOPAPERSIZE*/
-
- /* Send each scan line in turn */
- { int lnum;
- byte rmask = (byte)(0xff << (-pdev->width & 7));
-
- for ( lnum = 0; lnum < pdev->height; lnum++ )
- { byte *end_data = data + line_size;
- int s = gdev_prn_copy_scan_lines(pdev, lnum,
- (byte *)data, line_size);
- if(s < 0) return_error(s);
- /* Mask off 1-bits beyond the line width. */
- end_data[-1] &= rmask;
- /* Remove trailing 0s. */
- while ( end_data > data && end_data[-1] == 0 )
- end_data--;
- if ( end_data != data ) {
- int num_cols = 0;
- int out_count = 0;
- byte *out_data = data;
-
- while(out_data < end_data && *out_data == 0) {
- num_cols += 8;
- out_data++;
- }
- out_count = end_data - out_data;
-
- /* move down */ /* move across */
- goto_xy(prn_stream, num_cols, lnum);
-
- /* transfer raster graphics */
- fprintf(prn_stream, "%c%c%d;%d;0!a",
- PU1, out_count, out_count*8 );
-
- /* send the row */
- fwrite(out_data, sizeof(byte), out_count, prn_stream);
- }
- }
- }
- /* eject page */
- fputc(0x0c,prn_stream);
- fflush(prn_stream);
-#ifndef FMLBP_NOPAPERSIZE
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)data, line_size, sizeof(byte), "fmlbp_print_page(data)");
-#endif/*!FMLBP_NOPAPERSIZE*/
-
- return 0;
-}
diff --git a/gs/contrib/japanese/gdevfmpr.c b/gs/contrib/japanese/gdevfmpr.c
deleted file mode 100644
index 3563b5997..000000000
--- a/gs/contrib/japanese/gdevfmpr.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/* Copyright (C) 1990, 1992 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. */
-
-/* gdevfmpr.c */
-/* Fujitsu FMPR printer driver for Ghostscript */
-
-/* This derives from "gdevp201.c" programed by Norio KATAYAMA. */
-
-#include "gdevprn.h"
-
-private dev_proc_print_page(fmpr_print_page);
-
-#define A4
-
-/* The device descriptor */
-gx_device_printer gs_fmpr_device =
- prn_device(prn_std_procs, "fmpr",
- DEFAULT_WIDTH_10THS,
- DEFAULT_HEIGHT_10THS,
- 180, /* x_dpi */
- 180, /* y_dpi */
- 0, /* 0.35, */ /* left margins */
- 0, /* bottom margins */
- 0, /* 0.84, */ /* top margins */
- 0, /* right margins */
- 1, fmpr_print_page);
-
-/* ---- Printer output routines ---- */
-
-private int
-prn_putc(gx_device_printer *pdev, int c)
-{
- return fputc(c, pdev->file);
-}
-
-private int
-prn_puts(gx_device_printer *pdev, char *ptr)
-{
- return fputs(ptr, pdev->file);
-}
-
-private int
-prn_write(gx_device_printer *pdev, char *ptr, int size)
-{
- return fwrite(ptr, 1, size, pdev->file);
-}
-
-private int
-prn_flush(gx_device_printer *pdev)
-{
- return fflush(pdev->file);
-}
-
-/* ------ internal routines ------ */
-
-/* Transpose a block of 8x8 bits */
-private int
-fmpr_transpose_8x8(byte *src, int src_step, byte *dst, int dst_step)
-{
- byte mask, s, d0, d1, d2, d3, d4, d5, d6, d7;
- int i;
-
- d0 = d1 = d2 = d3 = d4 = d5 = d6 = d7 = 0;
-
- for(i=0, mask=0x80; i<8; i++, mask >>= 1) {
- s = *src;
- if(s & 0x80) d0 |= mask;
- if(s & 0x40) d1 |= mask;
- if(s & 0x20) d2 |= mask;
- if(s & 0x10) d3 |= mask;
- if(s & 0x08) d4 |= mask;
- if(s & 0x04) d5 |= mask;
- if(s & 0x02) d6 |= mask;
- if(s & 0x01) d7 |= mask;
- src += src_step;
- }
-
- *dst = d0;
- *(dst += dst_step) = d1;
- *(dst += dst_step) = d2;
- *(dst += dst_step) = d3;
- *(dst += dst_step) = d4;
- *(dst += dst_step) = d5;
- *(dst += dst_step) = d6;
- *(dst += dst_step) = d7;
-
- return 0;
-}
-
-/* Send the page to the printer. */
-private int
-fmpr_print_page(gx_device_printer *pdev, FILE *prn_stream)
-{
- int line_size = gdev_prn_raster(pdev);
- int height = pdev->height;
- int bits_per_column = 24;
- int bytes_per_column = bits_per_column / 8;
- int chunk_size = bits_per_column * line_size;
- byte *in, *out;
- int lnum;
- char prn_buf[16];
-
- in = (byte *)
- gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), bits_per_column, line_size, "fmpr_print_page(in)");
- out = (byte *)
- gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), bits_per_column, line_size, "fmpr_print_page(out)");
- if(in == 0 || out == 0)
- return -1;
-
- /* Initialize printer */
- prn_puts(pdev, "\033c");
- prn_puts(pdev, "\033Q1 `\033[24;18 G");
-
- /* Send Data to printer */
- lnum = 0;
- while(lnum < height) {
- byte *inp, *outp, *out_beg, *out_end;
- int x, y, num_lines, size, mod;
-
- if(gdev_prn_copy_scan_lines(pdev, lnum, in, chunk_size) < 0)
- break;
-
- if((num_lines = height - lnum) > bits_per_column)
- num_lines = bits_per_column;
-
- size = line_size * num_lines;
- if(in[0] == 0 &&
- !memcmp((char *)in, (char *)in + 1, size - 1)) {
- lnum += bits_per_column;
- prn_putc(pdev, '\n');
- continue;
- }
-
- if(num_lines < bits_per_column) {
- size = line_size * (bits_per_column - num_lines);
- memset(in + line_size * num_lines, 0, size);
- }
- lnum += bits_per_column;
-
- for(y = 0; y < bytes_per_column; y ++) {
- inp = in + line_size * 8 * y;
- outp = out + y;
- for(x = 0; x < line_size; x ++) {
- fmpr_transpose_8x8(inp, line_size,
- outp, bytes_per_column);
- inp ++;
- outp += bits_per_column;
- }
- }
-
- /* Remove trailing 0s. */
- out_end = out + chunk_size - 1;
- while(out_end >= out) {
- if(*out_end)
- break;
- out_end --;
- }
- size = (out_end - out) + 1;
- if((mod = size % bytes_per_column) != 0)
- out_end += bytes_per_column - mod;
-
- /* Remove leading 0s. */
- out_beg = out;
- while(out_beg <= out_end) {
- if(*out_beg)
- break;
- out_beg ++;
- }
- out_beg -= (out_beg - out) % bytes_per_column;
-
- sprintf(prn_buf, "\033[%da",
- (out_beg - out) / bytes_per_column);
- prn_puts(pdev, prn_buf);
-
- /* Dot graphics */
- size = out_end - out_beg + 1;
- sprintf(prn_buf, "\033Q%d W", size / bytes_per_column);
- prn_puts(pdev, prn_buf);
- prn_write(pdev, out_beg, size);
-
- prn_putc(pdev, '\n');
- }
-
- /* Form Feed */
- prn_putc(pdev, '\f');
- prn_flush(pdev);
-
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)out,
- bits_per_column, line_size, "fmpr_print_page(out)");
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)in,
- bits_per_column, line_size, "fmpr_print_page(in)");
-
- return 0;
-}
diff --git a/gs/contrib/japanese/gdevj100.c b/gs/contrib/japanese/gdevj100.c
deleted file mode 100644
index 5be96b7e1..000000000
--- a/gs/contrib/japanese/gdevj100.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/* Copyright (C) 1990, 1992 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. */
-
-/* gdevjj100.c */
-/* Star JJ-100 printer driver for Ghostscript */
-#include "gdevprn.h"
-
-private dev_proc_print_page(jj100_print_page);
-
-/*
- * The only available resolutions are 360 x 360.
- */
-
-/* The device descriptor */
-gx_device_printer gs_jj100_device =
- prn_device(prn_std_procs, "jj100",
- 82, /* width_10ths, 8.2" = 210mm(A4) */
- 115 /*113, 117*/, /* height_10ths, 11.7" = 297mm(A4) */
- 360, /* x_dpi */
- 360, /* y_dpi */
- 0,0,0,0, /* margins */
- 1, jj100_print_page);
-
-/* ------ internal routines ------ */
-
-/* Transpose a block of 8x8 bits */
-private int
-jj100_transpose_8x8(byte *src, int src_step, byte *dst, int dst_step)
-{
- byte mask, s, d0, d1, d2, d3, d4, d5, d6, d7;
- int i;
-
- d0 = d1 = d2 = d3 = d4 = d5 = d6 = d7 = 0;
-
- for(i=0, mask=0x01; i<8; i++, mask <<= 1) {
- s = *src;
- if(s & 0x80) d0 |= mask;
- if(s & 0x40) d1 |= mask;
- if(s & 0x20) d2 |= mask;
- if(s & 0x10) d3 |= mask;
- if(s & 0x08) d4 |= mask;
- if(s & 0x04) d5 |= mask;
- if(s & 0x02) d6 |= mask;
- if(s & 0x01) d7 |= mask;
- src += src_step;
- }
-
- *dst = d0;
- *(dst += dst_step) = d1;
- *(dst += dst_step) = d2;
- *(dst += dst_step) = d3;
- *(dst += dst_step) = d4;
- *(dst += dst_step) = d5;
- *(dst += dst_step) = d6;
- *(dst += dst_step) = d7;
-
- return 0;
-}
-
-/* Send the page to the printer. */
-private int
-jj100_print_page(gx_device_printer *pdev, FILE *prn_stream)
-{ int line_size = gdev_prn_raster(pdev);
- int height = pdev->height;
- int bits_per_column = 48;
- int bytes_per_column = bits_per_column / 8;
- int chunk_size = bits_per_column * line_size;
- byte *in, *out;
- int lnum, skip;
- char prn_buf[16];
-
- in = (byte *)
- gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), bits_per_column, line_size, "jj100_print_page(in)");
- out = (byte *)
- gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), bits_per_column, line_size, "jj100_print_page(out)");
- if(in == 0 || out == 0)
- return -1;
-
- /* Initialize printer */
- fputs("\033P", pdev->file); /* Proportional Mode */
- fputs("\033G", pdev->file); /* 1/180 inch per line */
- fputs("\033T16", pdev->file); /* 16/180 inch per line */
-
- /* Send Data to printer */
- lnum = 0;
- skip = 0;
- while(lnum < height) {
- byte *inp, *outp, *out_beg, *out_end;
- int x, y, num_lines, size, mod;
-
- /* Copy scan lines */
- if(gdev_prn_copy_scan_lines(pdev, lnum, in, chunk_size) < 0)
- break;
-
- /* The number of lines to process */
- if((num_lines = height - lnum) > bits_per_column)
- num_lines = bits_per_column;
-
- /* Test for all zero */
- size = line_size * num_lines;
- if(in[0] == 0 &&
- !memcmp((char *)in, (char *)in + 1, size - 1)) {
- lnum += bits_per_column;
- skip ++;
- continue;
- }
-
- /* Fill zero */
- if(num_lines < bits_per_column) {
- size = line_size * (bits_per_column - num_lines);
- memset(in + line_size * num_lines, 0, size);
- }
- lnum += bits_per_column;
-
- /* Vertical tab to the appropriate position. */
- while(skip > 15) {
- sprintf(prn_buf, "\037%c", 16 + 15);
- fputs(prn_buf, pdev->file);
- skip -= 15;
- }
- if(skip > 0) {
- sprintf(prn_buf, "\037%c", 16 + skip);
- fputs(prn_buf, pdev->file);
- }
-
- /* Transpose in blocks of 8 scan lines. */
- for(y = 0; y < bytes_per_column; y ++) {
- inp = in + line_size * 8 * y;
- outp = out + y;
- for(x = 0; x < line_size; x ++) {
- jj100_transpose_8x8(inp, line_size,
- outp, bytes_per_column);
- inp ++;
- outp += bits_per_column;
- }
- }
-
- /* Remove trailing 0s. */
- out_end = out + chunk_size - 1;
- while(out_end >= out) {
- if(*out_end)
- break;
- out_end --;
- }
- size = (out_end - out) + 1;
- if((mod = size % bytes_per_column) != 0)
- out_end += bytes_per_column - mod;
-
- /* Remove leading 0s. */
- out_beg = out;
- while(out_beg <= out_end) {
- if(*out_beg)
- break;
- out_beg ++;
- }
- out_beg -= (out_beg - out) % (bytes_per_column * 2);
-
- /* Dot addressing */
- sprintf(prn_buf, "\033F%04d",
- (out_beg - out) / bytes_per_column / 2);
- fputs(prn_buf, pdev->file);
-
- /* Dot graphics */
- size = out_end - out_beg + 1;
- sprintf(prn_buf, "\034bP,48,%04d.", size / bytes_per_column);
- fputs(prn_buf, pdev->file);
- fwrite(out_beg, 1, size, pdev->file);
-
- /* Carriage Return */
- fputc('\r', pdev->file);
- skip = 1;
- }
-
- /* Form Feed */
- fputc('\f', pdev->file);
- fflush(pdev->file);
-
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)out,
- bits_per_column, line_size, "jj100_print_page(out)");
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)in,
- bits_per_column, line_size, "jj100_print_page(in)");
-
- return 0;
-}
diff --git a/gs/contrib/japanese/gdevlbp3.c b/gs/contrib/japanese/gdevlbp3.c
deleted file mode 100644
index 72ea25ae9..000000000
--- a/gs/contrib/japanese/gdevlbp3.c
+++ /dev/null
@@ -1,277 +0,0 @@
-/* gdevlbp3.c */
-/* Canon LASER SHOT LBP-310/320 printer driver for Ghostscript
- * working on standerd/fine image mode.
- *
- * If any comment, write to naoya@mahoroba.ne.jp
- */
-
-#include "gdevprn.h"
-
-#define mm_to_inch(x) (x)/25.4
-
-/* The device descriptor */
-
-private dev_proc_print_page(lbp310PrintPage);
-private dev_proc_print_page(lbp320PrintPage);
-
-gx_device_printer far_data gs_lbp310_device =
- prn_device(prn_std_procs,
- "lbp310",
- DEFAULT_WIDTH_10THS,
- DEFAULT_HEIGHT_10THS,
- 600, 600,
- mm_to_inch(5.0),
- mm_to_inch(5.0),
- mm_to_inch(5.0),
- mm_to_inch(5.0),
- 1, lbp310PrintPage);
-
-gx_device_printer far_data gs_lbp320_device =
- prn_device(prn_std_procs,
- "lbp320",
- DEFAULT_WIDTH_10THS,
- DEFAULT_HEIGHT_10THS,
- 600, 600,
- mm_to_inch(5.0),
- mm_to_inch(5.0),
- mm_to_inch(5.0),
- mm_to_inch(5.0),
- 1, lbp320PrintPage);
-
-enum Paper
- {
- a4, a5, postcard, b5, letter
- };
-
-struct bounding
- {
- enum Paper paper;
- int Top, Bottom, Left, Right;
- };
-
-struct ppi
- {
- int w;
- int h;
- int id;
- };
-
-private const struct ppi PaperInfo[] =
- {
- {2100, 2960, 14}, /* A4 */
- {1485, 2098, 16}, /* A5 */
- {1000, 1480, 18}, /* Postcard */
- {1820, 2570, 26}, /* B5 */
- {2100, 2790, 14} /* Letter */
- };
-
-private void BoundImage(gx_device_printer *, struct bounding *);
-private long CompressImage(gx_device_printer *, struct bounding *, FILE *, const char *);
-
-private int
-lbp310PrintPage(gx_device_printer *pDev, FILE *fp)
-{
- int i;
- byte Buf[10];
- long DataSize;
- struct bounding Box;
-
- BoundImage(pDev, &Box);
-
- DataSize = CompressImage(pDev, &Box, fp, "\x1b[1;%d;%d;11;%d;.r");
-
- /* ----==== Set size ====---- */
- sprintf(Buf, "0%ld", DataSize);
- i = (DataSize+strlen(Buf)+1)&1;
- /* ----==== escape to LIPS ====---- */
- fprintf(fp, "\x80%s\x80\x80\x80\x80\x0c",Buf+i);
- fprintf(fp, "\x1bP0J\x1b\\");
-
- return(0);
-}
-
-private int
-lbp320PrintPage(gx_device_printer *pDev, FILE *fp)
-{
- int i;
- byte Buf[16];
- long DataSize;
- struct bounding Box;
-
- BoundImage(pDev, &Box);
-
- /* ----==== fix bounding box 4-byte align ====---- */
- Box.Left &= ~1;
- Box.Right |= 1;
-
- /* ----==== JOB start ??? ====---- */
- fprintf(fp, "\x1b%%-12345X@PJL CJLMODE\n@PJL JOB\n");
-
- DataSize = CompressImage(pDev, &Box, fp, "\x1b[1;%d;%d;11;%d;.&r");
-
- /* ----==== Set size ====---- */
- sprintf(Buf, "000%ld", DataSize);
- i = (DataSize+strlen(Buf)+1)&3;
- /* ----==== escape to LIPS ====---- */
- fprintf(fp, "\x80%s\x80\x80\x80\x80\x0c",Buf+i);
- fprintf(fp, "\x1bP0J\x1b\\");
- fprintf(fp, "\x1b%%-12345X@PJL CJLMODE\n@PJL EOJ\n\x1b%%-12345X");
-
- return(0);
-}
-
-private void
-BoundImage(gx_device_printer *pDev, struct bounding *pBox)
-{
- int x, y, flag;
- int LineSize = gdev_mem_bytes_per_scan_line((gx_device *)pDev);
- int Xsize, Ysize, Pt, Pb, Pl, Pr;
- int Xres = (int)pDev->x_pixels_per_inch,
- Yres = (int)pDev->y_pixels_per_inch,
- height = pDev->height;
- byte *Buf;
- enum Paper paper;
-
- /* ----==== Check parameters ====---- */
- paper = height*10/Yres < 82 ? postcard :\
- height*10/Yres < 98 ? a5 :\
- height*10/Yres < 109 ? b5 :\
- height*10/Yres < 116 ? letter : a4;
- Xsize = Xres * mm_to_inch(PaperInfo[paper].w-100) / 160;
- Ysize = Yres * mm_to_inch(PaperInfo[paper].h-100) / 10;
- /* ----==== Allocate momory ====---- */
- if (LineSize < Xsize*2+1) {
- LineSize = Xsize*2+1;
- }
- Buf = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), 1, LineSize, "LineBuffer");
- /* ----==== bounding image ====---- */
- Pt = Pb = Pl = Pr = -1;
- for(y=0 ; y<height && y<Ysize ; y++){
- flag = 0;
- gdev_prn_copy_scan_lines(pDev, y, Buf, LineSize);
- for (x=0 ; x<min(LineSize/2, Xsize) ; x++) {
- if (*(Buf+x*2) || *(Buf+x*2+1)) {
- if (Pl == -1 || Pl > x) {
- Pl = x;
- }
- if (Pr < x) {
- Pr = x;
- }
- flag = 1;
- }
- }
- if (flag) {
- if (Pt == -1) {
- Pt = y;
- }
- Pb = y;
- }
- }
- pBox->paper = paper;
- pBox->Top = Pt;
- pBox->Bottom = Pb;
- pBox->Left = Pl;
- pBox->Right = Pr;
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), Buf, 1, LineSize, "LineBuffer");
-}
-
-private long
-CompressImage(gx_device_printer *pDev, struct bounding *pBox, FILE *fp, const char *format)
-{
- int x, y, i, count = 255;
- int Xres = (int)pDev->x_pixels_per_inch;
- int LineSize = gdev_mem_bytes_per_scan_line((gx_device *)pDev);
- byte *Buf, oBuf[128], c_prev, c_cur, c_tmp;
- long DataSize = 0;
-
- /* ----==== Printer initialize ====---- */
- /* ----==== start TEXT mode ====---- */
- fprintf(fp, "\x1b%%@");
- /* ----==== job start ====---- */
- fprintf(fp, "\x1bP35;%d;1J;GhostScript\x1b\\", Xres);
- /* ----==== soft reset ====---- */
- fprintf(fp, "\x1b<");
- /* ----==== select size as dot ====---- */
- fprintf(fp, "\x1b[7 I");
- /* ----==== ??? ====---- */
- fprintf(fp, "\x1b[;1;'v");
- /* ----==== set paper size ====---- */
- fprintf(fp, "\x1b[%d;;p", PaperInfo[pBox->paper].id);
- /* ----==== select sheet feeder ====---- */
- fprintf(fp, "\x1b[1q");
- /* ----==== disable automatic FF ====---- */
- fprintf(fp, "\x1b[?2h");
- /* ----==== set number of copies ====---- */
- fprintf(fp, "\x1b[%dv", 1);
- /* ----==== move CAP location ====---- */
- fprintf(fp, "\x1b[%d;%df", pBox->Top, pBox->Left*16);
- /* ----==== draw raster image ====---- */
- fprintf(fp, format, pBox->Right-pBox->Left+1,
- Xres, pBox->Bottom-pBox->Top+1);
-
- /* ----==== Allocate momory ====---- */
- Buf = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), 1, LineSize, "LineBuffer");
- /* ----==== transfer raster image ====---- */
- for (y=pBox->Top ; y<=pBox->Bottom ; y++) {
- gdev_prn_copy_scan_lines(pDev, y, Buf, LineSize);
- for (x=pBox->Left*2 ; x<=pBox->Right*2+1 ; x++) {
- /* ----==== check pointer & Reverse bit order ====---- */
- c_cur = 0;
- if (x<LineSize) {
- c_tmp = *(Buf+x);
- for (i=0 ; i<8 ; i++) {
- c_cur = (c_cur << 1) | (c_tmp & 1);
- c_tmp = c_tmp >> 1;
- }
- }
- /* ----==== Compress data ====---- */
- if (count < 0) {
- if (c_prev == c_cur && count > -127) {
- count--;
- continue;
- } else {
- fprintf(fp, "%c%c", count, c_prev);
- DataSize += 2;
- }
- } else if (count == 0) {
- if (c_prev == c_cur) {
- count--;
- } else {
- count++;
- c_prev = *(oBuf+count) = c_cur;
- }
- continue;
- } else if (count < 127) {
- if (c_prev == c_cur) {
- fprintf(fp, "%c", count-1);
- fwrite(oBuf, 1, count, fp);
- DataSize += (count+1);
- count = -1;
- } else {
- count++;
- c_prev = *(oBuf+count) = c_cur;
- }
- continue;
- } else if (count == 127) {
- fprintf(fp, "%c", count);
- fwrite(oBuf, 1, count+1, fp);
- DataSize += (count+2);
- }
- c_prev = *oBuf = c_cur;
- count = 0;
- }
- }
-
- /* ----==== flush data ====---- */
- if (count < 0) {
- fprintf(fp, "%c%c", count, c_prev);
- DataSize += 2;
- } else {
- fprintf(fp, "%c", count);
- fwrite(oBuf, 1, count+1, fp);
- DataSize += (count+2);
- }
-
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), Buf, 1, LineSize, "LineBuffer");
- return(DataSize);
-}
diff --git a/gs/contrib/japanese/gdevmag.c b/gs/contrib/japanese/gdevmag.c
deleted file mode 100644
index 1b218b073..000000000
--- a/gs/contrib/japanese/gdevmag.c
+++ /dev/null
@@ -1,335 +0,0 @@
-/* Copyright (C) 1992, 1993 Aladdin Enterprises. All rights reserved.
-
-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. */
-
-/* gdevmag.c */
-/* .MAG file format devices for Ghostscript */
-#include "gdevprn.h"
-#include "gdevpccm.h"
-#include <stdlib.h>
-
-/* ------ The device descriptors ------ */
-
-/*
- * Default X and Y resolution.
- */
-#define HEIGHT_10THS 117
-#define DPI (8000.0/HEIGHT_10THS)
-#define WIDTH_10THS (6400.0 / DPI)
-
-private dev_proc_print_page(mag_4bit_print_page);
-private dev_proc_open_device(gdev_mag_4bit_open);
-private dev_proc_print_page(mag_8bit_print_page);
-private dev_proc_open_device(gdev_mag_8bit_open);
-
-/* internal routines. */
-private int mag_make_flag(gx_device_printer *,int ,int ,byte **, byte *,byte *);
-private int mag_comp_flag(gx_device_printer *,int ,byte * ,byte *,byte *, int, byte *);
-private int mag_write_palette(gx_device_printer * ,int );
-private int mag_print_page(gx_device_printer * , int , FILE * );
-
-/* 4-bit planar (PC-9801 style) color. */
-
-private gx_device_procs mag16_procs =
- prn_color_procs(gdev_mag_4bit_open, gdev_prn_output_page, gdev_prn_close,
- pc_4bit_map_rgb_color, pc_4bit_map_color_rgb);
-gx_device_printer far_data gs_mag16_device =
- prn_device(mag16_procs, "mag16",
- (int)WIDTH_10THS, (int)HEIGHT_10THS,
- DPI, DPI,
- 0,0,0,0, /* margins */
- 4, mag_4bit_print_page);
-
-/* 8-bit planar color. */
-
-private gx_device_procs mag256_procs =
- prn_color_procs(gdev_mag_8bit_open, gdev_prn_output_page, gdev_prn_close,
- pc_8bit_map_rgb_color, pc_8bit_map_color_rgb);
-gx_device_printer far_data gs_mag256_device =
- prn_device(mag256_procs, "mag256",
- (int)WIDTH_10THS, (int)HEIGHT_10THS,
- DPI, DPI,
- 0,0,0,0, /* margins */
- 8, mag_8bit_print_page);
-
-/* ------ Private definitions ------ */
-
-private int
-gdev_mag_4bit_open(gx_device *dev)
-{
- dev->width = (dev->width + 7) / 8 * 8;
- return gdev_prn_open(dev);
-}
-
-private int
-gdev_mag_8bit_open(gx_device *dev)
-{
- dev->width = (dev->width + 3) / 4 * 4;
- return gdev_prn_open(dev);
-}
-
-private int
-mag_4bit_print_page(gx_device_printer *pdev,FILE *file)
-{ return mag_print_page(pdev,4,file);
-}
-
-private int
-mag_8bit_print_page(gx_device_printer *pdev,FILE *file)
-{ return mag_print_page(pdev,8,file);
-}
-
-/* Write out a page in MAG format. */
-/* This routine is used for all formats. */
-private int
-mag_print_page(gx_device_printer *pdev, int depth, FILE *file)
-{
- int code = 0; /* return code */
- const char *magic = "MAKI02 gs ";
- char *user = getenv("USER");
- char check[256];
- byte header[32] = "\000\000\000\000"
- "\000\000\000\000"
- "\000\000\000\000";
- byte *flag;
- byte *flag_prev;
- byte *flag_a,*flag_b;
- byte *row_buffer;
- byte *row[17];
- byte *pixel;
- int raster = gdev_prn_raster(pdev);
- int height = pdev->height;
- int width = pdev->width;
- int width_pixel = width / ((depth == 4) ? 4 : 2 );
- int flag_size = width_pixel / 2;
- int flag_a_bytes = (flag_size + 7)/8 + 1;
- int flag_b_size = flag_size;
- long flag_b_bytes;
- long pixel_bytes;
- int y;
-
- row_buffer = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), raster,17,"mag_row");
- flag = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), flag_size,2,"mag_flag");
- flag_prev = flag + flag_size;
- flag_a = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), flag_a_bytes,1,"mag_flag_a");
- flag_b = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), flag_b_size,1,"mag_flag_b");
- pixel = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), width,1,"mag_pixel");
- if (row_buffer == 0 || flag == 0 ||
- flag_a == 0 || flag_b == 0 || pixel == 0) {
- code = -1;
- goto mag_done;
- }
- for (y=0;y<17;y++)
- row[y] = row_buffer + raster*y;
-
- if (user == 0) user = "Unknown";
- strcpy(check,magic);
- sprintf(check+strlen(check),"%-18s",user);
- sprintf(check+31," Ghostscript with %s driver\x1a", pdev->dname);
-
- /* check sizes of flag and pixel data. */
- pixel_bytes = 0;
- flag_b_bytes = 0;
- {
- byte *f0=flag_prev,*f1=flag;
- memset(f0,0,flag_size);
- for (y=0;y<height;y++) {
- byte *f2;
- pixel_bytes += mag_make_flag(pdev,y,depth,row,f1,pixel);
- flag_b_bytes += mag_comp_flag(pdev,flag_size,f0,f1,flag_a,0,flag_b);
- f2 = f0; f0 = f1; f1 = f2;
- }
- }
-
- /* make header */
- { long offset;
-#define put_word(b,w) ((b)[0] = (w)&0xff,(b)[1] = ((w)>>8)&0xff)
-#define put_dword(b,w) (put_word(b,w),put_word((b)+2,(w)>>16))
- header[3] = depth == 4 ? 0 : 0x80;
- put_word(header+8,width-1);
- put_word(header+10,height-1);
- offset = 32 + (1 << depth) * 3;
- put_dword(header+12,offset);
- offset += (flag_size * height + 7) / 8;
- put_dword(header+16,offset);
- put_dword(header+20,flag_b_bytes);
- offset += flag_b_bytes;
- put_dword(header+24,offset);
- put_dword(header+28,pixel_bytes);
-#undef put_word
-#undef put_dword
- }
-
- /* write magic number, header, palettes. */
- fputs(check,file);
- fwrite(header,32,1,file);
- mag_write_palette(pdev,depth);
-
- /* write image */
- { int count;
- int next_bit;
- byte *f0=flag_prev,*f1=flag;
-
- /* flag A */
- memset(f0,0,flag_size);
- next_bit = 0;
- for (y=0;y<height;y++) {
- byte *f2;
- mag_make_flag(pdev,y,depth,row,f1,pixel);
- mag_comp_flag(pdev,flag_size,f0,f1,flag_a,next_bit,flag_b);
- count = (next_bit + flag_size) / 8;
- next_bit = (next_bit + flag_size) % 8;
- fwrite(flag_a,count,1,file);
- if (next_bit) flag_a[0] = flag_a[count];
- f2 = f0; f0 = f1; f1 = f2;
- }
- if (next_bit) fputc(flag_a[0],file);
-
- /* flag B */
- memset(f0,0,flag_size);
- for (y=0;y<height;y++) {
- byte *f2;
- mag_make_flag(pdev,y,depth,row,f1,pixel);
- count = mag_comp_flag(pdev,flag_size,f0,f1,flag_a,0,flag_b);
- fwrite(flag_b,count,1,file);
- f2 = f0; f0 = f1; f1 = f2;
- }
-
- /* pixel */
- for (y=0;y<height;y++) {
- count = mag_make_flag(pdev,y,depth,row,f1,pixel);
- fwrite(pixel,count,1,file);
- }
- }
-
-mag_done:
- if (row_buffer) gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)row_buffer, raster, 17, "mag_row");
- if (flag) gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)flag,flag_size,2,"mag_flag");
- if (flag_a) gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)flag_a,flag_a_bytes,1,"mag_flag_a");
- if (flag_b) gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)flag_b,flag_b_size,1,"mag_flag_b");
- if (pixel) gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)pixel,width,1,"mag_pixel");
-
- fflush(file);
-
- return code;
-}
-
-/* make flag and pixel data */
-private int
-mag_make_flag(gx_device_printer *pdev,int line_no, int depth,
- byte **row, byte *flag,byte *pixel)
-{
- int x;
- int raster = gdev_prn_raster(pdev);
- byte *ppixel = pixel;
-
- { byte *prow = row[16];
- for (x=16;x>0;x--)
- row[x] = row[x-1];
- row[0] = prow;
- }
- gdev_prn_copy_scan_lines(pdev,line_no,row[0],raster);
-
- if (depth == 4) {
- for (x=0;x<raster;x++) {
- if (x&1) *(row[0]+x/2) |= *(row[0]+x);
- else *(row[0]+x/2) = *(row[0]+x) << 4;
- }
- raster = (raster + 1) / 2;
- }
-
-#define check_pixel(a,b) \
- (x >= (a) && line_no >= (b) && \
- *(row[0]+x) == *(row[b] + (x - (a))) && \
- *(row[0]+x+1) == *(row[b] + (x+1 - (a))))
-#define set_flag(v) \
- ((x & 2) ? (flag[x>>2] |= (v)) : (flag[x>>2] = (v)<<4))
-
- for (x=0; x<raster ;x+=2) {
- if (check_pixel(2,0)) set_flag(1); /* 1 */
- else if (check_pixel(0,1)) set_flag(4); /* 4 */
- else if (check_pixel(2,1)) set_flag(5); /* 5 */
- else if (check_pixel(0,2)) set_flag(6); /* 6 */
- else if (check_pixel(2,2)) set_flag(7); /* 7 */
- else if (check_pixel(0,4)) set_flag(9); /* 9 */
- else if (check_pixel(2,4)) set_flag(10); /* 10 */
- else if (check_pixel(4,0)) set_flag(2); /* 2 */
- else if (check_pixel(4,2)) set_flag(8); /* 8 */
- else if (check_pixel(4,4)) set_flag(11); /* 11 */
- else if (check_pixel(0,8)) set_flag(12); /* 12 */
- else if (check_pixel(2,8)) set_flag(13); /* 13 */
- else if (check_pixel(4,8)) set_flag(14); /* 14 */
- else if (check_pixel(8,0)) set_flag(3); /* 3 */
- else if (check_pixel(0,16)) set_flag(15); /* 15 */
- else { /* 0 */
- set_flag(0);
- *ppixel++ = *(row[0] + x);
- *ppixel++ = *(row[0] + x+1);
- }
- }
-#undef check_pixel
-#undef set_flag
-
- return ppixel - pixel;
-}
-
-/* compress flags (make flag A and B) */
-private int
-mag_comp_flag(gx_device_printer *pdev, int size,byte *f0,byte *f1,
- byte *flag_a,int next_bit,byte *flag_b)
-{
- byte mask = 0x80>>next_bit;
- byte *pflag_b = flag_b;
-
- for ( ;size>0 ; size--) {
- byte b = *f0 ^ *f1;
- if (mask == 0x80) {
- *flag_a = 0;
- }
- if (b) {
- *flag_a |= mask;
- *pflag_b++ = b;
- }
- mask >>= 1;
- f0++;
- f1++;
- if (mask == 0) {
- mask = 0x80;
- flag_a++;
- }
- }
-
- return pflag_b - flag_b;
-}
-
-/* write palette */
-private int
-mag_write_palette(gx_device_printer *pdev,int depth)
-{
- uint i;
- gx_color_value rgb[3];
- int max_index = 1 << depth;
-
- for ( i = 0; i < max_index; i++ ) {
- byte grb[3];
- (pdev->orig_procs.map_color_rgb)((gx_device *)pdev, (gx_color_index)i, rgb);
- grb[0] = rgb[1] >> (gx_color_value_bits - 8);
- grb[1] = rgb[0] >> (gx_color_value_bits - 8);
- grb[2] = rgb[2] >> (gx_color_value_bits - 8);
- fwrite(grb, 3,1,pdev->file);
- }
- return 0;
-}
diff --git a/gs/contrib/japanese/gdevmjc.c b/gs/contrib/japanese/gdevmjc.c
deleted file mode 100644
index b0203c216..000000000
--- a/gs/contrib/japanese/gdevmjc.c
+++ /dev/null
@@ -1,1809 +0,0 @@
-/* Copyright (C) 1991, 1992, 1993 Aladdin Enterprises. All rights reserved.
-
-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. */
-
-/* gdevmjc.c */
-/* Many parts of this file are copied from gdevcdj.c and gdevescp.c */
-
-/* EPSON MJ-700V2C colour printer drivers for Ghostscript */
-
-/*
- These drivers may also work with EPSON Stylus color printer,
- though the author hasn't tried.
-*/
-
-/*
- Any comments, suggestions, and bug reports are welcomed.
- The e-mail address of the author Kubo, Hiroshi is
-
- h-kubo@kuee.kyoto-u.ac.jp
-
- or
-
- JBD02172@niftyserve.or.jp
-
-*/
-
-
-/*
-
- Modified by Norihito Ohmori.
- Support -r / -dBitsPerPixel option.
- Change -dMicroweave / -dUnidirectional option.
-
- */
-
-#include "std.h" /* to stop stdlib.h redefining types */
-#include <stdlib.h> /* for rand() */
-#include <limits.h>
-#include "gdevprn.h"
-#include "gdevpcl.h"
-#include "gdevmjc.h"
-
-/***
- *** Note: Original driver gdevcdj.c for HP color printer was written
- *** by a user, George Cameron.
- ***
- *** An idea of Kuniyoshi Yoshio to borrow the codes of gdevcdj.c
- *** for another color printer BJC-600J inspired the author.
- ***
- *** Basic control sequences and compression algorithm for ESC/P
- *** V2 printer are taken from gdevescp.c, written by Richard Brown.
- ***
- *** The author Kubo, Hiroshi gathered necessary codes for EPSON
- *** MJ-700V2C and Sylus color printer in gdevmjc.c.
- ***/
-
-
-/*
- available drivers
-
- 1. mj700v2c EPSON Mach Jet Color, for ALL CMYK printer
-
- 2. mj500c EPSON Mach Jet Color,
- CMY or K printer: MJ-500C, MJ-510C,
- CMY + K printer: MJ-800C (for plane paper),
- MJ-3000C (for plane paper)
- 3. mj6000c EPSON MJ-830C, MJ-930C, MJ-6000C
- Use "High Performance Monochrome Mode"
- 4. mj8000c EPSON MJ-8000C
- Use "High Performance Monochrome Mode"
- A2 Paper Size Margin is different from mj6000c
-*/
-
-/*
- ** Options **
- *
- name type description
-
- Density int Controls densty of dots. 1024 is normal setting
- for 360dpi.
- Cyan int Controls depth of Cyan. 1024 is normal setting.
- Magenta int Controls depth of Magenta. 1024 is normal setting.
- Yellow int Controls depth of Yellow. 1024 is normal setting.
- Black int Controls depth of Black. 1024 is normal setting.
- Unidirectional bool if true, Force unidirectional printing.
- Microweave bool if true, set micro weave mode.
- DotSize int Controls the size of the dots. 0 means default,
- 1 means small, 2 means normal.
-
- ** Examples **
-
- % gs -sDEVICE=mj700v2c -sOutputFile=tiger.mj gdevmjc.ps tiger.ps
-
- % gs -sDEVICE=mj700v2c -dDensity=1152 -dCyan=1000 -dMagenta=896 \
- -dYellow=1024 -dBlack=512 -dUnidirectional -sOutputFile=tiger.mj \
- gdevmjc.ps tiger.ps
-
- */
-
-
-#define MJ700V2C_PRINT_LIMIT 0.34 /* taken from gdevescp.c */
-
-/* Margins are left, bottom, right, top. */
-/* left bottom right top */
-#define MJ700V2C_MARGINS_A4 0.118, 0.52, 0.118, 0.33465
-#define MJ6000C_MARGINS_A2 0.948, 0.52, 1.969, 0.33465
-#define MJ8000C_MARGINS_A2 0.194, 0.52, 0.194, 0.33465
-
-
-/* Define bits-per-pixel for generic drivers - default is 24-bit mode */
-#ifndef BITSPERPIXEL
-#define BITSPERPIXEL 32
-#endif
-
-#define W sizeof(word)
-#define I sizeof(int)
-
-/* Printer types */
-#define MJ700V2C 1
-#define MJ500C 2
-#define MJ6000C 3
-#define MJ8000C 4
-
-/* No. of ink jets (used to minimise head movements) */
-#define HEAD_ROWS_MONO 50
-#define HEAD_ROWS_COLOUR 16
-/* only for mj700v2c */
-#define MJ_HEAD_ROWS_MONO 64
-#define MJ_HEAD_ROWS_COLOUR 16
-
-/* Colour mapping procedures */
-private dev_proc_map_rgb_color (gdev_mjc_map_rgb_color);
-private dev_proc_map_color_rgb (gdev_mjc_map_color_rgb);
-
-/* Print-page, properties and miscellaneous procedures */
-private dev_proc_open_device(mj700v2c_open);
-private dev_proc_open_device(mj500c_open);
-private dev_proc_open_device(mj6000c_open);
-private dev_proc_open_device(mj8000c_open);
-private dev_proc_print_page(mj700v2c_print_page);
-private dev_proc_print_page(mj500c_print_page);
-private dev_proc_print_page(mj6000c_print_page);
-private dev_proc_print_page(mj8000c_print_page);
-
-private dev_proc_get_params(mj_get_params);
-private dev_proc_put_params(mj700v2c_put_params);
-private dev_proc_put_params(mj500c_put_params);
-
-private int mj_open(gx_device * pdev, int ptype);
-private int mj_put_params(gx_device * pdev, gs_param_list * plist, int ptype);
-private int mj_print_page(gx_device_printer * pdev, FILE * prn_stream, int ptype);
-private void expand_line(word *, int, int, int);
-private int put_param_int(gs_param_list *, gs_param_name, int *, int, int, int);
-private void set_bpp(gx_device *, int);
-private void mj500c_set_bpp(gx_device *, int);
-private gx_color_index mjc_correct_color(gx_device_printer *, gx_color_index);
-
-/* The device descriptors */
-struct gx_device_mj_s {
- gx_device_common;
- gx_prn_device_common;
- int colorcomp; /* 1: grayscale 3: CMY 4: CMYK */
- int density; /* (color depth) * density/1024 = otuput */
- int cyan; /* weight for cyan */
- int magenta; /* weight for magenta */
- int yellow; /* weight for yellow */
- int black; /* weight for black */
- bool direction; /* direction of the head. 1: one way 2: both way */
- bool microweave; /* Micro weave switch. 0: off 1: on */
- int dotsize; /* dot size switch.
- 0: default, 1: small, 2: normal */
-};
-
-typedef struct gx_device_mj_s gx_device_mj;
-
-#define mj ((gx_device_mj *) pdev)
-
-#define prn_hp_colour_device(procs, dev_name, x_dpi, y_dpi, bpp, print_page)\
- prn_device_body(gx_device_mj, procs, dev_name,\
- DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, x_dpi, y_dpi,\
- 0.118, 0.52, 0.118, 0.33465,\
- (bpp == 32 ? 4 : (bpp == 1 || bpp == 8) ? 1 : 3), bpp,\
- (bpp >= 8 ? 255 : 1), (bpp >= 8 ? 255 : bpp > 1 ? 1 : 0),\
- (bpp >= 8 ? 5 : 2), (bpp >= 8 ? 5 : bpp > 1 ? 2 : 0),\
- print_page)
-
-#define mjcmyk_device(procs, dev_name, x_dpi, y_dpi, bpp, print_page,\
- dns, r, g, b, k, drct, mcrwv, dtsz)\
-{ prn_hp_colour_device(procs, dev_name, x_dpi, y_dpi, bpp, print_page),\
- (bpp == 32 ? 4 : 1), dns, r, g, b, k, drct, mcrwv, dtsz \
-}
-
-#define mjcmy_device(procs, dev_name, x_dpi, y_dpi, bpp, print_page,\
- dns, r, g, b, k, drct, mcrwv, dtsz)\
-{ prn_hp_colour_device(procs, dev_name, x_dpi, y_dpi, bpp, print_page),\
- (bpp == 32 ? 3 : 1), dns, r, g, b, k, drct, mcrwv, dtsz \
-}
-
-#define mj_colour_procs(proc_colour_open, proc_get_params, proc_put_params)\
-{ proc_colour_open,\
- gx_default_get_initial_matrix,\
- gx_default_sync_output,\
- gdev_prn_output_page,\
- gdev_prn_close,\
- gdev_mjc_map_rgb_color,\
- gdev_mjc_map_color_rgb,\
- NULL, /* fill_rectangle */\
- NULL, /* tile_rectangle */\
- NULL, /* copy_mono */\
- NULL, /* copy_color */\
- NULL, /* draw_line */\
- gx_default_get_bits,\
- proc_get_params,\
- proc_put_params\
-}
-
-private gx_device_procs mj700v2c_procs =
-mj_colour_procs(mj700v2c_open, mj_get_params, mj700v2c_put_params);
-
-private gx_device_procs mj500c_procs =
-mj_colour_procs(mj500c_open, mj_get_params, mj500c_put_params);
-
-private gx_device_procs mj6000c_procs =
-mj_colour_procs(mj6000c_open, mj_get_params, mj700v2c_put_params);
-
-private gx_device_procs mj8000c_procs =
-mj_colour_procs(mj8000c_open, mj_get_params, mj700v2c_put_params);
-
-gx_device_mj far_data gs_mj700v2c_device =
-mjcmyk_device(mj700v2c_procs, "mj700v2c", 360, 360, BITSPERPIXEL,
- mj700v2c_print_page, 1024, 1024, 1024, 1024, 1024, 0, 1, 1);
-
-gx_device_mj far_data gs_mj500c_device =
-mjcmy_device(mj500c_procs, "mj500c", 360, 360, BITSPERPIXEL,
- mj500c_print_page, 1024, 1024, 1024, 1024, 1024, 0, 1, 1);
-
-gx_device_mj far_data gs_mj6000c_device =
-mjcmyk_device(mj6000c_procs, "mj6000c", 360, 360, BITSPERPIXEL,
- mj6000c_print_page, 1024, 1024, 1024, 1024, 1024, 0, 1, 1);
-
-gx_device_mj far_data gs_mj8000c_device =
-mjcmyk_device(mj8000c_procs, "mj8000c", 360, 360, BITSPERPIXEL,
- mj8000c_print_page, 1024, 1024, 1024, 1024, 1024, 0, 1, 1);
-
-/* Get the paper size code, based on width and height. */
-private int
-gdev_mjc_paper_size(gx_device *dev)
-{
- int width = dev->MediaSize[0];
- int height = dev->MediaSize[1];
-
- if (width == 1190 && height == 1684)
- return PAPER_SIZE_A2;
- else
- return PAPER_SIZE_A4;
-}
-
-private int
-mj700v2c_open(gx_device * pdev)
-{
- return mj_open(pdev, MJ700V2C);
-}
-
-private int
-mj500c_open(gx_device * pdev)
-{
- return mj_open(pdev, MJ700V2C);
-}
-
-private int
-mj6000c_open(gx_device * pdev)
-{
- return mj_open(pdev, MJ700V2C);
-}
-
-private int
-mj8000c_open(gx_device * pdev)
-{
- return mj_open(pdev, MJ700V2C);
-}
-
-/* Open the printer and set up the margins. */
-private int
-mj_open(gx_device *pdev, int ptype)
-{ /* Change the margins if necessary. */
- int xdpi = pdev->x_pixels_per_inch;
- int ydpi = pdev->y_pixels_per_inch;
-
- static const float mj_margin[4] = { MJ700V2C_MARGINS_A4 };
- static const float mj6000c_a2[4] = { MJ6000C_MARGINS_A2 };
- static const float mj8000c_a2[4] = { MJ8000C_MARGINS_A2 };
-
- const float *m;
-
- int paper_size;
-
-#if 0
- /* Set up colour params if put_props has not already done so */
- if (pdev->color_info.num_components == 0)
- set_bpp(pdev, pdev->color_info.depth);
-#endif
-
- paper_size = gdev_mjc_paper_size(pdev);
- if (paper_size == PAPER_SIZE_A2 ) {
- if (ptype == MJ6000C)
- m = mj6000c_a2;
- else if (ptype == MJ8000C)
- m = mj8000c_a2;
- else
- m = mj_margin;
- } else {
- m = mj_margin;
- }
-
- gx_device_set_margins(pdev, m, true);
-
- if (mj->colorcomp == 3)
- mj->density = mj->density * 720 / ydpi * 1.5;
- else
- mj->density = mj->density * 720 / ydpi;
-
- /* Print Resolution Check */
- if (!((xdpi == 180 && ydpi == 180) ||
- (xdpi == 360 && ydpi == 360) ||
- (xdpi == 720 && ydpi == 720) ||
- (xdpi == 360 && ydpi == 720) ||
- (xdpi == 720 && ydpi == 360)))
- return_error(gs_error_rangecheck);
-
- return gdev_prn_open(pdev);
-}
-
-/* Get properties. In addition to the standard and printer
- * properties, we supply shingling and depletion parameters,
- * and control over the bits-per-pixel used in output rendering */
-/* Added properties for DeskJet 5xxC */
-
-private int
-mj_get_params(gx_device *pdev, gs_param_list *plist)
-{
- int code = gdev_prn_get_params(pdev, plist);
-
- if ( code < 0 ||
- (code = param_write_int(plist, "Density", &mj->density)) < 0 ||
- (code = param_write_int(plist, "Cyan", &mj->cyan)) < 0 ||
- (code = param_write_int(plist, "Magenta", &mj->magenta)) < 0 ||
- (code = param_write_int(plist, "Yellow", &mj->yellow)) < 0 ||
- (code = param_write_int(plist, "Black", &mj->black)) < 0 ||
- (code = param_write_bool(plist, "Unidirectional", &mj->direction)) < 0 ||
- (code = param_write_bool(plist, "Microweave", &mj->microweave)) < 0 ||
- (code = param_write_int(plist, "DotSize", &mj->dotsize)) < 0
- )
- return code;
-
- return code;
-}
-
-/* Put properties. */
-private int
-mj700v2c_put_params(gx_device *pdev, gs_param_list *plist)
-{
- return mj_put_params(pdev, plist, MJ700V2C);
-}
-
-private int
-mj500c_put_params(gx_device *pdev, gs_param_list *plist)
-{
- return mj_put_params(pdev, plist, MJ500C);
-}
-
-private int
-mj_put_params(gx_device *pdev, gs_param_list *plist, int ptype)
-{
- int old_bpp = mj->color_info.depth;
- int bpp = 0;
- int code = 0;
- int density = mj->density;
- int cyan = mj->cyan;
- int magenta = mj->magenta;
- int yellow = mj->yellow;
- int black = mj->black;
- bool direction = mj->direction;
- bool microweave = mj->microweave;
- int dotsize = mj->dotsize;
- gs_param_name param_name;
- int ecode = 0;
-
- code = put_param_int(plist, "Density", &density, 0, INT_MAX, code);
- code = put_param_int(plist, "Cyan", &cyan, 0, INT_MAX, code);
- code = put_param_int(plist, "Magenta", &magenta, 0, INT_MAX, code);
- code = put_param_int(plist, "Yellow", &yellow, 0, INT_MAX, code);
- code = put_param_int(plist, "Black", &black, 0, INT_MAX, code);
-
- if ((code == param_read_bool(plist,
- (param_name = "Unidirectional"),
- &direction))< 0) {
- param_signal_error(plist, param_name, ecode = code);
- }
-
- if ((code == param_read_bool(plist,
- (param_name = "Microweave"),
- &microweave))< 0) {
- param_signal_error(plist, param_name, ecode = code);
- }
- if (ecode < 0)
- return code;
-
- if (microweave && pdev->x_pixels_per_inch == 180)
- return_error(gs_error_rangecheck);
-
- code = put_param_int(plist, "DotSize", &dotsize, 0, 1, code);
- code = put_param_int(plist, "BitsPerPixel", &bpp, 1, 32, code);
-
- if ( code < 0 )
- return code;
-
- mj->density = density;
- mj->cyan = cyan;
- mj->magenta = magenta;
- mj->yellow = yellow;
- mj->black = black;
- mj->direction = direction;
- mj->microweave = microweave;
- mj->dotsize = dotsize;
-
- if ( bpp != 0 ) {
- if (bpp != 8 && bpp != 32)
- return_error(gs_error_rangecheck);
-
- if (ptype == MJ500C)
- mj500c_set_bpp(pdev, bpp);
- else
- set_bpp(pdev, bpp);
- gdev_prn_put_params(pdev, plist);
- if ( bpp != old_bpp && pdev->is_open )
- return gs_closedevice(pdev);
- return 0;
- }
- else
- return gdev_prn_put_params(pdev, plist);
-}
-
-/* ------ Internal routines ------ */
-/* MACROS FOR DITHERING (we use macros for compact source and faster code) */
-/* Floyd-Steinberg dithering. Often results in a dramatic improvement in
- * subjective image quality, but can also produce dramatic increases in
- * amount of printer data generated and actual printing time!! Mode 9 2D
- * compression is still useful for fairly flat colour or blank areas but its
- * compression is much less effective in areas where the dithering has
- * effectively randomised the dot distribution. */
-
-#define SHIFT (I * I)
-#define MINVALUE 0
-#define MAXVALUE ((256 << SHIFT) - 1)
-#define THRESHOLD (128 << SHIFT)
-
-#define FSditherI(inP, out, errP, Err, Bit, Offset)\
- oldErr = Err;\
- Err = (*errP + ((Err * 7) >> 4) + (*inP++ << SHIFT));\
- if (Err > MAXVALUE) Err = MAXVALUE;\
- else if (Err < MINVALUE) Err = MINVALUE;\
- if (Err > THRESHOLD) {\
- out |= Bit;\
- Err -= MAXVALUE;\
- }\
- errP[Offset] += ((Err * 3) >> 4);\
- *errP++ = ((Err * 5 + oldErr) >> 4);
-
-#define FSditherD(inP, out, errP, Err, Bit, Offset)\
- oldErr = Err;\
- Err = (*--errP + ((Err * 7) >> 4) + (*--inP << SHIFT));\
- if (Err > MAXVALUE) Err = MAXVALUE;\
- else if (Err < MINVALUE) Err = MINVALUE;\
- if (Err > THRESHOLD) {\
- out |= Bit;\
- Err -= MAXVALUE;\
- }\
- errP[Offset] += ((Err * 3) >> 4);\
- *errP = ((Err * 5 + oldErr) >> 4);
-
-#define MATRIX_I(inP, out, Bit, Offset)\
- if ((*inP++ << 6) > Offset) {\
- out |= Bit;\
- }
-
-#define MATRIX_D(inP, out, Bit, Offset)\
- if ((*--inP << 6) > Offset) {\
- out |= Bit;\
- }
-
-
-/* Here we rely on compiler optimisation to remove lines of the form
- * (if (1 >= 4) {...}, ie. the constant boolean expressions */
-
-#define FSDline(scan, i, j, plane_size, cErr, mErr, yErr, kErr, cP, mP, yP, kP, n)\
-{\
- unsigned short *mat = matrix2 + (lnum & 127)*128;\
- int x;\
- if (scan == 0) { /* going_up */\
- x = 0;\
- for (i = 0; i < plane_size; i++) {\
- byte c, y, m, k, bitmask;\
- int val;\
- bitmask = 0x80;\
- for (c = m = y = k = j = 0; j < 8; j++) {\
- val = *(mat + (x++ & 127));\
- if (n >= 4)\
- {\
- MATRIX_I(dp, k, bitmask, val);\
- }\
- if (n >= 3)\
- { MATRIX_I(dp, c, bitmask, val);\
- MATRIX_I(dp, m, bitmask, val);\
- }\
- MATRIX_I(dp, y, bitmask, val);\
- bitmask >>= 1;\
- }\
- if (n >= 4)\
- *kP++ = k;\
- if (n >= 3)\
- { *cP++ = c;\
- *mP++ = m;\
- }\
- *yP++ = y;\
- }\
- } else { /* going_down */\
- x = plane_size*8;\
- for (i = 0; i < plane_size; i++) {\
- byte c, y, m, k, bitmask;\
- int val;\
- bitmask = 0x01;\
- for (c = m = y = k = j = 0; j < 8; j++) {\
- val = *(mat + (--x & 127));\
- MATRIX_D(dp, y, bitmask, val);\
- if (n >= 3)\
- { MATRIX_D(dp, m, bitmask, val);\
- MATRIX_D(dp, c, bitmask, val);\
- }\
- if (n >= 4)\
- { MATRIX_D(dp, k, bitmask, val);\
- }\
- bitmask <<= 1;\
- }\
- *--yP = y;\
- if (n >= 3)\
- { *--mP = m;\
- *--cP = c;\
- }\
- if (n >= 4)\
- *--kP = k;\
- }\
- }\
-}
-/* END MACROS FOR DITHERING */
-
-/* Some convenient shorthand .. */
-#define x_dpi (pdev->x_pixels_per_inch)
-#define y_dpi (pdev->y_pixels_per_inch)
-#define CONFIG_16BIT "\033*v6W\000\003\000\005\006\005"
-#define CONFIG_24BIT "\033*v6W\000\003\000\010\010\010"
-
-/* To calculate buffer size as next greater multiple of both parameter and W */
-#define calc_buffsize(a, b) (((((a) + ((b) * W) - 1) / ((b) * W))) * W)
-
-/*
- * Miscellaneous functions for Canon BJC-600J printers in raster command mode.
- */
-#define fputshort(n, f) fputc((n)%256,f);fputc((n)/256,f)
-
-
-#define row_bytes (img_rows / 8)
-#define row_words (row_bytes / sizeof(word))
-#define min_rows (32) /* for optimization of text image printing */
-
-
-private int
-mj_raster_cmd(int c_id, int in_size, byte* in, byte* buf2,
- gx_device_printer* pdev, FILE* prn_stream)
-{
- int band_size = 1; /* 1, 8, or 24 */
-
- byte *out = buf2;
-
- int width = in_size;
- int count;
-
- byte* in_end = in + in_size;
-
- static char colour_number[] = "\004\001\002\000"; /* color ID for MJ700V2C */
-
- byte *inp = in;
- byte *outp = out;
- register byte *p, *q;
-
- /* specifying a colour */
-
- fputs("\033r",prn_stream); /* secape sequence to specify a color */
- fputc(colour_number[c_id], prn_stream);
-
- /* end of specifying a colour */
-
- /* Following codes for compression are borrowed from gdevescp.c */
-
- for( p = inp, q = inp + 1 ; q < in_end ; ) {
-
- if( *p != *q ) {
- p += 2;
- q += 2;
- } else {
-
- /*
- ** Check behind us, just in case:
- */
-
- if( p > inp && *p == *(p-1) )
- p--;
-
- /*
- ** walk forward, looking for matches:
- */
-
- for( q++ ; *q == *p && q < in_end ; q++ ) {
- if( (q-p) >= 128 ) {
- if( p > inp ) {
- count = p - inp;
- while( count > 128 ) {
- *outp++ = '\177';
- memcpy(outp, inp, 128); /* data */
- inp += 128;
- outp += 128;
- count -= 128;
- }
- *outp++ = (char) (count - 1); /* count */
- memcpy(outp, inp, count); /* data */
- outp += count;
- }
- *outp++ = '\201'; /* Repeat 128 times */
- *outp++ = *p;
- p += 128;
- inp = p;
- }
- }
-
- if( (q - p) > 2 ) { /* output this sequence */
- if( p > inp ) {
- count = p - inp;
- while( count > 128 ) {
- *outp++ = '\177';
- memcpy(outp, inp, 128); /* data */
- inp += 128;
- outp += 128;
- count -= 128;
- }
- *outp++ = (char) (count - 1); /* byte count */
- memcpy(outp, inp, count); /* data */
- outp += count;
- }
- count = q - p;
- *outp++ = (char) (256 - count + 1);
- *outp++ = *p;
- p += count;
- inp = p;
- } else /* add to non-repeating data list */
- p = q;
- if( q < in_end )
- q++;
- }
- }
-
- /*
- ** copy remaining part of line:
- */
-
- if( inp < in_end ) {
-
- count = in_end - inp;
-
- /*
- ** If we've had a long run of varying data followed by a
- ** sequence of repeated data and then hit the end of line,
- ** it's possible to get data counts > 128.
- */
-
- while( count > 128 ) {
- *outp++ = '\177';
- memcpy(outp, inp, 128); /* data */
- inp += 128;
- outp += 128;
- count -= 128;
- }
-
- *outp++ = (char) (count - 1); /* byte count */
- memcpy(outp, inp, count); /* data */
- outp += count;
- }
- /*
- ** Output data:
- */
-
- fwrite("\033.\001", 1, 3, prn_stream);
-
- if(pdev->y_pixels_per_inch == 720)
- fputc('\005', prn_stream);
- else if(pdev->y_pixels_per_inch == 180)
- fputc('\024', prn_stream);
- else /* pdev->y_pixels_per_inch == 360 */
- fputc('\012', prn_stream);
-
- if(pdev->x_pixels_per_inch == 720)
- fputc('\005', prn_stream);
- else if(pdev->x_pixels_per_inch == 180)
- fputc('\024', prn_stream);
- else /* pdev->x_pixels_per_inch == 360 */
- fputc('\012', prn_stream);
-
- fputc(band_size, prn_stream);
-
- fputc((width << 3) & 0xff, prn_stream);
- fputc( width >> 5, prn_stream);
-
- fwrite(out, 1, (outp - out), prn_stream);
-
- fputc('\r', prn_stream);
-
- return 0;
-}
-
-private int
-mj_v_skip(int n, gx_device_printer *pdev, FILE *stream)
-{
- /* This is a kind of magic number. */
- static const int max_y_step = (256 * 15 + 255);
-
- int l = n - max_y_step;
- for (; l > 0; l -= max_y_step) { /* move 256 * 15 + 255 dots at once*/
- fwrite("\033(v\2\0\xff\x0f", sizeof(byte), 7, stream);
- }
- l += max_y_step;
- /* move to the end. */
- {
- int n2 = l / 256;
- int n1 = l - n2 * 256;
- fwrite("\033(v\2\0", sizeof(byte) ,5 ,stream);
- fputc(n1, stream);
- fputc(n2, stream);
- fputc('\r', stream);
- }
- return 0;
-}
-
-/* NOZ */
-
-/* private void bld_barrier( short **bar , int x ) */
-private void
-bld_barrier( short **bar , int x )
-{
- int i , j;
-
- short t;
- short *p;
- short *b;
- short *dat = barrier_dat + 1;
-
- p = *bar++ + x + 1;
-
- for ( i = 0 ; i < 11 ; i++ ) {
- t = *dat++;
- if (*p < t )
- *p = t;
- p++;
- }
-
- for ( j = 0 ; j < 11 ; j++ ) {
- p = *bar++ + x;
- b = p;
-
- t = *dat++;
- if (*p < t )
- *p = t;
- p++;
- for ( i = 0 ; i < 11 ; i++ ) {
- t = *dat++;
- if (*p < t )
- *p = t;
- p++;
-
- if (*(--b) < t )
- *b = t;
- }
- }
-}
-
-
-private void
-DifSubK( int d0 , short *a4 , short *a5 )
-{
-/*
- +---+---+---+
- | | X |1/2|
- +---+---+---+
- |1/4|1/8|1/8|
- +---+---+---+
-*/
- *a4++ = 0;
- d0 >>= 1;
- *a4 += d0;
- d0 >>= 1;
- *(a5-1) += d0;
- d0 >>= 1;
- *a5++ += d0;
- *a5 += d0;
-}
-
-
-/* a4.w , a5.w , */
-private byte
-Xtal( byte bitmask , short d0 , int x , short **bar , short *b1 , short *b2 )
-{
- short *a2;
-
- if (d0 != 0)
- d0 += *b1;
-
- a2 = *bar + x;
-
-/*fprintf(stderr , "[%02X]",*a2);*/
- if (*a2 < d0) {
- d0 -= 16400;
- if (-4096 >= d0) {
- DifSubK( d0 , b1 , b2 );
- bld_barrier( bar , x );
- } else {
- DifSubK( d0 , b1 , b2 );
- }
- return( bitmask );
- } else {
- if (d0 > 56)
- d0 -= 56;
- DifSubK( d0 , b1 , b2 );
- return( 0 );
- }
-}
-
-
-private void
-xtal_plane( byte *dp , short *buf[] , byte *oP , short **bar , int plane_size , int xtalbuff_size )
-{
- int i;
- int j;
- int x = 0;
- byte bitmask;
- byte out;
- short *p;
- short *b1 , *b2;
-
- b1 = buf[0];
- b2 = buf[1];
-/*
- for ( i = 0 ; i < 100 ; i++ ) {
- fprintf(stderr , "[%04X]",bar[0][i]);
- }
- fprintf(stderr , "\n");
-*/
- for ( i = 0 ; i < plane_size ; i++ ) {
- bitmask = 0x80;
- out = 0;
- for ( j = 0 ; j < 8 ; j++ ) {
- out |= Xtal( bitmask , (short)(*dp) << 6 , x++ , bar , b1++ , b2++ );
- dp += 4;
- bitmask >>= 1;
- }
- *oP++ = out;
- }
-/*fprintf(stderr , "\n");*/
- p = buf[0];
-/* fprintf(stderr , "\n"); */
- buf[0] = buf[1];
- buf[1] = p;
-
-
- p = bar[0];
- for ( i = 0 ; i < plane_size*8 ; i++ )
- *p++ = 0;
-
- /* memset( p, 0, (xtalbuff_size-16) * W);*/
- p = bar[0];
- for ( i = 0 ; i <= 14 ; i++ )
- bar[i] = bar[i+1];
- bar[15] = p;
-}
-
-private int
-mj700v2c_print_page(gx_device_printer * pdev, FILE * prn_stream)
-{
- return mj_print_page(pdev, prn_stream, MJ700V2C);
-}
-
-private int
-mj500c_print_page(gx_device_printer * pdev, FILE * prn_stream)
-{
- return mj_print_page(pdev, prn_stream, MJ500C);
-}
-
-private int
-mj6000c_print_page(gx_device_printer * pdev, FILE * prn_stream)
-{
- return mj_print_page(pdev, prn_stream, MJ6000C);
-}
-
-private int
-mj8000c_print_page(gx_device_printer * pdev, FILE * prn_stream)
-{
- return mj_print_page(pdev, prn_stream, MJ8000C);
-}
-
-/* Send the page to the printer. Compress each scan line. */
-private int
-mj_print_page(gx_device_printer * pdev, FILE * prn_stream, int ptype)
-{
-/* int line_size = gdev_prn_rasterwidth(pdev, 0); */
- int line_size = gdev_prn_raster(pdev);
- int line_size_words = (line_size + W - 1) / W;
- int num_comps = pdev->color_info.num_components;
- int bits_per_pixel = pdev->color_info.depth;
- int storage_bpp = bits_per_pixel;
- int expanded_bpp = bits_per_pixel;
- int plane_size, databuff_size;
- int errbuff_size = 0;
- int outbuff_size = 0;
- int scan = 0;
- int *errors[2];
- byte *data[4], *plane_data[4][4], *out_data;
- byte *out_row, *out_row_alt;
- word *storage;
- uint storage_size_words;
- uint mj_tmp_buf_size;
- byte* mj_tmp_buf;
- int xtalbuff_size;
- short *xtalbuff;
- short *Cbar[16];
- short *Mbar[16];
- short *Ybar[16];
- short *Kbar[16];
- short *Cbuf[2];
- short *Mbuf[2];
- short *Ybuf[2];
- short *Kbuf[2];
-
- /* Tricks and cheats ... */
- if (num_comps == 3) num_comps = 4; /* print CMYK */
-
- if (storage_bpp == 8 && num_comps >= 3)
- bits_per_pixel = expanded_bpp = 3; /* Only 3 bits of each byte used */
-
- plane_size = calc_buffsize(line_size, storage_bpp);
-
- if (bits_per_pixel == 1) { /* Data printed direct from i/p */
- databuff_size = 0; /* so no data buffer required, */
- outbuff_size = plane_size * 4; /* but need separate output buffers */
- }
-
- if (bits_per_pixel > 4) { /* Error buffer for FS dithering */
- expanded_bpp = storage_bpp = /* 8, 24 or 32 bits */
- num_comps * 8;
- errbuff_size = /* 4n extra values for line ends */
- calc_buffsize((plane_size * expanded_bpp + num_comps * 4) * I, 1);
- }
-
- databuff_size = plane_size * storage_bpp;
-
- storage_size_words = ((plane_size + plane_size) * num_comps +
- databuff_size + errbuff_size + outbuff_size) / W;
-
-/* NOZ */
- xtalbuff_size = plane_size*8 + 64;
- xtalbuff = (short *) gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), xtalbuff_size*(16*4+2*4) , W, "mj_colour_print_barrier");
- memset(xtalbuff, 0, xtalbuff_size*(16*4+2*4) * W);
- {
- int i;
- short *p = xtalbuff + 16;
- for ( i = 0 ; i < 16 ; i++ ) {
- Cbar[i] = p;
- p += xtalbuff_size;
- }
- for ( i = 0 ; i < 16 ; i++ ) {
- Mbar[i] = p;
- p += xtalbuff_size;
- }
- for ( i = 0 ; i < 16 ; i++ ) {
- Ybar[i] = p;
- p += xtalbuff_size;
- }
- for ( i = 0 ; i < 16 ; i++ ) {
- Kbar[i] = p;
- p += xtalbuff_size;
- }
- Cbuf[0] = p;
- p += xtalbuff_size;
- Cbuf[1] = p;
- p += xtalbuff_size;
- Mbuf[0] = p;
- p += xtalbuff_size;
- Mbuf[1] = p;
- p += xtalbuff_size;
- Ybuf[0] = p;
- p += xtalbuff_size;
- Ybuf[1] = p;
- p += xtalbuff_size;
- Kbuf[0] = p;
- p += xtalbuff_size;
- Kbuf[1] = p;
- p += xtalbuff_size;
- }
-
- storage = (word *) gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), storage_size_words, W, "mj_colour_print_page");
-
-/* prepare a temporary buffer for mj_raster_cmd */
-
- mj_tmp_buf_size = plane_size;
- mj_tmp_buf = (byte *) gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), mj_tmp_buf_size, W ,"mj_raster_buffer");
-
-#if 0
- fprintf(stderr, "storage_size_words :%d\n", storage_size_words);
- fprintf(stderr, "mj_tmp_buf_size :%d\n", mj_tmp_buf_size);
-#endif
- /*
- * The principal data pointers are stored as pairs of values, with
- * the selection being made by the 'scan' variable. The function of the
- * scan variable is overloaded, as it controls both the alternating
- * raster scan direction used in the Floyd-Steinberg dithering and also
- * the buffer alternation required for line-difference compression.
- *
- * Thus, the number of pointers required is as follows:
- *
- * errors: 2 (scan direction only)
- * data: 4 (scan direction and alternating buffers)
- * plane_data: 4 (scan direction and alternating buffers)
- */
-
- if (storage == NULL || mj_tmp_buf == NULL) /* can't allocate working area */
- return_error(gs_error_VMerror);
- else {
- int i;
- byte *p = out_data = out_row = (byte *)storage;
- data[0] = data[1] = data[2] = p;
- data[3] = p + databuff_size;
- out_row_alt = out_row + plane_size * 2;
- if (bits_per_pixel > 1) {
- p += databuff_size;
- }
- if (bits_per_pixel > 4) {
- errors[0] = (int *)p + num_comps * 2;
- errors[1] = errors[0] + databuff_size;
- p += errbuff_size;
- }
- for (i = 0; i < num_comps; i++) {
- plane_data[0][i] = plane_data[2][i] = p;
- p += plane_size;
- }
- for (i = 0; i < num_comps; i++) {
- plane_data[1][i] = p;
- plane_data[3][i] = p + plane_size;
- p += plane_size;
- }
- if (bits_per_pixel == 1) {
- out_data = out_row = p; /* size is outbuff_size * 4 */
- out_row_alt = out_row + plane_size * 2;
- data[1] += databuff_size; /* coincides with plane_data pointers */
- data[3] += databuff_size;
- }
- }
-
- /* Clear temp storage */
- memset(storage, 0, storage_size_words * W);
-
- /* Initialize printer. */
- {
- /** Reset printer, enter graphics mode: */
-
- fwrite("\033@\033(G\001\000\001", sizeof(byte), 8, prn_stream);
-
- /** Micro-weave-Mode */
- if (mj->microweave) {
- fwrite("\033(i\001\000\001", sizeof(byte), 6, prn_stream);
- }
- /** Dot-Size define */
- if (mj->dotsize) {
- fwrite("\033(e\002\000\000\001", sizeof(byte), 7, prn_stream);
- }
-
- if (ptype == MJ6000C || ptype == MJ8000C) {
- /* Select Monochrome/Color Printing Mode Command */
- if (pdev->color_info.depth == 8)
- fwrite("\033(K\002\000\000\001", sizeof(byte), 7, prn_stream);
- }
-
- if (mj->direction) /* set the direction of the head */
- fwrite("\033U\1", 1, 3, prn_stream); /* Unidirectional Printing */
- else
- fwrite("\033U\0", 1, 3, prn_stream);
-
-#if 0
-#ifdef A4
- /*
- ** After reset, the Stylus is set up for US letter paper.
- ** We need to set the page size appropriately for A4 paper.
- ** For some bizarre reason the ESC/P2 language wants the bottom
- ** margin measured from the *top* of the page:
- */
-
- fwrite("\033(U\001\0\n\033(C\002\0t\020\033(c\004\0\0\0t\020",
- 1, 22, prn_stream);
-#endif
-#endif
-
- /*
- ** Set the line spacing to match the band height:
- */
-
- if( pdev->y_pixels_per_inch >= 720 ) {
- fwrite("\033(U\001\0\005\033+\001", sizeof(byte), 9, prn_stream);
- }
- else if( pdev->y_pixels_per_inch >= 360 )
- fwrite("\033(U\001\0\012\033+\001", sizeof(byte), 9, prn_stream);
- else /* 180 dpi */
- fwrite("\033(U\001\0\024\033+\002", sizeof(byte), 9, prn_stream);
-
- /* set the length of the page */
- fwrite("\033(C\2\0", sizeof(byte), 5, prn_stream);
- fputc(((pdev->height) % 256), prn_stream);
- fputc(((pdev->height) / 256), prn_stream);
- }
-
-#define MOFFSET (pdev->t_margin - MJ700V2C_PRINT_LIMIT) /* Print position */
-
- {
- int MJ_MARGIN_MM = 55;
- uint top_skip = ( MJ_MARGIN_MM * pdev->y_pixels_per_inch ) / 254;
- top_skip = (top_skip ^ (-1)) & 65536;
- fwrite("\033(V\2\0\0\0",sizeof(byte), 7, prn_stream);
- fwrite("\033(v\2\0\0\xff",sizeof(byte), 7, prn_stream);
- }
-
- /* Send each scan line in turn */
- {
- long int lend = pdev->height -
- (dev_t_margin_points(pdev) + dev_b_margin_points(pdev));
- int cErr, mErr, yErr, kErr;
- int this_pass, i;
- long int lnum;
- int num_blank_lines = 0;
- int start_rows = (num_comps == 1) ?
- HEAD_ROWS_MONO - 1 : HEAD_ROWS_COLOUR - 1;
- word rmask = ~(word) 0 << ((-pdev->width * storage_bpp) & (W * 8 - 1));
-
- cErr = mErr = yErr = kErr = 0;
-
- if (bits_per_pixel > 4) { /* Randomly seed initial error buffer */
- int *ep = errors[0];
- for (i = 0; i < databuff_size; i++) {
- *ep++ = (rand() % (MAXVALUE / 2)) - MAXVALUE / 4;
- }
- }
-
-
- this_pass = start_rows;
-
-
- lnum = 0;
-
- /* for Debug */
-
- for (; lnum < lend; lnum++) {
- word *data_words = (word *)data[scan];
- register word *end_data = data_words + line_size_words;
- gx_color_index *p_data;
-
- gdev_prn_copy_scan_lines(pdev, lnum, data[scan], line_size);
-
- /* Mask off 1-bits beyond the line width. */
- end_data[-1] &= rmask;
-
- /* Remove trailing 0s. */
- while (end_data > data_words && end_data[-1] == 0)
- end_data--;
- if (end_data == data_words) { /* Blank line */
- num_blank_lines++;
- continue; /* skip to for (lnum) loop */
- }
- /* Skip blank lines if any */
- if (num_blank_lines > 0 ) {
- mj_v_skip(num_blank_lines, pdev, prn_stream);
- memset(plane_data[1 - scan][0], 0, plane_size * num_comps);
- num_blank_lines = 0;
- this_pass = start_rows;
- }
-
- /* Correct color depth. */
- if (mj->density != 1024 || mj->yellow != 1024 || mj->cyan != 1024
- || mj->magenta != 1024 || mj->black != 1024 ) {
- for (p_data = (gx_color_index*) data_words; p_data < end_data; p_data++) {
- *p_data = mjc_correct_color(pdev, *p_data);
- }
- }
-
- { /* Printing non-blank lines */
- register byte *kP = plane_data[scan + 2][3];
- register byte *cP = plane_data[scan + 2][2];
- register byte *mP = plane_data[scan + 2][1];
- register byte *yP = plane_data[scan + 2][0];
- register byte *dp = data[scan + 2];
- int zero_row_count;
- int i, j;
- byte *odp;
-
- if (this_pass)
- this_pass--;
- else
- this_pass = start_rows;
-
- if (expanded_bpp > bits_per_pixel) /* Expand line if required */
- expand_line(data_words, line_size, bits_per_pixel, expanded_bpp);
-
- /* In colour modes, we have some bit-shuffling to do before
- * we can print the data; in FS mode we also have the
- * dithering to take care of. */
- switch (expanded_bpp) { /* Can be 1, 3, 8, 24 or 32 */
- case 3:
- /* Transpose the data to get pixel planes. */
- for (i = 0, odp = plane_data[scan][0]; i < databuff_size;
- i += 8, odp++) { /* The following is for 16-bit
- * machines */
-#define spread3(c)\
- { 0, c, c*0x100, c*0x101, c*0x10000L, c*0x10001L, c*0x10100L, c*0x10101L }
- static word spr40[8] = spread3(0x40);
- static word spr08[8] = spread3(8);
- static word spr02[8] = spread3(2);
- register byte *dp = data[scan] + i;
- register word pword =
- (spr40[dp[0]] << 1) +
- (spr40[dp[1]]) +
- (spr40[dp[2]] >> 1) +
- (spr08[dp[3]] << 1) +
- (spr08[dp[4]]) +
- (spr08[dp[5]] >> 1) +
- (spr02[dp[6]]) +
- (spr02[dp[7]] >> 1);
- odp[0] = (byte) (pword >> 16);
- odp[plane_size] = (byte) (pword >> 8);
- odp[plane_size * 2] = (byte) (pword);
- }
- break;
-
- case 8:
- FSDline(scan, i, j, plane_size, cErr, mErr, yErr, kErr,
- cP, mP, yP, kP, 1);
- break;
- case 24:
- FSDline(scan, i, j, plane_size, cErr, mErr, yErr, kErr,
- cP, mP, yP, kP, 3);
- break;
- case 32:
- if (scan == 1) {
- dp -= plane_size*8*4;
- cP -= plane_size;
- mP -= plane_size;
- yP -= plane_size;
- kP -= plane_size;
- }
-/*
-{
- byte *p = dp;
- int i;
- for ( i = 0 ; i < plane_size ; i++ ) {
- fprintf ( stderr , "[%02X%02X%02X%02X]" , p[0] , p[1] , p[2] , p[3] );
- p += 4;
- }
- fprintf( stderr , "\n");
-
-}
-*/
-/*
- FSDline(scan, i, j, plane_size, cErr, mErr, yErr, kErr,
- cP, mP, yP, kP, 4);
-*/
-/* NOZ */
- xtal_plane( dp++ , Kbuf , kP , Kbar , plane_size , xtalbuff_size );
- xtal_plane( dp++ , Cbuf , cP , Cbar , plane_size , xtalbuff_size );
- xtal_plane( dp++ , Mbuf , mP , Mbar , plane_size , xtalbuff_size );
- xtal_plane( dp++ , Ybuf , yP , Ybar , plane_size , xtalbuff_size );
-
- break;
-
- } /* switch(expanded_bpp) */
-
-
- /* Make sure all black is in the k plane */
- if (num_comps == 4 ) {
- if (mj->colorcomp > 3 ) {
- register word *kp = (word *)plane_data[scan][3];
- register word *cp = (word *)plane_data[scan][2];
- register word *mp = (word *)plane_data[scan][1];
- register word *yp = (word *)plane_data[scan][0];
- if (bits_per_pixel > 4) { /* This has been done as 4 planes */
-#if 0
- for (i = 0; i < plane_size / W; i++) {
- word bits = ~*kp++;
- *cp++ &= bits;
- *mp++ &= bits;
- *yp++ &= bits;
- }
-#endif
- } else { /* This has really been done as 3 planes */
- for (i = 0; i < plane_size / W; i++) {
- word bits = *cp & *mp & *yp;
- *kp++ = bits;
- bits = ~bits;
- *cp++ &= bits;
- *mp++ &= bits;
- *yp++ &= bits;
- }
- }
- } else if (mj->colorcomp == 3 ) {
- register word *kp = (word *)plane_data[scan][3];
- register word *cp = (word *)plane_data[scan][2];
- register word *mp = (word *)plane_data[scan][1];
- register word *yp = (word *)plane_data[scan][0];
- if (bits_per_pixel > 4) { /* This has been done as 4 planes */
- for (i = 0; i < plane_size / W; i++) {
- word bits = *kp++; /* kp will not be used when printing */
- *cp++ |= bits;
- *mp++ |= bits;
- *yp++ |= bits;
- }
- } else { /* This has really been done as 3 planes */
- }
- }
- }
-
- /* Transfer raster graphics
- * in the order (K), C, M, Y. */
- switch (mj->colorcomp) {
- case 1:
- zero_row_count = 0;
- out_data = (byte*) plane_data[scan][0];
- /* 3 for balck */
- mj_raster_cmd(3, plane_size, out_data, mj_tmp_buf, pdev, prn_stream);
- break;
- case 3:
- for (zero_row_count = 0, i = 3 - 1; i >= 0; i--) {
- out_data = (byte*) plane_data[scan][i];
- mj_raster_cmd(i, plane_size, out_data, mj_tmp_buf, pdev, prn_stream);
- }
- break;
- default:
- for (zero_row_count = 0, i = num_comps - 1; i >= 0; i--) {
- out_data = (byte*) plane_data[scan][i];
- mj_raster_cmd(i, plane_size, out_data, mj_tmp_buf, pdev, prn_stream);
- }
- break;
- } /* Transfer Raster Graphics ... */
-
- {
- if ( pdev->y_pixels_per_inch > 360 ) {
- fwrite("\033(v\2\0\1\0",sizeof(byte),7, prn_stream);
- } else {
- fputc('\n', prn_stream);
- }
- }
- scan = 1 - scan; /* toggle scan direction */
- } /* Printing non-blank lines */
- } /* for lnum ... */
- } /* send each scan line in turn */
-
-
- /* end raster graphics & reset printer */
-
- /* eject page */
- {
- fputs("\f\033@", prn_stream);
- fflush(prn_stream);
- }
- /* free temporary storage */
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *) storage, storage_size_words, W, "mj_colour_print_page");
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *) mj_tmp_buf, mj_tmp_buf_size, W, "mj_raster_buffer");
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *) xtalbuff , xtalbuff_size*(16*4+2*4) , W, "mj_colour_print_barrier");
-
- return 0;
-}
-
-private void
-mj_color_correct(gx_color_value *Rptr ,gx_color_value *Gptr , gx_color_value *Bptr )
- /* R,G,B : 0 to 255 */
-{
- short R,G,B; /* R,G,B : 0 to 255 */
- short C,M,Y; /* C,M,Y : 0 to 1023 */
- short H,D,Wa; /* ese-HSV */
- long S; /* HSV */
-
-
- R = *Rptr;
- G = *Gptr;
- B = *Bptr;
- if (R==G) {
- if (G==B) { /* R=G=B */
- C=M=Y=1023-v_tbl[R];
- *Rptr = C;
- *Gptr = M;
- *Bptr = Y;
- return;
- } else if (G>B) { /* R=G>B */
- D = G-B;
- Wa = R;
- H = 256;
- } else { /* B>R=G */
- D = G-B;
- Wa = R;
- H = 1024;
- }
- }
-
- if (R>G) {
- if (G>=B) { /* R>G>B */
- Wa=R;
- D=R-B;
- H=(G-B)*256/D;
- } else if (R>B) { /* R>B>G */
- Wa=R;
- D=R-G;
- H=1536-(B-G)*256/D;
- } else { /* B>R>G */
- Wa=B;
- D=B-G;
- H=1024+(R-G)*256/D;
- }
- } else {
- if (R>B) { /* G>R>B */
- Wa=G;
- D=G-B;
- H=512-(R-B)*256/D;
- } else if (G>B) { /* G>B>R */
- Wa=G;
- D=G-R;
- H=512+(B-R)*256/D;
- } else { /* B>G>R */
- Wa=B;
- D=B-R;
- H=1024-(G-R)*256/D;
- }
- }
-
- if(Wa!=0){
- if(Wa==D){
- Wa=v_tbl[Wa];
- D=Wa/4;
- } else {
- S=((long)D<<16)/Wa;
- Wa=v_tbl[Wa];
- D= ( ((long)S*Wa)>>18 );
- }
- }
- Wa=1023-Wa;
-
- C=(HtoCMY[H*3 ])*D/256+Wa;
- M=(HtoCMY[H*3+1])*D/256+Wa;
- Y=(HtoCMY[H*3+2])*D/256+Wa;
- if (C<0)
- C=0;
- if (M<0)
- M=0;
- if (Y<0)
- Y=0;
-
- if(H>256 && H<1024){ /* green correct */
- short work;
- work=(((long)grnsep[M]*(long)grnsep2[H-256])>>16);
- C+=work;
- Y+=work+work;
- M-=work+work;
- if(C>1023) C=1023;
- if(Y>1023) Y=1023;
- }
-
- *Rptr = C;
- *Gptr = M;
- *Bptr = Y;
-}
-
-/*
- * Map a r-g-b color to a color index.
- * We complement the colours, since we're using cmy anyway, and
- * because the buffering routines expect white to be zero.
- * Includes colour balancing, following HP recommendations, to try
- * and correct the greenish cast resulting from an equal mix of the
- * c, m, y, inks by reducing the cyan component to give a truer black.
- */
-private gx_color_index
-gdev_mjc_map_rgb_color(gx_device *pdev, const gx_color_value cv[])
-{
- gx_color_value r, g, b;
-
- r = cv[0]; g = cv[1]; b = cv[2];
- if (gx_color_value_to_byte(r & g & b) == 0xff)
- return (gx_color_index)0; /* white */
- else {
- gx_color_value c = gx_max_color_value - r;
- gx_color_value m = gx_max_color_value - g;
- gx_color_value y = gx_max_color_value - b;
-
- switch (pdev->color_info.depth) {
- case 1:
- return ((c | m | y) > gx_max_color_value / 2 ?
- (gx_color_index)1 : (gx_color_index)0);
- case 8:
- if (pdev->color_info.num_components >= 3)
-#define gx_color_value_to_1bit(cv) ((cv) >> (gx_color_value_bits - 1))
- return (gx_color_value_to_1bit(c) +
- (gx_color_value_to_1bit(m) << 1) +
- (gx_color_value_to_1bit(y) << 2));
- else
-#define red_weight 306
-#define green_weight 601
-#define blue_weight 117
- return ((((word)c * red_weight +
- (word)m * green_weight +
- (word)y * blue_weight)
- >> (gx_color_value_bits + 2)));
- case 16:
-#define gx_color_value_to_5bits(cv) ((cv) >> (gx_color_value_bits - 5))
-#define gx_color_value_to_6bits(cv) ((cv) >> (gx_color_value_bits - 6))
- return (gx_color_value_to_5bits(y) +
- (gx_color_value_to_6bits(m) << 5) +
- (gx_color_value_to_5bits(c) << 11));
- case 24:
- return (gx_color_value_to_byte(y) +
- (gx_color_value_to_byte(m) << 8) +
- ((word)gx_color_value_to_byte(c) << 16));
- case 32:
- {
- gx_color_value k;
- c = gx_color_value_to_byte(r);
- m = gx_color_value_to_byte(g);
- y = gx_color_value_to_byte(b);
-
- mj_color_correct( &c , &m , &y );
-
- c = esp_dat_c[c];
- m = esp_dat_m[m];
- y = esp_dat_y[y];
-
- k = c <= m ? (c <= y ? c : y) : (m <= y ? m : y);
- k = black_sep[ k >> 4 ] >> 6;
- c >>= 6;
- m >>= 6;
- y >>= 6;
-
- return ( (y - k) + ((m - k) << 8) +
- ((word)(c - k) << 16) + ((word)(k) << 24) );
- }
- }
- }
- return (gx_color_index)0; /* This never happens */
-}
-
-/* Map a color index to a r-g-b color. */
-private int
-gdev_mjc_map_color_rgb(gx_device *pdev, gx_color_index color,
- gx_color_value prgb[3])
-{
- /* For the moment, we simply ignore any black correction */
- switch (pdev->color_info.depth) {
- case 1:
- prgb[0] = prgb[1] = prgb[2] = -((gx_color_value)color ^ 1);
- break;
- case 8:
- if (pdev->color_info.num_components >= 3)
- { gx_color_value c = (gx_color_value)color ^ 7;
- prgb[0] = -(c & 1);
- prgb[1] = -((c >> 1) & 1);
- prgb[2] = -(c >> 2);
- }
- else
- { gx_color_value value = (gx_color_value)color ^ 0xff;
- prgb[0] = prgb[1] = prgb[2] = (value << 8) + value;
- }
- break;
- case 16:
- { gx_color_value c = (gx_color_value)color ^ 0xffff;
- ushort value = c >> 11;
- prgb[0] = ((value << 11) + (value << 6) + (value << 1) +
- (value >> 4)) >> (16 - gx_color_value_bits);
- value = (c >> 6) & 0x3f;
- prgb[1] = ((value << 10) + (value << 4) + (value >> 2))
- >> (16 - gx_color_value_bits);
- value = c & 0x1f;
- prgb[2] = ((value << 11) + (value << 6) + (value << 1) +
- (value >> 4)) >> (16 - gx_color_value_bits);
- }
- break;
- case 24:
- { gx_color_value c = (gx_color_value)color ^ 0xffffff;
- prgb[0] = gx_color_value_from_byte(c >> 16);
- prgb[1] = gx_color_value_from_byte((c >> 8) & 0xff);
- prgb[2] = gx_color_value_from_byte(c & 0xff);
- }
- break;
- case 32:
-#define gx_maxcol gx_color_value_from_byte(gx_color_value_to_byte(gx_max_color_value))
- { gx_color_value w = gx_maxcol - gx_color_value_from_byte(color >> 24);
- prgb[0] = w - gx_color_value_from_byte((color >> 16) & 0xff);
- prgb[1] = w - gx_color_value_from_byte((color >> 8) & 0xff);
- prgb[2] = w - gx_color_value_from_byte(color & 0xff);
- }
- break;
- }
- return 0;
-}
-
-/*
- * Convert and expand scanlines:
- *
- * (a) 16 -> 24 bit (1-stage)
- * (b) 16 -> 32 bit (2-stage)
- * or (c) 24 -> 32 bit (1-stage)
- */
-private void
-expand_line(word *line, int linesize, int bpp, int ebpp)
-{
- int endline = linesize;
- byte *start = (byte *)line;
- register byte *in, *out;
-
- if (bpp == 16) /* 16 to 24 (cmy) if required */
- { register byte b0, b1;
- endline = ((endline + 1) / 2);
- in = start + endline * 2;
- out = start + (endline *= 3);
-
- while (in > start)
- { b0 = *--in;
- b1 = *--in;
- *--out = (b0 << 3) + ((b0 >> 2) & 0x7);
- *--out = (b1 << 5) + ((b0 >> 3) & 0x1c) + ((b1 >> 1) & 0x3);
- *--out = (b1 & 0xf8) + (b1 >> 5);
- }
- }
-
- if (ebpp == 32) /* 24 (cmy) to 32 (cmyk) if required */
- { register byte c, m, y, k;
- endline = ((endline + 2) / 3);
- in = start + endline * 3;
- out = start + endline * 4;
-
- while (in > start)
- { y = *--in;
- m = *--in;
- c = *--in;
- k = c < m ? (c < y ? c : y) : (m < y ? m : y);
- *--out = y - k;
- *--out = m - k;
- *--out = c - k;
- *--out = k;
- }
- }
-}
-
-private int
-put_param_int(gs_param_list *plist, gs_param_name pname, int *pvalue, int minval, int maxval, int ecode)
-{ int code, value;
- switch ( code = param_read_int(plist, pname, &value) )
- {
- default:
- return code;
- case 1:
- return ecode;
- case 0:
- if ( value < minval || value > maxval )
- param_signal_error(plist, pname, gs_error_rangecheck);
- *pvalue = value;
- return (ecode < 0 ? ecode : 1);
- }
-}
-
-private void
-set_bpp(gx_device *pdev, int bits_per_pixel)
-{ gx_device_color_info *ci = &pdev->color_info;
- /* Only valid bits-per-pixel are 1, 3, 8, 16, 24, 32 */
- int bpp = bits_per_pixel < 3 ? 1 : bits_per_pixel < 8 ? 3 :
- (bits_per_pixel >> 3) << 3;
- ci->num_components = ((bpp == 1) || (bpp == 8) ? 1 : 3);
- ci->depth = ((bpp > 1) && (bpp < 8) ? 8 : bpp);
- ci->max_gray = (bpp >= 8 ? 255 : 1);
- ci->max_color = (bpp >= 8 ? 255 : bpp > 1 ? 1 : 0);
- ci->dither_grays = (bpp >= 8 ? 5 : 2);
- ci->dither_colors = (bpp >= 8 ? 5 : bpp > 1 ? 2 : 0);
- mj->colorcomp = (bpp == 8 ? 1 : 4);
-}
-
-private void
-mj500c_set_bpp(gx_device *pdev, int bits_per_pixel)
-{ gx_device_color_info *ci = &pdev->color_info;
- /* Only valid bits-per-pixel are 1, 3, 8, 16, 24, 32 */
- int bpp = bits_per_pixel < 3 ? 1 : bits_per_pixel < 8 ? 3 :
- (bits_per_pixel >> 3) << 3;
- ci->num_components = ((bpp == 1) || (bpp == 8) ? 1 : 3);
- ci->depth = ((bpp > 1) && (bpp < 8) ? 8 : bpp);
- ci->max_gray = (bpp >= 8 ? 255 : 1);
- ci->max_color = (bpp >= 8 ? 255 : bpp > 1 ? 1 : 0);
- ci->dither_grays = (bpp >= 8 ? 5 : 2);
- ci->dither_colors = (bpp >= 8 ? 5 : bpp > 1 ? 2 : 0);
- mj->colorcomp = (bpp == 8 ? 1 : 3);
-}
-
-private gx_color_index
-mjc_correct_color(gx_device_printer *pdev, gx_color_index ci)
-{
- gx_color_index c, m, y, k, co;
- gx_color_index c2, m2, y2, k2;
- gx_color_index k3, k4, k5, k6, k7, k8;
- const uint cmask = 0xff;
- uint dn = mj->density;
- uint mjy = mj->yellow;
- uint mjc = mj->cyan;
- uint mjm = mj->magenta;
- uint mjb = mj->black;
- switch (pdev->color_info.depth) {
- case 8:
- k = ((ci & cmask) * (mjb)) >> 10;
- k = (k < cmask) ? k : cmask;
- k2 = (((ci >> 8) & cmask) * (mjb)) >> 10;
- k2 = (k2 < cmask) ? k2 : cmask;
- k3 = (((ci >> 16) & cmask) * (mjb)) >> 10;
- k3 = (k3 < cmask) ? k3 : cmask;
- k4 = (((ci >> 24) & cmask) * (mjb)) >> 10;
- k4 = (k4 < cmask) ? k4 : cmask;
-#if __WORDSIZE == 64
- /* This code is ugly... (for 64 bit OS) */
- if (sizeof(word) == 8)
- {
- k5 = (((ci >> 32) & cmask) * (mjb)) >> 10;
- k5 = (k5 < cmask) ? k5 : cmask;
- k6 = (((ci >> 40) & cmask) * (mjb)) >> 10;
- k6 = (k6 < cmask) ? k6 : cmask;
- k7 = (((ci >> 48) & cmask) * (mjb)) >> 10;
- k7 = (k7 < cmask) ? k7 : cmask;
- k8 = (((ci >> 56) & cmask) * (mjb)) >> 10;
- k8 = (k8 < cmask) ? k8 : cmask;
- co = k + (k2 << 8) + (k3 << 16) + (k4 << 24)
- + (k5 << 32) + (k6 << 40) + (k7 << 48) + (k8 << 56);
- if (ci != co)
- dprintf1("%s\n", "error");
- return co;
- }
-#endif
- return k + (k2 << 8) + (k3 << 16) + (k << 24);
- break;
- case 32:
- y = ((ci & cmask) * mjy * dn) >> 20;
- y = (y < cmask) ? y : cmask;
- m = (((ci >> 8) & cmask) * mjm * dn) >> 20;
- m = (m < cmask) ? m : cmask;
- c = (((ci >> 16) & cmask) * mjc * dn) >> 20;
- c = (c < cmask) ? c : cmask;
- k = (((ci >> 24) & cmask) * mjb * dn) >> 20;
- k = (k < cmask) ? k : cmask;
-#if __WORDSIZE == 64
- /* This code is ugly... (for 64 bit OS) */
- if (sizeof(word) == 8)
- {
- y2 = (((ci >> 32) & cmask) * mjy * dn) >> 20;
- y2 = (y2 < cmask) ? y2 : cmask;
- m2 = (((ci >> 40) & cmask) * mjm * dn) >> 20;
- m2 = (m2 < cmask) ? m2 : cmask;
- c2 = (((ci >> 48) & cmask) * mjc * dn) >> 20;
- c2 = (c2 < cmask) ? c2 : cmask;
- k2 = (((ci >> 56) & cmask) * mjb * dn) >> 20;
- k2 = (k2 < cmask) ? k2 : cmask;
-
- co = y + (m << 8) + (c << 16) + (k << 24)
- + (y2 << 32) + (m2 << 40) + (c2 << 48) + (k2 << 56);
-
- return co;
- }
-#endif
- co = (y + (m << 8) + (c << 16) + (k << 24));
-/* fprintf(stderr,"%d,%d:%d,%d,%d,%d\n", ci,co, y, m, c, k); */
- return co;
-/* return (gx_color_value_to_byte(y) +
- (gx_color_value_to_byte(m) << 8) +
- ((word)gx_color_value_to_byte(c) << 16) +
- ((word)gx_color_value_to_byte(k) << 24)); */
- break;
- }
- return ci;
-}
diff --git a/gs/contrib/japanese/gdevmjc.h b/gs/contrib/japanese/gdevmjc.h
deleted file mode 100644
index ee2c0df30..000000000
--- a/gs/contrib/japanese/gdevmjc.h
+++ /dev/null
@@ -1,3220 +0,0 @@
-unsigned short matrix2[] = { /* 128 x 128 */
- 0x0C3E,0x31BE,0x249A,0x0B88,0x2898,0x162F,0x2AEE,0x12D4,
- 0x20F1,0x3E08,0x0E3C,0x244A,0x3C5C,0x102A,0x36AE,0x0DB5,
- 0x27D2,0x3774,0x01D0,0x3A3B,0x18C7,0x356C,0x0E6C,0x2938,
- 0x1AB3,0x3B3E,0x04D9,0x2BF8,0x1C80,0x087C,0x2F7E,0x043B,
- 0x295E,0x097F,0x30AE,0x1722,0x38C5,0x1F2A,0x0491,0x2B7B,
- 0x169B,0x2887,0x1413,0x325B,0x03CD,0x2CF4,0x119A,0x2471,
- 0x19A8,0x2735,0x14AA,0x3D50,0x20F5,0x0141,0x22B3,0x2FA0,
- 0x0656,0x23CF,0x1BE4,0x3010,0x0712,0x1D9F,0x375C,0x1205,
- 0x3080,0x06B0,0x2922,0x0307,0x2CC4,0x0823,0x3E98,0x2587,
- 0x0CA3,0x2954,0x038C,0x3073,0x2549,0x0DE1,0x3124,0x0445,
- 0x2C5E,0x07B5,0x2A4E,0x0A5E,0x35B0,0x0332,0x2382,0x3192,
- 0x04A9,0x2C00,0x171D,0x2F1A,0x0DDC,0x2927,0x03A5,0x261E,
- 0x083F,0x3B04,0x1DFE,0x044C,0x2B6C,0x09BA,0x1735,0x3D78,
- 0x1D30,0x08BD,0x37CD,0x20D0,0x0682,0x22CF,0x2FCC,0x1155,
- 0x326E,0x1845,0x2364,0x2C10,0x19E2,0x088A,0x3B49,0x1873,
- 0x3482,0x0FF4,0x27F5,0x0CD4,0x2E0A,0x1382,0x22D3,0x2B6E,
- 0x3BFF,0x016F,0x1992,0x3F5F,0x05CB,0x38EF,0x0CFB,0x356B,
- 0x275C,0x0403,0x2DAF,0x1D82,0x010F,0x2645,0x1A9D,0x2EF8,
- 0x05D7,0x1C57,0x30C4,0x0BA3,0x2E75,0x0429,0x1DF0,0x3D8E,
- 0x0960,0x2096,0x3321,0x0EF7,0x3AAE,0x2316,0x1939,0x37FD,
- 0x1469,0x3B05,0x1034,0x2CAE,0x0842,0x2EB8,0x22EC,0x0C54,
- 0x3443,0x0143,0x2F86,0x1859,0x39D5,0x15D1,0x3584,0x0019,
- 0x3C08,0x09C2,0x2B6F,0x073C,0x2F02,0x1B5B,0x3A29,0x1058,
- 0x1F25,0x3CEB,0x03E2,0x24FA,0x18A2,0x31A8,0x0922,0x2611,
- 0x1A5B,0x3F46,0x11A2,0x3515,0x1543,0x3105,0x0F0C,0x1FAF,
- 0x2D16,0x17D3,0x3D90,0x1F42,0x0699,0x3BFD,0x1355,0x37A8,
- 0x10CD,0x3FA7,0x12A9,0x27DA,0x160A,0x2DBE,0x1AE2,0x10A4,
- 0x3E93,0x1DD2,0x0A31,0x21BC,0x3BFB,0x155A,0x35CD,0x13C5,
- 0x32B2,0x22D7,0x105B,0x33BE,0x1AA7,0x221E,0x3243,0x0377,
- 0x2F55,0x1FFF,0x0EB8,0x32F2,0x1B3E,0x3A3C,0x03AB,0x28B3,
- 0x0829,0x3F37,0x029E,0x154A,0x3D3D,0x2269,0x14C2,0x2EE5,
- 0x0798,0x2A1B,0x02FD,0x3251,0x1B18,0x3DEC,0x0467,0x1CB9,
- 0x104F,0x220F,0x2C3C,0x1118,0x2DD5,0x1ADD,0x2407,0x06E0,
- 0x1928,0x37FC,0x13AB,0x34E2,0x1772,0x3ABA,0x08A2,0x22D6,
- 0x3D59,0x10FF,0x25AF,0x1ED2,0x0F89,0x394D,0x23CC,0x14F4,
- 0x2D0A,0x1286,0x24D3,0x1E4A,0x00A5,0x3409,0x0C91,0x208F,
- 0x26C4,0x01A7,0x23A8,0x198B,0x35B5,0x0F08,0x3C7E,0x1929,
- 0x21C5,0x3B6A,0x0D90,0x2594,0x07F0,0x29F6,0x0BF1,0x28A2,
- 0x13FA,0x30B3,0x1890,0x389C,0x10DB,0x291C,0x0B24,0x259C,
- 0x31ED,0x0EE0,0x2AC5,0x0C6C,0x3C50,0x157E,0x20B0,0x3B87,
- 0x04B0,0x1FFC,0x24C1,0x09CD,0x27A8,0x18F8,0x35AD,0x015E,
- 0x39AB,0x08C8,0x2300,0x1515,0x3478,0x1C1E,0x2378,0x094E,
- 0x25F0,0x1D94,0x33B2,0x0590,0x3D54,0x0D15,0x3840,0x268E,
- 0x0882,0x2819,0x36C8,0x1C99,0x0674,0x2E0F,0x09A0,0x2A2F,
- 0x1C23,0x0126,0x37F3,0x2014,0x0640,0x3AB3,0x112E,0x2A22,
- 0x14B0,0x3C39,0x2744,0x00D1,0x2BDF,0x1465,0x31C8,0x1330,
- 0x2DEA,0x1AF8,0x2179,0x2E74,0x0C89,0x2ADF,0x0127,0x1D92,
- 0x382E,0x162D,0x3CED,0x2143,0x08D9,0x2745,0x180B,0x3045,
- 0x1F0F,0x3956,0x0857,0x369A,0x207B,0x0256,0x3C98,0x1D3B,
- 0x2CC1,0x1057,0x28E2,0x0B17,0x2C13,0x155E,0x3148,0x0E65,
- 0x203F,0x336D,0x0721,0x3F48,0x2A60,0x19D6,0x0853,0x35A3,
- 0x0335,0x3891,0x0753,0x3F18,0x27C0,0x12E6,0x2CD6,0x06BD,
- 0x32E4,0x1B13,0x3F98,0x0594,0x2569,0x1E35,0x0265,0x321C,
- 0x08AF,0x1B82,0x2CAF,0x1304,0x32F8,0x1DED,0x3D27,0x0FFC,
- 0x34F8,0x1D1A,0x0300,0x21D3,0x32D2,0x04F2,0x3E36,0x1A8F,
- 0x023B,0x3811,0x1406,0x3350,0x1D51,0x0157,0x2EFF,0x103E,
- 0x33C9,0x0E9A,0x3728,0x1B00,0x3B2E,0x0523,0x1CD1,0x2A38,
- 0x11C7,0x1E8F,0x36FE,0x0D0A,0x2762,0x0105,0x2F49,0x1A9A,
- 0x3244,0x01C8,0x18BA,0x2E6E,0x1DFB,0x24F9,0x0116,0x1861,
- 0x3520,0x15FA,0x02D0,0x2CCE,0x178F,0x22CB,0x38C1,0x0ED0,
- 0x3DC7,0x18D5,0x29E2,0x0B5E,0x2E3D,0x16A7,0x2652,0x0C06,
- 0x317D,0x072F,0x1988,0x355F,0x0C2C,0x248C,0x08F1,0x3834,
- 0x1FB3,0x0D5B,0x340E,0x064F,0x36BE,0x113B,0x3A1D,0x256B,
- 0x0DF3,0x2C2B,0x0C0F,0x196C,0x33AB,0x11DA,0x37BC,0x066B,
- 0x326C,0x0F18,0x1DBD,0x2513,0x14C6,0x3023,0x0F72,0x3425,
- 0x0907,0x3FC1,0x030D,0x3670,0x2217,0x04DD,0x1CB2,0x3836,
- 0x026C,0x184D,0x2DA6,0x165B,0x004B,0x2616,0x305D,0x11D1,
- 0x289B,0x17E4,0x2E62,0x1685,0x0A47,0x370B,0x1855,0x3D62,
- 0x10E5,0x2E22,0x0E19,0x2BD3,0x1182,0x3A07,0x28F0,0x104D,
- 0x2048,0x35F4,0x04E2,0x3FC7,0x1A0A,0x0299,0x2183,0x2E4B,
- 0x05D9,0x25EC,0x3F5E,0x0D2F,0x1D95,0x2A52,0x13A4,0x2DCC,
- 0x217B,0x1818,0x2C96,0x05A4,0x26C5,0x392A,0x0B6F,0x2B16,
- 0x1850,0x2E72,0x00A2,0x2C36,0x1320,0x230C,0x3CB8,0x0D59,
- 0x340F,0x2512,0x0330,0x2D9C,0x185D,0x3B23,0x1204,0x38A8,
- 0x0EA0,0x2111,0x39EB,0x14D2,0x08DB,0x3AB7,0x1C61,0x30DB,
- 0x0E0B,0x2457,0x3952,0x1009,0x3E4B,0x01B0,0x1EDD,0x30A0,
- 0x0562,0x2788,0x0F85,0x3CB0,0x1447,0x357D,0x019B,0x3F72,
- 0x1003,0x246B,0x3931,0x1196,0x1EA8,0x3EA2,0x18CA,0x2620,
- 0x018E,0x3A95,0x1703,0x269A,0x1BAF,0x31F0,0x0933,0x19AA,
- 0x30CD,0x0555,0x24A5,0x39B5,0x00E3,0x29A0,0x0D84,0x247E,
- 0x02E4,0x2805,0x3D48,0x047B,0x3359,0x0A70,0x2A68,0x1797,
- 0x2568,0x1414,0x2E1C,0x1C39,0x0D69,0x3DE2,0x2834,0x116C,
- 0x2978,0x3C1C,0x0968,0x21E9,0x3227,0x13BE,0x1FEA,0x3E14,
- 0x0BEB,0x349B,0x0D6C,0x20E3,0x30FE,0x1C05,0x02D8,0x245E,
- 0x1F4C,0x080E,0x386D,0x1EBA,0x313B,0x09E4,0x16F9,0x3E62,
- 0x26B7,0x0B8A,0x2A64,0x0F94,0x2750,0x3717,0x0B06,0x17E7,
- 0x3AA6,0x1247,0x2360,0x19CE,0x37B1,0x0C3B,0x3607,0x07B7,
- 0x39F6,0x0976,0x1E03,0x3FD4,0x0DA2,0x1964,0x34FA,0x22EF,
- 0x07FB,0x1D79,0x395D,0x2158,0x0954,0x3208,0x15CB,0x2EE6,
- 0x06FB,0x19A7,0x3FD4,0x13A6,0x3331,0x0BAD,0x2A9B,0x0476,
- 0x26D3,0x347E,0x0C34,0x2331,0x2BAE,0x0FF8,0x2D57,0x06A6,
- 0x3D10,0x1E54,0x0B85,0x3219,0x1A77,0x2994,0x0C3F,0x23DD,
- 0x158B,0x36F8,0x20A9,0x03FB,0x2BE2,0x0EF6,0x2893,0x17B0,
- 0x2CBF,0x1DAE,0x031B,0x21E6,0x2E89,0x049B,0x324A,0x1101,
- 0x3032,0x22B0,0x098B,0x3DD1,0x03EF,0x23C9,0x1E0B,0x3F5A,
- 0x11D3,0x3522,0x0E61,0x1C04,0x2F7A,0x15A6,0x3EA8,0x1AB0,
- 0x3A8B,0x1875,0x0C74,0x2BF0,0x130B,0x3B22,0x1C73,0x0130,
- 0x38C0,0x1F32,0x0698,0x3B50,0x1903,0x239D,0x0A5F,0x34A2,
- 0x2110,0x0F04,0x1DD7,0x380C,0x0C9A,0x3B76,0x052A,0x1AC4,
- 0x2B8B,0x01E1,0x2442,0x3BC4,0x0545,0x268A,0x39AD,0x0DC6,
- 0x362A,0x2760,0x1521,0x0042,0x1A4D,0x367C,0x2218,0x038B,
- 0x1498,0x394F,0x1D77,0x31FB,0x0718,0x2348,0x1CDD,0x2AD3,
- 0x0E17,0x2ED7,0x0844,0x2CD2,0x0103,0x2691,0x173E,0x2837,
- 0x12CE,0x3143,0x24A6,0x11A0,0x2DAC,0x2195,0x0439,0x1468,
- 0x3E12,0x29C5,0x0E00,0x1696,0x3ED9,0x1C46,0x0297,0x2200,
- 0x385D,0x285D,0x09E5,0x298C,0x05E4,0x24C6,0x16E3,0x3EB8,
- 0x1CA2,0x0719,0x1FFB,0x3DA7,0x03BE,0x3625,0x16D4,0x2097,
- 0x28AA,0x04C2,0x2B63,0x1F84,0x0735,0x3784,0x140E,0x3C3D,
- 0x1DCC,0x08E7,0x31F5,0x1885,0x21E5,0x38DE,0x0A64,0x34BF,
- 0x05BA,0x3B71,0x1A7B,0x3432,0x0F4D,0x2A95,0x0B0C,0x3C62,
- 0x1D48,0x0E79,0x2C8C,0x129F,0x2A7C,0x1404,0x2D42,0x0225,
- 0x29CE,0x16B7,0x3C61,0x21B8,0x0A37,0x348F,0x076C,0x2B43,
- 0x099B,0x2247,0x352B,0x1647,0x2669,0x0605,0x2E7C,0x225E,
- 0x0E82,0x3264,0x2709,0x10EC,0x2F20,0x009D,0x2D32,0x1A21,
- 0x0666,0x3638,0x26B6,0x0461,0x29DD,0x0F63,0x2766,0x360E,
- 0x103F,0x3913,0x1D47,0x0F0D,0x2D70,0x1138,0x1E34,0x29C0,
- 0x04A2,0x1803,0x3CD5,0x200D,0x2B19,0x0789,0x2D82,0x1CA3,
- 0x3056,0x22A3,0x00BF,0x1839,0x386E,0x10EB,0x3DEA,0x019F,
- 0x3540,0x1E70,0x397E,0x1695,0x3CA0,0x115A,0x3418,0x0419,
- 0x3C09,0x1BFB,0x0071,0x36C9,0x078E,0x3B0B,0x1CE0,0x3252,
- 0x1777,0x0355,0x27E0,0x3090,0x0636,0x2452,0x2CEF,0x0C11,
- 0x1450,0x1E26,0x35CF,0x1121,0x3C3E,0x1488,0x317E,0x0F69,
- 0x2C58,0x181A,0x3044,0x10A7,0x1D41,0x2770,0x0AE5,0x333F,
- 0x11BE,0x3A75,0x10E2,0x2F4A,0x169C,0x224E,0x3164,0x032F,
- 0x2EC7,0x2317,0x1360,0x3ED8,0x078C,0x1B19,0x2F00,0x15C5,
- 0x270A,0x10F9,0x2915,0x07AC,0x3D66,0x1724,0x2767,0x2083,
- 0x055E,0x385A,0x1A32,0x35EC,0x0800,0x3A88,0x0DAA,0x3741,
- 0x0B75,0x27AE,0x0422,0x2D94,0x1341,0x25AE,0x1F93,0x143A,
- 0x1C91,0x2FC8,0x0066,0x3EE5,0x0F4E,0x36E3,0x1511,0x3E1E,
- 0x1DB3,0x0AA4,0x2101,0x35AA,0x0C70,0x3982,0x11E8,0x3F12,
- 0x1D27,0x2333,0x1301,0x2F92,0x1790,0x33B0,0x20D2,0x082E,
- 0x1E6A,0x25DE,0x06DB,0x3289,0x1764,0x3F6B,0x089F,0x32AA,
- 0x1C6F,0x2FC9,0x0B2A,0x336F,0x1089,0x3B85,0x0CF8,0x378E,
- 0x06C1,0x167F,0x3BD4,0x2555,0x0C8E,0x2C69,0x15F2,0x3154,
- 0x1A80,0x053A,0x26F4,0x0A46,0x212F,0x2E16,0x0E4E,0x29B0,
- 0x1039,0x2384,0x2F74,0x1502,0x28C3,0x1271,0x2AAE,0x0BF6,
- 0x254E,0x3893,0x0AB6,0x1BA9,0x364B,0x0F80,0x3A79,0x1FC5,
- 0x3DC6,0x0047,0x2169,0x2E4D,0x0D76,0x2B7C,0x026B,0x369C,
- 0x09BF,0x3BD0,0x008F,0x2271,0x3861,0x0EE9,0x3F2E,0x0240,
- 0x2596,0x19D7,0x33EA,0x0053,0x3FC0,0x0952,0x1B2A,0x2B32,
- 0x0CF7,0x3A8C,0x00B2,0x1C72,0x2D75,0x2346,0x02C3,0x3DB6,
- 0x0D0B,0x36BB,0x1539,0x3003,0x1C97,0x0205,0x3524,0x1085,
- 0x2F3A,0x236F,0x008E,0x2017,0x30F3,0x1909,0x2429,0x1C27,
- 0x3087,0x0FD8,0x332A,0x1E64,0x3B7C,0x01F5,0x3829,0x294A,
- 0x342B,0x0D5C,0x2A12,0x1E98,0x3150,0x09F7,0x27B3,0x043F,
- 0x2921,0x3A4A,0x0283,0x1D0B,0x2A88,0x1607,0x27A9,0x0B4D,
- 0x30D6,0x0202,0x38EB,0x0A98,0x3FD4,0x0134,0x15AC,0x3AE0,
- 0x2A35,0x13EB,0x3CF3,0x21BE,0x00E7,0x2847,0x1F87,0x0E5B,
- 0x3B2D,0x13B1,0x2832,0x040A,0x24F1,0x18A1,0x29B6,0x123A,
- 0x27B2,0x341B,0x0901,0x1BD3,0x3024,0x046B,0x2889,0x0D50,
- 0x2401,0x375F,0x1294,0x32AB,0x1B75,0x0614,0x3F16,0x17BB,
- 0x35AE,0x0AFD,0x19AF,0x3D9D,0x0CF9,0x3535,0x01EA,0x3D22,
- 0x207E,0x10F3,0x337E,0x2387,0x136E,0x2A15,0x0450,0x16CF,
- 0x25DD,0x30EA,0x1925,0x04E1,0x377D,0x1DBB,0x260F,0x1A00,
- 0x2054,0x272C,0x14E9,0x3229,0x0601,0x2EE9,0x2172,0x1B68,
- 0x301A,0x0805,0x2481,0x1ECC,0x0F15,0x3459,0x2687,0x1128,
- 0x32D3,0x1659,0x2968,0x35EE,0x0D86,0x3986,0x13E3,0x2132,
- 0x2D9A,0x0021,0x2B40,0x09F0,0x3384,0x229B,0x0BB7,0x3B25,
- 0x1E72,0x14F3,0x3EF1,0x0F2C,0x26E1,0x034B,0x3CC3,0x070A,
- 0x2161,0x3E76,0x15EF,0x0938,0x1AE0,0x2BE4,0x16DC,0x0592,
- 0x11F3,0x39B6,0x17D8,0x080C,0x1A90,0x2C7A,0x12AE,0x33CD,
- 0x0F9D,0x2381,0x1807,0x3D08,0x07A3,0x33A2,0x03BB,0x3736,
- 0x16C1,0x28BB,0x193C,0x2BC9,0x1166,0x2257,0x3292,0x198C,
- 0x0373,0x3033,0x0B57,0x1BC7,0x3600,0x120B,0x381D,0x23D9,
- 0x01F7,0x2C73,0x0FA3,0x3EF4,0x14FB,0x34B3,0x01C0,0x3D88,
- 0x1FA5,0x0F4F,0x20DC,0x3F13,0x11F6,0x363D,0x1408,0x3B44,
- 0x0752,0x1D91,0x2A16,0x0250,0x3A7B,0x252F,0x13FC,0x2BC5,
- 0x02F7,0x25C6,0x3275,0x04CB,0x235A,0x1C3B,0x2FCF,0x1893,
- 0x072B,0x2C4C,0x1A31,0x0131,0x3BD6,0x0C64,0x3332,0x229A,
- 0x0957,0x126F,0x342A,0x27D1,0x153D,0x0AAE,0x3E26,0x055A,
- 0x3470,0x0B79,0x3990,0x1E32,0x2B4F,0x177B,0x0C9B,0x3BA8,
- 0x1387,0x3671,0x0C29,0x3B29,0x2818,0x198F,0x0435,0x3D71,
- 0x236C,0x0638,0x1FE4,0x09DA,0x2631,0x19AC,0x3100,0x084A,
- 0x1E9B,0x3AC4,0x1948,0x2592,0x0F99,0x393E,0x19DE,0x27FE,
- 0x06E8,0x34AA,0x09CB,0x2EF4,0x121C,0x3378,0x1520,0x2E6B,
- 0x1856,0x0010,0x2A58,0x22CC,0x3552,0x0B58,0x3FD4,0x20F3,
- 0x2482,0x03A4,0x2BA1,0x1FB2,0x3BBA,0x01D6,0x384F,0x1A08,
- 0x3074,0x0C13,0x2D03,0x12E7,0x287E,0x19CA,0x24A4,0x1417,
- 0x2C81,0x0CB0,0x3D4D,0x05C5,0x1E25,0x2E51,0x0996,0x241F,
- 0x34D1,0x110C,0x2704,0x2ED3,0x0A6F,0x2BD7,0x0714,0x18FB,
- 0x34FE,0x1FCC,0x3188,0x0668,0x291D,0x0C19,0x2EB0,0x1C2B,
- 0x0553,0x3231,0x2622,0x02CE,0x29C9,0x0A88,0x1F6E,0x2DBB,
- 0x188D,0x3EB4,0x101E,0x2F21,0x1FDF,0x08D7,0x3650,0x0C95,
- 0x38E3,0x1EB3,0x0F34,0x292D,0x3A4C,0x0904,0x159C,0x2759,
- 0x398A,0x0E41,0x3F6D,0x25F4,0x152A,0x2E97,0x1176,0x3809,
- 0x1CC5,0x39F5,0x0811,0x1B64,0x3AAB,0x21CE,0x1742,0x2D3C,
- 0x119E,0x29B9,0x1AF3,0x07A1,0x135D,0x37BD,0x2650,0x0503,
- 0x298E,0x0FA4,0x2D02,0x1734,0x0688,0x3832,0x219D,0x0B9E,
- 0x18C0,0x3892,0x2A9F,0x16F0,0x3C6B,0x04B7,0x22EA,0x37DA,
- 0x0E18,0x243D,0x0662,0x3FB6,0x1E4E,0x0501,0x2E2D,0x0ECF,
- 0x31A1,0x139B,0x25CA,0x1B8F,0x39CB,0x0880,0x2AE2,0x0A96,
- 0x36F7,0x1CF5,0x3947,0x0693,0x17BD,0x28BF,0x10CA,0x3050,
- 0x1B3C,0x3CEF,0x1086,0x34BE,0x0E5E,0x2613,0x2137,0x06FD,
- 0x1FF1,0x390E,0x056B,0x3579,0x0EBC,0x3E61,0x0D4C,0x3A26,
- 0x051D,0x335F,0x0FEC,0x251F,0x3706,0x150B,0x3C85,0x1332,
- 0x1FAA,0x3E60,0x058E,0x179A,0x3BF0,0x138A,0x2649,0x3D7D,
- 0x1551,0x091E,0x1B62,0x3730,0x1776,0x3A54,0x12F7,0x2423,
- 0x3813,0x0D8B,0x18CD,0x33B8,0x1599,0x39C2,0x23B3,0x005B,
- 0x2904,0x0B7D,0x342E,0x197A,0x0DD4,0x3093,0x227D,0x1A06,
- 0x29CF,0x0816,0x3E78,0x1CC7,0x10BE,0x2104,0x3665,0x03A0,
- 0x1F31,0x3220,0x05EB,0x1DCF,0x36BA,0x07C7,0x281C,0x0237,
- 0x2D61,0x1609,0x2118,0x2BEA,0x0147,0x2F35,0x08E4,0x2302,
- 0x381F,0x02AD,0x3F8D,0x23F8,0x3146,0x016A,0x1FAE,0x34BD,
- 0x18EB,0x3DF1,0x0314,0x213D,0x2E5F,0x1084,0x2C20,0x1CA6,
- 0x31A4,0x12E3,0x0269,0x3021,0x0E69,0x3421,0x0BE6,0x1D01,
- 0x2C59,0x1620,0x2FB2,0x11D5,0x3242,0x21A6,0x178B,0x3DF5,
- 0x0290,0x20F4,0x3BBC,0x046A,0x1FE3,0x2508,0x1A5E,0x321F,
- 0x0EE3,0x28EC,0x1308,0x252B,0x3B1F,0x0318,0x366C,0x08D8,
- 0x3308,0x152D,0x2F43,0x05E0,0x1D9A,0x3296,0x157A,0x3F8E,
- 0x11BC,0x257D,0x1BDD,0x21CB,0x2E35,0x018C,0x2962,0x1AFC,
- 0x268D,0x164E,0x2FD6,0x200E,0x07C8,0x2951,0x02CF,0x2BFD,
- 0x0875,0x1A11,0x3217,0x221C,0x027B,0x314B,0x1AF7,0x0428,
- 0x2F09,0x1EB7,0x2B61,0x0DA9,0x266C,0x0354,0x2CB7,0x09F9,
- 0x1A4E,0x2AAA,0x3B1B,0x098D,0x2F8C,0x069A,0x1AD5,0x3CDE,
- 0x1314,0x2BF5,0x03CC,0x244C,0x3D79,0x15EC,0x00CC,0x3BB9,
- 0x138D,0x2167,0x2C93,0x018B,0x3786,0x2868,0x0E9E,0x30E8,
- 0x1074,0x246D,0x190A,0x2DC2,0x0EED,0x2B21,0x12ED,0x3C94,
- 0x2211,0x057A,0x3F08,0x0DD0,0x34E1,0x1233,0x3CDB,0x1BD9,
- 0x0EA6,0x31D5,0x17EA,0x0ABB,0x1ED8,0x3AD1,0x14A5,0x2BB8,
- 0x09B4,0x23DC,0x1BC9,0x39FF,0x1467,0x3510,0x0135,0x3BB5,
- 0x08B7,0x2776,0x3FA6,0x21C7,0x1B98,0x290D,0x14B5,0x3E89,
- 0x0341,0x3580,0x0AB1,0x2A23,0x016B,0x37BB,0x092B,0x2646,
- 0x1ADC,0x2D77,0x105F,0x2A8D,0x0D55,0x311A,0x01B4,0x21C6,
- 0x3E0D,0x04ED,0x34D9,0x0A5A,0x1FB8,0x2E4E,0x13B7,0x205E,
- 0x00C6,0x295D,0x0BA9,0x24C9,0x3DA6,0x03E1,0x298D,0x0AC2,
- 0x2F96,0x002F,0x3C8B,0x0A26,0x1926,0x37D5,0x1366,0x34F5,
- 0x0BB6,0x3C27,0x00AE,0x1AAB,0x3B20,0x0E56,0x3543,0x1068,
- 0x39FE,0x2528,0x0F26,0x380A,0x1E65,0x0FE1,0x3958,0x2123,
- 0x0D20,0x33F1,0x0082,0x3C53,0x11D8,0x358A,0x15C7,0x3FD4,
- 0x220B,0x0113,0x201A,0x1393,0x24E1,0x1DB2,0x312D,0x0F75,
- 0x3549,0x16DE,0x38B3,0x1DE8,0x078F,0x331A,0x203E,0x2AFB,
- 0x056C,0x34B6,0x15B4,0x2664,0x1E2B,0x0697,0x3CCC,0x1ACB,
- 0x2A43,0x0A16,0x3820,0x02CA,0x3E3A,0x1D23,0x3147,0x0B59,
- 0x1BE2,0x2FF4,0x13AF,0x26C7,0x1840,0x299B,0x04AB,0x2DF6,
- 0x210C,0x0854,0x228F,0x2FD1,0x1072,0x27F3,0x08BE,0x1D31,
- 0x38CF,0x11FB,0x32D8,0x0778,0x29AC,0x0C3A,0x26EE,0x0FBC,
- 0x2F24,0x1E59,0x1529,0x0973,0x3A2F,0x00FA,0x31F1,0x1A2C,
- 0x2558,0x129C,0x3CC2,0x18A4,0x277F,0x1310,0x304C,0x1584,
- 0x3909,0x0B2E,0x3577,0x17CD,0x3FD4,0x1640,0x37E4,0x0C01,
- 0x1E58,0x2EC1,0x1144,0x2C32,0x19C9,0x0CFA,0x3DE6,0x2667,
- 0x3914,0x0EC1,0x3733,0x20D5,0x0F47,0x2EC9,0x1322,0x3538,
- 0x1884,0x2B04,0x14CA,0x3235,0x2127,0x0944,0x2B54,0x0626,
- 0x2D49,0x1278,0x2290,0x3240,0x13B0,0x279E,0x1707,0x2DC5,
- 0x205F,0x0010,0x2B53,0x0C17,0x2F79,0x2597,0x09BD,0x288E,
- 0x3EAD,0x12A3,0x245D,0x1D03,0x2DC4,0x0ABE,0x28BC,0x076B,
- 0x2F05,0x1709,0x2913,0x3DC5,0x03FE,0x38FD,0x0B0A,0x27CC,
- 0x053C,0x2608,0x0CEB,0x2E3A,0x1B23,0x280E,0x0A1B,0x170C,
- 0x399B,0x1BCC,0x08D4,0x33A8,0x0CEA,0x2D5B,0x1F74,0x0012,
- 0x3B62,0x1451,0x2794,0x16F3,0x23C1,0x063C,0x1756,0x35B1,
- 0x2560,0x0A1A,0x32EF,0x032D,0x3731,0x0CA4,0x39B2,0x14C3,
- 0x35CE,0x1C37,0x3C54,0x040B,0x363E,0x1660,0x3ED4,0x2547,
- 0x00C5,0x28FF,0x0DB7,0x2FC7,0x1D05,0x3F35,0x1345,0x372A,
- 0x228D,0x03CB,0x3475,0x2390,0x1889,0x2084,0x269D,0x07F3,
- 0x3367,0x1F26,0x05ED,0x2C21,0x0CF2,0x3BDD,0x1D8D,0x05C1,
- 0x2897,0x1F02,0x00E6,0x2CED,0x069E,0x2864,0x133E,0x2B76,
- 0x14EC,0x2310,0x3BF9,0x0183,0x3796,0x2230,0x0715,0x1917,
- 0x1239,0x2ADA,0x1D22,0x07F6,0x3A0D,0x1B90,0x23FE,0x0772,
- 0x3B86,0x0BF5,0x27D4,0x0468,0x3AF5,0x1C06,0x2216,0x3ECE,
- 0x0E68,0x1E97,0x3885,0x0AED,0x2B05,0x04E6,0x3EEB,0x092E,
- 0x1B6F,0x3679,0x1644,0x3FB7,0x05F6,0x1981,0x31D2,0x169F,
- 0x076E,0x20B4,0x38D6,0x0595,0x1825,0x328D,0x1D55,0x3888,
- 0x10B4,0x369D,0x0C73,0x1B0E,0x2D36,0x1518,0x2B3E,0x194B,
- 0x3293,0x1581,0x3C67,0x0206,0x3588,0x12C4,0x3F49,0x22F0,
- 0x0DCD,0x3017,0x20E0,0x118C,0x3FB4,0x1367,0x356A,0x17B7,
- 0x2224,0x31AC,0x0886,0x2F60,0x0D36,0x3A1E,0x28F5,0x00A7,
- 0x19BE,0x3B0C,0x15C2,0x2906,0x1B0A,0x2488,0x0FA9,0x288B,
- 0x0026,0x2A2B,0x0E20,0x26FA,0x0C7B,0x2DC0,0x05F8,0x1A9F,
- 0x358F,0x154D,0x3C9F,0x1851,0x02B0,0x20CB,0x2867,0x0599,
- 0x182A,0x39A8,0x0EE1,0x2F9E,0x06B8,0x355E,0x0CC6,0x3B8D,
- 0x0EA3,0x23C3,0x3850,0x1016,0x3400,0x0400,0x2420,0x372B,
- 0x0E1D,0x3CFA,0x24AF,0x127B,0x32B9,0x0CC3,0x3B4C,0x03DB,
- 0x3681,0x0858,0x1B6A,0x2827,0x0FDF,0x2F5E,0x1DB4,0x2D60,
- 0x3CBC,0x02D4,0x324F,0x1A10,0x26E6,0x0165,0x30DE,0x1EDF,
- 0x110F,0x31BC,0x176F,0x2BB4,0x106B,0x2ED4,0x021A,0x1871,
- 0x3301,0x24DD,0x0393,0x2F2F,0x1CAF,0x31C4,0x1217,0x2439,
- 0x30D8,0x0CB9,0x297F,0x1445,0x23B9,0x3AC3,0x0186,0x36F2,
- 0x1C9A,0x3086,0x0E90,0x26B2,0x3E19,0x1471,0x0236,0x216D,
- 0x2B0E,0x04FC,0x309B,0x2434,0x0891,0x3408,0x0180,0x3FA2,
- 0x0915,0x2CBC,0x1173,0x28E7,0x0EFC,0x25A9,0x045C,0x2DFD,
- 0x1E09,0x0274,0x37E5,0x2716,0x03EE,0x2984,0x0A44,0x2E69,
- 0x0512,0x1EAD,0x393B,0x1A5C,0x33E4,0x1F4D,0x1197,0x3FD4,
- 0x20D3,0x075E,0x2CB5,0x0B8C,0x3D3B,0x05B5,0x335B,0x12EA,
- 0x3E65,0x15C9,0x3511,0x1942,0x3B5F,0x1446,0x2399,0x317F,
- 0x0A09,0x2B1D,0x0541,0x2374,0x37E8,0x0B05,0x35BB,0x1C32,
- 0x2CE2,0x0A8D,0x2A67,0x16A0,0x3D2A,0x1319,0x2B56,0x1726,
- 0x2D4C,0x01C9,0x1B15,0x3089,0x146D,0x29B1,0x0C04,0x1C4B,
- 0x2F19,0x1676,0x08C2,0x3A00,0x22B7,0x1BFE,0x213E,0x2F25,
- 0x0F62,0x2004,0x33A3,0x144B,0x3F85,0x0425,0x35A5,0x09FA,
- 0x163B,0x25A7,0x13FD,0x3F40,0x1193,0x3655,0x149D,0x3889,
- 0x21F1,0x0282,0x3F1F,0x0DAF,0x35C3,0x1536,0x395E,0x27BF,
- 0x0841,0x15D7,0x3D24,0x183E,0x0DFB,0x2102,0x37C5,0x0239,
- 0x18ED,0x3B5D,0x048B,0x3483,0x0ADD,0x1ED4,0x2AA4,0x0F82,
- 0x2C05,0x03AD,0x364E,0x1A9E,0x08F7,0x230E,0x3AE6,0x19CF,
- 0x0EC9,0x3C77,0x13CE,0x1ED1,0x3ABF,0x111B,0x2370,0x0ED6,
- 0x24B3,0x1BCA,0x37A9,0x06F6,0x3B24,0x18FE,0x368D,0x11F4,
- 0x3C22,0x225B,0x0B95,0x184E,0x31F6,0x1CFA,0x385C,0x103D,
- 0x3D74,0x0D5E,0x24AD,0x01E4,0x2681,0x082F,0x2E01,0x0DE5,
- 0x274C,0x3666,0x10E8,0x3066,0x16AE,0x2ACD,0x1968,0x264F,
- 0x0BFE,0x2C9E,0x06C9,0x2F03,0x0212,0x2A87,0x0D8D,0x1EF3,
- 0x3A7A,0x199B,0x325D,0x10B8,0x2A1F,0x1DC0,0x0F24,0x30A5,
- 0x144E,0x3E34,0x1FCB,0x021E,0x1E15,0x28CE,0x0462,0x32A1,
- 0x1136,0x3F7E,0x27DB,0x077C,0x1F7E,0x3E49,0x1843,0x350F,
- 0x0333,0x20B6,0x2BF3,0x1918,0x025C,0x35B9,0x0A0E,0x1863,
- 0x3D73,0x25FA,0x05B3,0x2B17,0x0C14,0x24A3,0x172D,0x28AE,
- 0x32DE,0x0AFE,0x2A51,0x0559,0x2DEB,0x09DC,0x2A9A,0x0637,
- 0x2D12,0x158E,0x1FD2,0x26DB,0x0738,0x2449,0x0B16,0x1D2B,
- 0x3720,0x294E,0x0C51,0x2660,0x398B,0x070C,0x2738,0x1C52,
- 0x2C6B,0x0FA1,0x27F4,0x12EF,0x2E84,0x1510,0x21B2,0x3D11,
- 0x0BCF,0x278F,0x1177,0x2CDF,0x1DE4,0x2FC4,0x065E,0x34A3,
- 0x22A7,0x092D,0x31EF,0x028B,0x283D,0x186F,0x3746,0x1C88,
- 0x334E,0x0353,0x2148,0x2E91,0x145C,0x2991,0x0BFD,0x2792,
- 0x07CE,0x32F1,0x1C7A,0x3A08,0x14F7,0x0779,0x2285,0x2BD5,
- 0x1613,0x2A7B,0x1542,0x3BCE,0x12AA,0x3766,0x17E2,0x327B,
- 0x04C7,0x1D67,0x23D3,0x01A9,0x3922,0x0A81,0x3626,0x02E7,
- 0x3A72,0x1B38,0x249E,0x1236,0x37BE,0x16EE,0x3D1C,0x0387,
- 0x262A,0x0C88,0x2150,0x3E92,0x066D,0x24BF,0x3C43,0x003D,
- 0x2688,0x07B3,0x337A,0x1B10,0x3689,0x0FF9,0x3AF3,0x0A59,
- 0x249C,0x1EB5,0x1246,0x39EE,0x238E,0x0050,0x2B4E,0x0DBF,
- 0x2573,0x3EBE,0x0F7D,0x3709,0x2713,0x1187,0x2DB3,0x226A,
- 0x009F,0x16AC,0x3A37,0x1AB1,0x3435,0x1297,0x3ADF,0x05F5,
- 0x1D6B,0x3BCD,0x0F64,0x378A,0x194C,0x23B8,0x0FC0,0x3D32,
- 0x19A5,0x393A,0x0579,0x345B,0x1AB5,0x3DB4,0x13AE,0x2CB4,
- 0x04A8,0x1EE4,0x32A0,0x015F,0x1DD5,0x3336,0x0D0C,0x3DF9,
- 0x08B8,0x3582,0x1D7F,0x3DA9,0x02A1,0x376F,0x07C0,0x1AEE,
- 0x338C,0x1749,0x3BEE,0x012D,0x3970,0x0C93,0x2809,0x104C,
- 0x2D64,0x1946,0x20BB,0x3E7E,0x0BA2,0x3016,0x05E5,0x29C3,
- 0x0C1D,0x3E31,0x1819,0x099D,0x33D1,0x003C,0x3049,0x16A1,
- 0x2B7A,0x13C1,0x2D25,0x013B,0x2342,0x3E02,0x192F,0x02B2,
- 0x3514,0x06DE,0x30F4,0x099F,0x2C9B,0x1E4C,0x034E,0x2047,
- 0x38A0,0x13F8,0x3DD4,0x1F3E,0x11E9,0x296B,0x1479,0x2DA0,
- 0x21C9,0x0F7E,0x3200,0x20A8,0x092A,0x2C04,0x1056,0x2FEC,
- 0x1652,0x3933,0x0194,0x1AAC,0x2DE8,0x0D21,0x204B,0x320F,
- 0x1258,0x2C06,0x0F57,0x2822,0x0B7A,0x2EC0,0x2207,0x1B9D,
- 0x3778,0x0534,0x2F81,0x09DB,0x19F1,0x3632,0x1402,0x3A76,
- 0x1D0C,0x09A2,0x315F,0x05FA,0x1B29,0x3F26,0x0771,0x38DF,
- 0x1D5C,0x30B8,0x0D64,0x27A5,0x0213,0x29AF,0x0DE7,0x2CEE,
- 0x004F,0x2281,0x2FE7,0x1DEE,0x036A,0x31E6,0x1C43,0x2628,
- 0x0B20,0x22A1,0x2DF7,0x0D12,0x2A21,0x0078,0x30C6,0x1BC8,
- 0x3B79,0x0ED3,0x2319,0x3F58,0x12BC,0x28CD,0x1F49,0x11DE,
- 0x3040,0x16FB,0x06B3,0x229E,0x2B80,0x111E,0x312C,0x2409,
- 0x04CC,0x296A,0x0D54,0x2523,0x1365,0x33A9,0x14DC,0x3F75,
- 0x001D,0x3805,0x0DF5,0x265B,0x1E20,0x106A,0x3A45,0x164B,
- 0x2EE7,0x11BD,0x2BA2,0x2206,0x1C33,0x3D4A,0x0E0C,0x3877,
- 0x04A0,0x3E9A,0x0C7E,0x1EC7,0x2F83,0x0AAB,0x3353,0x2128,
- 0x0F4B,0x3EF6,0x198E,0x23DE,0x0F06,0x3D17,0x1A23,0x2A37,
- 0x0A33,0x2B48,0x07B4,0x279C,0x3508,0x0641,0x3EDE,0x1CE5,
- 0x0974,0x371D,0x03E3,0x3FAB,0x19D5,0x221B,0x340A,0x074D,
- 0x2932,0x0E2D,0x253F,0x3612,0x13C8,0x384E,0x18A9,0x0A0B,
- 0x3B30,0x1E81,0x3710,0x0588,0x3F00,0x1802,0x00A6,0x3197,
- 0x0CBE,0x299A,0x15E0,0x32F3,0x2524,0x0B4A,0x2953,0x0676,
- 0x2E30,0x1715,0x23DB,0x1DF2,0x2FF1,0x142F,0x2621,0x0EC4,
- 0x2967,0x08EF,0x36CD,0x136A,0x3CE0,0x1826,0x3724,0x1A74,
- 0x346C,0x1595,0x089A,0x2694,0x3DF7,0x0C86,0x3518,0x00F3,
- 0x36F1,0x129B,0x1E28,0x3BC6,0x16F6,0x368B,0x238B,0x0909,
- 0x1665,0x2F93,0x17C6,0x09E7,0x2EA4,0x0436,0x3A25,0x2472,
- 0x00F1,0x2853,0x36CA,0x1923,0x0970,0x3A73,0x1F39,0x121F,
- 0x3F3D,0x15E7,0x305A,0x18B4,0x2A27,0x047C,0x2C61,0x1C28,
- 0x2580,0x16C8,0x2F62,0x041F,0x3492,0x27AA,0x1FD4,0x00D7,
- 0x1F1B,0x3659,0x0509,0x3992,0x107A,0x24D4,0x1A57,0x23B6,
- 0x1F5A,0x0FD9,0x2684,0x3B42,0x1172,0x28CC,0x1325,0x2DD4,
- 0x1C34,0x25BC,0x00F5,0x36DC,0x1F91,0x05B8,0x337D,0x1507,
- 0x3B6D,0x129D,0x31E7,0x0EB1,0x1DF4,0x241B,0x0E77,0x3159,
- 0x1827,0x29A3,0x1E83,0x0D53,0x2E4A,0x008C,0x1B7A,0x3DD9,
- 0x14E0,0x32C7,0x1BF8,0x08DE,0x2AF3,0x03BA,0x2F72,0x272D,
- 0x16B4,0x0322,0x1A5D,0x2D14,0x10FA,0x20CF,0x2AC3,0x1546,
- 0x3D87,0x1062,0x38F1,0x0276,0x1DC2,0x3C28,0x162A,0x347D,
- 0x0FDC,0x3882,0x0123,0x3B91,0x0B11,0x2B2C,0x02F3,0x31AA,
- 0x1245,0x2C97,0x1993,0x243E,0x0678,0x2DD9,0x0948,0x20BE,
- 0x0B9D,0x27C6,0x3969,0x17A8,0x10AE,0x2C0E,0x1430,0x299D,
- 0x0DD1,0x3046,0x0398,0x24AE,0x09A5,0x1F67,0x0FEA,0x3430,
- 0x2107,0x02D5,0x389A,0x21BA,0x1A76,0x3485,0x0BB5,0x1C2E,
- 0x3CB7,0x20BA,0x0F54,0x2E21,0x1CBE,0x251A,0x0070,0x2EDF,
- 0x0A2D,0x34E6,0x0683,0x3819,0x0B7C,0x3C96,0x21EF,0x09A6,
- 0x3166,0x06F0,0x1CDE,0x39A7,0x15DC,0x07FF,0x3DB0,0x1AEC,
- 0x3128,0x0F0A,0x275F,0x0B63,0x2DAB,0x0382,0x313E,0x094D,
- 0x2A0D,0x35B2,0x1ABA,0x06CF,0x3444,0x0446,0x3A7F,0x07FE,
- 0x37CA,0x0C39,0x2B55,0x1134,0x308A,0x26DC,0x0CCE,0x2D2C,
- 0x0067,0x2491,0x1BFC,0x3812,0x037F,0x3AE4,0x1F9C,0x00FB,
- 0x3C31,0x080B,0x2504,0x3973,0x1151,0x3684,0x242D,0x0B66,
- 0x2A66,0x04D4,0x3BE3,0x1FFA,0x111A,0x3FD4,0x20ED,0x0776,
- 0x343B,0x1F94,0x3CB5,0x094F,0x2476,0x351C,0x0D7B,0x2E56,
- 0x0448,0x265E,0x20FB,0x18CE,0x2CFC,0x080D,0x2728,0x03A7,
- 0x2BBB,0x1A09,0x27D3,0x111D,0x33F3,0x1513,0x3C56,0x1EFA,
- 0x35EA,0x0417,0x3E6A,0x0C99,0x3282,0x14F9,0x2559,0x3EF0,
- 0x2C45,0x1BBD,0x0238,0x30F9,0x2198,0x0667,0x3A93,0x1CB8,
- 0x3E8B,0x18C8,0x2085,0x3355,0x15BE,0x3FD4,0x22FC,0x067E,
- 0x3CA9,0x2A6C,0x0CE4,0x3189,0x065B,0x25A5,0x1864,0x2D83,
- 0x14AC,0x09FB,0x3908,0x03EC,0x3E63,0x0E75,0x3548,0x14EA,
- 0x2AFC,0x1B9F,0x260B,0x1266,0x2D13,0x1AE9,0x0FC9,0x371A,
- 0x1571,0x3B8C,0x22D9,0x0A72,0x21AF,0x2DA9,0x0F8C,0x2AE8,
- 0x08FD,0x3CBE,0x1E91,0x34DF,0x13A8,0x3F33,0x152F,0x3725,
- 0x1680,0x0244,0x30BE,0x2400,0x1291,0x2CC0,0x1B8B,0x243B,
- 0x171C,0x326D,0x1A87,0x3AC0,0x0B03,0x1D83,0x3E32,0x1019,
- 0x1EC8,0x343C,0x06A5,0x1872,0x2BEC,0x1418,0x3029,0x25A6,
- 0x12D0,0x34A4,0x173D,0x04FB,0x2878,0x1F48,0x1225,0x37D4,
- 0x180A,0x2ED5,0x1293,0x2661,0x331F,0x0BB2,0x19DB,0x3A1B,
- 0x1388,0x2B28,0x11CA,0x320D,0x1CFE,0x064A,0x3B9D,0x2028,
- 0x1A3B,0x33EC,0x0BA0,0x3F3B,0x0F3C,0x3592,0x12C7,0x3DC0,
- 0x1DA4,0x0937,0x32C0,0x1F71,0x0517,0x29AA,0x18BE,0x0807,
- 0x1C02,0x2701,0x15A2,0x2942,0x1047,0x38B6,0x0389,0x171F,
- 0x06D5,0x3B6C,0x1FB9,0x0E9D,0x37A5,0x1B50,0x23C5,0x04F9,
- 0x25D5,0x0A67,0x3831,0x07A0,0x29AE,0x01B2,0x309C,0x1C86,
- 0x10DC,0x1E04,0x278D,0x15EB,0x3E6D,0x0DBE,0x377C,0x0311,
- 0x351B,0x2637,0x15C6,0x29DC,0x1711,0x290E,0x082B,0x39DA,
- 0x2196,0x031D,0x3DFE,0x1F11,0x01CA,0x32B7,0x2058,0x0394,
- 0x2996,0x0D6A,0x2B96,0x19C0,0x330C,0x02E3,0x37C6,0x135A,
- 0x28AD,0x1794,0x01F2,0x1B46,0x2828,0x0D57,0x2A94,0x0645,
- 0x2553,0x3D05,0x1798,0x09E6,0x3950,0x2081,0x0E14,0x3C90,
- 0x0366,0x27FA,0x062B,0x21B1,0x2EFD,0x0306,0x22BB,0x35AB,
- 0x2811,0x0B6A,0x3F94,0x269E,0x0D38,0x33DE,0x0B35,0x1B05,
- 0x2B8D,0x0F02,0x2D3F,0x1C60,0x3CC4,0x085D,0x312A,0x02EE,
- 0x27FB,0x0A75,0x34EF,0x00EA,0x175C,0x2C64,0x2327,0x023C,
- 0x305C,0x0ADB,0x28AC,0x0144,0x39E8,0x1912,0x255B,0x0A9D,
- 0x3843,0x1199,0x2F63,0x056A,0x2802,0x1D28,0x2D91,0x0BC7,
- 0x25A1,0x3AE5,0x1232,0x239F,0x3E16,0x0E0D,0x369B,0x206D,
- 0x3979,0x0A74,0x3369,0x0150,0x2F57,0x225C,0x1D36,0x332F,
- 0x287F,0x1302,0x356E,0x252C,0x0A8F,0x2D2E,0x1241,0x318B,
- 0x16BB,0x2ACA,0x117D,0x2F46,0x1A1F,0x38F0,0x0E22,0x280B,
- 0x36E8,0x07FD,0x3AE7,0x0041,0x1CE2,0x2982,0x11AE,0x2C39,
- 0x1E76,0x05C6,0x2FAA,0x0C50,0x33C2,0x1066,0x31B4,0x1E3F,
- 0x1399,0x2DC3,0x10F7,0x23D1,0x3A6B,0x0CE3,0x275A,0x3D86,
- 0x12AD,0x3621,0x0181,0x3EC3,0x0E2A,0x24C8,0x18EE,0x3259,
- 0x05FF,0x3853,0x1FC7,0x3BD7,0x0744,0x3303,0x19B3,0x39DF,
- 0x1EFC,0x0F33,0x2C01,0x1CDA,0x286C,0x007E,0x3011,0x1429,
- 0x33FE,0x1587,0x3F5C,0x0D9F,0x1B0D,0x39BE,0x16CD,0x054F,
- 0x147E,0x2EBE,0x2094,0x1065,0x3A3A,0x048D,0x21AB,0x3D9B,
- 0x02A7,0x38C8,0x09AF,0x3315,0x152B,0x2614,0x1D54,0x3F1E,
- 0x0F74,0x39BA,0x229D,0x1CF7,0x3CE1,0x0817,0x3797,0x1E43,
- 0x101D,0x3DE7,0x1596,0x2FBB,0x0E9C,0x2BAB,0x14DD,0x303E,
- 0x01A2,0x1EA6,0x2450,0x1762,0x3962,0x00D5,0x19A6,0x3757,
- 0x16AF,0x023D,0x2F8E,0x089B,0x1A6B,0x2D63,0x0036,0x28C7,
- 0x0F53,0x2CB0,0x16BC,0x3A14,0x1B09,0x081E,0x3C35,0x0D3F,
- 0x1010,0x2E54,0x0496,0x1967,0x3FAF,0x0174,0x39F1,0x0BBE,
- 0x3609,0x024C,0x3D99,0x22E9,0x0F5B,0x215D,0x2E94,0x0455,
- 0x1F19,0x3137,0x1778,0x222F,0x3570,0x08F4,0x3C24,0x2142,
- 0x0EC0,0x3FCC,0x1BBA,0x3785,0x01FC,0x2026,0x2498,0x053B,
- 0x3BF8,0x0BE0,0x3368,0x073E,0x19EC,0x2EB9,0x16E0,0x08BC,
- 0x2404,0x1BF5,0x304B,0x1755,0x2059,0x3A80,0x0B87,0x1CCD,
- 0x2BEF,0x1282,0x29C8,0x1100,0x2C79,0x1E00,0x0118,0x232C,
- 0x0A7E,0x34A7,0x0405,0x3FD4,0x1552,0x3711,0x0C0A,0x2516,
- 0x0931,0x2C71,0x109E,0x262F,0x3486,0x08C0,0x2B0A,0x1E1E,
- 0x3C9B,0x1913,0x018A,0x30FB,0x22F7,0x19FC,0x2F0D,0x10A2,
- 0x274E,0x18F3,0x204F,0x23F3,0x01B1,0x2F6F,0x0AF2,0x1686,
- 0x2C49,0x1A05,0x06A0,0x2F9F,0x0F8B,0x29D6,0x14C8,0x31A7,
- 0x21AE,0x04FA,0x25B5,0x1AB4,0x3613,0x03FA,0x3EC5,0x0D49,
- 0x27A6,0x3C65,0x0912,0x3298,0x1478,0x22ED,0x30D2,0x0631,
- 0x2239,0x2C1D,0x13F4,0x391F,0x2489,0x1147,0x328E,0x1718,
- 0x3F7A,0x0475,0x24FC,0x10F8,0x2B08,0x2062,0x138B,0x3144,
- 0x3E2C,0x1D7C,0x217C,0x3006,0x14A4,0x28C2,0x1A41,0x2765,
- 0x15DF,0x2CA6,0x1BA8,0x058D,0x3B11,0x0921,0x189E,0x3D25,
- 0x1415,0x2526,0x0EBB,0x2E47,0x12B1,0x2BCA,0x19E8,0x0702,
- 0x31E5,0x2273,0x0FF0,0x256E,0x1A6D,0x3CEA,0x124C,0x3494,
- 0x1821,0x2A04,0x1575,0x38F4,0x24FD,0x04C4,0x35B7,0x1D6D,
- 0x33B9,0x0615,0x259E,0x0A20,0x2DE9,0x0566,0x26D2,0x3F9A,
- 0x0DA5,0x35DE,0x0423,0x3407,0x0B1D,0x3AE9,0x1495,0x36A3,
- 0x28B1,0x12AB,0x2D98,0x2240,0x08A8,0x270F,0x1B5F,0x3DA0,
- 0x1878,0x1FF0,0x384A,0x014B,0x183A,0x30A9,0x1227,0x32AF,
- 0x0C7D,0x28D2,0x3749,0x168F,0x0A27,0x357A,0x0775,0x1ED6,
- 0x30D1,0x0600,0x3E53,0x0FE2,0x3837,0x178A,0x354B,0x21F8,
- 0x045E,0x33A4,0x208D,0x1324,0x38BA,0x040C,0x270B,0x09D9,
- 0x3AFE,0x1BDA,0x373D,0x08F3,0x23B1,0x1F64,0x12D9,0x3267,
- 0x1B7E,0x1042,0x2AC0,0x1F10,0x076A,0x3D19,0x0D68,0x2027,
- 0x3FC4,0x099E,0x3457,0x1F2D,0x04EB,0x3C97,0x1E93,0x07AB,
- 0x1FC9,0x341E,0x0C5C,0x3D84,0x0574,0x3770,0x2410,0x00B8,
- 0x17D5,0x086A,0x34C6,0x0C37,0x2A9D,0x0E01,0x32F0,0x0709,
- 0x3C57,0x09EF,0x1FE9,0x3512,0x161F,0x2673,0x318E,0x0B72,
- 0x2B9C,0x033A,0x33E2,0x0987,0x3A5C,0x0266,0x22F6,0x394B,
- 0x179D,0x0117,0x3AB6,0x0A24,0x2EBF,0x075F,0x2A6F,0x0AE4,
- 0x27B8,0x00F8,0x2F68,0x0A84,0x1DD6,0x3F10,0x1213,0x2ADE,
- 0x0ECD,0x3C32,0x1347,0x38E2,0x15A8,0x3509,0x1D98,0x0081,
- 0x23D0,0x1A8B,0x25D6,0x20B5,0x17D0,0x2717,0x2174,0x07E1,
- 0x18AC,0x3BF1,0x0C96,0x1A22,0x3168,0x102C,0x2E88,0x0279,
- 0x353F,0x06F7,0x2884,0x1C4E,0x3C60,0x0E13,0x2581,0x0253,
- 0x393F,0x1F69,0x07CC,0x2606,0x3EA3,0x132C,0x2858,0x3BB0,
- 0x0DE8,0x3411,0x13DC,0x2C22,0x0CBF,0x2A07,0x0724,0x3BCF,
- 0x1E0E,0x0E07,0x3D81,0x25CF,0x0BD1,0x326B,0x185B,0x2CA3,
- 0x1275,0x2998,0x1433,0x2D96,0x113A,0x396F,0x2856,0x06CE,
- 0x237D,0x371F,0x036C,0x3A9B,0x1BB9,0x25F2,0x1822,0x331B,
- 0x0F03,0x1C90,0x2671,0x0DD6,0x308D,0x1002,0x2B57,0x1AC0,
- 0x2E46,0x13D3,0x2817,0x1781,0x3051,0x0CE2,0x1BCD,0x2B5A,
- 0x36D7,0x2700,0x1191,0x3CFE,0x041D,0x3802,0x11E3,0x2D72,
- 0x13CC,0x24E5,0x3071,0x1035,0x2BE5,0x00E5,0x1C14,0x3760,
- 0x1203,0x3F41,0x1952,0x2050,0x26A1,0x1560,0x2DD0,0x0D24,
- 0x273D,0x2FED,0x14C9,0x28D4,0x1335,0x32FF,0x1D3A,0x3F82,
- 0x0F9A,0x382F,0x228B,0x1908,0x30D5,0x0D43,0x27E9,0x006E,
- 0x2FF7,0x1B14,0x2C1C,0x0340,0x2872,0x10CF,0x309F,0x1701,
- 0x3910,0x0878,0x3DE3,0x09C1,0x3565,0x0325,0x3ECC,0x1C9D,
- 0x32A2,0x01C2,0x2023,0x37B2,0x0499,0x3A49,0x21A3,0x15BD,
- 0x2322,0x319B,0x0D11,0x2E06,0x050E,0x1F23,0x2F2B,0x1766,
- 0x23E8,0x118A,0x2FD7,0x1B21,0x035B,0x2DD8,0x1C7C,0x0091,
- 0x2468,0x1BB2,0x26BB,0x03D6,0x3B2A,0x12C0,0x27B7,0x148F,
- 0x3001,0x2309,0x01CF,0x1C6B,0x2E6C,0x140D,0x3E4C,0x0089,
- 0x3561,0x07A6,0x3F9B,0x0241,0x32E2,0x0A12,0x16E4,0x3D63,
- 0x1927,0x0C2A,0x2EE4,0x120F,0x3422,0x0B39,0x2E8D,0x03F3,
- 0x281F,0x38AD,0x017F,0x2AC2,0x180C,0x3572,0x02B7,0x3B39,
- 0x0B26,0x37FB,0x01B9,0x2BF6,0x0FBA,0x25C5,0x3ABB,0x0AC7,
- 0x2018,0x029A,0x2ED0,0x18B5,0x24D5,0x1C66,0x235B,0x0022,
- 0x38A3,0x19CD,0x03D5,0x3ECD,0x0CAF,0x3439,0x226E,0x0762,
- 0x20C9,0x25D9,0x05AC,0x37E7,0x0B15,0x3E13,0x1E5B,0x3631,
- 0x08CE,0x1C44,0x36A5,0x04AC,0x3B8A,0x21B4,0x02E6,0x16C3,
- 0x3084,0x1AF4,0x088C,0x3B2F,0x0378,0x2BA7,0x14B3,0x3A3D,
- 0x213B,0x0967,0x2263,0x36C7,0x0C4B,0x3CEE,0x079F,0x2B46,
- 0x0E8A,0x2D97,0x164A,0x2F5F,0x11E4,0x2B24,0x13D6,0x2DF2,
- 0x0F98,0x25B3,0x2F13,0x1379,0x2949,0x1D1D,0x07A2,0x3B92,
- 0x0E4D,0x1DA9,0x3E58,0x164C,0x2238,0x3A13,0x0AD8,0x3637,
- 0x05AD,0x3D6A,0x0B33,0x3448,0x219A,0x0ECE,0x3924,0x1800,
- 0x2E79,0x0899,0x362C,0x195B,0x2241,0x322E,0x0010,0x2B2A,
- 0x0A00,0x34B5,0x192B,0x3AB2,0x065A,0x2A96,0x0D01,0x24C0,
- 0x1097,0x203A,0x2412,0x1989,0x264B,0x1D13,0x2B36,0x001F,
- 0x3536,0x24FB,0x15DD,0x2A0B,0x01D4,0x28DF,0x13A5,0x3BA9,
- 0x210A,0x10D3,0x1E52,0x3EAF,0x07D8,0x1C4A,0x2972,0x153F,
- 0x263F,0x1226,0x3165,0x1D42,0x3526,0x03BD,0x15CE,0x30DD,
- 0x1697,0x3BCC,0x22A2,0x0988,0x339F,0x0796,0x3F39,0x1ECD,
- 0x0E47,0x33DF,0x20AC,0x1540,0x2976,0x1292,0x3A2B,0x19B9,
- 0x3295,0x0ED8,0x2D44,0x1186,0x2934,0x1A38,0x0527,0x1442,
- 0x3186,0x245A,0x1112,0x2C03,0x19C4,0x0D06,0x37DB,0x2729,
- 0x05CE,0x2CC5,0x1FFD,0x1289,0x3314,0x1753,0x3534,0x07BD,
- 0x189A,0x3FCF,0x105A,0x19EE,0x2D06,0x1400,0x246A,0x1984,
- 0x36F6,0x1FFE,0x021B,0x1CC2,0x3984,0x0CBB,0x28FA,0x05B4,
- 0x35AF,0x197D,0x0840,0x3E43,0x0D73,0x35D9,0x16D6,0x23B7,
- 0x302D,0x03C2,0x277C,0x09C6,0x31EB,0x13BF,0x26E5,0x1D2D,
- 0x2D71,0x14D9,0x2A55,0x127D,0x3B0F,0x1E80,0x0BA1,0x34FC,
- 0x10BA,0x3FD3,0x1564,0x2FCA,0x0A50,0x1D68,0x3771,0x1059,
- 0x3F60,0x157D,0x28A5,0x0F19,0x35D7,0x2184,0x1A4C,0x3373,
- 0x1C0C,0x3A50,0x0C4A,0x37C1,0x0582,0x349D,0x0DAB,0x2F45,
- 0x20A2,0x05E3,0x39B1,0x0D4E,0x3E88,0x1011,0x35E2,0x1B2B,
- 0x0984,0x3516,0x28F1,0x0E57,0x23FC,0x3A89,0x0A8C,0x3654,
- 0x05F3,0x3D2D,0x2243,0x08BF,0x19E3,0x3FD4,0x22E7,0x0748,
- 0x325A,0x0D82,0x1B95,0x3997,0x1580,0x2BC1,0x135C,0x26CA,
- 0x2F56,0x0846,0x279A,0x395C,0x05E2,0x2EDD,0x0A29,0x2B37,
- 0x020F,0x3B9A,0x1B42,0x3586,0x00A4,0x33A6,0x1F8E,0x3C8A,
- 0x18C4,0x034C,0x3EDA,0x0A62,0x2666,0x3255,0x11EC,0x20C4,
- 0x35FF,0x0E52,0x3DF8,0x2544,0x0BB3,0x2941,0x0F65,0x26F2,
- 0x3225,0x0440,0x23DF,0x337C,0x01D8,0x1E9F,0x3194,0x0482,
- 0x2695,0x0BEF,0x3C92,0x250D,0x0681,0x3344,0x1EC6,0x3D33,
- 0x0D3B,0x2109,0x31E9,0x11D7,0x2B98,0x00C8,0x2D4F,0x0991,
- 0x1E5E,0x38ED,0x1207,0x36BD,0x1C10,0x0029,0x3F6F,0x091C,
- 0x1A13,0x37EA,0x0119,0x275D,0x0687,0x3038,0x228A,0x0522,
- 0x2AFF,0x2036,0x02BC,0x1F09,0x3DBE,0x11D6,0x2556,0x20B8,
- 0x04A5,0x2DDE,0x085C,0x30B1,0x1E84,0x0334,0x3C4E,0x088D,
- 0x2E50,0x044A,0x2912,0x1007,0x2C42,0x15F1,0x3B13,0x1E11,
- 0x0F61,0x31AB,0x1A73,0x26EB,0x1DB5,0x310B,0x0705,0x24D0,
- 0x2FF9,0x178E,0x05C9,0x36EB,0x1FA9,0x0F44,0x2D92,0x190D,
- 0x27E6,0x1EE0,0x10BF,0x3943,0x2A84,0x0A54,0x2F2E,0x1D16,
- 0x059A,0x217F,0x2CCF,0x01A3,0x2869,0x0B31,0x315E,0x035C,
- 0x1ABF,0x3D3E,0x0F36,0x1DDD,0x244E,0x13E0,0x3D65,0x16A4,
- 0x2807,0x1EBD,0x08A3,0x1FF4,0x2A54,0x1358,0x2E52,0x0808,
- 0x2298,0x2AA7,0x1638,0x30CA,0x1FBF,0x0016,0x3D8D,0x09AC,
- 0x1CD5,0x2B42,0x01DB,0x1BC2,0x3927,0x053F,0x3D40,0x1E27,
- 0x1159,0x1F76,0x394A,0x0E5D,0x21D5,0x3E41,0x0F22,0x3A1F,
- 0x124D,0x32D6,0x20EC,0x0DDA,0x2CF1,0x1AA3,0x0010,0x1737,
- 0x27CD,0x3926,0x039D,0x248E,0x1B8E,0x3C89,0x190B,0x3481,
- 0x0F6E,0x2270,0x2CEB,0x06A3,0x2548,0x2FBC,0x157F,0x2BCB,
- 0x21F3,0x0E7A,0x3223,0x18B8,0x2B64,0x1323,0x3CDD,0x1D89,
- 0x0E50,0x31D4,0x1AA9,0x29B7,0x0597,0x2C62,0x090E,0x3A53,
- 0x1DD4,0x1228,0x38D9,0x2340,0x0C83,0x2CE0,0x1189,0x27AF,
- 0x0E6A,0x3647,0x171E,0x3C21,0x1F1D,0x08C5,0x2353,0x0386,
- 0x3FD4,0x2147,0x0945,0x36B5,0x0466,0x18C6,0x2B9B,0x1630,
- 0x0083,0x3D55,0x1D21,0x255C,0x036D,0x306C,0x1CD3,0x00E2,
- 0x33AD,0x09D6,0x2FEB,0x02F9,0x15FD,0x2565,0x126D,0x38B8,
- 0x19A3,0x3E86,0x12F3,0x3593,0x173C,0x3AC8,0x108C,0x3777,
- 0x23A9,0x147B,0x3261,0x0187,0x3718,0x1F51,0x042A,0x332C,
- 0x0D74,0x365F,0x14FD,0x3E5A,0x0C8A,0x39CC,0x0F3A,0x1DFF,
- 0x3B0A,0x109C,0x3759,0x064E,0x151C,0x2E8E,0x22B5,0x17C5,
- 0x3A47,0x10E1,0x23BF,0x31BF,0x133A,0x2DB5,0x232B,0x013F,
- 0x3780,0x29E0,0x0802,0x1D43,0x2E63,0x06DC,0x2A5F,0x1C82,
- 0x2EB5,0x074F,0x1860,0x3787,0x131F,0x3B58,0x1FAB,0x2FB4,
- 0x091A,0x14CB,0x1EF9,0x3085,0x0C58,0x2641,0x0569,0x20CD,
- 0x3F24,0x0218,0x1CC9,0x3C06,0x181C,0x0A7D,0x35B8,0x0489,
- 0x3B64,0x1ED9,0x0849,0x3EDC,0x0A8E,0x337B,0x01EE,0x265A,
- 0x38BD,0x0799,0x3BEB,0x0F78,0x364C,0x170A,0x33AE,0x139E,
- 0x3131,0x224C,0x0121,0x189B,0x3EA7,0x154E,0x32BA,0x17AA,
- 0x2AF1,0x1493,0x2507,0x011B,0x2E76,0x1BB1,0x3140,0x175B,
- 0x261C,0x131E,0x2CA9,0x14B8,0x242A,0x3C81,0x0A04,0x3801,
- 0x238D,0x1122,0x3286,0x12D6,0x38C2,0x1497,0x3C1F,0x21F7,
- 0x167E,0x3E09,0x1B67,0x2988,0x2078,0x3C5F,0x0057,0x27D9,
- 0x31EC,0x0B92,0x267A,0x0E64,0x2E14,0x0620,0x2546,0x1F03,
- 0x06E9,0x2D66,0x0C65,0x2918,0x10B3,0x2FEF,0x239B,0x1024,
- 0x2A4F,0x0633,0x2DF5,0x182F,0x26D1,0x057B,0x21DA,0x34A5,
- 0x0184,0x2D56,0x0C52,0x23EB,0x3C41,0x1AC3,0x07E7,0x313D,
- 0x03EB,0x2D1C,0x1A37,0x06BA,0x36D1,0x09D1,0x1965,0x311E,
- 0x1656,0x0BEC,0x22C3,0x3B80,0x12DA,0x3597,0x1815,0x00DF,
- 0x22B2,0x3F64,0x26F8,0x035E,0x2B06,0x0B60,0x3434,0x0FEE,
- 0x3FAC,0x237B,0x36E1,0x06DD,0x39B7,0x1612,0x327D,0x0B6D,
- 0x2839,0x154F,0x2AC1,0x10E3,0x34BC,0x2408,0x0F40,0x28DA,
- 0x10F5,0x2F82,0x24DF,0x119B,0x2877,0x1717,0x2CFB,0x1441,
- 0x1F52,0x248F,0x17C0,0x2D93,0x0B51,0x279B,0x0229,0x2939,
- 0x09C3,0x3C78,0x1C53,0x33FB,0x07A9,0x2566,0x01FD,0x3844,
- 0x0621,0x3F15,0x0B86,0x33EF,0x11AB,0x3DB2,0x0D1D,0x38D4,
- 0x07EA,0x34CD,0x012B,0x3AEA,0x0C76,0x20A7,0x2D4A,0x1C01,
- 0x0B91,0x2F07,0x0722,0x29E1,0x0A3B,0x275E,0x0673,0x2C6D,
- 0x0BE3,0x24BC,0x055D,0x37C2,0x0AFF,0x140B,0x3471,0x1549,
- 0x1F99,0x2C66,0x03E9,0x3BEF,0x2226,0x1BF2,0x3DF4,0x115B,
- 0x3608,0x18E8,0x38B9,0x1658,0x3B3A,0x0AEF,0x1AD3,0x3F90,
- 0x15F8,0x3852,0x1DC4,0x028E,0x3113,0x1BBC,0x2C8A,0x0BA8,
- 0x27C3,0x16E7,0x3429,0x1C75,0x0DA8,0x353D,0x29A6,0x1349,
- 0x387B,0x0F1A,0x3EB9,0x25E6,0x1531,0x2AF2,0x21A8,0x0DCC,
- 0x3E90,0x1BF7,0x33F6,0x02D7,0x2BC6,0x0ACD,0x2617,0x388B,
- 0x15A7,0x0A02,0x1B60,0x30D4,0x165D,0x258F,0x04F8,0x2990,
- 0x1B4A,0x025A,0x1805,0x2A7E,0x12E1,0x2916,0x1049,0x387A,
- 0x19DF,0x33BB,0x08C4,0x3063,0x030E,0x1BE8,0x3DCC,0x15E8,
- 0x38F8,0x029F,0x1B77,0x3761,0x04D5,0x3A0C,0x0DB4,0x34C7,
- 0x0BD0,0x306A,0x00DD,0x1D15,0x39D1,0x117F,0x3D30,0x1B16,
- 0x2EE0,0x0E1F,0x2B18,0x107C,0x1F5C,0x3B06,0x1AA8,0x21FC,
- 0x2F61,0x12B9,0x2971,0x18DE,0x273B,0x059E,0x2A86,0x1B1A,
- 0x2DDF,0x1107,0x27D5,0x1962,0x3232,0x1576,0x02C4,0x3F23,
- 0x27A4,0x1391,0x34C8,0x1B11,0x3F9F,0x11E2,0x362E,0x1838,
- 0x3A39,0x11A6,0x32FC,0x1940,0x230F,0x2DB6,0x1E37,0x07F2,
- 0x3A77,0x11D0,0x33AA,0x1934,0x0982,0x30C7,0x00AA,0x29D5,
- 0x0AB7,0x264E,0x02BF,0x2B59,0x0684,0x253C,0x34F9,0x0051,
- 0x285A,0x0B52,0x24CA,0x3D00,0x1120,0x3715,0x12C2,0x3FD4,
- 0x1457,0x2A02,0x04FE,0x3991,0x2612,0x0245,0x1F15,0x2448,
- 0x0925,0x27D6,0x1E6F,0x0C5E,0x3BC2,0x031C,0x34B2,0x1ECB,
- 0x05B7,0x2D46,0x1023,0x27AB,0x1601,0x3CCB,0x2092,0x0D4B,
- 0x326F,0x1F12,0x3A70,0x10B2,0x3652,0x0E6E,0x3C25,0x1158,
- 0x2EDA,0x1E23,0x3379,0x0DA6,0x3EB0,0x0176,0x2E67,0x22DD,
- 0x04D0,0x2008,0x3960,0x0DEB,0x2144,0x2DF9,0x0655,0x2B8F,
- 0x0C24,0x32E5,0x23A1,0x14C7,0x29A7,0x1A6E,0x2598,0x0401,
- 0x3E85,0x1331,0x3827,0x21DF,0x0706,0x31FD,0x2001,0x05EE,
- 0x233B,0x352E,0x039F,0x26BD,0x3054,0x0D7D,0x2BF9,0x0918,
- 0x1E14,0x3571,0x0327,0x3A35,0x0ECC,0x3624,0x201D,0x0268,
- 0x1EA9,0x3BED,0x0A87,0x3769,0x0650,0x25A0,0x30DC,0x17DA,
- 0x04FD,0x3A5E,0x2037,0x01A1,0x1EAE,0x314A,0x0DEC,0x2A0F,
- 0x0263,0x2D34,0x2146,0x090C,0x3EFB,0x0458,0x3747,0x1A99,
- 0x020E,0x2825,0x0DB8,0x2B91,0x2073,0x12BD,0x391C,0x16C7,
- 0x3469,0x1230,0x3EFC,0x1F1A,0x32BE,0x1CF6,0x0CE8,0x2F3D,
- 0x1284,0x3187,0x193F,0x09E3,0x23BE,0x0750,0x25AB,0x03CA,
- 0x3246,0x0E60,0x2EFC,0x0AF0,0x1955,0x3F2A,0x0FE7,0x349C,
- 0x18FC,0x2F94,0x00C2,0x327A,0x1862,0x2EDC,0x0B3D,0x39FB,
- 0x2362,0x1721,0x3AB9,0x09C0,0x328A,0x052C,0x1A36,0x2E18,
- 0x062F,0x2A25,0x02A0,0x2823,0x07E6,0x2CA2,0x1973,0x32B3,
- 0x09FE,0x3AAC,0x0824,0x2579,0x1A92,0x3502,0x1E8B,0x0ACB,
- 0x3D97,0x138C,0x24C5,0x1B07,0x3C9E,0x0EB9,0x36EA,0x18F5,
- 0x26AC,0x1F70,0x07F7,0x3416,0x0CC9,0x3D6E,0x1263,0x2A98,
- 0x1674,0x2866,0x0F13,0x2BFC,0x1A54,0x251C,0x1459,0x3035,
- 0x10A8,0x17D7,0x39A6,0x19BD,0x0548,0x36A7,0x1689,0x3D47,
- 0x10EA,0x20BD,0x263A,0x165C,0x2D7F,0x0A2C,0x2C14,0x16C4,
- 0x2FDA,0x12A6,0x2911,0x165F,0x2B7D,0x1C2D,0x0DEF,0x370E,
- 0x245F,0x0FA8,0x2ACB,0x187E,0x2D67,0x04C1,0x25E8,0x15B5,
- 0x3532,0x1BFA,0x0EE5,0x30B9,0x16B2,0x2723,0x0FDE,0x29F7,
- 0x3D5D,0x1E85,0x37B4,0x052B,0x3FD4,0x2440,0x0D3A,0x2BD6,
- 0x0572,0x2849,0x1B4B,0x0959,0x139C,0x3CB2,0x1879,0x2201,
- 0x3C0D,0x0493,0x3955,0x1D72,0x35CB,0x1738,0x3AC9,0x2072,
- 0x19FE,0x3CAF,0x1C1D,0x214C,0x31DB,0x13F2,0x2E9E,0x047F,
- 0x3A9C,0x1500,0x3789,0x24D8,0x0E04,0x1C70,0x28D3,0x1420,
- 0x30A7,0x0034,0x1C3F,0x2AB9,0x1361,0x249B,0x375E,0x1076,
- 0x3D93,0x175F,0x34E8,0x1425,0x3E6C,0x1D75,0x0122,0x211D,
- 0x277A,0x15EE,0x2065,0x2FF3,0x05BE,0x240A,0x14EE,0x2F3F,
- 0x0F2A,0x318A,0x009B,0x2C0F,0x0871,0x28B5,0x1D73,0x013E,
- 0x3FD4,0x0FCE,0x3859,0x135F,0x2F14,0x006A,0x3190,0x0A19,
- 0x2E73,0x0580,0x336A,0x0A76,0x3F8A,0x0365,0x3688,0x0C59,
- 0x3E1C,0x2157,0x08FA,0x31B1,0x22E1,0x0C0E,0x2A28,0x00C4,
- 0x2DF1,0x0A93,0x3C93,0x0797,0x1DD0,0x385F,0x105C,0x3F3E,
- 0x0889,0x359A,0x03BF,0x3DCF,0x0CEF,0x3461,0x21D8,0x082C,
- 0x1D85,0x32DC,0x0BFC,0x3C59,0x1505,0x377E,0x0CD7,0x3E73,
- 0x06F9,0x23E0,0x3B99,0x014C,0x2AEF,0x0C35,0x3364,0x13AD,
- 0x1C21,0x08F9,0x1651,0x2FF8,0x1B0C,0x02DE,0x3226,0x1EAA,
- 0x3BAF,0x0EC3,0x366B,0x20E1,0x2ADD,0x039A,0x2D7B,0x0870,
- 0x1C3C,0x2B9A,0x0D40,0x28E3,0x0128,0x2D19,0x0AA1,0x3078,
- 0x085B,0x24A1,0x0093,0x37DC,0x06D2,0x2734,0x0C32,0x2BBE,
- 0x2208,0x0D48,0x1FC3,0x067B,0x2246,0x3FC2,0x03FF,0x36F4,
- 0x0F59,0x228E,0x342D,0x071D,0x3F50,0x1CE9,0x01B5,0x287C,
- 0x211E,0x0C4D,0x1C18,0x2D5D,0x0EF5,0x2397,0x3A40,0x13CF,
- 0x355C,0x03E5,0x3CBD,0x0E1E,0x37DF,0x0C07,0x3B73,0x0356,
- 0x2800,0x18D7,0x3A60,0x164D,0x363F,0x1240,0x3272,0x22EB,
- 0x16FC,0x2D2A,0x045A,0x2AD5,0x1DEA,0x2444,0x1858,0x36B2,
- 0x1BF0,0x3B4E,0x18D6,0x2720,0x11C4,0x2D2F,0x16A8,0x28FE,
- 0x0046,0x2BB5,0x1E7E,0x0F0F,0x3FC9,0x1DB9,0x1219,0x3883,
- 0x14F0,0x328F,0x2335,0x1941,0x3114,0x0060,0x1F06,0x25D8,
- 0x199A,0x23BB,0x1F2C,0x100D,0x2F76,0x00A3,0x39A1,0x1A43,
- 0x3E4A,0x0284,0x2E82,0x1F1E,0x086F,0x1FE7,0x2928,0x1795,
- 0x2FB5,0x0B53,0x1F0D,0x34AD,0x1105,0x39C5,0x05D4,0x2FD4,
- 0x2605,0x35DA,0x211C,0x0EE8,0x26F0,0x370A,0x150F,0x0832,
- 0x1A66,0x298B,0x013C,0x3101,0x1583,0x39AA,0x0F84,0x3636,
- 0x2561,0x14D5,0x2FD9,0x11F9,0x33EE,0x1B12,0x266F,0x1677,
- 0x38BF,0x0F73,0x2CDC,0x12E9,0x2B14,0x16F4,0x3B5E,0x1D1C,
- 0x084B,0x3D53,0x29FA,0x1782,0x2F2D,0x10F1,0x2C92,0x0AAC,
- 0x1E06,0x3C4B,0x1117,0x2833,0x0E35,0x2DA4,0x18B1,0x3230,
- 0x07A7,0x3972,0x2748,0x0472,0x3815,0x0B07,0x2AE4,0x0725,
- 0x1C85,0x2A32,0x16BF,0x2C53,0x1208,0x26CB,0x1A1E,0x3262,
- 0x1198,0x2AF8,0x0CA9,0x25CB,0x0421,0x2DA3,0x0B28,0x3AB0,
- 0x072D,0x1D17,0x3C74,0x19BC,0x0986,0x3AA7,0x0632,0x2156,
- 0x0BE8,0x23DA,0x0188,0x37C3,0x20F6,0x07BB,0x3C0F,0x0FB2,
- 0x3568,0x13C3,0x3A92,0x25B1,0x02AF,0x2EEC,0x2210,0x0760,
- 0x2B84,0x1C65,0x040D,0x379E,0x0F7A,0x2A30,0x3A99,0x0521,
- 0x33C1,0x0B55,0x3941,0x250F,0x15E3,0x2A80,0x12E8,0x2D09,
- 0x1178,0x26C2,0x1448,0x368A,0x19F2,0x3AFD,0x0011,0x3325,
- 0x1352,0x2B9E,0x14B7,0x25B8,0x1B41,0x21D0,0x2CA8,0x0CFD,
- 0x159B,0x008D,0x297B,0x3A03,0x0703,0x18FA,0x2D1E,0x1FC2,
- 0x37FE,0x140C,0x3DB3,0x1E1B,0x08E8,0x1F9B,0x2940,0x17C7,
- 0x01E7,0x380B,0x07CA,0x3EE6,0x2199,0x0DBD,0x3D4F,0x0302,
- 0x1D60,0x335C,0x1841,0x3E42,0x0D91,0x33E1,0x019A,0x302B,
- 0x1A1B,0x23AC,0x02B3,0x3949,0x0906,0x35A6,0x194A,0x217A,
- 0x2BA0,0x05F1,0x2F78,0x1ED7,0x3682,0x0B25,0x3BA4,0x118B,
- 0x1DFC,0x235D,0x11D2,0x301D,0x1D09,0x33AC,0x1705,0x21FD,
- 0x3DC8,0x0AA9,0x3653,0x005A,0x1F21,0x30EF,0x0784,0x214E,
- 0x3F8B,0x05F7,0x3566,0x142E,0x3E0E,0x1B88,0x2711,0x15C1,
- 0x215F,0x34D7,0x0ED7,0x25C4,0x321E,0x0FB9,0x2814,0x3EF8,
- 0x1593,0x2F3B,0x1E16,0x0CE5,0x30E6,0x1970,0x1FA6,0x2680,
- 0x09DD,0x312F,0x06AE,0x1C35,0x36F9,0x135E,0x3B84,0x1EA1,
- 0x0C9E,0x3EE1,0x13D5,0x280A,0x1F8D,0x0BB4,0x17AE,0x2935,
- 0x1483,0x2E23,0x1AF9,0x05F2,0x3D06,0x0A66,0x262E,0x0691,
- 0x316D,0x0AA3,0x29B8,0x057E,0x2B27,0x1103,0x2782,0x0F5E,
- 0x3D77,0x03FD,0x382C,0x07FA,0x3F74,0x0369,0x1896,0x3B18,
- 0x2031,0x3E22,0x173F,0x0B6E,0x2267,0x3CD7,0x0C94,0x32DD,
- 0x045D,0x2618,0x0D88,0x2CA4,0x195A,0x342C,0x05A8,0x3E77,
- 0x222A,0x0E83,0x273C,0x1EDB,0x0528,0x2BD4,0x1424,0x2F8D,
- 0x2435,0x0972,0x29A8,0x04B6,0x255D,0x146E,0x2931,0x0F2F,
- 0x35DB,0x137E,0x32DA,0x11D4,0x1F04,0x255E,0x016E,0x3DDA,
- 0x0CED,0x37ED,0x1A58,0x02DF,0x1779,0x2A6E,0x04CF,0x26B1,
- 0x3629,0x0076,0x3F17,0x19CC,0x08B9,0x264D,0x024B,0x2DF4,
- 0x0F3E,0x289D,0x1455,0x2464,0x3E6B,0x132D,0x371E,0x1BE5,
- 0x0B68,0x2DDD,0x1006,0x290A,0x1EFD,0x08E6,0x3976,0x032B,
- 0x2A6A,0x0A61,0x3059,0x01FE,0x174D,0x3735,0x1D39,0x0321,
- 0x330F,0x0898,0x3DAE,0x238F,0x14ED,0x398C,0x026F,0x3742,
- 0x1B43,0x2417,0x174F,0x2D5A,0x0ACA,0x2830,0x04C0,0x3454,
- 0x22FD,0x1816,0x3357,0x06D3,0x3D1D,0x23C0,0x352C,0x0985,
- 0x3E3D,0x01C3,0x209D,0x30F6,0x170D,0x3403,0x1416,0x3BD2,
- 0x1B47,0x35D3,0x0F0B,0x3CC6,0x1CB0,0x33F0,0x0940,0x2ECF,
- 0x1D0F,0x2430,0x10C4,0x2F65,0x0E5F,0x32C9,0x2894,0x0847,
- 0x24E3,0x0E15,0x324D,0x1D5F,0x348B,0x01D9,0x28B2,0x131A,
- 0x2AFE,0x119F,0x3372,0x0326,0x3AD4,0x0CB4,0x2EA3,0x10F0,
- 0x30BD,0x19CB,0x3300,0x13B9,0x3A59,0x0B30,0x3639,0x2021,
- 0x126A,0x3BA7,0x1614,0x3554,0x0B37,0x397A,0x1B7C,0x3F84,
- 0x062E,0x2C6F,0x0A6E,0x270D,0x3B27,0x0ED2,0x3177,0x12C1,
- 0x2772,0x1428,0x3349,0x2063,0x3E29,0x0FB7,0x34B9,0x1F75,
- 0x0BC2,0x2BAF,0x0EAF,0x24B5,0x3BD1,0x0FC8,0x36D2,0x1C40,
- 0x38FF,0x04EA,0x330E,0x1AFF,0x0953,0x2CD5,0x0227,0x29E8,
- 0x227A,0x185C,0x3C1E,0x01A6,0x2FAB,0x18DF,0x232F,0x3377,
- 0x1095,0x3E39,0x1CAC,0x2214,0x2D74,0x07A8,0x2BA4,0x19FA,
- 0x2763,0x2009,0x1372,0x34CE,0x05FB,0x2282,0x2E8A,0x1300,
- 0x2A8A,0x03FC,0x3CD3,0x101B,0x32CA,0x16DD,0x29D4,0x0EBA,
- 0x2C8F,0x01BD,0x2177,0x2E27,0x1605,0x030F,0x1B91,0x2B3F,
- 0x0EAB,0x2479,0x387C,0x10DF,0x2BBD,0x0372,0x28ED,0x1FB1,
- 0x016C,0x1E53,0x2DC7,0x22DC,0x033C,0x16E6,0x3918,0x196E,
- 0x061D,0x31AD,0x20C8,0x191C,0x26DD,0x1ECF,0x122C,0x33FC,
- 0x1A20,0x2D0B,0x053E,0x280C,0x0EA7,0x2F2C,0x1CCC,0x38D5,
- 0x0A68,0x3ED5,0x2145,0x1BC1,0x26C0,0x161B,0x243C,0x1E6C,
- 0x0942,0x391A,0x0359,0x2CFF,0x1001,0x28A0,0x1A7A,0x06FE,
- 0x313F,0x023E,0x2835,0x10C8,0x2A8B,0x1FEF,0x038F,0x1EBC,
- 0x287B,0x1566,0x3CD1,0x1B02,0x0552,0x2D33,0x1C94,0x38F3,
- 0x046E,0x2A11,0x0A1F,0x2E40,0x0815,0x1D37,0x244D,0x14AB,
- 0x3A65,0x168C,0x32D1,0x03F5,0x2020,0x306E,0x15D6,0x09B3,
- 0x22F2,0x2F85,0x1194,0x39DE,0x21C4,0x1036,0x3AF9,0x1547,
- 0x3466,0x0518,0x1CC8,0x32E1,0x12D1,0x3676,0x0C00,0x16AA,
- 0x2C9A,0x1950,0x06F5,0x3627,0x1427,0x3BE7,0x11F8,0x37CF,
- 0x0DC3,0x39F8,0x042C,0x1C76,0x2C3F,0x1869,0x0C8C,0x3F32,
- 0x0E84,0x34C5,0x1D7D,0x26F1,0x013D,0x3E9B,0x0964,0x37EC,
- 0x127C,0x3B15,0x1AF0,0x0AC6,0x370D,0x1E42,0x3BA0,0x1235,
- 0x324E,0x19EF,0x083E,0x2697,0x0CD0,0x39FC,0x1026,0x3763,
- 0x17C2,0x3ECF,0x07D2,0x162C,0x3070,0x2133,0x0E25,0x2A45,
- 0x3AA1,0x0C0C,0x36DE,0x010D,0x3CF1,0x099A,0x38E5,0x02A2,
- 0x3BEC,0x0AE7,0x3838,0x1362,0x3F83,0x1876,0x0774,0x220D,
- 0x3028,0x17FD,0x06A2,0x2EF0,0x0A0D,0x35C2,0x00DE,0x3B89,
- 0x2AE6,0x1690,0x2505,0x1B6C,0x3745,0x002E,0x3F68,0x223D,
- 0x0EDB,0x376A,0x1CEC,0x3DC9,0x0768,0x3390,0x17EF,0x2ECC,
- 0x0E02,0x324B,0x0069,0x22FB,0x374C,0x1627,0x089D,0x22AE,
- 0x3068,0x15CD,0x3B1C,0x1220,0x28FC,0x397F,0x0216,0x2FC2,
- 0x068A,0x28C9,0x110A,0x3881,0x1832,0x063F,0x29BB,0x3FD1,
- 0x18E2,0x0BCD,0x2B72,0x0310,0x30AA,0x1E46,0x0812,0x2BC3,
- 0x0D02,0x392D,0x2525,0x0DCB,0x296F,0x05B9,0x3F4F,0x20AF,
- 0x0024,0x38FA,0x2564,0x1013,0x293D,0x0C1A,0x267F,0x00EE,
- 0x2E13,0x17AF,0x2313,0x3291,0x0FE8,0x3ADE,0x20AA,0x0679,
- 0x2CAD,0x1924,0x0833,0x38DA,0x206F,0x112C,0x301F,0x1A27,
- 0x260C,0x085F,0x3138,0x2372,0x1340,0x2D1F,0x07E3,0x27DF,
- 0x0464,0x36A6,0x1CD2,0x3FA5,0x1882,0x2185,0x3214,0x0B70,
- 0x2C35,0x12B5,0x24FF,0x3664,0x0C33,0x3FD4,0x2554,0x0201,
- 0x1EE9,0x263B,0x1691,0x2D78,0x0FBE,0x2BD0,0x1CA1,0x2294,
- 0x142A,0x29E7,0x195D,0x2E49,0x0413,0x2473,0x3A56,0x15F0,
- 0x0010,0x2315,0x3551,0x0F70,0x3D41,0x1A26,0x2808,0x0D5A,
- 0x2051,0x06EF,0x3D9A,0x0C15,0x215A,0x3248,0x1149,0x2E9A,
- 0x18CF,0x258B,0x0BDE,0x1975,0x3015,0x1317,0x3835,0x07F8,
- 0x3A6C,0x218A,0x1852,0x2B67,0x0B00,0x2076,0x3EFE,0x17DF,
- 0x0B76,0x351A,0x00CF,0x23E3,0x1F58,0x0E70,0x2B38,0x1306,
- 0x3D4E,0x18DB,0x2E8C,0x0CA2,0x27C1,0x3533,0x2134,0x00F2,
- 0x1FA0,0x3573,0x1723,0x27BE,0x13EF,0x3D76,0x25EA,0x1307,
- 0x2F6C,0x20D8,0x09C4,0x3B33,0x1F8C,0x2EC8,0x111C,0x2756,
- 0x323E,0x0E0A,0x2005,0x3D1E,0x0380,0x2F75,0x16C6,0x3452,
- 0x21E2,0x090D,0x3CCF,0x0B5F,0x29E9,0x00AB,0x3559,0x25E3,
- 0x1422,0x322A,0x24D9,0x0EF3,0x2D22,0x1BEC,0x23F9,0x035A,
- 0x3519,0x1FE1,0x1573,0x3F76,0x00EB,0x219C,0x3980,0x1662,
- 0x2A03,0x0FC4,0x2CBD,0x0038,0x30A6,0x0700,0x1D62,0x26F5,
- 0x04F1,0x33A0,0x0DC2,0x1E0D,0x28A6,0x06CB,0x1C2C,0x3558,
- 0x0D89,0x3C51,0x0757,0x1D9B,0x34DE,0x177D,0x06C3,0x3129,
- 0x355B,0x00F4,0x269F,0x0CD6,0x36B0,0x1BE0,0x094B,0x341C,
- 0x1D65,0x3C3B,0x12EB,0x2B6D,0x1D2A,0x0603,0x3318,0x14B2,
- 0x2975,0x34F0,0x10D0,0x2F58,0x05DB,0x1DDA,0x2B58,0x093A,
- 0x3442,0x0452,0x39D8,0x2B02,0x00E8,0x2462,0x0C84,0x276B,
- 0x1DE7,0x0506,0x2FB6,0x1249,0x346E,0x266D,0x0242,0x2DD3,
- 0x1D81,0x2503,0x199D,0x3FD0,0x0731,0x35E6,0x1AA2,0x339A,
- 0x0A90,0x25B7,0x0193,0x3E40,0x1DC9,0x0910,0x1436,0x3A6D,
- 0x26E7,0x066C,0x3C15,0x0AB9,0x34B4,0x048C,0x1B33,0x3863,
- 0x00BE,0x193B,0x313C,0x161D,0x02B6,0x1A94,0x3506,0x0863,
- 0x1A03,0x2BE1,0x054A,0x1BDB,0x32E8,0x14AD,0x3FA3,0x0D46,
- 0x1AE5,0x2CC7,0x1476,0x27EA,0x1625,0x307C,0x1A67,0x0B21,
- 0x3BB4,0x0211,0x1B6B,0x343E,0x0530,0x39BC,0x0C41,0x3DA2,
- 0x0DD5,0x2EAF,0x0596,0x1C42,0x333C,0x183F,0x0DBC,0x346F,
- 0x0BD4,0x3C8E,0x21FA,0x15E4,0x2391,0x3B70,0x0EDD,0x2FE2,
- 0x19AB,0x20F7,0x3B2C,0x00B5,0x385E,0x151E,0x2E04,0x1243,
- 0x2923,0x158C,0x3103,0x246F,0x049F,0x3ECA,0x20F2,0x106C,
- 0x0BE9,0x3DD7,0x1610,0x2B13,0x125E,0x2F9C,0x25EB,0x1063,
- 0x2D0D,0x0BEA,0x2722,0x027E,0x30FF,0x21B3,0x1844,0x3FBD,
- 0x03D2,0x1E7F,0x26A8,0x1799,0x3C20,0x0D96,0x237E,0x3AF8,
- 0x133D,0x2881,0x1E69,0x10A3,0x1F6D,0x3C9D,0x16AB,0x2E05,
- 0x1067,0x3E91,0x0D35,0x3901,0x06F2,0x1971,0x32AE,0x0DA0,
- 0x3BB2,0x0627,0x30F1,0x0CCC,0x297A,0x1E7B,0x03AF,0x1FEB,
- 0x2AB8,0x11F5,0x31EA,0x2236,0x1031,0x3792,0x295B,0x1ACC,
- 0x0CEC,0x2EBD,0x15CC,0x2A3C,0x10CB,0x23AE,0x3285,0x1152,
- 0x24B7,0x3EBC,0x07C2,0x2B62,0x1DFA,0x3CFC,0x0F6D,0x245B,
- 0x3B8B,0x1256,0x383E,0x26D9,0x09FC,0x2B29,0x069D,0x1FB4,
- 0x3900,0x0259,0x366D,0x0653,0x3E9D,0x0A1C,0x1FA2,0x2BFF,
- 0x1157,0x2042,0x3E2B,0x0BAF,0x2848,0x159D,0x31B3,0x1757,
- 0x2A2E,0x11C6,0x3590,0x26B0,0x093B,0x2FE3,0x25C7,0x02C1,
- 0x2E5A,0x1E48,0x05D2,0x381E,0x0A3F,0x1EA7,0x34F3,0x0247,
- 0x3DCB,0x09BB,0x25FF,0x18B9,0x201E,0x32E7,0x0900,0x3E04,
- 0x0385,0x388F,0x09F4,0x1A88,0x2AA0,0x0EB5,0x300E,0x253E,
- 0x2A5E,0x112A,0x3215,0x07A5,0x3D20,0x0246,0x2002,0x3B21,
- 0x048F,0x29BA,0x172C,0x35E7,0x0E6D,0x389D,0x0908,0x2330,
- 0x3018,0x0B71,0x362F,0x01AF,0x2280,0x31B8,0x1667,0x02BB,
- 0x20D1,0x3E15,0x06C6,0x234D,0x3127,0x0916,0x358C,0x02FA,
- 0x3343,0x2227,0x1A71,0x24E8,0x1D5E,0x3D0E,0x11C5,0x29D9,
- 0x148E,0x2C1A,0x10D5,0x3707,0x1371,0x39D7,0x16B3,0x3CBF,
- 0x07C1,0x36AF,0x1B86,0x057D,0x3004,0x209C,0x034D,0x33DB,
- 0x2487,0x1004,0x3238,0x01A8,0x3F34,0x1EFE,0x0770,0x2CB6,
- 0x0D51,0x1E86,0x3587,0x0E80,0x308B,0x0695,0x2A42,0x1D66,
- 0x0251,0x2E2C,0x0AEC,0x189F,0x355A,0x11CB,0x247B,0x3149,
- 0x0F1B,0x2A8E,0x1B5D,0x2EB3,0x12B0,0x2698,0x3A38,0x056E,
- 0x368F,0x2446,0x14F1,0x2FCB,0x1052,0x2B4C,0x0010,0x2773,
- 0x077E,0x3C2D,0x20A3,0x0E7C,0x3D6C,0x1FBA,0x12B8,0x3A86,
- 0x224F,0x10E6,0x2AFA,0x1758,0x2DA2,0x11C2,0x2292,0x2A93,
- 0x143D,0x2CE6,0x1202,0x30C0,0x04C5,0x26BC,0x1AF1,0x22C6,
- 0x2C50,0x1048,0x205B,0x36B3,0x14B4,0x3985,0x02E8,0x1AD1,
- 0x0671,0x3755,0x2314,0x180E,0x21E8,0x319D,0x0D9D,0x1B63,
- 0x3347,0x149F,0x3F27,0x07DD,0x2A6D,0x13F5,0x2C1F,0x1028,
- 0x19D9,0x3A2E,0x1517,0x2E64,0x1B93,0x086B,0x372C,0x1C64,
- 0x2F54,0x0E6B,0x1BF9,0x3649,0x0F17,0x2B82,0x189C,0x25E1,
- 0x1F17,0x095B,0x30A3,0x0159,0x2C52,0x0A49,0x27C9,0x03D3,
- 0x3886,0x1ADF,0x25D0,0x0271,0x2EC6,0x0956,0x313A,0x0F14,
- 0x2CFD,0x13B4,0x2668,0x3C2E,0x0D34,0x160F,0x3ECB,0x17CB,
- 0x0543,0x3A01,0x20D6,0x19DD,0x2862,0x123D,0x3AC1,0x1591,
- 0x33E7,0x04B2,0x2675,0x1829,0x223E,0x376E,0x0BBC,0x33BC,
- 0x17BE,0x22F4,0x3279,0x208E,0x0166,0x3A83,0x1C56,0x048E,
- 0x3D85,0x20CA,0x0876,0x234B,0x37F8,0x0328,0x1716,0x3112,
- 0x19FB,0x0804,0x2A39,0x03C7,0x3B61,0x1D97,0x3825,0x12D2,
- 0x30B5,0x1A48,0x025D,0x2D5E,0x1910,0x04B8,0x328B,0x09F6,
- 0x1A82,0x3E4E,0x0CD5,0x35D6,0x03A3,0x3F2B,0x0864,0x1C5A,
- 0x329D,0x066E,0x3A51,0x0EBE,0x3D31,0x1333,0x3779,0x0CD2,
- 0x173A,0x334C,0x2754,0x003F,0x2D37,0x0B44,0x1FD7,0x3B5B,
- 0x2F4F,0x1DA3,0x03C0,0x2E77,0x0A32,0x1655,0x37D1,0x2780,
- 0x0AE9,0x2E08,0x0F43,0x247A,0x1A83,0x3AE2,0x0104,0x345E,
- 0x2074,0x070F,0x2AD8,0x0E11,0x3EA6,0x25CD,0x0CBD,0x2933,
- 0x079C,0x334F,0x26A5,0x01DD,0x3F1A,0x1CCA,0x05E8,0x3BB8,
- 0x128F,0x36D8,0x160D,0x3B07,0x16F5,0x3674,0x13D2,0x33F5,
- 0x2222,0x087B,0x3D80,0x2112,0x181B,0x24CD,0x1BB4,0x2705,
- 0x0028,0x3A9D,0x0935,0x1976,0x2C76,0x234F,0x096B,0x308E,
- 0x1C8F,0x28F4,0x0867,0x37D8,0x0B65,0x300C,0x02C8,0x2AB6,
- 0x1FE2,0x3C7B,0x0C66,0x39AF,0x013A,0x15E1,0x2D53,0x13CA,
- 0x3F22,0x07E5,0x1514,0x3C70,0x25E9,0x0CAD,0x3041,0x1806,
- 0x253B,0x11A1,0x3193,0x18C5,0x0DAD,0x219B,0x2B68,0x0FB4,
- 0x257E,0x3AA8,0x124E,0x3312,0x1ACA,0x0A91,0x22C9,0x33D3,
- 0x0CB7,0x2480,0x39D6,0x105D,0x3628,0x2973,0x151F,0x2518,
- 0x33B4,0x017B,0x2F9D,0x14B6,0x1F6F,0x27AC,0x1808,0x389F,
- 0x0FA2,0x2758,0x1D2E,0x2AA5,0x0A6D,0x2D24,0x0192,0x2175,
- 0x3BA6,0x05DF,0x1986,0x3F57,0x1279,0x248D,0x3410,0x0FE9,
- 0x20FE,0x0E48,0x3FD4,0x1EAF,0x39E0,0x235E,0x05C4,0x18B0,
- 0x3BD9,0x0191,0x1F44,0x319E,0x054C,0x1D87,0x2F37,0x0C80,
- 0x3CE2,0x24B0,0x11D9,0x32A4,0x0502,0x1867,0x397C,0x12BE,
- 0x3C73,0x1ED5,0x1381,0x2D15,0x1524,0x2422,0x304F,0x0CE0,
- 0x2A17,0x0495,0x28B7,0x0B94,0x26C3,0x0672,0x2E42,0x1D1B,
- 0x0EF1,0x303D,0x1555,0x343D,0x0AF4,0x3E9C,0x052F,0x386F,
- 0x20FC,0x1713,0x22AD,0x358E,0x022E,0x38C4,0x1E60,0x1161,
- 0x3D2F,0x0EEE,0x3319,0x16CC,0x2567,0x1BB8,0x373F,0x1466,
- 0x093E,0x19B0,0x29C6,0x124B,0x27F1,0x3DF6,0x217D,0x041C,
- 0x2786,0x1CAD,0x2D0E,0x05AE,0x1E66,0x29C1,0x13E8,0x3890,
- 0x0A30,0x35F2,0x0044,0x3B95,0x1CDC,0x35BA,0x0B6C,0x3FCD,
- 0x011C,0x1E4D,0x2DD1,0x092C,0x26D0,0x3EEF,0x1813,0x05AF,
- 0x2C34,0x1D18,0x08B2,0x271B,0x20EA,0x0C56,0x3C0E,0x072A,
- 0x1D35,0x2A72,0x0F49,0x2405,0x398F,0x0B1C,0x2C9F,0x0108,
- 0x2373,0x3712,0x02F4,0x182E,0x35DD,0x2358,0x1B8A,0x2EF7,
- 0x0B7E,0x2AF5,0x1F96,0x0D1B,0x31B5,0x1881,0x07E2,0x27CE,
- 0x0168,0x34D5,0x1A0E,0x0836,0x1396,0x304E,0x1D11,0x2CBB,
- 0x1190,0x23EA,0x36D6,0x10A9,0x3D57,0x2625,0x12BB,0x29F8,
- 0x17EB,0x02FF,0x38DD,0x1AB8,0x2130,0x2B3C,0x009C,0x2DAA,
- 0x229C,0x0414,0x38AE,0x0D71,0x33AF,0x0AB2,0x19E5,0x35EB,
- 0x144F,0x3FA8,0x10F6,0x34AE,0x1329,0x3DFA,0x22D1,0x007F,
- 0x39EF,0x1FA1,0x0565,0x1E31,0x2BBF,0x1251,0x333D,0x1508,
- 0x2F50,0x0C44,0x3173,0x10F2,0x2B0D,0x0DF1,0x2E57,0x21EB,
- 0x0094,0x26BE,0x203C,0x0411,0x3CD6,0x0A2E,0x22FF,0x31D3,
- 0x1DE2,0x2F10,0x03C5,0x3327,0x1ED0,0x0883,0x1B5A,0x3501,
- 0x1045,0x38EE,0x0E54,0x360F,0x15DE,0x3ED7,0x02B9,0x1D20,
- 0x2C7E,0x1327,0x293F,0x0C31,0x2891,0x05E1,0x2D9D,0x1933,
- 0x3180,0x0E51,0x227E,0x3740,0x149A,0x01F0,0x2171,0x3942,
- 0x13D0,0x36C0,0x17A2,0x3FD4,0x00AF,0x1DDC,0x2845,0x1958,
- 0x38C6,0x1380,0x3D28,0x0649,0x19E6,0x323A,0x13A9,0x3C29,
- 0x1AB2,0x0D4F,0x20A1,0x2E1D,0x14E2,0x059F,0x3F06,0x0FAD,
- 0x3578,0x12FB,0x39E6,0x25B9,0x0410,0x38DC,0x1CC1,0x3C8F,
- 0x2DB4,0x11DD,0x2875,0x32F4,0x20C5,0x0086,0x3E8E,0x0C6B,
- 0x34AB,0x1BD7,0x0B54,0x2C55,0x1763,0x0994,0x37EB,0x066A,
- 0x325C,0x1D2F,0x273F,0x09F1,0x2FDE,0x0DDF,0x3530,0x1DBE,
- 0x1168,0x3139,0x17B6,0x2A91,0x04D2,0x3A98,0x27BD,0x0010,
- 0x237F,0x1C22,0x2C8E,0x0298,0x2F11,0x1DDB,0x101A,0x2D2D,
- 0x0B9B,0x2A44,0x1A78,0x3BDE,0x017E,0x2886,0x1FCD,0x0773,
- 0x1DE9,0x3F92,0x0451,0x2737,0x1C58,0x3BC0,0x05DC,0x3696,
- 0x1954,0x34A8,0x0DCE,0x2F9B,0x12D7,0x2E11,0x1784,0x0043,
- 0x3FBE,0x0D70,0x383C,0x2343,0x0FA7,0x36C1,0x28C6,0x14E4,
- 0x2EDE,0x0087,0x1F65,0x285F,0x0941,0x2278,0x33ED,0x2685,
- 0x074E,0x3E4D,0x1FC1,0x3383,0x1071,0x3D0F,0x2305,0x118F,
- 0x2024,0x38D3,0x04C6,0x16E9,0x2C87,0x1D3C,0x2EC5,0x0FD5,
- 0x2874,0x0374,0x2F42,0x14FE,0x2BE9,0x37AD,0x0D9C,0x3065,
- 0x0349,0x28A8,0x0B9C,0x347A,0x25E2,0x0463,0x2983,0x0A1D,
- 0x3341,0x2470,0x3E46,0x092F,0x3928,0x2223,0x18D3,0x27E8,
- 0x0291,0x309D,0x08AC,0x1B20,0x2A56,0x0F38,0x2C3B,0x1481,
- 0x0A7F,0x3AB8,0x04C3,0x15DA,0x383F,0x2672,0x0FCD,0x29D7,
- 0x0514,0x27D7,0x392E,0x0396,0x2232,0x307E,0x1C45,0x2529,
- 0x0ECA,0x3EF5,0x1309,0x3716,0x15B8,0x3B48,0x2192,0x062D,
- 0x29CB,0x0BB9,0x3D1F,0x10B0,0x254C,0x1E1D,0x0FDA,0x2BF7,
- 0x392F,0x0861,0x1877,0x3C18,0x23F0,0x07AF,0x374E,0x18E0,
- 0x3F59,0x1171,0x34E9,0x0E28,0x2EFB,0x0FCB,0x31DE,0x1A44,
- 0x2C3D,0x0F4C,0x1F4A,0x37AE,0x083D,0x17B8,0x2A77,0x1472,
- 0x2CD0,0x07E0,0x3AE1,0x1A85,0x2769,0x06B7,0x396C,0x20FF,
- 0x11ED,0x2B3B,0x1A3F,0x0AE3,0x2FB0,0x187B,0x05D8,0x3A61,
- 0x0C53,0x23ED,0x3B1A,0x1280,0x3027,0x1A1C,0x0AF8,0x1673,
- 0x2F36,0x1A91,0x03AE,0x16B8,0x2AFD,0x1C5E,0x0292,0x3428,
- 0x08A1,0x271F,0x1BA3,0x3CD9,0x0A2F,0x3616,0x0710,0x3E18,
- 0x0D10,0x34E5,0x224D,0x0BE7,0x1FA3,0x0624,0x24A7,0x11FE,
- 0x336B,0x1558,0x2DFB,0x1E22,0x0FE6,0x361C,0x1D00,0x2F52,
- 0x145A,0x051B,0x1633,0x3120,0x11E0,0x29EC,0x082A,0x386A,
- 0x20DA,0x16FA,0x2336,0x3DB8,0x13A0,0x366F,0x0647,0x2406,
- 0x1785,0x2593,0x1D63,0x2B9D,0x08C7,0x1B03,0x35ED,0x14FF,
- 0x3CA1,0x191F,0x0E38,0x1E4B,0x3E67,0x155C,0x004E,0x3A97,
- 0x1FF2,0x07DF,0x2CE3,0x0243,0x2A53,0x08B6,0x1961,0x3FD4,
- 0x1421,0x3467,0x0171,0x201C,0x2FF6,0x08EC,0x3DED,0x1CBC,
- 0x0E27,0x210F,0x3134,0x1553,0x0C81,0x1F0A,0x282B,0x0392,
- 0x2197,0x311F,0x0648,0x23AF,0x17C9,0x3816,0x0A0C,0x3CFB,
- 0x0289,0x360C,0x24B4,0x1273,0x31FF,0x2539,0x0C0B,0x3E87,
- 0x0FC6,0x1F3F,0x23EF,0x024A,0x3E2D,0x1E47,0x0E29,0x3473,
- 0x2603,0x050C,0x3C0A,0x2040,0x0221,0x3D43,0x2519,0x12DB,
- 0x2BB6,0x1B1E,0x081C,0x3304,0x0454,0x3C19,0x1F4F,0x3702,
- 0x0F27,0x3A15,0x1EDA,0x3562,0x0917,0x3987,0x17C4,0x2394,
- 0x3C17,0x0DC1,0x2F8B,0x1142,0x2AA2,0x18AD,0x25C1,0x1356,
- 0x2D01,0x19B8,0x081F,0x3C30,0x2A08,0x187F,0x3EC8,0x2032,
- 0x0920,0x3A22,0x2117,0x004A,0x3F7F,0x22FE,0x072C,0x17A0,
- 0x3D01,0x1EAB,0x2B99,0x1C71,0x0084,0x349E,0x1F7B,0x1378,
- 0x323C,0x0AF7,0x2E87,0x00F7,0x3123,0x0C8F,0x2006,0x3E51,
- 0x2ED8,0x0D6E,0x3477,0x0F09,0x3D98,0x238A,0x0338,0x30B4,
- 0x0A11,0x209B,0x3280,0x28C5,0x090B,0x34D8,0x2710,0x116A,
- 0x2DE6,0x1AE8,0x222B,0x348C,0x0FF7,0x2679,0x30A2,0x0CAB,
- 0x2BDE,0x22EE,0x19C2,0x3800,0x123C,0x34D0,0x2339,0x0347,
- 0x29CC,0x379D,0x0533,0x22B9,0x39AE,0x2A31,0x0DE0,0x3233,
- 0x0A56,0x19D2,0x29AD,0x3AD5,0x0361,0x1C95,0x27FD,0x1463,
- 0x2A1E,0x192D,0x09AD,0x3DC4,0x0120,0x1B25,0x2D9F,0x034A,
- 0x27BB,0x38A5,0x13D7,0x32D7,0x11A7,0x3055,0x2268,0x08CA,
- 0x1920,0x2EA1,0x13F1,0x274A,0x329F,0x0E93,0x1E3B,0x35C8,
- 0x035F,0x3FD4,0x2624,0x0FB5,0x2B45,0x14AF,0x2DC9,0x00D6,
- 0x2A69,0x06A9,0x2E7A,0x1385,0x2820,0x0EFE,0x2FE8,0x0686,
- 0x1C9C,0x2A24,0x0079,0x346B,0x220A,0x03F6,0x3B4B,0x1F40,
- 0x0137,0x3846,0x1CD9,0x2385,0x0E8F,0x31A2,0x021C,0x3544,
- 0x1B71,0x2530,0x1135,0x2FFC,0x18F2,0x0CF1,0x3A9A,0x27DD,
- 0x0222,0x341A,0x0AC0,0x3A1A,0x22F3,0x15AE,0x3C9C,0x0459,
- 0x1C1F,0x3B08,0x10A6,0x1E24,0x26AE,0x1914,0x3260,0x02D2,
- 0x1C4C,0x39A3,0x01FF,0x2FBF,0x1F35,0x12D8,0x2D38,0x1727,
- 0x2433,0x39C8,0x01CC,0x1370,0x2E4C,0x205C,0x0D31,0x3691,
- 0x0485,0x3BE5,0x0B3E,0x18C2,0x3D5E,0x1F7A,0x033B,0x3865,
- 0x1E08,0x0551,0x2E28,0x0ACE,0x2AEB,0x0663,0x175A,0x3278,
- 0x1FCA,0x0F5D,0x1CCE,0x3329,0x01A5,0x176C,0x3CA3,0x1376,
- 0x38B5,0x2653,0x1577,0x0C55,0x2261,0x3575,0x06EC,0x3959,
- 0x0B77,0x345D,0x28C1,0x1390,0x2388,0x399F,0x0EC5,0x35F5,
- 0x1DAD,0x0717,0x2A09,0x0A95,0x2B86,0x0449,0x37AB,0x1C9B,
- 0x3B36,0x1078,0x371B,0x061A,0x1AD0,0x2C72,0x08FC,0x20EE,
- 0x3170,0x0D2E,0x190E,0x386B,0x21E3,0x0A6B,0x1C03,0x3DEE,
- 0x12BA,0x2583,0x0CD9,0x3F89,0x018F,0x364F,0x2225,0x163E,
- 0x3254,0x100A,0x3F5B,0x1E36,0x0E2E,0x30D3,0x1083,0x32EA,
- 0x24A8,0x0D77,0x2FEE,0x045B,0x3A6F,0x1648,0x2870,0x0F01,
- 0x2D84,0x04E0,0x3C6C,0x08AE,0x1FF7,0x31B0,0x11A3,0x20C6,
- 0x2E99,0x12D5,0x26FD,0x0F48,0x2D6C,0x08D1,0x2917,0x2135,
- 0x2B3A,0x0741,0x2251,0x3727,0x0544,0x3C14,0x1443,0x2749,
- 0x079A,0x234E,0x1AAD,0x24E0,0x0694,0x3B0D,0x0B1F,0x3732,
- 0x074C,0x1589,0x25F9,0x355D,0x182D,0x05BF,0x2FF5,0x13E4,
- 0x2997,0x1604,0x27A2,0x2F44,0x06BE,0x1570,0x33D8,0x239E,
- 0x0E46,0x3AD0,0x1663,0x3E69,0x1BC6,0x216B,0x3B90,0x14DB,
- 0x0936,0x3EC9,0x276C,0x11C8,0x2CE4,0x2136,0x0746,0x2FB8,
- 0x1EC2,0x010B,0x3E47,0x1CF4,0x30C3,0x10A0,0x2D1B,0x21CC,
- 0x15D3,0x1F77,0x04A4,0x2F95,0x1D12,0x08BA,0x308C,0x20AB,
- 0x1114,0x338B,0x18F9,0x3A0E,0x1557,0x268C,0x132A,0x29E6,
- 0x018D,0x2BF4,0x0BA6,0x21FE,0x3E9F,0x1592,0x39EC,0x11B3,
- 0x248A,0x1CE6,0x2E44,0x01DA,0x1692,0x35DF,0x2357,0x08DF,
- 0x210B,0x31F4,0x18DA,0x22AF,0x2D40,0x14D0,0x0B2F,0x3A8D,
- 0x046C,0x2791,0x206E,0x08FB,0x39AC,0x1C0A,0x2BA5,0x09EB,
- 0x1B36,0x3D7F,0x13F7,0x2957,0x0B5C,0x2F08,0x07DB,0x3DC3,
- 0x132E,0x291B,0x1698,0x35AC,0x2657,0x0397,0x3824,0x097D,
- 0x1A1A,0x3799,0x05AA,0x3FC5,0x1842,0x3388,0x0D67,0x14DA,
- 0x3EA9,0x1788,0x2FE9,0x12A2,0x2BFE,0x21E0,0x0969,0x305B,
- 0x376D,0x1237,0x3F11,0x10D8,0x32D4,0x1945,0x2B0B,0x1167,
- 0x2860,0x3F88,0x1A96,0x0831,0x3C47,0x22CA,0x1B28,0x3A21,
- 0x0999,0x330A,0x0111,0x2022,0x38F7,0x2328,0x0961,0x16ED,
- 0x2FA1,0x21B5,0x081B,0x25A8,0x0258,0x2DE5,0x0B2D,0x263C,
- 0x340D,0x20D7,0x05FD,0x3AA5,0x0AD5,0x3489,0x1A97,0x2563,
- 0x0E99,0x2D7A,0x113E,0x2B22,0x047E,0x3C80,0x1B2E,0x0077,
- 0x3F38,0x241A,0x3698,0x0F28,0x3B63,0x169A,0x26E4,0x04DE,
- 0x3FA1,0x2460,0x00D3,0x1D56,0x2E78,0x0822,0x3EEA,0x0F2D,
- 0x3392,0x14F6,0x1E9A,0x30EE,0x0CAE,0x28EE,0x00FC,0x2D39,
- 0x06C7,0x3414,0x0B73,0x3DA1,0x28E9,0x0542,0x3162,0x181E,
- 0x3790,0x03F9,0x3929,0x09A9,0x1D7E,0x3C8C,0x1BEB,0x2993,
- 0x192E,0x350B,0x127F,0x2EC2,0x2354,0x0654,0x15B6,0x37C9,
- 0x27B1,0x059D,0x3453,0x170B,0x3782,0x1264,0x241C,0x1ACD,
- 0x32E3,0x0C08,0x2E55,0x0E1C,0x1A70,0x2B1F,0x14DE,0x24F6,
- 0x30E2,0x0E8C,0x294C,0x1FB0,0x02C5,0x1E01,0x38BB,0x260E,
- 0x01BE,0x29D3,0x0BD3,0x3A7D,0x0DEA,0x1B52,0x344A,0x15E5,
- 0x0C26,0x2909,0x03B2,0x2A01,0x0C3D,0x2731,0x00CD,0x33E5,
- 0x1E7C,0x0426,0x2F7B,0x1FD3,0x1069,0x3153,0x02AE,0x25C8,
- 0x1E6B,0x1214,0x3E3B,0x17CA,0x0CF5,0x2CA0,0x1CB1,0x3CF8,
- 0x006D,0x1ADE,0x36CE,0x0EF9,0x34F4,0x1354,0x3988,0x1B74,
- 0x00B9,0x17E5,0x2E7D,0x15DB,0x2AE1,0x12CF,0x3DBA,0x0465,
- 0x37AA,0x1880,0x339E,0x0B1E,0x28AF,0x0E81,0x2678,0x316A,
- 0x131D,0x0895,0x1996,0x2B6A,0x01ED,0x3269,0x109D,0x2CAB,
- 0x17BA,0x0D5D,0x2205,0x3C4F,0x0EA5,0x350A,0x1C20,0x2789,
- 0x076F,0x3CE6,0x258D,0x0368,0x381C,0x13A2,0x361F,0x1503,
- 0x3CAD,0x1783,0x26E8,0x1154,0x1D99,0x3AB4,0x1053,0x2BCE,
- 0x0E1B,0x1E3A,0x27E1,0x160E,0x2AC8,0x02F8,0x3324,0x07D1,
- 0x2465,0x0A7B,0x3876,0x02AB,0x177C,0x3E72,0x2245,0x020A,
- 0x1846,0x2E31,0x0F6F,0x2665,0x008A,0x20B7,0x3106,0x03D0,
- 0x1FC0,0x3ADA,0x01AE,0x215B,0x395A,0x07A4,0x3E84,0x1C2A,
- 0x0132,0x3B7B,0x13E6,0x35E3,0x1AA4,0x3057,0x06A7,0x1F34,
- 0x3651,0x1A24,0x336C,0x037C,0x211A,0x3FB1,0x002A,0x2B1A,
- 0x3A23,0x1BF1,0x3513,0x1556,0x3C5D,0x1684,0x385B,0x21C1,
- 0x0D37,0x2C17,0x0ED9,0x38BE,0x24EF,0x0BC0,0x3F51,0x0E74,
- 0x379C,0x21EC,0x088E,0x2366,0x32B0,0x03DF,0x356F,0x0DA4,
- 0x2627,0x3171,0x1449,0x2947,0x1938,0x27EF,0x06DF,0x30E5,
- 0x1EBB,0x3D3A,0x09C5,0x3821,0x02CB,0x242F,0x0D23,0x2F5A,
- 0x200B,0x06E2,0x235F,0x39FD,0x13D9,0x373B,0x0793,0x17FF,
- 0x3539,0x1E82,0x3C13,0x0C02,0x25BA,0x1A33,0x3D18,0x0B23,
- 0x36BF,0x1C6D,0x2DBF,0x05EF,0x29AB,0x1809,0x02E0,0x3157,
- 0x1FBE,0x1679,0x0A5D,0x2D8F,0x18BD,0x26B4,0x07BF,0x2ADB,
- 0x1C69,0x03CF,0x3699,0x206C,0x07AD,0x22D5,0x2F91,0x022F,
- 0x20AD,0x3B82,0x0726,0x33FA,0x0F96,0x304D,0x1321,0x1F1C,
- 0x3DE9,0x16E5,0x2642,0x1D19,0x3161,0x0FC1,0x33DA,0x1D76,
- 0x3B94,0x08C3,0x1EEE,0x3FA0,0x1B26,0x39F3,0x10AC,0x36D9,
- 0x14A7,0x2483,0x1BA5,0x3245,0x1410,0x2F6D,0x109B,0x33E8,
- 0x2193,0x0C2D,0x2E39,0x07C3,0x2B07,0x0CB5,0x3C55,0x1146,
- 0x23A0,0x0F93,0x2543,0x1C68,0x2DD7,0x11A5,0x2633,0x17E3,
- 0x05CD,0x2461,0x0A42,0x2F1E,0x052D,0x2CCC,0x09D2,0x1B83,
- 0x3CF9,0x128A,0x3365,0x014F,0x1CBD,0x2AF4,0x14A8,0x2C70,
- 0x0457,0x3203,0x196A,0x39CF,0x0F68,0x287D,0x12A5,0x2B44,
- 0x1BFD,0x0A13,0x3A32,0x04A6,0x3F4E,0x0C2E,0x365D,0x106E,
- 0x2BA6,0x0E55,0x29FC,0x2173,0x18D0,0x3553,0x1B9E,0x26CC,
- 0x1216,0x3F1C,0x1AD7,0x026E,0x3088,0x218E,0x1D46,0x2AAD,
- 0x05A3,0x2E24,0x1533,0x20C0,0x390A,0x0729,0x1DE6,0x2A33,
- 0x039B,0x312E,0x0C87,0x3791,0x1165,0x3297,0x22E5,0x0D05,
- 0x39BD,0x23A4,0x354C,0x0FE4,0x3BD8,0x0DE2,0x3370,0x102D,
- 0x241E,0x312B,0x0EDF,0x29BF,0x3974,0x0C1F,0x155F,0x3EE4,
- 0x25F7,0x1127,0x2E12,0x1CBF,0x3E99,0x0979,0x21C2,0x359F,
- 0x012F,0x2C25,0x0BA5,0x3BD3,0x07AA,0x2BE0,0x0C79,0x29DE,
- 0x11FD,0x3356,0x23A7,0x0C49,0x2E98,0x0759,0x2A46,0x0A38,
- 0x2C09,0x06B9,0x3F0C,0x0AD3,0x26C6,0x0320,0x28B8,0x094A,
- 0x2C6A,0x164F,0x2283,0x39DD,0x1255,0x26DE,0x1740,0x32F9,
- 0x049C,0x3E1A,0x0A07,0x393C,0x06B2,0x3694,0x0ADF,0x3119,
- 0x3DD5,0x165A,0x37C4,0x1A63,0x255A,0x143B,0x30E1,0x22F1,
- 0x05FE,0x204E,0x2793,0x15AA,0x3B51,0x0708,0x33D7,0x1760,
- 0x2838,0x0FD4,0x2A13,0x0217,0x2ECE,0x1FC4,0x3F81,0x0629,
- 0x375A,0x23E5,0x10D6,0x2C4B,0x125D,0x2EA0,0x158D,0x26FE,
- 0x041E,0x36ED,0x1B3B,0x0727,0x301B,0x0A4D,0x3B9B,0x004D,
- 0x32ED,0x0A9A,0x212E,0x2B8E,0x1767,0x0C46,0x3B17,0x11C9,
- 0x384B,0x22A6,0x02FE,0x2C30,0x0DB9,0x317B,0x23E9,0x11B2,
- 0x3A64,0x15FB,0x253A,0x1A4F,0x2841,0x0A9C,0x3D89,0x1D8F,
- 0x137B,0x0063,0x1B27,0x289F,0x0532,0x2FF2,0x1A72,0x3AFF,
- 0x0ABC,0x1F60,0x3F6A,0x0015,0x188A,0x284D,0x3397,0x19D4,
- 0x0ADA,0x3589,0x17B2,0x008B,0x2496,0x1ABC,0x2A47,0x0E85,
- 0x2F6E,0x1224,0x349F,0x13DA,0x2531,0x19A0,0x3AD3,0x060F,
- 0x2FAE,0x19DA,0x033E,0x363A,0x1681,0x2752,0x13BB,0x3CF6,
- 0x1D29,0x303C,0x117E,0x2A26,0x1733,0x3BC1,0x122E,0x3658,
- 0x1E67,0x3DD8,0x03C6,0x1B89,0x2EFA,0x00DC,0x2A36,0x0EAD,
- 0x2D58,0x1364,0x319C,0x15A0,0x2AE0,0x19B5,0x2846,0x1475,
- 0x0CE1,0x295F,0x017A,0x2BA3,0x0B6B,0x3ED2,0x0304,0x396D,
- 0x18E9,0x3583,0x091B,0x3094,0x199E,0x2659,0x0F1E,0x3D75,
- 0x0AF3,0x3634,0x1E8A,0x3C03,0x16FE,0x07C4,0x1A2E,0x2D88,
- 0x1675,0x02BD,0x3386,0x1D45,0x251D,0x0164,0x3C58,0x1966,
- 0x2D6E,0x133F,0x24D7,0x3FCB,0x10EF,0x2813,0x144D,0x2D5C,
- 0x22F9,0x1694,0x34DD,0x0F60,0x3D29,0x25EE,0x0152,0x320A,
- 0x0AEB,0x1B61,0x3DAF,0x1426,0x35C4,0x1887,0x0010,0x3031,
- 0x1CF2,0x096D,0x3E10,0x01D1,0x3920,0x1EDE,0x0515,0x291F,
- 0x363B,0x1EFF,0x3F47,0x1268,0x2B4D,0x2025,0x01CE,0x1E74,
- 0x2E1F,0x0659,0x24DA,0x1C30,0x303F,0x13C6,0x0494,0x1FAC,
- 0x2C9D,0x0612,0x26FC,0x3A34,0x0D45,0x3743,0x04F0,0x3C44,
- 0x1DB0,0x26CE,0x044F,0x20A5,0x307D,0x0027,0x240C,0x1F37,
- 0x0EAA,0x3E3C,0x2600,0x1140,0x2CB2,0x04AA,0x3216,0x21DB,
- 0x0101,0x18EF,0x3830,0x0511,0x34F6,0x0DC0,0x2D8E,0x1AFD,
- 0x0616,0x134D,0x2896,0x3529,0x0FDB,0x3F69,0x0B2C,0x382D,
- 0x1E19,0x276D,0x0162,0x240B,0x0BA7,0x3C9A,0x02BA,0x2D11,
- 0x35BC,0x1106,0x3B98,0x1215,0x34B8,0x16D0,0x2806,0x0CB6,
- 0x2B60,0x1386,0x3DDE,0x2119,0x04DC,0x374B,0x1F33,0x0017,
- 0x302A,0x1B97,0x05D6,0x13D4,0x328C,0x1EF0,0x3948,0x0D56,
- 0x26B3,0x3DD6,0x18AF,0x080A,0x3133,0x1F5F,0x0ED5,0x33CE,
- 0x0B5A,0x3A2A,0x01E5,0x1EED,0x3433,0x050F,0x3869,0x1C8A,
- 0x08BB,0x3A6A,0x04BB,0x2F9A,0x0809,0x1BE3,0x2CC3,0x15E6,
- 0x2497,0x2F69,0x0A18,0x297E,0x067A,0x2629,0x3F0B,0x0E7D,
- 0x2BB1,0x2256,0x16FD,0x2D4B,0x104A,0x2428,0x31F3,0x1492,
- 0x0934,0x2C43,0x069B,0x3228,0x0B0F,0x3DBD,0x1833,0x36F3,
- 0x11CF,0x34B1,0x0CFF,0x3868,0x08C1,0x3CC8,0x2395,0x372F,
- 0x0FD6,0x3D58,0x20E7,0x143C,0x2BB0,0x15D5,0x2DE1,0x184A,
- 0x085A,0x37B6,0x1A69,0x3F09,0x0DF7,0x35D1,0x1192,0x38A9,
- 0x293B,0x0A4E,0x205A,0x3965,0x0D07,0x3BE2,0x1A52,0x0BCB,
- 0x3685,0x2619,0x0D3D,0x2CE7,0x19BB,0x254B,0x0018,0x3CD2,
- 0x239C,0x373E,0x17F1,0x0879,0x244F,0x1CEB,0x310D,0x196D,
- 0x0765,0x3BDF,0x18AA,0x360A,0x1F16,0x109A,0x32B4,0x181F,
- 0x0473,0x2379,0x1CB5,0x25E7,0x0651,0x2EA5,0x0FB1,0x31DC,
- 0x1D8C,0x01E2,0x243A,0x0D18,0x2DB8,0x144C,0x2F0E,0x24BA,
- 0x1113,0x2787,0x383B,0x2188,0x09FF,0x294B,0x00E4,0x3484,
- 0x1DA1,0x0A5B,0x2265,0x3B43,0x12E4,0x37A7,0x2393,0x05B2,
- 0x2AB3,0x17B3,0x306B,0x1201,0x2274,0x2E09,0x0E4A,0x2A8F,
- 0x181D,0x26FF,0x1FDC,0x123E,0x226C,0x36F0,0x1064,0x3FD4,
- 0x0539,0x1836,0x3333,0x1EF2,0x3873,0x0F97,0x203B,0x3476,
- 0x0479,0x3622,0x0839,0x1C59,0x33CC,0x0C48,0x194D,0x3854,
- 0x2190,0x17CC,0x3945,0x1BDF,0x2623,0x1501,0x2CFA,0x04DA,
- 0x2892,0x16F1,0x2985,0x12FC,0x2C40,0x2105,0x157C,0x01AD,
- 0x3156,0x1DCB,0x0BC8,0x344B,0x0363,0x283A,0x0B36,0x32B8,
- 0x23A5,0x0F67,0x2955,0x097A,0x2C98,0x1729,0x27E5,0x0481,
- 0x1828,0x31CF,0x0153,0x1B6D,0x2873,0x120D,0x2BB3,0x1DD9,
- 0x2350,0x12A8,0x3D68,0x1D3D,0x08E2,0x3122,0x2129,0x150E,
- 0x1F79,0x0BC5,0x31FA,0x1DC3,0x3AD6,0x058C,0x155D,0x2B74,
- 0x2234,0x14BF,0x2CCB,0x05A5,0x2E8B,0x217E,0x08D6,0x26A0,
- 0x1512,0x38EC,0x0825,0x3371,0x1B56,0x2191,0x3C16,0x0856,
- 0x3521,0x158F,0x2FD2,0x1E0F,0x103A,0x3ACF,0x0A92,0x19F5,
- 0x3C95,0x0B78,0x1621,0x2B11,0x3E64,0x112F,0x2FDF,0x141B,
- 0x2A9E,0x1554,0x2E4F,0x0376,0x2A3E,0x0923,0x1AEF,0x3E0B,
- 0x13FB,0x2840,0x0C2F,0x3BFC,0x07E8,0x1DCD,0x3E7B,0x0305,
- 0x361B,0x0C9D,0x3DEF,0x1A39,0x323D,0x03D7,0x29D0,0x0D2D,
- 0x2781,0x39A9,0x135B,0x0223,0x1BAB,0x2F23,0x07C6,0x1B22,
- 0x2A63,0x12FA,0x3C1D,0x272E,0x0402,0x3FB0,0x2638,0x0169,
- 0x2E33,0x0BF2,0x2437,0x029B,0x3064,0x08E5,0x22BA,0x38FE,
- 0x109F,0x3E5E,0x02F0,0x3615,0x1A2F,0x057C,0x3938,0x1BD1,
- 0x2784,0x06EE,0x2FB9,0x1090,0x3826,0x12A1,0x3F91,0x1C16,
- 0x01AA,0x3AF6,0x151B,0x36C6,0x1C07,0x06EA,0x3D02,0x1CD8,
- 0x373C,0x1000,0x226F,0x3449,0x07DE,0x37A6,0x028F,0x3F4D,
- 0x0897,0x3323,0x0407,0x2812,0x3ACA,0x12F8,0x3488,0x06C2,
- 0x3939,0x27A7,0x01F8,0x2BC4,0x0D1E,0x262B,0x3713,0x0260,
- 0x3A6E,0x09B7,0x1D4F,0x3DA5,0x12B2,0x370C,0x1BCB,0x3F4A,
- 0x315C,0x18FF,0x2E71,0x0DE9,0x3A2D,0x0061,0x1804,0x2A71,
- 0x1FDA,0x3FD2,0x06D9,0x38B2,0x22C8,0x02CC,0x2154,0x3195,
- 0x0490,0x33FF,0x2055,0x0285,0x1CF8,0x24DE,0x094C,0x3CC7,
- 0x056F,0x383D,0x1C87,0x3346,0x0F83,0x2495,0x31E3,0x0D83,
- 0x2F1B,0x03E4,0x32E0,0x1561,0x29FD,0x1394,0x21D9,0x31F9,
- 0x110E,0x2C4F,0x01A4,0x28DE,0x0B4F,0x3BBE,0x1437,0x3569,
- 0x1D78,0x08DC,0x2231,0x3E71,0x2844,0x1262,0x3C83,0x24F4,
- 0x0A60,0x2FDC,0x2080,0x0E8D,0x2EE1,0x201F,0x11EA,0x3AD2,
- 0x1579,0x34C9,0x1222,0x3C6D,0x1747,0x3431,0x0E26,0x1DEB,
- 0x257B,0x0A89,0x2DC1,0x0F00,0x2644,0x31EE,0x110B,0x2B51,
- 0x0E2F,0x3A81,0x231B,0x18EA,0x2194,0x2C68,0x05BD,0x2609,
- 0x2FA2,0x10FD,0x2B7F,0x02E5,0x3117,0x22F8,0x10C2,0x2D45,
- 0x0B62,0x1E8E,0x3C76,0x141F,0x2EF6,0x166B,0x3160,0x17DD,
- 0x2B01,0x0F10,0x2F47,0x160B,0x2045,0x02C0,0x1C8B,0x2AD2,
- 0x100E,0x19A1,0x3E9E,0x162B,0x3290,0x12EE,0x2060,0x2FCE,
- 0x0F6C,0x331E,0x259D,0x0D4D,0x28F9,0x0095,0x2BEE,0x0A25,
- 0x2501,0x024E,0x276F,0x20A6,0x161C,0x235C,0x36AB,0x12CA,
- 0x0424,0x1A3A,0x28BA,0x0BD9,0x3351,0x1B4E,0x3F1B,0x11CC,
- 0x2B89,0x0DE4,0x265D,0x3A5B,0x121B,0x3542,0x1F56,0x0F2B,
- 0x2D21,0x21A2,0x0C47,0x16C2,0x3EFF,0x1DE0,0x003A,0x3935,
- 0x20D4,0x19D8,0x2320,0x38B0,0x00F9,0x3729,0x0B34,0x1EB8,
- 0x254D,0x1900,0x3814,0x0F37,0x2E92,0x1C6C,0x2454,0x0097,
- 0x3098,0x197F,0x2C95,0x1578,0x096A,0x33BD,0x02C6,0x16BA,
- 0x39E9,0x19C8,0x00E9,0x3557,0x1857,0x0732,0x30F2,0x0AE1,
- 0x28DB,0x04A1,0x2A5D,0x1F4E,0x071A,0x2053,0x3B67,0x0112,
- 0x35BD,0x195C,0x2272,0x3BAA,0x0B3A,0x1F20,0x3F21,0x0828,
- 0x332E,0x1EC4,0x0264,0x3E21,0x08CD,0x1AA0,0x38D7,0x1641,
- 0x0A4A,0x3387,0x1C9E,0x24D2,0x0E43,0x392C,0x1F7C,0x021D,
- 0x3250,0x2582,0x051A,0x29F9,0x0A8A,0x24E7,0x0635,0x27CB,
- 0x1350,0x3A7C,0x21B9,0x09BE,0x36A4,0x2485,0x3FD4,0x0993,
- 0x3598,0x23CA,0x0DE6,0x294F,0x04B9,0x3D46,0x0A08,0x1A18,
- 0x29DB,0x1B78,0x03D4,0x353A,0x168A,0x39D4,0x11F2,0x1EC9,
- 0x0F5F,0x37E0,0x0BE5,0x3E75,0x0561,0x2C4A,0x0AE2,0x2E25,
- 0x1E55,0x3136,0x116F,0x2C8D,0x13DE,0x299E,0x0658,0x2855,
- 0x15C3,0x37E3,0x1A7C,0x0884,0x2E9B,0x03EA,0x27EC,0x3739,
- 0x1901,0x01BF,0x3A78,0x2751,0x066F,0x2CD9,0x187A,0x267D,
- 0x08AD,0x3115,0x0D2B,0x1D6E,0x2B94,0x1022,0x3019,0x0571,
- 0x3C2F,0x08A6,0x2160,0x317A,0x16D2,0x0777,0x3964,0x1F5D,
- 0x10C3,0x3B69,0x04D8,0x367B,0x233E,0x1A75,0x215C,0x2C63,
- 0x0FCA,0x31C7,0x258A,0x113D,0x3B93,0x2262,0x1AD2,0x35D5,
- 0x1D86,0x3DFB,0x0F87,0x379B,0x1B37,0x2EF2,0x149E,0x29DA,
- 0x0F46,0x311C,0x0607,0x1CC4,0x3005,0x00BB,0x23F2,0x19B1,
- 0x2586,0x11B0,0x2D8B,0x0EC6,0x28B9,0x33C7,0x0D1C,0x2044,
- 0x3C5B,0x18AE,0x065F,0x3DD3,0x1DA2,0x0819,0x28D1,0x3FD4,
- 0x18E4,0x0DED,0x339D,0x1296,0x3EAB,0x1977,0x39EA,0x0CF0,
- 0x3463,0x016D,0x1C00,0x30E4,0x153E,0x0C5A,0x1719,0x2DE2,
- 0x1BA2,0x0384,0x33C5,0x1384,0x2C5D,0x1143,0x2585,0x38A6,
- 0x06A4,0x3EEC,0x23E7,0x10AA,0x2EFE,0x07DA,0x2275,0x3C46,
- 0x2F5C,0x1E0A,0x309E,0x1038,0x32E9,0x1A9C,0x3D56,0x1530,
- 0x3874,0x095E,0x3B7A,0x00E0,0x3667,0x0E45,0x3903,0x0C5B,
- 0x30F8,0x0158,0x2C6C,0x2219,0x179E,0x3FD4,0x14BD,0x0788,
- 0x22BC,0x3206,0x10B5,0x1BC4,0x35BE,0x1343,0x3CF2,0x1040,
- 0x3610,0x163F,0x3F54,0x0751,0x2361,0x3D0A,0x1616,0x289C,
- 0x150A,0x2D20,0x1AE4,0x0447,0x3EE2,0x292E,0x0E2C,0x31E4,
- 0x251B,0x0B7F,0x291E,0x114B,0x305E,0x0C6D,0x3A96,0x061B,
- 0x36CF,0x0929,0x1BB7,0x2B34,0x0B9F,0x2CCA,0x0288,0x24A2,
- 0x098C,0x18F6,0x2DA8,0x0C7A,0x2910,0x03ED,0x3257,0x09CC,
- 0x3FD4,0x20F8,0x1780,0x2AAF,0x1470,0x3468,0x0D16,0x36C2,
- 0x043C,0x3B56,0x1623,0x365C,0x1BFF,0x0056,0x2F32,0x243F,
- 0x0399,0x286B,0x3574,0x0F23,0x2761,0x327C,0x148A,0x0997,
- 0x21BF,0x3B3B,0x15B0,0x2743,0x0068,0x2A75,0x102F,0x2E6D,
- 0x1628,0x245C,0x3E57,0x0680,0x2859,0x38DB,0x22B1,0x05E6,
- 0x3C6A,0x274D,0x0AF9,0x3B47,0x1D90,0x3617,0x0062,0x17A6,
- 0x2DCB,0x163A,0x095D,0x3AEE,0x207C,0x19F0,0x3464,0x04BD,
- 0x1ABE,0x0782,0x16F2,0x29EE,0x1F0C,0x0946,0x2334,0x0286,
- 0x206B,0x2726,0x18B2,0x2467,0x1C48,0x2FFA,0x197E,0x25C2,
- 0x1DAF,0x3DB7,0x10BC,0x3697,0x0BF7,0x1D4D,0x3309,0x1C13,
- 0x3C4C,0x09C9,0x2522,0x30BB,0x0BB0,0x2ABF,0x04CD,0x2E6F,
- 0x2000,0x028D,0x1F3A,0x2DEC,0x1774,0x03B3,0x33DC,0x0D5F,
- 0x367D,0x10CE,0x3A30,0x22F5,0x119D,0x2069,0x36A8,0x0628,
- 0x1C36,0x2F39,0x1650,0x3D5B,0x014E,0x1E75,0x279F,0x1631,
- 0x23D5,0x1DBA,0x3D35,0x0488,0x3446,0x1646,0x3EC7,0x1405,
- 0x3847,0x26BF,0x0088,0x32A7,0x15F5,0x3D37,0x12A4,0x1E13,
- 0x2510,0x027A,0x386C,0x095A,0x3CAC,0x1041,0x2BDA,0x133C,
- 0x2E83,0x0B9A,0x2708,0x0644,0x2170,0x3BAB,0x1748,0x1021,
- 0x30C1,0x12B3,0x1FF3,0x2E9D,0x00D0,0x2103,0x374F,0x1BD2,
- 0x2EC4,0x03F4,0x2B87,0x0C18,0x35F9,0x1BA1,0x380F,0x0460,
- 0x2961,0x0AC9,0x185E,0x2C5F,0x1A30,0x00EC,0x3196,0x1EE5,
- 0x0E7E,0x16AD,0x2F40,0x1A68,0x0767,0x2306,0x308F,0x1FF5,
- 0x0E4C,0x35D2,0x1CC6,0x26B8,0x01A0,0x2CB1,0x0CDF,0x2926,
- 0x3661,0x202D,0x3CB6,0x0110,0x38CA,0x13ED,0x35C0,0x2B92,
- 0x0E49,0x3268,0x0756,0x3D16,0x0A57,0x2376,0x034F,0x3AE3,
- 0x08D2,0x1899,0x292F,0x04F7,0x30A8,0x260D,0x0090,0x29B5,
- 0x130A,0x2BFA,0x17FE,0x02FB,0x38EA,0x1A28,0x25D3,0x0E0F,
- 0x3AEF,0x1AE3,0x3496,0x09E1,0x3998,0x2233,0x1BB6,0x2E2E,
- 0x0020,0x2736,0x0B01,0x3417,0x1D61,0x01DC,0x2635,0x17DB,
- 0x3E37,0x0358,0x3491,0x0CDE,0x2284,0x377B,0x0DF0,0x3F61,
- 0x0367,0x2E02,0x0D9B,0x27D8,0x1285,0x299C,0x0DC4,0x2ED1,
- 0x06D6,0x1CFF,0x3A46,0x10AB,0x25DA,0x083C,0x2213,0x39E2,
- 0x118E,0x32E6,0x1373,0x2F38,0x1C7E,0x262C,0x072E,0x3DB9,
- 0x2235,0x1B2F,0x316F,0x1403,0x2CA5,0x0C43,0x25B2,0x37EE,
- 0x0A03,0x3EBD,0x0749,0x1A04,0x3A67,0x16BE,0x0576,0x29A2,
- 0x0D65,0x38CD,0x1C5D,0x3039,0x1EF6,0x075D,0x2351,0x14E3,
- 0x3CD8,0x1DA5,0x352D,0x0FED,0x3BDA,0x2159,0x0B99,0x3762,
- 0x2392,0x3316,0x0199,0x283B,0x3953,0x1499,0x0C28,0x3E3E,
- 0x2890,0x0357,0x2B88,0x0FF5,0x3360,0x1338,0x3FD4,0x14A3,
- 0x030A,0x27AD,0x0DC8,0x2DCA,0x1847,0x287A,0x0675,0x1D84,
- 0x37C7,0x163C,0x292B,0x1153,0x3179,0x1754,0x2C0C,0x149C,
- 0x2413,0x3499,0x0D92,0x3BB3,0x20C2,0x1020,0x3B26,0x0CFC,
- 0x3678,0x059B,0x3EB2,0x1D6F,0x23A6,0x0FAE,0x3270,0x1E3D,
- 0x06E5,0x2C78,0x112D,0x28D7,0x0EAC,0x2B41,0x0850,0x2131,
- 0x3F95,0x167D,0x2C08,0x0692,0x2863,0x3CC5,0x0DBB,0x2D47,
- 0x100F,0x2ACC,0x2153,0x1527,0x2D95,0x07B1,0x2B12,0x1892,
- 0x329A,0x14F8,0x3603,0x1768,0x3AF7,0x0634,0x373A,0x21F9,
- 0x16DF,0x2C7C,0x0A97,0x1F97,0x3645,0x19F3,0x2D7E,0x0567,
- 0x2A3A,0x0CBC,0x286D,0x1936,0x038A,0x39B0,0x1FBC,0x15B3,
- 0x0172,0x37A4,0x08A5,0x3FB3,0x19F9,0x3258,0x0540,0x1E12,
- 0x28CF,0x17AB,0x22C0,0x3487,0x0AD4,0x260A,0x3D7A,0x1200,
- 0x34CA,0x229F,0x084D,0x145B,0x3E03,0x1765,0x32A5,0x1FA7,
- 0x08E3,0x2D9B,0x033D,0x26EF,0x0D22,0x2E43,0x1E05,0x1485,
- 0x07D3,0x1FBD,0x3F45,0x0D04,0x1810,0x3440,0x20E9,0x060A,
- 0x1E49,0x37A2,0x0BB8,0x3CE5,0x18BC,0x248B,0x0862,0x2D68,
- 0x3B3C,0x15F4,0x3395,0x1C51,0x0B8E,0x3F70,0x220E,0x0CB1,
- 0x23AA,0x01BB,0x395F,0x1F78,0x04BC,0x3EE9,0x0BD7,0x35D4,
- 0x062C,0x1B72,0x2D89,0x167A,0x0983,0x2F88,0x1865,0x247F,
- 0x1DFD,0x2DF8,0x0DCA,0x29F2,0x0803,0x3B7F,0x0133,0x3754,
- 0x220C,0x182B,0x3E2E,0x01BA,0x35FB,0x130F,0x3B4A,0x18BF,
- 0x0C4E,0x3311,0x1267,0x38C3,0x0FC2,0x1F46,0x32D9,0x0873,
- 0x3906,0x1E21,0x06C4,0x3B31,0x19E4,0x333A,0x116B,0x28A9,
- 0x0B19,0x2689,0x004C,0x2D28,0x0C09,0x2533,0x1EB0,0x01C7,
- 0x33FD,0x0FC5,0x3F29,0x2425,0x02C9,0x3130,0x0DFF,0x36EC,
- 0x1AAF,0x3E38,0x07BC,0x37E6,0x22A4,0x0BE4,0x33DD,0x2A40,
- 0x1D40,0x24E4,0x1837,0x281B,0x02B4,0x206A,0x3CC1,0x14CF,
- 0x32EE,0x020C,0x2CF9,0x1353,0x2AC6,0x1126,0x1EBE,0x3069,
- 0x017C,0x17E1,0x3AA2,0x26B9,0x02F6,0x2C51,0x0C7F,0x3B02,
- 0x25C0,0x125F,0x3923,0x1671,0x3602,0x0508,0x3E1F,0x24B2,
- 0x39C3,0x10B6,0x25AC,0x1CF0,0x2D76,0x02E2,0x2785,0x32B1,
- 0x0DC9,0x21FF,0x30B7,0x1C3E,0x044B,0x3828,0x1FA8,0x10D7,
- 0x0ADC,0x2946,0x0526,0x3A9E,0x20D9,0x03AA,0x3420,0x17C1,
- 0x3D9E,0x1E99,0x0DB0,0x348D,0x2589,0x156B,0x2E6A,0x11CD,
- 0x282D,0x3E5B,0x0226,0x2299,0x3894,0x1C50,0x03C3,0x31F7,
- 0x0A52,0x174C,0x3406,0x1170,0x3022,0x14B1,0x2A48,0x12CC,
- 0x2EDB,0x0BD2,0x24F0,0x2098,0x19F4,0x2FCD,0x049E,0x3132,
- 0x2347,0x02F1,0x27A1,0x1CD4,0x2FBD,0x03F2,0x23E1,0x1A64,
- 0x26F6,0x1244,0x3025,0x23B0,0x0278,0x20DD,0x3C26,0x0570,
- 0x38B7,0x107B,0x3DCD,0x212A,0x1A0F,0x3302,0x1102,0x3CA7,
- 0x1990,0x2774,0x051C,0x1820,0x3912,0x143F,0x2803,0x2007,
- 0x002C,0x1EB4,0x2C24,0x0F92,0x3062,0x1E29,0x1496,0x05E7,
- 0x3B28,0x0C60,0x34D2,0x1160,0x3917,0x0D85,0x2AD7,0x07FC,
- 0x1F8A,0x370F,0x0CDB,0x3B75,0x036B,0x33F4,0x0913,0x2490,
- 0x1CF9,0x2D1D,0x0F8A,0x2088,0x3798,0x1050,0x292A,0x01D2,
- 0x1A93,0x3116,0x0813,0x2A2C,0x107F,0x2930,0x17C8,0x025F,
- 0x1ABD,0x3224,0x04A3,0x37E1,0x0A85,0x3D5F,0x0F25,0x1C81,
- 0x3B9C,0x1590,0x0701,0x2816,0x2E60,0x11AF,0x31FC,0x23FD,
- 0x3079,0x12F2,0x2C0B,0x0FCC,0x25FE,0x2F97,0x0EB7,0x2ABB,
- 0x06F1,0x26DF,0x2F22,0x16E2,0x09D8,0x2A00,0x003B,0x39C0,
- 0x1F53,0x0EE6,0x1E2E,0x3423,0x075B,0x266E,0x3F2F,0x12C3,
- 0x3A52,0x21DD,0x01F1,0x3DD2,0x1B94,0x2415,0x09B9,0x3C99,
- 0x0412,0x350C,0x142D,0x3A58,0x0AC3,0x2604,0x2019,0x0FAB,
- 0x37FA,0x1A46,0x3D94,0x0943,0x1812,0x3BC8,0x146A,0x3738,
- 0x0075,0x3FA4,0x0AFB,0x17B1,0x383A,0x0EF2,0x1C0D,0x2C1E,
- 0x1637,0x3178,0x1BE9,0x0881,0x3975,0x03C4,0x2FA3,0x2321,
- 0x0958,0x30A1,0x1CA4,0x2D1A,0x0D3C,0x2B15,0x08A9,0x3BE8,
- 0x1792,0x3391,0x13EC,0x2682,0x0208,0x3EE3,0x2368,0x310E,
- 0x0FAA,0x298A,0x04BF,0x2E36,0x21F6,0x16D9,0x233D,0x3A10,
- 0x0F35,0x26DA,0x1A86,0x2034,0x2F64,0x186E,0x388D,0x0DC7,
- 0x3F73,0x05D3,0x337F,0x09CA,0x1B06,0x30AF,0x1348,0x34DA,
- 0x23E2,0x0E72,0x3F9D,0x1CEA,0x335D,0x0947,0x3002,0x1F68,
- 0x2CD1,0x0EDC,0x2974,0x114C,0x2B9F,0x22E3,0x16B0,0x2FA9,
- 0x011A,0x2634,0x3971,0x1730,0x099C,0x3DF2,0x0010,0x1CF3,
- 0x0720,0x3EB6,0x1EC3,0x3767,0x0892,0x1BA0,0x39CE,0x13AA,
- 0x3306,0x199F,0x031F,0x3A57,0x2079,0x36E0,0x1AEB,0x238C,
- 0x07D6,0x32DF,0x2747,0x1444,0x2CFE,0x108E,0x2057,0x2ABA,
- 0x06B6,0x2CA1,0x19AD,0x2721,0x053D,0x31CE,0x1EF1,0x157B,
- 0x2B90,0x107D,0x2944,0x0606,0x31B9,0x14F2,0x3D21,0x1DF5,
- 0x07E9,0x2CF8,0x0F05,0x2577,0x3528,0x0C1B,0x2979,0x0EA4,
- 0x2C12,0x13F0,0x3234,0x21A9,0x08AB,0x2307,0x307B,0x0BDF,
- 0x255F,0x0441,0x2ACE,0x223F,0x0F39,0x280F,0x1DAB,0x0E78,
- 0x3AA4,0x14D3,0x359B,0x077A,0x3DEB,0x1E73,0x34EE,0x0DBA,
- 0x2FC1,0x06AC,0x3ACD,0x0B40,0x34BB,0x17D1,0x0924,0x1B8D,
- 0x3642,0x1569,0x3E5F,0x1C3D,0x08EE,0x30F0,0x010E,0x1BCE,
- 0x321D,0x04DF,0x3EFA,0x0A15,0x2514,0x068C,0x2178,0x2DD6,
- 0x1565,0x27F8,0x16D8,0x3C12,0x2209,0x067D,0x3E83,0x1F2E,
- 0x0537,0x2D31,0x1963,0x0030,0x20DF,0x3B78,0x13FE,0x3643,
- 0x0B50,0x3BF5,0x15E9,0x35C6,0x1B81,0x06BF,0x3AC6,0x0B2B,
- 0x2ABD,0x1A47,0x0D00,0x34BA,0x1DA6,0x24C7,0x193E,0x369E,
- 0x2995,0x1AEA,0x0207,0x166A,0x327F,0x2380,0x0080,0x28F2,
- 0x0A6C,0x3C2A,0x1D4E,0x24C4,0x1328,0x05C0,0x3212,0x0D72,
- 0x3BF3,0x19E0,0x0433,0x3CF5,0x0AE6,0x3614,0x00E1,0x1AB6,
- 0x36D0,0x0CC4,0x396A,0x152E,0x359C,0x0E44,0x384D,0x256F,
- 0x08CF,0x3FD4,0x1E87,0x36AD,0x0DDB,0x2AD0,0x00DB,0x2E9C,
- 0x2253,0x1618,0x3361,0x0163,0x20B1,0x2E58,0x0625,0x3441,
- 0x1CB3,0x25D2,0x0471,0x3C71,0x1B35,0x35A4,0x0100,0x3E80,
- 0x1490,0x37F0,0x124F,0x362B,0x178C,0x3FD4,0x060B,0x2C0D,
- 0x20B3,0x00C9,0x1F7D,0x299F,0x167B,0x022C,0x1B7D,0x26FB,
- 0x126E,0x29F3,0x2090,0x2EA8,0x1130,0x2A61,0x1F5B,0x2DAD,
- 0x007B,0x2798,0x0E21,0x2477,0x3772,0x107E,0x3DDB,0x25D4,
- 0x130D,0x29ED,0x1626,0x314C,0x1438,0x3D49,0x1B4F,0x026D,
- 0x35A7,0x0B0D,0x2A92,0x0099,0x2F67,0x193A,0x2550,0x0B5D,
- 0x3978,0x113C,0x3692,0x233F,0x156D,0x2418,0x05A7,0x1E5F,
- 0x28AB,0x0716,0x2538,0x0085,0x2ED6,0x2189,0x1960,0x3198,
- 0x104B,0x3F28,0x22E6,0x02A5,0x3125,0x0DF8,0x2C83,0x11FC,
- 0x0A3A,0x33F2,0x1FAD,0x2CF0,0x0E16,0x18D9,0x3E94,0x15F9,
- 0x2B6B,0x1055,0x30BA,0x0826,0x3F9C,0x27A3,0x1664,0x2AA1,
- 0x1253,0x2466,0x304A,0x117B,0x290B,0x159E,0x24EC,0x315A,
- 0x11E1,0x288F,0x1F2B,0x0851,0x2043,0x2E19,0x0055,0x1A6C,
- 0x2F27,0x1787,0x027F,0x1B5C,0x281E,0x12A7,0x33B7,0x0CCF,
- 0x39F9,0x0547,0x1C74,0x3F0F,0x102E,0x1AE1,0x3AC2,0x186A,
- 0x0905,0x2F3E,0x1EDC,0x0F58,0x2E0E,0x12E0,0x2987,0x18D1,
- 0x283C,0x0D3E,0x2DBA,0x0209,0x3097,0x0C4F,0x3382,0x114A,
- 0x3734,0x1A6F,0x3CE7,0x0A79,0x32CE,0x2030,0x2EEF,0x04E8,
- 0x3F97,0x1B01,0x0324,0x18F4,0x3D15,0x0478,0x38A4,0x1334,
- 0x3B83,0x1706,0x2F71,0x03B9,0x1A7F,0x2C90,0x17DE,0x0AEE,
- 0x3845,0x0DFE,0x3662,0x0010,0x2C2D,0x0E95,0x3201,0x267B,
- 0x11A8,0x3AEC,0x13CB,0x32C5,0x0F6B,0x2C18,0x0E42,0x31A3,
- 0x1D50,0x2A82,0x06ED,0x31DA,0x0A48,0x3818,0x1B9A,0x3D7E,
- 0x120C,0x34A9,0x184F,0x3FC3,0x0D9E,0x38BC,0x03E7,0x202E,
- 0x357C,0x0639,0x2EAA,0x1F59,0x13DD,0x391B,0x054D,0x3BE4,
- 0x2843,0x1339,0x3B52,0x06B1,0x37F9,0x2783,0x0BFF,0x33B6,
- 0x0513,0x3722,0x1506,0x2D23,0x1CB7,0x0AEA,0x3904,0x02C7,
- 0x2EEB,0x0B93,0x1FDB,0x3752,0x06C8,0x3A0F,0x1C19,0x08F6,
- 0x3D60,0x02DA,0x3493,0x1932,0x3EDB,0x0FD3,0x2259,0x3B54,
- 0x0EFF,0x3497,0x1F92,0x3919,0x0763,0x3E74,0x1CEE,0x2714,
- 0x1741,0x2311,0x2B5C,0x09B0,0x3047,0x2458,0x02CD,0x2768,
- 0x3E25,0x0E10,0x3794,0x24AC,0x06FA,0x3A1C,0x0A7A,0x341D,
- 0x0516,0x3A71,0x1B54,0x1FE5,0x242E,0x195E,0x2632,0x1E92,
- 0x0834,0x2D8A,0x0F88,0x274B,0x13BC,0x39B9,0x1046,0x35EF,
- 0x0AFA,0x31C2,0x1F1F,0x2CDE,0x0E59,0x2702,0x103C,0x2B65,
- 0x06DA,0x3376,0x0CE9,0x3C86,0x21BB,0x0622,0x354E,0x20C7,
- 0x032C,0x2DC8,0x1D80,0x23C4,0x19A4,0x399E,0x073B,0x200F,
- 0x2B77,0x04CA,0x2432,0x1DB8,0x36F5,0x0443,0x3CFD,0x1831,
- 0x027D,0x2187,0x3C8D,0x1752,0x2B09,0x0F81,0x2E1A,0x01FA,
- 0x29BC,0x0D1F,0x2B3D,0x12F6,0x286F,0x161E,0x2C3A,0x11DB,
- 0x258C,0x1D69,0x0EB4,0x3C6F,0x27E4,0x0B56,0x25BE,0x17E9,
- 0x036E,0x2EEE,0x0C9F,0x2562,0x1E79,0x0418,0x300D,0x1B44,
- 0x23E4,0x0D13,0x2663,0x0142,0x344C,0x13F3,0x223B,0x3345,
- 0x153C,0x3E11,0x01AB,0x1B79,0x2B50,0x0EF8,0x2E37,0x21C8,
- 0x182C,0x2D41,0x0D94,0x2AF9,0x0497,0x1D64,0x2C2C,0x0A0A,
- 0x28D9,0x05C7,0x29FF,0x0C82,0x2D29,0x197B,0x038E,0x361D,
- 0x0A58,0x3B9F,0x1456,0x36FB,0x1F00,0x11E7,0x3930,0x137D,
- 0x1F8B,0x3141,0x01C1,0x1A0B,0x2BBC,0x1683,0x266B,0x1357,
- 0x2C89,0x21BD,0x0865,0x3D4B,0x0A43,0x36B9,0x02FC,0x3E28,
- 0x2264,0x172A,0x3839,0x037D,0x2BC7,0x0704,0x24C2,0x16EA,
- 0x2A9C,0x1462,0x3A3E,0x0792,0x36B8,0x1B51,0x32A3,0x0B38,
- 0x24F7,0x19B6,0x29D1,0x13B3,0x3185,0x1E07,0x0FC7,0x2945,
- 0x3AAA,0x1550,0x0845,0x3CB1,0x0C6E,0x2591,0x1E2C,0x0BBB,
- 0x3472,0x1A01,0x3EA4,0x079D,0x1B53,0x2A05,0x1383,0x271E,
- 0x3A4F,0x14E6,0x097B,0x2F99,0x0388,0x2778,0x13B6,0x3263,
- 0x1AA1,0x3A33,0x046F,0x33D2,0x084C,0x36E6,0x0A45,0x3E07,
- 0x01B3,0x338F,0x2260,0x07AE,0x1C83,0x36C5,0x14C1,0x32BD,
- 0x3D23,0x22BF,0x1906,0x35CA,0x1179,0x3BBD,0x2166,0x0FE5,
- 0x3DCE,0x1C38,0x3879,0x172F,0x20E2,0x3CE8,0x0893,0x1D1E,
- 0x28A4,0x0F91,0x31B7,0x23E6,0x1474,0x3FBA,0x0391,0x33B1,
- 0x0A9B,0x1CE8,0x39D0,0x122B,0x2693,0x3AA3,0x12DE,0x3693,
- 0x158A,0x3D91,0x115F,0x32C1,0x13DF,0x2486,0x314E,0x11AA,
- 0x2CD8,0x1BEE,0x025E,0x25ED,0x071F,0x3277,0x0B08,0x2DB0,
- 0x05BC,0x23EC,0x1CE7,0x3D8B,0x10FC,0x34FB,0x0329,0x3F25,
- 0x1E63,0x11A9,0x2F0A,0x15B7,0x29C2,0x13A1,0x2E96,0x0D08,
- 0x31CD,0x0589,0x1D59,0x323B,0x17F7,0x3C49,0x0C05,0x332D,
- 0x00FD,0x25CC,0x0CA5,0x29A9,0x1E45,0x0190,0x1FCE,0x3F66,
- 0x14D6,0x35E8,0x023F,0x39D2,0x09E8,0x2676,0x3F3F,0x0C0D,
- 0x1AFE,0x2730,0x34ED,0x1044,0x2FB1,0x03F8,0x2A3B,0x380D,
- 0x12F5,0x282E,0x0CEE,0x21D1,0x39C9,0x10BD,0x3419,0x0A65,
- 0x1C31,0x3126,0x2478,0x1060,0x3F07,0x0C72,0x38D8,0x230D,
- 0x0AE8,0x1FCF,0x26E9,0x19AE,0x23CE,0x1C08,0x2E80,0x14EF,
- 0x2936,0x1377,0x3AAF,0x1617,0x300A,0x00FF,0x2B39,0x0D42,
- 0x1B5E,0x089E,0x31C6,0x015A,0x2B95,0x19F8,0x0930,0x2CCD,
- 0x0254,0x29E4,0x09A8,0x2FDB,0x0584,0x2A06,0x18E5,0x367E,
- 0x04B1,0x3A31,0x2099,0x060E,0x34F7,0x0BE2,0x2790,0x16F7,
- 0x3BB1,0x253D,0x0179,0x3110,0x1EA4,0x07C5,0x2D9E,0x0301,
- 0x23C6,0x1ACF,0x26D5,0x0185,0x3C07,0x08B0,0x1EBF,0x38C7,
- 0x06A1,0x218D,0x3398,0x16B6,0x3EB3,0x156A,0x28F3,0x176D,
- 0x3606,0x1094,0x322C,0x0646,0x28D5,0x0C77,0x2D6A,0x22AC,
- 0x0939,0x38D2,0x0156,0x354A,0x0660,0x3BE9,0x168D,0x278E,
- 0x12B4,0x39FA,0x24EE,0x0EBF,0x28CA,0x1206,0x2DDB,0x1CCB,
- 0x3D67,0x10D2,0x3495,0x15F3,0x3C10,0x141E,0x2C75,0x0520,
- 0x290C,0x0C40,0x27F6,0x11C1,0x2E0B,0x1888,0x014A,0x2286,
- 0x3075,0x058A,0x193D,0x2B1C,0x137C,0x3FD4,0x15FC,0x2296,
- 0x011D,0x326A,0x186D,0x2E3C,0x0B4E,0x28C4,0x0160,0x24F2,
- 0x375B,0x0578,0x1AFA,0x3541,0x1672,0x2BCF,0x1BEF,0x04E3,
- 0x3E6E,0x1452,0x3683,0x0CC7,0x3D36,0x0309,0x21CD,0x39A0,
- 0x0C45,0x2DFC,0x0486,0x26D8,0x1979,0x3F63,0x122A,0x28E1,
- 0x3862,0x20F0,0x10C6,0x3FD4,0x0E03,0x250A,0x3A27,0x147C,
- 0x35E5,0x1274,0x3B2B,0x1A6A,0x25D7,0x0E3D,0x30D0,0x1368,
- 0x2BE6,0x1A9B,0x0CA0,0x2E15,0x194F,0x29F5,0x12B7,0x3091,
- 0x065D,0x1528,0x3601,0x221F,0x10FE,0x3381,0x14A0,0x1F4B,
- 0x341F,0x0877,0x3981,0x204D,0x17D6,0x2F1C,0x0F3B,0x2658,
- 0x18FD,0x3CDF,0x0FE0,0x2A83,0x0D30,0x2ECB,0x00C1,0x3BBF,
- 0x0CF6,0x2A8C,0x15CA,0x38A1,0x17F4,0x3B72,0x1B45,0x1005,
- 0x31B6,0x1746,0x2854,0x1A8D,0x2537,0x0BA4,0x2BB9,0x006B,
- 0x2E0C,0x1AE7,0x091D,0x3F0D,0x0196,0x353C,0x1A3D,0x05CA,
- 0x22CE,0x2F29,0x0444,0x27C8,0x0A35,0x30C9,0x18C1,0x37F5,
- 0x0F4A,0x3D70,0x1F89,0x34AF,0x0505,0x38B1,0x1F6B,0x3635,
- 0x116E,0x3C01,0x2484,0x01C6,0x32B6,0x1CAA,0x08CB,0x3B03,
- 0x2061,0x1523,0x3D38,0x0362,0x3604,0x1454,0x3F65,0x18B6,
- 0x0DA7,0x2151,0x2D08,0x00CA,0x26A2,0x07F4,0x33CA,0x21F0,
- 0x0E2B,0x3167,0x010C,0x2D17,0x116D,0x2A79,0x1891,0x0689,
- 0x32EB,0x0FA5,0x202C,0x3556,0x09AE,0x219E,0x3465,0x04EC,
- 0x0F21,0x2AAC,0x17BC,0x21F5,0x2F8A,0x0598,0x1C6E,0x30A4,
- 0x073A,0x1F3C,0x237A,0x0F8E,0x3253,0x1EF7,0x00AD,0x3F42,
- 0x0A23,0x265C,0x37D3,0x1316,0x3C7C,0x0010,0x3898,0x0D60,
- 0x204A,0x2BD8,0x1A1D,0x0568,0x3C7A,0x0B98,0x25E5,0x3F52,
- 0x0D7C,0x2BF2,0x155B,0x3205,0x0D0D,0x22C7,0x3F6E,0x0049,
- 0x2C33,0x0AAA,0x284A,0x0456,0x388E,0x2341,0x19B4,0x21ED,
- 0x2FE1,0x03B1,0x27E2,0x0AB0,0x259F,0x0010,0x302F,0x2035,
- 0x0556,0x3C7D,0x0DD8,0x33D0,0x120A,0x3851,0x1D06,0x3ADB,
- 0x0E3F,0x34CB,0x23B2,0x14C4,0x2B2B,0x0AB8,0x2643,0x391E,
- 0x13E2,0x1E8C,0x3EBB,0x122F,0x3870,0x21B0,0x0764,0x234C,
- 0x3042,0x1AA5,0x0801,0x1789,0x2BBA,0x2344,0x150D,0x069C,
- 0x2C41,0x0AC1,0x1E94,0x3905,0x0EB2,0x26C9,0x30B2,0x0DD9,
- 0x2C5B,0x06FF,0x25CE,0x1FDE,0x1A3E,0x2C85,0x0C38,0x3009,
- 0x1D2C,0x3D95,0x11B1,0x3842,0x1359,0x3B4F,0x0FA6,0x2F4B,
- 0x1A3C,0x2066,0x25C3,0x17CF,0x3AF0,0x09D4,0x34EC,0x1DD1,
- 0x24FE,0x1A0C,0x3CB9,0x1311,0x2FA5,0x10EE,0x1E1C,0x2D79,
- 0x3DA3,0x02D9,0x36FD,0x0787,0x1526,0x3897,0x2696,0x114D,
- 0x2885,0x3500,0x0360,0x3E48,0x07E4,0x378F,0x240F,0x1109,
- 0x2E90,0x1CE4,0x02DD,0x24E9,0x0F55,0x2D65,0x1654,0x24AB,
- 0x3E7C,0x0926,0x37FF,0x270E,0x16C0,0x2F90,0x00B1,0x18B7,
- 0x30BF,0x1C2F,0x03DD,0x2500,0x37D2,0x058F,0x1CA7,0x33E9,
- 0x12F4,0x35A9,0x14BA,0x30ED,0x1D70,0x083B,0x31E8,0x09A3,
- 0x1DC7,0x3FD4,0x1276,0x365E,0x13E9,0x2B2F,0x0EB3,0x34AC,
- 0x24D1,0x1432,0x2A4D,0x03E0,0x2D2B,0x1902,0x07B2,0x20C1,
- 0x2880,0x0430,0x1DBC,0x366A,0x1098,0x3B74,0x2068,0x0D81,
- 0x2C48,0x0838,0x2212,0x2DA5,0x02AA,0x1BBE,0x3673,0x1634,
- 0x00B6,0x2CBE,0x1E6D,0x3BB7,0x12DC,0x09AA,0x3E79,0x284C,
- 0x1669,0x33E0,0x1229,0x2229,0x2E59,0x0546,0x1B76,0x3594,
- 0x163D,0x3896,0x0F95,0x3342,0x0664,0x2332,0x3921,0x03C8,
- 0x2992,0x0734,0x27F7,0x0AA8,0x2DED,0x1D8A,0x2A3F,0x029D,
- 0x3C2C,0x0A22,0x3768,0x0742,0x1CC3,0x2FC5,0x12AC,0x3EE7,
- 0x005E,0x3109,0x081D,0x2A74,0x024D,0x3A4D,0x08F0,0x22A0,
- 0x0C30,0x315D,0x1ADB,0x236D,0x3247,0x186B,0x0040,0x3EC4,
- 0x0A0F,0x19BF,0x2DDC,0x1666,0x2AEC,0x13D1,0x1DF6,0x3564,
- 0x0766,0x3AC7,0x17D9,0x3385,0x212D,0x0A63,0x365A,0x03F7,
- 0x13FF,0x2DDA,0x1E2A,0x1054,0x2A20,0x0EC7,0x38E7,0x2453,
- 0x06E3,0x3ABE,0x212B,0x0B3F,0x1DC1,0x3052,0x0E98,0x2777,
- 0x1FD8,0x07BE,0x3AF1,0x2113,0x10F4,0x3DA4,0x1643,0x382A,
- 0x0FB3,0x227C,0x2C65,0x073D,0x30FD,0x1CA5,0x3DFD,0x0A14,
- 0x1E10,0x375D,0x0B29,0x3F8F,0x0FA0,0x267E,0x363C,0x10D1,
- 0x3E97,0x184B,0x2FF0,0x071B,0x28FD,0x198D,0x0319,0x3783,
- 0x11AD,0x33CF,0x1956,0x0CC0,0x34EA,0x2948,0x09B8,0x207A,
- 0x3A69,0x0D14,0x32CC,0x0364,0x2126,0x31C1,0x1FE0,0x0DA1,
- 0x2FE0,0x037A,0x3DBF,0x0872,0x1751,0x3C52,0x2396,0x02B1,
- 0x28D6,0x0AD1,0x2DEF,0x1720,0x3C45,0x1032,0x1E02,0x322F,
- 0x128C,0x2F01,0x15D0,0x3490,0x2295,0x0618,0x18F1,0x34FD,
- 0x15AD,0x2B0F,0x1257,0x30D9,0x249F,0x0404,0x288A,0x0D29,
- 0x2C11,0x16EF,0x378D,0x2087,0x1A7E,0x2369,0x33B5,0x176A,
- 0x1CBA,0x2753,0x101C,0x3ADD,0x0B47,0x215E,0x2C88,0x15E2,
- 0x2447,0x3999,0x0EA2,0x2725,0x0CD3,0x3B7D,0x043E,0x2852,
- 0x20DB,0x0D80,0x28F6,0x063A,0x3F02,0x19EB,0x27D0,0x1C63,
- 0x343F,0x22E8,0x0252,0x3DA8,0x0781,0x34CF,0x1EB6,0x134B,
- 0x2B47,0x108B,0x2861,0x3DDF,0x121A,0x225D,0x3A4B,0x032A,
- 0x2E95,0x1A42,0x2506,0x01B7,0x2BA9,0x1F24,0x04CE,0x2029,
- 0x2DEE,0x0230,0x1AA6,0x3A74,0x16FF,0x0480,0x2326,0x2EB2,
- 0x028C,0x28B4,0x1B70,0x2186,0x30EB,0x020B,0x1BB5,0x31FE,
- 0x0B0B,0x25A2,0x154C,0x3CBA,0x0E8E,0x3313,0x2338,0x1C5C,
- 0x3067,0x0023,0x3B41,0x2584,0x174A,0x0EEA,0x3D2C,0x26A6,
- 0x1124,0x2A1A,0x13C0,0x2610,0x3833,0x1598,0x0039,0x39E4,
- 0x2100,0x19B2,0x2771,0x1D5A,0x2F80,0x0D78,0x1916,0x3701,
- 0x1411,0x3E0C,0x1C7B,0x005C,0x2958,0x2089,0x08E0,0x22D0,
- 0x37D0,0x0D6F,0x3BB6,0x0316,0x170E,0x3FD4,0x2656,0x0B32,
- 0x28A7,0x0564,0x3DAD,0x1E61,0x0ED1,0x345F,0x1409,0x3925,
- 0x1D38,0x0BC3,0x268B,0x0DC5,0x3E55,0x0609,0x14B9,0x2C82,
- 0x3BFA,0x084E,0x2EBB,0x03D8,0x1DB1,0x3CAE,0x106D,0x3620,
- 0x04E5,0x1C1B,0x3204,0x01E3,0x2C6E,0x1811,0x3082,0x1265,
- 0x3D9C,0x1653,0x2F98,0x1FB7,0x14D7,0x2ABE,0x06FC,0x3A90,
- 0x09EC,0x1870,0x316E,0x15A3,0x2C44,0x21AA,0x0350,0x3CCA,
- 0x0BF0,0x3714,0x198A,0x01D3,0x2D5F,0x090F,0x1895,0x34C3,
- 0x125B,0x3E5D,0x0F8D,0x2FB7,0x0DF9,0x3330,0x19E9,0x3567,
- 0x0E67,0x3CA8,0x26A3,0x0966,0x2908,0x37F2,0x0D52,0x188B,
- 0x3C0C,0x1088,0x357F,0x06E7,0x1668,0x3B10,0x22E4,0x05A2,
- 0x1FEC,0x38F9,0x012C,0x1C78,0x2BEB,0x0577,0x3FD4,0x0963,
- 0x151A,0x282C,0x1DF9,0x0617,0x3983,0x22A9,0x03B5,0x191D,
- 0x35C5,0x055C,0x3FBF,0x1B1C,0x08A0,0x2DB2,0x1C9F,0x257A,
- 0x078D,0x37A0,0x0BCE,0x34F2,0x00B3,0x24D6,0x3169,0x0965,
- 0x2A90,0x05B0,0x2459,0x3560,0x0E3B,0x3A44,0x2B2D,0x1538,
- 0x01AC,0x261F,0x1AB9,0x2149,0x3092,0x0F3D,0x200A,0x3954,
- 0x1137,0x3393,0x2220,0x01DE,0x39E3,0x19D3,0x2E5C,0x0657,
- 0x2474,0x3C23,0x03A9,0x2D90,0x15C8,0x2829,0x3672,0x00A9,
- 0x12CB,0x3288,0x1473,0x20CE,0x30E0,0x068F,0x2919,0x0C63,
- 0x2E70,0x222D,0x0B3B,0x3D0C,0x115E,0x36D4,0x0BAE,0x2535,
- 0x0151,0x3320,0x098E,0x394E,0x0235,0x3283,0x1F3B,0x11EE,
- 0x2EC3,0x20A0,0x0E37,0x37BA,0x0C75,0x1B0B,0x321B,0x1710,
- 0x2F1F,0x054E,0x2012,0x3581,0x15BB,0x3C33,0x25F6,0x0BD5,
- 0x2AC7,0x0685,0x35FA,0x1B85,0x3A5D,0x0A2A,0x288C,0x0785,
- 0x24E2,0x1EA3,0x10CC,0x32F5,0x1F9D,0x1184,0x2114,0x3284,
- 0x0BED,0x271D,0x1978,0x2258,0x2B20,0x0980,0x2E2F,0x17B4,
- 0x2A7A,0x101F,0x3104,0x26A9,0x1129,0x2F7F,0x174B,0x2A0A,
- 0x20EB,0x3DB5,0x0BF4,0x2B8A,0x1061,0x2E2A,0x1D4C,0x3135,
- 0x0BC1,0x2D3D,0x0FAC,0x23D7,0x3462,0x0E87,0x3DE8,0x0FFA,
- 0x3155,0x130C,0x2AC4,0x16A5,0x3EF3,0x11CE,0x1F50,0x3B45,
- 0x19EA,0x320C,0x10E7,0x1EC0,0x2707,0x0487,0x1BB3,0x3EAC,
- 0x1CFC,0x3413,0x0843,0x2BB2,0x09BC,0x32FA,0x001B,0x1B3F,
- 0x2E9F,0x0932,0x1736,0x2C07,0x205D,0x098F,0x1F22,0x36EE,
- 0x10B1,0x1B1D,0x3328,0x1017,0x38E4,0x095C,0x1F86,0x252D,
- 0x1E38,0x0B8D,0x3F0A,0x26EA,0x0D87,0x37EF,0x1EB1,0x3405,
- 0x11C3,0x3ABD,0x1725,0x2052,0x27B4,0x0550,0x1F95,0x38D1,
- 0x1B84,0x2389,0x18C9,0x2739,0x1DE1,0x0F20,0x3D51,0x261B,
- 0x0107,0x3BE6,0x2824,0x049D,0x2599,0x3EC6,0x0F5C,0x28B0,
- 0x145F,0x23F7,0x311B,0x0CC5,0x290F,0x0608,0x2077,0x3294,
- 0x15D2,0x289E,0x1EE1,0x037B,0x236E,0x141D,0x3F43,0x17E8,
- 0x38D0,0x042B,0x3687,0x192C,0x0145,0x3ED1,0x29E3,0x04EE,
- 0x1E3E,0x3957,0x00B0,0x3E52,0x0D98,0x35C9,0x141A,0x3D9F,
- 0x0C1C,0x36AC,0x1F85,0x09A4,0x3A5A,0x2291,0x0D27,0x395B,
- 0x0406,0x1344,0x32FD,0x1FB5,0x3619,0x096C,0x3EC2,0x1460,
- 0x2727,0x1B9B,0x377F,0x020D,0x184C,0x2924,0x04D3,0x2C16,
- 0x1A84,0x3B8E,0x0575,0x286E,0x0A40,0x2D3A,0x041B,0x2636,
- 0x0CA6,0x20E4,0x3FAD,0x0818,0x372E,0x17B9,0x3281,0x0B18,
- 0x2FA6,0x100B,0x3D5A,0x1987,0x387E,0x1687,0x22D8,0x3E17,
- 0x13C4,0x254F,0x37C0,0x0E30,0x3F77,0x151D,0x2AB2,0x0139,
- 0x2CF2,0x21DE,0x087E,0x2712,0x1D08,0x3207,0x0E3E,0x3963,
- 0x2CD4,0x227B,0x0267,0x1930,0x2C15,0x16CA,0x0177,0x1A14,
- 0x2865,0x0339,0x2D07,0x0835,0x33A1,0x197C,0x2FE4,0x0FEF,
- 0x2AD6,0x0C8B,0x3C36,0x0531,0x3723,0x2237,0x07DC,0x17F9,
- 0x351F,0x0B81,0x1980,0x33BA,0x1D6A,0x086E,0x2E07,0x0064,
- 0x331D,0x0A10,0x1AC8,0x3FD4,0x137F,0x3848,0x1A98,0x00F0,
- 0x3A02,0x0A8B,0x3380,0x169E,0x2EBC,0x20E6,0x0092,0x307A,
- 0x1545,0x2D48,0x0C2B,0x278A,0x31D0,0x0AF5,0x15AB,0x3474,
- 0x2469,0x130E,0x316C,0x154B,0x2F7C,0x20B9,0x02B8,0x23F4,
- 0x2C94,0x0477,0x18CC,0x344E,0x1606,0x01F6,0x3199,0x1A17,
- 0x2375,0x2E61,0x187C,0x0233,0x1682,0x29DF,0x1C55,0x0138,
- 0x393D,0x08FE,0x24F3,0x1DF8,0x3B14,0x1250,0x36AA,0x1E39,
- 0x029C,0x2202,0x3030,0x10C1,0x332B,0x1461,0x3968,0x15FF,
- 0x35FD,0x0200,0x281A,0x1D96,0x0EEC,0x2D86,0x1397,0x293C,
- 0x05D1,0x1F73,0x2438,0x042E,0x272A,0x0B69,0x2D51,0x0795,
- 0x2A73,0x036F,0x1BC0,0x302E,0x0498,0x32BF,0x177E,0x3D09,
- 0x0E5A,0x35E9,0x1823,0x3FB5,0x01EB,0x19A2,0x2977,0x04C8,
- 0x0F5A,0x37A3,0x1C79,0x3550,0x0747,0x3A2C,0x1F98,0x3F80,
- 0x0A80,0x3675,0x1BD6,0x3DE4,0x1548,0x25E4,0x08ED,0x3FD4,
- 0x03B8,0x33CB,0x1482,0x2EF5,0x0BD8,0x31A9,0x1C98,0x2A50,
- 0x1132,0x3083,0x242B,0x1027,0x398E,0x168B,0x21F2,0x37F6,
- 0x1164,0x3B19,0x252A,0x0294,0x2CF6,0x0AB3,0x300F,0x24B8,
- 0x1489,0x2C84,0x1029,0x3C68,0x081A,0x3700,0x1B0F,0x2557,
- 0x0896,0x1C3A,0x3D82,0x2141,0x0FEB,0x201B,0x3B46,0x1A5F,
- 0x07CD,0x2C37,0x0A83,0x29A5,0x061E,0x1BD4,0x396E,0x19C5,
- 0x0DF6,0x3B6F,0x2363,0x075C,0x214D,0x3E3F,0x1E40,0x07C9,
- 0x3737,0x09ED,0x38AC,0x1EF5,0x3BC7,0x073F,0x3273,0x21E1,
- 0x17BF,0x2F48,0x0DFD,0x321A,0x06BC,0x2CB8,0x0A69,0x2655,
- 0x34B7,0x17ED,0x0928,0x3858,0x1BF6,0x23F1,0x07D7,0x2C38,
- 0x0FF6,0x30AC,0x1336,0x38CE,0x24AA,0x0270,0x3CAA,0x0E1A,
- 0x39B3,0x2A18,0x1412,0x35A2,0x121E,0x3B81,0x1D0A,0x361E,
- 0x1081,0x3C02,0x23F6,0x0CE6,0x2950,0x1FE8,0x07D4,0x1E9E,
- 0x28E0,0x04FF,0x2F41,0x142C,0x22C4,0x3591,0x10DE,0x3D72,
- 0x25DF,0x0810,0x2DE0,0x148D,0x29F4,0x123F,0x2E34,0x0F12,
- 0x2B7E,0x21AC,0x0DA3,0x2421,0x00A0,0x3A20,0x209A,0x1A55,
- 0x2CEA,0x10D4,0x2888,0x1739,0x2B73,0x132F,0x39ED,0x039C,
- 0x3F93,0x1FF6,0x0611,0x2BAD,0x028A,0x303A,0x0955,0x1CC0,
- 0x2952,0x0643,0x1F6A,0x29B3,0x17C3,0x3680,0x1E1A,0x0E23,
- 0x3EED,0x0591,0x25AD,0x1D10,0x2AEA,0x0DB6,0x320E,0x10BB,
- 0x3B32,0x2A76,0x147A,0x05DE,0x3996,0x296D,0x0331,0x25A3,
- 0x378B,0x1163,0x3D12,0x16B1,0x33A5,0x2386,0x0949,0x21B6,
- 0x2FD8,0x1305,0x325E,0x1B04,0x2A34,0x0FB0,0x2DB9,0x1594,
- 0x2797,0x1D7B,0x0E97,0x2D27,0x136F,0x27E7,0x1014,0x3CA5,
- 0x0630,0x22DE,0x3E24,0x1484,0x277E,0x1997,0x3CF7,0x1602,
- 0x0D28,0x3F8C,0x1DB6,0x2542,0x015B,0x3D3F,0x1AF2,0x216C,
- 0x3BC9,0x0A55,0x2A70,0x06CC,0x1F13,0x3396,0x18C3,0x23CD,
- 0x1E5D,0x0102,0x2EB1,0x0CF3,0x2C74,0x188E,0x0248,0x208B,
- 0x2FD5,0x08D5,0x1849,0x3841,0x1210,0x3B59,0x1B3A,0x347F,
- 0x1299,0x3ACC,0x2122,0x0A1E,0x2BCC,0x06D1,0x2E7E,0x17EE,
- 0x3121,0x1F41,0x0ECB,0x3E66,0x0BDB,0x261D,0x0474,0x348A,
- 0x1B1F,0x067C,0x316B,0x176B,0x2FC3,0x13B2,0x3498,0x0E62,
- 0x22B4,0x3878,0x0791,0x3E20,0x0054,0x2571,0x0D7E,0x2CC8,
- 0x0A99,0x1B34,0x36D5,0x13A3,0x3DB1,0x231D,0x1A35,0x3C3F,
- 0x14CC,0x3507,0x0FDD,0x39E1,0x07EC,0x2352,0x03B6,0x3445,
- 0x2106,0x19C3,0x38AA,0x023A,0x1801,0x3DF0,0x0536,0x28DC,
- 0x1DA8,0x0280,0x22C2,0x339B,0x1835,0x0CA8,0x3013,0x0EA9,
- 0x1EE3,0x2F3C,0x01B8,0x276E,0x0E33,0x374A,0x149B,0x3F20,
- 0x0058,0x2AB4,0x0A86,0x3CF0,0x0342,0x3823,0x0B4B,0x352F,
- 0x00AC,0x3F44,0x2349,0x0484,0x3438,0x0D2A,0x2B5D,0x15A9,
- 0x306D,0x1AC9,0x0375,0x2B85,0x0B96,0x2F04,0x0106,0x23C2,
- 0x2E7B,0x061C,0x2B52,0x1174,0x2F2A,0x0F3F,0x33E6,0x03D9,
- 0x190C,0x2F06,0x1C41,0x3D7C,0x0D47,0x2795,0x076D,0x3222,
- 0x0C10,0x378C,0x1A25,0x3F56,0x06A8,0x2248,0x31BD,0x115D,
- 0x268F,0x1C62,0x323F,0x00BA,0x2D4D,0x0A9F,0x27C5,0x030C,
- 0x2E00,0x0B64,0x1AAA,0x374D,0x15A4,0x3B3D,0x1D5B,0x0313,
- 0x1269,0x3B9E,0x23C7,0x00CB,0x31A6,0x18D4,0x3995,0x1318,
- 0x2517,0x3C42,0x1145,0x37D7,0x0B74,0x29F0,0x06C0,0x2EAD,
- 0x0261,0x1D88,0x2683,0x1272,0x32C4,0x1953,0x35CC,0x1535,
- 0x2699,0x2FD3,0x0EA1,0x2A4B,0x1830,0x0AD6,0x31C0,0x0415,
- 0x2BFB,0x0C36,0x2EAC,0x12F1,0x1EF4,0x3D8A,0x1509,0x2815,
- 0x0874,0x2F4C,0x0CCA,0x33D6,0x2402,0x11BB,0x2D0C,0x0E96,
- 0x3145,0x18CB,0x2DF0,0x0975,0x280D,0x37F7,0x129E,0x3FBC,
- 0x06BB,0x2365,0x14E7,0x3A12,0x1FD6,0x03DE,0x285B,0x1834,
- 0x31DD,0x11B9,0x2732,0x146B,0x2CB9,0x2308,0x169D,0x21AD,
- 0x2C28,0x0F52,0x2F15,0x18F7,0x2164,0x39F2,0x02AC,0x35F7,
- 0x0A17,0x2015,0x33F7,0x16C5,0x390D,0x13E5,0x3703,0x1C15,
- 0x0E76,0x33C0,0x1791,0x3A63,0x0C57,0x29BD,0x13B8,0x27A0,
- 0x3806,0x148B,0x0096,0x222E,0x350D,0x1290,0x3AF4,0x1670,
- 0x28C0,0x20FA,0x104E,0x2551,0x1BE1,0x39CA,0x0A3C,0x36E2,
- 0x04F3,0x3EC0,0x147F,0x2575,0x1DAC,0x3648,0x1169,0x3E8A,
- 0x16B5,0x2534,0x31E1,0x002D,0x28A1,0x0C16,0x24B6,0x381A,
- 0x2B78,0x05DA,0x1B49,0x36A0,0x1537,0x28A3,0x0D6D,0x2F18,
- 0x0214,0x1D9D,0x2A1C,0x042F,0x26ED,0x108A,0x3BCB,0x1FED,
- 0x35A8,0x0EEB,0x3B01,0x1F5E,0x09B5,0x2960,0x04D1,0x3C87,
- 0x2091,0x01CB,0x3B6B,0x0783,0x2163,0x361A,0x11B4,0x23D8,
- 0x1DA0,0x3E70,0x0173,0x24DB,0x317C,0x0CA1,0x2E26,0x173B,
- 0x3B37,0x12D3,0x291A,0x1E2F,0x08E9,0x3630,0x1CCF,0x3A16,
- 0x0A53,0x35FC,0x134E,0x3E95,0x1F80,0x0052,0x1D58,0x26C1,
- 0x1897,0x3183,0x1D8B,0x0BDC,0x30E7,0x1A8A,0x2EE8,0x0890,
- 0x2116,0x3A8A,0x04F6,0x35A0,0x1CFD,0x087D,0x3B8F,0x0538,
- 0x1C8D,0x36D3,0x06CD,0x3C64,0x0ACC,0x1B87,0x28F7,0x125A,
- 0x24C3,0x3AFB,0x0D95,0x292C,0x051E,0x257C,0x09CF,0x288D,
- 0x3C1B,0x21A0,0x033F,0x22C5,0x32C3,0x0500,0x3E6F,0x1D44,
- 0x0852,0x232A,0x311D,0x1814,0x0510,0x2CB3,0x1CA0,0x02ED,
- 0x3E2A,0x0885,0x3366,0x03B7,0x2B31,0x12E2,0x28BD,0x16CB,
- 0x2C46,0x1E2D,0x09B2,0x3A8E,0x06B5,0x195F,0x2EF1,0x0D75,
- 0x2A0C,0x075A,0x1EC1,0x3D64,0x11BF,0x333B,0x196F,0x0A94,
- 0x1600,0x3517,0x273E,0x09F5,0x2AF6,0x0519,0x3DD0,0x2152,
- 0x17E6,0x329E,0x0C8D,0x3E8C,0x14BC,0x2DB1,0x1AE6,0x093C,
- 0x179C,0x2A29,0x0586,0x2455,0x34EB,0x136D,0x2E65,0x0FD2,
- 0x18E1,0x3211,0x140A,0x1E68,0x2E17,0x00C3,0x277B,0x3944,
- 0x0DAC,0x176E,0x2AED,0x1C4F,0x05E9,0x37A1,0x20B2,0x001C,
- 0x1BD0,0x327E,0x044D,0x3BFE,0x18E6,0x26E3,0x0136,0x1704,
- 0x2B4B,0x1F01,0x045F,0x2456,0x156C,0x2345,0x352A,0x09F8,
- 0x36CC,0x04C9,0x3C69,0x2242,0x0730,0x3DFF,0x102B,0x37B9,
- 0x1BA4,0x0C6F,0x29B4,0x0F11,0x2EA6,0x1853,0x2419,0x3176,
- 0x10B9,0x2670,0x2056,0x1714,0x2323,0x31E0,0x0814,0x3F7C,
- 0x1D3F,0x005F,0x2FAF,0x1180,0x3E96,0x18AB,0x3274,0x1661,
- 0x074B,0x1B2C,0x2FD0,0x0B3C,0x1E62,0x25F3,0x0E9F,0x2EA2,
- 0x1728,0x345A,0x09E2,0x3F6C,0x264A,0x0FE3,0x30F7,0x21F4,
- 0x1150,0x2FFE,0x17FA,0x3C48,0x0DD3,0x3527,0x015C,0x3D3C,
- 0x0C61,0x23A3,0x318F,0x15D8,0x2B79,0x2266,0x0203,0x38C9,
- 0x14C5,0x34C1,0x1099,0x22E2,0x2B26,0x0560,0x3EF9,0x2377,
- 0x2ECD,0x0C42,0x2049,0x3B00,0x118D,0x33BF,0x1E41,0x0977,
- 0x3895,0x1431,0x25AA,0x1C17,0x343A,0x0189,0x3677,0x1E90,
- 0x3F53,0x1156,0x320B,0x0DFA,0x1DE5,0x3EEE,0x0894,0x232D,
- 0x397B,0x0BC9,0x22DA,0x380E,0x1248,0x3F30,0x199C,0x06E4,
- 0x21CF,0x36B4,0x0B14,0x3BAD,0x1937,0x271C,0x108F,0x34C2,
- 0x265F,0x0EEF,0x2A19,0x1125,0x2C47,0x0E09,0x3F7D,0x24CC,
- 0x074A,0x3C6E,0x1B4D,0x389E,0x0827,0x2E3E,0x0F30,0x2A14,
- 0x137A,0x2882,0x0F77,0x2D35,0x1773,0x263D,0x2046,0x0257,
- 0x236B,0x3305,0x13EA,0x3FA9,0x0167,0x3776,0x0D99,0x1F9A,
- 0x3DE1,0x09D0,0x33D4,0x0178,0x38CB,0x1541,0x2C2E,0x10B7,
- 0x2DA7,0x1943,0x2228,0x34DC,0x0B0E,0x27EE,0x01E9,0x39B4,
- 0x1EF8,0x359D,0x14CD,0x3CA4,0x1313,0x388C,0x20A4,0x022B,
- 0x3A94,0x1567,0x2B93,0x0E58,0x200C,0x3A17,0x0AD9,0x36E7,
- 0x1AD8,0x26AA,0x0BC6,0x1CEF,0x2D50,0x15B1,0x2746,0x13C7,
- 0x2E68,0x1A81,0x0346,0x3576,0x0FBD,0x3CA6,0x1BA6,0x214A,
- 0x2C02,0x0420,0x39B8,0x08FF,0x1770,0x30AD,0x1C4D,0x0197,
- 0x11DC,0x3D2E,0x180F,0x02DC,0x2D52,0x21FB,0x10C0,0x3026,
- 0x2312,0x05CC,0x3AD7,0x08A7,0x2182,0x2BD1,0x0D1A,0x2799,
- 0x0317,0x2C77,0x185F,0x38FB,0x012A,0x25FB,0x1A4A,0x30B6,
- 0x02D3,0x1D49,0x2D10,0x05B6,0x2ADC,0x09A1,0x3012,0x1C8E,
- 0x3236,0x0469,0x2F1D,0x13F9,0x3322,0x09FD,0x3F67,0x1DAA,
- 0x0B02,0x3D2B,0x1C84,0x3803,0x06D8,0x32F6,0x207F,0x11A4,
- 0x3191,0x1522,0x2F77,0x0FBB,0x32AD,0x17A3,0x3DC1,0x031A,
- 0x3911,0x1F18,0x3427,0x0124,0x39C7,0x0CC2,0x3480,0x1657,
- 0x3BD5,0x05CF,0x25DC,0x1AC5,0x2AC9,0x134C,0x2FDD,0x02EA,
- 0x19FD,0x2980,0x1212,0x2B0C,0x0CB2,0x2775,0x03CE,0x3352,
- 0x0A78,0x3A42,0x0733,0x1CE3,0x2AE9,0x127A,0x30B0,0x0F9C,
- 0x2C54,0x0BFB,0x2883,0x0014,0x2A57,0x0919,0x34B0,0x1AC7,
- 0x2536,0x05BB,0x1C6A,0x3644,0x01C5,0x1957,0x2AB5,0x0661,
- 0x2CDB,0x0032,0x38E8,0x247D,0x052E,0x3ACE,0x0B4C,0x349A,
- 0x06D7,0x391D,0x2615,0x0CD1,0x296E,0x05C3,0x3077,0x0A51,
- 0x132B,0x3151,0x1CD0,0x2181,0x3C4D,0x0F1F,0x2662,0x3704,
- 0x2C26,0x067F,0x256C,0x377A,0x1A29,0x088F,0x3B6E,0x0013,
- 0x1BBF,0x2B2E,0x1632,0x31D6,0x1008,0x19BA,0x3CEC,0x15CF,
- 0x37AF,0x1F07,0x07D9,0x2075,0x2F26,0x1494,0x3773,0x0E86,
- 0x21A4,0x3E00,0x0F71,0x357B,0x17E0,0x263E,0x0EFA,0x3AD8,
- 0x11EB,0x28E6,0x0E5C,0x2572,0x0272,0x2C80,0x221D,0x04D7,
- 0x3099,0x2329,0x0204,0x16EC,0x2DBD,0x1A51,0x0395,0x3750,
- 0x0B7B,0x2674,0x01DF,0x2965,0x1FE6,0x0585,0x1E7A,0x2BB7,
- 0x162E,0x08D3,0x1BAC,0x28FB,0x1223,0x2A41,0x065C,0x2E66,
- 0x0DE3,0x1E71,0x3102,0x0A77,0x21C3,0x3C40,0x0C20,0x20F9,
- 0x39A4,0x0642,0x3618,0x1B2D,0x3E59,0x12EC,0x3804,0x14A2,
- 0x1F72,0x269B,0x1769,0x37BF,0x0432,0x3D7B,0x1A62,0x246E,
- 0x055B,0x3F5D,0x108D,0x36DA,0x19E7,0x2F51,0x113F,0x2C19,
- 0x0DDD,0x3D03,0x27F9,0x1119,0x3048,0x2509,0x0F76,0x3CD0,
- 0x131B,0x3404,0x2038,0x0E34,0x31E2,0x1D9E,0x2905,0x186C,
- 0x23FF,0x1F8F,0x1270,0x3FD4,0x146C,0x36B1,0x17F2,0x2426,
- 0x3F2D,0x18D2,0x0B90,0x2D4E,0x02A3,0x2A1D,0x084F,0x1ACE,
- 0x0F6A,0x3060,0x1D93,0x0ADE,0x325F,0x293E,0x1519,0x2703,
- 0x3F31,0x0BE1,0x3708,0x0343,0x22CD,0x30C8,0x04F5,0x28EB,
- 0x0A28,0x32CF,0x1B7F,0x3C0B,0x10A1,0x2963,0x048A,0x1EB9,
- 0x335A,0x0820,0x2902,0x1C1A,0x0370,0x3CF4,0x2359,0x01E6,
- 0x2C60,0x189D,0x3E1B,0x15BA,0x38E0,0x1D0E,0x0D9A,0x39F4,
- 0x1F2F,0x134F,0x3525,0x2288,0x09A7,0x397D,0x286A,0x143E,
- 0x2AF0,0x12DD,0x3BA5,0x0B09,0x3668,0x1A34,0x3A28,0x0B48,
- 0x3335,0x23FB,0x3F55,0x0A39,0x353E,0x1D4A,0x3D45,0x1931,
- 0x223C,0x38E6,0x1015,0x36CB,0x046D,0x171A,0x32C6,0x26E0,
- 0x0E3A,0x2B8C,0x1E96,0x0431,0x1FD0,0x2A10,0x07CB,0x2499,
- 0x3CFF,0x0249,0x32C2,0x0DFC,0x2EA7,0x1DC8,0x08B4,0x31BB,
- 0x20E8,0x17D4,0x3007,0x230A,0x05EC,0x1F81,0x3ED0,0x03A6,
- 0x32F7,0x1EC5,0x08CC,0x390C,0x20DE,0x0BFA,0x3256,0x1D0D,
- 0x27BA,0x0927,0x1743,0x3FAA,0x1635,0x0848,0x3744,0x0295,
- 0x3DDD,0x0A9E,0x2FAC,0x0065,0x2879,0x1D1F,0x08AA,0x344D,
- 0x0146,0x22B6,0x3872,0x1562,0x35C7,0x1374,0x3A87,0x23BC,
- 0x3FD4,0x14FA,0x38FC,0x133B,0x209F,0x056D,0x3623,0x0A3E,
- 0x18EC,0x2D6F,0x125C,0x1F0E,0x2A89,0x0B41,0x3A06,0x13BA,
- 0x2EAE,0x1288,0x2AA6,0x0563,0x33C4,0x0CB8,0x3A5F,0x24EA,
- 0x12A0,0x2BDD,0x1434,0x38AF,0x20EF,0x1093,0x1DC6,0x379A,
- 0x0C5F,0x30DF,0x0737,0x2850,0x0B8F,0x2E3F,0x1AC6,0x25DB,
- 0x07CF,0x2EE2,0x0E4B,0x3EA1,0x1DCA,0x0F42,0x210E,0x3D14,
- 0x06AD,0x3436,0x1CA9,0x2D00,0x0ED4,0x27C7,0x126B,0x2989,
- 0x1AFB,0x0232,0x1588,0x2DFA,0x183C,0x03A1,0x2576,0x09B1,
- 0x2CE1,0x00B4,0x2B35,0x1CBB,0x233A,0x2D73,0x0713,0x1969,
- 0x34D4,0x1435,0x3CBB,0x16CE,0x3266,0x1025,0x2F6B,0x1CAB,
- 0x0C85,0x2CF5,0x115C,0x28EA,0x13B5,0x2521,0x3B16,0x0D62,
- 0x3641,0x02D1,0x1F9E,0x0C90,0x3B68,0x0F51,0x26D6,0x18F0,
- 0x240D,0x1254,0x2D43,0x19D0,0x04DB,0x3E56,0x17D2,0x0345,
- 0x3A55,0x211B,0x2A4A,0x03DA,0x2ED9,0x221A,0x19ED,0x30C2,
- 0x11AC,0x2C1B,0x1534,0x3348,0x0EC2,0x3B96,0x2303,0x1688,
- 0x202F,0x2F17,0x05D5,0x25F8,0x0992,0x31A5,0x1F36,0x0408,
- 0x0CA7,0x2AE3,0x012E,0x2796,0x3E05,0x1796,0x2445,0x1DE3,
- 0x3095,0x06B4,0x24F5,0x3C88,0x0F66,0x3354,0x1C5F,0x2588,
- 0x00A1,0x3E27,0x0C1E,0x2779,0x165E,0x2D85,0x1B48,0x09EA,
- 0x3BCA,0x002B,0x318D,0x0B83,0x281D,0x34E4,0x0A71,0x271A,
- 0x1F55,0x134A,0x365B,0x16DA,0x3437,0x03F1,0x3CB3,0x10DD,
- 0x3751,0x1603,0x2AAB,0x051F,0x31F2,0x2403,0x009E,0x1C67,
- 0x30CF,0x17F3,0x0437,0x22A8,0x3EC1,0x00EF,0x3555,0x0736,
- 0x3C3C,0x1F6C,0x36DD,0x0D7A,0x22D2,0x3A84,0x110D,0x35E4,
- 0x12CD,0x3E7A,0x17F6,0x0CF4,0x382B,0x1287,0x3EF2,0x1FF8,
- 0x0025,0x28BE,0x088B,0x2DE7,0x0A4C,0x3ADC,0x010A,0x340C,
- 0x1848,0x228C,0x3F14,0x0859,0x3887,0x00C7,0x1985,0x2AB1,
- 0x12E5,0x283F,0x396B,0x1693,0x2355,0x3202,0x0761,0x381B,
- 0x0AF6,0x3AFC,0x00D2,0x3505,0x28E8,0x1218,0x2427,0x2FBE,
- 0x14D4,0x0D03,0x3793,0x1E78,0x1110,0x3B55,0x0EA8,0x24EB,
- 0x1F27,0x050B,0x39DC,0x1A60,0x2AF7,0x03C9,0x3111,0x0CFE,
- 0x3DAA,0x1030,0x1E30,0x3BF2,0x19C6,0x2463,0x0E8B,0x33E3,
- 0x2857,0x1624,0x3310,0x1B8C,0x095F,0x3460,0x025B,0x3810,
- 0x144A,0x3A41,0x1A8C,0x0129,0x2CF7,0x17FB,0x0623,0x3866,
- 0x1F45,0x14DF,0x34CC,0x0FF3,0x3D6D,0x0215,0x2221,0x3523,
- 0x159F,0x26AF,0x177A,0x3FCE,0x064D,0x1A15,0x2D8D,0x04F4,
- 0x3CA2,0x239A,0x007A,0x2986,0x1185,0x246C,0x17F5,0x29EA,
- 0x0114,0x324C,0x0C3C,0x2692,0x1139,0x3B66,0x167C,0x2BA8,
- 0x097E,0x273A,0x39E5,0x11BA,0x1E51,0x315B,0x1947,0x2DA1,
- 0x0E94,0x2BD9,0x05F0,0x1DEC,0x3239,0x07EB,0x3020,0x19D1,
- 0x278C,0x08B5,0x2162,0x2F34,0x030B,0x29C7,0x0B27,0x251E,
- 0x3A48,0x10AD,0x3764,0x190F,0x26B5,0x1BCF,0x240E,0x1574,
- 0x39D3,0x055F,0x1E1F,0x31DF,0x1C0F,0x218B,0x357E,0x0670,
- 0x3D44,0x1BE7,0x08F2,0x3375,0x0149,0x1B30,0x29CD,0x1392,
- 0x2ECA,0x1745,0x25BD,0x1E9D,0x0AA5,0x31B2,0x07B9,0x1B4C,
- 0x3611,0x26BA,0x06AB,0x3158,0x259B,0x00ED,0x3399,0x093D,
- 0x3C1A,0x284E,0x1E17,0x080F,0x1F83,0x37C8,0x1221,0x2CAA,
- 0x071C,0x26F3,0x322D,0x0C62,0x2B97,0x0074,0x2E93,0x1281,
- 0x0610,0x3AA9,0x0AC8,0x22AB,0x2F87,0x121D,0x2C56,0x0EFB,
- 0x283E,0x0C78,0x346A,0x218C,0x0A5C,0x3FBB,0x2337,0x0E73,
- 0x3036,0x22DB,0x03F0,0x2F5D,0x2011,0x1874,0x2B71,0x0739,
- 0x3058,0x0D8A,0x2EED,0x1133,0x1FD9,0x3A24,0x147D,0x32A9,
- 0x1959,0x0F86,0x3967,0x1A59,0x3FAE,0x0690,0x35D0,0x0D2C,
- 0x3A8F,0x2140,0x1919,0x3043,0x1F82,0x07B0,0x3451,0x0CDC,
- 0x3FD4,0x2039,0x0E63,0x2E81,0x086C,0x2532,0x0C67,0x20C3,
- 0x3849,0x166C,0x2215,0x3E2F,0x1261,0x2A78,0x1CB6,0x02A9,
- 0x3961,0x1B58,0x350E,0x11B7,0x3B35,0x161A,0x358B,0x1A79,
- 0x09F2,0x2CF3,0x1CFB,0x035D,0x3FD4,0x0BAA,0x35DC,0x06F8,
- 0x2801,0x12B6,0x2BC0,0x15FE,0x0C27,0x303B,0x1559,0x2999,
- 0x1104,0x23D4,0x2EF9,0x0FD1,0x204C,0x3DFC,0x0EB0,0x35F8,
- 0x2138,0x063E,0x3FD4,0x0EE7,0x3748,0x1487,0x3C05,0x2AD9,
- 0x0161,0x18A6,0x3D13,0x0FF2,0x1A2D,0x2D18,0x14F5,0x29C4,
- 0x179B,0x0D19,0x33C8,0x1423,0x2F59,0x09DF,0x2590,0x1C7D,
- 0x399C,0x1944,0x0383,0x37E9,0x13EE,0x3E44,0x1B3D,0x36B6,
- 0x2D69,0x216E,0x1744,0x3C37,0x047D,0x2648,0x1A07,0x3EB1,
- 0x03E8,0x29FB,0x1033,0x2EB7,0x1E5C,0x1111,0x3547,0x1D33,
- 0x077F,0x3B0E,0x1951,0x2602,0x08C6,0x376C,0x0E12,0x3E82,
- 0x1D07,0x2899,0x0529,0x367F,0x2520,0x019C,0x29D8,0x0CCB,
- 0x2502,0x2FC6,0x0887,0x2B1E,0x0BF8,0x3163,0x156F,0x27CA,
- 0x1BBB,0x08DA,0x3E01,0x02F5,0x390B,0x1AD6,0x224B,0x2F0C,
- 0x1A12,0x0255,0x35B3,0x1702,0x37CC,0x159A,0x3D96,0x0348,
- 0x2654,0x09D3,0x2ED2,0x0010,0x26F7,0x0AD0,0x3CDC,0x2318,
- 0x1491,0x2E32,0x04E4,0x2626,0x0BF3,0x2821,0x05C2,0x3182,
- 0x241D,0x11F0,0x30E3,0x225A,0x1363,0x2BE8,0x1116,0x2FFB,
- 0x1D71,0x3788,0x02B5,0x3AB1,0x25D1,0x04AF,0x3BE0,0x0B1B,
- 0x3456,0x03AC,0x1922,0x37CE,0x275B,0x09E9,0x2DCE,0x0312,
- 0x1A4B,0x2B25,0x12C8,0x2E2B,0x02A8,0x284B,0x2010,0x0E71,
- 0x227F,0x2D7D,0x0A21,0x23D2,0x3817,0x0C22,0x3EE0,0x0453,
- 0x35E0,0x2250,0x01B6,0x3E8F,0x1817,0x20FD,0x3C66,0x0219,
- 0x153A,0x2FFD,0x23AB,0x0F9B,0x2920,0x1FDD,0x07D5,0x1E77,
- 0x139D,0x01F4,0x318C,0x0DB2,0x2003,0x3951,0x07F5,0x1D74,
- 0x339C,0x13AC,0x3D69,0x05A9,0x36E9,0x2740,0x0296,0x2C7B,
- 0x213C,0x0BDA,0x35F1,0x15B2,0x30EC,0x1234,0x2929,0x19E1,
- 0x02C2,0x3880,0x2324,0x0C71,0x1B80,0x347B,0x120E,0x3EDD,
- 0x0344,0x1E44,0x3389,0x1407,0x26A7,0x1037,0x2C7D,0x039E,
- 0x30CB,0x231A,0x16A3,0x2BED,0x0DF2,0x2A4C,0x04B4,0x13E7,
- 0x3867,0x2356,0x0C23,0x2C29,0x04D6,0x28EF,0x0DAE,0x32D0,
- 0x1A89,0x3B09,0x0FD0,0x35FE,0x1866,0x2C3E,0x0F9E,0x31D1,
- 0x0780,0x1D52,0x3F62,0x16EB,0x338D,0x1070,0x3DCA,0x1ECE,
- 0x0220,0x3C75,0x07F1,0x366E,0x1EEA,0x04E9,0x3B5C,0x21CA,
- 0x0CE7,0x18DD,0x30FA,0x2095,0x0F16,0x2CE8,0x11F1,0x27DE,
- 0x1477,0x3FB9,0x2570,0x06F3,0x14E1,0x3A04,0x1CDB,0x22E0,
- 0x3C72,0x0A41,0x368E,0x21A1,0x1B08,0x39DB,0x0557,0x1DBF,
- 0x3F3C,0x1398,0x32D5,0x1D5D,0x05AB,0x27F2,0x1B73,0x2BDB,
- 0x114E,0x2DFE,0x1B24,0x274F,0x059C,0x31C5,0x0D79,0x29FE,
- 0x35E1,0x08A4,0x1BED,0x330B,0x0525,0x35B4,0x17EC,0x3CE9,
- 0x27CF,0x388A,0x2325,0x1991,0x2BDC,0x1188,0x30FC,0x2416,
- 0x0AD7,0x2CBA,0x1C89,0x254A,0x0D26,0x1775,0x3276,0x12F0,
- 0x3EB5,0x1AF6,0x279D,0x0148,0x21D6,0x3C34,0x05B1,0x334D,
- 0x2093,0x0EE4,0x16E1,0x3CDA,0x27DC,0x0989,0x2CDD,0x202B,
- 0x359E,0x0E9B,0x21B7,0x3BF7,0x0228,0x36A2,0x1ECA,0x3B7E,
- 0x0F90,0x37F1,0x0BDD,0x21E4,0x3695,0x1586,0x3DAB,0x25BF,
- 0x07EE,0x2DE3,0x14CE,0x216A,0x3C04,0x123B,0x2B49,0x1EA5,
- 0x0821,0x1FBB,0x289A,0x14BB,0x310A,0x054B,0x37DD,0x1731,
- 0x21D2,0x2B5F,0x0AA6,0x297C,0x0140,0x2DAE,0x2204,0x13C9,
- 0x2C5C,0x18B3,0x2925,0x0D8E,0x2640,0x32EC,0x177F,0x01BC,
- 0x3D92,0x2970,0x140F,0x0978,0x3EAA,0x1CD7,0x3337,0x019D,
- 0x2F84,0x1F08,0x0E4F,0x32BB,0x2AD1,0x1708,0x05A0,0x33D5,
- 0x11B8,0x3014,0x188C,0x0723,0x2C9C,0x1091,0x2647,0x30F5,
- 0x0903,0x2907,0x02E9,0x3A9F,0x16A6,0x3657,0x0EFD,0x214F,
- 0x38F2,0x0769,0x3B1D,0x1051,0x36FC,0x1649,0x2431,0x1EE2,
- 0x10C7,0x278B,0x3F79,0x0E0E,0x2DC6,0x1073,0x2A5C,0x0BF9,
- 0x1F57,0x1532,0x0652,0x3F71,0x09C8,0x3669,0x00BC,0x16BD,
- 0x3B60,0x1886,0x01E0,0x38A7,0x2287,0x3C11,0x09D7,0x2871,
- 0x04B3,0x331C,0x11E5,0x39BF,0x1D57,0x0D09,0x2C0A,0x0B46,
- 0x3B38,0x2441,0x3241,0x069F,0x15D4,0x3A85,0x1AC2,0x07F9,
- 0x17AC,0x2B81,0x05F4,0x1C26,0x2EE3,0x171B,0x07B6,0x1B6E,
- 0x2943,0x0554,0x2E3B,0x1C09,0x015D,0x2D7C,0x0A73,0x1E6E,
- 0x3504,0x188F,0x3A68,0x0669,0x1D24,0x2FE6,0x0195,0x3503,
- 0x17B5,0x36FF,0x03D1,0x3FD4,0x0C03,0x1F28,0x2515,0x01D5,
- 0x3BA3,0x0EF4,0x3656,0x139A,0x39F0,0x1DD8,0x0962,0x3401,
- 0x0677,0x3705,0x12FE,0x3A09,0x1A8E,0x0995,0x2F12,0x24DC,
- 0x1C0E,0x0740,0x36E5,0x233C,0x2A2A,0x06AA,0x1793,0x394C,
- 0x22FA,0x082D,0x3AAD,0x1D9C,0x007C,0x2254,0x2CDA,0x0E31,
- 0x2956,0x01E8,0x249D,0x3DAC,0x1544,0x3363,0x0C97,0x191A,
- 0x389B,0x1238,0x2F4D,0x0D61,0x2601,0x0888,0x309A,0x0231,
- 0x1D6C,0x2690,0x0B61,0x209E,0x2AD4,0x0ABD,0x3D6F,0x04A7,
- 0x3857,0x18A7,0x0109,0x24BE,0x1A2A,0x3AE8,0x02EB,0x3455,
- 0x0950,0x3061,0x1D32,0x28E5,0x1608,0x24A9,0x1DD3,0x2E7F,
- 0x0868,0x26AB,0x329B,0x15D9,0x071E,0x1B59,0x2FFF,0x1563,
- 0x2A7F,0x0F0E,0x2D04,0x0837,0x31D7,0x1525,0x22BD,0x2F4E,
- 0x145E,0x00BD,0x1BB0,0x2EAB,0x23BD,0x0308,0x314F,0x1EEB,
- 0x3DBC,0x1260,0x3808,0x24BD,0x09AB,0x3E7F,0x1F90,0x34A0,
- 0x1211,0x3F2C,0x141C,0x33F8,0x2071,0x12C9,0x3993,0x0FFF,
- 0x28F8,0x0059,0x2279,0x31C3,0x0F32,0x230B,0x3E7D,0x10A5,
- 0x27E3,0x0E66,0x2E10,0x12F9,0x298F,0x3902,0x0D97,0x3326,
- 0x18E7,0x2FE5,0x0470,0x2041,0x24A0,0x1108,0x38A2,0x17A5,
- 0x26F9,0x0CAA,0x2E5D,0x0098,0x2064,0x3ED3,0x14E8,0x0B43,
- 0x33C3,0x2715,0x1AB7,0x0045,0x1629,0x37B8,0x21D7,0x0A34,
- 0x1A0D,0x2DBC,0x12C6,0x29EF,0x1AAE,0x3E81,0x0951,0x37AC,
- 0x13F6,0x39A5,0x1D3E,0x0B22,0x27B9,0x0031,0x3AED,0x234A,
- 0x0442,0x34C0,0x21D4,0x1BC5,0x3E33,0x1854,0x231C,0x3CCD,
- 0x0F7C,0x2F0B,0x19C7,0x347C,0x0010,0x282F,0x179F,0x2D81,
- 0x0B67,0x2B5B,0x1DCE,0x3934,0x0998,0x2383,0x1C25,0x2541,
- 0x36A9,0x0F79,0x3A0A,0x037E,0x34D6,0x0D25,0x3D34,0x1131,
- 0x36BC,0x20BC,0x0FBF,0x2E38,0x1E89,0x2B23,0x0033,0x3A0B,
- 0x0AA2,0x3D1B,0x1BD5,0x24CE,0x17DC,0x3F1D,0x03A8,0x1911,
- 0x3415,0x1F29,0x3F87,0x0A36,0x18E3,0x37B3,0x136C,0x28C8,
- 0x00D4,0x2E20,0x0AFC,0x1894,0x2D55,0x1303,0x29F1,0x0037,
- 0x259A,0x0AC5,0x2831,0x0855,0x3CE3,0x264C,0x043A,0x30AB,
- 0x16A9,0x3F4B,0x0E39,0x1EE7,0x3795,0x08EB,0x1C24,0x2AA9,
- 0x061F,0x3B77,0x1D7A,0x2451,0x0707,0x16A2,0x2D0F,0x213A,
- 0x08B1,0x2595,0x1BDC,0x3D4C,0x0790,0x2FA7,0x02E1,0x2A81,
- 0x0F56,0x3E30,0x1639,0x23C8,0x34A1,0x0613,0x27B0,0x38E9,
- 0x1678,0x0DB1,0x3BEA,0x1F3D,0x2D30,0x0FAF,0x314D,0x1D53,
- 0x3C4A,0x041A,0x36B7,0x0BCC,0x34DB,0x10E0,0x30CC,0x19A9,
- 0x2630,0x085E,0x32AC,0x1786,0x35C1,0x208A,0x1012,0x2DE4,
- 0x1F14,0x15F6,0x0971,0x2E5E,0x009A,0x3424,0x1175,0x1E88,
- 0x3317,0x0427,0x3FC6,0x14C0,0x1FC6,0x3A91,0x0E32,0x219F,
- 0x34A6,0x13D8,0x3000,0x1115,0x34E3,0x14EB,0x3EBA,0x129A,
- 0x0048,0x2E03,0x17A1,0x25FC,0x1A65,0x2D54,0x0573,0x2937,
- 0x1BDE,0x032E,0x398D,0x0B97,0x3DC2,0x10D9,0x3595,0x1998,
- 0x2574,0x207D,0x026A,0x37B0,0x06CA,0x26A4,0x1DC5,0x3946,
- 0x087A,0x2AE5,0x11B5,0x34FF,0x25B0,0x0CAC,0x2BF1,0x0FD7,
- 0x3937,0x1BF3,0x2203,0x3412,0x0381,0x39CD,0x0D4A,0x376B,
- 0x1A45,0x32A8,0x1771,0x2FEA,0x0F1C,0x18D8,0x371C,0x2176,
- 0x09B6,0x23AD,0x2F28,0x0409,0x272B,0x18A3,0x340B,0x13A7,
- 0x329C,0x1999,0x00FE,0x30BC,0x1C29,0x3C5A,0x0336,0x1AC1,
- 0x3EAE,0x1464,0x342F,0x11E6,0x28D0,0x14E5,0x3CB4,0x1B92,
- 0x3174,0x04B5,0x2B75,0x0ABF,0x17F0,0x305F,0x1D25,0x031E,
- 0x21E7,0x2EBA,0x0507,0x334A,0x0AC4,0x3E0F,0x02EC,0x2B33,
- 0x0D6B,0x2733,0x156E,0x2C4E,0x063D,0x256A,0x203D,0x0293,
- 0x3CD4,0x212C,0x1326,0x2EB6,0x0619,0x3EB7,0x1C93,0x078B,
- 0x3BF4,0x2475,0x37F4,0x0FB6,0x296C,0x0B82,0x2C7F,0x068B,
- 0x27FC,0x172E,0x24F8,0x0CDA,0x301C,0x064C,0x3213,0x1A95,
- 0x0273,0x3B53,0x07B8,0x270C,0x0434,0x2D05,0x0728,0x2B00,
- 0x3BF6,0x2125,0x08D0,0x3E23,0x0C12,0x21C0,0x3871,0x0F1D,
- 0x32FE,0x168E,0x27ED,0x211F,0x044E,0x2719,0x1FB6,0x068E,
- 0x3447,0x100C,0x2E86,0x1395,0x319F,0x0E7F,0x2BC2,0x1315,
- 0x2764,0x0F45,0x30C5,0x0416,0x1D8E,0x3C38,0x06E1,0x330D,
- 0x2139,0x058B,0x3D0B,0x1096,0x27BC,0x1AD9,0x2443,0x1458,
- 0x2CC6,0x064B,0x3B34,0x02EF,0x1FD1,0x2D26,0x070B,0x1BAA,
- 0x3394,0x1079,0x1A53,0x38E1,0x1298,0x3C91,0x02D6,0x2D62,
- 0x0A06,0x25E0,0x3936,0x0E08,0x348E,0x1018,0x2297,0x3596,
- 0x0C92,0x2810,0x007D,0x2C4D,0x0D0E,0x3209,0x216F,0x09D5,
- 0x2293,0x362D,0x114F,0x3A82,0x2493,0x0E05,0x3CE4,0x19B7,
- 0x351D,0x0FFB,0x29BE,0x126C,0x27FF,0x1935,0x250E,0x145D,
- 0x33F9,0x18A5,0x3F04,0x0FFD,0x1E3C,0x3B97,0x0DD7,0x2E85,
- 0x15BF,0x353B,0x03C1,0x1EAC,0x29CA,0x0EDE,0x26CD,0x3181,
- 0x1486,0x0234,0x1ABB,0x31CA,0x13E1,0x3BA2,0x2013,0x3899,
- 0x0DD2,0x3686,0x083A,0x3977,0x18DC,0x2651,0x1075,0x3F19,
- 0x25A4,0x124A,0x2A3D,0x15B9,0x319A,0x11B6,0x2804,0x16D5,
- 0x0EBD,0x1ADA,0x2AB7,0x12C5,0x31C9,0x019E,0x1CE1,0x2C27,
- 0x079E,0x3EDF,0x0E06,0x360B,0x18BB,0x3338,0x0C6A,0x2F0F,
- 0x1750,0x38F5,0x0914,0x242C,0x1AD4,0x3AA0,0x09F3,0x35B6,
- 0x01F3,0x3DE0,0x222C,0x170F,0x2DFF,0x14A6,0x282A,0x1B40,
- 0x0E53,0x3034,0x15BC,0x2B03,0x0BAB,0x32C8,0x050A,0x3D6B,
- 0x0C7C,0x28D8,0x1572,0x2494,0x35F6,0x0CD8,0x3C3A,0x22BE,
- 0x0287,0x3D42,0x2851,0x0794,0x2CC2,0x0D8F,0x24ED,0x1CD6,
- 0x3F0E,0x0F8F,0x208C,0x2B70,0x0866,0x1EE6,0x2F6A,0x05D0,
- 0x2AB0,0x106F,0x3A3F,0x1E8D,0x36EF,0x057F,0x194E,0x2DF3,
- 0x1351,0x1EE8,0x2876,0x0281,0x1DA7,0x2CEC,0x0786,0x28DD,
- 0x091F,0x3F86,0x1B32,0x39C4,0x060D,0x368C,0x0BB1,0x3B12,
- 0x077B,0x2F66,0x0170,0x21EA,0x3008,0x049A,0x3458,0x1D26,
- 0x08F8,0x2741,0x1AF5,0x3210,0x1439,0x2F73,0x0AAD,0x20CC,
- 0x34F1,0x1E50,0x3F7B,0x05FC,0x27B6,0x1A16,0x0390,0x16B9,
- 0x2DD2,0x2244,0x1B99,0x294D,0x0337,0x2E45,0x1EA2,0x08F5,
- 0x1C11,0x333E,0x0CB3,0x3D0D,0x1BAD,0x39D9,0x0BBF,0x32CD,
- 0x267C,0x3585,0x04AE,0x37D6,0x2398,0x1642,0x3BA1,0x1181,
- 0x25B6,0x1C77,0x2D8C,0x0981,0x2B69,0x13CD,0x3F9E,0x2165,
- 0x0352,0x27C4,0x1C12,0x3E45,0x00F6,0x2155,0x2DCD,0x1619,
- 0x2903,0x1CF1,0x0758,0x39F7,0x0AA0,0x35F0,0x0262,0x3EFD,
- 0x2289,0x0911,0x36E4,0x017D,0x3AEB,0x1699,0x2A65,0x1907,
- 0x33B3,0x10C5,0x3855,0x093F,0x19DC,0x2A97,0x11C0,0x31AE,
- 0x152C,0x1F38,0x0BD6,0x3599,0x1759,0x20E5,0x3142,0x0754,
- 0x1824,0x354F,0x0483,0x15C4,0x3D8F,0x2742,0x1389,0x3ACB,
- 0x1611,0x32FB,0x1B31,0x08DD,0x1712,0x26AD,0x3B4D,0x0155,
- 0x3860,0x086D,0x3FCA,0x1585,0x3758,0x11F7,0x3307,0x14D1,
- 0x2C31,0x1E7D,0x022A,0x1FD5,0x3081,0x1597,0x2C67,0x1732,
- 0x2981,0x1242,0x1F54,0x3856,0x0EB6,0x2901,0x1195,0x247C,
- 0x3F78,0x0F2E,0x3765,0x0BAC,0x3A05,0x0154,0x3D61,0x17AD,
- 0x050D,0x293A,0x10DA,0x2CD3,0x0E92,0x35D8,0x1F63,0x3D52,
- 0x12FD,0x014D,0x3299,0x1419,0x3D8C,0x0D93,0x364A,0x23D6,
- 0x38AB,0x05A6,0x2BCD,0x2121,0x0198,0x2255,0x2E48,0x03A2,
- 0x1F9F,0x0D41,0x2D6D,0x1E33,0x0DEE,0x300B,0x063B,0x2086,
- 0x31AF,0x00D8,0x172B,0x3BE1,0x1ED3,0x01EF,0x23B5,0x15A5,
- 0x3AD9,0x0E36,0x336E,0x128E,0x3053,0x1868,0x060C,0x3B88,
- 0x0B8B,0x351E,0x1982,0x2511,0x1F7F,0x10ED,0x2A62,0x13C2,
- 0x346D,0x1A49,0x2578,0x1EEC,0x0F29,0x2FC0,0x1295,0x2677,
- 0x01D7,0x2E8F,0x1C1C,0x2120,0x3F99,0x00CE,0x2706,0x08E1,
- 0x39BB,0x23EE,0x307F,0x1C92,0x00A8,0x3753,0x0C68,0x39C1,
- 0x2A6B,0x117A,0x22DF,0x2EA9,0x19F6,0x0182,0x33EB,0x0A82,
- 0x25BB,0x02F2,0x2EB4,0x1FEE,0x3F36,0x0EE2,0x1F43,0x3265,
- 0x0FF1,0x261A,0x1A02,0x30CE,0x09C7,0x256D,0x0125,0x3989,
- 0x0D58,0x3249,0x16C9,0x2B83,0x0A3D,0x26D4,0x00D9,0x32DB,
- 0x0D0F,0x3D07,0x25FD,0x09DE,0x3339,0x1C7F,0x3A7E,0x00B7,
- 0x183D,0x2959,0x0581,0x2BAC,0x1974,0x258E,0x0D7F,0x226D,
- 0x392B,0x0C21,0x3726,0x1D02,0x3076,0x070E,0x2A5B,0x0B04,
- 0x26C8,0x37D9,0x213F,0x0A6A,0x236A,0x3172,0x15C0,0x00C0,
- 0x16D3,0x2F16,0x1994,0x0A7C,0x37B5,0x0E89,0x191B,0x3DDC,
- 0x1568,0x399D,0x22D4,0x077D,0x3FD4,0x2276,0x1A5A,0x35F3,
- 0x0B49,0x3A36,0x24BB,0x06E6,0x3107,0x1B39,0x3781,0x0860,
- 0x1CED,0x2C99,0x0524,0x2AA3,0x0B13,0x3875,0x24B9,0x1504,
- 0x2A49,0x1231,0x2D3B,0x0010,0x297D,0x3B1E,0x08B3,0x2F30,
- 0x0492,0x2C5A,0x112B,0x3FD4,0x23B4,0x0696,0x379F,0x0AB4,
- 0x3E54,0x225F,0x04BE,0x2BD2,0x1342,0x2FAD,0x16DB,0x2C86,
- 0x1AED,0x0535,0x1312,0x3E4F,0x2304,0x15ED,0x26E2,0x1FA4,
- 0x01FB,0x1E18,0x3374,0x0BC4,0x387D,0x2492,0x111F,0x2DCF,
- 0x183B,0x3C79,0x0F41,0x2966,0x040E,0x301E,0x0BCA,0x23CB,
- 0x1C0B,0x2F7D,0x03E6,0x2367,0x1C47,0x3BC3,0x187D,0x20AE,
- 0x266A,0x068D,0x37DE,0x0F7F,0x3DBB,0x1375,0x3A18,0x1BC3,
- 0x2414,0x0549,0x1995,0x2D59,0x1700,0x0711,0x2A7D,0x1BE6,
- 0x356D,0x1123,0x3BAC,0x21DC,0x105E,0x3646,0x1B9C,0x3108,
- 0x1283,0x2BC8,0x231F,0x011E,0x18A0,0x3AB5,0x139F,0x3362,
- 0x1C54,0x098A,0x1636,0x3A43,0x1972,0x06D0,0x21EE,0x3BBB,
- 0x1FC8,0x0EF0,0x3EA0,0x231E,0x131C,0x338E,0x2964,0x0830,
- 0x2371,0x011F,0x1898,0x3218,0x16D1,0x02BE,0x2BE7,0x1077,
- 0x2A85,0x202A,0x0D8C,0x369F,0x11EF,0x2ABC,0x0FC3,0x31F8,
- 0x25F5,0x1141,0x3C84,0x1A50,0x26D7,0x1E95,0x0DF4,0x32CB,
- 0x03BC,0x3D39,0x0F07,0x3822,0x1346,0x1DF3,0x23F5,0x1905,
- 0x38F6,0x0C4C,0x30D7,0x03B0,0x1B96,0x31BA,0x0EC8,0x2C2F,
- 0x1E9C,0x0FFE,0x3A19,0x0CBA,0x3563,0x06C5,0x3B5A,0x0F7B,
- 0x36A1,0x1E4F,0x2B1B,0x0A2B,0x2D87,0x06AF,0x3BDC,0x0E40,
- 0x2969,0x3DE5,0x0602,0x2C23,0x12FF,0x1E56,0x3FB8,0x0665,
- 0x28B6,0x0B80,0x34E0,0x1C96,0x38B4,0x117C,0x2BAA,0x05F9,
- 0x358D,0x0CC1,0x3C63,0x0E6F,0x3546,0x05A1,0x2EEA,0x1043,
- 0x3E68,0x1A40,0x24B1,0x1F05,0x042D,0x310F,0x223A,0x08EA,
- 0x3640,0x1DB7,0x3916,0x02A4,0x3E1D,0x22AA,0x0C9C,0x3184,
- 0x0806,0x2CA7,0x1EFB,0x0371,0x2E1E,0x0869,0x2AE7,0x0303,
- 0x3C5E,0x079B,0x1622,0x3E0A,0x25EF,0x0BBD,0x2895,0x02DB,
- 0x3ED6,0x23BA,0x2F5B,0x040F,0x2B66,0x1D34,0x3072,0x0B89,
- 0x354D,0x26CF,0x0351,0x2F8F,0x1E57,0x04E7,0x2082,0x360D,
- 0x3096,0x1D04,0x3B57,0x0AA7,0x26EC,0x3721,0x14AE,0x3D83,
- 0x0558,0x19F7,0x2E53,0x15F7,0x2826,0x04AD,0x3D04,0x2070,
- 0x0073,0x3545,0x21A7,0x0990,0x364D,0x02A6,0x3FD4,0x22A5,
- 0x1B7B,0x2033,0x2FA4,0x09CE,0x334B,0x05C8,0x3CAB,0x0DB3,
- 0x2639,0x1FF9,0x17CE,0x3660,0x2A0E,0x138E,0x3BC5,0x21A5,
- 0x05EA,0x2F33,0x1645,0x2836,0x1A7D,0x24E6,0x0C25,0x27C2,
- 0x01CD,0x31D9,0x14FC,0x3A66,0x1915,0x3334,0x1259,0x302C,
- 0x1C8C,0x0B10,0x257F,0x0EAE,0x36DB,0x03B4,0x2108,0x3221,
- 0x1401,0x2FBA,0x2277,0x0755,0x166F,0x335E,0x1883,0x3E06,
- 0x14A1,0x2A5A,0x1761,0x2C8B,0x127E,0x2757,0x0C5D,0x34C4,
- 0x0379,0x2E41,0x0B1A,0x3426,0x2842,0x0E91,0x1904,0x2FB3,
- 0x11FA,0x2AA8,0x10FB,0x285E,0x14D8,0x2E5B,0x1EA0,0x128B,
- 0x3D1A,0x237C,0x0D32,0x3864,0x1CDF,0x3F03,0x1369,0x276A,
- 0x16E8,0x3037,0x218F,0x096E,0x1DF7,0x3118,0x150C,0x2C2A,
- 0x17A4,0x078A,0x1B55,0x3450,0x119C,0x3E5C,0x148C,0x2914,
- 0x0604,0x1A56,0x33D9,0x0D17,0x284F,0x3A62,0x166E,0x0B12,
- 0x10E9,0x2CC9,0x1277,0x2A59,0x1B66,0x0902,0x2FA8,0x0C98,
- 0x22B8,0x387F,0x022D,0x3F3A,0x0AE0,0x2CE5,0x0CC8,0x196B,
- 0x2F70,0x0EDA,0x175D,0x3152,0x14BE,0x2D6B,0x180D,0x0ABA,
- 0x310C,0x062A,0x25C9,0x19FF,0x2115,0x285C,0x16D7,0x3237,
- 0x0115,0x3A4E,0x07BA,0x210D,0x0A01,0x272F,0x0072,0x19C1,
- 0x3932,0x1162,0x34D3,0x024F,0x3CC0,0x146F,0x3402,0x178D,
- 0x3EF7,0x1F61,0x087F,0x2249,0x0323,0x2545,0x1F0B,0x047A,
- 0x3633,0x17A7,0x3AFA,0x1B1B,0x224A,0x30E9,0x174E,0x096F,
- 0x3BAE,0x00DA,0x192A,0x3D5C,0x2686,0x0224,0x29E5,0x0A4F,
- 0x2724,0x001A,0x390F,0x07EF,0x1F62,0x31CB,0x1949,0x2436,
- 0x1E5A,0x1183,0x3940,0x17FC,0x0745,0x3C82,0x2016,0x01F9,
- 0x3F4C,0x06F4,0x338A,0x0AAF,0x372D,0x04EF,0x3966,0x2180,
- 0x01EC,0x17F8,0x31D8,0x166D,0x0B45,0x2301,0x3271,0x0C69,
- 0x29A4,0x1080,0x345C,0x1A61,0x36DF,0x04BA,0x399A,0x0E88,
- 0x35A1,0x1EEF,0x3C7F,0x0AD2,0x2755,0x01C4,0x2CD7,0x0DDE,
- 0x39E7,0x2424,0x1209,0x3C2B,0x17A9,0x09E0,0x2900,0x3F05,
- 0x25F1,0x07D0,0x3807,0x03DC,0x3CCE,0x1DDF,0x252E,0x185A,
- 0x30DA,0x10E4,0x269C,0x1CA8,0x33C6,0x1440,0x39A2,0x22C1,
- 0x07ED,0x3EA5,0x29D2,0x0587,0x3C00,0x08C9,0x2552,0x39C6,
- 0x1582,0x3690,0x1082,0x3EBF,0x027C,0x3756,0x0ACF,0x1CB4,
- 0x2B4A,0x12AF,0x27F0,0x3D26,0x15EA,0x3358,0x1D4B,0x2DB7,
- 0x0B42,0x2607,0x1B57,0x2B30,0x0AB5,0x2EF3,0x0583,0x295A,
- 0x1087,0x2E0D,0x1BAE,0x29B2,0x37E2,0x0F9F,0x3F96,0x27B5,
- 0x0D63,0x2A2D,0x0035,0x2CE9,0x09EE,0x1516,0x3994,0x232E,
- 0x1BA7,0x2168,0x2D99,0x0AF1,0x1F30,0x37CB,0x12BF,0x32B5,
- 0x1A2B,0x2E29,0x15A1,0x23A2,0x3F01,0x021F,0x384C,0x097C,
- 0x3CC9,0x226B,0x006C,0x214B,0x2F31,0x13BD,0x34E7,0x24CB,
- 0x1480,0x295C,0x1A19,0x2527,0x1337,0x27EB,0x0BBA,0x306F,
- 0x1C5B,0x36C3,0x06D4,0x20BF,0x2F89,0x006F,0x1B65,0x367A,
- 0x05DD,0x3B40,0x0210,0x2D3E,0x0DCF,0x2A99,0x1CAE,0x2540,
- 0x003E,0x2D80,0x138F,0x29EB,0x103B,0x3884,0x128D,0x322B,
- 0x1BD8,0x090A,0x2CAC,0x005D,0x24CF,0x32A6,0x1C49,0x0277,
- 0x35BF,0x1F66,0x1453,0x2F53,0x0FCF,0x33A7,0x001E,0x3ABC,
- 0x089C,0x1EB2,0x32BC,0x0743,0x18A8,0x29A1,0x038D,0x31CC,
- 0x1E0C,0x122D,0x1F88,0x244B,0x10AF,0x2ACF,0x1F47,0x0175,
- 0x2E1B,0x0CCD,0x28E4,0x13DB,0x3175,0x160C,0x2252,0x3E50,
- 0x0F50,0x3531,0x1D14,0x0315,0x250C,0x0D39,0x3DF3,0x11FF,
- 0x36C4,0x06EB,0x3EE8,0x0F31,0x23FA,0x1BF4,0x3AF2,0x0D33,
- 0x36FA,0x0438,0x344F,0x0B84,0x16F8,0x31A0,0x0A4B,0x1983,
- 0x38CC,0x136B,0x3537,0x1148,0x3E8D,0x277D,0x0275,0x2BE3,
- 0x0D44,0x3663,0x14A9,0x3A11,0x10C9,0x2411,0x1DF1,0x0504,
- 0x3AC5,0x1092,0x3605,0x0BEE,0x1B17,0x2B5E,0x1615,0x28CB,
- 0x142B,0x3287,0x1B69,0x3B3F,0x0FB8,0x2B10,0x0B5B,0x1BEA,
- 0x3775,0x0D66,0x3B65,0x0010,0x3479,0x1921,0x3FC8,0x11DF,
- 0x2C57,0x0E7B,0x2718,0x3E35,0x12DF,0x3907,0x250B,0x0E24,
- 0x2C91,0x191E,0x25B4,0x1252,0x3FD4,0x175E,0x0A05,0x3BDB,
- 0x2067,0x0CDD,0x37B7,0x0593,0x3340,0x1DEF,0x262D,0x043D,
- 0x2124,0x3FB2,0x15AF,0x3719,0x1DDE,0x070D,0x3915,0x153B,
-};
-
-unsigned short black_sep[] = {
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0081,0x008A,0x0094,0x009F,
- 0x00A9,0x00B4,0x00BE,0x00C9,0x00D4,0x00E0,0x00EB,0x00F6,
- 0x0102,0x010E,0x011A,0x0126,0x0133,0x013F,0x014C,0x0159,
- 0x0166,0x0173,0x0180,0x018E,0x019B,0x01A9,0x01B7,0x01C5,
- 0x01D4,0x01E2,0x01F1,0x0200,0x020F,0x021E,0x022D,0x023C,
- 0x024C,0x025C,0x026C,0x027C,0x028C,0x029C,0x02AD,0x02BE,
- 0x02CF,0x02DF,0x02F1,0x0302,0x0313,0x0325,0x0336,0x0348,
- 0x035A,0x036C,0x037F,0x0391,0x03A3,0x03B6,0x03C9,0x03DC,
- 0x03EF,0x0402,0x0415,0x0428,0x043C,0x044F,0x0463,0x0477,
- 0x048A,0x049E,0x04B2,0x04C7,0x04DB,0x04EF,0x0504,0x0518,
- 0x052D,0x0541,0x0556,0x056B,0x0580,0x0595,0x05AA,0x05BF,
- 0x05D4,0x05EA,0x05FF,0x0614,0x062A,0x063F,0x0655,0x066A,
- 0x0680,0x0696,0x06AC,0x06C1,0x06D7,0x06ED,0x0703,0x0719,
- 0x072F,0x0745,0x075B,0x0771,0x0787,0x079D,0x07B3,0x07C9,
- 0x07E0,0x07F6,0x080C,0x0822,0x0838,0x084F,0x0865,0x087B,
- 0x0891,0x08A7,0x08BE,0x08D4,0x08EA,0x0900,0x0917,0x092D,
- 0x0943,0x0959,0x096F,0x0986,0x099C,0x09B2,0x09C8,0x09DE,
- 0x09F4,0x0A0A,0x0A20,0x0A36,0x0A4C,0x0A62,0x0A78,0x0A8E,
- 0x0AA4,0x0ABA,0x0AD0,0x0AE6,0x0AFB,0x0B11,0x0B27,0x0B3D,
- 0x0B52,0x0B68,0x0B7E,0x0B93,0x0BA9,0x0BBE,0x0BD4,0x0BE9,
- 0x0BFE,0x0C14,0x0C29,0x0C3E,0x0C54,0x0C69,0x0C7E,0x0C93,
- 0x0CA8,0x0CBD,0x0CD2,0x0CE7,0x0CFC,0x0D11,0x0D26,0x0D3B,
- 0x0D50,0x0D64,0x0D79,0x0D8E,0x0DA2,0x0DB7,0x0DCC,0x0DE0,
- 0x0DF4,0x0E09,0x0E1D,0x0E32,0x0E46,0x0E5A,0x0E6E,0x0E83,
- 0x0E97,0x0EAB,0x0EBF,0x0ED3,0x0EE7,0x0EFB,0x0F0F,0x0F23,
- 0x0F36,0x0F4A,0x0F5E,0x0F72,0x0F85,0x0F99,0x0FAD,0x0FC0,
- 0x0FD4,0x0FE7,0x0FFB,0x100E,0x1021,0x1035,0x1048,0x105B,
- 0x106F,0x1082,0x1095,0x10A8,0x10BB,0x10CE,0x10E1,0x10F4,
- 0x1107,0x111A,0x112D,0x1140,0x1153,0x1166,0x1178,0x118B,
- 0x119E,0x11B1,0x11C3,0x11D6,0x11E8,0x11FB,0x120E,0x1220,
- 0x1232,0x1245,0x1257,0x126A,0x127C,0x128E,0x12A1,0x12B3,
- 0x12C5,0x12D8,0x12EA,0x12FC,0x130E,0x1320,0x1332,0x1344,
- 0x1356,0x1368,0x137A,0x138C,0x139E,0x13B0,0x13C2,0x13D4,
- 0x13E6,0x13F8,0x140A,0x141B,0x142D,0x143F,0x1451,0x1462,
- 0x1474,0x1486,0x1497,0x14A9,0x14BB,0x14CC,0x14DE,0x14F0,
- 0x1501,0x1513,0x1524,0x1536,0x1547,0x1559,0x156A,0x157B,
- 0x158D,0x159E,0x15B0,0x15C1,0x15D2,0x15E4,0x15F5,0x1606,
- 0x1618,0x1629,0x163A,0x164B,0x165C,0x166E,0x167F,0x1690,
- 0x16A1,0x16B2,0x16C4,0x16D5,0x16E6,0x16F7,0x1708,0x1719,
- 0x172A,0x173B,0x174C,0x175D,0x176E,0x177F,0x1790,0x17A1,
- 0x17B2,0x17C3,0x17D4,0x17E5,0x17F6,0x1807,0x1818,0x1829,
- 0x183A,0x184B,0x185C,0x186C,0x187D,0x188E,0x189F,0x18B0,
- 0x18C1,0x18D1,0x18E2,0x18F3,0x1904,0x1915,0x1925,0x1936,
- 0x1947,0x1958,0x1968,0x1979,0x198A,0x199B,0x19AB,0x19BC,
- 0x19CD,0x19DD,0x19EE,0x19FF,0x1A10,0x1A20,0x1A31,0x1A41,
- 0x1A52,0x1A63,0x1A73,0x1A84,0x1A95,0x1AA5,0x1AB6,0x1AC7,
- 0x1AD7,0x1AE8,0x1AF8,0x1B09,0x1B1A,0x1B2A,0x1B3B,0x1B4B,
- 0x1B5C,0x1B6C,0x1B7D,0x1B8D,0x1B9E,0x1BAF,0x1BBF,0x1BD0,
- 0x1BE0,0x1BF1,0x1C01,0x1C12,0x1C22,0x1C33,0x1C43,0x1C54,
- 0x1C64,0x1C75,0x1C85,0x1C96,0x1CA6,0x1CB7,0x1CC7,0x1CD8,
- 0x1CE8,0x1CF9,0x1D09,0x1D19,0x1D2A,0x1D3A,0x1D4B,0x1D5B,
- 0x1D6C,0x1D7C,0x1D8D,0x1D9D,0x1DAD,0x1DBE,0x1DCE,0x1DDF,
- 0x1DEF,0x1E00,0x1E10,0x1E20,0x1E31,0x1E41,0x1E52,0x1E62,
- 0x1E72,0x1E83,0x1E93,0x1EA4,0x1EB4,0x1EC4,0x1ED5,0x1EE5,
- 0x1EF5,0x1F06,0x1F16,0x1F27,0x1F37,0x1F47,0x1F58,0x1F68,
- 0x1F78,0x1F89,0x1F99,0x1FAA,0x1FBA,0x1FCA,0x1FDB,0x1FEB,
- 0x1FFB,0x200C,0x201C,0x202C,0x203D,0x204D,0x205D,0x206E,
- 0x207E,0x208E,0x209F,0x20AF,0x20BF,0x20D0,0x20E0,0x20F0,
- 0x2101,0x2111,0x2121,0x2132,0x2142,0x2152,0x2163,0x2173,
- 0x2183,0x2194,0x21A4,0x21B4,0x21C5,0x21D5,0x21E5,0x21F6,
- 0x2206,0x2216,0x2226,0x2237,0x2247,0x2257,0x2268,0x2278,
- 0x2288,0x2299,0x22A9,0x22B9,0x22CA,0x22DA,0x22EA,0x22FA,
- 0x230B,0x231B,0x232B,0x233C,0x234C,0x235C,0x236D,0x237D,
- 0x238D,0x239D,0x23AE,0x23BE,0x23CE,0x23DF,0x23EF,0x23FF,
- 0x240F,0x2420,0x2430,0x2440,0x2451,0x2461,0x2471,0x2481,
- 0x2492,0x24A2,0x24B2,0x24C3,0x24D3,0x24E3,0x24F3,0x2504,
- 0x2514,0x2524,0x2534,0x2545,0x2555,0x2565,0x2576,0x2586,
- 0x2596,0x25A6,0x25B7,0x25C7,0x25D7,0x25E8,0x25F8,0x2608,
- 0x2618,0x2629,0x2639,0x2649,0x2659,0x266A,0x267A,0x268A,
- 0x269A,0x26AB,0x26BB,0x26CB,0x26DC,0x26EC,0x26FC,0x270C,
- 0x271D,0x272D,0x273D,0x274D,0x275E,0x276E,0x277E,0x278E,
- 0x279F,0x27AF,0x27BF,0x27D0,0x27E0,0x27F0,0x2800,0x2811,
- 0x2821,0x2831,0x2841,0x2852,0x2862,0x2872,0x2882,0x2893,
- 0x28A3,0x28B3,0x28C3,0x28D4,0x28E4,0x28F4,0x2905,0x2915,
- 0x2925,0x2935,0x2946,0x2956,0x2966,0x2976,0x2987,0x2997,
- 0x29A7,0x29B7,0x29C8,0x29D8,0x29E8,0x29F8,0x2A09,0x2A19,
- 0x2A29,0x2A39,0x2A4A,0x2A5A,0x2A6A,0x2A7A,0x2A8B,0x2A9B,
- 0x2AAB,0x2ABC,0x2ACC,0x2ADC,0x2AEC,0x2AFD,0x2B0D,0x2B1D,
- 0x2B2D,0x2B3E,0x2B4E,0x2B5E,0x2B6E,0x2B7F,0x2B8F,0x2B9F,
- 0x2BAF,0x2BC0,0x2BD0,0x2BE0,0x2BF0,0x2C01,0x2C11,0x2C21,
- 0x2C31,0x2C42,0x2C52,0x2C62,0x2C72,0x2C83,0x2C93,0x2CA3,
- 0x2CB3,0x2CC4,0x2CD4,0x2CE4,0x2CF4,0x2D05,0x2D15,0x2D25,
- 0x2D35,0x2D46,0x2D56,0x2D66,0x2D76,0x2D87,0x2D97,0x2DA7,
- 0x2DB7,0x2DC8,0x2DD8,0x2DE8,0x2DF9,0x2E09,0x2E19,0x2E29,
- 0x2E3A,0x2E4A,0x2E5A,0x2E6A,0x2E7B,0x2E8B,0x2E9B,0x2EAB,
- 0x2EBC,0x2ECC,0x2EDC,0x2EEC,0x2EFD,0x2F0D,0x2F1D,0x2F2D,
- 0x2F3E,0x2F4E,0x2F5E,0x2F6E,0x2F7F,0x2F8F,0x2F9F,0x2FAF,
- 0x2FC0,0x2FD0,0x2FE0,0x2FF0,0x3001,0x3011,0x3021,0x3031,
- 0x3042,0x3052,0x3062,0x3072,0x3083,0x3093,0x30A3,0x30B3,
- 0x30C4,0x30D4,0x30E4,0x30F4,0x3105,0x3115,0x3125,0x3135,
- 0x3146,0x3156,0x3166,0x3176,0x3187,0x3197,0x31A7,0x31B7,
- 0x31C8,0x31D8,0x31E8,0x31F8,0x3209,0x3219,0x3229,0x3239,
- 0x324A,0x325A,0x326A,0x327A,0x328B,0x329B,0x32AB,0x32BB,
- 0x32CC,0x32DC,0x32EC,0x32FC,0x330D,0x331D,0x332D,0x333D,
- 0x334E,0x335E,0x336E,0x337E,0x338F,0x339F,0x33AF,0x33BF,
- 0x33D0,0x33E0,0x33F0,0x3400,0x3411,0x3421,0x3431,0x3441,
- 0x3452,0x3462,0x3472,0x3482,0x3493,0x34A3,0x34B3,0x34C3,
- 0x34D4,0x34E4,0x34F4,0x3504,0x3515,0x3525,0x3535,0x3545,
- 0x3556,0x3566,0x3576,0x3586,0x3597,0x35A7,0x35B7,0x35C7,
- 0x35D8,0x35E8,0x35F8,0x3608,0x3619,0x3629,0x3639,0x3649,
- 0x365A,0x366A,0x367A,0x368A,0x369B,0x36AB,0x36BB,0x36CB,
- 0x36DC,0x36EC,0x36FC,0x370C,0x371D,0x372D,0x373D,0x374D,
- 0x375E,0x376E,0x377E,0x378E,0x379F,0x37AF,0x37BF,0x37CF,
- 0x37E0,0x37F0,0x3800,0x3810,0x3821,0x3831,0x3841,0x3851,
- 0x3862,0x3872,0x3882,0x3892,0x38A3,0x38B3,0x38C3,0x38D3,
- 0x38E4,0x38F4,0x3904,0x3914,0x3925,0x3935,0x3945,0x3955,
- 0x3966,0x3976,0x3986,0x3996,0x39A7,0x39B7,0x39C7,0x39D7,
- 0x39E8,0x39F8,0x3A08,0x3A18,0x3A29,0x3A39,0x3A49,0x3A59,
- 0x3A6A,0x3A7A,0x3A8A,0x3A9A,0x3AAB,0x3ABB,0x3ACB,0x3ADB,
- 0x3AEC,0x3AFC,0x3B0C,0x3B1C,0x3B2D,0x3B3D,0x3B4D,0x3B5D,
- 0x3B6E,0x3B7E,0x3B8E,0x3B9E,0x3BAF,0x3BBF,0x3BCF,0x3BDF,
- 0x3BF0,0x3C00,0x3C10,0x3C20,0x3C31,0x3C41,0x3C51,0x3C61,
- 0x3C72,0x3C82,0x3C92,0x3CA2,0x3CB3,0x3CC3,0x3CD3,0x3CE3,
- 0x3CF4,0x3D04,0x3D14,0x3D24,0x3D35,0x3D45,0x3D55,0x3D65,
- 0x3D76,0x3D86,0x3D96,0x3DA6,0x3DB7,0x3DC7,0x3DD7,0x3DE7,
- 0x3DF8,0x3E08,0x3E18,0x3E28,0x3E39,0x3E49,0x3E59,0x3E69,
- 0x3E7A,0x3E8A,0x3E9A,0x3EAA,0x3EBB,0x3ECB,0x3EDB,0x3EEB,
- 0x3EFC,0x3F0C,0x3F1C,0x3F2C,0x3F3D,0x3F4D,0x3F5D,0x3F6D,
- 0x3F7E,0x3F8E,0x3F9E,0x3FAE,0x3FBF,0x3FCF,0x3FDF,0x3FEF
-};
-#ifdef __STDC__
-private signed short HtoCMY[]
-#else
-private short HtoCMY[]
-#endif
- = {
- 0xFFAF,0x03E6,0x03E4,0xFFAF,0x03E4,0x03E4,0xFFAF,0x03E1,0x03E4,0xFFAF,0x03DE,0x03E4,
- 0xFFAF,0x03DB,0x03E4,0xFFAF,0x03D7,0x03E4,0xFFAF,0x03D3,0x03E4,0xFFAF,0x03D0,0x03E4,
- 0xFFAF,0x03CC,0x03E4,0xFFAF,0x03C8,0x03E4,0xFFAF,0x03C4,0x03E4,0xFFAF,0x03C0,0x03E4,
- 0xFFAF,0x03BB,0x03E4,0xFFAF,0x03B7,0x03E4,0xFFAF,0x03B3,0x03E4,0xFFAF,0x03AE,0x03E4,
- 0xFFAF,0x03AA,0x03E4,0xFFAF,0x03A5,0x03E3,0xFFAF,0x03A1,0x03E3,0xFFAF,0x039C,0x03E3,
- 0xFFAF,0x0397,0x03E3,0xFFAF,0x0393,0x03E3,0xFFAF,0x038E,0x03E3,0xFFAF,0x0389,0x03E3,
- 0xFFAF,0x0384,0x03E3,0xFFAF,0x037F,0x03E3,0xFFAF,0x037A,0x03E3,0xFFAF,0x0375,0x03E3,
- 0xFFAF,0x0370,0x03E3,0xFFAF,0x036B,0x03E3,0xFFAF,0x0366,0x03E3,0xFFAF,0x0361,0x03E3,
- 0xFFAF,0x035C,0x03E2,0xFFAF,0x0357,0x03E2,0xFFAF,0x0352,0x03E2,0xFFAF,0x034C,0x03E2,
- 0xFFAF,0x0347,0x03E2,0xFFAF,0x0342,0x03E2,0xFFAF,0x033C,0x03E2,0xFFAE,0x0337,0x03E2,
- 0xFFAE,0x0332,0x03E2,0xFFAE,0x032C,0x03E2,0xFFAE,0x0327,0x03E2,0xFFAE,0x0321,0x03E1,
- 0xFFAE,0x031C,0x03E1,0xFFAE,0x0316,0x03E1,0xFFAE,0x0311,0x03E1,0xFFAE,0x030B,0x03E1,
- 0xFFAE,0x0305,0x03E1,0xFFAE,0x0300,0x03E1,0xFFAE,0x02FA,0x03E1,0xFFAE,0x02F4,0x03E1,
- 0xFFAE,0x02EF,0x03E0,0xFFAE,0x02E9,0x03E0,0xFFAE,0x02E3,0x03E0,0xFFAE,0x02DE,0x03E0,
- 0xFFAE,0x02D8,0x03E0,0xFFAE,0x02D2,0x03E0,0xFFAE,0x02CC,0x03E0,0xFFAE,0x02C6,0x03E0,
- 0xFFAE,0x02C0,0x03DF,0xFFAD,0x02BB,0x03DF,0xFFAD,0x02B5,0x03DF,0xFFAD,0x02AF,0x03DF,
- 0xFFAD,0x02A9,0x03DF,0xFFAD,0x02A3,0x03DF,0xFFAD,0x029D,0x03DF,0xFFAD,0x0297,0x03DE,
- 0xFFAD,0x0291,0x03DE,0xFFAD,0x028B,0x03DE,0xFFAD,0x0285,0x03DE,0xFFAD,0x027F,0x03DE,
- 0xFFAD,0x0279,0x03DE,0xFFAD,0x0273,0x03DE,0xFFAD,0x026C,0x03DD,0xFFAC,0x0266,0x03DD,
- 0xFFAC,0x0260,0x03DD,0xFFAC,0x025A,0x03DD,0xFFAC,0x0254,0x03DD,0xFFAC,0x024E,0x03DD,
- 0xFFAC,0x0247,0x03DD,0xFFAC,0x0241,0x03DC,0xFFAC,0x023B,0x03DC,0xFFAC,0x0235,0x03DC,
- 0xFFAC,0x022E,0x03DC,0xFFAC,0x0228,0x03DC,0xFFAC,0x0222,0x03DC,0xFFAB,0x021C,0x03DB,
- 0xFFAB,0x0215,0x03DB,0xFFAB,0x020F,0x03DB,0xFFAB,0x0208,0x03DB,0xFFAB,0x0202,0x03DB,
- 0xFFAB,0x01FC,0x03DB,0xFFAB,0x01F5,0x03DA,0xFFAB,0x01EF,0x03DA,0xFFAB,0x01E8,0x03DA,
- 0xFFAA,0x01E2,0x03DA,0xFFAA,0x01DC,0x03DA,0xFFAA,0x01D5,0x03D9,0xFFAA,0x01CF,0x03D9,
- 0xFFAA,0x01C8,0x03D9,0xFFAA,0x01C2,0x03D9,0xFFAA,0x01BB,0x03D9,0xFFAA,0x01B5,0x03D9,
- 0xFFA9,0x01AE,0x03D8,0xFFA9,0x01A9,0x03D8,0xFFA9,0x01A3,0x03D8,0xFFA9,0x019E,0x03D8,
- 0xFFA9,0x0199,0x03D8,0xFFA9,0x0194,0x03D7,0xFFA9,0x018F,0x03D7,0xFFA9,0x018A,0x03D7,
- 0xFFA8,0x0184,0x03D7,0xFFA8,0x017F,0x03D7,0xFFA8,0x017A,0x03D6,0xFFA8,0x0175,0x03D6,
- 0xFFA8,0x0170,0x03D6,0xFFA8,0x016B,0x03D6,0xFFA8,0x0166,0x03D6,0xFFA7,0x0161,0x03D5,
- 0xFFA7,0x015C,0x03D5,0xFFA7,0x0157,0x03D5,0xFFA7,0x0152,0x03D5,0xFFA7,0x014E,0x03D4,
- 0xFFA7,0x0149,0x03D4,0xFFA6,0x0144,0x03D4,0xFFA6,0x013F,0x03D4,0xFFA6,0x013A,0x03D4,
- 0xFFA6,0x0136,0x03D3,0xFFA6,0x0131,0x03D3,0xFFA6,0x012C,0x03D3,0xFFA5,0x0127,0x03D3,
- 0xFFA5,0x0123,0x03D2,0xFFA5,0x011E,0x03D2,0xFFA5,0x011A,0x03D2,0xFFA5,0x0115,0x03D2,
- 0xFFA5,0x0110,0x03D2,0xFFA4,0x010C,0x03D1,0xFFA4,0x0107,0x03D1,0xFFA4,0x0103,0x03D1,
- 0xFFA4,0x00FE,0x03D1,0xFFA4,0x00FA,0x03D0,0xFFA3,0x00F6,0x03D0,0xFFA3,0x00F1,0x03D0,
- 0xFFA3,0x00ED,0x03D0,0xFFA3,0x00E9,0x03CF,0xFFA3,0x00E4,0x03CF,0xFFA2,0x00E0,0x03CF,
- 0xFFA2,0x00DC,0x03CF,0xFFA2,0x00D8,0x03CE,0xFFA2,0x00D3,0x03CE,0xFFA2,0x00CF,0x03CE,
- 0xFFA1,0x00CB,0x03CE,0xFFA1,0x00C7,0x03CD,0xFFA1,0x00C3,0x03CD,0xFFA1,0x00BF,0x03CD,
- 0xFFA0,0x00BB,0x03CD,0xFFA0,0x00B7,0x03CC,0xFFA0,0x00B3,0x03CC,0xFFA0,0x00AF,0x03CC,
- 0xFFA0,0x00AB,0x03CC,0xFF9F,0x00A7,0x03CB,0xFF9F,0x00A3,0x03CB,0xFF9F,0x00A0,0x03CB,
- 0xFF9F,0x009C,0x03CB,0xFF9E,0x0098,0x03CA,0xFF9E,0x0094,0x03CA,0xFF9E,0x0091,0x03CA,
- 0xFF9E,0x008D,0x03CA,0xFF9D,0x0089,0x03C9,0xFF9D,0x0086,0x03C9,0xFF9D,0x0082,0x03C9,
- 0xFF9D,0x007F,0x03C9,0xFF9C,0x007B,0x03C8,0xFF9C,0x0078,0x03C8,0xFF9C,0x0074,0x03C8,
- 0xFF9C,0x0071,0x03C7,0xFF9B,0x006D,0x03C7,0xFF9B,0x006A,0x03C7,0xFF9B,0x0067,0x03C7,
- 0xFF9A,0x0064,0x03C6,0xFF9A,0x0060,0x03C6,0xFF9A,0x005D,0x03C6,0xFF9A,0x005A,0x03C5,
- 0xFF99,0x0057,0x03C5,0xFF99,0x0054,0x03C5,0xFF99,0x0051,0x03C5,0xFF98,0x004E,0x03C4,
- 0xFF98,0x004B,0x03C4,0xFF98,0x0048,0x03C4,0xFF98,0x0045,0x03C3,0xFF97,0x0042,0x03C3,
- 0xFF97,0x003F,0x03C3,0xFF97,0x003C,0x03C3,0xFF96,0x003A,0x03C2,0xFF96,0x0037,0x03C2,
- 0xFF96,0x0034,0x03C2,0xFF95,0x0032,0x03C1,0xFF95,0x002F,0x03C1,0xFF95,0x002D,0x03C1,
- 0xFF95,0x002A,0x03C1,0xFF94,0x0028,0x03C0,0xFF94,0x0026,0x03C0,0xFF94,0x0023,0x03C0,
- 0xFF93,0x0021,0x03BF,0xFF93,0x001F,0x03BF,0xFF93,0x001D,0x03BF,0xFF92,0x001A,0x03BE,
- 0xFF92,0x0018,0x03BE,0xFF92,0x0016,0x03BE,0xFF91,0x0014,0x03BD,0xFF91,0x0013,0x03BD,
- 0xFF91,0x0011,0x03BD,0xFF90,0x000F,0x03BC,0xFF90,0x000D,0x03BC,0xFF90,0x000C,0x03BC,
- 0xFF8F,0x000A,0x03BC,0xFF8F,0x0009,0x03BB,0xFF8E,0x0007,0x03BB,0xFF8E,0x0006,0x03BB,
- 0xFF8E,0x0005,0x03BA,0xFF8D,0x0004,0x03BA,0xFF8D,0x0003,0x03BA,0xFF8D,0x0002,0x03B9,
- 0xFF8C,0x0001,0x03B9,0xFF8C,0x0000,0x03B9,0xFF8C,0x0000,0x03B8,0xFF8B,0xFFFD,0x03B8,
- 0xFF8B,0xFFFB,0x03B8,0xFF8A,0xFFF8,0x03B7,0xFF8A,0xFFF5,0x03B7,0xFF8A,0xFFF2,0x03B7,
- 0xFF89,0xFFF0,0x03B6,0xFF89,0xFFED,0x03B6,0xFF88,0xFFEA,0x03B6,0xFF88,0xFFE7,0x03B5,
- 0xFF88,0xFFE5,0x03B5,0xFF87,0xFFE2,0x03B5,0xFF87,0xFFDF,0x03B4,0xFF86,0xFFDC,0x03B4,
- 0xFF86,0xFFDA,0x03B4,0xFF88,0xFFD7,0x03B3,0xFF8B,0xFFD4,0x03B3,0xFF8D,0xFFD1,0x03B3,
- 0xFF8F,0xFFCF,0x03B2,0xFF92,0xFFCC,0x03B2,0xFF94,0xFFC9,0x03B2,0xFF96,0xFFC6,0x03B1,
- 0xFF99,0xFFC4,0x03B1,0xFF9B,0xFFC1,0x03B0,0xFF9D,0xFFBE,0x03B0,0xFFA0,0xFFBC,0x03B0,
- 0xFFA2,0xFFB9,0x03AF,0xFFA5,0xFFB6,0x03AF,0xFFA7,0xFFB3,0x03AF,0xFFA9,0xFFB1,0x03AE,
- 0xFFAC,0xFFAE,0x03AE,0xFFAE,0xFFAB,0x03AE,0xFFB0,0xFFA8,0x03AE,0xFFB3,0xFFA6,0x03AE,
- 0xFFB5,0xFFA3,0x03AE,0xFFB7,0xFFA0,0x03AE,0xFFBA,0xFF9D,0x03AE,0xFFBC,0xFF9B,0x03AE,
- 0xFFBE,0xFF98,0x03AE,0xFFC1,0xFF95,0x03AE,0xFFC3,0xFF92,0x03AE,0xFFC5,0xFF90,0x03AE,
- 0xFFC8,0xFF8D,0x03AE,0xFFCA,0xFF8A,0x03AE,0xFFCC,0xFF87,0x03AE,0xFFCF,0xFF85,0x03AE,
- 0xFFD1,0xFF82,0x03AE,0xFFD3,0xFF82,0x03AE,0xFFD6,0xFF81,0x03AE,0xFFD8,0xFF81,0x03AD,
- 0xFFDA,0xFF80,0x03AD,0xFFDD,0xFF80,0x03AD,0xFFDF,0xFF7F,0x03AD,0xFFE2,0xFF7F,0x03AD,
- 0xFFE4,0xFF7E,0x03AD,0xFFE6,0xFF7E,0x03AD,0xFFE9,0xFF7E,0x03AD,0xFFEB,0xFF7D,0x03AD,
- 0xFFED,0xFF7D,0x03AD,0xFFF0,0xFF7C,0x03AD,0xFFF2,0xFF7C,0x03AD,0xFFF4,0xFF7B,0x03AD,
- 0xFFF7,0xFF7B,0x03AD,0xFFF9,0xFF7B,0x03AD,0xFFFB,0xFF7A,0x03AD,0xFFFE,0xFF7A,0x03AD,
- 0x0000,0xFF79,0x03AD,0x0001,0xFF79,0x03AC,0x0001,0xFF78,0x03AC,0x0002,0xFF78,0x03AC,
- 0x0002,0xFF78,0x03AC,0x0003,0xFF77,0x03AC,0x0004,0xFF77,0x03AC,0x0005,0xFF76,0x03AC,
- 0x0006,0xFF76,0x03AC,0x0007,0xFF76,0x03AC,0x0008,0xFF75,0x03AC,0x0009,0xFF75,0x03AC,
- 0x000A,0xFF74,0x03AC,0x000C,0xFF74,0x03AC,0x000D,0xFF74,0x03AC,0x000E,0xFF73,0x03AB,
- 0x000F,0xFF73,0x03AB,0x0011,0xFF72,0x03AB,0x0012,0xFF72,0x03AB,0x0014,0xFF72,0x03AB,
- 0x0015,0xFF71,0x03AB,0x0017,0xFF71,0x03AB,0x0018,0xFF71,0x03AB,0x001A,0xFF70,0x03AB,
- 0x001B,0xFF70,0x03AB,0x001D,0xFF6F,0x03AB,0x001F,0xFF6F,0x03AA,0x0021,0xFF6F,0x03AA,
- 0x0022,0xFF6E,0x03AA,0x0024,0xFF6E,0x03AA,0x0026,0xFF6E,0x03AA,0x0028,0xFF6D,0x03AA,
- 0x002A,0xFF6D,0x03AA,0x002C,0xFF6C,0x03AA,0x002E,0xFF6C,0x03AA,0x0030,0xFF6C,0x03AA,
- 0x0031,0xFF6B,0x03AA,0x0034,0xFF6B,0x03A9,0x0036,0xFF6B,0x03A9,0x0038,0xFF6A,0x03A9,
- 0x003A,0xFF6A,0x03A9,0x003C,0xFF6A,0x03A9,0x003E,0xFF69,0x03A9,0x0040,0xFF69,0x03A9,
- 0x0042,0xFF69,0x03A9,0x0045,0xFF68,0x03A9,0x0047,0xFF68,0x03A8,0x0049,0xFF68,0x03A8,
- 0x004B,0xFF67,0x03A8,0x004E,0xFF67,0x03A8,0x0050,0xFF67,0x03A8,0x0052,0xFF66,0x03A8,
- 0x0055,0xFF66,0x03A8,0x0057,0xFF66,0x03A8,0x005A,0xFF65,0x03A8,0x005C,0xFF65,0x03A8,
- 0x005F,0xFF65,0x03A7,0x0061,0xFF64,0x03A7,0x0064,0xFF64,0x03A7,0x0066,0xFF64,0x03A7,
- 0x0069,0xFF63,0x03A7,0x006B,0xFF63,0x03A7,0x006E,0xFF63,0x03A7,0x0071,0xFF62,0x03A7,
- 0x0073,0xFF62,0x03A6,0x0076,0xFF62,0x03A6,0x0079,0xFF62,0x03A6,0x007B,0xFF61,0x03A6,
- 0x007E,0xFF61,0x03A6,0x0081,0xFF61,0x03A6,0x0084,0xFF60,0x03A6,0x0086,0xFF60,0x03A6,
- 0x0089,0xFF60,0x03A5,0x008C,0xFF5F,0x03A5,0x008F,0xFF5F,0x03A5,0x0092,0xFF5F,0x03A5,
- 0x0095,0xFF5F,0x03A5,0x0097,0xFF5E,0x03A5,0x009A,0xFF5E,0x03A5,0x009D,0xFF5E,0x03A5,
- 0x00A0,0xFF5D,0x03A4,0x00A3,0xFF5D,0x03A4,0x00A6,0xFF5D,0x03A4,0x00A9,0xFF5D,0x03A4,
- 0x00AC,0xFF5C,0x03A4,0x00AF,0xFF5C,0x03A4,0x00B2,0xFF5C,0x03A4,0x00B6,0xFF5C,0x03A3,
- 0x00B9,0xFF5B,0x03A3,0x00BC,0xFF5B,0x03A3,0x00BF,0xFF5B,0x03A3,0x00C2,0xFF5B,0x03A3,
- 0x00C5,0xFF5A,0x03A3,0x00C8,0xFF5A,0x03A3,0x00CC,0xFF5A,0x03A3,0x00CF,0xFF5A,0x03A2,
- 0x00D2,0xFF59,0x03A2,0x00D5,0xFF59,0x03A2,0x00D9,0xFF59,0x03A2,0x00DC,0xFF59,0x03A2,
- 0x00DF,0xFF58,0x03A2,0x00E3,0xFF58,0x03A1,0x00E6,0xFF58,0x03A1,0x00E9,0xFF58,0x03A1,
- 0x00ED,0xFF57,0x03A1,0x00F0,0xFF57,0x03A1,0x00F0,0xFF57,0x03A1,0x00F2,0xFF57,0x03A1,
- 0x00F3,0xFF56,0x03A0,0x00F5,0xFF56,0x03A0,0x00F6,0xFF56,0x03A0,0x00F8,0xFF56,0x03A0,
- 0x00F9,0xFF56,0x03A0,0x00FB,0xFF55,0x03A0,0x00FC,0xFF55,0x03A0,0x00FE,0xFF55,0x039F,
- 0x00FF,0xFF55,0x039F,0x0101,0xFF54,0x039F,0x0102,0xFF54,0x039F,0x0104,0xFF54,0x039F,
- 0x0105,0xFF54,0x039F,0x0106,0xFF54,0x039E,0x0108,0xFF53,0x039E,0x0109,0xFF53,0x039E,
- 0x010B,0xFF53,0x039E,0x010C,0xFF53,0x039E,0x010D,0xFF53,0x039E,0x010F,0xFF52,0x039D,
- 0x0110,0xFF52,0x039D,0x0112,0xFF52,0x039D,0x0113,0xFF52,0x039D,0x0114,0xFF52,0x039D,
- 0x0116,0xFF51,0x039D,0x0117,0xFF51,0x039D,0x0118,0xFF51,0x039C,0x011A,0xFF51,0x039C,
- 0x011B,0xFF51,0x039C,0x011C,0xFF51,0x039C,0x011D,0xFF50,0x039C,0x011F,0xFF50,0x039C,
- 0x0120,0xFF50,0x039B,0x0121,0xFF50,0x039B,0x0123,0xFF50,0x039B,0x0124,0xFF50,0x039B,
- 0x0125,0xFF4F,0x039B,0x0126,0xFF4F,0x039A,0x0127,0xFF4F,0x039A,0x0129,0xFF4F,0x039A,
- 0x012A,0xFF4F,0x039A,0x012B,0xFF4F,0x039A,0x012C,0xFF4E,0x039A,0x012D,0xFF4E,0x0399,
- 0x012E,0xFF4E,0x0399,0x0130,0xFF4E,0x0399,0x0131,0xFF4E,0x0399,0x0132,0xFF4E,0x0399,
- 0x0133,0xFF4E,0x0399,0x0134,0xFF4D,0x0398,0x0135,0xFF4D,0x0398,0x0136,0xFF4D,0x0398,
- 0x0137,0xFF4D,0x0398,0x0138,0xFF4D,0x0398,0x0139,0xFF4D,0x0397,0x013A,0xFF4D,0x0397,
- 0x013B,0xFF4D,0x0397,0x013C,0xFF4C,0x0397,0x013D,0xFF4C,0x0397,0x013E,0xFF4C,0x0397,
- 0x013F,0xFF4C,0x0396,0x0140,0xFF4C,0x0396,0x0141,0xFF4C,0x0396,0x0142,0xFF4C,0x0396,
- 0x0143,0xFF4C,0x0396,0x0144,0xFF4C,0x0395,0x0145,0xFF4B,0x0395,0x0146,0xFF4B,0x0395,
- 0x0147,0xFF4B,0x0395,0x0148,0xFF4B,0x0395,0x0149,0xFF4B,0x0394,0x0149,0xFF4B,0x0394,
- 0x014A,0xFF4B,0x0394,0x014B,0xFF4B,0x0394,0x014C,0xFF4B,0x0394,0x014D,0xFF4B,0x0394,
- 0x014D,0xFF4B,0x0393,0x014E,0xFF4A,0x0393,0x014F,0xFF4A,0x0393,0x0150,0xFF4A,0x0393,
- 0x0150,0xFF4A,0x0393,0x0151,0xFF4A,0x0392,0x0152,0xFF4A,0x0392,0x0153,0xFF4A,0x0392,
- 0x0153,0xFF4A,0x0392,0x0154,0xFF4A,0x0392,0x0155,0xFF4A,0x0391,0x0155,0xFF4A,0x0391,
- 0x0156,0xFF4A,0x0391,0x0156,0xFF4A,0x0391,0x0157,0xFF4A,0x0391,0x0158,0xFF4A,0x0390,
- 0x0158,0xFF4A,0x0390,0x0159,0xFF49,0x0390,0x0159,0xFF49,0x0390,0x015A,0xFF49,0x0390,
- 0x015A,0xFF49,0x038F,0x015B,0xFF49,0x038F,0x015B,0xFF49,0x038F,0x015C,0xFF49,0x038F,
- 0x015C,0xFF49,0x038F,0x015C,0xFF49,0x038E,0x015D,0xFF49,0x038E,0x015D,0xFF49,0x038E,
- 0x015D,0xFF49,0x038E,0x015E,0xFF49,0x038D,0x015E,0xFF49,0x038D,0x015E,0xFF49,0x038D,
- 0x015E,0xFF49,0x038D,0x015F,0xFF49,0x038D,0x015F,0xFF49,0x038C,0x015F,0xFF49,0x038C,
- 0x015F,0xFF49,0x038C,0x015F,0xFF49,0x038C,0x015F,0xFF48,0x038B,0x015F,0xFF48,0x038A,
- 0x015F,0xFF48,0x038A,0x015F,0xFF48,0x0389,0x015F,0xFF47,0x0387,0x015F,0xFF47,0x0386,
- 0x015F,0xFF47,0x0385,0x015F,0xFF47,0x0384,0x015F,0xFF46,0x0382,0x015F,0xFF46,0x0381,
- 0x015F,0xFF46,0x037F,0x015F,0xFF46,0x037E,0x015F,0xFF45,0x037C,0x015F,0xFF45,0x037A,
- 0x015F,0xFF45,0x0378,0x015F,0xFF45,0x0377,0x015F,0xFF44,0x0375,0x015F,0xFF44,0x0373,
- 0x015F,0xFF44,0x0371,0x015F,0xFF44,0x036F,0x015F,0xFF43,0x036C,0x015F,0xFF43,0x036A,
- 0x015F,0xFF43,0x0368,0x015F,0xFF43,0x0366,0x015F,0xFF42,0x0363,0x015F,0xFF42,0x0361,
- 0x015F,0xFF42,0x035F,0x015F,0xFF42,0x035C,0x015F,0xFF41,0x035A,0x015F,0xFF41,0x0357,
- 0x015F,0xFF41,0x0355,0x015F,0xFF41,0x0352,0x015F,0xFF41,0x034F,0x015F,0xFF40,0x034D,
- 0x015F,0xFF40,0x034A,0x015F,0xFF40,0x0347,0x015F,0xFF40,0x0344,0x015F,0xFF3F,0x0341,
- 0x015F,0xFF3F,0x033E,0x015F,0xFF3F,0x033C,0x015F,0xFF3F,0x0339,0x015F,0xFF3F,0x0336,
- 0x015F,0xFF3E,0x0333,0x015F,0xFF3E,0x032F,0x015F,0xFF3E,0x032C,0x015F,0xFF3E,0x0329,
- 0x015E,0xFF3D,0x0326,0x015E,0xFF3D,0x0323,0x015E,0xFF3D,0x0320,0x015E,0xFF3D,0x031C,
- 0x015E,0xFF3D,0x0319,0x015E,0xFF3C,0x0316,0x015E,0xFF3C,0x0312,0x015E,0xFF3C,0x030F,
- 0x015E,0xFF3C,0x030C,0x015E,0xFF3C,0x0308,0x015E,0xFF3B,0x0305,0x015E,0xFF3B,0x0301,
- 0x015E,0xFF3B,0x02FE,0x015E,0xFF3B,0x02FA,0x015E,0xFF3A,0x02F6,0x015E,0xFF3A,0x02F3,
- 0x015E,0xFF3A,0x02EF,0x015E,0xFF3A,0x02EB,0x015E,0xFF3A,0x02E8,0x015E,0xFF39,0x02E4,
- 0x015E,0xFF39,0x02E0,0x015E,0xFF39,0x02DC,0x015E,0xFF39,0x02D9,0x015E,0xFF39,0x02D5,
- 0x015E,0xFF39,0x02D1,0x015E,0xFF38,0x02CD,0x015E,0xFF38,0x02C9,0x015D,0xFF38,0x02C5,
- 0x015D,0xFF38,0x02C1,0x015D,0xFF38,0x02BD,0x015D,0xFF37,0x02B9,0x015D,0xFF37,0x02B5,
- 0x015D,0xFF37,0x02B1,0x015D,0xFF37,0x02AD,0x015D,0xFF37,0x02A8,0x015D,0xFF36,0x02A4,
- 0x015D,0xFF36,0x02A0,0x015D,0xFF36,0x029C,0x015D,0xFF36,0x0298,0x015D,0xFF36,0x0293,
- 0x015D,0xFF36,0x028F,0x015D,0xFF35,0x028B,0x015D,0xFF35,0x0286,0x015D,0xFF35,0x0282,
- 0x015D,0xFF35,0x027E,0x015C,0xFF35,0x0279,0x015C,0xFF35,0x0275,0x015C,0xFF34,0x0270,
- 0x015C,0xFF34,0x026C,0x015C,0xFF34,0x0267,0x015C,0xFF34,0x0263,0x015C,0xFF34,0x025E,
- 0x015C,0xFF34,0x025A,0x015C,0xFF33,0x0255,0x015C,0xFF33,0x0250,0x015C,0xFF33,0x024C,
- 0x015C,0xFF33,0x0247,0x015C,0xFF33,0x0242,0x015C,0xFF33,0x023E,0x015B,0xFF32,0x0239,
- 0x015B,0xFF32,0x0234,0x015B,0xFF32,0x022F,0x015B,0xFF32,0x022A,0x015B,0xFF32,0x0226,
- 0x015B,0xFF32,0x0221,0x015B,0xFF32,0x021C,0x015B,0xFF31,0x0217,0x015B,0xFF31,0x0212,
- 0x015B,0xFF31,0x020D,0x015B,0xFF31,0x0208,0x015A,0xFF31,0x0203,0x015A,0xFF31,0x01FE,
- 0x015A,0xFF31,0x01F9,0x015A,0xFF30,0x01F4,0x015A,0xFF30,0x01EF,0x015A,0xFF30,0x01EA,
- 0x015A,0xFF30,0x01E5,0x015A,0xFF30,0x01E0,0x015A,0xFF30,0x01DB,0x015A,0xFF30,0x01D5,
- 0x015A,0xFF2F,0x01D0,0x0159,0xFF2F,0x01CB,0x0159,0xFF2F,0x01C6,0x0159,0xFF2F,0x01C1,
- 0x0159,0xFF2F,0x01BB,0x0159,0xFF2F,0x01B6,0x0159,0xFF2F,0x01B1,0x0159,0xFF2F,0x01AB,
- 0x0159,0xFF2E,0x01A6,0x0159,0xFF2E,0x01A1,0x0158,0xFF2E,0x019C,0x0158,0xFF2E,0x0197,
- 0x0158,0xFF2E,0x0193,0x0158,0xFF2E,0x018E,0x0158,0xFF2E,0x0189,0x0158,0xFF2E,0x0184,
- 0x0158,0xFF2E,0x017F,0x0158,0xFF2D,0x017A,0x0157,0xFF2D,0x0176,0x0157,0xFF2D,0x0171,
- 0x0157,0xFF2D,0x016C,0x0157,0xFF2D,0x0167,0x0157,0xFF2D,0x0163,0x0157,0xFF2D,0x015E,
- 0x0157,0xFF2D,0x0159,0x0157,0xFF2D,0x0155,0x0156,0xFF2C,0x0150,0x0156,0xFF2C,0x014B,
- 0x0156,0xFF2C,0x0147,0x0156,0xFF2C,0x0142,0x0156,0xFF2C,0x013E,0x0156,0xFF2C,0x0139,
- 0x0156,0xFF2C,0x0134,0x0155,0xFF2C,0x0130,0x0155,0xFF2C,0x012B,0x0155,0xFF2C,0x0127,
- 0x0155,0xFF2B,0x0122,0x0155,0xFF2B,0x011E,0x0155,0xFF2B,0x0119,0x0155,0xFF2B,0x0115,
- 0x0154,0xFF2B,0x0110,0x0154,0xFF2B,0x010C,0x0154,0xFF2B,0x0108,0x0154,0xFF2B,0x0103,
- 0x0154,0xFF2B,0x00FF,0x0154,0xFF2B,0x00FB,0x0154,0xFF2B,0x00F6,0x0153,0xFF2B,0x00F2,
- 0x0153,0xFF2A,0x00EE,0x0153,0xFF2A,0x00E9,0x0153,0xFF2A,0x00E5,0x0153,0xFF2A,0x00E1,
- 0x0153,0xFF2A,0x00DD,0x0152,0xFF2A,0x00D8,0x0152,0xFF2A,0x00D4,0x0152,0xFF2A,0x00D0,
- 0x0152,0xFF2A,0x00CC,0x0152,0xFF2A,0x00C8,0x0152,0xFF2A,0x00C4,0x0151,0xFF2A,0x00C0,
- 0x0151,0xFF2A,0x00BB,0x0151,0xFF2A,0x00B7,0x0151,0xFF29,0x00B3,0x0151,0xFF29,0x00AF,
- 0x0150,0xFF29,0x00AB,0x0150,0xFF29,0x00A7,0x0150,0xFF29,0x00A3,0x0150,0xFF29,0x00A0,
- 0x0150,0xFF29,0x009C,0x0150,0xFF29,0x0098,0x014F,0xFF29,0x0094,0x014F,0xFF29,0x0090,
- 0x014F,0xFF29,0x008C,0x014F,0xFF29,0x0088,0x014F,0xFF29,0x0085,0x014E,0xFF29,0x0081,
- 0x014E,0xFF29,0x007D,0x014E,0xFF29,0x007A,0x014E,0xFF29,0x0076,0x014E,0xFF29,0x0072,
- 0x014D,0xFF29,0x006F,0x014D,0xFF29,0x006B,0x014D,0xFF28,0x0068,0x014D,0xFF28,0x0064,
- 0x014D,0xFF28,0x0060,0x014C,0xFF28,0x005D,0x014C,0xFF28,0x005A,0x014C,0xFF28,0x0056,
- 0x014C,0xFF28,0x0053,0x014B,0xFF28,0x004F,0x014B,0xFF28,0x004C,0x014B,0xFF28,0x0049,
- 0x014B,0xFF28,0x0046,0x014B,0xFF28,0x0042,0x014A,0xFF28,0x003F,0x014A,0xFF28,0x003C,
- 0x014A,0xFF28,0x0039,0x014A,0xFF28,0x0036,0x0149,0xFF28,0x0033,0x0149,0xFF28,0x0030,
- 0x0149,0xFF28,0x002D,0x0149,0xFF28,0x002A,0x0149,0xFF28,0x0027,0x0148,0xFF28,0x0024,
- 0x0148,0xFF28,0x0022,0x0148,0xFF28,0x001F,0x0148,0xFF28,0x001C,0x0147,0xFF28,0x001A,
- 0x0147,0xFF28,0x0017,0x0147,0xFF2B,0x0015,0x0147,0xFF2E,0x0012,0x0146,0xFF31,0x0010,
- 0x0146,0xFF33,0x000E,0x0146,0xFF36,0x000B,0x0146,0xFF39,0x0009,0x0145,0xFF3C,0x0007,
- 0x0145,0xFF3F,0x0006,0x0145,0xFF42,0x0004,0x0145,0xFF44,0x0002,0x0144,0xFF47,0x0001,
- 0x0144,0xFF4A,0x0000,0x0144,0xFF4D,0xFFF7,0x0144,0xFF50,0xFFEE,0x0143,0xFF53,0xFFE5,
- 0x0143,0xFF55,0xFFDD,0x0143,0xFF58,0xFFD4,0x0143,0xFF5B,0xFFCC,0x0142,0xFF5E,0xFFC3,
- 0x0142,0xFF61,0xFFBB,0x0146,0xFF64,0xFFB3,0x0149,0xFF67,0xFFAB,0x014D,0xFF69,0xFFA2,
- 0x0151,0xFF6C,0xFF9B,0x0154,0xFF6F,0xFF93,0x0158,0xFF72,0xFF8B,0x015C,0xFF75,0xFF83,
- 0x015F,0xFF78,0xFF7C,0x0163,0xFF7A,0xFF75,0x0166,0xFF7D,0xFF6D,0x016A,0xFF80,0xFF66,
- 0x016E,0xFF83,0xFF5F,0x0171,0xFF86,0xFF58,0x0175,0xFF89,0xFF52,0x0178,0xFF8B,0xFF4B,
- 0x017C,0xFF8E,0xFF44,0x0180,0xFF91,0xFF3E,0x0183,0xFF94,0xFF38,0x0187,0xFF97,0xFF32,
- 0x018A,0xFF9A,0xFF2C,0x018E,0xFF9D,0xFF26,0x0191,0xFF9F,0xFF21,0x0195,0xFFA2,0xFF1B,
- 0x0199,0xFFA5,0xFF16,0x019C,0xFFA8,0xFF11,0x01A0,0xFFAB,0xFF0C,0x01A3,0xFFAE,0xFF08,
- 0x01A7,0xFFB0,0xFF04,0x01AA,0xFFB3,0xFF00,0x01AE,0xFFB6,0xFEFC,0x01B1,0xFFB9,0xFEF9,
- 0x01B5,0xFFBC,0xFEF6,0x01B8,0xFFBF,0xFEF3,0x01BC,0xFFC1,0xFEF2,0x01BF,0xFFC4,0xFEF2,
- 0x01C2,0xFFC7,0xFEF1,0x01C6,0xFFCA,0xFEF1,0x01C9,0xFFCD,0xFEF0,0x01CD,0xFFD0,0xFEF0,
- 0x01D0,0xFFD3,0xFEEF,0x01D4,0xFFD5,0xFEEF,0x01D7,0xFFD8,0xFEEE,0x01DB,0xFFDB,0xFEEE,
- 0x01DE,0xFFDE,0xFEED,0x01E1,0xFFE1,0xFEED,0x01E5,0xFFE4,0xFEEC,0x01E8,0xFFE6,0xFEEC,
- 0x01EC,0xFFE9,0xFEEB,0x01EF,0xFFEC,0xFEEB,0x01F2,0xFFEF,0xFEEA,0x01F6,0xFFF2,0xFEEA,
- 0x01F9,0xFFF5,0xFEEA,0x01FC,0xFFF7,0xFEE9,0x0200,0xFFFA,0xFEE9,0x0203,0xFFFD,0xFEE8,
- 0x0206,0x0000,0xFEE8,0x020A,0x0000,0xFEE7,0x020D,0x0000,0xFEE7,0x0210,0x0001,0xFEE6,
- 0x0214,0x0001,0xFEE6,0x0217,0x0002,0xFEE6,0x021A,0x0002,0xFEE5,0x021E,0x0003,0xFEE5,
- 0x0221,0x0004,0xFEE4,0x0224,0x0004,0xFEE4,0x0227,0x0005,0xFEE4,0x022B,0x0006,0xFEE3,
- 0x022E,0x0007,0xFEE3,0x0231,0x0008,0xFEE2,0x0234,0x0009,0xFEE2,0x0238,0x000A,0xFEE1,
- 0x023B,0x000B,0xFEE1,0x023E,0x000C,0xFEE1,0x0241,0x000D,0xFEE0,0x0244,0x000E,0xFEE0,
- 0x0248,0x000F,0xFEE0,0x024B,0x0010,0xFEDF,0x024E,0x0011,0xFEDF,0x0251,0x0012,0xFEDE,
- 0x0254,0x0013,0xFEDE,0x0257,0x0015,0xFEDE,0x025B,0x0016,0xFEDD,0x025E,0x0017,0xFEDD,
- 0x0261,0x0018,0xFEDD,0x0264,0x001A,0xFEDC,0x0267,0x001B,0xFEDC,0x026A,0x001C,0xFEDB,
- 0x026D,0x001E,0xFEDB,0x0270,0x001F,0xFEDB,0x0274,0x0021,0xFEDA,0x0277,0x0022,0xFEDA,
- 0x027A,0x0024,0xFEDA,0x027D,0x0025,0xFED9,0x0280,0x0027,0xFED9,0x0283,0x0028,0xFED9,
- 0x0286,0x002A,0xFED8,0x0289,0x002B,0xFED8,0x028C,0x002D,0xFED8,0x028F,0x002E,0xFED7,
- 0x0292,0x0030,0xFED7,0x0295,0x0032,0xFED7,0x0298,0x0033,0xFED6,0x029B,0x0035,0xFED6,
- 0x029E,0x0037,0xFED6,0x02A1,0x0039,0xFED5,0x02A4,0x003A,0xFED5,0x02A7,0x003C,0xFED5,
- 0x02AA,0x003E,0xFED4,0x02AD,0x0040,0xFED4,0x02B0,0x0041,0xFED4,0x02B3,0x0043,0xFED4,
- 0x02B6,0x0045,0xFED3,0x02B9,0x0047,0xFED3,0x02BC,0x0049,0xFED3,0x02BE,0x004B,0xFED2,
- 0x02C1,0x004D,0xFED2,0x02C4,0x004E,0xFED2,0x02C7,0x0050,0xFED2,0x02CA,0x0052,0xFED1,
- 0x02CD,0x0054,0xFED1,0x02D0,0x0056,0xFED1,0x02D2,0x0058,0xFED0,0x02D5,0x005A,0xFED0,
- 0x02D8,0x005C,0xFED0,0x02DB,0x005E,0xFED0,0x02DE,0x0060,0xFECF,0x02E1,0x0063,0xFECF,
- 0x02E3,0x0065,0xFECF,0x02E6,0x0067,0xFECF,0x02E9,0x0069,0xFECE,0x02EC,0x006B,0xFECE,
- 0x02EE,0x006D,0xFECE,0x02F1,0x006F,0xFECE,0x02F4,0x0071,0xFECD,0x02F7,0x0074,0xFECD,
- 0x02F9,0x0076,0xFECD,0x02FC,0x0078,0xFECD,0x02FF,0x007A,0xFECC,0x0301,0x007D,0xFECC,
- 0x0304,0x007F,0xFECC,0x0307,0x0081,0xFECC,0x0309,0x0083,0xFECC,0x030C,0x0086,0xFECB,
- 0x030F,0x0088,0xFECB,0x0311,0x008A,0xFECB,0x0314,0x008D,0xFECB,0x0317,0x008F,0xFECA,
- 0x0319,0x0091,0xFECA,0x031C,0x0094,0xFECA,0x031E,0x0096,0xFECA,0x0321,0x0099,0xFECA,
- 0x0324,0x009B,0xFEC9,0x0326,0x009D,0xFEC9,0x0329,0x00A0,0xFEC9,0x032B,0x00A2,0xFEC9,
- 0x032E,0x00A5,0xFEC9,0x0330,0x00A7,0xFEC8,0x0333,0x00AA,0xFEC8,0x0335,0x00AC,0xFEC8,
- 0x0338,0x00AF,0xFEC8,0x033A,0x00B1,0xFEC8,0x033D,0x00B4,0xFEC8,0x033F,0x00B6,0xFEC7,
- 0x0342,0x00B9,0xFEC7,0x0344,0x00BB,0xFEC7,0x0346,0x00BE,0xFEC7,0x0349,0x00C1,0xFEC7,
- 0x034B,0x00C3,0xFEC7,0x034E,0x00C6,0xFEC6,0x0350,0x00C9,0xFEC6,0x0352,0x00CB,0xFEC6,
- 0x0355,0x00CE,0xFEC6,0x0357,0x00D1,0xFEC6,0x0359,0x00D3,0xFEC6,0x035C,0x00D6,0xFEC5,
- 0x035E,0x00D9,0xFEC5,0x0360,0x00DB,0xFEC5,0x0363,0x00DE,0xFEC5,0x0365,0x00E1,0xFEC5,
- 0x0367,0x00E3,0xFEC5,0x036A,0x00E6,0xFEC5,0x036C,0x00E9,0xFEC4,0x036E,0x00EC,0xFEC4,
- 0x0370,0x00EF,0xFEC4,0x0372,0x00F1,0xFEC4,0x0375,0x00F4,0xFEC4,0x0377,0x00F7,0xFEC4,
- 0x0379,0x00FA,0xFEC4,0x037B,0x00FD,0xFEC4,0x037D,0x0100,0xFEC3,0x037F,0x0102,0xFEC3,
- 0x0382,0x0105,0xFEC3,0x0384,0x0108,0xFEC3,0x0386,0x010B,0xFEC3,0x0388,0x010E,0xFEC3,
- 0x038A,0x0111,0xFEC3,0x038C,0x0114,0xFEC3,0x038E,0x0117,0xFEC3,0x0390,0x011A,0xFEC3,
- 0x0392,0x011D,0xFEC2,0x0394,0x0120,0xFEC2,0x0396,0x0123,0xFEC2,0x0398,0x0126,0xFEC2,
- 0x039A,0x0129,0xFEC2,0x039C,0x012C,0xFEC2,0x039E,0x012F,0xFEC2,0x03A0,0x0132,0xFEC2,
- 0x03A1,0x0135,0xFEC2,0x03A3,0x0138,0xFEC2,0x03A5,0x013B,0xFEC2,0x03A7,0x013E,0xFEC1,
- 0x03A9,0x0141,0xFEC1,0x03AB,0x0144,0xFEC1,0x03AC,0x0147,0xFEC1,0x03AE,0x014A,0xFEC1,
- 0x03B0,0x014D,0xFEC1,0x03B2,0x0151,0xFEC1,0x03B3,0x0154,0xFEC1,0x03B5,0x0157,0xFEC1,
- 0x03B7,0x015A,0xFEC1,0x03B9,0x015D,0xFEC1,0x03BA,0x0160,0xFEC1,0x03BC,0x0164,0xFEC1,
- 0x03BD,0x0167,0xFEC1,0x03BF,0x016A,0xFEC1,0x03C1,0x016D,0xFEC1,0x03C2,0x0170,0xFEC1,
- 0x03C4,0x0174,0xFEC1,0x03C5,0x0177,0xFEC0,0x03C7,0x017A,0xFEC0,0x03C8,0x017D,0xFEC0,
- 0x03CA,0x0181,0xFEC0,0x03CB,0x0184,0xFEC0,0x03CC,0x0187,0xFEC0,0x03CE,0x018B,0xFEC0,
- 0x03CF,0x018E,0xFEC0,0x03D0,0x0191,0xFEC0,0x03D2,0x0195,0xFEC0,0x03D3,0x0198,0xFEC0,
- 0x03D4,0x019B,0xFEC0,0x03D5,0x019F,0xFEC0,0x03D7,0x01A2,0xFEC0,0x03D8,0x01A5,0xFEC0,
- 0x03D9,0x01A9,0xFEC0,0x03DA,0x01AC,0xFEC0,0x03DB,0x01AF,0xFEC0,0x03DC,0x01B3,0xFEC0,
- 0x03DD,0x01B6,0xFEC0,0x03DE,0x01BA,0xFEC0,0x03DE,0x01BD,0xFEC0,0x03DF,0x01C1,0xFEC0,
- 0x03E0,0x01C4,0xFEC0,0x03E1,0x01C8,0xFEC0,0x03E1,0x01CB,0xFEC0,0x03E2,0x01CF,0xFEC0,
- 0x03E2,0x01D2,0xFEC0,0x03E1,0x01D3,0xFEC0,0x03DF,0x01D5,0xFEC0,0x03DD,0x01D6,0xFEC0,
- 0x03DB,0x01D8,0xFEC0,0x03D9,0x01D9,0xFEC0,0x03D6,0x01DB,0xFEC0,0x03D4,0x01DC,0xFEC0,
- 0x03D1,0x01DD,0xFEC0,0x03CE,0x01DF,0xFEC0,0x03CB,0x01E0,0xFEC0,0x03C8,0x01E2,0xFEC0,
- 0x03C5,0x01E3,0xFEC0,0x03C2,0x01E4,0xFEC0,0x03BF,0x01E6,0xFEC0,0x03BC,0x01E7,0xFEC0,
- 0x03B8,0x01E9,0xFEC0,0x03B5,0x01EA,0xFEC0,0x03B1,0x01EB,0xFEC0,0x03AE,0x01ED,0xFEC0,
- 0x03AA,0x01EE,0xFEC0,0x03A7,0x01EF,0xFEC1,0x03A3,0x01F1,0xFEC1,0x039F,0x01F2,0xFEC1,
- 0x039B,0x01F4,0xFEC1,0x0398,0x01F5,0xFEC1,0x0394,0x01F6,0xFEC1,0x0390,0x01F8,0xFEC1,
- 0x038C,0x01F9,0xFEC1,0x0388,0x01FA,0xFEC1,0x0384,0x01FC,0xFEC1,0x0380,0x01FD,0xFEC1,
- 0x037B,0x01FE,0xFEC1,0x0377,0x0200,0xFEC2,0x0373,0x0201,0xFEC2,0x036F,0x0202,0xFEC2,
- 0x036B,0x0204,0xFEC2,0x0366,0x0205,0xFEC2,0x0362,0x0206,0xFEC2,0x035D,0x0207,0xFEC2,
- 0x0359,0x0209,0xFEC2,0x0354,0x020A,0xFEC3,0x0350,0x020B,0xFEC3,0x034B,0x020D,0xFEC3,
- 0x0347,0x020E,0xFEC3,0x0342,0x020F,0xFEC3,0x033E,0x0210,0xFEC3,0x0339,0x0212,0xFEC4,
- 0x0334,0x0213,0xFEC4,0x0330,0x0214,0xFEC4,0x032B,0x0216,0xFEC4,0x0326,0x0217,0xFEC4,
- 0x0321,0x0218,0xFEC4,0x031C,0x0219,0xFEC5,0x0318,0x021B,0xFEC5,0x0313,0x021C,0xFEC5,
- 0x030E,0x021D,0xFEC5,0x0309,0x021E,0xFEC6,0x0304,0x0220,0xFEC6,0x02FF,0x0221,0xFEC6,
- 0x02FA,0x0222,0xFEC6,0x02F5,0x0223,0xFEC6,0x02F0,0x0224,0xFEC7,0x02EB,0x0226,0xFEC7,
- 0x02E6,0x0227,0xFEC7,0x02E0,0x0228,0xFEC8,0x02DB,0x0229,0xFEC8,0x02D6,0x022A,0xFEC8,
- 0x02D1,0x022C,0xFEC8,0x02CC,0x022D,0xFEC9,0x02C6,0x022E,0xFEC9,0x02C1,0x022F,0xFEC9,
- 0x02BC,0x0230,0xFEC9,0x02B6,0x0232,0xFECA,0x02B1,0x0233,0xFECA,0x02AC,0x0234,0xFECA,
- 0x02A6,0x0235,0xFECB,0x02A1,0x0236,0xFECB,0x029C,0x0237,0xFECB,0x0296,0x0239,0xFECC,
- 0x0291,0x023A,0xFECC,0x028B,0x023B,0xFECC,0x0286,0x023C,0xFECD,0x0280,0x023D,0xFECD,
- 0x027A,0x023E,0xFECE,0x0275,0x023F,0xFECE,0x026F,0x0241,0xFECE,0x026A,0x0242,0xFECF,
- 0x0264,0x0243,0xFECF,0x025E,0x0244,0xFECF,0x0259,0x0245,0xFED0,0x0253,0x0246,0xFED0,
- 0x024D,0x0247,0xFED1,0x0248,0x0248,0xFED1,0x0242,0x0249,0xFED2,0x023C,0x024A,0xFED2,
- 0x0236,0x024C,0xFED2,0x0231,0x024D,0xFED3,0x022B,0x024E,0xFED3,0x0225,0x024F,0xFED4,
- 0x021F,0x0250,0xFED4,0x0219,0x0251,0xFED5,0x0213,0x0252,0xFED5,0x020D,0x0253,0xFED6,
- 0x0207,0x0254,0xFED6,0x0202,0x0255,0xFED7,0x01FC,0x0256,0xFED7,0x01F6,0x0257,0xFED8,
- 0x01F0,0x0258,0xFED8,0x01EA,0x0259,0xFED9,0x01E4,0x025A,0xFED9,0x01DE,0x025B,0xFEDA,
- 0x01D7,0x025C,0xFEDA,0x01D1,0x025D,0xFEDB,0x01CB,0x025E,0xFEDB,0x01C5,0x025F,0xFEDC,
- 0x01BF,0x0260,0xFEDC,0x01B9,0x0261,0xFEDD,0x01B3,0x0262,0xFEDE,0x01AD,0x0263,0xFEDE,
- 0x01A6,0x0264,0xFEDF,0x01A0,0x0265,0xFEDF,0x019A,0x0266,0xFEE0,0x0195,0x0267,0xFEE1,
- 0x0190,0x0268,0xFEE1,0x018B,0x0269,0xFEE2,0x0186,0x026A,0xFEE2,0x0181,0x026B,0xFEE3,
- 0x017C,0x026C,0xFEE4,0x0177,0x026D,0xFEE4,0x0172,0x026E,0xFEE5,0x016E,0x026F,0xFEE6,
- 0x0169,0x0270,0xFEE6,0x0164,0x0271,0xFEE7,0x015F,0x0272,0xFEE8,0x015A,0x0273,0xFEE8,
- 0x0156,0x0274,0xFEE9,0x0151,0x0274,0xFEEA,0x014C,0x0275,0xFEEA,0x0148,0x0276,0xFEEB,
- 0x0143,0x0277,0xFEEC,0x013E,0x0278,0xFEED,0x013A,0x0279,0xFEED,0x0135,0x027A,0xFEEE,
- 0x0131,0x027B,0xFEEF,0x012C,0x027C,0xFEEF,0x0128,0x027C,0xFEF0,0x0123,0x027D,0xFEF1,
- 0x011F,0x027E,0xFEF2,0x011A,0x027F,0xFEF3,0x0116,0x0280,0xFEF3,0x0112,0x0281,0xFEF4,
- 0x010D,0x0282,0xFEF5,0x0109,0x0282,0xFEF6,0x0105,0x0283,0xFEF7,0x0101,0x0284,0xFEF7,
- 0x00FC,0x0285,0xFEF8,0x00F8,0x0286,0xFEF9,0x00F4,0x0287,0xFEFA,0x00F0,0x0287,0xFEFB,
- 0x00EC,0x0288,0xFEFC,0x00E8,0x0289,0xFEFC,0x00E4,0x028A,0xFEFD,0x00E0,0x028A,0xFEFE,
- 0x00DC,0x028B,0xFEFF,0x00D8,0x028C,0xFF00,0x00D4,0x028D,0xFF01,0x00D0,0x028E,0xFF02,
- 0x00CC,0x028E,0xFF03,0x00C8,0x028F,0xFF04,0x00C4,0x0290,0xFF04,0x00C0,0x0291,0xFF05,
- 0x00BD,0x0291,0xFF06,0x00B9,0x0292,0xFF07,0x00B5,0x0293,0xFF08,0x00B1,0x0294,0xFF09,
- 0x00AE,0x0294,0xFF0A,0x00AA,0x0295,0xFF0B,0x00A6,0x0296,0xFF0C,0x00A3,0x0296,0xFF0D,
- 0x009F,0x0297,0xFF0E,0x009C,0x0298,0xFF0F,0x0098,0x0298,0xFF10,0x0095,0x0299,0xFF11,
- 0x0091,0x029A,0xFF12,0x008E,0x029A,0xFF13,0x008B,0x029B,0xFF14,0x0087,0x029C,0xFF15,
- 0x0084,0x029C,0xFF16,0x0081,0x029D,0xFF17,0x007D,0x029E,0xFF18,0x007A,0x029E,0xFF1A,
- 0x0077,0x029F,0xFF1B,0x0074,0x02A0,0xFF1C,0x0071,0x02A0,0xFF1D,0x006E,0x02A1,0xFF1E,
- 0x006B,0x02A1,0xFF1F,0x0068,0x02A2,0xFF20,0x0065,0x02A3,0xFF21,0x0062,0x02A3,0xFF22,
- 0x005F,0x02A4,0xFF24,0x005C,0x02A4,0xFF25,0x0059,0x02A5,0xFF26,0x0056,0x02A5,0xFF27,
- 0x0053,0x02A6,0xFF28,0x0051,0x02A7,0xFF29,0x004E,0x02A7,0xFF2B,0x004B,0x02A8,0xFF2C,
- 0x0048,0x02A8,0xFF2D,0x0046,0x02A9,0xFF2E,0x0043,0x02A9,0xFF2F,0x0041,0x02AA,0xFF31,
- 0x003E,0x02AA,0xFF32,0x003C,0x02AB,0xFF33,0x0039,0x02AB,0xFF34,0x0037,0x02AC,0xFF36,
- 0x0035,0x02AC,0xFF37,0x0032,0x02AD,0xFF38,0x0030,0x02AD,0xFF39,0x002E,0x02AE,0xFF3B,
- 0x002C,0x02AE,0xFF3C,0x0029,0x02AE,0xFF3D,0x0027,0x02AF,0xFF3F,0x0025,0x02AF,0xFF40,
- 0x0023,0x02B0,0xFF41,0x0021,0x02B0,0xFF42,0x001F,0x02B1,0xFF44,0x001D,0x02B1,0xFF45,
- 0x001B,0x02B1,0xFF47,0x001A,0x02B2,0xFF48,0x0018,0x02B2,0xFF49,0x0016,0x02B2,0xFF4B,
- 0x0015,0x02B3,0xFF4C,0x0013,0x02B3,0xFF4F,0x0011,0x02B3,0xFF52,0x0010,0x02B4,0xFF55,
- 0x000E,0x02B4,0xFF58,0x000D,0x02B4,0xFF5B,0x000C,0x02B5,0xFF5D,0x000A,0x02B5,0xFF60,
- 0x0009,0x02B5,0xFF63,0x0008,0x02B6,0xFF66,0x0007,0x02B6,0xFF69,0x0006,0x02B6,0xFF6C,
- 0x0005,0x02B6,0xFF6F,0x0004,0x02B7,0xFF72,0x0003,0x02B7,0xFF75,0x0002,0x02B7,0xFF78,
- 0x0002,0x02B7,0xFF7A,0x0001,0x02B7,0xFF7D,0x0001,0x02B7,0xFF80,0x0000,0x02B8,0xFF83,
- 0x0000,0x02B8,0xFF86,0xFFFD,0x02B8,0xFF89,0xFFFA,0x02B8,0xFF8C,0xFFF7,0x02B8,0xFF8F,
- 0xFFF4,0x02B8,0xFF92,0xFFF1,0x02BA,0xFF95,0xFFEE,0x02BC,0xFF97,0xFFEB,0x02BE,0xFF9A,
- 0xFFE9,0x02C0,0xFF9D,0xFFE6,0x02C1,0xFFA0,0xFFE3,0x02C3,0xFFA3,0xFFE0,0x02C5,0xFFA6,
- 0xFFDD,0x02C7,0xFFA9,0xFFDB,0x02C9,0xFFAC,0xFFD8,0x02CB,0xFFAF,0xFFD5,0x02CC,0xFFB2,
- 0xFFD3,0x02CE,0xFFB5,0xFFD0,0x02D0,0xFFB7,0xFFCE,0x02D2,0xFFBA,0xFFCB,0x02D4,0xFFBD,
- 0xFFC9,0x02D6,0xFFC0,0xFFC6,0x02D7,0xFFC3,0xFFC4,0x02D9,0xFFC6,0xFFC2,0x02DB,0xFFC9,
- 0xFFBF,0x02DD,0xFFCC,0xFFBD,0x02DF,0xFFCF,0xFFBB,0x02E0,0xFFD2,0xFFB9,0x02E2,0xFFD4,
- 0xFFB6,0x02E4,0xFFD7,0xFFB4,0x02E6,0xFFDA,0xFFB2,0x02E8,0xFFDD,0xFFB0,0x02E9,0xFFE0,
- 0xFFAE,0x02EB,0xFFE3,0xFFAD,0x02ED,0xFFE6,0xFFAB,0x02EF,0xFFE9,0xFFA9,0x02F0,0xFFEC,
- 0xFFA8,0x02F2,0xFFEF,0xFFA6,0x02F4,0xFFF1,0xFFA5,0x02F6,0xFFF4,0xFFA4,0x02F7,0xFFF7,
- 0xFFA3,0x02F9,0xFFFA,0xFFA3,0x02FB,0xFFFD,0xFFA3,0x02FC,0x0000,0xFFA3,0x02FE,0x0000,
- 0xFFA3,0x0300,0x0001,0xFFA3,0x0302,0x0002,0xFFA4,0x0303,0x0002,0xFFA4,0x0305,0x0003,
- 0xFFA4,0x0307,0x0005,0xFFA4,0x0308,0x0006,0xFFA4,0x030A,0x0007,0xFFA4,0x030C,0x0008,
- 0xFFA4,0x030D,0x000A,0xFFA4,0x030F,0x000B,0xFFA4,0x0311,0x000D,0xFFA4,0x0312,0x000F,
- 0xFFA4,0x0314,0x0010,0xFFA4,0x0316,0x0012,0xFFA5,0x0317,0x0014,0xFFA5,0x0319,0x0016,
- 0xFFA5,0x031B,0x0018,0xFFA5,0x031C,0x001A,0xFFA5,0x031E,0x001C,0xFFA5,0x031F,0x001E,
- 0xFFA5,0x0321,0x0020,0xFFA5,0x0323,0x0022,0xFFA5,0x0324,0x0024,0xFFA5,0x0326,0x0027,
- 0xFFA5,0x0327,0x0029,0xFFA5,0x0329,0x002B,0xFFA6,0x032B,0x002E,0xFFA6,0x032C,0x0030,
- 0xFFA6,0x032E,0x0033,0xFFA6,0x032F,0x0035,0xFFA6,0x0331,0x0038,0xFFA6,0x0332,0x003B,
- 0xFFA6,0x0334,0x003D,0xFFA6,0x0335,0x0040,0xFFA6,0x0337,0x0043,0xFFA6,0x0339,0x0046,
- 0xFFA6,0x033A,0x0048,0xFFA6,0x033C,0x004B,0xFFA6,0x033D,0x004E,0xFFA7,0x033F,0x0051,
- 0xFFA7,0x0340,0x0054,0xFFA7,0x0342,0x0057,0xFFA7,0x0343,0x005A,0xFFA7,0x0345,0x005D,
- 0xFFA7,0x0346,0x0061,0xFFA7,0x0348,0x0064,0xFFA7,0x0349,0x0067,0xFFA7,0x034B,0x006A,
- 0xFFA7,0x034C,0x006D,0xFFA7,0x034E,0x0071,0xFFA7,0x034F,0x0074,0xFFA7,0x0350,0x0077,
- 0xFFA8,0x0352,0x007B,0xFFA8,0x0353,0x007E,0xFFA8,0x0355,0x0082,0xFFA8,0x0356,0x0085,
- 0xFFA8,0x0358,0x0089,0xFFA8,0x0359,0x008C,0xFFA8,0x035A,0x0090,0xFFA8,0x035C,0x0093,
- 0xFFA8,0x035D,0x0097,0xFFA8,0x035F,0x009B,0xFFA8,0x0360,0x009E,0xFFA8,0x0361,0x00A2,
- 0xFFA8,0x0363,0x00A6,0xFFA8,0x0364,0x00AA,0xFFA8,0x0366,0x00AE,0xFFA9,0x0367,0x00B1,
- 0xFFA9,0x0368,0x00B5,0xFFA9,0x036A,0x00B9,0xFFA9,0x036B,0x00BD,0xFFA9,0x036C,0x00C1,
- 0xFFA9,0x036E,0x00C5,0xFFA9,0x036F,0x00C9,0xFFA9,0x0370,0x00CD,0xFFA9,0x0372,0x00D1,
- 0xFFA9,0x0373,0x00D5,0xFFA9,0x0374,0x00D9,0xFFA9,0x0376,0x00DD,0xFFA9,0x0377,0x00E2,
- 0xFFA9,0x0378,0x00E6,0xFFAA,0x037A,0x00EA,0xFFAA,0x037B,0x00EE,0xFFAA,0x037C,0x00F2,
- 0xFFAA,0x037D,0x00F7,0xFFAA,0x037F,0x00FB,0xFFAA,0x0380,0x00FF,0xFFAA,0x0381,0x0104,
- 0xFFAA,0x0382,0x0108,0xFFAA,0x0384,0x010D,0xFFAA,0x0385,0x0111,0xFFAA,0x0386,0x0116,
- 0xFFAA,0x0387,0x011A,0xFFAA,0x0389,0x011F,0xFFAA,0x038A,0x0123,0xFFAA,0x038B,0x0128,
- 0xFFAA,0x038C,0x012C,0xFFAB,0x038D,0x0131,0xFFAB,0x038F,0x0135,0xFFAB,0x0390,0x013A,
- 0xFFAB,0x0391,0x013F,0xFFAB,0x0392,0x0143,0xFFAB,0x0393,0x0148,0xFFAB,0x0394,0x014D,
- 0xFFAB,0x0396,0x0152,0xFFAB,0x0397,0x0156,0xFFAB,0x0398,0x015B,0xFFAB,0x0399,0x0160,
- 0xFFAB,0x039A,0x0165,0xFFAB,0x039B,0x016A,0xFFAB,0x039C,0x016F,0xFFAB,0x039D,0x0174,
- 0xFFAB,0x039F,0x0179,0xFFAB,0x03A0,0x017E,0xFFAB,0x03A1,0x0183,0xFFAC,0x03A2,0x0188,
- 0xFFAC,0x03A3,0x018D,0xFFAC,0x03A4,0x0192,0xFFAC,0x03A5,0x0197,0xFFAC,0x03A6,0x019C,
- 0xFFAC,0x03A7,0x01A1,0xFFAC,0x03A8,0x01A6,0xFFAC,0x03A9,0x01AB,0xFFAC,0x03AA,0x01B0,
- 0xFFAC,0x03AB,0x01B6,0xFFAC,0x03AC,0x01BB,0xFFAC,0x03AD,0x01C0,0xFFAC,0x03AE,0x01C5,
- 0xFFAC,0x03AF,0x01CB,0xFFAC,0x03B0,0x01D0,0xFFAC,0x03B1,0x01D5,0xFFAC,0x03B2,0x01DB,
- 0xFFAC,0x03B3,0x01E0,0xFFAC,0x03B4,0x01E5,0xFFAD,0x03B5,0x01EB,0xFFAD,0x03B6,0x01F0,
- 0xFFAD,0x03B7,0x01F6,0xFFAD,0x03B8,0x01FB,0xFFAD,0x03B9,0x0201,0xFFAD,0x03BA,0x0206,
- 0xFFAD,0x03BB,0x020C,0xFFAD,0x03BC,0x0211,0xFFAD,0x03BD,0x0217,0xFFAD,0x03BD,0x021C,
- 0xFFAD,0x03BE,0x0222,0xFFAD,0x03BF,0x0228,0xFFAD,0x03C0,0x022D,0xFFAD,0x03C1,0x0233,
- 0xFFAD,0x03C2,0x0238,0xFFAD,0x03C3,0x023E,0xFFAD,0x03C3,0x0244,0xFFAD,0x03C4,0x024A,
- 0xFFAD,0x03C5,0x024F,0xFFAD,0x03C6,0x0255,0xFFAD,0x03C7,0x025B,0xFFAD,0x03C8,0x0261,
- 0xFFAD,0x03C8,0x0267,0xFFAE,0x03C9,0x026C,0xFFAE,0x03CA,0x0272,0xFFAE,0x03CB,0x0278,
- 0xFFAE,0x03CB,0x027E,0xFFAE,0x03CC,0x0284,0xFFAE,0x03CD,0x028A,0xFFAE,0x03CE,0x0290,
- 0xFFAE,0x03CE,0x0296,0xFFAE,0x03CF,0x029C,0xFFAE,0x03D0,0x02A2,0xFFAE,0x03D1,0x02A8,
- 0xFFAE,0x03D1,0x02AE,0xFFAE,0x03D2,0x02B4,0xFFAE,0x03D3,0x02BA,0xFFAE,0x03D3,0x02C0,
- 0xFFAE,0x03D4,0x02C6,0xFFAE,0x03D5,0x02CC,0xFFAE,0x03D5,0x02D3,0xFFAE,0x03D6,0x02D9,
- 0xFFAE,0x03D7,0x02DF,0xFFAE,0x03D7,0x02E5,0xFFAE,0x03D8,0x02EB,0xFFAE,0x03D8,0x02F2,
- 0xFFAE,0x03D9,0x02F8,0xFFAE,0x03D9,0x02FE,0xFFAE,0x03DA,0x0304,0xFFAE,0x03DB,0x030B,
- 0xFFAE,0x03DB,0x0311,0xFFAE,0x03DC,0x0317,0xFFAF,0x03DC,0x031E,0xFFAF,0x03DD,0x0324,
- 0xFFAF,0x03DD,0x032A,0xFFAF,0x03DE,0x0331,0xFFAF,0x03DE,0x0337,0xFFAF,0x03DF,0x033E,
- 0xFFAF,0x03DF,0x0344,0xFFAF,0x03E0,0x034B,0xFFAF,0x03E0,0x0351,0xFFAF,0x03E0,0x0358,
- 0xFFAF,0x03E1,0x035E,0xFFAF,0x03E1,0x0365,0xFFAF,0x03E2,0x036B,0xFFAF,0x03E2,0x0372,
- 0xFFAF,0x03E2,0x0378,0xFFAF,0x03E3,0x037F,0xFFAF,0x03E3,0x0386,0xFFAF,0x03E3,0x038C,
- 0xFFAF,0x03E4,0x0393,0xFFAF,0x03E4,0x039A,0xFFAF,0x03E4,0x03A0,0xFFAF,0x03E5,0x03A7,
- 0xFFAF,0x03E5,0x03AE,0xFFAF,0x03E5,0x03B4,0xFFAF,0x03E5,0x03BB,0xFFAF,0x03E5,0x03C2,
- 0xFFAF,0x03E6,0x03C9,0xFFAF,0x03E6,0x03D0,0xFFAF,0x03E6,0x03D6,0xFFAF,0x03E6,0x03DD
-};
-#ifdef __STDC__
-private signed short v_tbl[] = {
-#else
-private short v_tbl[] = {
-#endif
- 0x0000,0x0005,0x000B,0x0010,0x0016,0x001B,0x0020,0x0026,
- 0x002B,0x0030,0x0036,0x003B,0x0040,0x0046,0x004B,0x0050,
- 0x0056,0x005B,0x0060,0x0066,0x006B,0x0070,0x0075,0x007B,
- 0x0080,0x0085,0x008A,0x008F,0x0095,0x009A,0x009F,0x00A4,
- 0x00A9,0x00AF,0x00B4,0x00B9,0x00BE,0x00C3,0x00C8,0x00CD,
- 0x00D2,0x00D8,0x00DD,0x00E2,0x00E7,0x00EC,0x00F1,0x00F6,
- 0x00FB,0x0100,0x0105,0x010A,0x010F,0x0114,0x0119,0x011E,
- 0x0123,0x0128,0x012D,0x0132,0x0137,0x013C,0x0141,0x0146,
- 0x014A,0x014F,0x0154,0x0159,0x015E,0x0163,0x0168,0x016D,
- 0x0171,0x0176,0x017B,0x0180,0x0185,0x0189,0x018E,0x0193,
- 0x0198,0x019C,0x01A1,0x01A6,0x01AB,0x01AF,0x01B4,0x01B9,
- 0x01BD,0x01C2,0x01C7,0x01CB,0x01D0,0x01D5,0x01D9,0x01DE,
- 0x01E2,0x01E7,0x01EB,0x01F0,0x01F5,0x01F9,0x01FE,0x0202,
- 0x0207,0x020B,0x0210,0x0214,0x0219,0x021D,0x0222,0x0226,
- 0x022A,0x022F,0x0233,0x0238,0x023C,0x0240,0x0245,0x0249,
- 0x024D,0x0252,0x0256,0x025A,0x025F,0x0263,0x0267,0x026C,
- 0x0270,0x0274,0x0278,0x027C,0x0281,0x0285,0x0289,0x028D,
- 0x0291,0x0296,0x029A,0x029E,0x02A2,0x02A6,0x02AA,0x02AE,
- 0x02B2,0x02B6,0x02BA,0x02BE,0x02C2,0x02C6,0x02CA,0x02CE,
- 0x02D2,0x02D6,0x02DA,0x02DE,0x02E2,0x02E6,0x02EA,0x02ED,
- 0x02F1,0x02F5,0x02F9,0x02FD,0x0300,0x0304,0x0308,0x030C,
- 0x030F,0x0313,0x0317,0x031B,0x031E,0x0322,0x0325,0x0329,
- 0x032D,0x0330,0x0334,0x0337,0x033B,0x033E,0x0342,0x0345,
- 0x0349,0x034C,0x0350,0x0353,0x0357,0x035A,0x035D,0x0361,
- 0x0364,0x0367,0x036B,0x036E,0x0371,0x0374,0x0378,0x037B,
- 0x037E,0x0381,0x0384,0x0387,0x038B,0x038E,0x0391,0x0394,
- 0x0397,0x039A,0x039D,0x03A0,0x03A2,0x03A5,0x03A8,0x03AB,
- 0x03AE,0x03B1,0x03B3,0x03B6,0x03B9,0x03BC,0x03BE,0x03C1,
- 0x03C4,0x03C6,0x03C9,0x03CB,0x03CE,0x03D0,0x03D3,0x03D5,
- 0x03D7,0x03DA,0x03DC,0x03DE,0x03E0,0x03E2,0x03E5,0x03E7,
- 0x03E9,0x03EB,0x03ED,0x03EE,0x03F0,0x03F2,0x03F4,0x03F5,
- 0x03F7,0x03F9,0x03FA,0x03FB,0x03FC,0x03FE,0x03FE,0x03FF
-};
-private unsigned short grnsep[] = {
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,
- 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,
- 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,
- 0x0001,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,
- 0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,
- 0x0002,0x0002,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,
- 0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,
- 0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,
- 0x0004,0x0004,0x0004,0x0004,0x0005,0x0005,0x0005,0x0005,
- 0x0005,0x0005,0x0005,0x0005,0x0005,0x0005,0x0005,0x0006,
- 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,
- 0x0007,0x0007,0x0007,0x0007,0x0007,0x0007,0x0007,0x0007,
- 0x0008,0x0008,0x0008,0x0008,0x0008,0x0008,0x0008,0x0008,
- 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,
- 0x000A,0x000A,0x000A,0x000A,0x000A,0x000A,0x000B,0x000B,
- 0x000B,0x000B,0x000B,0x000B,0x000B,0x000C,0x000C,0x000C,
- 0x000C,0x000C,0x000C,0x000D,0x000D,0x000D,0x000D,0x000D,
- 0x000D,0x000E,0x000E,0x000E,0x000E,0x000E,0x000F,0x000F,
- 0x000F,0x000F,0x000F,0x000F,0x0010,0x0010,0x0010,0x0010,
- 0x0010,0x0011,0x0011,0x0011,0x0011,0x0011,0x0012,0x0012,
- 0x0012,0x0012,0x0012,0x0013,0x0013,0x0013,0x0013,0x0014,
- 0x0014,0x0014,0x0014,0x0014,0x0015,0x0015,0x0015,0x0015,
- 0x0015,0x0016,0x0016,0x0016,0x0016,0x0017,0x0017,0x0017,
- 0x0017,0x0018,0x0018,0x0018,0x0018,0x0018,0x0019,0x0019,
- 0x0019,0x0019,0x001A,0x001A,0x001A,0x001A,0x001B,0x001B,
- 0x001B,0x001B,0x001C,0x001C,0x001C,0x001C,0x001D,0x001D,
- 0x001D,0x001D,0x001E,0x001E,0x001E,0x001E,0x001F,0x001F,
- 0x001F,0x001F,0x0020,0x0020,0x0020,0x0021,0x0021,0x0021,
- 0x0021,0x0022,0x0022,0x0022,0x0022,0x0023,0x0023,0x0023,
- 0x0023,0x0024,0x0024,0x0024,0x0025,0x0025,0x0025,0x0025,
- 0x0026,0x0026,0x0026,0x0026,0x0027,0x0027,0x0027,0x0028,
- 0x0028,0x0028,0x0028,0x0029,0x0029,0x0029,0x0029,0x002A,
- 0x002A,0x002A,0x002B,0x002B,0x002B,0x002B,0x002C,0x002C,
- 0x002C,0x002D,0x002D,0x002D,0x002D,0x002E,0x002E,0x002E,
- 0x002E,0x002F,0x002F,0x002F,0x0030,0x0030,0x0030,0x0030,
- 0x0031,0x0031,0x0031,0x0032,0x0032,0x0032,0x0032,0x0033,
- 0x0033,0x0033,0x0033,0x0034,0x0034,0x0034,0x0035,0x0035,
- 0x0035,0x0035,0x0036,0x0036,0x0036,0x0036,0x0037,0x0037,
- 0x0037,0x0038,0x0038,0x0038,0x0038,0x0039,0x0039,0x0039,
- 0x0039,0x003A,0x003A,0x003A,0x003B,0x003B,0x003B,0x003B,
- 0x003C,0x003C,0x003C,0x003C,0x003D,0x003D,0x003D,0x003D,
- 0x003E,0x003E,0x003E,0x003E,0x003F,0x003F,0x003F,0x003F,
- 0x0040,0x0040,0x0040,0x0040,0x0041,0x0041,0x0041,0x0041,
- 0x0042,0x0042,0x0042,0x0042,0x0043,0x0043,0x0043,0x0043,
- 0x0044,0x0044,0x0044,0x0044,0x0045,0x0045,0x0045,0x0045,
- 0x0046,0x0046,0x0046,0x0046,0x0047,0x0047,0x0047,0x0047,
- 0x0047,0x0048,0x0048,0x0048,0x0048,0x0049,0x0049,0x0049,
- 0x0049,0x004A,0x004A,0x004A,0x004A,0x004A,0x004B,0x004B,
- 0x004B,0x004B,0x004B,0x004C,0x004C,0x004C,0x004C,0x004D,
- 0x004D,0x004D,0x004D,0x004D,0x004E,0x004E,0x004E,0x004E,
- 0x004E,0x004F,0x004F,0x004F,0x004F,0x004F,0x0050,0x0050,
- 0x0050,0x0050,0x0050,0x0050,0x0051,0x0051,0x0051,0x0051,
- 0x0051,0x0052,0x0052,0x0052,0x0052,0x0052,0x0052,0x0053,
- 0x0053,0x0053,0x0053,0x0053,0x0053,0x0054,0x0054,0x0054,
- 0x0054,0x0054,0x0054,0x0055,0x0055,0x0055,0x0055,0x0055,
- 0x0055,0x0055,0x0056,0x0056,0x0056,0x0056,0x0056,0x0056,
- 0x0056,0x0057,0x0057,0x0057,0x0057,0x0057,0x0057,0x0057,
- 0x0058,0x0058,0x0058,0x0058,0x0058,0x0058,0x0058,0x0058,
- 0x0058,0x0059,0x0059,0x0059,0x0059,0x0059,0x0059,0x0059,
- 0x0059,0x0059,0x005A,0x005A,0x005A,0x005A,0x005A,0x005A,
- 0x005A,0x005A,0x005A,0x005A,0x005A,0x005A,0x005B,0x005B,
- 0x005B,0x005B,0x005B,0x005B,0x005B,0x005B,0x005B,0x005B,
- 0x005B,0x005B,0x005B,0x005B,0x005B,0x005B,0x005B,0x005C,
- 0x005C,0x005C,0x005C,0x005C,0x005C,0x005C,0x005C,0x005C,
- 0x005C,0x005C,0x005C,0x005C,0x005C,0x005C,0x005C,0x005C,
- 0x005C,0x005C,0x005C,0x005C,0x005C,0x005C,0x005C,0x005C,
- 0x005C,0x005C,0x005C,0x005C,0x005C,0x005C,0x005C,0x005C,
- 0x005C,0x005C,0x005C,0x005C,0x005C,0x005C,0x005C,0x005B,
- 0x005B,0x005B,0x005B,0x005B,0x005B,0x005B,0x005B,0x005B,
- 0x005B,0x005B,0x005B,0x005B,0x005B,0x005B,0x005B,0x005A,
- 0x005A,0x005A,0x005A,0x005A,0x005A,0x005A,0x005A,0x005A,
- 0x005A,0x0059,0x0059,0x0059,0x0059,0x0059,0x0059,0x0059,
- 0x0059,0x0059,0x0058,0x0058,0x0058,0x0058,0x0058,0x0058,
- 0x0058,0x0057,0x0057,0x0057,0x0057,0x0057,0x0057,0x0057,
- 0x0056,0x0056,0x0056,0x0056,0x0056,0x0056,0x0055,0x0055,
- 0x0055,0x0055,0x0055,0x0055,0x0054,0x0054,0x0054,0x0054,
- 0x0054,0x0053,0x0053,0x0053,0x0053,0x0053,0x0052,0x0052,
- 0x0052,0x0052,0x0051,0x0051,0x0051,0x0051,0x0051,0x0050,
- 0x0050,0x0050,0x0050,0x004F,0x004F,0x004F,0x004F,0x004E,
- 0x004E,0x004E,0x004E,0x004D,0x004D,0x004D,0x004D,0x004C,
- 0x004C,0x004C,0x004C,0x004B,0x004B,0x004B,0x004B,0x004A,
- 0x004A,0x004A,0x004A,0x0049,0x0049,0x0049,0x0048,0x0048,
- 0x0048,0x0048,0x0047,0x0047,0x0047,0x0046,0x0046,0x0046,
- 0x0046,0x0045,0x0045,0x0045,0x0044,0x0044,0x0044,0x0044,
- 0x0043,0x0043,0x0043,0x0042,0x0042,0x0042,0x0041,0x0041,
- 0x0041,0x0041,0x0040,0x0040,0x0040,0x003F,0x003F,0x003F,
- 0x003E,0x003E,0x003E,0x003D,0x003D,0x003D,0x003D,0x003C,
- 0x003C,0x003C,0x003B,0x003B,0x003B,0x003A,0x003A,0x003A,
- 0x0039,0x0039,0x0039,0x0038,0x0038,0x0038,0x0038,0x0037,
- 0x0037,0x0037,0x0036,0x0036,0x0036,0x0035,0x0035,0x0035,
- 0x0034,0x0034,0x0034,0x0033,0x0033,0x0033,0x0033,0x0032,
- 0x0032,0x0032,0x0031,0x0031,0x0031,0x0030,0x0030,0x0030,
- 0x002F,0x002F,0x002F,0x002F,0x002E,0x002E,0x002E,0x002D,
- 0x002D,0x002D,0x002C,0x002C,0x002C,0x002C,0x002B,0x002B,
- 0x002B,0x002A,0x002A,0x002A,0x002A,0x0029,0x0029,0x0029,
- 0x0028,0x0028,0x0028,0x0028,0x0027,0x0027,0x0027,0x0026,
- 0x0026,0x0026,0x0026,0x0025,0x0025,0x0025,0x0025,0x0024,
- 0x0024,0x0024,0x0023,0x0023,0x0023,0x0023,0x0022,0x0022,
- 0x0022,0x0022,0x0021,0x0021,0x0021,0x0021,0x0020,0x0020,
- 0x0020,0x0020,0x001F,0x001F,0x001F,0x001F,0x001E,0x001E,
- 0x001E,0x001E,0x001D,0x001D,0x001D,0x001D,0x001D,0x001C,
- 0x001C,0x001C,0x001C,0x001B,0x001B,0x001B,0x001B,0x001B,
- 0x001A,0x001A,0x001A,0x001A,0x0019,0x0019,0x0019,0x0019,
- 0x0019,0x0018,0x0018,0x0018,0x0018,0x0018,0x0017,0x0017,
- 0x0017,0x0017,0x0017,0x0016,0x0016,0x0016,0x0016,0x0016,
- 0x0016,0x0015,0x0015,0x0015,0x0015,0x0015,0x0014,0x0014,
- 0x0014,0x0014,0x0014,0x0014,0x0013,0x0013,0x0013,0x0013,
- 0x0013,0x0013,0x0012,0x0012,0x0012,0x0012,0x0012,0x0012,
- 0x0011,0x0011,0x0011,0x0011,0x0011,0x0011,0x0011,0x0010,
- 0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x000F,0x000F,
- 0x000F,0x000F,0x000F,0x000F,0x000F,0x000E,0x000E,0x000E,
- 0x000E,0x000E,0x000E,0x000E,0x000E,0x000D,0x000D,0x000D,
- 0x000D,0x000D,0x000D,0x000D,0x000D,0x000C,0x000C,0x000C,
- 0x000C,0x000C,0x000C,0x000C,0x000C,0x000C,0x000B,0x000B,
- 0x000B,0x000B,0x000B,0x000B,0x000B,0x000B,0x000B,0x000B,
- 0x000A,0x000A,0x000A,0x000A,0x000A,0x000A,0x000A,0x000A,
- 0x000A,0x000A,0x000A,0x0009,0x0009,0x0009,0x0009,0x0009,
- 0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0008,0x0008,
- 0x0008,0x0008,0x0008,0x0008,0x0008,0x0008,0x0008,0x0008,
- 0x0008,0x0008,0x0008,0x0007,0x0007,0x0007,0x0007,0x0007,
- 0x0007,0x0007,0x0007,0x0007,0x0007,0x0007,0x0007,0x0007,
- 0x0007,0x0007,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,
- 0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,
- 0x0006,0x0006,0x0006,0x0005,0x0005,0x0005,0x0005,0x0005,
- 0x0005,0x0005,0x0005,0x0005,0x0005,0x0005,0x0005,0x0005,
- 0x0005,0x0005,0x0005,0x0005,0x0005,0x0005,0x0005,0x0005
-};
-private unsigned short grnsep2[] = {
- 0x0000,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,
- 0x0001,0x0001,0x0001,0x0001,0x0001,0x0002,0x0002,0x0002,
- 0x0002,0x0002,0x0002,0x0003,0x0003,0x0003,0x0003,0x0004,
- 0x0004,0x0004,0x0005,0x0005,0x0006,0x0006,0x0007,0x0007,
- 0x0008,0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,
- 0x000F,0x0010,0x0011,0x0013,0x0014,0x0016,0x0017,0x0019,
- 0x001B,0x001D,0x0020,0x0022,0x0025,0x0027,0x002A,0x002E,
- 0x0031,0x0035,0x0038,0x003D,0x0041,0x0046,0x004B,0x0050,
- 0x0056,0x005C,0x0063,0x006A,0x0071,0x0079,0x0081,0x008A,
- 0x0094,0x009E,0x00A9,0x00B4,0x00C0,0x00CD,0x00DB,0x00E9,
- 0x00F8,0x0109,0x011A,0x012C,0x013F,0x0153,0x0169,0x0180,
- 0x0197,0x01B1,0x01CC,0x01E8,0x0206,0x0225,0x0246,0x0269,
- 0x028E,0x02B4,0x02DD,0x0308,0x0334,0x0364,0x0395,0x03C9,
- 0x0400,0x043A,0x0476,0x04B5,0x04F7,0x053C,0x0585,0x05D1,
- 0x0620,0x0674,0x06CB,0x0725,0x0784,0x07E7,0x084F,0x08BB,
- 0x092B,0x09A1,0x0A1B,0x0A9A,0x0B1F,0x0BA9,0x0C39,0x0CCE,
- 0x0D69,0x0E0A,0x0EB2,0x0F60,0x1014,0x10CF,0x1191,0x125A,
- 0x132B,0x1402,0x14E2,0x15C9,0x16B7,0x17AE,0x18AD,0x19B5,
- 0x1AC5,0x1BDE,0x1CFF,0x1E2A,0x1F5D,0x209A,0x21E0,0x2330,
- 0x2489,0x25EC,0x2759,0x28D0,0x2A51,0x2BDC,0x2D71,0x2F11,
- 0x30BB,0x326F,0x342E,0x35F7,0x37CB,0x39A9,0x3B92,0x3D86,
- 0x3F84,0x418C,0x439F,0x45BC,0x47E3,0x4A15,0x4C50,0x4E96,
- 0x50E6,0x533F,0x55A2,0x580E,0x5A83,0x5D02,0x5F89,0x6219,
- 0x64B1,0x6751,0x69F9,0x6CA8,0x6F5F,0x721C,0x74E0,0x77AA,
- 0x7A79,0x7D4E,0x8028,0x8307,0x85E9,0x88D0,0x8BB9,0x8EA5,
- 0x9193,0x9484,0x9775,0x9A67,0x9D59,0xA04B,0xA33C,0xA62B,
- 0xA918,0xAC03,0xAEEA,0xB1CE,0xB4AD,0xB787,0xBA5B,0xBD29,
- 0xBFF0,0xC2B0,0xC568,0xC817,0xCABC,0xCD58,0xCFE9,0xD26E,
- 0xD4E8,0xD756,0xD9B7,0xDC0A,0xDE4E,0xE085,0xE2AC,0xE4C3,
- 0xE6CA,0xE8C0,0xEAA4,0xEC77,0xEE37,0xEFE5,0xF17F,0xF306,
- 0xF479,0xF5D7,0xF720,0xF854,0xF973,0xFA7C,0xFB6F,0xFC4B,
- 0xFD11,0xFDC1,0xFE59,0xFEDA,0xFF44,0xFF96,0xFFD1,0xFFF4,
- 0xFFFF,0xFFF4,0xFFD1,0xFF96,0xFF44,0xFEDA,0xFE59,0xFDC1,
- 0xFD11,0xFC4B,0xFB6F,0xFA7C,0xF973,0xF854,0xF720,0xF5D7,
- 0xF479,0xF306,0xF17F,0xEFE5,0xEE37,0xEC77,0xEAA4,0xE8C0,
- 0xE6CA,0xE4C3,0xE2AC,0xE085,0xDE4E,0xDC0A,0xD9B7,0xD756,
- 0xD4E8,0xD26E,0xCFE9,0xCD58,0xCABC,0xC817,0xC568,0xC2B0,
- 0xBFF0,0xBD29,0xBA5B,0xB787,0xB4AD,0xB1CE,0xAEEA,0xAC03,
- 0xA918,0xA62B,0xA33C,0xA04B,0x9D59,0x9A67,0x9775,0x9484,
- 0x9193,0x8EA5,0x8BB9,0x88D0,0x85E9,0x8307,0x8028,0x7D4E,
- 0x7A79,0x77AA,0x74E0,0x721C,0x6F5F,0x6CA8,0x69F9,0x6751,
- 0x64B1,0x6219,0x5F89,0x5D02,0x5A83,0x580E,0x55A2,0x533F,
- 0x50E6,0x4E96,0x4C50,0x4A15,0x47E3,0x45BC,0x439F,0x418C,
- 0x3F84,0x3D86,0x3B92,0x39A9,0x37CB,0x35F7,0x342E,0x326F,
- 0x30BB,0x2F11,0x2D71,0x2BDC,0x2A51,0x28D0,0x2759,0x25EC,
- 0x2489,0x2330,0x21E0,0x209A,0x1F5D,0x1E2A,0x1CFF,0x1BDE,
- 0x1AC5,0x19B5,0x18AD,0x17AE,0x16B7,0x15C9,0x14E2,0x1402,
- 0x132B,0x125A,0x1191,0x10CF,0x1014,0x0F60,0x0EB2,0x0E0A,
- 0x0D69,0x0CCE,0x0C39,0x0BA9,0x0B1F,0x0A9A,0x0A1B,0x09A1,
- 0x092B,0x08BB,0x084F,0x07E7,0x0784,0x0725,0x06CB,0x0674,
- 0x0620,0x05D1,0x0585,0x053C,0x04F7,0x04B5,0x0476,0x043A,
- 0x0400,0x03C9,0x0395,0x0364,0x0334,0x0308,0x02DD,0x02B4,
- 0x028E,0x0269,0x0246,0x0225,0x0206,0x01E8,0x01CC,0x01B1,
- 0x0197,0x0180,0x0169,0x0153,0x013F,0x012C,0x011A,0x0109,
- 0x00F8,0x00E9,0x00DB,0x00CD,0x00C0,0x00B4,0x00A9,0x009E,
- 0x0094,0x008A,0x0081,0x0079,0x0071,0x006A,0x0063,0x005C,
- 0x0056,0x0050,0x004B,0x0046,0x0041,0x003D,0x0038,0x0035,
- 0x0031,0x002E,0x002A,0x0027,0x0025,0x0022,0x0020,0x001D,
- 0x001B,0x0019,0x0017,0x0016,0x0014,0x0013,0x0011,0x0010,
- 0x000F,0x000E,0x000D,0x000C,0x000B,0x000A,0x0009,0x0008,
- 0x0008,0x0007,0x0007,0x0006,0x0006,0x0005,0x0005,0x0004,
- 0x0004,0x0004,0x0003,0x0003,0x0003,0x0003,0x0002,0x0002,
- 0x0002,0x0002,0x0002,0x0002,0x0001,0x0001,0x0001,0x0001,
- 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001
-};
-private short esp_dat_c[] = {
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x004A,0x0050,0x0056,0x005B,0x0061,0x0067,0x006C,
- 0x0072,0x0078,0x007D,0x0083,0x0089,0x008F,0x0095,0x009B,
- 0x00A0,0x00A6,0x00AC,0x00B2,0x00B8,0x00BE,0x00C4,0x00CA,
- 0x00D0,0x00D6,0x00DC,0x00E2,0x00E8,0x00EE,0x00F5,0x00FB,
- 0x0101,0x0107,0x010D,0x0113,0x011A,0x0120,0x0126,0x012D,
- 0x0133,0x0139,0x013F,0x0146,0x014C,0x0153,0x0159,0x015F,
- 0x0166,0x016C,0x0173,0x0179,0x0180,0x0186,0x018D,0x0193,
- 0x019A,0x01A1,0x01A7,0x01AE,0x01B5,0x01BB,0x01C2,0x01C9,
- 0x01CF,0x01D6,0x01DD,0x01E3,0x01EA,0x01F1,0x01F8,0x01FF,
- 0x0205,0x020C,0x0213,0x021A,0x0221,0x0228,0x022F,0x0236,
- 0x023D,0x0243,0x024A,0x0251,0x0258,0x025F,0x0266,0x026D,
- 0x0274,0x027C,0x0283,0x028A,0x0291,0x0298,0x029F,0x02A6,
- 0x02AD,0x02B4,0x02BC,0x02C3,0x02CA,0x02D1,0x02D8,0x02E0,
- 0x02E7,0x02EE,0x02F5,0x02FD,0x0304,0x030B,0x0312,0x031A,
- 0x0321,0x0328,0x0330,0x0337,0x033E,0x0346,0x034D,0x0355,
- 0x035C,0x0363,0x036B,0x0372,0x037A,0x0381,0x0389,0x0390,
- 0x0398,0x039F,0x03A7,0x03AE,0x03B6,0x03BD,0x03C5,0x03CC,
- 0x03D4,0x03DB,0x03E3,0x03EA,0x03F2,0x03F9,0x0401,0x0409,
- 0x0410,0x0418,0x041F,0x0427,0x042F,0x0436,0x043E,0x0445,
- 0x044D,0x0455,0x045C,0x0464,0x046C,0x0473,0x047B,0x0483,
- 0x048A,0x0492,0x049A,0x04A1,0x04A9,0x04B1,0x04B9,0x04C0,
- 0x04C8,0x04D0,0x04D7,0x04DF,0x04E7,0x04EF,0x04F6,0x04FE,
- 0x0506,0x050E,0x0515,0x051D,0x0525,0x052D,0x0534,0x053C,
- 0x0544,0x054C,0x0553,0x055B,0x0563,0x056B,0x0572,0x057A,
- 0x0582,0x058A,0x0592,0x0599,0x05A1,0x05A9,0x05B1,0x05B9,
- 0x05C0,0x05C8,0x05D0,0x05D8,0x05DF,0x05E7,0x05EF,0x05F7,
- 0x05FF,0x0606,0x060E,0x0616,0x061E,0x0626,0x062D,0x0635,
- 0x063D,0x0645,0x064D,0x0654,0x065C,0x0664,0x066C,0x0674,
- 0x067B,0x0683,0x068B,0x0693,0x069B,0x06A2,0x06AA,0x06B2,
- 0x06BA,0x06C1,0x06C9,0x06D1,0x06D9,0x06E1,0x06E8,0x06F0,
- 0x06F8,0x0700,0x0707,0x070F,0x0717,0x071F,0x0727,0x072E,
- 0x0736,0x073E,0x0746,0x074D,0x0755,0x075D,0x0765,0x076C,
- 0x0774,0x077C,0x0783,0x078B,0x0793,0x079B,0x07A2,0x07AA,
- 0x07B2,0x07BA,0x07C1,0x07C9,0x07D1,0x07D8,0x07E0,0x07E8,
- 0x07F0,0x07F7,0x07FF,0x0807,0x080E,0x0816,0x081E,0x0825,
- 0x082D,0x0835,0x083C,0x0844,0x084C,0x0853,0x085B,0x0863,
- 0x086A,0x0872,0x087A,0x0881,0x0889,0x0891,0x0898,0x08A0,
- 0x08A7,0x08AF,0x08B7,0x08BE,0x08C6,0x08CE,0x08D5,0x08DD,
- 0x08E4,0x08EC,0x08F4,0x08FB,0x0903,0x090A,0x0912,0x091A,
- 0x0921,0x0929,0x0930,0x0938,0x093F,0x0947,0x094F,0x0956,
- 0x095E,0x0965,0x096D,0x0974,0x097C,0x0983,0x098B,0x0993,
- 0x099A,0x09A2,0x09A9,0x09B1,0x09B8,0x09C0,0x09C7,0x09CF,
- 0x09D6,0x09DE,0x09E5,0x09ED,0x09F4,0x09FC,0x0A03,0x0A0B,
- 0x0A12,0x0A1A,0x0A21,0x0A29,0x0A30,0x0A38,0x0A3F,0x0A47,
- 0x0A4E,0x0A56,0x0A5D,0x0A65,0x0A6C,0x0A74,0x0A7B,0x0A83,
- 0x0A8A,0x0A92,0x0A99,0x0AA1,0x0AA8,0x0AB0,0x0AB7,0x0ABE,
- 0x0AC6,0x0ACD,0x0AD5,0x0ADC,0x0AE4,0x0AEB,0x0AF3,0x0AFA,
- 0x0B02,0x0B09,0x0B11,0x0B18,0x0B1F,0x0B27,0x0B2E,0x0B36,
- 0x0B3D,0x0B45,0x0B4C,0x0B54,0x0B5B,0x0B63,0x0B6A,0x0B71,
- 0x0B79,0x0B80,0x0B88,0x0B8F,0x0B97,0x0B9E,0x0BA6,0x0BAD,
- 0x0BB4,0x0BBC,0x0BC3,0x0BCB,0x0BD2,0x0BDA,0x0BE1,0x0BE9,
- 0x0BF0,0x0BF8,0x0BFF,0x0C07,0x0C0E,0x0C15,0x0C1D,0x0C24,
- 0x0C2C,0x0C33,0x0C3B,0x0C42,0x0C4A,0x0C51,0x0C59,0x0C60,
- 0x0C68,0x0C6F,0x0C77,0x0C7E,0x0C86,0x0C8D,0x0C95,0x0C9C,
- 0x0CA4,0x0CAB,0x0CB3,0x0CBA,0x0CC2,0x0CC9,0x0CD1,0x0CD8,
- 0x0CE0,0x0CE8,0x0CEF,0x0CF7,0x0CFE,0x0D06,0x0D0D,0x0D15,
- 0x0D1C,0x0D24,0x0D2C,0x0D33,0x0D3B,0x0D42,0x0D4A,0x0D52,
- 0x0D59,0x0D61,0x0D68,0x0D70,0x0D78,0x0D7F,0x0D87,0x0D8E,
- 0x0D96,0x0D9E,0x0DA5,0x0DAD,0x0DB5,0x0DBC,0x0DC4,0x0DCC,
- 0x0DD3,0x0DDB,0x0DE3,0x0DEB,0x0DF2,0x0DFA,0x0E02,0x0E0A,
- 0x0E11,0x0E19,0x0E21,0x0E29,0x0E30,0x0E38,0x0E40,0x0E48,
- 0x0E4F,0x0E57,0x0E5F,0x0E67,0x0E6F,0x0E77,0x0E7E,0x0E86,
- 0x0E8E,0x0E96,0x0E9E,0x0EA6,0x0EAE,0x0EB6,0x0EBE,0x0EC6,
- 0x0ECD,0x0ED5,0x0EDD,0x0EE5,0x0EED,0x0EF5,0x0EFD,0x0F05,
- 0x0F0D,0x0F15,0x0F1D,0x0F25,0x0F2E,0x0F36,0x0F3E,0x0F46,
- 0x0F4E,0x0F56,0x0F5E,0x0F66,0x0F6E,0x0F77,0x0F7F,0x0F87,
- 0x0F8F,0x0F97,0x0FA0,0x0FA8,0x0FB0,0x0FB8,0x0FC1,0x0FC9,
- 0x0FD1,0x0FD9,0x0FE2,0x0FEA,0x0FF2,0x0FFB,0x1003,0x100C,
- 0x1014,0x101C,0x1025,0x102D,0x1036,0x103E,0x1047,0x104F,
- 0x1058,0x1060,0x1069,0x1071,0x107A,0x1083,0x108B,0x1094,
- 0x109C,0x10A5,0x10AE,0x10B6,0x10BF,0x10C8,0x10D1,0x10D9,
- 0x10E2,0x10EB,0x10F4,0x10FD,0x1105,0x110E,0x1117,0x1120,
- 0x1129,0x1132,0x113B,0x1144,0x114D,0x1156,0x115F,0x1168,
- 0x1171,0x117A,0x1183,0x118C,0x1195,0x119F,0x11A8,0x11B1,
- 0x11BA,0x11C3,0x11CD,0x11D6,0x11DF,0x11E9,0x11F2,0x11FB,
- 0x1205,0x120E,0x1218,0x1221,0x122B,0x1234,0x123E,0x1247,
- 0x1251,0x125A,0x1264,0x126E,0x1277,0x1281,0x128B,0x1294,
- 0x129E,0x12A8,0x12B2,0x12BC,0x12C5,0x12CF,0x12D9,0x12E3,
- 0x12ED,0x12F7,0x1301,0x130B,0x1315,0x131F,0x132A,0x1334,
- 0x133E,0x1348,0x1352,0x135D,0x1367,0x1371,0x137C,0x1386,
- 0x1390,0x139B,0x13A5,0x13B0,0x13BA,0x13C5,0x13D0,0x13DA,
- 0x13E5,0x13F0,0x13FA,0x1405,0x1410,0x141B,0x1426,0x1430,
- 0x143B,0x1446,0x1451,0x145C,0x1467,0x1472,0x147E,0x1489,
- 0x1494,0x149F,0x14AA,0x14B6,0x14C1,0x14CC,0x14D8,0x14E3,
- 0x14EF,0x14FA,0x1506,0x1511,0x151D,0x1529,0x1534,0x1540,
- 0x154C,0x1558,0x1564,0x1570,0x157C,0x1588,0x1594,0x15A0,
- 0x15AC,0x15B8,0x15C4,0x15D0,0x15DD,0x15E9,0x15F5,0x1602,
- 0x160E,0x161B,0x1627,0x1634,0x1641,0x164D,0x165A,0x1667,
- 0x1674,0x1681,0x168D,0x169A,0x16A7,0x16B5,0x16C2,0x16CF,
- 0x16DC,0x16E9,0x16F7,0x1704,0x1711,0x171F,0x172C,0x173A,
- 0x1748,0x1755,0x1763,0x1771,0x177F,0x178D,0x179B,0x17A9,
- 0x17B7,0x17C5,0x17D3,0x17E1,0x17F0,0x17FE,0x180C,0x181B,
- 0x1829,0x1838,0x1847,0x1855,0x1864,0x1873,0x1882,0x1891,
- 0x18A0,0x18AF,0x18BE,0x18CD,0x18DD,0x18EC,0x18FC,0x190B,
- 0x191B,0x192A,0x193A,0x194A,0x195A,0x196A,0x197A,0x198A,
- 0x199A,0x19AA,0x19BA,0x19CB,0x19DB,0x19EC,0x19FC,0x1A0D,
- 0x1A1E,0x1A2F,0x1A40,0x1A51,0x1A62,0x1A73,0x1A84,0x1A95,
- 0x1AA7,0x1AB8,0x1ACA,0x1ADB,0x1AED,0x1AFF,0x1B11,0x1B23,
- 0x1B35,0x1B47,0x1B5A,0x1B6C,0x1B7E,0x1B91,0x1BA4,0x1BB6,
- 0x1BC9,0x1BDC,0x1BEF,0x1C02,0x1C16,0x1C29,0x1C3C,0x1C50,
- 0x1C64,0x1C77,0x1C8B,0x1C9F,0x1CB3,0x1CC7,0x1CDC,0x1CF0,
- 0x1D05,0x1D19,0x1D2E,0x1D43,0x1D58,0x1D6D,0x1D82,0x1D97,
- 0x1DAD,0x1DC2,0x1DD8,0x1DEE,0x1E04,0x1E1A,0x1E30,0x1E46,
- 0x1E5D,0x1E73,0x1E8A,0x1EA1,0x1EB8,0x1ECF,0x1EE6,0x1EFE,
- 0x1F15,0x1F2D,0x1F45,0x1F5D,0x1F75,0x1F8D,0x1FA5,0x1FBE,
- 0x1FD7,0x1FF0,0x2009,0x2022,0x203B,0x2055,0x206E,0x2088,
- 0x20A2,0x20BC,0x20D7,0x20F1,0x210C,0x2127,0x2142,0x215D,
- 0x2178,0x2194,0x21AF,0x21CB,0x21E7,0x2204,0x2220,0x223D,
- 0x225A,0x2277,0x2294,0x22B2,0x22CF,0x22ED,0x230B,0x232A,
- 0x2348,0x2367,0x2386,0x23A5,0x23C5,0x23E4,0x2404,0x2424,
- 0x2445,0x2465,0x2486,0x24A7,0x24C9,0x24EA,0x250C,0x252E,
- 0x2550,0x2573,0x2596,0x25B9,0x25DD,0x2600,0x2624,0x2648,
- 0x266D,0x2692,0x26B7,0x26DC,0x2702,0x2728,0x274F,0x2775,
- 0x279C,0x27C4,0x27EB,0x2813,0x283C,0x2864,0x288D,0x28B7,
- 0x28E0,0x290A,0x2935,0x2960,0x298B,0x29B6,0x29E2,0x2A0F,
- 0x2A3B,0x2A69,0x2A96,0x2AC4,0x2AF2,0x2B21,0x2B50,0x2B80,
- 0x2BB0,0x2BE1,0x2C12,0x2C43,0x2C75,0x2CA8,0x2CDB,0x2D0E,
- 0x2D42,0x2D76,0x2DAB,0x2DE1,0x2E17,0x2E4D,0x2E85,0x2EBC,
- 0x2EF4,0x2F2D,0x2F67,0x2FA1,0x2FDB,0x3016,0x3052,0x308F,
- 0x30CC,0x310A,0x3148,0x3187,0x31C7,0x3208,0x3249,0x328B,
- 0x32CE,0x3311,0x3355,0x339A,0x33E0,0x3427,0x346E,0x34B6,
- 0x3500,0x354A,0x3595,0x35E0,0x362D,0x367B,0x36CA,0x3719,
- 0x376A,0x37BB,0x380E,0x3862,0x38B7,0x390D,0x3964,0x39BC,
- 0x3A15,0x3A70,0x3ACB,0x3B28,0x3B87,0x3BE6,0x3C47,0x3CA9,
- 0x3D0D,0x3D72,0x3DD8,0x3E40,0x3EAA,0x3F15,0x3F81,0x3FF0
-};
-private short esp_dat_m[] = {
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x004A,0x004E,0x0052,0x0057,0x005B,0x005F,0x0064,
- 0x0068,0x006C,0x0071,0x0075,0x007A,0x007E,0x0083,0x0087,
- 0x008C,0x0090,0x0095,0x0099,0x009E,0x00A2,0x00A7,0x00AB,
- 0x00B0,0x00B5,0x00B9,0x00BE,0x00C2,0x00C7,0x00CC,0x00D1,
- 0x00D5,0x00DA,0x00DF,0x00E3,0x00E8,0x00ED,0x00F2,0x00F6,
- 0x00FB,0x0100,0x0105,0x010A,0x010F,0x0114,0x0118,0x011D,
- 0x0122,0x0127,0x012C,0x0131,0x0136,0x013B,0x0140,0x0145,
- 0x014A,0x014F,0x0154,0x0159,0x015E,0x0163,0x0168,0x016E,
- 0x0173,0x0178,0x017D,0x0182,0x0187,0x018C,0x0192,0x0197,
- 0x019C,0x01A1,0x01A6,0x01AC,0x01B1,0x01B6,0x01BC,0x01C1,
- 0x01C6,0x01CB,0x01D1,0x01D6,0x01DC,0x01E1,0x01E6,0x01EC,
- 0x01F1,0x01F6,0x01FC,0x0201,0x0207,0x020C,0x0212,0x0217,
- 0x021D,0x0222,0x0228,0x022D,0x0233,0x0238,0x023E,0x0243,
- 0x0249,0x024F,0x0254,0x025A,0x025F,0x0265,0x026B,0x0270,
- 0x0276,0x027C,0x0281,0x0287,0x028D,0x0292,0x0298,0x029E,
- 0x02A4,0x02A9,0x02AF,0x02B5,0x02BB,0x02C0,0x02C6,0x02CC,
- 0x02D2,0x02D8,0x02DE,0x02E3,0x02E9,0x02EF,0x02F5,0x02FB,
- 0x0301,0x0307,0x030D,0x0312,0x0318,0x031E,0x0324,0x032A,
- 0x0330,0x0336,0x033C,0x0342,0x0348,0x034E,0x0354,0x035A,
- 0x0360,0x0366,0x036C,0x0372,0x0378,0x037E,0x0384,0x038A,
- 0x0391,0x0397,0x039D,0x03A3,0x03A9,0x03AF,0x03B5,0x03BB,
- 0x03C1,0x03C8,0x03CE,0x03D4,0x03DA,0x03E0,0x03E6,0x03ED,
- 0x03F3,0x03F9,0x03FF,0x0405,0x040C,0x0412,0x0418,0x041E,
- 0x0425,0x042B,0x0431,0x0437,0x043E,0x0444,0x044A,0x0450,
- 0x0457,0x045D,0x0463,0x046A,0x0470,0x0476,0x047D,0x0483,
- 0x0489,0x0490,0x0496,0x049C,0x04A3,0x04A9,0x04AF,0x04B6,
- 0x04BC,0x04C2,0x04C9,0x04CF,0x04D6,0x04DC,0x04E2,0x04E9,
- 0x04EF,0x04F6,0x04FC,0x0502,0x0509,0x050F,0x0516,0x051C,
- 0x0523,0x0529,0x052F,0x0536,0x053C,0x0543,0x0549,0x0550,
- 0x0556,0x055D,0x0563,0x056A,0x0570,0x0577,0x057D,0x0584,
- 0x058A,0x0591,0x0597,0x059E,0x05A4,0x05AB,0x05B1,0x05B8,
- 0x05BE,0x05C5,0x05CB,0x05D2,0x05D8,0x05DF,0x05E6,0x05EC,
- 0x05F3,0x05F9,0x0600,0x0606,0x060D,0x0613,0x061A,0x0621,
- 0x0627,0x062E,0x0634,0x063B,0x0641,0x0648,0x064F,0x0655,
- 0x065C,0x0662,0x0669,0x0670,0x0676,0x067D,0x0683,0x068A,
- 0x0691,0x0697,0x069E,0x06A4,0x06AB,0x06B2,0x06B8,0x06BF,
- 0x06C6,0x06CC,0x06D3,0x06DA,0x06E0,0x06E7,0x06ED,0x06F4,
- 0x06FB,0x0701,0x0708,0x070F,0x0715,0x071C,0x0723,0x0729,
- 0x0730,0x0737,0x073D,0x0744,0x074B,0x0751,0x0758,0x075F,
- 0x0765,0x076C,0x0773,0x0779,0x0780,0x0787,0x078D,0x0794,
- 0x079B,0x07A2,0x07A8,0x07AF,0x07B6,0x07BC,0x07C3,0x07CA,
- 0x07D0,0x07D7,0x07DE,0x07E5,0x07EB,0x07F2,0x07F9,0x07FF,
- 0x0806,0x080D,0x0814,0x081A,0x0821,0x0828,0x082F,0x0835,
- 0x083C,0x0843,0x0849,0x0850,0x0857,0x085E,0x0864,0x086B,
- 0x0872,0x0879,0x0880,0x0886,0x088D,0x0894,0x089B,0x08A1,
- 0x08A8,0x08AF,0x08B6,0x08BC,0x08C3,0x08CA,0x08D1,0x08D8,
- 0x08DE,0x08E5,0x08EC,0x08F3,0x08FA,0x0900,0x0907,0x090E,
- 0x0915,0x091C,0x0922,0x0929,0x0930,0x0937,0x093E,0x0945,
- 0x094B,0x0952,0x0959,0x0960,0x0967,0x096E,0x0975,0x097B,
- 0x0982,0x0989,0x0990,0x0997,0x099E,0x09A5,0x09AB,0x09B2,
- 0x09B9,0x09C0,0x09C7,0x09CE,0x09D5,0x09DC,0x09E3,0x09EA,
- 0x09F0,0x09F7,0x09FE,0x0A05,0x0A0C,0x0A13,0x0A1A,0x0A21,
- 0x0A28,0x0A2F,0x0A36,0x0A3D,0x0A44,0x0A4B,0x0A52,0x0A59,
- 0x0A60,0x0A67,0x0A6E,0x0A75,0x0A7C,0x0A83,0x0A8A,0x0A91,
- 0x0A98,0x0A9F,0x0AA6,0x0AAD,0x0AB4,0x0ABB,0x0AC2,0x0AC9,
- 0x0AD0,0x0AD7,0x0ADE,0x0AE5,0x0AEC,0x0AF4,0x0AFB,0x0B02,
- 0x0B09,0x0B10,0x0B17,0x0B1E,0x0B25,0x0B2D,0x0B34,0x0B3B,
- 0x0B42,0x0B49,0x0B50,0x0B58,0x0B5F,0x0B66,0x0B6D,0x0B74,
- 0x0B7C,0x0B83,0x0B8A,0x0B91,0x0B98,0x0BA0,0x0BA7,0x0BAE,
- 0x0BB6,0x0BBD,0x0BC4,0x0BCB,0x0BD3,0x0BDA,0x0BE1,0x0BE9,
- 0x0BF0,0x0BF7,0x0BFF,0x0C06,0x0C0D,0x0C15,0x0C1C,0x0C24,
- 0x0C2B,0x0C32,0x0C3A,0x0C41,0x0C49,0x0C50,0x0C58,0x0C5F,
- 0x0C67,0x0C6E,0x0C76,0x0C7D,0x0C85,0x0C8C,0x0C94,0x0C9B,
- 0x0CA3,0x0CAA,0x0CB2,0x0CBA,0x0CC1,0x0CC9,0x0CD0,0x0CD8,
- 0x0CE0,0x0CE7,0x0CEF,0x0CF7,0x0CFE,0x0D06,0x0D0E,0x0D16,
- 0x0D1D,0x0D25,0x0D2D,0x0D35,0x0D3C,0x0D44,0x0D4C,0x0D54,
- 0x0D5C,0x0D63,0x0D6B,0x0D73,0x0D7B,0x0D83,0x0D8B,0x0D93,
- 0x0D9B,0x0DA3,0x0DAB,0x0DB3,0x0DBB,0x0DC3,0x0DCB,0x0DD3,
- 0x0DDB,0x0DE3,0x0DEB,0x0DF3,0x0DFB,0x0E03,0x0E0B,0x0E14,
- 0x0E1C,0x0E24,0x0E2C,0x0E34,0x0E3D,0x0E45,0x0E4D,0x0E55,
- 0x0E5E,0x0E66,0x0E6E,0x0E77,0x0E7F,0x0E87,0x0E90,0x0E98,
- 0x0EA1,0x0EA9,0x0EB2,0x0EBA,0x0EC2,0x0ECB,0x0ED4,0x0EDC,
- 0x0EE5,0x0EED,0x0EF6,0x0EFF,0x0F07,0x0F10,0x0F19,0x0F21,
- 0x0F2A,0x0F33,0x0F3B,0x0F44,0x0F4D,0x0F56,0x0F5F,0x0F68,
- 0x0F71,0x0F79,0x0F82,0x0F8B,0x0F94,0x0F9D,0x0FA6,0x0FAF,
- 0x0FB8,0x0FC2,0x0FCB,0x0FD4,0x0FDD,0x0FE6,0x0FEF,0x0FF9,
- 0x1002,0x100B,0x1014,0x101E,0x1027,0x1030,0x103A,0x1043,
- 0x104D,0x1056,0x1060,0x1069,0x1073,0x107C,0x1086,0x108F,
- 0x1099,0x10A3,0x10AC,0x10B6,0x10C0,0x10CA,0x10D3,0x10DD,
- 0x10E7,0x10F1,0x10FB,0x1105,0x110F,0x1119,0x1123,0x112D,
- 0x1137,0x1141,0x114B,0x1156,0x1160,0x116A,0x1174,0x117F,
- 0x1189,0x1193,0x119E,0x11A8,0x11B3,0x11BD,0x11C8,0x11D2,
- 0x11DD,0x11E8,0x11F2,0x11FD,0x1208,0x1213,0x121D,0x1228,
- 0x1233,0x123E,0x1249,0x1254,0x125F,0x126A,0x1275,0x1280,
- 0x128B,0x1297,0x12A2,0x12AD,0x12B9,0x12C4,0x12CF,0x12DB,
- 0x12E6,0x12F2,0x12FD,0x1309,0x1315,0x1320,0x132C,0x1338,
- 0x1344,0x1350,0x135B,0x1367,0x1373,0x137F,0x138C,0x1398,
- 0x13A4,0x13B0,0x13BC,0x13C9,0x13D5,0x13E1,0x13EE,0x13FA,
- 0x1407,0x1414,0x1420,0x142D,0x143A,0x1446,0x1453,0x1460,
- 0x146D,0x147A,0x1487,0x1494,0x14A2,0x14AF,0x14BC,0x14C9,
- 0x14D7,0x14E4,0x14F2,0x14FF,0x150D,0x151A,0x1528,0x1536,
- 0x1544,0x1552,0x1560,0x156E,0x157C,0x158A,0x1598,0x15A6,
- 0x15B5,0x15C3,0x15D1,0x15E0,0x15EF,0x15FD,0x160C,0x161B,
- 0x1629,0x1638,0x1647,0x1656,0x1665,0x1675,0x1684,0x1693,
- 0x16A3,0x16B2,0x16C2,0x16D1,0x16E1,0x16F1,0x1700,0x1710,
- 0x1720,0x1730,0x1741,0x1751,0x1761,0x1771,0x1782,0x1792,
- 0x17A3,0x17B4,0x17C5,0x17D5,0x17E6,0x17F7,0x1808,0x181A,
- 0x182B,0x183C,0x184E,0x185F,0x1871,0x1883,0x1895,0x18A7,
- 0x18B9,0x18CB,0x18DD,0x18EF,0x1902,0x1914,0x1927,0x1939,
- 0x194C,0x195F,0x1972,0x1985,0x1998,0x19AC,0x19BF,0x19D3,
- 0x19E6,0x19FA,0x1A0E,0x1A22,0x1A36,0x1A4A,0x1A5F,0x1A73,
- 0x1A88,0x1A9C,0x1AB1,0x1AC6,0x1ADB,0x1AF0,0x1B06,0x1B1B,
- 0x1B31,0x1B46,0x1B5C,0x1B72,0x1B88,0x1B9E,0x1BB5,0x1BCB,
- 0x1BE2,0x1BF8,0x1C0F,0x1C26,0x1C3E,0x1C55,0x1C6C,0x1C84,
- 0x1C9C,0x1CB4,0x1CCC,0x1CE4,0x1CFC,0x1D15,0x1D2E,0x1D47,
- 0x1D60,0x1D79,0x1D92,0x1DAC,0x1DC5,0x1DDF,0x1DF9,0x1E14,
- 0x1E2E,0x1E49,0x1E63,0x1E7E,0x1E99,0x1EB5,0x1ED0,0x1EEC,
- 0x1F08,0x1F24,0x1F40,0x1F5D,0x1F79,0x1F96,0x1FB4,0x1FD1,
- 0x1FEE,0x200C,0x202A,0x2048,0x2067,0x2085,0x20A4,0x20C3,
- 0x20E3,0x2102,0x2122,0x2142,0x2163,0x2183,0x21A4,0x21C5,
- 0x21E6,0x2208,0x222A,0x224C,0x226E,0x2291,0x22B4,0x22D7,
- 0x22FB,0x231F,0x2343,0x2367,0x238C,0x23B1,0x23D6,0x23FC,
- 0x2422,0x2448,0x246F,0x2496,0x24BD,0x24E5,0x250D,0x2535,
- 0x255E,0x2587,0x25B0,0x25DA,0x2604,0x262F,0x265A,0x2685,
- 0x26B1,0x26DD,0x2709,0x2736,0x2764,0x2791,0x27C0,0x27EE,
- 0x281E,0x284D,0x287D,0x28AE,0x28DF,0x2910,0x2942,0x2974,
- 0x29A7,0x29DB,0x2A0F,0x2A43,0x2A79,0x2AAE,0x2AE4,0x2B1B,
- 0x2B52,0x2B8A,0x2BC3,0x2BFC,0x2C36,0x2C70,0x2CAB,0x2CE7,
- 0x2D23,0x2D60,0x2D9D,0x2DDC,0x2E1B,0x2E5A,0x2E9B,0x2EDC,
- 0x2F1E,0x2F61,0x2FA4,0x2FE9,0x302E,0x3074,0x30BB,0x3102,
- 0x314B,0x3194,0x31DF,0x322A,0x3276,0x32C3,0x3311,0x3361,
- 0x33B1,0x3402,0x3454,0x34A8,0x34FC,0x3552,0x35A9,0x3601,
- 0x365A,0x36B4,0x3710,0x376D,0x37CB,0x382B,0x388C,0x38EE,
- 0x3952,0x39B7,0x3A1E,0x3A86,0x3AF0,0x3B5B,0x3BC9,0x3C37,
- 0x3CA8,0x3D1A,0x3D8E,0x3E04,0x3E7C,0x3EF6,0x3F72,0x3FF0
-};
-private short esp_dat_y[] = {
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
- 0x0000,0x004B,0x004F,0x0054,0x0058,0x005D,0x0061,0x0066,
- 0x006A,0x006F,0x0073,0x0078,0x007D,0x0081,0x0086,0x008B,
- 0x008F,0x0094,0x0099,0x009D,0x00A2,0x00A7,0x00AC,0x00B1,
- 0x00B5,0x00BA,0x00BF,0x00C4,0x00C9,0x00CE,0x00D3,0x00D8,
- 0x00DD,0x00E2,0x00E7,0x00EC,0x00F1,0x00F6,0x00FB,0x0100,
- 0x0105,0x010A,0x010F,0x0115,0x011A,0x011F,0x0124,0x012A,
- 0x012F,0x0134,0x0139,0x013F,0x0144,0x0149,0x014F,0x0154,
- 0x015A,0x015F,0x0164,0x016A,0x016F,0x0175,0x017A,0x0180,
- 0x0185,0x018B,0x0191,0x0196,0x019C,0x01A1,0x01A7,0x01AD,
- 0x01B3,0x01B8,0x01BE,0x01C4,0x01C9,0x01CF,0x01D5,0x01DB,
- 0x01E1,0x01E7,0x01EC,0x01F2,0x01F8,0x01FE,0x0204,0x020A,
- 0x0210,0x0216,0x021C,0x0222,0x0228,0x022E,0x0234,0x023A,
- 0x0240,0x0246,0x024C,0x0253,0x0259,0x025F,0x0265,0x026B,
- 0x0272,0x0278,0x027E,0x0284,0x028B,0x0291,0x0297,0x029E,
- 0x02A4,0x02AA,0x02B1,0x02B7,0x02BE,0x02C4,0x02CB,0x02D1,
- 0x02D8,0x02DE,0x02E5,0x02EB,0x02F2,0x02F8,0x02FF,0x0305,
- 0x030C,0x0313,0x0319,0x0320,0x0327,0x032D,0x0334,0x033B,
- 0x0341,0x0348,0x034F,0x0356,0x035D,0x0363,0x036A,0x0371,
- 0x0378,0x037F,0x0386,0x038C,0x0393,0x039A,0x03A1,0x03A8,
- 0x03AF,0x03B6,0x03BD,0x03C4,0x03CB,0x03D2,0x03D9,0x03E0,
- 0x03E7,0x03EE,0x03F5,0x03FD,0x0404,0x040B,0x0412,0x0419,
- 0x0420,0x0427,0x042F,0x0436,0x043D,0x0444,0x044C,0x0453,
- 0x045A,0x0461,0x0469,0x0470,0x0477,0x047F,0x0486,0x048D,
- 0x0495,0x049C,0x04A3,0x04AB,0x04B2,0x04BA,0x04C1,0x04C9,
- 0x04D0,0x04D7,0x04DF,0x04E6,0x04EE,0x04F5,0x04FD,0x0504,
- 0x050C,0x0514,0x051B,0x0523,0x052A,0x0532,0x0539,0x0541,
- 0x0549,0x0550,0x0558,0x0560,0x0567,0x056F,0x0577,0x057E,
- 0x0586,0x058E,0x0595,0x059D,0x05A5,0x05AD,0x05B4,0x05BC,
- 0x05C4,0x05CC,0x05D3,0x05DB,0x05E3,0x05EB,0x05F3,0x05FB,
- 0x0602,0x060A,0x0612,0x061A,0x0622,0x062A,0x0632,0x0639,
- 0x0641,0x0649,0x0651,0x0659,0x0661,0x0669,0x0671,0x0679,
- 0x0681,0x0689,0x0691,0x0699,0x06A1,0x06A9,0x06B1,0x06B9,
- 0x06C1,0x06C9,0x06D1,0x06D9,0x06E1,0x06E9,0x06F1,0x06F9,
- 0x0701,0x0709,0x0711,0x0719,0x0722,0x072A,0x0732,0x073A,
- 0x0742,0x074A,0x0752,0x075A,0x0762,0x076B,0x0773,0x077B,
- 0x0783,0x078B,0x0793,0x079C,0x07A4,0x07AC,0x07B4,0x07BC,
- 0x07C5,0x07CD,0x07D5,0x07DD,0x07E5,0x07EE,0x07F6,0x07FE,
- 0x0806,0x080F,0x0817,0x081F,0x0827,0x0830,0x0838,0x0840,
- 0x0848,0x0851,0x0859,0x0861,0x086A,0x0872,0x087A,0x0883,
- 0x088B,0x0893,0x089B,0x08A4,0x08AC,0x08B4,0x08BD,0x08C5,
- 0x08CD,0x08D6,0x08DE,0x08E6,0x08EF,0x08F7,0x0900,0x0908,
- 0x0910,0x0919,0x0921,0x0929,0x0932,0x093A,0x0943,0x094B,
- 0x0953,0x095C,0x0964,0x096D,0x0975,0x097D,0x0986,0x098E,
- 0x0997,0x099F,0x09A8,0x09B0,0x09B8,0x09C1,0x09C9,0x09D2,
- 0x09DA,0x09E3,0x09EB,0x09F4,0x09FC,0x0A04,0x0A0D,0x0A15,
- 0x0A1E,0x0A26,0x0A2F,0x0A37,0x0A40,0x0A48,0x0A51,0x0A59,
- 0x0A62,0x0A6A,0x0A73,0x0A7B,0x0A84,0x0A8C,0x0A95,0x0A9D,
- 0x0AA6,0x0AAE,0x0AB7,0x0ABF,0x0AC8,0x0AD0,0x0AD9,0x0AE2,
- 0x0AEA,0x0AF3,0x0AFB,0x0B04,0x0B0C,0x0B15,0x0B1D,0x0B26,
- 0x0B2F,0x0B37,0x0B40,0x0B48,0x0B51,0x0B5A,0x0B62,0x0B6B,
- 0x0B73,0x0B7C,0x0B84,0x0B8D,0x0B96,0x0B9E,0x0BA7,0x0BB0,
- 0x0BB8,0x0BC1,0x0BC9,0x0BD2,0x0BDB,0x0BE3,0x0BEC,0x0BF5,
- 0x0BFD,0x0C06,0x0C0F,0x0C17,0x0C20,0x0C29,0x0C31,0x0C3A,
- 0x0C43,0x0C4B,0x0C54,0x0C5D,0x0C65,0x0C6E,0x0C77,0x0C80,
- 0x0C88,0x0C91,0x0C9A,0x0CA2,0x0CAB,0x0CB4,0x0CBD,0x0CC5,
- 0x0CCE,0x0CD7,0x0CE0,0x0CE9,0x0CF1,0x0CFA,0x0D03,0x0D0C,
- 0x0D14,0x0D1D,0x0D26,0x0D2F,0x0D38,0x0D40,0x0D49,0x0D52,
- 0x0D5B,0x0D64,0x0D6D,0x0D75,0x0D7E,0x0D87,0x0D90,0x0D99,
- 0x0DA2,0x0DAB,0x0DB4,0x0DBC,0x0DC5,0x0DCE,0x0DD7,0x0DE0,
- 0x0DE9,0x0DF2,0x0DFB,0x0E04,0x0E0D,0x0E16,0x0E1F,0x0E28,
- 0x0E31,0x0E3A,0x0E43,0x0E4C,0x0E55,0x0E5E,0x0E67,0x0E70,
- 0x0E79,0x0E82,0x0E8B,0x0E94,0x0E9D,0x0EA6,0x0EAF,0x0EB8,
- 0x0EC1,0x0ECA,0x0ED4,0x0EDD,0x0EE6,0x0EEF,0x0EF8,0x0F01,
- 0x0F0A,0x0F14,0x0F1D,0x0F26,0x0F2F,0x0F38,0x0F42,0x0F4B,
- 0x0F54,0x0F5D,0x0F67,0x0F70,0x0F79,0x0F82,0x0F8C,0x0F95,
- 0x0F9E,0x0FA8,0x0FB1,0x0FBA,0x0FC4,0x0FCD,0x0FD6,0x0FE0,
- 0x0FE9,0x0FF3,0x0FFC,0x1006,0x100F,0x1018,0x1022,0x102B,
- 0x1035,0x103E,0x1048,0x1051,0x105B,0x1065,0x106E,0x1078,
- 0x1081,0x108B,0x1094,0x109E,0x10A8,0x10B1,0x10BB,0x10C5,
- 0x10CE,0x10D8,0x10E2,0x10EC,0x10F5,0x10FF,0x1109,0x1113,
- 0x111C,0x1126,0x1130,0x113A,0x1144,0x114E,0x1158,0x1161,
- 0x116B,0x1175,0x117F,0x1189,0x1193,0x119D,0x11A7,0x11B1,
- 0x11BB,0x11C5,0x11CF,0x11DA,0x11E4,0x11EE,0x11F8,0x1202,
- 0x120C,0x1217,0x1221,0x122B,0x1235,0x1240,0x124A,0x1254,
- 0x125E,0x1269,0x1273,0x127E,0x1288,0x1292,0x129D,0x12A7,
- 0x12B2,0x12BC,0x12C7,0x12D1,0x12DC,0x12E7,0x12F1,0x12FC,
- 0x1306,0x1311,0x131C,0x1327,0x1331,0x133C,0x1347,0x1352,
- 0x135C,0x1367,0x1372,0x137D,0x1388,0x1393,0x139E,0x13A9,
- 0x13B4,0x13BF,0x13CA,0x13D5,0x13E0,0x13EB,0x13F6,0x1402,
- 0x140D,0x1418,0x1423,0x142F,0x143A,0x1445,0x1451,0x145C,
- 0x1468,0x1473,0x147E,0x148A,0x1496,0x14A1,0x14AD,0x14B8,
- 0x14C4,0x14D0,0x14DB,0x14E7,0x14F3,0x14FF,0x150A,0x1516,
- 0x1522,0x152E,0x153A,0x1546,0x1552,0x155E,0x156A,0x1576,
- 0x1582,0x158F,0x159B,0x15A7,0x15B3,0x15C0,0x15CC,0x15D8,
- 0x15E5,0x15F1,0x15FE,0x160A,0x1617,0x1623,0x1630,0x163D,
- 0x1649,0x1656,0x1663,0x1670,0x167D,0x168A,0x1696,0x16A3,
- 0x16B0,0x16BE,0x16CB,0x16D8,0x16E5,0x16F2,0x16FF,0x170D,
- 0x171A,0x1727,0x1735,0x1742,0x1750,0x175D,0x176B,0x1779,
- 0x1786,0x1794,0x17A2,0x17B0,0x17BD,0x17CB,0x17D9,0x17E7,
- 0x17F5,0x1803,0x1812,0x1820,0x182E,0x183C,0x184B,0x1859,
- 0x1867,0x1876,0x1884,0x1893,0x18A2,0x18B0,0x18BF,0x18CE,
- 0x18DD,0x18EC,0x18FB,0x190A,0x1919,0x1928,0x1937,0x1946,
- 0x1956,0x1965,0x1974,0x1984,0x1993,0x19A3,0x19B3,0x19C2,
- 0x19D2,0x19E2,0x19F2,0x1A02,0x1A12,0x1A22,0x1A32,0x1A42,
- 0x1A53,0x1A63,0x1A73,0x1A84,0x1A94,0x1AA5,0x1AB6,0x1AC6,
- 0x1AD7,0x1AE8,0x1AF9,0x1B0A,0x1B1B,0x1B2C,0x1B3E,0x1B4F,
- 0x1B60,0x1B72,0x1B83,0x1B95,0x1BA7,0x1BB8,0x1BCA,0x1BDC,
- 0x1BEE,0x1C00,0x1C13,0x1C25,0x1C37,0x1C4A,0x1C5C,0x1C6F,
- 0x1C81,0x1C94,0x1CA7,0x1CBA,0x1CCD,0x1CE0,0x1CF3,0x1D06,
- 0x1D1A,0x1D2D,0x1D41,0x1D55,0x1D68,0x1D7C,0x1D90,0x1DA4,
- 0x1DB8,0x1DCD,0x1DE1,0x1DF5,0x1E0A,0x1E1E,0x1E33,0x1E48,
- 0x1E5D,0x1E72,0x1E87,0x1E9D,0x1EB2,0x1EC7,0x1EDD,0x1EF3,
- 0x1F09,0x1F1F,0x1F35,0x1F4B,0x1F61,0x1F78,0x1F8E,0x1FA5,
- 0x1FBC,0x1FD2,0x1FE9,0x2001,0x2018,0x202F,0x2047,0x205F,
- 0x2076,0x208E,0x20A6,0x20BF,0x20D7,0x20EF,0x2108,0x2121,
- 0x213A,0x2153,0x216C,0x2185,0x219F,0x21B9,0x21D2,0x21EC,
- 0x2206,0x2221,0x223B,0x2256,0x2271,0x228B,0x22A7,0x22C2,
- 0x22DD,0x22F9,0x2315,0x2330,0x234D,0x2369,0x2385,0x23A2,
- 0x23BF,0x23DC,0x23F9,0x2416,0x2434,0x2452,0x2470,0x248E,
- 0x24AC,0x24CB,0x24EA,0x2509,0x2528,0x2547,0x2567,0x2587,
- 0x25A7,0x25C7,0x25E8,0x2609,0x262A,0x264B,0x266C,0x268E,
- 0x26B0,0x26D2,0x26F4,0x2717,0x273A,0x275D,0x2781,0x27A4,
- 0x27C8,0x27ED,0x2811,0x2836,0x285B,0x2880,0x28A6,0x28CC,
- 0x28F2,0x2919,0x2940,0x2967,0x298E,0x29B6,0x29DE,0x2A06,
- 0x2A2F,0x2A58,0x2A81,0x2AAB,0x2AD5,0x2B00,0x2B2A,0x2B55,
- 0x2B81,0x2BAD,0x2BD9,0x2C06,0x2C33,0x2C60,0x2C8E,0x2CBC,
- 0x2CEA,0x2D19,0x2D49,0x2D78,0x2DA9,0x2DD9,0x2E0A,0x2E3C,
- 0x2E6E,0x2EA0,0x2ED3,0x2F07,0x2F3B,0x2F6F,0x2FA4,0x2FD9,
- 0x300F,0x3046,0x307C,0x30B4,0x30EC,0x3124,0x315E,0x3197,
- 0x31D1,0x320C,0x3248,0x3284,0x32C0,0x32FE,0x333C,0x337A,
- 0x33B9,0x33F9,0x343A,0x347B,0x34BD,0x3500,0x3543,0x3587,
- 0x35CC,0x3612,0x3658,0x369F,0x36E7,0x3730,0x377A,0x37C4,
- 0x3810,0x385C,0x38A9,0x38F7,0x3946,0x3996,0x39E7,0x3A39,
- 0x3A8C,0x3AE0,0x3B35,0x3B8B,0x3BE2,0x3C3B,0x3C94,0x3CEF,
- 0x3D4A,0x3DA7,0x3E05,0x3E65,0x3EC6,0x3F28,0x3F8B,0x3FF0
-};
-#ifdef __STDC__
-private signed short barrier_dat[] = {
-#else
-private short barrier_dat[] = {
-#endif
- 0x3FF0,0x3FF0,0x3000,0x1555,0x0C00,0x07AE,0x0555,0x03EB,
- 0x0300,0x025E,0x01EB,0x0196,0x3FF0,0x3FF0,0x2666,0x1333,
- 0x0B4B,0x0762,0x0530,0x03D7,0x02F4,0x0257,0x01E6,0x0192,
- 0x3000,0x2666,0x1800,0x0EC4,0x0999,0x069E,0x04CC,0x039F,
- 0x02D2,0x0242,0x01D8,0x0189,0x1555,0x1333,0x0EC4,0x0AAA,
- 0x07AE,0x05A5,0x0444,0x034F,0x02A1,0x0222,0x01C2,0x017A,
- 0x0C00,0x0B4B,0x0999,0x07AE,0x0600,0x04AE,0x03B1,0x02F4,
- 0x0266,0x01FA,0x01A7,0x0166,0x07AE,0x0762,0x069E,0x05A5,
- 0x04AE,0x03D7,0x0325,0x0298,0x0228,0x01CF,0x0189,0x0150,
- 0x0555,0x0530,0x04CC,0x0444,0x03B1,0x0325,0x02AA,0x0242,
- 0x01EB,0x01A4,0x0169,0x0139,0x03EB,0x03D7,0x039F,0x034F,
- 0x02F4,0x0298,0x0242,0x01F5,0x01B2,0x017A,0x0149,0x0121,
- 0x0300,0x02F4,0x02D2,0x02A1,0x0266,0x0228,0x01EB,0x01B2,
- 0x0180,0x0152,0x012B,0x0109,0x025E,0x0257,0x0242,0x0222,
- 0x01FA,0x01CF,0x01A4,0x017A,0x0152,0x012F,0x010F,0x00F3,
- 0x01EB,0x01E6,0x01D8,0x01C2,0x01A7,0x0189,0x0169,0x0149,
- 0x012B,0x010F,0x00F5,0x00DE,0x0196,0x0192,0x0189,0x017A,
- 0x0166,0x0150,0x0139,0x0121,0x0109,0x00F3,0x00DE,0x00CB
-};
diff --git a/gs/contrib/japanese/gdevml6.c b/gs/contrib/japanese/gdevml6.c
deleted file mode 100644
index 6b53b74e6..000000000
--- a/gs/contrib/japanese/gdevml6.c
+++ /dev/null
@@ -1,353 +0,0 @@
-/* Copyright (C) 1991 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. */
-
-/* gdevml6.c */
-/* OKI MICROLINE 620CL IPL mode driver for Ghostscript */
-/*
- Mar. 14, 1998 N.Tagawa
-
- $Id: gdevml6.c,v 1.4 2002/07/30 18:53:22 easysw Exp $
-*/
-
-#include "gdevprn.h"
-
-/* The device descriptors */
-private dev_proc_open_device(ml600_open);
-private dev_proc_close_device(ml600_close);
-private dev_proc_print_page(ml600_print_page);
-
-private gx_device_procs ml600_procs =
- prn_procs(ml600_open, gdev_prn_output_page, ml600_close);
-
-gx_device_printer gs_ml600_device =
- prn_device(ml600_procs, "ml600",
- 83, /* width_10ths, 8.3" */
- 117, /* height_10ths, 11.7" */
- 600, 600,
- 0.20, 0.20, 0.20, 0.20, /* margins, lbrt */
- 1, ml600_print_page);
-
-
-/* ------ prototype ------ */
-private int
-ml_finish(
- gx_device_printer *pdev,
- FILE *fp);
-
-private int
-ml_init(
- gx_device_printer *pdev,
- FILE *fp);
-
-private int
-move_pos(
- FILE *fp,
- int n,
- int m);
-
-private int
-make_line_data(
- byte *curr_data,
- byte *last_data,
- int line_size,
- byte *buf);
-
-private int
-send_line(
- byte *buf,
- int cnt,
- FILE *fp);
-
-private int
-page_header(
- gx_device_printer *pdev,
- FILE *fp);
-
-/* ------ Internal routines ------ */
-
-#define ESC 0x1b
-#define LINE_SIZE ((7016+7) / 8) /* bytes per line (A4 600 DPI) */
-#define ppdev ((gx_device_printer *)pdev)
-
-
-private int
-ml600_open(
- gx_device *pdev)
-{
- int code = gdev_prn_open(pdev);
- FILE *prn_stream;
-
- /* fprintf(stderr, "gdevml6: ml600_open called\n");*/
-
- if (code < 0)
- return code;
-
- code = gdev_prn_open_printer(pdev, true);
- if (code < 0)
- return code;
-
- prn_stream = ppdev->file;
- return ml_init(ppdev, prn_stream);
-}
-
-private int
-ml600_close(
- gx_device *pdev)
-{
- int code = gdev_prn_open_printer(pdev, true);
- FILE *prn_stream;
-
- /* fprintf(stderr, "gdevml6: ml600_close called\n"); */
- if (code < 0)
- return code;
-
- prn_stream = ppdev->file;
- ml_finish(ppdev, prn_stream);
-
- return gdev_prn_close(pdev);
-}
-
-
-/* Send the page to the printer. */
-private int
-ml600_print_page(
- gx_device_printer *pdev,
- FILE *prn_stream)
-{
- int ystep;
- byte data[2][LINE_SIZE*2];
- byte buf[LINE_SIZE*2];
- int skip;
- int current;
- int c_size;
- int lnum;
- int line_size;
- byte rmask;
- int i;
-
-#define LAST ((current ^ 1) & 1)
-
- /* initialize this page */
- ystep = page_header(pdev, prn_stream);
- ystep /= 300;
-
- /* clear last sent line buffer */
- skip = 0;
- current = 0;
- for (i = 0; i < LINE_SIZE*2; i++)
- data[LAST][i] = 0;
-
- /* Send each scan line */
- line_size = gdev_mem_bytes_per_scan_line((gx_device *)pdev);
- if (line_size > LINE_SIZE || line_size == 0)
- return 0;
-
- rmask = (byte)(0xff << (-pdev->width & 7)); /* right edge */
-
- for (lnum = 0; lnum < pdev->height; lnum++) {
- int s;
-
- s = gdev_prn_copy_scan_lines(pdev, lnum, data[current],
- line_size);
- /* Mask right edge bits */
- *(data[current] + line_size - 1) &= rmask;
-
- /* blank line ? */
- for (i = 0; i < line_size; i++)
- if (data[current][i] != 0)
- break;
-
- if (i == line_size) {
- skip = 1;
- current = LAST;
- continue;
- }
-
- /* move position, if previous lines are skipped */
- if (skip) {
- move_pos(prn_stream, lnum / ystep, lnum % ystep);
- skip = 0;
- }
-
- /* create one line data */
- c_size = make_line_data(data[current], data[LAST],
- line_size, buf);
-
- /* send one line data */
- send_line(buf, c_size, prn_stream);
-
- /* swap line buffer */
- current = LAST;
- }
-
- /* eject page */
- fprintf(prn_stream, "\014");
-
- return 0;
-}
-
-
-private int
-move_pos(
- FILE *fp,
- int n,
- int m)
-{
- fprintf(fp, "%c%c%c%c%c%c", ESC, 0x7c, 0xa6, 1, 0, 2);
- fprintf(fp, "%c%c%c%c%c%c%c%c%c", ESC, 0x7c, 0xa4, 4, 0,
- (n >> 8) & 0xff, n & 0xff, 0, 0);
- if (m > 0) {
- int i;
-
- fprintf(fp, "%c%c%c%c%c%c", ESC, 0x7c, 0xa6, 1, 0, 0);
- for (i = 0; i < m; i++) {
- fprintf(fp, "%c%c%c%c%c%c", ESC, 0x7c, 0xa7, 0, 1, 0);
- }
- }
- fprintf(fp, "%c%c%c%c%c%c", ESC, 0x7c, 0xa6, 1, 0, 3);
-
- return 0;
-}
-
-
-private int
-make_line_data(
- byte *curr_data,
- byte *last_data,
- int line_size,
- byte *buf)
-{
- int i; /* raster data index */
- int n; /* output data index */
- int bytes; /* num of bitimage bytes in one block */
- int offs;
-
-#define TOP_BYTE(bytes,offs) ((((bytes - 1) & 7) << 5) | (offs & 0x1f))
-
- i = 0;
- n = 0;
-
- while (i < line_size) {
- /* skip unchanged bytes */
- offs = 0;
- while (i < line_size && curr_data[i] == last_data[i]) {
- i++;
- offs++;
- }
- if (i >= line_size)
- break;
-
- /* count changed bytes (max 8) */
- bytes = 1;
- while (i + bytes < line_size && bytes < 8 &&
- curr_data[i + bytes] != last_data[i + bytes]) {
- bytes++;
- }
-
- /* make data */
- if (offs < 0x1f) {
- buf[n++] = TOP_BYTE(bytes, offs);
- }
- else {
- offs -= 0x1f;
- buf[n++] = TOP_BYTE(bytes, 0x1f);
-
- while (offs >= 0xff) {
- offs -= 0xff;
- buf[n++] = 0xff;
- }
- buf[n++] = offs;
- }
-
- /* write bitimage */
- while (bytes > 0) {
- buf[n++] = curr_data[i++];
- --bytes;
- }
- }
-
- return n;
-}
-
-
-private int
-send_line(
- byte *buf,
- int cnt,
- FILE *fp)
-{
- fprintf(fp, "%c%c%c", ESC, 0x7c, 0xa7);
- fprintf(fp, "%c%c", (cnt >> 8) & 0xff, cnt & 0xff);
- return fwrite(buf, sizeof(byte), cnt, fp);
-}
-
-
-private int
-ml_init(
- gx_device_printer *pdev,
- FILE *fp)
-{
- /* fprintf(stderr, "gdevml6: ml_init called\n"); */
-
- fprintf(fp, "%c%c%c", ESC, 0x2f, 0xf2);
-
- return 0;
-}
-
-
-private int
-page_header(
- gx_device_printer *pdev,
- FILE *fp)
-{
- int ydpi;
-
- fprintf(fp, "%c%c%c%c%c%c", ESC, 0x7c, 0xa0, 1, 0, 1);
- fprintf(fp, "%c%c%c%c%c%c", ESC, 0x7c, 0xa1, 1, 0, 1);
- fprintf(fp, "%c%c%c%c%c%c", ESC, 0x7c, 0xa2, 1, 0, 1);
- if (pdev->y_pixels_per_inch > 600) { /* 600 x 1200 dpi */
- fprintf(fp, "%c%c%c%c%c%c%c%c%c",
- ESC, 0x7c, 0xa5, 4, 0, 2, 0x58, 4, 0xb0);
- ydpi = 1200;
- }
- else if (pdev->y_pixels_per_inch > 300) { /* 600 dpi */
- fprintf(fp, "%c%c%c%c%c%c%c", ESC, 0x7c, 0xa5, 2, 0, 2, 0x58);
- ydpi = 600;
- }
- else {
- fprintf(fp, "%c%c%c%c%c%c%c", ESC, 0x7c, 0xa5, 2, 0, 1, 0x2c);
- ydpi = 300;
- }
- fprintf(fp, "%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",
- ESC, 0x7c, 0xf1, 0x0c, 0, 0, 1 , 0, 2, 0, 0, 0, 0, 0, 0, 0, 0);
- fprintf(fp, "%c%c%c%c%c%c", ESC, 0x7c, 0xa6, 1, 0, 3);
-
- return ydpi;
-}
-
-
-private int
-ml_finish(
- gx_device_printer *pdev,
- FILE *fp)
-{
- fprintf(fp, "%c%c%c", ESC, 0x2f, 0xfe);
-
- return 0;
-}
diff --git a/gs/contrib/japanese/gdevnpdl.c b/gs/contrib/japanese/gdevnpdl.c
deleted file mode 100644
index 1f3c73b22..000000000
--- a/gs/contrib/japanese/gdevnpdl.c
+++ /dev/null
@@ -1,715 +0,0 @@
-/* Copyright (C) 1989, 1992, 1993 Aladdin Enterprises. All rights reserved.
-
- 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. */
-
-/* gdevnpdl.c */
-/*
- * NEC NPDL/NPDL(level 2) language printer driver for Ghostscript.
- * Version 1.5
- *
- * This driver was designed to work with any NEC NPDL/NPDL(level 2)
- * language printers such as NEC MultiWriter series.
- *
- * Any test reports, comments, suggestions, and bug reports are welcome.
- *
- * -- Osamu Watanabe <owatanab@ceres.dti.ne.jp>
- *
- * $Id: gdevnpdl.c,v 1.10 1998/09/28 16:20:04 watanabe Exp $
- *
- */
-
-/*
- Modified by Norihito Ohmori, May 15 1999
- 1. Landscape Support
- 2. PostCard Size Support
- 3. Output Speed UP
- 4. Copy Mode Support (-dNumCopies Option)
- 5. Default Resolution Chage from 400 dpi to 240 dpi
- 6. NegativePrint Support
- */
-
-/*
- Modified by Norihito Ohmori, Jul 18 1999
- 1. Envelope 4 and BPostCard Size Support
- 2. Tumble (When Duplex) Support
- 3. Margin size change.
- */
-
-#include "gdevlprn.h"
-
-/*
- * Valid values for IMAGE resolutions, that is, X_DPI and Y_DPI, are
- * 160, 200, 240, and 400 (Mr. Keita Kawabe reported that the 600dpi
- * printer, MultiWriter 2000X, accepts 600).
- * These two values must be the same.
- *
- * The resolution specified below is the default value.
- * You can also specify the resolution at runtime with -r option.
- */
-#define X_DPI 240
-#define Y_DPI 240
-
-/*
- * Left, bottom, right, and top margins.
- *
- * The values defined below are more accurate for my printer,
- * and it is recommended that you adjust these values suitable to yours.
- * The commented values are from the PC-PR1000E/4 User's Manual.
- */
-/* margins of A3 paper */
-#define L_MARGIN_A3 0.20
-#define B_MARGIN_A3 0.24
-#define R_MARGIN_A3 0.20
-#define T_MARGIN_A3 0.20
-/* margins of A4 paper */
-#define L_MARGIN_A4 0.31
-#define B_MARGIN_A4 0.20
-#define R_MARGIN_A4 0.16
-#define T_MARGIN_A4 0.20
-/* margins of A5 paper */
-#define L_MARGIN_A5 0.31
-#define B_MARGIN_A5 0.16
-#define R_MARGIN_A5 0.16
-#define T_MARGIN_A5 0.20
-/* margins of B4 paper */
-#define L_MARGIN_B4 0.31
-#define B_MARGIN_B4 0.24
-#define R_MARGIN_B4 0.31
-#define T_MARGIN_B4 0.20
-/* margins of B5 paper */
-#define L_MARGIN_B5 0.31
-#define B_MARGIN_B5 0.24
-#define R_MARGIN_B5 0.16
-#define T_MARGIN_B5 0.20
-/* margins of letter size paper */
-#define L_MARGIN_LETTER 0.31
-#define B_MARGIN_LETTER 0.24
-#define R_MARGIN_LETTER 0.20
-#define T_MARGIN_LETTER 0.20
-/* margins of postcard size paper */
-#define L_MARGIN_POSTCARD 0.31
-#define B_MARGIN_POSTCARD 0.12
-#define R_MARGIN_POSTCARD 0.24
-#define T_MARGIN_POSTCARD 0.20
-/* margins of env4 size paper */
-#define L_MARGIN_ENV4 0.20
-#define B_MARGIN_ENV4 0.20
-#define R_MARGIN_ENV4 0.20
-#define T_MARGIN_ENV4 0.20
-
-/* The device descriptors */
-private dev_proc_open_device(npdl_open);
-private dev_proc_open_device(npdl_close);
-private dev_proc_print_page_copies(npdl_print_page_copies);
-private dev_proc_put_params(npdl_put_params);
-private dev_proc_image_out(npdl_image_out);
-
-private gx_device_procs npdl_prn_procs =
-prn_params_procs(npdl_open, gdev_prn_output_page, npdl_close,
- lprn_get_params, npdl_put_params);
-
-gx_device_lprn far_data gs_npdl_device =
-lprn_duplex_device(gx_device_lprn, npdl_prn_procs, "npdl",
- X_DPI, Y_DPI, /* default resolution */
- 0.0, 0.0, 0.0, 0.0, /* margins */
- 1, npdl_print_page_copies, npdl_image_out);
-
-
-
-/* ------ internal routines ------ */
-
-/* paper size code */
-/* modified from gdevpcl.h and gdevmjc.c */
-#define PAPER_SIZE_LETTER 2
-#define PAPER_SIZE_A5 25
-#define PAPER_SIZE_A4 26
-#define PAPER_SIZE_A3 27
-#define PAPER_SIZE_B4 30
-#define PAPER_SIZE_B5 31
-#define PAPER_SIZE_POSTCARD 32
-#define PAPER_SIZE_BPOSTCARD 33
-#define PAPER_SIZE_ENV4 34
-
-/* terminating code */
-private char
-terminating[2][64][13] = {{
-/* white */
-"00110101", "000111", "0111", "1000", /* 0 - 3 */
-"1011", "1100", "1110", "1111", /* 4 - 7 */
-"10011", "10100", "00111", "01000", /* 8 - 11 */
-"001000", "000011", "110100", "110101", /* 12 - 15 */
-"101010", "101011", "0100111", "0001100", /* 16 - 19 */
-"0001000", "0010111", "0000011", "0000100", /* 20 - 23 */
-"0101000", "0101011", "0010011", "0100100", /* 24 - 27 */
-"0011000", "00000010", "00000011", "00011010", /* 28 - 31 */
-"00011011", "00010010", "00010011", "00010100", /* 32 - 35 */
-"00010101", "00010110", "00010111", "00101000", /* 36 - 39 */
-"00101001", "00101010", "00101011", "00101100", /* 40 - 43 */
-"00101101", "00000100", "00000101", "00001010", /* 44 - 47 */
-"00001011", "01010010", "01010011", "01010100", /* 48 - 51 */
-"01010101", "00100100", "00100101", "01011000", /* 52 - 55 */
-"01011001", "01011010", "01011011", "01001010", /* 56 - 59 */
-"01001011", "00110010", "00110011", "00110100" /* 60 - 63 */
-},{
-/* black */
-"0000110111", "010", "11", "10", /* 0 - 3 */
-"011", "0011", "0010", "00011", /* 4 - 7 */
-"000101", "000100", "0000100", "0000101", /* 8 - 11 */
-"0000111", "00000100", "00000111", "000011000", /* 12 - 15 */
-"0000010111", "0000011000", "0000001000", "00001100111", /* 16 - 19 */
-"00001101000", "00001101100", "00000110111", "00000101000", /* 20 - 23 */
-"00000010111", "00000011000", "000011001010", "000011001011", /* 24 - 27 */
-"000011001100", "000011001101", "000001101000", "000001101001", /* 28 - 31 */
-"000001101010", "000001101011", "000011010010", "000011010011", /* 32 - 35 */
-"000011010100", "000011010101", "000011010110", "000011010111", /* 36 - 39 */
-"000001101100", "000001101101", "000011011010", "000011011011", /* 40 - 43 */
-"000001010100", "000001010101", "000001010110", "000001010111", /* 44 - 47 */
-"000001100100", "000001100101", "000001010010", "000001010011", /* 48 - 51 */
-"000000100100", "000000110111", "000000111000", "000000100111", /* 52 - 55 */
-"000000101000", "000001011000", "000001011001", "000000101011", /* 56 - 59 */
-"000000101100", "000001011010", "000001100110", "000001100111" /* 60 - 63 */
-}};
-
-/* make-up code */
-private char
-makeup[2][40][14] = {{
-/* white */
-"11011", "10010", "010111", "0110111", /* 64- 256 */
-"00110110", "00110111", "01100100", "01100101", /* 320- 512 */
-"01101000", "01100111", "011001100", "011001101", /* 576- 768 */
-"011010010", "011010011", "011010100", "011010101", /* 832-1024 */
-"011010110", "011010111", "011011000", "011011001", /* 1088-1280 */
-"011011010", "011011011", "010011000", "010011001", /* 1344-1536 */
-"010011010", "011000", "010011011", "00000001000", /* 1600-1792 */
-"00000001100", "00000001101", "000000010010", "000000010011", /* 1856-2048 */
-"000000010100", "000000010101", "000000010110", "000000010111", /* 2112-2304 */
-"000000011100", "000000011101", "000000011110", "000000011111" /* 2368-2560 */
-},{
-/* black */
-"0000001111", "000011001000", "000011001001", "000001011011", /* 64- 256 */
-"000000110011", "000000110100", "000000110101", "0000001101100",/* 320- 512 */
-"0000001101101","0000001001010","0000001001011","0000001001100",/* 576- 768 */
-"0000001001101","0000001110010","0000001110011","0000001110100",/* 832-1024 */
-"0000001110101","0000001110110","0000001110111","0000001010010",/* 1088-1280 */
-"0000001010011","0000001010100","0000001010101","0000001011010",/* 1344-1536 */
-"0000001011011","0000001100100","0000001100101","00000001000", /* 1600-1792 */
-"00000001100", "00000001101", "000000010010", "000000010011", /* 1856-2048 */
-"000000010100", "000000010101", "000000010110", "000000010111", /* 2112-2304 */
-"000000011100", "000000011101", "000000011110", "000000011111" /* 2368-2560 */
-}};
-
-/* EOL (end of line) code */
-private char
- eol[] = "000000000001";
-
-/* FILL bit */
-private char
- fill[] = "0";
-
-#define MAX_RUNLENGTH 2623 /* Max value of makeup(2560) + terminating(63) */
-#define EOL_SIZE 12 /* Size of EOL (end of line) code */
-
-private byte
- mask[] =
-{0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01};
-
-/* Write MH code to buffer */
-private int
-mh_write_to_buffer(byte * out, int chunk_size, int num_bits, char *code)
-{
- int code_length, i, p, q;
-
- for (code_length = 0; code[code_length] != '\0'; code_length++);
- if (((num_bits + code_length) / 8) >= chunk_size)
- return 0;
-
- p = num_bits / 8;
- q = num_bits % 8;
- for (i = 0; i < code_length; i++) {
- /*
- * MH compressed data are stored from 2^0 to 2^7,
- * whereas uncompressed data are stored from 2^7 to 2^0.
- */
- if (code[i] == '0')
- out[p] &= ~(mask[7 - q]);
- else
- out[p] |= mask[7 - q];
-
- if (q < 7)
- q++;
- else {
- p++;
- q = 0;
- }
- }
-
- return code_length;
-}
-
-/* Set run-length code */
-private int
-mh_set_runlength(byte * out, int chunk_size, int num_bits, int phase, int count)
-{
- int n, code_length;
-
- code_length = 0;
-
- /* Set makeup code */
- if (count / 64 > 0) {
- if ((n = mh_write_to_buffer(out, chunk_size, num_bits,
- makeup[phase][(count / 64) - 1])) == 0)
- return 0;
- code_length += n;
- }
- /* Set terminating code */
- if ((n = mh_write_to_buffer(out, chunk_size, num_bits + code_length,
- terminating[phase][count % 64])) == 0)
- return 0;
- code_length += n;
-
- return code_length;
-}
-
-/* Set EOL (end of line) code */
-private int
-mh_set_eol(byte * out, int chunk_size, int num_bits)
-{
- return mh_write_to_buffer(out, chunk_size, num_bits, eol);
-}
-
-/* Set RTC (return to control) code and FILL bits */
-private int
-mh_set_rtc(byte * out, int chunk_size, int num_bits)
-{
- int i, n, code_length, num_fills;
-
- code_length = 0;
-
- /* Set FILL bits */
- num_fills = (EOL_SIZE * 6 + (num_bits % 8)) % 8;
- if (num_fills != 0) {
- for (i = 0; i < 8 - num_fills; i++) {
- if ((n = mh_write_to_buffer(out, chunk_size, num_bits + code_length,
- fill)) == 0)
- return 0;
- code_length += n;
- }
- }
- /* Set RTC (that is, six EOL) code */
- for (i = 0; i < 6; i++) {
- if ((n = mh_write_to_buffer(out, chunk_size, num_bits + code_length,
- eol)) == 0)
- return 0;
- code_length += n;
- }
-
- return code_length;
-}
-
-/* Data compression by MH coding */
-private int
-mh_compression(byte * in, byte * out, int line_size, int column_size)
-{
- int i, p, q, r, n;
- int num_bits, phase, count;
- int chunk_size = line_size * column_size;
- byte src;
-
- num_bits = 0;
- for (i = 0; i < column_size; i++) {
- r = i * line_size;
-
- /* Synchronization of 1-dot line */
- if ((n = mh_set_eol(out, chunk_size, num_bits)) == 0)
- return 0;
- num_bits += n;
-
- /* Data compression of 1-dot line */
- phase = count = 0;
- for (p = 0; p < line_size; p++) {
- if (phase == 0)
- src = ~(in[r + p]);
- else
- src = in[r + p];
- for (q = 0; q < 8; q++) {
-
- /*
- * If the dot has reversed, write the
- * run-length of the continuous dots.
- */
- if (!(src & mask[q])) {
- if ((n = mh_set_runlength(out, chunk_size, num_bits,
- phase, count)) == 0)
- return 0;
- num_bits += n;
- phase = (phase == 0) ? 1 : 0;
- count = 1;
- src = ~src;
- }
- /*
- * If the dot is not reversed, check the
- * length of this continuous dots,
- */
- else {
- if (count < MAX_RUNLENGTH)
- count++;
- /*
- * and if the length >= MAX_RUNLENGTH,
- * stop and restart counting.
- */
- else {
- if ((n = mh_set_runlength(out, chunk_size, num_bits,
- phase, MAX_RUNLENGTH)) == 0)
- return 0;
- num_bits += n;
- phase = (phase == 0) ? 1 : 0;
- if ((n = mh_set_runlength(out, chunk_size, num_bits,
- phase, 0)) == 0)
- return 0;
- num_bits += n;
- phase = (phase == 0) ? 1 : 0;
- count = 1;
- }
- }
- }
- }
-
- /* Write the last run-length of 1-dot line */
- if ((n = mh_set_runlength(out, chunk_size, num_bits, phase,
- count)) == 0)
- return 0;
- num_bits += n;
- }
-
- /* RTC (return to control) */
- if ((n = mh_set_rtc(out, chunk_size, num_bits)) == 0)
- return 0;
- num_bits += n;
-
- return (num_bits / 8);
-}
-
-/* Get the paper size code based on the width and the height.
- modified from gdevpcl.c and gdevmjc.c */
-private int
-npdl_get_paper_size(gx_device * dev)
-{
- float media_height = (dev->MediaSize[0] > dev->MediaSize[1]) ? dev->MediaSize[0] : dev->MediaSize[1];
-
- return (media_height > 1032 ? PAPER_SIZE_A3 :
- media_height > 842 ? PAPER_SIZE_B4 :
- media_height > 792 ? PAPER_SIZE_A4 :
- media_height > 756 ? PAPER_SIZE_LETTER :
- media_height > 729 ? PAPER_SIZE_ENV4 :
- media_height > 595 ? PAPER_SIZE_BPOSTCARD :
- media_height > 568 ? PAPER_SIZE_B5 :
- media_height > 419 ? PAPER_SIZE_A5 :
- PAPER_SIZE_POSTCARD);
-}
-
-private int
-npdl_set_page_layout(gx_device * dev)
-{
- int code;
- float margins[4];
-
- /* Change the margins according to the paper size. */
- switch (npdl_get_paper_size(dev)) {
- case PAPER_SIZE_A3:
- if (dev->MediaSize[0] > dev->MediaSize[1]) { /* Landscape */
- margins[0] = L_MARGIN_A3;
- margins[1] = B_MARGIN_A3;
- margins[2] = R_MARGIN_A3;
- margins[3] = T_MARGIN_A3;
- } else { /* Portrait */
- margins[1] = L_MARGIN_A3;
- margins[2] = B_MARGIN_A3;
- margins[3] = R_MARGIN_A3;
- margins[0] = T_MARGIN_A3;
- }
- break;
- case PAPER_SIZE_A5:
- if (dev->MediaSize[0] > dev->MediaSize[1]) { /* Landscape */
- margins[0] = L_MARGIN_A5;
- margins[1] = B_MARGIN_A5;
- margins[2] = R_MARGIN_A5;
- margins[3] = T_MARGIN_A5;
- } else { /* Portrait */
- margins[1] = L_MARGIN_A5;
- margins[2] = B_MARGIN_A5;
- margins[3] = R_MARGIN_A5;
- margins[0] = T_MARGIN_A5;
- }
- break;
- case PAPER_SIZE_B5:
- if (dev->MediaSize[0] > dev->MediaSize[1]) { /* Landscape */
- margins[1] = L_MARGIN_B5;
- margins[2] = B_MARGIN_B5;
- margins[3] = R_MARGIN_B5;
- margins[0] = T_MARGIN_B5;
- } else { /* Portrait */
- margins[0] = L_MARGIN_B5;
- margins[1] = B_MARGIN_B5;
- margins[2] = R_MARGIN_B5;
- margins[3] = T_MARGIN_B5;
- }
- break;
- case PAPER_SIZE_LETTER:
- if (dev->MediaSize[0] > dev->MediaSize[1]) { /* Landscape */
- margins[1] = L_MARGIN_LETTER;
- margins[2] = B_MARGIN_LETTER;
- margins[3] = R_MARGIN_LETTER;
- margins[0] = T_MARGIN_LETTER;
- } else { /* Portrait */
- margins[0] = L_MARGIN_LETTER;
- margins[1] = B_MARGIN_LETTER;
- margins[2] = R_MARGIN_LETTER;
- margins[3] = T_MARGIN_LETTER;
- }
- break;
- case PAPER_SIZE_POSTCARD:
- if (dev->MediaSize[0] > dev->MediaSize[1]) { /* Landscape */
- margins[1] = L_MARGIN_POSTCARD;
- margins[2] = B_MARGIN_POSTCARD;
- margins[3] = R_MARGIN_POSTCARD;
- margins[0] = T_MARGIN_POSTCARD;
- } else { /* Portrait */
- margins[0] = L_MARGIN_POSTCARD;
- margins[1] = B_MARGIN_POSTCARD;
- margins[2] = R_MARGIN_POSTCARD;
- margins[3] = T_MARGIN_POSTCARD;
- }
- break;
- case PAPER_SIZE_ENV4:
- case PAPER_SIZE_BPOSTCARD:
- margins[1] = L_MARGIN_ENV4;
- margins[2] = B_MARGIN_ENV4;
- margins[3] = R_MARGIN_ENV4;
- margins[0] = T_MARGIN_ENV4;
- break;
- default: /* A4 */
- if (dev->MediaSize[0] > dev->MediaSize[1]) { /* Landscape */
- margins[1] = L_MARGIN_A4;
- margins[2] = B_MARGIN_A4;
- margins[3] = R_MARGIN_A4;
- margins[0] = T_MARGIN_A4;
- } else { /* Portrait */
- margins[0] = L_MARGIN_A4;
- margins[1] = B_MARGIN_A4;
- margins[2] = R_MARGIN_A4;
- margins[3] = T_MARGIN_A4;
- }
- break;
- }
- gx_device_set_margins(dev, margins, true);
- if (dev->is_open) {
- gdev_prn_close(dev);
- code = gdev_prn_open(dev);
- if (code < 0)
- return code;
- }
- return 0;
-}
-
-/* Open the printer, and set the margins. */
-private int
-npdl_open(gx_device * dev)
-{
- int xdpi = dev->x_pixels_per_inch;
- int ydpi = dev->y_pixels_per_inch;
-
- /* Print Resolution Check */
- if (xdpi != ydpi)
- return_error(gs_error_rangecheck);
- else if (xdpi != 160 && xdpi != 200 && xdpi != 240 &&
- xdpi != 400 && xdpi != 600)
- return_error(gs_error_rangecheck);
-
- npdl_set_page_layout(dev);
-
- return gdev_prn_open(dev);
-}
-
-private int
-npdl_close(gx_device *pdev)
-{
- gx_device_printer *const ppdev = (gx_device_printer *) pdev;
- gdev_prn_open_printer(pdev, 1);
- fputs("\033c1", ppdev->file);
-
- return gdev_prn_close(pdev);
-}
-
-
-private int
-npdl_put_params(gx_device * pdev, gs_param_list * plist)
-{
- gx_device_lprn *const lprn = (gx_device_lprn *) pdev;
- int code;
-
- code = lprn_put_params(pdev, plist);
- if (code < 0)
- return code;
- if (pdev->is_open && !lprn->initialized) {
- npdl_set_page_layout(pdev);
- }
- return 0;
-}
-
-/* Send the page to the printer. For speed, compress each scan line,
- since computer-to-printer communication time is often a bottleneck. */
-private int
-npdl_print_page_copies(gx_device_printer * pdev, FILE * prn_stream, int num_copies)
-{
- gx_device_lprn *const lprn = (gx_device_lprn *) pdev;
- int line_size = gdev_prn_raster(pdev);
- int x_dpi = (int)(pdev->x_pixels_per_inch);
- char paper_command[5];
- int code;
- int maxY = lprn->BlockLine / lprn->nBh * lprn->nBh;
-
- if (!(lprn->CompBuf = gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), line_size * maxY, sizeof(byte), "npdl_print_page_copies(CompBuf)")))
- return_error(gs_error_VMerror);
-
-
- /* Initialize printer */
- if (pdev->PageCount == 0) {
-
- /* Initialize printer */
- fputs("\033c1", prn_stream); /* Software Reset */
- fputs("\034d240.", prn_stream); /* Page Printer Mode */
-
-
- /* Check paper size */
- switch (npdl_get_paper_size((gx_device *) pdev)) {
- case PAPER_SIZE_POSTCARD:
- sprintf(paper_command, "PC");
- break;
- case PAPER_SIZE_A5:
- sprintf(paper_command, "A5");
- break;
- case PAPER_SIZE_A4:
- sprintf(paper_command, "A4");
- break;
- case PAPER_SIZE_A3:
- sprintf(paper_command, "A3");
- break;
- case PAPER_SIZE_B5:
- sprintf(paper_command, "B5");
- break;
- case PAPER_SIZE_B4:
- sprintf(paper_command, "B4");
- break;
- case PAPER_SIZE_LETTER:
- sprintf(paper_command, "LT");
- break;
- case PAPER_SIZE_ENV4:
- sprintf(paper_command, "ENV4");
- break;
- case PAPER_SIZE_BPOSTCARD:
- sprintf(paper_command, "UPPC");
- break;
- }
-
- if (lprn->ManualFeed) {
- fprintf(prn_stream, "\034f%cM0.",
- (pdev->MediaSize[0] > pdev->MediaSize[1]) ? 'L' : 'P');
- /* Page Orientation P: Portrait, L: Landscape */
- } else {
- fprintf(prn_stream, "\034f%c%s.",
- (pdev->MediaSize[0] > pdev->MediaSize[1]) ? 'L' : 'P',
- /* Page Orientation P: Portrait, L: Landscape */
- paper_command); /* Paper Size */
- }
-
- fprintf(prn_stream, "\034<1/%d,i.", x_dpi); /* Image Resolution */
-
- /* Duplex Setting */
- if (pdev->Duplex_set > 0) {
- if (pdev->Duplex) {
- if (lprn->Tumble == 0)
- fprintf(prn_stream, "\034'B,,1,0.");
- else
- fprintf(prn_stream, "\034'B,,2,0.");
- } else
- fprintf(prn_stream, "\034'S,,,0.");
- }
- }
-
- if (num_copies > 99)
- num_copies = 99;
- fprintf(prn_stream, "\034x%d.", num_copies);
-
- lprn->initialized = false;
-
- if (lprn->NegativePrint) {
- fprintf(prn_stream, "\034e0,0."); /* move to (0, 0) */
- fprintf(prn_stream, "\034Y"); /* goto figure mode */
- fprintf(prn_stream, "SU1,%d,0;", (int)pdev->x_pixels_per_inch);
- /* Setting Printer Unit */
- fprintf(prn_stream, "SG0,0;"); /* select black color */
- fprintf(prn_stream, "NP;"); /* begin path */
- fprintf(prn_stream, "PA%d,0,%d,%d,0,%d;",
- pdev->width, pdev->width, pdev->height, pdev->height);
- /* draw rectangle */
- fprintf(prn_stream, "CP"); /* close path */
- fprintf(prn_stream, "EP;"); /* end path */
- fprintf(prn_stream, "FL0;"); /* fill path */
- fprintf(prn_stream, "\034Z"); /* end of figure mode */
- fprintf(prn_stream, "\034\"R."); /* `R'eplace Mode */
- }
- code = lprn_print_image(pdev, prn_stream);
- if (code < 0)
- return code;
-
-
- /* Form Feed */
- fputs("\014", prn_stream);
-
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), lprn->CompBuf, line_size * maxY, sizeof(byte), "npdl_print_page_copies(CompBuf)");
- return 0;
-}
-
-/* Output data */
-private void
-npdl_image_out(gx_device_printer * pdev, FILE * prn_stream, int x, int y, int width, int height)
-{
- gx_device_lprn *const lprn = (gx_device_lprn *) pdev;
- int num_bytes;
- int x_dpi = (int)(pdev->x_pixels_per_inch);
-
- fprintf(prn_stream, "\034e%d,%d.", x, y);
- /* Data compression */
- num_bytes = mh_compression(lprn->TmpBuf, lprn->CompBuf, width / 8, height);
-
- /*
- * If the compression ratio >= 100%, send uncompressed data
- */
- if (num_bytes == 0) {
- fprintf(prn_stream, "\034i%d,%d,0,1/1,1/1,%d,%d.", width,
- height, width * height / 8, x_dpi);
- fwrite(lprn->TmpBuf, 1, width * height / 8, prn_stream);
- }
- /*
- * If the compression ratio < 100%, send compressed data
- */
- else {
- fprintf(prn_stream, "\034i%d,%d,1,1/1,1/1,%d,%d.", width,
- height, num_bytes, x_dpi);
- fwrite(lprn->CompBuf, 1, num_bytes, prn_stream);
- }
-}
diff --git a/gs/contrib/japanese/gdevp201.c b/gs/contrib/japanese/gdevp201.c
deleted file mode 100644
index 3b9c4ad3f..000000000
--- a/gs/contrib/japanese/gdevp201.c
+++ /dev/null
@@ -1,273 +0,0 @@
-/* Copyright (C) 1990, 1992 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. */
-
-/* gdevp201.c */
-/* NEC PC-PR201 printer driver for Ghostscript */
-/* modified by m.mori for printers other than pr-201 */
-/* modified by OkI for hires-98 */
-/* modified by ASAYAMA Kazunori for Ghostscript version 2.6.1 */
-#include "gdevprn.h"
-
-/* There are NEC PC-PR printer paramaters.
- MODEL DEVICE_NAME X_DPI,Y_DPI HEAD_PINS LF_PITCH
- PC-PR201 "nec160" 160 24 18
- PC-PR1000 "nec240" 240 40 20
- PC-PR150 "nec320" 320 48 18
- PC-PR1000/4 "nec400" 400 60 18
-*/
-
-#define WIDTH 80 /* width_10ths, 8" */
-#define HEIGHT 110 /* height_10ths, 11" */
-
-enum{PR201, PR1000, PR150, PR1K4};
-
-private dev_proc_print_page(pr201_print_page);
-
-/* The device descriptor */
-gx_device_printer gs_pr201_device =
- prn_device(prn_std_procs, "pr201",
- WIDTH,
- HEIGHT,
- 160,
- 160,
- 0,0,0,0, /* margins */
- 1, pr201_print_page);
-
-gx_device_printer gs_pr1000_device =
- prn_device(prn_std_procs, "pr1000",
- WIDTH,
- HEIGHT,
- 240,
- 240,
- 0,0,0,0, /* margins */
- 1, pr201_print_page);
-
-gx_device_printer gs_pr150_device =
- prn_device(prn_std_procs, "pr150",
- WIDTH,
- HEIGHT,
- 320,
- 320,
- 0,0,0,0, /* margins */
- 1, pr201_print_page);
-
-gx_device_printer gs_pr1000_4_device =
- prn_device(prn_std_procs, "pr1000_4",
- WIDTH,
- HEIGHT,
- 400,
- 400,
- 0,0,0,0, /* margins */
- 1, pr201_print_page);
-
-
-/* Transpose a block of 8x8 bits */
-private int
-pr201_transpose_8x8(byte *src, int src_step, byte *dst, int dst_step)
-{
- byte mask, s, d0, d1, d2, d3, d4, d5, d6, d7;
- int i;
-
- d0 = d1 = d2 = d3 = d4 = d5 = d6 = d7 = 0;
-
- for(i=0, mask=0x01; i<8; i++, mask <<= 1) {
- s = *src;
- if(s & 0x80) d0 |= mask;
- if(s & 0x40) d1 |= mask;
- if(s & 0x20) d2 |= mask;
- if(s & 0x10) d3 |= mask;
- if(s & 0x08) d4 |= mask;
- if(s & 0x04) d5 |= mask;
- if(s & 0x02) d6 |= mask;
- if(s & 0x01) d7 |= mask;
- src += src_step;
- }
-
- *dst = d0;
- *(dst += dst_step) = d1;
- *(dst += dst_step) = d2;
- *(dst += dst_step) = d3;
- *(dst += dst_step) = d4;
- *(dst += dst_step) = d5;
- *(dst += dst_step) = d6;
- *(dst += dst_step) = d7;
-
- return 0;
-}
-
-private int
-check_mode(const char* modename)
-{
- if (!strcmp(modename, "pr201"))
- return PR201;
- else if (!strcmp(modename, "pr1000"))
- return PR1000;
- else if (!strcmp(modename, "pr150"))
- return PR150;
- else
- return PR1K4;
-}
-
-/* Send the page to the printer. */
-private int
-pr201_print_page(gx_device_printer *pdev, FILE *prn_stream)
-{ int line_size;
- int height;
- int bits_per_column;
- int bytes_per_column;
- int chunk_size;
- byte *in, *out;
- int lnum, skip;
- int head_pins, lr_pitch, x_dpi;
-
- switch (check_mode(pdev->dname)){
- case PR201:
- head_pins=24; lr_pitch=18; x_dpi=160; break;
- case PR1000:
- head_pins=40; lr_pitch=20; x_dpi=240; break;
- case PR150:
- head_pins=48; lr_pitch=18; x_dpi=320; break;
- case PR1K4:
- head_pins=60; lr_pitch=18; x_dpi=400; break;
- }
-
- line_size = gdev_mem_bytes_per_scan_line((gx_device *)pdev);
- height = pdev->height;
- bits_per_column = head_pins;
- bytes_per_column = bits_per_column / 8;
- chunk_size = bits_per_column * line_size;
-
- in = (byte *)
- gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), bits_per_column, line_size, "pr201_print_page(in)");
- out = (byte *)
- gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), bits_per_column, line_size, "pr201_print_page(out)");
- if(in == 0 || out == 0)
- return -1;
-
- /* Initialize printer */
- fputs("\033cl", pdev->file); /* Software Reset */
- fputs("\033P", pdev->file); /* Proportional Mode */
- if (check_mode(pdev->dname)==PR150){
- fprintf(pdev->file, "\034d%d.", x_dpi); /* 320 dpi mode. */
- }
- fprintf(pdev->file, "\033T%d" , lr_pitch);
- /* 18/120 inch per line */
-
- /* Send Data to printer */
- lnum = 0;
- skip = 0;
- while(lnum < height) {
- byte *inp, *outp, *out_beg, *out_end;
- int x, y, num_lines, size, mod;
-
- /* Copy scan lines */
- if(gdev_prn_copy_scan_lines(pdev, lnum, in, chunk_size) < 0)
- break;
-
- /* The number of lines to process */
- if((num_lines = height - lnum) > bits_per_column)
- num_lines = bits_per_column;
-
- /* Test for all zero */
- size = line_size * num_lines;
- if(in[0] == 0 &&
- !memcmp((char *)in, (char *)in + 1, size - 1)) {
- lnum += bits_per_column;
- skip ++;
- continue;
- }
-
- /* Fill zero */
- if(num_lines < bits_per_column) {
- size = line_size * (bits_per_column - num_lines);
- memset(in + line_size * num_lines, 0, size);
- }
- lnum += bits_per_column;
-
- /* Vertical tab to the appropriate position. */
- while(skip > 72) {
- fprintf(pdev->file, "\037%c", 16 + 72);
- skip -= 72;
- }
- if(skip > 0) {
- fprintf(pdev->file, "\037%c", 16 + skip);
- }
-
- /* Transpose in blocks of 8 scan lines. */
- for(y = 0; y < bytes_per_column; y ++) {
- inp = in + line_size * 8 * y;
- outp = out + y;
- for(x = 0; x < line_size; x ++) {
- pr201_transpose_8x8(inp, line_size,
- outp, bytes_per_column);
- inp ++;
- outp += bits_per_column;
- }
- }
-
- /* Remove trailing 0s. */
- out_end = out + chunk_size - 1;
- while(out_end >= out) {
- if(*out_end)
- break;
- out_end --;
- }
- size = (out_end - out) + 1;
- if((mod = size % bytes_per_column) != 0)
- out_end += bytes_per_column - mod;
-
- /* Remove leading 0s. */
- out_beg = out;
- while(out_beg <= out_end) {
- if(*out_beg)
- break;
- out_beg ++;
- }
- out_beg -= (out_beg - out) % bytes_per_column;
-
- /* Dot addressing */
- fprintf(pdev->file, "\033F%04d",
- (out_beg - out) / bytes_per_column);
-
- /* Dot graphics */
- size = out_end - out_beg + 1;
- if (check_mode(pdev->dname)==PR201){
- fprintf(pdev->file,"\033J%04d", size / bytes_per_column);
- }else{
- fprintf(pdev->file,"\034bP,48,%04d.",
- size / bytes_per_column);
- }
- fwrite(out_beg, size, 1, pdev->file);
-
- /* Carriage Return */
- fputc('\r', pdev->file);
- skip = 1;
- }
-
- /* Form Feed */
- fputc('\f',pdev->file);
- fflush(pdev->file);
-
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)out,
- bits_per_column, line_size, "pr201_print_page(out)");
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)in,
- bits_per_column, line_size, "pr201_print_page(in)");
-
- return 0;
-}
diff --git a/gs/contrib/japanese/gdevrpdl.c b/gs/contrib/japanese/gdevrpdl.c
deleted file mode 100644
index 44305c385..000000000
--- a/gs/contrib/japanese/gdevrpdl.c
+++ /dev/null
@@ -1,296 +0,0 @@
-/* Copyright (C) 1999, 2000 Norihito Ohmori.
-
- Ghostscript driver for Ricoh RPDL printer.
-
- This software 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 GNU General Public License for full details.
-
- Everyone is granted permission to copy, modify and redistribute
- this software, but only under the conditions described in the GNU
- General Public License. A copy of this license is supposed to have been
- given to you along with this software 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.
- */
-
-/*$Id: gdevrpdl.c,v 1.1 2002/10/12 23:24:34 tillkamppeter Exp $ */
-/* Ricoh RPDL driver for Ghostscript */
-
-#include "gdevlprn.h"
-#include "gdevlips.h"
-
-#define DPI 240
-
-/* The device descriptors */
-private dev_proc_open_device(rpdl_open);
-private dev_proc_close_device(rpdl_close);
-private dev_proc_print_page_copies(rpdl_print_page_copies);
-private dev_proc_image_out(rpdl_image_out);
-private void rpdl_printer_initialize(gx_device_printer * pdev, FILE * prn_stream, int num_copies);
-private void rpdl_paper_set(gx_device_printer * pdev, FILE * prn_stream);
-
-private gx_device_procs rpdl_prn_procs =
-lprn_procs(rpdl_open, gdev_prn_output_page, rpdl_close);
-
-gx_device_lprn far_data gs_rpdl_device =
-lprn_device(gx_device_lprn, rpdl_prn_procs, "rpdl",
- DPI, DPI, 0.0, 0.0, 0.0, 0.0, 1,
- rpdl_print_page_copies, rpdl_image_out);
-
-#define ppdev ((gx_device_printer *)pdev)
-
-/* Open the printer. */
-private int
-rpdl_open(gx_device * pdev)
-{
- int xdpi = pdev->x_pixels_per_inch;
- int ydpi = pdev->y_pixels_per_inch;
-
- /* Resolution Check */
- if (xdpi != ydpi)
- return_error(gs_error_rangecheck);
- if (xdpi != 240 && xdpi != 400 && xdpi != 600)
- return_error(gs_error_rangecheck);
-
- return gdev_prn_open(pdev);
-}
-
-private int
-rpdl_close(gx_device * pdev)
-{
- gdev_prn_open_printer(pdev, 1);
- if (ppdev->Duplex && (pdev->PageCount & 1)) {
- fprintf(ppdev->file, "\014"); /* Form Feed */
- }
- return gdev_prn_close(pdev);
-}
-
-private int
-rpdl_print_page_copies(gx_device_printer * pdev, FILE * prn_stream, int num_coipes)
-{
- gx_device_lprn *const lprn = (gx_device_lprn *) pdev;
- int code = 0;
- int bpl = gdev_mem_bytes_per_scan_line(pdev);
- int maxY = lprn->BlockLine / lprn->nBh * lprn->nBh;
-
- /* printer initialize */
- if (pdev->PageCount == 0)
- rpdl_printer_initialize(pdev, prn_stream, num_coipes);
-
- if (!(lprn->CompBuf = gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), bpl * 3 / 2 + 1, maxY, "rpdl_print_page_copies(CompBuf)")))
- return_error(gs_error_VMerror);
-
- lprn->NegativePrint = false; /* Not Support */
-
- code = lprn_print_image(pdev, prn_stream);
- if (code < 0)
- return code;
-
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), lprn->CompBuf, bpl * 3 / 2 + 1, maxY, "rpdl_print_page_copies(CompBuf)");
-
- fprintf(prn_stream, "\014"); /* Form Feed */
-
- return code;
-}
-
-/* Output data */
-private void
-rpdl_image_out(gx_device_printer * pdev, FILE * prn_stream, int x, int y, int width, int height)
-{
- gx_device_lprn *const lprn = (gx_device_lprn *) pdev;
- int Len;
-
- Len = lips_mode3format_encode(lprn->TmpBuf, lprn->CompBuf, width / 8 * height);
-
- if (Len < width / 8 * height) {
- if (pdev->x_pixels_per_inch == 240) {
- /* Unit Size is 1/720 inch */
- fprintf(prn_stream, "\033\022G3,%d,%d,,4,%d,%d,%d@",
- width, height, x * 3, y * 3, Len);
- } else {
- fprintf(prn_stream, "\033\022G3,%d,%d,,4,%d,%d,%d@",
- width, height, x, y, Len);
- }
- fwrite(lprn->CompBuf, 1, Len, prn_stream);
- } else { /* compression result is bad. So, raw data is used. */
- if (pdev->x_pixels_per_inch == 240) {
- /* Unit Size is 1/720 inch */
- fprintf(prn_stream, "\033\022G3,%d,%d,,,%d,%d@",
- width, height, x * 3, y * 3);
- fwrite(lprn->TmpBuf, 1, width / 8 * height, prn_stream);
- } else {
- fprintf(prn_stream, "\033\022G3,%d,%d,,,%d,%d@",
- width, height, x, y);
- fwrite(lprn->TmpBuf, 1, width / 8 * height, prn_stream);
- }
- }
-}
-
-/* output printer initialize code */
-
-/* ------ Internal routines ------ */
-
-private void
-rpdl_printer_initialize(gx_device_printer * pdev, FILE * prn_stream, int num_copies)
-{
- gx_device_lprn *const lprn = (gx_device_lprn *) pdev;
- int xdpi = (int) pdev->x_pixels_per_inch;
-
- /* Initialize */
- fprintf(prn_stream, "\033\022!@R00\033 "); /* Change to RPDL Mode */
- fprintf(prn_stream, "\0334"); /* Graphic Mode kaijyo */
- fprintf(prn_stream, "\033\022YP,2 "); /* Select RPDL Mode */
- fprintf(prn_stream, "\033\022YB,2 "); /* Printable Area - Maximum */
- fprintf(prn_stream, "\033\022YK,1 "); /* Left Margin - 0 mm */
- fprintf(prn_stream, "\033\022YL,1 "); /* Top Margin - 0 mm */
- fprintf(prn_stream, "\033\022YM,1 "); /* 100 % */
- fprintf(prn_stream, "\033\022YQ,2 "); /* Page Length - Maximum */
-
- /* Paper Size Selection */
- rpdl_paper_set(pdev, prn_stream);
-
- /* Option Setting */
- /* Duplex Setting */
- if (pdev->Duplex_set > 0) {
- if (pdev->Duplex) {
- fprintf(prn_stream, "\033\02261,");
- if (lprn->Tumble == 0)
- fprintf(prn_stream, "\033\022YA01,2 ");
- else
- fprintf(prn_stream, "\033\022YA01,1 ");
- } else
- fprintf(prn_stream, "\033\02260,");
- }
-
- /* Resolution and Unit Setting */
- /* Resolution Seting */
- switch(xdpi) {
- case 600:
- fprintf(prn_stream, "\033\022YA04,3 ");
- break;
- case 400:
- fprintf(prn_stream, "\033\022YA04,1 ");
- break;
- default: /* 240 dpi */
- fprintf(prn_stream, "\033\022YA04,2 ");
- break;
- }
-
- /* Unit Setting */
- /* Graphics Unit */
- switch(xdpi) {
- case 600:
- fprintf(prn_stream, "\033\022YW,3 ");
- break;
- case 400:
- fprintf(prn_stream, "\033\022YW,1 ");
- break;
- default: /* 240 dpi */
- fprintf(prn_stream, "\033\022YW,2 ");
- break;
- }
-
- /* Spacing Unit */
- switch(xdpi) {
- case 600:
- fprintf(prn_stream, "\033\022Q5 ");
- break;
- case 400:
- fprintf(prn_stream, "\033\022Q4 ");
- break;
- default: /* 240 dpi */
- fprintf(prn_stream, "\033\022Q0 ");
- break;
- }
-
- /* Cartecian Unit */
- switch(xdpi) {
- case 600:
- fprintf(prn_stream, "\033\022#4 ");
- break;
- case 400:
- fprintf(prn_stream, "\033\022#2 ");
- break;
- }
-
- /* Paper Setting */
- if (pdev->MediaSize[0] > pdev->MediaSize[1])
- fprintf(prn_stream, "\033\022D2 "); /* landscape */
- else
- fprintf(prn_stream, "\033\022D1 "); /* portrait */
-
- /* Number of Copies */
- fprintf(prn_stream, "\033\022N%d ", num_copies);
-}
-
-private void
-rpdl_paper_set(gx_device_printer * pdev, FILE * prn_stream)
-{
- int width, height, w, h, wp, hp;
-
- width = pdev->MediaSize[0];
- height = pdev->MediaSize[1];
-
- if (width < height) {
- w = width;
- h = height;
- wp = width / 72.0 * pdev->x_pixels_per_inch;
- hp = height / 72.0 * pdev->y_pixels_per_inch;
- } else {
- w = height;
- h = width;
- wp = height / 72.0 * pdev->y_pixels_per_inch;
- hp = width / 72.0 * pdev->x_pixels_per_inch;
- }
-
- if (w == 1684 && h == 2380) /* A1 */
- fprintf(prn_stream, "\033\02251@A1R\033 ");
- else if (w == 1190 && h == 1684) { /* A2 */
- fprintf(prn_stream, "\033\02251@A2R\033 ");
- fprintf(prn_stream, "\033\02251@A2\033 ");
- } else if (w == 842 && h == 1190) { /* A3 */
- fprintf(prn_stream, "\033\02251@A3R\033 ");
- fprintf(prn_stream, "\033\02251@A3\033 ");
- } else if (w == 595 && h == 842) { /* A4 */
- fprintf(prn_stream, "\033\02251@A4R\033 ");
- fprintf(prn_stream, "\033\02251@A4\033 ");
- } else if (w == 597 && h == 842) { /* A4 */
- fprintf(prn_stream, "\033\02251@A4R\033 ");
- fprintf(prn_stream, "\033\02251@A4\033 ");
- } else if (w == 421 && h == 595) { /* A5 */
- fprintf(prn_stream, "\033\02251@A5R\033 ");
- fprintf(prn_stream, "\033\02251@A5\033 ");
- } else if (w == 297 && h == 421) { /* A6 */
- fprintf(prn_stream, "\033\02251@A6R\033 ");
- fprintf(prn_stream, "\033\02251@A6\033 ");
- } else if (w == 729 && h == 1032) { /* B4 */
- fprintf(prn_stream, "\033\02251@B4R\033 ");
- fprintf(prn_stream, "\033\02251@B4\033 ");
- } else if (w == 516 && h == 729) { /* B5 */
- fprintf(prn_stream, "\033\02251@B5R\033 ");
- fprintf(prn_stream, "\033\02251@B5\033 ");
- } else if (w == 363 && h == 516) { /* B6 */
- fprintf(prn_stream, "\033\02251@A6R\033 ");
- fprintf(prn_stream, "\033\02251@A6\033 ");
- } else if (w == 612 && h == 792) { /* Letter */
- fprintf(prn_stream, "\033\02251@LTR\033 ");
- fprintf(prn_stream, "\033\02251@LT\033 ");
- } else if (w == 612 && h == 1008) { /* Legal */
- fprintf(prn_stream, "\033\02251@LGR\033 ");
- fprintf(prn_stream, "\033\02251@LG\033 ");
- } else if (w == 396 && h == 612) { /* Half Letter */
- fprintf(prn_stream, "\033\02251@HLR\033 ");
- fprintf(prn_stream, "\033\02251@HLT\033 ");
- } else if (w == 792 && h == 1224) { /* Ledger */
- fprintf(prn_stream, "\033\02251@DLT\033 ");
- fprintf(prn_stream, "\033\02251@DLR\033 ");
- } else { /* Free Size (mm) */
- fprintf(prn_stream, "\033\022?5%d,%d\033 ",
- (int)((w * 25.4) / 72),
- (int)((h * 25.4) / 72));
- }
-}
diff --git a/gs/contrib/lips4/gdevl4r.c b/gs/contrib/lips4/gdevl4r.c
deleted file mode 100644
index 986f61540..000000000
--- a/gs/contrib/lips4/gdevl4r.c
+++ /dev/null
@@ -1,1358 +0,0 @@
-/* Copyright (C) 1998, 1999 Norihito Ohmori.
-
- Ghostscript printer driver
- for Canon LBP, BJC-680J and BJC-880J printers (LIPS II+/III/IVc/IV)
-
- This software 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 GNU General Public License for full details.
-
- Everyone is granted permission to copy, modify and redistribute
- this software, but only under the conditions described in the GNU
- General Public License. A copy of this license is supposed to have been
- given to you along with this software 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.
- */
-
-/*$Id: gdevl4r.c,v 1.5 2002/10/12 23:24:34 tillkamppeter Exp $ */
-/* Raster Version of LIPS driver */
-
-#include "gdevlprn.h"
-#include "gdevlips.h"
-
-/* The device descriptors */
-private dev_proc_open_device(lips2p_open);
-private dev_proc_open_device(lips3_open);
-private dev_proc_open_device(bjc880j_open);
-private dev_proc_open_device(lips4_open);
-
-private dev_proc_close_device(lips_close);
-
-private dev_proc_print_page_copies(lips2p_print_page_copies);
-private dev_proc_print_page_copies(lips3_print_page_copies);
-private dev_proc_print_page_copies(bjc880j_print_page_copies);
-private dev_proc_print_page_copies(lips4_print_page_copies);
-
-private dev_proc_get_params(lips_get_params);
-private dev_proc_get_params(lips4_get_params);
-
-private dev_proc_put_params(lips_put_params);
-private dev_proc_put_params(lips4_put_params);
-
-#if 0
-private dev_proc_image_out(lips_image_out);
-
-#endif
-private dev_proc_image_out(lips2p_image_out);
-private dev_proc_image_out(lips4_image_out);
-
-#define lips_device(dtype, procs, dname, xdpi, ydpi, lm, bm, rm, tm, color_bits,\
- print_page_copies, image_out, cassetFeed, username)\
-{ std_device_std_color_full_body(dtype, &procs, dname,\
- (int)((long)(DEFAULT_WIDTH_10THS) * (xdpi) / 10),\
- (int)((long)(DEFAULT_HEIGHT_10THS) * (ydpi) / 10),\
- xdpi, ydpi, color_bits,\
- -(lm) * (xdpi), -(tm) * (ydpi),\
- (lm) * 72.0, (bm) * 72.0,\
- (rm) * 72.0, (tm) * 72.0\
- ),\
- lp_device_body_rest_(print_page_copies, image_out),\
- cassetFeed, username, LIPS_PJL_DEFAULT,\
- 0, 0, 0, 0, 0, 0, 0, -1\
-}
-
-#define lips4_device(dtype, procs, dname, xdpi, ydpi, lm, bm, rm, tm, color_bits,\
- print_page_copies, image_out, cassetFeed, username)\
-{ std_device_std_color_full_body(dtype, &procs, dname,\
- (int)((long)(DEFAULT_WIDTH_10THS) * (xdpi) / 10),\
- (int)((long)(DEFAULT_HEIGHT_10THS) * (ydpi) / 10),\
- xdpi, ydpi, color_bits,\
- -(lm) * (xdpi), -(tm) * (ydpi),\
- (lm) * 72.0, (bm) * 72.0,\
- (rm) * 72.0, (tm) * 72.0\
- ),\
- lp_duplex_device_body_rest_(print_page_copies, image_out),\
- cassetFeed,\
- username, LIPS_PJL_DEFAULT, 0, 0, 0, 0, 0, 0, 0, -1,\
- 0, LIPS_NUP_DEFAULT, LIPS_FACEUP_DEFAULT,\
- LIPS_MEDIATYPE_DEFAULT \
-}
-
-typedef struct gx_device_lips_s gx_device_lips;
-struct gx_device_lips_s {
- gx_device_common;
- gx_prn_device_common;
- gx_lprn_device_common;
- lips_params_common;
-};
-
-typedef struct gx_device_lips4_s gx_device_lips4;
-struct gx_device_lips4_s {
- gx_device_common;
- gx_prn_device_common;
- gx_lprn_device_common;
- lips_params_common;
- lips4_params_common;
-};
-
-private gx_device_procs lips2p_prn_procs =
-prn_params_procs(lips2p_open, gdev_prn_output_page, lips_close,
- lips_get_params, lips_put_params);
-
-private gx_device_procs lips3_prn_procs =
-prn_params_procs(lips3_open, gdev_prn_output_page, lips_close,
- lips_get_params, lips_put_params);
-
-private gx_device_procs bjc880j_prn_color_procs =
-prn_params_procs(bjc880j_open, gdev_prn_output_page, lips_close,
- lips4_get_params, lips4_put_params);
-
-private gx_device_procs lips4_prn_procs =
-prn_params_procs(lips4_open, gdev_prn_output_page, lips_close,
- lips4_get_params, lips4_put_params);
-
-gx_device_lips far_data gs_lips2p_device =
-lips_device(gx_device_lips, lips2p_prn_procs, "lips2p",
- LIPS2P_DPI_DEFAULT,
- LIPS2P_DPI_DEFAULT,
- LIPS2P_LEFT_MARGIN_DEFAULT,
- LIPS2P_BOTTOM_MARGIN_DEFAULT,
- LIPS2P_RIGHT_MARGIN_DEFAULT,
- LIPS2P_TOP_MARGIN_DEFAULT,
- 1, lips2p_print_page_copies, lips2p_image_out,
- LIPS_CASSETFEED_DEFAULT,
- LIPS_USERNAME_DEFAULT);
-
-gx_device_lips far_data gs_lips3_device =
-lips_device(gx_device_lips, lips3_prn_procs, "lips3",
- LIPS3_DPI_DEFAULT,
- LIPS3_DPI_DEFAULT,
- LIPS3_LEFT_MARGIN_DEFAULT,
- LIPS3_BOTTOM_MARGIN_DEFAULT,
- LIPS3_RIGHT_MARGIN_DEFAULT,
- LIPS3_TOP_MARGIN_DEFAULT,
- 1, lips3_print_page_copies, lips2p_image_out,
- LIPS_CASSETFEED_DEFAULT,
- LIPS_USERNAME_DEFAULT);
-
-gx_device_lips4 far_data gs_bjc880j_device =
-lips4_device(gx_device_lips4, bjc880j_prn_color_procs, "bjc880j",
- BJC880J_DPI_DEFAULT,
- BJC880J_DPI_DEFAULT,
- BJC880J_LEFT_MARGIN_DEFAULT,
- BJC880J_BOTTOM_MARGIN_DEFAULT,
- BJC880J_RIGHT_MARGIN_DEFAULT,
- BJC880J_TOP_MARGIN_DEFAULT,
- 1, bjc880j_print_page_copies, lips4_image_out,
- LIPS_CASSETFEED_DEFAULT,
- LIPS_USERNAME_DEFAULT);
-
-gx_device_lips4 far_data gs_lips4_device =
-lips4_device(gx_device_lips4, lips4_prn_procs, "lips4",
- LIPS4_DPI_DEFAULT,
- LIPS4_DPI_DEFAULT,
- LIPS4_LEFT_MARGIN_DEFAULT,
- LIPS4_BOTTOM_MARGIN_DEFAULT,
- LIPS4_RIGHT_MARGIN_DEFAULT,
- LIPS4_TOP_MARGIN_DEFAULT,
- 1, lips4_print_page_copies, lips4_image_out,
- LIPS_CASSETFEED_DEFAULT,
- LIPS_USERNAME_DEFAULT);
-
-/* Printer types */
-typedef enum {
- LIPS2P,
- LIPS3,
- BJC880J,
- LIPS4
-} lips_printer_type;
-
-/* Forward references */
-private void lips_job_start(gx_device_printer * dev, lips_printer_type ptype, FILE * fp, int num_copies);
-private void lips_job_end(gx_device_printer * pdev, FILE * fp);
-private int lips_open(gx_device * pdev, lips_printer_type ptype);
-private int lips4c_output_page(gx_device_printer * pdev, FILE * prn_stream);
-private int lips_delta_encode(byte * inBuff, byte * prevBuff, byte * outBuff, byte * diffBuff, int Length);
-private int lips_byte_cat(byte * TotalBuff, byte * Buff, int TotalLen, int Len);
-private int lips_print_page_copies(gx_device_printer * pdev, FILE * prn_stream, lips_printer_type ptype, int numcopies);
-#if GS_VERSION_MAJOR >= 8
-private int lips_print_page_copies(gx_device_printer * pdev, FILE * prn_stream, lips_printer_type ptype, int numcopies);
-private int lips4type_print_page_copies(gx_device_printer * pdev, FILE * prn_stream, int num_copies, int ptype);
-#else
-private int lips_print_page_copies(P4(gx_device_printer * pdev, FILE * prn_stream, lips_printer_type ptype, int numcopies));
-private int lips_print_page_copies(P4(gx_device_printer * pdev, FILE * prn_stream, lips_printer_type ptype, int numcopies));
-#endif
-private int
-lips2p_open(gx_device * pdev)
-{
- return lips_open(pdev, LIPS2P);
-}
-
-private int
-lips3_open(gx_device * pdev)
-{
- return lips_open(pdev, LIPS3);
-}
-
-private int
-bjc880j_open(gx_device * pdev)
-{
- return lips_open(pdev, BJC880J);
-}
-
-private int
-lips4_open(gx_device * pdev)
-{
- return lips_open(pdev, LIPS4);
-}
-
-/* Open the printer, adjusting the margins if necessary. */
-private int
-lips_open(gx_device * pdev, lips_printer_type ptype)
-{
- int width = pdev->MediaSize[0];
- int height = pdev->MediaSize[1];
- int xdpi = pdev->x_pixels_per_inch;
- int ydpi = pdev->y_pixels_per_inch;
-
- /* Paper Size Check */
- if (width <= height) { /* portrait */
- if ((width < LIPS_WIDTH_MIN || width > LIPS_WIDTH_MAX ||
- height < LIPS_HEIGHT_MIN || height > LIPS_HEIGHT_MAX) &&
- !(width == LIPS_LEDGER_WIDTH && height == LIPS_LEDGER_HEIGHT))
- return_error(gs_error_rangecheck);
- } else { /* landscape */
- if ((width < LIPS_HEIGHT_MIN || width > LIPS_HEIGHT_MAX ||
- height < LIPS_WIDTH_MIN || height > LIPS_WIDTH_MAX) &&
- !(width == LIPS_LEDGER_HEIGHT && height == LIPS_LEDGER_WIDTH))
- return_error(gs_error_rangecheck);
- }
-
- /* Resolution Check */
- if (xdpi != ydpi)
- return_error(gs_error_rangecheck);
- else if (ptype == LIPS2P) {
- /* LIPS II+ support DPI is 240x240 */
- if (xdpi != LIPS2P_DPI_MAX)
- return_error(gs_error_rangecheck);
- } else if (ptype == LIPS3) {
- /* LIPS III supports DPI is 300x300 */
- if (xdpi != LIPS3_DPI_MAX)
- return_error(gs_error_rangecheck);
- } else if (ptype == BJC880J) {
- if (xdpi < LIPS_DPI_MIN || xdpi > BJC880J_DPI_MAX)
- return_error(gs_error_rangecheck);
- } else { /* LIPS4 supprts DPI is 60x60 - 600x600 and 1200x1200 */
- if ((xdpi < LIPS_DPI_MIN || xdpi > LIPS4_DPI_MAX) && xdpi != LIPS4_DPI_SUPERFINE)
- return_error(gs_error_rangecheck);
- }
-
- return gdev_prn_open(pdev);
-}
-
-private int
-lips_close(gx_device * pdev)
-{
- gx_device_printer *const ppdev = (gx_device_printer *) pdev;
- gx_device_lips *const lips = (gx_device_lips *) pdev;
-
- gdev_prn_open_printer(pdev, 1);
-
- fprintf(ppdev->file, "%c0J%c", LIPS_DCS, LIPS_ST);
- if (lips->pjl)
- fprintf(ppdev->file,
- "%c%%-12345X"
- "@PJL SET LPARM : LIPS SW2 = OFF\n"
- "@PJL EOJ\n"
- "%c%%-12345X", LIPS_ESC, LIPS_ESC);
-
- return gdev_prn_close(pdev);
-}
-
-/* Get properties for the lips drivers. */
-private int
-lips_get_params(gx_device * pdev, gs_param_list * plist)
-{
- gx_device_lips *const lips = (gx_device_lips *) pdev;
- int code = lprn_get_params(pdev, plist);
- int ncode;
- gs_param_string usern;
-
- if (code < 0)
- return code;
-
- if ((ncode = param_write_int(plist, LIPS_OPTION_CASSETFEED,
- &lips->cassetFeed)) < 0)
- code = ncode;
-
- if ((ncode = param_write_bool(plist, LIPS_OPTION_PJL,
- &lips->pjl)) < 0)
- code = ncode;
-
- if ((ncode = param_write_int(plist, LIPS_OPTION_TONERDENSITY,
- &lips->toner_density)) < 0)
- code = ncode;
-
- if (lips->toner_saving_set >= 0 &&
- (code = (lips->toner_saving_set ?
- param_write_bool(plist, LIPS_OPTION_TONERSAVING, &lips->toner_saving) :
- param_write_null(plist, LIPS_OPTION_TONERSAVING))) < 0)
- code = ncode;
-
- if (code < 0)
- return code;
-
- usern.data = (const byte *)lips->Username,
- usern.size = strlen(lips->Username),
- usern.persistent = false;
-
- return param_write_string(plist, LIPS_OPTION_USER_NAME, &usern);
-}
-
-private int
-lips4_get_params(gx_device * pdev, gs_param_list * plist)
-{
- gx_device_lips4 *const lips4 = (gx_device_lips4 *) pdev;
- int code = lips_get_params(pdev, plist);
- int ncode;
- gs_param_string pmedia;
-
- if (code < 0)
- return code;
-
- if ((ncode = param_write_int(plist, LIPS_OPTION_NUP,
- &lips4->nup)) < 0)
- code = ncode;
-
- if ((ncode = param_write_bool(plist, LIPS_OPTION_FACEUP,
- &lips4->faceup)) < 0)
- code = ncode;
-
- if (code < 0)
- return code;
-
- pmedia.data = (const byte *)lips4->mediaType,
- pmedia.size = strlen(lips4->mediaType),
- pmedia.persistent = false;
-
- return param_write_string(plist, LIPS_OPTION_MEDIATYPE, &pmedia);
-}
-
-/* Put properties for the lips drivers. */
-private int
-lips_put_params(gx_device * pdev, gs_param_list * plist)
-{
- gx_device_lips *const lips = (gx_device_lips *) pdev;
- int ecode = 0;
- int code;
- gs_param_name param_name;
- int cass = lips->cassetFeed;
- bool pjl = lips->pjl;
- int toner_density = lips->toner_density;
- bool toner_saving = lips->toner_saving;
- bool toner_saving_set = lips->toner_saving_set;
- gs_param_string usern;
-
- switch (code = param_read_int(plist,
- (param_name = LIPS_OPTION_CASSETFEED),
- &cass)) {
- case 0:
- if (cass < -1 || cass > 17 || (cass > 3 && cass < 10))
- ecode = gs_error_rangecheck;
- else
- break;
- goto casse;
- default:
- ecode = code;
- casse:param_signal_error(plist, param_name, ecode);
- case 1:
- break;
- }
-
- if ((code = param_read_bool(plist,
- (param_name = LIPS_OPTION_PJL),
- &pjl)) < 0)
- param_signal_error(plist, param_name, ecode = code);
-
- switch (code = param_read_int(plist,
- (param_name = LIPS_OPTION_TONERDENSITY),
- &toner_density)) {
- case 0:
- if (toner_density < 0 || toner_density > 8)
- ecode = gs_error_rangecheck;
- else
- break;
- goto tden;
- default:
- ecode = code;
- tden:param_signal_error(plist, param_name, ecode);
- case 1:
- break;
- }
-
- if (lips->toner_saving_set >= 0)
- switch (code = param_read_bool(plist, (param_name = LIPS_OPTION_TONERSAVING),
- &toner_saving)) {
- case 0:
- toner_saving_set = 1;
- break;
- default:
- if ((code = param_read_null(plist, param_name)) == 0) {
- toner_saving_set = 0;
- break;
- }
- ecode = code;
- param_signal_error(plist, param_name, ecode);
- case 1:
- break;
- }
- switch (code = param_read_string(plist,
- (param_name = LIPS_OPTION_USER_NAME),
- &usern)) {
- case 0:
- if (usern.size > LIPS_USERNAME_MAX)
- ecode = gs_error_limitcheck;
- else { /* Check the validity of ``User Name'' characters */
- int i;
-
- for (i = 0; i < usern.size; i++)
- if (usern.data[i] < 0x20 ||
- usern.data[i] > 0x7e
- /*
- && usern.data[i] < 0xa0) ||
- usern.data[i] > 0xfe
- */
- ) {
- ecode = gs_error_rangecheck;
- goto userne;
- }
- }
- break;
- goto userne;
- default:
- ecode = code;
- userne:param_signal_error(plist, param_name, ecode);
- case 1:
- usern.data = 0;
- break;
- }
-
- if (ecode < 0)
- return ecode;
- code = lprn_put_params(pdev, plist);
- if (code < 0)
- return code;
-
- lips->cassetFeed = cass;
- lips->pjl = pjl;
- lips->toner_density = toner_density;
- lips->toner_saving = toner_saving;
- lips->toner_saving_set = toner_saving_set;
-
- if (usern.data != 0 &&
- bytes_compare(usern.data, usern.size,
- (const byte *)lips->Username, strlen(lips->Username))
- ) {
- memcpy(lips->Username, usern.data, usern.size);
- lips->Username[usern.size] = 0;
- }
- return 0;
-}
-
-private int
-lips4_put_params(gx_device * pdev, gs_param_list * plist)
-{
- gx_device_lips4 *const lips4 = (gx_device_lips4 *) pdev;
- int ecode = 0;
- int code;
- gs_param_name param_name;
- gs_param_string pmedia;
- bool nup = lips4->nup;
- bool faceup = lips4->faceup;
- int old_bpp = pdev->color_info.depth;
- int bpp = 0;
-
- switch (code = param_read_int(plist,
- (param_name = LIPS_OPTION_NUP),
- &nup)) {
- case 0:
- if (nup != 1 && nup != 2 && nup != 4)
- ecode = gs_error_rangecheck;
- else
- break;
- goto nupe;
- default:
- ecode = code;
- nupe:param_signal_error(plist, param_name, ecode);
- case 1:
- break;
- }
-
- if ((code = param_read_bool(plist,
- (param_name = LIPS_OPTION_FACEUP),
- &faceup)) < 0)
- param_signal_error(plist, param_name, ecode = code);
-
- switch (code = param_read_string(plist,
- (param_name = LIPS_OPTION_MEDIATYPE),
- &pmedia)) {
- case 0:
- if (pmedia.size > LIPS_MEDIACHAR_MAX)
- ecode = gs_error_limitcheck;
- else { /* Check the validity of ``MediaType'' characters */
- if (strcmp(pmedia.data, "PlainPaper") != 0 &&
- strcmp(pmedia.data, "OHP") != 0 &&
- strcmp(pmedia.data, "TransparencyFilm") != 0 && /* same as OHP */
- strcmp(pmedia.data, "GlossyFilm") != 0 &&
- strcmp(pmedia.data, "CardBoard") != 0
- ) {
- ecode = gs_error_rangecheck;
- goto pmediae;
- }
- }
- break;
- goto pmediae;
- default:
- ecode = code;
- pmediae:param_signal_error(plist, param_name, ecode);
- case 1:
- pmedia.data = 0;
- break;
- }
-
- switch (code = param_read_int(plist,
- (param_name = "BitsPerPixel"),
- &bpp)) {
- case 0:
- if (bpp != 1 && bpp != 24)
- ecode = gs_error_rangecheck;
- else
- break;
- goto bppe;
- default:
- ecode = code;
- bppe:param_signal_error(plist, param_name, ecode);
- case 1:
- break;
- }
-
- if (bpp != 0)
- {
- pdev->color_info.depth = bpp;
- pdev->color_info.num_components = ((bpp == 1) ? 1 : 3);
- pdev->color_info.max_gray = (bpp >= 8 ? 255 : 1);
- pdev->color_info.max_color = (bpp >= 8 ? 255 : bpp > 1 ? 1 : 0);
- pdev->color_info.dither_grays = (bpp >= 8 ? 5 : 2);
- pdev->color_info.dither_colors = (bpp >= 8 ? 5 : bpp > 1 ? 2 : 0);
- dev_proc(pdev, map_rgb_color) = ((bpp == 1) ? gdev_prn_map_rgb_color : gx_default_rgb_map_rgb_color);
- }
-
- if (ecode < 0)
- return ecode;
- code = lips_put_params(pdev, plist);
- if (code < 0)
- return code;
-
- lips4->nup = nup;
- lips4->faceup = faceup;
-
- if (pmedia.data != 0 &&
- bytes_compare(pmedia.data, pmedia.size,
- (const byte *)lips4->mediaType, strlen(lips4->mediaType))
- ) {
- memcpy(lips4->mediaType, pmedia.data, pmedia.size);
- lips4->mediaType[pmedia.size] = 0;
- }
- if (bpp != 0 && bpp != old_bpp && pdev->is_open)
- return gs_closedevice(pdev);
- return 0;
-}
-
-
-/* ------ Internal routines ------ */
-
-private int
-lips2p_print_page_copies(gx_device_printer * pdev, FILE * prn_stream, int num_copies)
-{
- return lips_print_page_copies(pdev, prn_stream, LIPS2P, num_copies);
-}
-
-private int
-lips3_print_page_copies(gx_device_printer * pdev, FILE * prn_stream, int num_copies)
-{
- return lips_print_page_copies(pdev, prn_stream, LIPS3, num_copies);
-}
-
-#define NUM_LINES 24 /* raster height */
-#define NUM_LINES_4C 256
-
-private int
-lips_print_page_copies(gx_device_printer * pdev, FILE * prn_stream, lips_printer_type ptype, int num_copies)
-{
- gx_device_lprn *const lprn = (gx_device_lprn *) pdev;
- int code = 0;
- int bpl = gdev_mem_bytes_per_scan_line(pdev);
- int maxY = lprn->BlockLine / lprn->nBh * lprn->nBh;
-
- /* Initialize printer. */
- lips_job_start(pdev, ptype, prn_stream, num_copies);
-
- if (!(lprn->CompBuf = gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), bpl * 3 / 2 + 1, maxY, "(CompBuf)")))
- return_error(gs_error_VMerror);
-
-
- lprn->NegativePrint = false; /* not support */
- lprn->prev_x = lprn->prev_y = 0;
- code = lprn_print_image(pdev, prn_stream);
- if (code < 0)
- return code;
-
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), lprn->CompBuf, bpl * 3 / 2 + 1, maxY, "(CompBuf)");
-
- /* eject page */
- lips_job_end(pdev, prn_stream);
-
-
- return 0;
-}
-
-private int
-bjc880j_print_page_copies(gx_device_printer * pdev, FILE * prn_stream, int num_copies)
-{
- return lips4type_print_page_copies(pdev, prn_stream, num_copies, BJC880J);
-}
-
-private int
-lips4_print_page_copies(gx_device_printer * pdev, FILE * prn_stream, int num_copies)
-{
- return lips4type_print_page_copies(pdev, prn_stream, num_copies, LIPS4);
-}
-
-private int
-lips4type_print_page_copies(gx_device_printer * pdev, FILE * prn_stream, int num_copies, int ptype)
-{
- gx_device_lprn *const lprn = (gx_device_lprn *) pdev;
- int code = 0;
- int bpl = gdev_mem_bytes_per_scan_line(pdev);
- int maxY = lprn->BlockLine / lprn->nBh * lprn->nBh;
-
- /* Initialize printer. */
- lips_job_start(pdev, ptype, prn_stream, num_copies);
-
- if (pdev->color_info.depth == 1)
- {
- if (!(lprn->CompBuf = gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), bpl * 3 / 2 + 1, maxY, "(CompBuf)")))
- return_error(gs_error_VMerror);
- if (!(lprn->CompBuf2 = gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), bpl * 3 / 2 + 1, maxY, "(CompBuf2)")))
- return_error(gs_error_VMerror);
-
- if (lprn->NegativePrint) {
- int rm = pdev->width - (dev_l_margin(pdev) + dev_r_margin(pdev)) * pdev->x_pixels_per_inch;
- int bm = pdev->height - (dev_t_margin(pdev) + dev_b_margin(pdev)) * pdev->y_pixels_per_inch;
- /* Draw black rectangle */
- fprintf(prn_stream,
- "%c{%c%da%c%de%c;;;3}",
- LIPS_CSI, LIPS_CSI, rm, LIPS_CSI, bm, LIPS_CSI);
- fprintf(prn_stream, "%c%dj%c%dk",
- LIPS_CSI, rm, LIPS_CSI, bm);
- }
-
-
- lprn->prev_x = lprn->prev_y = 0;
- code = lprn_print_image(pdev, prn_stream);
- if (code < 0)
- return code;
-
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), lprn->CompBuf, bpl * 3 / 2 + 1, maxY, "(CompBuf)");
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), lprn->CompBuf2, bpl * 3 / 2 + 1, maxY, "(CompBuf2)");
- }
- else
- {
- code = lips4c_output_page(pdev, prn_stream);
-
- if (code < 0)
- return code;
- }
-
- /* eject page */
- lips_job_end(pdev, prn_stream);
-
-
- return 0;
-}
-
-#if 0
-/* Send the page to the printer. */
-private int
-lips4c_print_page_copies(gx_device_printer * pdev, FILE * prn_stream, int num_copies)
-{
- int code;
-
- lips_job_start(pdev, BJC880J, prn_stream, num_copies);
-
- /* make output data */
- code = lips4c_output_page(pdev, prn_stream);
-
- if (code < 0)
- return code;
-
- /* eject page */
- lips_job_end(pdev, prn_stream);
-
- return 0;
-}
-#endif
-
-private void
-move_cap(gx_device_printer * pdev, FILE * prn_stream, int x, int y)
-{
- gx_device_lprn *const lprn = (gx_device_lprn *) pdev;
-
- if (x != lprn->prev_x) {
- if (x > lprn->prev_x)
- fprintf(prn_stream, "%c%da", LIPS_CSI, x - lprn->prev_x);
- else
- fprintf(prn_stream, "%c%dj", LIPS_CSI, lprn->prev_x - x);
-
- lprn->prev_x = x;
- }
- if (y != lprn->prev_y) {
- if (y > lprn->prev_y)
- fprintf(prn_stream, "%c%de", LIPS_CSI, y - lprn->prev_y);
- else
- fprintf(prn_stream, "%c%dk", LIPS_CSI, lprn->prev_y - y);
-
- lprn->prev_y = y;
- }
-}
-
-private void
-draw_bubble(FILE * prn_stream, int width, int height)
-{
- /* Draw a rectangle */
- fprintf(prn_stream,
- "%c{%c%da%c%de%c}",
- LIPS_CSI, LIPS_CSI, width, LIPS_CSI, height, LIPS_CSI);
- fprintf(prn_stream, "%c%dj%c%dk",
- LIPS_CSI, width, LIPS_CSI, height);
-}
-
-
-#if 0
-/* Non Compression Version of image_out */
-private void
-lips_image_out(gx_device_printer * pdev, FILE * prn_stream, int x, int y, int width, int height)
-{
- gx_device_lprn *const lprn = (gx_device_lprn *) pdev;
-
- int i, j;
- byte *p;
- int maxY = lprn->BlockLine / lprn->nBh * lprn->nBh;
-
- move_cap(pdev, prn_stream, x, y);
-
- fprintf(prn_stream, "%c%d;%d;%d.r", LIPS_CSI,
- width / 8 * height, width / 8, (int)pdev->x_pixels_per_inch);
-
- for (i = 0; i < height; i++) {
- p = lprn->ImageBuf + ((i + y) % maxY) * raster;
- for (j = 0; j < width / 8; j++) {
- fputc(p[j + data_x], prn_stream);
- }
- }
-
- if (lprn->ShowBubble)
- draw_bubble(prn_stream, width, height);
-}
-#endif
-
-private void
-lips2p_image_out(gx_device_printer * pdev, FILE * prn_stream, int x, int y, int width, int height)
-{
- gx_device_lprn *const lprn = (gx_device_lprn *) pdev;
- int Len;
- char raw_str[32]; /* LIPS command header (uncompress) */
- char comp_str[32]; /* LIPS command header (compress) */
-
- move_cap(pdev, prn_stream, x, y);
-
- Len = lips_mode3format_encode(lprn->TmpBuf, lprn->CompBuf, width / 8 * height);
- sprintf(raw_str, "%c%d;%d;%d.r", LIPS_CSI,
- width / 8 * height, width / 8, (int)pdev->x_pixels_per_inch);
- sprintf(comp_str, "%c%d;%d;%d;9;%d.r", LIPS_CSI,
- Len, width / 8, (int)pdev->x_pixels_per_inch, height);
-
- if (Len < width / 8 * height - strlen(comp_str) + strlen(raw_str)) {
- fprintf(prn_stream, "%s", comp_str);
- fwrite(lprn->CompBuf, 1, Len, prn_stream);
- } else {
- /* compression result is bad. */
- fprintf(prn_stream, "%s", raw_str);
- fwrite(lprn->TmpBuf, 1, width / 8 * height, prn_stream);
- }
-
- if (lprn->ShowBubble)
- draw_bubble(prn_stream, width, height);
-}
-
-private void
-lips4_image_out(gx_device_printer * pdev, FILE * prn_stream, int x, int y, int width, int height)
-{
- gx_device_lprn *const lprn = (gx_device_lprn *) pdev;
- int Len, Len_rle;
- char raw_str[32]; /* LIPS command header (uncompress) */
- char comp_str[32]; /* LIPS command header (compress) */
-
- move_cap(pdev, prn_stream, x, y);
-
- Len = lips_packbits_encode(lprn->TmpBuf, lprn->CompBuf, width / 8 * height);
- Len_rle = lips_rle_encode(lprn->TmpBuf, lprn->CompBuf2, width / 8 * height);
-
- sprintf(raw_str, "%c%d;%d;%d.r", LIPS_CSI,
- width / 8 * height, width / 8, (int)pdev->x_pixels_per_inch);
-
- if (Len < Len_rle) {
- sprintf(comp_str, "%c%d;%d;%d;11;%d.r", LIPS_CSI,
- Len, width / 8, (int)pdev->x_pixels_per_inch, height);
- if (Len < width / 8 * height - strlen(comp_str) + strlen(raw_str)) {
- fprintf(prn_stream, "%s", comp_str);
- fwrite(lprn->CompBuf, 1, Len, prn_stream);
- } else {
- /* compression result is bad. */
- fprintf(prn_stream, "%s", raw_str);
- fwrite(lprn->TmpBuf, 1, width / 8 * height, prn_stream);
- }
- } else {
- sprintf(comp_str, "%c%d;%d;%d;10;%d.r", LIPS_CSI,
- Len, width / 8, (int)pdev->x_pixels_per_inch, height);
- if (Len_rle < width / 8 * height - strlen(comp_str) + strlen(raw_str)) {
- fprintf(prn_stream, "%s", comp_str);
- fwrite(lprn->CompBuf2, 1, Len, prn_stream);
- } else {
- /* compression result is bad. */
- fprintf(prn_stream, "%s", raw_str);
- fwrite(lprn->TmpBuf, 1, width / 8 * height, prn_stream);
- }
- }
-
- if (lprn->ShowBubble)
- draw_bubble(prn_stream, width, height);
-}
-
-private int
-lips4c_write_raster(gx_device_printer * pdev, FILE * prn_stream, byte * pBuff, byte * prevBuff, byte * ComBuff, byte * TotalBuff, byte * diffBuff, int lnum, int raster_height)
-{
- int bits_per_pixel = pdev->color_info.depth;
- int num_components = bits_per_pixel > 8 ? 3 : 1;
- int nBytesPerLine = gdev_prn_raster(pdev);
- int Xpixel = nBytesPerLine / num_components;
- int TotalLen = 0;
- int num_zerobyte = 0;
- bool zerobyte_flag = false;
- int i, y, Len;
-
- for (i = 0; i < nBytesPerLine; i++) {
- *(prevBuff + i) = 0x00; /* initialize */
- }
-
- for (y = lnum; y < lnum + raster_height; y++) {
- gdev_prn_copy_scan_lines(pdev, y, pBuff, nBytesPerLine);
-
- Len = lips_delta_encode(pBuff,
- prevBuff, ComBuff, diffBuff,
- Xpixel * num_components);
-
- if (Len == 2 && *ComBuff == 0x01) {
- if (zerobyte_flag == false) {
- zerobyte_flag = true;
- TotalLen = lips_byte_cat(TotalBuff, ComBuff, TotalLen, Len);
- } else {
- if (num_zerobyte > 255) {
- TotalLen = lips_byte_cat(TotalBuff, ComBuff, TotalLen, Len);
- } else {
- *(TotalBuff + TotalLen - 1) = num_zerobyte;
- }
- num_zerobyte++;
- }
- } else {
- TotalLen = lips_byte_cat(TotalBuff, ComBuff, TotalLen, Len);
- zerobyte_flag = false;
- num_zerobyte = 0;
- }
- }
-
- fprintf(prn_stream, "%c%d;%d;%d;12;%d;;%d;%d;;1.r", LIPS_CSI,
- TotalLen, Xpixel, (int)pdev->x_pixels_per_inch,
- raster_height,
- bits_per_pixel / num_components,
- num_components < 3 ? 0 : 10);
- fwrite(TotalBuff, 1, TotalLen, prn_stream);
- fputc(0x85, prn_stream); /* CR + LF */
-
- return 0;
-}
-
-private int
-lips4c_output_page(gx_device_printer * pdev, FILE * prn_stream)
-{
- byte *pBuff, *ComBuff, *prevBuff, *TotalBuff, *diffBuff;
- int bits_per_pixel = pdev->color_info.depth;
- int num_components = bits_per_pixel > 8 ? 3 : 1;
- int nBytesPerLine = gdev_prn_raster(pdev);
- int Xpixel = nBytesPerLine / num_components;
- int lnum = 0;
-
- /* Memory Allocate */
- if (!(pBuff = (byte *) gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), nBytesPerLine, sizeof(byte), "lips4c_compress_output_page(pBuff)")))
- return_error(gs_error_VMerror);
- if (!(prevBuff = (byte *) gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), nBytesPerLine, sizeof(byte), "lips4c_compress_output_page(prevBuff)")))
- return_error(gs_error_VMerror);
- if (!(ComBuff = (byte *) gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), Xpixel * num_components + (Xpixel * num_components + 127) * 129 / 128, sizeof(byte), "lips4c_compress_output_page(ComBuff)")))
- return_error(gs_error_VMerror);
- if (!(TotalBuff = (byte *) gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), (Xpixel * num_components + (Xpixel * num_components + 127) * 129 / 128) * NUM_LINES_4C, sizeof(byte), "lips4c_compress_output_page(TotalBuff)")))
- return_error(gs_error_VMerror);
- if (!(diffBuff = (byte *) gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), Xpixel * num_components * 2, sizeof(byte), "lips_print_page")))
- return_error(gs_error_VMerror);
-
- /* make output data */
- while (lnum < pdev->height) {
- lips4c_write_raster(pdev, prn_stream, pBuff, prevBuff, ComBuff,
- TotalBuff, diffBuff, lnum, NUM_LINES_4C);
- lnum += NUM_LINES_4C;
- }
-
- if (pdev->height - (lnum - NUM_LINES_4C) > 0) {
- lips4c_write_raster(pdev, prn_stream, pBuff, prevBuff, ComBuff,
- TotalBuff, diffBuff, lnum - NUM_LINES_4C,
- pdev->height - (lnum - NUM_LINES_4C));
- }
- /* Free Memory */
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), pBuff, nBytesPerLine, sizeof(byte), "lips4c_compress_output_page(pBuff)");
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), prevBuff, nBytesPerLine, sizeof(byte), "lips4c_compress_output_page(prevBuff)");
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), ComBuff, Xpixel * num_components + (Xpixel * num_components + 127) * 129 / 128, sizeof(byte), "lips4c_compress_output_page(ComBuff)");
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), TotalBuff, (Xpixel * num_components + (Xpixel * num_components + 127) * 129 / 128) * NUM_LINES_4C, sizeof(byte), "lips4c_compress_output_page(TotalBuff)");
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), diffBuff, Xpixel * num_components * 2, sizeof(byte), "lips_print_page");
-
- return 0;
-}
-
-
-private void
-lips_job_start(gx_device_printer * pdev, lips_printer_type ptype, FILE * prn_stream, int num_copies)
-{
- gx_device_lips *const lips = (gx_device_lips *) pdev;
- gx_device_lips4 *const lips4 = (gx_device_lips4 *) pdev;
- int prev_paper_size, prev_paper_width, prev_paper_height, paper_size;
- int width = pdev->MediaSize[0];
- int height = pdev->MediaSize[1];
- int tm, lm, rm, bm;
-
- if (pdev->PageCount == 0) {
- if (lips->pjl) {
- fprintf(prn_stream,
- "%c%%-12345X@PJL CJLMODE\n"
- "@PJL JOB\n", LIPS_ESC);
- if (ptype == LIPS4) {
- fprintf(prn_stream,
- "%c%%-12345X@PJL CJLMODE\n", LIPS_ESC);
- if ((int)pdev->x_pixels_per_inch == 1200)
- fprintf(prn_stream, "@PJL SET RESOLUTION = SUPERFINE\n");
- else if ((int)pdev->x_pixels_per_inch == 600)
- fprintf(prn_stream, "@PJL SET RESOLUTION = FINE\n");
- else if ((int)pdev->x_pixels_per_inch == 300)
- fprintf(prn_stream, "@PJL SET RESOLUTION = QUICK\n");
- }
- if (lips->toner_density)
- fprintf(prn_stream, "@PJL SET TONER-DENSITY=%d\n",
- lips->toner_density);
- if (lips->toner_saving_set) {
- fprintf(prn_stream, "@PJL SET TONER-SAVING=");
- if (lips->toner_saving)
- fprintf(prn_stream, "ON\n");
- else
- fprintf(prn_stream, "OFF\n");
- }
- fprintf(prn_stream,
- "@PJL SET LPARM : LIPS SW2 = ON\n"
- "@PJL ENTER LANGUAGE = LIPS\n");
- }
- fprintf(prn_stream, "%c%%@", LIPS_ESC);
- if (ptype == LIPS2P)
- fprintf(prn_stream, "%c21;%d;0J" LIPS2P_STRING LIPS_VERSION "%c",
- LIPS_DCS, (int)pdev->x_pixels_per_inch, LIPS_ST);
- else if (ptype == LIPS3)
- fprintf(prn_stream, "%c31;%d;0J" LIPS3_STRING LIPS_VERSION "%c",
- LIPS_DCS, (int)pdev->x_pixels_per_inch, LIPS_ST);
- else if (ptype == LIPS4)
- fprintf(prn_stream, "%c41;%d;0J" LIPS4_STRING LIPS_VERSION "%c",
- LIPS_DCS, (int)pdev->x_pixels_per_inch, LIPS_ST);
- else if (ptype == BJC880J)
- fprintf(prn_stream, "%c41;%d;0J" BJC880J_STRING LIPS_VERSION "%c",
- LIPS_DCS, (int)pdev->x_pixels_per_inch, LIPS_ST);
-
- if (ptype == LIPS4 || ptype == BJC880J)
- {
- if (pdev->color_info.depth == 24)
- fprintf(prn_stream, "%c1\"p", LIPS_CSI);
- else
- fprintf(prn_stream, "%c0\"p", LIPS_CSI);
- }
- fprintf(prn_stream, "%c<", LIPS_ESC);
- fprintf(prn_stream, "%c11h", LIPS_CSI); /* Size Unit Mode */
- }
- /* */
- /* Print Environment Setting */
- /* */
- /* Media Selection */
- paper_size = lips_media_selection(width, height);
-
- if (ptype == BJC880J) {
- /* Paint Memory Mode Setting */
- /* for BJC-680J/BJC-880J */
- if (paper_size == B4_SIZE ||
- paper_size == B4_SIZE + LANDSCAPE ||
- paper_size == LEGAL_SIZE ||
- paper_size == LEGAL_SIZE + LANDSCAPE)
- /* for BJC-880J */
- fprintf(prn_stream, "%c3&z", LIPS_CSI);
- else if (paper_size == A3_SIZE ||
- paper_size == A3_SIZE + LANDSCAPE ||
- paper_size == LEDGER_SIZE ||
- paper_size == LEDGER_SIZE + LANDSCAPE)
- /* for BJC-880J */
- fprintf(prn_stream, "%c4&z", LIPS_CSI);
- else
- fprintf(prn_stream, "%c2&z", LIPS_CSI);
- }
- if (ptype == LIPS4) {
- if (strcmp(lips4->mediaType, "PlainPaper") == 0)
- fprintf(prn_stream, "%c20\'t", LIPS_CSI);
- else if (strcmp(lips4->mediaType, "OHP") == 0 ||
- strcmp(lips4->mediaType, "TransparencyFilm") == 0)
- fprintf(prn_stream, "%c40\'t", LIPS_CSI); /* OHP mode (for LBP-2160) */
- else if (strcmp(lips4->mediaType, "CardBoard") == 0)
- fprintf(prn_stream, "%c30\'t", LIPS_CSI); /* CardBoard mode (for LBP-2160) */
- else if (strcmp(lips4->mediaType, "GlossyFilm") == 0)
- fprintf(prn_stream, "%c41\'t", LIPS_CSI); /* GlossyFile mode (for LBP-2160) */
- }
- if (ptype == LIPS4 || ptype == BJC880J) {
- if (lips4->ManualFeed ||
- (strcmp(lips4->mediaType, "PlainPaper") != 0 && strcmp(lips4->mediaType, LIPS_MEDIATYPE_DEFAULT) != 0)) {
- if (lips->prev_feed_mode != 10)
- fprintf(prn_stream, "%c10q", LIPS_CSI);
- lips->prev_feed_mode = 10;
- } else {
- if (lips->prev_feed_mode != lips->cassetFeed)
- fprintf(prn_stream, "%c%dq", LIPS_CSI, lips->cassetFeed);
- lips->prev_feed_mode = lips->cassetFeed;
- }
- } else if (lips->ManualFeed) { /* Use ManualFeed */
- if (lips->prev_feed_mode != 1)
- fprintf(prn_stream, "%c1q", LIPS_CSI);
- lips->prev_feed_mode = 1;
- } else {
- if (lips->prev_feed_mode != lips->cassetFeed)
- fprintf(prn_stream, "%c%dq", LIPS_CSI, lips->cassetFeed);
- lips->prev_feed_mode = lips->cassetFeed;
- }
-
- /* Use Verious Paper Size */
- prev_paper_size = lips->prev_paper_size;
- prev_paper_width = lips->prev_paper_width;
- prev_paper_height = lips->prev_paper_height;
-
- if (prev_paper_size != paper_size) {
- if (paper_size == USER_SIZE) {
- fprintf(prn_stream, "%c2 I", LIPS_CSI);
- fprintf(prn_stream, "%c80;%d;%dp", LIPS_CSI,
- width * 10, height * 10);
- } else if (paper_size == USER_SIZE + LANDSCAPE) {
- fprintf(prn_stream, "%c2 I", LIPS_CSI);
- fprintf(prn_stream, "%c81;%d;%dp", LIPS_CSI,
- height * 10, width * 10);
- } else {
- fprintf(prn_stream, "%c%dp", LIPS_CSI, paper_size);
- }
- } else if (paper_size == USER_SIZE) {
- if (prev_paper_width != width ||
- prev_paper_height != height) {
- fprintf(prn_stream, "%c2 I", LIPS_CSI);
- fprintf(prn_stream, "%c80;%d;%dp", LIPS_CSI,
- width * 10, height * 10);
- }
- } else if (paper_size == USER_SIZE + LANDSCAPE) {
- if (prev_paper_width != width ||
- prev_paper_height != height) {
- fprintf(prn_stream, "%c2 I", LIPS_CSI);
- fprintf(prn_stream, "%c81;%d;%dp", LIPS_CSI,
- height * 10, width * 10);
- }
- }
- /* desired number of copies */
- if (num_copies > 255)
- num_copies = 255;
- if (lips->prev_num_copies != num_copies) {
- fprintf(prn_stream, "%c%dv", LIPS_CSI, num_copies);
- lips->prev_num_copies = num_copies;
- }
- if (ptype == LIPS4) {
- if (lips4->faceup)
- fprintf(prn_stream, "%c11;12;12~", LIPS_CSI);
- }
- if (ptype == LIPS4) {
-
- if (pdev->PageCount == 0) {
- /* N-up Printing */
- if (lips4->nup != 1) {
- fprintf(prn_stream, "%c%d1;;%do", LIPS_CSI, lips4->nup, paper_size);
- }
- }
- /* Duplex mode */
- {
- bool dup = lips4->Duplex;
- int dupset = lips4->Duplex_set;
- bool tum = lips4->Tumble;
-
- if (dupset && dup) {
- if (lips4->prev_duplex_mode == 0 ||
- lips4->prev_duplex_mode == 1)
- fprintf(prn_stream, "%c2;#x", LIPS_CSI); /* duplex */
- if (!tum) {
- /* long edge binding */
- if (lips4->prev_duplex_mode != 2)
- fprintf(prn_stream, "%c0;#w", LIPS_CSI);
- lips4->prev_duplex_mode = 2;
- } else {
- /* short edge binding */
- if (lips4->prev_duplex_mode != 3)
- fprintf(prn_stream, "%c2;#w", LIPS_CSI);
- lips4->prev_duplex_mode = 3;
- }
- } else if (dupset && !dup) {
- if (lips4->prev_duplex_mode != 1)
- fprintf(prn_stream, "%c0;#x", LIPS_CSI); /* simplex */
- lips4->prev_duplex_mode = 1;
- }
- }
- }
- if (pdev->PageCount == 0) {
- /* Display text on printer panel */
- fprintf(prn_stream, "%c2y%s%c", LIPS_DCS, lips->Username, LIPS_ST);
-
- fprintf(prn_stream, "%c11h", LIPS_CSI); /* Size Unit Mode */
-
- fprintf(prn_stream, "%c?2;3h", LIPS_CSI);
- /* 2: Disable Auto FF */
- /* 3: Disable Auto CAP Movement */
-
- fprintf(prn_stream, "%c?1;4;5;6l", LIPS_CSI);
- /* 1: Disable Auto NF */
- /* 4: Disable Auto LF at CR */
- /* 5: Disable Auto CR at LF */
- /* 6: Disable Auto CR at FF */
- }
- if (prev_paper_size != paper_size || paper_size == USER_SIZE ||
- paper_size == USER_SIZE + LANDSCAPE) {
- if (ptype == LIPS4 || ptype == BJC880J) {
- fprintf(prn_stream, "%c?7;%d I", LIPS_CSI,
- (int)pdev->x_pixels_per_inch); /* SelectSizeUnit */
- } else {
- fprintf(prn_stream, "%c7 I", LIPS_CSI); /* SelectSizeUnit */
- }
-
- if (ptype == LIPS4 || ptype == BJC880J)
- {
- if (pdev->color_info.depth == 24)
- fprintf(prn_stream, "%c%d G", LIPS_CSI, NUM_LINES_4C); /* VMI (dots) */
- else
- fprintf(prn_stream, "%c%d G", LIPS_CSI, NUM_LINES); /* VMI (dots) */
- }
- }
- if (prev_paper_size != paper_size) {
- /* Top Margin: 63/300 inch + 5 mm */
- tm = (63. / 300. + 5. / MMETER_PER_INCH - dev_t_margin(pdev)) * pdev->x_pixels_per_inch;
- if (tm > 0)
- fprintf(prn_stream, "%c%dk", LIPS_CSI, tm);
- if (tm < 0)
- fprintf(prn_stream, "%c%de", LIPS_CSI, -tm);
-
- /* Left Margin: 5 mm left */
- lm = (5. / MMETER_PER_INCH - dev_l_margin(pdev)) * pdev->x_pixels_per_inch;
- if (lm > 0)
- fprintf(prn_stream, "%c%dj", LIPS_CSI, lm);
- if (lm < 0)
- fprintf(prn_stream, "%c%da", LIPS_CSI, -lm);
-
- /* Set Top/Left Margins */
- fprintf(prn_stream, "%c0;2t", LIPS_CSI);
-
- /* Bottom Margin: height */
- bm = pdev->height - (dev_t_margin(pdev) + dev_b_margin(pdev)) * pdev->y_pixels_per_inch;
- fprintf(prn_stream, "%c%de", LIPS_CSI, bm);
- /* Right Margin: width */
- rm = pdev->width - (dev_l_margin(pdev) + dev_r_margin(pdev)) * pdev->x_pixels_per_inch;
- fprintf(prn_stream, "%c%da", LIPS_CSI, rm);
- fprintf(prn_stream, "%c1;3t", LIPS_CSI);
-
- /* move CAP to (0, 0) */
- fprintf(prn_stream, "%c%dk\r", LIPS_CSI, bm);
- }
- lips->prev_paper_size = paper_size;
- lips->prev_paper_width = width;
- lips->prev_paper_height = height;
-}
-
-private void
-lips_job_end(gx_device_printer * pdev, FILE * prn_stream)
-{
- /* Paper eject command */
- fprintf(prn_stream, "\r%c", LIPS_FF);
-}
-
-private int lips_delta_compress(byte * inBuff, byte * prevBuff, byte * diffBuff, int Length);
-
-private int
-lips_delta_encode(byte * inBuff, byte * prevBuff, byte * outBuff, byte * diffBuff, int Length)
-{
- int i, j, k, com_size;
-
-
-
- com_size = lips_delta_compress(inBuff, prevBuff, diffBuff, Length);
- if (com_size < 0) { /* data is white raster */
- *outBuff = 0x01;
- *(outBuff + 1) = 0000;
- for (k = 0; k < Length; k++)
- *(prevBuff + k) = 0000;
- return 2;
- } else if (com_size == 0) { /* data is the same raster */
- *outBuff = 0000;
- return 1;
- }
- for (i = 0; i < com_size / 255; i++) {
- *(outBuff + i) = 0377;
- }
-
- *(outBuff + i) = (byte) (com_size % 255);
-
- for (j = 0; j < com_size; j++) {
- *(outBuff + i + j + 1) = *(diffBuff + j);
- }
-
- for (k = 0; k < Length; k++)
- *(prevBuff + k) = *(inBuff + k);
-
-
- return i + j + 1;
-}
-
-private int
-lips_delta_compress(byte * inBuff, byte * prevBuff, byte * diffBuff, int Length)
-{
- int i, j;
- bool zero_flag = TRUE;
- bool same_flag = TRUE;
- int num_bytes = 0;
- int num_commandbyte = 0;
- int size = 0;
- int offset = 0;
-
- for (i = 0; i < Length; i++) {
- if (*(inBuff + i) != 0x00)
- zero_flag = FALSE;
-
- /* Compare Buffer */
- if (*(inBuff + i) != *(prevBuff + i)) {
- num_bytes++;
-
- if (same_flag == TRUE) {
- /* first byte is offset */
- if (offset > 31)
- *(diffBuff + size) = 0037;
- else
- *(diffBuff + size) = offset;
-
- size++;
- num_commandbyte++;
-
- for (j = 0; j < (offset - 31) / 255; j++) {
- *(diffBuff + size) = 0377;
- size++;
- num_commandbyte++;
- }
-
- if ((offset - 31) % 255 >= 0) {
- *(diffBuff + size) = (offset - 31) % 255;
- size++;
- num_commandbyte++;
- }
- same_flag = FALSE;
-
- }
- } else {
- same_flag = TRUE;
- offset++;
- }
-
- if (num_bytes > 8) {
- /* write number of data for replace */
- *(diffBuff + size - num_commandbyte)
- = *(diffBuff + size - num_commandbyte) | 0340;
-
- for (j = 0; j < 8; j++, size++) {
- *(diffBuff + size) = *(inBuff + i + j - 8);
- }
-
- /* offset is 0 */
- *(diffBuff + size) = 0000;
- size++;
-
- num_bytes = 1;
- same_flag = FALSE;
- num_commandbyte = 1;
- } else if (same_flag == true && num_bytes > 0) {
- offset = 1;
-
- /* write number of data for replace */
- *(diffBuff + size - num_commandbyte)
- = *(diffBuff + size - num_commandbyte) | ((num_bytes - 1) << 5);
-
- /* write a different bytes */
- for (j = 0; j < num_bytes; j++, size++) {
- *(diffBuff + size) = *(inBuff + i + j - num_bytes);
- }
- num_bytes = 0;
- num_commandbyte = 0;
- }
- }
-
- if (num_bytes > 0) {
- /* write number of data for replace */
- *(diffBuff + size - num_commandbyte)
- = *(diffBuff + size - num_commandbyte) | ((num_bytes - 1) << 5);
-
- for (j = 0; j < num_bytes; j++, size++) {
- *(diffBuff + size) = *(inBuff + i + j - num_bytes);
- }
- }
- if (zero_flag)
- return -1;
-
- return size;
-}
-
-/* This routine work like ``strcat'' */
-private int
-lips_byte_cat(byte * TotalBuff, byte * Buff, int TotalLen, int Len)
-{
- int i;
-
- for (i = 0; i < Len; i++)
- *(TotalBuff + TotalLen + i) = *(Buff + i);
-
- return TotalLen + Len;
-}
diff --git a/gs/contrib/lips4/gdevl4v.c b/gs/contrib/lips4/gdevl4v.c
deleted file mode 100644
index 5688d0888..000000000
--- a/gs/contrib/lips4/gdevl4v.c
+++ /dev/null
@@ -1,2490 +0,0 @@
-/* Copyright (C) 1998, 1999 Norihito Ohmori.
-
- Ghostscript printer driver
- for Canon LBP (LIPS IV)
-
- This software 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 GNU General Public License for full details.
-
- Everyone is granted permission to copy, modify and redistribute
- this software, but only under the conditions described in the GNU
- General Public License. A copy of this license is supposed to have been
- given to you along with this software 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.
- */
-
-/*$Id: gdevl4v.c $ */
-/* Vector Version of LIPS driver */
-
-/*
-
- Vector driver ¤Ï Ghostscript 5.0 ¤«¤é¿·¤¿¤Ë²Ã¤ï¤Ã¤¿¥É¥é¥¤¥Ð¤Ç¤¹¡£
- ¤è¤Ã¤Æ»ÅÍͤ¬°ÂÄꤷ¤Æ¤¤¤Þ¤»¤ó¡£Ghostscript 5.10 ¤È Ghostscript 5.50 ¤Ç¤Ï
- Hi-level bitmap imaging ¤Î»ÅÍͤ¬ÊѤï¤Ã¤Æ¤¤¤Þ¤¹¡£
- Ghostscript 6.0 ¤Ç¤Ï¹¹¤Ë text_begin ¤È¤¤¤¦ API ¤¬Äɲ䵤ì¤ë¤è¤¦¤Ç¤¹¡£
-
-
- ¡ûGhostscript 5.10/5.50 ¤Î¥Ð¥°¤Ë¤Ä¤¤¤Æ
-
- Ghostscript 5.10/5.50 ¤Î Vector driver ¤Î setlinewidth ´Ø¿ô¤Ë¤Ï
- ¥Ð¥°¤¬¤¢¤ê¤Þ¤¹¡£ËÜÍ襹¥±¡¼¥ë¤¬Êѹ¹¤µ¤ì¤ë¤Ë¤·¤¿¤¬¤Ã¤ÆÀþ¤ÎÂÀ¤µ¤âÊѹ¹¤µ¤ì
- ¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¤¬¡¢Ghostscript 5.10/5.50 ¤Ç¤Ï¥¹¥±¡¼¥ë¤ò¹Íθ¤¹¤ë¤Î¤ò
- ˺¤ì¤Æ¤¤¤Þ¤¹¡£(¥Ð¥°Êó¹ð¤ò2²ó¤Û¤ÉÁ÷¤Ã¤¿¤Î¤À¤±¤ì¤É...)
- ¤³¤Î¥É¥é¥¤¥Ð¤Ï¤½¤Î¥Ð¥°¤ò²óÈò¤¹¤ë¤¿¤á¤Ë¥¹¥±¡¼¥ë¤ò¼«Ê¬¤Ç½èÍý¤·¤Æ¤¤¤Þ¤¹¡£
-
- Ghostscript 5.10 ¤ÎÀ¸À®¤¹¤ë¥Ñ¥¹¤Ï Ghostscript 5.50 ¤¬À¸À®¤¹¤ë¥Ñ¥¹¤è¤ê¤â
- Èó¾ï¤Ë¸úΨ¤Î°­¤¤¤â¤Î¤Ë¤Ê¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£LIPS IV ¤Î½èÍý¤Ç¤­¤ë¸Â³¦¤òĶ¤¨¤ë
- ¤³¤È¤â¤¢¤ê¤Þ¤·¤¿¡£¸úΨ¤Î°­¤¤¥Ñ¥¹¤Ï®ÅÙ¤ÎÄã²¼¤Ë¤â¤Ä¤Ê¤¬¤ë¤Î¤Ç Ghostscript
- 5.50 ¤ò»È¤Ã¤¿Êý¤¬¤³¤Î¥É¥é¥¤¥Ð¤Ç¤Ï½ÐÎÏ®ÅÙ¤¬Â®¤¯¤Ê¤ê¤Þ¤¹¡£
-
- ¤Þ¤¿ Ghostscript 5.10 ¤Ç¤Ï
- fill_trapezoid¡¢fill_parallelogram¡¢fill_triangle
- ¤Î´Ø¿ô¤ÎµóÆ°¤¬ÊѤˤʤ뤳¤È¤¬¤¢¤Ã¤¿¤Î¤Ç¤³¤ì¤é¤Ï»È¤Ã¤Æ¤¤¤Þ¤»¤ó¡£
-
-
- ¡û LIPS IV ¤Î¥Ð¥°¤Ë¤Ä¤¤¤Æ
-
- ¤³¤Î¥É¥é¥¤¥Ð¤Ï³«È¯Ãæ¤Ëȯ¸«¤·¤¿¼¡¤Î LIPS IV ¤Î¥Ð¥°¤ò²óÈò¤·¤Æ¤¤¤Þ¤¹¡£
- 1. 1 dot ¤Î¥¤¥á¡¼¥¸¤òÊÑ·Á¤·¤¿¤È¤­¤ËºÂɸ¤Î·×»»¤¬¶¸¤¦
- 2. ¾®¤µ¤Ê¥¤¥á¡¼¥¸¤òÉÁ²è¤¹¤ë¤ÈÀµ¾ï¤ËÉÁ¤«¤ì¤Ê¤¤
- 3. ¥¯¥ê¥Ã¥Ô¥ó¥°Ì¿Îá¤È¥Ñ¥¹¡¦¥¯¥ê¥Ã¥Ô¥ó¥°Ì¿Î᤬¤½¤ì¤¾¤ìÆÈΩ¤ËƯ¤¤¤Æ¤·¤Þ¤¦¡£
-
- 1. ¤Ï 1 dot ¤Î¥¤¥á¡¼¥¸¤ò¶ë·Á¤Ë¤·¤Æ²óÈò¤·¤Þ¤·¤¿¡£
- 2. ¤Ï¥¤¥á¡¼¥¸Îΰè³ÎÊÝÌ¿Îá¤Çʬ³ä¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤ê²óÈò¤·¤Þ¤·¤¿¡£
- 3. ¤Ï¥¯¥ê¥Ã¥Ô¥ó¥°Ì¿Îá¤ò»È¤ï¤Ê¤¤¤³¤È¤Ë¤·¤Æ²óÈò¤·¤Þ¤·¤¿¡£
-
-
- ¡û LIPS IV ¤Î»ÅÍͤˤĤ¤¤Æ
-
- 1. ñ¿§¥¤¥á¡¼¥¸¡¦¥«¥é¡¼»ØÄêÌ¿Îá¤Ï¥°¥ì¡¼¥¹¥±¡¼¥ë¥¤¥á¡¼¥¸¤ËÂФ·¤Æ¤â
- Ư¤¤¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
- 2. LIPS IV ¤Ç¤Ï¥°¥ì¡¼¥¹¥±¡¼¥ë¤Î¿§É½¸½¤¬ PostScript ¤ÈµÕ¤Ç¤¹¡£
- 3. LIPS IV ¤Ë¤Ï¥¤¥á¡¼¥¸¤Î¥Ó¥Ã¥È¤òȿž¤µ¤»¤ë¥³¥Þ¥ó¥É¤Ï¤¢¤ê¤Þ¤»¤ó¡£
- 4. LIPS IV ¤Ë¤Ï CMYK ¤Î¥«¥é¡¼¥¹¥Ú¡¼¥¹¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-
- */
-
-#include "string.h"
-#include "math_.h"
-#include "gx.h"
-#include "gserrors.h"
-#include "gsmatrix.h"
-#include "gsparam.h"
-#include "gxdevice.h"
-#include "gscspace.h"
-#include "gsutil.h"
-#include "gdevvec.h"
-#if 0
-#include "gdevpstr.h"
-#endif
-#include "ghost.h"
-#include "gzstate.h"
-#include "imemory.h"
-#include "igstate.h"
-#include "gdevlips.h"
-
-/* ---------------- Device definition ---------------- */
-
-/* Device procedures */
-private dev_proc_open_device(lips4v_open);
-private dev_proc_output_page(lips4v_output_page);
-private dev_proc_close_device(lips4v_close);
-private dev_proc_copy_mono(lips4v_copy_mono);
-private dev_proc_copy_color(lips4v_copy_color);
-private dev_proc_put_params(lips4v_put_params);
-private dev_proc_get_params(lips4v_get_params);
-private dev_proc_fill_mask(lips4v_fill_mask);
-private dev_proc_begin_image(lips4v_begin_image);
-
-
-#define X_DPI 600
-#define Y_DPI 600
-
-typedef struct gx_device_lips4v_s
-{
- gx_device_vector_common;
- lips_params_common;
- lips4_params_common;
- bool first_page;
- bool ManualFeed;
- bool Duplex;
- int Duplex_set;
- bool Tumble;
- bool OneBitMask; /* for LIPS Bug */
- int ncomp;
- int MaskReverse;
- int MaskState;
- bool TextMode;
- int prev_x;
- int prev_y;
- gx_color_index prev_color;
- gx_color_index current_color;
- int linecap;
- /* for Font Downloading */
-#define max_cached_chars 256 /* 128 * n */
- bool FontDL;
- int current_font;
- int count;
- gx_bitmap_id id_table[max_cached_chars + 1];
- gx_bitmap_id id_cache[max_cached_chars + 1];
-}
-gx_device_lips4v;
-
-gs_public_st_suffix_add0_final(st_device_lips4v, gx_device_lips4v,
- "gx_device_lips4v", device_lips4v_enum_ptrs,
- device_lips4v_reloc_ptrs, gx_device_finalize,
- st_device_vector);
-
-#define lips_device_full_body(dtype, pprocs, dname, stype, w, h, xdpi, ydpi, ncomp, depth, mg, mc, dg, dc, lm, bm, rm, tm)\
- std_device_part1_(dtype, pprocs, dname, stype, open_init_closed),\
- dci_values(ncomp, depth, mg, mc, dg, dc),\
- std_device_part2_(w, h, xdpi, ydpi),\
- offset_margin_values(-lm * xdpi, -tm * ydpi, lm * 72.0, bm * 72.0, rm * 72.0, tm * 72.0),\
- std_device_part3_()
-
-#define lips4v_device_body\
- lips_device_full_body(gx_device_lips4v, 0, "lips4v",\
- &st_device_lips4v,\
- DEFAULT_WIDTH_10THS * X_DPI / 10,\
- DEFAULT_HEIGHT_10THS * Y_DPI / 10,\
- X_DPI, Y_DPI,\
- 1, 8, 1000, 1000, 5, 2,\
- LIPS4_LEFT_MARGIN_DEFAULT,\
- LIPS4_BOTTOM_MARGIN_DEFAULT,\
- LIPS4_RIGHT_MARGIN_DEFAULT,\
- LIPS4_TOP_MARGIN_DEFAULT)
-
-
-#define lips4v_procs\
- { lips4v_open,\
- gx_upright_get_initial_matrix,\
- NULL, /* sync_output */\
- lips4v_output_page,\
- lips4v_close,\
- gx_default_gray_map_rgb_color,\
- gx_default_gray_map_color_rgb,\
- gdev_vector_fill_rectangle,\
- NULL, /* tile_rectangle */\
- lips4v_copy_mono,\
- lips4v_copy_color,\
- NULL, /* draw_line */\
- NULL, /* get_bits */\
- lips4v_get_params,\
- lips4v_put_params,\
- NULL, /* map_cmyk_color */\
- NULL, /* get_xfont_procs */\
- NULL, /* get_xfont_device */\
- NULL, /* map_rgb_alpha_color */\
- gx_page_device_get_page_device,\
- NULL, /* get_alpha_bits */\
- NULL, /* copy_alpha */\
- NULL, /* get_band */\
- NULL, /* copy_rop */\
- gdev_vector_fill_path,\
- gdev_vector_stroke_path,\
- lips4v_fill_mask,\
- gdev_vector_fill_trapezoid,\
- gdev_vector_fill_parallelogram,\
- gdev_vector_fill_triangle,\
- NULL /****** WRONG ******/, /* draw_thin_line */\
- lips4v_begin_image,\
- NULL,\
- NULL,\
- NULL, /* strip_tile_rectangle */\
- NULL/******strip_copy_rop******/\
- }
-
-gx_device_lips4v far_data gs_lips4v_device = {
- lips4v_device_body,
- lips4v_procs,
- vector_initial_values,
- LIPS_CASSETFEED_DEFAULT,
- LIPS_USERNAME_DEFAULT,
- FALSE /* PJL */ ,
- 0 /* toner_density */ ,
- FALSE /* toner_saving */ ,
- 0 /* toner_saving_set */ ,
- 0, 0, 0, 0, -1,
- 0 /* prev_duplex_mode */ ,
- LIPS_NUP_DEFAULT,
- LIPS_FACEUP_DEFAULT,
- LIPS_MEDIATYPE_DEFAULT,
- 0 /* first_page */ ,
- LIPS_MANUALFEED_DEFAULT,
- 0 /* Duplex */ , 0 /* Duplex_set */ , LIPS_TUMBLE_DEFAULT,
- 0 /* OneBitMask */ ,
- 0 /* ncomp */ , -1 /* MaskReverse */ , 0 /* MaskState */ ,
- 0 /* TextMode */ , 0 /* prev_x */ , 0 /* prev_y */ ,
- 0 /* prev_color */ , 0 /* current_color */ ,
- 0 /* linecap */ ,
- 0 /* FontDL */ ,
- -1 /* current_font */ ,
- 0 /* count */ ,
- {0},
- {0}
-};
-
-/* Vector device implementation */
-#if GS_VERSION_MAJOR >= 8
-private int lips4v_beginpage(gx_device_vector * vdev);
-private int lips4v_setfillcolor(gx_device_vector * vdev, const gs_imager_state * pis,
- const gx_drawing_color * pdc);
-private int lips4v_setstrokecolor(gx_device_vector * vdev, const gs_imager_state * pis,
- const gx_drawing_color * pdc);
-private int lips4v_setdash(gx_device_vector * vdev, const float *pattern,
- uint count, floatp offset);
-private int lips4v_setflat(gx_device_vector * vdev, floatp flatness);
-private int
-lips4v_setlogop(gx_device_vector * vdev, gs_logical_operation_t lop,
- gs_logical_operation_t diff);
-private int lips4v_can_handle_hl_color(gx_device_vector * vdev, const gs_imager_state * pis,
- const gx_drawing_color * pdc);
-private int
-
-lips4v_beginpath(gx_device_vector * vdev, gx_path_type_t type);
-private int
-lips4v_moveto(gx_device_vector * vdev, floatp x0, floatp y0, floatp x,
- floatp y, gx_path_type_t type);
-private int
-lips4v_lineto(gx_device_vector * vdev, floatp x0, floatp y0, floatp x,
- floatp y, gx_path_type_t type);
-private int
-lips4v_curveto(gx_device_vector * vdev, floatp x0, floatp y0, floatp x1,
- floatp y1, floatp x2, floatp y2, floatp x3, floatp y3,
- gx_path_type_t type);
-private int
-lips4v_closepath(gx_device_vector * vdev, floatp x, floatp y, floatp x_start,
- floatp y_start, gx_path_type_t type);
-
-private int lips4v_endpath(gx_device_vector * vdev, gx_path_type_t type);
-#else
-private int lips4v_beginpage(P1(gx_device_vector * vdev));
-private int lips4v_setfillcolor(P2(gx_device_vector * vdev,
- const gx_drawing_color * pdc));
-private int lips4v_setstrokecolor(P2(gx_device_vector * vdev,
- const gx_drawing_color * pdc));
-private int lips4v_setdash(P4(gx_device_vector * vdev, const float *pattern,
- uint count, floatp offset));
-private int lips4v_setflat(P2(gx_device_vector * vdev, floatp flatness));
-private int
-lips4v_setlogop(P3
-
- (gx_device_vector * vdev, gs_logical_operation_t lop,
- gs_logical_operation_t diff));
-private int
-
-lips4v_beginpath(P2(gx_device_vector * vdev, gx_path_type_t type));
-private int
-lips4v_moveto(P6
- (gx_device_vector * vdev, floatp x0, floatp y0, floatp x,
- floatp y, gx_path_type_t type));
-private int
-lips4v_lineto(P6
- (gx_device_vector * vdev, floatp x0, floatp y0, floatp x,
- floatp y, gx_path_type_t type));
-private int
-lips4v_curveto(P10
- (gx_device_vector * vdev, floatp x0, floatp y0, floatp x1,
- floatp y1, floatp x2, floatp y2, floatp x3, floatp y3,
- gx_path_type_t type));
-private int
-lips4v_closepath(P6
- (gx_device_vector * vdev, floatp x, floatp y, floatp x_start,
- floatp y_start, gx_path_type_t type));
-
-private int lips4v_endpath(P2(gx_device_vector * vdev, gx_path_type_t type));
-#endif
-private int lips4v_setlinewidth(gx_device_vector * vdev, floatp width);
-private int lips4v_setlinecap(gx_device_vector * vdev, gs_line_cap cap);
-private int lips4v_setlinejoin(gx_device_vector * vdev, gs_line_join join);
-private int lips4v_setmiterlimit(gx_device_vector * vdev, floatp limit);
-private const gx_device_vector_procs lips4v_vector_procs = {
- /* Page management */
- lips4v_beginpage,
- /* Imager state */
- lips4v_setlinewidth,
- lips4v_setlinecap,
- lips4v_setlinejoin,
- lips4v_setmiterlimit,
- lips4v_setdash,
- lips4v_setflat,
- lips4v_setlogop,
- /* Other state */
-#if GS_VERSION_MAJOR >= 8
- lips4v_can_handle_hl_color, /* can_handle_hl_color (dummy) */
-#endif
- lips4v_setfillcolor, /* fill & stroke colors are the same */
- lips4v_setstrokecolor,
- /* Paths */
- gdev_vector_dopath,
- gdev_vector_dorect,
- lips4v_beginpath,
- lips4v_moveto,
- lips4v_lineto,
- lips4v_curveto,
- lips4v_closepath,
- lips4v_endpath
-};
-
-/* ---------------- File header ---------------- */
-
-private const char *l4v_file_header1 =
-
- "\033%-12345X@PJL CJLMODE\n@PJL JOB\n\033%-12345X@PJL CJLMODE\n";
-private const char *l4v_file_header2 = "@PJL SET LPARM : LIPS SW2 = ON\n";
-private const char *l4v_file_header3 = "@PJL ENTER LANGUAGE = LIPS\n";
-private const char *l4v_file_header4 = "\033%@\033P41;";
-
-
-private const char *l4vmono_file_header =
-
- ";1J" L4VMONO_STRING LIPS_VERSION "\033\\\033[0\"p\033<";
-
-private const char *l4vcolor_file_header =
-
- ";1J" L4VCOLOR_STRING LIPS_VERSION "\033\\\033[1\"p\033<";
-
-/* ---------------- Utilities ---------------- */
-
-private void
-lips_param(int param, char *c)
-{
- int i, j;
- bool bSign;
-
- bSign = TRUE;
- if (param < 0) {
- bSign = FALSE;
- param = -param;
- }
- if (param < 16)
- i = 1;
- else if (param < 1024)
- i = 2;
- else if (param < 65536)
- i = 3;
- else
- i = 4;
-
- c[i] = '\0';
- c[i - 1] = (param & 0x0f) | 0x20 | (bSign ? 0x10 : 0x00);
- param >>= 4;
- for (j = i - 2; j >= 0; j--) {
- c[j] = (param & 0x3f) | 0x40;
- param >>= 6;
- }
-}
-
-private void
-sput_lips_int(stream * s, int param)
-{
- int i;
- char c[5];
-
- lips_param(param, c);
- for (i = 0; i < strlen(c); i++)
- sputc(s, c[i]);
-}
-
-/* Put a string on a stream.
- This function is copy of `pputs' in gdevpstr.c */
-private int
-lputs(stream * s, const char *str)
-{
- uint len = strlen(str);
- uint used;
- int status = sputs(s, (const byte *)str, len, &used);
-
- return (status >= 0 && used == len ? 0 : EOF);
-}
-
-/* Write a string on a stream. */
-private void
-put_bytes(stream * s, const byte * data, uint count)
-{
- uint used;
-
- sputs(s, data, count, &used);
-}
-
-/* for Font Downloading */
-private void
-put_int(stream * s, uint number)
-{
- sputc(s, number >> 8);
- sputc(s, number & 0xff);
-}
-
-private int
-lips4v_range_check(gx_device * dev)
-{
- int width = dev->MediaSize[0];
- int height = dev->MediaSize[1];
- int xdpi = dev->x_pixels_per_inch;
- int ydpi = dev->y_pixels_per_inch;
-
- /* Paper Size Check */
- if (width <= height) { /* portrait */
- if ((width < LIPS_WIDTH_MIN || width > LIPS_WIDTH_MAX ||
- height < LIPS_HEIGHT_MIN || height > LIPS_HEIGHT_MAX) &&
- !(width == LIPS_LEDGER_WIDTH && height == LIPS_LEDGER_HEIGHT))
- return_error(gs_error_rangecheck);
- } else { /* landscape */
- if ((width < LIPS_HEIGHT_MIN || width > LIPS_HEIGHT_MAX ||
- height < LIPS_WIDTH_MIN || height > LIPS_WIDTH_MAX) &&
- !(width == LIPS_LEDGER_HEIGHT && height == LIPS_LEDGER_WIDTH))
- return_error(gs_error_rangecheck);
- }
-
- /* Resolution Check */
- if (xdpi != ydpi)
- return_error(gs_error_rangecheck);
- else {
- if ((xdpi < LIPS_DPI_MIN || xdpi > LIPS4_DPI_MAX)
- && xdpi != LIPS4_DPI_SUPERFINE) return_error(gs_error_rangecheck);
- }
-
- return 0;
-}
-
-
-private void
-lips4v_set_cap(gx_device * dev, int x, int y)
-{
-
- char cap[15];
- stream *s = gdev_vector_stream((gx_device_vector *) dev);
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
- int dx = x - pdev->prev_x;
- int dy = y - pdev->prev_y;
-
-
- if (dx > 0) {
- sprintf(cap, "%c%da", LIPS_CSI, dx);
- lputs(s, cap);
- } else if (dx < 0) {
- sprintf(cap, "%c%dj", LIPS_CSI, -dx);
- lputs(s, cap);
- }
- if (dy > 0) {
- sprintf(cap, "%c%dk", LIPS_CSI, dy);
- lputs(s, cap);
- } else if (dy < 0) {
- sprintf(cap, "%c%de", LIPS_CSI, -dy);
- lputs(s, cap);
- }
- pdev->prev_x = x;
- pdev->prev_y = y;
-}
-
-#define POINT 18
-
-/* Font Downloading Routine */
-private int
-lips4v_copy_text_char(gx_device * dev, const byte * data,
- int raster, gx_bitmap_id id, int x, int y, int w, int h)
-{
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
- stream *s = gdev_vector_stream((gx_device_vector *) dev);
- uint width_bytes = (w + 7) >> 3;
- uint size = width_bytes * h;
- int i, j;
- uint ccode;
- char cset_sub[9], cset[64], cset_number[8], text_color[15];
- int cell_length = (POINT * (int)dev->x_pixels_per_inch) / 72;
- bool download = TRUE;
-
- if (w > cell_length || h > cell_length || !pdev->FontDL)
- return -1;
-
- for (j = pdev->count - 1; j >= 0; j--) {
- if (pdev->id_table[j] == id)
- /* font is found */
- {
- download = FALSE;
- ccode = j;
- for (i = j; i < pdev->count - 1; i++) {
- pdev->id_cache[i] = pdev->id_cache[i + 1];
- }
- pdev->id_cache[pdev->count - 1] = id;
- break;
- }
- }
-
- if (download) {
- if (pdev->count > max_cached_chars - 1) {
- gx_bitmap_id tmpid = pdev->id_cache[0];
-
- for (j = pdev->count - 1; j >= 0; j--) {
- if (pdev->id_table[j] == tmpid) {
- ccode = j;
- break;
- }
- }
- for (i = j; i < pdev->count - 1; i++) {
- pdev->id_cache[i] = pdev->id_cache[i + 1];
- }
- pdev->id_cache[pdev->count - 1] = tmpid;
- } else {
- ccode = pdev->count;
- pdev->id_cache[pdev->count] = id;
- }
- }
- if (pdev->TextMode == FALSE) {
- /* Text mode */
- lputs(s, "}p");
- sput_lips_int(s, x);
- sput_lips_int(s, y);
- sputc(s, LIPS_IS2);
- pdev->TextMode = TRUE;
- pdev->prev_x = x;
- pdev->prev_y = y;
- } else
- lips4v_set_cap(dev, x, y);
-
- if (download) {
- if (ccode % 128 == 0 && ccode == pdev->count) {
- /* ʸ»ú¥»¥Ã¥ÈÅÐÏ¿Êä½õÌ¿Îá */
- sprintf(cset_sub, "%c%dx%c", LIPS_DCS, ccode / 128, LIPS_ST);
- lputs(s, cset_sub);
- /* ʸ»ú¥»¥Ã¥ÈÅÐÏ¿Ì¿Îá */
- sprintf(cset,
- "%c%d;1;0;0;3840;8;400;100;0;0;200;%d;%d;0;0;;;;;%d.p",
- LIPS_CSI,
- size + 9, cell_length, /* Cell Width */
- cell_length, /* Cell Height */
- (int)dev->x_pixels_per_inch);
- lputs(s, cset);
- } else {
- /* 1ʸ»úÅÐÏ¿Ì¿Îá */
- sprintf(cset,
- "%c%d;%d;8;%d.q", LIPS_CSI,
- size + 9, ccode / 128, (int)dev->x_pixels_per_inch);
- lputs(s, cset);
- }
-
- /* ¥æ¡¼¥¶Ê¸»úÅÐÏ¿¥Ç¡¼¥¿ ¤Î¥Ø¥Ã¥À */
- sputc(s, ccode % 128); /* charcter code */
- put_int(s, w);
- put_int(s, 0);
- put_int(s, h);
- put_int(s, 0);
- for (i = h - 1; i >= 0; --i) {
- put_bytes(s, data + i * raster, width_bytes);
- }
- }
- /* ʸ»ú¥»¥Ã¥È¡¦¥¢¥µ¥¤¥óÈÖ¹æÁªÂòÌ¿Îá2 */
- if (download) {
- if (pdev->current_font != ccode / 128) {
- sprintf(cset_number, "%c%d%%v", LIPS_CSI, ccode / 128);
- lputs(s, cset_number);
- pdev->current_font = ccode / 128;
- }
- } else {
- if (pdev->current_font != ccode / 128) {
- sprintf(cset_number, "%c%d%%v", LIPS_CSI, ccode / 128);
- lputs(s, cset_number);
- pdev->current_font = ccode / 128;
- }
- }
-
- /* ¥«¥é¡¼ */
- if (pdev->current_color != pdev->prev_color) {
- if (pdev->color_info.depth == 8) {
- sputc(s, LIPS_CSI);
- lputs(s, "?10;2;");
- sprintf(text_color, "%d",
- (int)(pdev->color_info.max_gray - pdev->current_color));
- } else {
- int r = (pdev->current_color >> 16) * 1000.0 / 255.0;
- int g = ((pdev->current_color >> 8) & 0xff) * 1000.0 / 255.0;
- int b = (pdev->current_color & 0xff) * 1000.0 / 255.0;
-
- sputc(s, LIPS_CSI);
- lputs(s, "?10;;");
- sprintf(text_color, "%d;%d;%d", r, g, b);
- }
- lputs(s, text_color);
- lputs(s, "%p");
- pdev->prev_color = pdev->current_color;
- }
- /* À©¸æʸ»ú°õ»úÌ¿Îá */
- if (ccode % 128 == 0x00 ||
- (ccode % 128 >= 0x07 && ccode % 128 <= 0x0F) ||
- ccode % 128 == 0x1B) {
- sputc(s, LIPS_CSI);
- lputs(s, "1.v");
- }
- sputc(s, ccode % 128);
-
- if (download) {
- pdev->id_table[ccode] = id;
- if (pdev->count < max_cached_chars - 1)
- pdev->count++;
- }
- return 0;
-}
-
-private void
-reverse_buffer(byte * buf, int Len)
-{
- int i;
-
- for (i = 0; i < Len; i++)
- *(buf + i) = ~*(buf + i);
-}
-
-private void
-lips4v_write_image_data(gx_device_vector * vdev, byte * buf, int tbyte,
- int reverse)
-{
- stream *s = gdev_vector_stream(vdev);
- byte *cbuf = gs_alloc_bytes(vdev->memory, tbyte * 3 / 2,
- "lips4v_write_image_data(cbuf)");
- byte *cbuf_rle = gs_alloc_bytes(vdev->memory, tbyte * 3,
- "lips4v_write_image_data(cbuf_rle)");
- int Len, Len_rle;
-
- if (reverse)
- reverse_buffer(buf, tbyte);
-
-
- Len = lips_packbits_encode(buf, cbuf, tbyte);
- Len_rle = lips_rle_encode(buf, cbuf_rle, tbyte);
-
- if (Len > tbyte && Len_rle > tbyte) {
- /* Not compress */
- lputs(s, "0");
- sput_lips_int(s, tbyte);
- sputc(s, LIPS_IS2);
-
- put_bytes(s, buf, tbyte);
- } else if (Len > Len_rle) {
- /* Use RunLength encode */
- lputs(s, ":");
- sput_lips_int(s, Len_rle);
- sputc(s, LIPS_IS2);
-
- put_bytes(s, cbuf_rle, Len_rle);
- } else {
- /* Use PackBits encode */
- lputs(s, ";");
- sput_lips_int(s, Len);
- sputc(s, LIPS_IS2);
-
- put_bytes(s, cbuf, Len);
- }
-
- gs_free_object(vdev->memory, cbuf, "lips4v_write_image_data(cbuf)");
- gs_free_object(vdev->memory, cbuf_rle,
- "lips4v_write_image_data(cbuf_rle)");
-}
-
-
-/* ---------------- Vector device implementation ---------------- */
-
-private int
-lips4v_beginpage(gx_device_vector * vdev)
-{ /*
- * We can't use gdev_vector_stream here, because this may be called
- * from there before in_page is set.
- */
- gx_device_lips4v *const pdev = (gx_device_lips4v *) vdev;
- stream *s = vdev->strm;
- int dpi = vdev->x_pixels_per_inch;
- int width = pdev->MediaSize[0];
- int height = pdev->MediaSize[1];
- int paper_size, x0, y0;
- char dpi_char[6], unit[14];
- char page_header[8], l4vmono_page_header[7], l4vcolor_page_header[7];
- char duplex_char[6], tumble_char[6], toner_d[26], toner_s[5],
-
- nup_char[10];
- char username[6 + LIPS_USERNAME_MAX], feedmode[5], paper[16],
-
- faceup_char[256];
- bool dup = pdev->Duplex;
- int dupset = pdev->Duplex_set;
- bool tum = pdev->Tumble;
-
- /* ¥Ù¥¯¥¿¡¦¥â¡¼¥É°Ü¹ÔÌ¿Îá CSI &} ¤ÏÊǤ´¤È¤Ëȯ¹Ô¤¹¤ë */
-
- if (pdev->first_page) {
- if (pdev->pjl) {
- lputs(s, l4v_file_header1);
- if ((int)pdev->x_pixels_per_inch == 1200)
- lputs(s, "@PJL SET RESOLUTION = SUPERFINE\n");
- else if ((int)pdev->x_pixels_per_inch == 600)
- lputs(s, "@PJL SET RESOLUTION = FINE\n");
- else if ((int)pdev->x_pixels_per_inch == 300)
- lputs(s, "@PJL SET RESOLUTION = QUICK\n");
- lputs(s, l4v_file_header2);
- if (pdev->toner_density) {
- sprintf(toner_d, "@PJL SET TONER-DENSITY=%d\n",
- pdev->toner_density);
- lputs(s, toner_d);
- }
- if (pdev->toner_saving_set) {
- lputs(s, "@PJL SET TONER-SAVING=");
- if (pdev->toner_saving)
- sprintf(toner_s, "ON\n");
- else
- sprintf(toner_s, "OFF\n");
- lputs(s, toner_s);
- }
- lputs(s, l4v_file_header3);
- }
- lputs(s, l4v_file_header4);
-
- if (dpi > 9999)
- return_error(gs_error_rangecheck);
-
- /* set reaolution (dpi) */
- sprintf(dpi_char, "%d", dpi);
- lputs(s, dpi_char);
-
- if (pdev->color_info.depth == 8)
- lputs(s, l4vmono_file_header);
- else
- lputs(s, l4vcolor_file_header);
-
- /* username */
- sprintf(username, "%c2y%s%c", LIPS_DCS, pdev->Username, LIPS_ST);
- lputs(s, username);
- }
- if (strcmp(pdev->mediaType, "PlainPaper") == 0) {
- sputc(s, LIPS_CSI);
- lputs(s, "20\'t");
- }
- else if (strcmp(pdev->mediaType, "OHP") == 0 ||
- strcmp(pdev->mediaType, "TransparencyFilm") == 0) {
- sputc(s, LIPS_CSI);
- lputs(s, "40\'t"); /* OHP mode (for LBP-2160) */
- }
- else if (strcmp(pdev->mediaType, "CardBoard") == 0) {
- sputc(s, LIPS_CSI);
- lputs(s, "30\'t"); /* CardBoard mode (for LBP-2160) */
- }
- else if (strcmp(pdev->mediaType, "GlossyFilm") == 0) {
- sputc(s, LIPS_CSI);
- lputs(s, "41\'t"); /* GlossyFilm mode (for LBP-2160) */
- }
-
- /* µë»æ¥â¡¼¥É */
- if (pdev->ManualFeed ||
- (strcmp(pdev->mediaType, "PlainPaper") != 0
- && strcmp(pdev->mediaType, LIPS_MEDIATYPE_DEFAULT) != 0)) {
- /* Use ManualFeed */
- if (pdev->prev_feed_mode != 10) {
- sprintf(feedmode, "%c10q", LIPS_CSI);
- lputs(s, feedmode);
- pdev->prev_feed_mode = 10;
- }
- } else {
- if (pdev->prev_feed_mode != pdev->cassetFeed) {
- sprintf(feedmode, "%c%dq", LIPS_CSI, pdev->cassetFeed);
- lputs(s, feedmode);
- pdev->prev_feed_mode = pdev->cassetFeed;
- }
- }
-
- paper_size = lips_media_selection(width, height);
-
- /* Íѻ極¥¤¥º */
- if (pdev->prev_paper_size != paper_size) {
- if (paper_size == USER_SIZE) {
- /* modified by shige 06/27 2003
- sprintf(paper, "%c80;%d;%dp", LIPS_CSI, width * 10, height * 10); */
- /* modified by shige 11/09 2003
- sprintf(paper, "%c80;%d;%dp", LIPS_CSI, height * 10, width * 10); */
- sprintf(paper, "%c80;%d;%dp", LIPS_CSI,
- (height * 10 > LIPS_HEIGHT_MAX_720)?
- LIPS_HEIGHT_MAX_720 : (height * 10),
- (width * 10 > LIPS_WIDTH_MAX_720)?
- LIPS_WIDTH_MAX_720 : (width * 10));
- lputs(s, paper);
- } else if (paper_size == USER_SIZE + LANDSCAPE) {
- /* modified by shige 06/27 2003
- sprintf(paper, "%c81;%d;%dp", LIPS_CSI, height * 10, width * 10); */
- /* modified by shige 11/09 2003
- sprintf(paper, "%c81;%d;%dp", LIPS_CSI, width * 10, height * 10); */
- sprintf(paper, "%c80;%d;%dp", LIPS_CSI,
- (width * 10 > LIPS_HEIGHT_MAX_720)?
- LIPS_HEIGHT_MAX_720 : (width * 10),
- (height * 10 > LIPS_WIDTH_MAX_720)?
- LIPS_WIDTH_MAX_720 : (height * 10));
- lputs(s, paper);
- } else {
- sprintf(paper, "%c%dp", LIPS_CSI, paper_size);
- lputs(s, paper);
- }
- } else if (paper_size == USER_SIZE) {
- if (pdev->prev_paper_width != width ||
- pdev->prev_paper_height != height)
- /* modified by shige 06/27 2003
- sprintf(paper, "%c80;%d;%dp", LIPS_CSI, width * 10, height * 10); */
- /* modified by shige 11/09 2003
- sprintf(paper, "%c80;%d;%dp", LIPS_CSI, height * 10, width * 10); */
- sprintf(paper, "%c80;%d;%dp", LIPS_CSI,
- (height * 10 > LIPS_HEIGHT_MAX_720)?
- LIPS_HEIGHT_MAX_720 : (height * 10),
- (width * 10 > LIPS_WIDTH_MAX_720)?
- LIPS_WIDTH_MAX_720 : (width * 10));
- lputs(s, paper);
- } else if (paper_size == USER_SIZE + LANDSCAPE) {
- if (pdev->prev_paper_width != width ||
- pdev->prev_paper_height != height)
- /* modified by shige 06/27 2003
- sprintf(paper, "%c81;%d;%dp", LIPS_CSI, height * 10, width * 10); */
- /* modified by shige 11/09 2003
- sprintf(paper, "%c81;%d;%dp", LIPS_CSI, width * 10, height * 10); */
- sprintf(paper, "%c80;%d;%dp", LIPS_CSI,
- (width * 10 > LIPS_HEIGHT_MAX_720)?
- LIPS_HEIGHT_MAX_720 : (width * 10),
- (height * 10 > LIPS_WIDTH_MAX_720)?
- LIPS_WIDTH_MAX_720 : (height * 10));
- lputs(s, paper);
- }
- pdev->prev_paper_size = paper_size;
- pdev->prev_paper_width = width;
- pdev->prev_paper_height = height;
-
- if (pdev->faceup) {
- sprintf(faceup_char, "%c11;12;12~", LIPS_CSI);
- lputs(s, faceup_char);
- }
- /* N-up Printing Setting */
- if (pdev->first_page) {
- if (pdev->nup != 1) {
- sprintf(nup_char, "%c%d1;;%do", LIPS_CSI, pdev->nup, paper_size);
- lputs(s, nup_char);
- }
- }
- /* Duplex Setting */
- if (dupset && dup) {
- if (pdev->prev_duplex_mode == 0 || pdev->prev_duplex_mode == 1) {
- sprintf(duplex_char, "%c2;#x", LIPS_CSI); /* duplex */
- lputs(s, duplex_char);
- if (!tum) {
- /* long edge binding */
- if (pdev->prev_duplex_mode != 2) {
- sprintf(tumble_char, "%c0;#w", LIPS_CSI);
- lputs(s, tumble_char);
- }
- pdev->prev_duplex_mode = 2;
- } else {
- /* short edge binding */
- if (pdev->prev_duplex_mode != 3) {
- sprintf(tumble_char, "%c2;#w", LIPS_CSI);
- lputs(s, tumble_char);
- }
- pdev->prev_duplex_mode = 3;
- }
- }
- } else if (dupset && !dup) {
- if (pdev->prev_duplex_mode != 1) {
- sprintf(duplex_char, "%c0;#x", LIPS_CSI); /* simplex */
- lputs(s, duplex_char);
- }
- pdev->prev_duplex_mode = 1;
- }
- sputc(s, LIPS_CSI);
- lputs(s, "?1;4;5;6;14l");
- sputc(s, LIPS_CSI);
- lputs(s, "?2;3;h");
-
- /* size unit (dpi) */
- sputc(s, LIPS_CSI);
- lputs(s, "11h");
- sprintf(unit, "%c?7;%d I", LIPS_CSI, (int)pdev->x_pixels_per_inch);
- lputs(s, unit);
- sprintf(page_header, "%c[0&}#%c", LIPS_ESC, LIPS_IS2);
- lputs(s, page_header); /* vector mode */
-
- lputs(s, "!0"); /* size unit (dpi) */
- sput_lips_int(s, dpi);
- lputs(s, "1");
- sputc(s, LIPS_IS2);
-
- if (pdev->color_info.depth == 8) {
- sprintf(l4vmono_page_header, "!13%c$%c", LIPS_IS2, LIPS_IS2);
- lputs(s, l4vmono_page_header);
- } else {
- sprintf(l4vcolor_page_header, "!11%c$%c", LIPS_IS2, LIPS_IS2);
- lputs(s, l4vcolor_page_header);
- }
-
- lputs(s, "(00");
- sput_lips_int(s,
- ((width - dev_l_margin(vdev) - dev_r_margin(vdev)) * dpi) /
- 72);
- sput_lips_int(s,
- ((height - dev_b_margin(vdev) - dev_t_margin(vdev)) * dpi) /
- 72);
- sputc(s, LIPS_IS2);
-
- /* ¸¶ÅÀ°ÜÆ°Ì¿Îá */
- x0 = (dev_l_margin(vdev) - 5. / MMETER_PER_INCH) * dpi;
- y0 = (dev_b_margin(vdev) - 5. / MMETER_PER_INCH) * dpi;
-
- if (x0 != 0 && y0 != 0) {
- lputs(s, "}\"");
- sput_lips_int(s, x0);
- sput_lips_int(s, y0);
- sputc(s, LIPS_IS2);
- }
- lputs(s, "I00");
- sputc(s, LIPS_IS2);
- lputs(s, "}F2");
- sputc(s, LIPS_IS2);
- lputs(s, "}H1");
- sputc(s, LIPS_IS2);
- lputs(s, "*0");
- sputc(s, LIPS_IS2);
-
- pdev->MaskState = 1; /* ½é´ü²½: Æ©²á */
- pdev->linecap = 0;
- lputs(s, "}M");
- sput_lips_int(s, 3277); /* 11 degree : 16383 * 2 / 10 */
- sputc(s, LIPS_IS2);
- lputs(s, "}I1"); /* non-zero winding rule is default */
- sputc(s, LIPS_IS2);
-
- return 0;
-}
-
-
-private int
-lips4v_setlinewidth(gx_device_vector * vdev, floatp width)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_lips4v *const pdev = (gx_device_lips4v *) vdev;
-
-
-#if 0
- /* Scale ¤ò³Ý¤±¤Æ¤¤¤ë¤Î¤Ï, Ghostscript 5.10/5.50 ¤Î¥Ð¥°¤Î¤¿¤á */
- floatp xscale, yscale;
-
- xscale = fabs(igs->ctm.xx);
- yscale = fabs(igs->ctm.xy);
-
- if (xscale == 0 || yscale > xscale) /* if portrait */
- width = ceil(width * yscale);
- else
- width = ceil(width * xscale);
-#endif
-
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
- if (width < 1)
- width = 1;
-
- lputs(s, "F1");
- sput_lips_int(s, width);
- sputc(s, LIPS_IS2);
-
- return 0;
-}
-
-private int
-lips4v_setlinecap(gx_device_vector * vdev, gs_line_cap cap)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_lips4v *const pdev = (gx_device_lips4v *) vdev;
- char c[6];
- int line_cap = 0;
-
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
- switch (cap) {
- case 0:
- case 3:
- line_cap = 0; /* butt */
- break;
- case 1:
- line_cap = 1; /* round */
- break;
- case 2:
- line_cap = 2; /* square */
- break;
- }
- /* Àþü·Á¾õ»ØÄêÌ¿Îá */
- sprintf(c, "}E%d%c", line_cap, LIPS_IS2);
- lputs(s, c);
-
- pdev->linecap = cap;
-
- return 0;
-}
-
-private int
-lips4v_setlinejoin(gx_device_vector * vdev, gs_line_join join)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_lips4v *const pdev = (gx_device_lips4v *) vdev;
-
-/* ÀþÀܳ»ØÄêÌ¿Îá */
- char c[5];
- int lips_join = 0;
-
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
-
- switch (join) {
- case 0:
- lips_join = 2; /* miter */
- break;
- case 1:
- lips_join = 1; /* round */
- break;
- case 2:
- lips_join = 3; /* bevel */
- break;
- case 3:
- case 4:
- lips_join = 0; /* none */
- break;
- }
-
- sprintf(c, "}F%d%c", lips_join, LIPS_IS2);
- lputs(s, c);
-
- return 0;
-}
-
-private int
-lips4v_setmiterlimit(gx_device_vector * vdev, floatp limit)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_lips4v *const pdev = (gx_device_lips4v *) vdev;
- floatp lips_miterlimit;
-
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
- lips_miterlimit = (16383.0 * 2.0) / limit;
-
- lputs(s, "}M");
- sput_lips_int(s, lips_miterlimit);
- sputc(s, LIPS_IS2);
-
- return 0;
-}
-
-#if GS_VERSION_MAJOR >= 8
-private int
-lips4v_setfillcolor(gx_device_vector * vdev, const gs_imager_state * pis, const gx_drawing_color * pdc)
-#else
-private int
-lips4v_setfillcolor(gx_device_vector * vdev, const gx_drawing_color * pdc)
-#endif
-{
-
- if (!gx_dc_is_pure(pdc))
- return_error(gs_error_rangecheck);
- {
- stream *s = gdev_vector_stream(vdev);
- gx_device_lips4v *const pdev = (gx_device_lips4v *) vdev;
- gx_color_index color = gx_dc_pure_color(pdc);
- int drawing_color;
- float r, g, b;
-
- if (vdev->color_info.depth == 8) {
- drawing_color = vdev->color_info.max_gray - color;
- } else {
- r = (color >> 16) * 1000.0 / 255.0;
- g = ((color >> 8) & 0xff) * 1000.0 / 255.0;
- b = (color & 0xff) * 1000.0 / 255.0;
- }
-
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
- pdev->current_color = color;
-
- if (color == gx_no_color_index) {
- lputs(s, "I0");
- sputc(s, LIPS_IS2);
- } else {
- lputs(s, "I1");
- sputc(s, LIPS_IS2);
- }
-
- /* Åɤê¤Ä¤Ö¤·¥«¥é¡¼»ØÄêÌ¿Îá */
- /* J {color} IS2 */
- lputs(s, "J");
- if (vdev->color_info.depth == 8) {
- sput_lips_int(s, drawing_color);
- } else {
- sput_lips_int(s, r);
- sput_lips_int(s, g);
- sput_lips_int(s, b);
- }
- sputc(s, LIPS_IS2);
-
- /* ñ¿§¥¤¥á¡¼¥¸¡¦¥«¥é¡¼»ØÄêÌ¿Îá */
- /* }T {color} IS2 */
- lputs(s, "}T");
- if (vdev->color_info.depth == 8) {
- sput_lips_int(s, drawing_color);
- } else {
- sput_lips_int(s, r);
- sput_lips_int(s, g);
- sput_lips_int(s, b);
- }
- sputc(s, LIPS_IS2);
- }
- return 0;
-}
-
-#if GS_VERSION_MAJOR >= 8
-private int
-lips4v_setstrokecolor(gx_device_vector * vdev, const gs_imager_state * pis, const gx_drawing_color * pdc)
-#else
-private int
-lips4v_setstrokecolor(gx_device_vector * vdev, const gx_drawing_color * pdc)
-#endif
-{
- if (!gx_dc_is_pure(pdc))
- return_error(gs_error_rangecheck);
- {
- stream *s = gdev_vector_stream(vdev);
- gx_device_lips4v *const pdev = (gx_device_lips4v *) vdev;
- gx_color_index color = gx_dc_pure_color(pdc);
- float r, g, b;
-
- if (vdev->color_info.depth == 24) {
- r = (color >> 16) * 1000 / 255.0;
- g = ((color >> 8) & 0xff) * 1000 / 255.0;
- b = (color & 0xff) * 1000 / 255.0;
- }
-
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
- /* ¥é¥¤¥ó¥«¥é¡¼»ØÄêÌ¿Îá */
- /* G {color} IS2 */
- lputs(s, "G");
- if (vdev->color_info.depth == 8) {
- sput_lips_int(s, vdev->color_info.max_gray - color);
- } else {
- sput_lips_int(s, r);
- sput_lips_int(s, g);
- sput_lips_int(s, b);
- }
- sputc(s, LIPS_IS2);
- }
- return 0;
-}
-
-/* Àþ¼ï»ØÄêÌ¿Îá */
-private int
-lips4v_setdash(gx_device_vector * vdev, const float *pattern, uint count,
- floatp offset)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_lips4v *const pdev = (gx_device_lips4v *) vdev;
- int i;
- float scale, xscale, yscale;
-
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
-#if 0
- /* Scale ¤ò³Ý¤±¤Æ¤¤¤ë¤Î¤Ï, Ghostscript 5.10/5.50 ¤Î¥Ð¥°¤Î¤¿¤á */
- xscale = fabs(igs->ctm.xx);
- yscale = fabs(igs->ctm.xy);
-
- if (xscale == 0) /* if portrait */
- scale = yscale;
- else
- scale = xscale;
-#endif
-
- if (count == 0) {
- lputs(s, "E10");
- sputc(s, LIPS_IS2);
- } else {
- lputs(s, "}d");
- sputc(s, 0x2c);
- lputs(s, "1");
-#if 0
- sput_lips_int(s, offset * scale / vdev->x_pixels_per_inch + 0.5);
-#else
- sput_lips_int(s, offset);
-#endif
- for (i = 0; i < count; ++i) {
- if (pdev->linecap == 1 && count == 2 && pattern[0] == 0) {
- if (i == 0) {
- sput_lips_int(s, 1);
- } else {
-#if 0
- sput_lips_int(s,
- pattern[i] * scale /
- vdev->x_pixels_per_inch - 0.5);
-#else
- sput_lips_int(s, pattern[i] - 1);
-#endif
- }
- } else {
-#if 0
- sput_lips_int(s,
- pattern[i] * scale / vdev->x_pixels_per_inch +
- 0.5);
-#else
- sput_lips_int(s, pattern[i]);
-#endif
- }
- }
- sputc(s, LIPS_IS2);
- lputs(s, "E1");
- sputc(s, 0x2c);
- lputs(s, "0");
- sputc(s, LIPS_IS2);
- }
-
- return 0;
-}
-
-/* ¥Ñ¥¹Ê¿³êÅÙ»ØÄê */
-private int
-lips4v_setflat(gx_device_vector * vdev, floatp flatness)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_lips4v *const pdev = (gx_device_lips4v *) vdev;
-
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
- lputs(s, "Pf");
- sput_lips_int(s, flatness);
- sputc(s, LIPS_IS2);
-
- return 0;
-}
-
-private int
-lips4v_setlogop(gx_device_vector * vdev, gs_logical_operation_t lop,
- gs_logical_operation_t diff)
-{
-/****** SHOULD AT LEAST DETECT SET-0 & SET-1 ******/
- return 0;
-}
-
-#if GS_VERSION_MAJOR >= 8
-/*--- added for Ghostscritp 8.15 ---*/
-private int
-lips4v_can_handle_hl_color(gx_device_vector * vdev, const gs_imager_state * pis1,
- const gx_drawing_color * pdc)
-{
- return false; /* High level color is not implemented yet. */
-}
-#endif
-
-private int
-lips4v_beginpath(gx_device_vector * vdev, gx_path_type_t type)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_lips4v *const pdev = (gx_device_lips4v *) vdev;
-
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
- /* ¥Ñ¥¹¹½ÃÛ³«»ÏÌ¿Îá */
- if (type & gx_path_type_clip) {
- lputs(s, "P(10");
- sputc(s, LIPS_IS2);
- } else
- lputs(s, "P(00");
- sputc(s, LIPS_IS2);
-
- return 0;
-}
-
-private int
-lips4v_moveto(gx_device_vector * vdev, floatp x0, floatp y0, floatp x,
- floatp y, gx_path_type_t type)
-{
- stream *s = gdev_vector_stream(vdev);
-
- /* ¥µ¥Ö¥Ñ¥¹³«»ÏÌ¿Îá p1 */
- lputs(s, "p10");
- sput_lips_int(s, x);
- sput_lips_int(s, y);
- sputc(s, LIPS_IS2);
-
- return 0;
-}
-
-private int
-lips4v_lineto(gx_device_vector * vdev, floatp x0, floatp y0, floatp x,
- floatp y, gx_path_type_t type)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_lips4v *const pdev = (gx_device_lips4v *) vdev;
-
- /* if round cap */
- if (pdev->linecap == 1) {
- if ((x0 == x) && (y0 == y))
- x += 1;
- }
-
- /* ¥Ñ¥¹¡¦¥Ý¥ê¥é¥¤¥óÌ¿Îá */
- lputs(s, "p402");
- sput_lips_int(s, x);
- sput_lips_int(s, y);
- sputc(s, LIPS_IS2);
-
- return 0;
-}
-
-private int
-lips4v_curveto(gx_device_vector * vdev, floatp x0, floatp y0,
- floatp x1, floatp y1, floatp x2, floatp y2, floatp x3,
- floatp y3, gx_path_type_t type)
-{
- stream *s = gdev_vector_stream(vdev);
-
- /* ¥Ñ¥¹¡¦¥Ý¥ê¥é¥¤¥óÌ¿Îá */
- lputs(s, "p404");
- sput_lips_int(s, x1);
- sput_lips_int(s, y1);
- sput_lips_int(s, x2);
- sput_lips_int(s, y2);
- sput_lips_int(s, x3);
- sput_lips_int(s, y3);
- sputc(s, LIPS_IS2);
-
- return 0;
-}
-
-private int
-lips4v_closepath(gx_device_vector * vdev, floatp x, floatp y,
- floatp x_start, floatp y_start, gx_path_type_t type)
-{
- stream *s = gdev_vector_stream(vdev);
-
- lputs(s, "p0");
- sputc(s, LIPS_IS2);
- return 0;
-}
-
-private int
-lips4v_endpath(gx_device_vector * vdev, gx_path_type_t type)
-{
- stream *s = gdev_vector_stream(vdev);
-
- lputs(s, "P)");
- sputc(s, LIPS_IS2);
- if (type & gx_path_type_rule) {
- if (type & gx_path_type_winding_number) {
- lputs(s, "}I1");
- sputc(s, LIPS_IS2);
- } else {
- lputs(s, "}I0");
- sputc(s, LIPS_IS2);
- }
- }
- if (type & gx_path_type_fill) {
- if (type & gx_path_type_stroke) {
- lputs(s, "P&00");
- sputc(s, LIPS_IS2);
- } else {
- lputs(s, "PF00");
- sputc(s, LIPS_IS2);
- }
- }
- if (type & gx_path_type_stroke) {
- lputs(s, "PS00");
- sputc(s, LIPS_IS2);
- }
- if (type & gx_path_type_clip) {
- lputs(s, "PC10");
- sputc(s, LIPS_IS2);
- }
- return 0;
-}
-
-/* ---------------- Driver procedures ---------------- */
-
-/* ------ Open/close/page ------ */
-
-/* Open the device. */
-private int
-lips4v_open(gx_device * dev)
-{
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
-
- int code;
-
- code = lips4v_range_check(dev);
- if (code < 0)
- return code;
-
- vdev->v_memory = dev->memory;
-/****** WRONG ******/
- vdev->vec_procs = &lips4v_vector_procs;
-
-#if GS_VERSION_MAJOR >= 8
- code = gdev_vector_open_file_options(vdev, 512,
- (VECTOR_OPEN_FILE_SEQUENTIAL|VECTOR_OPEN_FILE_BBOX));
-#else
- code = gdev_vector_open_file_bbox(vdev, 512, true);
-#endif
- if (code < 0)
- return code;
-
-#if GS_VERSION_MAJOR >= 8
- if (pdev->bbox_device != NULL) {
- if (pdev->bbox_device->memory == NULL)
- pdev->bbox_device->memory = gs_memory_stable(dev->memory);
- }
-#endif
-
- gdev_vector_init(vdev);
- pdev->first_page = true;
-
- return 0;
-}
-
-/* Wrap up ("output") a page. */
-private int
-lips4v_output_page(gx_device * dev, int num_copies, int flush)
-{
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
- stream *s = gdev_vector_stream(vdev);
- char str[6];
-
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
- lputs(s, "%");
- sputc(s, LIPS_IS2);
- lputs(s, "}p");
- sputc(s, LIPS_IS2);
-
- if (num_copies > 255)
- num_copies = 255;
- if (pdev->prev_num_copies != num_copies) {
- sprintf(str, "%c%dv", LIPS_CSI, num_copies);
- lputs(s, str);
- pdev->prev_num_copies = num_copies;
- }
- sputc(s, LIPS_FF);
- sflush(s);
- vdev->in_page = false;
- pdev->first_page = false;
- gdev_vector_reset(vdev);
- return 0;
-}
-
-private int
-lips4v_close(gx_device * dev)
-{
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
- FILE *f = vdev->file;
-
- fprintf(f, "%c0J%c", LIPS_DCS, LIPS_ST);
- if (pdev->pjl) {
- fprintf(f, "%c%%-12345X@PJL SET LPARM : LIPS SW2 = OFF\n", LIPS_ESC);
- fprintf(f,
- "%c%%-12345X%c%%-12345X@PJL EOJ\n"
- "%c%%-12345X", LIPS_ESC, LIPS_ESC, LIPS_ESC);
- }
- gdev_vector_close_file(vdev);
-
- return 0;
-}
-
-/* Close the device. */
-/* Note that if this is being called as a result of finalization, */
-/* the stream may no longer exist; but the file will still be open. */
-
-/* ---------------- Get/put parameters ---------------- */
-
-/* Get parameters. */
-private int
-lips4v_get_params(gx_device * dev, gs_param_list * plist)
-{
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
- int code = gdev_vector_get_params(dev, plist);
- int ncode;
- gs_param_string usern;
- gs_param_string pmedia;
-
- if (code < 0)
- return code;
-
- if ((ncode = param_write_bool(plist, LIPS_OPTION_MANUALFEED,
- &pdev->ManualFeed)) < 0)
- code = ncode;
-
- if ((ncode = param_write_int(plist, LIPS_OPTION_CASSETFEED,
- &pdev->cassetFeed)) < 0)
- code = ncode;
-
- if ((ncode = param_write_bool(plist, LIPS_OPTION_DUPLEX_TUMBLE,
- &pdev->Tumble)) < 0)
- code = ncode;
-
- if ((ncode = param_write_int(plist, LIPS_OPTION_NUP, &pdev->nup)) < 0)
- code = ncode;
-
- if ((ncode = param_write_bool(plist, LIPS_OPTION_PJL, &pdev->pjl)) < 0)
- code = ncode;
-
- if ((ncode = param_write_int(plist, LIPS_OPTION_TONERDENSITY,
- &pdev->toner_density)) < 0)
- code = ncode;
-
- if (pdev->toner_saving_set >= 0 &&
- (code = (pdev->toner_saving_set ?
- param_write_bool(plist, LIPS_OPTION_TONERSAVING,
- &pdev->
- toner_saving) : param_write_null(plist,
- LIPS_OPTION_TONERSAVING)))
- < 0)
- code = ncode;
-
- if (pdev->Duplex_set >= 0 &&
- (ncode = (pdev->Duplex_set ?
- param_write_bool(plist, "Duplex", &pdev->Duplex) :
- param_write_null(plist, "Duplex"))) < 0)
- code = ncode;
-
- if ((ncode = param_write_bool(plist, LIPS_OPTION_FONTDOWNLOAD,
- &pdev->FontDL)) < 0)
- code = ncode;
-
- if ((ncode = param_write_bool(plist, LIPS_OPTION_FACEUP,
- &pdev->faceup)) < 0) code = ncode;
-
- pmedia.data = (const byte *)pdev->mediaType,
- pmedia.size = strlen(pdev->mediaType), pmedia.persistent = false;
-
- if ((ncode = param_write_string(plist, LIPS_OPTION_MEDIATYPE,
- &pmedia)) < 0) code = ncode;
-
- if (code < 0)
- return code;
-
- usern.data = (const byte *)pdev->Username,
- usern.size = strlen(pdev->Username), usern.persistent = false;
-
- return param_write_string(plist, LIPS_OPTION_USER_NAME, &usern);
-}
-
-/* Put parameters. */
-private int
-lips4v_put_params(gx_device * dev, gs_param_list * plist)
-{
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
- int ecode = 0;
- int code;
- gs_param_name param_name;
- gs_param_string pmedia;
- bool mf = pdev->ManualFeed;
- int cass = pdev->cassetFeed;
- gs_param_string usern;
- bool tum = pdev->Tumble;
- int nup = pdev->nup;
- bool pjl = pdev->pjl;
- int toner_density = pdev->toner_density;
- bool toner_saving = pdev->toner_saving;
- bool toner_saving_set = pdev->toner_saving_set;
- bool fontdl = pdev->FontDL;
- bool faceup = pdev->faceup;
- bool duplex;
- int duplex_set = -1;
- int old_bpp = dev->color_info.depth;
- int bpp = 0;
-
- if ((code = param_read_bool(plist,
- (param_name = LIPS_OPTION_MANUALFEED),
- &mf)) < 0) {
- param_signal_error(plist, param_name, ecode = code);
- }
- switch (code = param_read_int(plist,
- (param_name = LIPS_OPTION_CASSETFEED),
- &cass)) {
- case 0:
- if (cass < -1 || cass > 17 || (cass > 3 && cass < 10))
- ecode = gs_error_limitcheck;
- else
- break;
- goto casse;
- default:
- ecode = code;
- casse:param_signal_error(plist, param_name, ecode);
- case 1:
- break;
- }
-
- switch (code = param_read_string(plist,
- (param_name = LIPS_OPTION_MEDIATYPE),
- &pmedia)) {
- case 0:
- if (pmedia.size > LIPS_MEDIACHAR_MAX)
- ecode = gs_error_limitcheck;
- else { /* Check the validity of ``MediaType'' characters */
- if (strcmp(pmedia.data, "PlainPaper") != 0 &&
- strcmp(pmedia.data, "OHP") != 0 &&
- strcmp(pmedia.data, "TransparencyFilm") != 0 && /* same as OHP */
- strcmp(pmedia.data, "GlossyFilm") != 0 &&
- strcmp(pmedia.data, "CardBoard") != 0) {
- ecode = gs_error_rangecheck;
- goto pmediae;
- }
- }
- break;
- goto pmediae;
- default:
- ecode = code;
- pmediae:param_signal_error(plist, param_name, ecode);
- case 1:
- pmedia.data = 0;
- break;
- }
-
- switch (code = param_read_string(plist,
- (param_name = LIPS_OPTION_USER_NAME),
- &usern)) {
- case 0:
- if (usern.size > LIPS_USERNAME_MAX)
- ecode = gs_error_limitcheck;
- else { /* Check the validity of ``User Name'' characters */
- int i;
-
- for (i = 0; i < usern.size; i++)
- if (usern.data[i] < 0x20 || usern.data[i] > 0x7e
- /*
- && usern.data[i] < 0xa0) ||
- usern.data[i] > 0xfe
- */
- ) {
- ecode = gs_error_rangecheck;
- goto userne;
- }
- }
- break;
- goto userne;
- default:
- ecode = code;
- userne:param_signal_error(plist, param_name, ecode);
- case 1:
- usern.data = 0;
- break;
- }
-
-
- if ((code = param_read_bool(plist,
- (param_name = LIPS_OPTION_DUPLEX_TUMBLE),
- &tum)) < 0)
- param_signal_error(plist, param_name, ecode = code);
-
-
- switch (code = param_read_int(plist,
- (param_name = LIPS_OPTION_NUP), &nup)) {
- case 0:
- if (nup != 1 && nup != 2 && nup != 4)
- ecode = gs_error_rangecheck;
- else
- break;
- goto nupe;
- default:
- ecode = code;
- nupe:param_signal_error(plist, param_name, ecode);
- case 1:
- break;
- }
-
- if ((code = param_read_bool(plist,
- (param_name = LIPS_OPTION_PJL), &pjl)) < 0)
- param_signal_error(plist, param_name, ecode = code);
-
- switch (code = param_read_int(plist,
- (param_name = LIPS_OPTION_TONERDENSITY),
- &toner_density)) {
- case 0:
- if (toner_density < 0 || toner_density > 8)
- ecode = gs_error_rangecheck;
- else
- break;
- goto tden;
- default:
- ecode = code;
- tden:param_signal_error(plist, param_name, ecode);
- case 1:
- break;
- }
-
- if (pdev->toner_saving_set >= 0)
- switch (code =
- param_read_bool(plist, (param_name = LIPS_OPTION_TONERSAVING),
- &toner_saving)) {
- case 0:
- toner_saving_set = 1;
- break;
- default:
- if ((code = param_read_null(plist, param_name)) == 0) {
- toner_saving_set = 0;
- break;
- }
- ecode = code;
- param_signal_error(plist, param_name, ecode);
- case 1:
- break;
- }
-
- if (pdev->Duplex_set >= 0) /* i.e., Duplex is supported */
- switch (code = param_read_bool(plist, (param_name = "Duplex"),
- &duplex)) {
- case 0:
- duplex_set = 1;
- break;
- default:
- if ((code = param_read_null(plist, param_name)) == 0) {
- duplex_set = 0;
- break;
- }
- ecode = code;
- param_signal_error(plist, param_name, ecode);
- case 1:
- break;
- }
- if ((code = param_read_bool(plist,
- (param_name = LIPS_OPTION_FONTDOWNLOAD),
- &fontdl)) < 0)
- param_signal_error(plist, param_name, ecode = code);
-
- if ((code = param_read_bool(plist,
- (param_name = LIPS_OPTION_FACEUP),
- &faceup)) < 0) {
- param_signal_error(plist, param_name, ecode = code);
- }
-
-
- switch (code = param_read_int(plist, (param_name = "BitsPerPixel"), &bpp)) {
- case 0:
- if (bpp != 8 && bpp != 24)
- ecode = gs_error_rangecheck;
- else
- break;
- goto bppe;
- default:
- ecode = code;
- bppe:param_signal_error(plist, param_name, ecode);
- case 1:
- break;
- }
-
- if (bpp != 0) {
- dev->color_info.depth = bpp;
- dev->color_info.num_components = ((bpp == 8) ? 1 : 3);
- dev->color_info.max_gray = (bpp > 8 ? 255 : 1000);
- dev->color_info.max_color = (bpp > 8 ? 255 : 1000);
- dev->color_info.dither_grays = (bpp > 8 ? 256 : 5);
- dev->color_info.dither_colors = (bpp > 8 ? 256 : 2);
- dev_proc(pdev, map_rgb_color) =
- ((bpp == 8) ? gx_default_gray_map_rgb_color :
- gx_default_rgb_map_rgb_color);
- dev_proc(pdev, map_color_rgb) =
- ((bpp == 8) ? gx_default_gray_map_color_rgb :
- gx_default_rgb_map_color_rgb);
- }
-
- if (ecode < 0)
- return ecode;
- code = gdev_vector_put_params(dev, plist);
- if (code < 0)
- return code;
-
- pdev->ManualFeed = mf;
- pdev->cassetFeed = cass;
- pdev->Tumble = tum;
- pdev->nup = nup;
- pdev->pjl = pjl;
- pdev->toner_density = toner_density;
- pdev->toner_saving = toner_saving;
- pdev->toner_saving_set = toner_saving_set;
- pdev->FontDL = fontdl;
- pdev->faceup = faceup;
-
- if (duplex_set >= 0) {
- pdev->Duplex = duplex;
- pdev->Duplex_set = duplex_set;
- }
- if (pmedia.data != 0 &&
- bytes_compare(pmedia.data, pmedia.size,
- (const byte *)pdev->mediaType, strlen(pdev->mediaType))
- ) {
- memcpy(pdev->mediaType, pmedia.data, pmedia.size);
- pdev->mediaType[pmedia.size] = 0;
- }
- if (usern.data != 0 &&
- bytes_compare(usern.data, usern.size,
- (const byte *)pdev->Username, strlen(pdev->Username))
- ) {
- memcpy(pdev->Username, usern.data, usern.size);
- pdev->Username[usern.size] = 0;
- }
- if (bpp != 0 && bpp != old_bpp && pdev->is_open)
- return gs_closedevice(dev);
- return 0;
-}
-
-/* ---------------- Images ---------------- */
-
-private int
-lips4v_copy_mono(gx_device * dev, const byte * data,
- int data_x, int raster, gx_bitmap_id id, int x, int y, int w,
- int h, gx_color_index zero, gx_color_index one)
-{
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- stream *s = gdev_vector_stream(vdev);
- int dpi = dev->x_pixels_per_inch;
- gx_drawing_color color;
- int code = 0;
- floatp r, g, b;
-
- if (id != gs_no_id && zero == gx_no_color_index &&
- one != gx_no_color_index && data_x == 0) {
- gx_drawing_color dcolor;
-
- color_set_pure(&dcolor, one);
-#if GS_VERSION_MAJOR >= 8
- lips4v_setfillcolor(vdev, NULL, &dcolor);
-#else
- lips4v_setfillcolor(vdev, &dcolor);
-#endif
-
- if (lips4v_copy_text_char(dev, data, raster, id, x, y, w, h) >= 0)
- return 0;
- }
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
- /*
- (*dev_proc(vdev->bbox_device, copy_mono))
- ((gx_device *)vdev->bbox_device, data, data_x, raster, id,
- x, y, w, h, zero, one);
- */
- if (zero == gx_no_color_index) {
- if (one == gx_no_color_index)
- return 0;
- /* one ¿§¤ËÀ÷¤á¡¢Æ©²á¤Ë¤¹¤ë */
- if (pdev->MaskState != 1) {
- lputs(s, "}H1");
- sputc(s, LIPS_IS2);
- pdev->MaskState = 1;
- }
- if (pdev->color_info.depth == 8) {
- gx_color_index one_color = vdev->color_info.max_gray - one;
-
- lputs(s, "}T");
- sput_lips_int(s, one_color);
- sputc(s, LIPS_IS2);
- } else {
- r = (one >> 16) * 1000.0 / 255.0;
- g = ((one >> 8) & 0xff) * 1000.0 / 255.0;
- b = (one & 0xff) * 1000.0 / 255.0;
- lputs(s, "}T");
- sput_lips_int(s, r);
- sput_lips_int(s, g);
- sput_lips_int(s, b);
- sputc(s, LIPS_IS2);
- }
- } else if (one == gx_no_color_index)
- /* 1bit ¤ÏÆ©ÌÀ ¥Ó¥Ã¥Èȿž¡¦zero ¿§¤ËÀ÷¤á¤ë */
- {
- gx_color_index zero_color = vdev->color_info.max_gray - zero;
-
- if (pdev->MaskState != 1) {
- lputs(s, "}H1");
- sputc(s, LIPS_IS2);
- pdev->MaskState = 1;
- }
- if (pdev->color_info.depth == 8) {
- lputs(s, "}T");
- sput_lips_int(s, zero_color);
- sputc(s, LIPS_IS2);
- } else {
- r = (zero >> 16) * 1000.0 / 255.0;
- g = ((zero >> 8) & 0xff) * 1000.0 / 255.0;
- b = (zero & 0xff) * 1000.0 / 255.0;
- lputs(s, "}T");
- sput_lips_int(s, r);
- sput_lips_int(s, g);
- sput_lips_int(s, b);
- sputc(s, LIPS_IS2);
- }
- } else if (one == vdev->white) {
- /* ¥Ó¥Ã¥Èȿž ÇòÅɤê zero ¿§¤ËÀ÷¤á¤ë */
- gx_color_index zero_color = vdev->color_info.max_gray - zero;
-
- if (pdev->MaskState != 0) {
- lputs(s, "}H0");
- sputc(s, LIPS_IS2);
- pdev->MaskState = 0;
- }
- if (pdev->color_info.depth == 8) {
- lputs(s, "}T");
- sput_lips_int(s, zero_color);
- sputc(s, LIPS_IS2);
- } else {
- r = (zero >> 16) * 1000.0 / 255.0;
- g = ((zero >> 8) & 0xff) * 1000.0 / 255.0;
- b = (zero & 0xff) * 1000.0 / 255.0;
- lputs(s, "}T");
- sput_lips_int(s, r);
- sput_lips_int(s, g);
- sput_lips_int(s, b);
- sputc(s, LIPS_IS2);
- }
- } else {
- if (zero != gx_no_color_index) {
- code = (*dev_proc(dev, fill_rectangle)) (dev, x, y, w, h, zero);
- if (code < 0)
- return code;
- }
- if (pdev->MaskState != 1) {
- lputs(s, "}H1");
- sputc(s, LIPS_IS2);
- pdev->MaskState = 1;
- }
- color_set_pure(&color, one);
-
-#if GS_VERSION_MAJOR >= 8
- code = gdev_vector_update_fill_color((gx_device_vector *) pdev,
- NULL, &color);
-#else
- code = gdev_vector_update_fill_color((gx_device_vector *) pdev,
- &color);
-#endif
- }
- if (code < 0)
- return 0;
- lputs(s, "}P");
- sput_lips_int(s, x); /* Position X */
- sput_lips_int(s, y); /* Position Y */
- sput_lips_int(s, dpi * 100);
- sput_lips_int(s, dpi * 100);
- sput_lips_int(s, h); /* Height */
- sput_lips_int(s, w); /* Width */
- lputs(s, "100110");
- sputc(s, LIPS_IS2);
-
- lputs(s, "}Q11");
-
- {
- int i, j;
- uint width_bytes = (w + 7) >> 3;
- uint num_bytes = round_up(width_bytes, 4) * h;
- byte *buf = gs_alloc_bytes(vdev->memory, num_bytes,
- "lips4v_copy_mono(buf)");
-
- if (data_x % 8 == 0) {
- for (i = 0; i < h; ++i) {
- memcpy(buf + i * width_bytes,
- data + (data_x >> 3) + i * raster, width_bytes);
- }
- } else {
- for (i = 0; i < h; ++i) {
- for (j = 0; j < width_bytes; j++) {
- *(buf + i * width_bytes + j) =
- *(data + (data_x >> 3) + i * raster +
- j) << (data_x % 8) | *(data + (data_x >> 3) +
- i * raster + j + 1) >> (8 -
- data_x
- % 8);
- }
- }
- }
-
-
- if (one == gx_no_color_index
- || (one == vdev->white
- && zero != gx_no_color_index)) lips4v_write_image_data(vdev,
- buf,
- num_bytes,
- TRUE);
- else
- lips4v_write_image_data(vdev, buf, num_bytes, FALSE);
-
- gs_free_object(vdev->memory, buf, "lips4v_copy_mono(buf)");
- }
-
- return 0;
-}
-
-/* Copy a color bitmap. */
-private int
-lips4v_copy_color(gx_device * dev,
- const byte * data, int data_x, int raster, gx_bitmap_id id,
- int x, int y, int w, int h)
-{
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
- gx_device_vector *const vdev = (gx_device_vector *) dev;
-
- stream *s = gdev_vector_stream(vdev);
- int depth = dev->color_info.depth;
- int dpi = dev->x_pixels_per_inch;
- int num_components = (depth < 24 ? 1 : 3);
- uint width_bytes = w * num_components;
-
-
- if (dev->color_info.depth == 8) {
- gx_drawing_color dcolor;
-
- /* LIPS IV ¤Ç¤Ï¥°¥ì¡¼¥¹¥±¡¼¥ë¤âñ¿§¥¤¥á¡¼¥¸¡¦¥«¥é¡¼»ØÄêÌ¿Îá¤Ë
- ±Æ¶Á¤µ¤ì¤ë¤Î¤Ç¹õ¿§¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ */
- color_set_pure(&dcolor, vdev->black);
-#if GS_VERSION_MAJOR >= 8
- lips4v_setfillcolor(vdev, NULL, &dcolor);
-#else
- lips4v_setfillcolor(vdev, &dcolor);
-#endif
- } else {
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
- }
-
- if (pdev->MaskState != 0) {
- lputs(s, "}H0"); /* ÏÀÍýÉÁ²èÀßÄêÌ¿Îá */
- sputc(s, LIPS_IS2);
- pdev->MaskState = 0;
- }
- lputs(s, "}P");
- sput_lips_int(s, x);
- sput_lips_int(s, y);
- sput_lips_int(s, dpi * 100);
- sput_lips_int(s, dpi * 100);
- sput_lips_int(s, h);
- sput_lips_int(s, w);
- sput_lips_int(s, depth / num_components);
- sputc(s, depth < 24 ? '0' : ':'); /* 24 bit ¤Î¤È¤­ÅÀ½ç¼¡ */
- lputs(s, "0110");
- sputc(s, LIPS_IS2);
-
- {
- int i;
- uint num_bytes = width_bytes * h;
- byte *buf = gs_alloc_bytes(vdev->memory, num_bytes,
- "lips4v_copy_color(buf)");
-
- lputs(s, "}Q11");
-
- for (i = 0; i < h; ++i) {
- memcpy(buf + i * width_bytes,
- data + ((data_x * depth) >> 3) + i * raster, width_bytes);
- }
-
- if (dev->color_info.depth == 8)
- lips4v_write_image_data(vdev, buf, num_bytes, TRUE);
- else
- lips4v_write_image_data(vdev, buf, num_bytes, FALSE);
-
- gs_free_object(vdev->memory, buf, "lips4v_copy_color(buf)");
- }
-
- return 0;
-}
-
-/* Fill a mask. */
-private int
-lips4v_fill_mask(gx_device * dev,
- const byte * data, int data_x, int raster, gx_bitmap_id id,
- int x, int y, int w, int h,
- const gx_drawing_color * pdcolor, int depth,
- gs_logical_operation_t lop, const gx_clip_path * pcpath)
-{
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
- stream *s = gdev_vector_stream(vdev);
- int dpi = dev->x_pixels_per_inch;
-
- if (w <= 0 || h <= 0)
- return 0;
- if (depth > 1 ||
-#if GS_VERSION_MAJOR >= 8
- gdev_vector_update_fill_color(vdev, NULL, pdcolor) < 0 ||
-#else
- gdev_vector_update_fill_color(vdev, pdcolor) < 0 ||
-#endif
- gdev_vector_update_clip_path(vdev, pcpath) < 0 ||
- gdev_vector_update_log_op(vdev, lop) < 0)
- return gx_default_fill_mask(dev, data, data_x, raster, id,
- x, y, w, h, pdcolor, depth, lop, pcpath);
-#if 1
- (*dev_proc(vdev->bbox_device, fill_mask))
- ((gx_device *) vdev->bbox_device, data, data_x, raster, id,
- x, y, w, h, pdcolor, depth, lop, pcpath);
-#endif
- if (id != gs_no_id && data_x == 0) {
- if (lips4v_copy_text_char(dev, data, raster, id, x, y, w, h) >= 0)
- return 0;
- }
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
- /* ½ñ¤­¤À¤· */
- if (pdev->MaskState != 1) {
- lputs(s, "}H1"); /* ÏÀÍýÉÁ²èÀßÄêÌ¿Îá */
- sputc(s, LIPS_IS2);
- pdev->MaskState = 1;
- }
- lputs(s, "}P");
- sput_lips_int(s, x);
- sput_lips_int(s, y);
- sput_lips_int(s, dpi * 100);
- sput_lips_int(s, dpi * 100);
- sput_lips_int(s, h);
- sput_lips_int(s, w);
- lputs(s, "100110");
- sputc(s, LIPS_IS2);
-
- lputs(s, "}Q11");
-
- {
- int i;
- uint width_bytes = (w + 7) >> 3;
- uint num_bytes = round_up(width_bytes, 4) * h;
- byte *buf = gs_alloc_bytes(vdev->memory, num_bytes,
- "lips4v_fill_mask(buf)");
-
- for (i = 0; i < h; ++i) {
- memcpy(buf + i * width_bytes, data + (data_x >> 3) + i * raster,
- width_bytes);
- }
-
- lips4v_write_image_data(vdev, buf, num_bytes, FALSE);
-
- gs_free_object(vdev->memory, buf, "lips4v_fill_mask(buf)");
- }
-
- return 0;
-}
-
-/* ---------------- High-level images ---------------- */
-
-private image_enum_proc_plane_data(lips4v_image_plane_data);
-private image_enum_proc_end_image(lips4v_image_end_image);
-private const gx_image_enum_procs_t lips4v_image_enum_procs = {
- lips4v_image_plane_data, lips4v_image_end_image
-};
-
-/* Start processing an image. */
-private int
-lips4v_begin_image(gx_device * dev,
- const gs_imager_state * pis, const gs_image_t * pim,
- gs_image_format_t format, const gs_int_rect * prect,
- const gx_drawing_color * pdcolor,
- const gx_clip_path * pcpath, gs_memory_t * mem,
- gx_image_enum_common_t ** pinfo)
-{
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
- gdev_vector_image_enum_t *pie =
- gs_alloc_struct(mem, gdev_vector_image_enum_t,
- &st_vector_image_enum, "lips4v_begin_image");
- const gs_color_space *pcs = pim->ColorSpace;
- gs_color_space_index index;
- int num_components = 1;
- bool can_do = prect == 0 &&
- (pim->format == gs_image_format_chunky ||
-
- pim->format == gs_image_format_component_planar);
-
- int code;
-
- if (pie == 0)
- return_error(gs_error_VMerror);
- pie->memory = mem;
- code = gdev_vector_begin_image(vdev, pis, pim, format, prect,
- pdcolor, pcpath, mem,
- &lips4v_image_enum_procs, pie);
- if (code < 0)
- return code;
- *pinfo = (gx_image_enum_common_t *) pie;
-
- if (!pim->ImageMask) {
- index = gs_color_space_get_index(pcs);
- num_components = gs_color_space_num_components(pcs);
-
- if (pim->CombineWithColor)
- can_do = false;
- else {
- switch (index) {
- case gs_color_space_index_DeviceGray:
- if ((pim->Decode[0] != 0 || pim->Decode[1] != 1)
- && (pim->Decode[0] != 1 || pim->Decode[1] != 0))
- can_do = false;
- break;
- case gs_color_space_index_DeviceRGB:
- /* LIPS ¤Ç¤Ï RGB ¤òȿž¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤ */
- if (pim->Decode[0] != 0 || pim->Decode[1] != 1 ||
- pim->Decode[2] != 0 || pim->Decode[3] != 1 ||
- pim->Decode[4] != 0)
- can_do = false;
- break;
- default:
- /*
- LIPS ¤Ç¤Ï L*a*b* ·Á¼°¤Î¥«¥é¡¼¥¹¥Ú¡¼¥¹¤¬»È¤¨¤Þ¤¹¡£
- CIEBasedABC ¤ò»È¤Ã¤Æɽ¸½¤Ç¤­¤Ê¤¤¤³¤È¤â¤Ê¤¤¤Î¤Ç¤¹¤¬¡¢
- Æ°ºî³Îǧ¤Ç¤­¤Ê¤¤¤Î¤ÇÄã¥ì¥Ù¥ë¤Î´Ø¿ô¤Ë¤Þ¤«¤»¤ë¤³¤È¤Ë
- ¤·¤Á¤ã¤¤¤Þ¤¹¡£
- ¤½¤ì¤è¤ê¤â CMYK ¤Î¥«¥é¡¼¥¹¥Ú¡¼¥¹¤¬Íߤ·¤¤...
- */
- can_do = false;
- }
- }
- }
- if (!can_do)
- return gx_default_begin_image(dev, pis, pim, format, prect,
- pdcolor, pcpath, mem,
- &pie->default_info);
- else if (index == gs_color_space_index_DeviceGray) {
- gx_drawing_color dcolor;
-
- /* LIPS IV ¤Ç¤Ï¥°¥ì¡¼¥¹¥±¡¼¥ë¤âñ¿§¥¤¥á¡¼¥¸¡¦¥«¥é¡¼»ØÄêÌ¿Îá¤Ë
- ±Æ¶Á¤µ¤ì¤ë¤Î¤Ç¹õ¿§¤òÌÀ¼¨Åª¤Ë»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ */
- color_set_pure(&dcolor, vdev->black);
-#if GS_VERSION_MAJOR >= 8
- lips4v_setfillcolor(vdev, NULL, &dcolor);
-#else
- lips4v_setfillcolor(vdev, &dcolor);
-#endif
- }
- if (pim->ImageMask || (pim->BitsPerComponent == 1 && num_components == 1)) {
- if (pim->Decode[0] > pim->Decode[1])
- pdev->MaskReverse = 1;
- else
- pdev->MaskReverse = 0;
- }
- /* Write the image/colorimage/imagemask preamble. */
- {
- stream *s = gdev_vector_stream((gx_device_vector *) pdev);
- int ax, ay, bx, by, cx, cy, dx, dy;
- int tbyte;
- gs_matrix imat;
- int interpolate = 0;
-
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
- gs_matrix_invert(&pim->ImageMatrix, &imat);
- gs_matrix_multiply(&imat, &ctm_only(pis), &imat);
- /*
- [xx xy yx yy tx ty]
- LIPS ¤ÎºÂɸ·Ï¤ËÊÑ´¹¤ò¹Ô¤Ê¤¦¡£
-
- }U{Ax}{Ay}{Bx}{By}{Cx}{Cy}{pie->height}{pie->width}
- {pim->BitsPerComponent}{0}{0}{1} LIPS_IS2
- */
-
- /* }Q110{byte} LIPS_IS2 */
- ax = imat.tx;
- ay = imat.ty;
- bx = imat.xx * pim->Width + imat.yx * pim->Height + imat.tx;
- by = imat.xy * pim->Width + imat.yy * pim->Height + imat.ty;
- cx = imat.yx * pim->Height + imat.tx;
- cy = imat.yy * pim->Height + imat.ty;
- dx = imat.xx * pim->Width + imat.tx;
- dy = imat.xy * pim->Width + imat.ty;
-
- if (pim->ImageMask) {
- tbyte =
- (pie->width * pim->BitsPerComponent +
- 7) / 8 * num_components * pie->height;
- pdev->ncomp = 1;
- if (tbyte == 1) {
- /* LIPS IV ¤Ç¤Ï 1 dot ¤Î¥¤¥á¡¼¥¸¤òÊÑ·Á¤¹¤ë¤ÈºÂɸ¤¬¶¸¤¦¥Ð¥°¤¬
- ¤¢¤ë¡£¤è¤Ã¤Æ 1 dot ¤Î¥¤¥á¡¼¥¸¤Ï¶ë·Á¤È¤·¤Æ½èÍý¤¹¤ë¡£ */
- pdev->OneBitMask = true;
- /* Draw Rectangle */
- lputs(s, "2");
- sput_lips_int(s, ax);
- sput_lips_int(s, ay);
- sput_lips_int(s, cx - ax);
- sput_lips_int(s, cy - ay);
- sput_lips_int(s, bx - cx);
- sput_lips_int(s, by - cy);
- sput_lips_int(s, dx - bx);
- sput_lips_int(s, dy - by);
- sputc(s, LIPS_IS2);
- return 0;
- } else {
- /* ÉÁ²èÏÀÍýÀßÄêÌ¿Îá - Æ©²á */
- if (pdev->MaskState != 1) {
- lputs(s, "}H1");
- sputc(s, LIPS_IS2);
- pdev->MaskState = 1;
- }
- }
- } else {
- /* ÉÁ²èÏÀÍýÀßÄêÌ¿Îá - ÇòÅɤê */
- if (pdev->MaskState != 0) {
- lputs(s, "}H0");
- sputc(s, LIPS_IS2);
- pdev->MaskState = 0;
- }
- pdev->ncomp = num_components;
- }
-
- lputs(s, "}U");
- sput_lips_int(s, ax);
- sput_lips_int(s, ay);
- sput_lips_int(s, bx);
- sput_lips_int(s, by);
- sput_lips_int(s, cx);
- sput_lips_int(s, cy);
- sput_lips_int(s, pie->height);
- sput_lips_int(s, pie->width);
- sput_lips_int(s, pim->BitsPerComponent);
-
- if (pim->Interpolate) {
- if (pim->BitsPerComponent * pie->num_planes == 1)
- interpolate = 1;
- else
- interpolate = 3;
- }
- if (pim->ImageMask) { /* 1bit ¤Î¤È¤­ */
- lputs(s, "0");
- } else {
- if (index == gs_color_space_index_DeviceGray)
- lputs(s, "0");
- else {
- if (format == gs_image_format_chunky) /* RGBRGBRGB... */
- sputc(s, 0x3a);
- else /* RRR...GGG...BBB... */
- sputc(s, 0x3b);
- }
- }
- if (interpolate > 0)
- sput_lips_int(s, interpolate);
- sputc(s, LIPS_IS2);
- }
- return 0;
-}
-
-/* Process the next piece of an image. */
-private int
-lips4v_image_plane_data(gx_image_enum_common_t * info,
- const gx_image_plane_t * planes, int height,
- int *rows_used)
-{
- gx_device *dev = info->dev;
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
- gdev_vector_image_enum_t *pie = (gdev_vector_image_enum_t *) info;
-
- stream *s = gdev_vector_stream((gx_device_vector *) pdev);
- int y;
-
- if (pdev->OneBitMask) {
- /*
- lputs(s, "\200");
- */
- pie->y += height;
- return 1;
- }
- if (pie->default_info)
- return gx_image_plane_data(pie->default_info, planes, height);
- gx_image_plane_data(pie->bbox_info, planes, height);
- {
- int plane;
- int width_bytes, tbyte;
- byte *buf;
-
- width_bytes =
- (pie->width * pie->bits_per_pixel / pdev->ncomp +
- 7) / 8 * pdev->ncomp;
- tbyte = width_bytes * height;
- buf = gs_alloc_bytes(vdev->memory, tbyte, "lips4v_image_data(buf)");
-
- for (plane = 0; plane < pie->num_planes; ++plane)
- for (y = 0; y < height; ++y) {
- memcpy(buf + y * width_bytes,
- planes[plane].data +
- ((planes[plane].data_x * pie->bits_per_pixel) >> 3)
- + y * planes[plane].raster, width_bytes);
- }
-
- lputs(s, "}Q10");
-
- if ((pie->bits_per_pixel > 1 && pdev->ncomp == 1) ||
- pdev->MaskReverse == 0) {
- lips4v_write_image_data(vdev, buf, tbyte, TRUE);
- } else
- lips4v_write_image_data(vdev, buf, tbyte, FALSE);
-
- gs_free_object(vdev->memory, buf, "lips4v_image_data(buf)");
-
- }
-
- return (pie->y += height) >= pie->height;
-}
-
-private int
-lips4v_image_end_image(gx_image_enum_common_t * info, bool draw_last)
-{
- gx_device *dev = info->dev;
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
- gdev_vector_image_enum_t *pie = (gdev_vector_image_enum_t *) info;
- stream *s = gdev_vector_stream((gx_device_vector *) pdev);
- int code;
-
- if (pdev->OneBitMask)
- pdev->OneBitMask = false;
- else
- lputs(s, "}Q1100");
- sputc(s, LIPS_IS2); /* End of Image */
-
- pdev->MaskReverse = -1;
-
- code = gdev_vector_end_image(vdev, (gdev_vector_image_enum_t *) pie,
- draw_last, pdev->white);
- return code;
-}
diff --git a/gs/contrib/lips4/gdevl4v.c.orig b/gs/contrib/lips4/gdevl4v.c.orig
deleted file mode 100644
index ade08e1a9..000000000
--- a/gs/contrib/lips4/gdevl4v.c.orig
+++ /dev/null
@@ -1,2487 +0,0 @@
-/* Copyright (C) 1998, 1999 Norihito Ohmori.
-
- Ghostscript printer driver
- for Canon LBP (LIPS IV)
-
- This software 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 GNU General Public License for full details.
-
- Everyone is granted permission to copy, modify and redistribute
- this software, but only under the conditions described in the GNU
- General Public License. A copy of this license is supposed to have been
- given to you along with this software 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.
- */
-
-/*$Id: gdevl4v.c $ */
-/* Vector Version of LIPS driver */
-
-/*
-
- Vector driver ¤Ï Ghostscript 5.0 ¤«¤é¿·¤¿¤Ë²Ã¤ï¤Ã¤¿¥É¥é¥¤¥Ð¤Ç¤¹¡£
- ¤è¤Ã¤Æ»ÅÍͤ¬°ÂÄꤷ¤Æ¤¤¤Þ¤»¤ó¡£Ghostscript 5.10 ¤È Ghostscript 5.50 ¤Ç¤Ï
- Hi-level bitmap imaging ¤Î»ÅÍͤ¬ÊѤï¤Ã¤Æ¤¤¤Þ¤¹¡£
- Ghostscript 6.0 ¤Ç¤Ï¹¹¤Ë text_begin ¤È¤¤¤¦ API ¤¬Äɲ䵤ì¤ë¤è¤¦¤Ç¤¹¡£
-
-
- ¡ûGhostscript 5.10/5.50 ¤Î¥Ð¥°¤Ë¤Ä¤¤¤Æ
-
- Ghostscript 5.10/5.50 ¤Î Vector driver ¤Î setlinewidth ´Ø¿ô¤Ë¤Ï
- ¥Ð¥°¤¬¤¢¤ê¤Þ¤¹¡£ËÜÍ襹¥±¡¼¥ë¤¬Êѹ¹¤µ¤ì¤ë¤Ë¤·¤¿¤¬¤Ã¤ÆÀþ¤ÎÂÀ¤µ¤âÊѹ¹¤µ¤ì
- ¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¤¬¡¢Ghostscript 5.10/5.50 ¤Ç¤Ï¥¹¥±¡¼¥ë¤ò¹Íθ¤¹¤ë¤Î¤ò
- ˺¤ì¤Æ¤¤¤Þ¤¹¡£(¥Ð¥°Êó¹ð¤ò2²ó¤Û¤ÉÁ÷¤Ã¤¿¤Î¤À¤±¤ì¤É...)
- ¤³¤Î¥É¥é¥¤¥Ð¤Ï¤½¤Î¥Ð¥°¤ò²óÈò¤¹¤ë¤¿¤á¤Ë¥¹¥±¡¼¥ë¤ò¼«Ê¬¤Ç½èÍý¤·¤Æ¤¤¤Þ¤¹¡£
-
- Ghostscript 5.10 ¤ÎÀ¸À®¤¹¤ë¥Ñ¥¹¤Ï Ghostscript 5.50 ¤¬À¸À®¤¹¤ë¥Ñ¥¹¤è¤ê¤â
- Èó¾ï¤Ë¸úΨ¤Î°­¤¤¤â¤Î¤Ë¤Ê¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£LIPS IV ¤Î½èÍý¤Ç¤­¤ë¸Â³¦¤òĶ¤¨¤ë
- ¤³¤È¤â¤¢¤ê¤Þ¤·¤¿¡£¸úΨ¤Î°­¤¤¥Ñ¥¹¤Ï®ÅÙ¤ÎÄã²¼¤Ë¤â¤Ä¤Ê¤¬¤ë¤Î¤Ç Ghostscript
- 5.50 ¤ò»È¤Ã¤¿Êý¤¬¤³¤Î¥É¥é¥¤¥Ð¤Ç¤Ï½ÐÎÏ®ÅÙ¤¬Â®¤¯¤Ê¤ê¤Þ¤¹¡£
-
- ¤Þ¤¿ Ghostscript 5.10 ¤Ç¤Ï
- fill_trapezoid¡¢fill_parallelogram¡¢fill_triangle
- ¤Î´Ø¿ô¤ÎµóÆ°¤¬ÊѤˤʤ뤳¤È¤¬¤¢¤Ã¤¿¤Î¤Ç¤³¤ì¤é¤Ï»È¤Ã¤Æ¤¤¤Þ¤»¤ó¡£
-
-
- ¡û LIPS IV ¤Î¥Ð¥°¤Ë¤Ä¤¤¤Æ
-
- ¤³¤Î¥É¥é¥¤¥Ð¤Ï³«È¯Ãæ¤Ëȯ¸«¤·¤¿¼¡¤Î LIPS IV ¤Î¥Ð¥°¤ò²óÈò¤·¤Æ¤¤¤Þ¤¹¡£
- 1. 1 dot ¤Î¥¤¥á¡¼¥¸¤òÊÑ·Á¤·¤¿¤È¤­¤ËºÂɸ¤Î·×»»¤¬¶¸¤¦
- 2. ¾®¤µ¤Ê¥¤¥á¡¼¥¸¤òÉÁ²è¤¹¤ë¤ÈÀµ¾ï¤ËÉÁ¤«¤ì¤Ê¤¤
- 3. ¥¯¥ê¥Ã¥Ô¥ó¥°Ì¿Îá¤È¥Ñ¥¹¡¦¥¯¥ê¥Ã¥Ô¥ó¥°Ì¿Î᤬¤½¤ì¤¾¤ìÆÈΩ¤ËƯ¤¤¤Æ¤·¤Þ¤¦¡£
-
- 1. ¤Ï 1 dot ¤Î¥¤¥á¡¼¥¸¤ò¶ë·Á¤Ë¤·¤Æ²óÈò¤·¤Þ¤·¤¿¡£
- 2. ¤Ï¥¤¥á¡¼¥¸Îΰè³ÎÊÝÌ¿Îá¤Çʬ³ä¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤ê²óÈò¤·¤Þ¤·¤¿¡£
- 3. ¤Ï¥¯¥ê¥Ã¥Ô¥ó¥°Ì¿Îá¤ò»È¤ï¤Ê¤¤¤³¤È¤Ë¤·¤Æ²óÈò¤·¤Þ¤·¤¿¡£
-
-
- ¡û LIPS IV ¤Î»ÅÍͤˤĤ¤¤Æ
-
- 1. ñ¿§¥¤¥á¡¼¥¸¡¦¥«¥é¡¼»ØÄêÌ¿Îá¤Ï¥°¥ì¡¼¥¹¥±¡¼¥ë¥¤¥á¡¼¥¸¤ËÂФ·¤Æ¤â
- Ư¤¤¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
- 2. LIPS IV ¤Ç¤Ï¥°¥ì¡¼¥¹¥±¡¼¥ë¤Î¿§É½¸½¤¬ PostScript ¤ÈµÕ¤Ç¤¹¡£
- 3. LIPS IV ¤Ë¤Ï¥¤¥á¡¼¥¸¤Î¥Ó¥Ã¥È¤òȿž¤µ¤»¤ë¥³¥Þ¥ó¥É¤Ï¤¢¤ê¤Þ¤»¤ó¡£
- 4. LIPS IV ¤Ë¤Ï CMYK ¤Î¥«¥é¡¼¥¹¥Ú¡¼¥¹¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-
- */
-
-#include "string.h"
-#include "math_.h"
-#include "gx.h"
-#include "gserrors.h"
-#include "gsmatrix.h"
-#include "gsparam.h"
-#include "gxdevice.h"
-#include "gscspace.h"
-#include "gsutil.h"
-#include "gdevvec.h"
-#if 0
-#include "gdevpstr.h"
-#endif
-#include "ghost.h"
-#include "gzstate.h"
-#include "imemory.h"
-#include "igstate.h"
-#include "gdevlips.h"
-
-/* ---------------- Device definition ---------------- */
-
-/* Device procedures */
-private dev_proc_open_device(lips4v_open);
-private dev_proc_output_page(lips4v_output_page);
-private dev_proc_close_device(lips4v_close);
-private dev_proc_copy_mono(lips4v_copy_mono);
-private dev_proc_copy_color(lips4v_copy_color);
-private dev_proc_put_params(lips4v_put_params);
-private dev_proc_get_params(lips4v_get_params);
-private dev_proc_fill_mask(lips4v_fill_mask);
-private dev_proc_begin_image(lips4v_begin_image);
-
-
-#define X_DPI 600
-#define Y_DPI 600
-
-typedef struct gx_device_lips4v_s
-{
- gx_device_vector_common;
- lips_params_common;
- lips4_params_common;
- bool first_page;
- bool ManualFeed;
- bool Duplex;
- int Duplex_set;
- bool Tumble;
- bool OneBitMask; /* for LIPS Bug */
- int ncomp;
- int MaskReverse;
- int MaskState;
- bool TextMode;
- int prev_x;
- int prev_y;
- gx_color_index prev_color;
- gx_color_index current_color;
- int linecap;
- /* for Font Downloading */
-#define max_cached_chars 256 /* 128 * n */
- bool FontDL;
- int current_font;
- int count;
- gx_bitmap_id id_table[max_cached_chars + 1];
- gx_bitmap_id id_cache[max_cached_chars + 1];
-}
-gx_device_lips4v;
-
-gs_public_st_suffix_add0_final(st_device_lips4v, gx_device_lips4v,
- "gx_device_lips4v", device_lips4v_enum_ptrs,
- device_lips4v_reloc_ptrs, gx_device_finalize,
- st_device_vector);
-
-#define lips_device_full_body(dtype, pprocs, dname, stype, w, h, xdpi, ydpi, ncomp, depth, mg, mc, dg, dc, lm, bm, rm, tm)\
- std_device_part1_(dtype, pprocs, dname, stype, open_init_closed),\
- dci_values(ncomp, depth, mg, mc, dg, dc),\
- std_device_part2_(w, h, xdpi, ydpi),\
- offset_margin_values(-lm * xdpi, -tm * ydpi, lm * 72.0, bm * 72.0, rm * 72.0, tm * 72.0),\
- std_device_part3_()
-
-#define lips4v_device_body\
- lips_device_full_body(gx_device_lips4v, 0, "lips4v",\
- &st_device_lips4v,\
- DEFAULT_WIDTH_10THS * X_DPI / 10,\
- DEFAULT_HEIGHT_10THS * Y_DPI / 10,\
- X_DPI, Y_DPI,\
- 1, 8, 1000, 1000, 5, 2,\
- LIPS4_LEFT_MARGIN_DEFAULT,\
- LIPS4_BOTTOM_MARGIN_DEFAULT,\
- LIPS4_RIGHT_MARGIN_DEFAULT,\
- LIPS4_TOP_MARGIN_DEFAULT)
-
-
-#define lips4v_procs\
- { lips4v_open,\
- gx_upright_get_initial_matrix,\
- NULL, /* sync_output */\
- lips4v_output_page,\
- lips4v_close,\
- gx_default_gray_map_rgb_color,\
- gx_default_gray_map_color_rgb,\
- gdev_vector_fill_rectangle,\
- NULL, /* tile_rectangle */\
- lips4v_copy_mono,\
- lips4v_copy_color,\
- NULL, /* draw_line */\
- NULL, /* get_bits */\
- lips4v_get_params,\
- lips4v_put_params,\
- NULL, /* map_cmyk_color */\
- NULL, /* get_xfont_procs */\
- NULL, /* get_xfont_device */\
- NULL, /* map_rgb_alpha_color */\
- gx_page_device_get_page_device,\
- NULL, /* get_alpha_bits */\
- NULL, /* copy_alpha */\
- NULL, /* get_band */\
- NULL, /* copy_rop */\
- gdev_vector_fill_path,\
- gdev_vector_stroke_path,\
- lips4v_fill_mask,\
- gdev_vector_fill_trapezoid,\
- gdev_vector_fill_parallelogram,\
- gdev_vector_fill_triangle,\
- NULL /****** WRONG ******/, /* draw_thin_line */\
- lips4v_begin_image,\
- NULL,\
- NULL,\
- NULL, /* strip_tile_rectangle */\
- NULL/******strip_copy_rop******/\
- }
-
-gx_device_lips4v far_data gs_lips4v_device = {
- lips4v_device_body,
- lips4v_procs,
- vector_initial_values,
- LIPS_CASSETFEED_DEFAULT,
- LIPS_USERNAME_DEFAULT,
- FALSE /* PJL */ ,
- 0 /* toner_density */ ,
- FALSE /* toner_saving */ ,
- 0 /* toner_saving_set */ ,
- 0, 0, 0, 0, -1,
- 0 /* prev_duplex_mode */ ,
- LIPS_NUP_DEFAULT,
- LIPS_FACEUP_DEFAULT,
- LIPS_MEDIATYPE_DEFAULT,
- 0 /* first_page */ ,
- LIPS_MANUALFEED_DEFAULT,
- 0 /* Duplex */ , 0 /* Duplex_set */ , LIPS_TUMBLE_DEFAULT,
- 0 /* OneBitMask */ ,
- 0 /* ncomp */ , -1 /* MaskReverse */ , 0 /* MaskState */ ,
- 0 /* TextMode */ , 0 /* prev_x */ , 0 /* prev_y */ ,
- 0 /* prev_color */ , 0 /* current_color */ ,
- 0 /* linecap */ ,
- 0 /* FontDL */ ,
- -1 /* current_font */ ,
- 0 /* count */ ,
- {0},
- {0}
-};
-
-/* Vector device implementation */
-#if GS_VERSION_MAJOR >= 8
-private int lips4v_beginpage(gx_device_vector * vdev);
-private int lips4v_setfillcolor(gx_device_vector * vdev, const gs_imager_state * pis,
- const gx_drawing_color * pdc);
-private int lips4v_setstrokecolor(gx_device_vector * vdev, const gs_imager_state * pis,
- const gx_drawing_color * pdc);
-private int lips4v_setdash(gx_device_vector * vdev, const float *pattern,
- uint count, floatp offset);
-private int lips4v_setflat(gx_device_vector * vdev, floatp flatness);
-private int
-lips4v_setlogop(gx_device_vector * vdev, gs_logical_operation_t lop,
- gs_logical_operation_t diff);
-private int lips4v_can_handle_hl_color(gx_device_vector * vdev, const gs_imager_state * pis,
- const gx_drawing_color * pdc);
-private int
-
-lips4v_beginpath(gx_device_vector * vdev, gx_path_type_t type);
-private int
-lips4v_moveto(gx_device_vector * vdev, floatp x0, floatp y0, floatp x,
- floatp y, gx_path_type_t type);
-private int
-lips4v_lineto(gx_device_vector * vdev, floatp x0, floatp y0, floatp x,
- floatp y, gx_path_type_t type);
-private int
-lips4v_curveto(gx_device_vector * vdev, floatp x0, floatp y0, floatp x1,
- floatp y1, floatp x2, floatp y2, floatp x3, floatp y3,
- gx_path_type_t type);
-private int
-lips4v_closepath(gx_device_vector * vdev, floatp x, floatp y, floatp x_start,
- floatp y_start, gx_path_type_t type);
-
-private int lips4v_endpath(gx_device_vector * vdev, gx_path_type_t type);
-#else
-private int lips4v_beginpage(P1(gx_device_vector * vdev));
-private int lips4v_setfillcolor(P2(gx_device_vector * vdev,
- const gx_drawing_color * pdc));
-private int lips4v_setstrokecolor(P2(gx_device_vector * vdev,
- const gx_drawing_color * pdc));
-private int lips4v_setdash(P4(gx_device_vector * vdev, const float *pattern,
- uint count, floatp offset));
-private int lips4v_setflat(P2(gx_device_vector * vdev, floatp flatness));
-private int
-lips4v_setlogop(P3
-
- (gx_device_vector * vdev, gs_logical_operation_t lop,
- gs_logical_operation_t diff));
-private int
-
-lips4v_beginpath(P2(gx_device_vector * vdev, gx_path_type_t type));
-private int
-lips4v_moveto(P6
- (gx_device_vector * vdev, floatp x0, floatp y0, floatp x,
- floatp y, gx_path_type_t type));
-private int
-lips4v_lineto(P6
- (gx_device_vector * vdev, floatp x0, floatp y0, floatp x,
- floatp y, gx_path_type_t type));
-private int
-lips4v_curveto(P10
- (gx_device_vector * vdev, floatp x0, floatp y0, floatp x1,
- floatp y1, floatp x2, floatp y2, floatp x3, floatp y3,
- gx_path_type_t type));
-private int
-lips4v_closepath(P6
- (gx_device_vector * vdev, floatp x, floatp y, floatp x_start,
- floatp y_start, gx_path_type_t type));
-
-private int lips4v_endpath(P2(gx_device_vector * vdev, gx_path_type_t type));
-#endif
-private int lips4v_setlinewidth(gx_device_vector * vdev, floatp width);
-private int lips4v_setlinecap(gx_device_vector * vdev, gs_line_cap cap);
-private int lips4v_setlinejoin(gx_device_vector * vdev, gs_line_join join);
-private int lips4v_setmiterlimit(gx_device_vector * vdev, floatp limit);
-private const gx_device_vector_procs lips4v_vector_procs = {
- /* Page management */
- lips4v_beginpage,
- /* Imager state */
- lips4v_setlinewidth,
- lips4v_setlinecap,
- lips4v_setlinejoin,
- lips4v_setmiterlimit,
- lips4v_setdash,
- lips4v_setflat,
- lips4v_setlogop,
- /* Other state */
-#if GS_VERSION_MAJOR >= 8
- lips4v_can_handle_hl_color, /* can_handle_hl_color (dummy) */
-#endif
- lips4v_setfillcolor, /* fill & stroke colors are the same */
- lips4v_setstrokecolor,
- /* Paths */
- gdev_vector_dopath,
- gdev_vector_dorect,
- lips4v_beginpath,
- lips4v_moveto,
- lips4v_lineto,
- lips4v_curveto,
- lips4v_closepath,
- lips4v_endpath
-};
-
-/* ---------------- File header ---------------- */
-
-private const char *l4v_file_header1 =
-
- "\033%-12345X@PJL CJLMODE\n@PJL JOB\n\033%-12345X@PJL CJLMODE\n";
-private const char *l4v_file_header2 = "@PJL SET LPARM : LIPS SW2 = ON\n";
-private const char *l4v_file_header3 = "@PJL ENTER LANGUAGE = LIPS\n";
-private const char *l4v_file_header4 = "\033%@\033P41;";
-
-
-private const char *l4vmono_file_header =
-
- ";1J" L4VMONO_STRING LIPS_VERSION "\033\\\033[0\"p\033<";
-
-private const char *l4vcolor_file_header =
-
- ";1J" L4VCOLOR_STRING LIPS_VERSION "\033\\\033[1\"p\033<";
-
-/* ---------------- Utilities ---------------- */
-
-private void
-lips_param(int param, char *c)
-{
- int i, j;
- bool bSign;
-
- bSign = TRUE;
- if (param < 0) {
- bSign = FALSE;
- param = -param;
- }
- if (param < 16)
- i = 1;
- else if (param < 1024)
- i = 2;
- else if (param < 65536)
- i = 3;
- else
- i = 4;
-
- c[i] = '\0';
- c[i - 1] = (param & 0x0f) | 0x20 | (bSign ? 0x10 : 0x00);
- param >>= 4;
- for (j = i - 2; j >= 0; j--) {
- c[j] = (param & 0x3f) | 0x40;
- param >>= 6;
- }
-}
-
-private void
-sput_lips_int(stream * s, int param)
-{
- int i;
- char c[5];
-
- lips_param(param, c);
- for (i = 0; i < strlen(c); i++)
- sputc(s, c[i]);
-}
-
-/* Put a string on a stream.
- This function is copy of `pputs' in gdevpstr.c */
-private int
-lputs(stream * s, const char *str)
-{
- uint len = strlen(str);
- uint used;
- int status = sputs(s, (const byte *)str, len, &used);
-
- return (status >= 0 && used == len ? 0 : EOF);
-}
-
-/* Write a string on a stream. */
-private void
-put_bytes(stream * s, const byte * data, uint count)
-{
- uint used;
-
- sputs(s, data, count, &used);
-}
-
-/* for Font Downloading */
-private void
-put_int(stream * s, uint number)
-{
- sputc(s, number >> 8);
- sputc(s, number & 0xff);
-}
-
-private int
-lips4v_range_check(gx_device * dev)
-{
- int width = dev->MediaSize[0];
- int height = dev->MediaSize[1];
- int xdpi = dev->x_pixels_per_inch;
- int ydpi = dev->y_pixels_per_inch;
-
- /* Paper Size Check */
- if (width <= height) { /* portrait */
- if ((width < LIPS_WIDTH_MIN || width > LIPS_WIDTH_MAX ||
- height < LIPS_HEIGHT_MIN || height > LIPS_HEIGHT_MAX) &&
- !(width == LIPS_LEDGER_WIDTH && height == LIPS_LEDGER_HEIGHT))
- return_error(gs_error_rangecheck);
- } else { /* landscape */
- if ((width < LIPS_HEIGHT_MIN || width > LIPS_HEIGHT_MAX ||
- height < LIPS_WIDTH_MIN || height > LIPS_WIDTH_MAX) &&
- !(width == LIPS_LEDGER_HEIGHT && height == LIPS_LEDGER_WIDTH))
- return_error(gs_error_rangecheck);
- }
-
- /* Resolution Check */
- if (xdpi != ydpi)
- return_error(gs_error_rangecheck);
- else {
- if ((xdpi < LIPS_DPI_MIN || xdpi > LIPS4_DPI_MAX)
- && xdpi != LIPS4_DPI_SUPERFINE) return_error(gs_error_rangecheck);
- }
-
- return 0;
-}
-
-
-private void
-lips4v_set_cap(gx_device * dev, int x, int y)
-{
-
- char cap[15];
- stream *s = gdev_vector_stream((gx_device_vector *) dev);
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
- int dx = x - pdev->prev_x;
- int dy = y - pdev->prev_y;
-
-
- if (dx > 0) {
- sprintf(cap, "%c%da", LIPS_CSI, dx);
- lputs(s, cap);
- } else if (dx < 0) {
- sprintf(cap, "%c%dj", LIPS_CSI, -dx);
- lputs(s, cap);
- }
- if (dy > 0) {
- sprintf(cap, "%c%dk", LIPS_CSI, dy);
- lputs(s, cap);
- } else if (dy < 0) {
- sprintf(cap, "%c%de", LIPS_CSI, -dy);
- lputs(s, cap);
- }
- pdev->prev_x = x;
- pdev->prev_y = y;
-}
-
-#define POINT 18
-
-/* Font Downloading Routine */
-private int
-lips4v_copy_text_char(gx_device * dev, const byte * data,
- int raster, gx_bitmap_id id, int x, int y, int w, int h)
-{
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
- stream *s = gdev_vector_stream((gx_device_vector *) dev);
- uint width_bytes = (w + 7) >> 3;
- uint size = width_bytes * h;
- int i, j;
- uint ccode;
- char cset_sub[9], cset[64], cset_number[8], text_color[15];
- int cell_length = (POINT * (int)dev->x_pixels_per_inch) / 72;
- bool download = TRUE;
-
- if (w > cell_length || h > cell_length || !pdev->FontDL)
- return -1;
-
- for (j = pdev->count - 1; j >= 0; j--) {
- if (pdev->id_table[j] == id)
- /* font is found */
- {
- download = FALSE;
- ccode = j;
- for (i = j; i < pdev->count - 1; i++) {
- pdev->id_cache[i] = pdev->id_cache[i + 1];
- }
- pdev->id_cache[pdev->count - 1] = id;
- break;
- }
- }
-
- if (download) {
- if (pdev->count > max_cached_chars - 1) {
- gx_bitmap_id tmpid = pdev->id_cache[0];
-
- for (j = pdev->count - 1; j >= 0; j--) {
- if (pdev->id_table[j] == tmpid) {
- ccode = j;
- break;
- }
- }
- for (i = j; i < pdev->count - 1; i++) {
- pdev->id_cache[i] = pdev->id_cache[i + 1];
- }
- pdev->id_cache[pdev->count - 1] = tmpid;
- } else {
- ccode = pdev->count;
- pdev->id_cache[pdev->count] = id;
- }
- }
- if (pdev->TextMode == FALSE) {
- /* Text mode */
- lputs(s, "}p");
- sput_lips_int(s, x);
- sput_lips_int(s, y);
- sputc(s, LIPS_IS2);
- pdev->TextMode = TRUE;
- pdev->prev_x = x;
- pdev->prev_y = y;
- } else
- lips4v_set_cap(dev, x, y);
-
- if (download) {
- if (ccode % 128 == 0 && ccode == pdev->count) {
- /* ʸ»ú¥»¥Ã¥ÈÅÐÏ¿Êä½õÌ¿Îá */
- sprintf(cset_sub, "%c%dx%c", LIPS_DCS, ccode / 128, LIPS_ST);
- lputs(s, cset_sub);
- /* ʸ»ú¥»¥Ã¥ÈÅÐÏ¿Ì¿Îá */
- sprintf(cset,
- "%c%d;1;0;0;3840;8;400;100;0;0;200;%d;%d;0;0;;;;;%d.p",
- LIPS_CSI,
- size + 9, cell_length, /* Cell Width */
- cell_length, /* Cell Height */
- (int)dev->x_pixels_per_inch);
- lputs(s, cset);
- } else {
- /* 1ʸ»úÅÐÏ¿Ì¿Îá */
- sprintf(cset,
- "%c%d;%d;8;%d.q", LIPS_CSI,
- size + 9, ccode / 128, (int)dev->x_pixels_per_inch);
- lputs(s, cset);
- }
-
- /* ¥æ¡¼¥¶Ê¸»úÅÐÏ¿¥Ç¡¼¥¿ ¤Î¥Ø¥Ã¥À */
- sputc(s, ccode % 128); /* charcter code */
- put_int(s, w);
- put_int(s, 0);
- put_int(s, h);
- put_int(s, 0);
- for (i = h - 1; i >= 0; --i) {
- put_bytes(s, data + i * raster, width_bytes);
- }
- }
- /* ʸ»ú¥»¥Ã¥È¡¦¥¢¥µ¥¤¥óÈÖ¹æÁªÂòÌ¿Îá2 */
- if (download) {
- if (pdev->current_font != ccode / 128) {
- sprintf(cset_number, "%c%d%%v", LIPS_CSI, ccode / 128);
- lputs(s, cset_number);
- pdev->current_font = ccode / 128;
- }
- } else {
- if (pdev->current_font != ccode / 128) {
- sprintf(cset_number, "%c%d%%v", LIPS_CSI, ccode / 128);
- lputs(s, cset_number);
- pdev->current_font = ccode / 128;
- }
- }
-
- /* ¥«¥é¡¼ */
- if (pdev->current_color != pdev->prev_color) {
- if (pdev->color_info.depth == 8) {
- sputc(s, LIPS_CSI);
- lputs(s, "?10;2;");
- sprintf(text_color, "%d",
- (int)(pdev->color_info.max_gray - pdev->current_color));
- } else {
- int r = (pdev->current_color >> 16) * 1000.0 / 255.0;
- int g = ((pdev->current_color >> 8) & 0xff) * 1000.0 / 255.0;
- int b = (pdev->current_color & 0xff) * 1000.0 / 255.0;
-
- sputc(s, LIPS_CSI);
- lputs(s, "?10;;");
- sprintf(text_color, "%d;%d;%d", r, g, b);
- }
- lputs(s, text_color);
- lputs(s, "%p");
- pdev->prev_color = pdev->current_color;
- }
- /* À©¸æʸ»ú°õ»úÌ¿Îá */
- if (ccode % 128 == 0x00 ||
- (ccode % 128 >= 0x07 && ccode % 128 <= 0x0F) ||
- ccode % 128 == 0x1B) {
- sputc(s, LIPS_CSI);
- lputs(s, "1.v");
- }
- sputc(s, ccode % 128);
-
- if (download) {
- pdev->id_table[ccode] = id;
- if (pdev->count < max_cached_chars - 1)
- pdev->count++;
- }
- return 0;
-}
-
-private void
-reverse_buffer(byte * buf, int Len)
-{
- int i;
-
- for (i = 0; i < Len; i++)
- *(buf + i) = ~*(buf + i);
-}
-
-private void
-lips4v_write_image_data(gx_device_vector * vdev, byte * buf, int tbyte,
- int reverse)
-{
- stream *s = gdev_vector_stream(vdev);
- byte *cbuf = gs_alloc_bytes(vdev->memory, tbyte * 3 / 2,
- "lips4v_write_image_data(cbuf)");
- byte *cbuf_rle = gs_alloc_bytes(vdev->memory, tbyte * 3,
- "lips4v_write_image_data(cbuf_rle)");
- int Len, Len_rle;
-
- if (reverse)
- reverse_buffer(buf, tbyte);
-
-
- Len = lips_packbits_encode(buf, cbuf, tbyte);
- Len_rle = lips_rle_encode(buf, cbuf_rle, tbyte);
-
- if (Len > tbyte && Len_rle > tbyte) {
- /* Not compress */
- lputs(s, "0");
- sput_lips_int(s, tbyte);
- sputc(s, LIPS_IS2);
-
- put_bytes(s, buf, tbyte);
- } else if (Len > Len_rle) {
- /* Use RunLength encode */
- lputs(s, ":");
- sput_lips_int(s, Len_rle);
- sputc(s, LIPS_IS2);
-
- put_bytes(s, cbuf_rle, Len_rle);
- } else {
- /* Use PackBits encode */
- lputs(s, ";");
- sput_lips_int(s, Len);
- sputc(s, LIPS_IS2);
-
- put_bytes(s, cbuf, Len);
- }
-
- gs_free_object(vdev->memory, cbuf, "lips4v_write_image_data(cbuf)");
- gs_free_object(vdev->memory, cbuf_rle,
- "lips4v_write_image_data(cbuf_rle)");
-}
-
-
-/* ---------------- Vector device implementation ---------------- */
-
-private int
-lips4v_beginpage(gx_device_vector * vdev)
-{ /*
- * We can't use gdev_vector_stream here, because this may be called
- * from there before in_page is set.
- */
- gx_device_lips4v *const pdev = (gx_device_lips4v *) vdev;
- stream *s = vdev->strm;
- int dpi = vdev->x_pixels_per_inch;
- int width = pdev->MediaSize[0];
- int height = pdev->MediaSize[1];
- int paper_size, x0, y0;
- char dpi_char[6], unit[12];
- char page_header[8], l4vmono_page_header[7], l4vcolor_page_header[7];
- char duplex_char[6], tumble_char[6], toner_d[26], toner_s[5],
-
- nup_char[10];
- char username[6 + LIPS_USERNAME_MAX], feedmode[5], paper[16],
-
- faceup_char[256];
- bool dup = pdev->Duplex;
- int dupset = pdev->Duplex_set;
- bool tum = pdev->Tumble;
-
- /* ¥Ù¥¯¥¿¡¦¥â¡¼¥É°Ü¹ÔÌ¿Îá CSI &} ¤ÏÊǤ´¤È¤Ëȯ¹Ô¤¹¤ë */
-
- if (pdev->first_page) {
- if (pdev->pjl) {
- lputs(s, l4v_file_header1);
- if ((int)pdev->x_pixels_per_inch == 1200)
- lputs(s, "@PJL SET RESOLUTION = SUPERFINE\n");
- else if ((int)pdev->x_pixels_per_inch == 600)
- lputs(s, "@PJL SET RESOLUTION = FINE\n");
- else if ((int)pdev->x_pixels_per_inch == 300)
- lputs(s, "@PJL SET RESOLUTION = QUICK\n");
- lputs(s, l4v_file_header2);
- if (pdev->toner_density) {
- sprintf(toner_d, "@PJL SET TONER-DENSITY=%d\n",
- pdev->toner_density);
- lputs(s, toner_d);
- }
- if (pdev->toner_saving_set) {
- lputs(s, "@PJL SET TONER-SAVING=");
- if (pdev->toner_saving)
- sprintf(toner_s, "ON\n");
- else
- sprintf(toner_s, "OFF\n");
- lputs(s, toner_s);
- }
- lputs(s, l4v_file_header3);
- }
- lputs(s, l4v_file_header4);
-
- /* set reaolution (dpi) */
- sprintf(dpi_char, "%d", dpi);
- lputs(s, dpi_char);
-
- if (pdev->color_info.depth == 8)
- lputs(s, l4vmono_file_header);
- else
- lputs(s, l4vcolor_file_header);
-
- /* username */
- sprintf(username, "%c2y%s%c", LIPS_DCS, pdev->Username, LIPS_ST);
- lputs(s, username);
- }
- if (strcmp(pdev->mediaType, "PlainPaper") == 0) {
- sputc(s, LIPS_CSI);
- lputs(s, "20\'t");
- }
- else if (strcmp(pdev->mediaType, "OHP") == 0 ||
- strcmp(pdev->mediaType, "TransparencyFilm") == 0) {
- sputc(s, LIPS_CSI);
- lputs(s, "40\'t"); /* OHP mode (for LBP-2160) */
- }
- else if (strcmp(pdev->mediaType, "CardBoard") == 0) {
- sputc(s, LIPS_CSI);
- lputs(s, "30\'t"); /* CardBoard mode (for LBP-2160) */
- }
- else if (strcmp(pdev->mediaType, "GlossyFilm") == 0) {
- sputc(s, LIPS_CSI);
- lputs(s, "41\'t"); /* GlossyFilm mode (for LBP-2160) */
- }
-
- /* µë»æ¥â¡¼¥É */
- if (pdev->ManualFeed ||
- (strcmp(pdev->mediaType, "PlainPaper") != 0
- && strcmp(pdev->mediaType, LIPS_MEDIATYPE_DEFAULT) != 0)) {
- /* Use ManualFeed */
- if (pdev->prev_feed_mode != 10) {
- sprintf(feedmode, "%c10q", LIPS_CSI);
- lputs(s, feedmode);
- pdev->prev_feed_mode = 10;
- }
- } else {
- if (pdev->prev_feed_mode != pdev->cassetFeed) {
- sprintf(feedmode, "%c%dq", LIPS_CSI, pdev->cassetFeed);
- lputs(s, feedmode);
- pdev->prev_feed_mode = pdev->cassetFeed;
- }
- }
-
- paper_size = lips_media_selection(width, height);
-
- /* Íѻ極¥¤¥º */
- if (pdev->prev_paper_size != paper_size) {
- if (paper_size == USER_SIZE) {
- /* modified by shige 06/27 2003
- sprintf(paper, "%c80;%d;%dp", LIPS_CSI, width * 10, height * 10); */
- /* modified by shige 11/09 2003
- sprintf(paper, "%c80;%d;%dp", LIPS_CSI, height * 10, width * 10); */
- sprintf(paper, "%c80;%d;%dp", LIPS_CSI,
- (height * 10 > LIPS_HEIGHT_MAX_720)?
- LIPS_HEIGHT_MAX_720 : (height * 10),
- (width * 10 > LIPS_WIDTH_MAX_720)?
- LIPS_WIDTH_MAX_720 : (width * 10));
- lputs(s, paper);
- } else if (paper_size == USER_SIZE + LANDSCAPE) {
- /* modified by shige 06/27 2003
- sprintf(paper, "%c81;%d;%dp", LIPS_CSI, height * 10, width * 10); */
- /* modified by shige 11/09 2003
- sprintf(paper, "%c81;%d;%dp", LIPS_CSI, width * 10, height * 10); */
- sprintf(paper, "%c80;%d;%dp", LIPS_CSI,
- (width * 10 > LIPS_HEIGHT_MAX_720)?
- LIPS_HEIGHT_MAX_720 : (width * 10),
- (height * 10 > LIPS_WIDTH_MAX_720)?
- LIPS_WIDTH_MAX_720 : (height * 10));
- lputs(s, paper);
- } else {
- sprintf(paper, "%c%dp", LIPS_CSI, paper_size);
- lputs(s, paper);
- }
- } else if (paper_size == USER_SIZE) {
- if (pdev->prev_paper_width != width ||
- pdev->prev_paper_height != height)
- /* modified by shige 06/27 2003
- sprintf(paper, "%c80;%d;%dp", LIPS_CSI, width * 10, height * 10); */
- /* modified by shige 11/09 2003
- sprintf(paper, "%c80;%d;%dp", LIPS_CSI, height * 10, width * 10); */
- sprintf(paper, "%c80;%d;%dp", LIPS_CSI,
- (height * 10 > LIPS_HEIGHT_MAX_720)?
- LIPS_HEIGHT_MAX_720 : (height * 10),
- (width * 10 > LIPS_WIDTH_MAX_720)?
- LIPS_WIDTH_MAX_720 : (width * 10));
- lputs(s, paper);
- } else if (paper_size == USER_SIZE + LANDSCAPE) {
- if (pdev->prev_paper_width != width ||
- pdev->prev_paper_height != height)
- /* modified by shige 06/27 2003
- sprintf(paper, "%c81;%d;%dp", LIPS_CSI, height * 10, width * 10); */
- /* modified by shige 11/09 2003
- sprintf(paper, "%c81;%d;%dp", LIPS_CSI, width * 10, height * 10); */
- sprintf(paper, "%c80;%d;%dp", LIPS_CSI,
- (width * 10 > LIPS_HEIGHT_MAX_720)?
- LIPS_HEIGHT_MAX_720 : (width * 10),
- (height * 10 > LIPS_WIDTH_MAX_720)?
- LIPS_WIDTH_MAX_720 : (height * 10));
- lputs(s, paper);
- }
- pdev->prev_paper_size = paper_size;
- pdev->prev_paper_width = width;
- pdev->prev_paper_height = height;
-
- if (pdev->faceup) {
- sprintf(faceup_char, "%c11;12;12~", LIPS_CSI);
- lputs(s, faceup_char);
- }
- /* N-up Printing Setting */
- if (pdev->first_page) {
- if (pdev->nup != 1) {
- sprintf(nup_char, "%c%d1;;%do", LIPS_CSI, pdev->nup, paper_size);
- lputs(s, nup_char);
- }
- }
- /* Duplex Setting */
- if (dupset && dup) {
- if (pdev->prev_duplex_mode == 0 || pdev->prev_duplex_mode == 1) {
- sprintf(duplex_char, "%c2;#x", LIPS_CSI); /* duplex */
- lputs(s, duplex_char);
- if (!tum) {
- /* long edge binding */
- if (pdev->prev_duplex_mode != 2) {
- sprintf(tumble_char, "%c0;#w", LIPS_CSI);
- lputs(s, tumble_char);
- }
- pdev->prev_duplex_mode = 2;
- } else {
- /* short edge binding */
- if (pdev->prev_duplex_mode != 3) {
- sprintf(tumble_char, "%c2;#w", LIPS_CSI);
- lputs(s, tumble_char);
- }
- pdev->prev_duplex_mode = 3;
- }
- }
- } else if (dupset && !dup) {
- if (pdev->prev_duplex_mode != 1) {
- sprintf(duplex_char, "%c0;#x", LIPS_CSI); /* simplex */
- lputs(s, duplex_char);
- }
- pdev->prev_duplex_mode = 1;
- }
- sputc(s, LIPS_CSI);
- lputs(s, "?1;4;5;6;14l");
- sputc(s, LIPS_CSI);
- lputs(s, "?2;3;h");
-
- /* size unit (dpi) */
- sputc(s, LIPS_CSI);
- lputs(s, "11h");
- sprintf(unit, "%c?7;%d I", LIPS_CSI, (int)pdev->x_pixels_per_inch);
- lputs(s, unit);
- sprintf(page_header, "%c[0&}#%c", LIPS_ESC, LIPS_IS2);
- lputs(s, page_header); /* vector mode */
-
- lputs(s, "!0"); /* size unit (dpi) */
- sput_lips_int(s, dpi);
- lputs(s, "1");
- sputc(s, LIPS_IS2);
-
- if (pdev->color_info.depth == 8) {
- sprintf(l4vmono_page_header, "!13%c$%c", LIPS_IS2, LIPS_IS2);
- lputs(s, l4vmono_page_header);
- } else {
- sprintf(l4vcolor_page_header, "!11%c$%c", LIPS_IS2, LIPS_IS2);
- lputs(s, l4vcolor_page_header);
- }
-
- lputs(s, "(00");
- sput_lips_int(s,
- ((width - dev_l_margin(vdev) - dev_r_margin(vdev)) * dpi) /
- 72);
- sput_lips_int(s,
- ((height - dev_b_margin(vdev) - dev_t_margin(vdev)) * dpi) /
- 72);
- sputc(s, LIPS_IS2);
-
- /* ¸¶ÅÀ°ÜÆ°Ì¿Îá */
- x0 = (dev_l_margin(vdev) - 5. / MMETER_PER_INCH) * dpi;
- y0 = (dev_b_margin(vdev) - 5. / MMETER_PER_INCH) * dpi;
-
- if (x0 != 0 && y0 != 0) {
- lputs(s, "}\"");
- sput_lips_int(s, x0);
- sput_lips_int(s, y0);
- sputc(s, LIPS_IS2);
- }
- lputs(s, "I00");
- sputc(s, LIPS_IS2);
- lputs(s, "}F2");
- sputc(s, LIPS_IS2);
- lputs(s, "}H1");
- sputc(s, LIPS_IS2);
- lputs(s, "*0");
- sputc(s, LIPS_IS2);
-
- pdev->MaskState = 1; /* ½é´ü²½: Æ©²á */
- pdev->linecap = 0;
- lputs(s, "}M");
- sput_lips_int(s, 3277); /* 11 degree : 16383 * 2 / 10 */
- sputc(s, LIPS_IS2);
- lputs(s, "}I1"); /* non-zero winding rule is default */
- sputc(s, LIPS_IS2);
-
- return 0;
-}
-
-
-private int
-lips4v_setlinewidth(gx_device_vector * vdev, floatp width)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_lips4v *const pdev = (gx_device_lips4v *) vdev;
-
-
-#if 0
- /* Scale ¤ò³Ý¤±¤Æ¤¤¤ë¤Î¤Ï, Ghostscript 5.10/5.50 ¤Î¥Ð¥°¤Î¤¿¤á */
- floatp xscale, yscale;
-
- xscale = fabs(igs->ctm.xx);
- yscale = fabs(igs->ctm.xy);
-
- if (xscale == 0 || yscale > xscale) /* if portrait */
- width = ceil(width * yscale);
- else
- width = ceil(width * xscale);
-#endif
-
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
- if (width < 1)
- width = 1;
-
- lputs(s, "F1");
- sput_lips_int(s, width);
- sputc(s, LIPS_IS2);
-
- return 0;
-}
-
-private int
-lips4v_setlinecap(gx_device_vector * vdev, gs_line_cap cap)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_lips4v *const pdev = (gx_device_lips4v *) vdev;
- char c[6];
- int line_cap = 0;
-
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
- switch (cap) {
- case 0:
- case 3:
- line_cap = 0; /* butt */
- break;
- case 1:
- line_cap = 1; /* round */
- break;
- case 2:
- line_cap = 2; /* square */
- break;
- }
- /* Àþü·Á¾õ»ØÄêÌ¿Îá */
- sprintf(c, "}E%d%c", line_cap, LIPS_IS2);
- lputs(s, c);
-
- pdev->linecap = cap;
-
- return 0;
-}
-
-private int
-lips4v_setlinejoin(gx_device_vector * vdev, gs_line_join join)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_lips4v *const pdev = (gx_device_lips4v *) vdev;
-
-/* ÀþÀܳ»ØÄêÌ¿Îá */
- char c[5];
- int lips_join = 0;
-
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
-
- switch (join) {
- case 0:
- lips_join = 2; /* miter */
- break;
- case 1:
- lips_join = 1; /* round */
- break;
- case 2:
- lips_join = 3; /* bevel */
- break;
- case 3:
- case 4:
- lips_join = 0; /* none */
- break;
- }
-
- sprintf(c, "}F%d%c", lips_join, LIPS_IS2);
- lputs(s, c);
-
- return 0;
-}
-
-private int
-lips4v_setmiterlimit(gx_device_vector * vdev, floatp limit)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_lips4v *const pdev = (gx_device_lips4v *) vdev;
- floatp lips_miterlimit;
-
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
- lips_miterlimit = (16383.0 * 2.0) / limit;
-
- lputs(s, "}M");
- sput_lips_int(s, lips_miterlimit);
- sputc(s, LIPS_IS2);
-
- return 0;
-}
-
-#if GS_VERSION_MAJOR >= 8
-private int
-lips4v_setfillcolor(gx_device_vector * vdev, const gs_imager_state * pis, const gx_drawing_color * pdc)
-#else
-private int
-lips4v_setfillcolor(gx_device_vector * vdev, const gx_drawing_color * pdc)
-#endif
-{
-
- if (!gx_dc_is_pure(pdc))
- return_error(gs_error_rangecheck);
- {
- stream *s = gdev_vector_stream(vdev);
- gx_device_lips4v *const pdev = (gx_device_lips4v *) vdev;
- gx_color_index color = gx_dc_pure_color(pdc);
- int drawing_color;
- float r, g, b;
-
- if (vdev->color_info.depth == 8) {
- drawing_color = vdev->color_info.max_gray - color;
- } else {
- r = (color >> 16) * 1000.0 / 255.0;
- g = ((color >> 8) & 0xff) * 1000.0 / 255.0;
- b = (color & 0xff) * 1000.0 / 255.0;
- }
-
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
- pdev->current_color = color;
-
- if (color == gx_no_color_index) {
- lputs(s, "I0");
- sputc(s, LIPS_IS2);
- } else {
- lputs(s, "I1");
- sputc(s, LIPS_IS2);
- }
-
- /* Åɤê¤Ä¤Ö¤·¥«¥é¡¼»ØÄêÌ¿Îá */
- /* J {color} IS2 */
- lputs(s, "J");
- if (vdev->color_info.depth == 8) {
- sput_lips_int(s, drawing_color);
- } else {
- sput_lips_int(s, r);
- sput_lips_int(s, g);
- sput_lips_int(s, b);
- }
- sputc(s, LIPS_IS2);
-
- /* ñ¿§¥¤¥á¡¼¥¸¡¦¥«¥é¡¼»ØÄêÌ¿Îá */
- /* }T {color} IS2 */
- lputs(s, "}T");
- if (vdev->color_info.depth == 8) {
- sput_lips_int(s, drawing_color);
- } else {
- sput_lips_int(s, r);
- sput_lips_int(s, g);
- sput_lips_int(s, b);
- }
- sputc(s, LIPS_IS2);
- }
- return 0;
-}
-
-#if GS_VERSION_MAJOR >= 8
-private int
-lips4v_setstrokecolor(gx_device_vector * vdev, const gs_imager_state * pis, const gx_drawing_color * pdc)
-#else
-private int
-lips4v_setstrokecolor(gx_device_vector * vdev, const gx_drawing_color * pdc)
-#endif
-{
- if (!gx_dc_is_pure(pdc))
- return_error(gs_error_rangecheck);
- {
- stream *s = gdev_vector_stream(vdev);
- gx_device_lips4v *const pdev = (gx_device_lips4v *) vdev;
- gx_color_index color = gx_dc_pure_color(pdc);
- float r, g, b;
-
- if (vdev->color_info.depth == 24) {
- r = (color >> 16) * 1000 / 255.0;
- g = ((color >> 8) & 0xff) * 1000 / 255.0;
- b = (color & 0xff) * 1000 / 255.0;
- }
-
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
- /* ¥é¥¤¥ó¥«¥é¡¼»ØÄêÌ¿Îá */
- /* G {color} IS2 */
- lputs(s, "G");
- if (vdev->color_info.depth == 8) {
- sput_lips_int(s, vdev->color_info.max_gray - color);
- } else {
- sput_lips_int(s, r);
- sput_lips_int(s, g);
- sput_lips_int(s, b);
- }
- sputc(s, LIPS_IS2);
- }
- return 0;
-}
-
-/* Àþ¼ï»ØÄêÌ¿Îá */
-private int
-lips4v_setdash(gx_device_vector * vdev, const float *pattern, uint count,
- floatp offset)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_lips4v *const pdev = (gx_device_lips4v *) vdev;
- int i;
- float scale, xscale, yscale;
-
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
-#if 0
- /* Scale ¤ò³Ý¤±¤Æ¤¤¤ë¤Î¤Ï, Ghostscript 5.10/5.50 ¤Î¥Ð¥°¤Î¤¿¤á */
- xscale = fabs(igs->ctm.xx);
- yscale = fabs(igs->ctm.xy);
-
- if (xscale == 0) /* if portrait */
- scale = yscale;
- else
- scale = xscale;
-#endif
-
- if (count == 0) {
- lputs(s, "E10");
- sputc(s, LIPS_IS2);
- } else {
- lputs(s, "}d");
- sputc(s, 0x2c);
- lputs(s, "1");
-#if 0
- sput_lips_int(s, offset * scale / vdev->x_pixels_per_inch + 0.5);
-#else
- sput_lips_int(s, offset);
-#endif
- for (i = 0; i < count; ++i) {
- if (pdev->linecap == 1 && count == 2 && pattern[0] == 0) {
- if (i == 0) {
- sput_lips_int(s, 1);
- } else {
-#if 0
- sput_lips_int(s,
- pattern[i] * scale /
- vdev->x_pixels_per_inch - 0.5);
-#else
- sput_lips_int(s, pattern[i] - 1);
-#endif
- }
- } else {
-#if 0
- sput_lips_int(s,
- pattern[i] * scale / vdev->x_pixels_per_inch +
- 0.5);
-#else
- sput_lips_int(s, pattern[i]);
-#endif
- }
- }
- sputc(s, LIPS_IS2);
- lputs(s, "E1");
- sputc(s, 0x2c);
- lputs(s, "0");
- sputc(s, LIPS_IS2);
- }
-
- return 0;
-}
-
-/* ¥Ñ¥¹Ê¿³êÅÙ»ØÄê */
-private int
-lips4v_setflat(gx_device_vector * vdev, floatp flatness)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_lips4v *const pdev = (gx_device_lips4v *) vdev;
-
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
- lputs(s, "Pf");
- sput_lips_int(s, flatness);
- sputc(s, LIPS_IS2);
-
- return 0;
-}
-
-private int
-lips4v_setlogop(gx_device_vector * vdev, gs_logical_operation_t lop,
- gs_logical_operation_t diff)
-{
-/****** SHOULD AT LEAST DETECT SET-0 & SET-1 ******/
- return 0;
-}
-
-#if GS_VERSION_MAJOR >= 8
-/*--- added for Ghostscritp 8.15 ---*/
-private int
-lips4v_can_handle_hl_color(gx_device_vector * vdev, const gs_imager_state * pis1,
- const gx_drawing_color * pdc)
-{
- return false; /* High level color is not implemented yet. */
-}
-#endif
-
-private int
-lips4v_beginpath(gx_device_vector * vdev, gx_path_type_t type)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_lips4v *const pdev = (gx_device_lips4v *) vdev;
-
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
- /* ¥Ñ¥¹¹½ÃÛ³«»ÏÌ¿Îá */
- if (type & gx_path_type_clip) {
- lputs(s, "P(10");
- sputc(s, LIPS_IS2);
- } else
- lputs(s, "P(00");
- sputc(s, LIPS_IS2);
-
- return 0;
-}
-
-private int
-lips4v_moveto(gx_device_vector * vdev, floatp x0, floatp y0, floatp x,
- floatp y, gx_path_type_t type)
-{
- stream *s = gdev_vector_stream(vdev);
-
- /* ¥µ¥Ö¥Ñ¥¹³«»ÏÌ¿Îá p1 */
- lputs(s, "p10");
- sput_lips_int(s, x);
- sput_lips_int(s, y);
- sputc(s, LIPS_IS2);
-
- return 0;
-}
-
-private int
-lips4v_lineto(gx_device_vector * vdev, floatp x0, floatp y0, floatp x,
- floatp y, gx_path_type_t type)
-{
- stream *s = gdev_vector_stream(vdev);
- gx_device_lips4v *const pdev = (gx_device_lips4v *) vdev;
-
- /* if round cap */
- if (pdev->linecap == 1) {
- if ((x0 == x) && (y0 == y))
- x += 1;
- }
-
- /* ¥Ñ¥¹¡¦¥Ý¥ê¥é¥¤¥óÌ¿Îá */
- lputs(s, "p402");
- sput_lips_int(s, x);
- sput_lips_int(s, y);
- sputc(s, LIPS_IS2);
-
- return 0;
-}
-
-private int
-lips4v_curveto(gx_device_vector * vdev, floatp x0, floatp y0,
- floatp x1, floatp y1, floatp x2, floatp y2, floatp x3,
- floatp y3, gx_path_type_t type)
-{
- stream *s = gdev_vector_stream(vdev);
-
- /* ¥Ñ¥¹¡¦¥Ý¥ê¥é¥¤¥óÌ¿Îá */
- lputs(s, "p404");
- sput_lips_int(s, x1);
- sput_lips_int(s, y1);
- sput_lips_int(s, x2);
- sput_lips_int(s, y2);
- sput_lips_int(s, x3);
- sput_lips_int(s, y3);
- sputc(s, LIPS_IS2);
-
- return 0;
-}
-
-private int
-lips4v_closepath(gx_device_vector * vdev, floatp x, floatp y,
- floatp x_start, floatp y_start, gx_path_type_t type)
-{
- stream *s = gdev_vector_stream(vdev);
-
- lputs(s, "p0");
- sputc(s, LIPS_IS2);
- return 0;
-}
-
-private int
-lips4v_endpath(gx_device_vector * vdev, gx_path_type_t type)
-{
- stream *s = gdev_vector_stream(vdev);
-
- lputs(s, "P)");
- sputc(s, LIPS_IS2);
- if (type & gx_path_type_rule) {
- if (type & gx_path_type_winding_number) {
- lputs(s, "}I1");
- sputc(s, LIPS_IS2);
- } else {
- lputs(s, "}I0");
- sputc(s, LIPS_IS2);
- }
- }
- if (type & gx_path_type_fill) {
- if (type & gx_path_type_stroke) {
- lputs(s, "P&00");
- sputc(s, LIPS_IS2);
- } else {
- lputs(s, "PF00");
- sputc(s, LIPS_IS2);
- }
- }
- if (type & gx_path_type_stroke) {
- lputs(s, "PS00");
- sputc(s, LIPS_IS2);
- }
- if (type & gx_path_type_clip) {
- lputs(s, "PC10");
- sputc(s, LIPS_IS2);
- }
- return 0;
-}
-
-/* ---------------- Driver procedures ---------------- */
-
-/* ------ Open/close/page ------ */
-
-/* Open the device. */
-private int
-lips4v_open(gx_device * dev)
-{
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
-
- int code;
-
- code = lips4v_range_check(dev);
- if (code < 0)
- return code;
-
- vdev->v_memory = dev->memory;
-/****** WRONG ******/
- vdev->vec_procs = &lips4v_vector_procs;
-
-#if GS_VERSION_MAJOR >= 8
- code = gdev_vector_open_file_options(vdev, 512,
- (VECTOR_OPEN_FILE_SEQUENTIAL|VECTOR_OPEN_FILE_BBOX));
-#else
- code = gdev_vector_open_file_bbox(vdev, 512, true);
-#endif
- if (code < 0)
- return code;
-
-#if GS_VERSION_MAJOR >= 8
- if (pdev->bbox_device != NULL) {
- if (pdev->bbox_device->memory == NULL)
- pdev->bbox_device->memory = gs_memory_stable(dev->memory);
- }
-#endif
-
- gdev_vector_init(vdev);
- pdev->first_page = true;
-
- return 0;
-}
-
-/* Wrap up ("output") a page. */
-private int
-lips4v_output_page(gx_device * dev, int num_copies, int flush)
-{
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
- stream *s = gdev_vector_stream(vdev);
- char str[6];
-
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
- lputs(s, "%");
- sputc(s, LIPS_IS2);
- lputs(s, "}p");
- sputc(s, LIPS_IS2);
-
- if (num_copies > 255)
- num_copies = 255;
- if (pdev->prev_num_copies != num_copies) {
- sprintf(str, "%c%dv", LIPS_CSI, num_copies);
- lputs(s, str);
- pdev->prev_num_copies = num_copies;
- }
- sputc(s, LIPS_FF);
- sflush(s);
- vdev->in_page = false;
- pdev->first_page = false;
- gdev_vector_reset(vdev);
- return 0;
-}
-
-private int
-lips4v_close(gx_device * dev)
-{
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
- FILE *f = vdev->file;
-
- fprintf(f, "%c0J%c", LIPS_DCS, LIPS_ST);
- if (pdev->pjl) {
- fprintf(f, "%c%%-12345X@PJL SET LPARM : LIPS SW2 = OFF\n", LIPS_ESC);
- fprintf(f,
- "%c%%-12345X%c%%-12345X@PJL EOJ\n"
- "%c%%-12345X", LIPS_ESC, LIPS_ESC, LIPS_ESC);
- }
- gdev_vector_close_file(vdev);
-
- return 0;
-}
-
-/* Close the device. */
-/* Note that if this is being called as a result of finalization, */
-/* the stream may no longer exist; but the file will still be open. */
-
-/* ---------------- Get/put parameters ---------------- */
-
-/* Get parameters. */
-private int
-lips4v_get_params(gx_device * dev, gs_param_list * plist)
-{
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
- int code = gdev_vector_get_params(dev, plist);
- int ncode;
- gs_param_string usern;
- gs_param_string pmedia;
-
- if (code < 0)
- return code;
-
- if ((ncode = param_write_bool(plist, LIPS_OPTION_MANUALFEED,
- &pdev->ManualFeed)) < 0)
- code = ncode;
-
- if ((ncode = param_write_int(plist, LIPS_OPTION_CASSETFEED,
- &pdev->cassetFeed)) < 0)
- code = ncode;
-
- if ((ncode = param_write_bool(plist, LIPS_OPTION_DUPLEX_TUMBLE,
- &pdev->Tumble)) < 0)
- code = ncode;
-
- if ((ncode = param_write_int(plist, LIPS_OPTION_NUP, &pdev->nup)) < 0)
- code = ncode;
-
- if ((ncode = param_write_bool(plist, LIPS_OPTION_PJL, &pdev->pjl)) < 0)
- code = ncode;
-
- if ((ncode = param_write_int(plist, LIPS_OPTION_TONERDENSITY,
- &pdev->toner_density)) < 0)
- code = ncode;
-
- if (pdev->toner_saving_set >= 0 &&
- (code = (pdev->toner_saving_set ?
- param_write_bool(plist, LIPS_OPTION_TONERSAVING,
- &pdev->
- toner_saving) : param_write_null(plist,
- LIPS_OPTION_TONERSAVING)))
- < 0)
- code = ncode;
-
- if (pdev->Duplex_set >= 0 &&
- (ncode = (pdev->Duplex_set ?
- param_write_bool(plist, "Duplex", &pdev->Duplex) :
- param_write_null(plist, "Duplex"))) < 0)
- code = ncode;
-
- if ((ncode = param_write_bool(plist, LIPS_OPTION_FONTDOWNLOAD,
- &pdev->FontDL)) < 0)
- code = ncode;
-
- if ((ncode = param_write_bool(plist, LIPS_OPTION_FACEUP,
- &pdev->faceup)) < 0) code = ncode;
-
- pmedia.data = (const byte *)pdev->mediaType,
- pmedia.size = strlen(pdev->mediaType), pmedia.persistent = false;
-
- if ((ncode = param_write_string(plist, LIPS_OPTION_MEDIATYPE,
- &pmedia)) < 0) code = ncode;
-
- if (code < 0)
- return code;
-
- usern.data = (const byte *)pdev->Username,
- usern.size = strlen(pdev->Username), usern.persistent = false;
-
- return param_write_string(plist, LIPS_OPTION_USER_NAME, &usern);
-}
-
-/* Put parameters. */
-private int
-lips4v_put_params(gx_device * dev, gs_param_list * plist)
-{
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
- int ecode = 0;
- int code;
- gs_param_name param_name;
- gs_param_string pmedia;
- bool mf = pdev->ManualFeed;
- int cass = pdev->cassetFeed;
- gs_param_string usern;
- bool tum = pdev->Tumble;
- int nup = pdev->nup;
- bool pjl = pdev->pjl;
- int toner_density = pdev->toner_density;
- bool toner_saving = pdev->toner_saving;
- bool toner_saving_set = pdev->toner_saving_set;
- bool fontdl = pdev->FontDL;
- bool faceup = pdev->faceup;
- bool duplex;
- int duplex_set = -1;
- int old_bpp = dev->color_info.depth;
- int bpp = 0;
-
- if ((code = param_read_bool(plist,
- (param_name = LIPS_OPTION_MANUALFEED),
- &mf)) < 0) {
- param_signal_error(plist, param_name, ecode = code);
- }
- switch (code = param_read_int(plist,
- (param_name = LIPS_OPTION_CASSETFEED),
- &cass)) {
- case 0:
- if (cass < -1 || cass > 17 || (cass > 3 && cass < 10))
- ecode = gs_error_limitcheck;
- else
- break;
- goto casse;
- default:
- ecode = code;
- casse:param_signal_error(plist, param_name, ecode);
- case 1:
- break;
- }
-
- switch (code = param_read_string(plist,
- (param_name = LIPS_OPTION_MEDIATYPE),
- &pmedia)) {
- case 0:
- if (pmedia.size > LIPS_MEDIACHAR_MAX)
- ecode = gs_error_limitcheck;
- else { /* Check the validity of ``MediaType'' characters */
- if (strcmp(pmedia.data, "PlainPaper") != 0 &&
- strcmp(pmedia.data, "OHP") != 0 &&
- strcmp(pmedia.data, "TransparencyFilm") != 0 && /* same as OHP */
- strcmp(pmedia.data, "GlossyFilm") != 0 &&
- strcmp(pmedia.data, "CardBoard") != 0) {
- ecode = gs_error_rangecheck;
- goto pmediae;
- }
- }
- break;
- goto pmediae;
- default:
- ecode = code;
- pmediae:param_signal_error(plist, param_name, ecode);
- case 1:
- pmedia.data = 0;
- break;
- }
-
- switch (code = param_read_string(plist,
- (param_name = LIPS_OPTION_USER_NAME),
- &usern)) {
- case 0:
- if (usern.size > LIPS_USERNAME_MAX)
- ecode = gs_error_limitcheck;
- else { /* Check the validity of ``User Name'' characters */
- int i;
-
- for (i = 0; i < usern.size; i++)
- if (usern.data[i] < 0x20 || usern.data[i] > 0x7e
- /*
- && usern.data[i] < 0xa0) ||
- usern.data[i] > 0xfe
- */
- ) {
- ecode = gs_error_rangecheck;
- goto userne;
- }
- }
- break;
- goto userne;
- default:
- ecode = code;
- userne:param_signal_error(plist, param_name, ecode);
- case 1:
- usern.data = 0;
- break;
- }
-
-
- if ((code = param_read_bool(plist,
- (param_name = LIPS_OPTION_DUPLEX_TUMBLE),
- &tum)) < 0)
- param_signal_error(plist, param_name, ecode = code);
-
-
- switch (code = param_read_int(plist,
- (param_name = LIPS_OPTION_NUP), &nup)) {
- case 0:
- if (nup != 1 && nup != 2 && nup != 4)
- ecode = gs_error_rangecheck;
- else
- break;
- goto nupe;
- default:
- ecode = code;
- nupe:param_signal_error(plist, param_name, ecode);
- case 1:
- break;
- }
-
- if ((code = param_read_bool(plist,
- (param_name = LIPS_OPTION_PJL), &pjl)) < 0)
- param_signal_error(plist, param_name, ecode = code);
-
- switch (code = param_read_int(plist,
- (param_name = LIPS_OPTION_TONERDENSITY),
- &toner_density)) {
- case 0:
- if (toner_density < 0 || toner_density > 8)
- ecode = gs_error_rangecheck;
- else
- break;
- goto tden;
- default:
- ecode = code;
- tden:param_signal_error(plist, param_name, ecode);
- case 1:
- break;
- }
-
- if (pdev->toner_saving_set >= 0)
- switch (code =
- param_read_bool(plist, (param_name = LIPS_OPTION_TONERSAVING),
- &toner_saving)) {
- case 0:
- toner_saving_set = 1;
- break;
- default:
- if ((code = param_read_null(plist, param_name)) == 0) {
- toner_saving_set = 0;
- break;
- }
- ecode = code;
- param_signal_error(plist, param_name, ecode);
- case 1:
- break;
- }
-
- if (pdev->Duplex_set >= 0) /* i.e., Duplex is supported */
- switch (code = param_read_bool(plist, (param_name = "Duplex"),
- &duplex)) {
- case 0:
- duplex_set = 1;
- break;
- default:
- if ((code = param_read_null(plist, param_name)) == 0) {
- duplex_set = 0;
- break;
- }
- ecode = code;
- param_signal_error(plist, param_name, ecode);
- case 1:
- break;
- }
- if ((code = param_read_bool(plist,
- (param_name = LIPS_OPTION_FONTDOWNLOAD),
- &fontdl)) < 0)
- param_signal_error(plist, param_name, ecode = code);
-
- if ((code = param_read_bool(plist,
- (param_name = LIPS_OPTION_FACEUP),
- &faceup)) < 0) {
- param_signal_error(plist, param_name, ecode = code);
- }
-
-
- switch (code = param_read_int(plist, (param_name = "BitsPerPixel"), &bpp)) {
- case 0:
- if (bpp != 8 && bpp != 24)
- ecode = gs_error_rangecheck;
- else
- break;
- goto bppe;
- default:
- ecode = code;
- bppe:param_signal_error(plist, param_name, ecode);
- case 1:
- break;
- }
-
- if (bpp != 0) {
- dev->color_info.depth = bpp;
- dev->color_info.num_components = ((bpp == 8) ? 1 : 3);
- dev->color_info.max_gray = (bpp > 8 ? 255 : 1000);
- dev->color_info.max_color = (bpp > 8 ? 255 : 1000);
- dev->color_info.dither_grays = (bpp > 8 ? 256 : 5);
- dev->color_info.dither_colors = (bpp > 8 ? 256 : 2);
- dev_proc(pdev, map_rgb_color) =
- ((bpp == 8) ? gx_default_gray_map_rgb_color :
- gx_default_rgb_map_rgb_color);
- dev_proc(pdev, map_color_rgb) =
- ((bpp == 8) ? gx_default_gray_map_color_rgb :
- gx_default_rgb_map_color_rgb);
- }
-
- if (ecode < 0)
- return ecode;
- code = gdev_vector_put_params(dev, plist);
- if (code < 0)
- return code;
-
- pdev->ManualFeed = mf;
- pdev->cassetFeed = cass;
- pdev->Tumble = tum;
- pdev->nup = nup;
- pdev->pjl = pjl;
- pdev->toner_density = toner_density;
- pdev->toner_saving = toner_saving;
- pdev->toner_saving_set = toner_saving_set;
- pdev->FontDL = fontdl;
- pdev->faceup = faceup;
-
- if (duplex_set >= 0) {
- pdev->Duplex = duplex;
- pdev->Duplex_set = duplex_set;
- }
- if (pmedia.data != 0 &&
- bytes_compare(pmedia.data, pmedia.size,
- (const byte *)pdev->mediaType, strlen(pdev->mediaType))
- ) {
- memcpy(pdev->mediaType, pmedia.data, pmedia.size);
- pdev->mediaType[pmedia.size] = 0;
- }
- if (usern.data != 0 &&
- bytes_compare(usern.data, usern.size,
- (const byte *)pdev->Username, strlen(pdev->Username))
- ) {
- memcpy(pdev->Username, usern.data, usern.size);
- pdev->Username[usern.size] = 0;
- }
- if (bpp != 0 && bpp != old_bpp && pdev->is_open)
- return gs_closedevice(dev);
- return 0;
-}
-
-/* ---------------- Images ---------------- */
-
-private int
-lips4v_copy_mono(gx_device * dev, const byte * data,
- int data_x, int raster, gx_bitmap_id id, int x, int y, int w,
- int h, gx_color_index zero, gx_color_index one)
-{
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- stream *s = gdev_vector_stream(vdev);
- int dpi = dev->x_pixels_per_inch;
- gx_drawing_color color;
- int code = 0;
- floatp r, g, b;
-
- if (id != gs_no_id && zero == gx_no_color_index &&
- one != gx_no_color_index && data_x == 0) {
- gx_drawing_color dcolor;
-
- color_set_pure(&dcolor, one);
-#if GS_VERSION_MAJOR >= 8
- lips4v_setfillcolor(vdev, NULL, &dcolor);
-#else
- lips4v_setfillcolor(vdev, &dcolor);
-#endif
-
- if (lips4v_copy_text_char(dev, data, raster, id, x, y, w, h) >= 0)
- return 0;
- }
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
- /*
- (*dev_proc(vdev->bbox_device, copy_mono))
- ((gx_device *)vdev->bbox_device, data, data_x, raster, id,
- x, y, w, h, zero, one);
- */
- if (zero == gx_no_color_index) {
- if (one == gx_no_color_index)
- return 0;
- /* one ¿§¤ËÀ÷¤á¡¢Æ©²á¤Ë¤¹¤ë */
- if (pdev->MaskState != 1) {
- lputs(s, "}H1");
- sputc(s, LIPS_IS2);
- pdev->MaskState = 1;
- }
- if (pdev->color_info.depth == 8) {
- gx_color_index one_color = vdev->color_info.max_gray - one;
-
- lputs(s, "}T");
- sput_lips_int(s, one_color);
- sputc(s, LIPS_IS2);
- } else {
- r = (one >> 16) * 1000.0 / 255.0;
- g = ((one >> 8) & 0xff) * 1000.0 / 255.0;
- b = (one & 0xff) * 1000.0 / 255.0;
- lputs(s, "}T");
- sput_lips_int(s, r);
- sput_lips_int(s, g);
- sput_lips_int(s, b);
- sputc(s, LIPS_IS2);
- }
- } else if (one == gx_no_color_index)
- /* 1bit ¤ÏÆ©ÌÀ ¥Ó¥Ã¥Èȿž¡¦zero ¿§¤ËÀ÷¤á¤ë */
- {
- gx_color_index zero_color = vdev->color_info.max_gray - zero;
-
- if (pdev->MaskState != 1) {
- lputs(s, "}H1");
- sputc(s, LIPS_IS2);
- pdev->MaskState = 1;
- }
- if (pdev->color_info.depth == 8) {
- lputs(s, "}T");
- sput_lips_int(s, zero_color);
- sputc(s, LIPS_IS2);
- } else {
- r = (zero >> 16) * 1000.0 / 255.0;
- g = ((zero >> 8) & 0xff) * 1000.0 / 255.0;
- b = (zero & 0xff) * 1000.0 / 255.0;
- lputs(s, "}T");
- sput_lips_int(s, r);
- sput_lips_int(s, g);
- sput_lips_int(s, b);
- sputc(s, LIPS_IS2);
- }
- } else if (one == vdev->white) {
- /* ¥Ó¥Ã¥Èȿž ÇòÅɤê zero ¿§¤ËÀ÷¤á¤ë */
- gx_color_index zero_color = vdev->color_info.max_gray - zero;
-
- if (pdev->MaskState != 0) {
- lputs(s, "}H0");
- sputc(s, LIPS_IS2);
- pdev->MaskState = 0;
- }
- if (pdev->color_info.depth == 8) {
- lputs(s, "}T");
- sput_lips_int(s, zero_color);
- sputc(s, LIPS_IS2);
- } else {
- r = (zero >> 16) * 1000.0 / 255.0;
- g = ((zero >> 8) & 0xff) * 1000.0 / 255.0;
- b = (zero & 0xff) * 1000.0 / 255.0;
- lputs(s, "}T");
- sput_lips_int(s, r);
- sput_lips_int(s, g);
- sput_lips_int(s, b);
- sputc(s, LIPS_IS2);
- }
- } else {
- if (zero != gx_no_color_index) {
- code = (*dev_proc(dev, fill_rectangle)) (dev, x, y, w, h, zero);
- if (code < 0)
- return code;
- }
- if (pdev->MaskState != 1) {
- lputs(s, "}H1");
- sputc(s, LIPS_IS2);
- pdev->MaskState = 1;
- }
- color_set_pure(&color, one);
-
-#if GS_VERSION_MAJOR >= 8
- code = gdev_vector_update_fill_color((gx_device_vector *) pdev,
- NULL, &color);
-#else
- code = gdev_vector_update_fill_color((gx_device_vector *) pdev,
- &color);
-#endif
- }
- if (code < 0)
- return 0;
- lputs(s, "}P");
- sput_lips_int(s, x); /* Position X */
- sput_lips_int(s, y); /* Position Y */
- sput_lips_int(s, dpi * 100);
- sput_lips_int(s, dpi * 100);
- sput_lips_int(s, h); /* Height */
- sput_lips_int(s, w); /* Width */
- lputs(s, "100110");
- sputc(s, LIPS_IS2);
-
- lputs(s, "}Q11");
-
- {
- int i, j;
- uint width_bytes = (w + 7) >> 3;
- uint num_bytes = round_up(width_bytes, 4) * h;
- byte *buf = gs_alloc_bytes(vdev->memory, num_bytes,
- "lips4v_copy_mono(buf)");
-
- if (data_x % 8 == 0) {
- for (i = 0; i < h; ++i) {
- memcpy(buf + i * width_bytes,
- data + (data_x >> 3) + i * raster, width_bytes);
- }
- } else {
- for (i = 0; i < h; ++i) {
- for (j = 0; j < width_bytes; j++) {
- *(buf + i * width_bytes + j) =
- *(data + (data_x >> 3) + i * raster +
- j) << (data_x % 8) | *(data + (data_x >> 3) +
- i * raster + j + 1) >> (8 -
- data_x
- % 8);
- }
- }
- }
-
-
- if (one == gx_no_color_index
- || (one == vdev->white
- && zero != gx_no_color_index)) lips4v_write_image_data(vdev,
- buf,
- num_bytes,
- TRUE);
- else
- lips4v_write_image_data(vdev, buf, num_bytes, FALSE);
-
- gs_free_object(vdev->memory, buf, "lips4v_copy_mono(buf)");
- }
-
- return 0;
-}
-
-/* Copy a color bitmap. */
-private int
-lips4v_copy_color(gx_device * dev,
- const byte * data, int data_x, int raster, gx_bitmap_id id,
- int x, int y, int w, int h)
-{
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
- gx_device_vector *const vdev = (gx_device_vector *) dev;
-
- stream *s = gdev_vector_stream(vdev);
- int depth = dev->color_info.depth;
- int dpi = dev->x_pixels_per_inch;
- int num_components = (depth < 24 ? 1 : 3);
- uint width_bytes = w * num_components;
-
-
- if (dev->color_info.depth == 8) {
- gx_drawing_color dcolor;
-
- /* LIPS IV ¤Ç¤Ï¥°¥ì¡¼¥¹¥±¡¼¥ë¤âñ¿§¥¤¥á¡¼¥¸¡¦¥«¥é¡¼»ØÄêÌ¿Îá¤Ë
- ±Æ¶Á¤µ¤ì¤ë¤Î¤Ç¹õ¿§¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ */
- color_set_pure(&dcolor, vdev->black);
-#if GS_VERSION_MAJOR >= 8
- lips4v_setfillcolor(vdev, NULL, &dcolor);
-#else
- lips4v_setfillcolor(vdev, &dcolor);
-#endif
- } else {
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
- }
-
- if (pdev->MaskState != 0) {
- lputs(s, "}H0"); /* ÏÀÍýÉÁ²èÀßÄêÌ¿Îá */
- sputc(s, LIPS_IS2);
- pdev->MaskState = 0;
- }
- lputs(s, "}P");
- sput_lips_int(s, x);
- sput_lips_int(s, y);
- sput_lips_int(s, dpi * 100);
- sput_lips_int(s, dpi * 100);
- sput_lips_int(s, h);
- sput_lips_int(s, w);
- sput_lips_int(s, depth / num_components);
- sputc(s, depth < 24 ? '0' : ':'); /* 24 bit ¤Î¤È¤­ÅÀ½ç¼¡ */
- lputs(s, "0110");
- sputc(s, LIPS_IS2);
-
- {
- int i;
- uint num_bytes = width_bytes * h;
- byte *buf = gs_alloc_bytes(vdev->memory, num_bytes,
- "lips4v_copy_color(buf)");
-
- lputs(s, "}Q11");
-
- for (i = 0; i < h; ++i) {
- memcpy(buf + i * width_bytes,
- data + ((data_x * depth) >> 3) + i * raster, width_bytes);
- }
-
- if (dev->color_info.depth == 8)
- lips4v_write_image_data(vdev, buf, num_bytes, TRUE);
- else
- lips4v_write_image_data(vdev, buf, num_bytes, FALSE);
-
- gs_free_object(vdev->memory, buf, "lips4v_copy_color(buf)");
- }
-
- return 0;
-}
-
-/* Fill a mask. */
-private int
-lips4v_fill_mask(gx_device * dev,
- const byte * data, int data_x, int raster, gx_bitmap_id id,
- int x, int y, int w, int h,
- const gx_drawing_color * pdcolor, int depth,
- gs_logical_operation_t lop, const gx_clip_path * pcpath)
-{
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
- stream *s = gdev_vector_stream(vdev);
- int dpi = dev->x_pixels_per_inch;
-
- if (w <= 0 || h <= 0)
- return 0;
- if (depth > 1 ||
-#if GS_VERSION_MAJOR >= 8
- gdev_vector_update_fill_color(vdev, NULL, pdcolor) < 0 ||
-#else
- gdev_vector_update_fill_color(vdev, pdcolor) < 0 ||
-#endif
- gdev_vector_update_clip_path(vdev, pcpath) < 0 ||
- gdev_vector_update_log_op(vdev, lop) < 0)
- return gx_default_fill_mask(dev, data, data_x, raster, id,
- x, y, w, h, pdcolor, depth, lop, pcpath);
-#if 1
- (*dev_proc(vdev->bbox_device, fill_mask))
- ((gx_device *) vdev->bbox_device, data, data_x, raster, id,
- x, y, w, h, pdcolor, depth, lop, pcpath);
-#endif
- if (id != gs_no_id && data_x == 0) {
- if (lips4v_copy_text_char(dev, data, raster, id, x, y, w, h) >= 0)
- return 0;
- }
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
- /* ½ñ¤­¤À¤· */
- if (pdev->MaskState != 1) {
- lputs(s, "}H1"); /* ÏÀÍýÉÁ²èÀßÄêÌ¿Îá */
- sputc(s, LIPS_IS2);
- pdev->MaskState = 1;
- }
- lputs(s, "}P");
- sput_lips_int(s, x);
- sput_lips_int(s, y);
- sput_lips_int(s, dpi * 100);
- sput_lips_int(s, dpi * 100);
- sput_lips_int(s, h);
- sput_lips_int(s, w);
- lputs(s, "100110");
- sputc(s, LIPS_IS2);
-
- lputs(s, "}Q11");
-
- {
- int i;
- uint width_bytes = (w + 7) >> 3;
- uint num_bytes = round_up(width_bytes, 4) * h;
- byte *buf = gs_alloc_bytes(vdev->memory, num_bytes,
- "lips4v_fill_mask(buf)");
-
- for (i = 0; i < h; ++i) {
- memcpy(buf + i * width_bytes, data + (data_x >> 3) + i * raster,
- width_bytes);
- }
-
- lips4v_write_image_data(vdev, buf, num_bytes, FALSE);
-
- gs_free_object(vdev->memory, buf, "lips4v_fill_mask(buf)");
- }
-
- return 0;
-}
-
-/* ---------------- High-level images ---------------- */
-
-private image_enum_proc_plane_data(lips4v_image_plane_data);
-private image_enum_proc_end_image(lips4v_image_end_image);
-private const gx_image_enum_procs_t lips4v_image_enum_procs = {
- lips4v_image_plane_data, lips4v_image_end_image
-};
-
-/* Start processing an image. */
-private int
-lips4v_begin_image(gx_device * dev,
- const gs_imager_state * pis, const gs_image_t * pim,
- gs_image_format_t format, const gs_int_rect * prect,
- const gx_drawing_color * pdcolor,
- const gx_clip_path * pcpath, gs_memory_t * mem,
- gx_image_enum_common_t ** pinfo)
-{
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
- gdev_vector_image_enum_t *pie =
- gs_alloc_struct(mem, gdev_vector_image_enum_t,
- &st_vector_image_enum, "lips4v_begin_image");
- const gs_color_space *pcs = pim->ColorSpace;
- gs_color_space_index index;
- int num_components = 1;
- bool can_do = prect == 0 &&
- (pim->format == gs_image_format_chunky ||
-
- pim->format == gs_image_format_component_planar);
-
- int code;
-
- if (pie == 0)
- return_error(gs_error_VMerror);
- pie->memory = mem;
- code = gdev_vector_begin_image(vdev, pis, pim, format, prect,
- pdcolor, pcpath, mem,
- &lips4v_image_enum_procs, pie);
- if (code < 0)
- return code;
- *pinfo = (gx_image_enum_common_t *) pie;
-
- if (!pim->ImageMask) {
- index = gs_color_space_get_index(pcs);
- num_components = gs_color_space_num_components(pcs);
-
- if (pim->CombineWithColor)
- can_do = false;
- else {
- switch (index) {
- case gs_color_space_index_DeviceGray:
- if ((pim->Decode[0] != 0 || pim->Decode[1] != 1)
- && (pim->Decode[0] != 1 || pim->Decode[1] != 0))
- can_do = false;
- break;
- case gs_color_space_index_DeviceRGB:
- /* LIPS ¤Ç¤Ï RGB ¤òȿž¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤ */
- if (pim->Decode[0] != 0 || pim->Decode[1] != 1 ||
- pim->Decode[2] != 0 || pim->Decode[3] != 1 ||
- pim->Decode[4] != 0)
- can_do = false;
- break;
- default:
- /*
- LIPS ¤Ç¤Ï L*a*b* ·Á¼°¤Î¥«¥é¡¼¥¹¥Ú¡¼¥¹¤¬»È¤¨¤Þ¤¹¡£
- CIEBasedABC ¤ò»È¤Ã¤Æɽ¸½¤Ç¤­¤Ê¤¤¤³¤È¤â¤Ê¤¤¤Î¤Ç¤¹¤¬¡¢
- Æ°ºî³Îǧ¤Ç¤­¤Ê¤¤¤Î¤ÇÄã¥ì¥Ù¥ë¤Î´Ø¿ô¤Ë¤Þ¤«¤»¤ë¤³¤È¤Ë
- ¤·¤Á¤ã¤¤¤Þ¤¹¡£
- ¤½¤ì¤è¤ê¤â CMYK ¤Î¥«¥é¡¼¥¹¥Ú¡¼¥¹¤¬Íߤ·¤¤...
- */
- can_do = false;
- }
- }
- }
- if (!can_do)
- return gx_default_begin_image(dev, pis, pim, format, prect,
- pdcolor, pcpath, mem,
- &pie->default_info);
- else if (index == gs_color_space_index_DeviceGray) {
- gx_drawing_color dcolor;
-
- /* LIPS IV ¤Ç¤Ï¥°¥ì¡¼¥¹¥±¡¼¥ë¤âñ¿§¥¤¥á¡¼¥¸¡¦¥«¥é¡¼»ØÄêÌ¿Îá¤Ë
- ±Æ¶Á¤µ¤ì¤ë¤Î¤Ç¹õ¿§¤òÌÀ¼¨Åª¤Ë»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ */
- color_set_pure(&dcolor, vdev->black);
-#if GS_VERSION_MAJOR >= 8
- lips4v_setfillcolor(vdev, NULL, &dcolor);
-#else
- lips4v_setfillcolor(vdev, &dcolor);
-#endif
- }
- if (pim->ImageMask || (pim->BitsPerComponent == 1 && num_components == 1)) {
- if (pim->Decode[0] > pim->Decode[1])
- pdev->MaskReverse = 1;
- else
- pdev->MaskReverse = 0;
- }
- /* Write the image/colorimage/imagemask preamble. */
- {
- stream *s = gdev_vector_stream((gx_device_vector *) pdev);
- int ax, ay, bx, by, cx, cy, dx, dy;
- int tbyte;
- gs_matrix imat;
- int interpolate = 0;
-
- if (pdev->TextMode) {
- sputc(s, LIPS_CSI);
- lputs(s, "&}");
- pdev->TextMode = FALSE;
- }
- gs_matrix_invert(&pim->ImageMatrix, &imat);
- gs_matrix_multiply(&imat, &ctm_only(pis), &imat);
- /*
- [xx xy yx yy tx ty]
- LIPS ¤ÎºÂɸ·Ï¤ËÊÑ´¹¤ò¹Ô¤Ê¤¦¡£
-
- }U{Ax}{Ay}{Bx}{By}{Cx}{Cy}{pie->height}{pie->width}
- {pim->BitsPerComponent}{0}{0}{1} LIPS_IS2
- */
-
- /* }Q110{byte} LIPS_IS2 */
- ax = imat.tx;
- ay = imat.ty;
- bx = imat.xx * pim->Width + imat.yx * pim->Height + imat.tx;
- by = imat.xy * pim->Width + imat.yy * pim->Height + imat.ty;
- cx = imat.yx * pim->Height + imat.tx;
- cy = imat.yy * pim->Height + imat.ty;
- dx = imat.xx * pim->Width + imat.tx;
- dy = imat.xy * pim->Width + imat.ty;
-
- if (pim->ImageMask) {
- tbyte =
- (pie->width * pim->BitsPerComponent +
- 7) / 8 * num_components * pie->height;
- pdev->ncomp = 1;
- if (tbyte == 1) {
- /* LIPS IV ¤Ç¤Ï 1 dot ¤Î¥¤¥á¡¼¥¸¤òÊÑ·Á¤¹¤ë¤ÈºÂɸ¤¬¶¸¤¦¥Ð¥°¤¬
- ¤¢¤ë¡£¤è¤Ã¤Æ 1 dot ¤Î¥¤¥á¡¼¥¸¤Ï¶ë·Á¤È¤·¤Æ½èÍý¤¹¤ë¡£ */
- pdev->OneBitMask = true;
- /* Draw Rectangle */
- lputs(s, "2");
- sput_lips_int(s, ax);
- sput_lips_int(s, ay);
- sput_lips_int(s, cx - ax);
- sput_lips_int(s, cy - ay);
- sput_lips_int(s, bx - cx);
- sput_lips_int(s, by - cy);
- sput_lips_int(s, dx - bx);
- sput_lips_int(s, dy - by);
- sputc(s, LIPS_IS2);
- return 0;
- } else {
- /* ÉÁ²èÏÀÍýÀßÄêÌ¿Îá - Æ©²á */
- if (pdev->MaskState != 1) {
- lputs(s, "}H1");
- sputc(s, LIPS_IS2);
- pdev->MaskState = 1;
- }
- }
- } else {
- /* ÉÁ²èÏÀÍýÀßÄêÌ¿Îá - ÇòÅɤê */
- if (pdev->MaskState != 0) {
- lputs(s, "}H0");
- sputc(s, LIPS_IS2);
- pdev->MaskState = 0;
- }
- pdev->ncomp = num_components;
- }
-
- lputs(s, "}U");
- sput_lips_int(s, ax);
- sput_lips_int(s, ay);
- sput_lips_int(s, bx);
- sput_lips_int(s, by);
- sput_lips_int(s, cx);
- sput_lips_int(s, cy);
- sput_lips_int(s, pie->height);
- sput_lips_int(s, pie->width);
- sput_lips_int(s, pim->BitsPerComponent);
-
- if (pim->Interpolate) {
- if (pim->BitsPerComponent * pie->num_planes == 1)
- interpolate = 1;
- else
- interpolate = 3;
- }
- if (pim->ImageMask) { /* 1bit ¤Î¤È¤­ */
- lputs(s, "0");
- } else {
- if (index == gs_color_space_index_DeviceGray)
- lputs(s, "0");
- else {
- if (format == gs_image_format_chunky) /* RGBRGBRGB... */
- sputc(s, 0x3a);
- else /* RRR...GGG...BBB... */
- sputc(s, 0x3b);
- }
- }
- if (interpolate > 0)
- sput_lips_int(s, interpolate);
- sputc(s, LIPS_IS2);
- }
- return 0;
-}
-
-/* Process the next piece of an image. */
-private int
-lips4v_image_plane_data(gx_image_enum_common_t * info,
- const gx_image_plane_t * planes, int height,
- int *rows_used)
-{
- gx_device *dev = info->dev;
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
- gdev_vector_image_enum_t *pie = (gdev_vector_image_enum_t *) info;
-
- stream *s = gdev_vector_stream((gx_device_vector *) pdev);
- int y;
-
- if (pdev->OneBitMask) {
- /*
- lputs(s, "\200");
- */
- pie->y += height;
- return 1;
- }
- if (pie->default_info)
- return gx_image_plane_data(pie->default_info, planes, height);
- gx_image_plane_data(pie->bbox_info, planes, height);
- {
- int plane;
- int width_bytes, tbyte;
- byte *buf;
-
- width_bytes =
- (pie->width * pie->bits_per_pixel / pdev->ncomp +
- 7) / 8 * pdev->ncomp;
- tbyte = width_bytes * height;
- buf = gs_alloc_bytes(vdev->memory, tbyte, "lips4v_image_data(buf)");
-
- for (plane = 0; plane < pie->num_planes; ++plane)
- for (y = 0; y < height; ++y) {
- memcpy(buf + y * width_bytes,
- planes[plane].data +
- ((planes[plane].data_x * pie->bits_per_pixel) >> 3)
- + y * planes[plane].raster, width_bytes);
- }
-
- lputs(s, "}Q10");
-
- if ((pie->bits_per_pixel > 1 && pdev->ncomp == 1) ||
- pdev->MaskReverse == 0) {
- lips4v_write_image_data(vdev, buf, tbyte, TRUE);
- } else
- lips4v_write_image_data(vdev, buf, tbyte, FALSE);
-
- gs_free_object(vdev->memory, buf, "lips4v_image_data(buf)");
-
- }
-
- return (pie->y += height) >= pie->height;
-}
-
-private int
-lips4v_image_end_image(gx_image_enum_common_t * info, bool draw_last)
-{
- gx_device *dev = info->dev;
- gx_device_vector *const vdev = (gx_device_vector *) dev;
- gx_device_lips4v *const pdev = (gx_device_lips4v *) dev;
- gdev_vector_image_enum_t *pie = (gdev_vector_image_enum_t *) info;
- stream *s = gdev_vector_stream((gx_device_vector *) pdev);
- int code;
-
- if (pdev->OneBitMask)
- pdev->OneBitMask = false;
- else
- lputs(s, "}Q1100");
- sputc(s, LIPS_IS2); /* End of Image */
-
- pdev->MaskReverse = -1;
-
- code = gdev_vector_end_image(vdev, (gdev_vector_image_enum_t *) pie,
- draw_last, pdev->white);
- return code;
-}
diff --git a/gs/contrib/lips4/gdevlips.c b/gs/contrib/lips4/gdevlips.c
deleted file mode 100644
index 2da00d68f..000000000
--- a/gs/contrib/lips4/gdevlips.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/* Copyright (C) 1998, 1999 Norihito Ohmori.
-
- Ghostscript printer driver
- for Canon LBP and BJ printers (LIPS II+/III/IVc/IV)
-
- This software 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 GNU General Public License for full details.
-
- Everyone is granted permission to copy, modify and redistribute
- this software, but only under the conditions described in the GNU
- General Public License. A copy of this license is supposed to have been
- given to you along with this software 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.
- */
-
-/*$Id: gdevlips.c,v 1.3 2002/07/20 21:03:21 tillkamppeter Exp $ */
-/* Common Utility for LIPS driver */
-
-#include "gx.h"
-#include "gdevlips.h"
-
-typedef struct {
- int width;
- int height;
- int num_unit;
-} paper_table;
-
-static paper_table lips_paper_table[] =
-{
- {842, 1190, 12}, /* A3 */
- {595, 842, 14}, /* A4 */
- {597, 842, 14}, /* A4 8.3 inch x 11.7 inch */
- {421, 595, 16}, /* A5 */
- {284, 419, 18}, /* PostCard */
- {729, 1032, 24}, /* JIS B4 */
- {516, 729, 26}, /* JIS B5 */
- {363, 516, 28}, /* JIS B6 */
- {612, 792, 30}, /* Letter */
- {612, 1008, 32}, /* Legal */
- {792, 1224, 34}, /* Ledger */
- {522, 756, 40}, /* Executive */
- {298, 666, 50}, /* envyou4 */
- {0, 0, 80}, /* User Size */
-};
-
-int
-lips_media_selection(int width, int height)
-{
- int landscape = 0;
- int tmp;
- paper_table *pt;
-
- if (width > height) {
- landscape = 1;
- tmp = width;
- width = height;
- height = tmp;
- }
- for (pt = lips_paper_table; pt->num_unit < 80; pt++)
- if (pt->width == width && pt->height == height)
- break;
-
- return pt->num_unit + landscape;
-}
-
-private int GetNumSameData(const byte * curPtr, const int maxnum);
-private int GetNumWrongData(const byte * curPtr, const int maxnum);
-
-/* This routine talkes from LipsIVRunLengthEncode in Yoshiharu ITO's patch */
-int
-lips_packbits_encode(byte * inBuff, byte * outBuff, int Length)
-{
- int size = 0;
-
- while (Length) {
- int count;
-
- if (1 < (count = GetNumSameData(inBuff,
- Length > 128 ? 128 : Length))) {
- Length -= count;
- size += 2;
-
- *outBuff++ = -(count - 1);
- *outBuff++ = *inBuff;
- inBuff += count;
- } else {
- count = GetNumWrongData(inBuff, Length > 128 ? 128 : Length);
- Length -= count;
- size += count + 1;
-
- *outBuff++ = count - 1;
- while (count--) {
- *outBuff++ = *inBuff++;
- }
- }
- }
-
- return (size);
-}
-
-/* LIPS III printer can no use Runlength encode mode
- but Mode 1-3 Format mode. */
-/* This routine takes from LipsIIIRunLengthEncode in Yoshiharu ITO's patch */
-int
-lips_mode3format_encode(byte * inBuff, byte * outBuff, int Length)
-{
- int size = 0;
-
- while (Length) {
- int count;
-
- if (1 < (count = GetNumSameData(inBuff,
- Length > 257 ? 257 : Length))) {
- Length -= count;
- size += 3;
-
- *outBuff++ = *inBuff;
- *outBuff++ = *inBuff;
- *outBuff++ = count - 2;
- inBuff += count;
- } else {
- count = GetNumWrongData(inBuff, Length);
- Length -= count;
- size += count;
-
- while (count--) {
- *outBuff++ = *inBuff++;
- }
- }
- }
-
- return (size);
-}
-
-private int
-GetNumSameData(const byte * curPtr, const int maxnum)
-{
- int count = 1;
-
- if (1 == maxnum) {
- return (1);
- }
- while (*curPtr == *(curPtr + count) && maxnum > count) {
- count++;
- }
-
- return (count);
-}
-
-private int
-GetNumWrongData(const byte * curPtr, const int maxnum)
-{
- int count = 0;
-
- if (1 == maxnum) {
- return (1);
- }
- while (*(curPtr + count) != *(curPtr + count + 1) && maxnum > count) {
- count++;
- }
-
- return (count);
-}
-
-
-/*
-
- This routine takes from gdevlips4-1.1.0.
-
- */
-#define RLECOUNTMAX 0xff /* 256 times */
-int
-lips_rle_encode(byte * inBuff, byte * outBuff, int Length)
-{
- int i = 0;
- byte value;
- int count = 0;
- byte *ptr = inBuff;
-
- value = *ptr;
- ptr++;
-
- while (ptr < inBuff + Length) {
- if (*ptr == value) {
- count++;
- if (count > RLECOUNTMAX) {
- *outBuff++ = RLECOUNTMAX;
- *outBuff++ = value;
- i += 2;
- count = 0;
- }
- } else {
- *outBuff++ = count;
- *outBuff++ = value;
- i += 2;
- count = 0;
- value = *ptr;
- }
- ptr++;
- }
- *outBuff++ = count;
- *outBuff++ = value;
- i += 2;
-
- return i;
-}
diff --git a/gs/contrib/lips4/gdevlips.h b/gs/contrib/lips4/gdevlips.h
deleted file mode 100644
index 0236115a8..000000000
--- a/gs/contrib/lips4/gdevlips.h
+++ /dev/null
@@ -1,197 +0,0 @@
-/* Copyright (C) 1998, 1999 Norihito Ohmori.
-
- Ghostscript printer driver
- for Canon LBP, BJC-680J and BJC-880J printers (LIPS II+/III/IVc/IV)
-
- This software 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 GNU General Public License for full details.
-
- Everyone is granted permission to copy, modify and redistribute
- this software, but only under the conditions described in the GNU
- General Public License. A copy of this license is supposed to have been
- given to you along with this software 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.
- */
-
-/*$Id: gdevlips.h,v 1.4 2002/10/12 23:24:34 tillkamppeter Exp $ */
-/* Common header file for LIPS driver */
-
-#define LIPS_ESC 0x1b
-#define LIPS_FF 0x0c
-#define LIPS_CSI 0x9b /* LIPS_ESC "[" */
-#define LIPS_DCS 0x90 /* LIPS_ESC "P" */
-#define LIPS_ST 0x9c /* LIPS_ESC "\\" */
-#define LIPS_SP 0x20
-#define LIPS_IS1 0x1f
-#define LIPS_IS2 0x1e
-
-#define TRUE 1
-#define FALSE 0
-
-/* Media Size */
-#define LIPS_A3_HEIGHT 1190
-#define LIPS_A3_WIDTH 842
-#define LIPS_A4_HEIGHT LIPS_A3_WIDTH
-#define LIPS_A4_WIDTH 595
-#define LIPS_A5_HEIGHT LIPS_A4_WIDTH
-#define LIPS_A5_WIDTH 421
-#define LIPS_POSTCARD_HEIGHT 419
-#define LIPS_POSTCARD_WIDTH 284
-#define LIPS_B4_HEIGHT 1032
-#define LIPS_B4_WIDTH 729
-#define LIPS_B5_HEIGHT LIPS_B4_WIDTH
-#define LIPS_B5_WIDTH 516
-#define LIPS_B6_HEIGHT LIPS_B5_WIDTH
-#define LIPS_B6_WIDTH 363
-#define LIPS_LETTER_HEIGHT 792
-#define LIPS_LETTER_WIDTH 612
-#define LIPS_LEGAL_HEIGHT 1008
-#define LIPS_LEGAL_WIDTH LIPS_LETTER_WIDTH
-#define LIPS_LEDGER_HEIGHT 1224
-#define LIPS_LEDGER_WIDTH LIPS_LETTER_HEIGHT
-#define LIPS_EXECTIVE_HEIGHT 756
-#define LIPS_EXECTIVE_WIDTH 522
-#define LIPS_ENVYOU4_HEIGHT 666
-#define LIPS_ENVYOU4_WIDTH 298
-
-#define LIPS_HEIGHT_MAX LIPS_A3_HEIGHT
-#define LIPS_WIDTH_MAX LIPS_A3_WIDTH
-#define LIPS_HEIGHT_MIN LIPS_POSTCARD_HEIGHT
-#define LIPS_WIDTH_MIN LIPS_POSTCARD_WIDTH
-
-#define LIPS_HEIGHT_MAX_720 11905 /* =420mm */
-#define LIPS_WIDTH_MAX_720 8418 /* =294mm */
-
-#define LIPS_MAX_SIZE 51840 /* 72 inch */
-
-#define GS_A4_WIDTH 597
-#define GS_A4_HEIGHT 841
-
-#define MMETER_PER_INCH 25.4
-
-#define A3_SIZE 12
-#define A4_SIZE 14
-#define A5_SIZE 16
-#define POSTCARD_SIZE 18
-#define B4_SIZE 24
-#define B5_SIZE 26
-#define B6_SIZE 28
-#define LETTER_SIZE 30
-#define LEGAL_SIZE 32
-#define LEDGER_SIZE 34
-#define EXECUTIVE_SIZE 40
-#define ENVYOU4_SIZE 50
-#define USER_SIZE 80
-
-#define LANDSCAPE 1
-
-#define LIPS_MANUALFEED_DEFAULT FALSE
-#define LIPS_CASSETFEED_DEFAULT 0
-/* 0, 1 to 3, 10 to 17 (1 to 3 is not reccomended. It's obsoleted value.) */
-/* 0: Auto Feed */
-/* 1: MP tray, 2: Lower casset, 3: Upper casset */
-/* 10: MP tray, 11: casset 1, 12: casset 2, 13: casset 3, .... */
-
-#define LIPS_TUMBLE_DEFAULT FALSE
-#define LIPS_NUP_DEFAULT 1
-#define LIPS_PJL_DEFAULT FALSE
-#define LIPS_FACEUP_DEFAULT FALSE
-
-/* display text to printer panel */
-#define LIPS_USERNAME_MAX 12 /* If your printer have two line display,
- this value can change to 14 */
-#define LIPS_MEDIACHAR_MAX 32
-#define LIPS_USERNAME_DEFAULT "Ghostscript"
-#define LIPS_MEDIATYPE_DEFAULT "Default" /* Dummy */
-#define LIPS2P_COMPRESS_DEFAULT FALSE
-#define LIPS3_COMPRESS_DEFAULT FALSE
-#define LIPS4C_COMPRESS_DEFAULT TRUE
-#define LIPS4_COMPRESS_DEFAULT FALSE
-
-#define LIPS2P_DPI_DEFAULT 240
-#define LIPS2P_LEFT_MARGIN_DEFAULT 5. / MMETER_PER_INCH
-#define LIPS2P_BOTTOM_MARGIN_DEFAULT 5. / MMETER_PER_INCH
-#define LIPS2P_RIGHT_MARGIN_DEFAULT 5. / MMETER_PER_INCH
-#define LIPS2P_TOP_MARGIN_DEFAULT 5. / MMETER_PER_INCH
-
-#define LIPS3_DPI_DEFAULT 300
-#define LIPS3_LEFT_MARGIN_DEFAULT 5. / MMETER_PER_INCH
-#define LIPS3_BOTTOM_MARGIN_DEFAULT 5. / MMETER_PER_INCH
-#define LIPS3_RIGHT_MARGIN_DEFAULT 5. / MMETER_PER_INCH
-#define LIPS3_TOP_MARGIN_DEFAULT 5. / MMETER_PER_INCH
-
-#define BJC880J_DPI_DEFAULT 360
-#define BJC880J_LEFT_MARGIN_DEFAULT 5. / MMETER_PER_INCH
-#define BJC880J_BOTTOM_MARGIN_DEFAULT 8. / MMETER_PER_INCH
-#define BJC880J_RIGHT_MARGIN_DEFAULT 5. / MMETER_PER_INCH
-#define BJC880J_TOP_MARGIN_DEFAULT 2. / MMETER_PER_INCH
-
-#define LIPS4_DPI_DEFAULT 600
-
-#define LIPS4_LEFT_MARGIN_DEFAULT 5. / MMETER_PER_INCH
-#define LIPS4_BOTTOM_MARGIN_DEFAULT 5. / MMETER_PER_INCH
-#define LIPS4_RIGHT_MARGIN_DEFAULT 5. / MMETER_PER_INCH
-#define LIPS4_TOP_MARGIN_DEFAULT 5. / MMETER_PER_INCH
-
-/* Define the default resolutions. */
-
-#define LIPS2P_DPI1 80
-#define LIPS2P_DPI2 120
-#define LIPS2P_DPI_MAX 240
-#define LIPS3_DPI_MAX 300
-#define BJC880J_DPI_MAX 360
-#define LIPS4_DPI_MAX 600
-#define LIPS4_DPI_SUPERFINE 1200
-#define LIPS_DPI_MIN 60
-
-#define LIPS2P_STRING "lips2p:"
-#define LIPS3_STRING "lips3:"
-#define LIPS4_STRING "lips4:"
-#define BJC880J_STRING "bjc880j:"
-#define L4VMONO_STRING "lips4v:"
-#define L4VCOLOR_STRING "lips4vc:"
-#define LIPS_VERSION "2.3.6"
-/* ``LIPS*_STRING'' + ``VERSION string'' < 17 characters */
-
-#define LIPS_OPTION_MANUALFEED "ManualFeed"
-#define LIPS_OPTION_CASSETFEED "Casset"
-#define LIPS_OPTION_USER_NAME "UserName"
-#define LIPS_OPTION_PJL "PJL"
-
-/* LIPS IV Option */
-#define LIPS_OPTION_DUPLEX_TUMBLE "Tumble"
-#define LIPS_OPTION_NUP "Nup"
-#define LIPS_OPTION_TONERDENSITY "TonerDensity"
-#define LIPS_OPTION_TONERSAVING "TonerSaving"
-#define LIPS_OPTION_FONTDOWNLOAD "FontDL"
-#define LIPS_OPTION_FACEUP "OutputFaceUp"
-#define LIPS_OPTION_MEDIATYPE "MediaType"
-
-#define lips_params_common \
- int cassetFeed; /* Input Casset */ \
- char Username[LIPS_USERNAME_MAX]; /* Display text on printer panel */\
- bool pjl; \
- int toner_density;\
- bool toner_saving;\
- bool toner_saving_set;\
- int prev_paper_size; \
- int prev_paper_width; \
- int prev_paper_height; \
- int prev_num_copies; \
- int prev_feed_mode
-
-#define lips4_params_common \
- int prev_duplex_mode;\
- int nup;\
- bool faceup;\
- char mediaType[LIPS_MEDIACHAR_MAX]
-
-int lips_media_selection(int width, int height);
-int lips_packbits_encode(byte * inBuff, byte * outBuff, int Length);
-int lips_mode3format_encode(byte * inBuff, byte * outBuff, int Length);
-int lips_rle_encode(byte * inBuff, byte * outBuff, int Length);
diff --git a/gs/contrib/lips4/gdevlprn.c b/gs/contrib/lips4/gdevlprn.c
deleted file mode 100644
index 5aca154c3..000000000
--- a/gs/contrib/lips4/gdevlprn.c
+++ /dev/null
@@ -1,433 +0,0 @@
-/* Copyright (C) 1999 Norihito Ohmori.
-
- Ghostscript laser printer driver supporting Library.
-
- This software 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 GNU General Public License for full details.
-
- Everyone is granted permission to copy, modify and redistribute
- this software, but only under the conditions described in the GNU
- General Public License. A copy of this license is supposed to have been
- given to you along with this software 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.
- */
-
-/*$Id: gdevlprn.c,v 1.3 2002/07/20 21:03:21 tillkamppeter Exp $ */
-/* Library for Laser Printer Driver */
-
-/*
- Main part of this library was taked from Hiroshi Narimatsu's
- Ghostscript driver, epag-3.08.
- <ftp://ftp.humblesoft.com/pub/epag-3.08.tar.gz>
- */
-
-/*
- ************************
- * This Library Options *
- ************************
-
- -dTumble : for Duplex
- true: short edge binding, false: long edge binding
- the default is false.
- -dBlockLine=number : number of line to make output area.
- -dBlockWidth=number : rectangle width for output area.
- -dBlockHeight=number : rectangle height for output area.
- -dShowBubble : Draw rectangles, output area.
- */
-
-#include "gdevlprn.h"
-
-/* ------ Get/put parameters ------ */
-
-/* Get parameters. Laser Printer devices add several more parameters */
-/* to the default Printer Device set. */
-int
-lprn_get_params(gx_device * dev, gs_param_list * plist)
-{
- gx_device_lprn *const lprn = (gx_device_lprn *) dev;
- int code = gdev_prn_get_params(dev, plist);
- int ncode;
-
- if (code < 0)
- return code;
-
- if ((ncode = param_write_bool(plist, "ManualFeed", &lprn->ManualFeed)) < 0)
- code = ncode;
-
- if ((ncode = param_write_bool(plist, "NegativePrint", &lprn->NegativePrint)) < 0)
- code = ncode;
-
- if ((ncode = param_write_bool(plist, "Tumble", &lprn->Tumble)) < 0)
- code = ncode;
-
- if ((ncode = param_write_bool(plist, "RITOff", &lprn->RITOff)) < 0)
- code = ncode;
-
- if ((ncode = param_write_int(plist, "BlockLine", &lprn->BlockLine)) < 0)
- code = ncode;
-
- if ((ncode = param_write_int(plist, "BlockWidth", &lprn->nBw)) < 0)
- code = ncode;
-
- if ((ncode = param_write_int(plist, "BlockHeight", &lprn->nBh)) < 0)
- code = ncode;
-
- if ((ncode = param_write_bool(plist, "ShowBubble", &lprn->ShowBubble)) < 0)
- code = ncode;
-
- return code;
-}
-
-/* Put properties. */
-int
-lprn_put_params(gx_device * dev, gs_param_list * plist)
-{
- gx_device_lprn *const lprn = (gx_device_lprn *) dev;
- int ecode = 0;
- int code;
- gs_param_name param_name;
- bool ManualFeed = lprn->ManualFeed;
- bool NegativePrint = lprn->NegativePrint;
- bool Tumble = lprn->Tumble;
- bool RITOff = lprn->RITOff;
- int BlockLine = lprn->BlockLine;
- int BlockWidth = lprn->nBw;
- int BlockHeight = lprn->nBh;
- bool ShowBubble = lprn->ShowBubble;
-
- if ((code = param_read_bool(plist,
- (param_name = "ManualFeed"),
- &ManualFeed)) < 0) {
- param_signal_error(plist, param_name, ecode = code);
- }
-
- if ((code = param_read_bool(plist,
- (param_name = "NegativePrint"),
- &NegativePrint)) < 0) {
- param_signal_error(plist, param_name, ecode = code);
- }
- if ((code = param_read_bool(plist,
- (param_name = "Tumble"),
- &Tumble)) < 0) {
- param_signal_error(plist, param_name, ecode = code);
- }
- if ((code = param_read_bool(plist,
- (param_name = "RITOff"),
- &RITOff)) < 0) {
- param_signal_error(plist, param_name, ecode = code);
- }
- switch (code = param_read_int(plist,
- (param_name = "BlockWidth"),
- &BlockWidth)) {
- case 0:
- if (BlockWidth < 0)
- ecode = gs_error_rangecheck;
- else
- break;
- goto bwidthe;
- default:
- ecode = code;
- bwidthe:param_signal_error(plist, param_name, ecode = code);
- case 1:
- break;
- }
-
- switch (code = param_read_int(plist,
- (param_name = "BlockLine"),
- &BlockLine)) {
- case 0:
- if (BlockLine < 0)
- ecode = gs_error_rangecheck;
- else
- break;
- goto crowe;
- default:
- ecode = code;
- crowe:param_signal_error(plist, param_name, ecode = code);
- case 1:
- break;
- }
-
- switch (code = param_read_int(plist,
- (param_name = "BlockHeight"),
- &BlockHeight)) {
- case 0:
- if (BlockHeight < 0)
- ecode = gs_error_rangecheck;
- else
- break;
- goto bheighte;
- default:
- ecode = code;
- bheighte:param_signal_error(plist, param_name, ecode = code);
- case 1:
- break;
- }
-
- if ((code = param_read_bool(plist,
- (param_name = "ShowBubble"),
- &ShowBubble)) < 0) {
- param_signal_error(plist, param_name, ecode = code);
- }
- if (ecode < 0)
- return ecode;
- code = gdev_prn_put_params(dev, plist);
- if (code < 0)
- return code;
-
- lprn->ManualFeed = ManualFeed;
- lprn->NegativePrint = NegativePrint;
- lprn->Tumble = Tumble;
- lprn->RITOff = RITOff;
- lprn->BlockLine = BlockLine;
- lprn->nBw = BlockWidth;
- lprn->nBh = BlockHeight;
- lprn->ShowBubble = ShowBubble;
-
- return 0;
-}
-
-private void lprn_bubble_flush_all(gx_device_printer * pdev, FILE * fp);
-private void lprn_process_line(gx_device_printer * pdev, FILE * fp, int r, int h);
-private void lprn_bubble_flush(gx_device_printer * pdev, FILE * fp, Bubble * bbl);
-private int lprn_is_black(gx_device_printer * pdev, int r, int h, int bx);
-private void lprn_bubble_gen(gx_device_printer * pdev, int x0, int x1, int y0, int y1);
-private void lprn_rect_add(gx_device_printer * pdev, FILE * fp, int r, int h, int start, int end);
-
-int
-lprn_print_image(gx_device_printer * pdev, FILE * fp)
-{
- gx_device_lprn *const lprn = (gx_device_lprn *) pdev;
- int y;
- int bpl = gdev_mem_bytes_per_scan_line(pdev);
- Bubble *bbtbl;
- Bubble *bbl;
- int i;
- int ri, rmin, read_y;
- int code = 0;
- Bubble *bubbleBuffer;
- int maxBx, maxBy, maxY;
- int start_y_block = 0; /* start of data in buffer */
- int num_y_blocks = 0; /* number of data line [r:r+h-1] */
-
- maxBx = (bpl + lprn->nBw - 1) / lprn->nBw;
- maxBy = (pdev->height + lprn->nBh - 1) / lprn->nBh;
- maxY = lprn->BlockLine / lprn->nBh * lprn->nBh;
-
- if (!(lprn->ImageBuf = gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), bpl, maxY, "lprn_print_image(ImageBuf)")))
- return_error(gs_error_VMerror);
- if (!(lprn->TmpBuf = gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), bpl, maxY, "lprn_print_iamge(TmpBuf)")))
- return_error(gs_error_VMerror);
- if (!(lprn->bubbleTbl = gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), sizeof(Bubble *), maxBx, "lprn_print_image(bubbleTbl)")))
- return_error(gs_error_VMerror);
- if (!(bubbleBuffer = gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), sizeof(Bubble), maxBx, "lprn_print_image(bubbleBuffer)")))
- return_error(gs_error_VMerror);
-
- for (i = 0; i < maxBx; i++)
- lprn->bubbleTbl[i] = NULL;
- bbtbl = bubbleBuffer;
-
- for (i = 0; i < maxBx - 1; i++)
- bbtbl[i].next = &bbtbl[i + 1];
- bbtbl[i].next = NULL;
- lprn->freeBubbleList = &bbtbl[0];
-
- for (y = 0; y < maxBy; y++) {
- if (num_y_blocks + lprn->nBh > maxY) { /* bubble flush for next data */
- rmin = start_y_block + lprn->nBh; /* process the data under rmin */
- for (i = 0; i < maxBx; i++) {
- bbl = lprn->bubbleTbl[i];
- if (bbl != NULL && bbl->brect.p.y < rmin)
- lprn_bubble_flush(pdev, fp, bbl);
- }
- num_y_blocks -= lprn->nBh; /* data if keeps in [r:r+h] */
- start_y_block += lprn->nBh;
-
- }
- ri = start_y_block + num_y_blocks; /* read position */
- read_y = ri % maxY; /* end of read position */
- code = gdev_prn_copy_scan_lines(pdev, ri, lprn->ImageBuf + bpl * read_y, bpl * lprn->nBh);
- if (code < 0)
- return code;
-
- num_y_blocks += lprn->nBh;
-
- lprn_process_line(pdev, fp, start_y_block, num_y_blocks);
- }
- lprn_bubble_flush_all(pdev, fp); /* flush the rest of bubble */
-
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), lprn->ImageBuf, bpl, maxY, "lprn_print_image(ImageBuf)");
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), lprn->TmpBuf, bpl, maxY, "lprn_print_iamge(TmpBuf)");
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), lprn->bubbleTbl, sizeof(Bubble *), maxBx, "lprn_print_image(bubbleTbl)");
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), bubbleBuffer, sizeof(Bubble), maxBx, "lprn_print_image(bubbleBuffer)");
-
- return code;
-}
-
-
-/*
- * epag_bubble_flush_all: Output the rect of bubble.
- */
-private void
-lprn_bubble_flush_all(gx_device_printer * pdev, FILE * fp)
-{
- gx_device_lprn *const lprn = (gx_device_lprn *) pdev;
- int i = 0;
- int bpl = gdev_mem_bytes_per_scan_line(pdev);
- int maxBx = (bpl + lprn->nBw - 1) / lprn->nBw;
-
- for (i = 0; i < maxBx; i++) {
- if (lprn->bubbleTbl[i] != NULL) {
- lprn_bubble_flush(pdev, fp, lprn->bubbleTbl[i]);
- } else
- break;
- }
-}
-
-/*
- * Process bh lines raster data.
- */
-private void
-lprn_process_line(gx_device_printer * pdev, FILE * fp, int r, int h)
-{
- gx_device_lprn *const lprn = (gx_device_lprn *) pdev;
-
- int bx, bInBlack, bBlack, start;
- int bpl = gdev_mem_bytes_per_scan_line(pdev);
- int maxBx = (bpl + lprn->nBw - 1) / lprn->nBw;
-
- bInBlack = 0;
- for (bx = 0; bx < maxBx; bx++) {
- bBlack = lprn_is_black(pdev, r, h, bx);
- if (!bInBlack) {
- if (bBlack) {
- start = bx;
- bInBlack = 1;
- }
- } else {
- if (!bBlack) {
- bInBlack = 0;
- lprn_rect_add(pdev, fp, r, h, start, bx);
- }
- }
- }
- if (bInBlack)
- lprn_rect_add(pdev, fp, r, h, start, bx - 1);
-}
-
-/* Search the bx line to make output */
-private int
-lprn_is_black(gx_device_printer * pdev, int r, int h, int bx)
-{
- gx_device_lprn *const lprn = (gx_device_lprn *) pdev;
-
- int bh = lprn->nBh;
- int bpl = gdev_mem_bytes_per_scan_line(pdev);
- int x, y, y0;
- byte *p;
- int maxY = lprn->BlockLine / lprn->nBh * lprn->nBh;
-
- y0 = (r + h - bh) % maxY;
- for (y = 0; y < bh; y++) {
- p = &lprn->ImageBuf[(y0 + y) * bpl + bx * lprn->nBw];
- for (x = 0; x < lprn->nBw; x++)
- if (p[x] != 0)
- return 1;
- }
- return 0;
-}
-
-private void
-lprn_rect_add(gx_device_printer * pdev, FILE * fp, int r, int h, int start, int end)
-{
- gx_device_lprn *const lprn = (gx_device_lprn *) pdev;
-
- int x0 = start * lprn->nBw;
- int x1 = end * lprn->nBw - 1;
- int y0 = r + h - lprn->nBh;
- int y1 = y0 + lprn->nBh - 1;
- int i;
- Bubble *bbl;
-
- if ((bbl = lprn->bubbleTbl[start]) != NULL &&
- bbl->brect.q.y == y0 - 1 &&
- bbl->brect.p.x == x0 &&
- bbl->brect.q.x == x1) {
- bbl->brect.q.y = y1;
- } else {
- for (i = start; i <= end; i++)
- if (lprn->bubbleTbl[i] != NULL)
- lprn_bubble_flush(pdev, fp, lprn->bubbleTbl[i]);
- lprn_bubble_gen(pdev, x0, x1, y0, y1);
- }
-}
-
-private void
-lprn_bubble_gen(gx_device_printer * pdev, int x0, int x1, int y0, int y1)
-{
- gx_device_lprn *const lprn = (gx_device_lprn *) pdev;
-
- Bubble *bbl;
- int bx0, bx1, bx;
-
- assert(lprn->freeBubbleList != NULL);
-
- bbl = lprn->freeBubbleList;
- lprn->freeBubbleList = bbl->next;
-
- bbl->brect.p.x = x0;
- bbl->brect.q.x = x1;
- bbl->brect.p.y = y0;
- bbl->brect.q.y = y1;
-
- bx0 = x0 / lprn->nBw;
- bx1 = (x1 + lprn->nBw - 1) / lprn->nBw;
-
- for (bx = bx0; bx <= bx1; bx++) {
- assert(lprn->bubbleTbl[bx] == NULL);
- lprn->bubbleTbl[bx] = bbl;
- }
-}
-
-/* make output */
-void
-lprn_bubble_flush(gx_device_printer * pdev, FILE * fp, Bubble * bbl)
-{
- gx_device_lprn *const lprn = (gx_device_lprn *) pdev;
- int i, j, bx;
- byte *p;
- int bx0 = bbl->brect.p.x / lprn->nBw;
- int bx1 = (bbl->brect.q.x + lprn->nBw - 1) / lprn->nBw;
- int bpl = gdev_mem_bytes_per_scan_line(pdev);
- int x = bbl->brect.p.x * 8;
- int y = bbl->brect.p.y;
- int width = (bbl->brect.q.x - bbl->brect.p.x + 1) * 8;
- int height = bbl->brect.q.y - bbl->brect.p.y + 1;
- int maxY = lprn->BlockLine / lprn->nBh * lprn->nBh;
-
- for (i = 0; i < height; i++) {
- p = lprn->ImageBuf + ((i + y) % maxY) * bpl;
- for (j = 0; j < width / 8; j++) {
- if (lprn->NegativePrint)
- *(lprn->TmpBuf + i * width / 8 + j) = ~*(p + j + bbl->brect.p.x);
- else
- *(lprn->TmpBuf + i * width / 8 + j) = *(p + j + bbl->brect.p.x);
- }
- }
-
- (*lprn->image_out) (pdev, fp, x, y, width, height);
-
- /* Initialize bubbleTbl */
- for (bx = bx0; bx <= bx1; bx++) {
- assert(lprn->bubbleTbl[bx] == bbl);
- lprn->bubbleTbl[bx] = NULL;
- }
-
- bbl->next = lprn->freeBubbleList;
- lprn->freeBubbleList = bbl;
-}
diff --git a/gs/contrib/lips4/gdevlprn.h b/gs/contrib/lips4/gdevlprn.h
deleted file mode 100644
index a7fb57e01..000000000
--- a/gs/contrib/lips4/gdevlprn.h
+++ /dev/null
@@ -1,199 +0,0 @@
-/* Copyright (C) 1999 Norihito Ohmori.
-
- Ghostscript laser printer driver supprting Library.
-
- This software 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 GNU General Public License for full details.
-
- Everyone is granted permission to copy, modify and redistribute
- this software, but only under the conditions described in the GNU
- General Public License. A copy of this license is supposed to have been
- given to you along with this software 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.
- */
-
-/*$Id: gdevlprn.h,v 1.4 2002/10/12 23:24:34 tillkamppeter Exp $ */
-/* Library for Laser Printer Driver */
-
-/*
- Main part of this library was taked from Hiroshi Narimatsu's
- Ghostscript driver, epag-3.08.
- <ftp://ftp.humblesoft.com/pub/epag-3.08.tar.gz>
- */
-
-#include "gdevprn.h"
-
-#if GS_VERSION_MAJOR >= 8
-#define lprn_dev_proc_image_out(proc)\
- void proc(gx_device_printer *, FILE *, int, int, int, int)
-#else
-#define lprn_dev_proc_image_out(proc)\
- void proc(P6(gx_device_printer *, FILE *, int, int, int, int))
-#endif
-
-#define dev_proc_image_out(proc) lprn_dev_proc_image_out(proc)
-
-#define gx_lprn_device_common\
- lprn_dev_proc_image_out((*image_out));\
- bool initialized;\
- bool ManualFeed;\
- bool NegativePrint;\
- bool Tumble; /* for Duplex */\
- bool RITOff; /* currently only escpage.dev use this */\
- int prev_x;\
- int prev_y;\
- int BlockLine;\
- byte *ImageBuf; /* Image Buffer */\
- byte *TmpBuf; /* Tmporary buffer */\
- byte *CompBuf; /* Compress buffer */\
- byte *CompBuf2; /* Compress buffer */\
- int nBw; /* block width (byte,8dot) */\
- int nBh; /* block height(line) */\
- struct _Bubble **bubbleTbl;\
- struct _Bubble *freeBubbleList;\
- bool ShowBubble
-
-#define lp_device_body_rest_(print_page_copies, image_out)\
- { 0 }, /* std_procs */\
- { 0 }, /* skip */\
- { NULL,\
- print_page_copies,\
- { gx_default_create_buf_device,\
- gx_default_size_buf_device,\
- gx_default_setup_buf_device,\
- gx_default_destroy_buf_device\
- },\
- gdev_prn_default_get_space_params,\
- gx_default_start_render_thread,\
- gx_default_open_render_device,\
- gx_default_close_render_device,\
- gx_default_buffer_page\
- },\
- { PRN_MAX_BITMAP, PRN_BUFFER_SPACE,\
- { BAND_PARAMS_INITIAL_VALUES },\
- 0/*false*/, /* params_are_read_only */\
- BandingAuto /* banding_type */\
- },\
- { 0 }, /* fname */\
- 0/*false*/, /* OpenOutputFile */\
- 0/*false*/, /* ReopenPerPage */\
- 0/*false*/, -1, /* Duplex[_set] */\
- 0/*false*/, 0, 0, 0, /* file_is_new ... buf */\
- 0, 0, 0, 0, 0/*false*/, 0, 0, /* buffer_memory ... clist_dis'_mask */\
- { 0 }, /* ... orig_procs */\
- image_out,\
- 0/*false*/, /* initialized */\
- 0/*false*/, /* ManualFeed */\
- 0/*false*/, /* NegativePrint */\
- 0/*false*/, /* Tumble */\
- 0/*false*/, /* RITOff */\
- 0, 0,\
- 256,\
- NULL, NULL, NULL, NULL,\
- 4,\
- 32,\
- NULL, NULL,\
- 0 /*false */
-
-#define lp_duplex_device_body_rest_(print_page_copies, image_out)\
- { 0 }, /* std_procs */\
- { 0 }, /* skip */\
- { NULL,\
- print_page_copies,\
- { gx_default_create_buf_device,\
- gx_default_size_buf_device,\
- gx_default_setup_buf_device,\
- gx_default_destroy_buf_device\
- },\
- gdev_prn_default_get_space_params,\
- gx_default_start_render_thread,\
- gx_default_open_render_device,\
- gx_default_close_render_device,\
- gx_default_buffer_page\
- },\
- { PRN_MAX_BITMAP, PRN_BUFFER_SPACE,\
- { BAND_PARAMS_INITIAL_VALUES },\
- 0/*false*/, /* params_are_read_only */\
- BandingAuto /* banding_type */\
- },\
- { 0 }, /* fname */\
- 0/*false*/, /* OpenOutputFile */\
- 0/*false*/, /* ReopenPerPage */\
- 0/*false*/, 0, /* Duplex[_set] */\
- 0/*false*/, 0, 0, 0, /* file_is_new ... buf */\
- 0, 0, 0, 0, 0/*false*/, 0, 0, /* buffer_memory ... clist_dis'_mask */\
- { 0 }, /* ... orig_procs */\
- image_out,\
- 0/*false*/, /* initialized */\
- 0/*false*/, /* ManualFeed */\
- 0/*false*/, /* NegativePrint */\
- 0/*false*/, /* Tumble */\
- 0/*false*/, /* RITOff */\
- 0, 0,\
- 256,\
- NULL, NULL, NULL, NULL,\
- 4,\
- 32,\
- NULL, NULL,\
- 0 /*false */
-
-#define lprn_device(dtype, procs, dname, xdpi, ydpi, lm, bm, rm, tm, color_bits,\
- print_page_copies, image_out)\
-{ std_device_std_color_full_body(dtype, &procs, dname,\
- (int)((long)(DEFAULT_WIDTH_10THS) * (xdpi) / 10),\
- (int)((long)(DEFAULT_HEIGHT_10THS) * (ydpi) / 10),\
- xdpi, ydpi, color_bits,\
- -(lm) * (xdpi), -(tm) * (ydpi),\
- (lm) * 72.0, (bm) * 72.0,\
- (rm) * 72.0, (tm) * 72.0\
- ),\
- lp_device_body_rest_(print_page_copies, image_out)\
-}
-
-#define lprn_duplex_device(dtype, procs, dname, xdpi, ydpi, lm, bm, rm, tm, color_bits,\
- print_page_copies, image_out)\
-{ std_device_std_color_full_body(dtype, &procs, dname,\
- (int)((long)(DEFAULT_WIDTH_10THS) * (xdpi) / 10),\
- (int)((long)(DEFAULT_HEIGHT_10THS) * (ydpi) / 10),\
- xdpi, ydpi, color_bits,\
- -(lm) * (xdpi), -(tm) * (ydpi),\
- (lm) * 72.0, (bm) * 72.0,\
- (rm) * 72.0, (tm) * 72.0\
- ),\
- lp_duplex_device_body_rest_(print_page_copies, image_out)\
-}
-
-#define lprn_procs(p_open, p_output_page, p_close)\
- prn_params_procs(p_open, p_output_page, p_close, lprn_get_params, lprn_put_params)
-
-typedef struct _Bubble
-{
- struct _Bubble *next;
- gs_int_rect brect;
-}
-Bubble;
-
-typedef struct gx_device_lprn_s gx_device_lprn;
-struct gx_device_lprn_s
-{
- gx_device_common;
- gx_prn_device_common;
- gx_lprn_device_common;
-};
-
-#define ESC 0x1b /* \033 */
-#define GS 0x1d /* \035 */
-
-#ifndef assert
-# define assert(x)
-#endif
-
-dev_proc_get_params(lprn_get_params);
-dev_proc_put_params(lprn_put_params);
-
-int lprn_print_image(gx_device_printer * pdev, FILE * fp);
diff --git a/gs/contrib/lxm3200-tweaked/LICENSE b/gs/contrib/lxm3200-tweaked/LICENSE
deleted file mode 100644
index b8512125b..000000000
--- a/gs/contrib/lxm3200-tweaked/LICENSE
+++ /dev/null
@@ -1,342 +0,0 @@
-
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 675 Mass Ave, Cambridge, MA 02139, USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- Appendix: How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) 19yy name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
-
-
diff --git a/gs/contrib/lxm3200-tweaked/README b/gs/contrib/lxm3200-tweaked/README
deleted file mode 100644
index 55fb1562f..000000000
--- a/gs/contrib/lxm3200-tweaked/README
+++ /dev/null
@@ -1,88 +0,0 @@
-
-Lexmark 3200 ghostscript driver for Linux
-=========================================
-
-by Daniel Gordini (dgordin@tin.it)
-
-http://www.geocities.com/dgordini
-
-
-
- Version 0.4.1 - Dec 19, 2000
-
-
-These are the quick instructions needed to recompile a version
-of Ghostscript >=7.00 for Linux that supports this driver.
-The instruction assume you will use the "unix-gcc.mak" makefile,
-i.e. you are using gcc on a Unix system to compile Ghostscript.
-This is of course true for Linux.
-
-Instructions:
-
-1) Obtain and unpack the Ghostscript source distribution.
-
-2) Copy the driver source (gdevlx32.c) into the gsX.YZ/src
- directory (e.g. gs7.05/src).
-
-3) Modify the "contrib.mak" file as stated in the "Drivers.htm"
- documentation file, adding the following lines at the end:
-
-
-## --- Add everything down from here, this line excluded --- ##
-
-
-### ---------------- Lexmark 3200 device ----------------- ###
-
-lxm3200_=$(GLOBJ)gdevlx32.$(OBJ)
-
-$(DD)lxm3200.dev: $(lxm3200_) $(DD)page.dev
- $(SETPDEV) $(DD)lxm3200 $(lxm3200_)
-
-$(GLOBJ)gdevlx32.$(OBJ): $(GLSRC)gdevlx32.c $(PDEVH) $(gsparam_h)
- $(GLCC) $(GLO_)gdevlx32.$(OBJ) $(C_) $(GLSRC)gdevlx32.c
-
-
-## --- Add everything up to here, this line excluded --- ##
-
- The blanks must be made by one or more TABs, and not by spaces.
- This is important: if you put spaces there, the compilation will stop
- with a "missing separator" error.
-
-4) Modify the "unix-gcc.mak" file including the driver name shown above in
- the list of the drivers to compile. To do it, first look for the line
- which starts "DEVICE_DEVS6=". It should contain a list of driver names,
- such as "$(DD)bj10e.dev", "$(DD)bjc600.dev" and so on.
- It is very likely that the list is broken in more than one line.
- Please note that each line, except the last, ends with a "\" (backslash)
- character. This is the continuation character, and it means that the list
- does not end with the "newline" character but continues on the next line.
- If the backslash is there, it MUST ALWAYS be the last character of the line:
- there must be no spaces, tabs or any other character between the backslash
- and the newline.
- Add the device name "$(DD)lxm3200.dev" at the end of the last line.
- Be careful not to put it after a backslash.
-
-5) Recompile ghostscript with the command "make -f src/unix-gcc.mak"
- from the top of the unpacked ghostscript source tree.
-
-6) Install the freshly compiled version of ghostscript, using the command
- "make -f src/unix-gcc.mak install"
-
-7) Enjoy your Lexmark 3200!
-
-Additional notes:
-
-1) The easiest way to install this driver is by using the current
- ESP Ghostscript which incorporates the latest version.
- Just do a usual configuration, e.g.
- ./configure --prefix=/usr/local --with-fontpath=/usr/local/share/ghostscript/fonts
- and then make; make install.
-
-2) Now the driver supports the Lexmark Z12 and Z31 (for additional informations
- see the RELEASE_NOTES).
-
-If you have problems compiling Ghostscript, you should be able to solve them
-by reading carefully the documentation, expecially the section "Adding a
-driver" in the "Drivers.htm" file. DO NOT ASK ME FOR HELP IN COMPILING
-GHOSTSCRIPT, unless the compilation error is generated in the driver's file
-itself (that is gdevlx32.c).
diff --git a/gs/contrib/lxm3200-tweaked/RELEASE_NOTES b/gs/contrib/lxm3200-tweaked/RELEASE_NOTES
deleted file mode 100644
index 653ba5ffa..000000000
--- a/gs/contrib/lxm3200-tweaked/RELEASE_NOTES
+++ /dev/null
@@ -1,225 +0,0 @@
-
-Release notes for the Lexmark 3200 printer driver version 0.4.1
-December 21, 2000
-
-Copyright 2000 Daniele Gordini (dgordin@tin.it)
-
-This program is released under the terms of the GNU GPL.
-
-
-INTRODUCTION
-============
-
-This version is an almost complete rewrite of the driver, that adds
-(hopefully) increased stability and more features.
-The main differences between this release and the 0.3 releases are:
-
-1) Changed syntax: now there is only one device name and a parameter
- to select between monochromatic, color and photoquality printing.
-
-2) Much more robust printing: it *should* now be able to print all kind
- of pages, even very complex ones. I did not have any problem with any
- printout using this version, but obviously this doesn't mean it's
- perfect. It can be it will broke at your first attempt to print
- something, simply it's likely it will work pretty well.
-
-3) Support for 300, 600 and 1200 dpi resolution, both horizontal and
- vertical. Horizontal and vertical resolutions are independent, thus
- allowing for a total of 9 different resolution modes. Of course not
- all of them make sense (300x1200 for instance) but they are selectable
- nonetheless.
- IMPORTANT: Ghostscript uses a simple ordered dithering that does not
- take into account interlaced resolutions (i.e. resolutions where dots
- partially overlap, like all the Lexmark 3200 resolutions that have 1200
- dpi either horizontally or vertically). The result is that at 1200 dpi
- Ghostscript lays down *way* too much ink *way* too fast, leaving the
- paper soaked and causing ink smearing.
- The problem can be partially worked around by adjusting the gamma value
- to a lighter setting and/or by increasing the number of print passes
- (see below). The real solution would be to use a proper dithering
- algorithm: this is not trivial, and it will be cared for in the next
- release. By now this driver will work at its best at 600 dpi.
-
-4) Bidirectional printing for fastproofing. This still has issues with pass
- aligment that affect output quality, so I am confining this feature to
- draft output. The problem is that, as of now, I was able to obtain an
- output that is perfectly aligned either on the left or the right side but
- not on both. Even the Windows driver does have problems with bidirectional
- alignment, so I suspect that there is some kind of hardware problem.
- Anyway the output of the Windows driver looks better aligned than the
- output of my driver, so it appears there is room for improvement here.
-
-5) Multipass printing for lesser ink smearing. Using more than one pass has
- the main effect of reducing the speed at which the ink is dropped on the
- paper, thus allowing it to dry somewhat before adding more ink.
- This feature was provided for non-absorbing (i.e. coated) paper, but with
- the current unoptimized dithering algorithm the highest resolution modes
- (that would gain more benefit from it) don't really improve much.
-
-6) Now the printing margins are set as the printer's manual says they must be
- set (well, almost...). This means no more printing on the whole page, but
- it also means that what is inside the margins should be printed better.
- Note that, according to the manual, there are two sets of side margins: one
- used for A4 paper and one used for every other size (namely letter). I don't
- think this makes sense, but I need to study the issue more carefully, so
- for this release I will do as the manual says. And the third set of margins,
- the one used for envelopes, it's plainly ignored because this release does
- not explicitly support envelopes. This does not mean you won't be able to
- print on envelopes: it only means I've not tried to do it, so I won't
- assure anything.
-
-7) The driver supports the Lexmark Z12 and Z31 via the -dmodel parameter
- (see below). In the case of the Z12 only B&W printing was tested.
-
-KNOWN ISSUES
-============
-
-This driver is technically robust, but it still has 3 issues about the
-printout quality that need to be solved. All three directly descend from
-the fact that the routine used to do the dithering is the standard routine
-supplied by Ghostscript, which has limitations. The issues are:
-
-1) Ink density is fixed, so at 1200 dpi, where dots partially overlap, the
- paper gets soaked with ink and the printout is *way* too dark. You can
- alleviate the soaking problem by using more passes and by disabling
- bidirectional mode (if it was enabled in the first place), but don't
- expect too much from these solutions. The sad truth is that at 1200
- dpi you need to do a real lot of manual tweaking on the originating
- program (gamma value, luminosity, etc.) to make the output usable.
-
-2) Dithering algorithm is fixed to ordered, so line art printouts look
- pretty good (the Ghostscript examples, for instance), but photographic
- printouts doesn't...
-
-3) There is no color correction, so colors are quite often pretty wrong.
-
-I hope to solve most or all of these problems by releasing a version of
-the driver that plugs into the gimp-print project, using their dithering
-code (which is more general and better quality than ghostscript's one).
-
-
-PARAMETERS FOR THE DRIVER
-=========================
-
-BEWARE: in Ghostscript, parameter names are always case sensitive!
-
-Device name:
-------------
-
-Now there is only one device name: lxm3200, without the trailing letter.
-So the ghostscript invocation will always contain the option:
-
- -sDEVICE=lxm3200
-
-NOTE: this change will break the modified RedHat printtool that was
-distribuited with the version 0.3 of the driver. There is an upgrade
-package for printtool and printfilters on the download page that
-will make things work again, but YOU NEED TO REMOVE ALL THE
-CONFIGURED PRINTERS THAT USE THE OLD DRIVER BEFORE UPGRADING and then
-reinstall the printers after the upgrade.
-
-Printer model selection:
-------------------------
-
-The driver supports the following printers: Lexmark 3200, Z12 and Z31.
-The model must be selected with the "model" parameter.
--dmodel=0 -> Lexmark 3200 (this is the default).
--dmodel=1 -> Lexmark Z12 (discovered by Boer Attila)
--dmodel=2 -> Lexmark Z31 (discovered by Tomas Groth)
-
-Printing mode selection:
-------------------------
-
-Since there is only one device now, a new parameter has been added to
-select between the three printing modes. The parameter name is "mode",
-and it should be added to the Ghostscript invocation as follows:
-
- -dmode=<num>
-
-Where <num> is 0 to select monochromatic printing, 1 to select standard
-color printing (the default) and 2 to select photoquality printing.
-
-
-Printing resolution settings:
------------------------------
-
-The resolution is selected using the standard Ghostscript option "-rHxV",
-where H is the horizontal resolution and V the vertical one, both in DPI.
-The default is the native resolution (600x600) and legal values for H and V
-are 300, 600 and 1200, in any combination. No error is issued if a different
-number is specified: any setting below 450 is snapped to 300 dpi, a setting
-between 450 and 900 is snapped to 600 dpi and anything above 900 is snapped
-to 1200 dpi.
-
-
-Bidirectional printing:
------------------------
-
-The parameter "bidir" selects if bidirectional printing is in effect.
-Bidirectional improves speed but it has an effect on quality, so I
-strongly advice to use it only in draft mode. The default is "off",
-and it can be turned on or off adding on the ghostscript command line
-the option:
-
- -dbidir=<num>
-
-where "num" is 0 for monodirectional printing or 1 for bidirectional.
-
-
-Multipass printing:
--------------------
-
-The parameter "numpass" allows to specify the number of passes to do on
-each stripe, to slow down the printing. The invocation will be:
-
- -dnumpass=<num>
-
-where <num> is the number of passes, ranging from 1 (the default) to 16.
-Please note that usually each line is printed in a single pass, with the
-exception of the 1200 dpi resolutions: 1200 dpi horizontal requires two
-passes, 1200 dpi vertical requires two passes as well, and so 1200x1200
-requires a total of four passes. The value of <num> MULTIPLIES this, so
-setting a <num> of 3 at 1200x1200 dpi will result in a total of 12 passes.
-
-
-Alignment values:
------------------
-
-These are the same as of previous versions. They are all passed to the
-driver by defining them in a "-d" option.
-
- -dAlgnA=<num>
-
-This is the horizontal alignment between left and right cartridge. If you
-notice that there is an horizontal misalignment between black and color
-parts of the same printout, this is the value to change. The default is
-16 and the allowed range for <num> goes from 0 to 30. Obviously, in
-monochrome printing this value is not used at all.
-
- -dAlgnB=<num>
-
-This is the same as AlgnB, but for vertical alignment. You need to change
-this value if you notice vertical misalignments between black and color.
-The default value is 8 and <num> can go from 0 to 15. In monochrome printing
-this value is not used.
-
- -dAlgnC=<num>
-
-This sets the value of the distance between the even and odd nozzle columns
-of the left cartridge (black or photo). You need to change this if you see
-misalignments between black parts OF THE SAME STRIPE. The default value is
-16, and <num> can go from 0 to 30.
-
- -dAlgnD=<num>
-
-This sets the value of the distance between the even and odd nozzle columns
-of the right cartridge (color). You need to change this if you see
-misalignments between color parts OF THE SAME STRIPE. The default value is
-16, and <num> can go from 0 to 30.
-
-Additional margin for the Z31:
-------------------------------
-
-Because there are small differences between different Z31 models,
-we need a parameter which introduce an additional margin (default is 100).
- -dz31m=<num>
diff --git a/gs/contrib/lxm3200-tweaked/Z12-Z31-QuickSetup b/gs/contrib/lxm3200-tweaked/Z12-Z31-QuickSetup
deleted file mode 100644
index c2a0c5bb1..000000000
--- a/gs/contrib/lxm3200-tweaked/Z12-Z31-QuickSetup
+++ /dev/null
@@ -1,58 +0,0 @@
-
-Quick installation instructions for the Lexmark Z12 or Z31 printer under Linux
-------------------------------------------------------------------------------
-
-For those who don't want to read the Ghostscript and CUPS documentation
-I will provide here some short instructions.
-
-I suppose you don't have CUPS and ESP Ghostscript installed on your system.
-You need the followings:
-- CUPS (the current version is 1.1.18)
-- ESP Ghostscript (current CVS version: espgs-7.05.6-source.tar.bz2)
-- PPD file from www.linuxprinting.org
-- cupsomatic Perl script from www.linuxprinting.org
-
-1) Compile CUPS
- ./configure --prefix=/usr --exec-prefix=/usr --localstatedir=/var \
- --sysconfdir=/etc &&
- make && make install
-
-2) Extract the ESP Ghostscript source.
- Replace the gdevlx32.c from the gsX.YZ/src directory with the one
- provided with this tarball.
- Now we are ready to compile Ghostscript.
- ./configure --prefix=/usr/local --with-fontpath=/usr/local/share/ghostscript/fonts &&
- make && make install
-
-3) Copy the PPD file (Lexmark-Z12-lxm3200-tweaked.ppd or
- Lexmark-Z31-lxm3200-tweaked.ppd) to
- /usr/share/cups/model
- chmod a+r Lexmark-Z12-lxm3200-tweaked.ppd
- or
- chmod a+r Lexmark-Z31-lxm3200-tweaked.ppd
-
-4) Copy the cupsomatic Perl script to /usr/lib/cups/filter
- chmod 755 cupsomatic
-
-5) Now we are ready to start CUPS:
- /etc/rc.d/init.d/cups start or /etc/init.d/cups start
-
-6) Open your favorite web browser and connect to http://localhost:631.
- From the graphical CUPS configuration tool add a new printer.
- Select the "Lexmark Z12, lxm3200-tweaked" or
- "Lexmark Z31, lxm3200-tweaked" from the list.
- If everything went well now you can print a test page.
- Remember that I have tested only B&W printing. If you select color,
- I cannot guarantee anything.
-
-Enjoy the Lexmark Z12/Z31 printing under Linux !
-
-Note that the lxm3200 driver was written by Daniel Gordini,
-so all credits go to him.
-
-If you have problems setting up the Z12 or Z31, first of all read the CUPS
-and ESP Ghostscript documentation. If you are sure that the problem is
-connected with the driver, please contact us.
-
-Boer Attila (Z12) (boera@unitbv.ro)
-Tomas Groth (Z31) (tomasgroth@hotmail.com)
diff --git a/gs/contrib/md2k_md5k/README.jis b/gs/contrib/md2k_md5k/README.jis
deleted file mode 100644
index a17f2d228..000000000
--- a/gs/contrib/md2k_md5k/README.jis
+++ /dev/null
@@ -1,179 +0,0 @@
-
- ALPS MD series printer driver for Ghostscript 5.xx
-
- 1999/ 4/18
- 1999/ 5/ 2 $B99?7(B
-
-$B35MW(B
----
- $BK\%I%i%$%P$O(B Ghostscript 5.10/5.50(/5.82) $B$G(B ALPS MD $B%7%j!<%:%W%j%s%?!<$N(B
-$B=PNO$r$9$k$?$a$N%I%i%$%P$G$9!#0J2<$N$h$&$J5!G=$rHw$($F$$$^$9!#(B
-
- $B%+%i!<!?%b%N%/%m0u:~$,2DG=(B
- 300dpi, 600dpi, 1200x600dpi $B$KBP1~(B
- $BMQ;f$N<oN`!&%5%$%:$N;XDj$,2DG=(B
- Floyd-Steinberg dithering $B$,2DG=(B
- dithering $B;HMQ;~$K?'$NG;EYD4@0$,2DG=(B
-
-$B8=:_!"(BMD-2000/2010/4000/1300/1500/5000 $B$GF0:n$,3NG'$5$l$F$$$^$9!#(B(md2k$B$N$_(B)
-
-
-$B%$%s%9%H!<%k(B
----
-1. ghostscript $B$r%3%s%Q%$%k$9$k$N$KI,MW$J%=!<%9N`$rE83+$7!"(B
- $BE,59I,MW$J%Q%C%A$rEv$F$^$9!#(B
-2. gdevmd2k.c $B$r(B gs $B$N%=!<%9$N$"$k%G%#%l%/%H%j$K%3%T!<$7$^$9!#(B
-3. gs5.10 $B$N>l9g$O!"(Bgdevmd2k.dev $B$r(B Makefile $B$KDI2C$7$^$9!#(B
- gs5.50 $B$N>l9g$O!"(Bgdevmd2k.mak-5.50 $B$r(B contrib.mak $B$KDI2C$7$^$9!#(B
- (gs5.8x $B$N>l9g$O!"(Bgdevmd2k.mak-5.8x $B$r(B contrib.mak $B$KDI2C(B)
-4. $B<+J,$N%5%$%HMQ$K(B Makefile $B$rD4@0$7!"(B DEVICE_DEVS $B$K(B md2k.dev $B$rDI2C$7$^$9!#(B
- MD-5000 $B$r;HMQ$9$k>l9g$O!"(Bmd5k.dev $B$rDI2C$7$^$9!#(B
-5. make
-
-
-$B;HMQJ}(B
----
- $B%G%P%$%9$N;XDj(B
- gs $B$r<B9T$9$k:]$K!"(B-sDEVICE $B%*%W%7%g%s$G0J2<$N$$$:$l$+$N%G%P%$%9$r(B
- $BA*Br$9$k$3$H$G!"(BALPS MD $B%W%j%s%?!<MQ$N=PNO$,@8@.$5$l$^$9!#(B
-
- -sDEVICE=md2k
- MD-2000/4000/1000 $BEy!"(BMD-5000 $B0JA0$N(B MD $B%7%j!<%:$KBP1~$7$?(B
- $B7A<0$N=PNO$r9T$$$^$9!#(B(MD-5000 $B$G$b=PNO2DG=$G$9(B)
- -sDEVICE=md5k
- MD-5000 $B@lMQ$N7A<0$G=PNO$7$^$9!#%(%3%V%i%C%/%b!<%I$r;HMQ$9$k(B
- $B>l9g$O!"$3$A$i$r;XDj$9$kI,MW$,$"$j$^$9!#(B
- ($BCm(B) md5k.dev $B$O(B99/5/2$B8=:_!"<B:]$N%W%j%s%?!<$G%F%9%H$5$l$F$$$^$;$s!#(B
- MD-5000 $B$G!"K\%G%P%$%9$r%F%9%H$7$F2<$5$C$?J}$O@'Hs7k2L$r(B
- $B$*CN$i$;2<$5$$!#(B
-
- $B%+%i!<!?%b%N%/%m!&(Bdithering $B$NA*Br(B
- -dBitsPerPixel=1 $BDL>o$N%b%N%/%m0u:~(B
- -dBitsPerPixel=4 $BDL>o$N%+%i!<0u:~(B (default)
- -dBitsPerPixel=8 Floyd-Steinberg dithering $B$rMQ$$$?%b%N%/%m0u:~(B
- -dBitsPerPixel=32 Floyd-Steinberg dithering $B$rMQ$$$?%+%i!<0u:~(B
-
- ($BNc(B) tiger.ps $B$r%b%N%/%m!&(Bdithering $B;HMQ$G=PNO(B
- gs -q -dNOPAUSE -sDEVICE=md2k -dBitsPerPixel=8 \
- -sOutputFile=- tiger.ps -c quit | lpr
-
- -dColor, -dDither $B$r;HMQ$7$F$bF1MM$N@_Dj$,2DG=$G$9!#(B
- -dColor=false $B%b%N%/%m(B
- -dColor(=true) $B%+%i!<(B
- -dDither=false dithering$B$7$J$$(B
- -dDither(=true) dithering $B$r;HMQ(B
-
- * $B%+%i!<0u:~$rA*Br$7$F$b(B PS $B%U%!%$%k$,%b%N%/%m$N>l9g$K$O!"(B
- CMY$B$N%$%s%/%j%\%s$O;HMQ$7$^$;$s!#(B
- * dithering $B$r;HMQ$9$l$P!"<L??Ey$N2hA|$O$h$je:No$K0u:~$5$l$k$O$:(B
- $B$G$9$,!"2hA|$K$h$C$F$O;HMQ$7$J$$J}$,e:No$J>l9g$b$"$j$^$9!#(B
-
- $B2rA|EY$NA*Br(B
- -r300 300dpi
- -r600 600dpi (default)
- -r1200x600 1200x600dpi
-
- ($BNc(B) 1200x600dpi $B$G=PNO(B
- gs -q -dNOPAUSE -sDEVICE=md2k -r1200x600 -dBitsPerPixel=1 \
- -sOutputFile=- tiger.ps -c quit | lpr
-
- * MD-2000 $B$G$b!"%+%i!<(B 1200x600dpi $B$,0l1~;XDj$G$-$^$9$,!"(B
- $B2h<A$O$[$H$s$I(B 600dpi $B$HJQ$o$j$^$;$s!#(B
-
- $BMQ;f;XDj(B
- $BMQ;f$N<oN`$r;XDj$7$^$9!#(BWindows $B$N%I%i%$%P$H0[$J$j!"(B
- $B2rA|EY$OMQ;f$N<oN`$+$i<+F0E*$K7hDj$5$l$^$;$s!#(B
- $B2rA|EY$O(B -r $B%*%W%7%g%s$GJLES;XDj$7$F2<$5$$!#(B
- ($BCm(B) $B%"%$%m%s%7!<%k!"%l%Y%+%U%j!<Ey!"F0:n3NG'$7$F$$$J$$$b$N$b(B
- $B$"$j$^$9!#(B
-
- -sMediaType=PlainPaper $B%3%T!<;f(B (default)
- -sMediaType=IronSeal $B%"%$%m%s%7!<%k(B
- -sMediaType=RebecaFree $B%l%Y%+%U%j!<(B
- -sMediaType=CardBoard $B8|;f(B
- -sMediaType=PostCard $B$O$,$-(B
- -sMediaType=FinePaper $B>e<A;f(B
- -sMediaType=CoatedFilm $B8wBt%U%#%k%`(B
- -sMediaType=GlossyPaper $B8wBt;f(B
- -sMediaType=TransparencyFilm OHP$BMQ;f(B (MD-2000 $B0J30(B)
- -sMediaType=OHP $B!7(B
- -sMediaType=OHP_MD2000 OHP (MD-2000$B$G@lMQ%$%s%/$r;HMQ$9$k>l9g(B)
-
- $BMQ;f%5%$%:$N;XDj(B
- -sPAPERSIZE=letter $B%l%?!<%5%$%:(B
- -sPAPERSIZE=a4 A4
- -sPAPERSIZE=b5 B5
- -sPAPERSIZE=postcard $B$O$,$-(B (*)
- -d.MediaSize='{xx yy}' $BG$0U%5%$%:$N;XDj(B (xx, yy $B$O(B 1/72 inch)
-
- (*) gdevlips $B$K4^$^$l$k(B gs_statd.ps $B$N%Q%C%A$rEv$F$?>l9g$K(B
- $B;HMQ2DG=(B
-
- $B?'$NG;EYD4@0(B
- dithering $B$r;HMQ$9$k>l9g$N$_!"0J2<$N(Boption$B$GG;C8$ND4@0$,2DG=!#(B
- $B?t$,Bg$-$$Dx!"?'$,G;$/=PNO$5$l$^$9!#(B
-
- -dBlack=0-2048 (default 1024)
- -dCyan=0-2048 (default 1024)
- -dMagenta=0-2048 (default 1024)
- -dYellow=0-2048 (default 1024)
-
- ($BNc(B) $B%7%"%s$rG;$/!"%^%<%s%?$rGv$/0u:~$9$k(B
- gs -q -dNOPAUSE -sDEVICE=md2k -dBitsPerPixel=32 \
- -dCyan=1200 -dMagenta=800 -sOutputFile=- tiger.ps -c quit
-
- $B$=$NB>(B
- -dManualFeed $B<j:9$70u:~$9$k>l9g$K;XDj$7$^$9!#(B
-
- -dEcoBlack $B%(%3%V%i%C%/0u:~$r9T$$$^$9!#(B
- $B%G%P%$%9$K(B md5k $B$r;HMQ$7$?;~$N$_M-8z$G$9!#(B
-
- -dReverseSide $BN"LL$K0u:~$r9T$&:]$K!"%+!<%k6:@5$r6X;_$9$k$?$a(B
- $B;XDj$7$^$9!#(B
-
-
-$BJQ99MzNr(B
----
-1999-05-02 Ver.0.2a
- * MD-5000 $BMQ%G%P%$%9(B md5k $B$NDI2C(B
- * $BMQ;f;XDj%*%W%7%g%s(B -sMediaType $B$NDI2C(B
- * $B%*%W%7%g%s(B -dManualFeed, -dEcoBlack, -dReverseSide $B$NDI2C(B
- * $B%+%i!<!&(Bdithering $B$NM-L5$r(B -dBitsPerPixel $B$G;XDj$9$k$h$&(B
- README $B$rJQ99(B
- * -dColor, -dDither $B$r(B int $B7?$+$i(B bool $B7?$KJQ99(B
- * -dBitsPerPixel=1 $B$N;~!"M>Gr$r%9%-%C%W$7$J$$%P%0$r=$@5(B
- * $BMQ;f%5%$%:$K(B letter $B$rDI2C(B
- * MD-2000 $B$G$N(B OHP $B=PNO$KBP1~(B
-
-1999-04-18 Ver.0.1
- * MD-2000 $BBP1~$N(B gdevmd2k-0.1 $B$r8x3+(B
-
-
-TODO (or NOT TODO ?)
----
-* $B8wBt0u:~$J$IFC<l$J%b!<%I$X$NBP1~(B
-* dithering $B;~$N2h<A$N8~>e(B
-
-
-$B<U<-(B
----
- Floyd-Steinberg dithering $B$N%"%k%4%j%:%`$O!"(BGeorge Cameron $B;a$N=q$+$l$?(B
- gdevcdj.c $B$r;29M$K$5$;$FD:$-$^$7$?!#(B
-
- MD-5000 $BMQ%I%i%$%P(B gdevalps $B$N:n<T(B Shinya Umino$B$5$s$+$i$O(B
- MD-5000 $B$G$NF0:nJs9p$HK\%I%i%$%P$K4X$9$k8f0U8+$rD:$-$^$7$?!#(B
- $BK\%I%i%$%P$N(B MD-5000 $BBP1~ItJ,$O(B gdevalps $B$r85$K:n$i$l$^$7$?!#(B
-
- gdevlips $B$N:n<T(B $BBg?95*?M$5$s$+$i$O%+%i!<$N@_DjEy$K$D$$$F8f0U8+$r(B
- $BD:$-$^$7$?!#$^$?!"(Bgs $B$N%*%W%7%g%s$K$D$$$F$O!"(Bgdevlips $B$r;29M$K$5$;$F(B
- $BD:$-$^$7$?!#(B
-
- Kousuke Ikeda $B$5$s!"J!5o5#;j$5$s!"@6?e7rFs$5$s!"(BMIHIRA Yoshiro $B$5$s(B
- $B$+$i$O!"(BMD-1300, MD-1500, MD-4000 $B$G$NF0:nJs9p$rD:$-$^$7$?!#(B
-
----
- $BK\%I%i%$%P$K4X$9$k8f0U8+!"%P%0Js9p!"(BALPS MD $B3F5!<o$G$N%F%9%H7k2LEy(B
-$B$"$j$^$7$?$i!"%a!<%k$K$F8fO"Mm4j$$$^$9!#(B
-
-$B[X3@(B $B>-OB(B
-Masakazu Higaki <higamasa@dd.mbn.or.jp>
diff --git a/gs/contrib/opvp/gdevopvp.c b/gs/contrib/opvp/gdevopvp.c
deleted file mode 100644
index 88cd577be..000000000
--- a/gs/contrib/opvp/gdevopvp.c
+++ /dev/null
@@ -1,4634 +0,0 @@
-/* Copyright (c) 2003-2004, AXE, Inc. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; either version 2 of the License, or (at your
- option) any later version.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 59 Temple Place, Suite 330, Boston, MA, 02111-1307.
-
-*/
-
-/* $Id: gdevopvp.c,v 1.13 2006/01/18 15:11:59 gishi Exp $ */
-/* gdevopvp.c ver.1.00 rel.1.0 26 Nov 2004 */
-/* OpenPrinting Vector Printer Driver Glue Code */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <locale.h>
-#include <iconv.h>
-#include <langinfo.h>
-#include <dlfcn.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#include "string_.h"
-#include "math_.h"
-#include "gx.h"
-#include "ghost.h"
-#include "gscdefs.h"
-#include "gsexit.h"
-#include "gsstruct.h"
-#include "gserrors.h"
-#include "gsmatrix.h"
-#include "gsparam.h"
-#include "gxdevice.h"
-#include "gscspace.h"
-#include "gsutil.h"
-#include "gdevprn.h"
-#include "gdevvec.h"
-#include "spprint.h"
-#include "ghost.h"
-#include "gzstate.h"
-#include "ialloc.h"
-#include "iddict.h"
-#include "dstack.h"
-#include "ilevel.h"
-#include "iinit.h"
-#include "iname.h"
-#include "imemory.h"
-#include "igstate.h"
-#include "interp.h"
-#include "ipacked.h"
-#include "iparray.h"
-#include "iutil.h"
-#include "ivmspace.h"
-#include "opdef.h"
-#include "store.h"
-#include "gspath.h"
-#include "gzpath.h"
-#include "gsropt.h"
-#include "gsiparam.h"
-#include "gxxfont.h"
-
-/* added for image gamma correction */
-#include "gximage.h"
-#include "gxfmap.h"
-#include "gxfrac.h"
-#include "gxcvalue.h"
-
-#include "opvp_common.h"
-
-#define ENABLE_SIMPLE_MODE 1
-#define ENABLE_SKIP_RASTER 1
-#define ENABLE_AUTO_REVERSE 1
-
-/* ----- data types/macros ----- */
-
-/* for debug */
-#ifdef printf
-#undef printf
-#endif
-#ifdef fprintf
-#undef fprintf
-#endif
-
-/* buffer */
-#define OPVP_BUFF_SIZE 1024
-
-/* paper */
-#define PS_DPI 72
-#define MMPI 25.4
-#define TOLERANCE 3.0
-
-typedef struct {
-const char *region;
-const char *name;
- float width;
- float height;
-} OPVP_Paper;
-
-#define X_DPI 300
-#define Y_DPI 300
-
-/* driver */
-#define gx_device_opvp_common\
- char *vectorDriver;\
- char *printerModel;\
- void *handle;\
- int (*OpenPrinter)(int,char*,int*,OPVP_api_procs**);\
- int *errorno;\
- int outputFD;\
- int nApiEntry;\
- OPVP_api_procs *apiEntry;\
- int printerContext;\
- char *jobInfo;\
- char *docInfo;\
- char *pageInfo
-
-typedef struct gx_device_opvp_s {
- gx_device_vector_common;
-} gx_device_opvp;
-
-typedef struct gx_device_oprp_s {
- gx_device_common;
- gx_prn_device_common;
-} gx_device_oprp;
-
-/* point (internal) */
-typedef struct {
- floatp x;
- floatp y;
-} _fPoint;
-
-/* ----- private function prototypes ----- */
-
-/* Utilities */
-private int opvp_startpage(gx_device *);
-private int opvp_endpage(void);
-private char *opvp_alloc_string(char **, const char *);
-private char *opvp_cat_string(char **, const char *);
-private char *opvp_adjust_num_string(char *);
-private char **opvp_gen_dynamic_lib_name(void);
-private char *opvp_to_utf8(char *);
-#define opvp_check_in_page(pdev) \
- ((beginPage) || (inkjet) ? 0 \
- : (*vdev_proc(pdev, beginpage))((gx_device_vector*)pdev))
-private int opvp_get_papertable_index(gx_device *);
-private char *opvp_get_sizestring(float, float);
-/* not used private const char *opvp_get_papersize_region(gx_device *);*/
-/* not used private const char *opvp_get_papersize_name(gx_device *);*/
-/* not used private char *opvp_get_papersize_inch(gx_device *);*/
-/* not used private const char *opvp_get_papersize(gx_device *);*/
-private char *opvp_get_mediasize(gx_device *);
-private char *opvp_gen_page_info(gx_device *);
-private char *opvp_gen_doc_info(gx_device *);
-private char *opvp_gen_job_info(gx_device *);
-private int opvp_set_brush_color(gx_device_opvp *, gx_color_index,
- OPVP_Brush *);
-private int opvp_draw_image(gx_device_opvp *, int,
- int, int, int, int, int, /*const*/ byte *);
-
-/* load/unload vector driver */
-private int opvp_load_vector_driver(void);
-private int opvp_unload_vector_driver(void);
-private int prepare_open(gx_device *);
-
-/* driver procs */
-private int opvp_open(gx_device *);
-private int oprp_open(gx_device *);
-private void opvp_get_initial_matrix(gx_device *, gs_matrix *);
-private int opvp_output_page(gx_device *, int, int);
-private int opvp_close(gx_device *);
-#if GS_VERSION_MAJOR >= 8
-private gx_color_index opvp_map_rgb_color(gx_device *, gx_color_value *); /* modified for gs 8.15 */
-#else
-private gx_color_index opvp_map_rgb_color(gx_device *, gx_color_value,
- gx_color_value, gx_color_value);
-#endif
-private int opvp_map_color_rgb(gx_device *, gx_color_index, gx_color_value *);
-private int opvp_copy_mono(gx_device *, /*const*/ byte *, int, int,
- gx_bitmap_id, int, int, int, int,
- gx_color_index, gx_color_index);
-private int opvp_copy_color(gx_device *, /*const*/ byte *, int, int,
- gx_bitmap_id, int, int, int, int);
-private int _get_params(gs_param_list *);
-private int opvp_get_params(gx_device *, gs_param_list *);
-private int oprp_get_params(gx_device *, gs_param_list *);
-private int _put_params(gs_param_list *);
-private int opvp_put_params(gx_device *, gs_param_list *);
-private int oprp_put_params(gx_device *, gs_param_list *);
-private int opvp_fill_path(gx_device *, const gs_imager_state *, gx_path *,
- const gx_fill_params *, const gx_device_color *,
- const gx_clip_path *);
-private int opvp_stroke_path(gx_device *, const gs_imager_state *, gx_path *,
- const gx_stroke_params *, const gx_drawing_color *,
- const gx_clip_path *);
-private int opvp_fill_mask(gx_device *, const byte *, int, int, gx_bitmap_id,
- int, int, int, int, const gx_drawing_color *,
- int, gs_logical_operation_t, const gx_clip_path *);
-
-/* vector driver procs */
-private int opvp_beginpage(gx_device_vector *);
-private int opvp_setlinewidth(gx_device_vector *, floatp);
-private int opvp_setlinecap(gx_device_vector *, gs_line_cap);
-private int opvp_setlinejoin(gx_device_vector *, gs_line_join);
-private int opvp_setmiterlimit(gx_device_vector *, floatp);
-private int opvp_setdash(gx_device_vector *, const float *, uint, floatp);
-private int opvp_setflat(gx_device_vector *, floatp);
-private int opvp_setlogop(gx_device_vector *, gs_logical_operation_t,
- gs_logical_operation_t);
-#if GS_VERSION_MAJOR >= 8
-private int opvp_can_handle_hl_color(gx_device_vector *, const gs_imager_state *, const gx_drawing_color *);
-private int opvp_setfillcolor(gx_device_vector *, const gs_imager_state *, const gx_drawing_color *);
-private int opvp_setstrokecolor(gx_device_vector *, const gs_imager_state *,const gx_drawing_color *);
-#else
-private int opvp_setfillcolor(gx_device_vector *, const gx_drawing_color *);
-private int opvp_setstrokecolor(gx_device_vector *, const gx_drawing_color *);
-#endif
-private int opvp_vector_dopath(gx_device_vector *, const gx_path *,
- gx_path_type_t, const gs_matrix *);
-private int opvp_vector_dorect(gx_device_vector *, fixed, fixed, fixed, fixed,
- gx_path_type_t);
-private int opvp_beginpath(gx_device_vector *, gx_path_type_t);
-private int opvp_moveto(gx_device_vector *, floatp, floatp, floatp, floatp,
- gx_path_type_t);
-private int opvp_lineto(gx_device_vector *, floatp, floatp, floatp, floatp,
- gx_path_type_t);
-private int opvp_curveto(gx_device_vector *, floatp, floatp, floatp, floatp,
- floatp, floatp, floatp, floatp, gx_path_type_t);
-private int opvp_closepath(gx_device_vector *, floatp, floatp, floatp, floatp,
- gx_path_type_t);
-private int opvp_endpath(gx_device_vector *, gx_path_type_t);
-
-/* ----- Paper definition ----- */
-OPVP_Paper paperTable[] =
-{
-#if 0
- {"jpn","hagaki",100/MMPI*PS_DPI,148/MMPI*PS_DPI},
- {"iso","a6" ,105/MMPI*PS_DPI,148/MMPI*PS_DPI},
- {"jis","b6" ,128/MMPI*PS_DPI,182/MMPI*PS_DPI},
- {"jpn","oufuku",148/MMPI*PS_DPI,200/MMPI*PS_DPI},
- {"iso","a5" ,148/MMPI*PS_DPI,210/MMPI*PS_DPI},
- {"jis","b5" ,182/MMPI*PS_DPI,257/MMPI*PS_DPI},
- {"iso","a4" ,210/MMPI*PS_DPI,297/MMPI*PS_DPI},
- {"na" ,"letter", 8.5*PS_DPI, 11*PS_DPI},/* 215.9x279.4 */
- {"na" ,"legal" , 8.5*PS_DPI, 14*PS_DPI},/* 215.9x355.6 */
- {"jis","b4" ,257/MMPI*PS_DPI,364/MMPI*PS_DPI},
- {"iso","a3" ,297/MMPI*PS_DPI,420/MMPI*PS_DPI},
-#else
-#include "opvp_media.def"
-#endif
- {NULL ,NULL , 0, 0}
-};
-
-/* ----- Driver definition ----- */
-
-/* Driver procedures */
-private dev_proc_open_device(opvp_open);
-private dev_proc_open_device(oprp_open);
-private dev_proc_output_page(opvp_output_page);
-private dev_proc_print_page(oprp_print_page);
-private dev_proc_close_device(opvp_close);
-private dev_proc_get_params(opvp_get_params);
-private dev_proc_get_params(oprp_get_params);
-private dev_proc_put_params(opvp_put_params);
-private dev_proc_put_params(oprp_put_params);
-private dev_proc_fill_rectangle(opvp_fill_rectangle);
-private dev_proc_begin_image(opvp_begin_image);
-private image_enum_proc_plane_data(opvp_image_plane_data);
-private image_enum_proc_end_image(opvp_image_end_image);
-
-gs_public_st_suffix_add0_final(
- st_device_opvp,
- gx_device_opvp,
- "gx_device_opvp",
- device_opvp_enum_ptrs,
- device_opvp_reloc_ptrs,
- gx_device_finalize,
- st_device_vector
-);
-
-#define opvp_initial_values \
- NULL, /* *vectorDriver */\
- NULL, /* *printerModel */\
- NULL, /* *handle */\
- NULL, /* (*OpenPrinter)() */\
- NULL, /* *errorno */\
- -1, /* outputFD */\
- 0, /* nApiEntry */\
- NULL, /* *apiEntry */\
- -1, /* printerContext */\
- NULL, /* *jobInfo */\
- NULL /* *docInfo */
-
-/* device procs */
-#define opvp_procs \
-{\
- opvp_open,\
- opvp_get_initial_matrix,\
- NULL, /* sync_output */\
- opvp_output_page,\
- opvp_close,\
- opvp_map_rgb_color,\
- opvp_map_color_rgb,\
- opvp_fill_rectangle, /*gdev_vector_fill_rectangle,*/\
- NULL, /* tile_rectangle OBSOLETE */\
- opvp_copy_mono,\
- opvp_copy_color,\
- NULL, /* draw_line OBSOLETE */\
- NULL, /* get_bits */\
- opvp_get_params,\
- opvp_put_params,\
- NULL, /* map_cmyk_color */\
- NULL, /* get_xfont_procs */\
- NULL, /* get_xfont_device */\
- NULL, /* map_rgb_alpha_color */\
- gx_page_device_get_page_device,\
- NULL, /* get_alpha_bits OBSOLETE */\
- NULL, /* copy_alpha */\
- NULL, /* get_band */\
- NULL, /* copy_rop */\
- opvp_fill_path,\
- opvp_stroke_path,\
- opvp_fill_mask,\
- gdev_vector_fill_trapezoid,\
- gdev_vector_fill_parallelogram,\
- gdev_vector_fill_triangle,\
- NULL, /* draw_thin_line */\
- opvp_begin_image,\
- NULL, /* image_data */\
- NULL, /* end_image */\
- NULL, /* strip_tile_rectangle */\
- NULL, /* strip_copy_rop */\
- NULL, /* get_clipping_box */\
- NULL, /* begin_typed_image */\
- NULL, /* get_bits_rectangle */\
- NULL, /* map_color_rgb_alpha */\
- NULL, /* create_compositor */\
- NULL, /* get_hardware_params */\
- NULL, /* text_begin */\
- NULL, /* finish_copydevice */\
- NULL, /* begin_transparency_group */\
- NULL, /* end_transparency_group */\
- NULL, /* begin_transparency_mask */\
- NULL, /* end_transparency_mask */\
- NULL /* discard_transparency_layer */\
-}
-
-/* vector procs */
-private gx_device_vector_procs opvp_vector_procs =
-{
- /* Page management */
- opvp_beginpage,
- /* Imager state */
- opvp_setlinewidth,
- opvp_setlinecap,
- opvp_setlinejoin,
- opvp_setmiterlimit,
- opvp_setdash,
- opvp_setflat,
- opvp_setlogop,
- /* Other state */
-#if GS_VERSION_MAJOR >= 8
- opvp_can_handle_hl_color, /* added for gs 8.15 */
-#endif
- opvp_setfillcolor,
- opvp_setstrokecolor,
- /* Paths */
- opvp_vector_dopath,
- opvp_vector_dorect,
- opvp_beginpath,
- opvp_moveto,
- opvp_lineto,
- opvp_curveto,
- opvp_closepath,
- opvp_endpath
-};
-
-const gx_device_opvp gs_opvp_device =
-{
- std_device_dci_type_body(
- gx_device_opvp,
- 0,
- "opvp",
- &st_device_opvp,
- DEFAULT_WIDTH_10THS_A4 * X_DPI / 10,
- DEFAULT_HEIGHT_10THS_A4 * Y_DPI / 10,
- X_DPI,
- Y_DPI,
- 3,
- 24,
- 255,
- 255,
- 256,
- 256
- ),
- opvp_procs
-};
-
-/* for inkjet */
-private gx_device_procs prn_oprp_procs =
- prn_color_params_procs(
- oprp_open,
- opvp_output_page,
- opvp_close,
- opvp_map_rgb_color,
- opvp_map_color_rgb,
- oprp_get_params,
- oprp_put_params
- );
-
-const gx_device_oprp gs_oprp_device =
-{
- prn_device_std_margins_body(
- gx_device_oprp,
- prn_oprp_procs,
- "oprp",
- DEFAULT_WIDTH_10THS_A4,
- DEFAULT_HEIGHT_10THS_A4,
- X_DPI,
- Y_DPI,
- 0, 0, 0, 0, 0, 0,
- 24,
- oprp_print_page
- )
-};
-
-/* driver mode */
-static bool vector = true;
-static bool inkjet = false;
-static char *vectorDriver = NULL;
-static char *printerModel = NULL;
-static void *handle = NULL;
-static int (*OpenPrinter)(int,char*,int*,OPVP_api_procs**)
- = NULL;
-static int *errorno = NULL;
-static int outputFD = -1;
-static int nApiEntry = 0;
-static OPVP_api_procs *apiEntry = NULL;
-static int printerContext = -1;
-static char *jobInfo = NULL;
-static char *docInfo = NULL;
-static OPVP_ColorSpace colorSpace = OPVP_cspaceStandardRGB;
-static OPVP_Brush *vectorFillColor = NULL;
-static float margins[4] = {0, 0, 0, 0};
-static float zoom[2] = {1, 1};
-static float shift[2] = {0, 0};
-static bool zoomAuto = false;
-static bool zooming = false;
-static bool beginPage = false;
-
-/* for image */
-private const
-gx_image_enum_procs_t opvp_image_enum_procs =
-{
- opvp_image_plane_data,
- opvp_image_end_image
-};
-typedef enum _FastImageSupportMode {
- FastImageDisable,
- FastImageNoCTM,
- FastImageNoRotate,
- FastImageRightAngle,
- FastImageReverseAngle,
- FastImageAll
-} FastImageSupportMode;
-static char *fastImage = NULL;
-static FastImageSupportMode FastImageMode = FastImageDisable;
-static bool begin_image = false;
-static gs_color_space_index color_index = 0;
-static byte palette[3*256];
-static float imageDecode[GS_IMAGE_MAX_COMPONENTS * 2];
-static bool reverse_image = false;
-
-/* added for image gamma correction */
-typedef struct bbox_image_enum_s {
- gx_image_enum_common;
- gs_memory_t *memory;
- gs_matrix matrix; /* map from image space to device dpace */
- const gx_clip_path *pcpath;
- gx_image_enum_common_t *target_info;
- bool params_are_const;
- int x0, x1;
- int y, height;
-} bbox_image_enum;
-
-/* The following is already defined in stdpre.h */
-/*#define min(a, b) (((a) < (b))? (a) : (b))*/
-
-
-/* ----- Utilities ----- */
-private int
-opvp_startpage(
- gx_device *dev
- )
-{
- int ecode = 0;
- int code = -1;
-static char *page_info = NULL;
-
- /* page info */
- page_info = opvp_alloc_string(&page_info, OPVP_INFO_PREFIX);
- page_info = opvp_cat_string(&page_info, opvp_gen_page_info(dev));
-
- /* call StartPage */
- if (printerContext != -1) {
- if (apiEntry->StartPage)
- code = apiEntry->StartPage(printerContext,
- opvp_to_utf8(page_info));
- if (code != OPVP_OK) {
- ecode = -1;
- }
- }
-
- return ecode;
-}
-
-private int
-opvp_endpage(
- void
- )
-{
- int ecode = 0;
- int code = -1;
-
- /* call EndPage */
- if (printerContext != -1) {
- if (apiEntry->EndPage)
- code = apiEntry->EndPage(printerContext);
- if (code != OPVP_OK) {
- ecode = -1;
- }
- }
-
- return ecode;
-}
-
-private char *
-opvp_alloc_string(
- char **destin,
-const char *source
- )
-{
- if (!destin) return NULL;
-
- if (*destin) {
- if (source) {
- *destin = realloc(*destin, strlen(source)+1);
- } else {
- free(*destin);
- *destin = NULL;
- }
- } else {
- if (source) {
- *destin = malloc(strlen(source)+1);
- }
- }
- if (*destin && source) {
- if (*destin != source) {
- strcpy(*destin, source);
- }
- }
-
- return *destin;
-}
-
-private char *
-opvp_cat_string(
- char **destin,
-const char *string
- )
-{
- if (!destin) return NULL;
- if (!(*destin)) return opvp_alloc_string(destin, string);
-
- if (string) {
- *destin = realloc(*destin, strlen(*destin)+strlen(string)+1);
- strcat(*destin, string);
- }
-
- return *destin;
-}
-
-private char *
-opvp_adjust_num_string(
- char *num_string
- )
-{
- char *pp;
- char *lp;
-
- if (!num_string) return NULL;
-
- if ((pp = strrchr(num_string, '.'))) {
- for (lp = &(num_string[strlen(num_string)-1]); lp > pp; lp--) {
- if (*lp == '0') {
- *lp = '\0';
- } else {
- break;
- }
- }
- if (lp == pp) *lp = '\0';
- }
-
- return num_string;
-}
-
-private char **
-opvp_gen_dynamic_lib_name(
- void
- )
-{
-static char *buff[5] = {NULL,NULL,NULL,NULL,NULL};
- char tbuff[OPVP_BUFF_SIZE];
-
- if (!vectorDriver) {
- return NULL;
- }
-
- memset((void*)tbuff, 0, OPVP_BUFF_SIZE);
- strncpy(tbuff, vectorDriver, OPVP_BUFF_SIZE - 1);
- opvp_alloc_string(&(buff[0]), tbuff);
-
- memset((void*)tbuff, 0, OPVP_BUFF_SIZE);
- strncpy(tbuff, vectorDriver, OPVP_BUFF_SIZE - 4);
- strcat(tbuff, ".so");
- opvp_alloc_string(&(buff[1]), tbuff);
-
- memset((void*)tbuff, 0, OPVP_BUFF_SIZE);
- strncpy(tbuff, vectorDriver, OPVP_BUFF_SIZE - 5);
- strcat(tbuff, ".dll");
- opvp_alloc_string(&(buff[2]), tbuff);
-
- memset((void*)tbuff, 0, OPVP_BUFF_SIZE);
- strcpy(tbuff, "lib");
- strncat(tbuff, vectorDriver, OPVP_BUFF_SIZE - 7);
- strcat(tbuff, ".so");
- opvp_alloc_string(&(buff[3]), tbuff);
-
- buff[4] = NULL;
-
- return buff;
-}
-
-private char *
-opvp_to_utf8(
- char *string
- )
-{
- char *locale;
- iconv_t cd;
- char *buff = NULL;
- size_t ib, ob;
- int complete = false;
- char *ibuff, *obuff;
- char *ostring = NULL;
-
- if (string) {
- ib = strlen(string);
- if (ib > 0) {
- ob = ib * 4;
- buff = malloc(ob+1);
- setlocale(LC_CTYPE, "");
-#ifdef CODESET
- locale = nl_langinfo(CODESET);
-#else
- locale = "UTF-8";
-#endif /* CODESET */
- if (locale) {
- if (strcmp(locale, "C") && buff) {
- if ((cd = iconv_open("UTF-8", locale))
- != (iconv_t)-1) {
- ibuff = string;
- obuff = buff;
- if (iconv(cd, &ibuff, &ib,
- &obuff, &ob)
- != -1) {
- *obuff = 0;
- complete = true;
- }
- iconv_close(cd);
- }
- }
- }
- }
- }
-
- if (complete) {
- ostring = opvp_alloc_string(&ostring, buff);
- } else {
- ostring = string;
- }
-
- if (buff) free(buff);
- return ostring;
-}
-
-private float
-opvp_fabsf(float f)
-{
- return (float)fabs((double)f);
-}
-
-private int
-opvp_get_papertable_index(
- gx_device *pdev
- )
-{
- int i;
- float width, height;
- bool landscape;
- float paper_w, paper_h;
- float prev = -1;
- int paper = -1;
- int candidate = -1;
- int smaller = -1;
- int larger = -1;
- int s_candi = -1;
- int l_candi = -1;
- float h_delta = TOLERANCE;
- float sw_delta = TOLERANCE;
- float sh_delta = TOLERANCE;
- float lw_delta = TOLERANCE;
- float lh_delta = TOLERANCE;
- bool match = false;
- float f;
-
- /* portrait or landscape */
- landscape = (pdev->MediaSize[0] < pdev->MediaSize[1] ? false : true);
-
- /* paper size */
- width = (landscape ? pdev->MediaSize[1] : pdev->MediaSize[0]);
- height = (landscape ? pdev->MediaSize[0] : pdev->MediaSize[1]);
-
-#if 0
- for (i=0; paperTable[i].name != NULL; i++) {
- if ((width <= ceilf(paperTable[i].width)) &&
- (height <= ceilf(paperTable[i].height))) {
- break;
- }
- }
- return i;
-#endif
-
- for (i=0; paperTable[i].name != NULL; i++) {
- paper_w = paperTable[i].width;
- paper_h = paperTable[i].height;
- if (width == paper_w) {
- if (height == paper_h) {
- paper = i;
- match = true;
- break;
- } else if ((f = opvp_fabsf(height - paper_h)) < TOLERANCE) {
- if (f < h_delta) {
- h_delta = f;
- candidate = i;
- }
- }
- } else if (candidate != -1) {
- paper = candidate;
- match = true;
- break;
- } else if (prev != paper_w) {
- prev = paper_w;
- if (paper_w < width) {
- if ((f = opvp_fabsf(width - paper_w)) < TOLERANCE) {
- if (f < sw_delta) {
- sw_delta = f;
- smaller = i;
- }
- }
- } else {
- if ((f = opvp_fabsf(width - paper_w)) < TOLERANCE) {
- if (f < lw_delta) {
- lw_delta = f;
- larger = i;
- }
- }
- }
- }
- }
- if (!match) {
- paper = i;
- if (smaller != -1) {
- paper_w = paperTable[smaller].width;
- for (i = smaller; paperTable[i].width == paper_w; i++) {
- paper_h = paperTable[i].height;
- if (height == paper_h) {
- sh_delta = 0;
- s_candi = i;
- break;
- } else if ((f = opvp_fabsf(height - paper_h))
- < TOLERANCE) {
- if (f < sh_delta) {
- sh_delta = f;
- s_candi = i;
- }
- }
- }
- }
- if (larger != -1) {
- paper_w = paperTable[larger].width;
- for (i = larger; paperTable[i].width == paper_w; i++) {
- paper_h = paperTable[i].height;
- if (height == paper_h) {
- lh_delta = 0;
- l_candi = i;
- break;
- } else if ((f = opvp_fabsf(height - paper_h))
- < TOLERANCE) {
- if (f < lh_delta) {
- lh_delta = f;
- l_candi = i;
- }
- }
- }
- }
- if (s_candi != -1) {
- if (l_candi != -1) {
- if ((sw_delta + sh_delta)
- < (lw_delta + lh_delta)) {
- paper = s_candi;
- } else {
- paper = l_candi;
- }
- } else {
- paper = s_candi;
- }
- } else {
- if (l_candi != -1) {
- paper = l_candi;
- }
- }
- }
-
- return paper;
-}
-
-private char *
-opvp_get_sizestring(
- float width,
- float height
- )
-{
- char nbuff[OPVP_BUFF_SIZE];
- char nbuff1[OPVP_BUFF_SIZE / 2];
- char nbuff2[OPVP_BUFF_SIZE / 2];
-static char *buff = NULL;
-
- memset((void*)nbuff, 0, OPVP_BUFF_SIZE);
- memset((void*)nbuff1, 0, OPVP_BUFF_SIZE / 2);
- memset((void*)nbuff2, 0, OPVP_BUFF_SIZE / 2);
-
- snprintf(nbuff1, OPVP_BUFF_SIZE / 2 - 1, "%.3f", width);
- snprintf(nbuff2, OPVP_BUFF_SIZE / 2 - 1, "%.3f", height);
- snprintf(nbuff, OPVP_BUFF_SIZE - 1, "%sx%s",
- opvp_adjust_num_string(nbuff1),
- opvp_adjust_num_string(nbuff2));
-
- return opvp_alloc_string(&buff, nbuff);
-}
-
-/* not used
-private const char *
-opvp_get_papersize_region(
- gx_device *pdev
- )
-{
- return paperTable[opvp_get_papertable_index(pdev)].region;
-}
-*/
-
-/* not used
-private const char *
-opvp_get_papersize_name(
- gx_device *pdev
- )
-{
- return paperTable[opvp_get_papertable_index(pdev)].name;
-}
-*/
-
-/* not used
-private char *
-opvp_get_papersize_inch(
- gx_device *pdev
- )
-{
- bool landscape;
- float width, height;
-
- landscape = (pdev->MediaSize[0] < pdev->MediaSize[1] ? false : true);
- width = (landscape ? pdev->MediaSize[1] : pdev->MediaSize[0]) / PS_DPI;
- height = (landscape ? pdev->MediaSize[0] : pdev->MediaSize[1]) / PS_DPI;
-
- return opvp_get_sizestring(width, height);
-}
-*/
-
-/* not used
-private const char *
-opvp_get_papersize(
- gx_device *pdev
- )
-{
-const char *paper;
-
- paper = opvp_get_papersize_name(pdev);
- if (!paper) paper = opvp_get_papersize_inch(pdev);
-
- return paper;
-}
-*/
-
-private char *
-opvp_get_mediasize(
- gx_device *pdev
- )
-{
- int i;
- char wbuff[OPVP_BUFF_SIZE];
-static char *buff = NULL;
-const char *region;
-const char *name;
- float width;
- float height;
-const char *unit;
- bool landscape;
-
- i = opvp_get_papertable_index(pdev);
-
- if (paperTable[i].name) {
- region = paperTable[i].region;
- name = paperTable[i].name;
- width = paperTable[i].width / PS_DPI;
- height = paperTable[i].height / PS_DPI;
- if((strcmp(region, "na" ) == 0) ||
- (strcmp(region, "asme") == 0) ||
- (strcmp(region, "roc" ) == 0) ||
- (strcmp(region, "oe" ) == 0)) {
- unit = "in";
- } else {
- width *= MMPI;
- height *= MMPI;
- unit = "mm";
- }
- } else {
- landscape = (pdev->MediaSize[0] < pdev->MediaSize[1] ?
- false : true);
- region = "custom";
- name = "opvp";
- width = (landscape ? pdev->MediaSize[1] : pdev->MediaSize[0])
- / PS_DPI;
- height = (landscape ? pdev->MediaSize[0] : pdev->MediaSize[1])
- / PS_DPI;
- unit = "in";
- }
- memset((void*)wbuff, 0, OPVP_BUFF_SIZE);
- snprintf(wbuff, OPVP_BUFF_SIZE - 1, "%s_%s_%s%s", region, name,
- opvp_get_sizestring(width, height),
- unit);
- buff = opvp_alloc_string(&buff, wbuff);
-
- return buff;
-}
-
-private char *
-opvp_gen_page_info(
- gx_device *dev
- )
-{
-static char *buff = NULL;
- int num_copies = 1;
- bool landscape;
- char tbuff[OPVP_BUFF_SIZE];
-
- /* copies */
- if (!inkjet) {
- if (dev->IgnoreNumCopies) {
- num_copies = 1;
- } else if (dev->NumCopies_set > 0) {
- num_copies = dev->NumCopies;
- }
- }
-
- landscape = (dev->MediaSize[0] < dev->MediaSize[1] ? false
- : true);
- memset((void*)tbuff, 0, OPVP_BUFF_SIZE);
- snprintf(tbuff, OPVP_BUFF_SIZE - 1,
- "MediaCopy=%d;DeviceResolution=deviceResolution_%s;MediaPageRotation=%s;MediaSize=%s",
- num_copies,
- opvp_get_sizestring(dev->x_pixels_per_inch, dev->y_pixels_per_inch),
- (landscape ? "landscape" : "portrait"),
- opvp_get_mediasize(dev));
-
- opvp_alloc_string(&buff, tbuff);
-
- return buff;
-}
-
-private char *
-opvp_gen_doc_info(
- gx_device *dev
- )
-{
- return opvp_gen_page_info(dev);
-}
-
-private char *
-opvp_gen_job_info(
- gx_device *dev
- )
-{
- return opvp_gen_doc_info(dev);
-}
-
-private int
-opvp_set_brush_color(
- gx_device_opvp *pdev,
- gx_color_index color,
- OPVP_Brush *brush
- )
-{
- int code;
- int ecode = 0;
- gx_color_value rgb[3];
-
- code = opvp_map_color_rgb((gx_device *)pdev, color, rgb);
- if (code) {
- ecode = -1;
- } else {
-#if ENABLE_SIMPLE_MODE
- brush->colorSpace = colorSpace;
-#else
- /* call GetColorSpace */
- if (apiEntry->GetColorSpace)
- code = apiEntry->GetColorSpace(printerContext,
- &(brush->colorSpace));
- if (code != OPVP_OK) {
- brush->colorSpace = OPVP_cspaceDeviceRGB;
- }
-#endif
- brush->pbrush = NULL;
- brush->xorg = brush->yorg = 0;
- brush->color[3] = (color == gx_no_color_index ? -1 : 0);
- brush->color[2] = rgb[0];
- brush->color[1] = rgb[1];
- brush->color[0] = rgb[2];
- }
-
- return ecode;
-}
-
-private int
-opvp_draw_image(
- gx_device_opvp *pdev,
- int depth,
- int sw,
- int sh,
- int dw,
- int dh,
- int raster,
-/*const*/
- byte *data
- )
-{
- int code = -1;
- int ecode = 0;
- int count;
- OPVP_Rectangle rect;
-
- /* check page-in */
- if (opvp_check_in_page(pdev)) return -1;
-
- /* image size */
-/* count = (((((sw * depth + 7) >> 3) + 3) >> 2) << 2) * sh; */
- count = raster * sh;
- OPVP_i2Fix(0, rect.p0.x);
- OPVP_i2Fix(0, rect.p0.y);
- OPVP_i2Fix(dw, rect.p1.x);
- OPVP_i2Fix(dh, rect.p1.y);
-
- /* call DrawImage */
- if (apiEntry->DrawImage)
- code = apiEntry->DrawImage(printerContext,
- sw,
- sh,
- depth,
- OPVP_iformatRaw,
- rect,
- count,
- (void *)data);
- if (code != OPVP_OK) {
-
- /* call StartDrawImage */
- if (apiEntry->StartDrawImage)
- code = apiEntry->StartDrawImage(printerContext,
- sw,
- sh,
- depth,
- OPVP_iformatRaw,
- rect);
- if (code == OPVP_OK) {
-
- /* call TansferDrawImage */
- if (apiEntry->TransferDrawImage)
- code = apiEntry->TransferDrawImage(printerContext,
- count,
- (void *)data);
- if (code != OPVP_OK) ecode = -1;
-
- /* call EndDrawImage */
- if (apiEntry->EndDrawImage)
- apiEntry->EndDrawImage(printerContext);
-
- } else {
- /* ecode = -1;*/
- ecode = 0; /* continue... */
- }
- }
-
- return ecode;
-}
-
-/* ----- load/unload vector driver ----- */
-
-/*
- * load vector-driver
- */
-private int
-opvp_load_vector_driver(
- void
- )
-{
- char **list = NULL;
- int i;
- void *h;
-
- if (handle) {
- opvp_unload_vector_driver();
- }
-
- if (vectorDriver) {
- list = opvp_gen_dynamic_lib_name();
- }
-
- if (list) {
- i = 0;
- while (list[i]) {
- if ((h = dlopen(list[i],RTLD_NOW))) {
- OpenPrinter = dlsym(h,"OpenPrinter");
- errorno = dlsym(h,"errorno");
- if (OpenPrinter && errorno) {
- handle = h;
- break;
- }
- OpenPrinter = NULL;
- errorno = NULL;
- }
- i++;
- }
- }
-
- if (handle) {
- return 0;
- } else {
- return -1;
- }
-}
-
-/*
- * unload vector-driver
- */
-private int
-opvp_unload_vector_driver(
- void
- )
-{
- if (handle) {
- dlclose(handle);
- handle = NULL;
- OpenPrinter = NULL;
- errorno = NULL;
- }
- return 0;
-}
-
-/*
- * prepare open
- */
-private int
-prepare_open(
- gx_device *dev
- )
-{
- int ecode = 0;
- int code = -1;
- OPVP_api_procs *api_entry;
- int dumFD = -1;
- int dumContext = -1;
- OPVP_ColorSpace cspace = OPVP_cspaceStandardRGB;
-
- /* open dummy device */
- code = open("/dev/null", O_RDWR);
- if (code < 0) ecode = code;
- else dumFD = code;
-
- /* load vector driver */
- if (!ecode) {
- if ((code = opvp_load_vector_driver())) {
- ecode = code;
- }
- }
-
- /* prepare array of function pointer for PDAPI */
- if (!ecode) {
- if (!apiEntry) {
- if (!(apiEntry = calloc(sizeof(OPVP_api_procs), 1))) {
- ecode = -1;
- }
- } else {
- memset(apiEntry, 0, sizeof(OPVP_api_procs));
- }
- }
-
- /* call OpenPrinter as dummy */
- if (!ecode) {
- code = OpenPrinter(dumFD, printerModel,
- &nApiEntry, &api_entry);
- if (code == -1) ecode = code;
- else dumContext = code;
- }
-
- /* set apiEntry */
- if (!ecode) {
- if (nApiEntry > sizeof(OPVP_api_procs)/sizeof(void *)) {
- nApiEntry = sizeof(OPVP_api_procs)/sizeof(void *);
- }
- memcpy(apiEntry, api_entry, nApiEntry*sizeof(void *));
- } else {
- if (apiEntry) free(apiEntry);
- apiEntry = NULL;
- }
-
- /* check vector fucntion */
- if (apiEntry) {
- if (!inkjet) {
- if (!(apiEntry->NewPath) ||
- !(apiEntry->EndPath) ||
- !(apiEntry->StrokePath) ||
- !(apiEntry->SetCurrentPoint) ||
- !(apiEntry->LinePath) ||
- !(apiEntry->BezierPath)) {
- /* NOT avail vector drawing mode */
- vector = false;
- }
- }
- /* call GetColorSpace */
- if (apiEntry->GetColorSpace)
- code = apiEntry->GetColorSpace(dumContext, &cspace);
- if (cspace == OPVP_cspaceBW) {
- /* mono-color */
- colorSpace = cspace;
- dev->color_info.num_components = 1;
- dev->color_info.depth = 1;
- dev->color_info.max_gray = 0;
- dev->color_info.max_color = 0;
- dev->color_info.dither_grays = 1;
- dev->color_info.dither_colors = 1;
- } else if (cspace == OPVP_cspaceDeviceGray) {
- /* gray-scale */
- colorSpace = cspace;
- dev->color_info.num_components = 1;
- dev->color_info.depth = 8;
- dev->color_info.max_gray = 255;
- dev->color_info.max_color = 255;
- dev->color_info.dither_grays = 256;
- dev->color_info.dither_colors = 256;
- } else {
- /* rgb color */
- colorSpace = OPVP_cspaceStandardRGB;
- dev->color_info.num_components = 3;
- dev->color_info.depth = 24;
- dev->color_info.max_gray = 255;
- dev->color_info.max_color = 255;
- dev->color_info.dither_grays = 256;
- dev->color_info.dither_colors = 256;
- }
-#if GS_VERSION_MAJOR >= 8
- dev->procs.get_color_mapping_procs = NULL;
- dev->procs.get_color_comp_index = NULL;
- gx_device_fill_in_procs(dev);
-#endif
- }
-
- /* call Closerinter as dummy */
- if (dumContext != -1) {
- /* call ClosePrinter */
- if (apiEntry->ClosePrinter)
- apiEntry->ClosePrinter(dumContext);
- dumContext = -1;
- }
-
- /* close device for dummy */
- if (dumFD != -1) {
- close(dumFD);
- dumFD = -1;
- }
-
- /* un-load vector driver */
- opvp_unload_vector_driver();
-
- return ecode;
-}
-
-/* ----- driver procs ----- */
-/*
- * open device
- */
-private int
-opvp_open(
- gx_device *dev
- )
-{
- gx_device_opvp *pdev = (gx_device_opvp *)dev;
- gx_device_oprp *rdev = (gx_device_oprp *)dev;
- int ecode = 0;
- int code;
- OPVP_api_procs *api_entry;
- char *job_info = NULL;
- char *doc_info = NULL;
- char *tmp_info = NULL;
- float margin_width = 0;
- float margin_height = 0;
- float adj_margins[4];
-
- /* prepare open : load and open as dummy */
- code = prepare_open(dev);
- if (code) {
- ecode = code;
- return ecode;
- }
-
- /* set margins */
- if (zoomAuto) {
- margin_width = (margins[0] + margins[2])
- * dev->HWResolution[0];
- margin_height = (margins[1] + margins[3])
- * dev->HWResolution[1];
- zoom[0] = (dev->width - margin_width) / dev->width;
- zoom[1] = (dev->height - margin_height) / dev->height;
- if (zoom[0] < zoom[1]) zoom[1] = zoom[0];
- else zoom[0] = zoom[1];
- }
- if (inkjet) {
- if ((margins[0] != 0) ||
- (margins[1] != 0) || (margins[3] != 0)) {
- shift[0] = margins[0] * dev->HWResolution[0];
- shift[1] = (margins[1] + margins[3])
- * dev->HWResolution[1];
- zooming = true;
- }
- dev->width -= margins[2] * dev->HWResolution[0];
- dev->height -= margins[1] * dev->HWResolution[1];
- } else {
- if ((margins[0] != 0) || (margins[1] != 0)) {
- shift[0] = margins[0] * dev->HWResolution[0];
- shift[1] = margins[3] * dev->HWResolution[1];
- zooming = true;
- }
- adj_margins[0] = 0;
- adj_margins[3] = 0;
- adj_margins[1] = dev->height * zoom[1] / dev->HWResolution[1]
- - (dev->MediaSize[1] / PS_DPI
- - (margins[1] + margins[3]));
- if (adj_margins[1] < 0) adj_margins[0] = 0;
- adj_margins[2] = dev->width * zoom[0] / dev->HWResolution[0]
- - (dev->MediaSize[0] / PS_DPI
- - (margins[0] + margins[2]));
- if (adj_margins[2] < 0) adj_margins[2] = 0;
- gx_device_set_margins(dev, adj_margins, true);
- }
- if ((zoom[0] != 1) || (zoom[1] != 1)) zooming = true;
-
- /* open file for output device */
- if (!inkjet) {
- pdev->v_memory = gs_memory_stable(pdev->memory);
- /* open output stream */
- code = gdev_vector_open_file_options((gx_device_vector*)dev,
- 512,
- (VECTOR_OPEN_FILE_SEQUENTIAL
- |VECTOR_OPEN_FILE_BBOX
- ));
- if (code < 0) {
- ecode = code;
- return ecode;
- }
-#if GS_VERSION_MAJOR >= 8
- if (pdev->bbox_device != NULL) {
- if (pdev->bbox_device->memory == NULL)
- pdev->bbox_device->memory = gs_memory_stable(dev->memory);
- }
-#endif
- outputFD = fileno(pdev->file);
- } else {
- /* open printer device */
- code = gdev_prn_open(dev);
- if (code < 0) {
- ecode = ecode;
- return ecode;
- }
- /* open output stream */
- code = gdev_prn_open_printer_seekable(dev, true, false);
- if (code < 0) {
- ecode = code;
- return ecode;
- }
- outputFD = fileno(rdev->file);
- }
-
- /* RE-load vector driver */
- if ((code = opvp_load_vector_driver())) {
- ecode = code;
- return ecode;
- }
-
- /* call OpenPrinter */
- code = OpenPrinter(outputFD, printerModel,
- &nApiEntry, &api_entry);
- if (!apiEntry) {
- if (!(apiEntry = calloc(sizeof(OPVP_api_procs), 1))) {
- ecode = -1;
- }
- } else {
- memset(apiEntry, 0, sizeof(OPVP_api_procs));
- }
- if (code == -1) {
- ecode = code;
- if (apiEntry) free(apiEntry);
- apiEntry = NULL;
- opvp_unload_vector_driver();
- if (inkjet) gdev_prn_close(dev);
- else gdev_vector_close_file((gx_device_vector *)pdev);
- return ecode;
- }
- printerContext = code;
- if (nApiEntry > sizeof(OPVP_api_procs)/sizeof(void *)) {
- nApiEntry = sizeof(OPVP_api_procs)/sizeof(void *);
- }
- memcpy(apiEntry, api_entry, nApiEntry*sizeof(void *));
-
- /* call SetColorSpace */
- if (!ecode) {
- if (apiEntry->SetColorSpace)
- apiEntry->SetColorSpace(printerContext, colorSpace);
- }
-
- /* initialize */
- if ((!ecode) && (!inkjet)) {
- pdev->vec_procs = &opvp_vector_procs;
- if (vector) gdev_vector_init((gx_device_vector *)pdev);
- }
-
- /* start job */
- if (!ecode) {
- /* job info */
- if (jobInfo) {
- if (strlen(jobInfo) > 0) {
- job_info = opvp_alloc_string(&job_info,
- jobInfo);
- }
- }
- tmp_info = opvp_alloc_string(&tmp_info,
- opvp_gen_job_info(dev));
- if (tmp_info) {
- if (strlen(tmp_info) > 0) {
- if (job_info) {
- if (strlen(job_info) > 0) {
- opvp_cat_string(&job_info, ";");
- }
- }
- job_info = opvp_cat_string(&job_info,
- OPVP_INFO_PREFIX);
- job_info = opvp_cat_string(&job_info, tmp_info);
- }
- }
-
- /* call StartJob */
- if (apiEntry->StartJob)
- code = apiEntry->StartJob(printerContext,
- opvp_to_utf8(job_info));
- if (code != OPVP_OK) {
- ecode = -1;
- }
- }
-
- /* start doc */
- if (!ecode) {
- /* doc info */
- if (docInfo) {
- if (strlen(docInfo) > 0) {
- doc_info = opvp_alloc_string(&doc_info,
- docInfo);
- }
- }
- tmp_info = opvp_alloc_string(&tmp_info,
- opvp_gen_doc_info(dev));
- if (tmp_info) {
- if (strlen(tmp_info) > 0) {
- if (doc_info) {
- if (strlen(doc_info) > 0) {
- opvp_cat_string(&doc_info, ";");
- }
- }
- doc_info = opvp_cat_string(&doc_info,
- OPVP_INFO_PREFIX);
- doc_info = opvp_cat_string(&doc_info, tmp_info);
- }
- }
-
- /* call StartDoc */
- if (apiEntry->StartDoc)
- code = apiEntry->StartDoc(printerContext,
- opvp_to_utf8(doc_info));
- if (code != OPVP_OK) {
- ecode = -1;
- }
- }
-
- if (tmp_info) opvp_alloc_string(&tmp_info, NULL);
- if (doc_info) opvp_alloc_string(&doc_info, NULL);
- if (job_info) opvp_alloc_string(&job_info, NULL);
-
- return ecode;
-}
-
-/*
- * open device for inkjet
- */
-private int
-oprp_open(
- gx_device *dev
- )
-{
- /* set inkjet mode */
- vector = false;
- inkjet = true;
-
- /* matrix */
- dev->procs.get_initial_matrix = opvp_get_initial_matrix;
- return opvp_open(dev);
-}
-
-/*
- * get initial matrix
- */
-private void
-opvp_get_initial_matrix(
- gx_device *dev,
- gs_matrix *pmat
- )
-{
- gx_device_opvp *pdev = (gx_device_opvp *)dev;
- OPVP_CTM omat;
-
- gx_default_get_initial_matrix(dev,pmat);
- if (zooming) {
- /* gs matrix */
- pmat->xx *= zoom[0];
- pmat->xy *= zoom[1];
- pmat->yx *= zoom[0];
- pmat->yy *= zoom[1];
- pmat->tx = pmat->tx * zoom[0] + shift[0];
- pmat->ty = pmat->ty * zoom[1] + shift[1];
- }
-
- if (pdev->is_open) {
-
- /* call ResetCTM */
- if (apiEntry->ResetCTM)
- apiEntry->ResetCTM(printerContext);
- else {
- /* call SetCTM */
- omat.a = 1;
- omat.b = 0;
- omat.c = 0;
- omat.d = 1;
- omat.e = 0;
- omat.f = 0;
- if (apiEntry->SetCTM)
- apiEntry->SetCTM(printerContext, &omat);
- }
- }
-
- return;
-}
-
-/*
- * output page
- */
-private int
-opvp_output_page(
- gx_device *dev,
- int num_copies,
- int flush
- )
-{
- gx_device_opvp *pdev = (gx_device_opvp *)dev;
- int ecode = 0;
- int code = OPVP_OK;
-
- if (inkjet) return gdev_prn_output_page(dev, num_copies, flush);
-
-#ifdef OPVP_IGNORE_BLANK_PAGE
- if (pdev->in_page) {
-#else
- /* check page-in */
- if (opvp_check_in_page(pdev)) return -1;
-#endif
- /* end page */
- code = opvp_endpage();
- if (code) ecode = code;
-
- pdev->in_page = false;
- beginPage = false;
-#ifdef OPVP_IGNORE_BLANK_PAGE
- }
-#endif
-
- if (vector) {
- gdev_vector_reset((gx_device_vector *)pdev);
- }
-
- code = gx_finish_output_page(dev, num_copies, flush);
- if (code) ecode = code;
-
- return ecode;
-}
-
-/*
- * print page
- */
-private int
-oprp_print_page(
- gx_device_printer *pdev,
- FILE *prn_stream
- )
-{
- int ecode = 0;
- int code = -1;
- int raster_size;
- int buff_size;
- byte *buff = NULL;
- int line;
- int scan_lines;
- byte *data;
- int rasterWidth;
- bool start_page = false;
- bool start_raster = false;
-#if ENABLE_SKIP_RASTER
- int i;
- byte check;
-#endif
-
- /* get raster/pixel size */
- raster_size = gx_device_raster((gx_device *)pdev, 0);
- buff_size = ((raster_size + 3) >> 2) << 2;
- scan_lines = dev_print_scan_lines(pdev);
- rasterWidth = pdev->width;
-
- /* allocate buffer */
- buff = (byte*)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), 1, buff_size, "oprp_print_page(buff)");
- if (!buff) return ecode = -1;
-
- /* start page */
- if (!ecode) {
- code = opvp_startpage((gx_device *)pdev);
- if (code) ecode = code;
- else start_page = true;
- }
-
- /* moveto origin */
- if (!ecode)
- opvp_moveto((gx_device_vector*)pdev, 0, 0, 0, 0, 0);
-
- /* call StartRaster */
- if (!ecode) {
- if (apiEntry->StartRaster)
- code = apiEntry->StartRaster(printerContext, rasterWidth);
- if (code != OPVP_OK) ecode = code;
- else start_raster = true;
- }
-
- /* line */
- for (line = 0; (line < scan_lines) && (!ecode); line++) {
- /* get raster data */
- if (!ecode) {
- code = gdev_prn_get_bits(pdev, line, buff, &data);
- if (code) {
- ecode = code;
- break;
- }
- }
-#if ENABLE_SKIP_RASTER
- /* check support SkipRaster */
- if (apiEntry->SkipRaster) {
- /* check all white */
- if (pdev->color_info.depth > 8) {
- for (check = 0xff, i = 0; i < raster_size; i++)
- {
- check &= data[i];
- if (check != 0xff) break;
- }
- /* if all white call SkipRaster */
- if (check == 0xff) {
- code = apiEntry->SkipRaster(
- printerContext, 1);
- if (code == OPVP_OK) continue;
- }
- } else {
- for (check = 0, i = 0; i < raster_size; i++)
- {
- check |= data[i];
- if (check) break;
- }
- /* if all zero call SkipRaster */
- if (check) {
- code = apiEntry->SkipRaster(
- printerContext, 1);
- if (code == OPVP_OK) continue;
- }
- }
- }
-#endif
- /* call TransferRasterData */
- if (!ecode) {
- if (apiEntry->TransferRasterData)
- code = apiEntry->TransferRasterData(printerContext,
- raster_size,
- data);
- if (code != OPVP_OK) ecode = code;
- }
- }
-
- /* call StartRaster */
- if (start_raster) {
- if (apiEntry->EndRaster)
- code = apiEntry->EndRaster(printerContext);
- if (code != OPVP_OK) ecode = code;
- start_raster = false;
- }
-
- /* end page */
- if (start_page) {
- code = opvp_endpage();
- if (code) ecode = code;
- start_page = false;
- }
-
- /* free buffer */
- if (buff) {
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char*)buff, 1, buff_size, "oprp_print_page(buff)");
- buff = NULL;
- }
-
- return ecode;
-}
-
-/*
- * close device
- */
-private int
-opvp_close(
- gx_device *dev
- )
-{
- gx_device_opvp *pdev = (gx_device_opvp *)dev;
- int ecode = 0;
-
- /* finalize */
- if (printerContext != -1) {
-
- /* call EndDoc */
- if (apiEntry->EndDoc)
- apiEntry->EndDoc(printerContext);
-
- /* call EndJob */
- if (apiEntry->EndJob)
- apiEntry->EndJob(printerContext);
-
- /* call ClosePrinter */
- if (apiEntry->ClosePrinter)
- apiEntry->ClosePrinter(printerContext);
- printerContext = -1;
- }
-
- /* unload vector driver */
- if (apiEntry) free(apiEntry);
- apiEntry = NULL;
- opvp_unload_vector_driver();
-
- if (inkjet) {
- /* close printer */
- gdev_prn_close(dev);
- } else {
- /* close output stream */
- gdev_vector_close_file((gx_device_vector *)pdev);
- }
- outputFD = -1;
-
- return ecode;
-}
-
-/*
- * map rgb color
- */
-#if GS_VERSION_MAJOR >= 8
-private gx_color_index
-opvp_map_rgb_color(
- gx_device *dev,
- gx_color_value *prgb /* modified for gs 8.15 */
- )
-#else
-private gx_color_index
-opvp_map_rgb_color(
- gx_device *dev,
- gx_color_value r,
- gx_color_value g,
- gx_color_value b
- )
-#endif
-{
- OPVP_ColorSpace cs;
- uint c, m, y, k;
-
-#if !(ENABLE_SIMPLE_MODE)
- gx_device_opvp *pdev;
- int code;
-#endif
-
-#if GS_VERSION_MAJOR >= 8
- gx_color_value r, g, b; /* added for gs 8.15 */
- r = prgb[0];
- g = prgb[1];
- b = prgb[2];
-#endif
-
-#if !(ENABLE_SIMPLE_MODE)
- pdev = (gx_device_opvp *)dev;
- code = -1;
-#endif
- cs = OPVP_cspaceStandardRGB;
-
-#if ENABLE_SIMPLE_MODE
- cs = colorSpace;
-#else
- if (pdev->is_open) {
- /* call GetColorSpace */
- if (apiEntry->GetColorSpace)
- code = apiEntry->GetColorSpace(printerContext, &cs);
- if (code != OPVP_OK) {
- if (pdev->color_info.depth > 32) {
- cs = OPVP_cspaceStandardRGB64;
- } else if (pdev->color_info.depth > 8 ) {
- cs = OPVP_cspaceStandardRGB;
- } else if (pdev->color_info.depth > 1 ) {
- cs = OPVP_cspaceDeviceGray;
- } else {
- cs = OPVP_cspaceBW;
- }
- }
- }
-#endif
-
- switch (cs) {
- case OPVP_cspaceStandardRGB64 :
- /* unsupported */
- if (sizeof(gx_color_index) >= 6) {
- return (long long)b
- + ((long long)g << 16)
- + ((long long)b << 32);
- } else {
- return gx_color_value_to_byte(b)
- + ((uint)gx_color_value_to_byte(g) << 8)
- + ((ulong)gx_color_value_to_byte(r) << 16);
- }
- break;
- case OPVP_cspaceDeviceCMYK :
- case OPVP_cspaceDeviceCMY :
- /* unsupported */
- c = gx_color_value_to_byte(~r);
- m = gx_color_value_to_byte(~g);
- y = gx_color_value_to_byte(~b);
- if (cs == OPVP_cspaceDeviceCMYK) {
- k = (c<m ? (c<y ? c : y) : (m<y ? m : y));
- c -= k;
- m -= k;
- y -= k;
- } else {
- k = 0;
- }
- return (k + (y << 8) + (m << 16) + (c << 24));
- break;
- case OPVP_cspaceDeviceGray :
-#if GS_VERSION_MAJOR >= 8
- {
- gx_color_value rgb[3];
- rgb[0] = rgb[1] = rgb[2] = r;
- return gx_default_gray_map_rgb_color(dev, rgb);
- }
-#else
- return gx_default_gray_map_rgb_color(dev, r, g, b);
-#endif
- break;
- case OPVP_cspaceBW :
-#if GS_VERSION_MAJOR >= 8
- return gx_default_b_w_map_rgb_color(dev, prgb);
-#else
- return gx_default_b_w_map_rgb_color(dev, r, g, b);
-#endif
- break;
- case OPVP_cspaceStandardRGB :
- case OPVP_cspaceDeviceRGB :
- default :
-#if GS_VERSION_MAJOR >= 8
- return gx_default_rgb_map_rgb_color(dev, prgb);
-#else
- return gx_default_rgb_map_rgb_color(dev, r, g, b);
-#endif
- break;
- }
-}
-
-/*
- * map color rgb
- */
-private int
-opvp_map_color_rgb(
- gx_device *dev,
- gx_color_index color,
- gx_color_value prgb[3]
- )
-{
-#if !(ENABLE_SIMPLE_MODE)
- gx_device_opvp *pdev = (gx_device_opvp *)dev;
- int code = -1;
-#endif
- OPVP_ColorSpace cs = OPVP_cspaceStandardRGB;
- uint c, m, y, k;
-
-#if ENABLE_SIMPLE_MODE
- cs = colorSpace;
-#else
- /* call GetColorSpace */
- if (pdev->is_open) {
- if (apiEntry->GetColorSpace)
- code = apiEntry->GetColorSpace(printerContext, &cs);
- if (code != OPVP_OK) {
- if (pdev->color_info.depth > 32) {
- cs = OPVP_cspaceStandardRGB64;
- } else if (pdev->color_info.depth > 8 ) {
- cs = OPVP_cspaceStandardRGB;
- } else if (pdev->color_info.depth > 1 ) {
- cs = OPVP_cspaceDeviceGray;
- } else {
- cs = OPVP_cspaceBW;
- }
- }
- }
-#endif
-
- switch (cs) {
- case OPVP_cspaceStandardRGB64 :
- /* unsupported */
- if (sizeof(gx_color_index) >= 6) {
- prgb[0] = ((long long)color >> 32) & 0xffff;
- prgb[1] = ((long long)color >> 16) & 0xffff;
- prgb[2] = color & 0xffff;
- } else {
- prgb[0] = gx_color_value_from_byte(
- (color >> 16) & 0xff);
- prgb[1] = gx_color_value_from_byte(
- (color >> 8) & 0xff);
- prgb[2] = gx_color_value_from_byte(
- color & 0xff);
- }
- break;
- case OPVP_cspaceDeviceCMYK :
- case OPVP_cspaceDeviceCMY :
- /* unsupported */
- c = gx_color_value_from_byte((color >> 24) & 0xff);
- m = gx_color_value_from_byte((color >> 16) & 0xff);
- y = gx_color_value_from_byte((color >> 8) & 0xff);
- if (cs == OPVP_cspaceDeviceCMYK) {
- k = gx_color_value_from_byte(color & 0xff);
- c += k; if (c > 255) c = 255;
- m += k; if (m > 255) m = 255;
- y += k; if (y > 255) y = 255;
- }
- prgb[0] = gx_color_value_from_byte(~c & 0xff);
- prgb[1] = gx_color_value_from_byte(~m & 0xff);
- prgb[2] = gx_color_value_from_byte(~y & 0xff);
- break;
- case OPVP_cspaceDeviceGray :
- return gx_default_gray_map_color_rgb(dev, color, prgb);
- break;
- case OPVP_cspaceBW :
- return gx_default_b_w_map_color_rgb(dev, color, prgb);
- break;
- case OPVP_cspaceStandardRGB :
- case OPVP_cspaceDeviceRGB :
- default :
- return gx_default_rgb_map_color_rgb(dev, color, prgb);
- break;
- }
-
- return 0;
-}
-
-/*
- * fill rectangle
- */
-private int
-opvp_fill_rectangle(
- gx_device *dev,
- int x,
- int y,
- int w,
- int h,
- gx_color_index color
- )
-{
- gx_device_opvp *pdev = (gx_device_opvp *)dev;
- byte data[8] = {0xC0, 0, 0, 0, 0xC0, 0, 0, 0};
- int code = -1;
- int ecode = 0;
- OPVP_Brush brush;
- OPVP_Point point;
-#if !(ENABLE_SIMPLE_MODE)
- int rop = 0;
-#endif
-
- if (vector) {
- return gdev_vector_fill_rectangle( dev, x, y, w, h, color);
- }
-
- /* check page-in */
- if (opvp_check_in_page(pdev)) return -1;
-
-#if !(ENABLE_SIMPLE_MODE)
- /* call SaveGS */
- if (apiEntry->SaveGS)
- apiEntry->SaveGS(printerContext);
-#endif
-
- /* zero-color */
- opvp_set_brush_color(pdev, gx_no_color_index, &brush);
-
- /* call SetBgColor */
- if (apiEntry->SetBgColor)
- apiEntry->SetBgColor(printerContext, &brush);
-
- /* one-color */
- opvp_set_brush_color(pdev, color, &brush);
-
- /* call SetFillColor */
- if (apiEntry->SetFillColor)
- apiEntry->SetFillColor(printerContext, &brush);
-
-#if !(ENABLE_SIMPLE_MODE)
- /* save ROP */
- if (apiEntry->GetROP)
- apiEntry->GetROP(printerContext, &rop);
-#endif
- /* call SetROP */
- if (apiEntry->SetROP)
- apiEntry->SetROP(printerContext, 0xB8);
-
- /* call SetCurrentPoint */
- OPVP_i2Fix(x, point.x);
- OPVP_i2Fix(y, point.y);
- if (apiEntry->SetCurrentPoint)
- apiEntry->SetCurrentPoint(printerContext, point.x, point.y);
-
- /* draw image */
- code = opvp_draw_image(pdev,
- 1,
- 2, 2,
- w, h,
- 4,
- data);
- if (code) {
- ecode = code;
- }
-
-#if !(ENABLE_SIMPLE_MODE)
- /* restore ROP */
- if (rop) {
- /* call SetROP */
- if (apiEntry->SetROP)
- apiEntry->SetROP(printerContext, rop);
- }
-#endif
-
- /* restore fill color */
- if (vectorFillColor) {
- /* call SetFillColor */
- if (apiEntry->SetFillColor)
- apiEntry->SetFillColor(printerContext, vectorFillColor);
- }
-
-#if !(ENABLE_SIMPLE_MODE)
- /* call RestoreGS */
- if (apiEntry->RestoreGS)
- apiEntry->RestoreGS(printerContext);
-#endif
-
- return ecode;
-}
-
-/*
- * copy mono
- */
-private int
-opvp_copy_mono(
- gx_device *dev,
-/*const*/
- byte *data,
- int data_x,
- int raster,
- gx_bitmap_id id,
- int x,
- int y,
- int w,
- int h,
- gx_color_index zero,
- gx_color_index one
- )
-{
- gx_device_opvp *pdev = (gx_device_opvp *)dev;
- int code = -1;
- int ecode = 0;
- OPVP_Brush brush;
- OPVP_Point point;
- byte *buff = data;
- int i, j;
- byte *d;
- byte *s;
- int byte_offset = 0;
- int bit_offset = 0;
- int byte_length = raster;
- int bit_shift = 0;
- int trans_color = -1;
- int adj_raster = raster;
- int adj_height = h;
- char bit_mask = 0xff;
- int loop = 1;
-#if !(ENABLE_SIMPLE_MODE)
- int rop = 0;
-#endif
-
- /* check page-in */
- if (opvp_check_in_page(pdev)) return -1;
-
- /* data offset */
- if (data_x) {
- byte_offset = data_x >> 3;
- bit_offset = data_x & 0x07;
- if (bit_offset) bit_mask <<= (8 - bit_offset);
-
- if (zero == gx_no_color_index) {
- trans_color = 0;
- } else if (one == gx_no_color_index) {
- trans_color = 1;
- } else {
- trans_color = -1;
- bit_shift = bit_offset;
- bit_offset = 0;
- }
- byte_length = (((w + (bit_offset - bit_shift)) + 7) >> 3);
- adj_raster = ((byte_length + 3) >> 2) << 2;
-
- if (trans_color != -1) {
- loop = 1;
- adj_height = h;
- }
-
- buff = calloc(adj_raster, h);
- if (buff) {
- s = &(data[byte_offset]);
- d = buff;
- if (bit_shift) {
- for (i = 0;i < h; i++, d += adj_raster,
- s+= raster) {
- for (j = 0; j < byte_length; j++) {
- d[j] = ((s[j] & ~bit_mask)
- << bit_shift)
- | ((s[j + 1] & bit_mask)
- >> (8 - bit_shift));
- }
- }
- } else {
- for (i = 0;i < h; i++, d += adj_raster,
- s += raster) {
- memcpy(d, s, byte_length);
- if (bit_offset) {
- if (trans_color == 0) {
- *d &= ~bit_mask;
- } else {
- *d |= bit_mask;
- }
- }
- }
- }
- byte_offset = 0;
- } else {
- buff = data;
- loop = y;
- adj_raster = raster;
- adj_height = 1;
- if (bit_shift) bit_offset = bit_shift;
- }
- }
-
-#if !(ENABLE_SIMPLE_MODE)
- /* call SaveGS */
- if (apiEntry->SaveGS)
- apiEntry->SaveGS(printerContext);
-#endif
-
- /* zero-color */
- opvp_set_brush_color(pdev, zero, &brush);
-
- /* call SetBgColor */
- if (apiEntry->SetBgColor)
- apiEntry->SetBgColor(printerContext, &brush);
-
- /* one-color */
- opvp_set_brush_color(pdev, one, &brush);
-
- /* call SetFillColor */
- if (apiEntry->SetFillColor)
- apiEntry->SetFillColor(printerContext, &brush);
-
-#if !(ENABLE_SIMPLE_MODE)
- /* save ROP */
- if (apiEntry->GetROP)
- apiEntry->GetROP(printerContext, &rop);
-#endif
- /* call SetROP */
- if (zero == gx_no_color_index) {
- if (apiEntry->SetROP)
- apiEntry->SetROP(printerContext, 0xB8);
- } else {
- if (apiEntry->SetROP)
- apiEntry->SetROP(printerContext, 0xCC);
- }
-
- /* adjust */
- x -= bit_offset;
- w += bit_offset;
- h = adj_height;
-
- /* loop */
- for (i = 0; i < loop; i++, y += h) {
- /* call SetCurrentPoint */
- OPVP_i2Fix(x, point.x);
- OPVP_i2Fix(y, point.y);
- if (apiEntry->SetCurrentPoint)
- apiEntry->SetCurrentPoint(printerContext, point.x, point.y);
-
- /* draw image */
- code = opvp_draw_image(pdev,
- 1,
- w, h,
- w, h,
- adj_raster,
- &(buff[byte_offset + (adj_raster * i)]));
- if (code) {
- ecode = code;
- break;
- }
- }
-
-#if !(ENABLE_SIMPLE_MODE)
- /* restore ROP */
- if (rop) {
- /* call SetROP */
- if (apiEntry->SetROP)
- apiEntry->SetROP(printerContext, rop);
- }
-#endif
-
- /* restore fill color */
- if (vectorFillColor) {
- /* call SetFillColor */
- if (apiEntry->SetFillColor)
- apiEntry->SetFillColor(printerContext, vectorFillColor);
- }
-
-#if !(ENABLE_SIMPLE_MODE)
- /* call RestoreGS */
- if (apiEntry->RestoreGS)
- apiEntry->RestoreGS(printerContext);
-#endif
-
- if (buff != data) {
- if (buff) free(buff);
- }
-
- return ecode;
-}
-
-/*
- * copy color
- */
-private int
-opvp_copy_color(
- gx_device *dev,
-/*const*/
- byte *data,
- int data_x,
- int raster,
- gx_bitmap_id id,
- int x,
- int y,
- int w,
- int h
- )
-{
- gx_device_opvp *pdev = (gx_device_opvp *)dev;
- int code = -1;
- int ecode = 0;
- OPVP_Point point;
- byte *buff = data;
- int i;
- byte *d;
- byte *s;
- int byte_length = raster;
- int depth;
- int pixel;
- int adj_raster = raster;
- int adj_height = h;
- int loop = 1;
-#if !(ENABLE_SIMPLE_MODE)
- int j;
- int rop = 0;
-#endif
-
- /* check page-in */
- if (opvp_check_in_page(pdev)) return -1;
-
- /* data offset */
- if (data_x) {
- depth = pdev->color_info.depth;
- pixel = (depth + 7) >> 3;
- byte_length = pixel * w;
- adj_raster = ((byte_length + 3) >> 2) << 2;
-
- buff = malloc(adj_raster * h);
- if (buff) {
- s = &(data[data_x]);
- d = buff;
- for (i = 0;i < h; i++, d += adj_raster, s += raster) {
- memcpy(d, s, byte_length);
- }
- } else {
- buff = data;
- loop = y;
- adj_height = 1;
- adj_raster = raster;
- }
- }
-
-#if !(ENABLE_SIMPLE_MODE)
- /* call SaveGS */
- if (apiEntry->SaveGS)
- apiEntry->SaveGS(printerContext);
-#endif
-
-#if !(ENABLE_SIMPLE_MODE)
- /* save ROP */
- if (apiEntry->GetROP)
- apiEntry->GetROP(printerContext, &rop);
-#endif
- /* call SetROP */
- if (apiEntry->SetROP)
- apiEntry->SetROP(printerContext, 0xCC); /* SRCCOPY */
-
- /* adjust */
- h = adj_height;
-
- /* loop */
- for (i = 0; i < loop; i++, y += h) {
- /* call SetCurrentPoint */
- OPVP_i2Fix(x, point.x);
- OPVP_i2Fix(y, point.y);
- if (apiEntry->SetCurrentPoint)
- apiEntry->SetCurrentPoint(printerContext, point.x, point.y);
-
- /* draw image */
- code = opvp_draw_image(pdev,
- pdev->color_info.depth,
- w, h,
- w, h,
- adj_raster,
- &(buff[data_x + (adj_raster * i)]));
- if (code) {
- ecode = code;
- break;
- }
- }
-
-#if !(ENABLE_SIMPLE_MODE)
- /* restore ROP */
- if (rop) {
- /* call SetROP */
- if (apiEntry->SetROP)
- apiEntry->SetROP(printerContext, rop);
- }
-#endif
-
-#if !(ENABLE_SIMPLE_MODE)
- /* call RestoreGS */
- if (apiEntry->RestoreGS)
- apiEntry->RestoreGS(printerContext);
-#endif
-
- if (buff != data) {
- if (buff) free(buff);
- }
-
- return ecode;
-}
-
-/*
- * get params
- */
-private int
-_get_params(
- gs_param_list *plist
- )
-{
- int code;
- int ecode = 0;
- gs_param_name pname;
- gs_param_string vdps;
- gs_param_string pmps;
- gs_param_string jips;
- gs_param_string dips;
- gs_param_string fips;
- gs_param_string mlps;
- gs_param_string mtps;
- gs_param_string mrps;
- gs_param_string mbps;
- gs_param_string zmps;
- char buff[OPVP_BUFF_SIZE];
-
- /* get params */
-
- /* vector driver name */
- pname = "Driver";
- vdps.data = vectorDriver;
- vdps.size = (vectorDriver ? strlen(vectorDriver) + 1 : 0);
- vdps.persistent = false;
- code = param_write_string(plist, pname, &vdps);
- if (code) ecode = code;
-
- /* printer model name */
- pname = "Model";
- pmps.data = printerModel;
- pmps.size = (printerModel ? strlen(printerModel) + 1 : 0);
- pmps.persistent = false;
- code = param_write_string(plist, pname, &pmps);
- if (code) ecode = code;
-
- /* job info */
- pname = "JobInfo";
- jips.data = jobInfo;
- jips.size = (jobInfo ? strlen(jobInfo) + 1 : 0);
- jips.persistent = false;
- code = param_write_string(plist, pname, &jips);
- if (code) ecode = code;
-
- /* doc info */
- pname = "DocInfo";
- dips.data = docInfo;
- dips.size = (docInfo ? strlen(docInfo) + 1 : 0);
- dips.persistent = false;
- code = param_write_string(plist, pname, &dips);
- if (code) ecode = code;
-
- /* fast image support */
- switch (FastImageMode) {
- case FastImageNoCTM :
- opvp_alloc_string(&fastImage, "NoCTM");
- break;
- case FastImageNoRotate :
- opvp_alloc_string(&fastImage, "NoRotateCTM");
- break;
- case FastImageRightAngle :
- opvp_alloc_string(&fastImage, "RightAngleCTM");
- break;
- case FastImageReverseAngle :
- opvp_alloc_string(&fastImage, "ReverseAngleCTM");
- break;
- case FastImageAll :
- opvp_alloc_string(&fastImage, "All");
- break;
- case FastImageDisable :
- default :
- opvp_alloc_string(&fastImage, NULL);
- break;
- }
- pname = "FastImage";
- fips.data = fastImage;
- fips.size = (fastImage ? strlen(fastImage) + 1 : 0);
- fips.persistent = false;
- code = param_write_string(plist, pname, &fips);
- if (code) ecode = code;
-
- /* margins */
- memset((void*)buff, 0, OPVP_BUFF_SIZE);
- pname = "MarginLeft";
- snprintf(buff, OPVP_BUFF_SIZE - 1, "%f",margins[0]);
- mlps.data = buff;
- mlps.size = strlen(buff) + 1;
- mlps.persistent = false;
- code = param_write_string(plist, pname, &mlps);
- if (code) ecode = code;
- pname = "MarginTop";
- snprintf(buff, OPVP_BUFF_SIZE - 1, "%f",margins[3]);
- mtps.data = buff;
- mtps.size = strlen(buff) + 1;
- mtps.persistent = false;
- code = param_write_string(plist, pname, &mtps);
- if (code) ecode = code;
- pname = "MarginRight";
- snprintf(buff, OPVP_BUFF_SIZE - 1, "%f",margins[2]);
- mrps.data = buff;
- mrps.size = strlen(buff) + 1;
- mrps.persistent = false;
- code = param_write_string(plist, pname, &mrps);
- if (code) ecode = code;
- pname = "MarginBottom";
- snprintf(buff, OPVP_BUFF_SIZE - 1, "%f",margins[1]);
- mbps.data = buff;
- mbps.size = strlen(buff) + 1;
- mbps.persistent = false;
- code = param_write_string(plist, pname, &mbps);
- if (code) ecode = code;
-
- /* zoom */
- pname = "Zoom";
- snprintf(buff, OPVP_BUFF_SIZE - 1, "%f",zoom[0]);
- zmps.data = buff;
- zmps.size = strlen(buff) + 1;
- zmps.persistent = false;
- code = param_write_string(plist, pname, &zmps);
- if (code) ecode = code;
-
- return ecode;
-}
-
-/*
- * get params for vector
- */
-private int
-opvp_get_params(
- gx_device *dev,
- gs_param_list *plist
- )
-{
- int code;
-
- /* get default params */
- code = gdev_vector_get_params(dev, plist);
- if (code) return code;
-
- /* get params */
- return _get_params(plist);
-}
-
-/*
- * get params for inkjet
- */
-private int
-oprp_get_params(
- gx_device *dev,
- gs_param_list *plist
- )
-{
- int code;
-
- /* get default params */
- code = gdev_prn_get_params(dev, plist);
- if (code) return code;
-
- /* get params */
- return _get_params(plist);
-}
-
-/*
- * put params
- */
-private int
-_put_params(
- gs_param_list *plist
- )
-{
- int code;
- int ecode = 0;
- gs_param_name pname;
- char *buff = NULL;
- gs_param_string vdps;
- gs_param_string pmps;
- gs_param_string jips;
- gs_param_string dips;
- gs_param_string fips;
- gs_param_string mlps;
- gs_param_string mtps;
- gs_param_string mrps;
- gs_param_string mbps;
- gs_param_string zmps;
-
- /* vector driver name */
- pname = "Driver";
- code = param_read_string(plist, pname, &vdps);
- switch (code) {
- case 0 :
- buff = realloc(buff, vdps.size + 1);
- memcpy(buff, vdps.data, vdps.size);
- buff[vdps.size] = 0;
- opvp_alloc_string(&vectorDriver, buff);
- break;
- case 1 :
- /* opvp_alloc_string(&vectorDriver, NULL);*/
- break;
- default :
- ecode = code;
- param_signal_error(plist, pname, ecode);
- }
-
- /* printer model name */
- pname = "Model";
- code = param_read_string(plist, pname, &pmps);
- switch (code) {
- case 0 :
- buff = realloc(buff, pmps.size + 1);
- memcpy(buff, pmps.data, pmps.size);
- buff[pmps.size] = 0;
- opvp_alloc_string(&printerModel, buff);
- break;
- case 1 :
- /*opvp_alloc_string(&printerModel, NULL);*/
- break;
- default :
- ecode = code;
- param_signal_error(plist, pname, ecode);
- }
-
- /* job info */
- pname = "JobInfo";
- code = param_read_string(plist, pname, &jips);
- switch (code) {
- case 0 :
- buff = realloc(buff, jips.size + 1);
- memcpy(buff, jips.data, jips.size);
- buff[jips.size] = 0;
- opvp_alloc_string(&jobInfo, buff);
- break;
- case 1 :
- /*opvp_alloc_string(&jobInfo, NULL);*/
- break;
- default :
- ecode = code;
- param_signal_error(plist, pname, ecode);
- }
-
- /* doc info */
- pname = "DocInfo";
- code = param_read_string(plist, pname, &dips);
- switch (code) {
- case 0 :
- buff = realloc(buff, dips.size + 1);
- memcpy(buff, dips.data, dips.size);
- buff[dips.size] = 0;
- opvp_alloc_string(&docInfo, buff);
- break;
- case 1 :
- /*opvp_alloc_string(&docInfo, NULL);*/
- break;
- default :
- ecode = code;
- param_signal_error(plist, pname, ecode);
- }
-
- /* fast image support */
- pname = "FastImage";
- code = param_read_string(plist, pname, &fips);
- switch (code) {
- case 0 :
- buff = realloc(buff, fips.size + 1);
- memcpy(buff, fips.data, fips.size);
- buff[fips.size] = 0;
- opvp_alloc_string(&fastImage, buff);
- if (strcasecmp(fastImage,"NoCTM")==0) {
- FastImageMode = FastImageNoCTM;
- } else if (strncasecmp(fastImage,"NoRotate",8)==0) {
- FastImageMode = FastImageNoRotate;
- } else if (strncasecmp(fastImage,"Right",5)==0) {
- FastImageMode = FastImageRightAngle;
- } else if (strncasecmp(fastImage,"Reverse",7)==0) {
- FastImageMode = FastImageReverseAngle;
- } else if (strncasecmp(fastImage,"All",3)==0) {
- FastImageMode = FastImageAll;
- } else {
- FastImageMode = FastImageDisable;
- }
- break;
- case 1 :
- /*opvp_alloc_string(&fastImage, NULL);*/
- break;
- default :
- ecode = code;
- param_signal_error(plist, pname, ecode);
- }
-
- /* margins */
- pname = "MarginLeft";
- code = param_read_string(plist, pname, &mlps);
- switch (code) {
- case 0 :
- buff = realloc(buff, mlps.size + 1);
- memcpy(buff, mlps.data, mlps.size);
- buff[mlps.size] = 0;
- margins[0] = atof(buff);
- break;
- case 1 :
- break;
- default :
- ecode = code;
- param_signal_error(plist, pname, ecode);
- }
- pname = "MarginTop";
- code = param_read_string(plist, pname, &mtps);
- switch (code) {
- case 0 :
- buff = realloc(buff, mtps.size + 1);
- memcpy(buff, mtps.data, mtps.size);
- buff[mtps.size] = 0;
- margins[3] = atof(buff);
- break;
- case 1 :
- break;
- default :
- ecode = code;
- param_signal_error(plist, pname, ecode);
- }
- pname = "MarginRight";
- code = param_read_string(plist, pname, &mrps);
- switch (code) {
- case 0 :
- buff = realloc(buff, mrps.size + 1);
- memcpy(buff, mrps.data, mrps.size);
- buff[mrps.size] = 0;
- margins[2] = atof(buff);
- break;
- case 1 :
- break;
- default :
- ecode = code;
- param_signal_error(plist, pname, ecode);
- }
- pname = "MarginBottom";
- code = param_read_string(plist, pname, &mbps);
- switch (code) {
- case 0 :
- buff = realloc(buff, mbps.size + 1);
- memcpy(buff, mbps.data, mbps.size);
- buff[mbps.size] = 0;
- margins[1] = atof(buff);
- break;
- case 1 :
- break;
- default :
- ecode = code;
- param_signal_error(plist, pname, ecode);
- }
-
- /* zoom */
- pname = "Zoom";
- code = param_read_string(plist, pname, &zmps);
- switch (code) {
- case 0 :
- buff = realloc(buff, zmps.size + 1);
- memcpy(buff, zmps.data, zmps.size);
- buff[zmps.size] = 0;
- if (strncasecmp(buff, "Auto", 4)) {
- zoom[0] = atof(buff);
- if (zoom[0] > 0) {
- zoom[1] = zoom[0];
- } else {
- zoom[0] = zoom[1] = 1;
- }
- } else {
- zoom[0] = zoom[1] = 1;
- zoomAuto = true;
- }
- break;
- case 1 :
- break;
- default :
- ecode = code;
- param_signal_error(plist, pname, ecode);
- }
-
- if (buff) free(buff);
-
- return ecode;
-}
-
-/*
- * put params for vector
- */
-private int
-opvp_put_params(
- gx_device *dev,
- gs_param_list *plist
- )
-{
- int code;
-
- /* put params */
- code = _put_params(plist);
- if (code) return code;
-
- /* put default params */
- return gdev_vector_put_params(dev, plist);
-}
-
-/*
- * put params for inkjet
- */
-private int
-oprp_put_params(
- gx_device *dev,
- gs_param_list *plist
- )
-{
- int code;
-
- /* put params */
- code = _put_params(plist);
- if (code) return code;
-
- /* put default params */
- return gdev_prn_put_params(dev, plist);
-}
-
-/*
- * fill path
- */
-private int
-opvp_fill_path(
- gx_device *dev,
-const gs_imager_state *pis,
- gx_path *ppath,
-const gx_fill_params *params,
-const gx_device_color *pdevc,
-const gx_clip_path *pxpath
- )
-{
- bool draw_image = false;
- gs_fixed_rect inner, outer;
-
- /* check clippath support */
- if (!(apiEntry->SetClipPath)) {
- /* get clipping box area */
- gx_cpath_inner_box(pxpath,&inner);
- gx_cpath_outer_box(pxpath,&outer);
- /* check difference between inner-box and outer-box */
- if ((inner.p.x != outer.p.x) || (inner.p.y != outer.p.y) ||
- (inner.q.x != outer.q.x) || (inner.q.y != outer.q.y)) {
- /* set draw by image */
- draw_image = true;
- }
- }
-
- if (!vector || draw_image) {
- return gx_default_fill_path(dev, pis, ppath,
- params, pdevc, pxpath);
- }
-
- return gdev_vector_fill_path(dev, pis, ppath, params, pdevc, pxpath);
-}
-
-/*
- * stroke path
- */
-private int
-opvp_stroke_path(
- gx_device *dev,
-const gs_imager_state *pis,
- gx_path *ppath,
-const gx_stroke_params *params,
-const gx_drawing_color *pdcolor,
-const gx_clip_path *pxpath
- )
-{
- bool draw_image = false;
- gs_fixed_rect inner, outer;
-
- /* check clippath support */
- if (!(apiEntry->SetClipPath)) {
- /* get clipping box area */
- gx_cpath_inner_box(pxpath,&inner);
- gx_cpath_outer_box(pxpath,&outer);
- /* check difference between inner-box and outer-box */
- if ((inner.p.x != outer.p.x) || (inner.p.y != outer.p.y) ||
- (inner.q.x != outer.q.x) || (inner.q.y != outer.q.y)) {
- /* set draw by image */
- draw_image = true;
- }
- }
-
- if (!vector || draw_image) {
- return gx_default_stroke_path(dev, pis, ppath,
- params, pdcolor, pxpath);
- }
-
- return gdev_vector_stroke_path(dev, pis, ppath,
- params, pdcolor, pxpath);
-}
-
-/*
- * fill mask
- */
-private int
-opvp_fill_mask(
- gx_device *dev,
-const byte *data,
- int data_x,
- int raster,
- gx_bitmap_id id,
- int x,
- int y,
- int w,
- int h,
-const gx_drawing_color *pdcolor,
- int depth,
- gs_logical_operation_t lop,
-const gx_clip_path *pcpath
- )
-{
- if (vector) {
-#if GS_VERSION_MAJOR >= 8
- gdev_vector_update_fill_color((gx_device_vector *)dev, NULL, pdcolor); /* for gs 8.15 */
-#else
- gdev_vector_update_fill_color((gx_device_vector *)dev, pdcolor);
-#endif
- gdev_vector_update_clip_path((gx_device_vector *)dev, pcpath);
- gdev_vector_update_log_op((gx_device_vector *)dev, lop);
- }
-
- return gx_default_fill_mask(dev, data, data_x, raster, id,
- x, y, w, h, pdcolor, depth, lop, pcpath);
-}
-
-/*
- * begin image
- */
-private int
-opvp_begin_image(
- gx_device *dev,
-const gs_imager_state *pis,
-const gs_image_t *pim,
- gs_image_format_t format,
-const gs_int_rect *prect,
-const gx_drawing_color *pdcolor,
-const gx_clip_path *pcpath,
- gs_memory_t *mem,
- gx_image_enum_common_t **pinfo
- )
-{
- gx_device_vector *vdev =(gx_device_vector *)dev;
- gdev_vector_image_enum_t *vinfo;
- gs_matrix mtx;
- OPVP_CTM ctm;
- bool draw_image = false;
- bool supported_angle = false;
- int code = -1;
- int ecode = 0;
- OPVP_Rectangle rect;
- OPVP_Brush brush;
- int bits_per_pixel;
- bool can_reverse = false;
- int p;
- float mag[2] = {1, 1};
-const gs_color_space *pcs = pim->ColorSpace;
- gs_color_space_index index;
-
- color_index = 0;
-
- vinfo = gs_alloc_struct(mem, gdev_vector_image_enum_t,
- &st_vector_image_enum,
- "opvp_begin_image");
-
- if (vinfo) {
- memcpy(imageDecode,pim->Decode,sizeof(pim->Decode));
- vinfo->memory =mem;
- code = gdev_vector_begin_image(vdev, pis, pim, format, prect,
- pdcolor, pcpath, mem,
- &opvp_image_enum_procs,
- vinfo);
- if (code) ecode = code;
-
- if (!ecode) {
-#if 0 /* deleted to speed up 256-color image printing */
- /* check 256-color image, Thanks to T */
- /* Unavailiavle color space check */
- if (!(pim->ImageMask)) {
- index = gs_color_space_get_index(pcs);
- if (index == gs_color_space_index_Indexed)
- return gx_default_begin_image(
- dev, pis, pim, format,
- prect, pdcolor, pcpath,
- mem, pinfo);
- }
-#endif
- /* bits per pixel */
- for (bits_per_pixel=0, p=0; p < vinfo->num_planes; p++)
- bits_per_pixel += vinfo->plane_depths[p];
-
- /* for indexed color */
- if (!(pim->ImageMask)) {
- color_index = gs_color_space_get_index(pcs);
- if (color_index == gs_color_space_index_Indexed) {
- if (pcs->params.indexed.lookup.table.size > 3*256) {
- return gx_default_begin_image(
- dev, pis, pim, format,
- prect, pdcolor, pcpath,
- mem, pinfo);
- } else {
- memcpy(palette, pcs->params.indexed.lookup.table.data,\
- pcs->params.indexed.lookup.table.size);
- if (bits_per_pixel == 8)
- bits_per_pixel = 24;
- }
- }
- }
-
-#if ENABLE_AUTO_REVERSE
- if (bits_per_pixel % 8 == 0) {
- can_reverse = true;
- }
-#endif
- /* adjust matrix */
- reverse_image = false;
- gs_matrix_invert(&pim->ImageMatrix, &mtx);
- gs_matrix_multiply(&mtx, &ctm_only(pis), &mtx);
- switch (FastImageMode) {
- case FastImageNoCTM :
- if ((mtx.xy==0)&&(mtx.yx==0)&&
- (mtx.yy>=0)) {
- if (mtx.xx>=0) {
- mag[0] = mtx.xx;
- mag[1] = mtx.yy;
- mtx.xx = 1;
- mtx.yy = 1;
- supported_angle = true;
- } else if (can_reverse) {
- mtx.xx *= -1;
- mag[0] = mtx.xx;
- mag[1] = mtx.yy;
- mtx.xx = 1;
- mtx.yy = 1;
- mtx.tx -= vinfo->width
- * mag[0];
- supported_angle = true;
- reverse_image = true;
- }
- }
- break;
- case FastImageNoRotate :
- if ((mtx.xy==0)&&(mtx.yx==0)&&
- (mtx.yy>=0)) {
- if (mtx.xx>=0) {
- supported_angle = true;
- } else if (can_reverse) {
- mtx.xx *= -1;
- mtx.tx -= vinfo->width
- * mtx.xx;
- supported_angle = true;
- reverse_image = true;
- }
- }
- break;
- case FastImageRightAngle :
- if ((mtx.xy==0)&&(mtx.yx==0)) {
- if (((mtx.xx>=0)&&(mtx.yy>=0))||
- ((mtx.xx<=0)&&(mtx.yy<=0))){
- supported_angle = true;
- } else if (can_reverse) {
- mtx.xx *= -1;
- mtx.tx -= vinfo->width
- * mtx.xx;
- supported_angle = true;
- reverse_image = true;
- }
- } else if ((mtx.xx==0)&&(mtx.yy==0)) {
- if (((mtx.xy>=0)&&(mtx.yx<=0))||
- ((mtx.xy<=0)&&(mtx.yx>=0))){
- supported_angle = true;
- } else if (can_reverse) {
- mtx.xy *= -1;
- mtx.ty -= vinfo->height
- * mtx.xy;
- supported_angle = true;
- reverse_image = true;
- }
- }
- break;
- case FastImageReverseAngle :
- if (((mtx.xy==0)&&(mtx.yx==0))||
- ((mtx.xx==0)&&(mtx.yy==0))) {
- supported_angle = true;
- }
- break;
- case FastImageAll :
- supported_angle = true;
- break;
- case FastImageDisable :
- default :
- break;
- }
-#if 1
- if (supported_angle) {
- /* moveto */
- opvp_moveto(vdev, 0, 0, mtx.tx, mtx.ty, 0);
- }
-#endif
- if ((supported_angle) &&
- (FastImageMode != FastImageNoCTM)) {
- /* call SetCTM */
- ctm.a = mtx.xx;
- ctm.b = mtx.xy;
- ctm.c = mtx.yx;
- ctm.d = mtx.yy;
- ctm.e = mtx.tx;
- ctm.f = mtx.ty;
- if (apiEntry->SetCTM)
- code = apiEntry->SetCTM(printerContext, &ctm);
- else code = -1;
- if (code != OPVP_OK) ecode = code;
- }
- }
-
- if ((!ecode) && supported_angle) {
- if ((!prect) &&
- ((vinfo->num_planes == 1) ||
- ((vinfo->num_planes == 3) &&
- (vinfo->plane_depths[0] == 8) &&
- (vinfo->plane_depths[1] == 8) &&
- (vinfo->plane_depths[2] == 8))
- )
- ) {
- /*
- * avail only
- * 1 plane image
- * or
- * 3 planes 24 bits color image
- * (8 bits per plane)
- */
- if (apiEntry->StartDrawImage) {
- draw_image = true;
- }
- }
- }
- }
-
- if (draw_image) {
- *pinfo = (gx_image_enum_common_t *)vinfo;
-
- if (!ecode) {
-#if 0
- if (FastImageMode == FastImageNoCTM) {
- /* moveto */
- opvp_moveto(vdev, 0, 0, mtx.tx, mtx.ty, 0);
- } else {
- /* moveto new origin */
- opvp_moveto(vdev, 0, 0, 0, 0, 0);
- }
-#endif
-
-#if 0
- if ((vinfo->num_planes == 1) &&
- (vinfo->plane_depths[0] == 1)) {
- /* zero-color */
- opvp_set_brush_color((gx_device_opvp*)vdev,
- vdev->white, &brush);
- /* call SetBgColor */
- if (apiEntry->SetBgColor)
- apiEntry->SetBgColor(printerContext, &brush);
- /* one-color */
- opvp_set_brush_color((gx_device_opvp*)vdev,
- vdev->black, &brush);
- /* call SetFillColor */
- if (apiEntry->SetFillColor)
- apiEntry->SetFillColor(printerContext, &brush);
- }
-#endif
- /* call SetROP */
- if (apiEntry->SetROP)
- apiEntry->SetROP(printerContext, 0xCC);
- /* image size */
- OPVP_i2Fix(0, rect.p0.x);
- OPVP_i2Fix(0, rect.p0.y);
- if (mag[0] != 1) {
- OPVP_f2Fix(vinfo->width * mag[0], rect.p1.x);
- } else {
- OPVP_i2Fix(vinfo->width, rect.p1.x);
- }
- if (mag[1] != 1) {
- OPVP_f2Fix(vinfo->height * mag[1], rect.p1.y);
- } else {
- OPVP_i2Fix(vinfo->height, rect.p1.y);
- }
- /* call StartDrawImage */
- if (apiEntry->StartDrawImage)
- code = apiEntry->StartDrawImage(printerContext,
- vinfo->width,
- vinfo->height,
- bits_per_pixel,
- OPVP_iformatRaw,
- rect);
-
- /* bugfix for 32bit CMYK image print error */
- if(code != OPVP_OK) {
- if(apiEntry->ResetCTM)
- apiEntry->ResetCTM(printerContext); /* reset CTM */
- return gx_default_begin_image(dev, pis, pim, format,
- prect, pdcolor, pcpath, mem, pinfo);
- /* ecode = code; */
- }
- }
-
- if (!ecode) {
- begin_image = true;
- }
-
- return ecode;
- }
-
- return gx_default_begin_image(dev, pis, pim, format, prect,
- pdcolor, pcpath, mem, pinfo);
-}
-
-/*
- * plane data
- */
-private int
-opvp_image_plane_data(
- gx_image_enum_common_t *info,
-const gx_image_plane_t *planes,
- int height,
- int *rows_used
- )
-{
- gdev_vector_image_enum_t *vinfo;
- byte *tmp_buf = NULL;
- byte *buf = NULL;
- int bits_per_pixel;
- int data_bytes, dst_bytes;
- int raster_length, dst_length;
- int p;
- int x;
- int d;
- int h;
- int ecode = 0;
- int i, j;
- byte *src_ptr, *dst_ptr, *ppalette;
- byte *ptr;
- bbox_image_enum *pbe;
- gx_image_enum *tinfo;
- const gs_imager_state *pis;
-
- vinfo = (gdev_vector_image_enum_t *)info;
-
- if (!begin_image)
- return 0;
-
- for (bits_per_pixel=0, p=0; p < vinfo->num_planes; p++)
- bits_per_pixel += vinfo->plane_depths[p];
-
- data_bytes = (bits_per_pixel * vinfo->width + 7) >> 3;
- raster_length = ((data_bytes + 3) >> 2) << 2;
- buf = calloc(raster_length, height);
-
- if (vinfo->default_info) {
- gx_image_plane_data(vinfo->default_info, planes, height);
- }
- if (vinfo->bbox_info) {
- gx_image_plane_data(vinfo->bbox_info, planes, height);
- }
-
- if (buf) {
- if (vinfo->num_planes == 1) {
- for (h = 0; h < height; h++) {
- d = raster_length * h;
- if ((reverse_image) && (bits_per_pixel == 8)) {
- for (x = data_bytes * (h + 1) - 1;
- x >= data_bytes * h;
- x--, d++) {
- buf[d]
- = (byte)planes[0].data[x];
- }
- } else {
- memcpy(buf + d,
- planes[0].data
- + (data_bytes * h),
- data_bytes);
- }
- }
- } else {
- for (h = 0; h < height; h++) {
- d = raster_length * h;
- if (reverse_image) {
- for (x = vinfo->width * (h + 1) - 1;
- x >= vinfo->width * h;
- x--) {
- for (p = 0;
- p < vinfo->num_planes;
- p++, d++) {
- buf[d] = (byte)
- (planes[p].data[x]);
- }
- }
- } else {
- for (x = vinfo->width * h;
- x < vinfo->width * (h + 1);
- x++) {
- for (p = 0;
- p < vinfo->num_planes;
- p++, d++) {
- buf[d] = (byte)
- (planes[p].data[x]);
- }
- }
- }
- }
- }
-
- /* Convert 256 color -> RGB */
- if(color_index == gs_color_space_index_Indexed) { /* 256 color */
- if (vinfo->bits_per_pixel >= 8) { /* 8bit image */
- dst_bytes = data_bytes * 3;
- dst_length = ((dst_bytes + 3) >> 2) << 2;
-
- tmp_buf = calloc(dst_length, height);
- if (tmp_buf) {
- for (i = 0; i < height; i++) {
- src_ptr = buf + raster_length * i;
- dst_ptr = tmp_buf + dst_length * i;
- for (j = 0; j < data_bytes; j++) {
- ppalette = palette + src_ptr[j] * 3;
- dst_ptr[j*3] = ppalette[0]; /* R */
- dst_ptr[j*3 + 1] = ppalette[1]; /* G */
- dst_ptr[j*3 + 2] = ppalette[2]; /* B */
- }
- }
-
- free (buf);
- buf = tmp_buf;
- data_bytes = dst_bytes;
- raster_length = dst_length;
- vinfo->bits_per_pixel = 24;
- }
- } else { /* 1bit image */
- if (palette[0] == 0) { /* 0/1 reverse is needed */
- for (i = 0; i < height; i++) {
- src_ptr = buf + raster_length * i;
- for (j = 0; j < data_bytes; j++)
- src_ptr[j] ^= 0xff;
- }
- }
- }
- }
-
- /* Adjust image data gamma */
- pbe = (bbox_image_enum *)vinfo->bbox_info;
- tinfo = pbe->target_info;
- pis = tinfo->pis;
-
-#if GS_VERSION_MAJOR >= 8
- if (vinfo->bits_per_pixel == 24) { /* 24bit RGB color */
- for (i = 0; i < height; i++) {
- ptr = buf + raster_length * i;
- for (j = 0; j < vinfo->width; j++) {
- ptr[j*3] = min(255, frac2cv(gx_map_color_frac(pis, cv2frac(ptr[j*3]),\
- effective_transfer[0])));
- ptr[j*3+1] = min(255, frac2cv(gx_map_color_frac(pis, cv2frac(ptr[j*3+1]),\
- effective_transfer[1])));
- ptr[j*3+2] = min(255, frac2cv(gx_map_color_frac(pis, cv2frac(ptr[j*3+2]),\
- effective_transfer[2])));
- }
- }
- } else if (vinfo->bits_per_pixel == 8) { /* 8bit Gray image */
- for (i = 0; i < height; i++) {
- ptr = buf + raster_length * i;
- for (j=0; j < vinfo->width; j++) {
- ptr[j] = min(255, frac2cv(gx_map_color_frac(pis, cv2frac(ptr[j]),\
- effective_transfer[3])));
- }
- }
- } else if ((vinfo->bits_per_pixel == 1) && (color_index != gs_color_space_index_Indexed)) {/* 1bit gray */
- if (imageDecode[0] == 0) {
- for (i = 0; i < height; i++) {
- src_ptr = buf + raster_length * i;
- for (j = 0; j < data_bytes; j++)
- src_ptr[j] ^= 0xff;
- }
- }
- }
-#else
- if (vinfo->bits_per_pixel == 24) { /* 24bit RGB color */
- for (i = 0; i < height; i++) {
- ptr = buf + raster_length * i;
- for (j = 0; j < vinfo->width; j++) {
- ptr[j*3] = min(255, frac2cv(gx_map_color_frac(pis, cv2frac(ptr[j*3]),\
- effective_transfer.colored.red)));
- ptr[j*3+1] = min(255, frac2cv(gx_map_color_frac(pis, cv2frac(ptr[j*3+1]),\
- effective_transfer.colored.green)));
- ptr[j*3+2] = min(255, frac2cv(gx_map_color_frac(pis, cv2frac(ptr[j*3+2]),\
- effective_transfer.colored.blue)));
- }
- }
- } else if (vinfo->bits_per_pixel == 8) { /* 8bit Gray image */
- for (i = 0; i < height; i++) {
- ptr = buf + raster_length * i;
- for (j = 0; j < vinfo->width; j++) {
- ptr[j] = min(255, frac2cv(gx_map_color_frac(pis, cv2frac(ptr[j]),\
- effective_transfer.colored.gray)));
- }
- }
- } else if ((vinfo->bits_per_pixel == 1) && (color_index != gs_color_space_index_Indexed)) {/* 1bit gray */
- if (imageDecode[0] == 0) {
- for (i = 0; i < height; i++) {
- src_ptr = buf + raster_length * i;
- for (j = 0; j < data_bytes; j++)
- src_ptr[j] ^= 0xff;
- }
- }
- }
-#endif
-
- /* call TansferDrawImage */
- if (apiEntry->TransferDrawImage)
- apiEntry->TransferDrawImage(printerContext,
- raster_length * height,
- (void *)buf);
- if (buf)
- free(buf); /* free buffer */
- }
-
- vinfo->y += height;
- ecode = (vinfo->y >= vinfo->height);
-
- return ecode;
-}
-
-/*
- * end image
- */
-private int
-opvp_image_end_image(
- gx_image_enum_common_t *info,
- bool draw_last
- )
-{
- gx_device *dev = info->dev;
- gx_device_vector *vdev = (gx_device_vector *)dev;
- gdev_vector_image_enum_t *vinfo;
- OPVP_CTM ctm;
-
- vinfo = (gdev_vector_image_enum_t *)info;
-
- if (begin_image) {
- /* call EndDrawImage */
- if (apiEntry->EndDrawImage)
- apiEntry->EndDrawImage(printerContext);
-
- begin_image = false;
-
- if (FastImageMode != FastImageNoCTM) {
- /* call ResetCTM */
- if (apiEntry->ResetCTM)
- apiEntry->ResetCTM(printerContext);
- else {
- /* call SetCTM */
- ctm.a = 1;
- ctm.b = 0;
- ctm.c = 0;
- ctm.d = 1;
- ctm.e = 0;
- ctm.f = 0;
- if (apiEntry->SetCTM)
- apiEntry->SetCTM(printerContext, &ctm);
- }
- }
- if ((vinfo->num_planes == 1) &&
- (vinfo->plane_depths[0] == 1)) {
- /* restore fill color */
- if (vectorFillColor) {
- /* call SetFillColor */
- if (apiEntry->SetFillColor)
- apiEntry->SetFillColor(printerContext,
- vectorFillColor);
- }
- }
- }
-
- return gdev_vector_end_image(vdev, vinfo, draw_last, vdev->white);
-}
-
-/* ----- vector driver procs ----- */
-/*
- * begin page
- */
-private int
-opvp_beginpage(
- gx_device_vector *vdev
- )
-{
- gx_device_opvp *pdev = (gx_device_opvp *)vdev;
- int code = -1;
- int ecode = 0;
-
-#ifdef OPVP_IGNORE_BLANK_PAGE
- if (pdev->in_page) return 0;
-#endif
- /* start page */
- code = opvp_startpage((gx_device *)pdev);
- if (code) {
- ecode = code;
- } else {
- pdev->in_page = true; /* added '05.12.07 */
- beginPage = true;
- }
-
- return ecode;
-}
-
-/*
- * set line width
- */
-private int
-opvp_setlinewidth(
- gx_device_vector *vdev,
- floatp width
- )
-{
- gx_device_opvp *pdev = (gx_device_opvp *)vdev;
- int code = -1;
- int ecode = 0;
- OPVP_Fix w;
-
- /* check page-in */
- if (opvp_check_in_page(pdev)) return -1;
-
-#if 0
- if (width < 1) width = 1;
-#endif
-
- /* call SetLineWidth */
- OPVP_f2Fix(width, w);
- if (apiEntry->SetLineWidth)
- code = apiEntry->SetLineWidth(printerContext, w);
- if (code != OPVP_OK) {
- ecode = -1;
- }
-
- return ecode;
-}
-
-/*
- * set line cap
- */
-private int
-opvp_setlinecap(
- gx_device_vector *vdev,
- gs_line_cap cap
- )
-{
- gx_device_opvp *pdev = (gx_device_opvp *)vdev;
- int code = -1;
- int ecode = 0;
- OPVP_LineCap linecap;
-
- /* check page-in */
- if (opvp_check_in_page(pdev)) return -1;
-
- switch (cap) {
- case gs_cap_butt :
- linecap = OPVP_lineCapButt;
- break;
- case gs_cap_round :
- linecap = OPVP_lineCapRound;
- break;
- case gs_cap_square :
- linecap = OPVP_lineCapSquare;
- break;
- case gs_cap_triangle :
- default :
- linecap = OPVP_lineCapButt;
- break;
- }
-
- /* call SetLineCap */
- if (apiEntry->SetLineCap)
- code = apiEntry->SetLineCap(printerContext, linecap);
- if (code != OPVP_OK) {
- ecode = -1;
- }
-
- return ecode;
-}
-
-/*
- * set line join
- */
-private int
-opvp_setlinejoin(
- gx_device_vector *vdev,
- gs_line_join join
- )
-{
- gx_device_opvp *pdev = (gx_device_opvp *)vdev;
- int code = -1;
- int ecode = 0;
- OPVP_LineJoin linejoin;
-
- /* check page-in */
- if (opvp_check_in_page(pdev)) return -1;
-
- switch (join) {
- case gs_join_miter :
- linejoin = OPVP_lineJoinMiter;
- break;
- case gs_join_round :
- linejoin = OPVP_lineJoinRound;
- break;
- case gs_join_bevel :
- linejoin = OPVP_lineJoinBevel;
- break;
- case gs_join_none :
- case gs_join_triangle :
- default :
- linejoin = OPVP_lineCapButt;
- break;
- }
-
- /* call SetLineJoin */
- if (apiEntry->SetLineJoin)
- code = apiEntry->SetLineJoin(printerContext, linejoin);
- if (code != OPVP_OK) {
- ecode = -1;
- }
-
- return ecode;
-}
-
-/*
- * set miter limit
- */
-private int
-opvp_setmiterlimit(
- gx_device_vector *vdev,
- floatp limit
- )
-{
- gx_device_opvp *pdev = (gx_device_opvp *)vdev;
- int code = -1;
- int ecode = 0;
- OPVP_Fix l;
-
- /* check page-in */
- if (opvp_check_in_page(pdev)) return -1;
-
- /* call SetMiterLimit */
- OPVP_f2Fix(limit, l);
- if (apiEntry->SetMiterLimit)
- code = apiEntry->SetMiterLimit(printerContext, l);
- if (code != OPVP_OK) {
- ecode = -1;
- }
-
- return ecode;
-}
-
-/*
- * set dash
- */
-private int
-opvp_setdash(
- gx_device_vector *vdev,
- const float *pattern,
- uint count,
- floatp offset
- )
-{
- gx_device_opvp *pdev = (gx_device_opvp *)vdev;
- int code = -1;
- int ecode = 0;
- OPVP_Fix *p = NULL;
- OPVP_Fix o;
- int i;
-
- /* check page-in */
- if (opvp_check_in_page(pdev)) return -1;
-
- /* pattern */
- if (count) {
- p = calloc(sizeof(OPVP_Fix), count);
- if (p) {
- for (i = 0; i < count; i++) {
- OPVP_f2Fix(pattern[i], p[i]);
- }
- } else {
- ecode = -1;
- }
- }
-
- /* call SetLineDash */
- if (!ecode) {
- if (apiEntry->SetLineDash)
- code = apiEntry->SetLineDash(printerContext, p, count);
- if (code != OPVP_OK) {
- ecode = -1;
- }
- }
-
- /* call SetLineDashOffset */
- if (!ecode) {
- OPVP_f2Fix(offset, o);
- if (apiEntry->SetLineDashOffset)
- code = apiEntry->SetLineDashOffset(printerContext, o);
- if (code != OPVP_OK) {
- ecode = -1;
- }
- }
-
- /* call SetLineStyle */
- if (!ecode) {
- if (apiEntry->SetLineStyle)
- code = apiEntry->SetLineStyle(printerContext,
- (count ?
- OPVP_lineStyleDash :
- OPVP_lineStyleSolid));
- if (code != OPVP_OK) {
- ecode = -1;
- }
- }
-
- if (p) free(p);
-
- return ecode;
-}
-
-/*
- * set flat
- */
-private int
-opvp_setflat(
- gx_device_vector *vdev,
- floatp flatness
- )
-{
- gx_device_opvp *pdev = (gx_device_opvp *)vdev;
-/* int code = -1;*/
- int ecode = 0;
-
- /* check page-in */
- if (opvp_check_in_page(pdev)) return -1;
-
- /* what to do ? */
-
- return ecode;
-}
-
-/*
- * set logical operation
- */
-private int
-opvp_setlogop(
- gx_device_vector *vdev,
- gs_logical_operation_t lop,
- gs_logical_operation_t diff
- )
-{
- gx_device_opvp *pdev = (gx_device_opvp *)vdev;
- int code = -1;
- int ecode = 0;
-static int *prop = NULL;
-static int pnum = 0;
- int exist =0;
- int i;
- int rop = (lop_rop(lop)) & 0x00ff;
-
- /* check page-in */
- if (opvp_check_in_page(pdev)) return -1;
-
- if (!prop) {
- /* call QueryROP with NULL */
- if (!ecode) {
- if (apiEntry->QueryROP) {
- code = apiEntry->QueryROP(printerContext,
- &pnum, NULL);
- if (code != OPVP_OK) {
- ecode = -1;
- }
- }
- }
- }
-
- /* call QueryROP with array-pointer */
- if (!ecode && (pnum > 0)) {
- if (!prop) {
- if ((prop = calloc(sizeof(int), pnum))) {
- if (apiEntry->QueryROP)
- code = apiEntry->QueryROP(printerContext,
- &pnum, prop);
- if (code != OPVP_OK) {
- ecode = -1;
- }
- }
- }
- if (!ecode) {
- for (i = 0; i < pnum; i++ ) {
- if (prop[i] == rop) {
- exist = 1;
- break;
- }
- }
- }
- }
-
- /* call SetROP */
- if (!ecode) {
- if (!exist) {
- /* what to do ? */
- if (apiEntry->SetROP)
- apiEntry->SetROP(printerContext, 0xCC); /* SRCCOPY */
- } else {
- if (apiEntry->SetROP)
- code = apiEntry->SetROP(printerContext, rop);
- if (code != OPVP_OK) {
- ecode = -1;
- }
- }
- }
-
-#if !(ENABLE_SIMPLE_MODE)
- /* free buffer */
- if (prop) {
- free(prop);
- prop = NULL;
- }
-#endif
-
- return ecode;
-}
-
-#if GS_VERSION_MAJOR >= 8
-/*--- added for Ghostscritp 8.15 ---*/
-private int
-opvp_can_handle_hl_color(gx_device_vector * vdev, const gs_imager_state * pis1,
- const gx_drawing_color * pdc)
-{
- return false; /* High level color is not implemented yet. */
-}
-#endif
-
-/*
- * set fill color
- */
-#if GS_VERSION_MAJOR >= 8
-private int
-opvp_setfillcolor(
- gx_device_vector *vdev,
- const gs_imager_state *pis, /* added for gs 8.15 */
-const gx_drawing_color *pdc
- )
-#else
-private int
-opvp_setfillcolor(
- gx_device_vector *vdev,
-const gx_drawing_color *pdc
- )
-#endif
-{
- gx_device_opvp *pdev = (gx_device_opvp *)vdev;
- int code = -1;
- int ecode = 0;
- gx_color_index color;
-static OPVP_Brush brush;
-
- /* check page-in */
- if (opvp_check_in_page(pdev)) return -1;
-
- if (!gx_dc_is_pure(pdc)) return_error(gs_error_rangecheck);
-
- /* color */
- if (!vectorFillColor) vectorFillColor = &brush;
- color = gx_dc_pure_color(pdc);
- opvp_set_brush_color(pdev, color, vectorFillColor);
-
- /* call SetFillColor */
- if (apiEntry->SetFillColor)
- code = apiEntry->SetFillColor(printerContext, vectorFillColor);
- if (code != OPVP_OK) {
- ecode = -1;
- }
-
- return ecode;
-}
-
-/*
- * set stroke color
- */
-#if GS_VERSION_MAJOR >= 8
-private int
-opvp_setstrokecolor(
- gx_device_vector *vdev,
- const gs_imager_state *pis, /* added for gs 8.15 */
-const gx_drawing_color *pdc
- )
-#else
-private int
-opvp_setstrokecolor(
- gx_device_vector *vdev,
-const gx_drawing_color *pdc
- )
-#endif
-{
- gx_device_opvp *pdev = (gx_device_opvp *)vdev;
- int code = -1;
- int ecode = 0;
- gx_color_index color;
- OPVP_Brush brush;
-
- /* check page-in */
- if (opvp_check_in_page(pdev)) return -1;
-
- if (!gx_dc_is_pure(pdc)) return_error(gs_error_rangecheck);
-
- /* color */
- color = gx_dc_pure_color(pdc);
- opvp_set_brush_color(pdev, color, &brush);
-
- /* call SetStrokeColor */
- if (apiEntry->SetStrokeColor)
- code = apiEntry->SetStrokeColor(printerContext, &brush);
- if (code != OPVP_OK) {
- ecode = -1;
- }
-
- return ecode;
-}
-
-#define OPVP_OPT_MULTI_PATH
-
-/*
- * vector do path
- */
-private int
-opvp_vector_dopath(
- gx_device_vector *vdev,
-const gx_path *ppath,
- gx_path_type_t type,
-const gs_matrix *pmat
- )
-{
- gx_device_opvp *pdev = (gx_device_opvp *)vdev;
- int code = -1;
- int ecode = 0;
- gs_fixed_rect rect;
- gs_path_enum path;
- gs_point scale;
- int op;
-#ifdef OPVP_OPT_MULTI_PATH
- int i;
- int pop = 0;
- int npoints = 0;
- int *cp_num = NULL;
- _fPoint *points = NULL;
- OPVP_Point *opvp_p = NULL;
- _fPoint current;
- _fPoint check_p;
-#else
- _fPoint points[4];
-#endif
- _fPoint start;
- fixed vs[6];
- bool begin = true;
-
- /* check page-in */
- if (opvp_check_in_page(pdev)) return -1;
-
- if (gx_path_is_rectangle(ppath, &rect))
- return (*vdev_proc(vdev, dorect))(vdev,
- rect.p.x, rect.p.y,
- rect.q.x, rect.q.y,
- type);
-
- /* begin path */
- code = (*vdev_proc(vdev, beginpath))(vdev, type);
- if (code) ecode = code;
- scale = vdev->scale;
- gx_path_enum_init(&path, ppath);
-
- while (!ecode) {
-
- op = gx_path_enum_next(&path, (gs_fixed_point *)vs);
- if (begin) {
- /* start point */
- start.x = fixed2float(vs[0]) / scale.x;
- start.y = fixed2float(vs[1]) / scale.y;
- begin = false;
-
-#ifdef OPVP_OPT_MULTI_PATH
- npoints = 1;
- points = realloc(points, sizeof(_fPoint));
- current = start;
-#endif
-
- points[0] = start;
-
-#ifdef OPVP_OPT_MULTI_PATH
-
- } else if (op != pop) {
-
- /* convert float to Fix */
- opvp_p = realloc(opvp_p, sizeof(OPVP_Point) * npoints);
- for (i = 0; i < npoints; i++) {
- OPVP_f2Fix(points[i].x, opvp_p[i].x);
- OPVP_f2Fix(points[i].y, opvp_p[i].y);
- }
-
- switch (pop) {
-
- case gs_pe_moveto :
-
- /* call SetCurrentPoint */
- if (apiEntry->SetCurrentPoint)
- code = apiEntry->SetCurrentPoint(
- printerContext,
- opvp_p[npoints-1].x,
- opvp_p[npoints-1].y);
- if (code != OPVP_OK) ecode = -1;
-
- break;
-
- case gs_pe_lineto :
-
- /* call LinePath */
- if (apiEntry->LinePath)
- code = apiEntry->LinePath(
- printerContext,
- OPVP_PathOpen,
- npoints - 1,
- &(opvp_p[1]));
- if (code != OPVP_OK) ecode = -1;
-
- break;
-
- case gs_pe_curveto :
-
- /* npoints */
- if (!cp_num)
- cp_num = calloc(sizeof(int), 2);
- cp_num[0] = npoints;
- cp_num[1] = 0;
-
- /* call BezierPath */
- if (apiEntry->BezierPath)
- code = apiEntry->BezierPath(
- printerContext,
-#if (_PDAPI_VERSION_MAJOR_ == 0 && _PDAPI_VERSION_MINOR_ < 2)
- cp_num,
- opvp_p
-#else
- npoints - 1,
- &(opvp_p[1])
-#endif
- );
- if (code != OPVP_OK) ecode = -1;
-
- break;
-
- case gs_pe_closepath :
-
- /* close path */
- break;
-
- default :
-
- /* error */
- return_error(gs_error_unknownerror);
-
- break;
- }
-
- /* reset */
- npoints = 1;
- if (cp_num) free(cp_num), cp_num = NULL;
- points = realloc(points, sizeof(_fPoint));
- points[0] = current;
-
-#endif
- }
-
- if (!op) break; /* END */
-
- switch (op) {
-
- case gs_pe_moveto :
-
-#ifdef OPVP_OPT_MULTI_PATH
-
- /* move to */
- i = npoints;
- npoints += 1;
- points = realloc(points,
- sizeof(_fPoint) * npoints);
- points[i].x = fixed2float(vs[0]) / scale.x;
- points[i].y = fixed2float(vs[1]) / scale.y;
- current = points[i];
- start = current;
-
-#else
-
- /* move to */
- points[1].x = fixed2float(vs[0]) / scale.x;
- points[1].y = fixed2float(vs[1]) / scale.y;
- code = (*vdev_proc(vdev, moveto))(vdev,
- points[0].x,
- points[0].y,
- points[1].x,
- points[1].y,
- type);
- if (code) ecode = code;
- points[0] = points[1];
- start = points[0];
-#endif
-
- break;
-
- case gs_pe_lineto :
-
-#ifdef OPVP_OPT_MULTI_PATH
-
- /* line to */
- i = npoints;
- npoints += 1;
- points = realloc(points,
- sizeof(_fPoint) * npoints);
- points[i].x = fixed2float(vs[0]) / scale.x;
- points[i].y = fixed2float(vs[1]) / scale.y;
- current = points[i];
-
-#else
-
- /* line to */
- points[1].x = fixed2float(vs[0]) / scale.x;
- points[1].y = fixed2float(vs[1]) / scale.y;
- code = (*vdev_proc(vdev, lineto))(vdev,
- points[0].x,
- points[0].y,
- points[1].x,
- points[1].y,
- type);
- if (code) ecode = code;
- points[0] = points[1];
-#endif
-
- break;
-
- case gs_pe_curveto :
-
-#ifdef OPVP_OPT_MULTI_PATH
-
- /* curve to */
- check_p.x = fixed2float(vs[0]) / scale.x;
- check_p.y = fixed2float(vs[1]) / scale.y;
-
- i = npoints;
- npoints += 3;
- points = realloc(points,
- sizeof(_fPoint) * npoints);
- points[i ].x = fixed2float(vs[0]) / scale.x;
- points[i ].y = fixed2float(vs[1]) / scale.y;
- points[i+1].x = fixed2float(vs[2]) / scale.x;
- points[i+1].y = fixed2float(vs[3]) / scale.y;
- points[i+2].x = fixed2float(vs[4]) / scale.x;
- points[i+2].y = fixed2float(vs[5]) / scale.y;
- current = points[i+2];
-
-#else
-
- /* curve to */
- points[1].x = fixed2float(vs[0]) / scale.x;
- points[1].y = fixed2float(vs[1]) / scale.y;
- points[2].x = fixed2float(vs[2]) / scale.x;
- points[2].y = fixed2float(vs[3]) / scale.y;
- points[3].x = fixed2float(vs[4]) / scale.x;
- points[3].y = fixed2float(vs[5]) / scale.y;
- code = (*vdev_proc(vdev, curveto))(vdev,
- points[0].x,
- points[0].y,
- points[1].x,
- points[1].y,
- points[2].x,
- points[2].y,
- points[3].x,
- points[3].y,
- type);
- if (code) ecode = code;
- points[0] = points[3];
-#endif
-
- break;
-
- case gs_pe_closepath :
-
- /* close path */
- code = (*vdev_proc(vdev, closepath))(
- vdev,
- points[0].x,
- points[0].y,
- start.x,
- start.y,
- type);
- if (code) ecode = code;
- points[0] = start;
-
-#ifdef OPVP_OPT_MULTI_PATH
- current = start;
-#endif
-
- break;
-
- default :
-
- /* error */
- return_error(gs_error_unknownerror);
-
- break;
- }
-
-#ifdef OPVP_OPT_MULTI_PATH
- pop = op;
-#endif
- }
-
- /* end path */
- code = (*vdev_proc(vdev, endpath))(vdev, type);
- if (code) ecode = code;
-
-#ifdef OPVP_OPT_MULTI_PATH
- if (points) free(points);
- if (opvp_p) free(opvp_p);
- if (cp_num) free(cp_num);
-#endif
- return ecode;
-}
-
-/*
- * vector do rect
- */
-private int
-opvp_vector_dorect(
- gx_device_vector *vdev,
- fixed x0,
- fixed y0,
- fixed x1,
- fixed y1,
- gx_path_type_t type
- )
-{
- gx_device_opvp *pdev = (gx_device_opvp *)vdev;
- int code = -1;
- int ecode = 0;
- gs_point scale;
- OPVP_Rectangle rectangles[1];
- _fPoint p;
-
- /* check page-in */
- if (opvp_check_in_page(pdev)) return -1;
-
- /* begin path */
- code = (*vdev_proc(vdev, beginpath))(vdev, type);
- if (code) ecode = code;
- scale = vdev->scale;
-
- if (!ecode) {
-
- /* rectangle */
- p.x = fixed2float(x0) / scale.x;
- p.y = fixed2float(y0) / scale.y;
- OPVP_f2Fix(p.x, rectangles[0].p0.x);
- OPVP_f2Fix(p.y, rectangles[0].p0.y);
- p.x = fixed2float(x1) / scale.x;
- p.y = fixed2float(y1) / scale.y;
- OPVP_f2Fix(p.x, rectangles[0].p1.x);
- OPVP_f2Fix(p.y, rectangles[0].p1.y);
-
- /* call RectanglePath */
- if (apiEntry->RectanglePath)
- code = apiEntry->RectanglePath(printerContext,
- 1,
- rectangles);
- if (code != OPVP_OK) {
- ecode = -1;
- }
-
- }
-
- /* end path */
- if (!ecode) {
- code = (*vdev_proc(vdev, endpath))(vdev, type);
- if (code) ecode = code;
- }
-
- /* fallback */
- if (ecode) return gdev_vector_dorect(vdev,x0,y0,x1,y1,type);
-
- return ecode;
-}
-
-/*
- * begin path
- */
-private int
-opvp_beginpath(
- gx_device_vector *vdev,
- gx_path_type_t type
- )
-{
- gx_device_opvp *pdev = (gx_device_opvp *)vdev;
- int code = -1;
- int ecode = 0;
-
- /* check page-in */
- if (opvp_check_in_page(pdev)) return -1;
-
-#if (_PDAPI_VERSION_MAJOR_ > 0 || _PDAPI_VERSION_MINOR_ >= 2)
- /* check clip-path */
- if (type & gx_path_type_clip) {
- if (apiEntry->ResetClipPath)
- apiEntry->ResetClipPath(printerContext);
- }
-#endif
-
- /* call NewPath */
- if (apiEntry->NewPath)
- code = apiEntry->NewPath(printerContext);
- if (code != OPVP_OK) {
- ecode = -1;
- }
-
- return ecode;
-}
-
-/*
- * move to
- */
-private int
-opvp_moveto(
- gx_device_vector *vdev,
- floatp x0,
- floatp y0,
- floatp x1,
- floatp y1,
- gx_path_type_t type
- )
-{
- gx_device_opvp *pdev = (gx_device_opvp *)vdev;
- int code = -1;
- int ecode = 0;
- OPVP_Point p;
-
- /* check page-in */
- if (opvp_check_in_page(pdev)) return -1;
-
- /* call SetCurrentPoint */
- OPVP_f2Fix(x1, p.x);
- OPVP_f2Fix(y1, p.y);
- if (apiEntry->SetCurrentPoint)
- code = apiEntry->SetCurrentPoint(printerContext, p.x, p.y);
- if (code != OPVP_OK) {
- ecode = -1;
- }
-
- return ecode;
-}
-
-/*
- * line to
- */
-private int
-opvp_lineto(
- gx_device_vector *vdev,
- floatp x0,
- floatp y0,
- floatp x1,
- floatp y1,
- gx_path_type_t type
- )
-{
- gx_device_opvp *pdev = (gx_device_opvp *)vdev;
- int code = -1;
- int ecode = 0;
- OPVP_Point points[1];
-
- /* check page-in */
- if (opvp_check_in_page(pdev)) return -1;
-
- /* point */
- OPVP_f2Fix(x1, points[0].x);
- OPVP_f2Fix(y1, points[0].y);
-
- /* call LinePath */
- if (apiEntry->LinePath)
- code = apiEntry->LinePath(printerContext, OPVP_PathOpen, 1, points);
- if (code != OPVP_OK) {
- ecode = -1;
- }
-
- return ecode;
-}
-
-/*
- * curve to
- */
-private int
-opvp_curveto(
- gx_device_vector *vdev,
- floatp x0,
- floatp y0,
- floatp x1,
- floatp y1,
- floatp x2,
- floatp y2,
- floatp x3,
- floatp y3,
- gx_path_type_t type
- )
-{
- gx_device_opvp *pdev = (gx_device_opvp *)vdev;
- int code = -1;
- int ecode = 0;
- int npoints[2];
- OPVP_Point points[4];
-
- /* check page-in */
- if (opvp_check_in_page(pdev)) return -1;
-
- /* points */
- npoints[0] = 4;
- npoints[1] = 0;
- OPVP_f2Fix(x0, points[0].x);
- OPVP_f2Fix(y0, points[0].y);
- OPVP_f2Fix(x1, points[1].x);
- OPVP_f2Fix(y1, points[1].y);
- OPVP_f2Fix(x2, points[2].x);
- OPVP_f2Fix(y2, points[2].y);
- OPVP_f2Fix(x3, points[3].x);
- OPVP_f2Fix(y3, points[3].y);
-
- /* call BezierPath */
- if (apiEntry->BezierPath)
- code = apiEntry->BezierPath(printerContext,
-#if (_PDAPI_VERSION_MAJOR_ == 0 && _PDAPI_VERSION_MINOR_ < 2)
- npoints,
- points
-#else
- 3,
- &(points[1])
-#endif
- );
- if (code != OPVP_OK) {
- ecode = -1;
- }
-
- return ecode;
-}
-
-/*
- * close path
- */
-private int
-opvp_closepath(
- gx_device_vector *vdev,
- floatp x,
- floatp y,
- floatp x_start,
- floatp y_start,
- gx_path_type_t type
- )
-{
- gx_device_opvp *pdev = (gx_device_opvp *)vdev;
- int code = -1;
- int ecode = 0;
- OPVP_Point points[1];
-
- /* check page-in */
- if (opvp_check_in_page(pdev)) return -1;
-
- /* point */
- OPVP_f2Fix(x_start, points[0].x);
- OPVP_f2Fix(y_start, points[0].y);
-
- /* call LinePath */
- if (apiEntry->LinePath)
- code = apiEntry->LinePath(printerContext, OPVP_PathClose, 1, points);
- if (code != OPVP_OK) {
- ecode = -1;
- }
-
- return ecode;
-}
-
-/*
- * end path
- */
-private int
-opvp_endpath(
- gx_device_vector *vdev,
- gx_path_type_t type
- )
-{
- gx_device_opvp *pdev = (gx_device_opvp *)vdev;
- int code = -1;
- int ecode = 0;
-
- /* check page-in */
- if (opvp_check_in_page(pdev)) return -1;
-
- /* call EndPath */
- if (apiEntry->EndPath)
- code = apiEntry->EndPath(printerContext);
- if (code != OPVP_OK) {
- ecode = -1;
- }
-
- if (type & gx_path_type_fill) {
-
- /* fill mode */
- if (type & gx_path_type_even_odd) {
- /* call SetFillMode */
- if (apiEntry->SetFillMode)
- code = apiEntry->SetFillMode(
- printerContext,
- OPVP_fillModeEvenOdd
- );
- if (code != OPVP_OK) {
- ecode = -1;
- }
- } else {
- /* call SetFillMode */
- if (apiEntry->SetFillMode)
- code = apiEntry->SetFillMode(
- printerContext,
- OPVP_fillModeWinding
- );
- if (code != OPVP_OK) {
- ecode = -1;
- }
- }
-
- if (type & gx_path_type_stroke) {
- /* call StrokeFillPath */
- if (apiEntry->StrokeFillPath)
- code = apiEntry->StrokeFillPath(
- printerContext);
- if (code != OPVP_OK) {
- ecode = -1;
- }
- } else {
- /* call FillPath */
- if (apiEntry->FillPath)
- code = apiEntry->FillPath(printerContext);
- if (code != OPVP_OK) {
- ecode = -1;
- }
- }
-
- } else if (type & gx_path_type_clip) {
-
- /* call SetClipPath */
- if (apiEntry->SetClipPath)
- code = apiEntry->SetClipPath(
- printerContext,
- (type & gx_path_type_even_odd ? OPVP_clipRuleEvenOdd
- : OPVP_clipRuleWinding)
- );
- if (code != OPVP_OK) {
- ecode = -1;
- }
-
- } else if (type & gx_path_type_stroke) {
-
- /* call StrokePath */
- if (apiEntry->StrokePath)
- code = apiEntry->StrokePath(printerContext);
- if (code != OPVP_OK) {
- ecode = -1;
- }
-
- }
-
- return ecode;
-}
diff --git a/gs/contrib/opvp/opvp_common.h b/gs/contrib/opvp/opvp_common.h
deleted file mode 100644
index 54edb035f..000000000
--- a/gs/contrib/opvp/opvp_common.h
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
-
-Copyright (c) 2003-2004, AXE, Inc. All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-*/
-/* $Id: opvp_common.h,v 1.4 2005/06/10 16:53:36 gishi Exp $ */
-/* opvp_common.h ver.1.00 rel.1.0 26 Nov 2004 */
-/* OpenPrinting Vector Printer Driver Glue Code */
-
-#ifndef _OPVP_COMMON_H_
-#define _OPVP_COMMON_H_
-
-#define _PDAPI_VERSION_MAJOR_ 0
-#define _PDAPI_VERSION_MINOR_ 2
-
-/* Return Values */
-#define OPVP_OK 0 /* error is -1 */
-
-/* Error Codes */
-#define OPVP_FATALERROR -101 /* unrecoverable error occurred within the */
- /* library */
-#define OPVP_BADREQUEST -102 /* invalid function parameters */
-#define OPVP_BADCONTEXT -103 /* bad parameter precontext */
-#define OPVP_NOTSUPPORTED -104 /* printer or driver request not supported */
-#define OPVP_JOBCANCELED -105 /* job cancelled */
-#define OPVP_PARAMERROR -106 /* illegal parameter combination */
-
-/* Info params */
-#define OPVP_INFO_PREFIX "updf:"
-
-/* Fix */
-#define OPVP_FIX_FRACT_WIDTH 8
-#define OPVP_FIX_FRACT_DENOM (1<<OPVP_FIX_FRACT_WIDTH)
-#define OPVP_FIX_FLOOR_WIDTH (sizeof(int)*8-OPVP_FIX_FRACT_WIDTH)
-#if 0
-typedef struct {
- unsigned int fract : OPVP_FIX_FRACT_WIDTH;
- signed int floor : OPVP_FIX_FLOOR_WIDTH;
-} OPVP_Fix;
-#define OPVP_i2Fix(i,fix) (fix.fract=0,fix.floor=i)
-#define OPVP_Fix2f(fix,f) (f=(double)fix.floor\
- +(double)(fix.fract)/OPVP_FIX_FRACT_DENOM)
-#define OPVP_f2Fix(f,fix) (fix.fract=(f-floor(f))*OPVP_FIX_FRACT_DENOM,\
- fix.floor=floor(f))
-#else
-typedef int OPVP_Fix;
-#define OPVP_i2Fix(i,fix) (fix=i<<8)
-#define OPVP_f2Fix(f,fix) (fix=((int)floor(f)<<8)\
- |((int)((f-floor(f))*OPVP_FIX_FRACT_DENOM)\
- &0x000000ff))
-#endif
-
-/* Basic Types */
-typedef struct _OPVP_Point {
- OPVP_Fix x;
- OPVP_Fix y;
-} OPVP_Point;
-
-typedef struct _OPVP_Rectangle {
- OPVP_Point p0; /* start point */
- OPVP_Point p1; /* end point */
-} OPVP_Rectangle;
-
-typedef struct _OPVP_RoundRectangle {
- OPVP_Point p0; /* start point */
- OPVP_Point p1; /* end point */
- OPVP_Fix xellipse;
- OPVP_Fix yellipse;
-} OPVP_RoundRectangle;
-
-/* Image Formats */
-typedef enum _OPVP_ImageFormat {
- OPVP_iformatRaw = 0,
- OPVP_iformatRLE = 1,
- OPVP_iformatJPEG = 2,
- OPVP_iformatPNG = 3
-} OPVP_ImageFormat;
-
-/* Color Presentation */
-typedef enum _OPVP_ColorMapping {
- OPVP_cmapDirect = 0,
- OPVP_cmapIndexed = 1
-} OPVP_ColorMapping;
-
-typedef enum _OPVP_ColorSpace {
- OPVP_cspaceBW = 0,
- OPVP_cspaceDeviceGray = 1,
- OPVP_cspaceDeviceCMY = 2,
- OPVP_cspaceDeviceCMYK = 3,
- OPVP_cspaceDeviceRGB = 4,
- OPVP_cspaceStandardRGB = 5,
- OPVP_cspaceStandardRGB64 = 6
-} OPVP_ColorSpace;
-
-/* Raster Operation modes */
-typedef enum _OPVP_ROP {
- OPVP_ropPset = 0,
- OPVP_ropPreset = 1,
- OPVP_ropOr = 2,
- OPVP_ropAnd = 3,
- OPVP_ropXor = 4
-} OPVP_ROP;
-
-/* Fill, Paint, Clip */
-typedef enum _OPVP_FillMode {
- OPVP_fillModeEvenOdd = 0,
- OPVP_fillModeWinding = 1
-} OPVP_FillMode;
-
-typedef enum _OPVP_PaintMode {
- OPVP_paintModeOpaque = 0,
- OPVP_paintModeTransparent = 1
-} OPVP_PaintMode;
-
-typedef enum _OPVP_ClipRule {
- OPVP_clipRuleEvenOdd = 0,
- OPVP_clipRuleWinding = 1
-} OPVP_ClipRule;
-
-/* Line */
-typedef enum _OPVP_LineStyle {
- OPVP_lineStyleSolid = 0,
- OPVP_lineStyleDash = 1
-} OPVP_LineStyle;
-
-typedef enum _OPVP_LineCap {
- OPVP_lineCapButt = 0,
- OPVP_lineCapRound = 1,
- OPVP_lineCapSquare = 2
-} OPVP_LineCap;
-
-typedef enum _OPVP_LineJoin {
- OPVP_lineJoinMiter = 0,
- OPVP_lineJoinRound = 1,
- OPVP_lineJoinBevel = 2
-} OPVP_LineJoin;
-
-/* Brush */
-typedef enum _OPVP_BrushDataType {
- OPVP_bdtypeNormal = 0
-} OPVP_BrushDataType;
-
-typedef struct _OPVP_BrushData {
- OPVP_BrushDataType type;
- int width;
- int height;
- int pitch;
-#if (_PDAPI_VERSION_MAJOR_ == 0 && _PDAPI_VERSION_MINOR_ < 2)
- void *data; /* pointer to actual data */
-#else
- char data[1];
-#endif
-} OPVP_BrushData;
-
-typedef struct _OPVP_Brush {
- OPVP_ColorSpace colorSpace;
- int color[4]; /* aRGB quadruplet */
-#if (_PDAPI_VERSION_MAJOR_ == 0 && _PDAPI_VERSION_MINOR_ < 2)
- OPVP_BrushData *pbrush; /* pointer to brush data */
- /* solid brush used, if null */
- int xorg; /* brush origin */
- int yorg; /* ignored for SetBgColor */
-#else
- int xorg; /* brush origin */
- int yorg; /* ignored for SetBgColor */
- OPVP_BrushData *pbrush; /* pointer to brush data */
- /* solid brush used, if null */
-#endif
-} OPVP_Brush;
-
-/* Misc. Flags */
-#define OPVP_Arc 0 /* circular arc */
-#define OPVP_Chord 1 /* arch */
-#define OPVP_Pie 2 /* pie section */
-#define OPVP_Clockwise 0 /* clockwise */
-#define OPVP_Counterclockwise 1 /* counter-clockwise */
-#define OPVP_PathClose 0 /* Close path when using LinePath */
-#define OPVP_PathOpen 1 /* Do not close path when using LinePath */
-
-/* CTM */
-typedef struct _OPVP_CTM {
- float a;
- float b;
- float c;
- float d;
- float e;
- float f;
-} OPVP_CTM;
-
-/* Vector Driver API Proc. Entries */
-typedef struct _OPVP_api_procs {
- int (*OpenPrinter)(int,char *,int *,struct _OPVP_api_procs **);
- int (*ClosePrinter)(int);
- int (*StartJob)(int,char *);
- int (*EndJob)(int);
- int (*StartDoc)(int,char *);
- int (*EndDoc)(int);
- int (*StartPage)(int,char *);
- int (*EndPage)(int);
-#if (_PDAPI_VERSION_MAJOR_ > 0 || _PDAPI_VERSION_MINOR_ >= 2)
- int (*QueryDeviceCapability)(int,int,int,char *);
- int (*QueryDeviceInfo)(int,int,int,char *);
-#endif
- int (*ResetCTM)(int);
- int (*SetCTM)(int,OPVP_CTM *);
- int (*GetCTM)(int,OPVP_CTM *);
- int (*InitGS)(int);
- int (*SaveGS)(int);
- int (*RestoreGS)(int);
- int (*QueryColorSpace)(int,OPVP_ColorSpace *,int *);
- int (*SetColorSpace)(int,OPVP_ColorSpace);
- int (*GetColorSpace)(int,OPVP_ColorSpace *);
- int (*QueryROP)(int,int *,int *);
- int (*SetROP)(int,int);
- int (*GetROP)(int,int *);
- int (*SetFillMode)(int,OPVP_FillMode);
- int (*GetFillMode)(int,OPVP_FillMode *);
- int (*SetAlphaConstant)(int,float);
- int (*GetAlphaConstant)(int,float *);
- int (*SetLineWidth)(int,OPVP_Fix);
- int (*GetLineWidth)(int,OPVP_Fix *);
- int (*SetLineDash)(int,OPVP_Fix *,int);
- int (*GetLineDash)(int,OPVP_Fix *,int *);
- int (*SetLineDashOffset)(int,OPVP_Fix);
- int (*GetLineDashOffset)(int,OPVP_Fix *);
- int (*SetLineStyle)(int,OPVP_LineStyle);
- int (*GetLineStyle)(int,OPVP_LineStyle *);
- int (*SetLineCap)(int,OPVP_LineCap);
- int (*GetLineCap)(int,OPVP_LineCap *);
- int (*SetLineJoin)(int,OPVP_LineJoin);
- int (*GetLineJoin)(int,OPVP_LineJoin *);
- int (*SetMiterLimit)(int,OPVP_Fix);
- int (*GetMiterLimit)(int,OPVP_Fix *);
- int (*SetPaintMode)(int,OPVP_PaintMode);
- int (*GetPaintMode)(int,OPVP_PaintMode *);
- int (*SetStrokeColor)(int,OPVP_Brush *);
- int (*SetFillColor)(int,OPVP_Brush *);
- int (*SetBgColor)(int,OPVP_Brush *);
- int (*NewPath)(int);
- int (*EndPath)(int);
- int (*StrokePath)(int);
- int (*FillPath)(int);
- int (*StrokeFillPath)(int);
- int (*SetClipPath)(int,OPVP_ClipRule);
-#if (_PDAPI_VERSION_MAJOR_ > 0 || _PDAPI_VERSION_MINOR_ >= 2)
- int (*ResetClipPath)(int);
-#endif
- int (*SetCurrentPoint)(int,OPVP_Fix,OPVP_Fix);
- int (*LinePath)(int,int,int,OPVP_Point *);
- int (*PolygonPath)(int,int,int *,OPVP_Point *);
- int (*RectanglePath)(int,int,OPVP_Rectangle *);
- int (*RoundRectanglePath)(int,int,OPVP_RoundRectangle *);
-#if (_PDAPI_VERSION_MAJOR_ == 0 && _PDAPI_VERSION_MINOR_ < 2)
- int (*BezierPath)(int,int *,OPVP_Point *);
-#else
- int (*BezierPath)(int,int,OPVP_Point *);
-#endif
- int (*ArcPath)(int,int,int,OPVP_Fix,OPVP_Fix,OPVP_Fix,OPVP_Fix,
- OPVP_Fix,OPVP_Fix,OPVP_Fix,OPVP_Fix);
- int (*DrawBitmapText)(int,int,int,int,void *);
- int (*DrawImage)(int,int,int,int,
- OPVP_ImageFormat,OPVP_Rectangle,int,void *);
- int (*StartDrawImage)(int,int,int,int,
- OPVP_ImageFormat,OPVP_Rectangle);
- int (*TransferDrawImage)(int,int,void *);
- int (*EndDrawImage)(int);
- int (*StartScanline)(int,int);
- int (*Scanline)(int,int,int *);
- int (*EndScanline)(int);
- int (*StartRaster)(int,int);
- int (*TransferRasterData)(int,int,unsigned char *);
- int (*SkipRaster)(int,int);
- int (*EndRaster)(int);
- int (*StartStream)(int);
- int (*TransferStreamData)(int,int,void *);
- int (*EndStream)(int);
-} OPVP_api_procs;
-
-#endif /* _OPVP_COMMON_H_ */
-
diff --git a/gs/contrib/opvp/opvp_media.def b/gs/contrib/opvp/opvp_media.def
deleted file mode 100644
index 043d600eb..000000000
--- a/gs/contrib/opvp/opvp_media.def
+++ /dev/null
@@ -1,166 +0,0 @@
-/* $Id: opvp_media.def,v 1.4 2005/06/10 16:53:36 gishi Exp $ */
-{"iso" ,"a10" , 26/MMPI*PS_DPI, 37/MMPI*PS_DPI},
-{"iso" ,"c10" , 28/MMPI*PS_DPI, 40/MMPI*PS_DPI},
-{"iso" ,"b10" , 31/MMPI*PS_DPI, 44/MMPI*PS_DPI},
-{"jis" ,"b10" , 32/MMPI*PS_DPI, 45/MMPI*PS_DPI},
-{"iso" ,"a9" , 37/MMPI*PS_DPI, 52/MMPI*PS_DPI},
-{"iso" ,"c9" , 40/MMPI*PS_DPI, 57/MMPI*PS_DPI},
-{"iso" ,"b9" , 44/MMPI*PS_DPI, 62/MMPI*PS_DPI},
-{"jis" ,"b9" , 45/MMPI*PS_DPI, 64/MMPI*PS_DPI},
-{"iso" ,"a8" , 52/MMPI*PS_DPI, 74/MMPI*PS_DPI},
-{"iso" ,"c8" , 57/MMPI*PS_DPI, 81/MMPI*PS_DPI},
-{"iso" ,"b8" , 62/MMPI*PS_DPI, 88/MMPI*PS_DPI},
-{"jis" ,"b8" , 64/MMPI*PS_DPI, 91/MMPI*PS_DPI},
-{"iso" ,"a7" , 74/MMPI*PS_DPI, 105/MMPI*PS_DPI},
-{"na" ,"index-3x5" , 3*PS_DPI, 5*PS_DPI},/*76.2x127*/
-{"iso" ,"c7" , 81/MMPI*PS_DPI, 114/MMPI*PS_DPI},
-{"iso" ,"c7c6" , 81/MMPI*PS_DPI, 162/MMPI*PS_DPI},
-{"iso" ,"b7" , 88/MMPI*PS_DPI, 125/MMPI*PS_DPI},
-{"jpn" ,"chou4" , 90/MMPI*PS_DPI, 205/MMPI*PS_DPI},
-{"jis" ,"b7" , 91/MMPI*PS_DPI, 128/MMPI*PS_DPI},
-{"na" ,"personal" , 3.625*PS_DPI, 6.5*PS_DPI},/*92.075x165.1*/
-{"prc" ,"32k" , 97/MMPI*PS_DPI, 151/MMPI*PS_DPI},
-{"na" ,"monarch" , 3.875*PS_DPI, 7.5*PS_DPI},/*98.425x190.5*/
-{"na" ,"number-9" , 3.875*PS_DPI, 8.875*PS_DPI},/*98.425x225.425*/
-{"jpn" ,"hagaki" , 100/MMPI*PS_DPI, 148/MMPI*PS_DPI},
-{"om" ,"small-photo" , 100/MMPI*PS_DPI, 150/MMPI*PS_DPI},
-{"om" ,"italian" , 100/MMPI*PS_DPI, 230/MMPI*PS_DPI},
-{"na" ,"index-4x6" , 4*PS_DPI, 6*PS_DPI},/*101.6x152.4*/
-{"prc" ,"1" , 102/MMPI*PS_DPI, 165/MMPI*PS_DPI},
-{"prc" ,"2" , 102/MMPI*PS_DPI, 176/MMPI*PS_DPI},
-{"na" ,"number-10" , 4.125*PS_DPI, 9.5*PS_DPI},/*104.775x241.3*/
-{"iso" ,"a6" , 105/MMPI*PS_DPI, 148/MMPI*PS_DPI},
-{"jpn" ,"you4" , 105/MMPI*PS_DPI, 235/MMPI*PS_DPI},
-{"prc" ,"4" , 110/MMPI*PS_DPI, 208/MMPI*PS_DPI},
-{"iso" ,"dl" , 110/MMPI*PS_DPI, 220/MMPI*PS_DPI},
-{"prc" ,"5" , 110/MMPI*PS_DPI, 220/MMPI*PS_DPI},
-{"jpn" ,"chou2" ,111.1/MMPI*PS_DPI, 146/MMPI*PS_DPI},
-{"na" ,"a2" , 4.375*PS_DPI, 5.75*PS_DPI},/*111.125x146.05*/
-{"iso" ,"c6" , 114/MMPI*PS_DPI, 162/MMPI*PS_DPI},
-{"iso" ,"c6c5" , 114/MMPI*PS_DPI, 229/MMPI*PS_DPI},
-{"om" ,"postfix" , 114/MMPI*PS_DPI, 229/MMPI*PS_DPI},
-{"na" ,"number-11" , 4.5*PS_DPI, 10.375*PS_DPI},/*114.3x263.525*/
-{"jpn" ,"chou3" , 120/MMPI*PS_DPI, 235/MMPI*PS_DPI},
-{"prc" ,"8" , 120/MMPI*PS_DPI, 309/MMPI*PS_DPI},
-{"prc" ,"6" , 120/MMPI*PS_DPI, 320/MMPI*PS_DPI},
-{"na" ,"number-12" , 4.75*PS_DPI, 11*PS_DPI},/*120.65x279.4*/
-{"iso" ,"b6" , 125/MMPI*PS_DPI, 176/MMPI*PS_DPI},
-{"prc" ,"3" , 125/MMPI*PS_DPI, 176/MMPI*PS_DPI},
-{"iso" ,"b6c4" , 125/MMPI*PS_DPI, 324/MMPI*PS_DPI},
-{"na" ,"5x7" , 5*PS_DPI, 7*PS_DPI},/*127x177.8*/
-{"na" ,"index-5x8" , 5*PS_DPI, 8*PS_DPI},/*127x203.2*/
-{"na" ,"number-14" , 5*PS_DPI, 11.5*PS_DPI},/*127x292.1*/
-{"jis" ,"b6" , 128/MMPI*PS_DPI, 182/MMPI*PS_DPI},
-{"na" ,"invoice" , 5.5*PS_DPI, 8.5*PS_DPI},/*139.7x215.9*/
-{"prc" ,"16k" , 146/MMPI*PS_DPI, 215/MMPI*PS_DPI},
-{"jpn" ,"oufuku" , 148/MMPI*PS_DPI, 200/MMPI*PS_DPI},
-{"iso" ,"a5" , 148/MMPI*PS_DPI, 210/MMPI*PS_DPI},
-{"na" ,"index-4x6-ext", 6*PS_DPI, 8*PS_DPI},/*152.4x203.2*/
-{"na" ,"6x9" , 6*PS_DPI, 9*PS_DPI},/*152.4x228.6*/
-{"prc" ,"7" , 160/MMPI*PS_DPI, 230/MMPI*PS_DPI},
-{"iso" ,"c5" , 162/MMPI*PS_DPI, 229/MMPI*PS_DPI},
-{"na" ,"c5" , 6.5*PS_DPI, 9.5*PS_DPI},/*165.1x241.3*/
-{"iso" ,"a5-extra" , 174/MMPI*PS_DPI, 235/MMPI*PS_DPI},
-{"iso" ,"b5" , 176/MMPI*PS_DPI, 250/MMPI*PS_DPI},
-{"na" ,"7x9" , 7*PS_DPI, 9*PS_DPI},/*177.8x228.6*/
-{"jis" ,"b5" , 182/MMPI*PS_DPI, 257/MMPI*PS_DPI},
-{"na" ,"executive" , 7.25*PS_DPI, 10.5*PS_DPI},/*184.15x266.7*/
-{"roc" ,"16k" , 7.75*PS_DPI, 10.75*PS_DPI},/*196.85x273.05*/
-{"om" ,"juuro-ku-kai" , 198/MMPI*PS_DPI, 275/MMPI*PS_DPI},
-{"om" ,"large-photo" , 200/MMPI*PS_DPI, 300/MMPI*PS_DPI},
-{"iso" ,"b5-extra" , 201/MMPI*PS_DPI, 276/MMPI*PS_DPI},
-{"na" ,"govt-letter" , 8*PS_DPI, 10*PS_DPI},/*203.2x254*/
-{"na" ,"govt-legal" , 8*PS_DPI, 13*PS_DPI},/*203.2x330.2*/
-{"iso" ,"a4" , 210/MMPI*PS_DPI, 297/MMPI*PS_DPI},
-{"om" ,"folio" , 210/MMPI*PS_DPI, 330/MMPI*PS_DPI},
-{"om" ,"folio-sp" , 215/MMPI*PS_DPI, 315/MMPI*PS_DPI},
-{"na" ,"quarto" , 8.5*PS_DPI, 10.83*PS_DPI},/*215.9x275.082*/
-{"na" ,"letter" , 8.5*PS_DPI, 11*PS_DPI},/*215.9x279.4*/
-{"na" ,"fanfold-eur" , 8.5*PS_DPI, 12*PS_DPI},/*215.9x304.8*/
-{"na" ,"letter-plus" , 8.5*PS_DPI, 12.69*PS_DPI},/*215.9x322.326*/
-{"na" ,"foolscap" , 8.5*PS_DPI, 13*PS_DPI},/*215.9x330.2*/
-{"na" ,"legal" , 8.5*PS_DPI, 14*PS_DPI},/*215.9x355.6*/
-{"jis" ,"exec" , 216/MMPI*PS_DPI, 330/MMPI*PS_DPI},
-{"om" ,"invite" , 220/MMPI*PS_DPI, 220/MMPI*PS_DPI},
-{"iso" ,"a4-tab" , 225/MMPI*PS_DPI, 297/MMPI*PS_DPI},
-{"na" ,"super-a" , 8.94*PS_DPI, 14*PS_DPI},/*227.076x355.6*/
-{"na" ,"9x11" , 9*PS_DPI, 11*PS_DPI},/*228.6x279.4*/
-{"na" ,"arch-a" , 9*PS_DPI, 12*PS_DPI},/*228.6x304.8*/
-{"iso" ,"c4" , 229/MMPI*PS_DPI, 324/MMPI*PS_DPI},
-{"iso" ,"a4-extra" ,235.5/MMPI*PS_DPI,322.3/MMPI*PS_DPI},
-{"jpn" ,"kahu" , 240/MMPI*PS_DPI,322.1/MMPI*PS_DPI},
-{"jpn" ,"kaku2" , 240/MMPI*PS_DPI, 332/MMPI*PS_DPI},
-{"na" ,"letter-extra" , 9.5*PS_DPI, 12*PS_DPI},/*241.3x304.8*/
-{"na" ,"legal-extra" , 9.5*PS_DPI, 15*PS_DPI},/*241.3x381*/
-{"iso" ,"b4" , 250/MMPI*PS_DPI, 353/MMPI*PS_DPI},
-{"na" ,"10x11" , 10*PS_DPI, 11*PS_DPI},/*254x279.4*/
-{"na" ,"10x13" , 10*PS_DPI, 13*PS_DPI},/*254x330.2*/
-{"na" ,"10x14" , 10*PS_DPI, 14*PS_DPI},/*254x355.6*/
-{"na" ,"10x15" , 10*PS_DPI, 15*PS_DPI},/*254x381*/
-{"jis" ,"b4" , 257/MMPI*PS_DPI, 364/MMPI*PS_DPI},
-{"om" ,"pa-kai" , 267/MMPI*PS_DPI, 389/MMPI*PS_DPI},
-{"roc" ,"8k" , 10.75*PS_DPI, 15.5*PS_DPI},/*273.05x393.7*/
-{"om" ,"dai-pa-kai" , 275/MMPI*PS_DPI, 395/MMPI*PS_DPI},
-{"na" ,"11x12" , 11*PS_DPI, 12*PS_DPI},/*279.4x304.8*/
-{"na" ,"edp" , 11*PS_DPI, 14*PS_DPI},/*279.4x355.6*/
-{"na" ,"fanfold-us" , 11*PS_DPI, 14.875*PS_DPI},/*279.4x377.825*/
-{"na" ,"11x15" , 11*PS_DPI, 15*PS_DPI},/*279.4x381*/
-{"na" ,"ledger" , 11*PS_DPI, 17*PS_DPI},/*279.4x431.8*/
-{"iso" ,"a3" , 297/MMPI*PS_DPI, 420/MMPI*PS_DPI},
-{"iso" ,"a4x3" , 297/MMPI*PS_DPI, 630/MMPI*PS_DPI},
-{"iso" ,"a4x4" , 297/MMPI*PS_DPI, 841/MMPI*PS_DPI},
-{"iso" ,"a4x5" , 297/MMPI*PS_DPI, 1051/MMPI*PS_DPI},
-{"iso" ,"a4x6" , 297/MMPI*PS_DPI, 1261/MMPI*PS_DPI},
-{"iso" ,"a4x7" , 297/MMPI*PS_DPI, 1471/MMPI*PS_DPI},
-{"iso" ,"a4x8" , 297/MMPI*PS_DPI, 1682/MMPI*PS_DPI},
-{"iso" ,"a4x9" , 297/MMPI*PS_DPI, 1892/MMPI*PS_DPI},
-{"na" ,"eur-edp" , 12*PS_DPI, 14*PS_DPI},/*304.8x355.6*/
-{"na" ,"arch-b" , 12*PS_DPI, 18*PS_DPI},/*304.8x457.2*/
-{"na" ,"12x19" , 12*PS_DPI, 19*PS_DPI},/*304.8x482.6*/
-{"na" ,"b-plus" , 12*PS_DPI, 19.17*PS_DPI},/*304.8x486.918*/
-{"iso" ,"a3-extra" , 322/MMPI*PS_DPI, 445/MMPI*PS_DPI},
-{"iso" ,"c3" , 324/MMPI*PS_DPI, 458/MMPI*PS_DPI},
-{"prc" ,"10" , 324/MMPI*PS_DPI, 458/MMPI*PS_DPI},
-{"na" ,"super-b" , 13*PS_DPI, 19*PS_DPI},/*330.2x482.6*/
-{"iso" ,"b3" , 353/MMPI*PS_DPI, 500/MMPI*PS_DPI},
-{"jis" ,"b3" , 364/MMPI*PS_DPI, 515/MMPI*PS_DPI},
-{"iso" ,"a2" , 420/MMPI*PS_DPI, 594/MMPI*PS_DPI},
-{"iso" ,"a3x3" , 420/MMPI*PS_DPI, 891/MMPI*PS_DPI},
-{"iso" ,"a3x4" , 420/MMPI*PS_DPI, 1189/MMPI*PS_DPI},
-{"iso" ,"a3x5" , 420/MMPI*PS_DPI, 1486/MMPI*PS_DPI},
-{"iso" ,"a3x6" , 420/MMPI*PS_DPI, 1783/MMPI*PS_DPI},
-{"iso" ,"a3x7" , 420/MMPI*PS_DPI, 2080/MMPI*PS_DPI},
-{"iso" ,"ra2" , 430/MMPI*PS_DPI, 610/MMPI*PS_DPI},
-{"na" ,"c" , 17*PS_DPI, 22*PS_DPI},/*431.8x558.8*/
-{"iso" ,"sra2" , 450/MMPI*PS_DPI, 640/MMPI*PS_DPI},
-{"na" ,"arch-c" , 18*PS_DPI, 24*PS_DPI},/*457.2x609.6*/
-{"iso" ,"c2" , 458/MMPI*PS_DPI, 648/MMPI*PS_DPI},
-{"iso" ,"b2" , 500/MMPI*PS_DPI, 707/MMPI*PS_DPI},
-{"jis" ,"b2" , 515/MMPI*PS_DPI, 728/MMPI*PS_DPI},
-{"na" ,"d" , 22*PS_DPI, 34*PS_DPI},/*558.8x863.6*/
-{"iso" ,"a1" , 594/MMPI*PS_DPI, 841/MMPI*PS_DPI},
-{"iso" ,"a2x3" , 594/MMPI*PS_DPI, 1261/MMPI*PS_DPI},
-{"iso" ,"a2x4" , 594/MMPI*PS_DPI, 1682/MMPI*PS_DPI},
-{"iso" ,"a2x5" , 594/MMPI*PS_DPI, 2102/MMPI*PS_DPI},
-{"na" ,"arch-d" , 24*PS_DPI, 36*PS_DPI},/*609.6x914.4*/
-{"iso" ,"ra1" , 610/MMPI*PS_DPI, 860/MMPI*PS_DPI},
-{"iso" ,"sra1" , 640/MMPI*PS_DPI, 900/MMPI*PS_DPI},
-{"iso" ,"c1" , 648/MMPI*PS_DPI, 917/MMPI*PS_DPI},
-{"iso" ,"b1" , 707/MMPI*PS_DPI, 1000/MMPI*PS_DPI},
-{"asme","f" , 28*PS_DPI, 40*PS_DPI},/*711.2x1016*/
-{"jis" ,"b1" , 728/MMPI*PS_DPI, 1030/MMPI*PS_DPI},
-{"na" ,"wide-format" , 30*PS_DPI, 42*PS_DPI},/*762x1066.8*/
-{"iso" ,"a0" , 841/MMPI*PS_DPI, 1189/MMPI*PS_DPI},
-{"iso" ,"a1x3" , 841/MMPI*PS_DPI, 1783/MMPI*PS_DPI},
-{"iso" ,"a1x4" , 841/MMPI*PS_DPI, 2378/MMPI*PS_DPI},
-{"iso" ,"ra0" , 860/MMPI*PS_DPI, 1220/MMPI*PS_DPI},
-{"na" ,"e" , 34*PS_DPI, 44*PS_DPI},/*863.6x1117.6*/
-{"iso" ,"sra0" , 900/MMPI*PS_DPI, 1280/MMPI*PS_DPI},
-{"na" ,"arch-e" , 36*PS_DPI, 48*PS_DPI},/*914.4x1219.2*/
-{"iso" ,"c0" , 917/MMPI*PS_DPI, 1297/MMPI*PS_DPI},
-{"iso" ,"b0" , 1000/MMPI*PS_DPI, 1414/MMPI*PS_DPI},
-{"jis" ,"b0" , 1030/MMPI*PS_DPI, 1456/MMPI*PS_DPI},
-{"na" ,"f" , 44*PS_DPI, 68*PS_DPI},/*1117.6x1727.2*/
-{"iso" ,"2a0" , 1189/MMPI*PS_DPI, 1682/MMPI*PS_DPI},
-{"iso" ,"a0x3" , 1189/MMPI*PS_DPI, 2523/MMPI*PS_DPI},
-{"iso" ,"4a0" , 1682/MMPI*PS_DPI, 2378/MMPI*PS_DPI},
diff --git a/gs/contrib/pcl3/BUGS b/gs/contrib/pcl3/BUGS
deleted file mode 100644
index 16d4ce086..000000000
--- a/gs/contrib/pcl3/BUGS
+++ /dev/null
@@ -1,57 +0,0 @@
-*******************************************************************************
- File: @(#)$Id: BUGS,v 2.8 2001/08/18 17:37:28 Martin Rel $
- Contents: Bug list for pcl3
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany. E-mail: Martin.Lottermoser@t-online.de.
-
-*******************************************************************************
-* *
-* Copyright (C) 2000, 2001 by Martin Lottermoser *
-* All rights reserved *
-* *
-*******************************************************************************
-
-For an up-to-date version of this file, visit
-http://home.t-online.de/home/Martin.Lottermoser/pcl3.html.
-
-Each bug description has a number, possibly prefixed with "*" for those bugs
-for which there is at present no fix. The first line of each description
-contains the date on which and the pcl3 version for which the problem was
-reported, followed by a short summary and possibly a longer description.
-
-Bugs which have been fixed have a line denoting the pcl3 version with the fix.
-
-*******************************************************************************
-
-1 (2000-10-26, pcl3 3.0): Duplex printing on the DJ 970C does not work.
- The command
-
- gs -q -sDEVICE=pcl3 -sSubdevice=unspec -r600x600 -sOutputFile=/dev/lp0
- -sDuplexCapability=oppositeLeadingEdge -dDuplex=true
-
- applied to a two-page document generates a file which is printed on two
- sheets.
-
- FIXED in 3.0.2 (the call needs different options, though; many thanks to
- Dawei W. Dong for an extensive set of experiments).
-
-2 (2000-10-27, pcl3 3.0): Using "-sSubdevice" leads to printing at 300 ppi.
-
- FIXED in 3.0.1.
-
-3 (2001-01-12, pcl3 3.0.2): The "restore" in the following code leads to a
- "rangecheck" error in .installpagedevice (where it says "This should never
- happen!" in gs_setpd.ps :-) ):
-
- save a4 restore
-
- This is due to a problem with the "NumCopies" page device parameter which
- is caused by cooperating bugs in gs and pcl3.
-
- FIXED in 3.1.
-
-4 (2001-07-05, pcl3 3.2): On a platform where "unsigned long" has more bits
- than "int", using Floyd-Steinberg error diffusion gives wrong colours for
- high-intensity yellow.
-
- FIXED in 3.3.
diff --git a/gs/contrib/pcl3/LGPL b/gs/contrib/pcl3/LGPL
deleted file mode 100644
index b1e3f5a26..000000000
--- a/gs/contrib/pcl3/LGPL
+++ /dev/null
@@ -1,504 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
diff --git a/gs/contrib/pcl3/NEWS b/gs/contrib/pcl3/NEWS
deleted file mode 100644
index b266eeb37..000000000
--- a/gs/contrib/pcl3/NEWS
+++ /dev/null
@@ -1,379 +0,0 @@
-*******************************************************************************
- File: @(#)$Id: NEWS,v 2.10 2001/08/19 09:05:15 Martin Rel $
- Contents: Significant user-visible changes between versions of pcl3/hpdj
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany. E-mail: Martin.Lottermoser@t-online.de.
-
-*******************************************************************************
-* *
-* Copyright (C) 1997, 1998, 1999, 2000, 2001 by Martin Lottermoser *
-* All rights reserved *
-* *
-*******************************************************************************
-
-
-Version 3.3 (released 2001-08-19)
-=================================
-* Options
- - There is a new option "-sPJLJob" for declaring the generated file as a
- PJL print job.
- - I've documented the options "PCLInit1" and "PCLInit2" because I now know of
- a situation where one of them is needed.
- - The option "-dCUPSMessages" has been split into "-dCUPSMessages" and
- "-dCUPSAccounting".
- - I have added a new option "-dConfigureEveryPage" which is needed by some
- not strictly PCL-3-conforming printers.
-* Compilation
- - Adaptation to AFPL ghostscript 7.0 (previously only available as a patch
- file) and GNU ghostscript 6.51.
-* Other
- - I've removed the "PageCountFile" configuration parameter for cups-pcl3
- because the corresponding device parameter can also be set from PostScript.
- - I've corrected a bug which showed itself in wrong colour rendering for
- yellow on 64-bit platforms when using Floyd-Steinberg error diffusion.
- - If you've been using gs-pcl3-hpdj8xxc.ppd or gs-pcl3-hpdj1120c.ppd in an
- environment where you had to explicitly specify values for the options
- "*eprnBlackLevels" or "*eprnNonBlackLevels" you'll have to replace these
- now with a reference to "*pcl3IntensityLevels".
-
-
-
-Version 3.2 (released 2001-03-26)
-=================================
-This is the first non-beta release of pcl3 after hpdj 2.6.
-
-The main functional extension in this release is support for the Common UNIX
-Printing System (CUPS):
-- I have added PPD files for the supported subdevices.
-- The package now contains a filter for using pcl3 with CUPS.
-- The driver has a new option "-dCUPSMessages" to generate messages in the
- format demanded by CUPS.
-
-
-Version 3.1 (released 2001-02-28)
-=================================
-- After waiting almost 5 years for someone to implement it where it logically
- belongs (in the ghostscript core distribution somewhere near the "prn"
- device), I have finally dropped a deliberate restriction in hpdj/pcl3 and
- have implemented Floyd-Steinberg error diffusion on my own. The resulting
- quality is quite good, the performance isn't. There is a new option
- "-sIntensityRendering" which selects the rendering method to use.
-- I have added support for the RGB colour model. This is mostly of interest to
- people writing other ghostscript drivers and wishing to use pcl3's "eprn"
- device.
-- I have changed the "SendNULs" option to be of integer type instead of a
- boolean.
-- The option "-dNoHalftoning" has been replaced by the value "printer" for the
- new option "-sIntensityRendering".
-- I have changed the %N name used by the message catalogues for pcl3opts from
- "pcltools" to "pcl3opts". You should delete your old catalogues if you
- installed them.
-
-
-Version 3.0.2 (released 2000-11-09)
-===================================
-- Because I'm disappointed with the way the FTP server previously used for
- distributing hpdj is administered, I've moved pcl3's WWW home page to
- http://home.t-online.de/home/Martin.Lottermoser/pcl3.html.
-- I've made one change in the generated PCL code (argument value for Start
- Raster Graphics) which, according to the HP documentation available to me,
- should be equivalent but which is apparently a necessary condition for duplex
- printing on the HP DJ 970C.
-- The option -dOnlyCRD is now documented.
-- Rearrangements in the output of pcl3opts, addition of -dOnlyCRD if needed.
-- Clarifications in the reference page.
-
-
-Version 3.0.1 (released 2000-10-27)
-===================================
-Bugfix release (-sSubdevice leading to 300 ppi resolution).
-
-
-Version 3.0 (released 2000-10-22)
-=================================
-As predicted in hpdj 2.5, the name of this driver has been changed to "pcl3".
-I am sorry it took so long for this version to be released, but, apart from
-other tasks intervening, the work for this driver expanded in a manner I had
-not anticipated. The current version is practically a new implementation, hence
-this is only a beta release which should be approached with appropriate care.
-
-* Functionality/behaviour of the driver
-
- + Removed Functionality
- - I have removed the optional source code for generating a device-specific
- 'InputAttributes' page device parameter. I had misunderstood the purpose
- of this parameter in PostScript.
-
- + Modifications
- - The option "Colo[u]rMode" is now called ""Colo[u]rModel" and its default
- value is called "Gray" instead of "mono".
- - The default for "ManualFeed" is now always "false".
- - The "MarginFile" option has been renamed "MediaConfigurationFile" and
- media configuration files now expect PPD mediaOption keywords (like "A4")
- instead of PCL page size codes ("26" for ISO A4) to identify media sizes.
- - The "MediaType" parameter has been renamed "Medium" to prevent a conflict
- with PostScript Level 3. There are extensions in the permissible values
- as well.
- - The "Model" option has been renamed "Subdevice" and the permissible
- values have been changed.
- - The "PagecountFile" option is now called "PageCountFile" in order to
- agree with the spelling of the page device parameter "PageCount".
- - The default compression method depends now on the subdevice chosen.
- For "unspec", it is 2 instead of 9 as previously.
-
- + Extensions
- - More printer models are explicitly supported (in particular some of the
- series 300 and 600 DeskJets).
- - It is now possible to select supported printer models (subdevices)
- directly by a "-sDEVICE" option.
- - The driver can now also deal with media fed long edge first. This is
- needed for envelope sizes on some older DeskJets. The implementation is
- actually more general and adds support for the standard
- PostScript-Level-3 page device parameter "LeadingEdge".
- - The driver now reacts to media positions (numbers identifying input or
- output trays) determined by PostScript's media selection process.
- - The driver now supports banner printing.
- - The driver now supports duplex printing.
- - There is a new option "-dNoHalftoning" which turns off ghostscript's
- halftoning.
- - I've added support for printers (e.g., Olivetti JP 792) which violate PCL
- in requiring the black pixel plane to be sent last when printing in
- colour.
- - You now have direct access to print quality parameters for older DeskJets.
- - There are two new options with minor usefulness (SendNULs, PJLLanguage).
-
-* Documentation
- - I have rewritten the documentation in SGML, using the DocBook DTD.
- The distribution contains derived variants as an nroff/troff manual page
- and in HTML format.
- - To my dismay I have discovered that the description on how to increase the
- halftone screen frequency does not work with current ghostscript versions.
- The manual page has been corrected accordingly.
- - The support for functionality needing the PCL command "Configure Raster
- Data" is no longer marked as unsafe because I have finally obtained some
- official HP documentation on it.
- - I've added a preliminary version of a TeX document (notes.tex) containing
- useful information for other driver implementors.
-
-* Other Changes
- - I've added a command "pcl3opts" which parses PCL-3+ files and guesses the
- options needed to generate a file with similar settings using pcl3. This
- command is intended for people having access to a manufacturer-endorsed
- driver for their printer.
- - I've added some PostScript files to the package:
- - calign.ps for checking the relative alignment of ink cartridges
- - dumpppd.ps for dumping the contents of the page device dictionary to
- standard output
- - levels-test.ps for checking the basic colour capabilities of ghostscript
- and the driver
-
-* Compilation/Sources
- - I have restructured the driver and split it into three layers.
- The top-most one is a new abstract gs device ("eprn") extending
- ghostscript's standard "prn" device and dealing with aspects independent of
- PCL. The lowest layer is a PCL-3+ generator. Both components are intended
- to be usable in other contexts as well. The "pcl3" driver proper is the
- intermediate layer connecting the other two.
- - The way you have to integrate pcl3's sources in the compilation has
- changed. You now have less compilation options to worry about.
-
-
-
-Version 2.6 (released 1999-10-16)
-=================================
-The main purpose of this version is to update the address of hpdj's FTP site
-and my e-mail address which have changed. Other changes are:
-
-* Documentation
- - I have removed the description of HPDJ_INPUTATTRIBUTES from README.hpdj.
- The symbol can still be defined during compilation if you need it, but
- because I had misunderstood the purpose of the 'InputAttributes' page
- device parameter hpdj's resulting behaviour is not in agreement with the
- PostScript language definition.
- - README.hpdj now describes a fix for ghostscript's BG/UCR bug which was
- previously mentioned only on hpdj's WWW home page.
- - I've made numerous small changes in the manual page and README.hpdj.
-
-* Compilation
- - The make file parts needed for hpdj are no longer diffs but simply text
- segments which can be inserted with an ordinary text editor.
-
-There are almost no changes in the source code.
-
-
-
-Version 2.5 (released 1998-11-22)
-=================================
-This is mainly a release to adapt hpdj to gs 5.50. There are no changes in
-functionality.
-
-Unless there arise reasons for quickly issuing a new package, this will be the
-last release where the driver is called "hpdj". The new name will probably be
-"pcl3" and numbering will start with version 3.0.
-
-* Changes in behaviour
- - hpdj will now complain if you specify the option 'BitsPerPixel' unless the
- value given happens to be the same as the one chosen by hpdj.
-
-* Compilation
- - hpdj should now adapt automatically to the ghostscript version used, i.e.,
- you no longer have to set version-specific defines for older gs releases.
- - One user encountered and located a bug in Microsoft VC++ 5.0 which
- prevented reading margin files. This release works around the bug.
-
-* Documentation
- - Numerous small changes.
-
-
-
-Version 2.4 (released 1998-04-27)
-=================================
-Starting with this version, hpdj is released under the terms of the GNU Library
-General Public License (LGPL) instead of the GNU GPL.
-
-* Extensions
- - This version supports the Color Resolution Enhancement technology (C-REt)
- feature of some HP series-800 DeskJets, at least as far as I've been able
- to discover how this works without any documentation from HP. See the
- description of the new options 'BlackLevels' and 'CMYLevels' in the manual
- page.
- - There is a new option, "PagecountFile", which can be used to keep track of
- the number of pages printed. It is intended for spooler backends.
- - As an example of an input filter for a BSD spooler (lpr), I've added a file
- 'if-hpdj' to the distribution. Read the comments in the file to find out
- what it can do.
- - I've extended the list of PCL media size codes known to hpdj by some codes
- of interest to people with series-1100 DeskJets.
-
-* Modifications
- - The DJ 850C/855C/unspec margin information has been modified:
- - The margins for the JIS B5 format were demonstrably wrong for the DJ 850C
- and have been changed.
- - I've removed the entry for US A2 envelopes because contrary to what I
- believed previously this size is not supported.
-
-* Documentation
- - The FILES section in the manual page has been restructured and extended as
- a CONFIGURATION section. In particular, for those not familiar with
- PostScript, I've added much more on configuration with PostScript commands.
-
-* Compilation
- - I have added a missing "#include <errno.h>" directive to hpdjprn.c.
- - I have added an include directive for Aladdin's header "std.h" where
- appropriate in order to avoid some name clashes with non-standard system
- types like 'uint' on some operating systems (e.g., FreeBSD).
-
-
-
-
-Version 2.3 (released 1997-12-16)
-=================================
-This is a release to fix a bug preventing linking when HPDJ_MARGIN_FILE was
-defined during compilation.
-
-
-
-Version 2.2 (released 1997-12-08)
-=================================
-Most of the changes in this version are either in the documentation or internal.
-So far, only one bug has been reported for hpdj 2.1 and it is concerned with
-compilation and not with the generated PCL code (see below).
-
-* Changes in behaviour
-
- - Printing with a series-500 DeskJet on envelope sizes now assumes manual
- feed unless overridden by the new 'ManualFeed' option.
-
- - I have finally managed to see how to support automatic rotation for pages
- in landscape orientation without help from 'setpagedevice'. The rule is
- now: put media into the input tray short edge first and let hpdj worry
- about the rest.
-
- In particular, it is now possible to use setpagedevice to declare landscape
- orientation in default user space and thus obtain a file which can be
- viewed on the screen in its proper orientation and which will, without
- modifications, print correctly if processed by hpdj.
-
- - hpdj can now also install its own 'InputAttributes' dictionary in its page
- device dictionary. (And if you don't know what that can be used for you
- should skip this paragraph.) There will be one entry for each page size
- supported by the printer model chosen. This has the disadvantage that
- unsupported page sizes no longer produce readable messages like
-
- ? Device hpdj: This document requests a page size of 210 x 297 pt.
- This exceeds the custom page size limits for the DeskJet 850C.
-
- from hpdj but instead slightly cryptic messages like
-
- Error: /configurationerror in --setpagedevice--
- Additional information: [/PageSize [210 297]]
-
- from the setpagedevice operator (some ghostscript versions, e.g. gs 4.03,
- even omit the second of these lines). The advantage is that setpagedevice
- can now perform the usual media size matching.
-
- This feature is not active by default because it generates the wrong
- initial CTM if the printer model supports custom page sizes and the media
- size requested could be matched as a custom page size. This is due to a bug
- in make_adjustment_matrix() (file zmedia2.c) which is present in at least
- gs 3.53, gs 4.03 and gs 5.10. The hpdj distribution contains a patch file
- for zmedia2.c based on gs 5.10 which fixes this problem.
-
- Compile hpdj with -DHPDJ_INPUTATTRIBUTES to activate this feature.
-
-
-* Command line options:
-
- - New options (see the manual page for descriptions):
- - DryTime
- - ManualFeed
-
- - Changes in option interfaces (no change in functionality):
- - ColourMode and ColorMode accept "monochrome" as a synonym for "mono".
- - MediaType now recognizes the string "photo paper".
- - PrintQuality accepts "best" as a synonym for "presentation".
-
-
-* Manual page:
- - I have made the nroff/troff syntax more acceptable to man commands of
- limited intelligence and faulty man macros. In particular, man is now more
- likely to discover that preprocessing by tbl is needed, and nroff should
- no longer get confused what the "previous" font is after CW has been used.
- (The Linux system on which I developed hpdj 2.1 did not have these faults,
- but since then I have switched distributions...)
- - The man page now contains a reference to hpdj's FTP site.
- - The list of printers known to work with hpdj has been extended.
- - I have rewritten most of the "LIMITATIONS" section.
-
-* Additional files in the distribution:
- - This file :-).
- - A copy of the hpdj home page, hpdj.html, giving a short introduction to
- ghostscript and hpdj, together with instructions on where to get them.
- - Patch files for devs.mak in Aladdin ghostscript 3.53 and 5.10.
- - Patch file for zmedia2.c (bug in make_adjustment_matrix()) based on Aladdin
- ghostscript 5.10.
- - Margin test files in landscape orientation for ISO A4 and US Letter.
-
-* Compilation:
- - In two places, I had used dynamic initializers for structs. This is not
- required to be supported by ISO/ANSI C and gave error messages from at
- least one compiler. This bug has been fixed.
- - A user reported problems with the interpretation of return values of
- fprintf() on his non-ISO/ANSI-C-conforming system. This lead to hpdj
- erroneously assuming that an error had occurred. The code has been changed
- to circumvent this problem.
- - Based on user feedback, I have rewritten parts of README.hpdj.
- - There is a new printer model, "none", intended only as a compile-time value
- for HPDJ_DEFAULT_MODEL. Using this model leads to an error message telling
- the user that s/he should explicitly specify -sModel. I have introduced this
- value for the benefit of persons distributing binary versions of ghostscript
- and wishing to force their users to deliberately choose the printer model.
- This is the default value for HPDJ_DEFAULT_MODEL now.
- - The source code for the driver is now distributed over 7 files instead of
- 3 as before.
-
-
-
-Version 2.1 (released 1997-06-08)
-=================================
-This was the first widely-released version of hpdj.
diff --git a/gs/contrib/pcl3/README b/gs/contrib/pcl3/README
deleted file mode 100644
index 5b8490a75..000000000
--- a/gs/contrib/pcl3/README
+++ /dev/null
@@ -1,342 +0,0 @@
-*******************************************************************************
- File: @(#)$Id: README,v 2.12 2001/08/19 09:03:27 Martin Rel $
- Contents: README file for the pcl3 distribution
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany. E-mail: Martin.Lottermoser@t-online.de.
-
-*******************************************************************************
-* *
-* Copyright (C) 1997, 1998, 1999, 2000, 2001 by Martin Lottermoser *
-* All rights reserved *
-* *
-*******************************************************************************
-
-
-Table of Contents
-=================
-- What is pcl3?
-- Conditions of use
-- Status of this release
-- Files needed
-- How to compile ghostscript with pcl3
-
-
-
-What is pcl3?
-=============
-pcl3, formerly called hpdj, is a ghostscript device driver for printers
-understanding Hewlett-Packard's Printer Command Language, Level 3+ (PCL 3+).
-Some printer models (currently exclusively HP DeskJets) are explicitly
-supported, but there is also generic support for other PCL-3+ printers.
-So far I have not heard of any PCL-3 printer for which the driver cannot be
-used at all and it even works for some printers which claim to be
-PCL-3-conforming but aren't. For a more positive statement, i.e., a list of
-printer models for which pcl3 is currently known to work and how, see the file
-doc/reports.txt.
-
-
-
-Conditions of use
-=================
-pcl3 is free software and can be used under the terms of the GNU Lesser General
-Public License (LGPL), Version 2.1 (February 1999). You can find a copy of the
-LGPL in the pcl3 distribution, in several software packages distributed by the
-Free Software Foundation, and at http://www.gnu.org/copyleft/lesser.html.
-
-This implies in particular that you are using pcl3 AT YOUR OWN RISK!
-
-
-
-Status of this release
-======================
-This is version 3.3 of pcl3, released 2001-08-19. This is an ordinary
-(non-beta) release. Read the manual page to learn about the supported
-functionality and restrictions.
-
-
-
-Files needed
-============
-First, you need a ghostscript distribution. This version of pcl3 has been
-successfully integrated with the following ghostscript distributions:
-
- - AFPL ghostscript 7.0
- - GNU ghostscript 6.51
-
-Other ghostscript versions than those mentioned here are very likely to work,
-too.
-
-To obtain a ghostscript distribution, visit http://www.cs.wisc.edu/~ghost.
-You will also need some third-party archives in addition. See the URL just
-mentioned or check Make.htm in the ghostscript distribution you have obtained.
-
-Second, you need a font distribution containing at least a basic set of
-PostScript fonts. Such a set is distributed with ghostscript as an "std" and an
-"other" archive. Because font files are PostScript files, they are normally not
-restricted to a particular version of ghostscript although the archives have a
-ghostscript version number in their file names. Some of the possibilities are:
-
- ghostscript-fonts-std-6.0.tar.gz
- ghostscript-fonts-other-6.0.tar.gz
- gnu-gs-fonts-std-6.0.tar.gz
- gnu-gs-fonts-std-5.50.tar.gz
- gnu-gs-fonts-other-6.0.tar.gz
- gnu-gs-fonts-other-5.50.tar.gz
-
-Unless you already have such a set on your system, fetch at least an "std"
-archive and choose the one with the highest version number you can readily lay
-your hands on. Different file names do not necessarily mean different contents.
-
- A side remark: The "StandardSymL" font dated 1998-03-26 (first present in
- a 5.10 font archive) contains the Euro glyph. However, it has the wrong
- PostScript name ("euro" instead of "Euro") and the wrong default encoding
- (decimal 240 instead of octal 240). This is corrected in the version dated
- 1999-10-21. Ghostscript's "SymbolEncoding" encoding vector had the same bugs
- in gs 5.50 and this was fixed in gs 6.0.
-
-Third, you need the pcl3 distribution:
-
- pcl3-<version>.tar.gz
-
-But if you are reading this file, you should already have it. If not,
-you can obtain the current distribution through the following URL:
-
- http://home.t-online.de/home/Martin.Lottermoser/pcl3.html
-
-I am distributing pcl3 only in the form of gzipped tar archives. If you wish to
-compile pcl3 on a non-UNIX platform, you need gzip, tar (on a Microsoft Windows
-system, you can use the Cygnus port of the GNU tools, available from
-http://sources.redhat.com/cygwin), and a command to convert text files from
-LF-terminated lines to whatever the line termination conventions are on your
-system.
-
-
-
-How to compile ghostscript with pcl3
-====================================
-You need an ISO-C-conforming compiler and library in order to compile pcl3.
-
-The following description is heavily biased towards UNIX systems and in
-particular Linux.
-
- 1. Unpack the core distribution
-
- This is the file ghostscript-N.NN.tar or gnu-gs-N.NN.tar. Unpacking it will
- create a subdirectory "gsN.NN" in the current directory.
-
- In order to clearly identify directories I'm going to use the following
- expressions:
- - "gs directory": the directory gsN.NN you have just created
- - "documentation directory": In gs 5.50 this is identical to the
- gs directory, in newer versions it is the subdirectory "doc" in the
- gs directory.
- - "source directory": In gs 5.50 this is identical to the gs directory,
- in newer versions it is the subdirectory "src" in the gs directory.
-
- 2. Read Make.htm in the documentation directory on how to compile ghostscript.
- In particular, you should learn
-
- - which other files you need to unpack and how, and
- - what the platform-specific make file for your platform is.
-
- 3. Unpack the other files needed (except the font files) as directed by
- Make.htm.
-
- 4. Unpack pcl3, preferably in the gs directory. The file pcl3-<version>.tar
- unpacks into a subdirectory pcl3-<version> with only three files:
-
- README-cover
- pcl3.tar the distribution proper
- pcl3.tar.sig an OpenPGP signature for pcl3.tar
-
- Make the directory accessible under the name "pcl3" from the gs directory,
- either by renaming it or by creating an appropriate symbolic link. Then
- change into the pcl3 directory and unpack pcl3.tar from there. This should
- give you in addition the following regular files in that directory:
-
- BUGS pcl3's bug list
- LGPL text of the GNU LGPL
- NEWS list of user-visible changes between versions
- README this file
-
- Furthermore, a number of subdirectories will have been created:
-
- doc documentation
- eprn C source code for the eprn device on which pcl3 is based
- lib cups-pcl3, example.mcf, if-pcl3
- ppd PostScript printer description files
- ps PostScript files
- src C source code and build files for pcl3
-
- 5. Extend contrib.mak in the source directory.
-
- The pcl3 distribution contains extension files "src/contrib.mak-N.NN.add"
- for this purpose, where "N.NN" is a ghostscript version (at least for all
- ghostscript distributions listed in "Files needed" above). These files
- contain text to be inserted into contrib.mak at some point, for example at
- the end. An extension file might work for other gs versions in addition to
- the designated one.
-
- The extension files contain an initial comment which gives you some
- further instructions (compile options, files shared with hpdj, available
- devices).
-
- 6. Add at least "$(DD)pcl3.dev" ("pcl3.dev" in gs 5.50) to one of the
- DEVICE_DEVS* variables in the platform-specific make file. The conventional
- place is DEVICE_DEVS3, DEVICE_DEVS4, or DEVICE_DEVS5. For a complete list
- of pcl3 devices you can define here, see the contrib.mak-N.NN.add file.
- You might also wish to modify the device and feature lists in other
- respects.
-
- On a Linux system, the file to edit is unix-gcc.mak.
-
- 7. Read the file doc/gs-mods.txt about modifications I suggest for making in
- ghostscript's source code or configuration files.
-
- 8. Other changes to the platform-specific make file
-
- For a UNIX system and if you wish to install the software in a non-default
- directory, edit the make variable "prefix" (normally /usr/local).
- This directory must exist before step 10.
-
- If you intend to use the X Window System, check whether the values for the
- variables XINCLUDE, XLIBDIRS, and XLIBS are correct. On Linux, they should
- usually be "-I/usr/X11R6/include", "-L/usr/X11R6/lib", and
- "Xt SM ICE Xext X11", respectively. You can ignore XINCLUDE if one of the
- directories searched by the compiler anyway contains an appropriate "X11"
- subdirectory (e.g., there is a link from /usr/include/X11 to
- /usr/X11R6/include/X11).
-
- 9. On a UNIX system, check that the platform-specific make file (unix-gcc.mak
- for Linux) is available to make from the gs directory (or use "-f"). Then,
- in the gs directory, type "make" to generate the gs binary, and
- "make pcl3opts" to generate the pcl3opts binary. The latter step is likely
- to fail if you are not on an XPG-conforming UNIX system.
-
-10. Install: "make install pcl3-install".
-
- If you are not on a UNIX system, you'll probably have to omit the
- "pcl3-install" part. Instead, copy pcl3's doc/*.html files and the compiled
- pcl3opts binary (provided it did compile) to appropriate places yourself.
-
- If "make pcl3-install" gives you a usage message from the "instcopy"
- command you've forgotten "make pcl3opts" in step 9.
-
- The "make pcl3opts" call, if successful, has also generated two NLS message
- catalogues for pcl3opts in ghostscript's object file directory ("obj" in
- the gs directory): pcl3opts-en.cat (English) and pcl3opts-de.cat (German).
- These catalogues are not installed automatically. If you wish to use them,
- copy each file into an appropriate NLS directory under a name matching your
- NLSPATH conventions with "pcl3opts" for %N. (On Linux the default value for
- NLSPATH usually includes /usr/share/locale/%L/%N and
- /usr/share/locale/%L/LC_MESSAGES/%N.) You need the English catalogue only
- if you want pcl3opts to issue media sizes in inches instead of millimetres.
-
- Note that pcl3's PostScript example files (subdirectory "ps") are also not
- installed. If you find them useful, copy them to an appropriate place
- yourself.
-
-11. Install the fonts.
-
- First call the newly generated "gs" with the option "-h". The output will
- show you ghostscript's search path. The fonts should be present in one of
- these directories. On UNIX systems, the convention is to use a ".../fonts"
- directory for this purpose. Note that newer font distributions unpack into
- "./fonts" and some older ones into ".".
-
- If you already have a ghostscript installation somewhere else on your
- system and its font directory is not included in the font path of your new
- gs binary, you can create a symbolic link from the ".../fonts" directory to
- your installed fonts, or use the environment variable GS_FONTPATH to direct
- gs to the directory/ies in question.
-
-12. This is a good point to take a first look at pcl3's documentation if you
- haven't done that yet. It is available as a manual page (type "man gs-pcl3")
- and in HTML format (open gs-pcl3.html in the installed ghostscript's
- documentation directory with an HTML browser).
-
-13. If your printer is not directly supported by pcl3 and you wish the driver
- to be correctly informed about supported media sizes and the associated
- hardware margins, look into the file lib/example.mcf and then create a
- media configuration file for your printer from information in its manual.
- You must at least specify an entry for the default page size (A4 or
- US Letter as selected in your ghostscript configuration).
-
- If you have selected to set PCL3_MEDIA_FILE in step 5, the media file
- you have just created should be installed under that path name.
-
-14. Integration with a spool system
-
- This depends on your spooler :-). The minimum you need is the ability to
- print a file without any modifications by spool commands. In that case
- you can generate a PCL file by calling ghostscript with option values
- appropriate for your current needs and pass the generated file through the
- spool system for printing. Such spool queues are usually called "raw"
- queues.
-
- If you are using CUPS (Common UNIX Printing System, http://www.cups.org),
- you can proceed as follows:
-
- - Create a file ppd/gs.ppd describing the site-specific properties of
- your ghostscript installation.
- - Select a PPD file suitable for your printer model and copy it into
- CUPS' "model" directory using the ppd/catppd script.
- - Copy the lib/cups-pcl3 filter to CUPS' "filter" directory.
- - Install a new print queue based on the new PPD file.
-
- The details of the first two steps are described in the ppd/README file.
- You should also at some stage read the initial comments in lib/cups-pcl3.
-
- Most Linux systems still use a Berkeley spooler (lpr/lprm/lpq) which maps
- the queue name in the print request to a call to some backend command,
- based on /etc/printcap. Frequently, the backend is an intelligent filter
- which will examine the contents of the file to be printed and perform
- appropriate processing based on the file type.
-
- Because with an ordinary Berkeley spooler one cannot pass command line
- options to the backend, it is a good idea to install several print queues
- for those option combinations one needs frequently. You could for example
- install seven print queues: one for passing any file to the printer
- unchanged, three for monochrome and three for colour printing, each of the
- last two groups having a queue for "draft", "normal" and "presentation"
- quality.
-
- If you are on a machine with an AT&T spool system (lp/cancel/lpstat),
- one queue can be sufficient because you can pass command line options to
- the backend. However, if your printer has different hardware configurations
- (either black or CMY cartridge, either banner or tray feed) and you cannot
- completely control when print jobs are submitted, you should still install
- separate queues for these configurations, take steps to make it at least
- likely that the jobs submitted to each queue have the necessary properties,
- and enable only the queue agreeing with the printer's current configuration.
-
- You also need only one queue independent of the spool system if you have a
- spooler frontend capable of inserting PostScript setup commands into the
- document to be printed or if such a document manager is part of your
- spooler (the latter applies to CUPS). The pcl3 distribution contains the
- necessary PPD files for these cases; read the file ppd/README for further
- instructions. Note that the remarks above on separate queues for distinct
- hardware configurations apply also to this case.
-
- The pcl3 distribution contains configurable input filters for the Berkeley
- spooler and for CUPS in the files "lib/if-pcl3" and "lib/cups-pcl3",
- respectively. Read the initial comments in these files for further
- instructions.
-
- You should also not forget to skim the "OPTIONS" and "CONFIGURATION"
- sections in pcl3's manual page: some parts are particularly relevant for
- spooler backends.
-
-15. Test your configuration by printing a few example documents.
-
- As a first step and in particular when you are using a media configuration
- file, print some of the margin test files ps/margins-*.ps appropriate for
- your current media size. They should show marks with a distance of 25 mm or
- 1 in (depending on the media size) from the margins. If you find deviations
- from what you expect, read the manual page and in particular the
- description of how to use the "Margins" or "PageOffset" entries to correct
- misalignments.
-
- For trying out various rendering parameters, ps/levels-test.ps is a good
- test file, in particular if you print through a spooler, because the
- printed page will tell you which settings were effective.
diff --git a/gs/contrib/pcl3/doc/gs-mods.txt b/gs/contrib/pcl3/doc/gs-mods.txt
deleted file mode 100644
index 9e269f698..000000000
--- a/gs/contrib/pcl3/doc/gs-mods.txt
+++ /dev/null
@@ -1,161 +0,0 @@
-*******************************************************************************
- File: @(#)$Id: gs-mods.txt,v 2.3 2001/08/19 09:04:56 Martin Rel $
- Contents: Suggested changes to ghostscript's source code or configuration
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany. E-mail: Martin.Lottermoser@t-online.de.
-
-*******************************************************************************
-* *
-* Copyright (C) 1997, 1998, 1999, 2000, 2001 by Martin Lottermoser *
-* All rights reserved *
-* *
-*******************************************************************************
-
-Changes to source code require recompilation of ghostscript, changes to the
-configuration files can be made at any time, even after installation.
-
-
-Changes to Source Code
-**********************
-
- S1 Present ghostscript versions have a bug in make_adjustment_matrix() when
- given significantly positive lower bounds for size ranges in
- "InputAttributes". I have provided an appropriate patch in
- src/zmedia2.c-N.NN.diff. To test for this bug if you already have a working
- binary of ghostscript including the "bit" device, run
-
- gs -sDEVICE=bit
-
- on the following PostScript code:
-
- << /InputAttributes
- << 0 << /PageSize [ 100 100 700 900 ] >> >>
- >> setpagedevice
- << /PageSize [ 200 300 ] >> setpagedevice
- matrix defaultmatrix ==
- quit
-
- This tells ghostscript to assume that the device supports media widths
- between 100 and 700 and heights between 100 and 900 bp, and requests a
- page size 200 bp wide and 300 bp tall. Ghostscript should print
-
- [1.0 0.0 0.0 -1.0 0.0 300.0]
-
- on standard output if you don't have the bug and
-
- [1.0 0.0 0.0 -1.0 200.0 0.0]
-
- if you do. You can use other drivers to test for this, too, but to reliably
- evaluate the result you need information on the driver's device coordinate
- system.
-
- A simple visual test can be made by replacing the last two lines in the
- program, "matrix ... quit", by
-
- /Courier findfont 10 scalefont setfont
- 100 150 moveto (Hello) show
- showpage
-
- and running it through a real device driver, preferably for the screen.
- If you have the bug, the page will be empty, if you don't, you'll see
- "Hello" in the middle.
-
- If you are unsure whether to apply the patch, proceed without it and do
- the test afterwards. The worst which can happen is that you'll have to
- recompile after patching.
-
- I had reported this bug to L. Peter Deutsch on 1997-12-02. He promised to
- look at it when he would have time. The bug is still present in gs 7.0,
- released more than three years later.
-
- S2 There is a bug in the UNIX make files for GNU ghostscript 6.51 which leads
- to a failure during "make install" when trying to install the manual pages.
- Add the line
-
- man1dir = $(mandir)/man$(man1ext)
-
- to your platform-specific makefile to fix this problem.
-
-
-
-Changes to Configuration Files
-******************************
-
- C1 There is a bug in ghostscript's default configuration for the
- undercolour removal and black generation functions. It shows up when
- printing PostScript documents using the RGB colour space ("setrgbcolor" or
- "sethsbcolor") on a device where the CMYK space is the native colour space;
- this is the case for pcl3 if you specify "-sColourModel=CMYK". The bug
- results in black being printed as a mixture of cyan, magenta, and yellow.
- On my printer, this is a slightly greenish grey with fuzzy edges.
-
- To check for the presence of this bug, run gs on the following command:
-
- 0 0 0 setrgbcolor [ currentcmykcolor ] ==
-
- gs will issue "[1.0 1.0 1.0 0.0]" on standard output if it would print the
- mixture and "[0.0 0.0 0.0 1.0]" if it would print true black. You should
- specify a CMYK device like "bitcmyk" for this test.
-
- To correct this behaviour, you'll have to modify gs_init.ps. Look for the
- following lines (starting at line 1263 in AFPL gs 7.0 and at line 1247 in
- GNU ghostscript 6.51):
-
- % Set the default screen and BG/UCR.
- /.setdefaultbgucr {
- systemdict /setblackgeneration known {
- { pop 0 } dup setblackgeneration setundercolorremoval
- } if
- } bind def
-
- Replace the line containing "setundercolorremoval" with the following:
-
- {} dup setblackgeneration setundercolorremoval
-
- I had reported this bug to L. Peter Deutsch on 1998-12-09 and he wrote he
- would change the behaviour in the next release. This happened subsequently
- in gs 6.0 (released 2000-02-03), but gs 6.01 reverted to the previous
- behaviour.
-
- C2 Ghostscript's default configuration prohibits a driver from seeing the
- value of the standard page device parameter "LeadingEdge" if set from
- PostScript; it is only visible if you set it from the command line. This is
- a logical error in ghostscript because (a) "LeadingEdge" fixes the
- orientation between default user space and the feeding direction which is a
- property of the default CTM, and because (b) determining the default CTM in
- ghostscript is the job of the driver-specific get_initial_matrix device
- procedure. Hence the driver must have access to the value of "LeadingEdge".
-
- To change this, edit the definition of ".presentspecial" in gs_setpd.ps to
- not include "LeadingEdge". Look for the line "/.presentspecial mark" and
- after that for the following lines (starting at line 356 in
- GNU ghostscript 6.51 and at line 355 in AFPL ghostscript 7.0):
-
- /InputAttributes false
- .inputattrkeys
- { dup /PageSize eq
- { pop }
- { { 2 index /InputAttributes .knownget { null eq } { true } ifelse } }
- ifelse
- }
- forall
-
- Replace the line containing "PageSize" with the following:
-
- { dup dup /PageSize eq exch /LeadingEdge eq or
-
- You need correct this bug only if you wish to set "LeadingEdge" from
- PostScript. This is normally not necessary except when you are using a
- document manager with pcl3's PPD files to print on a custom page size in a
- non-default orientation.
-
- C3 Unless your default media size is US Letter, it is a good idea to remove
- the "%" comment in the "% (a4)..." line in gs_init.ps in order to set the
- default page size to ISO A4 instead of US Letter (see also Use.htm in the
- ghostscript distribution). This is essential for correctly printing all
- documents not explicitly requesting a page size.
-
- C4 If you intend to use PostScript resources, you should also edit the
- definitions of "FontResourceDir" and "GenericResourceDir" in gs_res.ps to
- reflect your local conventions. (And if you don't know what I'm talking
- about you don't need it.)
diff --git a/gs/contrib/pcl3/doc/gs-pcl3.1 b/gs/contrib/pcl3/doc/gs-pcl3.1
deleted file mode 100644
index 1f2912020..000000000
--- a/gs/contrib/pcl3/doc/gs-pcl3.1
+++ /dev/null
@@ -1,2143 +0,0 @@
-'\" t
-...\" $Header: /usr/src/docbook-to-man/cmd/RCS/docbook-to-man.sh,v 1.3 1996/06/17 03:36:49 fld Exp $
-...\"
-...\" transcript compatibility for postscript use.
-...\"
-...\" synopsis: .P! <file.ps>
-...\"
-.de P!
-.fl
-\!!1 setgray
-.fl
-\\&.\"
-.fl
-\!!0 setgray
-.fl \" force out current output buffer
-\!!save /psv exch def currentpoint translate 0 0 moveto
-\!!/showpage{}def
-.fl \" prolog
-.sy sed -e 's/^/!/' \\$1\" bring in postscript file
-\!!psv restore
-.
-.de pF
-.ie \\*(f1 .ds f1 \\n(.f
-.el .ie \\*(f2 .ds f2 \\n(.f
-.el .ie \\*(f3 .ds f3 \\n(.f
-.el .ie \\*(f4 .ds f4 \\n(.f
-.el .tm ? font overflow
-.ft \\$1
-..
-.de fP
-.ie !\\*(f4 \{\
-. ft \\*(f4
-. ds f4\"
-' br \}
-.el .ie !\\*(f3 \{\
-. ft \\*(f3
-. ds f3\"
-' br \}
-.el .ie !\\*(f2 \{\
-. ft \\*(f2
-. ds f2\"
-' br \}
-.el .ie !\\*(f1 \{\
-. ft \\*(f1
-. ds f1\"
-' br \}
-.el .tm ? font underflow
-..
-.ds f1\"
-.ds f2\"
-.ds f3\"
-.ds f4\"
-.ta 8n 16n 24n 32n 40n 48n 56n 64n 72n
-.TH "GS-PCL3" "1" "" "pcl3 3.3"
-.SH "NAME"
-pcl3 \(em ghostscript device driver for printers understanding PCL 3+
-.SH "SYNOPSIS"
-.PP
-\fBgs\fP -sDEVICE=pcl3 [\fIgs_option\fP | -dBlackLevels=\fIinteger\fP | -dCMYLevels=\fIinteger\fP | -sColorModel=\fImodel\fP | -sColourModel=\fImodel\fP | -dCompressionMethod=\fImethod\fP | -dConfigureEveryPage | -dCUPSAccounting | -dCUPSMessages | -dDepletion=\fIdepletion\fP | -dDryTime=\fIseconds\fP | -sDuplexCapability=\fIcapability\fP | -sIntensityRendering=\fImethod\fP | -dLeadingEdge=\fIedge\fP | -dManualFeed | -sMediaConfigurationFile=\fIpathname\fP | -dMediaPosition=\fIposition\fP | -sMedium=\fImedium\fP | -dOnlyCRD | -sPageCountFile=\fIpathname\fP | -sPCLInit1=\fIstring\fP | -sPCLInit2=\fIstring\fP | -sPJLJob=\fIjobname\fP | -sPJLLanguage=\fIlanguage\fP | -sPrintQuality=\fIquality\fP | -dRasterGraphicsQuality=\fIquality\fP | -dSendBlackLast | -dSendNULs=\fInumber\fP | -dShingling=\fIshingling\fP | -sSubdevice=\fIsubdevice\fP | -dTumble | -dUseCard=\fIvalue\fP ] \&... [\fIfile\fP \&...]
-.SH "DESCRIPTION"
-.SS "Supported Printers"
-.PP
-The ghostscript device driver \fBpcl3\fP
-(formerly called \fBhpdj\fP)
-is a ghostscript backend for printers understanding
-Hewlett-Packard\&'s Printer Command Language, level 3+
-("PCL 3+", also called "PCL 3 Plus")\&.
-The driver is intended to support in particular the following printer models:
-.RS
-.PP
-.nf
-HP DeskJet
-HP DeskJet Plus
-HP DeskJet Portable
-HP DeskJet 310
-HP DeskJet 320
-HP DeskJet 340
-HP DeskJet 400
-HP DeskJet 500
-HP DeskJet 500C
-HP DeskJet 510
-HP DeskJet 520
-HP DeskJet 540
-HP DeskJet 550C
-HP DeskJet 560C
-HP DeskJet 600
-HP DeskJet 660C
-HP DeskJet 670C
-HP DeskJet 680C
-HP DeskJet 690C
-HP DeskJet 850C
-HP DeskJet 855C
-HP DeskJet 870C
-HP DeskJet 890C
-HP DeskJet 1120C
-.fi
-.RE
-
-The PCL dialect called "PCL Level 3 enhanced" is apparently a not
-entirely compatible modification of PCL 3+\&.
-This driver should basically work with such printers
-but you must be more careful which options you select and
-you might not be able to exploit all your printer\&'s capabilities\&.
-.PP
-The driver does \fInot\fP support printers understanding only
-Hewlett-Packard\&'s PPA (Printing Performance Architecture) commands\&.
-If a printer\&'s documentation does not say anything about its
-printer command language and
-you find a statement like "\&.\&.\&. is designed for Microsoft Windows" or
-"DOS support through Windows only",
-the printer is almost certainly a PPA printer and hence is intended
-\fIexclusively\fP
-for systems running Microsoft Windows\&.
-(These printers are also erroneously known as "GDI printers"
-because they are intended to be accessed through a manufacturer-supplied driver
-via Windows\&' GDI interface\&.)
-There exist ways of using a PPA printer with ghostscript,
-but not through \fBpcl3\fP\&.
-.PP
-Different printer models usually implement model-specific subsets of all
-PCL-3+ commands or arguments to commands\&.
-You must therefore tell the driver by means of the
-\fBSubdevice\fP
-option for which model the generated PCL code is intended\&.
-The model-dependent difference in the generated code is not great\&.
-Apart from media specifications, resolutions and colour capabilities,
-one can consider three groups of models
-which are treated with significant differences:
-.RS
-.IP "Group 1" 10
-DeskJet, DeskJet Plus, DeskJet 500
-.IP "Group 2" 10
-DeskJet Portable, DeskJets 3\fIxx\fP,
-400, 5\fIxx\fP except 500 and 540,
-.IP "Group 3" 10
-DeskJets 540, 6\fIxx\fP,
-8\fIxx\fP and 1120C\&.
-.RE
-
-The first two groups I call the "old Deskjets",
-the third group consists of "new DeskJets"\&.
-If you have a PCL-3 printer not appearing in the list above,
-the likelihood is still good that it will accept the files generated by
-\fBpcl3\fP\&.
-You can specify one of the supported subdevices in these cases
-(it is sufficient to try one each from the groups just mentioned),
-or use the special subdevice names
-\fBunspecold\fP or \fBunspec\fP
-which are treated like members of the second and the third group above,
-respectively,
-with all subdevice-dependent checks having been turned off\&.
-.PP
-The list of printer models for which this driver is currently known to work is:
-.RS
-.PP
-.nf
-HP 2000C
-HP 2500CM
-HP DeskJet 697C
-HP DeskJet 850C
-HP DeskJet 970C
-HP DeskJet 1100C
-Xerox DocuPrint M750
-.fi
-.RE
-.PP
-Details can be found in the file \fBreports\&.txt\fP in the
-\fBpcl3\fP distribution;
-its latest version is available via \fBpcl3\fP\&'s
-\fIhome
-page (link to URL http://home.t-online.de/home/Martin.Lottermoser/pcl3.html) \fR\&.
-If you wish to report on the hardware compatibility for a particular
-printer model,
-please read the file \fBhow-to-report\&.txt\fP\&.
-.PP
-Omitting models already mentioned,
-previous (\fBhpdj\fP) versions of this driver were reported to
-work with the following printers:
-.RS
-.PP
-.nf
-HP DeskJet 340
-HP DeskJet 400 (tested for Gray only)
-HP DeskJet 420
-HP DeskJet 500
-HP DeskJet 500C (tested for Gray only)
-HP DeskJet 520
-HP DeskJet 540
-HP DeskJet 560C
-HP DeskJet 600
-HP DeskJet 610C
-HP DeskJet 612C
-HP DeskJet 640C
-HP DeskJet 660C/660Cse
-HP DeskJet 670C
-HP DeskJet 672C
-HP DeskJet 680C
-HP DeskJet 690C
-HP DeskJet 690C+
-HP DeskJet 693C
-HP DeskJet 694C
-HP DeskJet 832C
-HP DeskJet 855C
-HP DeskJet 870Cse/870Cxi
-HP DeskJet 880C
-HP DeskJet 890C
-HP DeskJet 895Cse/895Cxi
-HP DeskJet 932C
-HP DeskJet 1120C
-HP OfficeJet 350
-HP OfficeJet 590
-HP OfficeJet 600
-HP OfficeJet 625
-HP OfficeJet G55
-HP OfficeJet T45
-Lexmark 3000 Color Jetprinter
-Olivetti JP792 (see the option \fBSendBlackLast\fP)
-.fi
-.RE
-.PP
-Most of the people who sent me reports did not state to which extent
-\fBhpdj\fP worked for their printer model\&.
-.SS "Colour Models"
-.PP
-Ignoring photo cartridges which are not supported by \fBpcl3\fP,
-DeskJet printers can be classified in four categories:
-.IP " \(bu" 6
-The printer has only a black ink cartridge\&.
-.IP " \(bu" 6
-The printer can print with either a black or a
-cyan/magenta/yellow (CMY) cartridge\&.
-.IP " \(bu" 6
-The printer holds a CMY and a black cartridge simultaneously,
-but the two groups of inks are chemically incompatible and should not be
-overlayed\&.
-(Don\&'t worry: the printer is not going to explode if they do\&.
-You merely get poorer results because the black ink will spread further
-than it should\&.
-This is called "ink bleeding"\&.)
-.IP " \(bu" 6
-The printer holds a CMY and a black cartridge simultaneously
-and the inks can be mixed\&.
-(Newer HP DeskJets use such bleed-proof inks\&.)
-.PP
-This leads to four \fI(process) colour models\fR
-for the driver:
-.PP
-.RS
-.IP "Gray" 10
-Print in black only\&.
-.IP "CMY" 10
-Print with cyan, magenta and yellow\&.
-In this mode, "composite black" consisting of all three inks is used to
-stand in for true black\&.
-.IP "CMY+K" 10
-Print with all four inks, but never mix black with one of the others\&.
-.IP "CMYK" 10
-Print with all four inks\&.
-.RE
-
-As a printer with both, a black and a CMY cartridge, can usually also print,
-e\&.g\&., with black only,
-the printer\&'s "cartridge state" merely identifies one of these models as the
-maximal one\&.
-Depending on the category of the printer,
-the driver will therefore accept one or more models\&.
-The possibilities are:
-.PP
-.RS
-.TS
-tab();
-l l.
-DeskJet ModelColour Models
-_
-T{
-DeskJet, DeskJet Plus, DeskJet Portable, 500, 510, 520
-T}Gray
-310, 320, 340, 400, 500C, 540, 600Gray, CMY
-550C, 560CGray, CMY, CMY+K
-T{
-660C, 670C, 680C, 690C, 850C, 855C, 870C, 890C, 1120C
-T}all
-.TE
-.RE
-
-The subdevices \fBunspecold\fP and
-\fBunspec\fP also permit all colour models\&.
-A printer capable only of CMY might accept CMY+K or CMYK data,
-remapping them to CMY,
-and a printer capable of CMY+K might remap CMY data to CMY+K\&.
-.PP
-The colour model CMY+K is not useful if you have a CMYK printer\&.
-In contrast,
-if you have a CMY+K or CMYK printer and the two cartridges support different
-resolutions,
-the colour models Gray or CMY become interesting as well\&.
-In most of these cases
-the black cartridge can print at a higher resolution than the CMY cartridge,
-although the converse does also occur\&.
-In addition, ghostscript is generally fastest for Gray\&.
-.PP
-PCL\ 3+ also supports the colour model RGB
-although Hewlett-Packard discourages its use\&.
-For this model the printer internally converts the RGB data it receives into
-CMY data for printing\&.
-Note that not everything which can be demanded when using a CMY palette
-in PCL\ 3+ is also permitted when using RGB\&.
-Because of its limited usefulness,
-\fBpcl3\fP accepts the colour model RGB only for the subdevices
-\fBunspecold\fP and \fBunspec\fP\&.
-.SS "Media Sizes and Orientations"
-.PP
-A PostScript document describes its visible content with respect to
-a coordinate system called \fIdefault user space\fR\&.
-Almost all PostScript devices are \fIpage devices\fR which
-paint only a restricted rectangular area in default user space\&.
-Part of the state of a page device is therefore the current
-\fIpage size\fR,
-two numbers specifying the width and height of the sheet to be printed on\&.
-These values must be interpreted from default user space,
-hence the page size not only describes the
-"sheet size" (extension irrespective of orientation) but also the
-orientation between page contents and sheet
-(portrait if width \(<= height, landscape otherwise)\&.
-The page size is requested by the user or the document,
-and it is one of the jobs of the device to satisfy this request\&.
-.PP
-Ghostscript looks at several sources to determine the page size:
-.IP " \(bu" 6
-the default size configured for \fBgs\fP
-(usually US Letter or ISO A4 in portrait orientation),
-.IP " \(bu" 6
-the value given to the option \fBPAPERSIZE\fP in the
-invocation,
-.IP " \(bu" 6
-the size requested by the document, unless you specify
-\fB-dFIXEDMEDIA\fP\&.
-.PP
-The last applicable item in this list overrides the others,
-hence the current page size can change at runtime\&.
-.PP
-The \fBpcl3\fP driver splits the page size into sheet size and
-page orientation and passes the sheet size to the printer\&.
-This works only if the printer accepts this size
-(accepted sizes are listed in your printer\&'s manual)\&.
-For the explicitly supported printers,
-the driver knows which sizes are accepted
-and will refuse to print if an unsupported one is requested\&.
-(If you suspect that \fBpcl3\fP is in error concerning what is
-supported,
-check the list of supported sizes in the PPD file for the subdevice you are
-using\&.)
-Group-3 printers also accept a \fIcustom page size\fR command
-which permits printing on arbitrarily-sized media
-but only within certain limits which are also known to the driver\&.
-Unlike the sheet size the page orientation is irrelevant for deciding whether
-a particular page size is supported or not\&.
-The driver will adapt itself as required by the
-PostScript language and rotate the output if necessary\&.
-(I know of only one other ghostscript driver capable of this\&.)
-.PP
-In setting up the PostScript default user space,
-\fBpcl3\fP
-does not treat envelope sizes differently from other sizes\&.
-.PP
-The subdevice \fBunspecold\fP accepts all sizes supported by
-the HP DeskJet 560C,
-\fBunspec\fP supports all discrete sizes known to the
-HP DeskJets 850C/855C/870C/890C and
-treats in addition every other size request as a custom page size
-without imposing any limits\&.
-If using any of these two subdevices you should change the list of supported
-sizes to fit your printer\&'s capabilities;
-see the
-\fI\fICONFIGURATION\fP\fR
-section below for details\&.
-.PP
-In order for a document to be printed correctly
-a sheet of appropriate size must be provided and the driver must know
-what its orientation with respect to the printing mechanism is\&.
-The latter is usually specified by reference to the feeding direction as
-"short edge first" or "long edge first"\&.
-Don\&'t confuse this kind of orientation with the portrait/landscape
-orientation:
-the former ("sheet orientation") refers to the orientation of the sheet
-with respect to the feeding direction,
-the latter ("page orientation") describes the orientation of the sheet with
-respect to the page contents (default user space)\&.
-These orientations are logically independent:
-people inserting paper into the printer need to know about the first,
-people composing documents only care about the latter\&.
-.PP
-Because \fBpcl3\fP
-has no information about the actual dimension or orientation of the medium
-in the input tray,
-you must ensure yourself that this is appropriate\&.
-By default, the driver assumes the dimension to be that requested via the
-page size,
-but you can override this assumption with an \fBInputAttributes\fP
-definition (see the
-\fI\fIMedia Sources and Destinations\fP\fR
-subsection in the \fICONFIGURATION\fP section below)\&.
-.PP
-There is no command in PCL\ 3+ to tell the printer about the
-sheet\&'s orientation in the input tray,
-therefore it cannot be chosen and the manufacturer must prescribe it\&.
-I am not aware of any precise and complete statement from Hewlett-Packard
-about what is required in this respect,
-hence you should check your printer\&'s manual whether the assumptions made by
-\fBpcl3\fP are correct or not:
-the driver assumes that media are always fed short edge first except when
-using the subdevices
-\fBhpdj\fP,
-\fBhpdjplus\fP,
-\fBhpdj400\fP,
-\fBhpdj500\fP
-or
-\fBhpdj500c\fP
-for printing on envelope sizes
-(US no\&. 10 and ISO DL)\&.
-In these cases you should insert the medium long edge first\&.
-If you find that \fBpcl3\fP\&'s default behaviour is incorrect,
-you can override it with the option \fBLeadingEdge\fP
-or a media configuration file
-(see the
-\fI\fICONFIGURATION\fP\fR
-section below)\&.
-.SS "Print Quality and Media Properties"
-.PP
-With the introduction of the DeskJet 540, HP added two new PCL commands to the
-language: "Print Quality" and "Media Type"\&.
-For older DeskJets (groups 1 and 2), similar effects can be
-achieved by specifying some technical aspects of the printing process in detail\&.
-.PP
-You can use the \fBPrintQuality\fP and
-\fBMedium\fP options to adapt the driver to the desired
-output quality and those properties of the medium it must know about,
-independent of which kind of subdevice you select\&.
-If it corresponds to a printer understanding the new commands,
-the option values are passed through to the printer,
-otherwise these specifications are
-mapped to the older Depletion, Shingling, and Raster Graphics Quality commands
-based on recommendations from HP\&.
-If you are not satisfied with the result in the latter case,
-use the options \fBDepletion\fP,
-\fBShingling\fP and
-\fBRasterGraphicsQuality\fP
-to explicitly set these values\&.
-.SS "Diagnostic Messages"
-.PP
-Error messages issued by this driver start with
-"\f(CW? \fIcomponent\fP:\fR"
-and warnings with
-"\f(CW?-W \fIcomponent\fP:\fR"\&.
-The \fIcomponent\fP can be
-\f(CWeprn\fR,
-\f(CWpcl3\fR, or
-\f(CWpclgen\fR,
-corresponding to the driver\&'s three internal layers:
-the \fBeprn\fP device extends ghostscript without knowing PCL,
-\fBpclgen\fP is a module generating PCL without being aware of
-ghostscript,
-and \fBpcl3\fP is the driver proper connecting the other two
-layers\&.
-.PP
-All these messages are written on the standard error stream\&.
-.SH "OPTIONS"
-.PP
-When specifying options for \fBgs\fP you should keep in mind
-that
-case is significant,
-that some options must be passed as strings (\fB-s\fP)
-and others as general tokens (\fB-d\fP),
-and that \fBgs\fP
-effectively ignores every option it does not recognize\&.
-Hence some care in spelling parameter names is necessary\&.
-.PP
-If you are confused by the large number of options, don\&'t worry\&.
-Just ignore those you don\&'t understand and
-concentrate first on the following ones,
-given here in the order of their importance:
-\fB-sDEVICE\fP,
-\fB-sSubdevice\fP,
-\fB-sColourModel\fP,
-\fB-r\fP,
-\fB-sPrintQuality\fP,
-and
-\fB-sMedium\fP\&.
-You should also check whether there is an entry in the
-\fBreports\&.txt\fP file
-in the \fBpcl3\fP distribution
-listing working option combinations for your printer\&.
-.SS "Standard Options"
-.PP
-When calling \fBgs\fP with the \fBpcl3\fP driver
-you can specify any option defined for ghostscript\&'s
-\fBprn\fP
-(printer) device although some have particular meanings or restrictions\&.
-This includes all device-independent options described in
-\fBgs\fP\fB(1)\fP\&.
-You should also look into ghostscript\&'s extended documentation
-(file \fI\fBUse\&.htm\fP (link to URL Use.htm) \fR and the section
-\fI\fIDevice
-parameters\fP (link to URL Language.htm#Device_parameters) \fR
-in \fBLanguage\&.htm\fP)\&.
-.IP "\fB-sDEVICE=pcl3\fP" 10
-This specification selects the \fBpcl3\fP
-driver,
-but this is not the only way to select it with this option\&.
-See the description of the \fBSubdevice\fP option below for other
-possibilities\&.
-.IP "\fB-dDuplex[=\fIboolean\fP]\fP or \fB-dDuplex=null\fP" 10
-This parameter requests duplex printing and can be set to
-\fBtrue\fP only for \fBunspec\fP and
-\fBunspecold\fP,
-and when the
-\fBDuplexCapability\fP value is not \fBnone\fP\&.
-The default is \fBnull\fP
-which for this driver means that the printer\&'s default setting will be used\&.
-.IP "" 10
-If your printer does not support duplex printing you can achieve the same
-effect manually by printing the odd and even pages separately
-(use a command like \fBpsselect\fP\fB(1)\fP from the psutils package for extracting these parts)
-and reinserting the paper in between\&.
-.IP "\fB-r \fIresolution\fP\fP" 10
-This option specifies the resolution in
-pixels per inch (ppi; sometimes also called dots per inch, dpi)\&.
-The driver checks whether the subdevice selected accepts the given
-resolution unless the subdevice is \fBunspecold\fP or
-\fBunspec\fP\&.
-Resolutions supported by at least some of the other subdevices
-for some of the colour models are 75, 100, 150, 300, 600×300 and 600 ppi\&.
-Consult the PPD files in the \fBpcl3\fP distribution if you want
-to know the details\&.
-The default resolution for \fBpcl3\fP is 300 ppi\&.
-.IP "" 10
-At least the highest possible value should be listed in your printer\&'s manual,
-but some care is necessary in the interpretation:
-the value given to \fBpcl3\fP must be a resolution supported by
-the printer\&'s hardware for all the colorants in the process colour model
-simultaneously and when operating in raster graphics mode\&.
-You should also keep in mind that if your printer has two cartridges
-they might support different sets of resolutions,
-i\&.e\&., which resolution you can choose might depend on the colour model\&.
-It is also possible that the print quality has to be considered as well\&.
-If you are in doubt and have access to a manufacturer-endorsed driver for your
-printer,
-use \fBpcl3opts\fP to find out about the settings used by that
-driver\&.
-.IP "" 10
-At least some of the series-500 DeskJets claim to
-permit a resolution of 600 × 300 ppi\&.
-However,
-although these models have a 600 dpi addressable horizontal resolution grid
-they do not permit neighbouring pixels to be activated
-(and the dots printed still have a diameter of about 1/300 in)\&.
-The raster data generated by
-\fBgs\fP
-does not obey this restriction\&.
-In addition, it is possible that the higher resolution is anyway only supported
-for the printer\&'s builtin fonts and not for general raster data\&.
-.IP "" 10
-Concerning the DeskJet 870C,
-my impression is that although some HP documents and drivers use expressions
-like "600x300 dpi C-REt color" for this printer,
-the model does not really support a resolution of 600 × 300 ppi\&.
-First, it does not accept \fBpcl3\fP\&'s output with this resolution,
-and second,
-if one inspects the best output of HP\&'s Windows driver for this printer
-with \fBpcl3opts\fP,
-one finds that the file uses a "mixed resolution",
-i\&.e\&., 600 ppi for black and 300 ppi for CMY\&.
-This is not supported by \fBpcl3\fP\&.
-.SS "\fBPcl3\fP-Specific Options"
-.IP "\fB-dBlackLevels=\fIlevels\fP\fP and \fB-dCMYLevels=\fIlevels\fP\fP" 10
-These options set the number of intensity levels per pixel and colorant
-to use when printing with black or CMY inks, respectively,
-and must be consistent with the colour model\&.
-They permit access to the printer\&'s
-Colour Resolution Enhancement technology (C-REt) feature\&.
-The defaults are 0 or 2, depending on the colour model chosen\&.
-Other values are only accepted for the subdevices
-\fBhpdj8\fInn\fPc\fR,
-\fBhpdj1120c\fP
-and \fBunspec\fP,
-and when not using the colour model \fBRGB\fP\&.
-.IP "" 10
-The subdevice \fBunspec\fP
-accepts any non-negative number of levels except 1 up to 256\&.
-The subdevices \fBhpdj8\fInn\fPc\fR
-and \fBhpdj1120c\fR accept the
-\fIlevels\fP 0, 2, 3 and 4
-with the following restrictions if any of the levels is larger than 2
-(these restrictions have been determined experimentally with a
-DeskJet 850C and are not based on HP documentation):
-.RS
-.IP " \(bu" 6
-You can\&'t use this feature with draft quality\&.
-.IP " \(bu" 6
-You can\&'t use a colour model of \fBCMY\fP\&.
-.IP " \(bu" 6
-You must use a resolution of 300 ppi\&.
-.IP " \(bu" 6
-You must use 4 levels for black\&.
-.RE
-.IP "" 10
-When using the subdevice \fBunspec\fP
-you should expect the printer to similarly limit the possibilities\&.
-In particular you must expect the permitted number of levels to depend on
-colour model, resolution and print quality\&.
-So far I have not heard of a PCL-3+ printer supporting more than
-four intensity levels per colorant\&.
-.IP "\fB-sColorModel=\fImodel\fP\fP or \fB-sColourModel=\fImodel\fP\fP" 10
-This selects the colour model to be used by the driver:
-\fBGray\fP,
-\fBRGB\fP,
-\fBCMY\fP, \fBCMY+K\fP or
-\fBCMYK\fP\&.
-The default is \fBGray\fP\&.
-Which colour models are accepted depends on the subdevice, see
-\fI\fIColour Models\fP\fR
-in the section \fIDESCRIPTION\fP above\&.
-.IP "" 10
-A value of \fBCMY\fP for this option also sets
-\fBBlackLevels\fP to zero,
-and if
-\fBCMYLevels\fP
-is zero when you demand any of \fBCMY\fP,
-\fBCMY+K\fP or \fBCMYK\fP,
-it is set to two\&.
-For \fBRGB\fP, effectively the same happens as for
-\fBCMY\fP\&.
-For all other situations you must ensure yourself that colour model and
-intensity levels are consistent or \fBpcl3\fP will complain\&.
-This rule implies that you can ignore the level options unless you
-want to use a non-default number of levels\&.
-.IP "" 10
-The PostScript page device dictionary entry
-\fBProcessColorModel\fP will not be correct for a colour model of
-\fBCMY\fP or \fBCMY+K\fP\&.
-(Ghostscript returns the native colour space in this parameter,
-not the process colour model\&.)
-.IP "\fB-dCompressionMethod=\fImethod\fP\fP" 10
-PCL interpreters understand several compression methods for raster graphics
-data in order to speed up host-printer communication\&.
-The possible choices are:
-
-.TS
-tab();
-l l.
-\fB0\fPUnencoded, non-compressed
-\fB1\fPRunlength encoding
-\fB2\fPT{
-Tagged Image File Format (TIFF) revision 4\&.0 "Packbits" encoding
-T}
-\fB3\fPDelta Row Compression
-\fB9\fPT{
-Compressed Replacement Delta Row Encoding
-T}
-.TE
-
-The default method is 9 except for the subdevices
-\fBhpdj\fP,
-\fBhpdjplus\fP, and
-\fBhpdj500\fP where it is 3
-(these printers do not support method\ 9),
-and for the subdevices \fBunspec\fP and
-\fBunspecold\fP where it is 2
-(this seems to give the best combination of portability and compression)\&.
-Requesting method 3 actually leads to a combination of methods 2 and\ 3\&.
-The driver may temporarily choose method 0 if a compressed data sequence would
-be longer than its uncompressed version\&.
-.IP "" 10
-Compression rates can vary drastically, depending on the structure of the input\&.
-However, although the absolute values change, the relative order of efficiency
-between the methods is usually the order of increasing
-\fImethod\fP\&.
-In short: use method 9 if it is supported\&.
-.IP "\fB-dConfigureEveryPage[=\fIboolean\fP]\fP" 10
-This parameter, if set to true, will force the printer to be reconfigured for
-every page\&.
-The option is superfluous for printers which are truly PCL-3-conforming\&.
-.IP "" 10
-Use this parameter if you discover that you can print single-page documents
-without problems but that the printer does not accept multi-page files\&.
-At present, the only printer I know of for which such a reconfiguration is
-needed is the Xerox DocuPrint\ M750\&.
-.IP "\fB-dCUPSAccounting[=\fIboolean\fP]\fP" 10
-You will usually specify this parameter when using \fBpcl3\fP as
-the final component in a CUPS (Common UNIX Printing System) driver\&.
-It will lead to appropriate page accounting messages on standard error\&.
-The default for this parameter is \fBfalse\fP\&.
-.IP "" 10
-If you have set this parameter to \fBtrue\fP you can\&'t set
-it back to \fBfalse\fP\&.
-The driver will generate a warning if this is attempted\&.
-.IP "" 10
-When using \fBpcl3\fP within CUPS you will normally set both,
-\fBCUPSAccounting\fP and \fBCUPSMessages\fP\&.
-There exist, however, CUPS configurations where page accounting messages should
-be generated by a command further down the print pipeline than
-\fBpcl3\fP
-(e\&.g\&., by a CUPS backend capable of processing PJL Page Status messages
-and driving a printer which sends them)\&.
-In these cases you should not specify \fB-dCUPSAccounting\fP\&.
-.IP "\fB-dCUPSMessages[=\fIboolean\fP]\fP" 10
-Specify this parameter when using \fBpcl3\fP as a
-component in a CUPS (Common UNIX Printing System) driver\&.
-It will modify the format of error messages and warnings as expected by CUPS\&.
-The default for this parameter is \fBfalse\fP\&.
-.IP "\fB-dDepletion=\fIdepletion\fP\fP" 10
-This option is only available for old DeskJets
-(including \fBunspecold\fP)
-and when printing in colour\&.
-The integer \fIdepletion\fP controls an algorithm for
-removing certain pixels from the image;
-this leads to less ink being applied to the medium\&.
-The possible values for \fIdepletion\fP are:
-
-.TS
-tab();
-r l.
-\fB1\fPNo depletion
-\fB2\fP25%
-\fB3\fP50%
-\fB4\fP25% with gamma correction
-\fB5\fP50% with gamma correction
-.TE
-
-The default value is derived from
-\fBMedium\fP and \fBPrintQuality\fP\&.
-The values 4 and 5 are not understood by the DeskJet 500C,
-but even for the other printers these values are not useful because PostScript
-permits finer control for gamma correction through transfer functions
-(see the subsection
-\fI\fITransfer Functions\fP\fR
-in the next section)\&.
-.IP "\fB-dDryTime=\fIdelay\fP\fP" 10
-With the exception of the DeskJets 500 and 500C,
-series-500 DeskJet printers can be told to guarantee a minimum drying time of
-\fIdelay\fP
-seconds before the next page of the same print job is dropped on a newly
-printed page\&.
-(This interval can be terminated by pressing the Load/Eject button\&.)
-The printer will choose default values depending on the current print quality,
-hence it is normally not necessary to specify this option and
-the feature is even considered obsolete for post-series-500 DeskJets
-although it is still supported by some of them\&.
-.IP "" 10
-Permissible values for
-\fIdelay\fP
-are \fBnull\fP and
-integers in the range \fB0\fP
-to \fB1200\fP,
-where
-\fBnull\fP
-instructs
-\fBpcl3\fP
-not to send a corresponding command,
-\fB0\fP
-establishes default values for the current print quality,
-and all other values explicitly request the duration in seconds\&.
-The default is \fBnull\fP\&.
-.IP "\fB-sDuplexCapability=\fIcapability\fP\fP" 10
-Looking at the final result (sheet printed),
-there are two kinds of duplex printing identified by the two possible values
-for the option \fBTumble\fP\&.
-Not all printers capable of duplex printing, however, provide the hardware
-support necessary for both,
-hence the driver must be told what the printer offers in order to be able to
-compensate for the missing functionality\&.
-The parameter \fB\fIcapability\fP\fR
-can be any of the following:
-
-.TS
-tab();
-l l.
-\fBnone\fPno duplex capability
-\fBsameLeadingEdge\fPT{
-second pass of sheet occurs with the same leading edge
-T}
-\fBoppositeLeadingEdge\fPT{
-second pass of sheet occurs with the opposite leading edge
-T}
-\fBboth\fPT{
-second pass of sheet can occur with either edge
-T}
-.TE
-
-This option can only be specified for
-\fBunspecold\fP and \fBunspec\fP\&.
-The default value is \fBnone\fP\&.
-.IP "" 10
-The correct setting for the HP DeskJet 970C is
-\fBoppositeLeadingEdge\fP,
-but the printer permits access to its duplex functionality only if you specify
-in addition
-\fB-sPJLLanguage=PCL3GUI -dOnlyCRD\fP\&.
-(Many thanks to Dawei W\&. Dong for an extensive series of experiments\&.)
-.IP "" 10
-If a printer does not offer hardware support for both orientations,
-the document to be printed must execute \fBshowpage\fP after a
-possible page-level \fBrestore\fP and not before,
-otherwise the driver will not be able to compensate for the missing
-functionality
-and only one of the two \fBTumble\fP values will work\&.
-All DSC-3\&.0-conforming PostScript files have the required property\&.
-.IP "\fB-sIntensityRendering=\fImethod\fP\fP" 10
-Most printers,
-including every PCL-3+ printer I know of,
-can render only a small number of intensities per pixel and colorant\&.
-In the most frequent case, merely two levels are possible\&.
-As this is usually not sufficient,
-various methods have been devised to achieve a larger palette;
-this is possible at the expense of spatial resolution\&.
-Because of this tradeoff between effective resolution and the number of
-colours which can be distinguished,
-the best method for a given document depends on the contents of the document
-and the user should therefore be able to select it\&.
-.IP "" 10
-The \fBpcl3\fP driver supports the following
-\fImethods\fP for intensity
-rendering:
-
-.TS
-tab();
-l l.
-\fBprinter\fPT{
-use the printer\&'s capabilities directly
-T}
-\fBhalftones\fPT{
-use ghostscript\&'s halftoning implementation
-T}
-\fBFloyd-Steinberg\fPuse Floyd-Steinberg error diffusion
-.TE
-
-The default method is \fBhalftones\fP\&.
-The methods differ only in their treatment of intensities which cannot be
-represented directly by the printer\&.
-If your document contains for example only black text,
-they all produce the same result, albeit at different speeds\&.
-.IP "" 10
-With \fBprinter\fP,
-\fBpcl3\fP will cause everything to be painted
-at the full hardware resolution but will have to map all colours to the nearest
-levels the printer can represent directly\&.
-For a CMY or CMYK printer with two intensity levels,
-this results in just 8 useful colours per pixel\&.
-This value is therefore usually only sensible for documents with a small number
-of widely different saturated colours
-where accurate colour reproduction is of minor importance but
-achieving the highest possible resolution is essential\&.
-Another possible application is the case of PostScript input which has already
-been adapted to the printer\&'s resolution and available intensity levels\&.
-.IP "" 10
-With \fBhalftones\fP,
-ghostscript will use what looks like standard PostScript halftoning algorithms\&.
-For details, consult a PostScript manual\&.
-However, you should know that ghostscript\&'s current halftoning
-implementation has some problems:
-.RS
-.IP " \(bu" 6
-The algorithm cannot handle different non-zero values for
-\fBBlackLevels\fP and \fBCMYLevels\fP\&.
-In this situation \fBgs\fP will in general assume
-that the number of black levels available is equal to that for CMY levels\&.
-Depending on which of the numbers is smaller, there will then either be unused
-black levels or some will be used more than once\&.
-.IP " \(bu" 6
-When you are using values larger than 2 for \fBBlackLevels\fP or
-\fBCMYLevels\fP,
-ghostscript does not discover by itself that it could now achieve the same
-number of shades with smaller halftone cells\&.
-.IP " \(bu" 6
-Most of the ways of increasing the halftone screen frequency seem to fail\&.
-I\ have been successful only with the somewhat pedestrian approach of
-using threshold arrays,
-and even that worked only for some cases\&.
-.IP " \(bu" 6
-For particular CMYK values and with ghostscript version\ 6 or higher,
-the colour becomes drastically wrong\&.
-One example is CMYK = (0\&.99998472, 0\&.002549, 0, 0\&.00367827);
-this should be almost a pure cyan but is instead displayed as a sort of pink\&.
-If one subtracts one unit in the last position for any of the non-zero
-components,
-the result becomes acceptable\&.
-The problem has not been observed with ghostscript\ 5\&.50\&.
-.IP " \(bu" 6
-For ghostscript versions up to and including 5\&.50,
-if you are using the colour model \fBCMYK\fP
-and more than 2 black levels you should not set merely a single halftone screen
-(\fBsetscreen\fP, a type-1 or a type-3 halftone dictionary)
-because
-ghostscript\&'s dithering routine can in this case return non-monotonic levels of
-black for monotonic input intensities\&.
-However, if you specify independent halftone information for the colour
-components,
-\fBgs\fP
-uses a slower but more accurate algorithm instead which does not lead to the
-wrong behaviour\&.
-It is not necessary for the halftone information to be different for different
-components to achieve this\&.
-Note that ghostscript installs separate halftone screens for CMYK devices by
-default if the resolution is at least 150 ppi\&.
-.RE
-.IP "" 10
-Whenever you modify the halftone screens you should therefore use a test file
-like
-\fBlevels-test\&.ps\fP in the \fBpcl3\fP distribution
-to check whether you obtain the desired result\&.
-In particular,
-you should count the number of intensities you can distinguish
-for a single colorant:
-if it is obviously not one plus
-the number of pixels in the halftone cell times
-one less than the number of hardware intensity levels,
-something has gone wrong\&.
-This is, for example, the case if
-you specified 4 black levels and a 2×2 halftone cell,
-and you then can distinguish more than 1 + 4×3 = 13 intensity levels\&.
-You should also watch for non-monotonic jumps in intensity and incompletely
-filled shapes\&.
-.IP "" 10
-The value \fBFloyd-Steinberg\fP selects Floyd-Steinberg error
-diffusion as the method for rendering intensities\&.
-Use this in particular for printing photographs and other documents with
-a large number of colours or small irregular shapes\&.
-Regrettably, \fBpcl3\fP\&'s speed is much slower with this
-method than in the other cases,
-hence this value should only be used when it is really needed
-(e\&.g\&., when you run into one of ghostscript\&'s halftoning problems)
-or when the delay is acceptable\&.
-.IP "" 10
-If you are using ghostscript\ 5\&.50 and
-the page to be rendered needs a lot of memory
-(this applies in particular to \fBFloyd-Steinberg\fP in colour)
-a core dump may result under certain circumstances\&.
-You can get around this by increasing the \fBMaxBitmap\fP parameter
-or by switching to a newer ghostscript version\&.
-.IP "\fB-dLeadingEdge=\fIedge\fP\fP" 10
-This option can be used to specify which edge of the sheet will enter the
-printer first\&.
-The permitted values identify this edge by reference to
-the orientation of default user space on the sheet
-when printing with default settings (except for \fBLeadingEdge\fP)
-and a page size having width \(<= height
-("canonical page in portrait orientation"):
-
-.TS
-tab();
-r l.
-\fBnull\fPNo request for media orientation
-\fB0\fPShort edge; top of canonical page
-\fB1\fPT{
-Long edge; right side of canonical page
-T}
-\fB2\fPT{
-Short edge; bottom of canonical page
-T}
-\fB3\fPT{
-Long edge; left side of canonical page
-T}
-.TE
-.IP "" 10
-As far as I know,
-given a particular PCL-3+ printer and a particular media size,
-you cannot choose between short edge first (0 or 2) and
-long edge first (1 or 3):
-this orientation is prescribed by the manufacturer and should be documented
-in your printer\&'s manual\&.
-If in doubt, use short edge first when inserting the medium\&.
-.IP "" 10
-The default value for \fIedge\fP is
-\fBnull\fP\&.
-This leads either to 0 or to 3,
-depending on whether the subdevice normally expects media of this size
-to be fed short edge first or long edge first\&.
-See the subsection
-\fI\fIMedia Sizes and
-Orientations\fP\fR
-in the \fIDESCRIPTION\fP section above for details\&.
-.IP "" 10
-If you find that you can\&'t set this parameter from PostScript but you can set
-it from the command line,
-ghostscript\&'s \fBsetpagedevice\fP definition probably does not
-pass the parameter to drivers\&.
-Read the \fBgs-mods\&.txt\fP file in the \fBpcl3\fP
-distribution on how to fix this\&.
-.IP "\fB-dManualFeed[=\fIboolean\fP]\fP" 10
-It is possible to request a DeskJet printer to wait before each page of a
-document until the Load/Eject button is pressed on the printer\&.
-This is intended for situations where some special medium is used or
-the medium has to be inserted into an input slot holding only one sheet at a
-time\&.
-The default setting for this option is \fBfalse\fP\&.
-.IP "" 10
-In PCL, manual feed is established by requesting a particular media source (2),
-hence you should expect that setting this parameter will interfere with the
-input tray selection via \fBInput\%At\%trib\%utes\fP
-(see the
-\fI\fIMedia Sources and Destinations\fP\fR
-subsection in the \fICONFIGURATION\fP section below)\&.
-.IP "\fB-sMediaConfigurationFile=\fIpathname\fP\fP" 10
-This option must specify an existing file containing a list of
-supported media sizes, sheet orientations
-and corresponding margin descriptions for the printer\&.
-This will take precedence over the builtin subdevice-specific lists\&.
-The format of the file is described in the
-\fI\fICONFIGURATION\fP\fR
-section below\&.
-This option is primarily intended to be used with the subdevices
-\fBunspecold\fP and \fBunspec\fP\&.
-.IP "" 10
-The default is not to use a media configuration file but the builtin lists\&.
-However,
-a media file path can also be specified at compile time overriding the default
-behaviour for \fBunspec\fP only\&.
-Using the
-\fBMediaConfigurationFile\fP
-option in addition will take precedence over the compiled-in media file path\&.
-.IP "\fB-dMediaPosition=\fIposition\fP\fP" 10
-This option sets the standard PostScript page device parameter
-\fBMediaPosition\fP to the specified value\&.
-The integer \fIposition\fP identifies an input tray for
-feeding media from and
-must refer to an existing entry in the \fBInputAttributes\fP
-dictionary (see the
-\fI\fIMedia Sources and Destinations\fP\fR
-subsection in the \fICONFIGURATION\fP section below)
-in order to take effect\&.
-The media selection process will use this entry in preference to others
-provided it matches the media request\&.
-The default is not to request a particular tray by position but to look for
-a best match based on other properties\&.
-As ghostscript\&'s default configuration defines only one entry in
-\fBInputAttributes\fP
-this option is ineffective unless you modify \fBInputAttributes\fP\&.
-.IP "" 10
-With current ghostscript versions
-you can\&'t use this parameter to select a
-negative \fIposition\fP\&.
-The driver will issue a warning if you attempt it\&.
-If the entry is actually selected,
-a \fBrangecheck\fP error from ghostscript will follow\&.
-This restriction applies only to this device parameter,
-not to permissible values for position numbers in
-\fBInputAttributes\fP:
-if you want to use a negative \fIposition\fP,
-you can do so by making sure that it is the only matching entry
-or by selecting it via \fBPriority\fP\&.
-.IP "\fB-sMedium=\fImedium\fP\fP" 10
-This option selects the type of medium you wish to print on
-as far as the printer needs to know about it\&.
-The possible choices are:
-
-.TS
-tab();
-l l.
-\fB0\fP\fBplain paper\fP
-\fB1\fP\fBbond paper\fP
-\fB2\fP\fBHP Premium paper\fP
-\fB3\fP\fBglossy paper\fP
-\fB4\fP\fBtransparency film\fP
-\fB5\fP\fBquick dry glossy\fP
-\fB6\fP\fBquick dry transparency\fP
-.TE
-
-The default is \fBplain paper\fP\&.
-For \fImedium\fP,
-you can specify the full strings (these are the standard values),
-the (in some cases) one-word strings resulting from dropping "paper", "film",
-and "HP",
-or an integer\&.
-Out-of-range numerical values generate a warning but are passed through to the
-printer if you are using a group-3 subdevice\&.
-If you don\&'t,
-the effect is the same as specifying \fBplain paper\fP\&.
-The values 5 and 6 are unknown to most DeskJets;
-the only official exception I know of is the HP 2000C printer\&.
-Your printer\&'s manual should tell you which kinds of medium are supported\&.
-.IP "\fB-dOnlyCRD[=\fIboolean\fP]\fP" 10
-This parameter influences the PCL code generated
-and should only be specified for group-3 DeskJets\&.
-The default value is \fBfalse\fP and leads to the new
-PCL command Configure Raster Data being used only when it is necessary\&.
-Specifying \fBtrue\fP leads to Configure Raster Data
-being used even in those cases where older commands would be sufficient\&.
-.IP "" 10
-There are indications that printers with a PCL dialect of
-"PCL Level 3 enhanced" need a value of \fBtrue\fP for this
-option to enable some of their functionality\&.
-.IP "\fB-sPageCountFile=\fIpathname\fP\fP" 10
-The \fIpathname\fP
-must specify either a non-existent file in a directory with write permission
-or a writable file with a single line containing a non-negative integer\&.
-In the first case,
-\fBpcl3\fP
-will create the file and insert the number of pages printed,
-in the second case the number will be incremented by that amount\&.
-Parallel invocations of
-\fBgs\fP
-are permitted to use the same file\&.
-\fBpcl3\fP
-will also make the initial page count available in its page device dictionary\&.
-.IP "" 10
-This option is mainly intended for spooler backends calling
-\fBpcl3\fP\&.
-It can be used to keep track of the total number of pages printed and also for
-per-job accounting\&.
-I recommend using this option for the first purpose and to make a note of the
-values in the resulting files whenever you insert a new ink cartridge\&.
-This will enable you to get an indication of how much a printed page costs,
-and hence why it is a good idea to use \fBdraft\fP quality
-whenever possible
-and why you should have bought a laser printer\&.
-.IP "" 10
-The driver can be compiled without this option present
-but on a UNIX system I would not expect this to be done unless
-\fBgs\fP
-offers the same functionality in a driver-independent manner
-which it currently does not\&.
-.IP "" 10
-\fBpcl3\fP
-is distributed with example files \fBif-pcl3\fP and
-\fBcups-pcl3\fP
-of Berkeley and CUPS spooler backends using this option\&.
-.IP "\fB-sPCLInit1=\fIstring\fP\fP and \fB-sPCLInit2=\fIstring\fP\fP" 10
-These options can be used to insert additional PCL commands into
-\fBpcl3\fP\&'s output\&.
-Strings given to \fBPCLInit1\fP will be sent immediately after the
-initial Printer Reset command,
-the value of \fBPCLInit2\fP will be emitted shortly before the
-raster data of the first page\&.
-The default is not to send any additional commands\&.
-.IP "" 10
-Don\&'t use any of these options unless you understand PCL or someone who does
-tells you which value to choose under which circumstances\&.
-.IP "" 10
-Because not every possible \fIstring\fP value can be
-passed from the command line,
-these parameters are best set from a PostScript file\&.
-.IP "\fB-sPJLJob=[\fIjobname\fP]\fP" 10
-This option can be used to surround the generated file with
-Printer Job Language (PJL) commands declaring it to be a single print job
-called \fIjobname\fP\&.
-If you omit \fIjobname\fP, you create an unnamed job\&.
-The string \fIjobname\fP may not contain double quotes
-or control characters except HT
-(the forbidden byte codes are 0 to\ 8, 10 to\ 31, and\ 34)\&.
-.IP "" 10
-Use this option if your printer understands PJL and
-you discover either that settings for one job influence the following job
-or that the printer does not recognize the end of the job (lights remain
-flashing or a control panel still displays a processing message)\&.
-If you send the generated PCL file through a PJL filter,
-in particular one querying the printer\&'s state,
-omit this option and use the filter for this purpose instead\&.
-.IP "\fB-sPJLLanguage=\fIlanguage\fP\fP" 10
-If a printer supports several command languages and PCL\ 3+ is not the
-default,
-the printer must be told to switch to PCL\ 3+ at the beginning of the
-print job\&.
-Hewlett-Packard\&'s printers use a Printer Job Language (PJL) command
-for this purpose\&.
-Specifying this option will switch the printer to
-\fIlanguage\fP for the duration of the job and back to the
-default at the end\&.
-.IP "" 10
-This option is not usually necessary except that there are indications that
-printers with a PCL dialect of "PCL Level 3 enhanced" need
-\fB-sPJLLanguage=PCL3GUI\fP
-to enable some of their functionality\&.
-.IP "" 10
-You should never use the option unless you have a reliable source for the values
-of \fIlanguage\fP accepted by your printer,
-for example the output from \fBpcl3opts\fP for a file generated
-by an official driver for the printer in question\&.
-Values I have seen so far are \f(CWPCLSLEEK\fR and
-\f(CWPCL3GUI\fR\&.
-.IP "" 10
-If you send the generated PCL file through a PJL filter,
-omit this option and use the filter for this purpose instead\&.
-.IP "\fB-sPrintQuality=\fIquality\fP\fP" 10
-There are three print quality settings:
-
-.TS
-tab();
-r l.
-\fB-1\fP\fBdraft\fP or \fBecono\fP
-\fB0\fP\fBnormal\fP
-\fB1\fP\fBpresentation\fP or \fBbest\fP
-.TE
-
-The default is \fBnormal\fP\&.
-You may specify the strings or an integer\&.
-Out-of-range numerical values will generate a warning but are passed
-through to the printer if you have selected a group-3 subdevice\&.
-If you haven\&'t,
-the effect is the same as specifying \fBnormal\fP\&.
-.IP "\fB-dRasterGraphicsQuality=\fIquality\fP\fP" 10
-This option is only available for old DeskJets
-(including \fBunspecold\fP)
-and controls a trade-off between quality and print speed\&.
-The possible values for \fIquality\fP are:
-
-.TS
-tab();
-r l.
-\fB0\fPUse current control panel setting
-\fB1\fPDraft
-\fB2\fPHigh
-.TE
-
-Specifying this option overrides the default value derived from
-\fBMedium\fP and \fBPrintQuality\fP\&.
-.IP "\fB-dSendBlackLast[=\fIboolean\fP]\fP" 10
-When printing with four inks,
-a PCL-3+ printer expects the colour information for a row of pixels
-in the order black, cyan, magenta, and finally yellow (KCMY)\&.
-.IP "" 10
-There exists at least one printer (Olivetti JP792) which claims to accept
-PCL\ 3+
-but expects the colour planes to arrive in the order CMYK\&.
-If you have a printer with this property, use this option\&.
-The default value is \fBfalse\fP\&.
-.IP "\fB-dSendNULs=\fInumber\fP\fP" 10
-Most HP drivers for newer DeskJet printers generate PCL files starting with a
-sequence of 600 NUL characters, at least one uses even 9600 NULs\&.
-I have seen no documentation of this feature
-but I assume that in PCL the NUL character demands a null operation, i\&.e\&.,
-does nothing\&.
-Just in case such a NUL sequence is useful under certain circumstances,
-this option can be used to request it\&.
-(It has been suggested that this is needed to get the printer to accept
-new PCL commands if the previous print job was aborted in the middle of a
-command\&.)
-The value \fInumber\fP specifies the number of
-NUL characters to send and must not be negative\&.
-The default is zero\&.
-Note that initial NULs might confuse spooler backends which
-try to determine the file type from the first few bytes of the file contents\&.
-.IP "" 10
-There is no point in using this option if some other command
-in your print pipeline will add Printer Job Language (PJL) commands
-to the \fBpcl3\fP-generated file\&.
-.IP "\fB-dShingling=\fIshingling\fP\fP" 10
-This option is only available for group-2 DeskJets
-(including \fBunspecold\fP)
-and controls the number of passes the print head makes over the medium\&.
-A higher number permits more neighbouring pixels
-to be printed in separate passes,
-thereby reducing the likelihood of the ink spreading into the next pixel\&.
-The possible values for \fIshingling\fP are:
-
-.TS
-tab();
-r l.
-\fB0\fPNo shingling
-\fB1\fP2 passes (50% each pass)
-\fB2\fP4 passes (25% each pass)
-.TE
-
-Specifying this option overrides the default value derived from
-\fBMedium\fP and \fBPrintQuality\fP\&.
-.IP "\fB-sSubdevice=\fIsubdevice\fP\fP" 10
-This option identifies the printer model for which the generated file is
-intended\&.
-The following names (mostly of Hewlett-Packard DeskJet printers)
-are accepted for \fIsubdevice\fP:
-.PP
-.RS
-.IP "" 10
-\fBhpdj\fP,
-\fBhpdjplus\fP,
-\fBhpdjportable\fP,
-\fBhpdj310\fP,
-\fBhpdj320\fP,
-\fBhpdj340\fP,
-\fBhpdj400\fP,
-\fBhpdj500\fP,
-\fBhpdj500c\fP,
-\fBhpdj510\fP,
-\fBhpdj520\fP,
-\fBhpdj540\fP,
-\fBhpdj550c\fP,
-\fBhpdj560c\fP,
-\fBunspecold\fP,
-\fBhpdj600\fP,
-\fBhpdj660c\fP,
-\fBhpdj670c\fP,
-\fBhpdj680c\fP,
-\fBhpdj690c\fP,
-\fBhpdj850c\fP,
-\fBhpdj855c\fP,
-\fBhpdj870c\fP,
-\fBhpdj890c\fP,
-\fBhpdj1120c\fP,
-\fBunspec\fP\&.
-.RE
-.IP "" 10
-The correspondence with the real printer name is, I hope, obvious\&.
-Note that \fBhpdj\fP does not select the
-\fBhpdj\fP driver (this driver\&'s predecessor)
-but configures the \fBpcl3\fP driver
-for the "classical" HP DeskJet\&.
-.IP "" 10
-With the exception of \fBhpdj\fP,
-\fBunspec\fP and \fBunspecold\fP,
-your \fBgs\fP binary might support the subdevice names also
-as device names,
-i\&.e\&., instead of specifying
-\fB-sDEVICE=pcl3
--sSubdevice=\fIsubdevice\fP\fR
-you might be able to write
-\fB-sDEVICE=\fIsubdevice\fP\fR\&.
-Check ghostscript\&'s list of available devices to find out whether this is the
-case (\fBgs -h\fP)\&.
-.IP "" 10
-The choice of subdevice primarily determines which resolutions, colour models,
-intensity levels and media sizes the driver will accept,
-where the output will appear on the page,
-and to some extent what PCL code the driver will generate\&.
-Several of the subdevices are treated identically\&.
-.IP "" 10
-The default subdevice is \fBunspec\fP\&.
-It is intended for new PCL-3+ printers not explicitly supported by this driver\&.
-For \fBunspec\fP,
-all subdevice-specific checks (e\&.g\&., supported resolutions)
-are turned off\&.
-Supported media sizes and margin settings are assumed to be identical with
-those for the DeskJets 850C/855C/870C/890C,
-but you can and should use the \fBMediaConfigurationFile\fP
-option or its compile-time equivalent to override this\&.
-The PCL code generated assumes a new DeskJet in the sense that it should be
-at least of the level of a DeskJet 540 supporting the PCL commands Media Type
-and Print Quality\&.
-If you specify unequal horizontal and vertical resolutions or
-more than two levels of intensity per colorant and pixel,
-the printer must in addition understand the Configure Raster Data command\&.
-.IP "" 10
-The subdevice \fBunspecold\fP is similar but behaves like
-a DeskJet 560C\&.
-It supports all colour models and all uniform resolutions
-(the horizontal resolution is equal to the vertical resolution)\&.
-.IP "" 10
-If you choose to use \fBunspec\fP or
-\fBunspecold\fP
-it is your responsibility to ensure that \fBpcl3\fP
-is only called with parameter values the printer can handle\&.
-This applies in particular to the resolution and the intensity levels\&.
-.IP "" 10
-If you set this parameter from a PostScript document you must know that
-doing this re-initializes most of the \fBpcl3\fP parameters
-to their default values\&.
-If you set several page device parameters in a single
-\fBsetpagedevice\fP call
-the \fBSubdevice\fP option will be treated first\&.
-.IP "\fB-dTumble[=\fIboolean\fP]\fP" 10
-When duplex printing is requested (\fB-dDuplex\fP),
-this parameter specifies whether the y axes of PostScript\&'s default user space
-on the two sides of the sheet (assumed to use the same page size) point to the
-same edge or to opposite edges\&.
-The default value \fBfalse\fP indicates the same edge and
-is usually suitable for binding on the left while
-\fBtrue\fP indicates opposite edges and should be used for
-binding at the top\&.
-.IP "" 10
-You should note that the interpretation of \fBTumble\fP refers to
-default user space:
-if a PostScript program has rotated the user space coordinate system
-the association between the page\&'s apparent "up" direction and the binding edge
-will usually not be the one desired\&.
-You should watch for this in particular when creating output
-in landscape orientation from an application still generating
-PostScript Level 1 code\&.
-If a ghostscript screen driver like \fBx11\fP displays the pages
-with the right side up you should have nothing to worry about,
-even in the case of landscape orientation\&.
-(You must call \fBgs\fP directly for this test,
-not via \fBghostview\fP\&.)
-If the orientation between the two sides turns out to be wrong,
-you will have to print again with the opposite value for
-\fBTumble\fP\&.
-If that does not help and you have a printer supporting only one of the two
-possible duplex orientations,
-check the relative order of \fBrestore\fP and
-\fBshowpage\fP in the document you printed
-(see the \fBDuplexCapability\fP option above)\&.
-.IP "\fB-dUseCard[=\fIvalue\fP]\fP" 10
-This option should only be given when printing on A6 and with a printer like the
-HP DeskJet 1120C which distinguishes between A6 sheets and A6 postcards\&.
-The option can be used to specifically request one of the alternatives\&.
-The default \fIvalue\fP is \fBnull\fP
-and means that sheets are preferred to postcards,
-but either is acceptable if supported\&.
-The other permitted values are
-\fBtrue\fP and \fBfalse\fP\&.
-.IP "" 10
-This option applies to all page sizes set while ghostscript
-executes and this includes the default size set at startup\&.
-If you wish to use \fB-dUseCard=true\fP you will
-therefore usually have to specify the \fBPAPERSIZE\fP option in the
-call,
-otherwise an error will occur because there is no postcard variant for the
-usual default sizes (ISO A4 and US Letter)\&.
-.SS "Option Combinations for Hardware Parameters"
-.PP
-Not all combinations of colour model, resolution, number of intensity levels,
-print quality and media type are accepted or make sense\&.
-Unfortunately, Hewlett-Packard does not publicly release sufficient information
-to find the best possible combinations\&.
-A good way to find reasonable settings is to use \fBpcl3opts\fP
-on files generated by an official driver for the printer\&.
-You should also check the file \fBreports\&.txt\fP in the
-\fBpcl3\fP distribution\&.
-In addition, I\&'ll provide some remarks here\&.
-.PP
-As a general rule,
-it is unprofitable to use a finer resolution than 300 ppi or more than
-2 intensity levels for draft quality\&.
-A coarser resolution in particular can reduce the time needed to generate
-and transmit the file to the printer\&.
-Combined with draft quality this leads to what HP calls an "EconoFast" mode\&.
-.PP
-As an exception, here are recommendations based on official HP documentation
-for the DeskJet 1120C\&.
-The table lists the resolution and the number of black or black and CMY levels
-if not 2\&.
-.PP
-.RS
-.TS
-tab();
-l l l.
-QualityGrayCMYK
-_
-draft300 ppi300 ppi
-normal300 ppi, 4 levels300 ppi, (4,3) levels
-presentation600 ppi300 ppi, (4,4) levels
-.TE
-.RE
-
-These seem reasonable values for the supported series-800 DeskJets as well\&.
-.SS "Checking Page Device Parameters"
-.PP
-As for all ghostscript drivers,
-\fBpcl3\fP\&'s command line options correspond to identically-named
-PostScript page device parameters
-and are accessible in the usual way\&.
-In particular,
-it is possible to read the value of a parameter
-by letting \fBgs\fP execute a command like
-.PP
-.RS
-.PP
-.nf
-\f(CWcurrentpagedevice /\fIparameter\fP get ==\fR
-.fi
-.PP
-.RE
-where \fIparameter\fP is the name of the parameter one
-would like to inspect,
-for example \fBBlackLevels\fP\&.
-This is useful if you are in doubt whether the driver has accepted your options\&.
-Of course, for printer-visible parameters you can also use
-\fBpcl3opts\fP on the output file\&.
-.PP
-The ghostscript distribution contains a program \fBuninfo\&.ps\fP
-which displays the page device dictionary on standard output
-but does not resolve nested dictionaries\&.
-The \fBpcl3\fP distribution contains a similar program
-\fBdumppdd\&.ps\fP which does not have this limitation\&.
-.SH "CONFIGURATION"
-.SS "Media Configuration File"
-.PP
-A \fImedia configuration file\fR
-(\fImedia file\fR for short) can be used to override the
-builtin subdevice-specific lists of supported media sizes
-and, for each size, the sheet orientation in the input tray
-and the margins enforced by the printer\&.
-This feature is mainly intended to be used in conjunction with
-\fBunspec\fP and \fBunspecold\fP:
-if you have a model not directly supported by this driver, look up the
-supported media sizes,
-the rules for inserting media
-and the corresponding printable regions in your printer\&'s
-manual and enter them in a media file\&.
-.PP
-.ne 3
-.RS
-\fBCaution:
-.PP
-Entering a media size in the file which is not really supported by your
-printer is not useful:
-the PCL interpreter will simply ignore the request to set this size,
-and printer and driver may have diverging opinions about what the margins
-will be\&.
-If you need to print on a medium of a size not supported by your printer,
-choose a larger and printer-supported size in PostScript or via
-\fBFIXEDMEDIA\fP,
-shift the image if necessary,
-establish properly-positioned clipping regions within the real size, and print\&.
-Or you could use a suitable page size recovery policy for PostScript\&'s
-media selection process\&.
-However, if you have a newer DeskJet supporting custom page sizes,
-all this is not necessary\&.
-.RE
-.PP
-Margin specifications are important for two reasons:
-the values for the left and top margins determine how the output is positioned
-on the page,
-and sufficiently large values for the right and bottom margins prevent the
-print head being caught at the paper\&'s edge and printing beyond the sheet,
-respectively\&.
-Because DeskJet printers usually have an inconveniently large bottom margin
-(usually 0\&.4-0\&.8 inches or 10-20 mm),
-one might be tempted to specify smaller values than listed in the
-printer\&'s manual\&.
-However, one user reported that this led to the printer depositing a large wet
-blob of black ink at the bottom of the page\&.
-.PP
-A line in the media file can be blank, a comment line (first non-blank
-character is \&'\fB#\fP\&'), or one of the following:
-.PP
-.RS
-.TS
-tab();
-l l.
-\fBunit\fP\fIunit\fP
-\fIsize\fP\fIleft\fP \fIbottom\fP \fIright\fP \fItop\fP
-.TE
-.RE
-.PP
-A \fBunit\fP line specifies in which units
-margin specifications in the following lines should be interpreted\&.
-\fIunit\fP
-can either be \fBin\fP (inch) or
-\fBmm\fP (millimetre)
-with \fBin\fP being the default\&.
-A unit specification remains in force until overridden by a following
-\fBunit\fP line\&.
-.PP
-The second kind of line states that the model supports a particular
-media configuration and specifies the hardware margins in force for that case\&.
-The \fIsize\fP word consists of two parts:
-a keyword denoting the extension and an optional suffix\&.
-The following keywords are accepted
-(entries marked with an asterisk (*) are those used by the subdevice
-\fBunspec\fP
-if no media file is employed;
-entries with a section/paragraph sign (§) similarly identify the sizes
-used by \fBunspecold\fP):
-
-.TS
-tab();
-r l.
-\fBIndex3x5in\fPUS index card 3 × 5 in
-\fBEnvChou4\fPT{
-Japanese long envelope #4 (90 × 205 mm)
-T}
-\fBEnvMonarch\fPT{
-US Monarch envelope (3\&.875 × 7\&.5 in)
-T}
-*\fBPostcard\fPJapanese Hagaki card (100 × 148 mm)
-*\fBIndex4x6in\fPUS index card 4 × 6 in
-§*\fBEnv10\fPUS no\&. 10 envelope (4\&.125 × 9\&.5 in)
-\fBA6\fPISO/JIS A6 (105 × 148 mm)
-*\fBA6Card\fPISO/JIS A6 postcard (105 × 148 mm)
-§*\fBEnvDL\fPISO DL envelope (110 × 220 mm)
-\fBEnvUS_A2\fPUS A2 envelope (4\&.375 × 5\&.75 in)
-*\fBEnvC6\fPISO C6 envelope (114 × 162 mm)
-\fBEnvChou3\fPT{
-Japanese long envelope #3 (120 × 235 mm)
-T}
-*\fBIndex5x8in\fPUS index card 5 × 8 in
-\fBStatement\fPUS Statement (5\&.5 × 8\&.5 in)
-\fBDoublePostcard\fPdouble Postcard (148 × 200 mm)
-*\fBA5\fPISO/JIS A5 (148 × 210 mm)
-\fBEnvC5\fPISO C5 envelope (162 × 229 mm)
-\fBISOB5\fPISO B5 (176 × 250 mm)
-*\fBJISB5\fPJIS B5 (182 × 257 mm)
-§*\fBExecutive\fPUS Executive (7\&.25 × 10\&.5 in)
-§*\fBA4\fPISO/JIS A4 (210 × 297 mm)
-§*\fBLetter\fPUS Letter (8\&.5 × 11 in)
-§*\fBLegal\fPUS Legal (8\&.5 × 14 in)
-\fBEnvKaku2\fPT{
-Japanese Kaku envelope (240 × 332 mm)
-T}
-\fBJISB4\fPT{
-JIS B4 (257 × 364 mm)\&.
-This is distinct from ISO B4 (250 × 353 mm)\&.
-T}
-\fBTabloid\fPT{
-US Tabloid (11 × 17 in; in landscape orientation also called "Ledger")
-T}
-\fBA3\fPISO/JIS A3 (297 × 420 mm)
-\fBHPSuperB\fPwhat HP calls Super B (13 × 19 in)
-*\fBCustomPageSize\fPcustom page size
-.TE
-
-Note the difference between \fBA6\fP (sheet) and
-\fBA6Card\fP (postcard)\&.
-I do not know why Hewlett-Packard associates this distinction with media size
-instead of media type\&.
-However, with the exception of the 1120C all DeskJet printers I know of
-use only \fBA6Card\fP anyway\&.
-.PP
-In looking at your printer\&'s documentation, bear in mind that a driver might
-support more sizes than the printer accepts;
-\fBpcl3\fP needs to be given the latter values\&.
-If you are in doubt what your printer understands,
-\fBpcl3opts\fP can tell you which media size another driver
-requests\&.
-.PP
-Custom page sizes are not understood by older printers
-and may be used in a media file only for the subdevices
-\fBhpdj540\fP,
-\fBhpdj6\fInn\fP[c]\fR,
-\fBhpdj8\fInn\fPc\fR,
-\fBhpdj1120c\fP,
-and \fBunspec\fP (group\ 3)\&.
-In these cases you can print, within certain limits, on arbitrarily-sized media\&.
-The driver knows these limits and refuses to generate a file if you exceed them\&.
-For \fBunspec\fP, there are no limits\&.
-\fBpcl3\fP
-will tell the printer to expect a custom page size
-only if there is no fitting discrete entry\&.
-.PP
-Although it is possible, on those printers which support it,
-to use a media configuration file containing only a custom page size entry,
-I advise against it
-because this size specification is only intended as a last resort\&.
-If you have a custom page size entry in the media file,
-you should therefore list \fIall\fP discrete sizes supported by
-your printer or at least those which you expect to use\&.
-.PP
-The size keyword in the \fIsize\fP field can be extended
-by the following strings:
-.IP "\fBBig\fP" 10
-For \fBpcl3\fP, this suffix means banner printing\&.
-In these cases the top and bottom margins are usually zero\&.
-HP DeskJets supporting banner printing do so only for ISO A4 and US Letter\&.
-Your media file should then contain entries for the
-\fIsizes\fP
-\fBA4\fP,
-\fBA4Big\fP,
-\fBLetter\fP, and
-\fBLetterBig\fP\&.
-.IP "\fB\&.Transverse\fP" 10
-By default,
-\fBpcl3\fP assumes that the media listed are fed short edge first\&.
-If you specify this qualifier,
-the driver will assume that you are going to feed media of this size
-long edge first\&.
-If, for example,
-your printer\&'s manual states that envelopes of size ISO DL should be fed
-long edge first,
-the corresponding \fIsize\fP field in your media file
-should contain the string \fBEnvDL\&.Transverse\fP,
-not \fBEnvDL\fP\&.
-.IP "" 10
-This specification (or its absence) can be overridden with the option
-\fBLeadingEdge\fP in the call\&.
-.PP
-The builtin lists for the \fBunspec\fP and
-\fBunspecold\fP devices do not contain size entries with any
-of these suffixes\&.
-.PP
-Every media file must contain at least an entry which fits ghostscript\&'s
-default page size,
-usually ISO A4 or US Letter\&.
-Only those sizes which are listed will be accepted by \fBpcl3\fP\&.
-This is independent of a \fB\&.Transverse\fP suffix\&.
-If there are several entries in the media file with the same
-\fIsize\fP value,
-only the first is used\&.
-.PP
-The margins in a size entry should be valid for monochrome printing in
-raster graphics mode\&.
-If a non-monochrome colour model is selected and unless the bottom margin is
-exactly zero,
-it will be increased by a subdevice-specific amount\&.
-This increment is zero for \fBunspecold\fP and
-\fBunspec\fP\&.
-.PP
-The orientation of the margins refers to the feeding direction:
-you should imagine holding the sheet such that the leading edge is at the top
-and the side to be printed on is towards you\&.
-Be careful with envelopes:
-older (pre-1997) HP documentation usually gives the margins in landscape
-orientation
-even for those printers where the envelope has to be fed short edge first\&.
-You can check this by looking for the largest margin value:
-if it is on the left instead of at the bottom you almost certainly have such a
-landscape-based specification;
-rotate the values by +90 degrees (quarter-circle counterclockwise) in these
-cases\&.
-The margins have to be specified as non-negative floating point numbers
-in inches or millimetres
-as announced by the last preceding \fBunit\fP line\&.
-The floating point format is that of the "C" locale\&.
-.PP
-\fBpcl3\fP
-is distributed with an example of a media configuration file,
-\fBexample\&.mcf\fP\&.
-.SS "PostScript Configuration Files"
-.PP
-Sometimes it is desirable to execute additional PostScript commands for a
-particular file or possibly all files sent to a particular printer or print
-queue\&.
-With ghostscript this is easily possible because \fBgs\fP
-accepts several file names in the invocation and processes them sequentially\&.
-This is particularly appropriate for those PostScript operators which affect
-device-specific features and should therefore not appear in a portable page
-description
-and for settings which would be part
-of the interpreter\&'s persistent state when using a real PostScript printer\&.
-.PP
-The \fBpcl3\fP distribution contains examples of filters
-\fBif-pcl3\fP for the Berkeley spooler
-\fBlpr\fP\fB(1)\fP
-and \fBcups-pcl3\fP for the Common UNIX Printing System
-\fBcupsd\fP\fB(8)\fP\&.
-These filters permit the use of a print-queue-specific configuration file\&.
-.SS "Media Sources and Destinations"
-.PP
-PostScript has a builtin mechanism for selecting media sources and destinations
-based on certain properties of the document\&.
-This usually requires a system administrator to set the
-\fBInputAttributes\fP and \fBOutputAttributes\fP
-dictionaries in the device\&'s page device dictionary according to the current
-state of the printer and its intended use\&.
-For example, if there are two input trays,
-one currently holding paper and the other transparencies,
-the administrator could configure the \fBInputAttributes\fP
-dictionary such that print jobs requesting transparencies in a certain manner
-automatically fetch media from the second tray
-and every job needing a size not currently available will terminate with
-an error message\&.
-Unfortunately, in order to work as expected this process usually also requires
-some additional action on the part of the entity generating the PostScript code
-to be printed\&.
-.PP
-If your printer is capable of sensing certain properties of media in the
-input tray (e\&.g\&., media size)
-or assumes a fixed association between media properties and input trays
-you must expect this functionality to interfere with the process referenced
-here\&.
-.PP
-In the attributes dictionaries,
-each tray is identified by an integer,
-its \fIposition number\fR\&.
-When ghostscript successfully matches the document\&'s requirements with trays
-the resulting position numbers are accessible to the driver\&.
-The \fBpcl3\fP driver uses these numbers (except 0)
-directly as arguments
-for the PCL commands "Media Source" and "Media Destination", respectively\&.
-For the Media Source values (input trays), I know of the following meanings:
-
-.PP
-.RS
-.TS
-tab();
-r l.
--1banner printing
-1T{
-default tray; portable CSF (DJ 340); tray 2 (HP 2500C)
-T}
-2manual feed
-3envelope feed
-4T{
-desktop CSF (DJ 340); tray 3 (HP 2500C)
-T}
-5tray 1 (HP 2500C)
-7auto select (HP 2500C)
-.TE
-.RE
-
-You\&'ll have to experiment with your printer to find out which values are
-accepted and what their interpretation is\&.
-In general,
-you can only expect 1 and 2 to work\&.
-Unrecognized values should be simply ignored by the printer
-leading to the medium being fetched from the default tray\&.
-To shorten the search, use \fBpcl3opts\fP
-if you can in order to find out which values other drivers generate\&.
-Don\&'t bother testing the value\ 0:
-in PCL its effect is to eject a page and, as this is not needed,
-\fBpcl3\fP uses it to mean that no particular tray should be
-selected\&.
-.PP
-I do not know of any PCL-3+ printer supporting more than one output tray,
-hence the corresponding implementation is based on the speculation that such
-a feature, if made available,
-would use the same command as in PCL\ 5\&.
-Again, a value of zero is used by \fBpcl3\fP to mean
-"don\&'t select a particular tray"\&.
-.PP
-Ghostscript\&'s default configuration defines
-\fBInputAttributes\fP and
-\fBOutputAttributes\fP dictionaries with one entry each,
-having position number 0 in both cases,
-and maps all requests to these positions\&.
-As explained above, this configuration will lead to \fBpcl3\fP
-not requesting any particular input or output tray\&.
-If you wish to modify this you should consult a PostScript manual,
-for example the sections 6\&.2\&.1 and 6\&.2\&.4 in the
-\fIPostScript Language Reference\fP\&.
-However, I\&'ll present here three examples without explanation\&.
-In all cases, the PostScript code shown should be executed before the
-document to be printed\&.
-.PP
-The first example is intended for situations where you always wish to select
-a specific input tray:
-.PP
-.RS
-.PP
-.nf
-\f(CW<<
- /InputAttributes <<
- 0 null
- \&\fIinput\fP << /PageSize [6 6 524287 524287] >>
- >>
->> setpagedevice\fR
-.fi
-.PP
-.RE
-Replace \fIinput\fP with the number of the tray
-you wish to use\&.
-The second example does the same for the output tray:
-.PP
-.RS
-.PP
-.nf
-\f(CW<<
- /OutputAttributes <<
- 0 null
- \&\fIoutput\fP << >>
- >>
->> setpagedevice\fR
-.fi
-.PP
-.RE
-Replace \fIoutput\fP with the number of the tray
-you wish to use\&.
-.PP
-For the final example assume that you have one input tray,
-filled with media of a certain default size,
-and you wish all print jobs requesting another size to automatically switch
-to manual feed so you can insert these special sheets at leisure\&.
-In that case,
-let \fBgs\fP execute the following PostScript code:
-.PP
-.RS
-.PP
-.nf
-\f(CW<<
- /InputAttributes <<
- 0 << /PageSize [\fIwidth\fP \fIheight\fP] >>
- 2 << /PageSize [6 6 524287 524287] >>
- /Priority [0 2]
- >>
->> setpagedevice\fR
-.fi
-.PP
-.RE
-.PP
-For \fIwidth\fP and \fIheight\fP you
-must insert the actual dimensions of your default size
-in units of 1 bp ("big point", 1/72 inch, roughly 0\&.35 mm);
-the tolerance is 5 bp\&.
-In contrast to a document\&'s page size,
-the orientation is irrelevant here\&.
-.PP
-If you drop the second entry and the \fBPriority\fP line
-in the last example
-you obtain a configuration where ghostscript will refuse to print any document
-not requesting the specified media size\&.
-If you retain the two lines and you are using the
-\fBunspecold\fP or \fBunspec\fP devices
-it is advisable to insert your printer\&'s actual size bounds instead of those
-given above\&.
-This will protect you against printing on some sizes
-not supported by your printer\&.
-.SS "Banner Printing"
-.PP
-Some printers support printing on continuous forms,
-also called banners or z-fold media\&.
-Your printer\&'s manual should tell you whether this is supported and in
-particular how to load these media\&.
-.PP
-In order to print on continuous media with \fBpcl3\fP,
-configure it as follows:
-.IP " \(bu" 6
-Make sure that input position number -1 will be selected
-(see the subsection
-\fI\fIMedia Sources And Destinations\fP\fR
-above)\&.
-.IP " \(bu" 6
-In the call to \fBgs\fP,
-select a subdevice supporting the intended "\fBBig\fP" size\&.
-By default,
-only the subdevices \fBhpdj680c\fP,
-\fBhpdj690c\fP and \fBhpdj1120c\fP
-support banner printing
-(\fBA4Big\fP and \fBLetterBig\fP)\&.
-.PP
-Don\&'t forget to prepare the printer as well\&.
-.SS "Correcting Offsets"
-.PP
-A media configuration file is intended to adapt
-\fBpcl3\fP
-to the difference in margin settings between printer models and should usually
-contain "official" information,
-preferably taken from the model\&'s manual\&.
-.PP
-A different situation arises if a particular printer\&'s output is not properly
-positioned on the page even if the margin information is correct for this
-model\&.
-PostScript defines two arrays in the page device dictionary for correcting such
-misadjustments,
-both containing two numbers describing a desired shift of the page image with
-respect to device space coordinate axes but in different units\&.
-The values in the `\fBMargins\fP\&' array are interpreted with
-respect to a canonical default resolution,
-the newer `\fBPageOffset\fP\&' array
-is taken to be in units of 1/72 inch ("big points", bp)\&.
-For \fBpcl3\fP the device coordinate system has an
-x axis pointing to the right and a y axis pointing downwards
-when looking at the sheet with the leading edge at the top and the side to be
-printed on towards you\&.
-The canonical default resolution is 300 ppi\&.
-.PP
-As an example, assume your printer shifts its output 1 mm to the right
-and 0\&.5 mm upwards\&.
-Now create a file containing either the PostScript code
-.PP
-.RS
-.PP
-.nf
-\f(CW<< /Margins [-11\&.8 5\&.9] >> setpagedevice\fR
-.fi
-.PP
-.RE
-("shift 11\&.8 pixels to the left and 5\&.9 pixels down") or
-.PP
-.RS
-.PP
-.nf
-\f(CW<< /PageOffset [-2\&.8 1\&.4] >> setpagedevice\fR
-.fi
-.PP
-.RE
-("shift 2\&.8 bp to the left and 1\&.4 bp down")
-and have it executed by ghostscript before the file to be printed\&.
-.PP
-The margin test files distributed with \fBpcl3\fP
-can be used to determine the necessary correction\&.
-You should be aware that you have to expect fluctuations between individual
-print jobs,
-in particular in the horizontal direction\&.
-.SS "Transfer Functions"
-.PP
-DeskJets usually produce prints which are too dark (too much ink on the page),
-most noticeably when using more than 2 intensity levels per colorant\&.
-In this case you should perform
-\fIgamma correction\fR
-by modifying what PostScript calls \fItransfer functions\fR\&.
-In the simplest case,
-create a file containing the PostScript command
-.PP
-.RS
-.PP
-.nf
-\f(CW{\fInumber\fP exp} settransfer\fR
-.fi
-.PP
-.RE
-.PP
-where a good value for \fInumber\fP
-is usually in the range 0\&.3-0\&.5,
-and specify this file in ghostscript\&'s command line before the file you wish to
-print\&.
-Now the intensities of all colorants will be rescaled by exponentiation
-with \fInumber\fP\&.
-Because PostScript intensity values are in the range zero to one
-with zero meaning dark and one meaning light (additive interpretation),
-a value of \fInumber\fP <\ 1
-will lead to lighter colours and
-\fInumber\fP >\ 1 results in darker colours\&.
-.PP
-The best value for \fInumber\fP depends on the
-print quality,
-the number of intensity levels,
-the method chosen for intensity rendering,
-the kind of medium you print on,
-and the properties of the document to be printed\&.
-.PP
-Note that there is no common convention for the interpretation of
-stand-alone gamma values\&.
-When dealing with other software you might for example find that the boundary
-between light and dark is at a value of\ 1000 and
-that lighter colours are obtained with larger values\&.
-In order to understand what a "gamma value" means
-you therefore need the complete specification of the transfer function and,
-if the value does not refer to PostScript,
-also information on the interpretation of intensity values\&.
-.PP
-You can also set independent transfer functions for the four colorants
-by using the operator \fBsetcolortransfer\fP
-which expects four routines as arguments\&.
-Consult a PostScript manual if you want to learn more about transfer functions\&.
-.PP
-If you are using \fB-sIntensityRendering=halftones\fP,
-less than 32 intensity levels per colorant,
-a resolution below 800 ppi,
-and unless you explicitly set transfer functions,
-\fBgs\fP applies a default gamma correction roughly corresponding
-to a value of 0\&.8 for \fInumber\fP\&.
-.SH "LIMITATIONS"
-.SS "Ghostscript Version"
-.PP
-This manual page contains statements relying on undocumented properties of
-ghostscript\&.
-These statements are to my best knowledge and belief correct for current
-ghostscript versions
-but I do not check all these statements for every new version\&.
-.PP
-If you are in doubt about a particular point, please check it yourself\&.
-.SS "Reliability"
-.PP
-Hewlett-Packard does not publicly provide sufficiently detailed or accurate
-technical information to write a reliable driver for all of its PCL-3+ printers\&.
-The amount and quality of available information differs between printer models\&.
-As a consequence,
-\fBpcl3\fP cannot provide the same level of reliability for all
-of its devices\&.
-.PP
-In my opinion the best-documented printers are those of the DeskJet-500 series\&.
-In addition, I have currently access to a DeskJet 850C which I have used for a
-number of experiments\&.
-Support for these printers should be considered to be the most reliable\&.
-.PP
-The next level of reliability belongs to the remaining printers for which
-subdevices exist\&.
-In these cases I had at least access to official HP documentation on supported
-media sizes and associated hardware margins
-and in addition for almost all cases some information on the supported PCL
-commands,
-sometimes complemented by PCL files generated by HP\&'s official drivers and sent
-me by users\&.
-.PP
-The third level of reliability is associated with those printers for which
-people have sent success reports
-but for which I have no official information from HP\&.
-.PP
-With decreasing reliability it becomes increasingly probable
-that there is printer functionality which is not accessible through
-\fBpcl3\fP or
-even that this driver generates PCL code not accepted by the printer\&.
-.SS "Mixed Resolutions"
-.PP
-Some printers are able to print with different resolutions for black and
-CMY on the same region of a page\&.
-For example, the best quality on a DeskJet 850C is achieved with 600 ppi for
-black and 300 ppi for CMY\&.
-This is not supported by \fBpcl3\fP\&.
-.SS "Photo Cartridges"
-.PP
-From what I\&'ve heard, DeskJet printers with photo cartridges installed do not
-use a CMYK palette but instead one with 6 components\&.
-I have no official information on this interface
-and even if I had it wouldn\&'t help because
-ghostscript does not currently support \fBDeviceN\fP as a
-native colour space\&.
-.SS "Cartridge Alignment"
-.PP
-DeskJet printers with more than one ink cartridge present should usually be
-configured for the proper relative alignment of these cartridges\&.
-Apparently, this information is stored in not-immediately-volatile memory
-in the printer together with some settings (like the default media size)
-which are not relevant for printing with \fBpcl3\fP\&.
-As I do not have information on how this is done,
-you will need to use one of HP\&'s programs for this purpose\&.
-.PP
-On a Linux system, try installing and running HP\&'s DOS DeskJet control panel
-\fBDJCP\fP in the DOS emulator\&.
-\fBDJCP\fP should be present on one of the installation media
-you received with your printer\&.
-One user managed to get this to work
-for a DJ 670C with DOSEMU 0\&.98 under RedHat 5\&.2 by setting
-.PP
-.RS
-.PP
-.nf
-\f(CW$_ports = "0x378 0x379"\fR
-.fi
-.PP
-.RE
-in \fBdosemu\&.conf\fP\&.
-I was not successful on my Debian system\&.
-.PP
-The \fBpcl3\fP distribution contains a file
-\fBcalign\&.ps\fP which you can print if you wish to check
-to which extent the cartridges are aligned\&.
-.SH "KNOWN BUGS"
-.PP
-There are no known bugs in \fBpcl3\fP proper,
-but there do exist restrictions or bugs in \fBgs\fP
-which can lead to faulty behaviour when printing with \fBpcl3\fP\&.
-As far as I noticed them
-they are mentioned in the body of this manual page at the relevant points\&.
-.PP
-You can find an up-to-date bug list for this driver via
-\fBpcl3\fP\&'s home page on the Web\&.
-.SH "SEE ALSO"
-.PP
-\fBgs\fP\fB(1)\fP,
-\fBpcl3opts\fP\fB(1)\fP
-.PP
-\fI\fIA First Guide to PostScript\fP (link to URL http://www.cs.indiana.edu/docproject/programming/postscript/postscript.html) \fR
-.PP
-Adobe Systems,
-\fI\fIPostScript Language Reference\fP (link to URL http://partners.adobe.com/asn/developer/PDFS/TN/PLRM.pdf) \fR\&.
-Third edition, 1999\&.
-.SH "AUTHOR"
-.PP
-Copyright \(co 2000, 2001 by Martin Lottermoser,
-Greifswaldstraße 28, 38124 Braunschweig, Germany\&.
-E-mail:
-Martin\&.Lottermoser@t-online\&.de\&.
-.PP
-\fBpcl3\fP has a
-\fIhome page (link to URL http://home.t-online.de/home/Martin.Lottermoser/pcl3.html) \fR on the Web\&.
-.PP
-This is free software,
-released under the terms of the
-\fIGNU Lesser General Public License (LGPL) (link to URL http://www.gnu.org/copyleft/lesser.html) \fR,
-Version 2\&.1\&.
-\fIUSE IT AT YOUR OWN RISK\&.\fP
-.PP
-Version of this reference page: $Revision: 1\&.21 $
-($Date: 2001/08/18 17:19:29 $)\&.
-...\" created by instant / docbook-to-man, Sun 19 Aug 2001, 12:15
diff --git a/gs/contrib/pcl3/doc/gs-pcl3.html b/gs/contrib/pcl3/doc/gs-pcl3.html
deleted file mode 100644
index e371e4368..000000000
--- a/gs/contrib/pcl3/doc/gs-pcl3.html
+++ /dev/null
@@ -1,6277 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<HTML
-><HEAD
-><TITLE
->pcl3</TITLE
-><META
-NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet version 1.13"></HEAD
-><BODY
-BGCOLOR="#FFFFFF"
-TEXT="#000000"
-><H1
->GS-PCL3</H1
-><DIV
-CLASS="REFNAMEDIV"
-><H2
->NAME</H2
->pcl3 &#8212; ghostscript device driver for printers understanding PCL 3+</DIV
-><DIV
-CLASS="REFSYNOPSISDIV"
-><H2
->SYNOPSIS</H2
-><P
-><B
-CLASS="COMMAND"
->gs</B
-> -sDEVICE=pcl3 [<TT
-CLASS="REPLACEABLE"
-><I
->gs_option</I
-></TT
-> | -dBlackLevels=<TT
-CLASS="REPLACEABLE"
-><I
->integer</I
-></TT
-> | -dCMYLevels=<TT
-CLASS="REPLACEABLE"
-><I
->integer</I
-></TT
-> | -sColorModel=<TT
-CLASS="REPLACEABLE"
-><I
->model</I
-></TT
-> | -sColourModel=<TT
-CLASS="REPLACEABLE"
-><I
->model</I
-></TT
-> | -dCompressionMethod=<TT
-CLASS="REPLACEABLE"
-><I
->method</I
-></TT
-> | -dConfigureEveryPage | -dCUPSAccounting | -dCUPSMessages | -dDepletion=<TT
-CLASS="REPLACEABLE"
-><I
->depletion</I
-></TT
-> | -dDryTime=<TT
-CLASS="REPLACEABLE"
-><I
->seconds</I
-></TT
-> | -sDuplexCapability=<TT
-CLASS="REPLACEABLE"
-><I
->capability</I
-></TT
-> | -sIntensityRendering=<TT
-CLASS="REPLACEABLE"
-><I
->method</I
-></TT
-> | -dLeadingEdge=<TT
-CLASS="REPLACEABLE"
-><I
->edge</I
-></TT
-> | -dManualFeed | -sMediaConfigurationFile=<TT
-CLASS="REPLACEABLE"
-><I
->pathname</I
-></TT
-> | -dMediaPosition=<TT
-CLASS="REPLACEABLE"
-><I
->position</I
-></TT
-> | -sMedium=<TT
-CLASS="REPLACEABLE"
-><I
->medium</I
-></TT
-> | -dOnlyCRD | -sPageCountFile=<TT
-CLASS="REPLACEABLE"
-><I
->pathname</I
-></TT
-> | -sPCLInit1=<TT
-CLASS="REPLACEABLE"
-><I
->string</I
-></TT
-> | -sPCLInit2=<TT
-CLASS="REPLACEABLE"
-><I
->string</I
-></TT
-> | -sPJLJob=<TT
-CLASS="REPLACEABLE"
-><I
->jobname</I
-></TT
-> | -sPJLLanguage=<TT
-CLASS="REPLACEABLE"
-><I
->language</I
-></TT
-> | -sPrintQuality=<TT
-CLASS="REPLACEABLE"
-><I
->quality</I
-></TT
-> | -dRasterGraphicsQuality=<TT
-CLASS="REPLACEABLE"
-><I
->quality</I
-></TT
-> | -dSendBlackLast | -dSendNULs=<TT
-CLASS="REPLACEABLE"
-><I
->number</I
-></TT
-> | -dShingling=<TT
-CLASS="REPLACEABLE"
-><I
->shingling</I
-></TT
-> | -sSubdevice=<TT
-CLASS="REPLACEABLE"
-><I
->subdevice</I
-></TT
-> | -dTumble | -dUseCard=<TT
-CLASS="REPLACEABLE"
-><I
->value</I
-></TT
->...] [<TT
-CLASS="REPLACEABLE"
-><I
->file</I
-></TT
->...] </P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A NAME="DESCRIPTION"
-><H2
->DESCRIPTION</H2
-></A
-><DIV
-CLASS="REFSECT2"
-><H3
->Supported Printers</H3
-><P
->The ghostscript device driver <B
-CLASS="COMMAND"
->pcl3</B
->
-(formerly called <B
-CLASS="COMMAND"
->hpdj</B
->)
-is a ghostscript backend for printers understanding
-Hewlett-Packard's Printer Command Language, level 3+
-("PCL 3+", also called "PCL 3 Plus").
-The driver is intended to support in particular the following printer models:
-<BLOCKQUOTE
-><P
-CLASS="LITERALLAYOUT"
->HP&nbsp;DeskJet<br>
-HP&nbsp;DeskJet&nbsp;Plus<br>
-HP&nbsp;DeskJet&nbsp;Portable<br>
-HP&nbsp;DeskJet&nbsp;310<br>
-HP&nbsp;DeskJet&nbsp;320<br>
-HP&nbsp;DeskJet&nbsp;340<br>
-HP&nbsp;DeskJet&nbsp;400<br>
-HP&nbsp;DeskJet&nbsp;500<br>
-HP&nbsp;DeskJet&nbsp;500C<br>
-HP&nbsp;DeskJet&nbsp;510<br>
-HP&nbsp;DeskJet&nbsp;520<br>
-HP&nbsp;DeskJet&nbsp;540<br>
-HP&nbsp;DeskJet&nbsp;550C<br>
-HP&nbsp;DeskJet&nbsp;560C<br>
-HP&nbsp;DeskJet&nbsp;600<br>
-HP&nbsp;DeskJet&nbsp;660C<br>
-HP&nbsp;DeskJet&nbsp;670C<br>
-HP&nbsp;DeskJet&nbsp;680C<br>
-HP&nbsp;DeskJet&nbsp;690C<br>
-HP&nbsp;DeskJet&nbsp;850C<br>
-HP&nbsp;DeskJet&nbsp;855C<br>
-HP&nbsp;DeskJet&nbsp;870C<br>
-HP&nbsp;DeskJet&nbsp;890C<br>
-HP&nbsp;DeskJet&nbsp;1120C</P
-></BLOCKQUOTE
->
-
-The PCL dialect called "PCL Level 3 enhanced" is apparently a not
-entirely compatible modification of PCL 3+.
-This driver should basically work with such printers
-but you must be more careful which options you select and
-you might not be able to exploit all your printer's capabilities.</P
-><P
->The driver does <I
-CLASS="EMPHASIS"
->not</I
-> support printers understanding only
-Hewlett-Packard's PPA (Printing Performance Architecture) commands.
-If a printer's documentation does not say anything about its
-printer command language and
-you find a statement like "... is designed for Microsoft Windows" or
-"DOS support through Windows only",
-the printer is almost certainly a PPA printer and hence is intended
-<I
-CLASS="EMPHASIS"
->exclusively</I
->
-for systems running Microsoft Windows.
-(These printers are also erroneously known as "GDI printers"
-because they are intended to be accessed through a manufacturer-supplied driver
-via Windows' GDI interface.)
-There exist ways of using a PPA printer with ghostscript,
-but not through <B
-CLASS="COMMAND"
->pcl3</B
->.</P
-><P
->Different printer models usually implement model-specific subsets of all
-PCL-3+ commands or arguments to commands.
-You must therefore tell the driver by means of the
-<SPAN
-CLASS="OPTION"
->Subdevice</SPAN
->
-option for which model the generated PCL code is intended.
-The model-dependent difference in the generated code is not great.
-Apart from media specifications, resolutions and colour capabilities,
-one can consider three groups of models
-which are treated with significant differences:
-
-<BLOCKQUOTE
-><P
-></P
-><DL
-><DT
->Group 1</DT
-><DD
-><P
->DeskJet, DeskJet Plus, DeskJet 500</P
-></DD
-><DT
->Group 2</DT
-><DD
-><P
->DeskJet Portable, DeskJets 3<TT
-CLASS="REPLACEABLE"
-><I
->xx</I
-></TT
->,
-400, 5<TT
-CLASS="REPLACEABLE"
-><I
->xx</I
-></TT
-> except 500 and 540,</P
-></DD
-><DT
->Group 3</DT
-><DD
-><P
->DeskJets 540, 6<TT
-CLASS="REPLACEABLE"
-><I
->xx</I
-></TT
->,
-8<TT
-CLASS="REPLACEABLE"
-><I
->xx</I
-></TT
-> and 1120C.</P
-></DD
-></DL
-></BLOCKQUOTE
->
-
-The first two groups I call the "old Deskjets",
-the third group consists of "new DeskJets".
-If you have a PCL-3 printer not appearing in the list above,
-the likelihood is still good that it will accept the files generated by
-<B
-CLASS="COMMAND"
->pcl3</B
->.
-You can specify one of the supported subdevices in these cases
-(it is sufficient to try one each from the groups just mentioned),
-or use the special subdevice names
-<TT
-CLASS="USERINPUT"
-><B
->unspecold</B
-></TT
-> or <TT
-CLASS="USERINPUT"
-><B
->unspec</B
-></TT
->
-which are treated like members of the second and the third group above,
-respectively,
-with all subdevice-dependent checks having been turned off.</P
-><P
->The list of printer models for which this driver is currently known to work is:</P
-><P
-><BLOCKQUOTE
-><P
-CLASS="LITERALLAYOUT"
->HP&nbsp;2000C<br>
-HP&nbsp;2500CM<br>
-HP&nbsp;DeskJet&nbsp;697C<br>
-HP&nbsp;DeskJet&nbsp;850C<br>
-HP&nbsp;DeskJet&nbsp;970C<br>
-HP&nbsp;DeskJet&nbsp;1100C<br>
-Xerox&nbsp;DocuPrint&nbsp;M750</P
-></BLOCKQUOTE
-></P
-><P
->Details can be found in the file <TT
-CLASS="FILENAME"
->reports.txt</TT
-> in the
-<B
-CLASS="COMMAND"
->pcl3</B
-> distribution;
-its latest version is available via <B
-CLASS="COMMAND"
->pcl3</B
->'s
-<A
-HREF="http://home.t-online.de/home/Martin.Lottermoser/pcl3.html"
-TARGET="_top"
->home
-page</A
->.
-If you wish to report on the hardware compatibility for a particular
-printer model,
-please read the file <TT
-CLASS="FILENAME"
->how-to-report.txt</TT
->.</P
-><P
->Omitting models already mentioned,
-previous (<B
-CLASS="COMMAND"
->hpdj</B
->) versions of this driver were reported to
-work with the following printers:</P
-><P
-><BLOCKQUOTE
-><P
-CLASS="LITERALLAYOUT"
->HP&nbsp;DeskJet&nbsp;340<br>
-HP&nbsp;DeskJet&nbsp;400&nbsp;(tested&nbsp;for&nbsp;Gray&nbsp;only)<br>
-HP&nbsp;DeskJet&nbsp;420<br>
-HP&nbsp;DeskJet&nbsp;500<br>
-HP&nbsp;DeskJet&nbsp;500C&nbsp;(tested&nbsp;for&nbsp;Gray&nbsp;only)<br>
-HP&nbsp;DeskJet&nbsp;520<br>
-HP&nbsp;DeskJet&nbsp;540<br>
-HP&nbsp;DeskJet&nbsp;560C<br>
-HP&nbsp;DeskJet&nbsp;600<br>
-HP&nbsp;DeskJet&nbsp;610C<br>
-HP&nbsp;DeskJet&nbsp;612C <br>
-HP&nbsp;DeskJet&nbsp;640C <br>
-HP&nbsp;DeskJet&nbsp;660C/660Cse<br>
-HP&nbsp;DeskJet&nbsp;670C<br>
-HP&nbsp;DeskJet&nbsp;672C<br>
-HP&nbsp;DeskJet&nbsp;680C<br>
-HP&nbsp;DeskJet&nbsp;690C<br>
-HP&nbsp;DeskJet&nbsp;690C+<br>
-HP&nbsp;DeskJet&nbsp;693C<br>
-HP&nbsp;DeskJet&nbsp;694C<br>
-HP&nbsp;DeskJet&nbsp;832C<br>
-HP&nbsp;DeskJet&nbsp;855C<br>
-HP&nbsp;DeskJet&nbsp;870Cse/870Cxi<br>
-HP&nbsp;DeskJet&nbsp;880C<br>
-HP&nbsp;DeskJet&nbsp;890C<br>
-HP&nbsp;DeskJet&nbsp;895Cse/895Cxi<br>
-HP&nbsp;DeskJet&nbsp;932C <br>
-HP&nbsp;DeskJet&nbsp;1120C<br>
-HP&nbsp;OfficeJet&nbsp;350 <br>
-HP&nbsp;OfficeJet&nbsp;590<br>
-HP&nbsp;OfficeJet&nbsp;600<br>
-HP&nbsp;OfficeJet&nbsp;625<br>
-HP&nbsp;OfficeJet&nbsp;G55 <br>
-HP&nbsp;OfficeJet&nbsp;T45 <br>
-Lexmark&nbsp;3000&nbsp;Color&nbsp;Jetprinter<br>
-Olivetti&nbsp;JP792&nbsp;(see&nbsp;the&nbsp;option&nbsp;<SPAN
-CLASS="OPTION"
->SendBlackLast</SPAN
->)</P
-></BLOCKQUOTE
-></P
-><P
->Most of the people who sent me reports did not state to which extent
-<B
-CLASS="COMMAND"
->hpdj</B
-> worked for their printer model.</P
-></DIV
-><DIV
-CLASS="REFSECT2"
-><A NAME="COLOURMODELS"
-><H3
->Colour Models</H3
-></A
-><P
->Ignoring photo cartridges which are not supported by <B
-CLASS="COMMAND"
->pcl3</B
->,
-DeskJet printers can be classified in four categories:</P
-><P
-></P
-><UL
-><LI
-><P
->The printer has only a black ink cartridge.</P
-></LI
-><LI
-><P
->The printer can print with either a black or a
-cyan/magenta/yellow (CMY) cartridge.</P
-></LI
-><LI
-><P
->The printer holds a CMY and a black cartridge simultaneously,
-but the two groups of inks are chemically incompatible and should not be
-overlayed.
-(Don't worry: the printer is not going to explode if they do.
-You merely get poorer results because the black ink will spread further
-than it should.
-This is called "ink bleeding".)</P
-></LI
-><LI
-><P
->The printer holds a CMY and a black cartridge simultaneously
-and the inks can be mixed.
-(Newer HP DeskJets use such bleed-proof inks.)</P
-></LI
-></UL
-><P
->This leads to four <I
-CLASS="FIRSTTERM"
->(process) colour models</I
->
-for the driver:
-<BLOCKQUOTE
-><P
-></P
-><DL
-><DT
->Gray</DT
-><DD
-><P
->Print in black only.</P
-></DD
-><DT
->CMY</DT
-><DD
-><P
->Print with cyan, magenta and yellow.
-In this mode, "composite black" consisting of all three inks is used to
-stand in for true black.</P
-></DD
-><DT
->CMY+K</DT
-><DD
-><P
->Print with all four inks, but never mix black with one of the others.</P
-></DD
-><DT
->CMYK</DT
-><DD
-><P
->Print with all four inks.</P
-></DD
-></DL
-></BLOCKQUOTE
->
-
-As a printer with both, a black and a CMY cartridge, can usually also print,
-e.g., with black only,
-the printer's "cartridge state" merely identifies one of these models as the
-maximal one.
-Depending on the category of the printer,
-the driver will therefore accept one or more models.
-The possibilities are:
-<BLOCKQUOTE
-><DIV
-CLASS="INFORMALTABLE"
-><P
-></P
-><TABLE
-BORDER="1"
-CLASS="CALSTABLE"
-><TR
-><TH
-ALIGN="LEFT"
-VALIGN="TOP"
->DeskJet Model</TH
-><TH
-ALIGN="LEFT"
-VALIGN="TOP"
->Colour Models</TH
-></TR
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->DeskJet, DeskJet Plus, DeskJet Portable, 500, 510, 520</TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->Gray</TD
-></TR
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->310, 320, 340, 400, 500C, 540, 600</TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->Gray, CMY</TD
-></TR
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->550C, 560C</TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->Gray, CMY, CMY+K</TD
-></TR
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->660C, 670C, 680C, 690C, 850C, 855C, 870C, 890C, 1120C</TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->all</TD
-></TR
-></TABLE
-><P
-></P
-></DIV
-></BLOCKQUOTE
->
-
-The subdevices <TT
-CLASS="USERINPUT"
-><B
->unspecold</B
-></TT
-> and
-<TT
-CLASS="USERINPUT"
-><B
->unspec</B
-></TT
-> also permit all colour models.
-A printer capable only of CMY might accept CMY+K or CMYK data,
-remapping them to CMY,
-and a printer capable of CMY+K might remap CMY data to CMY+K.</P
-><P
->The colour model CMY+K is not useful if you have a CMYK printer.
-In contrast,
-if you have a CMY+K or CMYK printer and the two cartridges support different
-resolutions,
-the colour models Gray or CMY become interesting as well.
-In most of these cases
-the black cartridge can print at a higher resolution than the CMY cartridge,
-although the converse does also occur.
-In addition, ghostscript is generally fastest for Gray.</P
-><P
->PCL 3+ also supports the colour model RGB
-although Hewlett-Packard discourages its use.
-For this model the printer internally converts the RGB data it receives into
-CMY data for printing.
-Note that not everything which can be demanded when using a CMY palette
-in PCL 3+ is also permitted when using RGB.
-Because of its limited usefulness,
-<B
-CLASS="COMMAND"
->pcl3</B
-> accepts the colour model RGB only for the subdevices
-<TT
-CLASS="USERINPUT"
-><B
->unspecold</B
-></TT
-> and <TT
-CLASS="USERINPUT"
-><B
->unspec</B
-></TT
->.</P
-></DIV
-><DIV
-CLASS="REFSECT2"
-><A NAME="SIZESANDORIENTATIONS"
-><H3
->Media Sizes and Orientations</H3
-></A
-><P
->A PostScript document describes its visible content with respect to
-a coordinate system called <I
-CLASS="FIRSTTERM"
->default user space</I
->.
-Almost all PostScript devices are <I
-CLASS="FIRSTTERM"
->page devices</I
-> which
-paint only a restricted rectangular area in default user space.
-Part of the state of a page device is therefore the current
-<I
-CLASS="FIRSTTERM"
->page size</I
->,
-two numbers specifying the width and height of the sheet to be printed on.
-These values must be interpreted from default user space,
-hence the page size not only describes the
-"sheet size" (extension irrespective of orientation) but also the
-orientation between page contents and sheet
-(portrait if width <= height, landscape otherwise).
-The page size is requested by the user or the document,
-and it is one of the jobs of the device to satisfy this request.</P
-><P
->Ghostscript looks at several sources to determine the page size:</P
-><P
-></P
-><UL
-><LI
-><P
->the default size configured for <B
-CLASS="COMMAND"
->gs</B
->
-(usually US Letter or ISO A4 in portrait orientation),</P
-></LI
-><LI
-><P
->the value given to the option <SPAN
-CLASS="OPTION"
->PAPERSIZE</SPAN
-> in the
-invocation,</P
-></LI
-><LI
-><P
->the size requested by the document, unless you specify
-<TT
-CLASS="USERINPUT"
-><B
->-dFIXEDMEDIA</B
-></TT
->.</P
-></LI
-></UL
-><P
->The last applicable item in this list overrides the others,
-hence the current page size can change at runtime.</P
-><P
->The <B
-CLASS="COMMAND"
->pcl3</B
-> driver splits the page size into sheet size and
-page orientation and passes the sheet size to the printer.
-This works only if the printer accepts this size
-(accepted sizes are listed in your printer's manual).
-For the explicitly supported printers,
-the driver knows which sizes are accepted
-and will refuse to print if an unsupported one is requested.
-(If you suspect that <B
-CLASS="COMMAND"
->pcl3</B
-> is in error concerning what is
-supported,
-check the list of supported sizes in the PPD file for the subdevice you are
-using.)
-Group-3 printers also accept a <I
-CLASS="FIRSTTERM"
->custom page size</I
-> command
-which permits printing on arbitrarily-sized media
-but only within certain limits which are also known to the driver.
-Unlike the sheet size the page orientation is irrelevant for deciding whether
-a particular page size is supported or not.
-The driver will adapt itself as required by the
-PostScript language and rotate the output if necessary.
-(I know of only one other ghostscript driver capable of this.)</P
-><P
->In setting up the PostScript default user space,
-<B
-CLASS="COMMAND"
->pcl3</B
->
-does not treat envelope sizes differently from other sizes.</P
-><P
->The subdevice <TT
-CLASS="USERINPUT"
-><B
->unspecold</B
-></TT
-> accepts all sizes supported by
-the HP DeskJet 560C,
-<TT
-CLASS="USERINPUT"
-><B
->unspec</B
-></TT
-> supports all discrete sizes known to the
-HP DeskJets 850C/855C/870C/890C and
-treats in addition every other size request as a custom page size
-without imposing any limits.
-If using any of these two subdevices you should change the list of supported
-sizes to fit your printer's capabilities;
-see the
-<A
-HREF="gs-pcl3.html#CONFIGURATION"
-><I
-CLASS="CITETITLE"
->CONFIGURATION</I
-></A
->
-section below for details.</P
-><P
->In order for a document to be printed correctly
-a sheet of appropriate size must be provided and the driver must know
-what its orientation with respect to the printing mechanism is.
-The latter is usually specified by reference to the feeding direction as
-"short edge first" or "long edge first".
-Don't confuse this kind of orientation with the portrait/landscape
-orientation:
-the former ("sheet orientation") refers to the orientation of the sheet
-with respect to the feeding direction,
-the latter ("page orientation") describes the orientation of the sheet with
-respect to the page contents (default user space).
-These orientations are logically independent:
-people inserting paper into the printer need to know about the first,
-people composing documents only care about the latter.</P
-><P
->Because <B
-CLASS="COMMAND"
->pcl3</B
->
-has no information about the actual dimension or orientation of the medium
-in the input tray,
-you must ensure yourself that this is appropriate.
-By default, the driver assumes the dimension to be that requested via the
-page size,
-but you can override this assumption with an <TT
-CLASS="LITERAL"
->InputAttributes</TT
->
-definition (see the
-<A
-HREF="gs-pcl3.html#SOURCESANDDESTINATIONS"
-><I
-CLASS="CITETITLE"
->Media Sources and Destinations</I
-></A
->
-subsection in the <I
-CLASS="CITETITLE"
->CONFIGURATION</I
-> section below).</P
-><P
->There is no command in PCL 3+ to tell the printer about the
-sheet's orientation in the input tray,
-therefore it cannot be chosen and the manufacturer must prescribe it.
-I am not aware of any precise and complete statement from Hewlett-Packard
-about what is required in this respect,
-hence you should check your printer's manual whether the assumptions made by
-<B
-CLASS="COMMAND"
->pcl3</B
-> are correct or not:
-the driver assumes that media are always fed short edge first except when
-using the subdevices
-<TT
-CLASS="USERINPUT"
-><B
->hpdj</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdjplus</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj400</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj500</B
-></TT
->
-or
-<TT
-CLASS="USERINPUT"
-><B
->hpdj500c</B
-></TT
->
-for printing on envelope sizes
-(US no. 10 and ISO DL).
-In these cases you should insert the medium long edge first.
-If you find that <B
-CLASS="COMMAND"
->pcl3</B
->'s default behaviour is incorrect,
-you can override it with the option <SPAN
-CLASS="OPTION"
->LeadingEdge</SPAN
->
-or a media configuration file
-(see the
-<A
-HREF="gs-pcl3.html#CONFIGURATION"
-><I
-CLASS="CITETITLE"
->CONFIGURATION</I
-></A
->
-section below).</P
-></DIV
-><DIV
-CLASS="REFSECT2"
-><H3
->Print Quality and Media Properties</H3
-><P
->With the introduction of the DeskJet 540, HP added two new PCL commands to the
-language: "Print Quality" and "Media Type".
-For older DeskJets (groups 1 and 2), similar effects can be
-achieved by specifying some technical aspects of the printing process in detail.</P
-><P
->You can use the <SPAN
-CLASS="OPTION"
->PrintQuality</SPAN
-> and
-<SPAN
-CLASS="OPTION"
->Medium</SPAN
-> options to adapt the driver to the desired
-output quality and those properties of the medium it must know about,
-independent of which kind of subdevice you select.
-If it corresponds to a printer understanding the new commands,
-the option values are passed through to the printer,
-otherwise these specifications are
-mapped to the older Depletion, Shingling, and Raster Graphics Quality commands
-based on recommendations from HP.
-If you are not satisfied with the result in the latter case,
-use the options <SPAN
-CLASS="OPTION"
->Depletion</SPAN
->,
-<SPAN
-CLASS="OPTION"
->Shingling</SPAN
-> and
-<SPAN
-CLASS="OPTION"
->RasterGraphicsQuality</SPAN
->
-to explicitly set these values.</P
-></DIV
-><DIV
-CLASS="REFSECT2"
-><H3
->Diagnostic Messages</H3
-><P
->Error messages issued by this driver start with
-"<TT
-CLASS="COMPUTEROUTPUT"
->? <TT
-CLASS="REPLACEABLE"
-><I
->component</I
-></TT
->:</TT
->"
-and warnings with
-"<TT
-CLASS="COMPUTEROUTPUT"
->?-W <TT
-CLASS="REPLACEABLE"
-><I
->component</I
-></TT
->:</TT
->".
-The <TT
-CLASS="REPLACEABLE"
-><I
->component</I
-></TT
-> can be
-<TT
-CLASS="COMPUTEROUTPUT"
->eprn</TT
->,
-<TT
-CLASS="COMPUTEROUTPUT"
->pcl3</TT
->, or
-<TT
-CLASS="COMPUTEROUTPUT"
->pclgen</TT
->,
-corresponding to the driver's three internal layers:
-the <B
-CLASS="COMMAND"
->eprn</B
-> device extends ghostscript without knowing PCL,
-<B
-CLASS="COMMAND"
->pclgen</B
-> is a module generating PCL without being aware of
-ghostscript,
-and <B
-CLASS="COMMAND"
->pcl3</B
-> is the driver proper connecting the other two
-layers.</P
-><P
->All these messages are written on the standard error stream.</P
-></DIV
-></DIV
-><DIV
-CLASS="REFSECT1"
-><H2
->OPTIONS</H2
-><P
->When specifying options for <B
-CLASS="COMMAND"
->gs</B
-> you should keep in mind
-that
-case is significant,
-that some options must be passed as strings (<TT
-CLASS="USERINPUT"
-><B
->-s</B
-></TT
->)
-and others as general tokens (<TT
-CLASS="USERINPUT"
-><B
->-d</B
-></TT
->),
-and that <B
-CLASS="COMMAND"
->gs</B
->
-effectively ignores every option it does not recognize.
-Hence some care in spelling parameter names is necessary.</P
-><P
->If you are confused by the large number of options, don't worry.
-Just ignore those you don't understand and
-concentrate first on the following ones,
-given here in the order of their importance:
-<TT
-CLASS="USERINPUT"
-><B
->-sDEVICE</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->-sSubdevice</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->-sColourModel</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->-r</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->-sPrintQuality</B
-></TT
->,
-and
-<TT
-CLASS="USERINPUT"
-><B
->-sMedium</B
-></TT
->.
-You should also check whether there is an entry in the
-<TT
-CLASS="FILENAME"
->reports.txt</TT
-> file
-in the <B
-CLASS="COMMAND"
->pcl3</B
-> distribution
-listing working option combinations for your printer.</P
-><DIV
-CLASS="REFSECT2"
-><H3
->Standard Options</H3
-><P
->When calling <B
-CLASS="COMMAND"
->gs</B
-> with the <B
-CLASS="COMMAND"
->pcl3</B
-> driver
-you can specify any option defined for ghostscript's
-<B
-CLASS="COMMAND"
->prn</B
->
-(printer) device although some have particular meanings or restrictions.
-This includes all device-independent options described in
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->gs</SPAN
->(1)</SPAN
->.
-You should also look into ghostscript's extended documentation
-(file <A
-HREF="Use.htm"
-TARGET="_top"
-><TT
-CLASS="FILENAME"
->Use.htm</TT
-></A
-> and the section
-<A
-HREF="Language.htm#Device_parameters"
-TARGET="_top"
-><I
-CLASS="CITETITLE"
->Device
-parameters</I
-></A
->
-in <TT
-CLASS="FILENAME"
->Language.htm</TT
->).&#13;</P
-><P
-></P
-><DL
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-sDEVICE=pcl3</B
-></TT
-></DT
-><DD
-><P
->This specification selects the <B
-CLASS="COMMAND"
->pcl3</B
->
-driver,
-but this is not the only way to select it with this option.
-See the description of the <SPAN
-CLASS="OPTION"
->Subdevice</SPAN
-> option below for other
-possibilities.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-dDuplex[<SPAN
-CLASS="OPTIONAL"
->=<TT
-CLASS="REPLACEABLE"
-><I
->boolean</I
-></TT
-></SPAN
->]</B
-></TT
-> or <TT
-CLASS="USERINPUT"
-><B
->-dDuplex=null</B
-></TT
-></DT
-><DD
-><P
->This parameter requests duplex printing and can be set to
-<TT
-CLASS="USERINPUT"
-><B
->true</B
-></TT
-> only for <TT
-CLASS="USERINPUT"
-><B
->unspec</B
-></TT
-> and
-<TT
-CLASS="USERINPUT"
-><B
->unspecold</B
-></TT
->,
-and when the
-<SPAN
-CLASS="OPTION"
->DuplexCapability</SPAN
-> value is not <TT
-CLASS="USERINPUT"
-><B
->none</B
-></TT
->.
-The default is <TT
-CLASS="USERINPUT"
-><B
->null</B
-></TT
->
-which for this driver means that the printer's default setting will be used.</P
-><P
->If your printer does not support duplex printing you can achieve the same
-effect manually by printing the odd and even pages separately
-(use a command like <SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->psselect</SPAN
->(1)</SPAN
-> from the psutils package for extracting these parts)
-and reinserting the paper in between.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-r <TT
-CLASS="REPLACEABLE"
-><I
->resolution</I
-></TT
-></B
-></TT
-></DT
-><DD
-><P
->This option specifies the resolution in
-pixels per inch (ppi; sometimes also called dots per inch, dpi).
-The driver checks whether the subdevice selected accepts the given
-resolution unless the subdevice is <TT
-CLASS="USERINPUT"
-><B
->unspecold</B
-></TT
-> or
-<TT
-CLASS="USERINPUT"
-><B
->unspec</B
-></TT
->.
-Resolutions supported by at least some of the other subdevices
-for some of the colour models are 75, 100, 150, 300, 600×300 and 600 ppi.
-Consult the PPD files in the <B
-CLASS="COMMAND"
->pcl3</B
-> distribution if you want
-to know the details.
-The default resolution for <B
-CLASS="COMMAND"
->pcl3</B
-> is 300 ppi.</P
-><P
->At least the highest possible value should be listed in your printer's manual,
-but some care is necessary in the interpretation:
-the value given to <B
-CLASS="COMMAND"
->pcl3</B
-> must be a resolution supported by
-the printer's hardware for all the colorants in the process colour model
-simultaneously and when operating in raster graphics mode.
-You should also keep in mind that if your printer has two cartridges
-they might support different sets of resolutions,
-i.e., which resolution you can choose might depend on the colour model.
-It is also possible that the print quality has to be considered as well.
-If you are in doubt and have access to a manufacturer-endorsed driver for your
-printer,
-use <B
-CLASS="COMMAND"
->pcl3opts</B
-> to find out about the settings used by that
-driver.</P
-><P
->At least some of the series-500 DeskJets claim to
-permit a resolution of 600 × 300 ppi.
-However,
-although these models have a 600 dpi addressable horizontal resolution grid
-they do not permit neighbouring pixels to be activated
-(and the dots printed still have a diameter of about 1/300 in).
-The raster data generated by
-<B
-CLASS="COMMAND"
->gs</B
->
-does not obey this restriction.
-In addition, it is possible that the higher resolution is anyway only supported
-for the printer's builtin fonts and not for general raster data.</P
-><P
->Concerning the DeskJet 870C,
-my impression is that although some HP documents and drivers use expressions
-like "600x300 dpi C-REt color" for this printer,
-the model does not really support a resolution of 600 × 300 ppi.
-First, it does not accept <B
-CLASS="COMMAND"
->pcl3</B
->'s output with this resolution,
-and second,
-if one inspects the best output of HP's Windows driver for this printer
-with <B
-CLASS="COMMAND"
->pcl3opts</B
->,
-one finds that the file uses a "mixed resolution",
-i.e., 600 ppi for black and 300 ppi for CMY.
-This is not supported by <B
-CLASS="COMMAND"
->pcl3</B
->.</P
-></DD
-></DL
-></DIV
-><DIV
-CLASS="REFSECT2"
-><H3
-><B
-CLASS="COMMAND"
->Pcl3</B
->-Specific Options</H3
-><P
-></P
-><DL
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-dBlackLevels=<TT
-CLASS="REPLACEABLE"
-><I
->levels</I
-></TT
-></B
-></TT
-> and <TT
-CLASS="USERINPUT"
-><B
->-dCMYLevels=<TT
-CLASS="REPLACEABLE"
-><I
->levels</I
-></TT
-></B
-></TT
-></DT
-><DD
-><P
->These options set the number of intensity levels per pixel and colorant
-to use when printing with black or CMY inks, respectively,
-and must be consistent with the colour model.
-They permit access to the printer's
-Colour Resolution Enhancement technology (C-REt) feature.
-The defaults are 0 or 2, depending on the colour model chosen.
-Other values are only accepted for the subdevices
-<TT
-CLASS="USERINPUT"
-><B
->hpdj8<TT
-CLASS="REPLACEABLE"
-><I
->nn</I
-></TT
->c</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj1120c</B
-></TT
->
-and <TT
-CLASS="USERINPUT"
-><B
->unspec</B
-></TT
->,
-and when not using the colour model <TT
-CLASS="USERINPUT"
-><B
->RGB</B
-></TT
->.</P
-><P
->The subdevice <TT
-CLASS="USERINPUT"
-><B
->unspec</B
-></TT
->
-accepts any non-negative number of levels except 1 up to 256.
-The subdevices <TT
-CLASS="USERINPUT"
-><B
->hpdj8<TT
-CLASS="REPLACEABLE"
-><I
->nn</I
-></TT
->c</B
-></TT
->
-and <TT
-CLASS="USERINPUT"
-><B
->hpdj1120c</B
-></TT
-> accept the
-<TT
-CLASS="REPLACEABLE"
-><I
->levels</I
-></TT
-> 0, 2, 3 and 4
-with the following restrictions if any of the levels is larger than 2
-(these restrictions have been determined experimentally with a
-DeskJet 850C and are not based on HP documentation):</P
-><P
-></P
-><UL
-><LI
-><P
->You can't use this feature with draft quality.</P
-></LI
-><LI
-><P
->You can't use a colour model of <TT
-CLASS="USERINPUT"
-><B
->CMY</B
-></TT
->.</P
-></LI
-><LI
-><P
->You must use a resolution of 300 ppi.</P
-></LI
-><LI
-><P
->You must use 4 levels for black.</P
-></LI
-></UL
-><P
->When using the subdevice <TT
-CLASS="USERINPUT"
-><B
->unspec</B
-></TT
->
-you should expect the printer to similarly limit the possibilities.
-In particular you must expect the permitted number of levels to depend on
-colour model, resolution and print quality.
-So far I have not heard of a PCL-3+ printer supporting more than
-four intensity levels per colorant.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-sColorModel=<TT
-CLASS="REPLACEABLE"
-><I
->model</I
-></TT
-></B
-></TT
-> or <TT
-CLASS="USERINPUT"
-><B
->-sColourModel=<TT
-CLASS="REPLACEABLE"
-><I
->model</I
-></TT
-></B
-></TT
-></DT
-><DD
-><P
->This selects the colour model to be used by the driver:
-<TT
-CLASS="USERINPUT"
-><B
->Gray</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->RGB</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->CMY</B
-></TT
->, <TT
-CLASS="USERINPUT"
-><B
->CMY+K</B
-></TT
-> or
-<TT
-CLASS="USERINPUT"
-><B
->CMYK</B
-></TT
->.
-The default is <TT
-CLASS="USERINPUT"
-><B
->Gray</B
-></TT
->.
-Which colour models are accepted depends on the subdevice, see
-<A
-HREF="gs-pcl3.html#COLOURMODELS"
-><I
-CLASS="CITETITLE"
->Colour Models</I
-></A
->
-in the section <I
-CLASS="CITETITLE"
->DESCRIPTION</I
-> above.</P
-><P
->A value of <TT
-CLASS="USERINPUT"
-><B
->CMY</B
-></TT
-> for this option also sets
-<TT
-CLASS="USERINPUT"
-><B
->BlackLevels</B
-></TT
-> to zero,
-and if
-<TT
-CLASS="USERINPUT"
-><B
->CMYLevels</B
-></TT
->
-is zero when you demand any of <TT
-CLASS="USERINPUT"
-><B
->CMY</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->CMY+K</B
-></TT
-> or <TT
-CLASS="USERINPUT"
-><B
->CMYK</B
-></TT
->,
-it is set to two.
-For <TT
-CLASS="USERINPUT"
-><B
->RGB</B
-></TT
->, effectively the same happens as for
-<TT
-CLASS="USERINPUT"
-><B
->CMY</B
-></TT
->.
-For all other situations you must ensure yourself that colour model and
-intensity levels are consistent or <B
-CLASS="COMMAND"
->pcl3</B
-> will complain.
-This rule implies that you can ignore the level options unless you
-want to use a non-default number of levels.</P
-><P
->The PostScript page device dictionary entry
-<TT
-CLASS="LITERAL"
->ProcessColorModel</TT
-> will not be correct for a colour model of
-<TT
-CLASS="USERINPUT"
-><B
->CMY</B
-></TT
-> or <TT
-CLASS="USERINPUT"
-><B
->CMY+K</B
-></TT
->.
-(Ghostscript returns the native colour space in this parameter,
-not the process colour model.)</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-dCompressionMethod=<TT
-CLASS="REPLACEABLE"
-><I
->method</I
-></TT
-></B
-></TT
-></DT
-><DD
-><P
->PCL interpreters understand several compression methods for raster graphics
-data in order to speed up host-printer communication.
-The possible choices are:
-
-<DIV
-CLASS="INFORMALTABLE"
-><P
-></P
-><TABLE
-BORDER="1"
-CLASS="CALSTABLE"
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->0</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->Unencoded, non-compressed</TD
-></TR
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->1</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->Runlength encoding</TD
-></TR
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->2</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->Tagged Image File Format (TIFF) revision 4.0 "Packbits" encoding </TD
-></TR
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->3</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->Delta Row Compression</TD
-></TR
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->9</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->Compressed Replacement Delta Row Encoding</TD
-></TR
-></TABLE
-><P
-></P
-></DIV
->
-
-The default method is 9 except for the subdevices
-<TT
-CLASS="USERINPUT"
-><B
->hpdj</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdjplus</B
-></TT
->, and
-<TT
-CLASS="USERINPUT"
-><B
->hpdj500</B
-></TT
-> where it is 3
-(these printers do not support method 9),
-and for the subdevices <TT
-CLASS="USERINPUT"
-><B
->unspec</B
-></TT
-> and
-<TT
-CLASS="USERINPUT"
-><B
->unspecold</B
-></TT
-> where it is 2
-(this seems to give the best combination of portability and compression).
-Requesting method 3 actually leads to a combination of methods 2 and 3.
-The driver may temporarily choose method 0 if a compressed data sequence would
-be longer than its uncompressed version.</P
-><P
->Compression rates can vary drastically, depending on the structure of the input.
-However, although the absolute values change, the relative order of efficiency
-between the methods is usually the order of increasing
-<TT
-CLASS="REPLACEABLE"
-><I
->method</I
-></TT
->.
-In short: use method 9 if it is supported.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-dConfigureEveryPage[<SPAN
-CLASS="OPTIONAL"
->=<TT
-CLASS="REPLACEABLE"
-><I
->boolean</I
-></TT
-></SPAN
->]</B
-></TT
-></DT
-><DD
-><P
->This parameter, if set to true, will force the printer to be reconfigured for
-every page.
-The option is superfluous for printers which are truly PCL-3-conforming.</P
-><P
->Use this parameter if you discover that you can print single-page documents
-without problems but that the printer does not accept multi-page files.
-At present, the only printer I know of for which such a reconfiguration is
-needed is the Xerox DocuPrint M750.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-dCUPSAccounting[<SPAN
-CLASS="OPTIONAL"
->=<TT
-CLASS="REPLACEABLE"
-><I
->boolean</I
-></TT
-></SPAN
->]</B
-></TT
-></DT
-><DD
-><P
->You will usually specify this parameter when using <B
-CLASS="COMMAND"
->pcl3</B
-> as
-the final component in a CUPS (Common UNIX Printing System) driver.
-It will lead to appropriate page accounting messages on standard error.
-The default for this parameter is <TT
-CLASS="USERINPUT"
-><B
->false</B
-></TT
->.</P
-><P
->If you have set this parameter to <TT
-CLASS="USERINPUT"
-><B
->true</B
-></TT
-> you can't set
-it back to <TT
-CLASS="USERINPUT"
-><B
->false</B
-></TT
->.
-The driver will generate a warning if this is attempted.</P
-><P
->When using <B
-CLASS="COMMAND"
->pcl3</B
-> within CUPS you will normally set both,
-<SPAN
-CLASS="OPTION"
->CUPSAccounting</SPAN
-> and <SPAN
-CLASS="OPTION"
->CUPSMessages</SPAN
->.
-There exist, however, CUPS configurations where page accounting messages should
-be generated by a command further down the print pipeline than
-<B
-CLASS="COMMAND"
->pcl3</B
->
-(e.g., by a CUPS backend capable of processing PJL Page Status messages
-and driving a printer which sends them).
-In these cases you should not specify <TT
-CLASS="USERINPUT"
-><B
->-dCUPSAccounting</B
-></TT
->.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-dCUPSMessages[<SPAN
-CLASS="OPTIONAL"
->=<TT
-CLASS="REPLACEABLE"
-><I
->boolean</I
-></TT
-></SPAN
->]</B
-></TT
-></DT
-><DD
-><P
->Specify this parameter when using <B
-CLASS="COMMAND"
->pcl3</B
-> as a
-component in a CUPS (Common UNIX Printing System) driver.
-It will modify the format of error messages and warnings as expected by CUPS.
-The default for this parameter is <TT
-CLASS="USERINPUT"
-><B
->false</B
-></TT
->.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-dDepletion=<TT
-CLASS="REPLACEABLE"
-><I
->depletion</I
-></TT
-></B
-></TT
-></DT
-><DD
-><P
->This option is only available for old DeskJets
-(including <TT
-CLASS="USERINPUT"
-><B
->unspecold</B
-></TT
->)
-and when printing in colour.
-The integer <TT
-CLASS="REPLACEABLE"
-><I
->depletion</I
-></TT
-> controls an algorithm for
-removing certain pixels from the image;
-this leads to less ink being applied to the medium.
-The possible values for <TT
-CLASS="REPLACEABLE"
-><I
->depletion</I
-></TT
-> are:
-
-<DIV
-CLASS="INFORMALTABLE"
-><P
-></P
-><TABLE
-BORDER="1"
-CLASS="CALSTABLE"
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->1</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->No depletion</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->2</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->25%</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->3</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->50%</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->4</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->25% with gamma correction</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->5</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->50% with gamma correction</TD
-></TR
-></TABLE
-><P
-></P
-></DIV
->
-
-The default value is derived from
-<SPAN
-CLASS="OPTION"
->Medium</SPAN
-> and <SPAN
-CLASS="OPTION"
->PrintQuality</SPAN
->.
-The values 4 and 5 are not understood by the DeskJet 500C,
-but even for the other printers these values are not useful because PostScript
-permits finer control for gamma correction through transfer functions
-(see the subsection
-<A
-HREF="gs-pcl3.html#TRANSFERFUNCTIONS"
-><I
-CLASS="CITETITLE"
->Transfer Functions</I
-></A
->
-in the next section).</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-dDryTime=<TT
-CLASS="REPLACEABLE"
-><I
->delay</I
-></TT
-></B
-></TT
-></DT
-><DD
-><P
->With the exception of the DeskJets 500 and 500C,
-series-500 DeskJet printers can be told to guarantee a minimum drying time of
-<TT
-CLASS="REPLACEABLE"
-><I
->delay</I
-></TT
->
-seconds before the next page of the same print job is dropped on a newly
-printed page.
-(This interval can be terminated by pressing the Load/Eject button.)
-The printer will choose default values depending on the current print quality,
-hence it is normally not necessary to specify this option and
-the feature is even considered obsolete for post-series-500 DeskJets
-although it is still supported by some of them.</P
-><P
->Permissible values for
-<TT
-CLASS="REPLACEABLE"
-><I
->delay</I
-></TT
->
-are <TT
-CLASS="USERINPUT"
-><B
->null</B
-></TT
-> and
-integers in the range <TT
-CLASS="USERINPUT"
-><B
->0</B
-></TT
->
-to <TT
-CLASS="USERINPUT"
-><B
->1200</B
-></TT
->,
-where
-<TT
-CLASS="USERINPUT"
-><B
->null</B
-></TT
->
-instructs
-<B
-CLASS="COMMAND"
->pcl3</B
->
-not to send a corresponding command,
-<TT
-CLASS="USERINPUT"
-><B
->0</B
-></TT
->
-establishes default values for the current print quality,
-and all other values explicitly request the duration in seconds.
-The default is <TT
-CLASS="USERINPUT"
-><B
->null</B
-></TT
->.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-sDuplexCapability=<TT
-CLASS="REPLACEABLE"
-><I
->capability</I
-></TT
-></B
-></TT
-></DT
-><DD
-><P
->Looking at the final result (sheet printed),
-there are two kinds of duplex printing identified by the two possible values
-for the option <SPAN
-CLASS="OPTION"
->Tumble</SPAN
->.
-Not all printers capable of duplex printing, however, provide the hardware
-support necessary for both,
-hence the driver must be told what the printer offers in order to be able to
-compensate for the missing functionality.
-The parameter <TT
-CLASS="USERINPUT"
-><B
-><TT
-CLASS="REPLACEABLE"
-><I
->capability</I
-></TT
-></B
-></TT
->
-can be any of the following:
-
-<DIV
-CLASS="INFORMALTABLE"
-><P
-></P
-><TABLE
-BORDER="1"
-CLASS="CALSTABLE"
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->none</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->no duplex capability</TD
-></TR
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->sameLeadingEdge</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->second pass of sheet occurs with the same leading edge</TD
-></TR
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->oppositeLeadingEdge</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->second pass of sheet occurs with the opposite leading edge</TD
-></TR
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->both</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->second pass of sheet can occur with either edge</TD
-></TR
-></TABLE
-><P
-></P
-></DIV
->
-
-This option can only be specified for
-<TT
-CLASS="USERINPUT"
-><B
->unspecold</B
-></TT
-> and <TT
-CLASS="USERINPUT"
-><B
->unspec</B
-></TT
->.
-The default value is <TT
-CLASS="USERINPUT"
-><B
->none</B
-></TT
->.</P
-><P
->The correct setting for the HP DeskJet 970C is
-<TT
-CLASS="USERINPUT"
-><B
->oppositeLeadingEdge</B
-></TT
->,
-but the printer permits access to its duplex functionality only if you specify
-in addition
-<TT
-CLASS="USERINPUT"
-><B
->-sPJLLanguage=PCL3GUI -dOnlyCRD</B
-></TT
->.
-(Many thanks to Dawei W. Dong for an extensive series of experiments.)</P
-><P
->If a printer does not offer hardware support for both orientations,
-the document to be printed must execute <TT
-CLASS="LITERAL"
->showpage</TT
-> after a
-possible page-level <TT
-CLASS="LITERAL"
->restore</TT
-> and not before,
-otherwise the driver will not be able to compensate for the missing
-functionality
-and only one of the two <SPAN
-CLASS="OPTION"
->Tumble</SPAN
-> values will work.
-All DSC-3.0-conforming PostScript files have the required property.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-sIntensityRendering=<TT
-CLASS="REPLACEABLE"
-><I
->method</I
-></TT
-></B
-></TT
-></DT
-><DD
-><P
->Most printers,
-including every PCL-3+ printer I know of,
-can render only a small number of intensities per pixel and colorant.
-In the most frequent case, merely two levels are possible.
-As this is usually not sufficient,
-various methods have been devised to achieve a larger palette;
-this is possible at the expense of spatial resolution.
-Because of this tradeoff between effective resolution and the number of
-colours which can be distinguished,
-the best method for a given document depends on the contents of the document
-and the user should therefore be able to select it.</P
-><P
->The <B
-CLASS="COMMAND"
->pcl3</B
-> driver supports the following
-<TT
-CLASS="USERINPUT"
-><B
-><TT
-CLASS="REPLACEABLE"
-><I
->methods</I
-></TT
-></B
-></TT
-> for intensity
-rendering:
-
-<DIV
-CLASS="INFORMALTABLE"
-><P
-></P
-><TABLE
-BORDER="1"
-CLASS="CALSTABLE"
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->printer</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->use the printer's capabilities directly</TD
-></TR
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->halftones</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->use ghostscript's halftoning implementation</TD
-></TR
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->Floyd-Steinberg</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->use Floyd-Steinberg error diffusion</TD
-></TR
-></TABLE
-><P
-></P
-></DIV
->
-
-The default method is <TT
-CLASS="USERINPUT"
-><B
->halftones</B
-></TT
->.
-The methods differ only in their treatment of intensities which cannot be
-represented directly by the printer.
-If your document contains for example only black text,
-they all produce the same result, albeit at different speeds.</P
-><P
->With <TT
-CLASS="USERINPUT"
-><B
->printer</B
-></TT
->,
-<B
-CLASS="COMMAND"
->pcl3</B
-> will cause everything to be painted
-at the full hardware resolution but will have to map all colours to the nearest
-levels the printer can represent directly.
-For a CMY or CMYK printer with two intensity levels,
-this results in just 8 useful colours per pixel.
-This value is therefore usually only sensible for documents with a small number
-of widely different saturated colours
-where accurate colour reproduction is of minor importance but
-achieving the highest possible resolution is essential.
-Another possible application is the case of PostScript input which has already
-been adapted to the printer's resolution and available intensity levels.</P
-><P
->With <TT
-CLASS="USERINPUT"
-><B
->halftones</B
-></TT
->,
-ghostscript will use what looks like standard PostScript halftoning algorithms.
-For details, consult a PostScript manual.
-However, you should know that ghostscript's current halftoning
-implementation has some problems:
-<P
-></P
-><UL
-><LI
-><P
->The algorithm cannot handle different non-zero values for
-<SPAN
-CLASS="OPTION"
->BlackLevels</SPAN
-> and <SPAN
-CLASS="OPTION"
->CMYLevels</SPAN
->.
-In this situation <B
-CLASS="COMMAND"
->gs</B
-> will in general assume
-that the number of black levels available is equal to that for CMY levels.
-Depending on which of the numbers is smaller, there will then either be unused
-black levels or some will be used more than once.</P
-></LI
-><LI
-><P
->When you are using values larger than 2 for <SPAN
-CLASS="OPTION"
->BlackLevels</SPAN
-> or
-<SPAN
-CLASS="OPTION"
->CMYLevels</SPAN
->,
-ghostscript does not discover by itself that it could now achieve the same
-number of shades with smaller halftone cells.</P
-></LI
-><LI
-><P
->Most of the ways of increasing the halftone screen frequency seem to fail.
-I have been successful only with the somewhat pedestrian approach of
-using threshold arrays,
-and even that worked only for some cases.</P
-></LI
-><LI
-><P
->For particular CMYK values and with ghostscript version 6 or higher,
-the colour becomes drastically wrong.
-One example is CMYK = (0.99998472, 0.002549, 0, 0.00367827);
-this should be almost a pure cyan but is instead displayed as a sort of pink.
-If one subtracts one unit in the last position for any of the non-zero
-components,
-the result becomes acceptable.
-The problem has not been observed with ghostscript 5.50.</P
-></LI
-><LI
-><P
->For ghostscript versions up to and including 5.50,
-if you are using the colour model <TT
-CLASS="USERINPUT"
-><B
->CMYK</B
-></TT
->
-and more than 2 black levels you should not set merely a single halftone screen
-(<TT
-CLASS="LITERAL"
->setscreen</TT
->, a type-1 or a type-3 halftone dictionary)
-because
-ghostscript's dithering routine can in this case return non-monotonic levels of
-black for monotonic input intensities.
-However, if you specify independent halftone information for the colour
-components,
-<B
-CLASS="COMMAND"
->gs</B
->
-uses a slower but more accurate algorithm instead which does not lead to the
-wrong behaviour.
-It is not necessary for the halftone information to be different for different
-components to achieve this.
-Note that ghostscript installs separate halftone screens for CMYK devices by
-default if the resolution is at least 150 ppi.</P
-></LI
-></UL
->
-Whenever you modify the halftone screens you should therefore use a test file
-like
-<TT
-CLASS="FILENAME"
->levels-test.ps</TT
-> in the <B
-CLASS="COMMAND"
->pcl3</B
-> distribution
-to check whether you obtain the desired result.
-In particular,
-you should count the number of intensities you can distinguish
-for a single colorant:
-if it is obviously not one plus
-the number of pixels in the halftone cell times
-one less than the number of hardware intensity levels,
-something has gone wrong.
-This is, for example, the case if
-you specified 4 black levels and a 2×2 halftone cell,
-and you then can distinguish more than 1 + 4×3 = 13 intensity levels.
-You should also watch for non-monotonic jumps in intensity and incompletely
-filled shapes.</P
-><P
->The value <TT
-CLASS="USERINPUT"
-><B
->Floyd-Steinberg</B
-></TT
-> selects Floyd-Steinberg error
-diffusion as the method for rendering intensities.
-Use this in particular for printing photographs and other documents with
-a large number of colours or small irregular shapes.
-Regrettably, <B
-CLASS="COMMAND"
->pcl3</B
->'s speed is much slower with this
-method than in the other cases,
-hence this value should only be used when it is really needed
-(e.g., when you run into one of ghostscript's halftoning problems)
-or when the delay is acceptable.</P
-><P
->If you are using ghostscript 5.50 and
-the page to be rendered needs a lot of memory
-(this applies in particular to <TT
-CLASS="USERINPUT"
-><B
->Floyd-Steinberg</B
-></TT
-> in colour)
-a core dump may result under certain circumstances.
-You can get around this by increasing the <SPAN
-CLASS="OPTION"
->MaxBitmap</SPAN
-> parameter
-or by switching to a newer ghostscript version.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-dLeadingEdge=<TT
-CLASS="REPLACEABLE"
-><I
->edge</I
-></TT
-></B
-></TT
-></DT
-><DD
-><P
->This option can be used to specify which edge of the sheet will enter the
-printer first.
-The permitted values identify this edge by reference to
-the orientation of default user space on the sheet
-when printing with default settings (except for <SPAN
-CLASS="OPTION"
->LeadingEdge</SPAN
->)
-and a page size having width <= height
-("canonical page in portrait orientation"):
-
-<DIV
-CLASS="INFORMALTABLE"
-><P
-></P
-><TABLE
-BORDER="1"
-CLASS="CALSTABLE"
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->null</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->No request for media orientation</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->0</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->Short edge; top of canonical page</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->1</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->Long edge; right side of canonical page</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->2</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->Short edge; bottom of canonical page</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->3</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->Long edge; left side of canonical page</TD
-></TR
-></TABLE
-><P
-></P
-></DIV
-></P
-><P
->As far as I know,
-given a particular PCL-3+ printer and a particular media size,
-you cannot choose between short edge first (0 or 2) and
-long edge first (1 or 3):
-this orientation is prescribed by the manufacturer and should be documented
-in your printer's manual.
-If in doubt, use short edge first when inserting the medium.</P
-><P
->The default value for <TT
-CLASS="REPLACEABLE"
-><I
->edge</I
-></TT
-> is
-<TT
-CLASS="USERINPUT"
-><B
->null</B
-></TT
->.
-This leads either to 0 or to 3,
-depending on whether the subdevice normally expects media of this size
-to be fed short edge first or long edge first.
-See the subsection
-<A
-HREF="gs-pcl3.html#SIZESANDORIENTATIONS"
-><I
-CLASS="CITETITLE"
->Media Sizes and
-Orientations</I
-></A
->
-in the <I
-CLASS="CITETITLE"
->DESCRIPTION</I
-> section above for details.</P
-><P
->If you find that you can't set this parameter from PostScript but you can set
-it from the command line,
-ghostscript's <TT
-CLASS="LITERAL"
->setpagedevice</TT
-> definition probably does not
-pass the parameter to drivers.
-Read the <TT
-CLASS="FILENAME"
->gs-mods.txt</TT
-> file in the <B
-CLASS="COMMAND"
->pcl3</B
->
-distribution on how to fix this.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-dManualFeed[<SPAN
-CLASS="OPTIONAL"
->=<TT
-CLASS="REPLACEABLE"
-><I
->boolean</I
-></TT
-></SPAN
->]</B
-></TT
-></DT
-><DD
-><P
->It is possible to request a DeskJet printer to wait before each page of a
-document until the Load/Eject button is pressed on the printer.
-This is intended for situations where some special medium is used or
-the medium has to be inserted into an input slot holding only one sheet at a
-time.
-The default setting for this option is <TT
-CLASS="USERINPUT"
-><B
->false</B
-></TT
->.</P
-><P
->In PCL, manual feed is established by requesting a particular media source (2),
-hence you should expect that setting this parameter will interfere with the
-input tray selection via <TT
-CLASS="LITERAL"
->InputAttributes</TT
->
-(see the
-<A
-HREF="gs-pcl3.html#SOURCESANDDESTINATIONS"
-><I
-CLASS="CITETITLE"
->Media Sources and Destinations</I
-></A
->
-subsection in the <I
-CLASS="CITETITLE"
->CONFIGURATION</I
-> section below).</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-sMediaConfigurationFile=<TT
-CLASS="REPLACEABLE"
-><I
->pathname</I
-></TT
-></B
-></TT
-></DT
-><DD
-><P
->This option must specify an existing file containing a list of
-supported media sizes, sheet orientations
-and corresponding margin descriptions for the printer.
-This will take precedence over the builtin subdevice-specific lists.
-The format of the file is described in the
-<A
-HREF="gs-pcl3.html#CONFIGURATION"
-><I
-CLASS="CITETITLE"
->CONFIGURATION</I
-></A
->
-section below.
-This option is primarily intended to be used with the subdevices
-<TT
-CLASS="USERINPUT"
-><B
->unspecold</B
-></TT
-> and <TT
-CLASS="USERINPUT"
-><B
->unspec</B
-></TT
->.</P
-><P
->The default is not to use a media configuration file but the builtin lists.
-However,
-a media file path can also be specified at compile time overriding the default
-behaviour for <TT
-CLASS="USERINPUT"
-><B
->unspec</B
-></TT
-> only.
-Using the
-<SPAN
-CLASS="OPTION"
->MediaConfigurationFile</SPAN
->
-option in addition will take precedence over the compiled-in media file path.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-dMediaPosition=<TT
-CLASS="REPLACEABLE"
-><I
->position</I
-></TT
-></B
-></TT
-></DT
-><DD
-><P
->This option sets the standard PostScript page device parameter
-<TT
-CLASS="LITERAL"
->MediaPosition</TT
-> to the specified value.
-The integer <TT
-CLASS="REPLACEABLE"
-><I
->position</I
-></TT
-> identifies an input tray for
-feeding media from and
-must refer to an existing entry in the <TT
-CLASS="LITERAL"
->InputAttributes</TT
->
-dictionary (see the
-<A
-HREF="gs-pcl3.html#SOURCESANDDESTINATIONS"
-><I
-CLASS="CITETITLE"
->Media Sources and Destinations</I
-></A
->
-subsection in the <I
-CLASS="CITETITLE"
->CONFIGURATION</I
-> section below)
-in order to take effect.
-The media selection process will use this entry in preference to others
-provided it matches the media request.
-The default is not to request a particular tray by position but to look for
-a best match based on other properties.
-As ghostscript's default configuration defines only one entry in
-<TT
-CLASS="LITERAL"
->InputAttributes</TT
->
-this option is ineffective unless you modify <TT
-CLASS="LITERAL"
->InputAttributes</TT
->.</P
-><P
->With current ghostscript versions
-you can't use this parameter to select a
-negative <TT
-CLASS="REPLACEABLE"
-><I
->position</I
-></TT
->.
-The driver will issue a warning if you attempt it.
-If the entry is actually selected,
-a <TT
-CLASS="LITERAL"
->rangecheck</TT
-> error from ghostscript will follow.
-This restriction applies only to this device parameter,
-not to permissible values for position numbers in
-<TT
-CLASS="LITERAL"
->InputAttributes</TT
->:
-if you want to use a negative <TT
-CLASS="REPLACEABLE"
-><I
->position</I
-></TT
->,
-you can do so by making sure that it is the only matching entry
-or by selecting it via <TT
-CLASS="LITERAL"
->Priority</TT
->.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-sMedium=<TT
-CLASS="REPLACEABLE"
-><I
->medium</I
-></TT
-></B
-></TT
-></DT
-><DD
-><P
->This option selects the type of medium you wish to print on
-as far as the printer needs to know about it.
-The possible choices are:
-
-<DIV
-CLASS="INFORMALTABLE"
-><P
-></P
-><TABLE
-BORDER="1"
-CLASS="CALSTABLE"
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->0</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->plain paper</B
-></TT
-></TD
-></TR
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->1</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->bond paper</B
-></TT
-></TD
-></TR
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->2</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->HP Premium paper</B
-></TT
-></TD
-></TR
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->3</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->glossy paper</B
-></TT
-></TD
-></TR
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->4</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->transparency film</B
-></TT
-></TD
-></TR
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->5</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->quick dry glossy</B
-></TT
-></TD
-></TR
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->6</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->quick dry transparency</B
-></TT
-></TD
-></TR
-></TABLE
-><P
-></P
-></DIV
->
-
-The default is <TT
-CLASS="USERINPUT"
-><B
->plain paper</B
-></TT
->.
-For <TT
-CLASS="REPLACEABLE"
-><I
->medium</I
-></TT
->,
-you can specify the full strings (these are the standard values),
-the (in some cases) one-word strings resulting from dropping "paper", "film",
-and "HP",
-or an integer.
-Out-of-range numerical values generate a warning but are passed through to the
-printer if you are using a group-3 subdevice.
-If you don't,
-the effect is the same as specifying <TT
-CLASS="USERINPUT"
-><B
->plain paper</B
-></TT
->.
-The values 5 and 6 are unknown to most DeskJets;
-the only official exception I know of is the HP 2000C printer.
-Your printer's manual should tell you which kinds of medium are supported.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-dOnlyCRD[<SPAN
-CLASS="OPTIONAL"
->=<TT
-CLASS="REPLACEABLE"
-><I
->boolean</I
-></TT
-></SPAN
->]</B
-></TT
-></DT
-><DD
-><P
->This parameter influences the PCL code generated
-and should only be specified for group-3 DeskJets.
-The default value is <TT
-CLASS="USERINPUT"
-><B
->false</B
-></TT
-> and leads to the new
-PCL command Configure Raster Data being used only when it is necessary.
-Specifying <TT
-CLASS="USERINPUT"
-><B
->true</B
-></TT
-> leads to Configure Raster Data
-being used even in those cases where older commands would be sufficient.</P
-><P
->There are indications that printers with a PCL dialect of
-"PCL Level 3 enhanced" need a value of <TT
-CLASS="USERINPUT"
-><B
->true</B
-></TT
-> for this
-option to enable some of their functionality.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-sPageCountFile=<TT
-CLASS="REPLACEABLE"
-><I
->pathname</I
-></TT
-></B
-></TT
-></DT
-><DD
-><P
->The <TT
-CLASS="REPLACEABLE"
-><I
->pathname</I
-></TT
->
-must specify either a non-existent file in a directory with write permission
-or a writable file with a single line containing a non-negative integer.
-In the first case,
-<B
-CLASS="COMMAND"
->pcl3</B
->
-will create the file and insert the number of pages printed,
-in the second case the number will be incremented by that amount.
-Parallel invocations of
-<B
-CLASS="COMMAND"
->gs</B
->
-are permitted to use the same file.
-<B
-CLASS="COMMAND"
->pcl3</B
->
-will also make the initial page count available in its page device dictionary.</P
-><P
->This option is mainly intended for spooler backends calling
-<B
-CLASS="COMMAND"
->pcl3</B
->.
-It can be used to keep track of the total number of pages printed and also for
-per-job accounting.
-I recommend using this option for the first purpose and to make a note of the
-values in the resulting files whenever you insert a new ink cartridge.
-This will enable you to get an indication of how much a printed page costs,
-and hence why it is a good idea to use <TT
-CLASS="USERINPUT"
-><B
->draft</B
-></TT
-> quality
-whenever possible
-and why you should have bought a laser printer.</P
-><P
->The driver can be compiled without this option present
-but on a UNIX system I would not expect this to be done unless
-<B
-CLASS="COMMAND"
->gs</B
->
-offers the same functionality in a driver-independent manner
-which it currently does not.</P
-><P
-><B
-CLASS="COMMAND"
->pcl3</B
->
-is distributed with example files <TT
-CLASS="FILENAME"
->if-pcl3</TT
-> and
-<TT
-CLASS="FILENAME"
->cups-pcl3</TT
->
-of Berkeley and CUPS spooler backends using this option.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-sPCLInit1=<TT
-CLASS="REPLACEABLE"
-><I
->string</I
-></TT
-></B
-></TT
-> and <TT
-CLASS="USERINPUT"
-><B
->-sPCLInit2=<TT
-CLASS="REPLACEABLE"
-><I
->string</I
-></TT
-></B
-></TT
-></DT
-><DD
-><P
->These options can be used to insert additional PCL commands into
-<B
-CLASS="COMMAND"
->pcl3</B
->'s output.
-Strings given to <SPAN
-CLASS="OPTION"
->PCLInit1</SPAN
-> will be sent immediately after the
-initial Printer Reset command,
-the value of <SPAN
-CLASS="OPTION"
->PCLInit2</SPAN
-> will be emitted shortly before the
-raster data of the first page.
-The default is not to send any additional commands.</P
-><P
->Don't use any of these options unless you understand PCL or someone who does
-tells you which value to choose under which circumstances.</P
-><P
->Because not every possible <TT
-CLASS="REPLACEABLE"
-><I
->string</I
-></TT
-> value can be
-passed from the command line,
-these parameters are best set from a PostScript file.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-sPJLJob=[<SPAN
-CLASS="OPTIONAL"
-><TT
-CLASS="REPLACEABLE"
-><I
->jobname</I
-></TT
-></SPAN
->]</B
-></TT
-></DT
-><DD
-><P
->This option can be used to surround the generated file with
-Printer Job Language (PJL) commands declaring it to be a single print job
-called <TT
-CLASS="REPLACEABLE"
-><I
->jobname</I
-></TT
->.
-If you omit <TT
-CLASS="REPLACEABLE"
-><I
->jobname</I
-></TT
->, you create an unnamed job.
-The string <TT
-CLASS="REPLACEABLE"
-><I
->jobname</I
-></TT
-> may not contain double quotes
-or control characters except HT
-(the forbidden byte codes are 0 to 8, 10 to 31, and 34).</P
-><P
->Use this option if your printer understands PJL and
-you discover either that settings for one job influence the following job
-or that the printer does not recognize the end of the job (lights remain
-flashing or a control panel still displays a processing message).
-If you send the generated PCL file through a PJL filter,
-in particular one querying the printer's state,
-omit this option and use the filter for this purpose instead.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-sPJLLanguage=<TT
-CLASS="REPLACEABLE"
-><I
->language</I
-></TT
-></B
-></TT
-></DT
-><DD
-><P
->If a printer supports several command languages and PCL 3+ is not the
-default,
-the printer must be told to switch to PCL 3+ at the beginning of the
-print job.
-Hewlett-Packard's printers use a Printer Job Language (PJL) command
-for this purpose.
-Specifying this option will switch the printer to
-<TT
-CLASS="REPLACEABLE"
-><I
->language</I
-></TT
-> for the duration of the job and back to the
-default at the end.</P
-><P
->This option is not usually necessary except that there are indications that
-printers with a PCL dialect of "PCL Level 3 enhanced" need
-<TT
-CLASS="USERINPUT"
-><B
->-sPJLLanguage=PCL3GUI</B
-></TT
->
-to enable some of their functionality.</P
-><P
->You should never use the option unless you have a reliable source for the values
-of <TT
-CLASS="REPLACEABLE"
-><I
->language</I
-></TT
-> accepted by your printer,
-for example the output from <B
-CLASS="COMMAND"
->pcl3opts</B
-> for a file generated
-by an official driver for the printer in question.
-Values I have seen so far are <TT
-CLASS="COMPUTEROUTPUT"
->PCLSLEEK</TT
-> and
-<TT
-CLASS="COMPUTEROUTPUT"
->PCL3GUI</TT
->.</P
-><P
->If you send the generated PCL file through a PJL filter,
-omit this option and use the filter for this purpose instead.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-sPrintQuality=<TT
-CLASS="REPLACEABLE"
-><I
->quality</I
-></TT
-></B
-></TT
-></DT
-><DD
-><P
->There are three print quality settings:
-
-<DIV
-CLASS="INFORMALTABLE"
-><P
-></P
-><TABLE
-BORDER="1"
-CLASS="CALSTABLE"
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->-1</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->draft</B
-></TT
-> or <TT
-CLASS="USERINPUT"
-><B
->econo</B
-></TT
-></TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->0</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->normal</B
-></TT
-></TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->1</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->presentation</B
-></TT
-> or <TT
-CLASS="USERINPUT"
-><B
->best</B
-></TT
-></TD
-></TR
-></TABLE
-><P
-></P
-></DIV
->
-
-The default is <TT
-CLASS="USERINPUT"
-><B
->normal</B
-></TT
->.
-You may specify the strings or an integer.
-Out-of-range numerical values will generate a warning but are passed
-through to the printer if you have selected a group-3 subdevice.
-If you haven't,
-the effect is the same as specifying <TT
-CLASS="USERINPUT"
-><B
->normal</B
-></TT
->.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-dRasterGraphicsQuality=<TT
-CLASS="REPLACEABLE"
-><I
->quality</I
-></TT
-></B
-></TT
-></DT
-><DD
-><P
->This option is only available for old DeskJets
-(including <TT
-CLASS="USERINPUT"
-><B
->unspecold</B
-></TT
->)
-and controls a trade-off between quality and print speed.
-The possible values for <TT
-CLASS="REPLACEABLE"
-><I
->quality</I
-></TT
-> are:
-
-<DIV
-CLASS="INFORMALTABLE"
-><P
-></P
-><TABLE
-BORDER="1"
-CLASS="CALSTABLE"
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->0</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->Use current control panel setting</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->1</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->Draft</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->2</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->High</TD
-></TR
-></TABLE
-><P
-></P
-></DIV
->
-
-Specifying this option overrides the default value derived from
-<SPAN
-CLASS="OPTION"
->Medium</SPAN
-> and <SPAN
-CLASS="OPTION"
->PrintQuality</SPAN
->.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-dSendBlackLast[<SPAN
-CLASS="OPTIONAL"
->=<TT
-CLASS="REPLACEABLE"
-><I
->boolean</I
-></TT
-></SPAN
->]</B
-></TT
-></DT
-><DD
-><P
->When printing with four inks,
-a PCL-3+ printer expects the colour information for a row of pixels
-in the order black, cyan, magenta, and finally yellow (KCMY).</P
-><P
->There exists at least one printer (Olivetti JP792) which claims to accept
-PCL 3+
-but expects the colour planes to arrive in the order CMYK.
-If you have a printer with this property, use this option.
-The default value is <TT
-CLASS="USERINPUT"
-><B
->false</B
-></TT
->.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-dSendNULs=<TT
-CLASS="REPLACEABLE"
-><I
->number</I
-></TT
-></B
-></TT
-></DT
-><DD
-><P
->Most HP drivers for newer DeskJet printers generate PCL files starting with a
-sequence of 600 NUL characters, at least one uses even 9600 NULs.
-I have seen no documentation of this feature
-but I assume that in PCL the NUL character demands a null operation, i.e.,
-does nothing.
-Just in case such a NUL sequence is useful under certain circumstances,
-this option can be used to request it.
-(It has been suggested that this is needed to get the printer to accept
-new PCL commands if the previous print job was aborted in the middle of a
-command.)
-The value <TT
-CLASS="REPLACEABLE"
-><I
->number</I
-></TT
-> specifies the number of
-NUL characters to send and must not be negative.
-The default is zero.
-Note that initial NULs might confuse spooler backends which
-try to determine the file type from the first few bytes of the file contents.</P
-><P
->There is no point in using this option if some other command
-in your print pipeline will add Printer Job Language (PJL) commands
-to the <B
-CLASS="COMMAND"
->pcl3</B
->-generated file.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-dShingling=<TT
-CLASS="REPLACEABLE"
-><I
->shingling</I
-></TT
-></B
-></TT
-></DT
-><DD
-><P
->This option is only available for group-2 DeskJets
-(including <TT
-CLASS="USERINPUT"
-><B
->unspecold</B
-></TT
->)
-and controls the number of passes the print head makes over the medium.
-A higher number permits more neighbouring pixels
-to be printed in separate passes,
-thereby reducing the likelihood of the ink spreading into the next pixel.
-The possible values for <TT
-CLASS="REPLACEABLE"
-><I
->shingling</I
-></TT
-> are:
-
-<DIV
-CLASS="INFORMALTABLE"
-><P
-></P
-><TABLE
-BORDER="1"
-CLASS="CALSTABLE"
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->0</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->No shingling</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->1</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->2 passes (50% each pass)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->2</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->4 passes (25% each pass)</TD
-></TR
-></TABLE
-><P
-></P
-></DIV
->
-
-Specifying this option overrides the default value derived from
-<SPAN
-CLASS="OPTION"
->Medium</SPAN
-> and <SPAN
-CLASS="OPTION"
->PrintQuality</SPAN
->.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-sSubdevice=<TT
-CLASS="REPLACEABLE"
-><I
->subdevice</I
-></TT
-></B
-></TT
-></DT
-><DD
-><P
->This option identifies the printer model for which the generated file is
-intended.
-The following names (mostly of Hewlett-Packard DeskJet printers)
-are accepted for <TT
-CLASS="REPLACEABLE"
-><I
->subdevice</I
-></TT
->:</P
-><BLOCKQUOTE
-><P
-><TT
-CLASS="USERINPUT"
-><B
->hpdj</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdjplus</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdjportable</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj310</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj320</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj340</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj400</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj500</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj500c</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj510</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj520</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj540</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj550c</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj560c</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->unspecold</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj600</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj660c</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj670c</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj680c</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj690c</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj850c</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj855c</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj870c</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj890c</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj1120c</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->unspec</B
-></TT
->.</P
-></BLOCKQUOTE
-><P
->The correspondence with the real printer name is, I hope, obvious.
-Note that <TT
-CLASS="USERINPUT"
-><B
->hpdj</B
-></TT
-> does not select the
-<B
-CLASS="COMMAND"
->hpdj</B
-> driver (this driver's predecessor)
-but configures the <B
-CLASS="COMMAND"
->pcl3</B
-> driver
-for the "classical" HP DeskJet.</P
-><P
->With the exception of <TT
-CLASS="USERINPUT"
-><B
->hpdj</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->unspec</B
-></TT
-> and <TT
-CLASS="USERINPUT"
-><B
->unspecold</B
-></TT
->,
-your <B
-CLASS="COMMAND"
->gs</B
-> binary might support the subdevice names also
-as device names,
-i.e., instead of specifying
-<TT
-CLASS="USERINPUT"
-><B
->-sDEVICE=pcl3
--sSubdevice=<TT
-CLASS="REPLACEABLE"
-><I
->subdevice</I
-></TT
-></B
-></TT
->
-you might be able to write
-<TT
-CLASS="USERINPUT"
-><B
->-sDEVICE=<TT
-CLASS="REPLACEABLE"
-><I
->subdevice</I
-></TT
-></B
-></TT
->.
-Check ghostscript's list of available devices to find out whether this is the
-case (<TT
-CLASS="USERINPUT"
-><B
->gs -h</B
-></TT
->).</P
-><P
->The choice of subdevice primarily determines which resolutions, colour models,
-intensity levels and media sizes the driver will accept,
-where the output will appear on the page,
-and to some extent what PCL code the driver will generate.
-Several of the subdevices are treated identically.</P
-><P
->The default subdevice is <TT
-CLASS="USERINPUT"
-><B
->unspec</B
-></TT
->.
-It is intended for new PCL-3+ printers not explicitly supported by this driver.
-For <TT
-CLASS="USERINPUT"
-><B
->unspec</B
-></TT
->,
-all subdevice-specific checks (e.g., supported resolutions)
-are turned off.
-Supported media sizes and margin settings are assumed to be identical with
-those for the DeskJets 850C/855C/870C/890C,
-but you can and should use the <SPAN
-CLASS="OPTION"
->MediaConfigurationFile</SPAN
->
-option or its compile-time equivalent to override this.
-The PCL code generated assumes a new DeskJet in the sense that it should be
-at least of the level of a DeskJet 540 supporting the PCL commands Media Type
-and Print Quality.
-If you specify unequal horizontal and vertical resolutions or
-more than two levels of intensity per colorant and pixel,
-the printer must in addition understand the Configure Raster Data command.</P
-><P
->The subdevice <TT
-CLASS="USERINPUT"
-><B
->unspecold</B
-></TT
-> is similar but behaves like
-a DeskJet 560C.
-It supports all colour models and all uniform resolutions
-(the horizontal resolution is equal to the vertical resolution).</P
-><P
->If you choose to use <TT
-CLASS="USERINPUT"
-><B
->unspec</B
-></TT
-> or
-<TT
-CLASS="USERINPUT"
-><B
->unspecold</B
-></TT
->
-it is your responsibility to ensure that <B
-CLASS="COMMAND"
->pcl3</B
->
-is only called with parameter values the printer can handle.
-This applies in particular to the resolution and the intensity levels.</P
-><P
->If you set this parameter from a PostScript document you must know that
-doing this re-initializes most of the <B
-CLASS="COMMAND"
->pcl3</B
-> parameters
-to their default values.
-If you set several page device parameters in a single
-<TT
-CLASS="LITERAL"
->setpagedevice</TT
-> call
-the <SPAN
-CLASS="OPTION"
->Subdevice</SPAN
-> option will be treated first.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-dTumble[<SPAN
-CLASS="OPTIONAL"
->=<TT
-CLASS="REPLACEABLE"
-><I
->boolean</I
-></TT
-></SPAN
->]</B
-></TT
-></DT
-><DD
-><P
->When duplex printing is requested (<TT
-CLASS="USERINPUT"
-><B
->-dDuplex</B
-></TT
->),
-this parameter specifies whether the y axes of PostScript's default user space
-on the two sides of the sheet (assumed to use the same page size) point to the
-same edge or to opposite edges.
-The default value <TT
-CLASS="USERINPUT"
-><B
->false</B
-></TT
-> indicates the same edge and
-is usually suitable for binding on the left while
-<TT
-CLASS="USERINPUT"
-><B
->true</B
-></TT
-> indicates opposite edges and should be used for
-binding at the top.</P
-><P
->You should note that the interpretation of <SPAN
-CLASS="OPTION"
->Tumble</SPAN
-> refers to
-default user space:
-if a PostScript program has rotated the user space coordinate system
-the association between the page's apparent "up" direction and the binding edge
-will usually not be the one desired.
-You should watch for this in particular when creating output
-in landscape orientation from an application still generating
-PostScript Level 1 code.
-If a ghostscript screen driver like <B
-CLASS="COMMAND"
->x11</B
-> displays the pages
-with the right side up you should have nothing to worry about,
-even in the case of landscape orientation.
-(You must call <B
-CLASS="COMMAND"
->gs</B
-> directly for this test,
-not via <B
-CLASS="COMMAND"
->ghostview</B
->.)
-If the orientation between the two sides turns out to be wrong,
-you will have to print again with the opposite value for
-<SPAN
-CLASS="OPTION"
->Tumble</SPAN
->.
-If that does not help and you have a printer supporting only one of the two
-possible duplex orientations,
-check the relative order of <TT
-CLASS="LITERAL"
->restore</TT
-> and
-<TT
-CLASS="LITERAL"
->showpage</TT
-> in the document you printed
-(see the <SPAN
-CLASS="OPTION"
->DuplexCapability</SPAN
-> option above).</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->-dUseCard[<SPAN
-CLASS="OPTIONAL"
->=<TT
-CLASS="REPLACEABLE"
-><I
->value</I
-></TT
-></SPAN
->]</B
-></TT
-></DT
-><DD
-><P
->This option should only be given when printing on A6 and with a printer like the
-HP DeskJet 1120C which distinguishes between A6 sheets and A6 postcards.
-The option can be used to specifically request one of the alternatives.
-The default <TT
-CLASS="REPLACEABLE"
-><I
->value</I
-></TT
-> is <TT
-CLASS="USERINPUT"
-><B
->null</B
-></TT
->
-and means that sheets are preferred to postcards,
-but either is acceptable if supported.
-The other permitted values are
-<TT
-CLASS="USERINPUT"
-><B
->true</B
-></TT
-> and <TT
-CLASS="USERINPUT"
-><B
->false</B
-></TT
->.</P
-><P
->This option applies to all page sizes set while ghostscript
-executes and this includes the default size set at startup.
-If you wish to use <TT
-CLASS="USERINPUT"
-><B
->-dUseCard=true</B
-></TT
-> you will
-therefore usually have to specify the <SPAN
-CLASS="OPTION"
->PAPERSIZE</SPAN
-> option in the
-call,
-otherwise an error will occur because there is no postcard variant for the
-usual default sizes (ISO A4 and US Letter).</P
-></DD
-></DL
-></DIV
-><DIV
-CLASS="REFSECT2"
-><H3
->Option Combinations for Hardware Parameters</H3
-><P
->Not all combinations of colour model, resolution, number of intensity levels,
-print quality and media type are accepted or make sense.
-Unfortunately, Hewlett-Packard does not publicly release sufficient information
-to find the best possible combinations.
-A good way to find reasonable settings is to use <B
-CLASS="COMMAND"
->pcl3opts</B
->
-on files generated by an official driver for the printer.
-You should also check the file <TT
-CLASS="FILENAME"
->reports.txt</TT
-> in the
-<B
-CLASS="COMMAND"
->pcl3</B
-> distribution.
-In addition, I'll provide some remarks here.</P
-><P
->As a general rule,
-it is unprofitable to use a finer resolution than 300 ppi or more than
-2 intensity levels for draft quality.
-A coarser resolution in particular can reduce the time needed to generate
-and transmit the file to the printer.
-Combined with draft quality this leads to what HP calls an "EconoFast" mode.</P
-><P
->As an exception, here are recommendations based on official HP documentation
-for the DeskJet 1120C.
-The table lists the resolution and the number of black or black and CMY levels
-if not 2.
-<BLOCKQUOTE
-><DIV
-CLASS="INFORMALTABLE"
-><P
-></P
-><TABLE
-BORDER="1"
-CLASS="CALSTABLE"
-><TR
-><TH
-ALIGN="LEFT"
-VALIGN="TOP"
->Quality</TH
-><TH
-ALIGN="LEFT"
-VALIGN="TOP"
->Gray</TH
-><TH
-ALIGN="LEFT"
-VALIGN="TOP"
->CMYK</TH
-></TR
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->draft</TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->300 ppi</TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->300 ppi</TD
-></TR
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->normal</TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->300 ppi, 4 levels</TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->300 ppi, (4,3) levels</TD
-></TR
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->presentation</TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->600 ppi</TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->300 ppi, (4,4) levels</TD
-></TR
-></TABLE
-><P
-></P
-></DIV
-></BLOCKQUOTE
->
-
-These seem reasonable values for the supported series-800 DeskJets as well.</P
-></DIV
-><DIV
-CLASS="REFSECT2"
-><H3
->Checking Page Device Parameters</H3
-><P
->As for all ghostscript drivers,
-<B
-CLASS="COMMAND"
->pcl3</B
->'s command line options correspond to identically-named
-PostScript page device parameters
-and are accessible in the usual way.
-In particular,
-it is possible to read the value of a parameter
-by letting <B
-CLASS="COMMAND"
->gs</B
-> execute a command like
-<BLOCKQUOTE
-><PRE
-CLASS="PROGRAMLISTING"
->currentpagedevice /<TT
-CLASS="REPLACEABLE"
-><I
->parameter</I
-></TT
-> get ==</PRE
-></BLOCKQUOTE
->
-where <TT
-CLASS="REPLACEABLE"
-><I
->parameter</I
-></TT
-> is the name of the parameter one
-would like to inspect,
-for example <TT
-CLASS="USERINPUT"
-><B
->BlackLevels</B
-></TT
->.
-This is useful if you are in doubt whether the driver has accepted your options.
-Of course, for printer-visible parameters you can also use
-<B
-CLASS="COMMAND"
->pcl3opts</B
-> on the output file.</P
-><P
->The ghostscript distribution contains a program <TT
-CLASS="FILENAME"
->uninfo.ps</TT
->
-which displays the page device dictionary on standard output
-but does not resolve nested dictionaries.
-The <B
-CLASS="COMMAND"
->pcl3</B
-> distribution contains a similar program
-<TT
-CLASS="FILENAME"
->dumppdd.ps</TT
-> which does not have this limitation.</P
-></DIV
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A NAME="CONFIGURATION"
-><H2
->CONFIGURATION</H2
-></A
-><DIV
-CLASS="REFSECT2"
-><H3
->Media Configuration File</H3
-><P
->A <I
-CLASS="FIRSTTERM"
->media configuration file</I
->
-(<I
-CLASS="FIRSTTERM"
->media file</I
-> for short) can be used to override the
-builtin subdevice-specific lists of supported media sizes
-and, for each size, the sheet orientation in the input tray
-and the margins enforced by the printer.
-This feature is mainly intended to be used in conjunction with
-<TT
-CLASS="USERINPUT"
-><B
->unspec</B
-></TT
-> and <TT
-CLASS="USERINPUT"
-><B
->unspecold</B
-></TT
->:
-if you have a model not directly supported by this driver, look up the
-supported media sizes,
-the rules for inserting media
-and the corresponding printable regions in your printer's
-manual and enter them in a media file.</P
-><TABLE
-CLASS="CAUTION"
-BORDER="1"
-WIDTH="100%"
-><TR
-><TD
-ALIGN="CENTER"
-><B
->CAUTION</B
-></TD
-></TR
-><TR
-><TD
-ALIGN="LEFT"
-><P
->Entering a media size in the file which is not really supported by your
-printer is not useful:
-the PCL interpreter will simply ignore the request to set this size,
-and printer and driver may have diverging opinions about what the margins
-will be.
-If you need to print on a medium of a size not supported by your printer,
-choose a larger and printer-supported size in PostScript or via
-<SPAN
-CLASS="OPTION"
->FIXEDMEDIA</SPAN
->,
-shift the image if necessary,
-establish properly-positioned clipping regions within the real size, and print.
-Or you could use a suitable page size recovery policy for PostScript's
-media selection process.
-However, if you have a newer DeskJet supporting custom page sizes,
-all this is not necessary.</P
-></TD
-></TR
-></TABLE
-><P
->Margin specifications are important for two reasons:
-the values for the left and top margins determine how the output is positioned
-on the page,
-and sufficiently large values for the right and bottom margins prevent the
-print head being caught at the paper's edge and printing beyond the sheet,
-respectively.
-Because DeskJet printers usually have an inconveniently large bottom margin
-(usually 0.4-0.8 inches or 10-20 mm),
-one might be tempted to specify smaller values than listed in the
-printer's manual.
-However, one user reported that this led to the printer depositing a large wet
-blob of black ink at the bottom of the page.</P
-><P
->A line in the media file can be blank, a comment line (first non-blank
-character is '<TT
-CLASS="USERINPUT"
-><B
->#</B
-></TT
->'), or one of the following:</P
-><BLOCKQUOTE
-><DIV
-CLASS="INFORMALTABLE"
-><P
-></P
-><TABLE
-BORDER="0"
-CLASS="CALSTABLE"
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->unit</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="REPLACEABLE"
-><I
->unit</I
-></TT
-></TD
-></TR
-><TR
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="REPLACEABLE"
-><I
->size</I
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
-><TT
-CLASS="REPLACEABLE"
-><I
->left</I
-></TT
-> <TT
-CLASS="REPLACEABLE"
-><I
->bottom</I
-></TT
-> <TT
-CLASS="REPLACEABLE"
-><I
->right</I
-></TT
-> <TT
-CLASS="REPLACEABLE"
-><I
->top</I
-></TT
-></TD
-></TR
-></TABLE
-><P
-></P
-></DIV
-></BLOCKQUOTE
-><P
->A <TT
-CLASS="USERINPUT"
-><B
->unit</B
-></TT
-> line specifies in which units
-margin specifications in the following lines should be interpreted.
-<TT
-CLASS="REPLACEABLE"
-><I
->unit</I
-></TT
->
-can either be <TT
-CLASS="USERINPUT"
-><B
->in</B
-></TT
-> (inch) or
-<TT
-CLASS="USERINPUT"
-><B
->mm</B
-></TT
-> (millimetre)
-with <TT
-CLASS="USERINPUT"
-><B
->in</B
-></TT
-> being the default.
-A unit specification remains in force until overridden by a following
-<TT
-CLASS="USERINPUT"
-><B
->unit</B
-></TT
-> line.</P
-><P
->The second kind of line states that the model supports a particular
-media configuration and specifies the hardware margins in force for that case.
-The <TT
-CLASS="REPLACEABLE"
-><I
->size</I
-></TT
-> word consists of two parts:
-a keyword denoting the extension and an optional suffix.
-The following keywords are accepted
-(entries marked with an asterisk (*) are those used by the subdevice
-<TT
-CLASS="USERINPUT"
-><B
->unspec</B
-></TT
->
-if no media file is employed;
-entries with a section/paragraph sign (§) similarly identify the sizes
-used by <TT
-CLASS="USERINPUT"
-><B
->unspecold</B
-></TT
->):
-
-<DIV
-CLASS="INFORMALTABLE"
-><P
-></P
-><TABLE
-BORDER="1"
-CLASS="CALSTABLE"
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->Index3x5in</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->US index card 3 × 5 in</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->EnvChou4</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->Japanese long envelope #4 (90 × 205 mm)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->EnvMonarch</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->US Monarch envelope (3.875 × 7.5 in)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
->*<TT
-CLASS="USERINPUT"
-><B
->Postcard</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->Japanese Hagaki card (100 × 148 mm)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
->*<TT
-CLASS="USERINPUT"
-><B
->Index4x6in</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->US index card 4 × 6 in</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
->§*<TT
-CLASS="USERINPUT"
-><B
->Env10</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->US no. 10 envelope (4.125 × 9.5 in)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->A6</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->ISO/JIS A6 (105 × 148 mm)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
->*<TT
-CLASS="USERINPUT"
-><B
->A6Card</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->ISO/JIS A6 postcard (105 × 148 mm)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
->§*<TT
-CLASS="USERINPUT"
-><B
->EnvDL</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->ISO DL envelope (110 × 220 mm)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->EnvUS_A2</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->US A2 envelope (4.375 × 5.75 in)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
->*<TT
-CLASS="USERINPUT"
-><B
->EnvC6</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->ISO C6 envelope (114 × 162 mm)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->EnvChou3</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->Japanese long envelope #3 (120 × 235 mm)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
->*<TT
-CLASS="USERINPUT"
-><B
->Index5x8in</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->US index card 5 × 8 in</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->Statement</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->US Statement (5.5 × 8.5 in)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->DoublePostcard</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->double Postcard (148 × 200 mm)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
->*<TT
-CLASS="USERINPUT"
-><B
->A5</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->ISO/JIS A5 (148 × 210 mm)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->EnvC5</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->ISO C5 envelope (162 × 229 mm)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->ISOB5</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->ISO B5 (176 × 250 mm)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
->*<TT
-CLASS="USERINPUT"
-><B
->JISB5</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->JIS B5 (182 × 257 mm)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
->§*<TT
-CLASS="USERINPUT"
-><B
->Executive</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->US Executive (7.25 × 10.5 in)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
->§*<TT
-CLASS="USERINPUT"
-><B
->A4</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->ISO/JIS A4 (210 × 297 mm)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
->§*<TT
-CLASS="USERINPUT"
-><B
->Letter</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->US Letter (8.5 × 11 in)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
->§*<TT
-CLASS="USERINPUT"
-><B
->Legal</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->US Legal (8.5 × 14 in)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->EnvKaku2</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->Japanese Kaku envelope (240 × 332 mm)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->JISB4</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->JIS B4 (257 × 364 mm).
-This is distinct from ISO B4 (250 × 353 mm).</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->Tabloid</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->US Tabloid (11 × 17 in; in landscape orientation also called "Ledger")</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->A3</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->ISO/JIS A3 (297 × 420 mm)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
-><TT
-CLASS="USERINPUT"
-><B
->HPSuperB</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->what HP calls Super B (13 × 19 in)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
->*<TT
-CLASS="USERINPUT"
-><B
->CustomPageSize</B
-></TT
-></TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->custom page size</TD
-></TR
-></TABLE
-><P
-></P
-></DIV
->
-
-Note the difference between <TT
-CLASS="USERINPUT"
-><B
->A6</B
-></TT
-> (sheet) and
-<TT
-CLASS="USERINPUT"
-><B
->A6Card</B
-></TT
-> (postcard).
-I do not know why Hewlett-Packard associates this distinction with media size
-instead of media type.
-However, with the exception of the 1120C all DeskJet printers I know of
-use only <TT
-CLASS="USERINPUT"
-><B
->A6Card</B
-></TT
-> anyway.</P
-><P
->In looking at your printer's documentation, bear in mind that a driver might
-support more sizes than the printer accepts;
-<B
-CLASS="COMMAND"
->pcl3</B
-> needs to be given the latter values.
-If you are in doubt what your printer understands,
-<B
-CLASS="COMMAND"
->pcl3opts</B
-> can tell you which media size another driver
-requests.</P
-><P
->Custom page sizes are not understood by older printers
-and may be used in a media file only for the subdevices
-<TT
-CLASS="USERINPUT"
-><B
->hpdj540</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj6<TT
-CLASS="REPLACEABLE"
-><I
->nn</I
-></TT
->[<SPAN
-CLASS="OPTIONAL"
->c</SPAN
->]</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj8<TT
-CLASS="REPLACEABLE"
-><I
->nn</I
-></TT
->c</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj1120c</B
-></TT
->,
-and <TT
-CLASS="USERINPUT"
-><B
->unspec</B
-></TT
-> (group 3).
-In these cases you can print, within certain limits, on arbitrarily-sized media.
-The driver knows these limits and refuses to generate a file if you exceed them.
-For <TT
-CLASS="USERINPUT"
-><B
->unspec</B
-></TT
->, there are no limits.
-<B
-CLASS="COMMAND"
->pcl3</B
->
-will tell the printer to expect a custom page size
-only if there is no fitting discrete entry.</P
-><P
->Although it is possible, on those printers which support it,
-to use a media configuration file containing only a custom page size entry,
-I advise against it
-because this size specification is only intended as a last resort.
-If you have a custom page size entry in the media file,
-you should therefore list <I
-CLASS="EMPHASIS"
->all</I
-> discrete sizes supported by
-your printer or at least those which you expect to use.</P
-><P
->The size keyword in the <TT
-CLASS="REPLACEABLE"
-><I
->size</I
-></TT
-> field can be extended
-by the following strings:
-<P
-></P
-><DL
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->Big</B
-></TT
-></DT
-><DD
-><P
->For <B
-CLASS="COMMAND"
->pcl3</B
->, this suffix means banner printing.
-In these cases the top and bottom margins are usually zero.
-HP DeskJets supporting banner printing do so only for ISO A4 and US Letter.
-Your media file should then contain entries for the
-<TT
-CLASS="REPLACEABLE"
-><I
->sizes</I
-></TT
->
-<TT
-CLASS="USERINPUT"
-><B
->A4</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->A4Big</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->Letter</B
-></TT
->, and
-<TT
-CLASS="USERINPUT"
-><B
->LetterBig</B
-></TT
->.</P
-></DD
-><DT
-><TT
-CLASS="USERINPUT"
-><B
->.Transverse</B
-></TT
-></DT
-><DD
-><P
->By default,
-<B
-CLASS="COMMAND"
->pcl3</B
-> assumes that the media listed are fed short edge first.
-If you specify this qualifier,
-the driver will assume that you are going to feed media of this size
-long edge first.
-If, for example,
-your printer's manual states that envelopes of size ISO DL should be fed
-long edge first,
-the corresponding <TT
-CLASS="REPLACEABLE"
-><I
->size</I
-></TT
-> field in your media file
-should contain the string <TT
-CLASS="USERINPUT"
-><B
->EnvDL.Transverse</B
-></TT
->,
-not <TT
-CLASS="USERINPUT"
-><B
->EnvDL</B
-></TT
->.</P
-><P
->This specification (or its absence) can be overridden with the option
-<SPAN
-CLASS="OPTION"
->LeadingEdge</SPAN
-> in the call.</P
-></DD
-></DL
->
-
-The builtin lists for the <TT
-CLASS="USERINPUT"
-><B
->unspec</B
-></TT
-> and
-<TT
-CLASS="USERINPUT"
-><B
->unspecold</B
-></TT
-> devices do not contain size entries with any
-of these suffixes.</P
-><P
->Every media file must contain at least an entry which fits ghostscript's
-default page size,
-usually ISO A4 or US Letter.
-Only those sizes which are listed will be accepted by <B
-CLASS="COMMAND"
->pcl3</B
->.
-This is independent of a <TT
-CLASS="USERINPUT"
-><B
->.Transverse</B
-></TT
-> suffix.
-If there are several entries in the media file with the same
-<TT
-CLASS="REPLACEABLE"
-><I
->size</I
-></TT
-> value,
-only the first is used.</P
-><P
->The margins in a size entry should be valid for monochrome printing in
-raster graphics mode.
-If a non-monochrome colour model is selected and unless the bottom margin is
-exactly zero,
-it will be increased by a subdevice-specific amount.
-This increment is zero for <TT
-CLASS="USERINPUT"
-><B
->unspecold</B
-></TT
-> and
-<TT
-CLASS="USERINPUT"
-><B
->unspec</B
-></TT
->.</P
-><P
->The orientation of the margins refers to the feeding direction:
-you should imagine holding the sheet such that the leading edge is at the top
-and the side to be printed on is towards you.
-Be careful with envelopes:
-older (pre-1997) HP documentation usually gives the margins in landscape
-orientation
-even for those printers where the envelope has to be fed short edge first.
-You can check this by looking for the largest margin value:
-if it is on the left instead of at the bottom you almost certainly have such a
-landscape-based specification;
-rotate the values by +90 degrees (quarter-circle counterclockwise) in these
-cases.
-The margins have to be specified as non-negative floating point numbers
-in inches or millimetres
-as announced by the last preceding <TT
-CLASS="USERINPUT"
-><B
->unit</B
-></TT
-> line.
-The floating point format is that of the "C" locale.</P
-><P
-><B
-CLASS="COMMAND"
->pcl3</B
->
-is distributed with an example of a media configuration file,
-<TT
-CLASS="FILENAME"
->example.mcf</TT
->.</P
-></DIV
-><DIV
-CLASS="REFSECT2"
-><H3
->PostScript Configuration Files</H3
-><P
->Sometimes it is desirable to execute additional PostScript commands for a
-particular file or possibly all files sent to a particular printer or print
-queue.
-With ghostscript this is easily possible because <B
-CLASS="COMMAND"
->gs</B
->
-accepts several file names in the invocation and processes them sequentially.
-This is particularly appropriate for those PostScript operators which affect
-device-specific features and should therefore not appear in a portable page
-description
-and for settings which would be part
-of the interpreter's persistent state when using a real PostScript printer.</P
-><P
->The <B
-CLASS="COMMAND"
->pcl3</B
-> distribution contains examples of filters
-<TT
-CLASS="FILENAME"
->if-pcl3</TT
-> for the Berkeley spooler
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lpr</SPAN
->(1)</SPAN
->
-and <TT
-CLASS="FILENAME"
->cups-pcl3</TT
-> for the Common UNIX Printing System
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->cupsd</SPAN
->(8)</SPAN
->.
-These filters permit the use of a print-queue-specific configuration file.</P
-></DIV
-><DIV
-CLASS="REFSECT2"
-><A NAME="SOURCESANDDESTINATIONS"
-><H3
->Media Sources and Destinations</H3
-></A
-><P
->PostScript has a builtin mechanism for selecting media sources and destinations
-based on certain properties of the document.
-This usually requires a system administrator to set the
-<TT
-CLASS="LITERAL"
->InputAttributes</TT
-> and <TT
-CLASS="LITERAL"
->OutputAttributes</TT
->
-dictionaries in the device's page device dictionary according to the current
-state of the printer and its intended use.
-For example, if there are two input trays,
-one currently holding paper and the other transparencies,
-the administrator could configure the <TT
-CLASS="LITERAL"
->InputAttributes</TT
->
-dictionary such that print jobs requesting transparencies in a certain manner
-automatically fetch media from the second tray
-and every job needing a size not currently available will terminate with
-an error message.
-Unfortunately, in order to work as expected this process usually also requires
-some additional action on the part of the entity generating the PostScript code
-to be printed.</P
-><P
->If your printer is capable of sensing certain properties of media in the
-input tray (e.g., media size)
-or assumes a fixed association between media properties and input trays
-you must expect this functionality to interfere with the process referenced
-here.</P
-><P
->In the attributes dictionaries,
-each tray is identified by an integer,
-its <I
-CLASS="FIRSTTERM"
->position number</I
->.
-When ghostscript successfully matches the document's requirements with trays
-the resulting position numbers are accessible to the driver.
-The <B
-CLASS="COMMAND"
->pcl3</B
-> driver uses these numbers (except 0)
-directly as arguments
-for the PCL commands "Media Source" and "Media Destination", respectively.
-For the Media Source values (input trays), I know of the following meanings:
-
-<BLOCKQUOTE
-><DIV
-CLASS="INFORMALTABLE"
-><P
-></P
-><TABLE
-BORDER="1"
-CLASS="CALSTABLE"
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
->-1</TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->banner printing</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
->1</TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->default tray; portable CSF (DJ 340); tray 2 (HP 2500C)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
->2</TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->manual feed</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
->3</TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->envelope feed</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
->4</TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->desktop CSF (DJ 340); tray 3 (HP 2500C)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
->5</TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->tray 1 (HP 2500C)</TD
-></TR
-><TR
-><TD
-ALIGN="RIGHT"
-VALIGN="TOP"
->7</TD
-><TD
-ALIGN="LEFT"
-VALIGN="TOP"
->auto select (HP 2500C)</TD
-></TR
-></TABLE
-><P
-></P
-></DIV
-></BLOCKQUOTE
->
-
-You'll have to experiment with your printer to find out which values are
-accepted and what their interpretation is.
-In general,
-you can only expect 1 and 2 to work.
-Unrecognized values should be simply ignored by the printer
-leading to the medium being fetched from the default tray.
-To shorten the search, use <B
-CLASS="COMMAND"
->pcl3opts</B
->
-if you can in order to find out which values other drivers generate.
-Don't bother testing the value 0:
-in PCL its effect is to eject a page and, as this is not needed,
-<B
-CLASS="COMMAND"
->pcl3</B
-> uses it to mean that no particular tray should be
-selected.</P
-><P
->I do not know of any PCL-3+ printer supporting more than one output tray,
-hence the corresponding implementation is based on the speculation that such
-a feature, if made available,
-would use the same command as in PCL 5.
-Again, a value of zero is used by <B
-CLASS="COMMAND"
->pcl3</B
-> to mean
-"don't select a particular tray".</P
-><P
->Ghostscript's default configuration defines
-<TT
-CLASS="LITERAL"
->InputAttributes</TT
-> and
-<TT
-CLASS="LITERAL"
->OutputAttributes</TT
-> dictionaries with one entry each,
-having position number 0 in both cases,
-and maps all requests to these positions.
-As explained above, this configuration will lead to <B
-CLASS="COMMAND"
->pcl3</B
->
-not requesting any particular input or output tray.
-If you wish to modify this you should consult a PostScript manual,
-for example the sections 6.2.1 and 6.2.4 in the
-<I
-CLASS="CITETITLE"
->PostScript Language Reference</I
->.
-However, I'll present here three examples without explanation.
-In all cases, the PostScript code shown should be executed before the
-document to be printed.</P
-><P
->The first example is intended for situations where you always wish to select
-a specific input tray:
-<BLOCKQUOTE
-><PRE
-CLASS="PROGRAMLISTING"
->&#60;&#60;
- /InputAttributes &#60;&#60;
- 0 null
- <TT
-CLASS="REPLACEABLE"
-><I
->input</I
-></TT
-> &#60;&#60; /PageSize [6 6 524287 524287] &#62;&#62;
- &#62;&#62;
-&#62;&#62; setpagedevice</PRE
-></BLOCKQUOTE
->
-Replace <TT
-CLASS="REPLACEABLE"
-><I
->input</I
-></TT
-> with the number of the tray
-you wish to use.
-The second example does the same for the output tray:
-<BLOCKQUOTE
-><PRE
-CLASS="PROGRAMLISTING"
->&#60;&#60;
- /OutputAttributes &#60;&#60;
- 0 null
- <TT
-CLASS="REPLACEABLE"
-><I
->output</I
-></TT
-> &#60;&#60; &#62;&#62;
- &#62;&#62;
-&#62;&#62; setpagedevice</PRE
-></BLOCKQUOTE
->
-Replace <TT
-CLASS="REPLACEABLE"
-><I
->output</I
-></TT
-> with the number of the tray
-you wish to use.</P
-><P
->For the final example assume that you have one input tray,
-filled with media of a certain default size,
-and you wish all print jobs requesting another size to automatically switch
-to manual feed so you can insert these special sheets at leisure.
-In that case,
-let <B
-CLASS="COMMAND"
->gs</B
-> execute the following PostScript code:</P
-><BLOCKQUOTE
-><PRE
-CLASS="PROGRAMLISTING"
->&#60;&#60;
- /InputAttributes &#60;&#60;
- 0 &#60;&#60; /PageSize [<TT
-CLASS="REPLACEABLE"
-><I
->width</I
-></TT
-> <TT
-CLASS="REPLACEABLE"
-><I
->height</I
-></TT
->] &#62;&#62;
- 2 &#60;&#60; /PageSize [6 6 524287 524287] &#62;&#62;
- /Priority [0 2]
- &#62;&#62;
-&#62;&#62; setpagedevice</PRE
-></BLOCKQUOTE
-><P
->For <TT
-CLASS="REPLACEABLE"
-><I
->width</I
-></TT
-> and <TT
-CLASS="REPLACEABLE"
-><I
->height</I
-></TT
-> you
-must insert the actual dimensions of your default size
-in units of 1 bp ("big point", 1/72 inch, roughly 0.35 mm);
-the tolerance is 5 bp.
-In contrast to a document's page size,
-the orientation is irrelevant here.</P
-><P
->If you drop the second entry and the <TT
-CLASS="USERINPUT"
-><B
->Priority</B
-></TT
-> line
-in the last example
-you obtain a configuration where ghostscript will refuse to print any document
-not requesting the specified media size.
-If you retain the two lines and you are using the
-<TT
-CLASS="USERINPUT"
-><B
->unspecold</B
-></TT
-> or <TT
-CLASS="USERINPUT"
-><B
->unspec</B
-></TT
-> devices
-it is advisable to insert your printer's actual size bounds instead of those
-given above.
-This will protect you against printing on some sizes
-not supported by your printer.</P
-></DIV
-><DIV
-CLASS="REFSECT2"
-><H3
->Banner Printing</H3
-><P
->Some printers support printing on continuous forms,
-also called banners or z-fold media.
-Your printer's manual should tell you whether this is supported and in
-particular how to load these media.</P
-><P
->In order to print on continuous media with <B
-CLASS="COMMAND"
->pcl3</B
->,
-configure it as follows:
-<P
-></P
-><UL
-><LI
-><P
->Make sure that input position number -1 will be selected
-(see the subsection
-<A
-HREF="gs-pcl3.html#SOURCESANDDESTINATIONS"
-><I
-CLASS="CITETITLE"
->Media Sources And Destinations</I
-></A
->
-above).</P
-></LI
-><LI
-><P
->In the call to <B
-CLASS="COMMAND"
->gs</B
->,
-select a subdevice supporting the intended "<TT
-CLASS="USERINPUT"
-><B
->Big</B
-></TT
->" size.
-By default,
-only the subdevices <TT
-CLASS="USERINPUT"
-><B
->hpdj680c</B
-></TT
->,
-<TT
-CLASS="USERINPUT"
-><B
->hpdj690c</B
-></TT
-> and <TT
-CLASS="USERINPUT"
-><B
->hpdj1120c</B
-></TT
->
-support banner printing
-(<TT
-CLASS="USERINPUT"
-><B
->A4Big</B
-></TT
-> and <TT
-CLASS="USERINPUT"
-><B
->LetterBig</B
-></TT
->).</P
-></LI
-></UL
->
-Don't forget to prepare the printer as well.</P
-></DIV
-><DIV
-CLASS="REFSECT2"
-><H3
->Correcting Offsets</H3
-><P
->A media configuration file is intended to adapt
-<B
-CLASS="COMMAND"
->pcl3</B
->
-to the difference in margin settings between printer models and should usually
-contain "official" information,
-preferably taken from the model's manual.</P
-><P
->A different situation arises if a particular printer's output is not properly
-positioned on the page even if the margin information is correct for this
-model.
-PostScript defines two arrays in the page device dictionary for correcting such
-misadjustments,
-both containing two numbers describing a desired shift of the page image with
-respect to device space coordinate axes but in different units.
-The values in the `<TT
-CLASS="LITERAL"
->Margins</TT
->' array are interpreted with
-respect to a canonical default resolution,
-the newer `<TT
-CLASS="LITERAL"
->PageOffset</TT
->' array
-is taken to be in units of 1/72 inch ("big points", bp).
-For <B
-CLASS="COMMAND"
->pcl3</B
-> the device coordinate system has an
-x axis pointing to the right and a y axis pointing downwards
-when looking at the sheet with the leading edge at the top and the side to be
-printed on towards you.
-The canonical default resolution is 300 ppi.</P
-><P
->As an example, assume your printer shifts its output 1 mm to the right
-and 0.5 mm upwards.
-Now create a file containing either the PostScript code
-<BLOCKQUOTE
-><PRE
-CLASS="PROGRAMLISTING"
->&#60;&#60; /Margins [-11.8 5.9] &#62;&#62; setpagedevice</PRE
-></BLOCKQUOTE
->
-("shift 11.8 pixels to the left and 5.9 pixels down") or
-<BLOCKQUOTE
-><PRE
-CLASS="PROGRAMLISTING"
->&#60;&#60; /PageOffset [-2.8 1.4] &#62;&#62; setpagedevice</PRE
-></BLOCKQUOTE
->
-("shift 2.8 bp to the left and 1.4 bp down")
-and have it executed by ghostscript before the file to be printed.</P
-><P
->The margin test files distributed with <B
-CLASS="COMMAND"
->pcl3</B
->
-can be used to determine the necessary correction.
-You should be aware that you have to expect fluctuations between individual
-print jobs,
-in particular in the horizontal direction.</P
-></DIV
-><DIV
-CLASS="REFSECT2"
-><A NAME="TRANSFERFUNCTIONS"
-><H3
->Transfer Functions</H3
-></A
-><P
->DeskJets usually produce prints which are too dark (too much ink on the page),
-most noticeably when using more than 2 intensity levels per colorant.
-In this case you should perform
-<I
-CLASS="FIRSTTERM"
->gamma correction</I
->
-by modifying what PostScript calls <I
-CLASS="FIRSTTERM"
->transfer functions</I
->.
-In the simplest case,
-create a file containing the PostScript command</P
-><BLOCKQUOTE
-><PRE
-CLASS="PROGRAMLISTING"
->{<TT
-CLASS="REPLACEABLE"
-><I
->number</I
-></TT
-> exp} settransfer</PRE
-></BLOCKQUOTE
-><P
->where a good value for <TT
-CLASS="REPLACEABLE"
-><I
->number</I
-></TT
->
-is usually in the range 0.3-0.5,
-and specify this file in ghostscript's command line before the file you wish to
-print.
-Now the intensities of all colorants will be rescaled by exponentiation
-with <TT
-CLASS="REPLACEABLE"
-><I
->number</I
-></TT
->.
-Because PostScript intensity values are in the range zero to one
-with zero meaning dark and one meaning light (additive interpretation),
-a value of <TT
-CLASS="REPLACEABLE"
-><I
->number</I
-></TT
-> &#60; 1
-will lead to lighter colours and
-<TT
-CLASS="REPLACEABLE"
-><I
->number</I
-></TT
-> &#62; 1 results in darker colours.</P
-><P
->The best value for <TT
-CLASS="REPLACEABLE"
-><I
->number</I
-></TT
-> depends on the
-print quality,
-the number of intensity levels,
-the method chosen for intensity rendering,
-the kind of medium you print on,
-and the properties of the document to be printed.</P
-><P
->Note that there is no common convention for the interpretation of
-stand-alone gamma values.
-When dealing with other software you might for example find that the boundary
-between light and dark is at a value of 1000 and
-that lighter colours are obtained with larger values.
-In order to understand what a "gamma value" means
-you therefore need the complete specification of the transfer function and,
-if the value does not refer to PostScript,
-also information on the interpretation of intensity values.</P
-><P
->You can also set independent transfer functions for the four colorants
-by using the operator <TT
-CLASS="LITERAL"
->setcolortransfer</TT
->
-which expects four routines as arguments.
-Consult a PostScript manual if you want to learn more about transfer functions.</P
-><P
->If you are using <TT
-CLASS="USERINPUT"
-><B
->-sIntensityRendering=halftones</B
-></TT
->,
-less than 32 intensity levels per colorant,
-a resolution below 800 ppi,
-and unless you explicitly set transfer functions,
-<B
-CLASS="COMMAND"
->gs</B
-> applies a default gamma correction roughly corresponding
-to a value of 0.8 for <TT
-CLASS="REPLACEABLE"
-><I
->number</I
-></TT
->.</P
-></DIV
-></DIV
-><DIV
-CLASS="REFSECT1"
-><H2
->LIMITATIONS</H2
-><DIV
-CLASS="REFSECT2"
-><H3
->Ghostscript Version</H3
-><P
->This manual page contains statements relying on undocumented properties of
-ghostscript.
-These statements are to my best knowledge and belief correct for current
-ghostscript versions
-but I do not check all these statements for every new version.</P
-><P
->If you are in doubt about a particular point, please check it yourself.</P
-></DIV
-><DIV
-CLASS="REFSECT2"
-><H3
->Reliability</H3
-><P
->Hewlett-Packard does not publicly provide sufficiently detailed or accurate
-technical information to write a reliable driver for all of its PCL-3+ printers.
-The amount and quality of available information differs between printer models.
-As a consequence,
-<B
-CLASS="COMMAND"
->pcl3</B
-> cannot provide the same level of reliability for all
-of its devices.</P
-><P
->In my opinion the best-documented printers are those of the DeskJet-500 series.
-In addition, I have currently access to a DeskJet 850C which I have used for a
-number of experiments.
-Support for these printers should be considered to be the most reliable.</P
-><P
->The next level of reliability belongs to the remaining printers for which
-subdevices exist.
-In these cases I had at least access to official HP documentation on supported
-media sizes and associated hardware margins
-and in addition for almost all cases some information on the supported PCL
-commands,
-sometimes complemented by PCL files generated by HP's official drivers and sent
-me by users.</P
-><P
->The third level of reliability is associated with those printers for which
-people have sent success reports
-but for which I have no official information from HP.</P
-><P
->With decreasing reliability it becomes increasingly probable
-that there is printer functionality which is not accessible through
-<B
-CLASS="COMMAND"
->pcl3</B
-> or
-even that this driver generates PCL code not accepted by the printer.</P
-></DIV
-><DIV
-CLASS="REFSECT2"
-><H3
->Mixed Resolutions</H3
-><P
->Some printers are able to print with different resolutions for black and
-CMY on the same region of a page.
-For example, the best quality on a DeskJet 850C is achieved with 600 ppi for
-black and 300 ppi for CMY.
-This is not supported by <B
-CLASS="COMMAND"
->pcl3</B
->.</P
-></DIV
-><DIV
-CLASS="REFSECT2"
-><H3
->Photo Cartridges</H3
-><P
->From what I've heard, DeskJet printers with photo cartridges installed do not
-use a CMYK palette but instead one with 6 components.
-I have no official information on this interface
-and even if I had it wouldn't help because
-ghostscript does not currently support <TT
-CLASS="LITERAL"
->DeviceN</TT
-> as a
-native colour space.</P
-></DIV
-><DIV
-CLASS="REFSECT2"
-><H3
->Cartridge Alignment</H3
-><P
->DeskJet printers with more than one ink cartridge present should usually be
-configured for the proper relative alignment of these cartridges.
-Apparently, this information is stored in not-immediately-volatile memory
-in the printer together with some settings (like the default media size)
-which are not relevant for printing with <B
-CLASS="COMMAND"
->pcl3</B
->.
-As I do not have information on how this is done,
-you will need to use one of HP's programs for this purpose.</P
-><P
->On a Linux system, try installing and running HP's DOS DeskJet control panel
-<B
-CLASS="COMMAND"
->DJCP</B
-> in the DOS emulator.
-<B
-CLASS="COMMAND"
->DJCP</B
-> should be present on one of the installation media
-you received with your printer.
-One user managed to get this to work
-for a DJ 670C with DOSEMU 0.98 under RedHat 5.2 by setting
-<BLOCKQUOTE
-><PRE
-CLASS="PROGRAMLISTING"
->$_ports = "0x378 0x379"</PRE
-></BLOCKQUOTE
->
-in <TT
-CLASS="FILENAME"
->dosemu.conf</TT
->.
-I was not successful on my Debian system.</P
-><P
->The <B
-CLASS="COMMAND"
->pcl3</B
-> distribution contains a file
-<TT
-CLASS="FILENAME"
->calign.ps</TT
-> which you can print if you wish to check
-to which extent the cartridges are aligned.</P
-></DIV
-></DIV
-><DIV
-CLASS="REFSECT1"
-><H2
->KNOWN BUGS</H2
-><P
->There are no known bugs in <B
-CLASS="COMMAND"
->pcl3</B
-> proper,
-but there do exist restrictions or bugs in <B
-CLASS="COMMAND"
->gs</B
->
-which can lead to faulty behaviour when printing with <B
-CLASS="COMMAND"
->pcl3</B
->.
-As far as I noticed them
-they are mentioned in the body of this manual page at the relevant points.</P
-><P
->You can find an up-to-date bug list for this driver via
-<B
-CLASS="COMMAND"
->pcl3</B
->'s home page on the Web.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><H2
->SEE ALSO</H2
-><P
-><A HREF="Readme.htm"
-><SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->gs</SPAN
->(1)</SPAN
-></A
->,
-<A HREF="pcl3opts.html"
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->pcl3opts</SPAN
->(1)</SPAN
-></A
-></P
-><P
-><A
-HREF="http://www.cs.indiana.edu/docproject/programming/postscript/postscript.html"
-TARGET="_top"
-><I
-CLASS="CITETITLE"
->A First Guide to PostScript</I
-></A
-></P
-><P
->Adobe Systems,
-<A
-HREF="http://partners.adobe.com/asn/developer/PDFS/TN/PLRM.pdf"
-TARGET="_top"
-><I
-CLASS="CITETITLE"
->PostScript Language Reference</I
-></A
->.
-Third edition, 1999.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><H2
->AUTHOR</H2
-><P
->Copyright © 2000, 2001 by Martin Lottermoser,
-Greifswaldstraße 28, 38124 Braunschweig, Germany.
-E-mail:
-<A HREF="mailto:Martin.Lottermoser@t-online.de"><TT
-CLASS="EMAIL"
->Martin.Lottermoser@t-online.de</TT
-></A>.</P
-><P
-><B
-CLASS="COMMAND"
->pcl3</B
-> has a
-<A
-HREF="http://home.t-online.de/home/Martin.Lottermoser/pcl3.html"
-TARGET="_top"
->home page</A
-> on the Web.</P
-><P
->This is free software,
-released under the terms of the
-<A
-HREF="http://www.gnu.org/copyleft/lesser.html"
-TARGET="_top"
->GNU Lesser General Public License (LGPL)</A
->,
-Version 2.1.
-<I
-CLASS="EMPHASIS"
->USE IT AT YOUR OWN RISK.</I
-></P
-><P
->Version of this reference page: $Revision: 1.21 $
-($Date: 2001/08/18 17:19:29 $).</P
-></DIV
-></BODY
-></HTML
-> \ No newline at end of file
diff --git a/gs/contrib/pcl3/doc/gs-pcl3.ref b/gs/contrib/pcl3/doc/gs-pcl3.ref
deleted file mode 100644
index 95eb78749..000000000
--- a/gs/contrib/pcl3/doc/gs-pcl3.ref
+++ /dev/null
@@ -1,2972 +0,0 @@
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
-
-<!-- **************************************************************************
-
- Some markup conventions:
- - "ghostscript" is not usually marked up.
- - Ghostscript drivers are treated as <command>s.
- - Inline PostScript code is encapsulated by <literal>...</literal>.
- - Inline options are specified without the option prefix (-s or -d) except
- when an argument follows or (in the case of optional boolean arguments)
- could follow. In the first case they are marked as "option", in the second
- case as "userinput".
-
- Other conventions:
- - Statements which refer to undocumented properties of ghostscript are
- accompanied by a comment containing the string VERIFIED and describing
- the ghostscript version(s) in which I've checked the statement.
-
-*************************************************************************** -->
-
-<refentry id="gs-pcl3">
-
-<docinfo>
- <title>Reference page for the <application>ghostscript</application>
- device driver <command>pcl3</command></title>
- <author>
- <firstname>Martin</firstname>
- <surname>Lottermoser</surname>
- </author>
- <address>
- <street>Greifswaldstra&szlig;e 28</street>
- <postcode>38124</postcode> <city>Braunschweig</city>
- <country>Germany</country>
- <email>Martin.Lottermoser@t-online.de</email>
- </address>
- <copyright>
- <year>2000</year>
- <year>2001</year>
- <holder>Martin Lottermoser</holder>
- </copyright>
- <releaseinfo>$Id: gs-pcl3.ref,v 1.21 2001/08/18 17:19:29 Martin Rel $</releaseinfo>
-</docinfo>
-
-<!-- ********************************************************************** -->
-
-<refmeta>
- <refentrytitle>GS-PCL3</refentrytitle>
- <manvolnum>1</manvolnum>
-</refmeta>
-
-<!-- ********************************************************************** -->
-
-<refnamediv>
- <refname>pcl3</refname>
- <refpurpose>ghostscript device driver for printers <!--
- -->understanding PCL 3+</refpurpose>
-</refnamediv>
-
-<!-- ********************************************************************** -->
-
-<refsynopsisdiv>
- <!-- According to Walsh+Muellner, "DocBook - The Definitive Guide" (1.0.2),
- the title should be generated if not given. The version of Norman Walsh's
- HTML stylesheet I'm using does not do it, docbook-to-man does.
- If one specifies a title here, docbook-to-man produces two.
- Hence both packages are wrong. -->
- <cmdsynopsis>
- <command>gs</command>
- <arg choice="plain"> -sDEVICE=pcl3</arg>
- <group rep="repeat">
- <arg><replaceable>gs_option</replaceable></arg>
- <!-- The optional argument for boolean options is omitted because
- docbook-to-man does not produce good output for it. -->
- <arg>-dBlackLevels=<replaceable>integer</replaceable></arg>
- <arg>-dCMYLevels=<replaceable>integer</replaceable></arg>
- <arg>-sColorModel=<replaceable>model</replaceable></arg>
- <arg>-sColourModel=<replaceable>model</replaceable></arg>
- <arg>-dCompressionMethod=<replaceable>method</replaceable></arg>
- <arg>-dConfigureEveryPage</arg>
- <arg>-dCUPSAccounting</arg>
- <arg>-dCUPSMessages</arg>
- <arg>-dDepletion=<replaceable>depletion</replaceable></arg>
- <arg>-dDryTime=<replaceable>seconds</replaceable></arg>
- <arg>-sDuplexCapability=<replaceable>capability</replaceable></arg>
- <arg>-sIntensityRendering=<replaceable>method</replaceable></arg>
- <arg>-dLeadingEdge=<replaceable>edge</replaceable></arg>
- <arg>-dManualFeed</arg>
- <arg>-sMediaConfigurationFile=<replaceable>pathname</replaceable></arg>
- <arg>-dMediaPosition=<replaceable>position</replaceable></arg>
- <arg>-sMedium=<replaceable>medium</replaceable></arg>
- <arg>-dOnlyCRD</arg>
- <arg>-sPageCountFile=<replaceable>pathname</replaceable></arg>
- <arg>-sPCLInit1=<replaceable>string</replaceable></arg>
- <arg>-sPCLInit2=<replaceable>string</replaceable></arg>
- <arg>-sPJLJob=<replaceable>jobname</replaceable></arg>
- <arg>-sPJLLanguage=<replaceable>language</replaceable></arg>
- <arg>-sPrintQuality=<replaceable>quality</replaceable></arg>
- <arg>-dRasterGraphicsQuality=<replaceable>quality</replaceable></arg>
- <arg>-dSendBlackLast</arg>
- <arg>-dSendNULs=<replaceable>number</replaceable></arg>
- <arg>-dShingling=<replaceable>shingling</replaceable></arg>
- <arg>-sSubdevice=<replaceable>subdevice</replaceable></arg>
- <arg>-dTumble</arg>
- <arg>-dUseCard=<replaceable>value</replaceable></arg>
- </group>
- <arg rep="repeat"><replaceable>file</replaceable></arg>
- <!-- Actually, gs does not follow the XPG Utility Syntax Guidelines and
- you can not only mix options and files but there are also multi-token
- options. -->
- </cmdsynopsis>
-</refsynopsisdiv>
-
-<!-- ********************************************************************** -->
-
-<refsect1 id="DESCRIPTION"><title id="DESCRIPTIONtitle">DESCRIPTION</title>
-
-<refsect2><title>Supported Printers</title>
-<para>
-The ghostscript device driver <command>pcl3</command>
-(formerly called <command>hpdj</command>)
-is a ghostscript backend for printers understanding
-Hewlett-Packard's Printer Command Language, level 3+
-("PCL 3+", also called "PCL 3 Plus").
-The driver is intended to support in particular the following printer models:
-<blockquote><literallayout><!-- This is a hack to get a compact list.
--->HP DeskJet
-HP DeskJet Plus
-HP DeskJet Portable
-HP DeskJet 310
-HP DeskJet 320
-HP DeskJet 340
-HP DeskJet 400
-HP DeskJet 500
-HP DeskJet 500C
-HP DeskJet 510
-HP DeskJet 520
-HP DeskJet 540
-HP DeskJet 550C
-HP DeskJet 560C
-HP DeskJet 600
-HP DeskJet 660C
-HP DeskJet 670C
-HP DeskJet 680C
-HP DeskJet 690C
-HP DeskJet 850C
-HP DeskJet 855C
-HP DeskJet 870C
-HP DeskJet 890C
-HP DeskJet 1120C
-<!-- A total of 24 printer models. --></literallayout></blockquote>
-
-The PCL dialect called "PCL Level 3 enhanced" is apparently a not
-entirely compatible modification of PCL 3+.
-This driver should basically work with such printers
-but you must be more careful which options you select and
-you might not be able to exploit all your printer's capabilities.
-</para>
-
-<para>
-The driver does <emphasis>not</emphasis> support printers understanding only
-Hewlett-Packard's PPA (Printing Performance Architecture) commands.
-If a printer's documentation does not say anything about its
-printer command language and
-you find a statement like "... is designed for Microsoft Windows" or
-"DOS support through Windows only",
-the printer is almost certainly a PPA printer and hence is intended
-<emphasis>exclusively</emphasis>
-for systems running Microsoft Windows.
-(These printers are also erroneously known as "GDI printers"
-because they are intended to be accessed through a manufacturer-supplied driver
-via Windows' GDI interface.)
-There exist ways of using a PPA printer with ghostscript,
-but not through <command>pcl3</command>.
-</para>
-
-<para>
-Different printer models usually implement model-specific subsets of all
-PCL-3+ commands or arguments to commands.
-You must therefore tell the driver by means of the
-<option>Subdevice</option>
-option for which model the generated PCL code is intended.
-The model-dependent difference in the generated code is not great.
-Apart from media specifications, resolutions and colour capabilities,
-one can consider three groups of models
-which are treated with significant differences:
-
-<blockquote><variablelist>
-<varlistentry>
-<term>Group 1</term>
-<listitem><para>DeskJet, DeskJet Plus, DeskJet 500</para></listitem>
-</varlistentry>
-<varlistentry>
-<term>Group 2</term>
-<listitem><para>DeskJet Portable, DeskJets 3<replaceable>xx</replaceable>,
-400, 5<replaceable>xx</replaceable> except 500 and 540,
-</para></listitem>
-</varlistentry>
-<varlistentry>
-<term>Group 3</term>
-<listitem><para>DeskJets 540, 6<replaceable>xx</replaceable>,
-8<replaceable>xx</replaceable> and 1120C.</para></listitem>
-</varlistentry>
-</variablelist>
-</blockquote>
-
-The first two groups I call the "old Deskjets",
-the third group consists of "new DeskJets".
-If you have a PCL-3 printer not appearing in the list above,
-the likelihood is still good that it will accept the files generated by
-<command>pcl3</command>.
-You can specify one of the supported subdevices in these cases
-(it is sufficient to try one each from the groups just mentioned),
-or use the special subdevice names
-<userinput>unspecold</userinput> or <userinput>unspec</userinput>
-which are treated like members of the second and the third group above,
-respectively,
-with all subdevice-dependent checks having been turned off.
-</para>
-
-<para>
-The list of printer models for which this driver is currently known to work is:
-</para>
-<para>
-<!-- I don't know how to achieve a compact list. -->
-<blockquote><literallayout>
-HP 2000C
-HP 2500CM
-HP DeskJet 697C
-HP DeskJet 850C
-HP DeskJet 970C
-HP DeskJet 1100C
-Xerox DocuPrint M750
-</literallayout></blockquote>
-</para>
-<para>
-Details can be found in the file <filename>reports.txt</filename> in the
-<command>pcl3</command> distribution;
-its latest version is available via <command>pcl3</command>'s
-<ulink url="http://home.t-online.de/home/Martin.Lottermoser/pcl3.html">home
-page</ulink>.
-If you wish to report on the hardware compatibility for a particular
-printer model,
-please read the file <filename>how-to-report.txt</filename>.
-</para>
-
-<para>
-Omitting models already mentioned,
-previous (<command>hpdj</command>) versions of this driver were reported to
-work with the following printers:
-</para>
-<para>
-<!-- Should be a compact list. -->
-<blockquote><literallayout>
-HP DeskJet 340
-HP DeskJet 400 (tested for Gray only)
-HP DeskJet 420
-HP DeskJet 500
-HP DeskJet 500C (tested for Gray only)
-HP DeskJet 520
-HP DeskJet 540
-HP DeskJet 560C
-HP DeskJet 600
-HP DeskJet 610C
-HP DeskJet 612C <!-- 2000-07-06 R. Thavas -->
-HP DeskJet 640C <!-- 2000-10-02 Filip Stanek -->
-HP DeskJet 660C/660Cse
-HP DeskJet 670C
-HP DeskJet 672C
-HP DeskJet 680C
-HP DeskJet 690C
-HP DeskJet 690C+
-HP DeskJet 693C
-HP DeskJet 694C
-HP DeskJet 832C
-HP DeskJet 855C
-HP DeskJet 870Cse/870Cxi
-HP DeskJet 880C
-HP DeskJet 890C
-HP DeskJet 895Cse/895Cxi
-HP DeskJet 932C <!-- 2000-08-19 David Murdoch -->
-HP DeskJet 1120C
-HP OfficeJet 350 <!-- 2000-08-09 Chris BeHanna -->
-HP OfficeJet 590
-HP OfficeJet 600
-HP OfficeJet 625
-HP OfficeJet G55 <!-- 2000-10-27 Harald Schmid -->
-HP OfficeJet T45 <!-- 2000-09-02 Peter Henning -->
-Lexmark 3000 Color Jetprinter
-Olivetti JP792 (see the option <option>SendBlackLast</option>)
-</literallayout></blockquote>
-</para>
-
-<para>
-Most of the people who sent me reports did not state to which extent
-<command>hpdj</command> worked for their printer model.
-</para>
-</refsect2>
-
-<!--========================================================================-->
-
-<refsect2 id="ColourModels"><title>Colour Models</title>
-
-<para>
-Ignoring photo cartridges which are not supported by <command>pcl3</command>,
-DeskJet printers can be classified in four categories:
-</para>
-<itemizedlist>
-<listitem><para>The printer has only a black ink cartridge.</para></listitem>
-<listitem><para>The printer can print with either a black or a
-cyan/magenta/yellow (CMY) cartridge.</para></listitem>
-<listitem><para>The printer holds a CMY and a black cartridge simultaneously,
-but the two groups of inks are chemically incompatible and should not be
-overlayed.
-(Don't worry: the printer is not going to explode if they do.
-You merely get poorer results because the black ink will spread further
-than it should.
-This is called "ink bleeding".)</para></listitem>
-<listitem><para>The printer holds a CMY and a black cartridge simultaneously
-and the inks can be mixed.
-(Newer HP DeskJets use such bleed-proof inks.)</para></listitem>
-</itemizedlist>
-<para>
-This leads to four <firstterm>(process) colour models</firstterm>
-for the driver:
-<blockquote><variablelist>
-<varlistentry>
-<term>Gray</term>
-<listitem><para>Print in black only.</para></listitem>
-</varlistentry>
-<varlistentry>
-<term>CMY</term>
-<listitem><para>Print with cyan, magenta and yellow.
-In this mode, "composite black" consisting of all three inks is used to
-stand in for true black.</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term>CMY+K</term>
-<listitem><para>
-Print with all four inks, but never mix black with one of the others.
-</para></listitem>
-</varlistentry>
-<varlistentry>
-<term>CMYK</term>
-<listitem><para>Print with all four inks.</para></listitem>
-</varlistentry>
-</variablelist></blockquote>
-
-As a printer with both, a black and a CMY cartridge, can usually also print,
-e.g., with black only,
-the printer's "cartridge state" merely identifies one of these models as the
-maximal one.
-Depending on the category of the printer,
-the driver will therefore accept one or more models.
-The possibilities are:
-<blockquote><informaltable><tgroup cols="2">
-<thead>
- <row rowsep="1"><entry>DeskJet Model</entry><entry>Colour Models</entry></row>
- <!-- Rule missing here. -->
-</thead>
-<tbody>
- <row><entry>DeskJet, DeskJet Plus, DeskJet Portable, 500, 510, 520</entry>
- <entry>Gray</entry></row>
- <row><entry>310, 320, 340, 400, 500C, 540, 600</entry>
- <entry>Gray, CMY</entry></row>
- <row><entry>550C, 560C</entry><entry>Gray, CMY, CMY+K</entry></row>
- <row><entry>660C, 670C, 680C, 690C, 850C, 855C, 870C, 890C, 1120C</entry>
- <entry>all</entry></row>
-</tbody>
-</tgroup></informaltable></blockquote>
-
-The subdevices <userinput>unspecold</userinput> and
-<userinput>unspec</userinput> also permit all colour models.
-A printer capable only of CMY might accept CMY+K or CMYK data,
-remapping them to CMY,
-and a printer capable of CMY+K might remap CMY data to CMY+K.
-</para>
-
-<para>
-The colour model CMY+K is not useful if you have a CMYK printer.
-In contrast,
-if you have a CMY+K or CMYK printer and the two cartridges support different
-resolutions,
-the colour models Gray or CMY become interesting as well.
-In most of these cases
-the black cartridge can print at a higher resolution than the CMY cartridge,
-although the converse does also occur.
-In addition, ghostscript is generally fastest for Gray.
-</para>
-
-<para>
-PCL&nbsp;3+ also supports the colour model RGB
-although Hewlett-Packard discourages its use.
-For this model the printer internally converts the RGB data it receives into
-CMY data for printing.
-Note that not everything which can be demanded when using a CMY palette
-in PCL&nbsp;3+ is also permitted when using RGB.
-Because of its limited usefulness,
-<command>pcl3</command> accepts the colour model RGB only for the subdevices
-<userinput>unspecold</userinput> and <userinput>unspec</userinput>.
-</para>
-
-</refsect2>
-
-<!--========================================================================-->
-
-<refsect2 id="sizesAndOrientations"><title>Media Sizes and Orientations</title>
-
-<para>
-A PostScript document describes its visible content with respect to
-a coordinate system called <firstterm>default user space</firstterm>.
-Almost all PostScript devices are <firstterm>page devices</firstterm> which
-paint only a restricted rectangular area in default user space.
-Part of the state of a page device is therefore the current
-<firstterm>page size</firstterm>,
-two numbers specifying the width and height of the sheet to be printed on.
-These values must be interpreted from default user space,
-hence the page size not only describes the
-"sheet size" (extension irrespective of orientation) but also the
-orientation between page contents and sheet
-(portrait if width &le; height, landscape otherwise).
-The page size is requested by the user or the document,
-and it is one of the jobs of the device to satisfy this request.
-</para>
-
-<para>
-Ghostscript looks at several sources to determine the page size:
-</para>
-<itemizedlist>
-<listitem><para>the default size configured for <command>gs</command>
-(usually US Letter or ISO A4 in portrait orientation),
-</para>
-</listitem>
-<listitem><para>the value given to the option <option>PAPERSIZE</option> in the
-invocation,</para>
-</listitem>
-<listitem><para>the size requested by the document, unless you specify
-<userinput>-dFIXEDMEDIA</userinput>.</para>
-</listitem>
-</itemizedlist>
-<para>
-The last applicable item in this list overrides the others,
-hence the current page size can change at runtime.
-</para>
-
-<para>
-The <command>pcl3</command> driver splits the page size into sheet size and
-page orientation and passes the sheet size to the printer.
-This works only if the printer accepts this size
-(accepted sizes are listed in your printer's manual).
-For the explicitly supported printers,
-the driver knows which sizes are accepted
-and will refuse to print if an unsupported one is requested.
-(If you suspect that <command>pcl3</command> is in error concerning what is
-supported,
-check the list of supported sizes in the PPD file for the subdevice you are
-using.)
-Group-3 printers also accept a <firstterm>custom page size</firstterm> command
-which permits printing on arbitrarily-sized media
-but only within certain limits which are also known to the driver.
-Unlike the sheet size the page orientation is irrelevant for deciding whether
-a particular page size is supported or not.
-The driver will adapt itself as required by the
-PostScript language and rotate the output if necessary.
-(I know of only one other ghostscript driver capable of this.)
-<!-- The clj driver. -->
-</para>
-
-<para>
-In setting up the PostScript default user space,
-<command>pcl3</command>
-does not treat envelope sizes differently from other sizes.
-</para>
-<!--
- The Adobe PostScript 3 Version 3010 and 3011 Product Supplement states
- (section 2.3, this is repeated from earlier versions of the Supplement) that
- for envelopes in portrait orientation the default user space origin should be
- in the corner opposite to the return address and not located on an edge where
- the flap is. For landscape orientation, the correct rotation of default user
- space is then -90 degrees ("seascape") instead of the usual +90 degrees
- used by setpagedevice. This implies that the generating program must treat
- envelopes different from other media of the same size! I find this
- unacceptable (and I could find stronger words than that).
- In addition, at least on a DJ 850C the way in which one should insert
- envelopes according to HP (flap on the right) leads to the expected result
- if one uses the +90 degrees rotation.
--->
-
-<para>
-The subdevice <userinput>unspecold</userinput> accepts all sizes supported by
-the HP DeskJet 560C,
-<userinput>unspec</userinput> supports all discrete sizes known to the
-HP DeskJets 850C/855C/870C/890C and
-treats in addition every other size request as a custom page size
-without imposing any limits.
-If using any of these two subdevices you should change the list of supported
-sizes to fit your printer's capabilities;
-see the
-<link linkend="CONFIGURATION"><citetitle>CONFIGURATION</citetitle></link>
-section below for details.
-</para>
-
-<para>
-In order for a document to be printed correctly
-a sheet of appropriate size must be provided and the driver must know
-what its orientation with respect to the printing mechanism is.
-The latter is usually specified by reference to the feeding direction as
-"short edge first" or "long edge first".
-Don't confuse this kind of orientation with the portrait/landscape
-orientation:
-the former ("sheet orientation") refers to the orientation of the sheet
-with respect to the feeding direction,
-the latter ("page orientation") describes the orientation of the sheet with
-respect to the page contents (default user space).
-These orientations are logically independent:
-people inserting paper into the printer need to know about the first,
-people composing documents only care about the latter.
-</para>
-
-<para>
-Because <command>pcl3</command>
-has no information about the actual dimension or orientation of the medium
-in the input tray,
-you must ensure yourself that this is appropriate.
-By default, the driver assumes the dimension to be that requested via the
-page size,
-but you can override this assumption with an <literal>InputAttributes</literal>
-definition (see the
-<link linkend="sourcesAndDestinations"><citetitle>Media Sources and Destinations</citetitle></link>
-subsection in the <citetitle>CONFIGURATION</citetitle> section below).
-</para>
-
-<para>
-There is no command in PCL&nbsp;3+ to tell the printer about the
-sheet's orientation in the input tray,
-therefore it cannot be chosen and the manufacturer must prescribe it.
-I am not aware of any precise and complete statement from Hewlett-Packard
-about what is required in this respect,
-hence you should check your printer's manual whether the assumptions made by
-<command>pcl3</command> are correct or not:
-the driver assumes that media are always fed short edge first except when
-using the subdevices
-<userinput>hpdj</userinput>,
-<userinput>hpdjplus</userinput>,
-<userinput>hpdj400</userinput>,
-<userinput>hpdj500</userinput>
-or
-<userinput>hpdj500c</userinput>
-for printing on envelope sizes
-(US no. 10 and ISO DL).
-In these cases you should insert the medium long edge first.
-<!--
- Actually, this description is not entirely correct. The real assumption
- made by pcl3 is that if any PCL Page Size command is followed by a
- PCL Page Orientation command denoting "portrait", the first raster line
- sent is printed closest to and parallel with a short edge except in the
- cases mentioned in the text. The driver does not care how media are put
- into the input tray, but the medium's orientation with respect to the
- printer's command interface is important (and it's not documented by HP).
-
- The two descriptions are equivalent if the printer always prints the first
- raster line closest to and parallel with the leading edge. This assumption
- seems to me safe (mostly because PCL-3+ printers usually do not have
- sufficient memory to store a full graphics page) and I do not know of any
- PCL-3 printer violating it.
--->
-If you find that <command>pcl3</command>'s default behaviour is incorrect,
-you can override it with the option <option>LeadingEdge</option>
-or a media configuration file
-(see the
-<link linkend="CONFIGURATION"><citetitle>CONFIGURATION</citetitle></link>
-section below).
-</para>
-
-</refsect2>
-
-<!--========================================================================-->
-
-<refsect2><title>Print Quality and Media Properties</title>
-
-<para>
-With the introduction of the DeskJet 540, HP added two new PCL commands to the
-language: "Print Quality" and "Media Type".
-For older DeskJets (groups 1 and 2), similar effects can be
-achieved by specifying some technical aspects of the printing process in detail.
-</para>
-
-<para>
-You can use the <option>PrintQuality</option> and
-<option>Medium</option> options to adapt the driver to the desired
-output quality and those properties of the medium it must know about,
-independent of which kind of subdevice you select.
-If it corresponds to a printer understanding the new commands,
-the option values are passed through to the printer,
-otherwise these specifications are
-mapped to the older Depletion, Shingling, and Raster Graphics Quality commands
-based on recommendations from HP.
-<!-- See TRG, page 6-34. -->
-If you are not satisfied with the result in the latter case,
-use the options <option>Depletion</option>,
-<option>Shingling</option> and
-<option>RasterGraphicsQuality</option>
-to explicitly set these values.
-</para>
-
-</refsect2>
-
-<!--========================================================================-->
-
-<refsect2><title>Diagnostic Messages</title>
-
-<para>
-Error messages issued by this driver start with
-"<computeroutput>? <replaceable>component</replaceable>:</computeroutput>"
-and warnings with
-"<computeroutput>?-W <replaceable>component</replaceable>:</computeroutput>".
-The <replaceable>component</replaceable> can be
-<computeroutput>eprn</computeroutput>,
-<computeroutput>pcl3</computeroutput>, or
-<computeroutput>pclgen</computeroutput>,
-corresponding to the driver's three internal layers:
-the <command>eprn</command> device extends ghostscript without knowing PCL,
-<command>pclgen</command> is a module generating PCL without being aware of
-ghostscript,
-and <command>pcl3</command> is the driver proper connecting the other two
-layers.
-</para>
-
-<para>
-All these messages are written on the standard error stream.
-</para>
-
-</refsect2>
-</refsect1>
-
-<!-- ********************************************************************** -->
-
-<refsect1 id="OPTIONS"><title>OPTIONS</title>
-
-<para>
-When specifying options for <command>gs</command> you should keep in mind
-that
-case is significant,
-that some options must be passed as strings (<userinput>-s</userinput>)
-and others as general tokens (<userinput>-d</userinput>),
-and that <command>gs</command>
-effectively ignores every option it does not recognize.
-Hence some care in spelling parameter names is necessary.
-</para>
-
-<para>
-If you are confused by the large number of options, don't worry.
-Just ignore those you don't understand and
-concentrate first on the following ones,
-given here in the order of their importance:
-<userinput>-sDEVICE</userinput>,
-<userinput>-sSubdevice</userinput>,
-<userinput>-sColourModel</userinput>,
-<userinput>-r</userinput>,
-<userinput>-sPrintQuality</userinput>,
-and
-<userinput>-sMedium</userinput>.
-You should also check whether there is an entry in the
-<filename>reports.txt</filename> file
-in the <command>pcl3</command> distribution
-listing working option combinations for your printer.
-</para>
-
-<!--========================================================================-->
-
-<refsect2><title>Standard Options</title>
-
-<para>
-When calling <command>gs</command> with the <command>pcl3</command> driver
-you can specify any option defined for ghostscript's
-<command>prn</command>
-(printer) device although some have particular meanings or restrictions.
-This includes all device-independent options described in
-<citerefentry>
- <refentrytitle>gs</refentrytitle><manvolnum>1</manvolnum>
-</citerefentry>.
-You should also look into ghostscript's extended documentation
-(file <ulink url="Use.htm"><filename>Use.htm</filename></ulink> and the section
-<ulink url="Language.htm#Device_parameters"><citetitle>Device
-parameters</citetitle></ulink>
-<!-- VERIFIED: Link checked for gs 5.50 and gs 6.50. -->
-in <filename>Language.htm</filename>).
-
-</para>
-
-<variablelist>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-sDEVICE=pcl3</userinput></term>
-<listitem><para>This specification selects the <command>pcl3</command>
-driver,
-but this is not the only way to select it with this option.
-See the description of the <option>Subdevice</option> option below for other
-possibilities.
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-dDuplex<optional>=<replaceable>boolean</replaceable></optional
-></userinput> or <userinput>-dDuplex=null</userinput></term>
-<listitem><para>
-This parameter requests duplex printing and can be set to
-<userinput>true</userinput> only for <userinput>unspec</userinput> and
-<userinput>unspecold</userinput>,
-and when the
-<option>DuplexCapability</option> value is not <userinput>none</userinput>.
-The default is <userinput>null</userinput>
-which for this driver means that the printer's default setting will be used.
-</para>
-
-<para>
-If your printer does not support duplex printing you can achieve the same
-effect manually by printing the odd and even pages separately
-(use a command like <citerefentry>
- <refentrytitle>psselect</refentrytitle>
- <manvolnum>1</manvolnum>
-</citerefentry> from the psutils package for extracting these parts)
-and reinserting the paper in between.
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-r <replaceable>resolution</replaceable></userinput></term>
-<listitem><para>This option specifies the resolution in
-pixels per inch (ppi; sometimes also called dots per inch, dpi).
-<!-- Strictly speaking, the concept here is addressability, not resolution,
- because the option sets the number of pixels sent to the printer, not
- what it really prints. For the same reason, using "dpi" would actually be
- wrong. -->
-The driver checks whether the subdevice selected accepts the given
-resolution unless the subdevice is <userinput>unspecold</userinput> or
-<userinput>unspec</userinput>.
-Resolutions supported by at least some of the other subdevices
-for some of the colour models are 75, 100, 150, 300, 600&times;300 and 600 ppi.
-Consult the PPD files in the <command>pcl3</command> distribution if you want
-to know the details.
-The default resolution for <command>pcl3</command> is 300 ppi.
-</para>
-
-<para>
-At least the highest possible value should be listed in your printer's manual,
-but some care is necessary in the interpretation:
-the value given to <command>pcl3</command> must be a resolution supported by
-the printer's hardware for all the colorants in the process colour model
-simultaneously and when operating in raster graphics mode.
-You should also keep in mind that if your printer has two cartridges
-they might support different sets of resolutions,
-i.e., which resolution you can choose might depend on the colour model.
-It is also possible that the print quality has to be considered as well.
-If you are in doubt and have access to a manufacturer-endorsed driver for your
-printer,
-use <command>pcl3opts</command> to find out about the settings used by that
-driver.
-</para>
-
-<para>
-At least some of the series-500 DeskJets claim to
-permit a resolution of 600 &times; 300 ppi.
-However,
-although these models have a 600 dpi addressable horizontal resolution grid
-they do not permit neighbouring pixels to be activated
-(and the dots printed still have a diameter of about 1/300 in).
-The raster data generated by
-<command>gs</command>
-does not obey this restriction.
-In addition, it is possible that the higher resolution is anyway only supported
-for the printer's builtin fonts and not for general raster data.
-</para>
-
-<para>
-Concerning the DeskJet 870C,
-my impression is that although some HP documents and drivers use expressions
-like "600x300 dpi C-REt color" for this printer,
-the model does not really support a resolution of 600 &times; 300 ppi.
-First, it does not accept <command>pcl3</command>'s output with this resolution,
-and second,
-if one inspects the best output of HP's Windows driver for this printer
-with <command>pcl3opts</command>,
-one finds that the file uses a "mixed resolution",
-i.e., 600 ppi for black and 300 ppi for CMY.
-This is not supported by <command>pcl3</command>.
-</para>
-</listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-</variablelist>
-</refsect2>
-
-<!--========================================================================-->
-
-<refsect2><title><command>Pcl3</command>-Specific Options</title>
-
-<variablelist>
-
-<varlistentry>
-<term><userinput>-dBlackLevels=<replaceable>levels</replaceable></userinput
-> and <userinput>-dCMYLevels=<replaceable>levels</replaceable></userinput
-></term>
-<listitem><para>
-These options set the number of intensity levels per pixel and colorant
-to use when printing with black or CMY inks, respectively,
-and must be consistent with the colour model.
-They permit access to the printer's
-Colour Resolution Enhancement technology (C-REt) feature.
-The defaults are 0 or 2, depending on the colour model chosen.
-Other values are only accepted for the subdevices
-<userinput>hpdj8<replaceable>nn</replaceable>c</userinput>,
-<userinput>hpdj1120c</userinput>
-and <userinput>unspec</userinput>,
-and when not using the colour model <userinput>RGB</userinput>.
-</para>
-
-<para>
-The subdevice <userinput>unspec</userinput>
-accepts any non-negative number of levels except 1 up to 256.
-The subdevices <userinput>hpdj8<replaceable>nn</replaceable>c</userinput>
-and <userinput>hpdj1120c</userinput> accept the
-<replaceable>levels</replaceable> 0, 2, 3 and 4
-with the following restrictions if any of the levels is larger than 2
-(these restrictions have been determined experimentally with a
-DeskJet 850C and are not based on HP documentation):
-</para>
-<itemizedlist>
-<listitem><para>
-You can't use this feature with draft quality.
-</para></listitem>
-<listitem><para>
-You can't use a colour model of <userinput>CMY</userinput>.
-</para></listitem>
-<listitem><para>
-You must use a resolution of 300 ppi.
-</para></listitem>
-<listitem><para>
-You must use 4 levels for black.
-</para></listitem></itemizedlist>
-<para>
-When using the subdevice <userinput>unspec</userinput>
-you should expect the printer to similarly limit the possibilities.
-In particular you must expect the permitted number of levels to depend on
-colour model, resolution and print quality.
-So far I have not heard of a PCL-3+ printer supporting more than
-four intensity levels per colorant.
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-sColorModel=<replaceable>model</replaceable></userinput
-> or <userinput>-sColourModel=<replaceable>model</replaceable></userinput></term>
-<listitem><para>
-This selects the colour model to be used by the driver:
-<userinput>Gray</userinput>,
-<userinput>RGB</userinput>,
-<userinput>CMY</userinput>, <userinput>CMY+K</userinput> or
-<userinput>CMYK</userinput>.
-The default is <userinput>Gray</userinput>.
-Which colour models are accepted depends on the subdevice, see
-<link linkend="ColourModels"><citetitle>Colour Models</citetitle></link>
-in the section <citetitle>DESCRIPTION</citetitle> above.
-</para>
-
-<para>
-A value of <userinput>CMY</userinput> for this option also sets
-<userinput>BlackLevels</userinput> to zero,
-<!-- Note that "BlackLevels" in the previous line is deliberately not marked up
- as an option. -->
-and if
-<userinput>CMYLevels</userinput>
-is zero when you demand any of <userinput>CMY</userinput>,
-<userinput>CMY+K</userinput> or <userinput>CMYK</userinput>,
-it is set to two.
-For <userinput>RGB</userinput>, effectively the same happens as for
-<userinput>CMY</userinput>.
-For all other situations you must ensure yourself that colour model and
-intensity levels are consistent or <command>pcl3</command> will complain.
-This rule implies that you can ignore the level options unless you
-want to use a non-default number of levels.
-</para>
-
-<para>
-The PostScript page device dictionary entry
-<literal>ProcessColorModel</literal> will not be correct for a colour model of
-<userinput>CMY</userinput> or <userinput>CMY+K</userinput>.
-(Ghostscript returns the native colour space in this parameter,
-not the process colour model.)
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-dCompressionMethod=<replaceable>method</replaceable></userinput></term>
-<listitem><para>
-PCL interpreters understand several compression methods for raster graphics
-data in order to speed up host-printer communication.
-The possible choices are:
-
-<informaltable><tgroup cols="2">
-<tbody>
-<row><entry><userinput>0</userinput></entry>
- <entry>Unencoded, non-compressed</entry></row>
-<row><entry><userinput>1</userinput></entry>
- <entry>Runlength encoding</entry></row>
-<row><entry><userinput>2</userinput></entry>
- <entry>Tagged Image File Format (TIFF) revision 4.0 "Packbits" encoding </entry></row>
-<row><entry><userinput>3</userinput></entry>
- <entry>Delta Row Compression</entry></row>
-<row><entry><userinput>9</userinput></entry>
- <entry>Compressed Replacement Delta Row Encoding</entry></row>
-</tbody></tgroup></informaltable>
-
-The default method is 9 except for the subdevices
-<userinput>hpdj</userinput>,
-<userinput>hpdjplus</userinput>, and
-<userinput>hpdj500</userinput> where it is 3
-(these printers do not support method&nbsp;9),
-and for the subdevices <userinput>unspec</userinput> and
-<userinput>unspecold</userinput> where it is 2
-(this seems to give the best combination of portability and compression).
-Requesting method 3 actually leads to a combination of methods 2 and&nbsp;3.
-The driver may temporarily choose method 0 if a compressed data sequence would
-be longer than its uncompressed version.
-</para>
-
-<para>
-Compression rates can vary drastically, depending on the structure of the input.
-However, although the absolute values change, the relative order of efficiency
-between the methods is usually the order of increasing
-<replaceable>method</replaceable>.
-In short: use method 9 if it is supported.
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-dConfigureEveryPage<optional>=<replaceable>boolean</replaceable></optional></userinput></term>
-<listitem><para>
-This parameter, if set to true, will force the printer to be reconfigured for
-every page.
-The option is superfluous for printers which are truly PCL-3-conforming.
-</para>
-
-<para>
-Use this parameter if you discover that you can print single-page documents
-without problems but that the printer does not accept multi-page files.
-At present, the only printer I know of for which such a reconfiguration is
-needed is the Xerox DocuPrint&nbsp;M750.
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-dCUPSAccounting<optional>=<replaceable>boolean</replaceable></optional></userinput></term>
-<listitem><para>
-You will usually specify this parameter when using <command>pcl3</command> as
-the final component in a CUPS (Common UNIX Printing System) driver.
-<!-- CUPS "driver": set of filters. -->
-It will lead to appropriate page accounting messages on standard error.
-The default for this parameter is <userinput>false</userinput>.
-</para>
-
-<para>
-If you have set this parameter to <userinput>true</userinput> you can't set
-it back to <userinput>false</userinput>.
-The driver will generate a warning if this is attempted.
-</para>
-
-<para>
-When using <command>pcl3</command> within CUPS you will normally set both,
-<option>CUPSAccounting</option> and <option>CUPSMessages</option>.
-There exist, however, CUPS configurations where page accounting messages should
-be generated by a command further down the print pipeline than
-<command>pcl3</command>
-(e.g., by a CUPS backend capable of processing PJL Page Status messages
-and driving a printer which sends them).
-In these cases you should not specify <userinput>-dCUPSAccounting</userinput>.
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-dCUPSMessages<optional>=<replaceable>boolean</replaceable></optional></userinput></term>
-<listitem><para>
-Specify this parameter when using <command>pcl3</command> as a
-component in a CUPS (Common UNIX Printing System) driver.
-It will modify the format of error messages and warnings as expected by CUPS.
-The default for this parameter is <userinput>false</userinput>.
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-dDepletion=<replaceable>depletion</replaceable></userinput></term>
-<listitem><para>
-This option is only available for old DeskJets
-(including <userinput>unspecold</userinput>)
-and when printing in colour.
-The integer <replaceable>depletion</replaceable> controls an algorithm for
-removing certain pixels from the image;
-this leads to less ink being applied to the medium.
-The possible values for <replaceable>depletion</replaceable> are:
-
-<informaltable><tgroup cols="2">
-<colspec align="right"><colspec align="left">
-<tbody>
-<row><entry><userinput>1</userinput></entry>
- <entry>No depletion</entry></row>
-<row><entry><userinput>2</userinput></entry>
- <entry>25%</entry></row>
-<row><entry><userinput>3</userinput></entry>
- <entry>50%</entry></row>
-<row><entry><userinput>4</userinput></entry>
- <entry>25% with gamma correction</entry></row>
-<row><entry><userinput>5</userinput></entry>
- <entry>50% with gamma correction</entry></row>
-</tbody></tgroup></informaltable>
-
-The default value is derived from
-<option>Medium</option> and <option>PrintQuality</option>.
-The values 4 and 5 are not understood by the DeskJet 500C,
-but even for the other printers these values are not useful because PostScript
-permits finer control for gamma correction through transfer functions
-(see the subsection
-<link linkend="TransferFunctions"><citetitle>Transfer Functions</citetitle ></link>
-in the next section).
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-dDryTime=<replaceable>delay</replaceable></userinput></term>
-<listitem><para>
-With the exception of the DeskJets 500 and 500C,
-series-500 DeskJet printers can be told to guarantee a minimum drying time of
-<replaceable>delay</replaceable>
-seconds before the next page of the same print job is dropped on a newly
-printed page.
-(This interval can be terminated by pressing the Load/Eject button.)
-The printer will choose default values depending on the current print quality,
-hence it is normally not necessary to specify this option and
-the feature is even considered obsolete for post-series-500 DeskJets
-although it is still supported by some of them.
-</para>
-
-<para>
-Permissible values for
-<replaceable>delay</replaceable>
-are <userinput>null</userinput> and
-integers in the range <userinput>0</userinput>
-to <userinput>1200</userinput>,
-where
-<userinput>null</userinput>
-instructs
-<command>pcl3</command>
-not to send a corresponding command,
-<userinput>0</userinput>
-establishes default values for the current print quality,
-and all other values explicitly request the duration in seconds.
-The default is <userinput>null</userinput>.
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-sDuplexCapability=<replaceable>capability</replaceable></userinput></term>
-<listitem><para>
-Looking at the final result (sheet printed),
-there are two kinds of duplex printing identified by the two possible values
-for the option <option>Tumble</option>.
-Not all printers capable of duplex printing, however, provide the hardware
-support necessary for both,
-hence the driver must be told what the printer offers in order to be able to
-compensate for the missing functionality.
-The parameter <userinput><replaceable>capability</replaceable></userinput>
-can be any of the following:
-
-<informaltable><tgroup cols="2">
-<colspec align="left"><colspec align="left">
-<tbody>
-<row><entry><userinput>none</userinput></entry>
- <entry>no duplex capability</entry></row>
-<row><entry><userinput>sameLeadingEdge</userinput></entry>
- <entry>second pass of sheet occurs with the same leading edge</entry></row>
-<row><entry><userinput>oppositeLeadingEdge</userinput></entry>
- <entry>second pass of sheet occurs with the opposite leading edge</entry></row>
-<row><entry><userinput>both</userinput></entry>
- <entry>second pass of sheet can occur with either edge</entry></row>
-</tbody></tgroup></informaltable>
-
-This option can only be specified for
-<userinput>unspecold</userinput> and <userinput>unspec</userinput>.
-The default value is <userinput>none</userinput>.
-</para>
-
-<para>
-The correct setting for the HP DeskJet 970C is
-<userinput>oppositeLeadingEdge</userinput>,
-but the printer permits access to its duplex functionality only if you specify
-in addition
-<userinput>-sPJLLanguage=PCL3GUI -dOnlyCRD</userinput>.
-(Many thanks to Dawei W. Dong for an extensive series of experiments.)
-</para>
-
-<para>
-If a printer does not offer hardware support for both orientations,
-the document to be printed must execute <literal>showpage</literal> after a
-possible page-level <literal>restore</literal> and not before,
-otherwise the driver will not be able to compensate for the missing
-functionality
-and only one of the two <option>Tumble</option> values will work.
-All DSC-3.0-conforming PostScript files have the required property.
-<!-- See DSC 3.0, section 4.3 "Constraints", subsection "Use of showpage". -->
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-sIntensityRendering=<replaceable>method</replaceable></userinput></term>
-<listitem><para>
-Most printers,
-including every PCL-3+ printer I know of,
-can render only a small number of intensities per pixel and colorant.
-In the most frequent case, merely two levels are possible.
-As this is usually not sufficient,
-various methods have been devised to achieve a larger palette;
-this is possible at the expense of spatial resolution.
-Because of this tradeoff between effective resolution and the number of
-colours which can be distinguished,
-the best method for a given document depends on the contents of the document
-and the user should therefore be able to select it.
-</para>
-
-<para>
-The <command>pcl3</command> driver supports the following
-<userinput><replaceable>methods</replaceable></userinput> for intensity
-rendering:
-
-<informaltable><tgroup cols="2">
-<colspec align="left"><colspec align="left">
-<tbody>
-<row><entry><userinput>printer</userinput></entry>
- <entry>use the printer's capabilities directly</entry></row>
-<row><entry><userinput>halftones</userinput></entry>
- <entry>use ghostscript's halftoning implementation</entry></row>
-<row><entry><userinput>Floyd-Steinberg</userinput></entry>
- <entry>use Floyd-Steinberg error diffusion</entry></row>
-</tbody></tgroup></informaltable>
-
-The default method is <userinput>halftones</userinput>.
-The methods differ only in their treatment of intensities which cannot be
-represented directly by the printer.
-If your document contains for example only black text,
-they all produce the same result, albeit at different speeds.
-</para>
-
-<para>
-With <userinput>printer</userinput>,
-<command>pcl3</command> will cause everything to be painted
-at the full hardware resolution but will have to map all colours to the nearest
-levels the printer can represent directly.
-For a CMY or CMYK printer with two intensity levels,
-this results in just 8 useful colours per pixel.
-This value is therefore usually only sensible for documents with a small number
-of widely different saturated colours
-where accurate colour reproduction is of minor importance but
-achieving the highest possible resolution is essential.
-Another possible application is the case of PostScript input which has already
-been adapted to the printer's resolution and available intensity levels.
-</para>
-
-<para>
-With <userinput>halftones</userinput>,
-ghostscript will use what looks like standard PostScript halftoning algorithms.
-For details, consult a PostScript manual.
-However, you should know that ghostscript's current halftoning
-implementation has some problems:
-<itemizedlist>
-<listitem><para>
-The algorithm cannot handle different non-zero values for
-<option>BlackLevels</option> and <option>CMYLevels</option>.
-In this situation <command>gs</command> will in general assume
-that the number of black levels available is equal to that for CMY levels.
-Depending on which of the numbers is smaller, there will then either be unused
-black levels or some will be used more than once.
-<!-- VERIFIED: gs 5.10 -->
-</para></listitem>
-<listitem><para>
-When you are using values larger than 2 for <option>BlackLevels</option> or
-<option>CMYLevels</option>,
-ghostscript does not discover by itself that it could now achieve the same
-number of shades with smaller halftone cells.
-</para></listitem>
-<listitem><para>
-Most of the ways of increasing the halftone screen frequency seem to fail.
-I&nbsp;have been successful only with the somewhat pedestrian approach of
-using threshold arrays,
-and even that worked only for some cases.
-<!-- VERIFIED: gs 5.50, 6.01 -->
-</para></listitem>
-<listitem><para>
-For particular CMYK values and with ghostscript version&nbsp;6 or higher,
-the colour becomes drastically wrong.
-One example is CMYK = (0.99998472, 0.002549, 0, 0.00367827);
-this should be almost a pure cyan but is instead displayed as a sort of pink.
-If one subtracts one unit in the last position for any of the non-zero
-components,
-the result becomes acceptable.
-The problem has not been observed with ghostscript&nbsp;5.50.
-</para></listitem>
-<listitem><para>
-For ghostscript versions up to and including 5.50,
-if you are using the colour model <userinput>CMYK</userinput>
-and more than 2 black levels you should not set merely a single halftone screen
-(<literal>setscreen</literal>, a type-1 or a type-3 halftone dictionary)
-because
-ghostscript's dithering routine can in this case return non-monotonic levels of
-black for monotonic input intensities.
-<!--
- VERIFIED:
- Discovered with gs 5.10/hpdj at 4 levels using a 1-cell type-3 dictionary.
- Verified with gs 5.50.
- Also easily visible with a 2x2 line screen given to setscreen.
- Apparently gone with gs 6.01. -->
-However, if you specify independent halftone information for the colour
-components,
-<command>gs</command>
-uses a slower but more accurate algorithm instead which does not lead to the
-wrong behaviour.
-It is not necessary for the halftone information to be different for different
-components to achieve this.
-Note that ghostscript installs separate halftone screens for CMYK devices by
-default if the resolution is at least 150 ppi.
-<!-- VERIFIED: gs 5.10, 6.50 (definition of .sethireshalftone in gs_init.ps).
--->
-</para></listitem>
-</itemizedlist>
-Whenever you modify the halftone screens you should therefore use a test file
-like
-<filename>levels-test.ps</filename> in the <command>pcl3</command> distribution
-to check whether you obtain the desired result.
-In particular,
-you should count the number of intensities you can distinguish
-for a single colorant:
-if it is obviously not one plus
-the number of pixels in the halftone cell times
-one less than the number of hardware intensity levels,
-something has gone wrong.
-This is, for example, the case if
-you specified 4 black levels and a 2&times;2 halftone cell,
-and you then can distinguish more than 1 + 4&times;3 = 13 intensity levels.
-You should also watch for non-monotonic jumps in intensity and incompletely
-filled shapes.
-</para>
-
-<para>
-The value <userinput>Floyd-Steinberg</userinput> selects Floyd-Steinberg error
-diffusion as the method for rendering intensities.
-Use this in particular for printing photographs and other documents with
-a large number of colours or small irregular shapes.
-Regrettably, <command>pcl3</command>'s speed is much slower with this
-method than in the other cases,
-hence this value should only be used when it is really needed
-(e.g., when you run into one of ghostscript's halftoning problems)
-or when the delay is acceptable.
-</para>
-
-<para>
-If you are using ghostscript&nbsp;5.50 and
-the page to be rendered needs a lot of memory
-(this applies in particular to <userinput>Floyd-Steinberg</userinput> in colour)
-a core dump may result under certain circumstances.
-You can get around this by increasing the <option>MaxBitmap</option> parameter
-or by switching to a newer ghostscript version.
-</para>
-</listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-dLeadingEdge=<replaceable>edge</replaceable></userinput></term>
-<listitem><para>
-This option can be used to specify which edge of the sheet will enter the
-printer first.
-The permitted values identify this edge by reference to
-the orientation of default user space on the sheet
-when printing with default settings (except for <option>LeadingEdge</option>)
-and a page size having width &le; height
-("canonical page in portrait orientation"):
-
-<informaltable><tgroup cols="2">
-<colspec align="right"><colspec align="left">
-<tbody> <!-- Copied from PLR3 p. 402. -->
-<row><entry><userinput>null</userinput></entry>
- <entry>No request for media orientation</entry></row>
-<row><entry><userinput>0</userinput></entry>
- <entry>Short edge; top of canonical page</entry></row>
-<row><entry><userinput>1</userinput></entry>
- <entry>Long edge; right side of canonical page</entry></row>
-<row><entry><userinput>2</userinput></entry>
- <entry>Short edge; bottom of canonical page</entry></row>
-<row><entry><userinput>3</userinput></entry>
- <entry>Long edge; left side of canonical page</entry></row>
-</tbody></tgroup></informaltable>
-</para>
-
-<para>
-As far as I know,
-given a particular PCL-3+ printer and a particular media size,
-you cannot choose between short edge first (0 or 2) and
-long edge first (1 or 3):
-this orientation is prescribed by the manufacturer and should be documented
-in your printer's manual.
-If in doubt, use short edge first when inserting the medium.
-</para>
-
-<para>
-The default value for <replaceable>edge</replaceable> is
-<userinput>null</userinput>.
-This leads either to 0 or to 3,
-depending on whether the subdevice normally expects media of this size
-to be fed short edge first or long edge first.
-See the subsection
-<link linkend="sizesAndOrientations"><citetitle>Media Sizes and
-Orientations</citetitle></link>
-in the <citetitle>DESCRIPTION</citetitle> section above for details.
-</para>
-
-<para>
-If you find that you can't set this parameter from PostScript but you can set
-it from the command line,
-ghostscript's <literal>setpagedevice</literal> definition probably does not
-pass the parameter to drivers.
-Read the <filename>gs-mods.txt</filename> file in the <command>pcl3</command>
-distribution on how to fix this.
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-dManualFeed<optional>=<replaceable>boolean</replaceable></optional></userinput></term>
-<listitem><para>
-It is possible to request a DeskJet printer to wait before each page of a
-document until the Load/Eject button is pressed on the printer.
-This is intended for situations where some special medium is used or
-the medium has to be inserted into an input slot holding only one sheet at a
-time.
-The default setting for this option is <userinput>false</userinput>.
-</para>
-
-<para>
-In PCL, manual feed is established by requesting a particular media source (2),
-hence you should expect that setting this parameter will interfere with the
-input tray selection via <literal>InputAttributes</literal>
-(see the
-<link linkend="sourcesAndDestinations"><citetitle>Media Sources and Destinations</citetitle></link>
-subsection in the <citetitle>CONFIGURATION</citetitle> section below).
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-sMediaConfigurationFile=<replaceable>pathname</replaceable
- ></userinput></term>
-<listitem><para>
-This option must specify an existing file containing a list of
-supported media sizes, sheet orientations
-and corresponding margin descriptions for the printer.
-<!-- "-dMediaConfigurationFile=null" is also permitted, see below. -->
-This will take precedence over the builtin subdevice-specific lists.
-The format of the file is described in the
-<link linkend="CONFIGURATION"><citetitle>CONFIGURATION</citetitle></link>
-section below.
-This option is primarily intended to be used with the subdevices
-<userinput>unspecold</userinput> and <userinput>unspec</userinput>.
-</para>
-
-<para>
-The default is not to use a media configuration file but the builtin lists.
-<!-- This is the case "-dMediaConfigurationFile=null". -->
-However,
-a media file path can also be specified at compile time overriding the default
-behaviour for <userinput>unspec</userinput> only.
-Using the
-<option>MediaConfigurationFile</option>
-option in addition will take precedence over the compiled-in media file path.
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-dMediaPosition=<replaceable>position</replaceable></userinput></term>
-<listitem><para>
-This option sets the standard PostScript page device parameter
-<literal>MediaPosition</literal> to the specified value.
-The integer <replaceable>position</replaceable> identifies an input tray for
-feeding media from and
-must refer to an existing entry in the <literal>InputAttributes</literal>
-dictionary (see the
-<link linkend="sourcesAndDestinations"><citetitle
->Media Sources and Destinations</citetitle></link>
-subsection in the <citetitle>CONFIGURATION</citetitle> section below)
-in order to take effect.
-The media selection process will use this entry in preference to others
-provided it matches the media request.
-The default is not to request a particular tray by position but to look for
-a best match based on other properties.
-As ghostscript's default configuration defines only one entry in
-<literal>InputAttributes</literal>
-this option is ineffective unless you modify <literal>InputAttributes</literal>.
-</para>
-
-<para>
-With current ghostscript versions <!-- VERIFIED: gs 6.01, 6.50, 7.00 -->
-you can't use this parameter to select a
-negative <replaceable>position</replaceable>.
-The driver will issue a warning if you attempt it.
-If the entry is actually selected,
-a <literal>rangecheck</literal> error from ghostscript will follow.
-This restriction applies only to this device parameter,
-not to permissible values for position numbers in
-<literal>InputAttributes</literal>:
-if you want to use a negative <replaceable>position</replaceable>,
-you can do so by making sure that it is the only matching entry
-or by selecting it via <literal>Priority</literal>.
-</para>
-</listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-sMedium=<replaceable>medium</replaceable></userinput></term>
-<listitem><para>
-This option selects the type of medium you wish to print on
-as far as the printer needs to know about it.
-The possible choices are:
-
-<informaltable><tgroup cols="2">
-<tbody>
-<row><entry><userinput>0</userinput></entry>
- <entry><userinput>plain paper</userinput></entry></row>
-<row><entry><userinput>1</userinput></entry>
- <entry><userinput>bond paper</userinput></entry></row>
-<row><entry><userinput>2</userinput></entry>
- <entry><userinput>HP Premium paper</userinput></entry></row>
-<row><entry><userinput>3</userinput></entry>
- <entry><userinput>glossy paper</userinput></entry></row>
-<row><entry><userinput>4</userinput></entry>
- <entry><userinput>transparency film</userinput></entry></row>
-<row><entry><userinput>5</userinput></entry>
- <entry><userinput>quick dry glossy</userinput></entry></row>
-<row><entry><userinput>6</userinput></entry>
- <entry><userinput>quick dry transparency</userinput></entry></row>
-</tbody></tgroup></informaltable>
-
-The default is <userinput>plain paper</userinput>.
-For <replaceable>medium</replaceable>,
-you can specify the full strings (these are the standard values),
-the (in some cases) one-word strings resulting from dropping "paper", "film",
-and "HP",
-or an integer.
-Out-of-range numerical values generate a warning but are passed through to the
-printer if you are using a group-3 subdevice.
-If you don't,
-the effect is the same as specifying <userinput>plain paper</userinput>.
-The values 5 and 6 are unknown to most DeskJets;
-the only official exception I know of is the HP 2000C printer.
-Your printer's manual should tell you which kinds of medium are supported.
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-dOnlyCRD<optional>=<replaceable>boolean</replaceable
-></optional></userinput></term>
-<listitem><para>
-This parameter influences the PCL code generated
-and should only be specified for group-3 DeskJets.
-The default value is <userinput>false</userinput> and leads to the new
-PCL command Configure Raster Data being used only when it is necessary.
-Specifying <userinput>true</userinput> leads to Configure Raster Data
-being used even in those cases where older commands would be sufficient.
-</para>
-
-<para>
-There are indications that printers with a PCL dialect of
-"PCL Level 3 enhanced" need a value of <userinput>true</userinput> for this
-option to enable some of their functionality.
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-sPageCountFile=<replaceable>pathname</replaceable></userinput></term>
-<listitem><para>
-The <replaceable>pathname</replaceable>
-must specify either a non-existent file in a directory with write permission
-or a writable file with a single line containing a non-negative integer.
-In the first case,
-<command>pcl3</command>
-will create the file and insert the number of pages printed,
-<!-- Ghostscript interprets PageCount as meaning PostScript pages without
- counting copies (see gx_default_print_page_copies() in gs 6.50). This
- disagrees with PLR3 p. 752. pcl3 counts copies as well. -->
-in the second case the number will be incremented by that amount.
-Parallel invocations of
-<command>gs</command>
-are permitted to use the same file.
-<command>pcl3</command>
-will also make the initial page count available in its page device dictionary.
-<!-- Only after the device has been opened, though. -->
-</para>
-
-<para>
-This option is mainly intended for spooler backends calling
-<command>pcl3</command>.
-It can be used to keep track of the total number of pages printed and also for
-per-job accounting.
-I recommend using this option for the first purpose and to make a note of the
-values in the resulting files whenever you insert a new ink cartridge.
-This will enable you to get an indication of how much a printed page costs,
-and hence why it is a good idea to use <userinput>draft</userinput> quality
-whenever possible
-and why you should have bought a laser printer.
-</para>
-
-<para>
-The driver can be compiled without this option present
-but on a UNIX system I would not expect this to be done unless
-<command>gs</command>
-offers the same functionality in a driver-independent manner
-which it currently does not.
-</para>
-
-<para>
-<command>pcl3</command>
-is distributed with example files <filename>if-pcl3</filename> and
-<filename>cups-pcl3</filename>
-of Berkeley and CUPS spooler backends using this option.
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-sPCLInit1=<replaceable>string</replaceable></userinput
-> and <userinput>-sPCLInit2=<replaceable>string</replaceable></userinput
-></term>
-<listitem><para>
-These options can be used to insert additional PCL commands into
-<command>pcl3</command>'s output.
-Strings given to <option>PCLInit1</option> will be sent immediately after the
-initial Printer Reset command,
-the value of <option>PCLInit2</option> will be emitted shortly before the
-raster data of the first page.
-The default is not to send any additional commands.
-</para>
-
-<para>
-Don't use any of these options unless you understand PCL or someone who does
-tells you which value to choose under which circumstances.
-</para>
-
-<para>
-Because not every possible <replaceable>string</replaceable> value can be
-passed from the command line,
-these parameters are best set from a PostScript file.
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-sPJLJob=<optional><replaceable>jobname</replaceable></optional></userinput></term>
-<listitem><para>
-This option can be used to surround the generated file with
-Printer Job Language (PJL) commands declaring it to be a single print job
-called <replaceable>jobname</replaceable>.
-If you omit <replaceable>jobname</replaceable>, you create an unnamed job.
-The string <replaceable>jobname</replaceable> may not contain double quotes
-or control characters except HT
-(the forbidden byte codes are 0 to&nbsp;8, 10 to&nbsp;31, and&nbsp;34).
-</para>
-
-<para>
-Use this option if your printer understands PJL and
-you discover either that settings for one job influence the following job
-or that the printer does not recognize the end of the job (lights remain
-flashing or a control panel still displays a processing message).
-If you send the generated PCL file through a PJL filter,
-in particular one querying the printer's state,
-omit this option and use the filter for this purpose instead.
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-sPJLLanguage=<replaceable>language</replaceable></userinput></term>
-<listitem><para>
-If a printer supports several command languages and PCL&nbsp;3+ is not the
-default,
-the printer must be told to switch to PCL&nbsp;3+ at the beginning of the
-print job.
-Hewlett-Packard's printers use a Printer Job Language (PJL) command
-for this purpose.
-Specifying this option will switch the printer to
-<replaceable>language</replaceable> for the duration of the job and back to the
-default at the end.
-</para>
-
-<para>
-This option is not usually necessary except that there are indications that
-printers with a PCL dialect of "PCL Level 3 enhanced" need
-<userinput>-sPJLLanguage=PCL3GUI</userinput>
-to enable some of their functionality.
-</para>
-
-<para>
-You should never use the option unless you have a reliable source for the values
-of <replaceable>language</replaceable> accepted by your printer,
-for example the output from <command>pcl3opts</command> for a file generated
-by an official driver for the printer in question.
-Values I have seen so far are <computeroutput>PCLSLEEK</computeroutput> and
-<computeroutput>PCL3GUI</computeroutput>.
-</para>
-
-<para>
-If you send the generated PCL file through a PJL filter,
-omit this option and use the filter for this purpose instead.
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-sPrintQuality=<replaceable>quality</replaceable></userinput></term>
-<listitem><para>
-There are three print quality settings:
-
-<informaltable><tgroup cols="2">
-<colspec align="right"><colspec align="left">
-<tbody>
-<row><entry><userinput>-1</userinput></entry>
- <entry><userinput>draft</userinput> or <userinput>econo</userinput></entry></row>
-<row><entry><userinput>0</userinput></entry>
- <entry><userinput>normal</userinput></entry></row>
-<row><entry><userinput>1</userinput></entry>
- <entry><userinput>presentation</userinput> or <userinput>best</userinput></entry></row>
-</tbody></tgroup></informaltable>
-
-The default is <userinput>normal</userinput>.
-You may specify the strings or an integer.
-Out-of-range numerical values will generate a warning but are passed
-through to the printer if you have selected a group-3 subdevice.
-If you haven't,
-the effect is the same as specifying <userinput>normal</userinput>.
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-dRasterGraphicsQuality=<replaceable>quality</replaceable></userinput></term>
-<listitem><para>
-This option is only available for old DeskJets
-(including <userinput>unspecold</userinput>)
-and controls a trade-off between quality and print speed.
-The possible values for <replaceable>quality</replaceable> are:
-
-<informaltable><tgroup cols="2">
-<colspec align="right"><colspec align="left">
-<tbody>
-<row><entry><userinput>0</userinput></entry>
- <entry>Use current control panel setting</entry></row>
-<row><entry><userinput>1</userinput></entry>
- <entry>Draft</entry></row>
-<row><entry><userinput>2</userinput></entry>
- <entry>High</entry></row>
-</tbody></tgroup></informaltable>
-
-Specifying this option overrides the default value derived from
-<option>Medium</option> and <option>PrintQuality</option>.
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-dSendBlackLast<optional>=<replaceable>boolean</replaceable></optional></userinput></term>
-<listitem><para>
-When printing with four inks,
-a PCL-3+ printer expects the colour information for a row of pixels
-in the order black, cyan, magenta, and finally yellow (KCMY).
-</para>
-
-<para>
-There exists at least one printer (Olivetti JP792) which claims to accept
-PCL&nbsp;3+ <!-- It claims to be DJ-850C compatible. -->
-but expects the colour planes to arrive in the order CMYK.
-If you have a printer with this property, use this option.
-The default value is <userinput>false</userinput>.
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-dSendNULs=<replaceable>number</replaceable></userinput></term>
-<listitem><para>
-Most HP drivers for newer DeskJet printers generate PCL files starting with a
-sequence of 600 NUL characters, at least one uses even 9600 NULs.
-I have seen no documentation of this feature
-but I assume that in PCL the NUL character demands a null operation, i.e.,
-does nothing.
-Just in case such a NUL sequence is useful under certain circumstances,
-this option can be used to request it.
-(It has been suggested that this is needed to get the printer to accept
-new PCL commands if the previous print job was aborted in the middle of a
-command.)
-<!-- This suggestion came from David Chappell (2001-07-20). -->
-The value <replaceable>number</replaceable> specifies the number of
-NUL characters to send and must not be negative.
-The default is zero.
-Note that initial NULs might confuse spooler backends which
-try to determine the file type from the first few bytes of the file contents.
-</para>
-
-<para>
-There is no point in using this option if some other command
-in your print pipeline will add Printer Job Language (PJL) commands
-to the <command>pcl3</command>-generated file.
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-dShingling=<replaceable>shingling</replaceable></userinput></term>
-<listitem><para>
-This option is only available for group-2 DeskJets
-(including <userinput>unspecold</userinput>)
-and controls the number of passes the print head makes over the medium.
-A higher number permits more neighbouring pixels
-to be printed in separate passes,
-thereby reducing the likelihood of the ink spreading into the next pixel.
-The possible values for <replaceable>shingling</replaceable> are:
-
-<informaltable><tgroup cols="2">
-<colspec align="right"><colspec align="left">
-<tbody>
-<row><entry><userinput>0</userinput></entry>
- <entry>No shingling</entry></row>
-<row><entry><userinput>1</userinput></entry>
- <entry>2 passes (50% each pass)</entry></row>
-<row><entry><userinput>2</userinput></entry>
- <entry>4 passes (25% each pass)</entry></row>
-</tbody></tgroup></informaltable>
-
-Specifying this option overrides the default value derived from
-<option>Medium</option> and <option>PrintQuality</option>.
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-sSubdevice=<replaceable>subdevice</replaceable></userinput></term>
-<listitem><para>
-This option identifies the printer model for which the generated file is
-intended.
-The following names (mostly of Hewlett-Packard DeskJet printers)
-are accepted for <replaceable>subdevice</replaceable>:
-</para>
-
-<blockquote><para>
-<userinput>hpdj</userinput>,
-<userinput>hpdjplus</userinput>,
-<userinput>hpdjportable</userinput>,
-<userinput>hpdj310</userinput>,
-<userinput>hpdj320</userinput>,
-<userinput>hpdj340</userinput>,
-<userinput>hpdj400</userinput>,
-<userinput>hpdj500</userinput>,
-<userinput>hpdj500c</userinput>,
-<userinput>hpdj510</userinput>,
-<userinput>hpdj520</userinput>,
-<userinput>hpdj540</userinput>,
-<userinput>hpdj550c</userinput>,
-<userinput>hpdj560c</userinput>,
-<userinput>unspecold</userinput>,
-<userinput>hpdj600</userinput>,
-<userinput>hpdj660c</userinput>,
-<userinput>hpdj670c</userinput>,
-<userinput>hpdj680c</userinput>,
-<userinput>hpdj690c</userinput>,
-<userinput>hpdj850c</userinput>,
-<userinput>hpdj855c</userinput>,
-<userinput>hpdj870c</userinput>,
-<userinput>hpdj890c</userinput>,
-<userinput>hpdj1120c</userinput>,
-<userinput>unspec</userinput>.
-</para></blockquote>
-
-<para>
-The correspondence with the real printer name is, I hope, obvious.
-Note that <userinput>hpdj</userinput> does not select the
-<command>hpdj</command> driver (this driver's predecessor)
-but configures the <command>pcl3</command> driver
-for the "classical" HP DeskJet.
-</para>
-
-<para>
-With the exception of <userinput>hpdj</userinput>,
-<userinput>unspec</userinput> and <userinput>unspecold</userinput>,
-your <command>gs</command> binary might support the subdevice names also
-as device names,
-i.e., instead of specifying
-<userinput>-sDEVICE=pcl3
--sSubdevice=<replaceable>subdevice</replaceable></userinput>
-you might be able to write
-<userinput>-sDEVICE=<replaceable>subdevice</replaceable></userinput>.
-Check ghostscript's list of available devices to find out whether this is the
-case (<userinput>gs -h</userinput>).
-</para>
-
-<para>
-The choice of subdevice primarily determines which resolutions, colour models,
-intensity levels and media sizes the driver will accept,
-where the output will appear on the page,
-and to some extent what PCL code the driver will generate.
-Several of the subdevices are treated identically.
-</para>
-
-<para>
-The default subdevice is <userinput>unspec</userinput>.
-It is intended for new PCL-3+ printers not explicitly supported by this driver.
-For <userinput>unspec</userinput>,
-all subdevice-specific checks (e.g., supported resolutions)
-are turned off.
-Supported media sizes and margin settings are assumed to be identical with
-those for the DeskJets 850C/855C/870C/890C,
-but you can and should use the <option>MediaConfigurationFile</option>
-option or its compile-time equivalent to override this.
-The PCL code generated assumes a new DeskJet in the sense that it should be
-at least of the level of a DeskJet 540 supporting the PCL commands Media Type
-and Print Quality.
-If you specify unequal horizontal and vertical resolutions or
-more than two levels of intensity per colorant and pixel,
-the printer must in addition understand the Configure Raster Data command.
-</para>
-
-<para>
-The subdevice <userinput>unspecold</userinput> is similar but behaves like
-a DeskJet 560C.
-It supports all colour models and all uniform resolutions
-(the horizontal resolution is equal to the vertical resolution).
-</para>
-
-<para>
-If you choose to use <userinput>unspec</userinput> or
-<userinput>unspecold</userinput>
-it is your responsibility to ensure that <command>pcl3</command>
-is only called with parameter values the printer can handle.
-This applies in particular to the resolution and the intensity levels.
-</para>
-
-<para>
-If you set this parameter from a PostScript document you must know that
-doing this re-initializes most of the <command>pcl3</command> parameters
-to their default values.
-If you set several page device parameters in a single
-<literal>setpagedevice</literal> call
-the <option>Subdevice</option> option will be treated first.
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-dTumble<optional>=<replaceable>boolean</replaceable></optional></userinput></term>
-<listitem><para>
-When duplex printing is requested (<userinput>-dDuplex</userinput>),
-this parameter specifies whether the y axes of PostScript's default user space
-on the two sides of the sheet (assumed to use the same page size) point to the
-same edge or to opposite edges.
-<!-- This is really default user space, not default default user space. -->
-The default value <userinput>false</userinput> indicates the same edge and
-is usually suitable for binding on the left while
-<userinput>true</userinput> indicates opposite edges and should be used for
-binding at the top.
-</para>
-
-<para>
-You should note that the interpretation of <option>Tumble</option> refers to
-default user space:
-if a PostScript program has rotated the user space coordinate system
-the association between the page's apparent "up" direction and the binding edge
-will usually not be the one desired.
-You should watch for this in particular when creating output
-in landscape orientation from an application still generating
-PostScript Level 1 code.
-If a ghostscript screen driver like <command>x11</command> displays the pages
-with the right side up you should have nothing to worry about,
-even in the case of landscape orientation.
-(You must call <command>gs</command> directly for this test,
-not via <command>ghostview</command>.)
-<!-- ghostview interprets the DSC comment %%Orientation. -->
-If the orientation between the two sides turns out to be wrong,
-you will have to print again with the opposite value for
-<option>Tumble</option>.
-If that does not help and you have a printer supporting only one of the two
-possible duplex orientations,
-check the relative order of <literal>restore</literal> and
-<literal>showpage</literal> in the document you printed
-(see the <option>DuplexCapability</option> option above).
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-<varlistentry>
-<term><userinput>-dUseCard<optional>=<replaceable>value</replaceable></optional></userinput></term>
-<listitem><para>
-This option should only be given when printing on A6 and with a printer like the
-HP DeskJet 1120C which distinguishes between A6 sheets and A6 postcards.
-The option can be used to specifically request one of the alternatives.
-The default <replaceable>value</replaceable> is <userinput>null</userinput>
-and means that sheets are preferred to postcards,
-but either is acceptable if supported.
-The other permitted values are
-<userinput>true</userinput> and <userinput>false</userinput>.
-</para>
-
-<para>
-This option applies to all page sizes set while ghostscript
-executes and this includes the default size set at startup.
-If you wish to use <userinput>-dUseCard=true</userinput> you will
-therefore usually have to specify the <option>PAPERSIZE</option> option in the
-call,
-otherwise an error will occur because there is no postcard variant for the
-usual default sizes (ISO A4 and US Letter).
-</para></listitem>
-</varlistentry>
-
-<!-- ______________________________________________________________________ -->
-
-</variablelist>
-
-</refsect2>
-
-<!--========================================================================-->
-
-<refsect2><title>Option Combinations for Hardware Parameters</title>
-
-<para>
-Not all combinations of colour model, resolution, number of intensity levels,
-print quality and media type are accepted or make sense.
-Unfortunately, Hewlett-Packard does not publicly release sufficient information
-to find the best possible combinations.
-A good way to find reasonable settings is to use <command>pcl3opts</command>
-on files generated by an official driver for the printer.
-You should also check the file <filename>reports.txt</filename> in the
-<command>pcl3</command> distribution.
-In addition, I'll provide some remarks here.
-</para>
-
-<para>
-As a general rule,
-it is unprofitable to use a finer resolution than 300 ppi or more than
-2 intensity levels for draft quality.
-A coarser resolution in particular can reduce the time needed to generate
-and transmit the file to the printer.
-Combined with draft quality this leads to what HP calls an "EconoFast" mode.
-</para>
-
-<para>
-As an exception, here are recommendations based on official HP documentation
-for the DeskJet 1120C.
-<!-- Source: "Hewlett-Packard DeskJet 1120C Printer - Software Developer's
- PCL Guide", version 1.0, December 1997; page 48. -->
-The table lists the resolution and the number of black or black and CMY levels
-if not 2.
-<blockquote><informaltable><tgroup cols="3"><thead>
-<row><entry>Quality</entry> <entry>Gray</entry> <entry>CMYK</entry></row>
-<!-- Missing rule -->
-</thead>
-<tbody>
-<row><entry>draft</entry> <entry>300 ppi</entry> <entry>300 ppi</entry></row>
-<row><entry>normal</entry> <entry>300 ppi, 4 levels</entry>
- <entry>300 ppi, (4,3) levels</entry></row>
-<row><entry>presentation</entry>
- <entry>600 ppi</entry> <entry>300 ppi, (4,4) levels</entry></row>
-</tbody></tgroup></informaltable></blockquote>
-
-These seem reasonable values for the supported series-800 DeskJets as well.
-</para>
-
-</refsect2>
-
-<!--========================================================================-->
-
-<refsect2><title>Checking Page Device Parameters</title>
-
-<para>
-As for all ghostscript drivers,
-<command>pcl3</command>'s command line options correspond to identically-named
-PostScript page device parameters
-and are accessible in the usual way.
-In particular,
-it is possible to read the value of a parameter
-by letting <command>gs</command> execute a command like
-<blockquote><programlisting>
-currentpagedevice /<replaceable>parameter</replaceable> get ==
-</programlisting></blockquote>
-where <replaceable>parameter</replaceable> is the name of the parameter one
-would like to inspect,
-for example <userinput>BlackLevels</userinput>.
-This is useful if you are in doubt whether the driver has accepted your options.
-Of course, for printer-visible parameters you can also use
-<command>pcl3opts</command> on the output file.
-</para>
-
-<para>
-The ghostscript distribution contains a program <filename>uninfo.ps</filename>
-which displays the page device dictionary on standard output
-but does not resolve nested dictionaries.
-The <command>pcl3</command> distribution contains a similar program
-<filename>dumppdd.ps</filename> which does not have this limitation.
-</para>
-
-</refsect2>
-
-
-</refsect1>
-
-<!-- ********************************************************************** -->
-
-<refsect1 id="CONFIGURATION"><title>CONFIGURATION</title>
-
-<refsect2><title>Media Configuration File</title>
-
-<para>
-A <firstterm>media configuration file</firstterm>
-(<firstterm>media file</firstterm> for short) can be used to override the
-builtin subdevice-specific lists of supported media sizes
-and, for each size, the sheet orientation in the input tray
-and the margins enforced by the printer.
-This feature is mainly intended to be used in conjunction with
-<userinput>unspec</userinput> and <userinput>unspecold</userinput>:
-if you have a model not directly supported by this driver, look up the
-supported media sizes,
-the rules for inserting media
-and the corresponding printable regions in your printer's
-manual and enter them in a media file.
-</para>
-
-<caution><simpara>
-Entering a media size in the file which is not really supported by your
-printer is not useful:
-the PCL interpreter will simply ignore the request to set this size,
-and printer and driver may have diverging opinions about what the margins
-will be.
-If you need to print on a medium of a size not supported by your printer,
-choose a larger and printer-supported size in PostScript or via
-<option>FIXEDMEDIA</option>,
-shift the image if necessary,
-establish properly-positioned clipping regions within the real size, and print.
-Or you could use a suitable page size recovery policy for PostScript's
-media selection process.
-However, if you have a newer DeskJet supporting custom page sizes,
-all this is not necessary.
-</simpara></caution>
-
-<para>
-Margin specifications are important for two reasons:
-the values for the left and top margins determine how the output is positioned
-on the page,
-and sufficiently large values for the right and bottom margins prevent the
-print head being caught at the paper's edge and printing beyond the sheet,
-respectively.
-Because DeskJet printers usually have an inconveniently large bottom margin
-(usually 0.4-0.8 inches or 10-20 mm),
-one might be tempted to specify smaller values than listed in the
-printer's manual.
-However, one user reported that this led to the printer depositing a large wet
-blob of black ink at the bottom of the page.
-</para>
-
-<para>
-A line in the media file can be blank, a comment line (first non-blank
-character is '<userinput>#</userinput>'), or one of the following:
-</para>
-
-<blockquote>
-<!-- This is a table merely do get a decent alignment. -->
-<informaltable frame="none"><tgroup cols="2">
-<tbody>
-<row><entry><userinput>unit</userinput></entry>
- <entry><replaceable>unit</replaceable></entry></row>
-<row><entry><replaceable>size</replaceable></entry>
- <entry><replaceable>left</replaceable> <replaceable>bottom</replaceable> <!--
- --> <replaceable>right</replaceable> <replaceable>top</replaceable></entry>
- </row>
-</tbody></tgroup></informaltable>
-</blockquote>
-
-<para>
-A <userinput>unit</userinput> line specifies in which units
-margin specifications in the following lines should be interpreted.
-<replaceable>unit</replaceable>
-can either be <userinput>in</userinput> (inch) or
-<userinput>mm</userinput> (millimetre)
-with <userinput>in</userinput> being the default.
-A unit specification remains in force until overridden by a following
-<userinput>unit</userinput> line.
-</para>
-
-<para>
-The second kind of line states that the model supports a particular
-media configuration and specifies the hardware margins in force for that case.
-The <replaceable>size</replaceable> word consists of two parts:
-a keyword denoting the extension and an optional suffix.
-The following keywords are accepted
-(entries marked with an asterisk (*) are those used by the subdevice
-<userinput>unspec</userinput>
-if no media file is employed;
-entries with a section/paragraph sign (&sect;) similarly identify the sizes
-used by <userinput>unspecold</userinput>):
-
-<informaltable><tgroup cols="2">
-<colspec align="right"><colspec align="left">
-<tbody>
-<row><entry><userinput>Index3x5in</userinput></entry>
- <entry>US index card 3 &times; 5 in</entry></row>
-<row><entry><userinput>EnvChou4</userinput></entry>
- <entry>Japanese long envelope #4 (90 &times; 205 mm)</entry></row>
-<row><entry><userinput>EnvMonarch</userinput></entry>
- <entry>US Monarch envelope (3.875 &times; 7.5 in)</entry></row>
-<row><entry>*<userinput>Postcard</userinput></entry>
- <entry>Japanese Hagaki card (100 &times; 148 mm)</entry></row>
-<row><entry>*<userinput>Index4x6in</userinput></entry>
- <entry>US index card 4 &times; 6 in</entry></row>
-<row><entry>&sect;*<userinput>Env10</userinput></entry>
- <entry>US no. 10 envelope (4.125 &times; 9.5 in)</entry></row>
-<row><entry><userinput>A6</userinput></entry>
- <entry>ISO/JIS A6 (105 &times; 148 mm)</entry></row>
-<row><entry>*<userinput>A6Card</userinput></entry>
- <entry>ISO/JIS A6 postcard (105 &times; 148 mm)</entry></row>
-<row><entry>&sect;*<userinput>EnvDL</userinput></entry>
- <entry>ISO DL envelope (110 &times; 220 mm)</entry></row>
-<row><entry><userinput>EnvUS_A2</userinput></entry>
- <entry>US A2 envelope (4.375 &times; 5.75 in)</entry></row>
-<row><entry>*<userinput>EnvC6</userinput></entry>
- <entry>ISO C6 envelope (114 &times; 162 mm)</entry></row>
-<row><entry><userinput>EnvChou3</userinput></entry>
- <entry>Japanese long envelope #3 (120 &times; 235 mm)</entry></row>
-<row><entry>*<userinput>Index5x8in</userinput></entry>
- <entry>US index card 5 &times; 8 in</entry></row>
-<row><entry><userinput>Statement</userinput></entry>
- <entry>US Statement (5.5 &times; 8.5 in)</entry></row>
-<row><entry><userinput>DoublePostcard</userinput></entry>
- <entry>double Postcard (148 &times; 200 mm)</entry></row>
-<row><entry>*<userinput>A5</userinput></entry>
- <entry>ISO/JIS A5 (148 &times; 210 mm)</entry></row>
-<row><entry><userinput>EnvC5</userinput></entry>
- <entry>ISO C5 envelope (162 &times; 229 mm)</entry></row>
-<row><entry><userinput>ISOB5</userinput></entry>
- <entry>ISO B5 (176 &times; 250 mm)</entry></row>
-<row><entry>*<userinput>JISB5</userinput></entry>
- <entry>JIS B5 (182 &times; 257 mm)</entry></row>
-<row><entry>&sect;*<userinput>Executive</userinput></entry>
- <entry>US Executive (7.25 &times; 10.5 in)</entry></row>
-<row><entry>&sect;*<userinput>A4</userinput></entry>
- <entry>ISO/JIS A4 (210 &times; 297 mm)</entry></row>
-<row><entry>&sect;*<userinput>Letter</userinput></entry>
- <entry>US Letter (8.5 &times; 11 in)</entry></row>
-<row><entry>&sect;*<userinput>Legal</userinput></entry>
- <entry>US Legal (8.5 &times; 14 in)</entry></row>
-<row><entry><userinput>EnvKaku2</userinput></entry>
- <entry>Japanese Kaku envelope (240 &times; 332 mm)</entry></row>
-<row><entry><userinput>JISB4</userinput></entry>
- <entry>JIS B4 (257 &times; 364 mm).
-This is distinct from ISO B4 (250 &times; 353 mm).</entry></row>
-<row><entry><userinput>Tabloid</userinput></entry>
- <entry>US Tabloid (11 &times; 17 in; in landscape orientation also called "Ledger")</entry></row>
-<row><entry><userinput>A3</userinput></entry>
- <entry>ISO/JIS A3 (297 &times; 420 mm)</entry></row>
-<row><entry><userinput>HPSuperB</userinput></entry>
- <entry>what HP calls Super B (13 &times; 19 in)</entry></row>
-<row><entry>*<userinput>CustomPageSize</userinput></entry>
- <entry>custom page size</entry></row>
-</tbody></tgroup></informaltable>
-
-Note the difference between <userinput>A6</userinput> (sheet) and
-<userinput>A6Card</userinput> (postcard).
-I do not know why Hewlett-Packard associates this distinction with media size
-instead of media type.
-However, with the exception of the 1120C all DeskJet printers I know of
-use only <userinput>A6Card</userinput> anyway.
-</para>
-
-<para>
-In looking at your printer's documentation, bear in mind that a driver might
-support more sizes than the printer accepts;
-<command>pcl3</command> needs to be given the latter values.
-If you are in doubt what your printer understands,
-<command>pcl3opts</command> can tell you which media size another driver
-requests.
-</para>
-
-<para>
-Custom page sizes are not understood by older printers
-and may be used in a media file only for the subdevices
-<userinput>hpdj540</userinput>,
-<userinput>hpdj6<replaceable>nn</replaceable><optional>c</optional></userinput>,
-<userinput>hpdj8<replaceable>nn</replaceable>c</userinput>,
-<userinput>hpdj1120c</userinput>,
-and <userinput>unspec</userinput> (group&nbsp;3).
-In these cases you can print, within certain limits, on arbitrarily-sized media.
-The driver knows these limits and refuses to generate a file if you exceed them.
-For <userinput>unspec</userinput>, there are no limits.
-<command>pcl3</command>
-will tell the printer to expect a custom page size
-only if there is no fitting discrete entry.
-</para>
-
-<para>
-Although it is possible, on those printers which support it,
-to use a media configuration file containing only a custom page size entry,
-I advise against it
-because this size specification is only intended as a last resort.
-If you have a custom page size entry in the media file,
-you should therefore list <emphasis>all</emphasis> discrete sizes supported by
-your printer or at least those which you expect to use.
-</para>
-
-<para>
-The size keyword in the <replaceable>size</replaceable> field can be extended
-by the following strings:
-<variablelist>
-<varlistentry><term><userinput>Big</userinput></term>
-<listitem><para>
-For <command>pcl3</command>, this suffix means banner printing.
-In these cases the top and bottom margins are usually zero.
-HP DeskJets supporting banner printing do so only for ISO A4 and US Letter.
-Your media file should then contain entries for the
-<replaceable>sizes</replaceable>
-<userinput>A4</userinput>,
-<userinput>A4Big</userinput>,
-<userinput>Letter</userinput>, and
-<userinput>LetterBig</userinput>.
-</para>
-</listitem></varlistentry>
-
-<varlistentry><term><userinput>.Transverse</userinput></term>
-<listitem><para>
-By default,
-<command>pcl3</command> assumes that the media listed are fed short edge first.
-If you specify this qualifier,
-the driver will assume that you are going to feed media of this size
-long edge first.
-If, for example,
-your printer's manual states that envelopes of size ISO DL should be fed
-long edge first,
-the corresponding <replaceable>size</replaceable> field in your media file
-should contain the string <userinput>EnvDL.Transverse</userinput>,
-not <userinput>EnvDL</userinput>.
-</para>
-
-<para>
-This specification (or its absence) can be overridden with the option
-<option>LeadingEdge</option> in the call.
-</para>
-</listitem></varlistentry>
-</variablelist>
-
-The builtin lists for the <userinput>unspec</userinput> and
-<userinput>unspecold</userinput> devices do not contain size entries with any
-of these suffixes.
-</para>
-
-<para>
-Every media file must contain at least an entry which fits ghostscript's
-default page size,
-usually ISO A4 or US Letter.
-Only those sizes which are listed will be accepted by <command>pcl3</command>.
-This is independent of a <userinput>.Transverse</userinput> suffix.
-If there are several entries in the media file with the same
-<replaceable>size</replaceable> value,
-only the first is used.
-</para>
-
-<para>
-The margins in a size entry should be valid for monochrome printing in
-raster graphics mode.
-If a non-monochrome colour model is selected and unless the bottom margin is
-exactly zero,
-it will be increased by a subdevice-specific amount.
-This increment is zero for <userinput>unspecold</userinput> and
-<userinput>unspec</userinput>.
-</para>
-
-<para>
-The orientation of the margins refers to the feeding direction:
-you should imagine holding the sheet such that the leading edge is at the top
-and the side to be printed on is towards you.
-Be careful with envelopes:
-older (pre-1997) HP documentation usually gives the margins in landscape
-orientation
-even for those printers where the envelope has to be fed short edge first.
-You can check this by looking for the largest margin value:
-if it is on the left instead of at the bottom you almost certainly have such a
-landscape-based specification;
-rotate the values by +90 degrees (quarter-circle counterclockwise) in these
-cases.
-The margins have to be specified as non-negative floating point numbers
-in inches or millimetres
-as announced by the last preceding <userinput>unit</userinput> line.
-The floating point format is that of the "C" locale.
-</para>
-
-<para>
-<command>pcl3</command>
-is distributed with an example of a media configuration file,
-<filename>example.mcf</filename>.
-</para>
-</refsect2>
-
-<!--========================================================================-->
-
-<refsect2><title>PostScript Configuration Files</title>
-
-<para>
-Sometimes it is desirable to execute additional PostScript commands for a
-particular file or possibly all files sent to a particular printer or print
-queue.
-With ghostscript this is easily possible because <command>gs</command>
-accepts several file names in the invocation and processes them sequentially.
-This is particularly appropriate for those PostScript operators which affect
-device-specific features and should therefore not appear in a portable page
-description
-and for settings which would be part
-of the interpreter's persistent state when using a real PostScript printer.
-</para>
-
-<para>
-The <command>pcl3</command> distribution contains examples of filters
-<filename>if-pcl3</filename> for the Berkeley spooler
-<citerefentry>
- <!-- Here we have a choice of evils: lpr(1) can refer to the Berkeley
- interface or to the Berkeley-like interface for CUPS, lpd(8) can be
- either the Berkeley or the AT&T daemon. -->
- <refentrytitle>lpr</refentrytitle>
- <manvolnum>1</manvolnum>
-</citerefentry>
-and <filename>cups-pcl3</filename> for the Common UNIX Printing System
-<citerefentry>
- <refentrytitle>cupsd</refentrytitle>
- <manvolnum>8</manvolnum>
-</citerefentry>.
-These filters permit the use of a print-queue-specific configuration file.
-</para>
-</refsect2>
-
-<!--========================================================================-->
-
-<refsect2 id="sourcesAndDestinations">
- <title>Media Sources and Destinations</title>
-
-<para>
-PostScript has a builtin mechanism for selecting media sources and destinations
-based on certain properties of the document.
-This usually requires a system administrator to set the
-<literal>InputAttributes</literal> and <literal>OutputAttributes</literal>
-dictionaries in the device's page device dictionary according to the current
-state of the printer and its intended use.
-For example, if there are two input trays,
-one currently holding paper and the other transparencies,
-the administrator could configure the <literal>InputAttributes</literal>
-dictionary such that print jobs requesting transparencies in a certain manner
-automatically fetch media from the second tray
-and every job needing a size not currently available will terminate with
-an error message.
-Unfortunately, in order to work as expected this process usually also requires
-some additional action on the part of the entity generating the PostScript code
-to be printed.
-</para>
-
-<para>
-If your printer is capable of sensing certain properties of media in the
-input tray (e.g., media size)
-or assumes a fixed association between media properties and input trays
-you must expect this functionality to interfere with the process referenced
-here.
-<!-- One user reported (2000-02-14) that his Mita copier/printer fed media from
- the A3 tray only when sent the correct PCL page size code (this was for
- hpdj). -->
-</para>
-
-<para>
-In the attributes dictionaries,
-each tray is identified by an integer,
-its <firstterm>position number</firstterm>.
-When ghostscript successfully matches the document's requirements with trays
-the resulting position numbers are accessible to the driver.
-The <command>pcl3</command> driver uses these numbers (except 0)
-directly as arguments
-for the PCL commands "Media Source" and "Media Destination", respectively.
-<!-- Actually, the name of the latter seems to be "Paper Destination" in
- PCL 5. -->
-For the Media Source values (input trays), I know of the following meanings:
-
-<blockquote><informaltable><tgroup cols="2">
-<colspec align="right"><colspec align="left">
-<tbody>
-<!-- HP 2500C values from bpd07645. -->
-<row><entry>-1</entry> <entry>banner printing</entry></row>
-<row><entry>1</entry> <entry>default tray; portable CSF (DJ 340); tray 2 (HP 2500C)</entry></row>
-<row><entry>2</entry> <entry>manual feed</entry></row>
-<row><entry>3</entry> <entry>envelope feed</entry></row>
-<row><entry>4</entry> <entry>desktop CSF (DJ 340); tray 3 (HP 2500C)</entry></row>
-<row><entry>5</entry> <entry>tray 1 (HP 2500C)</entry></row>
-<row><entry>7</entry> <entry>auto select (HP 2500C)</entry></row>
-</tbody></tgroup></informaltable>
-</blockquote>
-
-You'll have to experiment with your printer to find out which values are
-accepted and what their interpretation is.
-In general,
-you can only expect 1 and 2 to work.
-Unrecognized values should be simply ignored by the printer
-leading to the medium being fetched from the default tray.
-To shorten the search, use <command>pcl3opts</command>
-if you can in order to find out which values other drivers generate.
-Don't bother testing the value&nbsp;0:
-in PCL its effect is to eject a page and, as this is not needed,
-<command>pcl3</command> uses it to mean that no particular tray should be
-selected.
-</para>
-
-<para>
-I do not know of any PCL-3+ printer supporting more than one output tray,
-hence the corresponding implementation is based on the speculation that such
-a feature, if made available,
-would use the same command as in PCL&nbsp;5.
-Again, a value of zero is used by <command>pcl3</command> to mean
-"don't select a particular tray".
-</para>
-
-<para>
-Ghostscript's default configuration defines
-<literal>InputAttributes</literal> and
-<literal>OutputAttributes</literal> dictionaries with one entry each,
-having position number 0 in both cases,
-and maps all requests to these positions.
-As explained above, this configuration will lead to <command>pcl3</command>
-not requesting any particular input or output tray.
-If you wish to modify this you should consult a PostScript manual,
-for example the sections 6.2.1 and 6.2.4 in the
-<citetitle>PostScript Language Reference</citetitle>. <!-- 3rd ed. -->
-However, I'll present here three examples without explanation.
-In all cases, the PostScript code shown should be executed before the
-document to be printed.
-</para>
-
-<para>
-The first example is intended for situations where you always wish to select
-a specific input tray:
-<blockquote><programlisting>
-&lt;&lt;
- /InputAttributes &lt;&lt;
- 0 null <!-- see PLR3, p. 410 -->
- <replaceable>input</replaceable> &lt;&lt; /PageSize [6 6 524287 524287] &gt;&gt;
- &gt;&gt;
-&gt;&gt; setpagedevice
-</programlisting></blockquote>
-Replace <replaceable>input</replaceable> with the number of the tray
-you wish to use.
-The second example does the same for the output tray:
-<blockquote><programlisting>
-&lt;&lt;
- /OutputAttributes &lt;&lt;
- 0 null
- <replaceable>output</replaceable> &lt;&lt; &gt;&gt;
- &gt;&gt;
-&gt;&gt; setpagedevice
-</programlisting></blockquote>
-Replace <replaceable>output</replaceable> with the number of the tray
-you wish to use.
-</para>
-
-<para>
-For the final example assume that you have one input tray,
-filled with media of a certain default size,
-and you wish all print jobs requesting another size to automatically switch
-to manual feed so you can insert these special sheets at leisure.
-In that case,
-let <command>gs</command> execute the following PostScript code:
-</para>
-
-<blockquote><programlisting>
-&lt;&lt;
- /InputAttributes &lt;&lt;
- 0 &lt;&lt; /PageSize [<replaceable>width</replaceable> <replaceable>height</replaceable>] &gt;&gt;
- 2 &lt;&lt; /PageSize [6 6 524287 524287] &gt;&gt; <!-- 2^19 - 1 -->
- /Priority [0 2]
- &gt;&gt;
-&gt;&gt; setpagedevice
-</programlisting></blockquote>
-
-<para>
-For <replaceable>width</replaceable> and <replaceable>height</replaceable> you
-must insert the actual dimensions of your default size
-in units of 1 bp ("big point", 1/72 inch, roughly 0.35 mm);
-the tolerance is 5 bp.
-In contrast to a document's page size,
-the orientation is irrelevant here.
-</para>
-
-<para>
-If you drop the second entry and the <userinput>Priority</userinput> line
-in the last example
-you obtain a configuration where ghostscript will refuse to print any document
-not requesting the specified media size.
-If you retain the two lines and you are using the
-<userinput>unspecold</userinput> or <userinput>unspec</userinput> devices
-it is advisable to insert your printer's actual size bounds instead of those
-given above.
-This will protect you against printing on some sizes
-not supported by your printer.
-</para>
-
-</refsect2>
-
-<!--========================================================================-->
-
-<refsect2><title>Banner Printing</title>
-
-<para>
-Some printers support printing on continuous forms,
-also called banners or z-fold media.
-Your printer's manual should tell you whether this is supported and in
-particular how to load these media.
-</para>
-
-<para>
-In order to print on continuous media with <command>pcl3</command>,
-configure it as follows:
-<itemizedlist>
-<listitem><para>
-Make sure that input position number &minus;1 will be selected
-(see the subsection
-<link linkend="sourcesAndDestinations"><citetitle
->Media Sources And Destinations</citetitle></link>
-above).
-</para></listitem>
-<listitem><para>
-In the call to <command>gs</command>,
-select a subdevice supporting the intended "<userinput>Big</userinput>" size.
-By default,
-only the subdevices <userinput>hpdj680c</userinput>,
-<userinput>hpdj690c</userinput> and <userinput>hpdj1120c</userinput>
-support banner printing
-(<userinput>A4Big</userinput> and <userinput>LetterBig</userinput>).
-</para></listitem>
-</itemizedlist>
-Don't forget to prepare the printer as well.
-</para>
-
-</refsect2>
-
-<!--========================================================================-->
-
-<refsect2><title>Correcting Offsets</title>
-
-<para>
-A media configuration file is intended to adapt
-<command>pcl3</command>
-to the difference in margin settings between printer models and should usually
-contain "official" information,
-preferably taken from the model's manual.
-</para>
-
-<para>
-A different situation arises if a particular printer's output is not properly
-positioned on the page even if the margin information is correct for this
-model.
-PostScript defines two arrays in the page device dictionary for correcting such
-misadjustments,
-both containing two numbers describing a desired shift of the page image with
-respect to device space coordinate axes but in different units.
-The values in the `<literal>Margins</literal>' array are interpreted with
-respect to a canonical default resolution,
-the newer `<literal>PageOffset</literal>' array
-is taken to be in units of 1/72 inch ("big points", bp).
-For <command>pcl3</command> the device coordinate system has an
-x axis pointing to the right and a y axis pointing downwards
-when looking at the sheet with the leading edge at the top and the side to be
-printed on towards you.
-The canonical default resolution is 300 ppi.
-</para>
-
-<para>
-As an example, assume your printer shifts its output 1 mm to the right
-and 0.5 mm upwards.
-Now create a file containing either the PostScript code
-<blockquote><programlisting>
-&lt;&lt; /Margins [-11.8 5.9] &gt;&gt; setpagedevice
-</programlisting></blockquote>
-<!--
- Specifying tenths of pixels here may seem exaggerated. However, the DJ 850C
- for example states that after calibration the vertical alignment is accurate
- within +/-0.002 in or +/-0.6 pixels at 300 ppi. I can't imagine ever needing
- that, but I can't see a reason either for throwing away accuracy. Moreover,
- I do dot wish to suggest to the reader that s/he has to specify integers.
--->
-("shift 11.8 pixels to the left and 5.9 pixels down") or
-<blockquote><programlisting>
-&lt;&lt; /PageOffset [-2.8 1.4] &gt;&gt; setpagedevice
-</programlisting></blockquote>
-("shift 2.8 bp to the left and 1.4 bp down")
-and have it executed by ghostscript before the file to be printed.
-</para>
-
-<para>
-The margin test files distributed with <command>pcl3</command>
-can be used to determine the necessary correction.
-You should be aware that you have to expect fluctuations between individual
-print jobs,
-in particular in the horizontal direction.
-</para>
-
-</refsect2>
-
-<!--========================================================================-->
-
-<refsect2 id="TransferFunctions"><title>Transfer Functions</title>
-
-<para>
-DeskJets usually produce prints which are too dark (too much ink on the page),
-most noticeably when using more than 2 intensity levels per colorant.
-In this case you should perform
-<firstterm>gamma correction</firstterm>
-by modifying what PostScript calls <firstterm>transfer functions</firstterm>.
-In the simplest case,
-create a file containing the PostScript command
-</para>
-
-<blockquote><programlisting>
-{<replaceable>number</replaceable> exp} settransfer
-</programlisting></blockquote>
-
-<para>
-where a good value for <replaceable>number</replaceable>
-is usually in the range 0.3-0.5,
-<!--
- The recommendation is my own. HP recommends to experiment around a gamma
- value of 0.3 for the DeskJets 310 and 320 when using 50 % shingling and
- 25 % depletion (DJ3/4 p. 24). -->
-and specify this file in ghostscript's command line before the file you wish to
-print.
-Now the intensities of all colorants will be rescaled by exponentiation
-with <replaceable>number</replaceable>.
-Because PostScript intensity values are in the range zero to one
-with zero meaning dark and one meaning light (additive interpretation),
-a value of <replaceable>number</replaceable> &lt;&nbsp;1
-will lead to lighter colours and
-<replaceable>number</replaceable> &gt;&nbsp;1 results in darker colours.
-</para>
-
-<para>
-The best value for <replaceable>number</replaceable> depends on the
-print quality,
-the number of intensity levels,
-the method chosen for intensity rendering,
-the kind of medium you print on,
-and the properties of the document to be printed.
-<!-- That should give you sufficient scope for experiments :-). -->
-</para>
-
-<para>
-Note that there is no common convention for the interpretation of
-stand-alone gamma values.
-When dealing with other software you might for example find that the boundary
-between light and dark is at a value of&nbsp;1000 and
-that lighter colours are obtained with larger values.
-In order to understand what a "gamma value" means
-you therefore need the complete specification of the transfer function and,
-if the value does not refer to PostScript,
-also information on the interpretation of intensity values.
-</para>
-
-<para>
-You can also set independent transfer functions for the four colorants
-by using the operator <literal>setcolortransfer</literal>
-which expects four routines as arguments.
-Consult a PostScript manual if you want to learn more about transfer functions.
-</para>
-
-<para>
-If you are using <userinput>-sIntensityRendering=halftones</userinput>,
-less than 32 intensity levels per colorant,
-a resolution below 800 ppi,
-and unless you explicitly set transfer functions,
-<command>gs</command> applies a default gamma correction roughly corresponding
-to a value of 0.8 for <replaceable>number</replaceable>.
-<!-- VERIFIED: gs 6.01, 6.50 (gs_init.ps) -->
-</para>
-
-</refsect2>
-</refsect1>
-
-<!-- ********************************************************************** -->
-
-<refsect1 id="LIMITATIONS"><title>LIMITATIONS</title>
-
-<refsect2><title>Ghostscript Version</title>
-
-<para>
-This manual page contains statements relying on undocumented properties of
-ghostscript.
-These statements are to my best knowledge and belief correct for current
-ghostscript versions
-but I do not check all these statements for every new version.
-</para>
-
-<para>
-If you are in doubt about a particular point, please check it yourself.
-</para>
-
-</refsect2>
-
-<!--========================================================================-->
-
-<refsect2><title>Reliability</title>
-
-<para>
-Hewlett-Packard does not publicly provide sufficiently detailed or accurate
-technical information to write a reliable driver for all of its PCL-3+ printers.
-The amount and quality of available information differs between printer models.
-As a consequence,
-<command>pcl3</command> cannot provide the same level of reliability for all
-of its devices.
-</para>
-
-<para>
-In my opinion the best-documented printers are those of the DeskJet-500 series.
-In addition, I have currently access to a DeskJet 850C which I have used for a
-number of experiments.
-Support for these printers should be considered to be the most reliable.
-</para>
-
-<para>
-The next level of reliability belongs to the remaining printers for which
-subdevices exist.
-In these cases I had at least access to official HP documentation on supported
-media sizes and associated hardware margins
-and in addition for almost all cases some information on the supported PCL
-commands,
-sometimes complemented by PCL files generated by HP's official drivers and sent
-me by users.
-</para>
-
-<para>
-The third level of reliability is associated with those printers for which
-people have sent success reports
-but for which I have no official information from HP.
-</para>
-
-<para>
-With decreasing reliability it becomes increasingly probable
-that there is printer functionality which is not accessible through
-<command>pcl3</command> or
-even that this driver generates PCL code not accepted by the printer.
-</para>
-
-</refsect2>
-
-<!--========================================================================-->
-
-<refsect2><title>Mixed Resolutions</title>
-
-<para>
-Some printers are able to print with different resolutions for black and
-CMY on the same region of a page.
-For example, the best quality on a DeskJet 850C is achieved with 600 ppi for
-black and 300 ppi for CMY.
-This is not supported by <command>pcl3</command>.
-</para>
-
-</refsect2>
-
-<!--========================================================================-->
-
-<refsect2><title>Photo Cartridges</title>
-
-<para>
-From what I've heard, DeskJet printers with photo cartridges installed do not
-use a CMYK palette but instead one with 6 components.
-I have no official information on this interface
-and even if I had it wouldn't help because
-ghostscript does not currently support <literal>DeviceN</literal> as a
-native colour space.
-</para>
-
-</refsect2>
-
-<!--========================================================================-->
-
-<refsect2><title>Cartridge Alignment</title>
-
-<para>
-DeskJet printers with more than one ink cartridge present should usually be
-configured for the proper relative alignment of these cartridges.
-Apparently, this information is stored in not-immediately-volatile memory
-in the printer together with some settings (like the default media size)
-which are not relevant for printing with <command>pcl3</command>.
-As I do not have information on how this is done,
-you will need to use one of HP's programs for this purpose.
-</para>
-
-<para>
-On a Linux system, try installing and running HP's DOS DeskJet control panel
-<command>DJCP</command> in the DOS emulator.
-<command>DJCP</command> should be present on one of the installation media
-you received with your printer.
-One user managed to get this to work
-for a DJ 670C with DOSEMU 0.98 under RedHat 5.2 by setting
-<blockquote><programlisting>
-$_ports = "0x378 0x379"
-</programlisting></blockquote>
-in <filename>dosemu.conf</filename>.
-<!-- Mail from Swapneel Kore <swapneel@nuclear.mu.ac.in> on 1999-05-23. -->
-I was not successful on my Debian system.
-<!--
- DOSEMU 0.98.1 in Debian 2.1.
- I used (kernel 2.0.38):
- ports { device /dev/lp1 range 0x378 0x37f }
- DJCP sensed correctly whether the printer was switched on or not, but the
- printer did not react. Some (all?) print jobs ended in the spooler.
--->
-</para>
-
-<para>
-The <command>pcl3</command> distribution contains a file
-<filename>calign.ps</filename> which you can print if you wish to check
-to which extent the cartridges are aligned.
-</para>
-
-</refsect2>
-
-</refsect1>
-
-<!--************************************************************************-->
-
-<refsect1><title>KNOWN BUGS</title>
-
-<para>
-There are no known bugs in <command>pcl3</command> proper,
-but there do exist restrictions or bugs in <command>gs</command>
-which can lead to faulty behaviour when printing with <command>pcl3</command>.
-As far as I noticed them
-they are mentioned in the body of this manual page at the relevant points.
-</para>
-
-<para>
-You can find an up-to-date bug list for this driver via
-<command>pcl3</command>'s home page on the Web.
-</para>
-</refsect1>
-
-<!--************************************************************************-->
-
-<refsect1><title>SEE ALSO</title>
-
-<!-- I should like to use simplelist here, but docbook-to-man indents it
- which looks very ugly. -->
-<para>
-<!-- I should generate some links here in case of HTML output. But how? -->
-<citerefentry>
- <refentrytitle>gs</refentrytitle>
- <manvolnum>1</manvolnum>
-</citerefentry>,
-<citerefentry>
- <refentrytitle>pcl3opts</refentrytitle>
- <manvolnum>1</manvolnum>
-</citerefentry>
-</para>
-
-<!-- Note that DocBook 3.1 does not permit a bibliography in a refsect. -->
-
-<para>
-<ulink
-url="http://www.cs.indiana.edu/docproject/programming/postscript/postscript.html"
-><citetitle>A First Guide to PostScript</citetitle></ulink>
-<!-- URL last checked 2000-10-21. -->
-</para>
-
-<para>
-<corpauthor>Adobe Systems</corpauthor>,
-<ulink url="http://partners.adobe.com/asn/developer/PDFS/TN/PLRM.pdf"
-><citetitle>PostScript Language Reference</citetitle></ulink>.
-<!-- URL last checked 2000-05-26. -->
-Third edition, 1999.
-</para>
-
-</refsect1>
-
-<!--************************************************************************-->
-
-<refsect1><title>AUTHOR</title>
-
-<para>
-Copyright &copy; 2000, 2001 by Martin Lottermoser,
-Greifswaldstra&szlig;e 28, 38124 Braunschweig, Germany.
-E-mail:
-<email>Martin.Lottermoser@t-online.de</email>.
-</para>
-
-<para>
-<command>pcl3</command> has a
-<ulink url="http://home.t-online.de/home/Martin.Lottermoser/pcl3.html"
->home page</ulink> on the Web.
-</para>
-
-<para>
-This is free software,
-released under the terms of the
-<ulink url="http://www.gnu.org/copyleft/lesser.html"
->GNU Lesser General Public License (LGPL)</ulink>,
-<!-- URL last checked 2000-10-21. -->
-Version 2.1.
-<emphasis>USE IT AT YOUR OWN RISK.</emphasis>
-</para>
-
-<para>
-Version of this reference page: $Revision: 1.21 $
-($Date: 2001/08/18 17:19:29 $).
-</para>
-
-</refsect1>
-
-<!--************************************************************************-->
-</refentry>
diff --git a/gs/contrib/pcl3/doc/how-to-report.txt b/gs/contrib/pcl3/doc/how-to-report.txt
deleted file mode 100644
index 6eec3f1eb..000000000
--- a/gs/contrib/pcl3/doc/how-to-report.txt
+++ /dev/null
@@ -1,256 +0,0 @@
-*******************************************************************************
- File: @(#)$Id: how-to-report.txt,v 1.13 2001/08/01 05:36:37 Martin Rel $
- Contents: How to report bugs and hardware compatibility for pcl3
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany. E-mail: Martin.Lottermoser@t-online.de.
-
-*******************************************************************************
-* *
-* Copyright (C) 2000, 2001 by Martin Lottermoser *
-* All rights reserved *
-* *
-*******************************************************************************
-
-
-Bugs and Failures
-*****************
-This document distinguishes between "bugs" and "failures". A bug is incorrect
-behaviour on the part of pcl3, a failure is described by a set of
-hardware-relevant parameter values which are not accepted by a particular
-printer. Most often a failure is due to hardware limitations in the printer,
-not to a problem in pcl3, although it might be difficult to find out which is
-the case. For the user, this distinction is fortunately irrelevant.
-
-
-Bugs
-****
-The basic rule is that it's a bug if there is disagreement between the
-behaviour and the documentation (the bug might be in the documentation, though).
-For example, if the documentation states that pcl3 produces a core dump under
-certain circumstances, this is by definition not a bug, which means that you
-should not report it (I'll have to fix it nevertheless, of course).
-
-If your printer has a specific subdevice in pcl3 (e.g., if you have a
-Hewlett-Packard DeskJet 540, this is the "hpdj540" subdevice) and the result
-when using this subdevice is not accepted by the printer or there is printer
-functionality you cannot access through this subdevice, this is a bug.
-
-If you find a bug in pcl3, please report it. The format of your message is
-irrelevant, but the content should be sufficiently detailed that I can
-reproduce the behaviour. You should always specify the versions of gs and pcl3
-you used. Please make sure that the behaviour is due to pcl3 and not to other
-causes. In particular, if nothing seems to work and you are on a UNIX system,
-do the following:
-
- - Generate the PCL file by calling gs yourself, and print through a
- "raw"/"transparent" queue which does not modify the file.
- - If spooled printing fails, log in as root and try to send the file
- directly to the device file. If it works, the problem is in the spooler.
- - If even that fails, send a line of text (still as superuser) directly
- to the device, followed by a form feed:
-
- printf 'Hello!\r\n\f' > /dev/...
-
- If this also does not work, you very likely have a kernel or hardware
- problem.
-
-I am writing this because there have been cases where people complained that my
-driver wasn't working at all and where the cause turned out to be, e.g., a
-misconfiguration of the spooler. Please don't bother me with problems of this
-kind; I have enough to do correcting my own mistakes. However, I only demand
-that you take reasonable steps to ensure that it isn't you who has created the
-problem. If you can't decide which component is at fault, by all means contact
-me -- just don't expect a quick answer and don't start by telling me that my
-driver doesn't work :-).
-
-
-
-Hardware compatibility reports
-******************************
-The pcl3 driver is intended to support a large number of printers. Because the
-PCL-3 documentation supplied by Hewlett-Packard is incomplete and occasionally
-wrong (sometimes obviously so because of inconsistencies), tests must be made
-on various printers in order to discover whether the driver can really be used
-for a particular printer model and which parameter values one should specify.
-As I do not have access to a complete range of PCL-3 printers, I must rely on
-others to do this for me.
-
-If you have a PCL-3 printer and are using pcl3, please check the file
-reports.txt whether there is already an entry for your printer or not. If there
-is none or if the hardware-relevant parameters listed are different from the
-ones you used, please compose a report in the format described below and send
-it to me. You need not cover all possible combinations; in fact, this might be
-too confusing for others anyway. Even a single success report, however, can
-help someone else with less knowledge or experience to get started. This is a
-service *you* can provide to the community of pcl3 users.
-
-
-
-Guidelines for testing
-======================
-- Read the documentation. Please. :-)
-
-- As test files, use publicly available PostScript files, preferably those
- included in the ghostscript or pcl3 distributions. The file levels-test.ps in
- the latter is a good starting point.
-
-- Keep in mind that some environment variables influence ghostscript's
- behaviour and make sure their values are as intended.
-
-- If you have access to a manufacturer-endorsed driver for your printer, use
- it to generate some test files with various settings, analyse them with
- pcl3opts, and try the suggested option combinations first.
-
-- The basic hardware parameters to test are colour model, resolution, and the
- number of intensity levels.
-
- - Colour model: The interesting models are Gray, CMY, and CMY+K/CMYK,
- depending on your printer. You need not bother with CMY for a CMY+K or
- CMYK printer unless you discover that the CMY cartridge supports a
- higher resolution than the black cartridge.
-
- - Resolution: Check your printer's documentation first. It should at least
- list the highest supported resolution, possibly separately for black and
- colour printing. If you don't have access to the documentation, a good
- set to test with is {300, 600x300, 600, 1200}. Smaller resolutions
- ({75, 100, 150}) are sometimes also supported but they are uninteresting
- for serious printing.
-
- Resolution tests are best made with a file where only the top left corner
- of the sheet is used. It should contain some structure of known extension.
- If a resolution is not accepted, the printer usually prints the picture
- anyway, but at a supported resolution, leading to magnified or reduced
- output.
-
- - Intensity levels: Test this only if your printer's documentation claims
- that some kind of Resolution Enhancement (e.g., C-REt) is supported or
- pcl3opts tells you that an official driver generates files with this
- property. Unless pcl3opts tells you differently, start with 300 ppi and
- 4 levels for all colorants used.
-
- Whether a particular value for a parameter is supported often depends on
- the values for other parameters. In some cases, even the print quality is
- important. If in doubt, test with "presentation".
-
-- If your printer has special hardware functionality, tests for that are
- also interesting (duplex printing, banner printing, different input or
- output trays). If you are using "unspec" or "unspecold", you should also
- always try compression method 9 unless the pcl3 documentation states that it
- is not supported by your printer.
-
-
-
-General rules for reports
-=========================
-- You can use all characters in ISO 8859-1, plus HT and NL/LF.
-- Please keep to the following syntactic rules which simplify converting the
- information into other formats:
- - The report consists of a sequence of fields, each occupying an integral
- number of lines.
- - Each field begins with a field name, starting in column 1 and ending with
- the first following colon (':') in the same line.
- - The content of a field may be continued over several lines provided all
- continuation lines are either empty or indented with blanks (SP or HT).
- Trailing empty lines are ignored.
- - With the exception of "Success" and "Failure", every field may appear at
- most once in a report. If it appears a second time in a file, a new report
- is assumed to start at this point.
-- Make your report sufficiently detailed to be reproducible but don't tell us
- your life story.
-
-
-
-Special remarks for individual fields
-=====================================
-
-- "Name": Supply your full name here. I don't accept anonymous or obviously
- nickname-signed reports.
-
-- "E-mail address" (optional): choose a stable one, your information might be
- used for several years. Omit this field if you do not wish your e-mail
- address to be disclosed to other users of pcl3.
-
-- "Date": I prefer the internationally standardized notation, YYYY-MM-DD.
-
-- "Printer": Be as precise as possible in identifying the printer. Ideally,
- I should like to have the following kind of information (as an example
- I'm giving some values for a DJ 850C):
- - printer name ("HP DeskJet 850C")
- - manufacturer's model identification ("C2145A")
- - firmware revision ("9.20 02/14/95")
- At least some of Hewlett-Packard's printers issue this information when you
- print a diagnostic or self test. If your printer's manual doesn't tell you
- how to generate such a test, try sending the command "ESC z" to the printer
- (on a UNIX system, you can use "printf '\x1bz'" to generate it).
-
-- pcl3opts (optional): Use this field to describe pcl3opts's output if you ran
- pcl3opts on files generated by manufacturer-endorsed drivers and you have
- obtained interesting information. You should always describe the driver you
- used.
-
- Interesting information is for example that the official driver generated
- files with certain settings for which pcl3opts did not give a warning but
- nevertheless you were not able to print such a file with pcl3. Expect me to
- ask you for a copy of such a file.
-
-- "Media configuration file" (optional): If you used a media configuration file
- and its content was relevant for the test or you wish to make the file
- available to other users, include it or a reference to it here. You must
- state where the information came from, so it can be verified in case of
- discrepancies.
-
-- "Remarks" (optional): Use this, if needed, for global information applying
- to a number of tests (perhaps a summary) or any other relevant information.
-
-- "Success:" and "Failure": These are intended for describing the result of
- using a single option combination and may be repeated any number of times
- (including zero). Each report should be independent of the others so they can
- be sorted differently if needed.
-
- Keep in mind that the key purpose of a report is to find out which hardware
- parameters work and which don't. It is therefore a success if the driver is
- at least able to correctly tell the printer how to paint shapes at the level
- of the printer's hardware capabilities (resolution, colorants and
- intensities). A good test file is levels-test.ps which has been designed for
- this purpose. I don't count it a failure when the result of printing a
- photograph or a similarly demanding document is not as aesthetically pleasing
- as it should be or when a problem is due to a bug in ghostscript. Use
- comments for such statements if desired. However, the decision whether an
- entry is a success or a failure remains yours to make, not mine.
-
- These fields should start with the list of options given to ghostscript via
- the command line, including the "-sDEVICE" option. You should omit options
- which are obviously irrelevant for the outcome of the test (like "-dNOPAUSE"
- or "-sOutputFile"), but otherwise the option list must be complete. If you
- wish to add a comment (and for a failure you must always do that), terminate
- this list with a period followed by a newline and add the comment after that.
- Here's an example:
-
- Failure: -sDEVICE=pcl3 -r1200 -sColourModel=CMYK
- -sPrintQuality=best -sMedium=transparency.
- Printed at twice the size intended.
-
- The option list terminates immediately after "transparency" in this case.
- Note that you don't need backslashes here if you break the command line
- into several text lines.
-
- If you did something interesting in the PostScript file (like setting page
- device parameters to unusual values), append the PostScript code in the
- comment part or in the "Remarks" field.
-
-*****************<Start of form; cut here>*************************************
-
-Name: [your full name]
-E-mail address: [optional]
-Date: [YYYY-MM-DD]
-Printer: [at least manufacturer and model]
-Ghostscript version: [GNU or AFPL, version number]
-pcl3 version: [version number]
-pcl3opts: [optional; information on printer capabilities obtained by running
- pcl3opts on other drivers' output files]
-Media configuration file: [optional]
-Remarks: [optional; use, e.g., for global comments or a summary]
-Success: [options used, repeat any number of times]
-Failure: [options used, repeat any number of times. Don't forget to give your
- reason for classifying this as a failure (after terminating the options with
- a period followed by a newline).]
diff --git a/gs/contrib/pcl3/doc/notes.bbl b/gs/contrib/pcl3/doc/notes.bbl
deleted file mode 100644
index 5f7c13f0d..000000000
--- a/gs/contrib/pcl3/doc/notes.bbl
+++ /dev/null
@@ -1,70 +0,0 @@
-\begin{thebibliography}{10}
-
-\bibitem{PSSupplement2017}
-Adobe Systems Incorporated.
-\newblock {\em {PostScript} Language Reference Manual Supplement for
- Version~2017}, April 1996.
-\newblock Document ID: PN~LPS5217.
-
-\bibitem{PPD4.3}
-Adobe Systems Incorporated.
-\newblock {\em {PostScript} Printer Description File Format Specification,
- Version~4.3}, February 1996.
-\newblock Document ID: PN~LPS5003.
-
-\bibitem{PSSupplement3010}
-Adobe Systems Incorporated.
-\newblock {\em Supplement: {PostScript} Language Reference Manual
- (LanguageLevel 3 Specification and {Adobe} {PostScript}~3 Version~3010
- Product Supplement)}, October 1997.
-\newblock Document ID: 970028-006.
-
-\bibitem{PostScript3}
-{Adobe Systems Incorporated}.
-\newblock {\em {PostScript} Language Reference}.
-\newblock Addison-Wesley, Reading\slash Mas\-sa\-chu\-setts etc., 3rd edition,
- February 1999.
-\newblock First printing.
-
-\bibitem{PSSupplement3011}
-Adobe Systems Incorporated.
-\newblock {\em {PostScript} Language Reference Supplement: {Adobe}
- {PostScript}~3 Version~3010 and~3011 Product Supplement}, August 1999.
-\newblock Document ID: 28-007.
-
-\bibitem{Use5.50}
-L.~Peter Deutsch.
-\newblock {\em How to use Ghostscript}, September 1998.
-\newblock File {\tt Use.htm} in ghostscript 5.50.
-
-\bibitem{Drivers5.50}
-L.~Peter Deutsch.
-\newblock {\em The interface between Ghostscript and device drivers}, September
- 1998.
-\newblock File {\tt Drivers.htm} in ghostscript 5.50.
-
-\bibitem{Language5.50}
-L.~Peter Deutsch.
-\newblock {\em The relationship between Ghostscript and {PostScript}},
- September 1998.
-\newblock File {\tt Language.htm} in ghostscript 5.50.
-
-\bibitem{Drivers6.01}
-L.~Peter Deutsch.
-\newblock {\em The interface between Ghostscript and device drivers}, February
- 2000.
-\newblock File {\tt Drivers.htm} in ghostscript 6.01.
-
-\bibitem{hpdj}
-Martin Lottermoser.
-\newblock {\em hdpj: a Ghostscript Device Driver for PCL 3+}, October 1999.
-\newblock Version 2.6. See {\tt ftp://ftp.sbs.de\slash pub\slash graphics\slash
- ghostscript\slash pcl3\slash pcl3.html}.
-
-\bibitem{pcl3}
-Martin Lottermoser.
-\newblock {\em pcl3}, October 2000.
-\newblock Version 3.0. See {\tt http://home.t-online.de\slash home\slash
- Martin.Lottermoser\slash pcl3.html}.
-
-\end{thebibliography}
diff --git a/gs/contrib/pcl3/doc/notes.tex b/gs/contrib/pcl3/doc/notes.tex
deleted file mode 100644
index 33baebcae..000000000
--- a/gs/contrib/pcl3/doc/notes.tex
+++ /dev/null
@@ -1,2052 +0,0 @@
-%******************************************************************************
-% File: @(#)$Id: notes.tex,v 1.11 2001/02/24 06:00:16 Martin Rel $
-% Contents: Notes an writing a ghostscript device driver
-% This is a TeX file using the LaTeX package.
-% Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-% Germany. E-mail: Martin.Lottermoser@t-online.de.
-%
-%******************************************************************************
-%
-% Copyright (C) 2000, 2001 by Martin Lottermoser
-% All rights reserved
-%
-%******************************************************************************
-
-\documentclass[twoside,a4paper]{article}
-
-% Macros to extract RCS information
-\def\RCScontents$#1:#2 ${\ignorespaces#2}
-\def\RCSDate$#1: #2/#3/#4 #5${#2--#3--#4}
-
-% Extracted RCS information.
-\setbox0=\hbox{\RCScontents$Locker: $}
-\ifdim\wd0=0pt
- \edef\Revision{\RCScontents$Revision: 1.11 $}
- \edef\Date{\RCSDate$Date: 2001/02/24 06:00:16 $}
- \def\BottomInfo{Version \Revision}
-\else
- \edef\Revision{\RCScontents$Revision: 1.11 $+}
- \def\Date{\today}
- \def\BottomInfo{Version of \Date}
- \def\draft{}
-\fi
-
-% Title page information
-\author{Martin Lottermoser\cr
- {\tt Martin.Lottermoser@t-online.de}\cr
- Greifswaldstra{\ss}e 28\cr
- 38124 Braunschweig\cr
- Germany}
-\title{Notes on Writing a {\it Ghostscript\/} Device Driver for Printers}
-\date{Version \Revision\ (\Date)}
-
-% 25mm margins for A4
-\textwidth=160truemm
-\evensidemargin=-0.4truemm \oddsidemargin=\evensidemargin
-\topmargin=-0.4truemm
-\textheight=247truemm
-\advance\textheight by -\headheight
-\advance\textheight by -\headsep
-\advance\textheight by -\footskip
-
-% Page layout
-\pagestyle{myheadings}
-\makeatletter
-\markboth{\@title}{\@title}
-\def\@oddfoot{{\tiny\sl \BottomInfo\/}\hfil}
-\makeatother
-
-% Paragraph layout
-\setlength{\parindent}{0mm }
-\setlength{\parskip}{1.5mm plus 0.5mm minus 0.5mm }
-
-%******************************************************************************
-
-% Normal underscore
-\catcode`\_=\active
-\newcommand{\normalUS}{\catcode`\_=\active \def_{\char`\_}}
-\catcode`\_=8
-
-% My version of LaTeX does not know that cmtt has braces and substitutes them
-% from cmsy.
-\newcommand{\lb}{\char"7B}
-\newcommand{\rb}{\char"7D}
-
-% Abbreviations
-\newcommand{\gs}{\textit{ghostscript\/}}
-\newcommand{\Gs}{\textit{Ghostscript\/}}
-
-% Markup
-\newenvironment{note}{\begin{quote}\small}{\end{quote}}
-\newenvironment{program}{\begin{quote}
- \normalUS\ttfamily\obeylines\obeyspaces\parskip=0mm \parindent=0mm }%
- {\end{quote}}
-\newcommand{\ps}[1]{{\sffamily\bfseries #1}} % PostScript names in the text
-\renewcommand{\d}[1]{{\bfseries #1}} % definition of a concept or name
-\newcommand{\prog}[1]{\texttt{#1}}
-\newcommand{\file}[1]{\texttt{#1}} % file names
-
-\bibliographystyle{plain}
-
-\hyphenation{ghost-script}
-
-\newif\ifdraft \draftfalse
-\expandafter\ifx\csname draft\endcsname\relax\else \drafttrue \fi
-
-%******************************************************************************
-
-\begin{document}
-\maketitle
-
-\tableofcontents
-
-%******************************************************************************
-
-\section{Introduction}
-
-This document contains remarks which I consider useful for persons implementing
-a \gs\ device driver for printers.
-It is based on my experiences and in particular the mistakes I made in
-implementing the \textit{hpdj/pcl3\/} driver~\cite{hpdj,pcl3}.
-And yes, I have made lots of mistakes,
-and I do not guarantee anything about the accuracy of this document either.
-
-The topics covered in this document can be arranged in the following
-categories:
-\begin{itemize}
- \item Suggestions on how to approach the implementation of a \gs\ device
- driver
- \item Information which is in my opinion necessary for properly implementing
- a driver but which I could not find in \gs's documentation
- \item Information I have collected for convenience
- \item Parts which logically belong into the design documentation for
- the \textit{hpdj/pcl3\/} driver but which have wider applicability
-\end{itemize}
-
-As the title indicates,
-this is not an exhaustive introduction on how to write a \gs\ device driver.
-You will need to access other documentation as well
-(and, of course, do some thinking of your own),
-preferably before reading this paper.
-
-This document is still largely incomplete. %???
-
-%==============================================================================
-
-\subsection{The Most Important Advice on Writing a \Gs\ Device Driver}
-
-\begin{center}
- \bigskip
- \begin{picture}(120, 30)
- \put(60,15){\oval(120,30)}
- \put(60,15){\makebox(0,0){\hfil\Large\em Don't do it!\/\hfil}}
- \end{picture}
- \bigskip
-\end{center}
-
-You should disregard this advice only if all of the following conditions are
-true:
-\begin{itemize}
- \item You are prepared to spend a substantial amount of time on this task.
- \item You have or are prepared to acquire sufficient knowledge of PostScript
- to find relevant information in the
- {\it PostScript Language Reference\/}~\cite{PostScript3},
- hereafter abbreviated as ``PLR3''.
- You must know chapters~6 and~7 (excluding sections~6.3 and~7.1) pretty well.
- \item You either know \gs's internal APIs (in particular~\cite{Drivers6.01})
- and programming conventions or are prepared to learn them.
- (Obvious, of course, but I still thought I'd better mention it.)
- \item You can read large amounts\footnote{%
- % Aladdin gs 5.50: 243089 lines for *.c and *.h, 32914 for *.ps.
- % loc gave 168705 NLOC for *.c and *.h.
- \Gs\ has roughly 250,000~lines of C and 33,000~lines of PostScript
- code~[gs~5.50].}
- of source code (C and PostScript) written by another person and
- locate and understand those sections which are relevant to a problem you
- have encountered.
- If you wish to write a reliable driver,
- you will have to do this much more often than you expect.
- \item In view of in particular the amount of time you will have to spend and
- the amount of frustration you will experience,
- the driver you have in mind will offer new functionality which is worth
- this effort.
- I would not expect this to be the case unless you have a sufficiently large
- group of users.
-\end{itemize}
-If you conclude from this that my own experiences in writing \gs\ device
-drivers were not entirely pleasant, you are right.
-In particular,
-I have serious doubts about whether the result justifies the effort I put into
-it.
-This document is an attempt to improve the result-to-effort ratio by making
-my experience available to others.
-
-%==============================================================================
-
-\subsection{Restrictions}
-
-This document concerns itself only with printer drivers.
-By this I mean devices with the following properties:
-\begin{itemize}
- \item From the point of view of PostScript, we are dealing with a page device.
- \item Processing in the driver can be split into two phases:
- \begin{itemize}
- \item creating a rasterized representation (pixmap) of the entire page in
- memory,
- \item converting it into another format appropriate for a particular kind
- of hardware or software external to \gs, and
- sending the converted data to a file.
- \end{itemize}
- \item From the point of view of \gs, we are dealing with a device derived
- from the {\it prn\/} device.
-\end{itemize}
-
-%==============================================================================
-
-\subsection{Conventions}
-
-A word or group of words \d{in this type} has a special meaning.
-The meaning is sometimes explained at the point where the term is denoted in
-this manner,
-but the main purpose is to alert the reader to the existence of a special
-meaning connected with these words in the context of PostScript or \gs.
-
-A reference like ``[gs~$n.m$]'' accompanying a statement means that I have
-checked this statement to be true for \gs\ version~$n.m$.
-These are typically statements about bugs in \gs\ or
-information I could not find in \gs's documentation
-but which I obtained from the source code or by experiment.
-
-%******************************************************************************
-
-\section{General Approach}
-
-%==============================================================================
-
-\subsection{PostScript First}
-
-You should base your implementation on those properties of your driver which
-will be visible in PostScript.
-
-One reason is that \gs\ is changing fairly rapidly.
-Although some effort is made to remain backward-compatible,
-you cannot expect this to be always possible.
-If you base your design on PostScript concepts,
-the result is much more likely to be able to adapt easily to changes in \gs.
-The same applies in areas where \gs\ does not yet correctly or entirely support
-the PostScript language definition.
-
-The second reason is that the PostScript language is well documented and offers
-a reasonably broad range of concepts for you to use.
-A description of similar coverage at the level of \gs's driver API does not
-exist.
-You will have to fill conceptual gaps in the latter from the former.
-
-Finally, you should not dismiss the possibility that you might later want to
-write a similar driver for another PostScript interpreter.
-Everything which depends on PostScript only could then be reused unchanged,
-although I would expect this to happen more on the level of structure and
-concepts then with actual lines of code.
-
-%==============================================================================
-
-\subsection{Architecture}
-
-It is almost certain that you'll find that a large part of what you need to
-implement is entirely independent of the printer you wish to drive
-and could be used for other drivers as well.
-This is due to a gap between the functionality offered by the \gs\ kernel and
-the functionality needed by most printer drivers.
-This gap is only partly closed by the abstract \textit{prn\/} device
-and this has led to a certain amount of duplicated code in \gs\ drivers.
-
-One solution to this problem is to reuse code from another driver.
-This is easiest to do if this functionality has been implemented in terms of an
-abstract \gs\ device derived from the \textit{prn\/} device.
-Your driver can then use this device instead of \textit{prn\/} as its base
-device.
-The \textit{pcl3\/} driver contains such an intermediate component in the
-\textit{eprn\/} (``extended \textit{prn\/}'') device.
-Its implementation has about
-4700~brutto and 2400~netto lines of code. % pcl3 3.0.2
-This gives you an impression of the size of the functionality gap you would
-otherwise have to bridge on your own,
-although admittedly not everything implemented in \textit{eprn\/} is
-absolutely essential for every printer driver.
-
-Independent of whether \textit{eprn\/} suits your needs or not,
-you should always implement the universal part of your functionality
-in a reusable form.
-
-At the other end of your implementation you should consider encapsulating
-printer-specific routines in a form which is largely independent of \gs.
-This also makes it easier to reuse this code in other contexts.
-The correct level of abstraction for this API is almost certainly near the
-point where your driver has obtained a pixmap for the page to be printed and
-has to convert it into the printer's language.
-
-If you introduce these two layers of functionality,
-the ``real'' driver will just be the intermediate layer connecting these two.
-\begin{note}
- In the implementation of my \textit{pcl3\/} driver about
- 47~\% of the code belongs to the high-level \textit{eprn\/} device,
- 21~\% can be found in the printer-specific backend,
- and 32~\% are contained in the intermediate layer.
- % This is based on NLOCs. BLOC-based values are even better: 49%, 24%, and
- % 27%. This reflects the more extensive documentation I've provided in the
- % reusable parts.
- % (BLOC, NLOC) as of pcl3 3.0.2: (4658, 2361), (2263, 1084), (2620, 1616).
- This means that roughly two thirds of the code could be reused
- in other contexts!
-\end{note}
-
-%******************************************************************************
-
-\section{Properties of an Output Device in PostScript}
-
-%==============================================================================
-
-\subsection{Definition}
-
-A PostScript interpreter may support several \d{output devices}.
-A \d{page device} is a special kind of output device.
-Its state is characterized by \d{page device parameters}.
-
-The \d{current (output) device} is part of the graphics state and can be
-inspected with \ps{currentpagedevice}.
-A new page device can be selected by calling \ps{setpagedevice}%
- \footnote{%
- For devices which are not page devices, other methods have to be
- employed.
- The null device, for example, is installed by calling \ps{nulldevice}.}
-and passing the device name as a value for the \ps{OutputDevice} page device
-parameter.%
- \footnote{%
- This does work with \gs\ but it produces a drastically reduced page device
- dictionary without, e.g., \ps{HWResolution}~[gs~5.50, gs~6.50].
- The official \gs\ interface for switching output devices from PostScript
- is via the non-standard \ps{selectdevice} operator~\cite{Use5.50}.}
-This resets all page device parameters to the default values appropriate for
-the new device.
-
-%==============================================================================
-
-\subsection{Identity and Basic Properties}
-
-An output device is identified by its name.
-If the interpreter supports several output devices,
-the \ps{OutputDevice} resource category should contain an entry for each device,
-indexed by its name and listing the associated properties in an
-\d{output device dictionary}.%
- \footnote{\Gs\ does not list its available devices in the \ps{OutputDevice}
- resource category~[gs~5.50, gs~6.50].
- Furthermore, although defining an output device dictionary as an external
- resource makes it visible to \ps{resourcestatus} and \ps{findresource},
- \gs\ versions before~6.50 will not list it with \ps{resourceforall} unless
- you execute \ps{findresource} first~[gs~5.50, gs~6.01].
- This makes \ps{resourceforall} useless.
- However, you can obtain the list of supported devices from \gs's
- non-standard \ps{devicenames} operator.
- }
-Section~6.4 of PLR3 contains a list of these properties:
-\begin{itemize}
- \item media classes
- \item page sizes
- \item resolutions
- \item process colour models
- \item trapping details dictionary types
-\end{itemize}
-It is possible (but there is no corresponding statement in PLR3)
-that a PostScript program relies on the assumption that,
-if a value is listed as supported,
-it is supported independent of the values chosen for other parameters
-unless the meaning of the property in question restricts it explicitly to a
-particular situation (this is only the case for \ps{DeviceN}).
-This is a possible rule for separating output devices.
-
-Therefore, if you have constraints among the values you wish to support
-(e.g., \ps{DeviceGray} can be used at 600\,ppi but \ps{DeviceCMYK} is only
-possible at 300\,ppi),
-you should consider implementing these groups of unconstrained values
-in different output devices.
-This might be inconvenient, though,
-and I myself have usually disregarded this advice.
-
-%==============================================================================
-
-\subsection{Process Colour Models}
-
-PostScript defines six \d{process colour models}:
-\begin{quote}
- \ps{DeviceGray},
- \ps{DeviceRGB}, \ps{DeviceRGBK},
- \ps{DeviceCMY}, \ps{DeviceCMYK},
- \ps{DeviceN}.
-\end{quote}
-A process colour model defines the \d{colorants} used by a device.
-\ps{DeviceN} is a parameterized process colour model which has to be
-supplemented by an explicit list of colorants (page device parameter
-\ps{SeparationColorNames}).
-Normally each device has one \d{native process colour model},
-but it may support others.\footnote{
- For example, a monochrome device capable of producing separations might
- support the process colour model
- \ps{DeviceCMYK}~\cite[page~424]{PostScript3}.}
-
-Each process colour model has an underlying \d{native colour space}.
-Because some process colour models are based on the same colour space
-only the following four colour spaces act as native colour spaces:
-\begin{quote}
- \ps{DeviceGray},
- \ps{DeviceRGB},
- \ps{DeviceCMYK},
- \ps{DeviceN}.
-\end{quote}
-The colour spaces \ps{DeviceGray}, \ps{DeviceRGB}, and \ps{DeviceCMYK} are
-called \d{device colour spaces}.
-The colour space \ps{DeviceN} is \emph{not\/} a device colour space
-but one of the \d{special colour spaces}.
-
-Note that a designation like ``\ps{DeviceRGB}'' can therefore denote a
-colour space, a native colour space or a process colour model.
-You have to find out which before you will be able to correctly understand
-the statement containing such a name.
-
-%==============================================================================
-
-\subsection{Media Selection}
-
-\subsubsection{Media Sources}
-
-PostScript assumes the output device to have several \d{media sources},
-each identified by an integer (\d{position number}).
-You will have to decide how to associate these numbers with input trays or
-whatever your printer supports.
-
-Properties of the media currently present in a tray can be stored in the
-\ps{InputAttributes} dictionary in the page device dictionary and are
-accessed during \d{media selection}.
-
-If the printer is capable of providing information on the properties of media
-currently available in its input trays,
-\ps{InputAttributes} should therefore be initialized appropriately
-by the driver.
-
-%------------------------------------------------------------------------------
-
-\subsubsection{The Process}
-
-PostScript's media selection process composes an \d{input media request} from
-those among the page device parameters
-\ps{PageSize}, \ps{MediaColor}, \ps{MediaWeight}, \ps{MediaType},
-\ps{MediaClass}, and \ps{InsertSheet}
-which are not \ps{null} (some devices may add others) and
-tries to find a matching entry in \ps{InputAttributes}.
-Apart from \ps{MatchAll}, only those parameters which a device
-considers for inclusion in a media request should appear in an
-\ps{InputAttributes} entry.
-
-An entry in \ps{InputAttributes} \d{matches} the request if
-\begin{itemize}
- \item it contains matching entries (equal values, in the case of
- \ps{PageSize} with a tolerance of 5~bp) for all parameters in the
- request and
- \item either
- \begin{itemize}
- \item does not have a \ps{MatchAll} entry which is \ps{true} or
- \item does have a \ps{MatchAll} entry which is \ps{true} and
- does not contain any entries in addition to \ps{MatchAll} and those
- present in the media request.
- \end{itemize}
-\end{itemize}
-Formally, you can define a relation ``$\leq$'' between two media requests or
-\ps{InputAttributes} entries $a$ and~$b$ as follows:
-\begin{displaymath}
- a \leq b \quad :\Longleftrightarrow \quad
- \vtop{\advance\hsize by -4cm
- All parameters present in $a$ (except for \ps{MatchAll} in an
- \ps{InputAttributes} entry) are also present in~$b$ and have matching
- values.}
-\end{displaymath}
-The match rule can then be rephrased in the following manner:
-\begin{quote}
- An \ps{InputAttributes} entry~$e$ matches the input media request~$r$
- if and only if $r \leq e$
- except when \ps{MatchAll} is defined and \ps{true} in~$e$.
- In the latter case one needs $r = e$.
-\end{quote}
-A media request is therefore a set of minimal requirements a media source must
-satisfy in order for the document to be printed from that source.
-
-Exceptions are possible if no match is found,
-the \ps{Policies} dictionary permits ignoring at least one parameter in the
-request,
-and a matching request $r' < r$ can be formed.
-PLR3 demands that in this case the interpreter must set the ignored
-page device parameters to \ps{null}\footnote{%
- \Gs\ does not currently do it [gs~6.01].}.
-The only exception is \ps{PageSize} which will be set to the value present
-in the \ps{InputAttributes} entry selected.
-The state of the device thus becomes as if the document had originally
-requested~$r'$.
-
-%------------------------------------------------------------------------------
-
-\subsubsection{Selection Parameters Which are also Configuration Parameters}
-
-Let a ``configuration parameter'' be a page device parameter which influences
-the way the output device adapts to the medium,
-while a ``selection parameter'' is a parameter considered for inclusion in a
-media request.
-The 6~standard selection parameters can then be classified as follows:
-\begin{itemize}
- \item
- also a configuration parameter:
- \ps{PageSize},
- \ps{MediaClass},
- % Explicitly defined to be an "arbitrary string representing attributes
- % of the medium that may require special action by the output device"
- % (PLR3 p. 402).
- \item
- not a configuration parameter:
- \ps{InsertSheet},
- \ps{MediaType},
- \item
- possibly a configuration parameter:
- \ps{MediaColor} (probably not),
- \ps{MediaWeight} (probably yes).
-\end{itemize}
-
-If a particular selection parameter is also a configuration parameter,
-it must be set correctly for the medium chosen by the media selection process.
-Assuming the correct value to be non-null and disregarding the
-\ps{PageSize} parameter,
-this is the case if and only if the parameter is correctly specified in the
-\ps{InputAttributes} entry \emph{and\/} the documents requests the same value:
-\begin{itemize}
- \item
- If the parameter is not specified in \ps{InputAttributes} and a match
- results, the value in the page device dictionary will be \ps{null}.
- \item
- If the parameter is not correctly specified in \ps{InputAttributes},
- the parameter's value in the page device dictionary will either be this
- incorrect value or \ps{null}.
- \item
- If the parameter is correctly specified in \ps{InputAttributes},
- the document requests a different value,
- and a match results,
- the value will also become \ps{null}.
-\end{itemize}
-The \ps{PageSize} parameter is different because instead of being set to
-\ps{null} when the request cannot be satisfied it is set to the value
-belonging to the \ps{InputAttributes} entry chosen.
-In my opinion this behaviour would have been desirable for all
-configuration parameters considered for selection.
-
-I wish to draw two conclusions from this dicussion:
-\begin{itemize}
- \item
- If the output device uses a selection parameter for configuration,
- the interpreter should be configured such that the \ps{InputAttributes}
- entries contain the correct values
- and the \ps{Policies} dictionary should not permit the request to be
- ignored.
- \item
- As already mentioned in a footnote,
- \gs's behaviour with respect to non-matching parameters is not
- currently~[gs~6.01] PostScript-conforming,
- hence the preceding discussion does not really apply.
- However, I am not aware of any statement in the documentation that this
- was a deliberate implementation decision,
- hence this behaviour cannot be relied upon.
-
- Therefore I still conclude that
- a \gs\ device should not use selection parameters for configuration
- unless the driver can sense these media properties.
-
- The reason is that the typical execution environment for \gs\ is a
- single-user PC with a dedicated printer completely controlled by the user.
- If this user inserts media with properties the driver needs to know,
- it is unreasonable to require the parameter to be set in two places.
-\end{itemize}
-
-%------------------------------------------------------------------------------
-
-\subsubsection{User Interaction via \ps{Policies}}
-
-The user may set a policy code of~2 in the \ps{Policies} dictionary.
-This indicates that a mismatch should result in some kind of device-specific
-interaction with an external entity,
-for example asking a human operator to insert media of the size requested and
-waiting for confirmation.
-This is not supported by \gs\ and results in a
-\ps{configurationerror}~[gs~5.50] just as for a policy value of~0.
-Should it be implemented one day, this will hopefully be independent of
-the \gs\ device in question.
-You should therefore ignore this feature.
-
-%------------------------------------------------------------------------------
-
-\subsubsection{Automatic Switch to Manual Feed}
-
-A user might wish to tell the interpreter something like the following:
-``I have put A4 sheets into the input tray where they can be fed automatically,
-but I am prepared to feed certain other sizes manually''.
-The second part of this statement cannot be easily expressed in
-\ps{InputAttributes} for two reasons.
-
-The first and more important one is that you cannot request additional actions
-(like setting \ps{ManualFeed} to \ps{true}) to be performed automatically if a
-particular media source is selected and certain conditions are met.\footnote{%
- One might consider (mis)using the \ps{Install} procedure for this purpose
- provided it can determine which source has been selected.
- However, there is no standard way for that,
- and in addition PLR3 does not say whether it is permitted for
- \ps{Install} to call \ps{setpagedevice}.
- This is a problem because the latter calls \ps{Install} again.}
-The only choices I see are
-to make manual feed implicit in the media source by convention or
-to provoke a \ps{PageSize} mismatch.
-The first possibility must be supported by the driver,
-the second requires the user to choose a \ps{PageSize} recovery policy of~2,
-possibly combined with a \ps{PolicyReport} procedure setting \ps{ManualFeed} to
-\ps{true}.
-
-The second problem arises if ``certain other sizes'' refers to a list or range
-of page sizes.
-Lists can only be supported by distributing the individual sizes over several
-media sources one at a time,
-ranges are permissible with \gs~[gs~5.50] but not in standard PostScript.
-If you want to make it possible for the user to specify lists in this
-situation,
-you must reserve an unlimited set of position numbers for this
-special purpose.
-
-One possible solution to both problems is therefore to let the driver interpret
-all negative position numbers as meaning ``manual feed''.
-
-In deciding how to implement your driver you should, however,
-not forget that \ps{InputAttributes} only states which media are currently
-available according to the user.
-The driver still has to check whether the requested size is acceptable to the
-printer.
-This reduces the usefulness of specifying lists or ranges for manual feed.
-In fact, if one uses \gs's ability to accept a range for \ps{PageSize},
-a single position number with an implied manual feed is probably sufficient.
-This is definitely the case if the device supports custom page sizes in such a
-way that the total set of supported sizes can be expressed as a single
-connected range of media extensions.
-
-%==============================================================================
-
-\subsection{Setting up Default User Space} \label{PsUserSpace}
-
-The PostScript language asserts that default user space is set up in a certain
-manner in relation to the medium printed on.
-PostScript programs may rely on this relationship.
-Most printers, however, can neither control nor react to how the media have
-been put into their input trays.
-In what follows I assume that this is the case for the printer in question.
-
-Concerning the extension (height and width irrespective of orientation) of
-media,
-the \ps{PageSize} entry in the \ps{InputAttributes} dictionary is available for
-telling a PostScript interpreter about the media present in an input tray.
-This is, however, not sufficient for the interpreter to correctly set up
-default user space:
-even assuming a sheet to be unmarked and to have indistinguishable sides
-this merely reduces the 8~possibilities of putting it into the input tray to
-two inequivalent ways (unless it is a square sheet).
-They are usually described by reference to the feeding direction as
-``short edge first'' and ``long edge first''.
-Both lead to equivalent \ps{PageSize} entries in \ps{InputAttributes}.
-
-The implementation of a PostScript output device for such a printer must
-therefore be accompanied by rules stating what the ``right'' ways for putting
-media into input trays are.
-In order to prevent printing beyond the edges of a sheet,
-the minimum is to state whether the interpreter assumes media will be fed short
-edge first or long edge first.
-A more detailed rule would add a description of default user space on
-a sheet lying in the input tray.
-This enables the user in addition to reliably position the output with respect
-to matter already on the medium (e.g., a watermark).
-
-\begin{note}
- At least three versions of the {\it PostScript Language Reference
- Supplement\/}~\cite{PSSupplement2017,PSSupplement3010,PSSupplement3011}
- impose special rules
- for the location of default user space when printing on envelopes.
- In my opinion these rules are undesirable because they require
- \textit{the program generating a PostScript page\/} to know
- whether printing will be done on envelopes or on ordinary paper
- of the same size.
- As this has nothing to do with the layout of text within the page,
- the program should not need to know this.
- But even worse, the rules are chosen such that if one requests landscape
- orientation (which is usually desired for envelopes) the standard rule
- governing the behaviour of \ps{setpagedevice} (rotate by $+90^\circ$)
- actually produces output standing on its head when applied to an envelope
- having the flap along its longer edge!
-
- If, on the other hand, a printer has particular requirements for feeding
- envelopes and this does not produce the desired result when keeping to
- PostScript's default rules,
- the output device should deal with this problem, possibly triggered by a
- page device parameter or by imposing the rule that certain page sizes are
- always interpreted as envelopes.
-
- My advice is therefore to ignore these rules,
- but you should form your own conclusion based on your printer's requirements.
-\end{note}
-
-All this applies only to a default state for default user space.
-This state is characterized by requesting a page in portrait orientation
-($\hbox{width} < \hbox{height}$)%
- \footnote{It is also assumed that the size requested is available,
- otherwise the media selection process might influence the location and
- scale of default user space (\ps{PageSize} recovery policies~3 and~4).}
-and omitting requests for any of the page device parameters
-\ps{LeadingEdge}, \ps{Orientation}, \ps{ImageShift},
-\ps{PageOffset}, \ps{Margins}, \ps{Tumble}, \ps{MirrorPrint},
-and possibly others.
-The resulting structure on the sheet is sometimes called the
-\d{canonical page in portrait orientation},
-but you should think of this situation as the set of conditions
-under which the statement about the position of default user space
-on a sheet in the input tray is valid.
-
-Most of the parameters just mentioned are defined in terms of their effect
-with respect to this default orientation.
-For example,
-on receiving a \ps{PageSize} request for landscape orientation the interpreter
-must rotate default user space 90~degrees counterclockwise with respect to
-its position for portrait orientation and shift the origin into the
-new lower left corner.
-
-The parameter \ps{LeadingEdge} makes it possible for the user to tell the
-interpreter that a sheet has been put into the input tray in a non-standard
-way.
-Note that different devices can differ in which of the 4~possibilities is the
-default:
-for an interpreter assuming a short-edge orientation in the input tray it will
-be either~0 or~2,
-while a long-edge-oriented one will have~1 or~3 as its default.
-This argument can be reversed:
-specifying which of these values is the default assumed by the interpreter
-together with the information which side of the sheet will be printed on
-uniquely selects one of the 8 possible orientations in the input tray as the
-``right'' one for the default situation.
-
-The parameter \ps{Orientation} should only be supported by devices
-with media of continuously variable page sizes (printing to roll-fed media,
-screen displays or file formats):
-the values~1 and~3 cannot be supported on cut-sheet media,
-and the user can achieve the effect of~2 by choosing a \ps{LeadingEdge} value
-differing by~2 from its default.
-
-You must decide which of these parameters will be supported by your driver.
-Note that some are automatically available for every \gs\ device.
-
-%==============================================================================
-
-\subsection{Device Coordinates}
-
-The rules of PostScript about the relative positioning of default user space
-and the medium are intended to ensure that a PostScript program need not know
-about the device coordinate system.
-This information is, however, still accessible to the program:
-the operator \ps{defaultmatrix}, for example,
-returns the default transformation matrix for the device,
-and with this information a PostScript program can unambiguously determine the
-position of the device coordinate system with respect to default user space.
-Hence the following discussion indeed belongs under the heading of
-PostScript-visible properties of the output device.
-
-When writing your driver you must choose a device coordinate system.
-This is no problem; just do it.
-However, I am not aware of any statement in PLR3 which states that the
-device coordinate system is a fixed property of the output device.
-``Fixed'' in this context means ``fixed with respect to the feeding direction''
-or equivalently ``fixed with respect to the default of default user space''.
-If you therefore wish to switch your device coordinate system if the user
-requests landscape orientation or on any other occasion the user executes
-\ps{setpagedevice},
-this is perfectly legitimate.
-You might even do it in such a manner that \ps{defaultmatrix} returns the
-same value under all circumstances.
-This freedom is actually desirable,
-because it means that you can choose whatever convention for device coordinates
-is the simplest for you to implement depending on the current set of
-page device parameters.
-
-However, if you look at the description of the \ps{PageOffset} and \ps{Margins}
-parameters you'll find statements that for \ps{PageOffset}
-``the repositioning is typically accomplished by altering the current
-transformation matrix, although on some devices it may instead be accomplished
-by device-dependent means that are independent of the graphics state
-(in particular, of the CTM)''~\cite[page 415]{PostScript3} and that
-for \ps{Margins} the latter case is the typical one.
-(Incidentally, as both parameters have to be specified with respect to the
-direction of the axes of the device coordinate system,
-your driver's documentation should tell the user where these axes point to.)
-If your device coordinates are fixed with respect to the default default user
-space,
-you will have to modify the default transformation matrix,
-and conversely if you wish the influence of such parameters not to be visible
-in the CTM you must shift your device coordinates.
-
-Concerning \ps{PageOffset} and \ps{Margins} these discussions are, however,
-slightly academic because \gs\ implements these parameters for all devices
-and does it via modifications of the default transformation matrix
-in both cases~[gs~5.50].
-At least for \ps{Margins} you can easily override this behaviour but I wouldn't.
-
-%==============================================================================
-
-\subsection{Other Standard Page Device Parameters Describing Device
- Capabilities}
-
-The following page device parameters defined in PLR3 refer to special
-hardware functionality:
-\begin{quote}
- \ps{InsertSheet}, \ps{ManualFeed}, \ps{TraySwitch},
- various parameters for roll-fed media,
- \ps{Duplex},
- \ps{Collate}, \ps{Jog}, \ps{OutputFaceUp},
- \ps{MaxSeparations}, \ps{SeparationColorNames}.
-\end{quote}
-Absence of one of these parameters indicates that the feature is not
-supported by the device.
-The converse is not true.
-You will have to decide which of these features you can support.
-
-In addition, there exist also position numbers for media destinations
-(keys in \ps{OutputAttributes}),
-similar to the numbers for media sources.
-If your printer has several output destinations your driver should
-support them as well.
-
-%==============================================================================
-
-\subsection{Non-Standard Page Device Parameters}
-
-If your driver is going to offer functionality which cannot be expressed in
-terms of standard page device parameters,
-you will have to define new ones.
-
-You should take some care not to choose parameter names which can collide with
-other definitions.
-At the least you should check the current edition of the
-{\it PostScript Language Reference Supplement\/}~\cite{PSSupplement3011}
-in order to find out whether there is already a semi-standard parameter
-for this functionality or one having the intended name but another meaning.
-
-%******************************************************************************
-
-\section{General Properties of a \Gs\ Device}
-
-Unless there is an explicit reference to a different version,
-everything which follows in this and subsequent sections is based on
-\gs\ version 5.50.
-
-%==============================================================================
-
-\subsection{Definitions}
-
-A \gs\ device driver defines one or more \d{ghostscript devices}.
-A ghostscript device is identified by its name (1~to~8 letters, digits or
-underscores, starting with a letter~\cite{Drivers5.50}\footnote{%
- These restrictions are probably the combined result of restrictions from
- the C~language and from some file systems.
- Effectively, this means that you can ignore at least the length restriction
- on almost all platforms.}) and characterized by a
-C~variable which must be called {\tt gs\_\textit{name}\_device}.
-% No italic correction for "name" here; it looks worse.
-This is the \d{device structure instance},
-its type is the \d{device structure}.
-The device structure instance is a prototype for the data structure
-(\d{device instance}, sometimes also called \d{driver instance})
-which is actually used when a device is installed in the graphics state.
-
-\ifdraft
-??? Forwarding device, band device,
-life cycle (at which point in a multi-function open call is the device open?
-Will partially opened devices be closed?)
-\fi
-
-%==============================================================================
-
-\subsection{Relation to Output Devices}
-
-There is a one-to-one correspondence between ghostscript devices and
-PostScript output devices supported by \gs.
-
-Technically, this can be inconvenient if your driver implements lots of
-different output devices and you do not wish to clutter \gs's device list
-with all these names.
-In that case you should introduce sub-devices based on particular parameter
-values.
-My \textit{hpdj\/} driver for example uses \texttt{hpdj} as the device name but
-in addition selects a particular printer model with the
-page device parameter \ps{Model}.
-As the latter determines which process colour models and page sizes are
-supported by the driver,
-this parameter in fact distinguishes between output devices within one
-ghostscript device.
-
-If you choose to implement such sub-devices you should try to simulate the
-behaviour of \ps{setpagedevice} for \ps{OutputDevice}
-(initialization with default values)
-whenever the output device is changed.
-Your \prog{put\_params} implementation should therefore check for the
-sub-device-changing parameters first.
-However, you should only reset those parameters which the user can override.
-%??? This does not apply to the resolution when set from the
-% command line [gs~6.01].
-
-%==============================================================================
-
-\subsection{Device Structure}
-
-\ifdraft
-??? Dynamic memory
-\fi
-
-%------------------------------------------------------------------------------
-
-\subsubsection{Device Procedures}
-
-Among the variables in the device structure are several dealing with functions:
-\begin{itemize}
- \item The \prog{static\_procs} variable points to a static table of
- type \prog{gx\_device\_procs} containing pointers to functions.
- It is common to all device instances of the same type.
- \item \prog{page\_procs} is of type \prog{gx\_page\_device\_procs}.
- This is a table of pointers to functions peculiar to page devices.
- \item The \d{device procedure table} \prog{procs} is also of
- type \prog{gx\_device\_procs}
- (but not a pointer to that type as \prog{static\_procs} is).
- The entries in this table (or the functions pointed to) are the
- \d{device procedures}.
-\end{itemize}
-
-The function \prog{gx\_device\_set\_procs()} checks whether
-\prog{static\_procs} is \prog{NULL} or not. % gsdevice.c
-If it is not,
-the table pointed to is copied over \prog{procs} and
-\prog{static\_procs} is set to \prog{NULL}.
-
-More important, however, is that almost all \prog{NULL} entries in the
-device procedure table are overwritten with default values.
-This is done by \prog{gx\_device\_fill\_in\_procs()}.
-It first calls \prog{gx\_device\_set\_procs()}
-and then replaces null entries for all device procedures except
-\prog{fill\_rectangle}~[gs~5.50].\footnote{
- The entries for \prog{image\_data} and \prog{end\_image} are always
- overwritten with non-null default values
- even if they are non-null to begin with.}
-
-The list of device procedures is frequently growing.
-In \gs\ version~5.50 this table has 43~entries.
-Check the definition of \prog{gx\_device\_proc\_struct()} in \file{gxdevcli.h}
-for the current list.
-
-A device procedure should be called by using the \prog{dev\_proc()} macro:
-it takes a pointer to a device instance and the name of a device
-procedure table field as arguments and is expanded into the entry in the
-device procedure table.
-
-While entries in \prog{*static\_procs} may not change,
-the device procedures in \prog{procs} can change during a device's lifetime.
-The macro \prog{set\_dev\_proc()} is intended for this purpose.
-%???
-%The \textit{prn\/} device, for example,
-%sets a number of device procedures for rendering when the device is opened
-%(\prog{gdev\_prn_\allocate()}) and restores the old values when the device is
-%closed (\prog{gdev\_prn\_tear\_down()}).
-
-%==============================================================================
-
-\subsection{\Gs\ Devices in PostScript}
-
-\subsubsection{Type, \Gs\ Initialization and State}
-
-\Gs\ introduces a new basic type \ps{devicetype} for representing ghostscript
-device (structure) instances.
-Instances of this type are composite objects. % See 'ref_type' in iref.h.
-
-% See gs_init.ps.
-On initialization,
-\gs\ repeatedly executes the \ps{.getdevice} operator to obtain
-all known device structure instances.
-It then creates a dictionary \ps{devicedict} in \ps{systemdict} containing
-for each device an array of length~2;
-the first entry is the device structure instance, % from 'gx_device_list[]'
-the second is \ps{null}\footnote{
- Actually, the PostScript initialization code sets the second entry to be
- \ps{null} if the device is not writable and
- makes it a copy of the first if it is.
- However, the implementation of \ps{.getdevice} (\prog{zgetdevice()})
- always returns a read-only object~[gs~5.50]. % See zdevice.c.
- % Also tested with gs 5.50 and gs 5.10 binaries.
- }.
-Entries in \ps{devicedict} have the string returned by \ps{.devicename} as a
-key (\prog{dname} field in the device structure). % See zdevice.c.
-
-The device instance current in the graphics state
-can be obtained with the operator
-\ps{currentdevice} implemented in \prog{zcurrentdevice()}.
-
-%------------------------------------------------------------------------------
-
-\subsubsection{Switching Devices}
-
-The procedure \ps{selectdevice} calls first \ps{finddevice} and then
-\ps{setdevice}. % Actually, it also calls \ps{.setdefaultscreen}.
-
-The procedure \ps{finddevice} looks into \ps{devicedict} to find a device by
-its name and checks the second entry in the array.
-If it is \ps{null},
-the entry is replaced by the result of \ps{copydevice} applied to the first
-entry.
-In all cases, this second entry is returned.
-
-\ifdraft
-??? TEST: What happens on multiple selection?
-\fi
-
-\ps{copydevice} is a \gs\ operator implemented in \prog{zcopydevice()}.
-% See zdevice.c.
-The latter calls \prog{gs\_copydevice()} % gsdevice.c
-which allocates storage for a new device instance,
-calls \prog{gx\_device\_init()} and sets the device variable \prog{is\_open}
-to \prog{false}.
-The function \prog{gx\_device\_init()} copies the source device instance
-storage into the new instance with the exception of the \prog{memory} variable.
-
-The procedure \ps{setdevice} calls the operator \ps{.setdevice} implemented
-in \prog{zsetdevice()}. % zdevice.c
-This function calls \prog{gs\_setdevice\_no\_erase()} and clears the
-underlying page device. % macro clear_pagedevice()
-
-\ifdraft
-??? What happens with the old device?
-\fi
-
-The function \prog{gs\_setdevice\_no\_erase()} first checks whether the device
-is already open.
-If not, it calls \prog{gx\_device\_fill\_in\_procs()} and the
-\prog{open\_device} device procedure and finally it sets \prog{is\_open = true}.
-Then it calls \prog{gs\_setdevice\_no\_init()}, \prog{gs\_initmatrix()} and
-\prog{gs\_initclip()}.
-
-\prog{gs\_setdevice\_no\_init()} sets the colour mapping procedures
-in the graphics state from the device's colour mapping procedures
-(calling \prog{gx\_set\_cmap\_procs()}).
-
-%******************************************************************************
-
-\section{\Gs\ Device Parameters}
-
-The variables in a device instance determine the values of its
-\d{device parameters}.
-These parameters are a subset of the
-page device parameters of the corresponding PostScript output device.
-The connection between the two and the way in which the device parameters may
-be accessed is an area where \gs's documentation is particularly reticent.
-
-%==============================================================================
-
-\subsection{Parameter Dictionaries}
-
-A device parameter is identified by a string, its name.
-If a device supports a particular parameter,
-it associates a typed value with this name.
-\Gs\ has an internal API for dealing with collections of such name-value pairs.
-
-%------------------------------------------------------------------------------
-
-\subsubsection{Types for Parameters}
-
-The name of a parameter is of type \prog{gs\_param\_name}
-which is defined as \prog{const char~*}.
-
-Each parameter has a type associated with it which is stored in an instance
-of type \prog{gs\_param\_type}:
-\begin{program} % gsparam.h
-typedef enum \lb
-\ /* Scalar */
-\ gs_param_type_null, gs_param_type_bool, gs_param_type_int,
-\ gs_param_type_long, gs_param_type_float,
-\ /* Homogenous collection */
-\ gs_param_type_string, gs_param_type_name,
-\ gs_param_type_int_array, gs_param_type_float_array,
-\ gs_param_type_string_array, gs_param_type_name_array,
-\ /* Heterogenous collection */
-\ gs_param_type_dict, gs_param_type_dict_int_keys, gs_param_type_array
-\rb\ gs_param_type;
-\end{program}
-In addition, there is a macro \prog{gs\_param\_type\_any} which resolves to
-an expression of this type and which can be used to denote any type.
-
-\ifdraft
-???
-What is the concept of ``type'' here? PostScript, C, a mixture of both?
-Add description of collections.
-\fi
-
-The type \prog{gs\_param\_value} is used to store values of parameters.
-It is a \prog{union} of the following C~types:
-\begin{quote}
- \prog{bool}, \prog{int}, \prog{long}, \prog{float},
- \prog{gs\_param\_string}, % twice
- \prog{gs\_param\_int\_array}, \prog{gs\_param\_float\_array},
- \prog{gs\_param\_string\_array}, % twice
- \prog{gs\_param\_collection}
-\end{quote}
-
-Finally, the type \prog{gs\_param\_typed\_value} combines a type description
-with a value:
-\begin{program} % gsparam.h
- typedef struct gs_param_typed_value_s \lb
- \ gs_param_value value;
- \ gs_param_type type;
- \rb\ gs_param_typed_value;
-\end{program}
-
-%------------------------------------------------------------------------------
-
-\subsubsection{Type and Operations for Parameter Collections}
-
-A \d{parameter dictionary} represents an unordered collection of
-instances of type \prog{gs\_param\_typed\_value}
-and is of the C~type \prog{gs\_param\_list}
-% (also known as \prog{struct gs\_param\_list\_s})
-or of a type having the same initial storage layout as this type.
-This is the same convention as used to simulate type inheritance for
-device structures:
-\prog{gs\_param\_list} should be
-considered as an abstract base class defining access routines for
-parameter dictionaries
-while its derived types provide implementations for the routines and storage
-for the parameters.
-This abstract interface is declared in \file{gsparam.h}.
-
-Concrete implementations of this abstract interface are the following types:
-\begin{quote}\begin{flushleft}
- \prog{gs\_c\_param\_list}, % gsparam.h
- \prog{dict\_param\_list}, % iparam.h
- \prog{array\_param\_list}, % iparam.h
- \prog{stack\_param\_list}, % iparam.h
- \prog{printer\_param\_list\_t} % gdevpsdf.c
-\end{flushleft}\end{quote}
-The only one of interest to implementors of device drivers is
-\prog{stack\_param\_list} because it is used to represent objects on the
-operand stack.
-\ifdraft
-??? More about it later?
-\fi
-
-There exists a macro \prog{gs\_param\_list\_common} to obtain the list of
-declarations common to all parameter dictionary types.
-It resolves to:
-\begin{program}
- const gs_param_list_procs *procs;
- gs_memory_t *memory; % Actually, the semicolon is not part of the macro.
-\end{program}
-The \prog{procs} member points to a table of pointers to the
-implementation's access methods.
-This table contains the following members\footnote{
- I am not aware of any official description for the semantics or behaviour of
- these functions at the level of abstraction for \prog{gs\_param\_list};
- the comments in \file{gsparam.h} are insufficient for this purpose.
- These descriptions are therefore heavily based on the actual implementation
- for \prog{iparam\_list} which is an abstract type between
- \prog{gs\_param\_list} and a number of concrete implementations
- including \prog{stack\_param\_list}.
- }:
-\begin{itemize}
- \item \prog{int (*xmit\_typed)(gs\_param\_list *, gs\_param\_name,
- gs\_param\_typed\_value *);}
-
- This routine is used to ``transmit'' a value.
- This means either to put a value into the dictionary (writing)
- or to extract it (reading).
- Which direction is chosen depends on the function pointed to,
- i.e., unless you modify this pointer you can either read or write the
- parameter dictionary but not both.
-
- A reading implementation of \prog{xmit\_typed} returns zero if the
- parameter value was successfully extracted,
- one if the parameter does not exist,
- and a negative value on error.
- A writing implementation returns zero or one on success and
- a negative value on error.
-
- The reading implementation of \prog{xmit\_typed} for
- \prog{stack\_param\_list} % Actually, for 'iparam_list'.
- keeps track of which parameter was accessed and what the result was.
- % See comments in iparam.h and the 'results' field in 'iparam_list'
- % [gs 5.50].
-
- \ifdraft
- ??? Discuss selective writing.
- \fi
- \item \prog{int (*signal\_error)(gs\_param\_list *, gs\_param\_name, int);}
-
- This routine is used to associate an error code (the last argument) with
- the parameter designated.
- A parameter dictionary can for example store this code in the list together
- with the parameter's value.
- The function must \emph{never\/} be called for a
- non-existent parameter [gs~5.50].
- % Looking at iparam.c, this should give a core.
-
- This routine is in particular intended to be used by functions extracting
- values from a parameter dictionary and discovering that
- the type is incorrect or the value is outside the permissible range.
- \item \prog{int (*commit)(gs\_param\_list *);}
-
- This function is used to perform some final processing after extracting
- all interesting values from a parameter dictionary.
- It can for example check that all the parameters present have been
- extracted,
- i.e., that there are no unknown parameters left in the dictionary.
- % ref_param_read_commit() does this if it has been requested.
- % If there are undefined parameters, their 'result' codes are set to
- % 'e_undefined'.
-
- The routine returns zero on success and a negative value on error.
- \item \prog{int (*next\_key)(gs\_param\_list *, gs\_param\_enumerator\_t *,
- gs\_param\_key\_t *);}
-
- This routine is useful for debugging because it can be used to iterate over
- all entries in a parameter dictionary.
- The second argument points to an iterator which stores the last position
- accessed;
- it must have been initialized by calling
- \prog{void param\_init\_enumerator(gs\_param\_enumerator\_t *)} before
- the first call to this function.
- The third argument
- (the type is an alias for \prog{gs\_param\_string}) % gs 6.50
- will receive the name of the next parameter if there is
- one (return code is zero),
- otherwise the return code is~1 (no more parameters) or negative (error).
- \item In addition, there are the members
- \prog{begin\_xmit\_collection},
- \prog{end\_xmit\_collection},
- \prog{request},
- \prog{requested},
- and
- \prog{get\_policy}.
-\end{itemize}
-
-%------------------------------------------------------------------------------
-
-\subsubsection{Interface for Drivers}
-
-The methods in parameter dictionaries are not particularly interesting
-from the point of view of writing a driver,
-but there are some functions on top of this interface which are.
-
-
-\paragraph{Reading.}
-
-For reading a value from a parameter dictionary, the basic routine is:
-\begin{program}
-int param_read_requested_typed(gs_param_list *, gs_param_name,
-\ gs_param_typed_value *);
-\end{program}
-This function expects a requested type to have been filled into the
-\prog{type} field of the entry pointed to be the third argument.
-It calls the \prog{xmit\_typed} function.
-If the latter returns a non-zero exit code, this code is returned.
-Otherwise the function checks for a mismatch between the requested and
-the actual type
-and tries to convert between the two if necessary and possible.
-For example, if the actual parameter is of type \prog{gs\_param\_type\_int}
-its value can also be extracted as \prog{gs\_param\_type\_long}
-or \prog{gs\_param\_type\_float}. % See param_coerce_typed().
-If the types do not match,
-a value of \prog{gs\_error\_typecheck} is returned.
-Otherwise the result is returned via the \prog{value} field in the
-third argument.
-
-There is a macro \prog{param\_read\_typed()} which effectively calls
-\prog{param\_read\_requested\_typed()} with the value
-\prog{gs\_param\_type\_any} and
-can be used to fetch a parameter value irrespective of its type.
-The \prog{type} field in the third argument will contain the actual type.
-
-Implemented on top of \prog{param\_read\_requested\_typed()} there are several
-functions \prog{param\_read\_\textit{type}()} which request and return a value
-of a specific type.
-For an \prog{int}, the routine is:
-\begin{program}
-int param_read_int(gs_param_list *, gs_param_name, int *);
-\end{program}
-These functions should be used in preference to the others.
-
-
-\paragraph{Writing.}
-
-For writing a parameter there is a macro \prog{param\_write\_typed()} which
-should be called as if it were the following function:
-\begin{program}
- int param_write_typed(gs_param_list *, gs_param_name,
- \ gs_param_typed_value *);
-\end{program}
-The macro is mapped to a call to \prog{xmit\_typed} and returns its return code.
-
-Again there is a layer of type-specific functions on top of this basic
-interface.
-For an \prog{int}, the routine is:
-\begin{program}
-int param_write_int(gs_param_list *, gs_param_name, const int *);
-\end{program}
-These functions should be preferred.
-
-
-\paragraph{Other Functions.}
-
-The macros \prog{param\_signal\_error()}, \prog{param\_commit()} and
-\prog{param\_get\_next\_key()}
-can be called as if they were the following functions:
-\begin{program}
-int param_signal_error(gs_param_list *, gs_param_name, int);
-int param_commit(gs_param_list *);
-int param_get_next_key(gs_param_list *, gs_param_enumerator_t *,
-\ gs_param_key_t *);
-\end{program}
-They call the dictionary's \prog{signal\_error}, \prog{commit} and
-\prog{next\_key} routines, respectively.
-
-%==============================================================================
-
-
-\subsection{The Parameter Device Procedures}
-
-To be described. % ???
-
-%==============================================================================
-
-\subsection{Default Parameters}
-
-\subsubsection{All Devices}
-
-The function \prog{gx\_default\_get\_params()} writes the following
-parameters into the parameter list it received as an argument~[gs~5.50]:
-% See gsdparam.c and gxdevcli.h.
-\begin{quote} % ??? Find a better solution.
- \normalUS
- \def\a{$^*$} % asterisk
- \halign{\quad\prog{#}\hfil\quad& \prog{#}\hfil\quad&
- \vtop{\raggedright\hsize=5cm #\strut}\hfil\cr
- % ??? Improve baseline distance.
- \omit\quad Name\hfil & \omit Type and device variable or value\hfil &
- Remarks\cr
- \noalign{\smallskip\nointerlineskip
- \hbox{\dimen0=\hsize \advance\dimen0 by -2em
- \quad \vrule depth 0.4pt height 0pt width \dimen0}
- \smallskip}
- .HWMargins\a& float HWMargins[4]&\cr
- .IgnoreNumCopies\a& bool IgnoreNumCopies&\cr
- .MarginsHWResolution& float MarginsHWResolution[2]&\cr
- .MediaSize\a& float MediaSize[2]&\cr
- BitsPerPixel& int color_info.depth&\cr
- BlueValues& (int)(color_info.max_color + 1)&
- only set if \prog{color\_info.num\_components} is larger than 1.\cr
- ColorValues& (long)(1L << color_info.depth)&
- only set if \prog{color\_info.num\_components} is larger than 1.\cr
- Colors& int color_info.num_components& \cr
- GraphicsAlphaBits& int&
- a value returned by the device procedure \prog{get_alpha_bits}\cr
- GrayValues& (int)(color_info.max_gray + 1)&\cr
- GreenValues& (int)(color_info.max_color + 1)&
- only set if \prog{color\_info.num\_components} is larger than 1.\cr
- HWColorMap& & returned as a string\cr % ???
- HWResolution\a& float HWResolution[2]& \cr
- HWSize\a& float [2]&
- initialized with \prog{width} and \prog{height} (in this order)\cr
- ImagingBBox\a& \textrm{null or} float ImagingBBox[4]&
- the type depends on \prog{bool ImagingBBox_set}\cr
- Margins\a& float Margins[2]& \cr
- Name& const char *dname& treated as a string\cr
- NumCopies\a& \textrm{null or} int NumCopies&
- only read or written if \prog{NumCopies\_set} is not negative.
- The null value is returned if \prog{NumCopies\_set} is zero.\cr
- OutputDevice& const char *dname& treated as a name\cr
- PageCount& long PageCount& \cr
- PageSize\a& float MediaSize[2]&
- only set if \prog{PAGESIZE_IS_MEDIASIZE} was defined during
- compilation which it is~[gs~5.50].\cr
- ProcessColorModel& \vtop{\raggedright\hsize=5cm
- \textrm{a name derived from
- \prog{color\_info.num\_components},
- see section~\ref{NativeColourSpaces}}\strut}\hfil\cr
- RedValues& (int)(color_info.max_color + 1)&
- only set if \prog{color\_info.num\_components} is larger than 1.\cr
- TextAlphaBits& int&
- a value returned by the device procedure \prog{get_alpha_bits}\cr
- }
-\end{quote}
-
-The function \prog{gx\_default\_put\_params()} reads the same parameters from
-its arguments list,
-but copies only some of them into the device instance.
-These writable parameters are marked with an asterisk in the preceding list.
-The others are accessed in order to check that they are defined at all,
-that they have the right type or that their value satisfies certain constraints.
-For example,
-\ps{PageCount} must be defined and
-be either \ps{null} or a \prog{long} value agreeing with the value present
-in the \prog{PageCount} field in the device instance.
-
-In addition the default put procedure also accesses \prog{\%MediaSource} and
-\prog{\%MediaDestination} but only to check that these parameters have values
-of integer type.
-
-Before \prog{gx\_default\_put\_params()} actually modifies any parameters it
-calls \prog{param\_commit()} for the parameter list after having called all
-the necessary routines for reading the known parameters
-into temporary variables.
-If the commit routine returns a negative value,
-processing terminates without making changes in the device structure.
-
-%------------------------------------------------------------------------------
-
-\subsubsection{The \textit{prn\/} Device}
-
-The function \prog{gdev\_prn\_get\_params()} first calls
-\prog{gx\_default\_get\_params()} and then writes the following parameters
-into the parameter list it received as an argument:
-\begin{quote} % ??? Find a better solution.
- \normalUS
- \def\a{$^*$}
- \halign{\quad\prog{#}\hfil\quad& \prog{#}\hfil\quad&
- \vtop{\raggedright\hsize=5cm #\strut}\hfil\cr
- % ??? Improve baseline distance.
- \omit\quad Name\hfil & \omit Type and device variable or value\hfil &
- Remarks\cr
- \noalign{\smallskip\nointerlineskip
- \hbox{\dimen0=\hsize \advance\dimen0 by -2em
- \quad \vrule depth 0.4pt height 0pt width \dimen0}
- \smallskip}
- BandBufferSpace& long space_params.band.BandBufferSpace& \cr
- BandHeight& int space_params.band.BandHeight& \cr
- BandWidth& int space_params.band.BandWidth& \cr
- BufferSpace& long space_params.BufferSpace& \cr
- Duplex\a& \textrm{null or} bool Duplex&
- only read or written if \prog{Duplex\_set} is not negative.
- A null value is returned if \prog{Duplex\_set} is zero.\cr
- MaxBitmap& long space_params.MaxBitmap&\cr
- OpenOutputFile\a& bool OpenOutputFile&\cr
- OutputFile\a& char fname[]& treated as a string\cr
- ReopenPerPage\a& bool ReopenPerPage&\cr
- }
-\end{quote}
-The function \prog{gdev\_prn\_put\_params()} accesses the same parameters
-as \prog{gx\_default\_get\_params()}
-and finally calls \prog{gx\_default\_put\_params()}.
-Only those parameters marked with an asterisk, however,
-are usually copied into the device instance.
-The others will be copied only
-if the field \prog{space\_params.params\_\-are\_\-read\_\-only} is \prog{false}
-(then they must also satisfy some constraints),
-otherwise their values must agree with those in the device instance.
-
-In addition the put function also accesses
-\prog{InputAttributes} and \prog{OutputAttributes}
-and checks that they are dictionaries if defined.
-
-%==============================================================================
-
-\subsection{The Basic Access Routines in PostScript}
-
-A device's parameters can be read with \ps{getdeviceprops} and modified by
-\ps{putdeviceprops}~\cite{Language5.50}.
-The first is based on the operator \ps{.getdeviceparams},
-the second on \ps{.putdeviceparams}.
-
-%------------------------------------------------------------------------------
-
-\subsubsection{Reading}
-
-The operator \ps{.getdeviceparams} accepts either a \ps{null} value or a
-dictionary of keys\footnote{Values are simply duplicates of the keys.}.
-In the second case, only the specified device parameters are fetched.
-The operator puts a mark object on the stack and on top of it the
-names and values of those parameters which it could find.
-If the caller requested a parameter which cannot be found
-that request will be ignored without indicating an error.
-
-\ifdraft
-??? CHECK
-\fi
-
-This operator is implemented in \prog{zgetdeviceparams()} which calls
-\prog{zget\_device\_params()},
-a function introduced to reduce duplicate code.
-% See zdevice.c.
-This function first prepares an instance of type \prog{stack\_param\_list}
-by connecting it with the operand stack
-and then calls \prog{gs\_get\_device\_or\_hardware\_params()} for the device
-with this list.
-
-\ifdraft
-??? Discuss selection.
-\fi
-
-The function \prog{gs\_get\_device\_or\_hardware\_params()} calls
-\prog{gx\_device\_set\_procs()},
-supplies default values for some device procedures if necessary,
-and finally passes the parameter list to the \prog{get\_params} procedure.
-
-%------------------------------------------------------------------------------
-
-\subsubsection{Writing}
-
-The operator \ps{.putdeviceparams} is implemented in \prog{zputdeviceparams()}.
-Its behaviour with respect to unrecognized keys has to be requested as
-either to ignore them or to generate an \ps{undefined} error
-(as \ps{putdeviceprops} does).
-
-The implementation first prepares an instance of type \prog{stack\_param\_list}
-and then calls \prog{gs\_put\-device\-params()} for the device
-with this list.
-If the return code is negative (error), the function returns.
-Otherwise, some special processing is done under certain circumstances
-and finally the macro \prog{clear\_\-page\-device()} is called for the graphics
-state.
-
-\ifdraft
-??? Add description of error processing for undefined values.
-\fi
-
-The function \prog{gs\_putdeviceparams()} calls
-\prog{gx\_device\_set\_procs()},
-supplies default values for some device procedures if necessary,
-and then calls the \prog{put\_params} procedure with the parameter list.
-The return code from \prog{gs\_putdeviceparams()} is the code returned by the
-device procedure provided it is negative or the device was closed before the
-call or it is still open afterwards;
-otherwise (no error and the device was open before and is closed afterwards)
-the return code is always~1.
-
-%==============================================================================
-
-\subsection{Connection with Page Device Parameters}
-
-%------------------------------------------------------------------------------
-
-\subsubsection{The Implementation of \ps{currentpagedevice}}
-
-The procedure \ps{currentpagedevice} first calls the operator
-\ps{.currentpagedevice} which is implemented in \prog{zcurrentpagedevice()}.
-If the current device is a page device or acts as a forwarding device
-for a page device,
-this function returns the dictionary parameter \prog{pagedevice} from
-\gs's graphics state.
-
-If the dictionary returned is empty, \ps{currentpagedevice}
-creates a new dictionary from all
-parameters returned by \ps{.getdeviceparams} for the page device plus
-the following ``required attributes''~[gs~5.50]:
-\begin{quote}
- % See definition of .requiredattrs in gs_setpd.ps.
- \ps{PageOffset},
- \ps{InputAttributes},
- \ps{\%MediaSource},
- \ps{OutputAttributes},
- \ps{\%MediaDestination},
- \ps{Install},
- \ps{BeginPage},
- \ps{EndPage},
- \ps{Policies}.
-\end{quote}
-The default values for these parameters are overridden if \ps{.getdeviceparams}
-returns values for them.
-% Remark in gs_setpd.ps 5.50, line 199-200:
-% In case of duplicate keys, .dicttomark takes the entry
-% lower on the stack, so we can just append the defaults here.
-Before returning the resulting dictionary,
-\ps{currentpagedevice} also calls \ps{.setpagedevice} (\prog{zsetpagedevice()})
-which sets \prog{pagedevice} in the graphics state.
-
-If, on the other hand, \ps{.currentpagedevice} returns a dictionary of non-zero
-length,
-\ps{currentpagedevice} creates and returns a new dictionary constructed from
-this and the current values for \ps{.MediaSize} and \ps{PageCount}.
-% Definition of .dynamicppkeys in gs_setpd.ps.
-If your driver modifies other device parameters except as requested through
-\ps{setpagedevice},
-these modifications will therefore not be visible in PostScript.
-
-\ifdraft
-??? Describe when the data are refreshed.
-\fi
-
-%------------------------------------------------------------------------------
-
-\subsubsection{The Implementation of \ps{setpagedevice}}
-
-\ifdraft
-\Gs's implementation of \ps{setpagedevice} is fairly complex.
-This document lists only some of its properties,
-the reader should check the file \file{gs\_setpd.ps} for details.
-
-???
-\else
-To be described.
-\fi
-
-%==============================================================================
-
-\ifdraft
-\subsection{???}
-
-CLI, overriding, multiple access, \prog{Duplex\_set} problem.
-\fi
-
-%******************************************************************************
-
-\section{Pages and Media}
-
-\subsection{Device Coordinates} \label{DevCoord}
-
-\Gs's documentation~\cite[section ``Coordinates and types'']{Drivers5.50}
-gives the impression that a driver can choose any location for the origin
-and orientation of its device coordinate system provided coordinate values
-fit into an \prog{int}.
-This is misleading.
-
-Printer drivers based on the \textit{prn\/} device use an internal
-pixmap-generating device (a ``memory'' or a ``command list'' device)
-for scan conversion.
-The device coordinate system for this pixmap uses $x$-values in the range
-$[0, \hbox{width}-1]$ and $y$-values in the range $[0, \hbox{height}-1]$.
-% ??? Reference.
-The width and height values are set from the page size and the resolution
-(see \prog{gx\_device\_set\_width\_height()}) % gsdevice.c
-and are available in the device instance as the \prog{width} and \prog{height}
-fields.
-Anything falling outside this area is clipped. % Where? ???
-This clipping happens in addition to the clipping established at PostScript
-level.
-Therefore you should never put your device coordinate origin in the interior
-of the imageable area or outside of the page area.
-It also means that the imageable area must be contained in the page area:
-the \textit{prn\/} device cannot support ``Extra''
-sizes~\cite[Appendix~B]{PPD4.3}.\footnote{
- A better way would have been to set width and height from page size,
- resolution and the hardware margins.
- Not only would this have achieved support for ``Extra'' sizes via negative
- margins,
- it would also almost certainly have forced \gs\ to interpret hardware margins
- with respect to device space (see section~\ref{HardwareMargins}).}
-
-Where a driver's device coordinate system is located on the printed page
-depends on where the driver puts the pixels from the pixmap.
-It extracts these values by calling one of the following functions to obtain
-one or more scan lines (all $x$~pixels for one $y$~value,
-$x = 0$ lying in the first byte of the scan line):
-\begin{quote}
- % Checked with gs 5.50.
- \tt\raggedright \parindent=-2em \advance\leftskip by 2em
- \noindent\kern-2em
- int gdev\_prn\_copy\_scan\_lines(gx\_device\_printer *pdev, int y,
- byte *str, \penalty-5 uint size);
-
- int gdev\_prn\_get\_bits(gx\_device\_printer *pdev, int y,
- byte *str, \penalty-5 byte **actual\_data);
-\end{quote}
-
-In most cases the printer's native I/O~interface for raster data
-will print a small group of pixel lines,
-clear its memory for the next group
-and advance the paper by the distance covered.
-It will not usually be possible to move backwards.
-Hence the first pixel line sent is the one closest to the medium's
-\d{leading edge},
-that edge which enters the printer first.\footnote{
- Ah, you noticed the logical gap?
- Well, if you find a printer which feeds paper with one edge first and
- then starts printing from one of the other edges,
- send me a message and I'll be surprised.}
-It is also to be expected that the printer prints the pixel line entirely,
-starting at the left margin of the imageable area and proceeding to the right.
-A convenient position for the device coordinate system is therefore
-with the origin in the top left corner\footnote{
- ``Top'' is defined as where the first pixel line is printed (leading edge),
- and ``left'' is the edge to the left if you hold the sheet with the
- leading edge up and the printed side towards you.}
-of the imageable area,
-the $x$~axis pointing to the right and the $y$~axis downwards.
-The driver can then extract scan lines from the pixmap in the order of
-increasing~$y$,
-does not need to reverse the order of pixels within the line,
-and need not insert or remove pixels at the beginning of raster lines.
-With the choice of device coordinates as just described
-the leading edge is then the edge close to the $y = 0$ line in device space.
-
-It is occasionally helpful to distinguish explicitly between the two systems
-of device coordinates:
-pixmap device coordinates are fixed with respect to the pixmap
-(I call this the \d{pixmap device space})
-and the ``real'' device coordinates should be thought of as being attached to
-the sheet printed.
-The relation between them is established by the driver's source code and the
-printer's native I/O~interface.
-When programming for \gs\ you usually deal with pixmap device space,
-except when setting up the default user space.
-
-%==============================================================================
-
-\subsection{Device Space and Default User Space}
-
-Having fixed the relation between the pixmap's device coordinates and the
-printer's interface you still have to set up the default matrix to establish
-the correct relation between default user space and
-(``real'') device coordinates.
-
-%------------------------------------------------------------------------------
-
-\subsubsection{The \ps{defaultmatrix} Operator}
-% Description derived from gs 5.50, checked with gs 6.50.
-
-\Gs\ implements \ps{defaultmatrix} in \prog{zdefaultmatrix()} % zmatrix.c
-which calls \prog{gs\_defaultmatrix()}.
-The latter function first checks whether the parameter \prog{ctm\_default\_set}
-in the graphics state is set or not. % See gscoord.c.
-If it is, the function returns the value of \prog{ctm\_default} in the
-graphics state.
-If it is not set,
-the function obtains the current device from the graphics state,
-calls \prog{gs\_deviceinitialmatrix()} for this device,
-and performs an additional shift of the coordinate system based on the
-values for the \prog{Margins} array in the device instance:
-\begin{program}
- pmat->tx +=
- \ dev->Margins[0] * dev->HWResolution[0] / dev->MarginsHWResolution[0];
- pmat->ty +=
- \ dev->Margins[1] * dev->HWResolution[1] / dev->MarginsHWResolution[1];
-\end{program}
-
-The function \prog{gs\_deviceinitialmatrix()} % gsdevice.c
-first checks whether the
-device procedure \prog{get\_initial\_matrix} has been filled in or not
-and inserts \prog{gx\_default\_get\_initial\_matrix()} in the procedure list
-if not.
-It then calls the device procedure \prog{get\_initial\_matrix}.
-
-Looking from default user space,
-the default procedure \prog{gx\_default\_get\_initial\_matrix()} returns a
-matrix putting the origin in the top left corner of the page,
-the $x$~axis pointing to the right and the $y$~axis downwards.
-% See gdevdflt.c.
-
-The graphics state parameter \prog{ctm\_default} is set in
-\prog{gs\_setdefaultmatrix()} only. % gscoord.c
-This function in turn is called only from \prog{zsetdefaultmatrix()} which
-is the implementation of the \ps{.setdefaultmatrix} operator.
-This operator is always (and usually only) called during execution of
-\ps{setpagedevice} with the value of the CTM valid
-after the possible execution of the \ps{Install} procedure.
-
-This is the connection between \ps{defaultmatrix} and the
-\prog{get\_initial\_matrix} device procedure.
-One implication of this relation is that,
-if \ps{setpagedevice} is called at least once,
-the default matrix will remain fixed until the next call to
-\ps{setpagedevice}.\footnote{
- Note that at least one function of the \gs\ kernel
- (\prog{gx\_default\_clip\_box()})
- calls the \prog{get\_initial\_matrix} procedure directly
- instead of calling \prog{gs\_deviceinitialmatrix()} [gs~6.50].
- I have not investigated whether this could have unwanted consequences.}
-
-The conclusions to be drawn from this are the following:
-\begin{itemize}
- \item You need to write your own \prog{get\_initial\_matrix} procedure only
- if the device coordinate origin is not in the upper left corner of the
- page area as seen from default user space.
- \item The driver should not change the default CTM except when
- \ps{setpagedevice} is called.
-
- This means that all parameters the \prog{get\_initial\_matrix} procedure
- needs to define default user space should be changed only in the
- \prog{put\_params} device procedure.
- \item Your implementation of \prog{get\_initial\_matrix} should ignore
- \prog{Margins} and any transformation already taken care of in
- \ps{setpagedevice} (like \ps{PageOffset}).
-\end{itemize}
-
-\ifdraft
-??? Discuss the soft-tumble problem and its solution.
-\fi
-
-%------------------------------------------------------------------------------
-
-\subsubsection{The Imageable Area and the Device Coordinate Origin}
-\label{HardwareMargins}
-
-The imageable area of a ghostscript device is described by the \prog{HWMargins}
-device variable.
-This is an array of four \prog{float}s,
-interpreted as distances in~bp from the edges of the page.\footnote{
- The ``canonical margin order'' in \gs, used for several such variables,
- is: left, bottom, right, and top,
- but this does not tell you which coordinate system defines these directions.
- This documentation is missing for several other device structure fields
- which require a reference system for their interpretation.
- In the case of \prog{HWMargins} one apparently has to look from default user
- space (see \prog{gs\_initclip()} in \file{gspath.c}).
- In contrast, the standard \texttt{*HWMargins} parameter in PPD files
- is explicitly defined with respect to the
- feeding direction~\cite[page~114]{PPD4.3}.}
-These values can be set by calling:
-\begin{program}
- void gx_device_set_margins(gx_device *dev, const float *margins,
- \ bool move_origin);
-\end{program}
-If you specify \prog{true} for \prog{move\_origin},
-\gs\ will in addition use the left and top margin values to set the
-\prog{Margins} array in such a manner that
-the device coordinate origin will be in the top left corner of the imageable
-area.
-As explained in section~\ref{DevCoord},
-the resulting effect is usually desirable.
-However, the way used to achieve it is wrong:
-the \prog{Margins} array contains the value of the \ps{Margins} page device
-parameter which was introduced to compensate for mechanical misalignments
-in a device.
-I take this to mean that a value of zero means that no misalignment exists,
-a contradiction with the situation achieved by
-\prog{gx\_device\_set\_margins()}.
-Of course one could tell the user that
-when setting \ps{Margins} s/he should take the imageable area into account,
-but this becomes a nuisance if the imageable area depends on the
-page size.
-This is for example the case for Hewlett-Packard's DeskJet printers.
-
-If you want to position your device coordinate origin in the top left corner
-of the imageable area and to leave \ps{Margins} with its standard meaning,
-you will therefore have to implement the desired shift of the device coordinate
-origin in your driver's \prog{get\_initial\_matrix} device procedure.
-This procedure will need to know the top and left margins in device space.
-
-%------------------------------------------------------------------------------
-
-\subsubsection{Landscape Orientation}
-
-As explained in section~\ref{PsUserSpace},
-the PostScript language requires that
-if a user requests landscape orientation
-(a \ps{PageSize} value with $\hbox{width} > \hbox{height}$ in a
-\ps{setpagedevice} request)
-the output device must rotate default user space by $+90^\circ$ with respect
-to portrait orientation for the same medium.\footnote{
- I would not consider this rule to be binding for an output device printing
- on media of continuously variable dimensions.
- In particular, it is certainly inappropriate for a screen viewer and for most
- if not all file formats.
- But the behaviour is essential for every device printing on
- media of discrete sizes.}
-However, the only ghostscript drivers I know of which actually do it are
-\textit{cljet5\/}~[gs~5.50] and my own \textit{hpdj/pcl3\/} driver.
-% I have done an automated check on most of the 137 devices present in gs 5.10
-% as compiled for Debian 2.1 (package gs 5.10-1). The exceptions were the
-% screen and file devices lvga256, vgalib, cgmmono, cgm8, and cgm24. The only
-% device where an exchange of width and height in the PageSize device parameter
-% led to a defaultmatrix with a different orientation was hpdj (cljet5 was not
-% among the devices compiled into the excutable).
-% Incidentally, hpdj is capable of this only since hpdj 2.2 but at least gave
-% an error message before that.
-% I have also searched through the gs 5.50 source code for drivers which set
-% their own get_initial_matrix() device procedure. I found
-% mem_get_initial_matrix(), clj_get_initial_matrix(), pm_get_initial_matrix(),
-% win_dib_get_initial_matrix(), and x_get_initial_matrix(). Only
-% clj_get_initial_matrix() treats rotation.
-% In addition, I have looked for the string "landscape" (irrespective of
-% upper/lower case) and found nothing suggestive except in the MS Windows
-% viewer gdevwpr2.c where it says: "...does try to set the printer page size
-% from the PostScript PageSize, but it isn't working reliably at the moment".
-
-Your driver can determine that landscape orientation has been requested by
-examining the \prog{MediaSize[]} array.
-It contains the requested page size in~bp with respect to default user
-space.\footnote{
- This interpretation is not documented with the variable's definition
- but can be deduced from the fact that it receives the value of the
- \ps{PageSize} page device parameter (\prog{gx\_default\_put\_params()}).}
-If it is a case of landscape orientation
-($\hbox{\prog{MediaSize[0]}} > \hbox{\prog{MediaSize[1]}}$),
-you must include a rotation by $+90^\circ$ in your \prog{get\_initial\_matrix}
-device procedure and you must modify the \prog{width} and \prog{height}
-fields appropriately.
-
-Unfortunately, \gs's functions \prog{gx\_device\_set\_width\_height()},
-\prog{gx\_device\_set\_resolution()} and \prog{gx\_device\_set\_media\_size()}
-all assume that device space and default user space have the same notion about
-what is ``vertical'' and what is ``horizontal''.
-Hence you must update \prog{width} and \prog{height} directly and guard against
-some other instance calling any of these functions and producing inappropriate
-values.
-The only reliable way I know for this
-is to check for this condition in the \prog{open\_device} device procedure and,
-if necessary, to reassign \prog{width} and \prog{height} there.
-Doing this requires reallocation of storage in the \textit{prn\/} device.
-
-\ifdraft
-??? Problem of the initial matrix routine having the necessary information
-\fi
-
-The same problems arise if your driver supports the \ps{LeadingEdge} page
-device parameter because in that case arbitrary orientations of default user
-space with respect to device space are possible.
-
-%==============================================================================
-
-\subsection{Media Sources and Destinations}
-
-\Gs~[gs~5.50] sets the page device parameters \ps{\%MediaSource} and
-\ps{\%MediaDestination} to the position numbers determined for media source and
-media destination respectively
-during the process of media selection.
-
-If your driver supports different media sources or destinations,
-its \prog{put\_params} routine should fetch the values of these parameters.
-
-\Gs\ does support the \ps{MediaPosition} page device parameter for
-media selection~[gs~5.50, gs~6.01],
-but not by default as a device parameter
-(i.e., you must set it with \ps{setpagedevice}, not from the command line),
-and you can't use it to select negative position numbers
-(this gives a \ps{rangecheck}~[gs~6.01]).
-
-%==============================================================================
-
-\ifdraft
-\subsection{To be Discussed} %???
-
-media sizes, InputAttributes
-\fi
-
-%******************************************************************************
-
-\section{\Gs's Colour Treatment}
-
-%==============================================================================
-
-\subsection{Native Colour Spaces} \label{NativeColourSpaces}
-
-\Gs\ does not support \ps{DeviceN} as a native colour space~[gs~5.50].
-The other three possible spaces are supported;
-this information is encoded in the \prog{color\_info.num\_components}
-device parameter
-which can be \prog{1} for \ps{DeviceGray},
-\prog{3} for \ps{DeviceRGB} and \prog{4} in the case of \ps{DeviceCMYK}.
-
-Note that \prog{gx\_default\_get\_params()} returns these colour space names
-as the value of the device parameter
-\ps{ProcessColorModel} which will be inappropriate if the device uses, e.g.,
-the process colour model \ps{DeviceCMY}.
-Your driver cannot correct this because
-\prog{gx\_default\_put\_params()} signals an error if this
-page device parameter has another value than the native colour space name
-belonging to the current \prog{color\_info.num\_components} value.
-% Source code inspection in gs 5.50.
-
-%==============================================================================
-
-\ifdraft
-
-\subsection{Internal Colour Representation}
-
-\subsubsection{Colour in the Native Colour Space}
-
-Colour specifications in a PostScript program can be given in any of the
-supported colour spaces.
-They are then converted into the native colour space as specified by the
-PostScript language definition.
-This part is standard and results in certain real numbers
-in the range $[0, 1]$.
-
-??? What are the device colours? Where does \gs\ apply transfer functions?
-
-For \gs, these
-\prog{color\_info.num\_components} floating point numbers are first
-converted into instances of type \prog{frac},
-an integer type % (\prog{short}~[gs~6.50]) % gxfrac.h
-with the range zero to
-$f_1 := 32760 = 2^3 \times 3^2 \times 5 \times 7 \times 13$.
-This value is chosen in order to be able to represent
-``almost all common fractions'' % gxfrac.h [gs 6.50]
-of~1 exactly.
-The conversions between \prog{float} and \prog{frac} are defined as follows:
-\begin{program} % gxfrac.h in gs 5.50 and 6.50
- \#define frac_1 ((frac)0x7ff8)
- \#define frac_1_float ((float)frac_1)
- \#define frac2float(fr) ((fr) / frac_1_float)
- \#define float2frac(fl) ((frac)(((fl) + 0.5 / frac_1_float) * frac_1_float))
-\end{program}
-Assuming infinite precision for floating point arithmetic,
-the conversion from a \prog{float}~$x$ to a \prog{frac}~$f$ is therefore
-simply:
-$$
- f = \left\lfloor x f_1 + {1 \over 2} \right\rfloor
-$$
-Looking at the pre-images of the possible results we find that
-this map divides the interval $[0, 1]$ into $f_1 + 1$~pieces of unequal length:
-the first and the last piece have length $1 / 2 f_1$,
-the others have length $1/f_1$.
-
-\ifdraft
-??? Discuss the resulting problems, present the correct solution.
-\fi
-
-???
-are then converted into \d{(device) colour values},
-instances of type \prog{gx\_color\_value}.
-This is an unsigned integer type
-(at present, it is \prog{unsigned short}~\cite{Drivers6.01}),
-and the conversion maps zero to zero and one to
-the value of the macro \prog{gx\_max\_color\_value}\footnote{
- This is equal to $2^{\hbox{\prog{gx\_color\_value\_bits}}} - 1$
- where \prog{gx\_color\_value\_bits} is
- $8 \times \hbox{\prog{sizeof(gx\_color\_value)}}$ [gs~6.50].}.
- % gxcvalue.h
-
-%------------------------------------------------------------------------------
-
-\subsubsection{???}
-
-??? gx\_color\_index, depth
-
-%------------------------------------------------------------------------------
-
-??? mapping functions (what is called depending on the native colour space)
-
-%==============================================================================
-
-\subsection{Intensity Rendering}
-
-??? \Gs's dithering implementation, 3 possibilities
-
-%==============================================================================
-
-\subsection{Process Colour Models}
-
-??? Example for DeviceCMY.
-
-\fi % draft
-
-%******************************************************************************
-
-\addcontentsline{toc}{section}{\numberline{}References}\nobreak
-\bibliography{Informatik,ghostscript}
-
-%******************************************************************************
-
-\end{document}
diff --git a/gs/contrib/pcl3/doc/pcl3opts.1 b/gs/contrib/pcl3/doc/pcl3opts.1
deleted file mode 100644
index 841e26809..000000000
--- a/gs/contrib/pcl3/doc/pcl3opts.1
+++ /dev/null
@@ -1,104 +0,0 @@
-...\" $Header: /usr/src/docbook-to-man/cmd/RCS/docbook-to-man.sh,v 1.3 1996/06/17 03:36:49 fld Exp $
-...\"
-...\" transcript compatibility for postscript use.
-...\"
-...\" synopsis: .P! <file.ps>
-...\"
-.de P!
-.fl
-\!!1 setgray
-.fl
-\\&.\"
-.fl
-\!!0 setgray
-.fl \" force out current output buffer
-\!!save /psv exch def currentpoint translate 0 0 moveto
-\!!/showpage{}def
-.fl \" prolog
-.sy sed -e 's/^/!/' \\$1\" bring in postscript file
-\!!psv restore
-.
-.de pF
-.ie \\*(f1 .ds f1 \\n(.f
-.el .ie \\*(f2 .ds f2 \\n(.f
-.el .ie \\*(f3 .ds f3 \\n(.f
-.el .ie \\*(f4 .ds f4 \\n(.f
-.el .tm ? font overflow
-.ft \\$1
-..
-.de fP
-.ie !\\*(f4 \{\
-. ft \\*(f4
-. ds f4\"
-' br \}
-.el .ie !\\*(f3 \{\
-. ft \\*(f3
-. ds f3\"
-' br \}
-.el .ie !\\*(f2 \{\
-. ft \\*(f2
-. ds f2\"
-' br \}
-.el .ie !\\*(f1 \{\
-. ft \\*(f1
-. ds f1\"
-' br \}
-.el .tm ? font underflow
-..
-.ds f1\"
-.ds f2\"
-.ds f3\"
-.ds f4\"
-.ta 8n 16n 24n 32n 40n 48n 56n 64n 72n
-.TH "PCL3OPTS" "1" "" "pcl3 3.2"
-.SH "NAME"
-pcl3opts \(em determine options for the ghostscript driver \fBpcl3\fP from a PCL-3+ file
-.SH "SYNOPSIS"
-.PP
-\fBpcl3opts\fP [\fB-o \fIoutput_file\fP\fP] [\fIinput_file\fP \&...]
-.SH "DESCRIPTION"
-.PP
-The command \fBpcl3opts\fP
-is intended to help in determining which options one should use when
-calling ghostscript using \fBpcl3\fP for driving a PCL-3+ printer\&.
-It analyzes one or more PCL \fIinput_files\fP
-and issues on the \fIoutput_file\fP
-its best guess as to which options one should specify in order to produce
-files using a similar configuration\&.
-The default \fIoutput_file\fP is standard output\&.
-If no \fIinput_files\fP are specified,
-the command reads from standard input\&.
-.PP
-This command is mostly of interest if you have access to PCL files generated by
-software provided by the printer\&'s manufacturer,
-for example if you have a manufacturer-supplied
-Microsoft Windows driver for your printer\&.
-In that case you can generate a few files under Windows using different
-settings and let \fBpcl3opts\fP examine them\&.
-.SH "LIMITATIONS"
-.PP
-Note that \fBpcl3opts\fP
-cannot guarantee that the collection of options it proposes leads to a file
-which is understood by the printer\&.
-It can merely provide a best guess\&.
-.PP
-In addition, some settings require interpretation of the page contents
-in order to properly translate them into options for \fBpcl3\fP
-and some cannot reliably be derived from a PCL file at all\&.
-Finding good values for these parameters is beyond
-\fBpcl3opts\fP\&'s capabilities\&.
-This includes \fBLeadingEdge\fP, \fBSendBlackLast\fP,
-\fBTumble\fP and the distinction between the colour models
-\fBCMY+K\fP and \fBCMYK\fP\&.
-.SH "SEE ALSO"
-.PP
-\fBgs-pcl3\fP\fB(1)\fP
-.SH "AUTHOR"
-.PP
-Copyright © 2000, 2001 by Martin Lottermoser,
-Greifswaldstraße 28, 38124 Braunschweig, Germany\&.
-E-mail: Martin\&.Lottermoser@t-online\&.de\&.
-.PP
-Version of this reference page: $Revision: 1\&.10 $
-($Date: 2001/02/10 17:01:06 $)\&.
-...\" created by instant / docbook-to-man, Sun 19 Aug 2001, 12:15
diff --git a/gs/contrib/pcl3/doc/pcl3opts.html b/gs/contrib/pcl3/doc/pcl3opts.html
deleted file mode 100644
index 492be1241..000000000
--- a/gs/contrib/pcl3/doc/pcl3opts.html
+++ /dev/null
@@ -1,175 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<HTML
-><HEAD
-><TITLE
->pcl3opts</TITLE
-><META
-NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet version 1.13"></HEAD
-><BODY
-BGCOLOR="#FFFFFF"
-TEXT="#000000"
-><H1
->PCL3OPTS</H1
-><DIV
-CLASS="REFNAMEDIV"
-><H2
->NAME</H2
->pcl3opts &#8212; determine options for the ghostscript driver <B
-CLASS="COMMAND"
->pcl3</B
-> from a PCL-3+ file</DIV
-><H2>SYNOPSIS</H2
-><DIV
-CLASS="REFSYNOPSISDIV"
-><P
-><B
-CLASS="COMMAND"
->pcl3opts</B
-> [<SPAN
-CLASS="OPTION"
->-o <TT
-CLASS="REPLACEABLE"
-><I
->output_file</I
-></TT
-></SPAN
->] [<TT
-CLASS="REPLACEABLE"
-><I
->input_file</I
-></TT
->...] </P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><H2
->DESCRIPTION</H2
-><P
->The command <B
-CLASS="COMMAND"
->pcl3opts</B
->
-is intended to help in determining which options one should use when
-calling ghostscript using <B
-CLASS="COMMAND"
->pcl3</B
-> for driving a PCL-3+ printer.
-It analyzes one or more PCL <TT
-CLASS="REPLACEABLE"
-><I
->input_files</I
-></TT
->
-and issues on the <TT
-CLASS="REPLACEABLE"
-><I
->output_file</I
-></TT
->
-its best guess as to which options one should specify in order to produce
-files using a similar configuration.
-The default <TT
-CLASS="REPLACEABLE"
-><I
->output_file</I
-></TT
-> is standard output.
-If no <TT
-CLASS="REPLACEABLE"
-><I
->input_files</I
-></TT
-> are specified,
-the command reads from standard input.</P
-><P
->This command is mostly of interest if you have access to PCL files generated by
-software provided by the printer's manufacturer,
-for example if you have a manufacturer-supplied
-Microsoft Windows driver for your printer.
-In that case you can generate a few files under Windows using different
-settings and let <B
-CLASS="COMMAND"
->pcl3opts</B
-> examine them.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><H2
->LIMITATIONS</H2
-><P
->Note that <B
-CLASS="COMMAND"
->pcl3opts</B
->
-cannot guarantee that the collection of options it proposes leads to a file
-which is understood by the printer.
-It can merely provide a best guess.</P
-><P
->In addition, some settings require interpretation of the page contents
-in order to properly translate them into options for <B
-CLASS="COMMAND"
->pcl3</B
->
-and some cannot reliably be derived from a PCL file at all.
-Finding good values for these parameters is beyond
-<B
-CLASS="COMMAND"
->pcl3opts</B
->'s capabilities.
-This includes <SPAN
-CLASS="OPTION"
->LeadingEdge</SPAN
->, <SPAN
-CLASS="OPTION"
->SendBlackLast</SPAN
->,
-<SPAN
-CLASS="OPTION"
->Tumble</SPAN
-> and the distinction between the colour models
-<TT
-CLASS="USERINPUT"
-><B
->CMY+K</B
-></TT
-> and <TT
-CLASS="USERINPUT"
-><B
->CMYK</B
-></TT
->.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><H2
->SEE ALSO</H2
-><P
-><A HREF="gs-pcl3.html"
-><SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->gs-pcl3</SPAN
->(1)</SPAN
-></A></P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><H2
->AUTHOR</H2
-><P
->Copyright © 2000, 2001 by Martin Lottermoser,
-Greifswaldstraße 28, 38124 Braunschweig, Germany.
-E-mail: <TT
-CLASS="EMAIL"
-><A HREF="mailto:Martin.Lottermoser@t-online.de"
->Martin.Lottermoser@t-online.de</A></TT
->.</P
-><P
->Version of this reference page: $Revision: 1.10 $
-($Date: 2001/02/10 17:01:06 $).</P
-></DIV
-></BODY
-></HTML
-> \ No newline at end of file
diff --git a/gs/contrib/pcl3/doc/pcl3opts.ref b/gs/contrib/pcl3/doc/pcl3opts.ref
deleted file mode 100644
index ad9a095a4..000000000
--- a/gs/contrib/pcl3/doc/pcl3opts.ref
+++ /dev/null
@@ -1,132 +0,0 @@
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
-
-<refentry id="pcl3opts">
-
-<docinfo>
- <title>Reference page for the command <command>pcl3opts</command></title>
- <author>
- <firstname>Martin</firstname>
- <surname>Lottermoser</surname>
- </author>
- <address>
- <street>Greifswaldstra&szlig;e 28</street>
- <postcode>38124</postcode> <city>Braunschweig</city>
- <country>Germany</country>
- <email>Martin.Lottermoser@t-online.de</email>
- </address>
- <copyright>
- <year>2000</year>
- <year>2001</year>
- <holder>Martin Lottermoser</holder>
- </copyright>
- <releaseinfo>$Id: pcl3opts.ref,v 1.10 2001/02/10 17:01:06 Martin Rel $</releaseinfo>
-</docinfo>
-
-<!--************************************************************************-->
-
-<refmeta>
- <refentrytitle>PCL3OPTS</refentrytitle>
- <manvolnum>1</manvolnum>
-</refmeta>
-
-<!--************************************************************************-->
-
-<refnamediv>
- <refname>pcl3opts</refname>
- <refpurpose>determine options for the ghostscript driver <command
- >pcl3</command> from a PCL-3+ file</refpurpose>
-</refnamediv>
-
-<!--************************************************************************-->
-
-<refsynopsisdiv>
- <!-- According to Walsh+Muellner, "DocBook - The Definitive Guide" (1.0.2),
- the title should be generated. The version of Norman Walsh's HTML
- stylesheet I'm using does not do it, docbook-to-man does.
- If one specifies a title here, docbook-to-man produces two.
- Hence both packages are wrong. -->
- <cmdsynopsis>
- <command>pcl3opts</command>
- <arg choice="Opt"><option>-o <replaceable>output_file</replaceable></option
- ></arg>
- <arg choice="Opt" rep="Repeat"><replaceable>input_file</replaceable></arg>
- </cmdsynopsis>
-</refsynopsisdiv>
-
-<!--************************************************************************-->
-
-<refsect1><title>DESCRIPTION</title>
-<para>
-The command <command>pcl3opts</command>
-is intended to help in determining which options one should use when
-calling ghostscript using <command>pcl3</command> for driving a PCL-3+ printer.
-It analyzes one or more PCL <replaceable>input_files</replaceable>
-and issues on the <replaceable>output_file</replaceable>
-its best guess as to which options one should specify in order to produce
-files using a similar configuration.
-The default <replaceable>output_file</replaceable> is standard output.
-If no <replaceable>input_files</replaceable> are specified,
-the command reads from standard input.
-</para>
-
-<para>
-This command is mostly of interest if you have access to PCL files generated by
-software provided by the printer's manufacturer,
-for example if you have a manufacturer-supplied
-Microsoft Windows driver for your printer.
-In that case you can generate a few files under Windows using different
-settings and let <command>pcl3opts</command> examine them.
-</para>
-</refsect1>
-
-<!--************************************************************************-->
-
-<refsect1><title>LIMITATIONS</title>
-<para>
-Note that <command>pcl3opts</command>
-cannot guarantee that the collection of options it proposes leads to a file
-which is understood by the printer.
-It can merely provide a best guess.
-</para>
-
-<para>
-In addition, some settings require interpretation of the page contents
-in order to properly translate them into options for <command>pcl3</command>
-and some cannot reliably be derived from a PCL file at all.
-Finding good values for these parameters is beyond
-<command>pcl3opts</command>'s capabilities.
-This includes <option>LeadingEdge</option>, <option>SendBlackLast</option>,
-<option>Tumble</option> and the distinction between the colour models
-<userinput>CMY+K</userinput> and <userinput>CMYK</userinput>.
-</para>
-</refsect1>
-
-<!--************************************************************************-->
-
-<refsect1><title>SEE ALSO</title>
-<para>
-<!-- I should generate a link here for HTML output. -->
-<citerefentry>
- <refentrytitle>gs-pcl3</refentrytitle>
- <manvolnum>1</manvolnum>
-</citerefentry>
-</para>
-</refsect1>
-
-<!--************************************************************************-->
-
-<refsect1><title>AUTHOR</title>
-<para>
-Copyright &copy; 2000, 2001 by Martin Lottermoser,
-Greifswaldstra&szlig;e 28, 38124 Braunschweig, Germany.
-E-mail: <email>Martin.Lottermoser@t-online.de</email>.
-</para>
-
-<para>
-Version of this reference page: $Revision: 1.10 $
-($Date: 2001/02/10 17:01:06 $).
-</para>
-</refsect1>
-
-<!--************************************************************************-->
-</refentry>
diff --git a/gs/contrib/pcl3/doc/reports.txt b/gs/contrib/pcl3/doc/reports.txt
deleted file mode 100644
index 7d88eca50..000000000
--- a/gs/contrib/pcl3/doc/reports.txt
+++ /dev/null
@@ -1,489 +0,0 @@
-#******************************************************************************
-# File: @(#)$Id: reports.txt,v 2.13 2001/08/14 16:20:35 Martin Rel $
-# Contents: Hardware compatibility reports for pcl3
-# Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-# Germany. E-mail: Martin.Lottermoser@t-online.de.
-#
-#******************************************************************************
-# *
-# Copyright (C) 2000, 2001 by Martin Lottermoser *
-# All rights reserved *
-# *
-#******************************************************************************
-#
-# For a description of the format and the meaning of the entries in this file,
-# see how-to-report.txt.
-#
-# The reports are sorted by the following criteria:
-# - company and printer name (basically alphabetically ascending)
-# - pcl3 version (descending)
-# - ghostscript version (descending)
-# - date (descending)
-#
-# The success and failure items within a report are preferably sorted as
-# follows:
-# - colour model: Gray, RGB, CMY, CMY+K, CMYK
-# - resolution (ascending)
-# - intensity levels (ascending)
-#
-# Note that the classification as success or failure is the responsibility of
-# the person who provided the report. In the case of failure, you should read
-# the accompanying comment in order to find out what went wrong. There are
-# cases where the failure is not due to pcl3.
-#
-#******************************************************************************
-
-# Hewlett-Packard 2000C/2000CN Professional Series Color Printers
-# (includes 2000Cse, 2000Cxi, and 2000CN)
-
-Name: Torsten Ian Smith
-E-mail address: torstenian@get2net.dk
-Date: 2001-04-18
-Printer: HP 2000C Version 9.5.1.R
-Ghostscript version: 6.50
-pcl3 version: 3.2
-Success: -sDEVICE=pcl3 -sColorModel=CMYK -dCompressionMethod=9
- -sPageCountFile=/var/spool/pagecount -sIntensityRendering=Floyd-Steinberg
- -sSubdevice=unspec -sMedium=plain -sPrintQuality=1
-
-Name: Torsten Ian Smith
-E-mail address: torstenian@get2net.dk
-Date: 2001-04-08
-Printer: HP 2000C Version 9.5.1.R
-Ghostscript version: 6.01
-pcl3 version: 3.0.2
-Remarks: Settings derived from MS-windows printfile using pcl3opts.
-Success: gs -sDEVICE=pcl3 -sSubdevice=unspec -dSendNULs -sPJLLanguage=PCL3GUI
- -dOnlyCRD -r300 -sColourModel=CMYK -dBlackLevels=4 -dCMYLevels=4
- -sPrintQuality=presentation -sMedium=plain -dCompressionMethod=9
-
-#******************************************************************************
-
-# Hewlett-Packard 2500CM Professional Series Color Printer (model C2685A)
-
-Name: Ian Leonard
-E-mail address: ghostscript@denver.com.au
-Date: 2001-07-17
-Printer: HP Deskjet 2500CM C2685A FW-8.3.6
-Ghostscript version: 6.50
-pcl3 version: 3.2
-Remarks: Printer display remained "Processing Job" after job completed printing.
- Tests were done on a Windows 2000 platform using AFPL Ghostscript
- 6.50 compiled with pcl3. This distribution is available at
- http://www.denver.com.au/downloads/gs-pcl.
-Success: -sDEVICE=pcl3 -sColorModel=CMYK -sSubdevice=unspec
- -dCompressionMethod=9 -r600
-Success: -sDEVICE=pcl3 -sColorModel=CMYK -sSubdevice=unspec
- -dCompressionMethod=9.
- The above produces 300dpi.
-Success: -sDEVICE=pcl3 -sSubdevice=unspec -dSendNULs=600
- -sPJLLanguage=PCL3GUI -dOnlyCRD -r300 -sColourModel=CMYK
- -dBlackLevels=4 -dCMYLevels=4 -sPrintQuality=presentation
- -sMedium=transparency -dCompressionMethod=9
- The above worked only if the command
- << /PCLInit1 <1B2A6F375708090000070101> >> setpagedevice
- was included before the document to be printed.
-
-#******************************************************************************
-
-# Hewlett-Packard DeskJet 697C
-
-Name: Oliver Schurr
-E-mail address: schurro@georgetown.edu
-Date: 2001-02-02
-Printer: Hewlett-Packard DeskJet 697C
-Ghostscript version: AFPL GS 6.50
-pcl3 version: 3.0.2
-Success: -sDEVICE=hpdj690c
-Success: -sDEVICE=hpdj690c -r600x300
-Success: -sDEVICE=hpdj690c -r600
-Success: -sDEVICE=hpdj690c -ColorModel=CMYK
-Success: -sDEVICE=hpdj690c -r600x300 -ColorModel=CMYK
-Remarks: in each case I used 'lpr -Praw test.pcl' to send the file to the
- printer
-
-#******************************************************************************
-
-# Hewlett-Packard DeskJet 850C (model C2145A)
-
-Name: Martin Lottermoser
-E-mail address: Martin.Lottermoser@t-online.de
-Date: 2000-10-21
-Printer: Hewlett-Packard DeskJet 850C, model C2145A, revision: 9.20 01/14/95
-Ghostscript version: Aladdin ghostscript 6.01
-pcl3 version: pre-3.0
-Remarks: All tests were made with levels-test.ps. I have made no remarks on
- recognizable halftoning problems except where the result was seriously wrong.
- This applies also to the classification as success or failure.
-Success: -sDEVICE=hpdj850c -r75.
- This resolution is too small to be useful.
-Failure: -sDEVICE=hpdj850c -r150.
- In the 43-levels test for black, fields 4 and 5 became white again (non-
- monotonic behaviour). The same gaps appear with the other bands.
- This is apparently a ghostscript problem, see the following test.
- The behaviour is the same in GNU ghostscript 5.50.
-Success: -sDEVICE=hpdj850c -r150 -dNoHalftoning
-Success: -sDEVICE=hpdj850c -r300
-Failure: -sDEVICE=hpdj850c -r300 -dBlackLevels=4.
- In the black band of the 43-levels test, fields 1, 3, 5, 7, 9, 11, 22, 24,
- 26, 28, and 30 have white gaps on the right. Similar gaps appear in the
- other bands. This is a problem with gs 6.01 which does not appear with
- GNU ghostscript 5.50. See also the following test.
-Success: -sDEVICE=hpdj850c -r300 -dBlackLevels=4 -dNoHalftoning
-Success: -sDEVICE=hpdj850c -r600
-Success: -sDEVICE=hpdj850c -r75 -sColourModel=CMY.
- This resolution is too small to be useful.
- Composite black is mapped to true black by the printer.
-Failure: -sDEVICE=hpdj850c -r150 -sColourModel=CMY.
- Composite black is mapped to true black by the printer.
- In the 43-levels test for black, fields 4 and 5 became white again (non-
- monotonic behaviour).
- This is apparently a ghostscript problem, see the following test.
-Success: -sDEVICE=hpdj850c -r150 -sColourModel=CMY -dNoHalftoning.
- Composite black is mapped to true black by the printer.
-Success: -sDEVICE=hpdj850c -r300 -sColourModel=CMY.
- Composite black is mapped to true black by the printer.
-Success: -sDEVICE=hpdj850c -r75 -sColourModel=CMYK.
- This resolution is too small to be useful.
-Failure: -sDEVICE=hpdj850c -r150 -sColourModel=CMYK.
- In the 43-levels test for black, fields 4 and 5 became white again (non-
- monotonic behaviour). The three CMY bands show a diminished intensity in the
- same fields, though not quite as obvious.
- This is apparently a ghostscript problem, see the following test.
-Success: -sDEVICE=hpdj850c -r150 -sColourModel=CMYK -dNoHalftoning
-Success: -sDEVICE=hpdj850c -r300 -sColourModel=CMYK
-Success: -sDEVICE=hpdj850c -r300 -sColourModel=CMYK -dBlackLevels=4
- -dCMYLevels=3.
- The CMY colorants are far too saturated (I didn't override the transfer
- functions).
-Success: -sDEVICE=hpdj850c -r300 -sColourModel=CMYK -dBlackLevels=4
- -dCMYLevels=4.
- The CMY colorants are far too saturated (again, no transfer functions).
-
-#******************************************************************************
-
-# Hewlett-Packard DeskJet 970C (model C6429A)
-
-Name: Patrick Brison
-E-mail address: pbn@rtbf.be
-Date: 2001/01/29
-Printer: DeskJet970Cxi (model C6429A)
- Serial Number: ES989130ZPJQ
- Service ID: 09345
- FW Revision: BF410063
- PCL Default Symbol Set: 341
-Ghostscript version: 6.50
-pcl3 version: 3.0.2
-Media configuration file: none used
-Remarks: Three series of test were made:
- - monochrome support
- - colours support
- - duplex support
- In summary:
- Different X and Y resolutions (600x300, 2400x1200) do not
- seem to work.
- The combination color/normal/600 dpi does not seem to work.
- Some options must be avoided for some modes to work correctly
- Duplex settings seem to work fine in all modes
-
-##################
-# Monochrome tests
-##################
-
-# Draft 300 dpi
-Success: -sDEVICE=pcl3
- -dSendNULs -sPJLLanguage=PCL3GUI -dOnlyCRD
- -sColourModel=Gray -sPrintQuality=draft -r300
-
-# Draft 600x300 dpi
-Failure: -sDEVICE=pcl3
- -dSendNULs -sPJLLanguage=PCL3GUI -dOnlyCRD
- -sColourModel=Gray -sPrintQuality=draft -r600x300.
- No output, printer loads page, power led blinks but nothing happens.
-
-# Normal 300 dpi
-Success: -sDEVICE=pcl3
- -dSendNULs -dOnlyCRD
- -sColourModel=Gray -sPrintQuality=normal -r300 -sMedium=plain.
- Removing / adding any of "-dSendNULs", "-dOnlyCRD" has no effect,
- Using "-sPJLLanguage=PCL3GUI" causes this mode to FAIL
-
-# Normal 600x300 dpi
-Failure: -sDEVICE=pcl3
- -dSendNULs -sPJLLanguage=PCL3GUI -dOnlyCRD
- -sColourModel=Gray -sPrintQuality=normal -r600x300.
- Right half of page missing
-
-# Normal 600 dpi
-Success: -sDEVICE=pcl3
- -dSendNULs -sPJLLanguage=PCL3GUI -dOnlyCRD
- -sColourModel=Gray -sPrintQuality=normal -r600
-
-# Best 600 dpi
-Success: -sDEVICE=pcl3
- -dSendNULs -sPJLLanguage=PCL3GUI -dOnlyCRD
- -sColourModel=Gray -sPrintQuality=presentation -r600
-
-##############
-# Colour tests
-##############
-
-# Draft 300 dpi
-Success: -sDEVICE=pcl3
- -dSendNULs -sPJLLanguage=PCL3GUI -dOnlyCRD -dCMYLevels=4
- -sColourModel=CMYK -sPrintQuality=draft -r300
-
-# Normal 300 dpi
-Success: -sDEVICE=pcl3
- -sColourModel=CMYK -sPrintQuality=normal -r300 -sMedium=plain.
- Adding "-dCMYLevels=4" causes this mode to FAIL
-
-# Normal 600 dpi
-Failure: -sDEVICE=pcl3
- -dSendNULs -sPJLLanguage=PCL3GUI -dOnlyCRD -dCMYLevels=4
- -sColourModel=CMYK -sPrintQuality=normal -r600.
- No output, printer loads page, power led blinks but nothing happens.
-Failure: -sDEVICE=pcl3
- -dSendNULs -sPJLLanguage=PCL3GUI -dOnlyCRD -dCMYLevels=4
- -sColourModel=CMYK -sPrintQuality=normal -r600 -sMedium=plain.
- No output. Printer loads a page and is "locked" with blinking power LED
-Failure: -sDEVICE=pcl3
- -dSendNULs -dOnlyCRD -dCMYLevels=4
- -sColourModel=CMYK -sPrintQuality=normal -r600 -sMedium=plain.
- This NEARLY works! Output is sharp but colours are shifted to the
- right of the page (the page printed was "levels-test.ps")
-Failure: -sDEVICE=pcl3
- -sColourModel=CMYK -sPrintQuality=normal -r600 -sMedium=plain.
- The output was just a plain nice black vertical bar, and the printer
- stayed "locked" with blinking power LED without ejecting the page.
-
-# Best 600 dpi
-Success: -sDEVICE=pcl3
- -dSendNULs -sPJLLanguage=PCL3GUI -dOnlyCRD -dCMYLevels=4
- -sColourModel=CMYK -sPrintQuality=presentation -r600
-
-# Best 1200 dpi
-Success: -sDEVICE=pcl3 -sSubdevice=unspec
- -dSendNULs -sPJLLanguage=PCL3GUI -dOnlyCRD
- -r1200 -sColourModel=CMY -sPrintQuality=presentation
- -sMedium=glossy -dCompressionMethod=2.
- Adding "-dCMYLevels=4" causes this mode to FAIL
- This mode only works with "-sColourModel=CMY"
-
-##############
-# Duplex tests
-##############
-
-# Book binding
-Success: -sDEVICE=pcl3
- -dSendNULs -sPJLLanguage=PCL3GUI -dOnlyCRD
- -sDuplexCapability=oppositeLeadingEdge -dCompressionMethod=2
- -dDuplex=true -dTumble=false
- -sColourModel=mono -sPrintQuality=normal -r600
-
-# Tablet binding
-Success: -sDEVICE=pcl3
- -dSendNULs -sPJLLanguage=PCL3GUI -dOnlyCRD
- -sDuplexCapability=oppositeLeadingEdge -dCompressionMethod=2
- -dDuplex=true -dTumble=true
- -sColourModel=mono -sPrintQuality=normal -r600
-
-#******************************************************************************
-
-# Hewlett-Packard DeskJet 1100C
-
-Name: Klaus Reimann
-E-mail address: Klaus.Reimann@itap.physik.uni-stuttgart.de
-Date: 2000-12-08
-Printer: HP DJ 1100C
-Ghostscript version: 6.30
-pcl3 version: 3.0.2
-Success: -sPJLLanguage=PCL3GUI -dOnlyCRD -sDEVICE=pcl3 -sSubdevice=unspec
- -r300 -sColourModel=Gray -dBlackLevels=2.
- Specifying -dOnlyCRD is necessary.
-
-
-Name: Klaus Reimann
-E-mail address: Klaus.Reimann@itap.physik.uni-stuttgart.de
-Date: 2000-12-08
-Printer: HP DJ 1100C
-Ghostscript version: 6.30
-pcl3 version: 3.0.1
-pcl3opts: In colour: -r300 -dBlackLevels=4 -dCMYLevels=4, monochrome: -r600.
- In both cases, -sPJLLanguage=PCL3GUI was also issued.
-Remarks: The results can be summarized as follows:
-
- 1. Connection
- Success:
- a) no options
- b) -sPJLLanguage=PCL3GUI -dOnlyCRD
- The "-dOnlyCRD" is needed. Success only with Version >3.0.2.
- c) -dSendNULs
- No effect.
- Failure:
- a) -sPJLLanguage=PCL3GUI
- non-uniformly distributed vertical black lines.
-
- 2. Compression
- Success: all Compression methods work
- a) no options
- b) -dCompressionMethod=2
- c) -dCompressionMethod=9
-
- 3. Media type
- Success: all
- a) no options
- b) -sMedium=plain
-
- 4. Print Quality
- Success: all
- a) no options
- b) -sPrintQuality=presentation
-
- 5. Resolution
- Sucess:
- a) -r300 : all
- b) -r600 : Success with -sColourModel=Gray
- Failure: all other
- a) -r600 -sColourModel=CMYK
-
- 6. Colour Models and Levels
- Success:
- a) -sColourModel=Gray -dBlackLevels=2
- b) -sColourModel=CMYK -dBlackLevels=2 -dCMYLevels=2
- Failure: all other
- a) -r300 -sColourModel=Gray -dBlackLevels=4
- This test gave white gaps in parts of levels-test.ps: in the 43-levels
- test, the gaps were on the right of some of the fields, in the
- 401-levels case, there were white vertical lines in 6 groups, the first
- 5 consisting of 19 lines each, the last of four. The distance between
- the lines within a group was 2mm. Apart from the gaps, the intensity
- increased monotonically.
- Some of the corners were missing from the letters.
- b) -r600 -sColourModel=Gray -dBlackLevels=3
- non-monotonic intensity.
- c) -r600 -sColourModel=Gray -dBlackLevels=4
- non-monotonic intensity. Missing corners. Grouped vertical lines.
- d) -r300 -sColourModel=CMYK -dBlackLevels=2 -dCMYLevels=4
- Totally wrong colours.
- e) -dBlackLevels=3 -dCMYLevels=2
- Wrong colours: yellow becomes white, magenta yellow, and cyan magenta.
- f) -dBlackLevels=4 -dCMYLevels=3
- When gradually passing horizontally from one colour to the next
- (e.g., red or green to black) in a vertical direction, there are
- horizontal strips where one colorant is missing from the mix.
- g) -dBlackLevels=4 -dCMYLevels=4
- Sometimes missing colorant. Some corners are missing from letters.
-
- 7. Printer Model
- Success:
- a) unspec
- b) hpdj1120c
-
-Success: -sDEVICE=pcl3 -sSubdevice=unspec -r300
- -sColourModel=Gray -dBlackLevels=2
-Failure: -sPJLLanguage=PCL3GUI -sDEVICE=pcl3 -sSubdevice=unspec -r300
- -sColourModel=Gray -dBlackLevels=2.
- Black vertical stripes. But see test with pcl3 3.0.2 and using -dOnlyCRD.
-Failure: -sDEVICE=pcl3 -sSubdevice=unspec -dCompressionMethod=9
- -r300 -sColourModel=Gray -sMedium=plain -sPrintQuality=presentation
- -dBlackLevels=4.
- This test gave white gaps in parts of levels-test.ps: in the 43-levels test,
- the gaps were on the right of some of the fields, in the 401-levels case,
- there were white vertical lines in 6 groups, the first 5 consisting of
- 19 lines each, the last of four. The distance between the lines within a
- group was 2mm. Apart from the gaps, the intensity increased monotonically.
- Some of the corners were missing from the letters.
-Success: -sDEVICE=pcl3 -sSubdevice=unspec -dSendNULs -r600 -sColourModel=Gray
- -sMedium=plain -sPrintQuality=presentation -dCompressionMethod=2
-Failure: -sDEVICE=pcl3 -sSubdevice=unspec -dSendNULs -r600 -sColourModel=Gray
- -sMedium=plain -sPrintQuality=presentation -dCompressionMethod=2
- -dBlackLevels=3.
- The intensity does not increase monotonically.
-Failure: -sDEVICE=pcl3 -sSubdevice=unspec -dSendNULs -r600 -sColourModel=Gray
- -sMedium=plain -sPrintQuality=presentation -dCompressionMethod=2
- -dBlackLevels=4.
- The intensity does not increase monotonically.
-Failure: -sDEVICE=pcl3 -sSubdevice=unspec -dSendNULs -r600 -sColourModel=Gray
- -sMedium=plain -sPrintQuality=presentation -dCompressionMethod=2
- -dBlackLevels=4 -sPJLLanguage=PCL3GUI.
- Garbage (black vertical stripes) printed.
-Failure: -sDEVICE=pcl3 -sSubdevice=unspec -dSendNULs -r600 -sColourModel=Gray
- -sMedium=plain -sPrintQuality=presentation -dCompressionMethod=2
- -dBlackLevels=4 -sPJLLanguage=PCL3GUI -dOnlyCRD.
- Black vertical stripes and nothing else.
-Failure: -sDEVICE=pcl3 -sSubdevice=unspec -dCompressionMethod=9
- -r600 -sColourModel=Gray -sMedium=plain -sPrintQuality=presentation
- -dBlackLevels=4 -sPJLLanguage=PCL3GUI -dOnlyCRD.
- Black vertical stripes and nothing else.
-Failure: -sDEVICE=pcl3 -sSubdevice=unspec -dCompressionMethod=9
- -r600 -sColourModel=Gray -sMedium=plain -sPrintQuality=presentation
- -dBlackLevels=4.
- Non-monotonic increase of intensities, many thin vertical lines (2 mm
- distance) in the 401 levels test section of levels-test.ps.
-Success: -sDEVICE=pcl3 -sSubdevice=hpdj1120c -sColourModel=CMYK
- -sPrintQuality=presentation
-Success: -sDEVICE=pcl3 -sSubdevice=unspec -dSendNULs -r300 -sColourModel=CMYK
- -dBlackLevels=2 -dCMYLevels=2 -sMedium=plain -sPrintQuality=presentation
- -dCompressionMethod=9
-Failure: -sDEVICE=pcl3 -sSubdevice=unspec -dSendNULs -r300 -sColourModel=CMYK
- -dBlackLevels=2 -dCMYLevels=4 -sMedium=plain -sPrintQuality=presentation
- -dCompressionMethod=9.
- Totally wrong colours.
-Failure: -sDEVICE=pcl3 -sSubdevice=unspec -dSendNULs -r300 -sColourModel=CMYK
- -dBlackLevels=3 -dCMYLevels=2 -sMedium=plain -sPrintQuality=presentation
- -dCompressionMethod=9.
- Wrong colours: yellow becomes white, magenta yellow, and cyan magenta.
-Failure: -sDEVICE=pcl3 -sSubdevice=unspec -dSendNULs -r300 -sColourModel=CMYK
- -dBlackLevels=4 -dCMYLevels=3 -sMedium=plain -sPrintQuality=presentation
- -dCompressionMethod=2.
- When gradually passing from one colour to the next (e.g., red or green to
- black) in a vertical direction, there are horizontal strips where one
- colorant is missing from the mix.
-Failure: -sDEVICE=pcl3 -sSubdevice=unspec -r300
- -sColourModel=CMYK -dBlackLevels=4 -dCMYLevels=4 -dCompressionMethod=2.
- When printing levels-test.ps, some corners are missing from letters.
- Using -dNoHalftoning does not help.
-Failure: -sDEVICE=pcl3 -sSubdevice=unspec -r300
- -sColourModel=CMYK -dBlackLevels=4 -dCMYLevels=4 -dCompressionMethod=2
- -dNoHalftoning
- When printing levels-test.ps, some corners are missing from letters.
-Failure: -sDEVICE=pcl3 -sSubdevice=unspec -r300
- -sColourModel=CMYK -dBlackLevels=4 -dCMYLevels=4 -dCompressionMethod=2
- -sPrintQuality=presentation.
- When printing levels-test.ps, some corners are missing from letters,
- and starting from intensity 17/42, levels are difficult to distinguish.
- Sometimes colours are missing.
-Failure: -sDEVICE=pcl3 -sSubdevice=unspec -dSendNULs -r300 -sColourModel=CMYK
- -dBlackLevels=4 -dCMYLevels=4 -sMedium=plain -sPrintQuality=presentation
- -dCompressionMethod=2.
- Same result as previous test, i.e., no influence of -dSendNULs.
-Failure: -sDEVICE=pcl3 -sSubdevice=unspec -r300
- -sColourModel=CMYK -dBlackLevels=4 -dCMYLevels=4 -dCompressionMethod=2
- -sPrintQuality=presentation -sPJLLanguage=PCL3GUI -dOnlyCRD -dNoHalftoning.
- When printing levels-test.ps, some corners are missing from letters.
-Failure: -sDEVICE=pcl3 -sSubdevice=unspec -dSendNULs -r600 -sColourModel=CMYK
- -dBlackLevels=4 -dCMYLevels=4 -sMedium=plain -sPrintQuality=presentation
- -dCompressionMethod=2.
- Wrong colours, twice the size, wrong position.
-
-#******************************************************************************
-
-# Xerox DocuPrint M750
-
-Name: Russ Bohnhoff
-Date: 01/17/01
-Printer: Xerox DocuPrint M750
-Ghostscript version: GNU 5.50
-pcl3 version: 3.0.2
-Remarks: any value other than 600 dpi will be printed at 600 dpi
-Success: -sDEVICE=pcl3 -sSubdevice=unspec -r600 -sPrintQuality=normal
- -sMedium=plain -dCompressionMethod=2 -sColorModel=CMYK.
- This option gives me full color with no defects.
- Printing can only be done one page at a time or otherwise
- a page feed error (blinking red) occurs.
- Margins:
- TOP: 7/48"
- BOTTOM: 17/48"
- LEFT: 7/48"
- RIGHT: 17/48"
diff --git a/gs/contrib/pcl3/eprn/eprnfs.c b/gs/contrib/pcl3/eprn/eprnfs.c
deleted file mode 100644
index 97278b238..000000000
--- a/gs/contrib/pcl3/eprn/eprnfs.c
+++ /dev/null
@@ -1,592 +0,0 @@
-/******************************************************************************
- File: $Id: eprnfs.c,v 1.6 2001/05/01 07:02:01 Martin Rel $
- Contents: Floyd-Steinberg error diffusion for eprn
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany; e-mail: Martin.Lottermoser@t-online.de.
-
-*******************************************************************************
-* *
-* Copyright (C) 2001 by Martin Lottermoser *
-* All rights reserved *
-* *
-*******************************************************************************
-
- Information about Floyd-Steinberg error diffusion should be available in a
- number of places. I've used:
-
- James D. Foley, Andries van Dam, Steven K. Feiner, John F. Hughes
- "Computer Graphics"
- Second edition in C
- Reading/Massachusetts, etc.: Addison-Wesley, 1996
- ISBN 0-201-84840-6
-
-******************************************************************************/
-
-/* Configuration management identification */
-#ifndef lint
-static const char
- cm_id[] = "@(#)$Id: eprnfs.c,v 1.6 2001/05/01 07:02:01 Martin Rel $";
-#endif
-
-/*****************************************************************************/
-
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE 500
-#endif
-
-#include "gdeveprn.h"
-
-/*****************************************************************************/
-
-/* Here follow some macros for code sections used in several routines. */
-
-#define fit_to_octet(value) ((value) < 0? 0: (value) > 255? 255: (value))
-
-#define FS_assign() \
- new_value = *to + correction; \
- if (new_value < 0) { \
- *to = 0; \
- remaining_error += new_value; \
- } \
- else if (255 < new_value) { \
- *to = 255; \
- remaining_error += new_value - 255; \
- } \
- else *to = new_value;
-
-#define error_propagation_Gray() \
- if (error != 0) { \
- remaining_error = error; \
- \
- /* 7/16 of the error goes to the right */ \
- correction = (7*error)/16; \
- remaining_error -= correction; \
- if (pixel < max_pixel) { \
- to = from + 1; \
- FS_assign() \
- if (pixel == pixels - 1 && *to > 0) { \
- pixels++; \
- line->length++; \
- } \
- } \
- \
- /* 3/16 of the error goes to the left and below */ \
- correction = (3*error)/16; \
- remaining_error -= correction; \
- if (pixel > 0) { \
- to = next_line->str + (pixel - 1); \
- FS_assign() \
- if (next_line->length < pixel && *to > 0) next_line->length = pixel; \
- } \
- \
- /* 5/16 of the error goes below */ \
- correction = (5*error)/16; \
- remaining_error -= correction; \
- to = next_line->str + pixel; \
- FS_assign() \
- if (next_line->length <= pixel && *to > 0) next_line->length = pixel + 1; \
- \
- /* The remainder (about 1/16 of the error) is added to the right and */ \
- /* below. */ \
- if (pixel < max_pixel) { \
- to = next_line->str + (pixel+1); \
- new_value = *to + remaining_error; \
- *to = fit_to_octet(new_value); \
- if (next_line->length < pixel + 2 && *to > 0) \
- next_line->length = pixel + 2; \
- } \
- }
-
-/* Number of octets per pixel for the non-monochrome cases */
-#define OCTETS_PER_PIXEL 4
-
-#define error_propagation_colour() \
- if (error != 0) { \
- remaining_error = error; \
- \
- /* 7/16 of the error goes to the right */ \
- correction = (7*error)/16; \
- remaining_error -= correction; \
- if (pixel < max_pixel) { \
- to = from + OCTETS_PER_PIXEL; \
- FS_assign() \
- if (pixel == pixels - 1 && *to > 0) { \
- pixels++; \
- line->length += OCTETS_PER_PIXEL; \
- } \
- } \
- \
- /* 3/16 of the error goes to the left and below */ \
- correction = (3*error)/16; \
- remaining_error -= correction; \
- if (pixel > 0) { \
- to = next_line->str + (pixel - 1)*OCTETS_PER_PIXEL + colorant; \
- FS_assign() \
- if (next_line->length < pixel*OCTETS_PER_PIXEL && *to > 0) \
- next_line->length = pixel*OCTETS_PER_PIXEL; \
- } \
- \
- /* 5/16 of the error goes below */ \
- correction = (5*error)/16; \
- remaining_error -= correction; \
- to = next_line->str + pixel*OCTETS_PER_PIXEL + colorant; \
- FS_assign() \
- if (next_line->length <= pixel*OCTETS_PER_PIXEL && *to > 0) \
- next_line->length = (pixel + 1)*OCTETS_PER_PIXEL; \
- \
- /* The remainder (about 1/16 of the error) is added to the right and */ \
- /* below. */ \
- if (pixel < max_pixel) { \
- to = next_line->str + (pixel+1)*OCTETS_PER_PIXEL + colorant; \
- new_value = *to + remaining_error; \
- *to = fit_to_octet(new_value); \
- if (next_line->length < (pixel + 2)*OCTETS_PER_PIXEL && *to > 0) \
- next_line->length = (pixel + 2)*OCTETS_PER_PIXEL; \
- } \
- }
-
-/******************************************************************************
-
- Function: split_Gray_2
-
- Floyd-Steinberg error diffusion for the process colour model Gray and
- 2 intensity levels.
-
-******************************************************************************/
-
-static void split_Gray_2(eprn_OctetString *line, eprn_OctetString *next_line,
- int max_octets, eprn_OctetString bitplanes[])
-{
- const int
- max_pixel = max_octets - 1;
- int
- correction,
- error,
- new_value,
- pixel,
- pixel_mod_8,
- pixels = line->length,
- remaining_error;
- eprn_Octet
- approx,
- *from,
- *ptr,
- *to;
-
- ptr = bitplanes[0].str;
-
- /* Loop over pixels in the scan line. Note that 'pixels' may increase
- within the loop. */
- for (pixel = 0, pixel_mod_8 = 8; pixel < pixels; pixel++, pixel_mod_8++) {
- if (pixel_mod_8 == 8) {
- pixel_mod_8 = 0;
- *ptr = 0;
- }
-
- /* Determine approximation and error for this pixel */
- from = line->str + pixel;
- approx = *from >> 7; /* take the most significant bit */
- error = *from - 255*approx;
- /* The sign of 'error' is chosen such that 'error' is positive if
- colorant intensity has to be added to the picture. */
-
- /* Insert the approximation into the output plane */
- *ptr = (*ptr << 1) | approx;
-
- error_propagation_Gray()
-
- if (pixel_mod_8 == 7) ptr++;
- }
-
- eprn_finalize(false, 0, 1, bitplanes, &ptr, pixels);
-
- return;
-}
-
-/******************************************************************************
-
- Function: split_Gray()
-
- Floyd-Steinberg error diffusion for the process colour model Gray and an
- arbitrary number of intensity levels.
-
-******************************************************************************/
-
-static void split_Gray(eprn_OctetString *line, eprn_OctetString *next_line,
- int max_octets, unsigned int black_levels, eprn_OctetString bitplanes[])
-{
- const int
- max_pixel = max_octets - 1,
- planes = eprn_bits_for_levels(black_levels);
- int
- correction,
- error,
- new_value,
- pixel,
- pixel_mod_8,
- pixels = line->length,
- plane,
- remaining_error;
- eprn_Octet
- approx,
- *from,
- *ptr[8],
- *to;
- const unsigned int
- divisor = 256/black_levels,
- max_level = black_levels - 1;
-
- for (plane = 0; plane < planes; plane++) ptr[plane] = bitplanes[plane].str;
-
- /* Loop over pixels in the scan line. Note that 'pixels' may increase
- within the loop. */
- for (pixel = 0, pixel_mod_8 = 8; pixel < pixels; pixel++, pixel_mod_8++) {
- if (pixel_mod_8 == 8) {
- pixel_mod_8 = 0;
- for (plane = 0; plane < planes; plane++) *ptr[plane] = 0;
- }
-
- /* Determine approximation and error for this pixel */
- from = line->str + pixel;
- approx = *from/divisor;
- error = *from - (255*approx)/max_level;
- /* The sign of 'error' is chosen such that 'error' is positive if
- colorant intensity has to be added to the picture. */
-
- /* Distribute the approximation over the bit planes */
- for (plane = 0; plane < planes; plane++) {
- *ptr[plane] = (*ptr[plane] << 1) | approx & 0x01;
- approx >>= 1;
- }
-
- error_propagation_Gray()
-
- if (pixel_mod_8 == 7)
- for (plane = 0; plane < planes; plane++) ptr[plane]++;
- }
-
- eprn_finalize(false, 0, planes, bitplanes, ptr, pixels);
-
- return;
-}
-
-/*****************************************************************************/
-
-/* Index of the black colorant in a pixel value (gx_color_index) for the
- non-monochrome cases */
-#define BLACK_INDEX 3
-
-/******************************************************************************
-
- Function: split_colour_CMYK_2()
-
- Floyd-Steinberg error diffusion for the CMYK colour model using 2 intensity
- levels for all colorants.
-
- This function is about 14 % faster than split_colour_at_most_2(), and every
- bit helps.
-
-******************************************************************************/
-
-#define PLANES 4
-
-static void split_colour_CMYK_2(eprn_OctetString *line,
- eprn_OctetString *next_line, int max_octets, eprn_OctetString bitplanes[])
-{
- const int
- max_pixel = max_octets/OCTETS_PER_PIXEL - 1;
- int
- colorant,
- correction,
- error,
- new_value,
- pixel,
- pixel_mod_8,
- pixels = line->length/OCTETS_PER_PIXEL,
- plane,
- remaining_error;
- eprn_Octet
- approx,
- *from,
- *ptr[4],
- *to;
-
- for (plane = 0; plane < PLANES; plane++) ptr[plane] = bitplanes[plane].str;
-
- /* Loop over pixels in the scan line. Note that 'pixels' may increase
- within the loop. */
- for (pixel = 0, pixel_mod_8 = 8; pixel < pixels; pixel++, pixel_mod_8++) {
- if (pixel_mod_8 == 8) {
- pixel_mod_8 = 0;
- for (plane = 0; plane < PLANES; plane++) *ptr[plane] = 0;
- }
-
- /* Loop over colorants within a scan line. Remember that the order within
- a pixel is YMCK. */
- for (colorant = BLACK_INDEX; colorant >= 0; colorant--) {
- from = line->str + pixel*OCTETS_PER_PIXEL + colorant;
-
- /* Determine approximation and error for this pixel */
- approx = *from >> 7;
- error = *from - 255*approx;
- /* The sign of 'error' is chosen such that 'error' is positive if
- colorant intensity has to be added to the picture. */
-
- /* Insert the approximation in the bit plane */
- plane = BLACK_INDEX - colorant;
- *ptr[plane] = (*ptr[plane] << 1) | approx;
-
- error_propagation_colour()
- }
-
- if (pixel_mod_8 == 7)
- for (plane = 0; plane < PLANES; plane++) ptr[plane]++;
- }
-
- eprn_finalize(false, 2, PLANES, bitplanes, ptr, pixels);
-
- return;
-}
-
-/******************************************************************************
-
- Function: split_colour_at_most_2()
-
- Floyd-Steinberg error diffusion for the non-monochrome process colour models
- using 2 intensity levels for the CMY colorants and at most 2 for the black
- colorant.
-
-******************************************************************************/
-
-static void split_colour_at_most_2(eprn_OctetString *line,
- eprn_OctetString *next_line, int max_octets, eprn_ColourModel colour_model,
- eprn_OctetString bitplanes[])
-{
- const int
- last_colorant =
- colour_model == eprn_DeviceCMY_plus_K || colour_model == eprn_DeviceCMYK?
- BLACK_INDEX: 2,
- max_pixel = max_octets/OCTETS_PER_PIXEL - 1,
- planes =
- colour_model == eprn_DeviceCMY_plus_K || colour_model == eprn_DeviceCMYK?
- 4: 3;
- int
- colorant,
- correction,
- error,
- new_value,
- pixel,
- pixel_mod_8,
- pixels = line->length/OCTETS_PER_PIXEL,
- plane,
- remaining_error;
- eprn_Octet
- approx[4],
- *from,
- *ptr[4],
- *to;
-
- for (plane = 0; plane < planes; plane++) ptr[plane] = bitplanes[plane].str;
-
- /* Loop over pixels in the scan line. Note that 'pixels' may increase
- within the loop. */
- for (pixel = 0, pixel_mod_8 = 8; pixel < pixels; pixel++, pixel_mod_8++) {
- if (pixel_mod_8 == 8) {
- pixel_mod_8 = 0;
- for (plane = 0; plane < planes; plane++) *ptr[plane] = 0;
- }
-
- /* Loop over colorants within a scan line. Remember that the order within
- a pixel is YMCK or BGR-. */
- for (colorant = last_colorant; colorant >= 0; colorant--) {
- from = line->str + pixel*OCTETS_PER_PIXEL + colorant;
-
- /* Determine approximation and error for this pixel */
- approx[colorant] = *from >> 7;
- error = *from - 255*approx[colorant];
- /* The sign of 'error' is chosen such that 'error' is positive if
- colorant intensity has to be added to the picture. */
-
- error_propagation_colour()
- }
-
- /* Determine the black component for CMY+K */
- if (colour_model == eprn_DeviceCMY_plus_K &&
- approx[0] == approx[1] && approx[1] == approx[2] && approx[0] > 0) {
- approx[BLACK_INDEX] = approx[0];
- approx[0] = approx[1] = approx[2] = 0;
- }
-
- /* Distribute the approximation over the bit planes */
- for (colorant = last_colorant, plane = 0; colorant >= 0;
- colorant--, plane++) {
- *ptr[plane] = (*ptr[plane] << 1) | approx[colorant];
- }
-
- if (pixel_mod_8 == 7)
- for (plane = 0; plane < planes; plane++) ptr[plane]++;
- }
-
- eprn_finalize(colour_model == eprn_DeviceRGB, 2, planes, bitplanes, ptr,
- pixels);
-
- return;
-}
-
-/******************************************************************************
-
- Function: split_colour()
-
- Floyd-Steinberg error diffusion for the non-monochrome process colour models
- and an arbitrary number of intensity levels.
-
-******************************************************************************/
-
-static void split_colour(eprn_OctetString *line, eprn_OctetString *next_line,
- int max_octets, eprn_ColourModel colour_model,
- unsigned int black_levels, unsigned int non_black_levels,
- eprn_OctetString bitplanes[])
-{
- const int
- black_planes = eprn_bits_for_levels(black_levels),
- last_colorant = black_levels > 0? BLACK_INDEX: 2,
- max_pixel = max_octets/OCTETS_PER_PIXEL - 1,
- non_black_planes = eprn_bits_for_levels(non_black_levels),
- planes = black_planes + 3*non_black_planes;
- int
- colorant,
- correction,
- error,
- new_value,
- next_plane[4],
- pixel,
- pixel_mod_8,
- pixels = line->length/OCTETS_PER_PIXEL,
- plane,
- remaining_error;
- eprn_Octet
- approx[4],
- *from,
- *ptr[32],
- *to;
- unsigned int
- divisor[4],
- max_level[4];
-
- if (black_levels > 0) {
- divisor[BLACK_INDEX] = 256/black_levels;
- max_level[BLACK_INDEX] = black_levels - 1;
- }
- else {
- divisor[BLACK_INDEX] = 0;
- max_level[BLACK_INDEX] = 0;
- }
- next_plane[BLACK_INDEX] = black_planes;
-
- for (colorant = 0; colorant < BLACK_INDEX; colorant++) {
- divisor[colorant] = 256/non_black_levels;
- max_level[colorant] = non_black_levels - 1;
- next_plane[colorant] = (3 - colorant)*non_black_planes + black_planes;
- }
-
- for (plane = 0; plane < planes; plane++) ptr[plane] = bitplanes[plane].str;
-
- /* Loop over pixels in the scan line. Note that 'pixels' may increase
- within the loop. */
- for (pixel = 0, pixel_mod_8 = 8; pixel < pixels; pixel++, pixel_mod_8++) {
- if (pixel_mod_8 == 8) {
- pixel_mod_8 = 0;
- for (plane = 0; plane < planes; plane++) *ptr[plane] = 0;
- }
-
- /* Loop over colorants within a scan line */
- for (colorant = last_colorant; colorant >= 0; colorant--) {
- from = line->str + pixel*OCTETS_PER_PIXEL + colorant;
-
- /* Determine approximation and error for this pixel */
- approx[colorant] = *from/divisor[colorant];
- error = *from - (255*approx[colorant])/max_level[colorant];
- /* The sign of 'error' is chosen such that 'error' is positive if
- colorant intensity has to be added to the picture. */
-
- error_propagation_colour()
- }
-
- /* Determine the black component for CMY+K */
- if (colour_model == eprn_DeviceCMY_plus_K &&
- approx[0] == approx[1] && approx[1] == approx[2] && approx[0] > 0) {
- int value = approx[0]*(black_levels - 1);
- if (value % (non_black_levels - 1) == 0) {
- /* Black does have a level at the same intensity as the CMY levels */
- approx[BLACK_INDEX] = value/(non_black_levels - 1);
- approx[0] = approx[1] = approx[2] = 0;
- }
- }
-
- /* Distribute the approximation over the bit planes */
- plane = 0;
- for (colorant = last_colorant; colorant >= 0; colorant--) {
- while (plane < next_plane[colorant]) {
- *ptr[plane] = (*ptr[plane] << 1) | approx[colorant] & 0x01;
- approx[colorant] >>= 1;
- plane++;
- }
- }
-
- if (pixel_mod_8 == 7) {
- int j;
- for (j = 0; j < planes; j++) ptr[j]++;
- }
- }
-
- eprn_finalize(colour_model == eprn_DeviceRGB, non_black_levels, planes,
- bitplanes, ptr, pixels);
-
- return;
-}
-
-/******************************************************************************
-
- Function: eprn_split_FS
-
- This function performs Floyd-Steinberg error diffusion on a scan line
- and returns the result as bitplanes.
-
- 'line' points to the scan line to be split, 'next_line' to the following one.
- Both lines will be modified by this process. This modification assumes that
- the function is called successively for all lines, starting with the first.
- All octets up to 'max_octets' must be available in the input lines and, as
- far as they have not been included in the length fields, must be zero.
- The parameter 'colour_model' specifies the process colour model used.
- 'black_levels' is the number of intensity levels for the black colorant,
- 'non_black_levels' the corresponding number for the other colorants.
- 'bitplanes' is an array of bitplanes into which the result will be stored
- in the usual format.
-
-******************************************************************************/
-
-void eprn_split_FS(eprn_OctetString *line, eprn_OctetString *next_line,
- int max_octets, eprn_ColourModel colour_model,
- unsigned int black_levels, unsigned int non_black_levels,
- eprn_OctetString bitplanes[])
-{
- if (colour_model == eprn_DeviceGray) {
- if (black_levels == 2)
- split_Gray_2(line, next_line, max_octets, bitplanes);
- else
- split_Gray(line, next_line, max_octets, black_levels, bitplanes);
- }
- else if (colour_model == eprn_DeviceCMYK &&
- black_levels == 2 && non_black_levels == 2)
- split_colour_CMYK_2(line, next_line, max_octets, bitplanes);
- else {
- if (black_levels <= 2 && non_black_levels == 2)
- split_colour_at_most_2(line, next_line, max_octets, colour_model,
- bitplanes);
- else
- split_colour(line, next_line, max_octets, colour_model, black_levels,
- non_black_levels, bitplanes);
- }
-
- return;
-}
diff --git a/gs/contrib/pcl3/eprn/eprnparm.c b/gs/contrib/pcl3/eprn/eprnparm.c
deleted file mode 100644
index 9473aac00..000000000
--- a/gs/contrib/pcl3/eprn/eprnparm.c
+++ /dev/null
@@ -1,1231 +0,0 @@
-/******************************************************************************
- File: $Id: eprnparm.c,v 1.24 2001/08/18 17:42:34 Martin Rel $
- Contents: Device parameter handling for the ghostscript device 'eprn'
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany. E-mail: Martin.Lottermoser@t-online.de.
-
-*******************************************************************************
-* *
-* Copyright (C) 2000, 2001 by Martin Lottermoser *
-* All rights reserved *
-* *
-*******************************************************************************
-
- Preprocessor symbols:
-
- EPRN_GS_HAS_MEDIAPOSITION
- Define this if ghostscript should in the future implement the standard
- PostScript page device parameter "MediaPosition" as a device parameter.
- Otherwise it will be stored in the eprn device. Note that
- ghostscript's input media selection algorithm *does* react to the
- parameter, and you could also specify it from PostScript. This
- implementation is only needed to make the parameter available as a
- command line option.
-
- EPRN_NO_PAGECOUNTFILE
- Define this if you do not want to use eprn's pagecount-file feature.
- You very likely must define this on Microsoft Windows.
-
- EPRN_TRACE
- Define this to enable tracing. Only useful for development.
-
-******************************************************************************/
-
-/* Configuration management identification */
-#ifndef lint
-static const char
- cm_id[] = "@(#)$Id: eprnparm.c,v 1.24 2001/08/18 17:42:34 Martin Rel $";
-#endif
-
-/*****************************************************************************/
-
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE 500
-#endif
-
-/* Special Aladdin header, must be included before <sys/types.h> on some
- platforms (e.g., FreeBSD). */
-#include "std.h"
-
-/* Standard headers */
-#include <assert.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* Ghostscript headers */
-#ifdef EPRN_TRACE
-#include "gdebug.h"
-#endif /* EPRN_TRACE */
-
-/* Special headers */
-#include "gdeveprn.h"
-
-/*****************************************************************************/
-
-#define ERRPREF "? eprn: "
-#define WARNPREF "?-W eprn: "
-
-/*****************************************************************************/
-
-/* Data structures for string arguments to parameters */
-
-const eprn_StringAndInt
- /* Colour models */
- eprn_colour_model_list[] = {
- /* Values of type 'eprn_ColourModel' are assumed to be usable as indices
- into this array in order to find string representations for them. */
- { "Gray", eprn_DeviceGray },
- { "RGB", eprn_DeviceRGB },
- { "CMY", eprn_DeviceCMY },
- { "CMY+K", eprn_DeviceCMY_plus_K },
- { "CMYK", eprn_DeviceCMYK },
- { NULL, 0 }
- };
-
-static const eprn_StringAndInt
- /* Intensity rendering methods */
- intensity_rendering_list[] = {
- { "printer", eprn_IR_printer },
- { "halftones", eprn_IR_halftones },
- { "Floyd-Steinberg", eprn_IR_FloydSteinberg },
- { NULL, 0}
- };
-
-/******************************************************************************
-
- Function: eprn_get_string
-
- This function returns a string representation of 'in_value' in '*out_value',
- based on 'table'. 'table' must be an array terminated with an entry having
- NULL as the 'name' value and must be permanently allocated and constant.
- If 'in_value' cannot be found in 'table', the function returns a non-zero
- value, otherwise zero.
-
- The string buffer in '*out_value' will be a statically allocated area which
- must not be modified.
-
-******************************************************************************/
-
-int eprn_get_string(int in_value, const eprn_StringAndInt *table,
- gs_param_string *out_value)
-{
- while (table->name != NULL && table->value != in_value) table++;
- if (table->name == NULL) return -1;
-
- out_value->data = (const byte *)table->name;
- out_value->size = strlen(table->name);
- out_value->persistent = true;
-
- return 0;
-}
-
-/******************************************************************************
-
- Function: eprn_get_int
-
- This function parses 'in_value' based on 'table' and returns the result in
- '*out_value'. 'table' must be an array, terminated with an entry having NULL
- as the value for 'name'.
-
- 'in_value' must be a string present in 'table'. If it is, the function
- returns 0, otherwise a non-zero ghostscript error value.
-
- On returning 'gs_error_VMerror', the function will have issued an error
- message.
-
-******************************************************************************/
-
-int eprn_get_int(const gs_param_string *in_value,
- const eprn_StringAndInt *table, int *out_value)
-{
- char *s;
-
- /* First we construct a properly NUL-terminated string */
- s = (char *) malloc(in_value->size + 1);
- if (s == NULL) {
- fprintf(stderr, ERRPREF
- "Memory allocation failure in eprn_get_int(): %s.\n",
- strerror(errno));
- return_error(gs_error_VMerror);
- }
- strncpy(s, (const char *)in_value->data, in_value->size);
- s[in_value->size] = '\0';
-
- /* Loop over table */
- while (table->name != NULL && strcmp(table->name, s) != 0) table++;
- if (table->name != NULL) *out_value = table->value;
- else {
- free(s); s = NULL;
- return_error(gs_error_rangecheck);
- }
-
- free(s); s = NULL;
-
- return 0;
-}
-
-/******************************************************************************
-
- Function: eprn_dump_parameter_list
-
- This function is only used for debugging. It dumps the names of the
- parameters in the parameter list 'plist' on the debugging stream.
-
-******************************************************************************/
-
-#ifdef EPRN_TRACE
-
-void eprn_dump_parameter_list(gs_param_list *plist)
-{
- gs_param_enumerator_t iterator;
- gs_param_key_t key;
- int count = 0;
-
- param_init_enumerator(&iterator);
- while (param_get_next_key(plist, &iterator, &key) == 0) {
- int j;
-
- count++;
- dlprintf(" `");
- for (j = 0; j < key.size; j++) dputc(key.data[j]);
- dprintf("'\n");
- }
- dlprintf1(" Number of parameters: %d.\n", count);
-
- return;
-}
-
-#endif /* EPRN_TRACE */
-/******************************************************************************
-
- Function: eprn_get_params
-
- This function returns to the caller information about the values of
- parameters defined for the device in the 'eprn' part and its base devices.
-
- The function returns zero on success and a negative value on error.
-
-******************************************************************************/
-
-int eprn_get_params(gx_device *device, gs_param_list *plist)
-{
- gs_param_string string_value;
- const eprn_Eprn *eprn = &((eprn_Device *)device)->eprn;
- int rc;
-
-#ifdef EPRN_TRACE
- if_debug0(EPRN_TRACE_CHAR, "! eprn_get_params()...\n");
-#endif
-
- /* Base class parameters */
- rc = gdev_prn_get_params(device, plist);
- if (rc < 0) return rc;
-
- /* Number of intensity levels. The casts are used to get rid of compiler
- warnings because the *_levels are unsigned. */
- if ((rc = param_write_int(plist, "BlackLevels",
- (const int *)&eprn->black_levels)) < 0) return rc;
- if ((rc = param_write_int(plist, "CMYLevels",
- (const int *)&eprn->non_black_levels)) < 0) return rc;
- if ((rc = param_write_int(plist, "RGBLevels",
- (const int *)&eprn->non_black_levels)) < 0) return rc;
-
- /* Colour model */
- eprn_get_string(eprn->colour_model, eprn_colour_model_list, &string_value);
- if ((rc = param_write_string(plist, "ColourModel", &string_value)) < 0 ||
- (rc = param_write_string(plist, "ColorModel", &string_value)) < 0)
- return rc;
-
- /* CUPS page accounting */
- if ((rc = param_write_bool(plist, "CUPSAccounting", &eprn->CUPS_accounting))
- < 0) return rc;
-
- /* CUPS message format */
- if ((rc = param_write_bool(plist, "CUPSMessages", &eprn->CUPS_messages)) < 0)
- return rc;
-
- /* Intensity rendering */
- eprn_get_string(eprn->intensity_rendering, intensity_rendering_list,
- &string_value);
- if ((rc = param_write_string(plist, "IntensityRendering", &string_value)) < 0)
- return rc;
-
- /* Leading edge */
- if (eprn->leading_edge_set) {
- if ((rc = param_write_int(plist, "LeadingEdge", &eprn->default_orientation))
- < 0) return rc;
- }
- else
- if ((rc = param_write_null(plist, "LeadingEdge")) < 0) return rc;
-
- /* Media configuration file */
- if (eprn->media_file == NULL) {
- if ((rc = param_write_null(plist, "MediaConfigurationFile")) < 0)
- return rc;
- }
- else {
- string_value.data = (const byte *)eprn->media_file;
- string_value.size = strlen((const char *)string_value.data);
- string_value.persistent = false;
- if ((rc =
- param_write_string(plist, "MediaConfigurationFile", &string_value)) < 0)
- return rc;
- }
-
-#ifndef EPRN_GS_HAS_MEDIAPOSITION
- /* Requested input media position */
- if (eprn->media_position_set) {
- if ((rc = param_write_int(plist, "MediaPosition", &eprn->media_position))
- < 0) return rc;
- }
- else
- if ((rc = param_write_null(plist, "MediaPosition")) < 0) return rc;
-#endif /* EPRN_GS_HAS_MEDIAPOSITION */
-
-#ifndef EPRN_NO_PAGECOUNTFILE
- /* Page count file */
- if (eprn->pagecount_file == NULL) {
- if ((rc = param_write_null(plist, "PageCountFile")) < 0) return rc;
- }
- else {
- string_value.data = (const byte *)eprn->pagecount_file;
- string_value.size = strlen((const char *)string_value.data);
- string_value.persistent = false;
- if ((rc = param_write_string(plist, "PageCountFile", &string_value)) < 0)
- return rc;
- }
-#endif /* EPRN_NO_PAGECOUNTFILE */
-
- return 0;
-}
-
-/******************************************************************************
-
- Function: is_word
-
- This function returns a non-zero value iff the string beginning at 's' is
- identical with the string pointed to by 'word' and is followed either by a
- blank character or '\0'.
-
-******************************************************************************/
-
-static int is_word(const char *s, const char *word)
-{
- size_t l = strlen(word);
- if (strncmp(s, word, l) != 0) return 0;
- return s[l] == '\0' || isspace(s[l]);
-}
-
-/******************************************************************************
-
- Function: next_word
-
- This function returns a pointer to the beginning of the next blank-separated
- word in the string pointed to by 's'. If s[0] is not blank, the character is
- considered to be part of the current word, i.e. the word to be returned is
- the one following.
-
- If there is no next word in this sense, the function returns NULL.
-
-******************************************************************************/
-
-static char *next_word(char *s)
-{
- /* Skip current word */
- while (*s != '\0' && !isspace(*s)) s++;
-
- /* Skip intermediate blanks */
- while (*s != '\0' && isspace(*s)) s++;
-
- return *s == '\0'? NULL: s;
-}
-
-/******************************************************************************
-
- Function: eprn_read_media_data
-
- This function reads a media configuration file and stores the result in
- '*eprn'. The file name must already have been stored in 'eprn->media_file',
- 'eprn->media_overrides' should be NULL.
-
- The function returns zero on success and a non-zero ghostscript error value
- otherwise. In the latter case, an error message will have been issued on
- stderr.
-
-******************************************************************************/
-
-#define BUFFER_SIZE 200
- /* should be large enough for a single line */
-
-#define cleanup() (free(list), fclose(f))
-
-
-static int eprn_read_media_data(eprn_Eprn *eprn)
-{
- char buffer[BUFFER_SIZE];
- const char
- *epref = eprn->CUPS_messages? CUPS_ERRPREF: "",
- *wpref = eprn->CUPS_messages? CUPS_WARNPREF: "";
- FILE *f;
- float conversion_factor = BP_PER_IN;
- /* values read have to be multiplied by this value to obtain bp */
- int
- line = 0, /* line number */
- read = 0; /* number of entries read so far */
- eprn_PageDescription *list = NULL;
-
- /* Open the file */
- if ((f = fopen(eprn->media_file, "r")) == NULL) {
- fprintf(stderr, "%s" ERRPREF "Error opening the media configuration file\n"
- "%s `%s'\n%s for reading: %s.\n",
- epref, epref, eprn->media_file, epref, strerror(errno));
- return_error(gs_error_invalidfileaccess);
- }
-
- /* Loop over input lines */
- while (fgets(buffer, BUFFER_SIZE, f) != NULL) {
- char *s, *t;
- eprn_PageDescription *current;
- int chars_read;
-
- line++;
-
- /* Check for buffer overflow */
- if ((s = strchr(buffer, '\n')) == NULL && fgetc(f) != EOF) {
- fprintf(stderr, "%s" ERRPREF "Exceeding line length %d in "
- "media configuration file\n%s %s, line %d.\n",
- epref, BUFFER_SIZE - 2 /* '\n'+'\0' */, epref, eprn->media_file, line);
- cleanup();
- return_error(gs_error_limitcheck);
- }
-
- /* Eliminate the newline character */
- if (s != NULL) *s = '\0';
-
- /* Originally, I did nothing further at this point and used a
- "%g %g %g %g %n" format in the sscanf() call below to skip trailing
- blanks. This does not work with Microsoft Visual C up to at least
- version 6 (_MSC_VER is 1200) because the variable for %n will never be
- set. If one drops the blank, it will be set, also if there are
- additional directives after %n. In addition, Cygwin does not (as of
- early 2001) set the %n variable if there is trailing white space in the
- string scanned. I don't want to know what's going on there, I just
- foil these bugs by removing all trailing white space from the input
- line which means I don't have to scan it afterwards.
- */
- if (s == NULL) s = strchr(buffer, '\0');
- while (buffer < s && isspace(*(s-1))) s--;
- *s = '\0';
-
- /* Ignore blank and comment lines */
- s = buffer;
- while (isspace(*s)) s++;
- if (*s == '\0' || *s == '#') continue;
-
- /* Check for unit specification */
- if (is_word(s, "unit")) {
- char *unit_name = next_word(s);
- if (unit_name != NULL) {
- s = next_word(unit_name);
- if (s == NULL) {
- if (is_word(unit_name, "in")) {
- conversion_factor = BP_PER_IN;
- continue;
- }
- if (is_word(unit_name, "mm")) {
- conversion_factor = BP_PER_MM;
- continue;
- }
- }
- /* If 's' is not NULL or the unit is not recognized, the error message
- will be generated when the attempt to read the whole line as a media
- specification will fail because there is no media size called
- "unit". */
- }
- }
-
- /* Extend the list */
- {
- eprn_PageDescription *new_list;
- new_list = (eprn_PageDescription *)
- realloc(list, (read+1)*sizeof(eprn_PageDescription));
- if (new_list == NULL) {
- fprintf(stderr, "%s" ERRPREF
- "Memory allocation failure in eprn_read_media_data(): %s.\n",
- epref, strerror(errno));
- cleanup();
- return_error(gs_error_VMerror);
- }
- list = new_list;
- }
-
- /* Set 'current' on the new entry */
- current = list + read;
-
- /* Isolate and identify the media size name */
- s = buffer;
- while (isspace(*s)) s++;
- t = s + 1; /* we checked above that the line is not empty */
- while (*t != '\0' && !isspace(*t)) t++;
- if (*t != '\0') {
- *t = '\0';
- t++;
- }
- {
- ms_MediaCode code = ms_find_code_from_name(s, eprn->flag_desc);
- if (code == ms_none) {
- fprintf(stderr, "%s" ERRPREF "Unknown media name (%s) in "
- "media configuration file\n%s %s, line %d.\n",
- epref, s, epref, eprn->media_file, line);
- cleanup();
- return_error(gs_error_rangecheck);
- }
- if (code & MS_ROTATED_FLAG) {
- fprintf(stderr, "%s" ERRPREF "Invalid substring \"" MS_ROTATED_STRING
- "\" in media name (%s)\n"
- "%s in media configuration file %s, line %d.\n",
- epref, s, epref, eprn->media_file, line);
- cleanup();
- return_error(gs_error_rangecheck);
- }
- current->code = code;
- }
-
- /* Look for margins */
- if (sscanf(t, "%g %g %g %g%n", &current->left,
- &current->bottom, &current->right, &current->top, &chars_read) != 4 ||
- t[chars_read] != '\0') {
- if (*t != '\0') *(t-1) = ' '; /* remove NUL after media name */
- fprintf(stderr, "%s" ERRPREF
- "Syntax error in media configuration file %s, line %d:\n%s %s\n",
- epref, eprn->media_file, line, epref, buffer);
- cleanup();
- return_error(gs_error_rangecheck);
- }
-
- /* Check for sign */
- if (current->left < 0 || current->bottom < 0 || current->right < 0 ||
- current->top < 0) {
- fprintf(stderr, "%s" ERRPREF
- "Ghostscript does not support negative margins (line %d in the\n"
- "%s media configuration file %s).\n",
- epref, line, epref, eprn->media_file);
- cleanup();
- return_error(gs_error_rangecheck);
- }
-
- read++;
-
- /* Convert to bp */
- current->left *= conversion_factor;
- current->bottom *= conversion_factor;
- current->right *= conversion_factor;
- current->top *= conversion_factor;
-
- /* A margin for custom page sizes without the corresponding capability in
- the printer is useless although it would not lead to a failure of eprn.
- The user might not notice the reason without help, hence we check. */
- if (ms_without_flags(current->code) == ms_CustomPageSize &&
- eprn->cap->custom == NULL)
- fprintf(stderr, "%s" WARNPREF "The media configuration file %s\n"
- "%s contains a custom page size entry in line %d, "
- "but custom page sizes\n"
- "%s are not supported by the %s.\n",
- wpref, eprn->media_file, wpref, line, wpref, eprn->cap->name);
- }
- if (ferror(f)) {
- fprintf(stderr, "%s" ERRPREF
- "Unidentified system error while reading `%s'.\n",
- epref, eprn->media_file);
- cleanup();
- return_error(gs_error_invalidfileaccess);
- }
- fclose(f);
-
- /* Was the file empty? */
- if (read == 0) {
- fprintf(stderr, "%s" ERRPREF "The media configuration file %s\n"
- "%s does not contain any media information.\n",
- epref, eprn->media_file, epref);
- return_error(gs_error_rangecheck);
- }
-
- /* Create a list in the device structure */
- eprn->media_overrides = (eprn_PageDescription *) gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), read + 1,
- sizeof(eprn_PageDescription), "eprn_read_media_data");
- if (eprn->media_overrides == NULL) {
- fprintf(stderr, "%s" ERRPREF
- "Memory allocation failure from gs_malloc() in eprn_read_media_data().\n",
- epref);
- free(list);
- return_error(gs_error_VMerror);
- }
-
- /* Copy the list and set the sentinel entry */
- memcpy(eprn->media_overrides, list, read*sizeof(eprn_PageDescription));
- eprn->media_overrides[read].code = ms_none;
-
- /* Cleanup */
- free(list);
-
- return 0;
-}
-
-#undef BUFFER_SIZE
-#undef cleanup
-
-/******************************************************************************
-
- Function: eprn_set_media_data
-
- This function sets the media size and margin information in an 'eprn' device
- from the specified media configuration file.
-
- The return code will be zero an success and a ghostscript error code
- otherwise. In the latter case, an error message will have been issued on
- stderr.
-
- The 'length' may be positive in which case it denotes the length of the
- string 'media_file' or zero in which case the string is assumed to be
- NUL-terminated.
-
- A NULL value or an empty string for 'media_file' is permitted and removes
- all previous media descriptions read from a media configuration file.
-
-******************************************************************************/
-
-int eprn_set_media_data(eprn_Device *dev, const char *media_file, size_t length)
-{
- eprn_Eprn *eprn = &dev->eprn;
- const char *epref = eprn->CUPS_messages? CUPS_ERRPREF: "";
- int rc = 0;
-
- /* Any previous size determination is obsolete now */
- eprn->code = ms_none;
-
- /* Free old storage */
- if (eprn->media_file != NULL) {
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), eprn->media_file, strlen(eprn->media_file) + 1,
- sizeof(char), "eprn_set_media_data");
- eprn->media_file = NULL;
- }
- if (eprn->media_overrides != NULL) {
- int n = 0;
- while (eprn->media_overrides[n].code != ms_none) n++;
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), eprn->media_overrides, n+1, sizeof(eprn_PageDescription),
- "eprn_set_media_data");
- eprn->media_overrides = NULL;
- }
-
- /* Set the file name length if not given */
- if (media_file != NULL && length == 0) length = strlen(media_file);
-
- /* Read media configuration file, unless the name is NULL or the empty
- string */
- if (media_file != NULL && length > 0) {
- eprn->media_file = (char *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), length + 1, sizeof(char),
- "eprn_set_media_data");
- if (eprn->media_file == NULL) {
- fprintf(stderr, "%s" ERRPREF
- "Memory allocation failure from gs_malloc() in "
- "eprn_set_media_data().\n",
- epref);
- rc = gs_error_VMerror;
- }
- else {
- strncpy(eprn->media_file, media_file, length);
- eprn->media_file[length] = '\0';
- if ((rc = eprn_read_media_data(eprn)) != 0) {
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), eprn->media_file, length + 1, sizeof(char),
- "eprn_set_media_data");
- eprn->media_file = NULL;
- }
- }
- }
-
- return rc;
-}
-
-/******************************************************************************
-
- Function: eprn_bits_for_levels
-
- This function returns the number of bits used to represent 'levels' intensity
- levels. 'levels' must be <= (ULONG_MAX+1)/2.
-
-******************************************************************************/
-
-unsigned int eprn_bits_for_levels(unsigned int levels)
-{
- unsigned int bits = 0;
- unsigned long n;
-
- for (n = 1; n < levels; n *= 2) bits++;
-
- return bits;
-}
-
-/******************************************************************************
-
- Function: res_supported
-
- 'list' must either bei NULL (all resolutions are accepted) or point to a
- list of resolutions terminated with a {0.0, 0.0} entry.
-
-******************************************************************************/
-
-static bool res_supported(const eprn_Resolution *list, float hres, float vres)
-{
- if (list == NULL) return true;
-
- while (list->h > 0.0 && (list->h != hres || list->v != vres)) list++;
-
- return list->h > 0.0;
-}
-
-/******************************************************************************
-
- Function: levels_supported
-
- 'list' may not be NULL and must point to a {0,0}-terminated list of
- supported ranges.
-
-******************************************************************************/
-
-static bool levels_supported(const eprn_IntensityLevels *list,
- unsigned int levels)
-{
- while (list->from > 0 && (levels < list->from || list->to < levels)) list++;
-
- return list->from > 0;
-}
-
-/******************************************************************************
-
- Function: reslev_supported
-
-******************************************************************************/
-
-static int reslev_supported(const eprn_ResLev *entry, float hres, float vres,
- unsigned int levels)
-{
- return res_supported(entry->resolutions, hres, vres) &&
- levels_supported(entry->levels, levels);
-}
-
-/******************************************************************************
-
- Function: eprn_check_colour_info
-
- This function checks the arguments starting at 'model' whether they are
- supported according to 'list'. This list must satisfy the constraints for
- 'colour_info' in 'eprn_PrinterDescription'.
-
- The function returns zero if the values are supported and a non-zero value
- if they are not.
-
-******************************************************************************/
-
-int eprn_check_colour_info(const eprn_ColourInfo *list,
- eprn_ColourModel *model, float *hres, float *vres,
- unsigned int *black_levels, unsigned int *non_black_levels)
-{
- const eprn_ColourInfo *entry;
-
- /* Search for a match. Successful exits are in the middle of the loop. */
- for (entry = list; entry->info[0] != NULL; entry++)
- if (entry->colour_model == *model ||
- entry->colour_model == eprn_DeviceCMYK &&
- *model == eprn_DeviceCMY_plus_K) {
- const eprn_ResLev *rl;
- unsigned int levels = (entry->colour_model == eprn_DeviceRGB ||
- entry->colour_model == eprn_DeviceCMY? *non_black_levels:
- *black_levels);
-
- for (rl = entry->info[0]; rl->levels != NULL; rl++)
- if (reslev_supported(rl, *hres, *vres, levels)) {
- const eprn_ResLev *rl2 = NULL;
-
- /* Check on info[1] needed? */
- if (entry->colour_model == eprn_DeviceGray ||
- entry->colour_model == eprn_DeviceRGB ||
- entry->colour_model == eprn_DeviceCMY)
- return 0;
-
- /* CMY+K or CMYK process colour models */
- if (entry->info[1] != NULL) {
- for (rl2 = entry->info[1]; rl2->levels != NULL; rl2++)
- if (reslev_supported(rl2, *hres, *vres, *non_black_levels)) break;
- }
- if (entry->info[1] == NULL && *black_levels == *non_black_levels ||
- entry->info[1] != NULL && rl2->levels != NULL)
- return 0;
- }
- }
-
- return -1;
-}
-
-/******************************************************************************
-
- Function: set_derived_colour_data
-
- This routine determines and sets various derived values in the device
- structure based on the number of black and non-black levels requested.
-
- The values to be set are 'eprn.bits_per_colorant' and the fields 'depth',
- 'max_gray', 'max_color', 'dither_grays' and 'dither_colors' in the
- 'color_info' structure.
-
- The parameters 'black_levels' and 'non_black_levels' must be in the range
- 0 to 256 without 1. At least one of the two must be positive.
-
-******************************************************************************/
-
-static void set_derived_colour_data(eprn_Device *dev)
-{
- eprn_Eprn *eprn = &dev->eprn;
- unsigned int levels;
-
- /* Choose equal number of bits in 'gx_color_index' for all components present
- */
- if (eprn->intensity_rendering == eprn_IR_FloydSteinberg) levels = 256;
- else if (eprn->black_levels >= eprn->non_black_levels)
- levels = eprn->black_levels;
- else levels = eprn->non_black_levels;
- eprn->bits_per_colorant = eprn_bits_for_levels(levels);
-
- /* For the depth, consider all components and adjust to possible values.
- Ghostscript permits pixel depths 1, 2, 4, 8, 16, 24 and 32. */
- dev->color_info.depth =
- (eprn->non_black_levels == 0? 1: 4) * eprn->bits_per_colorant;
- /* No distinction between non-Gray colour models */
- if (dev->color_info.depth > 2) {
- if (dev->color_info.depth <= 4) dev->color_info.depth = 4;
- else if (dev->color_info.depth <= 8) dev->color_info.depth = 8;
- else dev->color_info.depth = ((dev->color_info.depth + 7)/8)*8;
- /* Next multiple of 8 */
- }
-
- /* Set ghostscript's color_info data. This is an area where ghostscript's
- documentation (Drivers.htm) is not particularly intelligible. For
- example: can there be situations where the dither_* parameters are
- different from their corresponding max_* parameter plus one?
- */
- if (eprn->intensity_rendering != eprn_IR_halftones) {
- /* Here we cover two cases: retaining as much colour information as
- possible and effectively setting up 1-pixel halftone cells. Both
- demand that ghostscript is prevented from doing halftoning; the
- remaining difference (which is the essential part) is then handled in
- our colour mapping functions.
- According to Drivers.htm, a value of at least 31 for max_gray or
- max_color (actually, the documentation says "max_rgb") leads to
- ghostscript using the colour returned by the device if valid
- instead of using the dither parameters for halftoning. The actual
- values for the max_* parameters should then be irrelevant.
- */
- if (eprn->non_black_levels > 0) dev->color_info.max_color = 255;
- else dev->color_info.max_color = 0;
- dev->color_info.max_gray = 255;
-
- /* As long as our colour mapping functions return valid color indices, the
- following parameters should be irrelevant. */
- dev->color_info.dither_grays = 256;
- if (dev->color_info.num_components == 1) dev->color_info.dither_colors = 0;
- else dev->color_info.dither_colors = dev->color_info.max_color + 1;
- }
- else {
- /* Let ghostscript do halftoning */
- if (eprn->non_black_levels > 0)
- dev->color_info.max_color = eprn->non_black_levels - 1;
- else dev->color_info.max_color = 0;
- if (eprn->black_levels > 0)
- dev->color_info.max_gray = eprn->black_levels - 1;
- else dev->color_info.max_gray = dev->color_info.max_color;
-
- /* The dither parameters */
- if (eprn->black_levels > 0)
- dev->color_info.dither_grays = eprn->black_levels;
- else dev->color_info.dither_grays = eprn->non_black_levels;
- if (eprn->non_black_levels > 0)
- dev->color_info.dither_colors = eprn->non_black_levels;
- else dev->color_info.dither_colors = 0;
- }
-
- return;
-}
-
-/******************************************************************************
-
- Function: eprn_put_params
-
- This function reads a parameter list, extracts the parameters known to the
- 'eprn' device, and configures the device appropriately. This includes
- parameters defined by base devices.
-
- If an error occurs in the processing of parameters, the function will
- return a negative value, otherwise zero.
-
- This function does *not* exhibit transactional behaviour as requested in
- gsparam.h, i.e. on error the parameter values in the device structure
- might have changed. However, all values will be individually valid.
-
- For most of the parameters an attempt to set them closes the device if it is
- open.
-
-******************************************************************************/
-
-int eprn_put_params(gx_device *dev, gs_param_list *plist)
-{
- bool colour_mode_given_and_valid = false;
- gs_param_name pname;
- gs_param_string string_value;
- eprn_Eprn *eprn = &((eprn_Device *)dev)->eprn;
- const char
- *epref = eprn->CUPS_messages? CUPS_ERRPREF: "",
- *wpref = eprn->CUPS_messages? CUPS_WARNPREF: "";
- float mediasize[2];
- int
- height = dev->height,
- last_error = 0,
- temp,
- rc,
- width = dev->width;
-
-#ifdef EPRN_TRACE
- if (gs_debug_c(EPRN_TRACE_CHAR)) {
- dlprintf(
- "! eprn_put_params() called with the following device parameters:\n");
- eprn_dump_parameter_list(plist);
- }
-#endif /* EPRN_TRACE */
-
- /* Remember initial page size */
- for (temp = 0; temp < 2; temp++) mediasize[temp] = dev->MediaSize[temp];
-
- /* CUPS message format. This should be the first parameter to be set which is
- a problem because it should happen even before the put_params methods of
- derived devices are called. However, note that in a CUPS filter
- "CUPSMessages" will usually be set from the command line while most
- remaining parameters will be set via setpagedevice. Hence this will come
- first anyway except for problems for which the print administrator is
- responsible, not the ordinary user. */
- if ((rc = param_read_bool(plist, "CUPSMessages", &eprn->CUPS_messages)) == 0)
- {
- epref = eprn->CUPS_messages? CUPS_ERRPREF: "";
- wpref = eprn->CUPS_messages? CUPS_WARNPREF: "";
- }
- else if (rc < 0) last_error = rc;
-
- /* Read colour model into 'temp'. For those colonials across the pond we also
- accept the barbarized spelling variant.
- */
-#define colour_model(option) \
- if ((rc = param_read_string(plist, (pname = option), &string_value)) == 0) { \
- rc = eprn_get_int(&string_value, eprn_colour_model_list, &temp); \
- if (rc != 0) { \
- if (rc != gs_error_VMerror) { \
- fprintf(stderr, "%s" ERRPREF "Unknown colour model: `", epref); \
- fwrite(string_value.data, sizeof(char), string_value.size, stderr); \
- fputs("'.\n", stderr); \
- } \
- last_error = rc; \
- param_signal_error(plist, pname, last_error); \
- } \
- else colour_mode_given_and_valid = true; \
- } \
- else if (rc < 0) last_error = rc;
-
- colour_model("ColorModel")
- colour_model("ColourModel") /* overrides if both are given */
-
-#undef colour_model
-
- if (colour_mode_given_and_valid) {
- if (eprn->colour_model != temp && dev->is_open) gs_closedevice(dev);
- /* The close_device method can fail, but what should I do then? */
- eprn->colour_model = temp;
-
- /* Set the native colour space */
- switch(eprn->colour_model) {
- case eprn_DeviceGray:
- dev->color_info.num_components = 1; break;
- case eprn_DeviceRGB:
- /*FALLTHROUGH*/
- case eprn_DeviceCMY:
- /*FALLTHROUGH*/
- case eprn_DeviceCMY_plus_K:
- dev->color_info.num_components = 3; break;
- case eprn_DeviceCMYK:
- dev->color_info.num_components = 4; break;
- default:
- assert(0);
- }
-
- dev->color_info.polarity =
- dci_std_polarity(dev->color_info.num_components);
-
- /* Adjust black levels */
- if (eprn->colour_model == eprn_DeviceCMY ||
- eprn->colour_model == eprn_DeviceRGB) {
- if (eprn->black_levels != 0) eprn->black_levels = 0;
- }
- else
- if (eprn->black_levels == 0) eprn->black_levels = 2;
- /* Adjust non-black levels if they are too small for colour */
- if (dev->color_info.num_components > 1 && eprn->non_black_levels <= 0)
- eprn->non_black_levels = 2;
-
- /* Adjustments to pixel depth, 'max_gray', 'max_color' and dither levels
- will occur near the end of this routine */
- }
-
- /* BlackLevels. Various depending values will be adjusted below. */
- if ((rc = param_read_int(plist, (pname = "BlackLevels"), &temp)) == 0) {
- if (temp == 0 && (eprn->colour_model == eprn_DeviceRGB ||
- eprn->colour_model == eprn_DeviceCMY) ||
- 2 <= temp && temp <= 256 &&
- eprn->colour_model != eprn_DeviceRGB &&
- eprn->colour_model != eprn_DeviceCMY) {
- if (eprn->black_levels != temp && dev->is_open) gs_closedevice(dev);
- eprn->black_levels = temp;
- }
- else {
- fprintf(stderr, "%s" ERRPREF
- "The value for BlackLevels is outside the range permitted: %d.\n",
- epref, temp);
- last_error = gs_error_rangecheck;
- param_signal_error(plist, pname, last_error);
- }
- }
- else if (rc < 0) last_error = rc;
-
- /* CMYLevels */
- if ((rc = param_read_int(plist, (pname = "CMYLevels"), &temp)) == 0) {
- if (temp == 0 && eprn->colour_model == eprn_DeviceGray ||
- 2 <= temp && temp <= 256 && eprn->colour_model != eprn_DeviceGray) {
- if (eprn->non_black_levels != temp && dev->is_open) gs_closedevice(dev);
- eprn->non_black_levels = temp;
- }
- else {
- fprintf(stderr, "%s" ERRPREF
- "The value for CMYLevels is outside the range permitted: %d.\n",
- epref, temp);
- last_error = gs_error_rangecheck;
- param_signal_error(plist, pname, last_error);
- }
- }
- else if (rc < 0) last_error = rc;
-
- /* CUPS page accounting messages */
- {
- bool temp;
- if ((rc = param_read_bool(plist, "CUPSAccounting", &temp)) == 0) {
- if (eprn->CUPS_accounting && !temp)
- fputs(CUPS_WARNPREF WARNPREF
- "Attempt to set CUPSAccounting from true to false.\n", stderr);
- else eprn->CUPS_accounting = temp;
- }
- else if (rc < 0) last_error = rc;
- }
-
- /* Intensity rendering */
- if ((rc = param_read_string(plist, (pname = "IntensityRendering"),
- &string_value)) == 0) {
- rc = eprn_get_int(&string_value, intensity_rendering_list, &temp);
- if (rc == 0) {
- if (temp != eprn->intensity_rendering && dev->is_open)
- gs_closedevice(dev);
- eprn->intensity_rendering = temp;
- }
- else {
- fprintf(stderr, "%s" ERRPREF "Invalid method for IntensityRendering: `",
- epref);
- fwrite(string_value.data, sizeof(char), string_value.size, stderr);
- fputs("'.\n", stderr);
- last_error = gs_error_rangecheck;
- param_signal_error(plist, pname, last_error);
- }
- }
- else if (rc < 0) last_error = rc;
-
- /* Leading edge */
- if ((rc = param_read_null(plist, (pname = "LeadingEdge"))) == 0) {
- if (eprn->leading_edge_set && dev->is_open) gs_closedevice(dev);
- eprn->leading_edge_set = false;
- }
- else if (rc < 0 && rc != gs_error_typecheck) last_error = rc;
- else if ((rc = param_read_int(plist, (pname = "LeadingEdge"), &temp)) == 0) {
- if (0 <= temp && temp <= 3) {
- if ((!eprn->leading_edge_set || eprn->default_orientation != temp) &&
- dev->is_open) gs_closedevice(dev);
- eprn->leading_edge_set = true;
- eprn->default_orientation = temp;
- }
- else {
- fprintf(stderr,
- "%s" ERRPREF "LeadingEdge may only have values 0 to 3, not %d.\n",
- epref, temp);
- last_error = gs_error_rangecheck;
- param_signal_error(plist, pname, last_error);
- }
- }
- else if (rc < 0) last_error = rc;
-
- /* Media configuration file */
- if ((rc = param_read_null(plist, (pname = "MediaConfigurationFile"))) == 0) {
- if (eprn->media_file != NULL && dev->is_open) gs_closedevice(dev);
- rc = eprn_set_media_data((eprn_Device *)dev, NULL, 0);
- }
- else if (rc < 0 && rc != gs_error_typecheck) last_error = rc;
- else if ((rc = param_read_string(plist, pname, &string_value)) == 0) {
- if (string_value.size > 0) {
- if ((eprn->media_file == NULL ||
- strncmp(eprn->media_file, (const char *)string_value.data,
- string_value.size) != 0 ||
- eprn->media_file[string_value.size] != '\0') && dev->is_open)
- gs_closedevice(dev);
- rc = eprn_set_media_data((eprn_Device *)dev,
- (const char *)string_value.data, string_value.size);
- }
- else {
- if (eprn->media_file != NULL && dev->is_open) gs_closedevice(dev);
- rc = eprn_set_media_data((eprn_Device *)dev, NULL, 0);
- }
-
- if (rc != 0) {
- last_error = rc;
- param_signal_error(plist, pname, last_error);
- }
- }
- else if (rc < 0) last_error = rc;
-
-#ifndef EPRN_GS_HAS_MEDIAPOSITION
- if ((rc = param_read_null(plist, (pname = "MediaPosition"))) == 0)
- eprn->media_position_set = false;
- else if (rc < 0 && (rc = param_read_int(plist, pname, &eprn->media_position))
- == 0) {
- /* Current (up to at least gs 6.50) ghostscript versions do not accept
- negative MediaPosition values. */
- if (eprn->media_position < 0)
- fprintf(stderr, "%s" WARNPREF
- "Ghostscript does not accept negative values (%d) for the\n"
- "%s `MediaPosition' parameter.\n",
- wpref, eprn->media_position, wpref);
- /* The error message is left for ghostscript to generate during input
- media selection, should such an entry be a match. */
- eprn->media_position_set = true;
- }
- else if (rc < 0) last_error = rc;
-#endif /* EPRN_GS_HAS_MEDIAPOSITION */
-
-#ifndef EPRN_NO_PAGECOUNTFILE
- /* Page count file */
- if ((rc = param_read_null(plist, (pname = "PageCountFile"))) == 0) {
- if (eprn->pagecount_file != NULL) {
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), eprn->pagecount_file, strlen(eprn->pagecount_file) + 1,
- sizeof(char), "eprn_put_params");
- eprn->pagecount_file = NULL;
- }
- }
- else if (rc < 0 && rc != gs_error_typecheck) last_error = rc;
- else if ((rc = param_read_string(plist, pname, &string_value)) == 0) {
- /* Free old storage */
- if (eprn->pagecount_file != NULL) {
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), eprn->pagecount_file, strlen(eprn->pagecount_file) + 1,
- sizeof(char), "eprn_put_params");
- eprn->pagecount_file = NULL;
- }
-
- /* Store file name unless it is the empty string */
- if (string_value.size > 0) {
- eprn->pagecount_file = (char *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), string_value.size + 1,
- sizeof(char), "eprn_put_params");
- if (eprn->pagecount_file == NULL) {
- fprintf(stderr, "%s" ERRPREF
- "Memory allocation failure from gs_malloc() in eprn_put_params().\n",
- epref);
- last_error = gs_error_VMerror;
- param_signal_error(plist, pname, last_error);
- }
- else {
- strncpy(eprn->pagecount_file, (const char *)string_value.data,
- string_value.size);
- eprn->pagecount_file[string_value.size] = '\0';
- }
- }
- }
-#endif /* EPRN_NO_PAGECOUNTFILE */
-
- /* RGBLevels */
- if ((rc = param_read_int(plist, (pname = "RGBLevels"), &temp)) == 0) {
- if (temp == 0 || 2 <= temp && temp <= 256) {
- if (eprn->non_black_levels != temp && dev->is_open) gs_closedevice(dev);
- eprn->non_black_levels = temp;
- }
- else {
- fprintf(stderr, "%s" ERRPREF
- "The value for RGBLevels is outside the range permitted: %d.\n",
- epref, temp);
- last_error = gs_error_rangecheck;
- param_signal_error(plist, pname, last_error);
- }
- }
- else if (rc < 0) last_error = rc;
-
- /* Determine various derived colour parameters */
- set_derived_colour_data((eprn_Device *)dev);
-
- /* Catch a specification of BitsPerPixel --- otherwise a wrong value gives
- just a rangecheck error from gs without any readily understandable
- information (see gx_default_put_params()). This confused one hpdj user
- so much that he wrote in a newsgroup that gs was dumping core in this
- case :-).
- */
- if ((rc = param_read_int(plist, (pname = "BitsPerPixel"), &temp)) == 0) {
- if (temp != dev->color_info.depth) {
- fprintf(stderr, "%s" ERRPREF
- "Attempt to set `BitsPerPixel' to a value (%d)\n"
- "%s other than the one selected by the driver.\n",
- epref, temp, epref);
- last_error = gs_error_rangecheck;
- param_signal_error(plist, pname, last_error);
- }
- } else if (rc < 0) last_error = rc;
-
- /* Check whether ".HWMargins" is specified and, if it is, refrain from
- overwriting it. */
- {
- gs_param_typed_value temp;
- if (param_read_typed(plist, ".HWMargins", &temp) == 0) {
- /* ".HWMargins" is specified */
-#ifdef EPRN_TRACE
- if_debug1(EPRN_TRACE_CHAR, "! .HWMargins is specified: type is %d.\n",
- (int)temp.type);
-#endif
- eprn->keep_margins = true;
- }
- }
-
- /* Process parameters defined by base classes (should occur after treating
- parameters defined for the derived class, see gsparam.h) */
- if ((rc = gdev_prn_put_params(dev, plist)) < 0 || rc > 0 && last_error >= 0)
- last_error = rc;
-
- if (last_error < 0) return_error(last_error);
-
- /* If the page size was modified, close the device */
- if (dev->is_open && (dev->width != width || dev->height != height ||
- mediasize[0] != dev->MediaSize[0] || mediasize[1] != dev->MediaSize[1])) {
- gs_closedevice(dev);
-#ifdef EPRN_TRACE
- if_debug0(EPRN_TRACE_CHAR,
- "! Closing device because of page size modification.\n");
-#endif
- }
-
- return last_error;
-}
diff --git a/gs/contrib/pcl3/eprn/eprnrend.c b/gs/contrib/pcl3/eprn/eprnrend.c
deleted file mode 100644
index 4b04d1f89..000000000
--- a/gs/contrib/pcl3/eprn/eprnrend.c
+++ /dev/null
@@ -1,1160 +0,0 @@
-/******************************************************************************
- File: $Id: eprnrend.c,v 1.15 2001/08/01 05:12:56 Martin Rel $
- Contents: Colour rendering functionality for the ghostscript device 'eprn'
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany. E-mail: Martin.Lottermoser@t-online.de.
-
-*******************************************************************************
-* *
-* Copyright (C) 2000, 2001 by Martin Lottermoser *
-* All rights reserved *
-* *
-*******************************************************************************
-
- Preprocessor variables:
-
- EPRN_TRACE
- Define this to enable tracing. Only useful for development.
-
- EPRN_TRAILING_BIT_BUG_FIXED
- Define this to deactivate compensation for a bug in ghostscript which
- leads to the last pixel in an RGB line being black instead of white.
- This occurs at least in gs 6.01 and 6.50. The correction covers only
- the one-bit-per-colorant case and is equivalent to clipping the pixel.
-
-*******************************************************************************
-
- The eprn device uses 'gx_color_index' values with varying interpretations,
- depending on the colour model and the rendering method, and stores them at
- different pixmaps depths, normally using the smallest depth which can
- accommodate all colorants at the same number of bits per colorant.
-
- To simplify matters, a field for the black component is always included, even
- for RGB and CMY, i.e., there are either 1 or 4 bit fields in a
- 'gx_color_index' value. If there are 4, the interpretation is either YMCK or
- BGRK, looking from left to right (most to least significant). The width of
- the fields can be found in the 'bits_per_colorant' variable in the eprn part
- of the device instance.
-
- Within each colorant field, not all bits need be used. Except when using the
- *_max() colour mapping functions, the values returned by
- eprn_bits_for_levels() for the parameters 'black_levels' and
- 'non_black_levels' determine the number of bits which are actually
- meaningful. Only the last (least significant) bits are used.
-
-******************************************************************************/
-
-/* Configuration management identification */
-#ifndef lint
-static const char
- cm_id[] = "@(#)$Id: eprnrend.c,v 1.15 2001/08/01 05:12:56 Martin Rel $";
-#endif
-
-/*****************************************************************************/
-
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE 500
-#endif
-
-/* Special Aladdin header, must be included before <sys/types.h> on some
- platforms (e.g., FreeBSD). */
-#include "std.h"
-
-/* Standard headers */
-#include <assert.h>
-#include <stdlib.h>
-
-/* Ghostscript headers */
-#ifdef EPRN_TRACE
-#include "gdebug.h"
-#endif /* EPRN_TRACE */
-
-/* Special headers */
-#include "gdeveprn.h"
-
-/*****************************************************************************/
-
-/* Macros for 'gx_color_index' values used mainly for non-monochrome modes and
- a pixmap depth of 4 */
-
-/* Colorants bits, numbered from 0 on the right to 3 on the left */
-#define COLORANT_0_BIT 1U
-#define COLORANT_1_BIT 2U
-#define COLORANT_2_BIT 4U
-#define COLORANT_3_BIT 8U
-
-/* Alias names for the bits in particular colour models */
-#define BLACK_BIT COLORANT_0_BIT
-#define CYAN_BIT COLORANT_1_BIT
-#define MAGENTA_BIT COLORANT_2_BIT
-#define YELLOW_BIT COLORANT_3_BIT
-#define RED_BIT COLORANT_1_BIT
-#define GREEN_BIT COLORANT_2_BIT
-#define BLUE_BIT COLORANT_3_BIT
-
-/* Bit plane indices for splitting */
-#define COLORANT_0_INDEX 0
-#define COLORANT_1_INDEX 1
-#define COLORANT_2_INDEX 2
-#define COLORANT_3_INDEX 3
-
-/* Macro to extract the dominant 8 bits from a 'gx_color_value'. This
- definition assumes that 'gx_color_value' uses the least significant 16 bits
- of the underlying type (unsigned short). Splitting this part off looks
- inefficient because left shifts will usually follow, but I'm relying on the
- compiler to be sufficiently intelligent to eliminate this inefficiency.
- This way the code is easier to check.
- The type cast is needed to prevent problems with negative values on
- platforms where 'gx_color_index' has more bits than 'int'.
- */
-#define dominant_8bits(value) ((unsigned int)((value) >> 8))
-
-/******************************************************************************
-
- Function: eprn_number_of_bitplanes
-
- Total number of bit planes returned by eprn_get_planes().
- This value is constant while the device is open.
-
-******************************************************************************/
-
-unsigned int eprn_number_of_bitplanes(eprn_Device *dev)
-{
- return dev->eprn.output_planes;
-}
-
-/******************************************************************************
-
- Function: eprn_number_of_octets
-
- Maximal lengths, in terms of the number of 'eprn_Octet' instances, for each
- bit plane returned by eprn_get_planes() for this device. These values
- are constant while the device is open.
-
-******************************************************************************/
-
-void eprn_number_of_octets(eprn_Device *dev, unsigned int lenghts[])
-{
- unsigned int j, length;
-
- length = (dev->eprn.octets_per_line + dev->color_info.depth - 1)/
- dev->color_info.depth;
- /* This results in length >= ceiling((number of pixels per line)/8)
- because:
- 8 * octets_per_line >= pixels_per_line * depth
- <==> octets_per_line/depth >= pixels_per_line/8
- where division is to be understood as exact.
- */
-
- for (j = 0; j < dev->eprn.output_planes; j++) lenghts[j] = length;
-
- return;
-}
-
-/******************************************************************************
-
- Function: eprn_map_rgb_color_for_RGB
-
- Colour mapping function for the process colour model 'DeviceRGB' and
- 2 intensity levels per colorant.
-
-******************************************************************************/
-
-gx_color_index eprn_map_rgb_color_for_RGB(gx_device *device,
- const gx_color_value cv[])
-{
- gx_color_value red = cv[0], green = cv[1], blue = cv[2];
- static const gx_color_value half = gx_max_color_value/2;
- gx_color_index value = 0;
- const eprn_Device *dev = (eprn_Device *)device;
-
-#ifdef EPRN_TRACE
- if_debug3(EPRN_TRACE_CHAR,
- "! eprn_map_rgb_color_for_RGB() called for RGB = (%hu, %hu, %hu),\n",
- red, green, blue);
-#endif
-
- assert(dev->eprn.colour_model == eprn_DeviceRGB);
-
- if (red > half) value |= RED_BIT;
- if (green > half) value |= GREEN_BIT;
- if (blue > half) value |= BLUE_BIT;
-
-#ifdef EPRN_TRACE
- if_debug1(EPRN_TRACE_CHAR, " returning 0x%lX.\n", (unsigned long)value);
-#endif
- return value;
-}
-
-/******************************************************************************
-
- Function: eprn_map_rgb_color_for_CMY_or_K
-
- Colour mapping function for the native colour spaces DeviceGray and DeviceRGB
- and a process colour model using a selection of CMYK colorants with at most
- 2 intensity levels per colorant. This function must not be called for the
- process colour models 'DeviceRGB' and 'DeviceCMYK'.
-
-******************************************************************************/
-
-gx_color_index eprn_map_rgb_color_for_CMY_or_K(gx_device *device,
- const gx_color_value cv[])
-{
- gx_color_value red = cv[0], green = cv[1], blue = cv[2];
- static const gx_color_value half = gx_max_color_value/2;
- gx_color_index value = (CYAN_BIT | MAGENTA_BIT | YELLOW_BIT);
- const eprn_Device *dev = (eprn_Device *)device;
-
-#ifdef EPRN_TRACE
- if_debug3(EPRN_TRACE_CHAR,
- "! eprn_map_rgb_color_for_CMY_or_K() called for RGB = (%hu, %hu, %hu),\n",
- red, green, blue);
-#endif
-
- assert(dev->eprn.colour_model == eprn_DeviceGray && red == green &&
- green == blue && (blue == 0 || blue == gx_max_color_value) ||
- dev->eprn.colour_model == eprn_DeviceCMY ||
- dev->eprn.colour_model == eprn_DeviceCMY_plus_K);
-
- /* Map to CMY */
- if (red > half) value &= ~CYAN_BIT;
- if (green > half) value &= ~MAGENTA_BIT;
- if (blue > half) value &= ~YELLOW_BIT;
-
- /* Remap composite black to true black if available */
- if (dev->eprn.colour_model != eprn_DeviceCMY &&
- value == (CYAN_BIT | MAGENTA_BIT | YELLOW_BIT))
- value = BLACK_BIT;
-
-#ifdef EPRN_TRACE
- if_debug1(EPRN_TRACE_CHAR, " returning 0x%lX.\n", (unsigned long)value);
-#endif
- return value;
-}
-
-/******************************************************************************
-
- Function: eprn_map_rgb_color_for_RGB_flex
-
- This is a 'map_rgb_color' method for the process colour model 'DeviceRGB'
- supporting any number of intensity levels.
-
-******************************************************************************/
-
-gx_color_index eprn_map_rgb_color_for_RGB_flex(gx_device *device,
- const gx_color_value cv[])
-{
- gx_color_value red = cv[0], green = cv[1], blue = cv[2];
- gx_color_index value = 0;
- gx_color_value step;
- unsigned int level;
- const eprn_Eprn *eprn = &((eprn_Device *)device)->eprn;
-
-#ifdef EPRN_TRACE
- if_debug3(EPRN_TRACE_CHAR,
- "! eprn_map_rgb_color_for_RGB_flex() called for RGB = (%hu, %hu, %hu),\n",
- red, green, blue);
-#endif
-
- /* See the discussion in eprn_map_cmyk_color_flex() below. */
-
- step = gx_max_color_value/eprn->non_black_levels;
-
- /* The order has to be BGR from left to right */
- level = blue/step;
- if (level >= eprn->non_black_levels) level = eprn->non_black_levels - 1;
- value = level << eprn->bits_per_colorant;
- level = green/step;
- if (level >= eprn->non_black_levels) level = eprn->non_black_levels - 1;
- value = (value | level) << eprn->bits_per_colorant;
- level = red/step;
- if (level >= eprn->non_black_levels) level = eprn->non_black_levels - 1;
- value = (value | level) << eprn->bits_per_colorant;
-
-#ifdef EPRN_TRACE
- if_debug1(EPRN_TRACE_CHAR, " returning 0x%lX.\n", (unsigned long)value);
-#endif
- return value;
-}
-
-/******************************************************************************
-
- Function: eprn_map_rgb_color_for_CMY_or_K_flex
-
- This is a flexible 'map_rgb_color' method. It must not be called for the
- process colour models 'DeviceRGB' and 'DeviceCMYK'.
-
-******************************************************************************/
-
-gx_color_index eprn_map_rgb_color_for_CMY_or_K_flex(gx_device *device,
- const gx_color_value cv[])
-{
- gx_color_value red = cv[0], green = cv[1], blue = cv[2];
- const eprn_Device *dev = (eprn_Device *)device;
-
-#ifdef EPRN_TRACE
- if_debug3(EPRN_TRACE_CHAR,
- "! eprn_map_rgb_color_for_CMY_or_K_flex() called for "
- "RGB = (%hu, %hu, %hu).\n",
- red, green, blue);
-#endif
-
- /* Treat pure grey levels differently if we have black. This implies that for
- CMY+K only "true" grey shades will be printed with black ink, all others
- will be mixed from CMY. */
- gx_color_value tmpcv[4];
- if (dev->eprn.colour_model != eprn_DeviceCMY && red == green && green == blue) {
- tmpcv[0] = 0; tmpcv[1] = 0; tmpcv[2] = 0;
- tmpcv[3] = gx_max_color_value - red;
- return eprn_map_cmyk_color_flex(device, tmpcv);
-
- }
- tmpcv[0] = gx_max_color_value - red;
- tmpcv[1] = gx_max_color_value - green;
- tmpcv[2] = gx_max_color_value - blue;
- tmpcv[3] = 0;
- return eprn_map_cmyk_color_flex(device, tmpcv);
-}
-
-/******************************************************************************
-
- Function: eprn_map_rgb_color_for_RGB_max
-
- Colour mapping function for the process colour model 'DeviceRGB' retaining as
- much information as possible.
-
-******************************************************************************/
-
-gx_color_index eprn_map_rgb_color_for_RGB_max(gx_device *device,
- const gx_color_value cv[])
-{
- gx_color_value red = cv[0], green = cv[1], blue = cv[2];
- gx_color_index value;
-
-#ifdef EPRN_TRACE
- if_debug3(EPRN_TRACE_CHAR,
- "! eprn_map_rgb_color_for_RGB_max() called for RGB = (%hu, %hu, %hu),\n",
- red, green, blue);
-#endif
-
- value = dominant_8bits(red) << 8;
- value |= dominant_8bits(green) << 16;
- value |= dominant_8bits(blue) << 24;
-
-#ifdef EPRN_TRACE
- if_debug1(EPRN_TRACE_CHAR, " returning 0x%08lX.\n", (unsigned long)value);
-#endif
- return value;
-}
-
-/******************************************************************************
-
- Function: eprn_map_rgb_color_for_CMY_or_K_max
-
- "Maximal" colour mapping function for the process colour models "DeviceGray",
- "DeviceCMY", and "CMY+K".
-
-******************************************************************************/
-
-gx_color_index eprn_map_rgb_color_for_CMY_or_K_max(gx_device *device,
- const gx_color_value cv[])
-{
- gx_color_value red = cv[0], green = cv[1], blue = cv[2];
- const eprn_Device *dev = (eprn_Device *)device;
-
-#ifdef EPRN_TRACE
- if_debug3(EPRN_TRACE_CHAR,
- "! eprn_map_rgb_color_for_CMY_or_K_max() called for "
- "RGB = (%hu, %hu, %hu).\n",
- red, green, blue);
-#endif
-
- gx_color_value tmpcv[4];
- if (dev->eprn.colour_model == eprn_DeviceGray) {
- tmpcv[0] = 0; tmpcv[1] = 0; tmpcv[2] = 0;
- tmpcv[3] = gx_max_color_value - red;
- return eprn_map_cmyk_color_max(device, tmpcv);
- }
- /* Note that the conversion from composite black to true black for CMY+K can
- only happen at the output pixel level, not here. */
- tmpcv[0] = gx_max_color_value - red;
- tmpcv[1] = gx_max_color_value - green;
- tmpcv[2] = gx_max_color_value - blue;
- tmpcv[3] = 0;
- return eprn_map_cmyk_color_max(device, tmpcv);
-}
-
-/******************************************************************************
-
- Function: eprn_map_color_rgb
-
- This function is a 'map_color_rgb' method.
-
- Such a method should return an RGB triple for the specified 'color'. This is
- apparently intended for devices supporting colour maps.
-
- The function param_HWColorMap() in gsdparam.c tries to compile such a
- colour map by calling this method repeatedly for all values from 0 to
- 2^color_info.depth - 1, provided the depth is less than or equal to 8 and
- the process colour model is not DeviceCMYK. If the function for one of these
- values returns a negative code, the assumption seems to be that there is no
- such colour map. Because there is a default method which always returns zero,
- such a colour map is always constructed if a device does not implement its
- own 'map_color_rgb' method. This can be seen in the appearance of the
- "HWColorMap" page device parameter.
-
- The key purpose of this function is therefore to return a negative code.
-
-******************************************************************************/
-
-int eprn_map_color_rgb(gx_device *device, gx_color_index color,
- gx_color_value rgb[])
-{
-#ifdef EPRN_TRACE
- if_debug1(EPRN_TRACE_CHAR,
- "! eprn_map_color_rgb() called for 0x%lX.\n", (unsigned long)color);
-#endif
-
- /* Just to be safe we return defined values (white) */
- if (((eprn_Device *)device)->eprn.colour_model == eprn_DeviceRGB)
- rgb[0] = rgb[1] = rgb[2] = gx_max_color_value;
- else
- rgb[0] = rgb[1] = rgb[2] = 0;
-
- return -1;
-}
-
-/******************************************************************************
-
- Function: eprn_map_cmyk_color
-
- Colour mapping function for a process colour model of 'DeviceCMYK' with
- 2 intensity levels for all colorants.
-
-******************************************************************************/
-
-gx_color_index eprn_map_cmyk_color(gx_device *device,
- const gx_color_value cv[])
-{
- gx_color_value cyan = cv[0], magenta = cv[1], yellow = cv[2], black = cv[3];
- gx_color_index value = 0;
- static const gx_color_value threshold = gx_max_color_value/2;
-
-#ifdef EPRN_TRACE
- if_debug4(EPRN_TRACE_CHAR,
- "! eprn_map_cmyk_color() called for CMYK = (%hu, %hu, %hu, %hu),\n",
- cyan, magenta, yellow, black);
-#endif
-
- if (cyan > threshold) value |= CYAN_BIT;
- if (magenta > threshold) value |= MAGENTA_BIT;
- if (yellow > threshold) value |= YELLOW_BIT;
- if (black > threshold) value |= BLACK_BIT;
-
-#ifdef EPRN_TRACE
- if_debug1(EPRN_TRACE_CHAR, " returning 0x%lX.\n", (unsigned long)value);
-#endif
- return value;
-}
-
-/******************************************************************************
-
- Function: eprn_map_cmyk_color_flex
-
- This is a 'map_cmyk_color' method supporting arbitrary numbers of intensity
- levels. It may be called for every colour model except DeviceRGB. Colorants
- not present in the model will be ignored.
-
-******************************************************************************/
-
-gx_color_index eprn_map_cmyk_color_flex(gx_device *device,
- const gx_color_value cv[])
-{
- gx_color_value cyan = cv[0], magenta = cv[1], yellow = cv[2], black = cv[3];
- gx_color_index value = 0;
- gx_color_value step;
- unsigned int level;
- const eprn_Eprn *eprn = &((eprn_Device *)device)->eprn;
-
-#ifdef EPRN_TRACE
- if_debug4(EPRN_TRACE_CHAR,
- "! eprn_map_cmyk_color_flex() called for CMYK = (%hu, %hu, %hu, %hu),\n",
- cyan, magenta, yellow, black);
-#endif
-
- /* I can think of three linear methods to extract discrete values from a
- continuous intensity in the range [0, 1]:
- (a) multiply by the number of levels minus 1 and truncate,
- (b) multiply by the number of levels minus 1 and round, and
- (c) multiply by the number of levels and truncate, except for an
- intensity of 1 in which case one returns the number of levels minus 1.
- For intensity values which can be represented exactly, i.e.,
-
- intensity = i/(levels-1) for some non-negative i < levels,
-
- these three methods are identical. (a) is however inappropriate here
- because for less than 32 levels ghostscript already provides intensity
- values which have been adjusted to a representable level. A rounding
- error could now result in a level which is too small by one. I prefer (c)
- because it gives equal shares to all levels.
-
- I'm using integer arithmetic here although floating point numbers would
- be more accurate. This routine may, however, be called quite frequently,
- and the loss in accuray is acceptable as long as the values determined
- for 'step' are large compared to the number of levels. If you consider
- "large" as meaning "10 times as large", the critical boundary is at about
- 81 levels. The highest number of intensity levels at present supported by
- HP DeskJets is apparently 4.
-
- A more accurate implementation would determine 'step' as a floating point
- value, divide the intensity by it, and take the floor (entier) of the
- result as the component intensity.
- */
-
- /* The order has to be (YMC)(K) from left to right */
- if (eprn->colour_model != eprn_DeviceGray) {
- step = gx_max_color_value/eprn->non_black_levels;
-
- level = yellow/step;
- if (level >= eprn->non_black_levels) level = eprn->non_black_levels - 1;
- value = level << eprn->bits_per_colorant;
- level = magenta/step;
- if (level >= eprn->non_black_levels) level = eprn->non_black_levels - 1;
- value = (value | level) << eprn->bits_per_colorant;
- level = cyan/step;
- if (level >= eprn->non_black_levels) level = eprn->non_black_levels - 1;
- value = (value | level) << eprn->bits_per_colorant;
- }
- if (eprn->colour_model != eprn_DeviceCMY) {
- step = gx_max_color_value/eprn->black_levels;
- level = black/step;
- if (level >= eprn->black_levels) level = eprn->black_levels - 1;
- value |= level;
- }
-
-#ifdef EPRN_TRACE
- if_debug1(EPRN_TRACE_CHAR, " returning 0x%lX.\n", (unsigned long)value);
-#endif
- return value;
-}
-
-/******************************************************************************
-
- Function: eprn_map_cmyk_color_max
-
- This is a 'map_cmyk_color' method retaining as much colour information as
- possible. The reduction to the printer's capabilities must happen in the
- output routine.
-
-******************************************************************************/
-
-gx_color_index eprn_map_cmyk_color_max(gx_device *device,
- const gx_color_value cv[])
-{
- gx_color_value cyan = cv[0], magenta = cv[1], yellow = cv[2], black = cv[3];
- gx_color_index value;
-
-#ifdef EPRN_TRACE
- if_debug4(EPRN_TRACE_CHAR,
- "! eprn_map_cmyk_color_max() called for CMYK = (%hu, %hu, %hu, %hu),\n",
- cyan, magenta, yellow, black);
-#endif
-
- value = dominant_8bits(black);
- value |= dominant_8bits(cyan) << 8;
- value |= dominant_8bits(magenta) << 16;
- value |= dominant_8bits(yellow) << 24;
-
-#ifdef EPRN_TRACE
- if_debug1(EPRN_TRACE_CHAR, " returning 0x%08lX.\n", (unsigned long)value);
-#endif
- return value;
-}
-
-/******************************************************************************
-
- Function: eprn_map_cmyk_color_glob
-
- Global eprn_map_cmyk_color for all cases handled above used to
- be able to work together with ghostscript 8.15 and CMYK model.
-
-******************************************************************************/
-gx_color_index eprn_map_cmyk_color_glob(gx_device *device, const gx_color_value cv[])
-{
- const eprn_Eprn *eprn = &((eprn_Device *)device)->eprn;
- if (eprn->intensity_rendering == eprn_IR_FloydSteinberg)
- return eprn_map_cmyk_color_max(device, cv);
- else if (device->color_info.max_gray > 1 || device->color_info.max_color > 1)
- return eprn_map_cmyk_color_flex(device, cv);
- else
- return eprn_map_cmyk_color(device, cv);
-}
-
-/******************************************************************************
-
- Function: eprn_finalize
-
- This function fills the last octet in a set of bit planes with white if
- needed and sets the lengths of all these planes.
-
- 'is_RGB' denotes whether the colour model is eprn_DeviceRGB,
- 'non_black_levels' is the number of intensity levels for non-black colorants,
- 'planes' the number of bit planes,
- 'plane' points to an array of at least 'planes' bit planes,
- 'ptr' points to an array of at least 'planes' pointers into the bit planes,
- 'pixels' is the number of pixels written to the group of bit planes.
-
- If 'pixels' is divisible by 8, the 'ptr' pointers point to octets after
- the last completely written octets. Otherwise, they point to the last
- incompletely written octet in which the pixels written so far occupy the
- least significant bits.
-
-******************************************************************************/
-
-void eprn_finalize(bool is_RGB, unsigned int non_black_levels,
- int planes, eprn_OctetString *plane, eprn_Octet **ptr, int pixels)
-{
- int j;
-
- /* Execute remaining left shifts in the last octet of the output planes when
- the number of pixels is not a multiple of 8, and fill with white on the
- right */
- if (pixels % 8 != 0) {
- int shift = 8 - pixels % 8;
-
- if (is_RGB) {
- /* White may be any intensity, but it's the same for all three colorants,
- and it's the highest. */
- eprn_Octet imax = non_black_levels - 1;
- int c, rgb_planes = eprn_bits_for_levels(non_black_levels);
-
- j = 0; /* next output plane */
-
- /* Loop over RGB */
- for (c = 0; c < 3; c++) {
- eprn_Octet value = imax;
- int m;
-
- /* Loop over all planes for this colorant */
- for (m = 0; m < rgb_planes; m++, j++) {
- eprn_Octet bit = value & 1;
- int p;
-
- value = value >> 1;
-
- /* Put the bit into all remaining pixels for this plane */
- for (p = 0; p < shift; p++)
- *ptr[j] = (*ptr[j] << 1) | bit;
- }
- }
- }
- else /* White is zero */
- for (j = 0; j < planes; j++)
- *ptr[j] = *ptr[j] << shift;
-
- /* Advance all plane pointers by 1 */
- for (j = 0; j < planes; j++) ptr[j]++;
- }
-
- /* Set the lengths of the bit plane strings */
- for (j = 0; j < planes; j++) {
- if (pixels == 0) plane[j].length = 0;
- else plane[j].length = ptr[j] - plane[j].str;
- }
-
- return;
-}
-
-/******************************************************************************
-
- Function: split_line_le8
-
- This is the first of the "split_line implementations". See the body of
- eprn_get_planes() for the calling conventions common to them.
-
- This particular implementation has the following restrictions:
- - The pixmap depth must be a divisor of 8.
-
-******************************************************************************/
-
-static void split_line_le8(eprn_Device *dev, const eprn_Octet *line,
- int length, eprn_OctetString plane[])
-{
- gx_color_index
- pixel;
- int
- black_planes, /* number of planes to send for black */
- non_black_planes, /* number of planes to send for each of CMY/RGB */
- j,
- k,
- pixels, /* number of pixels transferred to bit planes */
- planes; /* number of planes to send */
- eprn_Octet
- comp_mask = 0, /* 'bits_per_component' 1s in the lowest part */
- pixel_mask = 0, /* 'depth' 1s in the lowest part */
- *ptr[8]; /* pointers into planes (next octet to write to) */
-
- /* Number of planes to send */
- black_planes = eprn_bits_for_levels(dev->eprn.black_levels);
- non_black_planes = eprn_bits_for_levels(dev->eprn.non_black_levels);
- planes = black_planes + 3*non_black_planes;
-
- /* Initialize the bit plane pointers */
- for (j = 0; j < planes; j++) ptr[j] = plane[j].str;
-
- /* Determine some bit masks */
- for (j = 0; j < dev->color_info.depth; j++)
- pixel_mask = (pixel_mask << 1) | 1;
- for (j = 0; j < dev->eprn.bits_per_colorant; j++)
- comp_mask = (comp_mask << 1) | 1;
-
- /* Copy from 'line' to 'plane[]', converting Z format to XY format */
- pixels = 0;
- k = 0; /* Next octet index in the input line */
- while (k < length) {
- int l, m, p;
-
- /* Initialize plane storage if it's a new output octet */
- if (pixels % 8 == 0) for (j = 0; j < planes; j++) *ptr[j] = 0;
-
- /* Loop over pixels within the input octet, starting at the leftmost
- pixel (highest-order bits) */
- p = 8/dev->color_info.depth - 1;
- do {
- eprn_Octet comp;
-
- /* Extract pixel */
- pixel = (line[k] >> p*dev->color_info.depth) & pixel_mask;
-
- /* Extract components from the pixel and distribute each over its planes
- */
- comp = pixel & comp_mask; /* black */
- for (j = 0; j < black_planes; j++) {
- *ptr[j] = (*ptr[j] << 1) | comp & 1;
- comp >>= 1;
- }
- if (non_black_planes > 0) for (l = 1; l < 4; l++) {
- comp = (pixel >> l*dev->eprn.bits_per_colorant) & comp_mask;
- for (m = 0; m < non_black_planes; m++, j++) {
- *ptr[j] = (*ptr[j] << 1) | comp & 1;
- comp >>= 1;
- }
- }
-
- pixels++;
- p--;
- } while (p >= 0);
- k++;
-
- /* Increase plane pointers if an output octet boundary has been reached */
- if (pixels % 8 == 0) for (j = 0; j < planes; j++) ptr[j]++;
- }
-
- eprn_finalize(dev->eprn.colour_model == eprn_DeviceRGB,
- dev->eprn.non_black_levels, planes, plane, ptr, pixels);
-
- return;
-}
-
-/******************************************************************************
-
- Function: split_line_ge8
-
- This split_line function has the following restrictions:
- - The pixmap depth must be a multiple of 8.
- - There may be at most 8 bits per colorant.
- (Hence the depth is at most 32.)
- - 'length' must be divisible by depth/8.
-
-******************************************************************************/
-
-static void split_line_ge8(eprn_Device *dev, const eprn_Octet *line,
- int length, eprn_OctetString plane[])
-{
- gx_color_index
- pixel;
- int
- black_planes, /* number of planes to send for black */
- non_black_planes, /* number of planes to send for each of CMY/RGB */
- j,
- k,
- octets_per_pixel = dev->color_info.depth/8,
- pixels, /* number of pixels transferred to bit planes */
- planes; /* number of planes to send */
- eprn_Octet
- comp_mask = 0, /* bits_per_component 1s in the lowest part */
- *ptr[32]; /* pointers into planes (next octet to write to) */
-
- /* Number of planes to send */
- black_planes = eprn_bits_for_levels(dev->eprn.black_levels);
- non_black_planes = eprn_bits_for_levels(dev->eprn.non_black_levels);
- planes = black_planes + 3*non_black_planes;
-
- /* Initialize the bit plane pointers */
- for (j = 0; j < planes; j++) ptr[j] = plane[j].str;
-
- /* Determine the component mask */
- for (j = 0; j < dev->eprn.bits_per_colorant; j++)
- comp_mask = (comp_mask << 1) | 1;
-
- /* Copy from 'line' to 'plane[]', converting Z format to XY format */
- pixels = 0;
- k = 0; /* Next octet index in the input line */
- while (k < length) {
- eprn_Octet comp;
- int l, m;
-
- /* Initialize plane storage if it's a new octet */
- if (pixels % 8 == 0) for (j = 0; j < planes; j++) *ptr[j] = 0;
-
- /* Reconstruct pixel from several octets */
- j = 0;
- pixel = line[k];
- do {
- j++; k++;
- if (j >= octets_per_pixel) break;
- pixel = (pixel << 8) | line[k]; /* MSB (Big Endian) */
- } while (1);
-
- /* Split and distribute over planes */
- comp = pixel & comp_mask; /* black */
- for (j = 0; j < black_planes; j++) {
- *ptr[j] = (*ptr[j] << 1) | comp & 1;
- comp >>= 1;
- }
- for (l = 1; l < 4; l++) {
- comp = (pixel >> l*dev->eprn.bits_per_colorant) & comp_mask;
- for (m = 0; m < non_black_planes; m++, j++) {
- *ptr[j] = (*ptr[j] << 1) | comp & 1;
- comp >>= 1;
- }
- }
-
- pixels++;
-
- /* Increase plane pointers if an octet boundary has been reached */
- if (pixels % 8 == 0) for (j = 0; j < planes; j++) ptr[j]++;
- }
-
- eprn_finalize(dev->eprn.colour_model == eprn_DeviceRGB,
- dev->eprn.non_black_levels, planes, plane, ptr, pixels);
-
- return;
-}
-
-/******************************************************************************
-
- Function: split_line_3or4x1
-
- This function is a split_line() implementation for a non-monochrome colour
- model (3 or 4 components) with 1 bit per component.
-
-******************************************************************************/
-
-static void split_line_3or4x1(eprn_Device *dev, const eprn_Octet *line,
- int length, eprn_OctetString plane[])
-{
- int
- from = (dev->eprn.colour_model == eprn_DeviceRGB ||
- dev->eprn.colour_model == eprn_DeviceCMY? 1: 0),
- j,
- k,
- l;
- eprn_Octet *ptr[4]; /* pointers into planes, indexed KCMY/-RGB */
-
- ptr[0] = NULL; /* defensive programming */
- for (j = from; j < 4; j++) ptr[j] = plane[j-from].str;
-
- /* Loop over the input line, taking four octets (8 pixels) at a time, as far
- as available, and split them into four output octets, one for each
- colorant.
- */
- k = 0;
- while (k < length) {
- eprn_Octet octet[4] = {0, 0, 0, 0};
-
- for (l = 0; l < 4 && k < length; l++, k++) {
- eprn_Octet part;
-#define treat_quartet() \
- octet[COLORANT_0_INDEX] <<= 1; \
- if (part & COLORANT_0_BIT) octet[COLORANT_0_INDEX] |= 1; \
- octet[COLORANT_1_INDEX] <<= 1; \
- if (part & COLORANT_1_BIT) octet[COLORANT_1_INDEX] |= 1; \
- octet[COLORANT_2_INDEX] <<= 1; \
- if (part & COLORANT_2_BIT) octet[COLORANT_2_INDEX] |= 1; \
- octet[COLORANT_3_INDEX] <<= 1; \
- if (part & COLORANT_3_BIT) octet[COLORANT_3_INDEX] |= 1;
-
- /* Upper four bits */
- part = (line[k] >> 4) & 0x0F;
- treat_quartet()
-
- /* Lower four bits */
- part = line[k] & 0x0F;
- treat_quartet()
-
-#undef treat_quartet
- }
- if (l < 4) {
- for (j = from; j < 4; j++) octet[j] <<= 8 - 2*l;
- if (dev->eprn.colour_model == eprn_DeviceRGB) {
- /* Add white in the last 8 - 2*l pixels */
- for (j = 1; j < 4; j++) {
- int k;
- /* We add two pixels at a time */
- for (k = 3 - l; k >= 0; k--) octet[j] |= 0x03 << k;
- }
- }
- }
- for (j = from; j < 4; j++) *(ptr[j]++) = octet[j];
- }
-
- /* Set the lengths of the bit plane strings */
- for (j = 0; j < dev->eprn.output_planes; j++) {
- if (length == 0) plane[j].length = 0;
- else plane[j].length = ptr[from + j] - plane[j].str;
- }
-
- return;
-}
-
-/******************************************************************************
-
- Function: split_line_4x2
-
- This is a split_line() implementation for 4 colour components (i.e., CMYK)
- with 3 or 4 levels each (2 bit planes to send for each component).
-
-******************************************************************************/
-
-static void split_line_4x2(eprn_Device *dev, const eprn_Octet *line,
- int length, eprn_OctetString plane[])
-{
- gx_color_index
- pixel;
- int
- j,
- k;
- eprn_Octet
- *ptr[8]; /* pointers into planes (next octet to write to) */
-
- /* Initialize the bit plane pointers */
- for (j = 0; j < 8; j++) ptr[j] = plane[j].str;
-
- /* Copy from 'line' to 'plane[]', converting Z format to XY format */
- for (k = 0; k < length; k++) {
- /* k is the index of the next octet in the input line and the number of
- pixels processed so far. */
-
- /* Initialize plane storage if it's a new octet */
- if (k % 8 == 0) for (j = 0; j < 8; j++) *ptr[j] = 0;
-
- /* Fetch pixel */
- pixel = line[k];
-
- /* Split and distribute over planes */
- *ptr[0] = (*ptr[0] << 1) | pixel & 0x01;
-#define assign_bit(index) \
- *ptr[index] = (*ptr[index] << 1) | (pixel >> index) & 0x01
- assign_bit(1);
- assign_bit(2);
- assign_bit(3);
- assign_bit(4);
- assign_bit(5);
- assign_bit(6);
- assign_bit(7);
-#undef assign_bit
-
- /* Increase plane pointers if an output octet boundary has been reached */
- if (k % 8 == 7) for (j = 0; j < 8; j++) ptr[j]++;
- }
-
- /* Execute remaining left shifts in the last octet of the output planes when
- the number of pixels is not a multiple of 8 */
- k = length % 8;
- if (k != 0) {
- int shift = 8 - k;
- for (j = 0; j < 8; j++)
- *(ptr[j]++) = *ptr[j] << shift;
- }
-
- /* Set the lengths of the bit plane strings */
- for (j = 0; j < 8; j++) {
- if (length == 0) plane[j].length = 0;
- else plane[j].length = ptr[j] - plane[j].str;
- }
-
- return;
-}
-
-/******************************************************************************
-
- Function: eprn_fetch_scan_line
-
- If there is a next scan line with y coordinate 'dev->eprn.next_y', this
- function fetches it into '*line' and returns zero. Otherwise the function
- returns a non-zero value.
-
- The storage allocated for 'line->str' must be at least of size
- 'dev->eprn.octets_per_line'.
-
- On success, the 'length' field in 'line' does not include trailing zero
- pixels.
-
-******************************************************************************/
-
-int eprn_fetch_scan_line(eprn_Device *dev, eprn_OctetString *line)
-{
- int rc;
- const eprn_Octet *str;
-
- rc = gdev_prn_copy_scan_lines((gx_device_printer *)dev, dev->eprn.next_y,
- line->str, dev->eprn.octets_per_line);
- /* gdev_prn_copy_scan_lines() returns the number of scan lines it fetched
- or a negative value on error. The number of lines to fetch is the value
- of the last argument divided by the length of a single line, hence in
- this case 1. */
- if (rc != 1) return 1;
-
- /* Set the length to ignore trailing zero octets in the scan line */
- str = line->str + (dev->eprn.octets_per_line - 1);
- while (str > line->str && *str == 0) str--;
- if (*str == 0) line->length = 0;
- else line->length = str - line->str + 1;
-
- /* Ensure we have an integral number of pixels in the line */
- if (dev->color_info.depth > 8) {
- int rem;
- unsigned int octets_per_pixel = dev->color_info.depth/8;
- /* If the depth is larger than 8, it is a multiple of 8. */
- rem = line->length % octets_per_pixel;
- if (rem != 0) line->length += octets_per_pixel - rem;
- }
-
-#if 0 && defined(EPRN_TRACE)
- if (gs_debug_c(EPRN_TRACE_CHAR)) {
- int j;
- dlprintf("! eprn_fetch_scan_line(): Fetched ");
- if (line->length == 0) dprintf("empty scan line.");
- else {
- dprintf("scan line: 0x");
- for (j = 0; j < line->length; j++) dprintf1("%02X", line->str[j]);
- }
- dlprintf("\n");
- }
-#endif
-
- return 0;
-}
-
-/******************************************************************************
-
- Function: eprn_get_planes
-
- For the description of this function, see gdeveprn.h.
-
-******************************************************************************/
-
-int eprn_get_planes(eprn_Device *dev, eprn_OctetString bitplanes[])
-{
- eprn_OctetString *line; /* where to copy the scan line from the prn device */
- int
- j,
- rc;
-
- /* Avoid a copying step for a depth of 1 */
- if (dev->color_info.depth == 1) line = bitplanes;
- else line = &dev->eprn.scan_line;
-
- /* Fetch the scan line if available */
- if (dev->eprn.intensity_rendering == eprn_IR_FloydSteinberg &&
- dev->eprn.next_y == 0) return 1;
- rc = eprn_fetch_scan_line(dev, line);
- if (rc == 0) dev->eprn.next_y++;
- else {
- if (dev->eprn.intensity_rendering != eprn_IR_FloydSteinberg) return 1;
- dev->eprn.next_y = 0;
- }
-
- if (dev->color_info.depth == 1) return 0;
-
- if (dev->eprn.intensity_rendering == eprn_IR_FloydSteinberg) {
- eprn_OctetString tmp;
-
- eprn_split_FS(&dev->eprn.next_scan_line, &dev->eprn.scan_line,
- dev->eprn.octets_per_line,
- dev->eprn.colour_model,
- dev->eprn.black_levels, dev->eprn.non_black_levels,
- bitplanes);
-
- /* Switch 'next_scan_line' to refer to what is currently 'scan_line' */
- tmp = dev->eprn.next_scan_line;
- dev->eprn.next_scan_line = dev->eprn.scan_line;
- dev->eprn.scan_line = tmp;
- }
- else {
- /* Here we split multi-bit pixels which are already adapted to the
- printer's capabilities.
-
- All the functions called here have the following signature:
-
- static void split_line...(eprn_Device *dev, const eprn_Octet *line,
- int length, eprn_OctetString plane[])
-
- Such a "split_line implementation" must take the scan line of length
- 'length', pointed to by 'line', split it into bit planes according to
- the state of 'dev', and return these planes via 'plane'. The length
- fields of the planes must be set. Trailing zero octets should not be
- removed because it's done here afterwards anyway.
- */
-
- if (dev->eprn.colour_model == eprn_DeviceGray)
- split_line_le8(dev, line->str, line->length, bitplanes);
- else {
- if (dev->eprn.bits_per_colorant == 1) {
-#ifndef EPRN_TRAILING_BIT_BUG_FIXED
- if (dev->eprn.colour_model == eprn_DeviceRGB &&
- line->length == dev->eprn.octets_per_line) {
- /* At least gs 6.01 and 6.50 sometimes generate pixel lines where the
- last pixel is not white but black (last octet in 'line' is 0xE0
- instead of 0xEE; with pcl3 it shows up for A6 and A4, but not for
- A3, A5, US Letter, or US Legal).
- I'm overwriting it with white. */
-#ifdef EPRN_TRACE
- if (gs_debug_c(EPRN_TRACE_CHAR)) {
- static bool already_noted = false;
- if (!already_noted && line->str[line->length - 1] != 0xEE) {
- dlprintf1("! eprn_get_planes(): "
- "Line-terminating octet is 0x%02X.\n",
- line->str[line->length - 1]);
- already_noted = true;
- }
- }
-#endif /* EPRN_TRACE */
- line->str[line->length - 1] |= RED_BIT | GREEN_BIT | BLUE_BIT;
- }
-#endif /* EPRN_TRAILING_BIT_BUG_FIXED */
- split_line_3or4x1(dev, line->str, line->length, bitplanes);
- }
- else if (dev->eprn.bits_per_colorant == 2 && dev->eprn.black_levels > 2 &&
- dev->eprn.non_black_levels > 2)
- split_line_4x2(dev, line->str, line->length, bitplanes);
- else if (dev->color_info.depth < 8)
- split_line_le8(dev, line->str, line->length, bitplanes);
- else split_line_ge8(dev, line->str, line->length, bitplanes);
- }
- }
-
- /* Reduce the lengths of the individual bit planes to not include trailing
- zero octets */
- for (j = 0; j < dev->eprn.output_planes; j++) {
- if (bitplanes[j].length > 0) {
- const eprn_Octet *str = bitplanes[j].str + (bitplanes[j].length - 1);
- while (str > bitplanes[j].str && *str == 0) str--;
- if (*str == 0) bitplanes[j].length = 0;
- else bitplanes[j].length = (str - bitplanes[j].str) + 1;
- }
- }
-
- return 0;
-}
diff --git a/gs/contrib/pcl3/eprn/eprnrend.c.orig b/gs/contrib/pcl3/eprn/eprnrend.c.orig
deleted file mode 100644
index cf453c966..000000000
--- a/gs/contrib/pcl3/eprn/eprnrend.c.orig
+++ /dev/null
@@ -1,1141 +0,0 @@
-/******************************************************************************
- File: $Id: eprnrend.c,v 1.15 2001/08/01 05:12:56 Martin Rel $
- Contents: Colour rendering functionality for the ghostscript device 'eprn'
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany. E-mail: Martin.Lottermoser@t-online.de.
-
-*******************************************************************************
-* *
-* Copyright (C) 2000, 2001 by Martin Lottermoser *
-* All rights reserved *
-* *
-*******************************************************************************
-
- Preprocessor variables:
-
- EPRN_TRACE
- Define this to enable tracing. Only useful for development.
-
- EPRN_TRAILING_BIT_BUG_FIXED
- Define this to deactivate compensation for a bug in ghostscript which
- leads to the last pixel in an RGB line being black instead of white.
- This occurs at least in gs 6.01 and 6.50. The correction covers only
- the one-bit-per-colorant case and is equivalent to clipping the pixel.
-
-*******************************************************************************
-
- The eprn device uses 'gx_color_index' values with varying interpretations,
- depending on the colour model and the rendering method, and stores them at
- different pixmaps depths, normally using the smallest depth which can
- accommodate all colorants at the same number of bits per colorant.
-
- To simplify matters, a field for the black component is always included, even
- for RGB and CMY, i.e., there are either 1 or 4 bit fields in a
- 'gx_color_index' value. If there are 4, the interpretation is either YMCK or
- BGRK, looking from left to right (most to least significant). The width of
- the fields can be found in the 'bits_per_colorant' variable in the eprn part
- of the device instance.
-
- Within each colorant field, not all bits need be used. Except when using the
- *_max() colour mapping functions, the values returned by
- eprn_bits_for_levels() for the parameters 'black_levels' and
- 'non_black_levels' determine the number of bits which are actually
- meaningful. Only the last (least significant) bits are used.
-
-******************************************************************************/
-
-/* Configuration management identification */
-#ifndef lint
-static const char
- cm_id[] = "@(#)$Id: eprnrend.c,v 1.15 2001/08/01 05:12:56 Martin Rel $";
-#endif
-
-/*****************************************************************************/
-
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE 500
-#endif
-
-/* Special Aladdin header, must be included before <sys/types.h> on some
- platforms (e.g., FreeBSD). */
-#include "std.h"
-
-/* Standard headers */
-#include <assert.h>
-#include <stdlib.h>
-
-/* Ghostscript headers */
-#ifdef EPRN_TRACE
-#include "gdebug.h"
-#endif /* EPRN_TRACE */
-
-/* Special headers */
-#include "gdeveprn.h"
-
-/*****************************************************************************/
-
-/* Macros for 'gx_color_index' values used mainly for non-monochrome modes and
- a pixmap depth of 4 */
-
-/* Colorants bits, numbered from 0 on the right to 3 on the left */
-#define COLORANT_0_BIT 1U
-#define COLORANT_1_BIT 2U
-#define COLORANT_2_BIT 4U
-#define COLORANT_3_BIT 8U
-
-/* Alias names for the bits in particular colour models */
-#define BLACK_BIT COLORANT_0_BIT
-#define CYAN_BIT COLORANT_1_BIT
-#define MAGENTA_BIT COLORANT_2_BIT
-#define YELLOW_BIT COLORANT_3_BIT
-#define RED_BIT COLORANT_1_BIT
-#define GREEN_BIT COLORANT_2_BIT
-#define BLUE_BIT COLORANT_3_BIT
-
-/* Bit plane indices for splitting */
-#define COLORANT_0_INDEX 0
-#define COLORANT_1_INDEX 1
-#define COLORANT_2_INDEX 2
-#define COLORANT_3_INDEX 3
-
-/* Macro to extract the dominant 8 bits from a 'gx_color_value'. This
- definition assumes that 'gx_color_value' uses the least significant 16 bits
- of the underlying type (unsigned short). Splitting this part off looks
- inefficient because left shifts will usually follow, but I'm relying on the
- compiler to be sufficiently intelligent to eliminate this inefficiency.
- This way the code is easier to check.
- The type cast is needed to prevent problems with negative values on
- platforms where 'gx_color_index' has more bits than 'int'.
- */
-#define dominant_8bits(value) ((unsigned int)((value) >> 8))
-
-/******************************************************************************
-
- Function: eprn_number_of_bitplanes
-
- Total number of bit planes returned by eprn_get_planes().
- This value is constant while the device is open.
-
-******************************************************************************/
-
-unsigned int eprn_number_of_bitplanes(eprn_Device *dev)
-{
- return dev->eprn.output_planes;
-}
-
-/******************************************************************************
-
- Function: eprn_number_of_octets
-
- Maximal lengths, in terms of the number of 'eprn_Octet' instances, for each
- bit plane returned by eprn_get_planes() for this device. These values
- are constant while the device is open.
-
-******************************************************************************/
-
-void eprn_number_of_octets(eprn_Device *dev, unsigned int lenghts[])
-{
- unsigned int j, length;
-
- length = (dev->eprn.octets_per_line + dev->color_info.depth - 1)/
- dev->color_info.depth;
- /* This results in length >= ceiling((number of pixels per line)/8)
- because:
- 8 * octets_per_line >= pixels_per_line * depth
- <==> octets_per_line/depth >= pixels_per_line/8
- where division is to be understood as exact.
- */
-
- for (j = 0; j < dev->eprn.output_planes; j++) lenghts[j] = length;
-
- return;
-}
-
-/******************************************************************************
-
- Function: eprn_map_rgb_color_for_RGB
-
- Colour mapping function for the process colour model 'DeviceRGB' and
- 2 intensity levels per colorant.
-
-******************************************************************************/
-
-gx_color_index eprn_map_rgb_color_for_RGB(gx_device *device,
- const gx_color_value cv[])
-{
- gx_color_value red = cv[0], green = cv[1], blue = cv[2];
- static const gx_color_value half = gx_max_color_value/2;
- gx_color_index value = 0;
- const eprn_Device *dev = (eprn_Device *)device;
-
-#ifdef EPRN_TRACE
- if_debug3(EPRN_TRACE_CHAR,
- "! eprn_map_rgb_color_for_RGB() called for RGB = (%hu, %hu, %hu),\n",
- red, green, blue);
-#endif
-
- assert(dev->eprn.colour_model == eprn_DeviceRGB);
-
- if (red > half) value |= RED_BIT;
- if (green > half) value |= GREEN_BIT;
- if (blue > half) value |= BLUE_BIT;
-
-#ifdef EPRN_TRACE
- if_debug1(EPRN_TRACE_CHAR, " returning 0x%lX.\n", (unsigned long)value);
-#endif
- return value;
-}
-
-/******************************************************************************
-
- Function: eprn_map_rgb_color_for_CMY_or_K
-
- Colour mapping function for the native colour spaces DeviceGray and DeviceRGB
- and a process colour model using a selection of CMYK colorants with at most
- 2 intensity levels per colorant. This function must not be called for the
- process colour models 'DeviceRGB' and 'DeviceCMYK'.
-
-******************************************************************************/
-
-gx_color_index eprn_map_rgb_color_for_CMY_or_K(gx_device *device,
- const gx_color_value cv[])
-{
- gx_color_value red = cv[0], green = cv[1], blue = cv[2];
- static const gx_color_value half = gx_max_color_value/2;
- gx_color_index value = (CYAN_BIT | MAGENTA_BIT | YELLOW_BIT);
- const eprn_Device *dev = (eprn_Device *)device;
-
-#ifdef EPRN_TRACE
- if_debug3(EPRN_TRACE_CHAR,
- "! eprn_map_rgb_color_for_CMY_or_K() called for RGB = (%hu, %hu, %hu),\n",
- red, green, blue);
-#endif
-
- assert(dev->eprn.colour_model == eprn_DeviceGray && red == green &&
- green == blue && (blue == 0 || blue == gx_max_color_value) ||
- dev->eprn.colour_model == eprn_DeviceCMY ||
- dev->eprn.colour_model == eprn_DeviceCMY_plus_K);
-
- /* Map to CMY */
- if (red > half) value &= ~CYAN_BIT;
- if (green > half) value &= ~MAGENTA_BIT;
- if (blue > half) value &= ~YELLOW_BIT;
-
- /* Remap composite black to true black if available */
- if (dev->eprn.colour_model != eprn_DeviceCMY &&
- value == (CYAN_BIT | MAGENTA_BIT | YELLOW_BIT))
- value = BLACK_BIT;
-
-#ifdef EPRN_TRACE
- if_debug1(EPRN_TRACE_CHAR, " returning 0x%lX.\n", (unsigned long)value);
-#endif
- return value;
-}
-
-/******************************************************************************
-
- Function: eprn_map_rgb_color_for_RGB_flex
-
- This is a 'map_rgb_color' method for the process colour model 'DeviceRGB'
- supporting any number of intensity levels.
-
-******************************************************************************/
-
-gx_color_index eprn_map_rgb_color_for_RGB_flex(gx_device *device,
- const gx_color_value cv[])
-{
- gx_color_value red = cv[0], green = cv[1], blue = cv[2];
- gx_color_index value = 0;
- gx_color_value step;
- unsigned int level;
- const eprn_Eprn *eprn = &((eprn_Device *)device)->eprn;
-
-#ifdef EPRN_TRACE
- if_debug3(EPRN_TRACE_CHAR,
- "! eprn_map_rgb_color_for_RGB_flex() called for RGB = (%hu, %hu, %hu),\n",
- red, green, blue);
-#endif
-
- /* See the discussion in eprn_map_cmyk_color_flex() below. */
-
- step = gx_max_color_value/eprn->non_black_levels;
-
- /* The order has to be BGR from left to right */
- level = blue/step;
- if (level >= eprn->non_black_levels) level = eprn->non_black_levels - 1;
- value = level << eprn->bits_per_colorant;
- level = green/step;
- if (level >= eprn->non_black_levels) level = eprn->non_black_levels - 1;
- value = (value | level) << eprn->bits_per_colorant;
- level = red/step;
- if (level >= eprn->non_black_levels) level = eprn->non_black_levels - 1;
- value = (value | level) << eprn->bits_per_colorant;
-
-#ifdef EPRN_TRACE
- if_debug1(EPRN_TRACE_CHAR, " returning 0x%lX.\n", (unsigned long)value);
-#endif
- return value;
-}
-
-/******************************************************************************
-
- Function: eprn_map_rgb_color_for_CMY_or_K_flex
-
- This is a flexible 'map_rgb_color' method. It must not be called for the
- process colour models 'DeviceRGB' and 'DeviceCMYK'.
-
-******************************************************************************/
-
-gx_color_index eprn_map_rgb_color_for_CMY_or_K_flex(gx_device *device,
- const gx_color_value cv[])
-{
- gx_color_value red = cv[0], green = cv[1], blue = cv[2];
- const eprn_Device *dev = (eprn_Device *)device;
-
-#ifdef EPRN_TRACE
- if_debug3(EPRN_TRACE_CHAR,
- "! eprn_map_rgb_color_for_CMY_or_K_flex() called for "
- "RGB = (%hu, %hu, %hu).\n",
- red, green, blue);
-#endif
-
- /* Treat pure grey levels differently if we have black. This implies that for
- CMY+K only "true" grey shades will be printed with black ink, all others
- will be mixed from CMY. */
- gx_color_value tmpcv[4];
- if (dev->eprn.colour_model != eprn_DeviceCMY && red == green && green == blue) {
- tmpcv[0] = 0; tmpcv[1] = 0; tmpcv[2] = 0;
- tmpcv[3] = gx_max_color_value - red;
- return eprn_map_cmyk_color_flex(device, tmpcv);
-
- }
- tmpcv[0] = gx_max_color_value - red;
- tmpcv[1] = gx_max_color_value - green;
- tmpcv[2] = gx_max_color_value - blue;
- tmpcv[3] = 0;
- return eprn_map_cmyk_color_flex(device, tmpcv);
-}
-
-/******************************************************************************
-
- Function: eprn_map_rgb_color_for_RGB_max
-
- Colour mapping function for the process colour model 'DeviceRGB' retaining as
- much information as possible.
-
-******************************************************************************/
-
-gx_color_index eprn_map_rgb_color_for_RGB_max(gx_device *device,
- const gx_color_value cv[])
-{
- gx_color_value red = cv[0], green = cv[1], blue = cv[2];
- gx_color_index value;
-
-#ifdef EPRN_TRACE
- if_debug3(EPRN_TRACE_CHAR,
- "! eprn_map_rgb_color_for_RGB_max() called for RGB = (%hu, %hu, %hu),\n",
- red, green, blue);
-#endif
-
- value = dominant_8bits(red) << 8;
- value |= dominant_8bits(green) << 16;
- value |= dominant_8bits(blue) << 24;
-
-#ifdef EPRN_TRACE
- if_debug1(EPRN_TRACE_CHAR, " returning 0x%08lX.\n", (unsigned long)value);
-#endif
- return value;
-}
-
-/******************************************************************************
-
- Function: eprn_map_rgb_color_for_CMY_or_K_max
-
- "Maximal" colour mapping function for the process colour models "DeviceGray",
- "DeviceCMY", and "CMY+K".
-
-******************************************************************************/
-
-gx_color_index eprn_map_rgb_color_for_CMY_or_K_max(gx_device *device,
- const gx_color_value cv[])
-{
- gx_color_value red = cv[0], green = cv[1], blue = cv[2];
- const eprn_Device *dev = (eprn_Device *)device;
-
-#ifdef EPRN_TRACE
- if_debug3(EPRN_TRACE_CHAR,
- "! eprn_map_rgb_color_for_CMY_or_K_max() called for "
- "RGB = (%hu, %hu, %hu).\n",
- red, green, blue);
-#endif
-
- gx_color_value tmpcv[4];
- if (dev->eprn.colour_model == eprn_DeviceGray) {
- tmpcv[0] = 0; tmpcv[1] = 0; tmpcv[2] = 0;
- tmpcv[3] = gx_max_color_value - red;
- return eprn_map_cmyk_color_max(device, tmpcv);
- }
- /* Note that the conversion from composite black to true black for CMY+K can
- only happen at the output pixel level, not here. */
- tmpcv[0] = gx_max_color_value - red;
- tmpcv[1] = gx_max_color_value - green;
- tmpcv[2] = gx_max_color_value - blue;
- tmpcv[3] = 0;
- return eprn_map_cmyk_color_max(device, tmpcv);
-}
-
-/******************************************************************************
-
- Function: eprn_map_color_rgb
-
- This function is a 'map_color_rgb' method.
-
- Such a method should return an RGB triple for the specified 'color'. This is
- apparently intended for devices supporting colour maps.
-
- The function param_HWColorMap() in gsdparam.c tries to compile such a
- colour map by calling this method repeatedly for all values from 0 to
- 2^color_info.depth - 1, provided the depth is less than or equal to 8 and
- the process colour model is not DeviceCMYK. If the function for one of these
- values returns a negative code, the assumption seems to be that there is no
- such colour map. Because there is a default method which always returns zero,
- such a colour map is always constructed if a device does not implement its
- own 'map_color_rgb' method. This can be seen in the appearance of the
- "HWColorMap" page device parameter.
-
- The key purpose of this function is therefore to return a negative code.
-
-******************************************************************************/
-
-int eprn_map_color_rgb(gx_device *device, gx_color_index color,
- gx_color_value rgb[])
-{
-#ifdef EPRN_TRACE
- if_debug1(EPRN_TRACE_CHAR,
- "! eprn_map_color_rgb() called for 0x%lX.\n", (unsigned long)color);
-#endif
-
- /* Just to be safe we return defined values (white) */
- if (((eprn_Device *)device)->eprn.colour_model == eprn_DeviceRGB)
- rgb[0] = rgb[1] = rgb[2] = gx_max_color_value;
- else
- rgb[0] = rgb[1] = rgb[2] = 0;
-
- return -1;
-}
-
-/******************************************************************************
-
- Function: eprn_map_cmyk_color
-
- Colour mapping function for a process colour model of 'DeviceCMYK' with
- 2 intensity levels for all colorants.
-
-******************************************************************************/
-
-gx_color_index eprn_map_cmyk_color(gx_device *device,
- const gx_color_value cv[])
-{
- gx_color_value cyan = cv[0], magenta = cv[1], yellow = cv[2], black = cv[3];
- gx_color_index value = 0;
- static const gx_color_value threshold = gx_max_color_value/2;
-
-#ifdef EPRN_TRACE
- if_debug4(EPRN_TRACE_CHAR,
- "! eprn_map_cmyk_color() called for CMYK = (%hu, %hu, %hu, %hu),\n",
- cyan, magenta, yellow, black);
-#endif
-
- if (cyan > threshold) value |= CYAN_BIT;
- if (magenta > threshold) value |= MAGENTA_BIT;
- if (yellow > threshold) value |= YELLOW_BIT;
- if (black > threshold) value |= BLACK_BIT;
-
-#ifdef EPRN_TRACE
- if_debug1(EPRN_TRACE_CHAR, " returning 0x%lX.\n", (unsigned long)value);
-#endif
- return value;
-}
-
-/******************************************************************************
-
- Function: eprn_map_cmyk_color_flex
-
- This is a 'map_cmyk_color' method supporting arbitrary numbers of intensity
- levels. It may be called for every colour model except DeviceRGB. Colorants
- not present in the model will be ignored.
-
-******************************************************************************/
-
-gx_color_index eprn_map_cmyk_color_flex(gx_device *device,
- const gx_color_value cv[])
-{
- gx_color_value cyan = cv[0], magenta = cv[1], yellow = cv[2], black = cv[3];
- gx_color_index value = 0;
- gx_color_value step;
- unsigned int level;
- const eprn_Eprn *eprn = &((eprn_Device *)device)->eprn;
-
-#ifdef EPRN_TRACE
- if_debug4(EPRN_TRACE_CHAR,
- "! eprn_map_cmyk_color_flex() called for CMYK = (%hu, %hu, %hu, %hu),\n",
- cyan, magenta, yellow, black);
-#endif
-
- /* I can think of three linear methods to extract discrete values from a
- continuous intensity in the range [0, 1]:
- (a) multiply by the number of levels minus 1 and truncate,
- (b) multiply by the number of levels minus 1 and round, and
- (c) multiply by the number of levels and truncate, except for an
- intensity of 1 in which case one returns the number of levels minus 1.
- For intensity values which can be represented exactly, i.e.,
-
- intensity = i/(levels-1) for some non-negative i < levels,
-
- these three methods are identical. (a) is however inappropriate here
- because for less than 32 levels ghostscript already provides intensity
- values which have been adjusted to a representable level. A rounding
- error could now result in a level which is too small by one. I prefer (c)
- because it gives equal shares to all levels.
-
- I'm using integer arithmetic here although floating point numbers would
- be more accurate. This routine may, however, be called quite frequently,
- and the loss in accuray is acceptable as long as the values determined
- for 'step' are large compared to the number of levels. If you consider
- "large" as meaning "10 times as large", the critical boundary is at about
- 81 levels. The highest number of intensity levels at present supported by
- HP DeskJets is apparently 4.
-
- A more accurate implementation would determine 'step' as a floating point
- value, divide the intensity by it, and take the floor (entier) of the
- result as the component intensity.
- */
-
- /* The order has to be (YMC)(K) from left to right */
- if (eprn->colour_model != eprn_DeviceGray) {
- step = gx_max_color_value/eprn->non_black_levels;
-
- level = yellow/step;
- if (level >= eprn->non_black_levels) level = eprn->non_black_levels - 1;
- value = level << eprn->bits_per_colorant;
- level = magenta/step;
- if (level >= eprn->non_black_levels) level = eprn->non_black_levels - 1;
- value = (value | level) << eprn->bits_per_colorant;
- level = cyan/step;
- if (level >= eprn->non_black_levels) level = eprn->non_black_levels - 1;
- value = (value | level) << eprn->bits_per_colorant;
- }
- if (eprn->colour_model != eprn_DeviceCMY) {
- step = gx_max_color_value/eprn->black_levels;
- level = black/step;
- if (level >= eprn->black_levels) level = eprn->black_levels - 1;
- value |= level;
- }
-
-#ifdef EPRN_TRACE
- if_debug1(EPRN_TRACE_CHAR, " returning 0x%lX.\n", (unsigned long)value);
-#endif
- return value;
-}
-
-/******************************************************************************
-
- Function: eprn_map_cmyk_color_max
-
- This is a 'map_cmyk_color' method retaining as much colour information as
- possible. The reduction to the printer's capabilities must happen in the
- output routine.
-
-******************************************************************************/
-
-gx_color_index eprn_map_cmyk_color_max(gx_device *device,
- const gx_color_value cv[])
-{
- gx_color_value cyan = cv[0], magenta = cv[1], yellow = cv[2], black = cv[3];
- gx_color_index value;
-
-#ifdef EPRN_TRACE
- if_debug4(EPRN_TRACE_CHAR,
- "! eprn_map_cmyk_color_max() called for CMYK = (%hu, %hu, %hu, %hu),\n",
- cyan, magenta, yellow, black);
-#endif
-
- value = dominant_8bits(black);
- value |= dominant_8bits(cyan) << 8;
- value |= dominant_8bits(magenta) << 16;
- value |= dominant_8bits(yellow) << 24;
-
-#ifdef EPRN_TRACE
- if_debug1(EPRN_TRACE_CHAR, " returning 0x%08lX.\n", (unsigned long)value);
-#endif
- return value;
-}
-
-/******************************************************************************
-
- Function: eprn_finalize
-
- This function fills the last octet in a set of bit planes with white if
- needed and sets the lengths of all these planes.
-
- 'is_RGB' denotes whether the colour model is eprn_DeviceRGB,
- 'non_black_levels' is the number of intensity levels for non-black colorants,
- 'planes' the number of bit planes,
- 'plane' points to an array of at least 'planes' bit planes,
- 'ptr' points to an array of at least 'planes' pointers into the bit planes,
- 'pixels' is the number of pixels written to the group of bit planes.
-
- If 'pixels' is divisible by 8, the 'ptr' pointers point to octets after
- the last completely written octets. Otherwise, they point to the last
- incompletely written octet in which the pixels written so far occupy the
- least significant bits.
-
-******************************************************************************/
-
-void eprn_finalize(bool is_RGB, unsigned int non_black_levels,
- int planes, eprn_OctetString *plane, eprn_Octet **ptr, int pixels)
-{
- int j;
-
- /* Execute remaining left shifts in the last octet of the output planes when
- the number of pixels is not a multiple of 8, and fill with white on the
- right */
- if (pixels % 8 != 0) {
- int shift = 8 - pixels % 8;
-
- if (is_RGB) {
- /* White may be any intensity, but it's the same for all three colorants,
- and it's the highest. */
- eprn_Octet imax = non_black_levels - 1;
- int c, rgb_planes = eprn_bits_for_levels(non_black_levels);
-
- j = 0; /* next output plane */
-
- /* Loop over RGB */
- for (c = 0; c < 3; c++) {
- eprn_Octet value = imax;
- int m;
-
- /* Loop over all planes for this colorant */
- for (m = 0; m < rgb_planes; m++, j++) {
- eprn_Octet bit = value & 1;
- int p;
-
- value = value >> 1;
-
- /* Put the bit into all remaining pixels for this plane */
- for (p = 0; p < shift; p++)
- *ptr[j] = (*ptr[j] << 1) | bit;
- }
- }
- }
- else /* White is zero */
- for (j = 0; j < planes; j++)
- *ptr[j] = *ptr[j] << shift;
-
- /* Advance all plane pointers by 1 */
- for (j = 0; j < planes; j++) ptr[j]++;
- }
-
- /* Set the lengths of the bit plane strings */
- for (j = 0; j < planes; j++) {
- if (pixels == 0) plane[j].length = 0;
- else plane[j].length = ptr[j] - plane[j].str;
- }
-
- return;
-}
-
-/******************************************************************************
-
- Function: split_line_le8
-
- This is the first of the "split_line implementations". See the body of
- eprn_get_planes() for the calling conventions common to them.
-
- This particular implementation has the following restrictions:
- - The pixmap depth must be a divisor of 8.
-
-******************************************************************************/
-
-static void split_line_le8(eprn_Device *dev, const eprn_Octet *line,
- int length, eprn_OctetString plane[])
-{
- gx_color_index
- pixel;
- int
- black_planes, /* number of planes to send for black */
- non_black_planes, /* number of planes to send for each of CMY/RGB */
- j,
- k,
- pixels, /* number of pixels transferred to bit planes */
- planes; /* number of planes to send */
- eprn_Octet
- comp_mask = 0, /* 'bits_per_component' 1s in the lowest part */
- pixel_mask = 0, /* 'depth' 1s in the lowest part */
- *ptr[8]; /* pointers into planes (next octet to write to) */
-
- /* Number of planes to send */
- black_planes = eprn_bits_for_levels(dev->eprn.black_levels);
- non_black_planes = eprn_bits_for_levels(dev->eprn.non_black_levels);
- planes = black_planes + 3*non_black_planes;
-
- /* Initialize the bit plane pointers */
- for (j = 0; j < planes; j++) ptr[j] = plane[j].str;
-
- /* Determine some bit masks */
- for (j = 0; j < dev->color_info.depth; j++)
- pixel_mask = (pixel_mask << 1) | 1;
- for (j = 0; j < dev->eprn.bits_per_colorant; j++)
- comp_mask = (comp_mask << 1) | 1;
-
- /* Copy from 'line' to 'plane[]', converting Z format to XY format */
- pixels = 0;
- k = 0; /* Next octet index in the input line */
- while (k < length) {
- int l, m, p;
-
- /* Initialize plane storage if it's a new output octet */
- if (pixels % 8 == 0) for (j = 0; j < planes; j++) *ptr[j] = 0;
-
- /* Loop over pixels within the input octet, starting at the leftmost
- pixel (highest-order bits) */
- p = 8/dev->color_info.depth - 1;
- do {
- eprn_Octet comp;
-
- /* Extract pixel */
- pixel = (line[k] >> p*dev->color_info.depth) & pixel_mask;
-
- /* Extract components from the pixel and distribute each over its planes
- */
- comp = pixel & comp_mask; /* black */
- for (j = 0; j < black_planes; j++) {
- *ptr[j] = (*ptr[j] << 1) | comp & 1;
- comp >>= 1;
- }
- if (non_black_planes > 0) for (l = 1; l < 4; l++) {
- comp = (pixel >> l*dev->eprn.bits_per_colorant) & comp_mask;
- for (m = 0; m < non_black_planes; m++, j++) {
- *ptr[j] = (*ptr[j] << 1) | comp & 1;
- comp >>= 1;
- }
- }
-
- pixels++;
- p--;
- } while (p >= 0);
- k++;
-
- /* Increase plane pointers if an output octet boundary has been reached */
- if (pixels % 8 == 0) for (j = 0; j < planes; j++) ptr[j]++;
- }
-
- eprn_finalize(dev->eprn.colour_model == eprn_DeviceRGB,
- dev->eprn.non_black_levels, planes, plane, ptr, pixels);
-
- return;
-}
-
-/******************************************************************************
-
- Function: split_line_ge8
-
- This split_line function has the following restrictions:
- - The pixmap depth must be a multiple of 8.
- - There may be at most 8 bits per colorant.
- (Hence the depth is at most 32.)
- - 'length' must be divisible by depth/8.
-
-******************************************************************************/
-
-static void split_line_ge8(eprn_Device *dev, const eprn_Octet *line,
- int length, eprn_OctetString plane[])
-{
- gx_color_index
- pixel;
- int
- black_planes, /* number of planes to send for black */
- non_black_planes, /* number of planes to send for each of CMY/RGB */
- j,
- k,
- octets_per_pixel = dev->color_info.depth/8,
- pixels, /* number of pixels transferred to bit planes */
- planes; /* number of planes to send */
- eprn_Octet
- comp_mask = 0, /* bits_per_component 1s in the lowest part */
- *ptr[32]; /* pointers into planes (next octet to write to) */
-
- /* Number of planes to send */
- black_planes = eprn_bits_for_levels(dev->eprn.black_levels);
- non_black_planes = eprn_bits_for_levels(dev->eprn.non_black_levels);
- planes = black_planes + 3*non_black_planes;
-
- /* Initialize the bit plane pointers */
- for (j = 0; j < planes; j++) ptr[j] = plane[j].str;
-
- /* Determine the component mask */
- for (j = 0; j < dev->eprn.bits_per_colorant; j++)
- comp_mask = (comp_mask << 1) | 1;
-
- /* Copy from 'line' to 'plane[]', converting Z format to XY format */
- pixels = 0;
- k = 0; /* Next octet index in the input line */
- while (k < length) {
- eprn_Octet comp;
- int l, m;
-
- /* Initialize plane storage if it's a new octet */
- if (pixels % 8 == 0) for (j = 0; j < planes; j++) *ptr[j] = 0;
-
- /* Reconstruct pixel from several octets */
- j = 0;
- pixel = line[k];
- do {
- j++; k++;
- if (j >= octets_per_pixel) break;
- pixel = (pixel << 8) | line[k]; /* MSB (Big Endian) */
- } while (1);
-
- /* Split and distribute over planes */
- comp = pixel & comp_mask; /* black */
- for (j = 0; j < black_planes; j++) {
- *ptr[j] = (*ptr[j] << 1) | comp & 1;
- comp >>= 1;
- }
- for (l = 1; l < 4; l++) {
- comp = (pixel >> l*dev->eprn.bits_per_colorant) & comp_mask;
- for (m = 0; m < non_black_planes; m++, j++) {
- *ptr[j] = (*ptr[j] << 1) | comp & 1;
- comp >>= 1;
- }
- }
-
- pixels++;
-
- /* Increase plane pointers if an octet boundary has been reached */
- if (pixels % 8 == 0) for (j = 0; j < planes; j++) ptr[j]++;
- }
-
- eprn_finalize(dev->eprn.colour_model == eprn_DeviceRGB,
- dev->eprn.non_black_levels, planes, plane, ptr, pixels);
-
- return;
-}
-
-/******************************************************************************
-
- Function: split_line_3or4x1
-
- This function is a split_line() implementation for a non-monochrome colour
- model (3 or 4 components) with 1 bit per component.
-
-******************************************************************************/
-
-static void split_line_3or4x1(eprn_Device *dev, const eprn_Octet *line,
- int length, eprn_OctetString plane[])
-{
- int
- from = (dev->eprn.colour_model == eprn_DeviceRGB ||
- dev->eprn.colour_model == eprn_DeviceCMY? 1: 0),
- j,
- k,
- l;
- eprn_Octet *ptr[4]; /* pointers into planes, indexed KCMY/-RGB */
-
- ptr[0] = NULL; /* defensive programming */
- for (j = from; j < 4; j++) ptr[j] = plane[j-from].str;
-
- /* Loop over the input line, taking four octets (8 pixels) at a time, as far
- as available, and split them into four output octets, one for each
- colorant.
- */
- k = 0;
- while (k < length) {
- eprn_Octet octet[4] = {0, 0, 0, 0};
-
- for (l = 0; l < 4 && k < length; l++, k++) {
- eprn_Octet part;
-#define treat_quartet() \
- octet[COLORANT_0_INDEX] <<= 1; \
- if (part & COLORANT_0_BIT) octet[COLORANT_0_INDEX] |= 1; \
- octet[COLORANT_1_INDEX] <<= 1; \
- if (part & COLORANT_1_BIT) octet[COLORANT_1_INDEX] |= 1; \
- octet[COLORANT_2_INDEX] <<= 1; \
- if (part & COLORANT_2_BIT) octet[COLORANT_2_INDEX] |= 1; \
- octet[COLORANT_3_INDEX] <<= 1; \
- if (part & COLORANT_3_BIT) octet[COLORANT_3_INDEX] |= 1;
-
- /* Upper four bits */
- part = (line[k] >> 4) & 0x0F;
- treat_quartet()
-
- /* Lower four bits */
- part = line[k] & 0x0F;
- treat_quartet()
-
-#undef treat_quartet
- }
- if (l < 4) {
- for (j = from; j < 4; j++) octet[j] <<= 8 - 2*l;
- if (dev->eprn.colour_model == eprn_DeviceRGB) {
- /* Add white in the last 8 - 2*l pixels */
- for (j = 1; j < 4; j++) {
- int k;
- /* We add two pixels at a time */
- for (k = 3 - l; k >= 0; k--) octet[j] |= 0x03 << k;
- }
- }
- }
- for (j = from; j < 4; j++) *(ptr[j]++) = octet[j];
- }
-
- /* Set the lengths of the bit plane strings */
- for (j = 0; j < dev->eprn.output_planes; j++) {
- if (length == 0) plane[j].length = 0;
- else plane[j].length = ptr[from + j] - plane[j].str;
- }
-
- return;
-}
-
-/******************************************************************************
-
- Function: split_line_4x2
-
- This is a split_line() implementation for 4 colour components (i.e., CMYK)
- with 3 or 4 levels each (2 bit planes to send for each component).
-
-******************************************************************************/
-
-static void split_line_4x2(eprn_Device *dev, const eprn_Octet *line,
- int length, eprn_OctetString plane[])
-{
- gx_color_index
- pixel;
- int
- j,
- k;
- eprn_Octet
- *ptr[8]; /* pointers into planes (next octet to write to) */
-
- /* Initialize the bit plane pointers */
- for (j = 0; j < 8; j++) ptr[j] = plane[j].str;
-
- /* Copy from 'line' to 'plane[]', converting Z format to XY format */
- for (k = 0; k < length; k++) {
- /* k is the index of the next octet in the input line and the number of
- pixels processed so far. */
-
- /* Initialize plane storage if it's a new octet */
- if (k % 8 == 0) for (j = 0; j < 8; j++) *ptr[j] = 0;
-
- /* Fetch pixel */
- pixel = line[k];
-
- /* Split and distribute over planes */
- *ptr[0] = (*ptr[0] << 1) | pixel & 0x01;
-#define assign_bit(index) \
- *ptr[index] = (*ptr[index] << 1) | (pixel >> index) & 0x01
- assign_bit(1);
- assign_bit(2);
- assign_bit(3);
- assign_bit(4);
- assign_bit(5);
- assign_bit(6);
- assign_bit(7);
-#undef assign_bit
-
- /* Increase plane pointers if an output octet boundary has been reached */
- if (k % 8 == 7) for (j = 0; j < 8; j++) ptr[j]++;
- }
-
- /* Execute remaining left shifts in the last octet of the output planes when
- the number of pixels is not a multiple of 8 */
- k = length % 8;
- if (k != 0) {
- int shift = 8 - k;
- for (j = 0; j < 8; j++)
- *(ptr[j]++) = *ptr[j] << shift;
- }
-
- /* Set the lengths of the bit plane strings */
- for (j = 0; j < 8; j++) {
- if (length == 0) plane[j].length = 0;
- else plane[j].length = ptr[j] - plane[j].str;
- }
-
- return;
-}
-
-/******************************************************************************
-
- Function: eprn_fetch_scan_line
-
- If there is a next scan line with y coordinate 'dev->eprn.next_y', this
- function fetches it into '*line' and returns zero. Otherwise the function
- returns a non-zero value.
-
- The storage allocated for 'line->str' must be at least of size
- 'dev->eprn.octets_per_line'.
-
- On success, the 'length' field in 'line' does not include trailing zero
- pixels.
-
-******************************************************************************/
-
-int eprn_fetch_scan_line(eprn_Device *dev, eprn_OctetString *line)
-{
- int rc;
- const eprn_Octet *str;
-
- rc = gdev_prn_copy_scan_lines((gx_device_printer *)dev, dev->eprn.next_y,
- line->str, dev->eprn.octets_per_line);
- /* gdev_prn_copy_scan_lines() returns the number of scan lines it fetched
- or a negative value on error. The number of lines to fetch is the value
- of the last argument divided by the length of a single line, hence in
- this case 1. */
- if (rc != 1) return 1;
-
- /* Set the length to ignore trailing zero octets in the scan line */
- str = line->str + (dev->eprn.octets_per_line - 1);
- while (str > line->str && *str == 0) str--;
- if (*str == 0) line->length = 0;
- else line->length = str - line->str + 1;
-
- /* Ensure we have an integral number of pixels in the line */
- if (dev->color_info.depth > 8) {
- int rem;
- unsigned int octets_per_pixel = dev->color_info.depth/8;
- /* If the depth is larger than 8, it is a multiple of 8. */
- rem = line->length % octets_per_pixel;
- if (rem != 0) line->length += octets_per_pixel - rem;
- }
-
-#if 0 && defined(EPRN_TRACE)
- if (gs_debug_c(EPRN_TRACE_CHAR)) {
- int j;
- dlprintf("! eprn_fetch_scan_line(): Fetched ");
- if (line->length == 0) dprintf("empty scan line.");
- else {
- dprintf("scan line: 0x");
- for (j = 0; j < line->length; j++) dprintf1("%02X", line->str[j]);
- }
- dlprintf("\n");
- }
-#endif
-
- return 0;
-}
-
-/******************************************************************************
-
- Function: eprn_get_planes
-
- For the description of this function, see gdeveprn.h.
-
-******************************************************************************/
-
-int eprn_get_planes(eprn_Device *dev, eprn_OctetString bitplanes[])
-{
- eprn_OctetString *line; /* where to copy the scan line from the prn device */
- int
- j,
- rc;
-
- /* Avoid a copying step for a depth of 1 */
- if (dev->color_info.depth == 1) line = bitplanes;
- else line = &dev->eprn.scan_line;
-
- /* Fetch the scan line if available */
- if (dev->eprn.intensity_rendering == eprn_IR_FloydSteinberg &&
- dev->eprn.next_y == 0) return 1;
- rc = eprn_fetch_scan_line(dev, line);
- if (rc == 0) dev->eprn.next_y++;
- else {
- if (dev->eprn.intensity_rendering != eprn_IR_FloydSteinberg) return 1;
- dev->eprn.next_y = 0;
- }
-
- if (dev->color_info.depth == 1) return 0;
-
- if (dev->eprn.intensity_rendering == eprn_IR_FloydSteinberg) {
- eprn_OctetString tmp;
-
- eprn_split_FS(&dev->eprn.next_scan_line, &dev->eprn.scan_line,
- dev->eprn.octets_per_line,
- dev->eprn.colour_model,
- dev->eprn.black_levels, dev->eprn.non_black_levels,
- bitplanes);
-
- /* Switch 'next_scan_line' to refer to what is currently 'scan_line' */
- tmp = dev->eprn.next_scan_line;
- dev->eprn.next_scan_line = dev->eprn.scan_line;
- dev->eprn.scan_line = tmp;
- }
- else {
- /* Here we split multi-bit pixels which are already adapted to the
- printer's capabilities.
-
- All the functions called here have the following signature:
-
- static void split_line...(eprn_Device *dev, const eprn_Octet *line,
- int length, eprn_OctetString plane[])
-
- Such a "split_line implementation" must take the scan line of length
- 'length', pointed to by 'line', split it into bit planes according to
- the state of 'dev', and return these planes via 'plane'. The length
- fields of the planes must be set. Trailing zero octets should not be
- removed because it's done here afterwards anyway.
- */
-
- if (dev->eprn.colour_model == eprn_DeviceGray)
- split_line_le8(dev, line->str, line->length, bitplanes);
- else {
- if (dev->eprn.bits_per_colorant == 1) {
-#ifndef EPRN_TRAILING_BIT_BUG_FIXED
- if (dev->eprn.colour_model == eprn_DeviceRGB &&
- line->length == dev->eprn.octets_per_line) {
- /* At least gs 6.01 and 6.50 sometimes generate pixel lines where the
- last pixel is not white but black (last octet in 'line' is 0xE0
- instead of 0xEE; with pcl3 it shows up for A6 and A4, but not for
- A3, A5, US Letter, or US Legal).
- I'm overwriting it with white. */
-#ifdef EPRN_TRACE
- if (gs_debug_c(EPRN_TRACE_CHAR)) {
- static bool already_noted = false;
- if (!already_noted && line->str[line->length - 1] != 0xEE) {
- dlprintf1("! eprn_get_planes(): "
- "Line-terminating octet is 0x%02X.\n",
- line->str[line->length - 1]);
- already_noted = true;
- }
- }
-#endif /* EPRN_TRACE */
- line->str[line->length - 1] |= RED_BIT | GREEN_BIT | BLUE_BIT;
- }
-#endif /* EPRN_TRAILING_BIT_BUG_FIXED */
- split_line_3or4x1(dev, line->str, line->length, bitplanes);
- }
- else if (dev->eprn.bits_per_colorant == 2 && dev->eprn.black_levels > 2 &&
- dev->eprn.non_black_levels > 2)
- split_line_4x2(dev, line->str, line->length, bitplanes);
- else if (dev->color_info.depth < 8)
- split_line_le8(dev, line->str, line->length, bitplanes);
- else split_line_ge8(dev, line->str, line->length, bitplanes);
- }
- }
-
- /* Reduce the lengths of the individual bit planes to not include trailing
- zero octets */
- for (j = 0; j < dev->eprn.output_planes; j++) {
- if (bitplanes[j].length > 0) {
- const eprn_Octet *str = bitplanes[j].str + (bitplanes[j].length - 1);
- while (str > bitplanes[j].str && *str == 0) str--;
- if (*str == 0) bitplanes[j].length = 0;
- else bitplanes[j].length = (str - bitplanes[j].str) + 1;
- }
- }
-
- return 0;
-}
diff --git a/gs/contrib/pcl3/eprn/gdeveprn.c b/gs/contrib/pcl3/eprn/gdeveprn.c
deleted file mode 100644
index 52ce5719c..000000000
--- a/gs/contrib/pcl3/eprn/gdeveprn.c
+++ /dev/null
@@ -1,1189 +0,0 @@
-/******************************************************************************
- File: $Id: gdeveprn.c,v 1.25 2001/04/30 05:15:51 Martin Rel $
- Contents: Implementation of the abstract ghostscript device 'eprn':
- general functions and page layout
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany. E-mail: Martin.Lottermoser@t-online.de.
-
-*******************************************************************************
-* *
-* Copyright (C) 2000, 2001 by Martin Lottermoser *
-* All rights reserved *
-* *
-*******************************************************************************
-
- Preprocessor variables:
-
- EPRN_NO_PAGECOUNTFILE
- Define this if you do not want to use eprn's pagecount-file feature.
- You very likely must define this on Microsoft Windows.
-
- EPRN_TRACE
- Define this to enable tracing. Only useful for development.
-
- EPRN_USE_GSTATE (integer)
- Define this to be non-zero if the graphics state should be accessed
- directly instead of via the interpreter context state. Newer ghostscript
- versions require the latter path. The default is zero unless
- GS_REVISION is defined and less than 600.
-
- GS_REVISION (integer)
- If defined, this must be the ghostscript version number, e.g., 601 for
- ghostscript 6.01.
-
-******************************************************************************/
-
-/* Configuration management identification */
-#ifndef lint
-static const char
- cm_id[] = "@(#)$Id: gdeveprn.c,v 1.25 2001/04/30 05:15:51 Martin Rel $";
-#endif
-
-/*****************************************************************************/
-
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE 500
-#endif
-
-/* Preprocessor symbol with version-dependent default */
-#ifndef EPRN_USE_GSTATE
-#if !defined(GS_REVISION) || GS_REVISION >= 600
-#define EPRN_USE_GSTATE 0
-#else
-#define EPRN_USE_GSTATE 1
-#endif
-#endif /* !EPRN_USE_GSTATE */
-
-/*****************************************************************************/
-
-/* Special Aladdin header, must be included before <sys/types.h> on some
- platforms (e.g., FreeBSD). */
-#include "std.h"
-
-/* Standard headers */
-#include <assert.h>
-#include <math.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef EPRN_TRACE
-#include <time.h>
-#endif /* EPRN_TRACE */
-
-/* Ghostscript headers. With the exception of gdebug.h, these files are only
- needed to compile eprn_forget_defaultmatrix() which needs the prototypes
- for gs_setdefaultmatrix() (in gscoord.h) and gs_main_instance_default()
- (in imain.h). Unfortunately and in disregard of good SE practice,
- ghostscript's header files are not self-contained. Therefore, if this file
- does not compile because of undefined symbols, just add include directives
- until it does. */
-#include "iref.h" /* needed by icstate.h */
-#include "gsmemraw.h" /* needed by icstate.h */
-#include "gsmemory.h" /* needed by icstate.h */
-#include "gstypes.h" /* needed by gsstate.h */
-#include "gsstate.h" /* needed by icstate.h */
-#include "icstate.h" /* for struct gs_context_state_s */
-#if !defined(GS_REVISION) || GS_REVISION >= 700
-#include "iapi.h" /* needed by iminst.h */
-#endif /* GS_REVISION */
-#include "iminst.h" /* for struct gs_main_instance_s */
-#include "imain.h" /* for gs_main_instance_default() */
-#include "gscoord.h" /* for gs_setdefaultmatrix() */
-#if EPRN_USE_GSTATE
-#include "igstate.h"
-#endif /* EPRN_USE_GSTATE */
-#ifdef EPRN_TRACE
-#include "gdebug.h"
-#endif /* EPRN_TRACE */
-
-/* Special headers for this device */
-#ifndef EPRN_NO_PAGECOUNTFILE
-#include "pagecount.h"
-#endif /* EPRN_NO_PAGECOUNTFILE */
-#include "gdeveprn.h"
-
-/*****************************************************************************/
-
-/* Prefix for error messages */
-#define ERRPREF "? eprn: "
-
-/******************************************************************************
-
- Function: eprn_get_initial_matrix
-
- This function returns the initial matrix for the device.
-
- The result is based on the following parameters:
- - eprn: default_orientation, down_shift, right_shift, soft_tumble
- - HWResolution, MediaSize, ShowpageCount
-
-******************************************************************************/
-
-void eprn_get_initial_matrix(gx_device *device, gs_matrix *mptr)
-{
- eprn_Device *dev = (eprn_Device *)device;
- float
- /* The following two arrays are oriented w.r.t. pixmap device space, i.e.,
- the index 0 refers to the x coordinate (horizontal) and the index 1 to
- the y coordinate (vertical) in pixmap device space. */
- extension[2], /* media extension in pixels */
- pixels_per_bp[2]; /* resolution */
- int
- j,
- quarters;
-
-#ifdef EPRN_TRACE
- if_debug0(EPRN_TRACE_CHAR, "! eprn_get_initial_matrix()...\n");
-#endif
-
- /* We need 'default_orientation' and also the margins. */
- if (dev->eprn.code == ms_none) {
-#ifdef EPRN_TRACE
- if_debug0(EPRN_TRACE_CHAR,
- "! eprn_get_initial_matrix(): code is still ms_none.\n");
-#endif
- if (eprn_set_page_layout(dev) != 0)
- fputs(" Processing can't be stopped at this point although this error "
- "occurred.\n", stderr);
- /* The current function has a signature without the ability to signal
- an error condition. */
- }
-
- quarters = dev->eprn.default_orientation +
- (dev->MediaSize[0] <= dev->MediaSize[1]? 0: 1);
- /* Number of quarter-circle rotations by +90 degrees necessary to obtain
- default user space starting with the y axis upwards in pixmap device
- space.
- It's not documented, but 'MediaSize' is the requested "PageSize" page
- device parameter value and hence is to be interpreted in default (not
- default default!) user space. The condition above therefore tests
- whether landscape orientation has been requested.
- */
-
- /* Soft tumble option: rotate default user space by 180 degrees on every
- second page */
- if (dev->eprn.soft_tumble && dev->ShowpageCount % 2 != 0) quarters += 2;
-
- /* Prepare auxiliary data */
- for (j = 0; j < 2; j++) pixels_per_bp[j] = dev->HWResolution[j]/BP_PER_IN;
- /* 'HWResolution[]' contains the standard PostScript page device parameter
- 'HWResolution' which is defined in pixels per inch with respect to
- device space. */
- if (quarters % 2 == 0) {
- /* Default user space and pixmap device space agree in what is "horizontal"
- and what is "vertical". */
- extension[0] = dev->MediaSize[0];
- extension[1] = dev->MediaSize[1];
- }
- else {
- extension[0] = dev->MediaSize[1];
- extension[1] = dev->MediaSize[0];
- }
- /* Convert from bp to pixels: */
- for (j = 0; j < 2; j++) extension[j] *= pixels_per_bp[j];
- /* Note that we are using the user-specified extension of the sheet, not the
- "official" one we could obtain in most cases from 'size'. */
-
- switch (quarters % 4) {
- case 0:
- /* The y axis of default user space points upwards in pixmap device space.
- The CTM is uniquely characterized by the following mappings from
- default user space to pixmap device space:
- (0, 0) -> (0, height in pixels)
- (width in bp, 0) -> (width in pixels, height in pixels)
- (0, height in bp) -> (0, 0)
- 'width' and 'height' refer to the sheet's extension as seen from pixmap
- device space, i.e., width in pixels == extension[0] and
- height in pixels == extension[1].
-
- From the PLR we find that the CTM is a PostScript matrix
- [a b c d tx ty] used for mapping user space coordinates (x, y) to
- device space coordinates (x', y') as follows:
- x' = a*x + c*y + tx
- y' = b*x + d*y + ty
- Ghostscript's matrix type 'gs_matrix' writes its structure components
- 'xx' etc. in storage layout order into a PostScript matrix (see
- write_matrix() in iutil.c), hence we obtain by comparison with
- gsmatrix.h the PostScript matrix [ xx xy yx yy tx ty ].
- The correspondence can also be seen by comparison of the equations
- above with the code in gs_point_transform() in gsmatrix.c.
- It would, however, still be reassuring to have a corresponding
- statement in ghostscript's documentation.
- */
- gx_default_get_initial_matrix(device, mptr);
- /* Of course, I could also set this directly:
- mptr->xx = pixels_per_bp[0];
- mptr->xy = 0;
- mptr->yx = 0;
- mptr->yy = -pixels_per_bp[1];
- mptr->tx = 0;
- mptr->ty = extension[1];
- Doing it in this way is, however, more stable against dramatic changes
- in ghostscript.
- */
- break;
- case 1:
- /* The y axis of default user space points to the left in pixmap device
- space. The CTM is uniquely characterized by the following mappings from
- default user space to pixmap device space:
- (0, 0) -> (width in pixels, height in pixels)
- (height in bp, 0) -> (width in pixels, 0)
- (0, width in bp) -> (0, height in pixels)
- */
- mptr->xx = 0;
- mptr->xy = -pixels_per_bp[1];
- mptr->yx = -pixels_per_bp[0];
- mptr->yy = 0;
- mptr->tx = extension[0];
- mptr->ty = extension[1];
- break;
- case 2:
- /* The y axis of default user space points downwards in pixmap device
- space. The CTM is uniquely characterized by the following mappings from
- default user space to pixmap device space:
- (0, 0) -> (width in pixels, 0)
- (width in bp, 0) -> (0, 0)
- (0, height in bp) -> (width in pixels, height in pixels)
- */
- mptr->xx = -pixels_per_bp[0];
- mptr->xy = 0;
- mptr->yx = 0;
- mptr->yy = pixels_per_bp[1];
- mptr->tx = extension[0];
- mptr->ty = 0;
- break;
- case 3:
- /* The y axis of default user space points to the right in pixmap device
- space. The CTM is uniquely characterized by the following mappings from
- default user space to pixmap device space:
- (0, 0) -> (0, 0)
- (height in bp, 0) -> (0, height in pixels)
- (0, width in bp) -> (width in pixels, 0)
- */
- mptr->xx = 0;
- mptr->xy = pixels_per_bp[1];
- mptr->yx = pixels_per_bp[0];
- mptr->yy = 0;
- mptr->tx = 0;
- mptr->ty = 0;
- break;
- }
-
- /* Finally, shift the device space origin to the top-left corner of the
- printable area. I am deliberately not using the corresponding shift
- feature in gx_device_set_margins() because it achieves its effect by
- using the 'Margins' array which should remain at the user's disposal for
- correcting misadjustments. In addition, gx_device_set_margins() will not
- work correctly for quarters % 4 != 0 anyway.
- */
- {
- gs_matrix translation;
-
- /* Translation of pixmap device space origin by top and left margins in
- pixmap device space */
- gs_make_translation(
- -dev->eprn.right_shift*pixels_per_bp[0],
- -dev->eprn.down_shift *pixels_per_bp[1],
- &translation);
-
- /* Multiply the initial matrix from the right with the translation matrix,
- i.e., in going from user to device space the translation will be applied
- last. */
- gs_matrix_multiply(mptr, &translation, mptr);
- }
-
-#ifdef EPRN_TRACE
- if_debug6(EPRN_TRACE_CHAR, " Returning [%g %g %g %g %g %g].\n",
- mptr->xx, mptr->xy, mptr->yx, mptr->yy, mptr->tx, mptr->ty);
-#endif
- return;
-}
-
-/******************************************************************************
-
- Function: print_flags
-
- Print a textual description of 'flags' on 'f'.
-
-******************************************************************************/
-
-static void print_flags(FILE *f, ms_MediaCode flags, const ms_Flag *user_flags)
-{
- /* Non-standard flags first */
- if (user_flags != NULL) {
- while (user_flags->code != ms_none) {
- if (user_flags->code & flags) {
- fputs(user_flags->name, f);
- flags &= ~user_flags->code;
- }
- user_flags++;
- }
- }
-
- /* Standard substrings */
- if (flags & MS_SMALL_FLAG) fputs(MS_SMALL_STRING, f);
- if (flags & MS_BIG_FLAG ) fputs(MS_BIG_STRING, f);
- if (flags & MS_EXTRA_FLAG) fputs(MS_EXTRA_STRING, f);
- flags &= ~(MS_SMALL_FLAG | MS_BIG_FLAG | MS_EXTRA_FLAG);
-
- /* Completeness check */
- if (flags & ~MS_TRANSVERSE_FLAG)
- fprintf(f, "0x%04X", (unsigned int)(flags & ~MS_TRANSVERSE_FLAG));
-
- /* Standard qualifier */
- if (flags & MS_TRANSVERSE_FLAG) fputs("." MS_TRANSVERSE_STRING, f);
-
- return;
-}
-
-/******************************************************************************
-
- Function: eprn_flag_mismatch
-
- This routine is called if the media size can be supported for some
- combination of flags but not for that combination which has been requested.
- The parameter 'no_match' indicates whether these flags are supported at all
- for any of the supported sizes or not.
-
- If the derived device has set a flag mismatch error reporting function, the
- call will be passed to that function. Otherwise a general error message is
- written on 'err'.
-
-******************************************************************************/
-
-static void eprn_flag_mismatch(FILE *err, const struct s_eprn_Device *eprn,
- bool no_match)
-{
- if (eprn->fmr != NULL) (*eprn->fmr)(err, eprn, no_match);
- else {
- const char *epref = eprn->CUPS_messages? CUPS_ERRPREF: "";
-
- fprintf(err, "%s" ERRPREF "The %s does not support ",
- epref, eprn->cap->name);
- if (eprn->desired_flags == 0) fprintf(err, "an empty set of media flags");
- else {
- fputs("the \"", err);
- print_flags(err, eprn->desired_flags, eprn->flag_desc);
- fputs("\" flag(s)", err);
- }
- fprintf(err, "\n%s (ignoring presence or absence of \"", epref);
- {
- ms_MediaCode optional = MS_TRANSVERSE_FLAG;
- if (eprn->optional_flags != NULL) {
- const ms_MediaCode *of = eprn->optional_flags;
- while (*of != ms_none) optional |= *of++;
- }
- print_flags(err, optional, eprn->flag_desc);
- }
- fputs("\") for ", err);
- if (no_match) fputs("any", err); else fputs("this", err);
- fputs(" page size.\n", err);
- }
-
- return;
-}
-
-/******************************************************************************
-
- Function: better_flag_match
-
- This function returns true iff the flags in 'new_code' match the requested
- flags (strictly) better than those in 'old_code'.
-
-******************************************************************************/
-
-static bool better_flag_match(ms_MediaCode desired,
- const ms_MediaCode *optional, ms_MediaCode old_code, ms_MediaCode new_code)
-{
- ms_MediaCode
- old_diff, /* difference between old flags and desired flags */
- new_diff; /* difference between new flags and desired flags */
-
- /* Ignore the size information */
- old_code = ms_flags(old_code);
- new_code = ms_flags(new_code);
-
- /* Determine differences to desired flags */
- old_diff = old_code ^ desired;
- new_diff = new_code ^ desired;
-
- /* Check for exact matches */
- if (old_diff == 0) return false;
- if (new_diff == 0) return true;
-
- /* Is the difference at most MS_TRANSVERSE_FLAG? */
- old_diff = old_diff & ~MS_TRANSVERSE_FLAG;
- new_diff = new_diff & ~MS_TRANSVERSE_FLAG;
- if (old_diff == 0) return false;
- if (new_diff == 0) return true;
-
- /* Loop over the remaining optional flags */
- if (optional != NULL) {
- const ms_MediaCode *opt = optional;
-
- while (*opt != ms_none) {
- old_diff = old_diff & ~*opt;
- new_diff = new_diff & ~*opt;
- if (old_diff == 0) {
- if (new_diff != 0) return false;
- /* At this point both are matches at the same level of optional flags.
- Now look for the last preceding flag in which they differ. */
- {
- ms_MediaCode diff = ms_flags(old_code ^ new_code);
- while (optional < opt && (diff & *opt) == 0) opt--;
- if ((diff & *opt) == 0) {
- if ((diff & MS_TRANSVERSE_FLAG) == 0) return false;
- /* old and new differ in MS_TRANSVERSE_FLAG */
- return (new_code & MS_TRANSVERSE_FLAG) ==
- (desired & MS_TRANSVERSE_FLAG);
- }
- return (new_code & *opt) == (desired & *opt);
- }
- }
- if (new_diff == 0) return true;
- opt++;
- }
- }
-
- return false; /* Both codes are mismatches at this point */
-}
-
-/******************************************************************************
-
- Function: flag_match
-
- This function returns true iff 'code' is an acceptable match for the flag
- request.
-
-******************************************************************************/
-
-static bool flag_match(ms_MediaCode desired,
- const ms_MediaCode *optional, ms_MediaCode code)
-{
- code = (ms_flags(code) ^ desired) & ~MS_TRANSVERSE_FLAG;
- if (code == 0) return true;
-
- if (optional == NULL) return false;
-
- while (*optional != ms_none && code != 0) {
- code = code & ~*optional;
- optional++;
- }
-
- return code == 0;
-}
-
-/******************************************************************************
-
- Function: eprn_set_page_layout
-
- This function determines media size, sheet orientation in pixmap device space,
- the orientation of default user space, and the imageable area. It should be
- called whenever the page device parameters "PageSize" and "LeadingEdge",
- the media flags, or the page descriptions have been changed.
-
- The function returns zero on success and a non-zero value otherwise.
- In the latter case, an error message has been issued on stderr. This can only
- occur if the media size is not supported with the flags requested.
-
- On success, the following variables in the device structure are consistent:
- width, height, MediaSize[], HWMargins[], eprn.code, eprn.default_orientation,
- eprn.right_shift, eprn.down_shift.
-
-******************************************************************************/
-
-int eprn_set_page_layout(eprn_Device *dev)
-{
- bool
- no_match = true,
- /* Are the requested flags supported for some size? */
- landscape = dev->MediaSize[0] > dev->MediaSize[1];
- /* It's not documented, but 'MediaSize' is the requested "PageSize" page
- device parameter value and hence is to be interpreted in default (not
- default default!) user space. */
- const char *epref = dev->eprn.CUPS_messages? CUPS_ERRPREF: "";
- const eprn_CustomPageDescription
- *best_cmatch = NULL; /* best custom page size match */
- eprn_Eprn
- *eprn = &dev->eprn;
- const eprn_PageDescription
- *best_cdmatch = NULL, /* best custom page size match in discrete list*/
- *best_dmatch = NULL, /* best discrete match */
- *pd; /* loop variable */
- float
- /* Page width and height in bp with w <= h (in a moment): */
- w = dev->MediaSize[0],
- h = dev->MediaSize[1],
- /* pixmap device space margins in bp (canonical order): */
- margins[4];
- int
- quarters;
- ms_MediaCode
- desired = eprn->desired_flags;
-
-#ifdef EPRN_TRACE
- if_debug3(EPRN_TRACE_CHAR,
- "! eprn_set_page_layout(): PageSize = [%.0f %.0f], "
- "desired_flags = 0x%04X.\n",
- dev->MediaSize[0], dev->MediaSize[1], (unsigned int)desired);
-#endif
-
- /* Ensure w <= h */
- if (w > h) {
- float temp;
- temp = w; w = h; h = temp;
- /* This has effectively split 'MediaSize[]' into 'w', 'h' and 'landscape'.
- */
- }
-
- /* Initialization of primary return value */
- eprn->code = ms_none;
-
- /* Put the LeadingEdge value into the desired flag pattern if it's set */
- if (eprn->leading_edge_set) {
- if (eprn->default_orientation % 2 == 0) /* true on short edge first */
- desired &= ~MS_TRANSVERSE_FLAG;
- else
- desired |= MS_TRANSVERSE_FLAG;
- }
-
- /* Find best match in discrete sizes */
- if (eprn->media_overrides == NULL) pd = eprn->cap->sizes;
- else pd = eprn->media_overrides;
- while (pd->code != ms_none) {
- const ms_SizeDescription *ms = ms_find_size_from_code(pd->code);
- if (ms->dimen[0] > 0.0 /* ignore variable sizes */ &&
- fabs(w - ms->dimen[0]) <= 5.0 &&
- fabs(h - ms->dimen[1]) <= 5.0) {
- /* The size does match at 5 bp tolerance. This value has been chosen
- arbitrarily to be equal to PostScript's PageSize matching tolerance
- during media selection. The tolerance should really be that at which
- the printer in question distinguishes between sizes or smaller than
- that in order to at least prevent printing on unsupported sizes.
- */
- if (best_dmatch == NULL ||
- better_flag_match(desired, eprn->optional_flags, best_dmatch->code,
- pd->code))
- best_dmatch = pd;
- if (flag_match(desired, eprn->optional_flags, pd->code))
- no_match = false;
- }
- pd++;
- }
-
- /* Next find the best match among the custom size descriptions */
- if (eprn->cap->custom != NULL) {
- const eprn_CustomPageDescription *cp = eprn->cap->custom;
-
- /* First check whether the size is in the supported range */
- while (cp->width_max > 0.0) {
- if (cp->width_min <= w && w <= cp->width_max &&
- cp->height_min <= h && h <= cp->height_max) {
- /* The size does match. */
- if (best_cmatch == NULL ||
- better_flag_match(desired, eprn->optional_flags, best_cmatch->code,
- cp->code))
- best_cmatch = cp;
- if (eprn->media_overrides == NULL &&
- flag_match(desired, eprn->optional_flags, cp->code))
- no_match = false;
- }
- cp++;
- }
-
- /* If we have read a media configuration file, the flags to be matched
- must be sought in 'media_overrides'. */
- if (best_cmatch != NULL && eprn->media_overrides != NULL) {
- for (pd = eprn->media_overrides; pd->code != ms_none; pd++) {
- if (ms_without_flags(pd->code) == ms_CustomPageSize) {
- if (best_cdmatch == NULL ||
- better_flag_match(desired, eprn->optional_flags,
- best_cdmatch->code, pd->code))
- best_cdmatch = pd;
- if (flag_match(desired, eprn->optional_flags, pd->code))
- no_match = false;
- }
- }
- }
- }
-
- /* Now the 'best_*match' variables indicate for each of the categories of
- page descriptions to which extent the size is supported at all (non-NULL
- value) and what the best flag match in the category is. Here we now check
- for NULL values, i.e., size matches. */
- if (best_dmatch == NULL) {
- /* No discrete match */
- if (best_cmatch == NULL) {
- /* No match at all. */
- fprintf(stderr, "%s" ERRPREF
- "This document requests a page size of %.0f x %.0f bp.\n",
- epref, dev->MediaSize[0], dev->MediaSize[1]);
- if (eprn->cap->custom == NULL) {
- /* The printer does not support custom page sizes */
- if (eprn->media_overrides != NULL)
- fprintf(stderr,
- "%s The media configuration file does not contain an entry for "
- " this size.\n", epref);
- else
- fprintf(stderr, "%s This size is not supported by the %s.\n",
- epref, eprn->cap->name);
- }
- else
- fprintf(stderr,
- "%s This size is not supported as a discrete size and it exceeds "
- "the\n"
- "%s custom page size limits for the %s.\n",
- epref, epref, eprn->cap->name);
- return -1;
- }
- if (eprn->media_overrides != NULL && best_cdmatch == NULL) {
- fprintf(stderr, "%s" ERRPREF
- "This document requests a page size of %.0f x %.0f bp\n"
- "%s but there is no entry for this size in the "
- "media configuration file\n"
- "%s %s.\n",
- epref, dev->MediaSize[0], dev->MediaSize[1], epref, epref,
- eprn->media_file);
- return -1;
- }
- }
- /* Now we have: best_dmatch != NULL || best_cmatch != NULL &&
- (eprn->media_overrides == NULL || best_cdmatch != NULL). */
-
- /* Find a flag match among the size matches found so far */
- {
- ms_MediaCode custom_code = ms_none;
- /* best custom page size match (either from cmatch or dcmatch) */
- if (best_cmatch != NULL &&
- (eprn->media_overrides == NULL || best_cdmatch != NULL))
- custom_code = (eprn->media_overrides == NULL?
- best_cmatch->code: best_cdmatch->code);
-
- if (best_dmatch == NULL ||
- best_cmatch != NULL &&
- better_flag_match(desired, eprn->optional_flags, best_dmatch->code,
- custom_code)) {
- if (flag_match(desired, eprn->optional_flags, custom_code)) {
- if (eprn->media_overrides == NULL) {
- eprn->code = best_cmatch->code;
- margins[0] = best_cmatch->left;
- margins[1] = best_cmatch->bottom;
- margins[2] = best_cmatch->right;
- margins[3] = best_cmatch->top;
- }
- else {
- eprn->code = best_cdmatch->code;
- margins[0] = best_cdmatch->left;
- margins[1] = best_cdmatch->bottom;
- margins[2] = best_cdmatch->right;
- margins[3] = best_cdmatch->top;
- }
- }
- }
- else {
- if (flag_match(desired, eprn->optional_flags, best_dmatch->code)) {
- eprn->code = best_dmatch->code;
- margins[0] = best_dmatch->left;
- margins[1] = best_dmatch->bottom;
- margins[2] = best_dmatch->right;
- margins[3] = best_dmatch->top;
- }
- }
- }
- /* If we've found a match, 'code' is no longer 'ms_none'. */
- if (eprn->code == ms_none) {
- eprn_flag_mismatch(stderr, eprn, no_match);
- return -1;
- }
-
- /* Adapt the orientation of default default user space if not prescribed */
- if (!eprn->leading_edge_set) {
- if (eprn->code & MS_TRANSVERSE_FLAG) eprn->default_orientation = 3;
- /* This leads to 0 if landscape orientation is requested. */
- else eprn->default_orientation = 0;
- }
-
- /*
- Now 'eprn->default_orientation % 2' describes the sheet's orientation in
- pixmap device space. If this does not agree with the width and height
- values in the device instance, we'll have to adapt them.
- This is only necessary if there is a significant difference between width
- and height.
- */
- if (fabs(w - h) > 1 /* arbitrary */ &&
- (eprn->default_orientation % 2 == 0) !=
- (dev->width/dev->HWResolution[0] <= dev->height/dev->HWResolution[1])) {
- bool reallocate = false;
-
-#ifdef EPRN_TRACE
- if_debug0(EPRN_TRACE_CHAR,
- "! eprn_set_page_layout(): width-height change is necessary.\n");
-#endif
-
- /* Free old storage if the device is open */
- if (dev->is_open) {
-#ifdef EPRN_TRACE
- if_debug0(EPRN_TRACE_CHAR, "! eprn_set_page_layout(): Device is open.\n");
-#endif
- reallocate = true;
- /* One could try and call the allocation/reallocation routines of the
- prn device directly, but they are not available in older ghostscript
- versions and this method is safer anyway because it relies on a
- documented API. */
- gdev_prn_close((gx_device *)dev); /* ignore the result */
- }
-
- /* Now set width and height via gx_device_set_media_size(). This function
- sets 'MediaSize[]', 'width', and 'height' based on the assumption that
- default user space has a y axis which is vertical in pixmap device
- space. This may be wrong and we have to fix it. Because fixing
- 'MediaSize[]' is simpler, gx_device_set_media_size() is called such
- that it gives the correct values for 'width' and 'height'. */
- if (eprn->default_orientation % 2 == 0) {
- /* portrait orientation of the sheet in pixmap device space */
- gx_device_set_media_size((gx_device *)dev, w, h);
- if (landscape) {
- dev->MediaSize[0] = h;
- dev->MediaSize[1] = w;
- }
- }
- else {
- /* landscape orientation in pixmap device space (transverse) */
- gx_device_set_media_size((gx_device *)dev, h, w);
- if (!landscape) {
- dev->MediaSize[0] = w;
- dev->MediaSize[1] = h;
- }
- }
-
- /* If the device is/was open, reallocate storage */
- if (reallocate) {
- int rc;
-
- rc = gdev_prn_open((gx_device *)dev);
- if (rc < 0) {
- fprintf(stderr, "%s" ERRPREF
- "Failure of gdev_prn_open(), code is %d.\n",
- epref, rc);
- return rc;
- }
- }
- }
-
- /* Increase the bottom margin for coloured modes except if it is exactly
- zero */
- if (eprn->colour_model != eprn_DeviceGray && margins[1] != 0.0)
- margins[1] += eprn->cap->bottom_increment;
-
- /* Number of +90-degree rotations needed for default user space: */
- quarters = eprn->default_orientation;
- if (landscape) quarters = (quarters + 1)%4;
-
- /* Store the top and left margins in the device structure for use by
- eprn_get_initial_matrix() and set the margins of the printable area if
- we may.
- gx_device_set_margins() (see gsdevice.c) copies the margins[] array to
- HWMargins[] which is presumably to be interpreted in default user space
- (see gs_initclip() in gspath.c), and if its second argument is true it
- also modifies the offset variable Margins[]. The first property means
- that gx_device_set_margins() can only be used if default user space and
- pixmap device space have the same "up" direction, and the second
- appropriates a parameter which is intended for the user.
- */
- if (eprn->keep_margins) {
- eprn->down_shift = dev->HWMargins[3 - quarters];
- eprn->right_shift = dev->HWMargins[(4 - quarters)%4];
- }
- else {
- int j;
-
- eprn->down_shift = margins[3];
- eprn->right_shift = margins[0];
-
- if (quarters != 0) {
- /* The "canonical margin order" for ghostscript is left, bottom, right,
- top. Hence for, e.g., a +90-degree rotation ('quarters' is 1) of
- default user space with respect to pixmap device space the left
- margin (index 0) in default user space is actually the bottom margin
- (index 1) in pixmap device space, the bottom margin is the right one,
- etc.
- */
- for (j = 0; j < 4; j++) dev->HWMargins[j] = margins[(j+quarters)%4];
- /* 'HWMargins[]' is in bp (see gxdevcli.h) */
- }
- else {
- /* Convert to inches */
- for (j = 0; j < 4; j++) margins[j] /= BP_PER_IN;
-
- gx_device_set_margins((gx_device *)dev, margins, false);
- /* Of course, I could set HWMargins[] directly also in this case. This
- way is however less prone to break on possible future incompatible
- changes to ghostscript and it covers the most frequent case (portrait
- and short edge first). */
- }
- }
-
- return 0;
-}
-
-/******************************************************************************
-
- Function: eprn_init_device
-
- This function sets 'cap' to 'desc' and all device parameters which are
- modified through the put_params routines to default values. The resolution is
- left at its old value (and don't ask me why or I'll start to whimper). If the
- device is open when this function is called the device will be closed
- afterwards.
-
- 'desc' may not be NULL.
-
-******************************************************************************/
-
-void eprn_init_device(eprn_Device *dev, const eprn_PrinterDescription *desc)
-{
- eprn_Eprn *eprn = &dev->eprn;
- int j;
- float hres, vres;
-
- if (dev->is_open) gs_closedevice((gx_device *)dev);
-
- assert(desc != NULL);
- eprn->cap = desc;
- eprn_set_media_data(dev, NULL, 0);
-
- /* The media flags are retained because they have not been prescribed by the
- user directly in contact with eprn but are completely under the control
- of the derived device. */
-
- eprn->code = ms_none;
- eprn->leading_edge_set = false;
- eprn->right_shift = 0;
- eprn->down_shift = 0;
- eprn->keep_margins = false;
- eprn->soft_tumble = false;
- for (j = 0; j < 4; j++) dev->HWMargins[j] = 0;
-
- /* Set to default colour state, ignoring request failures */
- eprn->colour_model = eprn_DeviceGray;
- eprn->black_levels = 2;
- eprn->non_black_levels = 0;
- eprn->intensity_rendering = eprn_IR_halftones;
- hres = dev->HWResolution[0];
- vres = dev->HWResolution[1];
- eprn_check_colour_info(desc->colour_info, &eprn->colour_model,
- &hres, &vres, &eprn->black_levels, &eprn->non_black_levels);
-
- if (eprn->pagecount_file != NULL) {
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), eprn->pagecount_file, strlen(eprn->pagecount_file) + 1,
- sizeof(char), "eprn_init_device");
- eprn->pagecount_file = NULL;
- }
-
- eprn->media_position_set = false;
-
- return;
-}
-
-/******************************************************************************
-
- Function: eprn_set_media_flags
-
-******************************************************************************/
-
-void eprn_set_media_flags(eprn_Device *dev, ms_MediaCode desired,
- const ms_MediaCode *optional)
-{
- dev->eprn.code = ms_none;
-
- dev->eprn.desired_flags = desired;
- dev->eprn.optional_flags = optional;
-
- return;
-}
-
-/******************************************************************************
-
- Function: eprn_open_device
-
- This function "opens" the device. According to Drivers.htm, the 'open_device'
- functions are called before any output is sent to the device, and they must
- ensure that the device instance is valid, possibly by doing suitable
- initialization.
-
- This particular implementation also checks whether the requested page size
- is supported by the printer. This discovery must, unfortunately, be
- delayed until the moment this function is called. Note that this also implies
- that various eprn parameters depending on the page size (e.g., 'eprn.code')
- can be relied upon to have valid values only after the device has been
- successfully opened. The same applies to rendering parameters.
-
- This function also opens the parts defined by base classes.
-
- The function returns zero on success and a ghostscript error value otherwise.
-
-******************************************************************************/
-
-int eprn_open_device(gx_device *device)
-{
- eprn_Eprn *eprn = &((eprn_Device *)device)->eprn;
- const char *epref = eprn->CUPS_messages? CUPS_ERRPREF: "";
- int rc;
-
-#ifdef EPRN_TRACE
- if_debug0(EPRN_TRACE_CHAR, "! eprn_open_device()...\n");
-#endif
-
- /* Checks on page size and determination of derived values */
- if (eprn_set_page_layout((eprn_Device *)device) != 0)
- return_error(gs_error_rangecheck);
-
- /* Check the rendering parameters */
- if (eprn_check_colour_info(eprn->cap->colour_info, &eprn->colour_model,
- &device->HWResolution[0], &device->HWResolution[1],
- &eprn->black_levels, &eprn->non_black_levels) != 0) {
- gs_param_string str;
-
- fprintf(stderr, "%s" ERRPREF "The requested combination of colour model (",
- epref);
- str.size = 0;
- if (eprn_get_string(eprn->colour_model, eprn_colour_model_list, &str) != 0)
- assert(0); /* Bug. No harm on NDEBUG because I've just set the size. */
- fwrite(str.data, str.size, sizeof(str.data[0]), stderr);
- fprintf(stderr, "),\n"
- "%s resolution (%gx%g ppi) and intensity levels (%d, %d) is\n"
- "%s not supported by the %s.\n",
- epref, device->HWResolution[0], device->HWResolution[1],
- eprn->black_levels, eprn->non_black_levels, epref, eprn->cap->name);
- return_error(gs_error_rangecheck);
- }
-
- /* Initialization for colour rendering */
- if (device->color_info.num_components == 4) {
- /* Native colour space is 'DeviceCMYK' */
- set_dev_proc(device, map_rgb_color, NULL);
-
- if (eprn->intensity_rendering == eprn_IR_FloydSteinberg)
- set_dev_proc(device, map_cmyk_color, &eprn_map_cmyk_color_max);
- else if (device->color_info.max_gray > 1 || device->color_info.max_color > 1)
- set_dev_proc(device, map_cmyk_color, &eprn_map_cmyk_color_flex);
- else
- set_dev_proc(device, map_cmyk_color, &eprn_map_cmyk_color);
-
- if (eprn->intensity_rendering == eprn_IR_FloydSteinberg)
- set_dev_proc(device, map_rgb_color, &eprn_map_rgb_color_for_CMY_or_K_max);
- else if (device->color_info.max_gray > 1 || device->color_info.max_color > 1)
- set_dev_proc(device, map_rgb_color, &eprn_map_rgb_color_for_CMY_or_K_flex);
- else
- set_dev_proc(device, map_rgb_color, &eprn_map_rgb_color_for_CMY_or_K);
-
- }
- else {
- set_dev_proc(device, map_cmyk_color, NULL);
-
- if (eprn->colour_model == eprn_DeviceRGB) {
- if (eprn->intensity_rendering == eprn_IR_FloydSteinberg)
- set_dev_proc(device, map_rgb_color, &eprn_map_rgb_color_for_RGB_max);
- else if (device->color_info.max_color > 1)
- set_dev_proc(device, map_rgb_color, &eprn_map_rgb_color_for_RGB_flex);
- else
- set_dev_proc(device, map_rgb_color, &eprn_map_rgb_color_for_RGB);
- } else {
- if (eprn->intensity_rendering == eprn_IR_FloydSteinberg)
- set_dev_proc(device, map_rgb_color, &eprn_map_rgb_color_for_CMY_or_K_max);
- else if (device->color_info.max_gray > 1 || device->color_info.max_color > 1)
- set_dev_proc(device, map_rgb_color, &eprn_map_rgb_color_for_CMY_or_K_flex);
- else
- set_dev_proc(device, map_rgb_color, &eprn_map_rgb_color_for_CMY_or_K);
- }
- }
- eprn->output_planes = eprn_bits_for_levels(eprn->black_levels) +
- 3 * eprn_bits_for_levels(eprn->non_black_levels);
-
-#if !defined(GS_REVISION) || GS_REVISION >= 600
- /* According to my understanding, the following call should be superfluous
- (because the colour mapping functions may not be called while the device
- is closed) and I am also not aware of any situation where it does make a
- difference. It shouldn't do any harm, though, and I feel safer with it :-)
- */
- gx_device_decache_colors(device);
-#endif
-
-#ifndef EPRN_NO_PAGECOUNTFILE
- /* Read the page count value */
- if (eprn->pagecount_file != NULL) {
- unsigned long count;
- if (pcf_getcount(eprn->pagecount_file, &count) == 0)
- device->PageCount = count;
- /* unsigned to signed. The C standard permits
- an implementation to generate an overflow indication if the value is
- too large. I consider this to mean that the type of 'PageCount' is
- inappropriate :-). Note that eprn does not use 'PageCount' for
- updating the file. */
- else {
- /* pcf_getcount() has issued an error message. */
- fputs(
- " No further attempts will be made to access the page count file.\n",
- stderr);
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), eprn->pagecount_file, strlen(eprn->pagecount_file) + 1,
- sizeof(char), "eprn_open_device");
- eprn->pagecount_file = NULL;
- }
- }
-#endif /* !EPRN_NO_PAGECOUNTFILE */
-
- /* Open the "prn" device part */
- if ((rc = gdev_prn_open(device)) != 0) return rc;
-
- /* Just in case a previous open call failed in a derived device (note that
- 'octets_per_line' is still the same as then): */
- if (eprn->scan_line.str != NULL)
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), eprn->scan_line.str, eprn->octets_per_line, sizeof(eprn_Octet),
- "eprn_open_device");
- if (eprn->next_scan_line.str != NULL) {
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), eprn->next_scan_line.str, eprn->octets_per_line, sizeof(eprn_Octet),
- "eprn_open_device");
- eprn->next_scan_line.str = NULL;
- }
-
- /* Calls which might depend on prn having been initialized */
- eprn->octets_per_line = gdev_prn_raster((gx_device_printer *)device);
- eprn->scan_line.str = (eprn_Octet *) gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), eprn->octets_per_line,
- sizeof(eprn_Octet), "eprn_open_device");
- if (eprn->intensity_rendering == eprn_IR_FloydSteinberg) {
- eprn->next_scan_line.str = (eprn_Octet *) gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), eprn->octets_per_line,
- sizeof(eprn_Octet), "eprn_open_device");
- if (eprn->next_scan_line.str == NULL && eprn->scan_line.str != NULL) {
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), eprn->scan_line.str, eprn->octets_per_line, sizeof(eprn_Octet),
- "eprn_open_device");
- eprn->scan_line.str = NULL;
- }
- }
- if (eprn->scan_line.str == NULL) {
- fprintf(stderr, "%s" ERRPREF
- "Memory allocation failure from gs_malloc() in eprn_open_device().\n",
- epref);
- return_error(gs_error_VMerror);
- }
-
- return rc;
-}
-
-/******************************************************************************
-
- Function: eprn_close_device
-
-******************************************************************************/
-
-int eprn_close_device(gx_device *device)
-{
- eprn_Eprn *eprn = &((eprn_Device *)device)->eprn;
-
-#ifdef EPRN_TRACE
- if_debug0(EPRN_TRACE_CHAR, "! eprn_close_device()...\n");
-#endif
-
- if (eprn->scan_line.str != NULL) {
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), eprn->scan_line.str, eprn->octets_per_line, sizeof(eprn_Octet),
- "eprn_close_device");
- eprn->scan_line.str = NULL;
- }
- if (eprn->next_scan_line.str != NULL) {
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), eprn->next_scan_line.str, eprn->octets_per_line, sizeof(eprn_Octet),
- "eprn_close_device");
- eprn->next_scan_line.str = NULL;
- }
-
- return gdev_prn_close(device);
-}
-
-/******************************************************************************
-
- Function: eprn_forget_defaultmatrix
-
- This function tells the ghostscript kernel to forget the default matrix,
- i.e., to consult the get_initial_matrix device procedure the next time the
- default CTM is needed.
-
-******************************************************************************/
-
-static void eprn_forget_defaultmatrix(void)
-{
-#if EPRN_USE_GSTATE
- /* Old ghostscript versions */
- gs_setdefaultmatrix(igs, NULL);
-#else
- gs_setdefaultmatrix(get_minst_from_memory(gs_lib_ctx_get_non_gc_memory_t())->i_ctx_p->pgs, NULL);
-#endif
-
- return;
-}
-
-/******************************************************************************
-
- Function: eprn_output_page
-
- This function is a wrapper for gdev_prn_output_page() in order to catch the
- number of pages printed and to initialize the eprn_get_planes() API.
-
-******************************************************************************/
-
-int eprn_output_page(gx_device *dev, int num_copies, int flush)
-{
- eprn_Eprn *eprn = &((eprn_Device *)dev)->eprn;
- int rc;
-
-#ifdef EPRN_TRACE
- clock_t start_time = clock();
- if_debug0(EPRN_TRACE_CHAR, "! eprn_output_page()...\n");
-#endif
-
- /* Initialize eprn_get_planes() data */
- eprn->next_y = 0;
- if (eprn->intensity_rendering == eprn_IR_FloydSteinberg) {
- /* Fetch the first line and store it in 'next_scan_line'. */
- if (eprn_fetch_scan_line((eprn_Device *)dev, &eprn->next_scan_line) == 0)
- eprn->next_y++;
- }
-
- /* Ship out */
- rc = gdev_prn_output_page(dev, num_copies, flush);
-
- /* CUPS page accounting message. The CUPS documentation is not perfectly
- clear on whether one should generate this message before printing a page
- or after printing has been successful. The rasterto* filters generate it
- before sending the page, but as the scheduler uses these messages for
- accounting, this seems unfair.
- */
- if (rc == 0 && eprn->CUPS_accounting)
- fprintf(stderr, "PAGE: %ld %d\n", dev->ShowpageCount, num_copies);
- /* The arguments are the number of the page, starting at 1, and the number
- of copies of that page. */
-
-#ifndef EPRN_NO_PAGECOUNTFILE
- /* On success, record the number of pages printed */
- if (rc == 0 && eprn->pagecount_file != NULL) {
- assert(num_copies > 0); /* because of signed/unsigned */
- if (pcf_inccount(eprn->pagecount_file, num_copies) != 0) {
- /* pcf_inccount() has issued an error message. */
- fputs(
- " No further attempts will be made to access the page count file.\n",
- stderr);
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), eprn->pagecount_file, strlen(eprn->pagecount_file) + 1,
- sizeof(char), "eprn_output_page");
- eprn->pagecount_file = NULL;
- }
- }
-#endif /* !EPRN_NO_PAGECOUNTFILE */
-
- /* If soft tumble has been demanded, ensure the get_initial_matrix procedure
- is consulted for the next page */
- if (eprn->soft_tumble) eprn_forget_defaultmatrix();
-
-#ifdef EPRN_TRACE
- if_debug1(EPRN_TRACE_CHAR, "! eprn_output_page() terminates after %f s.\n",
- ((float)(clock() - start_time))/CLOCKS_PER_SEC);
-#endif
-
- return rc;
-}
diff --git a/gs/contrib/pcl3/eprn/gdeveprn.h b/gs/contrib/pcl3/eprn/gdeveprn.h
deleted file mode 100644
index afc8c2759..000000000
--- a/gs/contrib/pcl3/eprn/gdeveprn.h
+++ /dev/null
@@ -1,827 +0,0 @@
-/******************************************************************************
- File: $Id: gdeveprn.h,v 1.23 2001/04/30 05:15:51 Martin Rel $
- Contents: Header file for the abstract ghostscript device 'eprn'
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany; e-mail: Martin.Lottermoser@t-online.de.
-
-*******************************************************************************
-* *
-* Copyright (C) 2000, 2001 by Martin Lottermoser *
-* All rights reserved *
-* *
-*******************************************************************************
-
- The 'eprn' device
- *****************
- In developing my hpdj/pcl3 driver for PCL 3+ I had to implement a lot of
- functionality which was logically independent of PCL. This indicated that the
- functionality offered by ghostscript's 'prn' device was insufficient and
- should be extended, leading to this "extended prn device".
-
-
- Functionality
- =============
- The "eprn" device offers the following services to derived devices:
- - A simple but still flexible rendering model. A derived device defines
- printer capability descriptions listing the supported rendering parameters,
- lets the eprn device handle the user's rendering requests, and then just
- fetches the pixels.
- - A PostScript-conforming initialization of default user space with respect
- to landscape orientation and support for the standard page device parameter
- "LeadingEdge".
- - Recognition of media sizes from the document and checking of supported
- sizes based on printer descriptions
- - Flexible handling of size-specific hardware margins
- - Counting of pages printed across gs invocations by means of page count
- files
-
-
- Rendering Model
- ===============
- The "eprn" device parameterizes the printer's rendering capabilities as
- follows:
- - process colour model (Gray, RGB, CMY, CMY+K, CMYK)
- - resolution in horizontal and vertical directions
- - number of intensity levels per colorant, chosen independently for black
- and non-black (RGB or CMY) colorants.
- In addition, the rendering process as implemented in this driver is
- parameterized by:
- - method for rendering intensities (printer, halftones or error diffusion)
- These parameters are specified by the user. The device checks whether the
- printer supports the requested combination and, if it does, sets
- ghostscript's internal data structures accordingly.
-
- The derived device can obtain the resulting pixels by successively calling
- eprn_get_planes() from the page printing procedure.
-
-
- Device Coordinates
- ==================
- "Pixmap device space" is the coordinate system used by the "prn" device for
- generating a pixmap and implicit in the API for accessing it (e.g.,
- gdev_prn_copy_scan_lines()). In identifying the directions "left", "bottom",
- "right" and "top" I'm assuming that the x axis is pointing to the right and
- the y axis downwards. This is not concerned with the orientation of device
- space on a sheet printed but is merely a definition of what, e.g., "down"
- means for the eprn device: it is defined as "towards increasing prn y values".
- This makes the code more readable for the case where the real device
- coordinate system (on the sheet) has just this orientation. Too bad for the
- others :-).
-
- Terms like "width" and "height" are also defined with respect to this
- interpretation, i.e., "width" is an extension in x direction.
-
- Note that names and interpretations of some of ghostscript's standard
- device structure fields (like 'width', 'height') are also based on this
- convention although this is not explicitly stated. This does however not
- apply to all parameters: for example, HWMargins[] and MediaSize[] are to be
- interpreted in default user space (see gx_default_clip_box()).
-
- One key assumption of the eprn device is that the top edge of pixmap device
- space is the edge closest to and parallel with the medium's leading edge.
- It is the responsibility of the derived device to ensure this. Usually
- it means that raster lines have to be printed in the order of ascending y.
- (The eprn device will work if the derived device violates this condition, but
- the meaning of user-visible properties of the device would change.)
-
- The device sets up the device coordinate system such that the device space
- origin is the top left corner of the imageable area where "top" and "left"
- refer to you holding the sheet with the printed side towards you and the
- leading edge at the top. Units and directions are identical with pixmap
- device space.
-
-
- Page Descriptions
- =================
- When a PostScript document requests a particular page size by specifying its
- width and height in default user space the eprn device combines this
- information with certain conditions imposed by the derived device and looks
- for a matching page description entry in the printer's capability
- description. The following information from such an entry is needed for
- correctly setting up the relation between default user space and device space:
-
- - default orientation of the sheet in pixmap device space
- (MS_TRANSVERSE_FLAG; set iff the sheet has width > height in pixmap
- device space)
- - hardware margins
-
- This part is interpreted by the eprn device.
-
- In addition, a page description entry may contain a number of flags
- indicating special conditions under which this entry is to be selected or
- carrying information on how to configure the printer. The flags are those
- defined by mediasize.h (except that MS_TRANSVERSE_FLAG and MS_ROTATED_FLAG
- may not be used for this purpose), their interpretation is up to the derived
- device which must request them or to which they will become visible when the
- entry is selected.
-
- The eprn device takes the following items as the request to be matched with a
- page description entry in the printer's capability description:
-
- - the media size of the document and, if set, the "LeadingEdge" page device
- parameter
- - a pattern of desired (not necessarily *required*) flags
- - an ordered list of optional flags
-
- Media size and LeadingEdge are set via PostScript or the command line, the
- flags can be set by the derived device through its device structure instance
- or by calling eprn_set_media_flags(). The optional flags when combined with
- the bitwise OR effectively define a mask of bits which may be ignored when
- checking whether an entry matches the desired flags. The order of optional
- flags is from most to least desirable to ignore.
-
- The complete request is compared to the list of page descriptions as follows:
-
- 1. If the media size, irrespective of flags, cannot be matched at 5 bp
- tolerance, the request fails with an error message to standard error.
- 2. Otherwise a shortened list containing all entries having a matching
- size is compiled, at least conceptually. If the device supports custom
- page sizes, they are listed at the end. This is the "base list".
- 3. If LeadingEdge is not null, the MS_TRANSVERSE_FLAG is set or cleared
- accordingly in the pattern of desired flags. This flag is also always
- added to the front of the list of optional flags.
- 4. A mask of flags to be ignored is set to zero.
- 5. The base list is searched for an entry agreeing with the desired flags
- except possibly for those in the ignore mask.
- 6. If no such entry is found, the next flag in the list of optional flags is
- added to the ignore mask and execution continues with step 5. If there is
- no such flag, the request fails and the flag mismatch reporting function
- is called (see below).
- 7. If a matching entry is found the list of optional flags is processed
- backwards starting with the flag before the last one added to the ignore
- mask. For each such flag an attempt is made to remove it from the mask.
- If there still is at least one matching entry in the base list the flag
- remains cleared, otherwise it is put back into the mask.
- 8. Finally, the first entry matching the request mask and the current
- ignore mask will be selected:
- - its media code will be made available to the derived device in the
- eprn device's 'code' field,
- - the hardware margins will be set from the page description (unless the
- user has explicitly specified a value for the ".HWMargins" page device
- parameter),
- - default user space will be configured based on sheet orientation
- (transverse or not in device space) and page orientation (portrait or
- landscape in default user space).
-
- Because the error message in step 6 has to report a mismatch on the flags
- and because the interpretation of the flags is fixed by the derived device,
- an error message issued by the eprn device may not be particularly
- illuminating to the user (the user will usually think in terms of the
- interpretation the derived device associates with these flags). Therefore
- issuing this error message can be delegated to a function ("flag mismatch
- reporting function") specified by the derived device in its device structure
- instance.
-
-******************************************************************************/
-
-#ifndef _gdeveprn_h /* Inclusion protection */
-#define _gdeveprn_h
-
-/* Configuration management identification */
-#pragma ident "@(#)$Id: gdeveprn.h,v 1.23 2001/04/30 05:15:51 Martin Rel $"
-
-/*****************************************************************************/
-
-/* Special Aladdin header, must be included before <sys/types.h> on some
- platforms (e.g., FreeBSD). This necessity seems to be triggered for example
- by <stdio.h>. */
-#include "std.h"
-
-/* Standard headers */
-#include <stdio.h> /* for 'FILE' and 'size_t' */
-
-/* Ghostscript headers */
-#include "gdevprn.h"
-/* This header is assumed to include a definition for 'bool' (stdpre.h). */
-
-/* Other header files */
-#include "mediasize.h"
-
-/*****************************************************************************/
-
-/* Types to describe supported page sizes and associated setup information.
- All sizes are in bp and all orientations refer to pixmap device space.
- */
-
-/* Discrete page sizes */
-typedef struct {
- ms_MediaCode code;
- /* The media flags in 'code' identify the conditions under which the size
- is supported ("required flags") and carry information needed in order
- to adapt ghostscript or the printer to using this entry ("optional
- flags"). The distinction between the two groups of flags is fixed by the
- derived device when calling eprn_set_media_flags() except that special
- rules apply to MS_TRANSVERSE_FLAG which is handled by eprn.
- Setting MS_TRANSVERSE_FLAG indicates that media of this size are normally
- fed such that width > height in pixmap device space, otherwise
- width <= height is assumed.
- Setting MS_ROTATED_FLAG is not permitted.
- The interpretation of all other flags is up to the derived device.
- */
- float left, bottom, right, top;
- /* Hardware margins (non-negative) in bp */
-} eprn_PageDescription;
-
-
-/* Custom page sizes */
-typedef struct {
- /* The first two lines have the same meaning as for 'eprn_PageDescription'.
- However, apart from flags, the 'code' field must be 'ms_CustomPageSize'.
- */
- ms_MediaCode code;
- float left, bottom, right, top;
- float width_min, width_max, height_min, height_max;
- /* Permissible range in bp for width and height when a sheet's dimension is
- given such that width <= height. */
-} eprn_CustomPageDescription;
-
-/*
- Here follows an example of using "eprn_PageDescription". It describes a
- printer supporting A4 and US Letter, the first with 5 mm margins, the latter
- with 0.2 inches:
-
- const eprn_PageDescription page_description[] = {
- {ms_A4, 5*BP_PER_MM, 5*BP_PER_MM, 5*BP_PER_MM, 5*BP_PER_MM},
- {ms_Letter, 0.2*BP_PER_IN, 0.2*BP_PER_IN, 0.2*BP_PER_IN, 0.2*BP_PER_IN},
- {ms_none, 0, 0, 0, 0}
- };
-
- The last entry is a sentinel value which will be required later.
-
-******************************************************************************/
-
-/* Types to describe supported combinations of resolutions, process colour
- models and intensity levels per colorant
-
- These types often contain pointers to lists terminated with a sentinel
- value. As these are usually static data, this makes it easier to share data
- between printer descriptions.
- */
-
-/* Process colour models */
-typedef enum {
- eprn_DeviceGray,
- eprn_DeviceRGB,
- eprn_DeviceCMY,
- eprn_DeviceCMY_plus_K,
- /* 'eprn_DeviceCMY_plus_K' is a process colour model using the CMYK
- colorants but never mixing black with one of the others. The underlying
- native colour space is 'DeviceRGB'. */
- eprn_DeviceCMYK
-} eprn_ColourModel;
-
-/* Horizontal and vertical resolutions w.r.t. pixmap device space */
-typedef struct {
- float h, v;
-} eprn_Resolution;
-
-/* Range for the number of intensity levels */
-typedef struct {
- unsigned short from, to; /* both inclusive */
-} eprn_IntensityLevels;
-
-/* Combined resolutions and intensities. Any combination of the listed
- resolutions and the listed intensity levels is permitted. */
-typedef struct {
- const eprn_Resolution *resolutions;
- /* either NULL (all resolutions are accepted) or a list terminated with
- a {0.0, 0.0} entry */
- const eprn_IntensityLevels *levels;
- /* non-NULL; this list is terminated with {0, 0}. The variable is a list in
- order to permit easier specification of discrete levels. */
-} eprn_ResLev;
-
-/* A complete instance of a rendering capability entry */
-typedef struct {
- eprn_ColourModel colour_model;
- /* A value of 'eprn_DeviceCMYK' implies the capability for
- 'eprn_DeviceCMY_plus_K' because the difference is realized in this driver
- and is not part of the printer's capabilities.
- In contrast, 'eprn_DeviceCMY_plus_K' or 'eprn_DeviceCMYK' do *not* imply
- the capability for CMY or Gray! This is because we assume that
- 'colour_model' corresponds to particular hardware settings for the
- printer.
- */
- const eprn_ResLev *info[2];
- /* Supported resolutions and intensities indexed by colorant. The first
- entry refers to black except for eprn_DeviceRGB and eprn_DeviceCMY when
- it describes the three non-black colorants. The second entry is ignored
- unless both black and non-black colorants are used in which case it can
- either refer to the latter or be NULL to indicate that the black entry
- applies also to the non-black colorants.
- Any non-null info[] points to a list terminated with a {NULL, NULL} entry.
- Only values for those colorants described by different (non-NULL) 'info'
- entries in an instance of this type can be chosen independently. Hence at
- most black can have values different from those of the other colorants.
- */
-} eprn_ColourInfo;
-
-/*
- As an example application of these types, consider a bilevel device
- supporting 600 ppi monochrome printing:
-
- const eprn_Resolution sixhundred[] = { {600, 600}, {0, 0}};
- const eprn_IntensityLevels bilevel[] = { {2, 2}, {0, 0}};
- const eprn_ResLev rl_600_2[] = { {sixhundred, bilevel}, {NULL, NULL}};
- const eprn_ColourInfo mono_600_2[] = {
- {eprn_DeviceGray, {rl_600_2, NULL}},
- {eprn_DeviceGray, {NULL, NULL}}
- };
-
-******************************************************************************/
-
-/* Printer capability description */
-typedef struct {
- const char *name;
- /* This string is used in error messages generated by the device. It should
- describe the printer, not a gs device. In selecting an appropriate value
- imagine a statement like "... is not supported by the <name>" or "The
- <name> does not support ...".
- */
-
- /* Media sizes and hardware margins */
- const eprn_PageDescription *sizes;
- /* List of supported discrete media sizes and associated hardware margins,
- terminated by an entry with 'code' == ms_none. This must always be
- non-NULL. */
- const eprn_CustomPageDescription *custom;
- /* This may be NULL, in which case the printer does not support custom
- page sizes. Otherwise it is a list of entries, terminated with an entry
- having 0.0 for 'width_max'. */
- float bottom_increment;
- /* Change of bottom hardware margin when not printing in DeviceGray,
- specified in bp. This correction is ignored if the bottom margin is
- exactly zero.
- Some HP DeskJets have a larger hardware margin at the bottom for the
- colour cartridge but this is not the case for banner printing. */
-
- /* Colour capabilities */
- const eprn_ColourInfo *colour_info;
- /* List of supported colour models, resolutions and intensity levels.
- This must always be non-NULL and terminated with an entry having NULL as
- 'info[0]'. There must be at least one 'eprn_ColourInfo' entry permitting
- identical resolution for all colorants.
- */
-} eprn_PrinterDescription;
-
-/*
- To continue our series of examples, here is a complete printer description:
-
- const eprn_PrinterDescription description = {
- "Wrzlbrnf printer", page_description, NULL, 0, mono_600_2
- };
-
-******************************************************************************/
-
-/* Intensity rendering methods */
-typedef enum {
- eprn_IR_printer,
- eprn_IR_halftones,
- eprn_IR_FloydSteinberg
-} eprn_IR;
-
-/*****************************************************************************/
-
-/* Unsigned 8-bit values (should really be 'uint8_t') */
-typedef unsigned char eprn_Octet;
-
-/* Octet strings */
-typedef struct {
- eprn_Octet *str;
- int length; /* zero or the length in 'eprn_Octet' instances of the area
- filled starting at '*str' */
-} eprn_OctetString;
-
-/* Type for flag mismatch reporting function */
-struct s_eprn_Device;
- /* The preceding statement is needed in order to establish a forward
- declaration for "struct s_eprn_Device" at file scope. */
-typedef void (*eprn_FlagMismatchReporter)(FILE *f,
- const struct s_eprn_Device *dev, bool no_match);
-/* A function of this kind will be called if the requested media flags cannot
- be satisfied by the printer although the size itself is supported for some
- (unspecified) set of flags. The parameter 'no_match' indicates whether the
- printer supports the set of required flags for some size or not at all
- (this is intended to be useful in the case of flags denoting printer
- capabilities). The requested set of media selection flags is available in
- 'dev->eprn.desired_flags' and 'dev->eprn.optional_flags' (MS_ROTATED_FLAG
- will never be set).
- The function must write an error message on 'f'.
-*/
-
-/*****************************************************************************/
-
-/* The eprn device variables. These are deliberately defined as a structure
- and not as usual in ghostscript as a macro body to be inserted into a
- structure because I want to have namespace isolation for these fields.
- A derived device may read any of these parameters but should never change
- them directly. The only exception is 'soft_tumble'.
- */
-typedef struct s_eprn_Device {
- /* Capabilities */
- const eprn_PrinterDescription *cap;
- /* non-NULL. The data pointed to may not change unless this is immediately
- followed by a call to eprn_init_device(). */
- char *media_file;
- /* gs_malloc()-allocated media configuration file name.
- Non-NULL if 'media_overrides' is non-NULL. */
- eprn_PageDescription *media_overrides;
- /* A list of supported media dimensions and corresponding hardware margins.
- This is usually NULL, meaning that 'cap->sizes' and 'cap->custom' should
- be used.
- If non-NULL, 'media_overrides' must be terminated with an entry having
- 'code' == ms_none. If this field is non-NULL, only the sizes listed here
- will be supported. The device will support custom page sizes only if
- 'cap->custom' is not NULL and 'media_overrides' contains an entry for
- 'ms_CustomPageSize'.
- The pointer refers to gs_malloc()-allocated storage.
- */
-
- /* Page setup */
- const ms_Flag *flag_desc;
- /* Description of the additional flags the derived device understands. This
- can be NULL or a list terminated with an entry having 'code' equal to
- 'ms_none'. */
- ms_MediaCode
- desired_flags;
- const ms_MediaCode
- *optional_flags; /* may be NULL; terminated with 'ms_none'. */
- eprn_FlagMismatchReporter fmr; /* may be NULL */
- ms_MediaCode code;
- /* Page size and other media attributes determined based on printer
- capabilities. A value of 'ms_none' indicates that the page description
- entry to be used has not (yet) been successfully identified and that
- therefore some of the other fields in this structure are not valid. */
-
- /* Coordinates */
- int default_orientation;
- /* Direction of the positive y axis of default default user space (the
- requested PageSize had width <= height) as seen from pixmap device space:
- 0 up
- 1 left
- 2 down
- 3 right
- Hence the value is the number of +90 degrees rotations necessary to
- obtain the "up" direction of default default user space (positive y axis)
- from the "up" direction of pixmap device space (negative y axis).
- The values 0 and 2 imply that the medium has width <= height in pixmap
- device space, 1 and 3 imply height <= width. */
- bool leading_edge_set;
- /* True iff someone set the 'LeadingEdge' page device parameter. In this
- case its value is stored in 'default_orientation'. The values permitted
- for 'default_orientation' and their interpretation are chosen such that
- this gives the desired result.
- If this value is false, the device will select a value for
- 'default_orientation' based on the MS_TRANSVERSE_FLAG in 'code'. */
- float
- right_shift,
- down_shift;
- /* Seen from pixmap device space, the top left corner of the sheet is at
- (-right_shift, -down_shift). Both values are in bp and represent
- hardware margins, i.e., the origin of pixmap device space is a corner
- of the sheet's imageable area.
- These parameters are logically superfluous and could be derived from
- 'HWMargins[]' and possibly other data (like 'default_orientation'),
- provided one knows what the reference system for 'HWMargins[]' is.
- This is not documented but it seems to be default user space. In order
- to have values with a reliable interpretation and because the data are
- originally given in pixmap device space anyway I have introduced these
- variables. */
- bool keep_margins;
- /* True iff margin information should be taken from 'HWMargins[]' instead
- of from the printer description. */
- bool soft_tumble;
- /* If this field is set, every second page will have its default user
- coordinate system rotated by 180 degrees. */
-
- /* Colour */
- eprn_ColourModel
- colour_model; /* Colour model selected */
- unsigned int
- black_levels, /* Number of intensity levels for black colorant */
- non_black_levels; /* Number of intensity levels for non-black colorants */
- eprn_IR
- intensity_rendering; /* method to use */
-
- /* Page counting and other spooler support */
- char
- *pagecount_file; /* gs_malloc()-allocated name of page count file.
- May be NULL. */
- bool
- CUPS_accounting, /* Send CUPS page accounting messages. */
- CUPS_messages; /* Add CUPS message prefixes to error messages and
- warnings. */
-
- /* Support for the standard page device parameter "MediaPosition" */
- bool media_position_set;
- int media_position;
-
- /* Internal parameters. These have reliable values only after a successful
- call to eprn_open(). */
- unsigned int
- bits_per_colorant; /* Number of bits per colorant used in 'gx_color_index'
- values. Constant while the device is open. */
- eprn_OctetString
- scan_line, /* 'str' is gs_malloc()-allocated */
- next_scan_line; /* 'str' is gs_malloc()-allocated. Non-null only for
- Floyd-Steinberg error diffusion. */
- unsigned int
- octets_per_line, /* Constant while the device is open. */
- output_planes; /* Constant while the device is open. */
- int next_y; /* During a call to eprn_output_page(), the device y
- coordinate for the next scan line to fetch from the "prn" device. For
- eprn_IR_FloydSteinberg, the next scan line to return is actually already
- present in 'next_scan_line' with its device coordinate being "next_y - 1",
- unless 'next_y' is zero in which case we have finished. */
-} eprn_Eprn;
-
-
-/* Macro for device structure type definitions. Note that in contrast to
- gx_prn_device_common this macro does include the inherited attributes. */
-#define gx_eprn_device_common \
- gx_device_common; /* Attributes common to all devices */ \
- gx_prn_device_common; /* Attributes for all printers */ \
- eprn_Eprn eprn
-
-/* Base type needed for casts */
-typedef struct {
- gx_eprn_device_common;
-} eprn_Device;
-
-
-/* Macro for initializing device structure instances (device prototypes)
-
- This macro corresponds to the prn_device*() macros which are used when
- basing a device directly on the prn device.
-
- The parameters are:
- dtype: identifier of the device structure type
- procs: pointer to static device procedure table
- (const gx_device_procs *, not NULL)
- dname: name of the device (const char *, not NULL)
- xdpi: horizontal resolution in ppi (float, positive)
- ydpi: vertical resolution in ppi (float, positive)
- print_page: page printing procedure to be called by
- gdev_prn_output_page(), not NULL
- cap: pointer to printer capability description
- (const eprn_PrinterDescription *, not NULL, the description may
- not change until immediately before the next call to
- eprn_init_device())
- flag_desc description of the non-standard flags the derived device
- accepts (const ms_Flag *, may be NULL, otherwise terminated
- with an entry having 'ms_none' for 'code')
- desired pattern of desired media flags (ms_MediaCode)
- optional NULL or a list of optional media flags (const ms_MediaCode *)
- terminated with an 'ms_none' value
- fmr NULL or pointer to a flag mismatch reporting function
- (eprn_FlagMismatchReporter)
-
- All storage referred to by pointers remains under the control of the
- derived device and should not be modified during the lifetime of the
- device unless explicitly permitted.
-
- This macro assumes that it is dealing with a printer supporting at least
- DeviceGray with 2 intensity levels and the page size described by
- (DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS), usually US Letter or ISO A4.
- This is also the initial state. If a derived device wishes to use another
- initial state, it should define its own macro.
- */
-#define eprn_device_initdata(dtype, procs, dname, xdpi, ydpi, print_page, cap, flag_desc, desired, optional, fmr) \
- prn_device_std_body( \
- dtype, \
- procs, \
- dname, \
- DEFAULT_WIDTH_10THS, \
- DEFAULT_HEIGHT_10THS, \
- xdpi, ydpi, \
- 0.0, 0.0, 0.0, 0.0, /* margins */ \
- 1, /* color_info.depth */ \
- print_page), \
- { \
- cap, /* cap */ \
- NULL, /* media_file */ \
- NULL, /* media_overrides */ \
- flag_desc, /* flag_desc */ \
- desired, /* desired_flags */ \
- optional, /* optional_flags */ \
- fmr, /* fmr */ \
- ms_none, /* code */ \
- 0, /* default_orientation */\
- false, /* leading_edge_set */ \
- 0.0, /* right_shift */ \
- 0.0, /* down_shift */ \
- false, /* keep_margins */ \
- false, /* soft_tumble */ \
- eprn_DeviceGray, /* colour_model */ \
- 2, /* black_levels */ \
- 0, /* non_black_levels */ \
- eprn_IR_halftones, /* intensity_rendering */ \
- NULL, /* pagecount_file */ \
- false, /* CUPS_accounting */ \
- false, /* CUPS_messages */ \
- false, /* media_position_set */\
- 0, /* media_position */ \
- 0, /* bits_per_colorant */ \
- {NULL, 0}, /* scan_line */ \
- {NULL, 0}, /* next_scan_line */ \
- 0, /* octets_per_line */ \
- 0, /* output_planes */ \
- 0 /* next_y */ \
- }
-
-
-/* For the calling conventions of the following functions consult the comments
- preceding each function's implementation. */
-
-/* Initialize the eprn device for another printer model */
-extern void eprn_init_device(eprn_Device *dev,
- const eprn_PrinterDescription *desc);
-
-/* Modify the information on supported media sizes and associated hardware
- margins by reading new values from a file */
-extern int eprn_set_media_data(eprn_Device *dev, const char *media_file,
- size_t length);
-
-/* Set media flags */
-extern void eprn_set_media_flags(eprn_Device *dev, ms_MediaCode desired,
- const ms_MediaCode *optional);
-
-/*****************************************************************************/
-
-/* Device procedures */
-extern dev_proc_open_device(eprn_open_device);
-extern dev_proc_get_initial_matrix(eprn_get_initial_matrix);
-extern dev_proc_output_page(eprn_output_page);
-extern dev_proc_close_device(eprn_close_device);
-extern dev_proc_map_rgb_color(eprn_map_rgb_color_for_RGB);
-extern dev_proc_map_rgb_color(eprn_map_rgb_color_for_RGB_flex);
-extern dev_proc_map_rgb_color(eprn_map_rgb_color_for_RGB_max);
-extern dev_proc_map_rgb_color(eprn_map_rgb_color_for_CMY_or_K);
-extern dev_proc_map_rgb_color(eprn_map_rgb_color_for_CMY_or_K_flex);
-extern dev_proc_map_rgb_color(eprn_map_rgb_color_for_CMY_or_K_max);
-extern dev_proc_map_color_rgb(eprn_map_color_rgb);
-extern dev_proc_get_params(eprn_get_params);
-extern dev_proc_put_params(eprn_put_params);
-extern dev_proc_map_cmyk_color(eprn_map_cmyk_color);
-extern dev_proc_map_cmyk_color(eprn_map_cmyk_color_flex);
-extern dev_proc_map_cmyk_color(eprn_map_cmyk_color_max);
-extern dev_proc_map_cmyk_color(eprn_map_cmyk_color_glob);
-
-
-/* Macro for initializing device procedure tables
-
- This macro corresponds to the macro prn_params_procs() which is used when
- basing a device directly on the prn device.
-
- If your device does not need all of the procedures in the argument list,
- use the following defaults:
- p_open: eprn_open_device
- p_close: eprn_close_device
- p_get_params: eprn_get_params
- p_put_params: eprn_put_params
- On the other hand, if your driver needs its own procedure in any of these
- cases its code must also call the appropriate default routine.
-*/
-#define eprn_procs_initdata(p_open, p_close, p_get_params, p_put_params) \
- p_open, /* open_device */ \
- eprn_get_initial_matrix, /* get_initial_matrix */ \
- NULL, /* sync_output */ \
- eprn_output_page, /* output_page */ \
- p_close, /* close_device */ \
- eprn_map_rgb_color_for_CMY_or_K, /* map_rgb_color */ \
- eprn_map_color_rgb, /* map_color_rgb */ \
- NULL, /* fill_rectangle */ \
- NULL, /* tile_rectangle */ \
- NULL, /* copy_mono */ \
- NULL, /* copy_color */ \
- NULL, /* draw_line */ \
- NULL, /* get_bits */ \
- p_get_params, /* get_params */ \
- p_put_params, /* put_params */ \
- eprn_map_cmyk_color_glob, /* map_cmyk_color */ \
- NULL, /* get_xfont_procs */ \
- NULL, /* get_xfont_device */ \
- NULL, /* map_rgb_alpha_color */ \
- gx_page_device_get_page_device /* get_page_device */
- /* The remaining fields should be NULL. */
-
-/*****************************************************************************/
-
-/* Access to pixels
-
- Of course, you could also use the prn interface to obtain pixel values.
- This, however, requires information on how eprn interprets 'gx_color_index'
- values (see eprnrend.c for a description) and bypasses all processing steps
- (error diffusion and the clipping of null bytes) which happen in
- eprn_get_planes().
-*/
-
-/* Number of bits and hence bit planes used to represent 'levels' intensity
- levels in eprn_get_planes(). The return values are independent of the
- device's state. */
-extern unsigned int eprn_bits_for_levels(unsigned int levels);
-
-/* Total number of bit planes written by eprn_get_planes().
- The value returned is reliable only after the eprn part of the device has
- been successfully opened. The value remains constant while the device is
- open and equals the sum of eprn_bits_for_levels() for all colorants. */
-extern unsigned int eprn_number_of_bitplanes(eprn_Device *dev);
-
-/* Maximal lengths, in terms of the number of 'eprn_Octet' instances, for each
- bit plane returned by eprn_get_planes() for this device.
- These values are reliable after the eprn part of the device has been
- successfully opened and remain constant while the device is open.
- The array 'lengths' must have at least the length returned by
- eprn_number_of_bitplanes(). */
-extern void eprn_number_of_octets(eprn_Device *dev, unsigned int lengths[]);
-
-/* The following function may be called only from the page printing procedure
- (see the macro eprn_device_initdata() above). For every invocation of that
- procedure, the first call of this function returns the scan line with
- device coordinate y = 0, subsequent invocations return the lines with the
- y coordinate incremented by 1 for every call.
-
- This function returns each scan line split into bit planes and stored into
- the areas pointed to by the 'bitplanes' array. The order of colorants is
- (K)(CMY) or RGB, where the parentheses indicate optional groups, depending
- on the colour model. Within each colorant, bit planes are stored from least
- to most significant. The number of bit planes per colorant is given by
- eprn_bits_for_levels(levels) where 'levels' is the number of intensity
- levels for this colorant.
-
- If the bit planes for a particular colorant result in the value zero for a
- certain pixel, this indicates a complete absence of that colorant for this
- pixel. The highest possible value is one less than the number of intensity
- levels for that colorant.
-
- The 'str' entries in the 'bitplanes' array must be non-NULL and point to
- storage areas of a length sufficient to hold the number of octets as
- returned by eprn_number_of_octets(). The 'length' entries will be set such
- that there will be no trailing zero octets in the octet strings returned.
- Bits are stored in an octet from most to least signicant bit (left to
- right). If a bit plane does not fill an integral number of octets the last
- octet will be filled on the right as if there were additional white pixels.
-
- This function returns zero if there was a scan line to be fetched and a
- non-zero value otherwise.
- */
-extern int eprn_get_planes(eprn_Device *dev, eprn_OctetString bitplanes[]);
-
-/*****************************************************************************/
-
-/* Auxiliary types and functions for parameter processing */
-
-/* Type to describe an association between a string and an integer */
-typedef struct {
- const char *name;
- int value;
-} eprn_StringAndInt;
-
-/* Routines on 'eprn_StringAndInt' arrays
- These are used to map names to integers and vice versa. It is possible to
- have several names for the same value. The first name given in the array
- for a particular 'value' is the canonical name for this value, i.e. the one
- returned by the eprn_get_string() routine.
- The arrays must be terminated by entries with a NULL pointer for 'name'.
-*/
-struct gs_param_string_s; /* Forward declaration */
-extern int eprn_get_string(int in_value, const eprn_StringAndInt *table,
- struct gs_param_string_s *out_value);
-extern int eprn_get_int(const struct gs_param_string_s *in_value,
- const eprn_StringAndInt *table, int *out_value);
-
-/*****************************************************************************/
-
-/* CUPS message prefixes */
-#define CUPS_ERRPREF "ERROR: "
-#define CUPS_WARNPREF "WARNING: "
-
-/*****************************************************************************/
-
-/* Selection character for tracing */
-#ifndef EPRN_TRACE_CHAR
-#define EPRN_TRACE_CHAR '_'
-#endif /* !EPRN_TRACE_CHAR */
-
-/* Debugging function */
-struct gs_param_list_s;
-extern void eprn_dump_parameter_list(struct gs_param_list_s *plist);
-
-/* Internal data structures */
-extern const eprn_StringAndInt eprn_colour_model_list[];
-
-/* Internal functions */
-extern int eprn_set_page_layout(eprn_Device *dev);
-extern int eprn_check_colour_info(const eprn_ColourInfo *list,
- eprn_ColourModel *model, float *hres, float *vres,
- unsigned int *black_levels, unsigned int *non_black_levels);
-extern int eprn_fetch_scan_line(eprn_Device *dev, eprn_OctetString *line);
-extern void eprn_finalize(bool is_RGB, unsigned int non_black_levels,
- int planes, eprn_OctetString *plane, eprn_Octet **ptr, int pixels);
-extern void eprn_split_FS(eprn_OctetString *line, eprn_OctetString *next_line,
- int max_octets, eprn_ColourModel colour_model, unsigned int black_levels,
- unsigned int non_black_levels, eprn_OctetString bitplanes[]);
-
-/*****************************************************************************/
-
-#endif /* Inclusion protection */
diff --git a/gs/contrib/pcl3/eprn/mediasize.c b/gs/contrib/pcl3/eprn/mediasize.c
deleted file mode 100644
index fafadae24..000000000
--- a/gs/contrib/pcl3/eprn/mediasize.c
+++ /dev/null
@@ -1,430 +0,0 @@
-/******************************************************************************
- File: $Id: mediasize.c,v 1.11 2001/04/12 18:35:26 Martin Rel $
- Contents: Operations and data for handling media sizes
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany. E-mail: Martin.Lottermoser@t-online.de.
-
-*******************************************************************************
-* *
-* Copyright (C) 1999, 2000 by Martin Lottermoser *
-* All rights reserved *
-* *
-******************************************************************************/
-
-/* Configuration management identification */
-#ifndef lint
-static const char
- cm_id[] = "@(#)$Id: mediasize.c,v 1.11 2001/04/12 18:35:26 Martin Rel $";
-#endif
-
-/*****************************************************************************/
-
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE 500
-#endif
-
-/* Standard headers */
-#include <assert.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* Special headers */
-#include "mediasize.h"
-
-/*****************************************************************************/
-
-/* Number of elements in an array */
-#define array_size(a) (sizeof(a)/sizeof(a[0]))
-
-/* String length of string literals */
-#define STRLEN(s) (sizeof(s) - 1)
-
-/*****************************************************************************/
-
-/* To ensure consistency I generate the size constant and the name from the
- keyword: */
-#define sn(keyword) ms_##keyword, #keyword
-
-/* Size list
-
- This list is ordered such that the size code is the index in the list and
- that entries are sorted by first and second dimension except at the end.
- If you compile without NDEBUG being defined these constraints will be
- checked at runtime before they are needed for the first time.
-
- The information on the sizes is mostly taken from table B.2 in PPD 4.3.
-
- The extensions for the A and ISO B series agree with DIN 476 part 1
- (February 1991) which is the German version of EN 20216:1990 which in turn
- is identical with ISO 216:1975. The C series values agree with DIN 476
- part 2 (February 1991). Some values for the A and C series are not listed
- in PPD 4.3 and are taken from DIN 476.
- */
-static const ms_SizeDescription list[] = {
- {ms_none, "", {0.0, 0.0}}, /* never returned */
- {sn(A10), {26*BP_PER_MM, 37*BP_PER_MM}},
- {sn(EnvC10), {28*BP_PER_MM, 40*BP_PER_MM}}, /* DIN 476 T2: 1991 */
- {sn(ISOB10), {31*BP_PER_MM, 44*BP_PER_MM}},
- {sn(JISB10), {32*BP_PER_MM, 45*BP_PER_MM}},
- {sn(A9), {37*BP_PER_MM, 52*BP_PER_MM}},
- {sn(EnvC9), {40*BP_PER_MM, 57*BP_PER_MM}}, /* DIN 476 T2: 1991 */
- {sn(ISOB9), {44*BP_PER_MM, 62*BP_PER_MM}},
- {sn(JISB9), {45*BP_PER_MM, 64*BP_PER_MM}},
- {sn(A8), {52*BP_PER_MM, 74*BP_PER_MM}},
- {sn(EnvC8), {57*BP_PER_MM, 81*BP_PER_MM}}, /* DIN 476 T2: 1991 */
- {sn(ISOB8), {62*BP_PER_MM, 88*BP_PER_MM}},
- {sn(JISB8), {64*BP_PER_MM, 91*BP_PER_MM}},
- {sn(A7), {74*BP_PER_MM, 105*BP_PER_MM}},
- {sn(Index3x5in), {3*BP_PER_IN, 5*BP_PER_IN}}, /* 76.2 x 127 mm */
- {sn(EnvC7), {81*BP_PER_MM, 114*BP_PER_MM}},
- {sn(ISOB7), {88*BP_PER_MM, 125*BP_PER_MM}},
- {sn(EnvChou4), {90*BP_PER_MM, 205*BP_PER_MM}},
- {sn(JISB7), {91*BP_PER_MM, 128*BP_PER_MM}},
- {sn(EnvMonarch), {3.875*BP_PER_IN, 7.5*BP_PER_IN}}, /* 98.4 x 190.5 mm */
- {sn(Env9), {3.875*BP_PER_IN, 8.875*BP_PER_IN}}, /* 98.4x225.4 mm */
- {sn(Postcard), {100*BP_PER_MM, 148*BP_PER_MM}},
- {sn(Index4x6in), {4.0*BP_PER_IN, 6.0*BP_PER_IN}}, /* 101.6 x 152.4 mm */
- {sn(Env10), {4.125*BP_PER_IN, 9.5*BP_PER_IN}}, /* 104.8 x 241.3 mm*/
- {sn(A6), {105*BP_PER_MM, 148*BP_PER_MM}},
- {sn(EnvDL), {110*BP_PER_MM, 220*BP_PER_MM}},
- {sn(EnvUS_A2), {4.375*BP_PER_IN, 5.75*BP_PER_IN}}, /* 111.1x146.1 mm */
- {sn(EnvC6), {114*BP_PER_MM, 162*BP_PER_MM}},
- {sn(EnvChou3), {120*BP_PER_MM, 235*BP_PER_MM}},
- {sn(ISOB6), {125*BP_PER_MM, 176*BP_PER_MM}},
- {sn(Index5x8in), {5.0*BP_PER_IN, 8.0*BP_PER_IN}}, /* 127 x 203.2 mm */
- {sn(JISB6), {128*BP_PER_MM, 182*BP_PER_MM}},
- {sn(Statement), {5.5*BP_PER_IN, 8.5*BP_PER_IN}}, /* 139.7 x 215.9 mm */
- {sn(DoublePostcard), {148*BP_PER_MM, 200*BP_PER_MM}},
- {sn(A5), {148*BP_PER_MM, 210*BP_PER_MM}},
- {sn(EnvC5), {162*BP_PER_MM, 229*BP_PER_MM}},
- {sn(ISOB5), {176*BP_PER_MM, 250*BP_PER_MM}},
- {sn(JISB5), {182*BP_PER_MM, 257*BP_PER_MM}},
- {sn(Executive), {7.25*BP_PER_IN, 10.5*BP_PER_IN}}, /* 184.2 x 266.7 mm*/
- /* Media called by this name may vary up to 0.5" in dimension (PPD 4.3). */
- {sn(A4), {210*BP_PER_MM, 297*BP_PER_MM}},
- {sn(Folio), {210*BP_PER_MM, 330*BP_PER_MM}},
- {sn(Quarto), {8.5*BP_PER_IN, 10.83*BP_PER_IN}}, /* 215.9 x 275.1 mm
- PPD 4.3 uses bp values for the definition, but this does not agree
- with the mm values it specifies. The inch specifications fit. */
- {sn(Letter), {8.5*BP_PER_IN, 11.0*BP_PER_IN}}, /* 215.9 x 279.4 mm */
- {sn(Legal), {8.5*BP_PER_IN, 14.0*BP_PER_IN}}, /* 215.9 x 355.6 mm */
- {sn(EnvKaku3), {216*BP_PER_MM, 277*BP_PER_MM}},
- {sn(SuperA), {227*BP_PER_MM, 356*BP_PER_MM}},
- {sn(ARCHA), {9*BP_PER_IN, 12*BP_PER_IN}}, /* 228.6 x 304.8 mm */
- {sn(EnvC4), {229*BP_PER_MM, 324*BP_PER_MM}},
- {sn(EnvKaku2), {240*BP_PER_MM, 332*BP_PER_MM}},
- {sn(ISOB4), {250*BP_PER_MM, 353*BP_PER_MM}},
- {sn(JISB4), {257*BP_PER_MM, 364*BP_PER_MM}},
- {sn(Tabloid), {11*BP_PER_IN, 17*BP_PER_IN}}, /* 279.4 x 431.8 mm */
- {sn(A3), {297*BP_PER_MM, 420*BP_PER_MM}},
- {sn(ARCHB), {12*BP_PER_IN, 18*BP_PER_IN}}, /* 304.8 x 457.2 mm */
- {sn(SuperB), {305*BP_PER_MM, 487*BP_PER_MM}},
- {sn(EnvC3), {324*BP_PER_MM, 458*BP_PER_MM}},
- {sn(HPSuperB), {13*BP_PER_IN, 19*BP_PER_IN}}, /* 330.2 x 482.6 mm */
- {sn(ISOB3), {353*BP_PER_MM, 500*BP_PER_MM}},
- {sn(JISB3), {364*BP_PER_MM, 515*BP_PER_MM}},
- {sn(A2), {420*BP_PER_MM, 594*BP_PER_MM}},
- {sn(ARCHC), {18*BP_PER_IN, 24*BP_PER_IN}}, /* 457.2 x 609.6 mm */
- {sn(EnvC2), {458*BP_PER_MM, 648*BP_PER_MM}},
- {sn(ISOB2), {500*BP_PER_MM, 707*BP_PER_MM}},
- {sn(JISB2), {515*BP_PER_MM, 728*BP_PER_MM}},
- {sn(A1), {594*BP_PER_MM, 841*BP_PER_MM}},
- {sn(ARCHD), {24*BP_PER_IN, 36*BP_PER_IN}}, /* 609.6 x 914.4 mm */
- {sn(EnvC1), {648*BP_PER_MM, 917*BP_PER_MM}},
- {sn(ISOB1), {707*BP_PER_MM, 1000*BP_PER_MM}},
- {sn(JISB1), {728*BP_PER_MM, 1030*BP_PER_MM}},
- {sn(A0), {841*BP_PER_MM, 1189*BP_PER_MM}},
- {sn(ARCHE), {36*BP_PER_IN, 48*BP_PER_IN}}, /* 914.4 x 1219.2 mm */
- {sn(EnvC0), {917*BP_PER_MM, 1297*BP_PER_MM}},
- {sn(ISOB0), {1000*BP_PER_MM, 1414*BP_PER_MM}},
- {sn(JISB0), {1030*BP_PER_MM, 1456*BP_PER_MM}},
- {sn(2A0), {1189*BP_PER_MM, 1682*BP_PER_MM}}, /* DIN 476 T1:1991 */
- {sn(4A0), {1682*BP_PER_MM, 2378*BP_PER_MM}}, /* DIN 476 T1:1991 */
- /* End of discrete sizes */
- {sn(CustomPageSize), {0.0, 0.0}},
- {sn(MaxPage), {0.0, 0.0}}
-};
-
-#undef sn
-
-/* Constant which is at least 1 longer than the longest known name */
-#define LONGER_THAN_NAMES 15
-
-/*****************************************************************************/
-
-#ifndef NDEBUG
-static char checked = 0;
-
-/* Function to check constraints on table entries */
-static void check(void)
-{
- int j;
-
- /* ms_none */
- assert(list[0].size == 0);
-
- for (j = 1; j < array_size(list); j++) {
- assert(list[j].size == j);
- assert(list[j].dimen[0] <= list[j].dimen[1]);
- assert(strlen(list[j].name) < LONGER_THAN_NAMES);
- assert(list[j].dimen[0] == 0.0 || list[j-1].dimen[0] < list[j].dimen[0] ||
- list[j-1].dimen[0] == list[j].dimen[0] &&
- list[j-1].dimen[1] <= list[j].dimen[1]);
- }
-
- /* Check that the highest accepted value does not collide with the flags */
- assert((ms_MaxPage & MS_FLAG_MASK) == 0);
-
- checked = 1;
-
- return;
-}
-
-#endif /* !NDEBUG */
-
-/*****************************************************************************/
-
-const ms_SizeDescription *ms_find_size_from_code(ms_MediaCode code)
-{
-#ifndef NDEBUG
- if (!checked) check();
-#endif /* !NDEBUG */
- code = ms_without_flags(code);
- if (code < 1 || array_size(list) <= code) return NULL;
-
- return list + code;
-}
-
-/*****************************************************************************/
-
-/* Function to compare two pointers to 'ms_SizeDescription *' by the 'name'
- fields pointed to. */
-
-static int cmp_by_name(const void *a, const void *b)
-{
- return strcmp((*(const ms_SizeDescription *const *)a)->name,
- (*(const ms_SizeDescription *const *)b)->name);
-}
-
-/******************************************************************************
-
- Function: find_flag
-
- This function searches for a number of flags at the end of 'name' which is
- taken to be a string of length '*length'. If a matching entry is found,
- '*length' is decreased by the length of the string matched and the flag value
- is returned. On failure, the return value is zero and '*length' is not
- modified.
-
-******************************************************************************/
-
-static ms_MediaCode find_flag(const char *name, size_t *length,
- const ms_Flag *flag_list)
-{
- int j = 0;
- size_t L;
-
- while (flag_list[j].code != 0 &&
- ((L = strlen(flag_list[j].name)) >= *length ||
- strncmp(name + *length - L, flag_list[j].name, L) != 0)) j++;
- if (flag_list[j].code == 0) return 0;
-
- *length -= L;
-
- return flag_list[j].code;
-}
-
-/*****************************************************************************/
-
-/* Table of standard substrings, sorted in the order preferred for name
- generation */
-static const ms_Flag substrings[] = {
- {MS_BIG_FLAG, MS_BIG_STRING},
- {MS_SMALL_FLAG, MS_SMALL_STRING},
- {MS_ROTATED_FLAG, MS_ROTATED_STRING},
- {MS_EXTRA_FLAG, MS_EXTRA_STRING},
- {0, NULL}
-};
-
-/*****************************************************************************/
-
-ms_MediaCode ms_find_code_from_name(const char *name,
- const ms_Flag *user_flag_list)
-{
- const char *end;
- char stripped_name[LONGER_THAN_NAMES];
- static const ms_SizeDescription *sorted_list[array_size(list) - 1];
- static unsigned int entries = 0;
- ms_SizeDescription
- keydata,
- *key = &keydata;
- const ms_SizeDescription **found;
- ms_MediaCode flags = 0;
- size_t l;
-
- /* On the first use of this function, compile a table of pointers into the
- list which is sorted by the names of the sizes. */
- if (entries == 0) {
- while (entries < array_size(sorted_list)) {
- sorted_list[entries] = list + entries + 1; /* ignore 'ms_none' */
- entries++;
- }
- qsort(sorted_list, array_size(sorted_list), sizeof(ms_SizeDescription *),
- &cmp_by_name);
- }
-
- /* Prevent idiots (like myself) from crashing the routine */
- if (name == NULL) return ms_none;
-
- /* Identify trailing qualifiers */
- end = strchr(name, '.'); /* before first qualifier */
- if (end == NULL) end = strchr(name, '\0');
- else {
- const char *s = end, *t;
- do {
- ms_MediaCode flag;
-
- s++;
- if ((t = strchr(s, '.')) == NULL) t = strchr(s, '\0');
- l = t - s;
-#define set_if(keyword) \
- if (l == STRLEN(MS_##keyword##_STRING) && \
- strncmp(s, MS_##keyword##_STRING, l) == 0) flag = MS_##keyword##_FLAG
- set_if(TRANSVERSE);
- else set_if(BIG);
- else set_if(SMALL);
- else set_if(EXTRA);
- else return ms_none;
-#undef set_if
- if ((flag & flags) != 0) return ms_none; /* no duplicates */
- flags |= flag;
- s = t;
- } while (*t != '\0');
- }
-
- /* Now search for recognizable substrings */
- l = end - name; /* length of uninterpreted part of the name */
- while (1) {
- ms_MediaCode flag;
-
- if ((flag = find_flag(name, &l, substrings)) == 0 &&
- (user_flag_list == NULL ||
- (flag = find_flag(name, &l, user_flag_list)) == 0))
- break; /* loop exit */
-
- if ((flag & flags) != 0) return ms_none; /* no duplicates */
- flags |= flag;
- }
- end = name + l;
-
- if ((flags & MS_BIG_FLAG) != 0 && (flags & MS_SMALL_FLAG) != 0)
- return ms_none;
-
- /* Prepare key for looking up the size part of the name */
- l = end - name;
- if (l >= LONGER_THAN_NAMES) return ms_none;
- strncpy(stripped_name, name, l);
- stripped_name[l] = '\0';
- keydata.name = stripped_name;
-
- /* Search */
- found = (const ms_SizeDescription **)bsearch(&key, sorted_list, entries,
- sizeof(ms_SizeDescription *), &cmp_by_name);
-
- return found == NULL? ms_none: ((*found)->size | flags);
-}
-
-/******************************************************************************
-
- Function: add_substrings
-
- This function appends names for the flags in '*code' to 'buffer', identifying
- flags by means of 'flag_list' which must be terminated with an entry having
- 'code' == 0.
-
- 'buffer' must point to a NUL-terminated string, '*length' must be the number
- of characters which this routine may write after the NUL.
-
- The function will return zero on success and a non-zero value of error.
- All flags matched will be removed from '*code' and '*length' will be updated
- to reflect the number of characters still available.
-
-******************************************************************************/
-
-static int add_substrings(char *buffer, size_t *length, ms_MediaCode *code,
- const ms_Flag *flag_list)
-{
- int j;
- size_t l;
-
- j = 0;
- buffer = strchr(buffer, '\0');
- while (flag_list[j].code != 0) {
- if (flag_list[j].code & *code) {
- l = strlen(flag_list[j].name);
- if (*length < l) {
- errno = ERANGE;
- return -1;
- }
- *code &= ~flag_list[j].code;
- strcpy(buffer, flag_list[j].name);
- buffer += l;
- *length -= l;
- }
- j++;
- }
-
- return 0;
-}
-
-/*****************************************************************************/
-
-extern int ms_find_name_from_code(char *buffer, size_t length,
- ms_MediaCode code, const ms_Flag *user_flag_list)
-{
- const ms_SizeDescription *desc = ms_find_size_from_code(code);
- size_t l;
-
- if (buffer == NULL || length == 0) {
- errno = EINVAL;
- return -1;
- }
-
- /* Size name */
- if (desc == NULL) {
- errno = EDOM;
- return -1;
- }
- l = strlen(desc->name);
- if (length <= l) {
- errno = ERANGE;
- return -1;
- }
- strcpy(buffer, desc->name);
- length -= l + 1;
- code = ms_flags(code);
-
- /* Substrings */
- if (user_flag_list != NULL &&
- add_substrings(buffer, &length, &code, user_flag_list) != 0 ||
- add_substrings(buffer, &length, &code, substrings) != 0) return -1;
-
- /* Transverse qualifier */
- if (code & MS_TRANSVERSE_FLAG) {
- if (length < 1 + STRLEN(MS_TRANSVERSE_STRING)) {
- errno = ERANGE;
- return -1;
- }
- strcat(buffer, "." MS_TRANSVERSE_STRING);
- code &= ~MS_TRANSVERSE_FLAG;
- }
-
- /* Check for unrecognized flags */
- if (code != 0) {
- errno = EDOM;
- return -1;
- }
-
- return 0;
-}
diff --git a/gs/contrib/pcl3/eprn/mediasize.h b/gs/contrib/pcl3/eprn/mediasize.h
deleted file mode 100644
index 75fe0badd..000000000
--- a/gs/contrib/pcl3/eprn/mediasize.h
+++ /dev/null
@@ -1,290 +0,0 @@
-/******************************************************************************
- File: $Id: mediasize.h,v 1.11 2001/04/12 18:35:26 Martin Rel $
- Contents: Header file for working with various media sizes
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany. E-mail: Martin.Lottermoser@t-online.de.
-
-*******************************************************************************
-* *
-* Copyright (C) 1999, 2000 by Martin Lottermoser *
-* All rights reserved *
-* *
-******************************************************************************/
-
-#ifndef _mediasize_h /* Inclusion protection */
-#define _mediasize_h
-
-/* Configuration management identification */
-#pragma ident "@(#)$Id: mediasize.h,v 1.11 2001/04/12 18:35:26 Martin Rel $"
-
-/*****************************************************************************/
-
-/* Macros for conversion between units.
- All these macros resolve to floating point numbers. */
-
-/* Millimetres per inch */
-#define MM_PER_IN 25.4
-
-/* Big points (units in PostScript's default user space) per inch */
-#define BP_PER_IN 72.0
-
-/* Big points per millimetre */
-#define BP_PER_MM (BP_PER_IN/MM_PER_IN)
-
-/******************************************************************************
-
- Sizes
- =====
-
- The constants of type 'ms_Size' each represent a rectangular area ("sheet")
- completely characterized by the lengths of its two edges. The orientation
- of the sheet is unspecified but note that the 'ms_SizeDescription' entries
- are guaranteed to return information such that dimen[0] <= dimen[1].
-
- The names of the size constants are mostly identical to the values for the
- "mediaOption" keywords in PPD files, prefixed with "ms_". The keywords are
- documented in Appendix B, "Registered mediaOption Keywords", of:
-
- Adobe Systems Incorporated
- "PostScript Printer Description File Format Specification"
- Version 4.3
- 9 February 1996
- Document ID: PN LPS5003
-
- It can be obtained from http://www.adobe.com.
-
- The following list does not contain all sizes from PPD 4.3, but all
- internationally standardized sizes are present.
-*/
-
-typedef enum {
- ms_none, /* no size; useful as a sentinel or default value */
- ms_A10,
- ms_EnvC10, /* Not a mediaOption keyword. */
- ms_ISOB10,
- ms_JISB10, /* PPD 4.3 calls this "B10" */
- ms_A9,
- ms_EnvC9, /* Not a mediaOption keyword. */
- ms_ISOB9,
- ms_JISB9, /* PPD 4.3 calls this "B9" */
- ms_A8,
- ms_EnvC8, /* Not a mediaOption keyword. */
- ms_ISOB8,
- ms_JISB8, /* PPD 4.3 calls this "B8" */
- ms_A7,
- ms_Index3x5in, /* US index card 3 x 5 in. Not a mediaOption keyword. */
- ms_EnvC7,
- ms_ISOB7,
- ms_EnvChou4, /* Japanese */
- ms_JISB7, /* PPD 4.3 calls this "B7" */
- ms_EnvMonarch, /* US */
- ms_Env9, /* US */
- ms_Postcard, /* Japanese Hagaki postcard */
- ms_Index4x6in, /* US index card 4 x 6 in. Not a mediaOption keyword. */
- ms_Env10, /* US */
- ms_A6,
- ms_EnvDL,
- ms_EnvUS_A2, /* US A2 envelope. Not a mediaOption keyword. */
- ms_EnvC6,
- ms_EnvChou3, /* Japanese */
- ms_ISOB6,
- ms_Index5x8in, /* US index card 5 x 8 in. Not a mediaOption keyword. */
- ms_JISB6, /* PPD 4.3 calls this "B6" */
- ms_Statement, /* US */
- ms_DoublePostcard, /* double Japanese postcard */
- ms_A5,
- ms_EnvC5,
- ms_ISOB5,
- ms_JISB5, /* PPD 4.3 calls this "B5" */
- ms_Executive, /* US */
- ms_A4,
- ms_Folio, /* US */
- ms_Quarto, /* US */
- ms_Letter, /* US */
- ms_Legal, /* US */
- ms_EnvKaku3, /* Japanese? */
- ms_SuperA,
- ms_ARCHA, /* US */
- ms_EnvC4,
- ms_EnvKaku2, /* Japanese? */
- ms_ISOB4,
- ms_JISB4, /* PPD 4.3 calls this "B4" */
- ms_Tabloid, /* US */
- ms_A3,
- ms_ARCHB, /* US */
- ms_SuperB,
- ms_EnvC3,
- ms_HPSuperB, /* what Hewlett-Packard calls "SuperB" (13x19 in).
- Not a mediaOption keyword. */
- ms_ISOB3,
- ms_JISB3, /* PPD 4.3 calls this "B3" */
- ms_A2,
- ms_ARCHC, /* US */
- ms_EnvC2,
- ms_ISOB2,
- ms_JISB2, /* PPD 4.3 calls this "B2" */
- ms_A1,
- ms_ARCHD, /* US */
- ms_EnvC1,
- ms_ISOB1,
- ms_JISB1, /* PPD 4.3 calls this "B1" */
- ms_A0,
- ms_ARCHE, /* US */
- ms_EnvC0,
- ms_ISOB0,
- ms_JISB0, /* PPD 4.3 calls this "B0" */
- ms_2A0, /* Not a mediaOption keyword. */
- ms_4A0, /* Not a mediaOption keyword. */
- /* End of discrete sizes */
- ms_CustomPageSize, /* no particular size. Not a mediaOption keyword. */
- ms_MaxPage /* largest available size on a particular device */
-} ms_Size;
-
-
-typedef struct {
- ms_Size size;
- const char *name;
- /* Names are identical to the name for the size constant after stripping the
- "ms_" prefix, hence the map from size names to size codes (except
- 'ms_none') is bijective. There is no description for 'ms_none'. */
- float dimen[2];
- /* Given in bp and with 'dimen[0]' <= 'dimen[1]'. Both values are zero for
- unspecified sizes like 'ms_CustomPageSize' and both are positive
- otherwise.
- */
-} ms_SizeDescription;
-
-/******************************************************************************
-
- Media codes
- ===========
-
- PPD 4.3 describes several standard qualifiers ("." followed by a string) and
- substrings for mediaOption keywords. The type 'ms_MediaCode' is
- intended for representing a combination of 'ms_Size' with a set of flags
- holding additional information of this kind.
-
- The additional information, as standardized by Adobe and as far as it is
- supported here, consists of information concerning external conditions
- ("Extra" and "Transverse") and information relating to the way the medium is
- used ("Big"/"Small" and "Rotated"). I've also added two flags which the using
- application can endow with any meaning it needs.
-
- Use bitwise OR with the flag values to construct an 'ms_MediaCode' instance
- from an 'ms_Size' instance.
- Use ms_flags() and ms_without_flags() to split a value of type 'ms_MediaCode'
- into its components.
-*/
-
-typedef unsigned int ms_MediaCode;
-
-/* Extraction of components */
-#define MS_FLAG_MASK 0xFF00U
-#define ms_flags(s) ((s) & MS_FLAG_MASK)
-#define ms_without_flags(s) ((ms_Size)((s) & ~MS_FLAG_MASK))
-
-/* The "Small" substring or qualifier describes a sheet of the same size as
- without this modification but with a smaller imageable area (larger
- hardware margins). */
-#define MS_SMALL_STRING "Small"
-#define MS_SMALL_FLAG 0x0400U
-
-/* The "Big" substring or qualifier describes a sheet of the same size as
- without this modification but with a larger imageable area (smaller
- hardware margins).
- This is not an Adobe-defined string, but note that there are sizes
- "PRC32K" and "PRC32KBig" with identical dimensions in PPD 4.3. */
-#define MS_BIG_STRING "Big"
-#define MS_BIG_FLAG 0x0800U
-
-/* The "Rotated" substring is used to distinguish between a sheet's two
- different orientations with respect to the page contents. */
-#define MS_ROTATED_STRING "Rotated"
-#define MS_ROTATED_FLAG 0x1000U
-
-/* The "Extra" substring or qualifier identifies a sheet which is actually a
- bit larger than specified by the size code (in PPD 4.3 usually 1 inch in
- each dimension). */
-#define MS_EXTRA_STRING "Extra"
-#define MS_EXTRA_FLAG 0x2000U
-
-/* The "Transverse" qualifier is used to distinguish between a sheet's two
- different orientations with respect to an external reference system, for
- example the feeding direction. */
-#define MS_TRANSVERSE_STRING "Transverse"
-#define MS_TRANSVERSE_FLAG 0x4000U
-
-/* Flags with user-definable interpretation */
-#define MS_USER_FLAG_1 0x0200U
-#define MS_USER_FLAG_2 0x0100U
-
-/* Type for lists of flags and their names */
-typedef struct {
- ms_MediaCode code;
- const char *name;
-} ms_Flag;
-
-/*****************************************************************************/
-
-/* Find the size description for a media code. The flags in 'code' are
- ignored. If the code is unknown, a NULL pointer will be returned.
- */
-extern const ms_SizeDescription *ms_find_size_from_code(ms_MediaCode code);
-
-/*===========================================================================*/
-
-/* Generate a media code for a name
-
- Acceptable names are all size names and all size names extended with any
- combination of the known substrings and qualifiers. The rules for forming a
- name recognized by this function are:
- - The order is: base name, substrings, qualifiers.
- - No string may appear twice.
- - At most one of "Big" and "Small" may be present.
- Note that "Transverse" is only permitted as a qualifier and "Rotated" may
- only appear as a substring. PPD 4.3 seems to prefer substrings to
- qualifiers where possible.
-
- The pointer 'user_flag_list', if non-NULL, must refer to a sequence of
- entries associating user flags with names. The list is terminated by the
- first entry having a zero 'code'. The names in this list will be recognized
- as substrings in addition to the standard names. The list will be searched
- linearly for a matching entry.
-
- The function returns 'ms_none' if it cannot convert the name.
-
- The function has the following restrictions:
- - The flags returned do not distinguish between appearance as a substring
- and appearance as a qualifier or consider the order of appearance.
- - There is no support for serialization qualifiers.
-*/
-extern ms_MediaCode ms_find_code_from_name(const char *name,
- const ms_Flag *user_flag_list);
-
-/*===========================================================================*/
-
-/* Construct a name for a media code
-
- The pointer 'buffer' must be non-NULL and point to a storage area of at
- least 'length' octets. The function will convert 'code' into a string
- representation and write it to 'buffer', terminating it with NUL. The list
- 'user_flag_list', if non-NULL, is taken into account for the conversion of
- user flags in 'code'. It is searched linearly until the first entry with a
- zero 'code'. If an appropriate entry is found it is added as a substring
- before all standard substrings.
-
- The function returns zero on success and a non-zero value otherwise.
- In the latter case, 'errno' will have been set to one of the following
- values:
- - EDOM: 'code' contains an unkown size or an unknown flag. The last case
- includes the situation where a user flag is found in 'code' and
- 'user_flag_list' is NULL or does not contain a matching entry.
- - EINVAL: 'buffer' is NULL or 'length' is zero.
- - ERANGE: 'length' is insufficient to store the resulting string.
- */
-extern int ms_find_name_from_code(char *buffer, size_t length,
- ms_MediaCode code, const ms_Flag *user_flag_list);
-
-/*****************************************************************************/
-
-#endif /* Inclusion protection */
diff --git a/gs/contrib/pcl3/eprn/pagecount.c b/gs/contrib/pcl3/eprn/pagecount.c
deleted file mode 100644
index 18e52ac8f..000000000
--- a/gs/contrib/pcl3/eprn/pagecount.c
+++ /dev/null
@@ -1,293 +0,0 @@
-/******************************************************************************
- File: $Id: pagecount.c,v 1.6 2000/10/07 17:48:49 Martin Rel $
- Contents: Simple (page) count file facility on UNIX
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany. E-mail: Martin.Lottermoser@t-online.de.
-
-*******************************************************************************
-* *
-* Copyright (C) 1997, 1998, 2000 by Martin Lottermoser *
-* All rights reserved *
-* *
-******************************************************************************/
-
-/* Configuration management identification */
-#ifndef lint
-static const char
- cm_id[] = "@(#)$Id: pagecount.c,v 1.6 2000/10/07 17:48:49 Martin Rel $";
-#endif
-
-/*****************************************************************************/
-
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE 500
-#endif
-
-/* Standard headers */
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-/* Specific headers */
-#include "pagecount.h"
-
-/*****************************************************************************/
-
-#define ERRPREFIX "?-E Pagecount module: "
-#define WARNPREFIX "?-W Pagecount module: "
-
-/******************************************************************************
-
- Function: lock_file
-
- This function locks the specified file 'f' with a lock of type 'lock_type'.
- 'filename' is merely used for error messages.
-
- The function returns zero on success and issues error messages on stderr
- if it fails.
-
-******************************************************************************/
-
-static int lock_file(const char *filename, FILE *f, int lock_type)
-{
- int
- fd,
- rc,
- tries;
- struct flock cmd;
-
- /* Obtain file descriptor */
- fd = fileno(f);
- if (fd == -1) {
- fprintf(stderr, ERRPREFIX "Cannot obtain file descriptor (%s).\n",
- strerror(errno));
- fclose(f);
- return -1;
- }
-
- /* Lock the file */
- cmd.l_type = lock_type;
- cmd.l_whence = SEEK_SET; /* 'start' is interpreted from start of file */
- cmd.l_start = 0;
- cmd.l_len = 0; /* until EOF */
- tries = 1;
- while ((rc = fcntl(fd, F_SETLK, &cmd)) != 0 && tries < 3) {
- tries++;
- sleep(1);
- }
- if (rc != 0) {
- fprintf(stderr, ERRPREFIX
- "Cannot obtain lock on page count file `%s' after %d attempts.\n",
- filename, tries);
- return -1;
- }
-
- return 0;
-}
-
-/******************************************************************************
-
- Function: read_count
-
- This function reads the contents of the open page count file.
-
-******************************************************************************/
-
-static int read_count(const char *filename, FILE *f, unsigned long *count)
-{
- if (fscanf(f, "%lu\n", count) != 1) {
- if (feof(f) && !ferror(f)) *count = 0; /* Empty file */
- else {
- fprintf(stderr, ERRPREFIX "Strange contents in page count file `%s'.\n",
- filename);
- return -1;
- }
- }
-
- return 0;
-}
-
-/******************************************************************************
-
- Function: pcf_getcount
-
- This routine reads the page count file 'filename' and returns the count read
- in '*count'. If the file does not exist, the value 0 is assumed.
-
- The function returns zero on success. On error, a message will have been
- issued on stderr.
-
-******************************************************************************/
-
-int pcf_getcount(const char *filename, unsigned long *count)
-{
- FILE *f;
-
- /* Should we use a page count file? */
- if (filename == NULL || *filename == '\0') return 0;
-
- /* If the file does not exist, the page count is taken to be zero. */
- if (access(filename, F_OK) != 0) {
- *count = 0;
- return 0;
- }
-
- /* Open the file */
- if ((f = fopen(filename, "r")) == NULL) {
- fprintf(stderr, ERRPREFIX "Cannot open page count file `%s': %s.\n",
- filename, strerror(errno));
- return -1;
- }
-
- /* Lock the file for reading (shared lock) */
- if (lock_file(filename, f, F_RDLCK) != 0) {
- fclose(f);
- return 1;
- }
-
- /* Read the contents */
- if (read_count(filename, f, count) != 0) {
- fclose(f);
- return -1;
- }
-
- /* Close the file, releasing the lock */
- fclose(f);
-
- return 0;
-}
-
-/******************************************************************************
-
- Function: pcf_inccount
-
- This function opens the page count file 'filename' and increases the number
- stored there by 'by'. If the file does not exist it will be created and
- treated as if had contained 0.
-
- The function returns zero on success and issues error messages on stderr if
- it fails.
-
-******************************************************************************/
-
-int pcf_inccount(const char *filename, unsigned long by)
-{
- FILE *f;
- int rc;
- unsigned long count;
-
- /* Should we use a page count file? */
- if (filename == NULL || *filename == '\0') return 0;
-
- /* Open the file. We need to access the old contents: this excludes the "w",
- "a" and "w+" modes. The operation should create the file if it doesn't
- exist: this excludes the "r" and "r+" modes. Hence the only choice is "a+".
- Note that this procedure makes it unavoidable to accept an empty file as
- being valid. This is, however, anyway necessary because of the fopen() and
- fcntl() calls being not in one transaction.
- */
- if ((f = fopen(filename, "a+")) == NULL) {
- fprintf(stderr, ERRPREFIX "Cannot open page count file `%s': %s.\n",
- filename, strerror(errno));
- return 1;
- }
-
- /* Lock the file for writing (exclusively) */
- if (lock_file(filename, f, F_WRLCK) != 0) {
- fclose(f);
- return 1;
- }
-
- /* Reposition on the beginning. fopen() with "a" as above opens the file at
- EOF. */
- if (fseek(f, 0L, SEEK_SET) != 0) {
- fprintf(stderr, ERRPREFIX "fseek() failed on `%s': %s.\n",
- filename, strerror(errno));
- fclose(f);
- return 1;
- }
-
- /* Read the contents */
- if (read_count(filename, f, &count) != 0) {
- fclose(f);
- return -1;
- }
-
- /* Rewrite the file */
- rc = 0;
- {
- FILE *f1 = fopen(filename, "w");
-
- if (f1 == NULL) {
- fprintf(stderr, ERRPREFIX
- "Error opening page count file `%s' a second time: %s.\n",
- filename, strerror(errno));
- rc = 1;
- }
- else {
- if (fprintf(f1, "%lu\n", count + by) < 0) {
- fprintf(stderr, ERRPREFIX "Error writing to `%s': %s.\n",
- filename, strerror(errno));
- rc = -1;
- }
- if (fclose(f1) != 0) {
- fprintf(stderr,
- ERRPREFIX "Error closing `%s' after writing: %s.\n",
- filename, strerror(errno));
- rc = -1;
- }
- }
- }
-
- /* Close the file (this releases the lock) */
- if (fclose(f) != 0)
- fprintf(stderr, WARNPREFIX "Error closing `%s': %s.\n",
- filename, strerror(errno));
-
- return rc;
-}
-
-#ifdef TEST
-/******************************************************************************
-
- Function: main
-
- This routine can be used for testing.
-
-******************************************************************************/
-
-int main(int argc, char **argv)
-{
- const char *filename = "pages.count";
- int rc;
- unsigned long
- by = 1,
- count = 0;
-
- if (argc > 1) {
- if (sscanf(argv[1], "%lu", &by) != 1) {
- fprintf(stderr, ERRPREFIX "Illegal number: `%s'.\n", argv[1]);
- exit(EXIT_FAILURE);
- }
- if (argc > 2) filename = argv[2];
- if (argc > 3) {
- fprintf(stderr, ERRPREFIX "Too many arguments.\n");
- exit(EXIT_FAILURE);
- }
- }
-
- rc = pcf_getcount(filename, &count);
- if (rc == 0)
- printf("Initial count returned by pcf_getcount(): %lu.\n", count);
- else fprintf(stderr, "? Error from pcf_getcount(), return code is %d.\n", rc);
-
- rc = pcf_inccount(filename, by);
-
- exit(rc == 0? EXIT_SUCCESS: EXIT_FAILURE);
-}
-
-#endif /* TEST */
diff --git a/gs/contrib/pcl3/eprn/pagecount.h b/gs/contrib/pcl3/eprn/pagecount.h
deleted file mode 100644
index ed7c3c979..000000000
--- a/gs/contrib/pcl3/eprn/pagecount.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/******************************************************************************
- File: $Id: pagecount.h,v 1.3 2000/11/19 07:05:17 Martin Rel $
- Contents: Header for pagecount file functions
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany; e-mail: Martin.Lottermoser@t-online.de.
-
-*******************************************************************************
-* *
-* Copyright (C) 2000 by Martin Lottermoser *
-* All rights reserved *
-* *
-******************************************************************************/
-
-#ifndef _pagecount_h /* Inclusion protection */
-#define _pagecount_h
-
-/* Configuration management identification */
-#pragma ident "@(#)$Id: pagecount.h,v 1.3 2000/11/19 07:05:17 Martin Rel $"
-
-/*****************************************************************************/
-
-/* The following two functions are used to read and write a "page count file".
- Such a file should contain a single line with a non-negative decimal
- integer. pcf_getcount() reads the file and returns the value,
- pcf_inccount() increases the number in the file by the specified amount.
- A non-existent file is treated as a file containing the number zero.
-
- The routines are safe against concurrent access.
-*/
-extern int pcf_getcount(const char *filename, unsigned long *count);
-extern int pcf_inccount(const char *filename, unsigned long by);
-
-/*****************************************************************************/
-
-#endif /* Inclusion protection */
diff --git a/gs/contrib/pcl3/lib/cups-pcl3 b/gs/contrib/pcl3/lib/cups-pcl3
deleted file mode 100755
index fb5861d6a..000000000
--- a/gs/contrib/pcl3/lib/cups-pcl3
+++ /dev/null
@@ -1,303 +0,0 @@
-#!/bin/sh
-#******************************************************************************
-# File: @(#)$Id: cups-pcl3,v 2.5 2001/05/18 14:58:24 Martin Rel $
-# Contents: CUPS filter converting application/vnd.cups-postscript to PCL-3
-# using ghostscript with the pcl3 driver
-# Call: cups-pcl3 <CUPS filter arguments>
-# Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-# Germany; Martin.Lottermoser@t-online.de
-#
-#******************************************************************************
-# *
-# Copyright (C) 2001 by Martin Lottermoser *
-# All rights reserved *
-# *
-#******************************************************************************
-#
-# Required entries in PPD files
-# -----------------------------
-# The PPD files distributed with pcl3 are by default already configured for
-# this filter. If you are using one of these files, continue reading with the
-# next section.
-#
-# If you want to use another PPD file or ghostscript driver, add or modify the
-# following two statements in the PPD file:
-#
-# *cupsFilter: "application/vnd.cups-postscript 0 cups-pcl3"
-# *GhostscriptOptions: "<gs options>"
-#
-# Replace <gs options> with a sequence of command line options for ghostscript
-# which select the device, in the case of pcl3 also the subdevice if the device
-# is "pcl3". From the point of view of the PPD specification, the
-# *GhostscriptOptions statement may contain only a single-line QuotedValue
-# without hexadecimal substrings. From the point of view of this filter, the
-# value should not contain any characters with special meaning for the shell,
-# except internal field separators.
-#
-#
-# Installation of this filter
-# ---------------------------
-# Copy this file to the .../cups/filter directory.
-#
-# If you've not yet installed the necessary PPD files, do it now. After that
-# you should be able to create a queue and start to print. The remaining
-# comments refer to steps you may perform later if you wish.
-#
-# Exception: If the ghostscript binary you wish to use is not the one found
-# by calling "gs" from the filter, you'll have to set "GhostscriptCommand" in
-# a configuration file. Read the instructions in the next section.
-#
-# Should you encounter problems when trying to print, check CUPS' error log
-# file. If necessary, increase the CUPS LogLevel to "debug", restart CUPS and
-# try again.
-#
-#
-# Configuration
-# -------------
-# This filter uses a queue-specific PostScript configuration file if it exists.
-# This file must have the name $PRINTER.ps ($PRINTER is the name of the queue)
-# and must reside in the "config" subdirectory (create it if it doesn't exist)
-# of the $CUPS_SERVERROOT directory, usually /etc/cups. This file will be
-# handed to ghostscript before the PostScript file to be printed.
-#
-# Use this configuration file for correcting misalignments, modifying
-# "InputAttributes" or "OutputAttributes", setting default transfer functions
-# or any other queue-specific configuration independent of the document to be
-# printed. Primarily this file should contain PostScript commands to simulate
-# persistent state for the printer (what you would store in a real PostScript
-# printer's memory in such a manner that it survives power-off or at least
-# end-of-job). Note that because the file to be printed will be processed after
-# the configuration file, the former can still override the latter.
-#
-# In addition, you can insert configuration statements for this filter into the
-# file. These statements must be given as PostScript comments starting in
-# column 1. The possiblities are:
-#
-# % DivertToFile: <path>
-# CUPS' document manager does not always operate correctly. If you
-# suspect that the settings you have demanded do not take effect or
-# ghostscript gives an error when printing through this filter while the
-# original file is valid PostScript, set <path> to the name of a file
-# which is writable for the user running this filter (usually lp).
-# Instead of printing, the filter will then copy its input to that file,
-# prepending a comment containing the command line it would use for
-# calling ghostscript.
-#
-# % DoAccounting: <True or False>
-# This parameter determines whether pcl3 will issue CUPS page accounting
-# messages or not. The default is "True". You should set this to "False"
-# only if the page accounting messages are generated by the backend
-# (later in the print pipeline).
-#
-# % GhostscriptCommand: <path to gs>
-# Use this to set the command to invoke ghostscript. The default
-# corresponds to "% GhostscriptCommand: gs".
-#
-# % UseIntermediateFile: <True or False>
-# This statement determines whether the ghostscript output file is first
-# written to disk or is copied directly to the printer. The former is
-# safer because it is legitimate for a PostScript program to invoke
-# operators like "print" which generate output which ghostscript maps to
-# standard output even for "-sOutputFile=-" (in my opinion this is a bug
-# in ghostscript). If you print such a document, the result is unlikely
-# to be usable. The same applies if you print an illegal PostScript file
-# because ghostscript issues some error messages on standard output.
-# The default is therefore "% UseIntermediateFile: True". This might
-# however require substantial disk space.
-#
-# Of course the file need not contain any PostScript commands if you just need
-# it for filter configuration.
-#
-#******************************************************************************
-
-#name=`basename "$0"`
-name=cups-pcl3 # Invalid CUPS documentation
-
-printf 'DEBUG: %s: called for queue %s\n' "$name" "${PRINTER:-}" >&2
-printf 'DEBUG: %s: command line: %s %s\n' "$name" "$0" "$*" >&2
-
-# Arguments
-if [ $# -ne 5 -a $# -ne 6 ]; then
- printf 'ERROR: Usage: %s job user title copies options [filename]\n' "$0" >&2
- exit 1
-fi
-job="$1"
-user="$2"
-title="$3"
-copies="$4" # can be ignored in this filter (pstops generates "NumCopies")
-options="$5"
-test $# -lt 6 || exec < "$6" || exit 1
-
-# We ignore all options completely because, as far as they are meaningful and
-# as far as I understand the matter, preceding filters (in particular pstops)
-# should have taken care of them, i.e., we assume that they have been converted
-# into PostScript code as far as possible.
-# Besides, I'm not aware of any statement in CUPS which tells a filter's
-# author which options can be expected (from the source code it's easiest to
-# find out which one needs not to expect, but that is not very interesting).
-
-#******************************************************************************
-
-# Find configuration file for the queue
-cfgfile="${CUPS_SERVERROOT:-/etc/cups}/config/${PRINTER:-}.ps"
-if [ -f "$cfgfile" ]; then
- printf 'DEBUG: %s: Using configuration file %s.\n' "$name" "$cfgfile" >&2
-else
- printf 'DEBUG: %s: No configuration file %s.\n' "$name" "$cfgfile" >&2
- cfgfile=
-fi
-
-# Subroutine to extract filter options from the configuration file
-extract()
-{
- # Argument $1: name of the option
- sed -e "/^% $1:/!d" -e 's/^[^:]*: *//' "$cfgfile" | head -1
-}
-
-# Extract filter options
-dacc=
-divert=
-gs_command=
-use_intermediate_file=
-if [ '' != "$cfgfile" ]; then
- if [ ! -r "$cfgfile" ]; then
- printf 'ERROR: %s: %s is not readable.\n' "$name" "$cfgfile" >&2
- exit 1
- fi
- dacc=`extract DoAccounting`
- divert=`extract DivertToFile`
- gs_command=`extract GhostscriptCommand`
- use_intermediate_file=`extract UseIntermediateFile`
-fi
-test '' != "$dacc" || dacc=True
-test '' != "$gs_command" || gs_command=gs
-test '' != "$use_intermediate_file" || use_intermediate_file=True
-printf 'DEBUG: %s: GhostscriptCommand: %s, DoAccounting: %s, '\
-'UseIntermediateFile: %s.\n' \
- "$name" "$gs_command" "$dacc" "$use_intermediate_file" >&2
-accounting=-dCUPSAccounting
-test False != "$dacc" || accounting=
-
-# Find the command line options from the PPD file. We need not bother about
-# *Include statements because CUPS doesn't support them.
-if [ ! -f "${PPD:-}" ]; then
- printf 'ERROR: %s: No PPD file %s.\n' "$name" "${PPD:-}" >&2
- exit 1
-fi
-printf 'DEBUG: %s: Using PPD file %s.\n' "$name" "$PPD" >&2
-gs_options=`grep '^\*GhostscriptOptions:' "$PPD" | \
- sed -e '1!d' -e 's/^[^"]*"//' -e 's/".*$//'`
-if [ '' = "$gs_options" ]; then
- printf 'ERROR: %s: No *GhostscriptOptions statement in %s.\n' \
- "$name" "$PPD" >&2
- exit 1
-fi
-printf 'DEBUG: %s: *GhostscriptOptions: "%s"\n' "$name" "$gs_options" >&2
-
-# Treat RIP_MAX_CACHE
-if [ '' != "${RIP_MAX_CACHE:-}" ]; then
- printf 'DEBUG: %s: RIP_MAX_CACHE is %s.\n' "$name" "$RIP_MAX_CACHE" >&2
-
- # Convert to "MaxBitmap" value (cnf. pstoraster/gdevprn.c in CUPS)
- amount=`printf '%s\n' "$RIP_MAX_CACHE" | sed -e 's/[^0-9].*$//'`
- unit=`printf '%s\n' "$RIP_MAX_CACHE" | sed -e 's/^[0-9]*//'`
- if [ '' = "$amount" ]; then
- amount=33554432 # 32 binary mega bytes
- else
- case "$unit" in
- g*)
- amount=`expr $amount '*' 1073741824`;; # binary giga bytes
- # Note that this will fail on 32-bit systems if "amount" is larger than
- # one.
- m*)
- amount=`expr $amount '*' 1048576`;; # binary mega bytes
- k*)
- amount=`expr $amount '*' 1024`;; # binary kilo bytes
- *)
- # This applies to "t" and to no unit specification.
- amount=`expr $amount '*' 262144`;; # 256 K
- esac
- fi
-
- printf 'DEBUG: %s: MaxBitmap will become %s.\n' "$name" "$amount" >&2
- gs_options="$gs_options -dMaxBitmap=$amount"
-fi
-
-#******************************************************************************
-
-if [ '' != "$divert" ]; then
- cat << --- > "$divert" || { \
- printf 'ERROR: %s: Failure to write to %s.\n' "$name" "$divert" >&2; \
- exit 1; }
-%!
-% $name input for job $job
-% Call to ghostscript: $gs_command $gs_options -dCUPSMessages $accounting $cfgfile <this file>
----
- cat >> "$divert" || exit 1
- printf 'WARNING: %s: No printing, output for job %s diverted to %s.\n' \
- "$name" "$job" "$divert" >&2
- exit 0
-fi
-
-#******************************************************************************
-
-if [ False = "$use_intermediate_file" ]; then
- # Directly to stdout, hoping that other data will not appear. However,
- # in order not to loose an error message text, the following command is
- # used to ensure that this output will be printed properly and in
- # particular without a "staircase effect" provided the error occurs on the
- # first page.
- printf '\033E\033&k2G\033&s0C'
- # PCL: Printer Reset, Line Termination (LF -> CR+LF), End-of-Line-Wrap (ON).
-
- # Now call ghostscript ("-dNOPAUSE -dBATCH" are currently superfluous, but
- # ghostscript's documentation is not sufficiently clear on this point to make
- # it appear safe to drop them).
- $gs_command $gs_options -dCUPSMessages $accounting -q -dNOPAUSE -dBATCH \
- -dSAFER -sOutputFile=- $cfgfile -
- # Newer gs versions (>= 5.65) accept also "-_" which might be faster than "-".
- rc=$?
-else
- # Call ghostscript with an intermediate file. See also comments above.
- tmp="${TMPDIR:-/tmp}/$$.tmp"
- rm -f "$tmp"
- $gs_command $gs_options -dCUPSMessages $accounting -q -dNOPAUSE -dBATCH \
- -dSAFER -sOutputFile="$tmp" $cfgfile - >&2
- rc=$?
-
- # Copy the file to stdout on success
- test 0 -ne $rc -o ! -f "$tmp" || cat "$tmp" || {
- rm -f "$tmp"
- printf 'ERROR: %s: cat to stdout failed for %s.\n' "$name" "$tmp" >&2
- exit 1
- }
- rm -f "$tmp"
-fi
-
-if [ 0 -ne $rc ]; then
- printf 'ERROR: %s: ghostscript returned %s for job %s (invalid PostScript input?).\n' \
- "$name" "$rc" "$job" >&2
-
- # Send a mail message if we have mailx and "$user" is something sensible
- # (CUPS doesn't seem to guarantee that at present for remote users)
- if type mailx > /dev/null 2>&1 && \
- { expr x"$user" : '.*@' > /dev/null || id "$user" > /dev/null 2>&1; }
- then
- mailx -s "$name"": Error printing job $job" "$user" << ---
-Ghostscript returned an error code ($rc) for your print job $job.
-
-The most likely cause is an invalid input file. If you submitted a
-PostScript file, run ghostscript or ghostview on it to check its
-correctness. If it is valid or you submitted a non-PostScript file,
-inspect CUPS' error log file for further information on the error.
-
-If that does not expose the cause, read the initial comments in
-$0, especially on DivertToFile.
----
- fi
- # No exit with non-zero return code because that would disable the printer.
- # As the error is most likely due to an illegal input file, such a drastic
- # step is not justified (it would even prevent other users from printing).
-fi
-
-exit 0
diff --git a/gs/contrib/pcl3/lib/example.mcf b/gs/contrib/pcl3/lib/example.mcf
deleted file mode 100644
index 6140f036a..000000000
--- a/gs/contrib/pcl3/lib/example.mcf
+++ /dev/null
@@ -1,136 +0,0 @@
-#******************************************************************************
-# File: @(#)$Id: example.mcf,v 2.1 2000/10/22 08:53:25 Martin Rel $
-# Contents: Example of a media configuration file for the ghostscript device
-# "pcl3": supported media dimensions and their margins for "unspec"
-# Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-# Germany, e-mail: Martin.Lottermoser@t-online.de
-#
-#******************************************************************************
-# *
-# Copyright (C) 1997, 1998, 2000 by Martin Lottermoser *
-# All rights reserved *
-# *
-#******************************************************************************
-#
-# This file is intended as a template for adapting the "unspec" subdevice to
-# the media sizes accepted by a printer not explicitly supported by pcl3.
-# The file contains entries with those data which are compiled into the
-# "unspec" subdevice and which will be used if you do not specify a media
-# description file. The default values given here almost agree with:
-# Hewlett-Packard
-# "HP DeskJet 855C, 850C, 870C, and 890C Series Printers - Printable Areas"
-# 1996-06-06, available from http://www.hp.com: bpd02523
-#
-# You should read the subsection "Media Configuration File" in the manual page
-# gs-pcl3(1) and then rewrite this file based on your printer's manual.
-#
-#------------------------------------------------------------------------------
-
-# The margins are specified in inches (the unit line is actually superfluous
-# because this is the default, but it's here to remind you that this can be
-# changed):
-unit in
-
-#------------------------------------------------------------------------------
-
-# Internationally standardized sizes
-
-# ISO A6 (105 x 148 mm, sheets or cards):
-# A6 sheets not supported by default
-A6Card 0.125 0.46 0.125 0.04
-
-# ISO A5 (148 x 210 mm):
-A5 0.13 0.46 0.13 0.04
-
-# ISO A4 (210 x 297 mm):
-A4 0.13 0.46 0.13 0.04
-
-# Banner printing
-# A4Big not supported by default
-
-# ISO A3 (297 x 420 mm)
-# A3 not supported by default
-
-# ISO DL (110 x 220 mm):
-EnvDL 0.125 0.87 0.125 0.04
-
-# ISO C5 (162 x 229 mm):
-# EnvC5 not supported by default
-
-# ISO C6 (114 x 162 mm):
-EnvC6 0.125 0.87 0.125 0.04
-
-#------------------------------------------------------------------------------
-
-# US sizes
-
-# US Executive (7.25 x 10.5 in):
-Executive 0.25 0.46 0.25 0.04
-
-# US Letter (8.5 x 11 in):
-Letter 0.25 0.46 0.25 0.04
-
-# Banner printing
-# LetterBig not supported by default
-
-# US Legal (8.5 x 14 in):
-Legal 0.25 0.46 0.25 0.04
-
-# US Tabloid (11 x 17 in) or Ledger (17 x 11 in):
-# Tabloid not supported by default
-
-# US Statement (5.5 x 8.5 in):
-# Statement not supported by default
-
-# Super B (13 x 19 in according to HP):
-# HPSuperB not supported by default
-
-# US Index card (3 x 5 in):
-# Index3x5in not supported by default
-
-# US Index card (4 x 6 in):
-Index4x6in 0.125 0.46 0.125 0.04
-
-# US Index card (5 x 8 in):
-Index5x8in 0.125 0.46 0.125 0.04
-
-# US Monarch envelope (3.875 x 7.5 in):
-# EnvMonarch not supported by default
-
-# US No. 10 envelope (4.125 x 9.5 in):
-Env10 0.125 0.87 0.125 0.04
-
-# US A2 envelope (4.375 x 5.75 in):
-# EnvUS_A2 not supported by default
-
-#------------------------------------------------------------------------------
-
-# Japanese sizes
-
-# JIS B5 (182 x 257 mm):
-JISB5 0.13 0.46 0.13 0.04
-# Actually, bpd02523 states that the top margin should be 0.46 in for
-# JIS B5. This is unlikely in general and provably wrong for the DJ 850C.
-
-# JIS B4 (257 x 364 mm):
-# JISB4 not supported by default
-
-# Hagaki card (100 x 148 mm):
-Postcard 0.125 0.46 0.125 0.04
-
-# Oufuko-Hagaki postcard (148 x 200 mm):
-# DoublePostcard not supported by default
-
-# Long envelope #3 (120 x 235 mm):
-# EnvChou3 not supported by default
-
-# Long envelope #4 (90 x 205 mm):
-# EnvChou4 not supported by default
-
-# Kaku envelope (240 x 332 mm):
-# EnvKaku2 not supported by default
-
-#------------------------------------------------------------------------------
-
-# Custom page size:
-CustomPageSize 0.13 0.46 0.13 0.04
diff --git a/gs/contrib/pcl3/lib/if-pcl3 b/gs/contrib/pcl3/lib/if-pcl3
deleted file mode 100755
index d25cacf06..000000000
--- a/gs/contrib/pcl3/lib/if-pcl3
+++ /dev/null
@@ -1,417 +0,0 @@
-#!/bin/sh
-#******************************************************************************
-# File: @(#)$Id: if-pcl3,v 2.6 2001/07/07 10:05:34 Martin Rel $
-# Contents: Example of a pcl3-based input filter for a Berkeley spooler (lpr)
-# driving a PCL-3 printer
-# Call: if-pcl3 <input filter arguments>
-# Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-# Germany. E-mail: Martin.Lottermoser@t-online.de.
-#
-#******************************************************************************
-# *
-# Copyright (C) 1998, 2000, 2001 by Martin Lottermoser *
-# All rights reserved *
-# *
-#******************************************************************************
-#
-# This input filter has the following interesting because unusual features:
-# - If an error occurs, the user is notified by mail.
-# - The filter is configurable based on the spool directory and permits in
-# particular
-# - the configuration of a "transparent" queue and
-# - the inclusion of a file with PostScript configuration commands.
-# - The filter does pac(8) accounting if this is requested in the printcap file.
-#
-# This is not the best of all possible filters. However, all the others I've
-# seen so far -- excepting those I've modified myself :-) -- lack several
-# important though elementary features. Much of this is admittedly due to the
-# inflexibility of the Berkeley spool system (compared to the AT&T spooler)
-# but, speaking entirely subjectively, I've also often had the impression that
-# the filters' authors are not as familiar with PCL, ghostscript or the
-# Berkeley spooler as one should be when trying to write universally useful
-# software. You should form your own opinion on this point and, if necessary,
-# ruthlessly modify whatever filter you determine to use until it satisfies
-# your requirements.
-#
-#******************************************************************************
-#
-# Installation
-# ============
-#
-# printcap entry
-# --------------
-# Read the man page printcap(5). You should set at least 'if' (absolute path
-# name of this filter), 'lp' (printer device), 'sd' (absolute path name of the
-# spool directory, choose it to be queue-specific), and 'sh' (suppress header,
-# should be true). Here's an example for a queue named "draft":
-#
-# draft:if=/var/spool/lpd/if-pcl3:lp=/dev/lp0:sd=/var/spool/lpd/draft:sh:
-#
-# Other entries which are worth considering are 'af' (this must usually be a
-# file named 'acct' in the spool directory, see pac(8)), 'lf', and 'mx'.
-#
-# You must create the spool directory if it does not exist. Usually, it should
-# be owned by "daemon", group "lp", and have the file mode 770.
-#
-#
-# Filter configuration
-# --------------------
-# This filter looks for a file if-pcl3.cfg in the spool directory. If it exists
-# and is readable it is sourced as a shell script. The file is intended for
-# setting shell variables used by this filter, redefining the two accounting
-# routines, and for modifying the environment.
-#
-# Here follows a description of shell variables used by this filter. Note that
-# you can also add other command line arguments to the gs call by setting
-# GS_OPTIONS in the environment.
-#
-# - GS: This is normally the path name of the ghostscript executable. But if
-# the configuration file sets it to the empty string, this filter will not
-# call ghostscript but simply 'cat'. This is intended for setting up a
-# "transparent" queue which passes files through to the printer without
-# modifications.
-# - INIT_TRANS: This must be empty or a parameter-less format string for the
-# 'printf' command. If $GS is empty, this string will be sent before the file
-# to be printed. Use it for PCL commands under the assumption that the user
-# wishes to print a text file. In particular, this is the place to set the
-# media size to ISO A4 if that is your default paper size. My recommendation
-# for A4 and ISO 8859-1 is:
-# INIT_TRANS='\033&l26A\033(0N\033&a10L\033(s12H\033&l6.5D\033&l5E\033&l66F'
-# For US Letter size, replace the "26" near the beginning by "2".
-# Setting INIT_TRANS should have no influence on PCL files submitted to such
-# a queue because all PCL-generating programs should start their output with
-# the "Printer Reset" command (pcl3 does this) which resets all parameters to
-# their defaults.
-# - RESOLUTION: This must be empty or an acceptable argument for ghostscript's
-# option '-r'. In the first case, pcl3's default resolution will be used
-# unless the document overrides it. Remember that "-r" sets also
-# "-dFIXEDRESOLUTION".
-# - SUBDEVICE, COLOURMODEL, QUALITY: These must contain values for pcl3's
-# options "Subdevice", "ColourModel" and "PrintQuality".
-# - PSCONFIGFILE: If this variable contains the name of an existing and
-# readable file it will be included in the call to ghostscript. This file is
-# intended to contain PostScript configuration commands, for example setting
-# the 'PageOffset' array, defining transfer functions, setting the halftone
-# screen or configuring 'InputAttributes'.
-# - PAGECOUNTFILE: If pcl3 has been compiled without EPRN_NO_PAGECOUNTFILE
-# defined, it has the ability to update a page count file with the number of
-# pages printed. If this variable is non-empty (and that is the default),
-# page counting will be enabled using the file specified in the variable and
-# the count will be accumulated across jobs.
-# - USE_INTERMEDIATE_FILE: When printing via ghostscript, this variable should
-# be "yes" or "no". It controls whether ghostscript's output is sent directly
-# to a printer or first to a file. Using "yes" needs substantial temporary
-# disk space but prevents wrong output in some situations and is therefore
-# the default.
-#
-# The defaults for these variables can be found below before the point where
-# the configuration file is sourced.
-#
-# The two accounting functions, 'acct_start' and 'acct_stop', are always called,
-# respectively, before and after the print command (cat or gs). 'acct_start'
-# should return a string on standard output which will be passed as an argument
-# to the later call to 'acct_stop'. The latter function should then return on
-# standard output a string representation of an integer or a floating point
-# number. If accounting has been enabled by an 'af' entry in the printcap file
-# and the print command was successful, this value will be recorded together
-# with the job owner's user name in the accounting file for later evaluation by
-# 'pac'. The usual interpretation is that this value represents pages printed
-# or feet of paper consumed.
-#
-# The default implementation of the accounting functions counts the number of
-# jobs submitted for a transparent queue and the number of pages printed for a
-# pcl3-based one. If PAGECOUNTFILE is empty or page counting manifestly does
-# not work, the filter counts jobs also in the latter case.
-#
-#
-#
-# Restrictions
-# ============
-# A spool queue based on this filter processes only PostScript files correctly
-# except when configured as a transparent queue in which case only text or PCL
-# files should be sent. This is not a so-called "intelligent filter" which
-# adapts its behaviour to the type of file received!
-#
-#******************************************************************************
-
-name=`basename "$0"`
-
-# Reset umask if 0. Otherwise an ordinary user could modify the accounting
-# information if this is the first time accounting is used. This does not work
-# on systems not supporting the old octal notation but is harmless there.
-expr "x`umask`" : 'x00*$' > /dev/null && umask 002
-
-# Berkeley input filters are called in the spool directory. This is used to
-# locate configuration files and it usually identifies the spool queue.
-spool_directory=`pwd`
-
-#******************************************************************************
-
-# In order to notify the user of errors occurring in the backend I'm copying
-# standard error into a temporary file and mail it to the user if it is
-# non-empty when the filter terminates.
-
-errlog="${TMPDIR:-/tmp}/$$-1.tmp"
-rm -f "$errlog"
-notify_user=root # This will be overwritten after we've checked the
-notify_host=`uname -n` # arguments in the call.
-
-
-finish()
-{
- if [ -s "$errlog" ]; then
- ${MAILX:-mailx} -s "$name: Error while printing" \
- "$notify_user"@"$notify_host" << ---
-The following error occurred while running $0
-in $spool_directory:
-
-`cat $errlog`
----
- cat "$errlog" >&3 # for the log file
- rm -f "$errlog"
- exit 2
- fi
- rm -f "$errlog"
- exit 0
-}
-
-
-# Set up a trap for finish() on exit and SIGINT
-trap finish 0 2
-
-# Copy standard error into a file. We duplicate file descriptor 2 as 3 because
-# stderr can be appended to a log file by the 'lf' field in printcap and we
-# should like to be able to have both, a cumulative log file for the
-# administrator and a job-specific mail message to the user.
-exec 3>&2
-exec 2> "$errlog"
-
-#******************************************************************************
-
-# Process options. Most are irrelevant for gs and this filter.
-print_controls=no # print control characters instead of interpreting them
-host= # host name of job owner
-user= # user name of job owner
-length=0 # page length in lines
-indentation=0 # amount of indentation in characters
-width=0 # page width in characters
-while getopts ch:i:l:n:w: option; do
- case "$option" in
- c)
- print_controls=yes;;
- h)
- host="$OPTARG";;
- i)
- indentation="$OPTARG";;
- l)
- length="$OPTARG";;
- n)
- user="$OPTARG";;
- w)
- width="$OPTARG";;
- *)
- echo "? $name"": Illegal option specification. The call was:" >&2
- printf ' %s\n' "$*" >&2
- exit 2;;
- esac
-done
-test 1 = "$OPTIND" || shift `expr $OPTIND - 1`
-
-# Deal with non-option arguments
-if [ $# -gt 1 ]; then
- echo "? $name"": More than one non-option argument in the call:" >&2
- printf ' %s\n' "$*" >&2
- exit 2
-fi
-if [ $# -gt 0 ]; then
- accounting_file="$1"
-else
- accounting_file=
-fi
-
-# Starting here, any errors occurring are sent to the job's owner
-if [ '' != "$user" ]; then
- notify_user="$user"
- test '' = "$host" || notify_host="$host"
-fi
-
-#******************************************************************************
-
-# Set up default values.
-
-# These are the parameters which can be redefined in the configuration file.
-# You might also have to use GS_OPTIONS, for example for the media type.
-GS=gs
-SUBDEVICE=unspec
-COLOURMODEL=Gray # Americans note the "U"! Britons note the "a"! :-)
-RESOLUTION=
-QUALITY=normal
-PSCONFIGFILE=if-pcl3.ps
-PAGECOUNTFILE=gs-pages.count
-INIT_TRANS=
-USE_INTERMEDIATE_FILE=yes
-
-
-# Default accounting: count the number of files printed or, if supported, the
-# number of pages.
-
-acct_start()
-{
- test '' = "$PAGECOUNTFILE" -o ! -f "$PAGECOUNTFILE" || cat "$PAGECOUNTFILE"
-
- return
-}
-
-acct_stop()
-{
- pages_before="$1"
- test '' != "$pages_before" || pages_before=0
-
- if [ '' != "$PAGECOUNTFILE" -a -f "$PAGECOUNTFILE" ]; then
- pages_after=`cat "$PAGECOUNTFILE"`
- pages=`expr $pages_after - $pages_before`
- if [ '' = "$pages" -o 0 -ge "$pages" ]; then
- test 0 -ne "$rc" || echo "? $name"": Wrong value for number of pages" \
- "printed: \`$pages'." >&2
- pages=1 # count files instead
- fi
- else
- pages=1 # count files
- fi
- echo $pages
-
- return
-}
-
-#******************************************************************************
-
-# Read the configuration file for the filter if present in the spool directory
-true
-cfg=if-pcl3.cfg
-test ! -f $cfg -o ! -r $cfg || . ./$cfg
-test $? -eq 0 || exit 2
-
-# RESOLUTION and PSCONFIGFILE must not contain field separators
-if expr "x$RESOLUTION$PSCONFIGFILE" : "x.*[$IFS]" > /dev/null; then
- printf '? %s: Shell field separator(s) in RESOLUTION (%s)\n' \
- "$name" "$RESOLUTION" >&2
- printf ' or PSCONFIGFILE (%s).\n' "$PSCONFIGFILE" >&2
- exit 2
-fi
-
-#******************************************************************************
-
-# Initialize accounting
-LC_NUMERIC=C; export LC_NUMERIC
-acct_saved=`acct_start`
-
-# stdin is the input file, stdout the printer.
-
-rc=0
-if [ '' = "$GS" ]; then
- # Transparent queue
- printf '\033E\033&k2G' # PCL: Printer Reset, Line Termination (LF -> CR+LF)
- test '' = "$INIT_TRANS" || printf "$INIT_TRANS"
- cat
- rc=$?
-else
- # An empty specifications for RESOLUTION means "use the default".
- test '' = "$RESOLUTION" || RESOLUTION="-r$RESOLUTION"
-
- # Remove the PostScript configuration file from the command line if it does
- # not exist or is not readable
- test '' != "$PSCONFIGFILE" -a -f "$PSCONFIGFILE" -a -r "$PSCONFIGFILE" || \
- PSCONFIGFILE=
-
- # If PAGECOUNTFILE is non-empty, insert an option with it in the call.
- pcf_option=
- test '' = "$PAGECOUNTFILE" || pcf_option=-sPageCountFile="$PAGECOUNTFILE"
-
- # We have to pass the resulting PCL file to standard output. Unfortunately,
- # if one does this directly from ghostscript (via "-sOutputFile=-"), the
- # output can contain unwanted data: error messages and data written to what
- # is standard output for PostScript. (I consider this behaviour to be a bug
- # in gs.) The latter feature is for example used by some MS Windows drivers
- # for PostScript printers in order to report the current processing state
- # back to the host.
- # If we want neither error messages nor statements like "%%[ Page: 1 ]%%" to
- # be intermixed with what is to be printed, we have to create a file first
- # and copy it to stdout in a second step. This might require substantial disk
- # space.
- # Hence I provide both solutions. Choose the one you like best by setting
- # USE_INTERMEDIATE_FILE.
-
- if [ no = "$USE_INTERMEDIATE_FILE" ]; then
- # Directly to stdout, hoping that other data will not appear. However,
- # in order not to loose the error message text, the following command is
- # used to ensure that this output will be printed properly and in
- # particular without a "staircase effect" provided the error occurs on the
- # first page.
- # This is for example what happens if the input file is not PostScript.
- printf '\033E\033&k2G\033&s0C'
- # PCL: Printer Reset, Line Termination (LF -> CR+LF), End-of-Line-Wrap (ON).
-
- # Call ghostscript
- ${GS:-gs} -q -dNOPAUSE -dSAFER -sDEVICE=pcl3 -sSubdevice="$SUBDEVICE" \
- -sColourModel="$COLOURMODEL" $RESOLUTION -sPrintQuality="$QUALITY" \
- $pcf_option -sOutputFile=- $PSCONFIGFILE -
- rc=$?
- test 0 -eq $rc || \
- printf '\n? %s: %s returned an exit code of %s.\n' "$name" "$GS" "$rc" >&2
- else
- # Two-step process with an intermediate file
- tmp="${TMPDIR:-/tmp}/$$-2.tmp"
- rm -f "$tmp"
-
- # Call ghostscript, redirecting stdout to stderr. Note that permissible
- # output (e.g., from "=") will be redirected to stderr as well, hence
- # we can't use the size of the resulting file as the sole indication that
- # an error has occurred.
- prev_umask=`umask`
- umask 027 # Ensure privacy. The group should be lp.
- ${GS:-gs} -q -dNOPAUSE -dSAFER -sDEVICE=pcl3 -sSubdevice="$SUBDEVICE" \
- -sColourModel="$COLOURMODEL" $RESOLUTION -sPrintQuality="$QUALITY" \
- $pcf_option -sOutputFile="$tmp" $PSCONFIGFILE - >&2
- rc=$?
- test 0 -eq $rc || \
- printf '\n? %s: %s returned an exit code of %s.\n' "$name" "$GS" "$rc" >&2
- umask "$prev_umask"
-
- # If an error occurred, don't bother printing.
- if [ 0 -eq $rc ]; then
- cat "$tmp"
- rc=$?
- test $rc -eq 0 || printf \
- '? %s: Error copying the generated file to stdout.\n' "$name" >&2
- fi
-
- rm -f "$tmp"
- fi
-fi
-
-# Reset the printer to its default state. This also ejects any unfinished pages
-# which is needed if the transparent queue is used for printing ordinary text.
-# It is superfluous when printing with pcl3 because pcl3 generates this at the
-# end of its output already, but a second reset is harmless (unless the printer
-# knows more than one command language and PCL-3+ is not the default) and it
-# works even if gs crashes.
-printf '\033E' # PCL: Printer Reset
-
-# Terminate accounting
-pages=`acct_stop "$acct_saved"`
-
-# Exit on error
-test 0 -eq $rc || exit 2
-
-#******************************************************************************
-
-# User-specific accounting on success
-if [ '' != "$accounting_file" ]; then
- printf '%7.2f\t%s:%s\n' "$pages" "$host" "$user" >> "$accounting_file"
-fi
-
-# Remove the trap for finish() in case the stderr log is non-empty although
-# everything worked.
-trap - 0 2
-
-exit 0
diff --git a/gs/contrib/pcl3/pcl3.tar.sig b/gs/contrib/pcl3/pcl3.tar.sig
deleted file mode 100644
index cf4248c9b..000000000
--- a/gs/contrib/pcl3/pcl3.tar.sig
+++ /dev/null
@@ -1,8 +0,0 @@
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.0.6 (GNU/Linux)
-Comment: For info see http://www.gnupg.org
-
-iD8DBQA7f5IWue0y1QfmkfMRAsxCAKCe1ARuLuDCpllYxBFjVs7xPetPUwCePxgz
-HW6sXDAPwVZVtS/l+5KNTgs=
-=LNGf
------END PGP SIGNATURE-----
diff --git a/gs/contrib/pcl3/ppd/README b/gs/contrib/pcl3/ppd/README
deleted file mode 100644
index b4cb88c93..000000000
--- a/gs/contrib/pcl3/ppd/README
+++ /dev/null
@@ -1,228 +0,0 @@
-*******************************************************************************
- File: @(#)$Id: README,v 1.10 2001/08/19 08:52:32 Martin Rel $
- Contents: Notes on the PPD files in the pcl3 distribution
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany. E-mail: Martin.Lottermoser@t-online.de.
-
-*******************************************************************************
-* *
-* Copyright (C) 2001 by Martin Lottermoser *
-* All rights reserved *
-* *
-*******************************************************************************
-
-
-Purpose and Format of PPD Files, Document Managers
-**************************************************
-Some PostScript commands (e.g., for duplex printing) are not concerned with
-what appears on the page but control the way a document is printed independent
-of its contents. Such commands are usually not created by the application
-generating the PostScript document but are inserted at the user's request when
-actually printing the file. In addition, some PostScript interpreters differ in
-the commands needed to achieve a particular effect, hence a PostScript file
-might have to be adapted for a certain device if it was orginally generated for
-a different one. This post-processing of PostScript files is the job of a
-PostScript "document manager" or "print manager". It obtains its information
-from a PPD (PostScript Printer Description) file for the printer selected.
-
-The most useful kind of document manager is a preprocessor for a spooler. This
-preprocessor parses the PostScript file to determine its current settings, asks
-the user which special features (e.g., duplex printing, output quality,
-stapling, etc.) are desired, extends or modifies the file with commands
-extracted from the PPD file, and passes the modified file to the spooler.
-
-There exist also spooler-integrated document managers where the user interface
-is detached from the editing component; in these cases the interface passes the
-information it has collected to the spooling interface in some spooler-specific
-manner and later a backend inserts appropriate PostScript commands.
-
-Primitive document manager implementations don't bother about parsing the
-PostScript file but merely prepend the new PostScript commands to the file;
-such commands will not take effect if the file already contains invocations of
-the same feature. Beware of this in particular in the case of Windows-generated
-PostScript files which usually contain explicit settings for the resolution.
-You might consider adding definitions for ghostscript's FIXEDRESOLUTION
-variable to the *Resolution statements in the PPD file if you have such a
-document manager.
-
-PPD files contain also some information which is relevant for software
-generating PostScript files. A case in point is the list of supported media
-sizes: it can be used by PostScript-generating programs to present a user with
-a list of choices for the document to be composed, and it is also used by the
-document manager to replace the size's invocation code with the commands
-required to obtain this size on the printer selected. It can be confusing if
-you have a PPD-based user interface to a print system which accepts PostScript
-as well as non-PostScript files and where the interface does not clearly
-distinguish between these two steps (document composition and printing); you
-might get the impression that you can alter the page size after the PostScript
-file has been generated. (A similar case is page orientation.) Actually,
-PostScript does provide functionality for doing this (PageSize recovery
-policies), but altering the size selection commands is logically wrong and does
-not give a usable result in general.
-
-The PPD file format is defined by Adobe:
-
- Adobe Systems Incorporated
- "PostScript Printer Description File Format Specification"
- Version 4.3
- 9 February 1996
- Document ID: PN LPS5003
-
-This specification can be obtained from http://www.adobe.com.
-
-
-
-The PPD Files for pcl3
-**********************
-The PPD files distributed with pcl3 are not complete descriptions of the
-devices implemented by ghostscript with the pcl3 driver. Their main purpose is
-to provide some essential support for document managers acting as
-preprocessors. This makes it possible to create printing interfaces which are
-easier to use than ghostscript's command line interface. As a consequence,
-you will find no *OpenUI/*CloseUI entries for device parameters like
-"SendBlackLast" or "PJLLanguage": the values of these parameters are not
-job-specific but printer-specific properties and should be given as additions
-in other PPD statements or in the call to ghostscript.
-
-PPD files can include other PPD files. For pcl3, the include structure looks
-like this (inclusion is from top to bottom):
-
- gs-pcl3-<subdevice>.ppd
- |
- gs-pcl3-common.ppd
- |
- gs.ppd
- |
- gs-<gs version>.ppd
- |
- gs-common.ppd
-
-Several of the files gs-pcl3-<subdevice>.ppd and in particular those where
-<subdevice> is not an acceptable argument to "-sSubdevice" are valid for
-several subdevices. If you are unsure which file to select, check the initial
-comments or the *ModelName statement in a file to discover the subdevices
-supported by that file.
-
-The gs-pcl3-<subdevice>.ppd files assume that the PostScript file generated by
-the document manager is passed to a ghostscript executable with options
-selecting pcl3 and the intended subdevice and without altering the default
-state of the device as far as it is reflected in the PPD file. If this does not
-agree with your environment, use a local PPD customization file for the
-necessary adaptations.
-
-If you're using CUPS, device and subdevice selection should happen via the
-*cupsFilter statement and the filter called. The gs-pcl3-<subdevice>.ppd files
-already contain *cupsFilter statements using the cups-pcl3 filter. If you're
-using a different filter, modify the statements as needed, otherwise read the
-initial comments in the file cups-pcl3.
-
-
-Installation of the Files
-*************************
-
-1. Create a file called gs.ppd for describing site-specific settings of your
- ghostscript installation. It should contain at least the following
- statements:
-
- *PPD-Adobe: "4.3"
- *DefaultPaperDimension: <size>
- *Include: "gs-<gs version>.ppd"
-
- Replace "<size>" with the default page size configured for your ghostscript
- installation. Usually, this is either "A4" or "Letter". In the case of A4
- you would therefore write:
-
- *DefaultPaperDimension: A4
-
- You might also wish to insert other statements here which describe settings
- which are relevant for a document manager. For example, if your document
- manager downloads fonts to the PostScript interpreter if it is of the
- opinion that the latter does not have a particular font used in a document
- (this is the case for CUPS), you should compose a PPD file with a list of
- fonts accessible to your ghostscript installation and insert it or an
- *Include statement for it at this point. You can use the fonts.ppd file in
- this directory as a model (or as a temporary substitute); it contains a
- list of ghostscript's usual standard fonts. If the programs accessing the
- PPD file use it only for determining whether a font is accessible to the
- interpreter or not, you can also simply use the list of font descriptions
- resulting from running gs on:
-
- /scratch 200 string def
- (*)
- {
- (*Font ) print print (: Standard "\(0.0\)" Standard Disk\n) print
- }
- scratch /Font resourceforall
-
- (put this into a file and run "gs -q -dBATCH -sDEVICE=bit" on it). This
- output will contain information which is wrong, but it will list all fonts
- known to your ghostscript installation.
-
- Don't forget to also replace <gs version> with your ghostscript's version
- number. If there is no gs-<gs version>.ppd file for your gs version, use
- one of the existing gs-<gs version>.ppd files as a model.
-
-2. The PPD specification distinguishes between printer models (e.g., the
- HP DeskJet 540) and printer instances (e.g., the second printer in
- room 12). The PPD file for an instance can be generated by creating a local
- instance-specific customization file which includes the model's PPD file.
-
- If your document manager has an interface for instance installation, it is
- sufficient to give it the relevant gs-pcl3-<subdevice>.ppd files which
- describe models. Otherwise you usually have to create a customization file
- under the name of the instance, containing just
-
- *PPD-Adobe: "4.3"
- *ShortNickName: "<short text>"
- *NickName: "<text>"
- *Include: "gs-pcl3-<subdevice>.ppd"
-
- with <text> describing the printer instance (<short text> should basically
- have the same content but consist of at most 31 characters) and <subdevice>
- being replaced to generate the name of the pcl3 PPD file you wish to use
- for this printer.
-
- If you wish to extend or override other settings in the
- gs-pcl3-<subdevice>.ppd file, add these statements in the customization
- file between the first and the last statement above.
-
- The pcl3 PPD files contain *InputSlot definitions only for those media
- sources ("Cassette" and "ManualFeed") which are available independent of
- your "InputAttributes" definitions. If you configure a print queue such
- that other sources are available as well, read the comments on the
- *InputSlot entry in gs-pcl3-common.ppd.
-
- You can't use local customization files with CUPS up to at least version
- 1.1.8 because the CUPS PPD scanner (a) does not support the *Include
- statement and (b) violates the PPD specification in either taking the
- last occurrence of a keyword as the correct instance or collecting all
- instances instead of disregarding every except the first. Modify the
- installed instance files in this case if you need some customization, for
- example to change the "*NickName" value (which actually CUPS should do when
- you give it a description for the print queue at creation time).
-
-3. Copy all PPD files needed into a directory where they will be found by your
- document manager.
-
- If your document manager does not support the "*Include" statement, use the
- script "catppd" for this purpose:
-
- catppd <top PPD file> <target directory or file>
-
- The script requires that all the files referenced from <top PPD file> must
- be accessible from the current working directory under the name given in
- the "*Include" statement. In the case of pcl3's PPD files this means that
- you must call it from the "ppd" directory. If you are installing model
- files you may specify any gs-pcl3-*.ppd file for <top PPD file> with the
- exception of gs-pcl3-common.ppd. If you are installing instance files, use
- catppd only on your customization files.
-
- For CUPS up to at least version 1.1.8 you'll have to use catppd and you
- should copy the files into the .../cups/model directory. You must also
- remove the second "*OpenUI *MediaType: ... *CloseUI *MediaType" section
- from the copied gs-pcl3-unspec.ppd file.
-
-4. If you are using the "unspec" or "unspecold" subdevices, check whether the
- PPD file supports all the features you need. You will also almost certainly
- find some features or values there which are not supported by your printer.
- It is probably best to create your own PPD file in this case.
diff --git a/gs/contrib/pcl3/ppd/catppd b/gs/contrib/pcl3/ppd/catppd
deleted file mode 100755
index a41d321f8..000000000
--- a/gs/contrib/pcl3/ppd/catppd
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/bin/sh
-#******************************************************************************
-# File: @(#)$Id: catppd,v 1.2 2001/03/16 07:57:12 Martin Rel $
-# Contents: Primitive *Include resolver for PPD files
-# Call: catppd <top-level file> <target directory or file>
-# Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-# Germany; Martin.Lottermoser@t-online.de
-#
-#******************************************************************************
-# *
-# Copyright (C) 2001 by Martin Lottermoser *
-# All rights reserved *
-# *
-#******************************************************************************
-#
-# All PPD files included with relative path names must be accessible from the
-# current working directory.
-#
-#******************************************************************************
-
-name=catppd
-
-# Collect the arguments
-if [ $# -ne 2 ]; then
- printf '? Usage: %s <top-level file> <target directory or file>\n' "$0" >&2
- exit 1
-fi
-infile="$1"
-if [ -d "$2" ]; then
- outfile="$2"/`basename "$infile"`
-else
- outfile="$2"
-fi
-
-# Check arguments for validity
-if [ ! -f "$infile" -o ! -r "$infile" ]; then
- printf '? %s: `%s'\'' is not accessible.\n' "$name" "$infile" >&2
- exit 1
-fi
-if [ -f "$outfile" ]; then
- printf '? %s: There is already a file %s.\n' "$name" "$outfile" >&2
- exit 1
-fi
-
-# Create awk script
-tmp="${TMPDIR:-/tmp}/$$.tmp"
-rm -f "$tmp"
-: ${AWK:=awk}
-cat << '---' | sed -e "s,@AWK@,$AWK," -e "s,@TMP@,$tmp," > "$tmp" || exit 1
-NR == 1 && first == "" && $1 ~ /^\*PPD-Adobe:/ {next}
-/^\*Include: *".*"$/ {
- quote = index($0, "\"")
- lastquote = length($0)
- file = substr($0, quote+1, lastquote-quote-1)
- # No support for hexadecimal substrings.
- printf "*%% Begin included file \"%s\"\n", file
- if (system("@AWK@ -f @TMP@ " file) != 0) exit 1
- printf "*%% End included file \"%s\"\n", file
- next
-}
-{print $0}
----
-
-# Create output file
-$AWK -f "$tmp" -v first=yes "$infile" > "$outfile" || \
- { rm -f "$tmp" "$outfile"; exit 1; }
-
-# Clean up
-rm -f "$tmp"
-
-exit 0
diff --git a/gs/contrib/pcl3/ppd/fonts.ppd b/gs/contrib/pcl3/ppd/fonts.ppd
deleted file mode 100644
index 668557679..000000000
--- a/gs/contrib/pcl3/ppd/fonts.ppd
+++ /dev/null
@@ -1,91 +0,0 @@
-*PPD-Adobe: "4.3"
-*% ****************************************************************************
-*% File: @(#)$Id: fonts.ppd,v 1.2 2001/03/21 12:54:15 Martin Rel $
-*% Contents: Example PPD font statements for a ghostscript installation
-*% Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-*% Germany; Martin.Lottermoser@t-online.de
-*%
-*% ****************************************************************************
-*%
-*% Copyright (C) 2001 Martin Lottermoser
-*% All rights reserved
-*%
-*% ****************************************************************************
-
-*% The following list has been derived from the gnu-gs-fonts-std-5.50.tar
-*% archive.
-*Font URWGothicL-Book: Standard "(1.05)" Standard Disk
-*Font URWGothicL-Demi: Standard "(1.05)" Standard Disk
-*Font URWGothicL-BookObli: Standard "(1.05)" Standard Disk
-*Font URWGothicL-DemiObli: Standard "(1.05)" Standard Disk
-*Font URWBookmanL-Ligh: Standard "(1.05)" Standard Disk
-*Font URWBookmanL-DemiBold: Standard "(1.05)" Standard Disk
-*Font URWBookmanL-LighItal: Standard "(1.05)" Standard Disk
-*Font URWBookmanL-DemiBoldItal: Standard "(1.05)" Standard Disk
-*Font CenturySchL-Roma: Standard "(1.05)" Standard Disk
-*Font CenturySchL-Bold: Standard "(1.05)" Standard Disk
-*Font CenturySchL-Ital: Standard "(1.05)" Standard Disk
-*Font CenturySchL-BoldItal: Standard "(1.05)" Standard Disk
-*Font Dingbats: Special "(001.005)" Unknown Disk
-*Font NimbusSanL-Regu: Standard "(1.05)" Standard Disk
-*Font NimbusSanL-Bold: Standard "(1.05)" Standard Disk
-*Font NimbusSanL-ReguItal: Standard "(1.05)" Standard Disk
-*Font NimbusSanL-BoldItal: Standard "(1.05)" Standard Disk
-*Font NimbusSanL-ReguCond: Standard "(1.05)" Standard Disk
-*Font NimbusSanL-BoldCond: Standard "(1.05)" Standard Disk
-*Font NimbusSanL-ReguCondItal: Standard "(1.05)" Standard Disk
-*Font NimbusSanL-BoldCondItal: Standard "(1.05)" Standard Disk
-*Font NimbusRomNo9L-Regu: Standard "(1.05)" Standard Disk
-*Font NimbusRomNo9L-Medi: Standard "(1.05)" Standard Disk
-*Font NimbusRomNo9L-ReguItal: Standard "(1.05)" Standard Disk
-*Font NimbusRomNo9L-MediItal: Standard "(1.05)" Standard Disk
-*Font NimbusMonL-Regu: Standard "(1.05)" Standard Disk
-*Font NimbusMonL-Bold: Standard "(1.05)" Standard Disk
-*Font NimbusMonL-ReguObli: Standard "(1.05)" Standard Disk
-*Font NimbusMonL-BoldObli: Standard "(1.05)" Standard Disk
-*Font URWPalladioL-Roma: Standard "(1.05)" Standard Disk
-*Font URWPalladioL-Bold: Standard "(1.05)" Standard Disk
-*Font URWPalladioL-Ital: Standard "(1.05)" Standard Disk
-*Font URWPalladioL-BoldItal: Standard "(1.05)" Standard Disk
-*Font StandardSymL: Special "(001.005)" Unknown Disk
-*Font URWChanceryL-MediItal: Standard "(1.05)" Standard Disk
-
-*% The following list is the same as the previous one, using standard font name
-*% substitutions from the GNU gs 5.50 Fontmap file.
-*Font AvantGarde-Book: Standard "(1.05)" Standard Disk
-*Font AvantGarde-Demi: Standard "(1.05)" Standard Disk
-*Font AvantGarde-BookObli: Standard "(1.05)" Standard Disk
-*Font AvantGarde-DemiObli: Standard "(1.05)" Standard Disk
-*Font Bookman-Light: Standard "(1.05)" Standard Disk
-*Font Bookman-Demi: Standard "(1.05)" Standard Disk
-*Font Bookman-LightItal: Standard "(1.05)" Standard Disk
-*Font Bookman-DemiItal: Standard "(1.05)" Standard Disk
-*Font NewCenturySchlbk-Roman: Standard "(1.05)" Standard Disk
-*Font NewCenturySchlbk-Bold: Standard "(1.05)" Standard Disk
-*Font NewCenturySchlbk-Italic: Standard "(1.05)" Standard Disk
-*Font NewCenturySchlbk-BoldItal: Standard "(1.05)" Standard Disk
-*Font ZapfDingbats: Special "(001.005)" Unknown Disk
-*Font Helvetica: Standard "(1.05)" Standard Disk
-*Font Helvetica-Bold: Standard "(1.05)" Standard Disk
-*Font HelveticaItal: Standard "(1.05)" Standard Disk
-*Font Helvetica-BoldItal: Standard "(1.05)" Standard Disk
-*Font HelveticaCond: Standard "(1.05)" Standard Disk
-*Font Helvetica-BoldCond: Standard "(1.05)" Standard Disk
-*Font HelveticaCondItal: Standard "(1.05)" Standard Disk
-*Font Helvetica-BoldCondItal: Standard "(1.05)" Standard Disk
-*Font Times-Roman: Standard "(1.05)" Standard Disk
-*Font Times-Bold: Standard "(1.05)" Standard Disk
-*Font Times-RomanItal: Standard "(1.05)" Standard Disk
-*Font Times-BoldItal: Standard "(1.05)" Standard Disk
-*Font Courier: Standard "(1.05)" Standard Disk
-*Font Courier-Bold: Standard "(1.05)" Standard Disk
-*Font CourierObli: Standard "(1.05)" Standard Disk
-*Font Courier-BoldObli: Standard "(1.05)" Standard Disk
-*Font Palatino-Roman: Standard "(1.05)" Standard Disk
-*Font Palatino-Bold: Standard "(1.05)" Standard Disk
-*Font Palatino-Italic: Standard "(1.05)" Standard Disk
-*Font Palatino-BoldItal: Standard "(1.05)" Standard Disk
-*Font Symbol: Special "(001.005)" Unknown Disk
-*Font ZapfChancery-MediumItalic: Standard "(1.05)" Standard Disk
-
-*% ****************************************************************************
diff --git a/gs/contrib/pcl3/ppd/gs-5.50.ppd b/gs/contrib/pcl3/ppd/gs-5.50.ppd
deleted file mode 100644
index d2b3ec53c..000000000
--- a/gs/contrib/pcl3/ppd/gs-5.50.ppd
+++ /dev/null
@@ -1,26 +0,0 @@
-*PPD-Adobe: "4.3"
-*% ****************************************************************************
-*% File: @(#)$Id: gs-5.50.ppd,v 1.1 2001/03/16 07:59:17 Martin Rel $
-*% Contents: PPD file part for GNU Ghostscript 5.50
-*% Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-*% Germany; Martin.Lottermoser@t-online.de
-*%
-*% ****************************************************************************
-*%
-*% Copyright (C) 2001 Martin Lottermoser
-*% All rights reserved
-*%
-*% ****************************************************************************
-
-*% Required general information keywords not provided in device PPD files
-*Product: "(GNU Ghostscript)"
-*PSVersion: "(3010) 550"
-
-*% For gs 5.50, unix-gcc.mak by default does not include ttfont.dev. Change
-*% "None" to "Type42" if your configuration differs:
-*TTRasterizer: None
-
-*% ****************************************************************************
-
-*% Common parts
-*Include: "gs-common.ppd"
diff --git a/gs/contrib/pcl3/ppd/gs-6.01.ppd b/gs/contrib/pcl3/ppd/gs-6.01.ppd
deleted file mode 100644
index 049654421..000000000
--- a/gs/contrib/pcl3/ppd/gs-6.01.ppd
+++ /dev/null
@@ -1,26 +0,0 @@
-*PPD-Adobe: "4.3"
-*% ****************************************************************************
-*% File: @(#)$Id: gs-6.01.ppd,v 1.1 2001/03/16 07:59:17 Martin Rel $
-*% Contents: PPD file part for Aladdin Ghostscript 6.01
-*% Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-*% Germany; Martin.Lottermoser@t-online.de
-*%
-*% ****************************************************************************
-*%
-*% Copyright (C) 2001 Martin Lottermoser
-*% All rights reserved
-*%
-*% ****************************************************************************
-
-*% Required general information keywords not provided in device PPD files
-*Product: "(Aladdin Ghostscript)"
-*PSVersion: "(3010) 601"
-
-*% For gs 6.01, unix-gcc.mak by default includes ttfont.dev. Change "Type42" to
-*% "None" if your configuration differs:
-*TTRasterizer: Type42
-
-*% ****************************************************************************
-
-*% Common parts
-*Include: "gs-common.ppd"
diff --git a/gs/contrib/pcl3/ppd/gs-6.50.ppd b/gs/contrib/pcl3/ppd/gs-6.50.ppd
deleted file mode 100644
index bedbe023c..000000000
--- a/gs/contrib/pcl3/ppd/gs-6.50.ppd
+++ /dev/null
@@ -1,26 +0,0 @@
-*PPD-Adobe: "4.3"
-*% ****************************************************************************
-*% File: @(#)$Id: gs-6.50.ppd,v 1.1 2001/03/16 07:59:17 Martin Rel $
-*% Contents: PPD file part for AFPL Ghostscript 6.50
-*% Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-*% Germany; Martin.Lottermoser@t-online.de
-*%
-*% ****************************************************************************
-*%
-*% Copyright (C) 2001 Martin Lottermoser
-*% All rights reserved
-*%
-*% ****************************************************************************
-
-*% Required general information keywords not provided in device PPD files
-*Product: "(AFPL Ghostscript)"
-*PSVersion: "(3010) 650"
-
-*% For gs 6.50, unix-gcc.mak by default includes ttfont.dev. Change "Type42" to
-*% "None" if your configuration differs:
-*TTRasterizer: Type42
-
-*% ****************************************************************************
-
-*% Common parts
-*Include: "gs-common.ppd"
diff --git a/gs/contrib/pcl3/ppd/gs-6.51.ppd b/gs/contrib/pcl3/ppd/gs-6.51.ppd
deleted file mode 100644
index 0d8c603c6..000000000
--- a/gs/contrib/pcl3/ppd/gs-6.51.ppd
+++ /dev/null
@@ -1,26 +0,0 @@
-*PPD-Adobe: "4.3"
-*% ****************************************************************************
-*% File: @(#)$Id: gs-6.51.ppd,v 1.2 2001/08/19 08:52:59 Martin Rel $
-*% Contents: PPD file part for GNU Ghostscript 6.51
-*% Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-*% Germany; Martin.Lottermoser@t-online.de
-*%
-*% ****************************************************************************
-*%
-*% Copyright (C) 2001 Martin Lottermoser
-*% All rights reserved
-*%
-*% ****************************************************************************
-
-*% Required general information keywords not provided in device PPD files
-*Product: "(GNU Ghostscript)"
-*PSVersion: "(3010) 651"
-
-*% For newer gs versions like this, unix-gcc.mak by default includes
-*% ttfont.dev. Change "Type42" to "None" if your configuration differs.
-*TTRasterizer: Type42
-
-*% ****************************************************************************
-
-*% Common parts
-*Include: "gs-common.ppd"
diff --git a/gs/contrib/pcl3/ppd/gs-7.00.ppd b/gs/contrib/pcl3/ppd/gs-7.00.ppd
deleted file mode 100644
index 53b87f20a..000000000
--- a/gs/contrib/pcl3/ppd/gs-7.00.ppd
+++ /dev/null
@@ -1,26 +0,0 @@
-*PPD-Adobe: "4.3"
-*% ****************************************************************************
-*% File: @(#)$Id: gs-7.00.ppd,v 1.1 2001/04/25 05:23:31 Martin Rel $
-*% Contents: PPD file part for AFPL Ghostscript 7.0
-*% Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-*% Germany; Martin.Lottermoser@t-online.de
-*%
-*% ****************************************************************************
-*%
-*% Copyright (C) 2001 Martin Lottermoser
-*% All rights reserved
-*%
-*% ****************************************************************************
-
-*% Required general information keywords not provided in device PPD files
-*Product: "(AFPL Ghostscript)"
-*PSVersion: "(3010) 700"
-
-*% For newer gs versions like this, unix-gcc.mak by default includes
-*% ttfont.dev. Change "Type42" to "None" if your configuration differs.
-*TTRasterizer: Type42
-
-*% ****************************************************************************
-
-*% Common parts
-*Include: "gs-common.ppd"
diff --git a/gs/contrib/pcl3/ppd/gs-common.ppd b/gs/contrib/pcl3/ppd/gs-common.ppd
deleted file mode 100644
index f5e85dd49..000000000
--- a/gs/contrib/pcl3/ppd/gs-common.ppd
+++ /dev/null
@@ -1,132 +0,0 @@
-*PPD-Adobe: "4.3"
-*% ****************************************************************************
-*% File: @(#)$Id: gs-common.ppd,v 1.3 2001/04/25 15:48:01 Martin Rel $
-*% Contents: PPD file part common to all current ghostscript versions
-*% Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-*% Germany; Martin.Lottermoser@t-online.de
-*%
-*% ****************************************************************************
-*%
-*% Copyright (C) 2001 Martin Lottermoser
-*% All rights reserved
-*%
-*% ****************************************************************************
-
-*% Capabilities (*Extensions is not needed because the language level is 3).
-*FileSystem: True
-*LanguageLevel: "3"
-
-*AccurateScreensSupport: True
-
-*% ****************************************************************************
-
-*% Fallbacks for required keywords (may be overridden in gs.ppd):
-*DefaultImageableArea: Unknown
-*% This would also be the place for "*DefaultPaperDimension: Unknown", but as
-*% CUPS, violating the PPD specification, would prefer this entry to the one in
-*% gs.ppd, I've omitted it. I'm therefore forced to assume that
-*% *DefaultImageableArea is not set in gs.ppd when using CUPS and that
-*% *DefaultPaperDimension is always set.
-
-*% ****************************************************************************
-
-*% Known media sizes. I'm assuming that the document manager has enough
-*% intelligence to obtain the "Rotated" variants from those given here.
-
-*PaperDimension A10: "74 105"
-*PaperDimension EnvC10: "79 113"
-*PaperDimension ISOB10: "88 125"
-*PaperDimension JISB10: "91 128"
-*PaperDimension A9: "105 147"
-*PaperDimension EnvC9: "113 162"
-*PaperDimension ISOB9: "125 176"
-*PaperDimension JISB9: "128 181"
-*PaperDimension A8: "147 210"
-*PaperDimension EnvC8: "162 230"
-*PaperDimension ISOB8: "176 249"
-*PaperDimension JISB8: "181 258"
-*PaperDimension A7: "210 298"
-*PaperDimension Index3x5in: "216 360"
-*PaperDimension EnvC7: "230 323"
-*PaperDimension ISOB7: "249 354"
-*PaperDimension EnvChou4: "255 581"
-*PaperDimension JISB7: "258 363"
-*PaperDimension EnvMonarch: "279 540"
-*PaperDimension Env9: "279 639"
-*PaperDimension Postcard: "283 420"
-*PaperDimension Index4x6in: "288 432"
-*PaperDimension Env10: "297 684"
-*PaperDimension Env10.Transverse: "297 684"
-*PaperDimension A6: "298 420"
-*PaperDimension A6Card: "298 420"
-*PaperDimension EnvDL: "312 624"
-*PaperDimension EnvDL.Transverse: "312 624"
-*PaperDimension EnvUS_A2: "315 414"
-*PaperDimension EnvC6: "323 459"
-*PaperDimension EnvChou3: "340 666"
-*PaperDimension ISOB6: "354 499"
-*PaperDimension Index5x8in: "360 576"
-*PaperDimension JISB6: "363 516"
-*PaperDimension Statement: "396 612"
-*PaperDimension DoublePostcard: "420 567"
-*PaperDimension A5: "420 595"
-*PaperDimension EnvC5: "459 649"
-*PaperDimension ISOB5: "499 709"
-*PaperDimension JISB5: "516 729"
-*PaperDimension Executive: "522 756"
-*PaperDimension A4: "595 842"
-*PaperDimension A4Big: "595 842"
-*PaperDimension Folio: "595 935"
-*PaperDimension Quarto: "612 780"
-*PaperDimension Letter: "612 792"
-*PaperDimension LetterBig: "612 792"
-*PaperDimension Legal: "612 1008"
-*PaperDimension EnvKaku3: "612 785"
-*PaperDimension SuperA: "643 1009"
-*PaperDimension ARCHA: "648 864"
-*PaperDimension EnvC4: "649 918"
-*PaperDimension EnvKaku2: "680 941"
-*PaperDimension ISOB4: "709 1001"
-*PaperDimension JISB4: "729 1032"
-*PaperDimension Tabloid: "792 1224"
-*PaperDimension A3: "842 1191"
-*PaperDimension ARCHB: "864 1296"
-*PaperDimension SuperB: "865 1380"
-*PaperDimension EnvC3: "918 1298"
-*PaperDimension HPSuperB: "936 1368"
-*PaperDimension ISOB3: "1001 1417"
-*PaperDimension JISB3: "1032 1460"
-*PaperDimension A2: "1191 1684"
-*PaperDimension ARCHC: "1296 1728"
-*PaperDimension EnvC2: "1298 1837"
-*PaperDimension ISOB2: "1417 2004"
-*PaperDimension JISB2: "1460 2064"
-*PaperDimension A1: "1684 2384"
-*PaperDimension ARCHD: "1728 2592"
-*PaperDimension EnvC1: "1837 2599"
-*PaperDimension ISOB1: "2004 2835"
-*PaperDimension JISB1: "2064 2920"
-*PaperDimension A0: "2384 3370"
-*PaperDimension ARCHE: "2592 3456"
-*PaperDimension EnvC0: "2599 3677"
-*PaperDimension ISOB0: "2835 4008"
-*PaperDimension JISB0: "2920 4127"
-*PaperDimension 2A0: "3370 4768"
-*PaperDimension 4A0: "4768 6741"
-
-*% ****************************************************************************
-
-*OpenUI *StrokeAdjustment/Stroke adjustment: PickOne
-*OrderDependency: 50 AnySetup *StrokeAdjustment
-*DefaultStrokeAdjustment: Default
-*% Ghostscript sets the stroke adjustment to true for low-resolution devices
-*% and to false for high-resolution ones (see gs_init.ps; the boundary is at
-*% 150 ppi).
-*StrokeAdjustment Default: ""
-*StrokeAdjustment True: "true setstrokeadjust"
-*StrokeAdjustment False: "false setstrokeadjust"
-*CloseUI *StrokeAdjustment
-
-*% One could also add an entry for the fill adjustment (a non-standard
-*% ghostscript extension to PostScript) here, but at present I don't know of a
-*% situation where that would be sufficiently useful.
diff --git a/gs/contrib/pcl3/ppd/gs-pcl3-common.ppd b/gs/contrib/pcl3/ppd/gs-pcl3-common.ppd
deleted file mode 100644
index 22b8ab984..000000000
--- a/gs/contrib/pcl3/ppd/gs-pcl3-common.ppd
+++ /dev/null
@@ -1,116 +0,0 @@
-*PPD-Adobe: "4.3"
-*% ****************************************************************************
-*% File: @(#)$Id: gs-pcl3-common.ppd,v 1.4 2001/04/10 16:36:27 Martin Rel $
-*% Contents: PPD file part common to all subdevices provided by the pcl3 driver
-*% Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-*% Germany; Martin.Lottermoser@t-online.de
-*%
-*% ****************************************************************************
-*%
-*% Copyright (C) 2001 Martin Lottermoser
-*% All rights reserved
-*%
-*% ****************************************************************************
-
-*% Required pcl3-specific keyword:
-*Manufacturer: "Martin Lottermoser"
-
-*% ****************************************************************************
-
-*% CUPS keywords independent of the subdevice
-*cupsVersion: 1.1
-*% The *cupsManualCopies statement is irrelevant for pcl3.
-*cupsFilter: "application/vnd.cups-postscript 0 cups-pcl3"
-
-*% ****************************************************************************
-
-*% Intensity rendering methods
-
-*OpenUI *eprnIntensityRendering/Intensity rendering: PickOne
-*OrderDependency: 50 AnySetup *eprnIntensityRendering
-*DefaulteprnIntensityRendering: halftones
-*eprnIntensityRendering printer: "(<<) cvx exec /IntensityRendering (printer) (>>) cvx exec setpagedevice"
-*eprnIntensityRendering halftones: "(<<) cvx exec /IntensityRendering (halftones) (>>) cvx exec setpagedevice"
-*eprnIntensityRendering Floyd-Steinberg: "(<<) cvx exec /IntensityRendering (Floyd-Steinberg) (>>) cvx exec setpagedevice"
-*CloseUI *eprnIntensityRendering
-
-*% ============================================================================
-
-*% Print quality
-
-*OpenUI *OutputMode/Print quality: PickOne
-*DefaultOutputMode: Normal
-*OrderDependency: 50 AnySetup *OutputMode
-*OutputMode Draft: "(<<) cvx exec /PrintQuality (draft) (>>) cvx exec setpagedevice"
-*OutputMode Normal: "(<<) cvx exec /PrintQuality (normal) (>>) cvx exec setpagedevice"
-*OutputMode Presentation: "(<<) cvx exec /PrintQuality (presentation) (>>) cvx exec setpagedevice"
-*CloseUI *OutputMode
-
-*% Media type (reduced list)
-*% The use of the *MediaType keyword for this property is a concession to CUPS.
-*% In my opinion it is wrong: *MediaType has the same meaning as the "MediaType"
-*% page device parameter and is therefore intended for influencing the media
-*% selection process. In agreement with that the PPD specification explicitly
-*% states that this "method usually requires prior device setup", i.e.,
-*% configuration of "InputAttributes". Read the discussion on selection and
-*% configuration parameters in notes.tex in the pcl3 distribution for further
-*% remarks.
-*% If you have a document manager with correct behaviour, rename the *MediaType
-*% statements into *pcl3Medium statements.
-
-*OpenUI *MediaType: PickOne
-*DefaultMediaType: plain
-*OrderDependency: 50 AnySetup *MediaType
-*MediaType plain/plain paper: "(<<) cvx exec /Medium (plain paper) (>>) cvx exec setpagedevice"
-*MediaType bond/bond paper: "(<<) cvx exec /Medium (bond paper) (>>) cvx exec setpagedevice"
-*MediaType Premium/HP Premium paper: "(<<) cvx exec /Medium (HP Premium paper) (>>) cvx exec setpagedevice"
-*MediaType glossy/glossy paper: "(<<) cvx exec /Medium (glossy paper) (>>) cvx exec setpagedevice"
-*MediaType transparency/transparency film: "(<<) cvx exec /Medium (transparency film) (>>) cvx exec setpagedevice"
-*CloseUI *MediaType
-
-*% ****************************************************************************
-
-*% Input slots
-
-*OpenUI *InputSlot: PickOne
-*OrderDependency: 50 AnySetup *InputSlot
-*DefaultInputSlot: Cassette
-*InputSlot Cassette/Default tray: ""
-*InputSlot ManualFeed: "(<<) cvx exec /ManualFeed true (>>) cvx exec setpagedevice"
-*% All other input slots require that there is a corresponding entry in
-*% "InputAttributes" or the request for the slot will be ignored. Hence these
-*% slots are not made known here even for printers where they are known to
-*% exist.
-*%
-*% If your printer has these media sources *and* you have configured
-*% "InputAttributes" appropriately, copy the complete "*InputSlot" entry to
-*% your local customization file and remove the comment prefix in the lines
-*% needed. (If you're using CUPS, you must edit this section here or delete it,
-*% but you should do it in the concatenated file for your printer's model.)
-*% In particular for the envelope feed, you should then also add constraints
-*% between this slot and all non-envelope page sizes. The banner slot
-*% (continuous feed) will be protected by pcl3 against size mismatches but
-*% you might also add constraints for all unsupported sizes (which usually
-*% means every size except A4 and Letter).
-*%
-*% *InputSlot ContinuousFeed/Continuous feed: "(<<) cvx exec
-*% /InputAttributes (<<) cvx exec /Priority [-1] (>>) cvx exec
-*% (>>) cvx exec setpagedevice"
-*% *End
-*% *InputSlot Envelope: "(<<) cvx exec
-*% /InputAttributes (<<) cvx exec /Priority [3] (>>) cvx exec
-*% (>>) cvx exec setpagedevice"
-*% *End
-*% *InputSlot DesktopCSF/Desktop CSF: "(<<) cvx exec
-*% /InputAttributes (<<) cvx exec /Priority [4] (>>) cvx exec
-*% (>>) cvx exec setpagedevice"
-*% *End
-*%
-*CloseUI *InputSlot
-
-*% pcl3 is not capable of sensing the media size in an input slot:
-*RequiresPageRegion All: True
-
-*% ****************************************************************************
-
-*Include: "gs.ppd"
diff --git a/gs/contrib/pcl3/ppd/gs-pcl3-hpdj1120c.ppd b/gs/contrib/pcl3/ppd/gs-pcl3-hpdj1120c.ppd
deleted file mode 100644
index 7b33ac2de..000000000
--- a/gs/contrib/pcl3/ppd/gs-pcl3-hpdj1120c.ppd
+++ /dev/null
@@ -1,264 +0,0 @@
-*PPD-Adobe: "4.3"
-*% ****************************************************************************
-*% File: @(#)$Id: gs-pcl3-hpdj1120c.ppd,v 1.6 2001/08/19 09:13:23 Martin Rel $
-*% Contents: PPD file for the ghostscript device "hpdj1120c" of the pcl3 driver
-*% Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-*% Germany, Martin.Lottermoser@t-online.de
-*%
-*% ****************************************************************************
-*%
-*% Copyright (C) 2001 Martin Lottermoser
-*% All rights reserved
-*%
-*% ****************************************************************************
-
-*% Required general information keywords
-
-*FileVersion: "1.1"
-*FormatVersion: "4.3"
-*LanguageEncoding: ISOLatin1
-*LanguageVersion: English
-*ModelName: "ghostscript/pcl3/hpdj1120c"
-*ShortNickName: "ghostscript/pcl3/hpdj1120c"
-*NickName: "ghostscript/pcl3/hpdj1120c"
-*PCFileName: "HPDJ1120.PPD"
-
-*% *Product, *PSVersion and *Manufacturer are assumed to be included via
-*% gs-pcl3-common.ppd.
-
-*% ****************************************************************************
-
-*% Device selection
-*GhostscriptOptions: "-sDEVICE=hpdj1120c"
-
-*% ****************************************************************************
-
-*% Rendering capabilities
-
-*ColorDevice: True
-
-*OpenUI *ColorModel: PickOne
-*OrderDependency: 20 AnySetup *ColorModel
-*DefaultColorModel: Gray
-*ColorModel Gray: "(<<) cvx exec /ColourModel (Gray) (>>) cvx exec setpagedevice"
-*ColorModel CMY: "(<<) cvx exec /ColourModel (CMY) (>>) cvx exec setpagedevice"
-*ColorModel CMY+K: "(<<) cvx exec /ColourModel (CMY+K) (>>) cvx exec setpagedevice"
-*ColorModel CMYK: "(<<) cvx exec /ColourModel (CMYK) (>>) cvx exec setpagedevice"
-*CloseUI *ColorModel
-
-*OpenUI *Resolution: PickOne
-*OrderDependency: 50 AnySetup *Resolution
-*DefaultResolution: 300dpi
-*Resolution 75dpi: "(<<) cvx exec /HWResolution [75 75] (>>) cvx exec setpagedevice"
-*Resolution 150dpi: "(<<) cvx exec /HWResolution [150 150] (>>) cvx exec setpagedevice"
-*Resolution 300dpi: "(<<) cvx exec /HWResolution [300 300] (>>) cvx exec setpagedevice"
-*Resolution 600dpi: "(<<) cvx exec /HWResolution [600 600] (>>) cvx exec setpagedevice"
-*CloseUI *Resolution
-
-*OpenUI *pcl3IntensityLevels/Intensity levels: PickOne
-*OrderDependency: 50 AnySetup *pcl3IntensityLevels
-*Defaultpcl3IntensityLevels: Automatic
-*pcl3IntensityLevels Automatic: ""
-*pcl3IntensityLevels K4/black 4: "(<<) cvx exec /BlackLevels 4 (>>) cvx exec setpagedevice"
-*pcl3IntensityLevels K4C3/black 4, CMY 3: "(<<) cvx exec /BlackLevels 4 /CMYLevels 3 (>>) cvx exec setpagedevice"
-*pcl3IntensityLevels K4C4/black 4, CMY 4: "(<<) cvx exec /BlackLevels 4 /CMYLevels 4 (>>) cvx exec setpagedevice"
-*CloseUI *pcl3IntensityLevels
-
-*% ============================================================================
-
-*% Constraints (exclusions) between rendering parameters
-
-*UIConstraints: *ColorModel CMY *Resolution 600dpi
-*UIConstraints: *Resolution 600dpi *ColorModel CMY
-*UIConstraints: *ColorModel CMY+K *Resolution 600dpi
-*UIConstraints: *Resolution 600dpi *ColorModel CMY+K
-*UIConstraints: *ColorModel CMYK *Resolution 600dpi
-*UIConstraints: *Resolution 600dpi *ColorModel CMYK
-
-*UIConstraints: *ColorModel Gray *pcl3IntensityLevels K4C3
-*UIConstraints: *pcl3IntensityLevels K4C3 *ColorModel Gray
-*UIConstraints: *ColorModel Gray *pcl3IntensityLevels K4C4
-*UIConstraints: *pcl3IntensityLevels K4C4 *ColorModel Gray
-*UIConstraints: *ColorModel CMY *pcl3IntensityLevels K4
-*UIConstraints: *pcl3IntensityLevels K4 *ColorModel CMY
-*UIConstraints: *ColorModel CMY *pcl3IntensityLevels K4C3
-*UIConstraints: *pcl3IntensityLevels K4C3 *ColorModel CMY
-*UIConstraints: *ColorModel CMY *pcl3IntensityLevels K4C4
-*UIConstraints: *pcl3IntensityLevels K4C4 *ColorModel CMY
-*UIConstraints: *ColorModel CMY+K *pcl3IntensityLevels K4
-*UIConstraints: *pcl3IntensityLevels K4 *ColorModel CMY+K
-*UIConstraints: *ColorModel CMYK *pcl3IntensityLevels K4
-*UIConstraints: *pcl3IntensityLevels K4 *ColorModel CMYK
-
-*UIConstraints: *Resolution 75dpi *pcl3IntensityLevels K4
-*UIConstraints: *pcl3IntensityLevels K4 *Resolution 75dpi
-*UIConstraints: *Resolution 75dpi *pcl3IntensityLevels K4C3
-*UIConstraints: *pcl3IntensityLevels K4C3 *Resolution 75dpi
-*UIConstraints: *Resolution 75dpi *pcl3IntensityLevels K4C4
-*UIConstraints: *pcl3IntensityLevels K4C4 *Resolution 75dpi
-*UIConstraints: *Resolution 150dpi *pcl3IntensityLevels K4
-*UIConstraints: *pcl3IntensityLevels K4 *Resolution 150dpi
-*UIConstraints: *Resolution 150dpi *pcl3IntensityLevels K4C3
-*UIConstraints: *pcl3IntensityLevels K4C3 *Resolution 150dpi
-*UIConstraints: *Resolution 150dpi *pcl3IntensityLevels K4C4
-*UIConstraints: *pcl3IntensityLevels K4C4 *Resolution 150dpi
-*UIConstraints: *Resolution 600dpi *pcl3IntensityLevels K4
-*UIConstraints: *pcl3IntensityLevels K4 *Resolution 600dpi
-*UIConstraints: *Resolution 600dpi *pcl3IntensityLevels K4C3
-*UIConstraints: *pcl3IntensityLevels K4C3 *Resolution 600dpi
-*UIConstraints: *Resolution 600dpi *pcl3IntensityLevels K4C4
-*UIConstraints: *pcl3IntensityLevels K4C4 *Resolution 600dpi
-
-*% More than two intensity levels are not possible with draft quality:
-*UIConstraints: *OutputMode Draft *pcl3IntensityLevels K4
-*UIConstraints: *pcl3IntensityLevels K4 *OutputMode Draft
-*UIConstraints: *OutputMode Draft *pcl3IntensityLevels K4C3
-*UIConstraints: *pcl3IntensityLevels K4C3 *OutputMode Draft
-*UIConstraints: *OutputMode Draft *pcl3IntensityLevels K4C4
-*UIConstraints: *pcl3IntensityLevels K4C4 *OutputMode Draft
-
-*% ****************************************************************************
-
-*% Information on page sizes
-
-*OpenUI *PageSize: PickOne
-*OrderDependency: 50 AnySetup *PageSize
-*DefaultPageSize: Unknown
-*PageSize Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageSize Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageSize Tabloid: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice 11x17"
-*PageSize Statement: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice halfletter"
-*PageSize HPSuperB: "(<<) cvx exec /PageSize [936 1368] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize A6: "(<<) cvx exec /PageSize [298 420] /ImagingBBox null /UseCard false (>>) cvx exec setpagedevice"
-*PageSize A5: "(<<) cvx exec /PageSize [420 595] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageSize A3: "(<<) cvx exec /PageSize [842 1191] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize JISB5: "(<<) cvx exec /PageSize [516 729] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize JISB4: "(<<) cvx exec /PageSize [729 1032] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Postcard: "(<<) cvx exec /PageSize [283 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize A6Card: "(<<) cvx exec /PageSize [298 420] /ImagingBBox null /UseCard true (>>) cvx exec setpagedevice"
-*PageSize Index4x6in: "(<<) cvx exec /PageSize [288 432] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Index5x8in: "(<<) cvx exec /PageSize [360 576] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Env10: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize EnvDL: "(<<) cvx exec /PageSize [312 624] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize EnvC6: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice c6"
-*PageSize EnvUS_A2/US A2 envelope: "(<<) cvx exec /PageSize [315 414] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize EnvChou3: "(<<) cvx exec /PageSize [340 666] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize EnvChou4: "(<<) cvx exec /PageSize [255 581] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize EnvKaku2: "(<<) cvx exec /PageSize [680 941] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize LetterBig: "(<<) cvx exec
- /PageSize [612 792] /ImagingBBox null
- /InputAttributes (<<) cvx exec /Priority [-1] (>>) cvx exec
- (>>) cvx exec setpagedevice"
-*End
-*PageSize A4Big: "(<<) cvx exec
- /PageSize [595 842] /ImagingBBox null
- /InputAttributes (<<) cvx exec /Priority [-1] (>>) cvx exec
- (>>) cvx exec setpagedevice"
-*End
-*?PageSize: "save /PageSizeQuery /ProcSet resourcestatus
- { pop pop /PageSizeQuery /ProcSet findresource begin query end }
- { (Unknown) }
- ifelse
- = flush restore"
-*End
-*CloseUI *PageSize
-
-*OpenUI *PageRegion: PickOne
-*OrderDependency: 50 AnySetup *PageRegion
-*DefaultPageRegion: Unknown
-*PageRegion Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageRegion Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageRegion Tabloid: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice 11x17"
-*PageRegion Statement: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice halfletter"
-*PageRegion HPSuperB: "(<<) cvx exec /PageSize [936 1368] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion A6: "(<<) cvx exec /PageSize [298 420] /ImagingBBox null /UseCard false (>>) cvx exec setpagedevice"
-*PageRegion A5: "(<<) cvx exec /PageSize [420 595] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageRegion A3: "(<<) cvx exec /PageSize [842 1191] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion JISB5: "(<<) cvx exec /PageSize [516 729] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion JISB4: "(<<) cvx exec /PageSize [729 1032] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Postcard: "(<<) cvx exec /PageSize [283 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion A6Card: "(<<) cvx exec /PageSize [298 420] /ImagingBBox null /UseCard true (>>) cvx exec setpagedevice"
-*PageRegion Index4x6in: "(<<) cvx exec /PageSize [288 432] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Index5x8in: "(<<) cvx exec /PageSize [360 576] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Env10: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion EnvDL: "(<<) cvx exec /PageSize [312 624] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion EnvC6: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice c6"
-*PageRegion EnvUS_A2/US A2 envelope: "(<<) cvx exec /PageSize [315 414] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion EnvChou3: "(<<) cvx exec /PageSize [340 666] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion EnvChou4: "(<<) cvx exec /PageSize [255 581] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion EnvKaku2: "(<<) cvx exec /PageSize [680 941] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion LetterBig: "(<<) cvx exec
- /PageSize [612 792] /ImagingBBox null
- /InputAttributes (<<) cvx exec /Priority [-1] (>>) cvx exec
- (>>) cvx exec setpagedevice"
-*End
-*PageRegion A4Big: "(<<) cvx exec
- /PageSize [595 842] /ImagingBBox null
- /InputAttributes (<<) cvx exec /Priority [-1] (>>) cvx exec
- (>>) cvx exec setpagedevice"
-*End
-*CloseUI *PageRegion
-
-*% The *DefaultImageableArea keyword is assumed to be found somewhere else.
-*ImageableArea Executive: "18 34 504 747"
-*ImageableArea Letter: "18 34 594 783"
-*ImageableArea Legal: "18 34 594 999"
-*ImageableArea Tabloid: "15 34 777 1215"
-*ImageableArea Statement: "15 34 381 603"
-*ImageableArea HPSuperB: "15 34 921 1359"
-*ImageableArea A6: "9 34 288 410"
-*ImageableArea A5: "9 34 410 586"
-*ImageableArea A4: "15 34 580 833"
-*ImageableArea A3: "15 34 827 1181"
-*ImageableArea JISB5: "9 34 506 719"
-*ImageableArea JISB4: "15 34 714 1023"
-*ImageableArea Postcard: "9 34 274 410"
-*ImageableArea A6Card: "9 34 288 410"
-*ImageableArea Index4x6in: "9 34 279 423"
-*ImageableArea Index5x8in: "9 34 351 567"
-*ImageableArea Env10: "9 34 288 675"
-*ImageableArea EnvDL: "9 34 302 614"
-*ImageableArea EnvC6: "9 34 314 450"
-*ImageableArea EnvUS_A2: "9 34 306 405"
-*ImageableArea EnvChou3: "9 34 331 657"
-*ImageableArea EnvChou4: "9 34 246 572"
-*ImageableArea EnvKaku2: "15 34 665 932"
-*ImageableArea LetterBig: "18 0 594 789"
-*ImageableArea A4Big: "10 0 585 839"
-
-*% ============================================================================
-
-*% Custom page size information
-
-*LeadingEdge Short: ""
-*DefaultLeadingEdge: Short
-
-*MaxMediaWidth: "936"
-*MaxMediaHeight: "1368"
-*ParamCustomPageSize Width: 2 points 255.118 936
-*ParamCustomPageSize Height: 3 points 413.858 1368
-*ParamCustomPageSize WidthOffset: 4 points 0 0
-*ParamCustomPageSize HeightOffset: 5 points 0 0
-*ParamCustomPageSize Orientation: 1 int 0 3
-*HWMargins: 9 34 9 9
-*CustomPageSize True: "
- pop pop
- 2 index 2 mod 0 eq {exch} if
- 1 index 1 index gt {2}{3} ifelse
- 4 -1 roll add 4 mod
- (<<) cvx exec /PageSize [ 6 -2 roll ]
- /LeadingEdge 5 -1 roll
- % This works only if the interpreter passes this parameter to the device.
- % Ghostscript's setpagedevice definition does not do this by default.
- /ImagingBBox null (>>) cvx exec setpagedevice"
-*End
-*NonUIOrderDependency: 50 AnySetup *CustomPageSize True
-
-*% ****************************************************************************
-
-*% Common parts:
-*Include: "gs-pcl3-common.ppd"
diff --git a/gs/contrib/pcl3/ppd/gs-pcl3-hpdj3xx.ppd b/gs/contrib/pcl3/ppd/gs-pcl3-hpdj3xx.ppd
deleted file mode 100644
index 66c2751c8..000000000
--- a/gs/contrib/pcl3/ppd/gs-pcl3-hpdj3xx.ppd
+++ /dev/null
@@ -1,96 +0,0 @@
-*PPD-Adobe: "4.3"
-*% ****************************************************************************
-*% File: @(#)$Id: gs-pcl3-hpdj3xx.ppd,v 1.2 2001/03/23 15:50:13 Martin Rel $
-*% Contents: PPD file for the ghostscript devices "hpdj310", "hpdj320" and
-*% "hpdj340" of the pcl3 driver
-*% Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-*% Germany, Martin.Lottermoser@t-online.de
-*%
-*% ****************************************************************************
-*%
-*% Copyright (C) 2001 Martin Lottermoser
-*% All rights reserved
-*%
-*% ****************************************************************************
-
-*% Required general information keywords
-
-*FileVersion: "1.0"
-*FormatVersion: "4.3"
-*LanguageEncoding: ISOLatin1
-*LanguageVersion: English
-*ModelName: "ghostscript/pcl3/hpdj310, hpdj320 and hpdj340"
-*ShortNickName: "ghostscript/pcl3/hpdj3xx"
-*NickName: "ghostscript/pcl3/hpdj310, hpdj320 or hpdj340"
-*PCFileName: "HPDJ_3XX.PPD"
-
-*% *Product, *PSVersion and *Manufacturer are assumed to be included via
-*% gs-pcl3-common.ppd.
-
-*% ****************************************************************************
-
-*% Device selection
-*GhostscriptOptions: "-sDEVICE=hpdj310"
-
-*% ****************************************************************************
-
-*% Rendering capabilities
-
-*ColorDevice: True
-
-*OpenUI *ColorModel: PickOne
-*OrderDependency: 20 AnySetup *ColorModel
-*DefaultColorModel: Gray
-*ColorModel Gray: "(<<) cvx exec /ColourModel (Gray) (>>) cvx exec setpagedevice"
-*ColorModel CMY: "(<<) cvx exec /ColourModel (CMY) (>>) cvx exec setpagedevice"
-*CloseUI *ColorModel
-
-*OpenUI *Resolution: PickOne
-*OrderDependency: 50 AnySetup *Resolution
-*DefaultResolution: 300dpi
-*Resolution 75dpi: "(<<) cvx exec /HWResolution [75 75] (>>) cvx exec setpagedevice"
-*Resolution 100dpi: "(<<) cvx exec /HWResolution [100 100] (>>) cvx exec setpagedevice"
-*Resolution 150dpi: "(<<) cvx exec /HWResolution [150 150] (>>) cvx exec setpagedevice"
-*Resolution 300dpi: "(<<) cvx exec /HWResolution [300 300] (>>) cvx exec setpagedevice"
-*CloseUI *Resolution
-
-*% ****************************************************************************
-
-*% Information on page sizes
-
-*OpenUI *PageSize: PickOne
-*OrderDependency: 50 AnySetup *PageSize
-*DefaultPageSize: Unknown
-*PageSize Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageSize Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageSize A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageSize Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*?PageSize: "save /PageSizeQuery /ProcSet resourcestatus
- { pop pop /PageSizeQuery /ProcSet findresource begin query end }
- { (Unknown) }
- ifelse
- = flush restore"
-*End
-*CloseUI *PageSize
-
-*OpenUI *PageRegion: PickOne
-*OrderDependency: 50 AnySetup *PageRegion
-*DefaultPageRegion: Unknown
-*PageRegion Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageRegion Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageRegion A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageRegion Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*CloseUI *PageRegion
-
-*% The *DefaultImageableArea keyword is assumed to be found somewhere else.
-*% The bottom margins are smaller than indicated when using the
-*% process colour model Gray.
-*ImageableArea Letter: "18 41 594 784"
-*ImageableArea Legal: "18 41 594 1000"
-*ImageableArea A4: "9 41 584 834"
-*ImageableArea Executive: "18 41 504 748"
-
-*% ****************************************************************************
-
-*% Common parts:
-*Include: "gs-pcl3-common.ppd"
diff --git a/gs/contrib/pcl3/ppd/gs-pcl3-hpdj400.ppd b/gs/contrib/pcl3/ppd/gs-pcl3-hpdj400.ppd
deleted file mode 100644
index 53d970e83..000000000
--- a/gs/contrib/pcl3/ppd/gs-pcl3-hpdj400.ppd
+++ /dev/null
@@ -1,102 +0,0 @@
-*PPD-Adobe: "4.3"
-*% ****************************************************************************
-*% File: @(#)$Id: gs-pcl3-hpdj400.ppd,v 1.2 2001/03/23 15:50:13 Martin Rel $
-*% Contents: PPD file for the ghostscript device "hpdj400" of the pcl3 driver
-*% Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-*% Germany, Martin.Lottermoser@t-online.de
-*%
-*% ****************************************************************************
-*%
-*% Copyright (C) 2001 Martin Lottermoser
-*% All rights reserved
-*%
-*% ****************************************************************************
-
-*% Required general information keywords
-
-*FileVersion: "1.0"
-*FormatVersion: "4.3"
-*LanguageEncoding: ISOLatin1
-*LanguageVersion: English
-*ModelName: "ghostscript/pcl3/hpdj400"
-*ShortNickName: "ghostscript/pcl3/hpdj400"
-*NickName: "ghostscript/pcl3/hpdj400"
-*PCFileName: "HPDJ_400.PPD"
-
-*% *Product, *PSVersion and *Manufacturer are assumed to be included via
-*% gs-pcl3-common.ppd.
-
-*% ****************************************************************************
-
-*% Device selection
-*GhostscriptOptions: "-sDEVICE=hpdj400"
-
-*% ****************************************************************************
-
-*% Rendering capabilities
-
-*ColorDevice: True
-
-*OpenUI *ColorModel: PickOne
-*OrderDependency: 20 AnySetup *ColorModel
-*DefaultColorModel: Gray
-*ColorModel Gray: "(<<) cvx exec /ColourModel (Gray) (>>) cvx exec setpagedevice"
-*ColorModel CMY: "(<<) cvx exec /ColourModel (CMY) (>>) cvx exec setpagedevice"
-*CloseUI *ColorModel
-
-*OpenUI *Resolution: PickOne
-*OrderDependency: 50 AnySetup *Resolution
-*DefaultResolution: 300dpi
-*Resolution 75dpi: "(<<) cvx exec /HWResolution [75 75] (>>) cvx exec setpagedevice"
-*Resolution 100dpi: "(<<) cvx exec /HWResolution [100 100] (>>) cvx exec setpagedevice"
-*Resolution 150dpi: "(<<) cvx exec /HWResolution [150 150] (>>) cvx exec setpagedevice"
-*Resolution 300dpi: "(<<) cvx exec /HWResolution [300 300] (>>) cvx exec setpagedevice"
-*CloseUI *Resolution
-
-*% ****************************************************************************
-
-*% Information on page sizes
-
-*OpenUI *PageSize: PickOne
-*OrderDependency: 50 AnySetup *PageSize
-*DefaultPageSize: Unknown
-*PageSize Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageSize Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageSize A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageSize Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize JISB5: "(<<) cvx exec /PageSize [516 729] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Env10.Transverse: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize EnvDL.Transverse: "(<<) cvx exec /PageSize [312 624] /ImagingBBox null (>>) cvx exec setpagedevice"
-*?PageSize: "save /PageSizeQuery /ProcSet resourcestatus
- { pop pop /PageSizeQuery /ProcSet findresource begin query end }
- { (Unknown) }
- ifelse
- = flush restore"
-*End
-*CloseUI *PageSize
-
-*OpenUI *PageRegion: PickOne
-*OrderDependency: 50 AnySetup *PageRegion
-*DefaultPageRegion: Unknown
-*PageRegion Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageRegion Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageRegion A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageRegion Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion JISB5: "(<<) cvx exec /PageSize [516 729] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Env10.Transverse: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion EnvDL.Transverse: "(<<) cvx exec /PageSize [312 624] /ImagingBBox null (>>) cvx exec setpagedevice"
-*CloseUI *PageRegion
-
-*% The *DefaultImageableArea keyword is assumed to be found somewhere else.
-*ImageableArea Letter: "18 31 594 786"
-*ImageableArea Legal: "18 31 594 1002"
-*ImageableArea A4: "9 31 585 836"
-*ImageableArea Executive: "18 31 504 750"
-*ImageableArea JISB5: "9 31 506 722"
-*ImageableArea Env10.Transverse: "6 9 266 678"
-*ImageableArea EnvDL.Transverse: "6 9 281 615"
-
-*% ****************************************************************************
-
-*% Common parts:
-*Include: "gs-pcl3-common.ppd"
diff --git a/gs/contrib/pcl3/ppd/gs-pcl3-hpdj500.ppd b/gs/contrib/pcl3/ppd/gs-pcl3-hpdj500.ppd
deleted file mode 100644
index b1785d678..000000000
--- a/gs/contrib/pcl3/ppd/gs-pcl3-hpdj500.ppd
+++ /dev/null
@@ -1,88 +0,0 @@
-*PPD-Adobe: "4.3"
-*% ****************************************************************************
-*% File: @(#)$Id: gs-pcl3-hpdj500.ppd,v 1.2 2001/03/23 15:51:02 Martin Rel $
-*% Contents: PPD file for the ghostscript (sub-) devices "hpdj", "hpdjplus"
-*% and "hpdj500" of the pcl3 driver
-*% Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-*% Germany, Martin.Lottermoser@t-online.de
-*%
-*% ****************************************************************************
-*%
-*% Copyright (C) 2001 Martin Lottermoser
-*% All rights reserved
-*%
-*% ****************************************************************************
-
-*% Required general information keywords
-
-*FileVersion: "1.0"
-*FormatVersion: "4.3"
-*LanguageEncoding: ISOLatin1
-*LanguageVersion: English
-*ModelName: "ghostscript/pcl3/hpdj, hpdjplus and hpdj500"
-*ShortNickName: "ghostscript/pcl3/hpdj500"
-*NickName: "ghostscript/pcl3/hpdj, hpdjplus or hpdj500"
-*PCFileName: "HPDJ_500.PPD"
-
-*% *Product, *PSVersion and *Manufacturer are assumed to be included via
-*% gs-pcl3-common.ppd.
-
-*% ****************************************************************************
-
-*% Device selection
-*GhostscriptOptions: "-sDEVICE=hpdj500"
-
-*% ****************************************************************************
-
-*% Rendering capabilities
-
-*ColorDevice: False
-*DefaultColorModel: Gray
-
-*OpenUI *Resolution: PickOne
-*OrderDependency: 50 AnySetup *Resolution
-*DefaultResolution: 300dpi
-*Resolution 75dpi: "(<<) cvx exec /HWResolution [75 75] (>>) cvx exec setpagedevice"
-*Resolution 100dpi: "(<<) cvx exec /HWResolution [100 100] (>>) cvx exec setpagedevice"
-*Resolution 150dpi: "(<<) cvx exec /HWResolution [150 150] (>>) cvx exec setpagedevice"
-*Resolution 300dpi: "(<<) cvx exec /HWResolution [300 300] (>>) cvx exec setpagedevice"
-*CloseUI *Resolution
-
-*% ****************************************************************************
-
-*% Information on page sizes
-
-*OpenUI *PageSize: PickOne
-*OrderDependency: 50 AnySetup *PageSize
-*DefaultPageSize: Unknown
-*PageSize Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageSize Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageSize A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageSize Env10.Transverse: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*?PageSize: "save /PageSizeQuery /ProcSet resourcestatus
- { pop pop /PageSizeQuery /ProcSet findresource begin query end }
- { (Unknown) }
- ifelse
- = flush restore"
-*End
-*CloseUI *PageSize
-
-*OpenUI *PageRegion: PickOne
-*OrderDependency: 50 AnySetup *PageRegion
-*DefaultPageRegion: Unknown
-*PageRegion Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageRegion Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageRegion A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageRegion Env10.Transverse: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*CloseUI *PageRegion
-
-*% The *DefaultImageableArea keyword is assumed to be found somewhere else.
-*ImageableArea Letter: "18 42 594 784"
-*ImageableArea Legal: "18 42 594 1000"
-*ImageableArea A4: "9 42 585 834"
-*ImageableArea Env10.Transverse: "8 54 255 630"
-
-*% ****************************************************************************
-
-*% Common parts:
-*Include: "gs-pcl3-common.ppd"
diff --git a/gs/contrib/pcl3/ppd/gs-pcl3-hpdj500c.ppd b/gs/contrib/pcl3/ppd/gs-pcl3-hpdj500c.ppd
deleted file mode 100644
index b450bd69c..000000000
--- a/gs/contrib/pcl3/ppd/gs-pcl3-hpdj500c.ppd
+++ /dev/null
@@ -1,95 +0,0 @@
-*PPD-Adobe: "4.3"
-*% ****************************************************************************
-*% File: @(#)$Id: gs-pcl3-hpdj500c.ppd,v 1.2 2001/03/23 15:50:13 Martin Rel $
-*% Contents: PPD file for the ghostscript device "hpdj500c" of the pcl3 driver
-*% Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-*% Germany, Martin.Lottermoser@t-online.de
-*%
-*% ****************************************************************************
-*%
-*% Copyright (C) 2001 Martin Lottermoser
-*% All rights reserved
-*%
-*% ****************************************************************************
-
-*% Required general information keywords
-
-*FileVersion: "1.0"
-*FormatVersion: "4.3"
-*LanguageEncoding: ISOLatin1
-*LanguageVersion: English
-*ModelName: "ghostscript/pcl3/hpdj500c"
-*ShortNickName: "ghostscript/pcl3/hpdj500c"
-*NickName: "ghostscript/pcl3/hpdj500c"
-*PCFileName: "HPDJ500C.PPD"
-
-*% *Product, *PSVersion and *Manufacturer are assumed to be included via
-*% gs-pcl3-common.ppd.
-
-*% ****************************************************************************
-
-*% Device selection
-*GhostscriptOptions: "-sDEVICE=hpdj500c"
-
-*% ****************************************************************************
-
-*% Rendering capabilities
-
-*ColorDevice: True
-
-*OpenUI *ColorModel: PickOne
-*OrderDependency: 20 AnySetup *ColorModel
-*DefaultColorModel: Gray
-*ColorModel Gray: "(<<) cvx exec /ColourModel (Gray) (>>) cvx exec setpagedevice"
-*ColorModel CMY: "(<<) cvx exec /ColourModel (CMY) (>>) cvx exec setpagedevice"
-*CloseUI *ColorModel
-
-*OpenUI *Resolution: PickOne
-*OrderDependency: 50 AnySetup *Resolution
-*DefaultResolution: 300dpi
-*Resolution 75dpi: "(<<) cvx exec /HWResolution [75 75] (>>) cvx exec setpagedevice"
-*Resolution 100dpi: "(<<) cvx exec /HWResolution [100 100] (>>) cvx exec setpagedevice"
-*Resolution 150dpi: "(<<) cvx exec /HWResolution [150 150] (>>) cvx exec setpagedevice"
-*Resolution 300dpi: "(<<) cvx exec /HWResolution [300 300] (>>) cvx exec setpagedevice"
-*CloseUI *Resolution
-
-*% ****************************************************************************
-
-*% Information on page sizes
-
-*OpenUI *PageSize: PickOne
-*OrderDependency: 50 AnySetup *PageSize
-*DefaultPageSize: Unknown
-*PageSize Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageSize Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageSize A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageSize Env10.Transverse: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*?PageSize: "save /PageSizeQuery /ProcSet resourcestatus
- { pop pop /PageSizeQuery /ProcSet findresource begin query end }
- { (Unknown) }
- ifelse
- = flush restore"
-*End
-*CloseUI *PageSize
-
-*OpenUI *PageRegion: PickOne
-*OrderDependency: 50 AnySetup *PageRegion
-*DefaultPageRegion: Unknown
-*PageRegion Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageRegion Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageRegion A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageRegion Env10.Transverse: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*CloseUI *PageRegion
-
-*% The *DefaultImageableArea keyword is assumed to be found somewhere else.
-*% The bottom margins are smaller than indicated when using the
-*% process colour model Gray.
-*ImageableArea Letter: "18 42 594 784"
-*ImageableArea Legal: "18 42 594 1000"
-*ImageableArea A4: "9 42 585 834"
-*ImageableArea Env10.Transverse: "8 54 255 630"
-
-*% ****************************************************************************
-
-*% Common parts:
-*Include: "gs-pcl3-common.ppd"
diff --git a/gs/contrib/pcl3/ppd/gs-pcl3-hpdj510.ppd b/gs/contrib/pcl3/ppd/gs-pcl3-hpdj510.ppd
deleted file mode 100644
index 1bdea3aa9..000000000
--- a/gs/contrib/pcl3/ppd/gs-pcl3-hpdj510.ppd
+++ /dev/null
@@ -1,94 +0,0 @@
-*PPD-Adobe: "4.3"
-*% ****************************************************************************
-*% File: @(#)$Id: gs-pcl3-hpdj510.ppd,v 1.2 2001/03/23 15:51:02 Martin Rel $
-*% Contents: PPD file for the ghostscript devices "hpdj510" and "hpdj520" of
-*% the pcl3 driver
-*% Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-*% Germany, Martin.Lottermoser@t-online.de
-*%
-*% ****************************************************************************
-*%
-*% Copyright (C) 2001 Martin Lottermoser
-*% All rights reserved
-*%
-*% ****************************************************************************
-
-*% Required general information keywords
-
-*FileVersion: "1.0"
-*FormatVersion: "4.3"
-*LanguageEncoding: ISOLatin1
-*LanguageVersion: English
-*ModelName: "ghostscript/pcl3/hpdj510 and hpdj520"
-*ShortNickName: "ghostscript/pcl3/hpdj510,520"
-*NickName: "ghostscript/pcl3/hpdj510 or hpdj520"
-*PCFileName: "HPDJ_510.PPD"
-
-*% *Product, *PSVersion and *Manufacturer are assumed to be included via
-*% gs-pcl3-common.ppd.
-
-*% ****************************************************************************
-
-*% Device selection
-*GhostscriptOptions: "-sDEVICE=hpdj510"
-
-*% ****************************************************************************
-
-*% Rendering capabilities
-
-*ColorDevice: False
-*DefaultColorModel: Gray
-
-*OpenUI *Resolution: PickOne
-*OrderDependency: 50 AnySetup *Resolution
-*DefaultResolution: 300dpi
-*Resolution 75dpi: "(<<) cvx exec /HWResolution [75 75] (>>) cvx exec setpagedevice"
-*Resolution 100dpi: "(<<) cvx exec /HWResolution [100 100] (>>) cvx exec setpagedevice"
-*Resolution 150dpi: "(<<) cvx exec /HWResolution [150 150] (>>) cvx exec setpagedevice"
-*Resolution 300dpi: "(<<) cvx exec /HWResolution [300 300] (>>) cvx exec setpagedevice"
-*CloseUI *Resolution
-
-*% ****************************************************************************
-
-*% Information on page sizes
-
-*OpenUI *PageSize: PickOne
-*OrderDependency: 50 AnySetup *PageSize
-*DefaultPageSize: Unknown
-*PageSize Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageSize Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageSize Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageSize Env10: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize EnvDL: "(<<) cvx exec /PageSize [312 624] /ImagingBBox null (>>) cvx exec setpagedevice"
-*?PageSize: "save /PageSizeQuery /ProcSet resourcestatus
- { pop pop /PageSizeQuery /ProcSet findresource begin query end }
- { (Unknown) }
- ifelse
- = flush restore"
-*End
-*CloseUI *PageSize
-
-*OpenUI *PageRegion: PickOne
-*OrderDependency: 50 AnySetup *PageRegion
-*DefaultPageRegion: Unknown
-*PageRegion Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageRegion Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageRegion Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageRegion Env10: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion EnvDL: "(<<) cvx exec /PageSize [312 624] /ImagingBBox null (>>) cvx exec setpagedevice"
-*CloseUI *PageRegion
-
-*% The *DefaultImageableArea keyword is assumed to be found somewhere else.
-*ImageableArea Letter: "18 34 594 789"
-*ImageableArea Legal: "18 34 594 1005"
-*ImageableArea Executive: "18 34 507 753"
-*ImageableArea A4: "9 34 585 839"
-*ImageableArea Env10: "9 52 288 681"
-*ImageableArea EnvDL: "9 52 301 620"
-
-*% ****************************************************************************
-
-*% Common parts:
-*Include: "gs-pcl3-common.ppd"
diff --git a/gs/contrib/pcl3/ppd/gs-pcl3-hpdj540.ppd b/gs/contrib/pcl3/ppd/gs-pcl3-hpdj540.ppd
deleted file mode 100644
index 871447a41..000000000
--- a/gs/contrib/pcl3/ppd/gs-pcl3-hpdj540.ppd
+++ /dev/null
@@ -1,149 +0,0 @@
-*PPD-Adobe: "4.3"
-*% ****************************************************************************
-*% File: @(#)$Id: gs-pcl3-hpdj540.ppd,v 1.2 2001/03/23 15:50:13 Martin Rel $
-*% Contents: PPD file for the ghostscript device "hpdj540" of the pcl3 driver
-*% Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-*% Germany, Martin.Lottermoser@t-online.de
-*%
-*% ****************************************************************************
-*%
-*% Copyright (C) 2001 Martin Lottermoser
-*% All rights reserved
-*%
-*% ****************************************************************************
-
-*% Required general information keywords
-
-*FileVersion: "1.0"
-*FormatVersion: "4.3"
-*LanguageEncoding: ISOLatin1
-*LanguageVersion: English
-*ModelName: "ghostscript/pcl3/hpdj540"
-*ShortNickName: "ghostscript/pcl3/hpdj540"
-*NickName: "ghostscript/pcl3/hpdj540"
-*PCFileName: "HPDJ_540.PPD"
-
-*% *Product, *PSVersion and *Manufacturer are assumed to be included via
-*% gs-pcl3-common.ppd.
-
-*% ****************************************************************************
-
-*% Device selection
-*GhostscriptOptions: "-sDEVICE=hpdj540"
-
-*% ****************************************************************************
-
-*% Rendering capabilities
-
-*ColorDevice: True
-
-*OpenUI *ColorModel: PickOne
-*OrderDependency: 20 AnySetup *ColorModel
-*DefaultColorModel: Gray
-*ColorModel Gray: "(<<) cvx exec /ColourModel (Gray) (>>) cvx exec setpagedevice"
-*ColorModel CMY: "(<<) cvx exec /ColourModel (CMY) (>>) cvx exec setpagedevice"
-*CloseUI *ColorModel
-
-*OpenUI *Resolution: PickOne
-*OrderDependency: 50 AnySetup *Resolution
-*DefaultResolution: 300dpi
-*Resolution 75dpi: "(<<) cvx exec /HWResolution [75 75] (>>) cvx exec setpagedevice"
-*Resolution 150dpi: "(<<) cvx exec /HWResolution [150 150] (>>) cvx exec setpagedevice"
-*Resolution 300dpi: "(<<) cvx exec /HWResolution [300 300] (>>) cvx exec setpagedevice"
-*CloseUI *Resolution
-
-*% ****************************************************************************
-
-*% Information on page sizes
-
-*OpenUI *PageSize: PickOne
-*OrderDependency: 50 AnySetup *PageSize
-*DefaultPageSize: Unknown
-*PageSize Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageSize Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageSize A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageSize A5: "(<<) cvx exec /PageSize [420 595] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize JISB5: "(<<) cvx exec /PageSize [516 729] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Index4x6in: "(<<) cvx exec /PageSize [288 432] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Index5x8in: "(<<) cvx exec /PageSize [360 576] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize A6Card: "(<<) cvx exec /PageSize [298 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Env10: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize EnvDL: "(<<) cvx exec /PageSize [312 624] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize EnvC6: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice c6"
-*PageSize Postcard: "(<<) cvx exec /PageSize [283 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*?PageSize: "save /PageSizeQuery /ProcSet resourcestatus
- { pop pop /PageSizeQuery /ProcSet findresource begin query end }
- { (Unknown) }
- ifelse
- = flush restore"
-*End
-*CloseUI *PageSize
-
-*OpenUI *PageRegion: PickOne
-*OrderDependency: 50 AnySetup *PageRegion
-*DefaultPageRegion: Unknown
-*PageRegion Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageRegion Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageRegion A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageRegion A5: "(<<) cvx exec /PageSize [420 595] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion JISB5: "(<<) cvx exec /PageSize [516 729] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Index4x6in: "(<<) cvx exec /PageSize [288 432] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Index5x8in: "(<<) cvx exec /PageSize [360 576] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion A6Card: "(<<) cvx exec /PageSize [298 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Env10: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion EnvDL: "(<<) cvx exec /PageSize [312 624] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion EnvC6: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice c6"
-*PageRegion Postcard: "(<<) cvx exec /PageSize [283 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*CloseUI *PageRegion
-
-*% The *DefaultImageableArea keyword is assumed to be found somewhere else.
-*% The bottom margins are smaller than indicated when using the
-*% process colour model Gray.
-*ImageableArea Executive: "18 43 504 753"
-*ImageableArea Letter: "18 43 594 789"
-*ImageableArea Legal: "18 43 594 1005"
-*ImageableArea A4: "10 43 586 839"
-*ImageableArea A5: "10 61 410 592"
-*ImageableArea JISB5: "12 43 504 725"
-*ImageableArea Index4x6in: "10 61 278 429"
-*ImageableArea Index5x8in: "10 61 350 573"
-*ImageableArea A6Card: "10 61 288 416"
-*ImageableArea Env10: "10 61 287 681"
-*ImageableArea EnvDL: "10 61 302 620"
-*ImageableArea EnvC6: "10 61 313 456"
-*ImageableArea Postcard: "12 61 271 416"
-
-*% ============================================================================
-
-*% Custom page size information
-
-*LeadingEdge Short: ""
-*DefaultLeadingEdge: Short
-
-*MaxMediaWidth: "612"
-*MaxMediaHeight: "1008"
-*ParamCustomPageSize Width: 2 points 360 612
-*ParamCustomPageSize Height: 3 points 419.76 1008
-*ParamCustomPageSize WidthOffset: 4 points 0 0
-*ParamCustomPageSize HeightOffset: 5 points 0 0
-*ParamCustomPageSize Orientation: 1 int 0 3
-*HWMargins: 10 61 9 3
-*CustomPageSize True: "
- pop pop
- 2 index 2 mod 0 eq {exch} if
- 1 index 1 index gt {2}{3} ifelse
- 4 -1 roll add 4 mod
- (<<) cvx exec /PageSize [ 6 -2 roll ]
- /LeadingEdge 5 -1 roll
- % This works only if the interpreter passes this parameter to the device.
- % Ghostscript's setpagedevice definition does not do this by default.
- /ImagingBBox null (>>) cvx exec setpagedevice"
-*End
-*NonUIOrderDependency: 50 AnySetup *CustomPageSize True
-
-*% ****************************************************************************
-
-*% Common parts:
-*Include: "gs-pcl3-common.ppd"
diff --git a/gs/contrib/pcl3/ppd/gs-pcl3-hpdj550c.ppd b/gs/contrib/pcl3/ppd/gs-pcl3-hpdj550c.ppd
deleted file mode 100644
index c30751fe0..000000000
--- a/gs/contrib/pcl3/ppd/gs-pcl3-hpdj550c.ppd
+++ /dev/null
@@ -1,103 +0,0 @@
-*PPD-Adobe: "4.3"
-*% ****************************************************************************
-*% File: @(#)$Id: gs-pcl3-hpdj550c.ppd,v 1.2 2001/03/23 15:50:13 Martin Rel $
-*% Contents: PPD file for the ghostscript devices "hpdj550c" and "hpdj560c" of
-*% the pcl3 driver
-*% Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-*% Germany, Martin.Lottermoser@t-online.de
-*%
-*% ****************************************************************************
-*%
-*% Copyright (C) 2001 Martin Lottermoser
-*% All rights reserved
-*%
-*% ****************************************************************************
-
-*% Required general information keywords
-
-*FileVersion: "1.0"
-*FormatVersion: "4.3"
-*LanguageEncoding: ISOLatin1
-*LanguageVersion: English
-*ModelName: "ghostscript/pcl3/hpdj550c and hpdj560c"
-*ShortNickName: "ghostscript/pcl3/hpdj550c,560c"
-*NickName: "ghostscript/pcl3/hpdj550c or hpdj560c"
-*PCFileName: "HPDJ550C.PPD"
-
-*% *Product, *PSVersion and *Manufacturer are assumed to be included via
-*% gs-pcl3-common.ppd.
-
-*% ****************************************************************************
-
-*% Device selection
-*GhostscriptOptions: "-sDEVICE=hpdj550c"
-
-*% ****************************************************************************
-
-*% Rendering capabilities
-
-*ColorDevice: True
-
-*OpenUI *ColorModel: PickOne
-*OrderDependency: 20 AnySetup *ColorModel
-*DefaultColorModel: Gray
-*ColorModel Gray: "(<<) cvx exec /ColourModel (Gray) (>>) cvx exec setpagedevice"
-*ColorModel CMY: "(<<) cvx exec /ColourModel (CMY) (>>) cvx exec setpagedevice"
-*ColorModel CMY+K: "(<<) cvx exec /ColourModel (CMY+K) (>>) cvx exec setpagedevice"
-*CloseUI *ColorModel
-
-*OpenUI *Resolution: PickOne
-*OrderDependency: 50 AnySetup *Resolution
-*DefaultResolution: 300dpi
-*Resolution 75dpi: "(<<) cvx exec /HWResolution [75 75] (>>) cvx exec setpagedevice"
-*Resolution 100dpi: "(<<) cvx exec /HWResolution [100 100] (>>) cvx exec setpagedevice"
-*Resolution 150dpi: "(<<) cvx exec /HWResolution [150 150] (>>) cvx exec setpagedevice"
-*Resolution 300dpi: "(<<) cvx exec /HWResolution [300 300] (>>) cvx exec setpagedevice"
-*CloseUI *Resolution
-
-*% ****************************************************************************
-
-*% Information on page sizes
-
-*OpenUI *PageSize: PickOne
-*OrderDependency: 50 AnySetup *PageSize
-*DefaultPageSize: Unknown
-*PageSize Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageSize Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageSize Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageSize Env10: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize EnvDL: "(<<) cvx exec /PageSize [312 624] /ImagingBBox null (>>) cvx exec setpagedevice"
-*?PageSize: "save /PageSizeQuery /ProcSet resourcestatus
- { pop pop /PageSizeQuery /ProcSet findresource begin query end }
- { (Unknown) }
- ifelse
- = flush restore"
-*End
-*CloseUI *PageSize
-
-*OpenUI *PageRegion: PickOne
-*OrderDependency: 50 AnySetup *PageRegion
-*DefaultPageRegion: Unknown
-*PageRegion Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageRegion Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageRegion Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageRegion Env10: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion EnvDL: "(<<) cvx exec /PageSize [312 624] /ImagingBBox null (>>) cvx exec setpagedevice"
-*CloseUI *PageRegion
-
-*% The *DefaultImageableArea keyword is assumed to be found somewhere else.
-*% The bottom margins are smaller than indicated when using the
-*% process colour model Gray.
-*ImageableArea Letter: "18 43 594 789"
-*ImageableArea Legal: "18 43 594 1005"
-*ImageableArea Executive: "18 43 507 753"
-*ImageableArea A4: "9 43 585 839"
-*ImageableArea Env10: "9 61 288 681"
-*ImageableArea EnvDL: "9 61 301 620"
-
-*% ****************************************************************************
-
-*% Common parts:
-*Include: "gs-pcl3-common.ppd"
diff --git a/gs/contrib/pcl3/ppd/gs-pcl3-hpdj600.ppd b/gs/contrib/pcl3/ppd/gs-pcl3-hpdj600.ppd
deleted file mode 100644
index ad9d4d228..000000000
--- a/gs/contrib/pcl3/ppd/gs-pcl3-hpdj600.ppd
+++ /dev/null
@@ -1,165 +0,0 @@
-*PPD-Adobe: "4.3"
-*% ****************************************************************************
-*% File: @(#)$Id: gs-pcl3-hpdj600.ppd,v 1.2 2001/03/23 15:50:13 Martin Rel $
-*% Contents: PPD file for the ghostscript device "hpdj600" of the pcl3 driver
-*% Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-*% Germany, Martin.Lottermoser@t-online.de
-*%
-*% ****************************************************************************
-*%
-*% Copyright (C) 2001 Martin Lottermoser
-*% All rights reserved
-*%
-*% ****************************************************************************
-
-*% Required general information keywords
-
-*FileVersion: "1.0"
-*FormatVersion: "4.3"
-*LanguageEncoding: ISOLatin1
-*LanguageVersion: English
-*ModelName: "ghostscript/pcl3/hpdj600"
-*ShortNickName: "ghostscript/pcl3/hpdj600"
-*NickName: "ghostscript/pcl3/hpdj600"
-*PCFileName: "HPDJ_600.PPD"
-
-*% *Product, *PSVersion and *Manufacturer are assumed to be included via
-*% gs-pcl3-common.ppd.
-
-*% ****************************************************************************
-
-*% Device selection
-*GhostscriptOptions: "-sDEVICE=hpdj600"
-
-*% ****************************************************************************
-
-*% Rendering capabilities
-
-*ColorDevice: True
-
-*OpenUI *ColorModel: PickOne
-*OrderDependency: 20 AnySetup *ColorModel
-*DefaultColorModel: Gray
-*ColorModel Gray: "(<<) cvx exec /ColourModel (Gray) (>>) cvx exec setpagedevice"
-*ColorModel CMY: "(<<) cvx exec /ColourModel (CMY) (>>) cvx exec setpagedevice"
-*CloseUI *ColorModel
-
-*OpenUI *Resolution: PickOne
-*OrderDependency: 50 AnySetup *Resolution
-*DefaultResolution: 300x300dpi
-*Resolution 75x75dpi: "(<<) cvx exec /HWResolution [75 75] (>>) cvx exec setpagedevice"
-*Resolution 100x100dpi: "(<<) cvx exec /HWResolution [100 100] (>>) cvx exec setpagedevice"
-*Resolution 150x150dpi: "(<<) cvx exec /HWResolution [150 150] (>>) cvx exec setpagedevice"
-*Resolution 300x300dpi: "(<<) cvx exec /HWResolution [300 300] (>>) cvx exec setpagedevice"
-*Resolution 600x300dpi: "(<<) cvx exec /HWResolution [600 300] (>>) cvx exec setpagedevice"
-*Resolution 600x600dpi: "(<<) cvx exec /HWResolution [600 600] (>>) cvx exec setpagedevice"
-*CloseUI *Resolution
-
-*% ============================================================================
-
-*% Constraints (exclusions) between rendering parameters
-
-*UIConstraints: *ColorModel CMY *Resolution 600x600dpi
-*UIConstraints: *Resolution 600x600dpi *ColorModel CMY
-
-*% ****************************************************************************
-
-*% Information on page sizes
-
-*OpenUI *PageSize: PickOne
-*OrderDependency: 50 AnySetup *PageSize
-*DefaultPageSize: Unknown
-*PageSize Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageSize Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageSize A5: "(<<) cvx exec /PageSize [420 595] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageSize JISB5: "(<<) cvx exec /PageSize [516 729] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Postcard: "(<<) cvx exec /PageSize [283 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize DoublePostcard: "(<<) cvx exec /PageSize [420 567] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize A6Card: "(<<) cvx exec /PageSize [298 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Index4x6in: "(<<) cvx exec /PageSize [288 432] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Index5x8in: "(<<) cvx exec /PageSize [360 576] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Env10: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize EnvDL: "(<<) cvx exec /PageSize [312 624] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize EnvC6: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice c6"
-*PageSize EnvUS_A2/US A2 envelope: "(<<) cvx exec /PageSize [315 414] /ImagingBBox null (>>) cvx exec setpagedevice"
-*?PageSize: "save /PageSizeQuery /ProcSet resourcestatus
- { pop pop /PageSizeQuery /ProcSet findresource begin query end }
- { (Unknown) }
- ifelse
- = flush restore"
-*End
-*CloseUI *PageSize
-
-*OpenUI *PageRegion: PickOne
-*OrderDependency: 50 AnySetup *PageRegion
-*DefaultPageRegion: Unknown
-*PageRegion Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageRegion Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageRegion A5: "(<<) cvx exec /PageSize [420 595] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageRegion JISB5: "(<<) cvx exec /PageSize [516 729] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Postcard: "(<<) cvx exec /PageSize [283 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion DoublePostcard: "(<<) cvx exec /PageSize [420 567] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion A6Card: "(<<) cvx exec /PageSize [298 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Index4x6in: "(<<) cvx exec /PageSize [288 432] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Index5x8in: "(<<) cvx exec /PageSize [360 576] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Env10: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion EnvDL: "(<<) cvx exec /PageSize [312 624] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion EnvC6: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice c6"
-*PageRegion EnvUS_A2/US A2 envelope: "(<<) cvx exec /PageSize [315 414] /ImagingBBox null (>>) cvx exec setpagedevice"
-*CloseUI *PageRegion
-
-*% The *DefaultImageableArea keyword is assumed to be found somewhere else.
-*% The bottom margins are smaller than indicated when using the
-*% process colour model Gray.
-*ImageableArea Executive: "18 43 504 753"
-*ImageableArea Letter: "18 43 594 789"
-*ImageableArea Legal: "18 43 594 1005"
-*ImageableArea A5: "10 61 410 592"
-*ImageableArea A4: "10 43 585 839"
-*ImageableArea JISB5: "13 43 503 725"
-*ImageableArea Postcard: "13 61 271 416"
-*ImageableArea DoublePostcard: "13 61 407 564"
-*ImageableArea A6Card: "10 61 288 416"
-*ImageableArea Index4x6in: "10 61 278 429"
-*ImageableArea Index5x8in: "10 61 350 573"
-*ImageableArea Env10: "10 61 287 681"
-*ImageableArea EnvDL: "10 61 302 620"
-*ImageableArea EnvC6: "10 61 313 456"
-*ImageableArea EnvUS_A2: "10 61 305 411"
-
-*% ============================================================================
-
-*% Custom page size information
-
-*LeadingEdge Short: ""
-*DefaultLeadingEdge: Short
-
-*MaxMediaWidth: "612"
-*MaxMediaHeight: "1008"
-*ParamCustomPageSize Width: 2 points 360 612
-*ParamCustomPageSize Height: 3 points 419.528 1008
-*ParamCustomPageSize WidthOffset: 4 points 0 0
-*ParamCustomPageSize HeightOffset: 5 points 0 0
-*ParamCustomPageSize Orientation: 1 int 0 3
-*HWMargins: 10 43 10 3
-*CustomPageSize True: "
- pop pop
- 2 index 2 mod 0 eq {exch} if
- 1 index 1 index gt {2}{3} ifelse
- 4 -1 roll add 4 mod
- (<<) cvx exec /PageSize [ 6 -2 roll ]
- /LeadingEdge 5 -1 roll
- % This works only if the interpreter passes this parameter to the device.
- % Ghostscript's setpagedevice definition does not do this by default.
- /ImagingBBox null (>>) cvx exec setpagedevice"
-*End
-*NonUIOrderDependency: 50 AnySetup *CustomPageSize True
-
-*% ****************************************************************************
-
-*% Common parts:
-*Include: "gs-pcl3-common.ppd"
diff --git a/gs/contrib/pcl3/ppd/gs-pcl3-hpdj660c.ppd b/gs/contrib/pcl3/ppd/gs-pcl3-hpdj660c.ppd
deleted file mode 100644
index be92246f8..000000000
--- a/gs/contrib/pcl3/ppd/gs-pcl3-hpdj660c.ppd
+++ /dev/null
@@ -1,169 +0,0 @@
-*PPD-Adobe: "4.3"
-*% ****************************************************************************
-*% File: @(#)$Id: gs-pcl3-hpdj660c.ppd,v 1.2 2001/03/23 15:50:13 Martin Rel $
-*% Contents: PPD file for the ghostscript device "hpdj660c" and "hpdj670c" of
-*% the pcl3 driver
-*% Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-*% Germany, Martin.Lottermoser@t-online.de
-*%
-*% ****************************************************************************
-*%
-*% Copyright (C) 2001 Martin Lottermoser
-*% All rights reserved
-*%
-*% ****************************************************************************
-
-*% Required general information keywords
-
-*FileVersion: "1.0"
-*FormatVersion: "4.3"
-*LanguageEncoding: ISOLatin1
-*LanguageVersion: English
-*ModelName: "ghostscript/pcl3/hpdj660c and hpdj670c"
-*ShortNickName: "ghostscript/pcl3/hpdj660c,670c"
-*NickName: "ghostscript/pcl3/hpdj660c or hpdj670c"
-*PCFileName: "HPDJ660C.PPD"
-
-*% *Product, *PSVersion and *Manufacturer are assumed to be included via
-*% gs-pcl3-common.ppd.
-
-*% ****************************************************************************
-
-*% Device selection
-*GhostscriptOptions: "-sDEVICE=hpdj660c"
-
-*% ****************************************************************************
-
-*% Rendering capabilities
-
-*ColorDevice: True
-
-*OpenUI *ColorModel: PickOne
-*OrderDependency: 20 AnySetup *ColorModel
-*DefaultColorModel: Gray
-*ColorModel Gray: "(<<) cvx exec /ColourModel (Gray) (>>) cvx exec setpagedevice"
-*ColorModel CMY: "(<<) cvx exec /ColourModel (CMY) (>>) cvx exec setpagedevice"
-*ColorModel CMY+K: "(<<) cvx exec /ColourModel (CMY+K) (>>) cvx exec setpagedevice"
-*ColorModel CMYK: "(<<) cvx exec /ColourModel (CMYK) (>>) cvx exec setpagedevice"
-*CloseUI *ColorModel
-
-*OpenUI *Resolution: PickOne
-*OrderDependency: 50 AnySetup *Resolution
-*DefaultResolution: 300x300dpi
-*Resolution 75x75dpi: "(<<) cvx exec /HWResolution [75 75] (>>) cvx exec setpagedevice"
-*Resolution 100x100dpi: "(<<) cvx exec /HWResolution [100 100] (>>) cvx exec setpagedevice"
-*Resolution 150x150dpi: "(<<) cvx exec /HWResolution [150 150] (>>) cvx exec setpagedevice"
-*Resolution 300x300dpi: "(<<) cvx exec /HWResolution [300 300] (>>) cvx exec setpagedevice"
-*Resolution 600x300dpi: "(<<) cvx exec /HWResolution [600 300] (>>) cvx exec setpagedevice"
-*Resolution 600x600dpi: "(<<) cvx exec /HWResolution [600 600] (>>) cvx exec setpagedevice"
-*CloseUI *Resolution
-
-*% ============================================================================
-
-*% Constraints (exclusions) between rendering parameters
-
-*UIConstraints: *ColorModel CMY *Resolution 600x600dpi
-*UIConstraints: *Resolution 600x600dpi *ColorModel CMY
-*UIConstraints: *ColorModel CMY+K *Resolution 600x600dpi
-*UIConstraints: *Resolution 600x600dpi *ColorModel CMY+K
-*UIConstraints: *ColorModel CMYK *Resolution 600x600dpi
-*UIConstraints: *Resolution 600x600dpi *ColorModel CMYK
-
-*% ****************************************************************************
-
-*% Information on page sizes
-
-*OpenUI *PageSize: PickOne
-*OrderDependency: 50 AnySetup *PageSize
-*DefaultPageSize: Unknown
-*PageSize Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageSize Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageSize Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageSize A5: "(<<) cvx exec /PageSize [420 595] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize JISB5: "(<<) cvx exec /PageSize [516 729] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Env10: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize EnvDL: "(<<) cvx exec /PageSize [312 624] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize EnvC6: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice c6"
-*PageSize Index4x6in: "(<<) cvx exec /PageSize [288 432] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Index5x8in: "(<<) cvx exec /PageSize [360 576] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize A6Card: "(<<) cvx exec /PageSize [298 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Postcard: "(<<) cvx exec /PageSize [283 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize EnvUS_A2/US A2 envelope: "(<<) cvx exec /PageSize [315 414] /ImagingBBox null (>>) cvx exec setpagedevice"
-*?PageSize: "save /PageSizeQuery /ProcSet resourcestatus
- { pop pop /PageSizeQuery /ProcSet findresource begin query end }
- { (Unknown) }
- ifelse
- = flush restore"
-*End
-*CloseUI *PageSize
-
-*OpenUI *PageRegion: PickOne
-*OrderDependency: 50 AnySetup *PageRegion
-*DefaultPageRegion: Unknown
-*PageRegion Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageRegion Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageRegion Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageRegion A5: "(<<) cvx exec /PageSize [420 595] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion JISB5: "(<<) cvx exec /PageSize [516 729] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Env10: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion EnvDL: "(<<) cvx exec /PageSize [312 624] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion EnvC6: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice c6"
-*PageRegion Index4x6in: "(<<) cvx exec /PageSize [288 432] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Index5x8in: "(<<) cvx exec /PageSize [360 576] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion A6Card: "(<<) cvx exec /PageSize [298 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Postcard: "(<<) cvx exec /PageSize [283 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion EnvUS_A2/US A2 envelope: "(<<) cvx exec /PageSize [315 414] /ImagingBBox null (>>) cvx exec setpagedevice"
-*CloseUI *PageRegion
-
-*% The *DefaultImageableArea keyword is assumed to be found somewhere else.
-*% The bottom margins are smaller than indicated when using the
-*% process colour model Gray.
-*ImageableArea Letter: "18 43 594 789"
-*ImageableArea Legal: "18 43 594 1005"
-*ImageableArea Executive: "18 43 504 753"
-*ImageableArea A4: "10 43 585 839"
-*ImageableArea A5: "10 61 410 592"
-*ImageableArea JISB5: "13 43 503 725"
-*ImageableArea Env10: "10 61 287 681"
-*ImageableArea EnvDL: "10 61 302 620"
-*ImageableArea EnvC6: "10 61 313 456"
-*ImageableArea Index4x6in: "10 61 278 429"
-*ImageableArea Index5x8in: "10 61 350 573"
-*ImageableArea A6Card: "10 61 288 416"
-*ImageableArea Postcard: "13 61 271 416"
-*ImageableArea EnvUS_A2: "10 61 305 411"
-
-*% ============================================================================
-
-*% Custom page size information
-
-*LeadingEdge Short: ""
-*DefaultLeadingEdge: Short
-
-*MaxMediaWidth: "612"
-*MaxMediaHeight: "1008"
-*ParamCustomPageSize Width: 2 points 360 612
-*ParamCustomPageSize Height: 3 points 419.528 1008
-*ParamCustomPageSize WidthOffset: 4 points 0 0
-*ParamCustomPageSize HeightOffset: 5 points 0 0
-*ParamCustomPageSize Orientation: 1 int 0 3
-*HWMargins: 10 43 10 3
-*CustomPageSize True: "
- pop pop
- 2 index 2 mod 0 eq {exch} if
- 1 index 1 index gt {2}{3} ifelse
- 4 -1 roll add 4 mod
- (<<) cvx exec /PageSize [ 6 -2 roll ]
- /LeadingEdge 5 -1 roll
- % This works only if the interpreter passes this parameter to the device.
- % Ghostscript's setpagedevice definition does not do this by default.
- /ImagingBBox null (>>) cvx exec setpagedevice"
-*End
-*NonUIOrderDependency: 50 AnySetup *CustomPageSize True
-
-*% ****************************************************************************
-
-*% Common parts:
-*Include: "gs-pcl3-common.ppd"
diff --git a/gs/contrib/pcl3/ppd/gs-pcl3-hpdj680c.ppd b/gs/contrib/pcl3/ppd/gs-pcl3-hpdj680c.ppd
deleted file mode 100644
index 4745daf58..000000000
--- a/gs/contrib/pcl3/ppd/gs-pcl3-hpdj680c.ppd
+++ /dev/null
@@ -1,191 +0,0 @@
-*PPD-Adobe: "4.3"
-*% ****************************************************************************
-*% File: @(#)$Id: gs-pcl3-hpdj680c.ppd,v 1.2 2001/03/23 15:50:13 Martin Rel $
-*% Contents: PPD file for the ghostscript devices "hpdj680c" and "hpdj690c" of
-*% the pcl3 driver
-*% Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-*% Germany, Martin.Lottermoser@t-online.de
-*%
-*% ****************************************************************************
-*%
-*% Copyright (C) 2001 Martin Lottermoser
-*% All rights reserved
-*%
-*% ****************************************************************************
-
-*% Required general information keywords
-
-*FileVersion: "1.0"
-*FormatVersion: "4.3"
-*LanguageEncoding: ISOLatin1
-*LanguageVersion: English
-*ModelName: "ghostscript/pcl3/hpdj680c and hpdj690c"
-*ShortNickName: "ghostscript/pcl3/hpdj680c,690c"
-*NickName: "ghostscript/pcl3/hpdj680c or hpdj690c"
-*PCFileName: "HPDJ680C.PPD"
-
-*% *Product, *PSVersion and *Manufacturer are assumed to be included via
-*% gs-pcl3-common.ppd.
-
-*% ****************************************************************************
-
-*% Device selection
-*GhostscriptOptions: "-sDEVICE=hpdj680c"
-
-*% ****************************************************************************
-
-*% Rendering capabilities
-
-*ColorDevice: True
-
-*OpenUI *ColorModel: PickOne
-*OrderDependency: 20 AnySetup *ColorModel
-*DefaultColorModel: Gray
-*ColorModel Gray: "(<<) cvx exec /ColourModel (Gray) (>>) cvx exec setpagedevice"
-*ColorModel CMY: "(<<) cvx exec /ColourModel (CMY) (>>) cvx exec setpagedevice"
-*ColorModel CMY+K: "(<<) cvx exec /ColourModel (CMY+K) (>>) cvx exec setpagedevice"
-*ColorModel CMYK: "(<<) cvx exec /ColourModel (CMYK) (>>) cvx exec setpagedevice"
-*CloseUI *ColorModel
-
-*OpenUI *Resolution: PickOne
-*OrderDependency: 50 AnySetup *Resolution
-*DefaultResolution: 300x300dpi
-*Resolution 75x75dpi: "(<<) cvx exec /HWResolution [75 75] (>>) cvx exec setpagedevice"
-*Resolution 100x100dpi: "(<<) cvx exec /HWResolution [100 100] (>>) cvx exec setpagedevice"
-*Resolution 150x150dpi: "(<<) cvx exec /HWResolution [150 150] (>>) cvx exec setpagedevice"
-*Resolution 300x300dpi: "(<<) cvx exec /HWResolution [300 300] (>>) cvx exec setpagedevice"
-*Resolution 600x300dpi: "(<<) cvx exec /HWResolution [600 300] (>>) cvx exec setpagedevice"
-*Resolution 600x600dpi: "(<<) cvx exec /HWResolution [600 600] (>>) cvx exec setpagedevice"
-*CloseUI *Resolution
-
-*% ============================================================================
-
-*% Constraints (exclusions) between rendering parameters
-
-*UIConstraints: *ColorModel CMY *Resolution 600x600dpi
-*UIConstraints: *Resolution 600x600dpi *ColorModel CMY
-*UIConstraints: *ColorModel CMY+K *Resolution 600x600dpi
-*UIConstraints: *Resolution 600x600dpi *ColorModel CMY+K
-*UIConstraints: *ColorModel CMYK *Resolution 600x600dpi
-*UIConstraints: *Resolution 600x600dpi *ColorModel CMYK
-
-*% ****************************************************************************
-
-*% Information on page sizes
-
-*OpenUI *PageSize: PickOne
-*OrderDependency: 50 AnySetup *PageSize
-*DefaultPageSize: Unknown
-*PageSize Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageSize A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageSize Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageSize Env10: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize EnvDL: "(<<) cvx exec /PageSize [312 624] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize A5: "(<<) cvx exec /PageSize [420 595] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize JISB5: "(<<) cvx exec /PageSize [516 729] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize EnvC6: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice c6"
-*PageSize Index4x6in: "(<<) cvx exec /PageSize [288 432] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Index5x8in: "(<<) cvx exec /PageSize [360 576] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize A6Card: "(<<) cvx exec /PageSize [298 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Postcard: "(<<) cvx exec /PageSize [283 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize EnvUS_A2/US A2 envelope: "(<<) cvx exec /PageSize [315 414] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize LetterBig: "(<<) cvx exec
- /PageSize [612 792] /ImagingBBox null
- /InputAttributes (<<) cvx exec /Priority [-1] (>>) cvx exec
- (>>) cvx exec setpagedevice"
-*End
-*PageSize A4Big: "(<<) cvx exec
- /PageSize [595 842] /ImagingBBox null
- /InputAttributes (<<) cvx exec /Priority [-1] (>>) cvx exec
- (>>) cvx exec setpagedevice"
-*End
-*?PageSize: "save /PageSizeQuery /ProcSet resourcestatus
- { pop pop /PageSizeQuery /ProcSet findresource begin query end }
- { (Unknown) }
- ifelse
- = flush restore"
-*End
-*CloseUI *PageSize
-
-*OpenUI *PageRegion: PickOne
-*OrderDependency: 50 AnySetup *PageRegion
-*DefaultPageRegion: Unknown
-*PageRegion Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageRegion A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageRegion Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageRegion Env10: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion EnvDL: "(<<) cvx exec /PageSize [312 624] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion A5: "(<<) cvx exec /PageSize [420 595] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion JISB5: "(<<) cvx exec /PageSize [516 729] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion EnvC6: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice c6"
-*PageRegion Index4x6in: "(<<) cvx exec /PageSize [288 432] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Index5x8in: "(<<) cvx exec /PageSize [360 576] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion A6Card: "(<<) cvx exec /PageSize [298 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Postcard: "(<<) cvx exec /PageSize [283 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion EnvUS_A2/US A2 envelope: "(<<) cvx exec /PageSize [315 414] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion LetterBig: "(<<) cvx exec
- /PageSize [612 792] /ImagingBBox null
- /InputAttributes (<<) cvx exec /Priority [-1] (>>) cvx exec
- (>>) cvx exec setpagedevice"
-*End
-*PageRegion A4Big: "(<<) cvx exec
- /PageSize [595 842] /ImagingBBox null
- /InputAttributes (<<) cvx exec /Priority [-1] (>>) cvx exec
- (>>) cvx exec setpagedevice"
-*End
-*CloseUI *PageRegion
-
-*% The *DefaultImageableArea keyword is assumed to be found somewhere else.
-*% The bottom margins are smaller than indicated when using the
-*% process colour model Gray.
-*ImageableArea Letter: "18 43 594 789"
-*ImageableArea A4: "10 43 585 839"
-*ImageableArea Legal: "18 43 594 1005"
-*ImageableArea Env10: "10 61 287 681"
-*ImageableArea Executive: "18 43 504 753"
-*ImageableArea EnvDL: "10 61 302 620"
-*ImageableArea A5: "10 61 410 592"
-*ImageableArea JISB5: "13 43 503 725"
-*ImageableArea EnvC6: "10 61 313 456"
-*ImageableArea Index4x6in: "10 61 278 429"
-*ImageableArea Index5x8in: "10 61 350 573"
-*ImageableArea A6Card: "10 61 288 416"
-*ImageableArea Postcard: "13 61 271 416"
-*ImageableArea EnvUS_A2: "10 61 305 411"
-*ImageableArea LetterBig: "18 0 594 792"
-*ImageableArea A4Big: "10 0 585 841"
-
-*% ============================================================================
-
-*% Custom page size information
-
-*LeadingEdge Short: ""
-*DefaultLeadingEdge: Short
-
-*MaxMediaWidth: "612"
-*MaxMediaHeight: "1008"
-*ParamCustomPageSize Width: 2 points 360 612
-*ParamCustomPageSize Height: 3 points 419.528 1008
-*ParamCustomPageSize WidthOffset: 4 points 0 0
-*ParamCustomPageSize HeightOffset: 5 points 0 0
-*ParamCustomPageSize Orientation: 1 int 0 3
-*HWMargins: 10 43 10 3
-*CustomPageSize True: "
- pop pop
- 2 index 2 mod 0 eq {exch} if
- 1 index 1 index gt {2}{3} ifelse
- 4 -1 roll add 4 mod
- (<<) cvx exec /PageSize [ 6 -2 roll ]
- /LeadingEdge 5 -1 roll
- % This works only if the interpreter passes this parameter to the device.
- % Ghostscript's setpagedevice definition does not do this by default.
- /ImagingBBox null (>>) cvx exec setpagedevice"
-*End
-*NonUIOrderDependency: 50 AnySetup *CustomPageSize True
-
-*% ****************************************************************************
-
-*% Common parts:
-*Include: "gs-pcl3-common.ppd"
diff --git a/gs/contrib/pcl3/ppd/gs-pcl3-hpdj8xxc.ppd b/gs/contrib/pcl3/ppd/gs-pcl3-hpdj8xxc.ppd
deleted file mode 100644
index 820d56b92..000000000
--- a/gs/contrib/pcl3/ppd/gs-pcl3-hpdj8xxc.ppd
+++ /dev/null
@@ -1,214 +0,0 @@
-*PPD-Adobe: "4.3"
-*% ****************************************************************************
-*% File: @(#)$Id: gs-pcl3-hpdj8xxc.ppd,v 1.6 2001/08/19 09:13:23 Martin Rel $
-*% Contents: PPD file for the ghostscript devices "hpdj850c", "hpdj855c",
-*% "hpdj870c", and "hpdj890c" of the pcl3 driver
-*% Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-*% Germany, Martin.Lottermoser@t-online.de
-*%
-*% ****************************************************************************
-*%
-*% Copyright (C) 2001 Martin Lottermoser
-*% All rights reserved
-*%
-*% ****************************************************************************
-
-*% Required general information keywords
-
-*FileVersion: "1.1"
-*FormatVersion: "4.3"
-*LanguageEncoding: ISOLatin1
-*LanguageVersion: English
-*ModelName: "ghostscript/pcl3/hpdj850c, hpdj855c, hpdj870c, and hpdj890c"
-*ShortNickName: "ghostscript/pcl3/hpdj8xxc"
-*NickName: "ghostscript/pcl3/hpdj850c, hpdj855c, hpdj870c, or hpdj890c"
-*PCFileName: "HPDJ8XXC.PPD"
-
-*% *Product, *PSVersion and *Manufacturer are assumed to be included via
-*% gs-pcl3-common.ppd.
-
-*% ****************************************************************************
-
-*% Device selection. You can specify either "hpdj850c", "hpdj855c", "hpdj870c"
-*% or "hpdj890c".
-*GhostscriptOptions: "-sDEVICE=hpdj850c"
-
-*% ****************************************************************************
-
-*% Rendering capabilities
-
-*ColorDevice: True
-
-*OpenUI *ColorModel: PickOne
-*OrderDependency: 20 AnySetup *ColorModel
-*DefaultColorModel: Gray
-*ColorModel Gray: "(<<) cvx exec /ColourModel (Gray) (>>) cvx exec setpagedevice"
-*ColorModel CMY: "(<<) cvx exec /ColourModel (CMY) (>>) cvx exec setpagedevice"
-*ColorModel CMY+K: "(<<) cvx exec /ColourModel (CMY+K) (>>) cvx exec setpagedevice"
-*ColorModel CMYK: "(<<) cvx exec /ColourModel (CMYK) (>>) cvx exec setpagedevice"
-*CloseUI *ColorModel
-
-*OpenUI *Resolution: PickOne
-*OrderDependency: 50 AnySetup *Resolution
-*DefaultResolution: 300dpi
-*Resolution 75dpi: "(<<) cvx exec /HWResolution [75 75] (>>) cvx exec setpagedevice"
-*Resolution 150dpi: "(<<) cvx exec /HWResolution [150 150] (>>) cvx exec setpagedevice"
-*Resolution 300dpi: "(<<) cvx exec /HWResolution [300 300] (>>) cvx exec setpagedevice"
-*Resolution 600dpi: "(<<) cvx exec /HWResolution [600 600] (>>) cvx exec setpagedevice"
-*CloseUI *Resolution
-
-*OpenUI *pcl3IntensityLevels/Intensity levels: PickOne
-*OrderDependency: 50 AnySetup *pcl3IntensityLevels
-*Defaultpcl3IntensityLevels: Automatic
-*pcl3IntensityLevels Automatic: ""
-*pcl3IntensityLevels K4/black 4: "(<<) cvx exec /BlackLevels 4 (>>) cvx exec setpagedevice"
-*pcl3IntensityLevels K4C3/black 4, CMY 3: "(<<) cvx exec /BlackLevels 4 /CMYLevels 3 (>>) cvx exec setpagedevice"
-*pcl3IntensityLevels K4C4/black 4, CMY 4: "(<<) cvx exec /BlackLevels 4 /CMYLevels 4 (>>) cvx exec setpagedevice"
-*CloseUI *pcl3IntensityLevels
-
-*% ============================================================================
-
-*% Constraints (exclusions) between rendering parameters
-
-*UIConstraints: *ColorModel CMY *Resolution 600dpi
-*UIConstraints: *Resolution 600dpi *ColorModel CMY
-*UIConstraints: *ColorModel CMY+K *Resolution 600dpi
-*UIConstraints: *Resolution 600dpi *ColorModel CMY+K
-*UIConstraints: *ColorModel CMYK *Resolution 600dpi
-*UIConstraints: *Resolution 600dpi *ColorModel CMYK
-
-*UIConstraints: *ColorModel Gray *pcl3IntensityLevels K4C3
-*UIConstraints: *pcl3IntensityLevels K4C3 *ColorModel Gray
-*UIConstraints: *ColorModel Gray *pcl3IntensityLevels K4C4
-*UIConstraints: *pcl3IntensityLevels K4C4 *ColorModel Gray
-*UIConstraints: *ColorModel CMY *pcl3IntensityLevels K4
-*UIConstraints: *pcl3IntensityLevels K4 *ColorModel CMY
-*UIConstraints: *ColorModel CMY *pcl3IntensityLevels K4C3
-*UIConstraints: *pcl3IntensityLevels K4C3 *ColorModel CMY
-*UIConstraints: *ColorModel CMY *pcl3IntensityLevels K4C4
-*UIConstraints: *pcl3IntensityLevels K4C4 *ColorModel CMY
-*UIConstraints: *ColorModel CMY+K *pcl3IntensityLevels K4
-*UIConstraints: *pcl3IntensityLevels K4 *ColorModel CMY+K
-*UIConstraints: *ColorModel CMYK *pcl3IntensityLevels K4
-*UIConstraints: *pcl3IntensityLevels K4 *ColorModel CMYK
-
-*UIConstraints: *Resolution 75dpi *pcl3IntensityLevels K4
-*UIConstraints: *pcl3IntensityLevels K4 *Resolution 75dpi
-*UIConstraints: *Resolution 75dpi *pcl3IntensityLevels K4C3
-*UIConstraints: *pcl3IntensityLevels K4C3 *Resolution 75dpi
-*UIConstraints: *Resolution 75dpi *pcl3IntensityLevels K4C4
-*UIConstraints: *pcl3IntensityLevels K4C4 *Resolution 75dpi
-*UIConstraints: *Resolution 150dpi *pcl3IntensityLevels K4
-*UIConstraints: *pcl3IntensityLevels K4 *Resolution 150dpi
-*UIConstraints: *Resolution 150dpi *pcl3IntensityLevels K4C3
-*UIConstraints: *pcl3IntensityLevels K4C3 *Resolution 150dpi
-*UIConstraints: *Resolution 150dpi *pcl3IntensityLevels K4C4
-*UIConstraints: *pcl3IntensityLevels K4C4 *Resolution 150dpi
-*UIConstraints: *Resolution 600dpi *pcl3IntensityLevels K4
-*UIConstraints: *pcl3IntensityLevels K4 *Resolution 600dpi
-*UIConstraints: *Resolution 600dpi *pcl3IntensityLevels K4C3
-*UIConstraints: *pcl3IntensityLevels K4C3 *Resolution 600dpi
-*UIConstraints: *Resolution 600dpi *pcl3IntensityLevels K4C4
-*UIConstraints: *pcl3IntensityLevels K4C4 *Resolution 600dpi
-
-*% More than two intensity levels are not possible with draft quality:
-*UIConstraints: *OutputMode Draft *pcl3IntensityLevels K4
-*UIConstraints: *pcl3IntensityLevels K4 *OutputMode Draft
-*UIConstraints: *OutputMode Draft *pcl3IntensityLevels K4C3
-*UIConstraints: *pcl3IntensityLevels K4C3 *OutputMode Draft
-*UIConstraints: *OutputMode Draft *pcl3IntensityLevels K4C4
-*UIConstraints: *pcl3IntensityLevels K4C4 *OutputMode Draft
-
-*% ****************************************************************************
-
-*% Information on page sizes
-
-*OpenUI *PageSize: PickOne
-*OrderDependency: 50 AnySetup *PageSize
-*DefaultPageSize: Unknown
-*PageSize Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageSize Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageSize Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageSize A5: "(<<) cvx exec /PageSize [420 595] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize JISB5: "(<<) cvx exec /PageSize [516 729] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Index4x6in: "(<<) cvx exec /PageSize [288 432] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Index5x8in: "(<<) cvx exec /PageSize [360 576] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize A6Card: "(<<) cvx exec /PageSize [298 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Postcard: "(<<) cvx exec /PageSize [283 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Env10: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize EnvDL: "(<<) cvx exec /PageSize [312 624] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize EnvC6: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice c6"
-*?PageSize: "save /PageSizeQuery /ProcSet resourcestatus
- { pop pop /PageSizeQuery /ProcSet findresource begin query end }
- { (Unknown) }
- ifelse
- = flush restore"
-*End
-*CloseUI *PageSize
-
-*OpenUI *PageRegion: PickOne
-*OrderDependency: 50 AnySetup *PageRegion
-*DefaultPageRegion: Unknown
-*PageRegion Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageRegion Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageRegion Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageRegion A5: "(<<) cvx exec /PageSize [420 595] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion JISB5: "(<<) cvx exec /PageSize [516 729] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Index4x6in: "(<<) cvx exec /PageSize [288 432] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Index5x8in: "(<<) cvx exec /PageSize [360 576] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion A6Card: "(<<) cvx exec /PageSize [298 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Postcard: "(<<) cvx exec /PageSize [283 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Env10: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion EnvDL: "(<<) cvx exec /PageSize [312 624] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion EnvC6: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice c6"
-*CloseUI *PageRegion
-
-*% The *DefaultImageableArea keyword is assumed to be found somewhere else.
-*ImageableArea Letter: "19 34 593 789"
-*ImageableArea Legal: "19 34 593 1005"
-*ImageableArea Executive: "19 34 503 753"
-*ImageableArea A4: "10 34 585 839"
-*ImageableArea A5: "10 34 409 592"
-*ImageableArea JISB5: "10 34 506 725"
-*ImageableArea Index4x6in: "10 34 278 429"
-*ImageableArea Index5x8in: "10 34 350 573"
-*ImageableArea A6Card: "10 34 288 416"
-*ImageableArea Postcard: "10 34 274 416"
-*ImageableArea Env10: "10 63 287 681"
-*ImageableArea EnvDL: "10 63 302 620"
-*ImageableArea EnvC6: "10 63 314 456"
-
-*% ============================================================================
-
-*% Custom page size information
-
-*LeadingEdge Short: ""
-*DefaultLeadingEdge: Short
-
-*MaxMediaWidth: "612.283"
-*MaxMediaHeight: "1009.13"
-*ParamCustomPageSize Width: 2 points 283.465 612.283
-*ParamCustomPageSize Height: 3 points 419.528 1009.13
-*ParamCustomPageSize WidthOffset: 4 points 0 0
-*ParamCustomPageSize HeightOffset: 5 points 0 0
-*ParamCustomPageSize Orientation: 1 int 0 3
-*HWMargins: 10 34 10 3
-*CustomPageSize True: "
- pop pop
- 2 index 2 mod 0 eq {exch} if
- 1 index 1 index gt {2}{3} ifelse
- 4 -1 roll add 4 mod
- (<<) cvx exec /PageSize [ 6 -2 roll ]
- /LeadingEdge 5 -1 roll
- % This works only if the interpreter passes this parameter to the device.
- % Ghostscript's setpagedevice definition does not do this by default.
- /ImagingBBox null (>>) cvx exec setpagedevice"
-*End
-*NonUIOrderDependency: 50 AnySetup *CustomPageSize True
-
-*% ****************************************************************************
-
-*% Common parts:
-*Include: "gs-pcl3-common.ppd"
diff --git a/gs/contrib/pcl3/ppd/gs-pcl3-hpdjportable.ppd b/gs/contrib/pcl3/ppd/gs-pcl3-hpdjportable.ppd
deleted file mode 100644
index 932c0b1a0..000000000
--- a/gs/contrib/pcl3/ppd/gs-pcl3-hpdjportable.ppd
+++ /dev/null
@@ -1,88 +0,0 @@
-*PPD-Adobe: "4.3"
-*% ****************************************************************************
-*% File: @(#)$Id: gs-pcl3-hpdjportable.ppd,v 1.2 2001/03/23 15:51:02 Martin Rel $
-*% Contents: PPD file for the ghostscript device "hpdjportable" of the
-*% pcl3 driver
-*% Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-*% Germany, Martin.Lottermoser@t-online.de
-*%
-*% ****************************************************************************
-*%
-*% Copyright (C) 2001 Martin Lottermoser
-*% All rights reserved
-*%
-*% ****************************************************************************
-
-*% Required general information keywords
-
-*FileVersion: "1.0"
-*FormatVersion: "4.3"
-*LanguageEncoding: ISOLatin1
-*LanguageVersion: English
-*ModelName: "ghostscript/pcl3/hpdjportable"
-*ShortNickName: "ghostscript/pcl3/hpdjportable"
-*NickName: "ghostscript/pcl3/hpdjportable"
-*PCFileName: "HPDJPORT.PPD"
-
-*% *Product, *PSVersion and *Manufacturer are assumed to be included via
-*% gs-pcl3-common.ppd.
-
-*% ****************************************************************************
-
-*% Device selection
-*GhostscriptOptions: "-sDEVICE=hpdjportable"
-
-*% ****************************************************************************
-
-*% Rendering capabilities
-
-*ColorDevice: False
-*DefaultColorModel: Gray
-
-*OpenUI *Resolution: PickOne
-*OrderDependency: 50 AnySetup *Resolution
-*DefaultResolution: 300dpi
-*Resolution 75dpi: "(<<) cvx exec /HWResolution [75 75] (>>) cvx exec setpagedevice"
-*Resolution 100dpi: "(<<) cvx exec /HWResolution [100 100] (>>) cvx exec setpagedevice"
-*Resolution 150dpi: "(<<) cvx exec /HWResolution [150 150] (>>) cvx exec setpagedevice"
-*Resolution 300dpi: "(<<) cvx exec /HWResolution [300 300] (>>) cvx exec setpagedevice"
-*CloseUI *Resolution
-
-*% ****************************************************************************
-
-*% Information on page sizes
-
-*OpenUI *PageSize: PickOne
-*OrderDependency: 50 AnySetup *PageSize
-*DefaultPageSize: Unknown
-*PageSize Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageSize Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageSize A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageSize Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*?PageSize: "save /PageSizeQuery /ProcSet resourcestatus
- { pop pop /PageSizeQuery /ProcSet findresource begin query end }
- { (Unknown) }
- ifelse
- = flush restore"
-*End
-*CloseUI *PageSize
-
-*OpenUI *PageRegion: PickOne
-*OrderDependency: 50 AnySetup *PageRegion
-*DefaultPageRegion: Unknown
-*PageRegion Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageRegion Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageRegion A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageRegion Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*CloseUI *PageRegion
-
-*% The *DefaultImageableArea keyword is assumed to be found somewhere else.
-*ImageableArea Letter: "18 29 594 784"
-*ImageableArea Legal: "18 29 594 1000"
-*ImageableArea A4: "9 29 584 834"
-*ImageableArea Executive: "18 29 504 748"
-
-*% ****************************************************************************
-
-*% Common parts:
-*Include: "gs-pcl3-common.ppd"
diff --git a/gs/contrib/pcl3/ppd/gs-pcl3-unspec.ppd b/gs/contrib/pcl3/ppd/gs-pcl3-unspec.ppd
deleted file mode 100644
index 6bdc4b164..000000000
--- a/gs/contrib/pcl3/ppd/gs-pcl3-unspec.ppd
+++ /dev/null
@@ -1,270 +0,0 @@
-*PPD-Adobe: "4.3"
-*% ****************************************************************************
-*% File: @(#)$Id: gs-pcl3-unspec.ppd,v 1.5 2001/03/29 14:50:08 Martin Rel $
-*% Contents: PPD file for the ghostscript device "unspec" of the pcl3 driver
-*% Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-*% Germany; Martin.Lottermoser@t-online.de
-*%
-*% ****************************************************************************
-*%
-*% Copyright (C) 2001 Martin Lottermoser
-*% All rights reserved
-*%
-*% ****************************************************************************
-*%
-*% Note: This file tries to permit a lot but does not permit everything. If you
-*% need to use the "unspec" subdevice, you should consider creating a
-*% customized PPD file reflecting your printer's actual capabilities.
-*%
-*% ****************************************************************************
-
-*% Required general information keywords
-
-*FileVersion: "1.1"
-*FormatVersion: "4.3"
-*LanguageEncoding: ISOLatin1
-*LanguageVersion: English
-*ModelName: "ghostscript/pcl3/unspec"
-*ShortNickName: "ghostscript/pcl3/unspec"
-*NickName: "ghostscript/pcl3/unspec"
-*PCFileName: "PCL3UNSP.PPD"
-
-*% *Product, *PSVersion and *Manufacturer are assumed to be included via
-*% gs-pcl3-common.ppd.
-
-*% ****************************************************************************
-
-*% Device selection
-*GhostscriptOptions: "-sDEVICE=pcl3 -sSubdevice=unspec"
-
-*% ****************************************************************************
-
-*% Rendering capabilities
-
-*ColorDevice: True
-
-*OpenUI *ColorModel: PickOne
-*OrderDependency: 20 AnySetup *ColorModel
-*DefaultColorModel: Gray
-*ColorModel Gray: "(<<) cvx exec /ColourModel (Gray) (>>) cvx exec setpagedevice"
-*ColorModel RGB: "(<<) cvx exec /ColourModel (RGB) (>>) cvx exec setpagedevice"
-*ColorModel CMY: "(<<) cvx exec /ColourModel (CMY) (>>) cvx exec setpagedevice"
-*ColorModel CMY+K: "(<<) cvx exec /ColourModel (CMY+K) (>>) cvx exec setpagedevice"
-*ColorModel CMYK: "(<<) cvx exec /ColourModel (CMYK) (>>) cvx exec setpagedevice"
-*CloseUI *ColorModel
-
-%==============================================================================
-
-*% Resolution. Actually, unspec permits any resolution but I've listed only
-*% those which I currently know to be supported on at least one printer.
-
-*OpenUI *Resolution: PickOne
-*DefaultResolution: 300x300dpi
-*OrderDependency: 50 AnySetup *Resolution
-*Resolution 75x75dpi: "(<<) cvx exec /HWResolution [ 75 75] (>>) cvx exec setpagedevice"
-*Resolution 100x100dpi: "(<<) cvx exec /HWResolution [ 100 100] (>>) cvx exec setpagedevice"
-*Resolution 150x150dpi: "(<<) cvx exec /HWResolution [ 150 150] (>>) cvx exec setpagedevice"
-*Resolution 300x300dpi: "(<<) cvx exec /HWResolution [ 300 300] (>>) cvx exec setpagedevice"
-*Resolution 600x300dpi: "(<<) cvx exec /HWResolution [ 600 300] (>>) cvx exec setpagedevice"
-*Resolution 600x600dpi: "(<<) cvx exec /HWResolution [ 600 600] (>>) cvx exec setpagedevice"
-*Resolution 1200x1200dpi: "(<<) cvx exec /HWResolution [1200 1200] (>>) cvx exec setpagedevice"
-*CloseUI *Resolution
-
-%==============================================================================
-
-*% Intensity levels. Again, this is merely a selection of values known to be
-*% supported on at least one printer.
-
-*OpenUI *eprnBlackLevels/Black levels: PickOne
-*OrderDependency: 50 AnySetup *eprnBlackLevels
-*DefaulteprnBlackLevels: Automatic
-*eprnBlackLevels Automatic: ""
-*eprnBlackLevels 0: "(<<) cvx exec /BlackLevels 0 (>>) cvx exec setpagedevice"
-*eprnBlackLevels 2: "(<<) cvx exec /BlackLevels 2 (>>) cvx exec setpagedevice"
-*eprnBlackLevels 4: "(<<) cvx exec /BlackLevels 4 (>>) cvx exec setpagedevice"
-*CloseUI *eprnBlackLevels
-
-*OpenUI *eprnNonBlackLevels/CMY levels: PickOne
-*OrderDependency: 50 AnySetup *eprnNonBlackLevels
-*DefaulteprnNonBlackLevels: Automatic
-*eprnNonBlackLevels Automatic: ""
-*eprnNonBlackLevels 0: "(<<) cvx exec /CMYLevels 0 (>>) cvx exec setpagedevice"
-*eprnNonBlackLevels 2: "(<<) cvx exec /CMYLevels 2 (>>) cvx exec setpagedevice"
-*eprnNonBlackLevels 3: "(<<) cvx exec /CMYLevels 3 (>>) cvx exec setpagedevice"
-*eprnNonBlackLevels 4: "(<<) cvx exec /CMYLevels 4 (>>) cvx exec setpagedevice"
-*CloseUI *eprnNonBlackLevels
-
-*% BlackLevels and colour model must be consistent
-*UIConstraints: *ColorModel Gray *eprnBlackLevels 0
-*UIConstraints: *eprnBlackLevels 0 *ColorModel Gray
-*UIConstraints: *ColorModel CMY *eprnBlackLevels 2
-*UIConstraints: *eprnBlackLevels 2 *ColorModel CMY
-*UIConstraints: *ColorModel CMY *eprnBlackLevels 4
-*UIConstraints: *eprnBlackLevels 4 *ColorModel CMY
-*UIConstraints: *ColorModel CMY+K *eprnBlackLevels 0
-*UIConstraints: *eprnBlackLevels 0 *ColorModel CMY+K
-*UIConstraints: *ColorModel CMYK *eprnBlackLevels 0
-*UIConstraints: *eprnBlackLevels 0 *ColorModel CMYK
-
-*% NonBlackLevels and colour model must be consistent
-*UIConstraints: *ColorModel Gray *eprnNonBlackLevels 2
-*UIConstraints: *eprnNonBlackLevels 2 *ColorModel Gray
-*UIConstraints: *ColorModel Gray *eprnNonBlackLevels 3
-*UIConstraints: *eprnNonBlackLevels 3 *ColorModel Gray
-*UIConstraints: *ColorModel Gray *eprnNonBlackLevels 4
-*UIConstraints: *eprnNonBlackLevels 4 *ColorModel Gray
-*UIConstraints: *ColorModel CMY *eprnNonBlackLevels 0
-*UIConstraints: *eprnNonBlackLevels 0 *ColorModel CMY
-*UIConstraints: *ColorModel CMY+K *eprnNonBlackLevels 0
-*UIConstraints: *eprnNonBlackLevels 0 *ColorModel CMY+K
-*UIConstraints: *ColorModel CMYK *eprnNonBlackLevels 0
-*UIConstraints: *eprnNonBlackLevels 0 *ColorModel CMYK
-
-*% More than two intensity levels are not possible with RGB.
-*UIConstraints: *ColorModel RGB *eprnBlackLevels 4
-*UIConstraints: *eprnBlackLevels 4 *ColorModel RGB
-*UIConstraints: *ColorModel RGB *eprnNonBlackLevels 3
-*UIConstraints: *eprnNonBlackLevels 3 *ColorModel RGB
-*UIConstraints: *ColorModel RGB *eprnNonBlackLevels 4
-*UIConstraints: *eprnNonBlackLevels 4 *ColorModel RGB
-
-*% ****************************************************************************
-
-*% Information on page sizes. These entries assume that you are not using a
-*% media configuration file.
-
-*OpenUI *PageSize: PickOne
-*OrderDependency: 50 AnySetup *PageSize
-*DefaultPageSize: Unknown
-*PageSize Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageSize Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageSize Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageSize A5: "(<<) cvx exec /PageSize [420 595] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize JISB5: "(<<) cvx exec /PageSize [516 729] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Index4x6in: "(<<) cvx exec /PageSize [288 432] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Index5x8in: "(<<) cvx exec /PageSize [360 576] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize A6Card: "(<<) cvx exec /PageSize [298 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Postcard: "(<<) cvx exec /PageSize [283 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize Env10: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize EnvDL: "(<<) cvx exec /PageSize [312 624] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize EnvC6: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice c6"
-*?PageSize: "save /PageSizeQuery /ProcSet resourcestatus
- { pop pop /PageSizeQuery /ProcSet findresource begin query end }
- { (Unknown) }
- ifelse
- = flush restore"
-*End
-*CloseUI *PageSize
-
-*OpenUI *PageRegion: PickOne
-*OrderDependency: 50 AnySetup *PageRegion
-*DefaultPageRegion: Unknown
-*PageRegion Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageRegion Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageRegion Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageRegion A5: "(<<) cvx exec /PageSize [420 595] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion JISB5: "(<<) cvx exec /PageSize [516 729] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Index4x6in: "(<<) cvx exec /PageSize [288 432] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Index5x8in: "(<<) cvx exec /PageSize [360 576] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion A6Card: "(<<) cvx exec /PageSize [298 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Postcard: "(<<) cvx exec /PageSize [283 420] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion Env10: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion EnvDL: "(<<) cvx exec /PageSize [312 624] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion EnvC6: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice c6"
-*CloseUI *PageRegion
-
-*% The *DefaultImageableArea keyword is assumed to be found somewhere else.
-*ImageableArea Letter: "19 34 593 789"
-*ImageableArea Legal: "19 34 593 1005"
-*ImageableArea Executive: "19 34 503 753"
-*ImageableArea A4: "10 34 585 839"
-*ImageableArea A5: "10 34 409 592"
-*ImageableArea JISB5: "10 34 506 725"
-*ImageableArea Index4x6in: "10 34 278 429"
-*ImageableArea Index5x8in: "10 34 350 573"
-*ImageableArea A6Card: "10 34 288 416"
-*ImageableArea Postcard: "10 34 274 416"
-*ImageableArea Env10: "10 63 287 681"
-*ImageableArea EnvDL: "10 63 302 620"
-*ImageableArea EnvC6: "10 63 314 456"
-
-*% ============================================================================
-
-*% Custom page size information
-
-*LeadingEdge Short: ""
-*DefaultLeadingEdge: Short
-
-*MaxMediaWidth: "524287"
-*MaxMediaHeight: "524287"
-*ParamCustomPageSize Width: 2 points 6 524287
-*ParamCustomPageSize Height: 3 points 6 524287
-*ParamCustomPageSize WidthOffset: 4 points 0 0
-*ParamCustomPageSize HeightOffset: 5 points 0 0
-*ParamCustomPageSize Orientation: 1 int 0 3
-*HWMargins: 10 34 10 3
-*CustomPageSize True: "
- pop pop
- 2 index 2 mod 0 eq {exch} if
- 1 index 1 index gt {2}{3} ifelse
- 4 -1 roll add 4 mod
- (<<) cvx exec /PageSize [ 6 -2 roll ]
- /LeadingEdge 5 -1 roll
- % This works only if the interpreter passes this parameter to the device.
- % Ghostscript's setpagedevice definition does not do this by default.
- /ImagingBBox null (>>) cvx exec setpagedevice"
-*End
-*NonUIOrderDependency: 50 AnySetup *CustomPageSize True
-
-*% ****************************************************************************
-
-*% Overriding definition for media types (see also comments in
-*% gs-pcl3-common.ppd)
-*% If you are using CUPS, remove the reduced *MediaType list further down after
-*% concatenation.
-
-*OpenUI *MediaType: PickOne
-*DefaultMediaType: plain
-*OrderDependency: 50 AnySetup *MediaType
-*MediaType plain/plain paper: "(<<) cvx exec /Medium (plain paper) (>>) cvx exec setpagedevice"
-*MediaType bond/bond paper: "(<<) cvx exec /Medium (bond paper) (>>) cvx exec setpagedevice"
-*MediaType Premium/HP Premium paper: "(<<) cvx exec /Medium (HP Premium paper) (>>) cvx exec setpagedevice"
-*MediaType glossy/glossy paper: "(<<) cvx exec /Medium (glossy paper) (>>) cvx exec setpagedevice"
-*MediaType transparency/transparency film: "(<<) cvx exec /Medium (transparency film) (>>) cvx exec setpagedevice"
-*MediaType quickglossy/quick dry glossy: "(<<) cvx exec /Medium (quick dry glossy) (>>) cvx exec setpagedevice"
-*MediaType quicktransparency/quick dry transparency: "(<<) cvx exec /Medium (quick dry transparency) (>>) cvx exec setpagedevice"
-*CloseUI *MediaType
-
-*% ****************************************************************************
-
-*% Duplex
-
-*OpenUI *Duplex: PickOne
-*DefaultDuplex: None
-*OrderDependency: 50 AnySetup *Duplex
-*Duplex None: "(<<) cvx exec /Duplex false (>>) cvx exec setpagedevice"
-*Duplex DuplexNoTumble: "(<<) cvx exec
- /PJLLanguage (PCL3GUI)
- /OnlyCRD true
- /DuplexCapability (oppositeLeadingEdge) % Works for DJ 970C.
- /Duplex true /Tumble false (>>) cvx exec setpagedevice"
-*End
-*Duplex DuplexTumble: "(<<) cvx exec
- /PJLLanguage (PCL3GUI)
- /OnlyCRD true
- /DuplexCapability (oppositeLeadingEdge) % Works for DJ 970C.
- /Duplex true /Tumble true (>>) cvx exec setpagedevice"
-*End
-*CloseUI *Duplex
-
-*% ****************************************************************************
-
-*% If supported, this is the place to add an *OutputBin entry. See the
-*% PPD specification and the *InputSlot entry in gs-pcl3-common.ppd.
-
-*% ****************************************************************************
-
-*% Common parts:
-*Include: "gs-pcl3-common.ppd"
diff --git a/gs/contrib/pcl3/ppd/gs-pcl3-unspecold.ppd b/gs/contrib/pcl3/ppd/gs-pcl3-unspecold.ppd
deleted file mode 100644
index c25bfe45d..000000000
--- a/gs/contrib/pcl3/ppd/gs-pcl3-unspecold.ppd
+++ /dev/null
@@ -1,109 +0,0 @@
-*PPD-Adobe: "4.3"
-*% ****************************************************************************
-*% File: @(#)$Id: gs-pcl3-unspecold.ppd,v 1.2 2001/03/23 15:50:13 Martin Rel $
-*% Contents: PPD file for the subdevice "unspecold" of the pcl3 driver
-*% Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-*% Germany, Martin.Lottermoser@t-online.de
-*%
-*% ****************************************************************************
-*%
-*% Copyright (C) 2001 Martin Lottermoser
-*% All rights reserved
-*%
-*% ****************************************************************************
-
-*% Required general information keywords
-
-*FileVersion: "1.0"
-*FormatVersion: "4.3"
-*LanguageEncoding: ISOLatin1
-*LanguageVersion: English
-*ModelName: "ghostscript/pcl3/unspecold"
-*ShortNickName: "ghostscript/pcl3/unspecold"
-*NickName: "ghostscript/pcl3/unspecold"
-*PCFileName: "PCL3UNSO.PPD"
-
-*% *Product, *PSVersion and *Manufacturer are assumed to be included via
-*% gs-pcl3-common.ppd.
-
-*% ****************************************************************************
-
-*% Device selection
-*GhostscriptOptions: "-sDEVICE=pcl3 -sSubdevice=unspecold"
-
-*% ****************************************************************************
-
-*% Rendering capabilities
-
-*ColorDevice: True
-
-*OpenUI *ColorModel: PickOne
-*OrderDependency: 20 AnySetup *ColorModel
-*DefaultColorModel: Gray
-*ColorModel Gray: "(<<) cvx exec /ColourModel (Gray) (>>) cvx exec setpagedevice"
-*ColorModel RGB: "(<<) cvx exec /ColourModel (RGB) (>>) cvx exec setpagedevice"
-*ColorModel CMY: "(<<) cvx exec /ColourModel (CMY) (>>) cvx exec setpagedevice"
-*ColorModel CMY+K: "(<<) cvx exec /ColourModel (CMY+K) (>>) cvx exec setpagedevice"
-*ColorModel CMYK: "(<<) cvx exec /ColourModel (CMYK) (>>) cvx exec setpagedevice"
-*CloseUI *ColorModel
-
-*% Resolution. Actually, unspecold permits any resolution but I've listed only
-*% those which I currently know to be supported by at least one group-2 DeskJet.
-*OpenUI *Resolution: PickOne
-*DefaultResolution: 300x300dpi
-*OrderDependency: 50 AnySetup *Resolution
-*Resolution 75x75dpi: "(<<) cvx exec /HWResolution [ 75 75] (>>) cvx exec setpagedevice"
-*Resolution 100x100dpi: "(<<) cvx exec /HWResolution [100 100] (>>) cvx exec setpagedevice"
-*Resolution 150x150dpi: "(<<) cvx exec /HWResolution [150 150] (>>) cvx exec setpagedevice"
-*Resolution 300x300dpi: "(<<) cvx exec /HWResolution [300 300] (>>) cvx exec setpagedevice"
-*CloseUI *Resolution
-
-*% ****************************************************************************
-
-*% Information on page sizes. These entries assume that you are not using a
-*% media configuration file.
-
-*OpenUI *PageSize: PickOne
-*OrderDependency: 50 AnySetup *PageSize
-*DefaultPageSize: Unknown
-*PageSize Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageSize Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageSize Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageSize Env10: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageSize EnvDL: "(<<) cvx exec /PageSize [312 624] /ImagingBBox null (>>) cvx exec setpagedevice"
-*?PageSize: "save /PageSizeQuery /ProcSet resourcestatus
- { pop pop /PageSizeQuery /ProcSet findresource begin query end }
- { (Unknown) }
- ifelse
- = flush restore"
-*End
-*CloseUI *PageSize
-
-*OpenUI *PageRegion: PickOne
-*OrderDependency: 50 AnySetup *PageRegion
-*DefaultPageRegion: Unknown
-*PageRegion Letter: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice letter"
-*PageRegion Legal: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice legal"
-*PageRegion Executive: "(<<) cvx exec /PageSize [522 756] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion A4: "(<<) cvx exec /ImagingBBox null (>>) cvx exec setpagedevice a4"
-*PageRegion Env10: "(<<) cvx exec /PageSize [297 684] /ImagingBBox null (>>) cvx exec setpagedevice"
-*PageRegion EnvDL: "(<<) cvx exec /PageSize [312 624] /ImagingBBox null (>>) cvx exec setpagedevice"
-*CloseUI *PageRegion
-
-*% The *DefaultImageableArea keyword is assumed to be found somewhere else.
-*ImageableArea Letter: "18 34 594 789"
-*ImageableArea Legal: "18 34 594 1005"
-*ImageableArea Executive: "18 34 507 753"
-*ImageableArea A4: "9 34 585 839"
-*ImageableArea Env10: "9 52 288 681"
-*ImageableArea EnvDL: "9 52 301 620"
-
-*% ****************************************************************************
-
-*% Add the duplex entry here if supported (see gs-pcl3-unspec.ppd).
-
-*% ****************************************************************************
-
-*% Common parts:
-*Include: "gs-pcl3-common.ppd"
diff --git a/gs/contrib/pcl3/ps/calign.ps b/gs/contrib/pcl3/ps/calign.ps
deleted file mode 100644
index 37c566726..000000000
--- a/gs/contrib/pcl3/ps/calign.ps
+++ /dev/null
@@ -1,232 +0,0 @@
-%!PS-Adobe-3.0
-%%Title: (Colorant Alignment Test)
-%%Copyright: Copyright (C) 2000 by Martin Lottermoser. All rights reserved.
-%%Creator: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig, Germany. E-mail: Martin.Lottermoser@t-online.de.
-%%CreationDate: $Date: 2000/08/30 16:53:36 $
-%%Pages: 1
-%%Orientation: Portrait
-%%LanguageLevel: 2
-%%DocumentNeededResources: font Helvetica Helvetica-Bold
-%%EndComments
-%******************************************************************************
-%
-% This PostScript program generates a test page for visually inspecting the
-% relative alignment of black and other colorants.
-%
-% It is intended for ghostscript devices driving CMYK-capable HP DeskJet
-% printers. These printers have several ink cartridges, usually one for black
-% and a second for cyan, magenta and yellow. After insertion of a new
-% cartridge, one should configure the printer for the proper relative alignment
-% of these two cartridges. This program can be used to check to which extent
-% the cartridges are aligned.
-%
-% You can print this document on ISO A4 or US Letter.
-%
-%******************************************************************************
-%%BeginProlog
-
-/runter { % <Distanz> runter -
- currentpoint
- 3 -1 roll sub
- exch pop 50 exch
- moveto
-} bind def
-
-/Pixelmitte { % <x> <y> Pixelmitte <xx> <yy>
- transform
- 2 {floor 0.5 add exch} repeat
- itransform
-} bind def
-
-/zeigeZentriert { % <Zeichenkette> zeigeZentriert -
- dup stringwidth exch -2 div exch rmoveto show
-} bind def
-
-/zeigeDistanz { % <Anzahl Pixel> zeigeDistanz -
- gsave
- Strichlaenge 1.5 mul Strichlaenge -4 mul rmoveto
- temp cvs zeigeZentriert
- grestore
-} bind def
-
-/Pixeldistanz { % <x> <y> Pixeldistanz <xx> <yy>
- dtransform
- dup abs 2 index abs le % <x'> <y'> |y'|<=|x'|
- {
- pop 0 ge {1}{-1} ifelse
- 0
- }
- {
- 0 ge {1}{-1} ifelse
- exch pop 0 exch
- }
- ifelse
- idtransform
-} bind def
-
-/Ausrichtung { % <CMYK-Farbe> <y-Verschiebung> Ausrichtung -
- gsave
- 0 setlinewidth
- 0 setgray
- newpath
- 0 0 moveto
- Strichlaenge 0 rlineto
- stroke
-
- newpath
- Strichlaenge exch moveto
- aload pop setcmykcolor
- Strichlaenge 0 rlineto
- stroke
-
- 0 setgray
- newpath
- Strichlaenge 2 mul 0 moveto
- Strichlaenge 0 rlineto
- stroke
- grestore
-} bind def
-
-/horizontal { % <CMYK-Farbe> <Anzahl Pixel> horizontal -
- gsave
- Strichlaenge 1.5 mul 0 rmoveto
- currentpoint Pixelmitte translate
- -90 rotate
- hPixel mul
- Ausrichtung
- grestore
-} bind def
-
-/vertikal { % <CMYK-Farbe> <Anzahl Pixel> vertikal -
- gsave
- 0 Strichlaenge -1.5 mul rmoveto
- currentpoint Pixelmitte translate
- vPixel mul
- Ausrichtung
- grestore
-} bind def
-
-/Testfolge { % <CMYK-Farbe> <Name der Prozedur> Testfolge -
- load
- -6 1 6.001
- { % <CMYK-Farbe> <Prozedur> <Distanz>
- 2 index
- 1 index
- 3 index exec
- zeigeDistanz
- hDistanz 0 rmoveto
- } for
- pop pop
- Strichlaenge 6 mul runter
-} bind def
-
-%%EndProlog
-%******************************************************************************
-%%BeginSetup
-
-%%IncludeResource: font Helvetica-Bold
-/gross /Helvetica-Bold findfont 10 scalefont def
-/sehrgross /Helvetica-Bold findfont 12 scalefont def
-
-%%IncludeResource: font Helvetica
-/normal /Helvetica findfont 10 scalefont def
-/klein /Helvetica findfont 7 scalefont def
-
-/temp 100 string def
-
-% Layout-Parameter
-/hDistanz 40 def % Abstand zwischen Tests
-/Strichlaenge 10 def
-
-% CMYK-Werte als Arrays
-/Zyan [1 0 0 0] def
-/Magenta [0 1 0 0] def
-/Gelb [0 0 1 0] def
-
-% Horizontale und vertikale Abstände für 1 Pixel
-/hPixel 1 0 Pixeldistanz pop def
-/vPixel 0 1 Pixeldistanz exch pop def
-
-% Kontrollen der Pixeldistanzen
-hPixel 0 dtransform
-dup mul exch dup mul add sqrt 1 sub abs
-0.000001 gt
-{
- (WARNING! Violation of an assumption \(horizontal distance\) concerning the relative alignment of user and device space.) =
-} if
-0 vPixel dtransform
-dup mul exch dup mul add sqrt 1 sub abs
-0.000001 gt
-{
- (WARNING! Violation of an assumption \(vertical distance\) concerning the relative alignment of user and device space.) =
-} if
-
-%%EndSetup
-%******************************************************************************
-%%Page: 1 1
-
-% Damit alles sowohl auf A4 als auch auf US Letter paßt, darf man nicht über
-% eine Breite von 595 und eine Höhe von 792 bp hinausgehen.
-
-% Überschrift
-sehrgross setfont
-300 720 moveto
-(Colorant Alignment Test) zeigeZentriert
-
-% Auflösung dokumentieren
-40 runter
-normal setfont
-(The resolution is ) show
-currentpagedevice /HWResolution get
-aload pop exch temp cvs show
-( x ) show
-temp cvs show
-( pixels per inch.) show
-
-% Hinweis zu den Einheiten
-12 runter
-(The number printed with each test is the number of pixels the line in the middle has been shifted with respect to the) show
-12 runter
-(neighbouring lines.) show
-
-%------------------------------------------------------------------------------
-
-40 runter
-gross setfont
-(Horizontal Alignment) show
-20 runter
-
-normal setfont
-
-Zyan /horizontal Testfolge
-Magenta /horizontal Testfolge
-Gelb /horizontal Testfolge
-
-%------------------------------------------------------------------------------
-
-40 runter
-gross setfont
-(Vertical Alignment) show
-20 runter
-
-normal setfont
-
-Zyan /vertikal Testfolge
-Magenta /vertikal Testfolge
-Gelb /vertikal Testfolge
-
-%------------------------------------------------------------------------------
-
-50 runter
-klein setfont
-(Author: Martin Lottermoser) show
-11 runter
-($Id: calign.ps,v 1.3 2000/08/30 16:53:36 Martin Rel $) show
-
-%------------------------------------------------------------------------------
-
-showpage
-
-%******************************************************************************
-%%Trailer
-%%EOF
diff --git a/gs/contrib/pcl3/ps/dumppdd.ps b/gs/contrib/pcl3/ps/dumppdd.ps
deleted file mode 100644
index c5158d1b3..000000000
--- a/gs/contrib/pcl3/ps/dumppdd.ps
+++ /dev/null
@@ -1,62 +0,0 @@
-%!PS-Adobe-3.0 Query
-%%Title: Program for dumping the page device dictionary to stdout
-%%Copyright: Copyright (C) 2000 by Martin Lottermoser. All rights reserved.
-%%Creator: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig, Germany. E-mail: Martin.Lottermoser@t-online.de.
-%%CreationDate: $Date: 2000/10/22 09:20:00 $
-%%EndComments
-
-%******************************************************************************
-
-%%?BeginQuery: dumppdd
-% @(#)$Id: dumppdd.ps,v 1.5 2000/10/22 09:20:00 Martin Rel $
-
-%%BeginResource: procset mjl-sort 1.3 0
-% @(#)$OriginalId: sort.ps,v 1.3 1997/10/21 04:50:37 mjl Exp $
-/mjl-sort-dict where { pop } { /mjl-sort-dict 6 dict def mjl-sort-dict
-begin /temp1 100 string def /temp2 100 string def /Vergleich { dup type dup
-/integertype eq 1 index /realtype eq or 1 index /stringtype eq or exch pop
-not { temp2 cvs exch temp1 cvs exch } if le } def /SortierteKeys { dup length
-array 2 dict begin /a exch def /j 0 def { pop a j 3 -1 roll put /j j 1 add
-def } forall a end ArraySortieren } def /ArraySortieren { 1 dict begin /a
-exch def 0 a length 1 sub dup 0 gt {SubarraySortieren} {pop pop} ifelse a
-end } def /SubarraySortieren { 6 dict begin /rechts exch def /links exch
-def /i links def /j rechts def /Wert a links rechts add 2 idiv get def {
-{ Wert a i get Vergleich {exit} if /i i 1 add def } loop { a j get Wert
-Vergleich {exit} if /j j 1 sub def } loop i j le { /w a i get def a i a
-j get put a j w put /i i 1 add def /j j 1 sub def } if i j gt {exit} if }
-loop links j i rechts end dup 3 -1 roll dup 4 1 roll gt {SubarraySortieren}
-{pop pop} ifelse dup 3 -1 roll dup 4 1 roll gt {SubarraySortieren} {pop pop}
-ifelse } def end } ifelse
-%%EndResource
-
-%%BeginResource: procset glglMitDict 1.1 0
-% @(#)$OriginalId: glglMitDict.ps,v 1.2 2000-07-23 18:52:39+02 Martin Exp $
-% Copyright (C) 1999, 2000 by Martin Lottermoser. All rights reserved.
-/glglDict where {pop} { 10 dict begin /temp 200 string def /zeige_Leerzeichen
-{ {( ) print} repeat } def /Einrueckung 0 def /integertype { temp cvs print }
-def /nametype { (/) print temp cvs print } def /dicttype { (<<) = /Einrueckung
-Einrueckung 2 add def [ 1 index {pop} forall ] /mjl-sort-dict where { pop
-mjl-sort-dict begin ArraySortieren end } if { Einrueckung zeige_Leerzeichen
-dup zeige_Objekt not { Einrueckung 1 add zeige_Leerzeichen } if ( ) print 1
-index exch get zeige_Objekt {() =} if } forall pop /Einrueckung Einrueckung
-2 sub def Einrueckung zeige_Leerzeichen (>>) print } def /zeige_Objekt {
-dup type glglDict 1 index known { glglDict exch get exec true } { pop ==
-false } ifelse } bind def currentdict end /glglDict exch def /=== { glglDict
-begin zeige_Objekt {() =} if end } bind def } ifelse
-%%EndResource
-
-%------------------------------------------------------------------------------
-
-() =
-(Current Page Device Dictionary Contents) =
-(=======================================) =
-
-currentpagedevice ===
-
-%------------------------------------------------------------------------------
-
-%%?EndQuery: Failed to access the PostScript interpreter.
-
-%******************************************************************************
-
-%%EOF
diff --git a/gs/contrib/pcl3/ps/levels-test.ps b/gs/contrib/pcl3/ps/levels-test.ps
deleted file mode 100644
index 9bdd35778..000000000
--- a/gs/contrib/pcl3/ps/levels-test.ps
+++ /dev/null
@@ -1,464 +0,0 @@
-%!PS-Adobe-3.0
-%%Title: (CMYK Intensity Level Representation Test for the pcl3 Driver)
-%%Copyright: Copyright (C) 2000 by Martin Lottermoser. All rights reserved.
-%%Creator: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig, Germany; e-mail: Martin.Lottermoser@t-online.de
-%%CreationDate: $Date: 2000/12/11 18:01:54 $
-%%LanguageLevel: 2
-%%Pages: 1
-%%Orientation: Portrait
-%%DocumentNeededResources: font Helvetica Helvetica-Bold
-%%EndComments
-%******************************************************************************
-% @(#)$Id: levels-test.ps,v 1.14 2000/12/11 18:01:54 Martin Rel $
-%
-% This PostScript program generates a test page for visually inspecting the
-% representation of equally-spaced CMYK intensity levels.
-% It is intended for the use with ghostscript's pcl3 driver.
-%
-% You can print this document on media of ISO A4 or US Letter size.
-%
-%******************************************************************************
-%%BeginProlog
-
-/runter { % <Distanz> runter -
- currentpoint
- 3 -1 roll sub
- exch pop links exch
- moveto
-} bind def
-
-% Schriftgroesse 10 bp vorausgesetzt.
-/nz { 12 runter } def
-/hz { 6 runter } def
-
-/ein {
- currentpoint exch pop 150 exch moveto
-} bind def
-
-/zeigeZentriert { % <Zeichenkette> zeigeZentriert -
- dup stringwidth exch -2 div exch rmoveto show
-} bind def
-
-%------------------------------------------------------------------------------
-
-/hole_falls_bekannt { % <dict> <Name> hole_falls_bekannt [<Wert>] <gefunden>
- 2 copy known
- {get true} {pop pop false} ifelse
-} bind def
-
-/zeigeParameter { % <Name> zeigeParameter -
- ein
- currentpagedevice exch hole_falls_bekannt
- {temp cvs}{(unknown)} ifelse
- show
-} bind def
-
-/zeigeParameterFallsBekannt { % <Name> zeigeParameterFallsBekannt -
- dup currentpagedevice exch hole_falls_bekannt
- {
- exch temp cvs show (:) show ein
- dup type /nulltype eq
- {(--null--)} % zur Unterscheidung von (null).
- {temp cvs}
- ifelse
- show nz
- }
- {
- pop
- }
- ifelse
-} bind def
-
-%------------------------------------------------------------------------------
-
-/zeigeFrequenz { % <dict> <Schluessel> zeigeFrequenz -
- get temp cvs show ( cells/inch) show
-} bind def
-
-/zeigeTF { % <HTD> zeigeTF -
- /TransferFunction known
- {(, transfer) show}
- if
-} bind def
-
-% Komponenten-Verzeichnisse in einem Typ-5-Verzeichnis
-/HTDict2 <<
- % Aufrufe: <HTD> <Routine> -, kein Zeilenumbruch
- 1 {
- (, ) show /Frequency zeigeFrequenz
- }
- 3 {
- (, ) show
- dup /Width get temp cvs show (x) show /Height get temp cvs show
- ( pixels) show
- }
- dup 6 exch % 6 kann hier wie 3 behandelt werden.
->> def
-
-/zeigeTransfer { % <HTD> zeigeTransfer -
- /TransferFunction known
- {(With transfer function.) show nz} if
-} bind def
-
-% Oberste Ebene
-/HTDict1 <<
- % Aufrufe: <HTD> <Routine> -
- 1 {
- (Frequency: ) show
- dup /Frequency zeigeFrequenz nz
- zeigeTransfer
- }
- 2 {
- % Die Ausrichtung klappt nicht ganz, weil Helvetica eine
- % Proportionalschrift ist.
- dup (Red: ) show /RedFrequency zeigeFrequenz nz
- dup (Green: ) show /GreenFrequency zeigeFrequenz nz
- dup (Blue: ) show /BlueFrequency zeigeFrequenz nz
- (Gray: ) show /GrayFrequency zeigeFrequenz nz
- }
- 3 {
- (Cell size: ) show
- dup /Width get temp cvs show (x) show
- dup /Height get temp cvs show ( pixels) show nz
- zeigeTransfer
- }
- dup 6 exch % 6 kann hier wie 3 behandelt werden.
- 5 {
- [/Default /Gray /Red /Green /Blue /Cyan /Magenta /Yellow /Black]
- {
- % <HTD_1> <Name>
- 1 index 1 index known
- {
- % <HTD_1> <Name>
- dup temp cvs show (: ) show
- 1 index exch get % <HTD_1> <HTD_2>
- dup
- (type ) show dup /HalftoneType get dup temp cvs show
- % <HTD_1> <HTD_2> <HTD_2> <Typ>
- HTDict2 zeigeHTTeile
- zeigeTF
- nz
- }
- {pop}
- ifelse
- % <HTD_1>
- } forall
- pop
- }
->> def
-
-/zeigeHTTeile { % <HTD> <Typ> <Routinen-Verzeichnis> zeigeHTTeile -
- dup 2 index known
- { exch get exec } % <HTD> Routine -
- { pop pop pop }
- ifelse
-} bind def
-
-%------------------------------------------------------------------------------
-
-/Rechteckpfad { % - Rechteckpfad -
- currentpoint
- newpath
- moveto
- Breite 0 rlineto
- 0 Hoehe rlineto
- Breite neg 0 rlineto
- closepath
-} bind def
-
-/Rechteck { % <C> <M> <Y> <K> Rechteck -
- gsave
- setcmykcolor
- Rechteckpfad
- currentpoint fill moveto
- mitRand
- {
- 0 setgray
- 0 setlinewidth
- Rechteckpfad
- stroke
- } if
- grestore
-} bind def
-
-/macheTest { % <Array mit Farbe> <Levels> macheTest -
- /maxLevel exch 1 sub def
- gsave
- 0 1 maxLevel
- {
- maxLevel div
- 1 index aload pop % <Faktor> <C> <M> <Y> <K>
- 1 1 4 {pop 4 index mul 4 1 roll} for
- Rechteck
- pop
- Breite 0 rmoveto
- } for
- grestore
- pop
- mitRand not
- {
- gsave
- 0 setlinewidth 0 setgray
- currentpoint newpath moveto
- maxLevel 1 add Breite mul
- dup 0 rlineto
- 0 Hoehe rlineto
- neg 0 rlineto
- closepath
- stroke
- grestore
- } if
- Hoehe 1.2 mul runter
-} bind def
-
-/vollerTest { % <mit Nummern> vollerTest -
- % Parameteruebergabe durch dict stack: schwarzeStufen, CMYStufen, Basisbreite,
- % Maximalbreite, Hoehe.
-
- % Maximale Anzahl Stufen
- /maxStufen
- schwarzeStufen CMYStufen gt {schwarzeStufen} {CMYStufen} ifelse
- def
-
- % Tatsaechliche Breite der 4 Testkaesten
- /Kastenbreite
- maxStufen Basisbreite mul dup Maximalbreite gt {pop Maximalbreite} if
- def
-
- % Ueberschrift
- gross setfont
- (Test with ) show
- CMYStufen temp cvs show
- CMYStufen schwarzeStufen ne
- { ( CMY and ) show schwarzeStufen temp cvs show ( black) show } if
- ( levels) show
- nz
- normal setfont
-
- /Breite Kastenbreite CMYStufen div def
-
- % Nummerierung, falls gewuenscht und sinnvoll
- CMYStufen schwarzeStufen eq and
- {
- gsave
- sehrklein setfont
- Breite 2 div 0 rmoveto
- 0 1 schwarzeStufen 1 sub
- {
- temp cvs
- gsave zeigeZentriert grestore
- Breite 0 rmoveto
- } for
- grestore
- 3 runter
- } if
-
- % Die vier Streifen
- Hoehe runter
- [1 0 0 0] CMYStufen macheTest
- [0 1 0 0] CMYStufen macheTest
- [0 0 1 0] CMYStufen macheTest
- /Breite Kastenbreite schwarzeStufen div def
- [0 0 0 1] schwarzeStufen macheTest
-} bind def
-
-%%EndProlog
-%******************************************************************************
-%%BeginSetup
-
-%%IncludeResource: font Helvetica-Bold
-/gross /Helvetica-Bold findfont 10 scalefont def
-/sehrgross /Helvetica-Bold findfont 12 scalefont def
-
-%%IncludeResource: font Helvetica
-/normal /Helvetica findfont 10 scalefont def
-/klein /Helvetica findfont 7 scalefont def
-/sehrklein /Helvetica findfont 5 scalefont def
-
-/temp 100 string def
-
-/links 50 def
-
-/Basisbreite 20 def
-/Breite Basisbreite def
-/Hoehe Basisbreite def
-/Maximalbreite 515 def
-
-/mitRand true def
-
-%%EndSetup
-%******************************************************************************
-%%Page: 1 1
-
-% Damit alles sowohl auf A4 als auch auf US Letter passt, darf man nicht ueber
-% eine Breite von 595 und eine Hoehe von 792 bp hinausgehen.
-
-% Ueberschrift
-sehrgross setfont
-300 760 moveto
-(CMYK Intensity Level Representation Test) zeigeZentriert
-
-%==============================================================================
-
-% Erlaeuterung
-links 740 moveto
-normal setfont
-(This test page \(designed for ghostscript's pcl3 driver\) is intended \
-for visually inspecting the representation of) show nz
-(equally-spaced intensity levels.) show nz
-nz
-
-%==============================================================================
-
-% Konfiguration
-gross setfont
-(Configuration for this test run) show nz
-normal setfont
-hz
-/HoeheKonfiguration currentpoint exch pop def % Merken der Hoehe.
-(Product:) show ein
- product show ( \(revision ) show revision temp cvs show (\)) show nz
-(Interpreter version:) show ein version show nz
-/OutputDevice zeigeParameterFallsBekannt % Optional seit Level 3.
-/Subdevice zeigeParameterFallsBekannt % pcl3
-/Model zeigeParameterFallsBekannt % hpdj
-currentpagedevice /ColourModel known
-{ (ColourModel: ) show /ColourModel zeigeParameter nz } % pcl3
-{
- currentpagedevice /ColourMode known % hpdj
- { (ColourMode: ) show /ColourMode zeigeParameter nz }
- { /ProcessColorModel zeigeParameterFallsBekannt}
- ifelse
-}
-ifelse
-/schwarzeStufen 2 def
-currentpagedevice /BlackLevels known
-{
- (BlackLevels: ) show ein
- currentpagedevice /BlackLevels get
- dup /schwarzeStufen exch def
- temp cvs
- show nz
-} if
-schwarzeStufen 0 le { /schwarzeStufen 2 def } if
-/CMYStufen 2 def
-currentpagedevice /CMYLevels known
-{
- currentpagedevice dup /ColourModel known
- { /ColourModel get (RGB) eq }
- { pop false } % hpdj
- ifelse
- {
- (RGBLevels: ) show ein
- currentpagedevice /RGBLevels get
- }
- {
- (CMYLevels: ) show ein
- currentpagedevice /CMYLevels get
- }
- ifelse
- dup /CMYStufen exch def
- temp cvs
- show nz
-} if
-CMYStufen 0 le { /CMYStufen 2 def } if
-/IntensityRendering zeigeParameterFallsBekannt % pcl3
-(Resolution: ) show ein
-currentpagedevice /HWResolution get
-aload pop exch temp cvs show ( x ) show temp cvs show
-( pixels per inch) show nz
-/PrintQuality zeigeParameterFallsBekannt
-currentpagedevice /Medium known
-{ /Medium zeigeParameterFallsBekannt } % pcl3
-{
- % MediaType ist ein Standard-Parameter, aber wir wollen ihn nur fuer hpdj
- % sehen.
- currentpagedevice dup /OutputDevice known
- {
- /OutputDevice get
- (hpdj) eq { (MediaType: ) show /MediaType zeigeParameter nz } if
- }
- { pop }
- ifelse
-}
-ifelse
-
-hz
-
-% Transferfunktionen
-currentcolortransfer true
-0 1 3 { pop exch length 0 eq and } for
-{(This test run uses trivial transfer functions \(no gamma correction\).) show}
-{(This test run uses non-trivial transfer functions \(gamma correction\).) show}
-ifelse
-nz
-
-/HoeheEndeKonfiguration currentpoint exch pop def
-
-% Halbtonzustand
-/links links 300 add def
-links HoeheKonfiguration moveto
-currenthalftone dup /HalftoneType get dup
-(Halftone type: ) show temp cvs show nz % <HTD> <Typ>
-HTDict1 zeigeHTTeile
-/links 50 def
-links HoeheEndeKonfiguration moveto
-
-nz
-
-%==============================================================================
-
-% Test mit BlackLevels und CMYLevels
-false vollerTest
-nz
-
-%==============================================================================
-
-% Sei h >= 2 die Anzahl von der Hardware darstellbarer Stufen und p >= 1 die
-% Anzahl Pixel im Halbtonschirm. Dann kann man insgesamt
-%
-% n = h + (h - 1)*(p - 1) = (h - 1)*p + 1
-%
-% verschiedene Intensitaeten darstellen. Gleichmaessig ueber das Intervall
-% [0, 1] verteilt, findet man sie an den Stellen:
-%
-% Intensitaet(j) = j/(n - 1), 0 <= j <= n-1
-%
-% Waehlt man nun eine andere (natuerlich groessere) Stufenzahl N fuer den
-% Aufruf von 'vollerTest', so bekommt man diese Intensitaeten genau dann mit,
-% wenn N-1 ein Vielfaches von n-1 ist. Einsetzen der Hardware-Stufen fuehrt zu
-% der Aussage, dass N-1 ein Vielfaches von (h - 1)*p sein muss, notwendigerweise
-% also ein Vielfaches von h-1.
-
-% Der folgende Test soll mindestens in den Faellen h = 2, 3, 4 und 8 die
-% exakt darstellbaren Intensitaeten treffen. Dies erfordet, dass N-1 ein
-% Vielfaches von kgV(1, 2, 3, 7) = 42 sein muss. (Diese Nummer kenn' ich doch
-% irgendwoher...)
-/schwarzeStufen 43 def
-/CMYStufen schwarzeStufen def
-true vollerTest
-nz
-
-% Ein Test mit effektiv kontinuierlicher Aenderung der Intensitaet.
-% Die 401 kommen als kgV(16, 25) + 1 zustande, wobei ich an 4x4 und 5x5 Pixel
-% grosse Halbtonzellen denke.
-% Bei dieser Anzahl und 300 ppi hat jedes Feld etwas mehr als 5 Pixel zur
-% Verfuegung (Maximalbreite/72*300/401).
-/mitRand false def
-/schwarzeStufen 401 def
-/CMYStufen schwarzeStufen def
-false vollerTest
-
-%==============================================================================
-
-30 runter
-klein setfont
-(Author: Martin Lottermoser) show
-10 runter
-($Id: levels-test.ps,v 1.14 2000/12/11 18:01:54 Martin Rel $) show
-
-showpage
-
-%******************************************************************************
-%%Trailer
-%%EOF
diff --git a/gs/contrib/pcl3/ps/margins-A4.ps b/gs/contrib/pcl3/ps/margins-A4.ps
deleted file mode 100644
index 6202ea593..000000000
--- a/gs/contrib/pcl3/ps/margins-A4.ps
+++ /dev/null
@@ -1,76 +0,0 @@
-%!PS-Adobe-3.0
-%%Title: Margin test file for the page size A4
-%%Copyright: Copyright (C) 1997, 1998, 1999, 2000 by Martin Lottermoser. All rights reserved.
-%%Creator: makemtf 1.19
-%%CreationDate: Sun Aug 19 12:16:16 CEST 2001
-%%Pages: 1
-%%DocumentNeededResources: font Courier
-%%DocumentMedia: A4 595 842 0 () ()
-%%Comments: The first entry in the preceding line should really be an empty
-%%+ string. That it is not is a concession to bugs in ghostview and gv.
-%%LanguageLevel: 1
-%%EndComments
-
-%%BeginProlog
-/in {72 mul} def
-/mm {0.0 mul} dup 0 72 25.4 div put def
-
-/crossdict 8 dict def % 4 defined here, 4 more defined at runtime
-crossdict begin
- /reverse {0.0 mul} dup 0 25.4 72 div put def
- /temp 100 string def
- /showrounded {10.0 mul round 10.0 div temp cvs show} def
- /append { % <string> <substring> append <string+substring>
- exch dup dup length % <substring> <string> <string> <length>
- 4 -1 roll putinterval
- } def
-end
-
-/cross { % <right> <top> <x> <y> cross -
- crossdict begin
- /y exch def /x exch def
- % 1 pt distance from the edges:
- 25 mm 1 sub mul /top exch def
- 25 mm 1 sub mul /right exch def
- 0 setlinewidth
- newpath
- x y moveto
- right 0 rmoveto
- x y lineto
- 0 top rlineto
- stroke
- x y moveto
- right -0.2 mul dup 0 lt {70 sub} if
- top -0.2 mul dup 0 lt { 8 sub} if
- rmoveto
- (\() show x reverse showrounded (, ) show
- y reverse showrounded (\)) show
- end
-} def
-%%EndProlog
-
-%%BeginSetup
-%%BeginFeature: *PageSize A4
-/languagelevel where {pop languagelevel} {1} ifelse 2 lt
-{ a4 }
-{ 1 dict begin /PageSize [595.27 841.88] def currentdict end setpagedevice }
-ifelse
-%%EndFeature
-%%IncludeResource: font Courier
-/Courier findfont 8 scalefont setfont
-%%EndSetup
-
-%%Page: 1 1
-
-297 421 moveto (Page size: A4)
-dup stringwidth -2 div exch -2 div exch rmoveto show
-
--1 -1 25 mm 25 mm cross
- 1 -1 595.27 25 mm sub 25 mm cross
--1 1 25 mm 841.88 25 mm sub cross
- 1 1 595.27 25 mm sub 841.88 25 mm sub cross
-
-showpage
-
-%%Trailer
-%%EOF
diff --git a/gs/contrib/pcl3/ps/margins-A4Rotated.ps b/gs/contrib/pcl3/ps/margins-A4Rotated.ps
deleted file mode 100644
index b0c35256e..000000000
--- a/gs/contrib/pcl3/ps/margins-A4Rotated.ps
+++ /dev/null
@@ -1,73 +0,0 @@
-%!PS-Adobe-3.0
-%%Title: Margin test file for the page size A4Rotated
-%%Copyright: Copyright (C) 1997, 1998, 1999, 2000 by Martin Lottermoser. All rights reserved.
-%%Creator: makemtf 1.19
-%%CreationDate: Sun Aug 19 12:16:17 CEST 2001
-%%Pages: 1
-%%DocumentNeededResources: font Courier
-%%DocumentMedia: A4Rotated 842 595 0 () ()
-%%Comments: The first entry in the preceding line should really be an empty
-%%+ string. That it is not is a concession to bugs in ghostview and gv.
-%%LanguageLevel: 2
-%%EndComments
-
-%%BeginProlog
-/in {72 mul} def
-/mm {0.0 mul} dup 0 72 25.4 div put def
-
-/crossdict 8 dict def % 4 defined here, 4 more defined at runtime
-crossdict begin
- /reverse {0.0 mul} dup 0 25.4 72 div put def
- /temp 100 string def
- /showrounded {10.0 mul round 10.0 div temp cvs show} def
- /append { % <string> <substring> append <string+substring>
- exch dup dup length % <substring> <string> <string> <length>
- 4 -1 roll putinterval
- } def
-end
-
-/cross { % <right> <top> <x> <y> cross -
- crossdict begin
- /y exch def /x exch def
- % 1 pt distance from the edges:
- 25 mm 1 sub mul /top exch def
- 25 mm 1 sub mul /right exch def
- 0 setlinewidth
- newpath
- x y moveto
- right 0 rmoveto
- x y lineto
- 0 top rlineto
- stroke
- x y moveto
- right -0.2 mul dup 0 lt {70 sub} if
- top -0.2 mul dup 0 lt { 8 sub} if
- rmoveto
- (\() show x reverse showrounded (, ) show
- y reverse showrounded (\)) show
- end
-} def
-%%EndProlog
-
-%%BeginSetup
-%%BeginFeature: *PageSize A4Rotated
-1 dict begin /PageSize [841.88 595.27] def currentdict end setpagedevice
-%%EndFeature
-%%IncludeResource: font Courier
-/Courier findfont 8 scalefont setfont
-%%EndSetup
-
-%%Page: 1 1
-
-421 297 moveto (Page size: A4Rotated)
-dup stringwidth -2 div exch -2 div exch rmoveto show
-
--1 -1 25 mm 25 mm cross
- 1 -1 841.88 25 mm sub 25 mm cross
--1 1 25 mm 595.27 25 mm sub cross
- 1 1 841.88 25 mm sub 595.27 25 mm sub cross
-
-showpage
-
-%%Trailer
-%%EOF
diff --git a/gs/contrib/pcl3/ps/margins-Env10Rotated.ps b/gs/contrib/pcl3/ps/margins-Env10Rotated.ps
deleted file mode 100644
index 11ecd6f08..000000000
--- a/gs/contrib/pcl3/ps/margins-Env10Rotated.ps
+++ /dev/null
@@ -1,73 +0,0 @@
-%!PS-Adobe-3.0
-%%Title: Margin test file for the page size Env10Rotated
-%%Copyright: Copyright (C) 1997, 1998, 1999, 2000 by Martin Lottermoser. All rights reserved.
-%%Creator: makemtf 1.19
-%%CreationDate: Sun Aug 19 12:16:22 CEST 2001
-%%Pages: 1
-%%DocumentNeededResources: font Courier
-%%DocumentMedia: Env10Rotated 684 297 0 () ()
-%%Comments: The first entry in the preceding line should really be an empty
-%%+ string. That it is not is a concession to bugs in ghostview and gv.
-%%LanguageLevel: 2
-%%EndComments
-
-%%BeginProlog
-/in {72 mul} def
-/mm {0.0 mul} dup 0 72 25.4 div put def
-
-/crossdict 8 dict def % 4 defined here, 4 more defined at runtime
-crossdict begin
- /reverse {0.0 mul} dup 0 1.0 72 div put def
- /temp 100 string def
- /showrounded {100.0 mul round 100.0 div temp cvs show} def
- /append { % <string> <substring> append <string+substring>
- exch dup dup length % <substring> <string> <string> <length>
- 4 -1 roll putinterval
- } def
-end
-
-/cross { % <right> <top> <x> <y> cross -
- crossdict begin
- /y exch def /x exch def
- % 1 pt distance from the edges:
- 1 in 1 sub mul /top exch def
- 1 in 1 sub mul /right exch def
- 0 setlinewidth
- newpath
- x y moveto
- right 0 rmoveto
- x y lineto
- 0 top rlineto
- stroke
- x y moveto
- right -0.2 mul dup 0 lt {70 sub} if
- top -0.2 mul dup 0 lt { 8 sub} if
- rmoveto
- (\() show x reverse showrounded (, ) show
- y reverse showrounded (\)) show
- end
-} def
-%%EndProlog
-
-%%BeginSetup
-%%BeginFeature: *PageSize Env10Rotated
-1 dict begin /PageSize [684 297] def currentdict end setpagedevice
-%%EndFeature
-%%IncludeResource: font Courier
-/Courier findfont 8 scalefont setfont
-%%EndSetup
-
-%%Page: 1 1
-
-342 148 moveto (Page size: Env10Rotated)
-dup stringwidth -2 div exch -2 div exch rmoveto show
-
--1 -1 1 in 1 in cross
- 1 -1 684 1 in sub 1 in cross
--1 1 1 in 297 1 in sub cross
- 1 1 684 1 in sub 297 1 in sub cross
-
-showpage
-
-%%Trailer
-%%EOF
diff --git a/gs/contrib/pcl3/ps/margins-EnvDLRotated.ps b/gs/contrib/pcl3/ps/margins-EnvDLRotated.ps
deleted file mode 100644
index f483d5b46..000000000
--- a/gs/contrib/pcl3/ps/margins-EnvDLRotated.ps
+++ /dev/null
@@ -1,73 +0,0 @@
-%!PS-Adobe-3.0
-%%Title: Margin test file for the page size EnvDLRotated
-%%Copyright: Copyright (C) 1997, 1998, 1999, 2000 by Martin Lottermoser. All rights reserved.
-%%Creator: makemtf 1.19
-%%CreationDate: Sun Aug 19 12:16:20 CEST 2001
-%%Pages: 1
-%%DocumentNeededResources: font Courier
-%%DocumentMedia: EnvDLRotated 624 312 0 () ()
-%%Comments: The first entry in the preceding line should really be an empty
-%%+ string. That it is not is a concession to bugs in ghostview and gv.
-%%LanguageLevel: 2
-%%EndComments
-
-%%BeginProlog
-/in {72 mul} def
-/mm {0.0 mul} dup 0 72 25.4 div put def
-
-/crossdict 8 dict def % 4 defined here, 4 more defined at runtime
-crossdict begin
- /reverse {0.0 mul} dup 0 25.4 72 div put def
- /temp 100 string def
- /showrounded {10.0 mul round 10.0 div temp cvs show} def
- /append { % <string> <substring> append <string+substring>
- exch dup dup length % <substring> <string> <string> <length>
- 4 -1 roll putinterval
- } def
-end
-
-/cross { % <right> <top> <x> <y> cross -
- crossdict begin
- /y exch def /x exch def
- % 1 pt distance from the edges:
- 25 mm 1 sub mul /top exch def
- 25 mm 1 sub mul /right exch def
- 0 setlinewidth
- newpath
- x y moveto
- right 0 rmoveto
- x y lineto
- 0 top rlineto
- stroke
- x y moveto
- right -0.2 mul dup 0 lt {70 sub} if
- top -0.2 mul dup 0 lt { 8 sub} if
- rmoveto
- (\() show x reverse showrounded (, ) show
- y reverse showrounded (\)) show
- end
-} def
-%%EndProlog
-
-%%BeginSetup
-%%BeginFeature: *PageSize EnvDLRotated
-1 dict begin /PageSize [623.62 311.81] def currentdict end setpagedevice
-%%EndFeature
-%%IncludeResource: font Courier
-/Courier findfont 8 scalefont setfont
-%%EndSetup
-
-%%Page: 1 1
-
-312 156 moveto (Page size: EnvDLRotated)
-dup stringwidth -2 div exch -2 div exch rmoveto show
-
--1 -1 25 mm 25 mm cross
- 1 -1 623.62 25 mm sub 25 mm cross
--1 1 25 mm 311.81 25 mm sub cross
- 1 1 623.62 25 mm sub 311.81 25 mm sub cross
-
-showpage
-
-%%Trailer
-%%EOF
diff --git a/gs/contrib/pcl3/ps/margins-Letter.ps b/gs/contrib/pcl3/ps/margins-Letter.ps
deleted file mode 100644
index 8087e3233..000000000
--- a/gs/contrib/pcl3/ps/margins-Letter.ps
+++ /dev/null
@@ -1,76 +0,0 @@
-%!PS-Adobe-3.0
-%%Title: Margin test file for the page size Letter
-%%Copyright: Copyright (C) 1997, 1998, 1999, 2000 by Martin Lottermoser. All rights reserved.
-%%Creator: makemtf 1.19
-%%CreationDate: Sun Aug 19 12:16:18 CEST 2001
-%%Pages: 1
-%%DocumentNeededResources: font Courier
-%%DocumentMedia: Letter 612 792 0 () ()
-%%Comments: The first entry in the preceding line should really be an empty
-%%+ string. That it is not is a concession to bugs in ghostview and gv.
-%%LanguageLevel: 1
-%%EndComments
-
-%%BeginProlog
-/in {72 mul} def
-/mm {0.0 mul} dup 0 72 25.4 div put def
-
-/crossdict 8 dict def % 4 defined here, 4 more defined at runtime
-crossdict begin
- /reverse {0.0 mul} dup 0 1.0 72 div put def
- /temp 100 string def
- /showrounded {100.0 mul round 100.0 div temp cvs show} def
- /append { % <string> <substring> append <string+substring>
- exch dup dup length % <substring> <string> <string> <length>
- 4 -1 roll putinterval
- } def
-end
-
-/cross { % <right> <top> <x> <y> cross -
- crossdict begin
- /y exch def /x exch def
- % 1 pt distance from the edges:
- 1 in 1 sub mul /top exch def
- 1 in 1 sub mul /right exch def
- 0 setlinewidth
- newpath
- x y moveto
- right 0 rmoveto
- x y lineto
- 0 top rlineto
- stroke
- x y moveto
- right -0.2 mul dup 0 lt {70 sub} if
- top -0.2 mul dup 0 lt { 8 sub} if
- rmoveto
- (\() show x reverse showrounded (, ) show
- y reverse showrounded (\)) show
- end
-} def
-%%EndProlog
-
-%%BeginSetup
-%%BeginFeature: *PageSize Letter
-/languagelevel where {pop languagelevel} {1} ifelse 2 lt
-{ letter }
-{ 1 dict begin /PageSize [612 792] def currentdict end setpagedevice }
-ifelse
-%%EndFeature
-%%IncludeResource: font Courier
-/Courier findfont 8 scalefont setfont
-%%EndSetup
-
-%%Page: 1 1
-
-306 396 moveto (Page size: Letter)
-dup stringwidth -2 div exch -2 div exch rmoveto show
-
--1 -1 1 in 1 in cross
- 1 -1 612 1 in sub 1 in cross
--1 1 1 in 792 1 in sub cross
- 1 1 612 1 in sub 792 1 in sub cross
-
-showpage
-
-%%Trailer
-%%EOF
diff --git a/gs/contrib/pcl3/ps/margins-LetterRotated.ps b/gs/contrib/pcl3/ps/margins-LetterRotated.ps
deleted file mode 100644
index 28ad24d8c..000000000
--- a/gs/contrib/pcl3/ps/margins-LetterRotated.ps
+++ /dev/null
@@ -1,73 +0,0 @@
-%!PS-Adobe-3.0
-%%Title: Margin test file for the page size LetterRotated
-%%Copyright: Copyright (C) 1997, 1998, 1999, 2000 by Martin Lottermoser. All rights reserved.
-%%Creator: makemtf 1.19
-%%CreationDate: Sun Aug 19 12:16:19 CEST 2001
-%%Pages: 1
-%%DocumentNeededResources: font Courier
-%%DocumentMedia: LetterRotated 792 612 0 () ()
-%%Comments: The first entry in the preceding line should really be an empty
-%%+ string. That it is not is a concession to bugs in ghostview and gv.
-%%LanguageLevel: 2
-%%EndComments
-
-%%BeginProlog
-/in {72 mul} def
-/mm {0.0 mul} dup 0 72 25.4 div put def
-
-/crossdict 8 dict def % 4 defined here, 4 more defined at runtime
-crossdict begin
- /reverse {0.0 mul} dup 0 1.0 72 div put def
- /temp 100 string def
- /showrounded {100.0 mul round 100.0 div temp cvs show} def
- /append { % <string> <substring> append <string+substring>
- exch dup dup length % <substring> <string> <string> <length>
- 4 -1 roll putinterval
- } def
-end
-
-/cross { % <right> <top> <x> <y> cross -
- crossdict begin
- /y exch def /x exch def
- % 1 pt distance from the edges:
- 1 in 1 sub mul /top exch def
- 1 in 1 sub mul /right exch def
- 0 setlinewidth
- newpath
- x y moveto
- right 0 rmoveto
- x y lineto
- 0 top rlineto
- stroke
- x y moveto
- right -0.2 mul dup 0 lt {70 sub} if
- top -0.2 mul dup 0 lt { 8 sub} if
- rmoveto
- (\() show x reverse showrounded (, ) show
- y reverse showrounded (\)) show
- end
-} def
-%%EndProlog
-
-%%BeginSetup
-%%BeginFeature: *PageSize LetterRotated
-1 dict begin /PageSize [792 612] def currentdict end setpagedevice
-%%EndFeature
-%%IncludeResource: font Courier
-/Courier findfont 8 scalefont setfont
-%%EndSetup
-
-%%Page: 1 1
-
-396 306 moveto (Page size: LetterRotated)
-dup stringwidth -2 div exch -2 div exch rmoveto show
-
--1 -1 1 in 1 in cross
- 1 -1 792 1 in sub 1 in cross
--1 1 1 in 612 1 in sub cross
- 1 1 792 1 in sub 612 1 in sub cross
-
-showpage
-
-%%Trailer
-%%EOF
diff --git a/gs/contrib/pcl3/src/contrib.mak-5.50.add b/gs/contrib/pcl3/src/contrib.mak-5.50.add
deleted file mode 100644
index 572fa4860..000000000
--- a/gs/contrib/pcl3/src/contrib.mak-5.50.add
+++ /dev/null
@@ -1,237 +0,0 @@
-### Driver "pcl3" for various PCL-3+ printers #################################
-#
-# @(#)$Id: contrib.mak.add,v 1.7 2001/07/27 13:52:58 Martin Rel $
-# Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-# Germany, e-mail: Martin.Lottermoser@t-online.de.
-#
-# Read the file README in the pcl3 distribution for general installation
-# instructions. If you don't have a distribution, visit
-# http://home.t-online.de/home/Martin.Lottermoser/pcl3.html.
-#
-# If you are including both, hpdj and pcl3, in the compilation, you should
-# disable the rules for pclcomp.$(OBJ) and pagecount.$(OBJ) in the hpdj
-# section. The versions of these files contained in the pcl3 distribution are
-# binary compatible with what hpdj 2.6 expects.
-#
-# You can add compilation options to the variable "pcl3_options" below.
-#
-# NDEBUG
-# Define this to remove certain runtime checks from the code which might
-# then become slightly faster. Don't define this for pcl3 beta releases
-# or ghostscript test releases.
-#
-# PCL3_MEDIA_FILE
-# Define this to be a C string containing the absolute path name of a
-# media configuration file if you want the "unspec" subdevice to use this
-# file instead of its default HP DeskJet 850C/855C/870C/890C media
-# configuration. An example definition for UNIX systems is:
-#
-# pcl3_options=-DPCL3_MEDIA_FILE='"$(gsdatadir)/pcl3.mcf"'
-#
-# A detailed description of the meaning and the syntax of this file can
-# be found in the reference page gs-pcl3(1). Briefly, it tells the
-# driver which media sizes your printer supports and how. You can
-# override this at run time with the option "-sMediaConfigurationFile".
-#
-# The variable "eprn_fs_options" is intended for optimization options used only
-# when compiling eprnfs.c. Choose the combination producing the fastest code.
-# You should leave this variable empty unless (a) you definitely know which
-# options produce the fastest code from eprnfs.c, and (b) ghostscript does not
-# use the same options anyway.
-#
-# You should also look at the section below containing the rules for the *.dev
-# files in order to find out which values you can add to the DEVICE_DEVS*
-# variables in the platform-specific make file. You should always add at least
-# the "pcl3" device but you may add others; the latter are shortcuts to the
-# subdevices of pcl3.
-#
-#
-# Remarks for Microsoft Windows
-# =============================
-# When compiling on Microsoft Windows and unless you are using Cygwin, you must
-# define the preprocessor symbol "EPRN_NO_PAGECOUNTFILE" and either remove the
-# dependency of pcl3 on pagecount.obj or replace pagecount.c with an empty
-# file.
-#
-###############################################################################
-
-# Compilation options
-pcl3_options=
-eprn_fs_options=
-
-# Version of the pcl3 rules: $Revision: 5.50.2.11 $.
-
-#==============================================================================
-
-# eprn rules
-# This is the part you need if you are developing another eprn-based driver.
-
-# Complete set of compilation options
-eprn_opts=-DGS_REVISION=$(GS_REVISION) $(pcl3_options)
-
-# Directory with eprn's source code as seen from the gs directory. The name
-# does not include a trailing path separator.
-eprn_dir=pcl3$(D)eprn
-# Same as above but with a separator
-eprn_src=$(eprn_dir)$(D)
-
-# List of all eprn object files
-eprn_=$(GLOBJ)gdeveprn.$(OBJ) $(GLOBJ)pagecount.$(OBJ) \
- $(GLOBJ)mediasize.$(OBJ) $(GLOBJ)eprnparm.$(OBJ) $(GLOBJ)eprnrend.$(OBJ) \
- $(GLOBJ)eprnfs.$(OBJ)
-
-# List of eprn headers needed when gdeveprn.h is included:
-eprn_headers=$(eprn_src)mediasize.h $(eprn_src)gdeveprn.h
-
-#------------------------------------------------------------------------------
-
-# Rules for individual files
-
-$(GLOBJ)mediasize.$(OBJ): $(eprn_src)mediasize.c $(eprn_src)mediasize.h
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)mediasize.c
-
-$(GLOBJ)gdeveprn.$(OBJ): $(eprn_src)gdeveprn.c $(eprn_headers) \
- $(eprn_src)pagecount.h
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)gdeveprn.c
-
-$(GLOBJ)eprnparm.$(OBJ): $(eprn_src)eprnparm.c $(eprn_headers)
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)eprnparm.c
-
-$(GLOBJ)eprnrend.$(OBJ): $(eprn_src)eprnrend.c $(eprn_headers)
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)eprnrend.c
-
-$(GLOBJ)eprnfs.$(OBJ): $(eprn_src)eprnfs.c $(eprn_headers)
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_fs_options) \
- $(eprn_src)eprnfs.c
-
-# File also used by hpdj:
-$(GLOBJ)pagecount.$(OBJ): $(eprn_src)pagecount.c $(eprn_src)pagecount.h
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)pagecount.c
-
-#==============================================================================
-
-# pcl3 rules
-
-# Complete set of compilation options
-pcl3_opts=-DGS_REVISION=$(GS_REVISION) -I$(eprn_dir) $(pcl3_options)
-
-# Root directory of pcl3 distribution as seen from the gs directory. The
-# variable includes a trailing path separator.
-pcl3_root=pcl3$(D)
-
-# Directory with pcl3's source code (name includes a trailing path separator)
-pcl3_src=$(pcl3_root)src$(D)
-
-# Headers used by most pcl3 files
-pcl3_headers=$(eprn_headers) \
- $(pcl3_src)pclgen.h $(pcl3_src)pclcap.h $(pcl3_src)pclsize.h
-
-# List of all object files needed for pcl3
-pcl3_=$(eprn_) $(GLOBJ)gdevpcl3.$(OBJ) $(GLOBJ)pclcap.$(OBJ) \
- $(GLOBJ)pclgen.$(OBJ) $(GLOBJ)pclcomp.$(OBJ) $(GLOBJ)pclsize.$(OBJ)
-
-#------------------------------------------------------------------------------
-
-# Rules for individual files
-
-$(GLOBJ)pclgen.$(OBJ): $(pcl3_src)pclgen.c $(pcl3_src)pclgen.h
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclgen.c
-
-$(GLOBJ)pclsize.$(OBJ): $(pcl3_src)pclsize.c $(eprn_src)mediasize.h \
- $(pcl3_src)pclsize.h $(pcl3_src)pclgen.h
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclsize.c
-
-$(GLOBJ)pclcap.$(OBJ): $(pcl3_src)pclcap.c $(pcl3_headers)
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclcap.c
-
-$(GLOBJ)gdevpcl3.$(OBJ): $(pcl3_src)gdevpcl3.c $(pcl3_headers)
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)gdevpcl3.c
-
-# File also used by hpdj:
-$(GLOBJ)pclcomp.$(OBJ): $(pcl3_src)pclcomp.c $(pcl3_src)pclgen.h
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclcomp.c
-
-#------------------------------------------------------------------------------
-
-# Device rules. The targets here (e.g., "pcl3.dev") are the values you
-# can add to the DEVICE_DEVS* variables in the platform-specific make file.
-
-# The generic pcl3 device with selectable subdevices
-pcl3.dev: $(pcl3_) page.dev
- $(SETPDEV) pcl3 $(pcl3_)
-
-# Fixed devices for specific printers
-hpdjplus.dev: $(pcl3_) page.dev
- $(SETPDEV) hpdjplus $(pcl3_)
-hpdjportable.dev: $(pcl3_) page.dev
- $(SETPDEV) hpdjportable $(pcl3_)
-hpdj310.dev: $(pcl3_) page.dev
- $(SETPDEV) hpdj310 $(pcl3_)
-hpdj320.dev: $(pcl3_) page.dev
- $(SETPDEV) hpdj320 $(pcl3_)
-hpdj340.dev: $(pcl3_) page.dev
- $(SETPDEV) hpdj340 $(pcl3_)
-hpdj400.dev: $(pcl3_) page.dev
- $(SETPDEV) hpdj400 $(pcl3_)
-hpdj500.dev: $(pcl3_) page.dev
- $(SETPDEV) hpdj500 $(pcl3_)
-hpdj500c.dev: $(pcl3_) page.dev
- $(SETPDEV) hpdj500c $(pcl3_)
-hpdj510.dev: $(pcl3_) page.dev
- $(SETPDEV) hpdj510 $(pcl3_)
-hpdj520.dev: $(pcl3_) page.dev
- $(SETPDEV) hpdj520 $(pcl3_)
-hpdj540.dev: $(pcl3_) page.dev
- $(SETPDEV) hpdj540 $(pcl3_)
-hpdj550c.dev: $(pcl3_) page.dev
- $(SETPDEV) hpdj550c $(pcl3_)
-hpdj560c.dev: $(pcl3_) page.dev
- $(SETPDEV) hpdj560c $(pcl3_)
-hpdj600.dev: $(pcl3_) page.dev
- $(SETPDEV) hpdj600 $(pcl3_)
-hpdj660c.dev: $(pcl3_) page.dev
- $(SETPDEV) hpdj660c $(pcl3_)
-hpdj670c.dev: $(pcl3_) page.dev
- $(SETPDEV) hpdj670c $(pcl3_)
-hpdj680c.dev: $(pcl3_) page.dev
- $(SETPDEV) hpdj680c $(pcl3_)
-hpdj690c.dev: $(pcl3_) page.dev
- $(SETPDEV) hpdj690c $(pcl3_)
-hpdj850c.dev: $(pcl3_) page.dev
- $(SETPDEV) hpdj850c $(pcl3_)
-hpdj855c.dev: $(pcl3_) page.dev
- $(SETPDEV) hpdj855c $(pcl3_)
-hpdj870c.dev: $(pcl3_) page.dev
- $(SETPDEV) hpdj870c $(pcl3_)
-hpdj890c.dev: $(pcl3_) page.dev
- $(SETPDEV) hpdj890c $(pcl3_)
-hpdj1120c.dev: $(pcl3_) page.dev
- $(SETPDEV) hpdj1120c $(pcl3_)
-
-#------------------------------------------------------------------------------
-
-# The pcl3opts command.
-# This is deliberately not included in the normal compilation because (a) the
-# rule is unlikely to work and (b) the code is unlikely to compile on any but
-# UNIX systems.
-
-pcl3opts: $(GLOBJ)pcl3opts$(XE)
-pcl3opts_=$(pcl3_src)pcl3opts.c $(pcl3_src)pclscan.c $(eprn_src)mediasize.c \
- $(pcl3_src)pclsize.c
-
-$(GLOBJ)pcl3opts$(XE): $(pcl3opts_)
- $(CC_) -o $@ -I$(eprn_src) $(pcl3opts_)
- gencat $(GLOBJ)pcl3opts-en.cat $(pcl3_src)pcl3opts-en.msg
- gencat $(GLOBJ)pcl3opts-de.cat $(pcl3_src)pcl3opts-de.msg
-
-#------------------------------------------------------------------------------
-
-# Installation rules (work only for UNIX). Note that the PostScript examples
-# are not copied.
-pcl3-install:
- for f in gs-pcl3 pcl3opts; do \
- $(INSTALL_DATA) $(pcl3_root)doc$(D)$$f.1 $(man1dir)/$$f.$(man1ext) \
- || exit 1; \
- $(INSTALL_DATA) $(pcl3_root)doc$(D)$$f.html $(docdir) || exit 1; done
- $(INSTALL_PROGRAM) $(GLOBJ)pcl3opts$(XE) $(bindir)
-
diff --git a/gs/contrib/pcl3/src/contrib.mak-6.01.add b/gs/contrib/pcl3/src/contrib.mak-6.01.add
deleted file mode 100644
index fa7826db8..000000000
--- a/gs/contrib/pcl3/src/contrib.mak-6.01.add
+++ /dev/null
@@ -1,237 +0,0 @@
-### Driver "pcl3" for various PCL-3+ printers #################################
-#
-# @(#)$Id: contrib.mak.add,v 1.7 2001/07/27 13:52:58 Martin Rel $
-# Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-# Germany, e-mail: Martin.Lottermoser@t-online.de.
-#
-# Read the file README in the pcl3 distribution for general installation
-# instructions. If you don't have a distribution, visit
-# http://home.t-online.de/home/Martin.Lottermoser/pcl3.html.
-#
-# If you are including both, hpdj and pcl3, in the compilation, you should
-# disable the rules for pclcomp.$(OBJ) and pagecount.$(OBJ) in the hpdj
-# section. The versions of these files contained in the pcl3 distribution are
-# binary compatible with what hpdj 2.6 expects.
-#
-# You can add compilation options to the variable "pcl3_options" below.
-#
-# NDEBUG
-# Define this to remove certain runtime checks from the code which might
-# then become slightly faster. Don't define this for pcl3 beta releases
-# or ghostscript test releases.
-#
-# PCL3_MEDIA_FILE
-# Define this to be a C string containing the absolute path name of a
-# media configuration file if you want the "unspec" subdevice to use this
-# file instead of its default HP DeskJet 850C/855C/870C/890C media
-# configuration. An example definition for UNIX systems is:
-#
-# pcl3_options=-DPCL3_MEDIA_FILE='"$(gsdatadir)/pcl3.mcf"'
-#
-# A detailed description of the meaning and the syntax of this file can
-# be found in the reference page gs-pcl3(1). Briefly, it tells the
-# driver which media sizes your printer supports and how. You can
-# override this at run time with the option "-sMediaConfigurationFile".
-#
-# The variable "eprn_fs_options" is intended for optimization options used only
-# when compiling eprnfs.c. Choose the combination producing the fastest code.
-# You should leave this variable empty unless (a) you definitely know which
-# options produce the fastest code from eprnfs.c, and (b) ghostscript does not
-# use the same options anyway.
-#
-# You should also look at the section below containing the rules for the *.dev
-# files in order to find out which values you can add to the DEVICE_DEVS*
-# variables in the platform-specific make file. You should always add at least
-# the "pcl3" device but you may add others; the latter are shortcuts to the
-# subdevices of pcl3.
-#
-#
-# Remarks for Microsoft Windows
-# =============================
-# When compiling on Microsoft Windows and unless you are using Cygwin, you must
-# define the preprocessor symbol "EPRN_NO_PAGECOUNTFILE" and either remove the
-# dependency of pcl3 on pagecount.obj or replace pagecount.c with an empty
-# file.
-#
-###############################################################################
-
-# Compilation options
-pcl3_options=
-eprn_fs_options=
-
-# Version of the pcl3 rules: $Revision: 1.1.1.2.2.11 $.
-
-#==============================================================================
-
-# eprn rules
-# This is the part you need if you are developing another eprn-based driver.
-
-# Complete set of compilation options
-eprn_opts=-DGS_REVISION=$(GS_REVISION) $(pcl3_options)
-
-# Directory with eprn's source code as seen from the gs directory. The name
-# does not include a trailing path separator.
-eprn_dir=pcl3$(D)eprn
-# Same as above but with a separator
-eprn_src=$(eprn_dir)$(D)
-
-# List of all eprn object files
-eprn_=$(GLOBJ)gdeveprn.$(OBJ) $(GLOBJ)pagecount.$(OBJ) \
- $(GLOBJ)mediasize.$(OBJ) $(GLOBJ)eprnparm.$(OBJ) $(GLOBJ)eprnrend.$(OBJ) \
- $(GLOBJ)eprnfs.$(OBJ)
-
-# List of eprn headers needed when gdeveprn.h is included:
-eprn_headers=$(eprn_src)mediasize.h $(eprn_src)gdeveprn.h
-
-#------------------------------------------------------------------------------
-
-# Rules for individual files
-
-$(GLOBJ)mediasize.$(OBJ): $(eprn_src)mediasize.c $(eprn_src)mediasize.h
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)mediasize.c
-
-$(GLOBJ)gdeveprn.$(OBJ): $(eprn_src)gdeveprn.c $(eprn_headers) \
- $(eprn_src)pagecount.h
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)gdeveprn.c
-
-$(GLOBJ)eprnparm.$(OBJ): $(eprn_src)eprnparm.c $(eprn_headers)
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)eprnparm.c
-
-$(GLOBJ)eprnrend.$(OBJ): $(eprn_src)eprnrend.c $(eprn_headers)
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)eprnrend.c
-
-$(GLOBJ)eprnfs.$(OBJ): $(eprn_src)eprnfs.c $(eprn_headers)
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_fs_options) \
- $(eprn_src)eprnfs.c
-
-# File also used by hpdj:
-$(GLOBJ)pagecount.$(OBJ): $(eprn_src)pagecount.c $(eprn_src)pagecount.h
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)pagecount.c
-
-#==============================================================================
-
-# pcl3 rules
-
-# Complete set of compilation options
-pcl3_opts=-DGS_REVISION=$(GS_REVISION) -I$(eprn_dir) $(pcl3_options)
-
-# Root directory of pcl3 distribution as seen from the gs directory. The
-# variable includes a trailing path separator.
-pcl3_root=pcl3$(D)
-
-# Directory with pcl3's source code (name includes a trailing path separator)
-pcl3_src=$(pcl3_root)src$(D)
-
-# Headers used by most pcl3 files
-pcl3_headers=$(eprn_headers) \
- $(pcl3_src)pclgen.h $(pcl3_src)pclcap.h $(pcl3_src)pclsize.h
-
-# List of all object files needed for pcl3
-pcl3_=$(eprn_) $(GLOBJ)gdevpcl3.$(OBJ) $(GLOBJ)pclcap.$(OBJ) \
- $(GLOBJ)pclgen.$(OBJ) $(GLOBJ)pclcomp.$(OBJ) $(GLOBJ)pclsize.o
-
-#------------------------------------------------------------------------------
-
-# Rules for individual files
-
-$(GLOBJ)pclgen.$(OBJ): $(pcl3_src)pclgen.c $(pcl3_src)pclgen.h
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclgen.c
-
-$(GLOBJ)pclsize.$(OBJ): $(pcl3_src)pclsize.c $(eprn_src)mediasize.h \
- $(pcl3_src)pclsize.h $(pcl3_src)pclgen.h
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclsize.c
-
-$(GLOBJ)pclcap.$(OBJ): $(pcl3_src)pclcap.c $(pcl3_headers)
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclcap.c
-
-$(GLOBJ)gdevpcl3.$(OBJ): $(pcl3_src)gdevpcl3.c $(pcl3_headers)
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)gdevpcl3.c
-
-# File also used by hpdj:
-$(GLOBJ)pclcomp.$(OBJ): $(pcl3_src)pclcomp.c $(pcl3_src)pclgen.h
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclcomp.c
-
-#------------------------------------------------------------------------------
-
-# Device rules. The targets here (e.g., "$(DD)pcl3.dev") are the values you
-# can add to the DEVICE_DEVS* variables in the platform-specific make file.
-
-# The generic pcl3 device with selectable subdevices
-$(DD)pcl3.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)pcl3 $(pcl3_)
-
-# Fixed devices for specific printers
-$(DD)hpdjplus.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdjplus $(pcl3_)
-$(DD)hpdjportable.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdjportable $(pcl3_)
-$(DD)hpdj310.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj310 $(pcl3_)
-$(DD)hpdj320.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj320 $(pcl3_)
-$(DD)hpdj340.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj340 $(pcl3_)
-$(DD)hpdj400.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj400 $(pcl3_)
-$(DD)hpdj500.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj500 $(pcl3_)
-$(DD)hpdj500c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj500c $(pcl3_)
-$(DD)hpdj510.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj510 $(pcl3_)
-$(DD)hpdj520.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj520 $(pcl3_)
-$(DD)hpdj540.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj540 $(pcl3_)
-$(DD)hpdj550c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj550c $(pcl3_)
-$(DD)hpdj560c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj560c $(pcl3_)
-$(DD)hpdj600.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj600 $(pcl3_)
-$(DD)hpdj660c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj660c $(pcl3_)
-$(DD)hpdj670c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj670c $(pcl3_)
-$(DD)hpdj680c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj680c $(pcl3_)
-$(DD)hpdj690c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj690c $(pcl3_)
-$(DD)hpdj850c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj850c $(pcl3_)
-$(DD)hpdj855c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj855c $(pcl3_)
-$(DD)hpdj870c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj870c $(pcl3_)
-$(DD)hpdj890c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj890c $(pcl3_)
-$(DD)hpdj1120c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj1120c $(pcl3_)
-
-#------------------------------------------------------------------------------
-
-# The pcl3opts command.
-# This is deliberately not included in the normal compilation because (a) the
-# rule is unlikely to work and (b) the code is unlikely to compile on any but
-# UNIX systems.
-
-pcl3opts: $(BINDIR)$(D)pcl3opts$(XE)
-pcl3opts_=$(pcl3_src)pcl3opts.c $(pcl3_src)pclscan.c $(eprn_src)mediasize.c \
- $(pcl3_src)pclsize.c
-
-$(BINDIR)$(D)pcl3opts$(XE): $(pcl3opts_)
- $(CC_) -o $@ -I$(eprn_src) $(pcl3opts_)
- gencat $(GLOBJ)pcl3opts-en.cat $(pcl3_src)pcl3opts-en.msg
- gencat $(GLOBJ)pcl3opts-de.cat $(pcl3_src)pcl3opts-de.msg
-
-#------------------------------------------------------------------------------
-
-# Installation rules (work only for UNIX). Note that the PostScript examples
-# and the PPD files are not copied.
-pcl3-install:
- for f in gs-pcl3 pcl3opts; do \
- $(INSTALL_DATA) $(pcl3_root)doc$(D)$$f.1 $(man1dir)/$$f.$(man1ext) \
- || exit 1; \
- $(INSTALL_DATA) $(pcl3_root)doc$(D)$$f.html $(docdir) || exit 1; done
- $(INSTALL_PROGRAM) $(BINDIR)$(D)pcl3opts$(XE) $(bindir)
-
diff --git a/gs/contrib/pcl3/src/contrib.mak-6.50.add b/gs/contrib/pcl3/src/contrib.mak-6.50.add
deleted file mode 100644
index 8d1bac537..000000000
--- a/gs/contrib/pcl3/src/contrib.mak-6.50.add
+++ /dev/null
@@ -1,237 +0,0 @@
-### Driver "pcl3" for various PCL-3+ printers #################################
-#
-# @(#)$Id: contrib.mak.add,v 1.7 2001/07/27 13:52:58 Martin Rel $
-# Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-# Germany, e-mail: Martin.Lottermoser@t-online.de.
-#
-# Read the file README in the pcl3 distribution for general installation
-# instructions. If you don't have a distribution, visit
-# http://home.t-online.de/home/Martin.Lottermoser/pcl3.html.
-#
-# If you are including both, hpdj and pcl3, in the compilation, you should
-# disable the rules for pclcomp.$(OBJ) and pagecount.$(OBJ) in the hpdj
-# section. The versions of these files contained in the pcl3 distribution are
-# binary compatible with what hpdj 2.6 expects.
-#
-# You can add compilation options to the variable "pcl3_options" below.
-#
-# NDEBUG
-# Define this to remove certain runtime checks from the code which might
-# then become slightly faster. Don't define this for pcl3 beta releases
-# or ghostscript test releases.
-#
-# PCL3_MEDIA_FILE
-# Define this to be a C string containing the absolute path name of a
-# media configuration file if you want the "unspec" subdevice to use this
-# file instead of its default HP DeskJet 850C/855C/870C/890C media
-# configuration. An example definition for UNIX systems is:
-#
-# pcl3_options=-DPCL3_MEDIA_FILE='"$(gsdatadir)/pcl3.mcf"'
-#
-# A detailed description of the meaning and the syntax of this file can
-# be found in the reference page gs-pcl3(1). Briefly, it tells the
-# driver which media sizes your printer supports and how. You can
-# override this at run time with the option "-sMediaConfigurationFile".
-#
-# The variable "eprn_fs_options" is intended for optimization options used only
-# when compiling eprnfs.c. Choose the combination producing the fastest code.
-# You should leave this variable empty unless (a) you definitely know which
-# options produce the fastest code from eprnfs.c, and (b) ghostscript does not
-# use the same options anyway.
-#
-# You should also look at the section below containing the rules for the *.dev
-# files in order to find out which values you can add to the DEVICE_DEVS*
-# variables in the platform-specific make file. You should always add at least
-# the "pcl3" device but you may add others; the latter are shortcuts to the
-# subdevices of pcl3.
-#
-#
-# Remarks for Microsoft Windows
-# =============================
-# When compiling on Microsoft Windows and unless you are using Cygwin, you must
-# define the preprocessor symbol "EPRN_NO_PAGECOUNTFILE" and either remove the
-# dependency of pcl3 on pagecount.obj or replace pagecount.c with an empty
-# file.
-#
-###############################################################################
-
-# Compilation options
-pcl3_options=
-eprn_fs_options=
-
-# Version of the pcl3 rules: $Revision: 1.1.1.4.2.8 $.
-
-#==============================================================================
-
-# eprn rules
-# This is the part you need if you are developing another eprn-based driver.
-
-# Complete set of compilation options
-eprn_opts=-DGS_REVISION=$(GS_REVISION) $(pcl3_options)
-
-# Directory with eprn's source code as seen from the gs directory. The name
-# does not include a trailing path separator.
-eprn_dir=pcl3$(D)eprn
-# Same as above but with a separator
-eprn_src=$(eprn_dir)$(D)
-
-# List of all eprn object files
-eprn_=$(GLOBJ)gdeveprn.$(OBJ) $(GLOBJ)pagecount.$(OBJ) \
- $(GLOBJ)mediasize.$(OBJ) $(GLOBJ)eprnparm.$(OBJ) $(GLOBJ)eprnrend.$(OBJ) \
- $(GLOBJ)eprnfs.$(OBJ)
-
-# List of eprn headers needed when gdeveprn.h is included:
-eprn_headers=$(eprn_src)mediasize.h $(eprn_src)gdeveprn.h
-
-#------------------------------------------------------------------------------
-
-# Rules for individual files
-
-$(GLOBJ)mediasize.$(OBJ): $(eprn_src)mediasize.c $(eprn_src)mediasize.h
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)mediasize.c
-
-$(GLOBJ)gdeveprn.$(OBJ): $(eprn_src)gdeveprn.c $(eprn_headers) \
- $(eprn_src)pagecount.h
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)gdeveprn.c
-
-$(GLOBJ)eprnparm.$(OBJ): $(eprn_src)eprnparm.c $(eprn_headers)
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)eprnparm.c
-
-$(GLOBJ)eprnrend.$(OBJ): $(eprn_src)eprnrend.c $(eprn_headers)
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)eprnrend.c
-
-$(GLOBJ)eprnfs.$(OBJ): $(eprn_src)eprnfs.c $(eprn_headers)
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_fs_options) \
- $(eprn_src)eprnfs.c
-
-# File also used by hpdj:
-$(GLOBJ)pagecount.$(OBJ): $(eprn_src)pagecount.c $(eprn_src)pagecount.h
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)pagecount.c
-
-#==============================================================================
-
-# pcl3 rules
-
-# Complete set of compilation options
-pcl3_opts=-DGS_REVISION=$(GS_REVISION) -I$(eprn_dir) $(pcl3_options)
-
-# Root directory of pcl3 distribution as seen from the gs directory. The
-# variable includes a trailing path separator.
-pcl3_root=pcl3$(D)
-
-# Directory with pcl3's source code (name includes a trailing path separator)
-pcl3_src=$(pcl3_root)src$(D)
-
-# Headers used by most pcl3 files
-pcl3_headers=$(eprn_headers) \
- $(pcl3_src)pclgen.h $(pcl3_src)pclcap.h $(pcl3_src)pclsize.h
-
-# List of all object files needed for pcl3
-pcl3_=$(eprn_) $(GLOBJ)gdevpcl3.$(OBJ) $(GLOBJ)pclcap.$(OBJ) \
- $(GLOBJ)pclgen.$(OBJ) $(GLOBJ)pclcomp.$(OBJ) $(GLOBJ)pclsize.$(OBJ)
-
-#------------------------------------------------------------------------------
-
-# Rules for individual files
-
-$(GLOBJ)pclgen.$(OBJ): $(pcl3_src)pclgen.c $(pcl3_src)pclgen.h
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclgen.c
-
-$(GLOBJ)pclsize.$(OBJ): $(pcl3_src)pclsize.c $(eprn_src)mediasize.h \
- $(pcl3_src)pclsize.h $(pcl3_src)pclgen.h
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclsize.c
-
-$(GLOBJ)pclcap.$(OBJ): $(pcl3_src)pclcap.c $(pcl3_headers)
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclcap.c
-
-$(GLOBJ)gdevpcl3.$(OBJ): $(pcl3_src)gdevpcl3.c $(pcl3_headers)
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)gdevpcl3.c
-
-# File also used by hpdj:
-$(GLOBJ)pclcomp.$(OBJ): $(pcl3_src)pclcomp.c $(pcl3_src)pclgen.h
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclcomp.c
-
-#------------------------------------------------------------------------------
-
-# Device rules. The targets here (e.g., "$(DD)pcl3.dev") are the values you
-# can add to the DEVICE_DEVS* variables in the platform-specific make file.
-
-# The generic pcl3 device with selectable subdevices
-$(DD)pcl3.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)pcl3 $(pcl3_)
-
-# Fixed devices for specific printers
-$(DD)hpdjplus.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdjplus $(pcl3_)
-$(DD)hpdjportable.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdjportable $(pcl3_)
-$(DD)hpdj310.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj310 $(pcl3_)
-$(DD)hpdj320.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj320 $(pcl3_)
-$(DD)hpdj340.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj340 $(pcl3_)
-$(DD)hpdj400.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj400 $(pcl3_)
-$(DD)hpdj500.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj500 $(pcl3_)
-$(DD)hpdj500c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj500c $(pcl3_)
-$(DD)hpdj510.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj510 $(pcl3_)
-$(DD)hpdj520.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj520 $(pcl3_)
-$(DD)hpdj540.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj540 $(pcl3_)
-$(DD)hpdj550c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj550c $(pcl3_)
-$(DD)hpdj560c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj560c $(pcl3_)
-$(DD)hpdj600.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj600 $(pcl3_)
-$(DD)hpdj660c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj660c $(pcl3_)
-$(DD)hpdj670c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj670c $(pcl3_)
-$(DD)hpdj680c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj680c $(pcl3_)
-$(DD)hpdj690c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj690c $(pcl3_)
-$(DD)hpdj850c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj850c $(pcl3_)
-$(DD)hpdj855c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj855c $(pcl3_)
-$(DD)hpdj870c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj870c $(pcl3_)
-$(DD)hpdj890c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj890c $(pcl3_)
-$(DD)hpdj1120c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj1120c $(pcl3_)
-
-#------------------------------------------------------------------------------
-
-# The pcl3opts command.
-# This is deliberately not included in the normal compilation because (a) the
-# rule is unlikely to work and (b) the code is unlikely to compile on any but
-# UNIX systems.
-
-pcl3opts: $(BINDIR)$(D)pcl3opts$(XE)
-pcl3opts_=$(pcl3_src)pcl3opts.c $(pcl3_src)pclscan.c $(eprn_src)mediasize.c \
- $(pcl3_src)pclsize.c
-
-$(BINDIR)$(D)pcl3opts$(XE): $(pcl3opts_)
- $(CC_) -o $@ -I$(eprn_src) $(pcl3opts_)
- gencat $(GLOBJ)pcl3opts-en.cat $(pcl3_src)pcl3opts-en.msg
- gencat $(GLOBJ)pcl3opts-de.cat $(pcl3_src)pcl3opts-de.msg
-
-#------------------------------------------------------------------------------
-
-# Installation rules (work only for UNIX). Note that the PostScript examples
-# and the PPD files are not copied.
-pcl3-install:
- for f in gs-pcl3 pcl3opts; do \
- $(INSTALL_DATA) $(pcl3_root)doc$(D)$$f.1 $(man1dir)/$$f.$(man1ext) \
- || exit 1; \
- $(INSTALL_DATA) $(pcl3_root)doc$(D)$$f.html $(docdir) || exit 1; done
- $(INSTALL_PROGRAM) $(BINDIR)$(D)pcl3opts$(XE) $(bindir)
-
diff --git a/gs/contrib/pcl3/src/contrib.mak-6.51.add b/gs/contrib/pcl3/src/contrib.mak-6.51.add
deleted file mode 100644
index 84c022ae6..000000000
--- a/gs/contrib/pcl3/src/contrib.mak-6.51.add
+++ /dev/null
@@ -1,239 +0,0 @@
-### Driver "pcl3" for various PCL-3+ printers #################################
-#
-# @(#)$Id: contrib.mak.add,v 1.7 2001/07/27 13:52:58 Martin Rel $
-# Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-# Germany, e-mail: Martin.Lottermoser@t-online.de.
-#
-# Read the file README in the pcl3 distribution for general installation
-# instructions. If you don't have a distribution, visit
-# http://home.t-online.de/home/Martin.Lottermoser/pcl3.html.
-#
-# If you are including both, hpdj and pcl3, in the compilation, you should
-# disable the rules for pclcomp.$(OBJ) and pagecount.$(OBJ) in the hpdj
-# section. The versions of these files contained in the pcl3 distribution are
-# binary compatible with what hpdj 2.6 expects.
-#
-# You can add compilation options to the variable "pcl3_options" below.
-#
-# NDEBUG
-# Define this to remove certain runtime checks from the code which might
-# then become slightly faster. Don't define this for pcl3 beta releases
-# or ghostscript test releases.
-#
-# PCL3_MEDIA_FILE
-# Define this to be a C string containing the absolute path name of a
-# media configuration file if you want the "unspec" subdevice to use this
-# file instead of its default HP DeskJet 850C/855C/870C/890C media
-# configuration. An example definition for UNIX systems is:
-#
-# pcl3_options=-DPCL3_MEDIA_FILE='"$(gsdatadir)/pcl3.mcf"'
-#
-# A detailed description of the meaning and the syntax of this file can
-# be found in the reference page gs-pcl3(1). Briefly, it tells the
-# driver which media sizes your printer supports and how. You can
-# override this at run time with the option "-sMediaConfigurationFile".
-#
-# The variable "eprn_fs_options" is intended for optimization options used only
-# when compiling eprnfs.c. Choose the combination producing the fastest code.
-# You should leave this variable empty unless (a) you definitely know which
-# options produce the fastest code from eprnfs.c, and (b) ghostscript does not
-# use the same options anyway.
-#
-# You should also look at the section below containing the rules for the *.dev
-# files in order to find out which values you can add to the DEVICE_DEVS*
-# variables in the platform-specific make file. You should always add at least
-# the "pcl3" device but you may add others; the latter are shortcuts to the
-# subdevices of pcl3.
-#
-#
-# Remarks for Microsoft Windows
-# =============================
-# When compiling on Microsoft Windows and unless you are using Cygwin, you must
-# define the preprocessor symbol "EPRN_NO_PAGECOUNTFILE" and either remove the
-# dependency of pcl3 on pagecount.obj or replace pagecount.c with an empty
-# file.
-#
-###############################################################################
-
-# Compilation options
-pcl3_options=
-eprn_fs_options=
-
-# Version of the pcl3 rules: $Revision: 1.1.1.4.4.2 $.
-
-#==============================================================================
-
-# eprn rules
-# This is the part you need if you are developing another eprn-based driver.
-
-# Complete set of compilation options
-eprn_opts=-DGS_REVISION=$(GS_REVISION) $(pcl3_options)
-
-# Directory with eprn's source code as seen from the gs directory. The name
-# does not include a trailing path separator.
-eprn_dir=pcl3$(D)eprn
-# Same as above but with a separator
-eprn_src=$(eprn_dir)$(D)
-
-# List of all eprn object files
-eprn_=$(GLOBJ)gdeveprn.$(OBJ) $(GLOBJ)pagecount.$(OBJ) \
- $(GLOBJ)mediasize.$(OBJ) $(GLOBJ)eprnparm.$(OBJ) $(GLOBJ)eprnrend.$(OBJ) \
- $(GLOBJ)eprnfs.$(OBJ)
-
-# List of eprn headers needed when gdeveprn.h is included:
-eprn_headers=$(eprn_src)mediasize.h $(eprn_src)gdeveprn.h
-
-#------------------------------------------------------------------------------
-
-# Rules for individual files
-
-$(GLOBJ)mediasize.$(OBJ): $(eprn_src)mediasize.c $(eprn_src)mediasize.h
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)mediasize.c
-
-$(GLOBJ)gdeveprn.$(OBJ): $(eprn_src)gdeveprn.c $(eprn_headers) \
- $(eprn_src)pagecount.h
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)gdeveprn.c
-
-$(GLOBJ)eprnparm.$(OBJ): $(eprn_src)eprnparm.c $(eprn_headers)
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)eprnparm.c
-
-$(GLOBJ)eprnrend.$(OBJ): $(eprn_src)eprnrend.c $(eprn_headers)
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)eprnrend.c
-
-$(GLOBJ)eprnfs.$(OBJ): $(eprn_src)eprnfs.c $(eprn_headers)
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_fs_options) \
- $(eprn_src)eprnfs.c
-
-# File also used by hpdj:
-$(GLOBJ)pagecount.$(OBJ): $(eprn_src)pagecount.c $(eprn_src)pagecount.h
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)pagecount.c
-
-#==============================================================================
-
-# pcl3 rules
-
-# Complete set of compilation options
-pcl3_opts=-DGS_REVISION=$(GS_REVISION) -I$(eprn_dir) $(pcl3_options)
-
-# Root directory of pcl3 distribution as seen from the gs directory. The
-# variable includes a trailing path separator.
-pcl3_root=pcl3$(D)
-
-# Directory with pcl3's source code (name includes a trailing path separator)
-pcl3_src=$(pcl3_root)src$(D)
-
-# Headers used by most pcl3 files
-pcl3_headers=$(eprn_headers) \
- $(pcl3_src)pclgen.h $(pcl3_src)pclcap.h $(pcl3_src)pclsize.h
-
-# List of all object files needed for pcl3
-pcl3_=$(eprn_) $(GLOBJ)gdevpcl3.$(OBJ) $(GLOBJ)pclcap.$(OBJ) \
- $(GLOBJ)pclgen.$(OBJ) $(GLOBJ)pclcomp.$(OBJ) $(GLOBJ)pclsize.$(OBJ)
-
-#------------------------------------------------------------------------------
-
-# Rules for individual files
-
-$(GLOBJ)pclgen.$(OBJ): $(pcl3_src)pclgen.c $(pcl3_src)pclgen.h
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclgen.c
-
-$(GLOBJ)pclsize.$(OBJ): $(pcl3_src)pclsize.c $(eprn_src)mediasize.h \
- $(pcl3_src)pclsize.h $(pcl3_src)pclgen.h
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclsize.c
-
-$(GLOBJ)pclcap.$(OBJ): $(pcl3_src)pclcap.c $(pcl3_headers)
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclcap.c
-
-$(GLOBJ)gdevpcl3.$(OBJ): $(pcl3_src)gdevpcl3.c $(pcl3_headers)
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)gdevpcl3.c
-
-# File also used by hpdj:
-$(GLOBJ)pclcomp.$(OBJ): $(pcl3_src)pclcomp.c $(pcl3_src)pclgen.h
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclcomp.c
-
-#------------------------------------------------------------------------------
-
-# Device rules. The targets here (e.g., "$(DD)pcl3.dev") are the values you
-# can add to the DEVICE_DEVS* variables in the platform-specific make file.
-
-# The generic pcl3 device with selectable subdevices
-$(DD)pcl3.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)pcl3 $(pcl3_)
-
-# Fixed devices for specific printers
-$(DD)hpdjplus.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdjplus $(pcl3_)
-$(DD)hpdjportable.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdjportable $(pcl3_)
-$(DD)hpdj310.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj310 $(pcl3_)
-$(DD)hpdj320.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj320 $(pcl3_)
-$(DD)hpdj340.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj340 $(pcl3_)
-$(DD)hpdj400.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj400 $(pcl3_)
-$(DD)hpdj500.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj500 $(pcl3_)
-$(DD)hpdj500c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj500c $(pcl3_)
-$(DD)hpdj510.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj510 $(pcl3_)
-$(DD)hpdj520.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj520 $(pcl3_)
-$(DD)hpdj540.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj540 $(pcl3_)
-$(DD)hpdj550c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj550c $(pcl3_)
-$(DD)hpdj560c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj560c $(pcl3_)
-$(DD)hpdj600.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj600 $(pcl3_)
-$(DD)hpdj660c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj660c $(pcl3_)
-$(DD)hpdj670c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj670c $(pcl3_)
-$(DD)hpdj680c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj680c $(pcl3_)
-$(DD)hpdj690c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj690c $(pcl3_)
-$(DD)hpdj850c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj850c $(pcl3_)
-$(DD)hpdj855c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj855c $(pcl3_)
-$(DD)hpdj870c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj870c $(pcl3_)
-$(DD)hpdj890c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj890c $(pcl3_)
-$(DD)hpdj1120c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj1120c $(pcl3_)
-
-#------------------------------------------------------------------------------
-
-# The pcl3opts command.
-# This is deliberately not included in the normal compilation because (a) the
-# rule is unlikely to work and (b) the code is unlikely to compile on any but
-# UNIX systems.
-
-pcl3opts: $(BINDIR)$(D)pcl3opts$(XE)
-pcl3opts_=$(pcl3_src)pcl3opts.c $(pcl3_src)pclscan.c $(eprn_src)mediasize.c \
- $(pcl3_src)pclsize.c
-
-$(BINDIR)$(D)pcl3opts$(XE): $(pcl3opts_)
- $(CC_) -o $@ -I$(eprn_src) $(pcl3opts_)
- gencat $(GLOBJ)pcl3opts-en.cat $(pcl3_src)pcl3opts-en.msg
- gencat $(GLOBJ)pcl3opts-de.cat $(pcl3_src)pcl3opts-de.msg
-
-#------------------------------------------------------------------------------
-
-# Installation rules (work only for UNIX). Note that the PostScript examples
-# and the PPD files are not copied. There are deliberately no prerequisites
-# for this target in order for the first part to work even if pcl3opts did not
-# compile.
-pcl3-install:
- for f in gs-pcl3 pcl3opts; do \
- $(INSTALL_DATA) $(pcl3_root)doc$(D)$$f.1 \
- $(mandir)/man$(man1ext)/$$f.$(man1ext) || exit 1; \
- $(INSTALL_DATA) $(pcl3_root)doc$(D)$$f.html $(docdir) || exit 1; done
- $(INSTALL_PROGRAM) $(BINDIR)$(D)pcl3opts$(XE) $(bindir)
-
diff --git a/gs/contrib/pcl3/src/contrib.mak-7.00.add b/gs/contrib/pcl3/src/contrib.mak-7.00.add
deleted file mode 100644
index fc5406197..000000000
--- a/gs/contrib/pcl3/src/contrib.mak-7.00.add
+++ /dev/null
@@ -1,239 +0,0 @@
-### Driver "pcl3" for various PCL-3+ printers #################################
-#
-# @(#)$Id: contrib.mak.add,v 1.7 2001/07/27 13:52:58 Martin Rel $
-# Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-# Germany, e-mail: Martin.Lottermoser@t-online.de.
-#
-# Read the file README in the pcl3 distribution for general installation
-# instructions. If you don't have a distribution, visit
-# http://home.t-online.de/home/Martin.Lottermoser/pcl3.html.
-#
-# If you are including both, hpdj and pcl3, in the compilation, you should
-# disable the rules for pclcomp.$(OBJ) and pagecount.$(OBJ) in the hpdj
-# section. The versions of these files contained in the pcl3 distribution are
-# binary compatible with what hpdj 2.6 expects.
-#
-# You can add compilation options to the variable "pcl3_options" below.
-#
-# NDEBUG
-# Define this to remove certain runtime checks from the code which might
-# then become slightly faster. Don't define this for pcl3 beta releases
-# or ghostscript test releases.
-#
-# PCL3_MEDIA_FILE
-# Define this to be a C string containing the absolute path name of a
-# media configuration file if you want the "unspec" subdevice to use this
-# file instead of its default HP DeskJet 850C/855C/870C/890C media
-# configuration. An example definition for UNIX systems is:
-#
-# pcl3_options=-DPCL3_MEDIA_FILE='"$(gsdatadir)/pcl3.mcf"'
-#
-# A detailed description of the meaning and the syntax of this file can
-# be found in the reference page gs-pcl3(1). Briefly, it tells the
-# driver which media sizes your printer supports and how. You can
-# override this at run time with the option "-sMediaConfigurationFile".
-#
-# The variable "eprn_fs_options" is intended for optimization options used only
-# when compiling eprnfs.c. Choose the combination producing the fastest code.
-# You should leave this variable empty unless (a) you definitely know which
-# options produce the fastest code from eprnfs.c, and (b) ghostscript does not
-# use the same options anyway.
-#
-# You should also look at the section below containing the rules for the *.dev
-# files in order to find out which values you can add to the DEVICE_DEVS*
-# variables in the platform-specific make file. You should always add at least
-# the "pcl3" device but you may add others; the latter are shortcuts to the
-# subdevices of pcl3.
-#
-#
-# Remarks for Microsoft Windows
-# =============================
-# When compiling on Microsoft Windows and unless you are using Cygwin, you must
-# define the preprocessor symbol "EPRN_NO_PAGECOUNTFILE" and either remove the
-# dependency of pcl3 on pagecount.obj or replace pagecount.c with an empty
-# file.
-#
-###############################################################################
-
-# Compilation options
-pcl3_options=
-eprn_fs_options=
-
-# Version of the pcl3 rules: $Revision: 1.1.1.5.2.3 $.
-
-#==============================================================================
-
-# eprn rules
-# This is the part you need if you are developing another eprn-based driver.
-
-# Complete set of compilation options
-eprn_opts=-DGS_REVISION=$(GS_REVISION) $(pcl3_options)
-
-# Directory with eprn's source code as seen from the gs directory. The name
-# does not include a trailing path separator.
-eprn_dir=pcl3$(D)eprn
-# Same as above but with a separator
-eprn_src=$(eprn_dir)$(D)
-
-# List of all eprn object files
-eprn_=$(GLOBJ)gdeveprn.$(OBJ) $(GLOBJ)pagecount.$(OBJ) \
- $(GLOBJ)mediasize.$(OBJ) $(GLOBJ)eprnparm.$(OBJ) $(GLOBJ)eprnrend.$(OBJ) \
- $(GLOBJ)eprnfs.$(OBJ)
-
-# List of eprn headers needed when gdeveprn.h is included:
-eprn_headers=$(eprn_src)mediasize.h $(eprn_src)gdeveprn.h
-
-#------------------------------------------------------------------------------
-
-# Rules for individual files
-
-$(GLOBJ)mediasize.$(OBJ): $(eprn_src)mediasize.c $(eprn_src)mediasize.h
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)mediasize.c
-
-$(GLOBJ)gdeveprn.$(OBJ): $(eprn_src)gdeveprn.c $(eprn_headers) \
- $(eprn_src)pagecount.h
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)gdeveprn.c
-
-$(GLOBJ)eprnparm.$(OBJ): $(eprn_src)eprnparm.c $(eprn_headers)
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)eprnparm.c
-
-$(GLOBJ)eprnrend.$(OBJ): $(eprn_src)eprnrend.c $(eprn_headers)
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)eprnrend.c
-
-$(GLOBJ)eprnfs.$(OBJ): $(eprn_src)eprnfs.c $(eprn_headers)
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_fs_options) \
- $(eprn_src)eprnfs.c
-
-# File also used by hpdj:
-$(GLOBJ)pagecount.$(OBJ): $(eprn_src)pagecount.c $(eprn_src)pagecount.h
- $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)pagecount.c
-
-#==============================================================================
-
-# pcl3 rules
-
-# Complete set of compilation options
-pcl3_opts=-DGS_REVISION=$(GS_REVISION) -I$(eprn_dir) $(pcl3_options)
-
-# Root directory of pcl3 distribution as seen from the gs directory. The
-# variable includes a trailing path separator.
-pcl3_root=pcl3$(D)
-
-# Directory with pcl3's source code (name includes a trailing path separator)
-pcl3_src=$(pcl3_root)src$(D)
-
-# Headers used by most pcl3 files
-pcl3_headers=$(eprn_headers) \
- $(pcl3_src)pclgen.h $(pcl3_src)pclcap.h $(pcl3_src)pclsize.h
-
-# List of all object files needed for pcl3
-pcl3_=$(eprn_) $(GLOBJ)gdevpcl3.$(OBJ) $(GLOBJ)pclcap.$(OBJ) \
- $(GLOBJ)pclgen.$(OBJ) $(GLOBJ)pclcomp.$(OBJ) $(GLOBJ)pclsize.$(OBJ)
-
-#------------------------------------------------------------------------------
-
-# Rules for individual files
-
-$(GLOBJ)pclgen.$(OBJ): $(pcl3_src)pclgen.c $(pcl3_src)pclgen.h
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclgen.c
-
-$(GLOBJ)pclsize.$(OBJ): $(pcl3_src)pclsize.c $(eprn_src)mediasize.h \
- $(pcl3_src)pclsize.h $(pcl3_src)pclgen.h
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclsize.c
-
-$(GLOBJ)pclcap.$(OBJ): $(pcl3_src)pclcap.c $(pcl3_headers)
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclcap.c
-
-$(GLOBJ)gdevpcl3.$(OBJ): $(pcl3_src)gdevpcl3.c $(pcl3_headers)
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)gdevpcl3.c
-
-# File also used by hpdj:
-$(GLOBJ)pclcomp.$(OBJ): $(pcl3_src)pclcomp.c $(pcl3_src)pclgen.h
- $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclcomp.c
-
-#------------------------------------------------------------------------------
-
-# Device rules. The targets here (e.g., "$(DD)pcl3.dev") are the values you
-# can add to the DEVICE_DEVS* variables in the platform-specific make file.
-
-# The generic pcl3 device with selectable subdevices
-$(DD)pcl3.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)pcl3 $(pcl3_)
-
-# Fixed devices for specific printers
-$(DD)hpdjplus.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdjplus $(pcl3_)
-$(DD)hpdjportable.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdjportable $(pcl3_)
-$(DD)hpdj310.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj310 $(pcl3_)
-$(DD)hpdj320.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj320 $(pcl3_)
-$(DD)hpdj340.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj340 $(pcl3_)
-$(DD)hpdj400.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj400 $(pcl3_)
-$(DD)hpdj500.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj500 $(pcl3_)
-$(DD)hpdj500c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj500c $(pcl3_)
-$(DD)hpdj510.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj510 $(pcl3_)
-$(DD)hpdj520.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj520 $(pcl3_)
-$(DD)hpdj540.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj540 $(pcl3_)
-$(DD)hpdj550c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj550c $(pcl3_)
-$(DD)hpdj560c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj560c $(pcl3_)
-$(DD)hpdj600.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj600 $(pcl3_)
-$(DD)hpdj660c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj660c $(pcl3_)
-$(DD)hpdj670c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj670c $(pcl3_)
-$(DD)hpdj680c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj680c $(pcl3_)
-$(DD)hpdj690c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj690c $(pcl3_)
-$(DD)hpdj850c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj850c $(pcl3_)
-$(DD)hpdj855c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj855c $(pcl3_)
-$(DD)hpdj870c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj870c $(pcl3_)
-$(DD)hpdj890c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj890c $(pcl3_)
-$(DD)hpdj1120c.dev: $(pcl3_) $(DD)page.dev
- $(SETPDEV) $(DD)hpdj1120c $(pcl3_)
-
-#------------------------------------------------------------------------------
-
-# The pcl3opts command.
-# This is deliberately not included in the normal compilation because (a) the
-# rule is unlikely to work and (b) the code is unlikely to compile on any but
-# UNIX systems.
-
-pcl3opts: $(BINDIR)$(D)pcl3opts$(XE)
-pcl3opts_=$(pcl3_src)pcl3opts.c $(pcl3_src)pclscan.c $(eprn_src)mediasize.c \
- $(pcl3_src)pclsize.c
-
-$(BINDIR)$(D)pcl3opts$(XE): $(pcl3opts_)
- $(CC_) -o $@ -I$(eprn_src) $(pcl3opts_)
- gencat $(GLOBJ)pcl3opts-en.cat $(pcl3_src)pcl3opts-en.msg
- gencat $(GLOBJ)pcl3opts-de.cat $(pcl3_src)pcl3opts-de.msg
-
-#------------------------------------------------------------------------------
-
-# Installation rules (work only for UNIX). Note that the PostScript examples
-# and the PPD files are not copied. There are deliberately no prerequisites
-# for this target in order for the first part to work even if pcl3opts did not
-# compile.
-pcl3-install:
- for f in gs-pcl3 pcl3opts; do \
- $(INSTALL_DATA) $(pcl3_root)doc$(D)$$f.1 \
- $(mandir)/man$(man1ext)/$$f.$(man1ext) || exit 1; \
- $(INSTALL_DATA) $(pcl3_root)doc$(D)$$f.html $(docdir) || exit 1; done
- $(INSTALL_PROGRAM) $(BINDIR)$(D)pcl3opts$(XE) $(bindir)
-
diff --git a/gs/contrib/pcl3/src/gdevpcl3.c b/gs/contrib/pcl3/src/gdevpcl3.c
deleted file mode 100644
index f9f0050dd..000000000
--- a/gs/contrib/pcl3/src/gdevpcl3.c
+++ /dev/null
@@ -1,1579 +0,0 @@
-/******************************************************************************
- File: $Id: gdevpcl3.c,v 1.32 2001/08/14 15:22:35 Martin Rel $
- Contents: Ghostscript device 'pcl3' for PCL-3+ printers
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany. E-mail: Martin.Lottermoser@t-online.de.
-
-*******************************************************************************
-* *
-* Copyright (C) 2000, 2001 by Martin Lottermoser *
-* All rights reserved *
-* *
-*******************************************************************************
-
- Preprocessor symbols:
-
- GS_REVISION (integer)
- If defined, this must be the ghostscript version number, e.g., 601 for
- ghostscript 6.01.
-
- PCL3_MEDIA_FILE (const char *)
- Define this to set a media configuration file for the "unspec" device
- unless the user overrides it.
-
-******************************************************************************/
-
-/* Configuration management identification */
-#ifndef lint
-static const char
- cm_id[] = "@(#)$Id: gdevpcl3.c,v 1.32 2001/08/14 15:22:35 Martin Rel $";
-#endif
-
-/*****************************************************************************/
-
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE 500
-#endif
-
-/* Special Aladdin header, must be included before <sys/types.h> on some
- platforms (e.g., FreeBSD). */
-#include "std.h"
-
-/* Standard headers */
-#include <assert.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* Ghostscript headers */
-#ifdef EPRN_TRACE
-#include "gdebug.h"
-#endif /* EPRN_TRACE */
-
-/* Driver-specific headers */
-#include "gdeveprn.h"
-#include "pclcap.h"
-#include "pclgen.h"
-#include "pclsize.h"
-
-/*****************************************************************************/
-
-/* Does the argument point to an instance of the generic (pcl3) device? */
-#define is_generic_device(dev) (strcmp(dev->dname, "pcl3") == 0)
-
-/*****************************************************************************/
-
-/* Combined type with a range of bool plus null */
-typedef enum {bn_null, bn_true, bn_false} bool_or_null;
-
-/* Type for duplex capabilities */
-typedef enum {Duplex_none, Duplex_sameLeadingEdge, Duplex_oppositeLeadingEdge,
- Duplex_both} DuplexCapabilities;
-
-/* Device structure */
-typedef struct {
- gx_eprn_device_common; /* eprn part including base types */
-
- /* Printer selection and other data not directly mappable to PCL */
- pcl_Printer printer;
- bool_or_null use_card;
- DuplexCapabilities duplex_capability;
- bool tumble; /* only relevant if 'Duplex' is 'true' */
-
- /* PCL generation */
- bool
- initialized, /* Has init() been run on this device instance? */
- configured, /* Has the output file been configured? */
- configure_every_page; /* Repeat the configuration for every page? */
- pcl_FileData file_data;
-} pcl3_Device;
-
-/*****************************************************************************/
-
-/* Device procedures */
-static dev_proc_open_device(pcl3_open_device);
-static dev_proc_close_device(pcl3_close_device);
-static dev_proc_get_params(pcl3_get_params);
-static dev_proc_put_params(pcl3_put_params);
-
-/* Device procedure table */
-static gx_device_procs pcl3_procs = {
- eprn_procs_initdata(pcl3_open_device, pcl3_close_device, pcl3_get_params,
- pcl3_put_params)
-};
-
-/* prn procedure implementations */
-#if !defined(GS_REVISION) || GS_REVISION >= 550
-static prn_dev_proc_print_page(pcl3_print_page);
-#else
-static dev_proc_print_page(pcl3_print_page);
-#endif
-
-/*****************************************************************************/
-
-/* Media flags known to this device in addition to the standard ones */
-static const ms_Flag
- flag_description[] = {
- {PCL_CARD_FLAG, PCL_CARD_STRING},
- {ms_none, NULL}
- };
-
-/* List of possible optional media flags */
-static const ms_MediaCode
- card_is_optional[] = {PCL_CARD_FLAG, ms_none};
-
-/*****************************************************************************/
-
-/* Forward declaration */
-static void pcl3_flag_mismatch_reporter(FILE *err,
- const struct s_eprn_Device *eprn, bool no_match);
-
-/* Macro for creating device structure instances */
-#define pcl3_device_instance(dname, printer) \
- pcl3_Device gs_##dname##_device = { \
- eprn_device_initdata( \
- pcl3_Device, /* device type */ \
- pcl3_procs, /* static device procedure table */ \
- #dname, /* device name */ \
- 300.0, 300.0, /* horizontal and vertical resolution */\
- pcl3_print_page, /* print page routine */ \
- &pcl3_printers[printer].desc, /* printer capability description */ \
- flag_description, /* flag descriptions */ \
- ms_none, /* desired media flags */ \
- card_is_optional, /* list of optional flags */ \
- &pcl3_flag_mismatch_reporter), /* reporting function */\
- printer, /* printer */ \
- bn_null, /* use_card */ \
- Duplex_none, /* duplex_capability */ \
- false, /* tumble */ \
- false /* initialized */ \
- /* The remaining fields will be set in init(). */ \
- }
-
-/* Generic and flexible device structure instance */
-pcl3_device_instance(pcl3, pcl3_generic_new);
-
-/* Printer-specific and fixed device structure instances */
-/* At present there is no entry for the HP DeskJet because its natural name
- collides with the hpdj driver. */
-pcl3_device_instance(hpdjplus, HPDeskJetPlus);
-pcl3_device_instance(hpdjportable, HPDJPortable);
-pcl3_device_instance(hpdj310, HPDJ310);
-pcl3_device_instance(hpdj320, HPDJ320);
-pcl3_device_instance(hpdj340, HPDJ340);
-pcl3_device_instance(hpdj400, HPDJ400);
-pcl3_device_instance(hpdj500, HPDJ500);
-pcl3_device_instance(hpdj500c, HPDJ500C);
-pcl3_device_instance(hpdj510, HPDJ510);
-pcl3_device_instance(hpdj520, HPDJ520);
-pcl3_device_instance(hpdj540, HPDJ540);
-pcl3_device_instance(hpdj550c, HPDJ550C);
-pcl3_device_instance(hpdj560c, HPDJ560C);
-pcl3_device_instance(hpdj600, HPDJ600);
-pcl3_device_instance(hpdj660c, HPDJ660C);
-pcl3_device_instance(hpdj670c, HPDJ670C);
-pcl3_device_instance(hpdj680c, HPDJ680C);
-pcl3_device_instance(hpdj690c, HPDJ690C);
-pcl3_device_instance(hpdj850c, HPDJ850C);
-pcl3_device_instance(hpdj855c, HPDJ855C);
-pcl3_device_instance(hpdj870c, HPDJ870C);
-pcl3_device_instance(hpdj890c, HPDJ890C);
-pcl3_device_instance(hpdj1120c, HPDJ1120C);
-
-/*****************************************************************************/
-
-#define ERRPREF "? pcl3: "
-#define WARNPREF "?-W pcl3: "
-
-#define array_size(a) (sizeof(a)/sizeof(a[0]))
-
-/*****************************************************************************/
-
-static const eprn_StringAndInt
- /* Names for duplex capabilities */
- duplex_capabilities_list[] = {
- { "none", Duplex_none },
- { "sameLeadingEdge", Duplex_sameLeadingEdge },
- { "oppositeLeadingEdge", Duplex_oppositeLeadingEdge },
- { "both", Duplex_both },
- { NULL, 0 }
- },
- /* Names for PCL Media Type values */
- media_type_list[] = {
- /* Canonical names */
- { "plain paper", 0 },
- { "bond paper", 1 },
- { "HP Premium paper", 2 },
- { "glossy paper", 3 },
- { "transparency film", 4 },
- { "quick dry glossy", 5 },
- { "quick dry transparency", 6 },
- /* Shortened names */
- { "plain", 0 },
- { "bond", 1 },
- { "Premium", 2 },
- { "glossy", 3 },
- { "transparency", 4 },
- { NULL, 0 }
- },
- /* Print Quality */
- print_quality_list[] = {
- { "draft", -1 },
- { "normal", 0 },
- { "presentation", 1 },
- /* Start of synonyms */
- { "econo", -1 },
- { "best", 1 },
- { NULL, 0 }
- },
- /* Subdevice names. They must be ordered by 'value' except for the last
- (NULL) entry. At present, there are 26 non-NULL entries here. */
- subdevice_list[] = {
- { "hpdj", HPDeskJet },
- { "hpdjplus", HPDeskJetPlus },
- { "hpdjportable", HPDJPortable },
- { "hpdj310", HPDJ310 },
- { "hpdj320", HPDJ320 },
- { "hpdj340", HPDJ340 },
- { "hpdj400", HPDJ400 },
- { "hpdj500", HPDJ500 },
- { "hpdj500c", HPDJ500C },
- { "hpdj510", HPDJ510 },
- { "hpdj520", HPDJ520 },
- { "hpdj540", HPDJ540 },
- { "hpdj550c", HPDJ550C },
- { "hpdj560c", HPDJ560C },
- { "unspecold", pcl3_generic_old },
- { "hpdj600", HPDJ600 },
- { "hpdj660c", HPDJ660C },
- { "hpdj670c", HPDJ670C },
- { "hpdj680c", HPDJ680C },
- { "hpdj690c", HPDJ690C },
- { "hpdj850c", HPDJ850C },
- { "hpdj855c", HPDJ855C },
- { "hpdj870c", HPDJ870C },
- { "hpdj890c", HPDJ890C },
- { "hpdj1120c", HPDJ1120C },
- { "unspec", pcl3_generic_new },
- { NULL, 0 }
- };
-
-/******************************************************************************
-
- Function: cmp_by_value
-
- This function compares two 'eprn_StringAndInt' instances by their 'value'
- fields.
-
-******************************************************************************/
-
-static int cmp_by_value(const void *a, const void *b)
-{
- return ((const eprn_StringAndInt *)a)->value -
- ((const eprn_StringAndInt *)b)->value;
-}
-
-/******************************************************************************
-
- Function: get_string_for_int
-
- This function returns a string representation of 'in_value' in '*out_value',
- based on 'table'. 'table' must be an array terminated with an entry having
- NULL as the 'name' value and must be permanently allocated and constant.
- If 'in_value' cannot be found in 'table', the function returns a decimal
- representation of 'in_value'.
-
- The string buffer in '*out_value' will be a permanently allocated area which
- must not be modified.
-
-******************************************************************************/
-
-static void get_string_for_int(int in_value, const eprn_StringAndInt *table,
- gs_param_string *out_value)
-{
- while (table->name != NULL && table->value != in_value) table++;
- if (table->name != NULL) {
- out_value->data = (const byte *)table->name;
- out_value->size = strlen(table->name);
- out_value->persistent = true;
- }
- else {
- static char buffer[22]; /* Must be sufficient for an 'int' */
-
- sprintf(buffer, "%d", in_value);
- assert(strlen(buffer) < sizeof(buffer));
- out_value->data = (const byte *)buffer;
- out_value->size = strlen(buffer);
- out_value->persistent = false;
- }
-
- return;
-}
-
-/******************************************************************************
-
- Function: get_int_for_string
-
- This function parses 'in_value' based on 'table' and returns the result in
- '*out_value'. 'table' must be an array, terminated with an entry having NULL
- as the value for 'name'.
-
- 'in_value' must either be a decimal representation of an integer or must be
- a string present in 'table'. In these cases, the function returns 0,
- otherwise a non-zero ghostscript error value.
-
- On returning 'gs_error_VMerror', the function will have issued an error
- message.
-
-******************************************************************************/
-
-static int get_int_for_string(const gs_param_string *in_value,
- const eprn_StringAndInt *table, int *out_value)
-{
- char *s;
- int read; /* counter */
-
- /* First we construct a properly NUL-terminated string */
- s = (char *) malloc(in_value->size + 1);
- if (s == NULL) {
- fprintf(stderr, ERRPREF
- "Memory allocation failure in get_int_for_string(): %s.\n",
- strerror(errno));
- return_error(gs_error_VMerror);
- }
- strncpy(s, (const char *)in_value->data, in_value->size);
- s[in_value->size] = '\0';
-
- /* To foil bugs in sscanf() on Windows (see gdeveprn.c in eprn) I'm removing
- trailing white space here instead of skipping it with a format. */
- {
- char *t = strchr(s, '\0');
-
- while (s < t && isspace(*(t-1))) t--;
- *t = '\0';
- }
-
- /* Check for a numerical value */
- if (sscanf(s, "%d%n", out_value, &read) != 1 || s[read] != '\0') {
- /* What the user specified is not a valid numerical value */
- while (table->name != NULL && strcmp(table->name, s) != 0) table++;
- if (table->name == NULL) {
- free(s); s = NULL;
- return_error(gs_error_rangecheck);
- }
- *out_value = table->value;
- }
-
- free(s); s = NULL;
-
- return 0;
-}
-
-/******************************************************************************
-
- Function: init
-
- This function does that part of initialization which cannot be performed at
- compile time or which must be repeated whenever the subdevice is changed.
- It must be called if 'initialized' is false and after the subdevice is
- changed.
-
- When this function is called, 'dev->printer' must have been set correctly.
-
- This function must not and does not depend on the state of initialization of
- its base devices.
-
-******************************************************************************/
-
-static void init(pcl3_Device *dev)
-{
-#ifndef NDEBUG
- /* Check that 'subdevice_list' is sorted by 'value' */
- {
- int j;
- for (j = 1; j < array_size(subdevice_list) - 1; j++)
- assert(cmp_by_value(subdevice_list + j - 1, subdevice_list + j) <= 0);
- }
-#endif /* !NDEBUG */
-
- /* Base class fields */
- if (is_generic_device(dev)) dev->Duplex_set = 0;
- /* "Duplex" is null. See remarks on the "Duplex" page device parameter in
- pcl3_put_params(). */
-
- /* pcl3 fields */
- dev->use_card = bn_null;
- dev->duplex_capability = Duplex_none;
- dev->tumble = false;
- dev->configured = false;
- dev->configure_every_page = false;
-
- /* Initialize 'file_data' */
- pcl3_fill_defaults(dev->printer, &dev->file_data);
-
- dev->initialized = true;
-
- return;
-}
-
-/******************************************************************************
-
- Function: pcl3_flag_mismatch_reporter
-
- Flag mismatch reporting function for the pcl3 device.
-
- The 'desired_flags' field can only contain MS_BIG_FLAG and PCL_CARD_FLAG.
-
-******************************************************************************/
-
-static void pcl3_flag_mismatch_reporter(FILE *err,
- const struct s_eprn_Device *eprn, bool no_match)
-{
- const char *epref = eprn->CUPS_messages? CUPS_ERRPREF: "";
-
- if (eprn->desired_flags == 0) {
- fprintf(stderr,
- "%s" ERRPREF "The %s does not support the requested media properties.\n",
- epref, eprn->cap->name);
- }
- else if (eprn->desired_flags == MS_BIG_FLAG) {
- fprintf(stderr, "%s" ERRPREF "The %s does not support banner printing",
- epref, eprn->cap->name);
- if (!no_match) fputs(" for this size", stderr);
- fputs(".\n", stderr);
- }
- else if (eprn->desired_flags == PCL_CARD_FLAG) {
- fprintf(stderr, "%s" ERRPREF
- "The %s does not support a `Card' variant for ",
- epref, eprn->cap->name);
- if (no_match) fputs("any", stderr); else fputs("this", stderr);
- fputs(" size.\n", stderr);
- }
- else {
- fprintf(stderr,
- "%s" ERRPREF "Banner printing on postcards?? You must be joking!\n",
- epref);
- }
-
- return;
-}
-
-/******************************************************************************
-
- Function: find_subdevice_name
-
- This function returns a pointer to a static storage location containing
- a NUL-terminated string with the name of the subdevice for 'subdev'.
-
- It must not be called for invalid 'subdev' values.
-
-******************************************************************************/
-
-static const char *find_subdevice_name(int subdev)
-{
- eprn_StringAndInt
- key = {NULL, 0};
- const eprn_StringAndInt
- *found;
-
- key.value = subdev;
-
- found = (const eprn_StringAndInt *)bsearch(&key, subdevice_list,
- array_size(subdevice_list) - 1, sizeof(eprn_StringAndInt), cmp_by_value);
- assert(found != NULL);
-
- return found->name;
-}
-
-/******************************************************************************
-
- Function: pcl3_get_params
-
- This function returns to the caller information about the values of
- parameters defined for the device. This includes parameters defined in base
- classes.
-
- The function returns zero on success and a negative value on error.
-
-******************************************************************************/
-
-static int pcl3_get_params(gx_device *device, gs_param_list *plist)
-{
- gs_param_string string_value;
- pcl3_Device *dev = (pcl3_Device *)device;
- const pcl_FileData *data = &dev->file_data;
- int
- temp, /* Used as an intermediate for various reasons */
- rc;
-
- /* Constructor */
- if (!dev->initialized) init(dev);
-
- /* Base class parameters */
- rc = eprn_get_params(device, plist);
- if (rc < 0) return rc;
-
- /* Compression method */
- temp = data->compression;
- if ((rc = param_write_int(plist, "CompressionMethod", &temp)) < 0) return rc;
-
- /* Configure every page */
- if ((rc = param_write_bool(plist, "ConfigureEveryPage",
- &dev->configure_every_page)) < 0) return rc;
-
- /* Dry time */
- if (data->dry_time < 0) {
- if ((rc = param_write_null(plist, "DryTime")) < 0) return rc;
- }
- else if ((rc = param_write_int(plist, "DryTime", &data->dry_time)) < 0)
- return rc;
-
- /* Duplex capability */
- if (is_generic_device(dev)) {
- eprn_get_string(dev->duplex_capability, duplex_capabilities_list,
- &string_value);
- if ((rc = param_write_string(plist, "DuplexCapability", &string_value)) < 0)
- return rc;
- }
-
- /* Manual feed */
- {
- bool temp = dev->file_data.manual_feed;
- if ((rc = param_write_bool(plist, "ManualFeed", &temp)) < 0) return rc;
- }
-
- /* PCL media type */
- get_string_for_int(data->media_type, media_type_list, &string_value);
- if ((rc = param_write_string(plist, "Medium", &string_value)) < 0)
- return rc;
-
- /* Media destination */
- if ((rc = param_write_int(plist, "%MediaDestination",
- &data->media_destination)) < 0) return rc;
-
- /* Media source */
- if ((rc = param_write_int(plist, "%MediaSource", &data->media_source)) < 0)
- return rc;
-
- /* Use of Configure Raster Data */
- if (is_generic_device(dev) || pcl_has_CRD(data->level)) {
- bool temp = (data->level == pcl_level_3plus_CRD_only);
- if ((rc = param_write_bool(plist, "OnlyCRD", &temp)) < 0) return rc;
- }
-
- /* PCL initilization strings */
- if (data->init1.length == 0) {
- if ((rc = param_write_null(plist, "PCLInit1")) < 0) return rc;
- }
- else {
- string_value.data = (const byte *)data->init1.str;
- string_value.size = data->init1.length;
- string_value.persistent = false;
- if ((rc = param_write_string(plist, "PCLInit1", &string_value)) < 0)
- return rc;
- }
- if (data->init2.length == 0) {
- if ((rc = param_write_null(plist, "PCLInit2")) < 0) return rc;
- }
- else {
- string_value.data = (const byte *)data->init2.str;
- string_value.size = data->init2.length;
- string_value.persistent = false;
- if ((rc = param_write_string(plist, "PCLInit2", &string_value)) < 0)
- return rc;
- }
-
- /* PJL job name */
- if (data->PJL_job == NULL) {
- if ((rc = param_write_null(plist, "PJLJob")) < 0) return rc;
- }
- else {
- string_value.data = (const byte *)data->PJL_job;
- string_value.size = strlen(data->PJL_job);
- string_value.persistent = false;
- if ((rc = param_write_string(plist, "PJLJob", &string_value)) < 0)
- return rc;
- }
-
- /* PJL language */
- if (data->PJL_language == NULL) {
- if ((rc = param_write_null(plist, "PJLLanguage")) < 0) return rc;
- }
- else {
- string_value.data = (const byte *)data->PJL_language;
- string_value.size = strlen(data->PJL_language);
- string_value.persistent = false;
- if ((rc = param_write_string(plist, "PJLLanguage", &string_value)) < 0)
- return rc;
- }
-
- /* Print quality */
- get_string_for_int(data->print_quality, print_quality_list, &string_value);
- if ((rc = param_write_string(plist, "PrintQuality", &string_value)) < 0)
- return rc;
-
- /* Black bit planes first (standard PCL) or last */
- {
- bool temp = (data->order_CMYK == TRUE);
- if ((rc = param_write_bool(plist, "SendBlackLast", &temp)) < 0) return rc;
- }
-
- /* NUL header */
- if ((rc = param_write_int(plist, "SendNULs", &data->NULs_to_send)) < 0)
- return rc;
-
- /* Subdevice name, but only for the generic device */
- if (is_generic_device(dev)) {
- const char *name = find_subdevice_name(dev->printer);
- string_value.data = (const byte *)name;
- string_value.size = strlen(name);
- string_value.persistent = true;
- if ((rc = param_write_string(plist, "Subdevice", &string_value)) < 0)
- return rc;
- }
-
- /* Tumble */
- if (is_generic_device(dev))
- if ((rc = param_write_bool(plist, "Tumble", &dev->tumble)) < 0) return rc;
-
- /* UseCard */
- if (dev->use_card == bn_null) {
- if ((rc = param_write_null(plist, "UseCard")) < 0) return rc;
- }
- else {
- bool temp = (dev->use_card == bn_true);
- if ((rc = param_write_bool(plist, "UseCard", &temp)) < 0) return rc;
- }
-
- /* The old quality commands if they have meaning for this device */
- if (pcl_use_oldquality(data->level)) {
- /* Depletion */
- if (data->depletion == 0) {
- if ((rc = param_write_null(plist, "Depletion")) < 0) return rc;
- }
- else if ((rc = param_write_int(plist, "Depletion", &data->depletion)) < 0)
- return rc;
-
- /* Raster Graphics Quality */
- if ((rc = param_write_int(plist, "RasterGraphicsQuality",
- &data->raster_graphics_quality)) < 0) return rc;
-
- /* Shingling */
- if ((rc = param_write_int(plist, "Shingling", &data->shingling)) < 0)
- return rc;
- }
- else if (is_generic_device(dev)) {
- /* It is logically wrong for these parameters to be visible if we are
- dealing with a group-3 device, but I haven't yet found a way to get
- around ghostscript's undefined-parameter-update problem. */
- if ((rc = param_write_null(plist, "Depletion")) < 0) return rc;
- if ((rc = param_write_null(plist, "RasterGraphicsQuality")) < 0) return rc;
- if ((rc = param_write_null(plist, "Shingling")) < 0) return rc;
- }
-
-#ifdef EPRN_TRACE
- if (gs_debug_c(EPRN_TRACE_CHAR)) {
- dlprintf("! pcl3_get_params() returns the following parameters:\n");
- eprn_dump_parameter_list(plist);
- }
-#endif
-
- return 0;
-}
-
-/******************************************************************************
-
- Function: fetch_octets
-
- This function checks whether 'plist' contains a string entry for the parameter
- 'pname' and returns the value via '*s' if it does.
-
- Neither 'plist' nor 'pname' may be NULL. On entry, '*s' must be a valid octet
- string; if it is non-zero, 's->str' must point to a gs_malloc()-allocated
- storage area of length 's->length'.
-
- If the parameter exists in 'plist', its type must be null or string. If it is
- null, '*s' will become zero. If the parameter type is string, the value will
- be copied to '*s'.
-
- The function returns a negative ghostscript error code on error and zero
- otherwise. In the former case an error message will have been issued on
- stderr, using 'epref' as a prefix for the message.
-
-******************************************************************************/
-
-static int fetch_octets(const char *epref,
- gs_param_list *plist, const char *pname, pcl_OctetString *s)
-{
- gs_param_string string_value;
- int rc;
-
- if ((rc = param_read_null(plist, pname)) == 0) {
- if (s->length != 0)
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), s->str, s->length, sizeof(pcl_Octet), "fetch_octets");
- s->str = NULL;
- s->length = 0;
- }
- else if (rc < 0 &&
- (rc = param_read_string(plist, pname, &string_value)) == 0) {
- /* Free old storage */
- if (s->length != 0)
- gs_free(gs_lib_ctx_get_non_gc_memory_t(), s->str, s->length, sizeof(pcl_Octet), "fetch_octets");
-
- /* Allocate new */
- s->str = (pcl_Octet *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), string_value.size, sizeof(pcl_Octet),
- "fetch_octets");
-
- if (s->str == NULL) {
- s->length = 0;
- fprintf(stderr, "%s" ERRPREF
- "Memory allocation failure from gs_malloc().\n", epref);
- rc = gs_error_VMerror;
- param_signal_error(plist, pname, rc);
- }
- else {
- memcpy(s->str, string_value.data, string_value.size);
- s->length = string_value.size;
- }
- }
- else if (rc > 0) rc = 0;
-
- return rc;
-}
-
-/******************************************************************************
-
- Function: fetch_cstring
-
- This function checks whether 'plist' contains a string entry for the parameter
- 'pname' and returns the value via '*s' if it does.
-
- Neither 'plist' nor 'pname' may be NULL. On entry, '*s' must be NULL or point
- to a NUL-terminated string in a gs_malloc()-allocated storage area.
-
- If the parameter exists in 'plist', its type must be null or string. If it is
- null, '*s' will be gs_free()d and set to NULL. If it is a string, '*s' will
- be reallocated to contain the NUL-terminated value of the string. Should the
- string already contain a NUL value, only the part up to the NUL will be
- copied.
-
- The function returns a negative ghostscript error code on error and zero
- otherwise. In the former case an error message will have been issued on
- stderr.
-
-******************************************************************************/
-
-static int fetch_cstring(const char *epref,
- gs_param_list *plist, const char *pname, char **s)
-{
- gs_param_string string_value;
- int rc;
-
- if ((rc = param_read_null(plist, pname)) == 0) {
- if (*s != NULL) gs_free(gs_lib_ctx_get_non_gc_memory_t(), *s, strlen(*s) + 1, sizeof(char), "fetch_cstring");
- *s = NULL;
- }
- else if (rc < 0 &&
- (rc = param_read_string(plist, pname, &string_value)) == 0) {
- /* Free old storage */
- if (*s != NULL) gs_free(gs_lib_ctx_get_non_gc_memory_t(), *s, strlen(*s) + 1, sizeof(char), "fetch_cstring");
-
- /* Allocate new */
- *s = (char *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), string_value.size + 1, sizeof(char),
- "fetch_cstring");
-
- if (*s == NULL) {
- fprintf(stderr, "%s" ERRPREF
- "Memory allocation failure from gs_malloc().\n", epref);
- rc = gs_error_VMerror;
- param_signal_error(plist, pname, rc);
- }
- else {
- strncpy(*s, (const char*)string_value.data, string_value.size);
- (*s)[string_value.size] = '\0';
- }
- }
- else if (rc > 0) rc = 0;
-
- return rc;
-}
-
-/******************************************************************************
-
- Function: set_palette
-
- This function sets 'dev->file_data.palette' and some other fields in
- agreement with 'dev->eprn.colour_model'.
-
-******************************************************************************/
-
-static void set_palette(pcl3_Device *dev)
-{
- pcl_FileData *data = &dev->file_data;
-
- switch(dev->eprn.colour_model) {
- case eprn_DeviceGray:
- {
- const eprn_ColourInfo *ci = dev->eprn.cap->colour_info;
-
- /* Can this printer switch palettes? */
- while (ci->info[0] != NULL && ci->colour_model == eprn_DeviceGray) ci++;
- if (ci->info[0] != NULL) data->palette = pcl_black;
- else data->palette = pcl_no_palette;
- }
- data->number_of_colorants = 1;
- data->depletion = 0; /* Depletion is only meaningful for colour. */
- break;
- case eprn_DeviceCMY:
- data->palette = pcl_CMY;
- data->number_of_colorants = 3;
- break;
- case eprn_DeviceRGB:
- data->palette = pcl_RGB;
- data->number_of_colorants = 3;
- break;
- case eprn_DeviceCMY_plus_K:
- /*FALLTHROUGH*/
- case eprn_DeviceCMYK:
- data->palette = pcl_CMYK;
- data->number_of_colorants = 4;
- break;
- default:
- assert(0);
- }
-
- return;
-}
-
-/******************************************************************************
-
- Function: pcl3_put_params
-
- This function reads a parameter list, extracts the parameters known to the
- device, and configures the device appropriately. This includes parameters
- defined by base classes.
-
- If an error occurs in the processing of parameters, the function will
- return a negative value, otherwise zero.
-
- This function does *not* exhibit transactional behaviour as requested in
- gsparam.h, i.e. on error the parameter values in the device structure
- might have changed. However, all values will be individually valid.
-
- Some of the parameters determine derived data in base classes or are relevant
- for device initialization. Setting any of these parameters closes the
- device if it is open.
-
-******************************************************************************/
-
-static int pcl3_put_params(gx_device *device, gs_param_list *plist)
-{
- bool new_quality = false; /* has someone requested the new variables? */
- gs_param_name pname;
- gs_param_string string_value;
- pcl3_Device *dev = (pcl3_Device *)device;
- const char
- *epref = dev->eprn.CUPS_messages? CUPS_ERRPREF: "",
- *wpref = dev->eprn.CUPS_messages? CUPS_WARNPREF: "";
- eprn_ColourModel previous_colour_model = dev->eprn.colour_model;
- pcl_FileData *data = &dev->file_data;
- int
- last_error = 0,
- temp,
- rc;
- struct {
- int depletion, quality, shingling;
- } requested = {-1, -1, -1};
- /* old quality parameters. -1 means "not specified". */
-
- /* Check for subdevice selection */
- if (is_generic_device(dev)) {
- if ((rc = param_read_string(plist, (pname = "Subdevice"), &string_value))
- == 0) {
- /* This property must be a known string. */
- int j = 0;
- while (subdevice_list[j].name != NULL &&
- (string_value.size != strlen(subdevice_list[j].name) ||
- strncmp((const char *)string_value.data, subdevice_list[j].name,
- string_value.size) != 0))
- j++;
- /* param_read_string() does not return NUL-terminated strings. */
- if (subdevice_list[j].name != NULL) {
- if (dev->is_open) gs_closedevice(device);
- dev->printer = subdevice_list[j].value;
- dev->initialized = false;
- eprn_init_device((eprn_Device *)dev, &pcl3_printers[dev->printer].desc);
- }
- else {
- fprintf(stderr, "%s" ERRPREF "Unknown subdevice name: `", epref);
- fwrite(string_value.data, sizeof(char), string_value.size, stderr);
- fputs("'.\n", stderr);
- last_error = gs_error_rangecheck;
- param_signal_error(plist, pname, last_error);
- }
- }
- else if (rc < 0) last_error = rc;
- }
-
- /* Constructor */
- if (!dev->initialized) init(dev);
-
- /* Compression method */
- if ((rc = param_read_int(plist, (pname = "CompressionMethod"), &temp))
- == 0) {
- if (temp != pcl_cm_none && temp != pcl_cm_rl && temp != pcl_cm_tiff &&
- temp != pcl_cm_delta && temp != pcl_cm_crdr) {
- fprintf(stderr,
- "%s" ERRPREF "Unsupported compression method: %d.\n", epref, temp);
- last_error = gs_error_rangecheck;
- param_signal_error(plist, pname, last_error);
- }
- else {
- if (temp == pcl_cm_crdr && (dev->printer == HPDeskJet ||
- dev->printer == HPDeskJetPlus || dev->printer == HPDJ500)) {
- /* This I know to be the case for the DJ 500. The others are guessed. */
- fprintf(stderr,
- "%s" ERRPREF "The %s does not support compression method 9.\n",
- epref, dev->eprn.cap->name);
- last_error = gs_error_rangecheck;
- param_signal_error(plist, pname, last_error);
- }
- else data->compression= temp;
- }
- }
- else if (rc < 0) last_error = rc;
-
- /* Configure every page */
- if ((rc = param_read_bool(plist, "ConfigureEveryPage",
- &dev->configure_every_page)) < 0) last_error = rc;
-
- /* Depletion */
- if ((rc = param_read_null(plist, (pname = "Depletion"))) == 0)
- requested.depletion = 0;
- else if (rc < 0 && (rc = param_read_int(plist, pname, &temp)) == 0) {
- if (1 <= temp && temp <= 5 && (dev->printer != HPDJ500C || temp <= 3))
- requested.depletion = temp;
- else {
- fprintf(stderr, "%s" ERRPREF "Invalid value for depletion: %d.\n",
- epref, temp);
- last_error = gs_error_rangecheck;
- param_signal_error(plist, pname, last_error);
- }
- }
- else if (rc < 0) last_error = rc;
-
- /* Dry time */
- if ((rc = param_read_null(plist, (pname = "DryTime"))) == 0)
- data->dry_time = -1;
- else if (rc < 0 &&
- (rc = param_read_int(plist, pname, &temp)) == 0) {
- if (0 <= temp && temp <= 1200) {
- if (dev->printer == HPDJ500 || dev->printer == HPDJ500C) {
- /* According to HP (DJ6/8 p. 18), only some of the series 600 and 800
- DeskJets respond to this command. I also suspect that the same is
- true for pre-DeskJet-500 printers. This should not matter, though,
- because the PCL interpreter should merely ignore the command.
- Hence I'm giving an error message only in those cases where HP
- explicitly states that the printer does not support the command.
- */
- fprintf(stderr,
- "%s" ERRPREF "The %s does not support setting a dry time.\n",
- epref, dev->eprn.cap->name);
- last_error = gs_error_rangecheck;
- param_signal_error(plist, pname, last_error);
- }
- else data->dry_time = temp;
- }
- else {
- fprintf(stderr,
- "%s" ERRPREF "Invalid value for the dry time: %d.\n", epref, temp);
- last_error = gs_error_rangecheck;
- param_signal_error(plist, pname, last_error);
- }
- }
- else if (rc < 0) last_error = rc;
-
- /* Duplex capability */
- if (is_generic_device(dev)) {
- if ((rc = param_read_string(plist, (pname = "DuplexCapability"),
- &string_value)) == 0) {
- rc = eprn_get_int(&string_value, duplex_capabilities_list, &temp);
- if (rc == 0) {
- if (dev->printer == pcl3_generic_new ||
- dev->printer == pcl3_generic_old || temp == Duplex_none) {
- dev->duplex_capability = temp;
- if (dev->duplex_capability == Duplex_none)
- dev->Duplex_set = 0; /* force to "null" */
- }
- else {
- fprintf(stderr, "%s" ERRPREF
- "You can use a non-trivial value for DuplexCapability\n"
- "%s only for unspec and unspecold.\n", epref, epref);
- last_error = gs_error_rangecheck;
- param_signal_error(plist, pname, last_error);
- }
- }
- else {
- fprintf(stderr, "%s" ERRPREF "Invalid duplex capability: `", epref);
- fwrite(string_value.data, sizeof(char), string_value.size, stderr);
- fputs("'.\n", stderr);
- last_error = gs_error_rangecheck;
- param_signal_error(plist, pname, last_error);
- }
- }
- else if (rc < 0) last_error = rc;
- }
-
- /* Check on "Duplex". This parameter is really read in gdev_prn_put_params(),
- but we check here to prevent it being set unless the printer really
- supports duplex printing. I would prefer to use the 'Duplex_set' variable
- for controlling the appearance of this page device parameter, but if I do,
- I can set the parameter only from PostScript and not from the command line.
- */
- {
- bool temp;
- if ((rc = param_read_bool(plist, (pname = "Duplex"), &temp)) == 0 &&
- temp && dev->duplex_capability == Duplex_none) {
- if (dev->printer == pcl3_generic_new || dev->printer == pcl3_generic_old)
- fprintf(stderr, "%s" ERRPREF
- "The '%s' device does not support duplex printing unless\n"
- "%s 'DuplexCapability' is not 'none'.\n",
- epref, find_subdevice_name(dev->printer), epref);
- else
- fprintf(stderr, "%s" ERRPREF
- "The %s does not support duplex printing.\n",
- epref, dev->eprn.cap->name);
- last_error = gs_error_rangecheck;
- param_signal_error(plist, pname, last_error);
- }
- /* NO check of rc because "null" is legal. */
- }
-
- /* Manual feed */
- {
- bool temp;
- if ((rc = param_read_bool(plist, (pname = "ManualFeed"), &temp)) == 0)
- dev->file_data.manual_feed = temp;
- else if (rc < 0) last_error = rc;
- }
-
- /* PCL media type */
- if ((rc = param_read_string(plist, (pname = "Medium"), &string_value)) == 0) {
- /* We accept numerical and string values. Numerical values at present
- officially defined are 0-6, but not all printers know all these values.
- We give the user the benefit of the doubt, though, because the
- value is simply passed through to the printer, except for the older
- DeskJets where we map illegal values to "plain paper".
- If the user specifies a string, however, it must be a known one.
- */
- rc = get_int_for_string(&string_value, media_type_list, &temp);
- if (rc != 0) {
- if (rc != gs_error_VMerror) {
- fprintf(stderr, "%s" ERRPREF "Unknown medium: `", epref);
- fwrite(string_value.data, sizeof(char), string_value.size, stderr);
- fputs("'.\n", stderr);
- }
- last_error = rc;
- param_signal_error(plist, pname, last_error);
- }
- else {
- new_quality = true;
- if (temp < 0 || 6 < temp)
- fprintf(stderr, "%s" WARNPREF "Unknown media type code: %d.\n",
- wpref, temp);
- pcl3_set_mediatype(data, temp);
- }
- }
- else if (rc < 0) last_error = rc;
-
- /* Media destination */
- if ((rc = param_read_int(plist, (pname = "%MediaDestination"),
- &data->media_destination)) < 0) last_error = rc;
-
- /* Media source */
- if ((rc = param_read_int(plist, (pname = "%MediaSource"),
- &data->media_source)) < 0) last_error = rc;
- else if (rc == 0 && dev->is_open) gs_closedevice(device);
- /* In pcl3, %MediaSource is relevant for banner printing and hence page
- layout which is determined in the open routine. */
-
- /* Use of Configure Raster Data */
- if (is_generic_device(dev) || pcl_has_CRD(data->level)) {
- bool temp;
-
- if ((rc = param_read_bool(plist, (pname = "OnlyCRD"), &temp)) == 0) {
- if (pcl_has_CRD(data->level))
- data->level = (temp? pcl_level_3plus_CRD_only: pcl_level_3plus_S68);
- else if (temp == true) {
- fprintf(stderr, "%s" ERRPREF
- "OnlyCRD may be set only for group-3 devices.\n", epref);
- last_error = gs_error_rangecheck;
- param_signal_error(plist, pname, last_error);
- }
- }
- else if (rc < 0) last_error = rc;
- }
-
- /* PCL initialization string 1 */
- rc = fetch_octets(epref, plist, "PCLInit1", &data->init1);
- if (rc < 0) last_error = rc;
-
- /* PCL initialization string 2 */
- rc = fetch_octets(epref, plist, "PCLInit2", &data->init2);
- if (rc < 0) last_error = rc;
-
- /* PJL job name */
- rc = fetch_cstring(epref, plist, "PJLJob", &data->PJL_job);
- if (rc < 0) last_error = rc;
-
- /* PJL language */
- rc = fetch_cstring(epref, plist, "PJLLanguage", &data->PJL_language);
- if (rc < 0) last_error = rc;
-
- /* Print Quality */
- if ((rc = param_read_string(plist, (pname = "PrintQuality"), &string_value))
- == 0) {
- /* The only known values are -1, 0 and 1. Again, however, we assume the
- user knows what s/he is doing if another value is given. */
- rc = get_int_for_string(&string_value, print_quality_list, &temp);
- if (rc != 0) {
- if (rc != gs_error_VMerror) {
- fprintf(stderr, "%s" ERRPREF "Unknown print quality: `", epref);
- fwrite(string_value.data, sizeof(char), string_value.size, stderr);
- fputs("'.\n", stderr);
- }
- last_error = rc;
- param_signal_error(plist, pname, last_error);
- }
- else {
- new_quality = true;
- if (temp < -1 || 1 < temp)
- fprintf(stderr, "%s" WARNPREF "Unknown print quality: %d.\n",
- wpref, temp);
- pcl3_set_printquality(data, temp);
- }
- }
- else if (rc < 0) last_error = rc;
-
- /* Raster Graphics Quality */
- if ((rc = param_read_null(plist, (pname = "RasterGraphicsQuality"))) == 0)
- ; /* ignore */
- else if (rc < 0 &&
- (rc = param_read_int(plist, (pname = "RasterGraphicsQuality"), &temp))
- == 0) {
- if (0 <= temp && temp <= 2) requested.quality = temp;
- else {
- fprintf(stderr,
- "%s" ERRPREF "Invalid value for raster graphics quality: %d.\n",
- epref, temp);
- last_error = gs_error_rangecheck;
- param_signal_error(plist, pname, last_error);
- }
- }
- else if (rc < 0) last_error = rc;
-
- /* Colorant order */
- {
- bool temp;
- if ((rc = param_read_bool(plist, (pname = "SendBlackLast"), &temp)) == 0)
- data->order_CMYK = temp;
- else if (rc < 0 ) last_error = rc;
- }
-
- /* Sending of NULs */
- if ((rc = param_read_int(plist, (pname = "SendNULs"), &temp)) == 0) {
- if (data->NULs_to_send >= 0) data->NULs_to_send = temp;
- else {
- fprintf(stderr,
- "%s" ERRPREF "Invalid value for SendNULs parameter: %d.\n",
- epref, temp);
- last_error = gs_error_rangecheck;
- param_signal_error(plist, pname, last_error);
- }
- }
- else if (rc < 0 ) last_error = rc;
-
- /* Shingling */
- if ((rc = param_read_null(plist, (pname = "Shingling"))) == 0)
- ; /* ignore */
- else if (rc < 0 &&
- (rc = param_read_int(plist, pname, &temp)) == 0) {
- if (0 <= temp && temp <= 2) requested.shingling = temp;
- else {
- fprintf(stderr, "%s" ERRPREF "Invalid value for shingling: %d.\n",
- epref, temp);
- last_error = gs_error_rangecheck;
- param_signal_error(plist, pname, last_error);
- }
- }
- else if (rc < 0) last_error = rc;
-
- /* Tumble */
- if (is_generic_device(dev))
- if ((rc = param_read_bool(plist, (pname = "Tumble"), &dev->tumble)) < 0)
- last_error = rc;
-
- /* UseCard */
- {
- bool temp;
-
- if ((rc = param_read_null(plist, (pname = "UseCard"))) == 0)
- dev->use_card = bn_null;
- else if (rc < 0 &&
- (rc = param_read_bool(plist, pname, &temp)) == 0)
- dev->use_card = (temp? bn_true: bn_false);
- else if (rc < 0 ) last_error = rc;
- }
-
- /* Process parameters defined by base classes (should occur after treating
- parameters defined for the derived class, see gsparam.h) */
- if ((rc = eprn_put_params(device, plist)) < 0 ||
- rc > 0 && last_error >= 0) last_error = rc;
-
- /* Act if the colour model was changed */
- if (previous_colour_model != dev->eprn.colour_model) set_palette(dev);
-
- if (last_error < 0) return_error(last_error);
-
- /* If we have seen new quality parameters, derive the old ones from them
- based on the current and possibly new value of the palette. */
- if (new_quality) pcl3_set_oldquality(data);
-
- /* If we have seen old quality parameters, store them */
- if (pcl_use_oldquality(data->level)) {
- if (requested.depletion >= 0) data->depletion = requested.depletion;
- if (requested.quality >= 0)
- data->raster_graphics_quality = requested.quality;
- if (requested.shingling >= 0) data->shingling = requested.shingling;
- }
-
- return 0;
-}
-
-/******************************************************************************
-
- Function: pcl3_open_device
-
-******************************************************************************/
-
-static int pcl3_open_device(gx_device *device)
-{
- pcl3_Device *dev = (pcl3_Device *)device;
- const char
- *epref = dev->eprn.CUPS_messages? CUPS_ERRPREF: "",
- *wpref = dev->eprn.CUPS_messages? CUPS_WARNPREF: "";
- int rc;
-
- /* Constructor */
- if (!dev->initialized) init(dev);
-
-#ifdef PCL3_MEDIA_FILE
- /* Change default media descriptions for 'unspec' */
- if (dev->eprn.media_file == NULL && dev->printer == pcl3_generic_new) {
- if ((rc = eprn_set_media_data(device, PCL3_MEDIA_FILE, 0)) != 0)
- return rc;
- }
-#endif
-
- /* Check on rendering parameters */
- if ((dev->eprn.black_levels > 2 || dev->eprn.non_black_levels > 2) &&
- dev->file_data.print_quality == -1)
- fprintf(stderr,
- "%s" WARNPREF "More than 2 intensity levels and draft quality\n"
- "%s are unlikely to work in combination.\n", wpref, wpref);
-
- /* Ensure correct media request flags */
- eprn_set_media_flags((eprn_Device *)dev,
- (dev->file_data.media_source == -1? MS_BIG_FLAG: ms_none) |
- (dev->use_card == bn_true? PCL_CARD_FLAG: ms_none),
- (dev->use_card == bn_null? card_is_optional: NULL));
-
- dev->eprn.soft_tumble = false;
-
- /* Open the "eprn" device part */
- if ((rc = eprn_open_device(device)) != 0) return rc;
-
- /* Fill the still unassigned parts of 'file_data' from the other data */
- {
- pcl_FileData *data = &dev->file_data;
- unsigned int j;
-
- /* Media handling */
- data->size = pcl3_page_size(dev->eprn.code);
- if (data->size == pcl_ps_default) {
- /* This is due to a media description using a media size code for which
- there is no PCL Page Size code. This is either an error in a builtin
- description or the user specified it in a media configuration file.
- Note that there might be a "Card" flag, hence we should not talk
- about "size" only.
- */
- char buffer[50];
-
- fprintf(stderr, "%s" ERRPREF
- "The current configuration for this driver has identified the\n"
- "%s page setup requested by the document as being for `",
- epref, epref);
- if (ms_find_name_from_code(buffer, sizeof(buffer),
- dev->eprn.code, flag_description) == 0) fputs(buffer, stderr);
- else fputs("UNKNOWN", stderr); /* should never happen */
- fprintf(stderr, "' (%.0f x %.0f bp).\n"
- "%s The driver does not know how to do this in PCL.\n",
- dev->MediaSize[0], dev->MediaSize[1], epref);
- if (dev->eprn.media_file != NULL)
- fprintf(stderr,
- "%s You should therefore not include such an entry in the\n"
- "%s media configuration file.\n", epref, epref);
- return_error(gs_error_rangecheck);
- }
- data->duplex = -1;
- if (dev->Duplex_set > 0) { /* Duplex is not null */
- if (dev->Duplex) {
- bool same_leading_edge;
-
- /* Find direction of default user space y axis in device space */
- int orient = dev->eprn.default_orientation;
- if (dev->MediaSize[1] < dev->MediaSize[0]) /* landscape */
- orient++; /* rotate +90 degrees */
-
- same_leading_edge = (orient % 2 == 0 /* y axis is vertical */) !=
- (dev->tumble != false);
- /* If there were a native 'bool' type in C, the last parenthesis
- could be reliably replaced by "dev->tumble". This is safer and
- just as fast, provided the compiler is sufficiently intelligent. */
-
- dev->eprn.soft_tumble = dev->duplex_capability != Duplex_both &&
- (same_leading_edge &&
- dev->duplex_capability != Duplex_sameLeadingEdge ||
- !same_leading_edge &&
- dev->duplex_capability != Duplex_oppositeLeadingEdge);
- if (dev->eprn.soft_tumble) same_leading_edge = !same_leading_edge;
-
- /* I am assuming here that the values 1 and 2, specified by HP in
- BPL02705 as meaning "Long-Edge Binding" and "Short-Edge Binding",
- respectively, in fact mean what I've called the "same leading edge"
- and "opposite leading edge" settings for the second pass. */
- if (same_leading_edge) data->duplex = 1;
- else data->duplex = 2;
- }
- else data->duplex = 0; /* simplex */
- }
-
- /* It is almost not necessary to set the palette here because the default
- settings of eprn and pcl3 agree and all other calls are routed through
- the put_params routines. But there is a special case: I want to use
- 'pcl_no_palette' if the printer cannot switch palettes. */
- set_palette(dev);
-
- /* Per-colorant information */
- for (j = 0; j < data->number_of_colorants; j++) {
- data->colorant_array[j].hres = dev->HWResolution[0] + 0.5;
- data->colorant_array[j].vres = dev->HWResolution[1] + 0.5;
- }
- if (data->palette == pcl_CMY || data->palette == pcl_RGB)
- for (j = 0; j < 3; j++)
- data->colorant_array[j].levels = dev->eprn.non_black_levels;
- else {
- data->colorant_array[0].levels = dev->eprn.black_levels;
- for (j = 1; j < data->number_of_colorants; j++)
- data->colorant_array[j].levels = dev->eprn.non_black_levels;
- }
- }
-
- return rc;
-}
-
-/******************************************************************************
-
- Function: pcl3_close_device
-
-******************************************************************************/
-
-static int pcl3_close_device(gx_device *device)
-{
- pcl3_Device *dev = (pcl3_Device *)device;
-
- /* HP recommends that a driver should send the Printer Reset command at the
- end of each print job in order to leave the printer in its default state.
- This is a matter of courtesy for the next print job which could otherwise
- inherit some of the properties set for the present job unless it starts
- with a Printer Reset command itself (every job generated with this driver
- does).
-
- Unfortunately, ghostscript does not have a corresponding device procedure.
- In particular, the 'close_device' procedure may be called multiple times
- during a job and for multi-file output it is even only called at the end
- of the sequence of files and then when 'dev->file' is already NULL.
- Hence this routine tries to get close by checking the 'configured' field:
- it is set if the pcl3_init_file() function has been called and therefore
- indicates that the driver has sent configuration commands to the printer.
- That part we can and should take back.
-
- Of course one might reset the printer at the end of every page, but this
- would entail having to repeat the initialization at the beginning of
- every page. I regard this as logically inappropriate.
- */
-
- if (dev->configured && dev->file != NULL) {
- pcl3_end_file(dev->file, &dev->file_data);
- dev->configured = false;
- }
-
- return eprn_close_device(device);
-}
-
-/******************************************************************************
-
- Function: pcl3_print_page
-
- This is the implementation of prn's print_page() method for this device.
-
- It initializes the printer if necessary and prints the page.
-
-******************************************************************************/
-
-/* Macro to handle return codes from calls to pclgen routines */
-#define guard(call) \
- if ((rc = (call)) != 0) { \
- if (rc > 0) return_error(gs_error_Fatal); /* bugs are fatal :-) */ \
- return_error(gs_error_ioerror); /* actually any environment error */ \
- }
-
-static int pcl3_print_page(gx_device_printer *device, FILE *out)
-{
- int
- blank_lines,
- rc;
- pcl3_Device *dev = (pcl3_Device *)device;
- const char *epref = dev->eprn.CUPS_messages? CUPS_ERRPREF: "";
- pcl_RasterData rd;
- unsigned int
- j,
- *lengths,
- planes;
-
- /* If this is a new file or we've decided to re-configure, initialize the
- printer first */
- if (gdev_prn_file_is_new(device) || !dev->configured ||
- dev->configure_every_page) {
- guard(pcl3_init_file(out, &dev->file_data))
- dev->configured = true;
- }
-
- /* Initialize raster data structure */
- memset(&rd, 0, sizeof(pcl_RasterData));
- rd.global = &dev->file_data;
- planes = eprn_number_of_bitplanes((eprn_Device *)dev);
- lengths = (unsigned int *)malloc(planes*sizeof(unsigned int));
- rd.next = (pcl_OctetString *)malloc(planes*sizeof(pcl_OctetString));
- if (pcl_cm_is_differential(dev->file_data.compression))
- rd.previous = (pcl_OctetString *)malloc(planes*sizeof(pcl_OctetString));
- if (lengths == NULL || rd.next == NULL ||
- pcl_cm_is_differential(dev->file_data.compression) &&
- rd.previous == NULL) {
- free(lengths); free(rd.next); free(rd.previous);
- fprintf(stderr, "%s" ERRPREF "Memory allocation failure from malloc().\n",
- epref);
- return_error(gs_error_VMerror);
- }
- eprn_number_of_octets((eprn_Device *)dev, lengths);
- rd.width = 8*lengths[0]; /* all colorants have equal resolution */
- for (j = 0; j < planes; j++)
- rd.next[j].str = (pcl_Octet *)malloc(lengths[j]*sizeof(eprn_Octet));
- /* Note: 'pcl_Octet' must be identical with 'eprn_Octet'. */
- if (pcl_cm_is_differential(dev->file_data.compression))
- for (j = 0; j < planes; j++)
- rd.previous[j].str = (pcl_Octet *)malloc(lengths[j]*sizeof(eprn_Octet));
- rd.workspace_allocated = lengths[0];
- for (j = 1; j < planes; j++)
- if (lengths[j] > rd.workspace_allocated)
- rd.workspace_allocated = lengths[j];
- for (j = 0;
- j < 2 && (j != 1 || dev->file_data.compression == pcl_cm_delta); j++)
- rd.workspace[j] =
- (pcl_Octet *)malloc(rd.workspace_allocated*sizeof(pcl_Octet));
-
- /* Collective check for allocation failures */
- j = 0;
- while (j < planes && rd.next[j].str != NULL) j++;
- if (j == planes && pcl_cm_is_differential(dev->file_data.compression)) {
- j = 0;
- while (j < planes && rd.previous[j].str != NULL) j++;
- if (j == planes && dev->file_data.compression == pcl_cm_delta &&
- rd.workspace[1] == NULL) j = 0;
- }
- if (j < planes || rd.workspace[0] == NULL) {
- /* Free everything. Note that free(NULL) is legal and we did a memset()
- with 0 on 'rd'. */
- for (j = 0; j < planes; j++) {
- free(rd.next[j].str);
- if (pcl_cm_is_differential(dev->file_data.compression))
- free(rd.previous[j].str);
- }
- free(lengths); free(rd.next); free(rd.previous);
- for (j = 0; j < 2; j++) free(rd.workspace[j]);
-
- fprintf(stderr, "%s" ERRPREF "Memory allocation failure from malloc().\n",
- epref);
- return_error(gs_error_VMerror);
- }
-
- /* Open the page and start raster mode */
- guard(pcl3_begin_page(out, &dev->file_data))
- guard(pcl3_begin_raster(out, &rd))
-
- /* Loop over scan lines */
- blank_lines = 0;
- while (eprn_get_planes((eprn_Device *)dev, (eprn_OctetString *)rd.next) == 0){
- /* Is this a blank (white) line? */
- if (dev->eprn.colour_model == eprn_DeviceRGB) {
- /* White results if all three colorants use their highest intensity.
- Fortunately, PCL-3+ can only support two intensity levels for all
- colorants in an RGB palette, hence this intensity must be one for all
- colorants simultaneously.
- Because the planes returned by eprn_get_planes() are guaranteed to
- have no trailing zero octets, we can easily check that they are of
- equal length before proceeding further.
- */
- for (j = 1; j < planes && rd.next[j].length == rd.next[0].length; j++);
- if (j >= planes && rd.next[0].length == lengths[0]) {
- int k;
- /* All planes have the same length and cover the whole width of the
- page. Check that they all contain 0xFF. */
- j = 0;
- do {
- k = rd.next[j].length - 1;
- while (k > 0 && rd.next[j].str[k] == 0xFF) k--;
- } while (k == 0 && rd.next[j].str[0] == 0xFF && ++j < planes);
- }
- }
- else
- /* White is zero */
- for (j = 0; j < planes && rd.next[j].length == 0; j++);
-
- if (j == planes) blank_lines++;
- else {
- if (blank_lines > 0) {
- guard(pcl3_skip_groups(out, &rd, blank_lines))
- blank_lines = 0;
- }
- guard(pcl3_transfer_group(out, &rd))
- }
- }
-
- /* Terminate raster mode and close the page */
- guard(pcl3_end_raster(out, &rd))
- guard(pcl3_end_page(out, &dev->file_data))
-
- /* Free dynamic storage */
- for (j = 0; j < planes; j++) free(rd.next[j].str);
- if (pcl_cm_is_differential(dev->file_data.compression))
- for (j = 0; j < planes; j++) free(rd.previous[j].str);
- for (j = 0; j < 2; j++) free(rd.workspace[j]);
- free(lengths); free(rd.next); free(rd.previous);
-
- return 0;
-}
-
-#undef guard
diff --git a/gs/contrib/pcl3/src/pcl3opts-de.msg b/gs/contrib/pcl3/src/pcl3opts-de.msg
deleted file mode 100644
index 410c207f8..000000000
--- a/gs/contrib/pcl3/src/pcl3opts-de.msg
+++ /dev/null
@@ -1,42 +0,0 @@
-$ *****************************************************************************
-$ File: @(#)$Id: pcl3opts-de.msg,v 1.9 2001/05/31 15:23:28 Martin Rel $
-$ Contents: NLS message catalogue for pcl3opts in German
-$ Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-$ Germany
-$
-$ *****************************************************************************
-$ *
-$ Copyright (C) 1999, 2000, 2001 by Martin Lottermoser *
-$ All rights reserved *
-$ *
-$ *****************************************************************************
-
-$set 2
-$quote "
-1 "Aufruf: %s [<Optionen>] [<Eingabedateien>].\n <Option> ::= -o <Ausgabedatei>\n"
-2 "Die Datei `%s' ließ sich nicht zum Schreiben öffnen:\n %s.\n"
-3 "Die Eingabedatei `%s' ließ sich nicht öffnen:\n %s.\n"
-4 "Fehler beim Schließen von `%s':\n %s.\n"
-9 "Fehler bei Speicherallokation: %s.\n"
-10 "\nDer vorige Abschnitt mit Rasterdaten wird gefolgt von einem mit einer\nabweichenden Konfiguration.\n"
-11 "Ich habe einen Abschnitt von Rasterdaten gefunden, der eine Kombination von\nAuflösungen und Intensitätsstufen verwendet, die pcl3 nicht reproduzieren kann:\n"
-12 " Komponente %d: %4d x %4d ppi %2d Stufen\n"
-13 "Meine beste Vermutung für die zum Erzeugen einer ähnlichen Datei nötige\nKommandozeile ist:\n"
-14 "Diese Datei verwendet einen PCL Code für die Seitengröße (%d),\n der pcl3 unbekannt ist.\n"
-15 "Die Seitengröße ist %s"
-16 "mm"
-17 "Das ausgewählte Medienziel (Ausgabefach) ist %d.\n"
-18 "Um eine Medienposition (Ein- oder Ausgabe) auswählen zu können, müssen Sie die\nVerzeichnisse `InputAttributes' oder `OutputAttributes' entsprechend\nkonfigurieren. Schlagen Sie dazu in der Handbuchseite gs-pcl3(1) nach.\n"
-19 "Die ausgewählte Medienquelle (Eingabefach) ist %d.\n"
-20 "Ungültige Feldlänge im Kommando Configure Raster Data.\n"
-30 "Diese Datei verwendet mindestens eine Kompressionsmethode für\n Rasterdaten (%d), die pcl3 nicht bekannt ist.\n"
-31 "Diese Datei enthält ein Configure Raster Data Kommando mit einer\n ungültigen Anzahl von Farbkomponenten (%d) und den folgenden Daten:\n"
-32 "Diese Datei enthält ein Configure Raster Data Kommando mit einem\n unbekannten Format (%d).\n"
-33 " Es *könnte* das folgende bedeuten:\n"
-34 " Dieses Format wird von pcl3 nicht unterstützt.\n"
-$ Message 40 should not be used.
-41 "Diese Datei verwendet eine Farbpalette (%d), die pcl3 nicht unterstützt.\n"
-50 "Dies scheint keine Datei mit PCL-Rasterdaten zu sein.\n"
-60 "Ich habe einen unbekannten Wert für das Kommando zur Auswahl von\nSimplex/Duplex-Druck gefunden: %d.\n"
-70 "Obwohl das Farbmodell in dieser Datei als CMYK deklariert ist, wird keine\nschwarze Farbe verwendet. Sollten Sie feststellen, dass der Drucker eine mit\nder obigen Kommandozeile generierte Datei nicht akzeptiert, versuchen Sie es\nstattdessen mit dem Farbmodell CMY.\n\n"
-$ Message number 80 is in use.
diff --git a/gs/contrib/pcl3/src/pcl3opts-en.msg b/gs/contrib/pcl3/src/pcl3opts-en.msg
deleted file mode 100644
index eac347673..000000000
--- a/gs/contrib/pcl3/src/pcl3opts-en.msg
+++ /dev/null
@@ -1,42 +0,0 @@
-$ *****************************************************************************
-$ File: @(#)$Id: pcl3opts-en.msg,v 1.9 2001/05/31 15:23:28 Martin Rel $
-$ Contents: NLS message catalogue for pcl3opts in English
-$ Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
-$ Germany
-$
-$ *****************************************************************************
-$ *
-$ Copyright (C) 1999, 2000, 2001 by Martin Lottermoser *
-$ All rights reserved *
-$ *
-$ *****************************************************************************
-
-$set 2
-$quote "
-1 "Usage: %s [<options>] [<input files>].\n <option> ::= -o <output file>\n"
-2 "The file `%s' could not be opened for writing:\n %s.\n"
-3 "Could not open the input file `%s':\n %s.\n"
-4 "Error closing `%s':\n %s.\n"
-9 "Memory allocation failure: %s.\n"
-10 "\nThe previous raster data section is followed by one with a different\nconfiguration.\n"
-11 "I've found a raster data section which uses a combination of resolutions\nand intensity levels which pcl3 cannot reproduce:\n"
-12 " colorant %d: %4d x %4d ppi %2d levels\n"
-13 "My best guess for the command line needed to generate a similar file is:\n"
-14 "This file uses a PCL page size code (%d) which is unknown to pcl3.\n"
-15 "The page size is set to %s"
-16 "in"
-17 "The media destination (output tray) selected is %d.\n"
-18 "To be able to select a media position (input or output) you will have to\nconfigure the `InputAttributes' or `OutputAttributes' dictionaries\nappropriately. See the manual page gs-pcl3(1).\n"
-19 "The media source (input tray) selected is %d.\n"
-20 "Illegal field length in Configure Raster Data command.\n"
-30 "This file uses at least one compression method for raster data (%d)\nwhich pcl3 does not know.\n"
-31 "This file contains a Configure Raster Data command with an\n illegal number of colorants (%d) and the following data:\n"
-32 "This file contains a Configure Raster Data command with an\n unknown format (%d).\n"
-33 " It *might* mean the following:\n"
-34 " This format is not supported by pcl3.\n"
-$ Message 40 should not be used.
-41 "This file uses a palette (%d) not supported by pcl3.\n"
-50 "This does not seem to be a PCL file containing raster data.\n"
-60 "I've found an unknown value for the command to select\nsimplex/duplex printing: %d.\n"
-70 "Although the colour model in this file is declared as CMYK, the file does not\nuse the black colorant. If you find that the printer does not accept a file\ngenerated with the command line above, try the CMY colour model instead.\n\n"
-$ Message number 80 is in use.
diff --git a/gs/contrib/pcl3/src/pcl3opts.c b/gs/contrib/pcl3/src/pcl3opts.c
deleted file mode 100644
index 394e232e1..000000000
--- a/gs/contrib/pcl3/src/pcl3opts.c
+++ /dev/null
@@ -1,1176 +0,0 @@
-/******************************************************************************
- File: $Id: pcl3opts.c,v 1.17 2001/05/31 15:19:16 Martin Rel $
- Contents: Program to convert information in PCL-3+ files into options to be
- used for the ghostscript device "pcl3" in order to produce a
- file using a similar configuration
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany; e-mail: Martin.Lottermoser@t-online.de.
-
-*******************************************************************************
-* *
-* Copyright (C) 1999, 2000, 2001 by Martin Lottermoser *
-* All rights reserved *
-* *
-******************************************************************************/
-
-/* Configuration management identification */
-#ifndef lint
-static char
- cm_id[] = "@(#)$Id: pcl3opts.c,v 1.17 2001/05/31 15:19:16 Martin Rel $";
-#endif
-
-/*****************************************************************************/
-
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE 500
-#endif
-
-/* Standard headers */
-#include <assert.h>
-#include <errno.h>
-#include <locale.h>
-#include <nl_types.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-/* Application headers */
-#include "pclsize.h"
-#include "pclgen.h"
-#include "pclscan.h"
-
-/*****************************************************************************/
-
-#define check(p) \
- if ((p) == NULL) { \
- emessage(9, "Memory allocation failure: %s.\n", strerror(errno)); \
- return -1; \
- }
-
-/*****************************************************************************/
-
-/* Global variables */
-
-static const char *progname; /* The program's name in messages */
-static nl_catd catd = (nl_catd)(-1); /* NLS message catalogue descriptor */
-
-/*****************************************************************************/
-
-static void message(FILE *f, int msg_id, const char *fmt, va_list ap)
-{
- vfprintf(f, catd == (nl_catd)(-1)? fmt: catgets(catd, 2, msg_id, fmt), ap);
-
- return;
-}
-
-/*****************************************************************************/
-
-static void emessage(int msg_id, const char *fmt, ...)
-{
- va_list ap;
-
- fprintf(stderr, "? %s: ", progname);
- va_start(ap, fmt);
- message(stderr, msg_id, fmt, ap);
- va_end(ap);
-
- return;
-}
-
-/*****************************************************************************/
-
-static void imessage(FILE *f, int msg_id, const char *fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
- message(f, msg_id, fmt, ap);
- va_end(ap);
-
- return;
-}
-
-/*****************************************************************************/
-
-static void check_line_length(FILE *out, int *line_length, int expected)
-{
- if (*line_length + expected <= 78) return;
-
- fputs(" \\\n", out);
- fputs(" ", out);
- *line_length = 4;
-
- return;
-}
-
-/*****************************************************************************/
-
-/* Type for state and information collected during parsing a file */
-typedef struct {
- FILE *out;
-
- /* Capability */
- pcl_bool
- seen_ERG_B, /* End Raster Graphics */
- seen_ERG_C,
- seen_RGR, /* Raster Graphics Resolution */
- seen_CRD, /* Configure Raster Data */
- seen_old_quality,
- seen_new_quality,
- seen_unknown_compression;
-
- /* State */
- int
- first_colorant_planes,
- next_plane,
- number_of_outputs;
- pcl_FileData
- fdata,
- fdata_old;
- pcl_bool
- CRD_active,
- seen_first_colorant,
- seen_raster_data;
-} CollectedInfo;
-
-/*****************************************************************************/
-
-static void print_result(CollectedInfo *ip) /* NLS: 10, 70 */
-{
- pcl_bool
- different_resolutions = FALSE,
- different_non_black_levels = FALSE;
- pcl_Compression
- default_compression;
- int j;
- int ll; /* line length */
- unsigned int min_hres, min_vres, black_levels, non_black_levels, start;
-
- if (ip->number_of_outputs > 0)
- imessage(ip->out, 10,
- "\nThe previous raster data section is followed by one with a different\n"
- "configuration.\n");
- ip->number_of_outputs++;
-
- /* Find the smallest resolutions and look for different resolutions */
- min_hres = ip->fdata.colorant_array[0].hres;
- min_vres = ip->fdata.colorant_array[0].vres;
- for (j = 1; j < ip->fdata.number_of_colorants; j++) {
- int
- h = ip->fdata.colorant_array[j].hres,
- v = ip->fdata.colorant_array[j].vres;
- if (h != min_hres || v != min_vres) different_resolutions = TRUE;
- if (h < min_hres) min_hres = h;
- if (v < min_vres) min_vres = v;
- }
-
- black_levels = ip->fdata.colorant_array[0].levels;
-
- /* Check for deviations in the non-black levels */
- start = (ip->fdata.palette == pcl_CMY || ip->fdata.palette == pcl_RGB? 0: 1);
- non_black_levels = ip->fdata.colorant_array[start].levels;
- for (j = 1; j < 3; j++)
- if (ip->fdata.colorant_array[start + j].levels != non_black_levels)
- different_non_black_levels = TRUE;
-
- if (different_resolutions || different_non_black_levels) {
- imessage(ip->out, 11,
- "I've found a raster data section which uses a combination of "
- "resolutions\n"
- "and intensity levels which pcl3 cannot reproduce:\n");
- for (j = 0; j < ip->fdata.number_of_colorants; j++)
- imessage(ip->out, 12, " colorant %d: %4d x %4d ppi %2d levels\n",
- j + 1,
- ip->fdata.colorant_array[j].hres, ip->fdata.colorant_array[j].vres,
- ip->fdata.colorant_array[j].levels);
- if (ip->fdata.palette == pcl_CMYK &&
- non_black_levels > 2 && black_levels < 4)
- black_levels = 4;
- }
-
- imessage(ip->out, 13,
- "My best guess for the command line needed to generate a similar file "
- "is:\n");
-
- /* Device selection */
- ll = -1;
- ll += fprintf(ip->out, "\n gs -sDEVICE=pcl3 -sSubdevice=");
- default_compression = pcl_cm_tiff;
- if (ip->seen_CRD || ip->seen_new_quality)
- ll += fprintf(ip->out, "unspec");
- else if (ip->seen_ERG_B && !ip->seen_ERG_C && ip->fdata.shingling == -1 &&
- (ip->fdata.palette == pcl_no_palette || ip->fdata.palette == pcl_black)) {
- /* This command line can still fail because of, e.g., resolution. */
- ll += fprintf(ip->out, "hpdj500");
- default_compression = pcl_cm_delta;
- }
- else
- ll += fprintf(ip->out, "unspecold");
-
- /* Special global language features */
- if (ip->fdata.NULs_to_send > 0) {
- check_line_length(ip->out, &ll, sizeof("-dSendNULs=9600"));
- /* Note the missing SP which is instead accounted for by NUL. */
- ll += fprintf(ip->out, " -dSendNULs=%d", ip->fdata.NULs_to_send);
- }
- if (ip->fdata.PJL_job != NULL) {
- check_line_length(ip->out, &ll,
- sizeof("-sPJLJob=") + strlen(ip->fdata.PJL_job));
- ll += fprintf(ip->out, " -sPJLJob=%s", ip->fdata.PJL_job);
- }
- if (ip->fdata.PJL_language != NULL) {
- check_line_length(ip->out, &ll,
- sizeof("-sPJLLanguage=") + strlen(ip->fdata.PJL_language));
- ll += fprintf(ip->out, " -sPJLLanguage=%s", ip->fdata.PJL_language);
- }
- if (ip->seen_CRD && !ip->seen_RGR) {
- check_line_length(ip->out, &ll, sizeof("-dOnlyCRD"));
- ll += fprintf(ip->out, " -dOnlyCRD");
- }
-
- /* Media handling except media source */
- if (ip->fdata.manual_feed) {
- check_line_length(ip->out, &ll, sizeof("-dManualFeed"));
- ll += fprintf(ip->out, " -dManualFeed");
- }
- if (ip->fdata.duplex > 0) {
- const char s[] = " -dDuplex";
-
- if (ip->fdata.duplex == 1) {
- const char s[] = " -sDuplexCapability=sameLeadingEdge";
- check_line_length(ip->out, &ll, sizeof(s) - 1);
- ll += fprintf(ip->out, s);
- }
- else if (ip->fdata.duplex == 2) {
- const char s[] = " -sDuplexCapability=oppositeLeadingEdge";
- check_line_length(ip->out, &ll, sizeof(s) - 1);
- ll += fprintf(ip->out, s);
- }
- check_line_length(ip->out, &ll, sizeof(s) - 1);
- ll += fprintf(ip->out, s);
- }
- if (ip->fdata.dry_time >= 0) {
- check_line_length(ip->out, &ll, sizeof("-dDryTime=") + 4);
- ll += fprintf(ip->out, " -dDryTime=%d", ip->fdata.dry_time);
- }
-
- /* Resolution */
- if (min_hres != 0) {
- check_line_length(ip->out, &ll, 12);
- ll += fprintf(ip->out, " -r%u", min_hres);
- if (min_vres != min_hres) ll += fprintf(ip->out, "x%u", min_vres);
- }
-
- /* Colour model */
- if (ip->fdata.palette != pcl_no_palette) {
- check_line_length(ip->out, &ll, sizeof("-sColourModel=CMY+K"));
- ll += fprintf(ip->out, " -sColourModel=");
- switch (ip->fdata.palette) {
- case pcl_black:
- ll += fprintf(ip->out, "Gray"); break;
- case pcl_RGB:
- ll += fprintf(ip->out, "RGB"); break;
- case pcl_CMY:
- ll += fprintf(ip->out, "CMY"); break;
- case pcl_CMYK:
- if (ip->seen_new_quality || ip->seen_CRD) /* Guess */
- ll += fprintf(ip->out, "CMYK");
- else
- ll += fprintf(ip->out, "CMY+K");
- break;
- default:
- assert(0); /* bug guard */
- }
- }
-
- /* Intensity levels */
- if (ip->fdata.palette == pcl_CMY) {
- if (non_black_levels > 2) {
- check_line_length(ip->out, &ll, sizeof("-dCMYLevels=") + 2);
- ll += fprintf(ip->out, " -dCMYLevels=%d", non_black_levels);
- }
- }
- else {
- if (black_levels > 2) {
- check_line_length(ip->out, &ll, sizeof("-dBlackLevels=") + 2);
- ll += fprintf(ip->out, " -dBlackLevels=%d", black_levels);
- }
- if (ip->fdata.palette == pcl_CMYK && non_black_levels > 2) {
- check_line_length(ip->out, &ll, sizeof("-dCMYLevels=") + 2);
- ll += fprintf(ip->out, " -dCMYLevels=%d", non_black_levels);
- }
- }
-
- /* Print quality, possibly also medium */
- if (ip->seen_new_quality) {
- check_line_length(ip->out, &ll, sizeof("-sPrintQuality=presentation"));
- ll += fprintf(ip->out, " -sPrintQuality=");
- switch (ip->fdata.print_quality) {
- case -1:
- ll += fprintf(ip->out, "draft"); break;
- case 0:
- ll += fprintf(ip->out, "normal"); break;
- case 1:
- ll += fprintf(ip->out, "presentation"); break;
- default:
- ll += fprintf(ip->out, "%d", ip->fdata.print_quality);
- }
-
- check_line_length(ip->out, &ll,
- sizeof("-sMedium='quick dry transparency'"));
- ll += fprintf(ip->out, " -sMedium=");
- switch (ip->fdata.media_type) {
- case 0:
- ll += fprintf(ip->out, "plain"); break;
- case 1:
- ll += fprintf(ip->out, "bond"); break;
- case 2:
- ll += fprintf(ip->out, "Premium"); break;
- case 3:
- ll += fprintf(ip->out, "glossy"); break;
- case 4:
- ll += fprintf(ip->out, "transparency"); break;
- case 5:
- ll += fprintf(ip->out, "'quick dry glossy'"); break;
- case 6:
- ll += fprintf(ip->out, "'quick dry transparency'"); break;
- default:
- ll += fprintf(ip->out, "%d", ip->fdata.media_type);
- }
- }
- else if (ip->seen_old_quality) {
- if (ip->fdata.depletion != 0) {
- check_line_length(ip->out, &ll, sizeof("-dDepletion=") + 2);
- ll += fprintf(ip->out, " -dDepletion=%d", ip->fdata.depletion);
- }
- if (ip->fdata.shingling != -1) {
- check_line_length(ip->out, &ll, sizeof("-dShingling=") + 2);
- ll += fprintf(ip->out, " -dShingling=%d", ip->fdata.shingling);
- }
- if (ip->fdata.raster_graphics_quality != -1) {
- check_line_length(ip->out, &ll,
- sizeof("-dRasterGraphicsQuality=") + 2);
- ll += fprintf(ip->out, " -dRasterGraphicsQuality=%d",
- ip->fdata.raster_graphics_quality);
- }
- }
-
- /* Compression. We display this option only if the value is different from
- what pcl3 would otherwise use. */
- if (ip->fdata.compression != default_compression) {
- check_line_length(ip->out, &ll, sizeof("-dCompressionMethod=") + 1);
- ll += fprintf(ip->out, " -dCompressionMethod=%d", ip->fdata.compression);
- }
-
- fputs("\n\n", ip->out);
- if (ip->fdata.palette == pcl_CMYK && !ip->seen_first_colorant) {
- imessage(ip->out, 70,
- "Although the colour model in this file is declared as CMYK, "
- "the file does not\n"
- "use the black colorant. If you find that the printer does not accept "
- "a file\n"
- "generated with the command line above, "
- "try the CMY colour model instead.\n\n");
- }
-
- if (ip->fdata.size != 0) {
- ms_MediaCode media_code = pcl3_media_code(ip->fdata.size);
- const ms_SizeDescription *size = ms_find_size_from_code(media_code);
- if (size == NULL)
- imessage(ip->out, 14,
- "This file uses a PCL page size code (%d) which is unknown to pcl3.\n",
- (int)ip->fdata.size);
- else {
- imessage(ip->out, 15, "The page size is set to %s", size->name);
- /* I'm using the size specification as an indication of the PCL Page Size
- code used, hence I'm adding the card flag if present. Note that
- adding "Big" is not useful. */
- if (media_code & PCL_CARD_FLAG) fputs(PCL_CARD_STRING, ip->out);
- if (size->dimen[0] > 0) {
- const char *unit = catgets(catd, 2, 16, "mm");
-
- fputs(" (", ip->out);
- if (strcmp(unit, "bp") == 0)
- fprintf(ip->out, "%.0f x %.0f bp", size->dimen[0],
- size->dimen[1]);
- else if (strcmp(unit, "in") == 0)
- fprintf(ip->out, "%.1f x %.1f in", size->dimen[0]/BP_PER_IN,
- size->dimen[1]/BP_PER_IN);
- else
- fprintf(ip->out, "%.0f x %.0f mm", size->dimen[0]/BP_PER_MM,
- size->dimen[1]/BP_PER_MM);
- fputc(')', ip->out);
- }
- fputs(".\n", ip->out);
- }
- }
- if (ip->fdata.media_source != 0 && ip->fdata.media_source != 1)
- imessage(ip->out, 19, "The media source (input tray) selected is %d.\n",
- ip->fdata.media_source);
- if (ip->fdata.media_destination != 0)
- imessage(ip->out, 17,
- "The media destination (output tray) selected is %d.\n",
- ip->fdata.media_destination);
- if (ip->fdata.media_source != 0 && ip->fdata.media_source != 1 ||
- ip->fdata.media_destination != 0)
- imessage(ip->out, 18,
- "To be able to select a media position (input or output) you will have "
- "to\n"
- "configure the `InputAttributes' or `OutputAttributes' dictionaries\n"
- "appropriately. See the manual page gs-pcl3(1).\n");
-
- return;
-}
-
-/*****************************************************************************/
-
-static int action_PageSize(FILE *in, const pcl_Command *cmd, void *i)
-{
- CollectedInfo *ip = i;
-
- ip->fdata.size = cmd->i;
-
- return 0;
-}
-
-/*****************************************************************************/
-
-static int action_dry_time(FILE *in, const pcl_Command *cmd, void *i)
-{
- CollectedInfo *ip = i;
-
- ip->fdata.dry_time = cmd->i;
-
- return 0;
-}
-
-/*****************************************************************************/
-
-static int action_destination(FILE *in, const pcl_Command *cmd, void *i)
-{
- CollectedInfo *ip = i;
-
- ip->fdata.media_destination = cmd->i;
-
- return 0;
-}
-
-/*****************************************************************************/
-
-static int action_source(FILE *in, const pcl_Command *cmd, void *i)
-{
- CollectedInfo *ip = i;
-
- if (cmd->i != 0 && cmd->i != -2) {
- if (cmd->i == 2) ip->fdata.manual_feed = TRUE;
- else ip->fdata.media_source = cmd->i;
- }
-
- return 0;
-}
-
-/*****************************************************************************/
-
-static int action_media_type(FILE *in, const pcl_Command *cmd, void *i)
-{
- CollectedInfo *ip = i;
-
- ip->seen_new_quality = TRUE;
- ip->fdata.media_type = cmd->i;
-
- return 0;
-}
-
-/*****************************************************************************/
-
-static int action_duplex(FILE *in, const pcl_Command *cmd, void *i)
-{ /* NLS: 60 */
- CollectedInfo *ip = i;
-
- ip->fdata.duplex = cmd->i;
- if (ip->fdata.duplex < 0 || 2 < ip->fdata.duplex)
- imessage(ip->out, 60, "I've found an unknown value for the command to "
- "select\nsimplex/duplex printing: %d.\n", ip->fdata.duplex);
-
- return 0;
-}
-
-/*****************************************************************************/
-
-/* PJL white space. Note: no expressions with side effects permitted. */
-#define PJL_ws(c) ((c) == ' ' || (c) == '\t')
-
-/******************************************************************************
-
- Function to check "@PJL" prefix
-
- Return codes:
- 0: starts correctly, prefix has been read,
- 1: starts wrong, read characters have been pushed back,
- -1: starts wrong, read characters could not be pushed back and an error
- message has been issued.
-*/
-
-static int check_prefix(FILE *in)
-{
- static const pcl_Octet prefix[] = "@PJL";
- /* Note that the "@PJL" prefix is required to be uppercase in PJL. */
- int c, j;
-
- /* Check for prefix followed by white space or EOL */
- j = 0; /* number of matching characters read */
- while (j < 4 && (c = fgetc(in)) == prefix[j]) j++;
- if (j == 4) {
- c = fgetc(in);
- if (PJL_ws(c) || c == '\r' || c == '\n') j++;
- /* I'm assuming that we're dealing with legal PJL, i.e., the CR is followed
- by LF. It is not the responsibility of this program to discover PJL
- syntax errors. */
- }
- if (j < 5) {
- /* Keep in mind that one byte of push-back is guaranteed to work. */
- if (c != EOF) ungetc(c, in);
- while (j > 0) {
- j--;
- if (ungetc(prefix[j], in) == EOF) {
- emessage(80,
- "Error trying to push back characters while parsing PJL:\n %s.\n",
- strerror(errno));
- /* This should only happen for unprofessional PJL, i.e., without a
- terminating ENTER LANGUAGE. */
- return -1;
- }
- }
-
- return 1;
- }
-
- /* Ensure we've not read past the end of the line */
- if (c == '\n') ungetc(c, in);
-
- return 0;
-}
-
-/*****************************************************************************/
-
-#define PJL_letter(c) ('a' <= (c) && (c) <= 'z' || 'A' <= (c) && (c) <= 'Z')
-
-/*****************************************************************************/
-
-#define TILE_SIZE 200
-
-static int action_UEL(FILE *in, const pcl_Command *cmd, void *i)
-{
- CollectedInfo *ip = i;
- int c;
- pcl_Octet *buffer, *s;
- size_t allocated, used;
-
- if (cmd->i != 12345) return 1;
-
- /* As we have entered PJL, the previous personality is irrelevant. */
- if (ip->fdata.PJL_language != NULL) {
- free(ip->fdata.PJL_language); ip->fdata.PJL_language = NULL;
- }
-
- buffer = (pcl_Octet *)malloc(TILE_SIZE);
- check(buffer);
- allocated = TILE_SIZE;
-
- /* Read one PJL command at a time (necessary in order to catch ENTER) */
- do {
- c = check_prefix(in);
- if (c != 0) c = EOF;
- else {
- /* Read up to EOL or EOF */
- used = 0;
- while ((c = fgetc(in)) != EOF && c != '\n') {
- if (used >= allocated - 1) {
- allocated += TILE_SIZE;
- buffer = (pcl_Octet *)realloc(buffer, allocated);
- check(buffer);
- }
- buffer[used] = c;
- used++;
- }
- /* Remove an optional trailing CR */
- if (used > 0 && buffer[used-1] == 'r') used--;
- buffer[used] = '\0';
-
- /* Skip optional whitespace */
- s = buffer;
- while (PJL_ws(*s)) s++;
-
- if (PJL_letter(*s)) {
- pcl_Octet *t;
- int l;
-
- /* Isolate command and convert to upper case. Note that we're running
- in an internationalized environment, hence we can't use toupper(). */
- t = s;
- do {
- if ('a' <= *t && *t <= 'z') *t -= 'a' - 'A';
- t++;
- } while (*t != '\0' && !PJL_ws(*t));
-
- /* Identify command */
- l = t - s;
-#if 0
- fprintf(stderr, "Command (length %d): `", l);
- fwrite(s, 1, l, stderr);
- fprintf(stderr, "'.\n");
-#endif
- if (l == sizeof("ENTER") - 1 && strncmp(s, "ENTER", l) == 0 &&
- PJL_ws(*t)) {
- /* Check for "LANGUAGE" */
- s = t + 1;
- while (PJL_ws(*s)) s++;
- t = s;
- while (*t != '\0' && !PJL_ws(*t) && *t != '=') {
- if ('a' <= *t && *t <= 'z') *t -= 'a' - 'A';
- t++;
- }
- l = t - s;
- if (l == sizeof("LANGUAGE") - 1 && strncmp(s, "LANGUAGE", t - s) == 0
- && (PJL_ws(*t) || *t == '=')) {
- s = strchr(t, '='); /* again assuming legal PJL */
- if (s != NULL) {
- s++;
- while (PJL_ws(*s)) s++;
- if (PJL_letter(*s)){
- t = s + 1;
- while (*t != '\0' && !PJL_ws(*t)) t++;
- ip->fdata.PJL_language = (char *)malloc(t - s + 1);
- check(ip->fdata.PJL_language);
- strncpy(ip->fdata.PJL_language, s, t - s);
- ip->fdata.PJL_language[t - s] = '\0';
- }
- }
- c = EOF; /* exit PJL and this loop */
- }
- }
- else if (l == 3 && strncmp(s, "JOB", 3) == 0) {
- /* Don't bother to identify the job name; let the user create an
- unnamed job. */
- static char jobname[] = "";
- ip->fdata.PJL_job = jobname;
- }
- }
- }
- }
- while (c != EOF);
-
- free(buffer);
-
- return 0;
-}
-
-/*****************************************************************************/
-
- /* NLS: 20 */
-static int action_compression(FILE *in, const pcl_Command *cmd, void *i)
-{
- CollectedInfo *ip = i;
-
- if (cmd->i != pcl_cm_none && cmd->i != pcl_cm_rl && cmd->i != pcl_cm_tiff &&
- cmd->i != pcl_cm_delta && cmd->i != pcl_cm_crdr) {
- if (!ip->seen_unknown_compression)
- imessage(ip->out, 20,
- "This file uses at least one compression method for raster data (%d)\n"
- "which pcl3 does not know.\n", cmd->i);
- ip->seen_unknown_compression = TRUE;
- }
- else {
- if (cmd->i > ip->fdata.compression) ip->fdata.compression = cmd->i;
- }
-
- return 0;
-}
-
-/*****************************************************************************/
-
-/* The following function is only called for "*bV" and "*bW". */
-
-static int action_raster_data(FILE *in, const pcl_Command *cmd, void *i)
-{
- CollectedInfo *ip = i;
- int j;
-
- ip->seen_raster_data = TRUE;
- if (!ip->seen_first_colorant && cmd->i > 0 &&
- ip->next_plane < ip->first_colorant_planes)
- ip->seen_first_colorant = TRUE;
-
- for (j = cmd->i; j > 0; j--) fgetc(in);
- if (cmd->chars[2] == 'W') ip->next_plane = 0; else ip->next_plane++;
-
- return 0;
-}
-
-/*****************************************************************************/
-
-#define two_octets(index) (buffer[index]*256 + buffer[(index) + 1])
-
-/*****************************************************************************/
-
-static void print_CRD(FILE *out, const pcl_Octet *buffer)
-{
- int j;
-
- for (j = 0; j < buffer[1]; j++)
- imessage(out, 12, " colorant %d: %4d x %4d ppi %2d levels\n",
- j + 1, two_octets(2 + 6*j), two_octets(4 + 6*j),
- two_octets(6 + 6*j));
-
- return;
-}
-
-/*****************************************************************************/
-
-static int action_CRD(FILE *in, const pcl_Command *cmd, void *i) /* NLS: 30 */
-{
- CollectedInfo *ip = i;
- pcl_Octet *buffer;
- int errors = 0;
-
- ip->seen_CRD = TRUE;
-
- if (cmd->i <= 0) {
- ip->CRD_active = FALSE;
- ip->fdata.palette = pcl_no_palette;
- ip->fdata.number_of_colorants = 1;
- ip->fdata.colorant_array[0].hres = ip->fdata.colorant_array[0].vres = 75;
- ip->fdata.colorant_array[0].levels = 2;
- ip->first_colorant_planes = 1;
- return 0;
- }
- ip->CRD_active = TRUE;
-
- buffer = (pcl_Octet *)malloc(cmd->i);
- check(buffer);
- fread(buffer, sizeof(pcl_Octet), cmd->i, in);
-
- if (buffer[0] == 2) {
- /* Just occasionally, a little paranoia is good for the soul, let alone for
- for the reliability of the program! */
- if (2 + buffer[1]*6 != cmd->i) {
- emessage(30, "Illegal field length in Configure Raster Data command.\n");
- return -1;
- }
-
- if (buffer[1] == 1 || buffer[1] == 3 || buffer[1] == 4) {
- int j;
-
- ip->fdata.number_of_colorants = buffer[1];
- switch (ip->fdata.number_of_colorants) {
- case 1:
- ip->fdata.palette = pcl_black; break;
- case 3:
- ip->fdata.palette = pcl_CMY; break;
- case 4:
- ip->fdata.palette = pcl_CMYK; break;
- }
-
- for (j = 0; j < ip->fdata.number_of_colorants; j++) {
- ip->fdata.colorant_array[j].hres = two_octets(2 + 6*j);
- ip->fdata.colorant_array[j].vres = two_octets(4 + 6*j);
- ip->fdata.colorant_array[j].levels = two_octets(6 + 6*j);
- }
-
- {
- int power = 1;
- ip->first_colorant_planes = 0;
-
- while (power < ip->fdata.colorant_array[0].levels) {
- power *= 2;
- ip->first_colorant_planes++;
- }
- }
- }
- else {
- emessage(31,
- "This file contains a Configure Raster Data command with an\n"
- " illegal number of colorants (%d) and the following data:\n",
- buffer[1]);
- print_CRD(stderr, buffer);
- errors++;
- }
- }
- else {
- emessage(32,
- "This file contains a Configure Raster Data command with an\n"
- " unknown format (%d).\n",
- (int)buffer[0]);
- if (cmd->i > 2 && cmd->i == 2 + buffer[1]*6) {
- imessage(stderr, 33, " It *might* mean the following:\n");
- print_CRD(stderr, buffer);
- imessage(stderr, 34, " This format is not supported by pcl3.\n");
- }
- errors++;
- }
- free(buffer);
-
- return errors > 0? -1: 0;
-}
-
-/*****************************************************************************/
-
-static int action_old_quality(FILE *in, const pcl_Command *cmd, void *i)
-{
- CollectedInfo *ip = i;
-
- ip->seen_old_quality = TRUE;
- if (cmd->chars[1] == 'o') {
- if (cmd->chars[2] == 'D') ip->fdata.depletion = cmd->i;
- else if (cmd->chars[2] == 'Q') ip->fdata.shingling = cmd->i;
- }
- else if (cmd->chars[1] == 'r' && cmd->chars[2] == 'Q')
- ip->fdata.raster_graphics_quality = cmd->i;
-
- return 0;
-}
-
-/*****************************************************************************/
-
-static int action_quality(FILE *in, const pcl_Command *cmd, void *i)
-{
- CollectedInfo *ip = i;
-
- ip->seen_new_quality = TRUE;
- ip->fdata.print_quality = cmd->i;
-
- return 0;
-}
-
-/*****************************************************************************/
-
- /* NLS: 40 */
-static int action_colour(FILE *in, const pcl_Command *cmd, void *i)
-{
- CollectedInfo *ip = i;
-
- if (!ip->CRD_active) {
- switch (cmd->i) {
- case -4:
- ip->fdata.palette = pcl_CMYK; break;
- case -3:
- ip->fdata.palette = pcl_CMY; break;
- case -1:
- /*FALLTHROUGH*/
- case 0:
- /*FALLTHROUGH*/
- case 1:
- ip->fdata.palette = pcl_black; break;
- case 3:
- ip->fdata.palette = pcl_RGB; break;
- default:
- emessage(41, "This file uses a palette (%d) not supported by pcl3.\n",
- cmd->i);
- return -1;
- }
- ip->fdata.number_of_colorants = abs(cmd->i);
-
- {
- int j;
-
- for (j = 0; j < ip->fdata.number_of_colorants; j++) {
- ip->fdata.colorant_array[j].hres = ip->fdata.colorant_array[j].vres =
- ip->fdata.colorant_array[0].hres;
- ip->fdata.colorant_array[j].levels = 2;
- }
- }
-
- ip->first_colorant_planes = 1;
- }
-
- return 0;
-}
-
-/*****************************************************************************/
-
-static int action_resolution(FILE *in, const pcl_Command *cmd, void *i)
-{
- CollectedInfo *ip = i;
-
- ip->seen_RGR = TRUE;
-
- if (!ip->CRD_active) {
- int j;
-
- for (j = 0; j < ip->fdata.number_of_colorants; j++) {
- ip->fdata.colorant_array[j].hres =
- ip->fdata.colorant_array[j].vres = cmd->i;
- ip->fdata.colorant_array[j].levels = 2;
- }
- }
-
- return 0;
-}
-
-/*****************************************************************************/
-
-static int action_end_raster(FILE *in, const pcl_Command *cmd, void *i)
-{
- CollectedInfo *ip = i;
-
- if (cmd->chars[2] == 'B') ip->seen_ERG_B = TRUE;
- else if (cmd->chars[2] == 'C') ip->seen_ERG_C = TRUE;
-
- if (ip->seen_raster_data &&
- memcmp(&ip->fdata, &ip->fdata_old, sizeof(pcl_FileData)) != 0) {
- print_result(ip);
- memcpy(&ip->fdata_old, &ip->fdata, sizeof(pcl_FileData));
- }
- ip->seen_raster_data = FALSE;
-
- return 0;
-}
-
-/*****************************************************************************/
-
-typedef struct {
- char cmd[4];
- pcl_CommandInterpreter action;
-} ActionEntry;
-
-static ActionEntry action_table[] = {
- {"%-X", &action_UEL}, /* Universal Exit Language */
- {"&bT", &action_dry_time}, /* Set Dry Time */
- {"&lA", &action_PageSize}, /* Page Size */
- {"&lG", &action_destination}, /* Set Output Bin */
- {"&lH", &action_source}, /* Media Source */
- {"&lM", &action_media_type}, /* Media Type */
- {"&lS", &action_duplex}, /* Simplex/Duplex Print */
- {"*bM", &action_compression}, /* Raster Graphics Compression Method */
- {"*bV", &action_raster_data}, /* Transfer Raster Graphics Data by Plane */
- {"*bW", &action_raster_data}, /* Transfer Raster Graphics Data by Row */
- {"*gW", &action_CRD}, /* Configure Raster Data */
- {"*oD", &action_old_quality}, /* Set Raster Graphics Depletion */
- {"*oM", &action_quality}, /* Print Quality */
- {"*oQ", &action_old_quality}, /* Set Raster Graphics Shingling */
- {"*rB", &action_end_raster}, /* End Raster Graphics (old) */
- {"*rC", &action_end_raster}, /* End Raster Graphics (new) */
- {"*rQ", &action_old_quality}, /* Raster Graphics Quality */
- {"*rU", &action_colour}, /* Set Number of Planes Per Row */
- {"*tR", &action_resolution} /* Set Raster Graphics Resolution */
-};
-
-/*****************************************************************************/
-
-static int cmp_entries(const void *a, const void *b)
-{
- return
- strncmp(((const ActionEntry *)a)->cmd, ((const ActionEntry *)b)->cmd, 3);
-}
-
-/*****************************************************************************/
-
-static int analyzer(FILE *in, const pcl_Command *cmd, void *i)
-{
- ActionEntry key;
- const ActionEntry *entry;
- CollectedInfo *ip = i;
-
- /* Control codes */
- if (cmd->kind == 1) {
- if (cmd->chars[0] == '\0' &&
- /* Guard against NULs somewhere else except initially */
- !ip->seen_RGR && !ip->seen_CRD)
- ip->fdata.NULs_to_send = cmd->i;
- return 0;
- }
-
- /* Two-character escape sequences */
- if (cmd->kind == 2) {
- switch (cmd->chars[0]) {
- case 'E': /* Printer Reset */
- {
- /* Preserve some global data (mostly PJL state) across PCL Reset
- invocations */
- unsigned int NULs_to_send = ip->fdata.NULs_to_send;
- char *PJL_language = ip->fdata.PJL_language;
- char *PJL_job = ip->fdata.PJL_job;
-
- ip->CRD_active = FALSE;
- ip->seen_raster_data = FALSE;
- memset(&ip->fdata, 0, sizeof(pcl_FileData));
- ip->fdata.colorant_array[0].hres =
- ip->fdata.colorant_array[0].vres = 75;
- ip->fdata.colorant_array[0].levels = 2;
- ip->fdata.number_of_colorants = 1;
- ip->fdata.duplex = -1;
- ip->fdata.dry_time = -1;
- ip->fdata.raster_graphics_quality = -1;
- ip->fdata.shingling = -1;
-
- ip->fdata.NULs_to_send = NULs_to_send;
- ip->fdata.PJL_language = PJL_language;
- ip->fdata.PJL_job = PJL_job;
- }
- break;
- default:
- return 1;
- }
- return 0;
- }
-
- /* Parameterized escape sequences */
- strncpy(key.cmd, cmd->chars, 3);
- entry = (const ActionEntry *)bsearch(&key, action_table,
- sizeof(action_table)/sizeof(ActionEntry), sizeof(ActionEntry), cmp_entries);
- if (entry != NULL) return (*entry->action)(in, cmd, ip);
-
- return 1;
-}
-
-/******************************************************************************
-
- Function: work
-
- On errors, the return value is positive, on success it is zero.
-
-******************************************************************************/
-
-static int work(FILE *in, FILE *out) /* NLS: 50 */
-{
- CollectedInfo info;
- int rc;
-
- memset(&info, 0, sizeof(CollectedInfo));
- info.out = out;
- info.fdata.duplex = -1;
- info.fdata.dry_time = -1;
- info.fdata.raster_graphics_quality = -1;
- info.fdata.shingling = -1;
-
- rc = pcl_scan(in, &analyzer, &info, NULL, NULL);
- if (rc != 0) return 1;
-
- if (info.number_of_outputs == 0) {
- emessage(50,
- "This does not seem to be a PCL file containing raster data.\n");
- return 1;
- }
-
- return 0;
-}
-
-/******************************************************************************
-
- Function: main
-
- Usage: pcl3opts <options> <input files>
- <option> ::= '-o' <output file>
- <input files> ::= <empty> | <input file> <input files>
-
-******************************************************************************/
-
-int main(int argc, char **argv)
-{
- char
- *outfile_name = NULL;
- FILE
- *outfile,
- *infile;
- int
- c,
- errors = 0,
- number_of_infiles;
-
-#ifndef NDEBUG
- {
- int j;
-
- for (j = 1; j < sizeof(action_table)/sizeof(ActionEntry); j++)
- assert(cmp_entries(action_table + (j - 1), action_table + j) < 0);
- }
-#endif /* !NDEBUG */
-
- /* Set the locale depending on the environment */
- setlocale(LC_ALL, "");
- catd = catopen("pcl3opts", 0);
-
- puts("*** pcl3opts\n"); /* Note that puts() appends another '\n'. */
-
- /* Set the program's name. We assume: argc <= 0 || parts(argv) >= 1. */
- if (argc <= 0 || argv[0] == NULL || argv[0][0] == '\0')
- progname = "pcl3opts";
- else {
- if ((progname = strrchr(argv[0], '/')) == NULL || progname[1] == '\0')
- progname = argv[0];
- else
- progname++;
- }
-
- /* Parse the options */
- while ((c = getopt(argc, argv, "o:")) != EOF) {
- switch(c) {
- case 'o':
- outfile_name = optarg;
- break;
- default:
- errors++;
- break;
- }
- }
-
- /* Leave on errors in the command line */
- if (errors > 0) {
- emessage(1, "Usage: %s [<options>] [<input files>].\n"
- " <option> ::= -o <output file>\n",
- progname);
- exit(EXIT_FAILURE);
- }
-
- /* Open the output file */
- if (outfile_name == NULL) outfile = stdout;
- else {
- outfile = fopen(outfile_name, "w");
- if (outfile == NULL) {
- emessage(2, "The file `%s' could not be opened for writing:\n %s.\n",
- outfile_name, strerror(errno));
- exit(EXIT_FAILURE);
- }
- }
-
- /* Loop over the input files */
- number_of_infiles = argc - optind;
- if (number_of_infiles <= 0) errors += work(stdin, outfile);
- else do {
- char *infile_name;
-
- /* Open */
- infile_name = argv[optind];
- infile = fopen(infile_name, "rb");
- if (infile == NULL) {
- emessage(3, "Could not open the input file `%s':\n %s.\n",
- infile_name, strerror(errno));
- exit(EXIT_FAILURE);
- }
-
- if (number_of_infiles > 1) fprintf(outfile, "*** %s:\n", infile_name);
- errors += work(infile, outfile);
-
- /* Close */
- if (fclose(infile) != 0) {
- emessage(4, "Error closing `%s':\n %s.\n",
- infile_name, strerror(errno));
- errors++;
- }
- optind++;
- if (errors == 0 && optind < argc) fputs("\n", outfile);
- } while (errors == 0 && optind < argc);
-
- /* Close the output file */
- if (fclose(outfile) != 0) {
- emessage(4, "Error closing `%s':\n %s.\n",
- outfile_name == NULL? "[standard output]": outfile_name, strerror(errno));
- errors++;
- }
-
- catclose(catd);
-
- exit(errors == 0? EXIT_SUCCESS: EXIT_FAILURE);
-}
diff --git a/gs/contrib/pcl3/src/pclcap.c b/gs/contrib/pcl3/src/pclcap.c
deleted file mode 100644
index ecf55ed9c..000000000
--- a/gs/contrib/pcl3/src/pclcap.c
+++ /dev/null
@@ -1,872 +0,0 @@
-/******************************************************************************
- File: $Id: pclcap.c,v 1.17 2001/03/08 09:17:51 Martin Rel $
- Contents: Description of PCL printer capabilities and supporting functionality
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany. E-mail: Martin.Lottermoser@t-online.de.
-
-*******************************************************************************
-* *
-* Copyright (C) 2000, 2001 by Martin Lottermoser *
-* All rights reserved *
-* *
-******************************************************************************/
-
-/* Configuration management identification */
-#ifndef lint
-static const char
- cm_id[] = "@(#)$Id: pclcap.c,v 1.17 2001/03/08 09:17:51 Martin Rel $";
-#endif
-
-/*****************************************************************************/
-
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE 500
-#endif
-
-/* Standard headers */
-#include <assert.h>
-#include <string.h> /* for memset() */
-#include <stdlib.h>
-
-/* Special headers */
-#include "pclcap.h"
-#include "pclsize.h"
-
-/*****************************************************************************/
-
-/* Number of elements in an array */
-#define array_size(a) (sizeof(a)/sizeof(a[0]))
-
-/* Distance in terms of pixels at 300 ppi */
-#define BP_PER_DOT (BP_PER_IN/300)
-
-/*****************************************************************************/
-
-/*
- Lists of media dimensions supported by each model and the (monochrome raster
- mode) margins in force for them. Read the comments on 'pcl_PageSize' in
- pclgen.h before reading further.
-
- These data have been obtained from various sources. A number of
- inconsistencies and omissions, partially within a single source, indicate
- that this information is not entirely reliable. If you find more reliable
- information than the one used here or you discover an entry to be definitely
- wrong by doing a test on the printer in question, send me a message.
-
- The PCL documentation (TRG500, DJ3/4, DJ6/8 and DJ1120C) should be the most
- reliable and I have usually given it priority. Besides this I have used HP
- support documents (e.g., "HP DeskJet 660C Printer - Printable Regions",
- BPD02519), user manuals for individual printers, a support document covering
- a range of printers ("HP DeskJet and DeskWriter Printers - Printable
- Areas/Minimum Margins", BPD05054), and the "Software Developer's Guide for HP
- DeskJet Printer Drivers", May 1996 (called "DG" in what follows).
-
- The DG seems the least reliable. Apart from several internal inconsistencies
- (conversion between units), some strange data (unexplicably large top margins)
- and frequent deviations from the documentation for the series-500 Deskjets
- (TRG500), I also suspect that some of the sizes listed are not supported by
- the printer at the PCL level but are handled in the driver, i.e., the driver
- uses a PCL Page Size code other than the one belonging to the size requested.
- In addition, HP distinguishes at least between margins when printing from DOS
- and margins when printing in Windows (see, e.g., BPD02519 for the DJ 660C).
- The DG lists the Windows margins which are usually larger than the hardware
- margins. I assume the DOS margins to be the real hardware margins.
-
- A statement that the DeskJets 500 and 500C but not 510, 520, 540, 550C, 560C
- or any newer models load envelopes long edge first can be found on p. 24 of
- DG. In addition, BPD01246 describes how to load envelopes on the HP DeskJet,
- DeskJet Plus, DJ 500 and DJ 500C printers and it has to be done flap first,
- i.e., long edge first.
-
- Some care is necessary when inserting margin specifications. In particular
- for envelopes, older (pre-1997) HP documentation frequently gives them in
- landscape orientation instead of in portrait orientation as needed here
- (except when the MS_TRANSVERSE_FLAG is set). A useful rule of thumb: If the
- bottom margin is not the largest of the four margins but the left margin is,
- it's very likely landscape. The value should be around 0.5 in (ca. 12 mm).
-*/
-
-static const eprn_PageDescription
- /* Order of margins: left, bottom, right, top. */
- hpdj3xx_sizes[] = {
- /* These are the page descriptions for the DeskJets Portable, 310, 320 and
- 340, taken from DJ3/4, pp. 1 and 20. When printing in colour, the
- bottom margin is larger by 50 d.
- Note that BPD05054 gives different margins.
- */
- {ms_Letter,
- 75*BP_PER_DOT, 120*BP_PER_DOT, 75*BP_PER_DOT, 30*BP_PER_DOT},
- {ms_Legal,
- 75*BP_PER_DOT, 120*BP_PER_DOT, 75*BP_PER_DOT, 30*BP_PER_DOT},
- {ms_A4,
- 37*BP_PER_DOT, 120*BP_PER_DOT, 43*BP_PER_DOT, 30*BP_PER_DOT},
- {ms_Executive,
- 75*BP_PER_DOT, 120*BP_PER_DOT, 75*BP_PER_DOT, 30*BP_PER_DOT},
- {ms_none}
- },
- hpdj400_sizes[] = {
- /* These are the page descriptions for the DeskJet 400 taken from DJ3/4,
- pp. 1 and 21, and are stated to be valid valid for black and colour.
- Page 21 contains the following statement: "The mechanism will
- physically shift the page image downwards by a nominal 0.08 inch
- (2.0 mm)." I conclude this to mean that the real top margin is
- 0.08 inch instead of zero as specified and that the real bottom margin
- is smaller than specified by 0.08 inch.
- Note that BPD05054 gives different margins.
- */
- {ms_Letter,
- 0.25*BP_PER_IN, (0.5-0.08)*BP_PER_IN, 0.25*BP_PER_IN, 0.08*BP_PER_IN},
- {ms_Legal,
- 0.25*BP_PER_IN, (0.5-0.08)*BP_PER_IN, 0.25*BP_PER_IN, 0.08*BP_PER_IN},
- {ms_A4,
- 0.125*BP_PER_IN, (0.5-0.08)*BP_PER_IN, 3.6*BP_PER_MM, 0.08*BP_PER_IN},
- {ms_Executive,
- 0.25*BP_PER_IN, (0.5-0.08)*BP_PER_IN, 0.25*BP_PER_IN, 0.08*BP_PER_IN},
- {ms_JISB5,
- 3.175*BP_PER_MM, (0.5-0.08)*BP_PER_IN, 3.25*BP_PER_MM, 0.08*BP_PER_IN},
- /* DJ3/4 p. 21: "Envelopes are printed in the landscape mode". As the
- margins are given such that the largest value is designated as "bottom"
- and the bottom is designated on page 19 as a long edge, I conclude that
- the DJ 400 feeds envelopes long edge first. The list on p. 1 gives the
- dimensions for Env10 in portrait and EnvDL in landscape orientation.
- */
- {ms_Env10 | MS_TRANSVERSE_FLAG,
- 0.125*BP_PER_IN, (0.5-0.08)*BP_PER_IN, 0.08*BP_PER_IN, 0.08*BP_PER_IN},
- {ms_EnvDL | MS_TRANSVERSE_FLAG,
- 0.125*BP_PER_IN, (0.5-0.08)*BP_PER_IN, 0.11*BP_PER_IN, 0.08*BP_PER_IN},
- {ms_none}
- },
- hpdj500_sizes[] = {
- /* These are taken from the TRG500 p. 1-18 except for No. 10 envelopes
- which are supported according to p. 3-2 and where I took the margins
- from BPD05054. The resulting collection agrees with BPD05054 which
- declares it to be valid for the HP DeskJet and the HP DeskJet Plus as
- well.
- Order of margins: left, bottom, right, top. */
- {ms_Letter,
- 0.25*BP_PER_IN, 0.57*BP_PER_IN, 0.25*BP_PER_IN, 0.1*BP_PER_IN},
- {ms_Legal,
- 0.25*BP_PER_IN, 0.57*BP_PER_IN, 0.25*BP_PER_IN, 0.1*BP_PER_IN},
- {ms_A4,
- 3.1*BP_PER_MM, 0.57*BP_PER_IN, 3.6*BP_PER_MM, 0.1*BP_PER_IN},
- {ms_Env10 | MS_TRANSVERSE_FLAG, /* Margins from BPD05054 */
- 0.75*BP_PER_IN, 0.57*BP_PER_IN, 0.75*BP_PER_IN, 0.1*BP_PER_IN},
- {ms_none}
- },
- hpdj500c_sizes[] = {
- /* The data are from the TRG500 pp. 1-18 and 1-19 except for No. 10
- envelopes which are supported according to p. 3-2 and which I took from
- BPD05054. The values listed in both documents agree.
- These are the values for the black cartridge; the CMY cartridge needs
- 0.17 inches more at the bottom.
- Order of margins: left, bottom, right, top. */
- {ms_Letter,
- 0.25*BP_PER_IN, 0.4*BP_PER_IN, 0.25*BP_PER_IN, 0.1*BP_PER_IN},
- {ms_Legal,
- 0.25*BP_PER_IN, 0.4*BP_PER_IN, 0.25*BP_PER_IN, 0.1*BP_PER_IN},
- {ms_A4,
- 3.1*BP_PER_MM, 0.4*BP_PER_IN, 3.6*BP_PER_MM, 0.1*BP_PER_IN},
- {ms_Env10 | MS_TRANSVERSE_FLAG,
- /* Margins from BPD05054, but I've chosen 0.4 in for the bottom margin
- instead of 0.57 in as listed there because it looks to me like the
- colour bottom. Compare with the DJ 500. */
- 0.75*BP_PER_IN, 0.4*BP_PER_IN, 0.75*BP_PER_IN, 0.1*BP_PER_IN},
- {ms_none}
- },
- common_sizes[] = { /* DJs 510, 520, 550C und 560C for printing in black */
- /* The data are from the TRG500 p. 1-19 except for envelopes which are
- supported according to p. 3-2 and where I took the margins from
- BPD05054. The values listed in both documents agree.
- For colour, the bottom margin must be increased by 0.13 inches.
- Order of margins: left, bottom, right, top. */
- {ms_Letter,
- 0.25*BP_PER_IN, 0.46*BP_PER_IN, 0.25*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_Legal,
- 0.25*BP_PER_IN, 0.46*BP_PER_IN, 0.25*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_Executive,
- 0.25*BP_PER_IN, 0.46*BP_PER_IN, 0.20*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_A4,
- 3.1*BP_PER_MM, 0.46*BP_PER_IN, 3.6*BP_PER_MM, 0.04*BP_PER_IN},
- /* Envelopes are supported according the TRG500, the margins are from
- BPD05054. */
- {ms_Env10, /* given in landscape by HP */
- 0.123*BP_PER_IN, 0.71*BP_PER_IN, 0.125*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_EnvDL, /* given in landscape by HP */
- 3.1*BP_PER_MM, 18.0*BP_PER_MM, 3.6*BP_PER_MM, 1.0*BP_PER_MM},
- {ms_none}
- },
- hpdj540_sizes[] = {
- /* The data are from the TRG500 pp. 1-20 and 1-21 except that I have used
- a top margin of 0.04 inch from the DG instead of zero from the TRG500.
- Taking into account that the bottom margin is larger by 0.13 inches in
- colour, the resulting data agree with those in the DG, pp. 65-66.
- Order of margins: left, bottom, right, top. */
- {ms_Executive,
- 0.25*BP_PER_IN, 0.46*BP_PER_IN, 0.25*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_Letter, 0.25*BP_PER_IN, 0.46*BP_PER_IN, 0.25*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_Legal, 0.25*BP_PER_IN, 0.46*BP_PER_IN, 0.25*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_A4, 3.2*BP_PER_MM, 11.7*BP_PER_MM, 3.2*BP_PER_MM, 0.04*BP_PER_IN},
- {ms_A5, 3.2*BP_PER_MM, 18.0*BP_PER_MM, 3.2*BP_PER_MM, 0.04*BP_PER_IN},
- {ms_JISB5, 4.2*BP_PER_MM, 11.7*BP_PER_MM, 4.2*BP_PER_MM, 0.04*BP_PER_IN},
- {ms_Index4x6in,
- 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_Index5x8in,
- 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_A6 | PCL_CARD_FLAG,
- 3.2*BP_PER_MM, 18.0*BP_PER_MM, 3.2*BP_PER_MM, 0.04*BP_PER_IN},
- {ms_Env10, 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- /* given in landscape by HP */
- {ms_EnvDL, 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- /* given in landscape by HP */
- {ms_EnvC6, 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- /* given in landscape by HP */
- {ms_Postcard, 4.2*BP_PER_MM, 18.0*BP_PER_MM, 4.2*BP_PER_MM, 0.04*BP_PER_IN},
- {ms_none}
- },
- hpdj660c_sizes[] = {
- /* These are taken from "HP DeskJet 660C Printer - Printable Regions",
- BPD02519, 1996 (obtained in March 1997), except that I've again
- increased the top margin from zero to 0.04 inches following BPD05054
- and DG pp. 69-70. These are the values for printing in black from DOS.
- Colour printing increases the bottom margin by 0.13 inch. Adding this
- value reproduces the data from BPD05054 and the DG. This is, however, a
- contradiction with DG because BPD02519 gives different values for
- printing from Windows.
- */
- {ms_Letter, 0.25*BP_PER_IN, 0.46*BP_PER_IN, 0.25*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_Legal, 0.25*BP_PER_IN, 0.46*BP_PER_IN, 0.25*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_Executive,
- 0.25*BP_PER_IN, 0.46*BP_PER_IN, 0.25*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_A4, 0.13*BP_PER_IN, 0.46*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_A5, 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_JISB5, 0.17*BP_PER_IN, 0.46*BP_PER_IN, 0.17*BP_PER_IN, 0.04*BP_PER_IN},
- /* The bottom margin for JISB5 is given with large differences. BPD02519
- specifies it as 0.46 in for black from DOS, 0.59 in DOS/colour (agreeing
- with +0.13 in for 'bottom_increment') and the same for Windows black or
- colour. BPD05054 gives 0.84 in without distinguishing between black and
- colour, and the DG gives 0.59 in. */
- {ms_Env10, 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- /* given in landscape by HP */
- {ms_EnvDL, 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- /* given in landscape by HP */
- {ms_EnvC6, 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- /* given in landscape by HP */
- {ms_Index4x6in,
- 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_Index5x8in,
- 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_A6 | PCL_CARD_FLAG,
- 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_Postcard,
- 0.17*BP_PER_IN, 0.71*BP_PER_IN, 0.17*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_EnvUS_A2,
- 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- /* Supported (BPD02925, BPD05054, DG), margins from BPD05054 agreeing
- with DG p. 70 */
- {ms_none}
- },
- hpdj680c_sizes[] = {
- /* For a change, these data are taken from the DG pp. 73-74. It is assumed
- that they are there given for colour printing and that the additional
- bottom margin included is 0.13 inches. Except for banner printing which
- is not supported by the DJ 660C, this gives identical margins as those
- for the DJ 660C.
- These data also almost agree with the German printer manual,
- Hewlett Packard
- "Weitere Informationen ueber den HP DeskJet 690C Series-Drucker"
- 1. Auflage, September 1996
- Bestellnummer C4562-60105, Artikelnummer C4562-90160
- for the DJ 690C. The difference is at most 0.31 mm except for the bottom
- margin in the case of JIS B5 which is given as 21.2 mm instead of 14.9 mm
- (0.83 in vs. 0.59 in).
- The DJ 690C does support banner printing (DJ6/8 p. 9).
- */
- {ms_Letter, 0.25*BP_PER_IN, 0.46*BP_PER_IN, 0.25*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_A4, 0.13*BP_PER_IN, 0.46*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_Legal, 0.25*BP_PER_IN, 0.46*BP_PER_IN, 0.25*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_Env10, 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_Executive,
- 0.25*BP_PER_IN, 0.46*BP_PER_IN, 0.25*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_EnvDL, 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_A5, 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_JISB5, 0.17*BP_PER_IN, 0.46*BP_PER_IN, 0.17*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_EnvC6, 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_Index4x6in,
- 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_Index5x8in,
- 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_A6 | PCL_CARD_FLAG,
- 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_Postcard,
- 0.17*BP_PER_IN, 0.71*BP_PER_IN, 0.17*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_EnvUS_A2,
- 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_Letter | MS_BIG_FLAG, /* banner */
- 0.25*BP_PER_IN, 0.0, 0.25*BP_PER_IN, 0.0},
- {ms_A4 | MS_BIG_FLAG, /* banner */
- 0.13*BP_PER_IN, 0.0, 0.13*BP_PER_IN, 0.0},
- /* BPD05054 claims left and right margins of 0.25 in. */
- {ms_none}
- },
- hpdj6xx_and_8xx_sizes[] = {
- /* This entry is a combination from the sizes supported according to
- DJ6/8 pp. 23-24 by all series 600 and 800 DeskJets, and the corresponding
- margins from 'hpdj660c_sizes[]' above. This is only used for
- series 600 DeskJets for which there is no other information and not for
- series 800 DeskJets.
- */
- {ms_Executive,
- 0.25*BP_PER_IN, 0.46*BP_PER_IN, 0.25*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_Letter, 0.25*BP_PER_IN, 0.46*BP_PER_IN, 0.25*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_Legal, 0.25*BP_PER_IN, 0.46*BP_PER_IN, 0.25*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_A5, 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_A4, 0.13*BP_PER_IN, 0.46*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_JISB5, 0.17*BP_PER_IN, 0.46*BP_PER_IN, 0.17*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_Postcard,
- 0.17*BP_PER_IN, 0.71*BP_PER_IN, 0.17*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_DoublePostcard, /* not present in 'hpdj660c_sizes[]'; guessed */
- 0.17*BP_PER_IN, 0.71*BP_PER_IN, 0.17*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_A6 | PCL_CARD_FLAG,
- 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_Index4x6in,
- 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_Index5x8in,
- 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_Env10, 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_EnvDL, 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_EnvC6, 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_EnvUS_A2,
- 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_none}
- },
- hpdj850c_sizes[] = {
- /* Apart from JIS B5, these specifications have been taken from the German
- HP user manual for the DeskJet 850C, "HP DeskJet 850C Handbuch",
- C2145-90248, 3/95. They are valid for black and colour printing.
- The manual agrees with "HP DeskJet 850C and 855C Printer -- Printable
- Regions" (BPD02523), HP FIRST #: 2789, 1995-09-05, and the newer
- "HP DeskJet 855C, 850C, 870C and 890C Series Printers -- Printable Areas"
- (BPD02523), effective date 1996-06-06.
- There are some minor deviations in the DG, pp. 81-82, which I have
- partially adopted.
- First some shorthand notation for margin types. The order is:
- left, bottom, right, top.
- */
-#define type1 6.4*BP_PER_MM, 11.7*BP_PER_MM, 6.4*BP_PER_MM, 1.0*BP_PER_MM
-#define type2 3.4*BP_PER_MM, 11.7*BP_PER_MM, 3.4*BP_PER_MM, 1.0*BP_PER_MM
-#define type3 3.4*BP_PER_MM, 11.7*BP_PER_MM, 3.4*BP_PER_MM, 11.7*BP_PER_MM
-#define type4 3.2*BP_PER_MM, 11.7*BP_PER_MM, 3.2*BP_PER_MM, 1.0*BP_PER_MM
-#define type5 3.2*BP_PER_MM, 22.0*BP_PER_MM, 3.2*BP_PER_MM, 1.0*BP_PER_MM
- {ms_Letter, type1},
- {ms_Legal, type1},
- {ms_Executive, type1},
- {ms_A4, type2},
- {ms_A5, type2}, /* also BPD05054. DG: type4 */
- {ms_JISB5, type4}, /* from DG */
- /* The German handbook as well as BPD02523 and BPD05054 state that this
- should be type3. This is however demonstrably wrong for the DJ 850C.
- Besides I can't see why the top margin should be so much larger for
- JIS B5 than for the other sizes. 'type4' agrees fairly well with what
- I've measured on a DJ 850C. In particular the right and bottom clipping
- margins are definitely close to 3 and 11.5 mm, respectively.
- */
- {ms_Index4x6in, type4},
- {ms_Index5x8in, type4},
- {ms_A6 | PCL_CARD_FLAG, type4},
- {ms_Postcard, type4},
- {ms_Env10, type5},
- {ms_EnvDL, type5},
- {ms_EnvC6, type5},
- /* BPD02926 claims that the series-800 DeskJets support also US A2 envelope
- size (ms_EnvUS_A2). I've experimented with a DeskJet 850C and I don't
- believe it: when sent this page size code, the printer establishes
- clipping regions which agree with those for US Letter size. This
- indicates that the PCL interpreter has not recognized the page size code
- and has therefore switched to the default size. */
- {ms_none}
-#undef type1
-/* type2 will be needed in a moment */
-#undef type3
-#undef type4
-#undef type5
- },
- hpdj1120c_sizes[] = {
- /* These values are from DJ1120C, pp. 11-12, and from BPD05567. I don't
- consider them particularly trustworthy. */
- {ms_Executive, 0.25*BP_PER_IN, 0.46*BP_PER_IN, 0.25*BP_PER_IN,
- 0.12*BP_PER_IN},
- {ms_Letter, 0.25*BP_PER_IN, 0.46*BP_PER_IN, 0.25*BP_PER_IN,
- 0.12*BP_PER_IN},
- {ms_Legal, 0.25*BP_PER_IN, 0.46*BP_PER_IN, 0.25*BP_PER_IN,
- 0.12*BP_PER_IN},
- {ms_Tabloid, 0.20*BP_PER_IN, 0.46*BP_PER_IN, 0.20*BP_PER_IN,
- 0.12*BP_PER_IN},
- {ms_Statement, 0.20*BP_PER_IN, 0.46*BP_PER_IN, 0.20*BP_PER_IN,
- 0.12*BP_PER_IN}, /* Not in BPD05567. */
- {ms_HPSuperB, 0.20*BP_PER_IN, 0.46*BP_PER_IN, 0.20*BP_PER_IN,
- 0.12*BP_PER_IN},
- {ms_A6, 0.125*BP_PER_IN, 0.46*BP_PER_IN, 0.125*BP_PER_IN,
- 0.12*BP_PER_IN}, /* Not in BPD05567. */
- {ms_A5, 0.125*BP_PER_IN, 0.46*BP_PER_IN, 0.125*BP_PER_IN,
- 0.12*BP_PER_IN},
- /* BPD05567: 0.12 in, 0.46 in, 0.12 in, 0.12 in. */
- {ms_A4, 0.20*BP_PER_IN, 0.46*BP_PER_IN, 0.20*BP_PER_IN,
- 0.12*BP_PER_IN},
- /* BPD05567: 0.13 in, 0.46 in, 0.13 in, 0.12 in. */
- {ms_A3, 0.20*BP_PER_IN, 0.46*BP_PER_IN, 0.20*BP_PER_IN,
- 0.12*BP_PER_IN}, /* Only in BPD05567. */
- {ms_JISB5, 0.125*BP_PER_IN, 0.46*BP_PER_IN, 0.125*BP_PER_IN,
- 0.12*BP_PER_IN},
- /* BPD05567: 0.12 in, 0.46 in, 0.12 in, 0.12 in. */
- {ms_JISB4, 0.20*BP_PER_IN, 0.46*BP_PER_IN, 0.20*BP_PER_IN,
- 0.12*BP_PER_IN}, /* Not in BPD05567. */
- {ms_Postcard, 0.125*BP_PER_IN, 0.46*BP_PER_IN, 0.125*BP_PER_IN,
- 0.12*BP_PER_IN},
- /* BPD05567: 0.12 in, 0.46 in, 0.12 in, 0.12 in. */
- {ms_A6 | PCL_CARD_FLAG, 0.125*BP_PER_IN, 0.46*BP_PER_IN, 0.125*BP_PER_IN,
- 0.12*BP_PER_IN},
- /* BPD05567: 0.12 in, 0.46 in, 0.12 in, 0.12 in. */
- {ms_Index4x6in, 0.125*BP_PER_IN, 0.46*BP_PER_IN, 0.125*BP_PER_IN,
- 0.12*BP_PER_IN},
- /* BPD05567: 0.12 in, 0.46 in, 0.12 in, 0.12 in. */
- {ms_Index5x8in, 0.125*BP_PER_IN, 0.46*BP_PER_IN, 0.125*BP_PER_IN,
- 0.12*BP_PER_IN},
- /* BPD05567: 0.12 in, 0.46 in, 0.12 in, 0.12 in. */
- {ms_Env10, 0.125*BP_PER_IN, 0.46*BP_PER_IN, 0.125*BP_PER_IN,
- 0.12*BP_PER_IN},
- /* BPD05567: 0.12 in, 0.46 in, 0.12 in, 0.12 in. */
- {ms_EnvDL, 0.125*BP_PER_IN, 0.46*BP_PER_IN, 0.125*BP_PER_IN,
- 0.12*BP_PER_IN},
- /* BPD05567: 0.12 in, 0.46 in, 0.12 in, 0.12 in. */
- {ms_EnvC6, 0.125*BP_PER_IN, 0.46*BP_PER_IN, 0.125*BP_PER_IN,
- 0.12*BP_PER_IN},
- /* BPD05567: 0.12 in, 0.46 in, 0.12 in, 0.12 in. */
- {ms_EnvUS_A2, 0.125*BP_PER_IN, 0.46*BP_PER_IN, 0.125*BP_PER_IN,
- 0.12*BP_PER_IN},
- /* BPD05567: 0.12 in, 0.46 in, 0.12 in, 0.12 in. */
- {ms_EnvChou3, 0.125*BP_PER_IN, 0.46*BP_PER_IN, 0.125*BP_PER_IN,
- 0.12*BP_PER_IN},
- /* BPD05567: 0.12 in, 0.46 in, 0.12 in, 0.12 in. */
- {ms_EnvChou4, 0.125*BP_PER_IN, 0.46*BP_PER_IN, 0.125*BP_PER_IN,
- 0.12*BP_PER_IN},
- /* BPD05567: 0.12 in, 0.46 in, 0.12 in, 0.12 in. */
- {ms_EnvKaku2, 0.20*BP_PER_IN, 0.46*BP_PER_IN, 0.20*BP_PER_IN,
- 0.12*BP_PER_IN}, /* Not in BPD05567. */
- /* Banners are listed only in BPD05567: */
- {ms_Letter | MS_BIG_FLAG,
- 0.25*BP_PER_IN, 0, 0.25*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_A4 | MS_BIG_FLAG,
- 0.13*BP_PER_IN, 0, 0.13*BP_PER_IN, 0.04*BP_PER_IN},
- {ms_none}
- };
-
-/*---------------------------------------------------------------------------*/
-
-/* Custom page size descriptions.
- First the limits: width min and max, height min and max.
- Then the margins in the usual order: left, bottom, right, top.
-
- Again, I have assumed something I could find no explicit documentation for,
- namely that these limits refer to raster space (which is identical to
- pixmap device space for the 'pcl3' device). It is, however, clear from the
- upper limits for the DJ 850C that "height" does not refer to the direction
- orthogonal to the feeding direction.
- */
-static const eprn_CustomPageDescription
- hpdj540_custom_sizes[] = {
- /* These values are taken from the document "HP DeskJet 540 Printer -
- Print Regions", BPD02194, 1996, except for the right margin which is
- stated to be application-dependent (the TRG500 recommends that one should
- enforce at least 1/8 in) and the top margin which I've extended from
- zero to 0.04 in.
- These are the correct values for printing in black. Note that the
- DeskJet 540 in colour mode needs a bottom margin which is larger by
- 0.13 in.
- */
- { /* Page width 7.12 to 8.5 in */
- ms_CustomPageSize,
- 0.13*BP_PER_IN, 0.46*BP_PER_IN, 0.125*BP_PER_IN, 0.04*BP_PER_IN,
- 7.12*BP_PER_IN, 8.5*BP_PER_IN, 5.83*BP_PER_IN, 14*BP_PER_IN
- },
- { /* Page width 5 to 7.12 in */
- ms_CustomPageSize,
- 0.13*BP_PER_IN, 0.71*BP_PER_IN, 0.125*BP_PER_IN, 0.04*BP_PER_IN,
- 5*BP_PER_IN, 7.12*BP_PER_IN, 5.83*BP_PER_IN, 14*BP_PER_IN
- },
- {ms_none, 0, 0, 0, 0, 0, 0, 0, 0}
- },
- hpdj_6xx_and_8xx_custom_sizes[] = {
- /* Ranges from DJ6/8 p. 23, margins from A4 for the DJ 660C (BPD02519) */
- {
- ms_CustomPageSize,
- 0.13*BP_PER_IN, 0.46*BP_PER_IN, 0.13*BP_PER_IN, 0.04*BP_PER_IN,
- 5*BP_PER_IN, 8.5*BP_PER_IN, 148*BP_PER_MM, 14*BP_PER_IN
- },
- {ms_none, 0, 0, 0, 0, 0, 0, 0, 0}
- },
- hpdj850c_custom_sizes[] = {
- { /*
- The following values have been taken from the German DeskJet 850C
- manual, "HP DeskJet 850C Handbuch", C2145-90248, 3/95.
- They agree with the values given in the newer version of BPD02523 for
- the DeskJets 850C, 855C, 870C and 890C except that the left and right
- margins are stated to be 3.44 mm instead of 3.4 mm. This is almost
- certainly a misprint because the accompanying value in inches is
- identical (0.13 in, i.e. 3.30 mm), and specifying the margins to a
- hundredth of a millimetre is ridiculous.
- */
- ms_CustomPageSize,
- type2,
- 100*BP_PER_MM, 216*BP_PER_MM, 148*BP_PER_MM, 356*BP_PER_MM
- },
- {ms_none, 0, 0, 0, 0, 0, 0, 0, 0}
- },
- hpdj1120c_custom_sizes[] = {
- { /* Taken from DJ1120C pp. 10 and 12. The minimum sizes are guessed
- (smallest supported discrete dimensions) */
- ms_CustomPageSize,
- 0.125*BP_PER_IN, 0.46*BP_PER_IN, 0.125*BP_PER_IN, 0.12*BP_PER_IN,
- 90*BP_PER_MM, 13*BP_PER_IN, 146*BP_PER_MM, 19*BP_PER_IN,
- },
- {ms_none, 0, 0, 0, 0, 0, 0, 0, 0}
- },
- any_custom_sizes[] = {
- /* Any value is permitted in this case. This is approximated by permitting
- 10^-37-10^37 bp for both, width and height (10^37 bp = 3.5*10^33 m).
- Note that 10^37 is the smallest upper bound and 10^-37 the largest lower
- bound for 'float' values permitted by the C standard. */
- {
- ms_CustomPageSize,
- type2, /* use DJ 850C margins */
- 1.0E-37, 1.0E37, 1.0E-37, 1.0E37
- },
- {ms_none, 0, 0, 0, 0, 0, 0, 0, 0}
- };
-
-#undef type2
-
-/*****************************************************************************/
-
-/* Resolution lists */
-static const eprn_Resolution
- threehundred[] = {
- { 300, 300 }, { 0, 0 }
- },
- six_by_three[] = {
- { 600, 300 }, { 0, 0 }
- },
- sixhundred[] = {
- { 600, 600 }, { 0, 0 }
- },
- basic_resolutions[] = {
- { 75, 75 }, { 100, 100 }, { 150, 150 }, { 300, 300 }, { 0, 0 }
- /* This is the list of resolutions supported by the series 300, 400 and
- 500 DeskJets (except the DJ 540) in black and colour and by the series
- 600 and 800 DeskJets (except the DJs 85xC) in colour. */
- },
- basic_without_100[] = {
- { 75, 75 }, { 150, 150 }, { 300, 300 }, { 0, 0 }
- },
- rel_hpdj1120c_black[] = {
- { 150, 150 }, { 300, 300 }, { 600, 600 }, { 0, 0 }
- },
- rel_150_and_300[] = {
- { 150, 150 }, { 300, 300 }, { 0, 0 }
- };
-
-/* Lists of permitted numbers of intensity levels */
-static const eprn_IntensityLevels
- two_levels[] = { {2, 2}, {0, 0} },
- four_levels[] = { {4, 4}, {0, 0} },
- two_to_four_levels[] = { {2, 4}, {0, 0} },
- three_to_four_levels[] = { {3, 4}, {0, 0} },
- any_levels[] = { {2, 65535}, {0, 0} };
- /* More than 65535 levels cannot be represented in a Configure Raster Data
- command with format 2. */
-
-/* Combinations of resolutions and intensity levels */
-static const eprn_ResLev
- rl_basic[] = {
- {basic_resolutions, two_levels}, {NULL, NULL}
- },
- rl_basic_without_100[] = {
- {basic_without_100, two_levels}, {NULL, NULL}
- },
- rl_hpdj6xx_black[] = {
- {basic_resolutions, two_levels}, {six_by_three, two_levels},
- {sixhundred, two_levels}, {NULL, NULL}
- },
- rl_hpdj6xx_colour[] = {
- {basic_resolutions, two_levels}, {six_by_three, two_levels}, {NULL, NULL}
- },
- rl_three[] = {
- {threehundred, two_levels}, {NULL, NULL}
- },
- rl_six[] = {
- {sixhundred, two_levels}, {NULL, NULL}
- },
- rl_hpdj85x_black[] = {
- {basic_without_100, two_levels}, {sixhundred, two_levels}, {NULL, NULL}
- },
- rl_three_with_levels_2_4[] = {
- {threehundred, two_to_four_levels}, {NULL, NULL}
- },
- rl_three_with_levels_3_4[] = {
- {threehundred, three_to_four_levels}, {NULL, NULL}
- },
- rl_three_with_levels_4[] = {
- {threehundred, four_levels}, {NULL, NULL}
- },
- rl_hpdj1120c_black[] = {
- {rel_hpdj1120c_black, two_levels},
- {threehundred, four_levels},
- {NULL, NULL}
- },
- rl_150_and_300[] = {
- {rel_150_and_300, two_levels}, {NULL, NULL}
- },
- rl_any_two_levels[] = {
- /* Any resolution, but only two intensity levels */
- {NULL, two_levels}, {NULL, NULL}
- },
- rl_any[] = {
- {NULL, any_levels}, {NULL, NULL}
- };
-
-/*****************************************************************************/
-
-/* Colour capability lists */
-static const eprn_ColourInfo
- ci_old_mono[] = { /* DeskJet 5xx monochrome printers */
- { eprn_DeviceGray, {rl_basic, NULL} },
- { eprn_DeviceGray, {NULL, NULL} }
- },
- ci_hpdj500c[] = { /* HP DeskJet 500C: black or CMY cartridge */
- { eprn_DeviceGray, {rl_basic, NULL} },
- { eprn_DeviceCMY, {rl_basic, NULL} },
- { eprn_DeviceGray, {NULL, NULL} }
- },
- ci_hpdj540[] = { /* HP DeskJet 540: black or CMY cartridge */
- { eprn_DeviceGray, {rl_basic_without_100, NULL} },
- { eprn_DeviceCMY, {rl_basic_without_100, NULL} },
- { eprn_DeviceGray, {NULL, NULL} }
- },
- ci_hpdj5xx_cmyk[] = {
- /* HP DeskJet 550C or 560C: black and CMY cartridges, but the inks should
- not mix. */
- { eprn_DeviceGray, {rl_basic, NULL} },
- { eprn_DeviceCMY, {rl_basic, NULL} },
- { eprn_DeviceCMY_plus_K, {rl_basic, NULL} },
- { eprn_DeviceGray, {NULL, NULL} }
- },
- ci_hpdj600[] = {
- /* HP DeskJet 600: black or CMY cartridge */
- { eprn_DeviceGray, {rl_hpdj6xx_black, NULL} },
- { eprn_DeviceCMY, {rl_hpdj6xx_colour, NULL} },
- { eprn_DeviceGray, {NULL, NULL} }
- },
- ci_hpdj6xx[] = {
- /* Series-600 CMYK printers */
- { eprn_DeviceGray, {rl_hpdj6xx_black, NULL} },
- { eprn_DeviceCMY, {rl_hpdj6xx_colour, NULL} },
- { eprn_DeviceCMYK, {rl_hpdj6xx_colour, NULL} },
- { eprn_DeviceCMYK, {rl_six, rl_three} },
- { eprn_DeviceGray, {NULL, NULL} }
- },
- ci_hpdj85x[] = {
- { eprn_DeviceGray, {rl_hpdj85x_black, NULL} },
- { eprn_DeviceCMY, {rl_basic_without_100, NULL} },
- { eprn_DeviceCMYK, {rl_basic_without_100, NULL} },
- /* The following I have determined experimentally on a DJ 850C: */
- { eprn_DeviceGray, {rl_three_with_levels_4, NULL} },
- { eprn_DeviceCMYK, {rl_six, rl_three_with_levels_2_4} },
- { eprn_DeviceCMYK, {rl_three_with_levels_4, rl_three_with_levels_3_4} },
- { eprn_DeviceGray, {NULL, NULL} }
- },
- ci_hpdj1120c[] = {
- /* DJ1120C p. 48 */
- { eprn_DeviceGray, {rl_hpdj1120c_black, NULL} },
- { eprn_DeviceCMYK, {rl_six, rl_three_with_levels_4} },
- { eprn_DeviceCMYK, {rl_six, rl_three} },
- { eprn_DeviceCMYK, {rl_three_with_levels_4, rl_three_with_levels_3_4} },
- { eprn_DeviceCMYK, {rl_150_and_300, NULL} },
- /* The following are combined from DJ1120C pp. 36 and 52. */
- { eprn_DeviceGray, {rl_hpdj85x_black, NULL} },
- { eprn_DeviceCMY, {rl_basic_without_100, NULL} },
- { eprn_DeviceCMYK, {rl_basic_without_100, NULL} },
- { eprn_DeviceGray, {NULL, NULL} }
- },
- ci_any[] = {
- { eprn_DeviceGray, {rl_any, NULL} },
- { eprn_DeviceRGB, {rl_any_two_levels, NULL} },
- { eprn_DeviceCMY, {rl_any, NULL} },
- { eprn_DeviceCMYK, {rl_any, rl_any} },
- { eprn_DeviceGray, {NULL, NULL} }
- };
-
-/*****************************************************************************/
-
-/* Descriptions of known PCL printers */
-
-const pcl_PrinterDescription pcl3_printers[] = {
- /* For the HP DeskJet and the HP DeskJet Plus I am guessing that they can
- be treated like the DJ 500. This seems reasonable because several HP
- documents group the HP DeskJet, the HP DeskJet Plus and the 500 and
- 500C DeskJets together. */
- { HPDeskJet, pcl_level_3plus_DJ500,
- { "HP DeskJet", hpdj500_sizes, NULL, 0.0, ci_old_mono } },
- { HPDeskJetPlus, pcl_level_3plus_DJ500,
- { "HP DeskJet Plus", hpdj500_sizes, NULL, 0.0, ci_old_mono } },
- { HPDJPortable, pcl_level_3plus_S5,
- { "HP DeskJet Portable", hpdj3xx_sizes, NULL, 0.0, ci_old_mono } },
- /* DJ3/4 p. 2: This printer behaves as the 550C without the colour
- cartridge. */
- { HPDJ310, pcl_level_3plus_S5,
- { "HP DeskJet 310", hpdj3xx_sizes, NULL, 50*BP_PER_DOT, ci_hpdj500c } },
- /* DJ3/4 p. 3: The 3xx DeskJets with the black cartridge installed behave
- identically to the DJ Portable, with the colour cartridge they can be
- treated as the DJ 500C. */
- { HPDJ320, pcl_level_3plus_S5,
- { "HP DeskJet 320", hpdj3xx_sizes, NULL, 50*BP_PER_DOT, ci_hpdj500c } },
- { HPDJ340, pcl_level_3plus_S5,
- { "HP DeskJet 340", hpdj3xx_sizes, NULL, 50*BP_PER_DOT, ci_hpdj500c } },
- { HPDJ400, pcl_level_3plus_S5,
- { "HP DeskJet 400", hpdj400_sizes, NULL, 0.0, ci_hpdj500c } },
- /* DJ3/4 p. 3 and p. 6. */
- { HPDJ500, pcl_level_3plus_DJ500,
- {"HP DeskJet 500", hpdj500_sizes, NULL, 0.0, ci_old_mono } },
- { HPDJ500C, pcl_level_3plus_S5,
- { "HP DeskJet 500C", hpdj500c_sizes, NULL, 0.17*BP_PER_IN, ci_hpdj500c } },
- { HPDJ510, pcl_level_3plus_S5,
- { "HP DeskJet 510", common_sizes, NULL, 0.0, ci_old_mono } },
- { HPDJ520, pcl_level_3plus_S5,
- { "HP DeskJet 520", common_sizes, NULL, 0.0, ci_old_mono } },
- { HPDJ540, pcl_level_3plus_S68,
- { "HP DeskJet 540", hpdj540_sizes, hpdj540_custom_sizes,
- 0.13*BP_PER_IN, ci_hpdj540 } },
- { HPDJ550C, pcl_level_3plus_S5,
- { "HP DeskJet 550C", common_sizes, NULL, 0.13*BP_PER_IN, ci_hpdj5xx_cmyk }},
- { HPDJ560C, pcl_level_3plus_S5,
- { "HP DeskJet 560C", common_sizes, NULL, 0.13*BP_PER_IN, ci_hpdj5xx_cmyk }},
- { pcl3_generic_old, pcl_level_3plus_ERG_both,
- { "unspecified PCL-3+ printer (old)", common_sizes, NULL, 0.0, ci_any } },
- { HPDJ600, pcl_level_3plus_S68,
- { "HP DeskJet 600", hpdj6xx_and_8xx_sizes, hpdj_6xx_and_8xx_custom_sizes,
- 0.13*BP_PER_IN, ci_hpdj600 } },
- { HPDJ660C, pcl_level_3plus_S68,
- { "HP DeskJet 660C", hpdj660c_sizes, hpdj_6xx_and_8xx_custom_sizes,
- 0.13*BP_PER_IN, ci_hpdj6xx } },
- { HPDJ670C, pcl_level_3plus_S68,
- { "HP DeskJet 670C", hpdj660c_sizes, hpdj_6xx_and_8xx_custom_sizes,
- 0.13*BP_PER_IN, ci_hpdj6xx } },
- /* This printer can be treated as the DJ 660C (DJ6/8 p. 2). */
- { HPDJ680C, pcl_level_3plus_S68,
- { "HP DeskJet 680C", hpdj680c_sizes, hpdj_6xx_and_8xx_custom_sizes,
- 0.13*BP_PER_IN, ci_hpdj6xx } },
- { HPDJ690C, pcl_level_3plus_S68,
- { "HP DeskJet 690C", hpdj680c_sizes, hpdj_6xx_and_8xx_custom_sizes,
- 0.13*BP_PER_IN, ci_hpdj6xx } },
- { HPDJ850C, pcl_level_3plus_S68,
- { "HP DeskJet 850C", hpdj850c_sizes, hpdj850c_custom_sizes,
- 0.0, ci_hpdj85x } },
- { HPDJ855C, pcl_level_3plus_S68,
- { "HP DeskJet 855C", hpdj850c_sizes, hpdj850c_custom_sizes,
- 0.0, ci_hpdj85x } },
- /* I'm treating the 870C and the 890C just as the 85xCs. */
- { HPDJ870C, pcl_level_3plus_S68,
- { "HP DeskJet 870C", hpdj850c_sizes, hpdj850c_custom_sizes,
- 0.0, ci_hpdj85x } },
- { HPDJ890C, pcl_level_3plus_S68,
- { "HP DeskJet 890C", hpdj850c_sizes, hpdj850c_custom_sizes,
- 0.0, ci_hpdj85x } },
- { HPDJ1120C, pcl_level_3plus_S68,
- { "HP DeskJet 1120C", hpdj1120c_sizes, hpdj1120c_custom_sizes,
- 0.0, ci_hpdj1120c } },
- { pcl3_generic_new, pcl_level_3plus_S68,
- {"unspecified PCL-3+ printer",
- hpdj850c_sizes, any_custom_sizes, 0.0, ci_any }}
-};
-
-/*****************************************************************************/
-
-#ifndef NDEBUG
-
-static int checked = 0;
-
-static void check(void)
-{
- int j;
-
- /* Check that 'pcl3_printers[]' is indexed by printer code */
- for (j = 0; j < array_size(pcl3_printers); j++)
- assert(pcl3_printers[j].id == j);
-
- checked = 1;
-
- return;
-}
-
-#endif /* !NDEBUG */
-
-/******************************************************************************
-
- Function: pcl3_fill_defaults
-
- This function overwrites all fields in '*data' irrespective of their old
- contents and replaces them with default values acceptable for the printer.
- In particular, everything which is printer-specific and cannot be chosen by
- the user will be set in accordance with 'printer'.
-
-******************************************************************************/
-
-void pcl3_fill_defaults(pcl_Printer printer, pcl_FileData *data)
-{
-#ifndef NDEBUG
- if (!checked) check();
-#endif /* !NDEBUG */
-
- /* Set everything to zero */
- memset(data, 0, sizeof(pcl_FileData));
-
- /* Data which must not be zero */
- /* At present, every printer listed here supports 300 ppi monochrome data
- with two intensity levels. Hence we need not look at the printer
- description. */
- data->number_of_colorants = 1;
- data->colorant_array[0].hres = data->colorant_array[0].vres = 300;
- data->colorant_array[0].levels = 2;
-
- /* Data which are fixed by the printer model */
- data->level = pcl3_printers[printer].level;
-
- /* Data for which zero is acceptable but not sensible */
- data->duplex = -1; /* no simplex/duplex requests */
- data->dry_time = -1; /* request no dry time */
- switch (printer) {
- case HPDeskJet:
- /*FALLTHROUGH*/
- case HPDeskJetPlus:
- /*FALLTHROUGH*/
- case HPDJ500:
- /* The DJ 500 does not support method 9 but it does support method 3
- (TRG500). I am guessing that the same is true for the HP DeskJet and
- the HP DeskJet Plus. */
- data->compression = pcl_cm_delta;
- break;
- case pcl3_generic_old:
- /*FALLTHROUGH*/
- case pcl3_generic_new:
- /* All HP drivers I have seen use method 2 when writing a PCL file to
- disk. Presumably, this is the most portable compression method. */
- data->compression = pcl_cm_tiff;
- break;
- default:
- /* The best compression method, but not always supported. */
- data->compression = pcl_cm_crdr;
- }
-
- /* Derived data */
- pcl3_set_oldquality(data);
-
- return;
-}
diff --git a/gs/contrib/pcl3/src/pclcap.h b/gs/contrib/pcl3/src/pclcap.h
deleted file mode 100644
index 3ae4cf15b..000000000
--- a/gs/contrib/pcl3/src/pclcap.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/******************************************************************************
- File: $Id: pclcap.h,v 1.10 2000/11/19 07:05:17 Martin Rel $
- Contents: Header for describing capabilities of PCL printers
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany. E-mail: Martin.Lottermoser@t-online.de.
-
-*******************************************************************************
-* *
-* Copyright (C) 2000 by Martin Lottermoser *
-* All rights reserved *
-* *
-******************************************************************************/
-
-#ifndef _pclcap_h /* Inclusion protection */
-#define _pclcap_h
-
-/* Configuration management identification */
-#pragma ident "@(#)$Id: pclcap.h,v 1.10 2000/11/19 07:05:17 Martin Rel $"
-
-/*****************************************************************************/
-
-#include "gdeveprn.h"
-#include "pclgen.h"
-
-/*****************************************************************************/
-
-/* Identifiers for printers (26) */
-typedef enum {
- HPDeskJet,
- HPDeskJetPlus,
- HPDJPortable, /* belongs to the 3xx family (DJ3/4 p. 1) */
- HPDJ310,
- HPDJ320,
- HPDJ340,
- HPDJ400,
- HPDJ500,
- HPDJ500C,
- HPDJ510, HPDJ520, /* may be treated identically (TRG500 p. 1-3) */
- HPDJ540,
- HPDJ550C,
- HPDJ560C,
- pcl3_generic_old,
- HPDJ600,
- HPDJ660C, HPDJ670C, /* programmatically identical (DJ6/8 p. 2) */
- HPDJ680C,
- HPDJ690C,
- HPDJ850C, HPDJ855C,
- /* HP refers to them collectively as "HP DJ85xC" (DJ6/8) */
- HPDJ870C,
- HPDJ890C,
- HPDJ1120C,
- pcl3_generic_new
-} pcl_Printer;
-
-/*****************************************************************************/
-
-/* PCL printer description */
-typedef struct {
- pcl_Printer id;
- pcl_Level level;
-
- eprn_PrinterDescription desc;
-} pcl_PrinterDescription;
-
-extern const pcl_PrinterDescription pcl3_printers[];
- /* This array is indexed by the values of 'pcl_Printer'. */
-
-/*****************************************************************************/
-
-extern void pcl3_fill_defaults(pcl_Printer printer, pcl_FileData *data);
-
-/*****************************************************************************/
-
-#endif /* Inclusion protection */
diff --git a/gs/contrib/pcl3/src/pclcomp.c b/gs/contrib/pcl3/src/pclcomp.c
deleted file mode 100644
index 263f70f31..000000000
--- a/gs/contrib/pcl3/src/pclcomp.c
+++ /dev/null
@@ -1,757 +0,0 @@
-/******************************************************************************
- File: $Id: pclcomp.c,v 1.11 2000/10/07 17:51:57 Martin Rel $
- Contents: Implementation of PCL compression routines
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany. E-mail: Martin.Lottermoser@t-online.de.
-
-*******************************************************************************
-* *
-* Copyright (C) 1996, 1997, 1998, 2000 by Martin Lottermoser *
-* All rights reserved *
-* *
-*******************************************************************************
-
- If you compile with NDEBUG defined, some runtime checks for programming
- errors (mine and the interface's user's) are omitted.
-
-******************************************************************************/
-
-/* Configuration management identification */
-#ifndef lint
-static const char
- cm_id[] = "@(#)$Id: pclcomp.c,v 1.11 2000/10/07 17:51:57 Martin Rel $";
-#endif
-
-/*****************************************************************************/
-
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE 500
-#endif
-
-/* Interface definition */
-#include "pclgen.h"
-
-/* Standard headers */
-#include <assert.h>
-#include <string.h>
-
-/*****************************************************************************/
-
-/* For TIFF compression, we need the two's complement representation of
- numbers in the range [-127, -1], expressed in a 'pcl_Octet'.
-
- The macro neg() must accept as an argument an 'int' expression with a value
- in that range and convert it such that the result can be assigned to a
- variable of type 'pcl_Octet' with the result that the value of the latter
- becomes the two's complement representation of the number with respect to
- 256.
-
- On most machines one can use a simple assignment. However, the C standard
- specifies the behaviour in these cases (signed to unsigned where the source
- has more bits than the target and the source value is negative) to be
- implementation-defined. Hence the need for a portable solution.
- Define PCLCOMP_NEG if you don't like it.
-*/
-
-#ifdef PCLCOMP_NEG
-#define neg(number) (number)
-#else
-#define neg(number) (256 + (number))
-#endif
-
-/******************************************************************************
-
- Function: compress_runlength
-
- This function performs runlength encoding.
-
- Runlength encoding consists in preceding each octet by a repeat count octet
- the value of which is one less than the repeat count.
-
- 'in' and 'incount' describe the row to be compressed, 'out' an area of at
- least 'maxoutcount' octets to which the result is to be written. The function
- returns the number of octets written or a negative value on error.
-
- 'incount' may be zero, in which case the values of the other arguments are
- irrelevant. Otherwise, 'in' must be non-NULL, and if 'maxoutcount' is positive
- 'out' must be non-NULL as well.
-
-******************************************************************************/
-
-static int compress_runlength(const pcl_Octet *in, int incount, pcl_Octet *out,
- int maxoutcount)
-{
- int available = maxoutcount;
-
- /* Here 'incount' is the number of octets to be encoded and 'in' points to
- the first of them. 'available' is the number of octets available in the
- output array and 'out' points to the first of them. */
- while (incount > 0 && available > 1) {
- int count = 0;
-
- out++; /* skip repetition count octet, to be filled in later */
- *out = *in;
- do {
- in++; incount--; count++;
- } while (incount > 0 && *in == *out && count < 256);
- *(out - 1) = count - 1;
- out++; available -= 2;
- }
-
- if (incount > 0) return -1;
- return maxoutcount - available;
-}
-
-/******************************************************************************
-
- Function: compress_tiff
-
- This function performs TIFF compression (compression method 2).
-
- 'in' and 'incount' describe the row to be compressed, 'out' an area of at
- least 'maxoutcount' octets to which the result is to be written. The function
- returns the number of octets written or a negative value on error.
-
- 'in' must be non-NULL, 'incount' must be positive, 'maxoutcount' must be
- non-negative, and 'out' must be non-NULL is 'maxoutcount' is positive.
-
- TIFF compression creates an octet stream consisting of three kinds of
- octet sequences:
- - an octet with value in the range [-127, -1] (two's complement)
- followed by a single octet: this means the second octet is to be
- repeated -<first octet>+1 times,
- - an octet with value in the range [0, 127]: this means the next
- <first octet>+1 octets have not been compressed,
- - an octet with the value -128: this is a no-op and must be ignored.
- The first octet determining the kind of sequence is called the "control
- byte".
-
- This routine generates an output string with a length which is minimal
- for TIFF compression (if it doesn't, it's a bug). Readability of the code
- and minimal execution speed were secondary considerations.
-
- I have implemented this as a finite state machine. As can be seen from
- the code, I sacrificed the rules of structured programming for this,
- because I found a state transition diagram much more intelligible
- than anything I could code. I then simply transferred it into C.
-
-******************************************************************************/
-
-static int compress_tiff(const pcl_Octet *in, int incount, pcl_Octet *out,
- int maxoutcount)
-{
- pcl_Octet
- last; /* a remembered octet before the current 'in' value */
- const pcl_Octet
- *end = in + incount - 1; /* last position in 'in' */
- int
- available = maxoutcount, /* number of free octets left in 'out' */
- repeated, /* repeat count during a compressed sequence */
- stored; /* store count during a non-compressed sequence */
-
- state1:
- /* No octet is held over to be treated, 'in' points to the next one */
- if (in == end) {
- /* This is the last octet and a single one. */
- if (available < 2) return -1;
- *out = 0; out++; /* control byte */
- *out = *in;
- available -= 2;
- goto finished;
- }
- last = *in; in++; /* Fetch one octet and remember it. */
- /* to state2 */
-
-
- state2:
- /* One octet to be treated is in 'last', 'in' points to the next. */
- if (*in != last) {
- if (available < 3) return -1;
- out++; available--; /* Skip control byte to be filled in later */
- stored = 0;
- goto state4;
- }
- if (available < 2) return -1;
- repeated = 2;
- /* to state3 */
-
-
- state3:
- /* We have read 'repeated' occurrences of 'last', 'in' is positioned on
- the last octet read. It is true that 2 <= repeated < 128 and
- 2 <= available. */
- do {
- if (in == end) break;
- in++;
- if (*in != last) break;
- repeated++;
- } while (repeated < 128);
-
- /* Had to stop accumulating, for whatever reason. Write results. */
- *out = neg(-repeated + 1); out++; /* control byte */
- *out = last; out++;
- available -= 2;
-
- /* Decide where to go from here */
- if (*in != last) goto state1;
- if (in == end) goto finished;
- in++;
- goto state1;
-
-
- state4:
- /* We have read 'stored'+2 octets, 0 <= stored <= 126. All except the
- last two have already been stored before the current value of 'out',
- leaving space for the control byte at out[-stored-1]. The last two
- octets can be found in 'last' and '*in', and they are not identical.
- We also know that 'available' >= 2.
- */
- do {
- *out = last; stored++; available--; out++;
- if (in == end) {
- *out = *in; stored++; available--;
- out[-stored] = stored - 1; /* control byte */
- goto finished;
- }
- if (available < 2) return -1;
- last = *in;
- in++;
- } while (*in != last && stored <= 126);
-
- if (*in == last) {
- if (stored < 126) goto state5;
- out[-stored-1] = stored - 1; /* control byte */
- repeated = 2;
- goto state3;
- }
-
- /* stored == 127, available >= 2 */
- *out = last; stored++; available--; out++;
- out[-stored-1] = stored - 1; /* control byte */
- goto state1;
-
- state5:
- /* We have read 'stored'+2 octets, 'stored' < 126. 'stored' of them have
- been stored before 'out' with the control byte still to be written to
- out[-stored-1]. The last two octets can be found in 'last' and '*in',
- and they are identical. We also know 2 <= available. */
- if (in == end) {
- *out = last; out++;
- *out = *in;
- stored += 2; available -= 2;
- out[-stored] = stored - 1; /* control byte */
- goto finished;
- }
- in++;
- if (*in == last) {
- out[-stored-1] = stored - 1; /* control byte */
- repeated = 3;
- goto state3;
- }
- if (available < 3) return -1;
- *out = last; stored++; available--; out++; /* The first repeated octet */
- goto state4;
-
-
- finished:
- return maxoutcount - available;
-}
-
-#undef neg
-
-/******************************************************************************
-
- Function: write_delta_replacement
-
- This function writes a replacement string for delta compression (method 3),
- i.e. the sequence of command byte, optional extension offset bytes, and the
- replacement bytes.
-
- 'out' points to a sequence of at least 'available' octets to which the string
- is to be written. 'reloffset' is the "left offset" value for the replacement.
- 'in' points to a sequence of 'replace_count' octets to be replaced.
- 'replace_count' must lie between 1 and 8, inclusive.
-
- This function returns a negative value on error or the number of octets
- written otherwise.
-
-******************************************************************************/
-
-static int write_delta_replacement(pcl_Octet *out, int available, int reloffset,
- const pcl_Octet *in, int replace_count)
-{
- int used;
- assert(1 <= replace_count && replace_count <= 8);
-
- /* Prepare the command byte and, possibly, the extension offset bytes */
- used = 1;
- if (available < used) return -1;
- *out = (replace_count - 1) << 5;
- if (reloffset < 31) {
- *out++ += reloffset;
- }
- else {
- /* Large offset */
- *out++ += 31;
- reloffset -= 31;
- used += reloffset/255 + 1;
- if (available < used) return -1;
- while (reloffset >= 255) {
- *out++ = 255;
- reloffset -= 255;
- }
- *out++ = reloffset;
- }
-
- /* Transfer the replacement bytes */
- used += replace_count;
- if (available < used) return -1;
- while (replace_count > 0) {
- *out++ = *in++;
- replace_count--;
- }
-
- return used;
-}
-
-/******************************************************************************
-
- Function: compress_delta
-
- This function performs delta row compression (method 3).
-
- The pairs (in, incount) and (prev, prevcount) describe the row to be
- compressed and the row sent last (seed row), of course in uncompressed
- form. (out, maxcount) refers to a storage area of 'maxoutcount' length to
- which the compressed result for 'in' is to be written.
- All three octet strings must be valid and any may be zero.
-
- It is assumed that any difference in length between 'in' and 'prev' is
- (logically) due to trailing zero octets having been suppressed in the shorter
- of the two.
-
- The function returns the number of octets written to 'out' (a zero value is
- possible and refers to a row identical with the one sent last), or a negative
- value on error.
-
-******************************************************************************/
-
-/* First a macro needed several times for comparing old and new row.
- Because we really need string substitution for the 'invalue', 'prevvalue'
- and 'repstart' parameters this cannot be realized by a function.
- This loop depends on the following variables external to it:
- pos, absoffset, out, opos, maxoutcount.
-*/
-#define delta_loop(bound, invalue, prevvalue, repstart) \
- while (pos < bound) { \
- if (invalue != prevvalue) { \
- int reloffset = pos - absoffset; /* "left offset" */ \
- absoffset = pos; /* first different octet */ \
- \
- /* Collect different octets, at most 8 */ \
- do pos++; \
- while (pos < bound && pos < absoffset + 8 && invalue != prevvalue); \
- /* All the octets with positions in [absoffset, pos) have to */ \
- /* be replaced, and there are at most 8 of them. */ \
- \
- /* Write the replacement string */ \
- { \
- int written; \
- written = write_delta_replacement(out + opos, maxoutcount - opos, \
- reloffset, repstart, pos - absoffset); \
- if (written < 0) return -1; \
- opos += written; \
- } \
- absoffset = pos; \
- } \
- else pos++; \
- }
-
-
-static int compress_delta(const pcl_Octet *in, int incount,
- const pcl_Octet *prev, int prevcount, pcl_Octet *out, int maxoutcount)
-{
- int
- absoffset, /* absolute offset (starting with zero) */
- mincount, /* min(incount, prevcount) */
- opos, /* next position in the output */
- pos; /* next position in the input rows */
-
- /* Treat the special case of a zero output buffer (actually, the bad case is
- merely the one where 'out' is NULL) */
- if (maxoutcount == 0) {
- if (incount == prevcount &&
- (incount == 0 || memcmp(in, prev, incount) == 0)) return 0;
- /* Can there be machines where memcmp() compares bits beyond those
- used for the 'pcl_Octet's? Unlikely. */
- return -1;
- }
-
- /* Initialization */
- mincount = (incount < prevcount? incount: prevcount);
- pos = 0; opos = 0;
- absoffset = 0; /* first untreated octet, i.e. position after the last
- unaltered octet. */
-
- /* Loop over parts common to this and the last row */
- delta_loop(mincount, in[pos], prev[pos], in + absoffset);
- /* Note: This artificial separation at the 'mincount' position (logically,
- both rows have equal length) is simpler to program but can result in
- the compressed row being 1 octet longer than necessary. */
-
- /* Treat length differences between 'in' and 'prev'. */
- if (mincount < incount) {
- /* We have to send all octets in the 'in' row which are non-zero. */
- delta_loop(incount, in[pos], 0, in + absoffset);
- }
- else {
- /* We have to replace all non-zero octets in the previous row. */
- pcl_Octet zero_block[8] = {0, 0, 0, 0, 0, 0, 0, 0};
- delta_loop(prevcount, 0, prev[pos], zero_block);
- }
- assert(opos <= maxoutcount);
-
- return opos;
-}
-
-#undef delta_loop
-
-/******************************************************************************
-
- Function: write_crdr_header
-
- This function writes the header for compressed replacement delta row encoding
- (method 9). It returns the number of octets written or a negative value on
- error.
-
-******************************************************************************/
-
-static int write_crdr_header(pcl_bool compressed, pcl_Octet *out,
- int maxoutcount, int reloffset, int repcount)
-{
- int
- maxvalue,
- shift,
- used = 1; /* command byte */
-
- /* The command byte */
- if (maxoutcount < 1) return -1;
- if (compressed) *out = 0x80; /* control bit: compressed */
- else *out = 0; /* control bit: uncompressed */
- maxvalue = (compressed? 3: 15);
- shift = (compressed? 5: 3);
- if (reloffset < maxvalue) {
- *out += reloffset << shift;
- reloffset = -1;
- }
- else {
- *out += maxvalue << shift;
- reloffset -= maxvalue;
- }
- /* The value to be encoded for 'repcount' is different from 'repcount': */
- if (compressed) repcount -= 2;
- else repcount--;
- assert(repcount >= 0);
- maxvalue = (compressed? 31: 7);
- if (repcount < maxvalue) {
- *out += repcount;
- repcount = -1;
- }
- else {
- *out += maxvalue;
- repcount -= maxvalue;
- }
- out++;
-
- /* Optional offset bytes */
- while (reloffset >= 0) {
- if (used >= maxoutcount) return -1;
- *out++ = (reloffset >= 255? 255: reloffset);
- reloffset -= 255;
- used++;
- }
-
- /* Optional replacement count bytes */
- while (repcount >= 0) {
- if (used >= maxoutcount) return -1;
- *out++ = (repcount >= 255? 255: repcount);
- repcount -= 255;
- used++;
- }
-
- return used;
-}
-
-/******************************************************************************
-
- Function: write_crdr_uncompressed
-
- This function returns the number of octets written or a negative value on
- error.
-
- 'in' may be NULL, indicating a sequence of 'repcount' null octets.
- This case is practically irrelevant except for 'repcount' == 1.
-
-******************************************************************************/
-
-static int write_crdr_uncompressed(pcl_Octet *out, int maxoutcount,
- int reloffset, const pcl_Octet *in, int repcount)
-{
- int used = write_crdr_header(FALSE, out, maxoutcount, reloffset, repcount);
- if (used < 0 || used + repcount > maxoutcount) return -1;
-
- out += used;
- if (in == NULL) memset(out, 0, repcount*sizeof(pcl_Octet));
- else memcpy(out, in, repcount*sizeof(pcl_Octet));
-
- return used + repcount;
-}
-
-/******************************************************************************
-
- Function: write_crdr_compressed
-
- This function returns the number of octets written or a negative value on
- error.
-
-******************************************************************************/
-
-static int write_crdr_compressed(pcl_Octet *out, int maxoutcount, int reloffset,
- pcl_Octet in, int repeat_count)
-{
- int used = write_crdr_header(TRUE, out, maxoutcount, reloffset, repeat_count);
- if (used < 0 || used >= maxoutcount) return -1;
-
- out += used;
- *out = in;
-
- return used + 1;
-}
-
-/******************************************************************************
-
- Function: write_crdr_replacement
-
- This function returns the number of octets written to 'out' or a negative
- value on error.
-
- 'in' may be NULL, indicating a sequence of 'repcount' null octets.
- 'repcount' must be positive.
-
-******************************************************************************/
-
-static int write_crdr_replacement(pcl_Octet *out, int maxoutcount,
- int reloffset, const pcl_Octet *in, int repcount)
-{
- const pcl_Octet *final;
- int written = 0;
-
- /* Treat the case of a null sequence */
- if (in == NULL) {
- if (repcount == 1)
- return write_crdr_uncompressed(out, maxoutcount, reloffset, in, repcount);
- return write_crdr_compressed(out, maxoutcount, reloffset, 0, repcount);
- }
-
- /* Loop over 'in', dividing it into sections at the boundaries of
- sequences of repeated octets. */
- final = in + repcount - 1;
- while (repcount > 0) {
- /* Advance 'bdup' over non-repeated octet */
- const pcl_Octet *bdup;
- bdup = in;
- while (bdup < final && *bdup != *(bdup + 1)) bdup++;
-
- /* If there is something either before a repeated section or before the
- end, encode it uncompressed. */
- if (in < bdup || bdup == final) {
- int incount = (bdup == final? repcount: bdup - in);
- int rc;
- rc = write_crdr_uncompressed(out + written, maxoutcount - written,
- reloffset, in, incount);
- if (rc < 0) return rc;
- written += rc;
- reloffset = 0;
- repcount -= incount;
- if (repcount > 0) in += incount;
- }
-
- /* If we have encountered a repeated section, encode it compressed.
- Note that the compressed version for a repetition is never longer than
- the uncompressed one, not even for a repeat count of 2, although in this
- case it might have equal length depending on the offset. */
- if (bdup < final) {
- const pcl_Octet *edup = bdup + 1;
- int incount, rc;
- while (edup < final && *(edup + 1) == *bdup) edup++;
- incount = edup - bdup + 1;
- rc = write_crdr_compressed(out + written, maxoutcount - written,
- reloffset, *bdup, incount);
- if (rc < 0) return rc;
- written += rc;
- reloffset = 0;
- repcount -= incount;
- if (repcount > 0) in = edup + 1;
- }
- }
-
- return written;
-}
-
-/******************************************************************************
-
- Function: compress_crdr
-
- This function performs compressed replacement delta row encoding (compression
- method 9).
-
- The pairs (in, incount) and (prev, prevcount) describe the row to be
- compressed and the row sent last (seed row), of course in uncompressed
- form. (out, maxcount) refers to a storage area of 'maxoutcount' length to
- which the compressed result for 'in' is to be written.
- All three octet strings must be valid and any may be zero.
-
- It is assumed that any difference in length between 'in' and 'prev' is
- (logically) due to trailing zero octets having been suppressed in the shorter
- of the two.
-
- The function returns the number of octets written to 'out' (a zero value is
- possible and refers to a row identical with the one sent last), or a negative
- value on error.
-
- This function and those it calls are very similar to the functions for delta
- row compression.
-
-******************************************************************************/
-
-/* Again, as for delta row compression, I'm using a macro for comparison. */
-#define crdr_loop(bound, invalue, prevvalue, repstart) \
- while (pos < bound) { \
- if (invalue == prevvalue) pos++; \
- else { \
- int reloffset = pos - absoffset, written; \
- absoffset = pos; \
- do pos++; while (pos < bound && invalue != prevvalue); \
- \
- written = write_crdr_replacement(out + opos, maxoutcount - opos, \
- reloffset, repstart, pos - absoffset); \
- if (written < 0) return written; \
- absoffset = pos; \
- opos += written; \
- } \
- }
-
-
-static int compress_crdr(const pcl_Octet *in, int incount,
- const pcl_Octet *prev, int prevcount, pcl_Octet *out, int maxoutcount)
-{
- int
- absoffset = 0,
- mincount = (incount < prevcount? incount: prevcount),
- opos = 0,
- pos = 0;
-
- /* Treat the special case of a zero output buffer (again, the bad case is
- merely the one where 'out' is NULL) */
- if (maxoutcount == 0) {
- if (incount == prevcount &&
- (incount == 0 || memcmp(in, prev, incount) == 0)) return 0;
- return -1;
- }
-
- crdr_loop(mincount, in[pos], prev[pos], in + absoffset);
- if (mincount < incount) {
- crdr_loop(incount, in[pos], 0, in + absoffset);
- }
- else {
- crdr_loop(prevcount, 0, prev[pos], NULL);
- }
-
- return opos;
-}
-
-#undef crdr_loop
-
-/******************************************************************************
-
- Function: pcl_compress
-
- This function compresses an octet string using the compression algorithm
- specified by 'method'.
-
- The arguments 'in' and 'out' must be non-NULL. They point to the data to be
- compressed ('in->length' octets starting at 'in->str') and the area to which
- the compressed result should be written (at most 'out->length' octets
- starting at 'out->str'). If '*in' and '*out' are both non-zero (see
- definitions above), their storage areas ('in->str' to
- 'in->str + in->length - 1' and 'out->str' to 'out->str + out->length - 1')
- should not overlap.
-
- If 'method' refers to a method entailing "vertical" compression, i.e.
- compression with respect to an octet string previously sent, 'prev' must
- point to this previous string. This is the case for methods 3 and 9.
- The variable is ignored otherwise and may be NULL. If it is needed, it should
- not overlap with the storage area of '*out'.
-
- The function returns a non-zero value in case of insufficient space in '*out'.
- In that situation, part of 'out->str' may have been overwritten already.
- Otherwise, a value of zero is returned and 'out->length' is set to the number
- of octets the compressed result occupies in 'out->str'.
-
-******************************************************************************/
-
-/* Test macro for an argument of type "pcl_OctetString *" */
-#define is_valid(s) \
- (s != NULL && ((s)->length == 0 || (s)->length > 0 && (s)->str != NULL))
-
-
-int pcl_compress(pcl_Compression method, const pcl_OctetString *in,
- const pcl_OctetString *prev, pcl_OctetString *out)
-{
- int result = -1;
-
- /* Prevent silly mistakes with the arguments */
- assert(is_valid(in) && is_valid(out) &&
- (method != pcl_cm_delta && method != pcl_cm_crdr || is_valid(prev)));
-
- /* Treat zero-length case for the "purely horizontal" methods */
- if (in->length == 0 && method != pcl_cm_delta && method != pcl_cm_crdr) {
- out->length = 0;
- return 0;
- }
-
- switch (method) {
- case pcl_cm_none: /* oh, well... */
- if (out->length <= in->length) {
- memcpy(out->str, in->str, in->length*sizeof(pcl_Octet));
- result = in->length;
- }
- break;
- case pcl_cm_rl:
- result = compress_runlength(in->str, in->length, out->str, out->length);
- break;
- case pcl_cm_tiff:
- result = compress_tiff(in->str, in->length, out->str, out->length);
- break;
- case pcl_cm_delta:
- result = compress_delta(in->str, in->length, prev->str, prev->length,
- out->str, out->length);
- break;
- case pcl_cm_crdr:
- result = compress_crdr(in->str, in->length, prev->str, prev->length,
- out->str, out->length);
- break;
- default:
- assert(0); /* Illegal value for compression method */
- /* If NDEBUG is defined, we fall through with the default value for
- 'result' which is -1, i.e., failure. */
- }
-
- /* Assign the length of the output octet string */
- if (result >= 0) {
- out->length = result;
- result = 0;
- }
-
- return result;
-}
diff --git a/gs/contrib/pcl3/src/pclgen.c b/gs/contrib/pcl3/src/pclgen.c
deleted file mode 100644
index 1f3dcdb16..000000000
--- a/gs/contrib/pcl3/src/pclgen.c
+++ /dev/null
@@ -1,1141 +0,0 @@
-/******************************************************************************
- File: $Id: pclgen.c,v 1.21 2001/04/29 10:37:08 Martin Rel $
- Contents: PCL-generating routines
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany. E-mail: Martin.Lottermoser@t-online.de.
-
-*******************************************************************************
-* *
-* Copyright (C) 1999, 2000, 2001 by Martin Lottermoser *
-* All rights reserved *
-* *
-*******************************************************************************
-
- In the implementation of these and other functions I have mainly used the
- following documents:
-
- - Hewlett-Packard
- "Technical Reference Guide for the HP DeskJet 500 Series Printers"
- First edition, October 1994
- Manual Part Number: C2170-90099
- (Quoted as "TRG500")
- - Hewlett-Packard
- "Hewlett-Packard 300 and 400 Series DeskJet Printers - Software Developer's
- Guide"
- January 1996
- (Quoted as "DJ3/4")
- - Hewlett-Packard
- "HP DeskJet 600/800 Series Printers - Software Developer's PCL Guide"
- Fifth edition, October 1997
- (Quoted as "DJ6/8")
- - Hewlett-Packard
- "DeskJet 1120C Printer - Software Developer's PCL Guide"
- First printing, December 1997. Version 1.0.
- (Quoted as "DJ1120C")
- - Hewlett-Packard
- "Printer Job Language Technical Reference Manual"
- Edition 10, October 1997. HP Part No. 5021-0380.
- (Quoted as "PJLTRM")
- - Lexmark
- "Printer Technical Reference, Version 1.1"
- First edition, February 1999
- (Quoted as "Lexmark-PTR". It deals with PCL 5 and PCL 6.)
-
- In addition, some other documents are quoted in a form like "BPD02926". These
- were obtained from http://www.hp.com, usually from the directory
- cposupport/printers/support_doc. BPD02926, for example, (a short description
- of PCL commands for series-800 DeskJets) could be found as the file
- bpd02926.html in that directory.
-
-******************************************************************************/
-
-/* Configuration management identification */
-#ifndef lint
-static const char
- cm_id[] = "@(#)$Id: pclgen.c,v 1.21 2001/04/29 10:37:08 Martin Rel $";
-#endif
-
-/*****************************************************************************/
-
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE 500
-#endif
-
-/* Standard headers */
-#include <assert.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* Special headers */
-#include "pclgen.h"
-
-/*****************************************************************************/
-
-/* Prefix for error messages */
-#define ERRPREF "? pclgen: "
-
-/* The usual array-size macro */
-#define array_size(a) (sizeof(a)/sizeof(a[0]))
-
-/* Macro to check whether an octet is an ASCII letter. Note that we can't use
- the isalpha() function because we might be operating in an internationalized
- environment. */
-#define is_letter(c) (0x41 <= (c) && (c) <= 0x5A || 0x61 <= (c) && (c) <= 0x7A)
-
-/* Same for digits */
-#define is_digit(c) (0x30 <= (c) && (c) <= 0x39)
-
-/******************************************************************************
-
- Function: pcl3_levels_to_planes
-
- This function returns ceiling(ld(levels)), the number of bitplanes needed to
- store the specified number of intensity levels, or 0 if 'levels' is zero.
- 'levels' must be <= (ULONG_MAX+1)/2.
-
-******************************************************************************/
-
-unsigned int pcl3_levels_to_planes(unsigned int levels)
-{
- unsigned long
- power = 1;
- unsigned int
- planes = 0;
- /* power == 2^planes */
-
- while (power < levels) {
- power *= 2; /* multiplication is faster than division */
- planes++;
- }
- /* levels == 0 or 2^(planes-1) < levels <= 2^planes */
-
- return planes;
-}
-
-/******************************************************************************
-
- Function: send_ERG
-
- This function sends an "End Raster Graphics" command to 'out', choosing its
- form according to 'level'.
-
-******************************************************************************/
-
-static void send_ERG(FILE *out, pcl_Level level)
-{
- /* PCL: End Raster Graphics/End Raster */
- fputs("\033*r", out);
- if (pcl_use_oldERG(level)) fputc('B', out);
- else if (level == pcl_level_3plus_ERG_both) fputs("bC", out);
- else fputc('C', out);
-
- return;
-}
-
-/******************************************************************************
-
- Function: pcl3_init_file
-
- This function must be called to initialize the printer before the first page.
- The 'data' should remain constant within a page. Whenever one changes 'data'
- between pages, this function should be called again.
-
- The function follows the return code rules described in pclgen.h. It will
- perform a number of validity checks on 'data'. No checks will be performed on
- fields like 'print_quality' which can be passed to the printer without having
- to be interpreted by this component.
-
- The routine will configure the printer such that the top left corner of the
- logical page is the top left corner of the printable area in raster space.
-
- The file 'out' should be a binary file for this and all other output
- functions.
-
-******************************************************************************/
-
-int pcl3_init_file(FILE *out, pcl_FileData *data)
-{
- pcl_bool needs_CRD = (data->level == pcl_level_3plus_CRD_only);
- /* Do we need Configure Raster Data? */
- int j;
- const pcl_ColorantState *colorant = NULL;
- unsigned int maxhres = 0, maxvres = 0; /* maximal resolutions in ppi */
-
- /* Check validity of the arguments */
- {
- pcl_bool invalid;
-
- invalid = (out == NULL || data == NULL);
- if (invalid)
- fputs(ERRPREF "Null pointer passed to pcl3_init_file().\n", stderr);
- else {
- /* Palette und colorants */
- switch(data->palette) {
- case pcl_no_palette:
- /*FALLTHROUGH*/
- case pcl_black: invalid = data->number_of_colorants != 1; break;
- case pcl_CMY: invalid = data->number_of_colorants != 3; break;
- case pcl_RGB: invalid = data->number_of_colorants != 3; break;
- case pcl_CMYK: invalid = data->number_of_colorants != 4; break;
- default: invalid = data->number_of_colorants <= 0;
- }
- if (invalid)
- fputs(ERRPREF
- "Palette specification and number of colorants are inconsistent.\n",
- stderr);
- else {
- if (data->colorant == NULL) colorant = data->colorant_array;
- else colorant = data->colorant;
-
- /* First pass over colorants: find minimal and maximal resolutions,
- check the number of intensity levels */
- data->minvres = colorant[0].vres;
- for (j = 0; j < data->number_of_colorants; j++) {
- if (colorant[j].hres <= 0 || colorant[j].vres <= 0) {
- invalid = TRUE;
- fprintf(stderr, ERRPREF
- "The resolution for colorant %d is not positive: %u x %u ppi.\n",
- j, colorant[j].hres, colorant[j].vres);
- }
- else {
- if (colorant[j].vres < data->minvres)
- data->minvres = colorant[j].vres;
- if (colorant[j].hres > maxhres) maxhres = colorant[j].hres;
- if (colorant[j].vres > maxvres) maxvres = colorant[j].vres;
- }
- if (colorant[j].levels < 2 || 0xFFFF < colorant[j].levels) {
- invalid = TRUE;
- fprintf(stderr, ERRPREF "The number of intensity levels for "
- "colorant %d is %u instead of at least 2 and at most 65535.\n",
- j, colorant[j].levels);
- /* Actually, DJ6/8 p. 68 requires the levels to be in the range
- 2-255, but as there are two octets available in the CRD format
- this seems unnecessarily strict. */
- }
- }
-
- /* Check for relations between resolutions and the need for CRD */
- if (!invalid) /* this implies that all resolutions are positive */
- for (j = 0; j < data->number_of_colorants; j++) {
- /* If there is more than one resolution or more than 2 levels we
- need CRD. Note that we compare with 'maxhres' in both lines: */
- if (maxhres != colorant[j].hres ||
- maxhres != colorant[j].vres || colorant[j].levels > 2)
- needs_CRD = TRUE;
-
- /* DJ6/8 states that the highest horizontal resolution must be a
- multiple of all lower horizontal resolutions and the same for
- the set of vertical resolutions. The reason is not given but
- these properties imply that it is possible to operate uniformly
- on a grid at the highest resolution.
- In contrast, the way in which raster data are transferred
- (strips with a height equal to the reciprocal of the lowest
- vertical resolution) logically requires that all vertical
- resolutions are multiples of the lowest vertical resolution.
- This condition is not stated in DJ6/8 but it is satisfied by
- all examples given in that document. This includes example 4 on
- page 72 which is meant to illustrate the maximum flexibility of
- format 2 and which describes a situation where the
- corresponding condition does not hold for the horizontal
- resolutions.
- */
- if (colorant[j].vres % data->minvres != 0) {
- invalid = TRUE;
- fprintf(stderr, ERRPREF
- "The vertical resolution for colorant %d (%u ppi) is not a "
- "multiple of the lowest vertical resolution (%u ppi).\n",
- j, colorant[j].vres, data->minvres);
- }
- if (maxhres % colorant[j].hres != 0) {
- invalid = TRUE;
- fprintf(stderr, ERRPREF
- "The highest horizontal resolution (%u ppi) is not a multiple "
- "of the horizontal resolution for colorant %d (%u ppi).\n",
- maxhres, j, colorant[j].hres);
- }
- if (maxvres % colorant[j].vres != 0) {
- invalid = TRUE;
- fprintf(stderr, ERRPREF
- "The highest vertical resolution (%u ppi) is not a multiple "
- "of the vertical resolution for colorant %d (%u ppi).\n",
- maxvres, j, colorant[j].vres);
- }
- }
- }
-
- if (needs_CRD && data->palette == pcl_RGB) {
- invalid = TRUE;
- if (data->level == pcl_level_3plus_CRD_only)
- fputs(ERRPREF
- "You can't use an RGB palette at the requested PCL level.\n",
- stderr);
- else
- fputs(ERRPREF "The specified structure of resolutions and intensity "
- "levels is not possible with an RGB palette.\n",
- stderr);
- }
- if (needs_CRD && !pcl_has_CRD(data->level)) {
- invalid = TRUE;
- fputs(ERRPREF "The specified structure of resolutions and intensity "
- "levels is not possible at the requested PCL level.\n", stderr);
- }
- if (data->palette == pcl_any_palette) {
- needs_CRD = TRUE;
- if (!pcl_has_CRD(data->level)) {
- invalid = TRUE;
- fputs(ERRPREF "The specified palette is not possible at the "
- "requested PCL level.\n", stderr);
- }
- }
- if (needs_CRD && (maxhres > 0xFFFF || maxvres > 0xFFFF)) {
- fputs(ERRPREF "Resolutions may be at most 65535 ppi when more than one "
- "resolution or more than two intensity levels are requested.\n",
- stderr);
- invalid = TRUE;
- }
- if (data->order_CMYK && data->palette != pcl_CMYK) {
- fputs(ERRPREF
- "Ordering bit planes as CMYK instead of KCMY is only meaningful\n"
- " for a CMYK palette.\n", stderr);
- invalid = TRUE;
- }
-
- /* Check PJL job name */
- if (data->PJL_job != NULL) {
- const unsigned char *s = (const unsigned char *)data->PJL_job;
-
- /* Permissible characters are HT and the octets 32-255 with the
- exception of '"' (PJLTRM, with some corrections). */
- while (*s != '\0' && (*s == '\t' || 32 <= *s && *s != '"')) s++;
- if (*s != '\0') {
- fprintf(stderr,
- ERRPREF "Illegal character in PJL job name (code 0x%02X).\n", *s);
- invalid = TRUE;
- }
-
- /* There is a maximum of 80 "significant characters" (PJLTRM).
- According to PJLTRM, p. D-8, "String too long" is a parser warning
- and leads to a part of the command being ignored. I play it safe.
- There would also be a warning for an empty string but we treat that
- case differently anyway (see below). */
- if (strlen(data->PJL_job) > 80) {
- fputs(ERRPREF "PJL job name is too long (more than 80 characters).\n",
- stderr);
- invalid = TRUE;
- }
- }
-
- /* Check PJL personality name */
- if (data->PJL_language != NULL) {
- const char *s = data->PJL_language;
-
- /* PJLTRM does not give explicit lexical conventions for personality
- names but from general considerations it should be an "alphanumeric
- variable". The latter must start with a letter and may consist of
- letters and digits. */
- if (is_letter(*s)) do s++; while (is_letter(*s) || is_digit(*s));
-
- if (*data->PJL_language == '\0') {
- fputs(ERRPREF "Empty PJL language name.\n", stderr);
- invalid = TRUE;
- }
- else if (*s != '\0') {
- fprintf(stderr,
- ERRPREF "Illegal character in PJL language name (code 0x%02X).\n",
- *s);
- invalid = TRUE;
- }
- }
- }
-
- if (invalid) return +1;
- }
-
- /* Practically every output file from an HP driver I have seen starts with
- 600 and one even with 9600 NUL characters. This seems unnecessary
- and is undocumented, but just in case that there are situations where it
- might make a difference, this module provides the capability. */
- for (j = 0; j < data->NULs_to_send; j++) fputc('\0', out);
-
- /* Issue PJL commands if requested. Most newer HP drivers for PCL-3 printers
- follow the NULs with a PJL statement to enter the PCL language
- interpreter. The language name varies (so far I've seen PCL3GUI and
- PCLSLEEK). Some drivers also generate JOB/EOJ statements.
- Interestingly enough, I have seen output from two HP drivers which, at
- the beginning of the job, generated first Printer Reset and then UEL.
- This is wrong (PJLTRM).
- */
- if (data->PJL_job != NULL || data->PJL_language != NULL) {
- fputs("\033%-12345X", out); /* Universal Exit Language (UEL) */
-
- /* Start of job */
- if (data->PJL_job != NULL) {
- fputs("@PJL JOB", out);
- if (*data->PJL_job != '\0') fprintf(out, " NAME=\"%s\"", data->PJL_job);
- fputc('\n', out);
- }
-
- /* Switch personality */
- if (data->PJL_language != NULL)
- fprintf(out, "@PJL ENTER LANGUAGE=%s\n", data->PJL_language);
- }
-
- /* PCL: Printer Reset */
- fputs("\033E", out);
-
- /* Additional initialization */
- if (data->init1.length > 0)
- fwrite(data->init1.str, sizeof(pcl_Octet), data->init1.length, out);
-
- /* Page layout initialization */
- fprintf(out,
- "\033&l%da" /* PCL: Page Size */
- "0o" /* PCL: Page Orientation/Orientation: portrait */
- "0L", /* PCL: Perforation Skip Mode: off. This also effectively sets
- the PCL top margin to zero. */
- (int) data->size
- );
-
- /* Media source */
- if (data->media_source != 0)
- fprintf(out, "\033&l%dH", data->media_source); /* PCL: Media Source */
- /* Note that a value of zero for the Media Source command means
- "eject the current page". Hence we are losing no functionality by
- reserving 0 to mean "no Media Source request". */
- if (data->media_source != 2 && data->manual_feed) fputs("\033&l2H", out);
- /* I am using two Media Source commands here in case the value 2 means
- "manual feed from the last selected media source" on some printer. */
-
- /* Media destination. This is included here merely in the hope that, if a
- PCL-3 printer should support such a feature, the command used is the same
- as in PCL 5/6. At present, I know of no such printer. */
- if (data->media_destination != 0)
- fprintf(out, "\033&l%dG", data->media_destination);
- /* PCL: Paper Destination (BPL02705). A value of zero means "auto select".
- */
-
- /* Duplex. Again, I have only PCL-5 documentation for this, but in this case
- I know that the DJ 970C uses the command. */
- if (data->duplex != -1)
- fprintf(out, "\033&l%dS", data->duplex); /* PCL: Simplex/Duplex Print */
-
- /* Print quality */
- if (pcl_use_oldquality(data->level)) {
- fprintf(out, "\033*r%dQ", data->raster_graphics_quality);
- /* PCL: Raster Graphics Quality */
- if (data->level > pcl_level_3plus_DJ500)
- fprintf(out, "\033*o%dQ", data->shingling);
- /* PCL: Set Raster Graphics Shingling/Mechanical Print Quality */
- if (data->depletion != 0)
- /* According to TRG500 p. 6-32, depletion makes no sense for monochrome
- data. Besides, not all printers react to this command. Hence I'm
- handing the decision to the caller. Note that permitted values are 1-5.
- */
- fprintf(out, "\033*o%dD", data->depletion);
- /* PCL: Set Raster Graphics Depletion */
- }
- else
- fprintf(out,
- "\033&l%dM" /* PCL: Media Type */
- "\033*o%dM", /* PCL: Print Quality */
- data->media_type,
- data->print_quality
- );
-
- /* PCL: Set Dry Time/Dry Timer. This command is ignored by newer printers
- and is obsolete for every printer supporting the new Media Type and Print
- Quality commands. Because I am uncertain about what "current" means in
- the description of the value 0 ("default dry time for the current print
- quality", TRG500 p. 2-4), I'm putting the command here after the quality
- commands. */
- if (data->dry_time >= 0) fprintf(out, "\033&b%dT", data->dry_time);
-
- /* End Raster Graphics. This provides a known graphics state, see
- TRG500 p. 6-25, but is probably superfluous here because of the Printer
- Reset command. */
- send_ERG(out, data->level);
-
- if (data->level != pcl_level_3plus_CRD_only)
- /* PCL: Set Raster Graphics Resolution/Raster Resolution */
- fprintf(out, "\033*t%uR", maxhres < maxvres? maxvres: maxhres);
- /* If different x and y resolutions have been demanded but the printer does
- not support the combination, choosing the larger value here will prevent
- printing beyond the sheet---provided the printer accepts this resolution.
- */
-
- /* Set PCL unit to reciprocal of largest resolution */
- if (data->level >= pcl_level_3plus_S68)
- fprintf(out, "\033&u%uD", maxhres < maxvres? maxvres: maxhres);
- /* PCL: Unit of Measure. This is not documented but merely mentioned in
- DJ6/8. All HP drivers for newer printers I've looked at (admittedly not
- many) generate this command, including a driver for the DJ 540.
- Actually, as the routines here send a Move CAP Horizontal/Vertical
- (PCL Units) command only for position 0, the units should be irrelevant.
- */
-
- /* Colour planes */
- if (data->level != pcl_level_3plus_CRD_only &&
- data->palette != pcl_no_palette && data->palette != pcl_any_palette)
- fprintf(out, "\033*r%dU",
- /* PCL: Set Number of Planes per Row/Simple Color */
- data->palette == pcl_RGB? 3: /* RGB palette */
- -data->number_of_colorants); /* (K)(CMY) palette */
-
- /* Configure Raster Data */
- if (needs_CRD) {
- fprintf(out, "\033*g%uW" /* PCL: Configure Raster Data */
- "\002%c", /* Format 2: Complex Direct Planar */
- 2 + 6*data->number_of_colorants, data->number_of_colorants);
-
- for (j = 0; j < data->number_of_colorants; j++)
- fprintf(out, "%c%c%c%c%c%c",
- /* Note that %c expects an 'int' (and converts it to 'unsigned char').
- */
- colorant[j].hres/256, colorant[j].hres%256,
- colorant[j].vres/256, colorant[j].vres%256,
- colorant[j].levels/256, colorant[j].levels%256);
- }
-
- if (ferror(out)) {
- fputs(ERRPREF "Unidentified system error while writing the output file.\n",
- stderr);
- return -1;
- }
-
- /* Additional initialization */
- if (data->init2.length > 0)
- fwrite(data->init2.str, sizeof(pcl_Octet), data->init2.length, out);
-
- /* Determine and set the number of bit planes */
- if (data->palette == pcl_CMY || data->palette == pcl_RGB)
- data->black_planes = 0;
- else data->black_planes =
- pcl3_levels_to_planes(colorant[0].levels)*(colorant[0].vres/data->minvres);
- data->number_of_bitplanes = 0;
- for (j = 0; j < data->number_of_colorants; j++)
- data->number_of_bitplanes +=
- pcl3_levels_to_planes(colorant[j].levels)*
- (colorant[j].vres/data->minvres);
-
- return 0;
-}
-
-/******************************************************************************
-
- Function: pcl3_begin_page
-
- This function sets CAP on the top margin of the logical page. It may only
- be called after pcl3_init_file() and not while a page is still open.
-
-******************************************************************************/
-
-int pcl3_begin_page(FILE *out, pcl_FileData *global)
-{
- fputs("\033*p0Y", out);
- /* PCL: Vertical Cursor Positioning by Dots/Move CAP Vertical (PCL Units) */
-
- return 0;
-}
-
-/******************************************************************************
-
- Function: pcl3_begin_raster
-
- This function starts raster mode at the left margin of the logical page
- and at the current height.
-
- The function may only be called within a page and not in raster mode.
-
- The raster data structure '*data' will be checked for validity and parts of
- the data may be modified. In particular, the caller should already have
- allocated appropriate storage in the 'next' and, for differential compression
- methods, 'previous' arrays. Until raster mode is terminated, the caller may
- only modify the storage currently pointed to by the pointers in 'next' and
- their corresponding length fields.
-
-******************************************************************************/
-
-int pcl3_begin_raster(FILE *out, pcl_RasterData *data)
-{
- const pcl_FileData *global = NULL;
- int j;
-
- /* Check 'data' for validity */
- {
- pcl_bool invalid;
-
- invalid = (data == NULL || data->global == NULL || data->next == NULL ||
- data->workspace[0] == NULL || data->workspace_allocated <= 0);
- if (!invalid) {
- global = data->global;
-
- for (j = 0;
- j < global->number_of_bitplanes &&
- (data->next[j].length == 0 || data->next[j].str != NULL);
- j++);
- invalid = j < global->number_of_bitplanes;
- if (!invalid && pcl_cm_is_differential(global->compression)) {
- invalid = (data->previous == NULL ||
- global->compression == pcl_cm_delta &&
- data->workspace[1] == NULL);
- if (!invalid) {
- for (j = 0;
- j < global->number_of_bitplanes &&
- (data->previous[j].length == 0 || data->previous[j].str != NULL);
- j++);
- invalid = j < global->number_of_bitplanes;
- }
- }
- }
-
- if (invalid) {
- fputs(ERRPREF "Invalid data structure passed to pcl3_begin_raster().\n",
- stderr);
- return +1;
- }
- }
-
- /* Allocate the seed plane array */
- data->seed_plane = (pcl_OctetString **)
- malloc(global->number_of_bitplanes*sizeof(pcl_OctetString *));
- if (data->seed_plane == NULL) {
- fputs(ERRPREF "Memory allocation failure in pcl3_begin_raster().\n",
- stderr);
- return -1;
- }
- memset(data->seed_plane, 0,
- global->number_of_bitplanes*sizeof(pcl_OctetString *));
-
- /* Use the seed plane array for differential compression methods */
- if (pcl_cm_is_differential(global->compression)) {
- /* HP's documentation is a bit obscure concerning what the seed plane for
- a particular bit plane is. Most of the documentation talks only about
- seed rows (and "rows" consist of planes), but then one suddenly comes
- across a statement like "a separate seed row is maintained for each
- graphic plane" (DJ6/8 p. 57). I've also never found a statement what
- the seed row/plane/whatever for a bitplane in a strip group with
- multiple lines or multiple planes per colorant is, except that DJ6/8
- (p. 60) states explicitly that one cannot use Seed Row Source in that
- situation to select it.
-
- I therefore have to make a few assumptions. The following seem sensible:
- - The PCL interpreter maintains independent "seed lines" for each
- colorant. Each line consists of independent seed planes, one for each
- bit plane in a pixel line for that colorant (i.e., there are
- pcl3_levels_to_planes(levels) seed planes for a colorant accepting
- 'levels' intensity levels).
- - If the current compression method (this is a global property of the
- interpreter) is a differential one, a bit plane is interpreted as a
- delta plane with respect to the corresponding bit plane in the
- current colorant's preceding line.
- */
-
- int strip;
- const pcl_ColorantState *colorant = NULL;
- int plane = 0;
-
- if (global->colorant == NULL) colorant = global->colorant_array;
- else colorant = global->colorant;
-
- for (strip = 0; strip < global->number_of_colorants; strip++) {
- int lines = colorant[strip].vres/global->minvres;
- int planes = pcl3_levels_to_planes(colorant[strip].levels);
- int l, p;
-
- /* The first line of the colorant strip refers to the last line in the
- preceding strip. I'm assuming Seed Row Source == 0 here. */
- for (p = 0; p < planes; p++, plane++)
- data->seed_plane[plane] = data->previous + plane + (lines - 1)*planes;
-
- /* Subsequent lines refer to the preceding line in the current strip
- group */
- for (l = 1; l < lines; l++)
- for (p = 0; p < planes; p++, plane++)
- data->seed_plane[plane] = data->next + plane - planes;
- }
- }
-
- /* Start raster mode */
- if (data->width > 0) {
- fprintf(out, "\033*r%uS", data->width);
- /* PCL: Set Raster Graphics Width/Source Raster Width. The value is the
- number of pixels at the lowest horizontal resolution (see DJ6/8 p. 66).
- This is reset by End Raster Graphics. */
- }
- fputs("\033*p0X" /* PCL: Horizontal Cursor Positioning by Dots */
- "\033*r1A", out);
- /* PCL: Start Raster Graphics: at current position */
-
- /* After Start Raster Graphics the seed row consists of all zeroes
- (DJ6/8 p. 50). */
- if (pcl_cm_is_differential(global->compression))
- for (j = 0; j < global->number_of_bitplanes; j++)
- data->previous[j].length = 0;
-
- fputs("\033*b", out);
- /* We use combined escape sequences, all with this prefix. */
-
- /* The old End Raster Graphics command (with 'B') does not reset the
- compression method to 'pcl_cm_none'. We could keep track of the current
- compression method, but this would mean that we then have to track also
- the Printer Reset command (DJ6/8 p. 55). It's easier to set the method
- explicitly here. The worst which could happen is that in the case of
- old printers we generate two consecutive commands the first of which is
- superfluous. */
- if (pcl_use_oldERG(global->level)) {
- /* Raster Graphics Compression Method */
- fprintf(out, "%dm", (int)global->compression);
- data->current_compression = global->compression;
- }
- else data->current_compression = pcl_cm_none;
-
- return 0;
-}
-
-/******************************************************************************
-
- Function: pcl3_skip_groups
-
- Routine to skip a number of strip groups. 'count' is the number of strip
- groups (vertical distance in units of the reciprocal of the lowest vertical
- raster resolution).
-
- This function may only be called in raster mode.
-
-******************************************************************************/
-
-int pcl3_skip_groups(FILE *out, pcl_RasterData *data, unsigned int count)
-{
- int j;
-
- /* I don't know what happens with the seed row when 'count' is zero, but as
- the command is superfluous in that case anyway I'm ignoring it. */
- if (count == 0) return 0;
-
- fprintf(out, "%uy", count);
- /* PCL: Relative Vertical Pixel Movement/Y Offset.
- The statement in DJ6/8, p. 52, that "this command zero-fills the offset
- area" is incorrect. This can be seen when printing with an RGB palette on
- a DJ 850C where it results in a white area, not a black one. Hence it
- really skips these groups. */
-
- /* This command has zeroed the seed row (DJ6/8 p. 52). */
- if (pcl_cm_is_differential(data->global->compression))
- for (j = 0; j < data->global->number_of_bitplanes; j++)
- data->previous[j].length = 0;
-
- return 0;
-}
-
-/******************************************************************************
-
- Function: send_plane
-
- This function sends a bit plane to the printer. It returns zero on success
- and a non-zero value otherwise. In the latter case, an error message will
- have been issued on stderr.
-
- 'final' indicates whether this is the last plane of the row or not.
- 'method_demanded' contains the PCL compression method desired, '*method_used'
- the one actually used in the last transmission. This last variable will be
- reset to the method used in this invocation.
- 'in' points to the octet string to be sent as plane data, 'prev' points to
- the string previously sent (or whatever the reference plane for a differential
- compression method is) and may be NULL if 'method_demanded' refers
- to a purely "horizontal" method.
- 'out' is the file to which the plane should be written.
- 'out_bf1' and possibly 'out_bf2' are pointers to storage areas of at least
- length 'out_bf_size' which can be used as scratch areas by this function.
- 'out_bf1' must be non-NULL.
- 'out_bf2' need only be non-NULL if 'method_demanded' is 'pcl_cm_delta'.
- 'out_bf_size' must be positive but need not be larger than 'in->length'+2.
-
-******************************************************************************/
-
-static int send_plane(pcl_bool final,
- pcl_Compression method_demanded, pcl_Compression *method_used,
- const pcl_OctetString *in, const pcl_OctetString *prev, FILE *out,
- pcl_Octet *out_bf1, pcl_Octet *out_bf2, size_t out_bf_size)
-{
- int
- rc = 0; /* Return code from commands */
- pcl_Compression
- choice; /* Method chosen */
- pcl_OctetString
- out1,
- out2,
- send; /* Octets to be sent to the printer */
-
- /* Initialize 'out1' (no dynamic initializers for structs in ISO/ANSI C) */
- out1.str = out_bf1;
- out1.length = in->length + (*method_used == pcl_cm_none? 0: 2);
- /* 2 is the cost of switching to 'pcl_cm_none'. */
- if (out1.length > out_bf_size) out1.length = out_bf_size;
-
- /* Set 'send' to a compressed row to be sent and 'choice' to the compression
- method employed. */
- if (method_demanded == pcl_cm_delta) {
- /* Method 3 (delta row compression) has a widely varying effectiveness,
- depending on the structure of the input. Hence it is best combined
- with a non-delta method like method 2, as is done here on a per-plane
- basis, or method 1, as inherent in method 9.
- The procedure here is simple: try both methods, and then take the one
- giving the shortest output.
- */
- int c1, c2; /* cost in octets */
-
- /* Try delta row compression */
- rc = pcl_compress(pcl_cm_delta, in, prev, &out1);
- if (rc == 0) c1 = out1.length; else c1 = -1;
- if (*method_used != pcl_cm_delta && c1 >= 0) c1 += 2;
- /* cost of switching methods */
-
- /* Try TIFF compression */
- if (0 == c1) c2 = -1;
- else {
- int bound = in->length + (*method_used == pcl_cm_none? 0: 2);
- if (c1 >= 0 && c1 < bound) {
- /* We're interested in TIFF compression only if it results in an octet
- string shorter than the one produced by delta row compression. */
- bound = c1;
- if (*method_used != pcl_cm_tiff && bound >= 2) bound -= 2;
- }
- out2.str = out_bf2; out2.length = bound;
- rc = pcl_compress(pcl_cm_tiff, in, NULL, &out2);
- if (rc == 0) c2 = out2.length; else c2 = -1;
- if (*method_used != pcl_cm_tiff && c2 >= 0) c2 += 2;
- }
-
- /* Select the better of the two, or no compression */
- if (c1 < 0) {
- if (c2 < 0) choice = pcl_cm_none;
- else choice = pcl_cm_tiff;
- }
- else {
- if (c2 < 0 || c1 <= c2) choice = pcl_cm_delta;
- else choice = pcl_cm_tiff;
- }
- switch (choice) {
- case pcl_cm_tiff:
- send = out2; break;
- case pcl_cm_delta:
- send = out1; break;
- default:
- send = *in;
- }
- }
- else {
- if (method_demanded != pcl_cm_none &&
- pcl_compress(method_demanded, in, prev, &out1) == 0) {
- /* Send compressed data */
- send = out1;
- choice = method_demanded;
- }
- else {
- /* Send uncompressed data */
- send = *in;
- choice = pcl_cm_none;
- }
- }
-
- /* Switch compression methods, if needed */
- if (*method_used != choice) {
- /* Raster Graphics Compression Method */
- if (fprintf(out, "%dm", (int)choice) < 0) {
- fprintf(stderr, ERRPREF "Error from fprintf(): %s.\n", strerror(errno));
- return -1;
- }
- *method_used = choice;
- }
-
- /* Transfer plane to the printer */
- if (send.length == 0) {
- errno = 0;
- if (final)
- fputc('w', out);
- /* PCL: Transfer Raster Graphics Data by Row/Transfer Raster by Row/Block
- */
- else
- fputc('v', out);
- /* PCL: Transfer Raster Graphics Data by Plane/Transfer Raster by Plane */
- if (errno != 0) {
- fprintf(stderr, ERRPREF "Error from fputc(): %s.\n", strerror(errno));
- return -1;
- }
- }
- else {
- /* PCL: Transfer Raster Graphics Data by Row/Block/Plane */
- if (fprintf(out, "%d%c", send.length, final? 'w': 'v') < 0) {
- fprintf(stderr, ERRPREF "Error from fprintf(): %s.\n", strerror(errno));
- return -1;
- }
- if (fwrite(send.str, sizeof(pcl_Octet), send.length, out) != send.length) {
- fprintf(stderr, ERRPREF "Error in fwrite(): %s.\n", strerror(errno));
- return -1;
- }
- }
-
- return 0;
-}
-
-/******************************************************************************
-
- Function: pcl3_transfer_group
-
- Routine to transmit a strip group given as a sequence of bitplanes. A strip
- group consists of one strip of raster rows for every colorant. Every strip
- has the same height (reciprocal of the lowest vertical resolution) and all
- the strips will be overlaid. For more details, see the description of
- 'pcl_RasterData' in the header file.
-
- The bit planes will be sent as specified without first trying to reduce their
- length by removing trailing null octets.
-
- This routine may only be called in raster mode.
-
- On success and if a differential compression method has been requested, this
- function will exchange the values of the 'next' and 'previous' arrays (not
- the storage areas pointed to by their 'str' fields). Hence the calling code
- need merely fill in the new sequence of bit planes into the areas currently
- pointed to from the 'next' array, set the length fields, call this function,
- and repeat the procedure for subsequent strip groups. On allocating the
- 'next' and 'previous' arrays it is therefore advisable to allocate storage of
- identical length for corresponding elements in 'next' and 'previous'.
-
-******************************************************************************/
-
-int pcl3_transfer_group(FILE *out, pcl_RasterData *data)
-{
- const pcl_FileData *global = data->global;
- int
- final,
- j;
-
- /* Send the bit planes in their proper order */
- if (global->palette == pcl_CMYK && global->order_CMYK) {
- /* First CMY */
- for (j = global->black_planes; j < global->number_of_bitplanes; j++) {
- if (send_plane(FALSE,
- global->compression, &data->current_compression, data->next + j,
- data->seed_plane[j],
- out,
- data->workspace[0], data->workspace[1],
- data->workspace_allocated) != 0)
- return -1;
- }
- /* Now black */
- final = global->black_planes - 1;
- for (j = 0; j < global->black_planes; j++) {
- if (send_plane(j == final,
- global->compression, &data->current_compression, data->next + j,
- data->seed_plane[j],
- out,
- data->workspace[0], data->workspace[1],
- data->workspace_allocated) != 0)
- return -1;
- }
- }
- else {
- /* Output order is K, CMY, KCMY or RGB */
- final = global->number_of_bitplanes - 1;
- for (j = 0; j < global->number_of_bitplanes; j++) {
- if (send_plane(j == final,
- global->compression, &data->current_compression, data->next + j,
- data->seed_plane[j],
- out,
- data->workspace[0], data->workspace[1],
- data->workspace_allocated) != 0)
- return -1;
- }
- }
-
- /* Switch old and new planes in case of differential compression methods */
- if (pcl_cm_is_differential(data->global->compression))
- for (j = 0; j < global->number_of_bitplanes; j++) {
- pcl_OctetString tmp;
- tmp = data->previous[j];
- data->previous[j] = data->next[j];
- data->next[j] = tmp;
- }
-
- return 0;
-}
-
-/******************************************************************************
-
- Function: pcl3_end_raster
-
- This function may only be called in raster mode which it terminates.
-
-******************************************************************************/
-
-int pcl3_end_raster(FILE *out, pcl_RasterData *data)
-{
- fputs("0Y", out);
- /* PCL: Relative Vertical Pixel Movement/Y Offset. This is a simple way
- to terminate the combined escape sequence started at the beginning of
- raster mode. */
-
- /* End Raster Graphics */
- send_ERG(out, data->global->level);
- if (!pcl_use_oldERG(data->global->level))
- data->current_compression = pcl_cm_none;
- /* TRG500 p. 6-40, Lexmark-PTR pp. 2-40/41 */
-
- free(data->seed_plane); data->seed_plane = NULL;
-
- return 0;
-}
-
-/******************************************************************************
-
- Function: pcl3_end_page
-
- This function must be called to finish a page. It may only be called if the
- page has been opened and not in raster mode.
-
-******************************************************************************/
-
-int pcl3_end_page(FILE *out, pcl_FileData *data)
-{
- /* Eject the page */
- fputc('\f', out);
-
- if (ferror(out)) {
- fputs(ERRPREF "Unidentified system error while writing the output file.\n",
- stderr);
- return -1;
- }
-
- return 0;
-}
-
-/******************************************************************************
-
- Function: pcl3_end_file
-
- This function should be called at the end of each print job in order to leave
- the printer in a known state. However, this is only a matter of courtesy for
- print jobs which do not follow HP's recommendations and do not start with
- Printer Reset as the initial command.
-
-******************************************************************************/
-
-int pcl3_end_file(FILE *out, pcl_FileData *data)
-{
- /* For banner printing, HP recommends to eject the page via Media Source.
- The printer then enters a paper-unloading state. */
- if (data->media_source == -1)
- fputs("\033&l0H", out); /* PCL: Media Source: Eject Page */
-
- /* PCL: Printer Reset */
- fputs("\033E", out);
-
- /* Terminate PJL */
- if (data->PJL_job != NULL || data->PJL_language != NULL) {
- /* PJL: UEL */
- fputs("\033%-12345X", out);
-
- if (data->PJL_job != NULL) {
- /* PJL: End of Job. Some HP PCL-3 drivers using JOB omit this command.
- According to PJLTRM, it is required in that case. */
- fputs("@PJL EOJ\n", out);
-
- /* PJL: UEL. All output I've seen from HP's PCL-3 drivers using EOJ
- omits this final UEL. According to PJLTRM, it is required. In my
- opinion it doesn't make any difference because in both cases the
- printer expects PJL in preference to other data next and the rules
- for deciding whether it's PJL or not are also the same. Note that the
- command does not influence the printer's state. */
- fputs("\033%-12345X", out);
- }
- }
-
- if (ferror(out)) {
- fputs(ERRPREF "Unidentified system error while writing the output file.\n",
- stderr);
- return -1;
- }
-
- return 0;
-}
-
-/******************************************************************************
-
- Function: pcl3_set_oldquality
-
- This function determines and sets the old quality parameters based on the
- current 'palette', 'print_quality' and 'media_type' values. This is mostly
- done as recommended by HP on page 6-34 of the TRG500 but that information is
- not complete.
-
- In particular, nothing is said about RGB palettes which I'm treating here
- like CMY palettes.
-
- If the input values cannot be mapped, the function sets the old parameters as
- if the offending value were 0 (normal quality or plain paper respectively)
- and returns a non-zero exit code.
-
-******************************************************************************/
-
-int pcl3_set_oldquality(pcl_FileData *data)
-{
- /* A media type of 3 means glossy paper, 4 is transparency film. */
-
- switch (data->print_quality) {
- case -1 /* draft */:
- data->depletion = 3; /* 50 % */
- data->raster_graphics_quality = 1; /* draft */
- if (data->media_type == 4) data->shingling = 1; /* 2 passes */
- else data->shingling = 0; /* no shingling */
- break;
- case 1 /* presentation */:
- if (3 <= data->media_type && data->media_type <= 4)
- data->depletion = 1; /* 0 % */
- else if (data->palette == pcl_CMY || data->palette == pcl_RGB)
- data->depletion = 2; /* 25 % */
- else
- data->depletion = 3; /* 50 % */
- /* Actually, TRG500 recommends 5 (50 % with gamma correction), but we
- assume that gamma correction will be handled externally. */
- data->raster_graphics_quality = 2; /* high */
- data->shingling = 2; /* 4 passes */
- break;
- default: /* normal or an illegal value */
- data->depletion = 2; /* 25 % */
- data->raster_graphics_quality = 0; /* use current control panel setting */
- if (data->media_type == 3 ||
- data->media_type == 4 && data->palette != pcl_CMY &&
- data->palette != pcl_RGB)
- data->shingling = 2; /* 4 passes (25 % each pass) */
- else data->shingling = 1; /* 2 passes (50 % each pass) */
- }
-
- /* No depletion for monochrome data */
- if (data->palette <= pcl_black) data->depletion = 0;
-
- return -1 <= data->print_quality && data->print_quality <= 1 &&
- 0 <= data->media_type && data->media_type <= 4? 0: 1;
-}
-
-/*****************************************************************************/
-
-int pcl3_set_printquality(pcl_FileData *data, int quality)
-{
- data->print_quality = quality;
- if (pcl_use_oldquality(data->level)) return pcl3_set_oldquality(data);
-
- return 0;
-}
-
-/*****************************************************************************/
-
-int pcl3_set_mediatype(pcl_FileData *data, int mediatype)
-{
- data->media_type = mediatype;
- if (pcl_use_oldquality(data->level)) return pcl3_set_oldquality(data);
-
- return 0;
-}
diff --git a/gs/contrib/pcl3/src/pclgen.h b/gs/contrib/pcl3/src/pclgen.h
deleted file mode 100644
index 4c12e8ded..000000000
--- a/gs/contrib/pcl3/src/pclgen.h
+++ /dev/null
@@ -1,435 +0,0 @@
-/******************************************************************************
- File: $Id: pclgen.h,v 1.25 2001/08/18 17:41:29 Martin Rel $
- Contents: Header for PCL-generating routines
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany. E-mail: Martin.Lottermoser@t-online.de.
-
-*******************************************************************************
-* *
-* Copyright (C) 1999, 2000, 2001 by Martin Lottermoser *
-* All rights reserved *
-* *
-*******************************************************************************
-
- The functions declared in this header file generate code for
- Hewlett-Packard's Printer Command Language level 3+ ("PCL 3+", also called
- "PCL 3 Plus").
-
- The routines support only raster graphics data.
-
-******************************************************************************/
-
-#ifndef _pclgen_h /* Inclusion protection */
-#define _pclgen_h
-
-/* Configuration management identification */
-#pragma ident "@(#)$Id: pclgen.h,v 1.25 2001/08/18 17:41:29 Martin Rel $"
-
-/*****************************************************************************/
-
-/* Standard headers */
-#include <stdio.h>
-
-/*****************************************************************************/
-
-/* PCL dialects */
-typedef enum {
- pcl_level_3plus_DJ500,
- /* End Raster Graphics is still ESC * r B, no Shingling */
- pcl_level_3plus_ERG_both,
- /* ESC*rbC, otherwise identical with 'pcl_level_3plus_S5' */
- pcl_level_3plus_S5,
- /* DeskJet 500 series except 540: old quality commands, no
- Configure Raster Data, ESC*rC */
- pcl_level_3plus_S68,
- /* DeskJet 540, DeskJet 600 and 800 series */
- pcl_level_3plus_CRD_only
- /* printers always and only using Configure Raster Data instead of
- Set Number of Planes per Row and Set Raster Graphics Resolution */
-} pcl_Level;
-
-
-/* Test macros */
-#define pcl_use_oldERG(level) (level <= pcl_level_3plus_DJ500)
-#define pcl_use_oldquality(level) (level <= pcl_level_3plus_S5)
-#define pcl_has_CRD(level) (level >= pcl_level_3plus_S68)
-
-/*****************************************************************************/
-
-/* Page Size codes (permitted arguments for the PCL command "Page Size")
-
- There exists an area of confusion around this command in connection with
- "orientation" in various senses. Unfortunately, the documentation made
- externally available by Hewlett-Packard is not only incomplete but also
- inconsistent in this respect. (Well, not only in this respect, but don't
- get me started on this topic or I'll run out of screen space.) In
- particular, HP does not distinguish between "input orientation"
- (orientation of a sheet with respect to the feeding direction: short edge
- first or long edge first) and "page orientation" (orientation of a sheet
- with respect to the "up" direction of the page contents: portrait or
- landscape). This is further complicated by the fact that PCL permits
- several relative orientations between text and graphics data.
-
- The following information is therefore partially in disagreement with
- HP documentation but does agree with the actual behaviour of the DJ 850C.
-
- (1) The Page Orientation command has no influence on the orientation of
- raster graphics data.
- (2) Therefore it is possible to define, independent of the Page Orientation
- setting, a coordinate system on the medium by reference to the printing
- of raster lines ("rows"): the order of pixels within a row defines what
- is left and right, and the order in which successive rows are printed
- distinguishes between up and down. I call this the "raster space"
- coordinate system. (Its units are irrelevant, but we need the
- directions.)
- (3) Because of the way DeskJet printers are constructed (limited memory!),
- raster space is fixed with respect to the feeding direction: the "up"
- edge of a sheet in raster space is the one entering the printer first
- (the leading edge).
- (4) Hence the media orientation in raster space depends only on the
- input orientation: short edge first leads to portrait and long edge
- first to landscape orientation in raster space.
- (5) Among other effects, the Page Size command sets in particular the
- printable region for the media size requested.
- (6) For raster graphics data, clipping occurs at the edge of the printable
- region. This happens at the right edge in raster space.
- (7) It is not possible in PCL to specify the input orientation one has
- chosen. In particular, the sign of a Page Size code has no influence on
- the printable region as seen in raster space.
- (8) Some Page Size codes do modify the orientation for text printing on
- some printers, but this can be overridden with a subsequent Page
- Orientation command.
- (9) The Page Size command usually sets up the printable region under the
- assumption of portrait orientation in raster space (i.e., the input
- orientation is short edge first). Exceptions occur with envelope sizes
- (Env10 and EnvDL) on older DeskJet printers (500 and 500C, possibly
- also 400) where envelopes have to be fed long edge first.
-
- The key conclusion to be drawn from this is that the layer represented by
- the functions in this interface does not have any information on the media
- orientation in raster space nor can this information be formulated in PCL
- and passed through this layer. It is information shared between the printer
- and the client code calling this interface, and the caller must therefore
- obtain it from an external source.
-
- In introducing the concept of a "raster space" I have deliberately avoided
- the term "physical page" used in the PCL documentation. The latter is not
- made sufficiently precise, and for printing raster data as done here the
- first concept is the one required.
-
-
- Two Page Size codes are marked "PS3". These are from Adobe's "LanguageLevel
- 3 Specification and Adobe PostScript 3 Version 3010 Product Supplement"
- (dated 1997-10-10), page 352, where eight PCL-5 page size codes are listed.
- Six of these agree with PCL-3 page size codes, and the remaining two are
- those inserted here and marked "PS3". I have not heard of any PCL-3 printer
- supporting these two sizes as discrete sizes.
-
- The identifiers are usually named after the corresponding 'mediaOption'
- keyword from Adobe's PPD 4.3 specification.
-*/
-typedef enum {
- pcl_ps_default = 0, /* default size for the printer (e.g., BPD03004 or
- BPD02926; but note that in some versions of these documents the text
- representation is wrong, you should look at the hex codes) */
- pcl_ps_Executive = 1, /* US Executive (7.25 x 10.5 in).
- According to Adobe's PPD 4.3 specification, media sizes called by this name
- vary by up to 1/2 in. */
- pcl_ps_Letter = 2, /* US Letter (8.5 x 11 in) */
- pcl_ps_Legal = 3, /* US Legal (8.5 x 14 in) */
- pcl_ps_Tabloid = 6, /* US Tabloid (11 x 17 in) or Ledger (17 x 11 in)
- (DJ1120C). The designation as Tabloid versus Ledger
- is not always consistent. I'm following PPD 4.3. */
- pcl_ps_Statement = 15, /* US Statement (5.5 x 8.5 in) (DJ1120C) */
- pcl_ps_HPSuperB = 16, /* Super B (13 x 19 in (330 x 483 mm) according to
- DJ1120C, while 305 x 487 mm according to PPD 4.3).
- Not supported in PCL 3 according to BPD07645
- (HP 2500C). */
- pcl_ps_A6 = 24, /* ISO/JIS A6 (105 x 148 mm) */
- pcl_ps_A5 = 25, /* ISO/JIS A5 (148 x 210 mm) */
- pcl_ps_A4 = 26, /* ISO/JIS A4 (210 x 297 mm) */
- pcl_ps_A3 = 27, /* ISO/JIS A3 (297 x 420 mm) (DJ1120C, BPL02327) */
- pcl_ps_JISB5 = 45, /* JIS B5 (182 x 257 mm) */
- pcl_ps_JISB4 = 46, /* JIS B4 (257 x 364 mm) (DJ1120C, BPL02327) */
- pcl_ps_Postcard = 71, /* Japanese Hagaki postcard (100 x 148 mm) */
- pcl_ps_DoublePostcard = 72, /* Japanese Oufuko-Hagaki postcard
- (148 x 200 mm) (DJ6/8) */
- pcl_ps_A6Card = 73, /* "ISO and JIS A6 card" (DJ6/8, DJ1120C). This is the
- value given for most DeskJets supporting A6. I do
- not know what the difference between this value and
- pcl_ps_A6 (24) is. */
- pcl_ps_Index4x6in = 74, /* US Index card (4 x 6 in) */
- pcl_ps_Index5x8in = 75, /* US Index card (5 x 8 in) */
- pcl_ps_Index3x5in = 78, /* US Index card (3 x 5 in) */
- pcl_ps_EnvMonarch = 80, /* US Monarch (3.875 x 7.5 in) (PS3, BPL02327) */
- pcl_ps_Env10 = 81, /* US No. 10 envelope (4.125 x 9.5 in) */
- pcl_ps_Env10_Negative = -81, /* also US No. 10 envelope */
- /* According to Lexmark-PTR, 89 is US No. 9 envelope (3.875 x 8.875 in). */
- pcl_ps_EnvDL = 90, /* ISO DL (110 x 220 mm) */
- pcl_ps_EnvDL_Negative = -90, /* also ISO DL. This value is hinted at in
- TRG500 p. 3-2 in the "Range" line at the bottom of the table and it is
- explicitly listed in DJ3/4 on p. 36. On a DJ 850C, I found no difference in
- text orientation with respect to the value 90. */
- pcl_ps_EnvC5 = 91, /* ISO C5 (162 x 229 mm) in PCL 5 (PS3, BPL02327) */
- pcl_ps_EnvC6 = 92, /* ISO C6 (114 x 162 mm) */
- pcl_ps_ISOB5 = 100, /* ISO B5 (176 x 250 mm, BPL02327; the dimensions in
- millimetres in BPL02327 are wrong, those in inches are right) */
- pcl_ps_CustomPageSize = 101, /* Custom page size */
- pcl_ps_EnvUS_A2 = 109, /* US A2 envelope (4.375 x 5.75 in) */
- pcl_ps_EnvChou3 = 110, /* Japanese long Envelope #3 (120 mm x 235 mm)
- (DJ1120C) */
- pcl_ps_EnvChou4 = 111, /* Japanese long envelope #4 (90 mm x 205 mm)
- (DJ1120C) */
- pcl_ps_EnvKaku2 = 113 /* Kaku envelope (240 x 332 mm) (DJ1120C) */
-} pcl_PageSize;
-
-/*****************************************************************************/
-
-/* Raster graphics compression methods */
-typedef enum {
- pcl_cm_none = 0, /* Unencoded, non-compressed method */
- pcl_cm_rl = 1, /* Run-Length Encoding */
- pcl_cm_tiff = 2, /* Tagged Image File Format (TIFF) revision 4.0
- "packbits" encoding */
- pcl_cm_delta = 3, /* Delta Row Compression */
- pcl_cm_adaptive = 5, /* Adaptive Compression */
- pcl_cm_crdr = 9 /* Compressed Replacement Delta Row Encoding */
-} pcl_Compression;
-
-/* Macro to test for differential compression methods */
-#define pcl_cm_is_differential(cm) \
- ((cm) == pcl_cm_delta || (cm) == pcl_cm_adaptive || (cm) == pcl_cm_crdr)
-
-/*****************************************************************************/
-
-/* Type and constants for boolean variables */
-typedef int pcl_bool;
-#ifndef FALSE
-#define FALSE 0
-#else
-#if FALSE != 0
-#error "FALSE is defined as non-zero."
-#endif /* FALSE != 0 */
-#endif /* FALSE */
-#ifndef TRUE
-#define TRUE 1
-#else
-#if TRUE == 0
-#error "TRUE is defined as zero."
-#endif /* TRUE == 0 */
-#endif /* TRUE */
-
-
-/* Palette (process colour model) */
-typedef enum {
- pcl_no_palette, /* Don't send Number of Planes per Row */
- pcl_black,
- pcl_CMY,
- pcl_CMYK,
- pcl_RGB, /* Using the RGB palette is discouraged by HP. */
- pcl_any_palette /* Don't use this value unless you know what you are
- doing. */
-} pcl_Palette;
-
-
-/* Information per colorant for raster images */
-typedef struct {
- unsigned int hres, vres; /* Resolution in ppi. The orientation refers to
- raster space. Both values must be non-zero. */
- unsigned int levels; /* Number of intensity levels. 2 or larger. */
-} pcl_ColorantState;
-
-/*****************************************************************************/
-
-/* 'pcl_Octet' is used to store 8-bit bytes as unsigned numbers. */
-#ifndef _pcl_Octet_defined
-#define _pcl_Octet_defined
-typedef unsigned char pcl_Octet;
-#endif
-
-/* Octet strings */
-typedef struct {
- pcl_Octet *str; /* Data area for storing the octet string. */
- int length; /* Length of 'str' in octets (non-negative). */
-} pcl_OctetString;
-/* A "valid" pcl_OctetString is one where either 'length' is zero, or
- 'length' is positive and 'str' is non-NULL and points to a storage
- area of at least 'length' octets.
- A "zero" pcl_OctetString is one where 'length' is zero.
-*/
-
-/*****************************************************************************/
-
-/* File-global data */
-typedef struct {
- pcl_Level level;
-
- /* Printer initialization */
- int NULs_to_send;
- char
- *PJL_job, /* PJL job name. Ignored if NULL. */
- *PJL_language; /* PJL personality. Ignored if NULL. */
-
- /* Additional initialization commands (ignored if zero) */
- pcl_OctetString
- init1, /* send immediately after resetting the printer */
- init2; /* send after all other initialization commands */
-
- /* Media */
- pcl_PageSize size;
- int
- media_type,
- media_source, /* 0: don't request a particular media source */
- media_destination, /* 0: don't request a particular media destination.
- Not based on HP documentation. */
- duplex; /* -1: don't request anything in this respect,
- 0: simplex, 1: duplex long-edge binding, 2: duplex short-edge binding
- (BPL02705). I assume the correct interpretation of the duplex values to
- be:
- 1: duplex, print back side with the same top edge in raster space
- 2: duplex, print back side with top and bottom edges exchanged in
- raster space
- */
- pcl_bool manual_feed;
-
- /* Print quality selection. Which of these variables are used depends on the
- PCL level chosen. */
- int
- print_quality,
- depletion, /* 0: no depletion command */
- shingling,
- raster_graphics_quality;
-
- /* Colour information */
- pcl_Palette palette;
- unsigned int number_of_colorants;
- pcl_ColorantState *colorant;
- /* This variable must either be NULL or point to an array of at least
- 'number_of_colorants' elements. The order of colorants is (K)(CMY) except
- for 'pcl_any_palette'. If the pointer is NULL, 'colorant_array' is used
- instead. */
- pcl_ColorantState colorant_array[4];
- /* Used if 'colorant' is NULL and with the same meaning. This is only
- possible if 'number_of_colorants' is at most 4. */
- pcl_bool order_CMYK;
- /* For pcl_CMYK, should the order of bit planes when sent to the printer be
- reversed to CMYK instead of KCMY? This is not standard PCL but is needed
- by at least one Olivetti printer (Olivetti JP792). */
-
- int dry_time; /* negative for "don't send this command" */
- pcl_Compression compression;
-
- /* Derived information managed by the routines declared here. These fields
- have reliable values only after a call to plc3_init_file(). */
- unsigned short number_of_bitplanes;
- unsigned short black_planes;
- unsigned int minvres; /* minimal vertical resolution */
-} pcl_FileData;
-
-/*****************************************************************************/
-
-/* Types for raster data */
-
-typedef struct {
- /* Data to be provided by the caller */
- unsigned int width; /* maximal length of raster lines in pixels at the
- lowest horizontal resolution. This may be zero to indicate "as large as
- possible", but this could waste printer memory. Always set this when
- using an RGB palette unless you have reliable data on the clipping
- boundary. The value should probably always be a multiple of 8. */
- pcl_FileData *global; /* must point to the data used in the last call
- to pcl3_init_file() */
- pcl_OctetString
- *previous, *next;
- /* These variables point to the sequences of bit planes for the old and
- the new strip group. The total number of bit planes per group can be
- obtained in the 'number_of_bitplanes' parameter in '*global'.
-
- The order of bit planes within a strip group is as follows:
- - Each strip group consists of a number of "colorant strips", one for
- each colorant. All strips in such a group cover the same region on
- the page. Except for 'pcl_RGB', colorant strips are ordered in the
- sequence (K)(CMY), independent of 'order_CMYK'. For an RGB palette,
- the order is (of course) RGB.
- - Each colorant strip contains a number of pixel lines for this
- colorant. If there is more than one line, the lines are ordered from
- top to bottom as seen from raster space. The number of lines is
- the ratio of that colorant's vertical resolution to the smallest
- vertical resolution.
- - Within each pixel line for a colorant, bit planes are ordered from
- least to most significant. The number of bit planes within a line is
- pcl3_levels_to_planes(levels) for this colorant.
- When bit planes are again combined into lines for a particular
- colorant, the resulting value per pixel denotes the intensity for
- that colorant. A value of zero denotes absence of that colorant.
- 'previous' will be ignored (and may then be NULL) unless a differential
- compression method is requested (pcl_cm_is_differential()).
-
- When using an RGB palette you should always send bit planes extending
- over the whole 'width' because shorter bit planes are implicitly
- extended with null octets and a pixel value of zero denotes black in an
- RGB palette which is not usually desired.
- */
- pcl_Octet *workspace[2];
- /* Storage for the use of these routines. workspace[0] must be non-NULL,
- workspace[1] will be ignored except for Delta Row Compression. */
- size_t workspace_allocated;
- /* Length allocated for each non-NULL 'workspace[]'. This should be at
- least 2 larger than the longest possible bit plane, otherwise raster
- data might have to be sent in uncompressed form even if that would take
- more space. */
-
- /* Internal data for these routines */
- pcl_Compression current_compression; /* last compression method used */
- pcl_OctetString **seed_plane; /* seed plane indexed by plane index */
-} pcl_RasterData;
-
-/******************************************************************************
-
- The routines assume a simple state machine:
-
- - You are either on a page or between pages.
- - If you are on a page, you are either in raster mode or not.
-
- You should call pcl3_init_file() before the first page and between pages
- whenever you change the file-global data (like the resolution). Otherwise,
- use the ..._begin() and ..._end() functions to navigate between the states.
-
- Look into the implementation file for detailed interface descriptions for
- these routines.
-
- The error conventions are the same for all file, page and raster functions:
- - A return code of zero indicates success.
- - A positive return code indicates an argument error. This should be
- avoidable by careful programming.
- - A negative return code indicates an environment error (e.g., disk overflow).
- If a function returns with a non-zero code, an error message will have been
- issued on standard error.
-
-******************************************************************************/
-
-/* Auxiliary functions */
-extern unsigned int pcl3_levels_to_planes(unsigned int levels);
-extern int pcl3_set_printquality(pcl_FileData *data, int quality);
-extern int pcl3_set_mediatype(pcl_FileData *data, int mediatype);
-extern int pcl3_set_oldquality(pcl_FileData *data);
-extern int pcl_compress(pcl_Compression method, const pcl_OctetString *in,
- const pcl_OctetString *prev, pcl_OctetString *out);
-
-
-/* File and page functions */
-extern int pcl3_init_file(FILE *out, pcl_FileData *global);
-extern int pcl3_begin_page(FILE *out, pcl_FileData *global);
-extern int pcl3_end_page(FILE *out, pcl_FileData *global);
-extern int pcl3_end_file(FILE *out, pcl_FileData *global);
-
-/* Raster functions */
-extern int pcl3_begin_raster(FILE *out, pcl_RasterData *data);
-extern int pcl3_skip_groups(FILE *out, pcl_RasterData *data,
- unsigned int count);
-extern int pcl3_transfer_group(FILE *out, pcl_RasterData *data);
-extern int pcl3_end_raster(FILE *out, pcl_RasterData *data);
-
-/*****************************************************************************/
-
-#endif /* Inclusion protection */
diff --git a/gs/contrib/pcl3/src/pclscan.c b/gs/contrib/pcl3/src/pclscan.c
deleted file mode 100644
index 55d7e5d0e..000000000
--- a/gs/contrib/pcl3/src/pclscan.c
+++ /dev/null
@@ -1,331 +0,0 @@
-/******************************************************************************
- File: $Id: pclscan.c,v 1.8 2000-10-22 11:05:34+02 Martin Rel $
- Contents: PCL scanner
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany, e-mail: Martin.Lottermoser@t-online.de
-
-*******************************************************************************
-* *
-* Copyright (C) 1999, 2000 by Martin Lottermoser *
-* All rights reserved *
-* *
-******************************************************************************/
-
-/* Configuration management identification */
-#ifndef lint
-static const char
- cm_id[] = "@(#)$Id: pclscan.c,v 1.8 2000-10-22 11:05:34+02 Martin Rel $";
-#endif
-
-/*****************************************************************************/
-
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE 500
-#endif
-#ifndef _XOPEN_SOURCE_EXTENDED
-#define _XOPEN_SOURCE_EXTENDED 1
-#endif
-
-/* Standard headers */
-#include <errno.h>
-#include <nl_types.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* Special headers */
-#include "pclscan.h"
-
-/*****************************************************************************/
-
-static nl_catd catd = (nl_catd)-1; /* NLS catalogue descriptor */
-
-
-static void message(int id, const char *s)
-{
- if (catd != (nl_catd)-1) s = catgets(catd, 1, id, s);
- /* The check might not be necessary (X/Open requires catgets() to return 's'
- if the call is unsuccessful for *any* reason and the possible errors
- include EBADF for an invalid 'catd'), but one never knows. */
-
- fputs("? pclscan: ", stderr);
- fprintf(stderr, s);
- fputc('\n', stderr);
-
- return;
-}
-
-/*****************************************************************************/
-
-static const pcl_Octet ESC = '\x1B';
-
-/******************************************************************************
-
- Function: pcl_is_control_code
-
- This function returns a non-zero value iff 'c', taken to be an unsigned char
- converted to 'int', is a PCL control code.
-
-******************************************************************************/
-
-int pcl_is_control_code(int c)
-{
- return
- c <= ' ' && (
- c == '\0' ||
- /* TRG500 does not mention NUL as a control code. */
- c == '\b' || c == '\t' || c == '\n' || c == '\f' || c == '\r' ||
- c == '\x0E' /* Shift Out (SO) */ ||
- c == '\x0F' /* Shift In (SI) */ ||
- c == '\x11' /* Device Control 1 (DC1) */ ||
- c == '\x13' /* Device Control 3 (DC3) */ ||
- c == ESC ||
- c == ' ');
-}
-
-/*****************************************************************************/
-
-static int cmp_strings(const void *a, const void *b)
-{
- return strncmp((const char *)a, (const char *)b, 3);
-}
-
-
-static int default_interpreter(FILE *in, const pcl_Command *cmd)
-{
- /* Skip over arguments for those commands which are known to have them */
- if (cmd->kind >= 3) {
- if (strncmp((const char *)cmd->chars, "%-X", 3) == 0 && cmd->i == 12345) {
- /* Universal Exit Language (UEL)/Start of PJL */
- int c;
-
- do {
- c = fgetc(in);
- if (c != '@') break;
- do c = fgetc(in); while (c != EOF && c != '\n');
- } while (c != EOF);
- if (c != EOF) ungetc(c, in);
- }
- else if (cmd->i > 0) {
- static const char with_args[][4] = {
- /* Must be sorted with respect to cmp_strings() */
- "&bW",
- "&iW",
- "&pX", /* Transparent Print Mode */
- "(sW", /* Download Character */
- ")sW", /* Create Font */
- "*bV", /* Transfer Raster Graphics Data by Plane */
- "*bW", /* Transfer Raster Graphics Data by Row */
- "*dW", /* Palette Configuration */
- "*gW", /* Configure Raster Data */
- "*oW"};
-
- if (bsearch(cmd->chars, with_args,
- sizeof(with_args)/sizeof(with_args[0]), sizeof(with_args[0]),
- &cmp_strings) != NULL) {
- int j;
-
- j = cmd->i;
- while (j > 0 && fgetc(in) != EOF) j--;
- if (j > 0) {
- message(1, "Premature EOF on input.");
- return -1;
- }
- }
- }
- }
- else if (cmd->kind == 2 && cmd->chars[0] == 'Y') {
- /* Display Functions Mode ON */
- int c;
-
- /* Read until EOF or Display Functions Mode OFF */
- do {
- do c = fgetc(in); while (c != EOF && c != ESC);
- if (c != EOF) c = fgetc(in);
- } while (c != EOF && c != 'Z');
-
- if (c != 'Z') {
- message(1, "Premature EOF on input.");
- return -1;
- }
- }
-
- return 0;
-}
-
-/*****************************************************************************/
-
-static int default_handler(FILE *in)
-{
- int c;
-
- do {
- c = fgetc(in);
- } while (c != EOF && !pcl_is_control_code(c));
- if (c != EOF) ungetc(c, in);
-
- return 0;
-}
-
-/******************************************************************************
-
- Function: pcl_scan
-
- This function scans a PCL file, separating it into printer commands and
- unknown data, and calling the functions '(*interpreter)()' and '(*handler)()'
- with these parts, respectively.
-
- 'in' must have been opened as a binary file and for reading.
- 'interpreter' or 'handler' may be null in which case default routines are
- used.
- If a non-NULL function pointer is provided for 'interpreter' or 'handler',
- the function will be passed the value of 'idata' or 'hdata', respectively.
-
- This function returns zero on success and a negative value otherwise.
- If one of the interpreter or data handler functions returns a negative value,
- processing will stop and the value will be returned as the return value of
- pcl_scan().
-
-******************************************************************************/
-
-int pcl_scan(FILE *in, pcl_CommandInterpreter interpreter, void *idata,
- pcl_UnknownDataHandler handler, void *hdata)
-{
- int
- c,
- rc = 0;
-
- /* Open catalogue descriptor */
- catd = catopen("pcltools", 0);
- if (catd == (nl_catd)(-1) && errno != ENOENT)
- /* A system returning ENOENT if no catalogue is available is for example
- Sun Solaris 2.5. */
- fprintf(stderr,
- "?-W pclscan: Error trying to open message catalogue: %s.\n",
- strerror(errno));
-
- /* Loop over input */
- while (rc >= 0 && (c = fgetc(in)) != EOF) {
- if (c == ESC) {
- pcl_Command command;
-
- if ((c = fgetc(in)) == EOF) {
- rc = -1;
- message(1, "Premature EOF on input.");
- break;
- }
- command.chars[0] = c;
- if (48 <= c && c <= 126) {
- /* Two-character escape sequence */
- command.kind = 2;
- if (interpreter == NULL ||
- (rc = (*interpreter)(in, &command, idata)) > 0)
- rc = default_interpreter(in, &command);
- }
- else {
- int continued;
-
- /* Parameterized escape sequence or garbage. The character we've just
- read is the "parameterized character" and it should be in the range
- 33-47. */
-
- /* Now the group character (should be in the range 96-126, but HP uses
- sometimes at least '-', which has the value 45) */
- if ((c = fgetc(in)) == EOF) {
- rc = -1;
- message(1, "Premature EOF on input.");
- break;
- }
- command.chars[1] = c;
-
- continued = 0;
- do {
- /* Now for the value */
- if ((c = fgetc(in)) == EOF) {
- rc = -1;
- message(1, "Premature EOF on input.");
- break;
- }
- if (c == '+' || c == '-' || '0' <= c && c <= '9') {
- if (c == '+' || c == '-') command.prefix = c;
- else command.prefix = ' ';
- ungetc(c, in);
- if (fscanf(in, "%d", &command.i) != 1) {
- rc = -1;
- message(2, "Syntax error in value field.");
- break;
- }
-
- /* Decimal point? */
- if ((c = fgetc(in)) == EOF) {
- rc = -1;
- message(1, "Premature EOF on input.");
- break;
- }
- command.scale = 0;
- command.fraction = 0;
- if (c == '.') {
- command.scale = 1;
- while ((c = fgetc(in)) != EOF && '0' <= c && c <= '9') {
- command.fraction = command.fraction*10 + (c - '0');
- command.scale *= 10;
- }
- if (c == EOF) {
- rc = -1;
- message(1, "Premature EOF on input.");
- break;
- }
- if (command.prefix == '-') command.fraction = -command.fraction;
- }
- }
- else {
- command.prefix = '\0'; /* no value given */
- command.i = 0;
- }
-
- /* Final character */
- if (96 <= c && c <= 126) {
- /* Parameter character */
- command.chars[2] = c - ('a' - 'A');
- command.kind = (continued? 6: 4);
- continued = 1;
- }
- else {
- /* Termination character (should be in the range 64-94) */
- command.chars[2] = c;
- command.kind = (continued? 5: 3);
- continued = 0;
- }
-
- if (interpreter == NULL ||
- (rc = (*interpreter)(in, &command, idata)) > 0)
- rc = default_interpreter(in, &command);
- } while (rc == 0 && continued);
- }
- }
- else if (pcl_is_control_code(c)) {
- pcl_Command command;
-
- command.chars[0] = c;
- command.kind = 1;
- command.i = 1; /* number of occurrences */
-
- while ((c = fgetc(in)) != EOF && c == command.chars[0]) command.i++;
- if (c != EOF) ungetc(c, in);
-
- if (interpreter == NULL ||
- (rc = (*interpreter)(in, &command, idata)) > 0)
- rc = default_interpreter(in, &command);
- }
- else {
- ungetc(c, in);
- if (handler == NULL || (rc = (*handler)(in, hdata)) > 0)
- rc = default_handler(in);
- }
- }
-
- /* Close catalogue descriptor */
- if (catd != (nl_catd)-1) catclose(catd);
-
- return rc;
-}
diff --git a/gs/contrib/pcl3/src/pclscan.h b/gs/contrib/pcl3/src/pclscan.h
deleted file mode 100644
index 1d3618236..000000000
--- a/gs/contrib/pcl3/src/pclscan.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/******************************************************************************
- File: $Id: pclscan.h,v 1.6 2000-10-22 11:05:34+02 Martin Rel $
- Contents: Header for PCL scanner
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany, e-mail: Martin.Lottermoser@t-online.de
-
-*******************************************************************************
-* *
-* Copyright (C) 1999, 2000 by Martin Lottermoser *
-* All rights reserved *
-* *
-******************************************************************************/
-
-#ifndef _pclscan_h /* Inclusion protection */
-#define _pclscan_h
-
-/* Configuration management identification */
-#ifdef __GNUC__
-#ident "@(#)$Id: pclscan.h,v 1.6 2000-10-22 11:05:34+02 Martin Rel $"
-#else
-#pragma ident "@(#)$Id: pclscan.h,v 1.6 2000-10-22 11:05:34+02 Martin Rel $"
-#endif
-
-/*****************************************************************************/
-
-/* Standard headers */
-#include <stdio.h>
-
-/*****************************************************************************/
-
-/* Macro to convert a termination character into a parameter character.
- It should only be applied to arguments in the range 64-94.
- */
-#define pcl_to_parameter_character(c) ((c) + ('a' - 'A'))
-
-/*****************************************************************************/
-
-#ifndef _pcl_Octet_defined
-#define _pcl_Octet_defined
-typedef unsigned char pcl_Octet;
-#endif
-
-typedef struct {
- unsigned short kind;
- /* The value can be in the range 1-6:
- 1: control code. chars[0] is this code and 'i' gives the number of its
- occurrences (positive).
- 2: two-character escape sequence. chars[0] is the second character, the
- first was ESC.
- 3: parameterized escape sequence. chars[0] is the parameterized
- character, chars[1] is the group character, and chars[2] is the
- termination character.
- 4: same as 3, except that the sequence is not terminated. In this case
- chars[2] is the octet which would be used as the termination
- character, not the octet actually read from the input stream
- (parameter character). pcl_to_parameter_character() can be used to
- obtain the latter.
- 5: same as 3, except that this is a part of a combined escape sequence
- started earlier.
- 6: same as 4, except that this is a part of a combined escape sequence
- started earlier.
- */
- pcl_Octet chars[3];
- pcl_Octet prefix;
- /* This can be one of:
- '\0': no value given
- ' ': value given without a sign
- '+': value given with prefix "+"
- '-': value given with prefix "-"
- */
- int i; /* integer part of the value (including the sign) */
- unsigned int scale;
- /* This can be zero or any power of ten. A value of zero means that the
- value was given without a decimal point, a value of one that there were
- no digits after the point. */
- int fraction;
- /* fractional part of the value (including the sign). The entire value is
- i + ((float)fraction)/scale, provided 'scale' is non-zero. */
-} pcl_Command;
-
-/*
- A negative return code indicates an error which will terminate scanning.
- A return code of zero indicates success.
- A positive return code indicates that the interpreter or handler does not know
- the command or the data and that the scanner should handle the case. */
-typedef int (*pcl_CommandInterpreter)(FILE *in, const pcl_Command *cmd,
- void *idata);
-typedef int (*pcl_UnknownDataHandler)(FILE *in, void *hdata);
-/* A handler for unknown data should never read over an ESC character which
- might start a printer command. */
-
-extern int pcl_is_control_code(int c);
-extern int pcl_scan(FILE *in, pcl_CommandInterpreter interpreter, void *idata,
- pcl_UnknownDataHandler handler, void *hdata);
-
-/*****************************************************************************/
-
-#endif /* Inclusion protection */
diff --git a/gs/contrib/pcl3/src/pclsize.c b/gs/contrib/pcl3/src/pclsize.c
deleted file mode 100644
index ec121a802..000000000
--- a/gs/contrib/pcl3/src/pclsize.c
+++ /dev/null
@@ -1,201 +0,0 @@
-/******************************************************************************
- File: $Id: pclsize.c,v 1.10 2001/08/18 17:41:49 Martin Rel $
- Contents: Maps between PCL Page Size codes und size information
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany. E-mail: Martin.Lottermoser@t-online.de.
-
-*******************************************************************************
-* *
-* Copyright (C) 1999, 2000 by Martin Lottermoser *
-* All rights reserved *
-* *
-******************************************************************************/
-
-/* Configuration management identification */
-#ifndef lint
-static const char
- cm_id[] = "@(#)$Id: pclsize.c,v 1.10 2001/08/18 17:41:49 Martin Rel $";
-#endif
-
-/*****************************************************************************/
-
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE 500
-#endif
-
-/* Standard headers */
-#include <stdlib.h>
-#include <string.h>
-
-/* Specific headers */
-#include "pclsize.h"
-
-/*****************************************************************************/
-
-/* Number of elements in an array */
-#define array_size(a) (sizeof(a)/sizeof(a[0]))
-
-/*****************************************************************************/
-
-/* Map from media code to PCL Page Size code
-
- This list is used to find a PCL Page Size code for a particular media code.
- It will be sorted by media code before the first use.
-
- This structure is based on the assumption that one needs only a single
- Page Size code for each supported media code. See the discussion in
- pclgen.h.
-*/
-
-typedef struct {
- ms_MediaCode mc;
- pcl_PageSize ps;
-} CodeEntry;
-
-#define me(keyword) {ms_##keyword, pcl_ps_##keyword}
-
-static CodeEntry code_map[] = {
- me(Executive),
- me(Letter),
- me(Legal),
- me(Tabloid),
- me(Statement),
- me(HPSuperB),
- me(A6),
- me(A5),
- me(A4),
- me(A3),
- me(JISB5),
- me(JISB4),
- me(Postcard),
- me(DoublePostcard),
- {ms_A6 | PCL_CARD_FLAG, pcl_ps_A6Card},
- me(Index4x6in),
- me(Index5x8in),
- me(Index3x5in),
- me(EnvMonarch),
- me(Env10),
- /* I've used 'pcl_ps_Env10' instead of 'pcl_ps_Env10_Negative' because of the
- DJ500 and DJ500C models which do not accept 'pcl_ps_Env10_Negative'. */
- me(EnvDL),
- me(EnvC5),
- me(EnvC6),
- me(ISOB5),
- me(CustomPageSize),
- me(EnvUS_A2),
- me(EnvChou3),
- me(EnvChou4),
- me(EnvKaku2)
-};
-
-#undef me
-
-/******************************************************************************
-
- Function: cmp_by_size
-
- This function compares two 'CodeEntry' instances by their media codes.
-
-******************************************************************************/
-
-static int cmp_by_size(const void *a, const void *b)
-{
- return ((const CodeEntry *)a)->mc - ((const CodeEntry *)b)->mc;
-}
-
-/******************************************************************************
-
- Function: pcl3_page_size
-
- If it knows a PCL Page Size code for the specified 'code', the function will
- return it. Otherwise the return value will be 'pcl_ps_default'.
-
- Flags in 'code' will be ignored except for PCL_CARD_FLAG.
-
-******************************************************************************/
-
-pcl_PageSize pcl3_page_size(ms_MediaCode code)
-{
- static pcl_bool initialized = FALSE;
- CodeEntry key;
- const CodeEntry *result;
-
- /* Sort the table if necessary */
- if (!initialized) {
- qsort(code_map, array_size(code_map), sizeof(CodeEntry), cmp_by_size);
- initialized = TRUE;
- }
-
- key.mc = ms_without_flags(code) | code & PCL_CARD_FLAG;
- result = (const CodeEntry *)bsearch(&key, code_map, array_size(code_map),
- sizeof(CodeEntry), cmp_by_size);
-
- return result == NULL? pcl_ps_default: result->ps;
-}
-
-/******************************************************************************
-
- Function: cmp_by_code
-
- This function compares two 'CodeEntry' instances by their PCL Page Size codes.
-
-******************************************************************************/
-
-static int cmp_by_code(const void *a, const void *b)
-{
- return ((const CodeEntry *)a)->ps - ((const CodeEntry *)b)->ps;
-}
-
-/******************************************************************************
-
- Function: pcl3_media_code
-
- This function will return a media code for the given PCL page size code.
- If the code is unknown, 'ms_none' will be returned.
-
-******************************************************************************/
-
-ms_MediaCode pcl3_media_code(pcl_PageSize code)
-{
- static CodeEntry inverse_map[array_size(code_map)];
- static pcl_bool initialized = FALSE;
- CodeEntry key;
- const CodeEntry *result;
-
- /* Construct the table if necessary */
- if (!initialized) {
- memcpy(&inverse_map, &code_map, sizeof(inverse_map));
- qsort(inverse_map, array_size(inverse_map), sizeof(CodeEntry), cmp_by_code);
- initialized = TRUE;
- }
-
- key.ps = code;
- result = (const CodeEntry *)bsearch(&key, inverse_map,
- array_size(inverse_map), sizeof(CodeEntry), cmp_by_code);
- if (result == NULL) {
- key.ps = -code;
- /* Actually, this is a generalization on my part: I am assuming that any
- two valid PCL Page Size codes with the same absolute value refer to the
- same media extension irrespective of sheet orientation in raster space.
- I have found negative Page Size codes in HP documentation only for
- Env10 and EnvDL. */
- result = (const CodeEntry *)bsearch(&key, inverse_map,
- array_size(inverse_map), sizeof(CodeEntry), cmp_by_code);
- }
-
- return result == NULL? ms_none: result->mc;
-}
-
-/******************************************************************************
-
- Function: pcl3_size_description
-
- This function will try to find a media size description for the specified
- 'code'. If the code is unknown, the function will return a NULL pointer.
-
-******************************************************************************/
-
-const ms_SizeDescription *pcl3_size_description(pcl_PageSize code)
-{
- return ms_find_size_from_code(pcl3_media_code(code));
-}
diff --git a/gs/contrib/pcl3/src/pclsize.h b/gs/contrib/pcl3/src/pclsize.h
deleted file mode 100644
index 7c9840980..000000000
--- a/gs/contrib/pcl3/src/pclsize.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/******************************************************************************
- File: $Id: pclsize.h,v 1.7 2000/11/19 07:05:17 Martin Rel $
- Contents: Header file for maps between PCL Page Size codes and size
- information
- Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
- Germany. E-mail: Martin.Lottermoser@t-online.de.
-
-*******************************************************************************
-* *
-* Copyright (C) 1999, 2000 by Martin Lottermoser *
-* All rights reserved *
-* *
-******************************************************************************/
-
-#ifndef _pclsize_h /* Inclusion protection */
-#define _pclsize_h
-
-/* Configuration management identification */
-#pragma ident "@(#)$Id: pclsize.h,v 1.7 2000/11/19 07:05:17 Martin Rel $"
-
-/*****************************************************************************/
-
-#include "mediasize.h"
-#include "pclgen.h"
-
-/* ms_MediaCode flag for distinguishing between sheets and cards */
-#define PCL_CARD_FLAG MS_USER_FLAG_1
-#define PCL_CARD_STRING "Card"
-
-extern pcl_PageSize pcl3_page_size(ms_MediaCode code);
-extern ms_MediaCode pcl3_media_code(pcl_PageSize code);
-extern const ms_SizeDescription *pcl3_size_description(pcl_PageSize size);
-
-/*****************************************************************************/
-
-#endif /* Inclusion protection */
diff --git a/gs/contrib/pcl3/src/zmedia2.c-5.50.diff b/gs/contrib/pcl3/src/zmedia2.c-5.50.diff
deleted file mode 100644
index 7df403598..000000000
--- a/gs/contrib/pcl3/src/zmedia2.c-5.50.diff
+++ /dev/null
@@ -1,33 +0,0 @@
-*** zmedia2.c.org Mon Feb 14 03:28:30 2000
---- zmedia2.c Sun Aug 19 12:16:31 2001
-***************
-*** 429,439 ****
-
- rx = ry, ry = temp;
- }
-! /* Adjust the medium size if flexible. */
-! if (medium->p.x < MIN_MEDIA_SIZE && mx > rx)
-! mx = rx;
-! if (medium->p.y < MIN_MEDIA_SIZE && my > ry)
-! my = ry;
-
- /* Translate to align the centers. */
- gs_make_translation(mx / 2, my / 2, pmat);
---- 429,445 ----
-
- rx = ry, ry = temp;
- }
-! /* If 'medium' is flexible, adjust 'mx' and 'my' towards 'rx' and 'ry',
-! respectively. Note that 'mx' and 'my' have just acquired the largest
-! permissible value, medium->q. */
-! if (medium->p.x < mx) /* non-empty width range */
-! if (rx < medium->p.x) mx = medium->p.x; /* minimum */
-! else if (mx > rx) mx = rx; /* fits */
-! /* else use medium->q.x, i.e., the maximum */
-! if (medium->p.y < my) /* non-empty height range */
-! if (ry < medium->p.y) my = medium->p.y; /* minimum */
-! else if (my > ry) my = ry; /* fits */
-! /* else use medium->q.y, i.e., the maximum */
-
- /* Translate to align the centers. */
- gs_make_translation(mx / 2, my / 2, pmat);
diff --git a/gs/contrib/pcl3/src/zmedia2.c-6.01.diff b/gs/contrib/pcl3/src/zmedia2.c-6.01.diff
deleted file mode 100644
index e46c31132..000000000
--- a/gs/contrib/pcl3/src/zmedia2.c-6.01.diff
+++ /dev/null
@@ -1,33 +0,0 @@
-*** zmedia2.c.org Thu Mar 9 09:40:45 2000
---- zmedia2.c Sun Aug 19 12:16:33 2001
-***************
-*** 427,437 ****
-
- rx = ry, ry = temp;
- }
-! /* Adjust the medium size if flexible. */
-! if (medium->p.x < MIN_MEDIA_SIZE && mx > rx)
-! mx = rx;
-! if (medium->p.y < MIN_MEDIA_SIZE && my > ry)
-! my = ry;
-
- /* Translate to align the centers. */
- gs_make_translation(mx / 2, my / 2, pmat);
---- 427,443 ----
-
- rx = ry, ry = temp;
- }
-! /* If 'medium' is flexible, adjust 'mx' and 'my' towards 'rx' and 'ry',
-! respectively. Note that 'mx' and 'my' have just acquired the largest
-! permissible value, medium->q. */
-! if (medium->p.x < mx) /* non-empty width range */
-! if (rx < medium->p.x) mx = medium->p.x; /* minimum */
-! else if (mx > rx) mx = rx; /* fits */
-! /* else use medium->q.x, i.e., the maximum */
-! if (medium->p.y < my) /* non-empty height range */
-! if (ry < medium->p.y) my = medium->p.y; /* minimum */
-! else if (my > ry) my = ry; /* fits */
-! /* else use medium->q.y, i.e., the maximum */
-
- /* Translate to align the centers. */
- gs_make_translation(mx / 2, my / 2, pmat);
diff --git a/gs/contrib/pcl3/src/zmedia2.c-6.50.diff b/gs/contrib/pcl3/src/zmedia2.c-6.50.diff
deleted file mode 100644
index 4e790ea11..000000000
--- a/gs/contrib/pcl3/src/zmedia2.c-6.50.diff
+++ /dev/null
@@ -1,33 +0,0 @@
-*** zmedia2.c.org Tue Sep 19 21:00:54 2000
---- zmedia2.c Sun Aug 19 12:16:35 2001
-***************
-*** 427,437 ****
-
- rx = ry, ry = temp;
- }
-! /* Adjust the medium size if flexible. */
-! if (medium->p.x < MIN_MEDIA_SIZE && mx > rx)
-! mx = rx;
-! if (medium->p.y < MIN_MEDIA_SIZE && my > ry)
-! my = ry;
-
- /* Translate to align the centers. */
- gs_make_translation(mx / 2, my / 2, pmat);
---- 427,443 ----
-
- rx = ry, ry = temp;
- }
-! /* If 'medium' is flexible, adjust 'mx' and 'my' towards 'rx' and 'ry',
-! respectively. Note that 'mx' and 'my' have just acquired the largest
-! permissible value, medium->q. */
-! if (medium->p.x < mx) /* non-empty width range */
-! if (rx < medium->p.x) mx = medium->p.x; /* minimum */
-! else if (mx > rx) mx = rx; /* fits */
-! /* else use medium->q.x, i.e., the maximum */
-! if (medium->p.y < my) /* non-empty height range */
-! if (ry < medium->p.y) my = medium->p.y; /* minimum */
-! else if (my > ry) my = ry; /* fits */
-! /* else use medium->q.y, i.e., the maximum */
-
- /* Translate to align the centers. */
- gs_make_translation(mx / 2, my / 2, pmat);
diff --git a/gs/contrib/pcl3/src/zmedia2.c-6.51.diff b/gs/contrib/pcl3/src/zmedia2.c-6.51.diff
deleted file mode 100644
index f1629369f..000000000
--- a/gs/contrib/pcl3/src/zmedia2.c-6.51.diff
+++ /dev/null
@@ -1,33 +0,0 @@
-*** zmedia2.c.org Mon Jul 30 07:30:12 2001
---- zmedia2.c Sun Aug 19 12:16:36 2001
-***************
-*** 430,440 ****
-
- rx = ry, ry = temp;
- }
-! /* Adjust the medium size if flexible. */
-! if (medium->p.x < MIN_MEDIA_SIZE && mx > rx)
-! mx = rx;
-! if (medium->p.y < MIN_MEDIA_SIZE && my > ry)
-! my = ry;
-
- /* Translate to align the centers. */
- gs_make_translation(mx / 2, my / 2, pmat);
---- 430,446 ----
-
- rx = ry, ry = temp;
- }
-! /* If 'medium' is flexible, adjust 'mx' and 'my' towards 'rx' and 'ry',
-! respectively. Note that 'mx' and 'my' have just acquired the largest
-! permissible value, medium->q. */
-! if (medium->p.x < mx) /* non-empty width range */
-! if (rx < medium->p.x) mx = medium->p.x; /* minimum */
-! else if (mx > rx) mx = rx; /* fits */
-! /* else use medium->q.x, i.e., the maximum */
-! if (medium->p.y < my) /* non-empty height range */
-! if (ry < medium->p.y) my = medium->p.y; /* minimum */
-! else if (my > ry) my = ry; /* fits */
-! /* else use medium->q.y, i.e., the maximum */
-
- /* Translate to align the centers. */
- gs_make_translation(mx / 2, my / 2, pmat);
diff --git a/gs/contrib/pcl3/src/zmedia2.c-7.00.diff b/gs/contrib/pcl3/src/zmedia2.c-7.00.diff
deleted file mode 100644
index 32dff6140..000000000
--- a/gs/contrib/pcl3/src/zmedia2.c-7.00.diff
+++ /dev/null
@@ -1,33 +0,0 @@
-*** zmedia2.c.org Tue Sep 19 21:00:54 2000
---- zmedia2.c Sun Aug 19 12:16:38 2001
-***************
-*** 427,437 ****
-
- rx = ry, ry = temp;
- }
-! /* Adjust the medium size if flexible. */
-! if (medium->p.x < MIN_MEDIA_SIZE && mx > rx)
-! mx = rx;
-! if (medium->p.y < MIN_MEDIA_SIZE && my > ry)
-! my = ry;
-
- /* Translate to align the centers. */
- gs_make_translation(mx / 2, my / 2, pmat);
---- 427,443 ----
-
- rx = ry, ry = temp;
- }
-! /* If 'medium' is flexible, adjust 'mx' and 'my' towards 'rx' and 'ry',
-! respectively. Note that 'mx' and 'my' have just acquired the largest
-! permissible value, medium->q. */
-! if (medium->p.x < mx) /* non-empty width range */
-! if (rx < medium->p.x) mx = medium->p.x; /* minimum */
-! else if (mx > rx) mx = rx; /* fits */
-! /* else use medium->q.x, i.e., the maximum */
-! if (medium->p.y < my) /* non-empty height range */
-! if (ry < medium->p.y) my = medium->p.y; /* minimum */
-! else if (my > ry) my = ry; /* fits */
-! /* else use medium->q.y, i.e., the maximum */
-
- /* Translate to align the centers. */
- gs_make_translation(mx / 2, my / 2, pmat);
diff --git a/gs/contrib/uniprint/PM760p.upp b/gs/contrib/uniprint/PM760p.upp
deleted file mode 100644
index 5d69b7264..000000000
--- a/gs/contrib/uniprint/PM760p.upp
+++ /dev/null
@@ -1,34 +0,0 @@
--supModel="Epson Stylus Photo PM760, 720x720DpI, Plain Paper"
--sDEVICE=uniprint
--dNOPAUSE
--dSAFER
--dupColorModel=/DeviceCMYKgenerate
--dupRendering=/FSCMYK32
--dupOutputFormat=/EscP2
--r720x720
--dupMargins="{ 9.0 31.0 9.0 9.0}"
--dupBlackTransfer="{ 0.0000 0.0260 0.0587 0.1079 0.2109 0.3750 }"
--dupCyanTransfer="{ 0.0000 0.0254 0.0620 0.1070 0.2250 0.4125 }"
--dupMagentaTransfer="{ 0.0000 0.0233 0.0569 0.0981 0.2063 0.4125 }"
--dupYellowTransfer="{ 0.0000 0.0212 0.0516 0.0891 0.2250 0.4125 }"
--dupOutputComponentOrder="{ 1 2 3 0 }"
--dupWeaveYPasses=8
--dupOutputPins=32
--dupWeaveYFeeds="{31 31 31 31 37 33 33 29}"
--dupWeaveInitialYFeeds="{1 1 1 1 1 1 1 25}"
--dupWeaveInitialPins="{ 4 24 28 32 19 15 11 7}"
--dupBeginJobCommand="(\000\000\000\000\000\000\033\001@EJL\0401284.4\012@EJL\040\040\040\040\040\012)"
--dupBeginPageCommand="<
- 1b40 1b40
- 1b2847 0100 01
- 1b2855 0100 05
- 1b5501
- 1b2865 0200 0000
- 1b2843 0200 0000
- 1b2863 0400 0000 0000
->"
--dupAdjustPageLengthCommand
--dupAdjustTopMarginCommand
--dupAdjustBottomMarginCommand
--dupEndPageCommand="(\033@\014)"
--dupAbortCommand="(\033@\15\12\12\12\12 Printout-Aborted\15\014)"
diff --git a/gs/contrib/uniprint/PM760pl.upp b/gs/contrib/uniprint/PM760pl.upp
deleted file mode 100644
index f095a83d2..000000000
--- a/gs/contrib/uniprint/PM760pl.upp
+++ /dev/null
@@ -1,34 +0,0 @@
--supModel="Epson Stylus Photo PM760, 360x360DpI, Plain Paper"
--sDEVICE=uniprint
--dNOPAUSE
--dSAFER
--dupColorModel=/DeviceCMYKgenerate
--dupRendering=/FSCMYK32
--dupOutputFormat=/EscP2
--r360x360
--dupMargins="{ 9.0 31.0 9.0 9.0}"
--dupBlackTransfer="{ 0.0000 0.0550 0.1250 0.2300 0.4500 0.8000 }"
--dupCyanTransfer="{ 0.0000 0.0540 0.1320 0.2280 0.4800 0.8800 }"
--dupMagentaTransfer="{ 0.0000 0.0495 0.1210 0.2090 0.4400 0.8800 }"
--dupYellowTransfer="{ 0.0000 0.0450 0.1100 0.1900 0.4800 0.8800 }"
--dupOutputComponentOrder="{ 1 2 3 0 }"
--dupWeaveYPasses=4
--dupOutputPins=32
--dupWeaveYFeeds="{33 30 35 30}"
--dupWeaveInitialYFeeds="{1 1 1 29}"
--dupWeaveInitialPins="{ 8 16 32 23}"
--dupBeginJobCommand="(\000\000\000\000\000\000\033\001@EJL\0401284.4\012@EJL\040\040\040\040\040\012)"
--dupBeginPageCommand="<
- 1b40 1b40
- 1b2847 0100 01
- 1b2855 0100 0A
- 1b5501
- 1b2865 0200 0000
- 1b2843 0200 0000
- 1b2863 0400 0000 0000
->"
--dupAdjustPageLengthCommand
--dupAdjustTopMarginCommand
--dupAdjustBottomMarginCommand
--dupEndPageCommand="(\033@\014)"
--dupAbortCommand="(\033@\15\12\12\12\12 Printout-Aborted\15\014)"
diff --git a/gs/contrib/uniprint/PM820p.upp b/gs/contrib/uniprint/PM820p.upp
deleted file mode 100644
index dfac6193d..000000000
--- a/gs/contrib/uniprint/PM820p.upp
+++ /dev/null
@@ -1,34 +0,0 @@
--supModel="Epson Stylus Photo PM820, 720x720DpI, Plain Paper"
--sDEVICE=uniprint
--dNOPAUSE
--dSAFER
--dupColorModel=/DeviceCMYKgenerate
--dupRendering=/FSCMYK32
--dupOutputFormat=/EscP2
--r720x720
--dupMargins="{ 9.0 31.0 9.0 9.0}"
--dupBlackTransfer="{ 0.0000 0.0260 0.0587 0.1079 0.2109 0.3750 }"
--dupCyanTransfer="{ 0.0000 0.0254 0.0620 0.1070 0.2250 0.4125 }"
--dupMagentaTransfer="{ 0.0000 0.0233 0.0569 0.0981 0.2063 0.4125 }"
--dupYellowTransfer="{ 0.0000 0.0212 0.0516 0.0891 0.2250 0.4125 }"
--dupOutputComponentOrder="{ 1 2 3 0 }"
--dupWeaveYPasses=6
--dupOutputPins=48
--dupWeaveYFeeds="{47 47 47 53 47 47}"
--dupWeaveInitialYFeeds="{1 1 1 1 1 43}"
--dupWeaveInitialPins="{ 8 48 40 31 23 15}"
--dupBeginJobCommand="(\000\000\000\000\000\000\033\001@EJL\0401284.4\012@EJL\040\040\040\040\040\012)"
--dupBeginPageCommand="<
- 1b40 1b40
- 1b2847 0100 01
- 1b2855 0100 05
- 1b5501
- 1b2865 0200 0000
- 1b2843 0200 0000
- 1b2863 0400 0000 0000
->"
--dupAdjustPageLengthCommand
--dupAdjustTopMarginCommand
--dupAdjustBottomMarginCommand
--dupEndPageCommand="(\033@\014)"
--dupAbortCommand="(\033@\15\12\12\12\12 Printout-Aborted\15\014)"
diff --git a/gs/contrib/uniprint/PM820pl.upp b/gs/contrib/uniprint/PM820pl.upp
deleted file mode 100644
index 96b40231b..000000000
--- a/gs/contrib/uniprint/PM820pl.upp
+++ /dev/null
@@ -1,34 +0,0 @@
--supModel="Epson Stylus Photo PM820, 360x360DpI, Plain Paper"
--sDEVICE=uniprint
--dNOPAUSE
--dSAFER
--dupColorModel=/DeviceCMYKgenerate
--dupRendering=/FSCMYK32
--dupOutputFormat=/EscP2
--r360x360
--dupMargins="{ 9.0 31.0 9.0 9.0}"
--dupBlackTransfer="{ 0.0000 0.0550 0.1250 0.2300 0.4500 0.8000 }"
--dupCyanTransfer="{ 0.0000 0.0540 0.1320 0.2280 0.4800 0.8800 }"
--dupMagentaTransfer="{ 0.0000 0.0495 0.1210 0.2090 0.4400 0.8800 }"
--dupYellowTransfer="{ 0.0000 0.0450 0.1100 0.1900 0.4800 0.8800 }"
--dupOutputComponentOrder="{ 1 2 3 0 }"
--dupWeaveYPasses=3
--dupOutputPins=48
--dupWeaveYFeeds="{52 46 46}"
--dupWeaveInitialYFeeds="{1 1 46}"
--dupWeaveInitialPins="{ 16 33 48}"
--dupBeginJobCommand="(\000\000\000\000\000\000\033\001@EJL\0401284.4\012@EJL\040\040\040\040\040\012)"
--dupBeginPageCommand="<
- 1b40 1b40
- 1b2847 0100 01
- 1b2855 0100 0A
- 1b5501
- 1b2865 0200 0000
- 1b2843 0200 0000
- 1b2863 0400 0000 0000
->"
--dupAdjustPageLengthCommand
--dupAdjustTopMarginCommand
--dupAdjustBottomMarginCommand
--dupEndPageCommand="(\033@\014)"
--dupAbortCommand="(\033@\15\12\12\12\12 Printout-Aborted\15\014)"
diff --git a/gs/contrib/uniprint/Stc670p.upp b/gs/contrib/uniprint/Stc670p.upp
deleted file mode 100644
index 2e94ceddf..000000000
--- a/gs/contrib/uniprint/Stc670p.upp
+++ /dev/null
@@ -1,35 +0,0 @@
--supModel="Epson Stylus Color 670, 720x720DpI, Plain Paper"
--sDEVICE=uniprint
--dNOPAUSE
--dSAFER
--dupColorModel=/DeviceCMYKgenerate
--dupRendering=/FSCMYK32
--dupOutputFormat=/EscP2
--r720x720
--dupMargins="{ 9.0 31.0 9.0 9.0}"
--dupBlackTransfer="{ 0.0000 0.0173 0.0391 0.0719 0.1406 0.2500 }"
--dupCyanTransfer="{ 0.0000 0.0169 0.0413 0.0713 0.1500 0.2750 }"
--dupMagentaTransfer="{ 0.0000 0.0155 0.0379 0.0654 0.1375 0.2750 }"
--dupYellowTransfer="{ 0.0000 0.0141 0.0344 0.0594 0.1500 0.2750 }"
--dupOutputComponentOrder="{ 1 2 3 0 }"
--dupWeaveYPasses=8
--dupOutputPins=32
--dupWeaveYFeeds="{31 31 31 31 37 33 33 29}"
--dupWeaveInitialYFeeds="{1 1 1 1 1 1 1 25}"
--dupWeaveInitialPins="{ 4 24 28 32 19 15 11 7}"
--dupBeginJobCommand="(\000\000\000\000\000\000\033\001@EJL\0401284.4\012@EJL\040\040\040\040\040\012)"
--dupBeginPageCommand="<
- 1b40 1b40
- 1b2847 0100 01
- 1b2855 0100 05
- 1b5501
- 1b2865 0200 0000
- 1b2843 0200 0000
- 1b2863 0400 0000 0000
->"
--dupAdjustPageLengthCommand
--dupAdjustTopMarginCommand
--dupAdjustBottomMarginCommand
--dupEndPageCommand="(\033@\014)"
--dupAbortCommand="(\033@\15\12\12\12\12 Printout-Aborted\15\014)"
-
diff --git a/gs/contrib/uniprint/Stc670pl.upp b/gs/contrib/uniprint/Stc670pl.upp
deleted file mode 100644
index 5c5fc8daa..000000000
--- a/gs/contrib/uniprint/Stc670pl.upp
+++ /dev/null
@@ -1,35 +0,0 @@
--supModel="Epson Stylus Color 670, 360x360DpI, Plain Paper"
--sDEVICE=uniprint
--dNOPAUSE
--dSAFER
--dupColorModel=/DeviceCMYKgenerate
--dupRendering=/FSCMYK32
--dupOutputFormat=/EscP2
--r360x360
--dupMargins="{ 9.0 39.96 9.0 9.0}"
--dupBlackTransfer="{ 0.0000 0.0550 0.1250 0.2300 0.4500 0.8000 }"
--dupCyanTransfer="{ 0.0000 0.0540 0.1320 0.2280 0.4800 0.8800 }"
--dupMagentaTransfer="{ 0.0000 0.0495 0.1210 0.2090 0.4400 0.8800 }"
--dupYellowTransfer="{ 0.0000 0.0450 0.1100 0.1900 0.4800 0.8800 }"
--dupOutputComponentOrder="{ 1 2 3 0 }"
--dupWeaveYPasses=4
--dupOutputPins=32
--dupWeaveYFeeds="{33 30 35 30}"
--dupWeaveInitialYFeeds="{1 1 1 29}"
--dupWeaveInitialPins="{ 8 16 32 23}"
--dupBeginJobCommand="(\000\000\000\000\000\000\033\001@EJL\0401284.4\012@EJL\040\040\040\040\040\012)"
--dupBeginPageCommand="<
- 1b40 1b40
- 1b2847 0100 01
- 1b2855 0100 0A
- 1b5501
- 1b2865 0200 0000
- 1b2843 0200 0000
- 1b2863 0400 0000 0000
->"
--dupAdjustPageLengthCommand
--dupAdjustTopMarginCommand
--dupAdjustBottomMarginCommand
--dupEndPageCommand="(\033@\014)"
--dupAbortCommand="(\033@\15\12\12\12\12 Printout-Aborted\15\014)"
-
diff --git a/gs/contrib/uniprint/Stc680p.upp b/gs/contrib/uniprint/Stc680p.upp
deleted file mode 100644
index 80b28d5b3..000000000
--- a/gs/contrib/uniprint/Stc680p.upp
+++ /dev/null
@@ -1,34 +0,0 @@
--supModel="Epson Stylus Color 680, 720x720DpI, Plain Paper"
--sDEVICE=uniprint
--dNOPAUSE
--dSAFER
--dupColorModel=/DeviceCMYKgenerate
--dupRendering=/FSCMYK32
--dupOutputFormat=/EscP2
--r720x720
--dupMargins="{ 9.0 31.0 9.0 9.0}"
--dupBlackTransfer="{ 0.0000 0.0173 0.0391 0.0719 0.1406 0.2500 }"
--dupCyanTransfer="{ 0.0000 0.0169 0.0413 0.0713 0.1500 0.2750 }"
--dupMagentaTransfer="{ 0.0000 0.0155 0.0379 0.0654 0.1375 0.2750 }"
--dupYellowTransfer="{ 0.0000 0.0141 0.0344 0.0594 0.1500 0.2750 }"
--dupOutputComponentOrder="{ 1 2 3 0 }"
--dupWeaveYPasses=6
--dupOutputPins=48
--dupWeaveYFeeds="{47 47 47 53 47 47}"
--dupWeaveInitialYFeeds="{1 1 1 1 1 43}"
--dupWeaveInitialPins="{ 8 48 40 31 23 15}"
--dupBeginJobCommand="(\000\000\000\000\000\000\033\001@EJL\0401284.4\012@EJL\040\040\040\040\040\012)"
--dupBeginPageCommand="<
- 1b40 1b40
- 1b2847 0100 01
- 1b2855 0100 05
- 1b5501
- 1b2865 0200 0000
- 1b2843 0200 0000
- 1b2863 0400 0000 0000
->"
--dupAdjustPageLengthCommand
--dupAdjustTopMarginCommand
--dupAdjustBottomMarginCommand
--dupEndPageCommand="(\033@\014)"
--dupAbortCommand="(\033@\15\12\12\12\12 Printout-Aborted\15\014)"
diff --git a/gs/contrib/uniprint/Stc680pl.upp b/gs/contrib/uniprint/Stc680pl.upp
deleted file mode 100644
index 5baa44a6a..000000000
--- a/gs/contrib/uniprint/Stc680pl.upp
+++ /dev/null
@@ -1,34 +0,0 @@
--supModel="Epson Stylus Color 680, 360x360DpI, Plain Paper"
--sDEVICE=uniprint
--dNOPAUSE
--dSAFER
--dupColorModel=/DeviceCMYKgenerate
--dupRendering=/FSCMYK32
--dupOutputFormat=/EscP2
--r360x360
--dupMargins="{ 9.0 31.0 9.0 9.0}"
--dupBlackTransfer="{ 0.0000 0.0550 0.1250 0.2300 0.4500 0.8000 }"
--dupCyanTransfer="{ 0.0000 0.0540 0.1320 0.2280 0.4800 0.8800 }"
--dupMagentaTransfer="{ 0.0000 0.0495 0.1210 0.2090 0.4400 0.8800 }"
--dupYellowTransfer="{ 0.0000 0.0450 0.1100 0.1900 0.4800 0.8800 }"
--dupOutputComponentOrder="{ 1 2 3 0 }"
--dupWeaveYPasses=3
--dupOutputPins=48
--dupWeaveYFeeds="{52 46 46}"
--dupWeaveInitialYFeeds="{1 1 46}"
--dupWeaveInitialPins="{ 16 33 48}"
--dupBeginJobCommand="(\000\000\000\000\000\000\033\001@EJL\0401284.4\012@EJL\040\040\040\040\040\012)"
--dupBeginPageCommand="<
- 1b40 1b40
- 1b2847 0100 01
- 1b2855 0100 0A
- 1b5501
- 1b2865 0200 0000
- 1b2843 0200 0000
- 1b2863 0400 0000 0000
->"
--dupAdjustPageLengthCommand
--dupAdjustTopMarginCommand
--dupAdjustBottomMarginCommand
--dupEndPageCommand="(\033@\014)"
--dupAbortCommand="(\033@\15\12\12\12\12 Printout-Aborted\15\014)"
diff --git a/gs/contrib/uniprint/Stc740p.upp b/gs/contrib/uniprint/Stc740p.upp
deleted file mode 100644
index 6fb561b81..000000000
--- a/gs/contrib/uniprint/Stc740p.upp
+++ /dev/null
@@ -1,34 +0,0 @@
--supModel="Epson Stylus Color 740, 720x720DpI, Plain Paper"
--sDEVICE=uniprint
--dNOPAUSE
--dSAFER
--dupColorModel=/DeviceCMYKgenerate
--dupRendering=/FSCMYK32
--dupOutputFormat=/EscP2
--r720x720
--dupMargins="{ 9.0 39.96 9.0 9.0}"
--dupBlackTransfer="{ 0.0000 0.0550 0.1250 0.2300 0.4500 0.8000 }"
--dupCyanTransfer="{ 0.0000 0.0540 0.1320 0.2280 0.4800 0.8800 }"
--dupMagentaTransfer="{ 0.0000 0.0495 0.1210 0.2090 0.4400 0.8800 }"
--dupYellowTransfer="{ 0.0000 0.0450 0.1100 0.1900 0.4800 0.8800 }"
--dupOutputComponentOrder="{ 1 2 3 0 }"
--dupWeaveYPasses=6
--dupOutputPins=48
--dupWeaveYFeeds="{47 47 47 53 47 47}"
--dupWeaveInitialYFeeds="{1 1 1 1 1 43}"
--dupWeaveInitialPins="{ 8 48 40 31 23 15}"
--dupBeginPageCommand="<
- 1b40 1b40
- 1b2847 0100 01
- 1b2855 0100 05
- 1b5501
- 1b2865 0200 0002
- 1b2843 0200 0000
- 1b2863 0400 0000 0000
->"
--dupAdjustPageLengthCommand
--dupAdjustTopMarginCommand
--dupAdjustBottomMarginCommand
--dupEndPageCommand="(\033@\014)"
--dupAbortCommand="(\033@\15\12\12\12\12 Printout-Aborted\15\014)"
-
diff --git a/gs/contrib/uniprint/Stc740pl.upp b/gs/contrib/uniprint/Stc740pl.upp
deleted file mode 100644
index 4ed68d7bd..000000000
--- a/gs/contrib/uniprint/Stc740pl.upp
+++ /dev/null
@@ -1,35 +0,0 @@
--supModel="Epson Stylus Color 740, 360x360DpI, Plain Paper"
--sDEVICE=uniprint
--dNOPAUSE
--dSAFER
--dupColorModel=/DeviceCMYKgenerate
--dupRendering=/FSCMYK32
--dupOutputFormat=/EscP2
--r360x360
--dupMargins="{ 9.0 31.0 9.0 9.0}"
--dupBlackTransfer="{ 0.0000 0.0550 0.1250 0.2300 0.4500 0.8000 }"
--dupCyanTransfer="{ 0.0000 0.0540 0.1320 0.2280 0.4800 0.8800 }"
--dupMagentaTransfer="{ 0.0000 0.0495 0.1210 0.2090 0.4400 0.8800 }"
--dupYellowTransfer="{ 0.0000 0.0450 0.1100 0.1900 0.4800 0.8800 }"
--dupOutputComponentOrder="{ 1 2 3 0 }"
--dupWeaveYPasses=3
--dupOutputPins=48
--dupWeaveYFeeds="{47 47 50}"
--dupWeaveInitialYFeeds="{1 1 46}"
--dupWeaveInitialPins="{ 16 48 31}"
--dupBeginJobCommand="(\000\000\000\000\000\000\033\001@EJL\0401284.4\012@EJL\040\040\040\040\040\012)"
--dupBeginPageCommand="<
- 1b40 1b40
- 1b2847 0100 01
- 1b2855 0100 0A
- 1b5501
- 1b2865 0200 0000
- 1b2843 0200 0000
- 1b2863 0400 0000 0000
->"
--dupAdjustPageLengthCommand
--dupAdjustTopMarginCommand
--dupAdjustBottomMarginCommand
--dupEndPageCommand="(\033@\014)"
--dupAbortCommand="(\033@\15\12\12\12\12 Printout-Aborted\15\014)"
-
diff --git a/gs/contrib/uniprint/Stc760p.upp b/gs/contrib/uniprint/Stc760p.upp
deleted file mode 100644
index 14dea4120..000000000
--- a/gs/contrib/uniprint/Stc760p.upp
+++ /dev/null
@@ -1,35 +0,0 @@
--supModel="Epson Stylus Color 760, 720x720DpI, Plain Paper"
--sDEVICE=uniprint
--dNOPAUSE
--dSAFER
--dupColorModel=/DeviceCMYKgenerate
--dupRendering=/FSCMYK32
--dupOutputFormat=/EscP2
--r720x720
--dupMargins="{ 9.0 31.0 9.0 9.0}"
--dupBlackTransfer="{ 0.0000 0.0173 0.0391 0.0719 0.1406 0.2500 }"
--dupCyanTransfer="{ 0.0000 0.0169 0.0413 0.0713 0.1500 0.2750 }"
--dupMagentaTransfer="{ 0.0000 0.0155 0.0379 0.0654 0.1375 0.2750 }"
--dupYellowTransfer="{ 0.0000 0.0141 0.0344 0.0594 0.1500 0.2750 }"
--dupOutputComponentOrder="{ 1 2 3 0 }"
--dupWeaveYPasses=6
--dupOutputPins=48
--dupWeaveYFeeds="{47 47 47 53 47 47}"
--dupWeaveInitialYFeeds="{1 1 1 1 1 43}"
--dupWeaveInitialPins="{ 8 48 40 31 23 15}"
--dupBeginJobCommand="(\000\000\000\000\000\000\033\001@EJL\0401284.4\012@EJL\040\040\040\040\040\012)"
--dupBeginPageCommand="<
- 1b40 1b40
- 1b2847 0100 01
- 1b2855 0100 05
- 1b5501
- 1b2865 0200 0000
- 1b2843 0200 0000
- 1b2863 0400 0000 0000
->"
--dupAdjustPageLengthCommand
--dupAdjustTopMarginCommand
--dupAdjustBottomMarginCommand
--dupEndPageCommand="(\033@\014)"
--dupAbortCommand="(\033@\15\12\12\12\12 Printout-Aborted\15\014)"
-
diff --git a/gs/contrib/uniprint/Stc760pl.upp b/gs/contrib/uniprint/Stc760pl.upp
deleted file mode 100644
index a7f0d0f4c..000000000
--- a/gs/contrib/uniprint/Stc760pl.upp
+++ /dev/null
@@ -1,34 +0,0 @@
--supModel="Epson Stylus Color 760, 360x360DpI, Plain Paper"
--sDEVICE=uniprint
--dNOPAUSE
--dSAFER
--dupColorModel=/DeviceCMYKgenerate
--dupRendering=/FSCMYK32
--dupOutputFormat=/EscP2
--r360x360
--dupMargins="{ 9.0 31.0 9.0 9.0}"
--dupBlackTransfer="{ 0.0000 0.0550 0.1250 0.2300 0.4500 0.8000 }"
--dupCyanTransfer="{ 0.0000 0.0540 0.1320 0.2280 0.4800 0.8800 }"
--dupMagentaTransfer="{ 0.0000 0.0495 0.1210 0.2090 0.4400 0.8800 }"
--dupYellowTransfer="{ 0.0000 0.0450 0.1100 0.1900 0.4800 0.8800 }"
--dupOutputComponentOrder="{ 1 2 3 0 }"
--dupWeaveYPasses=3
--dupOutputPins=48
--dupWeaveYFeeds="{52 46 46}"
--dupWeaveInitialYFeeds="{1 1 46}"
--dupWeaveInitialPins="{ 16 33 48}"
--dupBeginJobCommand="(\000\000\000\000\000\000\033\001@EJL\0401284.4\012@EJL\040\040\040\040\040\012)"
--dupBeginPageCommand="<
- 1b40 1b40
- 1b2847 0100 01
- 1b2855 0100 0A
- 1b5501
- 1b2865 0200 0000
- 1b2843 0200 0000
- 1b2863 0400 0000 0000
->"
--dupAdjustPageLengthCommand
--dupAdjustTopMarginCommand
--dupAdjustBottomMarginCommand
--dupEndPageCommand="(\033@\014)"
--dupAbortCommand="(\033@\15\12\12\12\12 Printout-Aborted\15\014)"
diff --git a/gs/contrib/uniprint/Stc777p.upp b/gs/contrib/uniprint/Stc777p.upp
deleted file mode 100644
index 6840e51d2..000000000
--- a/gs/contrib/uniprint/Stc777p.upp
+++ /dev/null
@@ -1,34 +0,0 @@
--supModel="Epson Stylus Color 777, 720x720DpI, Plain Paper"
--sDEVICE=uniprint
--dNOPAUSE
--dSAFER
--dupColorModel=/DeviceCMYKgenerate
--dupRendering=/FSCMYK32
--dupOutputFormat=/EscP2
--r720x720
--dupMargins="{ 9.0 31.0 9.0 9.0}"
--dupBlackTransfer="{ 0.0000 0.0173 0.0391 0.0719 0.1406 0.2500 }"
--dupCyanTransfer="{ 0.0000 0.0169 0.0413 0.0713 0.1500 0.2750 }"
--dupMagentaTransfer="{ 0.0000 0.0155 0.0379 0.0654 0.1375 0.2750 }"
--dupYellowTransfer="{ 0.0000 0.0141 0.0344 0.0594 0.1500 0.2750 }"
--dupOutputComponentOrder="{ 1 2 3 0 }"
--dupWeaveYPasses=6
--dupOutputPins=48
--dupWeaveYFeeds="{47 47 47 53 47 47}"
--dupWeaveInitialYFeeds="{1 1 1 1 1 43}"
--dupWeaveInitialPins="{ 8 48 40 31 23 15}"
--dupBeginJobCommand="(\000\000\000\000\000\000\033\001@EJL\0401284.4\012@EJL\040\040\040\040\040\012)"
--dupBeginPageCommand="<
- 1b40 1b40
- 1b2847 0100 01
- 1b2855 0100 05
- 1b5501
- 1b2865 0200 0000
- 1b2843 0200 0000
- 1b2863 0400 0000 0000
->"
--dupAdjustPageLengthCommand
--dupAdjustTopMarginCommand
--dupAdjustBottomMarginCommand
--dupEndPageCommand="(\033@\014)"
--dupAbortCommand="(\033@\15\12\12\12\12 Printout-Aborted\15\014)"
diff --git a/gs/contrib/uniprint/Stc777pl.upp b/gs/contrib/uniprint/Stc777pl.upp
deleted file mode 100644
index e63de07d0..000000000
--- a/gs/contrib/uniprint/Stc777pl.upp
+++ /dev/null
@@ -1,34 +0,0 @@
--supModel="Epson Stylus Color 777, 360x360DpI, Plain Paper"
--sDEVICE=uniprint
--dNOPAUSE
--dSAFER
--dupColorModel=/DeviceCMYKgenerate
--dupRendering=/FSCMYK32
--dupOutputFormat=/EscP2
--r360x360
--dupMargins="{ 9.0 31.0 9.0 9.0}"
--dupBlackTransfer="{ 0.0000 0.0550 0.1250 0.2300 0.4500 0.8000 }"
--dupCyanTransfer="{ 0.0000 0.0540 0.1320 0.2280 0.4800 0.8800 }"
--dupMagentaTransfer="{ 0.0000 0.0495 0.1210 0.2090 0.4400 0.8800 }"
--dupYellowTransfer="{ 0.0000 0.0450 0.1100 0.1900 0.4800 0.8800 }"
--dupOutputComponentOrder="{ 1 2 3 0 }"
--dupWeaveYPasses=3
--dupOutputPins=48
--dupWeaveYFeeds="{52 46 46}"
--dupWeaveInitialYFeeds="{1 1 46}"
--dupWeaveInitialPins="{ 16 33 48}"
--dupBeginJobCommand="(\000\000\000\000\000\000\033\001@EJL\0401284.4\012@EJL\040\040\040\040\040\012)"
--dupBeginPageCommand="<
- 1b40 1b40
- 1b2847 0100 01
- 1b2855 0100 0A
- 1b5501
- 1b2865 0200 0000
- 1b2843 0200 0000
- 1b2863 0400 0000 0000
->"
--dupAdjustPageLengthCommand
--dupAdjustTopMarginCommand
--dupAdjustBottomMarginCommand
--dupEndPageCommand="(\033@\014)"
--dupAbortCommand="(\033@\15\12\12\12\12 Printout-Aborted\15\014)"
diff --git a/gs/contrib/uniprint/Stp720p.upp b/gs/contrib/uniprint/Stp720p.upp
deleted file mode 100644
index 137b0efcf..000000000
--- a/gs/contrib/uniprint/Stp720p.upp
+++ /dev/null
@@ -1,34 +0,0 @@
--supModel="Epson Stylus Photo 720, 720x720DpI, Plain Paper"
--sDEVICE=uniprint
--dNOPAUSE
--dSAFER
--dupColorModel=/DeviceCMYKgenerate
--dupRendering=/FSCMYK32
--dupOutputFormat=/EscP2
--r720x720
--dupMargins="{ 9.0 31.0 9.0 9.0}"
--dupBlackTransfer="{ 0.0000 0.0260 0.0587 0.1079 0.2109 0.3750 }"
--dupCyanTransfer="{ 0.0000 0.0254 0.0620 0.1070 0.2250 0.4125 }"
--dupMagentaTransfer="{ 0.0000 0.0233 0.0569 0.0981 0.2063 0.4125 }"
--dupYellowTransfer="{ 0.0000 0.0212 0.0516 0.0891 0.2250 0.4125 }"
--dupOutputComponentOrder="{ 1 2 3 0 }"
--dupWeaveYPasses=8
--dupOutputPins=32
--dupWeaveYFeeds="{31 31 31 31 37 33 33 29}"
--dupWeaveInitialYFeeds="{1 1 1 1 1 1 1 25}"
--dupWeaveInitialPins="{ 4 24 28 32 19 15 11 7}"
--dupBeginJobCommand="(\000\000\000\000\000\000\033\001@EJL\0401284.4\012@EJL\040\040\040\040\040\012)"
--dupBeginPageCommand="<
- 1b40 1b40
- 1b2847 0100 01
- 1b2855 0100 05
- 1b5501
- 1b2865 0200 0000
- 1b2843 0200 0000
- 1b2863 0400 0000 0000
->"
--dupAdjustPageLengthCommand
--dupAdjustTopMarginCommand
--dupAdjustBottomMarginCommand
--dupEndPageCommand="(\033@\014)"
--dupAbortCommand="(\033@\15\12\12\12\12 Printout-Aborted\15\014)"
diff --git a/gs/contrib/uniprint/Stp720pl.upp b/gs/contrib/uniprint/Stp720pl.upp
deleted file mode 100644
index f441c43d2..000000000
--- a/gs/contrib/uniprint/Stp720pl.upp
+++ /dev/null
@@ -1,34 +0,0 @@
--supModel="Epson Photo 720, 360x360DpI, Plain Paper"
--sDEVICE=uniprint
--dNOPAUSE
--dSAFER
--dupColorModel=/DeviceCMYKgenerate
--dupRendering=/FSCMYK32
--dupOutputFormat=/EscP2
--r360x360
--dupMargins="{ 9.0 31.0 9.0 9.0}"
--dupBlackTransfer="{ 0.0000 0.0550 0.1250 0.2300 0.4500 0.8000 }"
--dupCyanTransfer="{ 0.0000 0.0540 0.1320 0.2280 0.4800 0.8800 }"
--dupMagentaTransfer="{ 0.0000 0.0495 0.1210 0.2090 0.4400 0.8800 }"
--dupYellowTransfer="{ 0.0000 0.0450 0.1100 0.1900 0.4800 0.8800 }"
--dupOutputComponentOrder="{ 1 2 3 0 }"
--dupWeaveYPasses=4
--dupOutputPins=32
--dupWeaveYFeeds="{33 30 35 30}"
--dupWeaveInitialYFeeds="{1 1 1 29}"
--dupWeaveInitialPins="{ 8 16 32 23}"
--dupBeginJobCommand="(\000\000\000\000\000\000\033\001@EJL\0401284.4\012@EJL\040\040\040\040\040\012)"
--dupBeginPageCommand="<
- 1b40 1b40
- 1b2847 0100 01
- 1b2855 0100 0A
- 1b5501
- 1b2865 0200 0000
- 1b2843 0200 0000
- 1b2863 0400 0000 0000
->"
--dupAdjustPageLengthCommand
--dupAdjustTopMarginCommand
--dupAdjustBottomMarginCommand
--dupEndPageCommand="(\033@\014)"
--dupAbortCommand="(\033@\15\12\12\12\12 Printout-Aborted\15\014)"
diff --git a/gs/contrib/uniprint/Stp870p.upp b/gs/contrib/uniprint/Stp870p.upp
deleted file mode 100644
index 4bb18cb8f..000000000
--- a/gs/contrib/uniprint/Stp870p.upp
+++ /dev/null
@@ -1,34 +0,0 @@
--supModel="Epson Stylus Photo 870, 720x720DpI, Plain Paper"
--sDEVICE=uniprint
--dNOPAUSE
--dSAFER
--dupColorModel=/DeviceCMYKgenerate
--dupRendering=/FSCMYK32
--dupOutputFormat=/EscP2
--r720x720
--dupMargins="{ 9.0 31.0 9.0 9.0}"
--dupBlackTransfer="{ 0.0000 0.0260 0.0587 0.1079 0.2109 0.3750 }"
--dupCyanTransfer="{ 0.0000 0.0254 0.0620 0.1070 0.2250 0.4125 }"
--dupMagentaTransfer="{ 0.0000 0.0233 0.0569 0.0981 0.2063 0.4125 }"
--dupYellowTransfer="{ 0.0000 0.0212 0.0516 0.0891 0.2250 0.4125 }"
--dupOutputComponentOrder="{ 1 2 3 0 }"
--dupWeaveYPasses=6
--dupOutputPins=48
--dupWeaveYFeeds="{47 47 47 53 47 47}"
--dupWeaveInitialYFeeds="{1 1 1 1 1 43}"
--dupWeaveInitialPins="{ 8 48 40 31 23 15}"
--dupBeginJobCommand="(\000\000\000\000\000\000\033\001@EJL\0401284.4\012@EJL\040\040\040\040\040\012)"
--dupBeginPageCommand="<
- 1b40 1b40
- 1b2847 0100 01
- 1b2855 0100 05
- 1b5501
- 1b2865 0200 0000
- 1b2843 0200 0000
- 1b2863 0400 0000 0000
->"
--dupAdjustPageLengthCommand
--dupAdjustTopMarginCommand
--dupAdjustBottomMarginCommand
--dupEndPageCommand="(\033@\014)"
--dupAbortCommand="(\033@\15\12\12\12\12 Printout-Aborted\15\014)"
diff --git a/gs/contrib/uniprint/Stp870pl.upp b/gs/contrib/uniprint/Stp870pl.upp
deleted file mode 100644
index 8f6eccac2..000000000
--- a/gs/contrib/uniprint/Stp870pl.upp
+++ /dev/null
@@ -1,34 +0,0 @@
--supModel="Epson Stylus Photo 870, 360x360DpI, Plain Paper"
--sDEVICE=uniprint
--dNOPAUSE
--dSAFER
--dupColorModel=/DeviceCMYKgenerate
--dupRendering=/FSCMYK32
--dupOutputFormat=/EscP2
--r360x360
--dupMargins="{ 9.0 31.0 9.0 9.0}"
--dupBlackTransfer="{ 0.0000 0.0550 0.1250 0.2300 0.4500 0.8000 }"
--dupCyanTransfer="{ 0.0000 0.0540 0.1320 0.2280 0.4800 0.8800 }"
--dupMagentaTransfer="{ 0.0000 0.0495 0.1210 0.2090 0.4400 0.8800 }"
--dupYellowTransfer="{ 0.0000 0.0450 0.1100 0.1900 0.4800 0.8800 }"
--dupOutputComponentOrder="{ 1 2 3 0 }"
--dupWeaveYPasses=3
--dupOutputPins=48
--dupWeaveYFeeds="{52 46 46}"
--dupWeaveInitialYFeeds="{1 1 46}"
--dupWeaveInitialPins="{ 16 33 48}"
--dupBeginJobCommand="(\000\000\000\000\000\000\033\001@EJL\0401284.4\012@EJL\040\040\040\040\040\012)"
--dupBeginPageCommand="<
- 1b40 1b40
- 1b2847 0100 01
- 1b2855 0100 0A
- 1b5501
- 1b2865 0200 0000
- 1b2843 0200 0000
- 1b2863 0400 0000 0000
->"
--dupAdjustPageLengthCommand
--dupAdjustTopMarginCommand
--dupAdjustBottomMarginCommand
--dupEndPageCommand="(\033@\014)"
--dupAbortCommand="(\033@\15\12\12\12\12 Printout-Aborted\15\014)"
diff --git a/gs/contrib/uniprint/bjc6000a1.upp b/gs/contrib/uniprint/bjc6000a1.upp
deleted file mode 100644
index 17aafb0f8..000000000
--- a/gs/contrib/uniprint/bjc6000a1.upp
+++ /dev/null
@@ -1,48 +0,0 @@
--supModel="Canon BJC 6000, 360x360DpI, plain paper, color, rendered"
--sDEVICE=uniprint
--dNOPAUSE
--dSAFER
--dupColorModel=/DeviceCMYKgenerate
--dupRendering=/FSCMYK32
--dupOutputFormat=/Canon
--r360x360
--dupMargins="{ 10.77 20.5 6.24 9.00 }"
--dupOutputComponentOrder="{ 3 2 1 0 }"
--dupBlackTransfer="{
-0.0000 0.0058 0.0164 0.0301 0.0463 0.0648 0.0851 0.1073
-0.1311 0.1564 0.1832 0.2114 0.2408 0.2716 0.3035 0.3366
-0.3708 0.4061 0.4425 0.4798 0.5182 0.5576 0.5978 0.6391
-0.6812 0.7242 0.7681 0.8128 0.8584 0.9048 0.9520 1.0000
-}"
--dupCyanTransfer="{
-0.0000 0.0008 0.0033 0.0075 0.0133 0.0208 0.0300 0.0408
-0.0533 0.0674 0.0832 0.1007 0.1199 0.1407 0.1632 0.1873
-0.2131 0.2406 0.2697 0.3005 0.3330 0.3671 0.4029 0.4404
-0.4795 0.5203 0.5627 0.6069 0.6527 0.7001 0.7492 0.8000
-}"
--dupMagentaTransfer="{
-0.0000 0.0008 0.0033 0.0075 0.0133 0.0208 0.0300 0.0408
-0.0533 0.0674 0.0832 0.1007 0.1199 0.1407 0.1632 0.1873
-0.2131 0.2406 0.2697 0.3005 0.3330 0.3671 0.4029 0.4404
-0.4795 0.5203 0.5627 0.6069 0.6527 0.7001 0.7492 0.8000
-}"
--dupYellowTransfer="{
-0.0000 0.0008 0.0033 0.0075 0.0133 0.0208 0.0300 0.0408
-0.0533 0.0674 0.0832 0.1007 0.1199 0.1407 0.1632 0.1873
-0.2131 0.2406 0.2697 0.3005 0.3330 0.3671 0.4029 0.4404
-0.4795 0.5203 0.5627 0.6069 0.6527 0.7001 0.7492 0.8000
-}"
--dupBeginPageCommand="<
- 1b5b 4b 0200 00 0f
- 1b28 62 0100 01
- 1b28 71 0100 01
- 1b28 6d 0a00 02 ff ff 00 00 07 00 03 00 00
- 1b28 64 0400 01 68 01 68
- 1b28 74 0300 01 00 01
- 1b28 63 0300 30 00 01
- 1b28 70 0800 02 a6 00 00 01 e0 00 00
- 1b28 6c 0200 34 00
- 1b28 65 0200 00 00
->"
--dupEndJobCommand="(\033\050b\001\000\000\033@)"
--dupEndPageCommand="(\014)"
diff --git a/gs/contrib/uniprint/bjc6000b1.upp b/gs/contrib/uniprint/bjc6000b1.upp
deleted file mode 100644
index 11836f6e9..000000000
--- a/gs/contrib/uniprint/bjc6000b1.upp
+++ /dev/null
@@ -1,48 +0,0 @@
--supModel="Canon BJC 6000, 720x720DpI, plain paper, color, rendered"
--sDEVICE=uniprint
--dNOPAUSE
--dSAFER
--dupColorModel=/DeviceCMYKgenerate
--dupRendering=/FSCMYK32
--dupOutputFormat=/Canon
--r720x720
--dupMargins="{ 10.77 20.5 6.24 8.70 }"
--dupOutputComponentOrder="{ 3 2 1 0 }"
--dupBlackTransfer="{
-0.0000 0.0029 0.0082 0.0151 0.0232 0.0324 0.0426 0.0537
-0.0655 0.0782 0.0916 0.1057 0.1204 0.1358 0.1517 0.1683
-0.1854 0.2030 0.2212 0.2399 0.2591 0.2788 0.2989 0.3195
-0.3406 0.3621 0.3840 0.4064 0.4292 0.4524 0.4760 0.5000
-}"
--dupCyanTransfer="{
-0.0000 0.0004 0.0017 0.0037 0.0067 0.0104 0.0150 0.0204
-0.0266 0.0337 0.0416 0.0504 0.0599 0.0703 0.0816 0.0937
-0.1066 0.1203 0.1349 0.1503 0.1665 0.1836 0.2015 0.2202
-0.2398 0.2601 0.2814 0.3034 0.3263 0.3501 0.3746 0.4000
-}"
--dupMagentaTransfer="{
-0.0000 0.0004 0.0017 0.0037 0.0067 0.0104 0.0150 0.0204
-0.0266 0.0337 0.0416 0.0504 0.0599 0.0703 0.0816 0.0937
-0.1066 0.1203 0.1349 0.1503 0.1665 0.1836 0.2015 0.2202
-0.2398 0.2601 0.2814 0.3034 0.3263 0.3501 0.3746 0.4000
-}"
--dupYellowTransfer="{
-0.0000 0.0004 0.0017 0.0037 0.0067 0.0104 0.0150 0.0204
-0.0266 0.0337 0.0416 0.0504 0.0599 0.0703 0.0816 0.0937
-0.1066 0.1203 0.1349 0.1503 0.1665 0.1836 0.2015 0.2202
-0.2398 0.2601 0.2814 0.3034 0.3263 0.3501 0.3746 0.4000
-}"
--dupBeginPageCommand="<
- 1b5b 4b 0200 00 0f
- 1b28 62 0100 01
- 1b28 71 0100 01
- 1b28 6d 0a00 02 ff ff 00 00 07 00 03 00 00
- 1b28 64 0400 02 d0 02 d0
- 1b28 74 0300 01 00 09
- 1b28 63 0300 30 00 02
- 1b28 70 0800 02 a6 00 00 01 e0 00 00
- 1b28 6c 0200 34 00
- 1b28 65 0200 00 00
->"
--dupEndJobCommand="(\033\050b\001\000\000\033@)"
--dupEndPageCommand="(\014)"
diff --git a/gs/contrib/uniprint/s400a1.upp b/gs/contrib/uniprint/s400a1.upp
deleted file mode 100644
index 7198c0118..000000000
--- a/gs/contrib/uniprint/s400a1.upp
+++ /dev/null
@@ -1,44 +0,0 @@
--supModel="Canon S400, 360x360DpI, plain paper, color, rendered"
--sDEVICE=uniprint
--dNOPAUSE
--dSAFER
--dupColorModel=/DeviceCMYKgenerate
--dupRendering=/FSCMYK32
--dupOutputFormat=/Canon
--r360x360
--dupMargins="{ 8.0 0.0 0.0 5.00 }"
--dupOutputComponentOrder="{ 3 2 1 0 }"
--dupBlackTransfer="{
-0 0.0123 0.0246 0.0371 0.0498 0.0626 0.0757 0.0892
-0.1031 0.1177 0.1331 0.1496 0.1676 0.1875 0.2099 0.2354
-0.2648 0.2989 0.3384 0.3840 0.4358 0.4934 0.5558 0.6213
-0.6876 0.7523 0.8133 0.8691 0.9188 0.9623 0.9999 1
-}"
--dupCyanTransfer="{
-0 0.0123 0.0246 0.0371 0.0498 0.0626 0.0757 0.0892
-0.1031 0.1177 0.1331 0.1496 0.1676 0.1875 0.2099 0.2354
-0.2648 0.2989 0.3384 0.3840 0.4358 0.4934 0.5558 0.6213
-0.6876 0.7523 0.8133 0.8691 0.9188 0.9623 0.9999 1
-}"
--dupMagentaTransfer="{
-0 0.0123 0.0246 0.0371 0.0498 0.0626 0.0757 0.0892
-0.1031 0.1177 0.1331 0.1496 0.1676 0.1875 0.2099 0.2354
-0.2648 0.2989 0.3384 0.3840 0.4358 0.4934 0.5558 0.6213
-0.6876 0.7523 0.8133 0.8691 0.9188 0.9623 0.9999 1
-}"
--dupYellowTransfer="{
-0 0.0123 0.0246 0.0371 0.0498 0.0626 0.0757 0.0892
-0.1031 0.1177 0.1331 0.1496 0.1676 0.1875 0.2099 0.2354
-0.2648 0.2989 0.3384 0.3840 0.4358 0.4934 0.5558 0.6213
-0.6876 0.7523 0.8133 0.8691 0.9188 0.9623 0.9999 1
-}"
--dupBeginPageCommand="<
- 1b5b4b 0200 000f
- 1b28 62 0100 01
- 1b28 63 0300 100110
- 1b28 64 0200 0168
- 1b28 6c 0200 1400
- 1b28 67 0100 E5
->"
--dupEndJobCommand="(\033\050b\001\000\000\033@)"
--dupEndPageCommand="(\014)"
diff --git a/gs/contrib/uniprint/s400b1.upp b/gs/contrib/uniprint/s400b1.upp
deleted file mode 100644
index 87d0818d3..000000000
--- a/gs/contrib/uniprint/s400b1.upp
+++ /dev/null
@@ -1,48 +0,0 @@
--supModel="Canon S400, 720x720DpI, plain paper, color, rendered"
--sDEVICE=uniprint
--dNOPAUSE
--dSAFER
--dupColorModel=/DeviceCMYKgenerate
--dupRendering=/FSCMYK32
--dupOutputFormat=/Canon
--r720x720
--dupMargins="{ 8.0 0.0 0.0 5.00 }"
--dupOutputComponentOrder="{ 3 2 1 0 }"
--dupBlackTransfer="{
-0 0.0082 0.0166 0.0251 0.0339 0.0429 0.0524 0.0623
-0.0728 0.0842 0.0966 0.1103 0.1257 0.1433 0.1635 0.1870
-0.2144 0.2466 0.2841 0.3277 0.3776 0.4338 0.4958 0.5623
-0.6317 0.7020 0.7708 0.8364 0.8970 0.9516 0.9999 1
-}"
--dupCyanTransfer="{
-0 0.0082 0.0166 0.0251 0.0339 0.0429 0.0524 0.0623
-0.0728 0.0842 0.0966 0.1103 0.1257 0.1433 0.1635 0.1870
-0.2144 0.2466 0.2841 0.3277 0.3776 0.4338 0.4958 0.5623
-0.6317 0.7020 0.7708 0.8364 0.8970 0.9516 0.9999 1
-}"
--dupMagentaTransfer="{
-0 0.0082 0.0166 0.0251 0.0339 0.0429 0.0524 0.0623
-0.0728 0.0842 0.0966 0.1103 0.1257 0.1433 0.1635 0.1870
-0.2144 0.2466 0.2841 0.3277 0.3776 0.4338 0.4958 0.5623
-0.6317 0.7020 0.7708 0.8364 0.8970 0.9516 0.9999 1
-}"
--dupYellowTransfer="{
-0 0.0082 0.0166 0.0251 0.0339 0.0429 0.0524 0.0623
-0.0728 0.0842 0.0966 0.1103 0.1257 0.1433 0.1635 0.1870
-0.2144 0.2466 0.2841 0.3277 0.3776 0.4338 0.4958 0.5623
-0.6317 0.7020 0.7708 0.8364 0.8970 0.9516 0.9999 1
-}"
--dupBeginPageCommand="<
- 1b5b 4b 0200 00 0f
- 1b28 62 0100 01
- 1b28 71 0100 01
- 1b28 6d 0a00 02 ff ff 00 00 07 00 03 00 00
- 1b28 64 0400 02 d0 02 d0
- 1b28 74 0300 01 00 09
- 1b28 63 0300 30 00 02
- 1b28 70 0800 02 a6 00 00 01 e0 00 00
- 1b28 6c 0200 34 00
- 1b28 65 0200 00 00
->"
--dupEndJobCommand="(\033\050b\001\000\000\033@)"
--dupEndPageCommand="(\014)"
diff --git a/gs/contrib/uniprint/sharp.upp b/gs/contrib/uniprint/sharp.upp
deleted file mode 100644
index 25fd238fb..000000000
--- a/gs/contrib/uniprint/sharp.upp
+++ /dev/null
@@ -1,58 +0,0 @@
--supModel="SHARP AJ1800, 600x600DpI, Gamma=2"
--sDEVICE=uniprint
--dNOPAUSE
--dSAFER
--dupColorModel=/DeviceCMYKgenerate
--dupRendering=/FSCMYK32
--dupOutputFormat=/Pcl
--r600x600
--dupMargins="{ 12.0 36.0 12.0 12.0}"
--dupBlackTransfer="{
- 0.0000 0.0010 0.0042 0.0094 0.0166 0.0260 0.0375 0.0510
- 0.0666 0.0843 0.1041 0.1259 0.1498 0.1758 0.2039 0.2341
- 0.2663 0.3007 0.3371 0.3756 0.4162 0.4589 0.5036 0.5505
- 0.5994 0.6504 0.7034 0.7586 0.8158 0.8751 0.9365 1.0000
-}"
--dupCyanTransfer="{
- 0.0000 0.0010 0.0042 0.0094 0.0166 0.0260 0.0375 0.0510
- 0.0666 0.0843 0.1041 0.1259 0.1498 0.1758 0.2039 0.2341
- 0.2663 0.3007 0.3371 0.3756 0.4162 0.4589 0.5036 0.5505
- 0.5994 0.6504 0.7034 0.7586 0.8158 0.8751 0.9365 1.0000
-}"
--dupMagentaTransfer="{
- 0.0000 0.0010 0.0042 0.0094 0.0166 0.0260 0.0375 0.0510
- 0.0666 0.0843 0.1041 0.1259 0.1498 0.1758 0.2039 0.2341
- 0.2663 0.3007 0.3371 0.3756 0.4162 0.4589 0.5036 0.5505
- 0.5994 0.6504 0.7034 0.7586 0.8158 0.8751 0.9365 1.0000
-}"
--dupYellowTransfer="{
- 0.0000 0.0010 0.0042 0.0094 0.0166 0.0260 0.0375 0.0510
- 0.0666 0.0843 0.1041 0.1259 0.1498 0.1758 0.2039 0.2341
- 0.2663 0.3007 0.3371 0.3756 0.4162 0.4589 0.5036 0.5505
- 0.5994 0.6504 0.7034 0.7586 0.8158 0.8751 0.9365 1.0000
-}"
--dupBeginJobCommand="<
- 1b451b451b451b451b451b451b451b451b451b451b451b451b451b451b451b45
->"
--dupBeginPageCommand="<
- 1b45
- 1b266c304c
- 1b2f743131323030333230303153
- 1b266c323641
- 1b266c304d
- 1b266c3148
- 1b2a70314e
- 1b2a703059
- 1b2a703058
- 1b2a723151
- 1b2f6432303253
- 1b2a7436303052
- 1b2a723141
- 1b2a62324d
->"
--dupAdjustPageWidthCommand
--dupEndPageCommand="(\033*rbC\12\033E)"
--dupEndJobCommand="(\033/s0C\033E)"
--dupAbortCommand="(\033*rbC\033E\15\12\12\12\12 Printout-Aborted\15\033&l0H)"
--dupYMoveCommand="(\033*b%dY\0)"
--dupWriteComponentCommands="{ (\033*b%dV\0) (\033*b%dV\0) (\033*b%dV\0) (\033*b%dW\0) }"
diff --git a/gs/contrib/uniprint/sipixa6.upp b/gs/contrib/uniprint/sipixa6.upp
deleted file mode 100644
index 00cd62f75..000000000
--- a/gs/contrib/uniprint/sipixa6.upp
+++ /dev/null
@@ -1,23 +0,0 @@
--supModel="SiPix A6 Pocket Printer"
--sDEVICE=uniprint
--dNOPAUSE
--dSAFER
--dupColorModel=/DeviceGray
--dupRendering=/ErrorDiffusion
--dupOutputFormat=/Epson
--r360x360
--dupMargins="{ 20 0 20 0}"
--dupWhiteTransfer="{
-1.0 0.0
-}"
--dupOutputPins=48
--dupWeaveYPasses=1
--dupFormatXabsolute
--dupBeginPageCommand="<
-1b40 0d
->"
--dupEndPageCommand"<0d 0a>"
--dupEndJobCommand"<0a 0a 0a>"
--dupAbortCommand="(\033\100\15\12\12\12 Printout-Aborted\15\12\12\12)"
--dupSetLineFeedCommand="<1b2b>"
--dupWriteComponentCommands="{(\033*\111)}"
diff --git a/gs/contrib/uniprint/stc740ih.upp b/gs/contrib/uniprint/stc740ih.upp
deleted file mode 100644
index 1023b5eb9..000000000
--- a/gs/contrib/uniprint/stc740ih.upp
+++ /dev/null
@@ -1,58 +0,0 @@
--supModel="Epson Stylus Color 740, 1440x720DpI, Inkjet Paper"
--sDEVICE=uniprint
--dNOPAUSE
--dSAFER
--dupColorModel=/DeviceCMYKgenerate
--dupRendering=/FSCMYK32
--dupOutputFormat=/EscP2XY
--r1440x720
--dupMargins="{ 9.0 39.96 9.0 9.0}"
--dupBlackTransfer="{
- 0.00000000 0.00627451 0.01254902 0.02196078 0.02980392 0.03764706 0.04549020
- 0.05490196 0.06431373 0.07215686 0.08156863 0.09098039 0.10196078 0.11450980
- 0.12862745 0.14588235 0.16313725 0.18509804 0.20862745 0.25411765 0.40000000
-}"
--dupCyanTransfer="{
- 0.00000000 0.00627451 0.01254902 0.02196078 0.02980392 0.03764706 0.04549020
- 0.05490196 0.06431373 0.07215686 0.08156863 0.09098039 0.10196078 0.11450980
- 0.12862745 0.14588235 0.16313725 0.18509804 0.20862745 0.25411765 0.40000000
-}"
--dupMagentaTransfer="{
- 0.00000000 0.00627451 0.01254902 0.02196078 0.02980392 0.03764706 0.04549020
- 0.05490196 0.06431373 0.07215686 0.08156863 0.09098039 0.10196078 0.11450980
- 0.12862745 0.14588235 0.16313725 0.18509804 0.20862745 0.25411765 0.40000000
-}"
--dupYellowTransfer="{
- 0.00000000 0.00627451 0.01254902 0.02196078 0.02980392 0.03764706 0.04549020
- 0.05490196 0.06431373 0.07215686 0.08156863 0.09098039 0.10196078 0.11450980
- 0.12862745 0.14588235 0.16313725 0.18509804 0.20862745 0.25411765 0.40000000
-}"
--dupOutputComponentOrder="{ 1 2 3 0 }"
--dupWeaveXPasses=2
--dupOutputXStep=2
--dupWeaveYPasses=6
--dupOutputPins=46
--dupWeaveYFeeds="{23 23 23 23 23 23 23 23 23 23 23 23}"
--dupWeaveXStarts="{0 1 0 1 0 1 1 0 1 0 1 0}"
--dupWeaveYOffset=50
--dupWeaveInitialYFeeds="{ 5 5 5 5 5 5 5 5 5 5 5 23}"
--dupWeaveInitialXStarts="{0 1 0 1 0 1 1 0 1 0 1 0}"
--dupWeaveInitialPins="{ 13 16 19 22 25 28 31 34 37 40 43 46}"
--dupFormatYabsolute
--dupBeginPageCommand="<
- 1b40 1b40
- 1b2847 0100 01
- 1b2855 0100 05
- 1b2873 0100 02
- 1b5501
- 1b2865 0200 0001
- 1b2843 0200 0000
- 1b2863 0400 0000 0000
->"
--dupAdjustPageLengthCommand
--dupAdjustTopMarginCommand
--dupAdjustBottomMarginCommand
--dupXStepCommand="<1b285c 0400 a005 0100 0000>"
--dupEndPageCommand="(\033@\014)"
--dupAbortCommand="(\033@\15\12\12\12\12 Printout-Aborted\15\014)"
-
diff --git a/gs/ijs/autogen.sh b/gs/ijs/autogen.sh
index 4e346ebd1..c907178b6 100755
--- a/gs/ijs/autogen.sh
+++ b/gs/ijs/autogen.sh
@@ -34,10 +34,6 @@ VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9]\.[0-9]\).*/\1/"
# do we need automake?
(grep "^AM_INIT_AUTOMAKE" "$CONFIG_AC" >/dev/null) && {
AM_NEEDED=`fgrep AUTOMAKE_OPTIONS Makefile.am | $VERSIONGREP`
- AM_NMAJOR=`echo $AM_NEEDED |cut -d. -f1`
- AM_NMINOR=`echo $AM_NEEDED |cut -d. -f2`
- AM_NPATCHLEVEL=`echo $AM_NEEDED |cut -d. -f3`
- AM_NVERSION=`expr $AM_NMAJOR '*' 10000 + $AM_NMINOR '*' 100 + 0$AM_NPATCHLEVEL`
if test -z $AM_NEEDED; then
echo -n "checking for automake... "
AUTOMAKE=automake
@@ -53,11 +49,8 @@ VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9]\.[0-9]\).*/\1/"
echo -n "checking for automake $AM_NEEDED or later... "
for am in automake-$AM_NEEDED automake$AM_NEEDED automake; do
($am --version < /dev/null > /dev/null 2>&1) || continue
- AM_MAJOR=`echo $AM_NEEDED |cut -d. -f1`
- AM_MINOR=`echo $AM_NEEDED |cut -d. -f2`
- AM_PATCHLEVEL=`echo $AM_NEEDED |cut -d. -f3`
- AM_VERSION=`expr $AM_NMAJOR '*' 10000 + $AM_NMINOR '*' 100 + 0$AM_NPATCHLEVEL`
- if test $AM_VERSION -ge $AM_NVERSION; then
+ ver=`$am --version < /dev/null | head -1 | $VERSIONGREP`
+ if test $ver = $AM_NEEDED; then
AUTOMAKE=$am
echo $AUTOMAKE
break
@@ -67,11 +60,8 @@ VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9]\.[0-9]\).*/\1/"
echo -n "checking for aclocal $AM_NEEDED or later... "
for ac in aclocal-$AM_NEEDED aclocal$AM_NEEDED aclocal; do
($ac --version < /dev/null > /dev/null 2>&1) || continue
- AM_MAJOR=`echo $AM_NEEDED |cut -d. -f1`
- AM_MINOR=`echo $AM_NEEDED |cut -d. -f2`
- AM_PATCHLEVEL=`echo $AM_NEEDED |cut -d. -f3`
- AM_VERSION=`expr $AM_NMAJOR '*' 10000 + $AM_NMINOR '*' 100 + 0$AM_NPATCHLEVEL`
- if test $AM_VERSION -ge $AM_NVERSION; then
+ ver=`$ac --version < /dev/null | head -1 | $VERSIONGREP`
+ if test $ver = $AM_NEEDED; then
ACLOCAL=$ac
echo $ACLOCAL
break
diff --git a/gs/lib/gs_init.ps b/gs/lib/gs_init.ps
index a7b5d6d7e..5bbb6092e 100644
--- a/gs/lib/gs_init.ps
+++ b/gs/lib/gs_init.ps
@@ -152,7 +152,6 @@ currentdict /NOFONTMAP known /NOFONTMAP exch def
currentdict /NOFONTPATH known /NOFONTPATH exch def
currentdict /NOGC known /NOGC exch def
currentdict /NOINTERPOLATE .knownget { /INTERPOLATE exch not def } if
-currentdict /NOMEDIAATTRS known /NOMEDIAATTRS exch def
currentdict /NOOUTERSAVE known /NOOUTERSAVE exch def
currentdict /NOPAGEPROMPT known /NOPAGEPROMPT exch def
currentdict /NOPAUSE known /NOPAUSE exch def
@@ -1470,22 +1469,7 @@ setpacking
% Set the default screen and BG/UCR.
/.setdefaultbgucr {
systemdict /setblackgeneration known {
-% T. Kamppeter, Linux Foundation
-%
-% Martin Lottermoser, author of the "pcl3" driver writes in
-% contrib/pcl3/doc/gs-mods.txt, section C1:
-%
-% There is a bug in ghostscript's default configuration for the
-% undercolour removal and black generation functions. It shows up when
-% printing PostScript documents using the RGB colour space ("setrgbcolor" or
-% "sethsbcolor") on a device where the CMYK space is the native colour space;
-% this is the case for pcl3 if you specify "-sColourModel=CMYK". The bug
-% results in black being printed as a mixture of cyan, magenta, and yellow.
-%
-% The bug is simply fixed by replacing the line
-% { pop 0 } dup setblackgeneration setundercolorremoval
-% with the following line:
- {} dup setblackgeneration setundercolorremoval
+ { pop 0 } dup setblackgeneration setundercolorremoval
} if
} bind def
/.useloresscreen { % - .useloresscreen <bool>
diff --git a/gs/lib/gs_setpd.ps b/gs/lib/gs_setpd.ps
index a7c7b9e64..2edd2c88c 100644
--- a/gs/lib/gs_setpd.ps
+++ b/gs/lib/gs_setpd.ps
@@ -164,17 +164,8 @@ level2dict begin
% We don't include attributes such as .MediaSize, which all devices
% are guaranteed to supply on their own.
/.defaultpolicies mark
- % M. Sweet, Easy Software Products
- %
- % Due to the fact that it is not possible to properly implement
- % the selection policies from a Ghostscript driver, we have changed
- % the default policy to "7" (impose) to avoid numerous problems with
- % printing within CUPS...
- %
- % /PolicyNotFound 1
- % /PageSize 0
- /PolicyNotFound 7
- /PageSize 7
+ /PolicyNotFound 1
+ /PageSize 0
/PolicyReport {
dup /.LockSafetyParams known {
% Only possible error is invalidaccess
@@ -385,42 +376,21 @@ level2dict begin
} bind
.dicttomark readonly def
-% M. Sweet, Easy Software Products:
-%
-% Define NOMEDIAATTRS to turn off the default (but unimplementable) media
-% selection policies for setpagedevice. This is used by CUPS to support
-% the standard Adobe media attributes.
-NOMEDIAATTRS {
- % Define only PageSize for input attribute matching.
- /.inputattrkeys [
- /PageSize
- ] readonly def
- % Define no other keys used in media selection.
- /.inputselectionkeys [
- /noInputSelectionsKeys
- ] readonly def
-
- % Define no keys used in output attribute matching.
- /.outputattrkeys [
- /noOutputAttrKeys
- ] readonly def
-} {
- % Define the keys used in input attribute matching.
- /.inputattrkeys [
- /PageSize /MediaColor /MediaWeight /MediaType /InsertSheet /ManualFeed
- % The following are documented in Adobe's supplement for v2017.
- /LeadingEdge /MediaClass
- ] readonly def
- % Define other keys used in media selection.
- /.inputselectionkeys [
- /MediaPosition /Orientation
- ] readonly def
-
- % Define the keys used in output attribute matching.
- /.outputattrkeys [
- /OutputType /Duplex /Tumble /ManualFeed
- ] readonly def
-} ifelse
+% Define the keys used in input attribute matching.
+/.inputattrkeys [
+ /PageSize /MediaColor /MediaWeight /MediaType /InsertSheet /ManualFeed
+ % The following are documented in Adobe's supplement for v2017.
+ /LeadingEdge /MediaClass
+] readonly def
+% Define other keys used in media selection.
+/.inputselectionkeys [
+ /MediaPosition /Orientation
+] readonly def
+
+% Define the keys used in output attribute matching.
+/.outputattrkeys [
+ /OutputType
+] readonly def
% Define all the parameters that should always be copied to the merged
% dictionary.
@@ -532,22 +502,11 @@ NOMEDIAATTRS {
% They are expected to consume the top 2 operands.
% NOTE: we currently treat all values other than 0, 1, or 7 (for PageSize)
% the same as 0, i.e., we signal an error.
-%
-% M. Sweet, Easy Software Products:
-%
-% Define NOMEDIAATTRS to turn off the default (but unimplementable) media
-% selection policies for setpagedevice. This is used by CUPS to support
-% the standard Adobe media attributes.
0 { % Set errorinfo and signal a configurationerror.
- NOMEDIAATTRS {
- % NOMEDIAATTRS means that the default policy is 7...
- pop 2 index exch 7 put
- } {
pop dup 4 index exch get 2 array astore
$error /errorinfo 3 -1 roll put
cleartomark
/setpagedevice .systemvar /configurationerror signalerror
- } ifelse
} bind
1 { % Roll back the failed request to its previous status.
SETPDDEBUG { (Rolling back.) = pstack flush } if
diff --git a/gs/src/Makefile.in b/gs/src/Makefile.in
index a39b1f62c..240ac4e9b 100644
--- a/gs/src/Makefile.in
+++ b/gs/src/Makefile.in
@@ -30,7 +30,6 @@ PSSRCDIR=./src
PSLIBDIR=./lib
PSGENDIR=./obj
PSOBJDIR=./obj
-CONTRIBDIR=./contrib
# Do not edit the next group of lines.
@@ -39,21 +38,6 @@ DD=$(GLGENDIR)/
GLD=$(GLGENDIR)/
PSD=$(PSGENDIR)/
-#### The following comes from the version.mak file, but we substitute
-#### the values from the configure script...
-# Major and minor version numbers.
-# MINOR0 is different from MINOR only if MINOR is a single digit.
-GS_VERSION_MAJOR=@GS_VERSION_MAJOR@
-GS_VERSION_MINOR=@GS_VERSION_MINOR@
-GS_VERSION_PATCH=@GS_VERSION_PATCH@
-GS_VERSION_MINOR0=@GS_VERSION_MINOR0@
-# Revision date: year x 10000 + month x 100 + day.
-GS_REVISIONDATE=@GS_REVISIONDATE@
-# Derived values
-GS_VERSION=@GS_VERSION@
-GS_DOT_VERSION=$(GS_VERSION_MAJOR).$(GS_VERSION_MINOR0)
-GS_REVISION=$(GS_VERSION)
-
# ------ Generic options ------ #
# Define the installation commands and target directories for
@@ -64,7 +48,6 @@ GS_REVISION=$(GS_VERSION)
INSTALL = $(GLSRCDIR)/instcopy -c
INSTALL_PROGRAM = $(INSTALL) -m 755
INSTALL_DATA = $(INSTALL) -m 644
-INSTALL_SHARED = @INSTALL_SHARED@
prefix = @prefix@
exec_prefix = @exec_prefix@
@@ -73,15 +56,9 @@ scriptdir = $(bindir)
libdir = @libdir@
mandir = @mandir@
man1ext = 1
-man1dir = $(mandir)/man$(man1ext)
datadir = @datadir@
-datarootdir = @datarootdir@
-
-# The following must be substituted using @datadir@ and @libdir@
-# to avoid adding RPM generation paths (CUPS STR #1112)
-gsdir = @datadir@/ghostscript
+gsdir = $(datadir)/ghostscript
gsdatadir = $(gsdir)/$(GS_DOT_VERSION)
-gssharedir = @libdir@/ghostscript/$(GS_DOT_VERSION)
docdir=$(gsdatadir)/doc
exdir=$(gsdatadir)/examples
@@ -90,7 +67,7 @@ GS_DOCDIR=$(docdir)
# Define the default directory/ies for the runtime
# initialization and font files. Separate multiple directories with a :.
-GS_LIB_DEFAULT=$(gsdatadir)/lib:$(gsdatadir)/Resource:$(gsdir)/fonts:@fontpath@
+GS_LIB_DEFAULT=$(gsdatadir)/lib:$(gsdatadir)/Resource:$(gsdir)/fonts
# Define the default directory for cached data files
# this must be a single path.
@@ -255,7 +232,7 @@ GCFLAGS=@CPPFLAGS@ @GCFLAGS@ @CFLAGS@
CFLAGS_STANDARD=@OPT_CFLAGS@
CFLAGS_DEBUG=-g -O
CFLAGS_PROFILE=-pg @OPT_CFLAGS@
-CFLAGS_SO=@DYNAMIC_CFLAGS@
+CFLAGS_SO=-fPIC
# Define the other compilation flags. Add at most one of the following:
# -DBSD4_2 for 4.2bsd systems.
@@ -268,7 +245,7 @@ CFLAGS_SO=@DYNAMIC_CFLAGS@
# We don't include -ansi, because this gets in the way of the platform-
# specific stuff that <math.h> typically needs; nevertheless, we expect
# gcc to accept ANSI-style function prototypes and function definitions.
-XCFLAGS=@DYNAMIC_FLAGS@
+XCFLAGS=
# defines from autoconf; note that we don't use these at present.
ACDEFS=@DEFS@
@@ -282,7 +259,7 @@ CFLAGS=$(CFLAGS_STANDARD) $(GCFLAGS) $(XCFLAGS)
# -R /usr/local/xxx/lib:/usr/local/lib
# giving the full path names of the shared library directories.
# XLDFLAGS can be set from the command line.
-XLDFLAGS=@X_LDFLAGS@
+XLDFLAGS=
LDFLAGS=@LDFLAGS@ $(XLDFLAGS)
@@ -293,7 +270,7 @@ LDFLAGS=@LDFLAGS@ $(XLDFLAGS)
# Solaris may need -lnsl -lsocket -lposix4.
# (Libraries required by individual drivers are handled automatically.)
-EXTRALIBS=@LIBS@ @DYNAMIC_LIBS@
+EXTRALIBS=
# Define the standard libraries to search at the end of linking.
# Most platforms require -lpthread for the POSIX threads library;
@@ -328,10 +305,10 @@ XINCLUDE=@X_CFLAGS@
# the -L (or whatever). It also defines X_PRE_LIBS and X_EXTRA_LIBS
# all three of which are stripped and slotted into XLIBS below.
# Usually however, all but X_LIBS are empty on modern platforms.
-XLIBDIRS=@X_LDFLAGS@
+XLIBDIRS=@X_LIBS@
XLIBDIR=
#XLIBS=Xt Xext X11
-XLIBS=@X_LIBS@
+XLIBS=@XLIBS@
# Define whether this platform has floating point hardware:
# FPU_TYPE=2 means floating point is faster than fixed point.
@@ -354,19 +331,11 @@ FPU_TYPE=1
# Default is No sync primitives since some platforms don't have it (HP-UX)
SYNC=nosync
-# programs we use
-RM=rm -f
-
-# ------ Dynamic loader options ------- #
-SOC_CFLAGS = @SOC_CFLAGS@
-SOC_LIBS = @SOC_LIBS@
-SOC_LOADER = @SOC_LOADER@
-
# ------ Devices and features ------ #
# Choose the language feature(s) to include. See gs.mak for details.
-FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)dpsnext.dev $(PSD)ttfont.dev $(PSD)epsf.dev $(GLD)pipe.dev $(PSD)fapi.dev @JBIG2DEVS@ @JPXDEVS@
+FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)ttfont.dev $(PSD)epsf.dev $(GLD)pipe.dev $(PSD)fapi.dev @JBIG2DEVS@ @JPXDEVS@
#FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev
#FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)dpsnext.dev $(PSD)ttfont.dev $(PSD)rasterop.dev $(GLD)pipe.dev
# The following is strictly for testing.
@@ -404,7 +373,7 @@ STDIO_IMPLEMENTATION=c
# Override the default device. This is set to 'display' by
# unix-dll.mak when building a shared object.
-DISPLAY_DEV=$(DD)bbox.dev
+DISPLAY_DEV=
# Define the name table capacity size of 2^(16+n).
# Setting this to a non-zero value will slow down the interpreter.
@@ -415,58 +384,31 @@ EXTEND_NAMES=0
# devs.mak and contrib.mak for the list of available devices.
#DEVICE_DEVS=$(DISPLAY_DEV) $(DD)x11.dev $(DD)x11alpha.dev $(DD)x11cmyk.dev $(DD)x11gray2.dev $(DD)x11gray4.dev $(DD)x11mono.dev
-#DEVICE_DEVS=$(DISPLAY_DEV) @X11DEVS@
-#DEVICE_DEVS=$(DISPLAY_DEV) @X_DEVS@
-
-#DEVICE_DEVS1=$(DD)bmpmono.dev $(DD)bmpgray.dev $(DD)bmpsep1.dev $(DD)bmpsep8.dev $(DD)bmp16.dev $(DD)bmp256.dev $(DD)bmp16m.dev $(DD)bmp32b.dev
-#DEVICE_DEVS2=#$(DD)gdevjbig2.dev $(DD)gdevjpx.dev #$(DD)rinkj.dev
-#DEVICE_DEVS3=$(DD)deskjet.dev $(DD)djet500.dev $(DD)laserjet.dev $(DD)ljetplus.dev $(DD)ljet2p.dev $(DD)ljet3.dev $(DD)ljet3d.dev $(DD)ljet4.dev $(DD)ljet4d.dev $(DD)lj5mono.dev $(DD)lj5gray.dev
-#DEVICE_DEVS4=$(DD)cdeskjet.dev $(DD)cdjcolor.dev $(DD)cdjmono.dev $(DD)cdj550.dev $(DD)pj.dev $(DD)pjxl.dev $(DD)pjxl300.dev
-#DEVICE_DEVS5=$(DD)uniprint.dev @IJSDEVS@
-#DEVICE_DEVS6=$(DD)bj10e.dev $(DD)bj200.dev $(DD)bjc600.dev $(DD)bjc800.dev
-#DEVICE_DEVS7=$(DD)faxg3.dev $(DD)faxg32d.dev $(DD)faxg4.dev $(DD)cfax.dev
-#DEVICE_DEVS8=$(DD)pcxmono.dev $(DD)pcxgray.dev $(DD)pcx16.dev $(DD)pcx256.dev $(DD)pcx24b.dev $(DD)pcxcmyk.dev
-#DEVICE_DEVS9=$(DD)pbm.dev $(DD)pbmraw.dev $(DD)pgm.dev $(DD)pgmraw.dev $(DD)pgnm.dev $(DD)pgnmraw.dev $(DD)pnm.dev $(DD)pnmraw.dev $(DD)ppm.dev $(DD)ppmraw.dev $(DD)pkm.dev $(DD)pkmraw.dev $(DD)pksm.dev $(DD)pksmraw.dev
-#DEVICE_DEVS10=$(DD)tiffcrle.dev $(DD)tiffg3.dev $(DD)tiffg32d.dev $(DD)tiffg4.dev $(DD)tifflzw.dev $(DD)tiffpack.dev
-#DEVICE_DEVS11=$(DD)tiff12nc.dev $(DD)tiff24nc.dev $(DD)tiffgray.dev $(DD)tiff32nc.dev $(DD)tiffsep.dev
-#DEVICE_DEVS12=$(DD)psmono.dev $(DD)psgray.dev $(DD)psrgb.dev $(DD)bit.dev $(DD)bitrgb.dev $(DD)bitcmyk.dev
+DEVICE_DEVS=$(DISPLAY_DEV) @X11DEVS@
+
+DEVICE_DEVS1=$(DD)bmpmono.dev $(DD)bmpgray.dev $(DD)bmpsep1.dev $(DD)bmpsep8.dev $(DD)bmp16.dev $(DD)bmp256.dev $(DD)bmp16m.dev $(DD)bmp32b.dev
+DEVICE_DEVS2=#$(DD)gdevjbig2.dev $(DD)gdevjpx.dev #$(DD)rinkj.dev
+DEVICE_DEVS3=$(DD)deskjet.dev $(DD)djet500.dev $(DD)laserjet.dev $(DD)ljetplus.dev $(DD)ljet2p.dev $(DD)ljet3.dev $(DD)ljet3d.dev $(DD)ljet4.dev $(DD)ljet4d.dev $(DD)lj5mono.dev $(DD)lj5gray.dev
+DEVICE_DEVS4=$(DD)cdeskjet.dev $(DD)cdjcolor.dev $(DD)cdjmono.dev $(DD)cdj550.dev $(DD)pj.dev $(DD)pjxl.dev $(DD)pjxl300.dev
+DEVICE_DEVS5=$(DD)uniprint.dev @IJSDEVS@
+DEVICE_DEVS6=$(DD)bj10e.dev $(DD)bj200.dev $(DD)bjc600.dev $(DD)bjc800.dev
+DEVICE_DEVS7=$(DD)faxg3.dev $(DD)faxg32d.dev $(DD)faxg4.dev $(DD)cfax.dev
+DEVICE_DEVS8=$(DD)pcxmono.dev $(DD)pcxgray.dev $(DD)pcx16.dev $(DD)pcx256.dev $(DD)pcx24b.dev $(DD)pcxcmyk.dev
+DEVICE_DEVS9=$(DD)pbm.dev $(DD)pbmraw.dev $(DD)pgm.dev $(DD)pgmraw.dev $(DD)pgnm.dev $(DD)pgnmraw.dev $(DD)pnm.dev $(DD)pnmraw.dev $(DD)ppm.dev $(DD)ppmraw.dev $(DD)pkm.dev $(DD)pkmraw.dev $(DD)pksm.dev $(DD)pksmraw.dev
+DEVICE_DEVS10=$(DD)tiffcrle.dev $(DD)tiffg3.dev $(DD)tiffg32d.dev $(DD)tiffg4.dev $(DD)tifflzw.dev $(DD)tiffpack.dev
+DEVICE_DEVS11=$(DD)tiff12nc.dev $(DD)tiff24nc.dev $(DD)tiffgray.dev $(DD)tiff32nc.dev $(DD)tiffsep.dev
+DEVICE_DEVS12=$(DD)psmono.dev $(DD)psgray.dev $(DD)psrgb.dev $(DD)bit.dev $(DD)bitrgb.dev $(DD)bitcmyk.dev
#DEVICE_DEVS13=$(DD)pngmono.dev $(DD)pnggray.dev $(DD)png16.dev $(DD)png256.dev $(DD)png16m.dev
-#DEVICE_DEVS13=@PNGDEVS@
-#DEVICE_DEVS14=$(DD)jpeg.dev $(DD)jpeggray.dev
-#DEVICE_DEVS15=$(DD)pdfwrite.dev $(DD)pswrite.dev $(DD)ps2write.dev $(DD)epswrite.dev $(DD)pxlmono.dev $(DD)pxlcolor.dev
-#DEVICE_DEVS16=$(DD)bbox.dev
-
-#DEVICE_DEVS17=
-#DEVICE_DEVS18=
-#DEVICE_DEVS19=
-#DEVICE_DEVS20=$(DD)cljet5.dev $(DD)cljet5c.dev
-#DEVICE_DEVS21=$(DD)spotcmyk.dev $(DD)devicen.dev $(DD)xcf.dev $(DD)psdcmyk.dev $(DD)psdrgb.dev
-DEVICE_DEVS=$(DISPLAY_DEV) @X_DEVS@
-DEVICE_DEVS1=@FILES@
-DEVICE_DEVS2=@PRINTERS@
-DEVICE_DEVS3=@CUPSDEV@
-DEVICE_DEVS4=@IJSDEVS@
-DEVICE_DEVS5=@OMNIDEVS@
-DEVICE_DEVS6=@PNGDEVS@
-DEVICE_DEVS7=@JBIG2DEVS@
-DEVICE_DEVS8=
-DEVICE_DEVS9=
-DEVICE_DEVS10=
-DEVICE_DEVS11=
-DEVICE_DEVS12=
-DEVICE_DEVS13=
-DEVICE_DEVS14=
-DEVICE_DEVS15=
-DEVICE_DEVS16=
+DEVICE_DEVS13=@PNGDEVS@
+DEVICE_DEVS14=$(DD)jpeg.dev $(DD)jpeggray.dev
+DEVICE_DEVS15=$(DD)pdfwrite.dev $(DD)pswrite.dev $(DD)ps2write.dev $(DD)epswrite.dev $(DD)pxlmono.dev $(DD)pxlcolor.dev
+DEVICE_DEVS16=$(DD)bbox.dev
+
DEVICE_DEVS17=
DEVICE_DEVS18=
DEVICE_DEVS19=
-DEVICE_DEVS20=
-DEVICE_DEVS21=
-
-
-# Shared library target to build.
-GS_SHARED_OBJS=@DYNAMIC_DEVS@
+DEVICE_DEVS20=$(DD)cljet5.dev $(DD)cljet5c.dev
+DEVICE_DEVS21=$(DD)spotcmyk.dev $(DD)devicen.dev $(DD)xcf.dev $(DD)psdcmyk.dev $(DD)psdrgb.dev
# ---------------------------- End of options --------------------------- #
@@ -485,13 +427,9 @@ AK=
CCFLAGS=$(GENOPT) $(CAPOPT) $(CFLAGS)
CC_=$(CC) $(CCFLAGS)
CCAUX=$(CC) $(GCFLAGS)
-CC_LEAF=$(CC_)
-# note gcc can't use -fomit-frame-pointer with -pg.
-CC_LEAF_PG=$(CC_)
# These are the specific warnings we have to turn off to compile those
# specific few files that need this. We may turn off others in the future.
CC_NO_WARN=$(CC_)
-CC_SHARED=$(CC_) @DYNAMIC_LDFLAGS@
# ---------------- End of platform-specific section ---------------- #
@@ -517,8 +455,6 @@ include $(GLSRCDIR)/unixlink.mak
include $(GLSRCDIR)/unix-dll.mak
include $(GLSRCDIR)/unix-end.mak
include $(GLSRCDIR)/unixinst.mak
-@CONTRIBINCLUDE@
-@CUPSINCLUDE@
# Clean up after the autotools scripts
# configure.ac and Makefile.in are symlinks from a subdir
diff --git a/gs/src/configure.ac b/gs/src/configure.ac
index 6b19e8751..9ff1d398c 100644
--- a/gs/src/configure.ac
+++ b/gs/src/configure.ac
@@ -22,30 +22,6 @@ AC_INIT
AC_PREREQ(2.52)
AC_CONFIG_SRCDIR(src/gs.c)
-GS_VERSION_MAJOR=8
-GS_VERSION_MINOR=57
-GS_REVISIONDATE=20070426
-
-GS_VERSION=`expr $GS_VERSION_MAJOR \* 100 + $GS_VERSION_MINOR`
-
-if test $GS_VERSION_MINOR -lt 10; then
- GS_VERSION_MINOR0=0$GS_VERSION_MINOR
-else
- GS_VERSION_MINOR0=$GS_VERSION_MINOR
-fi
-
-AC_SUBST(GS_REVISIONDATE, $GS_REVISIONDATE)
-AC_SUBST(GS_VERSION_MAJOR, $GS_VERSION_MAJOR)
-AC_SUBST(GS_VERSION_MINOR, $GS_VERSION_MINOR)
-AC_SUBST(GS_VERSION_MINOR0, $GS_VERSION_MINOR0)
-AC_SUBST(GS_VERSION, $GS_VERSION)
-
-dnl Inherit compiler flags from the environment...
-CFLAGS="${CFLAGS:=}"
-CPPFLAGS="${CPPFLAGS:=}"
-CXXFLAGS="${CXXFLAGS:=}"
-LDFLAGS="${LDFLAGS:=}"
-
dnl --------------------------------------------------
dnl Check for programs
dnl --------------------------------------------------
@@ -60,20 +36,6 @@ CFLAGS=$save_cflags
AC_PROG_RANLIB
#AC_PROG_INSTALL
-dnl --------------------------------------------------
-dnl Allow excluding the contributed drivers
-dnl --------------------------------------------------
-
-AC_ARG_ENABLE(contrib, [ --disable-contrib do not include contributed drivers [default=include]])
-CONTRIBINCLUDE="include contrib/contrib.mak"
-INSTALL_CONTRIB="install-contrib-extras"
-if test x$enable_contrib = xno; then
- CONTRIBINCLUDE=""
- INSTALL_CONTRIB=""
- CFLAGS="$CFLAGS -DNOCONTRIB"
-fi
-AC_SUBST(CONTRIBINCLUDE)
-
dnl --------------------------------------------------
dnl Set build flags based on environment
dnl --------------------------------------------------
@@ -91,12 +53,6 @@ else
optflags_to_try="-O"
fi
-AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]])
-if test x$enable_debug = xyes; then
- optflags_to_try="-g"
- CFLAGS="-DDEBUG $CFLAGS"
-fi
-
AC_MSG_CHECKING([supported compiler flags])
old_cflags=$CFLAGS
echo
@@ -188,8 +144,6 @@ if test "$uint64_type" != "none"; then
GCFLAGS="$GCFLAGS -DGX_COLOR_INDEX_TYPE=\"$uint64_type\""
fi
-dnl pkg-config is used for several tests now...
-AC_PATH_PROG(PKGCONFIG, pkg-config)
dnl --------------------------------------------------
dnl Check for libraries
@@ -198,50 +152,6 @@ dnl --------------------------------------------------
AC_CHECK_LIB(m, cos)
dnl AC_CHECK_LIB(pthread, pthread_create)
-dnl Tests for iconv (Needed for OpenPrinting Vector, "opvp" output device)
-AC_ARG_WITH(libiconv,
- [AC_HELP_STRING([--with-libiconv=@<:@no/gnu/native@:>@],
- [use the libiconv library])],,
- [with_libiconv=maybe])
-found_iconv=no
-case $with_libiconv in
- maybe)
- # Check in the C library first
- AC_CHECK_FUNC(iconv_open, [with_libiconv=no; found_iconv=yes])
- # Check if we have GNU libiconv
- if test $found_iconv = "no"; then
- AC_CHECK_LIB(iconv, libiconv_open, [with_libiconv=gnu; found_iconv=yes])
- fi
- # Check if we have a iconv in -liconv, possibly from vendor
- if test $found_iconv = "no"; then
- AC_CHECK_LIB(iconv, iconv_open, [with_libiconv=native; found_iconv=yes])
- fi
- ;;
- no)
- AC_CHECK_FUNC(iconv_open, [with_libiconv=no; found_iconv=yes])
- ;;
- gnu|yes)
- AC_CHECK_LIB(iconv, libiconv_open, [with_libiconv=gnu; found_iconv=yes])
- ;;
- native)
- AC_CHECK_LIB(iconv, iconv_open, [with_libiconv=native; found_iconv=yes])
- ;;
-esac
-if test x$found_iconv != xno -a x$with_libiconv != xno ; then
- LIBS="$LIBS -liconv"
-fi
-
-case $with_libiconv in
- gnu)
- AC_DEFINE(USE_LIBICONV_GNU, 1, [Using GNU libiconv])
- ;;
- native)
- AC_DEFINE(USE_LIBICONV_NATIVE, 1, [Using a native implementation of iconv in a separate library])
- ;;
-esac
-
-AC_CHECK_LIB(dl, dlopen)
-
AC_MSG_CHECKING([for local jpeg library source])
dnl At present, we give the local source priority over the shared
dnl build, so that the D_MAX_BLOCKS_IN_MCU patch will be applied.
@@ -336,40 +246,6 @@ AC_SUBST(SHARE_LIBPNG)
AC_SUBST(LIBPNGDIR)
AC_SUBST(PNGDEVS)
-dnl look for CUPS...
-AC_ARG_ENABLE(cups, [ --enable-cups turn on CUPS support, default=yes])
-
-CUPSDEV=""
-CUPSINCLUDE=""
-CUPSCONFIG="${CUPSCONFIG:=}"
-cups_datadir="/usr/share/cups"
-cups_serverroot="/etc/cups"
-cups_serverbin="/usr/lib/cups"
-
-if ( ! test -z "$CONTRIBINCLUDE" ) && ( test -d contrib/cups ); then
- if test x$enable_cups != xno; then
- AC_PATH_PROG(CUPSCONFIG,cups-config)
- if test "x$CUPSCONFIG" != x; then
- dnl Use values from CUPS config...
-# LIBS="`$CUPSCONFIG --ldflags` `$CUPSCONFIG --static --image --libs | sed -e '1,$s/-lssl//'` $LIBS"
- LIBS="`$CUPSCONFIG --ldflags` `$CUPSCONFIG --image --libs` $LIBS"
- CFLAGS="`$CUPSCONFIG --cflags` $CFLAGS -Dgs_stderr=stderr"
- cups_serverroot="`$CUPSCONFIG --serverroot`"
- cups_serverbin="`$CUPSCONFIG --serverbin`"
- cups_datadir="`$CUPSCONFIG --datadir`"
- CUPSINCLUDE="include contrib/cups/cups.mak"
- CUPSDEV="\$(DD)cups.dev"
- fi
- fi
-fi
-
-AC_SUBST(CUPSDEV)
-AC_SUBST(CUPSCONFIG)
-AC_SUBST(CUPSINCLUDE)
-AC_SUBST(cups_datadir)
-AC_SUBST(cups_serverroot)
-AC_SUBST(cups_serverbin)
-
dnl look for IJS implementation
AC_ARG_WITH(ijs, AC_HELP_STRING([--with-ijs],[include IJS driver support]))
dnl set safe defaults
@@ -494,76 +370,23 @@ AC_SUBST(JASPERDIR)
AC_SUBST(SHARE_JASPER)
AC_SUBST(JPXDEVS)
-dnl look for omni implementation
-AC_ARG_WITH([omni], AC_HELP_STRING([--with-omni],
- [build the omni driver]))
-dnl set safe defaults
-OMNIDEVS=''
-INCLUDEOMNI=yes
-if ( ! test -z "$CONTRIBINCLUDE" ) && ( test x$with_omni != xno ); then
- OMNIDEVS='$(DD)omni.dev'
-
- if test -n "$GCC"; then
- LIBS="$LIBS -lstdc++"
- fi
-fi
-AC_SUBST(OMNIDEVS)
-
dnl optional X11 for display devices
AC_PATH_XTRA
-
-X_LDFLAGS=""
-X_CFLAGS=""
-X_DEVS=""
-X_LIBS=""
-
-if test x$no_x != xyes; then
- if test "$x_libraries" = "/usr/lib"; then
- echo "Ignoring X library directory \"$x_libraries\" requested by configure."
- x_libraries="NONE"
- fi
- if test ! "$x_libraries" = "NONE" -a ! "$x_libraries" = ""; then
- LDFLAGS="-L$x_libraries $LDFLAGS"
- X_LDFLAGS="-L$x_libraries"
- if test "$uname" = "SunOS"; then
- X_LDFLAGS="$X_LDFLAGS -R$x_libraries"
+XLIBS=''
+if test x"$no_x" = x"yes"; then
+ AC_MSG_NOTICE([disabling X11 output devices])
+ X11DEVS=''
+else
+ # enable X11 output devices
+ X11DEVS='$(DD)x11.dev $(DD)x11alpha.dev $(DD)x11cmyk.dev $(DD)x11gray2.dev $(DD)x11gray4.dev $(DD)x11mono.dev'
+ # the makefile wants a list of just the library names in XLIBS
+ for item in -lXt $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS; do
+ stripped=`echo "$item" | sed -e 's/-l//'`
+ if test "x$stripped" != "x$item"; then
+ XLIBS="$XLIBS $stripped"
fi
- fi
-
- if test "$x_includes" = "/usr/include"; then
- echo "Ignoring X include directory \"$x_includes\" requested by configure."
- x_includes="NONE"
- fi
- if test ! "$x_includes" = "NONE" -a ! "$x_includes" = ""; then
- X_CFLAGS="-I$x_includes"
- fi
-
- SAVELIBS="$LIBS"
-
- AC_CHECK_LIB(X11,XOpenDisplay)
- AC_CHECK_LIB(Xext,XdbeQueryExtension)
- AC_CHECK_LIB(Xt,XtAppCreateShell)
-
- LIBS="$SAVELIBS"
-
- if test "$ac_cv_lib_Xt_XtAppCreateShell" = yes; then
- X11DEVS="\$(DD)x11.dev \$(DD)x11alpha.dev \$(DD)x11cmyk.dev \$(DD)x11mono.dev \$(DD)x11_.dev \$(DD)x11alt_.dev \$(DD)x11cmyk2.dev \$(DD)x11cmyk4.dev \$(DD)x11cmyk8.dev \$(DD)x11rg16x.dev \$(DD)x11rg32x.dev \$(DD)x11gray2.dev \$(DD)x11gray4.dev"
- X_DEVS=$X11DEVS
- # the makefile wants a list of just the library names in XLIBS
- for item in -lXt $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS; do
- stripped=`echo "$item" | sed -e 's/-l//'`
- if test "x$stripped" != "x$item"; then
- XLIBS="$XLIBS $stripped"
- fi
- done
- X_LIBS=$XLIBS
- fi
+ done
fi
-
-AC_SUBST(X_LDFLAGS)
-AC_SUBST(X_CFLAGS)
-AC_SUBST(X_LIBS)
-AC_SUBST(X_DEVS)
AC_SUBST(X11DEVS)
AC_SUBST(XLIBS)
@@ -582,284 +405,6 @@ AC_ARG_ENABLE(compile-inits, AC_HELP_STRING([--disable-compile-inits],
fi])
AC_SUBST(COMPILE_INITS)
-dnl look for drivers to compile...
-AC_ARG_WITH(drivers,
-[ --with-drivers=LIST Drivers to support, separated by commas.
- Either list the drivers or use aliases:
- ALL = all drivers
- FILES = all file format drivers
- PRINTERS = all printer drivers
- Printers:
- APPLE = all Apple printers
- BROTHER = all Brother printers
- CANON = all Canon printers
- EPSON = all Epson printers
- HP = all HP printers
- IBM = all IBM printers
- JAPAN = older japanese printers
- LEXMARK = all Lexmark printers
- OKI = all OKI printers
- PCLXL = all PCL XL/6 printers
- File formats:
- BMP = Output to bmp files
- FAX = Output to fax files
- JPEG = Output to JPEG files
- JPEG2000 = Output to JPEG 2000 files
- PBM = Output to PBM/PNM
- PCX = Output to PCX
- PNG = Output to PNG
- PS = Output to PostScript/PDF
- TIFF = Output to TIFF
- You can mix both variants, e.g.
- --with-drivers=HP,stcolor would build HP drivers and
- the Epson stcolor driver.
- Aliases must be uppercase (a 3rd party driver might
- have the same name).
- Default: ALL],drivers="$withval",drivers="ALL")
-
-AC_ARG_WITH(driversfile,
-[ --with-driversfile=FILE Drivers to support from file, separated by newlines.],
-driversfile="$withval",driversfile="")
-
-if test "x$driversfile" != x; then
- # Add drivers from file...
- drivers="`tr '\n' ',' <$driversfile`"
-fi
-
-dnl Check which drivers we'd like to support.
-P_DEVS=""
-F_DEVS=""
-
-dnl Known printers
-HP_DEVS="cdj500 djet500 djet500c dnj650c cljet5pr deskjet laserjet ljetplus ljet2p ljet3 ljet3d ljet4 ljet4d lj4dith lj5mono lj5gray cdeskjet cdjcolor cdjmono cdj550 pj pjxl pjxl300 lp2563 paintjet pjetxl cljet5 cljet5c pxlmono pxlcolor cdj670 cdj850 cdj880 cdj890 cdj970 cdj1600 chp2200 pcl3 hpdjplus hpdjportable hpdj310 hpdj320 hpdj340 hpdj400 hpdj500 hpdj500c hpdj510 hpdj520 hpdj540 hpdj550c hpdj560c hpdj600 hpdj660c hpdj670c hpdj680c hpdj690c hpdj850c hpdj855c hpdj870c hpdj890c hpdj1120c lj3100sw"
-PCLXL_DEVS="pxlmono pxlcolor"
-EPSON_DEVS="eps9high eps9mid epson epsonc escp lp8000 lq850 photoex st800 stcolor alc1900 alc2000 alc4000 alc4100 alc8500 alc8600 alc9100 lp3000c lp8000c lp8200c lp8300c lp8500c lp8800c lp9000c lp9200c lp9500c lp9800c lps6500 epl2050 epl2050p epl2120 epl2500 epl2750 epl5800 epl5900 epl6100 epl6200 lp1800 lp1900 lp2200 lp2400 lp2500 lp7500 lp7700 lp7900 lp8100 lp8300f lp8400f lp8600 lp8600f lp8700 lp8900 lp9000b lp9100 lp9200b lp9300 lp9400 lp9600 lp9600s lps4500"
-CANON_DEVS="bj10e bj200 bjc600 bjc800 lbp8 lips3 bjcmono bjcgray bjccmyk bjccolor"
-LEXMARK_DEVS="lxm5700m lx5000 lxm3200 lex2050 lex3200 lex5700 lex7000"
-BROTHER_DEVS="hl7x0 hl1240 hl1250"
-APPLE_DEVS="appledmp iwhi iwlo iwlq"
-IBM_DEVS="ibmpro jetp3852"
-OKI_DEVS="oki182 okiibm oki4w"
-JAPAN_DEVS="lips4 lips4v ljet4pjl lj4dithp dj505j picty180 lips2p bjc880j pr201 pr150 pr1000 pr1000_4 jj100 bj10v bj10vh mj700v2c mj500c mj6000c mj8000c fmpr fmlbp ml600 lbp310 lbp320 md50Mono md50Eco md1xMono escpage lp2000 npdl rpdl"
-MISC_PDEVS="uniprint ap3250 atx23 atx24 atx38 coslw2p coslwxl cp50 declj250 fs600 imagen lj250 m8510 necp6 oce9050 r4081 sj48 tek4696 t4693d2 t4693d4 t4693d8 dl2100 la50 la70 la75 la75plus ln03 xes md2k md5k gdi samsunggdi"
-OPVP_DEVS="opvp oprp"
-
-dnl Known file formats
-BMP_DEVS="bmpmono bmpgray bmpsep1 bmpsep8 bmp16 bmp256 bmp16m bmp32b bmpa16 bmpa16m bmpa256 bmpa32b bmpamono bmpasep1 bmpasep8"
-FAX_DEVS="cfax dfaxlow dfaxhigh fax tfax tiffg3 tiffg32d tiffg4 faxg3 faxg32d faxg4"
-JPEG_DEVS="jpeg jpeggray"
-JPEG2000_DEVS="jpx"
-PNG_DEVS="png16 png16m png256 pngalpha pnggray pngmono"
-TIFF_DEVS="tiffs tiff12nc tiff24nc tiffcrle tifflzw tiffpack"
-PCX_DEVS="pcxmono pcxgray pcx16 pcx256 pcx24b pcxcmyk pcx2up"
-PBM_DEVS="pbm pbmraw pgm pgmraw pgnm pgnmraw pnm pnmraw ppm ppmraw pkm pkmraw pksm pksmraw pam"
-PS_DEVS="psdf psdcmyk psdrgb pdfwrite pswrite epswrite psgray psmono psrgb bbox"
-MISC_FDEVS="ccr cgm24 cgm8 cgmmono cif inferno mag16 mag256 mgr4 mgr8 mgrgray2 mgrgray4 mgrgray8 mgrmono miff24 plan9bm sgirgb sunhmono bit bitrgb bitcmyk devicen spotcmyk xcf"
-
-while test -n "$drivers"; do
- if echo $drivers |grep "," >/dev/null; then
- THIS="`echo $drivers |sed -e 's/,.*//'`"
- drivers="`echo $drivers |sed -e \"s/$THIS,//\"`"
- else
- THIS=$drivers
- drivers=""
- fi
- case "$THIS" in
- ALL)
- # ALL = PRINTERS + FILES...
- if test -z "$drivers"; then
- drivers="PRINTERS,FILES"
- else
- drivers="$drivers,PRINTERS,FILES"
- fi
- ;;
- PRINTERS)
- P_DEVS="$P_DEVS $CANON_DEVS $EPSON_DEVS $HP_DEVS $LEXMARK_DEVS $BROTHER_DEVS $APPLE_DEVS $IBM_DEVS $OKI_DEVS $JAPAN_DEVS $MISC_PDEVS $OPVP_DEVS"
- ;;
- FILES)
- F_DEVS="$F_DEVS $BMP_DEVS $FAX_DEVS $JPEG_DEVS $JPEG2000_DEVS $PNG_DEVS $TIFF_DEVS $PCX_DEVS $PBM_DEVS $PS_DEVS $MISC_FDEVS"
- ;;
- APPLE)
- # All Apple printers
- P_DEVS="$P_DEVS $APPLE_DEVS"
- ;;
- BMP)
- # BMP file format
- F_DEVS="$F_DEVS $BMP_DEVS"
- ;;
- CANON)
- # All Canon printers
- P_DEVS="$P_DEVS $CANON_DEVS"
- ;;
- EPSON)
- # All Epson printers
- P_DEVS="$P_DEVS $EPSON_DEVS"
- ;;
- FAX)
- # Fax file formats
- F_DEVS="$F_DEVS $FAX_DEVS"
- ;;
- JPEG)
- # Jpeg file formats
- F_DEVS="$F_DEVS $JPEG_DEVS"
- ;;
- JPEG2000)
- # Jpeg file formats
- F_DEVS="$F_DEVS $JPEG2000_DEVS"
- ;;
- PNG)
- # PNG file formats
- F_DEVS="$F_DEVS $PNG_DEVS"
- ;;
- TIFF)
- # TIFF file formats
- F_DEVS="$F_DEVS $TIFF_DEVS"
- ;;
- PCLXL)
- # PCL XL/PCL 6 drivers
- F_DEVS="$F_DEVS $PCLXL_DEVS"
- ;;
- PCX)
- # PCX file formats
- F_DEVS="$F_DEVS $PCX_DEVS"
- ;;
- PBM)
- # PBM file formats
- F_DEVS="$F_DEVS $PBM_DEVS"
- ;;
- HP)
- # All HP printers
- P_DEVS="$P_DEVS $HP_DEVS"
- ;;
- LEXMARK)
- # All Lexmark printers
- P_DEVS="$P_DEVS $LEXMARK_DEVS"
- ;;
- BROTHER)
- # All Brother printers
- P_DEVS="$P_DEVS $BROTHER_DEVS"
- ;;
- OKI)
- # All OKI printers
- P_DEVS="$P_DEVS $OKI_DEVS"
- ;;
- IBM)
- # All IBM printers
- P_DEVS="$P_DEVS $IBM_DEVS"
- ;;
- JAPAN)
- # All old japanese printers
- P_DEVS="$P_DEVS $JAPAN_DEVS"
- ;;
- PS)
- # PostScript/PDF writing
- F_DEVS="$F_DEVS $PS_DEVS"
- ;;
- opvp)
- # Open Vector Printing driver...
- if test x$ac_cv_lib_dl_dlopen != xno -a x$found_iconv != xno; then
- P_DEVS="$P_DEVS $OPVP_DEVS"
- else
- AC_MSG_WARN(Unable to include opvp/oprp driver due to missing prerequisites...)
- fi
- ;;
- *)
- # It's a driver name (or a user messup)
- P_DEVS="$P_DEVS `echo $THIS |sed -e 's,\.dev$,,'`"
- ;;
- esac
-done
-# No need to include opvp/oprp driver without iconv/libiconv.
-if test -n "$P_DEVS"; then
- if test x$found_iconv = xno ; then
- P_DEVS=`echo $P_DEVS | sed -e 's|opvp||' -e 's|oprp||'`
- AC_MSG_WARN(Unable to include opvp/oprp driver due to missing iconv/libiconv...)
- fi
-
-# Remove contributed drivers if requested and make sure we don't have any
-# duplicates in there, add $(DD)foo.dev constructs
- PRINTERS=`(for i in $P_DEVS; do d='$(DD)'${i}.dev; if ( grep -q '^'$d src/*.mak ) || ( ! test -z "$CONTRIBINCLUDE" ); then echo $d; fi; done) | sort | uniq | tr '\012' ' '`
-fi
-if test -n "$F_DEVS"; then
- FILES=`(for i in $F_DEVS; do d='$(DD)'${i}.dev; if ( grep -q '^'$d src/*.mak ) || ( ! test -z "$CONTRIBINCLUDE" ); then echo $d; fi; done) | sort | uniq | tr '\012' ' '`
-fi
-AC_SUBST(PRINTERS)
-AC_SUBST(FILES)
-
-dnl Dynamic device support.
-DYNAMIC_CFLAGS=""
-DYNAMIC_DEVS=""
-DYNAMIC_FLAGS=""
-DYNAMIC_LDFLAGS=""
-DYNAMIC_LIBS=""
-INSTALL_SHARED=""
-
-AC_ARG_ENABLE(dynamic, [ --enable-dynamic enable dynamically loaded drivers (default=no)],
-[ case `uname` in
- Linux*)
- INSTALL_SHARED="install-shared"
- DYNAMIC_CFLAGS="-fPIC"
- if test "x$X_DEVS" != x; then
- DYNAMIC_DEVS="\$(GLOBJDIR)/X11.so"
- else
- DYNAMIC_DEVS=""
- fi
- DYNAMIC_FLAGS="-DGS_DEVS_SHARED -DGS_DEVS_SHARED_DIR=\\\"\$(gssharedir)\\\""
- DYNAMIC_LDFLAGS="-fPIC -shared"
- DYNAMIC_LIBS="-rdynamic -ldl"
- X_DEVS=""
- ;;
- *BSD)
- DYNAMIC_CFLAGS="-fPIC"
- DYNAMIC_DEVS="\$(GLOBJDIR)/X11.so"
- DYNAMIC_FLAGS="-DGS_DEVS_SHARED -DGS_DEVS_SHARED_DIR=\\\"\$(gssharedir)\\\""
- DYNAMIC_LDFLAGS="-fPIC -shared"
- DYNAMIC_LIBS=""
- X_DEVS=""
- ;;
- *)
- AC_MSG_ERROR([Sorry, dynamic driver support not available on this platform!])
- ;;
- esac
-])
-
-AC_SUBST(DYNAMIC_CFLAGS)
-AC_SUBST(DYNAMIC_DEVS)
-AC_SUBST(DYNAMIC_FLAGS)
-AC_SUBST(DYNAMIC_LDFLAGS)
-AC_SUBST(DYNAMIC_LIBS)
-AC_SUBST(INSTALL_SHARED)
-
-dnl look for default font path...
-AC_ARG_WITH(fontpath, [ --with-fontpath set font path for gs],fontpath="$withval",fontpath="")
-
-dnl Fix "prefix" variable...
-if test "x$prefix" = xNONE; then
- prefix=/usr/local
-fi
-
-dnl Fix "datadir" variable...
-if test "x$datadir" = 'x${prefix}/share'; then
- datadir="$prefix/share"
-fi
-
-dnl Fix "fontpath" variable...
-if test "x$fontpath" = "x"; then
- # These font directories are used by various Linux distributions...
- fontpath="$datadir/fonts/default/ghostscript"
- fontpath="${fontpath}:$datadir/fonts/default/Type1"
- fontpath="${fontpath}:$datadir/fonts/default/TrueType"
-
- # These font directories are used by IRIX...
- fontpath="${fontpath}:/usr/lib/DPS/outline/base"
-
- # These font directories are used by Solaris...
- fontpath="${fontpath}:/usr/openwin/lib/X11/fonts/Type1"
- fontpath="${fontpath}:/usr/openwin/lib/X11/fonts/TrueType"
-fi
-
-AC_SUBST(fontpath)
-
dnl --------------------------------------------------
dnl Check for library functions
dnl --------------------------------------------------
@@ -888,7 +433,4 @@ dnl --------------------------------------------------
AC_SUBST(OPT_CFLAGS)
AC_SUBST(GCFLAGS)
-AC_OUTPUT(Makefile src/version.mak
- contrib/cups/pstopxl contrib/cups/pstoraster)
-
-chmod +x contrib/cups/pstopxl contrib/cups/pstoraster
+AC_OUTPUT(Makefile)
diff --git a/gs/src/contrib.mak b/gs/src/contrib.mak
index dbcb34ae2..0c3cb4beb 100644
--- a/gs/src/contrib.mak
+++ b/gs/src/contrib.mak
@@ -472,6 +472,16 @@ $(GLOBJ)gdevstc3.$(OBJ) : $(GLSRC)gdevstc3.c $(gdevstc_h) $(PDEVH)
$(GLOBJ)gdevstc4.$(OBJ) : $(GLSRC)gdevstc4.c $(gdevstc_h) $(PDEVH)
$(GLCC) $(GLO_)gdevstc4.$(OBJ) $(C_) $(GLSRC)gdevstc4.c
+###--------------- Added Omni --------------------------###
+
+epclr_h1=$(GLSRC)defs.h
+
+$(DD)omni.dev : $(GLOBJ)gomni.$(OBJ) $(DD)page.dev
+ $(SETPDEV) $(DD)omni $(GLOBJ)gomni.$(OBJ)
+
+$(GLOBJ)gomni.$(OBJ) : $(GLSRC)gomni.c $(epclr_h1) $(PDEVH)
+ $(GLCC) $(GLO_)gomni.$(OBJ) $(C_) $(GLSRC)gomni.c
+
### --------------- Ugly/Update -> Unified Printer Driver ---------------- ###
### For questions about this driver, please contact: ###
### Gunther Hess (gunther@elmos.de) ###
@@ -837,24 +847,3 @@ $(DD)sunhmono.dev : $(sunr_) $(DD)page.dev
$(GLOBJ)gdevsunr.$(OBJ) : $(GLSRC)gdevsunr.c $(PDEVH)
$(GLCC) $(GLO_)gdevsunr.$(OBJ) $(C_) $(GLSRC)gdevsunr.c
-
-#########################################################################
-### --------------------Japanese printer addons --------------------- ###
-#########################################################################
-
-### These drivers are based on patches on existing device drivers in the
-### src/ directory, therefore they are not in addons/
-
-$(DD)ljet4pjl.dev: $(HPMONO) $(DD)page.dev
- $(SETPDEV) $(DD)ljet4pjl $(HPMONO)
-
-$(DD)lj4dithp.dev: $(cdeskjet_) $(DD)page.dev
- $(SETPDEV) $(DD)lj4dithp $(cdeskjet_)
-
-$(DD)dj505j.dev: $(cdeskjet_)
- $(SETPDEV) $(DD)dj505j $(cdeskjet_)
-
-$(DD)picty180.dev: $(cdeskjet_)
- $(SETPDEV) $(DD)picty180 $(cdeskjet_)
-
-#########################################################################
diff --git a/gs/src/devs.mak b/gs/src/devs.mak
index 6bdad5007..6a856ba36 100644
--- a/gs/src/devs.mak
+++ b/gs/src/devs.mak
@@ -412,7 +412,7 @@ $(DD)lvga256.dev : $(DEVS_MAK) $(lvga256_)
$(ADDMOD) $(DD)lvga256 -lib vga vgagl
$(GLOBJ)gdevl256.$(OBJ) : $(GLSRC)gdevl256.c $(GDEV) $(memory__h)
- $(GLCCSHARED) $(GLO_)gdevl256.$(OBJ) $(C_) $(GLSRC)gdevl256.c
+ $(GLCC) $(GLO_)gdevl256.$(OBJ) $(C_) $(GLSRC)gdevl256.c
vgalib_=$(GLOBJ)gdevvglb.$(OBJ) $(GLOBJ)gdevpccm.$(OBJ)
$(DD)vgalib.dev : $(DEVS_MAK) $(vgalib_)
@@ -420,18 +420,7 @@ $(DD)vgalib.dev : $(DEVS_MAK) $(vgalib_)
$(ADDMOD) $(DD)vgalib -lib vga
$(GLOBJ)gdevvglb.$(OBJ) : $(GLSRC)gdevvglb.c $(GDEV) $(gdevpccm_h) $(gsparam_h)
- $(GLCCSHARED) $(GLO_)gdevvglb.$(OBJ) $(C_) $(GLSRC)gdevvglb.c
-
-### Shared library object supporting vgalib.
-### NON PORTABLE, ONLY UNIX WITH GCC SUPPORT
-
-$(GLOBJ)lvga256.so: $(lvga256_)
- $(CCLD) -shared -Wl,'-solvga256.so' $(lvga256_) -lvga -lvgagl
- mv lvga256.so $(GLOBJ)lvga256.so
-
-$(GLOBJ)vgalib.so: $(vgalib_)
- $(CCLD) -shared -Wl,'-sovgalib.so' $(vgalib_) -lvga -lvgagl
- mv vgalib.so $(GLOBJ)vgalib.so
+ $(GLCC) $(GLO_)gdevvglb.$(OBJ) $(C_) $(GLSRC)gdevvglb.c
### -------------------------- The X11 device -------------------------- ###
@@ -461,14 +450,14 @@ GDEVX=$(GDEV) $(x__h) $(gdevx_h) $(TOP_MAKEFILES)
$(GLOBJ)gdevx.$(OBJ) : $(GLSRC)gdevx.c $(GDEVX) $(math__h) $(memory__h)\
$(gscoord_h) $(gsdevice_h) $(gsiparm2_h) $(gsmatrix_h) $(gsparam_h)\
$(gxdevmem_h) $(gxgetbit_h) $(gxiparam_h) $(gxpath_h)
- $(GLCCSHARED) $(XINCLUDE) $(GLO_)gdevx.$(OBJ) $(C_) $(GLSRC)gdevx.c
+ $(GLCC) $(XINCLUDE) $(GLO_)gdevx.$(OBJ) $(C_) $(GLSRC)gdevx.c
$(GLOBJ)gdevxcmp.$(OBJ) : $(GLSRC)gdevxcmp.c $(GDEVX) $(math__h)
$(GLCC) $(XINCLUDE) $(GLO_)gdevxcmp.$(OBJ) $(C_) $(GLSRC)gdevxcmp.c
$(GLOBJ)gdevxini.$(OBJ) : $(GLSRC)gdevxini.c $(GDEVX) $(memory__h)\
$(gserrors_h) $(gsparamx_h) $(gxdevmem_h) $(gdevbbox_h)
- $(GLCCSHARED) $(XINCLUDE) $(GLO_)gdevxini.$(OBJ) $(C_) $(GLSRC)gdevxini.c
+ $(GLCC) $(XINCLUDE) $(GLO_)gdevxini.$(OBJ) $(C_) $(GLSRC)gdevxini.c
# We have to compile gdevxres without warnings, because there is a
# const/non-const cast required by the X headers that we can't work around.
@@ -478,7 +467,7 @@ $(GLOBJ)gdevxres.$(OBJ) : $(GLSRC)gdevxres.c $(std_h) $(x__h)\
$(GLOBJ)gdevxxf.$(OBJ) : $(GLSRC)gdevxxf.c $(GDEVX) $(math__h) $(memory__h)\
$(gsstruct_h) $(gsutil_h) $(gxxfont_h)
- $(GLCCSHARED) $(XINCLUDE) $(GLO_)gdevxxf.$(OBJ) $(C_) $(GLSRC)gdevxxf.c
+ $(GLCC) $(XINCLUDE) $(GLO_)gdevxxf.$(OBJ) $(C_) $(GLSRC)gdevxxf.c
# Alternate X11-based devices to help debug other drivers.
# x11alpha pretends to have 4 bits of alpha channel.
@@ -528,14 +517,7 @@ $(DD)x11rg32x.dev : $(DEVS_MAK) $(DD)x11alt_.dev
$(GLOBJ)gdevxalt.$(OBJ) : $(GLSRC)gdevxalt.c $(GDEVX) $(math__h) $(memory__h)\
$(gsdevice_h) $(gsparam_h) $(gsstruct_h)
- $(GLCCSHARED) $(XINCLUDE) $(GLO_)gdevxalt.$(OBJ) $(C_) $(GLSRC)gdevxalt.c
-
-### Shared library object supporting X11.
-### NON PORTABLE, ONLY UNIX WITH GCC SUPPORT
-
-$(GLOBJ)X11.so: $(x11alt_) $(x11_)
- $(CCLD) -shared -Wl,'-soX11.so' $(x11alt_) $(x11_) -L/usr/X11R6/lib -lXt -lSM -lICE -lXext -lX11 $(XLIBDIRS)
- mv X11.so $(GLOBJ)X11.so
+ $(GLCC) $(XINCLUDE) $(GLO_)gdevxalt.$(OBJ) $(C_) $(GLSRC)gdevxalt.c
###### --------------- Memory-buffered printer devices --------------- ######
diff --git a/gs/src/gconf.c b/gs/src/gconf.c
index a5a27d301..6238c88c1 100644
--- a/gs/src/gconf.c
+++ b/gs/src/gconf.c
@@ -88,8 +88,7 @@ private const gs_composite_type_t *const gx_compositor_list[] = {
/* Set up the device table. */
#define device_(dev) (const gx_device *)&dev,
#define device2_(dev) &dev,
-private gx_device *gx_device_list[1024] = {
- /* as shared library are adding drivers here, so removed constness */
+private const gx_device *const gx_device_list[] = {
#include "gconf.h"
0
};
@@ -170,29 +169,9 @@ int
gs_lib_device_list(const gx_device * const **plist,
gs_memory_struct_type_t ** pst)
{
- int i;
-
if (plist != 0)
*plist = gx_device_list;
if (pst != 0)
*pst = NULL;
-
- for (i = 0; i < countof(gx_device_list) - 1; ++i)
- if (!gx_device_list[i])
- break;
- return i;
-}
-
-#ifdef GS_DEVS_SHARED
-void
-gs_lib_register_device(const gx_device *dev)
-{
- int i;
-
- for (i = 0; i < countof(gx_device_list) - 1; ++i)
- if (!gx_device_list[i]) {
- gx_device_list[i] = dev;
- return;
- }
+ return countof(gx_device_list) - 1;
}
-#endif
diff --git a/gs/src/gdevcdj.c b/gs/src/gdevcdj.c
index 8709d0263..cc3667d0e 100644
--- a/gs/src/gdevcdj.c
+++ b/gs/src/gdevcdj.c
@@ -13,16 +13,6 @@
/* $Id$*/
/* HP and Canon colour printer drivers */
-/*
- * HP DeskJet 505J Support (dj505j.dev)
- * -- taken from dj505j driver for Ghostscript 2.6.1 by Kazunori Asayama
- * NEC PICTY180 (PC-PR101J/180) Support (picty180.dev)
- * HP LaserJet 4V/4LJ Pro dither Suport (lj4dithp.dev)
- *
- * Norihito Ohmori <ohmori@p.chiba-u.ac.jp>
- * April 15, 1999
- */
-
/****************************************************************
* The code in this file was contributed by the authors whose names and/or
* e-mail addresses appear below: Aladdin Enterprises takes no
@@ -115,8 +105,6 @@
* 10 - bjc600: BJC 600//4000 printers
*** The BJC800 driver is based on the bjc600 one. By YA too.
* 11 - bjc800: BJC 800 printer
- * 12 - dj505j: HP DeskJet 505J
- * 13 - pixty180: NEC PICTY 180 (PC-PR101J/180)
***/
/*
@@ -185,8 +173,6 @@ private int cdj_param_check_float(gs_param_list *, gs_param_name, floatp, bool);
/* Margins are left, bottom, right, top. */
#define DESKJET_MARGINS_LETTER (float)0.25, (float)0.50, (float)0.25, (float)0.167
#define DESKJET_MARGINS_A4 (float)0.125, (float)0.50, (float)0.143, (float)0.167
-#define DESKJET_505J_MARGINS (float)0.125, (float)0.50, (float)0.125, (float)0.167
-#define DESKJET_505J_MARGINS_COLOR (float)0.125, (float)0.665, (float)0.125, (float)0.167
#define LJET4_MARGINS (float)0.26, (float)0.0, (float)0.0, (float)0.0
/* The PaintJet and DesignJet seem to have the same margins */
/* regardless of paper size. */
@@ -231,16 +217,15 @@ private int cdj_param_check_float(gs_param_list *, gs_param_name, floatp, bool);
/* Printer types */
#define DJ500C 0
#define DJ550C 1
-#define DJ505J 2
-#define PJXL300 3
-#define PJ180 4
-#define PJXL180 5
-#define DECLJ250 6
-#define DNJ650C 7
-#define LJ4DITH 8
-#define ESC_P 9
-#define BJC600 10
-#define BJC800 11
+#define PJXL300 2
+#define PJ180 3
+#define PJXL180 4
+#define DECLJ250 5
+#define DNJ650C 6
+#define LJ4DITH 7
+#define ESC_P 8
+#define BJC600 9
+#define BJC800 10
/* No. of ink jets (used to minimise head movements) */
#define HEAD_ROWS_MONO 50
@@ -257,7 +242,6 @@ private dev_proc_decode_color (gdev_cmyk_map_color_cmyk);
/* Print-page, parameters and miscellaneous procedures */
private dev_proc_open_device(dj500c_open);
private dev_proc_open_device(dj550c_open);
-private dev_proc_open_device(dj505j_open);
private dev_proc_open_device(dnj650c_open);
private dev_proc_open_device(lj4dith_open);
private dev_proc_open_device(pj_open);
@@ -269,11 +253,8 @@ private dev_proc_open_device(bjc_open);
private dev_proc_print_page(declj250_print_page);
private dev_proc_print_page(dj500c_print_page);
private dev_proc_print_page(dj550c_print_page);
-private dev_proc_print_page(dj505j_print_page);
-private dev_proc_print_page(picty180_print_page);
private dev_proc_print_page(dnj650c_print_page);
private dev_proc_print_page(lj4dith_print_page);
-private dev_proc_print_page(lj4dithp_print_page);
private dev_proc_print_page(pj_print_page);
private dev_proc_print_page(pjxl_print_page);
private dev_proc_print_page(pjxl300_print_page);
@@ -538,9 +519,6 @@ private gx_device_procs cdj550cmyk_procs =
cmyk_colour_procs(dj550c_open, cdj_get_params, cdj_put_params);
#endif
-private gx_device_procs dj505j_procs =
-hp_colour_procs(dj505j_open, cdj_get_params, cdj_put_params);
-
private gx_device_procs dnj650c_procs =
hp_colour_procs(dnj650c_open, cdj_get_params, cdj_put_params);
@@ -589,14 +567,6 @@ gx_device_cdj far_data gs_cdj550cmyk_device = {
};
#endif
-gx_device_cdj far_data gs_picty180_device =
-cdj_device(cdj550_procs, "picty180", 300, 300, BITSPERPIXEL,
- picty180_print_page, 0, 2, 1);
-
-gx_device_cdj far_data gs_dj505j_device =
-cdj_device(dj505j_procs, "dj505j", 300, 300, 1,
- dj505j_print_page, 4, 0, 1);
-
gx_device_pj far_data gs_declj250_device =
pj_device(pj_procs, "declj250", 180, 180, BITSPERPIXEL,
declj250_print_page);
@@ -609,10 +579,6 @@ gx_device_cdj far_data gs_lj4dith_device =
cdj_device(lj4dith_procs, "lj4dith", 600, 600, 8,
lj4dith_print_page, 4, 0, 1);
-gx_device_cdj far_data gs_lj4dithp_device =
-cdj_device(lj4dith_procs, "lj4dithp", 600, 600, 8,
- lj4dithp_print_page, 4, 0, 1);
-
gx_device_pj far_data gs_pj_device =
pj_device(pj_procs, "pj", 180, 180, BITSPERPIXEL,
pj_print_page);
@@ -712,11 +678,6 @@ dj550c_open(gx_device *pdev)
}
private int
-dj505j_open(gx_device *pdev)
-{ return hp_colour_open(pdev, DJ505J);
-}
-
-private int
dnj650c_open(gx_device *pdev)
{ return hp_colour_open(pdev, DNJ650C);
}
@@ -756,8 +717,6 @@ hp_colour_open(gx_device *pdev, int ptype)
{ /* Change the margins if necessary. */
static const float dj_a4[4] = { DESKJET_MARGINS_A4 };
static const float dj_letter[4] = { DESKJET_MARGINS_LETTER };
- static const float dj_505j[4] = { DESKJET_505J_MARGINS };
- static const float dj_505jc[4] = { DESKJET_505J_MARGINS_COLOR };
static const float lj4_all[4] = { LJET4_MARGINS };
static const float pj_all[4] = { PAINTJET_MARGINS };
static const float dnj_all[4] = { DESIGNJET_MARGINS };
@@ -784,9 +743,6 @@ hp_colour_open(gx_device *pdev, int ptype)
m = (gdev_pcl_paper_size(pdev) == PAPER_SIZE_A4 ? dj_a4 :
dj_letter);
break;
- case DJ505J:
- m = pdev->color_info.num_components > 1 ? dj_505jc : dj_505j;
- break;
case DNJ650C:
m = dnj_all;
break;
@@ -1272,26 +1228,6 @@ dj550c_print_page(gx_device_printer * pdev, FILE * prn_stream)
return hp_colour_print_page(pdev, prn_stream, DJ550C);
}
-/* The Picty180C can compress (mode 9) */
-/* This printer need switching mode using PJL */
-private int
-picty180_print_page(gx_device_printer * pdev, FILE * prn_stream)
-{ int ret_code;
- /* Ensure we're operating in PCL mode */
- fputs("\033%-12345X@PJL ENTER LANGUAGE = PCLSLEEK\n", prn_stream);
- ret_code = hp_colour_print_page(pdev, prn_stream, DJ550C);
- /* Reenter switch-configured language */
- fputs("\033%-12345X", prn_stream);
- return ret_code;
-}
-
-/* The DeskJet505J can compress */
-private int
-dj505j_print_page(gx_device_printer * pdev, FILE * prn_stream)
-{
- return hp_colour_print_page(pdev, prn_stream, DJ505J);
-}
-
/* The DesignJet650C can compress (mode 1) */
private int
dnj650c_print_page(gx_device_printer * pdev, FILE * prn_stream)
@@ -1305,17 +1241,6 @@ lj4dith_print_page(gx_device_printer * pdev, FILE * prn_stream)
return hp_colour_print_page(pdev, prn_stream, LJ4DITH);
}
-private int
-lj4dithp_print_page(gx_device_printer * pdev, FILE * prn_stream)
-{ int ret_code;
- /* Ensure we're operating in PCL mode */
- fputs("\033%-12345X@PJL\r\n@PJL ENTER LANGUAGE = PCL\r\n", prn_stream);
- ret_code = hp_colour_print_page(pdev, prn_stream, LJ4DITH);
- /* Reenter switch-configured language */
- fputs("\033%-12345X", prn_stream);
- return ret_code;
-}
-
/* The PJXL300 can compress (modes 2 & 3) */
private int
pjxl300_print_page(gx_device_printer * pdev, FILE * prn_stream)
@@ -2181,11 +2106,7 @@ hp_colour_print_page(gx_device_printer * pdev, FILE * prn_stream, int ptype)
}
/* Initialize printer. */
- if (ptype == DJ505J) {
- fputs("\033@",prn_stream); /* Reset printer */
- fprintf(prn_stream,"\033_R%c%c", /* Set resolution */
- (int)x_dpi & 0xff,((int)x_dpi >> 8) & 0xff);
- } else if (ptype == BJC600 || ptype == BJC800) {
+ if (ptype == BJC600 || ptype == BJC800) {
bjc_init_page(pdev, prn_stream);
} else {
if (ptype == LJ4DITH) {
@@ -2228,24 +2149,6 @@ hp_colour_print_page(gx_device_printer * pdev, FILE * prn_stream, int ptype)
/* Select data compression */
compression = 9;
break;
- case DJ505J:
- /* Set depletion and shingling levels */
- fprintf(prn_stream, "\033_D%c\033_E%c",
- cdj->depletion, cdj->shingling);
- /* Move to top left of printed area */
- fwrite("\033_N\000", 4, 1, prn_stream);
- fwrite("\033_J\xc4\xff", 5, 1, prn_stream);
- /* Set number of planes ((-)1 is mono, (-)3 is (cmy)rgb, -4 is cmyk),
- * and raster width, then start raster graphics */
- fprintf(prn_stream, "\033_U%c%c",
- (0xffff - num_comps + 1) & 0xff, ((0xffff - num_comps + 1) >> 8) & 0xff);
- fprintf(prn_stream,
- "\033_S%c%c", raster_width & 0xff, (raster_width >> 8) & 0xff);
- /* set origin */
- fwrite("\033_A\001", 4, 1, prn_stream);
- compression = 1;
- combined_escapes = 0;
- break;
case DNJ650C:
if (pdev->x_pixels_per_inch == 600) {
/* set resolution to 600dpi 1st through PJL command */
@@ -2372,9 +2275,7 @@ hp_colour_print_page(gx_device_printer * pdev, FILE * prn_stream, int ptype)
* omission is that 'mode 9' compression is not supported, as this
* mode can give both computational and PCL file size advantages. */
- if (ptype == DJ505J) {
- fprintf(prn_stream, "\033_M%c", compression);
- } else if (combined_escapes) {
+ if (combined_escapes) {
/* From now on, all escape commands start with \033*b, so we
* combine them (if the printer supports this). */
fputs("\033*b", prn_stream);
@@ -2455,10 +2356,7 @@ hp_colour_print_page(gx_device_printer * pdev, FILE * prn_stream, int ptype)
}
/* Skip blank lines if any */
if (num_blank_lines > 0) {
- if (ptype == DJ505J) {
- fprintf(prn_stream,"\033_Y%c%c",
- num_blank_lines & 0xff, (num_blank_lines >> 8) & 0xff);
- } else if (ptype == ESC_P) {
+ if (ptype == ESC_P) {
ep_print_image(prn_stream, 'B', 0, num_blank_lines);
} else if (ptype == BJC600 || ptype == BJC800) {
bjc_v_skip(num_blank_lines, pdev, prn_stream);
@@ -2642,13 +2540,6 @@ hp_colour_print_page(gx_device_printer * pdev, FILE * prn_stream, int ptype)
fputc('v', prn_stream);
}
break;
- case DJ505J:
- out_count = gdev_pcl_mode1compress((const byte *)
- plane_data[scan][i],
- (const byte *)
- plane_data[scan][i] + plane_size - 1,
- out_data);
- break;
case PJ180:
case DNJ650C:
if (num_comps > 1)
@@ -2718,10 +2609,7 @@ hp_colour_print_page(gx_device_printer * pdev, FILE * prn_stream, int ptype)
break;
}
if (output_plane) {
- if (ptype == DJ505J)
- fprintf(prn_stream, "\033_%c%c%c",
- "WVVV"[i], out_count & 0xff, (out_count >> 8) & 0xff);
- else if (combined_escapes)
+ if (combined_escapes)
fprintf(prn_stream, "%d%c", out_count, "wvvv"[i]);
else if (ptype == BJC600 || ptype == BJC800) {
if (out_count)
@@ -2750,16 +2638,13 @@ hp_colour_print_page(gx_device_printer * pdev, FILE * prn_stream, int ptype)
/* end raster graphics */
if (ptype == BJC600 || ptype == BJC800) {
bjc_finish_page(pdev, prn_stream);
- } else if (ptype == DJ505J)
- fputs("\033_C", prn_stream);
+ }
else if (ptype != ESC_P)
fputs("\033*rbC\033E", prn_stream);
/* eject page */
if (ptype == PJ180)
fputc('\f', prn_stream);
- else if (ptype == DJ505J)
- fputs("\f\033@", prn_stream);
else if (ptype == DNJ650C)
fputs ("\033*rC\033%0BPG;", prn_stream);
else if (ptype == BJC600 || ptype == BJC800)
diff --git a/gs/src/gdevdjet.c b/gs/src/gdevdjet.c
index 017892276..05fbff930 100644
--- a/gs/src/gdevdjet.c
+++ b/gs/src/gdevdjet.c
@@ -95,7 +95,6 @@
/* The device descriptors */
private dev_proc_open_device(hpjet_open);
private dev_proc_close_device(hpjet_close);
-private dev_proc_close_device(ljet4pjl_close);
private dev_proc_print_page_copies(djet_print_page_copies);
private dev_proc_print_page_copies(djet500_print_page_copies);
private dev_proc_print_page_copies(fs600_print_page_copies);
@@ -108,7 +107,6 @@ private dev_proc_print_page_copies(ljet4_print_page_copies);
private dev_proc_print_page_copies(ljet4d_print_page_copies);
private dev_proc_print_page_copies(lp2563_print_page_copies);
private dev_proc_print_page_copies(oce9050_print_page_copies);
-private dev_proc_print_page_copies(ljet4pjl_print_page_copies);
private dev_proc_get_params(hpjet_get_params);
private dev_proc_put_params(hpjet_put_params);
@@ -116,10 +114,6 @@ private const gx_device_procs prn_hp_procs =
prn_params_procs(hpjet_open, gdev_prn_output_page, hpjet_close,
hpjet_get_params, hpjet_put_params);
-private gx_device_procs prn_ljet4pjl_procs =
-prn_params_procs(hpjet_open, gdev_prn_output_page, ljet4pjl_close,
- gdev_prn_get_params, gdev_prn_put_params);
-
typedef struct gx_device_hpjet_s gx_device_hpjet;
struct gx_device_hpjet_s {
@@ -221,13 +215,6 @@ HPJET_DEVICE(prn_hp_procs, "oce9050",
0, 0, 0, 0, /* margins */
1, oce9050_print_page_copies);
-const gx_device_printer gs_ljet4pjl_device =
-prn_device_copies(prn_ljet4pjl_procs, "ljet4pjl",
- DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,
- X_DPI2, Y_DPI2,
- 0, 0, 0, 0, /* margins */
- 1, ljet4pjl_print_page_copies);
-
/* Open the printer, adjusting the margins if necessary. */
private int
hpjet_open(gx_device * pdev)
@@ -289,22 +276,6 @@ hpjet_close(gx_device * pdev)
return gdev_prn_close(pdev);
}
-private int
-ljet4pjl_close(gx_device *pdev)
-{
- gx_device_printer *const ppdev = (gx_device_printer *)pdev;
- int code = gdev_prn_open_printer(pdev, 1);
-
- if (code < 0)
- return code;
- if ( ppdev->Duplex_set >= 0 && ppdev->Duplex ) {
- gdev_prn_open_printer(ppdev, 1);
- fputs("\033&l0H", ppdev->file) ;
- }
- fputs("\033%-12345X", ppdev->file);
- return gdev_prn_close(ppdev);
-}
-
/* ------ Internal routines ------ */
/* Make an init string that contains paper tray selection. The resulting
@@ -454,22 +425,6 @@ ljet4d_print_page_copies(gx_device_printer * pdev, FILE * prn_stream,
dots_per_inch, PCL_LJ4D_FEATURES,
init);
}
-
-/* LaserJet 4 series compresses, and it needs a special sequence to */
-/* allow it to specify coordinates at 600 dpi. */
-/* It too needs its coordinate system translated slightly. */
-private int
-ljet4pjl_print_page_copies(gx_device_printer *pdev, FILE *prn_stream,
- int num_copies)
-{ int dots_per_inch = (int)pdev->y_pixels_per_inch;
- char real_init[60];
-
- sprintf(real_init, "\033&l-180u36Z\033*r0F\033&u%dD", dots_per_inch);
- return dljet_mono_print_page_copies(pdev, prn_stream, num_copies,
- dots_per_inch, PCL_LJ4PJL_FEATURES,
- real_init);
-}
-
/* The 2563B line printer can't compress */
/* and doesn't support *p+ or *b vertical spacing. */
private int
diff --git a/gs/src/gdevdljm.c b/gs/src/gdevdljm.c
index 9dae1be26..4c0d1e1cf 100644
--- a/gs/src/gdevdljm.c
+++ b/gs/src/gdevdljm.c
@@ -100,10 +100,6 @@ dljet_mono_print_page_copies(gx_device_printer * pdev, FILE * prn_stream,
/* Initialize printer. */
if (pdev->PageCount == 0) {
- if (features & HACK__IS_A_LJET4PJL) {
- fputs("\033%-12345X@PJL\r\n@PJL ENTER LANGUAGE = PCL\r\n",
- prn_stream);
- }
fputs("\033E", prn_stream); /* reset printer */
/* If the printer supports it, set the paper size */
/* based on the actual requested size. */
diff --git a/gs/src/gdevdljm.h b/gs/src/gdevdljm.h
index 0559559ce..e77e313b1 100644
--- a/gs/src/gdevdljm.h
+++ b/gs/src/gdevdljm.h
@@ -48,7 +48,6 @@
#define PCL_HAS_DUPLEX 64 /* <esc>&l<duplex>S supported */
#define PCL_CAN_SET_PAPER_SIZE 128 /* <esc>&l<sizecode>A supported */
#define PCL_CAN_PRINT_COPIES 256 /* <esc>&l<copies>X supported */
-#define HACK__IS_A_LJET4PJL 512
/* Shorthands for the most common spacing/compression combinations. */
#define PCL_MODE0 PCL3_SPACING
@@ -103,12 +102,6 @@
(PCL_MODE3 |\
PCL_CAN_SET_PAPER_SIZE | PCL_CAN_PRINT_COPIES)
- /* H-P LaserJet 4 PL */
-#define PCL_LJ4PJL_FEATURES\
- (PCL_MODE3 |\
- PCL_CAN_SET_PAPER_SIZE | PCL_CAN_PRINT_COPIES | HACK__IS_A_LJET4PJL)
-
-
/* H-P LaserJet 4d */
#define PCL_LJ4D_FEATURES\
(PCL_MODE3 |\
diff --git a/gs/src/gdevl256.c b/gs/src/gdevl256.c
index a08e0b104..9b527dca0 100644
--- a/gs/src/gdevl256.c
+++ b/gs/src/gdevl256.c
@@ -301,12 +301,3 @@ lvga256_draw_line(gx_device * dev, int x0, int y0, int x1, int y1,
gl_line(x0, y0, x1, y1, color);
return 0;
}
-
-#ifdef GS_DEVS_SHARED
-extern void gs_lib_register_device(const gx_device *dev);
-void
-gs_shared_init(void)
-{
- gs_lib_register_device(&gs_lvga256_device);
-}
-#endif
diff --git a/gs/src/gdevlbp8.c b/gs/src/gdevlbp8.c
index 87aeb0f60..534b40a8e 100644
--- a/gs/src/gdevlbp8.c
+++ b/gs/src/gdevlbp8.c
@@ -43,9 +43,7 @@ problems
/* The device descriptors */
private dev_proc_print_page(lbp8_print_page);
-#ifdef NOCONTRIB
private dev_proc_print_page(lips3_print_page);
-#endif
const gx_device_printer far_data gs_lbp8_device =
prn_device(prn_std_procs, "lbp8",
@@ -54,7 +52,6 @@ const gx_device_printer far_data gs_lbp8_device =
0.16, 0.2, 0.32, 0.21, /* margins: left, bottom, right, top */
1, lbp8_print_page);
-#ifdef NOCONTRIB
const gx_device_printer far_data gs_lips3_device =
prn_device(prn_std_procs, "lips3",
82, /* width_10ths, 8.3" */
@@ -62,7 +59,6 @@ const gx_device_printer far_data gs_lips3_device =
X_DPI, Y_DPI,
0.16, 0.27, 0.23, 0.27, /* margins */
1, lips3_print_page);
-#endif
/* ------ Internal routines ------ */
@@ -82,7 +78,6 @@ static const char lbp8_init[] = {
static const char *lbp8_end = NULL;
-#ifdef NOCONTRIB
static const char lips3_init[] = {
ESC, '<', /* soft reset */
DCS, '0', 'J', ST, /* JOB END */
@@ -99,7 +94,6 @@ static const char lips3_init[] = {
static const char lips3_end[] = {
DCS, '0', 'J', ST /* JOB END */
};
-#endif
/* Send the page to the printer. */
private int
@@ -205,11 +199,9 @@ lbp8_print_page(gx_device_printer *pdev, FILE *prn_stream)
lbp8_end, sizeof(lbp8_end));
}
-#ifdef NOCONTRIB
/* Print a LIPS III page. */
private int
lips3_print_page(gx_device_printer *pdev, FILE *prn_stream)
{ return can_print_page(pdev, prn_stream, lips3_init, sizeof(lips3_init),
lips3_end, sizeof(lips3_end));
}
-#endif
diff --git a/gs/src/gdevlj56.c b/gs/src/gdevlj56.c
index d127f75b1..7ab9dcc5b 100644
--- a/gs/src/gdevlj56.c
+++ b/gs/src/gdevlj56.c
@@ -142,7 +142,7 @@ ljet5_print_page(gx_device_printer * pdev, FILE * prn_stream)
};
px_write_page_header(s, (gx_device *)pdev);
- px_write_select_media(s, (gx_device *)pdev, NULL, NULL, 0, false, false);
+ px_write_select_media(s, (gx_device *)pdev, NULL, NULL);
PX_PUT_LIT(s, page_header);
if (pdev->color_info.depth == 1)
PX_PUT_LIT(s, mono_header);
diff --git a/gs/src/gdevpx.c b/gs/src/gdevpx.c
index f9491cba5..73aaca8b0 100644
--- a/gs/src/gdevpx.c
+++ b/gs/src/gdevpx.c
@@ -54,11 +54,8 @@ typedef struct gx_device_pclxl_s {
pxeMediaSize_t media_size;
bool ManualFeed; /* map ps setpage commands to pxl */
bool ManualFeed_set;
- int MediaPosition; /* MediaPosition attribute */
- int MediaPosition_set;
- int page; /* Page number starting at 0 */
- bool Duplex; /* Duplex attribute */
- bool Tumble; /* Tumble attribute */
+ int MediaPosition;
+ int MediaPosition_set;
gx_path_type_t fill_rule; /* ...winding_number or ...even_odd */
gx_path_type_t clip_rule; /* ditto */
pxeColorSpace_t color_space;
@@ -783,12 +780,6 @@ pclxl_beginpage(gx_device_vector * vdev)
stream *s = vdev->strm;
byte media_source = eAutoSelect; /* default */
- xdev->page ++;
-
- errprintf("PAGE: %d %d\n", xdev->page, xdev->NumCopies);
- errprintf("INFO: Printing page %d...\n", xdev->page);
- errflush();
-
px_write_page_header(s, (const gx_device *)vdev);
if (xdev->ManualFeed_set && xdev->ManualFeed)
@@ -796,9 +787,7 @@ pclxl_beginpage(gx_device_vector * vdev)
else if (xdev->MediaPosition_set && xdev->MediaPosition >= 0 )
media_source = xdev->MediaPosition;
- px_write_select_media(s, (const gx_device *)vdev, &xdev->media_size,
- &media_source,
- xdev->page, xdev->Duplex, xdev->Tumble);
+ px_write_select_media(s, (const gx_device *)vdev, &xdev->media_size, &media_source );
spputc(s, pxtBeginPage);
return 0;
@@ -1137,12 +1126,6 @@ pclxl_open_device(gx_device * dev)
VECTOR_OPEN_FILE_SEQUENTIAL);
if (code < 0)
return code;
-
- xdev->page = 0;
- xdev->Duplex = false;
- xdev->MediaPosition = 0;
- xdev->Tumble = false;
-
pclxl_page_init(xdev);
px_write_file_header(vdev->strm, dev);
xdev->media_size = pxeMediaSize_next; /* no size selected */
@@ -1627,100 +1610,60 @@ pclxl_image_end_image(gx_image_enum_common_t * info, bool draw_last)
return code;
}
-/*
- * 'pclxl_get_params()' - Get pagedevice parameters.
- */
-
-private int /* O - Error status */
-pclxl_get_params(gx_device *dev, /* I - Device info */
- gs_param_list *plist) /* I - Parameter list */
+/* Get parameters. */
+int
+pclxl_get_params(gx_device *dev, gs_param_list *plist)
{
- gx_device_pclxl *xdev; /* PCL XL device */
- int code; /* Return code */
-
-
- /*
- * First process the "standard" page device parameters...
- */
+ gx_device_pclxl *pdev = (gx_device_pclxl *) dev;
+ int code = gdev_vector_get_params(dev, plist);
- if ((code = gdev_vector_get_params(dev, plist)) < 0)
- return (code);
-
- /*
- * Then write the PCL-XL parameters...
- */
-
- xdev = (gx_device_pclxl *)dev;
-
- if ((code = param_write_bool(plist, "Duplex", &(xdev->Duplex))) < 0)
- return (code);
-
- if ((code = param_write_int(plist, "MediaPosition",
- &(xdev->MediaPosition))) < 0)
- return (code);
-
- if ((code = param_write_bool(plist, "Tumble", &(xdev->Tumble))) < 0)
- return (code);
+ if (code < 0)
+ return code;
- return (0);
+ if (code >= 0)
+ code = param_write_bool(plist, "ManualFeed", &pdev->ManualFeed);
+ return code;
}
+/* Put parameters. */
+int
+pclxl_put_params(gx_device * dev, gs_param_list * plist)
+{
+ gx_device_pclxl *pdev = (gx_device_pclxl *) dev;
+ int code = 0;
+ bool ManualFeed;
+ bool ManualFeed_set = false;
+ int MediaPosition;
+ bool MediaPosition_set = false;
+
+ code = param_read_bool(plist, "ManualFeed", &ManualFeed);
+ if (code == 0)
+ ManualFeed_set = true;
+ if (code >= 0) {
+ code = param_read_int(plist, "%MediaSource", &MediaPosition);
+ if (code == 0)
+ MediaPosition_set = true;
+ else if (code < 0) {
+ if (param_read_null(plist, "%MediaSource") == 0) {
+ code = 0;
+ }
+ }
+ }
-/*
- * 'pclxl_put_params()' - Set pagedevice parameters.
- */
+ /* note this handles not opening/closing the device */
+ code = gdev_vector_put_params(dev, plist);
+ if (code < 0)
+ return code;
-private int /* O - Error status */
-pclxl_put_params(gx_device *dev, /* I - Device info */
- gs_param_list *plist) /* I - Parameter list */
-{
- gx_device_pclxl *xdev; /* PCL XL device */
- int code; /* Error code */
- int intval; /* Integer value */
- bool boolval; /* Boolean value */
-
-
- /*
- * Process PCL-XL driver parameters...
- */
-
- xdev = (gx_device_pclxl *)dev;
-
-#define intoption(name, sname, type) \
- if ((code = param_read_int(plist, sname, &intval)) < 0) \
- { \
- param_signal_error(plist, sname, code); \
- return (code); \
- } \
- else if (code == 0) \
- { \
- xdev->name = (type)intval; \
- }
-
-#define booloption(name, sname) \
- if ((code = param_read_bool(plist, sname, &boolval)) < 0) \
- { \
- if ((code = param_read_null(plist, sname)) < 0) \
- { \
- param_signal_error(plist, sname, code); \
- return (code); \
- } \
- if (code == 0) \
- xdev->name = false; \
- } \
- else if (code == 0) \
- xdev->name = (bool)boolval;
-
- booloption(Duplex, "Duplex")
- intoption(MediaPosition, "MediaPosition", int)
- booloption(Tumble, "Tumble")
-
- /*
- * Then process standard page device parameters...
- */
-
- if ((code = gdev_vector_put_params(dev, plist)) < 0)
- return (code);
-
- return (0);
+ if (code >= 0) {
+ if (ManualFeed_set) {
+ pdev->ManualFeed = ManualFeed;
+ pdev->ManualFeed_set = true;
+ }
+ if (MediaPosition_set) {
+ pdev->MediaPosition = MediaPosition;
+ pdev->MediaPosition_set = true;
+ }
+ }
+ return code;
}
diff --git a/gs/src/gdevpxut.c b/gs/src/gdevpxut.c
index 28c39c12a..63b032711 100644
--- a/gs/src/gdevpxut.c
+++ b/gs/src/gdevpxut.c
@@ -81,8 +81,7 @@ px_write_page_header(stream *s, const gx_device *dev)
/* Write the media selection command if needed, updating the media size. */
int
px_write_select_media(stream *s, const gx_device *dev,
- pxeMediaSize_t *pms, byte *media_source,
- int page, bool Duplex, bool Tumble)
+ pxeMediaSize_t *pms, byte *media_source)
{
#define MSD(ms, res, w, h)\
{ ms, (float)((w) * 1.0 / (res)), (float)((h) * 1.0 / res) },
@@ -116,22 +115,6 @@ px_write_select_media(stream *s, const gx_device *dev,
if (media_source != NULL)
tray = *media_source;
px_put_uba(s, tray, pxaMediaSource);
-
- if (Duplex)
- {
- if (Tumble)
- px_put_uba(s, (byte)eDuplexHorizontalBinding, pxaDuplexPageMode);
- else
- px_put_uba(s, (byte)eDuplexVerticalBinding, pxaDuplexPageMode);
-
- if (page & 1)
- px_put_uba(s, (byte)eFrontMediaSide, pxaDuplexPageSide);
- else
- px_put_uba(s, (byte)eBackMediaSide, pxaDuplexPageSide);
- }
- else
- px_put_uba(s, (byte)eSimplexFrontSide, pxaSimplexPageMode);
-
if (pms)
*pms = size;
diff --git a/gs/src/gdevpxut.h b/gs/src/gdevpxut.h
index c0529d0e6..78a078989 100644
--- a/gs/src/gdevpxut.h
+++ b/gs/src/gdevpxut.h
@@ -29,8 +29,7 @@ int px_write_page_header(stream *s, const gx_device *dev);
/* Write the media selection command if needed, updating the media size. */
int px_write_select_media(stream *s, const gx_device *dev,
pxeMediaSize_t *pms,
- byte *media_source,
- int page, bool Duplex, bool Tumble);
+ byte *media_source);
/*
* Write the file trailer. Note that this takes a FILE *, not a stream *,
diff --git a/gs/src/gdevvglb.c b/gs/src/gdevvglb.c
index 2e50d9946..40dabb90b 100644
--- a/gs/src/gdevvglb.c
+++ b/gs/src/gdevvglb.c
@@ -368,12 +368,3 @@ vgalib_put_params(gx_device * dev, gs_param_list * plist)
}
return 0;
}
-
-#ifdef GS_DEVS_SHARED
-extern void gs_lib_register_device(const gx_device *dev);
-void
-gs_shared_init(void)
-{
- gs_lib_register_device(&gs_vgalib_device);
-}
-#endif
diff --git a/gs/src/gdevxalt.c b/gs/src/gdevxalt.c
index 9149f809f..880c9aeb5 100644
--- a/gs/src/gdevxalt.c
+++ b/gs/src/gdevxalt.c
@@ -25,7 +25,6 @@
#include "gdevx.h"
extern const gx_device_X gs_x11_device;
-extern const gx_device_X gs_x11alpha_device;
/*
* Define a forwarding device with a cache for the first 16 colors,
@@ -843,20 +842,3 @@ x_rg32x_alt_map_color(gx_device * dev, gx_color_index color,
rgb[2] = ((color >> 11) & 0x3ff) * gx_max_color_value / 0x3ff;
return -1;
}
-
-#ifdef GS_DEVS_SHARED
-extern void gs_lib_register_device(const gx_device *dev);
-void
-gs_shared_init(void)
-{
- gs_lib_register_device(&gs_x11_device);
- gs_lib_register_device(&gs_x11alpha_device);
- gs_lib_register_device(&gs_x11cmyk_device);
- gs_lib_register_device(&gs_x11cmyk2_device);
- gs_lib_register_device(&gs_x11cmyk4_device);
- gs_lib_register_device(&gs_x11cmyk8_device);
- gs_lib_register_device(&gs_x11gray2_device);
- gs_lib_register_device(&gs_x11gray4_device);
- gs_lib_register_device(&gs_x11mono_device);
-}
-#endif
diff --git a/gs/src/gp_unix.c b/gs/src/gp_unix.c
index 8a52a6863..c1898470d 100644
--- a/gs/src/gp_unix.c
+++ b/gs/src/gp_unix.c
@@ -36,56 +36,11 @@ extern void exit(int);
extern char *getenv(const char *);
#endif
-#ifdef GS_DEVS_SHARED
-#ifndef GS_DEVS_SHARED_DIR
-# define GS_DEVS_SHARED_DIR "/usr/lib/ghostscript/8.16"
-#endif
-/*
- * use shared library for drivers, always load them when starting, this
- * avoid too many modifications, and since it is supported only under linux
- * and applied as a patch (preferable).
- */
-#include <sys/types.h>
-#include <dirent.h>
-#include <dlfcn.h>
-#include <string.h>
-
-void
-gp_init(void)
-{
- DIR* dir = NULL;
- struct dirent* dirent;
- char buff[1024];
- char* pbuff;
- void* handle;
- void (*gs_shared_init)(void);
-
- strncpy(buff, GS_DEVS_SHARED_DIR, sizeof(buff) - 2);
- pbuff = buff + strlen(buff);
- *pbuff++ = '/'; *pbuff = '\0';
-
- dir = opendir(GS_DEVS_SHARED_DIR);
- if (dir == 0) return;
-
- while ((dirent = readdir(dir)) != 0) {
- strncpy(pbuff, dirent->d_name, sizeof(buff) - (pbuff - buff) - 1);
- if ((handle = dlopen(buff, RTLD_NOW)) != 0) {
- if ((gs_shared_init = dlsym(handle, "gs_shared_init")) != 0) {
- (*gs_shared_init)();
- } else {
- }
- }
- }
-
- closedir(dir);
-}
-#else
/* Do platform-dependent initialization. */
void
gp_init(void)
{
}
-#endif
/* Do platform-dependent cleanup. */
void
diff --git a/gs/src/gs.mak b/gs/src/gs.mak
index ed344a637..b5ce6b23a 100644
--- a/gs/src/gs.mak
+++ b/gs/src/gs.mak
@@ -258,8 +258,7 @@ gconfig_h=$(GLGENDIR)$(D)gconfxx.h
gconfigf_h=$(GLGENDIR)$(D)gconfxc.h
gconfigd_h=$(GLGENDIR)$(D)gconfigd.h
-all default : $(GS_XE) $(GS_SHARED_OBJS)
- $(RM) _temp_*
+all default : $(GS_XE)
$(NO_OP)
# the distclean and maintainer-clean targets (if any)
@@ -272,7 +271,6 @@ realclean : clean
clean : mostlyclean
$(RM_) $(GSGEN)arch.h
$(RM_) $(GS_XE)
- $(RM_) $(GS_SHARED_OBJS)
#****** FOLLOWING IS WRONG, NEEDS TO BE PER-SUBSYSTEM ******
mostlyclean : config-clean
diff --git a/gs/src/lib.mak b/gs/src/lib.mak
index b3466ac7e..df5643073 100644
--- a/gs/src/lib.mak
+++ b/gs/src/lib.mak
@@ -33,9 +33,9 @@ GLJBIG2CC=$(CC_) $(I_)$(GLI_) $(II)$(JB2I_)$(_I) $(JB2CF_) $(GLF_)
GLJASCC=$(CC_) $(I_)$(JPXI_) $(II)$(GLI_)$(_I) $(JPXCF_) $(GLF_)
GLLDFJB2CC=$(CC_) $(I_)$(LDF_JB2I_) $(II)$(GLI_)$(_I) $(JB2CF_) $(GLF_)
GLLWFJPXCC=$(CC_) $(I_)$(LWF_JPXI_) $(II)$(GLI_)$(_I) $(JPXCF_) $(GLF_)
-GLCCSHARED=$(CC_SHARED) $(I_)$(GLI_)$(_I) $(GLF_)
# All top-level makefiles define GLD.
#GLD=$(GLGEN)
+
# Define the name of this makefile.
LIB_MAK=$(GLSRC)lib.mak
diff --git a/gs/src/unix-aux.mak b/gs/src/unix-aux.mak
index 6915f2494..16924b5d6 100644
--- a/gs/src/unix-aux.mak
+++ b/gs/src/unix-aux.mak
@@ -83,7 +83,7 @@ MKROMFS_OBJS=$(MKROMFS_ZLIB_OBJS) $(GLOBJ)gscdefs.$(OBJ) $(GLOBJ)gsmisc.$(OBJ) \
$(GLOBJ)gp_stdia.$(OBJ) $(GLOBJ)gsutil.$(OBJ)
$(MKROMFS_XE): $(GLSRC)mkromfs.c $(MKROMFS_COMMON_DEPS) $(MKROMFS_OBJS)
- $(CCAUX) $(GENOPT) $(CFLAGS_DEBUG) $(I_)$(GLSRCDIR)$(_I) $(I_)$(GLOBJ)$(_I) $(I_)$(ZSRCDIR)$(_I) $(GLSRC)mkromfs.c $(O_)$(MKROMFS_XE) $(MKROMFS_OBJS) -lm $(LDFLAGS) $(EXTRALIBS)
+ $(CCAUX) $(GENOPT) $(CFLAGS_DEBUG) $(I_)$(GLSRCDIR)$(_I) $(I_)$(GLOBJ)$(_I) $(I_)$(ZSRCDIR)$(_I) $(GLSRC)mkromfs.c $(O_)$(MKROMFS_XE) $(MKROMFS_OBJS) -lm
# Query the environment to construct gconfig_.h.
# The "else true;" is required because Ultrix's implementation of sh -e
diff --git a/gs/src/unix-gcc.mak b/gs/src/unix-gcc.mak
index 687ca1176..92b72f096 100644
--- a/gs/src/unix-gcc.mak
+++ b/gs/src/unix-gcc.mak
@@ -235,7 +235,7 @@ CFLAGS_SO=-fPIC
# We don't include -ansi, because this gets in the way of the platform-
# specific stuff that <math.h> typically needs; nevertheless, we expect
# gcc to accept ANSI-style function prototypes and function definitions.
-XCFLAGS=-DGS_DEVS_SHARED -DGS_DEVS_SHARED_DIR=\"$(gssharedir)\"
+XCFLAGS=
CFLAGS=$(CFLAGS_STANDARD) $(GCFLAGS) $(XCFLAGS)
@@ -257,7 +257,7 @@ LDFLAGS=$(XLDFLAGS)
# Solaris may need -lnsl -lsocket -lposix4.
# (Libraries required by individual drivers are handled automatically.)
-EXTRALIBS=-rdynamic -ldl
+EXTRALIBS=
# Define the standard libraries to search at the end of linking.
# Most platforms require -lpthread for the POSIX threads library;
@@ -412,10 +412,6 @@ DEVICE_DEVS19=
DEVICE_DEVS20=$(DD)cljet5.dev $(DD)cljet5c.dev
DEVICE_DEVS21=$(DD)spotcmyk.dev $(DD)devicen.dev $(DD)xcf.dev $(DD)bmpsep1.dev $(DD)bmpsep8.dev $(DD)bmp16m.dev $(DD)bmp32b.dev $(DD)psdcmyk.dev $(DD)psdrgb.dev
-# Shared library target to build.
-GS_SHARED_OBJS=$(GLOBJDIR)/X11.so $(GLOBJDIR)/lvga256.so $(GLOBJDIR)/vgalib.so
-#GS_SHARED_OBJS=$(GLOBJDIR)/X11.so
-
# ---------------------------- End of options --------------------------- #
# Define the name of the partial makefile that specifies options --
@@ -438,7 +434,6 @@ CCAUX=$(CC) `cat $(AK)`
# These are the specific warnings we have to turn off to compile those
# specific few files that need this. We may turn off others in the future.
CC_NO_WARN=$(CC_) -Wno-cast-qual -Wno-traditional
-CC_SHARED=$(CC_) -fPIC -shared
# ---------------- End of platform-specific section ---------------- #
diff --git a/gs/src/unixinst.mak b/gs/src/unixinst.mak
index 59eafcb2c..4db4b4d45 100644
--- a/gs/src/unixinst.mak
+++ b/gs/src/unixinst.mak
@@ -15,7 +15,7 @@
# containing the `install' targets.
# This is the very last part of the makefile for these configurations.
-install: install-exec install-scripts install-data $(INSTALL_SHARED) $(INSTALL_CONTRIB)
+install: install-exec install-scripts install-data
# The sh -c in the rules below is required because Ultrix's implementation
# of sh -e terminates execution of a command if any error occurs, even if
@@ -169,9 +169,3 @@ golfer.eps grayalph.ps snowflak.ps tiger.eps vasarely.ps waterfal.ps \
ridt91.eps ;\
do $(INSTALL_DATA) $(PSEXDIR)/$$f $(DESTDIR)$(exdir) ;\
done
-
-install-shared: $(GS_SHARED_OBJS)
- -mkdir -p $(gssharedir)
- $(SH) -c 'for obj in $(GS_SHARED_OBJS); do \
- $(INSTALL_PROGRAM) $$obj $(gssharedir)/; done'
-
diff --git a/gs/src/version.mak.in b/gs/src/version.mak
index d6a9f7aa4..fed67f458 100644
--- a/gs/src/version.mak.in
+++ b/gs/src/version.mak
@@ -15,11 +15,11 @@
# Major and minor version numbers.
# MINOR0 is different from MINOR only if MINOR is a single digit.
-GS_VERSION_MAJOR=@GS_VERSION_MAJOR@
-GS_VERSION_MINOR=@GS_VERSION_MINOR@
-GS_VERSION_MINOR0=@GS_VERSION_MINOR0@
+GS_VERSION_MAJOR=8
+GS_VERSION_MINOR=57
+GS_VERSION_MINOR0=57
# Revision date: year x 10000 + month x 100 + day.
-GS_REVISIONDATE=@GS_REVISIONDATE@
+GS_REVISIONDATE=20070315
# Derived values
GS_VERSION=$(GS_VERSION_MAJOR)$(GS_VERSION_MINOR0)
GS_DOT_VERSION=$(GS_VERSION_MAJOR).$(GS_VERSION_MINOR0)