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

Doriano Blengino doriano.blengino at ...1909...
Sun Oct 5 13:09:58 CEST 2008


Benoit Minisini ha scritto:
> 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:
>>     
>>> I have some problems with rendering fonts in preview - they are
>>> imprecise, and some manipulation comes from practical tries, without a
>>>       
>> Font width is not accurate at small sizes on screen, because of font
>> hinting (on screen).
>> 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?
>>     
Well, I focused my problem better. The whole thing must, and actually 
does, "think" in real world coordinates. When calculations are done to 
position two texts side by side, one must know the width of the 
left-sided text to put the right-sided text in place.
draw.TextWidth() must be called in real-word coordinates, and it returns 
correct values.

When previewing, the text on the screen, because oh hinting, gets more 
or less widened or narrowed. This improves readability, but the 
proportionality is lost. The only possible thing is to disable hinting 
directly (not possible at this time), or indirectly (by drawing on a 
off-screen surface and then scaling the picture down). In either cases, 
one can not have both readability and proportionality. I could add a 
checkbox to toggle the two modes... in the non-hinting mode, 
anti-aliasing could help. This could be done by creating a Drawing area 
as big as the paper sheet (*much* memory...) and then scale the whole 
page, or by creating a single off-screen image for every text to print 
(and destroy the image just after).

Anyway, the answer to the question about using a 48 points font to do 
calculations, is: "use the true size of the font, because that font, 
with that size, will be rendered on paper".

You didn't reply to the question about instantiating observers to catch 
the GetPage events. It is not so important though.

Thank you, and best regards.
Doriano Blengino








More information about the User mailing list