-Font init cleanup. Now has a dedicated position in startup initilization.
This commit is contained in:
@@ -125,31 +125,6 @@ bool findOrCreateFont(LLFontGL*& fontp, const LLFontDescriptor& desc)
|
||||
return (fontp != NULL);
|
||||
}
|
||||
|
||||
// static
|
||||
BOOL LLFontGL::initDefaultFonts(F32 screen_dpi, F32 x_scale, F32 y_scale,
|
||||
const std::string& app_dir,
|
||||
const std::vector<std::string>& xui_paths,
|
||||
bool create_gl_textures)
|
||||
{
|
||||
sVertDPI = (F32)llfloor(screen_dpi * y_scale);
|
||||
sHorizDPI = (F32)llfloor(screen_dpi * x_scale);
|
||||
sScaleX = x_scale;
|
||||
sScaleY = y_scale;
|
||||
sAppDir = app_dir;
|
||||
|
||||
// Font registry init
|
||||
if (!sFontRegistry)
|
||||
{
|
||||
sFontRegistry = new LLFontRegistry(xui_paths,create_gl_textures);
|
||||
sFontRegistry->parseFontInfo("fonts.xml");
|
||||
}
|
||||
else
|
||||
{
|
||||
sFontRegistry->reset();
|
||||
}
|
||||
|
||||
return loadDefaultFonts();
|
||||
}
|
||||
|
||||
void LLFontGL::destroyGL()
|
||||
{
|
||||
@@ -956,6 +931,27 @@ void LLFontGL::removeEmbeddedChar( llwchar wc ) const
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLFontGL::initClass(F32 screen_dpi, F32 x_scale, F32 y_scale, const std::string& app_dir, const std::vector<std::string>& xui_paths, bool create_gl_textures)
|
||||
{
|
||||
sVertDPI = (F32)llfloor(screen_dpi * y_scale);
|
||||
sHorizDPI = (F32)llfloor(screen_dpi * x_scale);
|
||||
sScaleX = x_scale;
|
||||
sScaleY = y_scale;
|
||||
sAppDir = app_dir;
|
||||
|
||||
// Font registry init
|
||||
if (!sFontRegistry)
|
||||
{
|
||||
sFontRegistry = new LLFontRegistry(xui_paths,create_gl_textures);
|
||||
sFontRegistry->parseFontInfo("fonts.xml");
|
||||
}
|
||||
else
|
||||
{
|
||||
sFontRegistry->reset();
|
||||
}
|
||||
}
|
||||
|
||||
// Force standard fonts to get generated up front.
|
||||
// This is primarily for error detection purposes.
|
||||
// Don't do this during initClass because it can be slow and we want to get
|
||||
|
||||
Reference in New Issue
Block a user