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:
authorTon Roosendaal <ton@blender.org>2006-11-16 14:43:46 +0300
committerTon Roosendaal <ton@blender.org>2006-11-16 14:43:46 +0300
commitf0da2b05e1dc00898973aab84f6fb8589dbaa769 (patch)
treed8b67c2dd5f82ae0628c01656918f0b030fd18b5 /source/blender/src
parentc1e4099365f5fa4a60ca9566746255569f688119 (diff)
Bugfix #5243
The (#ifdef WITH_ICONV) option to draw International Fonts in file window, didn't set the rasterpos OK for textured fonts. Also: cleaned up code so it doesn't complain soo much without iconv.
Diffstat (limited to 'source/blender/src')
-rw-r--r--source/blender/src/filesel.c58
1 files changed, 31 insertions, 27 deletions
diff --git a/source/blender/src/filesel.c b/source/blender/src/filesel.c
index cba0ceb6818..7d25ca4dc5e 100644
--- a/source/blender/src/filesel.c
+++ b/source/blender/src/filesel.c
@@ -144,7 +144,6 @@ static void library_to_filelist(SpaceFile *sfile);
static void filesel_select_objects(struct SpaceFile *sfile);
static void active_file_object(struct SpaceFile *sfile);
static int groupname_to_code(char *group);
-static void string_to_utf8(char *original, char *utf_8);
extern void countall(void);
@@ -883,11 +882,35 @@ static void linerect(int id, int x, int y)
}
+#ifdef WITH_ICONV
+static void string_to_utf8(char *original, char *utf_8)
+{
+ size_t inbytesleft=strlen(original);
+ size_t outbytesleft=512;
+ size_t rv=0;
+ iconv_t cd;
+
+ cd=iconv_open("UTF-8", "gb2312");
+ if (cd == (iconv_t)(-1)) {
+ printf("iconv_open Error");
+ *utf_8='\0';
+ return ;
+ }
+ rv=iconv(cd, &original, &inbytesleft, &utf_8, &outbytesleft);
+ if (rv == (size_t) -1) {
+ printf("iconv Error\n");
+ return ;
+ }
+ *utf_8 = '\0';
+ iconv_close(cd);
+}
+#endif
+
+
static void print_line(SpaceFile *sfile, struct direntry *files, int x, int y)
{
int boxcol=0;
char *s;
- char utf_8[512];
boxcol= files->flags & (HILITE + ACTIVE);
@@ -932,8 +955,12 @@ static void print_line(SpaceFile *sfile, struct direntry *files, int x, int y)
if(s) {
glRasterPos2i(x, y);
#ifdef WITH_ICONV
- string_to_utf8(files->relname, utf_8);
- BIF_DrawString(G.font, utf_8, (U.transopts & USER_TR_MENUS));
+ {
+ char utf_8[512];
+ string_to_utf8(files->relname, utf_8);
+ BIF_RasterPos((float)x, (float)y); /* texture fonts */
+ BIF_DrawString(G.font, utf_8, (U.transopts & USER_TR_MENUS));
+ }
#else
BMF_DrawString(G.font, files->relname);
#endif
@@ -1099,7 +1126,6 @@ void drawfilespace(ScrArea *sa, void *spacedata)
short mval[2];
char name[20];
char *menu;
- char utf_8[512];
myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
@@ -1171,28 +1197,6 @@ void drawfilespace(ScrArea *sa, void *spacedata)
sa->win_swap= WIN_BACK_OK;
}
-#ifdef WITH_ICONV
-static void string_to_utf8(char *original, char *utf_8) {
- size_t inbytesleft=strlen(original);
- size_t outbytesleft=512;
- size_t rv=0;
- iconv_t cd;
-
- cd=iconv_open("UTF-8", "gb2312");
- if (cd == (iconv_t)(-1)) {
- printf("iconv_open Error");
- *utf_8='\0';
- return ;
- }
- rv=iconv(cd, &original, &inbytesleft, &utf_8, &outbytesleft);
- if (rv == (size_t) -1) {
- printf("iconv Error\n");
- return ;
- }
- *utf_8 = '\0';
- iconv_close(cd);
-}
-#endif
static void do_filescroll(SpaceFile *sfile)
{