Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7449 in orxonox.OLD for trunk/src/lib/graphics


Ignore:
Timestamp:
Apr 29, 2006, 8:22:14 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: dafaultFont(xpm/SDL_Surface) renders again

Location:
trunk/src/lib/graphics/text_engine
Files:
2 edited

Legend:

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

    r7432 r7449  
    3232
    3333/**
    34  * constructs a Font out of a TTF-FIle
     34 * @brief constructs a Font out of a TTF-FIle
    3535 * @param fontFile the File to load the font from
    3636 * @param fontSize the Size of the Font in Pixels
     
    4848
    4949/**
    50  * constructs a Font out of an ImageFile
     50 * @brief constructs a Font out of an ImageFile
    5151 * @param imageFile the ImageFile to load the Font From.
    5252 */
     
    7171
    7272/**
    73  * constructs a Font
     73 * @brief constructs a Font
    7474 * @param xpmArray the xpm-ARRAY to load the font from
    7575 */
     
    9393
    9494/**
    95  * destructs a font
     95 * @brief destructs a font
     96 *
    9697 * this releases the memory a font uses to be opened.
    9798 * deletes the glLists, and the TTF-handler, if present.
     
    105106    {
    106107      if (this->glyphArray[i] != NULL)
    107       {
    108108        delete this->glyphArray[i];
    109       }
    110109    }
    111110    delete[] this->glyphArray;
     
    123122
    124123/**
    125  * initializes a Font (with default values)
     124 * @brief initializes a Font (with default values)
    126125 */
    127126void Font::init()
     
    166165
    167166/**
    168  * loads a font From an XPM-array.
     167 * @brief loads a font From an XPM-array.
    169168 * @param xpmArray the array of the XPM to load the font from.
    170169 */
     
    203202      tmpGlyph->texCoord[0] = cx;
    204203      tmpGlyph->texCoord[1] = cx+0.0625f;
    205       tmpGlyph->texCoord[2] = cy+0.001f;
     204      tmpGlyph->texCoord[2] = cy;
    206205      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;
    212215    }
    213216  }
  • trunk/src/lib/graphics/text_engine/font.h

    r7430 r7449  
    6161    virtual ~Font();
    6262
    63     void init();
    64 
    6563  //  font
    6664    bool loadFontFromTTF(const std::string& fontFile);
     
    8280
    8381  private:
     82    void init();
    8483    int getMaxHeight() const;
    8584    int getMaxAscent() const;
Note: See TracChangeset for help on using the changeset viewer.