00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef STATICTEXTFONT_H
00016 #define STATICTEXTFONT_H
00017
00018 #include "pandabase.h"
00019
00020 #include "config_text.h"
00021 #include "textFont.h"
00022 #include "textGlyph.h"
00023 #include "pandaNode.h"
00024 #include "geom.h"
00025 #include "geom.h"
00026 #include "pointerTo.h"
00027 #include "pmap.h"
00028
00029 class Node;
00030 class GeomPoint;
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 class EXPCL_PANDA_TEXT StaticTextFont : public TextFont {
00041 PUBLISHED:
00042 StaticTextFont(PandaNode *font_def);
00043
00044 virtual PT(TextFont) make_copy() const;
00045
00046 virtual void write(ostream &out, int indent_level) const;
00047
00048 public:
00049 virtual bool get_glyph(int character, const TextGlyph *&glyph);
00050
00051 private:
00052 void find_character_gsets(PandaNode *root, CPT(Geom) &ch, CPT(Geom) &dot,
00053 const RenderState *&state,
00054 const RenderState *net_state);
00055 void find_characters(PandaNode *root,
00056 const RenderState *net_state);
00057
00058 typedef pmap<int, PT(TextGlyph)> Glyphs;
00059 Glyphs _glyphs;
00060 PN_stdfloat _font_height;
00061 PT(PandaNode) _font;
00062
00063 public:
00064 static TypeHandle get_class_type() {
00065 return _type_handle;
00066 }
00067 static void init_type() {
00068 TextFont::init_type();
00069 register_type(_type_handle, "StaticTextFont",
00070 TextFont::get_class_type());
00071 }
00072 virtual TypeHandle get_type() const {
00073 return get_class_type();
00074 }
00075 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00076
00077 private:
00078 static TypeHandle _type_handle;
00079 };
00080
00081 #include "staticTextFont.I"
00082
00083 #endif