wineconsole: Correctly handle TrueType font widths

Hugh McMaster hugh.mcmaster at outlook.com
Tue Nov 1 06:59:30 CDT 2016


Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
 programs/wineconsole/user.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/programs/wineconsole/user.c b/programs/wineconsole/user.c
index eb68373..b6734cc 100644
--- a/programs/wineconsole/user.c
+++ b/programs/wineconsole/user.c
@@ -461,7 +461,11 @@ HFONT WCUSER_CopyFont(struct config_data* config, HWND hWnd, const LOGFONTW* lf,
     SelectObject(hDC, hOldFont);
     ReleaseDC(hWnd, hDC);
 
-    config->cell_width  = tm.tmMaxCharWidth;
+    if (tm.tmPitchAndFamily & (TMPF_VECTOR | TMPF_TRUETYPE))
+        config->cell_width = tm.tmAveCharWidth;
+    else
+        config->cell_width = tm.tmMaxCharWidth;
+
     config->cell_height = tm.tmHeight + tm.tmExternalLeading;
     config->font_weight = tm.tmWeight;
     lstrcpyW(config->face_name, lf->lfFaceName);
-- 
2.7.4




More information about the wine-patches mailing list