X-Git-Url: http://git.chise.org/gitweb/?p=m17n%2Fm17n-test.git;a=blobdiff_plain;f=find-flt.c;fp=find-flt.c;h=7c67c9d6e027d4d846522b494383aa364dd9d58a;hp=0000000000000000000000000000000000000000;hb=8e95b30216e75c4474e4581973ea0a95609dc97b;hpb=b5621027ae6f52f8721096d3c1ff895c2628fc5b diff --git a/find-flt.c b/find-flt.c new file mode 100644 index 0000000..7c67c9d --- /dev/null +++ b/find-flt.c @@ -0,0 +1,38 @@ +#include +#include + +static unsigned int +otf_tag (char *p) +{ + unsigned int tag = 0; + int i; + + for (i = 0; i < 4 && *p; i++, p++) + tag = (tag << 8) | *p; + return (i < 4 ? 0 : tag); +} + + + +int +main (int argc, char **argv) +{ + MFLTGlyphString gstring; + MFLTGlyph g; + MFLT *flt; + + M17N_INIT (); + + gstring.glyph_size = sizeof (MFLTGlyph); + gstring.glyphs = &g; + gstring.allocated = gstring.used = 1; + gstring.script = otf_tag ("deva"); + gstring.langsys = 0; + + g.c = 0x915; + flt = mflt_find (&gstring, 0, NULL, NULL); + if (! flt) + exit (1); + M17N_FINI (); + exit (0); +}