Skip to content

Commit

Permalink
Use scoped enums for font flags.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed May 2, 2024
1 parent afed06a commit 6462cda
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions codegen/style/generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ QString Generator::valueAssignmentCode(
}
family = QString("font%1index").arg(familyIndex);
}
return QString("{ %1, %2, %3 }").arg(pxValueName(v.size)).arg(v.flags).arg(family);
return QString("{ %1, FontFlags::from_raw(%2), %3 }").arg(pxValueName(v.size)).arg(v.flags).arg(family);
} break;
case Tag::Icon: {
auto v(value.Icon());
Expand Down Expand Up @@ -1028,7 +1028,7 @@ bool Generator::writeFontFamiliesInit() {
source_->stream() << "void initFontFamilies() {\n";
for (auto i = fontFamilies_.cbegin(), e = fontFamilies_.cend(); i != e; ++i) {
auto family = stringToEncodedString(i.key());
source_->stream() << "\tfont" << i.value() << "index = style::internal::registerFontFamily(" << family << ");\n";
source_->stream() << "\tfont" << i.value() << "index = style::internal::RegisterFontFamily(" << family << ");\n";
}
source_->stream() << "}\n\n";
return true;
Expand Down

0 comments on commit 6462cda

Please sign in to comment.