From d79f1b4220f917dd9c35c2205da8c5562079964e Mon Sep 17 00:00:00 2001 From: CyberLeo Date: Thu, 12 Oct 2017 00:25:25 -0500 Subject: [PATCH] app-text/ghostscript-gpl: re-add Imagewriter driver --- app-text/ghostscript-gpl/Manifest | 5 + .../files/imagewriter-gs.patch | 552 ++++++++++++++++++ .../ghostscript-gpl-9.21-r1.ebuild | 207 +++++++ app-text/ghostscript-gpl/metadata.xml | 15 + 4 files changed, 779 insertions(+) create mode 100644 app-text/ghostscript-gpl/Manifest create mode 100644 app-text/ghostscript-gpl/files/imagewriter-gs.patch create mode 100644 app-text/ghostscript-gpl/ghostscript-gpl-9.21-r1.ebuild create mode 100644 app-text/ghostscript-gpl/metadata.xml diff --git a/app-text/ghostscript-gpl/Manifest b/app-text/ghostscript-gpl/Manifest new file mode 100644 index 0000000..7410d3f --- /dev/null +++ b/app-text/ghostscript-gpl/Manifest @@ -0,0 +1,5 @@ +AUX imagewriter-gs.patch 27324 SHA256 226d3a3580bfd3f33aea6271b0594234caa274d96b90008a3afb180213742056 SHA512 208533b573ccfe5c1da679f326492c9111e1cfc65fa8d35e36793d78723da705eb38e666da5c4525521d5d7be0728f871085844e09f39de41e0d79d2e7cefeb2 WHIRLPOOL c8158e2b1551ea2ce6ffb40b2ccd8064b8da1e75ccdf5d0a198702cc2039f20d2177e370c6b5beb5515ca8d300a16587f036c88142c2da7d360f89f81b49a452 +DIST ghostscript-9.21.tar.xz 29164532 SHA256 2be1d014888a34187ad4bbec19ab5692cc943bd1cb14886065aeb43a3393d053 SHA512 cfea089b92fb01e3f7c18a9ce05e7165fc8b356e2914bf53b7f2fd9de672279c8b97ced07e983e619f0d4334ce16018b100cfbf0cc872c215a8cf2aff4c78731 WHIRLPOOL 3836454ff852633940420a4812667b13c7e9b6602c3fcac7383298bf06cf2157a4580ad4c06cb9797af21418b162f52ff5bc03dd3651079078677eba252c8b40 +DIST ghostscript-gpl-9.21-patchset-1.tar.xz 6196 SHA256 53abca720b67cd6b6117b2d4e2946916957fac68ce5caffe7c151504f9db777c SHA512 58fef7080ca17a238231fb528be48f52bcfa771b1e496d7fede6df45fb927f1bb1c755cb77e02aa739295b0ccf0b3d3959f9a05a1628d32ffd11e134c0e0d355 WHIRLPOOL 2541f34acaa5fc923cd82b8873c82acc512bca2b6b28cf347e511acd5a259b4676687cc3c2454b8631a4c7559801c3691e6397c8bf3e04c7575c9566574f35c9 +EBUILD ghostscript-gpl-9.21-r1.ebuild 5605 SHA256 bbede23b6102d50d824cb96112e7ea4db42b6e2567e035bb6e0b4b7ee9d5cad4 SHA512 be693afb15c31e32eccb1ecac4a776d2da93dfc630bc8394c6ae86bbd9927c4602668af465f3e4e8fcd608c47a1c4f6c5023c2702c89a9c5ec0d84ae0c28e6d0 WHIRLPOOL 1f9d991f2fe75b7d9ba3ab14a42f763f054a1adf9afae577e22cc5ca213f0ef62bf8c5a89ec885b72904e6e6a923816cac36a3317854e4aa87a39c96c003cf66 +MISC metadata.xml 516 SHA256 c1080e7742c7915645c90e70143a45fdf66d90eae50f8c74009d5d20530dedf4 SHA512 2f20a51f4716d8581748520da0c353f3b9846182ab77ac459abe178f6fd68942c9fc15614ac5a01ae183ff94f3db318037038f48fae54620d6aa7a25de9834d6 WHIRLPOOL 93ef13281887a1d0dd886eb93e892bfcb8b8987e457caf2f668f3dd2e731ff8d4f25696cfc51d5b8a36bd25fce1c0bddba760f827befa75a4cd8824fdb9388f1 diff --git a/app-text/ghostscript-gpl/files/imagewriter-gs.patch b/app-text/ghostscript-gpl/files/imagewriter-gs.patch new file mode 100644 index 0000000..5bedbfc --- /dev/null +++ b/app-text/ghostscript-gpl/files/imagewriter-gs.patch @@ -0,0 +1,552 @@ +From b0dd49f3edad7ebb29076ff824c848b56c72d393 Mon Sep 17 00:00:00 2001 +From: CyberLeo +Date: Wed, 11 Oct 2017 23:46:01 -0500 +Subject: [PATCH] Re-add Imagewriter driver + +--- + base/unix-gcc.mak | 2 +- + configure.ac | 7 +- + devices/contrib.mak | 30 +++ + devices/gdevadmp.c | 401 +++++++++++++++++++++++++++++++++++++++++ + windows/ghostscript.vcproj | 4 + + windows/ghostscript_rt.vcxproj | 1 + + 6 files changed, 443 insertions(+), 2 deletions(-) + create mode 100644 devices/gdevadmp.c + +diff --git a/base/unix-gcc.mak b/base/unix-gcc.mak +index 393c77e71942cb785f492247db1bdb7bdf41e911..d1eacac2f06ea5c59fd0a12e9c64b56eaf90dd85 100644 +--- a/base/unix-gcc.mak ++++ b/base/unix-gcc.mak +@@ -566,7 +566,7 @@ DISPLAY_DEV=$(DD)bbox.dev + # DEVICE_DEVS=$(DISPLAY_DEV) $(DD)x11.dev $(DD)x11_.dev $(DD)x11alpha.dev $(DD)x11alt_.dev $(DD)x11cmyk.dev $(DD)x11cmyk2.dev $(DD)x11cmyk4.dev $(DD)x11cmyk8.dev $(DD)x11gray2.dev $(DD)x11gray4.dev $(DD)x11mono.dev $(DD)x11rg16x.dev $(DD)x11rg32x.dev + DEVICE_DEVS=$(DISPLAY_DEV) + DEVICE_DEVS1=$(DD)bit.dev $(DD)bitcmyk.dev $(DD)bitrgb.dev $(DD)bitrgbtags.dev $(DD)bmp16.dev $(DD)bmp16m.dev $(DD)bmp256.dev $(DD)bmp32b.dev $(DD)bmpgray.dev $(DD)bmpmono.dev $(DD)bmpsep1.dev $(DD)bmpsep8.dev $(DD)ccr.dev $(DD)cif.dev $(DD)devicen.dev $(DD)eps2write.dev $(DD)fpng.dev $(DD)inferno.dev $(DD)ink_cov.dev $(DD)inkcov.dev $(DD)jpeg.dev $(DD)jpegcmyk.dev $(DD)jpeggray.dev $(DD)mgr4.dev $(DD)mgr8.dev $(DD)mgrgray2.dev $(DD)mgrgray4.dev $(DD)mgrgray8.dev $(DD)mgrmono.dev $(DD)miff24.dev $(DD)pam.dev $(DD)pamcmyk32.dev $(DD)pamcmyk4.dev $(DD)pbm.dev $(DD)pbmraw.dev $(DD)pcx16.dev $(DD)pcx24b.dev $(DD)pcx256.dev $(DD)pcxcmyk.dev $(DD)pcxgray.dev $(DD)pcxmono.dev $(DD)pdfwrite.dev $(DD)pgm.dev $(DD)pgmraw.dev $(DD)pgnm.dev $(DD)pgnmraw.dev $(DD)pkm.dev $(DD)pkmraw.dev $(DD)pksm.dev $(DD)pksmraw.dev $(DD)plan.dev $(DD)plan9bm.dev $(DD)planc.dev $(DD)plang.dev $(DD)plank.dev $(DD)planm.dev $(DD)plib.dev $(DD)plibc.dev $(DD)plibg.dev $(DD)plibk.dev $(DD)plibm.dev $(DD)pnm.dev $(DD)pnmraw.dev $(DD)ppm.dev $(DD)ppmraw.dev $(DD)ps2write.dev $(DD)psdcmyk.dev $(DD)psdcmykog.dev $(DD)psdf.dev $(DD)psdrgb.dev $(DD)spotcmyk.dev $(DD)txtwrite.dev $(DD)xcf.dev +-DEVICE_DEVS2=$(DD)ap3250.dev $(DD)atx23.dev $(DD)atx24.dev $(DD)atx38.dev $(DD)bj10e.dev $(DD)bj200.dev $(DD)bjc600.dev $(DD)bjc800.dev $(DD)cdeskjet.dev $(DD)cdj500.dev $(DD)cdj550.dev $(DD)cdjcolor.dev $(DD)cdjmono.dev $(DD)cljet5.dev $(DD)cljet5c.dev $(DD)cljet5pr.dev $(DD)coslw2p.dev $(DD)coslwxl.dev $(DD)cp50.dev $(DD)declj250.dev $(DD)deskjet.dev $(DD)dj505j.dev $(DD)djet500.dev $(DD)djet500c.dev $(DD)dnj650c.dev $(DD)eps9high.dev $(DD)eps9mid.dev $(DD)epson.dev $(DD)epsonc.dev $(DD)escp.dev $(DD)fs600.dev $(DD)hl7x0.dev $(DD)ibmpro.dev $(DD)imagen.dev $(DD)itk24i.dev $(DD)itk38.dev $(DD)jetp3852.dev $(DD)laserjet.dev $(DD)lbp8.dev $(DD)lips3.dev $(DD)lj250.dev $(DD)lj3100sw.dev $(DD)lj4dith.dev $(DD)lj4dithp.dev $(DD)lj5gray.dev $(DD)lj5mono.dev $(DD)ljet2p.dev $(DD)ljet3.dev $(DD)ljet3d.dev $(DD)ljet4.dev $(DD)ljet4d.dev $(DD)ljet4pjl.dev $(DD)ljetplus.dev $(DD)lp2563.dev $(DD)lp8000.dev $(DD)lq850.dev $(DD)lxm5700m.dev $(DD)m8510.dev $(DD)necp6.dev $(DD)oce9050.dev $(DD)oki182.dev $(DD)okiibm.dev $(DD)paintjet.dev $(DD)photoex.dev $(DD)picty180.dev $(DD)pj.dev $(DD)pjetxl.dev $(DD)pjxl.dev $(DD)pjxl300.dev $(DD)pxlcolor.dev $(DD)pxlmono.dev $(DD)r4081.dev $(DD)rinkj.dev $(DD)sj48.dev $(DD)st800.dev $(DD)stcolor.dev $(DD)t4693d2.dev $(DD)t4693d4.dev $(DD)t4693d8.dev $(DD)tek4696.dev $(DD)uniprint.dev ++DEVICE_DEVS2=$(DD)ap3250.dev $(DD)appledmp.dev $(DD)atx23.dev $(DD)atx24.dev $(DD)atx38.dev $(DD)bj10e.dev $(DD)bj200.dev $(DD)bjc600.dev $(DD)bjc800.dev $(DD)cdeskjet.dev $(DD)cdj500.dev $(DD)cdj550.dev $(DD)cdjcolor.dev $(DD)cdjmono.dev $(DD)cljet5.dev $(DD)cljet5c.dev $(DD)cljet5pr.dev $(DD)coslw2p.dev $(DD)coslwxl.dev $(DD)cp50.dev $(DD)declj250.dev $(DD)deskjet.dev $(DD)dj505j.dev $(DD)djet500.dev $(DD)djet500c.dev $(DD)dnj650c.dev $(DD)eps9high.dev $(DD)eps9mid.dev $(DD)epson.dev $(DD)epsonc.dev $(DD)escp.dev $(DD)fs600.dev $(DD)hl7x0.dev $(DD)ibmpro.dev $(DD)imagen.dev $(DD)itk24i.dev $(DD)itk38.dev $(DD)iwhi.dev $(DD)iwlo.dev $(DD)iwlq.dev $(DD)jetp3852.dev $(DD)laserjet.dev $(DD)lbp8.dev $(DD)lips3.dev $(DD)lj250.dev $(DD)lj3100sw.dev $(DD)lj4dith.dev $(DD)lj4dithp.dev $(DD)lj5gray.dev $(DD)lj5mono.dev $(DD)ljet2p.dev $(DD)ljet3.dev $(DD)ljet3d.dev $(DD)ljet4.dev $(DD)ljet4d.dev $(DD)ljet4pjl.dev $(DD)ljetplus.dev $(DD)lp2563.dev $(DD)lp8000.dev $(DD)lq850.dev $(DD)lxm5700m.dev $(DD)m8510.dev $(DD)necp6.dev $(DD)oce9050.dev $(DD)oki182.dev $(DD)okiibm.dev $(DD)paintjet.dev $(DD)photoex.dev $(DD)picty180.dev $(DD)pj.dev $(DD)pjetxl.dev $(DD)pjxl.dev $(DD)pjxl300.dev $(DD)pxlcolor.dev $(DD)pxlmono.dev $(DD)r4081.dev $(DD)rinkj.dev $(DD)sj48.dev $(DD)st800.dev $(DD)stcolor.dev $(DD)t4693d2.dev $(DD)t4693d4.dev $(DD)t4693d8.dev $(DD)tek4696.dev $(DD)uniprint.dev + DEVICE_DEVS3= + DEVICE_DEVS4=$(DD)ijs.dev + DEVICE_DEVS5= +diff --git a/configure.ac b/configure.ac +index d0f62d73799d50a6318703e74a4cac4609edc516..f7711b699d4977f710db47c1167a295b11ef3fb8 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2019,6 +2019,7 @@ EPSON_DEVS='eps9high eps9mid epson epsonc escp lp8000 lq850 photoex st800 stcolo + CANON_DEVS='bj10e bj200 bjc600 bjc800 lbp8 lips3 bjcmono bjcgray bjccmyk bjccolor' + LEXMARK_DEVS='lxm5700m 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' +@@ -2058,7 +2059,7 @@ while test -n "$drivers"; do + fi + ;; + PRINTERS) +- P_DEVS0="$P_DEVS0 $CANON_DEVS $EPSON_DEVS $HP_DEVS $LEXMARK_DEVS $BROTHER_DEVS $IBM_DEVS $OKI_DEVS $JAPAN_DEVS $MISC_PDEVS $ETS_HALFTONING_DEVS" ++ P_DEVS0="$P_DEVS0 $CANON_DEVS $EPSON_DEVS $HP_DEVS $LEXMARK_DEVS $BROTHER_DEVS $APPLE_DEVS $IBM_DEVS $OKI_DEVS $JAPAN_DEVS $MISC_PDEVS $ETS_HALFTONING_DEVS" + IJS_DEVS0="$IJSDEVS" + if test x$ac_cv_lib_dl_dlopen != xno -a x$found_iconv != xno; then + P_DEVS0="$P_DEVS0 $OPVP_DEVS" +@@ -2072,6 +2073,10 @@ while test -n "$drivers"; do + JBIG2_DEVS="$JBIG2FILEDEVS" + PNG_DEVS0="$PNGDEVS" + ;; ++ APPLE) ++ # All Apple printers ++ P_DEVS0="$P_DEVS0 $APPLE_DEVS" ++ ;; + BMP) + # BMP file format + F_DEVS0="$F_DEVS0 $BMP_DEVS" +diff --git a/devices/contrib.mak b/devices/contrib.mak +index 588b5885be97f82eaa2063c0852b30a30653a9e0..d8d2b9d483ea9e371201836662626c66510a5697 100644 +--- a/devices/contrib.mak ++++ b/devices/contrib.mak +@@ -32,6 +32,7 @@ CONTRIB_MAK=$(DEVSRC)contrib.mak $(TOP_MAKEFILES) + # sonyfb Sony Microsystems monochrome display [Sony only] + # Printers: + # ap3250 Epson AP3250 printer ++# appledmp Apple Dot Matrix Printer (should also work with Imagewriter) + # bj10e Canon BubbleJet BJ10e + # bj200 Canon BubbleJet BJ200; also good for BJ300 in ProPrinter mode + # (see comments in source code) +@@ -66,6 +67,9 @@ CONTRIB_MAK=$(DEVSRC)contrib.mak $(TOP_MAKEFILES) + # also usable with the MFC6550MC Fax Machine. + # ibmpro IBM 9-pin Proprinter + # imagen Imagen ImPress printers ++# iwhi Apple Imagewriter in high-resolution mode ++# iwlo Apple Imagewriter in low-resolution mode ++# iwlq Apple Imagewriter LQ in 320 x 216 dpi mode + # jetp3852 IBM Jetprinter ink-jet color printer (Model #3852) + # lbp8 Canon LBP-8II laser printer + # lips3 Canon LIPS III laser printer in English (CaPSL) mode +@@ -146,6 +150,32 @@ $(DEVOBJ)gdevsnfb.$(OBJ) : $(DEVSRC)gdevsnfb.c $(PDEVH) $(CONTRIB_MAK) $(MAKEDIR + + ###### --------------- Memory-buffered printer devices --------------- ###### + ++### --------------------- The Apple printer devices --------------------- ### ++### Note: these drivers were contributed by users. ### ++### If you have questions about the DMP driver, please contact ### ++### Mark Wedel (master@cats.ucsc.edu). ### ++### If you have questions about the Imagewriter drivers, please contact ### ++### Jonathan Luckey (luckey@rtfm.mlb.fl.us). ### ++### If you have questions about the Imagewriter LQ driver, please ### ++### contact Scott Barker (barkers@cuug.ab.ca). ### ++ ++appledmp_=$(DEVOBJ)gdevadmp.$(OBJ) ++ ++$(DEVOBJ)gdevadmp.$(OBJ) : $(DEVSRC)gdevadmp.c $(PDEVH) $(CONTRIB_MAK) $(MAKEDIRS) ++ $(DEVCC) $(DEVO_)gdevadmp.$(OBJ) $(C_) $(DEVSRC)gdevadmp.c ++ ++$(DD)appledmp.dev : $(appledmp_) $(DD)page.dev $(CONTRIB_MAK) $(MAKEDIRS) ++ $(SETPDEV) $(DD)appledmp $(appledmp_) ++ ++$(DD)iwhi.dev : $(appledmp_) $(DD)page.dev $(CONTRIB_MAK) $(MAKEDIRS) ++ $(SETPDEV) $(DD)iwhi $(appledmp_) ++ ++$(DD)iwlo.dev : $(appledmp_) $(DD)page.dev $(CONTRIB_MAK) $(MAKEDIRS) ++ $(SETPDEV) $(DD)iwlo $(appledmp_) ++ ++$(DD)iwlq.dev : $(appledmp_) $(DD)page.dev $(CONTRIB_MAK) $(MAKEDIRS) ++ $(SETPDEV) $(DD)iwlq $(appledmp_) ++ + ### ------------ The Canon BubbleJet BJ10e and BJ200 devices ------------ ### + + bj10e_=$(DEVOBJ)gdevbj10.$(OBJ) +diff --git a/devices/gdevadmp.c b/devices/gdevadmp.c +new file mode 100644 +index 0000000000000000000000000000000000000000..bf816c55eb493bca15671a8bc5007d2f59726a0d +--- /dev/null ++++ b/devices/gdevadmp.c +@@ -0,0 +1,401 @@ ++/* Copyright (C) 2001-2012 Artifex Software, Inc. ++ All Rights Reserved. ++ ++ This software is provided AS-IS with no warranty, either express or ++ implied. ++ ++ This software is distributed under license and may not be copied, ++ modified or distributed except as expressly authorized under the terms ++ of the license contained in the file LICENSE in this distribution. ++ ++ Refer to licensing information at http://www.artifex.com or contact ++ Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134, San Rafael, ++ CA 94903, U.S.A., +1(415)492-9861, for further information. ++*/ ++ ++/* ++ * Apple DMP / Imagewriter driver ++ * ++ * This is a modification of Mark Wedel's Apple DMP and ++ * Jonathan Luckey's Imagewriter II driver to ++ * support the Imagewriter LQ's higher resolution (320x216): ++ * appledmp: 120dpi x 72dpi is still supported (yuck) ++ * iwlo: 160dpi x 72dpi ++ * iwhi: 160dpi x 144dpi ++ * iwlq: 320dpi x 216dpi ++ * ++ * This is also my first attempt to work with gs. I have not included the LQ's ++ * ability to print in colour. Perhaps at a later date I will tackle that. ++ * ++ * BTW, to get your Imagewriter LQ serial printer to work with a PC, attach it ++ * with a nullmodem serial cable. ++ * ++ * Scott Barker (barkers@cuug.ab.ca) ++ */ ++ ++/* ++ * This is a modification of Mark Wedel's Apple DMP driver to ++ * support 2 higher resolutions: ++ * appledmp: 120dpi x 72dpi is still supported (yuck) ++ * iwlo: 160dpi x 72dpi ++ * iwhi: 160dpi x 144dpi ++ * ++ * The Imagewriter II is a bit odd. In pinfeed mode, it thinks its ++ * First line is 1 inch from the top of the page. If you set the top ++ * form so that it starts printing at the top of the page, and print ++ * to near the bottom, it thinks it has run onto the next page and ++ * the formfeed will skip a whole page. As a work around, I reverse ++ * the paper about a 1.5 inches at the end of the page before the ++ * formfeed to make it think its on the 'right' page. bah. hack! ++ * ++ * This is my first attempt to work with gs, so your milage may vary ++ * ++ * Jonathan Luckey (luckey@rtfm.mlb.fl.us) ++ */ ++ ++/* This is a bare bones driver I developed for my apple Dot Matrix Printer. ++ * This code originally was from the epson driver, but I removed a lot ++ * of stuff that was not needed. ++ * ++ * The Dot Matrix Printer was a predecessor to the apple Imagewriter. Its ++ * main difference being that it was parallel. ++ * ++ * This code should work fine on Imagewriters, as they have a superset ++ * of commands compared to the DMP printer. ++ * ++ * This driver does not produce the smalles output files possible. To ++ * do that, it should look through the output strings and find repeat ++ * occurances of characters, and use the escape sequence that allows ++ * printing repeat sequences. However, as I see it, this the limiting ++ * factor in printing is not transmission speed to the printer itself, ++ * but rather, how fast the print head can move. This is assuming the ++ * printer is set up with a reasonable speed (9600 bps) ++ * ++ * WHAT THE CODE DOES AND DOES NOT DO: ++ * ++ * To print out images, it sets the printer for unidirection printing ++ * and 15 cpi (120 dpi). IT sets line feed to 1/9 of an inch (72 dpi). ++ * When finished, it sets things back to bidirection print, 1/8" line ++ * feeds, and 12 cpi. There does not appear to be a way to reset ++ * things to initial values. ++ * ++ * This code does not set for 8 bit characters (which is required). It ++ * also assumes that carriage return/newline is needed, and not just ++ * carriage return. These are all switch settings on the DMP, and ++ * I have configured them for 8 bit data and cr only. ++ * ++ * You can search for the strings Init and Reset to find the strings ++ * that set up the printer and clear things when finished, and change ++ * them to meet your needs. ++ * ++ * Also, you need to make sure that the printer daemon (assuming unix) ++ * doesn't change the data as it is being printed. I have set my ++ * printcap file (sunos 4.1.1) with the string: ++ * ms=pass8,-opost ++ * and it works fine. ++ * ++ * Feel free to improve this code if you want. However, please make ++ * sure that the old DMP will still be supported by any changes. This ++ * may mean making an imagewriter device, and just copying this file ++ * to something like gdevimage.c. ++ * ++ * The limiting factor of the DMP is the vertical resolution. However, I ++ * see no way to do anything about this. Horizontal resolution could ++ * be increased by using 17 cpi (136 dpi). I believe the Imagewriter ++ * supports 24 cpi (192 dpi). However, the higher dpi, the slower ++ * the printing. ++ * ++ * Dot Matrix Code by Mark Wedel (master@cats.ucsc.edu) ++ */ ++ ++#include "gdevprn.h" ++ ++/* The device descriptors */ ++static dev_proc_print_page(dmp_print_page); ++ ++/* Standard DMP device */ ++const gx_device_printer far_data gs_appledmp_device = ++prn_device(prn_bg_procs, "appledmp", /* The print_page proc is compatible with allowing bg printing */ ++ 85, /* width_10ths, 8.5" */ ++ 110, /* height_10ths, 11" */ ++ 120, 72, /* X_DPI, Y_DPI */ ++ 0, 0.5, 0.5, 0, /* margins */ ++ 1, dmp_print_page); ++ ++/* lowrez Imagewriter device */ ++const gx_device_printer far_data gs_iwlo_device = ++prn_device(prn_bg_procs, "iwlo", /* The print_page proc is compatible with allowing bg printing */ ++ 85, /* width_10ths, 8.5" */ ++ 110, /* height_10ths, 11" */ ++ 160, 72, /* X_DPI, Y_DPI */ ++ 0, 0.5, 0.5, 0, /* margins */ ++ 1, dmp_print_page); ++ ++/* hirez Imagewriter device */ ++const gx_device_printer far_data gs_iwhi_device = ++prn_device(prn_bg_procs, "iwhi", /* The print_page proc is compatible with allowing bg printing */ ++ 85, /* width_10ths, 8.5" */ ++ 110, /* height_10ths, 11" */ ++ 160, 144, /* X_DPI, Y_DPI */ ++ 0, 0.5, 0.5, 0, /* margins */ ++ 1, dmp_print_page); ++ ++/* LQ hirez Imagewriter device */ ++const gx_device_printer far_data gs_iwlq_device = ++prn_device(prn_bg_procs, "iwlq", /* The print_page proc is compatible with allowing bg printing */ ++ 85, /* width_10ths, 8.5" */ ++ 110, /* height_10ths, 11" */ ++ 320, 216, ++ 0, 0, 0.5, 0, /* margins */ ++ 1, dmp_print_page); ++ ++/* ------ Internal routines ------ */ ++ ++#define DMP 1 ++#define IWLO 2 ++#define IWHI 3 ++#define IWLQ 4 ++ ++/* Send the page to the printer. */ ++static int ++dmp_print_page(gx_device_printer *pdev, FILE *prn_stream) ++{ ++ int dev_type; ++ ++ int line_size = gdev_mem_bytes_per_scan_line((gx_device *)pdev); ++ /* Note that in_size is a multiple of 8. */ ++ int in_size = line_size * 8; ++ ++ byte *buf1 = (byte *)gs_malloc(pdev->memory, in_size, 1, "dmp_print_page(buf1)"); ++ byte *buf2 = (byte *)gs_malloc(pdev->memory, in_size, 1, "dmp_print_page(buf2)"); ++ byte *prn = (byte *)gs_malloc(pdev->memory, 3*in_size, 1, "dmp_print_page(prn)"); ++ ++ byte *in = buf1; ++ byte *out = buf2; ++ int lnum = 0; ++ ++ /* Check allocations */ ++ if ( buf1 == 0 || buf2 == 0 || prn == 0 ) ++ { ++ if ( buf1 ) ++ gs_free(pdev->memory, (char *)buf1, in_size, 1, ++ "dmp_print_page(buf1)"); ++ if ( buf2 ) ++ gs_free(pdev->memory, (char *)buf2, in_size, 1, ++ "dmp_print_page(buf2)"); ++ if ( prn ) ++ gs_free(pdev->memory, (char *)prn, in_size, 1, ++ "dmp_print_page(prn)"); ++ return_error(gs_error_VMerror); ++ } ++ ++ if ( pdev->y_pixels_per_inch == 216 ) ++ dev_type = IWLQ; ++ else if ( pdev->y_pixels_per_inch == 144 ) ++ dev_type = IWHI; ++ else if ( pdev->x_pixels_per_inch == 160 ) ++ dev_type = IWLO; ++ else ++ dev_type = DMP; ++ ++ /* Initialize the printer and reset the margins. */ ++ ++ fputs("\r\n\033>\033T16", prn_stream); ++ ++ switch(dev_type) ++ { ++ case IWLQ: ++ fputs("\033P\033a3", prn_stream); ++ break; ++ case IWHI: ++ case IWLO: ++ fputs("\033P", prn_stream); ++ break; ++ case DMP: ++ default: ++ fputs("\033q", prn_stream); ++ break; ++ } ++ ++ /* Print lines of graphics */ ++ while ( lnum < pdev->height ) ++ { ++ byte *inp; ++ byte *in_end; ++ byte *out_end; ++ int lcnt,ltmp; ++ int count, passes; ++ byte *prn_blk, *prn_end, *prn_tmp; ++ ++/* The apple DMP printer seems to be odd in that the bit order on ++ * each line is reverse what might be expected. Meaning, an ++ * underscore would be done as a series of 0x80, while on overscore ++ * would be done as a series of 0x01. So we get each ++ * scan line in reverse order. ++ */ ++ ++ switch (dev_type) ++ { ++ case IWLQ: passes = 3; break; ++ case IWHI: passes = 2; break; ++ case IWLO: ++ case DMP: ++ default: passes = 1; break; ++ } ++ ++ for (count = 0; count < passes; count++) ++ { ++ for (lcnt=0; lcnt<8; lcnt++) ++ { ++ switch(dev_type) ++ { ++ case IWLQ: ltmp = lcnt + 8*count; break; ++ case IWHI: ltmp = 2*lcnt + count; break; ++ case IWLO: ++ case DMP: ++ default: ltmp = lcnt; break; ++ } ++ ++ if ((lnum+ltmp)>pdev->height) ++ memset(in+lcnt*line_size,0,line_size); ++ else ++ gdev_prn_copy_scan_lines(pdev, ++ lnum+ltmp, in + line_size*(7 - lcnt), ++ line_size); ++ } ++ ++ out_end = out; ++ inp = in; ++ in_end = inp + line_size; ++ for ( ; inp < in_end; inp++, out_end += 8 ) ++ { ++ gdev_prn_transpose_8x8(inp, line_size, ++ out_end, 1); ++ } ++ ++ out_end = out; ++ ++ switch (dev_type) ++ { ++ case IWLQ: prn_end = prn + count; break; ++ case IWHI: prn_end = prn + in_size*count; break; ++ case IWLO: ++ case DMP: ++ default: prn_end = prn; break; ++ } ++ ++ while ( (int)(out_end-out) < in_size) ++ { ++ *prn_end = *(out_end++); ++ if ((dev_type) == IWLQ) prn_end += 3; ++ else prn_end++; ++ } ++ } ++ ++ switch (dev_type) ++ { ++ case IWLQ: ++ prn_blk = prn; ++ prn_end = prn_blk + in_size * 3; ++ while (prn_end > prn && prn_end[-1] == 0 && ++ prn_end[-2] == 0 && prn_end[-3] == 0) ++ { ++ prn_end -= 3; ++ } ++ while (prn_blk < prn_end && prn_blk[0] == 0 && ++ prn_blk[1] == 0 && prn_blk[2] == 0) ++ { ++ prn_blk += 3; ++ } ++ if (prn_end != prn_blk) ++ { ++ if ((prn_blk - prn) > 7) ++ fprintf(prn_stream,"\033U%04d%c%c%c", ++ (int)((prn_blk - prn)/3), ++ 0, 0, 0); ++ else ++ prn_blk = prn; ++ fprintf(prn_stream,"\033C%04d", ++ (int)((prn_end - prn_blk)/3)); ++ fwrite(prn_blk, 1, (int)(prn_end - prn_blk), ++ prn_stream); ++ } ++ break; ++ case IWHI: ++ for (count = 0; count < 2; count++) ++ { ++ prn_blk = prn_tmp = prn + in_size*count; ++ prn_end = prn_blk + in_size; ++ while (prn_end > prn_blk && prn_end[-1] == 0) ++ prn_end--; ++ while (prn_blk < prn_end && prn_blk[0] == 0) ++ prn_blk++; ++ if (prn_end != prn_blk) ++ { ++ if ((prn_blk - prn_tmp) > 7) ++ fprintf(prn_stream, ++ "\033V%04d%c", ++ (int)(prn_blk-prn_tmp), ++ 0); ++ else ++ prn_blk = prn_tmp; ++ fprintf(prn_stream,"\033G%04d", ++ (int)(prn_end - prn_blk)); ++ fwrite(prn_blk, 1, ++ (int)(prn_end - prn_blk), ++ prn_stream); ++ } ++ if (!count) fputs("\033T01\r\n",prn_stream); ++ } ++ fputs("\033T15",prn_stream); ++ break; ++ case IWLO: ++ case DMP: ++ default: ++ prn_blk = prn; ++ prn_end = prn_blk + in_size; ++ while (prn_end > prn_blk && prn_end[-1] == 0) ++ prn_end--; ++ while (prn_blk < prn_end && prn_blk[0] == 0) ++ prn_blk++; ++ if (prn_end != prn_blk) ++ { ++ if ((prn_blk - prn) > 7) ++ fprintf(prn_stream,"\033V%04d%c", ++ (int)(prn_blk - prn), 0); ++ else ++ prn_blk = prn; ++ fprintf(prn_stream,"\033G%04d", ++ (int)(prn_end - prn_blk)); ++ fwrite(prn_blk, 1, (int)(prn_end - prn_blk), ++ prn_stream); ++ } ++ break; ++ } ++ ++ fputs("\r\n",prn_stream); ++ ++ switch (dev_type) ++ { ++ case IWLQ: lnum += 24 ; break; ++ case IWHI: lnum += 16 ; break; ++ case IWLO: ++ case DMP: ++ default: lnum += 8 ; break; ++ } ++ } ++ ++ /* ImageWriter will skip a whole page if too close to end */ ++ /* so skip back more than an inch */ ++ if ( !(dev_type == DMP) ) ++ fputs("\033T99\n\n\033r\n\n\n\n\033f", prn_stream); ++ ++ /* Formfeed and Reset printer */ ++ fputs("\033T16\f\033<\033B\033E", prn_stream); ++ fflush(prn_stream); ++ ++ gs_free(pdev->memory, (char *)prn, in_size, 1, "dmp_print_page(prn)"); ++ gs_free(pdev->memory, (char *)buf2, in_size, 1, "dmp_print_page(buf2)"); ++ gs_free(pdev->memory, (char *)buf1, in_size, 1, "dmp_print_page(buf1)"); ++ return 0; ++} +diff --git a/windows/ghostscript.vcproj b/windows/ghostscript.vcproj +index 471349686ba04aafed142c018a556406b8f221aa..e675ba895dc23ddac80fcf8518dd42b1b3c1e0fb 100644 +--- a/windows/ghostscript.vcproj ++++ b/windows/ghostscript.vcproj +@@ -5654,6 +5654,10 @@ + > + + ++ ++ + +diff --git a/windows/ghostscript_rt.vcxproj b/windows/ghostscript_rt.vcxproj +index 39f47aea5e35bfe49775632b0811cc7e42c200c9..2d3f10b40f5766ea6f2e4770e2a60a2dd1b1b816 100644 +--- a/windows/ghostscript_rt.vcxproj ++++ b/windows/ghostscript_rt.vcxproj +@@ -1392,6 +1392,7 @@ + + + ++ + + + +-- +2.13.5 + diff --git a/app-text/ghostscript-gpl/ghostscript-gpl-9.21-r1.ebuild b/app-text/ghostscript-gpl/ghostscript-gpl-9.21-r1.ebuild new file mode 100644 index 0000000..8ce4297 --- /dev/null +++ b/app-text/ghostscript-gpl/ghostscript-gpl-9.21-r1.ebuild @@ -0,0 +1,207 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit autotools multilib versionator flag-o-matic toolchain-funcs + +DESCRIPTION="Ghostscript is an interpreter for the PostScript language and for PDF" +HOMEPAGE="http://ghostscript.com/" + +MY_P=${P/-gpl} +PVM=$(get_version_component_range 1-2) +PVM_S=$(replace_all_version_separators "" ${PVM}) + +MY_PATCHSET=1 + +SRC_URI=" + https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${PVM_S}/${MY_P}.tar.xz + https://dev.gentoo.org/~dilfridge/distfiles/${P}-patchset-${MY_PATCHSET}.tar.xz +" + +LICENSE="AGPL-3 CPL-1.0" +SLOT="0" +KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd" +IUSE="cups dbus gtk l10n_de static-libs tiff unicode X" + +COMMON_DEPEND=" + app-text/libpaper + media-libs/fontconfig + >=media-libs/freetype-2.4.9:2= + media-libs/jbig2dec + >=media-libs/lcms-2.6:2 + >=media-libs/libpng-1.6.2:0= + >=media-libs/openjpeg-2.1.0:2= + >=sys-libs/zlib-1.2.7:= + virtual/jpeg:0 + cups? ( >=net-print/cups-1.3.8 ) + dbus? ( sys-apps/dbus ) + gtk? ( || ( x11-libs/gtk+:3 x11-libs/gtk+:2 ) ) + unicode? ( net-dns/libidn ) + tiff? ( >=media-libs/tiff-4.0.1:0= ) + X? ( x11-libs/libXt x11-libs/libXext ) +" + +DEPEND="${COMMON_DEPEND} + virtual/pkgconfig +" + +RDEPEND="${COMMON_DEPEND} + >=app-text/poppler-data-0.4.5-r1 + >=media-fonts/urw-fonts-2.4.9 + l10n_ja? ( media-fonts/kochi-substitute ) + l10n_ko? ( media-fonts/baekmuk-fonts ) + l10n_zh-CN? ( media-fonts/arphicfonts ) + l10n_zh-TW? ( media-fonts/arphicfonts ) + !!media-fonts/gnu-gs-fonts-std + !!media-fonts/gnu-gs-fonts-other + !