cleaned up language support for a release.
authorRob Haarsma <phaseIV@zonnet.nl>
Fri, 9 May 2003 12:48:21 +0000 (12:48 +0000)
committerRob Haarsma <phaseIV@zonnet.nl>
Fri, 9 May 2003 12:48:21 +0000 (12:48 +0000)
source/blender/include/BIF_language.h
source/blender/src/headerbuttons.c
source/blender/src/language.c
source/blender/src/usiblender.c

index 24edc4343e70be47e91a209ce040783936d98484..718795dd8d160cfc44a1fb53b08442af43f6ea42 100644 (file)
 #ifndef BIF_LANGUAGE_H
 #define BIF_LANGUAGE_H
 
-int readMultiLingualFiles(void);       /* usiblender.c */
-void languagesmenu_free(void);         /* usiblender.c */
+int  read_languagefile(void);          /* usiblender.c */
+void free_languagemenu(void);          /* usiblender.c */
 
 void set_interface_font(char *str); /* headerbuttons.c */
-void set_ML_interface_font(void);      /* headerbuttons.c */
+void start_interface_font(void);       /* headerbuttons.c */
 void lang_setlanguage(void);           /* usiblender.c */
 
 char *language_pup(void);
index f370a2cc834be3b3b2eabdaa0bffc1a940477970..5d2092470823d971c5b0b7c37ff09939e546bf9c 100644 (file)
@@ -1516,12 +1516,11 @@ void do_global_buttons(unsigned short event)
 
        case B_DOLANGUIFONT:    /* is button from space.c  *info* */
                if(U.transopts & TR_ALL)
-                       set_ML_interface_font();
+                       start_interface_font();
                else
                        G.ui_international = FALSE;
                allqueue(REDRAWALL, 0);
                break;
-
 #endif
                
        case B_FULL:
index 9bd92cc67746a0532e781a61d26e904f2553e1c4..89c25cbb2073666ba1fdc2a523822fb0197d12ad 100644 (file)
@@ -137,9 +137,7 @@ void set_interface_font(char *str) {
        char di[FILE_MAXDIR];
 
        if(FTF_SetFont(str, U.fontsize)) {
-
                lang_setlanguage();
-
                BLI_split_dirfile(str, di, U.fontname);
 
                G.ui_international = TRUE;
@@ -151,12 +149,12 @@ void set_interface_font(char *str) {
 }
 
 
-void set_ML_interface_font(void) {
+void start_interface_font(void) {
        char tstr[FILE_MAXDIR+FILE_MAXFILE];
        int result = 0;
 
-       /* dirty hack to find out if we have saved language/font settings,
-          if not, try default font --phase */
+       /* hack to find out if we have saved language/font settings.
+          if not, set defaults and try Vera font (or else .bfont.tff) --phase */
        
        if(U.fontsize != 0) {
                BLI_make_file_string("/", tstr, U.fontdir, U.fontname);
@@ -164,21 +162,25 @@ void set_ML_interface_font(void) {
                result = FTF_SetFont(tstr, U.fontsize);
        } else {
                U.language= 0;
-               U.fontsize= 12;
+               U.fontsize= 11;
                U.encoding= 0;
-               sprintf(U.fontname, ".bfont.ttf\0");
+               sprintf(U.fontname, "Vera.ttf\0");
 
                result = FTF_SetFont(U.fontname, U.fontsize);
        }
 
-       if(!result) result = FTF_SetFont(".bfont.ttf", U.fontsize);
-//     printf(" res = %d\n ", result);
+       if(!result) {
+               U.fontsize= 12;
+               sprintf(U.fontname, ".bfont.ttf\0");
+               result = FTF_SetFont(U.fontname, U.fontsize);
+       }
+
        if(result) {
                lang_setlanguage();
 
                G.ui_international = TRUE;
        } else {
-               printf("no way ftf\n");
+               printf("no font found for international support\n");
                G.ui_international = FALSE;
        }
 
@@ -243,7 +245,7 @@ void puplang_insert_entry(char *line)
 }
 
 
-int readMultiLingualFiles(void) {
+int read_languagefile(void) {
        char name[FILE_MAXDIR+FILE_MAXFILE];
        LinkNode *l, *lines;
 
@@ -276,7 +278,7 @@ int readMultiLingualFiles(void) {
 }
 
 
-void languagesmenu_free(void)
+void free_languagemenu(void)
 {
        LANGMenuEntry *lme= langmenu;
 
index c366af6992dd3364d578aaa3d1b0ae434236b55f..de07e09b7075bab673b233a31eeec2ac21ab7de2 100644 (file)
@@ -166,7 +166,7 @@ int BIF_read_homefile(void)
 {
        char tstr[FILE_MAXDIR+FILE_MAXFILE], scestr[FILE_MAXDIR];
        char *home= BLI_gethome();
-       int success, result;
+       int success;
 
        BLI_make_file_string(G.sce, tstr, home, ".B.blend");
        strcpy(scestr, G.sce);  /* temporal store */
@@ -183,20 +183,6 @@ int BIF_read_homefile(void)
                /*  disable autoplay in .B.blend... */
                G.fileflags &= ~G_FILE_AUTOPLAY;
 
-#ifdef _WIN32  // FULLSCREEN
-               /* choose window startmode */
-               switch (G.windowstate){
-                       case G_WINDOWSTATE_USERDEF: /* use the usersetting */
-                               break;
-                       case G_WINDOWSTATE_FULLSCREEN: /* force fullscreen */
-                               U.uiflag |= FLIPFULLSCREEN;
-                               break;
-                       case G_WINDOWSTATE_BORDER: /* force with borders */
-                               U.uiflag &= ~FLIPFULLSCREEN;
-               }
-               mainwindow_toggle_fullscreen ((U.uiflag & FLIPFULLSCREEN));
-#endif
-
                if (BLI_streq(U.tempdir, "/")) {
                        char *tmp= getenv("TEMP");
                                
@@ -218,24 +204,6 @@ int BIF_read_homefile(void)
                        U.vrmlflag= USERDEF_VRML_LAYERS;
                }
 
-#ifdef INTERNATIONAL
-                       /* userdef multilanguage options */
-               /*  uncomment with versionchange to 2.27 --phase */
-/*
-               if (G.main->versionfile <= 226) {
-                       U.language= 0;
-                       U.fontsize= 12;
-                       U.encoding= 0;
-                       sprintf(U.fontname, ".bfont.ttf");
-               }
-*/
-               if(U.transopts & TR_ALL)
-                       set_ML_interface_font();
-               else
-                       G.ui_international = FALSE;
-
-#endif // INTERNATIONAL
-
                space_set_commmandline_options();
 
                reset_autosave();
@@ -488,20 +456,36 @@ void BIF_init(void)
        init_draw_rects();      /* drawobject.c */
        init_gl_stuff();        /* drawview.c */
 
-#ifdef INTERNATIONAL
-       readMultiLingualFiles();
-#endif
-
        BIF_read_homefile(); 
-
        readBlog();
        strcpy(G.lib, G.sce);
+
+#ifdef INTERNATIONAL
+       read_languagefile();
+
+       if(U.transopts & TR_ALL)
+               start_interface_font();
+       else
+               G.ui_international = FALSE;
+#endif // INTERNATIONAL
+
+#ifdef _WIN32  // FULLSCREEN
+       /* choose window startmode */
+       switch (G.windowstate){
+               case G_WINDOWSTATE_USERDEF: /* use the usersetting */
+                       break;
+               case G_WINDOWSTATE_FULLSCREEN: /* force fullscreen */
+                       U.uiflag |= FLIPFULLSCREEN;
+                       break;
+               case G_WINDOWSTATE_BORDER: /* force with borders */
+                       U.uiflag &= ~FLIPFULLSCREEN;
+       }
+       mainwindow_toggle_fullscreen ((U.uiflag & FLIPFULLSCREEN));
+#endif
 }
 
 /***/
 
-extern unsigned short fullscreen;
-extern unsigned short borderless;
 extern ListBase editNurb;
 extern ListBase editelems;
 
@@ -539,7 +523,7 @@ void exit_usiblender(void)
 
        fsmenu_free();
 #ifdef INTERNATIONAL
-       languagesmenu_free();
+       free_languagemenu();
 #endif 
        
        RE_free_render_data();