diff options
author | Harley Acheson <harley.acheson@gmail.com> | 2022-02-05 05:04:16 +0300 |
---|---|---|
committer | Harley Acheson <harley.acheson@gmail.com> | 2022-02-05 05:05:25 +0300 |
commit | b1cee3619062124497c73a24c3d87853f544c5f1 (patch) | |
tree | 232731f9441ccff0a9f5b5e056cd41c4c64350bb /source/blender/blenfont | |
parent | 141da5dc03b306060876bfbad3142d61cc5ec800 (diff) |
BLF: Default Size as Float
Allowing setting and storing of the default font size as float.
See D13230 for more details.
Differential Revision: https://developer.blender.org/D13230
Reviewed by Campbell Barton
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r-- | source/blender/blenfont/BLF_api.h | 2 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf_default.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h index 169107b19cb..638c5b727a6 100644 --- a/source/blender/blenfont/BLF_api.h +++ b/source/blender/blenfont/BLF_api.h @@ -309,7 +309,7 @@ void BLF_thumb_preview(const char *filename, /* blf_default.c */ void BLF_default_dpi(int dpi); -void BLF_default_size(int size); +void BLF_default_size(float size); void BLF_default_set(int fontid); /** * Get default font ID so we can pass it to other functions. diff --git a/source/blender/blenfont/intern/blf_default.c b/source/blender/blenfont/intern/blf_default.c index 57eeaa6768d..d5a0d514b5f 100644 --- a/source/blender/blenfont/intern/blf_default.c +++ b/source/blender/blenfont/intern/blf_default.c @@ -37,15 +37,15 @@ /* 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; +/* Keep in sync with `UI_DEFAULT_TEXT_POINTS` */ +static float global_font_size = 11.0f; void BLF_default_dpi(int dpi) { global_font_dpi = dpi; } -void BLF_default_size(int size) +void BLF_default_size(float size) { global_font_size = size; } |