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/editors/interface/interface_style.c')
-rw-r--r--source/blender/editors/interface/interface_style.c41
1 files changed, 20 insertions, 21 deletions
diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c
index 62a4c01bc6c..57f35f71927 100644
--- a/source/blender/editors/interface/interface_style.c
+++ b/source/blender/editors/interface/interface_style.c
@@ -89,8 +89,11 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name)
BLI_addtail(styles, style);
BLI_strncpy(style->name, name, MAX_STYLE_NAME);
+ style->panelzoom= 1.0;
+
style->paneltitle.uifont_id= UIFONT_DEFAULT;
style->paneltitle.points= 13;
+ style->paneltitle.kerning= 0;
style->paneltitle.shadow= 5;
style->paneltitle.shadx= 2;
style->paneltitle.shady= -2;
@@ -99,6 +102,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name)
style->grouplabel.uifont_id= UIFONT_DEFAULT;
style->grouplabel.points= 12;
+ style->grouplabel.kerning= 0;
style->grouplabel.shadow= 3;
style->grouplabel.shadx= 1;
style->grouplabel.shady= -1;
@@ -106,6 +110,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name)
style->widgetlabel.uifont_id= UIFONT_DEFAULT;
style->widgetlabel.points= 11;
+ style->widgetlabel.kerning= 0;
style->widgetlabel.shadow= 3;
style->widgetlabel.shadx= 1;
style->widgetlabel.shady= -1;
@@ -114,6 +119,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name)
style->widget.uifont_id= UIFONT_DEFAULT;
style->widget.points= 11;
+ style->widget.kerning= 0;
style->widget.shadowalpha= 0.25f;
style->columnspace= 5;
@@ -141,22 +147,6 @@ static uiFont *uifont_to_blfont(int id)
/* *************** draw ************************ */
-static void ui_font_shadow_draw(uiFontStyle *fs, int x, int y, char *str)
-{
- float color[4];
-
- glGetFloatv(GL_CURRENT_COLOR, color);
-
- glColor4f(fs->shadowcolor, fs->shadowcolor, fs->shadowcolor, fs->shadowalpha);
-
- BLF_blur(fs->shadow);
- BLF_position(x+fs->shadx, y+fs->shady, 0.0f);
- BLF_draw(str);
- BLF_blur(0);
-
- glColor4fv(color);
-}
-
void uiStyleFontDraw(uiFontStyle *fs, rcti *rect, char *str)
{
float height;
@@ -175,14 +165,23 @@ void uiStyleFontDraw(uiFontStyle *fs, rcti *rect, char *str)
/* clip is very strict, so we give it some space */
BLF_clipping(rect->xmin-1, rect->ymin-4, rect->xmax+1, rect->ymax+4);
BLF_enable(BLF_CLIPPING);
-
- if(fs->shadow)
- ui_font_shadow_draw(fs, rect->xmin+xofs, rect->ymin+yofs, str);
-
BLF_position(rect->xmin+xofs, rect->ymin+yofs, 0.0f);
- BLF_draw(str);
+ if (fs->shadow) {
+ BLF_enable(BLF_SHADOW);
+ BLF_shadow(fs->shadow, fs->shadowcolor, fs->shadowcolor, fs->shadowcolor, fs->shadowalpha);
+ BLF_shadow_offset(fs->shadx, fs->shady);
+ }
+
+ if (fs->kerning == 1)
+ BLF_enable(BLF_KERNING_DEFAULT);
+
+ BLF_draw(str);
BLF_disable(BLF_CLIPPING);
+ if (fs->shadow)
+ BLF_disable(BLF_SHADOW);
+ if (fs->kerning == 1)
+ BLF_disable(BLF_KERNING_DEFAULT);
}
/* ************** helpers ************************ */