Changeset 8765 in orxonox.OLD for trunk/src/lib/graphics/text_engine/font.cc
- Timestamp:
- Jun 24, 2006, 3:49:33 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/text_engine/font.cc
r8764 r8765 192 192 void Font::setStyle(const std::string& renderStyle) 193 193 { 194 this->data->setStyle(renderStyle); 194 /// FIXME 195 //this->data->setStyle(renderStyle); 195 196 } 196 197 … … 207 208 * @param fileName the File to write the image into. 208 209 */ 209 void Font::createAsciiImage(const std::string& fileName, unsigned int size) const 210 { 211 if (this->data->fontTTF == NULL) 210 void Font::createAsciiImage(const std::string& ttfFile, const std::string& fileName, unsigned int size) 211 { 212 TTF_Font* fontTTF = TTF_OpenFont(ttfFile.c_str(), size); 213 214 if (fontTTF == NULL) 212 215 return; 213 int height = this->getMaxHeight();216 int height = TTF_FontHeight(fontTTF); 214 217 215 218 // … … 241 244 { 242 245 SDL_Surface* glyphSurf = NULL; 243 if (likely(this->data->fontTTF != NULL)) 244 { 245 SDL_Color white = {255, 255, 255}; 246 glyphSurf = TTF_RenderGlyph_Blended(this->data->fontTTF, posX+size*posY, white); 247 } 246 SDL_Color white = {255, 255, 255}; 247 glyphSurf = TTF_RenderGlyph_Blended(fontTTF, posX+size*posY, white); 248 248 249 if( glyphSurf != NULL ) 249 250 { … … 259 260 SDL_SaveBMP(tmpSurf, fileName.c_str()); 260 261 SDL_FreeSurface(tmpSurf); 262 263 TTF_CloseFont(fontTTF); 261 264 } 262 265 … … 273 276 PRINT(0)("TEST %p and %p\n", this->data.get(), this->data->texData.get()); 274 277 // print the loaded font's style 275 int style = TTF_STYLE_NORMAL;278 /* int style = TTF_STYLE_NORMAL; 276 279 if (likely(this->data->fontTTF != NULL)) 277 280 style = TTF_GetFontStyle(this->data->fontTTF); … … 286 289 PRINTF(0)(" italic"); 287 290 if(style&TTF_STYLE_UNDERLINE) 288 PRINTF(0)(" underline"); 289 }291 PRINTF(0)(" underline");*/ 292 // } 290 293 PRINTF(0)("\n"); 291 294 }
Note: See TracChangeset
for help on using the changeset viewer.