diff options
Diffstat (limited to 'source/blender/blenfont/intern/blf_default.c')
-rw-r--r-- | source/blender/blenfont/intern/blf_default.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/blenfont/intern/blf_default.c b/source/blender/blenfont/intern/blf_default.c index 2bac0bf8904..57eeaa6768d 100644 --- a/source/blender/blenfont/intern/blf_default.c +++ b/source/blender/blenfont/intern/blf_default.c @@ -29,8 +29,6 @@ #include "BLF_api.h" -#include "UI_interface.h" - #include "blf_internal.h" /* call BLF_default_set first! */ @@ -39,12 +37,19 @@ /* Default size and dpi, for BLF_draw_default. */ static int global_font_default = -1; static int global_font_dpi = 72; +/* Keep in sync with `UI_style_get()->widgetlabel.points` */ +static int global_font_size = 11; void BLF_default_dpi(int dpi) { global_font_dpi = dpi; } +void BLF_default_size(int size) +{ + global_font_size = size; +} + void BLF_default_set(int fontid) { if ((fontid == -1) || blf_font_id_is_valid(fontid)) { @@ -62,8 +67,7 @@ int BLF_set_default(void) { ASSERT_DEFAULT_SET; - const uiStyle *style = UI_style_get(); - BLF_size(global_font_default, style->widgetlabel.points, global_font_dpi); + BLF_size(global_font_default, global_font_size, global_font_dpi); return global_font_default; } @@ -71,9 +75,7 @@ int BLF_set_default(void) void BLF_draw_default(float x, float y, float z, const char *str, const size_t str_len) { ASSERT_DEFAULT_SET; - - const uiStyle *style = UI_style_get(); - BLF_size(global_font_default, style->widgetlabel.points, global_font_dpi); + BLF_size(global_font_default, global_font_size, global_font_dpi); BLF_position(global_font_default, x, y, z); BLF_draw(global_font_default, str, str_len); } |