diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-11-06 08:26:09 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-11-06 08:28:02 +0300 |
commit | 81baeec59ba530c53f8db253bb0289825aef2f82 (patch) | |
tree | 840790ac1bd1d69f8ddae68e4ac099d288521b71 /source/blender/editors/interface | |
parent | a804a11db100883b15d100b1566f545a81a099cc (diff) |
Cleanup: remove window_manager & editor includes from BLF
Remove the need to include the window manager & editor functions
in low level font rendering code.
- The default font size is now set when changed in the preferences.
- Flushing cache is set as a callback.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_style.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index 92a9f14c77d..4c640851999 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -419,7 +419,7 @@ int UI_fontstyle_height_max(const uiFontStyle *fs) /* reading without uifont will create one */ void uiStyleInit(void) { - uiStyle *style = U.uistyles.first; + const uiStyle *style = U.uistyles.first; /* recover from uninitialized dpi */ if (U.dpi == 0) { @@ -490,9 +490,13 @@ void uiStyleInit(void) } if (style == NULL) { - ui_style_new(&U.uistyles, "Default Style", UIFONT_DEFAULT); + style = ui_style_new(&U.uistyles, "Default Style", UIFONT_DEFAULT); } + BLF_cache_flush_set_fn(UI_widgetbase_draw_cache_flush); + + BLF_default_size(style->widgetlabel.points); + /* XXX, this should be moved into a style, * but for now best only load the monospaced font once. */ BLI_assert(blf_mono_font == -1); |