Skip to content

Commit 1c4fb70

Browse files
committed
Not related to isscint but: The editor's font now defaults to Consolas if available, consistent with most other editors.
1 parent d6c14df commit 1c4fb70

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

Projects/Src/CompForm.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ function TCompileForm.InitializeMemoBase(const Memo: TCompScintEdit; const Popup
671671
Memo.Align := alClient;
672672
Memo.AutoCompleteFontName := Font.Name;
673673
Memo.AutoCompleteFontSize := Font.Size;
674-
Memo.Font.Name := 'Courier New';
674+
Memo.Font.Name := GetPreferredMemoFont;
675675
Memo.Font.Size := 10;
676676
Memo.ShowHint := True;
677677
Memo.Styler := FMemosStyler;

Projects/Src/CompFunc.pas

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ function ReadScriptLines(const ALines: TStringList; const ReadFromFile: Boolean;
7171
function CreateBitmapInfo(const Width, Height, BitCount: Integer): TBitmapInfo;
7272
function GetWordOccurrenceFindOptions: TScintFindOptions;
7373
function GetSelTextOccurrenceFindOptions: TScintFindOptions;
74+
function GetPreferredMemoFont: String;
7475

7576
implementation
7677

@@ -725,10 +726,21 @@ function GetSelTextOccurrenceFindOptions: TScintFindOptions;
725726
Result := [];
726727
end;
727728

729+
var
730+
PreferredMemoFont: String;
731+
732+
function GetPreferredMemoFont: String;
733+
begin
734+
Result := PreferredMemoFont;
735+
end;
736+
728737
initialization
729738
var OSVersionInfo: TOSVersionInfo;
730739
OSVersionInfo.dwOSVersionInfoSize := SizeOf(OSVersionInfo);
731740
GetVersionEx(OSVersionInfo);
732741
WindowsVersion := (Byte(OSVersionInfo.dwMajorVersion) shl 24) or (Byte(OSVersionInfo.dwMinorVersion) shl 16) or Word(OSVersionInfo.dwBuildNumber);
742+
PreferredMemoFont := 'Consolas';
743+
if not FontExists(PreferredMemoFont) then
744+
PreferredMemoFont := 'Courier New';
733745

734746
end.

whatsnew.htm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
</ul>
4646
<p>Other changes:</p>
4747
<ul>
48+
<li>The editor's font now defaults to Consolas if available, consistent with most other editors.</li>
4849
<li>Added shortcuts to move selected lines up or down (Alt+Up and Alt+Down).</li>
4950
<li>Added a right-click popup menu to the editor's gutter column for breakpoints.</li>
5051
<li>Minor tweaks and documentation improvements.</li>

0 commit comments

Comments
 (0)