summary refs log tree commit diff stats
path: root/src/font.h
blob: fd24830a052bb4e841e1509366aa84b10075c769 (plain) (blame)
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
29
30
31
32
33
#ifndef FONT_H_C80183A7
#define FONT_H_C80183A7

#include <string_view>
#include <vector>
#include "vector.h"

class Renderer;

class Font {
public:

  Font(std::string_view filename, Renderer& renderer);

  int getTextureId() const { return textureId_; }

  vec2i getCharacterLocation(char ch) const;

  vec2i getCharacterSize(char ch) const;

  int getCharacterWidth(char ch) const;

  int getCharacterHeight() const { return tileSize_.h(); }

private:

  int textureId_;
  int columns_;
  vec2i tileSize_;
  std::vector<int> widths_;
};

#endif /* end of include guard: FONT_H_C80183A7 */