From 2aa1d355ec2cc6338b323f75e1199672acb5aeeb Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Fri, 6 Sep 2024 00:30:15 -0400 Subject: [PATCH] Add SetTabWidth to Setter (non-functional currently) --- setter.go | 9 +++++++++ 1 file changed, 9 insertions(+) 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) {