Dmitry Timoshkov dmitry@baikal.ru writes:
Dmitry Timoshkov dmitry@baikal.ru wrote:
static void set_fixed_font( HWND dlg, UINT id ) {
- HFONT hfont = (HFONT)SendDlgItemMessageW( dlg, id, WM_GETFONT, 0, 0);
- LOGFONTW font;
- HFONT hfont;
- GetObjectW(hfont, sizeof(LOGFONTW), &font);
- font.lfPitchAndFamily = FIXED_PITCH;
- font.lfFaceName[0] = 0;
- hfont = CreateFontIndirectW(&font);
- hfont = GetStockObject( ANSI_FIXED_FONT ); SendDlgItemMessageW( dlg, id, WM_SETFONT, (WPARAM)hfont, TRUE );
}
To clarify things a bit: current code uses empty font face name, and GDI uses "System" font in that case (regardless of requested FIXED_PITCH), which is absolutely not readable. ANSI_FIXED_FONT should use built-in "Courier", which is actually a FIXED_PITCH font and much more readable.
For me every tab is replaced by a black square, so it doesn't look all that good...