Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
PhosphorTheme::FontFaces Class Reference

The shell's two type faces, resolved against what is installed. More...

#include <PhosphorTheme/FontFaces.h>

Inheritance diagram for PhosphorTheme::FontFaces:
[legend]

Signals

void facesChanged ()

Public Member Functions

 FontFaces (QObject *parent=nullptr)
 The display and UI family.
QString ui () const
QString mono () const
bool uiPreferred () const
bool monoPreferred () const
void refresh ()
 Re-read the font database (a font installed while the shell runs).

Static Public Member Functions

static QStringList uiCandidates ()
 The preference lists, first entry the identity's face.
static QStringList monoCandidates ()
static QString resolve (const QStringList &candidates, const QString &fallback)
 First installed family from candidates, else fallback.

Detailed Description

The shell's two type faces, resolved against what is installed.

The identity (05 §7) sets Manrope for display and UI text and JetBrains Mono for every value. Neither ships with a desktop, and binding the name unconditionally hands the choice to fontconfig, which substitutes by its own rules (often a serif, or the wrong weight axis). This singleton asks the font database instead and walks a short preference list per role, ending on the system face, so Tokens.font_family_ui always names a family that exists.

Resolved once on construction (the QML engine constructs the singleton on first access, after the platform font database exists) and again on refresh().

Constructor & Destructor Documentation

◆ FontFaces()

PhosphorTheme::FontFaces::FontFaces ( QObject * parent = nullptr)
explicit

The display and UI family.

The tabular value family. Whether the preferred faces (Manrope, JetBrains Mono) were found.

Member Function Documentation

◆ facesChanged

void PhosphorTheme::FontFaces::facesChanged ( )
signal

◆ mono()

QString PhosphorTheme::FontFaces::mono ( ) const
nodiscard

◆ monoCandidates()

QStringList PhosphorTheme::FontFaces::monoCandidates ( )
staticnodiscard

◆ monoPreferred()

bool PhosphorTheme::FontFaces::monoPreferred ( ) const
nodiscard

◆ refresh()

void PhosphorTheme::FontFaces::refresh ( )

Re-read the font database (a font installed while the shell runs).

◆ resolve()

QString PhosphorTheme::FontFaces::resolve ( const QStringList & candidates,
const QString & fallback )
staticnodiscard

First installed family from candidates, else fallback.

◆ ui()

QString PhosphorTheme::FontFaces::ui ( ) const
nodiscard

◆ uiCandidates()

QStringList PhosphorTheme::FontFaces::uiCandidates ( )
staticnodiscard

The preference lists, first entry the identity's face.

◆ uiPreferred()

bool PhosphorTheme::FontFaces::uiPreferred ( ) const
nodiscard

The documentation for this class was generated from the following file: