ScummVM API documentation
fontman.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef GRAPHICS_FONTMAN_H
23#define GRAPHICS_FONTMAN_H
24
25#include "common/scummsys.h"
26#include "common/singleton.h"
27#include "common/str.h"
28#include "common/hashmap.h"
29#include "common/hash-str.h"
30
31
32namespace Graphics {
33
43class Font;
44class BdfFont;
45
46class FontManager : public Common::Singleton<FontManager> {
47public:
48 enum FontUsage {
49 kLocalizedFont = 0,
50 kConsoleFont = 1,
51 kGUIFont = 2,
52 kBigGUIFont = 3
53 };
54
62
69 const Font *getFontByName(const Common::String &name) const;
70
80 bool assignFontToName(const Common::String &name, const Font *font);
81
89 bool setFont(FontUsage usage, const BdfFont *font);
90
96 void removeFontName(const Common::String &name);
97
105 const Font *getFontByUsage(FontUsage usage) const;
106
107 //const Font *getFontBySize(int size???) const;
108
115 void mayDeleteFont(const Font *font) const;
116
117private:
118 friend class Common::Singleton<SingletonBaseType>;
119 FontManager();
120 ~FontManager();
121
123 Common::Array<const Font *> _ownedFonts;
124 Common::String _localizedFontName;
125};
126
128} // End of namespace Graphics
129
135#define FontMan (Graphics::FontManager::instance())
137#endif
Definition: array.h:52
Definition: hashmap.h:85
Definition: singleton.h:42
Definition: str.h:59
Definition: bdf.h:60
Definition: font.h:83
Definition: fontman.h:46
bool setLocalizedFont(const Common::String &name)
void removeFontName(const Common::String &name)
void mayDeleteFont(const Font *font) const
const Font * getFontByName(const Common::String &name) const
const Font * getFontByUsage(FontUsage usage) const
bool assignFontToName(const Common::String &name, const Font *font)
bool setFont(FontUsage usage, const BdfFont *font)
Definition: formatinfo.h:28