source: abuse/tags/pd/macabuse/imlib/include/fonts.hpp @ 49

Last change on this file since 49 was 49, checked in by Sam Hocevar, 11 years ago
  • Imported original public domain release, for future reference.
File size: 913 bytes
Line 
1#ifndef __FONTS_HPP_
2#define __FONTS_HPP_
3#include "image.hpp"
4#include "timage.hpp"
5
6
7
8class texture_font
9{
10  int tl,th;
11  image *let,*fntpat;
12public:
13  texture_font(image *letters, image *font_pattern=NULL);
14  void put_char(image *screen,  int x, int y, char ch);
15  void put_string(image *screen, int x, int y, char *st);
16  int height() { return th; }
17  int length() { return tl; }
18  int width() { return tl; }
19  image *font_image() { return let; }
20  image *font_patter() { return fntpat; }
21  ~texture_font() { if (let) delete let; if (fntpat) delete fntpat; }
22} ;
23
24class JCFont
25{
26  int tl,th;
27  trans_image *let[256];
28public:
29  JCFont(image *letters);
30  void put_char(image *screen,  int x, int y, char ch, int color=-1);
31  void put_string(image *screen, int x, int y, char *st, int color=-1);
32  int height() { return th; }
33  int length() { return tl; }
34  int width() { return tl; }
35  ~JCFont();
36} ;
37
38#endif
39
40
Note: See TracBrowser for help on using the repository browser.