[Gambas-user] Why font coordinates lower-left?

Benoît Minisini gambas at ...1...
Thu Aug 29 19:29:28 CEST 2013


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.

-- 
Benoît Minisini




More information about the User mailing list