| 287 | } |
| 288 | |
| 289 | static void getBakedQuad(stbtt_bakedchar *chardata, int pw, int ph, int char_index, |
| 290 | float *xpos, float *ypos, stbtt_aligned_quad *q) |
| 291 | { |
| 292 | stbtt_bakedchar *b = chardata + char_index; |
| 293 | int round_x = STBTT_ifloor(*xpos + b->xoff); |
| 294 | int round_y = STBTT_ifloor(*ypos - b->yoff); |
| 295 | |
| 296 | q->x0 = (float)round_x; |
| 297 | q->y0 = (float)round_y; |
| 298 | q->x1 = (float)round_x + b->x1 - b->x0; |
| 299 | q->y1 = (float)round_y - b->y1 + b->y0; |
| 300 | |
| 301 | q->s0 = b->x0 / (float)pw; |
| 302 | q->t0 = b->y0 / (float)pw; |
| 303 | q->s1 = b->x1 / (float)ph; |
| 304 | q->t1 = b->y1 / (float)ph; |
| 305 | |
| 306 | *xpos += b->xadvance; |
| 307 | } |
| 308 | |
| 309 | static const float g_tabStops[4] = { 150, 210, 270, 330 }; |
| 310 | |