libdraw: autoscale fonts when moving between low and high dpi screens

Change-Id: I6093955b222db89dfe437fb723593b173d888d01
Reviewed-on: https://plan9port-review.googlesource.com/1170
Reviewed-by: Russ Cox <rsc@swtch.com>
This commit is contained in:
Russ Cox 2015-02-17 12:16:20 -05:00
parent 77f23268f7
commit 213fc4f6fb
9 changed files with 243 additions and 28 deletions

View file

@ -138,5 +138,23 @@ freefont(Font *f)
free(f->cache);
free(f->subf);
free(f->sub);
if(f->ondisplaylist) {
f->ondisplaylist = 0;
if(f->next)
f->next->prev = f->prev;
else
f->display->lastfont = f->prev;
if(f->prev)
f->prev->next = f->next;
else
f->display->firstfont = f->next;
}
if(f->lodpi != f)
freefont(f->lodpi);
if(f->hidpi != f)
freefont(f->hidpi);
free(f);
}