home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / apple2 / 18003 < prev    next >
Encoding:
Text File  |  1992-07-28  |  2.7 KB  |  53 lines

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