summaryrefslogtreecommitdiff
path: root/pango/break.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2000-06-21 16:13:42 +0000
committerOwen Taylor <otaylor@src.gnome.org>2000-06-21 16:13:42 +0000
commit0e6409a158d9dd76a31b9eccf7c4f26c5466d082 (patch)
treedc120946f7efa23c6c91c64aee2686d2637e3970 /pango/break.c
parent197a2a68c145d3568cd4f0f2fee3d3b55570134f (diff)
downloadpango-0e6409a158d9dd76a31b9eccf7c4f26c5466d082.tar.gz
Remove tests for libunicode
Wed Jun 21 12:11:56 2000 Owen Taylor <otaylor@redhat.com> * configure.in: Remove tests for libunicode * pango/utils.[ch]: Removed. The functions from here are now in GLib. * **.[ch]: Removed use of libunicode and utils.c in favor of Unicode functions in GLib. Requires latest GLib from CVS.
Diffstat (limited to 'pango/break.c')
-rw-r--r--pango/break.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/pango/break.c b/pango/break.c
index 70de69ce..93ffecf2 100644
--- a/pango/break.c
+++ b/pango/break.c
@@ -20,8 +20,6 @@
*/
#include "pango.h"
-#include <unicode.h>
-#include "utils.h"
/**
* pango_break:
@@ -41,20 +39,14 @@ void pango_break (const gchar *text,
/* Pseudo-implementation */
const gchar *cur = text;
- const gchar *next;
gint i = 0;
- GUChar4 wc;
+ gunichar wc;
- while (*cur)
+ while (*cur && cur - text < length)
{
- next = unicode_get_utf8 (cur, &wc);
- if (!next)
+ wc = g_utf8_get_char (cur);
+ if (wc == (gunichar)-1)
break; /* FIXME: ERROR */
- if (cur == next)
- break;
- if ((next - text) > length)
- break;
- cur = next;
attrs[i].is_white = (wc == ' ' || wc == '\t' || wc == '\n' || wc == 0x200b) ? 1 : 0;
attrs[i].is_break = i == 0 || attrs[i-1].is_white || attrs[i].is_white;
@@ -62,5 +54,6 @@ void pango_break (const gchar *text,
attrs[i].is_word_stop = (i == 0) || attrs[i-1].is_white;
i++;
+ cur = g_utf8_next_char (cur);
}
}