* ignore dist directory as well
[dejavu.git] / dejavu-fonts / makelgc.sh
blob467ad0bf4928369477c14047d829c1d82c416f3c
1 #!/bin/sh
3 # $Id$
5 # check for files needed to generate langcover.txt and unicover.txt for LGC
6 # Unicode Data
7 if [ ! -e "UnicodeData.txt" -o ! -e "Blocks.txt" ]; then
8 echo "can't read UnicodeData.txt or Blocks.txt\n";
9 exit 1;
11 # fontconfig fc-lang
12 if [ ! -d "fc-lang" ]; then
13 echo "can't read fc-lang\n";
14 exit 1;
17 mkdir lgc
18 echo "Creating LGC derivative"
19 for src in *.sfd; do
20 out=lgc/`echo $src | sed s,DejaVu,DejaVuLGC,`
21 echo "$src -> $out"
22 sed -e 's,FontName: DejaVu,FontName: DejaVuLGC,'\
23 -e 's,FullName: DejaVu,FullName: DejaVu LGC,'\
24 -e 's,FamilyName: DejaVu,FamilyName: DejaVu LGC,'\
25 -e 's,"DejaVu \(\(Sans\|Serif\)*\( Condensed\| Mono\)*\( Bold\)*\( Oblique\|Italic\)*\)","DejaVu LGC \1",g' < $src > $out
26 done
27 cd lgc
28 echo "Stripping unwanted glyphs"
29 fontforge -script ../lgc.pe *.sfd
30 echo "Generating TTF"
31 mkdir generated
32 ../generate.pe *.sfd
33 for ttf in *.sfd.ttf ; do
34 mv $ttf generated/$(echo $ttf|sed s+"\.sfd\.ttf+.ttf+g")
35 done
36 ../ttpostproc.pl generated/*.ttf
37 ../unicover.pl ../UnicodeData.txt ../Blocks.txt DejaVuLGCSans.sfd Sans DejaVuLGCSerif.sfd Serif DejaVuLGCMonoSans.sfd 'Sans Mono' > unicover.txt
38 ../langcover.pl ../fc-lang DejaVuLGCSans.sfd Sans DejaVuLGCSerif.sfd Serif DejaVuLGCMonoSans.sfd 'Sans Mono' > langcover.txt
39 cd ..
41 version=$1
42 if [ -z "$version" ]; then
43 echo "No version supplied - no distribution created"
44 exit 0
46 echo "Making LGC distribution of DejaVu fonts $version"
47 name=dejavu-lgc-ttf-$version
48 mkdir packaged/$name
49 cp lgc/generated/*.ttf README LICENSE AUTHORS NEWS BUGS lgc/unicover.txt lgc/langcover.txt packaged/$name
50 (cd packaged; tar cjvf $name.tar.bz2 $name)
51 (cd packaged; zip -rv $name.zip $name)