libmoldeo (Moldeo 1.0 Core)
1.0
libmoldeo is the group of objects and functions that executes the basic operations of Moldeo 1.0 Platform.
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
43
typedef
MOfloat
moFontSize
;
44
45
enum
moFontType
{
46
MO_FONT_OUTLINE
= 0,
47
MO_FONT_TRANSLUCENT
= 1,
48
MO_FONT_TRANSLUCENTTEXTURE
= 2,
49
MO_FONT_GRAYSCALE
= 3,
50
MO_FONT_MONOCHROME
= 4,
51
MO_FONT_SOLID
= 5,
52
MO_FONT_FILLED
= 6,
53
MO_FONT_GLBUILD
= 7,
54
MO_FONT_TYPES
= 8,
55
MO_FONT_UNDEFINED
=-1
56
};
57
58
60
63
class
LIBMOLDEO_API
moFont
:
public
moAbstract
{
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
98
moText
m_Name
;
99
moFontSize
m_FontSize
;
100
101
//Abstract instantiation of faces:
102
moFontFace
*
m_pFace
;
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
114
moDeclareExportedDynamicArray
(
moFont
*, moFonts);
115
117
120
class
LIBMOLDEO_API
moFontManager
:
public
moResource
{
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
moValue
Valor de un Parámetro.
Definition:
moValue.h:501
MO_FONT_GRAYSCALE
Definition:
moFontManager.h:49
MO_FONT_FILLED
Definition:
moFontManager.h:52
moResource
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 )
Definition:
moResourceManager.h:152
moFont
clase base para una fuente 3d o 2d
Definition:
moFontManager.h:63
moAbstract::Finish
virtual MOboolean Finish()
Finaliza el objeto, libera recursos.
Definition:
moAbstract.cpp:147
MOboolean
#define MOboolean
Definition:
moTypes.h:385
MO_FONT_TYPES
Definition:
moFontManager.h:54
moDeclareExportedDynamicArray
moDeclareExportedDynamicArray(moFont *, moFonts)
moFont::m_Name
moText m_Name
Definition:
moFontManager.h:98
moTypes.h
moFontManager
administrator de fuentes
Definition:
moFontManager.h:120
moAbstract
Clase base abstracta de donde deben derivar los objetos [virtual pura].
Definition:
moAbstract.h:191
moAbstract::Init
virtual MOboolean Init()
Inicializa el objeto.
Definition:
moAbstract.cpp:141
LIBMOLDEO_API
#define LIBMOLDEO_API
Definition:
moTypes.h:180
MOfloat
#define MOfloat
Definition:
moTypes.h:403
moResource::Init
virtual MOboolean Init()
Definition:
moResourceManager.cpp:64
moFont::m_FontGLId
GLuint m_FontGLId
Definition:
moFontManager.h:110
moText0
clase de para manejar textos
Definition:
moText.h:75
MO_FONT_UNDEFINED
Definition:
moFontManager.h:55
moFontSize
MOfloat moFontSize
Definition:
moFontManager.h:43
moResourceManager.h
MOint
#define MOint
Definition:
moTypes.h:388
moFont::moFont
moFont(const moFont &src)
Definition:
moFontManager.h:69
moFont::m_GLBaseList
GLuint m_GLBaseList
Definition:
moFontManager.h:109
moFontType
moFontType
Definition:
moFontManager.h:45
MO_FONT_GLBUILD
Definition:
moFontManager.h:53
MO_FONT_TRANSLUCENTTEXTURE
Definition:
moFontManager.h:48
MO_FONT_TRANSLUCENT
Definition:
moFontManager.h:47
moResource::Finish
virtual MOboolean Finish()
Definition:
moResourceManager.cpp:83
MO_FONT_MONOCHROME
Definition:
moFontManager.h:50
MO_FONT_OUTLINE
Definition:
moFontManager.h:46
MO_FONT_SOLID
Definition:
moFontManager.h:51
moFontManager::m_Fonts
moFonts m_Fonts
Definition:
moFontManager.h:143
MOuint
#define MOuint
Definition:
moTypes.h:387
moFontFace
void moFontFace
Definition:
moFontManager.h:38
moFont::m_FontSize
moFontSize m_FontSize
Definition:
moFontManager.h:99
moFont::m_pFace
moFontFace * m_pFace
Definition:
moFontManager.h:102
libmoldeo
moFontManager.h
Generado el Martes, 10 de Septiembre de 2019 21:27:07 para libmoldeo (Moldeo 1.0 Core) por
1.8.13