Blender V5.3
interface_style.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2009 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <cmath>
10#include <cstdio>
11#include <cstdlib>
12#include <cstring>
13
14#include "MEM_guardedalloc.h"
15
16#include "DNA_userdef_types.h"
17
18#include "BLI_listbase.hh"
19#include "BLI_rect.hh"
20#include "BLI_string.hh"
21#include "BLI_string_utf8.hh"
22#include "BLI_utildefines.hh"
23
24#include "BKE_global.hh"
25
26#include "BLF_api.hh"
27
28#include "CLG_log.h"
29
30#include "interface_intern.hh"
31
32#ifdef WIN32
33# include "BLI_math_base_c.hh" /* M_PI */
34#endif
35
36namespace blender::ui {
37
38static CLG_LogRef LOG = {"ui.font"};
39
40static void fontstyle_set_ex(const uiFontStyle *fs, const float dpi_fac);
41
42/* style + theme + layout-engine = UI */
43
58
59/* ********************************************** */
60
61static uiStyle *style_new(ListBaseT<uiStyle> *styles, const char *name, short uifont_id)
62{
63 uiStyle *style = MEM_new_zeroed<uiStyle>(__func__);
64
65 BLI_addtail(styles, style);
66 STRNCPY_UTF8(style->name, name);
67
68 style->panelzoom = 1.0; /* unused */
69
70 style->paneltitle.uifont_id = uifont_id;
72 style->paneltitle.character_weight = 400;
73 style->paneltitle.shadow = 3;
74 style->paneltitle.shadx = 0;
75 style->paneltitle.shady = -1;
76 style->paneltitle.shadowalpha = 0.5f;
77 style->paneltitle.shadowcolor = 0.0f;
78
79 style->grouplabel.uifont_id = uifont_id;
81 style->grouplabel.character_weight = 400;
82 style->grouplabel.shadow = 3;
83 style->grouplabel.shadx = 0;
84 style->grouplabel.shady = -1;
85 style->grouplabel.shadowalpha = 0.5f;
86 style->grouplabel.shadowcolor = 0.0f;
87
88 style->widget.uifont_id = uifont_id;
90 style->widget.character_weight = 400;
91 style->widget.shadow = 1;
92 style->widget.shady = -1;
93 style->widget.shadowalpha = 0.5f;
94 style->widget.shadowcolor = 0.0f;
95
96 style->tooltip.uifont_id = uifont_id;
98 style->tooltip.character_weight = 400;
99 style->tooltip.shadow = 1;
100 style->tooltip.shady = -1;
101 style->tooltip.shadowalpha = 0.5f;
102 style->tooltip.shadowcolor = 0.0f;
103
104 style->columnspace = 8;
105 style->templatespace = 5;
106 style->boxspace = 5;
107 style->buttonspacex = 8;
108 style->buttonspacey = 2;
109 style->panelspace = 8;
110 style->panelouter = 4;
111
112 return style;
113}
114
116{
117 uiFont *font = U.uifonts.first();
118
119 for (; font; font = font->next) {
120 if (font->uifont_id == id) {
121 return font;
122 }
123 }
124 return U.uifonts.first();
125}
126
127/* *************** draw ************************ */
128
130 const rcti *rect,
131 const char *str,
132 const size_t str_len,
133 const uchar col[4],
134 const FontStyleDrawParams *fs_params,
135 int *r_xofs,
136 int *r_yofs,
137 ResultBLF *r_info)
138{
139 int xofs = 0, yofs;
140 FontFlags font_flag = {};
141 if (fs_params->word_clip) {
142 font_flag |= BLF_CLIPPING;
143 }
144
145 fontstyle_set(fs);
146
147 /* set the flag */
148 if (fs->shadow) {
149 font_flag |= BLF_SHADOW;
150 const float shadow_color[4] = {
152 BLF_shadow(fs->uifont_id, FontShadowType(fs->shadow), shadow_color);
153 BLF_shadow_offset(fs->uifont_id, fs->shadx, fs->shady);
154 }
155 if (fs_params->word_wrap == 1) {
156 font_flag |= BLF_WORD_WRAP;
157 }
158 if (fs->bold) {
159 font_flag |= BLF_BOLD;
160 }
161 if (fs->italic) {
162 font_flag |= BLF_ITALIC;
163 }
164
165 BLF_enable(fs->uifont_id, font_flag);
166
167 if (fs_params->word_wrap == 1) {
168 /* Draw from bound-box top. */
169 yofs = BLI_rcti_size_y(rect) - BLF_height_max(fs->uifont_id);
170 }
171 else {
172 /* Draw from bound-box center. */
173 const int height = BLF_ascender(fs->uifont_id) + BLF_descender(fs->uifont_id);
174 yofs = ceil(0.5f * (BLI_rcti_size_y(rect) - height));
175 }
176
177 if (fs_params->align == UI_STYLE_TEXT_CENTER) {
178 xofs = floor(0.5f * (BLI_rcti_size_x(rect) - BLF_width(fs->uifont_id, str, str_len)));
179 }
180 else if (fs_params->align == UI_STYLE_TEXT_RIGHT) {
181 xofs = BLI_rcti_size_x(rect) - BLF_width(fs->uifont_id, str, str_len);
182 }
183
184 yofs = std::max(0, yofs);
185 xofs = std::max(0, xofs);
186
187 BLF_clipping(fs->uifont_id, rect->xmin, rect->ymin, rect->xmax, rect->ymax);
188 BLF_position(fs->uifont_id, rect->xmin + xofs, rect->ymin + yofs, 0.0f);
189 BLF_color4ubv(fs->uifont_id, col);
190
191 BLF_draw(fs->uifont_id, str, str_len, r_info);
192
193 BLF_disable(fs->uifont_id, font_flag);
194
195 if (r_xofs) {
196 *r_xofs = xofs;
197 }
198 if (r_yofs) {
199 *r_yofs = yofs;
200 }
201}
202
204 const rcti *rect,
205 const char *str,
206 const size_t str_len,
207 const uchar col[4],
208 const FontStyleDrawParams *fs_params)
209{
210 fontstyle_draw_ex(fs, rect, str, str_len, col, fs_params, nullptr, nullptr, nullptr);
211}
212
214 const rcti *rect,
215 const char *str,
216 const uchar col[4],
217 const FontStyleAlign align,
218 int *r_xofs,
219 int *r_yofs,
220 ResultBLF *r_info)
221{
222 int xofs = 0, yofs;
223 FontFlags font_flag = BLF_CLIPPING;
224
225 /* Recommended for testing: Results should be the same with or without BLF clipping since the
226 * string is wrapped and shortened to fit. Disabling it can help spot issues. */
227 // font_flag &= ~BLF_CLIPPING;
228
229 fontstyle_set(fs);
230
231 /* set the flag */
232 if (fs->shadow) {
233 font_flag |= BLF_SHADOW;
234 const float shadow_color[4] = {
236 BLF_shadow(fs->uifont_id, FontShadowType(fs->shadow), shadow_color);
237 BLF_shadow_offset(fs->uifont_id, fs->shadx, fs->shady);
238 }
239 if (fs->bold) {
240 font_flag |= BLF_BOLD;
241 }
242 if (fs->italic) {
243 font_flag |= BLF_ITALIC;
244 }
245
246 BLF_enable(fs->uifont_id, font_flag);
247
248 const int max_width = BLI_rcti_size_x(rect);
249 const int max_height = BLI_rcti_size_y(rect);
250 const int line_height = BLF_height_max(fs->uifont_id);
251 const int max_line_count = max_height / line_height;
252
253 BLF_clipping(fs->uifont_id, rect->xmin, rect->ymin, rect->xmax, rect->ymax);
254 BLF_color4ubv(fs->uifont_id, col);
255
256 char str_buf[UI_MAX_DRAW_STR];
258 fs, str, str_buf, sizeof(str_buf), max_width, max_line_count);
259
260 BLI_assert(lines.size() <= max_line_count);
261
262 /* Draw so that overall text is centered vertically. */
263 yofs = (max_height + lines.size() * line_height) / 2.0f - BLF_ascender(fs->uifont_id) -
264 /* Not sure subtracting the descender is always wanted,
265 * gives best results where this is currently used. */
266 BLF_descender(fs->uifont_id) / 2.0f;
267 yofs = std::max(0, yofs);
268
269 ResultBLF line_result = {0, 0};
270 /* Draw each line with the given alignment. */
271 for (StringRef line : lines) {
272 /* String wrapping might have trailing/leading white-space. */
273 line = line.trim();
274
275 if (align == UI_STYLE_TEXT_CENTER) {
276 xofs = floor(0.5f * (max_width - BLF_width(fs->uifont_id, line.data(), line.size())));
277 }
278 else if (align == UI_STYLE_TEXT_RIGHT) {
279 xofs = max_width - BLF_width(fs->uifont_id, line.data(), line.size());
280 }
281 xofs = std::max(0, xofs);
282
283 BLF_position(fs->uifont_id, rect->xmin + xofs, rect->ymin + yofs, 0.0f);
284 BLF_draw(fs->uifont_id, line.data(), line.size(), &line_result);
285
286 yofs -= line_height;
287 }
288
289 if (r_info) {
290 r_info->width = rect->xmin + xofs + line_result.width;
291 r_info->lines = lines.size();
292 }
293
294 BLF_disable(fs->uifont_id, font_flag);
295
296 if (r_xofs) {
297 *r_xofs = xofs;
298 }
299 if (r_yofs) {
300 *r_yofs = yofs;
301 }
302}
303
305 const rcti *rect,
306 const char *str,
307 const uchar col[4],
308 const FontStyleAlign align)
309{
310 fontstyle_draw_multiline_clipped_ex(fs, rect, str, col, align, nullptr, nullptr, nullptr);
311}
312
314 const rcti *rect,
315 const char *str,
316 const uchar col[4])
317{
318 float height;
319 int xofs, yofs;
320 float angle;
321 rcti txtrect;
322
323 fontstyle_set(fs);
324
325 height = BLF_ascender(fs->uifont_id) + BLF_descender(fs->uifont_id);
326 /* becomes x-offset when rotated */
327 xofs = ceil(0.5f * (BLI_rcti_size_y(rect) - height));
328
329 /* ignore UI_STYLE, always aligned to top */
330
331 /* Rotate counter-clockwise for now (assumes left-to-right language). */
332 xofs += height;
334 angle = M_PI_2;
335
336 /* translate rect to vertical */
337 txtrect.xmin = rect->xmin - BLI_rcti_size_y(rect);
338 txtrect.ymin = rect->ymin - BLI_rcti_size_x(rect);
339 txtrect.xmax = rect->xmin;
340 txtrect.ymax = rect->ymin;
341
342 /* clip is very strict, so we give it some space */
343 /* clipping is done without rotation, so make rect big enough to contain both positions */
345 txtrect.xmin - 1,
346 txtrect.ymin - yofs - xofs - 4,
347 rect->xmax + 1,
348 rect->ymax + 4);
350 BLF_position(fs->uifont_id, txtrect.xmin + xofs, txtrect.ymax - yofs, 0.0f);
351
354 BLF_color4ubv(fs->uifont_id, col);
355
356 if (fs->shadow) {
358 const float shadow_color[4] = {
360 BLF_shadow(fs->uifont_id, FontShadowType(fs->shadow), shadow_color);
361 BLF_shadow_offset(fs->uifont_id, fs->shadx, fs->shady);
362 }
363
367 if (fs->shadow) {
369 }
370}
371
373 const uiFontStyle *fs, float x, float y, const char *str, const uchar col[4])
374{
375 fontstyle_set(fs);
376 BLF_position(fs->uifont_id, x, y, 0.0f);
377 BLF_color4ubv(fs->uifont_id, col);
379}
380
382 float x,
383 float y,
384 const StringRef str,
385 const float col_fg[4],
386 const float col_bg[4])
387{
388 fontstyle_set(fs);
389
390 {
391 const int width = BLF_width(fs->uifont_id, str.data(), str.size());
392 const int height = BLF_height_max(fs->uifont_id);
393 const int decent = BLF_descender(fs->uifont_id);
394 const float margin = height / 4.0f;
395
396 rctf rect;
397 rect.xmin = x - margin;
398 rect.xmax = x + width + margin;
399 rect.ymin = (y + decent) - margin;
400 rect.ymax = (y + decent) + height + margin;
402 draw_roundbox_4fv(&rect, true, margin, col_bg);
403 }
404
405 BLF_position(fs->uifont_id, x, y, 0.0f);
406 BLF_color4fv(fs->uifont_id, col_fg);
407 BLF_draw(fs->uifont_id, str.data(), str.size());
408}
409
410/* ************** helpers ************************ */
411
413{
414#if 0
415 uiStyle *style = nullptr;
416 /* offset is two struct uiStyle pointers */
417 style = BLI_findstring(&U.uistyles, "Unifont Style", sizeof(style) * 2);
418 return (style != nullptr) ? style : U.uistyles.first;
419#else
420 return U.uistyles.first();
421#endif
422}
423
425{
426 const uiStyle *style = style_get();
427 static uiStyle _style;
428
429 _style = *style;
430
431 _style.paneltitle.shadx = short(UI_SCALE_FAC * _style.paneltitle.shadx);
432 _style.paneltitle.shady = short(UI_SCALE_FAC * _style.paneltitle.shady);
433 _style.grouplabel.shadx = short(UI_SCALE_FAC * _style.grouplabel.shadx);
434 _style.grouplabel.shady = short(UI_SCALE_FAC * _style.grouplabel.shady);
435 _style.widget.shadx = short(UI_SCALE_FAC * _style.widget.shadx);
436 _style.widget.shady = short(UI_SCALE_FAC * _style.widget.shady);
437 _style.tooltip.shadx = short(UI_SCALE_FAC * _style.tooltip.shadx);
438 _style.tooltip.shady = short(UI_SCALE_FAC * _style.tooltip.shady);
439
440 _style.columnspace = short(UI_SCALE_FAC * _style.columnspace);
441 _style.templatespace = short(UI_SCALE_FAC * _style.templatespace);
442 _style.boxspace = short(UI_SCALE_FAC * _style.boxspace);
443 _style.buttonspacex = short(UI_SCALE_FAC * _style.buttonspacex);
444 _style.buttonspacey = short(UI_SCALE_FAC * _style.buttonspacey);
445 _style.panelspace = short(UI_SCALE_FAC * _style.panelspace);
446 _style.panelouter = short(UI_SCALE_FAC * _style.panelouter);
447
448 return &_style;
449}
450
451int fontstyle_string_width(const uiFontStyle *fs, const char *str)
452{
453 fontstyle_set(fs);
455}
456
458 const StringRef str,
459 const float aspect)
460{
461 /* FIXME(@ideasman42): the final scale of the font is rounded which should be accounted for.
462 * Failing to do so causes bad alignment when zoomed out very far in the node-editor. */
463 fontstyle_set_ex(fs, UI_SCALE_FAC / aspect);
464 return int(BLF_width(fs->uifont_id, str.data(), str.size()) * aspect);
465}
466
468{
469 fontstyle_set(fs);
470 return BLF_height_max(fs->uifont_id);
471}
472
473/* ************** init exit ************************ */
474
476{
477 const uiStyle *style = U.uistyles.first();
478
479 /* Recover from uninitialized DPI. */
480 if (U.dpi == 0) {
481 U.dpi = 72;
482 }
483 CLAMP(U.dpi, 48, 144);
484
485 /* Needed so that custom fonts are always first. */
487
488 uiFont *font_first = U.uifonts.first();
489
490 /* default builtin */
491 if (font_first == nullptr) {
492 font_first = MEM_new_zeroed<uiFont>(__func__);
493 BLI_addtail(&U.uifonts, font_first);
494 }
495
496 if (U.font_path_ui[0]) {
497 STRNCPY(font_first->filepath, U.font_path_ui);
498 font_first->uifont_id = UIFONT_CUSTOM1;
499 }
500 else {
501 STRNCPY(font_first->filepath, "default");
502 font_first->uifont_id = UIFONT_DEFAULT;
503 }
504
505 for (uiFont &font : U.uifonts) {
506 const bool unique = false;
507
508 if (font.uifont_id == UIFONT_DEFAULT) {
509 font.blf_id = BLF_load_default(unique);
510 }
511 else {
512 font.blf_id = BLF_load(font.filepath);
513 if (font.blf_id == -1) {
514 font.blf_id = BLF_load_default(unique);
515 }
516 }
517
519
520 if (font.blf_id == -1) {
521 if (G.debug & G_DEBUG) {
522 CLOG_WARN(&LOG, "%s: error, no fonts available", __func__);
523 }
524 }
525 }
526
527 if (style == nullptr) {
528 style = style_new(&U.uistyles, "Default Style", UIFONT_DEFAULT);
529 }
530
532
534
535 /* XXX, this should be moved into a style,
536 * but for now best only load the monospaced font once. */
538 /* Use unique font loading to avoid thread safety issues with mono font
539 * used for render metadata stamp in threads. */
540 if (U.font_path_ui_mono[0]) {
541 blf_mono_font = BLF_load_unique(U.font_path_ui_mono);
542 }
543 if (blf_mono_font == -1) {
544 const bool unique = true;
546 }
547
548 /* Set default flags based on UI preferences (not render fonts) */
549 {
552 FontFlags flag_enable = BLF_NONE;
553
554 if (U.text_render & USER_TEXT_HINTING_NONE) {
555 flag_enable |= BLF_HINTING_NONE;
556 }
557 else if (U.text_render & USER_TEXT_HINTING_SLIGHT) {
558 flag_enable |= BLF_HINTING_SLIGHT;
559 }
560 else if (U.text_render & USER_TEXT_HINTING_FULL) {
561 flag_enable |= BLF_HINTING_FULL;
562 }
563
564 if (U.text_render & USER_TEXT_DISABLE_AA) {
565 flag_enable |= BLF_MONOCHROME;
566 }
567 else {
568 if (U.text_render & USER_TEXT_RENDER_SUBPIXELAA) {
569 flag_enable |= BLF_RENDER_SUBPIXELAA;
570 }
571 }
572
573 for (uiFont &font : U.uifonts) {
574 if (font.blf_id != -1) {
575 BLF_disable(font.blf_id, flag_disable);
576 BLF_enable(font.blf_id, flag_enable);
577 }
578 }
579 if (blf_mono_font != -1) {
580 BLF_disable(blf_mono_font, flag_disable);
581 BLF_enable(blf_mono_font, flag_enable);
582 }
583 }
584
591 if (blf_mono_font_render == -1) {
592 const bool unique = true;
594 }
595
596 /* Load the fallback fonts last. */
598}
599
600static void fontstyle_set_ex(const uiFontStyle *fs, const float dpi_fac)
601{
602 const uiFont *font = uifont_to_blfont(fs->uifont_id);
603
604 BLF_size(font->blf_id, fs->points * dpi_fac);
606}
607
609{
611}
612
613} // namespace blender::ui
#define BLF_DRAW_STR_DUMMY_MAX
Definition BLF_api.hh:456
#define M_PI_2
#define STRNCPY_UTF8(dst, src)
#define CLOG_WARN(clg_ref,...)
Definition CLG_log.h:189
@ UIFONT_DEFAULT
@ UIFONT_CUSTOM1
#define UI_SCALE_FAC
Read Blender memory allocation and freeing.
#define UI_DEFAULT_TOOLTIP_POINTS
#define UI_DEFAULT_TITLE_POINTS
#define UI_DEFAULT_TEXT_POINTS
#define UI_MAX_DRAW_STR
#define CLAMP(a, b, c)
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
Definition btVector3.h:356
#define str(s)
#define floor
#define ceil
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)
static CLG_LogRef LOG
Definition interface.cc:82
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)
UserDef U
Definition blender.cc:58
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)
Definition blf.cc:979
void BLF_position(int fontid, float x, float y, float z)
Definition blf.cc:390
float BLF_width(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
Definition blf.cc:835
int blf_mono_font_render
Definition blf.cc:51
void BLF_shadow(int fontid, FontShadowType type, const float rgba[4]=nullptr)
Definition blf.cc:967
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)
Definition listbase.cc:615
void BLF_cache_flush_set_fn(void(*cache_flush_fn)())
Definition blf_font.cc:1828
void BLF_character_weight(int fontid, int weight)
Definition blf.cc:349
void BLF_load_font_stack()
void BLF_disable(int fontid, FontFlags flag)
Definition blf.cc:331
Global G
Definition blender.cc:57
void BLF_size(int fontid, float size)
Definition blf.cc:445
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
Definition BLI_rect.hh:207
int BLF_load(const char *filepath) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition blf.cc:177
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
unsigned char uchar
Definition BKE_text.h:58
void BLF_clipping(int fontid, int xmin, int ymin, int xmax, int ymax)
Definition blf.cc:945
void BLF_unload_all()
Definition blf.cc:299
void BLF_draw(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
Definition blf.cc:587
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition BLI_rect.hh:203
int BLF_ascender(int fontid) ATTR_WARN_UNUSED_RESULT
Definition blf.cc:916
void BLF_color4ubv(int fontid, const unsigned char rgba[4])
Definition blf.cc:454
int BLF_height_max(int fontid) ATTR_WARN_UNUSED_RESULT
Definition blf.cc:883
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:118
int BLF_descender(int fontid) ATTR_WARN_UNUSED_RESULT
Definition blf.cc:905
int BLF_load_unique(const char *filepath) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition blf.cc:190
int blf_mono_font
Definition blf.cc:50
void BLF_default_size(float size)
void BLF_rotation(int fontid, float angle)
Definition blf.cc:936
void BLF_enable(int fontid, FontFlags flag)
Definition blf.cc:322
@ BLF_MONOCHROME
Definition BLF_enums.hh:44
@ BLF_RENDER_SUBPIXELAA
Definition BLF_enums.hh:63
@ BLF_SHADOW
Definition BLF_enums.hh:38
@ BLF_CLIPPING
Definition BLF_enums.hh:37
@ BLF_ROTATION
Definition BLF_enums.hh:36
@ BLF_HINTING_SLIGHT
Definition BLF_enums.hh:46
@ BLF_HINTING_FULL
Definition BLF_enums.hh:47
@ BLF_WORD_WRAP
Definition BLF_enums.hh:42
@ BLF_ITALIC
Definition BLF_enums.hh:49
@ BLF_HINTING_NONE
Definition BLF_enums.hh:45
void BLF_color4fv(int fontid, const float rgba[4])
Definition blf.cc:507
@ USER_TEXT_RENDER_SUBPIXELAA
short blf_id
struct uiFont * next
char filepath[1024]
short uifont_id
short buttonspacey
uiFontStyle tooltip
uiFontStyle paneltitle
uiFontStyle grouplabel
short buttonspacex
short panelouter
short templatespace
short panelspace
float panelzoom
uiFontStyle widget
short columnspace
char name[64]