Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. #ifndef __FONT_H__
  2. #define __FONT_H__
  3.  
  4. #include <stddef.h>
  5. #include <stdint.h>
  6.  
  7. enum font_type {
  8.         FONT_TYPE_16X26,
  9.         FONT_TYPE_8X13,
  10.         FONT_TYPE_7X5,
  11.         FONT_TYPE_AUTO
  12. };
  13.  
  14. struct dgen_font {
  15.         unsigned int w;
  16.         unsigned int h;
  17.         const short *(*data)[0x80];
  18. };
  19.  
  20. extern const struct dgen_font dgen_font[];
  21.  
  22. extern const struct dgen_font *font_select(unsigned int max_width,
  23.                                            unsigned int max_height,
  24.                                            enum font_type type);
  25. extern size_t font_text_width(const char *msg, size_t len,
  26.                               unsigned int max_width, unsigned int max_height,
  27.                               enum font_type type);
  28. extern size_t font_text_max_len(unsigned int max_width,
  29.                                 unsigned int max_height,
  30.                                 enum font_type type);
  31. extern size_t font_text(uint8_t *buf,
  32.                         unsigned int max_width, unsigned int max_height,
  33.                         unsigned int bytes_per_pixel, unsigned int pitch,
  34.                         const char *msg, size_t len, unsigned int mark,
  35.                         enum font_type type);
  36.  
  37. #endif /* __FONT_H__ */
  38.