From 1f36f5bd8d032dc0dd423a5ec404ec1951777e3c Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 29 Sep 2017 10:25:04 +0100 Subject: [PATCH] Added setting of the FontResolution of the DefaultFont --- src/osgText/DefaultFont.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/osgText/DefaultFont.cpp b/src/osgText/DefaultFont.cpp index cf0b55cc4..1dc251f68 100644 --- a/src/osgText/DefaultFont.cpp +++ b/src/osgText/DefaultFont.cpp @@ -24,8 +24,15 @@ using namespace osgText; DefaultFont::DefaultFont() { + _fontSize = FontResolution(8,12); + _minFilterHint = osg::Texture::LINEAR_MIPMAP_LINEAR; _magFilterHint = osg::Texture::NEAREST; + + _margin = 8; + _marginRatio = 0.0; + _glyphInterval = 16; + constructGlyphs(); } @@ -233,6 +240,8 @@ void DefaultFont::constructGlyphs() glyph->setVerticalBearing(osg::Vec2(0.5f,1.0f)); // top middle. glyph->setVerticalAdvance(sourceHeight*coord_scale); + glyph->setFontResolution(fontRes); + addGlyph(fontRes,i,glyph.get()); } }