home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / TRSICAT.LZX / CATS_CD2_TRSI / Reference_Library / lib_examples / pseudotext.c.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-21  |  951 b   |  42 lines

  1. /* pseudotext.c */
  2.  
  3. void main(void, void)
  4. {
  5.     struct TextAttr myta = {
  6.         "topaz.font"
  7.         11,
  8.         FSF_ITALIC | FSF_BOLD,
  9.         NULL
  10.     };
  11.  
  12.     struct TextFont *myfont, *oldfont;
  13.     struct RastPort *myrp;
  14.     struct Window   *mywin;
  15.  
  16.     . . .
  17.  
  18.     /* open the graphics and diskfont libraries and whatever else you may need */
  19.     . . .
  20.  
  21.     if (myfont = OpenDiskFont(&myta))
  22.     {
  23.         /* you would probably set the font of the rastport you are going to use */
  24.         myrp    = mywin->RPort
  25.         oldfont = myrp->Font;
  26.         SetFont(myrp, myfont);
  27.  
  28.         . . .
  29.  
  30.         /* perform whatever drawing you need to do */
  31.  
  32.         . . .
  33.  
  34.         /* time to clean up.  If the rastport is not exclusively yours,
  35.            you may need to restore the original font or other Rasport values */
  36.         SetFont(myrp, oldfont);
  37.         CloseFont(myfont);
  38.     }
  39.  
  40.     /* close whatever libraries and other resources you allocated */
  41. }
  42.