Change Details
tools/libtxt/font.c |
40 | 40 | struct font { |
41 | 41 | struct image *img; |
42 | 42 | struct sym sym[CHARS]; |
| 43 | int max_width; |
43 | 44 | }; |
44 | 45 | |
45 | 46 | |
... | ... | |
148 | 149 | static void set_block(struct font *font, int *n, |
149 | 150 | int xlast, int x, int y0, int y1) |
150 | 151 | { |
| 152 | int width = x-xlast-1; |
| 153 | |
| 154 | if (width > font->max_width) |
| 155 | font->max_width = width; |
151 | 156 | font->sym[*n].x = xlast+1; |
152 | 157 | font->sym[*n].y = y0; |
153 | | font->sym[*n].w = x-xlast-1; |
| 158 | font->sym[*n].w = width; |
154 | 159 | font->sym[*n].h = y1-y0+1; |
155 | 160 | (*n)++; |
156 | 161 | } |
... | ... | |
269 | 274 | const char *cp; |
270 | 275 | const struct sym *sym; |
271 | 276 | |
| 277 | if (c == ' ') |
| 278 | return font->max_width; |
272 | 279 | cp = strchr(charset, c); |
273 | 280 | if (!cp) |
274 | 281 | return 0; |
Download the corresponding diff file