OpenTTD Source 20260218-master-g2123fca5ea
ParagraphLayouter::Line Class Referenceabstract

A single line worth of VisualRuns. More...

#include <gfx_layout.h>

Inheritance diagram for ParagraphLayouter::Line:
CoreTextParagraphLayout::CoreTextLine FallbackParagraphLayout::FallbackLine ICUParagraphLayout::ICULine UniscribeParagraphLayout::UniscribeLine

Public Member Functions

virtual int GetLeading () const =0
 Get the font leading, or distance between the baselines of consecutive lines.
virtual int GetWidth () const =0
 Get the width of this line.
virtual size_t CountRuns () const =0
 Get the number of runs in this line.
virtual const VisualRunGetVisualRun (size_t run) const =0
 Get a reference to the given run.
virtual int GetInternalCharLength (char32_t c) const =0
 Get the number of elements the given character occupies in the underlying text buffer of the Layouter.

Detailed Description

A single line worth of VisualRuns.

Definition at line 174 of file gfx_layout.h.

Member Function Documentation

◆ CountRuns()

virtual size_t ParagraphLayouter::Line::CountRuns ( ) const
pure virtual

Get the number of runs in this line.

Returns
The number of runs.

Implemented in CoreTextParagraphLayout::CoreTextLine, FallbackParagraphLayout::FallbackLine, ICUParagraphLayout::ICULine, and UniscribeParagraphLayout::UniscribeLine.

Referenced by DrawLayoutLine().

◆ GetInternalCharLength()

virtual int ParagraphLayouter::Line::GetInternalCharLength ( char32_t c) const
pure virtual

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.

Implemented in CoreTextParagraphLayout::CoreTextLine, FallbackParagraphLayout::FallbackLine, ICUParagraphLayout::ICULine, and UniscribeParagraphLayout::UniscribeLine.

◆ GetLeading()

virtual int ParagraphLayouter::Line::GetLeading ( ) const
pure virtual

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..

Implemented in CoreTextParagraphLayout::CoreTextLine, FallbackParagraphLayout::FallbackLine, ICUParagraphLayout::ICULine, and UniscribeParagraphLayout::UniscribeLine.

Referenced by DrawLayoutLine().

◆ GetVisualRun()

virtual const VisualRun & ParagraphLayouter::Line::GetVisualRun ( size_t run) const
pure virtual

Get a reference to the given run.

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

Implemented in CoreTextParagraphLayout::CoreTextLine, FallbackParagraphLayout::FallbackLine, ICUParagraphLayout::ICULine, and UniscribeParagraphLayout::UniscribeLine.

Referenced by DrawLayoutLine().

◆ GetWidth()

virtual int ParagraphLayouter::Line::GetWidth ( ) const
pure virtual

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