OpenTTD Source 20260304-master-g1baaa74679
FallbackParagraphLayout::FallbackLine Class Reference

A single line worth of VisualRuns. More...

Inheritance diagram for FallbackParagraphLayout::FallbackLine:
ParagraphLayouter::Line

Public Member Functions

int GetLeading () const override
 Get the font leading, or distance between the baselines of consecutive lines.
int GetWidth () const override
 Get the width of this line.
size_t CountRuns () const override
 Get the number of runs in this line.
const ParagraphLayouter::VisualRunGetVisualRun (size_t run) const override
 Get a reference to the given run.
int GetInternalCharLength (char32_t) const override
 Get the number of elements the given character occupies in the underlying text buffer of the Layouter.
Public Member Functions inherited from ParagraphLayouter::Line
virtual ~Line ()=default
 Ensure the destructor of the sub classes are called as well.

Detailed Description

A single line worth of VisualRuns.

Definition at line 59 of file gfx_layout_fallback.cpp.

Member Function Documentation

◆ CountRuns()

size_t FallbackParagraphLayout::FallbackLine::CountRuns ( ) const
overridevirtual

Get the number of runs in this line.

Returns
The number of runs.

Implements ParagraphLayouter::Line.

Definition at line 162 of file gfx_layout_fallback.cpp.

Referenced by GetWidth().

◆ GetInternalCharLength()

int FallbackParagraphLayout::FallbackLine::GetInternalCharLength ( char32_t c) const
inlineoverridevirtual

Get the number of elements the given character occupies in the underlying text buffer of the Layouter.

Many use UTF-16 internally, meaning a character larger than MAX_UINT16 occupies two places in its buffer.

Parameters
cThe character to get the length for.
Returns
The length.

Implements ParagraphLayouter::Line.

Definition at line 66 of file gfx_layout_fallback.cpp.

◆ GetLeading()

int FallbackParagraphLayout::FallbackLine::GetLeading ( ) const
overridevirtual

Get the font leading, or distance between the baselines of consecutive lines.

Returns
The leading in pixels, which is generally the maximum of all runs..

Implements ParagraphLayouter::Line.

Definition at line 137 of file gfx_layout_fallback.cpp.

◆ GetVisualRun()

const ParagraphLayouter::VisualRun & FallbackParagraphLayout::FallbackLine::GetVisualRun ( size_t run) const
overridevirtual

Get a reference to the given run.

Parameters
runThe index into the runs.
Returns
The reference to the run.

Implements ParagraphLayouter::Line.

Definition at line 167 of file gfx_layout_fallback.cpp.

Referenced by GetWidth().

◆ GetWidth()

int FallbackParagraphLayout::FallbackLine::GetWidth ( ) const
overridevirtual

Get the width of this line.

Returns
The width of the line.

Implements ParagraphLayouter::Line.

Definition at line 147 of file gfx_layout_fallback.cpp.

References CountRuns(), and GetVisualRun().


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