Re: Font kerning

2022-02-16 Thread Francesco Napoleoni
> Of course, what it means to “conform as much as possible to the original
> layout” is the question at hand.  If purely visual, your code is
> correct; if purely semantic, “vº1º”/“vº2º” is correct (however the font
> displays that); if both together, then a font with appropriate letter
> and numeral forms is needed.

In my case “purely visual” is the correct answer. More in general, I 
definitely agree with you.

cheers
Francesco Napoleoni






Re: Font kerning

2022-02-15 Thread Joel C. Salomon

On 2/14/22 11:57, Francesco Napoleoni wrote:

In data lunedì 14 febbraio 2022 00:19:11 CET, Joel C. Salomon ha scritto:

I wonder whether you’re using the wrong symbol, and using the correct
one might help a little.  Your code is using the degree sign “°” U+B0,
when by context this should probably be the masculine ordinal indicator
“º” U+BA.


Yes, I know that there are more appropriate symbols, but I have to conform as
much as possible to the original layout, which uses superscript “o”
everywhere. Indeed this makes sense since the little “o” is the last letter of
every abbreviated word: “Violin_o_ prim_o_” and “Violin_o_ second_o_”, so I
ended up writing something like this (inside \markup):

\concat { "V." \hspace #-0.4 \normal-size-super o "I." \hspace #-0.6 \normal-
size-super o }

which produces an output very similar to the original.


Of course, what it means to “conform as much as possible to the original 
layout” is the question at hand.  If purely visual, your code is 
correct; if purely semantic, “vº1º”/“vº2º” is correct (however the font 
displays that); if both together, then a font with appropriate letter 
and numeral forms is needed.


―Joel




Re: Font kerning

2022-02-14 Thread Francesco Napoleoni
In data lunedì 14 febbraio 2022 00:19:11 CET, Joel C. Salomon ha scritto:
> On 2/7/2022 11:53 AM, Francesco Napoleoni wrote:
> > How can I adjust (if possible) such property in a markup block?
> > 
> > namely I would like to “shrink” the “V.° I.°” and the “V.° 2.°” text like
> > the attached screenshot.
> 
> I wonder whether you’re using the wrong symbol, and using the correct
> one might help a little.  Your code is using the degree sign “°” U+B0,
> when by context this should probably be the masculine ordinal indicator
> “º” U+BA.

Yes, I know that there are more appropriate symbols, but I have to conform as 
much as possible to the original layout, which uses superscript “o” 
everywhere. Indeed this makes sense since the little “o” is the last letter of 
every abbreviated word: “Violin_o_ prim_o_” and “Violin_o_ second_o_”, so I 
ended up writing something like this (inside \markup):

\concat { "V." \hspace #-0.4 \normal-size-super o "I." \hspace #-0.6 \normal-
size-super o }

which produces an output very similar to the original.

As a matter of fact the original text is an italian publication dated 1885, so 
you’re right, it’s quite old.

Anyway, thanks for your contribution.

bye
Francesco Napoleoni








Re: Font kerning

2022-02-13 Thread Joel C. Salomon



On 2/7/2022 11:53 AM, Francesco Napoleoni wrote:

How can I adjust (if possible) such property in a markup block?

namely I would like to “shrink” the “V.° I.°” and the “V.° 2.°” text like the
attached screenshot.


I wonder whether you’re using the wrong symbol, and using the correct 
one might help a little.  Your code is using the degree sign “°” U+B0, 
when by context this should probably be the masculine ordinal indicator 
“º” U+BA.


(Some fonts display this symbol as a superscript “o” like “ᵒ”; some add 
an underline to it like “̵ᵒ”; some add an underdot that I can’t easily 
imitate by abusing other Unicode characters; and your source material is 
using a full-stop “.” kerned in pretty tightly.)


I’m also pretty sure this is a font with old-style figures, where the 
numeral “1” looks like a small-caps “ɪ”; and so the v’s should be 
lower-case.


So the actual text should be “vº1º” & “vº2º” or “v.º1.º” & “v.º2.º”:

{
  c''1^\markup {
\override #'(font-name . "TeX Gyre Schola")
\override #'(font-features . ("onum"))
{ "vº1º2º" }
  }
  c''^\markup \concat {
\override #'(font-name . "TeX Gyre Termes")
\override #'(font-features . ("onum"))
{ "v." \hspace #-0.4 "º" "1." \hspace #-0.6 "º" "2." \hspace #-0.6 
"º" }

  }
}


—Joel



Re: Font kerning

2022-02-07 Thread David Bellows
> making something like shelf{}full omit the ff ligature only
somewhat reliably: if there is a hyphenation pass over the paragraph in
question, TeX will create the ff ligature in the "reconstitution pass".

As an aside, the selnolig package exists for LuaTeX that automatically
removes select ligatures like with "shelfful".

On Mon, Feb 7, 2022 at 2:36 PM David Kastrup  wrote:
>
> Valentin Petzel  writes:
>
> >> Am Montag, 7. Februar 2022, 22:47:30 CET schrieb:
> >>> Valentin Petzel  writes:
> >>> >> Am Montag, 7. Februar 2022, 21:30:21 CET schrieb:
> >>> >>> Thanks to all for your answers. The trick suggested by Valentin
> >>> >>> works for me.
> >>> >>>
> >>> >>> Anyway it looks like there’s no option to directly adjust letter
> >>> >>> spacing, something like \kern macro in LaTeX, right?
> >>> >
> >>> > No. As Lilypond is a music typesetter, not a  text typesetter, the text
> >>> > typesetting options in Lilypond are quite rudimentary. This means that
> >>> > Lilypond has no interface for these things. So kerning in Lilypond 
> >>> > markup
> >>> > usually means taking two markups and putting them next to each other 
> >>> > with
> >>> > some (potentially negative) distance.
> >>>
> >>> Which is pretty much what \kern does in TeX.  The difference between
> >>> a \kern and \hspace in TeX is that \hspace indicates a possible
> >>> breakpoint (and when a break happens there, it will get removed),
> >>> and \hspace can take flexible glue specifications.  And I am not
> >>> sure but \kern may be transparent to hyphenation.
> >>>
> >>> LilyPond's \hspace takes no flexible glue specifications and cannot
> >>> become a breakpoint either, and hyphenation is not a thing.  So I
> >>> have no idea what your "No." is supposed to mean.
> >
> > Hello David.
> >
> > TeX takes care of text output entirely by itself, while Lilypond delegates
> > this to Pango. This makes handling certain things quite a bit more awkward 
> > in
> > Lilypond. So while \hspace does work similarly to \kern it does not really
> > have the same function.
> >
> > In TeX we could for example do
> > This is a Test\kern0.2pt word
> > for what Lilypond would need
> > { This is a \concat { Test \hspace #0.1 word } }
>
> That has nothing to do with how \hspace works but rather how \line
> breaks things into pieces.  The equivalent to
> \markup { This is a Test \hspace #0.1 word }
> would be
> This is a Test \kern0.2pt\relax word
>
> \concat is LilyPond's way of omitting spaces.
>
> You'll also find that TeX's way of grouping kernable material is rather
> awkward, making something like shelf{}full omit the ff ligature only
> somewhat reliably: if there is a hyphenation pass over the paragraph in
> question, TeX will create the ff ligature in the "reconstitution pass".
>
> > Thus my "no" means to say that there is in fact not such a direct way
> > to adjust letter spacing in Lilypond.
>
> --
> David Kastrup
>



Re: Font kerning

2022-02-07 Thread David Kastrup
Valentin Petzel  writes:

>> Am Montag, 7. Februar 2022, 22:47:30 CET schrieb:
>>> Valentin Petzel  writes:
>>> >> Am Montag, 7. Februar 2022, 21:30:21 CET schrieb:
>>> >>> Thanks to all for your answers. The trick suggested by Valentin
>>> >>> works for me.
>>> >>> 
>>> >>> Anyway it looks like there’s no option to directly adjust letter
>>> >>> spacing, something like \kern macro in LaTeX, right?
>>> > 
>>> > No. As Lilypond is a music typesetter, not a  text typesetter, the text
>>> > typesetting options in Lilypond are quite rudimentary. This means that
>>> > Lilypond has no interface for these things. So kerning in Lilypond markup
>>> > usually means taking two markups and putting them next to each other with
>>> > some (potentially negative) distance.
>>> 
>>> Which is pretty much what \kern does in TeX.  The difference between
>>> a \kern and \hspace in TeX is that \hspace indicates a possible
>>> breakpoint (and when a break happens there, it will get removed),
>>> and \hspace can take flexible glue specifications.  And I am not
>>> sure but \kern may be transparent to hyphenation.
>>> 
>>> LilyPond's \hspace takes no flexible glue specifications and cannot
>>> become a breakpoint either, and hyphenation is not a thing.  So I
>>> have no idea what your "No." is supposed to mean.
>
> Hello David.
>
> TeX takes care of text output entirely by itself, while Lilypond delegates 
> this to Pango. This makes handling certain things quite a bit more awkward in 
> Lilypond. So while \hspace does work similarly to \kern it does not really 
> have the same function.
>
> In TeX we could for example do
> This is a Test\kern0.2pt word
> for what Lilypond would need
> { This is a \concat { Test \hspace #0.1 word } }

That has nothing to do with how \hspace works but rather how \line
breaks things into pieces.  The equivalent to
\markup { This is a Test \hspace #0.1 word }
would be
This is a Test \kern0.2pt\relax word

\concat is LilyPond's way of omitting spaces.

You'll also find that TeX's way of grouping kernable material is rather
awkward, making something like shelf{}full omit the ff ligature only
somewhat reliably: if there is a hyphenation pass over the paragraph in
question, TeX will create the ff ligature in the "reconstitution pass".

> Thus my "no" means to say that there is in fact not such a direct way
> to adjust letter spacing in Lilypond.

-- 
David Kastrup



Re: Font kerning

2022-02-07 Thread Valentin Petzel
Hello David.

TeX takes care of text output entirely by itself, while Lilypond delegates 
this to Pango. This makes handling certain things quite a bit more awkward in 
Lilypond. So while \hspace does work similarly to \kern it does not really 
have the same function.

In TeX we could for example do
This is a Test\kern0.2pt word
for what Lilypond would need
{ This is a \concat { Test \hspace #0.1 word } }

Thus my "no" means to say that there is in fact not such a direct way to 
adjust letter spacing in Lilypond.

Cheers,
Valentin

Am Montag, 7. Februar 2022, 22:47:30 CET schrieb David Kastrup:
> Valentin Petzel  writes:
> >> Am Montag, 7. Februar 2022, 21:30:21 CET schrieb:
> >>> Thanks to all for your answers. The trick suggested by Valentin works
> >>> for
> >>> me.
> >>> 
> >>> Anyway it looks like there’s no option to directly adjust letter
> >>> spacing,
> >>> something like \kern macro in LaTeX, right?
> > 
> > No. As Lilypond is a music typesetter, not a  text typesetter, the text
> > typesetting options in Lilypond are quite rudimentary. This means that
> > Lilypond has no interface for these things. So kerning in Lilypond markup
> > usually means taking two markups and putting them next to each other with
> > some (potentially negative) distance.
> 
> Which is pretty much what \kern does in TeX.  The difference between a
> \kern and \hspace in TeX is that \hspace indicates a possible breakpoint
> (and when a break happens there, it will get removed), and \hspace can
> take flexible glue specifications.  And I am not sure but \kern may be
> transparent to hyphenation.
> 
> LilyPond's \hspace takes no flexible glue specifications and cannot
> become a breakpoint either, and hyphenation is not a thing.  So I have
> no idea what your "No." is supposed to mean.



signature.asc
Description: This is a digitally signed message part.


Re: Font kerning

2022-02-07 Thread David Kastrup
Valentin Petzel  writes:

>> Am Montag, 7. Februar 2022, 21:30:21 CET schrieb:
>>> Thanks to all for your answers. The trick suggested by Valentin works for
>>> me.
>>> 
>>> Anyway it looks like there’s no option to directly adjust letter spacing,
>>> something like \kern macro in LaTeX, right?
>
> No. As Lilypond is a music typesetter, not a  text typesetter, the text 
> typesetting options in Lilypond are quite rudimentary. This means that 
> Lilypond has no interface for these things. So kerning in Lilypond markup 
> usually means taking two markups and putting them next to each other with 
> some 
> (potentially negative) distance.

Which is pretty much what \kern does in TeX.  The difference between a
\kern and \hspace in TeX is that \hspace indicates a possible breakpoint
(and when a break happens there, it will get removed), and \hspace can
take flexible glue specifications.  And I am not sure but \kern may be
transparent to hyphenation.

LilyPond's \hspace takes no flexible glue specifications and cannot
become a breakpoint either, and hyphenation is not a thing.  So I have
no idea what your "No." is supposed to mean.

-- 
David Kastrup



Re: Font kerning

2022-02-07 Thread Valentin Petzel
No. As Lilypond is a music typesetter, not a  text typesetter, the text 
typesetting options in Lilypond are quite rudimentary. This means that 
Lilypond has no interface for these things. So kerning in Lilypond markup 
usually means taking two markups and putting them next to each other with some 
(potentially negative) distance.

Cheers,
Valentin

Am Montag, 7. Februar 2022, 21:30:21 CET schrieb Francesco Napoleoni:
> Thanks to all for your answers. The trick suggested by Valentin works for
> me.
> 
> Anyway it looks like there’s no option to directly adjust letter spacing,
> something like \kern macro in LaTeX, right?
> 
> cheers
> Francesco Napoleoni



signature.asc
Description: This is a digitally signed message part.


Re: Font kerning

2022-02-07 Thread Francesco Napoleoni
In data lunedì 7 febbraio 2022 21:46:49 CET, David Kastrup ha scritto:
> So how would you characterise this being any different from \kern ?

Uhmmm... I wouldn’t. :-)







Re: Font kerning

2022-02-07 Thread David Kastrup
Francesco Napoleoni  writes:

> In data lunedì 7 febbraio 2022 21:40:05 CET, David Kastrup ha scritto:
>> Have you tried negative \hspace ?
>
> Yes, that’s what Valentin suggested, and indeed it does the trick.

So how would you characterise this being any different from \kern ?

-- 
David Kastrup



Re: Font kerning

2022-02-07 Thread Francesco Napoleoni
In data lunedì 7 febbraio 2022 21:40:05 CET, David Kastrup ha scritto:
> Have you tried negative \hspace ?

Yes, that’s what Valentin suggested, and indeed it does the trick.






Re: Font kerning

2022-02-07 Thread David Kastrup
Francesco Napoleoni  writes:

> Thanks to all for your answers. The trick suggested by Valentin works for me.
>
> Anyway it looks like there’s no option to directly adjust letter spacing, 
> something like \kern macro in LaTeX, right?

Have you tried negative \hspace ?

-- 
David Kastrup



Re: Font kerning

2022-02-07 Thread Francesco Napoleoni
Thanks to all for your answers. The trick suggested by Valentin works for me.

Anyway it looks like there’s no option to directly adjust letter spacing, 
something like \kern macro in LaTeX, right?

cheers
Francesco Napoleoni






Re: Font kerning

2022-02-07 Thread Valentin Petzel
Hello Francesco,

perhaps \concat { ... } . Also you can use \hspace with a negative number to 
add negative spacing before a markup, pulling it forward.

E.g.

{ c^\markup\concat { "V." \hspace #-0.5 "°" "I." \hspace #-0.8 "°"  } }

Cheers,
Valentin

Am Montag, 7. Februar 2022, 17:53:19 CET schrieb Francesco Napoleoni:
> Hello everyone
> 
> How can I adjust (if possible) such property in a markup block?
> 
> namely I would like to “shrink” the “V.° I.°” and the “V.° 2.°” text like
> the attached screenshot.
> 
> Thanks
> Francesco Napoleoni



signature.asc
Description: This is a digitally signed message part.


Re: Font kerning

2022-02-07 Thread Lukas-Fabian Moser

Hi Francesco,

Am 07.02.22 um 17:53 schrieb Francesco Napoleoni:

Hello everyone

How can I adjust (if possible) such property in a markup block?

namely I would like to “shrink” the “V.° I.°” and the “V.° 2.°” text like the
attached screenshot.


It's easier to help if you also provide the LilyPond code generating 
your example.


But here's my guess: Multi-part markup expressions like

\markup { some\raise #0.5 thing }

are implicitly understood to be separate words. If you want them to be 
printed without spaces in between, you can use \concat:


\markup { \concat { some\raise #0.5 thing } }

Lukas