Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!JHUNIX.BITNET!cal From: cal@JHUNIX.BITNET (cal) Newsgroups: comp.laser-printers Subject: ditroff metrics Keywords: ditroff, metrics, Transcript, troff Message-ID: <8910100244.AA08879@crayola.cs.UMD.EDU> Date: 6 Oct 89 20:18:30 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Johns Hopkins University - HCF Lines: 108 Approved: laser-lovers@brillig.umd.edu 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