# lv_imgfont.h (/api/font/imgfont/lv_imgfont_h)



<ApiSummary functions="2" typedefs="1" />

Functions [#functions]

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

  Creates a image font with info parameter specified.

  ```c title=" " lineNumbers=1
  lv_font_t * lv_imgfont_create(uint16_t height, lv_imgfont_get_path_cb_t path_cb, void *user_data)
  ```

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

  | Name        | Type                                        | Description                                         |
  | ----------- | ------------------------------------------- | --------------------------------------------------- |
  | `height`    | <ApiLink name="uint16_t" />                 | font size                                           |
  | `path_cb`   | <ApiLink name="lv_imgfont_get_path_cb_t" /> | a function to get the image path name of character. |
  | `user_data` | `void *`                                    | pointer to user data                                |

  **Returns:** <ApiLink name="lv_font_t" display="lv_font_t *" /> — pointer to the new imgfont or NULL if create error.
</ApiMember>

<ApiMember kind="function" name="lv_imgfont_destroy" file="font/imgfont/lv_imgfont.h" line="51" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/font/imgfont/lv_imgfont.h#L51">
  lv_imgfont_destroy [#lv_imgfont_destroy]

  Destroy a image font that has been created.

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

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

  | Name   | Type                                               | Description                   |
  | ------ | -------------------------------------------------- | ----------------------------- |
  | `font` | <ApiLink name="lv_font_t" display="lv_font_t *" /> | pointer to image font handle. |
</ApiMember>

Typedefs [#typedefs]

<ApiMember kind="typedef" name="lv_imgfont_get_path_cb_t" file="font/imgfont/lv_imgfont.h" line="30" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/font/imgfont/lv_imgfont.h#L30">
  lv_imgfont_get_path_cb_t [#lv_imgfont_get_path_cb_t]

  ```c title=" " lineNumbers=1
  typedef const void *(* lv_imgfont_get_path_cb_t) (const lv_font_t *font, uint32_t unicode, uint32_t unicode_next, int32_t *offset_y, void *user_data)
  ```
</ApiMember>

<TypeUsedBy name="lv_imgfont_get_path_cb_t" count="1">
  * `lv_imgfont_create` — param `path_cb`
</TypeUsedBy>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_conf_internal.h&#x22;, &#x22;lv_font.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_conf_kconfig.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;, &#x22;lv_types.h&#x22;]" />
