Re: Does 'strut' command work in LilyPond?

2014-03-30 Thread Karol Majewski
OK, so the question is: Is there a way to create box that has height of total 
font height? By total font height I mean the distance between bottom bearing 
line and top bearing line (see 
http://www.myfirstfont.com/images/glyphterms.gif). The idea is of course to 
have constant height of box, independently of what text is entered.

-Karol



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Does 'strut' command work in LilyPond?

2014-03-30 Thread Thomas Morley
2014-03-30 0:35 GMT+01:00 Karol Majewski karo...@wp.pl:
 According to:

 http://www.lilypond.org/doc/v2.19/Documentation/notation/other

 \strut Create a box of the same height as the space in the current font.

 So

 \markup { \strut \box . }
 \markup { \strut \box bp }

 should draw a box with constant height. But it doesn't. Maybe I'm doing 
 something wrong?

 -Karol



Hi,

according to it's description \strut works as expected, imho:
\strut creates a (invisible) box of the same _height_ (Y-direction!)
as the _space_ (X-direction!) in the current font.

Look at the output of:

\markup
\box \vcenter {
%% current default \strut:
\strut
%% sort of rebuilding it:
\rotate #90  
%% another markup to compare:
\concat { \strut . }
}


I think the request is another:
2014-03-30 10:24 GMT+02:00 Karol Majewski karo...@wp.pl:
 OK, so the question is: Is there a way to create box that has _height_ of 
 total font _height_?
 By total font height I mean the distance between bottom bearing line and 
 top bearing line

As sort of workaround you may use the coding below.
Please note, it's a _workaround_ ! Thinking of other non-european
languages it might easily be broken.


\version 2.18.0

#(define-markup-command (vstrut layout props)
  ()
  #:category other
  
@cindex creating vertical space in text

Create a box of the same height as the current font.
  (let ((ref-mrkp (interpret-markup layout props fp)))
(ly:make-stencil (ly:stencil-expr empty-stencil)
 empty-interval
 (ly:stencil-extent ref-mrkp Y

%%%
%% EXAMPLE
%%%

ln-mrkp = \markup \draw-line #'(2 . 0)

\markup
\override #'(baseline-skip . 1) {
\column \box {
\ln-mrkp
\ln-mrkp
\ln-mrkp
}
\column \box  {
x
x
x
}
opposed to: 
\column \box {
\line { \vstrut \ln-mrkp }
\line { \vstrut \ln-mrkp }
\line { \vstrut \ln-mrkp }
}
\column \box {
\line { \vstrut x }
\line { \vstrut x }
\line { \vstrut x }
}
}

Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Does 'strut' command work in LilyPond?

2014-03-30 Thread Karol Majewski
Very nice workaround! For Cental Europe languages it's better to replace fp 
with, let's say, Śp.

 2014-03-30 0:35 GMT+01:00 Karol Majewski karo...@wp.pl:
  According to:
 
  http://www.lilypond.org/doc/v2.19/Documentation/notation/other
 
  \strut Create a box of the same height as the space in the current font.
 
  So
 
  \markup { \strut \box . }
  \markup { \strut \box bp }
 
  should draw a box with constant height. But it doesn't. Maybe I'm doing 
 something wrong?
 
  -Karol
 
 
 
 Hi,
 
 according to it's description \strut works as expected, imho:
 \strut creates a (invisible) box of the same _height_ (Y-direction!)
 as the _space_ (X-direction!) in the current font.
 
 Look at the output of:
 
 \markup
 \box \vcenter {
 %% current default \strut:
 \strut
 %% sort of rebuilding it:
 \rotate #90  
 %% another markup to compare:
 \concat { \strut . }
 }
 
 
 I think the request is another:
 2014-03-30 10:24 GMT+02:00 Karol Majewski karo...@wp.pl:
  OK, so the question is: Is there a way to create box that has _height_ 
 of total font _height_?
  By total font height I mean the distance between bottom bearing line 
 and top bearing line
 
 As sort of workaround you may use the coding below.
 Please note, it's a _workaround_ ! Thinking of other non-european
 languages it might easily be broken.
 
 
 \version 2.18.0
 
 #(define-markup-command (vstrut layout props)
   ()
   #:category other
   
 @cindex creating vertical space in text
 
 Create a box of the same height as the current font.
   (let ((ref-mrkp (interpret-markup layout props fp)))
 (ly:make-stencil (ly:stencil-expr empty-stencil)
  empty-interval
  (ly:stencil-extent ref-mrkp Y
 
 %%%
 %% EXAMPLE
 %%%
 
 ln-mrkp = \markup \draw-line #'(2 . 0)
 
 \markup
 \override #'(baseline-skip . 1) {
 \column \box {
 \ln-mrkp
 \ln-mrkp
 \ln-mrkp
 }
 \column \box  {
 x
 x
 x
 }
 opposed to: 
 \column \box {
 \line { \vstrut \ln-mrkp }
 \line { \vstrut \ln-mrkp }
 \line { \vstrut \ln-mrkp }
 }
 \column \box {
 \line { \vstrut x }
 \line { \vstrut x }
 \line { \vstrut x }
 }
 }
 
 Cheers,
   Harm




___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Does 'strut' command work in LilyPond?

2014-03-30 Thread Kieren MacMillan
Hi all,

 Very nice workaround!

+1

 For Cental Europe languages it's better to replace fp with, let's say, Śp”.

When, oh when, will we get real text handling (e.g., leading) in Lilypond?

Cheers,
Kieren.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Does 'strut' command work in LilyPond?

2014-03-29 Thread Conor Cook
In what order should \strut come?  Does it require curly braces?

~Conor Cook

 On Mar 29, 2014, at 6:35 PM, Karol Majewski karo...@wp.pl wrote:
 
 According to:
 
 http://www.lilypond.org/doc/v2.19/Documentation/notation/other
 
 \strut Create a box of the same height as the space in the current font.
 
 So
 
 \markup { \strut \box . }
 \markup { \strut \box bp }
 
 should draw a box with constant height. But it doesn't. Maybe I'm doing 
 something wrong?
 
 -Karol
 
 
 
 ___
 lilypond-user mailing list
 lilypond-user@gnu.org
 https://lists.gnu.org/mailman/listinfo/lilypond-user

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Does 'strut' command work in LilyPond?

2014-03-29 Thread David Kastrup
Karol Majewski karo...@wp.pl writes:

 According to:

 http://www.lilypond.org/doc/v2.19/Documentation/notation/other

 \strut Create a box of the same height as the space in the current font.

 So

 \markup { \strut \box . }
 \markup { \strut \box bp }

 should draw a box with constant height. But it doesn't. Maybe I'm
 doing something wrong?

Huh?  You are not placing the \strut inside of the box, so why should
the box' height be affected?

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Does 'strut' command work in LilyPond?

2014-03-29 Thread Karol Majewski
I tried different order, but it didn't work. Could you please give an example 
of how to use 'strut' properly?

Dnia 30-03-2014 o godz. 0:57 David Kastrup napisał(a):
 Karol Majewski karo...@wp.pl writes:
 
  According to:
 
  http://www.lilypond.org/doc/v2.19/Documentation/notation/other
 
  \strut Create a box of the same height as the space in the current font.
 
  So
 
  \markup { \strut \box . }
  \markup { \strut \box bp }
 
  should draw a box with constant height. But it doesn't. Maybe I'm
  doing something wrong?
 
 Huh?  You are not placing the \strut inside of the box, so why should
 the box' height be affected?
 
 --
 David Kastrup




___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Does 'strut' command work in LilyPond?

2014-03-29 Thread Conor Cook
Would it be:

\markup { \box { \strut “.” } }

or

\markup { \strut { \box “.” } }

?

I’m just taking a shot in the dark.  I’ve not seen \strut before.

~Conor Cook

On Mar 29, 2014, at 7:04 PM, Karol Majewski karo...@wp.pl wrote:

 I tried different order, but it didn't work. Could you please give an example 
 of how to use 'strut' properly?
 
 Dnia 30-03-2014 o godz. 0:57 David Kastrup napisał(a):
 Karol Majewski karo...@wp.pl writes:
 
 According to:
 
 http://www.lilypond.org/doc/v2.19/Documentation/notation/other
 
 \strut Create a box of the same height as the space in the current font.
 
 So
 
 \markup { \strut \box . }
 \markup { \strut \box bp }
 
 should draw a box with constant height. But it doesn't. Maybe I'm
 doing something wrong?
 
 Huh?  You are not placing the \strut inside of the box, so why should
 the box' height be affected?
 
 --
 David Kastrup
 
 
 
 
 ___
 lilypond-user mailing list
 lilypond-user@gnu.org
 https://lists.gnu.org/mailman/listinfo/lilypond-user


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Does 'strut' command work in LilyPond?

2014-03-29 Thread Kieren MacMillan
Hi David,

 Huh?  You are not placing the \strut inside of the box, so why should
 the box' height be affected?

It appears that putting \strut inside the box doesn’t actually change the box’s 
height:

\version 2.19
\include english.ly

\markup \box { \strut . }
\markup \box { \strut bp }

Cheers,
Kieren.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Does 'strut' command work in LilyPond?

2014-03-29 Thread Kieren MacMillan
p.s. \line and \concat have no effect.

On Mar 29, 2014, at 8:26 PM, Kieren MacMillan kieren_macmil...@sympatico.ca 
wrote:

 Hi David,
 
 Huh?  You are not placing the \strut inside of the box, so why should
 the box' height be affected?
 
 It appears that putting \strut inside the box doesn’t actually change the 
 box’s height:
 
 \version 2.19
 \include english.ly
 
 \markup \box { \strut . }
 \markup \box { \strut bp }
 
 Cheers,
 Kieren.
 ___
 lilypond-user mailing list
 lilypond-user@gnu.org
 https://lists.gnu.org/mailman/listinfo/lilypond-user
 


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Does 'strut' command work in LilyPond?

2014-03-29 Thread Conor Cook
Does \strut simply produce a font-sized box, meant to have nothing in it?

~Conor Cook

On Mar 29, 2014, at 7:29 PM, Kieren MacMillan kieren_macmil...@sympatico.ca 
wrote:

 p.s. \line and \concat have no effect.
 
 On Mar 29, 2014, at 8:26 PM, Kieren MacMillan kieren_macmil...@sympatico.ca 
 wrote:
 
 Hi David,
 
 Huh?  You are not placing the \strut inside of the box, so why should
 the box' height be affected?
 
 It appears that putting \strut inside the box doesn’t actually change the 
 box’s height:
 
 \version 2.19
 \include english.ly
 
 \markup \box { \strut . }
 \markup \box { \strut bp }
 
 Cheers,
 Kieren.
 ___
 lilypond-user mailing list
 lilypond-user@gnu.org
 https://lists.gnu.org/mailman/listinfo/lilypond-user
 
 
 
 ___
 lilypond-user mailing list
 lilypond-user@gnu.org
 https://lists.gnu.org/mailman/listinfo/lilypond-user


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Does 'strut' command work in LilyPond?

2014-03-29 Thread David Kastrup
Kieren MacMillan kieren_macmil...@sympatico.ca writes:

 Hi David,

 Huh?  You are not placing the \strut inside of the box, so why should
 the box' height be affected?

 It appears that putting \strut inside the box doesn’t actually change
 the box’s height:

 \version 2.19
 \include english.ly

 \markup \box { \strut . }
 \markup \box { \strut bp }

\box only gets a single markup.  If you give it a list, it will make a
box for each element.  So you have to use \line.  It turns out that
\strut has a non-empty horizontal extent, a somewhat annoying property
which we should try to replace.  So we need to use \concat instead of
\line.

\version 2.19
\include english.ly

\markup \box \concat { \strut . }
\markup \box \concat { \strut bp }
\markup \box .



-- 
David Kastrup
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Does 'strut' command work in LilyPond?

2014-03-29 Thread Kieren MacMillan
Hi David,

 So we need to use \concat instead of \line.
 
 \version 2.19
 \include english.ly
 
 \markup \box \concat { \strut . }
 \markup \box \concat { \strut bp }
 \markup \box “.

That also doesn’t work as expected — the first box should be taller, right?

Cheers,
Kieren.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Does 'strut' command work in LilyPond?

2014-03-29 Thread David Kastrup
Kieren MacMillan kieren_macmil...@sympatico.ca writes:

 Hi David,

 So we need to use \concat instead of \line.
 
 \version 2.19
 \include english.ly
 
 \markup \box \concat { \strut . }
 \markup \box \concat { \strut bp }
 \markup \box “.

 That also doesn’t work as expected — the first box should be taller, right?

Well, the height does not really impress me, but it _is_ taller than the
strutless box.  All considered, it is probably a reasonable statement
that the current behavior of \strut leaves several things to be desired.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user