StaticAccidentalStaticAnnotationStaticAnnotationStaticAnnotationStaticArticulationStaticBarlineStaticBarlineStaticBarStaticBeamStaticBendStaticBoundingStaticBUILDStaticCanvasStaticChordStaticChordStaticChordStaticClefStaticClefStaticCrescendoStaticCurveStaticCurveStaticDotStaticEasyStaticElementStaticFactoryStaticFontStaticFontStaticFontStaticFormatterStaticFractionStaticFretStaticGhostStaticGlyphStaticGlyphsStaticGraceStaticGraceStaticGraceStaticKeyStaticKeyStaticKeyStaticModifierStaticModifierStaticModifierStaticMultiStaticMusicStaticNoteStaticNoteStaticNoteStaticOrnamentStaticParenthesisStaticParserStaticPedalStaticRegistryStaticRenderStaticRendererStaticRendererStaticRendererStaticRepeatStaticRepetitionStaticRuntimeStaticStaveStaticStaveStaticStaveStaticStaveStaticStaveStaticStaveStaticStaveStaticStaveStaticStaveStaticStaveStaticStemStaticStringStaticStrokeStaticSVGContextStaticSymbolStaticSystemStaticTabStaticTabStaticTabStaticTabStaticTestStaticTextStaticTextStaticTextStaticTextStaticTextStaticTickStaticTimeStaticTimeStaticTremoloStaticTuningStaticTupletStaticVibratoStaticVibratoStaticVoiceStaticVoiceStaticVoltaStaticVoltaStaticNOTATION_StaticRENDER_StaticRESOLUTIONStaticSLASH_StaticSOFTMAX_StaticSTAVE_StaticSTAVE_StaticSTEM_StaticSTEM_StaticTABLATURE_StaticTIME4_StaticunicodeStaticUNISONStaticclefStaticdurationStaticgetStaticgetStatichasStatickeyOptionalclef: stringOptionalparams: anyStatickeyStaticloadStaticsetCall this if you are using vexflow-core.js to take advantage of lazy loading for fonts.
vexflow.js and vexflow-bravura.js already call setFonts('Bravura', 'Academico'), so you only
need to call this when switching fonts.
Example:
await VexFlow.loadFonts('Bravura', 'Academico', 'Petaluma', 'Petaluma Script');
VexFlow.setFonts('Bravura', 'Academico');
... render a score in Bravura ...
VexFlow.setFonts('Petaluma', 'Petaluma Script');
... render a score in Petaluma...
See demos/fonts/ for more examples.
Load the fonts that are used by your app.
Call this if you are using
vexflow-core.jsto take advantage of lazy loading for fonts.If you are using
vexflow.jsorvexflow-bravura.js, this method is unnecessary, since they already call loadFonts(...) and setFonts(...) for you.If
fontNamesis undefined, all fonts in Font.FILES will be loaded. This is useful for debugging, but not recommended for production because it will load lots of fonts.For example, on the
flow.htmltest page, you could call:await VexFlow.loadFonts();Alternatively, you may load web fonts with a stylesheet link (e.g., from Google Fonts), and a @font-face { font-family: ... } rule in your CSS.
Customize
Font.HOST_URLandFont.FILESto load different fonts for your app.