Re: Use TTF font for text in working directory?

2020-12-07 Thread Werner LEMBERG


> Is it somehow possible to tell Lilypond to look for the .ttf file in
> the working directory, ie. the directory in which the .ly file is
> that is being compiled?

Yes.  Here's some documentation from the current development version;
the two mentioned scheme functions, however, are present in 2.20, too.

  Finding fonts
  -

  In addition to any font already installed on the operating system,
  more fonts may be added to the ones detected by FontConfig (and thus
  available in LilyPond scores) by the following commands:

#(ly:font-config-add-font "path/to/font-file")
#(ly:font-config-add-directory "path/to/directory/")

  Both commands accept either absolute or relative paths, which makes
  it possible to compile a score on any system by simply distributing
  the relevant font files together with the LilyPond input files.

For your case it should be thus sufficient to add

  #(ly:font-config-add-directory ".")

at the top of your main `.ly` file (assuming that you call the
`lilypond` binary while being in this directory).


Werner



Re: horizontal position of augmentation dots

2020-12-07 Thread Knute Snortum
When you read the documentation for an interface, check the bottom of the
page for "This object supports the following interface(s):".  In this case
it's the grob-interface that has the extra-offset property.

--
Knute Snortum



On Sun, Dec 6, 2020 at 8:10 AM Richard Shann 
wrote:

> On Sun, 2020-12-06 at 16:52 +0100, Pierre Perol-Schneider wrote:
> > Hi Richard,
> > How about:
> >
> > \version "2.20.0"
> > A = {f2~  f8. s16 s4 }
> > B = {bes,2~
> >  \tweak Dots.extra-offset #'(-.8 . 0)
> >  bes,8. bes,32 a, bes,16 c d e }
> >
> > \score {
> > \new Staff  <<
> >  \new Voice   {\voiceOne \clef bass \A }
> >  \new Voice   {\voiceTwo \B }
> > >>
> >}
>
> Thank you! I'm disconcerted that I didn't find this for myself. I got
> to this page
> https://lilypond.org/doc/v2.18/Documentation/internals/dots
> but it didn't seem to lead to extra-offset as a property... I suppose I
> need to tweak LilyPond so rarely that I get out of practice at finding
> things in the documentation (this was my first bit of polyphony for ten
> years!).
>
> Richard
>
>
> >
> > Cheers,
> > Pierre
> >
> > Le dim. 6 déc. 2020 à 15:32, Richard Shann 
> > a écrit :
> > > I struck me that this score:
> > >
> > > 8><8><8><8><8><8><8><8><8><8><8><8><8><8><
> > > \version "2.20.0"
> > > A = {f2~  f8. s16 s4 }
> > > B = {bes,2~  bes,8. bes,32 a, bes,16 c d e }
> > >
> > > \score {
> > > \new Staff  <<
> > >  \new Voice   {\voiceOne \clef bass \A }
> > >  \new Voice  {\voiceTwo \B }
> > > >>
> > >}
> > > 8><8><8><8><8><8><8><8><8><8><8><8><8><8><
> > >
> > > has the lower dotted note vertically aligned with the upper one
> > > (see
> > > attached pdf). I thought it might be nicer to move the lower dot
> > > closer
> > > to its notehead, but I couldn't find out how to do that. With a lot
> > > of
> > > things there are properties to tweak but this didn't seem to the
> > > the
> > > case for augmentation dots.
> > > Perhaps someone could steer me in the right direction?
> > >
> > > Richard Shann
> > >
>
>


Re: horizontal position of augmentation dots

2020-12-07 Thread Richard Shann
On Mon, 2020-12-07 at 07:56 -0800, Knute Snortum wrote:
> When you read the documentation for an interface, check the bottom of
> the page for "This object supports the following interface(s):".  In
> this case it's the grob-interface that has the extra-offset property.

Ah, yes, thank you. It's a sort of multiple inheritance thing I
guess...

Richard


> --
> Knute Snortum
> 
> 
> 
> On Sun, Dec 6, 2020 at 8:10 AM Richard Shann  > wrote:
> > On Sun, 2020-12-06 at 16:52 +0100, Pierre Perol-Schneider wrote:
> > > Hi Richard,
> > > How about:
> > > 
> > > \version "2.20.0"
> > > A = {f2~  f8. s16 s4 }
> > > B = {bes,2~  
> > >      \tweak Dots.extra-offset #'(-.8 . 0)
> > >      bes,8. bes,32 a, bes,16 c d e }
> > > 
> > > \score {
> > > \new Staff  << 
> > >  \new Voice   {\voiceOne \clef bass \A }
> > >  \new Voice   {\voiceTwo \B }
> > >             >> 
> > >        }
> > 
> > Thank you! I'm disconcerted that I didn't find this for myself. I
> > got
> > to this page
> > https://lilypond.org/doc/v2.18/Documentation/internals/dots
> > but it didn't seem to lead to extra-offset as a property... I
> > suppose I
> > need to tweak LilyPond so rarely that I get out of practice at
> > finding
> > things in the documentation (this was my first bit of polyphony for
> > ten
> > years!).
> > 
> > Richard
> > 
> > 
> > > 
> > > Cheers,
> > > Pierre
> > > 
> > > Le dim. 6 déc. 2020 à 15:32, Richard Shann  > om>
> > > a écrit :
> > > > I struck me that this score:
> > > > 
> > > > 8><8><8><8><8><8><8><8><8><8><8><8><8><8><
> > > > \version "2.20.0"
> > > > A = {f2~  f8. s16 s4 }
> > > > B = {bes,2~  bes,8. bes,32 a, bes,16 c d e }
> > > > 
> > > > \score {
> > > > \new Staff  << 
> > > >  \new Voice   {\voiceOne \clef bass \A }
> > > >  \new Voice  {\voiceTwo \B }
> > > > >> 
> > > >    }
> > > > 8><8><8><8><8><8><8><8><8><8><8><8><8><8><
> > > > 
> > > > has the lower dotted note vertically aligned with the upper one
> > > > (see
> > > > attached pdf). I thought it might be nicer to move the lower
> > dot
> > > > closer
> > > > to its notehead, but I couldn't find out how to do that. With a
> > lot
> > > > of
> > > > things there are properties to tweak but this didn't seem to
> > the
> > > > the
> > > > case for augmentation dots.
> > > > Perhaps someone could steer me in the right direction?
> > > > 
> > > > Richard Shann
> > > > 
> > 
> > 



Re: Help a newb: Formatting custom instrument names

2020-12-07 Thread Hwaen Ch'uqi
Greetings Michael,

I believe that, in your \with block, you should add the following lines:

  fontSize = #-3
  \override StaffSymbol.staff-space = #(magstep -3)

Hth,

Hwaen Ch'uqi


On 12/7/20, Michael Blankenship  wrote:
> Hi,
>
> I’m trying to use an instrument name as a sort of clef for a 12 line staff,
> where a column of characters are engraved just before the staff and each row
> of characters lines up with one of the 11 staff spaces.
>
> So far I’ve only been able to assign the column of text to the instrument
> name, but it’s WAY to big and spaced out. I tried to find the commands to
> tweak the instrument name in the reference manuals, but I just couldn’t
> figure it out. I need to tweak the size of the font, the vertical scale
> (assuming the characters are evenly spaced vertically) and the position. Can
> anyone help out a hapless newbie?
>
> Here’s the code i’ve got so far:
> \new Staff \with {
> instrumentName = \markup {
>\roman {
>  \right-column {
>i/iɚ
>ɪ
>eɪ/ɛ/ɛɚ
>æ
>ʌ/ə
>aɪ/ɑ/ɑ˞/aʊ
>ɝ/ɚ
>ɔɪ/ɔ˞/ɔ
>oʊ
>ʊ
>uɚ/u
>} } }
>  shortInstrumentName = \markup {
>\roman {
>  \right-column {
>i
>ɪ
>ɛ
>æ
>ʌ
>ɑ
>ɝ
>ɔ
>oʊ
>ʊ
>u
>} } }
>   }
>
> and here’s a screen cap of the output so far:
>
>
>
>
> Best,
> Michael
>



Re: Use TTF font for text in working directory?

2020-12-07 Thread Stefan Hante

Hi Werner,

thank you for quick and precise answer. It worked just as you said.

I used this to build a small project to create a beginner ocarina 
songbook, where under each note the fingering for the ocarina is 
printed. The project is on Git:


https://github.com/StHante/ocarinaBook

Just in case anyone is looking for something similar.

Best, Stefan

Am 07.12.2020 um 09:43 schrieb Werner LEMBERG:

Is it somehow possible to tell Lilypond to look for the .ttf file in
the working directory, ie. the directory in which the .ly file is
that is being compiled?

Yes.  Here's some documentation from the current development version;
the two mentioned scheme functions, however, are present in 2.20, too.

   Finding fonts
   -

   In addition to any font already installed on the operating system,
   more fonts may be added to the ones detected by FontConfig (and thus
   available in LilyPond scores) by the following commands:

 #(ly:font-config-add-font "path/to/font-file")
 #(ly:font-config-add-directory "path/to/directory/")

   Both commands accept either absolute or relative paths, which makes
   it possible to compile a score on any system by simply distributing
   the relevant font files together with the LilyPond input files.

For your case it should be thus sufficient to add

   #(ly:font-config-add-directory ".")

at the top of your main `.ly` file (assuming that you call the
`lilypond` binary while being in this directory).


 Werner




Re: Help a newb: Formatting custom instrument names

2020-12-07 Thread Lukas-Fabian Moser

Hi Michael,

So far I’ve only been able to assign the column of text to the 
instrument name, but it’s WAY to big and spaced out. I tried to find 
the commands to tweak the instrument name in the reference manuals, 
but I just couldn’t figure it out. I need to tweak the size of the 
font, the vertical scale (assuming the characters are evenly spaced 
vertically) and the position. Can anyone help out a hapless newbie?


Maybe something like this?

\version "2.21.80"

\layout {
  indent = 5
}

#(define-markup-command (unit-height layout props arg) (markup?)
  (let* ((stil (interpret-markup layout props arg))
 (x (ly:stencil-extent stil 0)))
    (interpret-markup layout props
  (make-with-dimensions-markup x '(-0.5 . 0.5) 
(markup #:general-align 1 0 arg)


#(define-markup-command (unit-height-column layout props args) 
(markup-list?)

    (interpret-markup layout props #{
  \markup {
    \override #'(baseline-skip . 0)
    \center-column \unit-height #args
  } #}))

\new Staff \with {
  \override StaffSymbol.line-count = 12
  instrumentName = \markup {
    \override #'(font-size . -10)
    \unit-height-column { First second third fourth fifth sixth seventh 
eighth ninth tenth eleventh } } }

{ a'4 }

The command \unit-height forces a markup to have Y dimension exactly 
-0.5 to 0.5 (hence, one staff space), no matter its actual size. 
\unit-height-column the given elements in a (horizontally centered) 
column, stacked without padding between the lines.


Lukas



Re: Help a newb: Formatting custom instrument names

2020-12-07 Thread Lukas-Fabian Moser

Hi Michael,


Maybe something like this?

\version "2.21.80"

\layout {
  indent = 5
}

#(define-markup-command (unit-height layout props arg) (markup?)
  (let* ((stil (interpret-markup layout props arg))
 (x (ly:stencil-extent stil 0)))
    (interpret-markup layout props
  (make-with-dimensions-markup x '(-0.5 . 0.5) 
(markup #:general-align 1 0 arg)


Of course that's insane, because the same markup is interpreted twice, 
and because 0.5 isn't an exact number. Hopefully better version:


\version "2.21.80"

\layout {
  indent = 5
}

#(define-markup-command (force-unit-height layout props arg) (markup?)
   (let* ((y-centered-arg (markup #:general-align 1 0 arg))
  (stil (interpret-markup layout props y-centered-arg))
  (x (ly:stencil-extent stil 0))
  (y (cons -1/2 1/2)))
 (ly:stencil-outline stil (make-filled-box-stencil x y

#(define-markup-command (unit-height-column layout props args) 
(markup-list?)

   (interpret-markup layout props #{
 \markup {
   \override #'(baseline-skip . 0)
   \center-column \force-unit-height #args
 } #} ))

\new Staff \with {
  \override StaffSymbol.line-count = 12
  instrumentName = \markup {
    \override #'(font-size . -10)
    \unit-height-column { First second third fourth fifth sixth seventh 
eighth ninth tenth eleventh }

  }
}
{ a'4 }

Lukas



Re: Help a newb: Formatting custom instrument names

2020-12-07 Thread Leo Correia de Verdier
I’m not sure if this is an interesting suggestion, but if you want this as the 
actual clef you could write 
%%
\once \override Staff.Clef.stencil = #ly:text-interface::print
  \once \override Staff.Clef.text = \markup {
\override #'(font-size . -6.5)
\unit-height-column { First second third fourth fifth sixth seventh eighth 
ninth tenth eleventh } }
  \once \override Staff.Clef.Y-offset = #5
  \clef treble % or whatever
%%

> 7 dec. 2020 kl. 22:39 skrev Lukas-Fabian Moser :
> 
> Hi Michael,
> 
>> Maybe something like this?
>> 
>> \version "2.21.80"
>> 
>> \layout {
>>   indent = 5
>> }
>> 
>> #(define-markup-command (unit-height layout props arg) (markup?)
>>   (let* ((stil (interpret-markup layout props arg))
>>  (x (ly:stencil-extent stil 0)))
>> (interpret-markup layout props
>>   (make-with-dimensions-markup x '(-0.5 . 0.5) (markup 
>> #:general-align 1 0 arg)
> 
> Of course that's insane, because the same markup is interpreted twice, and 
> because 0.5 isn't an exact number. Hopefully better version:
> 
> \version "2.21.80"
> 
> \layout {
>   indent = 5
> }
> 
> #(define-markup-command (force-unit-height layout props arg) (markup?)
>(let* ((y-centered-arg (markup #:general-align 1 0 arg))
>   (stil (interpret-markup layout props y-centered-arg))
>   (x (ly:stencil-extent stil 0))
>   (y (cons -1/2 1/2)))
>  (ly:stencil-outline stil (make-filled-box-stencil x y
> 
> #(define-markup-command (unit-height-column layout props args) (markup-list?)
>(interpret-markup layout props #{
>  \markup {
>\override #'(baseline-skip . 0)
>\center-column \force-unit-height #args
>  } #} ))
> 
> \new Staff \with {
>   \override StaffSymbol.line-count = 12
>   instrumentName = \markup {
> \override #'(font-size . -10)
> \unit-height-column { First second third fourth fifth sixth seventh 
> eighth ninth tenth eleventh }
>   }
> }
> { a'4 }
> 
> Lukas
>