Added setting of size.

This commit is contained in:
Robert Osfield
2011-05-12 10:10:49 +00:00
parent 74dab1fe8d
commit 3a4ff98883
2 changed files with 4 additions and 2 deletions

View File

@@ -256,6 +256,10 @@ TXFFont::loadFont(std::istream& stream)
float texToVertX = float(glyphs[i].width)/width;
float texToVertY = float(glyphs[i].height)/height;
glyph->setWidth(width);
glyph->setHeight(height);
glyph->setHorizontalAdvance(glyphs[i].advance + 0.1f*maxheight);
glyph->setHorizontalBearing(osg::Vec2((glyphs[i].x_off - 0.5f)*texToVertX,
(glyphs[i].y_off - 0.5f)*texToVertY));

View File

@@ -36,8 +36,6 @@ public:
virtual osg::Vec2 getKerning(unsigned int leftcharcode,unsigned int rightcharcode, osgText::KerningType kerningType);
virtual float getScale() const { return 1.0; }
bool loadFont(std::istream& stream);
protected: