diff --git a/setter.go b/setter.go index f5cc38f..06c671d 100644 --- a/setter.go +++ b/setter.go @@ -18,6 +18,7 @@ type TypeSetter struct { face font.Face width, height int wrap bool + tabWidth int minWidth fixed.Int26_6 layoutBounds image.Rectangle @@ -215,6 +216,14 @@ func (setter *TypeSetter) SetHeight (heignt int) { setter.height = heignt } +// SetTabWidth sets the distance between tab stops in em spaces. +func (setter *TypeSetter) SetTabWidth (tabWidth int) { + if setter.tabWidth == tabWidth { return } + setter.layoutClean = false + setter.alignClean = false + setter.tabWidth = tabWidth +} + // Em returns the width of one emspace according to the typesetter's font, which // is the width of the capital letter 'M'. func (setter *TypeSetter) Em () (width fixed.Int26_6) {