FluentUI/src/FluTextStyle.cpp

49 lines
1.1 KiB
C++
Raw Normal View History

2023-05-22 16:17:51 +08:00
#include "FluTextStyle.h"
2023-05-10 00:27:53 +08:00
2023-09-13 15:11:22 +08:00
FluTextStyle::FluTextStyle(QObject *parent):QObject{parent}{
2024-04-04 01:10:14 +08:00
_family = QFont().defaultFamily();
#ifdef Q_OS_WIN
_family = "微软雅黑";
#endif
2023-05-10 00:27:53 +08:00
QFont caption;
2024-04-04 01:10:14 +08:00
caption.setFamily(_family);
2023-05-10 00:27:53 +08:00
caption.setPixelSize(12);
Caption(caption);
QFont body;
2024-04-04 01:10:14 +08:00
body.setFamily(_family);
2023-06-18 23:54:39 +08:00
body.setPixelSize(13);
2023-05-10 00:27:53 +08:00
Body(body);
QFont bodyStrong;
2024-04-04 01:10:14 +08:00
bodyStrong.setFamily(_family);
2023-07-14 18:18:46 +08:00
bodyStrong.setPixelSize(13);
2023-12-01 18:14:10 +08:00
bodyStrong.setWeight(QFont::DemiBold);
2023-05-10 00:27:53 +08:00
BodyStrong(bodyStrong);
QFont subtitle;
2024-04-04 01:10:14 +08:00
subtitle.setFamily(_family);
2023-05-10 00:27:53 +08:00
subtitle.setPixelSize(20);
2023-12-01 18:14:10 +08:00
subtitle.setWeight(QFont::DemiBold);
2023-05-10 00:27:53 +08:00
Subtitle(subtitle);
QFont title;
2024-04-04 01:10:14 +08:00
title.setFamily(_family);
2023-05-10 00:27:53 +08:00
title.setPixelSize(28);
2023-12-01 18:14:10 +08:00
title.setWeight(QFont::DemiBold);
2023-05-10 00:27:53 +08:00
Title(title);
QFont titleLarge;
2024-04-04 01:10:14 +08:00
titleLarge.setFamily(_family);
2023-05-10 00:27:53 +08:00
titleLarge.setPixelSize(40);
2023-12-01 18:14:10 +08:00
titleLarge.setWeight(QFont::DemiBold);
2023-05-10 00:27:53 +08:00
TitleLarge(titleLarge);
QFont display;
2024-04-04 01:10:14 +08:00
display.setFamily(_family);
2023-05-10 00:27:53 +08:00
display.setPixelSize(68);
2023-12-01 18:14:10 +08:00
display.setWeight(QFont::DemiBold);
2023-05-10 00:27:53 +08:00
Display(display);
}