home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dokpr1.zip / font.h < prev    next >
C/C++ Source or Header  |  1995-10-18  |  3KB  |  92 lines

  1. /**************************************************************************
  2.  *                                                                        *
  3.  *                                                                        *
  4.  *          This code is copyright (c) 1994 & 1995                        *
  5.  *                     Athena Design, Inc.                                *
  6.  *                                                                        *
  7.  *                                                                        *
  8.  *                ALL RIGHTS RESERVED                                     *
  9.  *                                                                        *
  10.  *                                                                        *
  11.  *                                                                        *
  12.  *                                                                        *
  13.  *                                                                        *
  14.  **************************************************************************/
  15.  
  16. /*
  17.     holds the font information for a given font
  18.     5-31-94 dpp
  19.  
  20.     modify to init from OS/2 font names dpp 8/14/94
  21.     94-09-19 dpp added operator=()
  22. */
  23.  
  24. #ifndef _MH_font
  25.  
  26. #define _MH_font
  27.  
  28. #include "mlib.h"
  29.  
  30. class MStream;
  31.  
  32. #define MMaxFontInfo 4
  33.  
  34. class MFont {
  35.     public:
  36.     void init();
  37.     void init(MStream *);
  38.     void init(const MFont *);
  39.     void write(MStream *) const;
  40.  
  41.     // initialize the font from an OS/2 font name string
  42.     // 12. Tms Roman.
  43.     void init(const char *);
  44.  
  45.     
  46.     void getSystemName( char * buf) const;
  47.  
  48.     void free() {};
  49.     int operator==(const MFont &f) const
  50.         {return (size == f.size && !MStrCmp(fontName,f.fontName));};
  51.     MFont &operator=(const MFont &);
  52.     MFont &operator=(const MFont *);
  53.  
  54.     const char *getName() const {return fontName;};
  55.     void getBaseName(char *s) const;
  56.     int getSize() const {return size;};
  57.     void setName(const char *);
  58.     void setSize(int);
  59.     void makeBold(int);
  60.     void makePlain(int);
  61.     void makeItalic(int);
  62.  
  63.     int makeBitmap();
  64.     int makeVector();
  65.  
  66.     int isBitmapAllowed() const { return bitmapAllowed; };
  67.  
  68.     int isBold() const;
  69.     int isItalic() const;
  70.  
  71.     // use for internal caching stuff
  72.     int getInfo(int n) const {return info[n];};
  73.     void setInfo(int n,int i) {info[n] = i;};
  74.  
  75.     int getCacheNum() const { return cacheNum;};
  76.     void setCacheNum( int i) const;
  77.  
  78.     private:
  79.     int size;
  80.     char fontName[60];
  81.     int bitmapAllowed;
  82.     int info[MMaxFontInfo];
  83.     int cacheNum;
  84. };
  85.  
  86. const int CACHE_NOT_CHECKED = -1;
  87. const int NOT_IN_CACHE = -2;
  88.  
  89. //ifndef _MH_font
  90. #endif
  91.  
  92.