00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef DYNAMICTEXTGLYPH_H
00016 #define DYNAMICTEXTGLYPH_H
00017
00018 #include "pandabase.h"
00019
00020 #ifdef HAVE_FREETYPE
00021
00022 #include "textGlyph.h"
00023
00024 class DynamicTextPage;
00025 class DynamicTextFont;
00026
00027
00028
00029
00030
00031
00032
00033
00034 class EXPCL_PANDA_TEXT DynamicTextGlyph : public TextGlyph {
00035 public:
00036 INLINE DynamicTextGlyph(int character, DynamicTextPage *page,
00037 int x, int y, int x_size, int y_size,
00038 int margin);
00039 INLINE DynamicTextGlyph(int character, PN_stdfloat advance);
00040 private:
00041 INLINE DynamicTextGlyph(const DynamicTextGlyph ©);
00042 INLINE void operator = (const DynamicTextGlyph ©);
00043
00044 public:
00045 virtual ~DynamicTextGlyph();
00046
00047 INLINE bool intersects(int x, int y, int x_size, int y_size) const;
00048 unsigned char *get_row(int y);
00049 void erase(DynamicTextFont *font);
00050 void make_geom(int top, int left, PN_stdfloat advance, PN_stdfloat poly_margin,
00051 PN_stdfloat tex_x_size, PN_stdfloat tex_y_size,
00052 PN_stdfloat font_pixels_per_unit, PN_stdfloat tex_pixels_per_unit);
00053 void set_geom(GeomVertexData *vdata, GeomPrimitive *prim,
00054 const RenderState *state);
00055 virtual bool is_whitespace() const;
00056
00057 DynamicTextPage *_page;
00058 int _geom_count;
00059
00060 int _x, _y;
00061 int _x_size, _y_size;
00062 int _margin;
00063 };
00064
00065 #include "dynamicTextGlyph.I"
00066
00067 #endif // HAVE_FREETYPE
00068
00069 #endif