summaryrefslogtreecommitdiff
path: root/modules/basic/basic.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules/basic/basic.c')
-rw-r--r--modules/basic/basic.c34
1 files changed, 12 insertions, 22 deletions
diff --git a/modules/basic/basic.c b/modules/basic/basic.c
index 8f639a2b..944ec41c 100644
--- a/modules/basic/basic.c
+++ b/modules/basic/basic.c
@@ -24,8 +24,6 @@
#include <glib.h>
#include "pango.h"
#include "pangox.h"
-#include "utils.h"
-#include <unicode.h>
#include <fribidi/fribidi.h>
typedef struct _CharRange CharRange;
@@ -164,7 +162,7 @@ char_cache_free (CharCache *cache)
}
PangoGlyph
-find_char (CharCache *cache, PangoFont *font, GUChar4 wc, const char *input)
+find_char (CharCache *cache, PangoFont *font, gunichar wc, const char *input)
{
int mask_index;
MaskTable *mask_table;
@@ -267,15 +265,13 @@ conv_8bit (CharCache *cache,
{
iconv_t cd;
char outbuf;
- const char *p;
const char *inptr = input;
size_t inbytesleft;
char *outptr = &outbuf;
size_t outbytesleft = 1;
- _pango_utf8_iterate (input, &p, NULL);
- inbytesleft = p - input;
+ inbytesleft = g_utf8_next_char (input) - input;
cd = find_converter (cache, charset);
@@ -291,15 +287,13 @@ conv_euc (CharCache *cache,
{
iconv_t cd;
char outbuf[2];
- const char *p;
const char *inptr = input;
size_t inbytesleft;
char *outptr = outbuf;
size_t outbytesleft = 2;
- _pango_utf8_iterate (input, &p, NULL);
- inbytesleft = p - input;
+ inbytesleft = g_utf8_next_char (input) - input;
cd = find_converter (cache, charset);
@@ -316,10 +310,7 @@ conv_ucs4 (CharCache *cache,
Charset *charset,
const char *input)
{
- GUChar4 wc;
-
- unicode_get_utf8 (input, &wc);
- return wc;
+ return g_utf8_get_char (input);
}
static void
@@ -368,7 +359,6 @@ basic_engine_shape (PangoFont *font,
int n_chars;
int i;
const char *p;
- const char *next;
CharCache *cache;
@@ -379,19 +369,19 @@ basic_engine_shape (PangoFont *font,
cache = get_char_cache (font);
- n_chars = unicode_strlen (text, length);
+ n_chars = g_utf8_strlen (text, length);
pango_glyph_string_set_size (glyphs, n_chars);
p = text;
for (i=0; i < n_chars; i++)
{
- GUChar4 wc;
+ gunichar wc;
FriBidiChar mirrored_ch;
PangoGlyph index;
char buf[6];
const char *input;
- _pango_utf8_iterate (p, &next, &wc);
+ wc = g_utf8_get_char (p);
input = p;
if (analysis->level % 2)
@@ -399,7 +389,7 @@ basic_engine_shape (PangoFont *font,
{
wc = mirrored_ch;
- _pango_guchar4_to_utf8 (wc, buf);
+ g_unichar_to_utf8 (wc, buf);
input = buf;
}
@@ -414,7 +404,7 @@ basic_engine_shape (PangoFont *font,
{
set_glyph (font, glyphs, i, p - text, index);
- if (unicode_type (wc) == UNICODE_NON_SPACING_MARK)
+ if (g_unichar_type (wc) == G_UNICODE_NON_SPACING_MARK)
{
if (i > 0)
{
@@ -438,7 +428,7 @@ basic_engine_shape (PangoFont *font,
set_glyph (font, glyphs, i, p - text, pango_x_get_unknown_glyph (font));
}
- p = next;
+ p = g_utf8_next_char (p);
}
/* Simple bidi support... may have separate modules later */
@@ -470,13 +460,13 @@ basic_engine_get_coverage (PangoFont *font,
{
CharCache *cache = get_char_cache (font);
PangoCoverage *result = pango_coverage_new ();
- GUChar4 wc;
+ gunichar wc;
for (wc = 0; wc < 65536; wc++)
{
char buf[6];
- _pango_guchar4_to_utf8 (wc, buf);
+ g_unichar_to_utf8 (wc, buf);
if (find_char (cache, font, wc, buf))
pango_coverage_set (result, wc, PANGO_COVERAGE_EXACT);
}