struct font_info *fontp;
LOGFONT lf;
BOOL ok;
+ int codepage;
int i;
if (!fontname || !x_to_w32_font (fontname, &lf))
{
HDC hdc;
HANDLE oldobj;
- int codepage = w32_codepage_for_font (fontname);
+
+ codepage = w32_codepage_for_font (fontname);
hdc = GetDC (dpyinfo->root_window);
oldobj = SelectObject (hdc, font->hfont);
charset = xlfd_charset_of_font (fontname);
+ /* Cache the W32 codepage for a font. This makes w32_encode_char
+ (called for every glyph during redisplay) much faster. */
+ fontp->codepage = codepage;
+
/* Work out the font's full name. */
full_name = (char *)xmalloc (100);
if (full_name && w32_to_x_font (&lf, full_name, 100, charset))