smarter breaks in toc columns closes #2
This commit is contained in:
parent
e2dc938c02
commit
fbf273dae9
@ -19,13 +19,21 @@
|
|||||||
(map (lambda (foo)
|
(map (lambda (foo)
|
||||||
(make-general-align-markup Y UP (make-override-markup '(baseline-skip . 1) (make-column-markup
|
(make-general-align-markup Y UP (make-override-markup '(baseline-skip . 1) (make-column-markup
|
||||||
(let add-to-col ((lines restlines) (height-left height))
|
(let add-to-col ((lines restlines) (height-left height))
|
||||||
(let* ((finished (null? lines))
|
(set! restlines lines)
|
||||||
(linestencil (if (not finished) (interpret-markup layout (cons (list (cons 'line-width line-width) (cons 'baseline-skip 1)) props) (markup #:center-align (car lines)))))
|
(if (null? lines)
|
||||||
(calc-height (- height-left (if finished 0 (interval-length (ly:stencil-extent linestencil Y))))))
|
'()
|
||||||
(set! restlines lines)
|
(let* ((line-to-stencil (lambda (line) (interpret-markup layout (cons (list (cons 'line-width line-width) (cons 'baseline-skip 1)) props) (markup line))))
|
||||||
(if (or (< calc-height 0) (null? lines))
|
(stencil-height (lambda (stencil) (interval-length (ly:stencil-extent stencil Y))))
|
||||||
(list)
|
(linestencil (line-to-stencil (car lines)))
|
||||||
(cons (markup #:stencil linestencil) (add-to-col (cdr lines) calc-height)))))))))
|
(calc-height (- height-left (stencil-height linestencil)))
|
||||||
|
(calc-width (interval-length (ly:stencil-extent linestencil X)))
|
||||||
|
(is-less-than-half-line-width (< calc-width (/ line-width 2.0)))
|
||||||
|
(next-line-height (if (null? (cdr lines)) 0 (stencil-height (line-to-stencil (cadr lines)))))
|
||||||
|
(no-space-for-next-line (and is-less-than-half-line-width (< (- calc-height next-line-height) 0)))
|
||||||
|
)
|
||||||
|
(if (or (< calc-height 0) no-space-for-next-line)
|
||||||
|
'()
|
||||||
|
(cons (markup #:stencil linestencil) (add-to-col (cdr lines) calc-height))))))))))
|
||||||
(make-list cols))))
|
(make-list cols))))
|
||||||
(if (null? restlines)
|
(if (null? restlines)
|
||||||
(list)
|
(list)
|
||||||
@ -182,8 +190,8 @@
|
|||||||
indexItemMarkup = \markup \with-link-symbol-ref #'index:label {
|
indexItemMarkup = \markup \with-link-symbol-ref #'index:label {
|
||||||
\index-item-with-pattern
|
\index-item-with-pattern
|
||||||
}
|
}
|
||||||
indexSectionMarkup = \markup \override #'(baseline-skip . 1.5) \column {
|
indexSectionMarkup = \markup \override #'(baseline-skip . 1.5) \left-column {
|
||||||
\fill-line { \sans \bold \fontsize #3 \fromproperty #'index:text \null }
|
\sans \bold \fontsize #3 \fromproperty #'index:text
|
||||||
\null
|
\null
|
||||||
}
|
}
|
||||||
indexCategoryMarkup = \markup \override #'(baseline-skip . 1.5) \column {
|
indexCategoryMarkup = \markup \override #'(baseline-skip . 1.5) \column {
|
||||||
|
Loading…
Reference in New Issue
Block a user