-
Hi, Is it possible to add text to the left of the staff like the "R" and "L" in the following (non-Vexflow) example? I'd like to notate drum rudiments with vexflow using a similar presentation. Many thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @0xfe, curious if you had any ideas here. |
Beta Was this translation helpful? Give feedback.
-
I would just use some settings you can set beforehand: ctx.setFont(fontFamilyVexFlow, fontHeight, VexFlowConverter.fontStyle(fontStyle));
// font size is set by VexFlow in `pt`. This overwrites the font so it's set to px instead
ctx.attributes["font-size"] = `${fontHeight}px`;
ctx.state["font-size"] = `${fontHeight}px`; (this is for Vexflow 1.2.93, might have changed in Vexflow 4) You should be able to get the left-most x and y position of the stave somehow. |
Beta Was this translation helpful? Give feedback.
I would just use
ctx.fillText(text, x, y)
, that's how OSMD does it.some settings you can set beforehand:
(this is for Vexflow 1.2.93, might have changed in Vexflow 4)
You should be able to get the left-most x and y position of the stave somehow.