comparison engine/core/video/fonts/fonts.i @ 0:4a0efb7baf70

* Datasets becomes the new trunk and retires after that :-)
author mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
date Sun, 29 Jun 2008 18:44:17 +0000
parents
children 90005975cdbb
comparison
equal deleted inserted replaced
-1:000000000000 0:4a0efb7baf70
1 /***************************************************************************
2 * Copyright (C) 2005-2008 by the FIFE team *
3 * http://www.fifengine.de *
4 * This file is part of FIFE. *
5 * *
6 * FIFE is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the *
18 * Free Software Foundation, Inc., *
19 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
20 ***************************************************************************/
21
22 %module fife
23 %{
24 #include "video/fonts/abstractfont.h"
25 #include "video/fonts/fontbase.h"
26 #include "video/fonts/truetypefont.h"
27 #include "video/fonts/subimagefont.h"
28
29 %}
30 typedef unsigned char Uint8;
31
32 namespace FIFE {
33 class AbstractFont {
34 public:
35 virtual ~AbstractFont();
36 virtual void setRowSpacing (int spacing) = 0;
37 virtual int getRowSpacing() const = 0;
38 virtual void setGlyphSpacing(int spacing) = 0;
39 virtual int getGlyphSpacing() const = 0;
40 virtual void setAntiAlias(bool antiAlias) = 0;
41 virtual bool isAntiAlias() = 0;
42 virtual void setColor(uint8_t r,uint8_t g,uint8_t b) = 0;
43 virtual SDL_Color getColor() const = 0;
44 virtual int getWidth(const std::string& text) const = 0;
45 virtual int getHeight() const = 0;
46 };
47
48 class FontBase: public AbstractFont {
49 public:
50 virtual ~FontBase(){ }
51 };
52
53 %feature("notabstract") TrueTypeFont;
54 %rename(TTFont) TrueTypeFont;
55 class TrueTypeFont: public FontBase {
56 public:
57 TrueTypeFont(const std::string& filename, int size);
58 virtual ~TrueTypeFont();
59 virtual void setColor(Uint8 r, Uint8 g, Uint8 b);
60 virtual int getWidth(const std::string& text) const;
61 virtual int getHeight() const;
62 };
63
64 class ImagePool;
65 %feature("notabstract") SubImageFont;
66 class SubImageFont: public FontBase {
67 public:
68 SubImageFont(const std::string& filename, const std::string& glyphs, ImagePool& pool);
69 virtual ~SubImageFont();
70 virtual void setColor(Uint8 r, Uint8 g, Uint8 b);
71 virtual int getWidth(const std::string& text) const;
72 virtual int getHeight() const;
73 };
74 }