PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/src/test/font_manager_test.c

http://ftk.googlecode.com/
C | 26 lines | 19 code | 7 blank | 0 comment | 4 complexity | 7149ba977dbb149e419ef8316b2afccb MD5 | raw file
 1#include "ftk.h"
 2
 3int main(int argc, char* argv[])
 4{
 5	FtkFont* font = NULL;
 6	FtkFontDesc* font_desc = NULL;
 7	FtkFontManager* font_manager = NULL;
 8
 9	ftk_init(argc, argv);
10
11	font_desc = ftk_font_desc_create("size:24 bold:0 italic:0");
12	font_manager = ftk_font_manager_create(16);
13
14	font = ftk_font_manager_get_default_font(font_manager);
15	assert(font != NULL);
16	assert(ftk_font_height(font) == 16);
17	
18	font = ftk_font_manager_load(font_manager, font_desc);
19	assert(font != NULL);
20	assert(ftk_font_height(font) == 24);
21
22	ftk_font_desc_unref(font_desc);
23	ftk_font_manager_destroy(font_manager);
24
25	return 0;
26}