Skip to content

Instantly share code, notes, and snippets.

@mandel59
Created November 1, 2012 17:06
Show Gist options
  • Save mandel59/3995067 to your computer and use it in GitHub Desktop.
Save mandel59/3995067 to your computer and use it in GitHub Desktop.
TTC to TTF conversion
package main
import (
"flag"
"github.com/mandel59/gofont/otf"
"os"
)
var in *string = flag.String("in", "", "input file name")
func main() {
flag.Parse()
if *in == "" {
return
}
f, err := os.Open(*in)
if err != nil {
return
}
files := flag.Args()
o, err := otf.ReadOTF(f)
if err != nil {
return
}
for i, s := range files {
if i >= len(o) {
break
}
if f, err := os.Create(s); err == nil {
o[i].Generate(f)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment