The Battle for Wesnoth
1.19.7+dev
font
font_config.hpp
Go to the documentation of this file.
1
/*
2
Copyright (C) 2016 - 2024
3
by Chris Beck<render787@gmail.com>
4
Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5
6
This program is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2 of the License, or
9
(at your option) any later version.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY.
12
13
See the COPYING file for more details.
14
*/
15
16
#pragma once
17
18
/***
19
* The font::manager initializes cairo and font_config in order to figure out
20
* what local fonts to use.
21
*/
22
23
#include "
font_options.hpp
"
24
25
class
t_string
;
26
27
namespace
font
{
28
29
// Object which initializes font rendering libraries and related caches.
30
// When it is created, the font directory is found within game_config::path.
31
// If that path changes then this object should be destroyed and recreated.
32
//
33
// You should not use GUI1 or GUI2 or any font api function unless a
34
// font::manager is alive.
35
// Don't create two font::manager objects at once.
36
//
37
struct
manager
{
38
manager
();
39
~manager
();
40
41
manager
(
const
manager
&) =
delete
;
42
manager
&
operator =
(
const
manager
&) =
delete
;
43
};
44
45
/***
46
* load_font_config actually searches the game font path for fonts, and refreshes
47
* the set of loaded fonts
48
*
49
* Returns true in case of success
50
*/
51
bool
load_font_config
();
52
53
/** Returns the currently defined fonts. */
54
const
t_string
&
get_font_families
(
family_class
fclass =
FONT_SANS_SERIF
);
55
56
}
// end namespace font
t_string
Definition:
tstring.hpp:131
font_options.hpp
font
Graphical text output.
Definition:
editor_controller.hpp:31
font::family_class
family_class
Font classes for get_font_families().
Definition:
font_options.hpp:27
font::FONT_SANS_SERIF
@ FONT_SANS_SERIF
Definition:
font_options.hpp:28
font::get_font_families
const t_string & get_font_families(family_class fclass)
Returns the currently defined fonts.
Definition:
font_config.cpp:102
font::load_font_config
bool load_font_config()
Definition:
font_config.cpp:58
font::manager
Definition:
font_config.hpp:37
font::manager::manager
manager(const manager &)=delete
font::manager::operator=
manager & operator=(const manager &)=delete
font::manager::~manager
~manager()
Definition:
font_config.cpp:154
font::manager::manager
manager()
Definition:
font_config.cpp:120
Generated by
1.9.1