/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. * History:
  27. * ================================================================
  28. * 2011-03-20 Li XianJing <xianjimli@hotmail.com> created
  29. *
  30. */
  31. #ifndef FTK_FONT_DESC_H
  32. #define FTK_FONT_DESC_H
  33. #include "ftk_typedef.h"
  34. FTK_BEGIN_DECLS
  35. #ifndef FTK_FONT
  36. #define FTK_FONT "any"
  37. #endif
  38. #define FTK_DEFAULT_FONT "size:16 bold:0 italic:0 fontname:"FTK_FONT
  39. #define FONT_DESC_FMT "size:%d bold:%d italic:%d fontname:%s"
  40. struct _FtkFontDesc;
  41. typedef struct _FtkFontDesc FtkFontDesc;
  42. FtkFontDesc* ftk_font_desc_create(const char* font_desc);
  43. int ftk_font_desc_is_equal(FtkFontDesc* thiz, FtkFontDesc* other);
  44. int ftk_font_desc_is_bold(FtkFontDesc* thiz);
  45. int ftk_font_desc_is_italic(FtkFontDesc* thiz);
  46. int ftk_font_desc_get_size(FtkFontDesc* thiz);
  47. Ret ftk_font_desc_set_bold(FtkFontDesc* thiz, int bold);
  48. Ret ftk_font_desc_set_italic(FtkFontDesc* thiz, int italic);
  49. Ret ftk_font_desc_set_size(FtkFontDesc* thiz, int size);
  50. Ret ftk_font_desc_get_string(FtkFontDesc* thiz, char* desc, size_t len);
  51. const char *ftk_font_desc_get_fontname(FtkFontDesc* thiz);
  52. int ftk_font_desc_ref(FtkFontDesc* thiz);
  53. int ftk_font_desc_unref(FtkFontDesc* thiz);
  54. FTK_END_DECLS
  55. #endif/*FTK_FONT_DESC_H*/