Changeset 8755 in orxonox.OLD for branches/fontdata/src/lib/graphics/text_engine/font.h
- Timestamp:
- Jun 23, 2006, 8:24:28 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/fontdata/src/lib/graphics/text_engine/font.h
r8754 r8755 11 11 #define _FONT_H 12 12 13 #include " texture.h"13 #include "material.h" 14 14 15 15 #include "font_data.h" … … 17 17 18 18 //! A class to handle a Font of a certain ttf-File/image-file, Size. 19 class Font : public Texture19 class Font : public BaseObject /* TODO Material it should be */ 20 20 { 21 21 22 22 public: 23 23 Font(); 24 Font(const std::string& fontFile, 25 unsigned int renderSize); 24 Font(const std::string& fontFile, unsigned int renderSize); 26 25 Font(const std::string& imageFile); 27 26 Font(char** xpmArray); … … 31 30 bool operator==(const Font& font) const { return this->data == font.data; }; 32 31 33 // font 32 33 /// LOADING new Fonts 34 34 bool loadFontFromTTF(const std::string& fontFile); 35 35 bool loadFontFromSDL_Surface(SDL_Surface* surface); … … 42 42 inline TTF_Font* getTTF() const { return this->data->getTTF(); }; 43 43 44 inline GLuint getTexture() const { return this->data->getTexture(); }; 45 46 44 47 int getMaxHeight() const; 45 48 int getMaxAscent() const; … … 49 52 //inline static Font* getDefaultFont() { if (Font::defaultFont == NULL) initDefaultFont(); return Font::defaultFont; }; 50 53 51 52 53 54 void createAsciiImage(const std::string& fileName, unsigned int size) const; 54 55 55 56 void debug() const ; 57 56 58 private: 57 59 void init(); … … 60 62 bool createFastTexture(); 61 63 62 63 64 void initGlyphs(Uint16 from, Uint16 count); 64 65 int findOptimalFastTextureSize(); 65 66 66 67 static FontDataPointer initDefaultFont(); 67 static void initDefaultFont(); 68 68 69 69 private:
Note: See TracChangeset
for help on using the changeset viewer.