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:
authorMika Saari <mika.saari@wipsl.com>2006-03-09 19:57:19 +0300
committerMika Saari <mika.saari@wipsl.com>2006-03-09 19:57:19 +0300
commita95362f147d5685873a96e3f64173b8aa5809528 (patch)
treed51ad9bd815f9d6cf519fdb11f26f67238e1bbe7 /source/blender/src/interface_draw.c
parentd918fcd0556ae2d0d1f9c9fbe786f3624ac14db9 (diff)
Fixed bug "Bug Tracker item #3988", where <builtin> TTF (datatoc_bfont_ttf)
wasn't handled as UTF-8 font but like normal <builtin> font. This caused Blender to crash.
Diffstat (limited to 'source/blender/src/interface_draw.c')
-rw-r--r--source/blender/src/interface_draw.c35
1 files changed, 29 insertions, 6 deletions
diff --git a/source/blender/src/interface_draw.c b/source/blender/src/interface_draw.c
index d35e87753ee..59436aa9d5c 100644
--- a/source/blender/src/interface_draw.c
+++ b/source/blender/src/interface_draw.c
@@ -1752,9 +1752,18 @@ static void ui_draw_but_CHARTAB(uiBut *but)
int result = 0;
int charmax = G.charmax;
- /* <builtin> font in use */
+ /* <builtin> font in use. There are TTF <builtin> and non-TTF <builtin> fonts */
if(!strcmp(G.selfont->name, "<builtin>"))
- charmax = 0xff;
+ {
+ if(G.ui_international == TRUE)
+ {
+ charmax = 0xff;
+ }
+ else
+ {
+ charmax = 0xff;
+ }
+ }
/* Category list exited without selecting the area */
if(G.charmax == 0)
@@ -1775,7 +1784,7 @@ static void ui_draw_but_CHARTAB(uiBut *but)
cs = G.charstart;
- /* Set the font */
+ /* Set the font, in case it is not <builtin> font */
if(G.selfont && strcmp(G.selfont->name, "<builtin>"))
{
char tmpStr[256];
@@ -1795,6 +1804,13 @@ static void ui_draw_but_CHARTAB(uiBut *but)
err = FTF_SetFont((unsigned char *)tmpStr, 0, 14.0);
}
}
+ else
+ {
+ if(G.ui_international == TRUE)
+ {
+ FTF_SetFont((unsigned char *) datatoc_bfont_ttf, datatoc_bfont_ttf_size, 14.0);
+ }
+ }
/* Start drawing the button itself */
glShadeModel(GL_SMOOTH);
@@ -1833,11 +1849,18 @@ static void ui_draw_but_CHARTAB(uiBut *but)
}
else
{
- ustr[0] = cs;
- ustr[1] = 0;
+ if(G.ui_international == TRUE)
+ {
+ wcs2utf8s((char *)ustr, (wchar_t *)wstr);
+ }
+ else
+ {
+ ustr[0] = cs;
+ ustr[1] = 0;
+ }
}
- if(G.selfont && strcmp(G.selfont->name, "<builtin>"))
+ if((G.selfont && strcmp(G.selfont->name, "<builtin>")) || (G.selfont && !strcmp(G.selfont->name, "<builtin>") && G.ui_international == TRUE))
{
float wid;
float llx, lly, llz, urx, ury, urz;