Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8756 in orxonox.OLD


Ignore:
Timestamp:
Jun 23, 2006, 8:34:56 PM (18 years ago)
Author:
bensch
Message:

orxonox/font: ok, the font is rendering again

Location:
branches/fontdata/src/lib/graphics/text_engine
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/fontdata/src/lib/graphics/text_engine/font.cc

    r8755 r8756  
    5050
    5151  assert(data.get() != NULL);
    52   this->data->renderSize = renderSize;
     52
    5353  this->setStyle("c");
    5454
    5555  if (!fontFile.empty())
    56     this->loadFontFromTTF(fontFile);
     56    this->loadFontFromTTF(fontFile, renderSize);
    5757}
    5858
     
    150150 * @returns true if loaded, false if something went wrong, or if a font was loaded before.
    151151 */
    152 bool Font::loadFontFromTTF(const std::string& fontFile)
     152bool Font::loadFontFromTTF(const std::string& fontFile, unsigned int renderSize)
    153153{
    154154  this->data = FontDataPointer (new FontData());
    155155
    156156  this->setName(fontFile);
    157   this->data->fontTTF = TTF_OpenFont(this->getName(), this->data->renderSize);
     157  this->data->fontTTF = TTF_OpenFont(fontFile.c_str(), renderSize);
    158158
    159159  if(this->data->fontTTF != NULL)
  • branches/fontdata/src/lib/graphics/text_engine/font.h

    r8755 r8756  
    3232
    3333  /// LOADING new Fonts
    34   bool loadFontFromTTF(const std::string& fontFile);
     34  bool loadFontFromTTF(const std::string& fontFile, unsigned int renderSize);
    3535  bool loadFontFromSDL_Surface(SDL_Surface* surface);
    3636
  • branches/fontdata/src/lib/graphics/text_engine/font_data.cc

    r8751 r8756  
    3030  this->fontTTF = NULL;
    3131  this->glyphArray = NULL;
     32  this->renderStyle = TTF_STYLE_NORMAL;
     33  this->renderSize = FONT_DEFAULT_RENDER_SIZE;
    3234}
    3335
  • branches/fontdata/src/lib/graphics/text_engine/text.cc

    r8755 r8756  
    179179    if (newFont == NULL)
    180180    {
    181       //      newFont = Font::getDefaultFont();
     181//      newFont = &Font::();
    182182      PRINTF(2)("Font %s could not be loaded, probably file not found\n", fontFile.c_str());
    183183    }
     
    188188
    189189  // unloading the Font if we alrady have one loaded.
     190
    190191  this->_font = *newFont;
    191192//   if (oldFont != NULL && oldFont != Font::getDefaultFont())
Note: See TracChangeset for help on using the changeset viewer.