Skip to content

Commit 74abc16

Browse files
committed
fix: prevent editors from getting an empty font name
Refs #2338
1 parent 50b6864 commit 74abc16

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

source/main.pas

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13364,12 +13364,15 @@ procedure TMainForm.SetupSynEditor(Editor: TSynMemo);
1336413364
BaseEditor: TSynMemo;
1336513365
LineNumberPart: TSynGutterLineNumber;
1336613366
CodeFoldingPart: TSynGutterCodeFolding;
13367+
FontName: String;
1336713368
begin
1336813369
LogSQL('Setting up TSynMemo "'+Editor.Name+'"', lcDebug);
1336913370
BaseEditor := SynMemoQuery;
1337013371
Editor.Color := GetThemeColor(clWindow);
1337113372
//Editor.ScrollHintColor := GetThemeColor(clInfoBk);
13372-
Editor.Font.Name := AppSettings.ReadString(asFontName);
13373+
FontName := AppSettings.ReadString(asFontName);
13374+
if not FontName.IsEmpty then
13375+
Editor.Font.Name := FontName;
1337313376
Editor.Font.Size := AppSettings.ReadInt(asFontSize);
1337413377
Editor.Font.Quality := fqCleartypeNatural;
1337513378
LineNumberPart := Editor.Gutter.LineNumberPart(0);

0 commit comments

Comments
 (0)