X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=font_guts.c;fp=font_guts.c;h=af076cb8483ee1ab47e54f39ce32f8ccc3dfc5bc;hp=0000000000000000000000000000000000000000;hb=88a9e026caed5568363cefb7d49308b875dc5e4a;hpb=100372ba9cc83542b9d9894001d70f40e28f8f4b diff --git a/font_guts.c b/font_guts.c new file mode 100644 index 0000000..af076cb --- /dev/null +++ b/font_guts.c @@ -0,0 +1,31 @@ +#include + +#define TEMPLATE_WIDTH 1870 +#define TEMPLATE_HEIGHT 17 + +#define OUTPUT_WIDTH 29.0 + +#define FACTOR (OUTPUT_WIDTH / (float)TEMPLATE_WIDTH) +#define XMIN (0 - (TEMPLATE_WIDTH / 2)) +#define YMIN (TEMPLATE_HEIGHT / 2) + +int main(int argc, char** argv) { + int bit, x, y; + + x = XMIN; y = YMIN; + while((bit = getc(stdin)) != EOF) { + if(bit == '\n') { + x = XMIN; + --y; + continue; + } + + if(bit == '#') { + // parameters to sphere (in a blob) are: {, diameter, center-density} + printf("sphere { <%f, %f, 0>, %f, 2 }\n", (float)(x * FACTOR), (float)(y * FACTOR), (float)(2.5 * FACTOR)); + } + ++x; + } + + return 0; +}