projects
/
m17n
/
m17n-test.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
874557f
)
*** empty log message ***
author
handa
<handa>
Mon, 1 Oct 2007 04:39:32 +0000
(
04:39
+0000)
committer
handa
<handa>
Mon, 1 Oct 2007 04:39:32 +0000
(
04:39
+0000)
flt.c
patch
|
blob
|
history
diff --git
a/flt.c
b/flt.c
index
5756bd3
..
5cf2479
100644
(file)
--- a/
flt.c
+++ b/
flt.c
@@
-9,11
+9,13
@@
#if defined (FLT_GUI)
#include <m17n-gui.h>
#if defined (FLT_GUI)
#include <m17n-gui.h>
+#include <m17n-misc.h>
#define PROGNAME "flt-gui"
#elif defined (FLT_OTF)
#include <m17n-flt.h>
#define PROGNAME "flt-gui"
#elif defined (FLT_OTF)
#include <m17n-flt.h>
+#include <m17n-misc.h>
#include <otf.h>
#define PROGNAME "flt-otf"
#include <otf.h>
#define PROGNAME "flt-otf"
@@
-26,6
+28,7
@@
#else /* (defined (FLT_PANGO)) */
#include <m17n-flt.h>
#else /* (defined (FLT_PANGO)) */
#include <m17n-flt.h>
+#include <m17n-misc.h>
#define PANGO_ENABLE_ENGINE
#define PANGO_ENABLE_BACKEND
#include <pango/pango.h>
#define PANGO_ENABLE_ENGINE
#define PANGO_ENABLE_BACKEND
#include <pango/pango.h>
@@
-1357,6
+1360,7
@@
main (int argc, char **argv)
MText *mt;
MFLTFont *font;
int len, i, j;
MText *mt;
MFLTFont *font;
int len, i, j;
+ unsigned char *buf;
if (argc < 3)
{
if (argc < 3)
{
@@
-1379,7
+1383,14
@@
main (int argc, char **argv)
font->get_metrics = get_metrics;
font->drive_otf = drive_otf;
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'))
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);
i = j;
}
m17n_object_unref (mt);
+ free (buf);
close_font (font);
M17N_FINI ();
return 0;
close_font (font);
M17N_FINI ();
return 0;