Changed Font::setSize to Font::setFontResolution

This commit is contained in:
Robert Osfield
2005-01-27 11:10:50 +00:00
parent 67a5a020bf
commit a086a6d01b
5 changed files with 27 additions and 20 deletions

View File

@@ -1,4 +1,4 @@
;
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2003 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
@@ -123,17 +123,17 @@ std::string Font::getFileName() const
return "";
}
void Font::setSize(unsigned int width, unsigned int height)
void Font::setFontResolution(unsigned int width, unsigned int height)
{
if (_implementation.valid()) _implementation->setSize(width, height);
if (_implementation.valid()) _implementation->setFontResolution(width, height);
}
unsigned int Font::getWidth() const
unsigned int Font::getFontWidth() const
{
return _width;
}
unsigned int Font::getHeight() const
unsigned int Font::getFontHeight() const
{
return _height;
}

View File

@@ -257,7 +257,7 @@ String::iterator Text::computeLastCharacterOnLine(osg::Vec2 cursor, String::iter
Font* activefont = getActiveFont();
if (!activefont) return last;
float hr = _characterHeight/(float)activefont->getHeight();
float hr = _characterHeight/(float)activefont->getFontHeight();
float wr = hr/_characterAspectRatio;
bool horizontal = _layout!=VERTICAL;
@@ -370,9 +370,9 @@ void Text::computeGlyphRepresentation()
bool horizontal = _layout!=VERTICAL;
bool kerning = true;
activefont->setSize(_fontWidth,_fontHeight);
activefont->setFontResolution(_fontWidth,_fontHeight);
float hr = _characterHeight/(float)activefont->getHeight();
float hr = _characterHeight/(float)activefont->getFontHeight();
float wr = hr/_characterAspectRatio;
std::set<unsigned int> deliminatorSet;