OpenTTD Source: src/gfx_layout.cpp File Reference

OpenTTD Source 13.2.1

Data Structures | Functions
gfx_layout.cpp File Reference
`#include "stdafx.h"`
`#include "gfx_layout.h"`
`#include "string_func.h"`
`#include "strings_func.h"`
`#include "zoom_func.h"`
`#include "debug.h"`
`#include "table/control_codes.h"`
`#include <unicode/ustring.h>`
`#include "safeguards.h"`

Go to the source code of this file.

## Data Structures
class | ICUParagraphLayout
| Wrapper for doing layouts with ICU. More...
class | ICUParagraphLayout::ICUVisualRun
| Visual run contains data about the bit of text with the same font. More...
class | ICUParagraphLayout::ICULine
| A single line worth of VisualRuns. More...
class | ICUParagraphLayoutFactory
| Helper class to construct a new ICUParagraphLayout. More...
class | FallbackParagraphLayout
| Class handling the splitting of a paragraph of text into lines and visual runs. More...
class | FallbackParagraphLayout::FallbackVisualRun
| Visual run contains data about the bit of text with the same font. More...
class | FallbackParagraphLayout::FallbackLine
| A single line worth of VisualRuns. More...
class | FallbackParagraphLayoutFactory
| Helper class to construct a new FallbackParagraphLayout. More...

## Functions
template<typename T >
static void | GetLayouter (Layouter::LineCacheItem &line, const char *&str, FontState &state)
| Helper for getting a ParagraphLayouter of the given type. More...

## Detailed Description

Handling of laying out text.

Definition in file gfx_layout.cpp.

## Function Documentation

## ◆ GetLayouter()

template<typename T >

static void GetLayouter | ( | Layouter::LineCacheItem & | line,
|  | const char *& | str,
|  | FontState & | state
| ) |  |
| inlinestatic

Helper for getting a ParagraphLayouter of the given type.

Note
  In case no ParagraphLayouter could be constructed, line.layout will be nullptr.

Parameters

  line | The cache item to store our layouter in.
  str | The string to create a layouter for.
  state | The state of the font and color.

Template Parameters

  T | The type of layouter we want.

Definition at line 609 of file gfx_layout.cpp.

References Layouter::LineCacheItem::buffer, FontState::cur_colour, DRAW_STRING_BUFFER, FontState::fontsize, free(), Layouter::GetFont(), and Layouter::LineCacheItem::runs.