From b59d1bda8b62e829df368bf1a504c4241263b4bf Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 16 May 2018 07:00:36 +0530 Subject: [PATCH] Add a comment for RTL shaping --- kitty/fonts.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kitty/fonts.c b/kitty/fonts.c index 9c8f7c8bb..2555caec9 100644 --- a/kitty/fonts.c +++ b/kitty/fonts.c @@ -720,6 +720,7 @@ shape_run(Cell *first_cell, index_type num_cells, Font *font) { num_codepoints_used_by_glyph = UINT32_MAX; } else { next_cluster = G(info)[G(glyph_idx) + 1].cluster; + // RTL languages like Arabic have decreasing cluster numbers if (next_cluster != cluster) num_codepoints_used_by_glyph = cluster > next_cluster ? cluster - next_cluster : next_cluster - cluster; } if (!current_group->num_glyphs) {