font_info.c 591 B

123456789101112131415161718192021222324252627
  1. #include "font_info.h"
  2. #include <furi/core/check.h>
  3. FontInfo* totp_font_info_alloc() {
  4. FontInfo* font_info = malloc(sizeof(FontInfo));
  5. furi_check(font_info != NULL);
  6. font_info->data = NULL;
  7. font_info->char_info = NULL;
  8. return font_info;
  9. }
  10. void totp_font_info_free(FontInfo* font_info) {
  11. if(font_info == NULL) return;
  12. if(font_info->char_info != NULL) {
  13. free(font_info->char_info);
  14. }
  15. if(font_info->data != NULL) {
  16. free(font_info->data);
  17. }
  18. if(font_info->name != NULL) {
  19. free(font_info->name);
  20. }
  21. free(font_info);
  22. }