* finished adding hints to Tifinagh in Sans Book, room for improvements.
[dejavu.git] / dejavu-fonts / makelgc.sh
blob7b34666ffbbfea9f9699f8873d4b5554278a6855
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\)*\)","DejaVu LGC \1",g' < $src > $out
26 done
27 cd lgc
28 echo "Stripping unwanted glyphs"
29 fontforge -script - *.sfd <<END
30 i = 1
31 while ( i < \$argc )
32 Open(\$argv[i], 1)
34 Select(0u0530, 0u1cff)
35 SelectMore(0u2c00, 0u2c5f)
36 SelectMore(0u2cff, 0ua6ff)
37 SelectMore(0ua800, 0udfff)
38 SelectMore(0uf900, 0ufaff)
39 SelectMore(0ufb07, 0ufe1f)
40 SelectMore(0ufe30, 0uffef)
41 # SelectMore(0u10000, 0ueffff)
42 Clear()
44 Save(\$argv[i])
45 i++
46 endloop
47 END
48 echo "Generating TTF"
49 mkdir generated
50 ../generate.pe *.sfd
51 ../ttpostproc.pl generated/*.ttf
52 ../unicover.pl ../UnicodeData.txt ../Blocks.txt DejaVuLGCSans.sfd Sans DejaVuLGCSerif.sfd Serif DejaVuLGCMonoSans.sfd 'Sans Mono' > unicover.txt
53 ../langcover.pl ../fc-lang DejaVuLGCSans.sfd Sans DejaVuLGCSerif.sfd Serif DejaVuLGCMonoSans.sfd 'Sans Mono' > langcover.txt
54 cd ..
56 version=$1
57 if [ -z "$version" ]; then
58 echo "No version supplied - no distribution created"
59 exit 0
61 echo "Making LGC distribution of DejaVu fonts $version"
62 name=dejavu-lgc-ttf-$version
63 mkdir packaged/$name
64 cp lgc/generated/*.ttf README LICENSE AUTHORS NEWS BUGS lgc/unicover.txt lgc/langcover.txt packaged/$name
65 (cd packaged; tar cjvf $name.tar.bz2 $name)
66 (cd packaged; zip -rv $name.zip $name)