Small improvements to font editor

This commit is contained in:
pelya
2010-08-17 15:19:57 +03:00
parent 3a1885468e
commit f38d325a1b
3 changed files with 5 additions and 2 deletions

View File

@@ -0,0 +1,2 @@
editor

View File

@@ -64,6 +64,7 @@ void load()
void save()
{
FILE * ff = fopen(fname, "w");
fprintf(ff, "/* This file should be edited using Touchscreen Editor utility */\n");
fprintf(ff, "#ifndef _TOUCHSCREENFONT_H_\n#define _TOUCHSCREENFONT_H_\n");
fprintf(ff, "#include <SDL_types.h>\n");
fprintf(ff, "typedef struct font_line_t { Uint8 x1, y1, x2, y2; } font_line_t;\n");
@@ -72,7 +73,7 @@ void save()
if( maxLines < font[i].size() )
maxLines = font[i].size();
fprintf(ff, "enum { FONT_MAX_LINES_PER_CHAR = %i };\n", maxLines);
fprintf(ff, "font_line_t font[%d][FONT_MAX_LINES_PER_CHAR] = {\n", (int)font.size());
fprintf(ff, "static font_line_t font[%d][FONT_MAX_LINES_PER_CHAR] = {\n", (int)font.size());
for( size_t i = 0; i < font.size(); i++ )
{
fprintf(ff, "\t{\n");

View File

@@ -1,4 +1,4 @@
/* This file should be edited using Touchscreen Editor utility */
#ifndef _TOUCHSCREENFONT_H_
#define _TOUCHSCREENFONT_H_
#include <SDL_types.h>