The layouter performs all the layout work. More...
#include <gfx_layout.h>
Public Member Functions | |
Layouter (const char *str, int maxw=INT32_MAX, TextColour colour=TC_FROMSTRING, FontSize fontsize=FS_NORMAL) | |
Create a new layouter. | |
~Layouter () | |
Free everything we allocated. | |
Dimension | GetBounds () |
Get the boundaries of this paragraph. | |
Private Types | |
typedef UChar | CharType |
The type of character used within the layouter. | |
Private Member Functions | |
size_t | AppendToBuffer (CharType *buff, const CharType *buffer_last, WChar c) |
ParagraphLayout * | GetParagraphLayout (CharType *buff, CharType *buff_end, FontMap &fontMapping) |
Private Attributes | |
CharType | buffer [DRAW_STRING_BUFFER] |
Buffer for the text that is going to be drawn. | |
SmallVector< Font *, 4 > | fonts |
The fonts needed for drawing. |
The layouter performs all the layout work.
It also accounts for the memory allocations and frees.
Definition at line 121 of file gfx_layout.h.
Layouter::Layouter | ( | const char * | str, | |
int | maxw = INT32_MAX , |
|||
TextColour | colour = TC_FROMSTRING , |
|||
FontSize | fontsize = FS_NORMAL | |||
) |
Create a new layouter.
str | The string to create the layout for. | |
maxw | The maximum width. | |
colour | The colour of the font. | |
fontsize | The size of font to use. |
Definition at line 406 of file gfx_layout.cpp.
References SmallVector< ParagraphLayout::Line *, S >::Append(), SmallVector< T, S >::Append(), SmallMap< T, U, S >::Contains(), fonts, SmallMap< T, U, S >::Insert(), lastof, SCC_BIGFONT, SCC_TINYFONT, and Swap().
Layouter::~Layouter | ( | ) |
Free everything we allocated.
Definition at line 472 of file gfx_layout.cpp.
References SmallVector< T, S >::Begin(), SmallVector< T, S >::End(), and fonts.
Dimension Layouter::GetBounds | ( | ) |
Get the boundaries of this paragraph.
Definition at line 483 of file gfx_layout.cpp.
References SmallVector< ParagraphLayout::Line *, S >::Begin(), and SmallVector< ParagraphLayout::Line *, S >::End().
Referenced by DrawStringMultiLine(), GetStringBoundingBox(), and GetStringHeight().