Fluent-Qt

기초 가이드

글꼴과 텍스트 스타일

레이블과 커스텀 위젯에 사전 설정된 Fluent 글꼴 크기와 굵기를 적용합니다.

사전 설정 글꼴 크기

Typography는 12px 캡션부터 68px 디스플레이 제목까지 9가지 프리셋을 제공합니다: Caption(12px), Body(14px), BodyStrong(14px 세미볼드), BodyLarge(18px), BodyLargeStrong(18px 세미볼드), Subtitle(20px), Title(28px), TitleLarge(40px), Display(68px). Label에 적용하려면 setFluentTypography()를 호출하세요.

#include <FluentQt/TextFields.h>

auto* title = new fluent::textfields::Label("Account settings", this);
title->setFluentTypography(Typography::FontRole::Subtitle);

일반 QWidget에서 사용

일반 Qt 위젯에는 C++의 Typography::fontStyle(role).toQFont() 또는 Python의 fluentqt.font_for_role(role)로 알맞은 QFont를 얻을 수 있습니다. Fluent 컨트롤에 QWidget::setFont를 직접 호출하면 테마 전환 시 글꼴이 자동 갱신되지 않을 수 있습니다.

#include <FluentQt/Design.h>

customWidget->setFont(Typography::fontStyle(Typography::FontRole::BodyStrong).toQFont());

API 레퍼런스