forked from ConradIrwin/font
/
main.go
41 lines (33 loc) · 763 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package main
import (
"fmt"
"os"
"github.com/ConradIrwin/font/commands"
)
func main() {
command := "help"
if len(os.Args) > 1 {
command = os.Args[1]
os.Args = os.Args[1:]
}
switch command {
case "scrub":
commands.Scrub()
case "info":
commands.Info()
case "stats":
commands.Stats()
case "metrics":
commands.Metrics()
case "features":
commands.Features()
default:
fmt.Println(`
Usage: font [features|info|metrics|scrub|stats] font.[otf,ttf,woff]
features: prints the gpos/gsub tables (contains font features)
info: prints the name table (contains metadata)
metrics: prints the hhea table (contains font metrics)
scrub: remove the name table (saves significant space)
stats: prints each table and the amount of space used`)
}
}