[Gambas-user] Getting events from a modal showed modal

Benoit Minisini gambas at ...1...
Sat Oct 4 17:54:44 CEST 2008


On samedi 04 octobre 2008, Benoit Minisini wrote:
> Wow. I get this mail ten days after it was sent to the mailing-list!
>
> On jeudi 25 septembre 2008, Doriano Blengino wrote:
> > Hi,
> >
> > I send the project about raising GetPage event.
> >
> > Look at FMain.class:26; the only way I found to get getPage event is to
> > instantiate fmPreview.obs from Fmain.
> > I tried to create it inside the fmPreview.setup() method, and attach it
> > to blah blah blah; this is why in FMain:21 fmPreview.setup() is called
> > with a parameter "ME".
> >
> > fmPreview.obs is disposed in fmPreview.form_close().
> >
> >
> > Benoit,
> >
> > I have some problems with rendering fonts in preview - they are
> > imprecise, and some manipulation comes from practical tries, without a
> > right knowledge. All the things are a little messy, but if you quickly
> > see something wrong, any advice is appreciated.
> > The biggest problem is to calculate the true width of a printed text,
> > when this text is not actually printed on the true printer surface, but
> > on a scaled-down surface (a DrawingArea).
> >
> > Thanks in advance for your interest, if you care.
> >
> > Best regards,
> > Doriano Blengino
>
> Font width is not accurate at small sizes on screen, because of font
> hinting (on screen).
>
> If you want more information about that:
>
> http://www.antigrain.com/research/font_rasterization/index.html
>
> As font hinting problem seems to be less important with higher font sizes,
> I suggest the following:
>
> When you want to know the dimension of a text at small sizes (let's say
> when size <= 48), always calculate it at 48 point size, and divide the
> result by the ratio between 48 and the real font size.
>
> What do you think about that?

But beware that displaying text yet uses the font hinting, so you may have 
some visual glitch between text drawn by different calls to Draw.Text().

Regards,

-- 
Benoit Minisini




More information about the User mailing list