1 #include "fontfile.h"
2 #include <assert.h>
3 #include <string.h>
4 
5 //FONTFILE *fontfile_open(const char *filename);
6 
7 /*
8 FONTFILE *fontfile_open(const char *filename)
9 {
10   // TODO? check magic
11   if (...) {
12   }
13 }
14 */
15 
fontfile_open_sfnt(OTF_FILE * otf)16 FONTFILE *fontfile_open_sfnt(OTF_FILE *otf) // {{{
17 {
18   if (!otf) {
19     assert(0);
20     return NULL;
21   }
22   FONTFILE *ret=calloc(1,sizeof(FONTFILE));
23 
24   ret->sfnt=otf;
25 
26   return ret;
27 }
28 // }}}
29 
fontfile_open_std(const char * name)30 FONTFILE *fontfile_open_std(const char *name) // {{{
31 {
32   assert(name);
33   FONTFILE *ret=calloc(1,sizeof(FONTFILE));
34 
35   ret->stdname=strdup(name);
36 
37   return ret;
38 }
39 // }}}
40 
fontfile_close(FONTFILE * ff)41 void fontfile_close(FONTFILE *ff) // {{{
42 {
43   if (ff) {
44     otf_close(ff->sfnt);
45     // ??? cff_close(ff->cff);
46     free(ff->stdname);
47     free(ff);
48   }
49 }
50 // }}}
51