Skip to content

Commit

Permalink
Combine font face and size into one tag if both are changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Jojo-Schmitz committed Mar 31, 2024
1 parent de120c3 commit daf4541
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/engraving/dom/textbase.cpp
Expand Up @@ -2216,11 +2216,16 @@ String TextBase::genText(const LayoutData* ldata) const
}
}

if (format.fontSize() != fmt.fontSize()) {
text += String(u"<font size=\"%1\"/>").arg(format.fontSize());
}
if (format.fontFamily() != "ScoreText" && format.fontFamily() != fmt.fontFamily()) {
text += String(u"<font face=\"%1\"/>").arg(TextBase::escape(format.fontFamily()));
if (format.fontSize() != fmt.fontSize()
|| (format.fontFamily() != "ScoreText" && format.fontFamily() != fmt.fontFamily())) {
text += String(u"<font");
if (format.fontSize() != fmt.fontSize()) {
text += String(u" size=\"%1\"").arg(format.fontSize());
}
if (format.fontFamily() != "ScoreText" && format.fontFamily() != fmt.fontFamily()) {
text += String(u" face=\"%1\"").arg(TextBase::escape(format.fontFamily()));
}
text += u"/>";
}

VerticalAlignment va = format.valign();
Expand Down

0 comments on commit daf4541

Please sign in to comment.