# lv_tiny_ttf.h (/api/libs/tiny_ttf/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="libs/tiny_ttf/lv_tiny_ttf.h" line="89" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/tiny_ttf/lv_tiny_ttf.h#L89">
      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` | <ApiLink name="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="libs/tiny_ttf/lv_tiny_ttf.h" line="69" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/tiny_ttf/lv_tiny_ttf.h#L69">
      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` | <ApiLink name="size_t" />  | the data size          |
      | `font_size` | <ApiLink name="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="libs/tiny_ttf/lv_tiny_ttf.h" line="80" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/tiny_ttf/lv_tiny_ttf.h#L80">
      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`  | <ApiLink name="size_t" />            | the data size           |
      | `font_size`  | <ApiLink name="int32_t" />           | the font size in pixel  |
      | `kerning`    | <ApiLink name="lv_font_kerning_t" /> | kerning value in pixel  |
      | `cache_size` | <ApiLink name="size_t" />            | the cache size in count |
    </ApiMember>

    <ApiMember kind="function" name="lv_tiny_ttf_destroy" file="libs/tiny_ttf/lv_tiny_ttf.h" line="95" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/tiny_ttf/lv_tiny_ttf.h#L95">
      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 |
    </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`  | <ApiLink name="size_t" /> | Size of the font data    |
  | `cache_size` | <ApiLink name="size_t" /> | Size of the font cache   |
</ApiMember>

Variables [#variables]

<ApiMember kind="variable" name="lv_tiny_ttf_font_class" file="libs/tiny_ttf/lv_tiny_ttf.h" line="35" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/tiny_ttf/lv_tiny_ttf.h#L35">
  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;]" transitiveIncludes="[&#x22;lv_conf_kconfig.h&#x22;]" />
