Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char* fontlib_RenderAll(const char* string, uint8_t fontcolor, bool xcolor){
- char* render = string;
- uint24_t x_last;
- uint8_t printmin = fontlib_GetFirstPrintableCodePoint();
- do {
- x_last = fontlib_DrawString(render);
- render = fontlib_GetLastCharacterRead();
- if(*render < printmin){
- if(xcolor){
- uint8_t n_color;
- switch(*render){
- case 1:
- n_color = 159;
- break;
- case 2:
- n_color = 224;
- break;
- case 3:
- n_color = 247;
- break;
- case 0x0a:
- n_color = fontcolor;
- }
- fontlib_SetForegroundColor(n_color);
- fontlib_DrawGlyph(*render);
- }
- render++;
- }
- render++;
- if((fontlib_GetStringWidth(render) + x_last) >= 310) fontlib_Newline();
- else fontlib_DrawGlyph(0);
- } while(render < (string + strlen(string)));
- return render;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement