luat_hzfont.h 636 B

123456789101112131415161718192021222324252627
  1. #ifndef _LUAT_HZFONT_H_
  2. #define _LUAT_HZFONT_H_
  3. #include "luat_base.h"
  4. #include <stdint.h>
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. typedef enum {
  9. LUAT_HZFONT_STATE_UNINIT = 0,
  10. LUAT_HZFONT_STATE_READY = 1,
  11. LUAT_HZFONT_STATE_ERROR = 2,
  12. } luat_hzfont_state_t;
  13. int luat_hzfont_init(const char *ttf_path);
  14. void luat_hzfont_deinit(void);
  15. luat_hzfont_state_t luat_hzfont_get_state(void);
  16. uint32_t luat_hzfont_get_str_width(const char *utf8, unsigned char font_size);
  17. int luat_hzfont_draw_utf8(int x, int y, const char *utf8, unsigned char font_size, uint32_t color);
  18. #ifdef __cplusplus
  19. }
  20. #endif
  21. #endif /* _LUAT_HZFONT_H_ */