# lv_binfont_loader.h (/api/font/binfont_loader/lv_binfont_loader_h)



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

Functions [#functions]

<ApiMember kind="function" name="lv_binfont_create" file="font/binfont_loader/lv_binfont_loader.h" line="45" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/font/binfont_loader/lv_binfont_loader.h#L45">
  lv_binfont_create [#lv_binfont_create]

  Loads a `lv_font_t` object from a binary font file

  ```c title=" " lineNumbers=1
  lv_font_t * lv_binfont_create(const char *path)
  ```

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

  | Name   | Type           | Description       |
  | ------ | -------------- | ----------------- |
  | `path` | `const char *` | path to font file |

  **Returns:** <ApiLink name="lv_font_t" display="lv_font_t *" /> — pointer to font where to load
</ApiMember>

<ApiMember kind="function" name="lv_binfont_create_from_buffer" file="font/binfont_loader/lv_binfont_loader.h" line="55" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/font/binfont_loader/lv_binfont_loader.h#L55">
  lv_binfont_create_from_buffer [#lv_binfont_create_from_buffer]

  Loads a `lv_font_t` object from a memory buffer containing the binary font file. Requires LV\_USE\_FS\_MEMFS

  ```c title=" " lineNumbers=1
  lv_font_t * lv_binfont_create_from_buffer(void *buffer, uint32_t size)
  ```

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

  | Name     | Type                        | Description                            |
  | -------- | --------------------------- | -------------------------------------- |
  | `buffer` | `void *`                    | address of the font file in the memory |
  | `size`   | <ApiLink name="uint32_t" /> | size of the font file buffer           |

  **Returns:** <ApiLink name="lv_font_t" display="lv_font_t *" /> — pointer to font where to load
</ApiMember>

<ApiMember kind="function" name="lv_binfont_destroy" file="font/binfont_loader/lv_binfont_loader.h" line="62" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/font/binfont_loader/lv_binfont_loader.h#L62">
  lv_binfont_destroy [#lv_binfont_destroy]

  Frees the memory allocated by the <ApiLink name="lv_binfont_create" display="lv_binfont_create()" /> function

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

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

  | Name   | Type                                               | Description                                                    |
  | ------ | -------------------------------------------------- | -------------------------------------------------------------- |
  | `font` | <ApiLink name="lv_font_t" display="lv_font_t *" /> | lv\_font\_t object created by the lv\_binfont\_create function |
</ApiMember>

Structs [#structs]

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

  | Member        | Type                        | Description                            |
  | ------------- | --------------------------- | -------------------------------------- |
  | `font_size`   | <ApiLink name="uint32_t" /> | Size of the font in pixels             |
  | `path`        | `const char *`              | Path to font file                      |
  | `buffer`      | `const void *`              | Address of the font file in the memory |
  | `buffer_size` | <ApiLink name="uint32_t" /> | Size of the font file buffer           |
</ApiMember>

Variables [#variables]

<ApiMember kind="variable" name="lv_binfont_font_class" file="font/binfont_loader/lv_binfont_loader.h" line="34" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/font/binfont_loader/lv_binfont_loader.h#L34">
  lv_binfont_font_class [#lv_binfont_font_class]

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

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_conf_internal.h&#x22;]" transitiveIncludes="[&#x22;lv_conf_kconfig.h&#x22;]" />
