# lv_tiny_ttf.h (/api/public/font/lv_tiny_ttf_h)



<ApiSummary functions="4" structs="1" variables="1" />

Functions [#functions]

<ApiTabs items="[&#x22;Setters (1)&#x22;,&#x22;Other (3)&#x22;]">
  <ApiTab value="Setters (1)">
    <ApiMember kind="function" name="lv_tiny_ttf_set_size" file="public/font/lv_tiny_ttf.h" line="92" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/font/lv_tiny_ttf.h#L92">
      lv_tiny_ttf_set_size [#lv_tiny_ttf_set_size]

      Set the size of the font to a new font\_size

      ```c title=" " lineNumbers=1
      void lv_tiny_ttf_set_size(lv_font_t *font, int32_t font_size)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name        | Type                                               | Description            |
      | ----------- | -------------------------------------------------- | ---------------------- |
      | `font`      | <ApiLink name="lv_font_t" display="lv_font_t *" /> | the font object        |
      | `font_size` | `int32_t`                                          | the font size in pixel |

      <Callout type="info">
        the font bitmap cache and glyph cache will be flushed.
      </Callout>
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (3)">
    <ApiMember kind="function" name="lv_tiny_ttf_create_data" file="public/font/lv_tiny_ttf.h" line="72" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/font/lv_tiny_ttf.h#L72">
      lv_tiny_ttf_create_data [#lv_tiny_ttf_create_data]

      Create a font from the specified data pointer with the specified line height.

      ```c title=" " lineNumbers=1
      lv_font_t * lv_tiny_ttf_create_data(const void *data, size_t data_size, int32_t font_size)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name        | Type           | Description            |
      | ----------- | -------------- | ---------------------- |
      | `data`      | `const void *` | the data pointer       |
      | `data_size` | `size_t`       | the data size          |
      | `font_size` | `int32_t`      | the font size in pixel |

      **Returns:** <ApiLink name="lv_font_t" display="lv_font_t *" /> — a font object
    </ApiMember>

    <ApiMember kind="function" name="lv_tiny_ttf_create_data_ex" file="public/font/lv_tiny_ttf.h" line="83" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/font/lv_tiny_ttf.h#L83">
      lv_tiny_ttf_create_data_ex [#lv_tiny_ttf_create_data_ex]

      Create a font from the specified data pointer with the specified line height and the specified cache size.

      ```c title=" " lineNumbers=1
      lv_font_t * lv_tiny_ttf_create_data_ex(const void *data, size_t data_size, int32_t font_size, lv_font_kerning_t kerning, size_t cache_size)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name         | Type                                 | Description             |
      | ------------ | ------------------------------------ | ----------------------- |
      | `data`       | `const void *`                       | the data pointer        |
      | `data_size`  | `size_t`                             | the data size           |
      | `font_size`  | `int32_t`                            | the font size in pixel  |
      | `kerning`    | <ApiLink name="lv_font_kerning_t" /> | kerning value in pixel  |
      | `cache_size` | `size_t`                             | the cache size in count |
    </ApiMember>

    <ApiMember kind="function" name="lv_tiny_ttf_destroy" file="public/font/lv_tiny_ttf.h" line="98" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/font/lv_tiny_ttf.h#L98">
      lv_tiny_ttf_destroy [#lv_tiny_ttf_destroy]

      Destroy a font previously created with lv\_tiny\_ttf\_create\_xxxx()

      ```c title=" " lineNumbers=1
      void lv_tiny_ttf_destroy(lv_font_t *font)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                               | Description                        |
      | ------ | -------------------------------------------------- | ---------------------------------- |
      | `font` | <ApiLink name="lv_font_t" display="lv_font_t *" /> | the font object **May** be `NULL`. |
    </ApiMember>
  </ApiTab>
</ApiTabs>

Structs [#structs]

<ApiMember kind="struct" name="lv_tiny_ttf_font_src_t">
  lv_tiny_ttf_font_src_t [#lv_tiny_ttf_font_src_t]

  | Member       | Type           | Description              |
  | ------------ | -------------- | ------------------------ |
  | `path`       | `const char *` | Path to the font file    |
  | `data`       | `const void *` | Pointer to the font data |
  | `data_size`  | `size_t`       | Size of the font data    |
  | `cache_size` | `size_t`       | Size of the font cache   |
</ApiMember>

Variables [#variables]

<ApiMember kind="variable" name="lv_tiny_ttf_font_class" file="public/font/lv_tiny_ttf.h" line="38" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/font/lv_tiny_ttf.h#L38">
  lv_tiny_ttf_font_class [#lv_tiny_ttf_font_class]

  ```c title=" " lineNumbers=1
  const lv_font_class_t lv_tiny_ttf_font_class
  ```
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_conf_internal.h&#x22;, &#x22;lv_font.h&#x22;, &#x22;lv_types.h&#x22;]" includedBy="[&#x22;lvgl.h&#x22;]" transitiveIncludes="[&#x22;lv_area.h&#x22;, &#x22;lv_assert.h&#x22;, &#x22;lv_color.h&#x22;, &#x22;lv_color_op.h&#x22;, &#x22;lv_draw_buf.h&#x22;, &#x22;lv_image_dsc.h&#x22;, &#x22;lv_log.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_mem.h&#x22;, &#x22;lv_palette.h&#x22;, &#x22;lv_string.h&#x22;, &#x22;lv_symbol_def.h&#x22;]" />
