1 /* 2 * $Id: font.h,v 1.1.1.1 2002/08/18 17:28:53 aeneas Exp $ 3 * Copyright (c) 2002, Dominik Schnitzer <dominik@schnitzer.at> 4 * 5 * JFK - JFK Fucking Killerz, a massive multiplayer 2d shoot'em-up game 6 * http://relax.ath.cx/jfk/ 7 * 8 * This program is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation; either version 2 of the License, or 11 * (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU Library General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 */ 22 23 #ifndef JFK_FONT_H 24 #define JFK_FONT_H 25 26 #include <string> 27 #include "output.h" 28 29 using namespace std; 30 31 namespace JFK 32 { 33 namespace client 34 { 35 class font 36 { 37 public: 38 /* Load the given font */ 39 font(output* outp, string file); 40 ~font(); 41 42 /* Draw a string on the given position */ 43 void draw_text(int x, int y, string text); 44 get_height()45 int get_height() { return char_height; }; get_width()46 int get_width() { return char_width; }; 47 int get_textwidth(string text); 48 49 private: 50 output *out; 51 52 static const int MAX_CHARS = 95; 53 int char_width; 54 int char_height; 55 image fontset; 56 }; 57 } 58 } 59 60 #endif /* JFK_FONT_H */ 61