Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Imagemagick and web fonts

Does anyone know if ImageMagick can be powered by a web font? (Or perhaps feed in via STD IN?) I tried the line below with no luck:

convert -fill black -font http://fonts.googleapis.com/css?family=Diplomata+SC -pointsize 72 label:'Acme Dynamite Company, LLC' logo.png

My goal would be to let users choose a Google Web Font.

like image 352
Anthony Avatar asked Dec 13 '22 02:12

Anthony


2 Answers

If you wget the GWF API, it returns a TTF url:

$ wget -qO- "http://fonts.googleapis.com/css?family=Diplomata+SC" | urlext2

http://themes.googleusercontent.com/static/fonts/diplomatasc/v1/JdVwAwfE1a_pahXjk5qpNonF5uFdDttMLvmWuJdhhgs.ttf

$

like image 192
davelab6 Avatar answered Mar 27 '23 17:03

davelab6


Final update: The user barethon wrote a python woff to ttf converter, which works perfectly. (https://github.com/hanikesn/woff2otf/blob/master/woff2otf.py) I'm now able to rip down the font I want from Google, convert it to ttf and use it with imagemagick. Slightly more complicated than I would have liked, but no big deal.

like image 27
Anthony Avatar answered Mar 27 '23 18:03

Anthony