From 263c555bb45d5ad6b863701936d6ee14935df47f Mon Sep 17 00:00:00 2001
From: biwa <6475593+biwa@users.noreply.github.com>
Date: Sat, 18 Jul 2020 15:49:26 +0200
Subject: [PATCH] Added fallback for event line labels to use the default
 window font is the one specified for labels couldn't be loaded

---
 Source/Plugins/BuilderModes/General/Association.cs | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/Source/Plugins/BuilderModes/General/Association.cs b/Source/Plugins/BuilderModes/General/Association.cs
index 5db2f638d..c33d2ffc0 100755
--- a/Source/Plugins/BuilderModes/General/Association.cs
+++ b/Source/Plugins/BuilderModes/General/Association.cs
@@ -70,7 +70,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>
 			{
-- 
GitLab