Using MuseScore icons set in a plugin UI

• Oct 10, 2021 - 22:31

I'd like to use icons from MuseScore in to my plugins UI.
In my previous plugins I just did copy/paste as PNG and used those PNG. A bit tedious.

Is there any way to use those icon sets in a plugin UI ?

I searched for the Leland font on my MuseScore installation. Couldn't find it.
I searched for .SVG files. Couldn't find any.

I also tried this:
if (Qt.fontFamilies().indexOf('Leland') < 0) {
console.log("Leland not found");
}

And I couldn't find the font either.


Comments

Leland isn't a set of icons, it's a font, so not sure how that would help. But for the record, you can find all fonts and icons used in MsueScore on GitHub along with the full source code.

In reply to by rob.dnz

The easiest way i'm using is like this:
In any QML component (ComboBox, TextField, ...) set the font to "MScore Text" and set the text to what ever symbol you'd like to display.

font.family: 'MScore Text'
font.pointSize: 10
text: "\uE4E5" // write a "rest" symbol

The only difficulty is to identify the right unicode character code.
For that you'll have to use a Font Manager software.
I'm using Corel Font Manager, but it is a paying one. Look on internet. There are some free ones.

I haven't tested this but I think it should be possible to use something like
":/data/icons/note-longa.svg"
where icon names can be found in this list. In Qt paths prefixed by : mean resources bundled into the executable, and :/data/icons is the default MuseScore's path to search for icons.

In reply to by jeetee

Great. This is what I was looking for.

Actually that's where I started, but stopped when the test whether that font (and the Leland one) was installed answered we "not installed" :-(
if (Qt.fontFamilies().indexOf('Leland') <= 0) { console.log("NOT INSTALLED"); }
While actually QML is knowing them, without them actually be "installed" !!

For anyone looking to use this, the right Unicode characters to use can be found by analyzing the font which is located on the MuseScore font folder on GitHub

Do you still have an unanswered question? Please log in first to post your question.