forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstaticTextFont.h
More file actions
85 lines (71 loc) · 2.45 KB
/
staticTextFont.h
File metadata and controls
85 lines (71 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// Filename: staticTextFont.h
// Created by: drose (03May01)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University. All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license. You should have received a copy of this license along
// with this source code in a file named "LICENSE."
//
////////////////////////////////////////////////////////////////////
#ifndef STATICTEXTFONT_H
#define STATICTEXTFONT_H
#include "pandabase.h"
#include "config_text.h"
#include "coordinateSystem.h"
#include "textFont.h"
#include "textGlyph.h"
#include "pandaNode.h"
#include "geom.h"
#include "geom.h"
#include "pointerTo.h"
#include "pmap.h"
class Node;
class GeomPoint;
////////////////////////////////////////////////////////////////////
// Class : StaticTextFont
// Description : A StaticTextFont is loaded up from a model that was
// previously generated via egg-mkfont, and contains all
// of its glyphs already generated and available for
// use. It doesn't require linking with any external
// libraries like FreeType.
////////////////////////////////////////////////////////////////////
class EXPCL_PANDA_TEXT StaticTextFont : public TextFont {
PUBLISHED:
StaticTextFont(PandaNode *font_def, CoordinateSystem cs = CS_default);
virtual PT(TextFont) make_copy() const;
virtual void write(ostream &out, int indent_level) const;
public:
virtual bool get_glyph(int character, const TextGlyph *&glyph);
private:
void find_character_gsets(PandaNode *root, CPT(Geom) &ch, CPT(Geom) &dot,
const RenderState *&state,
const RenderState *net_state);
void find_characters(PandaNode *root,
const RenderState *net_state);
typedef pmap<int, PT(TextGlyph)> Glyphs;
Glyphs _glyphs;
PN_stdfloat _font_height;
PT(PandaNode) _font;
CoordinateSystem _cs;
public:
static TypeHandle get_class_type() {
return _type_handle;
}
static void init_type() {
TextFont::init_type();
register_type(_type_handle, "StaticTextFont",
TextFont::get_class_type());
}
virtual TypeHandle get_type() const {
return get_class_type();
}
virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
private:
static TypeHandle _type_handle;
};
#include "staticTextFont.I"
#endif