Comments on: A New Font Repository https://lizards.opensuse.org/2012/05/21/a-new-font-repository/ Blogs and Ramblings of the openSUSE Members Fri, 06 Mar 2020 17:50:09 +0000 hourly 1 https://wordpress.org/?v=4.7.5 By: Niki https://lizards.opensuse.org/2012/05/21/a-new-font-repository/#comment-7500 Tue, 29 May 2012 08:01:40 +0000 http://lizards.opensuse.org/?p=8668#comment-7500 [CODE]#!/bin/bash
#download fonts from http://www.dafont.com

echo “To Download type number”

echo “Retro – 115”
echo “Fancy Initials – 116”
echo “Grid – 117”
echo “Russian – 205”
echo “Medieval – 401”
echo “Gothic Initials – 404”
echo “Sans serif – 501”
echo “Serif – 502”
echo “Fixed width – 503”
echo “Calligraphy – 601”
echo “Ancient – 704”
echo “Shapes – 710”
echo “Bar Code – 711”
echo “Nature – 712”
echo “Sport – 713”
echo “Logos – 717”
echo “Music – 720”
echo “VariousD – 721”

read n
clear
echo “Wait downloading….”
mkdir dafonts/$n
URL=”http://www.dafont.com/theme.php?cat=$n”
#сваля инфо
lynx -dump $URL > l.html

#показва линковете за страниците
cat l.html | awk “/${n}/&&/page/”|awk ‘!/null/ {print $2}’ |uniq |sort -u >> pages.txt

#сваляне на всички страниците
cat pages.txt|while read url;do lynx -dump “${url}” >> l.html;done

#от 1 страница
cat l.html | awk ‘/img/||/dl/’|sort -u |awk ‘!/demo/ {print $2}’ >> fonts.txt

wget –content-disposition -qci fonts.txt -P ~/dafonts/$n

f=`cat l.html|head -22|tail -2|cut -d\> -f2`

cd ~/dafonts
mv $n $f
cd $f
b=`ls |wc -l`
echo ” $b fonts downloaded ”
cd ~/
rm fonts.txt l.html pages.txt
exit
[CODE]

]]>