[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
UTF-8-aware backwards string searching in Guile, or: fixing centered lyr
From: |
Alexander Kobel |
Subject: |
UTF-8-aware backwards string searching in Guile, or: fixing centered lyrics ignoring punctuation |
Date: |
Tue, 30 Oct 2018 18:01:57 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 |
Dear all,
I'm happily using center-lyrics-ignoring-punctuation.ily in the version
from
https://lists.gnu.org/archive/html/lilypond-user/2016-12/msg00382.html
for a while now. (It's attached as well.)
Now I stumbled across the following unexpected warning:
\version "2.19.82"
\include "center-lyrics-ignoring-punctuation.ily"
{ d4 }
\addlyrics { à }
GNU LilyPond 2.19.82
Processing `test.ly'
Parsing...
Interpreting music...
Preprocessing graphical objects...
(process:2528): Pango-WARNING **: 17:49:34.874: Invalid UTF-8 string passed to
pango_layout_set_text()
warning: no glyph for character U+FFFD in font
`/usr/share/fonts/tex-gyre/texgyreschola-regular.otf'
Observations:
1. The warning vanishes as soon as I replace the lyrics by àa, but not
by aà.
2. There is no U+FFFD (REPLACEMENT CHARACTER) anywhere in my input.
This makes me wonder whether the problem is in the backwards
string-search in string-skip-right or in the substring routine used in
the make-center-on-word-callback; the only reason I can imagine why this
pops up is that some blind-to-Unicode slicing cuts some string in the
middle of a multi-byte Unicode character.
The warning is merely annoying, but harmless; but I suspect that there
are unfortunate combinations where trailing "to-be-ignored" characters
are missed, or "not-to-be-ignored" characters are split into an
ill-defined character and a false "to-be-ignored".
Does anyone have a hint how to approach this one? (Or is the answer
just: be patient and hope for Guile v2?)
Thanks,
Alex
center-lyrics-ignoring-punctuation.ily
Description: Text document
test.ly
Description: Text Data
smime.p7s
Description: S/MIME Cryptographic Signature
- UTF-8-aware backwards string searching in Guile, or: fixing centered lyrics ignoring punctuation,
Alexander Kobel <=