From: Christian Dywan Date: Fri, 22 May 2009 02:01:56 +0000 (+0200) Subject: Implement a hack to keep the text direction left-to-right X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=16912f4cdfc5a3ca37b20052026f0134c6019ef4;p=midori Implement a hack to keep the text direction left-to-right --- diff --git a/midori/midori-view.c b/midori/midori-view.c index 4c142f52..5619378c 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -514,6 +514,17 @@ midori_view_class_init (MidoriViewClass* class) static void midori_view_update_title (MidoriView* view) { + /* If left-to-right text is combined with right-to-left text the default + behaviour of Pango can result in awkwardly aligned text. For example + "‪بستيان نوصر (hadess) | An era comes to an end - Midori" becomes + "hadess) | An era comes to an end - Midori) بستيان نوصر". So to prevent + this we insert an LRE character before the title which indicates that + we want left-to-right but retains the direction of right-to-left text. */ + if (view->title && !g_str_has_prefix (view->title, "‪")) + { + gchar* new_title = g_strconcat ("‪", view->title, NULL); + katze_assign (view->title, new_title); + } #define title midori_view_get_display_title (view) if (view->tab_label) {