File: font.h

package info (click to toggle)
ketm 0.0.6-17sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 9,356 kB
  • ctags: 875
  • sloc: ansic: 7,303; sh: 410; makefile: 185
file content (56 lines) | stat: -rw-r--r-- 1,497 bytes parent folder | download | duplicates (3)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef _FONT_H_
#define _FONT_H_
#include <SDL/SDL.h>
#include <string.h>

#include "support.h"

enum FONTS { FONT01, FONT02, FONT03, FONT04, FONT05, FONT06, FONT07, LAST_FONT };

#define FONT01NAME "font01.bmp"
#define FONT01CHARS "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890+-.:'\"x/=><*()!?@_ "
#define FONT01W 17
#define FONT01H 17

#define FONT02NAME "font02.bmp"
#define FONT02CHARS "ABCDEFGHIJKLMNOPQRSTUVWXYZ.,:!?[]/-1234567890"
#define FONT02W 16
#define FONT02H 16

#define FONT03NAME "font03.bmp"
#define FONT03CHARS "ABCDEFGHIJKLMNOPQRSTUVWXYZ.,:!?[]/-1234567890"
#define FONT03W 16
#define FONT03H 16

#define FONT04NAME "font04.bmp"
#define FONT04CHARS "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@(){},.-;:_#*+?=!\"�$%&/�����ܵ^�'`��\\<>| "
#define FONT04W 18
#define FONT04H 37

#define FONT05NAME "font05.bmp"
#define FONT05CHARS "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890+-.:'\"x/=><*()!?@_ "
#define FONT05W 17
#define FONT05H 17

#define FONT06NAME "font06.bmp"
#define FONT06CHARS "ABCDEFGHIJKLMNOPQRSTUVWXYZ,-./0123456789:<>?'()@!# "
#define FONT06W 16
#define FONT06H 16

#define FONT07NAME "font07.bmp"
#define FONT07CHARS " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^"
#define FONT07W 8
#define FONT07H 8

typedef struct {
	char filename[256];
	SDL_Surface *fontimg;
	int w;
	int h;
	char charorder[256];
} FONT;

void font_init();
SDL_Surface *font_render(char *text,int fontnr);
void font_print(char *text, int fontnr, int x, int y);
#endif