mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-05-30 08:20:28 -05:00
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. [originally from svn r5533] [r1406 == d9f7fc44bc177da552a14b879c199cc99f991e19]
This commit is contained in:
parent
bcd70d0661
commit
091462f240
@ -1296,24 +1296,11 @@ static void init_fonts(int pick_width, int pick_height)
|
|||||||
|
|
||||||
f(FONT_NORMAL, cfg.font.charset, fw_dontcare, FALSE);
|
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]);
|
SelectObject(hdc, fonts[FONT_NORMAL]);
|
||||||
GetTextMetrics(hdc, &tm);
|
GetTextMetrics(hdc, &tm);
|
||||||
|
|
||||||
|
GetObject(fonts[FONT_NORMAL], sizeof(LOGFONT), &lfont);
|
||||||
|
|
||||||
if (pick_width == 0 || pick_height == 0) {
|
if (pick_width == 0 || pick_height == 0) {
|
||||||
font_height = tm.tmHeight;
|
font_height = tm.tmHeight;
|
||||||
font_width = tm.tmAveCharWidth;
|
font_width = tm.tmAveCharWidth;
|
||||||
@ -2788,12 +2775,11 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
|||||||
set_input_locale((HKL)lParam);
|
set_input_locale((HKL)lParam);
|
||||||
sys_cursor_update();
|
sys_cursor_update();
|
||||||
break;
|
break;
|
||||||
case WM_IME_NOTIFY:
|
case WM_IME_STARTCOMPOSITION:
|
||||||
if(wParam == IMN_SETOPENSTATUS) {
|
{
|
||||||
HIMC hImc = ImmGetContext(hwnd);
|
HIMC hImc = ImmGetContext(hwnd);
|
||||||
ImmSetCompositionFont(hImc, &lfont);
|
ImmSetCompositionFont(hImc, &lfont);
|
||||||
ImmReleaseContext(hwnd, hImc);
|
ImmReleaseContext(hwnd, hImc);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WM_IME_COMPOSITION:
|
case WM_IME_COMPOSITION:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user