JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
bump version to 0.5.8
[vor.git] / font_guts.c
1 #include <stdio.h>
2
3 #define TEMPLATE_WIDTH 1870
4 #define TEMPLATE_HEIGHT 17
5
6 #define OUTPUT_WIDTH 29.0
7
8 #define FACTOR (OUTPUT_WIDTH / (float)TEMPLATE_WIDTH)
9 #define XMIN (0 - (TEMPLATE_WIDTH / 2))
10 #define YMIN (TEMPLATE_HEIGHT / 2)
11
12 int main(int argc, char** argv) {
13         int bit, x, y;
14
15         x = XMIN; y = YMIN;
16         while((bit = getc(stdin)) != EOF) {
17                 if(bit == '\n') {
18                         x = XMIN;
19                         --y;
20                         continue;
21                 }
22
23                 if(bit == '#') {
24                         // parameters to sphere (in a blob) are: {<x, y, z>, diameter, center-density}
25                         printf("sphere { <%f, %f, 0>, %f, 2 }\n", (float)(x * FACTOR), (float)(y * FACTOR), (float)(2.5 * FACTOR));
26                 }
27                 ++x;
28         }
29
30         return 0;
31 }