Firmware/src/display/display_functions.c
uint16_t display_draw_string(char *s, uint16_t x, uint16_t y, uint8_t font_size, uint8_t flags)
{
  uint16_t width = get_font_width(font_size);
  uint8_t chr_pos = 0;
  char chr = *s;
  
  while (chr && (chr_pos < 50)) 
  {
    display_draw_char(chr, x + chr_pos*width, y, font_size, flags);
    chr_pos++;
    chr = s[chr_pos];
  }
  display_cursor_text_x = x + chr_pos*width;
  display_cursor_text_y = y;
  
  return chr_pos*width;
}
//x, y - in pixel
//return string width
//String end is 0x00 char
x, y - in pixel
return string width
String end is 0x00 char
x y - in pixel return string width String end is 0x00 char
uint16_t display_draw_string(char *s, uint16_t x, uint16_t y, uint8_t font_size, uint8_t flags)
{
  uint16_t width = get_font_width(font_size);
  uint8_t chr_pos = 0;
  char chr = *s;
  while (chr && (chr_pos < 50)) 
  {
    display_draw_char(chr, x + chr_pos*width, y, font_size, flags);
    chr_pos++;
    chr = s[chr_pos];
  }
  display_cursor_text_x = x + chr_pos*width;
  display_cursor_text_y = y;
  return chr_pos*width;
}
uint16_t display_draw_string ( char * s , uint16_t x , uint16_t y , uint8_t font_size , uint8_t flags ) { uint16_t width = get_font_width ( font_size ) ; uint8_t chr_pos = 0 ; char chr = * s ; while ( chr && ( chr_pos < 50 ) ) { display_draw_char ( chr , x + chr_pos * width , y , font_size , flags ) ; chr_pos ++ ; chr = s [ chr_pos ] ; } display_cursor_text_x = x + chr_pos * width ; display_cursor_text_y = y ; return chr_pos * width ; }
x, y - in pixel
return string width
String end is 0x00 char
x y - in pixel return string width String end is 0x00 char