fontvga.h

Go to the documentation of this file.
00001 
00007 #ifndef INCL_FONTVGA
00008 #define INCL_FONTVGA  1
00009 
00010 /*
00011 Copyright (C) 1998  Jeffrey S. Freedman
00012 
00013 This program is free software; you can redistribute it and/or
00014 modify it under the terms of the GNU General Public License
00015 as published by the Free Software Foundation; either version 2
00016 of the License, or (at your option) any later version.
00017 
00018 This program is distributed in the hope that it will be useful,
00019 but WITHOUT ANY WARRANTY; without even the implied warranty of
00020 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021 GNU General Public License for more details.
00022 
00023 You should have received a copy of the GNU General Public License
00024 along with this program; if not, write to the Free Software
00025 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00026 */
00027 
00028 #include "font.h"
00029 #include "vgafile.h"
00030 
00031 /*
00032  *  The "fonts.vga" file:
00033  */
00034 class Fonts_vga_file : public Vga_file
00035   {
00036   Font fonts[11];     // Fonts from fonts.vga file.
00037 public:
00038   Fonts_vga_file()
00039     {  }
00040   void init();
00041           // Text rendering:
00042   int paint_text_box(Image_buffer8 *win, int fontnum, 
00043     const char *text, int x, int y, int w, 
00044     int h, int vert_lead = 0, int pbreak = 0)
00045     { return fonts[fontnum].paint_text_box(win, text, x, y, w, h,
00046             vert_lead, pbreak); }
00047   int paint_text(Image_buffer8 *win, int fontnum, 
00048     const char *text, int xoff, int yoff)
00049     { return fonts[fontnum].paint_text(win, text, xoff, yoff); }
00050   int paint_text(Image_buffer8 *win, int fontnum, 
00051     const char *text, int textlen, int xoff, int yoff)
00052     { return fonts[fontnum].paint_text(win, text, textlen,
00053                 xoff, yoff); }
00054           // Get text width.
00055   int get_text_width(int fontnum, const char *text)
00056     { return fonts[fontnum].get_text_width(text); }
00057   int get_text_width(int fontnum, const char *text, int textlen)
00058     { return fonts[fontnum].get_text_width(text, textlen); }
00059           // Get text height, baseline.
00060   int get_text_height(int fontnum)
00061     { return fonts[fontnum].get_text_height(); }
00062   int get_text_baseline(int fontnum)
00063     { return fonts[fontnum].get_text_baseline(); }
00064 
00065   Font *get_font(int fontnum)
00066     { return fontnum>=0&&fontnum<8?fonts+fontnum:NULL; };
00067   };
00068 
00069 #endif

Generated on Mon Jul 9 14:42:50 2007 for ExultEngine by  doxygen 1.5.1