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.

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /**
  2. * @file fontutils.h
  3. * @brief help functions for font and char
  4. * @author Yunhui Fu (yhfudev@gmail.com)
  5. * @version 1.0
  6. * @date 2016-08-19
  7. * @copyright GPL/BSD
  8. */
  9. #pragma once
  10. #include <stdlib.h>
  11. #include <stddef.h> // wchar_t
  12. #include <stdint.h> // uint32_t
  13. #include "../HAL/shared/Marduino.h"
  14. #include "../core/macros.h"
  15. // read a byte from ROM or RAM
  16. typedef uint8_t (*read_byte_cb_t)(uint8_t * str);
  17. uint8_t read_byte_ram(uint8_t * str);
  18. uint8_t read_byte_rom(uint8_t * str);
  19. // there's overflow of the wchar_t due to the 2-byte size in Arduino
  20. // sizeof(wchar_t)=2; sizeof(size_t)=2; sizeof(uint32_t)=4;
  21. // sizeof(int)=2; sizeof(long)=4; sizeof(unsigned)=2;
  22. //#undef wchar_t
  23. #define wchar_t uint32_t
  24. //typedef uint32_t wchar_t;
  25. typedef uint16_t pixel_len_t;
  26. #define PIXEL_LEN_NOLIMIT ((pixel_len_t)(-1))
  27. /* Perform binary search */
  28. typedef int (* pf_bsearch_cb_comp_t)(void *userdata, size_t idx, void * data_pin); /*"data_list[idx] - *data_pin"*/
  29. int pf_bsearch_r(void *userdata, size_t num_data, pf_bsearch_cb_comp_t cb_comp, void *data_pinpoint, size_t *ret_idx);
  30. /* Get the character, decoding multibyte UTF8 characters and returning a pointer to the start of the next UTF8 character */
  31. uint8_t* get_utf8_value_cb(uint8_t *pstart, read_byte_cb_t cb_read_byte, wchar_t *pval);
  32. /* Returns lenght of string in CHARACTERS, NOT BYTES */
  33. uint8_t utf8_strlen(const char *pstart);
  34. uint8_t utf8_strlen_P(PGM_P pstart);