patch 9.1.0026: win32: Windows default font lacking
Problem: win32: Windows default font lacking (@clach04)
Solution: Improve default font (Ken Takata)
win32: Improve default font
Currently, Fixedsys is the default font on Windows.
It is not suitable for recent High DPI environments.
* Change the default font to Consolas.
* Allow to change the default font by the translation message. E.g.:
```
msgid "DefaultFontNameForWindows"
msgstr "Courier New"
```
fixes: #12919
closes: #13266
Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/gui_w32.c b/src/gui_w32.c
index eb4c841..0935ecf 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -392,16 +392,6 @@
static DPI_AWARENESS_CONTEXT (WINAPI *pSetThreadDpiAwarenessContext)(DPI_AWARENESS_CONTEXT dpiContext) = NULL;
static DPI_AWARENESS (WINAPI *pGetAwarenessFromDpiAwarenessContext)(DPI_AWARENESS_CONTEXT) = NULL;
- static UINT WINAPI
-stubGetDpiForSystem(void)
-{
- HWND hwnd = GetDesktopWindow();
- HDC hdc = GetWindowDC(hwnd);
- UINT dpi = GetDeviceCaps(hdc, LOGPIXELSY);
- ReleaseDC(hwnd, hdc);
- return dpi;
-}
-
static int WINAPI
stubGetSystemMetricsForDpi(int nIndex, UINT dpi UNUSED)
{
@@ -5286,7 +5276,7 @@
fail:
// Disable PerMonitorV2 APIs.
- pGetDpiForSystem = stubGetDpiForSystem;
+ pGetDpiForSystem = vimGetDpiForSystem;
pGetDpiForWindow = NULL;
pGetSystemMetricsForDpi = stubGetSystemMetricsForDpi;
pSetThreadDpiAwarenessContext = NULL;