Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5368 in orxonox.OLD for trunk/src/lib/graphics/text_engine/font.h


Ignore:
Timestamp:
Oct 13, 2005, 12:00:01 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: rendering font with RenderSize, but not with TextSize. This makes the Font more controllable

File:
1 edited

Legend:

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

    r5367 r5368  
    3737  // Glyph-specific (size and so on)
    3838  Uint16   character;         //!< The character
    39   int      minX;              //!< The minimum distance from the origin in X
    40   int      maxX;              //!< The maximum distance from the origin in X
    41   int      minY;              //!< The minimum distance from the origin in Y
    42   int      maxY;              //!< The maximum distance from the origin in Y
    43   int      width;             //!< The width of the Glyph
    44   int      height;            //!< The height of the Glyph
    45   int      bearingX;          //!< How much is right of the Origin
    46   int      bearingY;          //!< How much is above the Origin
    47   int      advance;           //!< How big a Glyph would be in monospace-mode
     39  float    minX;              //!< The minimum distance from the origin in X
     40  float    maxX;              //!< The maximum distance from the origin in X
     41  float    minY;              //!< The minimum distance from the origin in Y
     42  float    maxY;              //!< The maximum distance from the origin in Y
     43  float    width;             //!< The width of the Glyph
     44  float    height;            //!< The height of the Glyph
     45  float    bearingX;          //!< How much is right of the Origin
     46  float    bearingY;          //!< How much is above the Origin
     47  float    advance;           //!< How big a Glyph would be in monospace-mode
    4848
    4949  GLfloat texCoord[4];        //!< Texture coordinates: 0:left, 1:right, 2: top, 3: bottom.
     
    5858  public:
    5959    Font(const char* fontFile,
    60          unsigned int fontSize);
     60         unsigned int renderSize);
    6161    Font(const char* imageFile);
    6262    Font(char** xpmArray);
     
    6666
    6767  // font
    68     bool loadFont(const char* fontFile);
     68    bool loadFontFromTTF(const char* fontFile);
    6969    bool loadFontFromSDL_Surface(SDL_Surface* surface);
    7070
    71     void setSize(unsigned int fontSize);
    7271    void setStyle(const char* renderStyle);
    7372
     
    8281    static void initDefaultFont();
    8382    static void removeDefaultFont();
     83
    8484
    8585  private:
     
    9999    static Font*  defaultFont;         //!< a default font, that is used, if other fonts were unable to be loaded.
    100100    // information about the Font
    101     TTF_Font*     font;                //!< The font we use for this.
    102     unsigned int  fontSize;            //!< The size of the font in pixels. each Font has one size.
     101    TTF_Font*     fontTTF;             //!< The font we use for this.
    103102    int           renderStyle;         //!< The Renderstyle
     103    unsigned int  renderSize;          //!< How big the Font should be rendered.
    104104
    105105    Glyph**       glyphArray;          //!< An Array of all the Glyphs stored in the Array of Glyphs.
Note: See TracChangeset for help on using the changeset viewer.