59 uiStyle *style = MEM_cnew<uiStyle>(__func__);
115 for (; font; font = font->next) {
116 if (font->uifont_id ==
id) {
120 return static_cast<uiFont *
>(
U.uifonts.first);
128 const size_t str_len,
143 const float shadow_color[4] = {
177 yofs = std::max(0, yofs);
178 xofs = std::max(0, xofs);
199 const size_t str_len,
239 txtrect.
ymin - yofs - xofs - 4,
251 const float shadow_color[4] = {
278 const float col_fg[4],
279 const float col_bg[4])
287 const float margin = height / 4.0f;
290 rect.
xmin = x - margin;
291 rect.
xmax = x + width + margin;
292 rect.
ymin = (y + decent) - margin;
293 rect.
ymax = (y + decent) + height + margin;
310 style =
BLI_findstring(&
U.uistyles,
"Unifont Style",
sizeof(style) * 2);
311 return (style !=
nullptr) ? style :
U.uistyles.first;
313 return static_cast<const uiStyle *
>(
U.uistyles.first);
384 if (font_first ==
nullptr) {
385 font_first = MEM_cnew<uiFont>(__func__);
389 if (
U.font_path_ui[0]) {
399 const bool unique =
false;
405 font->blf_id =
BLF_load(font->filepath);
406 if (font->blf_id == -1) {
413 if (font->blf_id == -1) {
415 printf(
"%s: error, no fonts available\n", __func__);
420 if (style ==
nullptr) {
433 if (
U.font_path_ui_mono[0]) {
437 const bool unique =
true;
467 if (font->blf_id != -1) {
485 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)
void * BLI_findstring(const struct ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void BLI_addtail(struct 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)
#define STRNCPY(dst, 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)
#define UI_DEFAULT_TITLE_POINTS
#define UI_DEFAULT_TEXT_POINTS
void UI_widgetbase_draw_cache_flush()
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
int UI_fontstyle_string_width_with_block_aspect(const uiFontStyle *fs, const char *str, const float aspect)
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(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)
static uiFont * uifont_to_blfont(int id)
ccl_device_inline float2 floor(const float2 a)
ccl_device_inline float3 ceil(const float3 a)