syllabify : prise en compte langues sans espace insécable avant les
[nenuvar.git] / common / common.ily
blob8b4cd508745b5aa5876e34de1b7d9b6e43df70c9
1 \version "2.17.16"
3 #(use-modules (srfi srfi-39))
4 #(define-public *staff-size*
5   (make-parameter (let ((module (ly:output-def-scope
6                                  (ly:parser-lookup (eval 'parser (current-module))
7                                                    '$defaultpaper))))
8                     (/ (module-ref module 'staff-height)
9                        (eval 'pt module)))))
11 \layout {
12   incipit-width = #(* (*staff-size*)
13                       (if (defined? 'reference-incipit-width)
14                           reference-incipit-width
15                           (* (/ 15.0 20.0) mm)))
18 %% Font
19 \paper {
20   #(define fonts (set-global-fonts
21                   #:music "scorlatti"
22                   #:factor (/ staff-height pt 20)))
24 \layout {
25   \context {
26     \FiguredBass
27     \override BassFigure.font-name = #"Cochin Bold" 
28     \override BassFigure.font-size = #2
29   }
32 \include "common/includes.ily"
33 \include "common/clef-key.ily"
34 \include "common/titling.ily"
35 \include "common/toc-columns.ily"
36 \include "common/music-commands.ily"
37 \include "common/baroque.ily"
38 \include "common/marks.ily"
39 \include "common/staff.ily"
40 \include "common/layout.ily"
41 \include "common/reduction.ily"
43 %%% Title page
44 %%%
46 #(define-markup-command (tagline-vspacer layout props) ()
47    (interpret-markup
48     layout props
49     #{ \markup\abs-fontsize #10 \with-color #white \char ##x01C0 #}))
51 \header {
52   maintainer = "Nicolas Sceaux"
53   maintainerEmail = "nicolas.sceaux@gmail.com"
54   maintainerWeb = "http://nicolas.sceaux.free.fr"
55   copyright = \markup\copyright
56   license = "Creative Commons Attribution-ShareAlike 4.0 License"
57   shortcopyright = \markup { \copyright — \license }
58   longcopyright = \markup\column {
59     \vspace #1
60     \fill-line { \copyright }
61     \fill-line { \license }
62   }
63   
64   tagline = \markup\sans\abs-fontsize #8 \override #'(baseline-skip . 0) {
65     \right-column\bold {
66       \with-url #"http://nicolas.sceaux.free.fr" {
67         \concat { Éditions \tagline-vspacer }
68         \concat { Nicolas \tagline-vspacer }
69         \concat { Sceaux \tagline-vspacer }
70       }
71     }
72     \abs-fontsize #9 \with-color #(x11-color 'grey40) \raise #-0.7 \musicglyph #"clefs.petrucci.f"
73     \column {
74       \line { \tagline-vspacer \copyright }
75       \smaller\line {
76         \tagline-vspacer
77         Sheet music from
78         \with-url #"http://nicolas.sceaux.free.fr"
79         \typewriter\smaller http://nicolas.sceaux.free.fr
80         typeset using \with-url #"http://lilypond.org" LilyPond
81         on \concat { \today . }
82       }
83       \smaller\line {
84         \tagline-vspacer \license
85         — free to download, distribute, modify and perform.
86       }
87     }
88   }
91 #(define-markup-command (nenuvar-footer layout props side)
92      (number?)
93    (interpret-markup
94     layout props
95     (cond ((and (= 1 (chain-assoc-get 'page:page-number props -1))
96                 (not (and (chain-assoc-get 'page:is-bookpart-last-page
97                                            props #f)
98                           (chain-assoc-get 'page:is-last-bookpart
99                                            props #f))))
100            ;; Book first page
101            #{ \markup\fill-line { \fromproperty #'header:tagline } #})
102           ((and (chain-assoc-get 'page:is-bookpart-last-page props #f)
103                 (chain-assoc-get 'page:is-last-bookpart props #f))
104            ;; book last page
105            #{ \markup\fill-line { \fromproperty #'header:tagline } #})
106           ((= side LEFT)
107            ;; even pages
108            #{ \markup\fill-line {
109   \null \abs-fontsize #6 \fromproperty #'header:shortcopyright } #})
110           (else
111            ;; odd pages
112            #{ \markup\fill-line {
113   \abs-fontsize #6 \fromproperty #'header:shortcopyright \null } #}))))
115 \paper {
116   nenuvarBookTitleMarkup = \markup \when-property #'header:title \abs-fontsize #12 \column {
117     \null \null \null \null \null \null
118     \fill-line { \fontsize #6 \italic \fromproperty #'header:composer }
119     \when-property #'header:poet \column { \null \null \null }
120     \fill-line { \fontsize #6 \italic \fromproperty #'header:poet }
121     \null \null \null \null \null \null
122     \fontsize #12 \fill-line {
123                  \apply-fromproperty #make-smallCaps-markup #'header:title }
124     \null \null \null \null \null \null
125     \fill-line { \postscript #(format #f "~a 0 moveto ~a 0 rlineto stroke"
126                                (/ -400 (*staff-size*))
127                                (/ 800 (*staff-size*)))
128                              }
129     \null \null \null \null \null \null
130     \fill-line { \fontsize #4 \fromproperty #'header:date }
131     \null
132     \on-the-fly #(lambda (layout props arg)
133                    (if (*part*)
134                        (interpret-markup layout props
135                          (markup #:column (#:null #:null
136                                            #:fill-line (#:fontsize 4 (*part-name*)))))
137                        empty-stencil))
138     \null \null \null \null
139     \fill-line { \fontsize #2 \fromproperty #'header:editions }
140     \fill-line { \fontsize #2 \fromproperty #'header:arrangement }
141   }
142   bookTitleMarkup = \nenuvarBookTitleMarkup
143   shortBookTitleMarkup =  \markup {
144     \override #'(baseline-skip . 3.5) \column {
145       \huge \larger \bold \fill-line { \larger \fromproperty #'header:title }
146       \huge \fill-line { \fromproperty #'header:subtitle }
147       \fill-line {
148         \fromproperty #'header:poet
149         \on-the-fly #(lambda (layout props arg)
150                       (if (*part*)
151                        (interpret-markup layout props (markup (*part-name*)))
152                        empty-stencil)) \null
153         \fromproperty #'header:composer
154       }
155       \fill-line {
156         \null
157         \fromproperty #'header:date
158       }
159     }
160   }
161   scoreTitleMarkup = #f
163   oddFooterMarkup = \markup\nenuvar-footer #RIGHT
164   evenFooterMarkup = \markup\nenuvar-footer #LEFT
166   tocTitle = "TABLE DES MATIÈRES"
170 %%% The following hack make regular rests hara-kiri-able
172 #(let* ((rest-def (assoc 'Rest all-grob-descriptions))
173         (meta-def (assoc 'meta (cdr rest-def)))
174         (interfaces-def (assoc 'interfaces (cdr meta-def)))
175         (interfaces (filter (lambda (interface)
176                               (not (eqv? interface 'rhythmic-grob-interface)))
177                             (cdr interfaces-def))))
178   (set-cdr! interfaces-def interfaces))