The Battle for Wesnoth  1.17.0-dev
constants.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 - 2021
3  by Mark de Wever <koraq@xs4all.nl>
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 #include <string>
19 
20 namespace font {
21 
22 // font sizes, to be made theme parameters
23 extern const int SIZE_NORMAL;
24 // automatic computation of other font sizes, to be made a default for theme-provided values
27 
28 // For arbitrary scaling:
29 // (Not used in defining the SIZE_* consts because of spurious compiler warnings.)
30 inline int relative_size(int size)
31 {
32  return (SIZE_NORMAL * size / 14);
33 }
34 
35 // GUI1 built-in maximum
36 extern const std::size_t max_text_line_width;
37 
38 // String constants
39 extern const std::string
40  ellipsis,
41  nbsp,
42 
49 
52 
53 } // end namespace font
const std::string weapon_details_sep
Definition: constants.cpp:50
Collection of helper functions relating to Pango formatting.
int relative_size(int size)
Definition: constants.hpp:30
const int SIZE_BUTTON_SMALL
Definition: constants.cpp:26
const int SIZE_PLUS
Definition: constants.cpp:29
const int SIZE_NORMAL
Definition: constants.cpp:20
const int SIZE_XLARGE
Definition: constants.cpp:33
const std::string unicode_minus
Definition: constants.cpp:42
std::size_t size(const std::string &str)
Length in characters of a UTF-8 string.
Definition: unicode.cpp:87
const std::string ellipsis
Definition: constants.cpp:39
const int SIZE_15
Definition: constants.cpp:28
const std::string unicode_multiplication_sign
Definition: constants.cpp:46
const std::size_t max_text_line_width
Definition: constants.cpp:36
const int SIZE_BUTTON
Definition: constants.cpp:25
const std::string unicode_figure_dash
Definition: constants.cpp:45
const std::string unicode_en_dash
Definition: constants.cpp:43
const std::string unicode_bullet
Definition: constants.cpp:47
const int SIZE_TITLE
Definition: constants.cpp:31
const std::string nbsp
Definition: constants.cpp:40
const int SIZE_LARGE
Definition: constants.cpp:30
const std::string weapon_numbers_sep
Definition: constants.cpp:49
const std::string unicode_em_dash
Definition: constants.cpp:44
const int SIZE_FLOAT_LABEL
Definition: constants.cpp:32
const int SIZE_SMALL
Definition: constants.cpp:24
const int SIZE_TINY
Definition: constants.cpp:23