How can I change the font of "notename.qml".
How can I change the font and font size in the plugin "notename.qml" ?
I tried to add
text.defauleFont = QFont("Helvetica",20);
But result was
ReferenceError: QFont is not defined.
Can I do the fine-tune the position using the xOffset and yOffset?
text.xOffset=5.0;
text.yOffset=5.0;
did not work.
Comments
text.pos.x and text.pos.y should work
for QFont maybe check http://doc.qt.io/qt-5/qml-font.html
In reply to text.pos.x and text.pos.y by Jojo-Schmitz
Thank you.
Position problem was solved by using the text.pos.x and text.pos.y.
But, I couldn’t understand how to use
"Text { font.family: "Helvetica"; font.pointSize: 13; font.bold: true }"
in the MuseScore plugin.
It seems these are added as ordinary Staff Text elements, so instead of trying to modify the plugin to hard code a specific font, why not just change the text style in your score?
In reply to It seems these are added as by Marc Sabatella
I want to rewrite the Shakuhachi, Shinobue, Koto and Erfu notation plug-ins from MuseScore v1 to v2.
StaffText elements support certain html features. I don't have an exhaustive list, but they do know how to handle font size:
Edit: Here's an example also changing the font:
In reply to StaffText elements support by heuchi
Thank you.
notenames.qml plugin at line 190,
I inserted the below line
text.text=qsTr("")+text.text;
This works well !
But
text.text=qsTr("")+text.text;
or
text.text=qsTr("")+text.text;
didn't work.
In reply to Thank you. notenames.qml by tcbnhrs
I don't understand: The lines all look the same.
And why would you use qsTr(""), that is, translate an empty string?
In reply to I don't understand: The lines by heuchi
Sorry, I was using the backspace character.
Shown as a image,
In reply to Sorry, I was using the by tcbnhrs
Why use qsTr() for the html tags?
And there's a "=" missing in <font face= ...>
In reply to Why use qsTr() for the html by heuchi
Indeed, drop the qsTr(...) (no need to translate those texts) and add a "=" (to get the html syntax right)
In reply to Indeed, drop the qsTr(...) by Jojo-Schmitz
I got this to work in my plugin (still need to upload the revision) by separating the size and face application into two separate lines. With both combined on the same line, i was getting a parsing error. i.e.,
In reply to Sorry, I was using the by tcbnhrs
Thank you all.
Problem bas solved.
I'd like to start improbement of shakuhachi and shinobue plug-ins.