OpenTTD Source: FontState Struct Reference

OpenTTD Source 13.2.1

Public Member Functions | Data Fields
FontState Struct Reference

Text drawing parameters, which can change while drawing a line, but are kept between multiple parts of the same text, e.g. More...

`#include <gfx_layout.h>`

## Public Member Functions
| FontState (TextColour colour, FontSize fontsize)
void | SetColour (TextColour c)
| Switch to new colour c. More...
void | PopColour ()
| Switch to and pop the last saved colour on the stack.
void | PushColour ()
| Push the current colour on to the stack.
void | SetFontSize (FontSize f)
| Switch to using a new font f. More...

## Data Fields
FontSize | fontsize
| Current font size.
TextColour | cur_colour
| Current text colour.
std::stack< TextColour, std::vector< TextColour > > | colour_stack
| Stack of colours to assist with colour switching.

## Detailed Description

Text drawing parameters, which can change while drawing a line, but are kept between multiple parts of the same text, e.g.

on line breaks.

Definition at line 35 of file gfx_layout.h.

## Member Function Documentation

## ◆ SetColour()

void FontState::SetColour | ( | TextColour | c | ) |
| inline

Switch to new colour c.

Parameters

  c | New colour to use.

Definition at line 48 of file gfx_layout.h.

References TC_COLOUR_MASK.

Referenced by PopColour().

## ◆ SetFontSize()

void FontState::SetFontSize | ( | FontSize | f | ) |
| inline

Switch to using a new font f.

Parameters

  f | New font to use.

Definition at line 77 of file gfx_layout.h.

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

- src/gfx_layout.h