Page Menu
Home
Search
Configure Global Search
Log In
Files
F1908
blender-setfont-crash.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
Emil Brink (emil)
Nov 13 2013, 1:00 PM
Size
1 KB
Subscribers
None
blender-setfont-crash.patch
View Options
diff -pru bf-blender/blender/source/blender/ftfont/intern/FTF_TTFont.cpp bf-blender-emil/blender/source/blender/ftfont/intern/FTF_TTFont.cpp
--- bf-blender/blender/source/blender/ftfont/intern/FTF_TTFont.cpp 2005-03-09 20:45:54.000000000 +0100
+++ bf-blender-emil/blender/source/blender/ftfont/intern/FTF_TTFont.cpp 2006-03-30 20:08:04.000000000 +0200
@@ -161,17 +161,20 @@ void FTF_TTFont::SetFontSize(char size)
else font=fontm;
}
-int FTF_TTFont::SetFont(const unsigned char* str, int datasize, int fontsize)
+void FTF_TTFont::DeleteSizes()
{
- int err = 0;
- bool success = 0;
-
if (fonts) delete fonts;
if (fontm) delete fontm;
if (fontl) delete fontl;
fonts= NULL;
fontm= NULL;
fontl= NULL;
+}
+
+int FTF_TTFont::SetFont(const unsigned char* str, int datasize, int fontsize)
+{
+ int err = 0;
+ bool success = 0;
if(mode == FTF_PIXMAPFONT) {
@@ -184,7 +187,7 @@ int FTF_TTFont::SetFont(const unsigned c
printf("Failed to open font %s\n", str);
return 0;
} else {
-
+ DeleteSizes();
fontm= font;
if(datasize) fonts = new FTGLPixmapFont(str, datasize);
@@ -216,7 +219,7 @@ int FTF_TTFont::SetFont(const unsigned c
printf("Failed to open font %s\n", str);
return 0;
} else {
-
+ DeleteSizes();
fontm= font;
if(datasize) fonts = new FTGLTextureFont(str, datasize);
diff -pru bf-blender/blender/source/blender/ftfont/intern/FTF_TTFont.h bf-blender-emil/blender/source/blender/ftfont/intern/FTF_TTFont.h
--- bf-blender/blender/source/blender/ftfont/intern/FTF_TTFont.h 2005-01-21 15:48:02.000000000 +0100
+++ bf-blender-emil/blender/source/blender/ftfont/intern/FTF_TTFont.h 2006-03-30 20:07:13.000000000 +0200
@@ -111,6 +111,8 @@ protected:
float pen_x, pen_y; //rasterpos
float fsize;
+ void DeleteSizes();
+
/** FTGL's */
FTFont* font; /* active */
File Metadata
Details
Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
5e/90/5204056dd6653e1d501deb7c30fc
Event Timeline
Log In to Comment