22#define FONT_THUMB_VERSION "1.0.1"
29 const float col[4] = {1.0f, 1.0f, 1.0f, 0.0f};
54 const char *sample_text)
56 int font_id = (filepath[0] !=
'<') ?
BLF_load(filepath) : 0;
60 const char default_sample[] =
"ABCDabefg&0123";
61 const char *
sample = sample_text ? sample_text : default_sample;
69 const float scale =
float(width) / name_w * 0.98f;
74 const int height = int(name_h * 1.8f);
77 const float col[4] = {1.0f, 1.0f, 1.0f, 0.0f};
85 BLF_buffer(font_id,
nullptr,
nullptr, 0, 0, 4,
nullptr);
float3x3 scale(float3x3 mat, float2 scale)
ImBuf * IMB_font_preview(const char *filepath, unsigned int width, const float color[4], const char *sample_text=nullptr)
void * BLI_hash_md5_buffer(const char *buffer, size_t len, void *resblock)
void BLF_position(int fontid, float x, float y, float z)
bool BLF_thumb_preview(const char *filepath, unsigned char *buf, int w, int h, int channels) ATTR_NONNULL()
void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int channel_count, const ColorSpace *colorspace)
void IMB_rectfill(ImBuf *drect, const float col[4])
bool IMB_thumb_load_font_get_hash(char *r_hash)
void BLF_size(int fontid, float size)
void IMB_freeImBuf(ImBuf *ibuf)
int BLF_load(const char *filepath) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
ImBuf * IMB_thumb_load_font(const char *filepath, unsigned int x, unsigned int y)
ImBuf * IMB_allocImBuf(unsigned int x, unsigned int y, ImBufFlags flags)
void BLF_buffer_col(int fontid, const float srgb_color[4]) ATTR_NONNULL(2)
char * BLI_hash_md5_to_hexdigest(const void *resblock, char r_hex_digest[33])
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()
bool BLF_unload_id(int fontid)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
uint8_t * byte_data_for_write()
#define FONT_THUMB_VERSION