summaryrefslogtreecommitdiff
path: root/indra/llrender/llfontgl.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2021-10-22 18:11:48 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2021-10-22 18:11:48 +0100
commite5cd9cb90f74c46ad59ba697bb70e7a425bf631d (patch)
tree35cf0536f89af885f670a3b788ff534667ce656a /indra/llrender/llfontgl.cpp
parent910daee8887b41619b07a1e5c4431f77c095dac5 (diff)
parentda183230b0f08d50ad35330fc8ef51307a8b6f84 (diff)
merge
Diffstat (limited to 'indra/llrender/llfontgl.cpp')
-rw-r--r--indra/llrender/llfontgl.cpp31
1 files changed, 23 insertions, 8 deletions
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index 86a4c35e6d..266399d212 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -547,9 +547,19 @@ F32 LLFontGL::getWidthF32(const llwchar* wchars, S32 begin_offset, S32 max_chars
return cur_x / sScaleX;
}
+void LLFontGL::generateASCIIglyphs()
+{
+ LL_PROFILE_ZONE_SCOPED
+ for (U32 i = 32; (i < 127); i++)
+ {
+ mFontFreetype->getGlyphInfo(i);
+ }
+}
+
// Returns the max number of complete characters from text (up to max_chars) that can be drawn in max_pixels
S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_chars, EWordWrapStyle end_on_word_boundary) const
{
+ LL_PROFILE_ZONE_SCOPED
if (!wchars || !wchars[0] || max_chars == 0)
{
return 0;
@@ -829,6 +839,8 @@ void LLFontGL::initClass(F32 screen_dpi, F32 x_scale, F32 y_scale, const std::st
{
sFontRegistry->reset();
}
+
+ LLFontGL::loadDefaultFonts();
}
// Force standard fonts to get generated up front.
@@ -838,6 +850,7 @@ void LLFontGL::initClass(F32 screen_dpi, F32 x_scale, F32 y_scale, const std::st
// static
bool LLFontGL::loadDefaultFonts()
{
+ LL_PROFILE_ZONE_SCOPED
bool succ = true;
succ &= (NULL != getFontSansSerifSmall());
succ &= (NULL != getFontSansSerif());
@@ -845,10 +858,18 @@ bool LLFontGL::loadDefaultFonts()
succ &= (NULL != getFontSansSerifHuge());
succ &= (NULL != getFontSansSerifBold());
succ &= (NULL != getFontMonospace());
- succ &= (NULL != getFontExtChar());
return succ;
}
+void LLFontGL::loadCommonFonts()
+{
+ LL_PROFILE_ZONE_SCOPED
+ getFont(LLFontDescriptor("SansSerif", "Small", BOLD));
+ getFont(LLFontDescriptor("SansSerif", "Large", BOLD));
+ getFont(LLFontDescriptor("SansSerif", "Huge", BOLD));
+ getFont(LLFontDescriptor("Monospace", "Medium", 0));
+}
+
// static
void LLFontGL::destroyDefaultFonts()
{
@@ -1015,7 +1036,7 @@ LLFontGL* LLFontGL::getFontSansSerifBig()
//static
LLFontGL* LLFontGL::getFontSansSerifHuge()
{
- static LLFontGL* fontp = getFont(LLFontDescriptor("SansSerif","Large",0));
+ static LLFontGL* fontp = getFont(LLFontDescriptor("SansSerif","Huge",0));
return fontp;
}
@@ -1026,12 +1047,6 @@ LLFontGL* LLFontGL::getFontSansSerifBold()
return fontp;
}
-//static
-LLFontGL* LLFontGL::getFontExtChar()
-{
- return getFontSansSerif();
-}
-
//static
LLFontGL* LLFontGL::getFont(const LLFontDescriptor& desc)
{