Skip to content

Commit ebe859d

Browse files
Xottab-DUTYantoncxx
authored andcommitted
xrUICore/FontManager/FontManager.cpp: return size and interval font settings (OpenXRay#382)
In original SOC/CS, interval was only set in stat_font, so GSC removed reading of these config values in COP and just set interval manually. But reading from config is generally better. Plus, mods could use interval, so let's return this code.
1 parent 6db9d50 commit ebe859d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/xrUICore/FontManager/FontManager.cpp

+11-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ void CFontManager::InitializeFonts()
3737
InitializeFont(pFontGraffiti50Russian, "ui_font_graff_50");
3838
InitializeFont(pFontLetterica25, "ui_font_letter_25");
3939
InitializeFont(pFontStat, "stat_font", CGameFont::fsDeviceIndependent);
40-
pFontStat->SetInterval(0.75f, 1.0f);
4140
}
4241

4342
LPCSTR CFontManager::GetFontTexName(LPCSTR section)
@@ -78,6 +77,17 @@ void CFontManager::InitializeFont(CGameFont*& F, LPCSTR section, u32 flags)
7877
#ifdef DEBUG
7978
F->m_font_name = section;
8079
#endif
80+
81+
if (pSettings->line_exist(section, "size"))
82+
{
83+
const float sz = pSettings->r_float(section, "size");
84+
if (flags & CGameFont::fsDeviceIndependent)
85+
F->SetHeightI(sz);
86+
else
87+
F->SetHeight(sz);
88+
}
89+
if (pSettings->line_exist(section, "interval"))
90+
F->SetInterval(pSettings->r_fvector2(section, "interval"));
8191
}
8292

8393
CFontManager::~CFontManager()

0 commit comments

Comments
 (0)