setting baseline-skip "from this point on"

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

setting baseline-skip "from this point on"

Kieren MacMillan
Hello all,

If I want to change the font size of all markup "from this point on", I can use

   \set fontSize = #5

Is there an equivalent command for baseline-skip?
I know about \override #'(baseline-skip . 13), but I believe that's only for overriding the "current" markup?

Thanks,
Kieren.
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: setting baseline-skip "from this point on"

David Kastrup
Kieren MacMillan <[hidden email]> writes:

> Hello all,
>
> If I want to change the font size of all markup "from this point on", I can use
>
>    \set fontSize = #5
>
> Is there an equivalent command for baseline-skip?
> I know about \override #'(baseline-skip . 13), but I believe that's
> only for overriding the "current" markup?


{
  c1-\markup \column { a b c }
  \override TextScript.baseline-skip = #20
  c-\markup \column { a b c }
}

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: setting baseline-skip "from this point on"

Kieren MacMillan
Hi David,

Thanks for the quick response.

>> Is there an equivalent command for baseline-skip?
>> I know about \override #'(baseline-skip . 13), but I believe that's
>> only for overriding the "current" markup?
>
> {
>  c1-\markup \column { a b c }
>  \override TextScript.baseline-skip = #20
>  c-\markup \column { a b c }
> }

Hmmm… Then there's another reason (that I clearly don't understand) why the first mod attempt in this snippet doesn't work but the second one does:

%%%  SNIPPET BEGINS
\version "2.19.61"

huge = {
  \set fontSize = #5
  \override TextScript.baseline-skip = #100
}

loremIpsum = \markup \wordwrap {
  Lorem ipsum dolor sit amet, consectetur adipisicing elit,
  sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
}

\markup \loremIpsum
\markup \vspace #2
\markup \huge \loremIpsum
\markup \vspace #2
\markup \fontsize #2 \override #'(baseline-skip . 20) \loremIpsum
%%%  SNIPPET ENDS

Thanks,
Kieren.
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: setting baseline-skip "from this point on"

David Kastrup
Kieren MacMillan <[hidden email]> writes:

> Hi David,
>
> Thanks for the quick response.
>
>>> Is there an equivalent command for baseline-skip?
>>> I know about \override #'(baseline-skip . 13), but I believe that's
>>> only for overriding the "current" markup?
>>
>> {
>>  c1-\markup \column { a b c }
>>  \override TextScript.baseline-skip = #20
>>  c-\markup \column { a b c }
>> }
>
> Hmmm… Then there's another reason (that I clearly don't understand)
> why the first mod attempt in this snippet doesn't work but the second
> one does:
>
> %%%  SNIPPET BEGINS
> \version "2.19.61"
>
> huge = {
>   \set fontSize = #5
>   \override TextScript.baseline-skip = #100
> }
>
> loremIpsum = \markup \wordwrap {
>   Lorem ipsum dolor sit amet, consectetur adipisicing elit,
>   sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
> }
>
> \markup \loremIpsum
> \markup \vspace #2
> \markup \huge \loremIpsum
> \markup \vspace #2
> \markup \fontsize #2 \override #'(baseline-skip . 20) \loremIpsum
> %%%  SNIPPET ENDS

I have no idea what you mean when you say "from this point on", give an
example with \set (which is a music expression) but then hobble together
something from markups and music expressions outside of any score.

At any rate, \huge is already defined as a proper markup command so your
music expression is not getting called inside of markups.

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: setting baseline-skip "from this point on"

Kieren MacMillan
Hi David,

The docs (1.8.2 Formatting text) say

>> Known issues and warnings
>> Using the font sizing commands \teeny, \tiny, \small, \normalsize, \large, and \huge will lead to inconsistent line spacing compared to using \fontsize.


I'm trying to get my head around the various situations and issues involved, and what it would take to eliminate the inconsistency.

> \huge is already defined as a proper markup command so your
> music expression is not getting called inside of markups.

Ah. In property-init.ly, it says

    huge = \set fontSize = #2

I was trying to improve that definition to solve the "inconsistent line spacing" problem (noted above). I pulled the definition out into the snippet to work with it there, but I guess that doesn't work as I would expect it to…

Thanks,
Kieren.
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: setting baseline-skip "from this point on"

David Kastrup
Kieren MacMillan <[hidden email]> writes:

> Hi David,
>
> The docs (1.8.2 Formatting text) say
>
>>> Known issues and warnings
>>> Using the font sizing commands \teeny, \tiny, \small, \normalsize,
>>> \large, and \huge will lead to inconsistent line spacing compared
>>> to using \fontsize.
>
>
> I'm trying to get my head around the various situations and issues
> involved, and what it would take to eliminate the inconsistency.
>
>> \huge is already defined as a proper markup command so your
>> music expression is not getting called inside of markups.
>
> Ah. In property-init.ly, it says
>
>     huge = \set fontSize = #2
>
> I was trying to improve that definition to solve the "inconsistent
> line spacing" problem (noted above). I pulled the definition out into
> the snippet to work with it there, but I guess that doesn't work as I
> would expect it to…

This isn't the \huge you are using in markups.

You are probably looking for the definition in
scm/define-markup-commands.scm as

(define-markup-command (huge layout props arg)
  (markup?)
  #:category font
  "Set font size to +2.

@lilypond[verbatim,quote]
\\markup {
  default
  \\hspace #2
  \\huge
  huge
}
@end lilypond"
  (interpret-markup layout (prepend-alist-chain 'font-size 2 props) arg))

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: setting baseline-skip "from this point on"

Kieren MacMillan
Hi David,

> This isn't the \huge you are using in markups.

Oy.

1. Thanks for clearing that up. I'll see where that leads me.

2. Is it *really* not possible to have just one "huge" command, which is used wherever "\huge" makes sense? In the 20 years I've programmed (in different languages and environments), I've never seen as many multiple confusing definitions as there seem to be in the Lilypond codebase (q.v. fontSize, font-size, fontsize, etc.).

Thanks,
Kieren.
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: setting baseline-skip "from this point on"

Simon Albrecht-2
On 07.06.2017 19:44, Kieren MacMillan wrote:
> Is it*really*  not possible to have just one "huge" command, which is used wherever "\huge" makes sense?

You mean one command for use in markup and music? That’s not possible,
because markup commands have a different namespace in that \huge is
translated to #:huge in the Scheme ‘markup’ macro, which is then
translated to make-huge-markup. (Which is also why define-markup-command
has such a different syntax from define-music-function &c.)

>   In the 20 years I've programmed (in different languages and environments), I've never seen as many multiple confusing definitions as there seem to be in the Lilypond codebase (q.v. fontSize, font-size, fontsize, etc.).

Maybe
<http://lilypond.org/doc/v2.19/Documentation/learning/naming-conventions-of-objects-and-properties>
should be somewhat extended to cover musicFunctions and markup-commands?
A real problem is that there are a few markup commands that defy the
naming convention. In the special case of font size, you have to chime
in as a native speaker whether fontsize is even correct, i.e. spelling
it as one word.

Best, Simon

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: setting baseline-skip "from this point on"

Kieren MacMillan
Hi Simon,

> You mean one command for use in markup and music? That’s not possible, because markup commands have a different namespace in that \huge is translated to #:huge in the Scheme ‘markup’ macro, which is then translated to make-huge-markup. (Which is also why define-markup-command has such a different syntax from define-music-function &c.)

Okay… but can we at least shared one implementation between all of them, so that they have feature- and bug-parity?
Fortunately, I've found a way (see thread in -devel) to at least call one from the other, so that's a plus…

> Maybe <http://lilypond.org/doc/v2.19/Documentation/learning/naming-conventions-of-objects-and-properties> should be somewhat extended to cover musicFunctions and markup-commands?

I'll take a look.

> In the special case of font size, you have to chime in as a native speaker whether fontsize is even correct, i.e. spelling it as one word.

In English, nobody would say "fontsize"; we would say "font size". Hence "font-size" or "fontSize" at least make some sense.
That being said, I don't always expect hyphens or camelCase to suddenly make code names into recognizable English.

Best,
Kieren.
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Loading...