File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,18 @@ private Settings LoadOrCreateNew (FileInfo fileInfo)
204204
205205 settings . FileColors ??= [ ] ;
206206
207+ try
208+ {
209+ using var fontFamily = new FontFamily ( settings . Preferences . FontName ) ;
210+ settings . Preferences . FontName = fontFamily . Name ;
211+ }
212+ catch ( ArgumentException )
213+ {
214+ var genericMonospaceFont = FontFamily . GenericMonospace . Name ;
215+ _logger . Warn ( $ "Specified font '{ settings . Preferences . FontName } ' not found. Falling back to default: '{ genericMonospaceFont } '.") ;
216+ settings . Preferences . FontName = genericMonospaceFont ;
217+ }
218+
207219 if ( settings . Preferences . ShowTailColor == Color . Empty )
208220 {
209221 settings . Preferences . ShowTailColor = Color . FromKnownColor ( KnownColor . Blue ) ;
You can’t perform that action at this time.
0 commit comments