From 1e19f89dbf0345086b032e72fd6607871b3da85c Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Fri, 29 Jan 2010 21:02:00 +0000 Subject: [PATCH] [CSR] - DejaVu Sans Mono seems to have a bug which makes Windows and Arwinss report double max char width as compared to a real char width. Since only a monospace font could be used, measure exact char width using GetTextExtentPoint32W and use that value. svn path=/trunk/; revision=45319 --- reactos/subsystems/win32/csrss/win32csr/guiconsole.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reactos/subsystems/win32/csrss/win32csr/guiconsole.c b/reactos/subsystems/win32/csrss/win32csr/guiconsole.c index 1b43429cc12..51eca7c21c7 100644 --- a/reactos/subsystems/win32/csrss/win32csr/guiconsole.c +++ b/reactos/subsystems/win32/csrss/win32csr/guiconsole.c @@ -685,6 +685,7 @@ GuiConsoleHandleNcCreate(HWND hWnd, CREATESTRUCTW *Create) HDC Dc; HFONT OldFont; TEXTMETRICW Metrics; + SIZE CharSize; PCSRSS_PROCESS_DATA ProcessData; HKEY hKey; @@ -762,6 +763,11 @@ GuiConsoleHandleNcCreate(HWND hWnd, CREATESTRUCTW *Create) } GuiData->CharWidth = Metrics.tmMaxCharWidth; GuiData->CharHeight = Metrics.tmHeight + Metrics.tmExternalLeading; + + /* Measure real char width more precisely if possible. */ + if (GetTextExtentPoint32W(Dc, L"R", 1, &CharSize)) + GuiData->CharWidth = CharSize.cx; + SelectObject(Dc, OldFont); ReleaseDC(hWnd, Dc);