summaryrefslogtreecommitdiff
path: root/src/sim/truetype.h
blob: 56759985d5724eefdfeb8c764f6dbc377ab3d720 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/** \file
 * \brief Text and Font Simulation using FreeType library.
 *
 * See Copyright Notice in cd.h
 */

#ifndef __TRUETYPE_H
#define __TRUETYPE_H

#ifdef __cplusplus
extern "C" {
#endif

#include "ft2build.h"
#include FT_FREETYPE_H

/*
   In CD version 4.4 we start to use FreeType 2.
   Only TrueType font support is enabled.
*/

typedef struct _cdTT_Text
{
  FT_Library library;
  FT_Face face;          

  unsigned char* rgba_data;
  int rgba_data_size;

  int max_height;
  int max_width;
  int descent;
  int ascent;

}cdTT_Text;

cdTT_Text* cdTT_create(void);
void cdTT_free(cdTT_Text * tt_text);
int cdTT_load(cdTT_Text * tt_text, const char *font,int size, double xres, double yres);

#ifdef __cplusplus
}
#endif

#endif  /* ifndef _CD_TRUETYPE_ */