116 for (; font; font = font->
next) {
121 return static_cast<uiFont *
>(
U.uifonts.first);
129 const size_t str_len,
144 const float shadow_color[4] = {
178 yofs = std::max(0, yofs);
179 xofs = std::max(0, xofs);
200 const size_t str_len,
228 const float shadow_color[4] = {
245 const int max_line_count = max_height / line_height;
252 fs,
str, str_buf,
sizeof(str_buf), max_width, max_line_count);
261 yofs = std::max(0, yofs);
275 xofs = std::max(0, xofs);
340 txtrect.
ymin - yofs - xofs - 4,
352 const float shadow_color[4] = {
379 const float col_fg[4],
380 const float col_bg[4])
388 const float margin = height / 4.0f;
391 rect.
xmin =
x - margin;
392 rect.
xmax =
x + width + margin;
393 rect.
ymin = (
y + decent) - margin;
394 rect.
ymax = (
y + decent) + height + margin;
411 style =
BLI_findstring(&
U.uistyles,
"Unifont Style",
sizeof(style) * 2);
412 return (style !=
nullptr) ? style :
U.uistyles.first;
414 return static_cast<const uiStyle *
>(
U.uistyles.first);
485 if (font_first ==
nullptr) {
490 if (
U.font_path_ui[0]) {
500 const bool unique =
false;
506 font->blf_id =
BLF_load(font->filepath);
507 if (font->blf_id == -1) {
514 if (font->blf_id == -1) {
516 printf(
"%s: error, no fonts available\n", __func__);
521 if (style ==
nullptr) {
534 if (
U.font_path_ui_mono[0]) {
538 const bool unique =
true;
568 if (font->blf_id != -1) {
586 const bool unique =
true;
void BLF_size(int fontid, float size)
void BLF_default_set(int fontid)
int BLF_descender(int fontid) ATTR_WARN_UNUSED_RESULT
void BLF_shadow(int fontid, FontShadowType type, const float rgba[4]=nullptr)
void BLF_clipping(int fontid, int xmin, int ymin, int xmax, int ymax)
int BLF_load_default(bool unique)
void BLF_cache_flush_set_fn(void(*cache_flush_fn)())
void BLF_color4fv(int fontid, const float rgba[4])
void BLF_shadow_offset(int fontid, int x, int y)
#define BLF_DRAW_STR_DUMMY_MAX
void BLF_disable(int fontid, int option)
void BLF_rotation(int fontid, float angle)
void BLF_draw(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
void BLF_default_size(float size)
int BLF_load_mono_default(bool unique)
int BLF_load(const char *filepath) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLF_load_unique(const char *filepath) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLF_load_font_stack()
void BLF_enable(int fontid, int option)
float BLF_width(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
int BLF_height_max(int fontid) ATTR_WARN_UNUSED_RESULT
void BLF_color4ubv(int fontid, const unsigned char rgba[4])
int BLF_ascender(int fontid) ATTR_WARN_UNUSED_RESULT
void BLF_character_weight(int fontid, int weight)
void BLF_position(int fontid, float x, float y, float z)
#define LISTBASE_FOREACH(type, var, list)
void * BLI_findstring(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
char * STRNCPY(char(&dst)[N], const char *src)
@ USER_TEXT_HINTING_SLIGHT
@ USER_TEXT_RENDER_SUBPIXELAA
static double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
Read Guarded memory(de)allocation.
void UI_draw_roundbox_4fv(const rctf *rect, bool filled, float rad, const float col[4])
#define UI_DEFAULT_TOOLTIP_POINTS
void UI_draw_roundbox_corner_set(int type)
blender::Vector< blender::StringRef > UI_text_clip_multiline_middle(const uiFontStyle *fstyle, const char *str, char *clipped_str_buf, const size_t max_len_clipped_str_buf, const float max_line_width, const int max_lines)
#define UI_DEFAULT_TITLE_POINTS
#define UI_DEFAULT_TEXT_POINTS
void UI_widgetbase_draw_cache_flush()
static uiStyle * ui_style_new(ListBase *styles, const char *name, short uifont_id)
void UI_fontstyle_draw_simple(const uiFontStyle *fs, float x, float y, const char *str, const uchar col[4])
int UI_fontstyle_string_width_with_block_aspect(const uiFontStyle *fs, const StringRef str, const float aspect)
int UI_fontstyle_string_width(const uiFontStyle *fs, const char *str)
void UI_fontstyle_draw_simple_backdrop(const uiFontStyle *fs, float x, float y, const blender::StringRef str, const float col_fg[4], const float col_bg[4])
void UI_fontstyle_draw(const uiFontStyle *fs, const rcti *rect, const char *str, const size_t str_len, const uchar col[4], const uiFontStyleDraw_Params *fs_params)
const uiStyle * UI_style_get_dpi()
int UI_fontstyle_height_max(const uiFontStyle *fs)
void UI_fontstyle_draw_rotated(const uiFontStyle *fs, const rcti *rect, const char *str, const uchar col[4])
const uiStyle * UI_style_get()
void UI_fontstyle_set(const uiFontStyle *fs)
void UI_fontstyle_draw_ex(const uiFontStyle *fs, const rcti *rect, const char *str, const size_t str_len, const uchar col[4], const uiFontStyleDraw_Params *fs_params, int *r_xofs, int *r_yofs, ResultBLF *r_info)
static void fontstyle_set_ex(const uiFontStyle *fs, const float dpi_fac)
void UI_fontstyle_draw_multiline_clipped_ex(const uiFontStyle *fs, const rcti *rect, const char *str, const uchar col[4], const eFontStyle_Align align, int *r_xofs, int *r_yofs, ResultBLF *r_info)
static uiFont * uifont_to_blfont(int id)
void UI_fontstyle_draw_multiline_clipped(const uiFontStyle *fs, const rcti *rect, const char *str, const uchar col[4], const eFontStyle_Align align)
void * MEM_callocN(size_t len, const char *str)