idirectfbfont.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. (c) Copyright 2001-2009 The world wide DirectFB Open Source Community (directfb.org)
  3. (c) Copyright 2000-2004 Convergence (integrated media) GmbH
  4. All rights reserved.
  5. Written by Denis Oliver Kropp <dok@directfb.org>,
  6. Andreas Hundt <andi@fischlustig.de>,
  7. Sven Neumann <neo@directfb.org>,
  8. Ville Syrjälä <syrjala@sci.fi> and
  9. Claudio Ciccani <klan@users.sf.net>.
  10. This library is free software; you can redistribute it and/or
  11. modify it under the terms of the GNU Lesser General Public
  12. License as published by the Free Software Foundation; either
  13. version 2 of the License, or (at your option) any later version.
  14. This library is distributed in the hope that it will be useful,
  15. but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. Lesser General Public License for more details.
  18. You should have received a copy of the GNU Lesser General Public
  19. License along with this library; if not, write to the
  20. Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  21. Boston, MA 02111-1307, USA.
  22. */
  23. #ifndef __IDIRECTFBFONT_H__
  24. #define __IDIRECTFBFONT_H__
  25. #include <directfb.h>
  26. #include <core/coretypes.h>
  27. /*
  28. * probing context
  29. */
  30. typedef struct {
  31. /* Only set if databuffer is created from file.
  32. deprecated - use memory location below. */
  33. const char *filename;
  34. /* if !=NULL, pointer to the file content */
  35. unsigned char *content;
  36. unsigned int content_size;
  37. bool content_mapped;
  38. } IDirectFBFont_ProbeContext;
  39. DFBResult
  40. IDirectFBFont_CreateFromBuffer( IDirectFBDataBuffer *buffer,
  41. CoreDFB *core,
  42. const DFBFontDescription *desc,
  43. IDirectFBFont **interface );
  44. /**********************************************************************************************************************/
  45. /*
  46. * private data struct of IDirectFBFont
  47. * used by implementors of IDirectFBFont
  48. */
  49. typedef struct {
  50. int ref; /* reference counter */
  51. CoreFont *font; /* pointer to core font */
  52. unsigned char *content; /* possible allocation, free at intf. close */
  53. unsigned int content_size;
  54. bool content_mapped;
  55. DFBTextEncodingID encoding; /* text encoding */
  56. } IDirectFBFont_data;
  57. /*
  58. * common code to construct the interface (internal usage only)
  59. */
  60. DFBResult IDirectFBFont_Construct( IDirectFBFont *thiz, CoreFont *font );
  61. /*
  62. * deinitialize font and its surfaces
  63. */
  64. void IDirectFBFont_Destruct( IDirectFBFont *thiz );
  65. #endif