fix note parenthesis SMuFL way, use proper accidental parenthesis from SMuFL font

This commit is contained in:
lasconic 2014-11-25 18:01:41 +01:00
parent 557a4e49c6
commit fc7188b329
6 changed files with 60 additions and 26 deletions

View file

@ -83,6 +83,12 @@
"accidentalQuarterToneFlatNaturalArrowDown": {
"codepoint": "U+e1bf"
},
"accidentalParensLeft": {
"codepoint": "U+E26A"
},
"accidentalParensRight": {
"codepoint": "U+E26B"
},
"arrowheadBlackDown": {
"codepoint": "U+E126"
},

Binary file not shown.

View file

@ -20,7 +20,7 @@ OS2Version: 3
OS2_WeightWidthSlopeOnly: 0
OS2_UseTypoMetrics: 1
CreationTime: 1403170689
ModificationTime: 1413789183
ModificationTime: 1416931484
PfmFamily: 17
TTFWeight: 400
TTFWidth: 5
@ -63,7 +63,7 @@ NameList: Adobe Glyph List
DisplaySize: -72
AntiAlias: 1
FitToEm: 1
WinInfo: 59640 10 8
WinInfo: 57930 10 8
BeginPrivate: 7
BlueValues 21 [0 0 256 257 478 478]
OtherBlues 11 [-141 -141]
@ -73,7 +73,7 @@ StdVW 4 [38]
StemSnapH 26 [24 30 34 40 44 55 80 102]
StemSnapV 20 [32 38 44 50 59 100]
EndPrivate
BeginChars: 65539 282
BeginChars: 65539 284
StartChar: .notdef
Encoding: 65536 -1 0
@ -2768,26 +2768,24 @@ EndChar
StartChar: uniE11D
Encoding: 57629 57629 57
Width: 152
Width: 116
GlyphClass: 2
Flags: W
VStem: 102 52<-126.266 128.29>
VStem: 64 52<-126.266 128.29>
LayerCount: 2
Fore
Refer: 27 57507 N 1 0 0 1 0 0 2
Validated: 1
Refer: 27 57507 N 1 0 0 1 -38 0 2
EndChar
StartChar: uniE11E
Encoding: 57630 57630 58
Width: 0
Width: 116
GlyphClass: 2
Flags: W
VStem: -154 52<-126.266 128.29>
VStem: 0 52<-126.266 128.29>
LayerCount: 2
Fore
Refer: 26 57506 N 1 0 0 1 -180 0 2
Validated: 1
Refer: 26 57506 N 1 0 0 1 -26 0 2
EndChar
StartChar: uniE11F
@ -12936,5 +12934,27 @@ SplineSet
EndSplineSet
Validated: 1
EndChar
StartChar: uniE26A
Encoding: 57962 57962 282
Width: 116
Flags: W
VStem: 0 52<-126.266 128.29>
LayerCount: 2
Fore
Refer: 26 57506 N 1 0 0 1 -26 0 2
Validated: 1
EndChar
StartChar: uniE26B
Encoding: 57963 57963 283
Width: 116
Flags: W
VStem: 64 52<-126.266 128.29>
LayerCount: 2
Fore
Refer: 27 57507 N 1 0 0 1 -38 0 2
Validated: 1
EndChar
EndChars
EndSplineFont

Binary file not shown.

View file

@ -310,9 +310,9 @@ void Accidental::layout()
m = magS();
if (_hasBracket) {
SymElement e(SymId::noteheadParenthesisLeft, 0.0);
SymElement e(SymId::accidentalParensLeft, 0.0);
el.append(e);
r |= symBbox(SymId::noteheadParenthesisLeft);
r |= symBbox(SymId::accidentalParensLeft);
}
SymId s = symbol();
@ -323,9 +323,9 @@ void Accidental::layout()
if (_hasBracket) {
x = r.x()+r.width();
SymElement e(SymId::noteheadParenthesisRight, x);
SymElement e(SymId::accidentalParensRight, x);
el.append(e);
r |= symBbox(SymId::noteheadParenthesisRight).translated(x, 0.0);
r |= symBbox(SymId::accidentalParensRight).translated(x, 0.0);
}
setbbox(r);
}

View file

@ -1641,15 +1641,22 @@ void Note::layout2()
if (!score()->tagIsValid(e->tag()))
continue;
e->setMag(mag());
if (e->type() == Element::Type::SYMBOL && static_cast<Symbol*>(e)->sym() == SymId::noteheadParenthesisRight) {
if (e->type() == Element::Type::SYMBOL) {
qreal w = headWidth();
Symbol* sym = static_cast<Symbol*>(e);
QPointF rp = e->readPos();
e->layout();
if (sym->sym() == SymId::noteheadParenthesisRight) {
if (staff()->isTabStaff()) {
StaffType* tab = staff()->staffType();
w = tabHeadWidth(tab);
}
QPointF rp = e->readPos();
e->layout();
e->rxpos() += w;
}
else if (sym->sym() == SymId::noteheadParenthesisLeft) {
e->rxpos() -= symWidth(SymId::noteheadParenthesisLeft);
}
if (sym->sym() == SymId::noteheadParenthesisLeft || sym->sym() == SymId::noteheadParenthesisRight) {
// adjustReadPos() was called too early in layout(), adjust:
if (!rp.isNull()) {
e->setUserOff(QPointF());
@ -1657,6 +1664,7 @@ void Note::layout2()
e->adjustReadPos();
}
}
}
else
e->layout();
}