[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Allow left-handed fret-markups (issue 339270043 by address@hidden)
From: |
thomasmorley65 |
Subject: |
Allow left-handed fret-markups (issue 339270043 by address@hidden) |
Date: |
Mon, 22 Jan 2018 14:12:48 -0800 |
Reviewers: ,
Message:
please review
Description:
Allow left-handed fret-markups
By adding a new boolean subproperty: left-handed.
- Extends Documentation/notation/fretted-strings.itely
- Extends Documentation/changes.tely
- Extenss scm/define-grob-properties.scm
- Adds regtest input/regression/fret-diagrams-left-handed.ly
- Disables the possibility to use negative string-distance
Please review this at https://codereview.appspot.com/339270043/
Affected files (+84, -8 lines):
M Documentation/changes.tely
M Documentation/notation/fretted-strings.itely
A input/regression/fret-diagrams-left-handed.ly
M scm/define-grob-properties.scm
M scm/fret-diagrams.scm
Index: Documentation/changes.tely
diff --git a/Documentation/changes.tely b/Documentation/changes.tely
index
1a4fcc59e51b93cf5d7792a7ba6a135907c627f0..7f726381be7aa5bac00b211936fd3baff1494d6d
100644
--- a/Documentation/changes.tely
+++ b/Documentation/changes.tely
@@ -62,6 +62,19 @@ which scares away people.
@end ignore
@item
+Fret-diagrams may now be printed left-handed, setting @code{left-handed} to
address@hidden (as a subproperty of @code{fret-diagram-details}).
address@hidden,quote]
+\markup
+ \center-column {
+ "C"
+ "(left-handed)"
+ \override #'(fret-diagram-details . ((left-handed . #t)))
+ \fret-diagram "6-x;5-3-3;4-2-2;3-o;2-1;1-o;"
+ }
address@hidden lilypond
+
address@hidden
The @code{output-classic-framework} procedure and the @code{-dclip-systems}
are now available with the @code{SVG} backend.
Index: Documentation/notation/fretted-strings.itely
diff --git a/Documentation/notation/fretted-strings.itely
b/Documentation/notation/fretted-strings.itely
index
a93627a871894a848db2aedf1a58da5859889fcd..a57463376418fabb3e012f269d190f048b926067
100644
--- a/Documentation/notation/fretted-strings.itely
+++ b/Documentation/notation/fretted-strings.itely
@@ -930,6 +930,20 @@ markup string.
>>
@end lilypond
address@hidden left-handed fret-diagrams
+
+Fret-diagrams may be printed left-handed
+
address@hidden,quote]
+\markup
+ \center-column {
+ "C"
+ "(left-handed)"
+ \override #'(fret-diagram-details . ((left-handed . #t)))
+ \fret-diagram "6-x;5-3-3;4-2-2;3-o;2-1;1-o;"
+ }
address@hidden lilypond
+
@cindex fret-diagram-terse markup
@funindex \fret-diagram-terse
Index: input/regression/fret-diagrams-left-handed.ly
diff --git a/input/regression/fret-diagrams-left-handed.ly
b/input/regression/fret-diagrams-left-handed.ly
new file mode 100644
index
0000000000000000000000000000000000000000..fc92f7893fd1cf5a91a44cea8c88508bee22d3e7
--- /dev/null
+++ b/input/regression/fret-diagrams-left-handed.ly
@@ -0,0 +1,32 @@
+\header {
+texidoc = "
+Fret-diagrams may be printed left-handed
+"
+}
+
+\version "2.19.21"
+
+fretTst = {
+ %% C major for guitar
+ c'1 ^\markup { \fret-diagram "6-x;5-3-3;4-2-2;3-o;2-1;1-o;"}
+}
+
+\new Voice {
+ \textLengthOn
+ \fretTst
+ \once \override TextScript.fret-diagram-details.left-handed = ##t
+ \fretTst
+ \bar "||"
+ \override TextScript.fret-diagram-details.orientation =
+ #'landscape
+ \fretTst
+ \once \override TextScript.fret-diagram-details.left-handed = ##t
+ \fretTst
+ \bar "||"
+ \override TextScript.fret-diagram-details.orientation =
+ #'opposing-landscape
+ \fretTst
+ \once \override TextScript.fret-diagram-details.left-handed = ##t
+ \fretTst
+ \bar "|."
+}
Index: scm/define-grob-properties.scm
diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm
index
0acc741f1cb93ad13ffa151b8fafc745df9037f0..4dcfa08f003e4c52ba8c28bdb65d4bd45258d9a5
100644
--- a/scm/define-grob-properties.scm
+++ b/scm/define-grob-properties.scm
@@ -398,6 +398,9 @@ address@hidden
@address@hidden, @code{LEFT}, or @code{DOWN} for left or down; @code{1},
@code{RIGHT}, or @code{UP} for right or up. Default @code{RIGHT}.
@item
address@hidden -- Print the fret-diagram left- or right-handed.
+Default @code{#f}.
address@hidden
@code{mute-string} -- Character string to be used to indicate muted
string. Default @code{\"x\"}.
@item
Index: scm/fret-diagrams.scm
diff --git a/scm/fret-diagrams.scm b/scm/fret-diagrams.scm
index
6dda45292852bdc0937521eda8abb1286d343b91..085511c4c105087f1ff7ac15bf038906be337246
100644
--- a/scm/fret-diagrams.scm
+++ b/scm/fret-diagrams.scm
@@ -304,8 +304,12 @@ with magnification @var{mag} of the string @var{text}."
(details (merge-details 'fret-diagram-details props '()))
(fret-distance
(assoc-get 'fret-distance details 1.0))
- (string-distance
+ (string-distance-from-details
(assoc-get 'string-distance details 1.0))
+ ;; disable negative `string-distance'
+ ;; mmh -- should we print a message/warning?
+ (string-distance (abs string-distance-from-details))
+ (left-handed (assoc-get 'left-handed details #f))
(string-count
(assoc-get 'string-count details 6)) ;; needed for everything
(my-fret-count
@@ -358,13 +362,23 @@ with magnification @var{mag} of the string
@var{text}."
"Return a pair @code{(x-coordinate . y-coordinate)}
in stencil coordinate system."
(cond
- ((eq? orientation 'landscape)
- (cons fret-coordinate
- (- string-coordinate (1- string-count))))
- ((eq? orientation 'opposing-landscape)
- (cons (- fret-coordinate) (- string-coordinate)))
- (else
- (cons string-coordinate (- fret-coordinate)))))
+ ((and (eq? orientation 'landscape) left-handed)
+ (cons fret-coordinate
+ (- (- string-coordinate (1- string-count)))))
+ ((eq? orientation 'landscape)
+ (cons fret-coordinate
+ (- string-coordinate (1- string-count))))
+ ((and (eq? orientation 'opposing-landscape) left-handed)
+ (cons (- fret-coordinate)
+ (- string-coordinate (1- string-count))))
+ ((eq? orientation 'opposing-landscape)
+ (cons (- fret-coordinate)
+ (- (- string-coordinate (1- string-count)))))
+ (left-handed
+ (cons (- string-coordinate) (- fret-coordinate)))
+ (else
+ (cons string-coordinate (- fret-coordinate)))))
+
(define (stencil-coordinate-offset fret-offset string-offset)
"Return a pair @code{(x-offset . y-offset)}
- Allow left-handed fret-markups (issue 339270043 by address@hidden),
thomasmorley65 <=