|
OpenTTD Source 20261112-master-gbcbec5e63f
|
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 ()=default | |
| Create the font state with an invalid state. | |
| FontState (FontSize fontsize, ExtendedTextColour colour) | |
| Create the font state. | |
| auto | operator<=> (const FontState &) const =default |
| Compare with another instance of this class. | |
| 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. | |
| Public Member Functions inherited from Font | |
| constexpr auto | operator<=> (const Font &) const =default |
| Compare with another instance of this class. | |
| FontCache & | GetFontCache () const |
| Get the font cache of this font. | |
Data Fields | |
| std::vector< ExtendedTextColour > | colour_stack |
| Stack of colours to assist with colour switching. | |
| Data Fields inherited from Font | |
| FontSize | fontsize = FontSize::End |
| The font size. | |
| ExtendedTextColour | colour = TextColour::Invalid |
| The text colour. | |
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 43 of file gfx_layout.h.
|
inline |
Create the font state.
| colour | The colour of the font. |
| fontsize | The size of the font. |
Definition at line 55 of file gfx_layout.h.
References Font::colour, and Font::fontsize.
|
default |
Compare with another instance of this class.
References FontState().
|
inline |
Switch to and pop the last saved colour on the stack.
Definition at line 77 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 87 of file gfx_layout.h.
References Font::colour, and colour_stack.
Referenced by GetLayouter().
|
inline |
Switch to new colour c.
| c | New colour to use. |
Definition at line 67 of file gfx_layout.h.
References Begin, ExtendedTextColour::colour, Font::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 96 of file gfx_layout.h.
References Font::fontsize.
Referenced by GetLayouter().
| std::vector<ExtendedTextColour> FontState::colour_stack |
Stack of colours to assist with colour switching.
Definition at line 45 of file gfx_layout.h.
Referenced by PopColour(), and PushColour().