61static uiStyle *
style_new(ListBaseT<uiStyle> *styles,
const char *name,
short uifont_id)
117 uiFont *font =
U.uifonts.first();
119 for (; font; font = font->
next) {
124 return U.uifonts.first();
132 const size_t str_len,
150 const float shadow_color[4] = {
184 yofs = std::max(0, yofs);
185 xofs = std::max(0, xofs);
206 const size_t str_len,
234 const float shadow_color[4] = {
251 const int max_line_count = max_height / line_height;
258 fs,
str, str_buf,
sizeof(str_buf), max_width, max_line_count);
267 yofs = std::max(0, yofs);
281 xofs = std::max(0, xofs);
291 r_info->
lines = lines.size();
346 txtrect.
ymin - yofs - xofs - 4,
358 const float shadow_color[4] = {
385 const float col_fg[4],
386 const float col_bg[4])
394 const float margin = height / 4.0f;
397 rect.
xmin =
x - margin;
398 rect.
xmax =
x + width + margin;
399 rect.
ymin = (
y + decent) - margin;
400 rect.
ymax = (
y + decent) + height + margin;
417 style =
BLI_findstring(&
U.uistyles,
"Unifont Style",
sizeof(style) * 2);
418 return (style !=
nullptr) ? style :
U.uistyles.first;
420 return U.uistyles.first();
477 const uiStyle *style =
U.uistyles.first();
488 uiFont *font_first =
U.uifonts.first();
491 if (font_first ==
nullptr) {
496 if (
U.font_path_ui[0]) {
505 for (
uiFont &font :
U.uifonts) {
506 const bool unique =
false;
522 CLOG_WARN(&
LOG,
"%s: error, no fonts available", __func__);
527 if (style ==
nullptr) {
540 if (
U.font_path_ui_mono[0]) {
544 const bool unique =
true;
573 for (
uiFont &font :
U.uifonts) {
592 const bool unique =
true;
#define BLF_DRAW_STR_DUMMY_MAX
#define STRNCPY_UTF8(dst, src)
#define CLOG_WARN(clg_ref,...)
Read Blender memory allocation and freeing.
#define UI_DEFAULT_TOOLTIP_POINTS
#define UI_DEFAULT_TITLE_POINTS
#define UI_DEFAULT_TEXT_POINTS
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
void fontstyle_draw_multiline_clipped_ex(const uiFontStyle *fs, const rcti *rect, const char *str, const uchar col[4], FontStyleAlign align, int *r_xofs, int *r_yofs, ResultBLF *r_info)
static uiStyle * style_new(ListBaseT< uiStyle > *styles, const char *name, short uifont_id)
const uiStyle * style_get()
void fontstyle_draw_multiline_clipped(const uiFontStyle *fs, const rcti *rect, const char *str, const uchar col[4], FontStyleAlign align)
int fontstyle_string_width(const uiFontStyle *fs, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
void fontstyle_draw_ex(const uiFontStyle *fs, const rcti *rect, const char *str, size_t str_len, const uchar col[4], const FontStyleDrawParams *fs_params, int *r_xofs, int *r_yofs, ResultBLF *r_info)
void fontstyle_draw_simple_backdrop(const uiFontStyle *fs, float x, float y, StringRef str, const float col_fg[4], const float col_bg[4])
void fontstyle_set(const uiFontStyle *fs)
const uiStyle * style_get_dpi()
void fontstyle_draw(const uiFontStyle *fs, const rcti *rect, const char *str, size_t str_len, const uchar col[4], const FontStyleDrawParams *fs_params)
void widgetbase_draw_cache_flush()
void draw_roundbox_corner_set(int type)
void fontstyle_draw_simple(const uiFontStyle *fs, float x, float y, const char *str, const uchar col[4])
int fontstyle_height_max(const uiFontStyle *fs)
void fontstyle_draw_rotated(const uiFontStyle *fs, const rcti *rect, const char *str, const uchar col[4])
static void fontstyle_set_ex(const uiFontStyle *fs, const float dpi_fac)
int int fontstyle_string_width_with_block_aspect(const uiFontStyle *fs, StringRef str, float aspect) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void draw_roundbox_4fv(const rctf *rect, bool filled, float rad, const float col[4])
Vector< StringRef > text_clip_multiline_middle(const uiFontStyle *fstyle, const char *str, char *clipped_str_buf, const size_t clipped_str_buf_maxncpy, const float max_line_width, const int max_lines)
static uiFont * uifont_to_blfont(int id)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
char * STRNCPY(char(&dst)[N], const char *src)
int BLF_load_default(bool unique)
void BLF_shadow_offset(int fontid, int x, int y)
void BLF_position(int fontid, float x, float y, float z)
float BLF_width(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
void BLF_shadow(int fontid, FontShadowType type, const float rgba[4]=nullptr)
void BLF_default_set(int fontid)
int BLF_load_mono_default(bool unique)
void * BLI_findstring(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLF_cache_flush_set_fn(void(*cache_flush_fn)())
void BLF_character_weight(int fontid, int weight)
void BLF_load_font_stack()
void BLF_disable(int fontid, FontFlags flag)
void BLF_size(int fontid, float size)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
int BLF_load(const char *filepath) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
void BLF_clipping(int fontid, int xmin, int ymin, int xmax, int ymax)
void BLF_draw(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
int BLF_ascender(int fontid) ATTR_WARN_UNUSED_RESULT
void BLF_color4ubv(int fontid, const unsigned char rgba[4])
int BLF_height_max(int fontid) ATTR_WARN_UNUSED_RESULT
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLF_descender(int fontid) ATTR_WARN_UNUSED_RESULT
int BLF_load_unique(const char *filepath) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLF_default_size(float size)
void BLF_rotation(int fontid, float angle)
void BLF_enable(int fontid, FontFlags flag)
void BLF_color4fv(int fontid, const float rgba[4])
@ USER_TEXT_HINTING_SLIGHT
@ USER_TEXT_RENDER_SUBPIXELAA