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