home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 199.lha / GimmeLib / font.c < prev    next >
C/C++ Source or Header  |  1988-12-27  |  1KB  |  64 lines

  1. /*
  2.  *  FILE: font.c
  3.  *  Support routines for accessign ROM or disk-based fonts.
  4.  *
  5.  *  Public Domain, but keep my name in it as the original author.
  6.  *  31-Aug-88    Jan Sven Trabandt   first release version
  7.  *  30-Sep-88    Jan Sven Trabandt   gimmeFont now alters given TextAttr
  8.  *  31-Oct-88    Jan Sven Trabandt   added gimmeFontLazy
  9.  */
  10.  
  11.  
  12. #include "gimmelib/gimmefuncs.h"
  13.  
  14.  
  15. struct TextFont *gimmeFont( textattr )
  16.     struct TextAttr *textattr;
  17. {
  18.     struct TextFont *tf;
  19.  
  20. #ifdef GIMME_WIMPY
  21.     if( !textattr ) {
  22.     return( NULL );
  23.     }
  24. #endif
  25.     tf = OpenDiskFont( textattr );
  26.     if( tf ) {
  27.     textattr->ta_YSize = tf->tf_YSize;
  28.     textattr->ta_Style = tf->tf_Style;
  29.     }
  30.     return( tf );
  31. } /* gimmeFont */
  32.  
  33.  
  34. struct TextFont *gimmeFontLazy( name, size )
  35.     UBYTE   *name;
  36.     UWORD   size;
  37. {
  38.     struct TextAttr ta;
  39.  
  40. #ifdef GIMME_WIMPY
  41.     if( !name ) {
  42.     return( NULL );
  43.     }
  44. #endif
  45.     ta.ta_Name = (STRPTR) name;
  46.     ta.ta_YSize = size;
  47.     ta.ta_Style = FS_NORMAL;
  48.     ta.ta_Flags = FPF_DISKFONT;
  49.     return( OpenDiskFont(&ta) );
  50. } /* gimmeFontLazy */
  51.  
  52.  
  53. short getRidOfFont( textfont )
  54.     struct TextFont *textfont;
  55. {
  56. #ifdef GIMME_WIMPY
  57.     if( !textfont ) {
  58.     return( -1 );
  59.     }
  60. #endif
  61.     CloseFont( textfont );
  62.     return( 0 );
  63. } /* getRidOfFont */
  64.