-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement additional font options #3586
Conversation
@fernandoherreradelasheras the |
Summary: this PR add the following font options Load all fontsThe Set a specific fall backThe Loading custom fontsThe The custom font must be archived in a ZIP file containing the files produced by the font script Verovio provides for extracting relevant information from an SVG font file and the corresponding SMuFL metadata. These files are:
The ZIP filename must correspond to the name of the font. For the JavaScript binding, the ZIP file must be encoded in Base64 and passed as a URL. Example rendered with ![]() <?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/5.0/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/5.0/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="5.0">
<meiHead>
<fileDesc>
<titleStmt>
<title>Changing fonts</title>
<respStmt>
<persName role="encoder">Laurent Pugin</persName>
</respStmt>
</titleStmt>
<pubStmt>
<date isodate="2024-02-07" />
</pubStmt>
<seriesStmt>
<title>Verovio test suite</title>
</seriesStmt>
<notesStmt>
<annot>The font can be changed on clef and metersig with @fontname. This option --font-load-all needs to be set.</annot>
</notesStmt>
</fileDesc>
<encodingDesc>
<appInfo>
<application version="4.2.0" label="2">
<name>Verovio</name>
</application>
</appInfo>
</encodingDesc>
</meiHead>
<music>
<body>
<mdiv>
<score>
<scoreDef midi.bpm="112.000000">
<staffGrp bar.thru="true" symbol="brace">
<staffDef n="1" lines="5">
<clef shape="G" color="olive" line="2" fontname="Petaluma" />
<keySig mode="major" sig="3s" pname="a" />
<meterSig enclose="brack" count="3" sym="common" unit="8" fontname="Petaluma" color="olive" />
</staffDef>
<staffDef n="2" lines="5">
<clef shape="F" line="4" />
<keySig mode="major" sig="3s" pname="a" />
<meterSig count="3" unit="8" />
</staffDef>
</staffGrp>
</scoreDef>
<section>
<measure n="15">
<staff n="1">
<layer n="1">
<beam>
<note xml:id="note-L9F2" dur="16" oct="5" pname="b" accid.ges="n" />
<note dur="16" oct="5" pname="g" accid.ges="s" />
<note dur="16" oct="5" pname="e" accid.ges="n" />
<note dur="16" oct="4" pname="b" accid.ges="n" />
<note dur="16" oct="5" pname="d" accid="s" />
<note dur="16" oct="4" pname="b" accid.ges="n" />
</beam>
</layer>
</staff>
<staff n="2">
<layer n="1">
<rest dur="8" />
<rest dur="8" />
<clef shape="G" line="2" color="orange" />
<note dur="8" oct="4" pname="a" accid.ges="n">
<artic artic="stacciss" />
</note>
</layer>
</staff>
<dynam place="between" staff="1 2" tstamp="1.000000">mezzo f</dynam>
<slur staff="1" startid="#note-L9F2" endid="#note-L22F2" />
</measure>
<measure n="16">
<staff n="1">
<layer n="1">
<beam>
<note dur="16" oct="5" pname="e" accid.ges="n" />
<note dur="16" oct="4" pname="b" accid.ges="n" />
<note dur="16" oct="5" pname="f" accid.ges="s" />
<note dur="16" oct="4" pname="b" accid.ges="n" />
<note dur="16" oct="5" pname="g" accid.ges="s" />
<note xml:id="note-L22F2" dur="16" oct="4" pname="b" accid.ges="n" />
</beam>
</layer>
</staff>
<staff n="2">
<layer n="1">
<beam>
<note dur="8" oct="4" pname="g" accid.ges="s">
<artic artic="stacciss" />
</note>
<note dur="8" oct="4" pname="f" accid.ges="s">
<artic artic="stacciss" />
</note>
<note dur="8" oct="4" pname="e" accid.ges="n">
<artic artic="stacciss" />
</note>
</beam>
</layer>
</staff>
</measure>
</section>
</score>
</mdiv>
</body>
</music>
</mei> |
I think in your description you mixed up |
Allow support for
@fontfam
(currently onclef
andmeterSig
) to use another font for these elements. To do so, the font needs to be loaded with the--font-load-all
option.Example: