/* Sets or resets the current global font data. 
The font data array is organized in follows:  = ... where  = ... ... where  = ... where  =  */
void gfxPrimitivesSetFont(const void *fontdata, Uint32 cw, Uint32 ch)
/* Sets or resets the current global font data. 
The font data array is organized in follows:  = ... where  = ... ... where  = ... where  =  */
void gfxPrimitivesSetFont(const void *fontdata, Uint32 cw, Uint32 ch)
{
	int i;
	if ((fontdata) && (cw) && (ch)) {
		currentFontdata = fontdata;
		charWidth = cw;
		charHeight = ch;
	} else {
		currentFontdata = gfxPrimitivesFontdata;
		charWidth = 8;
		charHeight = 8;
	}
	charPitch = (charWidth+7)/8;
	charSize = charPitch * charHeight;
	if ((charRotation==1) || (charRotation==3))
	{
		charWidthLocal = charHeight;
		charHeightLocal = charWidth;
	}
	else
	{
		charWidthLocal = charWidth;
		charHeightLocal = charHeight;
	}
	for (i = 0; i < 256; i++) {
		if (gfxPrimitivesFont[i]) {
			SDL_FreeSurface(gfxPrimitivesFont[i]);
			gfxPrimitivesFont[i] = NULL;
		}
	}
}