Lines Matching refs:font
16 to render images of individual letters (glyph). A font is stored in a
22 lv_style_set_text_font(&my_style, &lv_font_montserrat_28); /* Set a larger font */
34 - the font is stored as an array of bitmaps, one bitmap per glyph;
38 For advanced formats, the font information is stored in its respective format.
41 font. For example, ``format = LV_FONT_GLYPH_FORMAT_A4`` makes a font nearly four
68 (assuming the font supports them), LVGL cannot correctly render
102 - :c:macro:`LV_FONT_MONTSERRAT_12`: 12 px font
103 - :c:macro:`LV_FONT_MONTSERRAT_14`: 14 px font
104 - :c:macro:`LV_FONT_MONTSERRAT_16`: 16 px font
105 - :c:macro:`LV_FONT_MONTSERRAT_18`: 18 px font
106 - :c:macro:`LV_FONT_MONTSERRAT_20`: 20 px font
107 - :c:macro:`LV_FONT_MONTSERRAT_22`: 22 px font
108 - :c:macro:`LV_FONT_MONTSERRAT_24`: 24 px font
109 - :c:macro:`LV_FONT_MONTSERRAT_26`: 26 px font
110 - :c:macro:`LV_FONT_MONTSERRAT_28`: 28 px font
111 - :c:macro:`LV_FONT_MONTSERRAT_30`: 30 px font
112 - :c:macro:`LV_FONT_MONTSERRAT_32`: 32 px font
113 - :c:macro:`LV_FONT_MONTSERRAT_34`: 34 px font
114 - :c:macro:`LV_FONT_MONTSERRAT_36`: 36 px font
115 - :c:macro:`LV_FONT_MONTSERRAT_38`: 38 px font
116 - :c:macro:`LV_FONT_MONTSERRAT_40`: 40 px font
117 - :c:macro:`LV_FONT_MONTSERRAT_42`: 42 px font
118 - :c:macro:`LV_FONT_MONTSERRAT_44`: 44 px font
119 - :c:macro:`LV_FONT_MONTSERRAT_46`: 46 px font
120 - :c:macro:`LV_FONT_MONTSERRAT_48`: 48 px font
125 - :c:macro:`LV_FONT_MONTSERRAT_28_COMPRESSED`: Same as normal 28 px font but stored as a :ref:`fon…
126 - :c:macro:`LV_FONT_DEJAVU_16_PERSIAN_HEBREW`: 16 px font with normal range + Hebrew, Arabic, Pers…
127 - :c:macro:`LV_FONT_SIMSUN_16_CJK`: 16 px font with normal range plus 1000 of the most common CJK …
128 - :c:macro:`LV_FONT_UNSCII_8`: 8 px pixel perfect font with only ASCII characters
129 - :c:macro:`LV_FONT_UNSCII_16`: 16 px pixel perfect font with only ASCII characters
132 :cpp:var:`lv_font_montserrat_16` for a 16 px height font. To use them in a
133 style, just add a pointer to a font variable like this:
140 the `Montserrat <https://fonts.google.com/specimen/Montserrat>`__ font.
144 font.
243 The built-in font engine supports compressed bitmaps.
271 - The Tiny TTF font engine supports GPOS (Glyph Positioning) and Kern tables.
282 There are several ways to add a new font to your project:
284 1. The simplest method is to use the `Online font converter <https://lvgl.io/tools/fontconverter>`_…
285 Just set the parameters, click the *Convert* button, copy the font to your project
288 2. Use the `Offline font converter <https://github.com/lvgl/lv_font_conv>`__.
291 fonts (Montserrat font and symbols) but in a different size and/or
296 To declare a font in a file, use :cpp:expr:`LV_FONT_DECLARE(my_font_name)`.
306 The built-in symbols are created from the `FontAwesome <https://fontawesome.com/>`__ font.
311 2. Open the `Online font converter <https://lvgl.io/tools/fontconverter>`__.
314 declare and use the font in your code.
317 5. Convert the font and copy the generated source code to your project.
318 Make sure to compile the ``.c`` file of your font.
319 6. Declare the font using ``extern lv_font_t my_font_name;`` or simply
331 in the font defined in the style's ``text.font`` property. To use the symbol
332 you will need to set the style's text font to use the generated font, e.g.
341 :cpp:func:`lv_binfont_create` can be used to load a font from a file. The font needs
344 ``--format bin`` option to generate an LVGL compatible font file.
346 :note: To load a font :ref:`LVGL's filesystem <overview_file_system>`
356 /* Use the font */
358 /* Free the font if not required anymore */
366 :cpp:func:`lv_binfont_create_from_buffer` can be used to load a font from a memory buffer.
367 This function may be useful to load a font from an external file system, which is not
368 supported by LVGL. The font needs to be in the same format as if it were loaded from a file.
370 :note: To load a font from a buffer :ref:`LVGL's filesystem <overview_file_system>`
381 /* Read font file into the buffer from the external file system */
384 /* Load font from the buffer */
387 /* Use the font */
389 /* Free the font if not required anymore */
396 …ays with low resolution don't look pretty with automatically rendered fonts. A bitmap font provides
397 the solution, but it's necessary to convert the bitmap font (BDF) to a TTF.
449 Example for a 12px font
457 Importing font `./TerminusMedium-12-12.bdf' into glyph background...
465 To create a font for LVGL:
469 …lv_font_conv --bpp 1 --size 12 --no-compress --font TerminusMedium-001.000.ttf --range 0x20-0x7e,0…
478 LVGL's font interface is designed to be very flexible but, even so, you
479 can add your own font engine in place of LVGL's internal one. For
482 the font's bitmap and read them when the library needs them. FreeType can be used in LVGL as descri…
484 To add a new font engine, a custom :cpp:type:`lv_font_t` variable needs to be created:
488 /* Describe the properties of a font */
499 /* Get info about glyph of `unicode_letter` in `font` font.
503 …bool my_get_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_l…
521 /* Get the bitmap of `unicode_letter` from `font`. */
522 const uint8_t * my_get_glyph_bitmap_cb(const lv_font_t * font, uint32_t unicode_letter)
537 If the font in use does not have a glyph needed in a text-rendering task, you can
538 specify a ``fallback`` font to be used in :cpp:type:`lv_font_t`.
544 /* Roboto font doesn't have support for CJK glyphs */