From c669418b1e6923b5a6bf9f278f8607de52a3d08a Mon Sep 17 00:00:00 2001 From: Pere Pujal i Carabantes Date: Tue, 17 Aug 2010 21:20:15 +0000 Subject: [PATCH] Changing the font path of onscreen keyboard to be relative to DATA_PREFIX. --- src/tuxpaint.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 27dc504a4..f912564b9 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -23644,7 +23644,12 @@ int button(int id, int x, int y) void keybd_prepare() { - fonty = TTF_OpenFont( "data/fonts/FreeSansBold.ttf", 12 ); + /* FIXME we should use the current font to draw the keyboard */ + char * fontname; + fontname = malloc(128); + + sprintf(fontname, "%s/fonts/FreeSansBold.ttf", DATA_PREFIX); + fonty = TTF_OpenFont( fontname, 12 ); if (fonty == NULL) { fprintf(stderr, "\nError: Can't open the font!\n" @@ -23653,6 +23658,7 @@ void keybd_prepare() exit(1); } uistate.hotitem = 0; + free(fontname); } void keybd_finish()