Index: font.c =================================================================== --- font.c (revision 7022) +++ font.c (revision 7023) @@ -212,6 +212,9 @@ if (id == 0) return NULL; + if (id < 0) + id = fk->last_id + 1; + hash_setup(fk); /* do not attempt to overwrite/reuse existing font of the same ID, rather report error */ @@ -224,6 +227,9 @@ f->name = pcb_strdup(name); f->id = id; + if (f->id > fk->last_id) + fk->last_id = f->id; + return f; } @@ -248,4 +254,5 @@ htip_uninit(&fk->fonts); fk->hash_inited = 0; } + fk->last_id = 0; }