Further improvements to osgText and the freetype plugin, handling different

font sizes better and plugin removal safely.
This commit is contained in:
Robert Osfield
2003-03-04 12:34:42 +00:00
parent 09d0d0e887
commit 1c34c0981e
13 changed files with 125 additions and 29 deletions

View File

@@ -12,6 +12,7 @@
*/
#include <osgText/Font>
#include <osgText/Text>
#include <osg/State>
#include <osg/Notify>
@@ -82,11 +83,18 @@ Font::Font():
Font::~Font()
{
for(TextList::iterator itr=_textList.begin();
itr!=_textList.end();
++itr)
{
Text* text = *itr;
text->_font.release();
}
}
void Font::addGlyph(unsigned int charcode, Glyph* glyph)
void Font::addGlyph(unsigned int width, unsigned int height, unsigned int charcode, Glyph* glyph)
{
_glyphMap[charcode]=glyph;
_sizeGlyphMap[SizePair(width,height)][charcode]=glyph;
int posX=0,posY=0;
@@ -297,8 +305,8 @@ Font::Glyph::~Glyph() {}
unsigned int Font::Glyph::getGlyphCode() const { return _glyphCode; }
void Font::Glyph::setFont(Font* font) { _font = font; }
Font* Font::Glyph::getFont() const { return _font; }
// void Font::Glyph::setFont(Font* font) { _font = font; }
// Font* Font::Glyph::getFont() const { return _font; }
void Font::Glyph::setHorizontalBearing(const osg::Vec2& bearing) { _horizontalBearing=bearing; }
const osg::Vec2& Font::Glyph::getHorizontalBearing() const { return _horizontalBearing; }