X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/8ef0be9bb1c9c70e2e98307f71e01ddef3116d99..ae62eaeb01088430162fa96e8cca35f721ff376d:/unix/gtkfont.c diff --git a/unix/gtkfont.c b/unix/gtkfont.c index af577bda..5db582a4 100644 --- a/unix/gtkfont.c +++ b/unix/gtkfont.c @@ -280,6 +280,9 @@ static int x11_font_has_glyph(XFontStruct *xfs, int byte1, int byte2) (xfs->max_char_or_byte2 - xfs->min_char_or_byte2 + 1))); } + if (!xfs->per_char) /* per_char NULL => everything in range exists */ + return TRUE; + return (xfs->per_char[index].ascent + xfs->per_char[index].descent > 0 || xfs->per_char[index].width > 0); } @@ -425,7 +428,8 @@ static int x11font_has_glyph(unifont *font, wchar_t glyph) if (!sbstring[0]) return FALSE; /* not even in the charset */ - return x11_font_has_glyph(xfont->fonts[0], 0, sbstring[0]); + return x11_font_has_glyph(xfont->fonts[0], 0, + (unsigned char)sbstring[0]); } } @@ -1563,6 +1567,7 @@ unifont *multifont_create(GtkWidget *widget, const char *name, if (!font) return NULL; + fallback = NULL; if (font->want_fallback) { for (i = 0; i < lenof(unifont_types); i++) { if (unifont_types[i]->create_fallback) {