From 3a4ff9888343e517e444554a39de80f5b134f829 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 12 May 2011 10:10:49 +0000 Subject: [PATCH] Added setting of size. --- src/osgPlugins/txf/TXFFont.cpp | 4 ++++ src/osgPlugins/txf/TXFFont.h | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/osgPlugins/txf/TXFFont.cpp b/src/osgPlugins/txf/TXFFont.cpp index 9726a80ea..c1860b552 100644 --- a/src/osgPlugins/txf/TXFFont.cpp +++ b/src/osgPlugins/txf/TXFFont.cpp @@ -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)); diff --git a/src/osgPlugins/txf/TXFFont.h b/src/osgPlugins/txf/TXFFont.h index 2286f341b..bd5544a61 100644 --- a/src/osgPlugins/txf/TXFFont.h +++ b/src/osgPlugins/txf/TXFFont.h @@ -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: