From 6c0d8da8be9c81958740eb601a5673427d6363c3 Mon Sep 17 00:00:00 2001 From: Santhosh Thottingal Date: Sun, 18 Aug 2013 12:36:06 +0530 Subject: Updated Makefile with test and webfonts support --- Makefile | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 3285396..02bc36d 100644 --- a/Makefile +++ b/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 \ @@ -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 @@ -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 -- cgit