Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/planix-v0/sys/src/libdraw/subfont.c – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include <u.h>
2
#include <libc.h>
3
#include <draw.h>
4
 
5
Subfont*
6
allocsubfont(char *name, int n, int height, int ascent, Fontchar *info, Image *i)
7
{
8
	Subfont *f;
9
 
10
	assert(height != 0 /* allocsubfont */);
11
 
12
	f = malloc(sizeof(Subfont));
13
	if(f == 0)
14
		return 0;
15
	f->n = n;
16
	f->height = height;
17
	f->ascent = ascent;
18
	f->info = info;
19
	f->bits = i;
20
	f->ref = 1;
21
	if(name){
22
		f->name = strdup(name);
23
		if(lookupsubfont(i->display, name) == 0)
24
			installsubfont(name, f);
25
	}else
26
		f->name = 0;
27
	return f;
28
}