wineconsole: Leave room for wide characters only when using a DBCS codepage.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
a8511a3e17
commit
29533e4844
@ -449,6 +449,7 @@ HFONT WCUSER_CopyFont(struct config_data* config, HWND hWnd, const LOGFONTW* lf,
|
|||||||
TEXTMETRICW tm;
|
TEXTMETRICW tm;
|
||||||
HDC hDC;
|
HDC hDC;
|
||||||
HFONT hFont, hOldFont;
|
HFONT hFont, hOldFont;
|
||||||
|
CPINFO cpinfo;
|
||||||
|
|
||||||
if (!(hDC = GetDC(hWnd))) return NULL;
|
if (!(hDC = GetDC(hWnd))) return NULL;
|
||||||
if (!(hFont = CreateFontIndirectW(lf)))
|
if (!(hFont = CreateFontIndirectW(lf)))
|
||||||
@ -461,12 +462,16 @@ HFONT WCUSER_CopyFont(struct config_data* config, HWND hWnd, const LOGFONTW* lf,
|
|||||||
SelectObject(hDC, hOldFont);
|
SelectObject(hDC, hOldFont);
|
||||||
ReleaseDC(hWnd, hDC);
|
ReleaseDC(hWnd, hDC);
|
||||||
|
|
||||||
config->cell_width = tm.tmMaxCharWidth;
|
config->cell_width = tm.tmAveCharWidth;
|
||||||
config->cell_height = tm.tmHeight + tm.tmExternalLeading;
|
config->cell_height = tm.tmHeight + tm.tmExternalLeading;
|
||||||
config->font_weight = tm.tmWeight;
|
config->font_weight = tm.tmWeight;
|
||||||
lstrcpyW(config->face_name, lf->lfFaceName);
|
lstrcpyW(config->face_name, lf->lfFaceName);
|
||||||
if (el) *el = tm.tmExternalLeading;
|
if (el) *el = tm.tmExternalLeading;
|
||||||
|
|
||||||
|
/* FIXME: use maximum width for DBCS codepages since some chars take two cells */
|
||||||
|
if (GetCPInfo( GetConsoleOutputCP(), &cpinfo ) && cpinfo.MaxCharSize > 1)
|
||||||
|
config->cell_width = tm.tmMaxCharWidth;
|
||||||
|
|
||||||
return hFont;
|
return hFont;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user