[Gambas-user] Why font coordinates lower-left?
Rolf-Werner Eilert
eilert-sprachen at ...221...
Fri Aug 30 08:09:33 CEST 2013
Am 29.08.2013 19:29, schrieb Benoît Minisini:
> Le 20/08/2013 08:20, Rolf-Werner Eilert a écrit :
>> Hi folks, hi Benoit,
>>
>> just a question about drawing and printing... While other graphic
>> elements start at upper-left corner, fonts start at lower-left. This is
>> true for qt4 drawing as well as for Cairo drawing as far as I could see.
>>
>> This is confusing when you are not aware, for the page starts at
>> upper-left with 0,0 too. So when you print a text at 0,0 you will see
>> nothing, the text is above the border.
>>
>> And you have to take the font height into account whenever positioning text.
>>
>> In Gambas2, font positioning still started at upper-left, so when
>> re-writing old code, I always have to tackle with this problem.
>>
>> But maybe I just haven't understood the deeper sense behind this? :-)
>>
>> Thanks for your insight
>>
>> Rolf
>>
>
> Unless you specify the rectangle and the alignment arguments, text
> drawing routines normally draws the text at font baseline.
>
Aaah - ok. So it will help always specifying the rectangle. I didn't see
the difference...
Thanks!
Rolf
More information about the User
mailing list