1# 2# CDDL HEADER START 3# 4# The contents of this file are subject to the terms of the 5# Common Development and Distribution License, Version 1.0 only 6# (the "License"). You may not use this file except in compliance 7# with the License. 8# 9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10# or http://www.opensolaris.org/os/licensing. 11# See the License for the specific language governing permissions 12# and limitations under the License. 13# 14# When distributing Covered Code, include this CDDL HEADER in each 15# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16# If applicable, add the following below this CDDL HEADER, with the 17# fields enclosed by brackets "[]" replaced with your own identifying 18# information: Portions Copyright [yyyy] [name of copyright owner] 19# 20# CDDL HEADER END 21# 22 23Source code for a simple program that translates ASCII files into PostScript. The 24only important change, besides the restructuring that's been applied to all the 25translators, is the addition of the -r option that controls how carriage returns 26are handled. As in previous versions the default behavior is to ignore carriage 27returns. The two other choices are to return to column 1 (-r1 option) or treat 28carriage returns as newlines (-r2 option). You can modify the default behavior by 29changing the initialization of crmode (near line 98) in postprint.c. 30 31Things have been tuned for PostScript printers running at 9600 baud, and may not 32be optimal for fast printers running at higher baud rates. A few simple changes 33here and in ../postscript/postprint.ps could help if throughput seems to be 34lacking: 35 36 1) Near line 755 in postprint.c change 37 38 fprintf(fp_out, ")%d L\n", stringstart-1); 39 40 to 41 42 fprintf(fp_out, ")%d %d L\n", stringstart-1, stringcount); 43 44 Then change the definition of procedure L in ../postscript/postprint.ps 45 to, 46 47 /L { 48 {charwidth mul currentpoint exch pop show} repeat 49 linespace add dup 0 exch moveto 50 } bind def 51 52 2) Change the upper limit test near line 694 (procedure spaces()) in postprint.c 53 from 6 to something bigger. Output files will be larger, but will run faster 54 when they get to the printer. Should help if you're running at 19.2KB or 55 higher. 56 57 3) Adjust the scaling set in procedure setup in ../postscript/postprint.ps so 58 1 unit corresponds to the line spacing. Then replace 'linespace add' in 59 procedures l and L by '1 sub'. It's a little tricky, but I've tried it and 60 it does work. 61 62