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_font.c')
-rw-r--r--source/blender/blenfont/intern/blf_font.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index a80e97327f3..d5c6ae5b359 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -110,6 +110,9 @@ void blf_font_draw(FontBLF *font, char *str)
int pen_x, pen_y;
int i, has_kerning;
+ if (!font->glyph_cache)
+ return;
+
face= (FT_Face)font->engine;
i= 0;
pen_x= 0;
@@ -161,6 +164,9 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box)
int pen_x, pen_y;
int i, has_kerning;
+ if (!font->glyph_cache)
+ return;
+
face= (FT_Face)font->engine;
box->xmin= 32000.0f;
box->xmax= -32000.0f;
@@ -228,6 +234,9 @@ float blf_font_width(FontBLF *font, char *str)
{
rctf box;
+ if (!font->glyph_cache)
+ return(0.0f);
+
blf_font_boundbox(font, str, &box);
return((box.xmax - box.xmin) * font->aspect);
}
@@ -236,6 +245,9 @@ float blf_font_height(FontBLF *font, char *str)
{
rctf box;
+ if (!font->glyph_cache)
+ return(0.0f);
+
blf_font_boundbox(font, str, &box);
return((box.ymax - box.ymin) * font->aspect);
}