4644 |
{ |
{ |
4645 |
Lisp_Object bdf_fonts; |
Lisp_Object bdf_fonts; |
4646 |
struct font_info *retval = NULL; |
struct font_info *retval = NULL; |
4647 |
|
struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); |
4648 |
|
|
4649 |
bdf_fonts = w32_list_bdf_fonts (build_string (fontname), 1); |
bdf_fonts = w32_list_bdf_fonts (build_string (fontname), 1); |
4650 |
|
|
4652 |
{ |
{ |
4653 |
char *bdf_name, *bdf_file; |
char *bdf_name, *bdf_file; |
4654 |
Lisp_Object bdf_pair; |
Lisp_Object bdf_pair; |
4655 |
|
int i; |
4656 |
|
|
4657 |
bdf_name = SDATA (XCAR (bdf_fonts)); |
bdf_name = SDATA (XCAR (bdf_fonts)); |
4658 |
bdf_pair = Fassoc (XCAR (bdf_fonts), Vw32_bdf_filename_alist); |
bdf_pair = Fassoc (XCAR (bdf_fonts), Vw32_bdf_filename_alist); |
4659 |
bdf_file = SDATA (XCDR (bdf_pair)); |
bdf_file = SDATA (XCDR (bdf_pair)); |
4660 |
|
|
4661 |
|
// If the font is already loaded, do not load it again. |
4662 |
|
for (i = 0; i < dpyinfo->n_fonts; i++) |
4663 |
|
{ |
4664 |
|
if ((dpyinfo->font_table[i].name |
4665 |
|
&& !strcmp (dpyinfo->font_table[i].name, bdf_name)) |
4666 |
|
|| (dpyinfo->font_table[i].full_name |
4667 |
|
&& !strcmp (dpyinfo->font_table[i].full_name, bdf_name))) |
4668 |
|
return dpyinfo->font_table + i; |
4669 |
|
} |
4670 |
|
|
4671 |
retval = w32_load_bdf_font (f, bdf_name, size, bdf_file); |
retval = w32_load_bdf_font (f, bdf_name, size, bdf_file); |
4672 |
|
|
4673 |
bdf_fonts = XCDR (bdf_fonts); |
bdf_fonts = XCDR (bdf_fonts); |