microvg  7.0.0
microvg
vg_configuration.h
Go to the documentation of this file.
1 /*
2  * C
3  *
4  * Copyright 2020-2024 MicroEJ Corp. All rights reserved.
5  * Use of this source code is governed by a BSD-style license that can be found with this software.
6  */
7 
15 #if !defined VG_CONFIGURATION_H
16 #define VG_CONFIGURATION_H
17 
18 #if defined __cplusplus
19 extern "C" {
20 #endif
21 
22 #error \
23  "This header must be customized with platform specific configuration. Remove this #error when done. This file is not modified when a new version of the CCO is installed."
24 
34 #define MICROVG_CONFIGURATION_VERSION (4)
35 
36 // -----------------------------------------------------------------------------
37 // Includes
38 // -----------------------------------------------------------------------------
39 
40 #include "ui_configuration.h"
41 
42 // -----------------------------------------------------------------------------
43 // MicroVG's Path Options
44 // -----------------------------------------------------------------------------
45 
46 /*
47  * @brief Value of "VG_FEATURE_PATH" to use only one array to store the path's
48  * commands and the commands' parameters.
49  */
50 #define VG_FEATURE_PATH_SINGLE_ARRAY (1)
51 
52 /*
53  * @brief Value of "VG_FEATURE_PATH" to use two arrays to store the path's data:
54  * one for the commands and one for the commands' parameters.
55  */
56 #define VG_FEATURE_PATH_DUAL_ARRAY (2)
57 
58 // -----------------------------------------------------------------------------
59 // MicroVG's LinearGradient Options
60 // -----------------------------------------------------------------------------
61 
62 /*
63  * @brief Value of "VG_FEATURE_GRADIENT" to use a full implementation of the
64  * MicroVG's LinearGradient.
65  *
66  * This implementation holds an array of all colors and positions set by the
67  * application.
68  */
69 #define VG_FEATURE_GRADIENT_FULL (1)
70 
71 /*
72  * @brief Value of "VG_FEATURE_GRADIENT" to use a reduced implementation of the
73  * MicroVG's LinearGradient.
74  *
75  * This implementation keeps only the first color set by the application when
76  * inializing a gradient.
77  */
78 #define VG_FEATURE_GRADIENT_FIRST_COLOR (2)
79 
80 // -----------------------------------------------------------------------------
81 // MicroVG's VectorFont Options
82 // -----------------------------------------------------------------------------
83 
84 /*
85  * @brief Value of "VG_FEATURE_FONT" to use FreeTYPE as implementation of the
86  * MicroVG's VectorFont.
87  *
88  * This implementation configures FreeTYPE to manipulate the font's glyphs as a
89  * succession of vector paths. It requires a "vector" renderer.
90  */
91 #define VG_FEATURE_FONT_FREETYPE_VECTOR (1)
92 
93 /*
94  * @brief Value of "VG_FEATURE_FONT" to use FreeTYPE as implementation of the
95  * MicroVG' VectorFont.
96  *
97  * This implementation configures FreeTYPE to manipulate the font's glyphs as
98  * bitmaps. No renderer is required
99  */
100 #define VG_FEATURE_FONT_FREETYPE_BITMAP (2)
101 
102 // -----------------------------------------------------------------------------
103 // MicroVG's Features Implementation
104 // -----------------------------------------------------------------------------
105 
106 /*
107  * @brief Set this define to embed the implementation of the MicroVG's
108  * Path (dynamic path creation and path rendering).
109  *
110  * This implementation holds the path's commands and paramters defined by the
111  * application. The define value specifies how this data is stored (one or two arrays).
112  *
113  * When not set, a stub implementation is used. No error is thrown at runtime when
114  * the application uses a path: the dynamic path are not created and the path
115  * rendering is not performed.
116  */
117 #define VG_FEATURE_PATH VG_FEATURE_PATH_SINGLE_ARRAY
118 
119 /*
120  * @brief Set this define to specify the implementation of the MicroVG's
121  * LinearGradient (dynamic gradient creation and drawings with gradient).
122  *
123  * @see VG_FEATURE_GRADIENT_FULL
124  * @see VG_FEATURE_GRADIENT_FIRST_COLOR
125  *
126  * When not set, a stub implementation is used. No error is thrown at runtime when
127  * the application uses a gradient: the dynamic gradient are not created and the
128  * gradient rendering is not performed.
129  */
130 #define VG_FEATURE_GRADIENT VG_FEATURE_GRADIENT_FULL
131 
132 /*
133  * @brief Set this define to specify the implementation of the MicroVG'
134  * VectorFont (dynamic font loading and text rendering).
135  *
136  * @see VG_FEATURE_FONT_FREETYPE_VECTOR
137  * @see VG_FEATURE_FONT_FREETYPE_BITMAP
138  *
139  * When not set, a stub implementation is used. The application cannot load a font
140  * (and by consequence cannot draw a text).
141  */
142 #define VG_FEATURE_FONT VG_FEATURE_FONT_FREETYPE_VECTOR
143 
144 /*
145  * @brief Uncomment this define to enable the support of TTF font files'
146  *
147  */
148 #define VG_FEATURE_FREETYPE_TTF
149 
150 /*
151  * @brief Uncomment this define to enable the support of OTF font files'
152  *
153  */
154 #define VG_FEATURE_FREETYPE_OTF
155 
156 /*
157  * @brief Uncomment this define to enable the support of colored emoji'
158  *
159  */
160 #define VG_FEATURE_FREETYPE_COLORED_EMOJI
161 
162 /*
163  * @brief Uncomment this define to enable the support of complex layout.
164  *
165  * When set, the complex layout feature is disabled by default (the Freetype layout
166  * manager is used). See functions MICROVG_HELPER_set_complex_layout() and
167  * MICROVG_HELPER_has_complex_layouter().
168  *
169  * Note: the complex layout feature is managed by the Harfbuzz engine.
170  * Harfbuzz is used beside Freetype, thus the FT_CONFIG_OPTION_USE_HARFBUZZ define
171  * is not needed. This implementation has been chosen to ease the replacement of
172  * harfbuzz by an other complex layouter.
173  */
174 #define VG_FEATURE_FONT_COMPLEX_LAYOUT
175 
176 /*
177  * @brief Uncomment this define to allow to load external font files. When a font
178  * file is not available in the application classpath, the implementation tries to
179  * load it from an external resource system.
180  *
181  * The Platform must embbed the module "External Resource" and the BSP must implement
182  * "LLEXT_RES_impl.h" header file.
183  *
184  * When not set, only the resources compiled with the application are used.
185  */
186 #define VG_FEATURE_FONT_EXTERNAL
187 
188 /*
189  * @brief Configure this define to set the freetype heap size
190  *
191  * The freetype heap size depends on the font used by the application
192  * @see MICROVG_MONITOR_HEAP in vg_helper.h to monitor the heap usage evolution.
193  */
194 #define VG_FEATURE_FREETYPE_HEAP_SIZE (80 * 1024)
195 
196 /*
197  * @brief Configure this define to set the complex layouter heap size
198  *
199  *@see VG_FEATURE_FONT_COMPLEX_LAYOUT
200  *
201  * The complex layouter heap size depends on the font used by the application
202  * @see MICROVG_MONITOR_HEAP in vg_helper.h to monitor the heap usage evolution.
203  */
204 #ifdef VG_FEATURE_FONT_COMPLEX_LAYOUT
205 #define VG_FEATURE_FONT_COMPLEX_LAYOUT_HEAP_SIZE (80 * 1024)
206 #endif
207 
208 /*
209  * @brief Set this define to enable the support of MicroVG BufferedVectorImage.
210  * This feature requires the available number of supported GraphicsContext formats
211  * is higher than 1.
212  *
213  * Comment the define VG_FEATURE_BUFFERED_VECTOR_IMAGE to remove the support of
214  * BufferedVectorImage (even if the available number of supported GraphicsContext
215  * formats is higher than 1).
216  */
217 #if defined(UI_GC_SUPPORTED_FORMATS) && (UI_GC_SUPPORTED_FORMATS > 1)
218 
219 /*
220  * @brief Comment the define VG_FEATURE_BUFFERED_VECTOR_IMAGE to remove the support
221  * of BufferedVectorImage (even if the available number of supported GraphicsContext
222  * formats is higher than 1).
223  */
224 #define VG_FEATURE_BUFFERED_VECTOR_IMAGE
225 
226 /*
227  * @brief The drawing functions to target the BufferedVectorImage have by default the
228  * identifier 1.
229  */
230 #ifndef UI_DRAWING_IDENTIFIER_BVI_FORMAT
231 #define UI_DRAWING_IDENTIFIER_BVI_FORMAT 1
232 #endif
233 
234 #elif defined(VG_FEATURE_BUFFERED_VECTOR_IMAGE)
235 #error "The BufferedVectorImage feature requires the support of several Graphics Context formats".
236 #endif // if defined(UI_GC_SUPPORTED_FORMATS) && (UI_GC_SUPPORTED_FORMATS > 1)
237 
238 // -----------------------------------------------------------------------------
239 // EOF
240 // -----------------------------------------------------------------------------
241 
242 #ifdef __cplusplus
243 }
244 #endif
245 
246 #endif // !defined VG_CONFIGURATION_H