MT2523 API Reference  LinkIt SDK v4
gdi_font_engine.h
1 /* Copyright Statement:
2  *
3  * (C) 2005-2016 MediaTek Inc. All rights reserved.
4  *
5  * This software/firmware and related documentation ("MediaTek Software") are
6  * protected under relevant copyright laws. The information contained herein
7  * is confidential and proprietary to MediaTek Inc. ("MediaTek") and/or its licensors.
8  * Without the prior written permission of MediaTek and/or its licensors,
9  * any reproduction, modification, use or disclosure of MediaTek Software,
10  * and information contained herein, in whole or in part, shall be strictly prohibited.
11  * You may only use, reproduce, modify, or distribute (as applicable) MediaTek Software
12  * if you have agreed to and been bound by the applicable license agreement with
13  * MediaTek ("License Agreement") and been granted explicit permission to do so within
14  * the License Agreement ("Permitted User"). If you are not a Permitted User,
15  * please cease any access or use of MediaTek Software immediately.
16  * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
17  * THAT MEDIATEK SOFTWARE RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES
18  * ARE PROVIDED TO RECEIVER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
19  * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
21  * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
22  * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
23  * SUPPLIED WITH MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
24  * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
25  * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
26  * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
27  * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
28  * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
29  * CUMULATIVE LIABILITY WITH RESPECT TO MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
30  * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE MEDIATEK SOFTWARE AT ISSUE,
31  * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
32  * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
33  */
34 
35 #ifndef __GDI_FONT_ENGINE_H__
36 #define __GDI_FONT_ENGINE_H__
37 
98 #include <stdbool.h>
99 #include <stdint.h>
100 #include <stdio.h>
101 
102 #ifdef __cplusplus
103 extern "C"
104 {
105 #endif /* __cplusplus */
106 
116 #define GDI_FONT_ENGINE_SSC_ENGLISH "*#0044#"
117 #define GDI_FONT_ENGINE_SSC_SCHINESE "*#0086#"
118 #define GDI_FONT_ENGINE_SSC_TCHINESE "*#0886#"
123 #define GDI_FONT_ENGINE_LANGUAGE_NAME_LENGTH 40
124 #define GDI_FONT_ENGINE_SSC_SIZE 10
125 #define GDI_FONT_ENGINE_COUNTRY_CODE_SIZE 8
126 #define GDI_FONT_ENGINE_ISO_SIZE 4
131 #define GDI_FONT_ENGINE_FONT_SMALL 0x0000
132 #define GDI_FONT_ENGINE_FONT_MEDIUM 0x0001
133 #define GDI_FONT_ENGINE_FONT_LARGE 0x0002
134 typedef uint8_t gdi_font_engine_size_t;
149 typedef enum {
153 
157 typedef struct {
158  uint8_t alpha;
159  uint8_t red;
160  uint8_t green;
161  uint8_t blue;
163 
167 typedef struct {
168  uint8_t *string;
169  int32_t count;
170  int32_t width;
171  int32_t height;
172  int32_t baseline;
173  int32_t max_ascent;
174  int32_t max_descent;
175  int32_t advance_width;
176  int32_t advance_height;
178 
182 typedef struct {
183  int32_t x;
184  int32_t y;
185  uint8_t *string;
186  int32_t length;
187  int32_t baseline_height;
189 
193 typedef struct {
196  uint8_t country_code[GDI_FONT_ENGINE_COUNTRY_CODE_SIZE];
197  uint8_t iso_code[GDI_FONT_ENGINE_ISO_SIZE];
209 
216 
223 
229 
236 
237 
244 
245 #ifdef __cplusplus
246 }
247 #endif
248 
255 #endif /* __GDI_FONT_ENGINE_H__ */
256 
uint8_t red
The red value.
Definition: gdi_font_engine.h:159
int32_t count
The character counter to query.
Definition: gdi_font_engine.h:169
void gdi_font_engine_set_text_color(gdi_font_engine_color_t color)
This function sets the text color.
Define the color of the font engine.
Definition: gdi_font_engine.h:157
#define GDI_FONT_ENGINE_COUNTRY_CODE_SIZE
The country code size.
Definition: gdi_font_engine.h:125
int32_t max_ascent
The distance from the baseline to the highest or upper coordinate used to place an outline point...
Definition: gdi_font_engine.h:173
int32_t max_descent
The distance from the baseline to the lowest coordinate used to place an outline point.
Definition: gdi_font_engine.h:174
Define the string information structure to query.
Definition: gdi_font_engine.h:167
uint32_t gdi_font_engine_display_string(gdi_font_engine_display_string_info_t *parameter)
This function displays the specific string.
uint8_t alpha
The alpha value.
Definition: gdi_font_engine.h:158
int32_t baseline
An imaginary line that is used to guide glyphs when rendering text.
Definition: gdi_font_engine.h:172
#define GDI_FONT_ENGINE_SSC_SIZE
The SSC size.
Definition: gdi_font_engine.h:124
uint8_t * string
A pointer to the Unicode string.
Definition: gdi_font_engine.h:168
int32_t baseline_height
The base line of the string.
Definition: gdi_font_engine.h:187
int32_t length
The string length.
Definition: gdi_font_engine.h:186
uint8_t gdi_font_engine_set_font_size(gdi_font_engine_size_t font_size)
This function sets the current font size.
int32_t width
The string width.
Definition: gdi_font_engine.h:170
int32_t advance_width
The horizontal distance to increment (for left-to-right writing) or decrement (for right-to-left writ...
Definition: gdi_font_engine.h:175
Successful.
Definition: gdi_font_engine.h:150
#define GDI_FONT_ENGINE_ISO_SIZE
The ISO size.
Definition: gdi_font_engine.h:126
void gdi_font_engine_get_font_size(gdi_font_engine_size_t *font_size)
This function gets the current font size.
uint32_t gdi_font_engine_get_string_information(gdi_font_engine_string_info_t *query)
This function gets the detailed information of the specified string.
Define the structure of the language details.
Definition: gdi_font_engine.h:193
Unsupported language.
Definition: gdi_font_engine.h:151
uint8_t blue
The blue value.
Definition: gdi_font_engine.h:161
uint8_t * string
The pointer to a Unicode string.
Definition: gdi_font_engine.h:185
Define the string information structure to display.
Definition: gdi_font_engine.h:182
gdi_font_engine_color_t gdi_font_engine_get_text_color(void)
This function gets the text color.
gdi_font_engine_status_t
Define the return status of the font engine API.
Definition: gdi_font_engine.h:149
int32_t advance_height
The vertical distance to decrement the pen position after a glyph has been renderedd.
Definition: gdi_font_engine.h:176
int32_t y
Top left y coordinate.
Definition: gdi_font_engine.h:184
int32_t x
Top left x coordinate.
Definition: gdi_font_engine.h:183
#define GDI_FONT_ENGINE_LANGUAGE_NAME_LENGTH
Define the size of the language details.
Definition: gdi_font_engine.h:123
uint8_t gdi_font_engine_size_t
Define the type of the font size.
Definition: gdi_font_engine.h:134
uint8_t green
The green value.
Definition: gdi_font_engine.h:160
int32_t height
The string height.
Definition: gdi_font_engine.h:171