void BLF_default_set(int fontid) { FontBLF *font = blf_get(fontid); if (font || fontid == -1) { global_font_default = fontid; } }
void BLF_rotation_default(float angle) { FontBLF *font = blf_get(global_font_default); if (font) { font->angle = angle; } }
void BLF_buffer_col(int fontid, float r, float g, float b, float a) { FontBLF *font = blf_get(fontid); if (font) { ARRAY_SET_ITEMS(font->buf_info.col_init, r, g, b, a); } }
void BLF_size(int fontid, int size, int dpi) { FontBLF *font = blf_get(fontid); if (font) { blf_font_size(font, size, dpi); } }
void BLF_rotation(int fontid, float angle) { FontBLF *font = blf_get(fontid); if (font) { font->angle = angle; } }
void BLF_disable(int fontid, int option) { FontBLF *font = blf_get(fontid); if (font) { font->flags &= ~option; } }
void BLF_enable(int fontid, int option) { FontBLF *font = blf_get(fontid); if (font) { font->flags |= option; } }
void BLF_disable_default(int option) { FontBLF *font = blf_get(global_font_default); if (font) { font->flags &= ~option; } }
void BLF_unload_id(int fontid) { FontBLF *font = blf_get(fontid); if (font) { blf_font_free(font); global_font[fontid] = NULL; } }
void BLF_wordwrap(int fontid, int wrap_width) { FontBLF *font = blf_get(fontid); if (font) { font->wrap_width = wrap_width; } }
void BLF_blur(int fontid, int size) { FontBLF *font = blf_get(fontid); if (font) { font->blur = size; } }
void BLF_draw_buffer(int fontid, const char *str) { FontBLF *font = blf_get(fontid); if (font && font->glyph_cache && (font->buf_info.fbuf || font->buf_info.cbuf)) { blf_font_buffer(font, str); } }
void BLF_boundbox(int fontid, const char *str, size_t len, rctf *box) { FontBLF *font = blf_get(fontid); if (font) { blf_font_boundbox(font, str, len, box); } }
void BLF_metrics_attach(int fontid, unsigned char *mem, int mem_size) { FontBLF *font = blf_get(fontid); if (font) { blf_font_attach_from_mem(font, mem, mem_size); } }
void BLF_matrix(int fontid, const double m[16]) { FontBLF *font = blf_get(fontid); if (font) { memcpy(font->m, m, sizeof(font->m)); } }
void BLF_shadow_offset(int fontid, int x, int y) { FontBLF *font = blf_get(fontid); if (font) { font->shadow_x = x; font->shadow_y = y; } }
float BLF_height(int fontid, const char *str, size_t len) { FontBLF *font = blf_get(fontid); if (font && font->glyph_cache) { return blf_font_height(font, str, len); } return 0.0f; }
float BLF_ascender(int fontid) { FontBLF *font = blf_get(fontid); if (font && font->glyph_cache) { return font->glyph_cache->ascender; } return 0.0f; }
float BLF_width_max(int fontid) { FontBLF *font = blf_get(fontid); if (font && font->glyph_cache) { return font->glyph_cache->max_glyph_width; } return 0.0f; }
int BLF_height_max(int fontid) { FontBLF *font = blf_get(fontid); if (font && font->glyph_cache) { return font->glyph_cache->max_glyph_height; } return 0; }
float BLF_fixed_width(int fontid) { FontBLF *font = blf_get(fontid); if (font && font->glyph_cache) { return blf_font_fixed_width(font); } return 0.0f; }
void BLF_aspect(int fontid, float x, float y, float z) { FontBLF *font = blf_get(fontid); if (font) { font->aspect[0] = x; font->aspect[1] = y; font->aspect[2] = z; } }
void BLF_clipping(int fontid, float xmin, float ymin, float xmax, float ymax) { FontBLF *font = blf_get(fontid); if (font) { font->clip_rec.xmin = xmin; font->clip_rec.ymin = ymin; font->clip_rec.xmax = xmax; font->clip_rec.ymax = ymax; } }
void BLF_clipping_default(float xmin, float ymin, float xmax, float ymax) { FontBLF *font = blf_get(global_font_default); if (font) { font->clip_rec.xmin = xmin; font->clip_rec.ymin = ymin; font->clip_rec.xmax = xmax; font->clip_rec.ymax = ymax; } }
void BLF_width_and_height(int fontid, const char *str, size_t len, float *r_width, float *r_height) { FontBLF *font = blf_get(fontid); if (font && font->glyph_cache) { blf_font_width_and_height(font, str, len, r_width, r_height, NULL); } else { *r_width = *r_height = 0.0f; } }
void BLF_draw_ascii(int fontid, const char *str, size_t len) { FontBLF *font = blf_get(fontid); GLint mode, param; if (font && font->glyph_cache) { blf_draw__start(font, &mode, ¶m); blf_font_draw_ascii(font, str, len); blf_draw__end(mode, param); } }
void BLF_buffer_col(int fontid, float r, float g, float b, float a) { FontBLF *font = blf_get(fontid); if (font) { font->buf_info.col[0] = r; font->buf_info.col[1] = g; font->buf_info.col[2] = b; font->buf_info.col[3] = a; } }
void BLF_shadow(int fontid, int level, float r, float g, float b, float a) { FontBLF *font = blf_get(fontid); if (font) { font->shadow = level; font->shadow_col[0] = r; font->shadow_col[1] = g; font->shadow_col[2] = b; font->shadow_col[3] = a; } }
void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch, struct ColorManagedDisplay *display) { FontBLF *font = blf_get(fontid); if (font) { font->buf_info.fbuf = fbuf; font->buf_info.cbuf = cbuf; font->buf_info.w = w; font->buf_info.h = h; font->buf_info.ch = nch; font->buf_info.display = display; } }
float BLF_height_ex( int fontid, const char *str, size_t len, struct ResultBLF *r_info) { FontBLF *font = blf_get(fontid); BLF_RESULT_CHECK_INIT(r_info); if (font && font->glyph_cache) { return blf_font_height(font, str, len, r_info); } return 0.0f; }