- dpyinfo->n_fonts++;
-
- /* Set global flag fonts_changed_p to non-zero if the font loaded
- has a character with a smaller width than any other character
- before, or if the font loaded has a smaller height than any other
- font loaded before. If this happens, it will make a glyph matrix
- reallocation necessary. */
- if (dpyinfo->n_fonts == 1)
- {
- dpyinfo->smallest_font_height = font->font.height;
- dpyinfo->smallest_char_width = font->min_width;
- fonts_changed_p = 1;
- }
- else
- {
- if (dpyinfo->smallest_font_height > font->font.height)
- dpyinfo->smallest_font_height = font->font.height, fonts_changed_p |= 1;
- if (dpyinfo->smallest_char_width > font->min_width)
- dpyinfo->smallest_char_width = font->min_width, fonts_changed_p |= 1;
- }
-
- if (fonts_changed_p)
- {
- if (dpyinfo->smallest_font_height == 0)
- dpyinfo->smallest_font_height = 1;
- if (dpyinfo->smallest_char_width == 0)
- dpyinfo->smallest_char_width = 1;
- }
-
- return font;
+ font_object = ftfont_driver.open (f, entity, pixel_size);
+ if (NILP (font_object))
+ return Qnil;
+ font = XFONT_OBJECT (font_object);
+ font->driver = &ftxfont_driver;
+ return font_object;