font_fnt.h 713 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef __FONT_FNT_H__
  2. #define __FONT_FNT_H__
  3. #include <rtgui/font.h>
  4. #include <rtgui/dc.h>
  5. /* fnt font header */
  6. struct fnt_header
  7. {
  8. rt_uint8_t version[4];
  9. rt_uint16_t max_width;
  10. rt_uint16_t height;
  11. rt_uint16_t ascent;
  12. rt_uint16_t depth;
  13. rt_uint32_t first_char;
  14. rt_uint32_t default_char;
  15. rt_uint32_t size;
  16. rt_uint32_t nbits;
  17. rt_uint32_t noffset;
  18. rt_uint32_t nwidth;
  19. };
  20. typedef rt_uint8_t MWIMAGEBITS;
  21. struct fnt_font
  22. {
  23. struct fnt_header header;
  24. const MWIMAGEBITS *bits; /* nbits */
  25. const rt_uint16_t *offset; /* noffset */
  26. const rt_uint8_t *width; /* nwidth */
  27. };
  28. extern const struct rtgui_font_engine fnt_font_engine;
  29. struct rtgui_font *fnt_font_create(const char* filename);
  30. #endif