Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2002:
[Freeciv-Dev] main map have gtk1.2 font problem (i18n) (PR#1606)
Home

[Freeciv-Dev] main map have gtk1.2 font problem (i18n) (PR#1606)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] main map have gtk1.2 font problem (i18n) (PR#1606)
From: SAWADA Katsuya <ama@xxxxxxxxxxx>
Date: Sat, 22 Jun 2002 07:32:30 -0700 (PDT)

OS: Debian GNU/Linux woody + sid (i386)
libgtk1.2 1.2.10
LANG=ja_JP.eucJP

After I send mail about connection dialog, I found another font problem.

I can't read freeciv_motto, "'Cause civilization should be free!" on
main graphic in Japanese. First, I checked graphics.c/load_intro_gfx,
and found main_font has problem. main_font is currently font, but we
need fontset. Because Japanese use not only ascii character set, but
also use jisx0208.


I amn't using gtk-2.0 nor xaw, so I don't know whether they have or
not.


Now I can read Japanese font correctly with new ja.po.
#: client/tilespec.c:269
msgid "?fontset:10x20"
msgstr 
"-*-fixed-medium-r-*-*-16-*-*-*-*-*-iso8859-*,-*-fixed-medium-r-*-*-16-*-*-*-*-*-JISX0208.1983-*"

#: client/tilespec.c:273
msgid "?fontset:8x16"
msgstr 
"-*-fixed-medium-r-*-*-14-*-*-*-*-*-iso8859-*,-*-fixed-medium-r-*-*-14-*-*-*-*-*-JISX0208.1983-*"

Following is patch. 

regard.

--
SAWADA, Katsuya


--- client/gui-gtk/gui_main.c.orig      Thu Jun 20 10:27:23 2002
+++ client/gui-gtk/gui_main.c   Sat Jun 22 22:37:21 2002
@@ -776,13 +776,15 @@
 
   civ_gc = gdk_gc_new(root_window);
 
-  if (!(main_font=gdk_font_load(city_names_font))) {
-      freelog(LOG_FATAL, "failed loading font: %s", city_names_font);
+  if (!(main_font=gdk_fontset_load(city_names_fontset))) {
+      freelog(LOG_FATAL, "failed loading fontset: %s", city_names_fontset);
       exit(EXIT_FAILURE);
   }
 
-  if (!(city_productions_font = gdk_font_load(city_productions_font_name))) {
-    freelog(LOG_FATAL, "failed loading font: %s", city_productions_font_name);
+  if (!(city_productions_font
+        = gdk_fontset_load(city_productions_fontset_name))) {
+    freelog(LOG_FATAL,
+            "failed loading fontset: %s", city_productions_fontset_name);
     exit(EXIT_FAILURE);
   }
 
--- client/gui-xaw/gui_main.c.orig      Tue Jun  4 00:31:46 2002
+++ client/gui-xaw/gui_main.c   Sat Jun 22 22:35:49 2002
@@ -339,9 +339,9 @@
     values.graphics_exposures = False;
     civ_gc = XCreateGC(display, root_window, GCGraphicsExposures, &values);
 
-    main_font_struct=XLoadQueryFont(display, city_names_font);
+    main_font_struct=XLoadQueryFont(display, city_names_fontset);
     if(main_font_struct==0) {
-      freelog(LOG_FATAL, _("Failed loading font: %s"), city_names_font);
+      freelog(LOG_FATAL, _("Failed loading fontset: %s"), city_names_fontset);
       exit(EXIT_FAILURE);
     }
     values.foreground = colors_standard[COLOR_STD_WHITE];
@@ -351,9 +351,10 @@
                       GCForeground|GCBackground|GCFont|GCGraphicsExposures, 
                       &values);
 
-    prod_font_struct=XLoadQueryFont(display, city_productions_font_name);
+    prod_font_struct=XLoadQueryFont(display, city_productions_fontset_name);
     if(prod_font_struct==0) {
-      freelog(LOG_FATAL, _("Failed loading font: %s"), 
city_productions_font_name);
+      freelog(LOG_FATAL,
+              _("Failed loading fontset: %s"), city_productions_fontset_name);
       exit(EXIT_FAILURE);
     }
     values.foreground = colors_standard[COLOR_STD_WHITE];
--- client/gui-gtk-2.0/gui_main.c.orig  Wed Jun 19 11:12:45 2002
+++ client/gui-gtk-2.0/gui_main.c       Sat Jun 22 22:28:09 2002
@@ -815,12 +815,12 @@
   civ_gc = gdk_gc_new(root_window);
 
   if (!(main_font = pango_font_description_from_string("Sans Bold 13"))) {
-    freelog(LOG_FATAL, "failed loading font: %s", city_names_font);
+    freelog(LOG_FATAL, "failed loading font: Sans Bold 13");
     exit(EXIT_FAILURE);
   }
 
   if (!(city_productions_font=pango_font_description_from_string("Serif 11"))) 
{
-    freelog(LOG_FATAL, "failed loading font: %s", city_productions_font_name);
+    freelog(LOG_FATAL, "failed loading font: Serif 11");
     exit(EXIT_FAILURE);
   }
 
--- client/tilespec.h.orig      Wed Apr 10 02:35:09 2002
+++ client/tilespec.h   Sat Jun 22 22:26:33 2002
@@ -228,11 +228,11 @@
 
 /* name of font to use to draw city names on main map */
 
-extern char *city_names_font;
+extern char *city_names_fontset;
 
 /* name of font to use to draw city productions on main map */
 
-extern char *city_productions_font_name;
+extern char *city_productions_fontset_name;
 
 extern bool flags_are_transparent;
 
--- client/tilespec.c.orig      Thu Jun 20 10:26:44 2002
+++ client/tilespec.c   Sat Jun 22 22:34:20 2002
@@ -66,8 +66,8 @@
 
 bool is_isometric;
 
-char *city_names_font;
-char *city_productions_font_name;
+char *city_names_fontset;
+char *city_productions_fontset_name;
 
 bool flags_are_transparent = TRUE;
 
@@ -266,13 +266,13 @@
          UNIT_TILE_WIDTH, UNIT_TILE_HEIGHT,
          SMALL_TILE_WIDTH, SMALL_TILE_HEIGHT);
 
-  c = secfile_lookup_str_default(file, "10x20", "tilespec.city_names_font");
-  city_names_font = mystrdup(c);
-
-  c =
-      secfile_lookup_str_default(file, "8x16",
-                                "tilespec.city_productions_font");
-  city_productions_font_name = mystrdup(c);
+  c = secfile_lookup_str_default(file, Q_("?fontset:10x20"),
+                                 "tilespec.city_names_fontset");
+  city_names_fontset = mystrdup(c);
+
+  c = secfile_lookup_str_default(file, Q_("?fontset:8x16"),
+                                "tilespec.city_productions_fontset");
+  city_productions_fontset_name = mystrdup(c);
 
   flags_are_transparent =
     secfile_lookup_bool(file, "tilespec.flags_are_transparent"); 



[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] main map have gtk1.2 font problem (i18n) (PR#1606), SAWADA Katsuya <=