OpenTTD Source 20260304-master-g1baaa74679
ICUParagraphLayout::ICUVisualRun Class Reference

Visual run contains data about the bit of text with the same font. More...

Inheritance diagram for ICUParagraphLayout::ICUVisualRun:
ParagraphLayouter::VisualRun

Public Member Functions

 ICUVisualRun (const ICURun &run, int x)
 Constructor for a new ICUVisualRun.
std::span< const GlyphIDGetGlyphs () const override
 Get the glyphs to draw.
std::span< const PositionGetPositions () const override
 Get the positions for each of the glyphs.
std::span< const int > GetGlyphToCharMap () const override
 The offset for each of the glyphs to the character run that was passed to the Layouter.
const FontGetFont () const override
 Get the font.
int GetLeading () const override
 Get the font leading, or distance between the baselines of consecutive lines.
size_t GetGlyphCount () const override
 Get the number of glyphs.
int GetAdvance () const
Public Member Functions inherited from ParagraphLayouter::VisualRun
virtual ~VisualRun ()=default
 Ensure the destructor of the sub classes are called as well.

Private Attributes

std::vector< GlyphIDglyphs
std::vector< Positionpositions
std::vector< int > glyph_to_char
int total_advance
const Fontfont

Detailed Description

Visual run contains data about the bit of text with the same font.

Definition at line 62 of file gfx_layout_icu.cpp.

Constructor & Destructor Documentation

◆ ICUVisualRun()

ICUParagraphLayout::ICUVisualRun::ICUVisualRun ( const ICURun & run,
int x )

Constructor for a new ICUVisualRun.

It bases all information on the ICURun, which should already be shaped.

Parameters
runThe ICURun to base the visual run on.
xThe offset of the run on the line.

Definition at line 131 of file gfx_layout_icu.cpp.

References ICURun::positions.

Member Function Documentation

◆ GetAdvance()

int ICUParagraphLayout::ICUVisualRun::GetAdvance ( ) const
inline

Definition at line 81 of file gfx_layout_icu.cpp.

◆ GetFont()

const Font * ICUParagraphLayout::ICUVisualRun::GetFont ( ) const
inlineoverridevirtual

Get the font.

Returns
The font used for this run.

Implements ParagraphLayouter::VisualRun.

Definition at line 78 of file gfx_layout_icu.cpp.

◆ GetGlyphCount()

size_t ICUParagraphLayout::ICUVisualRun::GetGlyphCount ( ) const
inlineoverridevirtual

Get the number of glyphs.

Returns
The number of glyphs for this run.

Implements ParagraphLayouter::VisualRun.

Definition at line 80 of file gfx_layout_icu.cpp.

◆ GetGlyphs()

std::span< const GlyphID > ICUParagraphLayout::ICUVisualRun::GetGlyphs ( ) const
inlineoverridevirtual

Get the glyphs to draw.

Returns
The glyphs.

Implements ParagraphLayouter::VisualRun.

Definition at line 74 of file gfx_layout_icu.cpp.

◆ GetGlyphToCharMap()

std::span< const int > ICUParagraphLayout::ICUVisualRun::GetGlyphToCharMap ( ) const
inlineoverridevirtual

The offset for each of the glyphs to the character run that was passed to the Layouter.

Returns
The offsets.

Implements ParagraphLayouter::VisualRun.

Definition at line 76 of file gfx_layout_icu.cpp.

◆ GetLeading()

int ICUParagraphLayout::ICUVisualRun::GetLeading ( ) const
inlineoverridevirtual

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

Returns
The leading in pixels.

Implements ParagraphLayouter::VisualRun.

Definition at line 79 of file gfx_layout_icu.cpp.

References Font::fc, and FontCache::GetHeight().

◆ GetPositions()

std::span< const Position > ICUParagraphLayout::ICUVisualRun::GetPositions ( ) const
inlineoverridevirtual

Get the positions for each of the glyphs.

Returns
The glyph positions.

Implements ParagraphLayouter::VisualRun.

Definition at line 75 of file gfx_layout_icu.cpp.

Field Documentation

◆ font

const Font* ICUParagraphLayout::ICUVisualRun::font
private

Definition at line 69 of file gfx_layout_icu.cpp.

◆ glyph_to_char

std::vector<int> ICUParagraphLayout::ICUVisualRun::glyph_to_char
private

Definition at line 66 of file gfx_layout_icu.cpp.

◆ glyphs

std::vector<GlyphID> ICUParagraphLayout::ICUVisualRun::glyphs
private

Definition at line 64 of file gfx_layout_icu.cpp.

◆ positions

std::vector<Position> ICUParagraphLayout::ICUVisualRun::positions
private

Definition at line 65 of file gfx_layout_icu.cpp.

◆ total_advance

int ICUParagraphLayout::ICUVisualRun::total_advance
private

Definition at line 68 of file gfx_layout_icu.cpp.


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