20#define FONT_THUMB_VERSION "1.0.1"
27 const float col[4] = {1.0f, 1.0f, 1.0f, 0.0f};
51 const char *sample_text)
53 int font_id = (filepath[0] !=
'<') ?
BLF_load(filepath) : 0;
57 const char default_sample[] =
"ABCDabefg&0123";
58 const char *
sample = sample_text ? sample_text : default_sample;
66 const float scale =
float(width) / name_w * 0.98f;
71 const int height = int(name_h * 1.8f);
74 const float col[4] = {1.0f, 1.0f, 1.0f, 0.0f};
82 BLF_buffer(font_id,
nullptr,
nullptr, 0, 0,
nullptr);
void BLF_size(int fontid, float size)
void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, const ColorSpace *colorspace)
void BLF_draw_buffer(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
void BLF_width_and_height(int fontid, const char *str, size_t str_len, float *r_width, float *r_height) ATTR_NONNULL()
int BLF_load(const char *filepath) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLF_buffer_col(int fontid, const float srgb_color[4]) ATTR_NONNULL(2)
bool BLF_unload_id(int fontid)
bool BLF_thumb_preview(const char *filepath, unsigned char *buf, int w, int h, int channels) ATTR_NONNULL()
void BLF_position(int fontid, float x, float y, float z)
char * BLI_hash_md5_to_hexdigest(const void *resblock, char r_hex_digest[33])
void * BLI_hash_md5_buffer(const char *buffer, size_t len, void *resblock)
void IMB_freeImBuf(ImBuf *ibuf)
ImBuf * IMB_allocImBuf(unsigned int x, unsigned int y, unsigned char planes, unsigned int flags)
void IMB_rectfill(ImBuf *drect, const float col[4])
ImBufFloatBuffer float_buffer
ImBufByteBuffer byte_buffer
ImBuf * IMB_thumb_load_font(const char *filepath, uint x, uint y)
bool IMB_thumb_load_font_get_hash(char *r_hash)
ImBuf * IMB_font_preview(const char *filepath, uint width, const float color[4], const char *sample_text)
#define FONT_THUMB_VERSION