Changeset 7449 in orxonox.OLD for trunk/src/lib/graphics/text_engine
- Timestamp:
- Apr 29, 2006, 8:22:14 PM (19 years ago)
- Location:
- trunk/src/lib/graphics/text_engine
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/text_engine/font.cc
r7432 r7449 32 32 33 33 /** 34 * constructs a Font out of a TTF-FIle34 * @brief constructs a Font out of a TTF-FIle 35 35 * @param fontFile the File to load the font from 36 36 * @param fontSize the Size of the Font in Pixels … … 48 48 49 49 /** 50 * constructs a Font out of an ImageFile50 * @brief constructs a Font out of an ImageFile 51 51 * @param imageFile the ImageFile to load the Font From. 52 52 */ … … 71 71 72 72 /** 73 * constructs a Font73 * @brief constructs a Font 74 74 * @param xpmArray the xpm-ARRAY to load the font from 75 75 */ … … 93 93 94 94 /** 95 * destructs a font 95 * @brief destructs a font 96 * 96 97 * this releases the memory a font uses to be opened. 97 98 * deletes the glLists, and the TTF-handler, if present. … … 105 106 { 106 107 if (this->glyphArray[i] != NULL) 107 {108 108 delete this->glyphArray[i]; 109 }110 109 } 111 110 delete[] this->glyphArray; … … 123 122 124 123 /** 125 * initializes a Font (with default values)124 * @brief initializes a Font (with default values) 126 125 */ 127 126 void Font::init() … … 166 165 167 166 /** 168 * loads a font From an XPM-array.167 * @brief loads a font From an XPM-array. 169 168 * @param xpmArray the array of the XPM to load the font from. 170 169 */ … … 203 202 tmpGlyph->texCoord[0] = cx; 204 203 tmpGlyph->texCoord[1] = cx+0.0625f; 205 tmpGlyph->texCoord[2] = cy +0.001f;204 tmpGlyph->texCoord[2] = cy; 206 205 tmpGlyph->texCoord[3] = cy+0.0625f; 207 tmpGlyph->width = 1; 208 tmpGlyph->advance = 1; 209 tmpGlyph->bearingX = 1; 210 tmpGlyph->bearingY = 1; 211 tmpGlyph->height = 1; 206 tmpGlyph->minX = 0.0f; 207 tmpGlyph->maxX = 1.0f; 208 tmpGlyph->minY = 0.0f; 209 tmpGlyph->maxY = 1.0f; 210 tmpGlyph->width = 1.0f; 211 tmpGlyph->advance = 1.0f; 212 tmpGlyph->bearingX = 0.0f; 213 tmpGlyph->bearingY = 0.0f; 214 tmpGlyph->height = 1.0f; 212 215 } 213 216 } -
trunk/src/lib/graphics/text_engine/font.h
r7430 r7449 61 61 virtual ~Font(); 62 62 63 void init();64 65 63 // font 66 64 bool loadFontFromTTF(const std::string& fontFile); … … 82 80 83 81 private: 82 void init(); 84 83 int getMaxHeight() const; 85 84 int getMaxAscent() const;
Note: See TracChangeset
for help on using the changeset viewer.