2019-11-25 06:30:25 -08:00
|
|
|
/* Copyright (C) 2019 Wildfire Games.
|
2009-04-18 10:00:33 -07:00
|
|
|
* This file is part of 0 A.D.
|
|
|
|
|
*
|
|
|
|
|
* 0 A.D. 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.
|
|
|
|
|
*
|
|
|
|
|
* 0 A.D. 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 0 A.D. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
2013-10-18 08:53:07 -07:00
|
|
|
#ifndef INCLUDED_FONTMANAGER
|
|
|
|
|
#define INCLUDED_FONTMANAGER
|
2004-08-27 15:08:30 -07:00
|
|
|
|
2019-11-25 06:30:25 -08:00
|
|
|
#include "ps/CStrIntern.h"
|
|
|
|
|
|
|
|
|
|
#include <unordered_map>
|
2012-03-13 14:39:01 -07:00
|
|
|
|
2013-10-18 08:53:07 -07:00
|
|
|
class CFont;
|
2004-08-27 15:08:30 -07:00
|
|
|
|
2013-10-18 08:53:07 -07:00
|
|
|
/**
|
|
|
|
|
* Font manager: loads and caches bitmap fonts.
|
|
|
|
|
*/
|
|
|
|
|
class CFontManager
|
2004-08-27 15:08:30 -07:00
|
|
|
{
|
|
|
|
|
public:
|
2013-10-18 09:15:42 -07:00
|
|
|
shared_ptr<CFont> LoadFont(CStrIntern fontName);
|
2004-08-27 15:08:30 -07:00
|
|
|
|
|
|
|
|
private:
|
2013-10-18 09:15:42 -07:00
|
|
|
bool ReadFont(CFont* font, CStrIntern fontName);
|
2004-08-27 15:08:30 -07:00
|
|
|
|
2019-11-25 06:30:25 -08:00
|
|
|
using FontsMap = std::unordered_map<CStrIntern, shared_ptr<CFont> >;
|
2013-10-18 08:53:07 -07:00
|
|
|
FontsMap m_Fonts;
|
|
|
|
|
};
|
2004-08-27 15:08:30 -07:00
|
|
|
|
2013-10-18 08:53:07 -07:00
|
|
|
#endif // INCLUDED_FONTMANAGER
|