Revert "feat(font_glyph_format): refactor draw and font format into lv_font_glyph_format_t" (#5550)

Need to merge the commits separately.
This commit is contained in:
_VIFEXTech
2024-02-01 11:38:51 +08:00
committed by GitHub
parent 84917689da
commit 71e7bd816e
14 changed files with 197 additions and 228 deletions

View File

@@ -13,18 +13,15 @@ For example:
lv_style_set_text_font(&my_style, &lv_font_montserrat_28); /*Set a larger font*/
Fonts have a **format** property. It describes how the glyph draw data is stored.
It has *2* categories: `Legacy simple format` and `Advanced format`.
In the legacy simple format, the font is stored in a simple array of bitmaps.
In the advanced format, the font is stored in a different way like `Vector`, `SVG`, etc.
Fonts have a **bpp (bits per pixel)** property. It shows how many bits
are used to describe a pixel in a font. The value stored for a pixel
determines the pixel's opacity. This way, with higher *bpp*, the edges
of the letter can be smoother. The possible *bpp* values are 1, 2, 4 and
8 (higher values mean better quality).
In the legacy simple format, the value stored for a pixel determines the pixel's opacity.
This way, with higher *bpp (bit per pixel)*, the edges of the letter can be smoother.
The possible *bpp* values are 1, 2, 4 and 8 (higher values mean better quality).
The *format* property also affects the amount of memory needed to store a
font. For example, *format = LV_FONT_GLYPH_FORMAT_A4* makes a font nearly four times larger
compared to *format = LV_FONT_GLYPH_FORMAT_A1*.
The *bpp* property also affects the amount of memory needed to store a
font. For example, *bpp = 4* makes a font nearly four times larger
compared to *bpp = 1*.
Unicode support
***************
@@ -385,7 +382,7 @@ To do this, a custom :cpp:type:`lv_font_t` variable needs to be created:
dsc_out->box_w = 6; /*Width of the bitmap in [px]*/
dsc_out->ofs_x = 0; /*X offset of the bitmap in [pf]*/
dsc_out->ofs_y = 3; /*Y offset of the bitmap measured from the as line*/
dsc_out->format= LV_FONT_GLYPH_FORMAT_A2;
dsc_out->bpp = 2; /*Bits per pixel: 1/2/4/8*/
return true; /*true: glyph found; false: glyph was not found*/
}