Re: problem with installed font when set-global-staff-size is changed
Jonathan On 8/11/2015 5:15 PM, jonathan.scholbach [via Lilypond] wrote: (Setting the font-sizes manually is necessary since for some unknown reason, the font-size decreases.) This is because virtually everything that has any kind of font property is scaled relative to the staff-height. So, at 20pt staff-height, a 12pt font looks just right, but at 17pt staff-height, it ends up being scaled down to 12*(17/20) = 10.2pt. There are ways around this, though. Markups have the \abs-fontsize macro, but there isn't a built-in one for anything else, like Lyrics. A really nice macro was put together by Mike Solomon so the absolute nature of font size can be applied to any other kind of text object. Here's the code for it: allowGrobCallback = #(define-scheme-function (parser location syms) (symbol-list?) (let ((interface (car syms)) (sym (cadr syms))) #{ \with { \consists #(lambda (context) `((acknowledgers . ((,interface . ,(lambda (engraver grob source-engraver) (let ((prop (ly:grob-property grob sym))) (if (procedure? prop) (ly:grob-set-property! grob sym (prop grob))) ))) } #})) absFontSize = #(define-scheme-function (parser location pt)(number?) (lambda (grob) (let* ((layout (ly:grob-layout grob)) (ref-size (ly:output-def-lookup (ly:grob-layout grob) 'text-font-size 12))) (magnification-font-size (/ pt ref-size)) ))) \layout { \context { \Score \allowGrobCallback font-interface.font-size } } which you then can use like this: \override LyricText.font-size = \absFontSize 11.5 Without this, then to get back up to 12pt you'd need to manually increase the font-size, which is what you've learned already. Regards, Abraham -- View this message in context: http://lilypond.1069038.n5.nabble.com/problem-with-installed-font-when-set-global-staff-size-is-changed-tp179484p179539.html Sent from the User mailing list archive at Nabble.com.___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: problem with installed font when set-global-staff-size is changed
Am 11.08.2015 um 18:19 schrieb Jonathan Scholbach: Hi! I would like to use the Garamond font for all the text in my sheet (header, lyrics, markup). I downloaded the EBGaramond from http://www.georgduffner.at/ebgaramond/download.html and put all the .otf-files into the directory lilypond/usr/share/lilypond/current/fonts/otf Nearly everything works fine, but Lilypond seems to have problems with scaling, as my ME shows. The lyrics between the staves are not printed in Garamond font when the global-staff-size is changed. The problem is that setting staff size overrides the previous font settings, so you have to first change staff size, then change the fonts. Normally this would mean inserting #(set-global-staff-size 21) _before_ the paper block; with #layout-set-staff-size however, I don’t know of any solution. HTH, Simon ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: problem with installed font when set-global-staff-size is changed
Hi Simon, thank you for your advice! Just for people reading my question in the future: Your hint lead me to solve the problem with \layout { #(layout-set-staff-size 17) \override LyricText.font-name = EBGaramond \override LyricText.font-size = #2 \override Score.BarNumber.font-name = EBGaramond \override Score.BarNumber.font-size = #2 \override Staff.InstrumentName.font-name = EBGaramond \override Staff.InstrumentName.font-size = #2 } (Setting the font-sizes manually is necessary since for some unknown reason, the font-size decreases.) For my purposes that is an acceptable workaround. Greets, Jonathan On 08/11/2015 07:31 PM, Simon Albrecht wrote: Am 11.08.2015 um 18:19 schrieb Jonathan Scholbach: Hi! I would like to use the Garamond font for all the text in my sheet (header, lyrics, markup). I downloaded the EBGaramond from http://www.georgduffner.at/ebgaramond/download.html and put all the .otf-files into the directory lilypond/usr/share/lilypond/current/fonts/otf Nearly everything works fine, but Lilypond seems to have problems with scaling, as my ME shows. The lyrics between the staves are not printed in Garamond font when the global-staff-size is changed. The problem is that setting staff size overrides the previous font settings, so you have to first change staff size, then change the fonts. Normally this would mean inserting #(set-global-staff-size 21) _before_ the paper block; with #layout-set-staff-size however, I don’t know of any solution. HTH, Simon ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user