Foundations
Typography
Use font roles for headings, body text, and captions.
Font roles
Typography has nine roles: Caption (12px), Body (14px), BodyStrong (14px semibold), BodyLarge (18px), BodyLargeStrong (18px semibold), Subtitle (20px), Title (28px), TitleLarge (40px), and Display (68px). Set a role on Label with setFluentTypography().
#include <FluentQt/TextFields.h>
auto* title = new fluent::textfields::Label("Account settings", this);
title->setFluentTypography(Typography::FontRole::Subtitle);import fluentqt
title = fluentqt.Label("Account settings")
title.setFluentTypography(fluentqt.FontRole.Subtitle)Fonts for other widgets
For a widget that is not a Label, get a QFont from Typography::fontStyle(role).toQFont() in C++ or fluentqt.font_for_role(role) in Python. Calling setFont() on a Fluent control may stop it from following later theme font changes; check that control's API.
#include <FluentQt/Design.h>
customWidget->setFont(Typography::fontStyle(Typography::FontRole::BodyStrong).toQFont());import fluentqt
custom_widget.setFont(fluentqt.font_for_role(fluentqt.FontRole.BodyStrong))