Skip to content

Commit

Permalink
Not related to isscint but: The editor's font now defaults to Consola…
Browse files Browse the repository at this point in the history
…s if available, consistent with most other editors.
  • Loading branch information
martijnlaan committed Jun 13, 2024
1 parent d6c14df commit 1c4fb70
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Projects/Src/CompForm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ function TCompileForm.InitializeMemoBase(const Memo: TCompScintEdit; const Popup
Memo.Align := alClient;
Memo.AutoCompleteFontName := Font.Name;
Memo.AutoCompleteFontSize := Font.Size;
Memo.Font.Name := 'Courier New';
Memo.Font.Name := GetPreferredMemoFont;
Memo.Font.Size := 10;
Memo.ShowHint := True;
Memo.Styler := FMemosStyler;
Expand Down
12 changes: 12 additions & 0 deletions Projects/Src/CompFunc.pas
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function ReadScriptLines(const ALines: TStringList; const ReadFromFile: Boolean;
function CreateBitmapInfo(const Width, Height, BitCount: Integer): TBitmapInfo;
function GetWordOccurrenceFindOptions: TScintFindOptions;
function GetSelTextOccurrenceFindOptions: TScintFindOptions;
function GetPreferredMemoFont: String;

implementation

Expand Down Expand Up @@ -725,10 +726,21 @@ function GetSelTextOccurrenceFindOptions: TScintFindOptions;
Result := [];
end;

var
PreferredMemoFont: String;

function GetPreferredMemoFont: String;
begin
Result := PreferredMemoFont;
end;

initialization
var OSVersionInfo: TOSVersionInfo;
OSVersionInfo.dwOSVersionInfoSize := SizeOf(OSVersionInfo);
GetVersionEx(OSVersionInfo);
WindowsVersion := (Byte(OSVersionInfo.dwMajorVersion) shl 24) or (Byte(OSVersionInfo.dwMinorVersion) shl 16) or Word(OSVersionInfo.dwBuildNumber);
PreferredMemoFont := 'Consolas';
if not FontExists(PreferredMemoFont) then
PreferredMemoFont := 'Courier New';

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

0 comments on commit 1c4fb70

Please sign in to comment.