Search code examples
rubyfontsimagemagickrmagick

rmagick custom fonts as pictures


I'm using this script https://github.com/Joern/CustomFont/blob/master/custom_font.rb to generate pictures with text in a custom font.

It works fine.

Now I bought a very special font which works fine on my local working machine with this script.

On my server I also have Ubuntu installed, Ubuntu Server Edition.

So I synced my WebApp from my local machine to my server and then just saw that it doesn't use the font.

I installed it with fc-cache -vf and convert -list font lists the font as installed (also fc-list | grep "Innovage" brings "Innovage:style=Regular").

Strangely, rmagick just won't use the font.

In contrast, this works: convert -font Innovage-Regular -pointsize 72 label:Test test.jpg

Additionaly confusing: bringing the convert line from above into a ruby script, it doesn't use the font again.

Any other font does work, but because the font works on my local machine, it cannot have to do with the font.

So I guess the problem lies at rmagick.

It's the same rmagick and Imagemagick version as on my local machine.

I just can't get it, it's totally confusing me.

Yours, Joern.


Solution

  • okay the problem's solution lies at simple as it can be: the font was simply in the wrong font dir, so that it was installed by the system, but the font-dir, I compiled rmagick with, was different to the dir I put the font into.