]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - unix/gtkfont.c
Cross-reference all the host key docs.
[PuTTY.git] / unix / gtkfont.c
index 725b1d4b9b1c2d9167a659ab58768f64048afd51..ed9888bceaa3b6ba4946ca1c4a9409c1e1896b19 100644 (file)
@@ -350,7 +350,7 @@ static int x11_font_has_glyph(XFontStruct *xfs, int byte1, int byte2)
      * which glyphs _are_ missing.
      */
     const XCharStruct *xcs = x11_char_struct(xfs, byte1, byte2);
-    return (xcs->ascent + xcs->descent > 0 || xcs->width > 0);
+    return xcs && (xcs->ascent + xcs->descent > 0 || xcs->width > 0);
 }
 
 static unifont *x11font_create(GtkWidget *widget, const char *name,
@@ -1543,7 +1543,8 @@ static void pangofont_draw_internal(unifont_drawctx *ctx, unifont *font,
                            (unsigned char)utfptr[clen] < 0xC0)
                         clen++;
                     n++;
-                    if (pangofont_char_width(layout, pfont,
+                    if (is_rtl(string[n-1]) ||
+                        pangofont_char_width(layout, pfont,
                                              string[n-1], utfptr + oldclen,
                                              clen - oldclen) != desired) {
                         clen = oldclen;