Added fallback for event line labels to use the default window font is the one specified for labels couldn't be loaded

This commit is contained in:
biwa 2020-07-18 15:49:26 +02:00 committed by spherallic
parent fecb6aad8f
commit 7a0fe26b30

View file

@ -71,7 +71,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
linedefs = new List<Linedef>();
eventlines = new Dictionary<string, List<Line3D>>();
font = new Font(new FontFamily(General.Settings.TextLabelFontName), General.Settings.TextLabelFontSize, (General.Settings.TextLabelFontBold ? FontStyle.Bold : FontStyle.Regular));
try
{
font = new Font(new FontFamily(General.Settings.TextLabelFontName), General.Settings.TextLabelFontSize, (General.Settings.TextLabelFontBold ? FontStyle.Bold : FontStyle.Regular));
}
catch (Exception) // Fallback if the font couldn't be loaded
{
font = ((MainForm)General.Interface).Font;
}
distinctcolors = new List<PixelColor>
{