[Gambas-user] The hell of font size

Benoit Minisini gambas at ...1...
Sun Sep 19 19:14:55 CEST 2004


On Thursday 16 September 2004 00:03, Peter wrote:
> Hallo Rolf,
>
> > Well, message boxes and dialogs have larger fonts, but it does not have
> > any effect on the font size of lables and the TextArea.
>
> Complete startclass:
> STATIC PUBLIC SUB Main()
>   DIM hForm AS Form
>   Application.Font = Font["10"]
>   hForm = NEW FMain
>   hForm.show  
> END
> has effect for all objects from application on desktop!
>
> > And it has no  effect on printing.
>
> I have not work with printing from gambas
>
> > BUT: I set the TextArea font size by hand anyway.
> >
> > And of course I set
> > the font size for printing, too. The point is, when I set font size for
> > printing to 10, it will appear as about 12 with Courier font - Times
> > appears somewhat smaller... So it is actually not predictable.
>
> This problem i now from TCL/TK!
>
> > I assume there is some bug or something that has changed between the
> > version 0.92 and 0.99. I read through the changelogs but cannot find
> > anything pointing to this.
>
> With 0.98 i had no problem, ar i change to 0.99 on the same day as i
> install the 17 inch Monitor!!
>
> Regards
>
> Peter
>

The "font size hell" comes from the fact that the screen DPI returned by 
X-window is often false.

So I decided that all screen font size will be internally modified so that the 
screen resolution is always 96 DPI. This is the mean of the Font.Resolution 
property. The Desktop.Resolution property returns what X-Window says about 
your screen.

I put the line 'Application.Font = Font["10"]' in the source code, so that 
forms display the same everywhere. This is stupid, as I should only did that 
in the form windows. And I'm going to do that now... :-)

If you change Font.Resolution in your code, or if your default desktop font 
size is not 10, then when you run the program, the font size will be 
different from what you see in the form editor.

I did all that so that when you make a GUI with Gambas, you are almost sure 
that this GUI will look the same on another computer/screen...

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list