From 17e98668b2348782efaa22f6db843cf1bf384e0b Mon Sep 17 00:00:00 2001 From: shouchih_chen Date: Wed, 3 Jul 2024 22:45:59 +0800 Subject: [PATCH] try show font name --- NameCreater/NameCreater.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/NameCreater/NameCreater.cpp b/NameCreater/NameCreater.cpp index a3f871d..4b3b299 100644 --- a/NameCreater/NameCreater.cpp +++ b/NameCreater/NameCreater.cpp @@ -94,9 +94,11 @@ void NameCreater::loadFont(const QByteArray& fontdata){ version_font.setPixelSize(12); //ui.tital_label->setFont(tital_font); - QString fontName = QString::fromUtf8(family_list.at(0).toUtf8()); + QTextCodec *codec = QTextCodec::codecForName("Big5"); + QString fontname = codec->toUnicode(family_list.at(0).toStdString().c_str()); + ui.version_label->setFont(version_font); - ui.version_label->setText(QString(VERSION).append("/cht font:")+fontName); + ui.version_label->setText(QString(VERSION).append("/cht font:").append(fontname)); QList titals = findChildren(QRegularExpression("tital_label")); foreach(auto tital, titals) {