# How to use a customized font for fingering symbols in Lilypond

I am engraving a music score for an instrument called pipa. Someone else created a font for the pipa fingering and I want to use this font for the fingering symbols.

I am using Lilypond 2.20 on Ubuntu 20.04, with Frescobaldi as frontend.

This font looks like this in the Ubuntu font manager:

When I copy and paste the symbol into Frescobaldi editor, the character appeared as normal western letter A, B, C,....., not the fingering symbols I want.

Any help will be highly appreciated!

You can attach any markup as a fingering using the \finger command. So normally, you would write things like c-1 (the -1 means adding 1 as a fingering) or <c-1 e-2 g-3>, and likewise you can write (I use this a lot with guitar harmonics) e''\finger "12", for instance.

You can use any markup as a fingering, and you can override the font-name property in the markup to use any font you want. However, it is searched for by name, not by file, so you must install it into your system and let fontconfig know it is there (the file manager will probably install it correctly. If not, you could do it by copying the file into the ~/.fonts directory and running fc-cache afterwards (~ means your home directory and files/directories starting with a dot are hidden by default, so you may have to check something like "view hidden files". You may also have to create the directory yourself).)

So you could for instance write c\finger\markup{\override #'(font-name . "(your font name goes here)") "A"}, and that would use the "A" character from your font as the fingering for the note. Since the font associates some other symbol with the "A", you get what you want.

Obviously it would be really tiresome to write this for every note, so it will be better to make a couple of commands for the fingerings, which you can use ever after. Here's an example (with a different font; it's a calligraphic font called "Lovers Quarrel"):

fngA = \finger\markup{\override #'(font-name . "Lovers Quarrel") \fontsize #4 "A"}
fngB = \finger\markup{\override #'(font-name . "Lovers Quarrel") \fontsize #4 "B"}
fngC = \finger\markup{\override #'(font-name . "Lovers Quarrel") \fontsize #4 "C"}
fngD = \finger\markup{\override #'(font-name . "Lovers Quarrel") \fontsize #4 "D"}

\score {
\new Staff
{
\clef "G_8"
c\fngA e\fngB g\fngC a\fngD |
<c\fngA e\fngB g\fngC h\fngD>1 \bar "|."
}
\layout { }
}

(In the first four lines, I just define the commands for four different "fingerings". You can make similar commands for any number of fingerings you want.) The result looks like this:

As you can see, the letters behave just like any other fingerings (because they are fingerings), going above the notes as long as you have single notes, and to the left when you use chords. If you don't like that, please see the fingeringOrientation property in docs.

• Thank you so so so much Ramillies! You have saved me another day! I have been using Lilypond for a few years. But the score of this piece on my hand is so untypical, that it's pushing me to my limit. You have helped me solve two problems. More questions are coming....Btw, this is the piece I am trying to engrave: youtu.be/Jpx6zlUmJ6c Nov 8 '20 at 11:12
• @NicoleNaumann, I'm glad to have helped. And hopefully I will be able to answer the other questions too, although I can't promise anything :—). (And the piece is really nice; however, as a classical guitarist, I would notate it just like any other piece for a similar instrument. So I'm curious about what you will need of Lilypond :—).) Nov 8 '20 at 12:01