Skip to content

How do I draw a single note? #1592

Discussion options

You must be logged in to vote

There are a couple of ways. You can 'freehand' render any glyph supported by the application in the SVG graphics context. Based on your use case, though, I'm thinking you might want to use the glyphs from the SMUFL music fonts, and render them like a normal icon.

To just render glyphs on the existing graphics context, for any glyph supported in VexFlow, at coordinates x,y and the given font size:

        const glyph = new VF.Glyph(glyphCode.code, fontSize);
        glyph.render(this.context.getContext(), x, y);

If you want to make a dropdown (that is presumably html instead of svg), you could just use the font codes and get a copy of the actual font.

@font-face {
  font-family: 'Bravura';
  

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ego-lay-atman-bay
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants