ttf fonts are offset
Posted: 2008-01-13T21:04:41-07:00
I've stumbled across this issue and as noone was able to pin down the problem, I can only assume that this is a bug, even though it would surprise me, as someone else would certainly have come across it before. Sorry if it is no bug and I'm just being ignorant.
Nevertheless, here's the problem:
when drawing ttf-fonts on an image, the text seems to be vertically offset by a few pixels. This offset seems to vary by font and and font size. As I have to calculate font positions, this leaves me with some ugly spaces where none should be.
Examples are based on this code:
(the g is added for demonstration purposes)
http://www.mediafire.com/imageview.php? ... ix&thumb=6
http://www.mediafire.com/imageview.php? ... hx&thumb=6
http://www.mediafire.com/imageview.php? ... tm&thumb=6
(current version of IM running under Win2k)
Nevertheless, here's the problem:
when drawing ttf-fonts on an image, the text seems to be vertically offset by a few pixels. This offset seems to vary by font and and font size. As I have to calculate font positions, this leaves me with some ugly spaces where none should be.
Examples are based on this code:
Code: Select all
convert -size 800x120 xc:#000000 -gravity center -font fonts/arial.ttf -pointsize 120 -fill "#ffffff" -draw "text 0,0 'Alea iacta est g'" -quality 100 test.jpg
http://www.mediafire.com/imageview.php? ... ix&thumb=6
http://www.mediafire.com/imageview.php? ... hx&thumb=6
http://www.mediafire.com/imageview.php? ... tm&thumb=6
(current version of IM running under Win2k)