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/blenfont/intern/blf_glyph.c')
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index 33a435cc5be..a637774d7bf 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -496,8 +496,20 @@ int blf_glyph_texture_render(FontBLF *font, GlyphBLF *g, float x, float y)
GLint cur_tex;
float dx, dx1;
float y1, y2;
+ float xo, yo;
+ float color[4];
gt= g->tex_data;
+ xo= 0.0f;
+ yo= 0.0f;
+
+ if (font->flags & BLF_SHADOW) {
+ xo= x;
+ yo= y;
+ x += font->shadow_x;
+ y += font->shadow_y;
+ }
+
dx= floor(x + gt->pos_x);
dx1= dx + gt->width;
y1= y + gt->pos_y;
@@ -518,6 +530,27 @@ int blf_glyph_texture_render(FontBLF *font, GlyphBLF *g, float x, float y)
if (cur_tex != gt->tex)
glBindTexture(GL_TEXTURE_2D, gt->tex);
+ if (font->flags & BLF_SHADOW) {
+ glGetFloatv(GL_CURRENT_COLOR, color);
+ glColor4fv(font->shadow_col);
+
+ if (font->shadow == 3)
+ blf_texture3_draw(gt->uv, dx, y1, dx1, y2);
+ else if (font->shadow == 5)
+ blf_texture5_draw(gt->uv, dx, y1, dx1, y2);
+ else
+ blf_texture_draw(gt->uv, dx, y1, dx1, y2);
+
+ glColor4fv(color);
+ x= xo;
+ y= yo;
+
+ dx= floor(x + gt->pos_x);
+ dx1= dx + gt->width;
+ y1= y + gt->pos_y;
+ y2= y + gt->pos_y - gt->height;
+ }
+
if (font->blur==3)
blf_texture3_draw(gt->uv, dx, y1, dx1, y2);
else if (font->blur==5)