diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | pango/mini-fribidi/fribidi.c | 13 |
2 files changed, 18 insertions, 3 deletions
@@ -1,3 +1,11 @@ +2005-11-14 Behdad Esfahbod <behdad@gnome.org> + + * pango/mini-fribidi/fribidi.c): Include string.h, needed for memset. + + * pango/mini-fribidi/fribidi.c (fribidi_analyse_string_utf8): + Handle short-circuiting of the case when there are ltr letters, + no rtl strongs, and base dir is weak rtl. Pointed out by Owen Taylor. + 2005-11-11 Behdad Esfahbod <behdad@gnome.org> * pango/pango-layout.c (pango_layout_get_alignment): Fix get/set diff --git a/pango/mini-fribidi/fribidi.c b/pango/mini-fribidi/fribidi.c index dfe9411a..4d9c0b98 100644 --- a/pango/mini-fribidi/fribidi.c +++ b/pango/mini-fribidi/fribidi.c @@ -22,6 +22,7 @@ */ #include <stdlib.h> +#include <string.h> #ifdef HAVE_CONFIG_H #include <config.h> @@ -547,10 +548,16 @@ fribidi_analyse_string_utf8 ( /* input */ type_rl_list = run_length_encode_types_utf8 (str, bytelen, len, &ored_types, &anded_strongs); - /* If there's absolutely nothing with a hint of rtl, then all resolved - * levels will be ltr (even). short-circuit. + /* The case that all resolved levels will be ltr. + * First, all strongs should be ltr, and one of the following: + * + * o *pbase_dir doesn't have an rtl taste. + * o there are letters, and *pbase_dir is weak. */ - if (!FRIBIDI_IS_RTL (*pbase_dir | ored_types)) + if (!FRIBIDI_IS_RTL (ored_types) && + (!FRIBIDI_IS_RTL (*pbase_dir) || + (FRIBIDI_IS_WEAK (*pbase_dir) && FRIBIDI_IS_LETTER (ored_types)) + )) { /* all ltr */ free_rl_list (type_rl_list); |