diff options
| author | Jason Rumney | 2004-08-31 22:43:26 +0000 |
|---|---|---|
| committer | Jason Rumney | 2004-08-31 22:43:26 +0000 |
| commit | 63e50ea6725779bc769024071e8590432f5de99c (patch) | |
| tree | 7cd07f0857418c06d29e738c9b8254e7678b81be /src | |
| parent | f7e2238577c4a735538a9b0e496d874b32f54e40 (diff) | |
| download | emacs-63e50ea6725779bc769024071e8590432f5de99c.tar.gz emacs-63e50ea6725779bc769024071e8590432f5de99c.zip | |
2004-08-31 NAKAMURA Toshikazu <nr-tkz@nifty.com> (tiny change)
* w32fns.c (w32_load_font): If a BDF font is already loaded, do not
reload it.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32fns.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index 0cb3abe91cd..8d695fd65bc 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -4642,6 +4642,7 @@ int size; | |||
| 4642 | { | 4642 | { |
| 4643 | Lisp_Object bdf_fonts; | 4643 | Lisp_Object bdf_fonts; |
| 4644 | struct font_info *retval = NULL; | 4644 | struct font_info *retval = NULL; |
| 4645 | struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); | ||
| 4645 | 4646 | ||
| 4646 | bdf_fonts = w32_list_bdf_fonts (build_string (fontname), 1); | 4647 | bdf_fonts = w32_list_bdf_fonts (build_string (fontname), 1); |
| 4647 | 4648 | ||
| @@ -4649,11 +4650,22 @@ int size; | |||
| 4649 | { | 4650 | { |
| 4650 | char *bdf_name, *bdf_file; | 4651 | char *bdf_name, *bdf_file; |
| 4651 | Lisp_Object bdf_pair; | 4652 | Lisp_Object bdf_pair; |
| 4653 | int i; | ||
| 4652 | 4654 | ||
| 4653 | bdf_name = SDATA (XCAR (bdf_fonts)); | 4655 | bdf_name = SDATA (XCAR (bdf_fonts)); |
| 4654 | bdf_pair = Fassoc (XCAR (bdf_fonts), Vw32_bdf_filename_alist); | 4656 | bdf_pair = Fassoc (XCAR (bdf_fonts), Vw32_bdf_filename_alist); |
| 4655 | bdf_file = SDATA (XCDR (bdf_pair)); | 4657 | bdf_file = SDATA (XCDR (bdf_pair)); |
| 4656 | 4658 | ||
| 4659 | // If the font is already loaded, do not load it again. | ||
| 4660 | for (i = 0; i < dpyinfo->n_fonts; i++) | ||
| 4661 | { | ||
| 4662 | if ((dpyinfo->font_table[i].name | ||
| 4663 | && !strcmp (dpyinfo->font_table[i].name, bdf_name)) | ||
| 4664 | || (dpyinfo->font_table[i].full_name | ||
| 4665 | && !strcmp (dpyinfo->font_table[i].full_name, bdf_name))) | ||
| 4666 | return dpyinfo->font_table[i]; | ||
| 4667 | } | ||
| 4668 | |||
| 4657 | retval = w32_load_bdf_font (f, bdf_name, size, bdf_file); | 4669 | retval = w32_load_bdf_font (f, bdf_name, size, bdf_file); |
| 4658 | 4670 | ||
| 4659 | bdf_fonts = XCDR (bdf_fonts); | 4671 | bdf_fonts = XCDR (bdf_fonts); |