| 429 | } |
| 430 | |
| 431 | void cutcolorstring(char *text, int maxlen) |
| 432 | { // limit string length, ignore color codes |
| 433 | if(!curfont) return; |
| 434 | int len = 0; |
| 435 | maxlen *= curfont->defaultw; |
| 436 | while(*text) |
| 437 | { |
| 438 | if(*text == '\f' && text[1]) text++; |
| 439 | else if(*text == '\1' && text[1]) text++, len += FONTH + 1; |
| 440 | else if(*text == '\t') len = TABALIGN(len); |
| 441 | else len += curfont->chars.inrange(*text - curfont->skip) ? curfont->chars[*text - curfont->skip].w : curfont->defaultw; |
| 442 | if(len > maxlen) { *text = '\0'; break; } |
| 443 | text++; |
| 444 | } |
| 445 | } |
| 446 | |
| 447 | bool filterunrenderables(char *s) |
| 448 | { |
no test coverage detected