LLInitParam/LLUI Params enhancement

Specialized param handling for common linden types
And pre-viewer-interesting modernized llinitparam.* (includes llsdparam.cpp update)
This commit is contained in:
Inusaito Sayori
2013-12-02 00:27:50 -05:00
parent 9723a45e72
commit 23958965aa
7 changed files with 1496 additions and 740 deletions

View File

@@ -1046,6 +1046,13 @@ std::string LLFontGL::nameFromFont(const LLFontGL* fontp)
return fontp->getFontDesc().getName();
}
// static
std::string LLFontGL::sizeFromFont(const LLFontGL* fontp)
{
return fontp->getFontDesc().getSize();
}
// static
std::string LLFontGL::nameFromHAlign(LLFontGL::HAlign align)
{
@@ -1162,6 +1169,41 @@ LLFontGL* LLFontGL::getFont(const LLFontDescriptor& desc)
return sFontRegistry->getFont(desc);
}
// static
LLFontGL* LLFontGL::getFontByName(const std::string& name)
{
// check for most common fonts first
if (name == "SANSSERIF")
{
return getFontSansSerif();
}
else if (name == "SANSSERIF_SMALL")
{
return getFontSansSerifSmall();
}
else if (name == "SANSSERIF_BIG")
{
return getFontSansSerifBig();
}
else if (name == "SMALL" || name == "OCRA")
{
// *BUG: Should this be "MONOSPACE"? Do we use "OCRA" anymore?
// Does "SMALL" mean "SERIF"?
return getFontMonospace();
}
else
{
return NULL;
}
}
//static
LLFontGL* LLFontGL::getFontDefault()
{
return getFontSansSerif(); // Fallback to sans serif as default font
}
// static
std::string LLFontGL::getFontPathSystem()
{