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-gateThe devpost directory includes width tables for the entire LaserWriter Plus font 24*7c478bd9Sstevel@tonic-gateset (and a few others). The width tables assume a resolution of 720 dpi (which 25*7c478bd9Sstevel@tonic-gateisn't expected to match your printer's resolution) and by default are installed 26*7c478bd9Sstevel@tonic-gatein /usr/lib/font/devpost. You can point troff there using the -Tpost option, while 27*7c478bd9Sstevel@tonic-gatedpost goes there automatically. The width tables were generated on a PostScript 28*7c478bd9Sstevel@tonic-gateprinter using postio (with the -t option) and the files that you'll find in 29*7c478bd9Sstevel@tonic-gatedirectory ../buildtables. 30*7c478bd9Sstevel@tonic-gate 31*7c478bd9Sstevel@tonic-gateThe mapping from troff's one or two character font names to PostScript fonts is 32*7c478bd9Sstevel@tonic-gatehandled by definitions made near the start of file ../postscript/dpost.ps. troff 33*7c478bd9Sstevel@tonic-gatecharacters not available in PostScript fonts are constructed using the files in 34*7c478bd9Sstevel@tonic-gate./devpost/charlib. Characters that are assigned a code (ie. number in the fourth 35*7c478bd9Sstevel@tonic-gatecolumn) less than 32 are looked up (by dpost) in the charlib directory. A code 36*7c478bd9Sstevel@tonic-gateof 1 implies the character definition comes in one piece, while anything else 37*7c478bd9Sstevel@tonic-gatemeans the character may come in two pieces. The first part is downloaded once, 38*7c478bd9Sstevel@tonic-gatewhile the second part (ie. the one that ends in .map) must be included every 39*7c478bd9Sstevel@tonic-gatetime the character is printed. 40*7c478bd9Sstevel@tonic-gate 41*7c478bd9Sstevel@tonic-gateAdding a new font file (for troff and dpost) can be time consuming, but isn't 42*7c478bd9Sstevel@tonic-gatedifficult. The steps you'll need to follow are outlined below: 43*7c478bd9Sstevel@tonic-gate 44*7c478bd9Sstevel@tonic-gate 1: Pick a one or two character font name for troff and dpost - no longer a 45*7c478bd9Sstevel@tonic-gate trivial task! To find out what two character font names are taken type, 46*7c478bd9Sstevel@tonic-gate 47*7c478bd9Sstevel@tonic-gate cd devpost 48*7c478bd9Sstevel@tonic-gate ls -l ? ?? 49*7c478bd9Sstevel@tonic-gate 50*7c478bd9Sstevel@tonic-gate Any unused one or two character font name can be chosen. I've tried to choose 51*7c478bd9Sstevel@tonic-gate two character font names with the first character representing the font family 52*7c478bd9Sstevel@tonic-gate (eg. K for Bookman) and second (upper or lower case R, I, B, or X) indicating 53*7c478bd9Sstevel@tonic-gate the style. 54*7c478bd9Sstevel@tonic-gate 55*7c478bd9Sstevel@tonic-gate 2: Choose a unique internal name (ie. integer between 1 and 255). To find out 56*7c478bd9Sstevel@tonic-gate what internal names (ie. numbers) are already taken type, 57*7c478bd9Sstevel@tonic-gate 58*7c478bd9Sstevel@tonic-gate cd devpost 59*7c478bd9Sstevel@tonic-gate grep internalname ? ?? | sort -n +1 -2 60*7c478bd9Sstevel@tonic-gate 61*7c478bd9Sstevel@tonic-gate Any number not already used can be chosen. Consecutive numbering starting at 62*7c478bd9Sstevel@tonic-gate a fixed offset (like 128) might be a useful approach. 63*7c478bd9Sstevel@tonic-gate 64*7c478bd9Sstevel@tonic-gate 3: Build the width tables and install the ASCII files in ./devpost. Width tables 65*7c478bd9Sstevel@tonic-gate can be built by hand or you can use postio (with the -t option) and the stuff 66*7c478bd9Sstevel@tonic-gate in directory ../buildtables and have the printer generate the tables. Widths 67*7c478bd9Sstevel@tonic-gate (ie. numbers in column 2) are point size 10 widths assuming a resolution of 68*7c478bd9Sstevel@tonic-gate 720 dpi. As an example if you wanted to find the width of character A in 69*7c478bd9Sstevel@tonic-gate Times-Roman you could send the following to a PostScript printer, 70*7c478bd9Sstevel@tonic-gate 71*7c478bd9Sstevel@tonic-gate /Times-Roman findfont 100 scalefont setfont 72*7c478bd9Sstevel@tonic-gate (A) stringwidth pop == 73*7c478bd9Sstevel@tonic-gate 74*7c478bd9Sstevel@tonic-gate The fourth column in the width tables is the character code field and is only 75*7c478bd9Sstevel@tonic-gate used by dpost. It must be the code assigned to the character in the PostScript 76*7c478bd9Sstevel@tonic-gate font. For simple characters (like an a) it's just the ASCII code. Characters 77*7c478bd9Sstevel@tonic-gate that are assigned codes less than 32 (typically 1 or 2) are special and are 78*7c478bd9Sstevel@tonic-gate built up using files in devpost/charlib. 79*7c478bd9Sstevel@tonic-gate 80*7c478bd9Sstevel@tonic-gate 4: Any new special character names you've added to the width table must appear in 81*7c478bd9Sstevel@tonic-gate the charset portion of file devpost/DESC. 82*7c478bd9Sstevel@tonic-gate 83*7c478bd9Sstevel@tonic-gate 5: Add a mapping definition to ../postscript/dpost.ps. For example if you've 84*7c478bd9Sstevel@tonic-gate built a width table for font XR and the PostScript name is /ExtraFont-Roman 85*7c478bd9Sstevel@tonic-gate then add, 86*7c478bd9Sstevel@tonic-gate 87*7c478bd9Sstevel@tonic-gate /XR /ExtraFont-Roman def 88*7c478bd9Sstevel@tonic-gate 89*7c478bd9Sstevel@tonic-gate to the dpost prologue. 90*7c478bd9Sstevel@tonic-gate 91*7c478bd9Sstevel@tonic-gate 6: If you're system uses PDQs you'll need to build new PDQ font files. I've 92*7c478bd9Sstevel@tonic-gate included the PDQ version of makedev and font.mk includes a target called PDQ 93*7c478bd9Sstevel@tonic-gate that works on MHCC systems. Typing, 94*7c478bd9Sstevel@tonic-gate 95*7c478bd9Sstevel@tonic-gate make -f font.mk PDQ 96*7c478bd9Sstevel@tonic-gate 97*7c478bd9Sstevel@tonic-gate should work, provided you can execute the PDQFRONT program. The new binary 98*7c478bd9Sstevel@tonic-gate PDQ files initially go in directory PDQ/devpost and from there are installed 99*7c478bd9Sstevel@tonic-gate in /usr/lib/font/PDQ/devpost. If you don't know what PDQs are skip this stuff. 100*7c478bd9Sstevel@tonic-gate 101*7c478bd9Sstevel@tonic-gate 7: Build and install the new binary font files and dpost prologue by typing, 102*7c478bd9Sstevel@tonic-gate 103*7c478bd9Sstevel@tonic-gate cd .. 104*7c478bd9Sstevel@tonic-gate make TARGETS='font postscript' install 105*7c478bd9Sstevel@tonic-gate 106*7c478bd9Sstevel@tonic-gate Actually the install (as written above) installs everything in directory 107*7c478bd9Sstevel@tonic-gate ../postscript. Since all you need is the new version of dpost.ps the following 108*7c478bd9Sstevel@tonic-gate might be safer, 109*7c478bd9Sstevel@tonic-gate 110*7c478bd9Sstevel@tonic-gate cd .. 111*7c478bd9Sstevel@tonic-gate make TARGETS=font install 112*7c478bd9Sstevel@tonic-gate cd postscript 113*7c478bd9Sstevel@tonic-gate cp dpost.ps /usr/lib/postscript/dpost.ps 114*7c478bd9Sstevel@tonic-gate 115*7c478bd9Sstevel@tonic-gateThe devpostaps directory is new and the binary tables won't be built or installed 116*7c478bd9Sstevel@tonic-gateunless you do it by hand. The tables are an attempt to make Linotronic output look 117*7c478bd9Sstevel@tonic-gatesomething like APS-5 output, and won't be useful to most people. The only real 118*7c478bd9Sstevel@tonic-gateapplication is for simple (perhaps one or two page) updates to larger documents 119*7c478bd9Sstevel@tonic-gatethat have already been formatted and printed on the APS-5. The following commands 120*7c478bd9Sstevel@tonic-gatebuild and install the devpostaps tables, 121*7c478bd9Sstevel@tonic-gate 122*7c478bd9Sstevel@tonic-gate make -f font.mk makedev 123*7c478bd9Sstevel@tonic-gate cd devpostaps 124*7c478bd9Sstevel@tonic-gate ../makedev DESC ? ?? 125*7c478bd9Sstevel@tonic-gate mkdir /usr/lib/font/devpostaps 126*7c478bd9Sstevel@tonic-gate cp *.out /usr/lib/font/devpostaps 127*7c478bd9Sstevel@tonic-gate cd charlib 128*7c478bd9Sstevel@tonic-gate mkdir /usr/lib/font/devpostaps/charlib 129*7c478bd9Sstevel@tonic-gate cp * /usr/lib/font/devpostaps/charlib 130*7c478bd9Sstevel@tonic-gate 131*7c478bd9Sstevel@tonic-gateThe tables should only be used by dpost - troff files should be formatted with 132*7c478bd9Sstevel@tonic-gatethe -Taps option. In addition dpost must use level 2 encoding. A command line 133*7c478bd9Sstevel@tonic-gatethat forces dpost to do the best it can with APS files would be, 134*7c478bd9Sstevel@tonic-gate 135*7c478bd9Sstevel@tonic-gate dpost -e2 -Tpostaps -C/usr/lib/postscript/aps.ps file >file.ps 136*7c478bd9Sstevel@tonic-gate 137*7c478bd9Sstevel@tonic-gatewhere aps.ps is additional PostScript code (pulled in using the -C option) that 138*7c478bd9Sstevel@tonic-gatetunes the Courier, Times, and Helvetica fonts so they look more like APS fonts. 139*7c478bd9Sstevel@tonic-gate 140