Created
November 1, 2012 17:06
-
-
Save mandel59/3995067 to your computer and use it in GitHub Desktop.
TTC to TTF conversion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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