From fd64bb2775d7bf733130dd70cb41c0bc9a7645ec Mon Sep 17 00:00:00 2001 From: jacob Date: Mon, 21 Mar 2005 01:05:38 +0000 Subject: [PATCH] Improvement for IME font display from Hung-Te Lin. Not tested, but it appears only to affect Glenn Maynard's r1406 code from <20011006170741.A23470@zewt.org> and nothing else, so seems harmless enough. git-svn-id: svn://svn.tartarus.org/sgt/putty@5533 cda61777-01e9-0310-a592-d414129be87e --- windows/window.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/windows/window.c b/windows/window.c index 6046cf7a..fedcc359 100644 --- a/windows/window.c +++ b/windows/window.c @@ -1296,24 +1296,11 @@ static void init_fonts(int pick_width, int pick_height) f(FONT_NORMAL, cfg.font.charset, fw_dontcare, FALSE); - lfont.lfHeight = font_height; - lfont.lfWidth = font_width; - lfont.lfEscapement = 0; - lfont.lfOrientation = 0; - lfont.lfWeight = fw_dontcare; - lfont.lfItalic = FALSE; - lfont.lfUnderline = FALSE; - lfont.lfStrikeOut = FALSE; - lfont.lfCharSet = cfg.font.charset; - lfont.lfOutPrecision = OUT_DEFAULT_PRECIS; - lfont.lfClipPrecision = CLIP_DEFAULT_PRECIS; - lfont.lfQuality = DEFAULT_QUALITY; - lfont.lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE; - strncpy(lfont.lfFaceName, cfg.font.name, LF_FACESIZE); - SelectObject(hdc, fonts[FONT_NORMAL]); GetTextMetrics(hdc, &tm); + GetObject(fonts[FONT_NORMAL], sizeof(LOGFONT), &lfont); + if (pick_width == 0 || pick_height == 0) { font_height = tm.tmHeight; font_width = tm.tmAveCharWidth; @@ -2788,12 +2775,11 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, set_input_locale((HKL)lParam); sys_cursor_update(); break; - case WM_IME_NOTIFY: - if(wParam == IMN_SETOPENSTATUS) { + case WM_IME_STARTCOMPOSITION: + { HIMC hImc = ImmGetContext(hwnd); ImmSetCompositionFont(hImc, &lfont); ImmReleaseContext(hwnd, hImc); - return 0; } break; case WM_IME_COMPOSITION: -- 2.11.0