Tuesday, June 17, 2008

Installing Fonts and JPEG support in Image Magick in Fedora

Install microsoft fonts
1. Download the MS Core Fonts Smart Package File
wget http://corefonts.sourceforge.net/msttcorefonts-2.0-1.spec
2. Make sure that the rpm-build and cabextract packages are installed:
yum install rpm-build cabextract
3. Build the Core Fonts package:
rpmbuild -ba msttcorefonts-2.0-1.spec
4. Install the Core Fonts package:
rpm -Uvh /usr/src/redhat/RPMS/noarch/msttcorefonts-2.0-1.noarch.rpm

The above should install microsoft fonts.


Next we will install the JPEG and PNG support on Fedora

Install JPEG Support
wget http://www.imagefolio.com/ImageMagick/jpegsrc.v6b.tar.gz
gunzip jpegsrc.v6b.tar.gz
tar xf jpegsrc.v6b.tar
cd jpeg-6b
./configure --enable-shared
make
make install



Install PNG Support
wget http://www.imagefolio.com/ImageMagick/libpng-1.2.5.tar.gz
gunzip libpng-1.2.5.tar.gz
tar xf libpng-1.2.5.tar
mv libpng-1.2.5 libpng
cd libpng
cd scripts
cp makefile.linux ../makefile
cd ..
make test
make install



Now we will install ImageMagick-6.4.1-8
wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.4.1-8.tar.gz
gunzip ImageMagick-5.5.4-3.tar.gz
tar xf ImageMagick-5.5.4-3.tar
cd ImageMagick-5.5.4-3


Here I also copied the source files from JPEG and PNG folder to ImageMagick/magick folder (just in case).


./configure --enable-shared --disable-static --with-perl=/usr/bin/perl --enable-lzw
make
make install
cd /PATH/TO/YOUR/Installation_Files


To check if the fonts are configured with Image Magick, use following in shell command. It should give us the list of fonts that could be used in ImageMagick convert -list font

To use font with image magick use like
convert -font Courier-New-Regular -pointsize 72 label:Something something.jpg

No comments: