bell notificationshomepageloginNewPostedit profiledmBox

Hoots : 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. - freshhoot.com

10% popularity   0 Reactions

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.
This font can be downloaded from my Google drive: pipa.ttf
Any help will be highly appreciated!


Load Full (1)

Login to follow hoots

1 Comments

Sorted by latest first Latest Oldest Best

10% popularity   0 Reactions

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 cfingermarkup{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 = fingermarkup{override #'(font-name . "Lovers Quarrel") fontsize #4 "A"}
fngB = fingermarkup{override #'(font-name . "Lovers Quarrel") fontsize #4 "B"}
fngC = fingermarkup{override #'(font-name . "Lovers Quarrel") fontsize #4 "C"}
fngD = fingermarkup{override #'(font-name . "Lovers Quarrel") fontsize #4 "D"}

score {
new Staff
{
clef "G_8"
cfngA efngB gfngC afngD |
<cfngA efngB gfngC hfngD>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.


Back to top Use Dark theme