Fixed: use application default font family for rendered labels if user-selected font is not available

This commit is contained in:
ZZYZX 2019-12-26 07:02:19 +02:00
parent 76bfd79bd6
commit 607ac7751e
4 changed files with 14 additions and 5 deletions

View file

@ -363,7 +363,7 @@ namespace CodeImp.DoomBuilder.Config
scriptautoshowautocompletion = cfg.ReadSetting("scriptautoshowautocompletion", true);
//mxd. Text labels
textlabelfontname = cfg.ReadSetting("textlabelfontname", "Arial");
textlabelfontname = cfg.ReadSetting("textlabelfontname", "Microsoft Sans Serif");
textlabelfontsize = cfg.ReadSetting("textlabelfontsize", 10);
textlabelfontbold = cfg.ReadSetting("textlabelfontbold", false);

View file

@ -30,6 +30,6 @@ using CodeImp.DoomBuilder;
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.0.0.3248")]
[assembly: AssemblyVersion("3.0.0.3271")]
[assembly: NeutralResourcesLanguageAttribute("en")]
[assembly: AssemblyHash("99b1770")]
[assembly: AssemblyHash("fed4b77")]

View file

@ -128,7 +128,16 @@ namespace CodeImp.DoomBuilder.Rendering
{
scale = value;
font.Dispose();
font = new Font(new FontFamily(General.Settings.TextLabelFontName), (float)Math.Round(scale * 0.75f), (General.Settings.TextLabelFontBold ? FontStyle.Bold : FontStyle.Regular));
FontFamily ff;
try
{
ff = new FontFamily(General.Settings.TextLabelFontName);
}
catch (Exception)
{
ff = General.MainWindow.Font.FontFamily;
}
font = new Font(ff, (float)Math.Round(scale * 0.75f), (General.Settings.TextLabelFontBold ? FontStyle.Bold : FontStyle.Regular));
textsize = Size.Empty;
textureupdateneeded = true;
}

View file

@ -29,5 +29,5 @@ using System.Resources;
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.0.0.3248")]
[assembly: AssemblyVersion("3.0.0.3271")]
[assembly: NeutralResourcesLanguageAttribute("en")]