microvg  7.0.2
microvg
vg_configuration.h
Go to the documentation of this file.
1 /*
2  * C
3  *
4  * Copyright 2020-2025 MicroEJ Corp. All rights reserved.
5  * MicroEJ Corp. PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
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 #ifndef VG_FEATURE_PATH
118 #define VG_FEATURE_PATH VG_FEATURE_PATH_SINGLE_ARRAY
119 #endif
120 
121 /*
122  * @brief Set this define to specify the implementation of the MicroVG's
123  * LinearGradient (dynamic gradient creation and drawings with gradient).
124  *
125  * @see VG_FEATURE_GRADIENT_FULL
126  * @see VG_FEATURE_GRADIENT_FIRST_COLOR
127  *
128  * When not set, a stub implementation is used. No error is thrown at runtime when
129  * the application uses a gradient: the dynamic gradient are not created and the
130  * gradient rendering is not performed.
131  */
132 #ifndef VG_FEATURE_GRADIENT
133 #define VG_FEATURE_GRADIENT VG_FEATURE_GRADIENT_FULL
134 #endif
135 
136 /*
137  * @brief Set this define to specify the implementation of the MicroVG'
138  * VectorFont (dynamic font loading and text rendering).
139  *
140  * @see VG_FEATURE_FONT_FREETYPE_VECTOR
141  * @see VG_FEATURE_FONT_FREETYPE_BITMAP
142  *
143  * When not set, a stub implementation is used. The application cannot load a font
144  * (and by consequence cannot draw a text).
145  */
146 #ifndef VG_FEATURE_FONT
147 #define VG_FEATURE_FONT VG_FEATURE_FONT_FREETYPE_VECTOR
148 #endif
149 
150 /*
151  * @brief Uncomment this define to enable the support of TTF font files.
152  *
153  */
154 //#define VG_FEATURE_FREETYPE_TTF
155 
156 /*
157  * @brief Uncomment this define to enable the support of OTF font files.
158  *
159  */
160 //#define VG_FEATURE_FREETYPE_OTF
161 
162 /*
163  * @brief Uncomment this define to enable the support of colored emoji.
164  *
165  */
166 //#define VG_FEATURE_FREETYPE_COLORED_EMOJI
167 
168 /*
169  * @brief Uncomment this define to enable the support of complex layout.
170  *
171  * When set, the complex layout feature is disabled by default (the Freetype layout
172  * manager is used). See functions MICROVG_HELPER_set_complex_layout() and
173  * MICROVG_HELPER_has_complex_layouter().
174  *
175  * Note: the complex layout feature is managed by the Harfbuzz engine.
176  * Harfbuzz is used beside Freetype, thus the FT_CONFIG_OPTION_USE_HARFBUZZ define
177  * is not needed. This implementation has been chosen to ease the replacement of
178  * harfbuzz by an other complex layouter.
179  */
180 #define VG_FEATURE_FONT_COMPLEX_LAYOUT
181 //#define VG_FEATURE_FONT_COMPLEX_LAYOUT
182 
183 /*
184  * @brief Uncomment this define to allow to load external font files. When a font
185  * file is not available in the application classpath, the implementation tries to
186  * load it from an external resource system.
187  *
188  * The Platform must embbed the module "External Resource" and the BSP must implement
189  * "LLEXT_RES_impl.h" header file.
190  *
191  * When not set, only the resources compiled with the application are used.
192  */
193 //#define VG_FEATURE_FONT_EXTERNAL
194 
195 /*
196  * @brief Configure this define to set the freetype heap size
197  *
198  * The freetype heap size depends on the font used by the application
199  * @see MICROVG_MONITOR_HEAP in vg_helper.h to monitor the heap usage evolution.
200  */
201 #ifndef VG_FEATURE_FREETYPE_HEAP_SIZE
202 #define VG_FEATURE_FREETYPE_HEAP_SIZE (80 * 1024)
203 #endif
204 
205 /*
206  * @brief Configure this define to set the complex layouter heap size
207  *
208  *@see VG_FEATURE_FONT_COMPLEX_LAYOUT
209  *
210  * The complex layouter heap size depends on the font used by the application
211  * @see MICROVG_MONITOR_HEAP in vg_helper.h to monitor the heap usage evolution.
212  */
213 #ifdef VG_FEATURE_FONT_COMPLEX_LAYOUT
214 #define VG_FEATURE_FONT_COMPLEX_LAYOUT_HEAP_SIZE (80 * 1024)
215 #endif
216 
217 /*
218  * @brief Set this define to enable the support of MicroVG BufferedVectorImage.
219  * This feature requires the available number of supported GraphicsContext formats
220  * is higher than 1.
221  *
222  * Comment the define VG_FEATURE_BUFFERED_VECTOR_IMAGE to remove the support of
223  * BufferedVectorImage (even if the available number of supported GraphicsContext
224  * formats is higher than 1).
225  */
226 #if defined(UI_GC_SUPPORTED_FORMATS) && (UI_GC_SUPPORTED_FORMATS > 1)
227 
228 /*
229  * @brief Uncomment the define VG_FEATURE_BUFFERED_VECTOR_IMAGE to enable the support
230  * of BufferedVectorImage.
231  */
232 //#define VG_FEATURE_BUFFERED_VECTOR_IMAGE
233 
234 /*
235  * @brief The drawing functions to target the BufferedVectorImage have by default the
236  * identifier 1.
237  */
238 #ifndef UI_DRAWING_IDENTIFIER_BVI_FORMAT
239 #define UI_DRAWING_IDENTIFIER_BVI_FORMAT 1
240 #endif
241 
242 #elif defined(VG_FEATURE_BUFFERED_VECTOR_IMAGE)
243 #error "The BufferedVectorImage feature requires the support of several Graphics Context formats".
244 #endif // if defined(UI_GC_SUPPORTED_FORMATS) && (UI_GC_SUPPORTED_FORMATS > 1)
245 
246 // -----------------------------------------------------------------------------
247 // EOF
248 // -----------------------------------------------------------------------------
249 
250 #ifdef __cplusplus
251 }
252 #endif
253 
254 #endif // !defined VG_CONFIGURATION_H