#ifndef FONTMAPPING_H_
#define FONTMAPPING_H_

#include <string>
#include <map>

typedef std::map<std::string, std::string>	 FontMapping_t ;

/**
 *	class FontMapping
 *
 *	This class reads the default font mapping configuration file for Lua,
 *	which is supposed to be "/misc/fontmapping.lua" and creates a mapping
 *	for fonts faces to filenames. It was re-written to not use Lua API anymore.
 *
 *	This version is another implementation for FontMapping.
 *
 */
class FontMapping
{
    private:

        static FontMapping* instance;

	static int referenceCounter;
		
        FontMapping_t fontMap;

        void loadMapping ();

        std::string createKey (std::string face, std::string style);

        FontMapping ();

	~FontMapping ();

	std::string trim (std::string const& source, char const* delims = " ,\"\t\r\n");

    public:

        static FontMapping* getInstance ();

        static FontMapping* releaseInstance ();

        std::string fontToFile (std::string face, std::string style = "");

        void registerFont (std::string face, std::string style, std::string file);
};

#endif // FONTMAPPING_H_
