]> git.donarmstrong.com Git - lilypond.git/commitdiff
Show how to properly support the Gonville font.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 5 Mar 2010 05:07:04 +0000 (02:07 -0300)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 5 Mar 2010 05:07:04 +0000 (02:07 -0300)
Example in input/gonville.ly; it is not part of the regtest, since we
currently do not ship Gonville.  This still does not work for alphabet
glyphs, since those are still hardcoded to feta-alphabet, and are
loaded through Pango.

input/gonville.ly [new file with mode: 0644]
input/regression/gonville.ly [deleted file]
scm/font.scm

diff --git a/input/gonville.ly b/input/gonville.ly
new file mode 100644 (file)
index 0000000..1ee8e4a
--- /dev/null
@@ -0,0 +1,62 @@
+\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 
+}
diff --git a/input/regression/gonville.ly b/input/regression/gonville.ly
deleted file mode 100644 (file)
index cdb5289..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-\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)))
-  }
-}
index e7a388c7b8ed29f5e2cd1791b3d348de6c1ef4bb..ee5b08a4a298a61232eba079d5e494922d031f5a 100644 (file)
 ;; 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)