Skip to content

Commit

Permalink
Merge pull request rism-digital#3802 from rism-digital/develop-glyphs
Browse files Browse the repository at this point in the history
Add support for E0B8 and E0B9 note heads
  • Loading branch information
ahankinson authored Sep 27, 2024
2 parents 1733592 + 90d8cf7 commit c93d2fc
Show file tree
Hide file tree
Showing 24 changed files with 81 additions and 13 deletions.
2 changes: 1 addition & 1 deletion data/Bravura.css

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions data/Bravura.xml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,14 @@
<a n="stemDownNW" x="0.0" y="-0.15" />
<a n="stemUpSE" x="1.16" y="0.15" />
</g>
<g c="E0B8" x="0.0" y="-125.0" w="313.0" h="250.0" h-a-x="313" n="noteheadSquareWhite">
<a n="stemDownNW" x="0.0" y="-0.5" />
<a n="stemUpSE" x="1.25" y="0.5" />
</g>
<g c="E0B9" x="0.0" y="-125.0" w="313.0" h="250.0" h-a-x="313" n="noteheadSquareBlack">
<a n="stemDownNW" x="0.0" y="-0.5" />
<a n="stemUpSE" x="1.25" y="0.5" />
</g>
<g c="E0D9" x="0.0" y="-125.0" w="251.0" h="250.0" h-a-x="251" n="noteheadDiamondHalf">
<a n="stemDownNW" x="0.0" y="0.0" />
<a n="stemUpSE" x="1.0" y="0.0" />
Expand Down
1 change: 1 addition & 0 deletions data/Bravura/E0B8.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<symbol id="E0B8" viewBox="0 0 1000 1000" overflow="inherit"><path transform="scale(1,-1)" d="M313 -125h-313v250h313v-250zM28 -96h257v193h-257v-193z" /></symbol>
1 change: 1 addition & 0 deletions data/Bravura/E0B9.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<symbol id="E0B9" viewBox="0 0 1000 1000" overflow="inherit"><path transform="scale(1,-1)" d="M313 -125h-313v250h313v-250z" /></symbol>
2 changes: 1 addition & 1 deletion data/Leipzig.css

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions data/Leipzig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -818,4 +818,6 @@
<g c="EE92" x="20.0" y="-201.0" w="233.0" h="391.0" h-a-x="273" n="mensuralProportion7" />
<g c="EA2A" x="0.0" y="-130.0" w="319.0" h="260.0" h-a-x="319" n="medRenOriscusCMN" />
<g c="E595" x="0.0" y="0.0" w="210.0" h="400.0" h-a-x="210" n="ornamentLeftVerticalStrokeWithCross" />
<g c="E0B8" x="0.0" y="-125.0" w="300.0" h="250.0" h-a-x="300" n="noteheadSquareWhite" />
<g c="E0B9" x="0.0" y="-125.0" w="300.0" h="250.0" h-a-x="300" n="noteheadSquareBlack" />
</bounding-boxes>
1 change: 1 addition & 0 deletions data/Leipzig/E0B8.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<symbol id="E0B8" viewBox="0 0 1000 1000" overflow="inherit"><path transform="scale(1,-1)" d="M300 -125h-300v250h300v-250zM23 -101h254v203h-254v-203z" /></symbol>
1 change: 1 addition & 0 deletions data/Leipzig/E0B9.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<symbol id="E0B9" viewBox="0 0 1000 1000" overflow="inherit"><path transform="scale(1,-1)" d="M300 -125h-300v250h300v-250z" /></symbol>
2 changes: 1 addition & 1 deletion data/Leland.css

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions data/Leland.xml
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,14 @@
<g c="F417" x="0.0" y="-188.0" w="306.0" h="580.0" h-a-x="306" n="flag32ndDownStraight">
<a n="stemDownSW" x="0.0" y="-0.71" />
</g>
<g c="E0B8" x="0.0" y="-125.0" w="310.0" h="250.0" h-a-x="310" n="noteheadSquareWhite">
<a n="stemDownNW" x="0.0" y="0.0" />
<a n="stemUpSE" x="1.24" y="0.0" />
</g>
<g c="E0B9" x="0.0" y="-125.0" w="310.0" h="250.0" h-a-x="310" n="noteheadSquareBlack">
<a n="stemDownNW" x="0.0" y="0.0" />
<a n="stemUpSE" x="1.24" y="0.0" />
</g>
<g c="E0F5" x="0.0" y="-210.0" w="98.0" h="421.0" h-a-x="98" n="noteheadParenthesisLeft" />
<g c="E0F6" x="0.0" y="-210.0" w="98.0" h="421.0" h-a-x="98" n="noteheadParenthesisRight" />
<g c="F418" x="0.0" y="-388.0" w="289.0" h="762.0" h-a-x="289" n="flag64thUpStraight">
Expand Down
1 change: 1 addition & 0 deletions data/Leland/E0B8.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<symbol id="E0B8" viewBox="0 0 1000 1000" overflow="inherit"><path transform="scale(1,-1)" d="M310 125v-250h-310v250h310zM274 89h-238v-178h238v178z" /></symbol>
1 change: 1 addition & 0 deletions data/Leland/E0B9.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<symbol id="E0B9" viewBox="0 0 1000 1000" overflow="inherit"><path transform="scale(1,-1)" d="M310 125v-250h-310v250h310z" /></symbol>
2 changes: 1 addition & 1 deletion data/Petaluma.css

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions data/Petaluma.xml
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,14 @@
<a n="stemDownNW" x="0.0" y="-0.04" />
<a n="stemUpSE" x="1.44" y="0.09" />
</g>
<g c="E0B8" x="0.0" y="-131.0" w="350.0" h="262.0" h-a-x="350" n="noteheadSquareWhite">
<a n="stemDownNW" x="0.0" y="-0.3" />
<a n="stemUpSE" x="1.36" y="0.38" />
</g>
<g c="E0B9" x="0.0" y="-129.99" w="342.0" h="262.43" h-a-x="342" n="noteheadSquareBlack">
<a n="stemDownNW" x="0.0" y="-0.41" />
<a n="stemUpSE" x="1.37" y="0.4" />
</g>
<g c="E0D9" x="0.0" y="-148.0" w="295.0" h="296.0" h-a-x="294" n="noteheadDiamondHalf">
<a n="stemDownNW" x="0.0" y="-0.0" />
<a n="stemUpSE" x="1.18" y="-0.08" />
Expand Down
1 change: 1 addition & 0 deletions data/Petaluma/E0B8.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<symbol id="E0B8" viewBox="0 0 1000 1000" overflow="inherit"><path transform="scale(1,-1)" d="M325 -131c-89 1 -178 1 -266 1c-21 0 -33 10 -43 25c-2 4 -3 7 -3 10c-8 2 -13 8 -13 19c3 63 6 125 8 187c0 12 6 15 15 15c1 1 2 1 4 2h10c87 1 174 1 261 3c19 0 30 -8 37 -24c0 -1 0 -2 1 -3c1 -3 3 -6 3 -10c0 -16 3 -32 3 -48c1 -39 5 -77 7 -111v-29v-2 c0 -4 1 -8 1 -11s-1 -6 -4 -7l-1 -1c0 -1 1 -1 1 -2c0 -2 1 -4 1 -5c0 -5 -3 -8 -10 -8c-4 -1 -8 -1 -12 -1zM171 -87v-1h132l-6 102c-2 25 -2 50 -5 76h-104v-1c-28 0 -56 1 -85 1c-14 0 -28 0 -42 -1c-4 0 -7 0 -10 1v-40c-2 -43 -3 -85 -5 -127c0 -4 -1 -8 -2 -10h127z " /></symbol>
1 change: 1 addition & 0 deletions data/Petaluma/E0B9.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<symbol id="E0B9" viewBox="0 0 1000 1000" overflow="inherit"><path transform="scale(1,-1)" d="M151 132c-34 0 -80 1 -126 0c-22 0 -23 -2 -24 -24v-88c0 -41 0 -82 -1 -123c0 -14 3 -22 20 -25c22 -5 42 1 62 1c78 1 157 5 235 9c15 1 22 5 22 20c0 4 1 8 1 12c0 63 0 125 2 187c0 15 -6 21 -18 24c-6 2 -13 3 -19 4c-47 3 -94 3 -154 3z" /></symbol>
2 changes: 1 addition & 1 deletion emscripten/npm/src/verovio-toolkit.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export class VerovioToolkit {

preprocessOptions(options) {
// Nothing to do if we do not have 'fontAddCustom' set
if (!Object.hasOwn(options, 'fontAddCustom')) {
if (!options.hasOwnProperty('fontAddCustom')) {
return options;
}
const filenames = options['fontAddCustom'];
Expand Down
10 changes: 7 additions & 3 deletions fonts/Leipzig/Leipzig.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified fonts/Leipzig/Leipzig.ttf
Binary file not shown.
Binary file modified fonts/Leipzig/Leipzig.woff2
Binary file not shown.
22 changes: 21 additions & 1 deletion fonts/Leipzig/leipzig_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"tupletBracketThickness": 0.16
},
"fontName": "Leipzig",
"fontVersion": "5.2.92",
"fontVersion": "5.2.93",
"glyphBBoxes": {
"4stringTabClef": {
"bBoxNE": [
Expand Down Expand Up @@ -5172,6 +5172,26 @@
-1.0
]
},
"noteheadSquareBlack": {
"bBoxNE": [
1.2,
0.5
],
"bBoxSW": [
0.0,
-0.5
]
},
"noteheadSquareWhite": {
"bBoxNE": [
1.2,
0.5
],
"bBoxSW": [
0.0,
-0.5
]
},
"noteheadVoidWithX": {
"bBoxNE": [
1.156,
Expand Down
4 changes: 2 additions & 2 deletions fonts/supported.xml
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@
<glyph glyph-code="E0B5" smufl-name="noteheadWholeWithX" />
<glyph glyph-code="E0B6" smufl-name="noteheadHalfWithX" />
<glyph glyph-code="E0B7" smufl-name="noteheadVoidWithX" />
<!--<glyph glyph-code="E0B8" smufl-name="noteheadSquareWhite" />-->
<!--<glyph glyph-code="E0B9" smufl-name="noteheadSquareBlack" />-->
<glyph glyph-code="E0B8" smufl-name="noteheadSquareWhite" />
<glyph glyph-code="E0B9" smufl-name="noteheadSquareBlack" />
<!--<glyph glyph-code="E0BA" smufl-name="noteheadTriangleUpDoubleWhole" />-->
<!--<glyph glyph-code="E0BB" smufl-name="noteheadTriangleUpWhole" />-->
<!--<glyph glyph-code="E0BC" smufl-name="noteheadTriangleUpHalf" />-->
Expand Down
4 changes: 3 additions & 1 deletion include/vrv/smufl.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ enum {
SMUFL_E0B5_noteheadWholeWithX = 0xE0B5,
SMUFL_E0B6_noteheadHalfWithX = 0xE0B6,
SMUFL_E0B7_noteheadVoidWithX = 0xE0B7,
SMUFL_E0B8_noteheadSquareWhite = 0xE0B8,
SMUFL_E0B9_noteheadSquareBlack = 0xE0B9,
SMUFL_E0D9_noteheadDiamondHalf = 0xE0D9,
SMUFL_E0DA_noteheadDiamondHalfWide = 0xE0DA,
SMUFL_E0DB_noteheadDiamondBlack = 0xE0DB,
Expand Down Expand Up @@ -658,7 +660,7 @@ enum {
};

/** The number of glyphs for verification **/
#define SMUFL_COUNT 633
#define SMUFL_COUNT 635

} // namespace vrv

Expand Down
10 changes: 9 additions & 1 deletion src/note.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,15 @@ char32_t Note::GetNoteheadGlyph(const int duration) const
// case HEADSHAPE_isotriangle: return SMUFL_E0BC_noteheadTriangleUpHalf;
// case HEADSHAPE_oval: return SMUFL_noteheadOval;
// case HEADSHAPE_piewedge: return SMUFL_noteheadPieWedge;
// case HEADSHAPE_rectangle: return SMUFL_noteheadRectangle;
case HEADSHAPE_rectangle:
if (duration < DUR_4) {
return (this->GetHeadFill() == FILL_solid) ? SMUFL_E0B9_noteheadSquareBlack
: SMUFL_E0B8_noteheadSquareWhite;
}
else {
return (this->GetHeadFill() == FILL_void) ? SMUFL_E0B8_noteheadSquareWhite
: SMUFL_E0B9_noteheadSquareBlack;
}
// case HEADSHAPE_rtriangle: return SMUFL_noteheadRTriangle;
// case HEADSHAPE_semicircle: return SMUFL_noteheadSemicircle;
case HEADSHAPE_slash: {
Expand Down

0 comments on commit c93d2fc

Please sign in to comment.