-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
33 lines (29 loc) · 853 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
// This is a client program for the odtfindfont library
// Its purpose is to take some files on the command line
// and print the font-families that are used within the
// file.
// Author: Stefan Schröder
// License: See LICENSE file.
package main
import "flag"
import "fmt"
import "strings"
import o "github.com/StefanSchroeder/odtfontfind"
func main() {
flag.Parse()
var ret = []string{}
for _, filename := range flag.Args() {
if strings.HasSuffix(filename, ".odt") ||
strings.HasSuffix(filename, ".ods") ||
strings.HasSuffix(filename, ".odp") {
ret = append(ret, o.LibreofficeFontReader(filename)...)
} else if strings.HasSuffix(filename, ".svg") {
ret = append(ret, o.SvgFontReader(filename)...)
} else {
fmt.Println("Unknown suffix for \"" + filename + "\"")
}
}
for _, item := range ret {
fmt.Println(item)
}
}