static void nr_type_read_w32_list (void) { NRNameList wnames, wfamilies; int i, j; nr_type_w32_typefaces_get (&wnames); nr_type_w32_families_get (&wfamilies); for (i = wnames.length - 1; i >= 0; i--) { NRTypeFaceDef *tdef; const unsigned char *family; family = NULL; for (j = wfamilies.length - 1; j >= 0; j--) { int len; len = strlen (wfamilies.names[j]); if (!strncmp (wfamilies.names[j], wnames.names[i], len)) { family = wfamilies.names[j]; break; } } if (family) { tdef = nr_new (NRTypeFaceDef, 1); tdef->next = NULL; tdef->pdef = NULL; nr_type_w32_build_def (tdef, wnames.names[i], family); nr_type_register (tdef); } } nr_name_list_release (&wfamilies); nr_name_list_release (&wnames); }
void nr_type_read_xft_list (void) { NRNameList gnames, gfamilies; const char *debugenv; int debug; int i, j; debugenv = getenv ("INKSCAPE_DEBUG_XFT"); debug = (debugenv && *debugenv && (*debugenv != '0')); nr_type_xft_typefaces_get (&gnames); nr_type_xft_families_get (&gfamilies); if (debug) { fprintf (stderr, "Number of usable Xft familes: %lu\n", gfamilies.length); fprintf (stderr, "Number of usable Xft typefaces: %lu\n", gnames.length); } for (i = gnames.length - 1; i >= 0; i--) { NRTypeFaceDefFT2 *tdef; const gchar *family; family = NULL; for (j = gfamilies.length - 1; j >= 0; j--) { int len; len = strlen (gfamilies.names[j]); if (!strncmp (gfamilies.names[j], gnames.names[i], len)) { family = gfamilies.names[j]; break; } } if (family) { tdef = nr_new (NRTypeFaceDefFT2, 1); tdef->def.next = NULL; tdef->def.pdef = NULL; nr_type_xft_build_def (tdef, gnames.names[i], family); nr_type_register ((NRTypeFaceDef *) tdef); } } nr_name_list_release (&gfamilies); nr_name_list_release (&gnames); }
static void sp_font_selector_dispose(GObject *object) { SPFontSelector *fsel = SP_FONT_SELECTOR (object); if (fsel->font) { fsel->font->Unref(); fsel->font = NULL; } if (fsel->families.length > 0) { nr_name_list_release(&fsel->families); fsel->families.length = 0; } if (fsel->styles.length > 0) { nr_style_list_release(&fsel->styles); fsel->styles.length = 0; } if (G_OBJECT_CLASS(fs_parent_class)->dispose) { G_OBJECT_CLASS(fs_parent_class)->dispose(object); } }