be8d5d124b410d5d31cc60d4716c22b384f2d322
[retroray] / src / font.h
1 /*
2 Deep Runner - 6dof shooter game for the SGI O2.
3 Copyright (C) 2023  John Tsiombikas <nuclear@mutantstargoat.com>
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program.  If not, see <https://www.gnu.org/licenses/>.
17 */
18 #ifndef FONT_H_
19 #define FONT_H_
20
21 #include "drawtext.h"
22
23 struct font {
24         struct dtx_font *dtxfont;
25         int size;
26         float height, baseline;
27 };
28
29 int load_font(struct font *font, const char *fname);
30 void destroy_font(struct font *font);
31
32 void use_font(struct font *font);
33
34 float font_strwidth(struct font *font, const char *str);
35
36 #endif  /* FONT_H_ */