[Gambas-user] Error messages by 0.99

Eilert eilert-sprachen at ...221...
Wed Sep 8 09:28:41 CEST 2004


Hi Benoit,

> People shoud really, really read Changelog! 

Uff :-O

> 
> REALLY!

I obey ;-)

> Now by default Gambas ignores the DPI of the screen returned by X-Window when 
> deciding the size of the font. Of course this is a bad thing, but this way 
> gambas application fonts looks everywhere the same.

Sounds logical. Maybe not that bad idea...

> 
> For example, when you decide that your Label has a font size of 18, you want 
> implicitely that on every Linux box, the user gets the same size. Because 
> when you draw your interface visually, you think actually "pixels" and not 
> "points", that is a resolution-dependent unit.

100 % agreed. Never thought about that.

> 
> Note that the value of DPI returned by X is sometimes not accurate, and so, 
> sometimes, when you install a Mandrake, you have small fonts or big fonts 
> with the same screen, according to your video card!

I'm running Suse 9.1 on that machine, but the display is on other 
machines, one is an older version 7 point something (in my office), the 
others are LTSP terminals (never heard about that? Take a look at 
www.ltsp.org).

> 
> To change the Gambas behaviour , you have a Font.Resolution property and a 
> Desktop.Resolution property. By default, Font.Resolution = 96 whatever 
> Desktop.Resolution is.

Ok, I will play around with that if necessary. Now I've just reduced 
font sizes in that program, and it is ok.

> 
> It is the same thing in Windows - maybe a proof that it is a bad thing :-)

Well, in VB you've got to play with twips and stuff... But I managed to 
build a printing engine in VB which I use successfully for printing 
forms in two programs of mine. There is even a form editor to help you 
create the forms. If I could "translate" that into Gambas, I could 
discard all that Windows stuff and do everything in Linux.

> 
> You can change the value of Font.Resolution if you need. If you want the old 
> Gambas behaviour, try Font.Resolution = Screen.Resolution at the start of 
> your program.

Not really :-)

> 
> As you noticed, Font.Resolution is not used for printing. Happily! Otherwise, 
> a 10 pt font on the screen would become a 10 * 600 / 96 = 62.5 pt font on the 
> printer!
> 
> I hope everything is clear now.

:-)) Absolutely...

The form editor I realized this way: The main form's scaling system was 
set to "mm". On the form, there is a picture control which scales to mm 
as well. You can paint and write into that control just the same way you 
would do for the printer control. That is, I only have to set the 
picture to A4 size (landscape or portrait) in mm, and everything I'm 
"printing" into it will appear just like on real paper. The sizes are 
converted into screen measures by Windows, so the size of the paper in 
the form editor on screen is approximately the same as in real life (of 
course not 100 % the same, but it's ok).

For printing, I programmed a preview in the form choosing dialog by just 
dividing everything by 4.

> 
> P.S. Did I mention that everybody should read the ChangeLog ?
> 

Oh dear :-)

Rolf





More information about the User mailing list