home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.apple2
- Path: sparky!uunet!cs.utexas.edu!oakhill!jasonp
- From: jasonp@oakhill.sps.mot.com (Jason Perez)
- Subject: how do i generate fonts w/toolbox
- Message-ID: <1992Jul28.161546.6872@oakhill.sps.mot.com>
- Keywords: fonts orca/c
- Reply-To: jasonp@gollum.UUCP (Jason Perez)
- Organization: Motorola Inc., Austin, Texas
- Date: Tue, 28 Jul 1992 16:15:46 GMT
- Lines: 41
-
- i've been struggling with the toolbox to generate fonts and i'm up against
- a brick wall! how does one go about generating fonts to memory that aren't in
- the */system/fonts folder. i've tried using InstallFont, and have successfully
- generated different *point* sizes (with the help of Pointless), but i've not been
- able to generate fonts with different styles, like bold+italic. the following code
- segment shows how i'm trying to do it (orca/c 1.3):
-
- FontID menuFont;
- FontHndl fonthandlex; /* handle required for AddFontVar*/
-
- menuFont.fidRec.famNum = GetFamNum("\pCourier");
- menuFont.fidRec.fontStyle = 0x0003; /* bold+italic*/
- menuFont.fidRec.fontSize = 0x000c; /* 12 point*/
-
- InstallFont(menuFont.fidRec,0x0000);
- (*fonthandlex)->style = menuFont.fidRec.fontStyle; /* set up handle for*/
- (*fonthandlex)->family = menuFont.fidRec.fontStyle; /* AddFontVar */
- (*fonthandlex)->size = menuFont.fidRec.fontStyle;
- AddFontVar(fonthandlex,0x0002);
- FMSetSysFont(menuFont.fidRec);
-
-
- that's it. incidentally, i had to modify the control.h file because it #define(d)
- family, which also happens to be a variable name, so i could get the code to compile
- correctly. i've assigned the font handle info to be the same as the fontID info. what
- happens is that InstallFont will seemingly do nothing, as it can't find a bold+italic
- Courier font (if it's only bold, a 12 point font will be generated,as Courier Bold is in
- the */system/fonts folder). AddFontVar gives me error $1b04-family not found. i still
- get this error if i give it a font that *is* already in the fonts folder. FMSetSysFont give
- me an error-Font not found, obviously, since it wasn't installed.
- what is the proper procedure to generate new font styles that aren't in the fonts folder?
- and once it's generated, how do i get this font to be the font in the system menu bar?
- FMSetSysFont doesn't change the menubar font as far as i can tell. i'm calling this function
- before i set up the menus, but orca's startdesk(640) function has already drawn the menubar
- frame, so do i need to call FMSetSysFont before startdesk calls DrawMenuBar?
-
- --
- Jason Perez |
- jasonp@gollum.sps.mot.com | "Gig 'em!" "Frodo lives!"
- j0p7771@sigma.tamu.edu | "Don't have a cow man!"
- ________________________________________|______________________________________
-