/* * F2IBuilder - Font to Image Builder * Example with SDL - Loading fonts generated for F2IBuilder * Exemplo com SDL - Carregando fontes geradas pelo F2IBuilder */
May 292011
May 292011
void write(const char * WORDS, int X, int Y)
{
int i,t=strlen(WORDS);
unsigned char l;
position.x=X; //screen x
position.y=Y; //screen y
for (i=0; i<t; i++){
l=WORDS[i];
width.x=(l%16)*sizeChar.w; width.w=width[l];
width.y=(l/16)*sizeChar.h; width.h=sizeChar.h;
gsScreen->blitSurface(image,&width,&position);
position.y=Y;
position.x=position.x+width[l];
}
}
May 292011
//Global our member of class
char width[256];
void load(std::string fileimage)
{
FILE *file;
std::string txt="";
image = IMG_Load(fileimage.c_str());
if (image!=NULL){
txt=fileimage.substr(0,fileimage.length()-4);
txt+=".dat";
file = fopen(txt.c_str(),"rb");
fread(&width, 256, 1, file);
fclose(file);
}
}





