Hi Rick,
Thank you for your answer. I didn't know that 'bound-details had an X property. It does what I need but it can get tedious to use because I need to specify a number from the start of the spanner (or the system if the spanner is broken into many systems). It takes some trial and error to find the right number and all that work is undone if the spacing changes.
That however led me to writing this function that offsets the 'X value of the 'right-bound-info property, which is the procedure that calculates where the spanner ends. I'm copying it here so it can be used if someone finds it useful or is searching for a similar question in the future.
\version "2.19.83"
ALB-OffsetRBNfo-X =
#(define-scheme-function (n) (number?)
"Offset the X position at the end of a breakable object that determines its X position
through the 'right-bound-info procedure."
(lambda (grob)
(let* ((bound-right (ly:spanner-bound grob RIGHT))
(broken-right (= (ly:item-break-dir bound-right) CENTER)))
(if broken-right
(let* ((rbnfo (ly:grob-property grob 'right-bound-info #f))
(rbnfo (map (lambda (pair)
(if (eq? 'X (car pair))
(cons 'X (+ (cdr pair) n))
pair))
rbnfo)))
(ly:grob-set-property! grob 'right-bound-info rbnfo))))))
\relative {
\override TextSpanner.bound-details.left.text = "sample spanner"
\override TextSpanner.after-line-breaking = \ALB-OffsetRBNfo-X 15
c'\startTextSpan d e f | g a g f \break | e f e d | c1\stopTextSpan
}