- (ly:stencil-combine-at-edge fret-line Y UP
- (draw-fret-lines (- fret-count 1) string-count th size)
- gap))))
-
-(define (draw-thick-top-fret props string-count th size)
- "Draw a thick top fret for a fret diagram whose base fret is not 1."
+ (if (eq? orientation 'normal)
+ (ly:stencil-combine-at-edge (draw-fret-lines (- fret-count 1) string-count th size orientation) Y UP
+ fret-line
+ gap 0)
+ (ly:stencil-combine-at-edge (draw-fret-lines (- fret-count 1) string-count th size orientation) X RIGHT
+ fret-line
+ gap 0)))))
+
+(define (draw-fret-line string-count th size orientation)
+ "Draw a fret line for a fret diagram."
+ (let* ((fret-length (* (- string-count 1) size))
+ (sth (* size th))
+ (half-thickness (* sth 0.5)))
+ (if (eq? orientation 'normal)
+ (ly:make-stencil (list 'draw-line sth half-thickness size
+ (- fret-length half-thickness) size)
+ (cons 0 fret-length)
+ (cons (- half-thickness) half-thickness))
+ (ly:make-stencil (list 'draw-line sth 0 half-thickness
+ 0 (- fret-length half-thickness))
+ (cons (- half-thickness) half-thickness)
+ (cons 0 fret-length)))))
+
+(define (draw-thick-zero-fret props string-count th size orientation)
+ "Draw a thick zeroth fret for a fret diagram whose base fret is not 1."