aboutsummaryrefslogtreecommitdiff
path: root/cmd/drawtext/main.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-09-18 19:17:50 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-09-18 19:17:50 +0200
commit3ff749c98c4593ff35b2f82de222db9f97954f29 (patch)
treebcf452f4c58f9e65e3c1d4b8cb0034b798c1a2b7 /cmd/drawtext/main.go
parentdab8960e11bcbd102469881f3e1f9a75abadb896 (diff)
Move to cmd
Diffstat (limited to 'cmd/drawtext/main.go')
-rw-r--r--cmd/drawtext/main.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/cmd/drawtext/main.go b/cmd/drawtext/main.go
new file mode 100644
index 0000000..5f02e5d
--- /dev/null
+++ b/cmd/drawtext/main.go
@@ -0,0 +1,25 @@
+package main
+
+import (
+ "flag"
+ "os"
+
+ "dim13.org/robo"
+)
+
+var scale = flag.Float64("scale", 1.0, "font scale")
+
+func main() {
+ flag.Parse()
+
+ dev := robo.NewDevice()
+ defer dev.Close()
+
+ handle := dev.Handle()
+ defer robo.Home(handle.Writer)
+
+ robo.Initialize(handle, 113, robo.Portrait)
+ robo.A4.UpperRight(handle.Writer)
+ robo.Triple{100, 100, 100}.Factor(handle.Writer)
+ robo.Print(handle.Writer, os.Stdin, robo.Unit(*scale))
+}