Path: news1.icaen!news.uiowa.edu!news1.chicago.iagnet.net!iagnet.net!128.223.220.30!logbridge.uoregon.edu!news.uoregon.edu!!nparker From: nparker@inferno.uoregon.edu (Neil Parker) Newsgroups: comp.sys.apple2.programmer Subject: Re: Font ID numbers Date: 30 Dec 1997 09:26:21 GMT Organization: Me? Organized? Surely you jest. Lines: 39 Message-ID: <68aent$spc$1@pith.uoregon.edu> References: <689r1e$c8q@examiner.concentric.net> NNTP-Posting-Host: ssil.uoregon.edu X-Trace: pith.uoregon.edu 883473981 29484 nparker 128.223.108.115 X-Complaints-To: usenet@news.uoregon.edu Originator: nparker@ Xref: news1.icaen comp.sys.apple2.programmer:9601 In article <689r1e$c8q@examiner.concentric.net>, ericlob wrote: >Ok, I've finally had time to work on my current project (FONTPiMP) and >have gotten to the point that I need to have some means to check whether a >font number is being used (since I have to make one up, and the old font >will be replaced by the new one if they have the same number). > >Any ideas? Is there a system call (or means to query Pointless) to check >on whether a currently loaded font has the same number? There are a couple of Font Manager calls that might help. FindFamily ($0A1B) lets you step through the list of currently installed fonts. famNum = FindFamily(famSpecBits, positionNum, namePtr); For example, word famNum, i = 0; char fontName[27]; for(i = 0; i<=CountFamilies(0); i++) { famNum = FindFamily(0, i, fontName); fontName[fontName[0]+1] = '\0'; printf("font %d: ID=%x, name=%s\n", i, famNum, &fontName[1]); } GetFamInfo ($0B1B) returns a FamStatBits and the font's name if the specified family number is installed, or an error if it isn't. statBits = GetFamInfo(famNum, namePtr); - Neil Parker -- Neil Parker, nparker@inferno.uoregon.edu, nparker@axis.llx.com, http://axis.llx.com/~nparker/ (Note new addresses and home page!) Unsolicited commerical e-mail is not welcome, and will be discarded unread.