Lines Matching +full:- +full:c
20 .. code-block:: c
28 :Legacy simple: 1, 2, 4 or 8-bpp (aligned or unaligned) and image format, and
34 - the font is stored as an array of bitmaps, one bitmap per glyph;
35 - the value stored for each pixel determines the pixel's opacity, enabling edges
36 to be smoother --- higher bpp values result in smoother edges.
49 LVGL supports **UTF-8** encoded Unicode characters. Your editor needs to
50 be configured to save your code/text as UTF-8 (usually this the default)
51 and be sure that :c:macro:`LV_TXT_ENC` is set to :c:macro:`LV_TXT_ENC_UTF8` in
56 .. code-block:: c
71 The standard Latin-based languages (e.g., English, Spanish, German)
76 Languages like Arabic, Persian, and Hebrew, which use Right-to-Left
90 Built-In Fonts
93 There are several built-in fonts in different sizes, which can be
97 ------------
100 bullet symbol (U+2022) and the built-in symbols (see below).
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
123 -------------
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
131 The built-in fonts are **global variables** with names like
135 .. code-block:: c
139 The built-in fonts with ``bpp = 4`` contain the ASCII characters and use
143 the built-in fonts from the `FontAwesome <https://fontawesome.com/>`__
152 .. code-block:: c
158 .. code-block:: c
164 .. code-block:: c
176 ---------------------
178 Most languages use a Left-to-Right (LTR for short) writing direction,
180 Right-to-Left (RTL for short) direction.
187 BiDi support is enabled by setting :c:macro:`LV_USE_BIDI` to a non-zero value in ``lv_conf.h``.
197 :c:macro:`LV_BIDI_BASE_DIR_DEF` in ``lv_conf.h`` and other Widgets inherit the
203 - :cpp:enumerator:`LV_BASE_DIR_LTR`: Left to Right base direction
204 - :cpp:enumerator:`LV_BASE_DIR_RTL`: Right to Left base direction
205 - :cpp:enumerator:`LV_BASE_DIR_AUTO`: Auto detect base direction
209 - Create Widgets by default on the right
210 - ``lv_tabview``: Displays tabs from right to left
211 - ``lv_checkbox``: Shows the box on the right
212 - ``lv_buttonmatrix``: Orders buttons from right to left
213 - ``lv_list``: Shows icons on the right
214 - ``lv_dropdown``: Aligns options to the right
215 - The text strings in ``lv_table``, ``lv_buttonmatrix``, ``lv_keyboard``, ``lv_tabview``,
219 --------------------------
227 LVGL supports these rules if :c:macro:`LV_USE_ARABIC_PERSIAN_CHARS` is enabled
232 - Only displaying text is supported (e.g. on labels), i.e. text inputs (e.g. Text
234 - Static text (i.e. const) is not processed. E.g. text set by :cpp:func:`lv_label_set_text`
236 - Text get functions (e.g. :cpp:func:`lv_label_get_text`) will return the processed text.
241 ----------------
243 The built-in font engine supports compressed bitmaps.
246 - ticking the ``Compressed`` check box in the online converter
247 - not passing the ``--no-compress`` flag to the offline converter (compression is applied by defaul…
254 - they need the most memory
255 - they can be compressed better
256 - and on the likelihood that they are used less frequently than the medium-sized
262 -------
267 - The online converter generates kerning tables.
268 - The offline converter generates kerning tables unless ``--no-kerning`` is
270 - FreeType integration does not currently support kerning.
271 - The Tiny TTF font engine supports GPOS (Glyph Positioning) and Kern tables.
290 3. If you want to create something like the built-in
298 To make fonts globally available (like the built-in fonts), add them to
299 :c:macro:`LV_FONT_CUSTOM_DECLARE` in ``lv_conf.h``.
306 The built-in symbols are created from the `FontAwesome <https://fontawesome.com/>`__ font.
312 Add `FontAwesome.woff <https://lvgl.io/assets/others/FontAwesome5-Solid+Brands+Regular.woff>`__.
318 Make sure to compile the ``.c`` file of your font.
325 `this site <http://www.ltg.ed.ac.uk/~richard/utf-8.cgi?input=f287&mode=hex>`__.
326 For ``0xf287`` the *Hex UTF-8 bytes* are ``EF 8A 87``.
338 Loading a Font at Run-Time
344 ``--format bin`` option to generate an LVGL compatible font file.
351 .. code-block:: c
363 Loading a Font from a Memory Buffer at Run-Time
375 .. code-block:: c
400 ------------------
409 Install imagemagick, python3, python3-fontforge and potrace
415 sudo apt install imagemagick python3-fontforge potrace
426 But newer versions don't. So you might want to change 2 lines in ``potrace-wrapper.sh`` ---
427 open ``potrace-wrapper.sh`` and remove imagemagick from line 55 and line 64:
433 wh=($(identify -format '%[width]pt %[height]pt' "${input?}"))
439 convert "${input?}" -sample '1000%' - \
450 -----------------------
452 .. code-block:: console
455 ./mkttf.py ./TerminusMedium-12-12.bdf
457 Importing font `./TerminusMedium-12-12.bdf' into glyph background...
463 The TTF ``TerminusMedium-001.000.ttf`` will be created from ``./TerminusMedium-12-12.bdf``.
469 …_font_conv --bpp 1 --size 12 --no-compress --font TerminusMedium-001.000.ttf --range 0x20-0x7e,0xa…
471 :note: use 1-bpp because we don't use anti-aliasing. It doesn't look sharp on displays with a low r…
481 real-time render glyphs from TTF fonts or use an external flash to store
486 .. code-block:: c
510 dsc_out->adv_w = 12; /* Horizontal space required by the glyph in [px] */
511 dsc_out->box_h = 8; /* Height of the bitmap in [px] */
512 dsc_out->box_w = 6; /* Width of the bitmap in [px] */
513 dsc_out->ofs_x = 0; /* X offset of the bitmap in [pf] */
514 dsc_out->ofs_y = 3; /* Y offset of the bitmap measured from the as line */
515 dsc_out->format= LV_FONT_GLYPH_FORMAT_A2;
537 If the font in use does not have a glyph needed in a text-rendering task, you can
542 .. code-block:: c
549 roboto->fallback = droid_sans_fallback;