Panda3D
|
00001 // Filename: textGlyph.h 00002 // Created by: drose (08Feb02) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef TEXTGLYPH_H 00016 #define TEXTGLYPH_H 00017 00018 #include "pandabase.h" 00019 #include "renderState.h" 00020 #include "referenceCount.h" 00021 #include "geom.h" 00022 #include "pointerTo.h" 00023 #include "dcast.h" 00024 00025 //////////////////////////////////////////////////////////////////// 00026 // Class : TextGlyph 00027 // Description : A representation of a single glyph (character) from a 00028 // font. This is a piece of renderable geometry of some 00029 // kind. 00030 //////////////////////////////////////////////////////////////////// 00031 class EXPCL_PANDA_TEXT TextGlyph : public ReferenceCount { 00032 public: 00033 INLINE TextGlyph(int character); 00034 INLINE TextGlyph(int character, const Geom *geom, 00035 const RenderState *state, PN_stdfloat advance); 00036 INLINE TextGlyph(const TextGlyph ©); 00037 INLINE void operator = (const TextGlyph ©); 00038 virtual ~TextGlyph(); 00039 00040 INLINE int get_character() const; 00041 INLINE PT(Geom) get_geom(Geom::UsageHint usage_hint) const; 00042 INLINE const RenderState *get_state() const; 00043 INLINE PN_stdfloat get_advance() const; 00044 00045 virtual bool is_whitespace() const; 00046 00047 protected: 00048 int _character; 00049 CPT(Geom) _geom; 00050 CPT(RenderState) _state; 00051 PN_stdfloat _advance; 00052 }; 00053 00054 #include "textGlyph.I" 00055 00056 #endif