Advertisement
AnthonyCagliano

Untitled

Jul 18th, 2022
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. char* fontlib_RenderAll(const char* string, uint8_t fontcolor, bool xcolor){
  2. char* render = string;
  3. uint24_t x_last;
  4. uint8_t printmin = fontlib_GetFirstPrintableCodePoint();
  5. do {
  6. x_last = fontlib_DrawString(render);
  7. render = fontlib_GetLastCharacterRead();
  8. if(*render < printmin){
  9. if(xcolor){
  10. uint8_t n_color;
  11. switch(*render){
  12. case 1:
  13. n_color = 159;
  14. break;
  15. case 2:
  16. n_color = 224;
  17. break;
  18. case 3:
  19. n_color = 247;
  20. break;
  21. case 0x0a:
  22. n_color = fontcolor;
  23. }
  24. fontlib_SetForegroundColor(n_color);
  25. fontlib_DrawGlyph(*render);
  26. }
  27. render++;
  28. }
  29. render++;
  30. if((fontlib_GetStringWidth(render) + x_last) >= 310) fontlib_Newline();
  31. else fontlib_DrawGlyph(0);
  32. } while(render < (string + strlen(string)));
  33. return render;
  34. }
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement