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