public idFontFamily FindFont(string name)
{
string nameLower = name.ToLower();
foreach(idFontFamily fontFamily in _fontFamilies)
{
if(fontFamily.Name.Equals(nameLower) == true)
{
return fontFamily;
}
}
// if the font was not found, try to register it
string fileName = name.Replace("fonts", string.Format("fonts/{0}", _fontLanguage));
idFontFamily fontFamily2 = idE.RenderSystem.RegisterFont(name, fileName);
if(fontFamily2 != null)
{
_fontFamilies.Add(fontFamily2);
}
else
{
idConsole.WriteLine("Could not register font {0} [{1}]", name, fileName);
}
return fontFamily2;
}