Author: fireball Date: Fri Jan 29 22:02:00 2010 New Revision: 45319
URL: http://svn.reactos.org/svn/reactos?rev=45319&view=rev Log: [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.
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win3... ============================================================================== --- trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c [iso-8859-1] Fri Jan 29 22:02:00 2010 @@ -685,6 +685,7 @@ HDC Dc; HFONT OldFont; TEXTMETRICW Metrics; + SIZE CharSize; PCSRSS_PROCESS_DATA ProcessData; HKEY hKey;
@@ -762,6 +763,11 @@ } 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);