lilypond-user
[Top][All Lists]
Advanced

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

RE: Lyluatex: Font selection


From: Jacques Peron
Subject: RE: Lyluatex: Font selection
Date: Sat, 15 Apr 2023 10:27:13 +0000

Hello

This bug was introduced by an attempt to fix an incompatibility with polyglossia, as this one removes proper familyname informations that are normally available from lua.

@Jean Abou Samra : I’m the main author of lyluatex (I say the main one, as Urs Liska did an awesome work to make it what it has become). Not a developer nor a professional musician, but a priest and teacher in a French school, and "accidentally" choirmaster in this school.

Fr Jacques Peron +

De : Jean Abou Samra <jean@abou-samra.fr>
Envoyé : samedi 15 avril 2023 09:03
À : Lukas-Fabian Moser <lfm@gmx.de>
Cc : lilypond-user Mailing List (lilypond-user@gnu.org) <lilypond-user@gnu.org>; Werner LEMBERG <werner.lemberg@moz.ac.at>; cataclop@hotmail.com <cataclop@hotmail.com>
Objet : Re: Lyluatex: Font selection
 
(Out of curiosity, who is cataclop@hotmail.com in CC?)

> Le 15 avr. 2023 à 10:30, Lukas-Fabian Moser <lfm@gmx.de> a écrit :
>
> Folks,
>
> that's probably more of a Lyluatex issue, but since LilyPond's font handling is involved (and it's being changed right now and it's something I know nothing about, and we have proper font experts among us), maybe it's a good idea to discuss this also on the LilyPond side.
>
> When reviving and old Lyluatex project of mine I stumbled over the following: When using "EB Garamond" from https://github.com/octaviopardo/EBGaramond12/tree/master/fonts/otf as main document font as in
>
> \documentclass{article}
>
> \usepackage[program=/home/lukas/lilypond-versions/lilypond-2.24.0/bin/lilypond,debug=true]{lyluatex}
> \usepackage{fontspec}
> \setmainfont{EB Garamond}
> \setluaoption{ly}{pass-fonts}{true}
>
> \begin{document}
> Test
>
> \lily{
> \fixed c'{c\mark "Hallo" d e f^"Test"}
> \addlyrics{c d e f}
> }
> Noch ein Test
>
> \end{document}
>
> then Lyluatex's commit e55a3832e30cd364c4 ("Fix compatibility with polyglossia") makes the temporary .ly file contain the following font selection code:
>
>   #(define fonts
>     (make-pango-font-tree "EB Garamond Regular"
>                           "LMSans10"
>                           "LMMono10"
>                           (/ staff-height pt 20)))
>
> while without that commit it is:
>
>     #(define fonts
>     (make-pango-font-tree "EB Garamond"
>                           "Latin Modern Sans"
>                           "Latin Modern Mono"
>                           (/ staff-height pt 20)))
>
> Only the second one works (LilyPond doesn't find the font with the added "Regular"). So for now I've reverted that commit in my local copy of Lyluatex.
>
> So, my questions basically are:
>
> - Is it the font's fault for not registering itself as "Regular" by name?
> - Is it LilyPond's fault for not finding the font if "Regular" is added?


I don’t think it makes sense to add “Regular” in make-pango-font-tree or the new fonts alist, because regular in this context means it’s not italic or bold, but the string you specify is a font family, which can include regular/bold/italic/semibold/slanted/whatever, and LilyPond *will* use the italic or bold variant when appropriate.

In contrast, the font-name property is a Pango description string and disregards font-shape and font-series (and consequently \markup \italic and \markup \bold), so it *does* make sense to add “regular” or “bold” in a font-name string. (But it’s confusing and error-prone, so I plan to introduce an alternative.)


> - Is any of this touched by Jean's ongoing work on restructuring LilyPond's font selection mechanism? (I don't think so, at least fonts.roman = "EB Garamond Regular" fails with 2.25.4)


Not in any way that I can think of. The values in the fonts alist are still font families.


> - Or is this simply a bug in Lyluatex introduced with e55a3832e?


I think so.



reply via email to

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