[PATCH v2] conhost: Only use the maximum character width if a double-byte character set is in use
Hugh McMaster
hugh.mcmaster at outlook.com
Tue Nov 23 05:14:08 CST 2021
Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
programs/conhost/window.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/programs/conhost/window.c b/programs/conhost/window.c
index 319463537d5..7ad0d48effd 100644
--- a/programs/conhost/window.c
+++ b/programs/conhost/window.c
@@ -646,7 +646,7 @@ static HFONT select_font_config( struct console_config *config, unsigned int cp,
lstrcpyW( config->face_name, lf->lfFaceName );
/* FIXME: use maximum width for DBCS codepages since some chars take two cells */
- if (GetCPInfo( cp, &cpinfo ) && cpinfo.MaxCharSize > 1)
+ if (GetCPInfo( cp, &cpinfo ) && cpinfo.MaxCharSize == 2)
config->cell_width = tm.tmMaxCharWidth;
return font;
@@ -713,7 +713,7 @@ static BOOL set_console_font( struct console *console, const LOGFONTW *logfont )
memcpy( font_info->face_name, logfont->lfFaceName, font_info->face_len * sizeof(WCHAR) );
/* FIXME: use maximum width for DBCS codepages since some chars take two cells */
- if (GetCPInfo( console->output_cp, &cpinfo ) && cpinfo.MaxCharSize > 1)
+ if (GetCPInfo( console->output_cp, &cpinfo ) && cpinfo.MaxCharSize == 2)
font_info->width = tm.tmMaxCharWidth;
if (console->window->font) DeleteObject( console->window->font );
--
2.34.0
More information about the wine-devel
mailing list