Kurt Jungs Auslieferungszustand
This commit is contained in:
24
internal/files/bin/Makefile
Normal file
24
internal/files/bin/Makefile
Normal file
@@ -0,0 +1,24 @@
|
||||
TRG= ../files.go
|
||||
JSON= ../../../font/calligra.json
|
||||
Z= ../../../font/calligra.z
|
||||
|
||||
${TRG} : ${JSON} ${Z} ./bin
|
||||
echo "package files" > ${TRG}
|
||||
echo "" >> ${TRG}
|
||||
echo "// CalligraJson is embedded byte slice for calligra.json" >> ${TRG}
|
||||
echo "var CalligraJson = []byte{" >> ${TRG}
|
||||
./bin < ${JSON} >> ${TRG}
|
||||
echo "}" >> ${TRG}
|
||||
echo "" >> ${TRG}
|
||||
echo "// CalligraZ is embedded byte slice for calligra.z" >> ${TRG}
|
||||
echo "var CalligraZ = []byte{" >> ${TRG}
|
||||
./bin < ${Z} >> ${TRG}
|
||||
echo "}" >> ${TRG}
|
||||
gofmt -s -w ${TRG}
|
||||
|
||||
./bin : bin.go
|
||||
go build -v
|
||||
|
||||
clean :
|
||||
rm -f ./bin ${TRG}
|
||||
|
28
internal/files/bin/bin.go
Normal file
28
internal/files/bin/bin.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
var buf []byte
|
||||
var pos int
|
||||
var b byte
|
||||
var err error
|
||||
buf, err = ioutil.ReadAll(os.Stdin)
|
||||
if err == nil {
|
||||
for _, b = range buf {
|
||||
fmt.Printf("0x%02X, ", b)
|
||||
pos++
|
||||
if pos >= 16 {
|
||||
fmt.Println("")
|
||||
pos = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "%s\n", err)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user