Path: utzoo!mnetor!uunet!steinmetz!sprite!montnaro From: montnaro@sprite (Skip Montanaro) Newsgroups: comp.windows.news Subject: How to properly scale fonts in an application? Message-ID: <9971@steinmetz.steinmetz.UUCP> Date: 16 Mar 88 22:01:20 GMT Sender: news@steinmetz.steinmetz.UUCP Reply-To: montnaro@sprite.steinmetz.ge.com (Skip Montanaro) Organization: General Electric CRD, Schenectady, NY Lines: 29 I'm writing a small NeWS application that needs to put some text up and I'm having trouble setting the font size, other than by trial and error. I first tried (for instance) /Times-Italic findfont 12 scalefont in an attempt to get a 12-point font, and wound up with enormous text that sprayed itself all over the screen. My next attempt was to calculate the X dimension of the window after the user had reshaped the window (call it WinX) and the X dimension of the framebuffer (call it ScreenX) and do /Times-Italic findfont 12 WinX mul ScreenX div scalefont thinking that the ratio of the window to screen dimension would help scale things properly, but that didn't work either. So I started twiddling the "12" and came up with /Times-Italic findfont 0.05 WinX mul ScreenX div scalefont which isn't intuitive at all. Can someone give me some advice about what I'm doing wrong? Thanks, Skip Montanaro (montanaro@sprite.steinmetz.ge.com, montanaro@ge-crd.arpa)