Path: utzoo!attcan!uunet!decwrl!shelby!agate!linus!linus!marsh From: marsh@linus.mitre.org (Ralph Marshall) Newsgroups: comp.lang.postscript Subject: Re: Variable characters Keywords: font, character size Message-ID: <122961@linus.mitre.org> Date: 11 Oct 90 13:49:29 GMT References: <1902@fcs280s.ncifcrf.gov> <21131@well.sf.ca.us> Reply-To: marsh@darwin.UUCP (Ralph Marshall 617 271-8784) Organization: The MITRE Corporation, Bedford MA Lines: 19 In article <21131@well.sf.ca.us> shiva@well.sf.ca.us (Kenneth Porter) writes: > > >When I need to get characters to fit a pre-defined space (such >as is the case on my business card), I always calculate the >point size, sometimes with x and y computed independently. The >x size can be calculated by using stringwidth after setting the >font at 1 point. The y size can be calculated by iterating >over the string and reading the metric info for each character. Of course, you can also get the height of the string from stringwidth (despite the somewhat misleading name). It leaves both the width and height of the string on the stack, taking into account all the usual things such as scales and rotations, actual font, font size, etc., so it should be suitable for most situations such as picking a scale size that will allow the text to fit on a business card. Ralph Marshall marsh@linus.mitre.org