Changed Font::setSize to Font::setFontResolution
This commit is contained in:
@@ -26,7 +26,7 @@ FreeTypeFont::~FreeTypeFont()
|
||||
{
|
||||
}
|
||||
|
||||
void FreeTypeFont::setSize(unsigned int width, unsigned int height)
|
||||
void FreeTypeFont::setFontResolution(unsigned int width, unsigned int height)
|
||||
{
|
||||
if (width+2*_facade->getGlyphImageMargin()>_facade->getTextureWidthHint() ||
|
||||
height+2*_facade->getGlyphImageMargin()>_facade->getTextureHeightHint())
|
||||
@@ -49,8 +49,8 @@ void FreeTypeFont::setSize(unsigned int width, unsigned int height)
|
||||
}
|
||||
else
|
||||
{
|
||||
setWidth(width);
|
||||
setHeight(height);
|
||||
setFontWidth(width);
|
||||
setFontHeight(height);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -155,7 +155,7 @@ osgText::Font::Glyph* FreeTypeFont::getGlyph(unsigned int charcode)
|
||||
glyph->setVerticalBearing(osg::Vec2((float)metrics->vertBearingX/64.0f,(float)(metrics->vertBearingY-metrics->height)/64.0f)); // top middle.
|
||||
glyph->setVerticalAdvance((float)metrics->vertAdvance/64.0f);
|
||||
|
||||
addGlyph(_facade->getWidth(),_facade->getHeight(),charcode,glyph.get());
|
||||
addGlyph(_facade->getFontWidth(),_facade->getFontHeight(),charcode,glyph.get());
|
||||
|
||||
// cout << " in getGlyph() implementation="<<this<<" "<<_filename<<" facade="<<_facade<<endl;
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
|
||||
virtual std::string getFileName() const { return _filename; }
|
||||
|
||||
virtual void setSize(unsigned int width, unsigned int height);
|
||||
virtual void setFontResolution(unsigned int width, unsigned int height);
|
||||
|
||||
virtual osgText::Font::Glyph* getGlyph(unsigned int charcode);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user