Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC840302); site boring.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!mcvax!boring!guido From: guido@boring.UUCP Newsgroups: net.micro.mac Subject: How to change font sizes (Re: ascii.question 1) Message-ID: <6653@boring.UUCP> Date: Wed, 16-Oct-85 10:52:19 EDT Article-I.D.: boring.6653 Posted: Wed Oct 16 10:52:19 1985 Date-Received: Fri, 18-Oct-85 21:22:38 EDT References: <1034@ttds.UUCP> Reply-To: guido@mcvax.UUCP (Guido van Rossum) Organization: "Stamp Out BASIC" Committee, CWI, Amsterdam Lines: 23 Apparently-To: rnews@mcvax.LOCAL Use the QuickDraw routines to set the font and size of the current GrafPort (make sure you have done a SetPort): TextFont(font_id); TextSize(point_size); The "point size" is unrelated to the number of pixels the font is high, except that larger point sizes give larger characters; it is up to the font designer how large 12 point letters really are (a "point" is 1/72 inch but different output devices may give different results!) Now the QuickDraw routine GetFontInfo tells you all about the current font: it fills a struct FontInfo with fields ascent, descent, widMax and leading, all in pixels. The line height is ascent+descent+leading; I believe you must fill TextEdit's FirstBL (first base line) with ascent+leading to get a nice looking display. (Leading is the number of blank pixels between lines; widMax is the maximum width of any character in the font.) (PS: TextSize(0) will give you the real font that's closest to 12 points.) -- Guido van Rossum, CWI, Amsterdam (guido@mcvax.UUCP)