0
0
mirror of https://github.com/vim/vim.git synced 2025-10-23 08:44:20 -04:00

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>
This commit is contained in:
Ken Takata
2024-01-12 18:09:43 +01:00
committed by Christian Brabandt
parent dc4c37b9d5
commit d8cb1ddab7
5 changed files with 59 additions and 22 deletions

View File

@@ -392,16 +392,6 @@ static int (WINAPI *pGetSystemMetricsForDpi)(int, UINT) = NULL;
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 @@ load_dpi_func(void)
fail:
// Disable PerMonitorV2 APIs.
pGetDpiForSystem = stubGetDpiForSystem;
pGetDpiForSystem = vimGetDpiForSystem;
pGetDpiForWindow = NULL;
pGetSystemMetricsForDpi = stubGetSystemMetricsForDpi;
pSetThreadDpiAwarenessContext = NULL;