My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

u8g_fontutf8.h 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * @file fontutf8.h
  3. * @brief font api for u8g lib
  4. * @author Yunhui Fu (yhfudev@gmail.com)
  5. * @version 1.0
  6. * @date 2015-02-19
  7. * @copyright GPL/BSD
  8. */
  9. #ifndef _UXG_FONTUTF8_H
  10. #define _UXG_FONTUTF8_H 1
  11. #include <U8glib.h>
  12. #include "fontutils.h"
  13. // the macro to indicate a UTF-8 string
  14. // You should to save the C/C++ source in UTF-8 encoding!
  15. // Once you change your UTF-8 strings, you need to call the script uxggenpages.sh to create the font data file fontutf8-data.h
  16. #define _UxGT(a) a
  17. typedef struct _uxg_fontinfo_t {
  18. uint16_t page;
  19. uint8_t begin;
  20. uint8_t end;
  21. uint16_t size;
  22. const u8g_fntpgm_uint8_t *fntdata;
  23. } uxg_fontinfo_t;
  24. int uxg_SetUtf8Fonts (const uxg_fontinfo_t * fntinfo, int number); // fntinfo is type of PROGMEM
  25. unsigned int uxg_DrawWchar (u8g_t *pu8g, unsigned int x, unsigned int y, wchar_t ch, pixel_len_t max_length);
  26. unsigned int uxg_DrawUtf8Str (u8g_t *pu8g, unsigned int x, unsigned int y, const char *utf8_msg, pixel_len_t max_length);
  27. unsigned int uxg_DrawUtf8StrP (u8g_t *pu8g, unsigned int x, unsigned int y, const char *utf8_msg, pixel_len_t max_length);
  28. int uxg_GetUtf8StrPixelWidth(u8g_t *pu8g, const char *utf8_msg);
  29. int uxg_GetUtf8StrPixelWidthP(u8g_t *pu8g, const char *utf8_msg);
  30. #define uxg_GetFont(puxg) ((puxg)->font)
  31. #endif // _UXG_FONTUTF8_H