luat_hzfont.h 746 B

12345678910111213141516171819202122232425262728
  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, uint32_t cache_size, int load_to_psram);
  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. /* antialias = -1(自动), 1(无AA), 2(2x2), 4(4x4) */
  18. int luat_hzfont_draw_utf8(int x, int y, const char *utf8, unsigned char font_size, uint32_t color, int antialias);
  19. #ifdef __cplusplus
  20. }
  21. #endif
  22. #endif /* _LUAT_HZFONT_H_ */