AeonGUI
A portable video game graphic user interface library.
Loading...
Searching...
No Matches
AeonGUI::SkiaTextLayout Class Reference

Skia-backend text layout implementation. More...

#include </d/a/AeonGUI/AeonGUI/include/aeongui/SkiaTextLayout.hpp>

Inheritance diagram for AeonGUI::SkiaTextLayout:
[legend]
Collaboration diagram for AeonGUI::SkiaTextLayout:
[legend]

Public Member Functions

void SetText (const std::string &aText) override
 Set the text content to lay out.
void SetFontFamily (const std::string &aFamily) override
 Set the font family.
void SetFontSize (double aSize) override
 Set the font size.
void SetFontWeight (int aWeight) override
 Set the font weight.
void SetFontStyle (int aStyle) override
 Set the font style.
double GetTextWidth () const override
 Get the logical width of the laid-out text.
double GetTextHeight () const override
 Get the logical height of the laid-out text.
double GetBaseline () const override
 Get the baseline offset from the top.
double GetCharOffsetX (long aIndex) const override
PangoLayout * GetPangoLayout () const
 Get the underlying PangoLayout.
Public Member Functions inherited from AeonGUI::TextLayout
virtual ~TextLayout ()=0
 Virtual destructor.

Detailed Description

Skia-backend text layout implementation.

Uses PangoLayout backed by PangoFT2 for text measurement and layout.

Member Function Documentation

◆ GetBaseline()

double AeonGUI::SkiaTextLayout::GetBaseline ( ) const
overridevirtual

Get the baseline offset from the top.

Returns
Baseline in CSS pixels.

Implements AeonGUI::TextLayout.

◆ GetCharOffsetX()

double AeonGUI::SkiaTextLayout::GetCharOffsetX ( long aIndex) const
overridevirtual

Get the x-offset of the character at the given index.

Parameters
aIndexUTF-8 byte index.
Returns
x offset in CSS pixels.

Implements AeonGUI::TextLayout.

◆ GetPangoLayout()

PangoLayout * AeonGUI::SkiaTextLayout::GetPangoLayout ( ) const

Get the underlying PangoLayout.

Returns
Pointer to the PangoLayout.

◆ GetTextHeight()

double AeonGUI::SkiaTextLayout::GetTextHeight ( ) const
overridevirtual

Get the logical height of the laid-out text.

Returns
Height in CSS pixels.

Implements AeonGUI::TextLayout.

◆ GetTextWidth()

double AeonGUI::SkiaTextLayout::GetTextWidth ( ) const
overridevirtual

Get the logical width of the laid-out text.

Returns
Width in CSS pixels.

Implements AeonGUI::TextLayout.

◆ SetFontFamily()

void AeonGUI::SkiaTextLayout::SetFontFamily ( const std::string & aFamily)
overridevirtual

Set the font family.

Parameters
aFamilyFont family name (e.g. "sans-serif").

Implements AeonGUI::TextLayout.

◆ SetFontSize()

void AeonGUI::SkiaTextLayout::SetFontSize ( double aSize)
overridevirtual

Set the font size.

Parameters
aSizeFont size in CSS pixels.

Implements AeonGUI::TextLayout.

◆ SetFontStyle()

void AeonGUI::SkiaTextLayout::SetFontStyle ( int aStyle)
overridevirtual

Set the font style.

Parameters
aStyle0 = normal, 1 = italic, 2 = oblique.

Implements AeonGUI::TextLayout.

◆ SetFontWeight()

void AeonGUI::SkiaTextLayout::SetFontWeight ( int aWeight)
overridevirtual

Set the font weight.

Parameters
aWeightCSS font weight (400 = normal, 700 = bold).

Implements AeonGUI::TextLayout.

◆ SetText()

void AeonGUI::SkiaTextLayout::SetText ( const std::string & aText)
overridevirtual

Set the text content to lay out.

Parameters
aTextUTF-8 text string.

Implements AeonGUI::TextLayout.


The documentation for this class was generated from the following files:
  • /d/a/AeonGUI/AeonGUI/include/aeongui/SkiaTextLayout.hpp
  • /d/a/AeonGUI/AeonGUI/core/SkiaTextLayout.cpp