libmoldeo (Moldeo 1.0 Core)  1.0
libmoldeo es el conjunto de objetos y funciones, que permiten ejecutar las operaciones básicas de la plataforma Moldeo, y que compone su núcleo.
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Amigas 'defines' Grupos Páginas
moFontManager.h
Ir a la documentación de este archivo.
1 /*******************************************************************************
2 
3  moFontManager.h
4 
5  ****************************************************************************
6  * *
7  * This source is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This code is distributed in the hope that it will be useful, but *
13  * WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
15  * General Public License for more details. *
16  * *
17  * A copy of the GNU General Public License is available on the World *
18  * Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
19  * obtain it by writing to the Free Software Foundation, *
20  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21  * *
22  ****************************************************************************
23 
24  Copyright(C) 2006 Fabricio Costa
25 
26  Authors:
27  Fabricio Costa
28 
29 *******************************************************************************/
30 
31 #ifndef __MOFONTMANAGER_H
32 #define __MOFONTMANAGER_H
33 
34 #include "moTypes.h"
35 #include "moResourceManager.h"
36 
37 
38 typedef void moFontFace;
39 
44 
45 enum moFontType {
56 };
57 
58 
60 
64 
65  public:
66  moFont();
67  virtual ~moFont();
68 
69  moFont(const moFont& src) {
70  (*this) = src;
71  }
72  moFont& operator = (const moFont& src) {
73  m_Name = src.m_Name;
74  m_FontSize = src.m_FontSize;
75  m_pFace = src.m_pFace;
76  m_GLBaseList = src.m_GLBaseList;
77  m_FontGLId = src.m_FontGLId;
78 
79  return (*this);
80  }
81 
82  virtual MOboolean Init();
83  virtual MOboolean Init( moFontType p_Type, moText p_fontname /*or font bitmap name*/, MOint p_size, MOuint glid = 0 );
84  virtual MOboolean Finish();
85 
86  moText GetName();
87 
88  void SetSize( MOfloat size );
89  void Draw( MOfloat x, MOfloat y, moText& text );
90  void Draw( MOfloat x, MOfloat y, moText& text, moFontSize p_fontsize, MOint set=0, MOfloat sx=1.0, MOfloat sy=1.0, MOfloat rt=0.0 );
91 
92  void SetForegroundColor( MOfloat p_r, MOfloat p_g, MOfloat p_b);
93  void SetHorizontalJustification( int p_horizontal_justification);
94  void SetStringRotation( MOfloat p_string_rotation );
95 
96  protected:
97 
100 
101  //Abstract instantiation of faces:
103 
104  //glPrint implementation
105  void BuildFont();
106  void glPrint( GLint x, GLint y, char *string, int set, float scx, float scy, float rt );
107  void KillFont();
108 
109  GLuint m_GLBaseList; // Base Display List For The Font
110  GLuint m_FontGLId;
111 
112 };
113 
115 
117 
121 
122  public:
123  moFontManager();
124  virtual ~moFontManager();
125  virtual MOboolean Init();
126  virtual MOboolean Finish();
127 
128  moFontType GetFontType( moText fonttype );
129 
130  moFont* GetFont( moText p_fontname, bool create = false, moFontType p_fonttype = MO_FONT_OUTLINE, MOfloat p_fontsize = 12 );
131  moFont* GetFont( MOint p_id );
132  moFont* GetFont( moValue& p_value, bool create = true );
133 
134  moFonts* GetFonts();
135  moFont* AddFont( moText p_fontname, moText p_fonttype="OUTLINE", MOfloat p_fontsize = 12 );
136  moFont* AddFont( moText p_fontname, moFontType p_fonttype = MO_FONT_OUTLINE, MOfloat p_fontsize = 12 );
137  void AddFont( moFont* p_pFont );
138 
139  private:
140 
141  moFont* LoadFont( moText p_fontname_path, moFontType p_fonttype = MO_FONT_OUTLINE, MOfloat p_fontsize = 12 );
142 
143  moFonts m_Fonts;
144 };
145 
146 
147 #endif
148 
Valor de un Parámetro.
Definition: moValue.h:501
Recurso ( objeto para cargar y manipular objetos físicos de datos de imágenes, audio, video, 3d, 2d, fuentes, shaders y de cualquier otro tipo extendible por un plugin )
clase base para una fuente 3d o 2d
Definition: moFontManager.h:63
virtual MOboolean Finish()
Finaliza el objeto, libera recursos.
Definition: moAbstract.cpp:147
#define MOboolean
Definition: moTypes.h:385
moDeclareExportedDynamicArray(moFont *, moFonts)
function x(bx)
Definition: jquery.js:30
moText m_Name
Definition: moFontManager.h:98
administrator de fuentes
Clase base abstracta de donde deben derivar los objetos [virtual pura].
Definition: moAbstract.h:191
virtual MOboolean Init()
Inicializa el objeto.
Definition: moAbstract.cpp:141
#define LIBMOLDEO_API
Definition: moTypes.h:180
#define MOfloat
Definition: moTypes.h:403
virtual MOboolean Init()
GLuint m_FontGLId
clase de para manejar textos
Definition: moText.h:75
MOfloat moFontSize
Definition: moFontManager.h:43
#define MOint
Definition: moTypes.h:388
moFont(const moFont &src)
Definition: moFontManager.h:69
GLuint m_GLBaseList
moFontType
Definition: moFontManager.h:45
virtual MOboolean Finish()
moMatrix3 & operator=(const moMatrix3 &rkM)
#define MOuint
Definition: moTypes.h:387
void moFontFace
Definition: moFontManager.h:38
moFontSize m_FontSize
Definition: moFontManager.h:99
moFontFace * m_pFace