OpenTTD Source 20260917-master-gec444f7315
CoreTextParagraphLayout::CoreTextVisualRun Class Reference

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

Inheritance diagram for CoreTextParagraphLayout::CoreTextVisualRun:
ParagraphLayouter::VisualRun

Public Member Functions

 CoreTextVisualRun (CTRunRef run, Font *font, const CoreTextParagraphLayoutFactory::CharType *buff)
 CoreTextVisualRun (CoreTextVisualRun &&other)=default
std::span< const GlyphID > GetGlyphs () const override
 Get the glyphs to draw.
std::span< const Position > GetPositions () 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 Font * GetFont () 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< GlyphID > glyphs
std::vector< Position > positions
std::vector< int > glyph_to_char
int total_advance = 0
Font * font

Detailed Description

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

Definition at line 45 of file string_osx.cpp.

Constructor & Destructor Documentation

◆ CoreTextVisualRun()

CoreTextParagraphLayout::CoreTextVisualRun::CoreTextVisualRun ( CTRunRef run,
Font * font,
const CoreTextParagraphLayoutFactory::CharType * buff )

Definition at line 207 of file string_osx.cpp.

Member Function Documentation

◆ GetAdvance()

int CoreTextParagraphLayout::CoreTextVisualRun::GetAdvance ( ) const
inline

Definition at line 65 of file string_osx.cpp.

◆ GetFont()

const Font * CoreTextParagraphLayout::CoreTextVisualRun::GetFont ( ) const
inlineoverridevirtual

Get the font.

Returns
The font used for this run.

Implements ParagraphLayouter::VisualRun.

Definition at line 62 of file string_osx.cpp.

◆ GetGlyphCount()

size_t CoreTextParagraphLayout::CoreTextVisualRun::GetGlyphCount ( ) const
inlineoverridevirtual

Get the number of glyphs.

Returns
The number of glyphs for this run.

Implements ParagraphLayouter::VisualRun.

Definition at line 64 of file string_osx.cpp.

◆ GetGlyphs()

std::span< const GlyphID > CoreTextParagraphLayout::CoreTextVisualRun::GetGlyphs ( ) const
inlineoverridevirtual

Get the glyphs to draw.

Returns
The glyphs.

Implements ParagraphLayouter::VisualRun.

Definition at line 58 of file string_osx.cpp.

◆ GetGlyphToCharMap()

std::span< const int > CoreTextParagraphLayout::CoreTextVisualRun::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 60 of file string_osx.cpp.

◆ GetLeading()

int CoreTextParagraphLayout::CoreTextVisualRun::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 63 of file string_osx.cpp.

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

◆ GetPositions()

std::span< const Position > CoreTextParagraphLayout::CoreTextVisualRun::GetPositions ( ) const
inlineoverridevirtual

Get the positions for each of the glyphs.

Returns
The glyph positions.

Implements ParagraphLayouter::VisualRun.

Definition at line 59 of file string_osx.cpp.

Field Documentation

◆ font

Font* CoreTextParagraphLayout::CoreTextVisualRun::font
private

Definition at line 52 of file string_osx.cpp.

◆ glyph_to_char

std::vector<int> CoreTextParagraphLayout::CoreTextVisualRun::glyph_to_char
private

Definition at line 49 of file string_osx.cpp.

◆ glyphs

std::vector<GlyphID> CoreTextParagraphLayout::CoreTextVisualRun::glyphs
private

Definition at line 47 of file string_osx.cpp.

◆ positions

std::vector<Position> CoreTextParagraphLayout::CoreTextVisualRun::positions
private

Definition at line 48 of file string_osx.cpp.

◆ total_advance

int CoreTextParagraphLayout::CoreTextVisualRun::total_advance = 0
private

Definition at line 51 of file string_osx.cpp.


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