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:
authorHarley Acheson <harley.acheson@gmail.com>2020-10-12 19:53:00 +0300
committerHarley Acheson <harley.acheson@gmail.com>2020-10-12 19:53:00 +0300
commit19dcd32ee5942d17f9b9d45d7e13fd06206f54b8 (patch)
tree367e02853f9f25e96bc8d0c5be34616aa5bc8a0a /source/blender/editors
parent1b7458f85a6fbee8bbe072f470b6b576221da101 (diff)
UI: Remove Hard-coded Default Font Size
Default text output routines (which do not specify a size) will now use Text Style point size. Differential Revision: https://developer.blender.org/D9107 Reviewed by Brecht Van Lommel
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/include/UI_interface.h6
-rw-r--r--source/blender/editors/interface/interface_style.c8
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c2
3 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index cac18d81f56..bdec5ef3858 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -226,6 +226,12 @@ enum {
UI_BUT_OVERRIDEN = 1u << 31u,
};
+/* Default font size for normal text. */
+#define UI_DEFAULT_TEXT_POINTS 11
+
+/* Larger size used for title text. */
+#define UI_DEFAULT_TITLE_POINTS 12
+
#define UI_PANEL_WIDTH 340
#define UI_COMPACT_PANEL_WIDTH 160
#define UI_SIDEBAR_PANEL_WIDTH 220
diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c
index b38ad9f6adb..c3d528ad5c5 100644
--- a/source/blender/editors/interface/interface_style.c
+++ b/source/blender/editors/interface/interface_style.c
@@ -81,7 +81,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name, short uifont_id
style->panelzoom = 1.0; /* unused */
style->paneltitle.uifont_id = uifont_id;
- style->paneltitle.points = 12;
+ style->paneltitle.points = UI_DEFAULT_TITLE_POINTS;
style->paneltitle.kerning = 1;
style->paneltitle.shadow = 3;
style->paneltitle.shadx = 0;
@@ -90,7 +90,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name, short uifont_id
style->paneltitle.shadowcolor = 0.0f;
style->grouplabel.uifont_id = uifont_id;
- style->grouplabel.points = 12;
+ style->grouplabel.points = UI_DEFAULT_TITLE_POINTS;
style->grouplabel.kerning = 1;
style->grouplabel.shadow = 3;
style->grouplabel.shadx = 0;
@@ -99,7 +99,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name, short uifont_id
style->grouplabel.shadowcolor = 0.0f;
style->widgetlabel.uifont_id = uifont_id;
- style->widgetlabel.points = 11;
+ style->widgetlabel.points = UI_DEFAULT_TEXT_POINTS;
style->widgetlabel.kerning = 1;
style->widgetlabel.shadow = 3;
style->widgetlabel.shadx = 0;
@@ -108,7 +108,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name, short uifont_id
style->widgetlabel.shadowcolor = 0.0f;
style->widget.uifont_id = uifont_id;
- style->widget.points = 11;
+ style->widget.points = UI_DEFAULT_TEXT_POINTS;
style->widget.kerning = 1;
style->widget.shadow = 1;
style->widget.shady = -1;
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 66ce06bb340..1f4c0dd9eb1 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -102,7 +102,7 @@
#define M_GOLDEN_RATIO_CONJUGATE 0.618033988749895f
-#define VIEW3D_OVERLAY_LINEHEIGHT (0.9f * U.widget_unit)
+#define VIEW3D_OVERLAY_LINEHEIGHT (int)(1.1f * BLF_default_height_max())
/* -------------------------------------------------------------------- */
/** \name General Functions