exit (1); \
} while (0)
+
+void
+print_tag (OTF_Tag tag)
+{
+ char name[5];
+
+ OTF_tag_name (tag, name);
+ printf ("%s", name);
+}
+
+void
+print_gsub_gpos_info (OTF *otf, char *table)
+{
+ int i, j;
+
+ if (OTF_get_table (otf, table) == 0)
+ {
+ OTF_ScriptList *scripts;
+ OTF_FeatureList *features;
+
+ if (! strcmp (table, "GSUB"))
+ scripts = &otf->gsub->ScriptList, features = &otf->gsub->FeatureList;
+ else
+ scripts = &otf->gpos->ScriptList, features = &otf->gpos->FeatureList;
+
+ printf (" %s scripts: ", table);
+ for (i = 0; i < scripts->ScriptCount; i++)
+ {
+ OTF_Script *script = scripts->Script + i;
+
+ if (i > 0)
+ printf (", ");
+ print_tag (script->ScriptTag);
+ if (script->LangSysCount > 0)
+ {
+ printf (" (");
+ for (j = 0; j < script->LangSysCount; j++)
+ {
+ if (j > 0)
+ printf (", ");
+ print_tag (script->LangSysRecord[j].LangSysTag);
+ }
+ printf (" )");
+ }
+ }
+ printf ("\n");
+
+ printf (" %s features: ", table);
+ for (i = 0; i < features->FeatureCount; i++)
+ {
+ if (i > 0)
+ printf (",");
+ print_tag (features->Feature[i].FeatureTag);
+ }
+ printf ("\n");
+ }
+}
void
help_and_exit (char *prog)
{
int i, j;
if (FT_Init_FreeType (&ft_library))
- exit (1);
+ FATAL_ERROR ("%s\n", "!! Freetype initialization failed.");
if (argc > 1)
{
if (! FT_New_Face (ft_library, namelist[i]->d_name, 0, &face))
{
OTF *otf = OTF_open (namelist[i]->d_name);
- char *name, *family, *style;
+ char *name, *family = NULL, *style = NULL;
if (otf)
{
printf (" %d-%d", face->charmaps[j]->platform_id,
face->charmaps[j]->encoding_id);
printf ("\n");
+ if (otf && long_format)
+ {
+ print_gsub_gpos_info (otf, "GSUB");
+ print_gsub_gpos_info (otf, "GPOS");
+ }
+ if (otf)
+ OTF_close (otf);
}
else
{