Hi,
i try to use the VGlite in an FreeRTOS application. I can display and prozess raster pictures without problems. But now i want to use the "vg_lite_draw_text" function to write a text. I do not find any documentation how to use it.
When i understand the code in a right Way i had to first register the font with "vg_lite_register_font". What i am missin here is how the structure of the "void *data" in vg_lite_font_params has to look like.
typedef struct vg_lite_font_params
{
char name[MAX_FONT_NAME_LEN]; /*! font-family name */
eFontType_t font_type; /*! Raster/Vector font */
eFontWeight_t font_weight; /*! Font weight enum value */
eFontStretch_t font_stretch; /*! Font stretch enum value */
eFontStyle_t font_style; /*! Font style enum value */
int font_height; /*! Font height in pixels */
int data_len; /*! Font data buffer length */
void *data; /*! the address where the actual font data is stored; it is the
* responsibility of the user/application to load it there */
} vg_lite_font_params_t;
Is there any documentation about this?
Best Regards,
Florian
@Flo1989 Hi Florian,
To use VGLite draw text API, you must have a SVG file containing an embedded font. Please reference to the SVGTiny 1.2 for the embedded font in a SVG.
There is a vectorFontConverter tool that extracts font data from SVG files and saves it in an intermediate data format known asVFT-VectorFont. Then it can be registered with the VGLite driver to enable applications to draw text. This tool will be released as one tool of VGLite toolkit soon.
I attached an example to show how to use VGLite draw text API for your reference (Only passing IAR tool). The vectorFontConverter tool can be found from NXP.
Usage: vft_create input_svg output_vft
After creating a VFT file, you can use the xxd tool (Linux tool, available in the msys on windows) to create a header file:
xxd -i output_vft > output.h
Well apparently there is no vft_create tool in this package, there is svgConverter and eboConverter but no vft_create although there is a manual for that but binary itself is not present. How can I get it than ? Was this package wrongly created that it lacks it ?
Thank you for this reply, was looking for the same for some time,
Can you also shed some light on why the vg_lite_prerspective() transform function was removed from the API? using it makes the GPU stop rendering.
Now vg_lite_get_transform_matrix() is used to create a perspective matrix. It's easier than vg_lite_prerspective().
Hi, can you give an example on how to use vg_lite_get_transform_matrix() API function?
I used it the following way but it did nothing.
the image is stored in the vg_lite_buffer_t image_buffer and has size 256x256 and format VG_LITE_RGBX8888,
target buffer rt is the main frame buffer.
vg_lite_point4_t src={0,0,256,256};
vg_lite_point4_t dst = {0,0,256,300};
vg_lite_identity(&matrix);
vg_lite_get_transform_matrix(src, dst, &matrix);
vg_lite_blit(&rt, &image_buffer, &matrix, VG_LITE_BLEND_MULTIPLY, 0, VG_LITE_FILTER_BI_LINEAR);
@maglash64 You need to give 4-point location for src and 4-point location for dst.
vg_lite_point4_t src={{x0, y0}, {x1, y1}, {x2, y2}, {x3, y3}};
You can reference to the code of VGLiteBlit under boards\evkmimxrt1170\vglite_appnote_samples. Below's the download link:
https://www.nxp.com/docs/en/application-note-software/AN13075SW.zip
Hi,
sry but i have no access to that link.
Best Regards,
Florian
this couldn't be shared on the public community, I will mail to you later
Hello @joanxie ,
trying to access the link too, as we are interested in the offline tool to convert SVG to elementary structures - specifically for vector fonts. Also, a "VGLite Toolkit" is mentioned in AN13778, but I cannot find any resource. Could you help? Thanks in advance.
Stefano
Pls refer to the link as below:
Hi, I am also facing a similar problem, did you find the solution? What is the format of font to be placed in memory?