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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
/*
****************************************************************************
PROJECT : GRAPE_APP
FILE : $Id: write.h 25427 2013-06-14 07:55:45Z nan.wang $
============================================================================
DESCRIPTION
Write Module Interface
============================================================================
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 _WRITE_H_
#define _WRITE_H_
#include "font.h"
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************
Title: Write Module Interface
This header is the interface to the DRW2D based bitmap
write functions.
*/
/***********************************************************
Section: Global Functions
*/
/***********************************************************
Function: SelectFont
Select font for operation.
The 'write' module uses an internal pointer to the font,
which is used by any text operation. This function sets
that pointer.
Parameters:
Font - Font to be used
Returns:
void
*/
void SelectFont(const Font_t *Font);
/***********************************************************
Function: GetFontHeight
Get height of the font.
The function returns the height in pixel of the selected
font.
Parameters:
void
Returns:
Height of font.
*/
int GetFontHeight(void);
/***********************************************************
Function: GetCharWidth
Get character width.
The function returns the width of a character in pixel
when using the currently selected font.
Parameters:
Character - ASCII value of the character
Returns:
Character width in pixel.
*/
int GetCharWidth(char Character);
/***********************************************************
Function: GetTextWidth
Return width of a text.
The function returns the width of a text in pixel
when using the currently selected font.
Parameters:
Text - Pointer to a 0 terminated string
Returns:
Text width in pixel
*/
int GetTextWidth(char *Text);
/***********************************************************
Function: GetTextHeight
Return height of a text.
The function returns the height of a text in pixel
when using the currently selected font.
Parameters:
Text - Pointer to a 0 terminated string
Returns:
Text height in pixel
*/
int GetTextHeight(char *Text);
/***********************************************************
Function: Write
Write a text.
Use the currently selected buffer, font and color to draw
a text at the given position.
Parameters:
Dev - R_DRW2D handle
PosX - Display X position
PosY - Display Y position
Color - Color to multiply with the font texture.
Text - Pointer to a 0 terminated string
Returns:
void
*/
void Write(
r_drw2d_Device_t Dev,
int PosX,
int PosY,
r_drw2d_Color_t Color,
char *Text
);
void Write_String(r_drw2d_Device_t Dev,int PosX, int PosY, r_drw2d_Color_t Color, char *Text);
void Write_Hanzi(r_drw2d_Device_t Dev,int PosX, int PosY, r_drw2d_Color_t Color, uint16_t a[],uint16_t count);
unsigned int Get_Unicode_Words_Width(unsigned int Unicode_16t);
#ifdef __cplusplus
}
#endif
#endif /* _WRITE_H_ */