+1.3.97.jcn1
+===========
+
+* Added some interface documentation.
+
+* Added raise and kern to markup. This should make Chord names usable.
+
+
1.3.96.jcn10
============
MAJOR_VERSION=1
MINOR_VERSION=3
PATCH_LEVEL=97
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=jcn1
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
;(((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . (super "o7"))
;jazz: the delta, see jazz-chords.ly
- (((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . (super ((family . "math") "N")))
+ (((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . (super ((font-family . "math") "N")))
+ (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (rows ((raise . 1) "o") ((raise . 0.5) ((kern . -0.5) ((font-size . "-3") "/"))) "7")) ; slashed o
;(((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (super "x7"))
; slashed o
- (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (rows (super "o") ((kern . -0.5) ((size . "-3") "/")) "7"))
)
chord::names-alist-american))
d-\textscript #'(lines "one" "two" "three")
e-\textscript #'(lines (bold "one")
- (rows "and" "there" "is" ((family . "number") "2"))
+ (rows "and" "there" "is" ((font-family . "number") "2"))
(italic "three"))
f-\textscript #'(finger "3")
g-\textscript #'(music (named "noteheads-2"))
linewidth = -1.\mm;
\translator{
\ScoreContext
- TextScript \push #'font-family = #'roman
+ TextScript \push #'font-family = #"roman"
TextScript \pop #'no-spacing-rods
TextScript \push #'direction = #1
}
SCM markup = gh_car (markup_sentence);
SCM sentence = gh_cdr (markup_sentence);
SCM f = get_elt_property (me, "markup-to-properties");
- SCM p = gh_cons (gh_call1 (f, markup), properties);
+ SCM p = gh_append2 (gh_call1 (f, markup), properties);
Axis align = X_AXIS;
SCM a = scm_assoc (ly_symbol2scm ("align"), p);
if (gh_pair_p (a) && gh_number_p (gh_cdr (a)))
align = (Axis)gh_scm2int (gh_cdr (a));
+ Real staff_space = Staff_symbol_referencer::staff_space (me);
+ Real kern = 0;
+ SCM k = scm_assoc (ly_symbol2scm ("kern"), p);
+ if (gh_pair_p (k) && gh_number_p (gh_cdr (k)))
+ kern = gh_scm2double (gh_cdr (k)) * staff_space;
+
+ Real raise = 0;
+ SCM r = scm_assoc (ly_symbol2scm ("raise"), p);
+ if (gh_pair_p (r) && gh_number_p (gh_cdr (r)))
+ raise = gh_scm2double (gh_cdr (r)) * staff_space;
+
+ Offset o (align == X_AXIS ? kern : 0,
+ (align == Y_AXIS ? - kern : 0) + raise);
+
Molecule mol;
while (gh_pair_p (sentence))
{
Molecule m = text2molecule (me, gh_car (sentence), p);
if (!m.empty_b ())
- mol.add_at_edge (align, align == X_AXIS ? RIGHT : DOWN, m, 0);
+ {
+ m.translate (o);
+ mol.add_at_edge (align, align == X_AXIS ? RIGHT : DOWN, m, 0);
+ }
sentence = gh_cdr (sentence);
}
return mol;
(((0 . 0) (2 . 0) (4 . 0) (6 . -1)) . ("7"))
(((0 . 0) (2 . -1) (4 . 0) (6 . 0)) . ("m(maj7)"))
;jazz: the delta, see jazz-chords.ly
- ;(((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . (super ((family . "math") "N"))
- (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (rows (super "o") ((kern . -0.5) ((size . "-3") "/")) "7")) ; slashed o
+ ;;(((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . (super ((font-family . "math") "N"))
+ ;; slashed o
+ (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (rows ((raise . 1) "o") ((raise . 0.5) ((kern . -0.5) ((font-size . "-3") "/"))) "7")) ; slashed o
(((0 . 0) (2 . 0) (4 . 1) (6 . -1)) . ("aug7"))
(((0 . 0) (2 . 0) (4 . -1) (6 . 0)) . (rows "maj7" (music (named ("accidentals--1"))) "5"))
(((0 . 0) (3 . 0) (4 . 0) (6 . -1)) . ("7sus4"))
(list
(append '(named)
(list
- (string-append "accidentals-"
- (number->string (caddr pitch)))))))))))
+ (append '((font-size . "-2"))
+ (list
+ (string-append "accidentals-"
+ (number->string (caddr pitch)))))))))))))
(define (step->text pitch)
'(font-series font-shape font-family font-name font-point font-size)))))
(font-regexp-to-font-name paper font-regexp)))
-(define markup-to-properties-alist
- '(
- (style . font-style)
- (series . font-series)
- (shape . font-shape)
- (family . font-family)
- (name . font-name)
- (size . font-size)
- (point . font-point)
- (kern . kern)
- ))
-
(define markup-abbrev-to-properties-alist
(append
'(
- (rows . (align . 0))
- (lines . (align . 1))
- (roman . (font-family . "roman"))
- (music . (font-family . "music"))
- (bold . (font-series . "bold"))
- (italic . (font-shape . "italic"))
- (named . (lookup . name))
- (text . (lookup . value))
- ;; super needs some work
- (super . (font-size . "-1")))
+ (rows . ((align . 0)))
+ (lines . ((align . 1)))
+ (roman . ((font-family . "roman")))
+ (music . ((font-family . "music")))
+ (bold . ((font-series . "bold")))
+ (italic . ((font-shape . "italic")))
+ (named . ((lookup . name)))
+ (super . ((raise . 1) (font-size . "-1")))
+ (sub . ((raise . -1) (font-size . "-1")))
+ (text . ((lookup . value)))
+ )
(map (lambda (x) (cons (car x) (cons 'font-style (car x))))
style-to-font-alist)))
(define (markup-to-properties markup)
+ ;; (display "markup: `")
+ ;;(display markup)
+ ;;(display "'\n")
(if (pair? markup)
- (cons (cdr (assoc (car markup) markup-to-properties-alist)) (cdr markup))
- (cdr (assoc markup markup-abbrev-to-properties-alist))))
+ (list markup)
+ (let ((entry (assoc markup markup-abbrev-to-properties-alist)))
+ (if entry (cdr entry)
+ (list (cons markup #t))))))
(define (style-to-font-name paper style)
(let* ((entry (assoc style style-to-font-alist))
(property-description 'de-uglify-parameters list? "list of 3 real constants. They define the valid areas for the middle control points. Used in de_uglyfy. They are a bit empirical.")
(property-description 'details list? "alist containing contaning a few magic constants.")
(property-description 'attachment pair? "cons of symbols, '(LEFT-TYPE . RIGHT-TYPE), where both types may be alongside-stem, stem, head or loose-end")
+ (property-description 'attachment-offset pair? "cons of offsets, '(LEFT-offset . RIGHT-offset). This offset is added to the attachments to prevent ugly slurs.")
(property-description 'direction dir? "up or down?")
- (property-description 'y-free number? "? ")
- (property-description 'control-points list? "")
- (property-description 'extremity-rules list? "")
- (property-description 'extremity-offset-alist list? "")
- (property-description 'thickness list? "")
- (property-description 'dash number? "number representing the length of the dashes.")
+ (property-description 'beautiful number? "number that dictates when a slur should be de-uglyfied. It correlates with the enclosed area between noteheads and slurs. A value of 0.1 yields only undisturbed slurs, a value of 5 will tolerate quite high blown slurs.")
+ (property-description 'y-free number? "minimal vertical gap between slur and noteheads or stems")
+ (property-description 'control-points list? "[internal] control points of bezier curve")
+ (property-description 'extremity-rules list? "an alist (procedure slur dir) -> attachment to determine the attachment (see above). If procedure returns #t, attachment is used. Otherwise, the next procedure is tried.")
+ (property-description 'extremity-offset-alist list? "an alist (attachment stem-dir*dir slur-dir*dir) -> offset. The offset adds to the centre of the notehead, or stem.")
+ (property-description 'thickness list? "The thickness[stafflinethickness] of slur in the centre.")
+ (property-description 'dashed number? "[FIXME: use dash-period/dash length; see text-spanner] number representing the length of the dashes.")
)
)
)
-
-(define text-spanner-interface
- (lily-interface
- 'text-spanner-interface
- "generic text spanner"
- (list
- (property-description 'dash-period number? "")
- (property-description 'dash-length number? "")
- (property-description 'line-thickness number? "")
- (property-description 'edge-height pair? "(leftheight . rightheight)")
- (property-description 'edge-text pair? "(lefttext . righttext)")
- (property-description 'text-style string? "") ; SYMBOL!!?
- (property-description 'type string? "line, dashed-line or dotted-line") ; SYMBOL!!?
- )
-))
-
(define hairpin-interface
(lily-interface
'hairpin-interface
(define text-interface
(lily-interface
'text-interface
- "A text"
- (list
- (property-description 'text string? "")
- (property-description 'style string? "")
+ "A scheme markup text"
+ (list
+ (property-description 'text (lambda (x) (or (string? x) (list? x))) "the scheme markup text. Either a string, or a list of which the CAR is a markup '(MARKUP text text ...). MARKUP is either a CONS: an element property '(key . value) or a symbol: an abbreviation for a list of element properties. These abbreviations are currently defined: rows lines roman music bold italic named super sub text, as well as all font-style's.")
+ (property-description 'font-style string? "font definition for a special purpose, one of: finger volta timesig mark script large Large dynamic")
+ (property-description 'font-series string? "partial font definition: medium, bold")
+ (property-description 'font-shape string? "partial font definition: upright or italic")
+ (property-description 'font-family string? "partial font definition: music roman braces dynamic math ...")
+ (property-description 'font-name string? "partial font definition: base name of font file FIXME: should override other partials")
+ (property-description 'font-point string? "partial font definition: exact font size in points FIXME: should override font-size")
+ (property-description 'font-size string? "partial font definition: the relative size, 0 is style-sheet's normal size, -1 is smaller, +1 is bigger")
+ (property-description 'align number? "the alignment of the text, 0 is horizontal, 1 is vertical")
+ (property-description 'lookup symbol? "lookup method: 'value for plain text, 'name for character-name")
+ (property-description 'raise number? "height for text to be raised (a negative value lowers the text")
+ (property-description 'kern number? "amount of extra white space to add before text. This is `relative'(?) to the current alignment.")
+ (property-description 'magnify number? "the magnification factor. FIXME: doesn't work for feta fonts")
)))
)))
+(define text-spanner-interface
+ (lily-interface
+ 'text-spanner-interface
+ "generic text spanner"
+ (list
+ (property-description 'dash-period number? "the length of one dash + white space")
+ (property-description 'dash-length number? "the length of a dash")
+ (property-description 'line-thickness number? "the thickness[stafflinethickness] of the line")
+ (property-description 'edge-height pair? "a cons that specifies the heights of the vertical egdes '(LEFT-height . RIGHT-height)")
+ (property-description 'edge-text pair? "a cons that specifies the texts to be set at the edges '(LEFT-text . RIGHT-text)")
+ (property-description 'type string? "one of: line, dashed-line or dotted-line") ; SYMBOL!!?
+ )
+))
+
(define tie-interface
(lily-interface
'tie-interface
;; This list defines the offsets for each type of attachment.
;; The format of each element is
-;; (stem-dir * dir . slur-dir * dir)
+;; (attachment stem-dir*dir slur-dir*dir)
;; Different attachments have different default points:
;;
;; head: Default position is centered in X, on outer side of head Y