summaryrefslogtreecommitdiff
path: root/indra/llui/llstyle.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2009-05-08 07:43:08 +0000
committerSteven Bennetts <steve@lindenlab.com>2009-05-08 07:43:08 +0000
commita4000c3744e42fcbb638e742f3b63fa31a0dee15 (patch)
tree7f472c30e65bbfa04ee9bc06631a1af305cc31fb /indra/llui/llstyle.cpp
parent6c4cadbb04d633ad7b762058bdeba6e1f650dafd (diff)
merge trunk@116587 skinning-7@119389 -> viewer-2.0.0-skinning-7
Diffstat (limited to 'indra/llui/llstyle.cpp')
-rw-r--r--indra/llui/llstyle.cpp32
1 files changed, 24 insertions, 8 deletions
diff --git a/indra/llui/llstyle.cpp b/indra/llui/llstyle.cpp
index a716cbbaec..432d54dfee 100644
--- a/indra/llui/llstyle.cpp
+++ b/indra/llui/llstyle.cpp
@@ -33,10 +33,11 @@
#include "linden_common.h"
#include "llstyle.h"
+
+#include "llfontgl.h"
#include "llstring.h"
#include "llui.h"
-//#include "llviewerimagelist.h"
LLStyle::LLStyle()
{
@@ -110,7 +111,13 @@ LLStyle &LLStyle::operator=(const LLStyle &rhs)
return *this;
}
+//virtual
+const std::string& LLStyle::getFontString() const
+{
+ return mFontName;
+}
+//virtual
void LLStyle::setFontName(const std::string& fontname)
{
mFontName = fontname;
@@ -118,26 +125,35 @@ void LLStyle::setFontName(const std::string& fontname)
std::string fontname_lc = fontname;
LLStringUtil::toLower(fontname_lc);
- mFontID = LLFONT_OCRA; // default
-
+ // cache the font pointer for speed when rendering text
if ((fontname_lc == "sansserif") || (fontname_lc == "sans-serif"))
{
- mFontID = LLFONT_SANSSERIF;
+ mFont = LLFontGL::getFontSansSerif();
}
else if ((fontname_lc == "serif"))
{
- mFontID = LLFONT_SMALL;
+ // *TODO: Do we have a real serif font?
+ mFont = LLFontGL::getFontMonospace();
}
else if ((fontname_lc == "sansserifbig"))
{
- mFontID = LLFONT_SANSSERIF_BIG;
+ mFont = LLFontGL::getFontSansSerifBig();
}
else if (fontname_lc == "small")
{
- mFontID = LLFONT_SANSSERIF_SMALL;
+ mFont = LLFontGL::getFontSansSerifSmall();
+ }
+ else
+ {
+ mFont = LLFontGL::getFontMonospace();
}
}
+//virtual
+LLFontGL* LLStyle::getFont() const
+{
+ return mFont;
+}
void LLStyle::setLinkHREF(const std::string& href)
{
@@ -166,7 +182,7 @@ LLUIImagePtr LLStyle::getImage() const
void LLStyle::setImage(const LLUUID& src)
{
- mImagep = LLUI::sImageProvider->getUIImageByID(src);
+ mImagep = LLUI::getUIImageByID(src);
}