home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / spmio10.zip / gcc2 / stdwin / stdfont.h < prev    next >
C/C++ Source or Header  |  1994-06-07  |  2KB  |  57 lines

  1. #ifndef include_stdfont_h
  2. #define include_stdfont_h
  3.  
  4. #define INCL_PM
  5. #include <os2.h>
  6.  
  7. class FontInformation
  8. {
  9.   int font_count;
  10.   FONTMETRICS *font_metrics;
  11.   long xres, yres;
  12.   const FONTMETRICS *default_font_set[256];
  13.   unsigned default_font_pointsize[256];
  14.   
  15.   // Function to find a font index that matches a desired font string
  16.   int find_match (const char *fontspec, unsigned *pointsize);
  17.   
  18. public:
  19.   FontInformation (HWND);
  20.   ~FontInformation ();
  21.  
  22.   // Function to install a font (referenced with a font index) into the
  23.   // set of fonts we want availible by default.  Returns a handle
  24.   // by which the font may be referred to in the future.
  25.   int install_font (const char *fontspec);
  26.   
  27.   // Remove a font from the default list of availible fonts.
  28.   void deinstall_font (int fonthandle);
  29.  
  30.   // Configure a HPS so that all of the fonts which are availible by
  31.   // default are availible
  32.   void make_fonts_availible (HPS hps);
  33.  
  34.   // Set the drawing font to a given font
  35.   void use_font (HPS hps, int fonthandle);
  36.  
  37.   // Access to font metric information
  38.   const FONTMETRICS *get_fontmetrics (int fonthandle);
  39.  
  40.   // Access size information about the default set of fonts
  41.   int get_font_height (int fonthandle);
  42.   int get_fonts_height ();
  43.   int get_font_width (int fonthandle);
  44.   int get_fonts_width ();
  45.   int get_font_descender (int fonthandle);
  46.   int get_fonts_descender ();
  47.  
  48.   // Find a text width in the currently selected font of an hps
  49.   static int string_width (HPS hps, int length, const char *text);
  50. };
  51.  
  52. extern FontInformation *desktop_fontinfo;
  53. void init_desktop_fontinfo ();
  54.  
  55.  
  56. #endif /* include_stdfont_h */
  57.