// ---------------------------------------------------------------------------
// 
//   Lily Engine alpha
// 
//   Copyright (c) 2010 Clifford Jolly
//     http://cliffjolly.com
//     cliff@cliffjolly.com
// 
// ---------------------------------------------------------------------------
// 
//   This program is free software; you can redistribute it and/or modify
//   it under the terms of the GNU General Public License as published by
//   the Free Software Foundation; either version 2 of the License, or
//   (at your option) any later version.
//  
//   This program is distributed in the hope that it will be useful, but
//   WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
//   General Public License for more details.
// 
//   You should have received a copy of the GNU General Public License
//   along with this program; if not, write to the Free Software
//   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
//   USA
// -------------------------- END HEADER -------------------------------------

#ifndef FONTMANAGER_H
#define FONTMANAGER_H

#include <map>
#include <string>

class MalFont;

/// FontManager just keeps track of fonts so you don't do something
/// silly like load two fonts with the same texture (the second one
/// would try to read the modified texture).
class FontManager {
	public:
		
		/// Get a font from the font filename, or load it if it's not
		/// already loaded.
		MalFont *getFont(const std::string &name);
		
		/// Get the name for a font. (Warning: Kind of slow.)
		std::string getNameForFont(const MalFont *font);
		
		/// Clean up all the existing fonts.
		void freeEverything(void);
		
		/// Get the main FontManager. (Singleton thing.)
		static FontManager *get(void);

		// Constructor/destructor.
		FontManager(void);
		~FontManager(void);

	private:

		/// Actual font storage.
		std::map<std::string, MalFont *> fonts;
};

#endif
