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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/*
****************************************************************************
PROJECT : GRAPE_APP
FILE : $Id: font.h 25427 2013-06-14 07:55:45Z nan.wang $
============================================================================
DESCRIPTION
Sample program for demonstration of the D1X GFX features
============================================================================
C O P Y R I G H T
============================================================================
Copyright (c) 2014
by
Renesas Electronics (Europe) GmbH.
Arcadiastrasse 10
D-40472 Duesseldorf
Germany
All rights reserved.
============================================================================
Purpose: only for testing, not for mass production
DISCLAIMER
LICENSEE has read, understood and accepted the terms and conditions defined in
the license agreement, especially the usage rights. In any case, it is
LICENSEE's responsibility to make sure that any user of the software complies
with the terms and conditions of the signed license agreement.
SAMPLE CODE is not part of the licensed software, as such it must not be used in
mass-production applications. It can only be used for evaluation and
demonstration purposes at customer’s premises listed in the signed license
agreement.
****************************************************************************
*/
#ifndef _FONT_H_
#define _FONT_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "img_format.h"
/***********************************************************
Title: Font Interface
This header describes the structure of a bitmap font,
which can be used by the framework.
*/
/***********************************************************
Section: Global Types
*/
/***********************************************************
Type: FontPos_t
Character position and width information.
The type is used to specify the position of a character
inside a font texture.
Members:
Offset - Pixel position in the texture
Width - Pixel width in the texture
*/
typedef struct {
int Offset;
int Width;
} FontPos_t;
/***********************************************************
Type: CJKFontPos_t keith20210108
Character position and width information.
The type is used to specify the position of a character
inside a font texture.
Members:
Offset - Pixel position in the texture
Width - Pixel width in the texture
*/
/*
typedef struct {
unsigned short FontID;
unsigned short Xoffset;
unsigned short Yoffset;
unsigned char Width;
//int Height;
} CJKFontPos_t;
*/
/***********************************************************
Type: Font_t
Font data type.
This structure contains the data of a font.
Members:
Texture - Pointer to the font's image structure
Pos - Array of character information
Height - Pixel height of the font
*/
typedef struct {
Img_t *Texture;
const FontPos_t *Pos;
int Height;
} Font_t;
/***********************************************************
Type: CJKFontPos_t keith20210108
Character position and width information.
The type is used to specify the position of a character
inside a font texture.
Members:
Offset - Pixel position in the texture
Width - Pixel width in the texture
*/
typedef struct {
unsigned short FontID;
unsigned short Xoffset;
unsigned short Yoffset;
unsigned char Width;
unsigned char Height;
} CJKFontPos_t;
typedef struct {
unsigned short FontID;
unsigned short Xpos;
unsigned short Ypos;
unsigned char Width;
unsigned char Height;
char Xoffset;
char Yoffset;
char Xadvance;
} HanSansCNFontPos_t;
#ifdef __cplusplus
}
#endif
#endif /* _FONT_H_ */