Go to the documentation of this file.00001 #ifndef WIT_FONT_H
00002 #define WIT_FONT_H
00003
00004 #include <string>
00005 #ifdef WIT_USE_QT
00006 #include <wit.h>
00007 #else
00008 #include <ogc/gx.h>
00009 #endif
00010
00011 namespace wit {
00012
00013 struct FontSymbol {
00014 FontSymbol();
00015 char* data;
00016 signed char texWidth, texHeight, leftBearing, charWidth;
00017 };
00018
00019 class FontPrivate;
00020 class Font {
00021 public:
00022 Font();
00023 Font(const std::string& fontName, bool bold = false, bool italic = false);
00024 ~Font();
00025
00026 void setChar(unsigned char symbol, int texWidth, int texHeight, char* data, int leftBearing, int width);
00027 FontSymbol charData(unsigned char symbol) const;
00028
00029 void registerFont(const std::string& fontName, bool bold, bool italic, int wordSpacing);
00030
00031 bool isValid() const;
00032
00033 float draw(float x, float y, const std::string& text, const GXColor& color);
00034
00035 private:
00036 FontPrivate* d;
00037 };
00038
00039 }
00040
00041 #endif