Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!sun-barr!newstop!exodus!appserv!angel.Eng.Sun.COM!henry From: henry@angel.Eng.Sun.COM (Henry McGilton) Newsgroups: comp.lang.postscript Subject: Re: 2 Beginer Questions. (Underline & Pattern Fill) Summary: Unreliable Keywords: Underline Fill Message-ID: <595@appserv.Eng.Sun.COM> Date: 21 May 91 00:08:18 GMT References: <1991May20.222912.6130@gmuvax2.gmu.edu> Sender: news@appserv.Eng.Sun.COM Lines: 51 In article <1991May20.222912.6130@gmuvax2.gmu.edu>, mhovan@gmuvax2.gmu.edu (Mike Hovan) writes: Two simple questions: * 1) How do I use the underline information that is in the * font definition to produce underlines? Beware. /UnderlinePosition and /UnderlineThickness keys live in the /FontInfo dictionary. /FontInfo is an OPTIONAL DICTIONARY -- you cannot depend on its existence. Other implementations confuse the issue still further by putting the /UnderlinePosition and /UnderlineThickness keys in the font dictionary itself, instead of in the /FontInfo dictionary, thereby rendering PostScript interpreter dependent -- a new twist on device dependence. However, should you actually want to use these items of information, define start underline and end underline procedures. The start underline procedure records the start position of your show string. The end underline procedure then draws a line at the correct position and thickness. Another possible way is to actually use the underline character from the font, if it's there. Just go back to the start position of the show string and then show the appropriate number of underline characters. Both these suggestions are simplistic. The information is also (should be) contained in AFM files, which applications should use, assuming the information in the AFM files is correct. * 2) What is the easiest way to do arbitrary pattern fills? (image?) In PostScript Level One, a reasonably good way is to define a font containing characters that tile. Using the font machinery for patterns is a good way to go, since you can use arbitrary PostScript programs that will scale and so on. Using image is the next best way if you're desperate, but watch out for scaling effects. In PostScript Level Two, coming Real Soon Now to printers near you, use the pattern facilities. ........ Henry If Operating Systems were buildings, UNIX would be the Winchester Mystery House.