%% Generated by lilypond-book
%% Options: [exampleindent=10.16\mm,indent=0\mm,line-width=160\mm,paper-height=845.047\pt,paper-width=597.508\pt,papersize='(cons (* 597.508 pt) (* 845.047 pt))]
\include "lilypond-book-preamble.ly"


% ****************************************************************
% Start cut-&-pastable-section
% ****************************************************************

#(ly:set-option 'eps-box-padding 3.000000)



\paper {
  #(set-paper-size '(cons (* 597.508 pt) (* 845.047 pt)))
  indent = 0\mm
  line-width = 160\mm
  % offset the left padding, also add 1mm as lilypond creates cropped
  % images with a little space on the right
  line-width = #(- line-width (* mm  3.000000) (* mm 1))
}

\layout {
  
}




% ****************************************************************
% ly snippet:
% ****************************************************************
\sourcefilename "snippets/different-font-size-settings-for-instrumentname-and-shortinstrumentname.ly"
\sourcefileline 0
%% DO NOT EDIT this file manually; it was automatically
%% generated from the LilyPond Wiki
%% (https://wiki.lilypond.community).
%%
%% Make any changes in the Wiki itself, or in
%% `Documentation/snippets/new/`, then run
%% `scripts/auxiliar/makelsr.pl`.
%%
%% This file is in the public domain.

\version "2.24.0"

\header {
%% Translation of GIT committish: c043783aac6c35926d633aa2daf60ed4f2e7ca7a
  texidocfr = "
Une simple dérogation à un contexte particulier permet de différencier
la taille des variables @var{instrumentName} et
@var{shortInstrumentName}.
"

  doctitlefr = "Taille de police différente pour @code{instrumentName} et @code{shortInstrumentName}"

%% Translation of GIT committish: 70abecb938c2bb752967bd56b7402dd8129838a5
  texidoces = "
Elegir distintos tamaños de fuente para @code{instrumentName} y
@code{shortInstrumentName} como una sobreescritura de contexto.
"

  doctitlees = "Diferentes tamaños de fuente para @code{instrumentName} y @code{shortInstrumentName}"

  categories = "Editorial annotations, Scheme"

  texidoc = "
Choose different font sizes for @code{instrumentName} and
@code{shortInstrumentName} as a context override.
"

  doctitle = "Different font size settings for instrumentName and shortInstrumentName"
} % begin verbatim


InstrumentNameFontSize =
#(define-music-function (font-size-pair) (pair?)
   "Set the font size of `InstrumentName` grobs.

The first value of FONT-SIZE-PAIR sets the font size of the initial
`instrumentName` property, the second value sets the font size of
`shortInstrumentName`."
   ;; This code could be changed or extended to set different values
   ;; for each occurrence of `shortInstrumentName'.
   #{
     \override InstrumentName.after-line-breaking =
       #(lambda (grob)
          (let* ((orig (ly:grob-original grob))
                 (siblings (if (ly:grob? orig)
                               (ly:spanner-broken-into orig)
                               '())))
            (when (pair? siblings)
              (ly:grob-set-property! (car siblings)
                                     'font-size (car font-size-pair))
              (for-each
               (lambda (g)
                 (ly:grob-set-property! g
                                        'font-size (cdr font-size-pair)))
               (cdr siblings)))))
   #})

\layout {
  indent = 3\cm
  short-indent = 0.8\cm

  \context {
    \Staff
    \InstrumentNameFontSize #'(6 . -3)
  }
}

\new StaffGroup <<
  \new Staff \with {
       instrumentName = "Flute"
       shortInstrumentName = "Fl." } {
    c''1 \break c'' \break c'' }
  \new Staff \with {
       instrumentName = "Violin"
       shortInstrumentName = "Vl." } {
    c''1 \break c'' \break c'' }
>>



% ****************************************************************
% end ly snippet
% ****************************************************************
