- XFontStruct *xfont = malloc (sizeof (XFontStruct));
-
- if (! xfont)
- return NULL;
- font = ftfont_driver.open (f, entity, pixel_size);
- if (! font)
- {
- free (xfont);
- return NULL;
- }
- xfont->fid = (Font) 0;
- xfont->ascent = font->ascent;
- xfont->descent = font->descent;
- xfont->max_bounds.width = font->font.size;
- xfont->min_bounds.width = font->min_width;
- font->font.font = xfont;
- font->driver = &ftxfont_driver;
-
- 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;
- }