From: handa Date: Mon, 1 Oct 2007 04:39:32 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1cf616637034fe2f47296758983c415b25966d17;p=m17n%2Fm17n-test.git *** empty log message *** --- diff --git a/flt.c b/flt.c index 5756bd3..5cf2479 100644 --- a/flt.c +++ b/flt.c @@ -9,11 +9,13 @@ #if defined (FLT_GUI) #include +#include #define PROGNAME "flt-gui" #elif defined (FLT_OTF) #include +#include #include #define PROGNAME "flt-otf" @@ -26,6 +28,7 @@ #else /* (defined (FLT_PANGO)) */ #include +#include #define PANGO_ENABLE_ENGINE #define PANGO_ENABLE_BACKEND #include @@ -1357,6 +1360,7 @@ main (int argc, char **argv) MText *mt; MFLTFont *font; int len, i, j; + unsigned char *buf; if (argc < 3) { @@ -1379,7 +1383,14 @@ main (int argc, char **argv) font->get_metrics = get_metrics; font->drive_otf = drive_otf; - mt = mconv_decode_stream (msymbol ("utf-8"), stdin); + i = 0; + buf = malloc (4096); + while ((j = fread (buf + i, 1, 4096, stdin)) == 4096) + { + i += 4096; + buf = realloc (buf, i + 4096); + } + mt = mtext_from_data (buf, i, MTEXT_FORMAT_UTF_8); len = mtext_len (mt); for (i = 0, j = mtext_character (mt, i, len, '\n'); i < len; i = j + 1, j = mtext_character (mt, i, len, '\n')) @@ -1397,6 +1408,7 @@ main (int argc, char **argv) i = j; } m17n_object_unref (mt); + free (buf); close_font (font); M17N_FINI (); return 0;