UFO Shooter/OnScreenText.cpp
bool ScreenText::loadFontData(const std::string& path)
{
	fontpath = path;
	//Log to tell the user we're starting
	SDL_Log("Font loading started! Path is '%s'", fontpath.c_str());

	//  fontptr wasn't NULL, so release the old font, set its pointer to null and then call loadFontData
	if (fontptr != NULL)
	{
		TTF_CloseFont(fontptr);
		fontptr = NULL;
	}

	//Try to open up the file 
	fontptr = TTF_OpenFont(fontpath.c_str(), fontScale);

	//Couldn't be opened. Return false.
	if (!fontptr)
		return false;

	//Return true -- everything is good!
	return true;
}
/// <summary>
/// Loads font data from a given path and saves it into this instance.
/// </summary>
/// <param name="path">The path.</param>


Loads font data from a given path and saves it into this instance.

The path.
Loads font data from a given path and saves it into this instance . The path .
bool ScreenText::loadFontData(const std::string& path)
{
	fontpath = path;
	SDL_Log("Font loading started! Path is '%s'", fontpath.c_str());
	if (fontptr != NULL)
	{
		TTF_CloseFont(fontptr);
		fontptr = NULL;
	}
	fontptr = TTF_OpenFont(fontpath.c_str(), fontScale);
	if (!fontptr)
		return false;
	return true;
}
bool ScreenText :: loadFontData ( const std :: string & path ) { fontpath = path ; SDL_Log ( " " , fontpath . c_str ( ) ) ; if ( fontptr != NULL ) { TTF_CloseFont ( fontptr ) ; fontptr = NULL ; } fontptr = TTF_OpenFont ( fontpath . c_str ( ) , fontScale ) ; if ( ! fontptr ) return false ; return true ; }
<summary>
Loads font data from a given path and saves it into this instance.
<summary > Loads font data from a given path and saves it into this instance .
//Log to tell the user we're starting
 //  fontptr wasn't NULL, so release the old font, set its pointer to null and then call loadFontData
 //Try to open up the file 
 //Couldn't be opened. Return false.
 //Return true -- everything is good!
