diff --git a/docs/faq.rst b/docs/faq.rst index fddcb6f31..e52490747 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -19,8 +19,8 @@ use Unicode characters from the private use area to represent symbols. Often these symbols are wide and should be rendered in two cells. However, since private use area symbols all have their width set to one in the Unicode standard, |kitty| renders them either smaller or truncated. The exception is if -these characters are followed by a space or non-breaking space in which case -kitty makes use of the extra cell to render them in two cells. This behavior +these characters are followed by a space or en-space (U+2002) in which case +kitty makes use of the extra cell to render them in two cells. This behavior can be turned off for specific symbols using :opt:`narrow_symbols`. diff --git a/kitty/fonts.c b/kitty/fonts.c index cb3822e22..a1e4c256e 100644 --- a/kitty/fonts.c +++ b/kitty/fonts.c @@ -534,7 +534,7 @@ START_ALLOW_CASE_RANGE switch(cpu_cell->ch) { case 0: case ' ': - case 0xa0: // nbsp + case 0x2002: // en-space case '\t': case IMAGE_PLACEHOLDER_CHAR: return BLANK_FONT; @@ -1326,7 +1326,7 @@ render_line(FONTS_DATA_HANDLE fg_, Line *line, index_type lnum, Cursor *cursor, unsigned int num_spaces = 0; while ( i + num_spaces + 1 < line->xnum - && (line->cpu_cells[i+num_spaces+1].ch == ' ' || line->cpu_cells[i+num_spaces+1].ch == 0xa0) // space or nbsp + && (line->cpu_cells[i+num_spaces+1].ch == ' ' || line->cpu_cells[i+num_spaces+1].ch == 0x2002) // space or en-space && num_spaces < MAX_NUM_EXTRA_GLYPHS_PUA && num_spaces + 1 < desired_cells ) {