[comp.laser-printers] ditroff metrics

cal@JHUNIX.BITNET (cal) (10/07/89)

     
     
We use troff (ditroff) and Adobe's Transcript package for most of our
printing. I have written or modified a number of Postscript fonts for
non-European languages and have gotten them up and running in ditroff.
The only problem that I have yet to figure out a solution to arises,
apparently, in how ditroff does its metrics work.
   Due to the number of characters in the fonts I have developed, som
of the characters have had to be encoded in high ascii position and
called with the ditroff string \(xx (xx replaced with the 2 character
code for the desired character). Each character in the font has its
own metrics value in the Postscript prologue file and in the
corresponding afm (Adobe font metrics) file. This latter file is
converted to a ditroff font description file with the afmdit program
supplied with Transcript. All of these files have the correct metrics
information for all characters in the fonts. The problem comes with
ditroff takes the original troff coded file and produces the
intermediary ditroff file. In that file, the high ascii (and only the
high ascii) characters of my fonts are not given the metrics value
from the ditroff font description file for that font, but the metrics
of the character of the same ascii position in the Times-Roman font
(the default font for ditroff). The low ascii characters are spaced
correctly, so ditroff is finding the font description file, and all of
the characters, low and high ascii, are printing correctly, with the
exception of the messed up spacing of the high ascii characters. If
anyone has an explanation, or better a solution to this problem, I
would greatly appreciate knowing about it.
   Appended here are some samples of the various files illustrating
the situation in case my explanation above is not clear enough. For
anyone already familiar with these files, I apologize for this.
However, if there is something wrong in these files that I have
overlooked, seeing the pieces of code below might prompt a solution.
     
Steve Bennett
cal@jhunix
     
     
Postscript (from Syriac prologue file)
     
        Encoding        % ditroff octal
        dup 66 /bP put  % B
        dup 77 /mP put  % M
        dup 162 /bF put % \(ct    242
        dup 174 /TB put % \(fi    256
     
        Metrics
        /bP 912 def
        /mP 816 def
        /bF 614 def
        /TB 896 def
     
     
from Syriac AFM file
     
        C 66 ; WX 912 ; N B ; B 0 -24 912 360 ;
        C 77 ; WX 816 ; N M ; B 0 -200 816 448 ;
        C 162 ; WX 614 ; N cent ; B 0 0 564 360 ;
        c 174 ; WX 896 ; N fi ; B 0 -336 896 768 ;
     
     
Ditroff description file Syriac font
        (the metric value for each character -- 2nd column -- is derived by
        dividing the Postscript value by 5)
     
        B       182 2 0102      B
        M       163 2 0115      M
        ct      123 2 0242      cent
        fi      179 2 0256      fi
     
     
Ditroff values in Times-Roman font description file for same characters
     
        B       133 2 0102      B
        M       178 2 0115      M
        ct      100 0 0242      cent
        fi      111 2 0256      fi
     
     
Section of troff file and ditroff file (done at 25 point so that the
        character size matches the unitwidth of our printer.)
     
  (troff)
        .fp 4 sy        \" sy is name of downloaded font
        \f1 B\(ct\(fiMB
        \f4 B\(ct\(fiMB
     
  (ditroff)
        x font 4 sy
        f1                      Printing Times Roman line
        H555
        wV792
        50Bh133Cct
        h100Cfi
        h111cM
        h178cB
        n216 0
        H555
        wf4                     Printing Syriac line
        V1008
        50Bh186Cct              186 is correct for Syriac "B", 133 in Times
        h100Cfi                 Should be 123, not 100
        h111cM                  Should be 179, not 111
        h163cB                  163 correct for Syriac "M", 178 in Times
        n216 0
        x trailer
        V6336
        x stop

mackay@MANTA.CS.WASHINGTON.EDU (Pierre MacKay) (10/13/89)

If you are using Transcript, I am a bit puzzled to learn why you use ditroff
instead of ptroff.  

Ptroff goes right back to the old C/A/T 432 units/inch resolution, and lets
the Postscript RIP do the scaling.  Simple and effective.  Not the solution
I would use for TeX, but it works fine for all my Troff (manual page) needs.

I have one quarrel with ptroff.  The prologue that it adds to ps output 
uses the value 432 (exactly the old C/A/T resolution) to set dimensions
and you can see the results in -man format where the bottom line goes off
the paper.  The problem is evidently rounding in the RIP.  Change the
432 to 440, (it's a divisor) and the output shrinks to just about the
correct size.  This is true for both the older and the newer LaserWriters.
You may have to experiment with other PostScript processors.


Email:  mackay@cs.washington.edu		Pierre A. MacKay
Smail:  Northwest Computing Support Center	TUG Site Coordinator for
	Thompson Hall, Mail Stop DR05		Unix-flavored TeX
	University of Washington
	Seattle, WA 98195
	(206) 543-6259

rcd@ico.isc.com (Dick Dunn) (10/17/89)

mackay@MANTA.CS.WASHINGTON.EDU (Pierre MacKay) writes:
> If you are using Transcript, I am a bit puzzled to learn why you use ditroff
> instead of ptroff.  

There are good reasons for using ditroff (and psroff) rather than old troff
and ptroff (the C/A/T interface).

Ditroff works with grap.  It works better than old troff with pic.  Font
support for multiple families actually works well.  You can have more fonts
"mounted" (available) at one time.  Point size selection is better.
Ditroff is also a lot cleaner internally, for whatever that's worth.
-- 
Dick Dunn     rcd@ico.isc.com    uucp: {ncar,nbires}!ico!rcd     (303)449-2870
   ...No DOS.  UNIX.