7c67c9d6e027d4d846522b494383aa364dd9d58a
[m17n/m17n-test.git] / find-flt.c
1 #include <stdio.h>
2 #include <m17n-flt.h>
3
4 static unsigned int
5 otf_tag (char *p)
6 {
7   unsigned int tag = 0;
8   int i;
9
10   for (i = 0; i < 4 && *p; i++, p++)
11     tag = (tag << 8) | *p;
12   return (i < 4 ? 0 : tag);
13 }
14
15
16
17 int
18 main (int argc, char **argv)
19 {
20   MFLTGlyphString gstring;
21   MFLTGlyph g;
22   MFLT *flt;
23
24   M17N_INIT ();
25
26   gstring.glyph_size = sizeof (MFLTGlyph);
27   gstring.glyphs = &g;
28   gstring.allocated = gstring.used = 1;
29   gstring.script = otf_tag ("deva");
30   gstring.langsys = 0;
31   
32   g.c = 0x915;
33   flt = mflt_find (&gstring, 0, NULL, NULL);
34   if (! flt)
35     exit (1);
36   M17N_FINI ();
37   exit (0);
38 }