1 #!/usr/bin/env fontforge
4 # script file for FontForge for TTF generation
10 # font generation flags:
11 # 8 => do not include TT instructions (for experimental typefaces)
12 # 0x20 => generate a 'PfEd' table and store glyph comments
13 # 0x40 => generate a 'PfEd' table and store glyph colors
14 # 0x800 => generate old fashioned kern tables.
15 # - this one is important because it generates correct kerning tables
16 def_gen_flags = 0x20 + 0x40 + 0x800
17 exp_gen_flags = def_gen_flags + 8
19 if ($version < "20070501")
20 Error("Your version of FontForge is too old - 20070501 or newer is required");
22 # FoundryName is not used in TTF generation
23 SetPref("FoundryName", "DejaVu")
24 # first 4 characters of TTFFoundry are used for achVendId
25 SetPref("TTFFoundry", "DejaVu")
29 gen_flags = def_gen_flags
30 # Serif Oblique and Serif Bold Oblique are experimental
31 if ((Strcasestr ($fontname, "Serif") > -1) && (Strcasestr ($fontname, "Oblique") > -1))
32 gen_flags = exp_gen_flags
34 if (Strcasestr ($fontname, "Condensed") > -1)
35 gen_flags = exp_gen_flags
37 if (Strcasestr ($fontname, "ExtraLight") > -1)
38 gen_flags = exp_gen_flags
40 # no non-combining ligatures in Mono (we remove all because there are no valid combining ligatures right now)
41 if (Strcasestr ($fontname, "Mono") > -1)
42 # do not remove ligatures from Arabic
43 Select("U+0600", "U+06FF", "U+FB50", "U+FDFF", "U+FE70", "U+FEFF")
45 RemoveLookup("'liga' Standard Ligatures in Latin lookup 8")
48 Generate("generated/" + $fontname + ".ttf", "", gen_flags)