| * Cobble fake font using existing subfont |
| mkfont(Subfont *subfont, Rune min) |
| font = malloc(sizeof(Font)); |
| memset(font, 0, sizeof(Font)); |
| font->display = subfont->bits->display; |
| font->name = strdup("<synthetic>"); |
| font->ncache = NFCACHE+NFLOOK; |
| font->cache = malloc(font->ncache * sizeof(font->cache[0])); |
| font->subf = malloc(font->nsubf * sizeof(font->subf[0])); |
| if(font->name==0 || font->cache==0 || font->subf==0){ |
| memset(font->cache, 0, font->ncache*sizeof(font->cache[0])); |
| memset(font->subf, 0, font->nsubf*sizeof(font->subf[0])); |
| font->height = subfont->height; |
| font->ascent = subfont->ascent; |
| font->sub = malloc(sizeof(Cachefont*)); |
| c = malloc(sizeof(Cachefont)); |
| c->max = min+subfont->n-1; |
| c->name = 0; /* noticed by freeup() and agefont() */ |
| font->subf[0].f = subfont; |