6 * Cobble fake font using existing subfont
9 mkfont(Subfont *subfont, Rune min)
14 font = malloc(sizeof(Font));
17 memset(font, 0, sizeof(Font));
18 font->display = subfont->bits->display;
19 font->name = strdup("<synthetic>");
20 font->ncache = NFCACHE+NFLOOK;
22 font->cache = malloc(font->ncache * sizeof(font->cache[0]));
23 font->subf = malloc(font->nsubf * sizeof(font->subf[0]));
24 if(font->name==nil || font->cache==nil || font->subf==nil){
33 memset(font->cache, 0, font->ncache*sizeof(font->cache[0]));
34 memset(font->subf, 0, font->nsubf*sizeof(font->subf[0]));
35 font->height = subfont->height;
36 font->ascent = subfont->ascent;
38 font->sub = malloc(sizeof(Cachefont*));
41 c = malloc(sizeof(Cachefont));
47 c->max = min+subfont->n-1;
49 c->name = nil; /* noticed by agefont() */
51 font->subf[0].age = 0;
53 font->subf[0].f = subfont;