diff options
| author | Andrew Innes | 2001-10-17 17:47:56 +0000 |
|---|---|---|
| committer | Andrew Innes | 2001-10-17 17:47:56 +0000 |
| commit | 19c291d324bd521b35f4cb0c9082bf730bd77fd6 (patch) | |
| tree | b32be6f617cb5afbaa1543d2ef45a43b4db5872b | |
| parent | 677e7496ff4020d6b19f1025171a8254b6073c34 (diff) | |
| download | emacs-19c291d324bd521b35f4cb0c9082bf730bd77fd6.tar.gz emacs-19c291d324bd521b35f4cb0c9082bf730bd77fd6.zip | |
(w32_load_system_font): Cache codepage for font, in
font_info.charset field.
| -rw-r--r-- | src/w32fns.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index 18e40ed09ed..991ac7ac3af 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -5585,6 +5585,7 @@ w32_load_system_font (f,fontname,size) | |||
| 5585 | struct font_info *fontp; | 5585 | struct font_info *fontp; |
| 5586 | LOGFONT lf; | 5586 | LOGFONT lf; |
| 5587 | BOOL ok; | 5587 | BOOL ok; |
| 5588 | int codepage; | ||
| 5588 | int i; | 5589 | int i; |
| 5589 | 5590 | ||
| 5590 | if (!fontname || !x_to_w32_font (fontname, &lf)) | 5591 | if (!fontname || !x_to_w32_font (fontname, &lf)) |
| @@ -5616,7 +5617,8 @@ w32_load_system_font (f,fontname,size) | |||
| 5616 | { | 5617 | { |
| 5617 | HDC hdc; | 5618 | HDC hdc; |
| 5618 | HANDLE oldobj; | 5619 | HANDLE oldobj; |
| 5619 | int codepage = w32_codepage_for_font (fontname); | 5620 | |
| 5621 | codepage = w32_codepage_for_font (fontname); | ||
| 5620 | 5622 | ||
| 5621 | hdc = GetDC (dpyinfo->root_window); | 5623 | hdc = GetDC (dpyinfo->root_window); |
| 5622 | oldobj = SelectObject (hdc, font->hfont); | 5624 | oldobj = SelectObject (hdc, font->hfont); |
| @@ -5692,6 +5694,10 @@ w32_load_system_font (f,fontname,size) | |||
| 5692 | 5694 | ||
| 5693 | charset = xlfd_charset_of_font (fontname); | 5695 | charset = xlfd_charset_of_font (fontname); |
| 5694 | 5696 | ||
| 5697 | /* Cache the W32 codepage for a font. This makes w32_encode_char | ||
| 5698 | (called for every glyph during redisplay) much faster. */ | ||
| 5699 | fontp->codepage = codepage; | ||
| 5700 | |||
| 5695 | /* Work out the font's full name. */ | 5701 | /* Work out the font's full name. */ |
| 5696 | full_name = (char *)xmalloc (100); | 5702 | full_name = (char *)xmalloc (100); |
| 5697 | if (full_name && w32_to_x_font (&lf, full_name, 100, charset)) | 5703 | if (full_name && w32_to_x_font (&lf, full_name, 100, charset)) |