271bool draw_line(
char *buf,
int pitch,
const char *text, uint32_t color,
bool solid) {
273 static bool font_data_initialized =
false;
274 if (!font_data_initialized) {
278 font_data_initialized =
true;
286 if (c <
' ' || c >
'~') {
290 for (
int j = 0; j <
FONT_H; ++j) {
291 for (
int i = 0; i <
FONT_W; ++i) {
292 int pos_x = (
FONT_W * c + i) / 8;
295 if (font_data[
offset + pos_x] & mask) {
296 buf[j * pitch + 4 * (i + idx * WIDTH)] = color & 0xFFU;
297 buf[j * pitch + 4 * (i + idx * WIDTH) + 1] = (color >> 8U) & 0xFFU;
298 buf[j * pitch + 4 * (i + idx * WIDTH) + 2] = (color >> 16U) & 0xFFU;
299 buf[j * pitch + 4 * (i + idx * WIDTH) + 3] = (color >> 24U) & 0xFFU;
301 buf[j * pitch + 4 * (i + idx * WIDTH)] =
302 buf[j * pitch + 4 * (i + idx * WIDTH) + 1] =
303 buf[j * pitch + 4 * (i + idx * WIDTH) + 2] = 0;
304 buf[j * pitch + 4 * (i + idx * WIDTH) + 3] = 0xFFU;
308 buf[j * pitch + 4 * ((WIDTH-1) + idx * WIDTH)] =
309 buf[j * pitch + 4 * ((WIDTH-1) + idx * WIDTH) + 1] =
310 buf[j * pitch + 4 * ((WIDTH-1) + idx * WIDTH) + 2] = 0;
311 buf[j * pitch + 4 * ((WIDTH-1) + idx * WIDTH) + 3] = 0xFFU;
314 if ((++idx + 1) * WIDTH * 4 > pitch) {
int urlencode_html5_eval(int c)
bool draw_line(char *buf, int pitch, const char *text, uint32_t color, bool solid)
static bool draw_line_init(unsigned char *out)
unsigned char * base64_decode(const char *in, unsigned int *length)
char * wrap_paragraph(char *text)
int urlencode_rfc3986_eval(int c)
size_t urldecode(char *out, size_t max_len, const char *in)
size_t urlencode(char *out, size_t max_len, const char *in, int(*eval_pass)(int c), bool space_plus_replace)