aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--text.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/text.go b/text.go
index d13f766..ff21e18 100644
--- a/text.go
+++ b/text.go
@@ -45,7 +45,9 @@ func (f Font) putchar(c *bufio.Writer, s string, scale Unit, off *Point) {
}
off.Y += gl.W * scale
} else if ch == '\t' {
- off.Y += f[' '].W * 8 * scale
+ tab := 8 * f['W'].W * scale // widest char
+ pos := int(off.Y / tab)
+ off.Y = Unit(pos+1) * tab
}
}
off.X += height * scale