Add SetTabWidth to Setter (non-functional currently)

This commit is contained in:
Sasha Koshka 2024-09-06 00:30:15 -04:00
parent 6e3e288628
commit 2aa1d355ec

View File

@ -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) {