lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Font kerning


From: David Kastrup
Subject: Re: Font kerning
Date: Mon, 07 Feb 2022 23:35:08 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Valentin Petzel <valentin@petzel.at> writes:

>> Am Montag, 7. Februar 2022, 22:47:30 CET schrieb:
>>> Valentin Petzel <valentin@petzel.at> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]