PageRenderTime 25ms CodeModel.GetById 16ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/src/ftk_font_desc.h

http://ftk.googlecode.com/
C++ Header | 69 lines | 25 code | 14 blank | 30 comment | 0 complexity | 7b9ea08f7c94964c57c315256bbc41b1 MD5 | raw file
 1/*
 2 * 
 3 * File: ftk_font_desc.h    
 4 * Author:  Li XianJing <xianjimli@hotmail.com>
 5 * Brief:   font description.
 6 *
 7 * Copyright (c) 2009 - 2011  Li XianJing <xianjimli@hotmail.com>
 8 *
 9 * Licensed under the Academic Free License version 2.1
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
24 */
25
26/*
27 * History:
28 * ================================================================
29 * 2011-03-20 Li XianJing <xianjimli@hotmail.com> created
30 *
31 */
32
33#ifndef FTK_FONT_DESC_H
34#define FTK_FONT_DESC_H
35
36#include "ftk_typedef.h"
37
38FTK_BEGIN_DECLS
39
40#ifndef FTK_FONT
41#define FTK_FONT "any"
42#endif
43
44#define FTK_DEFAULT_FONT "size:16 bold:0 italic:0 fontname:"FTK_FONT
45#define FONT_DESC_FMT "size:%d bold:%d italic:%d fontname:%s"
46
47
48struct _FtkFontDesc;
49typedef struct _FtkFontDesc FtkFontDesc;
50
51FtkFontDesc* ftk_font_desc_create(const char* font_desc);
52
53int ftk_font_desc_is_equal(FtkFontDesc* thiz, FtkFontDesc* other);
54int ftk_font_desc_is_bold(FtkFontDesc* thiz);
55int ftk_font_desc_is_italic(FtkFontDesc* thiz);
56int ftk_font_desc_get_size(FtkFontDesc* thiz);
57Ret ftk_font_desc_set_bold(FtkFontDesc* thiz, int bold);
58Ret ftk_font_desc_set_italic(FtkFontDesc* thiz, int italic);
59Ret ftk_font_desc_set_size(FtkFontDesc* thiz, int size);
60Ret ftk_font_desc_get_string(FtkFontDesc* thiz, char* desc, size_t len);
61const char *ftk_font_desc_get_fontname(FtkFontDesc* thiz);
62
63int ftk_font_desc_ref(FtkFontDesc* thiz);
64int ftk_font_desc_unref(FtkFontDesc* thiz);
65
66FTK_END_DECLS
67
68#endif/*FTK_FONT_DESC_H*/
69