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