-
Notifications
You must be signed in to change notification settings - Fork 10
/
consoletuner.pas
40 lines (33 loc) · 1011 Bytes
/
consoletuner.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
unit ConsoleTuner;
interface
uses
{$IFDEF WINDOWS}
windows;
{$ENDIF}
const
LF_FACESIZE = 32;
type
CONSOLE_FONT_INFOEX = record
cbSize : ULONG;
nFont : DWORD;
dwFontSize : COORD;
FontFamily : UINT;
FontWeight : UINT;
FaceName : array [0..LF_FACESIZE-1] of WCHAR;
end;
function SetLucidaConsoleFont(): Boolean;
implementation
function SetCurrentConsoleFontEx(hConsoleOutput: HANDLE; bMaximumWindow: BOOL; var CONSOLE_FONT_INFOEX): BOOL; stdcall; external kernel32;
function SetLucidaConsoleFont(): Boolean;
var
New_CONSOLE_FONT_INFOEX: CONSOLE_FONT_INFOEX;
begin
FillChar(New_CONSOLE_FONT_INFOEX, SizeOf(CONSOLE_FONT_INFOEX), 0);
New_CONSOLE_FONT_INFOEX.cbSize := SizeOf(CONSOLE_FONT_INFOEX);
//New_CONSOLE_FONT_INFOEX.FaceName := 'Consolas';
New_CONSOLE_FONT_INFOEX.FaceName := 'Lucida Console';
New_CONSOLE_FONT_INFOEX.dwFontSize.Y := 24;
SetCurrentConsoleFontEx(StdOutputHandle, False, New_CONSOLE_FONT_INFOEX);
Exit(True);
end;
end.