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

Pango-backed text layout implementation. More...

#include <aeongui/PangoTextLayout.hpp>

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

Public Member Functions

 PangoTextLayout ()
 Default constructor. Creates a layout with default font settings.
 ~PangoTextLayout () override
 Destructor. Releases Pango resources.
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 of the layout.
double GetCharOffsetX (long aIndex) const override
 Get the x-offset of a character at the given byte index.
PangoLayout * GetPangoLayout () const
 Access the underlying PangoLayout for advanced use.
Public Member Functions inherited from AeonGUI::TextLayout
virtual ~TextLayout ()=0
 Virtual destructor.

Detailed Description

Pango-backed text layout implementation.

Uses PangoLayout and PangoFontDescription to measure and layout text for rendering by a Canvas.

Member Function Documentation

◆ GetBaseline()

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

Get the baseline offset from the top of the layout.

Returns
Baseline position in CSS pixels.

Implements AeonGUI::TextLayout.

◆ GetCharOffsetX()

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

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

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

Implements AeonGUI::TextLayout.

◆ GetPangoLayout()

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

Access the underlying PangoLayout for advanced use.

Returns
Pointer to the PangoLayout.

◆ GetTextHeight()

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

Get the logical height of the laid-out text.

Returns
Height in CSS pixels.

Implements AeonGUI::TextLayout.

◆ GetTextWidth()

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

Get the logical width of the laid-out text.

Returns
Width in CSS pixels.

Implements AeonGUI::TextLayout.

◆ SetFontFamily()

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

Set the font family.

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

Implements AeonGUI::TextLayout.

◆ SetFontSize()

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

Set the font size.

Parameters
aSizeFont size in CSS pixels.

Implements AeonGUI::TextLayout.

◆ SetFontStyle()

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

Set the font style.

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

Implements AeonGUI::TextLayout.

◆ SetFontWeight()

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

Set the font weight.

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

Implements AeonGUI::TextLayout.

◆ SetText()

void AeonGUI::PangoTextLayout::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: