When I try to draw a text string onto image with bitmap font, I got a mess result!
/usr/local/GraphicsMagick/bin/gm convert -debug all -quality 90 -antialias -font "@/usr/share/fonts/bitmap-fonts/console8x8.pcf" -encoding UTF-8 -pointsize 8 -draw "text 20,40 '9876543210'" blank.jpg annotate_mess.jpg
By learning the code of annotate.c, gd library(gdft.c) and freetype2, I learned:
1) the fixed-size bitmap font dose not support transform(see FT_Glyph_Transform), so the bitmap->left is always 0;
2) the data structure of 1-bit monochrome bitmap's bitmap.buffer differ from 8-bit gray-level pixmap, so the buffer should not be iterated with the same method.
And here is the patch of annotate.c, 'annotate.c.patch', some code was copied from gd library(gdft.c),
Now, with the same command, I got the right result.
Log in to post a comment.