diff options
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r-- | source/blender/blenfont/BLF_api.h | 3 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf.c | 9 |
2 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h index f9ad1de8015..5a0ade1069e 100644 --- a/source/blender/blenfont/BLF_api.h +++ b/source/blender/blenfont/BLF_api.h @@ -102,6 +102,9 @@ void BLF_batch_draw_end(void); void BLF_draw_default(float x, float y, float z, const char *str, size_t len) ATTR_NONNULL(); void BLF_draw_default_ascii(float x, float y, float z, const char *str, size_t len) ATTR_NONNULL(); +/* Set size and DPI, and return default font ID. */ +int BLF_set_default(void); + /* Draw the string using the current font. */ void BLF_draw_ex(int fontid, const char *str, size_t len, struct ResultBLF *r_info) ATTR_NONNULL(2); void BLF_draw(int fontid, const char *str, size_t len) ATTR_NONNULL(2); diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index 8e3f42e4d27..70a7b862830 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -570,6 +570,15 @@ void BLF_draw_default_ascii(float x, float y, float z, const char *str, size_t l BLF_draw_ascii(global_font_default, str, len); /* XXX, use real length */ } +int BLF_set_default(void) +{ + ASSERT_DEFAULT_SET; + + BLF_size(global_font_default, global_font_points, global_font_dpi); + + return global_font_default; +} + static void blf_draw_gl__start(FontBLF *font) { /* |