From 67202b2662c9a2e77bcb96c5e22303cd6bdd9717 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 15 Feb 2016 13:30:39 +0000 Subject: [PATCH] From Romain Ouabdelkader, "This is a fix for osgText to calculate kerning and to load glyph3D with the text's font resolution. Font::getKerning(...), Font::getGlyph3D(...) doesn't ask for a font resolution so it uses the last font resolution requested by Font:: getGlyph(...). This can leads to different results depending of the precedent call to Font::getGlyph(...). See http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2016-January/271952.html for more infos. This fix adds a font resolution parameter to Font::getKerning(...), Font::getGlyph3D(...) and to the font implementations. This was made under the base revision r15182." --- examples/osgtext3D/TextNode.cpp | 4 ++-- include/osgQt/QFontImplementation | 4 ++-- include/osgText/Font | 15 +++++++------- src/osgPlugins/freetype/FreeTypeFont.cpp | 8 ++++++-- src/osgPlugins/freetype/FreeTypeFont.h | 6 +++--- src/osgPlugins/txf/TXFFont.cpp | 2 +- src/osgPlugins/txf/TXFFont.h | 4 ++-- src/osgQt/QFontImplementation.cpp | 2 +- src/osgText/DefaultFont.cpp | 2 +- src/osgText/DefaultFont.h | 4 ++-- src/osgText/Font.cpp | 26 ++++++++++++++++-------- src/osgText/Text.cpp | 8 ++++---- src/osgText/Text3D.cpp | 14 ++++++------- 13 files changed, 57 insertions(+), 42 deletions(-) diff --git a/examples/osgtext3D/TextNode.cpp b/examples/osgtext3D/TextNode.cpp index 5d5b32c31..1ae3018aa 100644 --- a/examples/osgtext3D/TextNode.cpp +++ b/examples/osgtext3D/TextNode.cpp @@ -104,7 +104,7 @@ void Layout::layout(TextNode& text) const } else { - osgText::Glyph3D* glyph = font->getGlyph3D(charcode); + osgText::Glyph3D* glyph = font->getGlyph3D(resolution, charcode); OSG_NOTICE<<"pos = "<