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? -- Benoit Minisini ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user