File: font_internal.h

package info (click to toggle)
freespace2 24.2.0%2Brepack-1
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid
  • size: 43,716 kB
  • sloc: cpp: 595,001; ansic: 21,741; python: 1,174; sh: 457; makefile: 248; xml: 181
file content (50 lines) | stat: -rw-r--r-- 1,095 bytes parent folder | download | duplicates (2)
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

#ifndef FONT_INTERNAL_H
#define FONT_INTERNAL_H

#include "globalincs/pstypes.h"

namespace font
{
	typedef struct font_char {
		int					spacing;
		int					byte_width;
		int					offset;
		short				kerning_entry;
		short				user_data;
	} font_char;

	typedef struct font_kernpair {
		char				c1, c2;
		signed char			offset;
	} font_kernpair;

	typedef struct font {
		char				filename[MAX_FILENAME_LEN];
		int					id;							//!< Should be 'VFNT'
		int					version;					//!< font version
		int					num_chars;
		int					first_ascii;
		int					w;
		int					h;
		int					num_kern_pairs;
		int					kern_data_size;
		int					char_data_size;
		int					pixel_data_size;
		font_kernpair		*kern_data;
		font_char			*char_data;
		ubyte				*pixel_data;

		// Data for 3d cards
		int				bitmap_id;			//!< A bitmap representing the font data
		int				bm_w, bm_h;			//!< Bitmap width and height
		ubyte			*bm_data;			//!< The actual font data
		int				*bm_u;				//!< U offset of each character
		int				*bm_v;				//!< V offset of each character

		font();
		~font();
	} font_data;
}

#endif // FONT_INTERNAL_H