Font this is trouble of Qt, im use Qt 5.8.0
I need paint font "SF UI Display", in main.cpp im load font
void installFont() {
fontList << dir.entryList();
for (int i = 0; i < fontList.count(); ++i) {
int res
= QFontDatabase::addApplicationFont(":/font/" + fontList.
at(i
));
if (res == -1)
qDebug() << Q_FUNC_INFO << "can`t add " << fontList.at(i);
}
}
void installFont() {
QDir dir(":/font/");
QStringList fontList;
fontList << dir.entryList();
for (int i = 0; i < fontList.count(); ++i) {
int res = QFontDatabase::addApplicationFont(":/font/" + fontList.at(i));
if (res == -1)
qDebug() << Q_FUNC_INFO << "can`t add " << fontList.at(i);
}
}
To copy to clipboard, switch view to plain text mode
in qml
Text {
id: label1
anchors.left: parent.left
anchors.leftMargin: 100
anchors.top: parent.top
anchors.topMargin: 100
text: "SF UI Display Light"
font.family: "SF UI Display"
font.pixelSize: 28
font.weight: Font.Light
}
Text {
id: label1
anchors.left: parent.left
anchors.leftMargin: 100
anchors.top: parent.top
anchors.topMargin: 100
text: "SF UI Display Light"
font.family: "SF UI Display"
font.pixelSize: 28
font.weight: Font.Light
}
To copy to clipboard, switch view to plain text mode
but i see some other font, screen to qml, photoshop ->
https://joxi.ru/4zANB0SBwVOoA9
what im doing wrong ?
Bookmarks