Skip to content

Commit

Permalink
Dodanie zmiany czcionki na Lucida console w celu pewnego wspierania p…
Browse files Browse the repository at this point in the history
…olskich znaków
  • Loading branch information
Nircek committed Nov 21, 2018
1 parent 4e99524 commit 617896d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
11 changes: 11 additions & 0 deletions labirynt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@ void set(COORDS c, char ch) {
}
void winutf8() {
#if __WIN32
CONSOLE_FONT_INFOEX cfi;
HANDLE hndl = GetStdHandle(STD_OUTPUT_HANDLE);
GetCurrentConsoleFontEx(hndl, false, &cfi);
cfi.cbSize = sizeof cfi;
cfi.nFont = 0;
cfi.dwFontSize.X = 0;
cfi.dwFontSize.Y = 12;
cfi.FontFamily = FF_DONTCARE;
cfi.FontWeight = FW_NORMAL;
wcscpy(cfi.FaceName, L"Lucida Console");
SetCurrentConsoleFontEx(hndl, 0, &cfi);
system("chcp 65001>nul");
#endif // __WIN32
}
Expand Down
19 changes: 19 additions & 0 deletions labirynt.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,25 @@
#include <vector>
#include "getch.h"
#include "color.h"
#if _WIN32
#include <windows.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _CONSOLE_FONT_INFOEX {
ULONG cbSize;
DWORD nFont;
COORD dwFontSize;
UINT FontFamily;
UINT FontWeight;
WCHAR FaceName[LF_FACESIZE];
} CONSOLE_FONT_INFOEX, *PCONSOLE_FONT_INFOEX;
BOOL WINAPI GetCurrentConsoleFontEx(HANDLE, BOOL, PCONSOLE_FONT_INFOEX);
BOOL WINAPI SetCurrentConsoleFontEx(HANDLE, BOOL, PCONSOLE_FONT_INFOEX);
#ifdef __cplusplus
}
#endif
#endif

using namespace std;

Expand Down

0 comments on commit 617896d

Please sign in to comment.