X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fotfopen.c;h=c49eb1d33e6d462c14ae129b19143a3721102dc8;hb=1e0fa2bf25fc79591bf064ba67744da2398eac0e;hp=aacbc3050ace13d523efae67ade8fbf698f2a2c4;hpb=9477ef2b9bf2f9248dead4773dbafad08f23bd75;p=m17n%2Flibotf.git diff --git a/src/otfopen.c b/src/otfopen.c index aacbc30..c49eb1d 100644 --- a/src/otfopen.c +++ b/src/otfopen.c @@ -57,6 +57,15 @@ write to the Free Software Foundation, Inc., 59 Temple Place, Suite (5) API miscellaneous */ + +int debug_flag = -1; + +static void +set_debug_flag () +{ + debug_flag = getenv ("LIBOTF_DEBUG") != NULL; +} + /* (0) Stream handler @@ -2933,6 +2942,9 @@ OTF_open (const char *otf_name) int len = strlen (otf_name); const char *ext = otf_name + (len - 4); + if (debug_flag < 0) + set_debug_flag (); + if (len < 4 || ext[0] != '.' || (ext[1] != 'O' && ext[1] != 'T' && ext[1] != 'o' && ext[1] != 't') @@ -2983,6 +2995,9 @@ OTF_open_ft_face (FT_Face face) OTF *otf; OTF_InternalData *internal_data; + if (debug_flag < 0) + set_debug_flag (); + if (! FT_IS_SFNT (face)) OTF_ERROR (OTF_ERROR_FILE, (char *) face->family_name); otf = calloc (1, sizeof (OTF));