blob: 5e78f9e777c81c2f06ff8e376274e90103d7b0f3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#ifndef GRAPHICS_FONT_H
#define GRAPHICS_FONT_H
#include<string>
#include<array>
#include<SFML/Graphics.hpp>
namespace Graphics {
class TextureFont {
public:
struct Descr {
std::string mapping;
unsigned int numrows, numcols;
};
private:
const sf::Texture &tex_;
const Descr description_;
sf::Vector2f glyphSize_;
public:
TextureFont(const sf::Texture &texture, Descr desc);
std::array<sf::Vector2f,4> getGlyphMapping(const char ch);
sf::Vector2f getGlyphSize();
const sf::Texture *getTexture();
};
}
#endif // GRAPHICS_FONT_H
|