549 |
XFT_WEIGHT, XftTypeInteger, weight, |
XFT_WEIGHT, XftTypeInteger, weight, |
550 |
XFT_SLANT, XftTypeInteger, slant, |
XFT_SLANT, XftTypeInteger, slant, |
551 |
0); |
0); |
552 |
|
if (!renderFont) { |
553 |
|
/* CG: don't know if this can happen, should try fallback? */ |
554 |
|
free(font); |
555 |
|
return NULL; |
556 |
|
} |
557 |
font->ascent = renderFont->ascent; |
font->ascent = renderFont->ascent; |
558 |
font->descent = renderFont->descent; |
font->descent = renderFont->descent; |
559 |
font->private = renderFont; |
font->private = renderFont; |
565 |
XftFont *renderFont = font->private; |
XftFont *renderFont = font->private; |
566 |
|
|
567 |
XftFontClose(display, renderFont); |
XftFontClose(display, renderFont); |
568 |
|
/* Clear structure to force crash if font is still used after |
569 |
|
* close_font. |
570 |
|
*/ |
571 |
|
memset(font, 0, sizeof(*font)); |
572 |
free(font); |
free(font); |
573 |
} |
} |
574 |
|
|
770 |
XFontStruct *xfont = font->private; |
XFontStruct *xfont = font->private; |
771 |
|
|
772 |
XFreeFont(display, xfont); |
XFreeFont(display, xfont); |
773 |
|
/* Clear structure to force crash if font is still used after |
774 |
|
* close_font. |
775 |
|
*/ |
776 |
|
memset(font, 0, sizeof(*font)); |
777 |
free(font); |
free(font); |
778 |
} |
} |
779 |
|
|
826 |
static XCharStruct *handle_fallback(QEditScreen *s, QEFont **out_font, |
static XCharStruct *handle_fallback(QEditScreen *s, QEFont **out_font, |
827 |
QEFont *font, unsigned int cc) |
QEFont *font, unsigned int cc) |
828 |
{ |
{ |
829 |
XFontStruct *xfont = font->private; |
XFontStruct *xfont; |
830 |
XCharStruct *cs; |
XCharStruct *cs; |
831 |
int fallback_count; |
int fallback_count; |
832 |
QEFont *font1; |
QEFont *font1; |
844 |
*out_font = font1; |
*out_font = font1; |
845 |
return cs; |
return cs; |
846 |
} |
} |
847 |
|
release_font(s, font1); |
848 |
} |
} |
849 |
|
|
850 |
/* really no glyph : use default char in current font */ |
/* really no glyph : use default char in current font */ |
851 |
xfont = font->private; |
xfont = font->private; |
852 |
cs = get_char_struct(font, xfont->default_char); |
cs = get_char_struct(font, xfont->default_char); |
853 |
*out_font = font; |
*out_font = lock_font(s, font); |
854 |
return cs; |
return cs; |
855 |
} |
} |
856 |
|
|
880 |
metrics->font_ascent = max(metrics->font_ascent, font1->ascent); |
metrics->font_ascent = max(metrics->font_ascent, font1->ascent); |
881 |
metrics->font_descent = max(metrics->font_descent, font1->descent); |
metrics->font_descent = max(metrics->font_descent, font1->descent); |
882 |
} |
} |
883 |
|
release_font(s, font1); |
884 |
} |
} |
885 |
} |
} |
886 |
metrics->width = x; |
metrics->width = x; |