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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user