On 2024-01-16 9:12 am, YTG 1234 wrote:
I want to use emoji within markup, and I can see in the output log that Lilypond can't find a character in its default emoji font (Symbola). I can't figure out how to override the default font.

%%%

\markup {
    "🔒" %% This character isn't be found
}

%%%

I saw an old thread recommending to use \override #'(font-name . "..."), but that doesn't seem to work in modern versions (I'm on 2.25.11). Overriding the serif font doesn't work either, as I don't think Lilypond tries it at all.

Cannot reproduce locally running either 2.22.0 or 2.25.11.

%%%%
\version "2.22.0"

\markup
{ 🎲 🔒 😎 🎶 }

\markup
\override #'(font-name . "DejaVu Sans")
{ 🎲 🔒 😎 🎶 }

\markup
\override #'(font-name . "Segoe UI Emoji")
{ 🎲 🔒 😎 🎶 }
%%%%

This probably has less to do with LilyPond and nearly everything to do with FontConfig and what fonts are installed and accessible. At the very least, the markup \override command has not changed behavior, as far as I can tell. And what works on my machine is largely irrelevant to what you'll need to do on your system.

Things to check: Run LilyPond with the -dshow-available-fonts option and grep the output to ensure the font in question appears. If it does not, then something may be screwy with FontConfig. If the font does appear, then make sure you input the name fully with the font-name override. Some fonts include as part of their family name what appears to be a style, and this has been known to cause problems. Adding a trailing comma seems to help, e.g. use "Times New Roman," instead of "Times New Roman".


-- Aaron Hill

Reply via email to