1 /*
2  * gltt graphics library
3  * Copyright (C) 1998-1999 Stephane Rehel
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the Free
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  */
19 
20 #ifndef __GLTTOutlineFont_h
21 #define __GLTTOutlineFont_h
22 
23 #ifndef __GLTTboolean_h
24 #include "GLTTboolean.h"
25 #endif
26 
27 class FTFace;
28 class FTInstance;
29 class FTFont;
30 
31 /////////////////////////////////////////////////////////////////////////////
32 
33 class GLTTOutlineFont
34 {
35 protected:
36   FTFace* face;
37 
38   FTInstance* instance;
39 
40   FTFont* font;
41 
42   GLTTboolean* loaded;
43   int list_base;
44 
45   double precision;
46 
47 public:
48   GLTTOutlineFont( FTFace* _face );
49 
50   virtual ~GLTTOutlineFont();
51 
52   void destroy();
53 
54   void setPrecision( double _precision );
55 
56   GLTTboolean create( int point_size );
57 
58   GLTTboolean loadGlyph( int i );
59   void load( int from = 0, int to = 255 );
60   void load( const char* text );
61 
getFont()62   FTFont* getFont() const
63     {
64     return font;
65     }
66 
67   void output( const char* text );
68 
69   int getHeight() const;
70   int getDescender() const;
71   int getWidth( const char* text );
72 };
73 
74 /////////////////////////////////////////////////////////////////////////////
75 
76 #endif // ifndef __GLTTOutlineFont_h
77