00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __FONTGLYPH_H__
00020 #define __FONTGLYPH_H__
00021
00022 #include <set>
00023 #include <vrs/sharedobj.h>
00024 #include <vrs/text/vrs_textprerequisites.h>
00025 #include <vrs/text/glyphtypes.h>
00026
00028 namespace VRS
00029 {
00030 namespace TEXT
00031 {
00032 class VRS_CORE_API FontDefinition;
00033
00034 typedef std::set< SO<AbstractGlyph> > GlyphRepresentationSet;
00035
00040 class VRS_CORE_API FontGlyph : public SharedObj
00041 {
00042 public:
00062 FontGlyph( unsigned int glyphCode, GlyphCharcode glyph,
00063 float width, float height,
00064 float horiBearingX, float horiBearingY, float horiAdvance,
00065 float vertBearingX, float vertBearingY, float vertAdvance,
00066 SO<FontDefinition> fd, SO<FontGlyph> inheritSize = 0 );
00068 virtual ~FontGlyph();
00069
00070
00072 inline unsigned int getGlyphCode() const
00073 { return m_GlyphCode; };
00075 inline GlyphCharcode getGlyph() const
00076 { return m_Glyph; };
00077
00079 inline float getWidth() const
00080 { return m_Width; };
00082 inline float getHeight() const
00083 { return m_Height; };
00084
00086 inline float getExtraX() const
00087 { return m_ExtraX; };
00089 inline float getExtraY() const
00090 { return m_ExtraY; };
00091
00093 inline float getHoriBearingX() const
00094 { return m_HoriBearingX; };
00096 inline float getHoriBearingY() const
00097 { return m_HoriBearingY; };
00099 inline float getHoriAdvance() const
00100 { return m_HoriAdvance; };
00101
00103 inline float getVertBearingX() const
00104 { return m_VertBearingX; };
00106 inline float getVertBearingY() const
00107 { return m_VertBearingY; };
00109 inline float getVertAdvance() const
00110 { return m_VertAdvance; };
00111
00113 inline SO<FontDefinition> getFontDefinition() const
00114 { return m_FontDefinition; };
00115
00117 void addGlyphRepresentation( SO<AbstractGlyph> glyph );
00118
00122 SO<AbstractGlyph> getGlyphRepresentation( GlyphTypeID id ) const;
00123
00124 VRS_TYPEINFO(FontGlyph, SharedObj);
00125 private:
00127 unsigned int m_GlyphCode;
00129 GlyphCharcode m_Glyph;
00130
00132 float m_Width;
00134 float m_Height;
00136 float m_ExtraX;
00138 float m_ExtraY;
00139
00140
00141 float m_HoriBearingX;
00142 float m_HoriBearingY;
00143 float m_HoriAdvance;
00144
00145
00146 float m_VertBearingX;
00147 float m_VertBearingY;
00148 float m_VertAdvance;
00149
00151 SO<FontDefinition> m_FontDefinition;
00152
00153 GlyphRepresentationSet m_GlyphRepresentations;
00154 };
00155 }
00156 }
00157
00158 #endif