summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Aliste <jaliste@src.gnome.org>2013-04-30 23:13:45 -0400
committerJosé Aliste <jaliste@src.gnome.org>2013-05-02 19:01:13 -0400
commit1aeb5c840e25a7d8538f701659d77dcd7b3a8444 (patch)
tree1e34b17f76f7de2d510b28ae2cc908dac1f70496
parent5b38ec2ff9f26b0e3204ba79c1d1b5c0d2b92edb (diff)
downloadpango-1aeb5c840e25a7d8538f701659d77dcd7b3a8444.tar.gz
don't break words between a letter adjacent to a number
Newer Unicode specs (6.2 for instance) say that one should not break between letter or numbers that are adjacent. This also makes us to match word selection with many text capable apps.
-rw-r--r--pango/break.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/pango/break.c b/pango/break.c
index dd55edae..abdf45bc 100644
--- a/pango/break.c
+++ b/pango/break.c
@@ -453,8 +453,8 @@ typedef enum
STATE_SENTENCE_POST_DOT_SEP
} SentenceState;
-/* We call "123" and "foobar" words, but "123foo" is two words;
- * the Unicode spec just calls "123" a non-word
+/* Previously "123foo" was two words. But in UAX 29 of Unicode,
+ * we know don't break words between consecutive letters and numbers
*/
typedef enum
{
@@ -1155,27 +1155,12 @@ pango_default_break (const gchar *text,
attrs[i].is_word_end = TRUE;
}
}
- else
- {
- /* end the number word, start the letter word */
- attrs[i].is_word_end = TRUE;
- attrs[i].is_word_start = TRUE;
- current_word_type = WordLetters;
- }
-
last_word_letter = wc;
break;
case G_UNICODE_DECIMAL_NUMBER:
case G_UNICODE_LETTER_NUMBER:
case G_UNICODE_OTHER_NUMBER:
- if (current_word_type != WordNumbers)
- {
- attrs[i].is_word_end = TRUE;
- attrs[i].is_word_start = TRUE;
- current_word_type = WordNumbers;
- }
-
last_word_letter = wc;
break;