Subject: fvwm is absolutely unusable with UTF-8 locales

From: Alexander Kotelnikov <[email-masked]>
Date: Sun, 20 Jan 2002 03:54:17 +0300

Hello.

When fvwm is built with --enable-multibyte.

I get messages starting with

[FVWM][GetFontSetOrFixed]: WARNING -- can't get fontset fixed, trying 'fixed'

and zillions of

[FVWM][FvwmErrorHandler]: <<ERROR>> *** internal error ***
[FVWM][FvwmErrorHandler]: <<ERROR>> Request 55, Error 7, EventType: 0

[FVWM][FvwmErrorHandler]: <<ERROR>> *** internal error ***
[FVWM][FvwmErrorHandler]: <<ERROR>> Request 66, Error 13, EventType: 4

[FVWM][FvwmErrorHandler]: <<ERROR>> *** internal error ***
[FVWM][FvwmErrorHandler]: <<ERROR>> Request 56, Error 13, EventType: 4

[FVWM][FvwmErrorHandler]: <<ERROR>> *** internal error ***
[FVWM][FvwmErrorHandler]: <<ERROR>> Request 75, Error 13, EventType: 4

Menus are displayed as rectangles of solid background without lables
on them, even normal windows look and behave ok.
-- 
Alexander Kotelnikov
Saint-Petersburg, Russia
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Alexander Kotelnikov <[email-masked]>
Date: Sun, 20 Jan 2002 06:21:46 +0300

I forgot to say that this occurs with all fvwm 2.4.4. 2.4.0 also.

---

From: Alexander Kotelnikov <[email-masked]>
Date: Sun, 20 Jan 2002 06:51:32 +0300

And one more addition, I found rather strange logs of fvwm:

[FVWM][GetFontSetOrFixed]: WARNING -- can't get fontset -fixed-*-iso10646-1, trying 'fixed'

note, not -*-fixed, but -fixed

---

From: Alexander Kotelnikov <[email-masked]>
Date: Sun, 20 Jan 2002 17:40:29 +0300

>>>>> On Sun, 20 Jan 2002 06:51:32 +0300
>>>>> "Alexander" == Alexander Kotelnikov <[email-masked]> wrote:
Alexander> 
Alexander> And one more addition, I found rather strange logs of fvwm:
Alexander> [FVWM][GetFontSetOrFixed]: WARNING -- can't get fontset -fixed-*-iso10646-1, trying 'fixed'
Alexander> 
Alexander> note, not -*-fixed, but -fixed
                     ~~~~~~~~~~~~~~~~~~~~
this, but not the absence of labels in fvwm menus, was a typo in my
fvwm2rc, sorry.

---

From: Olivier Chapuis <[email-masked]>
Date: Sun, 20 Jan 2002 18:42:49 +0100

> [FVWM][GetFontSetOrFixed]: WARNING -- can't get fontset fixed, trying 'fixed'

Yes, fvwm cannot display directly UTF-8 fonts. I hope it will be able to
do that in the future.

If you have UTF-8 menus you may want to use the iconv utility
to convert these menus to a "classical" charset.

Regards, Olivier

---

From: Alexander Kotelnikov <[email-masked]>
Date: Mon, 21 Jan 2002 01:05:31 +0300

>>>>> On Sun, 20 Jan 2002 18:42:49 +0100
>>>>> "Olivier" == Olivier Chapuis <[email-masked]> wrote:
Olivier> 
>> [FVWM][GetFontSetOrFixed]: WARNING -- can't get fontset fixed, trying 'fixed'
Olivier> 
Olivier> Yes, fvwm cannot display directly UTF-8 fonts. I hope it will be able to
Olivier> do that in the future.

Strange... At first I am confused, why fvwm fails on menus and does
not on windows titles. Also it fails to draw text on modules.

I would like to obtain documentation on drawing text in X. I've looked
through Oreiily books, but Xmb, Xwc and Xutf8 functions seem to be not
covered by them.

Olivier> If you have UTF-8 menus you may want to use the iconv utility
Olivier> to convert these menus to a "classical" charset.

Note, if user uses UTF-8 locale, and there are more an more such
users, he wont be able to start fvwm successfully.

---

From: Alexander Kotelnikov <[email-masked]>
Date: Tue, 22 Jan 2002 03:31:07 +0300

Hello.

I've found that the only WM that handle both 8bit and UTF-8 locales
quiet well is blackbox, which (unpacked) code is only 500K. Even it is
written in a rather strange maner: it seems that LC_CTYPE can be never
set in blackbox.

It seems that it dos not matter for X is a string of utf-8 or koi8-r
or iso8859-1 characters, the internal representation is multibyte. But
in practice we see that most ov wm fails to wor with unicode...

---

From: Alexander Kotelnikov <[email-masked]>
Date: Thu, 24 Jan 2002 04:22:24 +0300

Hello.

It seems that the trouble was in side effects of setting GC font. If
someone can explain me, why exactly problem appears, I will
appreciate.

Second patch is for modules/, first does not affect them. Please not
that it is for released fvwm 2.4.4 and it is much less tested than
first one, may be someone should revise it accurately

Also all STRICTLY_FIXED parts of fvwm code would be removed from the
code (since nobody guarantee us that 'fixed' has character set that
matches our locale).

Third patch is a small modification to modules also. (substitution
of XCreateFonSet of GetFonSetOrFixed)

Fourth patch is GetFontSetOrFixed modification, which I emphatically
ask you to accept.

Index: fvwm/builtins.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/builtins.c,v
retrieving revision 1.331
diff -u -r1.331 builtins.c
--- fvwm/builtins.c	2002/01/16 21:21:29	1.331
+++ fvwm/builtins.c	2002/01/23 21:12:47
@@ -1205,7 +1205,11 @@
   int cset = Scr.DefaultColorset;
 
   /* make GC's */
+# ifdef I18N_MB
   gcm = GCFunction|GCFont|GCLineWidth|GCForeground|GCBackground;
+# else
+  gcm = GCFunction|GCLineWidth|GCForeground|GCBackground;
+# endif
   gcv.function = GXcopy;
   gcv.font = Scr.DefaultFont.font->fid;
   gcv.line_width = 0;
Index: fvwm/menus.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/menus.c,v
retrieving revision 1.286
diff -u -r1.286 menus.c
--- fvwm/menus.c	2002/01/23 15:20:00	1.286
+++ fvwm/menus.c	2002/01/23 21:13:20
@@ -6177,7 +6177,11 @@
   }
 
   /* make GC's */
+# ifdef I18N_MB
+  gcm = GCFunction|GCLineWidth|GCForeground|GCBackground;
+# else
   gcm = GCFunction|GCFont|GCLineWidth|GCForeground|GCBackground;
+# endif
   gcv.font = ST_PSTDFONT(ms)->font->fid;
   gcv.function = GXcopy;
   gcv.line_width = 0;
Index: fvwm/misc.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/misc.c,v
retrieving revision 1.118
diff -u -r1.118 misc.c
--- fvwm/misc.c	2002/01/01 19:09:56	1.118
+++ fvwm/misc.c	2002/01/23 21:13:21
@@ -369,10 +369,13 @@
 /* some fancy font handling stuff */
 void NewFontAndColor(Font newfont, Pixel color, Pixel backcolor)
 {
-  Globalgcv.font = newfont;
   Globalgcv.foreground = color;
   Globalgcv.background = backcolor;
-  Globalgcm = GCFont | GCForeground | GCBackground;
+# ifdef I18N_MB
+  Globalgcm = GCForeground | GCBackground;
+# else
+  Globalgcm = GCFont |GCForeground | GCBackground;
+# endif
   XChangeGC(dpy,Scr.TitleGC,Globalgcm,&Globalgcv);
 }
 
Index: libs/GetFont.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/libs/GetFont.c,v
retrieving revision 1.8
diff -u -r1.8 GetFont.c
--- libs/GetFont.c	2001/12/30 21:21:23	1.8
+++ libs/GetFont.c	2002/01/23 21:13:22
@@ -51,48 +51,49 @@
 }
 
 #ifdef I18N_MB
-/*
-** loads fontset or "fixed" on failure
-** Note, STRICTLY_FIXED does not seem to be defined on a standard compile.
-** The fallback is to a font that does not use a font alias.
-** I'm not sure why this is done for I18N_MB only. dje Dec 2001.
-*/
-
-#ifdef STRICTLY_FIXED
-#define FALLBACK_FONT "fixed"
-#else
-#define FALLBACK_FONT "-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*"
-#endif
-
 XFontSet GetFontSetOrFixed(Display *disp, char *fontname)
 {
   XFontSet fontset = NULL;
   char **ml;
   int mc;
+  int i;
   char *ds;
 
-  if (fontname)
+  if (fontname){
     fontset = XCreateFontSet(disp,fontname,&ml,&mc,&ds);
-  if (!fontset && fontname)
-  {
-    fprintf(stderr,
+  }
+  else{
+     fprintf(stderr,
             "[FVWM][GetFontSetOrFixed]: "
-	    "WARNING -- can't get fontset %s, trying '%s'\n",
-            fontname,FALLBACK_FONT);
+	    "WARNING -- fontname is a NULL-string\n");
   }
   if (!fontset)
   {
+    fprintf(stderr,
+            "[FVWM][GetFontSetOrFixed]: "
+	    "WARNING -- can't get fontset '%s', trying '-*-fixed-*'\n",
+            fontname);
     /* fixed should always be avail, so try that */
-    /* Yes, you say it's not a *FIXED* font, but it helps you. */
     if ((fontset =
 	 XCreateFontSet(disp,
-			FALLBACK_FONT,
+			"-*-fixed-*",
 			&ml, &mc, &ds)) == NULL)
     {
       fprintf(stderr,"[FVWM][GetFontSetOrFixed]: "
-	      "ERROR -- can't get fontset '%s'\n",FALLBACK_FONT);
+	      "ERROR -- can't get fontset 'fixed'\n");
+    }
+  }
+  if (fontset){
+    if (mc > 0) {
+      (void)fprintf(stderr, 
+		    "[FVWM][GetFontSetOrFixed]:"
+		    "The following charsets are missing:\n");
+      for(i=0; i < mc; i++)
+	fprintf(stderr, "\t%s\n", ml[i]);
+      XFreeStringList(ml);
     }
   }
+
   return fontset;
 }
 #endif
@@ -115,6 +116,7 @@
     ret_font->font = fs_list[0];
     fset_extents = XExtentsOfFontSet(newfontset);
     ret_font->height = fset_extents->max_logical_extent.height;
+
   }
   else
   {
diff -ur modules.orig/FvwmButtons/FvwmButtons.c modules/FvwmButtons/FvwmButtons.c
--- modules.orig/FvwmButtons/FvwmButtons.c	Sun Dec 16 21:13:11 2001
+++ modules/FvwmButtons/FvwmButtons.c	Thu Jan 24 01:45:36 2002
@@ -2054,11 +2054,13 @@
   gcm = GCForeground|GCBackground;
   gcv.foreground = fore_pix;
   gcv.background = back_pix;
+# ifndef I18N_MB
   if(ub && ub->c && ub->c->font && ub->font)
   {
     gcv.font = ub->c->font->fid;
     gcm |= GCFont;
   }
+# endif
   NormalGC = fvwmlib_XCreateGC(Dpy, MyWindow, gcm, &gcv);
   gcv.foreground = shadow_pix;
   gcv.background = fore_pix;
diff -ur modules.orig/FvwmButtons/draw.c modules/FvwmButtons/draw.c
--- modules.orig/FvwmButtons/draw.c	Thu Dec 13 10:55:27 2001
+++ modules/FvwmButtons/draw.c	Thu Jan 24 01:45:12 2002
@@ -371,7 +371,11 @@
     {
       gcv.foreground = fc;
       gcv.font = font->fid;
+# ifdef I18N_MB
+      XChangeGC(Dpy,NormalGC,GCForeground,&gcv);
+# else
       XChangeGC(Dpy,NormalGC,GCForeground | GCFont,&gcv);
+# endif
       DrawTitle(b,MyWindow,NormalGC);
     }
   } /* title */
diff -ur modules.orig/FvwmForm/FvwmForm.c modules/FvwmForm/FvwmForm.c
--- modules.orig/FvwmForm/FvwmForm.c	Sun Oct 14 22:22:56 2001
+++ modules/FvwmForm/FvwmForm.c	Thu Jan 24 01:49:17 2002
@@ -633,7 +633,11 @@
 static void CheckAlloc(Item *this_item,DrawTable *dt)
 {
   static XGCValues xgcv;
+# ifdef I18N_MB
+  static int xgcv_mask = GCBackground | GCForeground;
+# else
   static int xgcv_mask = GCBackground | GCForeground | GCFont;
+# endif
 
   if (dt->dt_used == 2) {               /* fonts colors shadows */
     return;
@@ -665,7 +669,11 @@
   xgcv.foreground = dt->dt_colors[c_item_fg];
   xgcv.background = dt->dt_colors[c_item_bg];
   xgcv.font = dt->dt_font;
+# ifdef I18N_MB
+  dt->dt_item_GC = fvwmlib_XCreateGC(dpy, CF.frame, GCForeground, &xgcv);
+# else
   dt->dt_item_GC = fvwmlib_XCreateGC(dpy, CF.frame, GCForeground | GCFont, &xgcv);
+# endif
   if (Pdepth < 2) {
     dt->dt_colors[c_itemlo] = BlackPixel(dpy, screen);
     dt->dt_colors[c_itemhi] = WhitePixel(dpy, screen);
diff -ur modules.orig/FvwmIconBox/FvwmIconBox.c modules/FvwmIconBox/FvwmIconBox.c
--- modules.orig/FvwmIconBox/FvwmIconBox.c	Sun Sep 16 19:51:17 2001
+++ modules/FvwmIconBox/FvwmIconBox.c	Thu Jan 24 01:49:35 2002
@@ -1184,7 +1184,11 @@
   gcv.foreground = icon_shadow_pix;
   IconShadowGC = fvwmlib_XCreateGC(dpy, main_win, gcm, &gcv);
 
+# ifdef I18N_MB
+  gcm = GCForeground|GCBackground;
+# else
   gcm = GCForeground|GCBackground|GCFont;
+# endif
   gcv.foreground = icon_fore_pix;
   gcv.font =  font->fid;
   NormalGC = fvwmlib_XCreateGC(dpy, main_win, gcm, &gcv);
diff -ur modules.orig/FvwmIdent/FvwmIdent.c modules/FvwmIdent/FvwmIdent.c
--- modules.orig/FvwmIdent/FvwmIdent.c	Sun Sep 16 19:51:18 2001
+++ modules/FvwmIdent/FvwmIdent.c	Thu Jan 24 01:47:48 2002
@@ -562,7 +562,11 @@
   XSelectInput(dpy, main_win, mw_events);
   change_window_name(&MyName[1]);
 
+# ifdef I18N_MB
+  gcm = GCForeground;
+# else
   gcm = GCForeground|GCFont;
+# endif
   gcv.foreground = fore_pix;
   gcv.font = font->fid;
   gc = fvwmlib_XCreateGC(dpy, main_win, gcm, &gcv);
diff -ur modules.orig/FvwmPager/x_pager.c modules/FvwmPager/x_pager.c
--- modules.orig/FvwmPager/x_pager.c	Sun Dec  9 17:00:26 2001
+++ modules/FvwmPager/x_pager.c	Thu Jan 24 01:47:28 2002
@@ -675,7 +675,11 @@
       : Colorset[Desks[i].colorset].fg;
     gcv.font = font->fid;
     Desks[i].NormalGC =
+# ifdef I18N_MB
+      fvwmlib_XCreateGC(dpy, Scr.Pager_w, GCForeground, &gcv);
+# else
       fvwmlib_XCreateGC(dpy, Scr.Pager_w, GCForeground | GCFont, &gcv);
+# endif
 
     /* create the active desk hilite GC */
     if(Pdepth < 2)
@@ -693,7 +697,11 @@
       gcv.foreground = (Desks[i].highcolorset < 0) ? fore_pix
 	: Colorset[Desks[i].highcolorset].fg;
     Desks[i].rvGC =
+# ifdef I18N_MB
+      fvwmlib_XCreateGC(dpy, Scr.Pager_w, GCForeground, &gcv);
+# else
       fvwmlib_XCreateGC(dpy, Scr.Pager_w, GCForeground | GCFont, &gcv);
+# endif
 
     /* create the virtual page boundary GC */
     gcv.foreground = (Desks[i].colorset < 0) ? fore_pix
@@ -920,7 +928,11 @@
 	: Colorset[Desks[i].ballooncolorset].fg;
 
       Desks[i].BalloonGC = fvwmlib_XCreateGC(dpy, Desks[i].balloon.w,
+# ifdef I18N_MB
+				     GCForeground, &gcv);
+# else
 				     GCFont | GCForeground, &gcv);
+# endif
 /* don't do this yet, wait for map since size will change
       if (Desks[i].ballooncolorset > -1 &&
           Colorset[Desks[i].ballooncolorset].pixmap)
diff -ur modules.orig/FvwmTaskBar/ButtonArray.c modules/FvwmTaskBar/ButtonArray.c
--- modules.orig/FvwmTaskBar/ButtonArray.c	Fri Nov 10 21:09:45 2000
+++ modules/FvwmTaskBar/ButtonArray.c	Thu Jan 24 01:44:12 2002
@@ -223,7 +223,7 @@
   int search_len;
   XFontStruct *font;
 #ifdef I18N_MB
-  XFontSet fontset;
+  XFontSet fontset SelButtonFontset;
 #endif
   XGCValues gcv;
   unsigned long gcm;
@@ -244,28 +244,15 @@
   if (state != BUTTON_UP) { x++; y++; }
 
   if (state == BUTTON_BRIGHT || button == StartButton)
-#ifdef I18N_MB
-  {
     font = SelButtonFont;
-    fontset = SelButtonFontset;
-  }
-#else
-    font = SelButtonFont;
-#endif
   else
-#ifdef I18N_MB
-  {
-    font = ButtonFont;
-    fontset = ButtonFontset;
-  }
-#else
     font = ButtonFont;
-#endif
 
+# ifdef I18N_MB
   gcm = GCFont;
   gcv.font = font->fid;
   XChangeGC(dpy, *drawgc, gcm, &gcv);
-
+# endif
   newx = 4;
 
   w3p = XTextWidth(font, t3p, 3);
diff -ur modules.orig/FvwmTaskBar/FvwmTaskBar.c modules/FvwmTaskBar/FvwmTaskBar.c
--- modules.orig/FvwmTaskBar/FvwmTaskBar.c	Sun Sep 16 19:51:19 2001
+++ modules/FvwmTaskBar/FvwmTaskBar.c	Thu Jan 24 01:44:44 2002
@@ -1656,7 +1656,11 @@
    gcval.font = SelButtonFont->fid;
    gcval.graphics_exposures = False;
 
+# ifdef I18N_MB
+   gcmask = GCForeground | GCBackground |  GCGraphicsExposures;
+# else
    gcmask = GCForeground | GCBackground | GCFont | GCGraphicsExposures;
+# endif
    /* Normal */
    gcval.foreground = pfore;
    if (graph)
diff -ur modules.orig/FvwmTaskBar/Goodies.c modules/FvwmTaskBar/Goodies.c
--- modules.orig/FvwmTaskBar/Goodies.c	Sun Sep 16 19:51:19 2001
+++ modules/FvwmTaskBar/Goodies.c	Thu Jan 24 01:40:21 2002
@@ -115,7 +115,11 @@
     pfore = fore;
     pback = back;
   }
+# ifdef I18N_MB
+  gcmask = GCForeground | GCBackground | GCGraphicsExposures;
+# else
   gcmask = GCForeground | GCBackground | GCFont | GCGraphicsExposures;
+# endif
   gcval.foreground = pfore;
   gcval.background = pback;
   gcval.font = StatusFont->fid;
diff -ur modules.orig/FvwmWharf/stepgfx.c modules/FvwmWharf/stepgfx.c
--- modules.orig/FvwmWharf/stepgfx.c	Sun Dec  3 18:56:09 2000
+++ modules/FvwmWharf/stepgfx.c	Thu Jan 24 01:46:13 2002
@@ -524,7 +524,11 @@
 	gcv.foreground = 0;
 	gcv.function = GXcopy;
     gcv.font = font->fid;
+# ifdef I18N_MB
+	gc = fvwmlib_XCreateGC(dpy,mask,GCFunction|GCForeground,&gcv);
+# else
 	gc = fvwmlib_XCreateGC(dpy,mask,GCFunction|GCForeground|GCFont,&gcv);
+# endif
     XFillRectangle(dpy,mask,gc,0,0,w,h);
 	XSetForeground(dpy,gc,1);
     XDrawString(dpy,mask,gc,0,font->ascent,text,chars);
diff -ur modules.orig/FvwmWinList/ButtonArray.c modules/FvwmWinList/ButtonArray.c
--- modules.orig/FvwmWinList/ButtonArray.c	Sun Nov 19 02:47:10 2000
+++ modules/FvwmWinList/ButtonArray.c	Thu Jan 24 01:48:29 2002
@@ -407,9 +407,11 @@
   bottomgc = up ? shadow[set] : hilite[set];
   font = ButtonFont;
 
+# ifndef I18N_MB
   gcm = GCFont;
   gcv.font = font->fid;
   XChangeGC(dpy, graph[set], gcm, &gcv);
+# endif
 
   Fontheight=ButtonFont->ascent+ButtonFont->descent;
 
diff -ur modules.orig/FvwmWinList/FvwmWinList.c modules/FvwmWinList/FvwmWinList.c
--- modules.orig/FvwmWinList/FvwmWinList.c	Tue Oct  2 19:31:01 2001
+++ modules/FvwmWinList/FvwmWinList.c	Thu Jan 24 01:48:08 2002
@@ -1281,7 +1281,11 @@
     gcval.foreground=fore[i];
     gcval.background=back[i];
     gcval.font=ButtonFont->fid;
+# ifdef I18N_MB
+    gcmask=GCForeground|GCBackground;
+# else
     gcmask=GCForeground|GCBackground|GCFont;
+# endif
     graph[i]=fvwmlib_XCreateGC(dpy,win,gcmask,&gcval);
 
     if(Pdepth < 2)
diff -ur modules.orig/FvwmButtons/FvwmButtons.c modules/FvwmButtons/FvwmButtons.c
--- modules.orig/FvwmButtons/FvwmButtons.c	Thu Jan 24 03:00:45 2002
+++ modules/FvwmButtons/FvwmButtons.c	Thu Jan 24 03:19:25 2002
@@ -1581,7 +1581,7 @@
     if(strncasecmp(b->font_string,"none",4)==0)
       b->font=NULL;
 #ifdef I18N_MB
-    else if(!(b->fontset=XCreateFontSet(Dpy,b->font_string,&ml,&mc,&ds)))
+    else if(!(b->fontset=GetFontSetOrFixed(Dpy,b->font_string)))
     {
       b->font = NULL;
       b->flags&=~b_Font;
@@ -1612,29 +1612,12 @@
     if(strncasecmp(b->c->font_string,"none",4)==0)
       b->c->font=NULL;
 #ifdef I18N_MB
-    else if(!(b->c->fontset=XCreateFontSet(Dpy,b->c->font_string,&ml,&mc,&ds)))
+    else if(!(b->c->fontset=GetFontSetOrFixed(Dpy,b->c->font_string)))
     {
       fprintf(stderr,"%s: Couldn't load fontset %s\n",MyName,
 	      b->c->font_string);
-      if(b==UberButton)
-      {
-#ifdef STRICTLY_FIXED
-	if(!(b->c->fontset=XCreateFontSet(Dpy,"fixed",&ml,&mc,&ds)))
-	{
-#else
-	if(!(b->c->fontset=XCreateFontSet(
-	  Dpy,"-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*",&ml,&mc,&ds)))
-	{
-#endif
-	  fprintf(stderr,"%s: Couldn't load fontset fixed\n",MyName);
-	  b->c->font = NULL;
-	}
-      }
-      else
-      {
 	b->c->font = NULL;
 	b->c->flags&=~b_Font;
-      }
     }
     else
     {
diff -ur modules.orig/FvwmPager/x_pager.c modules/FvwmPager/x_pager.c
--- modules.orig/FvwmPager/x_pager.c	Thu Jan 24 03:00:45 2002
+++ modules/FvwmPager/x_pager.c	Thu Jan 24 03:32:32 2002
@@ -332,13 +332,9 @@
   if (!uselabel || ((fontset =
 		     XCreateFontSet(dpy, font_string, &ml, &mc, &ds)) == NULL))
   {
-#ifdef STRICTLY_FIXED
-    if ((fontset = XCreateFontSet(dpy, "fixed", &ml, &mc, &ds)) == NULL)
-#else
     if ((fontset =
-	 XCreateFontSet(dpy, "-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*",
+	 XCreateFontSet(dpy, "-*-fixed-*",
 			&ml, &mc, &ds)) == NULL)
-#endif
     {
       fprintf(stderr,"%s: No fonts available\n",MyName);
       exit(1);
@@ -367,7 +363,8 @@
 #ifdef I18N_MB
   if(smallFont != NULL)
   {
-    windowFontset = XCreateFontSet(dpy, smallFont, &ml, &mc, &ds);
+    if ( (windowFontset = XCreateFontSet(dpy, smallFont, &ml, &mc, &ds)) == NULL)
+      windowFontset = XCreateFontSet(dpy, "-*-fixed-*", &ml, &mc, &ds);
     if (windowFontset != NULL)
     {
       XFontsOfFontSet(windowFontset, &fs_list, &ml);
@@ -859,23 +856,9 @@
 
       /* get font for balloon */
 #ifdef I18N_MB
-      if ( (Desks[i].balloon.fontset = XCreateFontSet(dpy, BalloonFont, &ml,
-						      &mc, &ds)) == NULL ) {
-#ifdef STRICTLY_FIXED
-	if ( (Desks[i].balloon.fontset = XCreateFontSet(dpy, "fixed", &ml, &mc,
-							&ds)) == NULL )
-#else
-	if ( (Desks[i].balloon.fontset =
-	      XCreateFontSet(dpy,
-			     "-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*",
-			     &ml, &mc, &ds)) == NULL )
-#endif
-	{
+      if ( (Desks[i].balloon.fontset = GetFontSetOrFixed(dpy, BalloonFont)) == NULL ) {
 	  fprintf(stderr,"%s: No fonts available.\n", MyName);
 	  exit(1);
-	}
-	fprintf(stderr, "%s: Can't find font '%s', using fixed.\n",
-		MyName, BalloonFont);
       }
       XFontsOfFontSet(Desks[i].balloon.fontset, &fs_list, &ml);
       Desks[i].balloon.font = fs_list[0];
Only in modules/FvwmPager: x_pager.c~
--- libs/GetFont.c.orig	Tue Dec  5 18:22:40 2000
+++ libs/GetFont.c	Wed Jan 23 19:37:35 2002
@@ -59,38 +59,43 @@
   XFontSet fontset = NULL;
   char **ml;
   int mc;
+  int i;
   char *ds;
 
-  if (fontname)
+  if (fontname){
     fontset = XCreateFontSet(disp,fontname,&ml,&mc,&ds);
-  if (!fontset && fontname)
-  {
-    fprintf(stderr,
+  }
+  else{
+     fprintf(stderr,
             "[FVWM][GetFontSetOrFixed]: "
-	    "WARNING -- can't get fontset %s, trying 'fixed'\n",
+	    "WARNING -- fontname is a NULL-string\n",
             fontname);
   }
   if (!fontset)
   {
+    fprintf(stderr,
+            "[FVWM][GetFontSetOrFixed]: "
+	    "WARNING -- can't get fontset '%s', trying '-*-fixed-*'\n",
+            fontname);
     /* fixed should always be avail, so try that */
-#ifdef STRICTLY_FIXED
-    if ((fontset = XCreateFontSet(disp,"fixed",&ml,&mc,&ds))==NULL)
-    {
-      fprintf(stderr,
-	      "[FVWM][GetFontSetOrFixed]: "
-	      "ERROR -- can't get fontset 'fixed'\n");
-    }
-#else
-    /* Yes, you say it's not a *FIXED* font, but it helps you. */
     if ((fontset =
 	 XCreateFontSet(disp,
-			"-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*",
+			"-*-fixed-*",
 			&ml, &mc, &ds)) == NULL)
     {
       fprintf(stderr,"[FVWM][GetFontSetOrFixed]: "
 	      "ERROR -- can't get fontset 'fixed'\n");
     }
-#endif
+  }
+  if (fontset){
+    if (mc > 0) {
+      (void)fprintf(stderr, 
+		    "[FVWM][GetFontSetOrFixed]:"
+		    "The following charsets are missing:\n");
+      for(i=0; i < mc; i++)
+	fprintf(stderr, "\t%s\n", ml[i]);
+      XFreeStringList(ml);
+    }
   }
 
   return fontset;

-- 
Alexander Kotelnikov
Saint-Petersburg, Russia

---

From: Dan Espen <[email-masked]>
Date: Wed, 23 Jan 2002 20:53:17 -0500

> Fourth patch is GetFontSetOrFixed modification, which I emphatically

The only one I looked at is the last one.
I can tell that you didn't make up your patch against current
CVS since I recently fixed up the messages in GetFontSetOrFixed
and your patch doesn't reflect that.

Patches should be against current CVS to make it easier on us.

-- 
Dan Espen
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854                     Phone: (732) 699-5570
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Alexander Kotelnikov <[email-masked]>
Date: Thu, 24 Jan 2002 06:29:13 +0300

")
Message-ID: <[email-masked]>
Lines: 49
User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1
 (i386-debian-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Sender: [email-masked]
Precedence: list
X-Majordomo: 1.94.jlt7

--=-=-=

>>>>> On Wed, 23 Jan 2002 20:53:17 -0500
>>>>> "Dan" == Dan Espen <<[email-masked]>
> wrote:
Dan> 
Dan> 
>> Fourth patch is GetFontSetOrFixed modification, which I emphatically
Dan> 
Dan> The only one I looked at is the last one.
Dan> I can tell that you didn't make up your patch against current
Dan> CVS since I recently fixed up the messages in GetFontSetOrFixed
Dan> and your patch doesn't reflect that.
Dan> 
Dan> Patches should be against current CVS to make it easier on us.

Oh... I realised now that GetFont.c diff against is in the end on 1st
patch. To put everything together I place that patch here again

--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=UTF-8_locale.diff
Content-Description: removes setting font field of XGCValues and modifies GetFontSetOrFixed()

Index: fvwm/builtins.c
 
   /* make GC's */
+# ifdef I18N_MB
 
   /* make GC's */
+# ifdef I18N_MB
 
Index: libs/GetFont.c
 
 #ifdef I18N_MB
-/*
 
-  if (fontname)
+  if (fontname){

--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=UTF-8_GCFont_modules.diff
Content-Description: great GCFont mask removal from modules (#ifdef I18N_MB)

Index: modules//FvwmButtons/FvwmButtons.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/modules/FvwmButtons/FvwmButtons.c,v
retrieving revision 1.141
diff -u -r1.141 FvwmButtons.c
--- modules//FvwmButtons/FvwmButtons.c	2002/01/17 09:40:51	1.141
+++ modules//FvwmButtons/FvwmButtons.c	2002/01/24 03:05:18
@@ -2092,11 +2092,13 @@
   gcm = GCForeground|GCBackground;
   gcv.foreground = fore_pix;
   gcv.background = back_pix;
+# ifndef I18N_MB
   if(ub && ub->c && ub->c->font && ub->font)
   {
     gcv.font = ub->c->font->fid;
     gcm |= GCFont;
   }
+# endif
   NormalGC = fvwmlib_XCreateGC(Dpy, MyWindow, gcm, &gcv);
   gcv.foreground = shadow_pix;
   gcv.background = fore_pix;
Index: modules//FvwmButtons/draw.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/modules/FvwmButtons/draw.c,v
retrieving revision 1.41
diff -u -r1.41 draw.c
--- modules//FvwmButtons/draw.c	2002/01/12 14:40:13	1.41
+++ modules//FvwmButtons/draw.c	2002/01/24 03:05:20
@@ -373,8 +373,7 @@
     if (fontset)
     {
       gcv.foreground = fc;
-      gcv.font = font->fid;
-      XChangeGC(Dpy,NormalGC,GCForeground | GCFont,&gcv);
+      XChangeGC(Dpy,NormalGC,GCForeground,&gcv);
       DrawTitle(b,MyWindow,NormalGC);
     }
 #else
Index: modules//FvwmForm/FvwmForm.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/modules/FvwmForm/FvwmForm.c,v
retrieving revision 1.77
diff -u -r1.77 FvwmForm.c
--- modules//FvwmForm/FvwmForm.c	2002/01/17 09:40:51	1.77
+++ modules//FvwmForm/FvwmForm.c	2002/01/24 03:05:26
@@ -637,7 +637,11 @@
 static void CheckAlloc(Item *this_item,DrawTable *dt)
 {
   static XGCValues xgcv;
+# ifdef I18N_MB
+  static int xgcv_mask = GCBackground | GCForeground;
+# else
   static int xgcv_mask = GCBackground | GCForeground | GCFont;
+# endif
 
   if (dt->dt_used == 2) {               /* fonts colors shadows */
     return;
@@ -669,7 +673,11 @@
   xgcv.foreground = dt->dt_colors[c_item_fg];
   xgcv.background = dt->dt_colors[c_item_bg];
   xgcv.font = dt->dt_font;
+# ifdef I18N_MB
+  dt->dt_item_GC = fvwmlib_XCreateGC(dpy, CF.frame, GCForeground, &xgcv);
+# else
   dt->dt_item_GC = fvwmlib_XCreateGC(dpy, CF.frame, GCForeground | GCFont, &xgcv);
+# endif
   if (Pdepth < 2) {
     dt->dt_colors[c_itemlo] = BlackPixel(dpy, screen);
     dt->dt_colors[c_itemhi] = WhitePixel(dpy, screen);
Index: modules//FvwmIconBox/FvwmIconBox.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/modules/FvwmIconBox/FvwmIconBox.c,v
retrieving revision 1.70
diff -u -r1.70 FvwmIconBox.c
--- modules//FvwmIconBox/FvwmIconBox.c	2002/01/19 21:33:15	1.70
+++ modules//FvwmIconBox/FvwmIconBox.c	2002/01/24 03:05:31
@@ -1202,7 +1202,11 @@
   gcv.foreground = icon_shadow_pix;
   IconShadowGC = fvwmlib_XCreateGC(dpy, main_win, gcm, &gcv);
 
+# ifdef I18N_MB
+  gcm = GCForeground|GCBackground;
+# else
   gcm = GCForeground|GCBackground|GCFont;
+# endif
   gcv.foreground = icon_fore_pix;
   gcv.font =  font->fid;
   NormalGC = fvwmlib_XCreateGC(dpy, main_win, gcm, &gcv);
Index: modules//FvwmIdent/FvwmIdent.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/modules/FvwmIdent/FvwmIdent.c,v
retrieving revision 1.56
diff -u -r1.56 FvwmIdent.c
--- modules//FvwmIdent/FvwmIdent.c	2002/01/17 09:40:51	1.56
+++ modules//FvwmIdent/FvwmIdent.c	2002/01/24 03:05:34
@@ -566,7 +566,11 @@
   XSelectInput(dpy, main_win, mw_events);
   change_window_name(&MyName[1]);
 
+# ifdef I18N_MB
+  gcm = GCForeground;
+# else
   gcm = GCForeground|GCFont;
+# endif
   gcv.foreground = fore_pix;
   gcv.font = font->fid;
   gc = fvwmlib_XCreateGC(dpy, main_win, gcm, &gcv);
Index: modules//FvwmPager/x_pager.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/modules/FvwmPager/x_pager.c,v
retrieving revision 1.134
diff -u -r1.134 x_pager.c
--- modules//FvwmPager/x_pager.c	2002/01/17 09:40:51	1.134
+++ modules//FvwmPager/x_pager.c	2002/01/24 03:05:39
@@ -670,7 +670,11 @@
     if (uselabel) {
       gcv.font = font->fid;
       Desks[i].NormalGC =
+# ifdef I18N_MB
+        fvwmlib_XCreateGC(dpy, Scr.Pager_w, GCForeground, &gcv);
+# else
         fvwmlib_XCreateGC(dpy, Scr.Pager_w, GCForeground | GCFont, &gcv);
+# endif
     } else {
       Desks[i].NormalGC =
         fvwmlib_XCreateGC(dpy, Scr.Pager_w, GCForeground, &gcv);
@@ -692,7 +696,11 @@
 	: Colorset[Desks[i].highcolorset].fg;
     if (uselabel) {
       Desks[i].rvGC =
+# ifdef I18N_MB
+        fvwmlib_XCreateGC(dpy, Scr.Pager_w, GCForeground, &gcv);
+# else
         fvwmlib_XCreateGC(dpy, Scr.Pager_w, GCForeground | GCFont, &gcv);
+# endif
     } else {
       Desks[i].rvGC =
         fvwmlib_XCreateGC(dpy, Scr.Pager_w, GCForeground, &gcv);
@@ -911,7 +919,11 @@
 	: Colorset[Desks[i].ballooncolorset].fg;
 
       Desks[i].BalloonGC = fvwmlib_XCreateGC(dpy, Desks[i].balloon.w,
+# ifdef I18N_MB
+				     GCForeground, &gcv);
+# else
 				     GCFont | GCForeground, &gcv);
+# endif
 /* don't do this yet, wait for map since size will change
       if (Desks[i].ballooncolorset > -1 &&
           Colorset[Desks[i].ballooncolorset].pixmap)
Index: modules//FvwmTaskBar/ButtonArray.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/modules/FvwmTaskBar/ButtonArray.c,v
retrieving revision 1.20
diff -u -r1.20 ButtonArray.c
--- modules//FvwmTaskBar/ButtonArray.c	2000/11/10 18:09:45	1.20
+++ modules//FvwmTaskBar/ButtonArray.c	2002/01/24 03:05:41
@@ -245,26 +245,22 @@
 
   if (state == BUTTON_BRIGHT || button == StartButton)
 #ifdef I18N_MB
-  {
-    font = SelButtonFont;
     fontset = SelButtonFontset;
-  }
 #else
     font = SelButtonFont;
 #endif
   else
 #ifdef I18N_MB
-  {
-    font = ButtonFont;
     fontset = ButtonFontset;
-  }
 #else
     font = ButtonFont;
 #endif
 
+# ifndef I18N_MB
   gcm = GCFont;
   gcv.font = font->fid;
 
   newx = 4;
 
Index: modules//FvwmTaskBar/FvwmTaskBar.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/modules/FvwmTaskBar/FvwmTaskBar.c,v
retrieving revision 1.80
diff -u -r1.80 FvwmTaskBar.c
--- modules//FvwmTaskBar/FvwmTaskBar.c	2002/01/19 21:33:15	1.80
+++ modules//FvwmTaskBar/FvwmTaskBar.c	2002/01/24 03:05:45
@@ -1657,7 +1657,11 @@
    gcval.font = SelButtonFont->fid;
    gcval.graphics_exposures = False;
 
+# ifdef I18N_MB
+   gcmask = GCForeground | GCBackground |  GCGraphicsExposures;
+# else
    gcmask = GCForeground | GCBackground | GCFont | GCGraphicsExposures;
+# endif
    /* Normal */
    gcval.foreground = pfore;
    if (graph)
Index: modules//FvwmTaskBar/Goodies.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/modules/FvwmTaskBar/Goodies.c,v
retrieving revision 1.26
diff -u -r1.26 Goodies.c
--- modules//FvwmTaskBar/Goodies.c	2001/11/10 21:19:48	1.26
+++ modules//FvwmTaskBar/Goodies.c	2002/01/24 03:05:47
@@ -116,7 +116,11 @@
     pfore = fore;
     pback = back;
   }
+# ifdef I18N_MB
+  gcmask = GCForeground | GCBackground | GCGraphicsExposures;
+# else
   gcmask = GCForeground | GCBackground | GCFont | GCGraphicsExposures;
+# endif
   gcval.foreground = pfore;
   gcval.background = pback;
   gcval.font = StatusFont->fid;
@@ -517,7 +521,11 @@
   Tip.win = XCreateWindow(dpy, Root, x, y, w+4, h+4, 0, Pdepth, InputOutput,
 			  Pvisual, winattrmask, &winattr);
 
+# ifdef I18N_MB
+  gcmask = GCForeground | GCBackground |  GCGraphicsExposures;
+# else
   gcmask = GCForeground | GCBackground | GCFont | GCGraphicsExposures;
+# endif
   gcval.graphics_exposures = False;
   gcval.foreground = tip_fore;
   gcval.background = tip_back;
Index: modules//FvwmWharf/stepgfx.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/modules/FvwmWharf/stepgfx.c,v
retrieving revision 1.6
diff -u -r1.6 stepgfx.c
--- modules//FvwmWharf/stepgfx.c	2000/12/03 15:56:09	1.6
+++ modules//FvwmWharf/stepgfx.c	2002/01/24 03:05:48
@@ -524,7 +524,11 @@
 	gcv.foreground = 0;
 	gcv.function = GXcopy;
     gcv.font = font->fid;
+# ifdef I18N_MB
+	gc = fvwmlib_XCreateGC(dpy,mask,GCFunction|GCForeground,&gcv);
+# else
 	gc = fvwmlib_XCreateGC(dpy,mask,GCFunction|GCForeground|GCFont,&gcv);
+# endif
     XFillRectangle(dpy,mask,gc,0,0,w,h);
 	XSetForeground(dpy,gc,1);
     XDrawString(dpy,mask,gc,0,font->ascent,text,chars);
Index: modules//FvwmWinList/ButtonArray.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/modules/FvwmWinList/ButtonArray.c,v
retrieving revision 1.26
diff -u -r1.26 ButtonArray.c
--- modules//FvwmWinList/ButtonArray.c	2000/11/18 23:47:10	1.26
+++ modules//FvwmWinList/ButtonArray.c	2002/01/24 03:05:49
@@ -407,9 +407,11 @@
   bottomgc = up ? shadow[set] : hilite[set];
   font = ButtonFont;
 
+# ifndef I18N_MB
   gcm = GCFont;
   gcv.font = font->fid;

Index: modules//FvwmWinList/FvwmWinList.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/modules/FvwmWinList/FvwmWinList.c,v
retrieving revision 1.92
diff -u -r1.92 FvwmWinList.c
--- modules//FvwmWinList/FvwmWinList.c	2002/01/19 21:33:15	1.92
+++ modules//FvwmWinList/FvwmWinList.c	2002/01/24 03:05:53
@@ -1300,7 +1300,11 @@
     gcval.foreground=fore[i];
     gcval.background=back[i];
     gcval.font=ButtonFont->fid;
+# ifdef I18N_MB
+    gcmask=GCForeground|GCBackground;
+# else
     gcmask=GCForeground|GCBackground|GCFont;
+# endif
     graph[i]=fvwmlib_XCreateGC(dpy,win,gcmask,&gcval);
 
     if(Pdepth < 2)

--=-=-=

I see some I18N_MB changes happend on cvs. Only two (actuaaly three,
first is two in one) patches now.

Also I ask you for removing idiotic STRICTLY_FIXED either in I18N_MB
case or in ASCII/Latin1 (!I18N_MB)

-- 
Alexander Kotelnikov
Saint-Petersburg, Russia

--=-=-=--

---

From: Alexander Kotelnikov <[email-masked]>
Date: Thu, 24 Jan 2002 08:48:50 +0300

Hello

After all changes I made there are still two troubles:
1. in small window indicating window size/position on resize/move
test is displayed too high, with UTF locale I see only some bottom
pixels of it.
2. FvwmPager hurts x font server. I have 5 labeled desktops, and if I
correctly understood the code FvwmPager loads all fonts to draw on
desks images separately. So it makes many requests to X for a font and
sometimes something breaks and I do not see labels at all. Same, but
less frequent happens to balloons.
3. everything works just ok it I use MiniIcons in FvwmPager, but if I
do not, but set SmallFont then I can get the same trouble as with
labels or balloons, but sometimes names of the windows can disappear
one by one (then BadDrawble error is printed into stderr). And I just
noted, sometime these window names are located in corresponding window
image as text in move/resize indication window: I see only the bottom
of a name.

One technical thing to do is to substitute XCreateFontSet with
GetFontSetOrFixed in modules.

---

From: Olivier Chapuis <[email-masked]>
Date: Thu, 24 Jan 2002 09:03:38 +0100

> After all changes I made there are still two troubles:

Does this means that you can display in the good way strings
encoded in UTF8 ??

> GetFontSetOrFixed in modules.

Yes, I think that GetFontSetOrFixed/GetFontOrFixed should be used evreywhere.
In a perfect wolrd we should have a libs files FText.{c,h} with F* functions
with the following correspondance:

  GetFontSetOrFixed or GetFontOrFixed  <-> FGetFontOrFixed
  XmbTextEscapement or XTextWidth <-> FTextWidth
  XmbDrawString or XDrawString <-> FDrawString
  ... etc ...

Basically, almost no I18N_MB ifdef should appear in fvwm codes (but
in the FText.{c,h} files). Also the arguments of the F* functions
should be carfully chosen  to allows "text extension" as using Xft
text rendering.

This is in my TODO list, but not in the first position at all. So, if
you want to do it your are welcome.

Olivier

---

From: Olivier Chapuis <[email-masked]>
Date: Thu, 24 Jan 2002 09:10:11 +0100

> someone can explain me, why exactly problem appears, I will

I will be happy to apply the patch (or some part). The problem is
that I do not understand too why it is needed to remove GCFont
with an UTF8 locale. Do you test the patch with others locale?
 
> code (since nobody guarantee us that 'fixed' has character set that

I do not think that STRICTLY_FIXED is defined anyway.

More comments in other mails, sorry.
Olivier

---

From: Alexander Kotelnikov <[email-masked]>
Date: Thu, 24 Jan 2002 11:29:51 +0300

>>>>> On Thu, 24 Jan 2002 09:03:38 +0100
Olivier> 
>> After all changes I made there are still two troubles:
Olivier> 
Olivier> Does this means that you can display in the good way strings
Olivier> encoded in UTF8 ??

Sure. Actually, it does not matter for X if a string is UTF-8 or
KOI8-R or ISO8859-1 or even JIS.2022, _if_ _we_ _use_ _XmbDrawString_.

>> GetFontSetOrFixed in modules.
Olivier> 
Olivier> Yes, I think that GetFontSetOrFixed/GetFontOrFixed should be
Olivier> used evreywhere. In a perfect wolrd we should have a libs
Olivier> files FText.{c,h} with F* functions with the following
Olivier> correspondance:
Olivier> 
Olivier>   GetFontSetOrFixed or GetFontOrFixed  <-> FGetFontOrFixed
Olivier>   XmbTextEscapement or XTextWidth <-> FTextWidth
Olivier>   XmbDrawString or XDrawString <-> FDrawString
Olivier>   ... etc ...

One thing I cannot undestand why you still keep !I18N_MB. Hope you
know that it is usable only for 7bit and western-european people.

Olivier> Basically, almost no I18N_MB ifdef should appear in fvwm codes (but
Olivier> in the FText.{c,h} files). Also the arguments of the F* functions
Olivier> should be carfully chosen  to allows "text extension" as using Xft
Olivier> text rendering.
Olivier> 
Olivier> This is in my TODO list, but not in the first position at all. So, if
Olivier> you want to do it your are welcome.

I'll think. Frankly speaking I am not in any king an experienced xlib
programmer, fvwm is my experience.

---

From: Olivier Chapuis <[email-masked]>
Date: Thu, 24 Jan 2002 09:26:13 +0100

> patch. To put everything together I place that patch here again

About the GetFont.c changes: you use *-fixed-* as fallback font.
What about using something like:

#define FALLBACK_FONT "-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*,*-fixed-*"

and we can add more fonts I think. The (small) problem with *-fixed-* is
that I get a bold large font.

> case or in ASCII/Latin1 (!I18N_MB)

Is STRICTLY_FIXED used in !I18N_MB codes? I do not think so.
Anyway I do not think STRICTLY_FIXED is defined somewhere.
But yes I think this should be removed.

Olivier

---

From: Olivier Chapuis <[email-masked]>
Date: Thu, 24 Jan 2002 09:37:34 +0100

> KOI8-R or ISO8859-1 or even JIS.2022, _if_ _we_ _use_ _XmbDrawString_.

I am not able to configure my machine to do so. Do you have some
tips? I can for KOI8-R or JIS.2022 but not for utf8.
 
> One thing I cannot undestand why you still keep !I18N_MB.

Hum, Dominik answer such a question recently. I try to find
the message I fail. Dominik?

> Hope you

I do not think so. You can use KOI8-R encoding with !I18N_MB but you
should effectively specify KOI8-R fonts.

> programmer, fvwm is my experience.

I learn the xlib like this. I've still some gap, but I progress :o)

Olivier

---

From: Alexander Kotelnikov <[email-masked]>
Date: Thu, 24 Jan 2002 11:44:10 +0300

>>>>> On Thu, 24 Jan 2002 09:10:11 +0100
Olivier> 
>> someone can explain me, why exactly problem appears, I will
Olivier> 
Olivier> I will be happy to apply the patch (or some part). The problem is
Olivier> that I do not understand too why it is needed to remove GCFont
Olivier> with an UTF8 locale. Do you test the patch with others locale?

0. It was me, who asked, why GCFont should be removed :)
1. font field in XGCValues should not be used with Xmb finctions
anyway, so its change should not change results of Xmb functions
actions.
2. but it does :(

Me myself run ru_RU.KOI8-R locale. Patched fvwm works the same way.
I tested that it start, show menus, move windows etc with the
following locales:
LANG=ru_RU.KOI8-R LANG=C LANG=en_US LANG=fr_FR LANG=uk_UA
LANG=de_DE@euro LANG=de_DE

and pair if UTF:
LANG=ru_RU.UTF-8
LANG=en_US.UTF-8
these two works but not completely, as I wrote.

Olivier>  
>> code (since nobody guarantee us that 'fixed' has character set that

Please, pay attention to my words. Just 'fixed' could fonts you do not
want it to match.

---

From: Alexander Kotelnikov <[email-masked]>
Date: Thu, 24 Jan 2002 11:49:13 +0300

>>>>> On Thu, 24 Jan 2002 09:26:13 +0100
Olivier> 
Olivier> #define FALLBACK_FONT "-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*,*-fixed-*"
Olivier> 
Olivier> and we can add more fonts I think. The (small) problem with *-fixed-* is
Olivier> that I get a bold large font.

This is much better, since sometimes we want to get event bad, but font.

---

From: Alexander Kotelnikov <[email-masked]>
Date: Thu, 24 Jan 2002 12:34:36 +0300

>>>>> On Thu, 24 Jan 2002 09:37:34 +0100
Olivier> 
Olivier> I am not able to configure my machine to do so. Do you have some
Olivier> tips? I can for KOI8-R or JIS.2022 but not for utf8.

localedef -i en_US -c -f UTF-8 en_US.UTF-8
you need relatively modern libc to create UTF-8 locales

>> One thing I cannot undestand why you still keep !I18N_MB.
Olivier> 
Olivier> Hum, Dominik answer such a question recently. I try to find
Olivier> the message I fail. Dominik?

actually I understand. it is much more speedy to deal with XFont than
with XFontSet, but everything seems to rush towards unicode.

>> know that it is usable only for 7bit and western-european people.
Olivier> 
Olivier> I do not think so. You can use KOI8-R encoding with !I18N_MB but you
Olivier> should effectively specify KOI8-R fonts.

It wont work. Really. And cannot. If we have a non 7bit char* in X the
one way to draw it without information lost is XmbDrawString.

---

From: Olivier Chapuis <[email-masked]>
Date: Thu, 24 Jan 2002 11:08:48 +0100

> you need relatively modern libc to create UTF-8 locales

Ah ok, my glibc seems to old, maybe I can try libutf8.
 
> one way to draw it without information lost is XmbDrawString.

Attached to this message a FvwmScrip tscreenshot releaseed with
2.4.4 without multibyte (Menu seems to work too). Anyway I am sure
that it is ok as I do not understand russian at all.

Olivier

---

From: Alexander Kotelnikov <[email-masked]>
Date: Thu, 24 Jan 2002 13:49:09 +0300

>>>>> On Thu, 24 Jan 2002 11:08:48 +0100
Olivier> 
Olivier> 
>> you need relatively modern libc to create UTF-8 locales
Olivier> 
Olivier> Ah ok, my glibc seems to old, maybe I can try libutf8.

I think 2.2 is ok, do really you have older?

>> one way to draw it without information lost is XmbDrawString.
Olivier> 
Olivier> Attached to this message a FvwmScrip tscreenshot releaseed with
Olivier> 2.4.4 without multibyte (Menu seems to work too). Anyway I am sure
Olivier> that it is ok as I do not understand russian at all.

xlib 4.x?

---

From: Olivier Chapuis <[email-masked]>
Date: Thu, 24 Jan 2002 11:58:07 +0100

> I think 2.2 is ok, do really you have older?

Yes, 2.1. I know that a 2.1 to 2.2 upgrade is possible
but ...
 
> Olivier> Attached to this message a FvwmScript screenshot releaseed with
                                                                        ^
                                                                       not
> Olivier> that it is ok as I do not understand russian at all.

Works with XFree 4.1 and XFree 3.3.6 (fortunately I have both
on my machine).

Olivier

---

From: Alexander Kotelnikov <[email-masked]>
Date: Thu, 24 Jan 2002 14:13:55 +0300

>>>>> On Thu, 24 Jan 2002 11:58:07 +0100
Olivier> 
>> xlib 4.x?
Olivier> 
Olivier> Works with XFree 4.1 and XFree 3.3.6 (fortunately I have both
Olivier> on my machine).

Hmm... you could trust me, if it still works, it will stop soon, for
me it looks like.

The trouble is that window's title is not string of chars*, but
multibyte srting.

-- 
Alexander Kotelnikov
Saint-Petersburg, Russia

---

From: Mikhael Goikhman <[email-masked]>
Date: Thu, 24 Jan 2002 11:37:52 +0000

> that I get a bold large font.

On my system, "*-fixed-*" gives

  -jis-fixed-medium-r-normal-*-16-*-*-*-*-*-jisx0208.1983-0

that does not contain ascii glyphs at all (at least xterm -fn "*-fixed-*"
ends up empty). There is a misc-14 variant of this font, also unusable.
Probably it is safe to assume a user has

  -misc-fixed-medium-r-normal-*-14-*-*-*-*-*-iso8859-1 font.

Regards,
Mikhael.

---

From: Olivier Chapuis <[email-masked]>
Date: Thu, 24 Jan 2002 13:02:54 +0100

> The trouble is that window's title is not string of chars*, but

Ha, I see. koi-r fonts are not multibyte. The point here is
that some applications as xterm do strange things when it
has a title with certains characters (the EuroSign with
with iso-8859-15). Some other apps do not do that (E.g.,
rxvt, fvwm modules, fvwm menu). If we can find a document
on the strange thing that do xterm we will be able to
filter the bad characters that appear in your xterm window
title (in the !I18N_MB case).

Olivier

---

From: Alexander Kotelnikov <[email-masked]>
Date: Thu, 24 Jan 2002 15:31:41 +0300

>>>>> On Thu, 24 Jan 2002 11:37:52 +0000
>>>>> "Mikhael" == Mikhael Goikhman <[email-masked]> wrote:
Mikhael> 
>> that I get a bold large font.
Mikhael> 
Mikhael> On my system, "*-fixed-*" gives
Mikhael> 
Mikhael>   -jis-fixed-medium-r-normal-*-16-*-*-*-*-*-jisx0208.1983-0

you are talking about fonts or fontsets?

Mikhael> that does not contain ascii glyphs at all (at least xterm -fn "*-fixed-*"
Mikhael> ends up empty). There is a misc-14 variant of this font, also unusable.
Mikhael> Probably it is safe to assume a user has
Mikhael> 
Mikhael>   -misc-fixed-medium-r-normal-*-14-*-*-*-*-*-iso8859-1 font.

no, thanks, I wont find a cyrilic letter in there :)

---

From: Alexander Kotelnikov <[email-masked]>
Date: Thu, 24 Jan 2002 15:44:20 +0300

>>>>> On Thu, 24 Jan 2002 13:02:54 +0100
Olivier> 
>> The trouble is that window's title is not string of chars*, but
Olivier> 
Olivier> Ha, I see. koi-r fonts are not multibyte. The point here is

koi8-r _charset_ fit 256 table

Olivier> that some applications as xterm do strange things when it
Olivier> has a title with certains characters (the EuroSign with
Olivier> with iso-8859-15). Some other apps do not do that (E.g.,
Olivier> rxvt, fvwm modules, fvwm menu). If we can find a document
Olivier> on the strange thing that do xterm we will be able to
Olivier> filter the bad characters that appear in your xterm window
Olivier> title (in the !I18N_MB case).

Ha! this is really great fault of these programs (rxvt fvwm and
stuff), since KOI8-R locale consists of two character sets: koi8-r
and... iso8859-1. So 1) there is not correct way keep KOI8-R strings
in as ordinar char* 2) ther is no way to draw these strings with
XDrawString.

BTW I am running debian unstable. Current libc and xlib are:
ii  libc6          2.2.4-7        GNU C Library: Shared libraries and Timezone
ii  xlibs          4.1.0-13       X Window System client libraries

---

From: Alexander Kotelnikov <[email-masked]>
Date: Thu, 24 Jan 2002 17:20:20 +0300

>>>>> On Thu, 24 Jan 2002 08:48:50 +0300
Alexander> 
Alexander> After all changes I made there are still two troubles:
Alexander> 1. in small window indicating window size/position on resize/move
Alexander> test is displayed too high, with UTF locale I see only some bottom
Alexander> pixels of it.

One more magic thing! this happens if and only if FvwmPager module is
loaded.

Anyway, geometry settings for label in Scr.SizeWindow need to be
corrected. BTW are Scr.SizeWindow dimensions stored somewhere? in
other words how do I get height and width of the drawble where
size/position is drawn?

---

From: Alexander Kotelnikov <[email-masked]>
Date: Thu, 24 Jan 2002 17:50:36 +0300

>>>>> On Thu, 24 Jan 2002 15:44:20 +0300
Alexander> 
>>>>> "Olivier" == Olivier Chapuis <[email-masked]> wrote:
Olivier> 
Alexander> Ha! this is really great fault of these programs (rxvt fvwm and
Alexander> stuff), since KOI8-R locale consists of two character sets: koi8-r
Alexander> and... iso8859-1. So 1) there is not correct way keep KOI8-R strings
Alexander> in as ordinar char* 2) ther is no way to draw these strings with
Alexander> XDrawString.

I've asked one of current X_LOCALE coders Ivan Pascal about the
problem. He said I was not absolutely right, even conclusions are
correct. The history is that when it happened that people what to work
with more than 7bit second half of byte  was given to iso8859-1 and
this is an Xlib standart. So it you have 8-bit string it is either
us-ascii or iso8859-1. To deal with other encodings one need to use
multibyte strings. So most of the people need fvwm to be built with
I18N_MB.

---

From: Olivier Chapuis <[email-masked]>
Date: Thu, 24 Jan 2002 16:01:14 +0100

> in as ordinar char* 2) ther is no way to draw these strings with

Of course, fvwm ignore the locale when !I18N_MB. What I just claimed
is that fvwm and others app can display Russia characters without
any i18n support. The problem with xterm is that it is compiled
with i18n support and gives multibyte titles at once it see
a non ASCII characters (it will be better to do so when this
is really needed: when says there is both non ASCII "koi8-r chars" and
non ascii "iso8859-1 char"). My rxvt does not have the problem
because it is compiled without multibyte support but it cannot
gives window title with both non ascii "koi8-r chars" and non ascii
"iso18859-1 char" as xterm can (fvwm with I18N_MB).

Now I think that understand the problem.
So ok, KOI8-R locale is multibyte, but koi8-r fonts are not.
What fvwm2 can do without i18n support is to display koi8-r
strings, that's all, exactly as it can display iso8859-1 font
(it can display some window title (or menu) with koi8-r and
some other with iso8859-1). This work fine only with application
without i18n support. This seems consistent.

Now what we may want is to have by default a weak
multibyte support: just handle the xterm titles problems
(which arise with all the apps with i18n support).
Of course it will not possible to mix  koi8-r and iso8859-1
and fonts should be explicitly set.
In fact this is easy to be done:
We just have to modify get_name_property in add_window.c
(the !I18N_MB one) and the corresponding code in events.c.
To filter the xterm titles it is enough to use
	XmbTextPropertyToTextList 
The solution of the filtering problems was simple!

Do I have to apply such changes to 2.4.5?

Olivier

---

From: Alex Belits <[email-masked]>
Date: Thu, 24 Jan 2002 09:37:27 -0700 (MST)

>   -misc-fixed-medium-r-normal-*-14-*-*-*-*-*-iso8859-1 font.

  What all of you are talking about? Most X servers won't even start if
the font alias "fixed" isn't defined, so "fixed", not "*-fixed-*" should
be the last-resort fallback. Most of people have it set to the default
fixed font with iso8859-1 charset, and some (me, for example) to the same
with local charset (koi8-r in my case). *-fixed-* on my box also returns
"-jis-fixed-medium-r-normal--0-0-75-75-c-0-jisx0208.1983-0", so it's
hardly an uncommon setup.

-- 
Alex

---

From: Alex Belits <[email-masked]>
Date: Thu, 24 Jan 2002 09:53:36 -0700 (MST)

> in as ordinar char* 2) ther is no way to draw these strings with

  Since when KOI8-R locale has anything to do with iso8859-1 charset? The
existence of definitions in locale and possibility to use iso8859-1 fonts
(and strings with that charset) doesn't mean that there is a string that
is supposed to have both charsets in them, this is where i18n standards
are still severely lacking (and this is how Unicode sneaks in where it
doesn't belong).

-- 
Alex

---

From: Alexander Kotelnikov <[email-masked]>
Date: Fri, 25 Jan 2002 00:03:07 +0300

>>>>> On Thu, 24 Jan 2002 09:37:27 -0700 (MST)
>>>>> "Alex" == Alex Belits <[email-masked]> wrote:
Alex> 
>> -misc-fixed-medium-r-normal-*-14-*-*-*-*-*-iso8859-1 font.
Alex> 
Alex>   What all of you are talking about? Most X servers won't even start if
Alex> the font alias "fixed" isn't defined, so "fixed", not "*-fixed-*" should
Alex> be the last-resort fallback. Most of people have it set to the default
Alex> fixed font with iso8859-1 charset, and some (me, for example) to the same
Alex> with local charset (koi8-r in my case). *-fixed-* on my box also returns
Alex> "-jis-fixed-medium-r-normal--0-0-75-75-c-0-jisx0208.1983-0", so it's
Alex> hardly an uncommon setup.

Thpe problem is that 
1. "fixed" is not a valid basename
2. "fixed" could be of not desired charset as "*-fixed-*" is for you.
-- 
Alexander Kotelnikov
Saint-Petersburg, Russia
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Alexander Kotelnikov <[email-masked]>
Date: Fri, 25 Jan 2002 00:10:07 +0300

>>>>> On Thu, 24 Jan 2002 16:01:14 +0100
Olivier> 
Olivier> Now what we may want is to have by default a weak
Olivier> multibyte support: just handle the xterm titles problems
Olivier> (which arise with all the apps with i18n support).
Olivier> Of course it will not possible to mix  koi8-r and iso8859-1
Olivier> and fonts should be explicitly set.
Olivier> In fact this is easy to be done:
Olivier> We just have to modify get_name_property in add_window.c
Olivier> (the !I18N_MB one) and the corresponding code in events.c.
Olivier> To filter the xterm titles it is enough to use
Olivier> 	XmbTextPropertyToTextList 
Olivier> The solution of the filtering problems was simple!
Olivier> 
Olivier> Do I have to apply such changes to 2.4.5?

Yes and no: from one side this will work, from another you are
breaking standarts, saying that simple char* is nothing more than
iso8859-1.
-- 
Alexander Kotelnikov
Saint-Petersburg, Russia
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dan Espen <[email-masked]>
Date: Thu, 24 Jan 2002 16:25:10 -0500

> The solution of the filtering problems was simple!

I think you are suggesting to remove the 3 byte escape sequence
when fvwm is compiled without multibyte.
I've been meaning to do the same for a while but haven't
had the chance.

I wouldn't use any Xmb function to do it though.
On Solaris, all the Xmb functions are in a separate shared
library.  I think if you use that function you'll cause another
shared library to be loaded.

I think the sequence is "Esc ( B" or "Esc B (" (I forget which).

> Do I have to apply such changes to 2.4.5?

Not for my benefit.

---

From: Alexander Kotelnikov <[email-masked]>
Date: Fri, 25 Jan 2002 00:29:20 +0300

Suddenly I said not thh thing that I wanted to say. Of course compound
text should be parsed. But is you get a property with 8-bit value and
type string it should be typed as iso8859, so if a wrong program
supplies cyrillic title in western-european characters diapason this
patch will probably break it. This could be avoided by checking if we
have sting or compounded string, but you should know, this check will
be a dirty hack.

If yo do: do not forget about icons :)

---

From: Alexander Kotelnikov <[email-masked]>
Date: Fri, 25 Jan 2002 00:41:55 +0300

>>>>> On Thu, 24 Jan 2002 16:25:10 -0500
>>>>> "Dan" == Dan Espen <[email-masked]> wrote:
Dan> 
>> The solution of the filtering problems was simple!
Dan> 
Dan> I think you are suggesting to remove the 3 byte escape sequence
Dan> when fvwm is compiled without multibyte.
Dan> I've been meaning to do the same for a while but haven't
Dan> had the chance.

This is not "remove the 3 byte escape sequence" this is converting a
property according to locale. So if I have a compound text consisted
of us-ascii, koi8-r, iso8859-1 and some CJK then iso8859 and CJK will
be stripped of instead of printing cyrillic charactesrs on which they
occasionally are mapped if you just remove escapes

Dan> I think the sequence is "Esc ( B" or "Esc B (" (I forget which).
Dan> 
>> Do I have to apply such changes to 2.4.5?
Dan> 
Dan> Not for my benefit.

But to make fvwm more standarts passing

---

From: Olivier Chapuis <[email-masked]>
Date: Thu, 24 Jan 2002 23:42:22 +0100

> have sting or compounded string, but you should know, this check will

I am not sure to understand the objection. With !I18N_MB the users
will have to use the Font and IconFont Styles in the good way.
Moreover, it is easy (and not a bad hack) to check if we have a
component property:

if (GetWMName(dpy, window, &text_prop) != 0)
{
  if (text_prop.value)
  {
    if (text_prop.encoding == XA_STRING)
    {
        /* STRING encoding: take the string as it is */
    }
    else
    {
       /* COMPOUND_TEXT: needs convertion */
    }
}

Olivier

---

From: Olivier Chapuis <[email-masked]>
Date: Fri, 25 Jan 2002 00:16:53 +0100

> I've been meaning to do the same for a while but haven't

I am not sure that it is so easy to remove these "3 bytes" (which
are not only 3 bytes and which can be found at different place
in the string). Basically, we have to rewrite the
	XmbTextPropertyToTextList
function (maybe in a weak form).

> > Do I have to apply such changes to 2.4.5?

Hum I do not know what we should do. But it seems that
since the 2002-01-01 all the Europe (East and West) needs
to use a locale with a non iso8859-1 charset. Also, I think
that a lot of people outside of the Europe will want the
EuroSign. The problem is not that people need the EuroSign
in window titles, the problem is that if you use a charset
!= iso8859-1 and if the window title of an xterm (and of a lot
of others programs) contains non ascii characters, then
the window title is not displayed in the good way. The
only thing that we can respond to this bug is "--enable-multibyte"
(which is now my default). And there are problems with
the I18N_MB patch.

What you would say if you have to use --enable-multibyte
for the "$" characters :o)
We may add --enable-us? or --disable-8bits? :o)

Really, I do not know what we should do. For 2.6.x
we must improve the I18N_MB patch (and fix the utf8
problem), but for 2.4.x?

Olivier

---

From: Olivier Chapuis <[email-masked]>
Date: Fri, 25 Jan 2002 00:35:29 +0100

> 2. "fixed" could be of not desired charset as "*-fixed-*" is for you.

Yes and No :o)
I think that here not evrey body are on the same subject;
and in fact I see a problem with the I18N_MB patch.

If you have "Style my_win Font foo-*-charsetA" with a locale which
supports only the charset charsetB, then fvwm with I18N_MB
will not load a font which match "foo-*-charsetA" but a
font which match *-fixed-*-charsetB (and not a jisx0208.1983-0
font if charsetB != jisx0208.1983-0).
I think that the correct fallback for GetFontSetOrFixed is to call
GetFontOrFixed (I.e, load a Font and not a Font Set). Or an
alternative is to have a Charset fvwm2 style.
Unfortunately the fvwm I18N_MB patch is not prepared to
do that ...

Olivier

---

From: Dan Espen <[email-masked]>
Date: Thu, 24 Jan 2002 20:46:28 -0500

> function (maybe in a weak form).

Maybe in theory the 3 bytes can occur anywhere,
but every time I've seen them, they are at the start of the string.
Java, for example, will put them there when you set the locale to
en_Us.  I think, if you have true multibyte strings, they might
be anywhere, but when an application is just marking a string as
multibyte, just in case, they seem to only be at the start of the
string.

> we must improve the I18N_MB patch (and fix the utf8

Hey, I'm old fashioned, in my opinion, proportional fonts
should never have been implemented on computers.  I'm not
even sure lower case makes any sense.  6 bit characters
made more sense to me.

IF I HAD MY WAY, EMAIL WOULD LOOK LIKE THIS.

  :)

I don't think everyone understood your question.
Current FVWM development is mainly on the 2.5.x branch.
We don't know exactly when the 2.5.x branch will be ready,
so we are making critical patches to the next 2.4.x release,
2.4.5.

The question is should this change be applied to both branches
or can it wait for the release of 2.6.0.

I understand that people in other countries
might have a different view about
how badly they need better character set support.

---

From: Alex Belits <[email-masked]>
Date: Thu, 24 Jan 2002 19:01:05 -0700 (MST)

> 1. "fixed" is not a valid basename

  So? This is the fallback font, the goal is just to get anything that
is likely to be readable.

> 2. "fixed" could be of not desired charset as "*-fixed-*" is for you.

"fixed" _might_ be of not desired charset. "*-fixed-*" almost always
isn't, unless the only available charset is the one desired, what
automatically makes "fixed" optimal.

-- 
Alex

---

From: Alexander Kotelnikov <[email-masked]>
Date: Fri, 25 Jan 2002 05:13:49 +0300

>>>>> On Thu, 24 Jan 2002 19:01:05 -0700 (MST)
Alex> 
Alex> On Fri, 25 Jan 2002, Alexander Kotelnikov wrote:
Alex> 
>> 1. "fixed" is not a valid basename
Alex> 
Alex>   So? This is the fallback font, the goal is just to get anything that
Alex> is likely to be readable.

if a string is not a valid basename no XFontSet will be created

Alex> 
>> 2. "fixed" could be of not desired charset as "*-fixed-*" is for you.
Alex> 
Alex> "fixed" _might_ be of not desired charset. "*-fixed-*" almost always
Alex> isn't, unless the only available charset is the one desired, what
Alex> automatically makes "fixed" optimal.

All this issue is about fontsets. Fontset do not have a charset. It
can have one, but it can have dosen. So I do not understand what are
you talking about.

---

From: Alex Belits <[email-masked]>
Date: Thu, 24 Jan 2002 19:20:58 -0700 (MST)

> can have one, but it can have dosen. So I do not understand what are

  I am talking about how fallback should be implemented. Maybe it
shouldn't try to be "right" about fontsets at all if the result will be
wrong anyway.

-- 
Alex

---

From: Alexander Kotelnikov <[email-masked]>
Date: Fri, 25 Jan 2002 05:24:24 +0300

>>>>> On Thu, 24 Jan 2002 20:46:28 -0500
Dan> 
>> function (maybe in a weak form).
Dan> 
Dan> Maybe in theory the 3 bytes can occur anywhere,
Dan> but every time I've seen them, they are at the start of the string.

"start of string"? actually on encidings interface. i.e. If I have
string of space and cyrilic letter in KOI8-R I get inerface between 
iso8859-1 and koi8-r, and if I have utf symbol and non-utf JIS one
I will also get this interface in UTF-8 locale

Dan> Java, for example, will put them there when you set the locale to
Dan> en_Us.  I think, if you have true multibyte strings, they might
Dan> be anywhere, but when an application is just marking a string as
Dan> multibyte, just in case, they seem to only be at the start of the
Dan> string.

---

From: Alexander Kotelnikov <[email-masked]>
Date: Fri, 25 Jan 2002 05:34:34 +0300

>>>>> On Thu, 24 Jan 2002 19:20:58 -0700 (MST)
Alex> 
>> can have one, but it can have dosen. So I do not understand what are
Alex> 
Alex>   I am talking about how fallback should be implemented. Maybe it
Alex> shouldn't try to be "right" about fontsets at all if the result will be
Alex> wrong anyway.

man XCreateFontSet, please, and look where FALLBACK_FONT is used in
the fvwm code.

Dan. I am quiet sure you was wrong when made STRICTLY_FIXED changes in
x_pager.c. Now STRICTLY_FIXED affect !I18N_MB parts,  while it has not
bebore.

---

From: Alexander Kotelnikov <[email-masked]>
Date: Fri, 25 Jan 2002 10:07:32 +0300

Alexander> 

sometimes I see just nothing. I tryed to dig it: I've put a printf
in move-resize.c in DisplayPosition()
#ifdef I18N_MB
+  printf("Scr.DefaultFont.font->ascent=%d\n",Scr.DefaultFont.font->ascent);
  XmbDrawString(dpy, Scr.SizeWindow, Scr.DefaultFont.fontset, Scr.StdGC,
                offset,
                Scr.DefaultFont.font->ascent + GEOMETRY_WINDOW_BW,
                str, strlen(str));
#else

this printf gives me while windows movement:

Scr.DefaultFont.font->ascent=4673097

and it is confusing. I got this with cvs fvwm with the only change
from me -- printf() addition.
-- 
Alexander Kotelnikov
Saint-Petersburg, Russia
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Alexander Kotelnikov <[email-masked]>
Date: Sun, 27 Jan 2002 05:47:42 +0300

Hello

The reason is in line
on_demand_loading      True
in
/usr/X11R6/lib/X11/locale/en_US.UTF-8/XLC_LOCALE

Great thanks to Ivan Pascal.

The trouble is that when compiled to use XFontSets fvwm also uses
XFontStruct* member of FvwmFont struct, which is not filled completely
when on_demand_loading is enabled.

I am going to change this redifining FvwmFont so:
typedef struct FvwmFont
{
# ifdef I18N_MB
  XFontSet fontset;		/* font set */
# else
  XFontStruct *font;		/* font structure */
# endif
  int height;			/* height of the font */
  int y;			/* Y coordinate to draw characters */
} FvwmFont;

Of course, this will make me to do many changes to fvwm code...

---

From: "Dmitry Yu. Bolkhovityanov" <[email-masked]>
Date: Mon, 28 Jan 2002 19:21:45 +0600

On Fri, 25 Jan 2002, Olivier Chapuis wrote:

[SNIP]
> function (maybe in a weak form).

	Hmmm...  Those "3 bytes" (generally, much more) are ISO2022 escape
sequences.  The 2022 is a very complex encoding (AFAIR, 2022 interpreter
is a state machine).  It is documented somewhere, but those docs are hard
to read.

	I'll ask Juliusz Chroboczek about how to strip 2022 tags in the
easiest way.  But I'm sure the reply wouldn't be fast -- he is quite busy
with upcoming XFree 4.2.0 now.

> we must improve the I18N_MB patch (and fix the utf8

	YES.  Definitely yes.  Alexander had posted a screenshot with
cyrillic titles from XTerm -- you can see that the result is hardly
readable.  The same happens with Netscape and almost all other apps --
they are correctly i18n'ed on Xlib layer.

	BTW, while just stripping 2022 tags wouldn't be a "correct"
solution, it will work at least for koi8-r, iso8859-* and for other
singlebyte charsets.

	The trick is that (at least in Russia) in case of locale with
"FOO-N" charset the fonts which are default (i.e. used by fvwm, first dir
in fontpath etc.) are *-FOO-N.  And singlebyte encodings are represented
in 2022 "as-is" (e.g. koi8-r text is "<escape for koi8-r><that text in
koi8-r>").  So, we'll display FOO-N-encoded strings with FOO-N-font, which
is right.  Of course, visiting chinese or even polish websites when in
russian locale will give funky titles, but that's what we had in old days.

	_________________________________________
	  Dmitry Yu. Bolkhovityanov
	  The Budker Institute of Nuclear Physics
	  Novosibirsk, Russia

---

From: Olivier Chapuis <[email-masked]>
Date: Tue, 29 Jan 2002 00:22:22 +0100

> or can it wait for the release of 2.6.0.

Ooops, I missed this mail!
I think that the change should be applied to both branches.
If you object we can make some tests: I apply the patch
to 2.4.6 with some "ifdef" and you (we) see if this makes a
big differrence.

Olivier