Skip to content

Commit

Permalink
Updated Makefile with test and webfonts support
Browse files Browse the repository at this point in the history
  • Loading branch information
santhoshtr committed Aug 27, 2013
1 parent 4dcf458 commit 019a9da
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions Makefile
@@ -1,7 +1,8 @@
fontpath=/usr/share/fonts/truetype/malayalam
fonts="AnjaliOldLipi Dyuthi Kalyani Meera Rachana RaghuMalayalamSans Suruma"

default:
default: clean compile
all: clean compile test webfonts
compile:
# generate ttf files from sfd files
@for font in `echo ${fonts}`; \
do \
Expand All @@ -13,9 +14,9 @@ install: */*.ttf
do \
install -D -m 0644 $${font}/$${font}.ttf ${DESTDIR}/${fontpath}/$${font}.ttf; done
# copy fontconfig configuration files to system fontconfig configuration directory
install -D -m 0644 malayalam-fonts.conf ${DESTDIR}/etc/fonts/conf.avail/67-malayalam-fonts.conf
if ! [ -d ${DESTDIR}/etc/fonts/conf.d ]; then mkdir ${DESTDIR}/etc/fonts/conf.d; fi
ln -s ../conf.avail/67-malayalam-fonts.conf ${DESTDIR}/etc/fonts/conf.d/67-malayalam-fonts.conf
install -D -m 0644 malayalam-fonts.conf ${DESTDIR}/etc/fonts/conf.avail/67-malayalam-fonts.conf
if ! [ -d ${DESTDIR}/etc/fonts/conf.d ]; then mkdir ${DESTDIR}/etc/fonts/conf.d; fi
ln -sf ../conf.avail/67-malayalam-fonts.conf ${DESTDIR}/etc/fonts/conf.d/67-malayalam-fonts.conf

uninstall:
# remove fonts from system font directories
Expand All @@ -38,5 +39,22 @@ clean:
do \
if [ -f $${font}/$${font}.ttf ]; then rm -f $${font}/$${font}.ttf; fi \
done
@rm -rf tests/*.pdf webfonts;

test: compile
# Test the fonts
@for font in `echo ${fonts}`; \
do \
echo "Testing font $${font}";\
hb-view $${font}/$${font}.ttf --debug --text-file tests/tests.txt --output-file tests/$${font}.pdf; \
done

webfonts: compile
# generate webfonts
@for font in `echo ${fonts}`; \
do \
mkdir -p webfonts/$${font}; \
sfntly -w $${font}/$${font}.ttf webfonts/$${font}/$${font}.woff; \
sfntly -e -x $${font}/$${font}.ttf webfonts/$${font}/$${font}.eot; \
echo "Webfonts generated for $${font}"; \
done

0 comments on commit 019a9da

Please sign in to comment.