lilypond-user
[Top][All Lists]
Advanced

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

Re: bug in magnetic snapping lyrics engraver


From: Werner LEMBERG
Subject: Re: bug in magnetic snapping lyrics engraver
Date: Wed, 13 Apr 2022 19:48:34 +0000 (UTC)

>> This is ingenious :-) Thanks *a lot* for this solution.  In my
>> tests it seems to work fine
>
> You're welcome.

I spoke too soon :-) There is a problem with ligatures at the syllable
boundaries (and kerning).  While this can be considered an ugliness in
languages based on the latin script, it might be a real showstopper
for non-latin scripts like Devanagari.

In other words, it is not sufficient to shift the right syllable in a
syllable pair to the left.  Instead, the following should be done.

* Concatenate the text/markup of the left syllable with the right
  text/markup *on the input level* (for example, by using
  `make-concat-markup`) so that Pango/Cairo can handle all affected
  syllables together.

* Store the result in the right syllable and adjust the horizontal
  position.  This allows accumulation for multi-syllable words.

* Set the text/markup in the left syllable to empty.

I tried to implement this, but I failed.  In this replacement code

```
(when (< delta threshold)
  (let ((lt (ly:grob-property left-text 'text))
        (rt (ly:grob-property grob 'text)))
    (begin
      (ly:grob-set-property!
       left-text 'text empty-markup)
      (ly:grob-set-property!
       grob 'text (make-concat-markup (list lt rt)))
```

the `ly:grob-set-property!` calls have zero effect.  I guess that at
this point of time it is too late for modifying properties, and the
grobs have already been converted to stencils.

Maybe this is the reason for the more complicated approach in David's
original approach?  Do you know a quick fix for your code?


    Werner



reply via email to

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