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