[frameworks-kconfig] [Bug 499736] Font features settings are not saved
Christoph Cullmann
bugzilla_noreply at kde.org
Mon Mar 24 17:45:22 GMT 2025
https://bugs.kde.org/show_bug.cgi?id=499736
Christoph Cullmann <christoph at cullmann.io> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|konsole-devel at kde.org |matthew at mjdsystems.ca
Product|konsole |frameworks-kconfig
Component|font |general
Version|24.12.2 |unspecified
CC| |christoph at cullmann.io,
| |kdelibs-bugs at kde.org
--- Comment #3 from Christoph Cullmann <christoph at cullmann.io> ---
Needs to be fixed in the read/write of fonts in the framework, KTextEditor
workarounds with
// read font, including font features
auto font = config.readEntry(KEY_FONT,
QFontDatabase::systemFont(QFontDatabase::FixedFont));
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
const QStringList rawFeaturesList = config.readEntry(KEY_FONT_FEATURES,
QStringList());
for (const QString &feature : rawFeaturesList) {
const auto parts = feature.split(QStringLiteral("="),
Qt::SkipEmptyParts);
if (parts.length() == 2) {
const auto tag = QFont::Tag::fromString(parts[0]);
bool ok = false;
const int number = parts[1].toInt(&ok);
if (tag.has_value() && ok) {
font.setFeature(tag.value(), number);
}
}
}
#endif
and
// write font, including font features
const auto font = baseFont();
config.writeEntry(KEY_FONT, font);
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
const auto tags = font.featureTags();
QStringList features;
for (const auto &tag : tags) {
const QString name = QString::fromUtf8(tag.toString());
const quint32 value = font.featureValue(tag);
features.push_back(QStringLiteral("%1=%2").arg(name,
QString::number(value)));
}
config.writeEntry(KEY_FONT_FEATURES, features);
#endif
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the konsole-devel
mailing list