Skip to content

Commit

Permalink
fix #61931: Gonville shows nothing in the master symbols palette
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed May 27, 2015
1 parent 8c0d58e commit d33f638
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
23 changes: 13 additions & 10 deletions libmscore/sym.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5487,16 +5487,19 @@ QString ScoreFont::toString(SymId id) const
void ScoreFont::computeMetrics(Sym* sym, int code)
{
FT_UInt index = FT_Get_Char_Index(face, code);
sym->setIndex(index);
sym->setCode(code);

FT_Load_Glyph(face, index, FT_LOAD_DEFAULT);
FT_BBox bb;
FT_Outline_Get_BBox(&face->glyph->outline, &bb);
QRectF bbox;
bbox.setCoords(bb.xMin/640.0, -bb.yMax/640.0, bb.xMax/640.0, -bb.yMin/640.0);
sym->setBbox(bbox);
sym->setAdvance(face->glyph->linearHoriAdvance / 655360.0);
if (index != 0) {
if (FT_Load_Glyph(face, index, FT_LOAD_DEFAULT) == 0) {
FT_BBox bb;
if (FT_Outline_Get_BBox(&face->glyph->outline, &bb) == 0) {
QRectF bbox;
bbox.setCoords(bb.xMin/640.0, -bb.yMax/640.0, bb.xMax/640.0, -bb.yMin/640.0);
sym->setIndex(index);
sym->setCode(code);
sym->setBbox(bbox);
sym->setAdvance(face->glyph->linearHoriAdvance / 655360.0);
}
}
}
}

//---------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions libmscore/sym.h
Original file line number Diff line number Diff line change
Expand Up @@ -1799,12 +1799,12 @@ enum class SymId {
ornamentPrecompAppoggTrill,
ornamentPrecompAppoggTrillSuffix,
ornamentPrecompCadence,
ornamentPrecompCadenceUpperPrefix ,
ornamentPrecompCadenceUpperPrefix,
ornamentPrecompCadenceUpperPrefixTurn,
ornamentPrecompCadenceWithTurn ,
ornamentPrecompCadenceWithTurn,
ornamentPrecompDescendingSlide,
ornamentPrecompDoubleCadenceLowerPrefix,
ornamentPrecompDoubleCadenceUpperPrefix ,
ornamentPrecompDoubleCadenceUpperPrefix,
ornamentPrecompDoubleCadenceUpperPrefixTurn,
ornamentPrecompInvertedMordentUpperPrefix,
ornamentPrecompMordentRelease,
Expand Down
2 changes: 2 additions & 0 deletions mscore/symboldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ void SymbolDialog::createSymbols()
{
int currentIndex = fontList->currentIndex();
const ScoreFont* f = &ScoreFont::scoreFonts()[currentIndex];
// init the font if not done yet
ScoreFont::fontFactory(f->name());
sp->clear();
for (int i = 0; i < int(SymId::lastSym); ++i) {
if (f->isValid(SymId(i))) {
Expand Down

0 comments on commit d33f638

Please sign in to comment.