Explorar o código

Not related to isscint but: The editor's font now defaults to Consolas if available, consistent with most other editors.

Martijn Laan hai 1 ano
pai
achega
1c4fb70970
Modificáronse 3 ficheiros con 14 adicións e 1 borrados
  1. 1 1
      Projects/Src/CompForm.pas
  2. 12 0
      Projects/Src/CompFunc.pas
  3. 1 0
      whatsnew.htm

+ 1 - 1
Projects/Src/CompForm.pas

@@ -671,7 +671,7 @@ begin
   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;

+ 12 - 0
Projects/Src/CompFunc.pas

@@ -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
 
@@ -725,10 +726,21 @@ begin
   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 - 0
whatsnew.htm

@@ -45,6 +45,7 @@ For conditions of distribution and use, see <a href="files/is/license.txt">LICEN
 </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>