yolobs-studio/plugins/text-freetype2/find-font.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
887 B
C
Raw Normal View History

2016-02-23 23:16:51 +00:00
#pragma once
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_SFNT_NAMES_H
#include FT_TRUETYPE_IDS_H
#include <util/dstr.h>
#include <util/darray.h>
struct font_path_info {
2019-09-22 21:19:10 +00:00
char *face_and_style;
2016-02-23 23:16:51 +00:00
uint32_t full_len;
uint32_t face_len;
2019-09-22 21:19:10 +00:00
bool is_bitmap;
2016-02-23 23:16:51 +00:00
uint32_t num_sizes;
2019-09-22 21:19:10 +00:00
int *sizes;
2016-02-23 23:16:51 +00:00
2019-09-22 21:19:10 +00:00
bool bold;
bool italic;
2016-02-23 23:16:51 +00:00
2019-09-22 21:19:10 +00:00
char *path;
FT_Long index;
2016-02-23 23:16:51 +00:00
};
static inline void font_path_info_free(struct font_path_info *info)
{
bfree(info->sizes);
bfree(info->face_and_style);
bfree(info->path);
}
extern void build_font_path_info(FT_Face face, FT_Long idx, const char *path);
extern char *sfnt_name_to_utf8(FT_SfntName *sfnt_name);
extern bool load_cached_os_font_list(void);
extern void load_os_font_list(void);
extern void free_os_font_list(void);
extern const char *get_font_path(const char *family, uint16_t size,
2019-09-22 21:19:10 +00:00
const char *style, uint32_t flags,
FT_Long *idx);