OpenTTD
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.
void SetPreviousColour ()
 Switch to previous colour.
void SetFontSize (FontSize f)
 Switch to using a new font f.

Data Fields

FontSize fontsize
 Current font size.
TextColour cur_colour
 Current text colour.
TextColour prev_colour
 Text colour from before the last colour switch.

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 33 of file gfx_layout.h.

Member Function Documentation

void FontState::SetColour ( TextColour  c)
inline

Switch to new colour c.

Parameters
cNew colour to use.

Definition at line 45 of file gfx_layout.h.

References cur_colour, and prev_colour.

Referenced by GetLayouter().

void FontState::SetFontSize ( FontSize  f)
inline

Switch to using a new font f.

Parameters
fNew font to use.

Definition at line 62 of file gfx_layout.h.

References fontsize.

Referenced by GetLayouter().

void FontState::SetPreviousColour ( )
inline

Switch to previous colour.

Definition at line 53 of file gfx_layout.h.

References cur_colour, prev_colour, and Swap().

Referenced by GetLayouter().


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