Index: trunk/src/font.c =================================================================== --- trunk/src/font.c (revision 10292) +++ trunk/src/font.c (revision 10293) @@ -339,6 +339,18 @@ fk->last_id = 0; } +void pcb_fontkit_reset(pcb_fontkit_t *fk) +{ + if (fk->hash_inited) { + htip_entry_t *e; + for (e = htip_first(&fk->fonts); e; e = htip_first(&fk->fonts)) { + pcb_font_free(e->value); + htip_delentry(&fk->fonts, e); + } + } + fk->last_id = 0; +} + int pcb_del_font(pcb_fontkit_t *fk, pcb_font_id_t id) { htip_entry_t *e; Index: trunk/src/font.h =================================================================== --- trunk/src/font.h (revision 10292) +++ trunk/src/font.h (revision 10293) @@ -83,6 +83,9 @@ pcb_font_t *pcb_new_font(pcb_fontkit_t *fk, pcb_font_id_t id, const char *name); int pcb_del_font(pcb_fontkit_t *fk, pcb_font_id_t id); +/* Reset the fontkit so that only the default font is kept and all extra fonts are purged */ +void pcb_fontkit_reset(pcb_fontkit_t *fk); + /* Unlink the font from pcb, but do not free anything but return the font */ pcb_font_t *pcb_font_unlink(pcb_board_t *pcb, pcb_font_id_t id);