[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
Re: XyWrite and Ghostscript
- Subject: Re: XyWrite and Ghostscript
- From: OkAnnie@xxxxxxxx
- Date: Sat, 19 Aug 1995 19:45:42 -0400
- Maybe in reply to: Dan Kanagy: "XyWrite and Ghostscript"
"I did look at XyDos 4 documentation again and found instructions for
creating width tables. I'll have to fool around with this some more later."
--Dan Kanagy
Dan: Just came across this possibly relevant msg posted by David Clarke
to the PostScript language newsgroup. To use
the printout code:
Save from
%!PS-
through
/Helvetica pwidths
as a separate file. For /Helvetica, substitute the name of any Type 1 font,
preceded by a slash, that's been dl'd to Ghostscript. Send Ghostscript the
file just as you send Ghostscript any PS file you've printed to disk. Works
with my GoScript previewer. I may fool around with piping output to a file,
which for building a width table would be more useful than a printout. --a
Re: PS character widths ==================================
Sat, 19 Aug 1995 10:21 GMT
================ David Clarke
: Can anyone suggest a macro for listing
: character widths in a given PS font?
David H. Foster: If the fonts are downloadable ones they should have been
supplied with a file of relevant width information for the platform
concerned--.PFM for Windows, or .AFM which is an ASCII-format listing all of
the relevant metrics information for the font.
If you do not have these, or if the fonts are resident in a printer, the most
comprehensive listing (almost identical in format to the .AFM file) can be
obtained by using the program PRFONT.PS, which is bundled nowadays with
distributions of GhostScript, though it originated elsewhere. Another program
to look for is GETAFM.PS.
If the job doesn't need all of the information available, the following code
will simply print out the widths for a given font. --David Clarke (Reply to
dclarke@xxxxxxxx) Trent Micro Systems, Nottingham, 0973 213372
%!PS-
% Simple printer of character widths
/pwidths
{ /w 256 array def /e 256 array def /X 25 def /Y 750 def
dup /n exch def findfont 1000 scalefont setfont 0 1 255
{ dup dup currentfont /Encoding get exch get
dup e 4 -1 roll 3 -1 roll put /.notdef ne
{ dup (_) dup 0 4 -1 roll put stringwidth pop cvi }
{ 0 }ifelse
w 3 1 roll put
}for
/Courier findfont 10 scalefont setfont n 100 string cvs
X Y moveto show /Y Y 12 sub def 0 4 255
{ /I exch def X Y moveto 0 1 3
{ I add dup dup 6 string cvs show ( \() show
e exch get 30 string cvs show (\) ) show
w exch get 6 string cvs show (, ) show
}for /Y Y 11 sub def
}for
showpage
}def
% Sample usage:
/Helvetica pwidths
========================== annie fisher nyc
- Maybe in reply to: Dan Kanagy: "XyWrite and Ghostscript"