+ int kerning_size = 0;
+ for(t=0;t<src->num_glyphs;t++) {
+ dict_t* d = src->kerning[t];
+ if(!d) continue;
+ DICT_ITERATE_ITEMS(d,void*,key,mtf_t*,m) {
+ if(m) {
+ kerning_size++;
+ }
+ }
+ }
+ font->kerning_size = kerning_size;
+ font->kerning = (gfxkerning_t*)malloc(sizeof(gfxkerning_t)*kerning_size);
+ int pos = 0;
+ for(t=0;t<src->num_glyphs;t++) {
+ dict_t* d = src->kerning[t];
+ if(!d) continue;
+ DICT_ITERATE_ITEMS(d,void*,key,mtf_t*,m) {
+ if(m) {
+ font->kerning[pos].c1 = src->glyphs[t]->glyphid;
+ font->kerning[pos].c2 = src->glyphs[(int)(ptroff_t)key]->glyphid;
+ font->kerning[pos].advance = (int)(ptroff_t)m->first->key;
+ pos++;
+ }
+ }