From Tree, updates to osgText and freetype plugin to support are kerning paramter.

This commit is contained in:
Robert Osfield
2003-06-26 16:21:49 +00:00
parent 5bf9be4473
commit 8d4ab4668e
8 changed files with 37 additions and 25 deletions

View File

@@ -211,7 +211,10 @@ public:
unsigned int getDrawMode() const { return _drawMode; }
void setKerningType(KerningType kerningType) { _kerningType = kerningType; }
KerningType getKerningType() const { return _kerningType; }
/** Draw the text.*/
virtual void drawImplementation(osg::State& state) const;
@@ -266,13 +269,12 @@ public:
typedef std::map<osg::ref_ptr<osg::StateSet>,GlyphQuads> TextureGlyphQuadMap;
/** Direct Access to GlyphQuads */
const GlyphQuads* getGlyphQuad(unsigned int index) const
const GlyphQuads* getGlyphQuads(osg::StateSet* stateSet) const
{
if (index>=_textureGlyphQuadMap.size()) return NULL;
TextureGlyphQuadMap::iterator itGlyphQuad = _textureGlyphQuadMap.find(stateSet);
if (itGlyphQuad == _textureGlyphQuadMap.end()) return NULL;
TextureGlyphQuadMap::const_iterator itGlyph = _textureGlyphQuadMap.begin();
while((index--) && (itGlyph!=_textureGlyphQuadMap.end())) itGlyph++;
return &itGlyph->second;
return &itGlyphQuad->second;
}
protected:
@@ -303,6 +305,7 @@ protected:
Layout _layout;
osg::Vec4 _color;
unsigned int _drawMode;
KerningType _kerningType;
// iternal map used for rendering. Set up by the computeGlyphRepresentation() method.
mutable TextureGlyphQuadMap _textureGlyphQuadMap;