Linux/Ruby/Rails tips

0 notes

only default font is available in RMagick

if only default font is available in RMagick i.e. even after you explicitly specified font

Magick::Draw.new.annotate(img_out, img_out.columns, img_out.rows, 0, 0, “Text”) do

  self.font_family = ‘Arial’

  self.fill = ‘white’

  self.stroke = ‘transparent’

  self.pointsize = 12

  self.font_weight = Magick::BoldWeight

  self.gravity = Magick::CenterGravity

end

and from bash it throws errors like this:

$ convert -font Times-Roman -pointsize 23 label:Anthony test.png

convert: delegate library support not built-in

check whether ImageMagick was installed with Freetype library (http://freetype.sourceforge.net/index2.html). You could install freetype lib from source and then reinstall IM (check —with-freetype=yes option in ./configure output) and RMagick. 

Filed under rmagick ImageMagick FreeType