--- /dev/null
+\header {
+
+ texidoc = "Use an alternative music font (gonville). To use this,
+put gonville-20.otf and gonville-brace.otf in a directory where
+lilypond can find them (use the --include option to extend the search
+path)."
+
+}
+
+\version "2.13.6"
+
+\paper {
+ myStaffSize = 20
+
+ %% bogus statement, because myStaffSize must be assigned before
+ %% the scheme statement starts parsing.
+ bogus = 42
+
+ #(add-music-fonts fonts "gonville" 'gonville '(20)
+ (/ myStaffSize 20))
+}
+
+sampleMusic = \relative c'' {
+ a4-\trill_\f b8 c16 d32
+}
+
+
+{
+ \set Staff.instrumentName = #"Default"
+ \sampleMusic
+}
+
+\score {
+ {
+ \set Staff.instrumentName = #"Feta"
+ \sampleMusic
+ }
+ \layout {
+ #(define font-defaults
+ '((font-family . feta) (font-encoding . fetaMusic)))
+ }
+}
+
+\score {
+ \relative c'' {
+ \set Staff.instrumentName = #"Gonv"
+ \sampleMusic
+ }
+ \layout {
+ #(define font-defaults
+ '((font-family . gonville) (font-encoding . fetaMusic)))
+ }
+}
+
+\relative c''
+{
+ \set Staff.instrumentName = #"Gonv override"
+ c2^\trill c
+ \override NoteHead #'font-family = #'gonville
+ \override Script #'font-family = #'gonville
+ c^\trill c
+}
+++ /dev/null
-\header {
-
- texidoc = "The default music font can be overridden by setting
- @code{(font-family . gonville)} in the @code{font-defaults} in the
- paper block."
-
-}
-
-\version "2.13.6"
-
-\paper {
- % Load the alternative font definitions into the font tree.
-% temporarily disabled to allow a release. -gp
-% #(add-music-fonts fonts "gonville" 'gonville (/ staff-height (* 20 pt)))
-}
-
-%{
- Note: for this to work, do something like
-
- wget -P out http://www.chiark.greenend.org.uk/~sgtatham/gonville/gonville-r8724.tar.gz
- tar xzf out/gonville-r8724.tar.gz
- ln out/gonville-r8724/lilyfonts/otf/gonville* out/share/lilypond/current/fonts/otf/
- (cd out/share/lilypond/current/fonts/otf && for i in gonville*; do mv $i $(echo $i | sed s/gonville/gonville-/); done)
-
-
- To show all available fonts, do
-
- lilypond -dshow-available-fonts blabla
-
-%}
-
-\relative c'' {
- \set Staff.instrumentName = #"Default"
- a4-\trill b8 c16 d32
-}
-
-\score {
- \relative c'' {
- \set Staff.instrumentName = #"Feta"
- a4-\trill b8
- c16 d32
- }
- \layout {
- #(define font-defaults
- '((font-family . feta) (font-encoding . fetaMusic)))
- }
-}
-
-\score {
- \relative c'' {
-% temporarily disabled to allow a release. -gp
-% \set Staff.instrumentName = #"Gonville"
- a4-\trill b8 c16 d32
- }
- \layout {
- #(define font-defaults
- '((font-family . gonville) (font-encoding . fetaMusic)))
- }
-}
;; Each size family is a vector of fonts, loaded with a delay. The
;; vector should be sorted according to ascending design size.
(define-public (add-music-fonts node name family design-size-list factor)
- "Add fonts to NODE. DESIGN-SIZE-LIST is a list of numbers."
+ "Setup music fonts.
+
+Arguments:
+ NODE the font tree to modify.
+ NAME is the basename for the music font. NAME-DESIGNSIZE.otf should be the music font,
+ NAME-brace.otf should have piano braces.
+ DESIGN-SIZE-LIST is a list of numbers, used as suffix for font filenames
+ FACTOR is size factor relative to default size that is being used. This is used
+ to select the proper design size for text fonts.
+"
(for-each
(lambda (x)
(add-font node
(define-public (make-pango-font-tree roman-str sans-str typewrite-str factor)
(let ((n (make-font-tree-node 'font-encoding 'fetaMusic)))
(add-music-fonts n "emmentaler" 'feta '(11 13 14 16 18 20 23 26) factor)
-;; Let's not do this [yet], see input/regression/gonville.ly
-;; (add-music-fonts n "gonville" 'gonville factor)
(add-pango-fonts n 'roman roman-str factor)
(add-pango-fonts n 'sans sans-str factor)
(add-pango-fonts n 'typewriter typewrite-str factor)