aboutsummaryrefslogtreecommitdiff
path: root/text.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-11-14 00:42:23 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-11-14 00:42:23 +0100
commit05af31880498bf60316b85415f9d4c1dfa0d1577 (patch)
treee7040c967ee8e98ae67c3c89ab9bf6d9d5acb5f8 /text.go
parent360abb4272dea659de237b1c58d46acc1746ffa7 (diff)
wip
Diffstat (limited to 'text.go')
-rw-r--r--text.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/text.go b/text.go
index a925f91..cce7956 100644
--- a/text.go
+++ b/text.go
@@ -15,19 +15,19 @@ type Glyph struct {
type Set []Path
-func Print(c *bufio.Writer, in io.Reader, scale Unit) {
+func (r Robo) Print(in io.Reader, scale Unit) {
var off Point
scanner := bufio.NewScanner(in)
for scanner.Scan() {
- font.putchar(c, scanner.Text(), scale, &off)
+ font.putchar(r, scanner.Text(), scale, &off)
}
if err := scanner.Err(); err != nil {
log.Fatal(err)
}
}
-func (f Font) putchar(c *bufio.Writer, s string, scale Unit, off *Point) {
+func (f Font) putchar(r Robo, s string, scale Unit, off *Point) {
for _, ch := range s {
gl, ok := f[ch]
if ok {
@@ -35,9 +35,9 @@ func (f Font) putchar(c *bufio.Writer, s string, scale Unit, off *Point) {
off.X += height * scale
off.Y = 0
}
- off.Offset(c)
+ r.Offset(*off)
for _, p := range gl.S {
- p.Scale(scale).Line(c)
+ r.Line(p.Scale(scale)...)
//p.Scale(scale).Curve(c, 0)
}
off.Y += gl.W * scale