#include "Fonts.h"

enum textquality {solid, shaded, blended};
TTF_Font** itfz_Fuentes;

void itfz_InitFonts(void){
    static TTF_Font* itfz_Fuentestmp[] = {    
                        loadfont("fonts/futurab.ttf",10),
                        loadfont("fonts/futurab.ttf",12),
                        loadfont("fonts/futurab.ttf",14),
                        loadfont("fonts/futurab.ttf",16),
                        loadfont("fonts/futurab.ttf",24),
                        loadfont("fonts/futurab.ttf",30),
                    };
    itfz_Fuentes = itfz_Fuentestmp;
}

TTF_Font* loadfont(const char* file, int ptsize)
{
  TTF_Font* tmpfont;
  tmpfont = TTF_OpenFont(file, ptsize);
  if (tmpfont == NULL){
    printf("Unable to load font: %s %s \n", file, TTF_GetError());
    // Handle the error here.
  }
  return tmpfont;
}
SDL_Surface *itfz_DrawText(itfzfont fonttodraw, SDL_Color fontcolor, const char *text) {
    SDL_Surface *resultingText;
    resultingText = TTF_RenderText_Blended(itfz_Fuentes[fonttodraw], text, fontcolor);
    return resultingText;
}
