aboutsummaryrefslogtreecommitdiff
path: root/ps/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'ps/main.go')
-rw-r--r--ps/main.go34
1 files changed, 34 insertions, 0 deletions
diff --git a/ps/main.go b/ps/main.go
new file mode 100644
index 0000000..478e52c
--- /dev/null
+++ b/ps/main.go
@@ -0,0 +1,34 @@
+package main
+
+import (
+ "io/ioutil"
+ "log"
+ "os"
+ "strings"
+
+ "dim13.org/robo/gc"
+ "github.com/llgcode/ps"
+)
+
+var postscriptContent string
+
+func main() {
+ src, err := os.OpenFile("tiger.ps", 0, 0)
+ if err != nil {
+ log.Println("can't find postscript file.")
+ return
+ }
+ defer src.Close()
+ bytes, err := ioutil.ReadAll(src)
+ postscriptContent = string(bytes)
+ if err != nil {
+ panic(err)
+ }
+
+ GC := gc.NewGraphicContext()
+
+ interpreter := ps.NewInterpreter(GC)
+ reader := strings.NewReader(postscriptContent)
+ interpreter.Execute(reader)
+
+}