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