Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 24, 2006, 3:49:33 AM (19 years ago)
Author:
bensch
Message:

trunk: much better loading of the Font

File:
1 edited

Legend:

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

    r8764 r8765  
    5959  bool loadFontFromSDL_Surface(SDL_Surface* surface);
    6060
    61   void setStyle(const std::string& renderStyle);
     61  void setStyle(TTF_Font* font, const std::string& renderStyle);
    6262
    6363
     
    6565  /** @returns a Pointer to the Array of Glyphs */
    6666  inline Glyph** getGlyphArray() const { return this->glyphArray; };
    67   /** @returns the a pointer to the TTF */
    68   inline TTF_Font* getTTF() const { return this->fontTTF; };
    6967
    70   int getMaxHeight() const;
    71   int getMaxAscent() const;
    72   int getMaxDescent() const;
     68  int getMaxHeight() const { return maxHeight; };
     69  int getMaxAscent() const { return maxAscent; };
     70  int getMaxDescent() const { return maxDescent; };
    7371
    7472
     
    8280  FontData();
    8381
    84   void initGlyphs(Uint16 from, Uint16 count);
    85   bool getGlyphMetrics(Glyph* glyph, Uint16 character);
     82  void initGlyphs(TTF_Font* font, Uint16 from, Uint16 count);
     83  bool getGlyphMetrics(TTF_Font* font, Glyph* glyph, Uint16 character);
    8684
    8785  int findOptimalFastTextureSize();
    88   bool createFastTexture();
     86  bool createFastTexture(TTF_Font* font);
    8987
    9088private:
    91   TTF_Font*     fontTTF;             //!< The font we use for this.
     89  std::string   fontFile;            //!< The FileName the Font was loaded from.
     90
    9291  int           renderStyle;         //!< The Renderstyle
    9392  unsigned int  renderSize;          //!< How big the Font should be rendered.
    9493
    9594  Glyph**       glyphArray;          //!< An Array of all the Glyphs stored in the Array of Glyphs.
     95
     96  int           maxHeight;           //!< Max Height of the Font.
     97  int           maxAscent;           //!< Max Ascent of the Font.
     98  int           maxDescent;          //!< Max Desent of the Font.
    9699
    97100  TextureDataPointer   texData;
Note: See TracChangeset for help on using the changeset viewer.