Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenfont/intern/blf.c')
-rw-r--r--source/blender/blenfont/intern/blf.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c
index 3163b633df2..76ff498f5c2 100644
--- a/source/blender/blenfont/intern/blf.c
+++ b/source/blender/blenfont/intern/blf.c
@@ -38,6 +38,7 @@
#include "MEM_guardedalloc.h"
#include "DNA_listBase.h"
+#include "DNA_userdef_types.h"
#include "DNA_vec_types.h"
#include "BLI_math.h"
@@ -47,6 +48,8 @@
#include "IMB_colormanagement.h"
+#include "UI_interface.h"
+
#include "GPU_immediate.h"
#include "GPU_matrix.h"
#include "GPU_shader.h"
@@ -75,7 +78,6 @@ static FontBLF *global_font[BLF_MAX_FONT] = {NULL};
/* Default size and dpi, for BLF_draw_default. */
static int global_font_default = -1;
-static int global_font_points = 11;
static int global_font_dpi = 72;
/* XXX, should these be made into global_font_'s too? */
@@ -96,7 +98,6 @@ int BLF_init(void)
global_font[i] = NULL;
}
- global_font_points = 11;
global_font_dpi = 72;
return blf_font_init();
@@ -518,7 +519,8 @@ void BLF_draw_default(float x, float y, float z, const char *str, size_t len)
{
ASSERT_DEFAULT_SET;
- BLF_size(global_font_default, global_font_points, global_font_dpi);
+ const uiStyle *style = UI_style_get();
+ BLF_size(global_font_default, style->widgetlabel.points, global_font_dpi);
BLF_position(global_font_default, x, y, z);
BLF_draw(global_font_default, str, len);
}
@@ -528,7 +530,8 @@ void BLF_draw_default_ascii(float x, float y, float z, const char *str, size_t l
{
ASSERT_DEFAULT_SET;
- BLF_size(global_font_default, global_font_points, global_font_dpi);
+ const uiStyle *style = UI_style_get();
+ BLF_size(global_font_default, style->widgetlabel.points, global_font_dpi);
BLF_position(global_font_default, x, y, z);
BLF_draw_ascii(global_font_default, str, len); /* XXX, use real length */
}
@@ -537,7 +540,8 @@ int BLF_set_default(void)
{
ASSERT_DEFAULT_SET;
- BLF_size(global_font_default, global_font_points, global_font_dpi);
+ const uiStyle *style = UI_style_get();
+ BLF_size(global_font_default, style->widgetlabel.points, global_font_dpi);
return global_font_default;
}
@@ -820,6 +824,11 @@ int BLF_height_max(int fontid)
return 0;
}
+int BLF_default_height_max(void)
+{
+ return BLF_height_max(global_font_default);
+}
+
float BLF_width_max(int fontid)
{
FontBLF *font = blf_get(fontid);
@@ -831,6 +840,11 @@ float BLF_width_max(int fontid)
return 0.0f;
}
+float BLF_default_width_max(void)
+{
+ return BLF_width_max(global_font_default);
+}
+
float BLF_descender(int fontid)
{
FontBLF *font = blf_get(fontid);