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