#include <pango/pango-ot.h>
#include <pango/pangoft2.h>
#include <pango/pangofc-font.h>
+
#endif
+#include <m17n-misc.h>
+
static FT_Library ft_library;
int
MText *mt;
MFLTFont *font;
int len, i, j;
+ unsigned char *buf;
if (argc < 3)
{
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'))
i = j;
}
m17n_object_unref (mt);
+ free (buf);
close_font (font);
M17N_FINI ();
return 0;