gui: implemented ItemView, a scrollable view of any type of control backed by an...
[fail.git] / src / scenegraph / Font.h
blob7264f73fe901d60d14a7b548154ea825b448bfac
1 /*
2 Fail game engine
3 Copyright 2007 Antoine Chavasse <a.chavasse@gmail.com>
5 This file is part of Fail.
7 Fail is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 3
9 as published by the Free Software Foundation.
11 Fail is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef FAIL_SCENEGRAPH_FONT_H_
20 #define FAIL_SCENEGRAPH_FONT_H_
22 #include "core/core.h"
23 #include "scenegraph/scenegraph_export.h"
24 #include <string>
25 #include <math.h>
27 class FTGLTextureFont;
29 namespace fail { namespace scenegraph
31 class FLSCENEGRAPH_EXPORT Font : public RefCounted
33 public:
34 Font( std::string Filename_, uint32_t Size_ );
35 ~Font();
36 void drawText( const std::string& Text_ ) const;
38 float getHeight() const
40 return m_Height; //floor( m_FTGLFont.Ascender() + 0.5 );
43 float getTextWidth( const std::string& Text_ ) const;
45 private:
46 FTGLTextureFont* m_pFTGLFont;
47 float m_Height;
48 float m_Offset;
52 #endif