static void xftfont_close (struct font *font) { struct x_display_info *xdi; struct xftfont_info *xftfont_info = (struct xftfont_info *) font; #ifdef HAVE_LIBOTF if (xftfont_info->otf) { OTF_close (xftfont_info->otf); xftfont_info->otf = NULL; } #endif /* See comment in xfont_close. */ if (xftfont_info->xftfont && ((xdi = x_display_info_for_display (xftfont_info->display)) && xftfont_info->x_display_id == xdi->x_id)) { block_input (); XftUnlockFace (xftfont_info->xftfont); XftFontClose (xftfont_info->display, xftfont_info->xftfont); unblock_input (); xftfont_info->xftfont = NULL; } }
static void xftfont_close (FRAME_PTR f, struct font *font) { struct xftfont_info *xftfont_info = (struct xftfont_info *) font; #ifdef HAVE_LIBOTF if (xftfont_info->otf) OTF_close (xftfont_info->otf); #endif BLOCK_INPUT; XftUnlockFace (xftfont_info->xftfont); XftFontClose (xftfont_info->display, xftfont_info->xftfont); UNBLOCK_INPUT; }
int main (int ac, char ** av) { if (ac < 2) { printf("usage: lsotfea <your OpenType file name>\n"); return 0; } else { OTF * ot; ot = OTF_open(av[1]); if (!ot) { OTF_perror("lsotfea"); return 0; } if (OTF_get_table(ot, "GSUB") == 0 && ot->gsub->ScriptList.ScriptCount > 0) { printf("All GSUB (Glyph Substitution) Infomation\n"); list_GSUB_features(ot); } if (OTF_get_table(ot, "GPOS") == 0 && ot->gpos->ScriptList.ScriptCount > 0) { printf("All GPOS (Glyph Positioning) Infomation\n"); list_GPOS_features(ot); } OTF_close(ot); } return 0; }
int main (int argc, char **argv) { FT_Library ft_library; FT_Face face; char *filename; int long_format = 0; int i; if (FT_Init_FreeType (&ft_library)) FATAL_ERROR ("%s\n", "!! Freetype initialization failed."); if (argc > 1) { if (! strcmp (argv[1], "-h") || ! strcmp (argv[1], "--help")) help_and_exit (argv[0]); if (! strcmp (argv[1], "-l")) long_format = 1, argc--, argv++; } if (argc == 2) { if (chdir (argv[1]) < 0) FATAL_ERROR ("Can't change directory to %s\n", argv[1]); } while ((filename = next_file (".")) != NULL) { if (! FT_New_Face (ft_library, filename, 0, &face)) { OTF *otf = OTF_open (filename); char *name, *family = NULL, *style = NULL; if (otf && OTF_get_table (otf, "name") == 0) { if (! (family = otf->name->name[16])) family = otf->name->name[1]; if (! (style = otf->name->name[17])) style = otf->name->name[2]; } if (! family) family = face->family_name; if (! style) style = face->style_name; name = alloca (strlen (filename) + strlen (family) + 4); sprintf (name, "%s (%s)", filename, family); printf ("%-40s %s", name, style); for (i = 0; i < face->num_charmaps; i++) printf (" %d-%d", face->charmaps[i]->platform_id, face->charmaps[i]->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 { printf ("%s fail to open\n", filename); } } exit (0); }