| 1 |
|
| 2 |
|
| 3 |
import os, sys, shutil, tempfile, fontforge |
| 4 |
|
| 5 |
caliban=fontforge.open(sys.argv[1]) |
| 6 |
print("...Opened Caliban") |
| 7 |
caliban.selection.all() |
| 8 |
caliban.autoHint() |
| 9 |
print("...AutoHinted") |
| 10 |
caliban.save("Caliban.sfd") |
| 11 |
print("...Saved As") |
| 12 |
caliban.save("Caliban.sfdir") |
| 13 |
print("...Saved As dir") |
| 14 |
caliban.generate("Caliban.ps",bitmap_type="bdf") |
| 15 |
print("...Generated type0") |
| 16 |
caliban.generate("Caliban.ttf",bitmap_type="ms",flags=("pfm",)) |
| 17 |
print("...Generated ttf w/ ms bitmaps") |
| 18 |
caliban.generate("Caliban.ttf",bitmap_type="apple") |
| 19 |
print("...Generated ttf w/ apple bitmaps") |
| 20 |
caliban.generate("Caliban.otf",bitmap_type="ms") |
| 21 |
print("...Generated otf w/ ms bitmaps") |
| 22 |
caliban.generate("Caliban.otf",bitmap_type="ttf",flags=("apple","opentype")) |
| 23 |
print("...Generated otf w/ both apple and ot modes set (& bitmaps)") |
| 24 |
caliban.generate("Caliban.dfont",bitmap_type="sbit") |
| 25 |
print("...Generated sbit") |
| 26 |
caliban.generate("Caliban.",bitmap_type="otb") |
| 27 |
print("...Generated X11 opentype bitmap") |
| 28 |
caliban.generate("Caliban.dfont",bitmap_type="dfont") |
| 29 |
print("...Generated dfont w/ apple bitmaps") |
| 30 |
caliban.generateTtc("Caliban.ttc", None) |
| 31 |
print("...Generated TTC") |
| 32 |
|
| 33 |
caliban.layers["Fore"].is_quadratic = 1 |
| 34 |
caliban.setTableData("cvt ","") |
| 35 |
caliban.selection.all() |
| 36 |
fontforge.setPrefs("DetectDiagonalStems",1) |
| 37 |
caliban.autoHint() |
| 38 |
caliban.autoInstr() |
| 39 |
print("...AutoInstructed") |
| 40 |
caliban.generate("Caliban.ttf",bitmap_type="apple") |
| 41 |
print("...Generated ttf w/ apple bitmaps (again) and instructions") |
| 42 |
caliban.close() |
| 43 |
|
| 44 |
caliban = fontforge.open("Caliban.sfd") |
| 45 |
print("...Read sfd") |
| 46 |
caliban.close() |
| 47 |
caliban = fontforge.open("Caliban.sfdir") |
| 48 |
print("...Read sfdir") |
| 49 |
caliban.close() |
| 50 |
caliban = fontforge.open("Caliban.ps") |
| 51 |
print("...Read type0 (if PfaEdit didn't understand /CalibanBase that's ok)") |
| 52 |
caliban.close() |
| 53 |
caliban = fontforge.open("Caliban.ttf") |
| 54 |
print("...Read ttf") |
| 55 |
caliban.close() |
| 56 |
caliban = fontforge.open("Caliban.otf") |
| 57 |
print("...Read otf") |
| 58 |
caliban.close() |
| 59 |
caliban = fontforge.open("Caliban.dfont") |
| 60 |
print("...Read dfont") |
| 61 |
caliban.close() |
| 62 |
caliban = fontforge.open("Caliban.otb") |
| 63 |
print("...Read otb") |
| 64 |
caliban.close() |
| 65 |
caliban = fontforge.open("Caliban-10.bdf") |
| 66 |
caliban.generate("Caliban.dfont",bitmap_type="sbit") |
| 67 |
print("...Read bdf & Generated sbit") |
| 68 |
caliban.close() |