[Gambas-user] special chars bug solved!

Stefano Palmeri stefanopalmeri at ...152...
Wed May 31 01:06:51 CEST 2006


Hi, Benoit.

Last week I posted some messages about
a 'special chars bug' in the Editor control.

Finally, I've got the solution.

I noticed that if in the Editor control properties I select a font 
different than my KDE (.qtrc?) default font or I set Editor1.Font.*
in the code, then I can type and see those special chars (àòùìèé). 

Moreover, I saw that Gambas2 doesn't store
the Editor font value in the relative *.form file, 
if the selected font is equal to the Application.Font.Name.

So, I modified Gambas2 FProperty.class this way:

PRIVATE FUNCTION GetFont(sFont AS String) AS String

  DIM bDefault AS Boolean

  bDefault = Font[sFont].Name = Application.Font.Name
  IF bDefault THEN
     [...]
     WEND  
     IF NOT sFont THEN sFont = "+0"     <----- patch
  ENDIF

to make Gambas2 always store the font size value of controls. 

This workaround is partial because the user has to set at least
once the font value in the properties.

After recompiling, the bug has gone and I can see all chars in the Editor
control, even the special ones. 

To draw conclusions: if the Editor control Font value is not specified 
in the relative *.form file or in the project code, I get the bug. 

Probably the bug is only for my system (nobody else reported it). 

If it doesn't hurt Gambas2, could you modify next Gambas2 
so that, when the user adds an Editor control to a Form, the 
default value Font = Font["+0"] is automatically stored?

Anyway, now I know how to work around the bug :-)

Thanks for reading.

Regards,

Stefano Palmeri

P.S. Using some kind of fonts, the cursor of the Editor control 
progressively  moves away from typed chars.
I experienced that with "Bitstream Vera Sans", "Cursor",
"Luxi Sans".     




More information about the User mailing list