diff --git a/docs/changelog.rst b/docs/changelog.rst index f35ed97e5..b11970a91 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -33,6 +33,9 @@ To update |kitty|, :doc:`follow the instructions `. - Fix piping PNG images into the icat kitten not working (:iss:`1920`) +- When the OS returns a fallback font that does not actually contain glyphs + for the text, do not exhaust the list of fallback fonts (:iss:`1918`) + 0.14.3 [2019-07-29] --------------------- diff --git a/kitty/fonts.c b/kitty/fonts.c index 1287a39b2..b88449004 100644 --- a/kitty/fonts.c +++ b/kitty/fonts.c @@ -497,6 +497,20 @@ load_fallback_font(FontGroup *fg, CPUCell *cell, bool bold, bool italic, bool em Font *af = &fg->fonts[ans]; if (!init_font(af, face, bold, italic, emoji_presentation)) fatal("Out of memory"); Py_DECREF(face); + if (!has_cell_text(af, cell)) { + if (global_state.debug_font_fallback) { + printf("The font chosen by the OS for the text: "); + printf("U+%x ", cell->ch); + for (unsigned i = 0; i < arraysz(cell->cc_idx) && cell->cc_idx[i]; i++) { + printf("U+%x ", codepoint_for_mark(cell->cc_idx[i])); + } + printf("is "); + PyObject_Print(af->face, stdout, 0); + printf(" but it does not actually contain glyphs for that text\n"); + } + del_font(af); + return MISSING_FONT; + } fg->fallback_fonts_count++; fg->fonts_count++; return ans;