Re: GtkEntry needs to be fixed in order to work correctly with fonts (not fontsets) under non-latin1 single-byte locale



Vlad Harchev <hvv hippo ru> writes:

>  Hi, 
> 
>  The GtkEntry recent version of gtk, 1.2.9, still has bugs of not working
> correctly with fonts (not fontsets) under non-latin1 single-byte locale -
> since GtkEntry uses *_wc family of functions independant of the use_wchar -
> i.e. _wc functions are used for multibyte text too!
>  This bug leads to displaying completely wrong glyphs in GtkEntry!

I guess it's good that we didn't switch over the RC files to use
fonts, then!

>  The gross hack to fix this problem is
> change
> 	entry->use_wchar = FALSE;
> to 
> 	entry->use_wchar = TRUE;
> in gtk_entry_init. It works just fine, the only issues it has is decreasing
> performance (but it's negligible I think).

We can't make this change for GTK+-1.2.10. There are a substantial 
number of systems where the wide character functions (gdk_iswspace,
and so forth) are broken. 

Now, if we were putting out a release with a long testing period
be able to figure out exactly what, if anything, would break.

But 1.2.10 is going out tomorrow morning, with the goal of introducing
zero new defects beyond those in 1.2.9. 

So this is not a change I feel comfortable with. I'd be much
more comfortable with a patch that:

 - Always used the GDK functions for converting between multi-byte
   and wide characters.

 - But, as currently, only used iswspace and relatives when 
   a fontset is in use.
 
>  Also I can prepare a patch for GtkEntry that fixes all problems in a clean
> way (i.e. calling non-wc versions of functions if entry->use_wchar  is FALSE
> and *_wc version of functions when entry->use_wchar is TRUE). Of course it
> will complicate code somewhat.. Will this patch be accepted and included in 
> 1.2.10 (if it has no technical flaws) or hackish solution will be preferred?

If you can get me a patch by tomorrow morning, my time, that:
 
 - Fixes all occurences of conversion between characters and bytes
   by direct assignment by using the GDK functions.

   (Note that this occurs in GtkText as well - see, e.g., line 3773)

 - Is thoroughly tested out. 
   
Then I'll consider it for inclusion in 1.2.10. But I don't want to
just make random changes in hopes of moving forward.

Thanks,
                                        Owen




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]