Skip to content

Commit

Permalink
fix potential font issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dfober committed Jan 8, 2024
1 parent 4939e6a commit d244b63
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/engine/graphic/GRSpecial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ void GRSpecial::OnDraw(VGDevice & hdc) const
// TODO: scale the graphic context instead.
const int fontSize = (int)(((ar->getSize() ? ar->getSize()->getValue() : 1) * 4 * LSPACE) + float(0.5)); // +0.5 to round from float to int.
const VGFont* myfont = FontManager::FindOrCreateFont( fontSize );
const VGFont* savedFont = hdc.GetMusicFont();
hdc.SetMusicFont( myfont );
hdc.SetFontAlign( VGDevice::kAlignLeft | VGDevice::kAlignBase );

Expand All @@ -62,5 +63,6 @@ void GRSpecial::OnDraw(VGDevice & hdc) const
}
hdc.DrawMusicSymbol((mPosition.x + specialXOffset), (mPosition.y + specialYOffset), theSymbol);
if (tps) hdc.SetFontColor(prevTextColor);
hdc.SetMusicFont( savedFont );
}

0 comments on commit d244b63

Please sign in to comment.