|
OpenTTD Source 20260531-master-g0e951f3528
|
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 () | |
| Create the font state with an invalid state. | |
| FontState (ExtendedTextColour colour, FontSize fontsize) | |
| Create the font state. | |
| auto | operator<=> (const FontState &) const =default |
| void | SetColour (ExtendedTextColour c) |
| Switch to new colour c. | |
| 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. | |
Data Fields | |
| FontSize | fontsize |
| Current font size. | |
| ExtendedTextColour | cur_colour |
| Current text colour. | |
| std::vector< ExtendedTextColour > | colour_stack |
| Stack of colours to assist with colour switching. | |
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 24 of file gfx_layout.h.
|
inline |
Create the font state with an invalid state.
Definition at line 30 of file gfx_layout.h.
References cur_colour, End, and fontsize.
|
inline |
Create the font state.
| colour | The colour of the font. |
| fontsize | The size of the font. |
Definition at line 36 of file gfx_layout.h.
References cur_colour, and fontsize.
|
inline |
Switch to and pop the last saved colour on the stack.
Definition at line 54 of file gfx_layout.h.
References colour_stack, and SetColour().
Referenced by GetLayouter().
|
inline |
Push the current colour on to the stack.
Definition at line 64 of file gfx_layout.h.
References colour_stack.
Referenced by GetLayouter().
|
inline |
Switch to new colour c.
| c | New colour to use. |
Definition at line 44 of file gfx_layout.h.
References Begin, ExtendedTextColour::colour, End, ExtendedTextColour::flags, Forced, Invalid, IsPaletteColour, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().
Referenced by GetLayouter(), and PopColour().
|
inline |
Switch to using a new font f.
| f | New font to use. |
Definition at line 73 of file gfx_layout.h.
Referenced by GetLayouter().
| std::vector<ExtendedTextColour> FontState::colour_stack |
Stack of colours to assist with colour switching.
Definition at line 27 of file gfx_layout.h.
Referenced by PopColour(), and PushColour().
| ExtendedTextColour FontState::cur_colour |
Current text colour.
Definition at line 26 of file gfx_layout.h.
Referenced by FontState(), FontState(), and GetLayouter().
| FontSize FontState::fontsize |
Current font size.
Definition at line 25 of file gfx_layout.h.
Referenced by FontState(), FontState(), and GetLayouter().