# Rivendell Font Management

Fred
Gleason
fredg@paravelsystems.com

## Overview

Fonts in Rivendell are managed by the `RDFontEngine` class, which generates them based on a set of abstract "roles" from a small group of parameters provided in the `[Fonts]` section of `rd.conf` 5. The intent is to provide a consistent look-and-feel throughout the various Rivendell user modules while providing a convenient means for local customization.

## Accessing Fonts

The simplest method for gaining access to Rivendell fonts is to inherit from one of the following classes:

- `RDDialog`
- `RDFrame`
- `RDPushButton`
- `RDWidget`

Each of these classes (as well as `RDFontEngine` itself) provides the following font methods:

### Button Fonts

`buttonFont()`

  Font for use in `QPushButton` widgets used for primary navigation, such as the "OK" and "Cancel" button found in most dialogs in `rdadmin` 1.

`hugeButtonFont()`

  Font for use in `QPushButton` widgets requiring an especially large font, such as the numbered "line" buttons in `rdcartslots` 1.

`bigButtonFont()`

  Font for use in `QPushButton` widgets requiring a large font, such as the "Add", "Move", "Delete" and "Copy" buttons in `rdairplay` 1.

`subButtonFont()`

  Font for use in `QPushButton` widgets used for subsidiary navigation, such as "Select" buttons used to invoke file pickers.

### Label Fonts

`bigLabelFont()`

  Font for use in `QLabel` widgets used for labeling the major UI element in a dialog, such as a `QListView`.

`labelFont()`

  Font for use in `QLabel` widgets used for item labeling, such as the various output names in the Configure RDAirPlay dialog in `rdadmin` 1.

`sectionLabelFont()`

  Font for use in `QLabel` widgets used for identifying major sections within a particular dialog, such as the "Channel Assignments", "Log Settings", "Display Settings" and "Start/Stop Settings" sections of the Configure RDAirPlay dialog in `rdadmin` 1.

`subLabelFont()`

  Font for use in `QLabel` widgets used for sub-item labeling, such as the "Card" and "Port" fields in the Configure RDAirPlay dialog in `rdadmin` 1.

### Miscellaneous Fonts

`progressFont()`

  Font for use in `QProgressBar` widgets used for showing progress on long-running operations, such as posting a podcast in `rdcastmanager` 1.

`bannerFont()`

  Font for use where a large display font is needed, such as the "L" and "R" channel markers on the waveform display in the Edit Audio dialog in `rdlibrary` 1.

`timerFont()`

  Font for use in timer displays, such as the one in the Cut Info/Record dialog in `rdlibrary` 1.

`smallTimerFont()`

  Font for use in small timer displays, such as the one on SoundPanel buttons in `rdairplay` 1.

### The Default Font

The `defaultFont()` method returns a font that can also be obtained by calling the `font()` method of `RDDialog`, `RDFrame`, `RDPushButton` and `RDWidget` classes. As implied by its name, this font will also be assigned by default to any child widgets of those classes. This font should be used for all data element classes (`QLineEdit`, `QComboBox`, `QTextEdit`, etc.)

## Examples

### RDAirPlay

Examples of `bigButtonFont()`, `smallTimerFont()` and `timerFont()`

### RDCartSlots

Example of `hugeButtonFont()`

### RDAdmin - Configure RDAirPlay

Examples of `buttonFont()`, `subButtonFont()`, `labelFontFont()`, `sectionLabelFont()` and `subLabelFont()`

### RDLibrary - Edit Audio

Example of `bannerFont()`

### RDCastManager - Uploading Audio

Example of `progressFont()`

### RDCastManager - List Carts

Example of `bigLabelFont()`