Path: utzoo!utgpu!watmath!att!pacbell!ames!indri!xanth!mcnc!ecsvax!ruslan From: ruslan@ecsvax.UUCP (Robin C. LaPasha) Newsgroups: comp.sys.amiga.tech Subject: Re: OpenFont vs OpenDiskFont Summary: a question of sizes? Message-ID: <7459@ecsvax.UUCP> Date: 9 Aug 89 01:19:19 GMT References: <890804175711.2040019c@SIC.Epfl.CH> Organization: UNC Educational Computing Service Lines: 71 In article <890804175711.2040019c@SIC.Epfl.CH>, gay_d@elma.epfl.ch (David Gay) writes: > cmcmanis%pepper@sun.com (Chuck McManis) writes (some time ago): > > > >[...about opening and using non-ROM fonts...] > >[code deleted to save space] > >[further OpenDiskFont discussion deleted] > > Just another word of warning: if you want to open the same font in different > sizes, don't use the above approach. You'll get the font that is already > open :-( (ie, if you open helvetica 13, and then ask for helvetica 24, > you'll get helvetica 13 ...). > The following code will check the size of the returned font: > tf1 = OpenFont(&text_attr); > if (!tf1) > return OpenDiskFont(&text_attr); > else if (tf1->tf_YSize != text_attr.ta_YSize) > { > tf2 = OpenDiskFont(&text_attr); > > if (tf2) > { > CloseFont(tf1); > return tf2; > } > else > return tf2; > } > else > return tf1; > > >--Chuck McManis > >uucp: {anywhere}!sun!cmcmanis BIX: cmcmanis ARPAnet: cmcmanis@sun.com > David Gay > GAY_D@ELMA.EPFL.CH, or GAY_D%ELMA.EPFL.CH@CLSEPF51.bitnet Can you folks suggest (or offer) a code example of how to manage a window or screen with proportional fonts of different sizes? How would you control vertical scrolling with a NotePad-style setup? Like, would it be easier to have the users "pre-select" the fonts and sizes they're going to use before the text is typed, so that the maximum size (and scrolling) could be calculated in advance? (Granted, a big difference in sizes could make a mixed-font text look quite strange.) (If the problem of scrolling and sizes is complex beyond belief just laugh and try to be kind in telling me so...) Any pointers to Fish Disks or other freebies are welcome. Thanks in advance. (filler) (for) (inews) -- =-=-=-=-=-=-=- Robin LaPasha |Deep-Six your ruslan@ecsvax.uncecs.edu |files with VI! ;^) ;^) ;^)