From: Han-Wen Nienhuys Date: Fri, 5 Mar 2010 05:07:04 +0000 (-0300) Subject: Show how to properly support the Gonville font. X-Git-Tag: release/2.13.16-1~54 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c5ba96d235fb8c532773030cb44a641d5e23dff7;p=lilypond.git Show how to properly support the Gonville font. 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. --- diff --git a/input/gonville.ly b/input/gonville.ly new file mode 100644 index 0000000000..1ee8e4a649 --- /dev/null +++ b/input/gonville.ly @@ -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 index cdb528970a..0000000000 --- a/input/regression/gonville.ly +++ /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))) - } -} diff --git a/scm/font.scm b/scm/font.scm index e7a388c7b8..ee5b08a4a2 100644 --- a/scm/font.scm +++ b/scm/font.scm @@ -152,7 +152,16 @@ ;; 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 @@ -203,8 +212,6 @@ (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)