aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/text
diff options
context:
space:
mode:
authorLauris Kaplinski <lauris@src.gnome.org>2000-09-09 06:32:24 +0800
committerLauris Kaplinski <lauris@src.gnome.org>2000-09-09 06:32:24 +0800
commit1768e0e4fde11a6dfdf2336536edce3c954f4474 (patch)
tree8d778c052a38846c98e1def4e10438a459c2debf /widgets/text
parent16e05ea9a531460f45404773e0cb1f0a8aafb10f (diff)
downloadgsoc2013-evolution-1768e0e4fde11a6dfdf2336536edce3c954f4474.tar.gz
gsoc2013-evolution-1768e0e4fde11a6dfdf2336536edce3c954f4474.tar.zst
gsoc2013-evolution-1768e0e4fde11a6dfdf2336536edce3c954f4474.zip
Some UTF-8 fixes and experimental 16-bit unicode font support
svn path=/trunk/; revision=5279
Diffstat (limited to 'widgets/text')
-rw-r--r--widgets/text/e-text.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c
index ed87f21c95..cb064c9c40 100644
--- a/widgets/text/e-text.c
+++ b/widgets/text/e-text.c
@@ -683,8 +683,8 @@ calc_line_widths (EText *text)
{
struct line *lines;
int i;
- int j;
gdouble clip_width;
+ gchar *p;
/* Make sure line has been split */
if (text->text && text->num_lines == 0)
@@ -721,10 +721,10 @@ calc_line_widths (EText *text)
clip_width >= 0) {
if (text->font) {
lines->ellipsis_length = 0;
- for (j = 0; j < lines->length; j++ ) {
- if (e_font_utf8_text_width (text->font, E_FONT_PLAIN, lines->text, j) + text->ellipsis_width
- <= clip_width)
- lines->ellipsis_length = j;
+ for (p = lines->text; p && *p && (p - lines->text) < lines->length; p = unicode_next_utf8 (p)) {
+ if (e_font_utf8_text_width (text->font, E_FONT_PLAIN, lines->text, p - lines->text) +
+ text->ellipsis_width <= clip_width)
+ lines->ellipsis_length = p - lines->text;
else
break;
}